text stringlengths 14 410k | label int32 0 9 |
|---|---|
public InternetHeaders getControlHeaders ()
{
final InternetHeaders headers = new InternetHeaders();
headers.addHeader(_name.getField(), _name.getFieldValue());
headers.addHeader(_version.getField(), _version.getFieldValue());
headers.addHeader(_section.getField(), _section.getFiel... | 4 |
public void Update() {
//the following all increase the speed as a key is pressed
// Calculating speed for moving up
if (Canvas.keyboardKeyState(KeyEvent.VK_W)) {
if (speedY >= TOP_SPEED * - 0.5) {
speedY -= speedAccelerating;
} else {
sp... | 8 |
double getCharge() {
double result = 0;
switch (getMovie().getPriceCode()) {
case Movie.REGULAR:
result += 2;
if (getDaysRented() > 2)
result += (getDaysRented() - 2) * 1.5;
break;
case Movie.NEW_RELEASE:
result += getDaysRented() * 3;
break;
case Movie.CHILDRENS:
result += 1.5;
if (getDaysRented() > 3)
r... | 5 |
public static String encrypt(final String text) {
String encryptedText = null;
TripleDesCipher cipher = new TripleDesCipher();
cipher.setKey("GWT_DES_KEY_16_BYTES".getBytes());
try {
encryptedText = cipher.encrypt(String.valueOf(text));
} catch (DataLengthException e1) {
e1.printStackTrace();
/... | 3 |
@SuppressWarnings ("unchecked" )
public ReflectMethod( Method method )
{
Class<?>[] parameters = method.getParameterTypes();
int calculatedMaxSize = 0;
reflects = new Reflect[parameters.length];
for (int i = 0; i < parameters.length; i++)
{
Reflect<Object> r... | 5 |
@Override
public boolean equals(Object o)
{
Point other = (Point)o;
return x==other.x && y==other.y;
} | 1 |
private int getBowlScore(int[] bowl) {
int score = 0;
for (int i = 0; i < NFRUIT; i++) {
score += bowl[i] * mPreferences[i];
}
return score;
} | 1 |
public static double[] doLinearRegressionFromTo(int start,int end,double[][] args) //input int start, int end
{ //input double[1]=array of prices
double[] answer = new double[3];
int ... | 5 |
public void add(T element) {
// create a node for that element
Node z = new Node();
z.key = element;
Node y = null;
Node x = root; // the root
// loop while x is not null
while (x != null) {
// set y to x
y = x;
// compare the key of the element to be inserted with x
int compare = z.key.comp... | 6 |
@Test
public void delMinReturnsCorrectOrderWithRandomInput() {
Random r = new Random();
int[] expected = new int[100];
for (int i = 0; i < 100; i++) {
int randomInteger = r.nextInt(5000);
h.insert(new Vertex(0, randomInteger));
expected[i] = randomInteger;... | 2 |
public void doDelimitedWithPZMapErrors() {
try {
final String mapping = ConsoleMenu.getString("Mapping ", DelimitedWithPZMapErrors.getDefaultMapping());
final String data = ConsoleMenu.getString("Data ", DelimitedWithPZMapErrors.getDefaultDataFile());
DelimitedWithPZMapErro... | 1 |
@Override
public List<Membre> findAll() {
List<Membre> listM = new ArrayList<Membre>();
Statement st = null;
ResultSet rs = null;
try {
st = this.connect().createStatement();
rs = st.executeQuery("select * from Membre");
System.out.println("recherc... | 5 |
@Override
public List<String> logInBuyer(String name, String passwd) {
loggerMediator.info("Log in buyer " + name);
List<String> serviceList;
stateMgr.setBuyerState();
serviceList = stateMgr.getServiceList(name);
if (serviceList!= null && !serviceList.isEmpty())
if (!logInUser(name, passwd, UserTypes.... | 3 |
public String getSector() {
return Sector;
} | 0 |
public boolean execGo(Direction d) {
Command c = new GoCommand(d);
if(c != null && c.execute()) {
saveGameState(c);
return true; //moved
}
return false; //not moved
} | 2 |
private String getName() {
return "RemoteServerConnection [" + name + ", Port: " + port + "]";
} | 0 |
private void tbListaClientesKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tbListaClientesKeyReleased
System.out.println("Clicando");
if(evt.getKeyCode() == KeyEvent.VK_SPACE ){
try {
concluido = true;
this.dispose();
} catch... | 5 |
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
case 1: return statement_list_sempred((Statement_listContext)_localctx, predIndex);
case 8: return or_expression_sempred((Or_expressionContext)_localctx, predIndex);
case 9: return and_expression_sempred((And_ex... | 9 |
private void chooseFile(final int whichFile) {
final JFileChooser fileChooser = new JFileChooser();
fileChooser.showOpenDialog(this);
File selectedFile = fileChooser.getSelectedFile();
if (selectedFile != null) {
if (whichFile == 1) {
targetBehaviorTxt.setText(fileChooser.getSelectedFile().getAbsolutePat... | 3 |
private void InitializeComponents()
{
//Window Settings
setSize(500, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
//Main Panel
pnlLobby = new JPanel(new GridLayout(1, 1));
pnlLobby.setBackground(Color.WHITE);
this.add(pnlLobby);
... | 6 |
public static void doEverything(int size, float scale, final int initialDelay, final int generationGap, final int redrawGap, final AutomataSheet firstSheet)
{
final CellFrame frame = new CellFrame(firstSheet);
frame.setScale(scale);
frame.setVisible(true);
final Switch isRunning = new Switch... | 5 |
private static void addAlterStatistics(final PrintWriter writer,
final PgTable oldTable, final PgTable newTable,
final SearchPathHelper searchPathHelper) {
@SuppressWarnings("CollectionWithoutInitialCapacity")
final Map<String, Integer> stats = new HashMap<String, Integer>();
... | 9 |
@Override
public void run() {
for (int i = 0; i < COUNT; i++) {
System.out.println("Loop:" + name + ", iteration:" + i + ".");
}
} | 1 |
@RequestMapping(method = RequestMethod.GET)
public String generalTree(ModelMap map) {
if (Feat.getFeats().isEmpty()) {
Feat.loadFromSQL();
}
ArrayList<FeatNode> nodes = new ArrayList<FeatNode>();
int count = 0;
if (FeatNode.getNodes().isEmpty()) {
... | 7 |
public static boolean selectItem(final int index) {
if (index < 0)
return false;
WidgetChild[] boxes = getList(BOX_LIST);
return getCurrentIndex() == index || index < boxes.length && boxes[index].getTextureId() != -1
&& boxes[index].click(true) && new TimedCondition(1400) {
@Override
public bool... | 5 |
public void updateUI()
{
super.updateUI();
if (titleLabel != null) {
updateHeader();
}
} | 1 |
@Test
public void EnsurePathIsParsedCorrectly() {
Path path = new Path("alan/likes/warbyparker");
String patharray[] = path.getPathArray();
assertEquals(3, patharray.length);
assertEquals("alan", patharray[0]);
assertEquals("likes", patharray[1]);
assertEquals("warbyparker", patharray[2]);
} | 0 |
private HashSet<String> getMatchesOutputSet(Vector<String> tagSet, String baseURL) {
HashSet<String> retSet=new HashSet<String>();
Iterator<String> vIter=tagSet.iterator();
while (vIter.hasNext()) {
String thisCheckPiece=vIter.next();
Iterator<Pattern> pIter=patternSet.iterator();
boo... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
String action = e.getActionCommand();
JButton buton;
switch (action) {
case "enviar":
AudioChatService.escribirMensaje();
break;
case "cambiarNombre":
AudioChatService.cambiarNombre();
break;
case "cambiarNombreCanal":
AudioChatService.... | 6 |
private void setRange(Range newRange) {
if (range != null) {
range.clearDisplay();
}
range = newRange;
if (range != null) {
range.display();
}
} | 2 |
public int findEstimate(int k) {
for (int i = 0; i < msgs.length; i++) {
if (msgs[i] != null) {
if (msgs[i].getDeltaP()[k] != -1) {
return msgs[i].getDeltaP()[k];
}
}
}
return -1;
} | 3 |
@Override
public void computeFitness() {
this.fitness = 0.0;
AiInterface opponent = MinichessBeatRandCreature.globalRandomAi;
boolean playAsWhite = GPConfig.getRandGen().nextBoolean();
int numOpponents = GPConfig.getTournySize() - 1;
for (int i = 0; i < numOpponents; i... | 7 |
private static String mangle(String nm) {
StringBuilder buf = new StringBuilder();
for(int i = 0; i < nm.length(); i++) {
char c = nm.charAt(i);
if(c == '/')
buf.append("_");
else
buf.append(c);
}
return(buf.toString());
} | 2 |
private static String getTime(String time) {
time = time.split(" ")[3];
time = (Integer.parseInt(time.split(":")[0]) > 12 ? Integer.parseInt(time.split(":")[0])-12 : time.split(":")[0]) + ":" +time.split(":")[1]
+(Integer.parseInt(time.split(":")[0]) > 12 ? " PM" : " AM");
retur... | 2 |
private void convertRGBtoHSV() {
float r;
float g;
float b;
float max, min;
float hsv[] = new float[3];
float delta;
for (int i = 0; i < imageSize; i++) {
r = redPixel[i];
g = greenPixel[i];
b = bluePixel[i];
r /= 25... | 6 |
private void setUpLabelImage(JLabel label, String image, int width, int height){
BufferedImage titleImage;
try{
if(bookLayout == 1){
titleImage = ImageIO.read(new File("resources/buttons/"+image));
}
else{
titleImage = ImageIO.read(new File("resources/buttons" +bookLayout + "/"+image));
}
Ima... | 2 |
private void readExcludedPackages() {
fExcluded= new Vector(10);
for (int i= 0; i < defaultExclusions.length; i++)
fExcluded.addElement(defaultExclusions[i]);
InputStream is= getClass().getResourceAsStream(EXCLUDED_FILE);
if (is == null)
return;
Properties p= new Properties();
try {
p.load(i... | 8 |
public
JobMaster (JobType whatToDo, AbstractPage rootPage, int threadsNumber) {
if (threadsNumber <= 0)
threadsNumber = CORETHREADS_NUMBER;
executor = Executors.newFixedThreadPool(threadsNumber);
assert (executor instanceof ThreadPoolExecutor);
submittedPairs = new ConcurrentLinkedQueue<>();
this.whatT... | 1 |
public void pidWrite(double output) {
set(output);
} | 0 |
public void transceive() throws IOException {
String received;
br = new BufferedReader(new InputStreamReader(newSS.getInputStream()));
received = br.readLine();
String[] temp;
PrintWriter pw = new PrintWriter(newSS.getOutputStream(), true);
switch (received.charAt(0)) {
case ('1'):
pw.println(imdb.ge... | 5 |
protected Resources() {
this.bagFields = new HashSet<Field>();
for (Field f : getClass().getFields()) {
if (Modifier.isPublic(f.getModifiers()) && ResourceBag.class.isAssignableFrom(f.getType())) {
this.bagFields.add(f);
}
}
} | 3 |
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Type gameboard config:");
String input = keyboard.nextLine();
Game game = new Game(input);
System.out.println("Game initialized");
System.out.println();
System.out.println("Use the following ke... | 7 |
public Markers randomIntervals(int numIntervals, int maxStart, int maxLength, int numChromo) {
Markers ints = new Markers();
for (int ch = 1; ch <= numChromo; ch++) {
for (int i = 0; i < numIntervals; i++) {
int start = rand.nextInt(maxStart);
int end = Math.min(start + rand.nextInt(maxLength), maxStart... | 2 |
public boolean step()
{
board[knight.y][knight.x] = VISITED;
Point[] possibleMoves = getPossibleMoves(knight.x, knight.y);
Random random = new Random(System.nanoTime());
if (possibleMoves.length > 0)
{
Point nextMove = possibleMoves[0];
int numOfPossibleMoves = getNumberOfPossibleMov... | 5 |
private Position getTertiaryPowerFailurePosition(Position secondaryPos, int directionInt) {
// Calculate T1 Position
final Position squareOne = (Direction.values()[directionInt]).newPosition(secondaryPos);
// Calculate T2 Position
final int dirIntTwo = (directionInt - 1 < 0) ? Direction.values().length - 1 :... | 2 |
public void visitIf(If node, String args){
pp(indent() + (args.compareTo("elsif") == 0 ? "ELSIF " : "IF "), node.getStyle());
node.getCond().accept(this, args);
pp(" THEN\n", node.getStyle());
n++;
node.getIfBlock().accept(this, args);
n--;
if (node.getElseBlock() != null) {
if(node.getElseBlock().getC... | 4 |
public static SwagStack stringToSwagStack(String swagString) {
String[] swagPieces = swagString.split(",");
SwagStack swagStack = new SwagStack(Integer.valueOf(swagPieces[0]));
if (!swagPieces[1].equals("0")) {
if (swagPieces[1].contains("-")) {
Stri... | 5 |
@Override
public void execute() {
long next;
synchronized (this) {
while (frequence.addAndGet(0) <= 0) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
next = System.currentTimeMillis() + 1000 / frequence.get();
getSimulateur().actionPerformed(null, ... | 2 |
private void startDialog() {
isRunning = true;
checkFiles(); //Checks if all Data directories exist.
dmPhase = new DMPhase(); //Creates the DMPhase, which loads all data
//Goes through the StartDialog.
do {
phase.setPhaseResult(this);
phase = phase.nextPhase(this);
} while(!userLoggedIn && isRunning);... | 4 |
public void busquedaDesordenada(T x){
Nodo<T> q = this.p;
while(q.getLiga() != null && q.getValor() != x){
q = q.getLiga();
}
if(q == null){
System.out.println("No se encontro el valor");
}else{
System.out.println("Se encontro el valor dentro de la lista");
}
} | 3 |
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if(command.getName().equalsIgnoreCase("fchat")){
Player player = null;
if(sender instanceof Player)
player = (Player) sender;
if(player != null){
if(!plugin.hasPermission(player, "default... | 8 |
private void nextTurn() {
// Used to switch turns. Called each time a valid move is made.
if (hasWon(turn)) { // Check to see if the move the current player made was a winning move.
gameOver = true; // If it was, then set gameOver to true;
sendWin(turn); // Also, display a window informing the user(s) of wha... | 6 |
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
String pathName = args[0]; // takes in the path name from the command line
File ipAddresses = new File(pathName);
Scanner input = new Scanner(ipAddresses);
MyCountingLinkedLists<String> list = new MyCountingLinkedLists<Str... | 7 |
public boolean isEnded() {
if (endedInt == "1") {
return true;
} else {
return false;
}
} | 1 |
@Override
public void run() {
while (true) {
try {
UpdChecker checker = new UpdChecker();
Map<String, String> updates = checker.check();
if (updates.size() > 0) {
//SMS sending quantity of new entries at sl... | 4 |
public IrcClient(AprilonIrc plugin, String name) { this.Parent = plugin; this.Name = name; } | 0 |
public boolean insertEntry(String name, String file)
{
System.out.println(this.getClass().toString()+"::insertEntry("+name+","+file+")");
fileName = makeSQLCompatible(file);
// if file already in list, stop
if(getIndexOf(file) != -1)return true;
//System.out.println("In insert: ar... | 7 |
public Iterator getDictKeys() throws IOException {
if (type == INDIRECT) {
return dereference().getDictKeys();
} else if (type == DICTIONARY || type == STREAM) {
return ((HashMap) value).keySet().iterator();
}
// wrong type
return new ArrayList().iterator... | 3 |
protected void actionPerformed(GuiButton par1GuiButton)
{
if (!par1GuiButton.enabled)
{
return;
}
if (par1GuiButton.id == 5)
{
if (Minecraft.getOs() == EnumOS.MACOS)
{
try
{
System.out.pr... | 9 |
public void handleShading(int intensity, int falloff, int lightX,
int lightY, int lightZ) {
for (int triangle = 0; triangle < triangleCount; triangle++) {
int x = triangleX[triangle];
int y = triangleY[triangle];
int z = triangleZ[triangle];
if (triangleDrawType == null) {
int colour = triangleColo... | 6 |
public static void maxHeapify(int[] A, int i, int heapSize){
int left = 2 * i + 1;
int right = 2 * i + 2;
//find the largest in A[i],A[left],A[right]
int largest = i;
if(left < heapSize && A[left] > A[largest]){
largest = left;
}
if(right < heapSize && A[right] > A[largest]){
largest = right;
}... | 5 |
public static void main(String[] args) {
String fullQuanlifiedFileName ="D:\\MyEclipseGen.java";
// "src/com/xin/A.java";
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
try {
FileOutputStream err = new FileOutputStream("D:\\err.txt");
int compilationResult = compiler.run(null... | 2 |
private boolean normal(Publish p) {
boolean sent = false;
List<SubscriberParent> list = p.mapping.get(p.message.getClass());
if (list == null) {
return false;
}
for (SubscriberParent sp : list) {
Subscriber<?> s = sp.getSubscriber();
if (!predicateApplies(s, p.message)) {
continue;
}
s.rece... | 4 |
private StopRangeComparator()
{
} | 0 |
private boolean simula (int indexIniziale) {
// indica se e' avvenuto un loop infinito:
boolean loop = false;
// cellaCorrente assume il valore della cella da cui deve iniziare la simulazione della macchina
this.indexCorrente = indexIniziale;
while (this.indexCo... | 3 |
public void run() {
while (clientSocket.isConnected()) {
try {
BufferedReader inputStream = new BufferedReader(
new InputStreamReader(clientSocket.getInputStream()));
String message = inputStream.readLine();
System.out
.println("[Server] Message received : " + message);
if (mess... | 4 |
public static String escape(String string) {
StringBuilder sb = new StringBuilder(string.length());
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break... | 6 |
@RequestMapping(value = "/users.htm", method = RequestMethod.GET)
public ModelAndView setupListForm(
@RequestParam(required = false, value = "tool") String tool,
HttpServletRequest request,
ModelMap model) {
String vue = Consts.INDEX_VUE;
List<User> users = null;
... | 9 |
public void press(String msg, boolean cap){
if(!selected) return;
if(text.length() >= length) return;
if(cap) msg = msg.toUpperCase();
text = text + msg;
wait = 10;
} | 3 |
private void buy(Player hero) {
System.out.println("What will you buy? Current Gold:" + hero.getGold());
//Prints the inventory of the shop
String inven = "";
for (int i = 0; i < getInventory().length; i++) {
inven += "[" + i + "]" + getInventory()[i].getName() + "(" + getIn... | 7 |
public void setImageLevel(TransparentImageLevel lev, int index) {
if (index < 0 || index > MAX_IMG_LEVELS) {
throw new IllegalArgumentException("Bad index for setImageLevel:" + index);
}
if (imgLevels[index] == null && lev != null) {
// new one added
numImgLev... | 6 |
@Inject
public void schedule( Scheduler scheduler )
throws Exception
{
if ( cronExpression == null && trigger == null )
{
throw new ProvisionException( format( "Impossible to schedule Job '%s' without cron expression",
jobClas... | 9 |
public void move(int xa, int ya) {
if (xa != 0 && ya != 0) {
move(xa, 0);
move(0, ya);
return;
}
if (xa > 0) setDir(1);
if (xa < 0) setDir(3);
if (ya > 0) setDir(2);
if (ya < 0) setDir(0);
if (!collision(xa, ya)) {
x += xa;
y += ya;
xL += xa;
yT += ya;
xR += xa;
yB += ya;
}... | 7 |
private ArrayList<String> extractNGrams() {
ArrayList<String> list = new ArrayList<String>();
NGram ngram = new NGram();
for(int i=0;i<text.length();++i) {
ngram.addChar(text.charAt(i));
for(int n=1;n<=NGram.N_GRAM;++n){
String w = ngram.get(n);
... | 4 |
private Main(int rack_size, Player ai) throws Exception{
Main.rack_size = rack_size;
WIN_HEIGHT = rack_size*Card.height+(rack_size-1)*Board.card_pad+2*Board.border_pad_ver+50;
if (WIN_HEIGHT < 300) WIN_HEIGHT = 400;
player_ai = ai;
player_human = new PlayerGUI(this);
game = Game.create(
new Player[]{p... | 2 |
public static Class<? extends TrapEvent> fromString(String s) {
if(s.equalsIgnoreCase("attack"))
return TrapEventAttack.class;
else if(s.equalsIgnoreCase("lpincrease"))
return TrapEventLPIncrease.class;
else if(s.equalsIgnoreCase("lpdecrease"))
return TrapEventLPDecrease.class;
else if(s.equalsIgnoreCa... | 6 |
public long askID() {
System.out.println(ASK_ID);
if (terminal.hasNext(ID_PATTERN)) {// verificamos que sea un id valido
return Long.parseLong(terminal.nextLine());
} else if (terminal.hasNext(ID_PATTERN_SMALL))// para ahorrar tiempo se usan ids de tres digitos
{
... | 2 |
static Object getAnnotationType(Class clz, ClassPool cp,
AnnotationsAttribute a1, AnnotationsAttribute a2)
throws ClassNotFoundException
{
Annotation[] anno1, anno2;
if (a1 == null)
anno1 = null;
else
anno1 = a1.getAnnotati... | 8 |
@Test
public void testCancelAllJobs() {
System.out.println("cancelAllJobs");
final Counter counter = new Counter();
c.setAssignmentListener(new AssignmentListener() {
boolean run = true;
@Override
public void receiveTask(Assignment task) {
... | 8 |
public SimulationEvent(int eventType, Object eventData)
{
if (eventType != EVENT_SIM_STARTED
&& eventType != EVENT_SIM_DONE
&& eventType != EVENT_SIM_CANCELLED
&& eventType != EVENT_SIM_ERROR
&& eventType != EVENT_SIM_PROGRESS
) {
throw new... | 5 |
public void laufen(int geschwindigkeit, int delta) {
// Macht Bewegung auf Y Ebene möglich
y_Pos += speed_v;
// Hier steht die Bewegung auf horizontaler Ebene.
// Pfeiltaste links
if (steuerung.isKeyDown(Input.KEY_A)) {
x_Pos = x_Pos - geschwindigkeit;
}
// Pfeiltaste rechts
if (steuerung.isKeyDown... | 9 |
private static int decode4to3(
byte[] source, int srcOffset,
byte[] destination, int destOffset, int options ) {
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Source array was null." );
} // end if
... | 8 |
public void initToNull()
{
for(int j = 0; j < anInt437; j++)
{
for(int k = 0; k < anInt438; k++)
{
for(int i1 = 0; i1 < anInt439; i1++)
groundArray[j][k][i1] = null;
}
}
for(int l = 0; l < anInt472; l++)
{
for(int j1 = 0; j1 < anIntArray473[l]; j1++)
aClass47ArrayArray474[l][j1] = ... | 7 |
public Medicament() {
} | 0 |
public void award_bonus(BigInteger threshold, BigInteger bonus) {
if (getBalance().compareTo(threshold) >= 0)
deposit(bonus);
} | 1 |
public void setId(String id) {
questId = Integer.parseInt(id);
} | 0 |
@Test
public void haltInstrInvalidOpcodeTest() {
try {
instr = new HaltInstr(Opcode.LOAD);
}
catch (IllegalStateException e) {
e.getMessage();
}
assertNull(instr); //Instruction should only be instantiated with HALT opcode
} | 1 |
public boolean jsFunction_waitStartMoveGob(int gob, int timeout) {
deprecated();
int curr = 0; if(timeout == 0) timeout = 10000;
while(!JSBotUtils.isMoving(gob))
{
if(curr > timeout)
return false;
Sleep(25);
curr += 25;
}
return true;
} | 3 |
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
// array of coordinate points of polygon 1 (region 1)
int [] polygon1 = new int [] {10, height/2, 9*width/16, 10, 9*width/16, height-10};
Region region1 = new Region(device);
region1.a... | 7 |
public static void processWords(String str) throws FileNotFoundException
{
//String str="<DOC><DOCNO>1</DOCNO><TITLE>experimental investigation of the aerodynamics of awing in a slipstream .</TITLE><AUTHOR>brenckman,m.</AUTHOR><BIBLIO>j. ae. scs. 25, 1958, 324.</BIBLIO><TEXT> an experimental study of a wing in a pr... | 7 |
protected BallNode mergeNodes(Vector<TempNode> list, int startIdx, int endIdx)
throws Exception {
for(int i=0; i<list.size(); i++) {
TempNode n = (TempNode) list.get(i);
n.anchor = calcPivot(n.points, new MyIdxList(), m_Instances);
n.radius = calcRadius(n.points, new MyIdxList(), n.anchor... | 7 |
public String disparar() {
String resultado = "";
if(numElementos > 0 ) {
Random rnd = new Random();
int fila = rnd.nextInt(NUM_FILAS);
int columna = rnd.nextInt(NUM_COLUMNAS);
int porcentaje = rnd.nextInt(100);
NaveAlien n1 = listaNavesAliens[fila][columna];
if(n1 != null ) {
... | 6 |
public AccountServiceError addUser(String login, String password) {
if (isConnectionClosed())
openConnection();
if (isConnectionClosed())
return new AccountServiceError(AccountServiceError.Type.DB_noConnection);
UserDataSetDAO dao = new UserDataSetDAO(dbconn);
... | 5 |
public String getEssensrationText()
{
String ration = "";
if ( this.essensration == 1 )
ration = "halb";
if ( this.essensration == 2 )
ration = "voll";
if ( this.essensration == 4 )
ration = "doppelt";
return ration;
} | 3 |
public static File showOpenFileDialog(Frame parentFrame, String title){
FileDialog fileDialog = new FileDialog(parentFrame, title);
fileDialog.setIconImage(MAIN_ICON.getImage());
fileDialog.setDirectory(HOME_DIRECTORY);
fileDialog.setVisible(true);
String directoryName = fileDial... | 2 |
private void writeOutput(List<List<Gate>> layersOfGates) {
BufferedWriter fbw = null;
try {
fbw = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(outputFile), charset));
int[] intHeaders = circuitParser.getOutputHeader(layersOfGates);
String header = "";
for (int i = 0; i < intHead... | 6 |
public Object handle(Message req) throws Exception {
if(server_obj == null) {
log.error(Util.getMessage("NoMethodHandlerIsRegisteredDiscardingRequest"));
return null;
}
if(req == null || req.getLength() == 0) {
log.error(Util.getMessage("MessageOrMessageBuffe... | 7 |
public String getLibelle() {
return libelle;
} | 0 |
public HunterPanel(World world) {
this.model = world.getHunterList();
this.setBorder(new TitledBorder("Hunter"));
this.setLayout(new FlowLayout(FlowLayout.LEFT));//new BorderLayout());
this.setPreferredSize(new Dimension(250,350));
this.setBounds(0, 0, 250, 350);
//this.setSize(250,350);
rowData = ne... | 1 |
public String winner()
{
int blackcount = 0;
int whitecount = 0;
for (int[] row : board)
{
for (int value : row)
{
if(value == B)
blackcount++;
else if(value == W)
whitecount++;
... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.