text
stringlengths
14
410k
label
int32
0
9
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...
8
@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...
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]; ...
1
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...
5
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...
1
public Recipe getRecipe() { if (recipe == null) { recipe = new Recipe(); } return recipe; }
1
@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; }
5
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; }...
6
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 { ...
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...
9
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...
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...
4
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...
5
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....
8
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); }
2
public synchronized double getValue() {return value;}
0
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...
7
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...
1
@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...
7
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]; }
4
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); } }
2
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...
7
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]; ...
3
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...
2
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...
9
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); ...
4
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; }
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"); ...
1
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...
4
@Test public void singlePushPop() { s.push(0); assertTrue(0 == s.pop()); }
0
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...
5
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;...
6
@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; }
5
@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...
3
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<...
7
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...
4
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 ...
2
@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...
4
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; ...
7
@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...
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...
9
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; } }
2
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...
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())); ...
8
@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(); ...
4
public Map<String, Long> getStatistics() { throw new RuntimeException("not implemented"); }
0
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(...
8
public synchronized int getItem() throws InterruptedException { if(warehouse.isEmpty()||warehouse.iterator().next()==null||consumedItemsCount>=warehouse.size()) wait(); return warehouse.get(consumedItemsCount++) ; }
3
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++) { ...
8
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);...
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...
5
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...
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;} }
4
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 )...
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...
8
@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...
3
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...
2
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 ...
0
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...
4
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....
3
*/ 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...
5
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...
6
public CreditCard(int amount) { this.acceptability = new AcceptedEverywhere(); this.balance = 0; this.creditLimit = amount; }
0
@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 ...
5
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...
2
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; }
1
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...
9
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) ...
6
public SootClass getViewClass() { return this.viewClass; }
0
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...
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; }
2
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[] ...
6
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("*...
4
@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 ...
2
public String toString(){ String str = identifier.getNewName(false); if(expression != null) str += "=" + expression.toString(); return str; }
1
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;...
9
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()...
4
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...
3
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...
6
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 ...
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...
9
private boolean checkForUpdate(String current, String online) { if (current.equals(online)) { return false; } return checkUpdate(getVersionInts(current), getVersionInts(online)); }
1
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(); ...
3
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(); ...
6
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...
4
public void remove() { try { Thread.sleep(2000); } catch (Exception e) { LOGGER.log(Level.WARNING, "Just to shutup SonarB", e); } floorFrame.dispose(); }
1
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...
5
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); ...
7
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...
6
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...
7
public void sendDeadline(){ graphicsContainer.get().sendDeadline(); for(AIConnection client: globalClients){ client.sendDeadline(); } }
1
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...
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; }
3
public void setTableName(String tableName) { this.tableName = tableName; }
0
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; }
3
@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; }
1
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) { ...
8
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...
9
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 : ...
5
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...
9