method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
c29170be-be9a-4d69-813b-27ffe8265257
5
private void generateCircle() { int cc = this.cornerCount; float radius = (float)Math.min(this.getPixelHeight(), this.getFO().getPixelHeight())/2.0f; float s = radius <= 10?Settings.get(SetKeys.GUI_CMP_BORDER_SIZE, Integer.class)/2:Settings.get(SetKeys.GUI_CMP_BORDER_SIZE, Integer.class); float alpha = Util...
e9dc2d7e-6809-4d1f-a9ae-88afabe26c09
2
public void addActor(Actor actor){ int x; int y; do{ x = (int)(Math.random() * width); y = (int)(Math.random() * height); } while(!tile(x,y).isPassable() || getActor(x,y) != null); actor.setPosX(x); actor.setPosY(y); ...
3228de1e-e4eb-4d49-a84e-fd9d18f61b62
8
public void getComida(int type){ double min, min2, minX, minY; Cuerpo comida = null; min = 12345; minX = 0; minY = 0; for(Cuerpo c : Game.art){ if((c.getTipo() == type)&& c.getVida()>1){ min2 = min; min = Math.min(min, Math.hypo...
9af4fd7c-9594-47d6-af98-3bbd95925baa
7
public static HashMap<String,String> getChildrenFolderUsage(File file){ if(!file.isDirectory()){ return null; } File[] children = file.listFiles(); float sum = getDirSize(file)/1024; float sum20Percent = sum*0.08f; if(children!=null...
b97f8647-6f45-474e-b2ec-ee29c73e748e
5
public void executeCalculations(Scanner scan,CommandFactory cmdFactory,Stack<Double> st,Map<String,Double> def){ while (scan.hasNextLine()){ String userInput = scan.nextLine(); if (!userInput.equals("quit")){ String key=userInput.split(" ")[0]; try{ ...
5cd0dcbb-e206-45d8-a46d-fe3c0a93d92f
7
public static int search(int[] A, int target, int start, int end) { int current = A[start]; int len = end - start + 1; if(len == 1) { if(A[start] > target) { return start; } else if(A[start] < target) { return start+1; } else { return star...
3469da3a-67b3-4f1d-9562-ff2eff2a8673
3
/* */ public void updateEnemyUnits(Graphics g) { /* 587 */ for (int i = 0; i < enemies.size(); i++) { /* 588 */ Unit u = (Unit)enemies.get(i); /* 589 */ if (u.alive) { /* 590 */ u.update(17); /* 591 */ g.drawImage(u.getImage(), u.getX() + offsetX, u.getY() + /* 592 */ of...
04c78550-898f-41da-86ee-fa12471ea974
7
protected static BigDecimal convertValueToBigDecimalDatatype( Object aValue ) { if ( aValue == null ) { return null; } else if ( aValue instanceof BigDecimal ) { return (BigDecimal) aValue; } else if ( aValue instanceof String ) { String str = (String) aValue; if ( str.trim().length() == 0 ...
ee158fe7-e464-4b40-aa44-5e26cba0d882
7
public boolean start() { synchronized (optOutLock) { // Did we opt out? if (isOptOut()) { return false; } // Is metrics already running? if (task != null) { return true; } // Begin hitting the s...
3b8c816c-b557-45e9-984c-97123aa02a87
5
@Override public void happen(int rollResult) { for (Character characterChecking : Game.getInstance().getCharacters()) { //if (characterChecking.getCurrentRoom().getFloor() == Floor_Name.BASEMENT) { if (rollResult >= 1 && rollResult <= 3){ Trait chosenTrait = Game.getInstance().chooseAMentalTrait(); ...
60b70099-76e9-4913-b1be-70eb255286f2
6
public static void ex12(){ int [][] array=new int [5][5]; for(int i=0; i<5; i++){ for(int j=0; j<5; j++){ array[i][j]=(int)(Math.random()*10); System.out.print(array[i][j]+"\t"); } System.out.println(""); } System.out.println("Files x columnes"); int aux=0; for(int i=0; i<5; i++){ for(int j=0; j<5; ...
3bec9c4d-0cc7-48cb-8ad0-60fb12e35d6f
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...
3b6d87a2-f96a-4ad8-9b96-dfebe5f6a835
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FontTuple other = (FontTuple) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) ret...
3ad5cfd8-a8d9-4fb0-a334-d7a413c8f8ac
2
private String getMimeTypeForFile(String uri) { int dot = uri.lastIndexOf('.'); String mime = null; if (dot >= 0) { mime = MIME_TYPES.get(uri.substring(dot + 1).toLowerCase()); } return mime == null ? MIME_DEFAULT_BINARY : mime; }
cc3e22c2-e3c8-41f9-8ce4-c0989a7e4232
8
@Override public boolean doEvent(Event e) { switch (e.getType()) { case KEY_PRESSED: if (e.getValue() == Keyboard.KEY_LEFT) playerSpeedX -= horizontalSpeed; if (e.getValue() == Keyboard.KEY_RIGHT) playerSpeedX += horizontalSpeed; if (e.getValue() == Keyboard.KEY_UP && !playerFalling) { playerFal...
b34248fc-c612-4e46-b484-32f3c3fe7f18
4
public static void main(String[] args) { Collection<String> collection = new ArrayList<String>(); // Collection<String> collection = new CopyOnWriteArrayList<String>(); collection.add("1"); collection.add("2"); collection.add("3"); Iterator<String> iterator = collection.iterator(); String removeStr = "2"; ...
3863fc2e-7c28-41f1-807c-8973c5a15c13
4
private int packHSL(int h, int s, int l) { if (l > 179) s /= 2; if (l > 192) s /= 2; if (l > 217) s /= 2; if (l > 243) s /= 2; return (h / 4 << 10) + (s / 32 << 7) + l / 2; }
09747af5-bc09-401c-bdb5-f82c0b890293
6
public Archive.ArchiveData read(HistoryLinkMap linkMap, LinkDataFactory linkFactory) throws IOException { DataInputStream inputStream = new DataInputStream(mStreamFactory.getInputStream()); try { readHeader(inputStream); Set<LinkDigest> readLinks = readLinks(linkMap, linkFactory,...
432df7b4-321b-438a-a7c3-831d67ae559e
5
public Object remove(int index) { if (index >= size) { return null; } Node requestedIndex = null; if (index == 0) { requestedIndex = head; head = head.next; if (tail == requestedIndex) { tail = null; } size--; return requestedIndex.data; } else { Node cursor = head; index--; ...
8ea55d6c-cdf3-4d44-8f5d-827a28dcccdb
2
public int getIndex(Socket socket) { for (int i = 0; i < sockets.size(); i++) { Socket e = sockets.get(i); if (e == socket) return i; } return -1; }
4567fc41-89db-45ce-8a24-7f5b6d2c2e82
2
public static void main(String[] args) throws Exception{ String webappDirLocation = "src/main/webapp/"; //The port that we should run on can be set into an environment variable //Look for that variable and default to 8080 if it isn't there. String webPort = System.getenv("PORT")...
76fcb416-d7c6-48f4-a90a-11e66fe8e676
6
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof Hash)) { return false; } else { Hash h = (Hash) o; if (hash != h.hash) { return false; } if (data.length != h.data.length) { return false; } for (int i = 0; i < data.length; i++) { ...
13e9f4cb-28e1-4309-b85f-542844a15e47
2
protected static void revertOutlinerDocument(OutlinerDocument document) { int result = JOptionPane.showConfirmDialog(document, GUITreeLoader.reg.getText("confirmation_revert_file"), "", JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { FileMenu.revertFile(document); } else if (result == JOpti...
3dd3ebe6-a1a6-4c51-b6ef-38be273fefa5
7
public boolean intersects(Dimension d) { int x1 = (int) from.drawx; int y1 = (int) from.drawy; int x2 = (int) to.drawx; int y2 = (int) to.drawy; return (((x1>0 || x2>0) && (x1<d.width || x2<d.width)) && ((y1>0 || y2>0) && (y1<d.height || y2<d.height) ))...
0ba30e94-37b1-4813-a888-96c71250104e
9
public void parseProductSection(OVFProperty prop,XMLEvent e,XMLEventReader r) throws XMLStreamException{ boolean end = false; while (!end && r.hasNext()){ e = r.nextEvent(); end = (e.isEndElement()&&e.asEndElement().getName().getLocalPart().contentEquals("Property")); if (!end){ switch(e.getEventType()...
bde043d0-1eed-40d8-b825-60aa233fd833
4
@RequestMapping(value = "/listActiveUsers.do", method = RequestMethod.GET) public String listActiveUsers(Model model) { Map<Object, Date> lastActivityDates = new HashMap<Object, Date>(); for (Object principal : sessionRegistry.getAllPrincipals()) { // a principal may have multiple active...
b28a0f82-bff3-492e-9486-a01a933264f1
8
* @Post: move the selected piece to the selected location if it is a valid move * @Return: whether the piece actually moved */ private boolean movePiece(Point p) { if(possibleMoves==null) { return false; } if(possibleMoves.contains(p))//then we move the piece { if(chosenPiece instanceof King&&Math...
36c67266-86f6-4550-87c1-797c67214df9
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ClientCov other = (ClientCov) obj; if (defaultIncrement == null) { ...
638685a5-96e8-4ed5-8f28-0ee6e795da1d
6
private Node term() { // factor ((MUL^|DIV^|MOD^) factor)* Node factorExpression = factor(); while (lookAhead(1) == TokenType.MULTIPLY || lookAhead(1) == TokenType.DIVIDE || lookAhead(1) == TokenType.MOD) { if (lookAhead(1) == TokenType.MULTIPLY) { factorExpression = new MultiplyOpNode( match...
76fa357e-5786-4058-b707-64a20d5013fb
3
@SuppressWarnings("unchecked") public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { Event event = new Event(); JsonObject jsonObject = json.getAsJsonObject(); for(Map.Entry<String, JsonElement> entry: jsonObject.entrySet()) { String key = en...
8dc5b9dc-4c50-4166-a8ab-f97a03c9866c
5
@Override public void setStatus(PlayerStatus value) { if (Status != PlayerStatus.Out && Status != PlayerStatus.Bowled && Status != PlayerStatus.Stumped && Status != PlayerStatus.RunOut && Status != PlayerStatus.Caught) { PreviousSatus = Status; Status = value; } }
c3e053b5-c286-4b51-8adf-05a85e1c4dbf
2
public boolean heeftAuto(String kt){ boolean b = false; for (Auto a: alleAutos){ if (a.getKenteken().equals(kt)){ b = true; } } return b; }
8fdb5613-ccf1-4efc-a743-18a971fd0715
6
public BoardRec nextMoveRecurse(Board b, List<Integer> nextPiece, int depth) { if (depth == Math.min(exploreDepth, nextPiece.size())) { return new BoardRec(heuristic.useHeuristic(b)); } else{ BoardRec ret = null; for (Board.Direction d : Board.Direction.values()) { Board next = b.move(d...
6385e977-f543-46fd-8e11-27d71a621d92
8
private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { String eol = System.getProperty("line.separator", "\n"); StringBuffer expected = new StringBuffer(); int maxSize = 0; for (int i = 0; i < expe...
a08b5f07-86bc-4ea8-a54c-c0b860cdc2e8
1
public double calculatePopularity(double totalUsersInRoom,double totalUsersOnline) { if (totalUsersInRoom==0) { this.popularity=0; } else { //System.out.println("INSIDE"); //System.out.println(totalUsersInRoom); //System.out.println(totalUsersOnline); this.popularity = totalUsersInRoom/tot...
3f4c4d33-16f2-4274-bce2-e1827b2d7a34
7
@Override public void run() { Logger logger = BukkitCLI.getPlugin().getLogger(); if (command == null) { logger.warning("Unable to execute command. Cannot be null."); return; } try { Process p; if(dir == null) { p = runtime.exec(command); } else { p = runtime.exec(command, null, dir); ...
87069dc2-6b8f-4991-b6eb-e923605e87e8
3
public synchronized void synchronizeCuboid(int id) { try { if (existsCuboid(id)) { byte[] array = getCuboid(id).toByteArray(); PreparedStatement sync = db.prepareStatement("UPDATE " + CuboidHandler.cuboidTable + " SET cuboid = ? WHERE id = '" + id + "';"); Blob blob = new SerialBlob(array...
fb821ea3-0d2a-4db0-b9da-c9912d469a3d
6
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/plain;charset=UTF-8"); PrintWriter out = response.getWriter(); try { log("caller="+request.getParameter("id")); ...
8a02ecac-ef57-4bd2-b6a6-6753906b7cf1
3
@Override public int compareTo(Node uusi) { int paikka = 0; while (true) { if (juuri.get(paikka).getNamechar().compareTo(uusi.getNamechar()) > 0) { break; } paikka++; // Jos ollaan listan päädyssä, niin paikka on listan lopussa. ...
6a5894c1-41cb-4246-bfe5-7e901d491c4e
8
public void run() { try { in = new BufferedReader( new InputStreamReader( client.getInputStream() ) ); out = client.getOutputStream(); pout = new PrintStream(out); String request = in.readLine(); if ( request == null ) error(400, "Empty Request"); if(request.toLowerCase().indexOf("http/...
bc3f2f74-e7d1-4b74-abb4-191548da781b
0
public static <K, V> MultiValueMap<K, V> toMultiValueMap(Map<K, List<V>> map) { return new MultiValueMapAdapter<K, V>(map); }
bce14b6a-1a45-4928-a000-4b89f68473ab
0
public boolean isHasNextPage() { return (page + 1) * pageSize + 1 <= getItemsCount(); }
b0b44ee9-3c5d-4d00-b56f-a6390070232b
6
public void actionPerformed(ActionEvent e) { if(e.getSource()==register){ //variables to hold info read in from text fields String userName = name.getText(); String fstName = firstName.getText(); String lstName = lastName.getText(); ...
c660c5ce-9f6b-47dd-af8a-74209130cfee
9
public void actionPerformed(ActionEvent e) { if (e.getSource() == b1) { String naam = JOptionPane.showInputDialog(null, "Voer sponsorloop naam in: ", "Naam invoeren", JOptionPane.PLAIN_MESSAGE); if ((naam != null) && (naam.length() > 0)) { if (bestaatAl(naam)) { JOptionPane.showMessageDialog(...
013b9508-db2c-4048-9e00-7067383fd096
2
private void saveResults() { Object[] options = {"Yes", "No"}; int reallySubmit = JOptionPane.showOptionDialog(QuestionPanel, "This will finish the quiz and store your answers, are you sure?", //Object message, "Really Submit?", //S...
3699aec4-bf77-444d-b599-1549118ecc68
3
@Override public String processCommand(String[] arguments) throws SystemCommandException { Election election = facade.getCurrentElection(); if (election == null) throw new SystemCommandException("No current election set."); facade.publishResults(); ElectionResult result = facade.getCurrentElec...
df3f49ba-fd43-4fb0-9666-d76a713f1464
1
private byte[] alignBigEndToFourByteBoundry(byte[] bytes) { int mod = bytes.length % 4; // if the remainder == 0 then return the bytes otherwise pad the bytes // to lineup correctly if (mod == 0) { return bytes; } int pad = 4 - mod; byte[] newBytes = new byte[pad + bytes.length]; // for (int i = 0; i ...
a0937781-df79-4ed8-b7e4-9fae02007d82
0
public void accept(OperationVisitor visitor){ visitor.visit(this); }
e70bb339-edbe-479d-870e-09b19a8c4096
9
public void execute(String[] args) { File file = null; if (args.length == 0) { JFileChooser chooser = new JFileChooser(); FileFilter filter = new FileNameExtensionFilter("GEDCOM file", "ged"); chooser.setFileFilter(filter); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) file = c...
9bb5b1e4-edfb-4620-b853-2d5b9d65bb18
3
@OnMessage public String onMessage(String message, Session UserSession) throws IOException { username = (String) UserSession.getUserProperties().get("username"); Iterator<Session> iterator = chatroomUsers.iterator(); if (username == null) { UserSession.getUserProperties().put("us...
67da8e01-3bc0-45ec-ad1e-fb40b7a36bb3
6
public ChatSession(final String name) { super(name); //assign the global variable partner = name; //removes this thread when the window is closed this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { Controller.remove...
c7c1cc2b-4379-4a4d-aee4-29926b7b73ef
9
public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member, Tag[] firstSentenceTags, List<Content> tableContents, int counter) { HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD); tdSummaryType.addStyle(HtmlStyle.colFirst); writer.addSummaryType(this, member, tdSummaryT...
afc52662-8886-48be-a1d6-685a95e6ea69
9
@Override protected CommandExecutionResult executeArg(Map<String, RegexPartialMatch> arg) { final String g1 = arg.get("G1").get(0); final String g2 = arg.get("G2").get(0); // if (getSystem().isGroup(g1) && getSystem().isGroup(g2)) { // return executePackageLink(arg); // } if (getSystem().isGroup(g1) || getS...
e6bd4a65-843e-4803-ba9e-79b989785d93
9
private boolean r_t_plural() { int among_var; int v_1; int v_2; int v_3; int v_4; int v_5; int v_6; // (, line 160 // setlimit, line 161 v_1 = limit - cursor; ...
1307b78e-f21d-4021-8916-37ce4ee8a6b0
3
public synchronized int gridletStatus(int gridletId,int userId) { ResGridlet rgl = null; // Find in EXEC List first int found = gridletInExecList_.indexOf(gridletId, userId); if (found >= 0) { // Get the Gridlet from the execution list rgl = (ResGridl...
9ef04841-f726-48bb-a746-a437c84a813e
2
public void modificarDocumento(int id, ArrayList datos) { // Cambiamos todos los datos, que se puedan cambiar, a minúsculas for(int i = 0 ; i < datos.size() ; i++) { try{datos.set(i, datos.get(i).toString().toLowerCase());} catch(Exception e){} } bibli...
f168ae03-0f62-4e45-832e-121f103f7de7
6
protected void computeV(int k) { u.reshape(n,1, false); u.zero(); double u[] = this.u.data; // find the largest value in this column // this is used to normalize the column and mitigate overflow/underflow double max = 0; for( int i = k+1; i < n; i++ ) {...
24d48e0e-4a06-4c09-9c9e-1df591c0a094
6
private void renewImages(){ Runnable thread = new Runnable() { @Override public void run() { boolean firstRun = true; for (Team team : playmode.getTeams()) { for (User user : team.getUser()) { GameObject playerObject = gameObjects.get("PLAYER" + user.getID()); if(firstRun){ ...
d01aec5a-e5b0-46b0-a00a-db0cc64ffe17
6
private void kingBottomRightPossibleMove(Piece piece, Position position) { int x1 = position.getPositionX(); int y1 = position.getPositionY(); if((x1 >= 0 && y1 >= 1) && (x1 <= 6 && y1 < maxHeight)) { if(board.getChessBoardSquare(x1+1, y1-1).getPiece().getPieceType() != board.getBlankPiece().getPieceType...
72cd926c-89e2-46ac-8167-637fb7284f79
6
public StackController(Register SP, Memory storage) { super(null); reg = SP; mem_low = new Memory(storage); mem_high = new Memory(storage); in_data = new NOPNode[reg.getBitness()]; for (int i = 0; i < reg.getBitness(); i++) { in_data[i] = new NOPNode(); } for (int i = 0; i < reg.getBitness()/2; i++) ...
ba467ddd-dcfe-4d9a-a534-bb4292da0003
0
public TicketQueryResult getResponse() { return _response; }
862f4e12-48a0-427a-b59d-1639d48633db
8
public static ArrayList<ArrayList<String>> parse(String circuitData) throws FileNotFoundException{ ArrayList<ArrayList<String>> data = new ArrayList<ArrayList<String>>(); File file = new File(circuitData); Scanner scan = new Scanner(file); //scanner is life, scanner is love String line; int count = 0; //using...
23aca4df-a2bb-451e-8a81-0d207c35de48
7
public Body(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "alink": alink = Alink.parse(this, v); break; case "background": background = Background.parse(this, v...
2b9ca478-28ce-48af-a9a3-e730df53a0ba
1
public static void addurl(URL url) { ResSource src = new HttpSource(url); final CacheSource mc = prscache; if (mc != null) { src = new TeeSource(src) { public OutputStream fork(String name) throws IOException { return (mc.cache.store("res/" + name)); } }; } chainloader(new Loader(src)); }
0921643d-c5e9-4238-b4fa-dab13720aec7
3
private Double zeilensummenNorm() { Double sum = 0d; Double max = 0d; for (int t = 0; t < 2; t++) { for (int i = 0; i < 2; i++) { sum = sum + Math.abs(values[t][i]); } if (max.compareTo(sum) == -1) ...
68e8efef-a9b2-4096-a1c8-41c1dd1e1f6a
0
public boolean isCellEditable(int row, int column) { return column != 0; }
2cd996ee-eb29-4616-9400-074a5d8fdf40
0
@Override public DataStructures getStructure() { return data; }
94c6e635-9caf-4635-98f5-9e3dbaa4182c
2
@Override public void save(FileOutputStream out) throws IOException { SaveInfo info = new SaveInfo(); if (initialized){ info.addInt(contains.length); for (int i = 0; i < contains.length; i++){ contains[i].getBase().getID(); } } else { info.addInt(-1); } info.saveInfo(out); }
1cdf07d7-80ee-454c-bcc8-04e768cebe1b
0
public void updatePosition(int deplacement, int rotation) { eraseCourante(); rotation(rotation); deplacement(deplacement); position.setValue(positionReelle.get(0).intValue(), positionReelle.get(1).intValue()); drawCourante(); }
1aa389c7-fb9a-4f12-8f8c-4030d4f1976f
0
public Rogue() { super(new BackStab(), new DeadlyInfect(), new Intimidate(), 100.0, 60.0, 20.0, 0, 50.0, 60.0, "Rogue",350,175); } // End DVC
d4ff63c6-9f5b-440e-a9ca-288d0aa9d6b4
0
public Integer getId() { return this.id; }
b51827f1-3ffd-4b78-8d5d-c921e3ec8007
0
@Before public void setUp() throws Exception { this.terminal = new POSTerminal(); this.terminal.setPricing('A',1,10); this.terminal.setPricing('A',2,7); this.terminal.setPricing('B',1,7); this.terminal.setPricing('B',5,25); this.terminal.setPricing('C',1,4); this.terminal.setPricing('D',3,2); termina...
1d07f842-6583-4d20-90d5-2b014c02ebef
0
default void log(String str){ System.out.println("I2 logging::"+str); }
02f9c123-0fe2-4a96-bc55-803f0018bdd4
1
private Visiteur chargerUnEnregistrement(ResultSet rs) throws DaoException { try { Visiteur visiteur = new Visiteur(null,null,null,null,null,null,null,null,null); visiteur.setMatricule(rs.getString("VIS_MATRICULE")); visiteur.setPrenom(rs.getString("VIS_PRENOM")); ...
9e5d48c5-8a9c-4d2a-b2c1-8a4ee73cb1d9
1
public void changeOuter() throws Exception { Set<Node> doneNodes = new HashSet<Node>(); Set<Node> openNodes = new HashSet<Node>(); doneNodes.addAll(inNodes); //output Nodes for (int i = 0; i < outNodes.size(); i++) { calculateNode(outNodes.get(i), doneNodes, openNodes...
2e517d3d-0044-496f-9beb-4370af72925b
6
public synchronized void jvnInvalidateReader() throws JvnException { System.out.println("invalidate reader with state : "+STATE+" sur l'objet "+joi+" "+System.currentTimeMillis()); if(STATE != STATE_ENUM.R && STATE != STATE_ENUM.RWC){ STATE = STATE_ENUM.NL; } else{ wait_for_write = true; while(...
9472ffc6-8967-4c88-ab31-e00d669b15a1
0
public void setDialogWindowView(DialogWindowView dialogWindowView) { this.dialogWindowView = dialogWindowView; addView(dialogWindowView); }
c07b4fc5-a700-4099-bc26-d6eed12c24b0
4
private void save(BufferedImage image, String fileName, String ext) { String dirName; if(parent != null && parent.parent != null && parent.parent.parent != null){ dirName = parent.parent.parent.directoryName; }else{ dirName = "."; } File file = new File(dirName + "/" + fileName + "....
1d1bff95-c4af-421a-9cd3-ceaafc200b59
6
public void loadConfig(AlpineRescue rescue, String gridFile, String mapFile, Map<String,String> searcherConfig, String direction) { try { FileReader reader = new FileReader(gridFile); @SuppressWarnings("resource") Scanner scan = new Scanner(reader); String line; String[] splitLine; line = scan.n...
2b045ca5-d200-4b6c-8f35-d808b00ce646
5
@Override public String toString(){ float r, g, b, a; String type = "-"; if(this.r == -1 || this.g == -1 || this.b == -1 || this.a == -1){ r = this.getRed(); g = this.getBlue(); b = this.getGreen(); a = this.getAlpha(); type = "Color"; }else{ r = this.r * 255; g = this.g * 255; b = t...
a077aa68-0378-4393-b04c-079bd43b77f5
9
public void renderInBattle(Screen screen, int placement) { int xa = Game.width-30-sprite.SIZE; int ya = (placement*25-10); if (number == 1) { sprite = Sprite.ghost_left1; if (animate % 30 < 10) { sprite = Sprite.ghost_left2; } if (animate % 30 > 20) { sprite = Sprite.ghost_left3; } } if...
d12b863e-dd9c-4cf3-b3e9-f7d5f3ab6d94
9
private void drawJuliaBruteForce(int image_size) { double size = fractal.getSize(); double size_2_x = size * 0.5; double size_2_y = (size * height_ratio) * 0.5; double temp_size_image_size_x = size / image_size; double temp_size_image_size_y = (size * height_ratio) / image_size...
e5703a83-1a23-46a8-9460-42bfff279005
6
private final void method88(int i) { anInt2++; long l = Class62.getCurrentTimeMillis(); long l_2_ = ByteBuffer.aLongArray7206[Class152.anInt2071]; ByteBuffer.aLongArray7206[Class152.anInt2071] = l; if (l_2_ != 0L && l_2_ < l) { int i_3_ = (int) (l - l_2_); Class239_Sub5.anInt5891 = (32000 + (i_3_ >> -128...
5f6c596d-3978-4427-b68c-c535d3655cfc
0
public Integer getId() { return id; }
6e5cfd21-53e7-4157-ad2d-7b90f5ed1df5
9
public static void inicializarCreaturasPrograma(){ File dir = new File(pathCarpetaCreaturasPrograma); if(!dir.exists()){ System.out.println("El directorio No Existe"); } else{ String[] ficheros = dir.list(); String[] datos; if (ficheros == null){ ...
01f05d0b-19f6-44e2-ac5a-595a71b68d29
7
private String search(Task userRequest) { String searchedTasks = ""; searchList = new ArrayList<Integer>(); String[] keywords = null; if (userRequest.getDescription() != null && !userRequest.getDescription().equals("")){ keywords = userRequest.getDescription().split("\\s+"); } for (int i = 0; i < mLoc...
1240a15b-8f97-4627-bc34-f7d9233ac25c
7
public UserdataUpdater() { plPort = Configuration.getConfig(Configuration.CONFIG_PIPELINE_PORT); plUser = Configuration.getConfig(Configuration.CONFIG_PIPELINE_USER); String pipeHome = Constants.pipelineHome(plUser, plPort); userdataFile = new File( pipeHome + "userdata.xml"); if ...
d379f867-ca76-458e-8f5e-90fcbf1e5dd9
0
public void load(int[] aInt, float[] aFloat, String[] aString){ this.array = aInt; }
4e1e2c09-b39e-4f97-a1d1-d76bd78a73d8
7
public Object remove(int p) { Object t = null; if (p < 0 || p >= _size) { return t; } if (p == 0) { int tmp = array[head].getNext(); array[head].setPrev(-1); array[head].setNext(-1); t = array[head].getData(); array[...
a8fd4d44-3335-4338-831e-6f9796ee0b41
4
public static void main(String[] args) { try { if(args.length<3) { System.out.println("parameters error!"); showHelp(); System.exit(0); } else{ txtPath=args[1]; xmlPath=args[2]; outputPath=args[3]; } if(args[0].equals("-o")){ System.out.println("creating xml file...")...
1ba20588-67a5-4c4e-bac4-590753991ec9
6
@Override public float generate(float x, float y, T cell) { float tectonics_x = x / tectonics_map_.getCellSize(); float tectonics_y = y / tectonics_map_.getCellSize(); int cell_x = (int)tectonics_x; int cell_y = (int)tectonics_y; float rest_x = tectonics_x - (float)Math.floor(tectonics_x); float rest_y...
ad49a312-966b-4614-a5c1-95cd3b1bb75a
9
private void login(String uname, String pass) { if(KeyID == -5 || challstr == null) return; URL url = null; try { url = new URL("https://play.pokemonshowdown.com/action.php"); } catch (MalformedURLException e) { e.printStackTrace(); } Map<String,Object> params = new LinkedHashMap<>...
273ae04e-5b9e-4747-a60c-6ac2cc9f7181
2
public boolean shipDestroyed() { for(Field f:fields) { if(f.getBattleState()!= eFieldBattleState.Hit) return false; } return true; }
b5af8501-4748-4b2e-868d-531265ae72d0
6
private static List<PositionEntity> getMovePositionsGold(final ChessBoardEntity b, final ChessmenEntity c) { List<PositionEntity> result = new ArrayList<PositionEntity>(); PositionEntity p = null; p = new PositionEntity(c.getPosition().getX() - 1, c.getPosition().getY() - 1); if (enablePosition(b, p)) { resu...
30105684-83d4-4088-a323-35a9d17f7e66
5
private int maptype1_quantvals(){ int vals=(int)(Math.floor(Math.pow(entries, 1./dim))); // the above *should* be reliable, but we'll not assume that FP is // ever reliable when bitstream sync is at stake; verify via integer // means that vals really is the greatest value of dim for which // vals^b...
9bcc7e45-8211-4204-9fb2-f8fb1ec136c2
9
public void render_map(){ map_width = game.getBredde()*16; map_height = game.getHoyde()*16; Character[][] char_map = game.getMap(); int x = 200; int y = 200; for (int i = 0; i < game.getHoyde(); i++) { for (int j = 0; j < game.getBredde(); j++) { if(char_map[i][j]== '#'){ wall.draw(x...
a30a362d-e81c-473b-8edb-bb4d059d806d
6
@Override public int[] getInts(int par1, int par2, int par3, int par4) { int i1 = par1 - 1; int j1 = par2 - 1; int k1 = par3 + 2; int l1 = par4 + 2; int[] aint = this.parent.getInts(i1, j1, k1, l1); int[] aint1 = IntCache.getIntCache(par3 * par4); for (in...
45baf7f7-1fc2-4423-8b85-f5670ce78ca8
2
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PlayerInfo other = (PlayerInfo) obj; return this.id == other.id; }
84230854-5e06-45f9-acd9-3cc32f2a0c27
0
public void setFunMm(Integer funMm) { this.funMm = funMm; }
e4f46ccf-952a-4eb1-b886-6ade139200ba
7
@Override public void run() { int bytesRead = 0; while (true) { try { if (isPlaying == true) { if (line != null) { if (bytesRead == -1) { isPlaying = false; bytesRead = 0; inputStream.reset(); line.drain(); if (isLooping) ...