text
stringlengths
14
410k
label
int32
0
9
private void drawShape(Shape shape, BasicGraphicalElement element, Color backupColor) { GraphicAttributes attributes = element.getGraphicAttributes(); Color fillColor = null; if (element.isClosed() && attributes instanceof FillAttributes) { fillColor = ((FillAttributes) attributes).getFillColor(); } if (fi...
9
private static int sommeInt(HashMap<VoieEnum, AtomicInteger> map) { int somme = 0; for (AtomicInteger value : map.values()) { somme = somme + value.get(); } return somme; }
1
public boolean contact(Connector c2) { Component e = c2.getParent(); int x = e.getX() - e.getHeight() / 4; int y = e.getY() - e.getHeight() / 4; int width = e.getWidth() + e.getHeight() / 2; int height = e.getHeight() + e.getHeight() / 2; Point p1 = new Point(x, y); Point p2 = new Point(x + width, y); P...
4
public Dimension getSizeForImageManipulation(ImageMetadata imageMetadata, RequestData requestData) { Dimension d = new Dimension(); Dimension regionSize = getRegionCoordinates(requestData, imageMetadata).getSize(); log.debug("getSizeForImageManipulation - passed"); i...
8
public static void main(String[] args) throws FileNotFoundException, ExecutionException, InterruptedException, IOException { int NT = Integer.parseInt(args[0]); String inputFile = args[1]; String outputFile = args[2]; InputReader in = new InputReader(inputFile); String fr...
8
public void removeProvinceFromCache(String worldName, int chunkX, int chunkZ) { String together = worldName + "+" + chunkX + "+" + chunkZ; if (provinceLocCache.containsKey(together)) { int id = provinceLocCache.get(together); plugin.info("Removing provinceLocCache: " + together + " = " + id); if (provinc...
2
private void loadAssetFileAsZIP() { renderEngine.logger.info("ASSETS LOADER : Extracting game assets..."); ArrayList<String[]> var = ZipUtilities.getFiles(assetFile.toString()); ArrayList<String> list = new ArrayList<String>(); ArrayList<File> list1 = new ArrayList<File>(); for (...
9
protected void initEditDebateComponents() { createDebateJfme = new JFrame(); createDebateJpel = new JPanel(); createDebateJfme.add(createDebateJpel); titleCDJlbl = new JLabel("Title:"); titleCDJlbl.setFont(new Font("Tahoma", 1, 16)); maxTurnsCDJlbl = new JLabel("Max Turns"); maxTurnsCDJlbl.setFont(new Fon...
4
public void setPlayerStatus(PlayerStatus playerStatus) { if (playerStatus == null) throw new IllegalArgumentException("The given PlayerStatus is invalid!"); if (this.playerStatus != playerStatus) { this.playerStatus = playerStatus; getGrid().getEventManager().sendEvent(new Event(EventType.PLAYER_STATUS_...
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
private static void parseInterClusterProbabilities(final Map<String, String> args, final CommandLineArguments result) throws ParseException { int k = result.cl_sizes.size(); if (args.containsKey("p_out")) { double p_out; try { p_out = new Double(args.get("p_out")); } catch (final NumberForma...
5
public void atualizar(FonteFinanciamento fontefinanciamento) throws Exception { String sql = "UPDATE fontefinanciamento SET nome = ? WHERE id = ?" ; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); stmt.setString(1, fontefinanciamento.getNome()); stmt.setLong(2...
1
protected Option[] loadOptions(int x, int y, String... optionTitles) { Option[] optionPage = new Option[optionTitles.length]; for(int i = 0; i < optionTitles.length; i++) { if(i == 0) { optionPage[i] = new Option(optionTitles[i], x, y, true); } else { ...
2
public void put(int key, int value) { HashPrinter.tryPut(key, value); /** Index that moves through array slots */ int runner = 0; int hash = (key % TABLE_INITIAL_SIZE); if (table[hash] == null) { table[hash] = new Node(key, value); HashPrinter.successfulInsertion(key, hash); } else { /** Col...
4
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(mob.isInCombat()) return Ability.QUALITY_INDIFFERENT; if(!(target instanceof MOB)) return Ability.QUALITY_INDIFFERENT; if((((MOB)target).amDead())||(!CMLib.flags().canBeSeenBy(target,mob))) return Ability.QUALI...
7
public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; }
0
private void initializeButtons() { for (int i = 0; i < maxPartySize; i++) { //partyList.add(new Textbox("Hire Party Member\nCost: " + partyMemberCost, initialPartyVSpacer, initialPartyVSpacer + (i * partyVSpacer) + (i * partyTHeight), partyTWidth, partyTHeight, IntroSequence.input)); partyButtons.add(new Button...
6
@Override public void deserialize(Buffer buf) { questId = buf.readUShort(); if (questId < 0 || questId > 65535) throw new RuntimeException("Forbidden value on questId = " + questId + ", it doesn't respect the following condition : questId < 0 || questId > 65535"); objectiveId = b...
4
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page ...
6
public static Project getProjectFromURL(String url) { Project project = new Project(); project.setUrl(url); System.out.println("------" + url); Document doc; try { doc = Jsoup.connect(url).get(); Elements backersElements = doc.select("div#backers_count"); String totalBackers = backersElements.get(0)....
9
public void setMatrix(String values) { String number = ""; int row = 0; int column = 0; for (int i = 0; i < values.length(); i++) { if (values.charAt(i) == ',') { setElement(row, column, Integer.parseInt(number)); column++; numb...
4
public Object getBounds() { if (bounds == null) { bounds = computeBounds(); } return bounds; }
1
private void handleCollisions() { // Anything that is destroyed should be erased, so get ready // to erase stuff Graphics g = playArea.getGraphics(); g.setColor(Color.BLACK); // Deal with shots blowing up comets for(int i = 0; i < shots.size(); i++) { Shot s = shots.elementAt(i); for(int j = 0; ...
8
public Collection<String> getStations() { return new ArrayList<String>(stations); }
0
public static void main(String[] args) throws IOException { StaticDynamicUncertaintyULHSolver solverWithoutADI = new StaticDynamicUncertaintyULHSolver(); StaticDynamicUncertaintyWithADIULHSolver solverWithADI = new StaticDynamicUncertaintyWithADIULHSolver(); ConstantNormalDistributedProblemGenerator problemGenera...
1
public Object getFieldValue(_Fields field) { switch (field) { case FIRST_NAME: return getFirstName(); case LAST_NAME: return getLastName(); case STATUS: return getStatus(); case ID: return Integer.valueOf(getId()); case EMAIL: return getEmail(); } throw...
5
public double evaluate_double(Object[] dl) throws Throwable { if (Debug.enabled) Debug.println("Wrong evaluateXXXX() method called,"+ " check value of getType()."); return 0.0D; };
1
@Test(expected = NullPointerException.class) public void findBestDistanceNullException(){ assertEquals(Quantity.best(null), new ArithmeticQuantity(4, Distance.YARDS)); }
0
protected int processPuzzle(int f,int e) { if(f==0||f==1) return f; if(e==1) { return f; } int attemptsReqdBrk,attemptsReqdDBrk,res; int min=Integer.MAX_VALUE; if(e>1) { for(int i=1;i<=f;i++) { // egg breaks if(!cache.containsKey(f+","+e)) { attemptsReqdBrk=1+processPuzzl...
8
public void zoomOut(){ if(utmWidth >= 364790 || utmHeight >= 269423) { //You can't zoom more out than this //If the upper left corner is not in the right position, reset the map if(upperLeftX != 434168 && upperLeftY != 6412239) { resetMap(); } return; } zoom(upperLeftX-(utmWidth*0.1), upperLeftY...
4
public GameBoard() { addKeyListener(new TAdapter()); setFocusable(true); setBackground(Color.BLACK); setDoubleBuffered(true); //---Create the elements on the board---// // Put walls along the boundary for (int i = 0; i < BOARD_WIDTH; i += BLOCK_WIDTH){ //Top Row wallL...
7
public void LoadConfig(FileConfiguration config) { config.options().copyDefaults(true); plugin.DebugEnabled = Config().getBoolean("debug", false); plugin.USDateFormat = Config().getBoolean("us-date-format", false); plugin.JoinMessage = Config().getString("messages.join"); plugin.AnnounceMessage = Config().ge...
7
public int parseLine(String line) { setEFileVersionNumber("1.7"); checkMinimumLength(line); if (line.length() > 2) setDetailRecId(line.substring(0,2)); // if these remain null this will cause problems in PicCodeParserManifestV17 setOverlabelIndicator(""); setOverlabelBarcodeConstructCode(""); setO...
9
private static String parseString(ListIterator<Character> chars) { StringBuilder ret = new StringBuilder(); boolean isControlled = false; int hexValue = 0; int hexChar = -1; while (chars.hasNext()) { char cur = chars.next(); if (hexChar >= 0) { try { hexValue <<= 4; hexValue |= Integer.par...
9
public int circularHead(Node node) { if(node == null) return -1; else { Node slow = node; Node fast = node; while(fast.next != null) { slow = slow.next; if(fast.next.next == null) { return -1; } else { fast = fast.next.next; } if(slow == fast) ...
7
protected void UpdateLineColumn(char c) { column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else line += (column = 1); ...
6
private void btnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarActionPerformed if(tbxPasswordActual.getPassword().length != 0 && tbxPasswordNuevo.getPassword().length != 0 && tbxPasswordNuevoRepetido.getPassword().length != 0){ try { ...
8
public List<Double> getRHList() { List<Double> result= new ArrayList<Double>(); double[] values= this.getRHArray(); for (int i= 0; i< values.length; ++i) { result.add(Double.valueOf(values[i])); } return result; }
1
public static List<String> expandWithThesaurusBroader1(String node) throws JSONException { HashMap<String, List<String>> result = new HashMap(); List<String> resultsList = new ArrayList<String>(); List<String> expandedNodes = new ArrayList<String>(); List<String> expandedTerms = new ArrayList<String>(); L...
4
private static String js_substr(String target, Object[] args) { if (args.length < 1) return target; double begin = ScriptRuntime.toInteger(args[0]); double end; int length = target.length(); if (begin < 0) { begin += length; if (begin < 0) ...
7
public float getPrix() { return prix; }
0
public void writeHistory(DataOutput output) { try { output.writeInt(VERSION); int comboCount = directoryCombo.getItemCount(); Vector strings = new Vector(); for (int i = 0; i < comboCount; ++i) { String next = (String) directoryCombo.getItemAt(i); ...
4
private Program generateOffspring() { List<Program> crossoverParents = selectionCrossoverOp.select(population, 2); Program offspring = null; try { if(crossoverParents != null && crossoverParents.size() > 1) { offspring = crossoverOp.generateOffspring(crossoverParents.get(0), crossoverParents.get(1)); o...
3
public void fxpDirectory(FTPConnection destination, FTPFile srcDir, FTPFile dstDir) throws IOException, FtpWorkflowException, FtpIOException { if (!srcDir.isDirectory()) throw new FtpFileNotFoundException("Downloading: " + srcDir.getName() ...
8
public void createBlocks() { // We get the target and put it last to guarantee it will always be on top Entity target = entities.pop(); Entity temp; for (int i = 1; i < 9; i++) { temp = new Entity(new Vector2(i, 2.5f),textures.get(3)); temp.setObjectID(Entity.ObjectIDType.BLOCK); ...
8
private void btnApagarPagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarPagamentoActionPerformed try { if (JOptionPane.showConfirmDialog(rootPane, "Deseja realmente apagar esta forma de pagamento?") == 0) { carregaObjeto(); ...
3
public void mousePressed(MouseEvent e) {}
0
public void testEra() { assertEquals(1, BuddhistChronology.BE); try { new DateTime(-1, 13, 5, 0, 0, 0, 0, BUDDHIST_UTC); fail(); } catch (IllegalArgumentException ex) {} }
1
private int getMachineIndexBySelectedRow(JTable table){ InputTableModel model = (InputTableModel) table.getModel(); int row = table.getSelectedRow(); if(row < 0) return -1; String machineFileName = (String)model.getValueAt(row, 0); return getMachineIndexByName(machineFileName); }
1
private void ReInitRounds() { int i; jjround = 0x80000001; for (i = 16; i-- > 0;) jjrounds[i] = 0x80000000; }
1
public static void mergeQuestion() { int arrlen = 3; int [] arra = new int[arrlen * 2]; int [] arrb = new int[arrlen]; int [] arrc = new int[arrlen * 2]; arra = ArrayUtil.getRandomIntArray(arrlen * 2, 100); arrb = ArrayUtil.getRandomIntArray(arrlen, 100); Arrays.sort(arra); Arrays.sort(arrb); ...
9
public void resetAP(MapleClient c, byte stat) { MapleCharacter player = c.getPlayer(); short amount = 0; switch (stat) { case 1: // STR amount = (short) (player.getStat().getStr() - 4); if ((player.getRemainingAp() + amount) > 32767) { ...
8
@Override public List<Event> searchEventByVenue(Venue v) { final List<Event> ret = new ArrayList<Event>(); final String vID = v.getId(); final HashMap<String, String> params = this.createDefaultHashMap(); params.put("location", vID); final String url = this.conn.prepareURL("events/search", params)...
5
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
private void startTask() { if (m_TaskRunning == false && m_TaskQueue.size() > 0) { Thread activeTaskThread; activeTaskThread = new Thread() { public void run() { m_TaskRunning = true; Task currentTask = (Task)m_TaskQueue.pop(); String taskId = (String)m_TaskIdQueue.pop(); TaskSta...
7
public void startServer() { System.out.println("Starting server..."); try { server.startServer(9876); System.out.println("Server started!"); } catch (CouldNotStartServerException e) { System.out.println("Server could not be started: " + e.getMessage()); } }
1
public boolean equals(Object other) { if (this == other) return true; if (other == null) return false; if (!BoardType.class.isAssignableFrom(other.getClass())) return false; Board board = (Board) other; if (!this.getShiftCard().equals(board.getShiftCard()) || !this.getTreasure().equals(board.ge...
9
private void parseEntityValue(ReplacementTextBuffer value) throws IOException { final Token t = new Token(); for (;;) { int tok; for (;;) { try { tok = Tokenizer.tokenizeEntityValue(buf, bufStart, bufEnd, t); currentTokenStart = bufStart; bufStart = t.getTokenEnd(); break; } catch (Em...
9
protected final void raiseEvent(Event event) { if (event == null) return; Class<?> eventClass = event.getClass(); while (Event.class.isAssignableFrom(eventClass)) { fireEvent(eventClass, event); Class<?>[] interfaces = eventClass.getInterfaces(); for (Class<?> i : interfaces) { if (Event.c...
7
public static String getPermutation(int n, int k) { int[] factorial = new int[n + 1]; for (int i = 0; i < n + 1; i++) { if (1 < i) factorial[i] = factorial[i - 1] * i; else factorial[i] = 1; } List<Integer> alpha = new ArrayList<Integer>(); for (int i = 1; i < n...
8
protected static Ptg calcCoupDayBS( Ptg[] operands ) { if( operands.length < 2 ) { return new PtgErr( PtgErr.ERROR_NULL ); } debugOperands( operands, "COUPDAYSBS" ); try { GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() ); GregorianCalenda...
9
private boolean jj_3_74() { if (jj_scan_token(ANDAND)) return true; return false; }
1
private void cftrec4_th(final int n, final float[] a, final int offa, final int nw, final float[] w) { int i; int idiv4, m, nthreads; int idx = 0; nthreads = 2; idiv4 = 0; m = n >> 1; if (n > ConcurrencyUtils.getThreadsBeginN_1D_FFT_4Threads()) { nthre...
8
public boolean canDo(char symbol) { if (symbol == ' ') return true; return false; }
1
private void computeLater(final ExprInfo exprInfo) { Iterator blocks = cfg.nodes().iterator(); while (blocks.hasNext()) { final Block block = (Block) blocks.next(); final Phi phi = exprInfo.exprPhiAtBlock(block); if (phi != null) { phi.setLater(phi.canBeAvail()); } } blocks = cfg.nodes().ite...
7
private void convert(int slot) { readerGen[slot] = currentReaderGen; int index = 0; String value = values[slot]; if (value == null) { ords[slot] = 0; return; } if (sortPos == 0 && bottomSlot != -1 && bottomSlot != slot) { // Since we are the primary sort, the...
6
public Map<String, Object> getValues(boolean deep) { Map<String, Object> result = new LinkedHashMap<String, Object>(); Configuration root = getRoot(); if (root != null && root.options().copyDefaults()) { ConfigurationSection defaults = getDefaultSection(); if (defaults ...
3
private String setHeader (String key, int datalen, Map header) { String info = separator + key; if (header != null && header.containsKey("dtime")) { info += separator + "dtime=" + header.get("dtime"); header.remove("dtime"); } else { info += separator + "dtim...
7
private Expression orStatement( List<Expression> args, String caller ) { // return the first non-false value for( int i = 0; i < args.size(); ++i ) { if ( args.get(i).show(defSubst, caller).compareTo("#f") != 0 ) { return args.get(i).eval(defSubst, caller); } } ...
2
public boolean checkVersion() { String curVersion = this.plugin.getDescription().getVersion(); String file = (String) this.latest.get(this.DL_NAME); String last = file.substring(file.lastIndexOf("-"), file.length()); return !newVersion(curVersion, last); }
0
public void setAge(int age) { this.age = age; }
0
public void setTipo(String tipo) { this.tipo = tipo; }
0
private void movePaddle(MouseEvent e) { int x = 0; boolean movementOver = false; while (x++ < WIDTH && !movementOver) { //x++ is limiting counter movementOver = paddleCtrl.movePaddle(e.getX()); } }
2
public void visitAttribute(final Attribute attr) { buf.setLength(0); buf.append(tab).append("ATTRIBUTE "); appendDescriptor(-1, attr.type); if (attr instanceof Traceable) { ((Traceable) attr).trace(buf, labelNames); } else { buf.append(" : unknown\n"); ...
2
public void updateAuctionList() { new Thread() { @Override public void run() { if (userId != null && userProfile != null) { synchronized (activeRequest) { activeRequest.setSenderId(userId); activeRequest.setSessionToken(userProfile.getSessionToken()); boolean success = Comms.se...
5
private void mouseKeyStatus(MouseEvent e, boolean status) { if (e.getButton() == MouseEvent.BUTTON1) { mouseState[0] = status; } else if (e.getButton() == MouseEvent.BUTTON2) { mouseState[1] = status; } else if (e.getButton() == MouseEvent.BUTTON3) { mouseStat...
3
public static URL baseUrlOfClass(Class<?> clazz) { try { String name = clazz.getName(); URL url = clazz.getResource("/" + name.replace('.', '/') + ".class"); int curPos = 0; do { curPos = name.indexOf('.', curPos + 1); if (curPos >=...
4
private static URL __getWsdlLocation() { if (AQACQUISITIONSERVICE_EXCEPTION!= null) { throw AQACQUISITIONSERVICE_EXCEPTION; } return AQACQUISITIONSERVICE_WSDL_LOCATION; }
1
private static int booleanString(boolean b){ if(b){ return 1; } else{ return 0; } }
1
public final ControlFlow.lvalue_return lvalue(String funcName) throws RecognitionException { ControlFlow.lvalue_return retval = new ControlFlow.lvalue_return(); retval.start = input.LT(1); CommonTree id=null; TreeRuleReturnScope r1 =null; try { // C:\\eclipse-workspaces\\workspace1\\Compiler\\src\\edu\\c...
9
public Dimension getPreferredSize() { int maxx = MIN_SIZE; int maxy = MIN_SIZE; if (background != null) { maxx = Math.max(maxx, background.getWidth()); maxy = Math.max(maxx, background.getHeight()); } for (Sh...
2
private Element requestLaunch(Connection connection, Element element) { FreeColServer freeColServer = getFreeColServer(); // Check if launching player is an admin. ServerPlayer launchingPlayer = freeColServer.getPlayer(connection); if (!launchingPlayer.isAdmin()) { return DO...
6
void drawHLine(int argb, boolean tScreened, int x, int y, int z, int w) { // hover, labels only int width = g3d.width; if (w < 0) { x += w; w = -w; } int[] pbuf = g3d.pbuf; int[] zbuf = g3d.zbuf; if (x < 0) { w += x; x = 0; } if (x + w >= width) { w = wi...
9
public final void and_expr() throws RecognitionException { try { // Python.g:324:10: ( shift_expr ( AMPER shift_expr )* ) // Python.g:324:12: shift_expr ( AMPER shift_expr )* { pushFollow(FOLLOW_shift_expr_in_and_expr2657); shift_expr(); state._fsp--; if (state.failed) return; // Python.g:324:...
7
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new FileReader(args[0])); String l; while ((l = br.readLine()) != null) { String[] a = l.split("\\ "); LinkedList<String> s = new LinkedList<String>(); int c = 0; double x, y; String o; for...
9
public void sortByValue() { ArrayList<Card> newHand = new ArrayList<Card>(); while( hand.size() > 0 ) { int pos = 0; Card c = hand.get(0); for (int i = 1; i < hand.size(); i++) { Card c1 = hand.get(i); if ( c1.getValue() < c.getValue() || (c1.getValue() == c.getValue() && c1.getSuit() < c.get...
5
public void ge_main_process(TextArea area,SimpleNode node)throws SemanticErr{ int i=0; for (i = 0; i < gt.symbol_table.symbol_name.size(); i++) { String symbol = gt.symbol_table.symbol_type.get(i).toString(); if(symbol.equals("VARIABLE_NAME")){ break; ...
5
public boolean isCollision(Sprite s1, Sprite s2) { // if the Sprites are the same, return false if (s1 == s2) { return false; } // if one of the Sprites is a dead Creature, return false if (s1 instanceof Creature && !((Creature)s1).isAlive()) { return fal...
8
public Binding<Boolean> inbound(Binding<String> fromBinding) { Binding<Boolean> toBinding = new Binding<Boolean>(Boolean.class, null); if (fromBinding == null || fromBinding.getObj() == null) { return toBinding; } String fromStr = fromBinding.getObj().toString(); if (...
5
static boolean function(String st){ char cerrado = '\0', abierto = '\0'; if(st.length()==0)return true; if(st.charAt(0) == '('){ cerrado = ')'; abierto = '('; } else{ cerrado = ']'; abierto = '['; } int nAbiertos = 1; for (int i = 1; i < st.length() && nAbiertos > 0; i++){ if(st.charA...
8
public CanvasExtended(String ownerName) { super(SimpleUniverse.getPreferredConfiguration()); setDoubleBufferEnable(true); // Create a universe universeProxyServer = Client.getSharedUniverse(App.SERVER_NAME, "1234", "Pluton"); universe = new CSharedUniverse(universeProxyServer, this); // Load a vrml mo...
4
public XMLGregorianCalendar getExpiryDate() { return expiryDate; }
0
static void draw_sprites(osd_bitmap bitmap,int pri) { int offs,fx,fy,x,y,color,sprite; if (sprite_enable==0) return; for (offs = 0x1000-8;offs >= 0;offs -= 8) { /* Don't draw empty sprite table entries */ if (buffered_spriteram.read(offs+7)!=0xf) continue; if (buffered_spriteram.read(offs+0)==0xf0...
9
public static String getRelativePath(final String parentPath, final String absolutePath) { if (parentPath == null || absolutePath == null || (parentPath.length() > absolutePath.length())) { return null; } String relativePath = null; final File absoluteFile = ...
7
public void renderTile(int xp, int yp, Tile tile) { xp -= xOffset; yp -= yOffset; for (int y = 0; y < tile.sprite.SIZE; y++) { int ya = y + yp; for (int x = 0; x < tile.sprite.SIZE; x++) { int xa = x + xp; if (xa < -tile.sprite.SIZE || xa >= width || ya < 0 || ya >= height) break; if (xa < 0) x...
7
private static int checkFormalTypeParameters(final String signature, int pos) { // FormalTypeParameters: // < FormalTypeParameter+ > pos = checkChar('<', signature, pos); pos = checkFormalTypeParameter(signature, pos); while (getChar(signature, pos) != '>') { pos = checkFormalTypeParameter(signature, pos)...
1
public PairingsGUI(int round, ArrayList<Match> matches,Player pbye){ this.matches = matches; this.nextTitle = ("Round " + round + " Standings"); seats.add(table1_seat1); seats.add(table1_seat2); seats.add(table2_seat1); seats.add(table2_seat2); seats.add(table3_seat1); seats.add(table3_seat2); seat...
9
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
static char convert(byte[] bytes) { char result = '-'; int secPosValue = 0; int i; for (i = 0; i < bytes.length; i++) { bytes[i] -= GB_SP_DIFF; } secPosValue = bytes[0] * 100 + bytes[1]; for (i = 0; i < 23; i++) { if (secPosValue >= secPosValueList[i] && secPosValue <...
4
@Override public void fatalError(SAXParseException e) { System.out.println(padding + "XML PARSER FATAL ERROR: Line: " + e.getLineNumber() + " Column: " + e.getColumnNumber()); System.out.println(padding + e.getMessage()); }
0