text
stringlengths
14
410k
label
int32
0
9
private IdentificadorVariavel completarIdVariavel(Identificador id) throws SemanticError, IdentificadorNaoDefinidoException { if(analisandoRegistro) return new IdentificadorVariavelCampoRegistro(id.getNome(), deslocamento++, tipoAtual); switch (tipoAtual) { case VETOR: return completarIdVariavelV...
4
@Override public void error(JoeException someException) { System.out.println(someException.getMessage()) ; this.errorOccurred = true; } // end method error
0
public void clearList(){ list.clear(); }
0
@Override public void createFrom(int elementIndex, int numberOfPoints) { int size = 0; for(int i = 0; i<numberOfPoints; i++){ size = size + inData.getLength()/numberOfPoints; String[] array = new String[size]; for(int j = 0; j < size; j++ ){ array[...
2
@Override public Word getMemoryCell(DCPU dcpu, OperandMode mode) { dcpu.getPc().inc(); final Word totalValue = dcpu.getRam(dcpu.getPc()).clone(); Register register; switch (this.value) { case 0x10: register = Register.A; break; ...
8
private static void go(boolean gotoColumn) { // Get a valid line number int lineNumber = 1; String lineNumberString = lineNumberTextField.getText(); if (lineNumberString == null) { return; } try { lineNumber = Integer.parseInt(lineNumberString); } catch (NumberFormatException nfe) { return; ...
5
public static String[] getResourceListing(Class c, String path) throws Exception { java.net.URL dirURL = c.getResource(path); if (dirURL != null && dirURL.getProtocol().equals("file")) { /* A file path: easy enough */ return new File(dirURL.toURI()).list(); } if ...
7
public void delAll1(File file) { //确定出口 if (file.isFile() || (file.list().length == 0)) { file.delete(); } else { File[] files = file.listFiles(); for (File f : files) { delAll1(f); } //最后删除自己文件夹,最后的处理 System.out.println(file.delete()); } }
3
public List<List<Integer>> dfs(List<List<Integer>> result, List<Integer> line, int[] num, int index, int target) { if (target == 0) { result.add(line); return result; } if (index >= num.length || num[index] > target) return result; for (int i = index; i < num.length; i++) { if (i > index && n...
6
public void generateProfile() { File directory = new File(get("directory")); for (String lang: arglist) { File file = searchFile(directory, lang + "wiki-.*-abstract\\.xml.*"); if (file == null) { System.err.println("Not Found abstract xml : lang = " + lang); ...
7
public void playAudioStream(AudioInputStream audioInputStream) { // Audio format provides information like sample rate, size, channels. AudioFormat audioFormat = audioInputStream.getFormat(); System.out.println("Play input audio format=" + audioFormat); // Convert comp...
7
private void LuoHahmo(double kentanLeveys, double kentanKorkeus, double sijainti) { double vartalonHalkaisija = 40; double raajanMaxPituus = vartalonHalkaisija * 2; osat = new ArrayList<KentallaOlija>(); raajat = new ArrayList<Raaja>(); double pallonKeskipiste = raajanM...
1
private void callStatement() { callExpression(); expect(Token.Kind.SEMICOLON); }
0
public static int[] qualtityArray(Fastq fastq) { char qc[] = fastq.getQuality().toCharArray(); int q[] = new int[qc.length]; int min = (fastq.getVariant().isSanger() ? 33 : 64); for( int i = 0; i < qc.length; i++ ) q[i] = qc[i] - min; return q; }
2
public void setCsaCantidad(int csaCantidad) { this.csaCantidad = csaCantidad; }
0
@Override public Iterator getKeys() { return current_values.keySet().iterator(); }
0
public static Node performMiniMax(Board b, int color, int depth, Response r) { Node root = new Node(b, Integer.MIN_VALUE); Node move = null; if (r.secondsleft > 60) { Future<Node> control = Executors.newSingleThreadExecutor().submit(new TimedJob(root, color, depth)); try { // Try to get the result with...
6
private V getFromFile(String file) throws NullPointerException { try { FileInputStream fileStream = new FileInputStream(file); ObjectInputStream objectStream = new ObjectInputStream(fileStream); V value = (V) objectStream.readObject(); fileStream.close(); ...
3
@Override public void run() { byte[] buf = new byte[10000000]; DatagramPacket p = new DatagramPacket(buf, buf.length); while (true) { try { //System.out.println("Waiting request"); multiSocket.receive(p);// fica aguardando requisição. outra thread ...
9
public static ArrayList<Post> getAllPage() throws SQLException, NamingException { Connection conn = null; Statement stmt = null; ResultSet rs = null; ArrayList<Comment> comment = new ArrayList<Comment>(); ArrayList<Graffiti> graffiti = new ArrayList<Graffiti>(); DataSource ds = getDataSource(); Array...
8
@SuppressWarnings("unchecked") public synchronized List<WayOsm> getWays(String codigo, List<Long> ids){ List<WayOsm> ways = new ArrayList<WayOsm>(); for (Long l: ids) ways.add(((WayOsm) getKeyFromValue((Map< String, Map <Object, Long>>) ((Object)totalWays), codigo, l))); ways.remove(null); return ways; ...
1
public void close(){ if(this.requestWithFile != null && this.requestWithFile.isReadFile()){ FileTransfer fr = requestWithFile.getFileReceiver(); if(fr != null && !fr.finishWrite()){ fr.forceClose();// 强制关闭删除损害的文件 } } // 关闭连接 SocketChannel socketChannel = (SocketChannel) this.key.channel(); ...
6
private Fundamental transformHelper() { String[] answer = this.resultString.split("\n"); // The first flag says if it is bounded, 0 -> Unbounded so we want a // UnknwonFundamental if (answer[0].equals("0")) { logger.info("Unbounded Fundamental Region computed. Returning UnkownFundamental instead"...
6
private String removeFromParent(Rack rack) { for (int i = 1; i < aisleID; i++) { try { Aisle aisle = (Aisle) storage.find("A" + i); if (aisle == null) { i++; aisle = (Aisle) storage.find("A" + i); } ...
5
private boolean isItemInMarkupItem(Resource item, Set<Resource> visitedItems) { if (!visitedItems.contains(item)) { visitedItems.add(item); Set<Resource> subjects = model.listResourcesWithProperty(pitem_r, item).toSet(); subjects.addAll(model.listResourcesWithProperty(pfirstitem_r, item).toSet()); sub...
8
public static void resetPixels() { int total = Graphics2D.width * Graphics2D.height; for (int i = 0; i < total; i++) { Graphics2D.pixels[i] = 0; } }
1
@Override public double[] computeValue(char refBase, FastaWindow window, AlignmentColumn col) { values[major] = 0.0; values[minor] = 0.0; int countMajor = 0; int countMinor = 0; if (col.getDepth() > 0) { calculateAlleles(col.getBases(), col.getDepth(), refBase...
8
void readDir(String dirName) { filesByCellType = new AutoHashMap<String, ArrayList<String>>(new ArrayList<String>()); epiMarkByFile = new HashMap<String, String>(); // Read all files int countFiles = 0; File dir = new File(dirName); for (String file : dir.list()) { if (file.indexOf(".bed") > 0) { // Is ...
6
private int jjMoveStringLiteralDfa13_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(11, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(12, active0); return 13; } switch(curChar) { case 3...
6
private static boolean insertEmployee(Employee bean, PreparedStatement stmt) throws SQLException{ stmt.setString(1, bean.getName()); stmt.setString(2, bean.getUsername()); stmt.setString(3, bean.getPass()); stmt.setDate(4, bean.getDob()); stmt.setString(5, bean.getPhone()); stmt.setString(6, bean.getAddr...
1
private void algoritmo(){ Cromosoma mejor; int max = 1; for(int i = 0; i < individuos; ++i){ poblacion[i] = new Cromosoma(); poblacion[i].generarCodificacion(); } calcularAptitud(); ordenar(); mejor = mejor(); ++ciclo; while(ciclo <= 200...
5
public static Double absorbtivity(Double absorbtivity, Double molarAbsorbtivity, Double cuvetteWidth, Double concentration) { boolean[] nulls = new boolean[4]; nulls[0] = (absorbtivity == null); nulls[1] = (molarAbsorbtivity == null); nulls[2] = (cuvetteWidth == null); nulls[3] = (concentration == null); ...
7
public Message parseMessage(String s) { //System.out.println(s); JSONObject data; JSONArray argdata; String[] args; try { data = new JSONObject(s); switch(data.getInt("type")) { case Message.TYPE_CHAT: return new STDMessage(this, data.getString("payload")); case Message.TYPE_USER: a...
9
public YamlPermissionWorld(String n, ConfigurationSection config) { super(n, config); }
0
public void pageSearchAction() { PageSearchDialog pageSearchDialog = new PageSearchDialog(vermilionCascadeNotebook.getEditor().getShell()); pageSearchDialog.open(); PageSearchDialog.DialogResult dr = pageSearchDialog.getResult(); if (dr != null) { searchingText = dr.searchText; isCaseSensitive = dr.isC...
3
@Before public void dbPreserve(){ originalItemList=(ArrayList<Item>) ItemDAO.getInstance().getAllItems(); quantityList=new ArrayList<Integer>(); for (Item item : originalItemList){ quantityList.add(item.getQuantity()); } Main.clearTable(); }
1
@Override public void simpleUpdate(float tpf){ elapsedTime += tpf; //handle messages from server handleMessages(); /* for(int a=0;a<5;a++){ //ninjas[a].rotate(0, 2*tpf, 0); ninjas[a].move(tpf*2, 0, tpf*2); } */ // System.out.println("Amount of unit...
9
@Override public boolean equals (Object obj) { if (!(obj instanceof TorrentMetaInfo)) return false; TorrentMetaInfo tmi = (TorrentMetaInfo) obj; boolean dateEq = (creationDate == null && tmi.creationDate == null) || (creationDate != null && creationD...
9
final void method3829(Class70 class70, int i, byte i_0_, boolean bool) { if (i_0_ == 80) { int i_1_ = 0; int i_2_ = i; int i_3_; while_232_: do { do { if (i_2_ != 1) { if (-3 != (i_2_ ^ 0xffffffff)) break; } else { i_3_ = 6; break while_232_; } ...
6
public String getNumOfOdigoi(){ /* * epistefei ton arithmo twn odigwn ths vashs */ String num=null; try { pS = conn.prepareStatement("SELECT COUNT(*) AS num FROM odigoi"); rs=pS.executeQuery(); while(rs.next()){ num=rs.getString("num"); } } catch (SQLException e) { e.printStackTrace(); ...
3
private void resize(int chains) { SeparateChainingHashST<Key, Value> temp = new SeparateChainingHashST<Key, Value>(chains); for (int i = 0; i < M; i++) { for (Key key : st[i].keys()) { temp.put(key, st[i].get(key)); } } this.M = temp.M; thi...
2
public void swap(){ int x1=boton1.getBounds().x/30; int x2=boton2.getBounds().x/30; int y1=boton1.getBounds().y/30; int y2=boton2.getBounds().y/30; if((x1+y1)==(x2+y2) || (x1+y1-x2-y2)>1 || (x2+y2-x1-y2)>1){ boton1=null; boton2=null; presionado=0; return;} bloque aux=buttonMatrix[x1][y1]; b...
5
public static boolean createFunny(ConditionalBlock cb, StructuredBlock last) { if (cb.jump == null || !(cb.getInstruction() instanceof CompareUnaryOperator) || !(last.outer instanceof SequentialBlock) || !(last.outer.getSubBlocks()[0] instanceof IfThenElseBlock)) return false; CompareUnaryOperator ...
6
@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 AttributeEnumeration)) { return false; } AttributeEnumeration other = (AttributeEnumeration) object; if ((this....
5
@Override protected Value evaluate(ExecutionContext context) throws InterpretationException { Value val1 = ((AbsValueNode) this.getChildAt(0)).evaluate(context); Value val2 = ((AbsValueNode) this.getChildAt(1)).evaluate(context); if (val2.getType() == VariableType.STRING) { if ...
6
public static String formatBig(BigDecimal value, int minnum) { return format(value, minnum, false); }
0
protected void replaceCase(int index) { if(myLemma.replaceCase(tempDecomposition, tempI, index)) myMessage.setText("Case #" + (index + 1) + " replaced."); else myMessage.setText("Wrong case selected."); }
1
public void processLocalKeyEvent(KeyEvent evt) { if (viewer.rfb != null && rfb.inNormalProtocol) { if (!inputEnabled) { if ((evt.getKeyChar() == 'r' || evt.getKeyChar() == 'R') && evt.getID() == KeyEvent.KEY_PRESSED ) { // Request screen update. try { rfb.writeFramebufferUpdateRequest(0, 0, r...
8
public boolean enviarMail(String email, String passw, boolean envio) throws MessagingException { boolean ret = false; abrirBase(); LazyList<Email> emailsModel = Email.findAll(); if (!emailsModel.isEmpty() || !envio) { cerrarBase(); if (envio) { ab...
9
public ArrayList<String[]> importData(String filepath){ BufferedReader buffReader = null; String line = ""; ArrayList<String[]> readPatterns = new ArrayList<String[]>(); try { buffReader = new BufferedReader(new FileReader(filepath)); while((line = buffReader.readLine()) != null){ String[] stringNu...
2
public GraphLine[] getSelectedLines() { ArrayList<GraphElement> buffer = new ArrayList(); Iterator<Map.Entry<Integer, GraphLine>> it = lines.entrySet().iterator(); GraphLine bgp; while (it.hasNext()) { bgp = it.next().getValue(); if (bgp.getComponent().getSelect(...
2
private void filterPoints(int[] depthMap) { for (int x = 0; x < resx; x++) { for (int y = 0; y < resy; y++) { int i = x + y * resx; if (i % nthpoint == 0) { int z = depthMap[i]; if (z > minZ) { Vector3D v...
6
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
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TimePeriod other = (TimePeriod) obj; if (this.id != other.id && (this.id == null || !this.id.equ...
8
public void loadIgnoredPlayers() { if (getConfig().contains("Ignore.players")) { List<String> ignored = getConfig().getStringList("Ignore.players"); if (ignored.size() > 0) { Iterator<String> i = ignored.iterator(); while (i.hasNext()) { String thisLine = i.next(); ignoredPlayers.add(thisLine)...
3
public static LinkedList<Object> readCSV(){ String filePath = "rundata.csv"; BufferedReader br = null; String line = ""; String csvSplit = ","; LinkedList<Object> days = new LinkedList<Object>(); LinkedList<Object> currDay = null; //Take note, when returned the first element is a Event currEvent = null; ...
9
public static void BottomUpMergeSort(Comparable[] a) { Comparable[] aux = new Comparable[a.length]; for (int i = 1; i < aux.length; i += i) { for (int j = 0; j < aux.length - i; j += i + i) { merge(a, aux, j, i + j - 1, Math.min(j + i + i - 1, aux.leng...
2
@Override public void update() { bg.update(); if(KeyHandler.isPressed(Keys.KEY_ENTER)) selectOption(); if(KeyHandler.isPressed(Keys.KEY_UP) || KeyHandler.isPressed(Keys.KEY_W)){ currentChoice--; if(currentChoice == -1) currentChoice = options.length - 1; } ...
7
private static boolean isEqual(String str,String[] array){ if(null == array || array.length < 0 ) return false; for(String t : array){ if(t.equalsIgnoreCase(str)) return true; else continue; } return false; }
4
public void execute() throws InterruptedException { final NPC mob = getBestExperiment(); final Player player = client.getMyPlayer(); if (mob != null) { if (mob.getPosition().distance(player.getPosition()) > 7 && !player.isMoving()) { if (!player.isUnderAttack()) { if (walk(mob.getPosition(...
9
public static String stringZip(String inputstr){ String outputstr=""; int tempCount=1; if(inputstr.length() == 0) return outputstr; char preChar=inputstr.charAt(0); for(int i=1;i<inputstr.length();i++){ if(inputstr.charAt(i) == preChar) tempCount++; else { if(tempCount > 1) outputstr+=tempC...
5
public void insert(Connection conn) throws SQLException { if (isValid()) { PreparedStatement stmt = conn.prepareStatement("INSERT INTO crmcorporations VALUES (?, ?, ?, ?)"); stmt.setInt(1, id); stmt.setString(2, name); stmt.setString(3, address); stmt.setString(4, email); stmt.execute(); } }
1
private void renderVisibleObjects(Graphics g) { for (VisibleObject object : objectsToRender) { if (!(object instanceof AnimationBasedVisualEffect)) { object.render(g); } } for (VisibleObject object : objectsToRender) { if (object instanceof AnimationBasedVisualEffect) { object.render(g); ...
5
static void checkSignedShort(final int value, final String msg) { if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) { throw new IllegalArgumentException(msg + " (must be a signed short): " + value); } }
2
public Log generate(int n){ List<Record> records = new ArrayList<Record>(); RecordGen recordGen = new RecordGen(); for (int i=0; i<n; i++){ records.add(recordGen.generate()); } return new Log(records); }
1
private void configure(final JDialog configDialog, final int portNumber) { try { Utils.logToConsole("Performing port configuration"); if (!Utils.selectConfigSection(configDialog, new String[] {"API","Settings"})) // older versions of TWS don't have the Settin...
8
public static void initializeLabels(Label[] label) { /* * Iterate through the labels */ int[] statementList={4,7,8,28,13,14,27,24,26,36,38}; int[] identifierAssignedList={2,5,12,20,25,29}; int[] identifierInlineList={9,15,21,30,37}; int nLabels=label.length; for(int i=0;i<nLabels;i++) {...
7
private Entry parseEntry(Element rootEntryElement) { Entry rEntry = new Entry(); rEntry.setDate(rootEntryElement.getAttribute("date")); NodeList entryNodes = rootEntryElement.getChildNodes(); for (int i = 0; i < entryNodes.getLength(); i++) { // Changing all children...
7
private static Field makeNewField(Menu menuElement) { Field field; switch (menuElement) { case SmallField: field = new Field(10, 10, 10); break; case MediumField: field = new Field(15, 30, 40); break; cas...
5
public void setRight(boolean b) { right = b; if(left) left = !b; // facingRight = b; }
1
public static int parseDirection(int deltaX, int deltaY) { if (deltaX < 0) { if (deltaY < 0) { return 5; } else if (deltaY > 0) { return 0; } else { return 3; } } else if (deltaX > 0) { if (deltaY < 0) { return 7; } else if (deltaY > 0) { return 2; } else { return 4; ...
8
private void assertThatWeeklyTotalIsEqualToBudgetBreakdownValue(BigDecimal expected, BigDecimal actual) { System.out.println("Expected Value: " + expected); System.out.println("Actual Value: " + actual); if(!actual.equals(expected)) { fail("TotalMoneyAvailableWeekly should be calcu...
1
private void handleUpdate() { // We can simplify this when we move more methods into the Preference Interface. if (pref instanceof PreferenceStringList) { // Update pref PreferenceStringList prefStringList = (PreferenceStringList) pref; String text = list.getText(); StringList stringList = new S...
2
protected long freePhysTake(int size, boolean ensureAvail, boolean recursive) { assert(structuralLock.isHeldByCurrentThread()); assert(size>0); //check free space if(spaceReclaimReuse){ long ret = longStackTake(size2ListIoRecid(size),recursive); if(ret!=0){ ...
9
protected StringBuffer renderWrappedText(StringBuffer sb, int width, int nextLineTabStop, String text) { int pos = findWrapPos(text, width, 0); if (pos == -1) { sb.append(rtrim(text)); return sb; } sb.app...
6
public boolean hasPermission(Permission p){ if(permsList.contains(p))return true; if(p.equals(Permission.magical))return true; return false; }
2
public Game(char [][] b) { //JFrame constructor which puts the //current game number in the title super("Sym4 Game " + gamesPlayed); //get content pane and set layout contents = getContentPane(); contents.setLayout(new BorderLayout(55,50)); //create individual gridlayouts for different //sections of...
5
public void locateWindows() { // Exit if (!locatingWindows) { return; } for (final Locatable window : locatableWindows) { Rectangle position = deserializeWindowPosition(window); final Rectangle defaultPosition = getDefaultPositionValues(window); if (position == null) { position = defaultPositi...
3
private void loadInfo(String name) { FileReader baseSave = null; try { charCount = (new File(name + ".rcf")).length(); charCount = (long) 1.25*charCount; baseSave = new FileReader(name + ".rcf"); //Read the header if(!readTill(';',baseSave).equals("Server Info")) { baseSave.close(); lo...
7
public int longestConsecutive(int[] num) { map.clear(); heads.clear(); for (int n : num) { if (map.containsKey(n)) continue; ListNode node = new ListNode(n); map.put(n, node); node.next = null; if (map.containsKey(n +...
5
private static int[] getColor() { int[] color = { 0xFF111111, 0xFFD50000, 0xFFFFFFFF }; switch (random.nextInt(8)) { case 0: { // red color color[1] = 0xFFD50000; break; } case 1: { // yellow color color[1] = 0xFFFFF115; break; } case 2: { // blue color color[1] = 0xFF6997FF; b...
7
protected boolean bruteForceForPath(Place currentPlace, Place destinationPlace, LinkedList<Road> path, HashMap<String, Boolean> vis, int[] minLength, int currentLength) { String current = new String(currentPlace.getName()); String destination = new String(destinationPlace.getName()); String expectedKey = current...
9
public static boolean containsWordsFromDict(String s, String[] dict) { boolean[] contains = new boolean[s.length()+1]; contains[0] = true; for( int i = 0; i< s.length(); i++) { if(!contains[i]) { continue; } for(String word : dict) { ...
6
public void func_860_a() { if(this.field_1235_h) { if(!this.field_1234_i) { this.field_1236_g.flip(); this.field_1234_i = true; } if(this.field_1236_g.remaining() > 0) { GL11.glPushMatrix(); GL11.glTranslatef((float)this.field_1242_a - th...
3
@POST @Path("/{repoName}/{fileName}/issue") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) public String submitIssue( @PathParam("repoName") String repoName, @PathParam("fileName") String fileName, @FormDataParam("battleScribeVersion")...
9
@Test public void testArrayListLong() { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; long avgTime = 0; long beforeTime = 0; long afterTime = 0; long curTime = 0; Random random = new Random(); int value; AbstractProcessor<Long>...
4
private String needMessage(int meetLevel) { meetLevel = Visit.clamp(meetLevel, HoldingUpgrades.NUM_LEVELS) ; final Object met = HoldingUpgrades.NEEDS_MET ; final Object access = HoldingUpgrades.checkAccess (this, meetLevel, true), materials = HoldingUpgrades.checkMaterials(this, meetLevel, ...
6
@Override protected void setColoredExes() { coloredEx = LineGenerator.WuAlgorithm(begin, end); }
0
private Table createTable(Connection conn, ResultSet rs) throws SQLException { String tableName = rs.getString("TABLE_NAME"); String tableType = rs.getString("TABLE_TYPE"); String remarks = rs.getString("REMARKS"); if (StringUtil.isNullOrEmpty(remarks)) { String sql = "select TABLE_COMMENT from information_s...
6
protected void hypothesizeUseless(GrammarEnvironment env, Grammar g) { UselessProductionRemover remover = new UselessProductionRemover(); Grammar g2 = UselessProductionRemover .getUselessProductionlessGrammar(g); if (g2.getTerminals().length==0) { JOptionPane.showMessageDialog(env, "Error : Th...
2
void sort(int[] a) throws Exception { for (int i = a.length; --i>=0; ) for (int j = 0; j<i; j++) { if (stopRequested) { return; } if (a[j] > a[j+1]) { int T = a[j]; a[j] = a[j+1]; a[j+1] = T; } pause(i,j); } }
9
public void printWorld() { System.out.println(height); System.out.println(width); for (int i = 0; i < height; i++) { if (i % 2 == 1) { //odd row System.out.print(" "); } for (int j = 0; j < width; j++) { System.out.print(cells[...
3
public void visit_istore(final Instruction inst) { final int index = ((LocalVariable) inst.operand()).index(); if (index + 1 > maxLocals) { maxLocals = index + 1; } if (inst.useSlow()) { if (index < 256) { addOpcode(Opcode.opc_istore); addByte(index); } else { addOpcode(Opcode.opc_wide); ...
8
public void WorldChecker(Block chest, Player player, Boolean respawn) { Chest chestc = (Chest)chest.getState(); if ((!this.pl.chest.containsKey(chest.getLocation())) && (!BlockChecker(player, Integer.valueOf(chest.getLocation().getBlockX()), Integer.valueOf(chest.getLocation().getBlockY()), Integer.valueOf(chest.ge...
5
private static void savePort(ConfigurationSection maincs, Port port) { ConfigurationSection cs = maincs.createSection(port.getName()); cs.set("srcCorner1", getLocString(port.getSrcLowerCorner())); cs.set("srcCorner2", getLocString(port.getSrcUpperCorner())); cs.set("destination", getLocString(port.getDestinati...
6
public static String shorten(float f, int decimals) { if (Math.abs(f) < 0.1f) return "0" ; final boolean neg = f < 0 ; if (neg) f *= -1 ; final int i = (int) f ; final float r = f - i ; if (r == 0) return ""+i ; final String fraction = r+"" ; final int trim = Math.min(decimals + 2, fract...
4
public void setShortMessageFont(String font) { if ((font == null) || font.equals("")) { this.shortMessageFont = UIFontInits.SHORTMESSAGE.getFont(); } else { this.shortMessageFont = font; } somethingChanged(); }
2
@Override public String toString() { return "TableColumnDesc [field=" + field + ", type=" + type + ", isNull=" + isNull + ", isKey=" + isKey + ", default_=" + default_ + ", extra=" + extra + "]"; }
0
public ArrayList<ArrayList<Integer>> levelOrderBottom(TreeNode root) { // Start typing your Java solution below // DO NOT write main() function ArrayList<ArrayList<Integer>> resArr = new ArrayList<ArrayList<Integer>>(); if (root == null) return resArr; Queue<TreeNode> pre = new LinkedList<TreeNode>(); Ar...
6
public void process() { Item[] items = player.getEquipment().getItems().getItems(); for (int slot = 0; slot < items.length; slot++) { Item item = items[slot]; if (item == null) continue; if (player.getAttackedByDelay() > Utils.currentTimeMillis()) { int newId = ItemConstants.getDegradeItemWhenComba...
7