method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
3ea2b6ea-8cf9-48d2-8ad0-6f9f6ecfc914
7
public P077C() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); depth = new int[N]; beavers = new int[N]; for (int i = 0; i < N; i++) { beavers[i] = sc.nextInt(); } ArrayList<ArrayList<Integer>> adj = new ArrayList<ArrayList...
4f007a24-7a39-4d68-a90d-d6406a3f847f
9
private static void enterInteractive() { System.out.println("How many letters should my word be?"); boolean cont = true; Scanner inp = new Scanner(new InputStreamReader(System.in)); String numLetsStr = ""; while (cont) { System.out.print("> "); String line...
c210f5d1-941a-4e28-8cc3-3748a37c55ad
8
public boolean handleEvent (Event event) { if (event.id == Event.WINDOW_DESTROY) quit(); else if (event.target == scrollbar) { int[] view = waveCanvas.getView(); int l = view[1] - view[0]; boolean flag = true; // Bloody Win32 AWT. Hurry up with that rewrite, Sun! // This al...
cc921e8f-f4d9-481a-bcd5-8c13a34c514d
4
@Override public void run() { while (true) { Logger.log("Connecting to " + this.name); RSSFactory factory = RSSFactory.newFactory(); try { URLConnection conn = this.feedURL.openConnection(); RSS feed = factory.parse(conn.getInputStream()); this.storeRelease(feed); }...
29a6d539-f7e4-410f-b704-69a9ff2f9567
3
public String getURLString() { String ret = ""; String[] nameParts = detailMap.get("eventName").split(" "); if (nameParts.length < 3){ for (int i = 0; i < nameParts.length; i++) { ret += nameParts[i]; } } else { ...
002bc4b3-0aeb-42a8-9820-5508a0b8463b
9
public AltaJuego2() throws SQLException { initComponents(); setLocationRelativeTo(null); // ControladorPerfil cont2= ControladorPerfil.getInstance(); // ControladorJuego cont1= ControladorJuego.getInstance(); /******Listo todos los desarrolladores del sistema *****/...
aab9365e-45f9-4c9d-a53a-746c50a77070
9
public static HashMap<String, TreeMap<Double, String>> eParamsCalculator( String fileName) throws IOException { HashMap<String, TreeMap<Double, String>> emissionParams = new HashMap<String, TreeMap<Double, String>>(); FileReader in = new FileReader(fileName); BufferedReader br = new BufferedReader(in); Has...
94878b1f-1591-42a6-a067-e97d9b6ac2d1
0
public double getEntrega() { return entrega; }
443d24f1-c847-4062-81c8-f28658070e73
4
public static boolean endsWithIgnoreCase(String str, String suffix) { if (str == null || suffix == null) { return false; } if (str.endsWith(suffix)) { return true; } if (str.length() < suffix.length()) { return false; } String lcStr = str.substring(s...
707b0da0-8c42-4834-8423-9e018918a481
9
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYTitleAnnotation)) { return false; } XYTitleAnnotation that = (XYTitleAnnotation) obj; if (this.coordinateType != that.coordinateType) { ...
6b5f4c7d-ebdf-4f6c-b7e3-e38ed5e77925
2
public String getBookingTime(){ String hour, min; hour = Integer.toString(date.get(11)); if (hour.length()==1) hour = "0" + hour; min = Integer.toString(date.get(12)); if (min.length()==1) min = "0" + min; return (hour+":"+min); }
3e3fc6eb-7447-44ba-b852-e05724c7baac
7
public synchronized void playQuiz(QuizServer quizAccess, String playerChoice,String[]playerData){ int correctAnswer=0; int quizId=0; int score=0; int recordCount=0; Quiz quiz=null; String quizTitle=""; //List<Integer> quizIdList = new ArrayList<Integer>(); List<Result> resultList = null; Set<Question>...
df163621-38e9-466c-b809-36bec91c0ad7
0
public void setPrpIdFuncionario(Integer prpIdFuncionario) { this.prpIdFuncionario = prpIdFuncionario; }
96707656-85be-484f-91eb-57c56df40952
3
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (myRecipe != null) { if (o == dilutedCheckBox ) { if (dilutedCheckBox.isSelected()) { DilutedRecipe dil = new DilutedRecipe(myRecipe); StrangeSwing.getInstance().setRecipe(dil); myRecipe = dil; } else { Recipe...
4f721e35-c05f-4ae5-9230-14d19289382c
1
public String getFileError(File targetDir) { if (targetDir.exists()) { return "The directory is missing a launcher profile. Please run the minecraft launcher first"; } else { return "There is no minecraft directory set up. Either choose an alternative, or run the minecraft launch...
b2173f36-ec61-4da6-8981-e2347b17a000
3
public static void indexTFIPF(){ DatabaseManager dbm = new DatabaseManager(); //dbm.createTables(); String docName = ""; dbm.emptyTables(); long debutTime = System.currentTimeMillis(); XMLParser.initHashMaps(); for(int docNum...
2bfefb08-c7ce-4f1d-a7d1-b1de192fd612
8
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o.getClass().equals(ArgHolder.class)) { ArgHolder<?> v = (ArgHolder<?>) o; boolean equal = getType().equals(v.getType()); equal &= v.isSetValue() == isSetValue(); if (equal && isSetValue()) { equal ...
ab38f494-ec2d-4458-87ac-4e4e05b91c93
6
public static <T extends Comparable> Pair<T> max(T[]a){ if(a.length==0 || a==null) return null; T max1 = a[0]; T max2 = a[0]; int i=0; for(; i<a.length;i++){ if(max1.compareTo(a[i])<0) max1 = a[i]; if((max2.compareTo(a[i])>0) && max2!=max1)...
a9d826a1-08a7-412a-9d19-e1076f917498
4
public boolean isDictType(String match) throws IOException { if (type == INDIRECT) { return dereference().isDictType(match); } else if (type != DICTIONARY && type != STREAM) { return false; } PDFObject obj = getDictRef("Type"); return obj != null && obj.g...
35c1679b-86a3-43a6-b91d-5649870a4715
5
public static void main(String[] args) { Scanner input=new Scanner(System.in); int a=input.nextInt(); int b=input.nextInt(); List<Integer> dig = new ArrayList<Integer>(); if(b<a){ int mask=b; b=a; a=mask; } for (int i = a; i <=b; i++) { dig=myNumbers(i); int count=dig.size()/2; bool...
0b309656-559d-4866-b414-beb4c30a5845
0
public String getNom() { return nom; }
09985e72-9658-4122-a500-088a1e0b8f0f
4
private void setSuit() { if(this.id < 13*Deck.numDecks){ this.suit = "Hearts"; } else if(this.id < 13*2*Deck.numDecks){ this.suit = "Diamonds"; } else if(this.id < 13*3*Deck.numDecks){ this.suit = "Spades"; } else if(this.id < 13*4*Deck.numDecks){ this.suit = "Clubs"; } }
a033662a-a11e-4ffe-867f-d68a974c58cd
1
public void save() { try { TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); ...
72fb1627-2a61-470e-b885-21d26bb8512d
5
public void show() { if (options.isButtonHideOnSelect() && mainMenuButton.getOpacity() > 0) { return; } if (options.isButtonHideOnSelect() || mainMenuButton.getOpacity() == 0) { mainMenuButton.setScaleX(1.0); mainMenuButton.setScaleY(1.0); cross.s...
74e4a345-1647-4b6a-a077-65511b31db65
1
public synchronized boolean isDownloading() { return this.requests != null && this.requests.size() > 0; }
f7c9a288-9f18-4305-b7d0-2b603c55306d
4
public String OperatorDir( int Case){ switch(Case) { case 1: int data = (int) (Math.random() * 65535 - 1); String dataR = Integer.toString(data); return dataR; case 2: int data1 = ((int) Math.floor(Math.random() * 20 )); String data1R = Integer.toString(data1); return data1R; ...
2c052705-120a-4069-88e4-d8a20db81e00
2
public void changeAce() { for (int i = 0; i < hand.size(); i++) { if (hand.get(i).getValue() == 11) { hand.get(i).setValue(1); break; } } }
ebca33f0-f3da-4de9-bcf8-2fed28de6848
7
protected void onTick() { if (myAgent.satisfaction <= 0) { DFServiceUtils.sendMsgToService(myAgent, myAgent.parting_sentence, Constants.HOST_SERVICE, Constants.GOODBYE); myAgent.blockingReceive(MessageTemplate.MatchConversationId(Constants.GOODBYE_ACK)); myAgent.doDelete(); return; } ACLMessage ...
ede04c8f-2aca-471c-9d84-4c4fb3c6057b
4
public void handleParsedCommand(String[] commandArr) { if(commandArr[0].equalsIgnoreCase("message")) { int target = Integer.parseInt(commandArr[1]); String message = commandArr[2]; System.out.println("Message sending to: " + target); MachatServer.sendMessage(target, thi...
34f861ed-5635-4693-9cc7-1faa3be0ab62
2
public String cyclify() { if (isFree) return "FREE"; else if (isInvalid) return "INVALID-CONSTANT"; else return "#$" + getName(); }
d2530026-0959-4466-8074-68f13ee5ccb4
3
public Set<Set<String>> getSubsets(Set<String> set){ Set<Set<String>> setsOfSets = new HashSet<Set<String>>(); if(set.isEmpty()){ return null; } if(set.size()==1){ setsOfSets.add(set); return setsOfSets; } for(int i=1; i<set.size(); i+...
90f4a343-f5fd-41d8-a0a6-5b3661fc0534
6
public int getPlayerId(String username) { PreparedStatement selectStmt = null; PreparedStatement insertStmt = null; ResultSet rs = null; try { // если есть уже такой пользователь - получить его id selectStmt = SQLiteConnection.getInstance().getConnection().prep...
d786e407-d0dd-416f-a51e-1d20401fb859
1
private Simulateur(int taille) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } rp = new RondPoint(taille); tour = new Tour(this); UI = new SimulateurUI(this); rp.updateUI(UI); }
565fa774-a869-40c3-a610-b42e3d331e58
8
public DodgeWindow(int x,int y) { xIndex=x; yIndex=y; //setUndecorated(true); pack(); //getInsets() only works after you call pack() or show for some reason... Goddammit Java origX=(int)(MainClass.scale*MainClass.resolution/MainClass.yWindows*x+MainClass.edgePaddingX+((x!=0) ? MainClass.windowPaddingX/2 : 0...
83b65ee8-86ce-450d-a2ce-3ca85a72c31d
6
public boolean equals(Object o2) { if (o2 instanceof Style) { Style ss2 = (Style)o2; if (this.underline==ss2.underline && areEqual(foreground, ss2.foreground) && areEqual(background, ss2.background) && areEqual(font, ss2.font) && areEqual(fontMetrics, ss2.fontMetrics)) return true; } re...
1b34e4e0-a2ef-4d7a-993b-9f221303904a
7
protected final int getStatusByte() { return ((carry ? 0x01 : 0) + (zero ? 0x02 : 0) + (disableInterupt ? 0x04 : 0) + (decimal ? 0x08 : 0) + (brk ? 0x10 : 0) + 0x20 + (overflow ? 0x40 : 0) + (sign ? 0x80 : 0)); }
193ab305-72c8-4905-b7c6-0ba33b437832
4
private static int applyNumberScore(String passwd) { int numbers = 0; // NUMBERS Matcher m = Pattern.compile(".??[0-9]").matcher(passwd); while ( m.find() ) // [verified] at least one number { numbers += 1; } if (numbers == 1) { log.debug("5 points for 1 number."); return 5; } ...
a8d633ea-349b-4436-b4a9-1ffa21b6006d
2
private void writeUserList() { UserXMLHandler writer = new UserXMLHandler(); try { writer.writeToFile(userList); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-gen...
457bf326-331d-47f5-8da2-92b3ba236d44
4
public void movement() { left = input.getLeft(); right = input.getRight(); shoot = input.getShoot(); if ( (xShip < (window.getWidth() - ship.getWidth()/3 - 5))){ if (right) { xShip += moveSpeed; } } if (xShip >= 0 ){ if...
a7c722bb-5f04-4b9c-917e-3b9bfc2db2e0
8
public static void main(String[] args) { EvolvingGlobalProblemSetInitialisation starter = new EvolvingGlobalProblemSetInitialisation(); starter.initLanguage(new char[] { 'a', 'b' }, 10, "[ab]*abab"); int solutionFoundCounter = 0; int noSolutionFound = 0; List<Long> cycleCount = new LinkedList<Long>(); long...
81e278d9-ddfa-4d13-a7e5-aa18805b504d
8
public static final String escape(String str) { StringBuilder sb = new StringBuilder(); sb.append(CHAR_DQUOTE); for (int i = 0, n = str.length(); i < n; ++i) { char ch = str.charAt(i); if (ch == CHAR_DQUOTE || ch == CHAR_BACKSLASH) { // || ch == '/') { sb.append(CHAR_BACKSLASH); sb.append(ch); } ...
0883bd62-c72c-45d8-be92-f3b5294cac3b
4
public void nextPermutation(int[] num) { int last = num.length - 1; for(int i = last; i > 0 ; i --){ Arrays.sort(num,i,last+1); if(num[last] > num[i-1]){ for(int j = i ; j < last + 1 ; j ++){ if(num[j] > num[i-1]){ ...
d429282c-a893-441b-9808-57717530d7de
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Dokumentvorlage)) { return false; } Dokumentvorlage other = (Dokumentvorlage) object; if ((this.dokumentvorlage...
7a2e7e69-311d-4054-9048-b9cb7d5c028d
6
public static <GSection extends ArraySection<?>> GSection validate(final GSection section) throws NullPointerException, IndexOutOfBoundsException, IllegalArgumentException { if (section == null) throw new NullPointerException("section = null"); if (section.array() == null) throw new NullPointerException("array = ...
d096eb94-eac1-446a-98d3-826a8e5e8526
9
public WxMsgItem parseLine(String line) throws Exception{ //ʼline̫Ҳʹʾƺݲʹ //List<String > lists = getValue("^.*\"MsgType\":([0-9]+).*$", line); int lidx , ridx; lidx = line.indexOf("\"MsgType\""); lidx = line.indexOf(":",lidx + 1); if(lidx == -1) throw new Exception("Malformed WxMsg"); ridx = line.inde...
fe75c733-1adc-4edd-8e82-c63750091212
0
@Override public void lost() { }
32544a9a-00a7-43aa-b110-98eea0c45acd
8
protected DateTime nextIrrigationAt() { DateTime dt = new DateTime(); for (int i = 0; i < 7; i++) { for (final int dayOfWeek : wateringDays) { if (dayOfWeek == (dt.getDayOfWeek())) { // If it's the first run then we may match the same day we are currently on, in this case // we...
dcafb10b-773a-4f83-bd53-32316ab2243f
2
protected static int compareDoubles(double a, double b) { return a > b ? 1 : a < b ? -1 : 0; }
2c6e645b-b561-4efb-aa41-10c76fe6b58a
1
@Override public ResourceType getResourceTypeByResourceId(String id) { if (resources.containsKey(id)) { Resource resource = resources.get(id); return resource.getResourceType(); } else { return null; } }
88f56fc0-af6a-46c7-8d2e-eae1625d6fc0
1
@Override public void render() { super.render(); if(loc.getWeaponID() == WeaponLocation.NO_WEAPON) { Renderer.get().drawText("Add a weapon:", x, y); shop.render(); } else { GameActor a = Application.get().getLogic().getActor(loc.getWeaponID()); ...
266908e3-0476-4328-9e6e-1d46ab158e1a
2
@Override public void put( ByteBuffer out, Boolean v ) { out.put( v == null ? Compress.NULL : (v ? F_TRUE : F_FALSE) ); }
a5e8cb09-2633-402f-b0ed-83bc2e27a96e
2
void runMain(String[] args) throws IOException { parse(args); initialize(); runJSCover(args); if (LoggerUtils.getInstance().isExceptionThrown()) exitStatus = 1; if (exitStatus != 0) mainHelper.exit(exitStatus); }
59db7787-48e6-4ba8-9667-70e4a400937a
5
public synchronized byte[] sendMutualAuth(byte[] rndIFD, byte[] rndICC, byte[] kIFD, SecretKey kEnc, SecretKey kMac) throws CardServiceException { try { ResponseAPDU rapdu = transmit(createMutualAuthAPDU(rndIFD, rndICC, kIFD, kEnc, kMac)); byte[] rapduBytes = rapdu.getBytes(); if (rapduBytes == nu...
bb424438-5da7-4f1b-a98c-b285f922a362
2
public static String getClipboardText() throws Exception { Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); if ((t == null) || (!t.isDataFlavorSupported(DataFlavor.stringFlavor))) return null; return (String) t.getTransferData(DataFlavor.stringFlavor); }
5121e482-1b77-42a5-a33a-4a751defc440
0
@Test public void deleteMinSingleEntry() { l.insert(v); l.delete(); assertEquals(null, l.min()); assertEquals(null, l.max()); }
467ebd1d-084d-4b75-b818-bd6c0d586dfd
9
public static Class getPrimitiveClass(Class toClass) { if (isPrimitive(toClass)) { return toClass; } if (toClass.equals(java.lang.Boolean.class)) { return boolean.class; } else if (toClass.equals(java.lang.Byte.class)) { ...
83bc26d3-2100-44b3-b5c3-e7e26565daa7
8
private static void processLaunchExternal() { String externalFile = Boot.argProps.getProperty(LAUNCH_EXT_ARG); if (externalFile == null) { logger.info("No External File to Launch"); return; } logger.info("Launching external file:" + externalFile); launch...
7e089c38-9f84-4286-815f-a194337fba48
0
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new java...
15cdbbea-665f-489f-9a1b-bca61fa79f08
5
public void handleKeyRelease(int value) { switch (value) { case MinuetoKeyboard.KEY_UP: this.keyUp = false; break; case MinuetoKeyboard.KEY_LEFT: this.keyLeft = false; break; case MinuetoKeyboard.KEY_RIGHT: this.keyRight = false; break; case MinuetoKeyboard.KEY_DOWN: this.keyDown = fa...
677ea7d6-748e-4ffe-bd7e-b1a0edc35654
9
public void flush() { while (true) { cs:synchronized(this) { disableRehash = true; long n; do { n = nModified; for (int i = 0; i < table.length; i++) { Entry e, next, ...
cf0a4b81-9975-4823-ad59-010f5e3422d2
9
public boolean addDepartmentFrame(){ boolean ret = false; try { String nameDepartment; Department department = new Department(); JTextField name = new JTextField(); // Получили массив объектов для комбо-бокса Faculty[] facultys = ua.edu.odeku.p...
603539ae-fa09-4ff3-9393-f769e95fd960
7
public static void main(String[] args) throws Exception { inputfilename = args[0]; long startTime =System.currentTimeMillis(); File document = new File(inputfilename); File[] fileListName = document.listFiles(); int num=0; for(File file1:fileListName) { StringBuilder items = new StringBuilder(); ...
a2c052dc-41f5-4cd5-8275-a196a7d13581
5
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { BeanRsi_train br_train = null; try { br_train = new BeanRsi_train(); if("yahoo".equals(request.getParameter("datasource"))){ ...
9e267ba3-53f8-4296-b6af-3dc44bbec629
1
public String getString(String key) throws JSONException { Object object = this.get(key); if (object instanceof String) { return (String) object; } throw new JSONException("JSONObject[" + quote(key) + "] not a string."); }
e8bcff1e-6e27-4ae1-88ed-5374111175e5
5
public Result ValidarNuevoRol(Rol pRol) { StringBuilder sb = new StringBuilder(); sb.append((Common.IsNullOrEmpty(pRol.getNombreRol()))?".Nombre inválido\n":""); sb.append((Common.IsNullOrEmpty(pRol.getDescripcionRol()))?".Descripción inválida\n":""); sb.append((pRol.get...
1d46567c-94f7-41ce-853b-ebd8957fa868
3
public Hub (Device dev) throws IOException { super (ControlMessage.getClassDescriptor (dev, TYPE_HUB, (byte) 0, 0, 10)); this.dev = dev; if (dev.getDeviceDescriptor ().getDeviceClass () != CLASS_HUB) throw new IllegalArgumentException (); if (getDescriptorType () != TYPE_HUB) throw new IllegalA...
d1031719-b8b1-4794-a843-f99e7382f285
2
public boolean loadFromFile() { boolean readSuccessful =false; String fileName = selectFile(MODE_OPEN); if(fileName != null) { readSuccessful = read_serialize(fileName); if(readSuccessful) { String message = "Game state successfully restored."; JOptionPane.showMessageDialog(null, message, "Game S...
d6c58314-3888-453f-9587-ccffba7c9d64
2
public String getPermutation(int n, int k) { ArrayList<Integer> ll = new ArrayList<Integer>(); int mod = 1; for(int i = 1; i<=n;i++){ ll.add(i); mod = mod*i; } k--; String result = ""; for(int i = 0; i<n;i++){ mod = mod / ( n...
7b47d139-4b4d-463a-920f-b70f9cccfdd0
3
public String getTelnetSessionAsString(String tcb) throws SocketException, IOException, InterruptedException { startTelnetSession(); String rtn="blah"; GosLink2.dw.append("Logging into server "+tcb+"."); if (tcb.equals("1")){ rtn=loginUser(GosLink2.prps("user1"),GosLink2.prps("g...
210afed7-6a2a-4da5-8070-e90a2077cee2
9
public void registerMany(Kim kim) { int length = kim.length; int limit = this.capacity - this.length; if (limit > JSONzip.substringLimit) { limit = JSONzip.substringLimit; } int until = length - (JSONzip.minSubstringLength - 1); for (int from = 0; from < until...
b95aef5e-3b64-45e8-a8b2-d55f743961d0
6
public static void main(String[] args) { if (args.length < 1) { throw new IllegalArgumentException("You should provide a path to makefile"); } String makefilePath = args[0]; List<String> targets = Arrays.asList(args).subList(1, args.length); MakefileParser parser =...
48d1f384-1112-45f9-81d9-085363edf964
4
@Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._expLogica_ == oldChild) { setExpLogica((PExpLogica) newChild); return; } for(ListIterator<PExpAux> i = th...
b5074604-c4b2-4ea4-8f6f-38f7e0ea5d16
5
public void loadLevel() { SpriteSheet sprites = new SpriteSheet("/res/images/floorTile.png", 1, 1); Image floor = sprites.getSprite(0); for (int x = 0; x < WIDTH; x += 2) for (int y = 0; y < HEIGHT; y += 2) addObject((BufferedImage)floor, x, y, true); sprites ...
16ab8ea4-f208-43f4-8ec6-11a6aabcbdb2
3
private boolean isIn(Vecteur<Integer> Vec) { return Vec.get(0) >= 0 && Vec.get(0) < tailleX && Vec.get(1) >= 0 && Vec.get(1) < tailleY; }
49ca5e29-328d-4f42-bfa3-cf7e39054aa7
6
public int getColor(int type) { switch(type){ case COLOR_BACKGROUND: return ApplicationManager.manager.getIntProperty("item.background", 0x0ffffff); case COLOR_FOREGROUND: return ApplicationManager.manager.getIntProperty("item.foreground", 0); case COLOR_HIGHLIGHTED_BACKGROUND: ret...
43d89245-d3f7-4b2a-b095-61a03d0f9570
7
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] = ...
35c4e0d4-f38a-476b-8567-e04e4fbb1c0d
0
public int getHeight() { return tiles[0].length; }
d26ebd3d-9c82-43bc-bb56-258bd87e26f0
4
public void run() { while (!Thread.currentThread().isInterrupted()) { try { Thread.sleep(250); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); break; } if (connected && associatedQ2) { application.getO2Panel().updateValue(patient.getO...
dcf7d871-92c7-4b43-81a2-3ea1ad1ca85a
3
static boolean eq(CtClass one, CtClass two) { return one == two || (one != null && two != null && one.getName().equals(two.getName())); }
e04b8f15-2b5f-4156-832c-b17e66bb9289
8
private EventSetImpl removeUnfiltered(long timeout) throws InterruptedException { EventSetImpl eventSet = null; /* * Make sure the VM has completed initialization before * trying to build events. */ vm.waitInitCompletion(...
7f8230bc-687c-4734-8bb4-ec47a603e386
4
public void dump(String filename) { LinkedList<Integer> scores = new LinkedList<Integer>(scoreHistory); int size = scores.size(); double avg = average(); double std = stdev(); Collections.sort(scores, Collections.reverseOrder()); try { PrintWriter writer = new...
08a64397-3c39-49e7-9c0c-c256469b46bd
1
public static void main( String[] args ) { JFrame frame = new JFrame( "Graph" ); frame.setBounds( 20, 20, 800, 600 ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); Graph graph = new Graph(); for( GraphItem item : createTestItems() ){ graph.addItem( item ); } GraphPanel panel = new Graph...
c1740bcf-ee85-4947-af4b-91ccb93f620d
3
public synchronized boolean blockWaiting() { for(int i = 0; i < this.blockOffsets.length; i++){ if(this.blocks.containsKey(blockOffsets[i])) continue; if(this.blockLastRequested[i] - System.currentTimeMillis() < 500) continue; return true; } return false; }
2cfaaf10-e5b2-4c55-a537-4c2d4a30c6dc
1
public void Open() throws IOException { Iterator it = notebookCache.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); System.out.println(entry.getKey() + " - " + entry.getValue()); } }
114ad871-9aec-48fa-9c97-f0804d00838f
1
public static float pedirSalodInicialCuenta(){ float inicial=0; try{ System.out.print("Saldo inicial => "); BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); inicial=Float.parseFloat(stdin.readLine()); }catch(Exception e){ System.out.println("Se espera un valor numerico "+e); ...
e1d348fc-0412-4264-a72b-cda72c1ea227
3
public GameState play(UserInput input) { switch (input.getType()) { case NORMAL: return doPlay(input); case UNDO: return undo(input); case REDO: return redo(input); default: return GameState.PLAYING; } }
99d4f836-0d7c-4fc4-99c6-d5df584a2d16
4
public void stop(int keycode){ if (keycode == KeyEvent.VK_LEFT || keycode == KeyEvent.VK_A || keycode == KeyEvent.VK_RIGHT || keycode == KeyEvent.VK_D){ movement.setX(0); this.animation = type.getAnimationStill(prevAnimation); this.prevAnimation = animation; } }
6847b768-df13-490e-aa2d-d33aac791305
1
public static void stop() { if (ginsu != null) { ginsu.end = true; } }
f8c2d26d-b269-48ab-83cb-f32b51dba809
7
@EventHandler public void onPlayerToggleSneak(PlayerToggleSneakEvent e) { Player p = e.getPlayer(); if(printBlockStats.get(p) == null) printBlockStats.put(p, true); if(printBlockStats.get(p) && e.isSneaking() && p.getItemInHand().getType() == Material.WATER_BUCKET) { Block lookingAt = Utilities.getLo...
4cd498dc-f30b-4297-bc72-bb43e18e2f71
6
@Override public void layoutContainer(Container parent) { // TODO: This repeats logic String screen_text = construct.screen_text(); if(screen_text != null) { final String child_string = "$(node)"; StringBuilder builder = new StringBuilder(); FontMetrics metrics = Toolkit.getDefaultToolkit()....
bf68e585-7e62-4bb7-b8f5-5cea5168b7db
1
@Override public List<? extends IResource> getResources() throws IOException { return resources; }
56ace1c3-ea5d-48b5-a9b3-519164a1960a
4
private static String doit(Object oms3) { StringBuffer b = new StringBuffer(); Class cl = oms3.getClass(); ComponentAccess a = new ComponentAccess(oms3); b.append("package " + cl.getPackage().getName() + ";\n"); b.append("\n"); b.append("import jams.data.*;\n"); ...
83e6873d-ff40-40d2-aed0-995558255950
8
@Override public boolean equals(Object other) { if (other instanceof KeyValue) { KeyValue otherPair = (KeyValue) other; return ((this.key == otherPair.key || (this.key != null && otherPair.key != null && this.key.equals(otherPair.key))) && (this.value == otherPair.value || (this.value != null && otherPair.valu...
863ef237-b143-4cf9-81ba-fa716bd60eee
6
public boolean getBoolean(int index) throws JSONException { Object object = this.get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equal...
06b13c77-df28-4000-b699-77743ec86e57
8
static private boolean jj_3R_62() { Token xsp; xsp = jj_scanpos; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3_8()) { jj_scanpos = xsp; if (jj_3_9()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) { jj_sc...
1aa9e82a-3d2b-42c2-afd2-26a895307221
1
public SQLHelper() { try { InputStream in = this.getClass().getResourceAsStream("/sols/Util/jdbc.properties"); Properties pp = new Properties(); pp.load(in); url = pp.getProperty("jdbc.url"); user = pp.getProperty("jdbc.username"); passwor...
bf0a08c0-d601-4676-bb0d-c7e713478947
5
public LoadMethodSkinUpdate(Class<?> streamClass, Class<?> readLimiterClass) { setMethod(getMethod(Modifier.STATIC, 0, streamClass, null, DataInput.class, readLimiterClass)); // Find the unlimited read limiter for (Field field : readLimiterClass.getDeclaredFields()) { if (readLimiterClass.isAssignableF...
832d0f08-f7ca-4458-a177-00e54ab8a322
2
public void testPropertyCompareToYear() { LocalDate test1 = new LocalDate(TEST_TIME1); LocalDate test2 = new LocalDate(TEST_TIME2); assertEquals(true, test1.year().compareTo(test2) < 0); assertEquals(true, test2.year().compareTo(test1) > 0); assertEquals(true, test1.year().compar...
9f006e4e-ac99-4a64-9671-78143eb99132
9
protected DateRange parseDateRange(String[] words, int code) throws MalformedDateException { Date date1 = null; int flags = 0; switch (code) { case BEFORE: case AFTER: date1 = parsePlainDate(words, 1, 0); flags = (code == BEFORE) ? DateRange.BEFORE : DateRange.AFTER; return new DateRange(d...
7313fd08-ade1-4373-8986-cf2a19f49688
1
public int getHeight() { Window window = device.getFullScreenWindow(); if (window != null) { return window.getHeight(); } else { return 0; } }