method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
35cbb380-9534-40d4-8694-2aff48ca9d64
9
private boolean canFlipHorizontal(long binPosition, boolean goesRight){ boolean hasFlippableDisk = false; long searchPosition = binPosition; if(goesRight && (binPosition & 0x0101010101010101l) == 0) searchPosition = binPosition >> 1; else if( !goesRight && (binPosition & 0x...
5a3797c0-8ff6-4fdf-a749-80def719b42c
3
public static void withOpen(String filePath, String mode, EAction1<RandomAccessFile> block) { RandomAccessFile recordFile = null; try { recordFile = new RandomAccessFile(filePath, mode); block.call(recordFile); } catch (Throwable e) { throw new RuntimeException(e); } finally { try { if (recordFil...
b7ac433c-a352-4dce-be4d-4931dab320b2
6
public void setPosition(PositionY pY, PositionX pX) { Dimension screenS = Toolkit.getDefaultToolkit().getScreenSize(); int x = 0, y = 0; switch (pX) { case LEFT: x = 0; break; case CENTER: x = screenS.width / 2 - getWidth() / 2; break; case RIGHT: x = screenS.width - getWidth(); break; }...
2b6bbdb0-156c-4bc5-805a-b285acdd222c
0
public static void main(String[] args) { int a = AGE; System.out.println(a); output(); }
bff3c380-9936-400f-98a2-29066d3f6155
9
@Override public Dimension maximumLayoutSize(Container parent) { long height = 0; long width = (mColumns - 1) * mHGap; synchronized (parent.getTreeLock()) { Insets insets = parent.getInsets(); int compCount = parent.getComponentCount(); int[] widths = new int[mColumns]; int rows = 1 + (compCount - 1...
8d464eef-f500-40ec-bc0b-f2bd70f0d94c
5
final void initializeApplet(int i, int i_15_, int i_16_, int i_17_, int i_18_, String string, int i_19_) { anInt25++; try { if (Class348_Sub40_Sub9.anApplet_Sub1_9169 != null) { Class348_Sub51.loadedCounter++; if (Class348_Sub51.loadedCounter >= 3) method82(112, "alreadyloaded"); else getApp...
bd2fb496-a989-40b4-abd8-2f89f5499084
9
public EvolvingGraph replaceNode(int nOut, int nIn){ EvolvingGraph graphIn = new EvolvingGraph(sample); if(nIn > original.getNumOfNodes() || nOut > original.getNumOfNodes()) fail("Node numbers given should be between 0...NNodes-1"); if(sampledNodes.indexOf(nOut) == -1) fail("The node to be taken out does no...
def71653-27d7-456f-a040-4a9a89ef1012
8
public String getPermutation(int n, int k) { int[] FACTORIAL = { 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 }; int len = n; boolean[] used = new boolean[len]; for (int i = 0; i < len; i++) { used[i] = false; } StringBuilder sb = new StringBuilder(); while (n-- > 1) { int tims = k / FACTORIAL[n - 1];...
4c869ae9-c9b4-45ff-9081-383f40775f54
2
public StronglyConnectedComponents(Digraph G) { marked = new boolean[G.V()]; id = new int[G.V()]; OrderDirectedDFS order = new OrderDirectedDFS(G); for (int v : order.reversePostOrder()) if (!marked[v]) { dfs(G.reverse(), v); count++; } }
d09920e7-0e22-4b62-91f3-edcce1311898
1
@Test public void shouldThrowError() { //when String message = "Dies ist eine Fehlermeldung."; ValidBean validBean = new ValidBean(false, new GOLException(message)); //then try { throw validBean.getExceptionOnInvalid(); } catch (Exception e) { ...
b460878c-c4e1-49a7-aeaf-1372a5510fdc
2
public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException { Configuration conf = new Configuration(); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (otherArgs.length != 2) { System.err.println("Usage: H...
44efe1f9-8a02-41cc-88fc-1de418994054
1
private String toJavaCase( String value ) { String line = value; if ( value.length() > 0 ) line = line.substring( 0, 1 ).toLowerCase() + line.substring( 1 ); return line; }
32b489ce-23fa-4a07-ac5f-4f4873d7ea4f
4
public SwitchGate getCellGate(int x, int y) { for (int i = 0; i < switchGates.length; i++) { if (switchGates[i] == null) continue; for (int j = 0; j < switchGates[i].getGateSize(); j++) { if (switchGates[i].getNearGate(x, y)) { return switchGates[i]; } } } return null; }
9dc01215-2d23-424a-a940-424f0ca78a52
0
protected final Logger getLogger() { return LoggerFactory.getLogger(this.getClass()); }
70af9ecc-0884-409c-afc3-c3179d98f836
1
public void addNode(int pos, long nodeId){ if (nodes.size()>pos) nodes.get(pos).add(nodeId); }
9a9f9f02-9d8f-4629-9b2e-78fb2ebfe871
0
public void setKey(String key) { this.key = key; }
f4bb3ce0-3e7c-4474-9b11-92a3302a42b0
9
private ArrayList<Tile> findAxisX(int x, int y) { ArrayList<Tile> word = new ArrayList<Tile>(); // First let's check left if ( x != 0 ) { if ( !this._board.isEmpty(y, x-1, true) ) { int starting = x; while ( starting-1 >= 0 && !this._board.isEmpty(y, starting-1, true) ) { word.add(0, this._boar...
159b1857-0b24-4342-bf33-3dacb2d1aefa
0
public PermissionHandlerWrapper(Permission permission) { this.permissionBase = permission; }
d0926aad-478c-44f3-9cb0-ff69236a58ac
1
private static <K, V> Map<String, Object> serializeMap(Map<K, V> map) { Map<String, Object> data = new HashMap<String, Object>(); data.put("T", "L"); data.put("class", map.getClass().getName()); List<List<Object>> pairs = new ArrayList<List<Object>>(map.size()); for (Map...
9fafde2a-e1eb-4841-bcd2-18070cbd3b60
5
@Override public void run() { long delta = 0; game = new Game(); game.start(); while (true) { long start = System.currentTimeMillis(); game.update((int) delta); BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(3); continue; } render(bs.getDrawGraphics...
07c7e796-fcfe-446f-beea-86673a364c46
2
@Override protected Void doInBackground() throws Exception { Client client = new Client(); client.getKryo().register(PacketLogin.class); client.getKryo().register(PacketLoginResponse.class); client.getKryo().register(PacketRequestCaptcha.class); client.getKryo().register(Pac...
ce35faab-9486-4056-8a34-7392ef913119
9
public static int getmax(int[] l, int[] t) { int count = l.length; int res = 0; if (count <= 2) return count; for (int i = 0; i < count; i++) { for (int j = i+1; j < count; j++) { int test1 = t[i]; int test2 = t[j]; int tempcount = 0; for (int k = 0; k < count; k++) { if (test1 >= t[k...
0bec5513-07ee-47cd-b445-c15ffd2b900d
3
private void initMap() { listFieldNbSourisSorti.clear(); listNbSourisSorti.clear(); listNodeDepart.clear(); listNodeFromage.clear(); listDepartToFromage.clear(); fieldVitesse.setText("500"); nbPorte = 0; nbTour = 0; nbDeplacement = 0; nbSourisEnCours = 0; nbSourisArrivees = 0; nbSourisSorties...
7a74a5c0-809c-46a8-99b7-252845386800
9
public static AbstractDictionary dictionary(Surrogate collectiontype, Cons alternatingkeysandvalues) { { AbstractDictionary dictionary = ((AbstractDictionary)(Surrogate.createObject(collectiontype, Stella.NIL))); Stella_Object key = null; Stella_Object value = null; Cons copy = Stella.NIL; C...
5c747963-08bd-4c95-8ee2-4a8373376d6c
4
public static String getHoraMSUtilDate(java.util.Date date){ if(date==null) return ""; String strDate=""; if(getHora(date)<10) strDate+="0"+getHora(date); else strDate+=getHora(date); if(getMinutos(date)<10) strDate+=":"+"0"+(getMinutos(date)); else strDate+=":"+getMinutos(date); if(getSegu...
41a1aad0-cf39-4890-9fce-e22695d46f8d
0
public OrderByIterable(Iterable<T> source, Comparator<T> comparator) { this._source = source; this._comparer = comparator; }
b2de5c07-4d2b-4fa2-9daa-29743b6c8c08
2
@Override public boolean equals(Object obj) { return (obj instanceof LngLatAlt) && (((LngLatAlt)obj).getLatitude() == latitude) && (((LngLatAlt)obj).getLongitude() == longitude); }
e7778792-71b0-419d-b3fa-186af8075aae
1
static synchronized public InputStream getResourceAsStream(String name) { InputStream is = null; if (hook!=null) { is = hook.getResourceAsStream(name); } else { Class cls = JavaLayerUtils.class; is = cls.getResourceAsStream(name); } return is; }
d86eb9f6-1682-4866-89d5-8441638f3c61
5
@Override public final void addFooterLines(String... lines) { if (lines != null && lines.length > 0) { for (String line : lines) { if (line == null) { footer.add("#; "); } else if (line.startsWith("#;")) { fo...
bf1eb8db-9b68-4480-bb0e-1d9d1854b135
2
public boolean shapeValido (){ if (cultivo == null) return true; if (cultivo.equals("VT")) return false; else return true; }
2b2e7d05-fcac-403c-836e-7bb0bb59d65c
0
public JScrollPane getjScrollPane2() { return jScrollPane2; }
6adbde91-ae30-4c4e-b2ac-62c2abae79b4
8
public static int numpadToX(char num){ //returns the x direction of each keypad input. default is zero because a non-directional key doesn't allow movement. switch(num){ case('1'): return -1; case('2'): return 0; case('3'): return 1; case('4'): return -1; case('6'): return 1; case('7'): ...
48295707-1586-4c09-aa78-b4f3b124fe2b
5
@Path("/admin/profiles.json") @Produces(MediaType.APPLICATION_JSON) @PUT public String updateProfiles( @Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("json") String json ) { if( !checkHostInfo(request.getRemoteHost(), AdminProperties.getHttp_allowed()) ) { ...
f7970120-4c8a-4ae4-b35b-e6b150ed6b46
7
private void fillAllRoles(TheaterPlay play) { for (Act act : play.getActs()) { for (Scene scene : act.getScenes()) { Role allRole = scene.getAllRole(); if (allRole != null) { allRole.setPseudoRole(true); for (Paragraph paragraph : scene.getParagraphs()) { if (paragraph instanceof Passage) {...
d134518e-05b3-4c61-967a-972bcf596de4
8
public static String fixName(String s) { if(s.length() > 0) { char ac[] = s.toCharArray(); for(int j = 0; j < ac.length; j++) if(ac[j] == '_') { ac[j] = ' '; if(j + 1 < ac.length && ac[j + 1] >= 'a' && ac[j + 1] <= 'z') ac[j + 1] = (char)((ac[j + 1] + 65) - 97); } if(ac[0] >= ...
36e8ee65-9b71-425f-9ba5-d7b11768e5e8
9
private static boolean testPfamToGoMapping() { try { final PfamToGoMapping pg0 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) ); final PfamToGoMapping pg1 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) ); final PfamToGoMapping pg2 =...
2097532a-ec97-4603-a846-4eb72716b8bc
7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Transducer that = (Transducer) o; if (lowerRangeLimit != that.lowerRangeLimit) return false; if (type != that.type) return false; if (u...
5306da9d-fd84-4845-af1f-6133759c7b54
8
public void buildClassifier(Instances instances) throws Exception { // can classifier handle the data? getCapabilities().testWithFail(instances); // remove instances with missing class instances = new Instances(instances); instances.deleteWithMissingClass(); double sumOfWeights = 0; m...
2aa69b24-bda3-4842-84ae-e992797aebfd
1
public void testMinus_int() { Years test2 = Years.years(2); Years result = test2.minus(3); assertEquals(2, test2.getYears()); assertEquals(-1, result.getYears()); assertEquals(1, Years.ONE.minus(0).getYears()); try { Years.MIN_VALUE.minus(1);...
6ecff766-3517-4dcf-8b6a-576477045c34
1
public OrgaEinheit erstelleOrgaEinheit(int idUeberOrgaEinheit, String OrgaEinheitBez, String Leitername, int idLeiterBerechtigung, boolean Zustand, int idMitarbeiterBerechtigung){ OrgaEinheit rueckgabe = null; try { rueckgabe = new OrgaEinheit(idUeberOrgaEinheit, OrgaEinheitBez, Leitername, idLeiterBerecht...
041c0a42-b664-4869-a650-306fb1c8f744
5
public TemperatureSet(String stationId, HashMap<String, String> minSet, HashMap<String, String> maxSet, BufferedWriter out) { _stationId = stationId; for (String s : minSet.keySet()) { TemperatureDate td = new TemperatureDate(); if (minSet.get(s) != null) td._min = Float.parseFloat(minSet...
f3820c20-7d59-40fa-9bef-6d468b85c94c
6
public BitMatrix cut(int s, int i, int j) { if (s<=0 || s>n) throw new Error("s = " + s); if (i+s>n || j+s>n) throw new Error("Cut overflow"); BitMatrix M = empty(s); for (int r=0;r<s;r++) { BitSet src = m[i+r]; BitSet trg = M.m[r]; for (int c=0;...
c4f78291-fcbe-4506-bd83-1879380ddeea
4
private String scanTagHandle (String name) { char ch = peek(); if (ch != '!') throw new TokenizerException("While scanning a " + name + ", expected '!' but found: " + ch(ch)); int length = 1; ch = peek(length); if (ch != ' ') { while (ALPHA.indexOf(ch) != -1) { length++; ch = peek(length); } ...
5696001b-7fb3-4019-98fd-214e2d4c72b7
2
public DataModule getDataModuleContaining(String segment){ for(int i = fragments.size(); i > 0; i--){ DataModule dataModule = getDataModule(fragments.get(i - 1)); if(dataModule.getDataAt(segment).isEmpty()){ continue; } return dataModule; } return null; }
a8b8f2f0-b43a-485e-a7dd-46fbf9471324
6
private void initField(Field[][] fields) { for (int i = 0; i < sizeX; i++) { for (int j = 0; j < sizeY; j++) { fields[i][j] = new Field(this, i + j * sizeX); } } for (int i = 0; i < sizeX; i++) { fields[i][0] = new BorderField(fields[i][0]); ...
84b34a00-114e-4281-8a3e-6473da6d0cd4
4
@Override public void run() { if (tryContinue()) return; // 6 before enter, 7 while talk // 8 after ladder if (!npc().valid()) { enter(); } if (stage() >= 8 || ctx.chat.visible("It's time to enter some caves")) { leave(); return; } super.run(); }
acc0ff6a-6a66-428d-9f1b-2b2c4991918f
6
@Override public boolean activate() { return (Game.getClientState() != Game.INDEX_MAP_LOADED || (Game.getClientState() == Game.INDEX_MAP_LOADED && Ivy.stop == 1000) || Ivy.client != Bot.client() || (Walking.getEnergy() == 100 && !Walking.isRunEnabled()) || Widgets.get(640, 30).isOnScreen() ); }
d0f81ae9-208f-4dd6-8382-8d0a849a4373
2
public static final boolean isJS(String fileName) { for (String file : JS) { if (file.equals(fileName)) { return true; } } return false; }
4f7e46f0-08dc-403b-976f-e6ee249e3618
8
public Object getAdapter(Class type) { if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) { return new UndoablePropertySheetPage(getCommandStack(), getActionRegistry().getAction(ActionFactory.UNDO.getId()), getActionRegistry().getAction(ActionFactory.REDO.getId())); } if (type == G...
719bf0e1-583e-4f8b-856e-00841e32a56c
9
public static void main(String[] args) { @SuppressWarnings("resource") Scanner in = new Scanner(System.in); System.out.println("Enter first string"); String leftString = in.next(); System.out.println(); System.out.println("Enter second string"); String rightString = in.next(); if (leftString =...
5b1c93ef-a14f-40d5-adc3-64b24d9150dc
6
public static Mesh load(File file) throws IOException, FileNotFoundException { BufferedReader reader = new BufferedReader(new FileReader(file)); MeshBuilder m = new MeshBuilder(); String line; int type = -1; m.startMesh(); while((line = reader.readLine()) != null) { //remove additional whitespaces...
e2fa9880-e2c8-481d-ac82-a92ec875ca50
8
void generatePrimes_03(int min, int max){ for( int integer= min<2?2:min ; integer < max+1 ; integer++ ){ boolean isPrime = true; if( !primeNumbers.contains(integer)){ int check = 2; int maxCheck = integer; while(integer>2 && check < maxCheck){ if(integer%check == 0...
e81956e0-015c-42f9-8156-6c0daa7df7fa
7
@Override public String readString(String encoding, int length) throws IOException { Charset charset = Charset.forName(encoding); CharsetDecoder dec = charset.newDecoder(); ByteBuffer bin = ByteBuffer.allocate(8); CharBuffer bout = CharBuffer.allocate(1); String ret = "";...
6d2bbcc5-6188-428f-82f0-c4d120de7921
2
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{ if(input.isKeyPressed(Input.KEY_ENTER)){ sbg.enterState(1); } if(input.isKeyPressed(Input.KEY_ESCAPE)){ gc.exit(); } }
1507c0bf-3506-4802-b81a-bcd38809ee0e
5
public static String GetTaskday(Task t) { int x = (int) DateUtils.getDiffInDays(Calendar.getInstance(), t.getStartDate(), false); byte i = 1 ; initMaps(); if (!t.getModelStatus().isEndUserStatus()) { i = -1; } days.put(ALL,(byte) (days.get...
4b69ae02-fa88-4de9-9474-63b3d68eab32
3
@Override public void execute(CommandSender sender, String gateName, List<String> args) { this.sender = sender; Object[] gatesArray = plugin.getGates().namesArray(); java.util.Arrays.sort(gatesArray); String gateList = ""; for (Object gateObj : gatesArray) { String thisGateName = (String) gateObj; ...
b4eacd1d-b36c-4ec6-a60e-501f58403685
3
public static void fillDP() { dp = new int[1000001]; int con = 1, lim = 0, ch = (int) 'A'; for (int i = 0; i < dp.length; i++) { if (ch > (int) 'Z') ch = (int) 'A'; if (lim == con) { dp[i] = ch; lim = 0; con++; ch++; } else { lim++; dp[i] = ch; } } }
cc745801-1cf6-43af-95d1-32159c83914c
5
public void checkNode(GameState nodeToCheck) { if(valid(nodeToCheck)){ System.out.println("Found shortest way"); System.out.println("Die Weglaenge ist: "+(nodeToCheck.getaStarG()-1)); System.out.println("Der weg ist: "); while(nodeToCheck.getPredecessor() != null){ System.out.println(nodeToCheck.toStr...
bd6cdda5-5429-413a-a46a-e2939aaa0faf
7
private static ArrayList<LineAnaVO> setHindex(ArrayList<LineAnaVO> lList, int code) { ArrayList<LineAnaVO> newOne=new ArrayList<LineAnaVO>(); int size=lList.size(); while(newOne.size()<size){ int max=-1; int tmp=-1; int index=-1; for(int i=0;i<lList.size();i++){ LineAnaVO vo = lList.g...
4290f72b-f072-46ec-95d3-91fff6b8e837
9
public boolean getGifts(int index,float sum, int n) { if((sum>=0&&n==0)) { if(sum<minSum) { gift_list.clear(); ArrayList<Products>tmp = new ArrayList<Products>(); for(int i=0;i<gift.size();i++) { tmp.add(gift.get(i)); } gift_list.add(tmp); minSum = sum; ...
48857419-82a4-4c23-a787-00199c902e18
2
public ArrayList<Trajet> getTrajetByConducteur(Membre m){ ArrayList<Trajet> res = new ArrayList<Trajet>(); for(Trajet t : listeTrajets){ if(m==t.getConducteur()) res.add(t); } return res; }
4d13cfb2-d5b9-4a56-b7ca-cf1bd2300af4
4
public static int mst(int[][] nabomatrise){ int start = 0; ArrayList<int[]> edgeList = findEdges(nabomatrise[start], start); ArrayList<Integer> noderSett = new ArrayList<Integer>(); int max = Integer.MIN_VALUE; noderSett.add(start); while (noderSett.size() < nabomatrise.length) { int[] currentEdge = new ...
e304fdaa-96ac-4be7-b3dd-ecbd0b480288
0
public Integer getPlainValue() { return plainValue; }
20ba0301-5ce5-4b61-b79d-dfcf559fd9a0
8
public String verifica_estruturas(){ String str = ""; str+="Circulo\n"; for (Circulo c : ctrCirculo.circulos_desenhados) { str+=c.toString(); str+="\n"; } str+="Arco Circulo\n"; for (Circulo c : ctrCirculo.arcos_desenhados){ str+=c.toString(); str+="\n"; } str+="Elipse\n"; for (Elips...
25576e3f-5083-4c14-86f2-a256a1c8fee1
3
@EventHandler(priority = EventPriority.NORMAL) public void onEntityExplode(EntityExplodeEvent event) { if (event.isCancelled()) return; // plugin.debug(event.getEventName()); for (Block block : event.blockList()) { if (plugin.isProtected(block)) { plugin.debug("Blocking explostion at " + block.getWorl...
610f81eb-c165-4965-947b-e738db6f7cbd
4
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAcce...
ff23c1f7-551a-492f-ad2f-f50257819e1e
1
public static IClienteDAO getClienteDAO(){ if(clienteDAO == null){ clienteDAO = new ClienteDAOImpl(); } return clienteDAO; }
5087d44f-fcfe-4668-8b33-e50cbd81c6c2
0
public WorkThread(Runnable target, AtomicInteger counter) { this.target = target; this.counter = counter; }
1a2c22ce-4dff-44c8-9afe-3899a5f2d0e9
8
final public void Function_return_declaration() throws ParseException { /*@bgen(jjtree) Function_return_declaration */ SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_RETURN_DECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken...
30a3af67-a089-4cc7-9d41-d76ce443fe27
4
public void run () { try { getNPCData(); Thread.sleep(15000); while (true) { for (Integer i = 0; npcData.size() > i; i++) { String isPathfind = "does"; if (!doPathfind(i)) isPathfind = isPathfind ...
cda37159-7559-47e0-81c9-f4e7d384895d
3
private TypeMirror getTypeMirrorOf(final Declaration decl) { TypeMirror typeMirror = null; if (decl instanceof FieldDeclaration) { typeMirror = ((FieldDeclaration) decl).getType(); } if (decl instanceof ParameterDeclaration) { typeMirror = ((ParameterDeclaration) ...
90aecf5e-8160-4042-be6a-62afd1da80e4
3
@Override public ProductModel createBook(BookModel book) throws WebshopAppException { int generatedId = ProductModel.DEFAULT_PRODUCT_ID; if (isValidBook(book, "CREATE_BOOK")) { try (Connection conn = getConnection()) { conn.setAutoCommit(false); try { generatedId = super.insertProduct(conn, boo...
5653e044-4c4b-43a0-a1f1-0cff2cc7ff98
1
public Transition modifyTransition(Transition t, TableModel model) { //EDebug.print("ModifyTransitionCalled"); String s = (String) model.getValueAt(0, 0); try { return new FSATransition(t.getFromState(), t.getToState(), s); } catch (IllegalArgumentException e) { reportException(e); return null; } }
b81e7e1a-a319-4b67-9636-ac8d2816e47d
7
* @param xxx * @param yyy * @param zzz */ public void renderSimpleRail(int textureId, int xxx, int yyy, int zzz, BlockType block, int tex_offset) { float x = xxx + this.x*16; float z = zzz + this.z*16; float y = yyy; byte data = getData(xxx, yyy, zzz); byte powered = data; powered >>= 3; if (po...
807b1661-a0cd-48f4-84b3-66c9bbe9fd28
4
public int compare(Object a, Object b) throws ClassCastException { if(a == null){ return -1; } else if(b == null){ return 1; } else if(a == null && b == null ){ return 0; } else{ MessageBid bida = (MessageBid...
3a336868-2136-45b8-b864-1f7e1edbae95
1
public static void createWindow( int width, int height, String title ) { Display.setTitle( title ); try { Display.setDisplayMode( new DisplayMode( width, height ) ); Display.setVSyncEnabled( true ); Display.setResizable( true ); Display.create( new PixelFormat( 0, 0, 0, 8 ) ); Keyboard.create(); ...
eff9bebe-25c5-480a-8bf6-00d19af76185
1
private void acao131() throws SemanticError { contextoExpressao = ContextoExpressao.IMPRESSAO; if (!Tipo.isImprimivel(tipoExpressao)) throw new SemanticError("Tipo inválido para impressão"); // Gerar código }
5374c3b7-1fbc-44ca-adf5-6f9d07ec9dce
5
protected Boolean tryCheckVLine3(boolean remove) { for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; j++) { int count = (gemArray[i][j]); if (j + 1 <= 5) { if (count == gemArray[i][j + 1]) { if (remove) { ...
fe2c30fb-b89a-40c0-8cbf-b084367177f1
5
static final boolean method1130(r var_r, int i, int i_1_, int i_2_, boolean[] bools) { boolean bool = false; if (aa_Sub1.aSArray5191 != Class332.aSArray4142) { int i_3_ = Class348_Sub1_Sub1.aSArray8801[i].method3986(i_1_, i_2_, (byte) -109); int i_4_ = 0; for (/**/; i_4_ <= i; i...
8b534f87-787e-40a2-999e-4ca9a9202e4c
6
private static void parseBuildings(GameField field, Scanner scanner) throws MapLoaderException { if (!scanner.next().equals("BUILDINGS")) { throw new MapLoaderException("Buildings section not found."); } char buildingChar; int x; int y; int numberOfBuildings = scanner.nextInt(); for (int i = 0; i <...
8f402483-462c-44b8-984b-6840e284031e
0
public void setId(String id) { this.id = id; }
295155e8-3dcc-4c9d-a980-3ea9aac62ffb
0
public Enemy (float startx, float starty){ x = startx; y = starty; }
b2e754be-26c4-44da-a6d8-b3b332da483a
6
double determineRotation(BufferedImage img, double initialRotation, int blackWhiteBoundary) { int w = 0; int h = 0; if (img.getWidth() > img.getHeight()) { w = MAX_DIM; h = MAX_DIM * img.getHeight() / img.getWidth(); } else { w = MAX_DIM * img.getWidth() / img.getHeight(); h = MAX_DIM; } Buffere...
4fc5751f-44bb-4963-a72d-b9d45cbd9340
7
public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { int var3 = 0; for (int var4 = 0; var4 < this.chunkList.size(); ++var4) { Chunk var5 = (Chunk)this.chunkList.get(var4); if (par1) { this.saveChunkExtraData(var5...
b1c1769f-f30d-4d01-b8a2-83207dd5d58f
7
public int xgettrust(int kind, String fmsId) throws IOException { if (!supportsXGETTRUST()) { return -1; // Freetalk doesn't support trust extensions. } send(String.format("XGETTRUST %s %s", trustKindToString(kind), fmsId)); String reply = read(); StatusResponse respo...
8de291f1-2424-4568-a370-356a9f003b10
9
private void step6_7(Beat beat) { System.out.println("6-7: Find chord"); //List<ChordMark> chords = Chord.getChords(beat); //boolean foundChord = chords.size() > 0; ChordMark chordMark = Chord.getChord(beat.getToneMap(), beat); boolean foundChord = chordMark != null; // ak je to zakladny akord tj. +,...
cd5f0943-bd89-4344-879e-b4545bd19ea5
4
@Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } if (id != null) { return id.equals(((GroupBE) that).id); } return super.equals(that); }
63375b5a-b2e7-43fb-b6d3-b9abbd37f17e
8
protected Class findClass( String name ) throws ClassNotFoundException { // Deal with this cast somehow... maybe have this class use // ClassManagerImpl type directly. // Don't add the method to BshClassManager... it's really an impl thing ClassManagerImpl bcm = (ClassManagerImpl)getClassManager(); // ...
bcb483dd-1de0-4f22-8fa7-284a14ccde2b
2
public static pgrid.service.corba.simulation.SimulationHandle unchecked_narrow (org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof pgrid.service.corba.simulation.SimulationHandle) return (pgrid.service.corba.simulation.SimulationHandle)obj; else { org.o...
13180661-ca4a-405c-b2db-185122e39b25
1
@Override public void onDelete(Level l, int index, Server server) { if (_level != l) return; _level.ticks.remove(this); }
067aba86-fe1d-4ef4-a4d3-0e12fabb3a41
3
public String readAndDecrypt(String key) throws GeneralSecurityException, IOException { int content; BufferedReader br; br = new BufferedReader(new InputStreamReader((FileInputStream)this)); StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()...
31bd2f43-00fd-4184-832b-6db566e32c06
0
public GrilledSandwich() { this.setName("GrilledSandwich"); this.setPrice(new BigDecimal(30)); }
61268d8b-1396-48c1-8c17-6549109ae7d7
4
public static void main(String[] args) { IntStats intStats = new IntStats(); // Default input is STDIN InputStream in = System.in; // Input from file? if( args.length > 0 ) try { in = new FileInputStream(new File(args[0])); } catch(FileNotFoundException e1) { throw new RuntimeException("Error openin...
ef9ac39b-f637-4cd6-bb12-4e15e9ce498c
9
@Override public void run() { try { // Eclipse doesn't support System.console() BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); ConfigManager config = NetBase.theNetBase().config(); String server = config.getProperty("net.server.ip"); if ( server == null ) { Sys...
983e7d70-ad73-49f9-8291-88f943476220
8
public final Map<String, Integer> getSkillStats(final int itemId) { if (SkillStatsCache.containsKey(itemId)) { return SkillStatsCache.get(itemId); } if (!(itemId / 10000 == 228 || itemId / 10000 == 229)) { // Skillbook and mastery book return null; } final...
554a61ab-13c9-4549-81ae-3dafd3e1dd5a
8
@Override public Word getMemoryCell(DCPU dcpu, OperandMode mode) { Register register; switch (this.value) { case 0x08: register = Register.A; break; case 0x09: register = Register.B; break; case 0x0A:...
beb21e7b-defd-44df-a5b9-7f5f25e38f86
5
@Override public void keyPressed(KeyEvent ke) { if (isWin==false) { switch (ke.getKeyCode()) { case KeyEvent.VK_LEFT: left(); break; case KeyEvent.VK_DOWN: down(); ...
8fe5b908-0f1d-4739-9402-74bbd10bd256
0
public Land getFirstLand() { return first_land; }
a59f7887-0b28-478a-a10f-7add35d1491d
7
@Override public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { String data; try { ArrayList<FilterBean> alFilter = new ArrayList<>(); if (request.getParameter("filter") != null) { if (request.getParameter("filterop...
b3050f19-ecb9-49b5-9462-c6a77690fe92
5
public static int[][] getHistogram(int[][] imagematrix) { ArrayList<int[]> histogram = new ArrayList<int[]>(); //dynamic array size boolean isNewColor; for(int[] imColumn: imagematrix) { for(int imCell: imColumn) { isNewColor = true; for(int[] hgRow : histogram) { if(hgRow[0]==imCell) { hgRo...