text
stringlengths
14
410k
label
int32
0
9
public void grab(Boolean hasGold) { this.performance = this.performance -1; if (hasGold) { this.performance = this.performance + 1000; this.setState(WumpusConsts.STATE_GOAL); } }
1
@Override public void addQuestAnswer(String answ) { questAnswer.add(answ); }
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 JTextField getJTextField0() { if (jTextField0 == null) { jTextField0 = new JTextField(); } return jTextField0; }
1
public final byte[] readBytes(final int amount) throws FileNotOnDiskException, DiskReadException { checkExists(); byte[] buffer = new byte[FILE_READ_BUFFER_SIZE]; final List<Byte> list = new ArrayList<Byte>(); int totalRead = 0; BufferedInputStream reader = null; try { reader = new BufferedInputStream(ne...
7
public static void main(String[] args) throws InterruptedException { SimpleCreature adam = new SimpleCreature(100.0); List<SimpleCreature> list = new ArrayList<SimpleCreature>(); list.add(adam); List<SimpleCreature> newBorn; while (true) { newBorn = new ArrayList<Simp...
3
private void pruneBeam(ArrayList<SegResult> beam, ArrayList<SegResult> candidates) { // TODO Implement pruning properly for (SegResult candidate : candidates) { if (beam.size() < beamSize) { beam.add(candidate); } } }
2
@Override public void run() { while (true) { try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } for (String b : Network.res.keySet()) { if (Calendar.getInstance().getTimeInMillis()/1000 - Network.res.get(b).time > 15){ ...
4
@Override public boolean containsDrink() { if((!CMLib.flags().isGettable(this)) &&(owner()!=null) &&(owner() instanceof Room) &&(((Room)owner()).getArea()!=null) &&(((Room)owner()).getArea().getClimateObj().weatherType((Room)owner())==Climate.WEATHER_DROUGHT)) return false; if(liquidRemaining()<1) { ...
9
public Set<Map.Entry<Long,V>> entrySet() { return new AbstractSet<Map.Entry<Long,V>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TLongObjectMapDecorator.this.isEmpty(); } public bool...
7
public static void keyReleased(KeyEvent keyEvent) { Iterator<PComponent> it = components.iterator(); while(it.hasNext()) { PComponent comp = it.next(); if(comp == null) continue; if (shouldHandleKeys) { if (comp.shouldHandleKeys()) ...
8
private Object handleCaln(Object tos) { if ((tos instanceof RepositoryRef && ((RepositoryRef)tos).getCallNumber() == null) || (tos instanceof Source && ((Source)tos).getCallNumber() == null)) { return new FieldRef(tos, "CallNumber"); } return null; }
4
public Component getTreeCellRendererComponent( JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus ) { if ( value instanceof LeafNode ) { JPanel panel = new JPanel(); String text = ( ( (LeafNode) value ).getItem() ).toStri...
8
private void loadDataFromFile(String file, InstanceType type) throws IOException { FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); ArrayList<Double> features = new ArrayList<Double>(); String line = null; while((line = br.readLine()) != null) { String[] tks = line.trim...
3
public static StringBuffer[] createScoreTemplate() { StringBuffer[] scoreLine = new StringBuffer[2]; for (int i = 0; i < scoreLine.length; i++) { scoreLine[i] = new StringBuffer(); } scoreLine[0].append(IConstants.SCORE_TABLE_TEMPLATE); scoreLine[1].append(IConstants.SCORE_TABLE_TEMPLATE); for (int i =...
2
public String toPrettyString() { PaddingStringBuilder output = new PaddingStringBuilder(); // Settings section PaddingStringBuilder.PaddingSection settingsSection = new PaddingStringBuilder.PaddingSection(true); output .append(" | ").append(settingsSection, "Score limit: ").append(scoreLimit) .append("\...
6
public boolean isEmptySpace () { int i = 0, j = 0; for (i = 0; i < 16; i++) { for (j = 0; j < 16; j++) { if (entries[i][j].getText().equals("")) { System.out.println("isEmptySpace() returned false at i: " + i + " j: "+j); return false; } } } return true; }
3
String factorStr() { if (factor > 1000000000) return factor / 1000000000 + "Gb"; if (factor > 1000000) return factor / 1000000 + "Mb"; if (factor > 1000) return factor / 1000 + "Kb"; return factor + "b"; }
3
public static void main(String args[]) throws IOException, InterruptedException { /* 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 fee...
8
public Comparable<?> getValue(ResultSet rs) throws Exception { if("int".equals(dataType)) { return rs.getInt(columnName); } if("bigint".equals(dataType)) { return rs.getLong(columnName); } if("nchar".equals(dataType)) { return rs.getString(colu...
7
public Move move(boolean[] foodpresent, int[] neighbors, int foodleft, int energyleft) throws Exception { Move m = null; // placeholder for return value // this player selects randomly int direction = rand.nextInt(6); switch (direction) { case 0: m = new Move(STAYPUT); break; case 1: m = new Move(WES...
9
protected InputStream getConnectionInputStream(final URLConnection urlconnection) throws DownloadException { final AtomicReference<InputStream> is = new AtomicReference<InputStream>(); for (int j = 0; (j < 3) && (is.get() == null); j++) { StreamThread stream = new StreamThread(urlconnection...
9
@Override public void attributesVisibilityChanged(OutlinerDocumentEvent e) {}
0
@SuppressWarnings ("unchecked" ) @Override public boolean retainAll( Collection<?> collection ) { final int previousSize = trie.size(); final Trie<E, Object> newTrie = trie.newEmptyClone(); for (Object element : collection) { if (trie.containsKey( element )) { ...
3
protected boolean test5 () { return true; }
0
public static void copyFile(String src, String dest, boolean keepDate) throws UtilException { try { FileUtils.copyFile(new File(src), new File(dest), keepDate); } catch (IOException e) { throw new UtilException("拷贝文件失败", e); } }
1
public static final void SpawnPet(final SeekableLittleEndianAccessor slea, final MapleClient c, final MapleCharacter chr) { slea.skip(4); final byte slot = slea.readByte(); final IItem item = chr.getInventory(MapleInventoryType.CASH).getItem(slot); switch (item.getItemId()) { case 5000047: case 5000028: ...
8
private int find_index( int index, int target ){ // divide weight into three groups: Self, Son & Daughter, and test each // Testing self int sum = tree.elementAt(index).chance_weight; if( target < sum ) { return index; // found within self } // else outside self, must be in child...
3
void processUnixWay(String argChars, String[] args, boolean shouldFail) { GetOpt getopt = new GetOpt(argChars); int errs = 0; char c; while ((c = getopt.getopt(args)) != 0) { if (c == '?') { ++errs; } else { Debug.println("getopt", "Found " + c); //if (getopt.optarg() != null) // System...
5
private void findCaptureArea(int x, int y, int owner) { if(!isOnMap(x, y)) { return; } if(map[x][y].owner == owner) { return; } boolean mask[][] = new boolean[getXSize()][getYSize()]; for(int i = 0; i < getXSize(); i++) {...
9
@Test(expected = RuntimeException.class) public void itShouldFailOnAddInteriorRingWithoutExteriorRing() throws Exception { Polygon polygon = new Polygon(); polygon.addInteriorRing(MockData.EXTERNAL); }
0
public int cdlMorningDojiStarLookback( double optInPenetration ) { if( optInPenetration == (-4e+37) ) optInPenetration = 3.000000e-1; else if( (optInPenetration < 0.000000e+0) || (optInPenetration > 3.000000e+37) ) return -1; return ((( ((( (this.candleSettings[CandleSettingType.B...
6
@Override public SQLResult executeSqlQuery(String query) throws Exception { Session session = null; Transaction trx = null; SQLResult result = new SQLResult(); try { session = sessionFactory.openSession(); trx = session.beginTransaction(); PreparedStatement statement = session.connection().prep...
8
private static TreeMap<String, Tuple<BufferedImage, Integer>> loadTilesetFile(String tilesetFilename) { try { Scanner reader = new Scanner(new FileReader("Resources/Tilesets/" + tilesetFilename)); TreeMap<String, Tuple<BufferedImage, Integer>> tileMap = new TreeMap<String, Tuple<BufferedImage, Integer>>(); w...
3
static final void method2554(byte i) { if (i != -45) anInt4032 = 61; anInt4030++; if (Class312.anInt3931 == 1 || Class312.anInt3931 == 3 || (Class312.anInt3931 != Class83.anInt1447 && ((Class312.anInt3931 ^ 0xffffffff) == -1 || Class83.anInt1447 == 0))) { Class348_Sub32.anInt6930 = 0; Cla...
6
public ChannelLPC(BitInputStream is, Header header, ChannelData channelData, int bps, int wastedBits, int order) throws IOException { super(header, wastedBits); this.order = order; // read warm-up samples //System.out.println("Order="+order); for (int u = 0; u < order; u++) { ...
9
private int[] exploreNextMove() { for (int col = 0; col < 7; col++) { if (board.validateStep(col)) { int row = board.availableSpace(col); if (board.checkConnectFour(player1, row, col) || board.checkConnectFour(player2, row, col)) { return new int[] { row, col }; } } } return new int[]...
4
private String getDecodedParameterKey() throws IOException { String[] splitOnMark = requestArray[1].split("\\?"); try { String parameters = splitOnMark[1]; String paramsWithSpace = parameters.replaceAll("=", " = "); String paramsWithAmpSpace = paramsWithSpace.replaceAll("&", " "); retur...
1
public void insertUser() { PreparedStatement st = null; String q = "INSERT INTO users SET email= ?, password = MD5(?), first_name = ?, last_name = ?"; try { conn = dbconn.getConnection(); conn.setAutoCommit(false); st = conn.prepareStatement(q); st...
3
@Override public void onAudioSamples(IAudioSamplesEvent event) { if (sectionIterator < randomSections.size()) { VideoSection currentSection = randomSections.get(sectionIterator); Long timeStamp = event.getTimeStamp(currentSection.getTimeUnit()); if (currentSection.getStart() < timeStamp) { if (cur...
3
public final void onWebsocketClose( WebSocket conn, int code, String reason, boolean remote ) { selector.wakeup(); try { if( removeConnection( conn ) ) { onClose( conn, code, reason, remote ); } } finally { try { releaseBuffers( conn ); } catch ( InterruptedException e ) { Thread.currentTh...
2
public void restoreItem(T item) { for (TimeOutListItem<T> listItem : this.list) { if (listItem.equals(item)) { listItem.restore(); this.list.remove(listItem); break; } } }
2
public RegisterWidget() { this.setTitle("Register a UniChat Account"); this.setWidth("50%"); this.setHeight("50%"); this.setShowMinimizeButton(false); this.setIsModal(true); this.setShowModalMask(true); this.centerInPage(); this.setAlign(Alignment.CENTER); ...
5
private void stopServer_adbMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopServer_adbMenuActionPerformed try { adbController.stopServer(); } catch (IOException ex) { logger.log(Level.ERROR, "An error occurred while stopping the ADB server!"); ...
1
public static Ball probe(Ball ball, int boxSize, int shiftIncrement, Rectangle2D.Double acceptQuadrant){ Cardinal direction = Cardinal.NORTH; Ball probe = new Ball(new Point2D.Double(ball.getCenterPoint().getX(), ball.getCenterPoint().getY()), ball.getVelocity(), ball.getSpeed(), MyColor.BLACK); //displace the in...
9
public int RowCount() { try { ResultSet Result = Statement.executeQuery(ClassQuery); return (Result.last() ? Result.getRow() : 0); } catch(SQLException E) { Grizzly.WriteOut(E.getMessage()); return 0; } }
2
public static void setGamemode(Player player, String playerName, String gamemodePlayerName, String gamemode) { ArrayList<Player> gamemodePlayers = AdminEyeUtils .requestPlayers(gamemodePlayerName); if (gamemodePlayers == null && gamemodePlayerName != null) { StefsAPI.MessageHandler.buildMessage().addSend...
6
public Value unaryOperation(final AbstractInsnNode insn, final Value value) { int size; switch (insn.getOpcode()) { case LNEG: case DNEG: case I2L: case I2D: case L2D: case F2L: case F2D: case D2L: ...
9
public OSCPortIn(int port) throws SocketException { super(new DatagramSocket(port), port); }
0
public static FastStringBuffer decimalToString(BigDecimal value, FastStringBuffer fsb) { // Can't use the plain BigDecimal#toString() under JDK 1.5 because this produces values like "1E-5". // JDK 1.5 offers BigDecimal#toPlainString() which might do the job directly int scale = value.scale(); ...
9
public void initTable(ITable subtable) { _table = subtable; updateTable(); }
0
IMySQLConnection getConnection() throws SQLException { System.out.println("Connections: " + conns.size()); ++cullTicker; if(cullTicker > CULL_SCHEDULE) { cullTicker = 0; cullConnections(); } for (IMySQLConnection conn : conns) { if(conn.isAvailable()) { return conn; } } return a...
3
@Override public boolean shadow_hit(Ray ray, FloatRef tmin) { float ox = ray.getOrigin().getX(); float oy = ray.getOrigin().getY(); float oz = ray.getOrigin().getZ(); float dx = ray.getDirection().getX(); float dy = ray.getDirection().getY(); float dz = ray.getDirecti...
7
private Color setclr(int i){ if(i == 0){ return Color.BLUE; } else if(i == 1){ return Color.RED; } else if(i == 2){ return Color.GREEN; } else if(i == 3){ return Color.ORANGE; } else if(i == 4){ return Color.YELLOW; } else if(i == 5){ return Color.PINK; } else{ return Colo...
6
@EventHandler(priority = EventPriority.NORMAL) public void onBlockPlace(BlockPlaceEvent event) { if (event.isCancelled()) return; Player player = event.getPlayer(); Block block = event.getBlock(); if (plugin.isLifestone(block) == true) { if (!(player.hasPermission("lifestones.breaklifestone"))) { ...
5
public void run() { try { voyageHandler voyhandlr = new voyageHandler(); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); hc = (HttpConnection) Connector.open("http://localhost:8080/smartPhp/getXmlAnnonce.php?id="+selectedAnn); dis = new DataInpu...
3
public static boolean startsWithIgnoreCase(String str, String prefix) { if (str == null || prefix == null) { return false; } if (str.startsWith(prefix)) { return true; } if (str.length() < prefix.length()) { return false; } String lcStr = str.substrin...
4
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){ try { Object o1 = session.getAttribute("UserID"); Object o2 = session.getAttribute("UserRights"); boolean bRedirect = false; ...
7
private int computeHeight(TPoint[] points) { int maxY = points[0].y; int minY = points[0].y; for (int i = 1; i < points.length; i++) { TPoint currentPoint = points[i]; if (currentPoint.y > maxY) maxY = currentPoint.y; if (currentPoint.y < minY) minY = currentPoint.y; } // + 1 is to account for d...
3
public int getGroundDecorationUid(int z, int x, int y) { GroundTile groundTile = groundTiles[z][x][y]; if (groundTile == null || groundTile.groundDecoration == null) { return 0; } else { return groundTile.groundDecoration.uid; } }
2
public DocumentEvent(Document doc) { setDocument(doc); }
0
public Shape getShape(String shapeName) { // Java 8 can use Strings in switch. switch (shapeName) { case "CIRCLE": return new Circle(); case "RECTANGLE": return new Rectangle(); case "SQUARE": return new Square(); default: return null; } }
3
public static String GetAuthToken(String username, String password) { try { CookieManager m = new CookieManager(); CookieHandler.setDefault(m); URL u3 = new URL("http://www.havenandhearth.com/portal/login"); HttpURLConnection connection3 = (HttpURLConnection) u3 ...
5
private static void loadRankURIs(URL[] URLs, String urlBase) { for (int i = 0; i < 13; i++) { URLs[i] = ImageManager.class.getResource(urlBase + i + ".svg"); } }
1
public static int d_mht(final int n) { return (int) Math.ceil(log(log(n,2)+1,2)); }
0
public static String getText(Categories category) { switch (category) { case SHOES: return "Ботинки"; case SHIRTS: return "Футболки"; case CAPS: return "Головные уборы"; case PANTS: return "Штаны"; ...
4
private void addNode(Position pos, GameNode node) { if(pos.x<mapSize) throw new RuntimeException("X выходит за границы игровой карты"); if(pos.y<mapSize) throw new RuntimeException("Y выходит за границы игровой карты"); node.setPosition(pos); ArrayList<GameNode> col = mainMa...
3
private void addVessel(Map<String, EnumElement> board, EnumLine line, EnumColumn column, boolean vertical, EnumElement vessel) throws InvalidPositionException { if (this.validatePosition(line, column, vertical, vessel)) { if (this.notOverrideVessel(board, line, column, vertical, vessel)) { final int ini...
4
private int alpha_beta(BoardNode root,int a, int b, int d) { int i,var; BoardNode tmp; if(d==0){/*if reach the max depth, return the static value */ var = this.evaluator.Evaluate(root, this.myClr); return var; } if (root.isMAX){/*for max node*/ for(i=0;i<7;i++) { if((tmp=root.NewNode(i)...
9
static void Pixel(osd_bitmap bitmap, int x, int y, int spr_number, int color) { int xr, yr, spr_y1, spr_y2; int SprOnScreen; if (x < Machine.drv.visible_area.min_x || x > Machine.drv.visible_area.max_x || y < Machine.drv.visible_area.min_y || y > ...
9
private String Complement(String binaryString) { StringBuilder complementBuilder = new StringBuilder(binaryString); for(int i = 0; i < binaryString.length(); ++i) { char flip = binaryString.charAt(i) == '0' ? '1' : '0'; complementBuilder.setCharAt(i, flip); } return complementBuilder.toString(); ...
2
public boolean removeModerator(String subForumId, User invoker, User moderator) { if (!invoker.hasPermission(Permissions.REMOVE_MODERATOR)) return false; getSubForumById(subForumId).removeModerator(moderator); save(); return true; }
1
private void AIteleport() { if (ball.getX() < 100 && ball.getVx() > 0) { if (tempBallReturned + 1 == player1.getBallReturned() && tempBallReturned != 0) { if (player2.useTeleport()) { createTeleport(); tempBallReturned = 0; } ...
5
public PersonHistory(Person P) { setIconImage(Toolkit.getDefaultToolkit().getImage(PersonHistory.class.getResource("/InterfazGrafica/Images/1418023120_Program-Group.png"))); getContentPane().setBackground(new Color(248, 248, 255)); setBounds(10, 50, 836, 739); getContentPane().setLayout(null); contentPanel.se...
0
@Override public boolean add(T e) { if (e == null) throw new RuntimeException("Does not permit nulls"); int hash =e.cuckooHash(); int hash2 = e.cuckooHashTwo(); int hash3 =e.cuckooHashThree(); hash =hash & mask; hash2 =hash2 & mask; hash3 =hash3 & mask; //inlining for performance. makes add about 2...
8
@SuppressWarnings("unused") @Deprecated private ComplexMatrix strassenMultiply(ComplexMatrix mx) { int n = getRowsNum() / 2; // 0 1 2 3 ComplexMatrix[] m1 = divideMatrixIntoFour(n, n); // a b c d ComplexMatrix[] m2 = mx.divideMatrixIntoFour(n, n); // e f g h if (m1[0].getColsNum...
3
private void process() { boolean inEpsilonRange = false; int i = 0; double error = 0; Vector prevV = v; while (i < iterations && !inEpsilonRange) { i++; v = MatrixOps.toVector(A.multiply(v)); if (v.get(1) < 0) { v = v.multiply(-...
7
private void computeMatch() { /* Phase 1 */ for (int j = 0; j < match.length; j++) { match[j] = match.length; } //O(m) computeSuffix(); //O(m) /* Phase 2 */ //Uses an auxiliary array, backwards version of the KMP failure function. //suffix[i] = the smallest j > i s.t. p...
9
void doHit() { if (gameInProgress == false) { message = "Click \"New Game\" to start a new game."; repaint(); return; } playerHand.addCard( deck.dealCard() ); if ( playerHand.getBlackjackValue() > 21 ) { message = "You've busted! Sorry, you lose."; ...
3
public double getRadius() { return radius; }
0
public void testPropertyCompareToHour() { LocalDateTime test1 = new LocalDateTime(TEST_TIME1); LocalDateTime test2 = new LocalDateTime(TEST_TIME2); assertEquals(true, test1.hourOfDay().compareTo(test2) < 0); assertEquals(true, test2.hourOfDay().compareTo(test1) > 0); assertEquals...
2
public void setCount(int count) { this.count = count; }
0
public static byte[] constructPacket(HostRecord hostRecord, int txnId) throws Exception { // calculate packet length String host = hostRecord.getDomainName(); ArrayList<IPAddress> ipAddresses = hostRecord.getIpAddresses(); int headLen = 12; String hostParts[] = host.split("\\."); int questionLen = 5; for ...
5
public Image getAvatarAsImage(int px) { switch(px) { case 16: return new ImageIcon(gravatar_16px).getImage(); case 32: return new ImageIcon(gravatar_32px).getImage(); case 64: return new ImageIcon(gravatar_64px).getImage(); case 128: return new ImageIcon(gravatar_128px).getImage(); case 256: return new...
5
public String getAnswer(){ long answer = 0; for(int x = 0; x < 20; x++){ long currentLoop = 1; for(int i = 0; i < 37; i++){ for( int y = 0; y < 13; y++){ char theNum = NUM.charAt((50 * x) + i + y); long number = theNum; currentLoop *= number; } i...
8
private void addFeatDialog() { JLabel nameLabel = new JLabel("Feat name"); nameLabel.setAlignmentX(Component.LEFT_ALIGNMENT); JTextField nameField = new JTextField(); nameField.setAlignmentX(Component.LEFT_ALIGNMENT); JLabel descLabel = new JLabel("Feat description"); d...
7
public static void configureStandardUI() { System.setProperty("apple.laf.useScreenMenuBar", Boolean.TRUE.toString()); //$NON-NLS-1$ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { ex.printStackTrace(System.err); } }
1
public List<Integer> match(String pattern, String text) { List<Integer> matches = new ArrayList<Integer>(); int m = text.length(); int n = pattern.length(); Map<Character, Integer> rightMostIndexes = preprocessForBadCharacterShift(pattern); int alignedAt = 0; while (align...
7
@Override public void paintComponent(Graphics g) { List<BeeHive> beeHiveList = _temporaryEnvironment.getBeeHives(); for (BeeHive f : beeHiveList) { g.setColor(new Color(255, 0, 0)); g.fillOval( (_fieldSizeX / 2) * _fieldScaleFactor + (((f.getPosition().x * _fieldScaleFactor) - 5) + 15), (_f...
4
private void checkForPeakY(double y) { if (isUpPeakY) { if (y < lastY) { peakY = lastY; isUpPeakY = false; } } else { if (y > lastY) { peakY = lastY; isUpPeakY = true; } } lastY = y; }
3
public boolean isScramble(String s1, String s2) { if (s1.equals(s2)) { return true; } char[] one = s1.toCharArray(); char[] two = s2.toCharArray(); Arrays.sort(one); Arrays.sort(two); if (!Arrays.equals(one, two)) { return false; } int len = s1.length(); for (int i = 1; i < len; i++) { Stri...
7
public void addPopup(int x, int y) { JMenuItem item = new JMenuItem(); JPopupMenu menu = new JPopupMenu(); item = new JMenuItem("Rename"); if(list.getSelectedIndex() == -1) item.setEnabled(false); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { @Suppr...
3
private String readInput() throws IOException { return this.keyboard.readLine(); }
0
@Override public boolean execute(Mob usr) { Container loc = usr.getLoc(); //Search the player's loc for the item's container, if we need to. if(getTargetContainer() != null){ Obj container = search(getTargetContainer(), loc); if (container != null && container.isConta...
7
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { BookService bookService = (BookService) getServletContext().getAttribute("bookService");//呼叫service int booksCount = bookService.getBooksCount();//取得book總數 ...
5
protected void setOutput(String output) { /* * Too careful again. */ if(output == null) myOutput = ""; else myOutput = output; }
1
private double getCoordinate(String RationalArray) { //num + "/" + den String[] arr = RationalArray.substring(1, RationalArray.length()-1).split(","); String[] deg = arr[0].trim().split("/"); String[] min = arr[1].trim().split("/"); String[] sec = arr[2].trim().split("/"); ...
9
public int getplayernum() { return players.size(); }
0
@Override public void run() { API api = Plugin.getAPI(); for(Player p : Bukkit.getOnlinePlayers()){ api.setMoney(p, api.getMoney(p) + api.getPlayersJob(p).getSalary()); p.sendMessage("[RP] " + api.getPlayersJob(p).getSalary() + "$ has been added to your wallet!"); } }
1
public static boolean validaMesAno (String strMesAno){ if(strMesAno == null || strMesAno.trim().equals("")){ return false; } if(strMesAno.length()!=7) return false; else{ String mes = strMesAno.substring(0, 2); if(validaNumero(mes)){ if(Long.valueOf(mes).compareTo(Long.valueOf("12")) > 0 || Long...
8