method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
141cabec-a8cc-4710-8fa7-403dd7824299
0
public void keyTyped(KeyEvent e) { // make sure the key isn't processed for anything else e.consume(); }
3377f670-0f2d-463c-beda-e1336cefba06
9
public static boolean isValueCode(char ch) { return ch == '@' || ch == ':' || ch == '%' || ch == '+' || ch == '#' || ch == '<' || ch == '>' || ch == '*' || ch == '/' ...
df58768d-92c0-4dce-95f6-2d7dfbac0f0b
2
static byte[] hex2Bytes(String s) { if ((s.length() & 1) != 0) { throw new IllegalArgumentException("String length must be even: " + s.length()); } byte[] buf = new byte[s.length() / 2]; for (int index = 0; index < buf.length; index++) { final int stringIndex = ...
05d592c2-98eb-451d-95fe-70fcc01c41ab
9
private void checkEventTime(AWTEvent event, long currTime, long startTime) { long currProcessingTime = currTime - startTime; if (currProcessingTime >= this.thresholdDelay) { System.out.println("Event [" + event.hashCode() + "] " + event.getClass().getName() + " is taking too much time on EDT (" + currP...
4eefdae0-c355-43b2-b320-e486ccb71fab
0
public void addEffMult(double f) { this.setEffMult(this.getEffMult()+f); }
8a95b802-ada1-4fcf-b463-d26203009f8c
4
public void nextQuestion() { for(Component button : panel.getComponents()) { panel.remove(button); } try { Integer nbOfKanjis = 4; Condition conditionRandom = Settings.UsePondaration ? new Condition(Criterias.SELECT_RANDOM, nbOfKanjis) : new Condition(Criterias.SELECT_RANDOM_PONDARATED, nbOfKa...
ee2f8912-e3ce-4f55-8e3f-3f836a307505
7
public void moveAnt() { this.setAge(this.getAge() + 1); if (movement > 50) { movement = 0; advancingOnX = getRandomBoolean(); advancingOnY = getRandomBoolean(); randomNumX = rand.nextInt(3); randomNumY = rand.nextInt(3); } if (advancingOnX) { if (!this.collisionX_MAX(terrainWidth, this.getX()...
db944102-771d-4ad4-bd6f-563ae388bbc9
7
public OpenHouse getOpenHouse() { OpenHouse current = current_house.get(); if (current != null) { return current; } final Iterator<OpenHouse> iterator = openHouses.iterator(); final long timeBounds = System.currentTimeMillis() - nextTimeBounds; while (iterator.hasNext()) { final OpenHouse house = it...
941f09df-04a8-4f76-b239-98dcebd90c15
4
private ResGridlet cancel(int gridletId, int userId) { ResGridlet rgl = null; // Find in EXEC List first int found = gridletInExecList_.indexOf(gridletId, userId); if (found >= 0) { // update the gridlets in execution list up to this point in time upd...
b67407b3-8ce0-4b2e-b664-99f7cc4bcbc0
5
public boolean pieceAllowed(final Piece piece) { return !isFull() && piece.getType() >= 0 && piece.getType() <= 4 && pieces[piece.getType()] == null && (piece.getType() != 4 || isEmpty()); }
4daaded3-084b-470a-b79a-fe86f0c33ae7
7
public void updatePosition() { if (xPos < xDestination) xPos++; else if (xPos > xDestination) xPos--; if (yPos < yDestination) yPos++; else if (yPos > yDestination) yPos--; if (xPos == xDestination && yPos == yDestination &...
20464ef0-ccde-43ec-a472-67fab57778cf
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Secao other = (Secao) obj; if (!Objects.equals(this.id, other.id)) { return false; } ...
c73c6554-2ad9-4a84-9def-0e593ff6d9a8
6
private List<FileObfuscationStructure> generateProjectFileObfuscationList () { List<FileObfuscationStructure> result = new ArrayList<FileObfuscationStructure>(); for (File file : projectFiles) { if (file.isFile()) { String fileExtension = McbcFileUtils.getFilenameExtension(file.getName()); if (Constant...
097b4d41-bb00-453d-90d8-53cbcf9733c2
2
public static int parseDataTransferRate(String value) throws ParseException{ Pattern p = Pattern.compile("\\s*(((?<mb>[1-9][0-9]*)\\s*(Mbps)?)|((?<gb>[1-9](\\.[0-9]+)*)\\s*Gbps))\\s*"); Matcher m = p.matcher(value); if (m.matches()){ String mb = m.group("mb"); String gb = m.group("gb"); if (null !...
e074e08c-8cd1-431a-a48f-5bc16e9b801b
9
@EventHandler(priority = EventPriority.MONITOR) public void onBlockPlace(BlockPlaceEvent event) { Player player = event.getPlayer(); String playername = player.getName(); World world = player.getWorld(); String worldname = world.getName(); Boolean staff = false; int x = event.getBlock().getLocation().get...
257c86f5-e4bc-4b34-aa21-1b156d27222b
1
public void dumpStackLocalInfo() { for (Iterator iter = bytecode.getInstructions().iterator(); iter .hasNext();) { Instruction instr = (Instruction) iter.next(); System.err.println("" + instr.getTmpInfo()); System.err.println(instr.getDescription()); } }
67fdb4e6-9a94-4078-8836-f7226b8688c6
3
public static void main(String[] args) { int initWidth, initHeight; if (args.length == 2) { try { initWidth = Integer.parseInt(args[0]); } catch (NumberFormatException e) { initWidth = 28; } try { initHeight = Integer.parseInt(args[1]); } catch (NumberFormatException e) { initHeight =...
ac833f38-7da4-4875-9e08-4d28e4e6500a
0
public int getAxisValue(int index) { return mapValue(axesValue[index], -1, 1, 0, 255); }
3f7ea035-b642-4395-8170-5ef85cbdc763
7
public void interact(Particle p) { if (contains(p.rx, p.ry)) { if (viscosity > Particle.ZERO) { double dmp = MDModel.GF_CONVERSION_CONSTANT * viscosity / p.getMass(); p.fx -= dmp * p.vx; p.fy -= dmp * p.vy; } if (reflection) { if (p instanceof Atom) internalReflection((Atom) p); } }...
0c374960-baaf-4ad3-9413-b985baf2e306
4
private void close() { try { if (rs != null) { rs.close(); } if (statement != null) { statement.close(); } if (conn != null) { conn.close(); } } catch (SQLException e) { th...
6996219f-9442-42d1-86d5-869408ae5b31
0
@Test public void testGetS1() { System.out.println("getS1"); PickUp instance = new PickUp(6,9); int expResult = 6; int result = instance.getS1(); assertEquals(expResult, result); }
9ac207e8-c48a-466a-b39f-1f68774985b6
3
public void bindThumbnailTexture(Minecraft var1) { if(this.texturePackThumbnail != null && this.texturePackName < 0) { this.texturePackName = var1.renderEngine.allocateAndSetupTexture(this.texturePackThumbnail); } if(this.texturePackThumbnail != null) { var1.renderEngine.bindTexture...
b07755c1-aa8b-4f12-88f7-8bc7b33c9238
6
private void buildTable() { tableContents = new HashMap<String, Map<String, Integer>>(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(new File(fileName))); } catch (final FileNotFoundException e) { System.out.println("Cou...
9cce1e67-994b-41eb-b9ba-46df1f8ced74
8
public void getPayload () { int code = -1; while (code != 7) { System.out.print("1. Armazenar um item no inventário\n" + "2. Equipar um item\n" + "3. Desequipar um item\n" + "4. Modificar um item\n" + "5. Descar...
48102a7d-dda4-401a-829e-24c26b668fbd
8
public static void main(String[] args) { SimpleBusiness simpleBusiness = new SimpleBusiness(); // The following pre-generated code demonstrates how you can // use StickyWeb's EditableCache to create data files. try { // First, you create a new EditableCache, possibly passing in an // existing cache to ad...
0363977b-4c79-4e4e-baee-63690b4e832f
3
public void setReference(String name, int type , String reference, String key) { if ((type != ElementType.TYPE_REFERENCE) && (type != ElementType.TYPE_REFERENCE_ARRAY) && (type != ElementType.TYPE_BACK_REFERENCE)) { throw new RuntimeException("Illegal type: " + type); } types.put(nam...
ebd60682-f47f-46ca-b1f1-e9899ce3f24a
1
public String printWrongLetters() { StringBuilder result = new StringBuilder(); result.append("Wrong Letters: "); for (int i = 0; i < wrongLetters.size(); i++) { char temp = wrongLetters.get(i); result.append(temp); } return result.toString(); }
46d8784e-41d7-4134-80c3-c20fbda7a343
6
public void fight(Character character, Monster creature, Scanner console) { int monsterHealth = creature.getHealth(); boolean run = false; while (monsterHealth > 0 && character.getHealthCurrent() > 0 && run == false) { char action = action(console); if (action == 'a') { monsterHealth -= character.attack...
c7aeb8cf-4959-4210-9972-47df5be3b692
7
public String toInitString(){ StringBuilder sb = new StringBuilder(); for(int i=0;i<1;i++){ for(int j=0;j<4;j++){ for(int k=0;k<3;k++){ for(int l=0;l<3;l++){ for(int n=0;n<2;n++){ sb.append(String.format("%.3f ", chanceRaise[i][j][k][l][n])); } for(int m=0;m<3;m++){ f...
534efb33-ec02-4293-ab26-187a4447998c
4
public SingleTreeNode egreedy() { SingleTreeNode selected = null; if(m_rnd.nextDouble() < egreedyEpsilon) { //Choose randomly int selectedIdx = m_rnd.nextInt(children.length); selected = this.children[selectedIdx]; }else{ //pick the bes...
0f22a5b9-6e59-44ba-b617-ada28643c882
0
@Override public void doAction() { StateManager.getInstance().setState(new TimeIsRunningOut(null)); startGame(); }
480b2390-248e-4881-98f2-20b1b0ccf1c3
2
public void firstDFSwithReversedG() { for (int fromNode = 0; fromNode < totalNumNodes; fromNode++) { // if not explored then go ahead, otherwise break if (!nodesStatus.get(fromNode)) { DFSforReversedG(fromNode); } } }
faf586b6-591f-406a-bfa1-ddbda1b21ee8
0
@Column(name = "PCA_SUBGRU") @Id public Integer getPcaSubgru() { return pcaSubgru; }
f0c6b8db-52ba-473a-9f9d-ef7bb14d7dd8
9
public int checkVolatileUp(int a_x, int a_y, Vector<Enemy> a_enemies, Vector<Item> a_items) { int numCoins = 0; int i = a_y; boolean end = false; int currentBlockIndex = (int)(a_x / MAP_BLOCK_LENGTH); int currentXInBlockIndex = (int)(a_x % MAP_BLOCK_LENGTH); while(!...
b7c1afe2-1ee8-4029-b064-502043c860d7
9
public int writeLongS (long value, boolean optimizePositive) throws KryoException { if (!optimizePositive) value = (value << 1) ^ (value >> 63); if (value >>> 7 == 0) { require(1); niobuffer.put((byte)value); position += 1; return 1; } if (value >>> 14 == 0) { require(2); niobuffer.put((byte)(...
5f2a0791-70df-45b7-a3d2-0b47c2ec4348
3
public void eventcheck(String EventName, Player playername){ config = plugin.getConfig(); File PLog = new File (plugin.getDataFolder() + ("tempPlayers.yml")); FileConfiguration players = YamlConfiguration.loadConfiguration(PLog); String Event = (String) players.get("EventType"); if(Event == null){ playe...
fcbaa900-0a61-416e-9c62-4582b8c384ad
9
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (accessLevel != user.accessLevel) return false; if (id != user.id) return false; if (login != null ? !login.eq...
5f37791e-5d48-433e-8b9d-8622f57abb49
1
public void drawPerspective(Graphics g) { for (int i=0; i < edges.size(); i++) { edges.get(i).drawPerspective(g); } }
456f0c0d-f3b4-447a-bfbd-7c4d94708b6c
1
public void printDebug() { System.out.println("dummy:" + closed); System.out.println("tcycl:" + writeIndex); System.out.println("tnum:" + buffIndex); System.out.println("writer:" + isWriter); System.out.println("ioerror:" + hasIOError); try { System.out.println("available:" + available()); } catch (IOE...
d98dbe88-3174-49e6-80a2-ffb76bfd7fca
1
public void sendMsg(InetAddress addr, byte[] msg) { System.out.println("sendMsg to " + addr); try { DatagramPacket packet; packet = new DatagramPacket( msg, msg.length, addr, port ); datagramSocket.send( packet ); } catch (IOException e) { e.printStackTrace(); } }
e2093b97-2ebe-4389-bb68-50e12660dd0a
4
@Override public void connectToHost(final String hostname, final int port) { if(client != null) { // This will have to do until I find a more final solution... client.shutdown(); client = new Client(); } new Thread(new Runnable() { public void run() { try { gui.getLoginWindow().setServerStat...
6aa2ed8c-9e7a-4164-bbe4-9f439f743045
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; IvyPackageKey other = (IvyPackageKey) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)...
00aca790-abbd-4224-9f83-c42cd8a14161
5
public static void setColumnAndRowHW( HSSFRow hssfrow ,HSSFCell cell ,String [][]attr) { for(int x=0;x<attr.length;x++) { if("height".equals(attr[x][0])&&(!"".equals(attr[x][1]))) { String height = attr[x][1]; hssfrow.setHei...
d1ab7029-3356-4081-9ccc-67b02fa87e85
8
@Override public void evaluateClustering(Clustering clustering, Clustering trueClustering, ArrayList<DataPoint> points) throws Exception { this.points = points; this.clustering = clustering; numPoints = points.size(); numFClusters = clustering.size(); numDims = points.get(0)...
3556c547-3491-498b-9776-86b9f27739d6
3
public Integer getMatchName(String matchvalue) { if (this.getMatchSring().equals(matchvalue)) { return string_name; } if (this.getMatchNum().equals(matchvalue)) { return num_name; } if (this.getMatchOperacion().equals(matchvalue)) { return oper...
67510e46-973c-4b68-8614-6b42f82c9b7e
8
@Override public void setStat(String code, String val) { if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0) CMLib.coffeeMaker().setGenItemStat(this,code,val); else switch(getCodeNum(code)) { case 0: setPowerCapacity(CMath.s_parseLongExpression(val)); break; case 1: activate(CMath.s_bool(val));...
8a0ad65f-72b7-4bab-b84e-c74dd939dc48
2
public MenuItem getProductUiItem() { if (productUiItem == null) { productUiItem = new MenuItem("Show Product UI"); productUiItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Dimension dimension = Toolkit.getDefaultToolkit() .getScreenSize(); ...
0698c427-d9b6-492e-866c-92b97915fc05
7
@Override public void executeMsg(Environmental host, CMMsg msg) { if((affected instanceof Armor)&&(msg.source()==((Armor)affected).owner())) { if((msg.targetMinor()==CMMsg.TYP_REMOVE) ||(msg.sourceMinor()==CMMsg.TYP_WEAR) ||(msg.sourceMinor()==CMMsg.TYP_WIELD) ||(msg.sourceMinor()==CMMsg.TYP_HOLD) ...
616dae4c-c597-4caf-9402-eeb6e0b92fae
2
public void update(Stage stage) { for(int x = 0; x<actions.size(); x++) { actions.get(x).update(stage); } for(int x = 0; x<textboxes.size(); x++) { textboxes.get(x).update(stage); } }
8da27d85-ea65-4beb-a924-98196068ed03
5
private void btnGenerateReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateReportActionPerformed JFileChooser newChooser = new JFileChooser(); int chooserResult = newChooser.showSaveDialog(this); switch(chooserResult) { case JFileCh...
b69fcd9c-b7c7-4e4b-aa49-1399c81d0854
2
protected String getLine(int index) { if ((index < 0) || (index > this.uiFileLines.size())) { IllegalArgumentException iae = new IllegalArgumentException("The index must not be sub zero!"); Main.handleUnhandableProblem(iae); } return this.uiFileLines.get(index); }
b9033a48-7069-40f8-a611-73c44c5cc117
6
public TreeNode buildTreeRec(int[] preorder, int[] inorder, int s1, int e1, int s2, int e2) { if(e1 == s1 && s2 == e2) return new TreeNode(inorder[s2]); if(preorder[s1] == inorder[s2]){ TreeNode root = new TreeNode(preorder[s1]); TreeNode right = buildTreeRec(preorder, inorder, s...
c603f2b8-a444-4382-9d80-e45c97f45ddf
0
@Override public Balance Accesscreate() { return Balance.create(); }
6da5871e-a12e-4a9f-b5f2-1ae3fd459654
4
public static NbtCompound fromStream(InputSupplier<? extends InputStream> stream, StreamOptions option) throws IOException { InputStream input = null; DataInputStream data = null; boolean suppress = true; try { input = stream.getInput(); data = new DataIn...
4020a134-7c5f-4d72-aae5-d270b0f1c06e
7
void processNodes(RsNavLink navLink) throws RsParsingException { String [] nodeString = new String[2]; RsNavNode [] node = new RsNavNode[2]; for(int i=0; i<2; i++){ RsToken token = nextToken(); if(token.getType()!=RsToken.TT_IDENTIFIER) throw token.gripe("Invalid...
3f2f8afd-fdde-4d65-9b93-4d9cb94c296f
9
public void renderScene(Location[] locations) { JLabel Header = new JLabel(player.getLoc().toString()); Header.setForeground(Color.GREEN); Header.setBounds(0, 0, 400, 100); this.add(Header); for (int j = 0; j < locations.length; j++) { Location loc = locations[j]; JLabel p; i...
8da15ad5-7721-4fe5-a73b-f9c043b3bdd1
6
public boolean getBoolean(String key) throws JSONException { Object object = this.get(key); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String)object).equalsIgnoreCase("false"))) { return false; } else if (object.equals(Boolean.T...
3a76948b-7a58-4d01-aeb6-4c53ab444eaf
0
public GameEvent(int points) { this.points = points; }
957c9f15-755b-4903-8e7a-02bcf26ee10d
1
public static int[] fillRandomInt(int length, int min, int max, int count) { int[] array = new int[length]; for (int i = 0; i < array.length; i++) { array[i] = (int) random(min, max, count); } return array; }
348cea34-83a0-4659-8760-016ce759147d
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...
f5b7231f-c65d-4674-a9f4-f38d8fd7d2d6
8
public void outputGraph(String fileNameLocalIndexes, String fileNameTrueIndexes) throws Exception{ //get nodes with edges HashSet<Integer> nodesWithEdges = new HashSet<Integer>(); for(int i : this.graph.keySet()){ for(int j : this.graph.get(i).keySet()){ nodesWithEdges.add(i); node...
819fb4d4-91b8-4601-9e80-fc1fb5062eea
3
public void paint(GC gc, int width, int height) { Device device = gc.getDevice(); if (image == null) { image = example.loadImage(device, "maze.bmp"); } // draw maze Rectangle bounds = image.getBounds(); int x = (width - bounds.width) / 2; int y = (height - bounds.height) / 2; gc.drawImage(image, x, y); /...
acebf1fb-d2b4-4211-9211-5b5d257d65bf
0
public long getId() { return Id; }
ec925e71-5d67-49a0-b21d-967b0f9f6e88
6
public String sendMessage(String senderName, String recipient, String message) { // // If recipient is "ALL", then broadcast this message // if (recipient.equals(StringDefs.ALL)) { if (broadcastMessage(senderName, message, false)) return (""); else return (null); } else if (recipient.equals(S...
2e60c112-d321-4dc5-b49a-206b940ea963
8
static public boolean showFile(Object obj) { File f = coerceFile(obj); if (f == null) { return false; } else if (!f.isDirectory()) { if (WIN) { try { Process proc = Runtime.getRuntime().exec("explorer /root," + f.getAbsolutePath()); ...
0749c74c-9aa8-483e-90fc-ddd250996530
6
public boolean checkEmptySpace(Rectangle rect) { int fromTileX = pixelsToTiles(rect.getMinX()); int fromTileY = pixelsToTiles(rect.getMinY()); int toTileX = pixelsToTiles(rect.getMaxX() - 1); int toTileY = pixelsToTiles(rect.getMaxY() - 1); for (int x = fromTileX; x <= toTileX; x++) { for (int y = fromT...
732735d8-5250-4668-8843-2999e4d22cba
3
public static void main(String[] args) { Display display = new Display(); Shell shell = new GraphicsExample().open(display); while (shell != null && !shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
d39407e1-7659-4ed0-8071-32f3613f9b0f
1
public static String copyAndDigest(InputStream inputStream, OutputStream outputStream) throws IOException, NoSuchAlgorithmException { MessageDigest digest = MessageDigest.getInstance("MD5"); byte[] buffer = new byte[65536]; try { int read = inputStream.read(buffer); while (read >= 1) { ...
754a7b7e-508f-4d40-97cc-ae1d0b8168d6
8
protected Registration readName (Input input) { int nameId = input.readVarInt(true); if (nameIdToClass == null) nameIdToClass = new IntMap(); Class type = nameIdToClass.get(nameId); if (type == null) { // Only read the class name the first time encountered in object graph. String className = input.readStr...
4a139b9c-d6bf-439b-b2ba-e911fdb61479
5
public final StartContext start() throws RecognitionException { StartContext _localctx = new StartContext(_ctx, getState()); enterRule(_localctx, 0, RULE_start); int _la; try { _localctx = new ProgramContext(_localctx); enterOuterAlt(_localctx, 1); { setState(55); _errHandler.sync(this); _la =...
613b4464-d063-44ca-8556-28dc26029f88
0
@Override public Object getValue() { return this.nativeValue; }
592d6f21-07f7-4226-a033-3e841ade2796
2
@Override public void actionPerformed(ActionEvent e) { if(e.getSource().equals(back)) { Menu m = new Menu(parent, "resources/Menu.png"); m.setLocation(PhotoLoc.this.getX() - PhotoLoc.this.getWidth(), PhotoLoc.this.getY()); parent.getContentPane().add(m, 0); Utilities.transitionEffect(PhotoLoc.this, m, pa...
0f80fdd6-ced4-43da-aa39-71593625a491
1
private Window() { // Sets the title for this frame. this.setTitle(" JUMP "); // Sets size of the frame. if(false) // Full screen mode { // Disables decorations for this frame. this.setUndecorated(true); // Puts the frame to full s...
0aec9f80-f7a0-4588-bbcf-28b140d97585
7
public URL convertFromCachedURL(URL u) { if(u == null) return u; try { String urlStr = u.toString(); String rootURLStr = this.rootDir.toURL().toString(); //If the URL isn't a file protocol and the URL doesn't start with the Cache Dir then its not //a Cache URL so...
f7d3950b-50d4-411a-a1fe-a6a44a490f89
8
public void modificarGrafico( String nombre, int tipoRelacion, Figura figura ){ int i=0; while (i<listaFigura.size()){ boolean b = false; if ( listaFigura.get(i) instanceof ClaseGrafica){ ClaseGrafica c = (ClaseGrafica)listaFigura.ge...
9a58ffe6-0783-4ea8-8b3e-80dc29a7eb76
8
public static void main(String[] args){ Set<String> set = new HashSet<String>(); String s[] = null; BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader("geotags.txt")); String line = null; while ((line = bufferedReader.readLine()...
9d0ec452-d3ef-4b72-84e6-ab401741c89f
7
* @param y * @param decimalPlaces * @param a_RoundingMode * @return x multiplied by y then rounded; */ public static BigDecimal multiplyRoundToFixedDecimalPlaces( BigDecimal x, BigDecimal y, int decimalPlaces, RoundingMode a_RoundingMode) { ...
98df099b-d8fd-4542-b045-ee9bf2ba9e54
8
@Override public boolean readDictionary() { if (_dictionaryPath == "") { if (!setPath()) { return false; } } BufferedReader in; try { //A File must be opened in order to be able to access Distributed Cache. in = new BufferedReader(new InputStreamReader(new FileInputStream(new File(_...
e616b662-212c-4031-a9b3-023925ac0914
5
public ResourceManager(Cluster cluster, String gridscheduler, String registry) throws RemoteException { // preconditions assert(cluster != null); //logger.info("RM in da house"); this.jobQueue = new ConcurrentLinkedQueue<Job>(); this.cluster = cluster; this.socketURL = cluster.getName(); this.gridsche...
84098098-2c47-4709-827e-fa90fd585d2e
9
@Override public void keyReleased(final KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.VK_ESCAPE: mainFrame.dispose(); case KeyEvent.VK_LEFT: { if (tabPane.getTabCount() == 0) { return; } int index = tabPane.getSe...
85f21c88-5f8a-4487-89c2-c098dcb5d096
3
public boolean addLink(Link link) { //System.out.println(this + ".addLink() : " + link); // Links points to this teacher Group has the field pointed by link group doesn't have a teacher for the field if (link.getTeacher() == this && link.getGroup().getClasses().get(link.getField()) != null && link.getGrou...
6b8abcee-be1e-47ab-8ef7-24b67af65984
8
@Override public boolean makeGuess(char ch) { System.out.println("makeGuess: " + ch + "; numWords=" + wordlist.size()); guessResult = false; letterGuess = ch; if (Character.isLetter(ch) && !alreadyGuessed(ch)) { //stores deleted words in case no more possible words ArrayList<String> deleted = new ArrayL...
7c831a74-9415-4f69-8527-4a396fd6bfa2
9
public int read(char[] outputBuffer, int offset, int size) throws IOException { try { int charsRead = 0; int bufferLength = this.buffer.length(); if ((offset + size) > outputBuffer.length) { size = outputBuffer.length - o...
456fc852-3243-4202-939c-7ed612b052d6
0
public void setWorkPosition(String workPosition) { WorkPosition = workPosition; }
d49ce97c-370f-45b9-86e0-9b0f2e481574
1
public void resetLastExecutes(int count) { Command command; for (int i = getMin(history.size(), count); i > 0; i--) { command = history.get(history.size() - 1); command.undo(); history.remove(command); } }
4c38fbee-3cad-48a9-8102-19ff069bc4d2
7
public boolean exist(char[][] board, String word) { // Start typing your Java solution below // DO NOT write main() function if (board.length == 0 || board[0].length == 0 || word.length() == 0) { return false; } boolean[][] visit = new boolean[board.length][board[0].length]; boolean result = false; for...
78fe1c5d-8afb-4592-a5a6-f97a1eb598ba
5
public Wave42(){ super(); MobBuilder m = super.mobBuilder; for(int i = 0; i < 2500; i++){ if(i % 8 == 0) add(m.buildMob(MobID.ONIX)); else if(i % 7 == 0) add(m.buildMob(MobID.MACHOP)); else if(i % 6 == 0) add(m.buildMob(MobID.GRAVELER)); else if(i % 5 == 0) add(m.buildMob(MobID.MAROWAK...
22586e97-9126-499d-89ff-610c7041a062
9
public Frame_FileBrowser(Thread_Terminal terminal) { try { this.myThread = terminal; this.continueRun = false; this.myThread.frameFileBrowserIsDisposed = false; this.myThread.myFileBrowser = this; setTitle("Splinter - RAT vrs 1.41 - BETA File Browser @" + this.myThread.g...
aaf2fa4d-6c44-431a-b734-39a1806693a1
3
public int[] plusOne(int[] digits) { int carry = 1; int index = digits.length - 1; while (index >= 0) { digits[index] = digits[index] + carry; carry = digits[index] / 10; digits[index] %= 10; index--; if (carry == 0) ret...
c636c862-9ee0-4e3d-85c3-e52a28cb4e23
0
public void addSubCategory(SubCategory scat) { this.subcategories.add(scat); }
9f422667-6e86-4185-b069-b93666448ca0
6
@Override public Object getValueAt(int row, int column) { Vehicle vehicle = vehicles.elementAt(row); switch (column) { case 0: return vehicle.getLicencePlate(); case 1: return vehicle.getStartDate(); case 2: return v...
fc3714d2-810b-4c0d-adb1-1268d8f53c56
0
public FSAStepWithClosureSimulator(Automaton automaton) { super(automaton); }
6150fb8c-da55-472c-9ed2-39b50c838c4b
1
private int calcAsciiSum(final String s) { int res = 0; for (int i = 0;i < s.length();i++) { char c = s.charAt(i); res += (int) c; } return res; }
ff03c84c-a836-4e19-a17d-608b14b633d4
8
final Interface18_Impl3 method3843(int i, int i_11_, int i_12_, int i_13_, byte[] is, Class304 class304, int i_14_, boolean bool) { try { anInt9846++; if (i_14_ != 32) anOpenGL9856 = null; if (!aBoolean9926 && (!Class192.method1436(i_14_ ^ 0x46, i_12_) || !Class192.method14...
4ea55999-15f8-4815-9650-d2fe4516e680
8
private void computeNext() { int i = k - 1; int j = k; // find smallest j > k - 1 where a[j] > a[k - 1] while (j < n && a[i].compareTo(a[j]) >= 0) { ++j; } if (j < n) { swap(i, j); } else { reverseRightOf(i); // i = ...
b3ce73f8-e728-494b-bd7f-eba915966e72
3
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed try { if (invoice.equals("-") && jTextField1.getText().contains("-")) { JOptionPane.showMessageDialog(this, "Please enter positive amount for invoice", "Error", JOptionPane...
26a3d42a-aa2e-4202-830e-ac6ae042c8b4
0
public static String thead(){ return "<thead>" + "<tr>"+ "<th>"+"instance id"+"</th>"+ "<th>"+"txid"+"</th>"+ "<th>"+"BPEL"+"</th>"+ "<th>"+"course id"+"</th>"+ "<th>"+"course provider"+"</th>"+ "<th...
03530232-1ed4-4273-9419-4c8cee47edc3
1
public void activePlayerEndTurn() { setNextActivePlayer(); getGrid().decrementEffectsLifetime(); // Decrement lifetime of all // Powerfailures on the grid if (powerFailureFactory != null) powerFailureFactory.generate(); // Add new PowerFailures to the grid }
5440221f-41d6-4346-9dde-1a0769554df7
5
public Date engineGetCreationDate(String alias) { if (!loaded) { throw NOT_LOADED; } if (keyring == null) { return null; } List entries = keyring.get(alias); if (entries.size() == 0) { return null; } for (Iterator it = entries.iterator(); it.has...
96df3436-5195-4ea1-9fdb-b8d200181543
1
public static String flipText(String expr) { char[] chars = expr.toCharArray(); for(int i=0;i<chars.length/2;i++) { char c = chars[i]; chars[i] = chars[chars.length-1-i]; chars[chars.length-1-i] = c; } return new String(chars); }