method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
df99e4ea-6976-4b6a-b1c9-d425c4a6d12c
8
public boolean searchMatrix(int[][] matrix, int target) { if (matrix.length == 0) { return false; } int start = 0, end = matrix.length; while (start < end) { int mid = (start + end) >>> 1; int midVal = matrix[mid][0]; if (midVal < targe...
7e832ff0-6c55-4e91-93e9-0d4d222e1ae0
9
int insertKeyRehash(float val, int index, int hash, byte state) { // compute the double hash final int length = _set.length; int probe = 1 + (hash % (length - 2)); final int loopIndex = index; int firstRemoved = -1; /** * Look ...
9b6716fc-44a9-4f7f-8bac-ca604b3d6daf
9
private void scan(boolean target, boolean debug) throws IOException{ System.out.println("stage: scanner"); PrintWriter pw = null; if (target){ output = new File(this.name + ".scan"); output.createNewFile(); pw = new PrintWriter(new FileWriter(output)); pw.println("LINEA\t\tTIPO\t\t\t\t\t\tVALOR"); ...
34376829-ced2-4fc2-8b6e-a0b183c741b4
8
public boolean equals(Object other) { if ( (this == other ) ) return true; if ( (other == null ) ) return false; if ( !(other instanceof BandsperfestivalId) ) return false; BandsperfestivalId castOther = ( BandsperfestivalId ) other; return (this.getFestId()==castOther.getFestId()) && (...
430c856b-bb5f-462d-bb5e-e8a2fb111f3c
6
public Map<K, V> read(JsonReader in) throws IOException { JsonToken peek = in.peek(); if (peek == JsonToken.NULL) { in.nextNull(); return null; } Map<K, V> map = constructor.construct(); if (peek == JsonToken.BEGIN_ARRAY) { in.beginArray(); while (in.hasNe...
18b4fca6-6fcc-49e2-8a79-81807fee6369
9
private boolean fillNumber(char[][] board, int row, int col) { int size = board.length; for(int i=row; i<size; i++) { int j=col; if(i==row+1)j=0; for(; j<size; j++) { if(board[i][j]!='.') ...
c2bdbdc1-bbf3-4d3b-82bf-33864bc32160
1
public static void main(String[] args) throws Exception { ApplicationContext ctx = new ClassPathXmlApplicationContext( "context/jdbcContext.xml"); // dataSourceはSpringで作成。 DataSource source = (DataSource) ctx.getBean("dataSource"); Connection con = source.getConnection(); Statement stat = con.createState...
e8732dd2-ba5f-442c-8536-de581ca07108
7
public String toString() { switch (typecode) { case TC_LONG: return "long"; case TC_FLOAT: return "float"; case TC_DOUBLE: return "double"; case TC_NULL: return "null"; case TC_VOID: return "void"; case TC_UNKNOWN: return "<unknown>"; case TC_ERROR: default: return "<error>"; } ...
a3c3625b-84b4-453a-849e-75b5fa37b59e
6
public List getMessByTimeAndDriver(String beginTme, String endTime,String driver,String rescueStatus) { if(beginTme!=null&&!beginTme.trim().equals("")){ if(endTime!=null&&!endTime.trim().equals("")){ String hql = "from Rescueapply r where r.applytime >=:beginTime and r.applytime <=:endTime and r.driver=:dri...
76aabed4-19d2-471b-abfa-141cfe4f45c5
3
public Gezin getGezin(int gezinsNr) { // inefficiente oplossing for (Persoon p : personen) { Iterator<Gezin> it = p.getGezinnen(); while (it.hasNext()) { Gezin r = it.next(); if (r.getNr() == gezinsNr) { return r; ...
d77004a6-0a40-475b-a5ce-2a20f7f2e5c1
7
public <T> ResultSet queryDB(String query, ArrayList<T> sqlParam){ PreparedStatement ps = null; ResultSet rs = null; try{ ps = conn.prepareStatement(query); int i = 1; for (T a : sqlParam){ //System.out.println(a.getClass()); if (a.getClass() == String.class){ ps.setString(i, (String)a); ...
4d16f833-5902-49c3-a402-f381ef4918d9
2
public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException { if (!isEntered) writer.println("// MISSING MONITORENTER"); writer.print("synchronized ("); if (object != null) object.dumpExpression(writer.EXPL_PAREN, writer); else writer.print(local.getName()); writer.print(")");...
17c1fbf0-167e-4096-828a-ce1513f9b164
2
public JSONObject toJSON() throws JSONException { JSONObject json = super.toJSON(); json.put("aptitude", aptitude.name()); JSONArray array = new JSONArray(); if(this.subordonnes != null){ for(int i = 0; i < this.subordonnes.size(); i++){ array.put(i, this.subordonnes.get(i).toJSON()); } } ...
7604e802-90da-4f43-8480-ce99d1e969a4
6
public static ArrayList<Map<String, String>> loadLabels(String labelsFile) { if(labelsFile == null) return null; ArrayList<Map<String, String>> labels = null; try{ BufferedReader fi = new BufferedReader(new FileReader(labelsFile)); labels = new ArrayList<Map<String, String>>(); String doc...
b81f2769-8787-42e3-a458-376ec5f2a5fb
2
private void addBedrock() { for (int x = 0; x < chunkWidth; x++) { for (int z = 0; z < chunkWidth; z++) { world.chunk[x][255][z] = 1; } } }
399fb112-a810-4c66-a85a-2177215cf880
2
static void removeDup(LinkedListNode n) { Set<Integer> set = new HashSet<Integer>(); while (n != null) { int current = n.getValue(); if (set.contains(current)) { n.pre.next = n.next; } else { set.add(current); } ...
6cb5878b-064b-481d-8796-15325ee9fa61
3
private void jButton_VerifyFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_VerifyFilesActionPerformed OpenTransactionAccount otAccount = new OpenTransactionAccount(); int isSuccess = otAccount.verifyFiles(jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextFie...
f382d6f4-db4d-4f60-a15f-d03d77c5a441
5
public void roadNameCheck() { for(MyNode n : mg.getNodeArray()) { for(MyEdge e : n.getFromEdges()) { if(e.getRoadName().equals(address[0])) { putEdge(e); } } for(MyEdge e : n.getToEdges()) { if(e.getRoadName().equals(address[0])) { putEdge(e); } } } }
20915ab7-0c0a-4320-8164-068c69ec05c6
5
private static void showStorage (int indent, Rio500 rio, boolean external) throws IOException { Rio500.MemoryStatus mem; int temp; indentLine (indent, external ? "SmartMedia" : "Built-in Memory"); indent += 2; temp = rio.getFreeMemory (external); indentLine (indent, "Available Memory in bytes: " + ...
a5b7a188-d412-4f25-a5bd-246f39b99e02
7
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
17d3a702-02b5-4a1c-b5a0-6de43b609cf6
5
String removeMnemonics (String string) { /* removes single ampersands and preserves double-ampersands */ char [] chars = new char [string.length ()]; string.getChars (0, chars.length, chars, 0); int i = 0, j = 0; for ( ; i < chars.length; i++, j++) { if (chars[i] == '&') { if (++i == chars.length) break; i...
92890ff4-01f9-4845-857c-c640b0aa50e4
2
static void input(double[][] matrix){ for(int i = 0; i < matrix.length; i++){ for(int j = 0; j < matrix[i].length; j++){ matrix[i][j] = scan.nextDouble(); } } }
de7af163-ac81-483b-b273-26ca0059174f
7
public void elSuapDefinitivo(int arr) { IVPTabu obj = new IVPTabu(); String url = "jdbc:derby://localhost:1527/PDPIVP"; String selectdatos="SELECT * FROM MatrizSolucion"; int tabu=0; int notabu=0; double cambio=0; int indice1=0; int indice2=0; double losmejores[]=new double[5]; ...
ac2bd0ec-72ca-4901-ab49-cb46fcab7440
1
public void printInventory(){ for(Block i : inv){ System.out.print(i.type + " "); } System.out.println(); }
357fc7f4-4255-4713-9dbd-b0c1c5753f32
2
private void closeConnections() throws Exception { if (getConnections() == null) return; while (getConnections().size() > 0) { ISocketServerConnection ssc = (ISocketServerConnection)getConnections().get(0); ssc.disconnect(); getConnections().remove(ssc); } }
64594a8f-3f04-4fc0-9e9c-69bd2fefbe23
9
private double[][] manRGBArray(BufferedImage image, Hemisphere hemi){ double[][] rgbArray = new double[200][200]; int rgb = 3096;//Don't ask why int x=0; int y = 0; for (x = 0; x < 200; x++) { // loop x axis of the image for (y = 0; y < 200; y++) {// loop y axis // remove arrow or text if (hemi ...
3c95ad03-7b84-4c6a-9ccf-a61f3dbe8c57
2
public static void main(String[] args) throws JAXBException, FileNotFoundException { Company company = new Company(); company.setName("ITCompany"); Departament itDepartament = new Departament(); itDepartament.setName("IT"); Worker worker = new Worker(); worker.setName("Tom"); itDepartament.addWor...
33470161-a83b-4861-a4df-2afce573f2c8
2
public void kirajzol(){ System.out.println(" 0 1 2 3 4 5 6 7"); for(int i=0; i<8; i++){ System.out.print(i+" "); for(int j=0; j<8; j++) System.out.print(sajat[i][j]+" "); System.out.println(); } }
700a819d-7a38-4754-93a8-7c509432a0b6
1
public static void syncSize() { // grab the size that's been set int sizeSet = Preferences.getPreferenceInt(Preferences.RECENT_FILES_LIST_SIZE).cur; // if it's different than our stored setting ... if (sizeSet != recentFilesList.currentRecentFilesListSize) { // store new setting recentFilesList.cur...
de7130a2-1afe-4ffa-b9d2-724f4f30b069
4
private byte a2b(byte c){ if('0'<=c&&c<='9') return (byte)(c-'0'); if('a'<=c&&c<='z') return (byte)(c-'a'+10); return (byte)(c-'A'+10); }
5f5ee567-c8ca-461f-a14a-0c817fd28509
0
@Basic @Column(name = "FUN_AAAA") public Integer getFunAaaa() { return funAaaa; }
b7be5091-dae0-4259-8785-c9f381b37fa7
4
public void read(Scanner input) { emptyGraph(); checking = true; try { String line = input.nextLine(); if (!line.equals(version)) { throw new ParseException(line, -1); } GraphType loadedType = GraphType.valueOf(input.nextLine()); ...
88da0d71-b884-4858-bcba-cc54230f7c29
6
public static String getSuperRegionName(int superRegionID){ String out = ""; switch(superRegionID){ case 1: out = "North America"; break; case 2: out = "South America"; break; case 3: out = "Europe"; break; case 4: out = "Africa"; break; case 5: out = "Asia"; break; case 6:...
1bf05103-7de4-4184-be1b-9fb168e4e97d
2
@Override public boolean apply(ICreature input) { if (input == observer) { return false; } double dirAngle = input.directionFormAPoint(observer.getPosition(), observer.getDirection()); return abs(dirAngle) < (observer.getFieldOfView()) && observer.distanceFromAPoint(input.getPosition()) <= ...
bf9dfb5e-6e3c-4aa5-94cd-f1c46ed74037
3
private boolean checkDuplicate(String userID){ if(count > 0){ for (int i = 0; i < clientObj.length; i++) { if((clientObj[i].getUserID()).equals(userID)){ return false; } } }return true; }
eeba0a6b-e5ab-40c5-8093-a2433a92eeaf
3
public void run() { try { if (logger.isInfoEnabled()) logger.info("Start job schedule launcher at " + new Timestamp(System.currentTimeMillis())); String dateParam = new Date().toString(); JobParameters param = new JobParametersBuilder().addString("date", dateParam).toJobParameters(); JobExe...
17f996d8-1011-455c-8250-191967af9634
1
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; }
46a5d1ba-961e-41d0-a9aa-eb51dc83f4bd
7
private List<String> validNegative(List<String> words) { List<String> tempNumbers = words; int negCount = 0; while(tempNumbers.contains("negative") || tempNumbers.contains("minus")) { if(negCount != 0) { System.err.println("Only one 'negative' or 'minus' allowed"); System.exit(7); } else if...
d5702750-56cc-4892-9fe7-ae4836cda1c3
2
private void startGame(GameModel m){ if (gameController != null){ gameController.stopThread(); } if (m == null){ startNewGame(); } WINDOW.add(new LoadingPanel()); gameController = new GameController(mainModel, this); mainModel.setGameModel(m); gameController.init(); WINDOW.add(gameControl...
6ecada91-049a-4bdc-9298-e80c50a928e2
9
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest); MediaLibAccessor srcAccessor1 = new MediaLibAccessor(sources[0], destRect...
7561e219-6c6b-4449-b94c-b2f6b901623d
5
public boolean update(CreditProgram crProg) { //Получаем текущий обьект по названию кредитной программы String crProgName = crProg.getName(); CreditProgram curProgram; if ((curProgram = get(crProgName)) == null) { //Если обьекта c таким именем не существует - обновлять нечего...
237df5dc-1905-4f5c-833e-fdcbeb506bd7
8
public static boolean setGuildHome(String[] args, CommandSender s){ //Various checks if(Util.isBannedFromGuilds(s) == true){ //Checking if they are banned from the guilds system s.sendMessage(ChatColor.RED + "You are currently banned from interacting with the Guilds system. Talk to your server admin if you...
2b6819d7-ba97-4df4-bad7-a3aa2fb4d57b
2
public void enablePayButton(ListSelectionEvent e) { if (!e.getValueIsAdjusting() && list.getSelectedIndex() != -1) { pay.setEnabled(list.getSelectedValue().isBookable()); } else { pay.setEnabled(false); } }
8a616673-82ea-479b-90f7-13a50cb76f18
5
public void menuFileAsym() { int choice; do { System.out.println("\n"); System.out.println("File Cryption Menu"); System.out.println("Select Asymmetric Cryption Methode"); System.out.println("----------------------------------\n"); System.out....
a848136b-602f-48cb-b81a-e3e435e447b6
8
private boolean isJavabeanGetter(IMethod method) throws JavaModelException { if (method.getNumberOfParameters() == 0 && Flags.isPublic(method.getFlags())) { String methodName = method.getElementName(); if (methodName.length() > 3 && methodName.startsWith("get")) //$NON-NLS-...
a872f16e-0b01-4e71-9696-ab47c7089fd7
7
public void update() { Player_down.update(); Player_up.update(); Player_left.update(); Player_right.update(); if(firerate > 0) firerate--; int xa = 0, ya = 0; if (input.up) ya--; if (input.down) ya++; if (input.left) xa--; if (input.right) xa++; if (xa != 0 || ya != 0) { move(xa,...
34d7c6ed-68bf-47d4-b10d-5a04597c095e
9
protected void switchChannel(String toReplace, String replacing) { if (toReplace.equals(replacing.toLowerCase())) { //Nothing to edit, reload the initial picture this.changePicture(this.getRelURL()); this.revalidateContainer(); reloadChanges(); return; } BufferedImage toEdit = null; try { ...
92bb29a7-0793-4bd6-ae1b-cc9cc4130021
0
@Override public String getName() { return this.name; }
95412aa6-ef76-4e8f-ab28-509cf34e74a0
9
@Override public boolean tick(Tickable ticking, int tickID) { if((affected!=null) &&(affected instanceof MOB) &&(tickID==Tickable.TICKID_MOB)) { final MOB mob=(MOB)affected; if((husbanding==null)||(mob.location()==null)) { messedUp=true; unInvoke(); } for(final MOB husbandM : husbanding...
5848a30d-861a-498f-a6a4-b9cc80d9853f
9
public static void invert(double src[][], double dst[][]) { gaussian(src, a); for (int i = 0 ; i < 4 ; i++) for (int j = 0 ; j < 4 ; j++) b[i][i] = i == j ? 1 : 0; for (int i = 0 ; i < 3 ; i++) for (int j = i + 1 ; j < 4 ; j++) for (int k = 0 ; k < 4 ; k++) ...
68accb46-8db7-4907-ba16-53ae4fd87dd5
0
public void setShopName(String shopName) { this.shopName = shopName; }
607149bc-9c70-4ed6-8794-4fa9d1571042
8
public static boolean transitiveClosureIteratorDnextP(TransitiveClosureIterator self) { { Stella_Object node = self.value; Iterator adjacencyiterator = ((Iterator)(edu.isi.stella.javalib.Native.funcall(self.allocateAdjacencyIteratorFunction, null, new java.lang.Object [] {node}))); if (adjacencyiterato...
0bda50fa-99f9-48b2-b7e0-abb2e1196f83
5
@Override public boolean registerParser(Class<? extends IPacketParser> parser) { Object object = null; try { object = parser.newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } ParsesPacket annotation = parser.getAnno...
0c4c1e19-a588-48e5-9e7b-f128b8004c4b
0
public Stack() { this.stack = new DynamicArray(); }
c774903e-5a9b-4396-959a-bddda2ad7d59
6
@Override public void showGetOptions(ResourceType[] enabledResources) { getAvailables = enabledResources; getreload.setVisible(false); getAmount.setVisible(false); //Show them all getwood.setVisible(true); getbrick.setVisible(true); getsheep.setVisible(true); getwheat.setVisible(true); getore.setV...
d4e2044d-7423-4241-a110-e1bf9582387a
4
public ThreadPoolImpl(int minThreads, int maxThreads, int maxIdleTime) throws IllegalArgumentException { if (maxThreads < 1) { throw new IllegalArgumentException( "maxThreads must be an integral value greater than 0"); } _maxThreads = maxThreads; if...
7bd0fcf1-cdae-4996-bfef-39cff7272a24
4
public void addFace(Face face) { if (!mesh.isDynamic() && !mesh.needsRenderUpdate) return; if (face == null) return; if (faces.contains(face)) return; faces.add(face); face.mesh = mesh; face.reg = this; mesh.needsRenderUpdate = true; }
524a1ed4-bc09-4cdf-b4a4-80ea96d51c20
7
public ArrayList<ArrayList<Double>> vectorsCompletionForMaintenance(ArrayList<String> newWordsArray, StatisticData[][] sd, int numOfComments, String articleId) throws SQLException{ ArrayList<String> wordArray = HelperFunctions.addNewWordsToOldWords(newWordsArray, articleId); DatabaseOperations.setArticleWords(artic...
51e930ad-bcf7-4325-ba62-156652576943
0
public int getColumnCount() { return entries[0].length; }
6db3a414-df16-4d5a-a928-c8dab8d90a3d
1
public synchronized Player getPlayer(int index) throws IndexOutOfBoundsException { if (index > players.length) throw new IndexOutOfBoundsException( "The max number of players is four."); return players[index]; }
fbb11571-75b6-43d0-8d7a-f58c8663e627
0
public static XSDDatatype getXSDDatetime() { return (new XSDDateTime(Calendar.getInstance())).getNarrowedDatatype(); }
9f02d091-2bf0-4263-8936-ea659dc9fa74
7
private static void loadUnpackedNPCBonuses() { Logger.log("NPCBonuses", "Packing npc bonuses..."); try { DataOutputStream out = new DataOutputStream(new FileOutputStream( PACKED_PATH)); BufferedReader in = new BufferedReader(new FileReader( "data/npcs/unpackedBonuses.txt")); while (true) { St...
391ad7db-1aa7-42ea-a5e8-e2362a143355
2
public static BencodeParser getResponsibleParserByFirstChar(char firstChar) throws InvalidFormatException { for (BencodeParser parser : AVAILABLE_PARSERS) { if(parser.isResponsible(firstChar)){ return parser; } } throw new InvalidFormatException(); }
f010b975-78d0-4341-8448-d874136cf52c
0
public void registroAlArchivo(General atributos, String archivo, String n, int c, String m, double nota) throws FileNotFoundException{ //Se llama al metodo datosEstudiante datosEstudiante(atributos, n, c, m, nota); //Se crea el archivo y se le guarda la informacio F...
5ad90e01-a76c-497d-8477-c658356f49b5
9
public Material dropPicker() { int next = gen.nextInt(10); switch (next) { case 1: return getHelmet(); case 2: return getChestPlate(); case 3: return getLeggings(); case 4: return getBoots(); case 5: return getHoe(); case 6: return getPickaxe(); case 7: return getAxe(); case 8: ...
b7a5351e-24e6-44fc-afba-a35f3cd14b84
0
@Test public void testSearchxPath() throws Exception { MyUnit.testFindFieldsbyXpath(); }
af9824e4-b0cf-4d00-8b8a-fc6062308bda
4
private int getMatrix(int i, int j) { if (i >= 0 && i < size && j >= 0 && j < size) return array[i][j]; else return -1; }
2234eef9-c940-436e-bcb8-de828f20cec8
9
@Override public void buttonStateCheck(Input input) { int mX = input.getMouseX(); int mY = input.getMouseY(); int farX = getX() + getStoredImage().getImage().getWidth(); int farY = getY() + getStoredImage().getImage().getHeight(); if (pointContains(getX(), mX, farX) && pointContains(getY(), mY, farY)) { h...
efd9f40f-70cb-442c-b8dc-f76d08db4bb7
1
public static double deltaVectors( double[] vec1, double[] vec2 ) { double[] test = Vector.sub(vec1, vec2); double delta = 0.0; int m = vec1.length; for ( int i = 0; i < m; ++i ) delta += Math.abs(test[i]); return(delta / m); }
88588e2c-c068-4e5b-80f0-4cabad2b53f5
2
public static void main(String[] args) { Map<String,String> map = new HashMap<String,String>(); map.put("10", "aaa"); map.put("12", "dafg"); map.put("14", "gaswde"); map.put("15", "gasde"); Set<String> set = map.keySet(); for(Iterator<String> iter = set.iterator();iter.hasNext();){ String key...
31e6f18c-6b10-415a-9d97-6380c5b7df34
1
Item newNameTypeItem(final String name, final String desc) { key2.set(NAME_TYPE, name, desc, null); Item result = get(key2); if (result == null) { put122(NAME_TYPE, newUTF8(name), newUTF8(desc)); result = new Item(index++, key2); put(result); } return result; }
e52089b0-e5da-4693-992c-c80a2a4fe421
2
public void printExceptionList() { for (Iterator<Throwable> it = exceptions.iterator(); it.hasNext();) { Throwable throwable = it.next(); if (throwable != null) throwable.printStackTrace(); } }
eaeabc8e-1bf7-4667-b00e-d09d8de11075
0
public long binIsBlack(){ return binIsBlack; }
12ab3c42-ef44-42d8-b069-35a97a457547
6
private Vector<Vector<Object>> getContenidoTabla(int perfil){ //r_con.Connection(); Tareas t=new Tareas(r_con); Permisos p=new Permisos(r_con); Vector<Vector<String>> v = p.getContenidoTablaPermisos(perfil); Vector<Vector<String>>tareas = t.getDescripcionTareas(); ...
ec6c4db9-bb88-4765-bd08-4e1b7a69c314
2
@Override protected void onReceive(int clientId, String message) { System.out.println("Received message from client " + clientId + ": \"" + message + "\""); Message msg = Message.parse(message); switch(msg.getType()) { case ID_REQUEST: //TODO send id response, send spawn messages to client, send spawn mes...
7a75c026-25d0-4a19-b2fc-ccda54d27ee9
0
@Before public void setUp() throws Exception { }
cc86c642-0dfb-4a6a-83f8-feb2207c39d9
0
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { progress = new javax.swing.JProgressBar(); jLabel1 = new javax.swing.JLabel(); okButton = new javax.swing.JButton(); jLabel2 =...
48ef8aae-4d18-4719-a8a0-0a79692138db
7
String multiplyHelper(String str1,int digit,int zeros){ if(digit==1){ for(int i=0;i<zeros;i++){ str1+="0"; } return str1; } if(digit==0||str1.equals("0")){ return "0"; } String str=""; int advance=0; for(int i=str1.length()-1;i>=0;i--){ int temp=(str1.charAt(i)-'0')*digit+advance; ad...
4731fdb0-bcda-4a05-9304-d756a221c72f
6
protected void initParts() { assert this.composite1 == null: "This is a bug."; assert this.implem_composite1 == null: "This is a bug."; this.implem_composite1 = this.implementation.make_composite1(); if (this.implem_composite1 == null) { throw new RuntimeException("make_composite1() in co...
181efb98-21fa-4f54-9387-e06ccfb01c7e
7
private void updateScreenActvCopyAllComponentValsToTxtFlds(){ for (int i = 0; i < currentlyShownActivityRowsNum; i++) { int actvCompType = jLabelsActvArr[i].getCompType(); if( actvCompType != COMPONENT_TYPE_TEXTFIELD ){ String txtFldVal1; String txtFldVa...
27d6ec92-1148-4c9c-b58c-1f65eb9ecf34
9
@Override public void execute() { Variables.status = "Summoning"; Walking.walk(new Tile(3658, 5094, 0)); Task.sleep(500, 600); if(Skills.getRealLevel(Skills.SUMMONING) >= 83) { if(Summoning.getPoints() > 8 && Inventory.getItem(Variables.LAVA_TITAN_POUCH_ID) != null) { Summoning.summonFamilia...
3fea25c8-007d-4e2d-bd30-3a8eaa84ae22
4
public PegsHash( PegsBoardType type, boolean[][] board ) { hashes = new int[(type.places.length >> 5) + 1]; int hashIndex = 0; int k = 0; for (PegsPoint p : type.places) { hashes[hashIndex] |= (board[p.y][p.x] ? 1 : 0) << k; if (++k == 32) { k = 0; hashIndex++; } } hash = h...
6e554ae6-7531-4b55-8154-e7d6e8f90965
3
@Override public double getVariance() throws VarianceException { if (nu <= 1) { throw new VarianceException("t variance nu > 1."); } else if (1 < nu && nu <= 2) { return Double.POSITIVE_INFINITY; } else { return (double) nu / (nu - 2); } }
dd7fa1b1-e65b-40c2-b1c1-34774f32418d
6
private void seeParse(ArrayList<ObjInfo> seeArray, String[] splitPacket) { for(int i = 2; i < splitPacket.length; i += 4) { // Split up the ObjName String[] splitName = (splitPacket[i].split(" ")); String[] splitInfo = (splitPacket[i+1].split(" ")); // Determine type of object: // - Flag -...
306e74e1-3842-4f82-ad51-71539d36bc8c
3
void setCellForeground () { if (!instance.startup) { table1.getItem (0).setForeground (1, cellForegroundColor); } /* Set the foreground color item's image to match the foreground color of the cell. */ Color color = cellForegroundColor; if (color == null) color = table1.getItem (0).getForeground (1); Tabl...
bd19b59b-0330-4769-9a4b-620909862b6c
6
public void goTop() { nNode = Idx[I].top; sRecno = 0; found = false; nKey = 0; for(;;) { goNode(); readPage(); if(left_page>0) nNode=left_page; else { for(;;) { if(key_cnt>0 || right_page<0) break; nNode = right_page; goNode(); readPage(); } nKey ...
f29ec384-9f6e-44af-9e26-fd95223978a8
2
public Memento saveToMemento() { // TODO erstellen MementoBoard memento = new MementoBoard(this.numOfColumns(), this.numOfRows()); // FIXME richtige reihenfolge? oder rows zuerst? // FIXME passt das sonst? for (int row = 0; row < this.numOfRows(); ++row) { for (int col = 0; col < this.numOfColumns(); ++...
f6a4f299-627f-4830-a20f-d9e41c0e9a34
5
public static void main(String[] args) { setIsPrime(); //asn is [a, b, count] int[] ans = new int[]{-1000, -1000, -1}; for(int a = -999; a < 1000; a++) for(int b = -999; b < 1000; b++) { int x = 0; int count = 0; int f = x*x + a*x + b; while( f >= 0 && isPrime[f] ) { count++; ...
bc8938a6-6072-4ed0-af66-e73bd561cd6b
2
@Override public int compareTo(final MethodStatistics o) { return (time < o.time ? -1 : (time == o.time ? 0 : 1)); }
14a0fa7f-5a11-4ab3-8209-6543985f5308
7
private NodeDouble<E> getIndex(int index){ if (index == 0){ return _head; } else if(index == _lenght-1){ return _tail; } else if (0< index && index < _lenght-1){ int calculo = (_lenght/2) - index; NodeDouble<E> actual; if(calculo <= 0){ calculo = _lenght - index-1; actual = _tail; f...
913a51c3-a17d-4899-b453-46bfd8b4b0fc
0
public CheckResultMessage check21(int day) { return checkReport.check21(day); }
672047b6-1de6-448e-8f18-be2e8c2e7dfa
4
@Override public final int getId(final Path path) throws InterruptedException { @SuppressWarnings("hiding") final Integer id; synchronized (Deserializer_0.this.idMapOut) { id = Deserializer_0.this.idMapOut.get(path); if (id == null) { Deserializer_0.this.idMapOut.put(path, -1); } } if ...
446837ee-3526-4af3-9d17-68bf161772ef
2
public static Properties toProperties(JSONObject jo) throws JSONException { Properties properties = new Properties(); if (jo != null) { Iterator keys = jo.keys(); while (keys.hasNext()) { String name = keys.next().toString(); properties.put(name...
8e76da23-4b95-4997-850f-8ebd5efb8443
5
public static void main(String[] args) { long ntscIncrementAsLong = 0x3F9111109E88C1B0L; // 0.0166666666 double ntscIncrement = Double.longBitsToDouble(ntscIncrementAsLong); long palIncrementAsLong = 0x3F9485CD701C02FCL; // 0.020041666 double palIncrement = Double.longBitsToDouble(palIncrementAsLong); floa...
f0bef40d-2228-4ed4-a153-fcc2a74b8775
4
@EventHandler public void onPlayerInventoryClose(InventoryCloseEvent e) { String title; Player p; ItemStack[] stack; title = e.getInventory().getTitle(); if (!title.contains("Armor")) return; p = Bukkit.getPlayer(title.substring(0, title.indexOf("'s") - 1)); if (p == null) return; ...
65f4f713-cdc7-4a32-b958-6ed6b5971bb2
0
public void get() { System.out.print(value); }
f64a4ed9-2ee0-43e5-9234-7d00e212ffd2
3
public static boolean isPrimitiveWrapper(Class type) { return ( // (type == Boolean.class) || (type == Integer.class) || (type == Long.class) || // (type == Short.class) || (type == Float.class) || (type == Double.class)); // || //(type == Byte.clas...
febcd628-3871-4c7a-96db-6ba5e58273fd
7
Object getProperty(String property, int index) { //Logger.debug("Measures.getProperty(" +property + "," + index +")"); if ("count".equals(property)) { return new Integer(measurementCount); } if ("countPlusIndices".equals(property)) { return index < measurementCount ? measurements[index]....
bdced500-8971-4855-8c1c-98b5d3ddeec5
0
public CloseProgram() { setIconImage(Toolkit.getDefaultToolkit().getImage(CloseProgram.class.getResource("/InterfazGrafica/Images/Warning.png"))); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setModal(true); setTitle("BOLSA DE EMPLEOS REP.DOM"); setBounds(100, 100, 450, 300); setLocationRelativ...
2119d053-4fac-4757-b77e-52c50f19792d
4
public void assignVariables(String host, int port) { hostName = host; portNumber = port; try { echoSocket = new Socket(host, port); } catch (UnknownHostException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (IOException e2) { // TODO Auto-generated catch block e2.print...