method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
3131cd35-5bb5-456e-b3c4-ffd0d32f4e27
9
public static List<String> getQuotes() { List<String> ff = new LinkedList<String>(); try { HttpURLConnection con = (HttpURLConnection) new URL("http://www.bash.org/?random").openConnection(); StringBuilder sb = new StringBuilder(); con.connect(); InputStr...
5190290a-7375-4ef8-b475-6aa7cf177015
8
private void parseAttributes(ArrayList<XmlAttr> attrList) { // Sort attributes by key name Collections.sort(attrList, new Comparator<XmlAttr>() { public int compare(XmlAttr o1, XmlAttr o2) { return o1.key.compareTo(o2.key); } }); boolean added; boolean ignore; // Read and create uniques combin...
a07dc7c7-d8a0-4501-8a60-a5c163ca6ae5
2
public Character convert(String source) { if (source.length() == 0) { return null; } if (source.length() > 1) { throw new IllegalArgumentException( "Can only convert a [String] with length of 1 to a [Character]; string value '" + source + "' has length of " + source.length()); } return source.char...
6d0f6d5d-0b77-4b13-ac96-698c77a2ef6a
2
private static String getQualifiedName(int baseNameLength, String classPath) { logger.info("Computing fully qualified name from" + classPath + " by removing " + baseNameLength + " characters from the start"); // A plugin cannot be an internal class if ((! classPath.endsWith(".class")) || (classPath.indexO...
5a042747-9072-4140-b973-dfdbe5c05a48
8
@Transactional public int update(Object o) throws DataAccessException { StringBuilder qry = new StringBuilder(); StringBuilder strFieldColumn = new StringBuilder(); StringBuilder strWherePkClause = new StringBuilder(); List<Object> val = new ArrayList<Object>(); qry.append("update "); Class<?> c = o.getCl...
62ac9c8e-999b-4d45-aabb-76b66e2612ca
9
public void serialEvent(SerialPortEvent spe) { int[] msgToChildren = NetworkProtocol.msgToChildren; if (spe.getEventType() == SerialPortEvent.DATA_AVAILABLE) {//If one byte of data came in try { byte charVal = (byte)input.read(); if (charVal == START_BYTE && dataPacketFlag == false) { //Stores start ...
4ef2aabe-492b-4c47-b455-e6629d9659bd
4
public void calculateShortestPath() { this.parent = this.startWord; this.wordParent.put(this.startWord, this.parent); char alphabetLetter; int i; //label used for breaking loop outerLoop: while(!(this.queue.isEmpty())) { char[] splitWord = this.queue.get(0).toCharArray(); for(i = 0; i < sp...
e03835cb-8000-4ece-8149-5c743dec374d
8
public File getCsvData() { List<DataLead> leads = selectAll(); if(leads == null) { this.errorLogFile.log(LoggingProxy.ERROR, "[---]CsvProxy error. Can't get data. "); return null; } File tmp = createCsvFile(); if(tmp == null) { this.errorLogFi...
2e2557d0-19a8-45fd-8802-552878d8721e
1
public List<Product> getAll() { List<Product> products = null; try { beginTransaction(); products = session.createCriteria(Product.class).list(); session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); } finally { closeSesion(); } return products; }
e09383bb-2e02-4f1e-9a90-c5b7d3a0a6ba
5
public static List<String> getMapId(String search) { List<String> ret = new ArrayList<String>(); ret.add("<<MapId Search: " + search + ">>"); MapleData data; MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("net.sf.odinms.wzpath") + "/...
c47b4614-5e1c-4546-a7e3-8c83eee15054
0
public HBox initHeader(String titleText) { HBox header = new HBox(); header.setAlignment(Pos.CENTER_LEFT); header.getStyleClass().add("popUpHeader"); header.setPrefHeight(28); Button closeBtn = new Button(); closeBtn.getStyleClass().add("close-button"); closeBtn.setPrefSize(16, 16); closeBtn.setMinSize...
86c02b4d-b69b-415a-8e19-b8c3c2fead4a
1
public float getMinGain() { float gainMin = -9999.0f; if (audioDevice instanceof JavaSoundAudioDevice) { JavaSoundAudioDevice jsAudio = (JavaSoundAudioDevice) audioDevice; gainMin = jsAudio.getMinGain(); } return gainMin; }
7e6cc33a-f28c-4c07-aaba-c999a61ea422
6
public void moveToEx(float x, float y, int random) throws IOException { LOG.debug("Moving to {} {} (and waiting until we reach it, until we're blocked or dead)"); int blocked = 0; int status = this.getMapLoading(); this.moveEx(x, y, random); pingSleep(0); float distance...
730bdef7-c776-4283-8025-ba9d1f1d1cad
2
private static void ForWithContinue() { int[] numbers = { 10, 20, 30, 40, 50 }; System.out.println("Begin of ForWithBreak"); for (int x : numbers) { if (x == 30) { continue; } System.out.print(x); System.out.print("\n"); } System.out.println("End of ForWithContinue"); System.out.println("\n"...
c6ad9095-ec35-408b-90ba-7aa32888207d
5
private void findExits() throws SlickException { Collections.sort(plan); Integer idchoose = 0; int possibility = MIN_CHOISABLE; int MinDistance = MIN_DISTANCE_TO_EXIT; for (int i = 0; i < exitNumber; i++) { // Pour le nombre de sortie de la // zone boolean goodChoice = false; int tryCounter ...
31c62075-641a-4743-93a4-92c53e3adbfa
1
public Game(FullGridFactory gridFactory) { if (gridFactory == null) throw new IllegalArgumentException("Gamefacotry can't be null!"); this.gridFactory = gridFactory; init(); powerFailureFactory = gridFactory.getPowerFailureFactory(); }
32fe3e68-8d6c-4208-b10c-522c97f4fc64
6
BaseColor getBadgeBackgroundColor() { String badgeBackgroundColorString = null; if (detectBadgeTypeFromName) { final String adultLeaderBadgeTag = PropertyFileReader.getProperty( "adultLeaderBadgeTag", "A_"); final String youthCounselorBadgeTag = PropertyFileReader .getProperty("youthCounselorBadgeTa...
3d040bbc-19cb-4b58-b923-48ff571bf6d4
1
public void filter(byte[] samples, int offset, int length) { for (int i=0; i<filters.length; i++) { filters[i].filter(samples, offset, length); } }
77512bb6-7a06-46a2-90f4-a07bf7ee6405
0
public void clearControllers() { // Reset the ArrayList activeControllers = new ArrayList<JInputController>(); }
ae9e95ba-e431-42c4-b3b4-b6f7f07fed0f
4
public byte[] addHeaders(byte[] data) { List<Byte> result = new ArrayList<Byte>(); // Header byte result.add((byte)0x03); // Timestamp long timediff = System.currentTimeMillis() - startTime; result.add((byte)((timediff & 0xFF0000) >> 16)); result.add((byte)((timediff & 0x00FF00) >> 8)); result.add((b...
17f8c6ac-6a9d-45a1-9ce1-9e820967500b
6
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int len = Integer.parseInt(br.readLine()); String[] l = br.readLine().split(" "); String[] p = br.readLine().split(" "); int[][] result = new int[len][len]; for (int i = 0; i...
fd7257ff-d58b-441d-bb9a-1c34bea06092
7
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == kuldesGomb) { kuldes(); } else if (e.getSource() == manualisOktatasMenupont) { manualisOktatasAblakMegnyitas(); } else if(e.getSource() == mentesMenupont){ tudastarMentese(); ...
50dd54e5-eced-4d6e-b379-7ed211898e3b
8
private void nextTurn() { if (this.currentPlayerTurn == 1) { // Minimum 2 players, so always change to P2. this.currentPlayer = this.P2; // Change from P1 to P2 this.currentPlayerTurn = 2; return; } if (this.currentPlayerTurn == 2) { if (this.numPlayers == 2) { // If 2 players, go back to P1. Otherwi...
83eb4e56-d0a4-435e-92cd-58dfa120453e
8
public InputFileChooserView() { display = new Display(); shell = new Shell(display); Monitor primary = display.getPrimaryMonitor(); Rectangle r = primary.getBounds(); shell.setBounds((int) (r.width * 0.1), (int) (r.height * 0.1), (int) (r.width * 0.8), (int) (r.height * 0.8)); Point shellSize = shell.ge...
1191d135-9a13-4b8a-83ee-6005327f8b8f
2
@Override public boolean onKeyUp(int key) { Iterator<IScreenItem> it = screenItems.iterator(); while(it.hasNext()) { IScreenItem item = it.next(); if(item.onKeyUp(key)) { return true; } } return false; }
51d11738-044c-4d21-9de5-a98c47b5b083
4
static protected Location parseLocationLine(String line) { if(log.isDebugEnabled()) log.debug("parseLocationLine:" + line); String latitude, longitude; int latitudeSign = 1, longitudeSign = 1; if(log.isDebugEnabled()) log.debug("line:" + line); latitude = line.replaceAll("^.*LATITUDE ", ""); lat...
fbd3d1a8-6b0c-4620-8ab4-cb4629972f7a
1
@Test public void testLoadMemory() { Data[] testArray = new Data[2]; testArray[0] = testInstr; Instruction testInstr2 = new BranchInstr(Opcode.BRZ, 5); testArray[1] = testInstr2; memory.loadMemory(testArray); for (int i = 0; i < 2; i++) { assertEquals(testArray[i], memory.accessAddress(i)); } ...
2157013c-a415-4940-b30f-4f15a51ed99f
2
public void reserveSmallConstants(GrowableConstantPool gcp) { for (int i = 0; i < fields.length; i++) fields[i].reserveSmallConstants(gcp); for (int i = 0; i < methods.length; i++) methods[i].reserveSmallConstants(gcp); }
85d2f74d-35a4-4f1c-8b02-bb0d33a7e1ad
0
@Override public int fight() { return super.fight(); }
7615c61c-11b6-4994-9615-8cd594304d4d
2
@Override public void Consultar() throws SQLException { try { Conexion.GetInstancia().Conectar(); ResultSet rs = Conexion.GetInstancia().EjecutarConsulta("SELECT Nom_Cliente,Dir_Cliente,Tel_Cliente,Ape_Cliente ,Email_Cliente,Tip_Cliente,SalPen_Cliente FROM Cliente WHERE ...
4e0da0cf-6c60-49bd-8995-4b41d236fe7d
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...
3ba632af-803e-442a-aa57-777f6b267aad
1
public void testRowCount() { DataSet ds = null; try { final DelimitedColumnNamesInFile testDelimted = new DelimitedColumnNamesInFile(); ds = testDelimted.getDsForTest(); // check that we parsed in the right amount of rows assertEquals(6, ds.getRowCount(...
4e26ec82-dbdf-4555-b200-7efc57cd5ed1
2
public static ArrayList<History> showHistory() { ArrayList<History> histories = new ArrayList<History>(); Database db = dbconnect(); try { db.prepare("SELECT * FROM ticket_history ORDER BY changed_on desc"); ResultSet rs = db.executeQuery(); while(rs...
aa871a26-3f29-47ae-9b0c-c1ffcee20834
6
private Color stripColor(ColorRGB colorInfo) { colorInfo.setR(colorInfo.getR() < 0 ? 0 : colorInfo.getR() > 1 ? 1 : colorInfo.getR()); colorInfo.setG(colorInfo.getG() < 0 ? 0 : colorInfo.getG() > 1 ? 1 : colorInfo.getG()); colorInfo.setB(colorInfo.getB() < 0 ? 0 : colorInfo.getB() > 1 ? 1 : colorInfo....
66fd9315-5252-4ad3-b937-bf4827a9e5c4
2
@DBCommand public boolean delete(CommandSender sender, Iterator<String> args) { if(!sender.hasPermission("db.delete")) { sender.sendMessage(RED + "You don't have permission to use this command!"); return true; } if(!args.hasNext()) { sender.sendMessage("No...
67a69d5d-ed9f-447b-ac17-5738815b5b54
0
public void event() { }
0ce50162-eddc-4e6e-80dc-3b7cb0f4ea47
3
public static void validateNumericType(Number number) { if (!(number instanceof Integer) && !(number instanceof Double) && !(number instanceof Long)) { throw new RuntimeException("Unsupported Number type: " + number.getClass().toString()); } }
f02036f6-e204-4faa-a551-eb0de74cd6c4
3
@Override public void update(Observable arg0, Object arg1) { //arg1 ist der name (String) des Spielers der den schauen Befehl ausgeführt hat. if(arg1 == null) try { sendeAenderungenAnAlle(); } catch(RemoteException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } el...
9c208b64-3818-403e-b1c6-72c12de8bda8
9
@Override public void keyPressed(KeyEvent e) { // this.editor.textPane.setText(""); // this.editor.textPane.setText(""+e.getKeyCode()); if(e.getKeyCode() == 17) this.editor.strgPressed = true; else if(this.editor.strgPressed && e.getKeyCode() == 120) th...
16a84199-93d6-4a90-95b3-03a56f2f6d2d
4
private Message collectMessageFromR(int r) { while (true) { if (isSuspect(r)) { // r is been suspected, no need to block any further return null; } // try to receive the message synchronized (valMessages) { if(valMessages.containsKey(r)){ return valMessages.get(r); } } try { ...
2837f29c-e4fa-40d9-b6aa-48fc9bb6a158
1
private void resetLabels() { for (JLabel label : labels) { //label.setBorder(BorderFactory.createLineBorder(Color.white)); label.setFont(new java.awt.Font("Tahoma", 0, FONT_SIZE)); label.setMaximumSize(LABEL_SIZE); label.setMinimumSize(LABEL_SIZE); lab...
65d25e3a-8adc-4b5f-8460-aa3b2ed855f4
2
public void adjustWater() { for(Molecule mole : getMolecules()) if(mole instanceof Water) mole.setScale(((temp-250)/200.0)*20.0+1); }
e95ffa67-171e-4584-a485-865cdc0087f1
2
@Override public void execute(Game game, HashMap<String, String> strings, Entity target) throws ScriptException { if (game.getPlayer().menuOpen) { System.out.println("What?"); } else { PokedexPage p = PokedexPage.newMenu(game, game.getWorld(), Pokemon.getPokemon(parseString(args[0], strings))); game.getPl...
93f65fa9-93d7-4aa4-8a31-3b5e16a1c7fe
9
public void startWithComputer() { System.out.println(WELCOME_MESSAGE); gameField.showField(); int maxMoves = (int)Math.pow(gameField.getFieldSize(),2) + 1; while(!gameField.checkWin() && move != maxMoves) { if (move % 2 != 0) { int x = requestX(); ...
fe1cadb4-556f-4dac-8b8a-d555ed0d2338
1
public ArrayList<ArrayList<Integer>> pathSum(TreeNode root, int sum) { if (root == null) return res; Stack<Integer> stk = new Stack<Integer>(); stk.push(root.val); pathSumRec(root, sum, stk); return res; }
b258001c-4449-423f-bd8f-d54a595191b2
3
public void setDestination(Teleporter destination) { if (destination == null || destination == this) throw new IllegalArgumentException("The given Teleporter is invalid!"); if (this.destination != null) throw new IllegalStateException("Destination is already set!"); this.destination = destination; }
0e2ddb4f-9b44-4dce-bf7e-cb338ee75a02
5
@Override public void updateRecord() { comps = null; byte[] first = firstPtg.getRecord(); byte[] last = lastPtg.getRecord(); // KSC: this apparently is what excel wants: if( wholeRow ) { first[5] = 0; } if( wholeCol ) { first[3] = 0; first[4] = 0; } // the last record has an extra ident...
2fb76565-7634-4af4-b780-249de9a670f8
1
private boolean jj_3R_49() { if (jj_3R_61()) return true; return false; }
3dbebb39-f387-4bcd-a2fd-b541711c63cb
3
@Override public void actionPerformed(ActionEvent e) { OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(); OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode()); if (textArea == null) { return; } Node node = textArea.n...
454c6c81-3f9f-45c8-9880-77ec246778d5
2
public void draw(Graphics g) { switch (gamestate) { case 0: menu.draw(g); break; case 1: world.draw(g); break; default: break; } g.drawImage(cursor, Keyboard.getMouseX() - 8, Keyboard.getMouseY() - 8, null); }
bbe6c39a-c39a-441d-93e2-089caa41356f
8
public static Matrix multiply(Matrix matrixA, Matrix matrixB) throws IllegalSizesException, MatrixIndexOutOfBoundsException, IncorrectFormatOfData { Matrix matrixC = null; int rowsA = matrixA.getRowsCount(); int colsA = matrixA.getColsCount(); int rowsB = matrixB.getRowsCou...
7bee4b51-4522-4f40-a610-98a5f8b825b5
3
private int readBytes(byte[] b, int offs, int len) throws BitstreamException { int totalBytesRead = 0; try { while (len > 0) { int bytesread = source.read(b, offs, len); if (bytesread == -1) { break; } totalBytesRead += bytesread; offs += bytesread; len -= bytesread; }...
7ccf8536-92da-4cea-a259-ba65b97eb441
1
public Color getColorForDisk(int num) { try { byte[] bytesOfMessage = String.valueOf(num).getBytes(); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] d = md.digest(bytesOfMessage); return new Color((int)d[0] + 128, (int)d[1] + 128, (int)d[2] + 128)...
6c0f9231-00a5-4d0c-b80e-486e125538c7
6
public String getPrecisionAff() { // On renvoie des mots compréhensibles (en fonction des infos données sur le site officiel) switch (this.precision) { case "3": return "Très bonne"; case "2": return "Bonne"; case "1": r...
f3e3597e-2adb-4e98-969c-245cff829709
3
private void showP(File file) { try { p = DataIO.properties(new FileReader(file), "Parameter"); List<String> dims = DataIO.keysByMeta(p, "role", "dimension"); List<String> dims2d = DataIO.keysForBounds(p, 2); dimCombo.removeAllItems(); dimCombo.addItem...
0eb55008-3b71-4741-a0be-86fb88d8ad26
3
public static JSONObject toJSONObject(String string) throws JSONException { String n; JSONObject o = new JSONObject(); Object v; JSONTokener x = new JSONTokener(string); o.put("name", x.nextTo('=')); x.next('='); o.put("value", x.nextTo(';')); ...
ac3780df-eb38-44f2-b3d7-81fc1f9ada6f
0
public void setThirdCorner(Rectangle thirdCorner) { this.thirdCorner = thirdCorner; }
3b9e292c-efda-40de-9008-7e3d777bdd68
1
public void testToStandardMinutes_overflow() { Duration test = new Duration(((long) Integer.MAX_VALUE) * 60000L + 60000L); try { test.toStandardMinutes(); fail(); } catch (ArithmeticException ex) { // expected } }
49bdaa36-d3ca-410d-8390-2fb964693a5a
6
@Deprecated public static void loadLevel(String title, GameContainer gc) throws SlickException { nodes = new ArrayList<Node>(); wires = new ArrayList<Wire>(); Scanner scan = new Scanner(Level.class.getClassLoader().getResourceAsStream("levels.dat")); // find header for level String next; do { next =...
0dd2200e-a8b2-46a6-9094-46d6acc5722c
0
public Stack() {}
778df793-98aa-47e3-a7a3-73a9e8bf022d
3
@Override public void run(){ Random random = new Random(); driveTime = 0; startTime = System.currentTimeMillis(); for(int i = 0; i < laps; i++){ int lapTime = random.nextInt(100); driveTime += lapTime; try { Thread.sleep(lapTime); } catch (InterruptedException e) { interrupt(); crashed ...
09445400-1946-4ca1-9877-be54843ec852
9
public void getAlternateLabel(StringBuffer s) throws Exception { //StringBuffer s = new StringBuffer(); FastVector tmp = (FastVector)m_ranges.elementAt(0); if (m_classObject != null && m_training.classAttribute().isNominal()) { s.append("Classified by " + m_classObject.getClass()...
9e3e5477-8015-4a2b-a3e5-a39cd91576e7
8
@Override public Result findSimilarTo(Signal signal) throws RemoteException { boolean finished = false; while (!finished) { waitForBalacing.acquireAndRelease(); receivedSignals.incrementAndGet(); if (channel.isConnected()) { List<Future<Result>> futureResults = new ArrayList<>(); List<Res...
c6c577b4-0e95-493a-b59b-eaa55dc32da1
1
public SynthesisFilter(int channelnumber, float factor, float[] eq0) { if (d==null) { d = load_d(); d16 = splitArray(d, 16); } v1 = new float[512]; v2 = new float[512]; samples = new float[32]; channel = channelnumber; scalefactor = factor; setEQ(eq); //setQuality(HIGH_QUALI...
e44e7d01-b428-493e-813c-54f323e703f7
8
public void update() { up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W]; down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S]; left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A]; right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D]; if (up) direction = 0; else if (right) direction = 1; else if (down)...
fda0a590-4f34-49d3-b572-c014c9423cc7
5
public String request(String method, String path, Response data, Map<String, String> options) { HttpURLConnection connection = null; String answer = null; try { StringBuffer sb = new StringBuffer(); sb.append("?api_key=" + apiKey); if(method.equals("GET")) { sb.append(prepareGet(data)); } ...
6f658891-0a41-4ce7-827f-3e9158526670
5
private FloatingPoint getOperatorValue(TokenOperator token, FloatingPoint[] values) { FloatingPoint floatingPoint = null; // TODO Implement new way to caculate floating point number without // using Float String original = token.getOriginal(); float value = 0.0f; if (original.equals("*")) { value = ...
cf3cae5c-4539-40d3-9998-95c1fa4a2675
1
protected void setHandler(Handler handler){ if (handler==null) this.handler=new DefaultHandler(); else this.handler=handler; }
e5be1847-4683-49ae-bc9a-73eb426e922d
3
public static ArrayList<String> getVoteSummary(Proposal proposal) { // Create an index of options -> numVotes Map<Integer, Integer> voteCount = new HashMap<Integer, Integer>(); VoteModel voteModel = new VoteModel(); for (Integer i : proposal.getVotes()) { Vote vote = (Vote) ...
05cb36d3-3d54-4b1b-aba7-af45b5246203
0
public CheckResultMessage checkL1(int day) { return checkReport.checkL1(day); }
0f58e97d-19e0-4c88-a984-634791312ce3
5
private static int converterComando(String cmd) throws Exception { cmd = cmd.toLowerCase(); if (cmd.equals("mover")) return 1; if (cmd.equals("olhar")) return 2; if (cmd.equals("atacar")) return 3; if (cmd.equals("largar")) return 4; if (cmd.equals("pegar")) return 5; throw new Exception("C...
b6cb3189-5e06-4460-aa29-3734d833219f
2
private static Box initialize() { Box[] nodes = new Box[7]; nodes[1] = new Box(1); int[] s = {1, 4, 7}; for (int i = 0; i < 3; ++i) { nodes[2] = new Box(21 + i); nodes[1].add(nodes[2]); int lev = 3; for (int j = 0; j < 4; ++j) { ...
4938e52a-b78e-4da8-a6e7-7daab2799981
3
public ByteBuffer readBuf() { ByteBuffer buf = readBuf; buf.flip(); buf.position(readPos); if (buf.remaining() == 0) { if (bufs.isEmpty()) { // There's nothing to read, so we won't return this buffer. // We can clear it just in case... readBuf.clear(); readPos = 0; return null; } else ...
551be72b-4b3e-436f-becd-dcc4c50a8c46
0
public void advice(String msg) { System.out.println("Called ..." + LoggerUtils.getSig() + "; msg:" + msg); }
54abe347-da5f-48dd-a586-cae8f0c0f6f2
2
public void mouseDown(MouseEvent e) { if(e.getButton() == e.BUTTON1) { for(UIContent content : Contents) { content.contentMouseDown(e); } } }
73f3b504-9912-46a6-8865-2324a6d11612
4
@Override public Value run(CodeBlock b) throws InterpreterException { if (args_ != null || getArgsNumber()==0) { Value[] vals = new Value[getArgsNumber()]; for (int i = 0; i < vals.length; i++) { vals[i] = args_[i].run(b); } try { Value v = function_.evaluate(vals); return v; } catch (Exce...
20ed082b-f679-4881-8219-6688b8e2c04b
5
protected String processTmplFile(File inFolder, File file) throws IOException { final String template = FileUtils.readFileToString(file); Map<String, String> parameters = new HashMap<>(); Map<String, String> dependencies = listReferencedFiles(template); Map<String, String> imagesDepend...
677c7e3c-f9c1-4f5a-8f59-a9e0a71ee661
8
protected void createDdlProcedure(Connection connection2) { BufferedReader br = null; try { StringBuilder sql = new StringBuilder(); FileReader fr = new FileReader("rev_tbl.sql"); br = new BufferedReader(fr); String line = null; Statement statement = connection.createStatement(); while ((line = br...
f1167501-82c9-4269-8d7a-91892d5f4855
3
public void convertToSlopeIntersect(){ if (_y == 0){ if (_x != 1){ _c /= _x; _x = 1; } } else if (_y != 1){ _x /= _y; _c /= _y; _y = 1; } }
0a20e742-693e-4e38-9a42-1d1d1aec9b76
2
public void randomPrefabFromFile(int x, int y) throws IOException{ String path = "data/houses.pfl"; FileInputStream in = new FileInputStream(path); Random rand = new Random(System.currentTimeMillis()); int cPrefabs = in.read(); long skip = rand.nextInt(cPrefabs); skip = (skip * 24 * 24) + (skip * 2); ...
5a3d6395-181f-4102-8e34-0708c32cf805
4
void updateAnsSet(String s, int a, int b) { for (int i = 0; i < checkSet.length; i++) { if (!checkSet[i]) { continue; } if ((getA(s, answerSet[i]) != a) || (getB(s, answerSet[i]) != b)) { checkSet[i] = false; } } }
fa94b994-a7f8-40cb-9c06-313aef57d36f
9
public static String getIpAddr() { HttpServletRequest request = BaseAction.getHttpServletRequest(); String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "u...
56d6899b-4d42-453d-8270-aececb7fce6b
8
public static void OPNB_ADPCM_CALC_CHA( YM2610 F2610, ADPCM_CH ch ) { int/*UINT32*/ step; int data; ch.now_step += ch.step; if ( ch.now_step >= (1<<ADPCM_SHIFT) ) { step = ch.now_step >> ADPCM_SHIFT; ch.now_step &= (1<<ADPCM_SHIFT)-1; /* end check */ if ( (ch.now_addr+step) > (ch.end<<1) ) { ch.flag = ...
b0b627e0-1fd9-42c2-a8b3-32a20413dc97
1
public String getItemTypeName() { String n = ""; if(itemType != null) { n = itemType.getName(); } return n; }
a9abad06-91c4-4b4c-8ba9-ebdd4a50fdc4
7
public static java.util.List<Puntaje> leer(int numerDeDiscosDeseado, boolean porMovimientos) { BufferedReader br = null; FileReader fileWriter = null; File file; java.util.List<Puntaje> puntuaciones = new LinkedList<Puntaje>(); try { file = new File(RUTA); ...
f9d41bdd-7c8e-4d44-b230-c67f20f43b5c
2
public static void saltar() { file = new File("."); ruta = file.getAbsolutePath(); Thread hilo = new Thread() { @Override public void run() { try { Thread.sleep(1); FileInputStream fis; Player pla...
a04618d8-faac-4cef-8aeb-27c6fcd672aa
2
private static ArrayList<Score> createScores(String scores) { if(scores == null) { return null; } ArrayList<Score> list = new ArrayList<Score>(); String[] scoreList = scores.split(";"); for(String s : scoreList) { String[] s2 = s.split(":...
75277fe8-22ff-405d-ab9a-63398be57723
4
public static void main(String[] args) { final String path = "C:\\Users\\Ferium\\Documents\\NetBeansProjects\\Netlife\\src\\Files\\sample.txt"; // Checks boolean tests from the Units class boolean test1 = Units.CheckGetCommandList(path); System.out.println("Test 1: " + test1); ...
3022bc8d-424d-469c-866b-dbf578e97138
3
public FileAttribute getFileAttribute(String lfn) { // check first int rcID = getReplicaCatalogueID(); if (rcID == -1 || lfn == null) { return null; } int eventTag = DataGridTags.CTLG_GET_FILE_ATTR; FileAttribute fAttr = null; // sends a request ...
97687c6c-efc1-4d5d-8e98-7bfeb09e9924
7
public static void main(String[] args) { // Create Display try { Display.setDisplayMode (new DisplayMode(800, 600)); Display.create (); Display.setTitle("Hello!!"); } catch (LWJGLException ex) { Logger.getLogger(LWJGL_Example2.cl...
fd80d109-acef-4e9a-95a8-29c1b48a491e
5
protected final Archive createArchive() throws Exception { ProtectionDomain protectionDomain = getClass().getProtectionDomain(); CodeSource codeSource = protectionDomain.getCodeSource(); URI location = (codeSource == null ? null : codeSource.getLocation().toURI()); String path = (location == null ? null : locat...
d840b16b-e60e-4d9f-b5d8-50d3f9e8baf4
0
@Test public void findHandFromCardSet_whenThreePairsExist_returnsHighestTwoPair() { Hand hand = findHandFromCardSet(twoKingsTwoQueensTwoJacksSix()); assertEquals(HandRank.TwoPair, hand.handRank); assertEquals(Rank.King, hand.ranks.get(0)); assertEquals(Rank.Queen, hand.ranks.get(1)); assertEquals(Rank.Jack, ...
6daefc1f-f80c-4759-8a94-d81452b62fc7
7
private static TileFlip extractFlipRaw(long item) { long t = item; if (isSet(t, true, true, true )) return TileFlip.HVD; else if (isSet(t, true, true, false )) return TileFlip.HV; else if (isSet(t, true, false, true )) return TileFlip.HD; else if (isSet(t, true, false, false )) return T...
a4aa2e45-8ecc-4f8e-8806-91211c9f24aa
4
@Override @Execute public void postLogic(IChassis chassis) { if(!GL11.glGetBoolean(GL11.GL_TEXTURE_2D)) GL11.glDisable(GL11.GL_TEXTURE_2D); if(this.camera != null) this.camera.applyMatrices(); Iterator<GUIElement> it = this.guiElements.values().iterator(); while(it.hasNext()) { GUIElement element = it.nex...
66871417-3420-465b-a510-9bba357fc507
5
public Map<Integer, Integer> rand() { int[] tem = new int[MAX]; boolean b; for (int key = 0; key < MAX; key++) { b = true; int element = (int) (Math.random() * MAX + ONE); for (int t = 0; t < MAX; t++) { if (element == tem[t] && key > 0) { key = key - 1; b = false; } } if (b) { ...
df33d1a7-3b69-4144-b1b4-9d99e8a59e04
6
private void jButtonOpretKundeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpretKundeActionPerformed String fornavn = jTextFieldFornavn.getText(); String efternavn = jTextFieldEfternavn.getText(); String navn = fornavn + " " + efternavn; String adresse = jTe...
104aacf5-c2c2-476f-95ce-19ff685e5e47
9
final int method2571(int i, int i_48_, int[] is, String string, int i_49_, int i_50_, RasterToolkit[] class105s, int i_51_, int i_52_, Random random) { try { anInt4047++; if (string == null) return 0; random.setSeed((long) i_48_); int i_53_ = (random.nextInt() & 0x1f) + 192; method25...
428e2c0c-f9a6-4c34-a6cb-14a62430f253
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...
c8f7abf6-dad3-4dde-8533-464bd1c8f003
5
@Override public void run() { double time = System.currentTimeMillis(); try { isDrawing.acquire(); } catch (InterruptedException ex) { Logger.getLogger(RedrawRoutine.class.getName()).log(Level.SEVERE, null, ex); System.exit(...
33127b98-0816-49a9-b6f8-521a954e1ce0
8
private static String date_format(double t, int methodId) { StringBuffer result = new StringBuffer(60); double local = LocalTime(t); /* Tue Oct 31 09:41:40 GMT-0800 (PST) 2000 */ /* Tue Oct 31 2000 */ /* 09:41:40 GMT-0800 (PST) */ if (methodId != Id_toTimeString) { ...