method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
37bd6f6d-1c54-4895-af40-faa2072fd3fc
8
public void tick() { clock++; removeLosses(); draw = (draw * 49.0 + lastTickDraw) / 50.0; lastTickDraw = 0.0; if (drewFromTrack > 0) drewFromTrack--; else if (type == Type.USER && charge < (capacity / 2.0) && clock % DRAW_INTERVAL...
85d3c5a2-8c85-4ebf-ab32-7dfd830462c1
1
@SuppressWarnings("unchecked") public T getLast(int i) { // check if we have enough history if (i >= count.getValue()) { throw new NoSuchElementException(); } // fetch the wanted value OverflowingInteger position = top.clone(); position.decrement(i); //System.out.println("Reading data at " + position...
1d0f6f4f-097a-48a0-ad1a-421498f9c6be
1
public static CtClass getReturnType(String desc, ClassPool cp) throws NotFoundException { int i = desc.indexOf(')'); if (i < 0) return null; else { CtClass[] type = new CtClass[1]; toCtClass(cp, desc, i + 1, type, 0); return type[0]; ...
12849d6b-f595-4d2b-b3d9-94d57891bacb
5
public void afficher (Graphics g){ // affiche l'image principale g.drawImage(board,x,y, null); for (Territory territory : boardModel.board.values()){ //display the garrisons if(territory.haveGarrison()){ displayGarrison(territory, g); } //display the neutral forces if(territory.getNeutralFo...
1655704b-ca62-46c0-b931-2cca43e63fa9
1
public static void testAllGeneration() throws IOException, GeneratorException { FileInputStream jsonInput = new FileInputStream("examples/json/test.json"); String jsonText = IOUtils.toString(jsonInput); String outputPath = "examples/tests/"; File dir = new File(outputPath); if (!dir.exists()) { dir.mkdi...
7de8cff9-a758-46bf-970d-464c4bdfdc0f
1
public Recipe getRecipe() { if (recipe == null) { recipe = new Recipe(); } return recipe; }
f5f20fef-9440-4b7f-aceb-9e18f2eee7e0
5
@Override public void collides(Entity... en) { if (!Exploded) { return; } for (Entity e : en) { if (e == this || e.cull()) continue; Polygon p = e.getBounds(); if (shape.intersects(e.getBounds())) { takeDamage(e.doDamage()); e.takeDamage(doDamage()); return; } } return; }
db69b024-454b-4a96-82f2-47829ee914f9
6
public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception { if (splitted[0].equalsIgnoreCase("reloadmap")) { if (splitted.length < 2) { mc.dropMessage("If you don't know how to use it. You should't be using it."); return; }...
1179d4b9-fc78-481b-ac57-db4c92c2f480
9
private static void removeExceptionInstructionsEx(BasicBlock block, int blocktype, int finallytype) { InstructionSequence seq = block.getSeq(); if (finallytype == 3) { // empty finally handler for (int i = seq.length() - 1; i >= 0; i--) { seq.removeInstruction(i); } } else { ...
9594e127-6571-4c55-aeb5-2ac39ead126f
9
public synchronized void shutdown() { super.shutdown(); try { if (this.serverSocket != null) { if (this.syslogServerConfig.getShutdownWait() > 0) { try { Thread.sleep(this.syslogServerConfig.getShutdownWait()); } catch (final InterruptedException ie) { // } } this.serverSo...
41514bf2-4c82-4e7b-b4d0-f2948eb5c073
4
private String getFontSytle(int sytle, int flags) { // Get any useful data from the flags integer. String style = ""; if ((sytle & BOLD_ITALIC) == BOLD_ITALIC) { style += " BoldItalic"; } else if ((sytle & BOLD) == BOLD) { style += " Bold"; } else if ((syt...
06d5df14-6570-4db3-b78b-2f28bc8d7073
4
public static Locale getLocale(String language) { Locale lang = new Locale("fr", ""); if (language.equalsIgnoreCase("Français")) { lang = new Locale("fr", ""); } else if (language.equalsIgnoreCase("English")) { lang = new Lo...
af983f4b-5487-4c4b-800e-e0d07ac76316
5
private float diagnoseBonus() { float manners = -5 ; manners += 5 * patient.mind.relationValue(actor) ; manners += 5 * actor.mind.relationValue(patient) ; manners /= 2 ; if (actor.aboard() != theatre) return manners ; Upgrade u = null ; if (type == TYPE_FIRST_AID ) u = Sickbay.EMERGENC...
594bad52-45cd-4f17-b4cf-3854498f3035
8
public void updateStatus() { Market mkt = Market.getInstance(); Parameter p = Parameter.getInstance(); String param = p.getParam("asset treshold"); double tresh = Double.valueOf(param); int[] n = new int[2]; double[][] list = new double[size][mkt.assets.size()]; double[] centroid = new double[mkt.assets....
c4dc5d81-96b0-497a-b200-c608f92c91a7
2
public Map<String, Object> getKeys() { if (this.keyList.size() == 0) { return null; } if (this.keyList.size() > 1) { throw new RetrievalIdException("getKeys方法只适用于单个主键的表结构,但当前表结构包含多个主键:" + this.keyList); } return this.keyList.get(0); }
4696a1ac-b923-40f1-9f82-22dabfe5df86
0
public synchronized double getValue() {return value;}
efd0f422-18bd-49ee-8c27-0c92e8edbafc
7
public void revealCells(AbstractState state) { if (state.getValue() == AbstractState.EMPTY_CELL_VALUE) { this.emptyCellRevealedCount++; } this.gameboard.setFlag(state, AbstractState.VISIBLE_FLAG); AbstractState neighbor; Flag neighborFlag; Temperament neighbo...
ffdda0ab-ef94-4a87-a33d-2b10f40b0d89
1
public ImageContainer(List<Player> Players){ terrain = new ImageIcon(this.getClass().getResource(ImageTag.TERRAIN.getFilePath())).getImage(); rivers = new ImageIcon(this.getClass().getResource(ImageTag.RIVERS.getFilePath())).getImage(); roads = new ImageIcon(this.getClass().getResource(ImageTag...
47bea3af-6883-4e31-b7d1-845f8108288c
7
@Override public Move getMove(Board board){ for(int i=0; i<Board.SIZE; i++){ for(int j=0; j<Board.SIZE; j++){ if(board.validMove(i, j, color)) moves.add(new Move(i,j)); } } if(moves.isEmpty()) return null; Move optimalMove = moves.get(0); char opponent = color == 'W' ? 'B' : 'W'; do...
ecd91486-3c7b-4f63-8253-33d6d6868e8f
4
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]; esc = keys[KeyEvent.VK_ESCAPE]; }
c8c0b306-8204-4401-81b8-15b63edeaa0c
2
private static String decodeComponent(String s, String charset){ if(s == null){ return ""; } try{ return URLDecoder.decode(s, charset); }catch(UnsupportedEncodingException e){ throw new UnsupportedCharsetException(charset); } }
5868ff78-7d6a-4ce5-9beb-a14a969dc955
7
public SinglyLinkedList<NodeType> merge(SinglyLinkedList<NodeType> otherList) { Node<NodeType> ownNode = this.head.next; Node<NodeType> otherNode = otherList.head.next; Node<NodeType> prevOwnNode = this.head; Node<NodeType> nextOtherNode; if (ownNode == this.tail) { // we are empty this.concat(o...
3d618e65-ca5f-4262-870d-7e7860946b85
3
private boolean isTie() { Player[][] locations = this.board.getBoardLocations(); for (int row = 0; row < locations.length; row++) { Player[] rowLocations = locations[row]; for (int col = 0; col < rowLocations.length; col++) { Player location = rowLocations[col]; ...
47a6c88b-bbdd-4465-89ca-d8e1c8e6b3f9
2
public ComplexMatrix getLocalPropagationMatrix(int index, double energy) { MatterInterval inl = intervals.get(index); MatterInterval next = intervals.get(index + 1); Complex k_ratio; // Double.POSITIVE_INFINITY is handled here and it assigns to real part of Complex if appears k...
e37f5f40-67b3-488b-a0cc-5e0f8ed394cd
9
public void actionPerformed(ActionEvent arg0) { String[] tip = null; String[] bddlistgrpuser = new db().grpuserBDDList(dockerUserservice,dockerServeur,conn); if(arg0.getSource()==boutonLaunchappli){ new dock().copyFolderSave("copybusybox", dockerUserservice, dockerServeur, dockerRootpass); new dock().d...
2378b565-a5ae-48b5-a8ae-c2fd62a0c792
4
protected void checkWhatInteractAction(Rectangle rectangle, String s) { if (s.contains("(CHANGEMAP)")) { String[] fields; fields = s.split(":"); String[] pos = (fields[2].split(",")); float x = Integer.parseInt(pos[0]); float y = Integer.parseInt(pos[1]); Vector2 playerPos = new Vector2(x, y); ...
f17a7b8a-7132-4e9b-abfe-71667b0e3dc2
1
private Collection<File> searchDirectory(File dir, String suffix) { @SuppressWarnings("unchecked") Iterator<File> iter = FileUtils.iterateFiles(dir, new String[] { suffix }, true); List<File> collector = new ArrayList<File>(); while (iter.hasNext()) collector.add(iter.next()); return collector; }
31e338fb-dd76-45ff-8a4d-bd644d183ca0
1
protected boolean getFlipX (Node contNode) throws ParseException { logger.entering(getClass().getName(), "getFlipX", contNode); boolean flipX = false; String strValue = getProcessingInstructionValue(contNode, "flip-x"); if (strValue != null) flipX = strValue.equalsIgnoreCase("true"); ...
04e794ea-7c4f-456f-bfc3-81da2a99694a
4
public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); int factorion = -1; while (factorion < 0) { System.out.print("Please enter a positive integer (>=0): "); factorion = keyboard.nextInt(); } int secondFactorion = 0; for (int count = 0; count < Integer.toString(factorion...
32181df5-77a3-47c2-aec6-9aaa57182cfc
0
@Test public void singlePushPop() { s.push(0); assertTrue(0 == s.pop()); }
bd5f8957-8f50-4442-bb62-4e3d127bc7c9
5
public void tick(InputHandler input) { scroll += speed; scroll2 += speed; scroll %= height; scroll2 %= 16; distance += speed; if (speed < MAX_SPEED) { speed = (distance / 8 / 1000.0f) + 1; speed = Math.min(speed, MAX_SPEED); } for (int i = 0; i < entities.length; i++) { Entity e = enti...
dd76df97-3e4a-4638-b52b-dad04174b8f6
6
public void drawImageAlpha(int i, int j) { int k = 128;// was parameter i += offsetX; j += offsetY; int i1 = i + j * DrawingArea.width; int j1 = 0; int k1 = height; int l1 = width; int i2 = DrawingArea.width - l1; int j2 = 0; if (j < DrawingArea.topY) { int k2 = DrawingArea.topY - j; k1 -= k2;...
a2988060-1079-4b0a-9c02-249d4448e947
5
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PlayerImpl player = (PlayerImpl) o; if (name != null ? !name.equals(player.name) : player.name != null) return false; return true; }
32167c64-0f8f-4662-9362-fb503fc63c4e
3
@Override public int hashCode() { int result = nameLangKey != null ? nameLangKey.hashCode() : 0; result = 31 * result + (descLangKey != null ? descLangKey.hashCode() : 0); result = 31 * result + sort; result = 31 * result + (moduleId != null ? moduleId.hashCode() : 0); return...
1660be49-a0b8-4127-839c-d6a231e0585b
7
public Set<Coordinate> getLegalMoves(Coordinate startingCoord, Board board) { // three types of legal moves: // -take diagonally (if opposing color piece is present) // -move up one // -move up two (in starting position) // -ampasant - dont handle this yet Set<Coordinate> legalLocations = new LinkedHashSet<...
49e1849a-4002-4f54-8480-f4e454852dbd
4
public String toString() { StringBuffer sb = new StringBuffer().append(clazzAnalyzer.getClazz()) .append(".OuterValues["); String comma = ""; int slot = 1; for (int i = 0; i < headCount; i++) { if (i == headMinCount) sb.append("<-"); sb.append(comma).append(slot).append(":").append(head[i]); sl...
8cfac9e1-3c74-488b-afee-923de2ebce6d
2
public Conditional getRuleAnswer(int id) { Conditional ans=null; try{ stat.setQueryTimeout(30); ResultSet rs = stat.executeQuery("SELECT * FROM Answer WHERE RuleId ="+id+";"); boolean b = rs.getInt("NotFlag") ==1 ? true : false ; ans = new ...
81713800-cf3e-4a37-b8c8-6cf068c95c65
4
@Override public void move(Point startMove, Point endMove, int canvasWidth, int canvasHeight) { if(((x + endMove.getX()-startMove.getX()) > 0) && ((y + endMove.getY()-startMove.getY()) > 0) && ((x + width + endMove.getX()-startMove.getX()) < canvasWidth) && ((y + height + endMove.getY()-startMove.getY...
5cf07513-255e-4955-91cb-7a8f0ff73633
7
public ListNode reverseKGroup(ListNode head, int k) { // Start typing your Java solution below // DO NOT write main() function if (k <= 1 || head == null) return head; ListNode root = new ListNode(0); root.next = head; ListNode pre = root; ListNode cur = head; while (true) { ListNode tmp = cur; ...
5d597b6c-d2bf-4cce-8bc4-5bb94139919b
9
@SuppressWarnings("rawtypes") private Class getServiceInterface(Resource resource, ClassLoader classLoader) { try { if (!resource.isReadable()) return null; AnnotationTypeFilter filter = new AnnotationTypeFilter(Remote.class); SimpleMetadataReaderFactory simpleMetadataReaderFactory = new SimpleMetadata...
db27ff62-2e0b-49ea-826a-474e22d480d1
9
void processResponseHeaders(Map<String, List<String>> resHeaders) { for (Map.Entry<String, List<String>> entry : resHeaders.entrySet()) { String name = entry.getKey(); if (name == null) continue; // http/1.1 line List<String> values = entr...
6beb290a-f550-43d4-9eb0-e4b371e1f756
2
private boolean writePlaneColByCol(double[][] src, byte[] tmp, int startPos, int height) { try { for (int y = 0; y < height; y++) { tmp[y] = (byte)(src[y+startPos][0] + 0.5); } dos.write(tmp); return true; } catch (Exception e) { e.printStackTrace(); return false; } }
f72eecc0-34bb-4f52-acd8-eb66a848681e
8
public static int maximalRectangle(char[][] matrix) { int n = matrix.length; if(n == 0) { return 0; } int m = matrix[0].length; if(m == 0) { return 0; } int[][] rectangleMatrix = new int[n][m]; for(int i=0;i<m;i++) { rectangleMatrix[0][i] = Integer.valueOf(matri...
4046fd05-232b-463a-8232-45589904f15b
8
@Override public void update() { if(++updateCount >= REGEN_TIME) { updateCount = 0; amount++; updateImage(); } if(amount < 0) { getWorld().removeStructure(this); } else if(amount > SPREAD) { Set<Tile> neighbours = new HashSet<Tile>(); neighbours.add(getWorld().getTile(getX()-1, getY())); ...
e47b180a-b844-42cc-ab7f-ab98ceeb6895
4
@Override public void update(Observable arg0, Object roomState) { status = (GameStatus)roomState; game = (Grid) arg0; if(status == GameStatus.SHOTMISSED) game.RevealRooms(); else if(status == GameStatus.SHOTHIT) game.RevealRooms(); else if(status == GameStatus.DIEDWUMPUS) game.RevealRooms(); ...
09636763-3d5a-41f9-9a7c-7544a3daa5cc
0
public Map<String, Long> getStatistics() { throw new RuntimeException("not implemented"); }
4754e16d-24ea-4974-adab-ac6761fe71a1
8
public void setSelected(String tool, boolean yn) { int N = this.getComponentCount(); int i = 0; for (i = 0; i < N && !this.getComponent(i).getClass().equals(JButton.class); i++) ; if (i < N) { Object o = this.getComponent(i); JButton b = (JButton) o; while (i < N && !b.getActionCommand().equals(...
c86f523f-c9ec-4750-b4bb-ec97aa77b3f7
3
public synchronized int getItem() throws InterruptedException { if(warehouse.isEmpty()||warehouse.iterator().next()==null||consumedItemsCount>=warehouse.size()) wait(); return warehouse.get(consumedItemsCount++) ; }
bee6c3b8-68dc-494d-bf73-b8e9fe620f99
8
public static void main(String[] args) { String[] cards = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K","A"}; String[] faces = { "♠", "♥","♦","♣"}; int fullHouseCount = 0; for (int f = 0; f <=12; f++) { ...
fbbc3c7d-09b2-4eaa-b9ac-5a36e00e75f1
5
private void rawpath(Rectangle rec) { boolean hori = rec.width < rec.height; int doors = 0; for (int y = rec.y; y < rec.y + rec.height; y++) { for (int x = rec.x; x < rec.x + rec.width; x++) { if (data[y][x] == null) { data[y][x] = new Floor(x, y);...
46281dcb-2aea-4b34-82ed-74db71b01aca
5
@Override public boolean verifier() throws SemantiqueException { super.verifier(); if(gauche.isBoolean()){ setBoolean(); if(!droite.isBoolean()) GestionnaireSemantique.getInstance().add(new SemantiqueException("Expression droite arithmetique, booleenne attendue pour le XOR li...
3e3f8f87-3b71-47cd-ae8b-9aa1241adabd
4
public static String displayTokens(double minimumTFIDF, double minimumIDF) { String tempOutput = ""; String output = ""; int tokenCount = 0; Iterator iterator = dictionaryMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry termEntry = (Map.Entry) iter...
df0a4cab-468c-419b-96ca-2f8eb9c89803
4
public void move(){ x=x+xspeed; y=y+yspeed; if(x>1600) {isFired=false;x=0;y=0;} if(x<0) {isFired=false;x=0;y=0;} if(y>1000) {isFired=false;x=0;y=0;} if(y<0) {isFired=false;x=0;y=0;} }
5f088d2a-3b8a-4c37-899d-4ad09df093c9
8
public Color get_field_as_colour( String section, String field ) throws NoSuchKeyException, NoSuchSectionException, BadFormatException { String s; s = get_field( section, field ); s = s.toLowerCase().trim(); if( s.equals( "black" )) { return ( Color.black ); } if( s.equals( "white" )) { return ( Color.white )...
0f4b2c72-af9a-48b1-a8cb-5c04dd9bc9e9
8
public static long getPermutationCount( final List<LocationList> variations ) { if (( null == variations ) || ( 0 == variations.size() )) return 0; long count = 0; for ( int variationi = 0; variationi < variations.size(); variationi++ ) { LocationList enharmonics = variations.get( variationi ); if ( co...
beb74c9f-22a8-46fa-9713-88ea36946dd7
3
@Override public int getNumWolves() { int tempInt = 0; while(true){ tempInt = getIntFromUser("PLEASE CHOOSE HOW MANY OF WOLVES"); if((tempInt <= 0) || (tempInt >= this.players)) { displayError("You must have at least one wolf,\n " + "but fewer than the total number of players"); } else { bre...
59fa0f22-2d12-4124-9fc1-923abd5aaa6b
2
private void saveMenuItem_actionPerformed(ActionEvent event) { JFileChooser fileChooser = createFileChooser(); fileChooser.setDialogType(JFileChooser.SAVE_DIALOG); fileChooser.showSaveDialog(this); File file = fileChooser.getSelectedFile(); if (file != null) { default...
9c7eaeb5-082c-4dba-85e4-b46914d1518e
0
public Encargo(int idEncargo, int cliente, GregorianCalendar fechaEncargo, String horaEncargo, String fechaRecogida, String horaRecogida, int ubicacion, double total, double entrega) { this.idEncargo = idEncargo; this.cliente = cliente; this.fechaEncargo = fechaEncargo; this.horaEncargo ...
7369567a-a7de-41b6-b6f0-56ed79655c98
4
public Controls(GameWindow gameWindow) { boolean test = false; if (test || m_test) { System.out.println("Controls :: Controls() BEGIN"); } setGameWindow(gameWindow); int width = getGameWindow().getDrawing().gameBoardGraphics .getS...
28ee6c2e-79bc-4edc-be1f-a94dfd233acc
3
public Map<String, String> buildKeyWordMap(File indexFile) { Map<String, String> result = new HashMap<String, String>(); try { BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream(indexFile))); String s; while((s = reader.readLine()) != null) { String[] indexArray = s....
a320f2e0-1fe1-4165-8553-1714bc780b21
5
*/ public static String askForHighScore() { String playerName = ""; goToPostRaceScreen = false; try { while (!exit && !goToPostRaceScreen) { // If the display is not visible (minimised), add much more // delay if (!Display.isVisible()) { Thread.sleep(200); } // If the display is req...
30e6f8a5-5aaf-409d-a7f3-37a6116fe68f
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...
86b50131-8969-4529-a695-e01668d91e47
0
public CreditCard(int amount) { this.acceptability = new AcceptedEverywhere(); this.balance = 0; this.creditLimit = amount; }
e91613d6-832c-4c7f-9152-3a719c53d1ae
5
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Literal literal = (Literal) o; if (id != literal.id) return false; if (!Arrays.equals(entries, literal.entries)) return false; return ...
e591a62e-3f34-4b0b-8abf-0028f1eeebee
2
private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegisterActionPerformed if (!txtUsername.getText().trim().isEmpty() && !new String(txtPassword.getPassword()).trim().isEmpty()) { this.cp.username = txtUsername.getText(); this.c...
2b2a1b13-24c4-4922-a832-51d1da98c29b
1
public static BufferedImage loadSingle(String s) { BufferedImage img; try { img = ImageIO.read(Images.class.getResourceAsStream(s)); return img; } catch (IOException e) { e.printStackTrace(); Print.say("Error Loading single image"); } return null; }
b649879c-55b1-495e-933c-50ad34d42125
9
Page readPageData(RandomAccessFile raf) throws IOException { PageId pid; Page newPage = null; String pageClassName = raf.readUTF(); String idClassName = raf.readUTF(); try { Class<?> idClass = Class.forName(idClassName); Class<?> pageClass = Class.forNam...
f5253aad-f124-42b6-a868-6c39d8fd4152
6
private int buildHistory(ColumnSet set, JPanel panel) { NumberFormat formatter = new DecimalFormat("##.##"); int numRows = getNumRows(set); int numChildren = getNumChildren(set); for (int r=0; r<numRows; r++) { Color backColor; if (r % 2 == 0) ...
2f0c8475-a4bd-4c04-ba7d-9c0207fcb59a
0
public SootClass getViewClass() { return this.viewClass; }
1f4f6d8c-2a16-4b87-a3d9-6eaee04d36ce
2
public List<Material> getEatableItems() { List<String> fakeMaterials = mainConfig.getStringList("Eatable items"); List<Material> realMaterials = new ArrayList<Material>(); for (String fakeMaterial: fakeMaterials) { Material mat = Material.getMaterial(fakeMaterial.toUpperCase().trim()); if (mat != nul...
ec1b1566-3962-4c90-a59c-b0b9101b5d5f
2
private int max(int[] values) { int max = 0; for (int i=0; i<values.length; i++) { if (values[i] > max) { max = values[i]; } } return max; }
bc078ac9-4303-4d0e-9c5b-51d258d3c078
6
public void getInterfaces(Object calledObj, String methodName, Class[] paramTypes, Object[] paramValues) { this.calledObj = calledObj; this.paramTypes = paramTypes; this.paramValues = paramValues; Class classObj = (calledObj instanceof Class) ? (Class)calledObj : calledObj.getClass(); Class[] ...
5abdf541-2273-4dba-8bf3-6929c576c199
4
private void readAndPrint() throws IOException { PushbackInputStream f = new PushbackInputStream(System.in, 3); int c, c1, c2; while ((c = f.read()) != 'q') { switch (c) { case '.': System.out.print((char) c); if ((c1 = f.read()) == '0') { if ((c2 = f.read()) == '0') { System.out.print("*...
587fce9c-f8cd-467b-8b28-9618ce8c83ad
2
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { // Check that the row is not selected. JLabel label ...
43f8a9a6-d01f-4a6f-8186-5d179274b4b3
1
public String toString(){ String str = identifier.getNewName(false); if(expression != null) str += "=" + expression.toString(); return str; }
7d99e3b9-4f90-4165-9ddc-c51fcde31468
9
public int[][] floyd(int[][] g) { int[][] x = getG(); for (int[] x1 : x) { for (int j = 0; j < x.length; j++) { if (x1[j] == 0) { x1[j] = -1; } } } for (int k = 0; k < g.length; k++) { for (int i = 0;...
79fbcd87-b5a3-4e57-a91a-1ac0a11056b3
4
private void deepCleanTrees(Model mod){ for(int i=0;i<mod.getDamiera().getDim();i++) for(int j=0;j<mod.getDamiera().getDim();j++) if(!mod.getDamiera().isFreePos(new Posizione(i,j)) && !mod.getDamiera().getPezzo(new Posizione(i,j)).isNullAM()){ mod.getDamiera().getPezzo(new Posizione(i,j)).getAlberoMosse()...
9a40c1bc-f018-4657-ac61-be1d0aee1271
3
private static void activateIndexHTML(Request request, Response response) throws Exception { if (isCookeOK(request)) { response.setRedirect("/smtp/main.html", request.GetHttpVer()); return; } if (request.getParams().get(COOKE_PARAM) != null) { if (Helper.EmailValidator(request.getParams().get(COOKE_PA...
f07d6dcf-e5b2-462e-bb98-d258a2418f3a
6
public void Drop() { //assume the block can drop unless we find otherwise boolean movable = true; for( int i = 0; i < 4; i++ ) { int newLevel = currentBlock.yvalues[i] - 1; //if there is something below currentBlock then it can't //go any further down if( currentBlock.yvalues[i] == 0 || colorG...
5154cfc7-8c7b-49d2-927e-084626fa5534
9
protected void zsort (Vector v, int lo0, int hi0) { int lo = lo0; int hi = hi0; double mid; if (hi0 > lo0) { mid = ((dlentry) v.elementAt ((lo0 + hi0) / 2)).zvalue (); while (lo <= hi) { while ((lo < hi0) && (((dlentry) v.elementAt (lo)).zvalue () < mid)) ++lo; while ...
833befb3-9f50-4d85-a6b4-0d7fff6380b0
9
public int pit1(Block set, Material m, BlockFace bf) { int x = 1; int a = gen.nextInt(30); if (a < 12) { a = 12; } while (x < a) { int newx = x - 1; Block otherset = set.getRelative(bf, newx); Block clr10 = otherset.getRelative(BlockFace.DOWN, 1); Block clr20 = otherset.get...
b4ae4331-bd98-4e9c-b8bd-5684658693cc
1
private boolean checkForUpdate(String current, String online) { if (current.equals(online)) { return false; } return checkUpdate(getVersionInts(current), getVersionInts(online)); }
887b36b5-bedd-433a-9e51-50a627fa2098
3
public static void addTopicsLevelsRec(Topic root, int level, int n_topics, int iter, List<String> addedList) { int d = root.Get_depth(); if (d < level) { //System.out.println("At Level: " + root.Get_depth()); EM.preE(root);// k ArrayList<Float> float[][] edgeweight = root.Get_edgeweight(); ...
34985d97-1f65-4400-ac1d-8abed5428839
6
private static void gerarRelatorios() { Funcionario funcionario = new Funcionario(); ControleAcessoService controleAcesso = new ControleAcessoServiceImpl(); Scanner input = new Scanner(System.in); System.out.print("Informe seu CPF: "); String cpf = input.nextLine(); ...
b54e4e74-f4ef-4b8d-a204-cbd470f0f006
4
public static void main(String[] args) { try { Display.setDisplayMode(new DisplayMode(1000,1000)); Display.create(); load(); setColorMap(); if (use3D) setup3D(); else setup2D(); while(!Display.isCloseRequested()) { if (use3D) render3D(); else render2D(); } Disp...
0cdf712f-74b3-44c9-9949-bea6ac24970b
1
public void remove() { try { Thread.sleep(2000); } catch (Exception e) { LOGGER.log(Level.WARNING, "Just to shutup SonarB", e); } floorFrame.dispose(); }
7a4121df-2a73-45fc-8b94-23c7ea30687f
5
public void update(Game G){ // updates the balls position in the level if (Px + Vx > G.getWidth()-radius-1){ // if the ball is hitting the right side of the screen, make it bounce off Px = G.getWidth()-radius-1; Vx = -Vx*energyLoss; }else if (Px+Vx < radius){ Px = radius; Vx = -Vx*energyLoss; }el...
fe8122ec-d67e-4797-981e-6ffd89d91e79
7
private int excelByAgingSort(int start, int end, int rid, ArrayList<Borrower> list, HSSFWorkbook workbook, HSSFSheet sheet) { int _rid = rid; // 生成一行显示“多少天账龄”提示,可以注释掉,下面代码可注释 sheet.addMergedRegion(new CellRangeAddress(_rid, _rid, 0, 9)); HSSFRow row = sheet.createRow(_rid); HSSFCell cell = row.createCell(0); ...
af87f812-2bef-4ce4-9067-25eaabf01c7e
6
private static void maxComSubStrLen(int m, int n, String strA, String strB, int[][] intC, int[][] intB) { int i, j; for (i = 0; i <= m; i++) { intC[i][0] = 0; } for (i = 1; i <= n; i++) { intC[0][i] = 0; } for (i = 1; i <= m; i++) { for...
aa571d2f-e7e2-4fe0-be67-79765b0032fd
7
public void launchURL(String url) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class fileMgr = Class.forName("com.apple.eio.FileManager"); Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); openURL.invoke(null, new Obj...
664ea2da-e92f-45cc-a6e7-27626d2afaa3
1
public void sendDeadline(){ graphicsContainer.get().sendDeadline(); for(AIConnection client: globalClients){ client.sendDeadline(); } }
471f3e28-f2ff-4dc8-87e4-535424acd50b
3
public HashMap getInfo(String link){ String sourceName = "什么值得买-海淘"; String html = GetHTML.getHtml(link,"utf-8"); Document document = Jsoup.parse(html); Elements allEles = document.select("div.leftWrap").select("article[itemtype]"); String catagories = document.select("div.leftL...
a985b682-4922-4107-b4a1-a1239273e1bc
3
private boolean jj_3_57() { if (jj_3R_73()) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_3_56()) { jj_scanpos = xsp; break; } } return false; }
3ebd8bc4-7b22-410d-ad14-b61274570bba
0
public void setTableName(String tableName) { this.tableName = tableName; }
89368387-2e08-4574-be10-8d2a30921837
3
public void setState(int state) { // Is the correct state? if (config.isAccept()) state = ACCEPT; if (state < 0 || state >= TEXT.length) state = NORMAL; // setText(TEXT[state]); // setForeground(STATE_COLOR[state]); // setBackground(STATE_COLOR[state]); this.state = state; }
cf220dbc-3dec-4a06-9da3-3b7ade1a5f30
1
@Override public Object clone() { NodeSet nodeSet = new NodeSet(); for (int i = 0, limit = nodes.size(); i < limit; i++) { nodeSet.addNode(nodes.get(i).cloneClean()); } return nodeSet; }
cd1dae3f-7a6f-43a4-96ab-395067973093
8
public Point2D.Double nextPosition() { assert n % 2 == 1; final int halfN = (n - 1) / 2; final Point2D.Double result = new Point2D.Double(x, y); i++; if (seg == 'A') { x++; if (x > halfN) { seg = 'B'; x = halfN; y = -halfN + 1; } } else if (seg == 'B') { y++; if (y > halfN) { ...
0386c846-211b-42fe-9881-4476fbf5667c
9
private void refreshMonLocsSepPopSickmons() { double numSickMons = this.getAlpha()*this.numMonitors; double numPopMons = this.numMonitors - numSickMons; monitoredLocs = new HashSet<Integer>(this.numMonitors); boolean allAtMin = this.calcWeights(); // Add Sick monitors if (!allAtMin) { WeightedRandPerm...
48dd3772-3bb0-4bfe-b33d-7997383bd352
5
public RoomPanel initRoomPanel() { HashMap<String, ArrayList<String>> rooms = this.getOtherRooms(); while (rooms == null) { rooms = this.getOtherRooms(); try { Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } for (Entry<String, ArrayList<String>> pair : ...
6bf3d6c1-3279-4328-8e5c-7563f7abe344
9
public void Draw(Mesh mesh, Texture t) { // for(int m = 0; m < s.getMesh().length; m++){ /* * if(s.hasMesh() && s.getMesh()[0].getMat() != null){ * s.getMesh()[0].getMat().getTexture().bind(); }else * if(s.getTexture().getTexture() != null){ * s.getTexture().getTexture().bind(); }else * if(s.getText...