text
stringlengths
14
410k
label
int32
0
9
@Override public int compareTo(GeneratorTask o) { if (op < o.op) return 1; if (op > o.op) return -1; if (z < o.z) return -1; if (z > o.z) return 1; if (x < o.x) ret...
6
private void enableEvents(boolean b) { enableAttachEvents(b && attachListeners.size() > 0); enableDetachEvents(b && detachListeners.size() > 0); enableErrorEvents(b && errorListeners.size() > 0); enableServerConnectEvents(b && serverConnectListeners.size() > 0); enableServerDisconnectEvents(b && serverDisconn...
5
public static void addUser(ConcordiaDatabase database){ Scanner myKey = new Scanner(System.in); boolean successful = false; //Prompts user for basic information System.out.print("What is the first name of this individual? "); String firstName=myKey.next(); System.out.print("What is the last name of " + ...
8
public static <T extends DC> Similarity getIndexedSim(Set<Pair<Pair<PT<Integer>,T>,Pair<PT<Integer>,T>>> done) { if(done!=null) { if(done.getNext()!=null) { return new Similarity(done.getFst().fst().delta(done.getFst().snd()).simi().getValue()+(getIndexedSim(done.getNext()).getValue())); } else ...
2
public void freegame(String[] split, String command) { if (split.length != 6) { PrintMessage("Syntax:!freeplay [name] [eastplayer] [southplayer] [westplayer] [northplayer]"); return; } String name = split[1]; String east = split[2]; String south = split[3]; String west = split[4]; String north = ...
6
@Override public void actionPerformed(ActionEvent e) { if(firstTime){ drawRandomNode(); drawSnake(); firstTime = false; } Node last; if(e.getSource() == timer){ last = snake.move(food); if(snake.getIsDead()){ stop(); System.out.println("snake was dead"); }else{ if(snake.eat(food))...
4
public static String getColorLang(String langKey, String ... keyMap) { String result = getLang(langKey); if (result == null) { result = langKey; } for (int i = 0; i < keyMap.length; i += 2) { if (i+1 >= keyMap.length) { break; } String key = keyMap[i]; String value = keyMap[i+1]; ...
3
private void drawYValues() { mySketch.fill(0); mySketch.textSize(valueSize); mySketch.textAlign(PApplet.RIGHT); float ySize = plotY2 - plotY1; float nextYPlace = plotY1; float fixedXPlace = plotX1 - 5; float yValue = yMax; float yInterval = (yMax - yMin) / valueDivisions; DecimalFormat decimalForm ...
3
protected void handleControlPropertyChanged(final String PROPERTY) { if ("RESIZE".equals(PROPERTY)) { resize(); } else if ("STATUS".equals(PROPERTY)) { updateStatus(); } else if ("COLOR".equals(PROPERTY)) { icon.setBackground(new Background(new BackgroundFill(...
3
@Override public void mouseDragged(MouseEvent e) { if (e.getPoint().x >= 0 && e.getPoint().x <= getWidth() && e.getPoint().y >= 0 && e.getPoint().y <= getHeight()) { if (right) { MapTile tile = getTile(); moveMap(start.getGX(mapLoc) - tile.getGX(mapLoc), start.get...
9
public void clik() { for (ClickListener l : listeners) { l.doClick(); } }
1
public String getAsHiddenString() { StringBuilder builder = new StringBuilder(); for (int x = 0; x < SIZE; x++) { for (int y = 0; y < SIZE; y++) { int value = fField[x][y]; if (value == VALUE_SHIP) builder.append(VALUE_FREE); else builder.append(value); }...
3
private void assertValidFields () { if (_name == null) throw new IllegalArgumentException("The PackageName cannot be null."); if (_version == null) throw new IllegalArgumentException("The PackageVersion cannot be null."); if (_section == null) throw new IllegalArgumentException("The PackageS...
7
private boolean versionCheck(String title) { if (this.type != UpdateType.NO_VERSION_CHECK) { final String localVersion = this.plugin.getDescription().getVersion(); if (title.split(delimiter).length == 2) { final String remoteVersion = title.split(delimiter)[1].split(" ")[0]; // Get // ...
5
@Override public void actionPerformed(ActionEvent e) { // File Menu if (e.getActionCommand().equals(CANCEL)) { setCanceled(true); } }
1
public static void start(String a_port) { port = Integer.parseInt(a_port); ServerSocket ss = null; try { InetAddress thisIp = null; NetworkInterface ni = NetworkInterface.getByName("wlan0"); Enumeration<InetAddress> inetAddresses = ni.getInetAddresses(); while(inetAddre...
5
public final Number parse(String text) throws TypeConversionException { if (text == null || "".equals(text)) { return null; } if (pattern == null) { try { return createNumber(text); } catch (NumberFormatException ex) {...
9
private void moveForward() { int newX = getPositionX(); int newY = getPositionY(); switch (getFacing()) { case NORTH: newY++; break; case EAST: newX++; break; case SOUTH: newY--;...
5
public boolean higher(String a, String b) { int i = 0, limit = Math.min(a.length(), b.length()); while (i < limit - 1 && LOWER.to(a.charAt(i)) == LOWER.to(b.charAt(i))) ++i; return a.charAt(i) < b.charAt(i) || a.length() <= b.length(); }
3
public void actionPerformed(ActionEvent e) { String[] args = getArgs(e); String channel = args[0]; String sender = args[1]; String message = args[2]; if (message.contains("youtube.com/watch") || message.contains("youtu.be/")) if (acebotCore.ha...
5
private ArrayList<Object> chooseEquation(int flag){ ArrayList<Object> ret = new ArrayList<Object>(); String headerCommentP = null; String[] commentsP = null; String[] boxTitlesP = null; switch(flag){ case 0: headerCommentP = "Choose a fitting equation"; ...
8
public static ArrayList<postInfo> getPosts(long offering_id, boolean privilegeFlag){ try{ PreparedStatement pstmt; if (!privilegeFlag){ pstmt = conn.prepareStatement("select S.post_id, S.parent_post_id, S.student_id, student.name, S.mytime, " + "(s...
7
public void recalculate(final double OFFSET) { List<Stop> stops = new ArrayList<>(sortedStops.size()); for (Stop stop : sortedStops) { double newOffset = (stop.getOffset() + OFFSET) % 1; if(Double.compare(newOffset, 0d) == 0) { newOffset = 1.0; sto...
7
@Test public void TallennuksenKasittelijaLoytaaTasonNumeronArrayListista() { ArrayList<String> rivit = new ArrayList(); rivit.add("Taso: 4"); int x = k.etsiTasonNumero(rivit); assertTrue("taso oli väärä!", x == 4); }
0
private void attackCalculation(Player attacker, Player defender) { if (attacker.checkIfAlive() && defender.checkIfAlive()) { // Defender HP lost = difference between attacker's strength and defender's constitution. int attackCalc = attacker.getStrValue() - defender.getConValu...
9
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof RingPlot)) { return false; } RingPlot that = (RingPlot) obj; if (this.separatorsVisible != that.separatorsVisible) { return false; } ...
8
public static int checkStage(int stage) { if(stage>6) return 6; else if(stage<-6) return -6; else return stage; }
2
public JButton getjButtonClose() { return jButtonClose; }
0
protected void processTraverseEvent(int columnIndex, ViewerRow row, TraverseEvent event) { ViewerCell cell2edit = null; if (event.detail == SWT.TRAVERSE_TAB_PREVIOUS) { event.doit = false; if ((event.stateMask & SWT.CTRL) == SWT.CTRL && (feature & TABBING_VERTICAL) == TABBING_VERTICAL) { cell2e...
9
byte[] getBrushWithAA(CPBrushInfo brushInfo, float dx, float dy) { byte[] nonAABrush = getBrush(brushInfo); int intSize = (int) (brushInfo.curSize + .99f); int intSizeAA = (int) (brushInfo.curSize + .99f) + 1; for (int y = 0; y < intSizeAA; y++) { for (int x = 0; x < intSizeAA; x++) { brushAA[y * intSi...
4
protected void parseHost() { final int i = this.message.indexOf(' '); String hostAddress = null; String hostName = null; if (i > -1) { final String providedHost = this.message.substring(0,i).trim(); hostAddress = this.inetAddress.getHostAddress(); if (providedHost.equalsIgnoreCase(hostAddress)) { ...
6
private static void loadFEP() { try { FileInputStream fstream; fstream = new FileInputStream("fep.conf"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null) { HashMap<Stri...
4
public void walkRight() { face = 1; if (!(x == Realm.WORLD_WIDTH - 1) && !walkblockactive) if (!Collision.check(new Position(x, y), face)) { x += walkspeed; setWalkBlock(walkblocktick); } }
3
public static void main(String[] args) { Scanner input = new Scanner(System.in); input.useLocale(Locale.US); System.out.println("Inserisci un aggettivo :"); String aggettivo = input.next(); input.close(); //aggiungo la lettera maiuscola aggettivo = aggettivo.toUpperCase().substring(0,1)+a...
6
public static boolean isReleased(int i) { return !keyState[i] && prevKeyState[i]; }
1
public void PKz() { if(PlayerHandler.players[KillerId] != null) { if(KillerId != playerId){ if(PlayerHandler.players[KillerId].combat > combat){ lnew = 1; } else if(PlayerHandler.players[KillerId].combat < combat){ lnew = 3; } else if(PlayerHandler.players[KillerId].combat...
8
public String getConfigPath(String filename) { if (eng.isApplet()) return null; File jgamedir; try { jgamedir = new File(System.getProperty("user.home"), ".jgame"); } catch (Exception e) { // probably AccessControlException of unsigned webstart return null; } if (!jgamedir.exists()) { // try to ...
9
private final void method2855(int i, byte i_56_) { anInt8927++; if (i_56_ < -42) { for (Class348_Sub43 class348_sub43 = ((Class348_Sub43) ((Class348_Sub16_Sub1) aClass348_Sub16_Sub1_8958) .aClass262_8848.getFirst(4)); class348_sub43 != null; class348_sub43 = ((Class348_Sub43) ((C...
5
public static double incompleteBetaFraction1( double a, double b, double x ) { double xk, pk, pkm1, pkm2, qk, qkm1, qkm2; double k1, k2, k3, k4, k5, k6, k7, k8; double r, t, ans, thresh; int n; k1 = a; k2 = a + b; k3 = a; k4 = a + 1.0; k5 = 1.0; k6 = b - 1.0; k7 = k4; k...
7
@Test public void randomShapeGeneration() { RandomShapeGenerator rsg = new RandomShapeGenerator(); for (int i = 0; i < 1000; i++) { Shape newShape = rsg.getNewShapeAtRandom(); for (Shape shape : shapeCount.keySet()) { if (newShape.getClass().getName().equals(s...
3
private List<Integer> getMailNumberList() { String response; List<String> responseList = new ArrayList<String>(); List<Integer> MailNumberList = new ArrayList<Integer>(); try { sTrace.debug("Try Stat Command"); writeToServer("List"); response = readFromServer(); while(!response.equals(".")){ res...
5
public void addMissileToOrefPanel(String destination, int time, int flyTime) { // exclude messages with # - to prevent showing interception alerts if(!(destination.contains ("#"))){ // time % 2 - to make the alert blink every second if (time < ALERT_DISPLAY_TIME && time % 2 == 0) { topAlert.setText("Alert in...
5
@Override protected void wildCardPlayed(TurnContext state) { System.out.print("You have put down a wildcard. "); if (state.selection == null && state.g.canDraw() && state.currentPlayable.isEmpty()) { System.out.println("Since cards can be drawn, you must draw and you cannot put down any more cards."); } else ...
4
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 void IncrementPersonsCreated() { personsCreated += 1; }
0
public synchronized DataInputStream getChunkDataInputStream(int x, int z) { if (outOfBounds(x, z)) { debugln("READ", x, z, "out of bounds"); return null; } try { int offset = getOffset(x, z); if (offset == 0) { // debugln("READ", x...
7
@Override public void deleteIngredient(int i) { Ingredient ingredient = getIngredient(i); for(int parent : ingredient.getParentIngredients()){ for(Ingredient child : getChildrenIngredients(ingredient)){ child.addParent(parent); updateIngredient(child); } } try(Connection connection = DriverManage...
3
public void move(int dx, int dy) { AffineTransform at = new AffineTransform(); at.translate(dx, dy); ((GeneralPath) shape).transform(at); canvas.repaint(); }
0
public static Cons mergeConsLists(Cons list1, Cons list2, java.lang.reflect.Method predicate) { { Cons cursor1 = list1; Cons cursor2 = list2; Cons result = Stella.NIL; Cons tail = Stella.NIL; Cons temp = Stella.NIL; for (;;) { if (cursor1 == Stella.NIL) { if (tail ==...
7
public CheckResultMessage checkL6(int day){ int r1 = get(17,5); int c1 = get(18,5); int r2 = get(30,5); int c2 = get(31,5); if(checkVersion(file).equals("2003")){ try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if(0!=getValue(r2+6, c2+day, 10).compareTo(getValue(r1+2+day...
5
public void setThumbUrl(String thumbUrl) { this.thumbUrl = thumbUrl; }
0
public static String formatPackets(long paramLong, boolean MB, boolean GB) { if (paramLong >= 1000000000L && GB) { return paramLong / 1000000000L + " B"; } if (paramLong >= 10000000L && MB) { return paramLong / 1000000L + " M"; } if (paramLong >= 1000L) { return paramLong / 1000L + " K"; } return...
5
@Test public void testSerialize() { ThriftyList<Integer> list = new ThriftyList<Integer>(); int testCount = 10; for (int j = 0; j < testCount; j++) { list.add(j); } try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream os = new ObjectOutputStream(out);...
4
@Override public ParserResult specialCheckAndGetParserResult(ParserResult result, SyntaxAnalyser analyser) throws GrammarCheckException { Map<String, String> dimensionLevelInfo = result.getDimensionLevelInfo(); boolean conditionIsOk = dimensionLevelInfo.size() == 2; for (Iterator<String> iterator = dimensionL...
7
private static boolean canBeAbundant(int n){ for(Integer a : abundant){ if (abundant.contains(n-a)) return true; } return false; }
2
public void atBat() throws PopFoul { }
0
public void setPrpMoaConsec(int prpMoaConsec) { this.prpMoaConsec = prpMoaConsec; }
0
@Override public void giveIMC2ChannelsList(MOB mob) { if((mob==null)||(!imc2online())) return; if(mob.isMonster()) return; final StringBuffer buf=new StringBuffer("\n\rIMC2 Channels List:\n\r"); final Hashtable channels=imc2.query_channels(); buf.append(CMStrings.padRight(L("Name"), 22)+CMStrings.padR...
8
@Override public void setHouseNumber(String houseNumber) { super.setHouseNumber(houseNumber); }
0
public static boolean isValidDate(int day, int month, int year) { if (isMonthWith31Days(month)) { return (day >= 1) && (day <= 31); } else if (month == 2) { if (isLeapYear(year)) { return (day >= 1) && (day <= 29); } else { return (day >= 1) && (day <= 28); } } else { return (day >= 1) && (...
7
public StopwatchTimer(String author, long time, long period) { this.author = author; baseTime = time; remainingTime = time; if(period != 0 && baseTime > period) this.period = period; else if(baseTime > 60) this.period = 60; }
3
public Integer convert(Object object,Integer defultValue,Object... args) throws HeraException{ if(object instanceof Double){ return new DoubleIntegerConverter().convert((Double)object, defultValue, args); } else if(object instanceof Long){ return new LongIntegerConverter().convert((Long)object, defultValue,...
4
private static void viewAStudent(String first, String last) { String allInfo = new String(); if (studentExists(first, last) >= 0) { Student tempStudent = new Student( (Student) Students.get(studentExists(first, last))); allInfo = ("Name: " + tempStudent.getfName() + " " + tempStudent .getlName()); ...
2
public static void rullTilbake(Connection forbindelse) { try { if (forbindelse != null && !forbindelse.getAutoCommit()) { forbindelse.rollback(); } } catch (SQLException e) { skrivMelding(e, "rollback()"); } }
3
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
private BufferedImage getMaskedImage(BufferedImage bi) { // get the color of the current paint final Paint paint = state.fillPaint.getPaint(); if (!(paint instanceof Color)) { // TODO - support other types of Paint return bi; } Color col = (Color) paint;...
4
public static void main(String[] args) throws InterruptedException { ApplicationContext context = new ClassPathXmlApplicationContext("main-context.xml"); WorldFactory worldFactory = context.getBean(ToroidalArrayWorldFactory.class); UniverseFactory universeFactory = context.getBean(UniverseFactor...
3
public Checker getChecker(int x, int y) { for(Checker checker: redCheckers) { if( (checker.checkX(x)) && (checker.checkY(y)) ) { return checker; } } for(Checker checker: blackCheckers) { ...
6
private void addAttackers(int color, int target, int excludedSquare) { // This function pushes the attackers found on top of the stack in MV (Move-value) order: // e.g. king -> queens -> rooks and so on so we do NOT have to worry about AttackerStacks // pushIntoPlace() until we begin to add hid...
9
private static List<Element> find(Node root, String nsUri, String localName, boolean recursive) { List<Element> result = new ArrayList<Element>(); NodeList nl = root.getChildNodes(); if (nl != null) { int len = nl.getLength(); for (int i = 0; i < len; i++) { ...
9
public void visitStackManipStmt(final StackManipStmt stmt) { if (CodeGenerator.DEBUG) { System.out.println("code for " + stmt); } genPostponed(stmt); // All the children are stack variables, so don't so anything. switch (stmt.kind()) { case StackManipStmt.SWAP: method.addInstruction(Opcode.opcx_swa...
8
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); Page page= new Page(); HttpSession session = request.getSession(getURI(request).indexOf("new")>0); ...
7
private static void GetGraphlist() throws FileNotFoundException { // TODO Auto-generated method stub GraphList.clear(); File f = new File("src/kargerMinCut.txt"); Scanner s = new Scanner(f); int i = 0; int j = 0; while (s.hasNext()) { Scanner sl = new Scanner(s.nextLine()); sl.nextInt(); java.ut...
2
public Point getViewPosition() { return (viewIsUnbounded() ? getPanCenterPoint() : super.getViewPosition()); }
1
public static Mouse newMouseDialog() { JTextField mouseName = new JTextField(12); JTextField mouseBirthDate = new JTextField(12); JTextField mouseColour = new JTextField(12); JPanel namePanel = new JPanel(); namePanel.add(new JLabel("Name:")); namePanel.add(Box.createHorizontalStrut(22)); namePanel.add(...
5
public static String LFSR(String semSuc, String pol, int sizeOutput) { int output = 0; StringBuffer sucAux = new StringBuffer(); int[] vec = new int[sizeOutput]; //Se crea el vector que hace de buffer de tamaño pasado desde la interfaz o igual (2^n-1)*2 por defecto //Copia la semilla ...
9
public String getDescription() { return description; }
0
@Test public void filtersByAuthorLastnameWorks2() { citations.add(c1); citations.add(c2); citations.add(cnull); filter.addFieldFilter("author", "Isoherra"); List<Citation> filtered = filter.getFilteredList(); assertTrue(filtered.contains(c2) && filtered.size() == 1); ...
1
public void resolveSymbol() { switch (m_lex.tok().type()) { case INT: case FLOAT: case CHAR: case STRING: updateCurrent(m_symbols.get("{literal}")); break; case ID: { Symbol smb = m_symbols.get(m_lex.tok().value()); if (smb == null) { smb = m_scope.find(m_lex.tok().value()); } updat...
9
private void spawnResources(ResourceType rt, int count, int level) { Point p; int y; for (int i = 0; i < count; i++) { p = rt.getNewXY(gameController.getMapWidth(), level); if (p.x > 0 && p.y > 0) { Resource r = new Resource(registry, this, rt, p.x, p.y, 0...
9
private void accept(){ if (verifyAddress(Adress.getText())){ if (port.getText().matches("[0-9]+") && port.getText().length() > 0){ if(!Adress.getText().trim().equals("")){ try { catalogue.setNameServer(InetAddress.getByName(Adre...
6
private void handleFileClick(FindReplaceResult result) { try { String filepath = result.getFile().getCanonicalPath(); Document doc = Outliner.documents.getDocument(filepath); if (doc == null) { // grab the file's extension String extension = filepath.substring(filepath.lastIndexOf(".") + 1, filep...
3
private static int readIntNum(CompileInfo ci, String p, boolean decimal){ int radix = 10; p = p.trim(); if(!decimal){ if(ci.replacements!=null){ Integer num = ci.replacements.get(p.toLowerCase()); if(num!=null) return num; } if(p.startsWith("0x")){//$NON-NLS-1$ p = p.substring(2); ra...
6
public void start() throws InterruptedException { boolean test = false; if (test || m_test) { System.out.println("Othello :: start() BEGIN"); } boolean m_Trace = false; if(m_Trace) { System.out.println("Game::Start() - Game has started");} setWindow(new GameWindow(this));...
5
public String getSessionCookie() { if (sessionCookie == null) { sessionCookie = ""; for (Cookie cookie : request.getCookies()) { if (cookie.getName().equals(SESSION_COOKIE)) { sessionCookie = cookie.getValue(); } } } return sessionCookie; }
3
public void exportManagementToCSV() throws FileNotFoundException { JFileChooser saveFileChooser = new JFileChooser(); int returnVal = saveFileChooser.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = saveFileChooser.getSelectedFile(); S...
3
public static int goalHashCode(ControlFrame frame) { { Proposition proposition = frame.proposition; Surrogate operator = Proposition.cachedGoalOperator(proposition); Vector arguments = proposition.arguments; int code = 0; code = ((Context)(Stella.$CONTEXT$.get())).hashCode_(); if (fra...
7
@Override public void run(int interfaceId, int componentId) { switch(stage) { case -1: sendNPCDialogue(GRILLEGOATS, 9827, "Tee hee! You have never milked a cow before, have you?"); break; case 0: sendPlayerDialogue(9827, "Erm... no. How could you tell?"); break; case 1: sendNPCDialogue(GRILLEGOA...
7
private static int checkAndAddFile(List<File> list, File f) { if (Utilities.getFileExtention(f) != null && Utilities.getFileExtention(f).equalsIgnoreCase("PNG")) { try { BufferedImage image = ImageIO.read(f); int w = image.getWidth(null); int h = image...
5
private void renameRemote() { final int select = remoteList.getSelectedIndex(); if (select < 0 || select > remotefiles.length || client == null) { return; } showDialog(remotefiles[select].getFileName(), new KeyListener() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == 27) ...
9
public static void main(String[] args) { new AntLabMain().printOutMessage(); }
0
private final void method1065(ByteBuffer class348_sub49, int i, int i_0_) { if ((i_0_ ^ 0xffffffff) == -2) ((Class117) this).aChar1778 = Class50_Sub1.method462(class348_sub49.getByte(), -128); else if ((i_0_ ^ 0xffffffff) == -3) ((Class117) this).aChar1779 = Class50_Sub1.method462(class348_sub49.g...
9
public void feedDrink(int index) { DrinkObject drink = Drink.getDrink(index); if (!canAfford(drink.getPrice())) return; thirst += drink.getAmount(); // money -= food.getMoney(); // "Purchased" + food.getName(); // TODO Add Food on the screen. // TODO adding hunger is placeholder }
1
public Reader openStream(String publicID, String systemID) throws MalformedURLException, FileNotFoundException, IOException { URL url = new URL(this.currentReader.systemId, systemID); if (url.getRef() != null) { String ref = url.getRef...
4
private void censored(int row) { if (!MyFactory.getResourceService().hasRight(MyFactory.getCurrentUser(), Resource.CENSORED)) { return; } PaidDetail selectedRow = result == null ? null : result.get(row); if (selectedRow != null) { int result = JOptionPane.showConf...
6
private void writeXRefTable() throws IOException { // Link each deleted entry to the next deleted entry by iterating // backwards through the entries, which are sorted by object number. // End chain by pointing to head. If none del, chain back on itself. int nextDeletedObjectNumber = 0;...
3
public final void start(final MapleClient c, final int npc) { try { if (!(cms.containsKey(c) && scripts.containsKey(c))) { final Invocable iv = getInvocable("npc/" + npc + ".js", c); final ScriptEngine scriptengine = (ScriptEngine) iv; if (iv == null) { return; } final NPCConversationManager cm = ...
5
public void extractConfig(final String resource, final boolean replace) { final File config = new File(this.getDataFolder(), resource); if (config.exists() && !replace) return; this.getLogger().log(Level.FINE, "Extracting configuration file {1} {0} as {2}", new Object[] { resource, CustomPlugin...
4
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 void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int size = Integer.parseInt(line.trim()); if (size...
5