text
stringlengths
14
410k
label
int32
0
9
private static void decodeInput(char keyChar) { Movement.checkAllFalse(); switch (keyChar) { case 'a': Movement.MOVEMENT[Movement.LEFT] = true; Miscellaneous.log("LEFT"); break; case 'w': ...
4
public static void load(ImageSet imageSet){ DataBaseHandler db = new DataBaseHandler(); ResultSet resultado = null; String sql = "select code, name, link from images"; try { resultado = db.consultar(sql); if(resultado != null){ ...
5
private void addPlayersOnGrid() { for (Player p : players) { grid.addElement(p); grid.addElement(p.getLightTrail()); factory.addObservable(p); factory.addObserver(p); factory.addObservable(p.getLightTrail()); } }
1
public static String getSql(String path) { String content = ""; StringBuffer strbuf = new StringBuffer(); File f = new File(path); if (f.exists() && f.canRead()) { System.out.println("Filehandle auf " + path); BufferedReader read; try { read = new BufferedReader(new FileReader(f)); w...
5
@Override public CodeLineList generateCode(Code relatedClass, Method relatedMethod, boolean forCodeGeneration) { CodeLineList typeCodeList = this.getChild(0).generateCode(relatedClass, relatedMethod, true); CodeLine typeLine = typeCodeList.getCodeLine(0); String type = typeLine.getCode(); if (type.conta...
9
public int hashCode() { int _hashCode = 0; _hashCode = 29 * _hashCode + id; _hashCode = 29 * _hashCode + (idModified ? 1 : 0); if (email != null) { _hashCode = 29 * _hashCode + email.hashCode(); } _hashCode = 29 * _hashCode + (emailModified ? 1 : 0); if (salt != null) { _hashCode = 29 * _hashCod...
8
public boolean intersects(int x0, int y0, int x1, int y1) { return !(x + xr < x0 || y + yr < y0 || x - xr > x1 || y - yr > y1); }
3
@Override protected String buildSearchQuery() { Category cat = (Category) e; String query = "" + "SELECT * " + "FROM category " + "WHERE 1=1 "; if (cat.getName() != null && !cat.getName().equals("")) { query += " AND Name LIKE '%"...
6
public void action() throws Exception { if (isEnd) { return; } if (needStart) { updatePosition(); if (FieldGame.isFreeFromBricks(id, pos_x, pos_y)) { writeMailbox(BrickGame.bluetooth_mailboxSystem, direction, BrickGame.bluetooth_mailboxGotIt); writeMailbox(BrickGame.bluetooth_mailboxSystem...
7
public boolean getNappaimenTila(int nappain){ if (nappainTilat.containsKey(nappain)){ return nappainTilat.get(nappain); } else { return false; } }
1
@Override public void play() { switch( channelType ) { case SoundSystemConfig.TYPE_NORMAL: if( clip != null ) { if( toLoop ) { clip.stop(); clip.loop( Clip.LOOP_CON...
5
public void testIsEqual_LocalDate() { LocalDate test1 = new LocalDate(2005, 6, 2); LocalDate test1a = new LocalDate(2005, 6, 2); assertEquals(true, test1.isEqual(test1a)); assertEquals(true, test1a.isEqual(test1)); assertEquals(true, test1.isEqual(test1)); assertEquals(tr...
1
private static boolean doesDetectedPolygonMatchesWithRoads(ArrayList<Position> detectedPolygon, ArrayList<Road> roads) { ArrayList<Road>[] roadListByNode = new ArrayList[detectedPolygon.size()]; for (int i = 0; i < detectedPolygon.size(); i++) roadListByNode[i] = new ArrayList<Road>(); for (int i = 0; i < de...
7
@Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if(str == null) { return; } else if(str.length() + offs > maxLength) { return; } char[] letters = str.toCharArray(); boolean numbers = true; for(char c : letters) { if(!Character.isDigit(c)) { ...
5
@Override public Connection getConnection() { Connection connection = null; try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.out.println("No esta instalado el Driver JDBC"); e.printStackTrace(); ...
3
public void run(){ setSizeField(); field.initField(); showField(); while (!check.win(player) && var.counter < field.sizeField * field.sizeField) { player = Value.changePlayer(player); playersMove(player); showField(); if (check.win(player))...
5
public void addPawn(final Pawn pawn) { if (getSquareContent(pawn.getX(), pawn.getY()) == null) this.pawns.add(pawn); }
1
public static boolean percentChance(double percent){ if(percent > 100 || percent < 0){ throw new IllegalArgumentException("Percentage cannot be greater than 100 or less than 0!"); } double result = new Random().nextDouble() * 100; return result <= percent; }
2
public static void saveReservation(Reservation reservation){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { conn.setAutoCommit(false...
4
public int search(int[] A, int target) { if(target >=A[0]){ for(int i=0 ; i< A.length;i++){ if(A[i] == target) return i; } }else { for(int i= A.length -1 ; i>=0;i--){ if(A[i] == target) r...
5
public static String[] getParameterTypes(String methodTypeSig) { int pos = 1; int count = 0; while (methodTypeSig.charAt(pos) != ')') { pos = skipType(methodTypeSig, pos); count++; } String[] params = new String[count]; pos = 1; for (int i = 0; i < count; i++) { int start = pos; pos = skipType...
2
private void closeResultSet(ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } }
2
ClientThread(Socket socket) { uid = uniqueID++; this.socket = socket; try { //Creating I/O streams for a Client output = new ObjectOutputStream(socket.getOutputStream()); input = new ObjectInputStream(socket.getInputStream()); //Read username that Client broadcasts to us username = (Stri...
5
public void setDescription(String description) { this.description = description; }
0
public final JSONWriter object() throws JSONException { if (this.mode == 'i') { this.mode = 'o'; } if (this.mode == 'o' || this.mode == 'a') { this.append("{"); this.push(new JSONObject()); this.comma = false; return this; } ...
3
@Override public void commit() throws DaoException { try { mysqlConn.commit(); } catch (SQLException ex) { throw new DaoConnectException("Error in commit connection in pool."); } }
1
private void doCheatPrompt() { // hack String input = JOptionPane.showInputDialog(null); if ("yc with contacts".equals(input)) { useMask = !useMask; } else if ("17".equals(input)) { player.addExp(171717); player.setMaxHealth(171717); player.setMaxMana(171717); player.setHealth(171717); player.se...
9
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof GatewayAttributeEnumeration)) { return false; } GatewayAttributeEnumeration other = (GatewayAttributeEnumeration) objec...
5
public boolean testUser(String u) throws Exception { Connection conn =null; Statement stmt = null; ResultSet rs=null; try{ Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection(url); stmt = conn.createStatement(); ...
4
@Override public Role findRoleByRoleIdAndAccountId(int roleId, int accountId) { Role role = null; Connection cn = null; PreparedStatement ps = null; ResultSet rs = null; try { cn = ConnectionHelper.getConnection(); ps = cn.prepareStatement(QTPL_SELEC...
5
public void setTerminer(boolean terminer) { this.terminer = terminer; }
0
public ResultSet execute(String query) { try { Statement stm = this.con.createStatement(); if(stm.execute(query)){ return stm.getResultSet(); } return null; } catch (SQLException e) { LogHandler.writeStackTrace(log, e, Level.SEVERE); return null; } }
2
public void miseEnMain() { Peuple p = joueurEnCours.getPeuple(); // Récupération des unités du plateau Iterator<Territoire> it = p.getTerritoiresOccupes().iterator(); while (it.hasNext()) { Territoire t = it.next(); int nb = t.getNbUnite(); t.setNbUnite(1); p.addNbUniteEnMain(nb ...
1
protected void computeU( int k) { u.reshape(m,1, false); double u[] = this.u.data; // find the largest value in this column // this is used to normalize the column and mitigate overflow/underflow double max = 0; for( int i = k; i < m; i++ ) { // copy the hou...
6
private boolean isApplicableMethod(Method m, Class<? extends Annotation> httpMethodClass) { Class<?>[] parameters = m.getParameterTypes(); if(!m.isAnnotationPresent(httpMethodClass)) return false; if(!(parameters.length == 1 && parameters[0].equals(Arguments.class))) throw new IllegalArgumentException("Wron...
5
public static void main(String[] args) { w = new Worker(); }
0
public void actionPerformed( ActionEvent e ) { // if any data available if (TGlobal.projects.getCurrentData() != null) { if ( GUIGlobals.PROJECT_PROPERTIES_DIALOG == null ) GUIGlobals.PROJECT_PROPERTIES_DIALOG = new ProjectSettingsDialog() ; if ( GUIGlobals.PROJECT_PROPERTIES_DIALOG....
4
@SuppressWarnings({ "unchecked" }) @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String studyPath = req.getPathInfo(); if (studyPath == null) { resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Must specify study path."); ...
8
public Account getBuyer(){ return buyerInt; }
0
public boolean setProduct(Product product) { if (product.getStock() == 0) return false; this.product = product; quantity = 1; return true; }
1
public int[] getOID(byte type) throws ASN1DecoderFail { if(data[offset]!=type) throw new ASN1DecoderFail("OCTET STR: "+type+" != "+data[offset]); byte[] b_value = new byte[contentLength()]; Encoder.copyBytes(b_value, 0, data, contentLength(),offset+typeLen()+lenLen()); int len=2; for(int k=1;k<b_value.length;...
5
protected void updateDisplay() { System.out.println("HELLO"); cover.repaint(); if (displayedToolIndex >= 1) { this.startXPosition.setText("" + Math.round(cover.getStartPoint().getX())); this.startYPosition.setText("" + Math.round(cover.getStartPoint().getY())); if (displayedToolIndex > 1) { ...
4
public Node createNode(SVGGraphWriter writer, Document document, GraphLayoutCache cache, CellView view, double dx, double dy) { Rectangle2D bounds = view.getBounds(); Map attributes = view.getAllAttributes(); Element href = (Element) document.createElement("a"); String link = GraphConstants.getLink(attribute...
9
public ProgressCheckRejectionPolicy(String rejection_policy) { String policy = rejection_policy.toLowerCase(); if (!policy.startsWith(NAME)) { throw new IllegalStateException(rejection_policy); } policy = policy.substring(NAME.length()); if (policy.startsWith("=")) { ...
7
public Serie(String nom) { this.nom = nom; }
0
public static ArrayList<FullTicket> showAll(String status) { ArrayList<FullTicket> fulltickets = new ArrayList<FullTicket>(); StringBuilder query = new StringBuilder(); Database db = dbconnect(); try { query.append ("SELECT * FROM full_ticket "); if (...
5
private Session(String sessionId) { this.recordActive(); this.sessionId = sessionId; this.datas = new HashMap<String,Object>(); }
0
private void acao102(Token token) throws SemanticError { try { String nomeConstante = token.getLexeme(); idAtual = new IdentificadorConstante(nomeConstante, null, null); tabela.add(idAtual, nivelAtual); } catch (IdentificadorJaDefinidoException e) { throw new SemanticError(e.getMessage(), token.getPosit...
1
public static int[][] matrixMultiply(int[][] a, int[][] b) { if (a == null || a.length == 0 || b == null || b.length == 0) { throw new IllegalArgumentException("empty arrays"); } if (b.length != a[0].length) { throw new IllegalArgumentException("not compatible arrays"); } int m = a.length; int n ...
8
public void resizePanel(int w, int h) { if (w == 0 && h == 0) { //full screen Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); pWidth = dim.width; pHeight = dim.height; dbImage = null; //resize the panel this.setPr...
6
synchronized void resizeMap(int x, int y) { int i, i2, X, Y; short newMap[][]= new short[x][y]; X = MapColumns; if (x < MapColumns) { X = x; } Y = MapRows; if (y < MapRows) { Y = y; } for (i=0;i<X;i++) { for (i2=0;i2<Y;i2++) { try { newMap[i][i2] = shrMap[i][i2...
9
@Override public void keyReleased(final KeyEvent ke) { switch (ke.getKeyCode()) { case KeyEvent.VK_UP: isUP = false; break; case KeyEvent.VK_DOWN: isDOWN = false; break; case KeyEvent.VK_LEFT: isLEFT = false; break; case KeyEvent.VK_RIGHT: isRIGHT = false; break; case KeyEvent.VK_CO...
8
@Override public SqlSession getRequestSession() { SqlSession session = thSession.get(); if (session == null) { try { session = MyBatisManager.getDataSessionFactory().openSession(); }catch (Exception ex) { Logger.getLogger(ThreadLocalRequestData...
2
private void scheduleMatch() { clear(); try { int matchCount = matchmgr.showCount(); int teamCount = teammgr.showCount(); if (teamCount > 0) { int tm = teammgr.getById(1).getGroupId(); if (tm != 0) ...
4
public Ginsu() {}
0
private Class<? extends GAttrib> attrclass(Class<? extends GAttrib> cl) { while (true) { Class<?> p = cl.getSuperclass(); if (p == GAttrib.class) return (cl); cl = p.asSubclass(GAttrib.class); } }
5
public static boolean isEmail(String email) { if ((email == null) || (email.length() < 1) || (email.length() > 256)) { return false; } Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"); return pattern.matcher(email).matches(); }
3
public ArrayList<String> items(String string){ ArrayList<String> validItems = new ArrayList<>(); List<String> available = Utils.getItemsList(); if(!string.equals("")){ for(String item : available){ if(item.toLowerCase().startsWith(string)){ validItems.add(item); } } }else { for(String item...
4
private void RandomHeader() { int a = 0; String Path = null; String[] PicturesArray = { "Ashe.jpg", "Fiddle.jpg", "Irelia.jpg", "Jax.jpg", "Karthus.jpg", "Kayle.jpg", "Kayle2.jpg", "LB.jpg", "Lux.jpg", "Maokai.jpg", "Morgana.jpg", "Morgana2.jpg", "Noc.jpg", "Swain.jpg", "Vayne.jpg", "Xin.jpg", "Zyra.j...
3
private boolean jj_3_14() { if (jj_3R_32()) return true; return false; }
1
public void paintButtons() { buttonPane.removeAll(); buttonPane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); textField = new JTextField("port"); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.weightx = 0.5; c.weighty = 0; c.insets = MainGUI...
4
public void calcTMmodeEffectiveRefractiveIndices(){ this.effectiveRefractiveIndicesTM = new double[this.numberOfTMmeasurementsPrism]; this.effectiveErrorsTM = new double[this.numberOfTMmeasurementsPrism]; if(this.setTMerrors){ ErrorProp alpha = new ErrorProp(this.prismAngleAlphaRad, ...
3
public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { K[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != null && valueTable[i] == null) return true; } else if (identity) { for (int i = capacity...
9
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { // Entering a sub-command without parameters is assumed to be a request // for information. So display some detailed help. if (args.length == 0) { sender.sendMessage(plugin.t...
7
public void DrawBoard (){ for (int i = 0; i<9;i++){ if (i != 0 && i % 3 == 0){ System.out.println(); System.out.print("-----------"); System.out.println(); } if (DrawnTTTBoard.isEmpty(i)){ System.out.print(" "); } if (DrawnTTTBoard.hasCross(i)){ System.out.print(" X "); ...
9
public ShortAnswer(boolean needsAnswer){ prompt = InputHandler.getString("Enter the prompt for your Short Answer question:"); if (needsAnswer){ setCorrectAnswer(); } }
1
private static Stalk_Color_Below_Ring loadStalkColorBelow(String stalk_color_below) { if(stalk_color_below.equals("n")) { return Stalk_Color_Below_Ring.brown; } else if(stalk_color_below.equals("b")) { return Stalk_Color_Below_Ring.buff; } else if(stalk_color_below.equals("c")) { return Stalk...
9
@Override public void run() { try { while (true) { Thread.sleep(1000); item.setCurrentAnimation(1); Thread.sleep(1000); item.setCurrentAnimation(2); Thread.sleep(1000); item.setCurrentAnimation(0); ...
2
public EncryptedDeck requestEncDeck(User reqUser, EncryptedDeck encDeck) throws IOException, InterruptedException { Notification not = new Notification(); encryptedDeck = null; final Subscription encSub = elvin.subscribe(NOT_TYPE + " == '" + ENCRYPT_DECK_REPLY + "' && " + GAME_ID + " == '" + gameHost....
1
@Override public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 0) { return sectionNameList.get(rowIndex); } if (columnIndex == 1) { return sectionIdList.get(rowIndex); } if (columnIndex == 2) { return sectionWordsAmo...
3
public void Stop() throws InterruptedException, IOException { if (!Running) return; Running = false; Log("Stopping server..."); for(Player p : players) { p.sendMessage("Stopping server..."); } for (Level l : this.getLevelHandler().getLevelList()) { if (l != MainLevel) l.Unload(this); } Ma...
5
public Query handleInsertStatement(ZInsert s, TransactionId tId) throws DbException, simpledb.ParsingException { int tableId; try { tableId = Database.getCatalog().getTableId(s.getTable()); // will // fall // through if ...
9
public long Problem3() { long n=Long.parseLong("600851475143"); long maior=0; while(n!=1) { int i=2; while (i<=n) { if (Utility_J.isPrime(i) && n%i==0) { if (i>maior) { maior = i; } n/=i; break; } i++; } } return maior; }
5
public boolean checkStatus() { for (final TextFile availableTextFile : AvailableTextFiles.getInstance().getAvailableTextFiles()) { try { final SVNStatus status = this.svnClientManager.getStatusClient().doStatus(new File(availableTextFile.getAbsolutePath()), true); if (status != null) { final SVNS...
4
private String [] fillArrayAtDo(String [] pullValues){ if(pullValues[2].equalsIgnoreCase("FORCE") && pullValues[3].equalsIgnoreCase("COORDINATES")) return new String [] {"@DO", "FORCE_COORDINATES", pullValues[1], pullValues[4]}; else if(pullValues[2].equalsIgnoreCase("FORCE") && pullValues[3].equalsIgnoreCase("A...
8
public boolean enter(String s, SymtabEntry e) { boolean isNew = true; SymtabEntry value = lookup(s); if (value != null) if (value.getScope().equals(e.getScope())) isNew = false; m.put(s, e); if (isNew) l.add(s); return isNew; }
3
private void processType(String alias, String description) { // get type Type type = this._typeManager.getType(alias); // apply superclass if (this._extendsTypes != null && this._extendsTypes.size() > 0) { // TODO: Only supporting single inheritance Type superClass = this._extendsTypes.get(0); ...
8
public static void main(String[] args) { Base base = getBase(47); base.f(); }
0
public UserRemovalFinalized(User user) { this.user = user; }
0
ArchiveLoader(int i, FileIndex class137, FileIndex class137_23_, OndemandWorker requester, FileIndexWorker class112, int i_24_, byte[] is, int i_25_, boolean bool) { requestTable = new HashTable(16); anInt6373 = 0; requestsDeque = new Deque(); aLong6374 = 0L; do { try { indexId = i; fileIndex = class137; ...
9
public void setGrid(Grid grid) { this.grid = grid; Slot[][] newCells = new Slot[grid.getNumRows()][grid.getNumColumns()]; for (int r = 0; r < grid.getNumRows(); r++) { for (int c = 0; c < grid.getNumColumns(); c++) { if (r < cells.length && c < cells[0].length) { ...
4
public void save() { //W klasie docelowej należy sprawdzić, czy row.isEmpty() //jeśli tak, to należy nadać nazwę tabeli, do ktrej zostanie wstawiony wiersz //należy to zrobić za pomocą row.setTableName(<nazwa>); //Dopiero potem należy wywołać save z klasy bazowej if(row.isEmp...
4
public int getPerimeter() { return 4 * side; }
0
public long getLong(String key) throws JSONException { Object o = get(key); return o instanceof Number ? ((Number)o).longValue() : (long)getDouble(key); }
1
private long calcSSD (int[] org, int[] dec, int width, int height) { long ssd = 0; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int diff = org[y * width + x] - dec[y * width + x]; ssd += diff * diff; } } ret...
2
private void handleCommon(HTMLComponent comp) { currentPage.addChild(comp); if (currentPage != currentContainer()) { currentContainer().addChild(comp); } if (comp instanceof HTMLContainer) { pushContainer((HTMLContainer)comp); } if (comp instanceof HTMLInput && currentForm != null) { ((HTMLFormImpl...
4
public void setPrismAngleAlpha(double angle){ this.prismAngleAlphaDeg = angle; this.prismAngleAlphaRad = Math.toRadians(angle); this.setPrismAlpha = true; if(this.setMeasurementsPrism && this.setPrismRI)this.calcEffectiveRefractiveIndices(); }
2
private void compute_pcm_samples13(Obuffer buffer) { final float[] vp = actual_v; //int inc = v_inc; final float[] tmpOut = _tmpOut; int dvp =0; // fat chance of having this loop unroll for( int i=0; i<32; i++) { final float[] dp = d16[i]; float pcm_sample; pcm_sample = (float)(((vp[13 ...
1
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<n;j++) ...
6
public GUIController(WorldFrame<T> parent, GridPanel disp, DisplayMap displayMap, ResourceBundle res) { resources = res; display = disp; parentFrame = parent; this.displayMap = displayMap; makeControls(); occupantClasses = new TreeSet<Class>(new Comparato...
6
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Volume other = (Volume) obj; if (this.value != other.value) { return false; } ...
3
public List<List<String>> getRecords(String fundCode) throws IOException { if(records == null){ records = new HashMap<String, List<List<String>>>(); } if(records.size() > RECORDCACHESIZE){ records.clear(); } if(!records.containsKey(fundCode)){ List<List<String>> record = null; try { record...
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ResourceHand other = (ResourceHand) obj; if (brick != other.brick) return false; if (ore != other.ore) return false; if (sheep != other...
8
public static void updateYellow() { for (int i = 0; i < yOrgs.size(); i++) { Organism g1 = yOrgs.get(i); g1.move(); for (int j = i + 1; j < yOrgs.size(); j++) { Organism g2 = yOrgs.get(j); if (g1.getDist(g2) < 40) { g1.closeTo(g2); } } } }
3
public static void main(String args[]) { boolean[] isPrime = EulerMath.getSieve(1_000_000); int total = 0; for(int i = 10; i < isPrime.length; i++) if( isPrime[i] ) { boolean add = true; int x = i; int numDigits = 0; // Removes least significant while( add && x > 0 ) { if( isPr...
9
public static void main(String[] args) { Detergent x = new Detergent(); x.dilute(); x.apply(); x.scrub(); x.foam(); System.out.println(x); System.out.println("Testing base class:"); Cleanser.main(args); }
0
public String longestCommonPrefix(String[] strs) { if (strs == null || strs.length == 0) return ""; int num = strs.length; if (num == 1) return strs[0]; int len1 = strs[0].length(); String prefix = ""; for (int i...
8
public void warn(Event event) { switch(event.getTypeEvent()) { case SHUTDOWN : stop(); break; case PLAYMUSIC_END : end = true; break; case GOFORWARD_END : state = 1; robotMoving = false; break; case GOBACKWARD_END : state = 2; robotMoving = false; break; case ROTATE_END : ...
8
public int overlapEnd(int start, int end) { if (start >= end) throw new IllegalArgumentException("The end " + end + " should be greater than start " + start); IntervalNode intervalNode = root; if (root == null || start >= root.maxEnd || end <= root.start) return -1; while (...
7
public BufferedImage captureScreen() { File oDir = new File(""); String sDirectory = ""; String sPathSeparator = ""; if (!sDirectory.endsWith(File.separator)) { sPathSeparator = File.separator; } try{ sDirectory = oDir.getCanonicalPath(); } catch (IOException ex){ System.out.prin...
3