method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e78bb312-c87e-4436-ae6e-cff0a73d7986
3
public static void checkForUpdates() { if (isOutdated()) { int browse = JOptionPane.showOptionDialog(new JFrame(), Helper.arrayToString("\n", Refs.OUTDATED), "DonationCalculator", 0, JOptionPane.INFORMATION_MESSAGE, null, new String[] {"Update", "Close"}, "Update"); if (browse == 0) { try { D...
73e5935e-78d6-44be-a672-ecacbbfea735
2
public final void initUI() { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setLayout(new GridLayout(5, 4, 5, 5)); String[] buttons = { "Cls", "Bck", "", "Close", "7", "8", "9", "/", "4", "5", "6", "*", "1", "2", "3", "-", "0", ".", "=", "+" }; f...
3a0f379d-aae9-4fec-b109-658eeea027d6
1
private void rivitTalteen() { while (lukija.hasNext()) { rivit.add(lukija.nextLine()); } }
cd21f7f4-e32a-46a7-84f7-cc27f7c2fb30
1
void sanityCheck() { if (checkCircular) { // val.checkInFieldAccess(); validator.checkOutFieldAccess(); } }
8e735d7a-50ba-4ce4-a500-a0f1babab9d5
7
public String evaluar(Stack stack){ String pop,prueba1,prueba2; int num1,num2,cont; do{ prueba1 = (String)stack.pop(); prueba2 = (String)stack.pop(); if(prueba2!=null){ stack.push(prueba2); stack.push(prueba1); num...
96ef45bf-540a-437f-9553-7af20369d462
3
public boolean isImage() { return this.fileName.toLowerCase().endsWith(".png") || this.fileName.toLowerCase().endsWith(".jpg") || this.fileName.toLowerCase().endsWith(".jpeg") || this.fileName.toLowerCase().endsWith(".gif"); }
f26e5db3-bf28-456a-ac63-ec2d3140a712
8
public int compare(String o1, String o2) { String s1 = (String)o1; String s2 = (String)o2; int thisMarker = 0; int thatMarker = 0; int s1Length = s1.length(); int s2Length = s2.length(); while (thisMarker < s1Length && thatMarker < s2Length) { ...
0d5481fa-5730-4b32-9d14-1b88b3629be5
3
private void collect(Node x, StringBuilder prefix, Queue<String> q) { // TODO Auto-generated method stub if (x == null) return; if (x.val != null) q.add(prefix.toString()); for (char c = 0; c < R; c++) { prefix.append(c); collect(x.next[c], prefix, q); prefix.deleteCharAt(prefix.length() - 1); }...
d55c7d74-661a-4f6c-846b-94ebbeefd884
1
public Vector2 calculate(Vector2 target) { Vector2 toTarget = target.minusOperator(entity.position); float dist = toTarget.length(); if(dist > 0) { final float decelTweaker = 0.3f; float speed = dist / decelTweaker; speed = Math.min(speed, entity.maxSpeed); Vector2 desiredVelocity = toTarget.multiply(...
e6a16fa4-f29b-4239-9c18-5645a3a81626
2
@SuppressWarnings("deprecation") private void addProgram(String text, int type) { int shader = glCreateShader(type); if(shader == 0) { System.err.println("Shader creation failed: Could not find valid memory location when adding shader"); System.exit(1); } glShaderSource(shader, text); glCompil...
91b0f800-6025-4893-a393-07a8ba1c93ba
2
public boolean isPlaying() { boolean playing = false; if (player != null && !player.isComplete()) { playing = true; } return playing; }
96b68680-93f6-4771-bdba-d578191ace03
9
public void Run() { try { this.heartBeatThread.start(); ArrayList<KeyValuePair<Key1, Value1>> inputList = new ArrayList<KeyValuePair<Key1, Value1>>(); for(String path:localInputPaths){ FileInputStream fis = new FileInputStream(path); ObjectInputStream ois = new ObjectInputStream(fis); ArrayList<K...
e35331f7-ef76-44cd-8ca8-7d023cddcd86
7
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column ) { ResultSetTableModel model; Component result; boolean found; result = super.getTableCellRendererComponent( ...
915e9bf3-f5cb-4483-a51d-fe9464bc764d
8
@EventHandler(priority = EventPriority.MONITOR) public void onBlockBreakEvent(BlockBreakEvent event) { if (event.isCancelled()) { logDebug("TH: Block break cancel detected."); return; } logDebug("TH: No cancel detected."); org.bukkit.block.Block block = event....
e9d493e9-795b-474e-b5cd-7d9130ac9965
9
public void run() { try { selector = Selector.open(); ServerSocketChannel serverChannel = ServerSocketChannel.open(); serverChannel.configureBlocking(false); serverChannel.socket().bind( new InetSocketAddress("localhost", READ_PORT)); serverChannel.register(selector, SelectionKey.OP_ACCEPT); wh...
c04ba81b-ca97-456e-b705-ca76b7afc93d
7
private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
8dd36368-75ee-4991-af92-c5725856c9d5
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
68e92e4d-58aa-4aed-9770-5a8ed5e9f125
3
public static Angle fromString(String name) { if (name != null) { for (Angle b : Angle.values()) { if (name.equalsIgnoreCase(b.name)) { return b; } } } return null; }
bac10fb7-7dc2-4668-ad8d-6086674c2d8d
8
final public void Function_process() throws ParseException { /*@bgen(jjtree) Function_process */ SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_PROCESS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(BEGIN...
0eab10ec-66c0-4eb3-8e14-54c608ecf1eb
3
public int getCount(int x) { int count = 0; for (int row = 0; row < matrix.length; row++) { for (int col = 0; col < matrix[0].length; col++) { if (matrix[row][col] == x) { count++; } } } return count; }
b6853d8c-0976-4201-abb3-cd43ef307507
0
public ToolBar(EditCanvas view, AutomatonDrawer drawer, ToolBox box) { super(); adapter = new ToolAdapter(view); this.view = view; this.drawer = drawer; tools = box.tools(view, drawer); initBar(); view.addMouseListener(adapter); view.addMouseMotionListener(adapter); }
5faf83cc-4a96-4ab3-af1d-60655d88c805
9
@Override public void update() { move(); fisic(); nearMapBlocks = Main.sphereMapCollide(getX(), getY(), 5); for(Block bl : nearMapBlocks) bl.updateSpr(); if(getY()<=-16)//futura mapColision aqui { setY(getY()-16); inGround = true; ...
5eb24344-69f8-4e6b-baea-0bb47f3ae932
7
public synchronized String sendLockRequest() throws InterruptedException, UnableToGetLockException { // TODO: Global lock needed? mLockId = null; int lockTries = 0; int timeout = 0; while (lockTries < MAX_LOCK_RETRIES) { CollaborationRequireLock lockReques...
454881a6-30ed-41cb-915a-6fc4d6799543
5
public void renderTo(Rendering rendering) { if (textures == null) I.complain("TEXTURE NOT ASSIGNED") ; if (numFacets == 0) return ; final Texture tex = textures[(int) animFrame] ; if (tex == null) return ; GL11.glDepthMask(false) ; textures[(int) animFrame].bindTex() ; super.renderTo(re...
bc291e5d-fb11-4375-86d5-bb2e04070e05
7
public ArrayList<Sag> sogParagraf(String paragraf, boolean ui90d) { if (ui90d) { ArrayList<Sag> sager_p = new ArrayList<>(); SimpleDateFormat formatter = new SimpleDateFormat("MM"); int currentMonth = Integer.valueOf(formatter.format(new java.util.Date())); for (S...
0b76ddc0-232b-41c5-a1a2-686c0ba05ece
4
void determinePacRows(Graphics screen) { int counter = 0; double[] pacRowsAvg = new double[2];//avg y point of rows double[] pacNumRows = new double[2];//radii of pacs for( int i = 0; i < game.numRowsToClear; i++ ) { if( i == 0 ) { pacRowsAvg[0] = game.rowsToClear[0]; pacNumRows[0] = 1; } ...
be664c6f-48ba-4baa-a81a-598186f8a1b2
0
public int getThickness() { return thickness; }
6ad91ff0-0869-4d7e-93d0-f942edb3c6b5
0
public BitSet getCompletedPieces() { synchronized (this.completedPieces) { return (BitSet)this.completedPieces.clone(); } }
5deddfe8-e978-4ba1-9226-9c3246719f00
6
@Override public void close() throws IOException { if (xmlEncoder != null) { xmlEncoder.flush(); xmlEncoder.close(); xmlEncoder = null; } if (fs != null) { try { fs.close(); fs = null; } catch (IOException e) { e.printStackTrace(); } } if (xmlDecoder != null) { xmlDecoder.cl...
ef053d8e-c784-4884-9bcb-7d8c901310a1
9
private void makeCards() { int n = amount/2; for (int i = 0; i < n; i++) { // Final variable to be able to use it in the actionListener. final int in = i; cards[i] = new Card(img[i]); cards[i].addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Checks if the...
9f469d5c-5f9e-4c5f-914d-05f0667e174b
8
private int jjMoveStringLiteralDfa8_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 7); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 7); } switch(curChar) { case 65: if ((active0 & 0x100000000L...
988f9c20-7fc1-42ec-96c6-f526b6d91ab5
0
@Override public boolean markSupported() { return true; }
a51ce7a0-0660-45df-8d82-21264f4f6d61
9
@Override public boolean envelopesPoint(double xx, double yy) { return (((a > 0 && (xx >= x && yy >= y)) && (xx <= x + a) && (yy <= y + b)) || ((a < 0 && (xx <= x && yy <= y)) && (xx >= x + a) && (yy >= y + b))); }
8a1cc8a9-c972-4fc9-bc69-ed8b6e721be6
8
public Maze() { createCellArray(map); setPreferredSize(new Dimension(CELL * tileWidth, CELL * tileHeight)); pacman = new Pacman(pacmanInitialRow, pacmanInitialColumn, this, 3); inky = new Ghost(ghostInitialRow, ghostInitialColumn, this, "inky.png"); blinky = new Ghost(ghostInit...
f23964e4-172c-48b6-9e96-adee2b88047c
1
@Before public void setUp() { try { alustaTyhjaTestitiedosto(); kasittelija = new Tiedostonkasittelija(); kasittelija.setFile(tiedosto); } catch (Exception e){ System.out.println("Tiedostoa ei löydy setUpissa"); } }
bebe0d86-4a0d-403e-8e16-653420a1d8bc
8
public static List<Word> getProcessedWords(String input){ String output = ProcessText.processInputText(input); String[] inputArr = input.split("\\s"); String[] outputArr = output.split("\\s"); List<Word> list = new ArrayList<>(); if(inputArr.length != outputArr.length){ ...
f2cab6a9-20f4-4983-a50d-3d5ad381b8fd
4
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("Incorrect parameters.\n"); System.err.println(getHelp()); return; } switch (args[0]) { case "-c": compress(new File(args[1]), n...
b53265d9-3443-43d6-89a5-61261fd8ed4d
3
public boolean save(final ISave save) { switch ( this.options.getType( ) ) { case FILE: final File file = new File((String) this.options.getArgument("target")); if ( !file.exists( ) ) return false; return save.save(this); case DB: return save.save(this); default: } /* * F...
494ed1aa-2642-4ece-8059-5cd1da5065dd
9
public void calculateOffset(){ /* Calculate the Offsets for scrolling around the level */ // constants final int centerx = getFrame().getWidth() / 2; final int centery = getFrame().getHeight() / 2; levelParser.setOffset( new Point(0,0) ); if (isMoving()){ /* the confusing conditionals 'i...
6ef71709-bbeb-4e39-aebb-34d01488e8e4
8
public MongoStreamRecordReader(InputSplit split, JobConf conf) throws IOException { // determine if any locations are local ArrayList<String> sortedLocations = new ArrayList<String>(); ArrayList<String> localLocations = new ArrayList<String>(); ArrayList<String> remoteLocations = new ArrayList<String>(); ...
36bee16f-48df-4512-95b4-d8ae845f53a9
0
private void onExit() { System.err.println("Exit"); System.exit(0); }
861f4335-f21c-479d-8df3-f722270b6025
7
public void restart(int rows, int columns, int mineNumber){ if(this.rows == rows && this.columns == columns && this.mineNumber == mineNumber){ for(int i=0;i<columns;i++){ for(int j=0;j<rows;j++){ cells[i][j].reset(); } } } else{ this.rows = rows; this.columns = columns; this.mineNumber...
ccbd6542-ab73-4c0e-acb4-4e9bcf6786d1
3
public synchronized void poll() { for (int i = 0; i < KEY_COUNT; ++i) { // Set the key state if (currentKeys[i]) { // If the key is down now, but was not // down last frame, set it to ONCE, // otherwise, set it to PRESSED if (keys[i] == KeyState.RELEASED) keys[i] = KeyState.ONCE; else ...
2a604419-cb6d-487d-b9e3-d4ae43468402
4
public ForteresseDeGlace(Partie p) { pileGeantDeGivre = new LinkedList<>(); geantDeffausse = new LinkedList<>(); runeSigel = new boolean[4]; runeMann = new boolean[4]; runeDaeg = new boolean[4]; runeTiwaz = new boolean[4]; for (boolean b : runeDaeg) { ...
e0b1badd-8d7d-45a8-8a91-cfe116953bc9
0
public JLabel getjLabel7() { return jLabel7; }
2d229c3b-2708-41b3-99d1-80b1e3f249aa
4
boolean isFaceCard(){ faceCard=false; if(this.getRankNo().equals(ACE)||this.getRankNo().equals(JACK)||this.getRankNo().equals(QUEEN)||this.getRankNo().equals(KING)) faceCard= true; return faceCard; }
886fd4c3-289e-435b-ad90-d9825c29a82f
8
public ReturnValues turnTo(Coordinate _start, Coordinate _end, int _playerDireciton){ int startDir = _playerDireciton; startDir--; if(startDir < 0) startDir = 3; Coordinate n = getFacingCoordinate(_start, startDir); startDir = _playerDireciton; ...
43c56821-870a-44c9-8496-708e6049b30a
1
public SchlangenGlied getFirstGlied() { if (previousGlied != null) { return previousGlied.getFirstGlied(); } else { return this; } }
191e7ab9-6946-48e7-8a84-2f080300d024
8
public void testFormat_year_twoDigit() { DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC); DateTimeFormatter f = DateTimeFormat.forPattern("yy").withLocale(Locale.UK); assertEquals(dt.toString(), "04", f.print(dt)); dt = new DateTime(-123, 6, 9, 10, 20, 30, 40, UTC); ...
7794ca58-2166-447d-b057-7ba91c11e7b6
7
public static QueryIterator createRetrieveQuery(Stella_Object query) { { Surrogate testValue000 = Stella_Object.safePrimaryType(query); if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_QUERY_ITERATOR)) { { QueryIterator query000 = ((QueryIterator)(query)); return (query000); ...
f31c2d77-e31a-4433-9249-9b98d0cd73b2
9
public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_F1) { String s = input.getText(); input.setRows(0); input.setText(""); input.cut(); String[] c = s.split(" "); if (c[0].equals("*stop")) { sg.n.server.stop(); } else if (c[0].equals("*start")) { sg.n.s...
7e6fcf35-1b82-4c1d-afa3-b6eba0667b4a
2
private int findDay (String input) { // method to extract day # information Scanner s = new Scanner (input); int[] date = new int[3]; s.useDelimiter("/"); while(s.hasNext()) { for (int i = 0; i < date.length; i++) { date[i] = s.nextInt(); } } s.close(); return date[1]; }
741a916f-2f0c-4ef4-9a98-4ffee64ab659
3
@Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child for(ListIterator<PVariavel> i = this._variavel_.listIterator(); i.hasNext();) { if(i.next() == oldChild) { if(newCh...
433167ef-4d87-419d-9257-7bd6dc400ac4
1
protected ELMt loadKBQELMt(CycAccess access, CycDenotationalTerm kbq) throws CycApiException, IOException { try { final String command = SubLAPIHelper.makeSubLStmt(KBQ_ELMT, kbq); return access.makeELMt(access.converseCycObject(command)); } catch (CycApiException xcpt) { throw new Cy...
ea0f573e-0a65-4acc-8963-dc5a260c3c9f
7
public static SequenceIndex selectRulePropositions(Cons pattern) { { Cons arguments = pattern.rest.rest; Stella_Object posrelation = arguments.value; Stella_Object negrelation = arguments.rest.value; Description description = null; ObjectStore store = null; if (posrelation != null) { ...
2ada1c0a-a8df-4854-b3f8-c046329f87f1
2
private EventList getEventListeners(Class<? extends Event> type) { try { Method method = getRegistrationClass(type).getDeclaredMethod("getEventList"); method.setAccessible(true); return (EventList) method.invoke(null); } catch (Exception e) { server.Log("==!E...
6993df64-52a5-41a6-93de-9bd00bdd5367
6
public void clickEvent(double mouseX, double mouseY) { double x1 = this.getX1(); double x2 = this.getX2(); double y1 = this.getY1(); double y2 = this.getY2(); if(x1 <= mouseX && x2 >= mouseX && y1 <= mouseY && y2 >= mouseY) { double relMouseX = mouseX - x1; //System.out.println("X: " ...
6a5aeac7-3990-4195-81d4-2631da154466
9
private void handleEscape( final String promptString, // this argument needs to be factored out somehow final boolean hideTyping ) throws IOException { byte c = (byte) terminal.read(); // CSI if (c == '[') { c = (byte) terminal.read(); switch (c) { case 'A': if (historyIterator.hasNex...
8c4cb37b-0679-49b4-b16b-66b0cb40b182
7
public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()) { int n = in.nextInt(); if(n == 0) return; int steps = 0; int[] array = new int[n]; for(int i = 0; i < n; i++) { array[i] = in.nextInt(); } while(!allEqual(array)) { int[] array...
751ef732-8035-4c53-909e-263bf81984f9
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
7f3e7457-3565-48d4-9552-1ec942bbec5f
6
public static boolean failsAntecedentTypeCheckP(PatternVariable v1, Stella_Object i2) { if (((Keyword)(Logic.$TYPE_CHECK_STRATEGY$.get())) == Logic.KWD_LOOKUP) { { Surrogate type = v1.skolemType; boolean typeisokP = ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) && (((QueryItera...
f3eb42d3-d358-4c60-a48e-c761a207daf0
8
private void nextMove(int type) { if (type == 0) { holdable = true; generateNextTokens(); } else { currentType = type; } //set currentTokens switch (currentType) { case 1:// the I token setPositionForCase1(currentTok...
bf06a0b3-005f-48fe-92c7-b72e6ab16082
1
private static boolean isProblemStoreSpecification(final CycSymbol key, final Object val) { return (":PROBLEM-STORE".equals(key.toString())) && (val instanceof List); }
75b3a280-df1c-4511-a6cc-31c0370fb1f9
8
public void putAll( Map<? extends Double, ? extends Long> map ) { Iterator<? extends Entry<? extends Double,? extends Long>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends Double,? extends Long> e = it.next(); this.put( e.getKey...
4fe010c1-fe80-4423-a4b4-4321ae8b6c67
4
@EventHandler public void onEntityExplode(final EntityExplodeEvent event){ if (!plugin.isEnabled()) return; for (Block block : event.blockList()){ Block above = block.getRelative(BlockFace.UP); if (plugin.gates.gateLocation.containsKey(block.getLocation())){ e...
7e1cd18e-d703-4df8-b95b-8c83af684790
1
public void addTreeNode(List<TreeNode> list, TreeNode node){ if(node == null) return ; list.add(node); addTreeNode(list,node.left); addTreeNode(list,node.right); }
b88be82b-7740-4f35-87a9-759ce0a09c72
2
protected final synchronized void idle() { while (paused.get()) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } }
1d7aaa56-80cb-49f6-956a-4688a55a60c3
2
private World.direction getDirection(World.direction lastDirection) { World.direction direction = lastDirection; float chance = randGen.nextFloat(); if (chance < 0.02f) { if (lastDirection == World.direction.Left) { direction = World.direction.Right; } els...
072347a6-9f8b-446d-a2c2-60548ff202f7
9
public ClassUseMapper(RootDoc root, ClassTree classtree) { this.classtree = classtree; // Map subclassing, subinterfacing implementing, ... for (Iterator<ClassDoc> it = classtree.baseclasses().iterator(); it.hasNext();) { subclasses(it.next()); } for (Iterator<ClassD...
fe7df5f3-ec11-4651-9d68-2d4fa05849b1
0
public Admin(String name, String userName, String password){ this.name = name; this.userName = userName; this.password = password; }
1d6ce2fb-dc5c-4036-992d-082bd5bab30a
2
public void appendTypeName(StringBuffer b, String name) { int i = name.lastIndexOf('.'); if (i >= 0) { String prefix = name.substring(0, i + 1); if (!prefix.equals("java.lang")) { b.append("<font color='gray'...
5b666aa0-3a32-4c84-a4db-ca754eede3da
1
public void visit_dastore(final Instruction inst) { stackHeight -= 4; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } }
7d55d7ab-6aef-4cc8-819c-d2d18a582a04
0
public String getURI() { return uri; }
bd40c028-feb5-4ad1-b3b1-49f8650f5bfc
4
public void purgeDeadPlayersFromRing(){ RingNode tempPlayer = currentPlayer; do { if(!tempPlayer.connection.isAlive){ if(tempPlayer.next == tempPlayer){ Debug.error("Last player disconnected, press enter to quit"); } Debug.warn("Found dead player '" + tempPlayer.connection.username + "' in rin...
f4fbbab6-ca3d-4858-9416-19ccfdb85f84
4
private OfficeSpace tempGetOfficeByID(String authToken, String ID){ ArrayList<Provider> p = user.getProviderList(authToken); Iterator<Provider> i = p.iterator(); while (i.hasNext()){ Provider temp1 = i.next(); if(temp1 != null){ ArrayList<OfficeSpace> cur = (ArrayList<OfficeSpace>) temp1.getOfficeSpaces...
9a3f565d-f3de-4ace-82b6-5128af732df4
1
public String toString() { try { return this.toJSON().toString(4); } catch (JSONException e) { return "Error"; } }
230c2327-3146-4565-93c7-f00a5071151b
7
public static boolean isJournalAccessAllowed(MOB mob, String journalFlagName) { journalFlagName=journalFlagName.trim().toUpperCase(); if(mob==null) return false; if(isASysOp(mob)) return true; if((mob.playerStats()==null) ||((mob.soulMate()!=null)&&(!mob.soulMate().isAttributeSet(MOB.Attrib.SYSOPMSGS))...
de47338b-973e-4649-b547-e3e0998e8422
7
public void render(ArrayList<GameObject> gameObjList) { if (game.getGameState() == GameState.INITIALIZING) return; // System.out.println("NeuroFrame.render(): graphics=" + graphics); if ((game.getGameState() == GameState.PLAYING) || (game.getGameState() == GameState.GAMEOVER)) { world.render(ca...
e9622923-cce3-4810-b765-f827a7fb9c52
7
protected final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { final HttpSession session = request.getSession(true); /******************************************************* * Construct a table to present all our results **********...
7b102437-3116-4982-b646-2691679a1ce5
3
@Override public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); if (qName.equals("receiver")) { mInReceiver = false; mCurrentRecieverClass = null; } if (mInReceiver &...
2d9e3718-84cb-4d39-8032-5084bb8af904
6
public boolean IsetNodeParams(String region, String agent, String plugin, Map<String,String> paramMap) { boolean isUpdated = false; OrientGraph graph = null; String node_id = null; try { node_id = getNodeId(region,agent,plugin); if(node_id != null) ...
e28f8b4d-b1d1-4ba9-b7a6-026bd44f3679
0
public static void removeFromDatabase(String input) { database.remove(database.indexOf(input)); }
97fc1f34-510c-4fde-a312-e3dd55bdd0f6
8
public String showColourOfDay(int Day){ String msg1; try{ if(Day==1){ msg1 = new String("\nDay : Sanday = Red colour"); return msg1; } else if(Day==2){ msg1 = new String("\nDay : Monday = Yellor colour"); return msg1; } else if(Day==3){ ms...
2373b134-5aad-4df7-ae49-5bb5c414625c
5
public Object getValueAt(int row, int col) { try { Recipe r = data.get(row); switch (col) { case 0 : return r.getName(); case 1 : return r.getStyle(); case 2 : return r.getBrewer(); case 3 : return ""; default : return ""; } } catch (Exception ...
b1fa29e9-2946-4234-a6e0-054609e05ae5
5
public void processDamageQueue() { if(getDamageQueue().isEmpty()) return; if(getUpdateFlags().getFirstDamage() != null || getUpdateFlags().getSecondDamage() != null) { return; } if(getUpdateFlags().getFirstDamage() == null) { damage(getDamageQueue().poll()); return; } if(getUpdateFlags().get...
f2baa3b2-a8ab-4550-9893-384a0509e4ee
9
public static SimpleQueue <Integer> sort(ArrayList <Integer> arr) { SimpleQueue <Integer> q1; SimpleQueue <Integer> q2; if (arr.size() > 2) { Integer newSize = arr.size() / 2; ArrayList <Integer> newList = new ArrayList <Integer> (); for (int i = 0; i < newSize; i++) { newList.add(arr.remove(i));...
d1fc401e-0459-46a6-b11a-dab19cf5e47f
5
private void updateBehaviors() { behavior.clear(); boolean anyEnabled = false; for(int i = 0; i < enabledBehaviors.size(); i++) { //if there are no behaviors left, reset velocity if(enabledBehaviors.get(i)) { anyEnabled = true; break; } } if(!anyEnabled) { this.velocity = new Vector2(0, 0); ...
34dc51c7-2828-49c5-85e7-6099ce725332
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
44e75ea8-c4ac-4515-81d3-8a53074aa4f0
5
public int next() { char next = nextValue(); // System.out.println( "state[" + state + "], next[" + next + "], stringValue[" + stringValue + "]" ); switch (state) { case STATE_END: { state = STATE_AFTER_END; } case STATE_AFTER_END:...
9f86720a-385d-4c58-b712-df0d8a6f8058
3
public boolean equals(Object o) { if (! (o instanceof MultiType)) return false; MultiType multi = (MultiType) o; if (resolved != null) return resolved.equals(multi.resolved); else if (multi.resolved != null) return false; return interfaces.ke...
48598336-a5bc-4fdd-b2a6-a2b57f032c1b
9
private static void fillScoreMatrix(char[] st1, char[] st2) { // расстояния между одной строкой и другой пустой for (int i = 1; i <= st1.length; i++) { score[i][0] = -(gapInst + gapExt*(i-1)); } for (int i = 1; i <= st2.length; i++) { score[0][i] = -(gapInst + gapExt*(i-1)); } // заполним матриц...
30b990df-17aa-4d0a-9a9d-c37e9c961bf5
0
void updateItemCounter(int delta) { itemCounter += delta; lblItems.setText(String.format("お買い上げ点数 %s 点", itemCounter)); }
d5800a9e-6d99-4337-bad6-5d237ae10e43
3
private static boolean isIgnoreable(char chr) { return chr == '\t' || chr == '\f' || chr == ' ' || chr == '\r'; }
032b5efc-4f49-403c-88ba-dc21772f8a27
8
@Override public TimeZone nearestTimeZone(final Location searchLocation) { LinkedList<TwoDimTreeNode> nodeStack = new LinkedList<>(); Set<TwoDimTreeNode> attendedNodes = new HashSet<>(); Location bestGuess = traverseTheTree(nodeStack, root, searchLocation, attendedNodes); double bes...
93e5e57c-e874-4955-acd5-2e7249d5e589
9
public static void fdwarrio_decode() { char xortable[][] = { /* note how the first lines are highly repetitive, while the */ /* last ones get more and more unique. */ {0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00}, /* .0.0..0..x..x..x...
02d2c6f9-9d8e-4196-8014-a46eb43dd150
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Contact other = (Contact) obj; if (code == null) { if (other.code != null) return false; } else if (!code.equals(other.code)) return ...
4252326d-614a-4904-850f-1e74766834c8
7
boolean propExpr(final Block block, final LocalExpr lhs, final Expr rhs) { if (ExprPropagation.DEBUG) { System.out.println("prop " + rhs + " to uses of " + lhs); System.out.println(" uses of lhs = " + lhs.uses()); } if (rhs instanceof LocalExpr) { // We can't prop a local to a PhiStmt operand, so don...
97e8e4d8-884f-44ed-9c68-9e8b73e21585
6
@Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if(buffer.readable()) { int opcode = buffer.readUnsignedByte(); int length = Constants.PACKET_LENGTHS[opcode]; if (opcode < 0) { buffer.discardReadBytes(); return null; } if (...
99b07020-2278-40b0-993e-82d850e84be8
5
public void digHorizontal(){ //DETERMINE DIRECTION: if(blockX<targetBlockX){ dirMod=1; } else if(blockX>targetBlockX){ dirMod=-1; } else{ if(x-(blockX*16)<7||x-(blockX*16)>9){ hspeed = 7*dirMod; goSpeed()...
a2ff22e7-6365-4d05-8e9e-b202ec1c3256
5
protected void discoverSpecificComments(String similarityFile) { System.out.println("topic similarity"); try { PrintWriter pw = new PrintWriter(new File(similarityFile)); for (_Doc doc : m_trainSet) { if (doc instanceof _ParentDoc) { pw.print(doc.getName() + "\t"); double stnTopicSimilarity = ...