text
stringlengths
14
410k
label
int32
0
9
private static void sort(int[] array) { // TODO Auto-generated method stub for(int i = 0; i < array.length - 1; i++){ for(int k = 0; k < array.length - 1 ; k++){ int temp; if(array[k] > array[k+1]){ temp = array[k]; array[k] = array[k+1]; array[k+1]=temp; } } } }
3
protected ArrayList<Placement> densityMapping(Field[][] map, int c) { shootDensity.clear(); for (int y = 0; y < map.length; ++y) { for (int x = 0; x < map[y].length - shipValue + 1; ++x) { int tmp = 0; for (int z = 0; z < shipValue; ++z) { ...
9
public Map<String, Integer> splitAndCount() throws EmptyLineException { String delims = ", :.-=+/*"; for (int i=0; i<arrayOfStrings.size(); i++){ String splitString = arrayOfStrings.get(i); if (splitString.isEmpty()) { throw new EmptyLineException("Empty line"); } StringTokenizer st = new StringToke...
6
private boolean r_tidy_up() { int among_var; // (, line 183 // [, line 184 ket = cursor; // substring, line 184 among_var = find_among_b(a_7, 4); if (among_var == 0) { ...
8
public Sudoku(boolean autoPossBasic, boolean autoPossAdvanced, boolean autoFillBasic, boolean autoFillAdvanced, boolean possAsNum, boolean initialPoss, int initNumbers, int size, final MouseListenerMethod m, int difficulty) { super(new GridBagLayout()); this.size = si...
8
@Override public int[] find(final String[] criteria) throws RecordNotFoundException { final List<Integer> results = new ArrayList<Integer>(); for (int n = 0; n < this.contractors.size(); n++) { if (!this.isRecordDeleted(n)) { this.lock(n); boolean match = true; for (int i = 0; i < criteria.length; ...
8
@Override public void initialize(Vertex start) { initializeSingleSource(start); for (int i = 0; i < vertices.getSize(); i++) { heap.insert(vertices.get(i)); } for (int i = 0; i < edges.getSize(); i++) { edges.get(i).setVisited(false); } }
2
public void checkForRightInput(int rs, int cs) { boolean isTooBig = checkForTooBigInput(rs, cs); if(isTooBig) { showTooBigInputError(); } if(rs > 0 && cs > 0 && !isTooBig) { model = new GameSimulator(rs, cs); createNewWindow(); } if(rs == 0 || cs == 0) { showCharacterInputError(); } }
6
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final POSTerminal other = (POSTerminal) obj; return Objects.equals(this.terminalID, other.terminalID); }
3
public boolean newLibrary( Class libraryClass ) throws SoundSystemException { initialized( SET, false ); CommandQueue( new CommandObject( CommandObject.NEW_LIBRARY, libraryClass ) ); comman...
4
public static boolean adjoinTaxonomyNodeIntervalP(TaxonomyNode node, Interval interval) { { Cons intervalstoremove = Stella.NIL; { Interval renamed_Int = null; Cons iter000 = node.intervals; for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) { renamed_Int = ((Interval)(iter000...
7
@Basic @Column(name = "zip") public String getZip() { return zip; }
0
private void dfs(int x,int y){ if(dist<0) return; grid[y][x] = 1; for (int i=-dist;i<=dist;i++){ for(int j=Math.abs(i)-dist;j<=dist-Math.abs(i);j++){ int newx = x+i; int newy = y+j; if(newx>=0&&newx<width&&newy>=0&&newy<height&&field[n...
9
public JuliaPanelDouble(double a, double b) { left = -2; right = 2; top = -1; bottom = 1; cA = a; cB = b; }
0
public int getInt(int index, int length) { // User input. List<String> words = this.getParser().getInput(); if (!words.isEmpty()) { try { index = Integer.parseInt(words.get(0)); // Index out of bounds. if (index >= 0 && index < len...
4
public void parseEncoding(PDFObject encoding) throws IOException { differences = new HashMap<Character,String>(); // figure out the base encoding, if one exists PDFObject baseEncObj = encoding.getDictRef("BaseEncoding"); if (baseEncObj != null) { baseEncoding = getBaseEncodi...
5
public void testCaseSensitiveMetaData() { DataSet ds; final String cols = "COLUMN1,column2,Column3\r\n value1,value2,value3"; Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); // check that column names are case sens...
4
public void paint(Graphics g, Shape a) { Color oldColor = g.getColor(); fBounds = a.getBounds(); int border = getBorder(); int x = fBounds.x + border + getSpace(X_AXIS); int y = fBounds.y + border + getSpace(Y_AXIS); int width = fWidth; int height = fHeight; int sel = getSelectionState(); if( ! hasPi...
9
@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 SiteBoundaryDataset)) { return false; } SiteBoundaryDataset other = (SiteBoundaryDataset) object; if ((this.dat...
5
public static Locale toLocale(Object value) throws ConversionException { if (value instanceof Locale) { return (Locale)value; } else if (value instanceof String) { List elements = split((String)value, '_'); int size = elements.size(); if (size >= 1 && ...
7
public Date getBookingDate() { return bookingDate; }
0
private void resize() { width = getSkinnable().getWidth(); height = getSkinnable().getHeight(); size = width < height ? width : height; if (width > 0 && height > 0) { if (aspectRatio * width > height) { width = 1 / (aspectRatio / height); } els...
7
static public double[] getMarker(int x, int y) { double lat = latitude - yToMap[zoomIndex]*y + imageSizeH/2*yToMap[zoomIndex]; double lon = longtitude + xToMap[zoomIndex]*x - imageSizeW/2*xToMap[zoomIndex]; double [] coords = {lat, lon}; return coords; }
0
@Override public void bougerPierre(int x, int y) { if (donjon.getPosition(x, y).estVide()) { e = donjon.getElementMobile(x, y); if (e == null) { setX(x); setY(y); } } }
2
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String url = "jdbc:mysql://db4free.net:3306/"; String driver = "com.mysql.jdbc.Driver"; String userName = "komunikator"; String password = "pawel01"; String login1 = ""; String password1 = ""; String loginTB = jTextField1.getText(); ...
5
@Override public ShadeRec clone() { ShadeRec sr = new ShadeRec(world); sr.hitAnObject = hitAnObject; sr.material = material == null ? null : material.clone(); sr.worldHitPoint = worldHitPoint == null ? null : worldHitPoint.clone(); sr.ray = ray == null ? null : new Ray(ray.ge...
5
private int findHeaderEnd(final byte[] buf, int rlen) { int splitbyte = 0; while (splitbyte + 3 < rlen) { if (buf[splitbyte] == '\r' && buf[splitbyte + 1] == '\n' && buf[splitbyte + 2] == '\r' && buf[splitbyte + 3] == '\n') { return splitbyte + 4; ...
5
public void hauptPhase() { aktuellerSpieler = spieler1; System.out.println("hauptphase"); while(laenderGraph.getAnzahlLaender(spieler1.getFraktion()) != 0 && laenderGraph.getAnzahlLaender(spieler2.getFraktion()) != 0) { int verfuegbareEinheiten = ermittleVerstaerkung(aktuellerSpieler); aktuellerSpie...
2
public void loadModule(Module module){ module.setModuleManager(this); module.onStart(); modules.add(module); DebugUtils.info("Module " + module.getName() + " loaded"); }
0
public boolean canLoot(MapleCharacter player, int itemid) { if (player.isAdmin()) { return true; } int i = 0; if (!player.isGenin() && Items.isSummonBag(itemid)) { return false; } switch (itemid) { case 4000241: i = 1; ...
9
public void actionPerformed(ActionEvent __event) { try { Object OBJ = __event.getSource(); Object read; File file; if (OBJ == _save || OBJ == _saveb) { file = selectFile(_objectfile); ...
8
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Asystent Inwestora"); primaryStage.setMinHeight(600); primaryStage.setMinWidth(800); primaryStage.setMaximized(true); // primaryStage.setFullScreen(true); tabs = CreateT...
6
private void validate(Budget budget, BudgetBreakdown budgetBreakdown) throws Exception { if(budgetCalculation == null) { throw new Exception("BudgetCalculation is null"); } if(budget == null) { throw new Exception("Budget is null."); } if(budget.getSala...
4
private boolean method322(int z, int x, int y, int offsetZ) { if (!method320(x, y, z)) return false; int _x = x << 7; int _y = y << 7; return method324(_x + 1, _y + 1, heightMap[z][x][y] - offsetZ) && method324((_x + 128) - 1, _y + 1, heightMap[z][x + 1][y] - offsetZ) && method324((_x + 128) - ...
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ValueType other = (ValueType) obj; if (this.javaType != other.javaType && (this.javaType == null || !this...
8
private void requestBearerToken() throws IOException { // Do the OAUTH2 Authenticate String oAuthTokenUrl = "https://api.twitter.com/oauth2/token"; URL tokenURL = new URL(oAuthTokenUrl); HttpsURLConnection con = (HttpsURLConnection) tokenURL.openConnection(); con.setDoOutput(true); con.setDoI...
3
public void update(GameContainer gc, StateBasedGame arg1, int delta) throws SlickException { super.update(gc, arg1, delta); Input input = gc.getInput(); if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON) && inputEnabled) { Vector2 mousePos = new Vector2(input.getMouseX(), input.getMouseY()); mousePos = ...
3
private Component parseComponentContent(NodeList childNodes) { Component component = new Component(); for (int count = 0; count < childNodes.getLength(); count++) { Node node = childNodes.item(count); if ("attribute".equals(node.getNodeName().toLowerCase())) ...
9
private void calcAngle() { final double directionToAim = this.getAngle(this.location, this.getAim()); if (this.direction != directionToAim) { final double directionAtZero = this.direction - this.direction; double directionToAimAtZero = directionToAim - this.direction; if (directionToAimAtZero <= -PI)...
6
public void setReplacement(String replacement) {this.replacement = replacement;}
0
public Component getComponentForDataSection(TaskObserver taskObserver, String dataSectionName) throws InterruptedException { if (dataSectionName == DATA_SECTION_GENERAL) { return getGeneralPanel(taskObserver); } else if (dataSectionName == DATA_SECTION_SKILLS) { return getSkillsPanel(taskObserver); ...
9
public static void iterateOverMethods(Class<?> clz,Class<?> goUpto,ReflectionCallback<Method> callback) { try{ for(Class<?> c=clz; c!=null && (goUpto==null || goUpto.isAssignableFrom(c)) ; c=c.getSuperclass()) { for(Method m : c.getDeclaredMethods()) { m.setAccess...
9
@Override public String turnHardwareOn() { String output = ""; mHardwareLayer.turnHardwareOn(); boolean compareFiles = false; if (mMode == MachineMode.MANUAL){ try { PrintWriter writer = new PrintWriter("Manual.DAS.csv", "UTF-8"); writer.p...
9
private void printDirListing(OutputStream out) { // 4 kbyts - should be set-up before! byte[] dir = new byte[4096]; int p = 0; int adr = 0x801; // Load address dir[p++] = (byte) (adr & 0xff); dir[p++] = (byte) (adr >> 8); adr += label.length() + 5; dir[p++] = (byte) (adr & 0xff); ...
9
private void render() { remove(gc); gc.removeAll(); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { if (lab.getWalkways()[i][j]) { gc.add(new GImage("blank.png", i*16, j*16)); } else { gc.add(new GImage("wall.png", i*16, j*16)); } } } add(gc); }
3
public void setColumnData(int i, Object value) throws Exception { if (i == 0) fileID = (String) value; else if (i == 1) projID = (String) value; else if (i == 2) format = (String) value; else if (i == 3) fileName = (String) value; else if (i == 4) location = (String) val...
5
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
static long f(int n) { Arrays.fill(a, inf); a[0] = 0; long B = inf; for (long t = 1; B == inf; t *= 10) { Arrays.fill(b, inf); for (int add = 0; add < L; ++add) if (a[add] != inf) { for (int m = 0; m < 10; ++m) { ...
9
final Class367 method3832(int i, byte i_64_) { if (i_64_ >= -57) aClass209Array9795 = null; int i_65_ = i; while_234_: do { do { if (-4 != (i_65_ ^ 0xffffffff)) { if ((i_65_ ^ 0xffffffff) != -5) { if (8 == i_65_) break; break while_234_; } } else return ...
6
public void setAlgorithm(String value) { this.algorithm = value; }
0
private boolean greater(Key i, Key j) { if (i.compareTo(j) > 0) return true; return false; }
1
protected void cloneFix(StdArea areaA) { me=this; basePhyStats=(PhyStats)areaA.basePhyStats().copyOf(); phyStats=(PhyStats)areaA.phyStats().copyOf(); properRooms =new STreeMap<String, Room>(new RoomIDComparator()); properRoomIDSet=null; metroRoomIDSet =null; parents=areaA.parents.copyOf(); children=ar...
7
public boolean isMatch(String s, String p) { int i = 0; int j = 0; int star = -1; int mark = -1; while (i < s.length()) { if (j < p.length() && (p.charAt(j) == '?' || p.charAt(j) == s.charAt(i))) { ++i; ...
9
public void close() throws IOException { if (socket != null) socket.close(); if (streamIn != null) streamIn.close(); }
2
public void actionPerformed(final ActionEvent EVENT) { if (EVENT.getActionCommand().equals("flip") && flipping) { previousSelectionIndex = currentSelectionIndex; currentSelectionIndex++; if (currentSelectionIndex >= selectedSet.size()) { currentSelectionIndex = 0; } nextSelectionIndex = currentSele...
8
public void processOrder(String input) throws Exception { String tokens[] = getTokenizedData(input); DataValidator validator = new DataValidator(); if (validator.validateInput(tokens)) { String fileName = tokens[0].trim(); RestaurtantDetailsLoader proc = new RestaurtantDetailsLoader(); restaurantMap = ...
8
public void tickDownTileStatuses(int currentPlayerIndex) { for (int y = 0; y < this.getGridHeight(); y++) { for (int x = 0; x < this.getGridWidth(); x++) { grid[x][y].tickDownStatuses(currentPlayerIndex); } } }
2
final void send(SocketChannel socket, ByteBuffer data) { synchronized (mPendingWriteData) { LinkedList<ByteBuffer> list = mPendingWriteData.get(socket); if (list == null) { list = new LinkedList<>(); mPendingWriteData.put(socket, list); } list.add(data); } synchronized (mPendingChanges) { m...
1
public String stringTypeValue(keyTypeValues value) { String val = "string"; switch (value) { case BOOLEAN: { val = "boolean"; break; } case DOUBLE: { val = "double"; break; } case FLOAT: { val = "float"; break; } case INT: { val = "int"; break; ...
6
public static void main(String[] args) { String line = ""; String message = ""; int c; try { while ((c = System.in.read()) >= 0) { switch (c) { case '\n': ...
4
private void attack(Civilization c) { if (c.cities.size()>0&&cities.size()>0) { City best=cities.get(0),target=c.cities.get(0); int attackGuess=aggression*best.population/100*(strength+getBonus(target.CENTER)-best.CENTER.distanceTo(target.CENTER)*distanceWeight); int defendGuess=c.aggression*target.populatio...
6
public static void main(String[] args) { CameraCaptureTester tester = new CameraCaptureTester(); tester.run(); }
0
public static void main(String[] args) { Graph G = null; try { G = new Graph(new In(args[0])); } catch (Exception e) { System.out.println(e); System.exit(1); } Bipartite b = new Bipartite(G); if (b.isBipartite()) System.out.println(args[0] + " is bipartite"); else System.out.println...
2
public static void main(String[] args) { Pattern pat = Pattern.compile(".*?xx"); Matcher mat = pat.matcher("yyxxxyxx"); while(mat.find()){ System.out.println("Start:"+mat.start()); System.out.println("Group..:"+mat.group()); } }
1
public boolean attemptToMove(double delta, Tile[] tiles) { // Store our already (hopefully) collision-free position px = x; py = y; float timeslicesRemaining = 1.0f; int numberOfTimesSubdivided = 0; boolean collided; Collision collision = new Collision(); Collision bestCollision = new Collision(); ...
8
public JButton getjButtonNew() { return jButtonNew; }
0
public static void openWorkbench(Player player) { //has to have the use permission if (!permission.has(player.getWorld(), player.getName(), "portables.workbench.use")) { return; } //has to be holding the material if (permission.has(player.getWorld(), player.getName(), "portables.workbench.has")) { //Doe...
6
protected void processChange(Rectangle paramRectangle) { Rectangle localRectangle1 = getBounds(); if (this.BufferSize != null) { localRectangle1.setSize(this.BufferSize); } if (paramRectangle.intersects(localRectangle1)) { paramRectangle = paramRectangle.intersection(localRectangle1); ...
5
public static void main(String[] args) { HttpClient httpClient = HttpClientBuilder.create().build(); try { HttpPost request = new HttpPost("http://localhost:8080/register"); StringEntity params =new StringEntity("userJson={\"id\":\"100\",\"age\":\"20\",\"name\":\"Purnima\"}"); // request.addHeader("cont...
1
public EventCommentType(final String name) { super(name); }
0
public static void main(String[] args) { Employee e1 = new Employee("Tom", "Tommerson", "555-55-5555"); Employee e2 = new Employee("Sneaky", "Sneakerson", "444-55-5555"); Employee e3 = new Employee("Sally", "Sallerson", "333-55-5555"); Employee e4 = new Employee("Bill", "Billerson", "44...
5
public boolean deliverToMemory(boolean isRead) { //If isRead, first stage of read operation, otherwise write. if (isRead) { return memory.notifyRead(addressBus.read()); } fireOperationUpdate(""); //Reset control line GUI display as data is written into MBR return memory.notifyWrite(addressBus.read(), dataBu...
1
public ResultSet executeSQLQuery(String sqlStatement) { try { // Datenbankverbindung herstellen connect = connectDB(); // PreparedStatement für den SQL-Befehl myPreparedStatement = connect.prepareStatement(sqlStatement); // SQL-Befehl wird ausgeführt myResultSet = myPreparedStatement.executeQuery...
1
@SuppressWarnings("static-access") @EventHandler(priority = EventPriority.HIGH) public void onPlayerDropItem (PlayerDropItemEvent event) { Random rand = new Random(); int possessionChance = rand.nextInt(5); final ItemStack droppedStack = event.getItemDrop().getItemStack(); final ...
1
public static void internalComponents0(Collection<Class<?>> comps, Class<?> model) { for (Field f : model.getDeclaredFields()) { f.setAccessible(true); Class<?> fc = f.getType(); if (!fc.isPrimitive() && !fc.getName().startsWith("java.") && isComponentClass(fc)) { ...
8
@Override //TODO: Need to put error check, make sure there is only one letter popping and placing // More error check? protected boolean checkAutomaton() { // TODO Auto-generated method stub //return true for now return true; }
0
BitMatrix buildFunctionPattern() { int dimension = getDimensionForVersion(); BitMatrix bitMatrix = new BitMatrix(dimension); // Top left finder pattern + separator + format bitMatrix.setRegion(0, 0, 9, 9); // Top right finder pattern + separator + format bitMatrix.setRegion(dimension - 8, 0, 8,...
8
/* */ public Object getDestroyPacket() /* */ { /* 83 */ Class<?> PacketPlayOutEntityDestroy = Util.getCraftClass("PacketPlayOutEntityDestroy"); /* */ /* 85 */ Object packet = null; /* */ try { /* 87 */ packet = PacketPlayOutEntityDestroy.newInstance(); /* 88 */ Field a =...
6
public JSONWriter endArray() throws JSONException { return this.end('a', ']'); }
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
private void checkBody() throws Exception { Token token; while(iterator < tokenList.size()) { token = tokenList.get(iterator++); if(token.getType() == TokenType.BOOL_TYPE || token.getType() == TokenType.CHAR_TYPE || token.getType() == TokenType.INT_TYPE) { checkVarDeclaration(); } else if(token...
9
@Override public <T> Invoker<T> refer(final Class<T> type, final TpURL tpURL) throws RpcException { // 获得一个 服务类 对应的 remote 请求代理 T referProxy = doRefer(type, tpURL); // 将这个请求代理进行包装,生成一个Invoker 具有远程调用外部service的能力 final Invoker<T> target = proxyFactory.createProxyInvoker(referProxy, type, tpURL); // 生成一个Abstrac...
7
public static void start() throws IOException { new Listener(); }
0
@Override public void run() { if(state==GameState.Running){ while (true) { robot.update(); if (robot.isJumped()) { currentSprite = characterJumped; } else if (robot.isJumped() == false && robot.isDucked() == false) { currentSprite = anim.getImage(); } ArrayList projectiles = robot.getProjec...
9
public boolean blockLeftClick(Block block, Player player) { // If the block we're clicking is a chest, no point doing anything if(block.getType() == Material.CHEST) return true; // Get the material in the hand Material inHand = player.getItemInHand().getType(); // They're not interacting with a block if(...
8
private boolean isPasswordAndConfirmEquals() { boolean result = false; boolean passwordAndConfirmIsValid = isPasswordValidate() && isConfirmValidate(); if(passwordAndConfirmIsValid) { result = this.password.equals(this.password_confirm) ? true: false; } return resul...
3
public static void main(String[] args) { LinearAlgebraScanner input = new LinearAlgebraScanner(); boolean done = false; System.out.println("Howdy!"); System.out.println("This heres the greatest calculator ever"); System.out.println("created with 10 functions or less."); w...
9
static void actionLikeA(A a) { a.action(); }
0
private void descripcionmedicamentosFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_descripcionmedicamentosFieldKeyTyped // TODO add your handling code here: if (!Character.isLetter(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar()))...
4
public void foreachPoms(POMHandler handler) { init(); // process the ignored pom files for (String pomPath: pomOptions.keySet()) { POMOptions options = getPOMOptions(pomPath); if (options.isIgnore()) { File pom = new File(baseDir, pomPath); ...
6
@Override public int hashCode() { int result = userSession != null ? userSession.hashCode() : 0; result = 31 * result + (watcherSession != null ? watcherSession.hashCode() : 0); return result; }
2
private boolean zzRefill() throws java.io.IOException { /* first: make room (if you can) */ if (zzStartRead > 0) { System.arraycopy(zzBuffer, zzStartRead, zzBuffer, 0, zzEndRead-zzStartRead); /* translate stored positions */ zzEndRead-= zzStartRe...
5
public static void startupExplanations() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEXT$, (...
7
public int setCurrent(Piece piece, int x, int y) { int result = board.place(piece, x, y); if (result <= Board.PLACE_ROW_FILLED) { // SUCESS // repaint the rect where it used to be if (currentPiece != null) repaintPiece(currentPiece, currentX, currentY); currentPiece = piece; currentX = x; currentY...
2
public void visit( final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { StringBuffer sb = new StringBuffer(); appendAccess(access | ACCESS_CLASS, sb); AttributesIm...
6
@SuppressWarnings("unchecked") public Object newMetadata() { if (modelData.containsKey(id)) { Object model = modelData.get(id); Object w; try { w = DynamicClassFunctions.classes.get("DataWatcher").newInstance(); } catch (Exception e) { DisguiseCraft.logger.log(Level.SEVERE, "Could not construct a...
6
public static boolean getBoolean(Object value) { try { String v = getString(value); if ("1".equals(v)) { return true; } else if ("0".equals(v)) { return false; } else if ("Y".equals(v)) { return true; } else if ("N".equals(v)) { return false; } else { return Boolean.parseBoolean(...
5
public int getSum() { aapneForbindelse(); double sum = 0; int okter = -1; try { setning = forbindelse.prepareStatement(sqlGetSum); setning.setString(1, brukernavn); res = setning.executeQuery(); while (res.next()) { sum = re...
3
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || this.length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this....
4
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void rates(CreatureSpawnEvent event) { if (P.p().shouldIgnoreNextSpawn() || P.p().shouldAbilitiesIgnoreNextSpawn()) return; if (!P.p().getPluginIntegration().canApplyAbilities(event.getEntity())) { P.p().abilitiesIgnoreNextSpawn...
7