text
stringlengths
14
410k
label
int32
0
9
@Override public boolean equals(final Object item) { if (this == item) { return true; } if (!(item instanceof Item)) { return false; } final Item that = (Item) item; /* @formatter:off */ return this.name == that.getName() || (null != this.name && this.na...
4
public ConsultaPerfil() { initComponents(); CargarComboBox(); web.setVisible(false); panel.setVisible(false); // setLocationRelativeTo(null); //super combo box c_perfiles.getEditor().getEditorComponent().addKeyListener...
8
final boolean method793(int i) { anInt1403++; if (((NpcDefinition) this).anIntArray1377 == null) { if ((((NpcDefinition) this).anInt1343 ^ 0xffffffff) == 0 && (((NpcDefinition) this).anInt1364 ^ 0xffffffff) == 0 && ((NpcDefinition) this).anInt1327 == -1) return false; return true; } for (int i_0_ = ...
9
public void paivitaTuote(Tuote t) throws DAOPoikkeus{ Connection yhteys = avaaYhteys(); String muokkaaPizzaQuery = "UPDATE Tuote SET nimi=?, numero=?, hinta=?, aktiivinen=?,tuoteryhmaID=? WHERE TuoteID = ?"; String poistaTayte ="DELETE FROM TuotteenTayte WHERE tuoteID=?"; String lisaaTaytteet = "INSERT IN...
3
private void closeConnection() { logger.finer("Closing server connection"); synchronized(CONNECTION_LOCK) { if(receivePacketThread != null) receivePacketThread.stopReceiving(); if(timeoutThread != null) timeoutThread.stopCheckingForTimeouts(); if(socket != null) socket.close(); resetParamete...
3
public void addChunk(Chunk C) { chunksLock.writeLock().lock(); try { chunks.add(C); } finally { chunksLock.writeLock().unlock(); } }
0
static protected boolean isWhiteSpace(char ch) { return (ch == ct || ch == lf || ch == tb || ch == fd || ch == cr || ch == nl || ch == zs || ch == zl || ch == zp); }
8
protected String makeResponseToken(WebSocketRequest requestInfo, byte[] token)throws NoSuchAlgorithmException { MessageDigest md5digest = MessageDigest.getInstance("MD5"); for(Integer i = 0; i < 2; ++i){ byte[] asByte = new byte[4]; long key = (i == 0) ? requestInfo.getKey1().intValue() : requestInfo.getKey2(...
2
public int getTotalNum() { int num = 0; for(ParkBoy boy : this.parkBoyList) { num += boy.getTotalNum(); } if(this.park != null) { num += this.park.getTotalNum(); } return num; }
2
public String findVappLink(String apiUrl, String vAppName) throws Exception { String response = doGet(apiUrl + Utils.VAPPS_QUERY_SUFFIX); Document doc = RestClient.stringToXmlDocument(response); NodeList list = doc.getElementsByTagName(Constants.VAPP_RECORD); String element = new String(); for(int i=0; i ...
3
private boolean toBoolean(final Properties azotProperties, final String key, final boolean defaultValue) { boolean flag = defaultValue; if (azotProperties.getProperty(key) != null) { try { flag = Boolean.parseBoolean(azotProperties.getProperty(key)); } catch (Exception e) { e.printStackTrace(); } ...
2
public int[] canMove() { int[] movable = new int[] { 0, 0, 0, 0 }; if (this.nodesState[0] > dimension && this.nodesState[0] <= dimension * dimension) movable[0] = 1; // 空白格可向上移 if (this.nodesState[0] >= 1 && this.nodesState[0] <= dimension * (dimension - 1)) movable[1] = 1; // 空白格可向下移 if (this.nod...
6
public Member merge(Member detachedInstance) { log.debug("merging Member instance"); try { Member result = (Member) getSession().merge(detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } }
1
@Override public void mutateStackForInfixTranslation(Stack<Token> operatorStack, StringBuilder output) { Token before; while (!operatorStack.isEmpty() && (before = operatorStack.peek()) != null && (before instanceof OperatorToken || before instanceof FunctionToken)) { if (before instanceof FunctionToken) { ...
9
private static Object getNextMatchPosRegExImpl(String regEx, CharSequence searchIn, boolean goForward, boolean matchCase, boolean wholeWord, String replaceStr) { if (wholeWord) { regEx = "\\b" + regEx + "\\b"; } // Make a pattern that takes into account whether or not to match case. in...
6
private List<Node> closestNodesNotFailed(String status) { List<Node> closestNodes = new ArrayList<>(this.config.k()); int remainingSpaces = this.config.k(); for (Map.Entry<Node, String> e : this.nodes.entrySet()) { if (!FAILED.equals(e.getValue())) { ...
4
@BeforeClass public static void setUpClass() { }
0
public void add(Item item) { Node<Item> oldfirst = first; first = new Node<Item>(); first.item = item; first.next = oldfirst; N++; }
0
public String toString() { E el; // Search for maximum element length // int maxlen = 0; // int ellen; // // for (int i = 0; i < array.getSize(); i++) { // el = array.getElement(i); // if (el != null) { // ellen = el.toString().length();...
5
static void testConnection(String url, String query, int maxconn) { if (url == null || url.length() == 0 || query == null || query.length() == 0 || maxconn <= 0) { testError(); } SimpleConnectionPool pool = null; Connection con = null; try { pool = SimpleConnectionPool.getInstance(maxconn); log.i...
7
public void mouseReleased(MouseEvent evt) { //Fill in pixels in between and connect the first to the last int N = selectionBorder.size(); if (N == 0 || (state != SELECTING && state != DRAGGING)) return; if (state == SELECTING) { for (int n = 0; n < N; n++) { int startx = selectionBorder.get(n).x...
7
private static void initializeLogger() { try { FileHandler fh = new FileHandler(client.Main.class.getName() + ".log"); fh.setFormatter(new SimpleFormatter()); log.addHandler(fh); } catch (SecurityException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) ...
2
public void action() { ACLMessage msg = receive(MessageTemplate.MatchSender(controller)); if (msg == null) { block(); return; } if (msg.getPerformative() == ACLMessage.REQUEST){ try { ContentElement content = getContentManager().extractContent(msg); Concept concept = ((Acti...
8
public void loadFile(String filename){ String path = "data/" + filename; try { BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(path), "Shift_JIS")); String line; while ((line = br.readLine()) != null) { ...
5
@Override public void run() { for(;;) { // Se o socke esta fechado então terminar Thread. if(socket.isClosed()) return; try { mensagemRecebida = (Mensagem) entrada.readObject(); switch(mensagemRecebida.getTipoMensagem()) { ...
7
private void unmountFoldersOnLinux() { if (!getType().equalsIgnoreCase("smb") && !getType().equalsIgnoreCase("nfs")) { // TODO: find better way to throw errors without needing to add // throw declarations everywhere. throw new RuntimeException("Nope, invalid mount type " + getType() + " on server ["...
6
@Override public void deserialize(Buffer buf) { senderName = buf.readString(); content = buf.readString(); timestamp = buf.readInt(); if (timestamp < 0) throw new RuntimeException("Forbidden value on timestamp = " + timestamp + ", it doesn't respect the following conditio...
3
public void pushSelection(Selectable s, boolean asRoot) { if (asRoot) navStack.clear() ; if (s != null) { selected = s ; if (s.subject().inWorld()) UI.camera.lockOn(s.subject()) ; final InfoPanel panel = s.createPanel(UI) ; final int SI = navStack.indexOf(selected) ; Se...
7
public void setOptions(String[] options) throws Exception { String tmpStr; tmpStr = Utils.getOption("mean-prec", options); if (tmpStr.length() > 0) setMeanPrec(Integer.parseInt(tmpStr)); else setMeanPrec(getDefaultMeanPrec()); tmpStr = Utils.getOption("stddev-prec", options); ...
8
final void method401(int i, int j, int k, int l, int i1) { if (composite == null) { return; } if (!super.aBoolean2894) { Animation animation = super.animation != -1 && super.animationDelay == 0 ? Class66.animationForID(super.animation) : null; Animation animat...
9
private StdImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable<?, ?> properties) { super(cm, raster, isRasterPremultiplied, properties); clear(); }
2
@EventHandler public void BlazeJump(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.getBlazeConfig().getDouble("Blaze.Jump.DodgeCha...
6
public void deleteMarker(int index) { for(int i=index;i<markers-1;i++) { marker[i]=marker[i+1]; } marker[markers-1]=null; markers--; }
1
public List<List<Integer>> zigzagLevelOrder(TreeNode root) { List<List<Integer>> result = new ArrayList<List<Integer>>(); if(root == null){ return result; } List<Integer> first = new ArrayList<Integer>(); first.add(root.val); result.add(first); Linked...
9
static void printList(final PrintWriter pw, final List l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List) o); } else { pw.print(o.toString()); } } }
2
public boolean gayp() { if (gay == -1) gay = detectgay() ? 1 : 0; return (gay == 1); }
2
public String getId() { return id; }
0
@Override public boolean setChartOption( String op, String val ) { boolean bHandled = false; if( op.equalsIgnoreCase( "SmoothedLine" ) ) { fSmoothedLine = val.equals( "true" ); bHandled = true; } else if( op.equalsIgnoreCase( "ThreeDBubbles" ) ) { f3dBubbles = val.equals( "true" ); bHandled = ...
4
public static Rule_dirSubannotation parse(ParserContext context) { context.push("dirSubannotation"); boolean parsed = true; int s0 = context.index; ArrayList<Rule> e0 = new ArrayList<Rule>(); Rule rule; parsed = false; if (!parsed) { { ArrayList<Rule> e1 = new ArrayList...
7
public void contextDestroyed(ServletContextEvent sce) { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); Object[] params = new Object[1]; params[0] = tccl; // Walk up the tree of classloaders, finding all the available // LogFactory classes and releasing any o...
5
public void arrayMakeRequirements() { String temp; int areaHours=0; for (int i = 0; i < arrayCourseRefined.size(); i++) { RequirementsStruct maker = new RequirementsStruct(); maker.requirementName = parse17(arrayCourseRefined.get(i).get(0), i); maker.ID = i; ...
7
public void test_loop() { // loop round at least one 400 year cycle, including before 1970 LocalDate date = LocalDate.of(1960, 1, 5); // Tuseday of week 1 1960 int year = 1960; int wby = 1960; int weekLen = 52; int week = 1; while (date.getYear() < 2400) { DayOfWeek loopDow = date.get...
9
public void implementFather() { if(parents.size() == 0) return; else { for(int i = 0; i < parents.size(); ++i) { if(parents.get(i) != null) parents.get(i).implementFather(); } for(int i = 0; i < parents.size(); ++i) attributes.addAll(parents.get(i).attributes); } }
4
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!super.okMessage(myHost, msg)) return false; if((msg.tool()==this) &&(msg.targetMinor()==CMMsg.TYP_DAMAGE) &&(msg.value()>0) &&(msg.target() !=null) &&(msg.target() instanceof MOB) &&(weaponClassification()==Weapon.C...
7
public static AbstractForme creerForme(String chaineForme) { DecodeurChaineForme decodeur = new DecodeurChaineForme(chaineForme); IDLogger enregistreur = IDLogger.getInstance(); AbstractForme forme = null; switch(decodeur.getTypeForme()) { case CHAINE_CARRE : forme = new Carre(decodeur.getNumeroSequen...
5
@Override public void init(int l, int h) { if(!(l%2 == 1 && h%2 == 1)) throw new PreConditionError("l and h must be odd"); if(!(l>0 && h>0)) throw new PreConditionError("l and h must be positive"); super.init(l,h); if(!(super.getNombreColonnes()==l)) throw new PostConditionError("getNombreColonnes(ini...
6
public void setupWindow(JComponent component) { frame = new JFrame(); frame.add(component); //frame.setUndecorated(slateSettings.getUndecorated()); frame.setUndecorated(true); frame.setResizable(false); // Shift to external display //if (slateSettings.getExternalDisplay()) //{ //Dimension screen...
7
public void Process(int id){ switch(id){ case 1003:InsertDelayedOperationList(3); break; case 1004:InsertDelayedOperationList(4); break; case 1005:InsertDelayedOperationList(5); break; case 1006:InsertDelayedOperationList(6); break; case 1007:InsertDelayedOperationList(7); break; ...
6
public static void addItemTester(Item item){ if(item != null){ if(ItemStorageInventory.create().addItem(item)){ System.out.println("add "+ item.toString() + " successfully\n"); }else{ System.out.println("add "+ item.toString() + " failed\n"); } }else System.out.println("add item " + " faile...
2
public String readString(String tag){ String s = ""; if(!data.containsKey(tag)){ System.out.println("The tag "+ tag + " did not exist."); return s; } s = (String)data.get(tag); return s; }
1
@Override public SkillsMain[] getSkillNames() { return Constants.paladinSkillSkills; }
0
public boolean next() throws IOException { if (ia == null) { return false; } try { long crcValue = ia.readLong("crcvalue"); System.out.println("crcvalue: "+crcValue); byte[] bytes = readTxnBytes(ia); ...
9
@Test public void testFindNodes() throws Exception { NodeList nodes = _xpath.findNodes("//p"); Assert.assertEquals(2, nodes.getLength()); for(int i=0; i<nodes.getLength(); i++) { Assert.assertEquals("p", nodes.item(i).getNodeName()); } }
1
private static void parseJstatMetrics(String wholeJstatText, Task task) { String[] lines = wholeJstatText.split("\\n"); if(lines.length < 5) return; String dateStrSec; if(!lines[0].trim().startsWith("NGCMN")) return; String[] gccapacity = lines[1].trim().split("\\s+"); if(gccapacity.length != ...
5
public boolean take(int slot,int amount,String title){ //如果能成功拿走就返回true 否则返回false //这个位置的物品的名字 如果不包含title 那么也会返回false ItemStack item = inv.getItem(slot); if((item==null)||(item.getType()==Material.AIR))return false; if(!item.getItemMeta().hasDisplayName()) return false; i...
6
public void update() { time++; // if time % 60 == 0 / = 1 second if (time % (random.nextInt(50) + 60) == 0) { xa = (random.nextInt(3) - 1) * speed; // speed=5 => -1, 0, 1 ; // speed=0.5 => -0.5, 0, 0.5 ya = (random.nextInt(3) - 1) * speed; if (random.nextInt(4) == 0) { xa = 0; ya = 0...
9
static String getQuadrant(String v, String h) { int hor = Integer.valueOf(h); int vert = 1; if (v.equals("a")){ vert = 1; } else if (v.equals("b")) vert = 2; if (v.equals("c")) vert = 3; if (v.equals("d")) vert = 4; if (v.equals("e")) vert = 5; if (v.equals("f")) vert = 6; if (v.e...
9
public void itemGiver(Chest chest) { chest.getInventory().clear(); Inventory inv = chest.getInventory(); List<String> items = this.pl.getConfig().getStringList("configurations." + this.pl.ChosenConfiguration + ".items"); for (String item : items){ ItemStack newItem = parseItem(item); if (newItem != null)...
4
public void createPlaylist(BEPlaylist aPlaylist) throws Exception { try { ds.createPlaylist(aPlaylist); } catch (SQLException ex) { throw new Exception("Could not create playlist" + aPlaylist.getName()); } }
1
public KingedChecker(int team){ super(team); if(team == 1) { setImage(new GreenfootImage("Crowned-Mario.png")); } else if(team == 2) { setImage(new GreenfootImage("Crowned-Wario.png")); } }
2
public void selectNext() { selectedIndex++; if(selectedItem != null) selectedItem.deselect(); if(selectedIndex >= listItems.size()) { boolean selectionRolloverHandled = handleSelectionRollover(SelectionRolloverDirection.Bottom); if(selectionRolloverHandled) return; else selectedIndex = 0; ...
3
public void randomize() { try { if (sql.getConnection() == null) { sql.connect(); } sql.getVals(); // mathGame.sql.close(); } catch (Exception e) { System.out.println("Get vals from DB failed"); e.printStackTrace(); } System.out.println("\n\n\n\n*******GAMETYPE=="+gameType+"**********\n...
4
public void render(Graphics g){ g.setColor(Color.BLACK); g.setFont(JudokaComponent.bigFont); JudokaComponent.drawTextBox(75, 50, 500, 35, g); JudokaComponent.drawTextBox(75, 150, 500, 35, g); g.drawString("Player1 Character Name", 80, 40); g.drawString("Player2 Character Name", 80, 140); g.setColor(new Co...
6
default void isNull(String str) { System.out.println("Interface Null Check"); }
0
public boolean gameCouldFinish() { boolean allNullWord = true; boolean weAreAlone = true; for (Player p : playersList) { if (p.isActive() && !p.isLastResponseWrong) allNullWord = false; if (p.isActive() && p != localPlayer) weAreAlone = false; } return allNullWord || weAreAlone; }
6
public String longestPalindrome(String s) { boolean[][] table = new boolean[s.length()][s.length()]; int max = 1; int index = 0; for (int i = 0; i < s.length(); i++) { table[i][i] = true; } for (int i = 0; i < s.length() - 1; i++) { if (s.charAt(i) == s.charAt(i + 1)) { table[i][i + 1] = true; ...
7
public String getString(int index) throws JSONException { Object object = this.get(index); if (object instanceof String) { return (String) object; } throw new JSONException("JSONArray[" + index + "] not a string."); }
1
public WarriorsJourneyServer() { log.log(Level.FINE,"=== Warriors Journey Server Loading... ==="); config = new Config(); clientThreads = new WarriorsJourneyClient[Config.MAX_CONNECTIONS]; log.log(Level.FINE,"=== Loading Handlers ==="); mysqlData = new MysqlHandler(); log.log(Level...
5
static Throwable getThrowableCandidate(Object[] argArray) { if (argArray == null || argArray.length == 0) { return null; } final Object lastEntry = argArray[argArray.length - 1]; if (lastEntry instanceof Throwable) { return (Throwable) lastEntry; } ...
3
protected FSDirectory(File path, LockFactory lockFactory) throws IOException { path = getCanonicalPath(path); // new ctors use always NativeFSLockFactory as default: if (lockFactory == null) { lockFactory = new NativeFSLockFactory(); } directory = path; if (directory.exists() && !director...
6
public static java.awt.Color getColorForPlayer(Player p) { switch ( p ) { case RED : return java.awt.Color.RED; case BLUE : return java.awt.Color.CYAN; case YELLOW : return java.awt.Color.YELLOW; case GREEN : return java.awt.Color.GREEN; } return java.awt.Color.WHITE; }
4
public int price(PointT finish) { if (this.x == finish.x || this.y == finish.y) { return 10; } else { return 14; } }
2
private void setLoggingLevel() { final String name = Main.configurationFile.getConfig().getString("logLevel", "INFO"); Level level = MessageLevel.parse(name); if (level == null) level = Level.INFO; // Only set the parent handler lower if necessary, otherwise leave it alone for other con...
3
private void searchMCVersions() { File file = new File(mineord, "versions"); if (file.exists()) { File[] li = file.listFiles(); for (int i=0; i<li.length; i++) { File jarfile = new File(li[i], li[i].getName()+".jar"); File jsonfile = new File(li[i], li[i].getName()+".json"); if(jarfile.ex...
5
@Override public boolean equals(Object o) { if (!(o instanceof MoveAction)) { return false; } MoveAction other = (MoveAction)o; return (other.model == this.model) && (other.start.equals(start)) && (other.actor.equals(actor)) && (other.end.equals(end)); }
4
public static OptionsDialog getInstance() { if (instance==null) { instance=new OptionsDialog(); } return instance; }
1
private BufferedImage HorizontalFiltering(BufferedImage bufImage, int iOutW) { int dwInW = bufImage.getWidth(); int dwInH = bufImage.getHeight(); int value = 0; BufferedImage pbOut = new BufferedImage(iOutW, dwInH, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < ...
7
private static boolean isDelimiter(char c){ return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '{' || c == '}'; }
5
public static void main(String[] args) { int a[] = new int[101]; int i = 0; int j = 0; for (i = 1; i < 101; i++) { a[i] = 1; } for (i = 2; i < 101; i++) { if (a[i] != 0) { for (j = i + i; j < 101; j++) { System.out.println(i+"---"+j); if (j % i == 0) { a[j] = 0; j = j +...
5
public void merge(int A[], int m, int B[], int n) { int a = n; int b = 0; int c = 0; for (int i = m; i > 0; i--) { A[i + n - 1] = A[i - 1]; } while (a < m + n && b < n) { if (A[a] < B[b]) { A[c] = A[a]; a++; } else { A[c] = B[b]; b++; } c++; } while (c < m + n) { if ...
6
public static void intro() { GUI.log("Welcome to Corlanthia. To start, simply type a command into the input box below. For a list of available " + "commands, type \"help\".\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + "\n\n" + "You wake up in a daze, there is a lump on your head and y...
0
public double getDiag(){ return diag=Math.sqrt(this.getHig()*this.getHig())+Math.sqrt(rad*rad); }
0
public Path getRevisionInfo(long timestamp) { // Get the revision in question DbConnection db = DbConnection.getInstance(); RevisionInfo revision = db.getSpecificRevision(file, timestamp); Path pathToTempFile = null; PrintWriter output = null; // Figure out the extension. However, we only add the period (...
4
public void setForecast(Iterator<Element>tempit,WeatherInfo tempweather){ Element tempelementRoot,tempElement; /**tempit2: 每一个weather块<br>tempit3:day块和night块*/ Iterator<Element>tempit2,tempit3; String temp; int i=0,j; while(tempit.hasNext()){ tempelementRoot=(Element)tempit.next(); tempit2=tempelement...
7
public ResultMap singleSelect(final String sql){ ResultMap result = new ResultMap(); Statement stmt; try { stmt = this.connetion.createStatement(); ResultSet rs = stmt.executeQuery(sql); ResultSetMetaData rsmd = rs.getMetaData(); int numberOfColumns = rsmd.getColumnCount(); while (rs.next()) { ...
3
public static void main(String[] args) { try { JConecta dialog = new JConecta(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
1
private void filter () { displayedElements.clear(); if (filter != null) for (int i = 0; i < source.getSize(); i++) if (filter.accept (source.getElementAt (i))) displayedElements.add (i); fireContentsChanged (this, 0, getSize() - 1); }
3
public static List<HueBridge> searchUPnP(int timeout, BridgeDiscoveryCallback callback) throws IOException { // Send out SSDP discovery broadcast String ssdpBroadcast = "M-SEARCH * HTTP/1.1\nHOST: 239.255.255.250:1900\nMAN: ssdp:discover\nMX: 8\nST:SsdpSearch:all"; DatagramSocket upnpSock = new DatagramSocket(); ...
9
public void procBtnRAZ() { int compsSize = m_enregistreurDeComp.getCompetences().size(); if (!optEmploi.isSelected() || cmbReg.getSelectedIndex() != 0 || jckbprox.isSelected() || !"0".equals(txtSalesp.getText()) || cmbComp.getSelectedIndex(...
6
private double getPreFlopDiscardOdds(int holeCardA, int holeCardB, int discardCard) throws IOException { long wins = 0; long gameCount = 0; int[] cardsToRemove = {holeCardA, holeCardB, discardCard}; Integer[] newCards = getNewCards(cardsToRemove, ints); int[] newCardsArray = new int[49]; for (int z = 0; ...
9
private boolean r_perfective_gerund() { int among_var; int v_1; // (, line 71 // [, line 72 ket = cursor; // substring, line 72 among_var = find_among_b(a_0, 9); if (among_var ...
8
@Override public Object getValueAt(int rowIndex, int columnIndex) { assert rowIndex >= 0 && rowIndex < this.files.length; IFile file = this.files[rowIndex]; switch (columnIndex) { case 0: return file.getName(); case 1: return file.siz...
4
public void kasvataKulmaa(){ if (liikkuuko){ kulma = kulma + KULMAN_KASVATUS_VAKIO; //pidä kulma nollan ja kaksipiin välillä if (kulma > 2*Math.PI){ kulma -= 2*Math.PI; } else if (kulma < 0) { kulma += 2*Math.PI; } ...
3
boolean test (Instantiation inst) { if (prefix == '!') { if (model.getProcedural().whyNotTrace) model.output (toStringFirstLine (null)); Vector<String> tokens = new Vector<String>(); for (int i=0 ; i<specials.size() ; i++) { String special = specials.elementAt(i); if (Symbol.get(special).is...
9
public void renderMob(int xp, int yp, int dir, Sprite sprite){ for(int y = 0; y < sprite.size; y++){ int ya = y + yp; int ys = y; for(int x = 0; x < sprite.size; x++){ int xa = x + xp; int xs = x; if(xa < 0 || xa >= width || ya < 0 || ya >= height) continue; int col = sprite.pixels[xs + y...
8
private boolean isCommonName(String p){ short i = 0; for(Player s : this){ if(s.getName().startsWith(p)){ i++; } } if(i > 1){ return true; } return false; }
3
public void endElement( String uri, String localName, String qName ) { // recognized text is always content of an element // when the element closes, no more text should be expected isStackReadyForText = false; // pop stack and add to 'parent' element, which is next on the stack // important to pop stack fi...
9
protected boolean testMatrixMajor(Matrix A, Matrix B) { boolean ret = false; Matrix tmpC; int i = -1; int j = -1; int r = A.getRowDimension(); int c = A.getColumnDimension(); if((r == B.getRowDimension())&&(c == B.getColumnDimension())) { tmpC = A.minus(B); ret = false; for(i = 0; (i<r)&&(!ret...
8
public DoublyLinkedNode getSucc() { return succ; }
0
@Override public int compareTo(InterpenetrationPoint o) { return signedDistance == o.signedDistance ? 0 : signedDistance < o.signedDistance ? -1 : 1; }
2