text
stringlengths
14
410k
label
int32
0
9
protected void createFrame() { MyInternalFrame frame = new MyInternalFrame(); ScribbleApplet pad = new ScribbleApplet(); frame.add(pad.getContentPane()); frame.setVisible(true); desktop.add(frame); try { frame.setSelected(true); } catch (java.beans.Pr...
1
public boolean isValidProduction(Production production) { try { checkProduction(production); return true; } catch (IllegalArgumentException e) { return false; } }
1
@Override public void doLoopAction() { if (hit) { super.ai(); } if (changeAni) { setAnimation(); changeAni = false; } }
2
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == startMissionButton) { if(Board.getInstance().getTurn().getTurnType()==null){ Board.getInstance().initTurn(); } TileContainerPanel.setBetable(true); for (TilePanel panel : TileContainerPanel.getTilePanels()) { panel.n...
9
@Override public boolean Render3D(double _deltaTime) { //TODO: Tighten the graphics on level 3. //If the game is visible render your game. if(application.isVisible()) { } return true; }
1
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 void run() { for (int i = 0; i < 4; i++) { if (linesToBlow[i] != 99) { for (int j = 0; j < 10; j++) { tokens[linesToBlow[i]][j].flash(); } } } refresh(); ...
9
@Override protected void sort(final int[] a) { index.set(0); ArrayList<Callable<Void>> list = new ArrayList<Callable<Void>>(); for (final int i : a) { Callable<Void> thread = new Callable<Void>() { @Override public Void call() { ...
5
static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
public static void main(String[] args) { try { UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { //ignored } SwingU...
1
private String getClusterTextNote(int index) { String note = "..."; switch (index) { case (1): note = "Advanced: Questions with few answers appearing to be difficult."; break; case (2): note = "FAQ: Frequently Asked Question!"; break; case (3): note = "3 Shots: Questions with low score, little ...
6
private static void sendServerMessage( Server server, String message ) { for ( ProxiedPlayer p : server.getInfo().getPlayers() ) { for ( String line : message.split( "\n" ) ) { p.sendMessage( line ); } } }
2
public void Run() { // make sure game started properly if (Initialize()) { while(mIsRunning) { // handles window events Display.update(true); mGameTime.Update(); while (Keyboard.next()) { GameProperties.GetInputHandler().HandleKeyboardEvent(); gameStates.peek(...
9
private MenuItem createEditMenu(Menu menuBar) { //Edit menu. MenuItem item = new MenuItem(menuBar, SWT.CASCADE); item.setText(resAddressBook.getString("Edit_menu_title")); Menu menu = new Menu(shell, SWT.DROP_DOWN); item.setMenu(menu); /** * Add a listener to handle enabling and disabling * some items in ...
5
private static void load(String[] argv) { int argCount = argv.length; for (int cnt = 0; cnt < argCount; cnt++) { // current string must start with "-" if ((argv[cnt] == null) || (!argv[cnt].startsWith(ArgumentPrefix))) continue; // strip o...
7
public void createNewGame(Playmode playmode, User[] user) throws IndexOutOfBoundsException{ int i = 0; for (Team team : playmode.getTeams()) { while(team.getCurrentPlayerCount() < team.getTeamSize()){ team.addUser(user[i]); i++; } } Game game = new Game(playmode); int matchType = Match.TEST; i...
7
public void setPopFecmod(Date popFecmod) { this.popFecmod = popFecmod; }
0
public void readDataBase() { try { //Class.forName("com.mysql.jdbc.Driver"); java.sql.Driver d = (java.sql.Driver)Class.forName("solid.jdbc.SolidDriver").newInstance(); String connectSQL = "jdbc:solid://localhost:2315/dba/dba"; connect1 = DriverManager.getConnection(connectSQL); connect2 =...
8
@Override protected void map(Writable key, VectorWritable value, Context context) throws IOException, InterruptedException { omega.computeYRow(value.get(), yRow); // compute outer product update for YtY if (yRow.isDense()) { for (int i = 0; i < kp; i++) { double yi; ...
8
@Override public List<Framedata> translateFrame( ByteBuffer buffer ) throws InvalidDataException { buffer.mark(); List<Framedata> frames = super.translateRegularFrame( buffer ); if( frames == null ) { buffer.reset(); frames = readyframes; readingState = true; if( currentFrame == null ) currentFra...
5
public void processConnectRequest(ServerCnxn cnxn, ByteBuffer incomingBuffer) throws IOException { BinaryInputArchive bia = BinaryInputArchive.getArchive(new ByteBufferInputStream(incomingBuffer)); ConnectRequest connReq = new ConnectRequest(); connReq.deserialize(bia, "connect"); if (LO...
8
public static void main(String[] args) { EvolvingGlobalProblemSetInitialisation starter = new EvolvingGlobalProblemSetInitialisation(); starter.initLanguage(new char[] { '0', '1' }, 10, "(1(01*0)*1|0)*"); int solutionFoundCounter = 0; int noSolutionFound = 0; List<Long> cycleCount = new LinkedList<Long>(); ...
8
final boolean needsMod() { return this.elements.contains(this.MOD_DATE) || this.elements.contains(this.MOD_DAY) || this.elements.contains(this.MOD_MONTH) || this.elements.contains(this.MOD_MONTH_STRING) || this.elements.contains(this.MOD_YEAR); }
4
@Override public synchronized int calculatePlayerScore(PlayerQuizInstance quizInstance, Map<Question, Integer> guesses) throws RemoteException { int playerQuizInstanceScore = 0; //if guesses were not submitted, set quiz to not played to avoid blocking admin from closing it if (guesses.isEmpt...
6
public void printAllFiles() { System.out.println("Printing out the database"); try { ResultSet result = printAllFiles.executeQuery(); while (result.next()) { String fileName = result.getString("FileName"); Timestamp start = result.getTimestamp("StartTime"); Timestamp end = result.getTimesta...
2
private void jTextFieldInterlocuteurCpRechercheKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldInterlocuteurCpRechercheKeyReleased try { List<projetrf.model.Ville> vv1 = RequetesVille.rechercheVilleByCp(jTextFieldInterlocuteurCpRecherche.getText().trim()); ...
2
public static double avers(double a){ if(a<0.0D && a>2.0D) throw new IllegalArgumentException("avers argument (" + a + ") must be <= 2 and >= 0"); return Math.acos(1.0D - a); }
2
@Override public void bid(String username, int itemId) { for(Auction auc : search){ if(auc.getId() == itemId){ auc.currentBid++; auc.owner = username; } } }
2
public void renderFilter() { image = loader.getImage(); raster = image.getRaster(); int[] pixels = new int[image.getWidth() * image.getHeight() * Constants.PIXEL_ARRAY_NO_ALPHA]; raster.getPixels(0, 0, image.getWidth(), image.getHeight(), pixels); for(int i = 0; i < pixels.length; i += 3) { r = pixels...
7
@EventHandler public void WitherSlow(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getZombieConfig().getDouble("Wither.Slow.Dodge...
7
protected Random getRandom() { return rand; }
0
private static String standardize(String line) { for (int i = 0; i < line.length(); i += 1) { if (Character.isWhitespace(line.charAt(i)) || Character.isLetter(line.charAt(i))) { continue; } else { System.exit(1); } } ...
7
protected Action updateAction(Action action, String name, String icon, String accel, Character mnemonic) { Action result; // did we already update that action for another component? if (action == null) { result = m_Actions.get(name); return result; } result = action; i...
8
private void excuteAction(SeleniumNode node) throws Exception { ElementAction e = node.getField().getAnnotation(ElementAction.class); if (Exist.NOTSURE.equals(e.isExist())) { try { e.type().findElement(super.driver, node.getPath()); } catch (NoSuchElementException e1) { logger.debug("this element is n...
8
@Override protected void cbThinking() { super.cbThinking(); int round = getRoundNum(); if ( teammate.size() == 0 || round%3 == 2 ) { setFireMode(ctx.MODE_FIRE_AUTO); return; } if ( ctx.my.time > 100 ) { if ( round%3 == 1 ) { ...
8
public ParsePane(GrammarEnvironment environment, Grammar grammar) { super(new BorderLayout()); this.grammar = grammar; this.environment = environment; }
0
private void checkDesyncAction(final Game serverGame, final Player serverPlayer) { Game game = freeColClient.getGame(); boolean problemDetected = false; Map serverMap = serverGame.getMap(); for (Tile t : serverMap.getAllTiles()) { if (server...
9
private Token fetchValue () { SimpleKey key = possibleSimpleKeys.get(flowLevel); if (null == key) { if (flowLevel == 0 && !allowSimpleKey) throw new TokenizerException("Found a mapping value where it is not allowed."); } else { possibleSimpleKeys.remove(flowLevel); tokens.add(key.tokenNumber - tokensTake...
5
public CtrnnPhenotype(List<Integer> attributes, int numHiddenNeurons, int sensors, int motorType){ Iterator<Integer> attributeIt = attributes.iterator(); hiddenLayer = new ArrayList<INeuron>(); motorLayer = new ArrayList<INeuron>(); this.motorType = motorType; ...
7
public final BufferedImage paintToImage(final BufferedImage _bi, final PaintObjectWriting _o, final boolean _final, final DPoint _p_start, final BufferedImage _g, final DRect _rVisibleScope) { //fetch list of points and go to the beginning of the list List<DPoint> ls_point = _o.getPoints(); model.util...
9
public WorldControl(final WorldGUI view) { this.view = view; view.getGame().addMouseListener(new MouseListener(){ public void mouseClicked(MouseEvent e) { view.setNumOfPlayers(2); view.showGame(); } public void mouseEntered(MouseEvent e){ } public void mouseExited(MouseEvent e){ } pub...
4
public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("Izquierda")) { izq = isPressed; } else if (name.equals("Derecha")) { der = isPressed; } else if (name.equals("Arriba")) { arriba = isPressed; } else if (name.equals("Aba...
5
private void loadData(byte[] data) throws SQLException, IOException { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(data); InputStreamReader inputStreamReader = new InputStreamReader(byteArrayInputStream); reader = new BufferedReader(inputStreamReader); try { ...
5
public Sound(String event, URL sound_res){ this.event = event; try { AudioInputStream audio_in = AudioSystem.getAudioInputStream(sound_res); AudioFormat format = audio_in.getFormat(); DataLine.Info info = new DataLine.Info(Clip.class, format); this.audio =...
4
public static MethodSlot helpDefineMethodFromParseTree(Cons inputtree, String stringifiedsource, Object [] MV_returnarray) { { Stella_Object nametree = null; Cons parameterstree = null; KeywordKeyValueList methodoptions = KeywordKeyValueList.newKeywordKeyValueList(); Cons bodytree = null; Sy...
6
synchronized public void updateMessages() { while (bornlist.size() > 0) list.add(bornlist.pop()); while (list.size() > 0 && list.peek().state == DeliverState.delivered) { list.pop(); messageCount--; } }
3
protected void setAge(int age) { this.age = age; }
0
public void run() { FcpMessage fcpMessage = null; Throwable throwable = null; while (true) { synchronized (this) { if (shouldStop) { break; } } try { String line = readLine(); logger.log(Level.FINEST, "read line: %1$s", line); if (line == null) { break; } if (line.le...
9
public boolean compPotions(PotionTypeAdv potion, Player play, String sAction, ArrayList<PaymentCache> aPayer) { HashMap<String, ArrayList<PotionTypeAdv>> hType = _jobsdata.getPotHash(); if(hType.isEmpty()) return false; for(Map.Entry<String, ArrayList<PotionTypeAdv>> e : hType.entry...
5
@Override public String buscarDocumentoPorFechaPago(String fechapago1, String fechapago2) { ArrayList<Venta> geResult= new ArrayList<Venta>(); ArrayList<Venta> dbVentas = tablaVentas(); String result=""; Date xfechapago1; Date xfechapago2; Date f; ...
8
public void update() { Window window = device.getFullScreenWindow(); if (window != null) { BufferStrategy strategy = window.getBufferStrategy(); if (!strategy.contentsLost()) { strategy.show(); } } // Sync the display on some systems. ...
2
public CommandHandler(LogOre plugin, String highlight, String normal) { StringBuilder i = new StringBuilder(); i.append(highlight) .append(plugin.getDescription().getName()) .append(normal) .append(" v") .append(highlight) ....
2
public void blinkparticle() { if (untouchable > 0) { if (blink > 15 && blink <= 30) { setImage(invin); } else if (blink >= 0 && blink <= 15) { setImage(empty); } } else if (untouchable == 0) { getWorld()...
6
public static int KMPmatch(String source, String target) { if (source == null || target == null || source.length() < target.length()) { return -1; } if (target.equals("")) { return 0; } int[] next = KMP.CalNext(target); int i = 0, j = 0; while (i < source.length()) { if (source.charAt(i) == targe...
8
public Set<Map.Entry<Byte,Short>> entrySet() { return new AbstractSet<Map.Entry<Byte,Short>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteShortMapDecorator.this.isEmpty(); } publ...
8
public static List<FieldRegistration> getFields(Class<?> clazz) throws FieldRegistrationException { final List<FieldRegistration> fields = new ArrayList<FieldRegistration>(); while (clazz!=null){ for (Field field : clazz.getDeclaredFields()) { FieldRegistration fieldRegistration = getField(field); if (fi...
6
public ItemMapping(IClientContext ctx) { super(ctx); final WrapperLoader<ItemDefinition> loader = ctx.definitions.system().itemLoader; // map of items ids to real id //try (PrintWriter items = new PrintWriter(new File("items.txt"))) { int id = 0; while (loader.canLoad(id)) { final ItemDefinition definiti...
4
/*Delete User*/public boolean deleteUser(String where, String what) { try{ if(where.length() > 40 || what.length() > 40)return false; delete.setString(1, where); delete.setString(2, what); delete.executeUpdate(); return true; }catch(Exception e){e.printStackTrace();} return false; }
3
public boolean contains(Object src) { return ((src == this.slider) || (src == this.spinner) || (src == this.radioButton) || (src == this.label)); }
3
public static int search( byte[] text, int offset, byte[] pattern ) { int[] next = initNext( pattern ); int i = offset, j = 0; n = 1; while ( i < text.length ) { while ( j >= 0 && pattern[j] != text[i] ) { j = next[j]; } i++; j++; if ( j == pattern.length ) return i - pattern.le...
4
public void leaving(final String name, final Object o) { // info(StringUtils.shortName(o.getClass()) + "-" + o.hashCode() + " leaving " + name + "()"); }
0
public void crearPedido(int ancho , int largo, int d , int m , int a) { //tinee que validar que no haya pedidos creados boolean pedidoExistente = false; for (int x = 0; x < pedidos.size(); x++) { Pedido aux = (Pedido) pedidos.get(x); if (cActual.getClienteId() == aux.getC...
3
static boolean isDigit(char ch) { switch(ch) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return true; } return false; }
9
public void removePush() { if (pushedLocal != null) exceptionLocal = pushedLocal; super.removePush(); }
1
@Override public void execute() { Player receiver = getReceiver(); StringBuilder builder = new StringBuilder(); if (players != null && !players.isEmpty()) { HashMap<String, String> values = new HashMap<String, String>(1); builder.append(TerminalUtil.createHeadline("T...
7
public synchronized Serializable jvnInvalidateWriterForReader() throws JvnException { System.out.println("invalidate writerforreader with state : "+STATE+" sur l'objet "+joi+" "+System.currentTimeMillis()); if(STATE != STATE_ENUM.RWC && STATE != STATE_ENUM.W){ STATE = STATE_ENUM.NL; } else{ wait_...
5
private int sendImage(final String language, final String filePath, StringBuilder sb) throws ClientProtocolException, IOException { final HttpClient httpclient = new DefaultHttpClient(); final HttpPost httppost = new HttpPost(SERVICE_URL); final FileBody image = new FileBody(new Fil...
3
public void writePolyomino(boolean[][] polyomino) throws IOException{ assert polyomino.length == this.size; assert polyomino[0].length == this.size; int numBytes = (polyomino.length * polyomino[0].length + 7)/ 8; byte[] bytesToAdd = new byte[numBytes]; byte currentByte=0; ...
5
public static void main(String[] args) { // TODO Auto-generated method stub }
0
public void basicSetParcours(Parcours myParcours) { if (this.parcours != myParcours) { if (myParcours != null) { if (this.parcours != myParcours) { Parcours oldparcours = this.parcours; this.parcours = myParcours; if (oldparcours != null) oldparcours.unsetWorkout(); } } } }
4
public boolean traiterAppelsExternes(Echeancier e, int date) { if (this.getPriorite() == '^') { //On parcourt les étages supérieurs Etage et = this.getEtage(); while ((et = this.ascenseur.getEtageSuivant(et)) != null) { //Si des gens attendent sur le palier ...
6
private PrivateMessagingListener getPrivateMessagingListener(String nickname) { for (PrivateMessagingListener listener : privateMessagingListeners) { if ( listener.getNickname().equalsIgnoreCase(nickname) ) return listener; } return null; }
2
public double side(Box box) { final Point2DInt corners[] = box.getCorners(); final double s0 = side(corners[0]); final double s1 = side(corners[1]); final double s2 = side(corners[2]); final double s3 = side(corners[3]); if (s0 > 0 && s1 > 0 && s2 > 0 && s3 > 0) { return 1; } if (s0 < 0 && s1 < 0 && ...
8
public void tick(int x, int y) { this.x = x; this.y = y; if (timer.isDone()) { frame++; timer.start(tpf); } if(frame == 5) frame = 0; }
2
public List<Location> adjacentLocations(Location location) { assert location != null : "Null location passed to adjacentLocations"; // The list of locations to be returned. List<Location> locations = new LinkedList<Location>(); if(location != null) { int row = location.ge...
9
public Location getLocation() { if (currentLocation == DINER) { return diner; }else if (currentLocation == POLICE_STATION) { return policeStation; }else if (currentLocation == MANSION) { return mansion; }else if (currentLocation == CAR) { return car; }else if (currentLocation == P...
9
@Override public void keyPressed(KeyEvent ke) { int key = 0; try { key = ke.getKeyCode(); } catch(UnsupportedOperationException e) { } switch(key) { case KeyEvent.VK_RIGHT : //Mouvement vers la droite moves.set...
6
private boolean seuraavanaNegatiiviMiinus() { return syote.substring(paikka, paikka + 1).equals("-") && lauseke.nykyinenLohko().onTyhja(); }
1
private void drawWorld(World world) { // n.b. Z-ordering is decided by painter's algorithm // draw the terrain Stage stage = world.getStage(); for (int i = 0; i < stage.getHeightMap().size(); ++i) { int height = stage.getHeightMap().get(i); renderer.drawAtWithHeight(floorSpr, new Vector2(stage.getLeftP...
8
private void removeAll(final boolean mark) { if (mark) { AbstractInsnNode insn = first; while (insn != null) { AbstractInsnNode next = insn.next; insn.index = -1; // insn no longer belongs to an InsnList insn.prev = null; in...
2
static ArrayList<Field> getFields(Class<?> cls) { if (cls == null) return new ArrayList<Field>(); ArrayList<Field> output = new ArrayList<Field>(); Field fieldlist[]; try { fieldlist = cls.getFields(); output.addAll(Arrays.asList(fieldlist)); fieldlist = cls.getDeclaredFields(); for (int i = 0; i <...
6
public Document performFetch() throws SQLException { //Output document Document fetchData = null; Dbhandle handle = new Dbhandle(); if (fetchAction == FetchAction.FETCH_USER) { } else if (fetchAction == FetchAction.FETCH_MEETING) { } else if (fetchAction == FetchAction.FETCH_EVENT) { } el...
5
private void fireServerStartEvent(ServerStartEvent evt) { Object[] listeners = serverStartListenerList.getListenerList(); for (int i=0; i<listeners.length; i+=2) { if (listeners[i]==ServerStartListener.class) { ((ServerStartListener)listeners[i+1]).OnServerStartEvent(evt); } } }
2
public static void main(String[] args) throws Exception { PrivateField p = new PrivateField(); Class<?> classType = p.getClass(); Field field = classType.getDeclaredField("name"); /** * Exception in thread "main" java.lang.IllegalAccessException: Class reflection.ModifiedPrivateField can not access...
1
public SolverState solve(ProblemDefinition problem) { OccurrenceSelection occurrenceSelection; AllocationSelection allocationSelection; try { occurrenceSelection = (OccurrenceSelection)Class.forName( properties.getProperty("solver.occurrenceSelectionClassName", "n...
8
private Integer readNumErrors(XMLStreamReader xmlsr) throws XMLStreamException { Integer countNb = null; // Compteur d'entrées dans un élément int nbStart = 0; // Type d'évemenement int eventType; // On est déjà dans l'élément, il faut récupérer l'attribut 'count' int attCount = xmlsr.getAttributeCount...
6
public void clearThawed() { // Avoid concurrent modification exceptions. ArrayList list = new ArrayList(); list.addAll(configurationToButtonMap.values()); Iterator it = list.iterator(); while (it.hasNext()) { ConfigurationButton button = (ConfigurationButton) it.next(); if (button.state != Configuratio...
2
public synchronized Iterator<RecordInfo> iterator(int sortIndex, boolean descending) { Iterator iter = null; if (sortIndex < 0) iter = Arrays.asList(unsortedRecords.toArray()).iterator(); else { final List<RecordInfo>[] whichList = descending ? reverseSorted : forwardSorted; if ((whichList == ...
7
private void jTextFieldSearchLivreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldSearchLivreKeyTyped // TODO add your handling code here: if (evt.getKeyChar() == KeyEvent.VK_ENTER) { String toSearch = jTextFieldSearchLivre.getText(); if (jRadioButtonAllLivre.i...
8
public static String parseMsg(String data) { String[] lines = data.split("\n"); for (String line : lines) { String[] parts = line.split(":", 2); if (parts[0].equals("msg")) { return parts[1]; } } return null; }
2
public void deleteRoom(Scanner sc) { System.out.println("Delete a room"); System.out.print("Enter Room Number: "); String deleteRm = sc.nextLine(); shsmb.dummyType(); shsmb.deleteRoom(deleteRm); System.out.println("Successfully delete a room"); }
0
public static synchronized ViewHelperFactory getInstance() { if (viewHelperFactory == null) { viewHelperFactory = new ViewHelperFactory(); } return viewHelperFactory; }
1
private void appendParser(final String title) { try { GenericParser panel2add = null; if (title.equals(NeighborhoodParser.NAME)) { panel2add = new NeighborhoodParser(jTabbedPane1); } else if (title.equals(ClustersParser.NAME)) { panel2add = ne...
8
public static Department returnDepartment(String deptName) { Session session = sf.openSession(); org.hibernate.Transaction tr = session.beginTransaction(); String strSql ="from Department o where o.deptName =:dn"; Query query = session.createQuery(strSql); query.setPara...
3
@Override public void playerGamePlay(RSAService rsaService, ComService comServ, User gameUser, ArrayList<User> gameUsers, SigService sig, SearchGamesTask jgt) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException, IllegalBlockSizeE...
8
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { Object msg = e.getMessage(); if (!(msg instanceof HttpMessage) && !(msg instanceof HttpChunk)) { ctx.sendUpstream(e); return; } HttpMessage currentMessage = th...
8
private static void processLoadProject(String dataStr, Object key){ Project curProject = null; ArrayList<Project> myProjs = new ArrayList<Project>(); String[] data = dataStr.trim().split("\n"); for (String line : data) { String[] parts = line.split("\t"); parts[parts.length-1] = parts[parts.length-1]....
9
public ItemStack transferStackInSlot(int par1) { ItemStack var2 = null; Slot var3 = (Slot)this.inventorySlots.get(par1); if (var3 != null && var3.getHasStack()) { ItemStack var4 = var3.getStack(); var2 = var4.copy(); if (par1 < 9) { ...
7
public void startArena(String arenaName) { if (getArena(arenaName) != null) { //If the arena exsists final Arena arena = getArena(arenaName); //Create an arena for using in this method arena.sendMessage(ChatC...
6
static int validateDay( int y, int m, int d ) { if( d > 28 ) { // m is 0-based if( m == 1 ) // TODO: Get maximum for year { d = 28; } else if( ((m == 3) || (m == 5) || (m == 8) || (m == 10)) && (d == 31) ) { d = 30; } } return d; }
7