method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
cd0c2e75-d45d-4c82-beb7-0e9ecb725445
4
public boolean addRoom(String roomNumber, String roomType, int roomStart,int roomFireBreak, int capacity, int roomEnd) { try{ openDatabase(); }catch(Exception e){} //String query = "INSERT t8005t2 .rooms values('" + roomNumber + "','"+ roomType + "','" + roomStart + "','" + roomFireBreak + "','" + capaci...
6065f653-248e-4eed-a9f6-19598f60ecb6
0
public void disabledPeriodic() { sendSensorData(); }
c06e6bc9-a9c6-4e35-a52b-251077578006
1
public void paivitaPisteetJaTaso(){ if (this.pisteLabel == null | this.tasoLabel == null){ return; } this.pisteLabel.setText(""+this.rivit); this.tasoLabel.setText(""+this.taso); }
3d1210a4-649d-4a41-acaf-9a388039a32d
6
public Object[][] searchByInfo(String string) { int numFound = 0; for(Note note : store) { if(note.getTitle().contains(string) || note.getContent().contains(string)) { numFound++; } } Object[][] found = new Object[numFound][3]; int index = 0; for(Note note : store) { if(note.getTitle().contains...
f624a4f8-ff06-43f2-871a-5d2be2af2e40
5
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { if(!this.isFreestanding) { int var5 = var1.getBlockMetadata(var2, var3, var4); float var6 = 0.28125F; float var7 = 0.78125F; float var8 = 0.0F; float var9 = 1.0F; float v...
b4fa6197-39a0-455e-8423-4f55f6b5523c
6
@Test public void test() { StickyWeb sw = new StickyWeb(); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("location", "blacksburg"); StickyWebResponse result; try { result = sw .get("http://api.yelp.com/v2/search", parameters).setOnline(true) .execute(); ...
2abc766f-662c-463f-ab96-f664c33d5b2d
4
public static String getID(String associatedSetting) { if (IDConfig == null) { try { IDConfig = Util.readJSONFile("./data/ids.json"); } catch (IOException ex) { Logger.error("IDHelper.loadIDs", "Failed to load 'ids.json'!", false, ex); ret...
988017c2-b563-402b-8ec2-30320ea00591
7
public static void main(String[] args) { Scanner sc = new Scanner(System.in); long first = sc.nextLong(); long second = sc.nextLong(); if (first < second) { long temp = first; first = second; second = temp; } // counting the number of digits in the smaller ones long divider; for (divider = 1;...
d2247c1b-e325-412b-adac-a68200a03619
2
public double mean(){ double mean = 0.0; for(int i=0; i<this.numberOfRows; i++){ for(int j=0; j<this.numberOfColumns; j++){ mean += this.matrix[i][j]; } } mean /= this.numberOfRows*this.numberOfColumns; retur...
5e9df5c4-ef25-4ee7-bf62-d5698b5bcea9
6
public void run () { while (true) { try { Object objectIn = Sinput.readObject (); if (objectIn instanceof String){ messageIn((String)objectIn); } ...
2eeff77e-3bda-47c6-adf0-b9120a12b302
8
public void setAim(KeyState keys) { if(keys.left) { if(keys.up) { aim = Direction.UP_LEFT; } else if(keys.down) { aim = Direction.DOWN_LEFT; } else { aim = Direction.LEFT; } } else if(keys.right) { ...
e642a7cd-a5e2-4015-943b-f873607d261b
7
@Override public RestrictionHandler.Result handleRestriction( final AbstractQueryBuilder abstractQueryBuilder, final Restriction restriction) { final StringBuilder builder = new StringBuilder(); final Nullable nullable = restriction.getNullable(); final String restrictionId = " ?" + restriction.getParame...
89c9f005-cc71-49e6-ad14-8c0fa1d50ccd
9
@Override protected void runImpl() throws ExecutionFailedException { Timer t = new Timer(); debug("Loading components..."); List<ConnectedComponent> components = ConnectedComponent.loadComponents(componentsFile.get()); info(NumUtils.groupDigits(components.size()) + "...
1e2fd2bc-38fc-47d7-ab0a-d6e7b9083177
0
public void configurationSelectionChange(ConfigurationSelectionEvent event) { // changeSelection(); }
cb825a89-1744-43e8-b8ea-72820363b86c
4
public void checkStockLevels() { // System.out.println("checkstocklevels *****************"); try { PreparedStatement stmt = connection.prepareStatement("select unique mname from DepotItem"); ResultSet rs = stmt.executeQuery(); //int number; while (rs.nex...
2a113229-a9bc-49a7-9562-6af99bca62a5
2
public static void convertPointToScreen(Point pt, Component component) { while (component != null) { pt.x += component.getX(); pt.y += component.getY(); if (component instanceof Window) { break; } component = component.getParent(); } }
380928ba-4b20-48e2-b89b-aea166a78578
8
public void printAuswertungXLS() { if (table.getSelectedRowCount() == 0) return; List<EinzelWettkampf> lewk = new Vector<EinzelWettkampf>(); List<MannschaftsWettkampf> lmwk = new Vector<MannschaftsWettkampf>(); for (int i : table.getSelectedRows()) { Wettkampf w = (Wettkampf) table.getValueAt(i, -1); i...
b4389caa-88f2-4a15-b34a-9636f57c2fa4
1
public void initialize(ConstPool cp, CodeAttribute attr) { if (constPool != cp) newIndex = 0; }
aabaff82-7891-4cf4-aeab-7559340c9175
4
private void scaleRecipe() { String newUnits = sizeUnitsComboModel.getSelectedItem().toString(); double newSize = Double.parseDouble(sizeTxt.getText()); myRecipe.scaleRecipe(new Quantity(newUnits, newSize)); if (convMaltsChk.isSelected()){ for (int i=0;i<myRecipe.getMaltListSize();i++){ myRecipe.get...
ea972c0d-2300-49ee-81ea-ac597a8c9719
5
public int sqrt(int x) { int start = 0; int end = x; if (x == 1) return 1; if (x == 0) return 0; while (start < end - 1) { int half = (start + end) >>> 1; if (half < x / half) start = half; else ...
56547d04-df3c-4de6-9120-57da7281b7a1
3
@Override public Action getActionRemote(Server server, Instruction instruction,Option[] options) { Context context = null; try{ context = createContext(server); }catch(Exception e){ } if(null == context) return null; try{ Deploy deploy = server.findDeploy(instruction); String bi...
2c0edf9f-7572-41f3-a2f3-d3c20341c834
0
private void Initialize() { }
7310ea7e-c89c-482e-abbf-043e1d17be07
5
public synchronized void executeNextTask() { // System.out.println("HIT"); if (this.m_TaskQueue.size() > 0) { for (int i = 0; i < this.m_Threads.size(); i++) { DCThread thread = this.m_Threads.get(i); // System.out.println("Got thread: " + thread.getThreadId()); if (thread.getThreadState() == THREAD...
5619715f-e9d1-4ab7-9fd2-7974da233512
4
public void visitTypeInsn(final int opcode, final String type) { Item i = cw.newClassItem(type); // Label currentBlock = this.currentBlock; if (currentBlock != null) { if (compute == FRAMES) { currentBlock.frame.execute(opcode, code.length, cw, i); } else if (opcode == Opcodes.NEW) { // updates curr...
13ad29c5-3785-47cd-8844-542179438316
4
@Override public Container load(InputStream is) throws FormatException, IOException { byte[] headerBytes = new byte[11]; int bytesRead = is.read(headerBytes); if (bytesRead < 11) { throw new FormatException("MLA header is too small"); } else { short headerS...
891be584-0f7c-4099-9a65-5c12b79c4ecc
7
public String[] runGibbs(String[][] labels, double[][][] adiacMaps) { //Build initial alignment int[] alignment=new int[labels.length]; int i=0, j=0; for(i=0;i<alignment.length;i++) { int row=random.nextInt(labels[i].length); alignment[i]=row; } //Start gibbs sampling int indIter=0; double b...
10858470-6a14-47e5-bc2c-950252841548
7
public void solve(char[][] board) { if (board == null || board.length == 0) { return; } int rowSize = board.length; int colSize = board[0].length; boolean[][] visited = new boolean[rowSize][colSize]; ArrayList<Character> current = new ArrayList<Character>(); ...
5342d44c-62c8-415d-b434-8b346db46534
3
protected void turn() { short[][] turnedBlock = new short[ MAX_Y ][ MAX_X ]; // 回転したブロック for ( int y = 0; y < MAX_Y; y++ ) { for ( int x = 0; x < MAX_X; x++ ) { turnedBlock[ x ][ MAX_Y - 1 - y ] = _block[ y ][ x ]; } } // 回転可能な場合、ブロックの入れ替え if ( _game.isMovable( _pos, turnedBlock ) ) { ...
74cb4203-131a-408e-918e-ee60ee3fc371
6
public static void main(String[] args) { try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(in.readLine()); boolean[][] nabomatrise = new boolean[n][n]; String naboRad; for(int i=0;i<n;i++){ naboRad=in.readLine(); for(int j=0;j...
b148e957-21d7-422c-a3e1-316e38ab0277
4
public void listChannels(long chanId, String indents){ String str = ""; Channel childC; if(getChannel(chanId) instanceof ChannelGroup){ ChannelGroup cg = (ChannelGroup)getChannel(chanId); str += cg.getId() + " G " + cg.getName(); System.out.println(indents + str); indents += " "; for(long i...
b8b094ac-4da2-4e1a-b157-b96ea181d33c
1
public void loadwaitint() throws InterruptedException { synchronized (this) { boostprio(10); while (loading) { wait(); } } }
04a2e4d5-0faa-4bc0-b72a-f3280721dd15
0
public List<BranchLeader> findBranchLeadersByHallEventId(final Long hallEventId) { return new ArrayList<BranchLeader>(); }
7be58ef9-6b42-4994-b095-62c625a132d8
5
private void readInformations(Map map) throws IOException { m_bufferReader.readLine(); String data = m_bufferReader.readLine(); // Blanc text: blanc nombre try { // Blanc text: blanc nombre map.setNumberMonsters(readInt(data, "\\s+\\w*:\\s+\\d+\\s*").next...
f6f5b2c0-616b-4300-918e-d02a6c928f80
5
private void acceptButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptButtonActionPerformed // TODO add your handling code here: Object[] what; boolean error = false; String msg = ""; what = new Object[5]; if (!tableName.getText().equalsIgnoreC...
1bc286c4-bc94-4e92-9c60-f2df8df9e70f
8
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("postOrder")){ tree.postOrder(); } else if (e.getActionCommand().equals("insert")){ tree.insertFromInput(); } else if (e.getActionCommand().equals("clear")){ tree.clear(); } else if (e.getActionCommand().equ...
ba7a2838-d1cb-4f7f-90dd-2f51133c2ce8
1
public void commit() { try { commitTo(loader.outputStreamFor(this)); } catch (final IOException e) { e.printStackTrace(); System.exit(1); } }
25fcbb3a-cd45-4d2e-aa0b-5f66127db91a
7
public void updateTargetLayers(List<Layer> layersForReceiver) { BLFramePacket fp = retrieveLatestPacket(); if (fp != null) { for (Layer l : layersForReceiver) { if (layerImage == null || fp.getImageWidth() != layerImage.getWidth() || fp.getImageHeight() != layerImage.getHeight()) { layerImag...
f559f4e1-668a-4155-b14b-ddd2c60a1565
2
public void configure(DocumentSettings docSettings) { // Lazy Instantiation if (!initialized) { initialize(); initialized = true; } this.docSettings = docSettings; // Set the Preference Objects on the Listeners so that changes are always sent to the document level Preferences. lineEndComboBox...
9496611e-ce7d-47c4-9f51-59ae0caa3cee
3
public LifeStatus shouldALive(LifePosition lifePosition) { if(calculateLifeAround(lifePosition) == 3 || calculateLifeAround(lifePosition) == 2 && alive(lifePosition)) return LifeStatus.alive; return LifeStatus.dead; }
afe3d223-f9fe-4d19-81a4-1ab37059d07f
5
public String toString() { switch (state) { case STATE_IDLING: return "idling"; case STATE_SEEKING: return "seeking"; case STATE_ATTACKING: return "attacking"; case STATE_RETREATING: return "retreating"; case STATE_DEFENDING: return "defending"; } return "???"; }
5f170a05-f252-4f69-a28c-22f15cd41314
6
public static void InitialisationListesObjets(){ if(velos == null){ velos = VeloDAO.getAllVelo(); } if(bornes == null){ bornes = BorneDAO.getAllBorne(); } if(stations == null){ stations = StationDAO.getAllStation(); } i...
56100c82-c852-4033-bda1-e990df6d7dac
4
private DefaultTableModel resultSetToTableModel(DefaultTableModel model, ResultSet result) throws SQLException { ResultSetMetaData rsMetaData = result.getMetaData(); if(model == null){ model = new DefaultTableModel(); } String columnLabels[] = new String[rsMetaData.getColumnCount()]; for(int i = 0;i < c...
a1177848-7085-4a73-b42c-bdf2801a6f5d
7
@Override public void channelCommand(MessageEvent<PircBotX> event) throws IllegalAccessException, SQLException, InstantiationException { super.channelCommand(event); if(command.equalsIgnoreCase("!quote")){ if(args.length==1){ if(Permissions.isRegular(user,event, true)){ ...
e91bc2d7-0d11-4b7f-86c1-c385e4d10d2b
8
private static StringBuffer leerAsm(Scanner entrada){ StringBuffer contenido = new StringBuffer(); while(entrada.hasNextLine()){ String linea = entrada.nextLine(); if(!linea.startsWith(";") && !linea.contains(";") && !linea.equals("")){ contenido.append(linea); contenido.append("\n"); }else if(li...
50448bb2-961e-4ddb-936e-bd28c96eb594
4
@GET @Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public Response getComposition(@PathParam("client_id") String client_id) { File compositionXmlFile = new File(baseFilePath + File.separator + client_id + File.separator + "Composition" + File.separator + "Compos...
b314f3e0-2ac8-4d06-8027-3d542ebeac29
5
public ArrayList<Word> getPrefixWords(Utterance utt, int index) { String[] units = utt.getUnits(); Boolean[] stresses = utt.getStresses(); ArrayList<Word> prefixWords = new ArrayList<Word>(); // Reject index if it's too high if (index >= units.length || index < 0) throw new RuntimeException("Starting inde...
7e8215d7-6f23-49b1-83d6-621e503f54f7
5
public void Decorate() { super.Decorate(); try { g = currentIcon.getGraphics(); } catch (NullPointerException e) { System.out.println("Could not get Graphics pointer to " + getClass() + " Image"); return; } if (robot != null) { ...
cef355f7-94f5-42d8-830a-18fa9fa0a3a8
5
public static <V> V findInMap(Map<? extends IKey, V> map, IKey name, boolean caseSensitive, boolean allowAbbreviations) { if (allowAbbreviations) { return findAbbreviatedValue(map, name, caseSensitive); } else { if (caseSensitive) { return map.get(name); } else { for (IKey c : map.k...
801ba8a8-61f0-44f0-ae14-2843816383ef
4
public void run() throws IOException { List<Stack> stacks = opsworksUtil.getStacksByName(stackName); if (stacks.isEmpty()) { throw new IllegalArgumentException("No stack found with name '" + stackName + "'"); } for (Stack stack : stacks) { List<App> apps = opswor...
b8fbdb53-36c2-492b-a8c7-63ca0293812b
4
public String prevediIzPismaUPismo(String rec, Pismo iz, Pismo u) { if (iz.equals(Cyr) && u.equals(Lat)) { return prevediIzCiriliceULatinicu(rec); } else if (iz.equals(Lat) && u.equals(Cyr)) { return prevediIzLatiniceUCirilicu(rec); } else { return "Može se pr...
a0d5d152-f815-4f45-b7e8-109d3cc63b81
5
public void calculateSharedKMers() throws IOException { fillHashMap(this.allKMersOne, this.pathToFile); reverseHashMap(allKMersOne); // System.out.println(this.allKMersOne.get("CAACGAATAAGATGGTC")); // fillHashMapWithoutFile(this.allKMersTwo); // reverseHashMap(this.allKMersTwo); ...
1bbb7fb3-2d3f-4518-b94d-c3c68b241c94
7
public Usuario selectLogin(String login, String Senha) throws SQLException { Connection conexao = null; PreparedStatement comando = null; ResultSet resultado = null; Usuario user = null; try { conexao = BancoDadosUtil.getConnection(); comando = conexao....
8ba13eeb-1bf5-477b-95e1-a1cba6229109
1
public QueryOrderResponse queryOrder(QueryOrderRequest request) throws GongmingConnectionException, GongmingApplicationException { URL path = _getPath(QUERY_ORDER); QueryOrderResponse response = _GET(path, request, QueryOrderResponse.class); if (response.code != GMResponseCode.COMMON_SUCCESS) { ...
ba50f841-a598-4633-8e82-d02377e2c709
4
private void close() { try { if (rs != null) { rs.close(); } if (statement != null) { statement.close(); } if (conn != null) { conn.close(); } } catch (SQLException e) { th...
6866c97c-efdd-4eb7-bcd3-5e2a3c244411
4
protected boolean isInChannel(String aName) { User[] users = bot.getUsers(gameChan); for (int i = 0; i < users.length; i++) { String nick = users[i].getNick(); if (nick.equals(aName) || nick.equals("&" + aName) || nick.equals("~" + aName)) return true; } return false; }
e3f98293-cfc2-470c-8fda-ecce3e9e63e4
5
public void joinGame(final String adr) { client = null; TimerTask acceptLoop = new TimerTask() { @Override public void run() { System.out.println("connecting..."); try { client = new Socket(adr, 7227); } catch (IOException e) { // TODO Auto-generated catch block delegate.connection...
2368ee4c-6510-4fc6-864f-84abab1c448b
8
private static void setupLWJGL() { String osName = System.getProperty("os.name"); String nativeDir = ""; try { nativeDir = new File(Terraria.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent(); } catch (Exception e) { try { e.printStackTrace(); nativeDir = new File(".")....
804f3fde-fb2c-4254-a713-9ac6f146a50b
4
public void checkForWin() { if( checkAcross() || checkDown() || checkDiagonal() ) win( playerTurnField.getText().substring(playerTurnField.getText().indexOf( (char)32 ) + 1 ) ); else if(turn == 9) { playerTurnField.setText("NO WINNER"); turn = 0; }else { playerTurnField.setText("PlayerTurn:...
95fd985f-1990-400f-87c5-12c33f5bd692
7
public void buildAdaBoostTree(ArrayList<Sample> trainSamples) { for (int i = 0; i < trainSamples.size(); i++) { trainSamples.get(i).setWeight(1.0/trainSamples.size()); } for (int j = 0; j < 10; j++) { // on each iteration, train on 2500 samples ArrayList<Sample> allCopy = new ArrayList<Sample>(trainSampl...
a60c96fe-4f98-4f49-9347-3f0739ff2313
1
@Override public Class<?>[] getSupportedAttributeCategories() { return null; }
76baa272-f140-4713-8de7-416b6b0a4fd9
1
@Override public boolean isHoverable(PositionChangedObservable o) { IsHoverableVisitor visitor = new IsHoverableVisitor(o); for(PositionChangedObservable e : destination.hoveringElements) e.accept(visitor); return visitor.isHoverable(); }
d83b4748-b6e2-4261-b09b-7d131eea94c4
9
private int get_next_page(Page page, long boundary){ if(boundary>0) boundary+=offset; while(true){ int more; if(boundary>0 && offset>=boundary)return OV_FALSE; more=oy.pageseek(page); if(more<0){offset-=more;} else{ if(more==0){ if(boundary==0)return OV_FALSE; // if(get_data(...
2ff59ade-817b-42b3-b7f7-b1002265de9b
9
private void restore(char [] cs, int index, int[] dq, int qIndex, List<String> result ){ if (qIndex == 3 && cs.length-index>3){ return; } else if (qIndex==4 ){ if (index > cs.length-1){ StringBuilder bldr = new StringBuilder(); for (int i=0...
c3800597-b315-4fa1-95d6-362688e911ba
1
@Override public void updatePhysics() { super.updatePhysics(); if(!onPlatform) { vy += DryIceClimber.GRAV_ACC; } onPlatform = false; }
a8a31fab-a704-4687-a6ff-e0d927ba078b
3
public Ball(int positionx, int positiony, int radius, int pathmode, int touchmode, Vector<int[]> Lines, Vector<int[]> Goals, PathCollector PCol, boolean pause) { this.PCol = PCol; position[0] = positionx; position[1] = positiony; prepoint[0] = position[0]; prepoint[1] = position[1]; destination[0] = posit...
a81d2c27-1f9c-484e-902b-798b0095f54f
9
private static void loadVersionFile() { try { if (!(VersionFile.exists() && VersionFile.canRead())) { if (JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog( null, "Wombat has not been installed.\n\n" + "Do you want to install it to this directory:\n" + CurrentDi...
9345adb8-fba5-4377-a880-13700537320a
5
public static boolean isItTimeForEndOfRound() { boolean answer = false; int count = 0; for (int i = 0; i < currentPlayers.size(); i++) { // @@@ Hvis spilleren har samme Turnbet som bordet eller er all in er han stadigvæk med i spillet if (currentPlayers.get(i).getCurre...
76e080ca-a3f8-4970-8479-cac2a98f2eee
2
public void addNick(String nick) { char c = nick.charAt(0); if (c == '@') { nicks.add(beginningOpers, nick); beginningVoiced++; beginningNormal++; } else if (c == '+') { nicks.add(beginningVoiced, nick); beginningNormal++; } else { nicks.add(beginningNormal,...
e7d930a5-261e-4180-a979-9bc35eac72c2
0
@Override public String getBirth() { return super.getBirth(); }
a57eab1f-b724-4246-8bac-f9f9d3a25b54
5
public void prune() { while(size() > maxBufferSize) { boolean cont = false; for (Integer key : stateMap.keySet()) { // for (Integer key : stateMap.descendingKeySet()) { if (stateMap.get(key).size() > MAX_SUBMAP_SIZE) { stateMap.get(key).remove(stateMap.get(key).size()-1); ...
056ce022-7042-4e9b-9c6f-c8a192826bc4
4
public void checkKeys(GameContainer container) { Input input = container.getInput(); // Pressed Down / Held Down / Let Go. if (input.isKeyPressed(Keyboard.KEY_ESCAPE)) { escPressed = true; } else if (input.isKeyDown(Keyboard.KEY_ESCAPE)) { //escPressed = true; } else { escPressed = false; ...
3a4bc5fa-dcc8-494c-9cd6-e8c1dd89e111
0
public void setCantidad(double cantidad) { this.cantidad = cantidad; }
9da495da-5186-42a1-b595-21e0df3b9151
4
public void collisionCibleProjectiles(Projectiles proj, Cibles c, Screen ecran){ if (proj.getPosition().getX() + proj.getBound().getX() > c.getPosition().getX() && proj.getPosition().getX() < (c.getPosition().getX() + c.getBound().getX()) && proj.getPosition().getY() + proj.getBound().getY() > c.getPosition()....
6062058d-f1e8-4cd0-a1a9-b10db8363111
6
public String getProfileImage(String username){ String out = baseURL; try { //Encode the URL to ensure that all the characters send are valid String data = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(username, "UTF-8"); //...
880a1aae-0306-4ff2-9762-634ddd644850
7
public int minDepth(TreeNode root) { if (root == null) { return 0; } if (root.left == null && root.right == null) { return 1; } if (root.left == null && root.right != null) { return 1 + minDepth(root.right); } if (root.right == ...
212eefee-1c7d-4390-aafc-615ed53f6913
4
@Override public void actionPerformed(ActionEvent ae) { try { String op = ae.getActionCommand(); switch(op){ case "Salvar": execSalvarCrlv(); break; case "Salvar Alterações": ...
799d48b2-3954-47ef-bd00-359c911ceaa3
5
public void setSourccePreview() { InputStream is; try { BufferedImage src = ImageIO.read(new File(sourcePath)); if (src.getWidth() >= 150 || src.getHeight() >= 150) { BufferedImage prevIMG = new BufferedImage(150, 150, src.getType()); for (int i =...
d82703cc-c669-4528-bd65-549b6345f5d7
3
public StockPriceProvider() { Share[] buffershare = new Share[0]; if(this instanceof YahooFinancePriceProvider){ buffershare = createShares(); }else if(this instanceof HistoricalStockPriceProvider){ buffershare = createDefaulShares(); } for (int i = 0; ...
49118ddf-4e81-41c8-b0e2-801c8ad9f1e7
5
@Override public void update(long delta) { int cPicker; int cRule; int sRule; int pRule; timeSince_ += delta; while(timeSince_ > MILLISECONDS_PER_PARTICLE) { Random r = new Random(); while(!cPickers[cPicker = r.nextInt(cPickers.length)]) { ; } while(!cRules[cRule = r.nextInt(cRules.le...
ba7fc023-6747-42c3-9abe-4923b7574287
5
public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = scn.nextInt(); int rows = 2; int[] row; int[] prevRow = { scn.nextInt() }; int i = 0; while (rows <= N) { row = new int[prevRow.length + 1]; while (i...
24e95d33-bf14-498d-ac3a-b29570b10272
0
@Before public void setUp() { this.k = new TallennuksenKasittelija(); }
52795354-77c2-448b-ac15-8642f6684ef8
5
public void method281(int x, int uid, Entity entity0, int z, Entity entity1, Entity entity2, int tileZ, int y) { ItemPile itemPile = new ItemPile(); itemPile.anItemPile_48 = entity2; itemPile.anInt46 = x * 128 + 64; itemPile.anInt47 = y * 128 + 64; itemPile.anInt45 = z; itemPile.uid = uid; itemPile.aEntit...
b9bca3b9-4343-48ca-aab4-a1a407fcbb93
7
public void visitLocalVariable(final String name, final String desc, final String signature, final Label start, final Label end, final int index) { if (signature != null) { if (localVarType == null) { localVarType = new ByteVector(); } ++localVarTypeCount; localVarType.putShort(start.position) ...
7ac1499a-e5a1-434c-820a-089f7e1acd1f
7
private AbstractCommandExecutor createExecutor(ExecutorConfig config) { try { Class<?> cmdClass = Class.forName(config.getClassName()); Constructor<?> cmdCtr = cmdClass.getDeclaredConstructor(); AbstractCommandExecutor executor = (AbstractCommandExecutor)cmdCtr.newInstance(); ...
4676c881-ea7b-4a0c-8216-b699d9208289
1
public void updatedReleasedKeys() { // Remove all keys that have been released since we last checked. for (int keyCode : keyReleased) { keyPressed.remove(keyCode); } // Clear the keys that are released, since // they are handled now. keyReleased.clear(); }
7c7456cb-7670-40c4-adbb-c4ecf5527db0
2
private String createIndex(){ StringBuilder sb = new StringBuilder(); for ( IndexNode node : table.getIndexList() ) { String methodName = "readByIndex" + toTitleCase( node.getIndexName()); String param = ""; for(Column col : node.getColumnList()){ param += ...
197c55a7-72d8-4123-a6d8-84690044d10b
0
public void mouseEntered(MouseEvent event) { adapter.mouseEntered(event); }
82018403-1a7a-4b2b-9f42-903c30189da6
4
public int pengubah(int jenis, String bilangan){ switch (jenis){ case 1: bil = Integer.parseInt(bilangan,2); break; case 2: bil = Integer.parseInt(bilangan,10); break; case 3: bil = Integer.parseI...
96687aac-1560-4109-a6ce-67b7a277a99c
4
@Override public Pixel[][] getDisplay() { Pixel[][] pixels = new Pixel[50][50]; for (int row = 0; row < thisTick.length; row++) { for (int col = player.getPos() - 25; col < player.getPos() + 25; col++) { //log(Level.FINEST, "col:%d playerPos:%d", col, player.getPos()); ...
2636d5ed-dab7-4f25-a14d-335afecf4c02
5
public void clean(){ if(!isSAMNull()) for(int i=0;i<am.length;i++) if(am[i]!=null) //Elimino l'albero se il suo valore non massimo o non mangio abbastanza dame if(am[i].getValue()!=valore-1 || am[i].getNumDameEated()<getMaxDameEated()) am[i]=null; else am[i].clean(); }
49f68f89-5de6-412c-beb8-2d597b912464
6
@Override public StringConverter<?> findConverter(Class<?> cls) { Class<?> sup = cls.getSuperclass(); if (sup == Enum.class) { return new EnumStringConverter(cls); } else if (sup != null && sup.getSuperclass() == Enum.class) { return new EnumStringConverter(sup); ...
500516b4-b3bd-49e4-b2a7-7809be1aca82
2
public void mousePressed(MouseEvent arg0) { if( case1.isFinale() ){ Coup coupValide = ((Damier) this.plateau).getCoupValide( ((Damier) this.plateau).getPositionPieceActive(), case1.getPosition() ); ((Damier) this.plateau).executionCoup(coupValide); } else{ ((Damier) this.plateau).reinitEtatCases(); ...
6d0a085d-1d74-48c0-8252-4f88b4f751db
3
@Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); Province province = (Province) value; if(ui == null) setTe...
7d311a0b-919a-4a5e-b8c8-14d9be4db24e
1
public static void show_symbol_table(Symbol_table symbol_table) { System.out.println("=============Symbol Table============="); System.out.println("total number: " + symbol_table.symbol_name.size()); for (int i = 0; i < symbol_table.symbol_name.size(); i++) { System.out.println(symbo...
810939c6-0c3d-41f1-9866-4287d000f2e2
5
public void start_insert(DB_Init init, String batch, ArrayList<String> branchArray,ArrayList<String> rollStartArray,ArrayList<String> rollEndArray) { StringBuilder sb = get.extract_complete_data(); DBCursor prev_count_cursor = init.original_table.find(); db_size = prev_count_cursor.count(); ArrayList<String[]> ...
238f122b-7811-4d11-9587-c2ab92592639
7
private void startScene2() throws NoSuchElementException, NoSuchElementException, IllegalStateException, IOException { String fila = input.readLine().toUpperCase(); for (int i = 0; i < Rows; i++) { for (int j = 0; j < Columns; j++) { DimeMa...
a896d701-9cd8-41c6-836b-8c864381d6a6
1
private Localization(Class<?> theClass) { mClass = theClass; mBundleName = theClass.getName(); mIsAccessible = (mClass.getModifiers() & Modifier.PUBLIC) != 0; }
6203d7ae-05a7-494f-99ec-c0f4eea35631
8
private static void assembleCode() { String sName = sourceBaseName + ".s"; String cLib = "cless"; if (underscoredGlobals()) { cLib = "clessus"; } String arg[]; if (noLink) { arg = new String[4]; arg[0] = "gcc"; arg[1] = "-m...
657a6bd3-16ab-41af-be93-c5173c33b609
9
public boolean isValidFor(SeedNode node) { if (node.x < Consts.SEED_RADIUS - Consts.EPSILON || node.x > width - (Consts.SEED_RADIUS - Consts.EPSILON) || node.y < Consts.SEED_RADIUS - Consts.EPSILON || node.y > height - (Consts.SEED_RADIUS - Consts.EPSILON)) return false; for (Location tree : trees) { if (L...
34ab6e7f-566c-4d14-bd76-29bf5f988107
3
public ArithmeticTree(String expression) throws WrongStructure, IncorrectSymbol, ImpossibleAction { try { head = fillTree(expression); } catch (WrongStructure exception1) { throw exception1; } catch (IncorrectSymbol exception2) { throw exception2; } ca...