text
stringlengths
14
410k
label
int32
0
9
public void renderHealth(){ float px = 0 - Main.px; float py = 0 + Main.py; if(health < 3){ glColor4d(1, 0.2, 0.2, 0.5); glBegin(GL_QUADS); { glVertex2f(px, py); glVertex2f(px + Main.WIDTH, py); glVertex2f(px + Main.WIDTH, py + Main.HEIGHT); glVertex2f(px, py + Main.HEIGHT); } g...
3
private MapEntry getExceptionProcessor(ExceptionResolver exceptionResolver, Exception ex) { if (exceptionResolver == null) { return null; } MapEntry[] exceptionProcessors = exceptionResolver.value(); for (MapEntry exceptionProcesso...
6
public static void main(String[] args) { for (Path part : path) { System.out.println(part); } Path parentPath = path.getParent(); System.out.println(parentPath); if (parentPath.compareTo(path) < 0) { Path anotherPath = Paths.get("/home/xander"); ...
2
static final aa_Sub1 method4009(int i, int[] is, int[] is_0_, int i_1_, OpenGlToolkit var_ha_Sub2, int i_2_) { try { anInt4597++; byte[] is_3_ = new byte[i * i_2_]; for (int i_4_ = i_1_; (i_2_ ^ 0xffffffff) < (i_4_ ^ 0xffffffff); i_4_++) { int i_5_ = i * i_4_ - -is[i_4_]; for (int i_6_ = ...
6
private void setGroupNames(String username, String[] groups) { Vector<String> v = null; if (groups == null) { v = emptyVector; } else { v = new Vector<String>(groups.length + 1); for (int i = 0; i < groups.length; i++) { v.add(groups[i]); ...
2
public synchronized void stop() { try { thread.join(); System.exit(0); } catch (InterruptedException e) { e.printStackTrace(); } }
1
public boolean isValidWith(int[] concepts){ if(this.isUniversal()) return true; int finded = 0; for (int concept : concepts) { if(s==concept || p==concept || o==concept){ finded++; } } return finded==this.nonUniversalConcepts(); }
5
@Override public String toString() { return "[sysMessage=" + sysMessage + "]"; }
0
public Elements siblingElements() { if (parentNode == null) return new Elements(0); List<Element> elements = parent().children(); Elements siblings = new Elements(elements.size() - 1); for (Element el: elements) if (el != this) siblings.add(el); ...
3
public static TextAngleStrategy angleParallel() { return new TextAngleStrategy() { @Override public double getAngle( TextStrategyParameters parameters ) { Point2D normal = parameters.getPath().getNormalAt( parameters.getPosition() ); double dx = normal.getX(); double dy = normal.getY(); if( dx =...
5
public void DataEnd() { if (mDone == true) return ; if (mItems == 2) { if ((mVerifier[mItemIdx[0]].charset()).equals("GB18030")) { Report(mVerifier[mItemIdx[1]].charset()) ; mDone = true ; } else if ((mVerifier[mItemIdx[1]].charset()).equals("GB18030")) { Report(mVerifier[mItemIdx[0]].charset(...
5
private void evalGetField(int opcode, int index, Frame frame) throws BadBytecode { String desc = constPool.getFieldrefType(index); Type type = zeroExtend(typeFromDesc(desc)); if (opcode == GETFIELD) { Type objectType = resolveClassInfo(constPool.getFieldrefClassName(index)); ...
1
public static String readAll() { if (!scanner.hasNextLine()) return ""; String result = ""; while (scanner.hasNextLine()) { result = result + scanner.nextLine(); result = result + "\n"; } return result; }
2
public void keyTyped(KeyEvent e) { if (!Character.isDigit(e.getKeyChar())) { e.setKeyChar((char) 0); } else { if ((e.getSource() == tfPort) && !tfPort.getText().isEmpty()) { int port = Integer.valueOf(tfPort.getText() + e.getKeyChar()); if ((port < 1) || (port > 65535)) { e.setKeyChar((char)...
5
public int[][] idct(int F[][]) { double tempX[][] = new double[N][N]; double tempY[][] = new double[N][N]; int f[][] = new int[N][N]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { tempY[i][j] = (double)F[i][j]; } } i...
4
public void run() { stop = false; double gy = transformY(garbage.getX()); double gx = transformX(garbage.getY()); while (!cancelled) { while(!pos2d.isDataReady()){}; double x = pos2d.getX(); double y = pos2d.getY(); if (getDistance(x, y, gx, gy) <=...
6
public void start() { if (running) { throw new IllegalStateException("Simulation is already running."); } // the reason we do not inherit from Runnable is that we do not want to // expose the void run() method to the outside world. We want to well // encapsulate the whole idea of a thread. // thread can...
5
public int compareTo(AsciiString str) { if(str == null) return 1; if(chars().hashCode() == str.val.hashCode()) return 0; int len1=val.length; int len2=str.val.length; int lim=Math.min(len1, len2); int k = 0; while (k < lim) { byte c1 =val...
7
public void mousePressed(MouseEvent e) { // request page focus // requestFocusInWindow(); if (documentViewModel.getViewToolMode() == DocumentViewModel.DISPLAY_TOOL_TEXT_SELECTION) { textSelectionHandler.mousePressed(e); } else if (documentViewModel.getViewToo...
3
public boolean inArea(Rectangle in, Rectangle area) { if (area.getX() >= in.getX() && area.getX() + area.getWidth() <= in.getX() + in.getWidth() && area.getY() >= in.getY() && area.getY() + area.getHeight() <= in.getY() + in.getHeight()) { return true; } return false; }
4
public static void main(String[] args) throws ExecutionException, InterruptedException { scheduleAtFixedRateTest(); //scheduleWithFixedDelayTest(); }
0
public void loseHealth(int i){ if(alive){ health -= i; if(health <= 0){ health = 0; die(); } } }
2
public String getMessage() { return message; }
0
public void thumbnail(String fromFileStr, String saveToFileStr, int width, int height,String format) throws Exception { BufferedImage srcImage; File saveFile = new File(saveToFileStr); File fromFile = new File(fromFileStr); srcImage = javax.imageio.ImageIO.read(fromFile); // ...
7
private void loadExampleBN() { File dir = new File(exdir); optionsBN.addItem("None"); for (File file : dir.listFiles()) { if (!file.isDirectory()) { String name = file.getName(); if (name.endsWith(".bn")) { optionsBN.addItem(name.substring(0, name.length())); } ...
3
@Override public String downloadSong(final String songUrl, final String destinationFolder, final Mp3Metadata metadata) { String trackString = null; try { final long trackId = getApi().resolve(songUrl); final HttpResponse trackResponse = getApi().get(new Request(String.format(Constants.TRACK_URL, trackId, Con...
4
private static final String esc(final String str) { StringBuffer sb = new StringBuffer(str.length()); for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); switch (ch) { case '&': sb.append("&amp;"); break; case '<': sb.append("&lt;"); break; case '>': sb...
6
public String getSector() { return Address.getSector(); }
0
public BufferedReader getReader() { return reader; }
0
private void open( Handshakedata d ) { if ( DEBUG ) System.out.println( "open using draft: " + draft.getClass().getSimpleName() ); readystate = READYSTATE.OPEN; try { wsl.onWebsocketOpen( this, d ); } catch ( RuntimeException e ) { wsl.onWebsocketError( this, e ); } }
2
@EventHandler public void onPlayerDeath(final PlayerDeathEvent e) { new BukkitRunnable() { public void run() { try { Object nmsPlayer = e.getEntity().getClass().getMethod("getHandle").invoke(e.getEntity()); Object con = nmsPlayer.getClass().getDeclaredField("playerConnection").get(nmsPlaye...
2
public void actualizarTurnosDesdeJTable() { for (int i = 0; i < tabla.getRowCount(); i++) { if (tabla.getValueAt(i, 3) != null) { if (tabla.getValueAt(i, 4) != null) { turno.turnos.get(i).setDuración((int) tabla.getValueAt(i, 3)); turno....
3
private static boolean checkRelative(Board board, SquarePos position, List<SquarePos> blocks, int x, int y) { for (SquarePos pos : blocks) { int relxPos = pos.x + position.x + x; int relyPos = pos.y + position.y + y; if (relyPos > board.getHeight() - 1 || ...
5
private static boolean isValidEvent(String eventNumber) { if (eventNumber == null) return false; try { Integer.parseInt(eventNumber); } catch (NumberFormatException e) { return false; } int index = Integer.parseInt(eventNumber) - 1; if (events.size() > index && index >= 0) return true; else...
4
public void appendSamples(int channel, float[] f) { int pos = bufferp[channel]; short s; float fs; for (int i=0; i<32;) { fs = f[i++]; fs = (fs>32767.0f ? 32767.0f : (fs < -32767.0f ? -32767.0f : fs)); s = (short)fs; buffer[pos] = s; pos += channels; } buf...
3
private String replace(String message, String playerName, String targetName) { // colors message = message.replace("{BLACK}", "&0"); message = message.replace("{DARKBLUE}", "&1"); message = message.replace("{DARKGREEN}", "&2"); message = message.replace("{DARKTEAL}", "&3"); message = message.replace("{DARKR...
2
@Override protected Void doInBackground() { final int BUFFER_SIZE = 2048; BufferedInputStream bis = null; ByteArrayOutputStream baos; try { URL url = new URL(addr); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connecti...
5
private static boolean isArray(Object object) { return (object == null ? false : object.getClass().isArray()); }
1
public static IPCTrackerDataV2 LoadData(String path){ IPCTrackerDataV2 loadedData = new IPCTrackerDataV2(); IPCTrackerData v1LoadedData = new IPCTrackerData(); FileInputStream fis = null; ObjectInputStream in = null; if(path.endsWith(IPCTrackerKeys.FileNames.FileName)){ try { f...
6
public void jump() { main.getCam().removeFocus(); resetIdle(); if(snoozing){ wake(); return; } //can't move if the current action disallows it if(immobileActions.contains(getAction(), true) || frozen) return; if (isOnGround()) { main.playSound(getPosition(), "jump1"); body.applyForceToCe...
4
public static void getArticlesFromName(String name, ArrayList<Article> articles, ArrayList<String> coauthers) { try { if (conn == null || conn.isClosed()) { init(); } if (statement == null || statement.isClosed()) { statement = conn.createStatement(); } String sql = String.format( SQL_O...
6
private void addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addActionPerformed try { /* * Validity check */ if (!valid()) { return; } System.out.println("\"" + comboGemeentes.getSelectedItem() + "\""); model.setFirm(txtFirma.getText()...
7
@Override public void keyReleased(KeyEvent e) { //Space bar generates a new generation if (e.getKeyCode() == KeyEvent.VK_SPACE) { generator.generateNewGeneration(); //Clear the selected fractals selectedFractals = new boolean[9]; repaint(); } ...
6
public BlogDelegate getBlogDelegate() { return blogDelegate; }
0
OptionSet(Options.Prefix prefix, Options.Multiplicity defaultMultiplicity, String setName, int minData, int maxData) { if (setName == null) throw new IllegalArgumentException(CLASS + ": setName may not be null"); if (minData < 0) throw new IllegalArgumentException(CLASS + ": minData must be >= 0"); ...
3
public void prepareToWrite() { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); try { DocumentBuilder db = dbf.newDocumentBuilder(); Document document = db.newDocument(); Element root = document.createElement("sta...
6
public void showMeVector(Vector vec) { for(int i=0;i<vec.size();i++) { System.out.println(vec.elementAt(i)); } }
1
@Override public void trainOnInstanceImpl(Instance inst) { if (this.treeRoot == null) { this.treeRoot = newLearningNode(); this.activeLeafNodeCount = 1; } FoundNode[] foundNodes = this.treeRoot.filterInstanceToLeaves(inst, null, -1, true); for...
7
public static String unParse(String in){ String B = in; for (int y = 0; y < CodeList.size(); y++) { String A[] = B.split(CodeList.get(y).get(true)); B = A[0]; for (int x = 1; x < A.length; x++) { B += CodeList.get(y).get(false); B += (CodeList.get(y).get(false).endsWith(">")) ? A[x] : (CodeList.get...
4
public void parse22(String input){ char[] temp = new char[13]; input.trim(); for (String retval : input.split("> ")) { retval.getChars(5, 18, temp, 0); if(Character.isDigit(temp[12])){ if(temp[12]!='0'){ String[] course = String.c...
8
private ArrayList<Integer> parseAnswer(int multiplier) throws Exception { Thread.sleep(this.MAX_INTERVAL * multiplier); int c; ArrayList<Integer> answer = new ArrayList<Integer>(); while ((c = input.read()) != -1) answer.add(c); if (answer.get(0) == Status.OK) ...
6
@Override public void addNewPastMeeting(Set<Contact> contacts, Calendar date, String text) { if(contacts.isEmpty() || !contactsExist(contacts)) { throw new IllegalArgumentException(); } else if(contacts != null && date != null && text != null) { PastMeeting newMeeting = new P...
5
public ArrayList<ChatChannel> getPlayersChannels(String name) throws SQLException { ArrayList<ChatChannel> channels = new ArrayList<ChatChannel>(); sql.initialise(); ResultSet res = sql.sqlQuery("SELECT ChannelName FROM BungeeMembers WHERE PlayerName = '"+name+"'"); while(res.next()){ channels.add(plugin.get...
3
public int process(int signal) throws MaltChainedException { if (cachedGraph == null) { marking_strategy = OptionManager.instance().getOptionValue(getOptionContainerIndex(), "pproj", "marking_strategy").toString().trim(); covered_root = OptionManager.instance().getOptionValue(getOptionContainerIndex(), "pproj",...
9
@Test public void testPostTracking() throws Exception { //test informed all the fields allowed to post Tracking tracking1 = new Tracking(trackingNumberPost); tracking1.setSlug(slugPost); tracking1.setOrderIDPath(orderIDPathPost); tracking1.setCustomerName(customerNamePost); ...
1
@Override public void mousePressed(MouseEvent e) { isMouseDown = true; mouseY = e.getY(); }
0
@Override public void setSelectionPath(TreePath p) { if (p.getPathCount() == 3) { if (!isPathSelected(p)) { super.setSelectionPath(p); gui.imageBrowser.setEvent(p.getLastPathComponent().toString()); } else { super.removeSelectionPath(p); gui.imageBrowser.clearEvent(); } } else { su...
2
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
static boolean patroonInterval(String invoer) { return invoer.matches("[0-9]{4}-[0-9]{4}"); }
0
@Override public String toString() { return "BOP " + operator; }
0
public void startHandshake( ClientHandshakeBuilder handshakedata ) throws InvalidHandshakeException { assert ( readystate != READYSTATE.CONNECTING ) : "shall only be called once"; // Store the Handshake Request we are about to send this.handshakerequest = draft.postProcessHandshakeRequestAsClient( handshakeda...
2
public void color(int i, int x, int y) { if(x < texture.getWidth() && y < texture.getHeight() && x >= 0 && y >= 0) { texture.setRGB(x, y, new Color(i).getRGB()); this.repaint(); } }
4
public boolean save(String filename) { boolean success = true; PrintWriter writer = null; try { writer = new PrintWriter(new File(filename)); for (Score score : scores) { writer.printf("%s\n", score); } } catch (FileNotFoundException e) { success = false; } finally { writer.close(); } ...
2
@Override public void update(GameContainer window) { if (isAnimating()) { float currentAlpha = tile.getAlpha(); if (fadingIn) { if (currentAlpha < 1F) tile.setAlpha(currentAlpha + 0.01F); else animating = false; } else { if (currentAlpha > 0F) tile.setAlpha(currentAlp...
4
public void update() { if(Keyboard.isKeyDown(getKey())) { setPressed(true); setReleased(false); } else { if(isPressed()) setReleased(true); else setReleased(false); setPressed(false); setHeld(false); } }
2
public Espectaculo(String localidad, int cantidadEntradas, String nombre, String[] fecha, List<Zona> zonas) { this.localidad = localidad; this.cantidadEntradas = cantidadEntradas; this.nombre = nombre; this.fecha = fecha; this.zonas = zonas; // this...
3
private void setDayCells(){ Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month); calendar.set(Calendar.DAY_OF_MONTH, 1); // Calendar.DAY_OF_WEEK uses base 1. That's why one is subtracted. int firstDayOfMonth = calendar.get(Calendar.DAY_OF_WEEK) ...
8
private void EtudiantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EtudiantsActionPerformed // TODO add your handling code here: switch(etat){ case Debut: //interdit break; case Debut1: this.donner1.frame_Etudi...
8
public void _updateNodeCollection(Node n) { if(!n.holdInNodeCollection) { return; // the node is not yet hold by this node collection } //sensitiveInformationChanged = true; SquarePos newPosition = getPosOfNode(n); SquarePos oldPosition = (SquarePos) n.nodeCollectionInfo; if((oldPosition.x != newPosi...
3
public static void main(final String args[]) { Type.truncatedName(Type.getType("(D)V")); // Print the truncated name of each argument for (int i = 0; i < args.length; i++) { System.out.println("Truncated name of " + args[i] + ": " + Type.truncatedName(Type.getType(args[i]))); } }
1
private void handleCreateReservation(Sim_event ev) { int src = -1; // the sender id boolean success = false; int tag = -1; try { // get the data ARObject obj = (ARObject) ev.get_data(); src = obj.getUserID(); // get the uniq...
6
public final NiklausParser.arithmeticexpression_return arithmeticexpression() throws RecognitionException { NiklausParser.arithmeticexpression_return retval = new NiklausParser.arithmeticexpression_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token ADDITION109=null;...
9
public void writeDouble(double v) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("writeDouble = " + v); } if (Double.isNaN(v)) { throw new RuntimeException("Tried to send a NaN floating-point"); } else if (Double.isInfinite(v)) { thr...
4
public ControlloreFasiGioco(int numGiocatori, Mazziere mazziere, ControlloreUtenti controlloreUtenti) { this.mazziere = mazziere; this.controlloreUtenti = controlloreUtenti; int segnaliniScommesse; switch (numGiocatori){ case 2: {numTurniTotali=6; segnaliniScommesse=1;break;} case 3: {numTurniTotali=6; se...
8
private void buildBuilding(BuildRequest request) { Unit worker = control.requestUnit(UnitType.Terran_SCV); if (worker == null) { return; } TilePosition requestLocation = request.getBuildLocation(); if (requestLocation == null) { requestLocation = self.getStartLocation(); } TilePosition buildTile = ...
4
public synchronized String formalizeLiteralBooleanFunctionString(final String literalVariableStr, Map<LiteralVariable, LiteralVariable> literalVariableMapping, Map<LiteralVariable, String> literalBooleanFunctionAnswers, boolean isSubstituteWithJavaCode) throws ParserException { if (null == literalVariableStr...
7
public int[] getAvailableTopRowColumnPairs() { /* Only pairs of columns are valid. */ if(this.getNumberOfColumns() < 2) return new int[0]; /* filter available columns */ int row = 0; ArrayList<Integer> colsList = new ArrayList(this.getNumberOfRows())...
8
public boolean isGood(){ switch(this){ case LAWFUL_GOOD: case NEUTRAL_GOOD: case CHAOTIC_GOOD: return true; default: return false; } }
3
public void mousePressed(MouseEvent me) { if(monitorPress) { Zone activeZone = checkActiveZone(new Point(me.getX(),me.getY())); if(null != activeZone) listener.zoneEventOccurred(activeZone.name, ZoneEvents.PRESS); } //If drag events are to be monitored, the point at which the mouse is //first pres...
4
@Test public void testToString() { Rarity r = Rarity.BASIC; try { assert(r.toString(r).equalsIgnoreCase("basic")); } catch (IOException io) { fail(io.getMessage()); } r = Rarity.BASIC; try { assert(r.toString(r).equalsIgnoreCase("basic")); } catch (IOException io) { fail(io.getMessage()); }...
7
private static boolean validAuctionPublication(Auction au) { return au.getMinPrice() >= 0 && au.getReservePrice() >= au.getMinPrice() && au.getEndDate().after(new Date()) && au.getState().equals(AuctionState.CREATED) && !auctionsContainer.hasItem(au.getItem()); }
4
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ContentType that = (ContentType) o; if (charset != null ? !charset.equals(that.charset) : that.charset != null) return false; if (subtype != nu...
9
public static boolean isMonospacedFont(Font font) { FontMetrics fm = getFontMetrics(font); return isMonospaced(fm); }
0
public void doRun(int run) throws Exception { if (getRawOutput()) { if (m_ZipDest == null) { m_ZipDest = new OutputZipper(m_OutputFile); } } if (m_Instances == null) { throw new Exception("No Instances set"); } // Randomize on a copy of the original dataset Instances runInst...
8
static public void serialize(OutputStream out, Object obj) throws IOException { if (out==null) throw new NullPointerException("out"); if (obj==null) throw new NullPointerException("obj"); ObjectOutputStream objOut = new ObjectOutputStream(out); objOut.writeObject(obj); }
2
public boolean getLogin() { return isLogin; }
0
private QueryResult gatherResultInfoForSelectQuery(String queryString, int queryNr, boolean sorted, Document doc, String[] rows) { Element root = doc.getRootElement(); //Get head information Element child = root.getChild("head", Namespace.getNamespace("http://www.w3.org/2005/sparql-results#")); //Get result...
6
public static String getHtmlString(int heading,String value,String colour,boolean isBold) { String bold=""; if(isBold){ bold="<b>"+value+"</b>"; }else{ bold=value; } String font=""; if(colour!=null){ font="<font color=\""+colour+"\">"+bold+"</font>"; }else{ font="<font color=\"black\">"+bold+"...
6
public void drawCalendar(int inputMonth, int inputYear) { p2.removeAll(); for (int i = 0; i < weekdays.length; i++) { JLabel label = new JLabel(weekdays[i]); label.setHorizontalAlignment(SwingConstants.RIGHT); p2.add(label); } Calendar today = Calendar.getInstance(); today.setTime(new Date()); ...
7
private void testBroadcastMode() { System.out.println("BEGIN: BROADCAST TEST"); final int numConnections = 10; final int numMessages = 100; ServerConnection[] connections = new ServerConnection[numConnections]; for (int i = 0; i < numConnections; i++) connections[i...
9
public static void main(String[] args) throws Exception { StaticDynamicUncertaintyULHSolver solver = new StaticDynamicUncertaintyULHSolver(); StaticDynamicUncertaintyWithADIULHSolver solverADI = new StaticDynamicUncertaintyWithADIULHSolver(); PrintStream filePrintStream = new PrintStream(new File("results/Setu...
7
public int getSampleRateHz() { return sampleRateHz; }
0
public boolean equals(IPAddress other) { if ((buffer.length == 4) && (other.buffer.length == 4) && (buffer[0] == other.buffer[0]) && (buffer[1] == other.buffer[1]) && (buffer[2] == other.buffer[2]) && (buffer[3] == other.buffer[3])) return true; return false; }
6
private static void render(float interpolation) { StretchType stretch = guiList.peek().getOverrideStretchType(); if(stretch == null) stretch = game.getDefaultStretchType(); if(stretch != DisplayHandler.getStretchType()) DisplayHandler.setStretchType(stretch); Renderer.loadIdentity(); int color = ...
3
@SuppressWarnings({"deprecation", "static-access"}) @EventHandler(priority = EventPriority.HIGH) public void onMobDeath (EntityDeathEvent event) { Entity entity = event.getEntity(); event.getEntity().getWorld(); if (entity instanceof Pig) { Pig pigc = (Pig) entity; ...
3
public double standardizedPersonVariance(int index){ if(!this.dataPreprocessed)this.preprocessData(); if(index<1 || index>this.nPersons)throw new IllegalArgumentException("The person index, " + index + ", must lie between 1 and the number of persons," + this.nPersons + ", inclusive"); if(!this.v...
4
@Override public void onUpdate(GameContainer window) { if (currentScreen != null) currentScreen.update(window); if (overlayScreen != null) overlayScreen.update(window); if (isLoading()) { IScreenOverlay overlay = getOverlayScreen(); if (!overlay.isAnimating()) { currentScreen = pendingScr...
4
public int getDiscogID(String artist, String title) { try { URL url = new URL(req.replace("QUERY", URLEncoder.encode(title, "utf-8"))); DiscogHandler handler = new DiscogHandler(); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(new GZIPInputStream(url.openStream()), ha...
6
public Point[] growHull(Point[] hull) { double rad = HULL_GROWTH_RADIUS; double rightRad = endGame ? rad * HULL_GROWTH_ENDGAME_MULT : rad; Point[] newPoints = new Point[hull.length * 6]; for (int i=0; i < hull.length; i++) { // original point newPoints[6 * i + 0] = new Point(hull[i]); // point above ...
9
public T put( S query, T value ) { final int queryLength = sequencer.lengthOf( query ); if (value == null || queryLength == 0) { return null; } int queryOffset = 0; TrieNode<S, T> node = root.children.get( sequencer.hashOf( query, 0 ) ); // The root doesn't have ...
9