text
stringlengths
14
410k
label
int32
0
9
public static int raceToId(String race) { HashMap<String, Integer> races = new HashMap<String, Integer>(); races.put("baden-württemberg", 1); races.put("bayern", 2); races.put("berlin", 3); races.put("brandenburg", 4); races.put("bremen", 5); races.put("hamburg", 6); races.put("hessen", 7); races.put(...
1
@Override public String toString() { if (this.type == NUM) { return "NUM: " + this.value; } else if (this.type == CMD) { return "CMD: " + this.name; } else if (this.type == UNK) { return "UNK"; } else if (this.type =...
9
static final public ValueExpression value_spec() throws ParseException { Token tok; TupleExpression tup; VariableExpression var; ActorIdentifier actId; if (jj_2_12(4)) { tok = jj_consume_token(TUPLETAG); tup = new TupleExpression(tok.image); jj_cons...
9
public static Circle reconstructCircle( final String[] elements ) { if( elements == null ) { throw new IllegalArgumentException( "The parameter 'elements' must not be 'null'." ); } final Map< String, Object > attributesP = new HashMap< String, Object >(); final Map< String, O...
9
public static int[][] getTiles(int dx, int dy, int width, int blockAdd, int tilesetAdd, int tilesetBankOffset) { int[] rom = curGb.getROM(); int[][] tmp = new int[24][20]; int add = blockAdd; for (int y=0;y<5;y++) { for (int x=0;x<6;x++) { int block = getBlockVal(tilesetBankOffset, rom, add); for (in...
6
public static void main(String[] args){ HybridTrie hbt = new HybridTrie(); String[] arr = {"abc", "abcd", "abcde", "bcde", "bce", "eofl", "cctv"}; for(int i = 0; i < arr.length; i++){ String s = arr[i]; hbt.put(s, i + 1); } Integer result = hbt.get("cctv"); LinkedList<String> resultList = (LinkedList<...
5
@Override public void run() { String s; while(true) { if (!csConnection.m_incomingMsgQueue.isEmpty()) { s = csConnection.m_incomingMsgQueue.remove(); //System.out.println("PIM:" + s); try { JSONObject j = new JSONObject(s); if (j.has("Message")) { System.out.println(j.get("Mess...
7
public static void makeCompactGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) { SpringLayout layout; try { layout = (SpringLayout)pa...
7
public void addSeries(float[] values, int seriesNumber, Comparable seriesKey) { invalidateRangeInfo(); int i; if (values == null) { throw new IllegalArgumentException("TimeSeriesDataset.addSeries(): " + "cannot add null array of values."); ...
8
public void evalGarbledGate(boolean alice_interpret, boolean bob_interpret) { int i; int permuted_index; byte[] dec_key; byte[] cipher; byte perm_dec_key; // Do something only if gate hasn't been evaluated yet if (garbled_value == null) { // Construc...
8
public int getLevel() { int level = 0; if (item != null) { level = item.getLevel(); } return level; }
1
private void drawLoginScreen(boolean originalLoginScreen) { setupLoginScreen(); loginBoxLeftBackgroundTile.initDrawingArea(); titleBoxImage.drawImage(0, 0); int x = 360; int y = 200; if (loginScreenState == 0) { int _y = y / 2 + 80; fontSmall.drawCentredTextWithPotentialShadow(onDemandFetcher.statusSt...
8
public static WidgetChild getCompass() { final Record record = get(); update(record); if (record.index_widget == -1) { return null; } final Widget widget = Widgets.get(record.index_widget); if (widget != null) { if (record.index_compass == -1) { for (final WidgetChild widgetChild : widget.getChild...
8
public void run(String arg) { ImagePlus image = IJ.getImage(); int currentChannel = image.getChannel(); int currentSlice = image.getSlice(); int currentFrame = image.getFrame(); ImageStack stack = image.getStack(); HashMap<Integer, Integer> histogram = new HashMap<Integer...
8
private boolean r_postlude() { int among_var; int v_1; // repeat, line 56 replab0: while(true) { v_1 = cursor; lab1: do { // (, line 56 ...
8
private void moveUp() { int[] rows = table.getSelectedRows(); DefaultTableModel model = (DefaultTableModel) table.getModel(); try { if (model.getRowCount() >= 2) { model.moveRow(rows[0], rows[rows.length - 1], rows[0] - 1); table.setRowSelectionInterval(rows[0] - 1, rows[rows.length - 1] - 1); ...
2
public Long getId() { return id; }
0
private void initGui() { this.setPreferredSize(new Dimension(640, 480)); this.setSize(new Dimension(640, 480)); this.setResizable(false); this.setBackground(Color.WHITE); this.setLayout(new BorderLayout()); this.setDefaultCloseOperation(EXIT_ON_CLOSE); chatWindow = new JPanel(); chatWindow.setLayout...
5
public Match getCurrentMatch(int userID){ if(alstNewMatchRequests.contains(userID)){ return this.upcomingMatches.peek(); } return this.runningMatch; }
1
private void p_searchPage(){ p_searchPane = new JPanel(); p_searchPane.setBackground(SystemColor.activeCaption); p_searchPane.setLayout(null); JLabel lbl_searchPatient = new JLabel("Search Patient"); lbl_searchPatient.setFont(new Font("Arial", Font.BOLD, 30)); lbl_searchPatient.setBounds(376, 20, 221, 41...
4
public temp (String text) { this.text = text; }
0
public GraphicInterface(final TaskManager tManager) { super("Running Task Program"); setBounds(500,100,570,520); setLayout(null); this.tManager = tManager; name = "gg"; laTitle.setBounds(120,10,100,15); add(laTitle); laActiveTasks.setBounds(400,10,100,15...
5
protected Collection getCells(Collection cells, boolean edges, boolean ordered) { Set result = null; if (ordered && order != null) { result = new TreeSet(order); } else { result = new LinkedHashSet(); } Iterator it = cells.iterator(); while (it.hasNext()) { Object cell = it.next(); if ((e...
9
public int firstMissingPositive(int[] A) { if (A.length == 0) return 1; boolean[] f = new boolean[A.length+1]; for (int i=0;i<=A.length; i++) f[i] = false; for (int i = 0 ;i< A.length ;i++) { if (A[i] > 0 && A[i] <= A.length + 1) { f[A[i] -1] =true; } } int j = 0; while ( f[j] ) { ...
6
public void turnLeft() { if(speedX > 0) { this.speedX = 0; this.speedY = speedOfSnake; } else if(speedX < 0){ this.speedX = 0; this.speedY = -speedOfSnake; } else if(speedY > 0) { this.speedY = 0; this.speedX = -speedOfSnake; } else if(speedY < 0) { this.speedY = 0; this.speedX = speedOf...
4
private int checkCross(GameBoardMark playerMark) { int k, l, x; for (k = 1; k < 7; k++) { for (l = 1; l < 7; l++) { x = k + 10 * l; if (gameBoard.mainBoard()[x] == playerMark.index && gameBoard.mainBoard()[x + 2] == playerMark.index && gameBoard.mainBoard()[x...
7
private void OkButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OkButtonActionPerformed String user = UsernameText.getText(); String pass = new String(PasswordText.getPassword()); if (!user.equals("") && !pass.equals("")) { String q = "select contrasenna from ...
8
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { //first goal is to be able to receive and process //a well formatted XML moveTwo piggybacked on a POST //this gives me a raw stream to payload of Post requ...
1
public void flush() { BufferedWriter saveWriter = null; try { saveWriter = new BufferedWriter(new FileWriter(saveFile)); saveWriter.write("# Automatically generated file; DO NOT EDIT\n"); saveWriter.write("#Contacts\n"); for(Contact contact : contactList) { saveWriter.write(((ContactI...
3
public JSONObject getJSONObject(int index) throws JSONException { Object object = get(index); if (object instanceof JSONObject) { return (JSONObject)object; } throw new JSONException("JSONArray[" + index + "] is not a JSONObject."); }
1
public static void msg(String msg, boolean debugging_on) { if(debugging_on) System.err.println("DEBUG ("+System.currentTimeMillis()+"): "+msg); }
1
private boolean checkFieldColumnWinn(int columnNumber, char cellValue){ boolean checkColumn = true; for (int i = 0; i <= fieldSize - WIN_NUMBER_OF_CELLS ; i++){ checkColumn = true; for(int j = i; j < i + WIN_NUMBER_OF_CELLS; j++){ if( field[columnNumber][j] != c...
4
public static void main(String[] args){ int[] p = new int[(int)1e6]; for(int i=2;i<1e6;i++) p[i]=1; sieve(p); int count=0; for(int i=2;i<1e6;i++){ if (p[i]==1){ List<Integer> rotations = rotate(i); boolean circular = true; for(Integer k:rotations){ if(p[k] == 0) circular = false; } ...
6
private void cftbsub(int n, float[] a, int offa, int[] ip, int nw, float[] w) { if (n > 8) { if (n > 32) { cftb1st(n, a, offa, w, nw - (n >> 2)); if ((ConcurrencyUtils.getNumberOfThreads() > 1) && (n > ConcurrencyUtils.getThreadsBeginN_1D_FFT_2Threads())) { ...
9
public void resetSyntax() { for (int i = ctype.length; --i >= 0;) ctype[i] = 0; }
1
public boolean is(Object key) { Boolean b = get(key); if (b == null) { return false; } return b; }
1
@Override public double escapeTime(Complex point, Complex seed) { // Keep iterating until either n is reached or divergence is found int i = 0; while (point.modulusSquared() < escapeSquared && i < iterations) { // Z(i+1) = (Z(i) * Z(i)) + c point = point.square().add(...
2
private void deepLearn(){ DL_layers++; //Add another layer if (DL_layers < DL_maxlayers){ int dl = drawNet.layers.get(1).length - DL_layers*DL_drawdelta, pl = playNet.layers.get(1).length - DL_layers*DL_playdelta; //if (Game.verbose) System.out.println("Casandra: Adding DEEP LEARNING layer #"+DL_lay...
1
private Giocatore[] getBestAtt(Formazione f){ Giocatore[] att=new Giocatore[3]; Giocatore[] squad=f.getGiocatori(); Giocatore tmp=squad[0]; int st=0, nd=0, temp=0; for(int j=0;j<3;j++){ for(int i=1;i<11;i++){ if(squad[i].getAttacco()>=tmp.getAttacco() && (i!=st || i!=nd) ){ tmp=squad[i]; temp...
7
@Override public void mouseReleased(MouseEvent me) { if (me.getSource() instanceof JMenuItem) { JMenuItem menuItem = (JMenuItem) me.getSource(); if (menuItem.getActionCommand().compareTo("FILE->INSERT") == 0) { StudentsInformation.StudentsName(stdname.getText()); ...
7
public static void mergePropertiesIntoMap(Properties props, Map<String, Object> map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (props != null) { for (Enumeration<?> en = props.propertyNames(); en .hasMoreElements();) { String key = (String) en.nextElem...
5
public static int findMaximumPathSum(){ String linestr; String[] tokens; int lines = 0, i = 0; int j,temp; try{ BufferedReader br = new BufferedReader(new FileReader("triangle")); LineNumberReader reader = new LineNumberReader(new BufferedReader(new FileReader("triangle"))); while((reader.readLine(...
8
public int read(BitReader bitreader) throws JSONException { try { this.width = 0; Symbol symbol = this.table; while (symbol.integer == none) { this.width += 1; symbol = bitreader.bit() ? symbol.one : symbol.zero; } tick(...
4
@Override @SuppressWarnings({ "nls", "boxing" }) protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder enc) { super.initialize(type, oldInstance, newInstance, enc); if (type != oldInstance.getClass()) { return; } MenuBar bar = (MenuBar) oldInstance...
8
public void run() { try { /* * A server socket is opened with a connectivity queue of a size specified in int floodProtection. Concurrent login handling under normal * circumstances should be handled properly, but denial of service attacks via massive parallel program login...
5
public boolean getBoolean(String key) throws JSONException { Object object = this.get(key); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equals...
6
public void writeTo(String outname) throws IOException { if(!assembled) { throw new IllegalStateException("assemble method must be called before writeTo"); } WordWriter out; if(outname.equals("-")) { out = new WordWriter(System.out, littleEndian); ...
2
private Combination<Colors> generateCombination(Answer lastAnswer) { // / to be completed !!! String combi = "RRRRR"; List<Token<Colors>> colors = new ArrayList<Token<Colors>>(); for (int i = 0; i < combi.length(); i++) { colors.add(new Token<Colors>(Colors.valueOf(combi.substring(i, i + 1)))); ...
1
@Override public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String[] args) { if (!sender.hasPermission("VanishCommand.isVanish")) { sender.sendMessage(ChatColor.RED + "No permission!"); return true; } if (args.length != 1) return false; Player p = Bukkit.getPlayer(args[0]...
4
private <T extends NeuralNetwork> ArrayList<T> merge(ArrayList<T> one,ArrayList<T> two){ ArrayList<T> merged=new ArrayList<>(); while(!one.isEmpty()&&!two.isEmpty()){ if(one.get(0).getFitness()>two.get(0).getFitness()) merged.add(one.remove(0)); else if(one.get(0)...
7
public static void main(String[] args){ TreeNode root = new TreeNode(1); TreeNode node1 = new TreeNode(2); TreeNode node2 = new TreeNode(3); TreeNode node3 = new TreeNode(4); root.left = node1; root.right = node2; node2.left = node3; List<List<Integer>> re...
1
public static void compareFiles(File f1, File f2) throws IOException { assertEquals(f1.length(), f2.length()); try (BufferedInputStream b1 = new BufferedInputStream(new FileInputStream(f1)); BufferedInputStream b2 = new BufferedInputStream(new FileInputStream(f2))) { byte[] buf1 = new byte[1024 * 16], buf2 =...
2
public static void main(String[] args) { try { Socket socket = new Socket("localhost", 3300); new ObjectOutputStream(socket.getOutputStream()).writeObject(new SimpleMessage("pera", "marko", 1)); System.out.println(new ObjectInputStream(socket.getInputStream()).readUTF()); } catch (UnknownHostException ...
2
public void destroy(BitacoraId id) throws NonexistentEntityException, RollbackFailureException, Exception { EntityManager em = null; try { utx.begin(); em = getEntityManager(); Bitacora bitacora; try { bitacora = em.getReference(Bitacora.cl...
4
public char nextClean() throws JSONException { for (; ; ) { char c = next(); if (c == 0 || c > ' ') { return c; } } }
3
@Override public void paint(Graphics jframeg) { //super.paint(g); Graphics g = bi.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, 500, 500); for (int i = 0; i < points.size(); i++) { GeoRef p = points.get(i); ...
6
protected int getRowofvalue(int a) { int lngRow = 0; if(lisCol.get(0).contains(a)) { lngRow = 0; }else if(lisCol.get(1).contains(a)) { lngRow = 1; } else if(lisCol.get(2).contains(a)) { lngRow = 2; } else if(lisCol.get(3).contains(a)) { ...
5
public void setGraphComponent(mxGraphComponent graphComponent) { mxGraphComponent oldValue = this.graphComponent; if (this.graphComponent != null) { this.graphComponent.getGraph().removeListener(repaintHandler); this.graphComponent.getGraphControl().removeComponentListener( componentHandler); this...
3
private static void test(Mat src, Mat tpl) { //Imshow.show(src); //Imshow.show(tpl); // generate log polar images Mat srcPolar = new Mat(src.rows(), src.cols(), src.type()); Mat tplPolar = new Mat(tpl.rows(), tpl.cols(), tpl.type()); Mat srcCart = new Mat(src.rows(), src.cols(), src.type()); Mat tpl...
5
public void addResponseHeader(String name, String value) { response.add(name+": "+value+"\n"); }
0
int divide(int dividend, int divisor) { long a = Math.abs(( long)dividend); long b = Math.abs(( long)divisor); int ans = 0, i = 0; while (a > b){ i++; b = b << 1; } while (i >= 0){ if (a >= b){ a -= b; ...
4
public void init(Map attributes) throws InvalidKeyException, IllegalStateException { synchronized(lock) { if (state != -1) { throw new IllegalStateException(); } Integer want = (Integer) attributes.get(STATE); if (want != null) { switch (want.intValu...
6
@Override public void processPacket(Packet p) { String username = ""; String message = ""; ChannelBuffer data = p.getData(); int updateFlags = data.readByte(); if ((updateFlags & 0x1) == 0x1) { int messagesToRead = p.getData().readByte(); for (int i = ...
4
void rightRotate(RedBlackNode y) { RedBlackNode x = y.left; // set x y.left = x.right; // turn x's right subtree into y's left subtree if(x.right != nil) x.right.parent = y; x.parent = y.parent; // link y's parent to x if(y.parent == nil) root = x; else if (y == y.pa...
3
public static String createHref(String contextPath, String actionPath, String action) { StringBuffer sb = new StringBuffer(); if (contextPath != null) { sb.append(contextPath); } if (actionPath != null) { sb.append(actionPath); if (sb.charAt(sb.length()-1) != '/') { sb.append('/'); } } St...
8
@Test public void testServerGetQueueTimeoutDisconnectIndividualHashEx() { LOGGER.log(Level.INFO, "----- STARTING TEST testServerGetQueueTimeoutDisconnectIndividualHashEx -----"); boolean exception_other = false; String client_hash = ""; try { server2.setUseMessageQueues(t...
5
public T[] getFooArray() { return fooArray; }
0
public int getBumonCode() { return bumonCode; }
0
public void bindThumbnailTexture(Minecraft var1) { if(this.texturePackThumbnail != null && this.texturePackName < 0) { this.texturePackName = var1.renderEngine.allocateAndSetupTexture(this.texturePackThumbnail); } if(this.texturePackThumbnail != null) { var1.renderEngine.bindTexture...
3
public boolean insertar(BeanProducto bean) { boolean estado = false; try { PreparedStatement ps = MySQL_Connection.getConection(). prepareStatement(insertar); ps.setString(1, bean.getNombre()); estado = ps.executeUpdate() != 0; ps.cl...
1
@Test public void testPlayGame() { Player winPlayer = _underTest.playGame(_player1, _player2); if (winPlayer != null) // it was no tie { assertEquals(1, winPlayer.getNumberOfWins()); // use knowledge about Player to verify behaviour. } }
1
public void render(GameContainer gc, Graphics g) throws SlickException { if (state != STATE.INVISIBLE) { if (state == STATE.ON || state == STATE.REFRESH) CustomRender(gc, g); if (state == STATE.FREEZE_NEXT) { sence.getGraphics().clear(); CustomRender(gc, s...
5
public void update(int wx, int wy, int wz, int r) { depth = wz; visible = new boolean[world.width()][world.height()]; for (int x = -r; x < r; x++) { for (int y = -r; y < r; y++) { if (x*x + y*y > r*r) continue; if (wx + x < 0 || wx + x >= world.width() || wy + y < 0 || wy + y >= world.height()...
9
private void getModsPath(){ String OS = System.getProperty("os.name").toLowerCase(); OS = OS.substring(0,3); if(OS.equals("win")){ modsPath = System.getProperty("user.home")+ "/AppData/Roaming/.minecraft/mods"; } else if(OS.equals("mac")){ modsPath =System.getProperty("user.home")+"/Library/Application...
3
public void parseXML() throws FileNotFoundException { try { if (file != null) { DocumentBuilderFactory newDocumentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder newBuilder = newDocumentBuilderFactory.newDocumentBuilder(); Docum...
7
public static JSONObject getJSON(HttpResponse response) throws IOException { final String json = getString(response); if (json == null || json.length() == 0) throw new IOException("JSON response is empty"); try { return new JSONObject(json); } catch (JSONException e) { ...
4
public static void printList(ListNode list){ while(list!= null){ System.out.print(list.val+" "); list = list.next; } }
1
public List<Usuario> listarProfessor(Professor professor){ ArrayList<Usuario> listaRetorno = new ArrayList<Usuario>(); if (professor.recuperarSiape().isEmpty() || professor.recuperarSiape() == null){ for (Usuario usuario : this.usuarios) { if(usuario instanceof Professor && usuario.rec...
9
public static void initializeWeights(){ //input to hidden weights for(int i = 0; i < inHid.length; i++){ for(int j = 0; j < inHid[i].length; j++){ inHid[i][j] = (Math.random()/10) - 0.5; } } //set the bias to one // for(int j = 0; j < inHid[0].length -1; j++){ // inHid[numInputs - 1][j] = 1; // ...
4
private void postPlugin(final boolean isPing) throws IOException { // The plugin's description file contain all of the plugin data such as // name, version, author, etc final PluginDescriptionFile description = plugin.getDescription(); // Construct the post data final StringBuilder data = new StringBuilder()...
9
public void atira() { for (int i = 0; i < 10; i++) { double angulo = 0.2 * i * Math.PI; int cos = (int) (Math.cos(angulo)); int sen = (int) (Math.sin(angulo)); int x = pos.x + (int) (10 * cos); int y = pos.y + (int) (10 * sen); int sinalx, ...
3
* @param terminalP * @param frame * @return Keyword */ public static Keyword selectTestResult(boolean successP, boolean terminalP, ControlFrame frame) { if (successP == ((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue()) { ControlFrame.setFrameTruthValue(frame, Logic.FALSE_TRUTH_VALUE); ...
6
public void setDead(int number){ if (beings.get(number).isHuman() || beings.get(number).isZombie()) { turnToDeadMan(number); } else if (beings.get(number).isDead()){ turnIntoHuman(number); } }
3
public String getSearchAuthArg() { _read.lock(); try { return _searchAuthArg; } finally { _read.unlock(); } }
0
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 static boolean bringOnScreen(final boolean move, final Entity e) { final Tile nearLoc = e instanceof Locatable ? getReachable((Locatable) e) : null; if (e instanceof Locatable && nearLoc == null) { return false; } if (turnTo(e)) { return true; } else if (e instanceof Locatable && move) { final...
9
private void resolution() { if (width == 800 && height == 600) { } else { if (width == 1024 && height == 768) { } else { if (width == 1152 && height == 864) { } else { if (width == 1280 && height == 720) { ...
8
public static void shogwarr_mcu_run() { int mcu_command; if ( shogwarr_mcu_status != (1|2|4|8) ) return; mcu_command = mcu_ram.READ_WORD(shogwarr_mcu_command_offset); if (mcu_command==0) return; if (errorlog!=null) fprintf(errorlog, "CPU #0 PC %06X : MCU executed command at %04X: %04X\n", cpu_...
8
public final String getVersion() { return version; }
0
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { if((mob.getWorshipCharID().length()==0) ||(CMLib.map().getDeity(mob.getWorshipCharID())==null)) { mob.tell(L("You must worship a god to use this prayer.")); return false; } final Deity ta...
9
protected void action(){ if(!dead){ if(wallExistsRight()){ if(game.getCurrentLevel().blockAtPixelExists(x+(width)-1,y+(height/4))){ Block bl = game.getCurrentLevel().getBlockAtPixel(x+(width)-1,y+(height/4)); activateDoor(bl); } else { Block bl = game.getCurrentLevel().getBlockAtPixel(x+(wid...
5
@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 RecordingEntity)) { return false; } RecordingEntity other = (RecordingEntity) object; if ((this.recordedName ==...
5
public void setUitleenDatum(GregorianCalendar UitleenDatum) { this.UitleenDatum = UitleenDatum; }
0
private int boardValue(Board board) { //Take the next checker. Checker curChecker = board.pop(); //Exception case: there is no board! if (curChecker == null) return 0; //Every piece has an initial value of 2 points. int value = 2; //Having a king is worth another 3 points. if (curCh...
3
public File createSSTableFiles(String csvFile, String keyspace, String columnFamily, MutableInt lineCounter, MutableBoolean lastLineRead, BufferedReader reader) throws IOException { File directory = new File(keyspace+columnFamily); if (directory.exists()) { FileUtils.deleteDirectory(directo...
9
@Override public void deserialize(Buffer buf) { super.deserialize(buf); playerId = buf.readInt(); if (playerId < 0) throw new RuntimeException("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0"); playerName = buf.re...
5
@Override public void handle(HttpExchange he) throws IOException { String requestedFile = he.getRequestURI().getPath().substring(1); File file; if (requestedFile.equals("")) { file = new File(contentFolder + "index.html"); contentType = "text/html"; } else i...
3
public static Movimientos getInstance(int tipo){ switch(tipo){ case 1: return movimientos1; case 2: return movimientos2; case 3: return movimientos3; case 4: return movimientos4; } return null; }
4
public int compareTo(StatView o) { int r = getName().compareTo(o.getName()); if (r == 0) { r = -stat.getWhen().compareTo(o.stat.getWhen()); } return r; }
1
@Override public double calculateJuliaWithPeriodicity(Complex pixel) { iterations = 0; check = 3; check_counter = 0; update = 10; update_counter = 0; period = new Complex(); Complex tempz2 = new Complex(init_val2.getPixel(pixel)); Complex[...
9