method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
0117d55d-0d03-4698-bd59-3fddf1e773ae
9
public Token getToken() { StringBuilder keywords = new StringBuilder(); try { while(lastChar == ' ' || lastChar == '\t' || lastChar == '\n' || lastChar == '\r') { lastChar = input.read(); position++; } if(lastChar == -1) return new Token(Token.Type.END); if(terminals.contains((char) la...
38f26670-795e-4d80-84ee-47498774ad9c
3
public JSONObject accumulate( String key, Object value ) throws JSONException { testValidity(value); Object object = this.opt(key); if (object == null) { this.put(key, value instanceof JSONArray ? new JSONArray().put(value) ...
b948eca9-b94c-4e93-b77c-fa5a77799589
0
public JTextField getjTextFieldLogin() { return jTextFieldLogin; }
0be95915-ad39-4a26-8236-9b35f47879d2
5
public void drawBattle(Graphics2D gr, boolean Turn){ gr.drawImage(BattlePanel.resize(monster.getImage(), 150, 150), BattlePanel.MONSTERX, BattlePanel.MONSTERY, 150, 150, null); gr.drawImage(BattlePanel.resize(hero.getBackImage(), 150, 150), BattlePanel.HEROX, BattlePanel.HEROY, 150, 150, null); int x, y; ...
3f5a3d18-d8ee-4a0d-9247-963fd2262d04
8
protected int[] filterPixels( int width, int height, int[] inPixels, Rectangle transformedSpace ) { int index = 0; int[] outPixels = new int[width * height]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int pixel = 0xff000000; for (int dy = -1; dy <= 1; dy++) { int iy = y+...
6e49d699-e9c0-4c45-a273-0f220b0a9e15
4
public boolean validKoordinaten(Koordinate koord) { if ((0 <= koord.getX()) && (koord.getX() < Regeln.getSpielFeldGroesse().getX()) && (0 <= koord.getY()) && (koord.getY() < Regeln.getSpielFeldGroesse().getY())) { return true; } return false; }
3180b3df-f9a4-4383-b0c7-de841af17a84
7
public ArrayList <Reservation> DBreservationRouter (Object sysObject, String action){ //local container ArrayList <Reservation> temp; try{ if (sysObject instanceof String && "VIEWALL".equals(action)){ temp = queryDB.ReservationsForFranc...
f0e92f22-5da8-4937-a8fb-8f13795b0ad7
0
public void setLastName(String lastName) { this.lastName = lastName; }
28fe45f3-1ce7-40ed-bceb-d69d589e5a58
4
private void growBuffer(int loHash) { final IntBuffer buffer1 = keysBuffers[loHash]; final IntBuffer buffer2 = ByteBuffer.allocate(buffer1.capacity() * 8).order(ByteOrder.nativeOrder()).asIntBuffer(); keysBuffers[loHash] = buffer2; KE ke = acquireKeyElement(0); int used = 0; OUTER: for (int ...
89440309-9767-46cc-8f21-fa87df89a77c
3
@Override public void conversion() { switch (type) { case RZ: decodageRZ(); break; case NRZ: decodageNRZ(); break; case NRZT: decodageNRZT(); break; } }
7501575e-0817-444b-b39a-4d281b49e925
7
public void moveNext() throws IOException, TokenizerException{ while (Character.isWhitespace(scanner.current())){ // skip whitespace. scanner.moveNext(); } char c = scanner.current(); if (c == Scanner.EOF){ // handle end of file. current = new Lexeme(Sc...
869add7e-55e5-4ce2-8e38-3b9163c0b1bf
1
public InnerClassInfo[] getInnerClasses() { if ((status & INNERCLASSES) == 0) loadInfo(INNERCLASSES); return innerClasses; }
2e9a3db3-efc6-4375-812f-ac3085b37d5d
8
@Override public void visitLdcInsn(final Object cst) { Item i = cw.newConstItem(cst); // Label currentBlock = this.currentBlock; if (currentBlock != null) { if (compute == FRAMES) { currentBlock.frame.execute(Opcodes.LDC, 0, cw, i); } else { ...
e61e64a3-3450-4c47-a2eb-3841fd3588d5
5
public static void main(String[] args) throws InterruptedException { EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; try { Map<String, Object> addressMap = new HashMap<String, Object>(); addressMap.put("name", "Simpler Postage Inc"); addressMap.put("street1", "...
e9c655e3-67c6-4624-a4de-c75c8a8a91d4
0
public Iterator getDefaultOpenDocumentIterator() { return getOpenDocumentIterator(0); }
97f4e3c5-adfe-4adb-9401-31509bb8fb99
5
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((cabinClass == null) ? 0 : cabinClass.hashCode()); result = prime * result + ((carrierCode == null) ? 0 : carrierCode.hashCode()); result = prime * result + (int) (departureDate ^ (departureDate >>> 32)); result = prime...
723e351a-e0c0-4146-b02d-cac1189a8ff2
9
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page ...
0b0cf0ca-2291-4870-9d82-7261a7b3a84a
4
private static int mainMenu(int condition, Scanner scan) { //Check if the selected option is valid, if true then skip straight to the return statement else run through the selection process if (condition == 0) { System.out.println("What do you want to do? " + "\n1) Start playing " + "\n2) Read the rule...
10035db1-ec67-4c62-8ee4-8a33e1caa06e
5
protected void greedyMatch() { for (int w = 0; w < dim; w++) { for (int j = 0; j < dim; j++) { if (matchJobByWorker[w] == -1 && matchWorkerByJob[j] == -1 && costMatrix[w][j] - labelByWorker[w] - labelByJob[j] == 0) { match(w, j); } } } }
fb10f6c6-528b-416a-a76e-115f4c55e845
8
private void sortStepInit() { childMap = calculateChildMap(); depths = calculateNodeDepths(); for (String s : depths.keySet()) { int depth = depths.get(s); maxDepth = Math.max(maxDepth, depth); if (radiusByImportance) { Visode o = find(s); if (o instanceof OdeNode) { OdeNode n = ((Ode...
698d1b86-aeec-4182-a88d-50e2e9545285
3
@Override public void radnja() throws InterruptedException { voziSe = true; Thread.sleep((long) (tmin + Math.random() * (tmax - tmin))); // vreme put izmedju stanica voziSe = false; la.setText(toString()); // da promeni stanje labele Thread.sleep((long) zadrzavanje ); //vreme na stanici...
a2bba41c-6f34-4372-9eee-bf5b8bf4c358
2
private static int[][] mirrorVertically(int[][] squares) { int[][] mirrorVertically = new int[4][4]; for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { mirrorVertically[row][3-col] = squares[row][col]; } } return mirrorVertically; }
787d5467-d32d-4269-a132-29cb2e8502bc
2
private void voteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voteButtonActionPerformed if(!ProposalLogic.isExpired(getProposal())) { int option = optionComboBox.getSelectedIndex(); if(ProposalLogic.vote(proposal, option)){ JOptionPane.showMes...
1ae703da-a5f0-4455-8e30-8ac1549d4150
2
private void clearPlayers() { for (int i = 0; i < players.size(); i++) { Entity e = players.get(i); if (e.isRemoved()) { players.remove(i); } } }
55fc45d7-f9e1-4863-a81f-0101ec0d16e5
6
private static void printParameterDocumentation(ExecutableMemberDoc member) { /* handle @param tags */ ParamTag[] tags = member.paramTags(); if (tags.length > 0) { os.println("\\begin{texdocparameters}"); for (ParamTag tag : member.paramTags()) { os.print("\\texdocparameter{" + HTMLToTex.convert(tag.par...
3d63454d-b543-4570-9437-fb46e7bdc26c
3
private void initGliderPositionsList() { try{ RecentLaunchSelections recent = RecentLaunchSelections.getRecentLaunchSelections(); gliderPositions = DatabaseUtilities.DatabaseDataObjectUtilities.getGliderPositions(); List<GliderPosition> recentGliderPositions = recent.getRecen...
4ef00ac3-417f-40d5-af81-548854fcc5a4
0
@Override public RemoteCallObjectType getCallObjectType() { return remoteCallObjectType; }
593fa202-415b-4670-837f-079600891da7
2
static private int lookupMonthNum(CycConstant cycMonth) { ensureMonthArrayInitialized(); for (int monthNum = Calendar.JANUARY; monthNum <= Calendar.DECEMBER; monthNum++) { if (cycMonth.equals(CYC_MONTH_TERMS[monthNum])) { return monthNum; } } return -1; }
1b1d9a54-cf48-4b16-924b-cf6c2a0b1686
9
private byte[] createMorseWave(String playString) { //@TODO code to play string in morse :) //@TODO NEEDS ByteArrayOutpuStream to work! ByteArrayOutputStream bbout = new ByteArrayOutputStream(); char charToPlay; int sLength = playString.length(); byte[] playWave = new byte[32]; ...
ffbc3bb0-5c7c-4f06-8dc7-24840c104931
6
void copyBGToBuf(Graphics bufg, int sx1,int sy1,int sx2,int sy2, int dx1,int dy1) { //System.out.println("("+sx1+","+sy1+")-("+sx2+","+sy2+")"); if (sx2<=sx1 || sy2<=sy1) return; int barrelx = el.scaleXPos(el.moduloFloor(el.xofs,el.tilex),false); int barrely = el.scaleYPos(el.moduloFloor(el.yofs,el.tiley),fals...
68e19abf-d5f7-4ca8-b3b2-4e14570981a4
5
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((coach == null) ? 0 : coach.hashCode()); result = prime * result + ((country == null) ? 0 : country.hashCode()); result = prime * result + ((flag == null) ? 0 : flag.hashCode()); result = prime *...
0270e241-0b09-4141-8192-3b9e83832ed4
2
protected static void runDemo(final DemoType mixed) { switch (mixed) { case MIXED: mixedDemo(); break; case MASS: massDemo(); break; default: break; } }
28649176-b34d-439f-af8f-4383bf18cc11
4
public Duration findGap(Interval interval, Duration gap) { boolean found = false; int start = overlapStart(interval); Duration currentGap = null; while (start < size() - 2 && !found) { currentGap = get(start).gap(get(start + 1)).toDuration(); if (currentGap.com...
0e2d0b94-d835-4b1f-836d-be052518e7af
6
public void keyPressed(int key, char c){ // same code as the mouseclicked method, except that this is triggered by keyboard buttons // KEY_1 toggles building rocket tower // KEY_2 toggles building maching gun tower // KEY_3 toggles building slow tower if(key == Input.KEY_1){ if(buildR){ this.RTBimage =...
f212e816-9330-4f61-9249-02e0b8d7ff7b
6
public Type intersection(Type type) { if (type == tError) return type; if (type == Type.tUnknown) return this; Type top, bottom, result; bottom = bottomType.getSpecializedType(type); top = topType.getGeneralizedType(type); if (top.equals(bottom)) result = top; else if (top instanceof ReferenceTy...
ff4f3b02-dfe5-4f9f-bf12-2d9b4421a6e7
0
@Override public void setIpdbserver(String ipdbserver) { this.ipdbserver = ipdbserver; }
1abf5eb0-80c8-4620-bbc8-0fe944502359
7
public ObjectIterator(Object object) { if (object == null) { this.iterator = new EmptyIterator(); } else if (object instanceof List) { this.iterator = ((List) object).iterator(); } else if (object instanceof Map) { this.iterator = ((Map) object).entrySet().ite...
93f9097d-9c89-46e8-9c42-23e0147434dc
9
private void initialize() throws IOException { InputStream in; String path = System.getProperty("kakasi.itaijiDictionary.path"); if (path != null) { in = new FileInputStream(path); } else { in = ItaijiDictionary.class.getResourceAsStream( "resource...
89c3929c-524e-4019-b78e-44edbe92001c
5
public String mouseOver(int x, int y) { y = height - y; Set<String> set = buttons.keySet(); //Loop through all the buttons for (String s: set) { List<Integer> l = buttons.get(s); //check if the mouse is within the button if (x > l.get(0) && x < l.get(2) && y > l.get(1) && y < l.get(3)) { ...
5c8d2df2-4c9c-4a10-b578-e1583d8e67be
6
public Double[][] subtract(Double[][] a, Double[][] b) { Double[][] ans = new Double[2][a[0].length+b[0].length]; boolean flag = false; for(int i=0; i<a[0].length; i++){ ans[0][i] = a[0][i]; ans[1][i] = a[1][i]; } if(a[0].length < b[0].length){ ...
0b5682a5-c251-4743-a441-0ced14c2574e
0
private void notifyUpdateSize(int newSize) { synchronized (sizeUpdateLock) { currentSize = newSize; sizeUpdateLock.notifyAll(); } }
46d6846c-a093-42df-bba1-088414608eaa
3
public AnimatedObject(int id, int rotation, int type, int posxplus1, int posxplus1yplus1, int pos, int posyplus1, int animationId, boolean flag) { this.id = id; this.type = type; this.rotation = rotation; this.pos = pos; this.posxplus1 = posxplus1; this.posxplus1yplus1 = posxplus1yplus1; this.posyplus1 = ...
443647fb-5f48-4560-a126-ed810c237738
9
private void produceForest() { Perlin noise = new Perlin(); try { noise.setOctaveCount(octaves); } catch (Exception e) {e.printStackTrace();} noise.setFrequency(frequency); noise.setSeed(seed); int dimx = MyzoGEN.DIMENSION_X * chunksX; int dimy = MyzoGEN.DIMENSION_Y * chunksY; NoiseMap tempMap = null; ...
3bf95533-9d00-4a37-aa88-840da608f224
1
public int hashCode() { return (int)(2 *((viscosity == null) ? 0 : viscosity.hashCode())); }
7e13eacb-cd1c-45f0-83df-1888fdc1f5ea
7
private void testHelper_method_unspecifiedPosition_shouldFail(MethodToTest method) { final RelativePosition UNSPECIFIED_POSITION = RelativePosition.NotSpecified; switch (method) { case changeMoleculeEnergyLevel: moleculeMediator.changeMoleculeEnergyLevel(validAnchor, UNSPECIFIED_POSITION, VALID_ENERGY_CHANG...
eb16594f-273b-47a4-879e-fc1bbd548865
2
public static int toBufferedImageType(Image.ImageType type) { switch(type) { case GREYSCALE: return BufferedImage.TYPE_BYTE_GRAY; case COLOR: return BufferedImage.TYPE_INT_RGB; default: throw new IllegalArgumentException(); } }
1270f82a-6e6b-49b8-aa12-08f8cc1bcb76
2
public int getPlayerMPIndex(String username){ int index = 0; for(PlayerMP player : this.connectedPlayers){ if(player.getUsername().equals(username)){ break; } index++; } return index; }
cd2752dd-68cd-4029-8976-030f2cea6bed
7
public static void maxHeapifyTernary(TernaryHeap A, int i) { int l = leftTernary(i); int r = rightTernary(i); int m = middleTernary(i); int largest; if (l <= A.getHeapsize() - 1 && A.get(l) > A.get(i)) { largest = l; } else if (m <= A.getHeapsize() - 1 && A.ge...
22487822-7714-4fc8-b3e0-b0bbd5626d79
3
private static CompressionType getType(String str) { CompressionType type = CompressionType.NONE; str = str.toLowerCase(); if(str.equalsIgnoreCase("gzip")) { type = CompressionType.GZIP; } else if(str.equalsIgnoreCase("zip")) { type = CompressionType.ZIP; } else if(str.equalsIgnoreCase("rar")) { type...
612bbc99-58ba-4fd7-a5c8-27a9fe3c86e9
1
public void testRemoveBadIndex1() { Converter[] array = new Converter[] { c1, c2, c3, c4, }; ConverterSet set = new ConverterSet(array); try { set.remove(200, null); fail(); } catch (IndexOutOfBoundsException ex) {} assertEquals(4, set....
7956aa42-7944-4e4f-b518-c58eca0c7fbd
1
public void visitMonitorStmt(final MonitorStmt stmt) { if (stmt.object == from) { stmt.object = (Expr) to; ((Expr) to).setParent(stmt); } else { stmt.visitChildren(this); } }
3c9b7999-13a1-4fa6-bde5-8a307b0d9573
9
public static int[] getSearchTermOccurrences( String searchTerm, String content) { List<StyleRange> styleRange; List<Integer> ranges; Display disp = Display.getCurrent(); StyleRange myStyleRange = new StyleRange(0, 0, null, disp.getSystemColor(SWT....
36d3af6c-dd1e-4f63-9870-7cc32fee182f
6
public static ResultSet query2(Statement stat, String table, String... field) throws SQLException{ ResultSet rs = null; StringBuffer sb = new StringBuffer(); sb.append("select "); boolean bool = false; if(field == null || field.length == 0 || field[0].equals("")){ sb.append(" * "); bool =true; } if(...
4c49714d-a8e3-4e4d-9549-fd2ead39e12b
8
public void debutPartie() { Scanner sc = new Scanner(System.in); Scanner sc2 = new Scanner(System.in); Scanner sc3 = new Scanner(System.in); System.out.println("Combien voulez vous de joueur virtuels (1 -> *)"); int nbJoueur = sc.nextInt(); this.nombreJoueurVirtuel=nbJoueur; System.out.println("quel est v...
ec018ec2-cca9-438a-a19f-d26193f82b66
0
public String getBirth() { return Birth; }
ec17fec9-2894-40d5-b454-c9320d0a8cd9
9
public void notifyForRequest(String recievedMessage, String fname, String add, String size) throws IOException { // switch (recievedMessage) { case "REQUEST_TO_SEND_FILE": // show the message to the user System.out.println(fname); recievingFile...
e7972ba2-45c3-4102-8db0-c3769f282ba5
7
@Override protected void read(InputBuffer b) throws IOException, ParsingException { InputBuffer signed = b.getSubBuffer(0); VariableLengthIntegerMessage messageVersion = getMessageFactory().parseVariableLengthIntegerMessage(b); b = b.getSubBuffer(messageVersion.length()); if (messageVersion.getLong() != MESS...
fc633258-a1ce-42e9-9fff-e7cfe219dd4f
4
public Matrix rMult(Matrix M){ if (columns==M.getRows()){ int i=1; int j=1; int k=1;double s=0; int c=M.getColumns(); Matrix S=new Matrix(rows,c); while (i<=rows){ while (j<=c){ while (k<=columns){ s+=ele...
8b3c210a-b000-468d-b0e6-bc124cf278e9
8
public boolean put(BytesKey key, OpItem value) throws IOException { if (this.loadFactor() > 0.75f) { return false; } int keyHash = this.hashForKey(key); int j = hash1(keyHash); int offset = calcOffset(j); int i = 0; int m = table.length; while ...
0b68d17a-8d74-4dcb-a83c-c974940f84f2
8
public boolean equals( Object obj) { if ((obj == null) || !(obj instanceof RC2ParameterSpec)) { return false; } RC2ParameterSpec spec = (RC2ParameterSpec)obj; if (this.effectiveKeyBits != spec.effectiveKeyBits) { return false; ...
519e215e-bec4-4880-9452-a37cffd13254
2
public void setTreeHeuristics (TrieNode node) throws Exception { if (!node.isRoot()){ throw new Exception("calcHeuristic must be run on root node"); } for (TrieNode child : node.getChildren().values()) { calcHeuristic(child); } }
9ab03496-a021-45a9-a3d9-140b751687e3
8
public void deleteCourseFromStudent(Scanner a_scan) { System.out .println("Please Select Method to Choose Student(1 or 2): " + "\n1)Search Student by Name,\n2)Search Student by techID)"); Student s1; switch (getMenuChoiceNameOrId(a_scan)) { case 1: { s1 = findStudent(inputStudentName(a_scan)); i...
255c1a83-3070-4b1b-a201-0efd5bd0a3d4
1
public int getUnresolvedWord() { if(word == null) return 0; return word; }
2c00f3b9-73ca-44a3-984f-8e7c1ba540b4
1
public void loadConfig() { if (Config.getInstance().getRpcURL() != null) { clientConfig.setServerURL( Config.getInstance().getRpcURL() ); clientConfig.setBasicUserName( Config.getInstance().getRpcUser() ); clientConfig.setBasicPassword( Config.getInstance().getRpcPass() ); ...
44b86a8a-91ac-493b-a4bc-e659fea3214b
7
public static boolean commonsDeleteFile(String server, String username, String password, String rFolder, String rFilename) { FTPClient ftp = null; int reply; boolean succes; try { // Connect and logon to FTP Server ftp = new FTPClient(); ftp.connect( server ); ftp.login( username, password ); ...
5f5c68ad-9d20-4cf7-8781-d325019c6b7f
6
public static String[] trim(String s0, String s1) { // Find the common prefix s.s0[0..h+1] and s.s[0.k+1] int h= 0; while (h < s0.length() && h < s1.length() && s0.charAt(h) == s1.charAt(h)) { h= h+1; } s0= s0.substring(h); s1= s1.substring(...
5de672e8-8a99-4203-8a18-4daa23d61a28
5
@Override public void Write(IOClient p, Server server) { PacketPrepareEvent event = new PacketPrepareEvent(p, this, server); server.getEventSystem().callEvent(event); if (event.isCancelled()) return; Player player; if (p instanceof Player) { player = (Player)p; } else return; try { while (p...
bc66cd5f-0240-49e5-be01-9b283d9c96f1
8
public void onKeyReleased(KeyEvent e) { switch (e.getKeyCode()) { case VK_UP: case VK_W: case VK_DOWN: case VK_S: // Arrow up and down keys: move direction = stand still moveDirection = 0; moveAmount = 0; break; case VK_RIGHT: case VK_D: case VK_LEFT: case VK_A: // Arrow right and left...
64a9e5bd-94f4-4517-916a-955c1945a193
7
private static Modifiers forModifier(String modifier){ List<Modifiers> tmp = new ArrayList<Modifiers>(); if(modifier.toLowerCase().startsWith(ROTATE_MOD)){ int count = Integer.parseInt(modifier.split("#")[1]); count %= 4; switch(count){ case 0: return NONE; case 1: return ROTATE_90; ...
66cd0b3c-65e9-48b6-b054-fc97a9fcffeb
9
private static Object loadClass(Class<? extends Rule> ruleClazz) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException { ResourceBundle bundle = ResourceBundle.getBundle("application"); String ruleDirectory = bundle.getString("rule.directory"); String ruleFil...
192ec9fb-a151-41d8-8d87-c41e7b7685fb
2
public boolean submit(Submission submission) { boolean result = false; // Get ConfigManager object ConfigManager cm = new ConfigManager(); try { // Try to connect to RMI through port 1099 Registry registry = LocateRegistry.getRegistry(cm.getServerIp(), 1099); Rmi rmi = (Rmi) registry.lookup("pcs...
d84ec54a-17ea-474d-be37-80cbdfc7381e
0
public void setjCheckBoxMedicaments(JCheckBox jCheckBoxMedicaments) { this.jCheckBoxMedicaments = jCheckBoxMedicaments; }
57f64f03-8434-41a9-a9ed-780f99b0894f
1
public ArrayList<Node> copyNodes(){ ArrayList<Node> copy = new ArrayList<Node>(); for(int i=0; i<numNodes; i++){ copy.add(new Node(nodes.get(i))); } return copy; }
4242fd92-b0ea-4810-b04d-16af414093e8
8
public Node<Integer> add(Node<Integer> head1, Node<Integer> head2, int add) { if (head1 == null && head2 == null && add == 0) return null; int sum = add; if (head1 != null) sum += head1.data; if (head2 != null) sum += head2.data; Node<Integer> next1 = (head1 == null) ? null : head1.next; Node<Integ...
574652a8-f48a-4d18-a65e-5e8f474daa78
9
private void processQueuedCommands() { synchronized (queuedCommands) { if (!queuedCommands.isEmpty()) { logger.log("Processing Queued commands."); } else { logger.log("There are no Queued commands."); } int MAX_ITERATION = 0; for (int i : queuedCommands.keySet()) { if (i > MA...
ff241c12-7a44-4e3b-96f4-1acb224ad4b0
3
private static int getRepresentation(final String s) { if ("code".equals(s)) { return BYTECODE; } else if ("xml".equals(s)) { return MULTI_XML; } else if ("singlexml".equals(s)) { return SINGLE_XML; } return 0; }
d35250a5-0512-4f03-94fd-e8b64ae26189
7
@Override @SuppressWarnings({ "nls", "boxing" }) protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder enc) { super.initialize(type, oldInstance, newInstance, enc); List list = (List) oldInstance; Statement setterStm = new Statement(oldInstance, "setSize", new Objec...
71c05f14-6cc5-42af-8fb2-f455663e47cb
8
@Override public void enqueueCommand(Command cmd) { switch (clientType) { //Kinect client listens to RStatus and RLock commands case KINECT: switch (cmd.getCommandType()) { case RSTATUS: case RLOCK: sendCommand(cmd); break; } break; //Mapper clients listen to MPosition, RStatus, RLock, R...
14136112-2dba-4ee4-b486-9ac7aaa3c9f7
8
public void addNotes(String noteData) { boolean complete = false; while (!complete) { String currentNote; boolean done1 = false; int i = 0; while (!done1) { if (noteData.substring(i).equals("") || noteData.substring(i, i+1).equals(",")) done1 = true; i++; } currentNote = note...
4c9478cf-5690-4091-94a3-681e64c2127f
4
protected boolean getListFromOtherRegional(List regionalList, int eventTag) { // check for input first if (regionalList == null || regionalList.size() == 0) { return false; } // a loop to ask each regional GIS for its resource IDs Iterator it = regionalList.itera...
9b2d014a-7dfd-4f30-a6ce-d71cdbba27fd
7
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(affected==null) return super.okMessage(myHost,msg); if(affected instanceof MOB) { final MOB mob=(MOB)affected; if(((msg.amITarget(mob))||(msg.amISource(mob))) &&(msg.tool() instanceof Social) &&(msg.tool().Name()...
11fb3b58-8413-4cc4-b618-9ea9acef3163
4
private int getPosition(int itemId, int userId, boolean ar) { int sizeVector = items_.size(); ScheduleItem item; for (int i = 0; i < sizeVector; i++) { item = items_.get(i); if (item.getID() == itemId && item.getSenderID() == userId && item.isAdvanceReservation() == ar) return...
020ce0a2-b6ef-4d4f-8a2b-759a2146c7e3
7
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Pair pair = (Pair) o; /*if (v1 != pair.v1) { return false; } if (v2 != pair.v2) { return false; } return true; */ if ((v1 == pa...
e76cfd8a-b521-4185-8e46-908490d27849
5
public static Properties subProperties(Properties pr, String prefix) { if(pr==null || StrTry.isEmpty(prefix)) return null; Properties res = new Properties(); prefix = prefix.trim(); int l = prefix.length(); if(prefix.charAt(l)!='.'){ prefix = pre...
c4a02ee1-fc5b-4908-9a97-83413f1d5bab
2
private void colisionesInvasores() { for (Invasor i : invasores) { if(i.isVivo()){ i.colisionesMisDisparosConList(naves); i.colisionesMisDisparosConList(escudos); } } }
820997f0-c76b-404a-a378-d72a879cffc8
8
@Override public void drawTool(Graphics g, int mouseX, int mouseY){ Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(2)); Canvas c = MainWindow.MAIN_WINDOW.getCanvas(); Point prev; switch(state){ case START: break; case CONFIRM: g.setColor(Color.ORANGE); if (boxMode.isSelected())...
22118668-4647-4a39-8620-4bb32adebaed
3
public void performSubPathChanges(SubPath[] subPaths, int[] solution, boolean[] reversed){ // System.out.println("Performing changes blabla: "); int filled=0; int[] tmp=Arrays.copyOf(path, path.length); for(int i=0;i<solution.length;i++){ //no change // if(! ( solution[i]==i && !reversed[i] ) ){...
2ef52ea2-7be9-4293-bfe3-94473fd15da6
1
public NioServer(SSLContext sslContext) throws IOException { setName(getClass().getSimpleName()); setDaemon(true); mSSLContext = sslContext; mSelector = SelectorProvider.provider().openSelector(); int count = Runtime.getRuntime().availableProcessors() + 1; for (int i = 0; i < count; i++) { NioWorker work...
c8c05d35-65ee-46cf-b7e9-f776934cc2d2
9
public void assignInputVars() { if (input.equals("url")) { input = url; } else if (input.equals("email")) { input = email; } else if (input.equals("password")) { input = password; } else if (input.equals("welcomeMessage")) { input = welcomeMessage; } else if (input.equals("deptCity")) { inp...
3fde33e4-a147-4662-a841-ee4a20487d22
2
public static <T extends Planet> Planet create(int id, Class<T> type) { PropertyManager pm = new PropertyManager("config.properties"); Random rnd = new Random(); double planetMass = pm.getDoubleProperty("min.Planet.Mass") + (pm.getDoubleProperty("max.Planet.Mass") - pm.getDoubleProperty("min.Pl...
0645c054-b2f0-41d9-9338-87f1230dfba9
7
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
36e69962-5123-4219-add9-3f09419b24c5
6
private void trCopy (final int ISA, final int ISAn, final int first, final int a, final int b, final int last, final int depth) { final int[] SA = this.SA; int c, d, e; int s, v; v = b - 1; for (c = first, d = a - 1; c <= d; ++c) { if ((s = SA[c] - depth) < 0) { s += ISAn - ISA; } if (SA[ISA ...
f843640f-b925-43ff-9f20-fe162055b59a
8
public int[][][] getCheckInOrCheckOutByMonthArray(boolean getCheckIn) { int yearCount = AirbnbGlobals.ENDYEAR-AirbnbGlobals.STARTYEAR+1; int listingCount = listingNames.size(); int[][][] checkInArray = new int[yearCount][listingCount+1][13]; for(Iterator<AirbnbReservation> i = airbnbReservationList.iterat...
db471ca4-80f0-4d0f-8e27-d63106110df6
0
@Override public String toString() { return "Record [auther=" + auther + ", contestId=" + contestId + ", errorType=" + errorType + ", id=" + id + ", memory=" + memory + ", problemId=" + problemId + ", recordCode=" + recordCode + ", recordStatus=" + recordStatus + ", recordTime=" + recordTime + ", sum...
3fb8024b-f9c8-4e32-a3d3-c660213f9ec3
5
@ Override public T readFromFile(final File file) { skipRemaining = false; Path filePath = Paths.get (file.getAbsolutePath ()); T object = null; BufferedReader reader = null; try { // Read file using BufferedReader reader = Files.newBufferedReader (filePath, encoding); // Get instantiated ob...
d52c9853-de71-4081-9eda-713224fa4e09
5
public int decreaseHandicap(int minX, int minY, int ex, int ey) { if (ex > 90 && ex < 90 + minX) { if (ey > 280 && ey < 280 + minY) { if (handicap > 0) { handicap--; return handicap; } } } return hand...
bb3b734c-9f76-4d37-b17a-0d587eb74d22
6
public static int getOS(){ String os = System.getProperty("os.name").toLowerCase(); if(os.contains("linux"))return OS_LINUX; if(os.contains("lunix"))return OS_LINUX; if(os.contains("win"))return OS_WINDOWS; if(os.contains("mac"))return OS_APPLE; if(os.contains("solaris"))...
d4846020-6694-47cf-ac83-68b00913c766
5
@Override public int truncate(String path, long size) throws FuseException { try { if (fileSystem.isReadOnly()) return Errno.EROFS; FileHandle handle = fileSystem.openFile(path, true, true); fileSystem.setLength(handle, size); fileSystem.close(handle); } catch (PathNotFoundException e) { return ...
4517428c-984b-4f69-a677-354b1b6b8f4e
0
public List getPropertyContainerList() { return this.containers; }
c2f9111f-ffe4-4bee-9ebf-f4fd047edaef
9
public static Set<int[]> getSubsets(int[] set, int sum) { Map<String, int[]> map = new LinkedHashMap<String, int[]>(); Set<int[]> subsets = new LinkedHashSet<int[]>(); int[] subset; for (int i = 0; i < set.length; i++) { for (int j = 0; j < set.length; j++) { for (int k = 0; k < set.length; k++) { i...