text
stringlengths
14
410k
label
int32
0
9
public static String escapeDoubleQuotes(String string) { if (string == null) { return null; } String result = string.replaceAll("\\\\", "\\\\\\\\"); return result.replaceAll("\\\"", "\\\\\\\""); }
1
public void languageAndWordlistCheckMain() { try{ // Open the file that is the first // command line parameter FileInputStream fstream = new FileInputStream("Options.dat"); // Get the object of DataInputStream DataInputStream in = new...
7
private int knapsack(int n, int capacity, int w[], int v[]) { // dynamic programming if (vKnapsack[capacity] != Integer.MIN_VALUE) return vKnapsack[capacity]; // Find the optimal value that can carried in a knapsack of given // capacity // The optimal value that can be carried is the maximum of the optim...
5
@EventHandler public void onTarget(EntityTargetLivingEntityEvent e) { if (e.getTarget().getType() == EntityType.PLAYER) { if (e.getTarget().isInsideVehicle()) { if (e.getEntity().getEntityId() == e.getTarget().getVehicle() .getEntityId()) { e.setCancelled(true); e.setTarget(null); if (e.g...
4
private void updateAsteroids() { ArrayList<Asteroid> deadAsteroid = new ArrayList<Asteroid>(); for(int i = 0; i < asteroids.size(); i++) { Asteroid a = asteroids.get(i); a.move(); if(CollisionDetector.isColliding(sc, a)) { if(!sc.isShieldActive()) sc.damaged(a.getStrength()); else ...
7
public SimpleSparqlSimulator(String endpoint) throws MalformedURLException { // read the list of files of queries sparql_queries = new ArrayList<File>(); URL url = getClass().getResource("/"); LOGGER.info("Reading queries (txt files) from " + url.getPath() + SimpleSparqlSimulator.class.getName()); File dir = n...
4
public static BasicBlock find(BasicBlock[] blocks, int pos) throws BadBytecode { for (int i = 0; i < blocks.length; i++) { int iPos = blocks[i].position; if (iPos <= pos && pos < iPos + blocks[i].length) return blocks[i]; } throw new BadByteco...
3
public int atualizar(String sql) { Connection conn = this.getConn(); try { Statement stm = conn.createStatement(); return stm.executeUpdate(sql); } catch (SQLException ex) { Logger.getLogger(ConectorMySql.class.getName()).log(Level.SEVERE, null, ex); }...
1
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { if (isSelected) { int vDifference = (int) (boldFontMetrics.getStringBounds(title, g).getWidth()) - textRect.width; textRect.x -= (v...
1
public void doFilter(ServletRequest _request, ServletResponse _response, FilterChain chain) throws IOException, ServletException { if (_request instanceof HttpServletRequest && _response instanceof HttpServletResponse) { HttpServletRequest request = (HttpServletRequest) _request; HttpSer...
5
private static void printGame(JSONObject jo) { try { JSONArray champs = Champion.getAllChamps(false); long champId = jo.getLong("championId"); System.out.println("Game " + jo.getLong("gameId")); System.out.println("-----------------------------"); System.out.println("Champion: " + ch...
6
private void setSelected(SingleScorePanel singleScorePanel) { singleScorePanel.setSelected(true); }
0
public static void main(String args[]) { String test = args[0]; int up = 0; int down = 0; int left = 0; int right = 0; for(int i = 0; i < test.length(); i++) { switch(test.charAt(i)) { case 'U': up++; break; case 'D': down++; break; case 'L': left++; break; case 'R': right++; brea...
7
@Override public boolean equals( Object obj ){ if (this == obj){ return true; } if (obj == null){ return false; } if (obj instanceof PassengerCar ){ PassengerCar temp = (PassengerCar) obj; return ( this.baggageWeight == temp.getBaggageWeight())&& ( this.passengersCount == temp.getPassenger...
7
public static int[] getRandomOrdering(int Size){ double[] randArray = new double[Size]; for(int n = 0; n < Size; n++){ randArray[n] = Math.random(); } int[] randOrder = new int[Size]; double lowestRand = 1; for(int i = 0; i < Size; i++){ for(int n = 0; n < Size; n++){ if(randArray[n] < lowestRand)...
4
public void timeAndComputeValue(){ }
0
public String rotate(String plainText) { char[] plainTextChars = plainText.toCharArray(); StringBuilder rotatedChars = new StringBuilder(); for (char plainTextChar : plainTextChars) { if ((plainTextChar >= 'a' && plainTextChar <= 'm') || (plainTextChar >= 'A' && plainTextChar <= 'M...
9
public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_UP && !principal.getSalta()){ principal.setSalta(); tiempoCaida = 0; } }
2
public void removeOpinion(DataRow row) { boolean result = DataVector.getInstance().dbManager.remove(row); if(!result) { ErrorDialog errorDialog = new ErrorDialog(true, "Nastąpił błąd w usuwaniu opinii: " + row.getName() + ".", "AbstractManager", "Method: removeOpinion(DataRow row...
3
public String udp2String(Packet packet) { UDPPacket udpPacket = (UDPPacket) packet; //Creates a udp packet out of the packet EthernetPacket ethernetPacket = (EthernetPacket) packet.datalink; //Creates and ethernet packet for layer 2 information methodData += src_macInEnglish = ethernetPacket.getSourceAdd...
1
public static void main(String [] args) throws Throwable { if (args.length < 2) { usage(); return; } Class stemClass = Class.forName("org.tartarus.snowball.ext." + args[0] + "Stemmer"); SnowballStemmer stemmer = (SnowballStemmer) stemClass.newInstance(); Reader reader; ...
9
public String getPassword() { return password; }
0
public void add(String line) { graph.append(line); }
0
public static boolean isOptionPresent(String cmdLineArg, char option) { boolean result = false; // avoid "--abc" if (cmdLineArg.lastIndexOf('-') == 0) { result = cmdLineArg.indexOf(option) >= 1; } return result; }
1
public long getSeatType() { return this._seatType; }
0
public static boolean isOnScreen(Entity paramEntity) { if (paramEntity.getXpos() > ScreenHelper.widthNeg(paramEntity) && paramEntity.getXpos() < ScreenHelper.widthPos(paramEntity)) { if (paramEntity.getYpos() > ScreenHelper.heightNeg(paramEntity) && paramEntity.getYpos() < ScreenHelper.h...
4
public ListNode rotateRight(ListNode head, int n) { if(null == head || null == head.next) return head; int length = getLengthOfList(head); ListNode tail = getTailOfNode(head); tail.next = head; ListNode pivot = getRotateNode(head, length - n % length); ...
2
public ArrayList<Record> getNewsfeed() { ArrayList<User> myfriends = getFriendList(); ArrayList<Record> newsFeeds = new ArrayList<Record>(); for (int i = 0; i < myfriends.size(); i++) { User friend = myfriends.get(i); newsFeeds.addAll(QuizTakenRecord.getQuizHistoryByUserID(friend.userID)); newsFeeds.addA...
1
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter("id"); String password = req.getParameter("password"); if (id == null || id.length() == 0 || password == null || password.length() == 0) { resp.sendError(400, ...
5
public void paintComponent(Graphics g){ Graphics2D g2 = (Graphics2D) g; int heightMover = 0; for (int tetIndex = 0; tetIndex<upcoming.size(); tetIndex++){ g2.setColor(controller.getBlankColor()); g2.fillRect(0, heightMover*size, size*6, size); g2.setRenderingHint(RenderingHints.KEY_ANTIALIA...
6
@Override public void deserialize(Buffer buf) { elementId = buf.readInt(); if (elementId < 0) throw new RuntimeException("Forbidden value on elementId = " + elementId + ", it doesn't respect the following condition : elementId < 0"); elementCellId = buf.readShort(); if (e...
4
@Override public void doAction(Player player) throws InvalidActionException { if (player == null) throw new IllegalArgumentException("Player can't be null!"); if (player.getRemainingActions() <= 0) throw new InvalidActionException("The player has no turns left!"); Position currentPos = player.getPosition(...
3
void toss(){ Random rand=new Random(); if(rand.nextInt(9)<5){ this.setHeadSide(true); }else{ this.setTailSide(true); } }
1
private long ticklessTimer() { // Calculate tickless timer, up to 1 hour long tickless = System.currentTimeMillis() + 1000 * 3600; for (STimer timer : timers) { if (timer.when == -1) timer.when = timer.delay + System.currentTimeMillis(); if (tickless ...
5
@SuppressWarnings({ "rawtypes", "unchecked" }) public void getAllInGroup(String group, Map target){ try{ String key; ObjectInputStream objStr; Serializable obj; PreparedStatement prep = this.conn.prepareStatement("SELECT key, value FROM keyval WHERE collection = ?"); prep.setS...
2
public String getConsulDefMap(String arg_dt1) throws SQLException, ClassNotFoundException { ResultSet rs; String sts = ""; Connection conPol = conMgr.getConnection("PD"); if (conPol == null) { throw new SQLException("Numero Maximo de Conexoes Atingida!"); } t...
3
private void btnValiderMembreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnValiderMembreActionPerformed if(jRadioButton1.isSelected()){ jTable1.setModel(new ListMembreNomController(jTextField1.getText())); } if(jRadioButton2.isSelected()){ ...
3
public void fillStocks() { pnlDashboardCenter.removeAll(); stocks = new ArrayList<Stock>(Service.getAllStocks()); Collections.sort(stocks); squareGraphicList = new ArrayList<SquareGraphic>(); selectedSquare = null; for (Stock stock : stocks) { SquareGraphic sq = new SquareGraphic(); sq.addMouseListen...
1
private boolean isStudentInOneLectureAtTheTime(Teacher teacher, List<Group> teachersGroups, Group group, int lectureNumber, LinkedHashMap<String, LinkedHashMap> dayTimeTable) { boolean mandatoryConditionsMet = true; if (group != null) { // System.out.println("Grupe idejimui: " + group.getGrou...
7
public void paintComponent(Graphics g){ int x = this.getWidth(); int y = this.getHeight(); g.setColor(Color.GRAY); if(n==0) {g.setColor(Color.blue);} if(n==1) {g.setColor(Color.red);} if(n==2) {g.setColor(Color.green);} g.fillRect(0, 0, this.getWidth(), this.getHeight());...
8
public static int chooseFile() { Scanner in = new Scanner(System.in); String[] files = FileLister.getFilesArrayString(); FileLister.listFiles(files); System.out.println(">Enter a file number"); int selection = in.nextInt() - 1; return selection; }
0
public void buildClassifier(Instances instances) throws Exception { // can classifier handle the data? getCapabilities().testWithFail(instances); // remove instances with missing class instances = new Instances(instances); instances.deleteWithMissingClass(); double sumOfWeights = 0; m...
8
public List<String> summaryRanges1(int[] nums) { List<String> result = new ArrayList<String>(); if(nums.length<1) return result; int start = nums[0]; int end = 0; int i = 0; while(i<=nums.length-1){ if(i+1 == nums.length || nums[i+1] != nums[i]+1 ){ end = nums[i]; if(end == start){ resul...
6
public String toString() { ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE) .append("username", this.username) .append("enabled", this.enabled) .append("accountExpired", this.accountExpired) .append("credentialsExpired", ...
3
public int getAxisWidth(Graphics g) { int i; width = 0; if (minimum == maximum) return 0; if (dataset.size() == 0) return 0; calculateGridLabels(); exponent.setText(null); if (label_exponent != 0) { exponent.copyState(label); exponent.setText("x10^" + String.valueOf(label_exponent)); } ...
7
Acceptor(TerminateSignaller terminateSignaller, ServerSocket serverSocket, ThreadModelType threadModelType, ExecutorService executorService, Serializer serializer, Class<T> serviceInterface, Class<V> serviceObjectClass, ThreadPoolOverflowPolicy threadPoolOverflowPolicy) throws Serv...
4
@Override public int getColumnCount() { return columnNames.length; }
0
public static boolean isGetter(Method method) { if(!method.getName().startsWith("get")) return false; if(method.getParameterTypes().length != 0) return false; if(void.class.equals(method.getReturnType())) return false; return true; }
3
private String postRequest(String URL, String request) throws IOException { HttpPost hp = new HttpPost(URL); //StringEntity ent = new StringEntity(request, "UTF-8"); StringEntity ent = new StringEntity(request, HTTP.UTF_8); hp.setEntity(ent); hp.addHeader("Authorization", "Bas...
4
private GenericConverter getRegisteredConverter(Class<?> sourceType, Class<?> targetType, Class<?> sourceCandidate, Class<?> targetCandidate) { ConvertersForPair convertersForPair = converters.get(new ConvertiblePair(sourceCandidate, targetCandidate)); return convertersForPair == null ? null : conve...
5
public int process() { Stack<Character> stack=new Stack<Character>(); InputReader in=new InputReader(getClass().getResourceAsStream("/balexp.txt")); String line=in.readLine(); for(int i=0;i<line.length();i++) { char ch=line.charAt(i); switch(ch) { case '(': case '[': case '{':stack...
9
public void executeLookupAction(String base, String sourceLocale, String targetLocale){ log("lookup in base \"" + base + "\" from locale \"" + sourceLocale + "\" to locale \"" + targetLocale + "\":"); log(); log("reading target word storage from disk..."); WordStorage sourceWordStorage = (WordStorage)WordSto...
6
public BadNetwork(Channel leftIn, Channel leftOut, Channel rightIn, Channel rightOut) { leftIn_ = leftIn; leftOut_ = leftOut; rightIn_ = rightIn; rightOut_ = rightOut; currentState = Status.NOMSG; /* Swing */ netLbl = new JLabel("Network"); netBtnFail = new JButton("Failure"); netBtnSuccess ...
9
private static void printCharacters(ArrayList<Character> characters) { Comparator<Character> chars = new Comparator<Character>() { // TODO compares Characters by level, strength and armour // note that this soln isn't quite correct, // find the bug and fix it @Override public int compare(Character c...
3
private boolean containsEnemyWool(TeamPlayer p, CTFTeam team) { Wool w = new Wool(this.GoalTeam.getColor()); //Check for wool for (ItemStack m : p.getPlayer().getInventory()) { //If item in inventory is wool if (m != null && m.getType().equals(Material.WOOL)) { System.out.println("Got...
5
protected void calculateAverageContingencyMatrix() { // Initialize the matrix double[][] newMatrix = new double[super.classesNumber()][super.classesNumber()]; for(int i = 0; i < newMatrix.length; ++i) for(int j = 0; j < newMatrix[0].length; ++j) newMatrix[i][j] = 0.0; // Sum all the performances ma...
7
public String getShopUrl() { return shopUrl; }
0
protected static void createDescriptor() { try { InputStream descriptorStream = ResultParserParseControllerGenerated.class.getResourceAsStream(DESCRIPTOR); InputStream table = ResultParserParseControllerGenerated.class.getResourceAsStream(TABLE); boolean filesystem = false; if(descri...
9
@Override public int compare(StopRange arg0, StopRange arg1) { int stops1 = arg0.end - arg1.start; int stops2 = arg1.end - arg1.start; int rs = Integer.compare(stops1, stops2); if(rs == 0) { rs = Integer.compare(arg0.start, arg1.start); } return rs; }
1
public void update() { value = neighbours.size(); }
0
public boolean EliminarAfecta(Afecta p){ if (p!=null) { cx.Eliminar(p); return true; }else { return false; } }
1
public static int maxProfit(int[] prices) { int profit=0; if(prices.length <=0) return profit; int minPrice=prices[0]; for(int i=0;i<prices.length;i++){ profit=prices[i]-minPrice>profit?prices[i]-minPrice:profit; minPrice=prices[i]<minPrice?prices[i]:minPrice; }...
4
public void set(String seqStr) { if( seqStr == null ) { length = 0; nmer = 0; } else { nmer = 0; setLength(seqStr.length()); // Create binary sequence char seqChar[] = seqStr.toCharArray(); int i; for( i = 0; i < length; i++ ) rol(seqChar[i]); } }
2
public double value(StateObservation a_gameState) { boolean gameOver = a_gameState.isGameOver(); Types.WINNER win = a_gameState.getGameWinner(); double rawScore = a_gameState.getGameScore(); if(gameOver && win == Types.WINNER.PLAYER_LOSES) rawScore += HUGE_NEGATIVE; ...
4
public ZElement chercheElement(int x, int y) { for (int i = zelements.size() - 1; i >= 0; i--) if (getElement(i).isSelected(x, y)) return getElement(i); return null; }
2
public void draw(int windowX, int windowY, int xStart, int yStart){ for (int x = 0; x < Standards.MAP_TILES_TO_DRAW; x++){ for (int y = 0; y < Standards.MAP_TILES_TO_DRAW; y++){ int cx = x + xStart; int cy = y + yStart; if (isOnMap(cx, cy)){ int drawX = x * Standards.TILE_SIZE; int ...
3
public void notifyAdd(UpdateTag... tags) { if (updateExec == null || updateExec.done) { updateExec = new UpdateCall(); SwingUtilities.invokeLater(updateExec); } for (UpdateTag ut : tags) { if (!updateExec.mods.contains(ut)) updateExec.mods.add(ut); } }
4
@Override public String requestPro(HttpServletRequest request, HttpServletResponse response) throws Throwable { request.setCharacterEncoding("utf-8"); MultipartRequest multi = null; int sizeLimit = 10 * 1024 * 1024 ; @SuppressWarnings("deprecation") String savePath = request.getRealPath("/upload"); ...
7
@Override public String getName() { return NAME; }
0
public Base(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "href": href = Href.parse(this, v); break; case "target": target = Target.parse(this, v); break; ...
3
@Override protected void doAction(int option) { switch (option) { case 1: listAllSongs(); //lister alle sange op break; case 2: songSearch(); //søger en bestemt sang break; case ...
7
static public List<Class<?>> getMapTypes(String str_className, String str_fieldName) { List<Class<?>> lcla_types = new ArrayList<Class<?>>(); try { Class<?> lcl_class = Class.forName(str_className); Field lcl_f = lcl_class.getDeclaredField(str_fieldName); Type lcl_type = lcl_f.getGenericType(); if (lc...
8
private void moveToNextParam() { JTextComponent tc = ac.getTextComponent(); int dot = tc.getCaretPosition(); int tagCount = tags.size(); if (tagCount==0) { tc.setCaretPosition(maxPos.getOffset()); deactivate(); } Highlight currentNext = null; int pos = -1; List<Highlight> highlights = getParamet...
7
public SetDeck() { try { Gson g = new Gson(); URL url = new URL("http://128.199.235.83/icw/?q=icw/service/all_ic_of&user=624"); try { HashMap<String, ArrayList<Double>> temp = g.fromJson(new InputStreamReader(url.openStream()), HashMap.class ); ArrayList<Double> cardString = temp.get("data"); try...
8
public void generateHorizontalCorridor(MapRegion room1, MapRegion room2, String[][] dungeon) { // Etäisyys lähekkäimpien seinien välillä int distance = room2.getX1() - room1.getX2(); // Valitaan alku- ja loppukoordinaatit siten, että polku ei koskaan kulje huoneen kulmasta int startY...
6
private String pickMobSpawner(Random var1) { int var2 = var1.nextInt(4); return var2 == 0?"Skeleton":(var2 == 1?"Zombie":(var2 == 2?"Zombie":(var2 == 3?"Spider":""))); }
4
public Type getType() { return this.type; }
0
public boolean isStore(Chest chest){ if(chest==null) return false; return stores.containsKey(chest); }
1
public void remove(Object removedObject) { Object[] tempArray; int numberOfFindElements = 0; if (object == null||object.length==0) { throw new IllegalArgumentException( "There is no elements in Arraylist! Nothing could be deleted!"); } for (int i = 0; i < object.length; i++) { if (object[i].equa...
8
private String login(String username,String password,String randCode) throws IOException{ URL url = new URL("https://kyfw.12306.cn/otn/login/loginAysnSuggest?loginUserDTO.user_name="+username+"&userDTO.password="+password+"&randCode="+randCode); HttpsURLConnection con = (HttpsURLConnection) url.openConn...
3
@Override public void update(){ if(hitPoints <= 0) die(); super.update(); for(Shield shield : shields) shield.update(); }
2
public GridCell cell(int row, int col) { if (row < rows && col < cols) { if (row < 0 || col < 0) { return null; } return gridCells[row][col]; } return null; }
4
@Test public void shouldReturnAreaOfTenForTwoByFiveRectangle(){ Rectangle rectangle = new Rectangle(5, 2, 0, 0); assertEquals(10, rectangle.area()); }
0
* @param active Whether or not the active version of the color is needed. * @return The background color. */ public static Color getListBackground(boolean selected, boolean active) { if (selected) { Color color = UIManager.getColor("List.selectionBackground"); //$NON-NLS-1$ if (!active) { color = Color...
2
public static boolean ananlysisNJCM(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException { int strlen = o.getStem().length(); boolean success = false; if(strlen>3&&(o.getStem().endsWith("에서이")||o.getStem().endsWith("부터이"))) { o.addElist(o.getStem().substring(strlen-1)); ...
9
public void removePreviousGlied() { SchlangenGlied oldPreviousGlied = previousGlied; previousGlied = null; if (oldPreviousGlied != null) { previousGlied.removeNextGlied(); } }
1
private void escribirTeam(Piloto pilot) { int lectura = 0; String cadenainicio = ""; String cadenamedio = ""; String cadenafinal = ""; String nuevoarchivo = ""; Scanner s; try { s = new Scanner(pilot.getFile()); while ...
6
@Override public int observed(String sequence) { char seq[] = sequence.toUpperCase().toCharArray(); int cpg = 0; for( int pos = 0; pos < (seq.length - 1); pos++ ) if( (seq[pos] == 'C') && (seq[pos + 1] == 'G') ) cpg++; return cpg; }
3
@Override public UserDTO getUserByLogin(String login, String pass) throws SQLException { Session session = null; UserDTO user = null; try { session = HibernateUtil.getSessionFactory().openSession(); user = (UserDTO) session.createCriteria(UserDTO.class) ...
3
@Override public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { String data; try { if (request.getParameter("id") == null) { data = "{\"error\":\"id is mandatory\"}"; } else { Cl...
2
@Override public void execute(CommandSender sender, String[] arg1) { if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) { sender.sendMessage(plugin.NO_PERMISSION); return; } if (arg1.length < 1) { sender.sendMessage(ChatColor.RED + "/" + plugin.setWarp + " (name) [private]"); return; } ...
7
public boolean load(String audiofile) { try { setFilename(audiofile); sample = AudioSystem.getAudioInputStream(getURL(filename)); clip.open(sample); return true; } catch (IOException e) { return false; } catch (UnsupportedAudioFileException e) { return false; } catch (LineUnavailableException...
3
@Override public void processEvent(Event event) { if(event.getHeader().getEventType().equals(LogEventType.ROTATE)) { try{ processRotateEvent(event); } catch (SQLException ex) { } } else if(event.getData() instanceof RowsIEventData) { i...
5
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
public JsonObject toJSON() { JsonObject obj = new JsonObject(); Gson gson = new Gson(); obj.addProperty("title", title); obj.addProperty("project", project); // Add contributors for(String key: contributors.keySet()) { if(!contributors.get(key).isEmpty()) obj.add(key, gson.toJsonTree(contributors.g...
4
private void initView() { super.setLayout(new BorderLayout()); initGrammarTable(); JPanel rightPanel = initRightPanel(); JSplitPane mainSplit = SplitPaneFactory.createSplit(environment, true, 0.4, new JScrollPane(grammarTable), rightPanel); add(mainSplit, BorderLayout.CENTER); }
0
public static List<Actor> getActors(String urlString) throws TvDbException { List<Actor> results = new ArrayList<>(); Actor actor; Document doc; NodeList nlActor; Node nActor; Element eActor; try { doc = DOMHelper.getEventDocFromUrl(urlString); ...
5
public static String createPath(String folderName, String fileName) { return folderName + System.getProperties().getProperty("file.separator") + fileName; }
0
private void removeDataNode(DFSNode dataNode){ ///// System.out.println("dataNode is " + dataNode.getIp() + ":" + dataNode.getPort()); ///// for(DFSBlkDataNode dbdn : this.dataNodes){ if(dbdn.getIp().equals(dataNode.getIp()) && dbdn.getPort() == dataNode.getPort()){ ...
9
public float getK() { return k; }
0