text
stringlengths
14
410k
label
int32
0
9
@SuppressWarnings("unused") private static void insertTestFileObjectsIntoDatabase() { File directory = new File("Pictures"); File[] files = directory.listFiles(); int i = 0; for(File file : files) { FileObject f = Metadata.getImageObject(file); f.setLocationObject(new LocationGPSObject("Japan")); ...
6
public String findResult(String SituName, String ParName, TextProcessing TextPro) { int resultIndex = 0; String result = null; for ( int i = 0; i < TextPro.Headers.length; i ++ ) { if ( TextPro.Headers[i].equals(ParName) ) { resultIndex = i; } } for ( String textLine:TextPro.textList ) { Strin...
4
public void removeNode(){ ArrayList<Node> oldNodes=new ArrayList<Node>(); ArrayList<Line> oldLines=new ArrayList<Line>(); for(Node node:this.mindmap.getNodes()) oldNodes.add(node); for(Line line:this.mindmap.getLines()) oldLines.add(line); for(Node node:this.children) node.removeNode(); this.mindma...
8
private String charArrToString(char[] arr) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { sb.append(arr[i]); } return sb.toString(); }
1
public void visitIntInsn(final int opcode, final int operand) { mv.visitIntInsn(opcode, operand); if (constructor && opcode!=NEWARRAY) { pushValue(OTHER); } }
2
double percentCds(ChangeEffect changeEffect) { int cdsLen = changeEffect.getAaLength(); int codonNum = changeEffect.getCodonNum(); if ((cdsLen >= 0) && (codonNum >= 0)) return codonNum / ((double) cdsLen); return Double.NaN; }
2
public static boolean transform(InstructionContainer ic, StructuredBlock last) { return (createLocalPrePostInc(ic, last) || createPostInc(ic, last)); }
1
public BackgroundManager(GameController gc, Registry rg) { super(gc, rg); backgrounds = new ArrayList<Background>(); parallaxBackgrounds = new ArrayList<Parallax>(); int x, y; float ms; Background b; Parallax parallax; int camMapX = registry.getGameCont...
5
public static void main (String args[]) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int round = Integer.parseInt(reader.readLine()); for (int i = 0; i < round; i++) { StringTokenizer tokenizer = new StringTokenizer(reader.readLine...
5
public void wonBet() { if (hand.getHand().get(0).getRank().equals("Ace") && (hand.getHand().get(1).getRank().equals("King") || hand.getHand().get(1).getRank().equals("Queen") || hand.getHand().get(1).getRank().equals("Jack") || hand .getHand().get(1).getRank().equals("Ten"))) { blackJack(); ...
5
public void setTipo(Tipo tipo) throws SemanticError { if(!Tipo.isPreDefinido(tipo)) throw new SemanticError("Contantes só podem possuim valor de tipo pré-definido"); this.tipo = tipo; }
1
public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay with the * default look and fe...
6
public void paint(Graphics g) { super.paint(g); LOGGER.info("Desenhando ClienteCliente:\t" + cliente.toString() ); if (fase != null && cliente != null && cliente.getMario() != null && cliente.getLuigi() != null) { g.drawImage(fase.getBackground(), 0,0, this); g.drawImage(fase.getMarioDirImg(), client...
4
private BufferedImage setColors(BufferedImage image, double [] values, PaintType paintType) { int width = image.getWidth(); int height = image.getHeight(); for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { for (int k = 1; k < criticalValues.length; ...
9
public void encryptOrDecrypt(String key, int mode, InputStream is, OutputStream os) throws Throwable { DESKeySpec dks = new DESKeySpec(key.getBytes()); SecretKeyFactory skf = SecretKeyFactory.getInstance("DES"); SecretKey desKey = skf.generateSecret(dks); Cipher cipher = Cipher.getInstance("DES"); // DES/ECB/P...
2
@Override public void hoverOver(EventMouse eventMouse) { if(!active){ // square.setTextureCoor(inputTexture.getHover()); } }
1
private void generateGems(int times){ String[] gems1 = new String[10]; gems1[0] = "banded, eye, or moss agate\n"; gems1[1] = "azurite\n"; gems1[2] = "blue quartz\n"; gems1[3] = "hematite\n"; gems1[4] = "lapis lazuli\n"; gems1[5] = "malachite\n"; gems1[6] = "obsidiam\n"; gems1[7] = "rhodoscrosite\n"; ...
6
private void checkGridletCompletion() { ResGridlet obj = null; int i = 0; // NOTE: This one should stay as it is since gridletFinish() // will modify the content of this list if a Gridlet has finished. // Can't use iterator since it will cause an exception while ( i ...
3
public void fillDeclarables(Collection used) { if (usedAnalyzers != null) used.addAll(usedAnalyzers); if (innerAnalyzers != null) { Enumeration enum_ = innerAnalyzers.elements(); while (enum_.hasMoreElements()) { ClassAnalyzer classAna = (ClassAnalyzer) enum_.nextElement(); if (classAna.getParent()...
4
@SuppressWarnings("unchecked") ArrayList new52() /* reduce ANonTerminal$Classdecl */ { @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList(); @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop(); @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop(); Li...
2
private boolean implementsCustom(final Class<?> oneClass, final Class<?> customClass) { Class<?>[] interfacesImplemented = oneClass.getInterfaces(); for (Class<?> oneInterface: interfacesImplemented) { if (oneInterface.getName().equals(customClass.getName())) { return true; } } return false; }
6
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target==null) return false; if(target.fetchEffect(ID())!=null) { mob.tell(targ...
9
public void onMouseEvent(int mx, int my, int buttonPressed, boolean released) { if(buttonPressed == 0 && released && isMouseOver(mx,my)) { SoundManager.instance.playSoundFX("/assets/sounds/click.ogg", 0.5f, 1f); selected = !selected; if(group != null && selected) group.handleSelected(this); listene...
5
private void writeSubstring(Kim kim) throws JSONException { this.substringkeep.reserve(); zero(); int from = 0; int thru = kim.length; int until = thru - JSONzip.minSubstringLength; int previousFrom = none; int previousThru = 0; // Find a substring from the subst...
9
void injectKey(int new_key, boolean shift_pressed, boolean ctrl_pressed, boolean alt_pressed, boolean command_pressed) throws AWTException { // create Robot instance if necessary if (robot == null){ robot = new Robot(); } // use upper c...
9
public void render(GameContainer container, Graphics g) { g.setFont(container.getDefaultFont()); g.setColor((isActive() ? new Color(0f, 0f, 0f, 0.70f) : new Color(0f, 0f, 0f, 0.65f))); if(isRadial) g.fill(new Circle(getX() + (getWidth() / 2), getY() + (getHeight() / 2), getWidth() / 2, getHeight() / 2)); ...
5
public double[] distributionForInstance(Instance inst) throws Exception { double[] newDist = new double[inst.numClasses()]; if (m_FirstSuccessor == null) { for (int i = 0; i < inst.numClasses(); i++) { if (m_Range.isInRange(i)) { newDist[i] = 1; } } return newDist; ...
7
public void buscarPorCodigo(String codigo) { DefaultTableModel modelo = crearCabecerasTabla(); for (clsPersona p : lstPersonas) { if (p.getCodigo() == Integer.parseInt(codigo)) { crearFila(p,modelo); } } tablaRegistrar.setModel(modelo); }
2
@Override public void load() throws DataLoadFailedException { permissions.clear(); options.clear(); debug = false; List<String> list = yamlConfiguration.getStringList("permissions"); LinkedList<String> global = new LinkedList<String>(); for (String l : list) { ...
4
public void run() { // while thread is alive continue always! while ( true ) { synchronized (this) { // check if thread is paused... while ( threadPause ) { try { // ...and keep it waiting, as long as paused wait (); } ...
5
public Expr evaluate(IEvaluationContext context, Expr[] args) throws ExprException { assertMinArgCount(args, 4); assertMaxArgCount(args, 5); double cost = asDouble(context, args[0], true); if (cost < 0) return ExprError.NUM; double salvage = asDouble(cont...
7
@Override public void actionPerformed(ActionEvent e) { if (x == load_x && y > a.ir.y && y < a.ir.y + 170) { // loading gold, right island if (currentgold + 5 <= maxcapacity && a.ir.goldcount > 0) { currentgold += 5; a.ir.goldcount -= 5; } } els...
9
public void actionPerformed(ActionEvent e){ // reset counts for (int i = 0; i < 26; i++){ counts[i]=0; } try { // create file input stream Scanner input = new Scanner(new File(jtf.getText().trim())); while (input.hasNext()){ String line = input.nextLine(); for (int i...
5
public <L extends Layer> L layer(Class<L> cl) { checkerr(); for (Layer l : layers) { if (cl.isInstance(l)) return (cl.cast(l)); } return (null); }
2
public WhileStatement(Tree condition, Tree body){ this.condition = condition; this.body = body; this.labelFirst = Tree.getNextLabel(); this.labelLast = Tree.getNextLabel(); ArrayList<Tree> loopControlStatements = findLoopControlStatements(); for (ListIterator<Tree> iter = loopControlStatements.list...
1
public FindSSCsInGraph(int numNodes, String filename) throws IOException { originalGraph = new HashMap<Integer, LinkedList<Integer>>(); reversedGraph = new HashMap<Integer, LinkedList<Integer>>(); nodesStatus = new BitSet(numNodes); nodesFinishtime = new int[numNodes]; nodesSortedbyFt = new int[numNodes]; n...
1
public void test_08() { initSnpEffPredictor(); // Read CDS (hg37, chromosome Y) from a file and store them indexed by transcript ID HashMap<String, String> cdsByTrId = new HashMap<String, String>(); String cdsY = Gpr.readFile("./tests/cds_hg37_chrY.txt"); String lines[] = cdsY.split("\n"); for (String line...
7
public Group finalPath(double xWidth, double yHeight) { Group finalPath = new Group(); int intxWidth = Double.valueOf(xWidth).intValue(); int intyHeight = Double.valueOf(yHeight).intValue(); Dimension[] pathCoordinates = { new Dimension(intxWidth, 7 * intyHeight), new Dimension(7 * intxWidth, intyHeig...
6
private boolean hayAlgunJugadorQueCedaLugar() { for (Jugador inscripto : inscriptos) { if(inscripto.dejaLugarAOtro()){ return true; } } return false; }
2
public static void main(String[] args) { /* * We'll just use this class for testing our ccde. * We'll provide input and get some output... */ //Low-level modules Employee emp1 = new HourlyPlusIncentiveEmployee(10.50, 2020); Employee emp2 = new SalariedEmployee...
1
@Override public byte[] write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) { Integer lengthTemp = lengthUnit.write(out, ptc, thread, serverToClient); if(lengthTemp == null) { return null; } if(lengthTemp*3 != length) { ptc.printLogMessage("Error writin...
6
@Override public void run() { // TODO Auto-generated method stub System.out.println("testing1:you are there in the serve"); while (!(StringConstants.ip != null && StringConstants.ip_config != null && StringConstants.MasterDir != null && StringConstants.servername != null && StringConstants.Downlo...
9
public static GlobalStats getGlobalStats(){ double LOCLimits=0; double LOCBalance=0; int LOCNumber=0; double LoanBalance=0; int LoanNumber=0; double CheckingBalance=0; int CheckingNumber=0; double CDBalance = 0; int CDNumber=0; double SavingsBalance=0; int SavingsNumber=0; for (BasicAccount a : accounts.values...
6
@Override public void mouseClicked(MouseEvent arg0) { JTable tab = (JTable)arg0.getSource(); int row = tab.getSelectedRow(); int column = tab.getSelectedColumn(); if(tab.equals(tblFav)){ if(column == 0){; Recipe rec = favList.get(row); createRecipeFrame(rec); } else { Recipe rec = favList.get...
7
static void writeCSV(String sFileName, String text) { try { boolean writeHeader = false; File csv = new File(sFileName); if (!csv.exists()) writeHeader = true; FileWriter writer = new FileWriter(csv, true); if (writeHeader) writer.append("NN_Path;Learn_Path;WeigthMatrix;LearningRate;MaxIter...
3
@Override public void visitImport(XTreeImport _import) { XCodeGen code = getCode(_import); for (XTreeImportEntry importEntry : _import.imports) { String importName = importEntry._import.name; XTreeIdent name = importEntry.as == null ? importEntry._import : importEntry.as; String asName = name.name; int...
6
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
8
private void cmdPegarItem(String item) throws Exception { Sala sala = salas[salaAtual]; List<Item> itens = sala.getItens(); for(Item i : itens){ if(item.equalsIgnoreCase(i.getDescricao())){ if(i instanceof Chave) jogador.setChave((Chave) i); if(i instanceof Arma) jogador.setArma((Arma) i);...
5
public static void main(String[] args){ mainWindow = new FramesRuner(); mainWindow.runMainFrame(); // MainFrame.getInstance().setVisible(true); }
0
private static InetAddressNode create(Enumeration<InetAddress> addresses) { if (!addresses.hasMoreElements()) throw new IllegalArgumentException(); InetAddressNode first = null; InetAddressNode prev = null; InetAddressNode node = null; int count = 0; while (addresses.hasMoreElements()) { InetA...
5
public void Update(float delta) { for(GameComponent component : m_components) component.Update(delta); }
1
public ArithmeticQuantity(double value, Unit unit) { super(value, unit); if(!Distance.class.isInstance(unit) && !Volume.class.isInstance(unit)) { throw new RuntimeException("Cannot create ArithmeticQuantity with unit " + unit); } }
2
public void removeImageData(Rectangle rect, boolean autoRemove){ ImageData match = null; for(Iterator<ImageData> it = imgs.iterator(); it.hasNext();){ ImageData iData = it.next(); if (rect.equals(iData.getRect())){ match = iData; JPanel p = (JPanel) iData.getButton().getParent(); p.remove(iData.ge...
7
private WorkerWish getBestWorkerWish(AIUnit aiUnit, java.util.Map<UnitType, List<Wish>> workerWishes) { final Unit unit = aiUnit.getUnit(); List<Wish> wishList = workerWishes.get(unit.getType()); WorkerWish nonTransported = null; WorkerWish transported = null; float best...
6
final int[][] method3047(int i, int i_7_) { anInt9434++; int[][] is = ((Class348_Sub40) this).aClass322_7033.method2557(-111, i); if (i_7_ != -1564599039) method3140(72, -13); if (((Class322) ((Class348_Sub40) this).aClass322_7033).aBoolean4035) { int[] is_8_ = this.method3048(-1 + i & Class299_Sub2....
5
public Rectangle findSling() { if (_sling != null) return _sling; // use the highest sling typed component int minY = 999999; ConnectedComponent sling = null; for (ConnectedComponent c : _components) { int top = c.boundingBox()[1]; if ...
5
public String parse(){ final StringBuffer result = new StringBuffer(text.length()*2); //乘以多少可以再看 XmlTree xmltree = new XmlTree(); lines = text.split("\n"); //初始化每行的lv linelvs = new int[lines.length+1]; //+1是为了应对最后一行 int i=0; for( ;i<lines.length; i++){ linelvs[i] = getLineLevel(lines[i]); } l...
8
@Override public LngLatAlt deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonArray data = json.getAsJsonArray(); LngLatAlt node = new LngLatAlt(); node.setLongitude(data.get(0).getAsDouble()); node.setLatitude(data.get(1).getAsDouble()); if (da...
1
public void create(Usuario usuario) throws PreexistingEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); em.persist(usuario); em.getTransaction().commit(); } catch (Exception ex) { ...
3
public XMLElement getChild(String name) { // The first matching child will be kept here Node child = null; // Iterate over all the child nodes for (Node node : new NodeListIterator<Node>(element.getChildNodes()).toIterable()) { // Look for Element instances that match the ...
5
protected void extendColumnWithShape(final int height, final int[] colIndexs, final int rowIndex, final Class<? extends Shape> type) { if (Size.DEFAULT_HEIGHT < height) { final int count = height / Size.DEFAULT_HEIGHT - 1; for (int i = 0; i < coun...
6
@Override public void run() { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); brea...
8
public void visitReturnExprStmt(final ReturnExprStmt stmt) { if (CodeGenerator.DEBUG) { System.out.println("code for " + stmt); } stmt.visitChildren(this); genPostponed(stmt); final Type type = stmt.expr().type(); // Stack should be empty after return if (type.isReference()) { method.addInstruc...
6
private StreamTokenizer getTokenizer() throws IOException { if ( !new File( this.getFilename() ).exists() ) { throw new IOException( this.getFilename() + " does not exist!" ); } if ( this.getEncoding() != null ) { this.reader = new InputStrea...
2
public CheckResultMessage checkL6(int day) { return checkReport.checkL6(day); }
0
public static <T extends User> Integer compareProperties(T t1, T t2) throws Exception{ for(String name: t1.fieldsToCompare()){ logger.info("comparing property {} ",name); Object property1 = PropertyUtils.getProperty(t1, name); Object property2 = PropertyUtils.getProperty(t2, name); if (property1...
8
public void GenMostScore() { Object[] keys = Environment.RoomManager.GetRooms().values().toArray(); Room[] Rooms=new Room[keys.length];int[]Scores=new int[keys.length]; int row = 0; for (int a = 0; a < keys.length; a++) { Room Current = (Room) keys[a]; ...
9
public void reCompute() { short x = inputPins[0].get(); // 16 bit d input short y = inputPins[1].get(); // 16 bit m/a input short zx = inputPins[2].get(); // 1 bit flag short nx = inputPins[3].get(); // 1 bit flag short zy = inputPins[4].get(); // 1 bit flag short ny = in...
7
public void emit(String event, Object... args) { List<EventHandler> handlers = listeners(event); if (handlers == null || handlers.size() == 0) { if (!event.equals("error")) return; StringBuilder sb = new StringBuilder("error"); if (args.length > 0) sb.append(":"); for (Object arg : args) s...
8
@Override public void update(PositionChangedObservable observable) { if(observable.getPositions().contains(position)) { System.out.println(this + " " + observable + " " + incomingElement); addHoveringElement(observable); if(observable != incomingElement) observable.accept(new CollideWithTeleporterVisito...
2
public Direction flipped() { switch (this) { case NORTH: return SOUTH; case SOUTH: return NORTH; case EAST: return WEST; case WEST: return EAST; default: return null; } }
4
public static String[] verifyDateTimeArguments(String[] args) throws Exception { if (null == args) throw new IncorrectNoOfArgumentsException(3); if (!(args.length == 3 || args.length == 6)) throw new IncorrectNoOfArgumentsException("3 or 6"); String d[] = verifyDateArguments(new String[] { args[0], args[1], args...
5
public void setPitch( float p ) { // Make sure there is a pan control if( sampleRateControl == null ) { return; } float sampleRate = p; // make sure the value is valid (between 0.5f and 2.0f) if( sampleRate < 0.5f ) sampleRate = 0.5f; ...
3
public ITicketPool getPool() { return this._pool; }
0
void refresh() { int n = view.getModel().getNumberOfParticles(); if (n > viewer.getAtomCount()) n = viewer.getAtomCount(); Atom at; int argb = 0; float sigma = 0; for (int i = 0; i < n; i++) { at = view.atom[i]; if (at.isVisible()) { sigma = getCurrentSigma(at); if (view.model instanceof Re...
8
public Object[][] bacaDaftar(){ boolean adaKesalahan = false; Connection cn = null; Object[][] daftarPembeli = new Object[0][0]; try{ Class.forName(Koneksi.driver); } catch (Exception ex){ adaKesalahan = true; JOptionPane.showMessageDialog(null...
7
private void imprimir_acciones_de_parsing(Stack pila, Token tokenReconocido) { //Parsing Stack System.out.print(padRight(new StringBuilder("$ ").append(pila.toString().replaceAll("\\[", "").replaceAll("]", "").replaceAll(",", "")).toString(), 135)); //Input System.out.print(padRight(tok...
6
private void setupPlayer(String filename) { try { InputStream is = getClass().getResource(filename).openStream(); if(filename.contains("music/")){ musicPlayer = new AdvancedPlayer(is, createAudioDevice()); } else if(filename.conta...
4
public String toString() { String string = "#< " + factory.getCache().tableName(type); if (extendsModels()) { string += " inherits ("; Set<Class> sup = supers.keySet(); boolean first = true; for (Class s : sup) { string += first ? "" : ", "; string += " "+ factory.getCache().tableN...
7
private boolean isLayoutClass(SootClass theClass) { if (theClass == null) return false; // To make sure that nothing all wonky is going on here, we // check the hierarchy to find the android view class boolean found = false; for (SootClass parent : Scene.v().getActiveHierarchy().getSuperclas...
3
private void registerAsParent() { if (children != null) { for (int i = 0; i < children.capacity(); i++) { TrieNode<S, T> c = children.valueAt( i ); if (c != null) { c.parent = this; } } } }
3
public static Commercial selectCommercialById(int id) throws SQLException { String query = null; Commercial Util = new Commercial(); ResultSet resultat; try { query = "SELECT * from COMMERCIAL where ID_COMMERCIAL=? "; PreparedStatement pStatement = ConnectionBD...
2
public void setOnline() { lastSignal = System.currentTimeMillis(); }
0
public boolean repExists(long zobrist) { int hashkey = (int) (zobrist % HASHSIZE); if (hashtable[hashkey] == 0) return false; else if (hashtable[hashkey] == zobrist) return true; for (int i = 1; i < HASHSIZE; i++) { if (hashtable[(hashkey + i) % HASHSIZE] == 0) { return false; } else if (hasht...
5
private void initialize() { setAutoCreateColumnsFromModel(true); setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); setPreferredScrollableViewportSize(getPreferredSize()); setFillsViewportHeight(true); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); DefaultTableCellRenderer rightRenderer = new...
0
public void handleInput() { /* * if (Keys.isPressed(Keys.ENTER) && currentChoice == 1) { * sfx.get("bump").play(); return; } */ if (Keys.isPressed(Keys.ENTER) /* && currentChoice != 1 */) { sfx.get("menuselect").play(); System.out.println("Handled Enter"); select(); } else if (Keys.isPressed(Key...
5
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException{ ObjectInputStream inputStream = new ObjectInputStream( new BufferedInputStream(new FileInputStream( "D:\\darshan\\temp\\FinalIndexLexicon"))); Lexicon lexicon = (Lexicon) inputStream .readObjec...
9
protected void onServerPing(String response) { this.sendRawLine("PONG " + response); }
0
@Override public Resource objectToJena(Model toAddTo, Alert alert) throws IllegalArgumentException { if (alert.getResourceURL() == null) { throw new IllegalArgumentException(String.format(msg_ResourceWithoutURI, "alerts")); } Resource res = toAddTo.createResource(alert.getResourceURL().toString()); toAdd...
6
public synchronized void linstep(int id, int frame, int l) { boolean isplayer = isplayerid(id); Gob g = getgob(id, frame); if (g == null) return; Moving m = g.getattr(Moving.class); if ((m == null) || !(m instanceof LinMove)) return; LinMove lm = (...
7
@Override public Boolean value(final Long input) { if (input < this._primes.get(1L)) return false; long largestKnownPrime = this._primes.size(); largestKnownPrime = this._primes.get(largestKnownPrime); if (largestKnownPrime <= input) { for (long pc = largestKn...
6
public AbstractFullTestClass(){ mapWithAnnot = new HashMap<Integer, String>(); iterableWithAnnot = new IdentityArrayList<String>(); int i = 0; while (i<5){ mapWithAnnot.put(i, "e"+i); iterableWithAnnot.add("e"+i); i++; } }
1
@SuppressWarnings("rawtypes") private void runDemo(String demoKey) { Class demo = this.demos.get(demoKey); Method mainMethod = null; for(Method method: demo.getMethods()) { if(method.getName().equals("main")) { mainMethod = method; break; } } System.out.println("Running " + demo.getNam...
6
public void addEdge(Object from, Object to) { adjacent(from).add(to); }
0
public final static URL getMbRecordingsOfRelease(String releaseID) throws MusicbrainzUrlException { if(releaseID == null || releaseID.equals("")) throw new MusicbrainzUrlException("The releaseID is null or empty"); URL url= null; URI uri= null; try { uri= new URI("http","www.musicbrainz.o...
6
private void enlarge() { if (Math.random() >= 0.5) { width++; } if (Math.random() >= 0.5) { height++; } }
2
public void incrementTime(int minutesToIncrement) { rawMinutes += minutesToIncrement; minute += minutesToIncrement; while(minute >= 60) { hour++; minute-=60; } while(hour >=24) { day++; hour-=24; } }
2
public HashMap<String, Integer> getSpillCosts() { HashMap<String, Integer> spillCosts = new HashMap<String, Integer>(); for(int i = 0; i < lines.size(); i++) { String[] lineParams = lines.get(i).split(","); if(lineParams[0].replaceAll("\\s", "").contains("br")) loopDepth++; if(lineParams.length > 3 ...
6
private void handleRemoveListeners() { for (Object listener : listenersToBeRemoved) { if (listener instanceof EntityHealthListener) { healthListeners.remove(listener); } else if (listener instanceof DeathListener) { deathListeners.remove(listener); } else if (listener instanceof EntityAttributeListen...
5
private static By newSelector(SelectorType selectorType, String selector) { switch (selectorType) { case className: return By.className(selector); case cssSelector: return By.cssSelector(selector); case id: return By.id(selector...
8