method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
81561db0-0144-4664-9463-cd50f7719fee
9
public Fom() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 1101, 641); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); panel.setBounds(10, 11, 329, 356); contentPane.add(panel); panel_1....
0a5d2949-775b-4827-b4ed-45273498f69f
4
private Client() { try { s = new Socket("localhost", 11111); } catch (UnknownHostException uhe) { // Server Host unreachable System.out.println("Unknown Host : localhost"); s = null; } catch (IOException ioe) { // Cannot connect to port...
9a0d940e-77c9-4626-b569-661aaa6f6876
7
private Module getModule(File file) { String fileExtension = file.getAbsolutePath().substring(file.getAbsolutePath().lastIndexOf("/") + 1); if(fileExtension.contains(".")) fileExtension = fileExtension.substring(fileExtension.lastIndexOf(".") + 1); List<Module> moduleList = new Array...
65f2b20b-2bdf-400c-bc87-d8a2d311aeff
2
public boolean isPackage() { return (!isPublic() && !isPrivate() && !isProtected()); }
917237f7-8d95-464a-a625-fb7c505f9bfd
2
private void connect(){ try { server = new Socket(remote_host, remote_port); out = new PrintWriter(server.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(server.getInputStream())); } catch (UnknownHostException e) { System.err.print...
3aa2e5ce-c5e6-476f-969b-ed8287ba497b
1
@Override public void joined(String channel) { ChannelTab tab = getChannelTabByName(channel); if (tab == null) tab = createChannelTab(channel); tab.setFocus(); }
ec6cf0cf-1cb9-410f-bcad-796fed11aa4c
5
public void displayBoard() { for (int i = 0; i < Board.allMarkers.length; i++){ for (int j = 0; j < Board.allMarkers[i].length; j++) { String currentMarker; if ("_".equals(allMarkers[i][j])) { currentMarker = " "; ...
da1b0e34-928b-4db1-9521-71541922f2d2
1
protected static String processAbbreviation(String text) { StringBuilder output = new StringBuilder(""); String arr[] = text.split("\\|"); output.append(arr[2]); output.append(" ("); output.append(arr[1]); output.append(") "); if (arr.length >= 4) { o...
0908cbd8-95d5-4ccf-a56d-bd6e6b92c3ec
9
@EventHandler( priority = EventPriority.HIGHEST ) public void onSignChangeEvent( SignChangeEvent event ) { Block b = event.getBlock(); String m = event.getLine( 0 ); Player p = event.getPlayer(); if ( m.equalsIgnoreCase( "[locked]" ) ) { event.setLine( 0, ChatColor.GOLD + "[locked]" ); event.setLin...
d17325c3-f86f-4e83-b722-3934d52ff242
1
public boolean equals(Point p) { int _x = p.getX(); int _y = p.getY(); return x == _x && y == _y; }
b7f28a80-979b-44e7-8210-59779bd1200b
6
private void copyRGBtoRGBA(ByteBuffer buffer, byte[] curLine) { if (transPixel != null) { byte tr = transPixel[1]; byte tg = transPixel[3]; byte tb = transPixel[5]; for (int i = 1, n = curLine.length; i < n; i += 3) { byte r = curLine[i]; ...
bbd1dad8-c5f2-4fa4-9e66-b5d036615059
5
@Override public Class<?> getColumnClass(int columnIndex) { switch (columnIndex) { case 0: return Long.class; case 1: case 2: return String.class; case 3: return BigDecimal.class; default: throw new IllegalArgumentException("columnIndex"); } }
eaf41dc7-ec42-4aac-8385-838a4c8c323f
0
public int getNumOfSkills() { return numOfSkills; }
2f19c192-ef04-4cfd-8982-0961f241b507
9
private boolean validarFecha(int d, int m, int a){ int diasDelMes[]={31,29,31,30,31,30,31,31,30,31,30,31}; if(a<=0) { return false; } if(d<=0 || d>31) { return false; } if(m<=0 || m>12) { return false; } if(d>di...
6aa561a6-4721-4295-ac24-90f48636eddb
5
public <T> void register( CapabilityName<T> name, CapabilityHandler<T> handler ){ Iterator<Site<?>> handlers = this.handlers.iterator(); while( handlers.hasNext() ){ Site<?> site = handlers.next(); if( site.name.equals( name )){ handlers.remove(); site.dispose(); } } if( handler != null ){ ...
bc77abdd-8145-44dc-b74c-8b9d8fbbe85e
0
public void setIdentifier(String identifier) { this.identifier = identifier; }
2d245296-0882-4904-b642-f944a7f33064
5
private static void diffusePixel(Image original, Image diffused, int i, int j, BorderDetectorFunction pf) { for(ChannelType channel: Image.rgbValues()){ double oldValueIJ = original.getPixel(i, j, channel); double DnIij = i > 0 ? original.getPixel(i - 1, j, channel) - oldValueIJ : 0; double DsIij = i ...
6429f706-efad-41e2-8509-653ee515fbed
7
public static final double expectation(double ruleCount, int premiseCount,double[] midPoints, Hashtable priors){ double numerator = 0, denominator = 0; for(int i = 0;i < midPoints.length; i++){ Double actualPrior = (Double)priors.get(new Double(midPoints[i])); if(actualPrior != null){ if(actualPri...
81748a2f-42fc-43fa-9c54-2e0a0db911d2
2
private static ArrayList<Fact> getAnswers(ArrayList<Fact> list) { ArrayList<Fact> newList = new ArrayList(); for (Fact f : list) { if (f.isAnswer()) { newList.add(f); } } return newList; }
a56d09fa-3a1a-4372-b7fd-5ad1b0652c84
7
private Vector getDirection(int number){ Vector res = new Vector(0,0); if (!hasEnemyInAreaToMove(number)){ return res; } double radius; int count = 1; for (int i = 0; i < beings.size(); i++){ radius = beings.get(number).isZombie() ? RADIUS_DETECT_H...
e8f14275-b774-4208-9fc4-0197b90b6172
5
protected void updatePaddles() { if (cnt == 3) { cnt = 0; if (wPressed) { paddle1.moveUp(); } if (sPressed) { paddle1.moveDown(); } if (upPressed) { paddle2.moveUp(); } ...
93f24e10-e260-4a3e-999e-3101850219a5
2
private int getLeafScore() throws Exception { if (this.getState().isWin(MAX_PLAYER)) { return 1; } else if (this.getState().isWin(MIN_PLAYER)) { return -1; } else { return 0; } }
3e67fc12-385c-42b9-817d-7d6b188a0dc4
0
@Basic @Column(name = "account_number") public String getAccountNumber() { return accountNumber; }
0a10a62d-5a5e-42bc-b572-4527b5433f1e
8
protected void getUniversalStartingItems(int theme, MOB mob) { final List<String> newItemPartsV = CMParms.parseCommas(CMProps.getVar(CMProps.Str.STARTINGITEMS), true); for(String item : newItemPartsV) { item=item.trim(); int num=1; final int x = item.indexOf(' '); if((x>0)&&(CMath.isInteger(item.subs...
fa77a936-bd03-4cd5-afb4-c5750a31ec0a
1
public void render(Graphics g) { // this.idleImage.draw(position.getX(), position.getY()); if(!this.eating) { this.animation.get(this.currentAnimation).draw(position.x, position.y); } else { playEatingAnimation(); } }
430d2ab6-44d5-4c55-9558-5b7d559a0f36
9
public boolean processInputLine(String line) { logger.info(newLine + controller.getCardinGame().size()); if (!controller.stillSetInGAme() || this.controller.getCardinGame().isEmpty()) { lastMensage(); return false; } boolean cont = true; String[] splintWords = line.split(" "); int index = ZERO; ...
008db04c-0aa5-4599-8ae2-eceb66cc3120
8
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
e45986f1-2c5c-47ac-bf3b-ae8e73106475
6
public static void connectToHost(String[] args){ String host = null; int port = -1; if (args.length < 2) { System.out.println("ILLEGAL ARGUMENT; USAGE: java client host port"); System.exit(-1); } try { // get input parameters ...
61ab596f-cd5b-43e1-8c62-612b9f8c9f6f
8
final public void N_Address() throws ParseException { /*@bgen(jjtree) N_Address */ ASTN_Address jjtn000 = new ASTN_Address(JJTN_ADDRESS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { N_Paras(); jj_consume_token(AT); N_Domain(); } catch (Throwable jjte000) { if ...
c71763d7-02ab-4e70-8976-c1dc20859e47
6
@RequestMapping("getStatusMess") public String getStatusMess(HttpServletRequest request,String status){ String _status = ""; if(status =="yiqueren" ||status.equals("yiqueren")){ _status = "申请已确认"; } if(status =="yipaichu" ||status.equals("yipaichu")){ _status = "车辆已派出"; } if(status =="yijieshu" ||sta...
187cae66-f7e7-4081-83d5-c74b57a79549
7
private void updateConfig(){ if(!xm.getConfig().isSet("SaveUsersOnJoin")){ xm.getConfig().set("SaveUsersOnJoin", "true"); } if(!xm.getConfig().isSet("ConfigVersion")){ xm.getConfig().set("ConfigVersion", currentVersion); } if(!xm.getConfig().isSet("CheckUpdate")){ if(!xm.getConfig().isSet("CheckUpdat...
1d5c835c-3efc-4128-b3a4-b44959fbf873
2
private void fillArray(Object array, Random random, int size) { int arraySize = Array.getLength(array); for (int i = 0; i < arraySize; ++i) { Class comp = array.getClass().getComponentType(); if (comp.isArray()) { fillArray(Array.get(array, i), random, size); ...
b55358aa-1c83-4977-a919-e35012fba9b6
8
void processOMMMsg(OMMMsg msg) { switch (msg.getMsgType()) { case OMMMsg.MsgType.REFRESH_RESP: if (msg.getDataType() == OMMTypes.MAP) { processMap((OMMMap)msg.getPayload()); } else { ...
a0cc8f93-c908-4377-8875-a9b680e8515f
5
public static void main(String[] args) { Scanner inputScanner = null; try { inputScanner = new Scanner(new File(args[0])); } catch (FileNotFoundException e) { System.err.println("Invalid input file."); } while (inputScanner.hasNextLine()) { String input = inputScanner.nextLine(); String longString...
ddc6e4c0-39c6-4462-b8a8-6f7e0997fc3a
4
public static String fill(String type) { if (type.equals("String")) return "java.lang.String"; else if (type.equals("int")) return "java.lang.Integer"; else if (type.equals("long")) return "java.lang.Long"; else if (type.equals("boolean")) return "java.lang.Boolean"; return null;...
7638b3cb-9be5-408f-8702-4f3ba8d73394
8
public void setDestination(double x, double y){ xStart = this.x; yStart = this.y; destinationX = x; destinationY = y; if(destinationX > this.x){ destinationX -= sprite.SIZE / 2; }else if(destinationX < this.x){ destinationX += sprite.SIZE / 2; } if(destinationY > this.y){ destinationY ...
2d8f2874-287b-4869-bba5-8aed999ab17a
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Experiment other = (Experiment) obj; if (ID == null) { if (other.ID != null) return false; } else if (!ID.equals(other.ID)) return f...
46ca784f-49c7-4112-89ac-a1d375827052
6
public List<WeightedEdge> RunPrim() { nodesList = new ArrayList<Integer>(nodes); Random rnd = new Random(); // blue edges K = new ArrayList<WeightedEdge>(); U = new ArrayList<Integer>(); Close = new int[nodes.size()]; ClosestWeight = new double[nodes.size()]; int node = nodesList.get(rnd.nextInt(n...
ae30ce57-c101-478c-b029-32118110fad5
4
public String getFullTime24(){ int hourI = this.getHour24(); this.fullTime24 = (new Integer(hourI)).toString(); int minI = this.getMinute(); if(minI<10){ this.fullTime24 += ".0" + minI; } else{ this.fullTime24 += "." + minI; } int s...
4b5bb87c-25ff-49f5-9830-b8cd99876dc2
9
protected Element invokeWriteToXML(Element parent, Object o, String name) throws Exception { Method method; Class[] methodClasses; Object[] methodArgs; boolean array; Element node; boolean useDefault; node = null; met...
370a5ec2-0402-4b1c-9280-e6a5405da31a
0
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
ea8ad322-d20c-42ca-b9ee-a51fd2557940
0
public static Set getNewProductionWithUsefulVariableSet() { return new HashSet(); }
5ba3f3e6-e1fb-472a-8694-44bf0a91dfd5
4
public void doCreateScaffold(StaplerRequest request, StaplerResponse response) throws IOException, ServletException { String name = request.getParameter("name"); String[] jobNames = request.getParameterValues("jobNames"); String[] variableNames = request.getParameterValues("variables"); ...
72c5a449-80d2-4429-921f-3e5b5927e3e5
0
public void setFunApellidos(String funApellidos) { this.funApellidos = funApellidos; }
345f06b4-c455-497a-b18b-12fca0359015
4
public int getRowCount() { if (numberOfRows != null) return numberOfRows; if (categories.isEmpty()) throw new IllegalStateException("there are no categories added from which I could count the number of rows/fields"); int rowcount = categories.get(0).getFieldCount(); for (Category category : categories) { if...
d8027b65-7d20-4156-9377-07d37c10d7a2
5
private boolean initialize(int numOfRows, int numOfColumns) { if (isInitialized) { Iterator<List<Passenger>> rowIterator = passengerList.iterator(); while(rowIterator.hasNext()){ List<Passenger> _passengers = rowIterator.next(); for (int i = 0; i < _passen...
c3ff8c66-c149-44d8-8455-a65cc9e08cc9
0
public String getFriendlyName() { return friendlyName; }
2fff754e-0652-4b3b-b19a-325cccdd054a
5
public void enableEncryption(@SuppressWarnings("hiding") boolean encrypt) { if (encrypt && !this.encrypt && (this.changeTypeC != '-')) { this.encrypt = true; } else if (!encrypt && this.encrypt) { this.encrypt = false; } }
0afaad13-2fac-4f83-806c-00d513656329
0
@Override public ArrayList<String> getGoToList() { // TODO Auto-generated method stub return null; }
72feadc0-4b9c-449b-a838-e3e111325ff4
8
* @param breakoncap * @param breakonnumber * @param breakonseparators * @param removeprefix * @param removesuffix * @param addprefix * @param addsuffix * @param outputcase * @param outputseparator * @return String */ public static String makeMatchingNameFull(String originalname, Keyword ...
9ffb8b08-d36d-4bb1-8f38-6874f70fc285
5
public boolean upgradeSettlement(Coordinate location, Player owner) { boolean isUpgraded = false; location = location.normalizeCoordinate(); // Attempt to find the settlement and upgrade it Node locationNode = nodeSet.get(location); // Make sure user has proper hand in...
854f0316-0d6f-431f-bd3e-67487982407c
7
@Override public void actionPerformed(ActionEvent e) { final String cmd = e.getActionCommand(); final int ri; final int ci; if (cmd == null) { assert false : "command is null"; return; } else if (cmd.endsWith("-to-home")...
459c8fc3-b7c9-4776-ad2d-8ece937b2891
3
public HashMap<String, Float> analyseRules(HashMap<String, Float> rulesMin) { HashMap<String, Float> result = new HashMap<>(); for (String r : rulesMin.keySet()) { if (rules.containsKey(r)) { if (!result.containsKey(rules.get(r))) result.put(rules.get(r), rulesMin.get(r)); else { // If the key ...
f2ccc650-a9d2-4f94-8b48-33064c86c9aa
3
public void run() { try{ while (!interrupted()) { tekst.setText(toString()); synchronized(this) { while(zaustavi) wait(); } radnja(); tekst.setText(toString()); } }catch(InterruptedException g){} }
f6eb14da-5768-4be1-9f30-379fccb20eb2
0
public int getA() { return a; }
5e554da9-d170-4488-bd3e-d7da3710d9dc
3
private String getSlotSizes(int par, int chi) { String ssLine = ""; int[] sizes = c.widgets.get(par, chi).getSlotSizes(); if (sizes != null) { for (int i = 0; i < sizes.length; i++) { ssLine = ssLine + sizes[i]; if (i < sizes.length - 1) { ...
e51241bf-fdd0-4cca-a833-42aec03c2228
3
public void addAnnotation(Field field, Class<? extends Annotation> annotation) { if(field == null) { throw new IllegalArgumentException("Field cannot be null"); } FieldStoreItem item = store.get(FieldStoreItem.createKey(field)); if(item != null) { item.setAnnotati...
d2ca04c3-ff06-4239-a9f6-1767df4529b5
3
public static boolean createTable(Connection con, TableInfo tableInfo) { System.out.println("Creating table " + tableInfo.tableName); String tableCreate = "CREATE TABLE " + tableInfo.tableName + " ( "; for(String i : tableInfo.columns) { String[] tmp = i.split(","); tableCreate += " " + tmp[0] + " " + ...
6ad1aa02-faf7-46ee-9212-c5a007591ede
8
public void expandNode(int count) { tour = new ArrayList<Vertex>(); tours = new ArrayList<ArrayList<Vertex>>(); for(int a = 0; a < (caseSize - 1); a ++) { cost = 15000; if(a == 0) { tour.add(vertices.get(count - 1)); v1 = tour.get(0); } specifiedEdges = graph.getEdges(v1); Iterator...
35d2c417-7444-4e79-a863-7671655830a3
3
@Override public JSONObject main(Map<String, String> params, Session session) throws Exception { JSONObject rtn = new JSONObject(); long apptId = Long.parseLong(params.get("id")); Appointment appt = Appointment.findById(apptId); if(appt == null) { rtn.put("rtnCode", this.getRtnCode(405)); return rtn; ...
fcd7edfa-1d0b-47fd-8090-5c95209e4fa7
2
public String buscarUsuariosPorCode(String code){ String resultBusqueda = "No se encuentra registro"; tablaDeUsuarios(); for(int i = 0; i<data.size();i++){ String codeBuscado = data.get(i).getCode(); if (codeBuscado.equals(code)){ resultBusqueda =...
c6d9065f-2dae-4a36-9cc3-ba84f7745ae8
1
public void clearButtons() { this.abilitiesListed.clear(); while(cur > 0) { buttons[cur].setVisible(false); cur--; } buttons[0].setVisible(false); }
b4507f9c-5532-4081-bbdc-851449990570
9
@Test public void testRoll() { track.rollDice(dice); for (int i = 0; i < dice.size(); i++) { if (dice.get(i).toString() == "workers") { assertTrue(track.getWorkers() >= 3); } else if (dice.get(i).toString() == "good") { assertTrue(track.getGoods() >= 1); } else if (dice.get(i).toString() == "food ...
d8f1d3af-bbfc-4321-be42-0438dc6768b8
9
public String invoker(String methodName,String[] args){ switch(methodName){ case "getInt" : return getInt(args); case "getEmail" : return getEmail(); case "getName" : return getName(); case "getLatitude" : return getLatitude(); case "getLongitude" : return getLongitude(); case "getFromList": retur...
2c0a2159-cc76-4da6-950e-812f542357b7
0
public Id3v2TextFrame(Property property, PropertyTree parent) { super(property, parent); }
3bdb8439-835e-47b7-9cf6-23c12de3d904
3
public String toString() { String str = "Step: [" + this.Type + ","; if (this.Argument1 != null) str = str + this.Argument1 + ","; if (this.Argument2 != null) str = str + this.Argument2 + ","; if (this.Point1 != null) str = str + this.Point1 + ","; str = str + this.Number1 + ",De...
9420045b-0de6-4709-a1cb-d445676aa451
8
public long nextLong() throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p == PEEKED_LONG) { peeked = PEEKED_NONE; return peekedLong; } if (p == PEEKED_NUMBER) { peekedString = new String(buffer, pos, peekedNumberLength); pos += peek...
2b4e0751-7cf1-42f6-a9c4-215a3b0cd6e8
9
public static void main(String[] args) throws Exception { if (args.length != 2) { System.err.println("Usage: ImageDriver <port> <imagefile>"); return; } String port = args[0]; String filename = args[1]; System.out.println("Opening connection to watch..."); FileOutputStream ...
46ff6e24-3426-4b18-91e1-61940a1cd829
9
public DefaultListModel<String> findOrder(String input) { /*Adds wildcard on both sides of the search phrase*/ input = "%" + input + "%"; /*tries to setup a connection to the database*/ try (Connection con = DriverManager.getConnection(URL, username, password)) { /*tries to create a prepared sta...
8e27a7f3-c504-43f3-9c76-d31568f8fe61
8
@Override public void onUnitComplete(Unit unit) { StartedBuildRequest completed = null; for (StartedBuildRequest request : finishedRequests) { if (request.getRequest().getUnit().equals(unit.getType())) { completed = request; break; } } if (completed != null) { // Put the unit where it was requ...
d9f69fa6-32c5-42ff-afdd-10189a8b801e
1
public final EsperParser.whileloop_return whileloop() throws RecognitionException { EsperParser.whileloop_return retval = new EsperParser.whileloop_return(); retval.start = input.LT(1); Object root_0 = null; Token ENDWHILE54=null; EsperParser.while__return while_53 =null; ...
862b9e65-9ff7-4c88-bfd5-d88020a31c3b
4
public static void main(String[] args) { if (Debug.enabled) { try { // Tables from gnu.jel.TypesStack String[] specialTypesStr={ null, // Boolean.TYPE, // 0 0x00 null, // Byte.TYPE, // 1 0x01 null, // Cha...
39429993-d16b-4a33-a2c0-709cd3039bd3
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...
d43dab83-d6ec-420a-be7c-4de5af0eebfa
4
public boolean removeLanguageVersion( TLanguageFile versionFile ) { boolean back = false ; if (versionFile == null) { return false ; } // try to delete default if (defaultLang != null) { if (defaultLang.hashCode() == versionFile.hashCode() ) { defaultLang = n...
6dac7910-2ce4-4f6c-897d-60096203f991
9
public DropTarget getDropTarget(Point pLocation) { //Convert the point to be relative to the stage Point _point = pLocation.getLocation(); //Go through the registered windows and get its components Iterator _it = windows.iterator(); while(_it.hasNext()) { Window _win = (Window)_it.ne...
7007febb-c51f-4984-b210-945739127c80
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...
85ad26ec-d0f4-4274-828b-d50ac8a25438
0
private void addTerminal(String terminal) { myTerminals.add(terminal); }
305e55a7-82e1-4ba7-9db9-2835c6fe7327
5
public Cell[][] getExploredStatus() { int rowCount = this.exploredMap.getRowCount(); int colCount = this.exploredMap.getColumnCount(); Cell[][] status = new Cell[rowCount][colCount]; for(int rowID = 0;rowID < this.exploredMap.getRowCount();rowID++){ for(int colID = 0;colID < this.exploredMap.getColumnCount...
bdb4c274-ad71-487c-962b-fa9d51519095
7
private List<Shape> getShapesOrderedWithoutTop(Collection<Line> lines) { final List<Shape> all = new ArrayList<Shape>(shapes); final Set<String> tops = new HashSet<String>(); final Map<String, Shape> shs = new HashMap<String, Shape>(); for (final Iterator<Shape> it = all.iterator(); it.hasNext();) { final S...
f0f0495b-1ea9-4c74-bc70-7848fe47dc0c
3
public static int getColumnIndex(final String key, final MetaData columnMD, final String colName, final boolean columNameCaseSensitive) { int idx = -1; String column = colName; if (!columNameCaseSensitive) { column = colName.toLowerCase(Locale.getDefault()); } idx = c...
4c038f59-0065-4ed7-af7a-907f6705c134
0
public ClassPathHandler( Filter filter, ClassPathEntryHandler... classHandlers ) { this.filter = filter; this.classHandlers = classHandlers; }
68bfc4f8-94a5-4bb2-9c37-6af37f9bc31d
8
public fieldCard(String empty, String select, int x, int y) { super(empty); try { cardEmpty = ImageIO.read(new File(empty)); cardSelect = ImageIO.read(new File(select)); } catch(IOException e) { System.out.print...
539eec28-7c32-4693-b4d2-b84dce6df6e9
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 fe...
25c47d3e-9146-4a98-894a-b98a31a9ece6
7
@Override public boolean activate() { return (Game.getClientState() != Game.INDEX_MAP_LOADED || (Game.getClientState() == Game.INDEX_MAP_LOADED && BearFurs.stop == 1000) || BearFurs.client != Bot.client() || Inventory.contains(Constants.NEWSPAPER) || (Walking.getEnergy() == 100 && !Walking.isRunEn...
85385ab7-9ce9-4d74-95ce-342d5e00fe4d
2
public void popularCmbDepartamento() { ArrayList<String> Departamentos = new ArrayList<>(); DepartamentoBO departamentoBO = new DepartamentoBO(); try { Departamentos = departamentoBO.ComboBoxDepartamentos(); } catch (SQLException ex) { JOptionPane.showMessageDial...
3651dab6-5b14-4e27-a7a2-61fbe2e2e112
3
public void createSpecimen(List<Double> in, List<Double> out) { List<Node> outputSpecimen = new ArrayList<>(); Network net = new Network(); for (int i = 0; i < out.size(); i++) { Node newOutNode = new Node(out.get(i), NodeType.OUTPUT, nextEnabledNodeID()); net.addOutNode(...
297e1fc8-8a05-4b75-983f-85d3153e04d8
2
public LightMap get(int radius, Color color) { LightMapKey key = new LightMapKey(radius, color); SoftReference<LightMap> ref = loadedLightMaps.get(key); LightMap current = ref == null ? null : ref.get(); if (current != null) { return current; } else { loadedLightMaps.remove(radius); LightMap result =...
403d5b34-cec1-4d3c-b774-320e1392741e
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...
a6ce6a1f-acf2-4d6d-8285-02e35e7b9e32
7
public final static void initTables() throws java.io.IOException { final String prefix = FILEPREFIX; int i = 0; lhs = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$ char[] chars = readTable(prefix + (++i) + ".rsc"); //$NON-NLS-1$ check_table = new short[chars.length]; for (int c = chars.length; c-- > 0;) { ...
4a7a962b-3bfd-4647-ba12-937acc417c89
3
@Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Vector2)) { return false; } Vector2 other = (Vector2)o; return (this.x == other.x && this.y == other.y); }
1e917704-7ad6-47e0-8a10-94249f3f1264
9
public static PDFDecrypter createDecryptor (PDFObject encryptDict, PDFObject documentId, PDFPassword password) throws IOException, EncryptionUnsupportedByPlatformException, EncryptionUnsupportedByProductException, PDFAuthenticationFailureException ...
27643a5d-4638-4158-817e-8813dff67e26
6
public static String stripBetween(String s, String begin, String end) { if ((s == null) || (begin == null) || (end == null)) { return s; } StringBuilder sb = new StringBuilder(s.length()); int pos = 0; while (true) { int x = s.indexOf(begin, pos); int y = s.indexOf(end, x + begin.length()); if...
c142f3ce-9feb-472f-9a41-72f1756ce362
9
public String command(final CommandSender sender, Command command, final String[] args) { if (args.length < 1) return plugin.getString(Language.DUPEIP_ARGUMENTS); String name = Formatting.expandName(args[0]); String ip = plugin.getUBDatabase().getAddress(name); if (ip == null...
4eb37dfe-f32a-4999-8659-7e5021206071
9
public boolean codopValido(String cod){ int punto=0, tam=cod.length(); boolean flag=false; if(tam > 5){ return false; } else if(!Character.isLetter(cod.charAt(0))){ return false; } else{ for(int i=1;i<tam && !flag;i++){ if(!(Character.isLetter(cod.c...
a4488cb9-4ee1-4944-9d2e-9b96177a915e
5
private static void maxHeap( Individual[] individuals, int i, int n ) { int left = i * 2; int right = i * 2 + 1; int largest = 0; if( left <= n && individuals[left].getFitness() > individuals[i].getFitness() ) largest = left; else largest = i; if( right <= n && individuals[right].getFitness() >...
7b114d34-9029-44f2-ba66-ff093079636e
6
public int lengthOfLongestSubstring(String s) { if (s == null || s.length() == 0) { return 0; } HashSet<Character> set = new HashSet<Character>(); int leftBound = 0, max = 0; for (int i = 0; i < s.length(); i++) { // encounter duplicates if (set.contains(s.charAt(i))) { while (leftBound < i && ...
0ac7992c-ca7c-4e5f-afde-dd16e9b33b8b
0
public int getQuantityOfPredator() { return predators.size(); }
7c44608c-bec4-4b77-94ea-dc18d4e72d7b
2
public BasicBlock getBranchTarget() { if(instructions.isEmpty()) { return null; } Instruction i = instructions.get(instructions.size() - 1); if(i instanceof BranchInstruction) { return ((BranchInstruction)i).getTarget(); } return null; }
ce197d49-1825-465e-b75a-37a38b461606
5
public void listenerPrincipal(final BackPropagationContainer bpGui){ bpGui.btnAgregarSetAprendizaje.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { DefaultTableModel temp = (DefaultTableModel) bpGui.tablaSetAprendizaje.getModel(); Object nuevo[]= {"0",...
c9eb03bd-e6c8-4a5c-ac71-e1fb2d00f06c
3
private void getSentences(String risk) { int start = 0, end = 0, last = 0; last = start = risk.indexOf(".", end); while (start != -1 && end != -1) { end = risk.indexOf(".", last + 1); if (end - last > 10) { sentences.add(risk.substring(start + 1, end)); start = end; } last = end; } }