text
stringlengths
14
410k
label
int32
0
9
public TimeLine(final SampleLog log) { this.log = log; this.samples = log.samples; setPreferredSize(new Dimension(samples.size(), 100)); addMouseWheelListener( new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent e) { scale += e.getUnitsToScroll() * 0.10f; validateValues(); ...
8
public void greedyLetterSplit(List<String> motifList) { String substring; for (String s : motifList) { for (int i = 0; i < 4; i++) { substring = s.substring(i, i + 1); switch (i) { case 0: this.A.add(Double....
6
public boolean valid() { if (actor == null) return super.valid() ; // // TODO: Try to make this whole process more elegant. Establish the // basic harvest-item from the beginning? if (type == TYPE_HARVEST) { if (actor.gear.amountOf(PROTEIN) > 0) return true ; } if (type == TYP...
6
@Override protected ClosingsModel doInBackground() throws Exception { closingsModel = new ClosingsModel(); Document schools = null; try { schools = Jsoup.connect( bundle.getString("ClosingsURL")) .timeout(10000) .get();...
5
@SafeVarargs public static final <T> boolean ins(T value, T... array) { if (value == null) { for (int i = 0; i < array.length; i++) { if (array[i] == null) { return true; } } } else { for (int i = 0; i < array.length; i++) { if (value.equals(array[i])) { return true; } } } ...
5
public String getCurrentDayTime(LocalTime time){ String interpretedDaytime = ""; LocalTime currentTime = time; if(currentTime.isBefore(morningStart)){ interpretedDaytime = "night"; } else if(currentTime.isAfter(morningStart)){ interpretedDaytime = "morning"; if(currentTime.isAfter(forenoonStar...
7
public static void main (String[] args) throws IOException, ParserConfigurationException, SAXException { Parser ps = new Parser(); // File indirectory = new File("/home/dharmesh/aditya/author_profiling/pan_author_profiling_training_data/en/"); // File outdirectory = new File("/home/dharmesh/aditya/...
2
public boolean canScroll(Direction scrollDirection) { Point robot = model.getRobotLocation(); int topBorder = Math.abs(panel.getScroll()); int bottomBorder = Math.abs(panel.getScroll()) + panel.getHeight(); switch(scrollDirection) { case DOWN: return robot.y <= (topBorder + 50); case UP: return robot....
2
public static void setPointLights(PointLight[] pointLights) { if (pointLights.length > MAX_POINT_LIGHTS) { System.err .println("Error: You passed in too many point lights. Max allowed is " + MAX_POINT_LIGHTS + ", you passed ...
1
synchronized public void startServer() { try { System.out.println("Server started"); do { Socket accept = server.accept(); protocol = protocol.getClass().getConstructor(Socket.class).newInstance(accept); new Thread(protocol).start(); } while (!isClosed); } catch (NoSuchMethodException ex) { ...
8
public void clicked() throws RealPlayerException { Player realPlayer = null; try { realPlayer = Game.getInstance().getPlayerManager().getRealPlayer(); } catch (RealPlayerException e) { e.printStackTrace(); return; } Base selectedBases = realPlayer.getSelectedBases(); // 1st case : the player ...
6
private int jjMoveStringLiteralDfa34_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 33); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 33); } switch(curChar) { case 53: return jjMoveStringLiter...
4
public void saveStatus(){ // EDebug.print("I have been called upon"); if (wait){ wait = false; return; } // EDebug.print("\nFirst place"); // for (int i = 0; i < myDeck.size(); i++) // EDebug.print(((LinkedList)myDeck).get(i).hashCode()); // ...
4
public static void inspectObject(Object o) { Class clazz = o.getClass(); Field[] fields = clazz.getDeclaredFields(); System.out.println("pola w klaise:"); for(Field f : fields) { System.out.println(f.getName() + " typu: " + f.getType()); ...
9
public List<Room> getRoomList() { List<Room> list = new ArrayList<Room>(); try { PreparedStatement ps = con.prepareStatement("SELECT * FROM rooms"); ResultSet rs = ps.executeQuery(); while( rs.next() ) { list.add(getRoomFromRS(rs)); } ps.close(); } catch (SQLException e) { // TODO Au...
2
private void editProjektledare() { int val = JOptionPane.showConfirmDialog(null, "Om du tar bort personen som projektledare kommer alla projekt som denna personen hade att bli projektledarlösa.", "Är du säker?", JOptionPane.OK_CANCEL_OPTION); if (val == JOptionPane.OK_OPTION) { try { ...
3
public static BiCubicSpline zero(int nP, int mP){ if(nP<3 || mP<3)throw new IllegalArgumentException("A minimum of three x three data points is needed"); BiCubicSpline aa = new BiCubicSpline(nP, mP); return aa; }
2
public int getS1() { return this.state1; }
0
@Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean selected, boo...
3
protected void compareDatasets(Instances data1, Instances data2) throws Exception { if (!data2.equalHeaders(data1)) { throw new Exception("header has been modified\n" + data2.equalHeadersMsg(data1)); } if (!(data2.numInstances() == data1.numInstances())) { throw new Exception("number of...
8
public Key max() { if (N == 0) throw new RuntimeException("Priority Queue Underflow"); return pq[1]; }
1
int writeUntilPattern(OutputStream streamOut, byte[] pattern) throws IOException { int indexOfPattern; int bytesWritten = 0; do { int bytesRead = fillFromStream(); indexOfPattern = indexOf(pattern); if (indexOfPattern == -1) { // No patterns in bu...
3
public void deleteFromCursor(int par1) { if (text.length() == 0) { return; } if (selectionEnd != cursorPosition) { writeText(""); return; } boolean flag = par1 < 0; int i = flag ? cursorPosition + par1 : cursorPosi...
7
public void processResult(int rc, String path, Object ctx, Stat stat) { boolean exists; switch (rc) { case Code.Ok: exists = true; break; case Code.NoNode: exists = false; break; case Code.SessionExpired: case Code.NoAuth: ...
9
public static int search(String source, String pattern) { int index = -1; int sLen = source.length(); int pLen = pattern.length(); int i = 0; while (i <= sLen - pLen) { int j = 0; while (j < pLen && source.charAt(i + j) == pattern.charAt(j)) { j++; } if (j == pLen) { return i; } else ...
5
public void resizeWatcher(){ this.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(ComponentEvent event) { environment.resizeSplit(); } ...
0
void removeAgent(int memberId, int memberType, String userName) { switch (memberType) { case GameController.passiveUser: case GameController.userContributor: case GameController.userBugReporter: case GameController.userTester: case GameController.userCommitter: case GameController.userLeader: gameContr...
6
public static void printBoolVal(String pre, char str, String suf){ if(str == '0' ){ System.out.printf(pre+"false"+suf); } else if(str == '1' ){ System.out.printf(pre+"true"+suf); } else{ System.out.printf("Error occured, printed "+str+"...
2
public void renderLevel() { int pixelIndex; for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { int xAbs = x + cameraXCoord; int yAbs = y + cameraYCoord; pixelIndex = (x + cameraXCoord) + (y + cameraYCoord) * SpriteSheets.mainStage.getXSheetSize(); if(xAbs > 0 && yAbs > 0 && xAbs <...
7
public Polynomial(long[] coeff) { int len = 0; for (int i = coeff.length - 1; i >= 0; i--) { // remove heading zeroes if (coeff[i] != 0) { len = i + 1; break; } } if (len < coeff.length) { long[] new_coeff = new long...
3
@Override public int isInside(int p_x, int p_y) { for (Rectangle r : rectList) { if((r.getX()<p_x && p_x<(r.getX()+width)) && (r.getY()<p_y && p_y<(r.getY()+height))) { return rectList.indexOf(r); } } if((getX()<p_x && p_x<(getX()+width)) && (getY()<p_y && p_y<(getY()+height))) { return 1...
9
public static BrazilianAnalyzer getAnalyzer(boolean stopwords, boolean stemming) { if(stemming) { if(stopwords) { return new BrazilianAnalyzer(Version.LUCENE_48); } else { Analyzer a = new SnowballAnalyzer(Version.LUCENE_48, "Portuguese"); if(a instanceof BrazilianAnalyzer) { System.out...
5
public JSONArray toJSONArray(JSONArray names) throws JSONException { if (names == null || names.length() == 0) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } re...
3
private synchronized static void createInstance() { if (instance == null) { instance = new BookingService(); } }
1
private MalformedJsonException jsonError(String msg, boolean printAll){ if(printAll){ //SB for faster error print! Not like that it'd matter... //MAX size (can be smaller): text before current text after \n spaces before ^ StringBuilder err = new StringBuilder(ERR_PRINT_BEFORE + ...
6
public static double viscosity(double temperature){ double[] tempc = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63...
2
public static int getLevenshteinDistance(String s, String t) { if (s == null || t == null) { throw new IllegalArgumentException("Strings must not be null"); } /* The difference between this impl. and the previous is that, rather than creating and retaining a matrix of size s.length()+1 by t.length()+1, ...
8
public void override(Identificador id, int nivel) throws IdentificadorJaDefinidoException{ verificarIdPrograma(id); HashMap<String, Identificador> tabelaNivel = tabela.get(nivel); if(!tabelaNivel.containsKey(id.getNome())) throw new RuntimeException("Este identificador não existe para ser sobreescrit...
1
public void testConstructor_ObjectStringEx1() throws Throwable { try { new LocalDateTime("1970-04-06T+14:00"); fail(); } catch (IllegalArgumentException ex) {} }
1
public Move chooseMove(State s) { // remember who we are so we can correctly evaluate states me = s.whoseTurn(); // The rest of this function looks a lot like evalMove, except // that it doesn't just track the minimaxvalue, but also the // best move itself. // get a list of possible moves MyList moves = s.find...
3
public void kill(String target) { if(target.equals("No thx")) { DataOutputStream dOut = this.outputs.get(firstPlayer); String msg = "WHO_FIRST_PLAYER"; Set<Player> pSet= outputs.keySet(); for(Player p : pSet) { if(!p.getName().equals(renfield.getName())) { if(firstPlayer.getName() != p.get...
6
public static void main(String[] args) { // create random bipartite graph with V vertices and E edges; then add F random edges int V = Integer.parseInt(args[0]); int E = Integer.parseInt(args[1]); int F = Integer.parseInt(args[2]); Graph G = new Graph(V); int[] vertices ...
6
public void setFunAaaa(Integer funAaaa) { this.funAaaa = funAaaa; }
0
public static Vector<String> getNasdaqSymbols() { String strUrl = "http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download"; Vector<String> symbols = new Vector<String>(); String line; URL url; InputStream is = null; BufferedReader br; String current...
9
public Grille incrementGeneration(double nbrGenerations) { while (nbrGenerations >= 1) { generation += 1.0; nbrGenerations -= 1.0; grid = nextGeneration(); } if (generation + nbrGenerations >= Math.floor(generation) + 1) { // Une dernière fois ...
2
public List<Command> compile(String code) { if (!validCharSet(code) || !validBrackets(code)) { System.out.println("Compilation error.\n"); return null; } List<Command> commands = new ArrayList<>(); // output Deque<Cycle> cyclesStack = new ArrayDeque<>(); ...
7
private void notifyMissingAuthService(String type) { for (ComponentEntry ac : this.accessControllers.values()) { if (ac.activeType.equals(type)) { IAuthorization available = availableAuthorization(ac.preferredType); if (available == null) { available = availableAuthorization(ac.altType); } Mes...
4
public static boolean isValid( String s ){ if ( s == null ) return false; final int len = s.length(); if ( len != 24 ) return false; for ( int i=0; i<len; i++ ){ char c = s.charAt( i ); if ( c >= '0' && c <= '9' ) continue...
9
public static Rule_dirClass parse(ParserContext context) { context.push("dirClass"); boolean parsed = true; int s0 = context.index; ArrayList<Rule> e0 = new ArrayList<Rule>(); Rule rule; parsed = false; if (!parsed) { { ArrayList<Rule> e1 = new ArrayList<Rule>(); ...
7
private static void inputgraph() throws FileNotFoundException { // TODO Auto-generated method stub int i=0; File f = new File("src/Prim.txt"); Scanner sr = new Scanner(f); for (i = 0; i < 502; i++) { graph.add(new ArrayList<Integer>()); } sr.next(); sr.next(); int l,m,n; while(sr.hasNext()){ ...
3
private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
7
public static Duration safeMinus(Duration max, Duration current) { if (max.isShorterThan(current)) { return new Duration(0); } else { return max.minus(current); } }
1
public void paint(Graphics g){ super.paint(g); Graphics2D g2d = (Graphics2D) g; for(int ii = 0;ii<10;ii++){ for(int i=0;i<10;i++){ x=i*BLOCK; y=ii*BLOCK; g2d.drawImage(bia[grid[ii][i]], x,y, this); ...
6
public static BigInt bigIntegerMult(BigInt x, BigInt y) { /* If one of the numbers is 0, return 0 */ if (x.size() == 1 && x.testCharZero()) { return new BigInt("0"); } if (y.size() == 1 && y.testCharZero()) { return new BigInt("0"); } /* Define result: with proper size and sign */ BigInt result =...
9
public void create(Servidor servidor) throws PreexistingEntityException, RollbackFailureException, Exception { if (servidor.getComputadoraCollection() == null) { servidor.setComputadoraCollection(new ArrayList<Computadora>()); } EntityManager em = null; try { em =...
8
public static String formatTextAsString(Text text) { StringBuilder sb = new StringBuilder(); for (Sentence textpart : text.getAllElements()) { if (textpart.getClass().equals(Listing.class)) { Listing listing = (Listing) textpart; sb.append(listing.getValue())...
4
public void propertyChange(PropertyChangeEvent ev) { if (!isEditing() || getClientProperty("terminateEditOnFocusLost") != Boolean.TRUE) { //NOI18N return; } Component c = focusManager.getPermanentFocusOwner(); while (c != null) { ...
9
public void setUpComboBoxes(Set<Card> cards) { for (Card card : cards) { String name = card.getName(); if (card.getType().equals(CardType.PERSON)) { peoplePossibilities.addItem(name); } else if (card.getType().equals(CardType.ROOM)) { roomsPossibilities.addItem(name); } else { weaponsPossibil...
3
private void calcNormals(Vertex[] vertices, int[] indices) { for (int i = 0; i < indices.length; i += 3) { int i0 = indices[i]; int i1 = indices[i + 1]; int i2 = indices[i + 2]; Vector3f v1 = vertices[i1].getPos().sub(vertices[i0].getPos()); Vector3f ...
2
private boolean sendFailures() { int event_type; int i,k; int avg_event = 0; logger.log(Level.INFO, super.get_name() + " is sending failures to " + GridSim.getEntityName(resID) + " ..."); List<FailureEvent> events = model.generateFailure(); if(events == null) { ...
5
private ArrayList<String> parseMap(JLD raw, int layer){ ArrayList<String> out = new ArrayList<String>(); String st; out.add(indent(layer) + "{"); layer++; for(String key : raw.keySet()){ st = indent(layer); if(key.contains("\"")) st += "'" + key + "' : "; else st += "\"" + key + "\" : "; O...
7
public static ErrorCode getCodeByName(String name) { if (StringUtils.isEmpty(name)) { return null; } for (ErrorCode code : values()) { if (StringUtils.equals(code.name(), name)) { return code; } } return null; }
3
public static void main(String[] args) { Watched watched = new ConcreteWatched(); watched.addWatcher(new ConcreteWatcher()); watched.addWatcher(new ConcreteWatcher()); watched.addWatcher(new ConcreteWatcher()); watched.notified("Observer Test !"); }
0
public static Categorie creerCategorie(Categorie categorieParent, String nom, Icone icone, Utilisateur utilisateur, Role consultationRoleMinimum, Role reponseRoleMinimum, Role sujetRoleMinimum) throws ChampInvalideException, ChampVideException { if (!categorieParent.peutCreerCategorie(utilisateur)) ...
5
public static void main(String args[]) { Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread thread, Throwable e) { Log.crash(e, "AMIDST has encounted an uncaught exception on thr...
5
MediaElement[] getSelected(JTable table) { if (table == null) table = parentTable; MediaElement[] res = new MediaElement[table.getSelectedRowCount()]; for (int i = 0; i < table.getSelectedRowCount(); i++) res[i] = (MediaElement) table.getModel() .getValueAt(table.convertRowIndex...
2
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 doEdgeDetection() { if (imageManager.getBufferedImage() == null) return; WritableRaster raster = imageManager.getBufferedImage().getRaster(); double[][] dx = new double[][] {{-1, 0, 1}, {-2, 0, 2}, {-1, 0, 1}}; double[][] dy = new double[][] {{-1, -2, -1}, { ...
7
public startScreen() { Position position = new Position(); setLayout(new GridLayout(0, 1, 0, 0)); JButton btnCurrentDate = new JButton("current date"); btnCurrentDate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { MainFrame.cardLayout.show(getParent(), "Binary...
0
@Override public PilotAction findNextAction(double s_elapsed) { MoveDirection move = MoveDirection.NONE; if (is_moving_forward) { if (!is_moving_backward) { move = MoveDirection.FORWARD; } } else if (is_moving_backward) { move = MoveDirection.BACKWARD; } StrafeDirect...
9
public int paintNode(Graphics g, Node node, double timeBegin, int nLeaveAbove) { int y=0; if(node.isLeaf()) { y = (int) ((height-2*yTopBranch)*((double)(nLeaveAbove))/nLeaves)+yTopBranch; if(node.getTime()==0) { g.fillRect(getX(node.getTime()), y-heightBranch/2, widthGeneLabels, heightBranch); //The branc...
7
public void buildShowWords() { showFrame = new JFrame("All words"); JPanel mainPanel = new JPanel(); allPhrases = new JTextArea(GuiBuilder.numberOfLinesInFile +2, 25); allPhrases.setEditable(false); JScrollPane qScroller = new JScrollPane(allPhrases); qScroller.setHorizon...
1
public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException { String text; Path pt = new Path("spamlist/spamlist.txt"); //List of known spammers FileSystem fs = FileSystem.get(new Configuration()); BufferedReader in = new BufferedReader(new InputStreamRe...
7
public ScoreList(User[] user){ scores = new Score[user.length]; for (int i = 0; i < user.length; i++) { scores[i] = new Score(user[i]); } }
1
@EventHandler(priority = EventPriority.LOWEST) public void vehiclePlace(PlayerInteractEvent event) { if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { Material clickedMaterial = event.getClickedBlock().getType(); Player player = event.getPlayer(); Material materialInHand = player.getItemInHand().getType(...
8
public void piirraRuutu(int x, int y, RuutuTyyli tyyli, Graphics graph){ switch(tyyli){ case Hedelma: tyyli.drawImage(graph, x, y); break; case IsoHedelma: tyyli.drawImage(graph, x, y); break; case LyhentavaHedel...
9
public synchronized static void buildCategories(){ List<Fingerprint> dataset = HomeFactory.getFingerprintHome().getAll(); for (Fingerprint f : dataset) { if (f == null || f.getLocation() == null || f.getMeasurement() == null) continue; Integer id = ((Location)f.getLocation()).getId(); if (id == null) c...
8
public static Choice getChoice(boolean check, boolean download) { for (Choice c : Choice.values()) { if (c.equals(check, download)) { return c; } } return null; }
2
private void addConditional(Vector addTo, Location loc, int x, int y) { int newX = loc.x + x, newY = loc.y + y; if (newX < 0 || newX >= grid.length) { return; } if (newY < 0 || newY >= grid[0].length) { return; } if (grid[newX][newY] == Constants.FULL_NON_PASSABLE) { return; } if (isDiagonal(ne...
7
static byte[] scanForOffsets(int firstAtomIndex, int[] specialAtomIndexes, byte[] interestingAtomIDs) { /* * from validateAndAllocate in AminoMonomer or NucleicMonomer extensions * * sets offsets for the FIRST conformation ONLY * (pr...
7
public DoorBlock(int x, int y, int type, int direction, int roomPointer) { super(x, y, type); if (direction == 1) { doorBounds = new Rectangle(getBoundsDoor().x, getBoundsDoor().y, getBoundsDoor().width, getBoundsDoor().height); } if (direction == 2) { doorBounds = new Rectangle(getBoundsDoor().x, getB...
3
public void setProffession(Proffession proffession) {this.proffession = proffession;}
0
public void reply() { try { ServerSocket server = new ServerSocket(SPORT); Socket client = server.accept(); ObjectInputStream is = new ObjectInputStream(client.getInputStream()); Object o = is.readObject(); if (o instanceof Message) { Message m = (Mess...
2
private int[][] subMatrix(final int[][] X, final int[][] Y) { try { int[][] subtraction = new int[X.length][X[0].length]; if (X.length == Y.length) { for (int i = 0; i < X.length; ++i) { if (X[i].length == Y[i].length) { for (in...
5
public boolean hitFoldingIcon(Object cell, int x, int y) { if (cell != null) { mxIGraphModel model = graph.getModel(); // Draws the collapse/expand icons boolean isEdge = model.isEdge(cell); if (foldingEnabled && (model.isVertex(cell) || isEdge)) { mxCellState state = graph.getView().getState(...
6
public double evaluate(){ //returns distance to closest pit to the right if facing right and sim. left if(player.getFalling()) return 0; ArrayList<Block> blocklist = level.getBlocksOnScreen(); double width = 1; double mariobot = player.getYpos()+player.getHeight()/2; ...
8
@Override protected int findPrototypeId(String s) { int id; // #generated# Last update: 2007-05-09 08:15:31 EDT L0: { id = 0; String X = null; int c; int s_length = s.length(); if (s_length==7) { X="valueOf";id=Id_valueOf; } else if (s_length==8) { ...
8
* The width to be translated to a character index. * @return Returns the given width, translated to a character index. */ public int line_offset_from(int line, int wid) { int ret; String l = code.getsb(line).toString(); int w = 0, lw = 0; for (ret = 0; ret < l.length() && w < wid; ret++) ...
4
@Test public void EnsurePathMatchesAllWildCardPattern() { Path path = new Path("alan/likes/warbyparker"); Pattern pattern = new Pattern("*,*,*"); assertTrue(path.match(pattern)); }
0
public org.omg.CORBA.portable.OutputStream _invoke (String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) { org.omg.CORBA.portable.OutputStream out = null; java.lang.Integer __method = (java.lang.Integ...
9
public static boolean[] shortToBoolean(short[] octets) throws SubneterException { if (octets.length != 4) { throw new SubneterException("Invalid IP adress too many or to less octets"); } for (int i = 0; i < 4; i++) { if (octets[i] < 0 || octets[i] > 25...
7
private void rotateRight(Entry<K,V> p) { Entry<K,V> l = p.left; p.left = l.right; if (l.right != null) l.right.parent = p; l.parent = p.parent; if (p.parent == null) root = l; else if (p.parent.right == p) p.parent.right = l; else p.parent....
3
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) { if (lab_modo.getText().equals("Alta")){ if (camposCompletos()){ if (validarFechas()){ ocultar_Msj(); insertar(); ...
9
public int GetNPCID(int coordX, int coordY) { for (int i = 0; i < server.npcHandler.maxNPCs; i++) { if (server.npcHandler.npcs[i] != null) { if (server.npcHandler.npcs[i].absX == coordX && server.npcHandler.npcs[i].absY == coordY) { return server.npcHandler.npcs[i].npcType; } } } return 1; }
4
@Override public int getNextRound() { return nextScheduledRound; }
0
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY); if(target==null) return false; if(!(target instanceof Wand)) { mob.tell(L("You can't recharge that...
9
private Vector getInitVector() { int random = (int)(Math.random() * 8); switch (random) { case 1: return Vector.UP; case 2: return Vector.DOWN; case 3: return Vector.RIGHT; case 4: return Vector.LEFT; } return Vector.UP; }
4
public int hashCode() { return super.hashCode(); }
0
@Override public void handleEvent(Event event) { if (event.getType() == EventType.END_ACTION) endActionUpdate(); else if (event.getType() == EventType.END_EFFECT) if (isValidEndEffectEvent(event)) removeEffect(); }
3
public static int[] sort(int array[]){ for(int i = 1;i < array.length;i++){ int key = array[i]; int j = i-1; while( j>=0 && key < array[j]){ array[j+1] = array[j]; j--; } array[j+1] = key; } return array; }
3