method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
2be522e8-ac0d-4a4e-821b-5b529eaab940
1
@Override public void undo() { JoeTree tree = node.getTree(); node.setValue(oldText); tree.setCursorPosition(oldPosition); tree.getDocument().setPreferredCaretPosition(oldPosition); tree.setCursorMarkPosition(oldMarkPosition); tree.setComponentFocus(OutlineLayoutManager.TEXT); tree.setEditingNode(node...
dfc3e3ec-fa26-4fc8-a1ce-38328648039f
4
public void addObserver() { for(Carro c: carros) { c.addObserver(panelVisualizacion); c.addObserver(panelCarros); } ArrayList<Huerto> huertosV=new ArrayList<Huerto>(); Huerto h=null; for(Nodo n: huertos) { h=n.getHuerto(); if(h!=null){ if(!huertosV.contains(h)) { huertosV.add(h)...
4fcbe61a-b499-4fee-83d0-08886e3f6b14
9
public Data parse(byte[] bytes) { String input = getString(bytes).trim(); String s; if (input.length() < 1) { s = null; }else if (getSignPosition() == LEADING) { char c = input.charAt(0); s = (isPositive(c) ? "" : "-") + getNumber(c) ...
15eb1a47-1160-47c6-844b-64ae5522ee69
9
public void deleteOldValues(final long now) { this.checkTime(now); final long minTime = now - this.windowLength; boolean deleted = false; while (this.size > 0) { if (this.times[this.ringTail] < minTime) { final float value = this.values[this.ringTail]; this.delete(); deleted = true; ...
93b5549f-1911-407f-958e-acc8a535ac05
2
public void fireWaitingEvents() { // Synchronise the waitingEventLists which stores the list of all events // which were collected during the previous logic update and fire them synchronized (waitingEventLists) { for (Entry<KeyEventType, Collection<EventHolder>> kvp : waitingEventLists.entrySet()) { for (E...
becb22df-483a-4d11-8b30-e76418690c6f
9
public static <D extends TopicDataset> void latexTimingPerformance( Vector<A2WSystem> a2wAnnotators, Vector<Sa2WSystem> sa2wAnnotators, Vector<Sc2WSystem> sc2wAnnotators, Vector<D> dss) throws Exception { System.out.println("Timing performance - latex output"); int allAnnsSize = 0; if (sa2wAnnotators != nu...
a9c95e26-e7d0-4012-a013-adb6a34dfcec
4
private void vectorUsers(long chanId, Vector<String> users){ ChannelTree ct = ctrl.getChannel(chanId); if(ct instanceof ChannelGroup){ ChannelGroup cg = (ChannelGroup)ct; for(long id : cg.getChildren()){ vectorUsers(id,users); } } else{ Channel ch = (Channel)ct; Vector<String>chUsers = ch.get...
415d1af2-35d3-420e-aa94-eb2c5dfd8e1a
9
public void pump(BaseTableContainer base, boolean up) { HashMap<String, BaseTableContainer> prims = chart.getPrims(); double othercount = -1; for(BaseTableContainer btc : prims.values()) { if (btc.rollUpRatio > 0) { othercount = othercount + 1; ...
9387e9f3-99f0-4f96-970e-39ac06e1db54
2
@Override public TestResult test(Object input, Object... args) { boolean passed = false; for(Object item : args){ passed |= input.equals(item); } String message = passed ? null : messageT; return new TestResult(passed, message); }
f821abc1-bdcd-4ca7-97eb-34154cc8f98d
5
public synchronized boolean sameShapes(List<String> s){ if (this.shapes == null || s == null) return false; if (this.shapes.size() != s.size()) return false; List<String> l1 = new ArrayList<String>(); List<String> l2 = new ArrayList<String>(); for (String l : this.shapes) l1.add(l); Collections...
488aee4e-45f6-4024-bf05-1bcafc3a0d7b
4
private void evenements() { _btnAjouterUtil.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { String mdp = new String(_textMdpUtil.getPassword()); if(!_textMailUtil.getText().equals("") && !_textNomUtil.getTex...
f1998bcc-422f-45e1-b312-558c88e1a3da
5
@Override protected Value evaluate(ExecutionContext context) throws InterpretationException { Value val1 = ((AbsValueNode) this.getChildAt(0)).evaluate(context); Value val2 = ((AbsValueNode) this.getChildAt(1)).evaluate(context); if (val1.getType() == VariableType.NUMBER && val2.getType() ...
32ddf5b3-44cb-48e4-9d4a-85a156e50fbe
6
public HashMap getAllProfils() { HashMap<String, Profil> liste = new HashMap<>(); File folder = new File("users"); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile() && listOfFiles[i].getName().endsWit...
b7631db0-ab4a-45ff-a5ae-1152ab930ef5
8
public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param2 = inStack.pop(); Object param1 = inStack.pop(); if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number) param1).doubleValue(); double y = ((Number) param2).doubleValue...
54f773ff-4dea-4ac1-904e-83f450ce6d26
5
private void computeNegativeWeightedShortestPath(Vertex origin) { // queue for storing vertices not yet visited LinkedQueue q = new LinkedQueue(); // Vertex in current shortest path Vertex v; // Vertex adjacent to v Vertex w; // Edge connecting v to w Edge e; // cost of Edge from v to w ...
f3fe6efa-9de4-4a54-b095-025b286a54c4
2
public static boolean isLeapYear(int year) { return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) ; }
6b1349b0-c7fd-4f72-9828-5ae4f85f1502
3
public static void sort(Comparable[] a) { for (int i = 0; i < a.length; i++) { int min = i; for (int j = i + 1; j < a.length; j++) { if (less(a[j], a[min])) min = j; exch(a, i, min); } } }
96ea9c02-1cb0-4a13-b3d8-0a666a1f9600
1
public long recursion(long n) { if (n == 1){ return 1; } else result = recursion(n-1) * n; //System.out.println(result+"\n"); return result; }
061ee6ba-83b3-4ad8-93e6-87671467c6aa
4
@Override protected VcfEntry readNext() { // Read another line from the file try { headeSection = false; while (ready()) { line = readLine(); if (line == null) return null; // End of file? VcfEntry vcfEntry = parseVcfLine(line); if (vcfEntry != null) return vcfEntry; else headeSection |=...
703ab890-f910-444b-befc-52f8e92983dd
6
@Override public void handleMessage(String sender, String msg) { String[] parts = msg.split(" "); int id = 0; if (parts.length == 2) { try { id = Integer.parseInt(parts[1]); } catch (NumberFormatException nfe) { ; } } if ( id>0 && id==LANWebcam.sIdentifier ) { mWebcam.tak...
3f9fc4e2-1f22-450b-ba6f-4dd055bbdadf
2
@Override public int compare(Tile tile1, Tile tile2) { if (tile1.getPosition().getX() > tile2.getPosition().getX()){ return -1; } else if (tile1.getPosition().getX() > tile2.getPosition().getX()){ return 1; } else { return 0; } }
cb0a37d9-b9a2-470e-ac27-25d21a3fb0ca
3
public static void main(String args[]) { if(args.length < 6 || (args.length % 2 != 0)) { printHelp(); return; } delay = 1; for(int i = 0; i < args.length; i+=2) parseParameter(args[i], args[i+1]); CompetitionParameters.LONG_DELAY ...
d8e36e4e-b687-45af-8b67-34b828570da9
3
private void itemCounterUp(FieldItem item) { switch (item.getType()) { case 'T': numberOfTrees++; break; case 'D': numberOfDucks++; break; case 'H': numberOfHunters++; break; ...
e87c32c2-4cfe-4eea-8e1e-70014c33118a
8
@Override public void run() { Map<Integer, Integer> triangles = new HashMap<>(1000); for(int i = 3; i <= 1000; i++) { triangles.put(new Integer(i), new Integer(0)); } for(int a = 1; a < 400; a++) { for(int b = 1; b < 400; b++) { for(int c = 1; c < 400; c++) { if(a + b + c > 1000) break; ...
3bb81ba1-866a-4057-a82c-3265b48f712f
9
public static int threeSumClosest(int[] num, int target) { if (num.length < 3) return 0; Arrays.sort(num); int mid = 0; int last = num.length - 1; int closest = num[0] + num[1] + num[2]; while (mid > 0) { while (mid < last) { int sum = num[mid]; sum += num[last]; fo...
eb6b3dde-5cfe-48cb-9770-21b4c9005401
3
private static void runJAXB() { try { toXML.marshalingExample(); } catch (JAXBException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } try { JAXBparser jaxBparser = new JAXBparser(); } cat...
3aab3b85-8602-402f-bce6-2fce27d96265
8
private void toggleKey(int keyCode, boolean isPressed) { if (keyCode == KeyEvent.VK_LEFT) { scene.toggleKey(Mario.KEY_LEFT, isPressed); } if (keyCode == KeyEvent.VK_RIGHT) { scene.toggleKey(Mario.KEY_RIGHT, isPressed); } if (keyCode == ...
2b5fe1d8-a8eb-4e77-99eb-717d73a8e5cd
7
public void compute() throws IOException { Map<String, FastaItem> fastaMap = readFasta(); ProteinFilter proteinFilter = new ProteinFilter(); // optional property if (properties.containsKey("minSeqLength")) { minSeqLen = Integer.parseInt(properties.getProperty("minSeqLength")); protein...
9018f7b9-887f-4051-a858-affcfd288499
2
public int countDurationInterval(Interval outer, Duration next, Duration threshold) { int count = 0; int index = overlapStart(outer); Interval inner = new Interval(outer.getStartMillis(), outer.getStartMillis() + next.getMillis()); long duration = next.getMillis(); while (index...
b44cfdda-a41a-4634-89b8-38e686a9a634
4
public Vector4d abs() { if(x < 0) x = -x; if(y < 0) y = -y; if(z < 0) z = -z; if(w < 0) w = -w; return this; }
50e6c77a-78a3-4b59-9adc-0c3d614eeb18
5
private void init() { try { ip = getLocalAddress().toString().replace("/", ""); } catch (SocketException e) { System.err.print(" LOBBY] [ERROR] " + e); } status = new JLabel("Enter a Username"); status.setFont(new Font("Tahoma", Font.PLAIN, 20)); status.setHorizontalAlignment(SwingConstants.CENTER); ...
f66c0325-0385-44ea-8048-aa669a67badb
9
void dfs(int d){ String r = trans(); if(min<=d||ref.containsKey(r)&&ref.get(r)<=d)return; if(r.equals(g)){ min = d;return; } ref.put(r, d); for(int i=0;i<4;i++)for(int j=1;j<8;j++){ if(a[i][j]!=0||a[i][j-1]==0||a[i][j-1]%10==7)continue; int x = a[i][j-1]+1; int p = pos[x]; a[p/8][p%8] = 0; a[...
8a8d5d51-0e18-4ddb-983b-fda2931445b0
0
public int getID(){ return id; }
99f1fa18-a02b-4d81-869a-eb8f66725d57
8
public void actionPerformed(ActionEvent evt) { System.out.println("[GraphPanel.java] animationHandler::actionPerformed()\nactualAnimationVertexID="+actualAnimationVertexID); if (!isBlink) { if (actualAnimationVertexID<idList.size()+1) { if (actualAnimationVertexID>0) getVertexById(idList.get(actua...
22442f1a-5c4a-4fb3-9f2b-7568d2d48954
7
@Override public Class<?> getColumnClass(int columnIndex) { switch (COLUMNS.values()[columnIndex]) { case ID: return Integer.class; case CUSTOMER: case CAR: return String.class; case FROM: case TO: return Date.class; case COST: return BigDecimal.class; default: throw ne...
43689431-e2da-492e-b1cb-5e1f663620f9
9
private void loadMap(BufferedReader br) { boolean canLoad = false; String str = null; Grid<T> gr = world.getGrid(); for (Location loc : gr.getOccupiedLocations()) world.remove(loc); repaint(); try { str = br.readLine(); if (str.equals("unbounded")) { if (gr.getNumCols() == -1 && gr.getNumRows()...
552cc62d-abe3-43ad-8219-dfbe871b925a
3
public void render() { BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(3); requestFocus(); return; } int xScroll = player.x - WIDTH/ 2; int yScroll = player.y - (HEIGHT - 8) / 2; level.renderBackground(); if(menu==null)player.render(lightScreen); level.renderS...
ea75422b-e404-4c7b-aacb-a4666166b57e
1
private void close(boolean restart) { bot.close(); if (!restart) { dispose(); bots.remove(bot); return; } // TODO handle restart }
879d1aa3-d7b7-4165-82d0-63a71bdd06c8
7
@Override public PeerInfo getDestinationPeerInfo() { PeerInfo currentPeerInfo = getPeerInfo(); if(currentPeerInfo == null) { return null; } PeerClient.printOnShell("Selecting peerinfo for : " + currentPeerInfo); Set<PeerInfo> availablePeerInfos = getAvailablePeerInfos(); if(availablePeerInfos == null ||...
e257412d-9118-4732-94d5-d6d8c0b13dc5
8
private static void runCommandLine(ImporterArgs args) throws Exception { IExperianRepository experianRepo = new ExperianWebServcieRepository(); IImporterSettingsRepository settingsRepo = new FileImporterSettingsRepository(); // get settings ImporterSettings settings = settingsRepo.getSettings(); IDnBReposito...
723758c3-91db-4e11-b3be-68b2bfac8c1a
0
public PrintAction(Environment environment) { super("Print", null); this.environment = environment; putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_P, MAIN_MENU_MASK)); }
1be7c355-2aac-4c2e-886a-d6a7e6f94f4b
7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RecommendRelationship that = (RecommendRelationship) o; if (productEnd != null ? !productEnd.equals(that.productEnd) : that.productEnd != null) return ...
e5cd2a45-6a29-4440-a8b2-8278cc853b8b
2
public ResultSet checkRecord(String patientInfo){ try { if(Helper.isInteger(patientInfo)){ String testRecordQuery = "SELECT * " + "FROM patient p, test_record t " + "WHERE " + " p.health_care_no = " + Integer.parseInt(patientInfo) + " AND t.patient_no = p.health_care_no " + "AND t.re...
5f5bff86-3951-4a5d-b3a1-ed5bb8f1124d
0
public static void main(String[] args) { IHello hello = new HelloSpeaker(); LogHandler handler = new LogHandler(); IHello proxy = (IHello) handler.bind(hello); proxy.hello("Laud"); }
ab1def52-b18a-4a77-b2a1-0efd812ae69d
8
public ImagePlus apply() { final int width = input.getWidth(); final int height = input.getHeight(); final int depth = input.getStackSize(); //final ImagePlus imageOutput = input.duplicate(); //final ImageStack imageStackOutput = imageOutput.getStack(); final ImageStack inputStack = input.getStack(); ...
ab2c5637-1af6-4cdf-890b-90399f8d72db
7
@EventHandler(priority = EventPriority.HIGHEST) public void onEntityDamageEvent(final EntityDamageEvent event) { if (!(event.getEntity() instanceof Player)) { return; } Player player = (Player) event.getEntity(); if (event.getCause() == DamageCause.FALL) { //Chec...
9eccbde2-920d-42e1-8f69-c39d299bb08b
2
public void reloadGuardsConfig() { if (GuardsConfigFile == null) { GuardsConfigFile = new File(getDataFolder(), "Guards.yml"); } GuardsConfig = YamlConfiguration.loadConfiguration(GuardsConfigFile); // Look for defaults in the jar InputStream defConfigStream = this.getR...
91d2459a-7517-433d-ac8d-96466b619e0e
4
@SuppressWarnings("unchecked") public static <T> Set<T> viewOf(final Set<? extends T> s1, final Set<? extends T> s2) { if (s1.isEmpty()) { return (Set<T>) s2; } else if (s2.isEmpty()) { return (Set<T>) s1; } else { return new LazyUnionSet<>(s1, s2); ...
4ce56c84-5d7e-4846-a428-0e0b0be6db54
8
public static int getStandardErrorParamIndex(String accession) { if (INTENSITY_STD_ERR_SUBSAMPLE1.getAccession().equals(accession)) { return 1; } else if (INTENSITY_STD_ERR_SUBSAMPLE2.getAccession().equals(accession)) { return 2; } else if (INTENSITY_STD_ERR_SUBSAMPLE3.g...
e918a215-8e87-4733-9c8c-716e57c3f181
8
public boolean isMonthLetter(String letter) { boolean validLetter = false; if(letter.equals("J")) { validLetter = true; } else if(letter.equals("A")) { validLetter = true; } else if(letter.equals("M")) { ...
edaed68a-d3bb-4c6f-b047-c5eac72c6628
2
* @Post: TODO * @Return: whether or not the king in check can get out */ private boolean canGetOutOfCheck() { ArrayList<Piece> piecesAttacking =enemyPiecesThatCanAttack(getCurrentKing().getPoint()); return canMoveOutOfCheck()||canKillAllAttackingEnemies(piecesAttacking)||canBlockAttack(piecesAttacking); }
aac41cdc-af88-4a40-8866-82bee901e1bb
2
@SuppressWarnings("unchecked") @Test public void testPopRemovesItemFromList() throws LuaScriptException { String jid1 = addNewTestJob(); String jid2 = addJob(UUID.randomUUID().toString()); List<String> keys = Arrays.asList(TEST_QUEUE); List<String> args = Arrays.asList(TEST_WORKER, "1", JQlessClient.getC...
5b427257-e443-470c-9c8f-566e18e6f5ae
0
public void setEndLineNumber(int endLineNumber) { this.endLineNumber = endLineNumber; }
e16a0612-d063-493f-b4f6-120b1239902a
7
public void testFillOffsets() { int element_count = 20; TIntList a = new TIntLinkedList(); for ( int i = 1; i <= element_count; i++ ) { a.add( i ); } a.fill( 10, 15, 0xdeadbeef ); for ( int i = 0; i < 10; i++ ) { assertEquals( i + 1, a.get( i ) );...
8e8eb63c-1a05-46d9-8cd2-cad458fc72c9
7
private void checkForUpdate() { URL url = null; BufferedReader in = null; String line = null; try { log.trace("Checking for latest version"); url = new URL(latestVersionUrl); in = new BufferedReader( new InputStreamReader( (InputStream)url.getContent() ) ); int latestVersion = Integer.parseI...
57ec2f5c-0bcd-4c62-aeb4-1b61d21338c6
8
public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) { ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>(); if(num.length<4) return res; Arrays.sort(num); for (int i = 0; i < num.length; i++) { for (int j = i + 1; j < num.length; j++) { int k = j + 1; int l = num...
a3f88e27-ad0d-4bc2-b21e-1c07e5c85a9a
5
@Override public void run(){ long startTime = System.currentTimeMillis(); try { while(true){ Thread.sleep(100); //System.out.println("Waiter "+table.getWaiters()); String out = ""; int[] eater = table.getAuslastung(); int sum...
1dae7658-d5cc-4605-9206-9d8badebe088
1
public Iterator<Float> calculateScores(int numberOfScores, int multiplier){ ArrayList<Float> scores = new ArrayList<Float>(); for(int i = 1; !(i>numberOfScores); i++){ Float score = (float)(((float)i/(float)numberOfScores)*(float)multiplier); scores.add(score); } return scores.iterator(); }
ea066ef5-98ee-4357-8b5f-3b44f154d0f0
0
public void setActiveActivity(ActiveActivities activeActivity) { this.activeActivity = activeActivity; }
7f4637f8-ce88-4e6f-beab-894e4ce541a0
0
public void setB(float b) { this.b = b; }
90cafed0-905b-46f5-b26b-b40c559b373f
3
private static void test_size(TestCase t) { // Print the name of the function to the log pw.printf("\nTesting %s:\n", t.name); // Run each test for this test case int score = 0; for (int i = 0; i < t.tests.length; i += 2) { int bits = (Integer) t.tests[i]; int exp = (Integer) t.tests[i + 1]; try { ...
1b16a3b7-5780-46a5-a483-5a0112f32ad9
8
protected boolean pawnCanMoveTwo(int finalX, int finalY) { int abs_Y_diff = Math.abs(finalY - this.y); Piece[][] board = this.player.myGame.gameBoard.boardArray; if((abs_Y_diff == 2) &&(this.player.myGame.turn == 1 || this.player.myGame.turn == 2) &&(board[fi...
329374fd-2bd0-47d8-ba44-3b4df9517a47
9
private static void writeString(final StringWriter writer, final String s) { writer.write('"'); for(int i = 0; i < s.length(); i++) { char c = s.charAt(i); switch(c) { case '"': writer.append("\\\""); break; case '\\': writer.append("\\\\"); break; case '\b': writer.append...
11775baf-bb6b-450d-9d68-4111fbf7a238
2
public float[][] getM() { float[][] res = new float[4][4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) res[i][j] = m[i][j]; return res; }
52a6b6cf-5b9b-4b61-9ff4-77faaea29f27
8
public int adjustState(int currentIndex){ if(playHeadMode == PLAYHEAD_FORWARD){ currentIndex++; if(currentIndex >= CHREditorModel.MAX_FRAMES){ if(mode == PLAYHEAD_LOOP_MODE){ currentIndex = 0; } else if(mode == PLAYHEAD_OSCILLATE_MODE){...
28bc5a06-82e3-496c-b509-9c323b198761
0
KeyUsageType(String v) { value = v; }
943d3276-7846-44c1-8bed-e0149feadd03
4
private void normaliseTextNodes(Element element) { List<Node> toMove = new ArrayList<Node>(); for (Node node: element.childNodes) { if (node instanceof TextNode) { TextNode tn = (TextNode) node; if (!tn.isBlank()) toMove.add(tn); ...
12cf9f67-479a-4eef-b0ab-8dbe8f55182a
9
private static void maxHeapify(int[] array, int index, int heapSize) { int largest = index; int left = ((index * 2 + 1) <= heapSize - 1) ? (index * 2 + 1) : -1; int right = ((index * 2 + 2) <= heapSize - 1) ? (index * 2 + 2) : -1; if(left == -1 && right == -1) { return; } if(left != -1 && array[lar...
9e1081dc-1446-4a4d-ab88-941e1c1db4b3
3
private boolean updatePreview() { if (!useSettings()) { return false; } // Create preview Vector<String[]> tableContent = new Vector<>(); try { for (Entry e : importer.preview(20)) { String[] row = {e.getWord(), e.getDefinition(), e.getCategory(), e.getTagsAsString(), e.getNotes()}; tableCont...
d15391ce-2529-45a3-92d4-5bc32a290019
9
public static long getNode() { try { final Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); if (interfaces != null && interfaces.hasMoreElements()) { for (NetworkInterface iface = interfaces.nextElement(); interfaces.hasMoreElements(); iface = interfaces.nextElement()) { ...
fb0ef2dd-6e5a-485d-b2d4-146f8e80943b
6
public AudioDeviceOutputPipe(String mixerName) { for (Mixer.Info info : AudioSystem.getMixerInfo()) { System.out.println(info.getName()); if (info.getName().matches(mixerName)) { System.out.println("GETTING MIXER"); mixer = AudioSystem.getMixer(info); break; } } for (Line.Info info : mi...
bb537b36-34ca-414b-94a6-79d77231bec3
3
private static CCNode processData(final String nodeData, final String nodePosData) throws NodeDataLengthException, NodeDataException { CCNode node = new CCNode(); String[] nodeNameData = nodeData.split("\\s"); String[] nodePositionData = nodePosData.split("\\s"); ...
04992c00-c94a-4398-b467-31845014c15c
2
public static void foldervalidator() { File file = new File(Directories.APP_HOME); if (!file.exists()) { file.mkdirs(); } file = new File(Directories.LOGS_DIR); if (!file.exists()) { file.mkdir(); } }
8b411fd3-bdda-450b-90cd-28c114ce353e
5
public boolean updateCastle(Piece p1, Piece p2) { Board b = gm.getBoard(); if ( b.isWhiteTurn() == p1.isWhite() && b.isWhiteTurn() == this.isWhite ) { ArrayList<PossibleTile> tiles = new ArrayList<PossibleTile>(); b.nextTurn(); Piece clone1 = p1.clone(); Piece clone2 = p2.clone(); b.removePie...
720ec501-752c-4bba-bda6-393767fb3c11
0
public BitSet getAvailablePieces() { synchronized (this.availablePieces) { return (BitSet)this.availablePieces.clone(); } }
f151ee1e-0264-4098-8504-7f2f3207595d
5
public void render() { anim.bind(animTicks); int w = anim.frameWidth * World.screenScale; int h = anim.frameHeight * World.screenScale; int dh = Display.getHeight(); int cx = Main.m.world.camera.posX; int cy = Main.m.world.camera.posY; int flash = 1 - (invincibilityCounter % 5 == 0 ? 0 : 1); Main.m.mo...
90590ab2-0154-489a-835f-2ed15234f371
9
public String readLine(ByteBuffer buffer) throws LineTooLargeException { byte b; boolean more = true; while (buffer.hasRemaining() && more) { b = buffer.get(); if (b == HeboUtils.CR) { if (buffer.hasRemaining() && buffer.get() == HeboUtils.LF) { ...
d7ab831b-a288-45e2-ba4a-a3e36f31e616
8
public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) { EntityPlayerSP var2 = this.mc.thePlayer; if (par1Packet103SetSlot.windowId == -1) { var2.inventory.setItemStack(par1Packet103SetSlot.myItemStack); } else if (par1Packet103SetSlot.windowId == 0 && ...
e4804163-9562-43fb-80f1-9815b949f03d
6
static private int jjMoveStringLiteralDfa9_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(7, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(8, active0); return 9; } switch(curChar) { cas...
efbcffa8-0611-48af-a325-3ce59ff5dd34
7
public static void getTraitBoons(Tidy tidy, Document doc, Trait[] traits) { try { XPath xpath = XPathFactory.newInstance().newXPath(); XPathExpression expr = xpath.compile("//table[@id = 'traits']/tr/td/text() |" + "//table[@id = 'traits']/tr/td/a/text()"); NodeList nodes = (NodeList)...
1e11bd54-3efc-44ce-942b-2476208b3ac1
7
public void shoot(int dist, Point shooterPosition) { int d5 = 42 + (5 * 5 * currentTime.getH() + 5 * currentTime.getM() + currentTime.getS()) % 42; int d7 = 42 + (7 * 7 * currentTime.getH() + 7 * currentTime.getM() + currentTime.getS()) % 42; int id = 0; if (dist < d5) id = 5; ...
22f7eb9d-ec8d-462f-bb30-c1bc027c1e7d
2
@SuppressWarnings("unchecked") protected List<T> findByCriteria(Order ordem, Criterion... criterion) { Session session = HibernateUtil.getSessionFactory().openSession(); Transaction transaction = session.beginTransaction(); Criteria crit = session.createCriteria(getPersistentClass()).setResultTransformer(Criter...
56f3f170-05ad-4156-9a6a-33a33ad7a801
0
public void setExtraPoints(Integer extraPoints) { this.extraPoints = extraPoints; }
a4ab4d71-2e8d-4cd2-b4df-804b5a6dc842
6
public void compute() throws IOException { createStartPopulation(); best = new IndividualDoubleStart(Long.MIN_VALUE); worst = new IndividualDoubleStart(Long.MAX_VALUE); Collections.sort(population); best = population.get(0); worst = population.get(population.size() - 1); ...
248ff155-6013-4f38-86e5-5b5345137b96
3
public DirectedEdge(int v, int w, double weight, MapEdge me) { if (v < 0) throw new IndexOutOfBoundsException("Vertex names must be nonnegative integers"); if (w < 0) throw new IndexOutOfBoundsException("Vertex names must be nonnegative integers"); if (Double.isNaN(weight)) throw new IllegalArgu...
ae341ac5-ad3d-4e0a-89ab-f1045def1202
8
public void dataRequest( SystemObject object, DataDescription dataDescription, byte state ) { debug.finer("object: " + object + "dataDescription: " + dataDescription + "state: " + state); if(state == START_SENDING) { List newObject = new LinkedList(); newObject.add(object); newObject.add(dataDescriptio...
564bb435-bfe8-4fa9-a82b-71debb1681b4
4
public List<Server> getUserServers(String username) { logMessage(LOGLEVEL_DEBUG, "Getting all servers from " + username + "."); if (servers == null || servers.isEmpty()) return null; Server desiredServer; ListIterator<Server> it = servers.listIterator(); List<Server> serverList = new ArrayList<>(); while...
b804eb8f-6f00-49ba-af2d-d88407308db5
0
public Build getLastUnstableBuild() { return lastUnstableBuild; }
2d7e9d01-5006-4418-b7af-f6e7c3abaa45
8
public void setProfileUserFromView(EditProfileFrame editProfileFrame) { if (profilUser == null) { profilUser = new ProfilUser(); } profilUser.setNama(editProfileFrame.textFieldNama.getText()); profilUser.setBeratBadan(Double.parseDouble(editProfileFrame.textFieldBeratBadan.ge...
11ce5949-59e2-42e1-a6d9-465265b9a4b5
0
private void estabTwitterConn() { OAuthUser OA = new OAuthUser(); query.track(Settings.baseKeywords); twitterStream = new TwitterStreamFactory( OA.build(Settings.ConsumerKey,Settings.ConsumerSecret, Settings.AccessToken,Settings.AccessSecret)).getInstance(); dataStream = new DataStream(); twi...
ca85e195-8e70-4f30-b6e0-06c9087ff041
0
public void saveEnvironmentStackSize() { savedEnvironmentStackSize = environmentStack.size(); }
494a0c7f-77ec-492e-b5db-232001575c64
8
private void init() { if (Double.compare(getWidth(), 0) <= 0 || Double.compare(getHeight(), 0) <= 0 || Double.compare(getPrefWidth(), 0) <= 0 || Double.compare(getPrefHeight(), 0) <= 0) { setPrefSize(PREFERRED_SIZE, PREFERRED_SIZE); ...
40bfc9d5-e921-4da9-b682-032f185559da
7
public void checkSideCollision(Rectangle rleft, Rectangle rright, Rectangle leftfoot, Rectangle rightfoot) { if (type != 5 && type != 2 && type != 0) { if (rleft.intersects(r)) { robot.setCenterX(tileX + 102); robot.setSpeedX(0); } else if (leftfoot.intersects(r)) { robot.setCenterX(tile...
ee989360-58e2-458a-9945-05c5daab6c40
4
@Override public boolean vetoContinueAfterCall(int currentAddress, int jumpAddress) { if(jumpAddress == 0x4793) // messes with stack, reads return address as jump table return true; if(jumpAddress == 0x47a8) // messes with stack, reads return address as jump table return true; if(jumpAddress == 0xc80d7) //...
81405879-6afd-4176-a2c2-86068158348e
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TuileBonus other = (TuileBonus) obj; if (!Objects.equals(this.troupe, other.troupe)) { return...
f30048af-ce20-4646-abbf-2562a6cfa828
6
public void func_40449_a(TileEntityEnchantmentTable par1TileEntityEnchantmentTable, double par2, double par4, double par6, float par8) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F, (float)par6 + 0.5F); float var9 = (float)par1TileEntityEnchantmentTable.tic...
aa9ce582-63e4-45c0-a366-726b7b8041a9
4
public static int getLine(int l) { int line = 0; switch (l) { case 1: line = 0; break; case 2: line = 1; break; case 3: line = 2; break; case 4: line = 3; } return line; }
b0e8a497-607b-4e34-a6b0-a2ad527c8f40
3
public void addToCartHasCreateAccount(DriverGenerator dg){ // boiler plate WebDriver wd = dg.generate(); ParallelPrepHelper pph = new ParallelPrepHelper(wd); // setup boolean madeItToPage = pph.goToURL(AMAZON_HOME_PAGE); boolean foundAndClickedOnElementOne = pph.clickOnVisibleElement(TODAYS_DEALS_LINK); b...
225393ae-51d5-4dfb-99cf-89c128b43e59
4
public QuestConverter(){ System.out.println("\n\n\n\n [Hawox's uQuest]Converting old Quests..."); iProperty questStorage = new iProperty("plugins/uQuest/uQuest_Quests.txt"); //HashMap<Object,Object> masterOutput = new HashMap<Object,Object>(); Yaml y = new org.yaml.snakeyaml.Yaml(); //y.setUseGlobal...
538ef4d5-7e89-46ff-ab70-34b5104ed73f
8
static public byte[] decode(final String base32) { int i, index, lookup, offset, digit; byte[] bytes = new byte[base32.length() * 5 / 8]; for (i = 0, index = 0, offset = 0; i < base32.length(); i++) { lookup = base32.charAt(i) - '0'; /* Skip chars outside the lookup tab...