text
stringlengths
14
410k
label
int32
0
9
public RandomListNode copyRandomList(RandomListNode head) { if (head == null) return null; RandomListNode p = head, p1; while (p != null) { p1 = new RandomListNode(p.label); p1.next = p.next; p.next = p1; p = p1.next; } p = head; ...
5
public List<java.util.LinkedList<Integer>> createDepthLinkedLists(TreeNode node){ if(node==null){ return null; } List<java.util.LinkedList<Integer>> linkedListList = new ArrayList<java.util.LinkedList<Integer>>(); Queue<TreeNode> nodeQueue = new ArrayDeque<TreeNode>(); ...
6
public MatchResult match(EvaluationCtx context) { MatchResult result = null; // before matching, see if this target matches any request if (matchesAny()) return new MatchResult(MatchResult.MATCH); // first, try matching the Subjects section result = subjectsSection....
5
public Object [] getResultTypes() { int addm = (m_AdditionalMeasures != null) ? m_AdditionalMeasures.length : 0; int overall_length = RESULT_SIZE+addm; overall_length += NUM_IR_STATISTICS; overall_length += NUM_WEIGHTED_IR_STATISTICS; overall_length += NUM_UNWEIGHTED_IR_STATISTICS; ...
7
public boolean isFull() { return mChildren[0] != null && mChildren[1] != null; }
1
private static BufferedImage deriveBufferedImageFromTIFFBytes( InputStream in, Library library, int compressedBytes, int width, int height) { BufferedImage img = null; try { library.memoryManager.checkMemory(compressedBytes); /* com.sun.media.jai.codec.Se...
4
public List<Integer> rightSideView(TreeNode root) { if (root == null) return new ArrayList<>(); Queue<TreeNode> queue = new LinkedList<>(); queue.add(root); List<Integer> ret = new ArrayList<>(); while (!queue.isEmpty()) { int size = queue.size(); ...
6
public void Start() { ServerSocket serverSocket = null; Socket socket = null; try { serverSocket = new ServerSocket(7777); System.out.println(" ۵Ǿϴ."); ServerSender sender = new ServerSender(); // sender sender.start(); // ϳ ϱ . (receiver Ŭ̾Ʈ ŭ ) while (true) { socket = serverSock...
2
public void popReturnAddrs() { pc = returnAddrs.pop(); }
0
public static void setUsers(Map<String, UserEntity> users) { Scheduler.users = users; }
0
private void postPlugin(final boolean isPing) throws IOException { // The plugin's description file containg all of the plugin data such as name, version, author, etc final PluginDescriptionFile description = plugin.getDescription(); // Construct the post data final StringBuilder data =...
9
public void send(DataOutputStream outputStream)throws Exception{ //send tanks Tank s; //outputStream.writeUTF("$tank$"); outputStream.writeInt(tanks.size()); for(Map.Entry<Integer, Tank> entry : tanks.entrySet()){ s = entry.getValue(); outputStream.writeI...
5
@Override public void applyTemporaryToCurrent(){cur = new Color(tmp.getRGB());}
0
private void btnSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSwitchActionPerformed AdministradorCRUD adao = new AdministradorCRUD(MyConnection.getConnection()); if(btnSwitch.getText().equals("Actualizar")){ Administrador admin = new Administrador( ...
3
public static boolean confirmChanges(List<Path> filesToCopy, List<Path> filesToDelete, int charsToDisplay, Path outputPath) { if (filesToCopy.isEmpty() && filesToDelete.isEmpty()) { System.out.println("There are no changes."); return true; } else { System.out.println("There are changes to sync "); if (f...
9
@Override public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd.equals("Add Keyword")) { } }
1
public static int connect(int a[], int al, int ar, int b[], int bl, int br) { int max = 0; for (int i = al; i <= ar; i++) { int j = find(b, bl, br, a[i]); if (j == -1) continue; int n = 0; if (i - 1 >= 0 && j - 1 >= 0) n += connect(a, al, i - 1, b, bl, j - 1); if (i + 1 < a.length && j + 1...
7
public void setPersonApplicantions(PersonApplication personApplicantions) { PersonApplications.add(personApplicantions); }
0
@Override public <T> void deleteObject(Class<T> clazz, Long id) { Session session = null; try{ session = sessionFactory.getCurrentSession(); session.beginTransaction(); T obj = (T)session.get(clazz, id); session.delete(...
4
public void filtrarEstrategias(){ for(int i=0;i<contenedorEstrategia.getEstrategias().size();i++){ System.out.println(contenedorEstrategia.getEstrategias().get(i).server+" "+serverTF.getText()); if(!contenedorEstrategia.getEstrategias().get(i).server.equals(serverTF.getText()...
2
protected int processSortInfo (byte[] sortInfo) { // TBD // if (Outliner.DEBUG) { System.out.println("\tStan_Debug:\tPdbReaderWriter:processSortInfo"); } return SUCCESS ; } // end protected method processSortInfo;
0
private BitSet checkArcs( ListIterator<Arc> iter, String type ) throws MVDException { BitSet bs = new BitSet(); while ( iter.hasNext() ) { Arc a = iter.next(); BitSet v = a.versions; for ( int i=v.nextSetBit(0);i>=0;i=v.nextSetBit(i+1) ) { if ( bs.nextSetBit(i)==i ) throw new MVDException...
3
public void setColumnData(int i, Object value) throws Exception { if (i == 0) personID = (String) value; else if (i == 1) name = (String) value; else if (i == 2) projectID = (String) value; else if (i == 3) role = (String) value; else throw new Exception("Error: invalid ...
4
private Point fisica(float dt, float x, float y, int diametro) { x += vx; y += vy; if (vx < 0 && x <= 0 || vx > 0 && x + diametro >= getWidth()) vx = -vx; if (vy < 0 && y < 0 || vy > 0 && y + diametro >= getHeight()) vy = -vy; return new Point(Math.round(x), Math.round(y)); }
8
public static Field randomReachableField(Field from, HashMap<Field, ArrayList<Object>> conflictingHashMap, ArrayList<Field> shouldGetCleared) { LinkedList<Field> frontier = new LinkedList<Field>(); frontier.add(from); ArrayList<Field> closedSet = new ArrayList<Field>(); Field currentField = frontier.p...
7
public void drawObjects(Graphics g){ g.drawImage(bg, 0, 0); int x=75; int y=50; for(int j=0; j<4; j++){ for(int i=0; i<10; i++){ if((j*10)+i < objectList.size()){ if( objectList.get((j*10)+i) != null){ if(objectList.get((j*10)+i).itemClass==1){ g.drawImage(objectList.get((j*10)+i).getIm...
8
public void printTopTerms(int n) { List<String> seen = new ArrayList<String>(); for (int i=0; i<n; i++) { double highest = 0; String base = ""; for (Map.Entry<String, Double> e : termScore.entrySet()) { if (!seen.contains(e.getKey()) && e.getValue(...
5
public void test(){ System.out.println("HeadCount : "+getH()+" TailCount : "+getT()); }
0
public List<String> userService(String userName, String userType) { List<String> serviceList = new Vector<String>(); String currentLine; StringTokenizer strTk; BufferedReader br = getFileReader(); if(br == null) { System.err.println("Error opening file"); System.exit(1); } try { //Read until ...
7
@Override public boolean getDebugMode() { Object[] buttons = {"Debug mode", "Play Normally"}; int userInput = JOptionPane.showOptionDialog(null, "Would you like to use debug mode? \n (This will display all game-states at every update.)", "Quantum Werewolves", JOptionPane.YES_NO_OPTION...
3
@After public void tearDown() { }
0
public void onKeyPressed(KeyEvent e) { switch (e.getKeyCode()) { case VK_UP: case VK_W: directions.add(Direction.UP); break; case VK_DOWN: case VK_S: directions.add(Direction.DOWN); break; case VK_RIGHT: case VK_D: directions.add(Direction.RIGHT); break; case VK_LEFT: case VK_A: ...
8
public static void main(String[] args) { final int MAX_STUDENTS = 50, MAX_SUBJECTS = 3; int[][] marks = new int[MAX_STUDENTS][MAX_SUBJECTS]; // generate data into the marks for (int studentID = 0; studentID < MAX_STUDENTS; studentID++) { for (int subjectID = 0; subjectID < MAX_SUBJECTS; subjectID++) { ma...
4
@Override public Value evaluate(Value... operands) throws Exception { // we need two operands if (operands.length != input()) throw new EvalException("Error: wrong number of operands"); // get operands Value l = operands[0]; Value r = operands[1]; // if they are identical if (l.getType().isNumeric()...
4
static void move(int[][] board, int x, int y, int dx, int dy, int n, int m) { while (true) { if (board[x][y] == 0) { break; } int tox = x + dx; int toy = y + dy; if (!inside(tox, toy, n, m)) { break; } ...
5
public boolean assignUser(int idUser) { Action pick = new Action(idUser, true); Action drop = new Action(idUser, false); if (size() == 0) { // Agregarse a sí mismo add(pick); add(drop); } else { // Agregar otros usuarios add(1, pick); //Agregar la recogida del nuevo como primer paso int carrying =...
6
@Test public void RussianName() throws Exception { LoginCheck logCh = new LoginCheck(); name = "Вася585"; if (kesh.containsKey(name)) { assertFalse(kesh.get(name)); } else { boolean result = logCh.validate(name); kesh.put(name, result); ...
1
@Override public void undo() { if (prevSpeed == CeilingFan.HIGH) { ceilingFan.high(); } if (prevSpeed == CeilingFan.MEDIUM) { ceilingFan.medium(); } if (prevSpeed == CeilingFan.LOW) { ceilingFan.low(); } if (prevSpeed == Cei...
4
public Command getCommand() { String inputLine; // will hold the full input line String word1 = null; String word2 = null; System.out.print("> "); // print prompt inputLine = reader.nextLine(); // Find up to two words on the line. Scanner tokenizer =...
3
@Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_UP) { this.rotation = CharRotation.UP; Helper.moveIfPossible(this, x, y - 1); Helper.eatFlowerIfCollided(this); } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { this.rotation = CharRotation.DOWN; Helper.moveIfPo...
4
public void sortScoreInfo() { int i = 0, j = 0; String temp = ""; for(i = 0; i < users.size(); i++) { for(j = i; j < users.size(); j++) { if(Double.parseDouble(highScores.get(i)) < Double.parseDouble(highScores.get(j)) ) { temp = users.get(i); users.set(i, users.get(j)); users.set(j, temp); ...
3
public void testClosedPoolBehavior() throws Exception { final ObjectPool pool; try { pool = makeEmptyPool(new MethodCallPoolableObjectFactory()); } catch (UnsupportedOperationException uoe) { return; // test not supported } Object o1 = pool.borrowObject();...
9
public List<String> getPermissionCommand() { return config.getStringList("ArenaOption.PermissionCommands"); }
0
public String getSintoma() { return sintoma; }
0
@Override public void run() { for (i=0; i <= aantal; i++){ System.out.print(letter); } }
1
@Test @Ignore public void testCycles() { if (jdepend.containsCycles()) { StringBuilder sb = new StringBuilder( "The following packages contain cycles which should be removed."); for (Object element : jdepend.getPackages()) { JavaPackage pa...
3
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYSeries)) { return false; } if (!super.equals(obj)) { return false; } XYSeries that = (XYSeries) obj; if (this.maximumItemCount ...
7
private ArrayList<ServerMessage> updateConvo(String message) { ArrayList<ServerMessage> messageList = new ArrayList<ServerMessage>(); //Parse the message data into appropriate fields boolean convo_id = false; StringBuilder ci = new StringBuilder(); boolean user = false; S...
9
public int reduceHealth(int damage) { health = health - damage; if(health <= 0) { health = 0; dead = true; } if(health > maxHealth) { health = maxHealth; } return health; }
2
private static int pivot(int[] a, int low, int high) { int i1 = low, i2 = high - 1, i3 = (low + high) / 2; int a1 = a[i1], a2 = a[i2], a3 = a[i3]; int n = (a1 > a2) ? a1 : a2; int m = (a2 > a3) ? a2 : a3; if (m > n) { return (a1 > a2) ? i1 : i2; } else if (n...
8
private Map<String, Element> gatherCCSSResults() { Map<String, Element> results = new HashMap<>(); String sql = "SELECT " + " MSP.projectID " + ", MSP.siteID, BS.disname, BS.schname " + ", BC.gradeLevel " + ", BC.subjectArea " ...
8
public void DBUpdateFollowers(MOB mob) { if((mob==null)||(mob.Name().length()==0)) return; final List<DBPreparedBatchEntry> statements=new LinkedList<DBPreparedBatchEntry>(); statements.add(new DBPreparedBatchEntry("DELETE FROM CMCHFO WHERE CMUSERID='"+mob.Name()+"'")); for(int f=0;f<mob.numFollowers();f++)...
7
public static String checkBanned(String ip) throws UnknownHostException { String query = "SELECT * FROM `" + mysql_db +"`.`banlist`"; try (Connection con = getConnection(); PreparedStatement pst = con.prepareStatement(query)) { ResultSet r = pst.executeQuery(); while (r.next()) { String decIP = r.getStrin...
5
@Override public void doPost( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { String gameIdString = req.getParameter( "gameid" ); String playerIdString = req.getParameter( "playerid" ); BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreServic...
7
public void SmartIDCardInserted(CardActionEvents ce) { System.out.println("Inserted SmartID card."); long timeElapsed = 0; try { BasicService service = ce.getService(); service.open(); Reader reader = new Reader(); if (service != null) { PasswdEnterDialog passwd = new PasswdEnterDialog(reader, "Sm...
7
public void createNewPizzaProduct() { pizza = new Pizza(); }
0
public void generate(Land[][] world, float heightThreshold, float lakeLevel){ this.lakeLevel = lakeLevel; this.world = world; ArrayList<Land> startOptions = new ArrayList<Land>(); ArrayList<Land> riverStarts = new ArrayList<Land>(); for(int i = 0; i < world.length; i++){ for(int j = 0; j < world[0].length;...
6
public TableModel Update() { String columnNames[] = { "Liste Filiere"}; DefaultTableModel defModel = new DefaultTableModel(); defModel.setColumnIdentifiers(columnNames); SequenceController seq_classe= new SequenceController(); seq_classe.CreateSequence("SEQ_FILIERE"); ...
4
public int getBlood() { return blood; }
0
private void updateTrainingBall() { if (ballY >= 0.95 || ballY <= -0.95) { ballYSpeed = -ballYSpeed; } //Left Paddle (AI) if (ballX <= -0.9) { stateList.learnAll((ballY+1)/2, AI); stateList.reset(); resetRandomBall(); } stateList.add(ballX, ballY, ballYSpeed); ballX += ballXSpeed; ballY +...
3
private Graph<TypedVerTex, DefaultEdge> generateGraph(Tuple<double[][], String[][]> params) throws UserError { double[][] data1=params.getKey(); //String [][]data2=params.getValue(); int noTypes=(int)data1[0][0]; int noNoRels=(int)data1[0][1]; //------------ BuildHeteGraph x=new BuildHeteGraph(); //get...
5
protected List<Integer> getAllPrimes() { boolean[] sito = new boolean[N]; for (int i = 1; i < sito.length; i++) { sito[i] = true; } ArrayList<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < sito.length; i++) { if (sito[i]) { int i1 = i + 1; list.add(i1); int x = 2; int j ...
4
public static void main(String[] args) throws InterruptedException { PoolingClientConnectionManager pool = new PoolingClientConnectionManager(); final HttpClient httpClient = new DefaultHttpClient(); ForkJoinPool forkJoinPool = new ForkJoinPool(); ArrayList<FutureTask<Object>> futureTask...
3
public static String getJsonFromData(Data data){ ObjectMapper mapper = new ObjectMapper(); StringWriter writer = new StringWriter() ; try { mapper.writeValue(writer, data) ; } catch (JsonGenerationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JsonMappingException e)...
3
@Override public void run() { WordNode current_node; if((current_node = this.the_words.getHead()) == null) return; for(int i=0; i < this.the_words.getSize(); ++i){ if(isFormable(current_node)){ this.formable_words.add(current_node.copy()); // Keep largest words next to each other if(...
4
public String toString(){ StringBuffer sb = new StringBuffer(); switch(type){ case TYPE_VALUE: sb.append("VALUE(").append(value).append(")"); break; case TYPE_LEFT_BRACE: sb.append("LEFT BRACE({)"); break; case TYPE_RIGHT_BRACE: sb.append("RIGHT BRACE(})"); break; case TYPE_LEFT_SQUARE: ...
8
public HelpFrame() { this.setTitle("Syntaxilizer Help"); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setSize(Main.WIDTH - 200, Main.HEIGHT - 100); this.setResizable(true); this.setLocationRelativeTo(null); //center window on screen helpPane = new JEditorPane(); ...
4
@Override public String getJSONString() { StringBuilder json = new StringBuilder() .append("{") .append(super.getJSONBaseString()); if(this.getRepeat() != null) { json.append("\"repeat\":{"); for(int i=0;i<7;i++) { json.append("\"").append(Daily.days[i]).append("\": ").append(this.getRepeat()[i]...
7
public BufferedImage getImage() { if (image == null) { try { return ImageIO.read(new File("res/default.png")); } catch (IOException ex) { return null; } } else { return image; } }
2
private void mapRawData(String[] tickers) { System.out.println("total number of tickers: " + tickers.length); int counter = 0; // (" 2 36 44 9 9 9 9 9 9 9 9 9 9 1 1 1"); for (String tk : tickers) { StringBuilder saveAsText = new StringBuilder(); saveAsText.append(cnnForecast(tk).trim()); saveAsText.ap...
2
public int[] getMessageTimestamps() { return messageTimestamps; }
0
public boolean onCommand(CommandSender sender, String[] args) { // get the groups PermissionGroup[] groups = plugin.permissions.getGroups(); // create a comparator Comparator<PermissionGroup> rankComparator = new RankComparator(); // and sort the groups Arrays.sort(groups, rankComparator); // print ...
3
public String getAccessToken_secret() { return accessToken_secret; }
0
final public void start(BlockStatement node) throws ParseException { label_1: while (true) { assign(node); jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: case STATEMENT: case PRINT: case READ: case TYPE: case ID: ...
8
public String getGoTo() { return goTo; }
0
private String decodeAuthCookieSafely(Cookie cookie) { if (cookie == null) { return null; } String decodedCookieValue = null; try { decodedCookieValue = Base64Utils.decode(cookie.getValue()); } catch (Base64Exception e) { LOGGER.log(Level.WARNI...
2
public boolean playerHasItem2(int itemID) { for (int i= 0; i < playerItems.length; i++) { if (playerItems[i] == itemID+1) { playerAxe = itemID; return true; } } for (int i2 = 0; i2 < playerEquipment.length; i2++) { if (playerEquipment[i2] == itemID) { ...
4
public void addStateMarker(int state, double time) { plot.addDomainMarker(new ValueMarker(time, Color.BLUE, new BasicStroke((float) 2.5))); switch(state) { case 2: XYTextAnnotation text = new XYTextAnnotation("Armed", time, 500); text.setFont(new Font("SansSer...
6
private void stop() { if (isMovingRight() == false && isMovingLeft() == false) { speedX = 0; } if (isMovingRight() == false && isMovingLeft() == true) { moveLeft(); } if (isMovingRight() == true && isMovingLeft() == false) { moveRight(); } }
6
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //¶Ӧı,ĽȷĽ request.setCharacterEncoding("gbk"); response.setContentType("text/html;charset=gbk"); //ĬϵϢ String searchPath = "D:\\Bingo_Index"; ...
8
public static double absDiff(double[] obs, double[] sim, double missingValue) { sameArrayLen(obs, sim); double abs = 0; for (int i = 0; i < obs.length; i++) { if (obs[i] > missingValue) { abs += Math.abs(obs[i] - sim[i]); } } return abs; ...
2
private static void processToken(String token, Stack<String> operators, Vector<String> postfix) { if(token.matches("\\p{Alpha}+")) // If is an ID puts it on the vector { postfix.add(token); } else if(token.equals(")")) // If ")" pop until find matching "(" { while(!operators.empty()) { Stri...
8
public List<String>delNickName(String nickName) throws NickNameNotExist { if(!nickNameAlreadyExist(nickName)) throw new NickNameNotExist(); for (Personne p : listPer) { if(p.getListNickName().contains(nickName)) { int rang = p.getListNickName().indexOf(nickName); p.getListNickName().remove(rang); bre...
3
private boolean valueSearchNonNull(Entry n, Object value) { // Check this node for the value if (value.equals(n.value)) return true; // Check left and right subtrees for value return (n.left != null && valueSearchNonNull(n.left, value)) || (n.right != null &&...
4
static final void method106() { IndexLoader.anInt669 = 0; for (int i = 0; i < Class150.anInt2057; i++) { Npc class318_sub1_sub3_sub3_sub1 = (((Class348_Sub22) (Class348_Sub22) Class282.aClass356_3654 .get((long) EntityPacket.anIntArray1233[i])) .aClass318_Sub1_Sub3_Sub3_Sub1_6859); if ((((Mo...
7
public void equipBraves(IndianSettlement is) { final Specification spec = getSpecification(); List<Unit> units = is.getUnitList(); units.addAll(is.getTile().getUnitList()); roles: for (Role r : new Role[] { Role.DRAGOON, Role.SOLDIER, Role.SCOUT ...
7
public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getActionCommand() == "Exit") { this.exitButtonActionPerformed(e); } else if (e.getActionCommand() == "Sort!") { startSortButtonActionPerformed(e); } else if (e.getActionCommand() == "Source Dir") { sourceDirUpdate()...
9
private void programmerAutosaveButton(java.awt.event.ActionEvent evt) { try { List<String> userInput = Arrays.asList(programmerText.getText().split("\n")); PrintWriter out; DateFormat dateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss"); ...
2
private String httpRequest(Map<String, String> param, String method) { Log.d("httpRequest", "start to send http request"); // 添加其他默认需要的参数 param.put("method", method); if (!param.containsKey("v")){ param.put("v", Ver); } if (!param.containsKey("appKey")){ ...
9
public static float getYawByF(int f) { return f * 360.0f / 4.0f; }
0
@Override public void step(PulsatioGame game, float delta) { stage.act(delta); stage.draw(); heartbeatTimer += delta; if (heartbeatTimer >= 12) { heartbeatTimer = 0; game.assets.get("sound/GGJ13_Theme.wav", Sound.class).play(adrenalineteam0*3f); } if (placementPhase && player0placed && player1p...
9
private void handleInput() { //Toggle debug screen if(in.getKeypress(debugButton)) { debugMenu=!debugMenu; } //Toggle music if(in.getKeypress(music)) { AudioManager.epic.toggle(); } //Toggle flying if(in.getKeypress(fly)) { this.cam.fly=!this.cam.fly; this.grounded=false; } //Hos...
8
public List<Planet> NeutralPlanets() { List<Planet> r = new ArrayList<Planet>(); for (Planet p : planets) { if (p.Owner() == 0) { r.add(p); } } return r; }
2
public List<Long> getLongList(String path) { List<?> list = getList(path); if (list == null) { return new ArrayList<Long>(0); } List<Long> result = new ArrayList<Long>(); for (Object object : list) { if (object instanceof Long) { result....
8
private static ImageProcessor xGradient(ImageProcessor ip){ ImageProcessor result = ip.duplicate(); int[] Gx = {-1, 0, 1, -2, 0, 2, -1, 0, 1}; result.convolve3x3(Gx); return result; }
0
public int compareTo(CHRTile tile){ if(tile.tileWidth != tileWidth){ return ((tile.tileWidth < tileWidth) ? 1 : -1); } if(tile.tileHeight != tileHeight){ return ((tile.tileHeight < tileHeight) ? 1 : -1); } if(IMAGE_SIMILARITY_THRESHO...
9
public static int fac(int k) { if (k < 0) return 0; int kfac = 1; while (k > 1) { kfac = kfac * k; k = k - 1; } return kfac; }
2
public void saveScoreStats() { File file = new File("Scores.txt"); boolean flag = false; FileWriter writer; ArrayList<String> scoreData = new ArrayList<String>(); ListIterator<String> iterator; try { Scanner s = new Scanner(file); while(s.hasNextLine()) { scoreData.add(s.nextLine()); } s.clo...
7
public void removePush() { if (stack != null) instr = stack.mergeIntoExpression(instr); }
1
@RequestMapping(value="inserirDisciplina",method = RequestMethod.POST) public String inserir(@Valid Disciplinas disciplina, BindingResult result, final RedirectAttributes redirectAttributes) { if(disciplina.getCodDisciplina()==null || disciplina.getCodDisciplina().equals("")) { System.out.println("Erro"); retu...
6