text
stringlengths
14
410k
label
int32
0
9
@Test public void testGcdHappyPath() { // the base case means that q == 0, so return p int q = 100; int p = 75; int result = BasicMath.gcd(p, q); assertEquals(result, 25); }
0
private ExpressionList expression_list(int fallbackLineNumber, int fallbackCharPosition) throws RequiredTokenException { enterRule(NonTerminal.EXPRESSION_LIST); ArrayList<Expression> expressions = new ArrayList<Expression>(); if(firstSetSatisfied(NonTerminal.EXPRESSION0)) { expressions.add(expression0()); ...
4
@Override public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) { if (cs instanceof Player) { final Player player = (Player) cs; if (Lobby.started && !Game.started) { if (DatabaseHandler.isPremium(player)) { //TODO START PARTY } else { player.sendMessage(Message...
4
public Collection<Entidad> ordenar(final String nombreCampo) { final Collection<Entidad> tmp = new TreeSet<Entidad>( // Crea una coleccion de entidades a partir de un TreeSet new Comparator<Entidad>() { // Es necesario crear un comparador de entidades para el TreeSet @Ove...
4
public void run() { System.out.println("taskLauncher run"); while (!Thread.interrupted()) { try { TaskInstance taskIns; synchronized (tasksToLaunch) { while (tasksToLaunch.isEmpty()) { tasksToLaunch.wait(); } //get the TIP ...
4
public Item next() throws NoSuchElementException { if(postingListMemoryMapped!=null && entry >=0 && entry < lexiconSize && currentPos >=0 && currentPos < toPos) { numOfReads++; int o=postingListMemoryMapped.get...
6
protected static Ptg calcSlope( Ptg[] operands ) throws CalculationException { if( operands.length != 2 ) { return new PtgErr( PtgErr.ERROR_VALUE ); } double[] yvals = PtgCalculator.getDoubleValueArray( operands[0] ); double[] xvals = PtgCalculator.getDoubleValueArray( operands[1] ); if( (xvals == null)...
7
public ResultMessage updUncheckedSend(ArrayList<SendCommodityPO> poList) { SendCommodityPO po; for(int i = 0; i < poList.size(); i ++) { po = poList.get(i); Iterator<SendCommodityPO> iter = sendList.iterator(); SendCommodityPO s; while(iter.hasNext()) { s = iter.next(); if(po.date.getTime() == s...
5
public JPanel setBoard(int n) { players[n].setMyBoard(new JPanel(new GridLayout(11,11)));//panel to store board JTextField k; for (i=0;i<11;i++) { for (j=0;j<11;j++) { if ((j!=0)&&(i!=0)) { players[n].getBboard(i-1,j-1).addActionListener(new BoardListener()); players[n].getM...
7
@Override public void run(Player interact, Entity on, InteractionType interaction) { if(interaction != InteractionType.LEFT && interaction != InteractionType.RIGHT) return; String[] vote = new String[1]; vote[0] = this.vote; Vote.instance.execute(interact, vote); }
2
static void revertMove(String cmd, int specialPiece) throws IOException { int v[][] = Board.translatePosition(cmd.charAt(0) + "" + cmd.charAt(1) + "" + cmd.charAt(2) + "" + cmd.charAt(3)); Board.board[v[0][0]][v[0][1]] = Board.board[v[1][0]][v[1][1]]; Board.board[v[1][0]][v[1][1]] = specialPiece...
5
public static void main(String[] args){ String host; int port; String platform = null; //default name boolean main = true; host = "localhost"; port = -1; //default-port 1099 Runtime runtime = Runtime.instance(); Profile profile = null; AgentContainer container = null; profile = new Prof...
1
public HashMap<Integer, Integer[]> countOfPassengerOnEveryStation(Train train) { log.debug("Start countOfPassengerOnEveryStation select"); List stationFrom = em.createQuery("select station.id, count(ticket.id), 0, schedule.seqNumber - 1 \n" + "from Train train \n" + "left...
4
public List<Integer> WolfTargets(int inWolf){ ArrayList<Integer> output = new ArrayList<Integer>(); for(PlayerAction Action : AllActions){ if(Action instanceof Attack){ if(Action.getPlayer() == inWolf) output.add(((Attack) Action).getTarget()); } } return output; }
3
public String getTextColorOfParticipant(String id) { return participants.get(id).getTextColor(); }
0
public static GameObjectType fromId(byte id) { for (GameObjectType type : values()) { if (type.id == id) return type; } return null; }
2
void DFS(String s, int start, ArrayList<String> tmp, ArrayList<ArrayList<String>> res) { if (start == s.length()) { res.add(new ArrayList(tmp)); } for (int i = start; i < s.length(); ++i) { if (isPalindrome(s, start, i)) { tmp.add(s.substring(start, i + 1)); DFS(s, i + 1, tmp, res); tmp.remove(t...
3
public Object getProperty(String key) { PreparedStatement pstmtGetProp = null; Object result = null; // build the query StringBuffer query = new StringBuffer("SELECT ").append(valueColumn).append(" FROM "); query.append(table).append(" WHERE "); query.appe...
7
public void siirra(Suunta suunta) { float x = siirtyma.x(); float y = siirtyma.y(); switch(suunta) { case OIKEA: siirtyma.aseta(x + 1, y); break; case VASEN: siirtyma.aseta(x - 1, y); break; case ALAS: siirtyma.aseta(x, y + 1); break; ...
4
public void scriviTutto () { System.out.println("Stato Iniziale: " + this.statoIniziale); System.out.println(""); System.out.println("Configurazione stato:"); for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { System.out.print("Stato[" + i + ...
5
public SignatureVisitor visitInterfaceBound() { separator = seenInterfaceBound ? ", " : " extends "; seenInterfaceBound = true; startType(); return this; }
1
private void createTablesIfNotExist(Connection cnn) { if (tableExists("cb_users", cnn)) { logger.info("table cb_users already exists"); } else { logger.info("create table cb_users"); String sql = "CREATE TABLE `cb_users` ( \n" + ...
2
private void removeBlock(final Block block) { trace.remove(block); subroutines.remove(block); catchBlocks.remove(block); handlers.remove(block); // edgeModCount is incremented by super.removeNode(). // Dominators will be recomputed automatically if needed, so just // clear the pointers to let the GC work...
6
public Version(final String version) { this.original = version; if (version == null) { this.major = null; this.minor = null; this.revision = null; this.type = null; this.build = null; return; } final Matcher m = Pa...
3
public java.lang.String getLastMessage() throws java.rmi.RemoteException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[11]); _call.setUseSOAPAct...
4
public void doTask() { // // Get the currently picked tile, fixture and mobile. See if they are // valid as targets. If so, preview in green. Otherwise, preview in // red. If the user clicks, perform the placement. final Tile PT = UI.selection.pickedTile() ; final Fixture PF = UI.selectio...
6
public static String toString(JSONObject jo) throws JSONException { StringBuffer sb = new StringBuffer(); sb.append(escape(jo.getString("name"))); sb.append("="); sb.append(escape(jo.getString("value"))); if (jo.has("expires")) { sb.append(";expires="); s...
4
@Override public void doAnswer(AnswerSide answerSide) { AnswerSideManager answerSideManager = AnswerSideManager.getInstance(); answerSideManager.setAnswerSide(answerSide); MessageDialog.getInstance().show(answerSideManager.getAnswersName() + ", фальстарт!"); answerSideManager.set...
0
public int up(){ int movedNr = 0; for(int i=0;i<getY();i++){ ArrayList<Integer> merged = new ArrayList<Integer>(2); //list of all tiles which are already merged and are not allowed to be merged again for(int u=0;u<getX()-1;u++){//go from left to right int cv = u+1; if(cells[cv][i] != 0){ Boolean ...
8
@Test public void testGetName() throws IOException { System.out.println("getName"); String antBrainFile = "cleverbrain1.brain"; AntBrain instance = new AntBrain(antBrainFile); String expResult = antBrainFile; String result = instance.getName(); assertEquals(expResult,...
0
public static void toFile(String stats, String filename) { BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(filename + ".dat")); writer.write(stats); } catch (IOException ignored) { } finally { try { if (w...
3
public SQLTableModel(String sql, String connection) { super(); Connection con = (Connection) Session.getCurrent().get(connection); try { Statement stat = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet res = stat.executeQuery(sql); ResultSetMetaData meta = re...
4
public void recordValue(String name, long timeStamp, float value) throws IOException { SensorData sd = (SensorData)paramStorage.get(name); if (sd.list_bos != null && sd.list_bos.size() >= maxBulkSize){ adapter.storeRecord(sd.list_bos.getBuffer(), sd.list_bos.size()); sd.list_bos = null; } if (sd.list_...
8
public byte[] getFileData() throws IOException { byte[] data = source.getPayload(); CRC32 check=new CRC32(); // todo: see how much this crc check is slowing us down check.update(data); if(check.getValue() != this.crc32.getValue()) { throw new IOException("CRC mismatch reloading file");...
1
public final void keyPressed(int keyCode) { switch (keyCode) { case (KEY_UP): facing = NORTH; break; case (KEY_DOWN): facing = SOUTH; break; case (KEY_LEFT): facing = WEST; break; case (KEY_RIGHT): facing = EAST; break; case (KEY_DELE...
5
public static synchronized String[] getAzubuStreamList() { //TODO ensure these streams are loaded up via text file azubuStream.areStreamsUp(); ArrayList<String> streamList = AzubuStream.getStreamList(); //ids for stream ArrayList<String> streamName = AzubuStream.getStreamName(); //name ...
3
private void setPesoLlaveEntera(int capa, int neurona, int llave, double valor){ switch (llave) { case 0: this.setPeso(capa, neurona, THRESHOLD, valor); break; case 1: this.setPeso(capa, neurona, EMBARAZOS, valor); break; case 2: this.setPeso(capa, neurona, CONCENTRACION_GLUCOSA, valor...
9
@Test public void testConcurrency1() { final int clientThreadCount = 5; int total = 0; int count = 0; for (int i = 0; i < mServerCount; i++) { try { mDhtClientArray[i].purge(); } catch (RemoteException e) { e.printStackTrace();...
8
private void handleGameStatusUpdate(GameStatusUpdateEvent event) { if (event.getStatus() == Status.DRAW || event.getStatus() == Status.OVER) { this.startNewGame(); } }
2
@Override public boolean checkLegal(String prev_pos, String new_pos) { String convert_old_pos = CUtil.pos_Finder(prev_pos); String convert_new_pos = CUtil.pos_Finder(new_pos); int pfile = Integer.parseInt(convert_old_pos.substring(0,1)); int prank = Integer.parseInt(convert_old_pos.substring(1)); int nfile...
4
public double getHealth() { return health; }
0
public void insertMedicineData(Medicine medicine) throws SQLException { try { databaseConnector = medicineConnector.getConnection(); SQLQuery = "INSERT INTO familydoctor.medicine " + "VALUES(?,?,?,?,?,?,?)"; PreparedStatement preparedStatement = databaseConnector.prepareStat...
3
public void checkCollisions() { Rectangle rBase = base.getBounds(); for (Enemy e: getEnemyList()){ Rectangle rEnemy = e.getBounds(); if(rEnemy.intersects(rBase)){ doOnCollisions(e); } } }
2
public void loadFromFile(String filename) { // Detect FILE Format String getExtension=filename.toLowerCase(); String extension="NONE"; if (getExtension.contains(".jpg")||getExtension.contains(".jpeg")) { extension="JPG"; } else if (getExtension.con...
4
public CommandState getCommandState(String uniqueID) { if(currentCommand != null && currentCommand.transactionID.equals(uniqueID)) { return CommandState.RUNNING; } synchronized (toProcessCommands) { for(CommandRequestInfo commReq:toProcessCommands) { if(commReq.transactionID.equals(uniqueID)) ...
6
@Override public void update(Graphics g) { if (seleccionado) { g.drawRect(x, y, Longitud_Casilla, Longitud_Casilla); g.fillRect(x, y, Longitud_Casilla, Longitud_Casilla); } else { g.drawRect(x, y, Longitud_Casilla, Longitud_Casilla); } switch (ti...
8
public void onPlayerDamageBlock(int par1, int par2, int par3, int par4) { syncCurrentPlayItem(); if (blockHitDelay > 0) { blockHitDelay--; return; } if (field_78779_k.func_77145_d()) { blockHitDelay = 5; netClientHandl...
9
@Override public void update() { if ((modify.get(PhysicsComponent.class)).getDirection() != Direction.DOWN) { switch ((modify.get(PhysicsComponent.class)).getDirection()) { case DOWN: setCurrentAnimation("down_walk"); break; case UP: setCurrentAnimation("up_walk"); break; case LEFT: s...
5
private void setOutliers() { _minValue = Double.MAX_VALUE; _maxValue = Double.MIN_VALUE; _totalCount = 0; _totalValue = 0d; for (DMemeList dml : _grid) { if (dml.Min() != null && dml.Max() != null) { if (_minValue == null) { ...
8
private boolean checaTipoRetornoFuncao(String tipoDoRetorno) { if(!listaDeBlocos.isEmpty()){ for(int i=0 ; i< listaDeBlocos.size();i++){ String [] tabela = listaDeBlocos.get(i).split("~"); String ehFuncao = tabela[0]; if(ehFuncao.equals("Fu...
5
public final WaiprParser.inval_return inval() throws RecognitionException { WaiprParser.inval_return retval = new WaiprParser.inval_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token set68=null; CommonTree set68_tree=null; try { dbg.enterRule(getGrammarFileName(), "inval"); if ( get...
6
public void paint(Graphics g) { if (showingMessage) { if (showMessageCount <= showMessage) { g.setColor(Color.WHITE); g.setFont(font); g.drawString(message, 25, 350); showMessageCount++; } else { showingMessage = false; } } }
2
@Override public YamlPermissionOp getOP() throws DataLoadFailedException { checkCache(PermissionType.OP, "op"); return (YamlPermissionOp) cache.get(PermissionType.OP).get("op"); }
0
public PixImage boxBlur(int numIterations) { // Replace the following line with your solution. int i; PixImage blureven = new PixImage(this); PixImage blurodd = new PixImage(this); for (i = 0; i < numIterations; i++) { if (i % 2 == 0) { blurodd = blureven.boxBluronce(); } else { blureven = bluro...
3
public void itemStateChanged (ItemEvent evt) { if (evt.getSource() == cbmi100) { appParent.intImageSizePalette = appParent.intImageOriginalSize; cbmi100.setState(true); cbmi75.setState(false); cbmi50.setState(false); cbmi25.setState(false); } else if (evt.getSource() == cbmi75) { appParent.in...
6
public boolean checkComplete() { int count = 0; //Check if all answers entered for(int i=0;i<3;i++) { for(int n=0;n<3;n++) { for(int t=0;t<3;t++) { for(int e=0;e<3;e++) { if(grid[i][n][t][e].getText().equals("")) { grid[i][n][t][e].setBackground(Color.RED); count++; ...
6
public ArrayList<Integer> findSubstring(String S, String[] L) { // Start typing your Java solution below // DO NOT write main() function if(L==null || L.length==0) return null; int n = L.length, m = L[0].length(), l=S.length(); ArrayList<Integer> res = new ArrayList<Integer>(); ...
9
protected Date parseApproximateDate(String[] words, int code) throws MalformedDateException { int qualifier = Date.EXACT; switch (code) { case ABOUT: qualifier = Date.ABOUT; break; case CALCULATED: qualifier = Date.CALCULATED; break; case ESTIMATED: qualifier = Date.ESTIMATED; ...
3
public String[] itemNames(){ if(!this.dataEntered)throw new IllegalArgumentException("no data has been entered"); String[] ret = new String[this.nItems]; for(int i=0; i<this.nItems; i++)ret[i] = this.itemNames[i]; return ret; }
2
private void altaCuenta (){ DefaultMutableTreeNode node = (DefaultMutableTreeNode) JTreeConta.getLastSelectedPathComponent(); Cuenta loadcuenta = null; if (node == null){ mensajeError("Primero debe seleccionar una Cuenta."); } else{ Object nodeInfo = node...
7
@Override public void map(String key, String value, Context context) { if(value != null && value.length() > 0 && value.charAt(0) != '#'){ String[] fields = value.split("\t"); if(fields.length == 2){ String inNode = fields[1]; context.write(inNode,"1");...
4
public int highScore() { return high(0); }
0
public static boolean divide() { if ( !popTwo() ) return false; if ( x == 0 ) { System.out.println("Cannot divide by 0."); calcStack.push(y); calcStack.push(x); return false; } else { double result = y / x; pushResul...
2
public void generateAmbit(String source, String word) { for (Place p : places) { int start = p.getLocation() - 60; int end = p.getLocation() + 60; while (start > 0 && source.charAt(start) != ' ') { // jump to space or string start start--; } ...
7
public synchronized void closeEntityManagerFactory() { if (emf != null) { emf.close(); emf = null; if (DEBUG) System.out.println("n*** Persistence finished at " + new java.util.Date()); } }
2
@Override public String getDbConnString() { return dbconnstring; }
0
public static void loadFromPreferences() { clearRecents(); Preferences prefs = Preferences.getInstance(); prefs.resetIfVersionMisMatch(PREFS_MODULE, PREFS_VERSION); for (int i = 0; i < MAX_RECENTS; i++) { String path = prefs.getStringValue(PREFS_MODULE, Integer.toString(i)); if (path == null) { break;...
2
public static ItemInfo itemByString(String string) { // int Pattern pattern = Pattern.compile("(?i)^(\\d+)$"); Matcher matcher = pattern.matcher(string); if (matcher.find()) { int id = Integer.parseInt(matcher.group(1)); return itemById(id); } //...
3
public SynthesisFilter(int channelnumber, float factor, float[] eq0) { if (d==null) { d = load_d(); d16 = splitArray(d, 16); } v1 = new float[512]; v2 = new float[512]; samples = new float[32]; channel = channelnumber; scalefactor = factor; setEQ(eq); //setQuality(HIGH_QUALI...
1
public void getPorts(String value, String type) { ArrayList<String[]> data = new ArrayList<String[]>(); Vector<String[]> target = model.getCachedData(); int index = 0; //no port case b/c default of index is 0. switch (type) { case "protocol": index = 1; break; case "name": index = 2; break;...
6
public void run(){ if (mode==1){ ready=false; kill=false; this.open(filename,auIndex); } else { while(true){ ready=false; kill=false; if(mode==2){ this.open(filename,auIndex); } if(kill) break; } } }
4
private void postPlugin(boolean isPing) throws IOException { // Server software specific section PluginDescriptionFile description = plugin.getDescription(); String pluginName = description.getName(); boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enab...
5
public void start() { VoteFrame stemFrame = new VoteFrame(this); ResultJFrame localUitslagJFrame = new ResultJFrame(this); localUitslagJFrame.setVisible(true); stemFrame.setVisible(true); this.uitslagJFrame = localUitslagJFrame; this.voteFrame = stemFrame; bool...
8
public void startupMapHook() { super.startupMapHook(); ModeController mc = getController(); MindMap model = getController().getMap(); if (Tools.safeEquals(getResourceString("file_type"), "user")) { if (model == null) return; // there may be no map open ...
9
@Override public boolean okMessage(Environmental host, CMMsg msg) { if((((msg.target()==affected)&&(affected instanceof Item)) ||(msg.target() instanceof Item)&&(affected instanceof MOB)&&(((MOB)affected).isMine(msg.target()))) &&(msg.targetMinor()==CMMsg.TYP_WATER)) { if(!dontbother.contains(msg.target()...
8
private void isLegal() { if ((null == binaryLogicalOperator)) { throw new IllegalStateException("Operator cannot be null."); } else if (((null == validatorLHS) || (null == validatorRHS))) { throw new IllegalStateException("Atleast one validator must be set for a compound validator."); } }
3
public static boolean checkRunButton() { File file = new File(outputDirField.getText()); if (!file.isAbsolute()) { file = file.getAbsoluteFile(); } if (checkFile(file) && (!file.exists() || file.isDirectory())) { updateRunButton(true); return true; } else { updateRunButton(false); return fals...
4
public Command scanInput() { Scanner scanner = new Scanner(System.in); input = scanner.nextLine(); input = input.toLowerCase(); scanner.close(); Command command = new Command(); if (input.contains("zug")) { if(this.zugConverter(input)==null){ command.setCommand(CommandConst.E...
7
@SuppressWarnings("unchecked") @Override public double getScore(Object userAnswer) { if (userAnswer == null) return 0; ArrayList<String> ans = (ArrayList<String>) userAnswer; ArrayList<String> trueAns = (ArrayList<String>) answer; ArrayList<String> ques = (ArrayList<String>) question; int matches = 0; ...
4
private void checkExpressionIsCorrect(String input) { String regex = "(\\s*\\d+\\s*[\\+\\-\\*\\/]\\s*){1,}\\d+\\s*"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(input); if (!matcher.matches()) { int failPosition = getFailPosition(pattern, input...
1
public static void incorporateFirstInputParameter(MethodSlot method) { { List parametertypespecs = method.methodParameterTypeSpecifiers(); StandardObject firstargtype = ((StandardObject)(parametertypespecs.first())); if (!method.methodFunctionP) { if (parametertypespecs.emptyP()) { { ...
8
public static void main(String [] args) { int bestK = 0; int bestJ = 0; boolean solutionFound = false; boolean noSmallerSolutionExists = false; long smallestDifference = Long.MAX_VALUE; for (int k=1; !solutionFound && !noSmallerSolutionExists; k++) { long pk = penta(k); for (int j=1; j<k; j++) { ...
9
private void drawOval(int rx1, int ry1, int w, int h, int c, boolean fill) { if (fill) { Ellipse2D e = new Ellipse2D.Double(rx1, ry1, w, h); for (int x = rx1; x <= rx1 + w; x++) for (int y = ry1; y <= ry1 + h; y++) if (e.contains(x, y)) ...
5
@Override public final void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { this.version = version; this.access = access; this.name = newClass(name); thisName = name; ...
6
@Override public int attack(final Glacor glacor, final Entity target) { target.setAttackedBy(glacor); glacor.setNextAnimation(new Animation(9955)); int SPEED = 50; glacor.setNextGraphics(new Graphics(905)); World.sendProjectile(glacor, new WorldTile(target), 963, 60, 40, SPEED, 30, 12, 0); if (!tile.co...
7
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // pour le jour meme Calendar calendar = Calendar.getInstance(); String monthS = "", dayS = ""; int year = calendar.get(Calendar.YEAR); int monthI = calendar.get(Calendar.MONTH); month...
9
@Override protected Value evaluate(ExecutionContext context) throws InterpretationException { Value val = ((AbsValueNode) this.getChildAt(0)).evaluate(context); if (val.getType() == VariableType.ARRAYLIST) { ArrayList<Value> list = (ArrayList<Value>) val.getValue(); list.rem...
3
public static void doPrint(List ocFile, List compsub, String PDBID, double x[]){ /* Filename: putative_true % % Abstract: % Print out predicted calcium location and associated ligand group % version 0.3 % Kun Zhao % Version: 0.2 % Author: Xue Wang % Date: 1/25/2008 % Replace version 0.1 ...
9
private ArrayList<String> GetProductiveNonTerminals(ArrayList<String> i_productions) { ArrayList<String> res_array = new ArrayList<String>(); for(Rule rule : m_rules) { boolean is_productive_rule = true; for(String str : rule.GetRightPart()) { ...
4
@Inject public UnmarshallerPool(@Named("unmarshalContext") JAXBContext context) { this.context = context; }
0
public byte[] readNibbleArray() throws IOException { final int size = this.readInt(); final int byteCount = ceilDiv(size, 2); final byte[] nibbles = new byte[size]; final byte[] data = new byte[byteCount]; this.in.read(data); for (int nibbleIndex = 0, byteIndex = 0, bitIndex = 1; nibbleIndex < size; nib...
2
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String string = Double.toString(d); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && ...
7
@Override public void loop() { switch (step) { case 0: if(Motors.movement.isMoving()){ if(Motors.tsf.isPressed()){ Motors.movement.backward(); reset(); step++; } } else{ Motors.movement.forward(); } break; case 1: if (delta()>500){ Motors.movement.stop(); if...
7
public int getRap_num() { return rap_num; }
0
public void nouveauTour() { tourEnCours++; if (tourEnCours >= nbTours) { Game.gameOver(); } else { // RAZ des étapes etape = 0; indexJoueurEnCours = 0; joueurEnCours = this.lstJoueurs.get(indexJoueurEnCours); // Si le peuple n'a pas de joueur, il doit en choisi...
2
@Override public void speak() { System.out.println("The poodle says \"arf\""); }
0
@Override public boolean accept(CourseRec rec) { if (!this.active || rec.getCategories().isEmpty()) return true; for (DescRec r : rec.getCategories()) if (selected.contains(r)) return true; return false; }
4
void analyzePacket(Packet packet){ boolean[] isExpanded=new boolean[root.getChildCount()]; for(int i=0;i<root.getChildCount();i++) { isExpanded[i] = tree.isExpanded(new TreePath(((DefaultMutableTreeNode) root.getChildAt(i)).getPath())); } root.removeAllChildren(); DefaultMutableTreeNod...
9
private void updateStatus() { if (RobotMap.driveTrain_leftRearMotor != null){ Robot.driveTrain.updateStatus(); } Robot.oi.updateStatus(); if (RobotMap.ratchetClimberRatchet != null){ Robot.ratchetClimber.updateStatus(); } Robot.climberActuator.upda...
3
public static String getAttributeValue(Node node, String name) { String results = null; if(node != null && !isNullOrWhitespace(name) && node instanceof Element) { NamedNodeMap attrs = node.getAttributes(); if(attrs != null) { for(int j = 0; j < attrs.getLength(); ++j) { Attr attr = (Attr)attrs.item(...
8