method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
131b97bf-553b-4f52-98f3-384cbb13a2a9
9
private String interpreterObjet(Objet o) { // TODO Auto-generated method stub String s = ""; if(o instanceof Ligne) { s+="<line x1=\"" + ((Ligne) o).getAbscisseX1() + "\" y1=\"" + ((Ligne) o).getOrdonneeX1() + "\" x2=\"" + ((Ligne) o).getAbscisseX2() + "\" y2=\"" + ((Ligne) o).getOrdonneeX2() + "\" "; s+="s...
b4ee53b3-7c89-4b87-bb88-0f5e0a9377d7
2
private void set(final int local, final int type) { // creates and/or resizes the output local variables array if necessary if (outputLocals == null) { outputLocals = new int[10]; } int n = outputLocals.length; if (local >= n) { int[] t = new int[Math.max(local + 1, 2 * n)]; System.arraycopy(outputLo...
ab533264-39d8-4abb-90ed-19f2538f7b70
7
@Override public void update(Observable o, Object arg) { if(o instanceof ShopCharacter && arg instanceof PlayerCharacter){ shopPanel.update( (ShopCharacter) o, (PlayerCharacter) arg); }else if( o instanceof CivilianCharacter && arg instanceof PlayerCharacter){ questPanel.update( (CivilianCharacter) o, (Playe...
d74954b8-e1be-4554-9c14-327845170031
5
private static byte[] Final(int[] internalState) { byte[] diegest = new byte[16]; int count = 0; for (int i = 0; i < 4; i++) { int n = (i == 0) ? internalState[0] : ((i == 1) ? internalState[1] : ((i == 2) ? internalState[2] : internalState[3])); for (int j = 0, k = 0; j ...
a6bab9f0-5ff1-41a2-9e62-82e1920a00e0
3
private boolean isMatch(char c1, char c2) { switch (c1) { case '(': return c2 == ')'; case '[': return c2 == ']'; case '{': return c2 == '}'; default: return false; } }
7ec3e923-dbb3-4019-a930-0a6d05eda6ab
8
public void toggleKey(int KeyCode, boolean isPressed) { if (KeyCode == KeyEvent.VK_W || KeyCode == KeyEvent.VK_UP) { up.toggle(isPressed); } if (KeyCode == KeyEvent.VK_S || KeyCode == KeyEvent.VK_DOWN) { down.toggle(isPressed); } if (KeyCode == KeyEvent.VK_A || KeyCode == KeyEvent.VK_LEFT) { left.tog...
6352be8d-e4ea-42bc-9c1d-8993c46de92f
1
@Override public List<Hotel> findHotels(Criteria criteria) throws DaoException { if (criteria.getParam(DAO_HOTEL_STATUS) == null) { criteria.addParam(DAO_HOTEL_STATUS, ACTIVE); } TypedQuery query = TypedQueryFactory.getInctance(QueryType.HOTELQUERY); return query.load(cri...
b714beba-68f8-43e1-9671-484632991490
4
@Override public boolean containsByteArray(String name) { JOSObject<? , ?> raw = this.getObject(name); if(raw == null) return false; if(raw.getName().equalsIgnoreCase(BYTE_ARRAY_NAME)) return true; return false; }
86c8f3be-84fa-451f-abc5-c22845849de1
1
private boolean canHaveAsIdentityDisc(IdentityDisc idDisc) { if (idDisc == null) return false; return grid.getElementsOnPosition(idDisc.getPosition()).isEmpty(); }
80feab0f-9572-4809-b662-daeadab1244e
5
public List<Rule> extractApproxRules() { /* * pour chaque générateur g de {elements} * Pour chaque superset de g * nouvelle règle : g -> superSet - g / support(fermé(g)) / confiance = support(superset(g)) / support(fermé(g)) * si confiance < minConfidence ou confi...
0f29fe2b-3260-4bdb-8ac1-ff42254030c5
7
private void skip(int items) { if (playlist.size() == 0) { return; } boolean playAllowed = isPlaying(); if (shuffle) { playingIndex = RANDOM.nextInt(playlist.size()); } else { playingIndex += items; if (playingIndex > playlist.size() - 1) { if (repeat) { playingIndex = 0; } el...
eea421ed-0be0-4be1-8c91-da13ceca105f
9
public void laskeTaso(){ if (pisteet < 500){ taso = alkutaso + 1; } else if (pisteet < 1200){ taso = alkutaso + 2; } else if (pisteet < 2200){ taso = alkutaso + 3; } else if (pisteet < 3500){ taso = alkutaso + 4; } else if ...
3c20ec01-3183-461e-8696-43040e060d3c
2
public void addWorldModelListener(final WorldModelListener listener) { if (listener != null && !listenersWorld.contains(listener)) { this.listenersWorld.add(listener); } }
a6e3de6c-8647-41d5-9f99-51024b954038
2
public double rawAllResponsesRange(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.variancesCalculated)this.meansAndVariances(); return this.rawAllResponsesRange; }
3cb45cf4-4db0-4649-8cfc-77f843bc69a7
6
public static Map<Integer, Double> getResourcesFromUserWithRec(List<Bookmark> trainData, List<Bookmark> testData, int userID, Double dValue, boolean sorting) { Map<Integer, Double> resourceMap = new LinkedHashMap<Integer, Double>(); long refTimestamp = Utilities.getBaselineTimestamp(testData, userID, false); for ...
cc1e580b-8296-4a45-84b8-d9767f611de2
3
public void sendReplenishmentOrder(String mname) { // System.out.println("SendReplenishmentOrder---------" + mname); try { PreparedStatement stmt = connection.prepareStatement("select stock_number, quantity, max_stock from DepotItem where trim(mname) = trim(?)"); stmt.setString(1,...
93a56e31-60c9-4c58-b1a4-3887dbd9f376
1
public void analyzeInnerClasses() throws ClassFormatError { int serialnr = 0; Enumeration elts = anonConstructors.elements(); while (elts.hasMoreElements()) { InvokeOperator cop = (InvokeOperator) elts.nextElement(); analyzeInvokeOperator(cop); } }
c6e195d9-47e7-4c10-931a-1cec695f55a2
6
public Textos(int idLlamante) { setResizable(false); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); // Si el idLlamante = 1 mostramos las etiquetas correspondientes a Ayuda if (idLlamante == 1) { setTitle("Soy Millonario? - Ayuda"); setBounds(100, 100, 498, 485); contentPane = new JPanel(); cont...
d17f5955-144a-4c2c-b7a4-983f36df7b12
5
@Override public void addUser(String id, String password) { Connection conn = null; PreparedStatement stmt = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement("INSERT INTO \"USER\" (USER_ID,USER_PASSWORD,USER_DATE) VALUES(?,?,?)"); ...
182a8b89-73a6-4f08-968d-ebcc9d7ecbb9
4
private void parseValue(String line, int lineNum) { // skip a comment line if (line.startsWith(COMMENT)) { return; } String[] sp = line.split("\\s+"); // split the fields based on a space int len = 0; // length of a string int index = 0; // the index of an array // che...
2ea5fb8f-9fd9-4cb9-92b7-4244eba331c9
4
private Area createArea(int aTile, boolean aProbability) { int flags = 0; TileSet areaTiles = new TileSet(mField); for (int tile : mField.getBorderOf(aTile)) { MaskValue mask = mField.getMaskValue(tile); if (mask.isFlag()) flags++ ; else if ( !mask.isOpen() && !mask.isQuestion()) areaTiles.add(tile); ...
15fbfeef-eddd-4fa2-85cb-07879ec9afa3
4
public void onBlockAdded(World var1, int var2, int var3, int var4) { if(var1.getBlockId(var2, var3 - 1, var4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(var1, var2, var3, var4)) { if(!var1.isBlockNormalCube(var2, var3 - 1, var4) && !this.func_263_h(var1, var2, var3, var4)) { ...
901e6b17-19ea-4b96-86eb-d9e62a525c30
4
public void blockPlace(List<String> materialList, Boolean mode){ if (materialList != null){ Material materialet; for (String material : materialList){ materialet = Material.getMaterial(material); if (materialet != null){ blockPlace.add(materialet); } } } if (mode != null){ blockPlaceM...
7d8c4c19-2ff8-4b25-a255-a137c4052fd7
4
public void move(int destX, int destY) { if (x == destX && y == destY) return; if (x < destX) x++; else x--; if (y < destY) y++; else y--; }
4ba39791-97d6-4052-acda-d60d3529ca54
5
public void menuPrimeTest() { int choice; do { System.out.println("\n"); System.out.println("Select PrimeTest Methode"); System.out.println("------------------------\n"); System.out.println("1 - Miller Rabin"); System.out.println("2 - Back"); ...
6206b392-4be5-4564-881e-0baf41efdd34
2
public void transformedProbabilityPlot(){ if(!this.transformDone)this.transform(); double[][] data = PlotGraph.data(2,this.nData); data[0] = this.gaussianOrderMedians; data[1] = ((new ArrayMaths(this.standardizedTransformedData)).sort()).array(); data[2] = this.gaussianOrderMed...
d09db640-650a-45e0-8e05-68837a6da83e
7
public void checkLoginUser() { String pseudoTmp = ""; String passwordTmp = ""; System.out.println("Pseudo :"); pseudoTmp = sc.nextLine(); System.out.println("Password :"); passwordTmp = sc.nextLine(); UserDB user = null; user = new UserDB(pseudoTmp, passwo...
14ba9307-ff33-452a-ac00-2b555716ea4f
5
public void selectNew() { textField.setVisible(true); lblTitle.setVisible(true); if (booster.getActiveControl() instanceof PWindow) { PWindow pw = (PWindow) booster.getActiveControl(); textField.setText(pw.getText()); lblTitle.setText("Window title:"); textField_1.setText(pw.getWidth()+""); textFie...
3dda19c8-ef7a-4feb-8468-50cde278e866
9
static void search( String fp ){ File topFolder = new File( fp ); for( String iter : topFolder.list()){ File folder = new File( fp + "/" + iter ); if( folder.isDirectory() ) search( fp + "/" + folder.getName() ); else{ String fileName = fp + "/" + folder.getName(); if( fileName.length() > 2 ){ ...
00f6bd85-6192-4264-bebd-0713b2419645
9
@Override public long readVLong() { byte b = bytes[pos++]; if (b >= 0) return b; long i = b & 0x7FL; b = bytes[pos++]; i |= (b & 0x7FL) << 7; if (b >= 0) return i; b = bytes[pos++]; i |= (b & 0x7FL) << 14; if (b >= 0) return i; b = bytes[pos++]; i |= (b & 0x7FL) << 21; ...
c823d833-a9ba-441b-a245-4cbc1e4d23e5
5
private boolean eq(ClassST a, ClassST b) { if(!a.name.equals(b.name)) return false; if(!a._package.equals(b._package)) return false; if(a.modifiers != b.modifiers) return false; for(int i = 0; i < a.imports.size(); i++) { if(!a.imports.get(i).equals(b.imports.get(i))) return false; } re...
2fa6b5ca-ee95-4553-9778-d07a93210a90
9
static final Mob method817(int i, int i_0_, int i_1_, int i_2_) { anInt1456++; Class357 class357 = Message.aClass357ArrayArrayArray2029[i_1_][i_0_][i_2_]; if (class357 == null) return null; if (i != 252) return null; Mob class318_sub1_sub3_sub3 = null; int i_3_ = -1; for (Class148 class14...
3e8c9c1e-8eb7-4eb1-8d28-5081c105df7c
9
private void Download(ByteBuffer packet) throws IOException { // NO HEADER // allow only 1 download at a time, clear old threads for (ServerFwding f : peer_threads){ if (f.isAlive()) f.interrupt(); } peer_threads.clear(); //parse the req if (packet.capacity() < 4) throw new RuntimeExceptio...
6545b238-75cd-43a0-85ab-d2bd7749f45b
9
@Override public void run() { Message m = null; DataOutputStream writer; while (true) { try { pm.md.increaseCounter(); Envelope e = queue.take(); m = e.getMessage(); /* * Se il messaggio è una Move, calcolo la posizione appena prima * di mandarlo, così che sia consistente. La consi...
a498d2f3-5da7-491a-a13a-a3625007c7be
6
public static ListNode rotateRight(ListNode head, int n) { ListNode p = head; ListNode q = null; int len = 0; while (null != p) { len = len + 1; p = p.next; } if (0 == len) return head; n = n % len; if (0 == n) return head; int i = 0; p = head; while (n...
6a9f4f5f-5f78-4e47-8a77-db1c94392e1b
4
public static boolean arrIsEmpty(String[] param) { boolean result = true; if ((param != null) && (param.length > 0)) { int i = 0; for (int len = param.length; i < len; i++) { if (!isEmpty(param[i])) { result = false; break; } } } return result; }
16147ef7-8e74-4b67-af49-97af49c8b055
2
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { String url = "/"; HttpServletRequest request = (HttpServletRequest)req; HttpSession session = request.getSession(true); if ("purchase".equals(request.getParameter("action"))) { ...
8debcf5d-e9f8-4d75-b446-c128fa42ecbb
4
public boolean conflicts(String name, Scope inScope, int context) { int dot = name.indexOf('.'); if (dot >= 0) name = name.substring(0, dot); int count = scopes.size(); for (int ptr = count; ptr-- > 0;) { Scope scope = (Scope) scopes.elementAt(ptr); if (scope == inScope) return false; if (scope....
56cf99d7-04a5-4313-8a68-80e51532c834
5
int numDistinct(String S, String T) { int m = S.length(); int n = T.length(); if (m == 0 || n == 0) return 0; int[] diff = new int[n + 1]; diff[n] = 1; for (int i = m - 1; i > -1; i--) { for (int j = 0; j < n; j++) { if (S.charA...
88d1a370-0418-4370-af4c-e75d11bb3ec6
0
public void setNombre(String nombre) { this.nombre = nombre; }
0df07588-ffde-4af6-8eec-84e5e63bd4ff
1
public void flush() { if(idx > 0) { data.flip(); render(); idx = 0; data.clear(); } }
22294980-f9c7-4cae-9e71-ca3b2ddce166
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TileXY other = (TileXY) obj; if (x != other.x) return false; if (y != other.y) return false; return true; }
3bab32b1-1e90-44e8-90d2-f5ad0e06a023
1
public ArrayList<Coordinate> getCoveredCoordinates() { ArrayList<Coordinate> coveredCoordinates = new ArrayList<Coordinate>(); for (Character key : getVehicles().keySet()) { coveredCoordinates.addAll(getVehicles().get(key).getCoveredCoordinates()); } return coveredCoordinates; }
5062b3d7-2357-490a-b65e-e18755aaa718
3
public int add(sols.Model.Exam exam){ int generated_Exam_ID=-1; StringBuffer sql=new StringBuffer(); sql.append("INSERT INTO Exam"); sql.append("(`Exam_ID`,"); sql.append("`Instructions`,"); sql.append("`isPublic`)"); sql.append("VALUES"); sql.app...
a4d32477-ced0-4611-bf7f-454ab15e69eb
5
public void start(String[] args) { try { if(args.length == 0) { processDirectoryTree(new File(".")); } else { for(String arg : args) { File fileArg = new File(arg); if(fileArg.isDirectory()) { ...
ec3ac0e2-8ced-4a16-af4f-81b8d84ff2e9
1
public synchronized boolean hasRecordedDuplicateOfIncomingPacket(Packet packet) { return (packet == null ? false : hasReceivedPacketWithSequenceNumber(packet.getDuplicateSequenceNumber())); }
321a0512-46a8-457a-96ec-e5bd49222a5d
0
public void setPiloteJdbc(String piloteJdbc) { this.piloteJdbc = piloteJdbc; }
41d4cc33-d1f0-4215-8ec1-62b7e3994e9b
2
public static void main(String[] args) { String input; int no_of_inputs = 0; System.out.println("Enter the number of input Strings\n"); Scanner in = new Scanner(System.in); no_of_inputs = in.nextInt(); System.out.println("Enter " + no_of_inputs +" Strings delimited by newLine "); for(int i=0; i<=no_of_inp...
f6dacef8-79d2-4e76-820c-a6bc8e9ab53a
7
public void func_40380_a(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { byte var5 = 2; int var6 = var5 + 1; byte var7 = 33; int var8 = var5 + 1; this.densities = this.func_40379_a(this.densities, par1 * var5, 0, par2 * var5, var6, var7, ...
7476ed8b-5509-43dc-9c86-33272c83f901
0
public String getOutput() { return myOutput; }
243c65ed-a82a-40c7-a5d5-7c401e3981d4
8
public boolean valide() { boolean valid = false; int start = 0; int ende = 0; Raum startRaum = null; _verbindungen.verbindeRaeume(_ui.getMap()); for(Raum r : _verbindungen.getRaumListe()) { if(r.getRaumart() == RaumArt.Start) { startRaum = r; start++; } else if(r.getRaumart() == Rau...
7390ecc6-90dc-4113-9ace-f52015d63528
9
public static void renderMenu(Graphics g, Global global){ //Current Menu Menu currentMenu = global.getCurrent().getMenu(); if (currentMenu!=null){ for (int i=0; i<currentMenu.getMenuItems().size(); i++){ MenuItem item = currentMenu.getMenuItems().get(i); //item.getImg().getImage().draw(item.getX(),i...
ef3f050e-ca6c-4199-8b35-b68839a3c485
1
protected static boolean insertarP(Product p){ try { AppendObject dataOut=new AppendObject (Files.newOutputStream(path,java.nio.file.StandardOpenOption.APPEND )); dataOut.writeObject(p); dataOut.reset(); dataOut.flush(); dataOut.close(); return true; } catch (IOException e) { ...
9fe2a49e-6d0e-404e-b32b-d4404daef594
1
private void ExceptionTest() { try { bla(); } catch (Exception ex) { Logger.getLogger(MenuFrame.class.getName()).log(Level.SEVERE, null, ex); } }
0a252de6-33a9-4102-841e-e85921d0dca1
4
public static Coords findMatchingCellInNeighbours(CellBase targetCell, NeighbourhoodMatrix nextgen) { // System.out.println("Target col=" + targetCell.getCol() + " row=" + targetCell.getRow()); for(int col=0; col<nextgen.getCells().length; col++) for(int row=0; row<nextgen.getCells()[0].length; row++){ // S...
2b90cea7-8ed1-44c4-b5a2-8d37ef98cca3
2
private void getFloorPlanGetDirt(String line, CellDescription cellDescription) { int startIndex; int endIndex; /*get amount of dirt of floor*/ startIndex = line.indexOf("ds") + 4; endIndex = line.indexOf('\'', startIndex); try { cellDescription.dirt(Integer.parseInt(line.sub...
73a7e3f1-94fc-4b4c-b632-28914a347bcf
9
public Map buildSingleRowStr(String[] singleRowInfoContent, Map modelInfo, String lang, int idIndex, String idField, Map<String, String> specialField, String keys, String contentSplitFragment, Map<String, String> defaultValue) { Map<String, List<Integer>> fieldIndex = (Map<String, List<Integer>>) modelInfo.get(...
7fd029e1-eada-4310-a8b5-1b588f01efde
5
public String[] getDecodedContentSteam() { // Some PDF's won't have any content for a given page. try { initPageContents(); if (contents == null) { return null; } String[] decodedContentStream = new String[contents.size()]; int...
1a29027c-e403-4b12-b8f0-a768652b7fed
8
public void paintComponent(Graphics g) { super.paintComponent(g); switch (value) { // case 1: // Graphics2D g0 = (Graphics2D) g; // g0.setPaint(new Color(0, 0, 255)); // g0.drawArc(47, 20, 5, 5, 90, 90); // g0.fillArc(47, 20, 7, 7, 90, 90); // // g0.drawArc(51, 20, 5, 5, 0, 90); // g0.fillArc(51, 20, 7...
0e89e44d-37e7-4f2e-b411-b87746a808fd
6
public static void main(String[] args) { double num; int times = 0; Scanner scn; int i = 0; System.out.println("Please enter the count of numbers you will enter:"); try{ scn = new Scanner(System.in); times = scn.nextInt()...
9a1330d6-394e-4039-8a42-658d53e777e7
5
static final void method2468(int i) { anInt10348++; if (i == 3613) { int i_31_ = 0; for (int i_32_ = 0; Class367_Sub4.mapSizeX > i_32_; i_32_++) { for (int i_33_ = 0; Class348_Sub40_Sub3.mapSizeY > i_33_; i_33_++) { if (Class367_Sub4.method3542 (i_33_, Message.aClass357ArrayArrayArray2029,...
7a013816-6837-4455-9bc3-fd2eb58a479a
1
public ServerStatusPanel(){ super(); try { redLamp = ImageIO.read(new File("redLamp.png")); greenLamp = ImageIO.read(new File("greenLamp.png")); currentImage = redLamp; } catch (Exception e) { e.printStackTrace(); } }
d74f6862-75d5-44b8-a55a-106dce778f50
8
public boolean isConflict(Section sectionToAdd, ArrayList<Section>sections){ for(Section section: sections){ //checks if an existing section causes a conflict for(Meeting meeting: section.getMeetings()){ //checks if a meeting in a section conflicts with all meetings in section to add int meetingSta...
0da56ff1-13c3-4305-8e7c-27679ebcde13
7
public Set<Class<? extends SequenceListener>> getListeners(int preOrPost) { List<SequenceListener> toGet = null; if (preOrPost == PRE) toGet = preTrimListeners; if (preOrPost == POST) toGet = postTrimListeners; Set<Class<? extends SequenceListener>> set = null; if (toGet != null) { set = new HashSet<...
94265833-1d33-48ff-a9c6-a05e5f0b414f
7
private void jBtn_ConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtn_ConfirmarActionPerformed // TODO add your handling code here: String formato = "dd/MM/yyyy"; //Formato de la fecha String parametro = jrbText+ ";" ; boolean procesoOK = false; ...
b7fd58ed-d3c2-4289-b644-1b75c9ff01d2
5
public Expression simplify() { if (subExpressions[1] instanceof ConstOperator) { ConstOperator one = (ConstOperator) subExpressions[1]; if ((getOperatorIndex() == OPASSIGN_OP + ADD_OP || getOperatorIndex() == OPASSIGN_OP + SUB_OP) && one.isOne(subExpressions[0].getType())) { int op = (getOperato...
bc74dc1a-dcd9-4bfc-bb77-d9e184d63b5e
8
public void onLivingUpdate() { super.updateEntityActionState(); if (this.otherPlayerMPPosRotationIncrements > 0) { double var1 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; double var3 = this.posY + (this.otherPlay...
17367f78-be61-4b10-bb61-89efa3183864
9
private void updateSymbolTable(File file, Hashtable symbols, Hashtable functions) throws ProgramException { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file.getAbsolutePath())); } catch (FileNotFoundException fnfe) { throw new ProgramEx...
1a5a7fb8-d2f7-412a-8cc8-27078ffc0828
8
public void run() { while (!isInterrupted()) { // System.out.println(parentDevice.getDeviceName() + " port" + getIndex() + " send cycle start"); if (!sendQueue.isEmpty()) { if (oppo != null) { oppo.ReceiveFrame(sendQueue.poll()); System.out.println("Frame sent from " + parentDevice.getDev...
77f41a99-dae2-4a23-bea7-a2ec92dd5b75
1
public BigInteger bigNumber(BigInteger n) { if (n.equals(BigInteger.ONE)){ return BigInteger.ONE; } else resultBig = bigNumber(n.subtract(BigInteger.ONE)).multiply(n); //System.out.println(resultBig.toString()+"\n"); return resultBig; }
82257b8b-ee9d-459e-86b2-e6701ca48ec9
1
public void setStatus(boolean isActive) { Debugger.println("network", "[ConnectionBundle] Station " + alias + " is now " + (isActive?"active.":"inactive.")); this.isActive = isActive; }
6012b5cb-cf95-4182-9e96-92561ca73441
1
public double getInitialOF() throws Exception { currentNumOfComplexes = initNumOfComplexes; totalNumOfPoints = initTotalNumOfPoints; double objFuncValue; for (int j = 0; j < numOfParams; j++) { bound[j] = upperBound[j] - lowerBound[j]; initialPoint[j] = initialP...
1af8b788-adba-4e34-b3fc-8490b753d01e
1
public void testFixed() throws IOException { DateTimeZoneBuilder builder = new DateTimeZoneBuilder() .setStandardOffset(3600000) .setFixedSavings("LMT", 0); DateTimeZone tz = builder.toDateTimeZone("Test", true); for (int i=0; i<2; i++) { assertEquals("Test",...
b31424fc-d347-4652-9026-96b1abf27e18
5
public String getDatosHistorial(String clave, beansHistorial hist){ if(clave.trim().equals("downline")) return hist.getDownline().getNick(); if(clave.trim().equals("upline")) return hist.getUpline().getNick(); if(clave.trim().equals("contacto")) return hist.getContacto().getNick(); if(clave.trim().equa...
2d74d961-4a90-48d3-91e3-018e789d6d25
2
public static void useRepel(Item item) { if (!hasItem(item)) { errorWindow.addMessage(" You don't have this item in your inventory to use! "); errorWindow.toFront(); return; } else { errorWindow.addMessage("No encounters for "+item.power1+" more steps!",""+item.type); errorWindow.toFront(); ...
9c7c79e1-e7c0-41f2-8938-1d822867fd1f
4
public void run() { try { BufferedReader output = new BufferedReader(new InputStreamReader( process.getInputStream())); String line; while (true) { line = output.readLine(); if (line != null && ! this.silent) System.out.println(line); } } catch (IOException e) { // TODO Auto-gener...
25fcad7f-5767-490d-b8d0-c3b35f913ee8
9
private static void handleMoveType4(PGNMove move, String strippedMove, byte color, byte[][] board) throws PGNParseException { byte piece = WHITE_PAWN; int fromhPos = getChessATOI(strippedMove.charAt(1)); int fromvPos = strippedMove.charAt(2) - '1'; int tohPos = getChessATOI(strippedMove.charAt(3)); int tovPos...
6ff0e26c-dbca-48d6-925d-1f7a6a11a56d
1
private void handleClientRequest(ServerSocket serverSocket) { try { ConnectionRequestHandler aThread = new ConnectionRequestHandler(serverSocket.accept()); threads.add(aThread); aThread.start(); } catch (IOException e) { e.printStackTrace(); } }
778db491-8a41-4bd7-9fe5-88d01ce0975b
3
private static void activateSubmitPollHTML(Request request, Response response) { boolean submitResult = false; Polls newPoll = new Polls(); if (parsAndSetNewPoll(newPoll, request)) { if (DBHandler.addPoll(newPoll)) { submitResult = true; } } if (submitResult) { response.setRedirect("/smtp/polls...
040e42e7-e053-42b7-b6c3-3d5871f7a486
2
public String readFile(String nameFile) { String chaine = ""; try { InputStream ips = new FileInputStream(nameFile); InputStreamReader ipsr = new InputStreamReader(ips); BufferedReader br = new BufferedReader(ipsr); String ligne; w...
97ef1989-d65e-4df3-9951-bc61396f030c
5
public int getTotalCount(String type, Placeable skipPlaceable) { int count = 0; HashMap<String, Placeable> tempHashMap = new HashMap<String, Placeable>(placeables); Placeable placeable = null; try { for (String key : tempHashMap.keySet()) { placeable = (Pla...
cfe4fc3b-0d18-414e-bd95-dcdce8730188
6
public static void main(String args[]) { /* Set the Windows 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://dow...
7daeff93-f210-4c56-ac67-73f99ae7f39a
8
public static void manageInput() { if (Keyboard.isKeyDown(Keyboard.KEY_W) || Keyboard.isKeyDown(Keyboard.KEY_UP)) { InputUtils.isUp = true; } else if (Keyboard.isKeyDown(Keyboard.KEY_S) || Keyboard.isKeyDown(Keyboard.KEY_DOWN)) { InputUtils.isDown = true; } ...
8f8ecb2e-8c8e-41e7-9e82-7a1608eeed89
8
public void runTournament(Player[] players) throws Exception { // Generate three worlds for this tournament. String[] tournamentWorlds = new String[3]; for (int index=0; index<3; index++) { tournamentWorlds[index] = worldEngine.generateNewWorldFile("temp_" + index + ".world"); } // Match each player ...
6298dd4c-f37b-42e3-bcac-f8651db57c9f
0
public LoginWindow (int port) { PORT = port; initComponents (); getIP(); }
e7777aab-67ef-48cf-b7a6-996f99758b22
8
private final void method677(byte i) { anInt5619++; if ((anInt5537 ^ 0xffffffff) != -1 && i > 125) { if (aByte5581 != 0) method688(5, true); method688(5, false); if (aClass270_5575 != null) { if (((Class270) aClass270_5575).anInterface8_3463 == null) method678((aByte5581 & 0x10) != 0, (byte) ...
899bccc0-c64f-4b69-9c59-50f235ff43a9
0
public void setDepth(int depth) { this.depth = depth; }
12784a8a-d6de-49fe-9d85-f5963e013de8
9
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the * to string. If we reach an early end, bail. */ ...
341cf86f-13c5-440f-8664-8715b3bf0b44
0
public ManContainer(T man, String name) { super(); this.man = man; this.name = name; }
83945003-f0d1-456d-be4b-c2951426f5c1
5
public int determineOutcome() { if (topScore(1) > 21) { return 0; } else if (topScore(0) > 21) { return 1; } else if (topScore(1) > topScore(0)) { return 1; } else if (topScore(0) > topScore(1)) { return 2; } else if (topScore(1) == topScore(0)) { return 3; } System.out.println("Something d...
bd47d151-01c0-4358-bc4a-52be010bb308
6
public boolean isClicked() { if (!enabled) return false; Mouse mouse = Game.mouse; if (mouse.getX() > x && mouse.getX() < x + width && mouse.getY() > y && mouse.getY() < y + height) { hover = true; if (mouse.isLeftClicked()) return true; } else hover = false; return false; }
26b94706-e939-409e-b77c-b365568d3afe
9
public RequeteRasterVector2Points(FenetreVector2Points fen) throws SQLException { srids=RequeteUnionVector2Points.getSrids(); this.fen=fen; tableaux=fen.getTableauTailles(); for(int fg=0;fg<tableaux.size();fg++){ String test34[][]=tableaux.get(fg); String taillePixels=test34[fg][1]; taillePixel.add(...
811d179b-332a-4b8f-8f67-848a83e95f65
4
private TextExtractor parsePdf(File f) throws IOException { PDDocument doc = PDDocument.load(f); if(doc.isEncrypted()) { // Some documents are encrypted with the empty password. Try // to decrypt with this password, or the one passed in on the // command line (if any), and fail if we can'...
7c69744f-9c61-46c8-9c8f-ddca9fc7b7b9
3
private Client rechercherClient(int numero){ System.out.println("ModeleLocations::rechercherClient()") ; Client client = null ; int i = 0 ; while(i < this.clients.size() && client == null){ if(this.clients.get(i).getNumero() == numero){ client = this.clients.get(i) ; } else { i += 1 ; } } ...
2b1ddcba-5084-41e3-b3aa-1bb73e4d0a39
7
public static Calendar datum(String datumaanduiding) throws IllegalArgumentException { if (datumaanduiding.isEmpty()) { return null; } try { String[] datumSplit = datumaanduiding.split("-"); if (datumSplit.length != 3) { throw new IllegalArgume...
20b7ede9-ff04-474a-9a81-634fcdb5da35
0
public void addArena(String arenaname, Arena arena) { arenas.put(arenaname, arena); }
423ecce3-5cb4-436f-8e9b-09a356a8caa6
1
public void agregarGolpe(){ iGolpes++; if(iGolpes == iVidas) { setDestruido(true); } }
7e063763-fb3b-47c9-a203-ebc3be10dd25
0
public Command(String name) { this.name = name; }
5f80c48d-7687-413c-aff8-6834c19f69c5
9
public void clearTheSlate(MOB mob) { if(mob==null) return; for(final Payment P : payments) if(P.mommyM==mob) payments.remove(P); if(dropOffs != null) for(final DropOff D : dropOffs) if(D.mommyM==mob) { boolean found=false; for(final DropOff A : associations) found = found || ...
f6c80293-9ac2-447b-8b3c-ad594f82dcda
1
private boolean isUserConfirm(String userAnswer) { boolean userConfirm = false; if (userAnswer.equals("yes")) { userConfirm = true; } return userConfirm; }