method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
9119c434-2814-4c82-9d14-5749f8d8aea8
0
private HashMap<String, String> createHashMapWithSettings() { HashMap<String, String> settings = new HashMap<String, String>(); settings.put("name", nameTextField.getText()); settings.put("port", portTextField.getText()); settings.put("minimizeToTray", new Boolean(minimizeToTrayCheckbox.isSelected()).toString()...
535a9ee6-07fa-4a3a-a6e9-914ea03d0a4b
9
private void paintComponentWrapped(Graphics g) { // The variables we use are as follows: // - visibleRect is the "visible" area of the text area; e.g. // [0,100, 300,100+(lineCount*cellHeight)-1]. // actualTop.y is the topmost-pixel in the first logical line we // paint. Note that we may well not paint this...
dce7fbd3-488e-41e5-8d21-c9e8be7ef4fc
2
@Override public double probability(double x0, double x1) { if (x0 < this.point && point <= x1) return 1; else return 0; }
9f9b7d88-194a-4b94-9ef7-9c6fe8e5c95a
2
public double getPrice() { double price = 0; for (Ingredient tmp : getIngredients()) { price += tmp.getPrice(); } for (Material tmp : getMaterials()) { price += tmp.getPrice(); } return price; }
3511f760-b471-4d03-a2f4-3666ff26ccf6
6
@Override public final void render(int var1, int var2) { var1 = getBlockOnScreen(var1, var2); if (defaultSizeBlocks) { drawFadingBox(width / 2 - 140, 30, width / 2 + 140, 195, -1878719232, -1070583712); } else { drawFadingBox(width / 2 - 140, 30, width / 2 + 140, 180,...
7fa7d181-ecf7-45b4-bca6-8c5885e70c70
7
@Override public boolean onCommand(CommandSender sender, String[] args) { for (String s : FTPInfo.SYNC_FILES) { if (!Installer.getRootFile(s).exists()) { sender.sendMessage(ChatColor.RED + "No install yet, use /install"); return true; } } Installer.downloadSyncFiles("$path.temp"); Sync local = ...
cfcf3a6b-3ca9-4c6c-bcea-053263aaa5e0
1
public void backOff(Entity other) { if (other.getx() > getx()) { x -= 3; } else { x += 3; } }
714dbe99-04d2-4ccb-8429-097c901dab40
7
private void processInteraction(PlayerInteractEvent event, Sign sign, Player player) { if(sign.getLine(0).equalsIgnoreCase("[Mailbox]")) { if(plugin.isHoldingMail(player)) { PostMaster.sendMail(plugin.getHeldMail(player)); plugin.removeHeldMail(player); player.sendMessage("Mail sent"); } else { ...
a8b5f9be-ad00-4a5d-81c6-d1f7db7ba26f
7
public static String autodetectProjectionFromFile(File archivo) throws IOException { String contenido = readFile(archivo); contenido = contenido.replaceAll("\",.*", ""); contenido = contenido.replaceAll(".*\"", ""); switch(contenido) { // TODO Faltan más casos/codigos case "ED_1950_UTM_Zone_29N": return "23...
8686f461-1f7d-4f07-b6eb-685f6addf96b
9
public void getOutfit(String user, String pass) { int tor[]; if (offline) { StringTokenizer st = new StringTokenizer(p.getProperty("outfit"),","); int total = st.countTokens()/3; for (int i = 0; i < total; i++) { ...
d5b694df-0a00-4c02-b28c-5ff750388119
7
private String loadTemperature() { if (details) System.out.println("Loading temperature."); File imageFile = new File("output/"+name+"/overviews/temperature_overview.png"); if (imageFile.exists()) { try { BufferedImage tempImage = ImageIO.read(imageFile); if (tempImage.getWidth() == chunksX * MyzoGE...
2c560233-6725-4d61-9af7-7562bb2ba088
5
private PersistanceManager() { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader("logSequenceNumber")); this.logSequenceNumber = Integer.parseInt(reader.readLine()); } catch (FileNotFoundException e) { this.logSequenceNumber = 0; } catch (NumberFormatException e) { ...
1a49cabb-5d8f-42ba-86b4-34829050c140
1
public void closeSocket() { try { csocket.close(); interrupt(); } catch (IOException e) { System.err.println(e); } }
659c3f5a-c7e5-480c-929c-8e3135d84a4f
4
public String getArgs() { output.target.setArgument(output.text.getText()); output.target.enable(); if (output.text.getText().equals("")) output.target.disable(); id.target.setArgument(id.text.getText()); id.target.enable(); if (id.text.getText().equals("")) id.target.disable(); csv.target.se...
3d4ef7a2-62cd-4b66-9ea4-2c75abda697a
9
public void evaluate(Graph graph){ Iterator<Edge> i0 = graph.edges(); while(i0.hasNext()){ Edge e = i0.next(); Node m1 = graph.getSourceNode(e); Node m2 = graph.getTargetNode(e); if (m1.get("value").equals(m2.get("value"))){ e.set("type", "same"); sameedges++; } else{ e.set("type","cro...
3a44b2b8-8d25-418f-97c3-c8770c49941b
5
public void run(){ while(!Display.isCloseRequested() && !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){ if(Display.isVisible()) { this.processKeyboard(); this.processMouse(); this.update(Time.getDelta()); this.render(); } ...
b6fc892d-ab01-4e66-a2e6-b1d116ddaa53
3
public static List<Integer> toIntegerList(List<String> strList, boolean failOnException){ List<Integer> intList = new ArrayList<Integer>(); for(String str : strList){ try{ intList.add(Integer.parseInt(str)); } catch(NumberFormatException nfe){ if(failOnException){ return null; } else{ ...
4b4839d6-99ff-452f-9fc1-43e8d395affa
0
@Override public void save() { }
1775338a-03c0-4560-ae94-fe86c4b6fa1c
8
@Override public int read(char[] cbuf, int off, int len) throws IOException { if (len > 0) { if (arrayOpenSent) { for (int i = 0; i < len; i++) { int ch = inputReader.read(); if (ch == -1) { if (i == 0) { ...
236d3930-5345-4326-8aa3-747ebc709575
4
public static String fetchURLPost(final String u, String parameters) { String returnedString = ""; try { final URL url = new URL(u); HttpURLConnection connection = (HttpURLConnection) url .openConnection(); connection.setDoOutput(true); connection.setRequestMethod("POST"); OutputStreamWriter wri...
278f08fa-a5a5-4ecd-a73d-1862688f4762
6
public Object tooltip(Coord c, boolean again) { if (tooltip != null) { prevtt = null; return (tooltip); } for (Widget wdg = lchild; wdg != null; wdg = wdg.prev) { if (!wdg.visible) continue; Coord cc = xlate(wdg.c, true); ...
03bd28be-ddca-4c63-b2e7-4ae4867f898f
1
public int orientation() { return this.area()>0? 1: -1; }
b3594bae-a11b-4ece-8ce8-fb6b06b8256d
4
private void updateActivities() { if (user != null) { activities = new HashMap<>(); activityIdNameMap = new HashMap<>(); //get their activities ArrayList<Integer> temp = user.getActivities(); if (temp != null) { activityNames = new St...
c4bdf2ae-41c3-4f48-921e-7003be117ffc
7
public void doOk() { this.isClosedByOk = true; String name = this.txfName.getText().trim(); Object sel = this.cbxType.getSelectedItem(); StockType type = StockType.SEMI; if (sel != null && sel instanceof StockType) { type = (StockType) sel; } int capacity = 64, maxTrays = 16, unitsPerRow = 8; try {...
cbffb351-476c-4b73-84b4-21cefd9e91d6
1
@Override public void undo() { JoeTree tree = parent.getTree(); if (newNode != null) { // Remove node from visible nodes cache tree.removeNode(newNode); // Swap the nodes parent.removeChild(newNode,index); } // Swap the nodes parent.insertChild(oldNode,index); // Insert the node into...
89497e3c-1849-4c9f-875d-3172d9d9637b
1
public OutputStream store(final String name) throws IOException { /* * The persistence service actually yields a real * OutputStream, but since it needs to know the final size of * the data before that, it isn't actually possible to use it * as an OutputStream in any reasonable manner. Thus, all data * is fi...
326d4a19-4798-471e-9d3a-f7f4a606e633
3
private final long mem(long TIME) { // display timing information System.err.println("# Time: " + (System.nanoTime() - TIME) / 1000 + " mus"); // memory stuff Runtime r = Runtime.getRuntime(); for (int i =0; i < 4; i++) { r.gc(); } long a = (r.totalMemory() - r.freeMemory()); boolean b = a > 1 << 20; lo...
2927ef42-3c90-492e-9f5f-83dd9ae81536
8
private void getPointList(){ buf.position(offsetFrames); points = new Vector3[numFrames * numXYZ]; int index = 0; float x,y,z; float minX, minY, minZ, maxX, maxY, maxZ; minX = minY = minZ = Float.MAX_VALUE; maxX = maxY = maxZ = -Float.MAX_VALUE; int normIndex; float sx,sy,sz,tx,ty,tz; frameNames = ...
07412709-499e-4528-a89c-2303902a13ae
0
public Crossbar(int speed, Queue []inputBuffers, Queue []outputBuffers) { //VERTICALBUSES are the number of 'OutputBuffers.length' //passes the constructor values to the base class SwitchingFabric super(speed, inputBuffers, outputBuffers, outputBuffers.length); //indicate has no memo...
b36dbf1f-abb2-4e62-918c-1ac2ef044d6a
1
public static boolean getKeyUp( int keyCode ) { return !getKey( keyCode ) && lastKeys[keyCode]; }
ad0bd5b6-a669-4381-80d5-3978162f7e2b
3
public Player[] allPlayersExcept(Player p) { ArrayList<Player> list = new ArrayList<Player>(); int index = p.getIndexInPlayers(); for (int i = 0; i < this.numPlayers; i++) { Player b = this.playerList[i]; if (b.getIndexInPlayers() != index) { list.add(b); } } Player[] listB = new Player[list.siz...
f5eccf3e-60c5-4427-9e59-b81221c7d451
6
public String getLowOrHighDate(String dateone, String datetwo, boolean highestDate) { try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date1 = sdf.parse(dateone); Date date2 = sdf.parse(datetwo); if (date1.compareTo(date2) > 0) { ...
d402a224-3fe3-4257-8058-b240ff8af194
4
public double distanceFrom(Location b) { if (b.locType != this.locType) { System.out.println("Location.distanceFrom: sorry type conversion not implemented yet"); return -1; } else { double rr = -1; switch (locType) { case NORTHINGE...
3d77d7b7-558f-40e9-bdc9-b34d36c3092c
8
public Rectangle2D getImageRectangle() { if (image == null) { return null; } double componentWidth = this.getWidth(); double componentHeight = this.getHeight(); double imageWidth = image.getWidth(this); double imageHeight = image.getHeight(this); dou...
a8089f1b-7c2e-4506-aed6-0b163de80d57
1
public void toggleState(ToggleButton button) { isEnabled = button.isSelected(); alarm.setEnabled(isEnabled); if(isEnabled) { this.getStyleClass().remove("disabled"); button.setText("On"); } else { this.getStyleClass().add("disabled"); butt...
8741815e-316f-4e7b-a2d3-d308de7ddfca
2
public int getFireResistance(){ int value = 0; for (Armor armor : armorList) { if(armor != null) value += armor.getStats().getFireResistance(); } return value; }
6867f366-012a-4fda-b1e0-ba3766a6d88a
2
public ArrayList<String> traerListaCargos(){ conn = Conector.conectorBd(); String sql = "select descripcion from tipousuario"; try { pst = conn.prepareStatement(sql); ArrayList<String> ls = new ArrayList<>(); rs = pst.executeQuer...
a9912c65-daa0-4873-b359-1868267ec3f1
4
private List<Reducer> estimateReducers(List<Mapper> newMapperList, boolean useRuntimeMaxJvmHeap) { int fReducerNum = finishedConf.getMapred_reduce_tasks(); if(fReducerNum == 0) return null; //if(isMapperConfChanged == false && isSplitSizeChanged == false && isReducerConfChanged == false) // return job.getR...
dcda2765-c2af-4583-9b73-f8e1d34f4013
4
public PreferencesPopup(Window window, ToolboxPanel toolboxPanel) { super(window, "Set Custom Colors", true); setLocationRelativeTo(window); this.toolboxPanel = toolboxPanel; scheme = new ColorScheme(ColorScheme.CUSTOM_SCHEME.toString(), ColorScheme.CUSTOM_SCHEME); loadEx...
365613d8-9b4d-425f-9c7a-f9130a2d1ab4
9
public void season(){ switch(month){ case MARCH: case APRIL: case MAY: System.out.println("Spring!"); break; case JUNE: case JULY: case AUGUST: System.out.println("SUMMER!!!!"); break; case SEPTEMBER: case OCTOBER: case NOVEMBER: System.out.println("Fall!"); break; //case DECEMBE...
fd88c037-db20-4f9d-ae45-a06e81480911
3
public void loadSigns() { file = new File(plugin.getDataFolder(),"signs.dat"); try { if (!file.exists()) { file.createNewFile(); Main.log.info("[ClassSign] Created signs.dat data file successfully."); } else { FileInputStream fis = ...
2db3985e-aff5-43b8-991c-70c8f37735bb
1
private void resize(int newsize) { // create new storage char[] newdata = new char[newsize]; // copy all existing elements for (int i = 0; i < top; i++) { newdata[i] = data[i]; } // apply new storage capacity = newsize; data = newdata; }
f4554d75-554f-4257-92df-be969cfca439
7
public static void makeCompactGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) { SpringLayout layout; try { layout = (SpringLayout)pa...
07330e11-3daf-4b12-b172-4ac61750e7a1
0
@Basic @Column(name = "CTR_VALOR_TOTAL") public double getCtrValorTotal() { return ctrValorTotal; }
d3bf6f49-710d-40d7-bf33-318ff035d525
5
@Override public void actionPerformed(ActionEvent e) { Object src = e.getSource(); if (src == btnOk) { Object sel = lstStocks.getSelectedValue(); if (sel != null && sel instanceof Stock) { stock = (Stock) sel; wasAccepted = true; Updater.getInstance().notifyObservers(); setVisible(fa...
d9f5d4b5-6081-413e-a3d6-3cc4b27c5833
3
private void doDown() { if (ducked) { marioObject.setHeight(tempHeight); marioObject.setY(marioObject.getY() + tempY); noMore = false; } switch (marioObject.getDirection()) { case LEFT: super.setAnimation(DuckLeft); ...
9800ada3-f3ab-416d-9377-4434b96397c8
4
@Override public void run() { BufferedReader reply = makeRequest(); if(reply == null) // Stop immediately if the request did not generate a response. return; /* Send the request to be interpreted and forward the found layers * to the main GSInsert object. */ if(parseXml(reply)) { mUi.publishFields(mF...
182773d6-d820-412c-a602-9d88567d86de
7
public static String convertToJSON(Car car) throws Exception { Class<?> currentCarClass = car.getClass(); Method getModel = null; Method getPower = null; Method getDateOfCreation = null; try{ getModel = currentCarClass.getDeclaredMethod("getModel"); }catch (NoSuchMethodException e){ System.out.println...
95fda7e5-04c2-4124-b767-12742ef3bd71
3
public int hashCode() { int result; result = (first != null ? first.hashCode() : 0); result = 29 * result + (second != null ? second.hashCode() : 0); result = 37 * result + (second != null ? second.hashCode() : 0); return result; }
807bacb7-f3cb-4416-b9ee-706783961ade
7
static public void main(String[] args) throws Exception { AuthHelper authHelper = new AuthHelper(); try { Policy defaultPolicy = Policy.getPolicy(); DbPolicy dbPolicy = new DbPolicy(); List policies = new ArrayList(2); policies.add(defaultPolicy); policies.add(dbPolicy); Com...
3d61da63-ab99-4b07-8fc0-4e10abc52aee
4
public boolean isCompleteMatch(List<Character> currentMatching) { if(currentMatching.isEmpty()) return false; if(currentMatching.get(0) != KeyMappingProfile.ESC_CODE) return false; String asString = ""; for(int i = 1; i < currentMatching.size(); i++) ...
c0e97554-931a-4e23-a136-0f85f162ea74
6
public RecipeBook RecipeMatcher(Recipe in) { RecipeBook res = new RecipeBook(); RecipeBook cq = new RecipeBook(); Recipe n = new Recipe("n"); RNode finger = in.first(); while (finger != null) { n.add(finger.getElement()); cq.add(n.copy()); n.remove(finger.getElement()); finger = finger.g...
7ea7111d-b545-4acd-8c7a-976e8c36cb3a
8
public static void main(String[] args) { parseParams(args); // TODO Auto-generated method stub dbWrapper.initGlobalWrappers(); //debugPrint.print("Driver finished"); //read in config file loadConfig(configFile); int personCount = 1; try { FileReade...
b820c4fc-5ff1-4858-803b-bb715d207d75
0
public SimpleCreature(double startingFoodLevel) { foodLevel = startingFoodLevel; }
2e3857b9-eb56-4059-b73b-345d19861ffd
4
public static void writeMasterImport(String[] folders) { File master = new File(baseFolder + scriptDirectory + "_import.txt"); PrintWriter out = Main.getWriter(master); if (out == null) return; List<String> output_elements = new ArrayList<String>(); for (String folder : folders...
7cefa6d5-ba9a-48bb-a340-ed73101b0f0b
1
public void setValueAt(Object aValue, int row, int col) { // data[rowIndex][columnIndex] = (String) aValue; try { Project element = projectResultList.get(row); element.setColumnData(col, aValue); fireTableCellUpdated(row, col); } catch (Exception err) { err.toString(); } }
37e5b48f-8f6d-41e6-be8d-6716cbc4a427
6
@SuppressWarnings({"unchecked"}) public boolean forEachEntry( TObjectObjectProcedure<? super K, ? super V> procedure ) { Object[] keys = _set; V[] values = _values; for ( int i = keys.length; i-- > 0; ) { if ( keys[i] != FREE && keys[i] != REMOVED ...
517d6889-c622-43b1-bb5f-3d9c6400cfdd
8
public int getIntIndex(int x) { int start=0; int end=intArray.length-1; int mid=-1; while(start<=end) { mid=(end+start)/2; if((mid>0)&&((intArray[mid-1]&NEXT_FLAG)>0)) { mid--; } if(x<(intArray[mid]&INT_BITS)) end=mid-1; else if((intArray[mid]&NEXT_FLAG)>0) { if(x>intArray...
60864a0e-7ab8-4311-b327-fcec55665e08
1
public void refreshLevel() { wonLevel = false; for (BoxObject bo : renderer.blocks) { bo.destroy(); } renderer.blocks.clear(); renderer.blocks.addAll(levelLoader.getBoxes()); renderer.trianglePos.set(levelLoader.getGoalPos()); renderer.cam.pos.set(levelLoader.getPlayerPos()); renderer.cam.rot.y = lev...
9f31d16c-e28d-43c3-99d7-41d7465a69fe
5
public void variableAssigned(Variable assignedVar) { //see if the variable is in the clause if(! variableInClause(assignedVar)) return; //make sure the unitness stats are correct checkUnitness(); //see if the clause is satisfied //we're going to do this by checking the number of satisfied literals direc...
2776ea87-f4c1-48f5-ab87-befca7070236
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final SegmentACK other = (SegmentACK) obj; if (actualWindowSize != other.actualWindow...
2d611326-371d-4e0b-ae60-d39a0ff1d2fa
1
public EditSprite getClone() { EditSprite clone = null; try { clone = (EditSprite) this.clone(); clone.setID(); } catch (CloneNotSupportedException e) { System.out.println("Cloning is illegal! And occasionally unethical!"); } return clone; }
2d86b2a8-6738-4631-8eef-5f45ba8fe342
3
@Override protected void doUpdate(double dt) { try { if (getElapsedTime() >= totalDuration) { if (!hasJumped) { hasJumped = true; getFacade().jump(projectile, GUIConstants.JUMP_TIME_STEP); //System.out.println("final time " + getElapsedTime() + " at x:" + projectile.getPosition().getX() + " and...
080b1991-9822-4ff7-9311-5c4de78ada89
1
public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args) throws CompileError { if (gen.getMethodArgsLength(args) != 1) throw new CompileError(Javac.proceedName + "() cannot take more than one parameter " + "for ins...
66009614-7d04-49ac-8e5a-0d23b4a9209c
3
@Override public void execute(IContext context) throws Exception { boolean isMultipart = ServletFileUpload.isMultipartContent(context.getRequest()); if(isMultipart){ FileItemFactory fif = new DiskFileItemFactory(); ServletFileUpload servletFileUpload = new ServletFileUpload(fif); try{ List...
d48f9526-6f49-4752-89de-e62dd78ac69d
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof GameMapData)) return false; GameMapData other = (GameMapData) obj; if (!Arrays.deepEquals(data, other.data)) return false; if (height != other...
00423812-30ca-46ec-b058-a49b946333e5
2
public void persistRule(Rule rule) { String sqlStatement; dao.connect(); sqlStatement = generateInsertStmt(rule); if(dao.getErrorLogs().getErrorMsgs().size() == 0){ dao.executeUpdate(sqlStatement); } if(dao.getErrorLogs().getErrorMsgs().size() == 0){ dao.disconnect(); } }
b9e24d91-5070-4bdb-b1c0-2eb49c8b433c
5
public void definirPoste(int number) { switch (number) { case 1 : this.poste = posteEnum.Caissier.toString(); break; case 2 : this.poste = posteEnum.Securite.toString(); break; case 3 : ...
bdbdc32d-75a7-4e0a-aad6-62f03c4b6f53
5
public boolean commit(){ synchronized (fatherTable){ for(Map.Entry<Column, ValueWithTimestamp> entry:localData.entrySet()){ Column col=entry.getKey(); ValueWithTimestamp data=entry.getValue(); Long oldNow=fatherTable.getLatestTimestamp(row, col); if(prevData==null) System.out.println(null+"");...
883b19fb-d7a8-47d5-9894-6c9c271df493
4
private void startProcess() throws IOException { final Swoppen swoppen = new Swoppen(processTrayIcon); Thread thread = new Thread(new Runnable() { public void run() { try { DbReader.getToken(processTrayIcon); } catch (IOException e1) { e1.printStackTrace(); } boolean runSwoppen = true;...
e4cd40c9-65f7-408b-bc32-4e26840fdb61
9
@Override public MergeSpecification findForcedDeletesMerges(SegmentInfos infos, IndexWriter writer) throws IOException { if (verbose(writer)) { message("findForcedDeletesMerges infos=" + writer.segString(infos) + " forceMergeDeletesPctAllowed=" + forceMergeDeletesPctAllowed, writer); } final List<Se...
ab3ee292-80c9-42da-8ec7-e158f012755b
5
private void loadPosition(){ FileInputStream in; File settings = new File("settings.properties"); if(settings.exists()){ try { in = new FileInputStream("settings.properties"); Properties prop = new Properties(); try { prop.load(in); in.close(); if (prop.containsKey("windowposx") && p...
20b4e8d8-ed0b-4464-939d-403965900c2a
7
@Override public void executeOperation() { switch (getView().getOperation()) { case VALIDATE_USER: validateUser(); break; case GET_PROJECTS: getProjects(); break; case GET_SAMPLE_IMAGE: getSampleImage(); break; case DOWNLOAD_BATCH: downloadBatch(); break; case GET_FIELDS: getFiel...
f0a4b880-f986-408e-95c2-0eb692b5c04d
0
public StudentServlet() { super(); // TODO Auto-generated constructor stub }
1bcc8fab-c738-4526-adee-6afea572e2ed
1
@Override public void run() { //TODO emit an output event instead of direct speaking eva.getEventBus().broadcast( new Event( EventType.OUTPUT, this, "Executing shutdown hook" ) ); ...
333841c5-39b8-4fe7-8b3a-4442b53ccd12
0
public int getArea(int i){ return getCell(i).getArea(); }
a67d94a1-3718-49d8-87d9-97566ed453ee
1
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + imgHeight; result = prime * result + imgWidth; result = prime * result + ((pictureType == null) ? 0 : pictureType.hashCode()); return result; }
5f3a0902-fe43-4f6c-9e31-4aa6353f5c39
5
@Override public void start(final Stage primaryStage) { stage = primaryStage; primaryStage.setTitle("Visual Eyes"); // clever name sounds like "visualize" Scene scene = new Scene(root); GridPane interfaceElements = new GridPane(); interfaceElements.setAlignment(Pos.TOP_LEFT); interfaceElement...
c9ccdb31-15b1-4294-af76-16d31e8471df
6
public static boolean isValidTile(int x, int y, int zoomLevel, TileFactoryInfo info) { // int x = (int)coord.getX(); // int y = (int)coord.getY(); // if off the map to the top or left if (x < 0 || y < 0) { return false; } // if of the map to the right if (info.getMapCenterInPixelsAtZoom(zoomLevel).g...
ccaec843-4b85-446a-b823-2f511586f723
0
public StackTest(){ stk.push(1); stk.push(22); stk.push(333); stk.push(4444); }
57eb01af-b96c-49e1-8a40-14173a353e95
3
public static void main(String[] args) throws IOException, ClassNotFoundException { File statusDir = new File(statusPath); File[] files = statusDir.listFiles(); TreeSet<Long> idSet = new TreeSet<Long>(); long total = 0; for (int i = 0; i < files.length; i++) { System.out.println(i + " " + files[i].getName...
9c6b2824-aa46-4f8f-b0e4-884caf0e3247
7
protected void updateIndexSetFor(int i, double C) throws Exception { /* m_I0a.delete(i); m_I0b.delete(i); m_I1.delete(i); m_I2.delete(i); m_I3.delete(i); */ if (m_alpha[i] == 0 && m_alphaStar[i] == 0) { //m_I1.insert(i); m_iSet[i] = I1; m_I0.delete(i); } else ...
7bb8175d-a312-4196-bfbd-0fd48fa7a4d3
7
@EventHandler public void SkeletonNightVision(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...
48d9f719-3998-4e60-aa22-e05ef57a4e86
0
@Override public int getLockCountAll(String objectType) { return getLockWriteCount(objectType) + getLockReadCount(objectType); }
8295268f-e96e-40f0-b1a4-75a1b154610b
5
public static String formatCsvValue(Object fieldValue, String type) { NumberFormat nf = createFixedPointFormat(); // These strings have been interned so == works for comparison if ("string" == type) { if (fieldValue instanceof Text) { return AnalysisUtility.escapeAndQuoteField(((Text) fieldValue).getValue(...
25774d8d-42db-4c6b-b35a-57739300acb3
3
public void setValor(PValor node) { if(this._valor_ != null) { this._valor_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
3c52fac3-506a-4b18-a4b2-802e967840c6
5
public static void main(String[] args) throws IOException { String arg0 = null; Integer listenPort = null; listenPort = 7777; try { arg0 = args[0]; if (arg0 != null) { listenPort = Integer.parseInt(arg0); } } catch (NumberFormat...
18302c0f-d573-4b7c-891f-8e86a458a960
2
public double getRadius( DistType t ) { if( t == DistType.MILES ) return convertDist( radius, DistType.NAUTS, DistType.MILES ); else if( t == DistType.KILO ) return convertDist( radius, DistType.NAUTS, DistType.KILO ); return radius; }
44dbbe93-1729-406f-a8f1-8fe72ec92f3b
1
public BitSet insertMtoN(BitSet M, BitSet N, int i, int j){ // clear the j -> i in N; N.set(i, j, false); // shift m to left by i; BitSet shiftedM = new BitSet(32); shiftedM.clear(); for(int start = i; start <32; start ++ ){ //System.out.println("shiftedM["+start+"]="+"M["+(start-i)+"]:"+M.get(start-i...
34737dfc-a7ce-4344-a3ca-bc1c6c089a44
0
public static void main(String[] args) { int i, j, k; j = 59; System.out.println("j : " + j); k = 56; System.out.println("k : " + k); i = j + k; System.out.println("j + k : " + i); i = j - k; System.out.println("j - k : " + i); i = k / j; System.out.println("k / j : " + i); i = k * j; System.o...
01a8e4e4-4370-471a-97c2-8a35e9a49d2c
3
public int search(String docs) { int i, j, M = pattern.length(), N = docs.length(); for (i = 0, j = 0; i < N && j < M; i++) { j = dfa[docs.charAt(i)][j]; } if (j == M) return i - M; else return N; }
5e552179-9184-48d5-b96d-06046c17c31c
0
@Override public boolean isCanceled() { return isCanceled; }
c990cb30-6a28-417a-a90a-9a6afc901ef4
4
public static void serveRead(ReactorSession session) throws IOException { ByteBuffer buffer = session.getInBuffer(); SocketChannel socketChannel = (SocketChannel) session.getSelectionKey().channel(); // Read the data. int amount = socketChannel.read(buffer); if (amount == -1) { session.disconnect(); re...
519e73b0-3bf1-47d0-93c9-a0eeecd84047
0
public CarBuilder() { delegate = new Car(); }
f854c55d-bf8b-4bfa-846f-dd1b4a870e22
5
public String cipher_sub(String sub) { StringBuilder sb=new StringBuilder(); int[][] codes=new int[3][sub.length()/2]; for(int i=0;i<sub.length();i+=2) { char c1=(char)(sub.charAt(i)-'a'+'A'); char c2=sub.charAt(i+1); Pair<Integer> cp1=h1.get(c1); codes[0][...
720453fd-c33a-4cf3-8261-580cfafe5e77
2
private static boolean isArray(TypedObject data, String x) { try{ if(data.getArray(x) == null) { return false; } } catch(Exception e) { return false; } return true; }
c61a092f-f795-4eb7-a510-e7f52706fb4a
1
public String getSimpleCode(){ String str = ""; if(identifiers != null) str += ", " + identifiers.getSimpleCode(); str = identifier.getNewName() + str; return str; }
0cb5267d-9bc0-4f2f-b8bc-dc69ec1a6128
5
static void jump(Grid hg, int myX, int myY){ Random randjump = new Random(); boolean valid = false; int newX = 0; int newY = 0; while(!valid){ newX = randjump.nextInt(10)+1; newY = randjump.nextInt(10)+1; if(hg.whatsAt(newX, newY) == null || hg.whatsAt(newX, newY).whoAmI() != 'Y' || hg.whatsAt(new...
ff9ec5f1-bd30-4724-8bb6-96d8f57de538
3
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder out = new StringBuilder(); int nCases = Integer.parseInt(in.readLine().trim()); for (int nCase = 1; nCase <= nCases; nCase++) { in.readLine(); a = new char[4]...
adb589f1-d5eb-46f8-9d25-afe55eca040f
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Usuarios)) { return false; } Usuarios other = (Usuarios) object; if ((this.iUsuario == null && other.iUsuario !...