method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
8a087c89-97f7-4c1e-8bcd-954a7762bf7a
2
public AABB stretch(double amtX, double amtY) { double minX, maxX, minY, maxY; if (amtX < 0) { minX = this.minX + amtX; maxX = this.maxX; } else { minX = this.minX; maxX = this.maxX + amtX; } if (amtY < 0) { minY = this.minY + amtY; maxY = this.maxY; } else { minY = this.minY; maxY =...
527b0d59-9033-42cc-8475-eadc5581792e
9
public int ReloadFilteredDocs() { File folder = new File(Configuration.HeidelCollectionRoot + "R_puliti_divisi"); //System.out.println("folder: " + folder); File[] listOfFiles = folder.listFiles(); //System.out.println("listOfFiles: " + listOfFiles); if (listOfFiles == null) { System.out....
768d68fe-e990-4c28-875f-833180b834f4
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
f31e872d-8311-4843-8a81-c1282529dd58
6
public Vector2f checkIntersection(Vector2f lineStart, Vector2f lineEnd, boolean hurt) { Vector2f nearestIntersection = null; for(int i = 0; i < colPosStart.size(); i++) { Vector2f colVector = lineIntersects(lineStart, lineEnd, colPosStart.get(i), colPosEnd.get(i)); if(...
2ac5d0a5-da85-487b-a589-5e16ed07f8ad
7
String hexToString(String hh) { hh = hh.substring(1, hh.length() - 1).toUpperCase(); StringBuilder sb = new StringBuilder(); if (hh.charAt(0) == 'F' && hh.charAt(1) == 'E' && hh.charAt(2) == 'F' && hh.charAt(3) == 'F') { byte b[] = new ...
319a295e-f165-49dd-a861-546de28b3f89
9
Field getFieldWithPos(int position_) { if (isPrimitive != null) { // if this is a primitive return null; //throw new ASNException("Cannot get subfield's position for a Primitive Type"); } if (position_ != 6) { // Optimization for Tag 6 Object Identifier. for (...
28289c1e-2a85-42c0-a94f-59287920dcb7
2
@Override public boolean onMouseDown(int mX, int mY, int button) { if(loc.getWeaponID() == WeaponLocation.NO_WEAPON && shop.onMouseDown(mX, mY, button)) { return true; } return false; }
69e97a22-c05e-4b24-9b5e-e1187502e353
0
public Mario() { super("Mario", 5000, 600, 500, 500, as); as.setSkill(0, "Nice", -200, 20, "Mario feels like being nice today."); as.setSkill(1, "Hard Question", 1000, 60, "Mario asks his student a hard question."); as.setSkill(2, "Hard Test", 2500, 1000, "Mario gives his student a hard test."); as.setSkill(...
031c479c-f47b-43b3-a747-0d48fb6f50cc
6
public static void main(String[] args) throws IOException { OptionParser optionParser = new OptionParser(); optionParser.accepts("cache-dir", "The directory to cache native libraries in").withRequiredArg(); optionParser.accepts("stat", "Display details about the specified file or directory").wit...
d51ca86e-bf0d-476b-bdf8-363299442c96
3
public ParseTreeNode charClass() throws SyntaxError { ParseTreeNode node = new ParseTreeNode("<char-class>"); if (accept('.')) { node.addChild("."); return node; } else if (accept('[')) { node.addChild("["); node.addChild(charClass1()); return node; } else if (isDefinedClass()) { accept(symbol...
e769a1f8-b9f9-4807-b527-272a9bc71d42
7
public static void main(String args []){ final int LENGTH=100; double [] value= new double[LENGTH]; int currentSize=0; //read input System.out.println("Enter input values, Q to quit: "); Scanner in=new Scanner(System.in); while(in.hasNextDouble()&& currentSize<...
c4fc31e5-6d5d-46cc-9e09-1dc0fd649882
8
protected void performTest(boolean nomClass) { TestInstances test; Instances data; double[] originalResults; double[] testResults; int i; // generate data try { test = new TestInstances(); if (nomClass) { test.setClassType(Attribute.NOMINAL); test.setNumNominal(5); test....
406ecb1d-7b7c-4129-ae36-6f00d02f99c4
2
public void unlockWeapon(UnlockType type){ if(type == UnlockType.DAMAGE_OVER_TIME) unlockedDOT = true; else if(type == UnlockType.MAGIC) unlockedMagic = true; }
1845d507-b340-438e-82c6-70c340986b3b
3
public boolean isInvalid(Date date) { calendar2.setTime(date); for (int i = 4; i < 6; i++) { if (calendar.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH) && calendar.get(Calendar.DAY_OF_MONTH) == calendar2 .get(Calendar.DAY_OF_MONTH) + i) { ...
56c09120-d2be-4c4f-b19b-c1b7505d3b92
2
public boolean login(String user, String pass){ if (user == username && pass == password) return true; return false; }
a40796f6-280b-4c7d-8371-8f2323a3c731
7
@Test public void compareToCommonOps() { Method[] methods = classFixed.getMethods(); int numNotMatched = 0; int numPassed = 0; int numFailed = 0; for( Method fixedM : methods ) { if( !isValid(fixedM)) continue; Method commonM = null;...
d7ff1f05-9aef-4cfd-b764-e3b958476b86
9
private void cftfsub(int n, float[] a, int offa, int[] ip, int nw, float[] w) { if (n > 8) { if (n > 32) { cftf1st(n, a, offa, w, nw - (n >> 2)); if ((ConcurrencyUtils.getNumberOfThreads() > 1) && (n > ConcurrencyUtils.getThreadsBeginN_1D_FFT_2Threads())) { ...
dcf651bf-d944-4396-be9b-06bc67b5ddfe
1
public void errorPrintln(String errorMessage) { System.err.println(errorMessage); if (writeToFile) { checkLogFile(); printWriter.println(errorMessage); printWriter.flush(); } }
2c81b773-f47a-4e16-9553-32edbe840585
0
public void begin() { Printer.printToConsole("Begin"); Printer.printToConsole(String.format("Victims in pool %d", initialization.getNumberVictims())); Printer.printToConsole(String.format("Predators in pool %d", initialization.getNumberPredators())); }
48baa8c3-6b37-4f48-b4e4-129e8027d1e6
2
public Octo get(int id) { for(Octo c: getAll()) { if(c.getId()==id) { Octo c1 = new Octo(); c1.setId(c.getId()); c1.setEmail(c.getEmail()); c1.setNumber(c.getNumber()); c1.setSurname(c.getSurname()); c1.setName(c.getName()); return c1; } } return null; }
86f59dbf-b803-472e-a998-7b5d3306fba0
9
public boolean checkRootLabelCodes(LabelSet rlc) { if (rlc == null && rootLabelCodes == null) { return true; // or false ? } else if ((rlc == null && rootLabelCodes != null) || (rlc != null && rootLabelCodes == null)) { return false; } else if (rlc.size() != rootLabelCodes.size()) { return false; } els...
1d1a48bf-a3b6-4c88-8f75-8dc315e8e4df
6
@SuppressWarnings("unchecked") private void loadField(Object object, Class<?> clazz, Field field, Setting setting, ConfigurationNode node) throws ConfigurationException, IllegalArgumentException, IllegalAccessException, InstantiationException { String path = getSettingPath(field, se...
dd3f85f5-7881-49bd-940f-d972f5a1b9e5
0
public UnrestrictedUserParser(Grammar grammar, String target) { super(grammar, target); }
dec2499e-1a92-4005-8c26-5f25d2f42fd3
8
@Override public int[] generate(ArrayList<Function> program) throws Exception { // the last function should be main if(!program.get(program.size() - 1).name.getString().equals("__MAIN__")) { throw new Exception("Main not found"); } // first instructions will be setting t...
57757f08-7299-46b1-b86e-cba4de2e6121
1
@Override protected void done() { super.done(); if (sideIcon != null) sideIcon.setIcon(button.getIcon()); }
1f7876ee-05a4-42f9-955c-c8574a7af0ab
2
@Override public boolean equals(Object o){ if(this==o) return true; Entree e = (Entree) o; return this.nom.equals(e.getNom()) && espace.equals(e.getEspace()); }
6b1f94af-998d-4bb9-bf38-7356476ea91f
6
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n=in.nextInt(); int cnt200 = 0; int cnt100 = 0; while(n-->0){ int a = in.nextInt(); if(a==100) cnt100++; else cnt200++; } String ans = ""; if(cnt200%2 == 0 && cnt100%2 == 0) ans = "YES"; else if (c...
65557470-a1d4-4ed3-b444-e1c1ce5d30b7
2
@Override public void add(TfamEntry tfamEntry) { if ((familyId != null) && (!familyId.equals(tfamEntry.getFamilyId()))) throw new RuntimeException("Cannot add memeber to family. Family IDs do not match: '" + familyId + "' vs '" + tfamEntry.getFamilyId() + "'"); tfamEntryById.put(tfamEntry.getId(), tfamEntry); }
2f636af2-a96b-458d-88ce-1d777d716acd
0
public double getEdge(){ return edge; }
bcb20522-1faf-486d-bb26-3b92b12bb757
0
@Test public void itSetsBoilerState() { maker.setBoilerState(CoffeeMakerAPI.BOILER_ON); assertEquals(CoffeeMakerAPI.BOILER_ON, maker.getBoilerState()); maker.setBoilerState(CoffeeMakerAPI.BOILER_OFF); assertEquals(CoffeeMakerAPI.BOILER_OFF, maker.getBoilerState()); }
85a9bea3-004c-43ba-a79c-8e0ac9f50235
7
public String getName(){ switch (id) { case 0: return " UNDECIDED "; case 1: return " EARTH "; case 2: return " WIND "; case 3: return " WATER "; case 4: return " FIRE "; ...
0721beae-d729-417c-81ba-96a60ac12b1f
6
public static void cppOutputFormalParameters(Cons parameters) { { int nParameters = parameters.length(); boolean variableArgumentsP = false; ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("("); { Cons parameter = null; Cons iter000 = parameters; int n = Stella....
7de6c7ee-d2a4-4915-badc-caad08512608
1
private Boolean checkData(String sx){ /* * elegxei an exei dothei sxolio */ if(sx.length()<1){ JOptionPane.showMessageDialog(null, "Grapse kapoio sxolio!"); return false; }else{ return true; } }
ecda0be0-b2ad-40a9-9c28-e329888f94b2
2
public void read(SelectionKey key) throws IOException { System.out.println("READ CLIENT: "); //ByteBuffer buf = ByteBuffer.allocateDirect(StringConstants.BUF_SIZE); MappedByteBuffer buf = null; SocketChannel socketChannel = (SocketChannel)key.channel(); RandomAccessFile fromFil...
a62f54cf-2ba9-4f0f-8aa5-918cbb0ce055
4
public final void endElement(final String ns, final String lName, final String qName) throws SAXException { // the actual element name is either in lName or qName, depending // on whether the parser is namespace aware String name = lName == null || lName.length() == 0 ? qName : lName; // Fire "end" events f...
e9cc515d-bcac-4cb1-bc86-0357a308487f
5
private void tryToPickUpObjectInInteraction(MouseEvent e) { PickCanvas pickShape = new PickCanvas( (Canvas3D) e.getSource(), msd.scene); pickShape.setShapeLocation((MouseEvent) e); msd.x1 = e.getX(); msd.y1 = e.getY(); PickResult[] sgPath = pickShape.pickAllSorted(); if (sgPath != null) { try { N...
08e07cad-e84c-4dc5-b7a3-f99b8d4b0a5c
4
public void jButton2_actionPerformed(ActionEvent e) { String name = javax.swing.JOptionPane.showInputDialog(this, "输入节点名字: "); if (name == null || name.equals(" ")) { return; } if (allTreeNodeNameList.contains(name.trim())) {//节点名称不能有重复的 // 数...
ae02bc96-1bcc-4ab8-8178-c27828b7b30d
4
public static void init(String tempPath) { if (!isInit) { cfg = new Configuration(); cfg.setEncoding(Locale.CHINA, "UTF-8");// 设置字符集 String configPath = null; if(tempPath != null && !"".equals(tempPath)){ configPath = tempPath; }else{ WebContentPath = getWebcontentPath(); configPath = WebCo...
b4e50dbb-4854-42d2-8ed9-3aa5df9d7fe8
6
public static void setupPostRaceScreen() { // Set that the user didn't enter their high score yet enteredHighScore = false; // Find the player's best lap time bestLap = 0; for (int lap = 1; lap < lapTimes.length; lap++) { if (lapTimes[lap] < lapTimes[bestLap]) { bestLap = lap; } } try { // ...
44706b7c-cb53-480d-9084-3d2cfb2f762c
4
public String listarEst() throws SQLException { ResultSet list_est = null; String tbl_est = ""; String colorEstado = ""; String iconoEstado = ""; String nomFuncion = ""; try { list_est = Est.consultarEstudiante(); while (list_est.next()) { ...
b9fc3ee0-e8db-42e8-8d06-da7b7db36f12
9
public void cellRandDraw(int x, int y){ Random snail = new Random(); if(!sedna.getSelected() ||sedna.getSelection(x,y)){ if(cellfillflag){ int nose = randToolNum(3); switch(cft){ case 0: populate(x,y,3); break; case 1: mainBrain.getCell(x, y).setOption(toolstring[3]...
20d590a2-0659-4774-8216-aad20c602623
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
0f8deda8-9699-4206-a2b7-6af7fede6972
4
void extend() { int newX = x; while ( newX<parent.B.length && newX-index<parent.A.length && parent.B[newX] == parent.A[newX-index] ) newX++; if ( newX > x ) { parent.track( x, x-index, newX, newX-index ); setPrev( this.p, PathOperation....
9beb481f-dd61-4d91-8d9b-963ba8be3e3d
5
*/ public void mouseDragged(MouseEvent e) { if (dragStarted) { e.consume(); return; } if (dndArmedEvent == null) { return; } int dx = Math.abs(e.getX() - dndArmedEvent.getX()); int dy = Math.abs(e.getY() - dndArmedEvent.getY()); if ((dx > motionThre...
550f6b67-b1d1-4174-ab71-91a2cf8e9b92
8
public static void main(String[] args){ try{ BufferedReader in; if (args.length > 0) { try { in = new BufferedReader(new FileReader(args[0])); } catch (FileNotFoundException e) { System.out.println("Kunne ikke �pne...
4e50e208-7bc8-4c9d-842d-a76f999b33bb
7
private synchronized void receiveAd(Sim_event ev) { if (super.reportWriter_ != null) { super.write("receive router ad from, " + GridSim.getEntityName(ev.get_src())); } // what to do when an ad is received RIPAdPack ad = (RIPAdPack)ev.get_data(); ...
b2dc8e6c-b36a-413c-8b9c-246b25384460
1
public Type getGeneralizedType(Type type) { if (type.typecode == TC_RANGE) type = ((RangeType) type).getTop(); return type; }
8e606ad5-4043-44c3-afc5-a2fe00aa9755
8
private int compareHands(String hand1, String hand2) { int r1 = (int) (hand1.charAt(0)) - 48, r2 = (int) (hand2.charAt(0)) - 48; //compare ranks //if one is bigger than the other, it's done if (r1 > r2) { return 1; } else if (r2 > r1) { return 2; ...
0fe785c8-a393-473d-8c63-094e3928cbe4
6
final void setValues(int i, int i_6_, String string, String string_7_, String string_8_, int i_9_, int i_10_, String string_11_, String string_12_) { try { ((Message) this).anInt2031 = Entity.method2408((byte) -91); anInt2036++; ((Message) this).aString2033 = string_7_; ((Message) this)...
8acbcfd2-da95-49e0-9901-2ae56947b47d
8
protected boolean pickAndExecuteAnAction() { if (ordering) { SendOrder(outGoingList); } synchronized(orders) { for (Order order : orders) { synchronized(cookingAreas) { for(CookingArea cookingArea: cookingAreas) { synchronized(platingAreas) { for(PlatingArea platingArea: plati...
cdfdd66a-6068-4e9d-afe3-51579c3a7900
5
public void update(){ for(int i=0;i<spider.length;i++){ spider[i].update(); if(spider[i].getHp()>0){ if(moveAI(spider[i])); else{ } } } for(int b=0; b<coins.length; b++){ coins[b].update(); } for(int e=0;e<hearts.length;e++){ hearts[e].update(); } }
6dedc9b7-9054-44e9-9664-395c29c27205
1
@FXML public void action(ActionEvent event) { if(event.getSource().equals(buttonOk)) Core.getIntance().close(); }
b33b21bb-52b5-4d95-a9f7-89b31aaf8daf
0
public boolean isInitialized() { return this.initialized; }
edf32b02-c4a4-489f-8c0b-688f5782685a
6
public ParsableConfigurationData getParsbleData(){ ParsableConfigurationData data = new ParsableConfigurationData(type.toString() + "|" + name); data.addNewData(new StringData("name", name)); data.addNewData(new StringData("GameType", type.toString())); ParsableModule redSpawnsModule = new ParsableModule("RedSp...
1e1a2ef2-b560-4ad0-85f6-1b17f9e49aef
7
@EventHandler public void SkeletonStrength(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getZombieConfig().getDouble("Skeleton.St...
ad8e4fee-0c34-494a-8d54-0bb8160e33c1
6
public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(reader.readLine()); int b = Integer.parseInt(reader.readLine()); int c = Integer.parseInt(reader.readLine()); if...
8bee3785-0a7d-4eca-901b-0bd3b8ce2181
0
public synchronized EquationBTreeNode getChild1() {return child1;}
1addb7c6-4973-4caa-b873-4f21381a8a5b
9
public String build(DataSource source, String classTable, List<List<Object>> classData) { StringBuilder sb = new StringBuilder(); // -- PAL setup sb.append(SqlGenerator.setSchema(schemaName)); List<TableType> allTypes = algorithm.getSignature().getAllTypes(); for (TableType type : allTypes) { sb.app...
e27b2366-aecd-4d48-9dd9-437d57bad6c2
0
public Long getMaxLength() { return maxLength; }
69fa5093-87ad-45bd-9add-e1edf40fc46d
6
@EventHandler public void CreeperStrength(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getCreeperConfig().getDouble("Creeper.Str...
7bd36a4d-f45c-4b84-972a-7a90700b5cb5
9
static final void method3461(int i, Object[] objects, int i_26_, long[] ls, int i_27_) { do { try { anInt4351++; if ((i ^ 0xffffffff) > (i_26_ ^ 0xffffffff)) { int i_28_ = (i + i_26_) / 2; int i_29_ = i; long l = ls[i_28_]; ls[i_28_] = ls[i_26_]; ls[i_26_] = l; Object ...
7f582f2d-f170-4707-8ae7-020351507b2f
0
public static void main(String[] args) { MyFrame frame = new MyFrame("First Frame !"); frame.setSize(500, 500); frame.setBackground(Color.DARK_GRAY); frame.setVisible(true); }
33f6e2d6-30a6-484a-a8c9-dfa3e51661d2
4
@Override public boolean execute(CommandSender sender, String identifier, String[] args) { Player player = (Player) sender; String titleId = args[0]; if (sender instanceof Player) { try { if (!DBManager.idExist(titleId)) { sender.sendMessage("No titles exist with this id."); return false; ...
431dcf56-5733-41f5-932b-003f65356a2f
7
public static void runExitPrompt() { try { while (!exit && !resume && !goToMainMenu && !restart) { // If the display is not visible (minimised), add much more // delay if (!Display.isVisible()) { Thread.sleep(200); } // If the display is requested to close, exit the program else if (...
143322ab-6f0f-4316-ba62-195a6f400c40
0
public void addLegForce(int legForce) { this.legForce += legForce; }
e585d603-c39e-4d9b-b5c8-be9f91f88467
8
public boolean onJoinCommand(CommandSender sender, Command cmd, String label, String[] args){ if (args.length == 1) { //specified only the team to join. join hte first for (CTFSession s: sessions) { if (s.hasTeam(args[0])) { CTFTeam team = s.getTeam(args[0]); s.addPlayer(team, getTeamPlayer((Playe...
c3531775-ee9b-4eb6-b67b-a2f8c9cfacd7
1
public static boolean isIndexPath(String path) { path = path.trim().toLowerCase(); return path.endsWith(DataConstants.INDEX_COMPRESSED_FILE_EXTENSION) || path.endsWith(DataConstants.DEFAULT_INDEX_FILE_NAME); }
943c0be5-11b3-4ca4-b87e-8289d186e2c9
9
@Override public void execute(Object parent) { mxGraphHierarchyModel model = layout.getModel(); final Set<mxGraphHierarchyNode> seenNodes = new HashSet<mxGraphHierarchyNode>(); final Set<mxGraphHierarchyNode> unseenNodes = new HashSet<mxGraphHierarchyNode>( model.getVertexMapper().values()); // Perform a...
2d4879c0-0fa4-4b2b-8510-44ac8004174d
5
int dinicDfs(int[] ptr, int[] dist, int dest, int u, int f) { if (u == dest) return f; for (; ptr[u] < ady[u].size(); ++ptr[u]) { Edge e = ady[u].get(ptr[u]); if (dist[e.t] == dist[u] + 1 && e.f < e.cap) { int df = dinicDfs(ptr, dist, dest, e.t, Math.min(f, e.cap - e.f)); if (df > 0) ...
74f94123-03bf-4a76-ad1a-4795f7f9a6c5
9
@Override public void start(Map<String, List<String>> incAttributes, String incUrl, Socket socket) { System.out.println("Starting RainbowSystem Plugin"); ResponseHandler respHandle = new ResponseHandler(socket); if (incAttributes.isEmpty()) { try { respHandle.star...
31b2e64d-0ece-4ff4-93b8-7d5db6eb0504
4
private void boton(){ if(estado)iniciar(); else{ for(int i=0; i<9; i++) for(int j=0;j<9;j++){ casillas[i][j].setText(""); casillas[i][j].setBackground(c2); } } estado = !estado; jButton1.setText((estado)?"Resolver":"Borrar"); }
03b958aa-a87a-464a-bf28-c3cee9473e66
1
@Override public boolean accept(File f) { return f.isDirectory() || f.getAbsolutePath().toLowerCase().endsWith(".img"); }
c8332e7b-7db6-4ff1-9e90-eb533203060c
1
public static Point getPointSize(int number) { int exp = greater2PowersExponent(number); int n2 = exp >> 1; int r = exp & 0x1; int sizey = 1 << n2; int sizex = sizey; if (r > 0) { sizex = sizex << 1; } return new Point(sizex, sizey); }
29a211c5-289a-45f3-a4b2-13def5f49c4a
8
public void run() { World world; Location blockLocation; BaseBlock testBlock; // if(delaysTillBlockPlace <= building.getBuildSpeed()) { if (delaysTillBlockPlace <= 1) { delaysTillBlockPlace++; } else { delaysTillBlockPlace = 0; world = player.getWorld(); blockLocation = new Location(world, ...
35dcc647-202d-4e1d-a320-0b3020bb0dd6
7
private void fetchPositions(Car significantCar) throws IOException { HttpURLConnection connection = (HttpURLConnection) new URL( "https://mapsracer.appspot.com/position").openConnection(); connection.setRequestMethod("GET"); InputStreamReader streamReader = new InputStreamReader( connection.getInputStrea...
eaec2305-e0d9-48bc-95ad-3e89993b7436
9
*/ public static void evaluateProposition(Proposition self) { Proposition.evaluationStateSetter(self, Logic.KWD_EVALUATED); { Keyword testValue000 = self.kind; if (testValue000 == Logic.KWD_AND) { Proposition.evaluateAndProposition(self); } else if (testValue000 == Logic.KWD_OR) { ...
2579b06c-c58d-40f5-b3f5-833d3935aaa1
1
private void jTextFieldCmdCliQte2FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCmdCliQte2FocusLost mondecimal = new DecimalFormat("#######.00"); if (!(jTextFieldCmdCliQte2.getText().equals(""))) { int qte = Integer.parseInt(jTextFieldCmdCliQte2.getText().trim()...
f74c1d20-6b4d-41b3-b5d7-b59faf9e1d07
5
public CheckResultMessage checkL2(int day){ int r1 = get(17,5); int c1 = get(18,5); int r2 = get(39,5); int c2 = get(40,5); if(checkVersion(file).equals("2003")){ try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if(0!=getValue(r2+1, c2+day, 10).compareTo(getValue(r1+day, ...
b23a42e3-c56a-460c-9ae0-3ca28047be73
1
@Override public Item next() { if (!hasNext()) throw new java.util.NoSuchElementException(); return ar[i--]; }
a4f4305d-15e3-422c-a368-e17ea1daa34d
7
private static ArrayList<Integer> darIndices(String titulo, String key) { ArrayList<Integer> indices = new ArrayList<Integer>(); String palabra = "",palAux=""; int aux = 0; for (int i = 0; i < titulo.length(); i++) { char caracter = titulo.charAt(i); if(caracter!=' '){ if(Character.isLetter(caracter))...
93eed52c-0700-42cd-a424-ad24ba01bb0d
5
protected boolean getSubCommand(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { if (isOcorrendo()) { sender.sendMessage(getMessage("Message6")); } else { sender.sendMessage(getMessage("Message7")); } } else { ...
5063fbd4-2ed0-49e6-85ae-c9ccb343ad17
2
public SignatureVisitor visitClassBound() { if (state != FORMAL) { throw new IllegalStateException(); } state = BOUND; SignatureVisitor v = sv == null ? null : sv.visitClassBound(); return new CheckSignatureAdapter(TYPE_SIGNATURE, v); }
3698f5da-d59c-4fad-85bf-f7cbc002ec00
0
public static void serviceConsumer(ServiceFactory fact) { Service s = fact.getService(); s.method1(); s.method2(); }
134e9f07-82d6-40de-909e-05410453b790
3
public MedicoDAO getMedico(){ try{ EntityManager em = conecta(); if (em!=null){ String consulta = "SELECT m FROM Medico m WHERE m.idMedico="+idMedico; //System.out.println(consulta); Query q = em.createQuery(consulta); List<...
b4d6860c-04f1-45a1-9c37-654f1d1874d8
0
public Color getOutline() { return outline; }
900c0ee8-9b06-49a2-a64c-ea4053dfdfe7
6
public void mouseClicked(MouseEvent e) { switch(state){ case 0: gameStart.mouseClicked(e, xMouse, yMouse); break; case 1: lvlObj1.mouseClicked(e);if(xMouse>12 && xMouse<175 && yMouse>488 && yMouse<538){ drawLightning = true; } break; } }
89878eb5-eeed-4f7c-aca2-b3298dd4466e
2
public boolean contains(Point point) { for (List<List<LngLatAlt>> coordinate : coordinates) { if (GeoJson.pointInPolygon(coordinate, point)) { return true; } } return false; }
56a8beaf-c711-4183-bed3-ffb73657d863
8
private void onDragSash(Event event) { if (event.detail == SWT.DRAG) { // constrain feedback Rectangle area = getClientArea(); if (orientation == SWT.HORIZONTAL) { if (controls[0].getData(MAINTAIN_SIZE) != null) { event.x = Math.max(event.x, DRAG_MINIMUM); } else { event.x = Math.min(event....
8389396d-7bff-4ed7-8195-a1debbe3c658
6
protected static final boolean notIgnore(Object value, int ignore) { if (ignore > IGNORE_NONE) { switch (ignore) { case IGNORE_NULL: return value != null; case IGNORE_EMPTY: return value != null && value.toString().length() > 0; case IGNORE_BLANK: return value != null && StringUtil.notEmpty(va...
22884fb6-b654-4431-8239-c45ba14a8bd6
7
* @param options * @return String */ public static String composeNamestring(Cons nameComponents, Cons options) { { PropertyList self000 = PropertyList.newPropertyList(); self000.thePlist = options; { PropertyList plist = self000; String prefix = ""; String suffix = ""; K...
1f06c089-7eaf-49cb-bb49-becd84f2fac2
9
public static RNASecStr loadSecStrBPSEQ(String path) { RNASecStr res = null; try { BufferedReader fr = new BufferedReader(new FileReader(path)); String line = fr.readLine(); String seqTmp = ""; Vector<Integer> strTmp = new Vector<Integer>(); while(line!= null) { line = line.t...
6a3b44d7-fde5-4117-8b23-390497ff8b3f
0
@BeforeClass public static void setUpClass() { }
5d5733d7-6641-44b5-b342-c164271d7089
7
public TreeNode buildTree1(int[] preorder, int[] inorder) { if(preorder.length == 0 || inorder.length == 0) return null; TreeNode mid = new TreeNode(preorder[0]); if(preorder.length == 1) return mid; int midIndex = -1; for(int i=0; i< inorder.length; i++) ...
b987fe2c-cb72-4716-99fc-754712419a2c
6
public boolean solveSudoku(char[][] board) { // Start typing your Java solution below // DO NOT write main() function for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (board[i][j] == '.') { for (int k = 0; k < 9; k++) { ...
361061d4-fe8c-4e39-ad06-4b8a24f75ac4
6
private void processRcon(int userLevel, String[] keywords, String sender, String hostname) { logMessage(LOGLEVEL_NORMAL, "Processing a request for rcon (from " + sender + ")."); if (isAccountTypeOf(userLevel, REGISTERED, MODERATOR, ADMIN)) { if (keywords.length == 2) { if (Functions.isNumeric(keywords[1])) {...
0bcd68ce-80eb-4c8b-bec9-36fee65948e4
5
public void keyPressed(int k) { if(k == KeyEvent.VK_ENTER){ select(); } if(k == KeyEvent.VK_UP){ currentChoice--; if(currentChoice == -1){ currentChoice = options.length - 1; } } if(k == KeyEvent.VK_DOWN){ currentChoice++; if(currentChoice == options.length){ currentChoice = 0; ...
79703961-b616-4bf3-9ebf-613a2fda0e11
9
@Override public String getCVSArguments() { final StringBuffer toReturn = new StringBuffer(""); // NOI18N if (!isRecursive()) { toReturn.append("-l "); // NOI18N } if (isUseHeadIfNotFound()) { toReturn.append("-f "); // NOI18N } if (getExportBy...
09304d0c-e2bf-4c0c-abd9-506543173bc8
9
public boolean isEmpty() { if (this.lowerLimit_ != null && this.upperLimit_ != null) { return false; } if (this.lowerEndpoint_ != null && this.upperEndpoint_ != null) { return false; } if (this.lowerLimit_ != null && this.upperEndpoint_ != null) { return false; } if (this.lowerEndpoint_ != null &...
9f0d8a2c-e2a8-4915-bfbf-df76ca8b9af1
4
public void messageReceived(DataPacket packet) { if (!packet.isKeepAlive()) { System.out.println("Error, packet delivered at network monitor is NOT a keep-alive packet!"); return; } Byte source = packet.getSource(); this.lock.lock(); // shutdown? if (packet.isRouting()) { if (this.activity...
6bb24f35-4a28-4a38-a6b0-036dd62c0c06
8
private EventQueueList(Object[] data){ super(data); MouseListener mouseListener = new MouseAdapter() { public void mouseClicked(MouseEvent e) { if(e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) { int index = locationToIndex(e.getPoint()); if(queueElements[index] != null && que...