text
stringlengths
14
410k
label
int32
0
9
private void flushResponse() { try { if (!ctx.getChannel().isOpen()) { System.err.println("channel is closed, channel: " + ctx.getChannel()); ctx.getChannel().disconnect(); ctx.getChannel().close(); return; } // mymod. WebbitException: cannot send more responses than re...
5
public <T extends Component> void addComponent(UUID entity, T component) { if (frozen) { return; } synchronized (componentStores) { HashMap<UUID, ? extends Component> store = componentStores .get(component.getClass()); if (store == null) ...
3
public boolean executeLine(String line) { if (first && (line.equals("ditaa") || line.startsWith("ditaa("))) { data = new StringBuilder(); if (line.contains("-E") || line.contains("--no-separation")) { performSeparationOfCommonEdges = false; } if (line.contains("-S") || line.contains("--no-shadows")) {...
8
public static String classDescriptor(String name) { // The name of the class may arrive as the name of the class file // in which in resides. In this case, we should remove the .class // file extension. if (name.endsWith(".class")) { name = name.substring(0, name.lastIndexOf('.')); } name = name.replace...
2
public static String vectorCaddieToHTML(Vector<Caddie> rs){ if (rs.isEmpty()) return "<p class=\"plusbas\">Le caddie est vide.</p>"; String toReturn = "<TABLE BORDER='1' width=\"1000\">"; toReturn+="<CAPTION>Le caddie :</CAPTION>"; toReturn+="<TR>"; toReturn+="<TH> <i>Reservation n°</i></TH>"; toRet...
3
@Override public boolean modificarCliente(TCliente cliente) { boolean correcto = false; TransactionManager.obtenerInstanacia().nuevaTransaccion(); try { TransactionManager.obtenerInstanacia().getTransaccion().start(); TCliente tCliente = Factor...
6
@Override public void setEntityManager(IEntityManager<? extends IEntityTracker> entityManager) { if(!this.finalized) { if(entityManager instanceof IPluggable) this.entityManager = entityManager; else throw new UnsupportedOperationException("The EntityManager does not implement IPluggable!"); } else throw n...
3
public Image getImage() { if(image == null) { try { image = new Image("res/sprites/items/" + getItemID() + ".png"); } catch (SlickException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return image; }
2
public int saveBook(Book bookToSave) { try { // Erforderlicher SQL-Befehl String sqlStatement = "INSERT INTO bookworm_database.books (isbn, title, author, " + "publicationDate, formatb, shortDescription, category, " + "commentb, readb) VALUES ('" + bookToSave.getIsbn() + "', '" + bookT...
1
public String[] getLastSenders() { return previousSenders; }
0
private void checkForWhite(int i, int j) { gameBoard.step(blockBoard[i][j]); // Checks that block is blank & 0 n if (blockBoard[i][j] instanceof Blank) { boardButtons[i][j].setVisible(false); blockBoard[i][j].setAlreadyChecked(true); for (int a = i - 1; a <= i + 1; a++) { for (int b = j - 1; b <=...
8
public void doAnswer(AnswerSide answerSide) { if (this.answerSide == answerSide || isRunning) return; isRunning = true; AnswerSideManager answerSideManager = AnswerSideManager.getInstance(); answerSideManager.setAnswerSide(answerSide); PriceManager priceManager =...
4
@Override public void tickServer() { super.tickServer(); if (needsInit) { needsInit = false; for (WorldCoordinate pair : getPairs()) { SignalController controller = getControllerAt(pair); if (controller != null) { onControll...
3
@Override public boolean generateClientSettings(final File settingsFile) { LOG.log(Level.FINE, "Generating client settings."); final SimpleXMLSettingsFile xml = new SimpleXMLSettingsFile(); boolean result = false; try { final Enumeration<NetworkInterface> ne...
5
public RenderTable wrapper(final GraphReportExtension mr) { GraphModelIterator it; if (!gens.equals(GeneratorFilters.NoGenerator)) { it = new GraphGeneratorIterator(gens); } else { it = new AllGraphIterator(type,size,part); } ToCall f = new ToCall() { ...
9
public static void main(String[] args) { try { List<String> warnings = new ArrayList<String>(); boolean overwrite = true; File configFile = new File(ClassLoader.getSystemResource(runXMLAUTHORITY).getFile()); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConf...
6
public Builder name(String receivedName) { if (receivedName == null || receivedName.equals("")) { log.warn("Wrong Name. receivedName ={}", name); throw new IllegalArgumentException("name must be not null. Received value = " + receivedName); } this.nam...
2
private List<Area> createAreas(CodelTableModel model) { List<Segment> segments = getSegmentsAtRow(model, 0); if (segments == null) { return null; } List<Area> areas = new ArrayList<Area>(); for (Segment segment : segments) { Area area = n...
8
@Override public List<String> getSuggestions(CommandInvocation invocation) { List<String> result = new ArrayList<>(); Class completerClass = parameter.getProperty(Properties.COMPLETER); if (completerClass == null) { completerClass = parameter.getType(); } ...
2
public void shootshing() { if (waitforshoot <= 0 && shoottwice == 30) { getWorld().addObject(new sting(), getX(), getY()); shoottwice--; } else if (shoottwice != 30 && shoottwice > 0) { shoottwice--; } else if (shoottwice <= 0) { ge...
6
public static double ValueCoherentNoise3D (double x, double y, double z, int seed, NoiseQuality noiseQuality) { // Create a unit-length cube aligned along an integer boundary. This cube // surrounds the input point. int x0 = (x > 0.0? (int)x: (int)x - 1); int x1 = x0 + 1; int ...
6
@Override public void mousePressed(MouseEvent m) { Wall newWall; if(m.getButton() == 1){//front click newWall = new Wall(new Point2D.Double(m.getX(), m.getY()), Wall.Orientation.HORIZONTAL); } else{ newWall = new Wall(new Point2D.Double(m.getX(), m.getY()), Wall.Orientation.VERTICAL); } for(Wall wall...
4
public CategorieMotClef findCategorieOf(MotClef mot) { for (CategorieMotClef c : categories) { for (MotClef m : c.getMotClefs()) { if (m.equals(mot)) { return c; } } } return null; }
3
private double[] getMinMax() { double[] minmax = new double[4]; double minX; double maxX; double minY; double maxY; try { String sql = "SELECT (\n" + " SELECT MIN([start-x-coord])\n" + " FROM correctedCo...
2
@Override public boolean extensionExists(String ext) { Iterator it = getExtensions(); while (it.hasNext()) { String key = (String) it.next(); if (ext.equals(key)) { return true; } } return false; }
2
public void setDayStored (Day d) { dayStored = new Day (d); }
0
public static boolean checkStatementExceptions(List<Statement> lst) { Set<Statement> all = new HashSet<>(lst); Set<Statement> handlers = new HashSet<>(); Set<Statement> intersection = null; for (Statement stat : lst) { Set<Statement> setNew = stat.getNeighboursSet(StatEdge.TYPE_EXCEPTION, State...
8
public VuePraticiens getVue() { return vue; }
0
static public void main(String args[]) { double x, y; Random rand = new Random(); String prefixletter = "ABCDEFGHJKLMNOPQRSTUVWXYZ"; double sumx, sumx2; int nsum; OSNI osni = new OSNI(); osni.setErrorTolerance(0.0001); nsum = 0; sumx = sumx2 = 0.0; for (int i = 0; i < 10000; i++) { x = 100000...
6
static void runParser(String inPath, String outPath) { String cs; try { // open a star file, read it in cs = readFile(inPath); } catch (IOException e) { print("sorry, unable to read file. aborting"); System.exit(2); return; // what? why do I need a return here? why isn't System.exit enough? }...
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PhpposPermissionsEntityPK that = (PhpposPermissionsEntityPK) o; if (personId != that.personId) return false; if (moduleId != null ? !moduleId.e...
6
public void edit(Applicant applicant) throws NonexistentEntityException, RollbackFailureException, Exception { EntityManager em = null; try { utx.begin(); em = getEntityManager(); applicant = em.merge(applicant); utx.commit(); } catch (Exception ex...
6
public void updateGame() { //System.out.println(gameWorld.getDrawableActorGroup().getBulletGroup().getList().size()); PlaneGroup planeGroup = gameWorld.getDrawableActorGroup().getPlaneGroup(); UserPlane up = planeGroup.getUserPlane(); if(up == null) { //you have lost the game, restart? } else { g...
6
public List<Recipe> search(String search){ Document doc = null; try { doc = Jsoup.connect("http://www.recept.nu/search?searchtext="+search+"&orderby=relevance").get(); } catch (IOException ex) { Logger.getLogger(RecipeSearch.class.getName()).log(Level.SEVERE, null, ex); ...
4
public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) { Rectangle alloc = bounds.getBounds(); // Set up translucency if necessary. Graphics2D g2d = (Graphics2D)g; Composite originalComposite = null; if (getAlpha()<1.0f) { originalComposite = g2d.getComposite(); g2d.s...
6
public StackSentence( StackSentence parent, int newWord, int[] sourceSentence, Dictionary dict, LanguageModel langMod, LengthModel lenMod) { if(parent == null){ words = new int[1]; } else { words = new int[parent.words.length + 1]; System.arraycopy(parent.words, 0, words, 0, parent.words.length); ...
6
public void waitForPeersToPopulate() { while (!peersPopulated) { while (manager.peers.size() < 1) try { Thread.sleep(10L); } catch (InterruptedException e) {} for (Peer p : manager.peers) { if (p.availablePieces.size() > 0) { this.peersPopulated = true; break; } } } }
5
private boolean isBlocked(int x, int y, int i, int j) { int delta[] = {x, y}; int next[] = {i, j}; int block[] = new int[2]; int k; for(k = 0; k < 2; k++) { delta[k] -= next[k]; block[k] = next[k]-delta[k]; } // it is blocked if it is ...
6
@EventHandler public void MagmaCubeSpeed(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.getMagmaCubeConfig().getDouble("MagmaCube....
6
private Combo findChunk(int index) { boolean b = true; boolean startFirst = startFirst(index); int count; Chunk current; // This isn't 100% optimal, because the size of the chunks can be different, but it's not bad anyway if (startFirst) { count = 0; current = firstChunk; } else { cou...
6
public void debug(String s) { getConnectionProcessor().get_logger().debug(StringUtils.shortName(getClass()) + s); }
0
public void sendState(int currentState, int activeDrum) { //System.out.println("STATE:" + currentState); long milliTime = (long)(parent.getCurrentUnixTime()); for(Observer o : StateListeners) { o.update("STATE;"+String.valueOf(currentState)+";"+String.valueOf(milliTime));...
3
public void setZugZuende(Boolean b) { zugZuende = b; }
0
public void agregarEntidad(final Long cantidad, final String nombre, final Double precioUnitario) { if (DAO.listarEntidades() == null) { //Si no hay entidades se creará una arreglo que las contendrá DAO.setEntidades(new ArrayList<Entidad>()); } DAO.agregarEntidad(new Entidad(canti...
1
@Before public void setUp() { try { clientProxy = AqWsFactory.newAqAcqClient(TestContext.AcquisitionServiceUrl, TestContext.User, TestContext.Pwd); } catch(Exception ex) { fail("setUp failed: " + ex.toString()); } }
1
public int compareTo(HotTestDetails comp) { int result = 0; if (m_minimize) { if (m_merit == comp.m_merit) { // larger support is better if (m_support == comp.m_support) { } else if (m_support > comp.m_support) { result = -1; } else...
9
public static void main(String[] args) { int[][] arr = {{59},{73,41},{52,40,9},{26,53,6,34},{10,51,87,86,81},{61,5,66,57,25,68},{90,81,80,38,92,67,73},{30,28,51,76,81,18,75,44},{84,14,95,87,62,81,17,78,58},{21,46,71,58,2,79,62,39,31,9},{56,34,35,53,78,31,81,18,90,93,15},{78,53,4,21,84,93,32,13,97,11,37,51},{45,3,8...
6
public void rotate(double angle, int axis) { if (axis != X_AXIS && axis != Y_AXIS && axis != Z_AXIS) return; double cosAngle = Math.cos(angle); double sinAngle = Math.sin(angle); double xNew, yNew, zNew; switch (axis) { case X_AXIS: yNew = y * cosAngle + z * sinAngle; zNew = -y * sinAngle ...
6
public void clearHalt () throws IOException { if ("bulk" != getType ()) throw new IllegalArgumentException (); // this affects the USB data toggle and other HCD state, // otherwise we could issue control requests directly if (spi == null) spi = iface.getDevice ().getSPI (); spi.clearHalt ((byte) (0...
2
public static List<String> getStringListValue(String nodeValue) { List<String> values = new ArrayList<String>(); for(String part : nodeValue.split(",")) { String value = part.trim(); if(value.isEmpty()) continue; values.add(value); } return Collections.unmodifiableList(values); }
2
static double log2ScaleExp(double[] xs) { if (xs.length == 0) return 0.0; double max = xs[0]; for (int i = 1; i < xs.length; ++i) if (max < xs[i]) max = xs[i]; if (max < 0.0 || max > 1.0) { String msg = "Max must be >= 0 and <= 1." + " Found max=" ...
9
protected static Item possibleContainer(MOB mob, List<String> commands, boolean withStuff, Filterer<Environmental> filter) { if((commands==null)||(commands.size()<2)) return null; final String possibleContainerID=commands.get(commands.size()-1); final Environmental thisThang=mob.location().fetchFromMOBRoomFa...
7
private void readyForTermination() { addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { currentState.processKeyPressed(e); int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_ESCAPE ...
3
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
public static int longestValidParentheses(String s) { String[] parts = s.split(""); int len = parts.length; int[] position = new int[len-1]; int left = 0; Stack<Integer> right = new Stack<Integer>(); for(int i=1;i<len;i++) { position[i-1] = -1; if(parts[i].equals("(")) { left++; ri...
8
public void paintComponent(Graphics g) { BufferedImage spriteSheet = null,engine; BufferedImageLoader loader = new BufferedImageLoader(); try { spriteSheet = loader.loadImage("images/Ship_Shop/shipshopparts.png"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(...
7
private void handleInput(){ camera.doKeyboardControl(); camera.doMouseControl(); while (Keyboard.next()){ if (Keyboard.getEventKey() == Keyboard.KEY_Q){ System.exit(0); } } while (Mouse.next()){ if (Mouse.getEventButtonState() && Mouse.getEventButton() == 2){ Mouse.setGrabbed(!Mouse.isGr...
5
protected void setList(List list) throws IteratorException { this.list = list; if (list != null) { listIterator = list.listIterator(); } else { throw new IteratorException(); } }
1
public void setMinValue(double minValue, boolean filterArchivedValues) throws IOException, RrdException { double maxValue = this.maxValue.get(); if(!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new RrdException("Invalid min/max values: " + minValue + "/" + maxValue); } ...
6
private static void renameAndTrimBackups() { File directory = new File(DatabaseWrapper.storagePath + "Backup/"); ArrayList<Path> paths = new ArrayList<>(); if (!directory.exists()) { try { Files.createDirectory(directory.toPath()); } catch (IOException ex) { Logger.getLogger(AwanaDatabase.class.getN...
7
public static HashMap<String, Profile> loadProfiles() { LOGGER.log(Level.INFO, "Loading player profiles.."); HashMap<String, Profile> profiles = new HashMap<String, Profile>(); File[] proFiles = new File("profiles").listFiles(); for (File file : proFiles) { try { ...
4
@Override public Iterator<T> iterator() { return new Iterator<T>(){ private int pos = 0; public boolean hasNext() { return pos < size; } @SuppressWarnings("unchecked") public T next() { if(hasNext()) return (T)array[pos++]; else throw new NoSuchElementException("Pas de suivant"...
3
public void populateTasks(File tasks) { try { Scanner fileInput = new Scanner(tasks); int level = 0; char group = 0; String name = ""; String token = ""; while (fileInput.hasNextLine()) { token = fileInput.next(); if (!token.equals("")) name = token; ...
5
private void printBuffersStatus() { System.out.println("{sendBuffer:" + sendBuffer.size() + " receiveBuffer:" + receiveBuffer.size() + " inputQueue:" + inputQueue.size() + "}"); System.out.println("------------------------------------------------"); }
0
protected boolean checkCDATA(StringBuffer buf) throws IOException { char ch = this.readChar(); if (ch != '[') { this.unreadChar(ch); this.skipSpecialTag(0); return false; } else if (! this.checkLiteral("CDATA[")) { //$NON-NLS-1$ this.sk...
9
public Integer getId() { return id; }
0
public boolean isValidKill(Player p){ String pName = p.getName().toLowerCase(); if(this.recentKills.containsKey(pName)){ long lastKill = recentKills.get(pName); if(lastKill + 60000 > System.currentTimeMillis()){ //Killed them in the last 60 seconds. return false; } } Player m = this.getPl...
6
public JTextField getjTextFieldNom() { return jTextFieldNom; }
0
public void update(float delta) { System.out.println(x+" "+y); if(moving) { progress=Math.min(1, progress+speed*delta); } if(progress==1) { progress=0; moving=false; switch(dir) { case NORTH: y--; break; case SOUTH: y++; break; case WEST: x--; break; case ...
6
private void BroadcastAddMember(final DataPacket<AddMember> dp) { //TODO delete after test System.out.println("BroadCast AddMember begin"); String peopleOnline = ""; String peopleOffline = ""; String senderIdentity = dp.getLog().getidentity(); AddMember newMember = dp.getContent(); ArrayList<String> membe...
8
public final char[] signature() /* (ILjava/lang/Thread;)Ljava/lang/Object; */ { if (signature != null) return signature; StringBuffer buffer = new StringBuffer(parameters.length + 1 * 20); buffer.append('('); TypeBinding[] targetParameters = this.parameters; boolean isConstructor = isConstructor(); // if (isCo...
7
public static void unjar(File jarFile, File directory) { JarFile jfile; try { jfile = new JarFile(jarFile); final Enumeration<? extends JarEntry> entries = jfile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); final File file = new File(directory...
4
public boolean equals(Object o) { if (!(o instanceof ContactImpl)) { return false; } else { ContactImpl contact = (ContactImpl) o; if (firstName.equals(contact.firstName) && lastName.equals(contact.lastName) && organization.equa...
5
public boolean allowMove(int dx, int dy) { int nx = x + dx; int ny = y + dy; int nx2 = x2 + dx; int ny2 = y2 + dy; int i; for (i = 0; i != sim.elmList.size(); i++) { CircuitElm ce = sim.getElm(i); if (ce.x == nx && ce.y == ny && ce.x2 == nx2 && ce....
9
public EssenceOfDeath(boolean isFullscreen, int newWidth, int newHeight) { try { add(new Board(this, isFullscreen, newWidth, newHeight, 32)); } catch (IOException e) { System.out.println("Error loading Board - " + e); } setDefaultCloseOperation(JFrame.EX...
1
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Borrower)) { return false; } Borrower other = (Borrower) obj; if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(othe...
6
private GenericDAO<Project> getCustomersDAO() { if (_customersDAO == null) { _customersDAO = new GenericDAO<Project>(Project.class); } return _customersDAO; }
1
public void actionPerformed(ActionEvent e){ if (e.getSource() == newButton){ newButtonClicked(e); } if (e.getSource() == showButton){ showButtonClicked(e); } if (e.getSource() == timeButton){ timeButtonClicked(e); } }
3
public TuringToGrammarConverter() { myAllReadableString=new HashSet <String>(); myAllWritableString=new HashSet <String>(); }
0
private void submitOrder(String label, OrderCommand orderCmd) throws JFException { this.order = engine.submitOrder(label, this.instrument, orderCmd, this.amount); while (order.getState() == IOrder.State.CREATED || order.getState() == IOrder.State.OPENED) { order.waitForUpdate(2, TimeUnit.SE...
3
private void handlePingResponse(Packet pingResponse) { //ignore if the ping response is null if(pingResponse == null) return; //if the ping response doesn't have a sequence number of the ping it's responding to then we can't do anything if(pingResponse.getLastReceivedSequenceNumber() == Packet.SEQUENCE_NUMB...
4
public static Image generateImage(Dataset dataset, BitSet selected, String infoString) { List<Point> points = dataset.getPoints(); float distance = dataset.getMaxDistance(); //If no bitset is provided, show all connections if(selected==null) { selected = new BitSet(points.size()); selected.set(0, point...
8
public void invalidatePacketEventsForThisEdge(Edge toDelFor){ boolean changed = false; Iterator<Event> eventIter = iterator(); while(eventIter.hasNext()){ Event eventInQueue = eventIter.next(); if(eventInQueue instanceof PacketEvent){ PacketEvent pe = (PacketEvent) eventInQueue; if(pe.packet.edge...
5
public void setScheme(int scheme) { if ((scheme == SIMPLE) || (scheme == NUMBERED) || (scheme == TIME)) { this.scheme = scheme; } else { throw new IllegalArgumentException("Invalid output strategy scheme."); } }
3
private static void setDefaults() { List<String> check = Announcements.announcements.getSubNodes( "Announcements" ); if ( !check.contains( "Global" ) ) { Announcements.announcements.setInt( "Announcements.Global.Interval", 300 ); List<String> l = new ArrayList<String>(); ...
3
public static void main(String[] args) throws IOException { final String method = CLASS_NAME + ".main()"; boolean start = Peer.start(args); if(!start) { LogUtil.log(method, "Peer not initialized properly"); return; } Set<String> filenames = FileStore.getInstance().getFilenames(); if(filenames == null...
8
public boolean execute(ChatClient sender, String[] args) { if (args.length < 2) { sender.serverChat(usage()); return true; } ChatAccount account = AccountManager.getAccount(args[1]); if (account == null) { sender.serverChat("There is no account by that name"); } StringBuilder strBuf = ne...
9
public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source == saveButton) { Dimension size = this.getSize(); BufferedImage image = (BufferedImage) this.createImage(size.width, size.height); Graphics g = imag...
9
public static void clear() { for(Stack<Edge> s : stacks.values()) { s.clear(); } stacks.clear(); if(lastStack != null) { lastStack.clear(); } lastStack = null; }
2
public void printCombs(ArrayList<ArrayList<Integer>> comb) { System.out.println("["); for (int i = 0; i < comb.size(); i++) { ArrayList<Integer> curComb = comb.get(i); System.out.print("["); for (int j = 0; j < curComb.size(); j++) { if (j == curComb.size() - 1) System.out.print(curComb.get(j)); ...
3
private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed this.anadirCliente(); }//GEN-LAST:event_btnNuevoActionPerformed
0
public boolean collide_static() { for(int i = 0; i < Fenetre._list_static_items.size(); i++) { //Ici on verifie que le rectangle de l'objet dans lequel on est collide avec un des objets de la liste static if (Fenetre._list_static_items.get(i).getSolid() && _r.intersects(Fenetre._list_static_items.get(i).getRect...
3
public static ArrayList<Vector2D> getTriangleTriangleIntersects(Triangle A, Triangle B) { ArrayList<Vector2D> intersects = new ArrayList<Vector2D>(); for (Vector2D intersect : getTriangleLineIntersects(A, B.getAB())) { intersects.add(intersect); } for (Vector2D intersect : g...
3
protected void doPrintHeader() { if (m_Header.classAttribute().isNominal()) if (m_OutputDistribution) append(" inst# actual predicted error distribution"); else append(" inst# actual predicted error prediction"); else append(" inst# actual predicted error"); if (...
7
public static Customer getCustomer(String name) { for (String s : names) { if (s.equalsIgnoreCase(name)) return new RealCustomer(name); } return new NullCustomer(); }
2
public void runToNextWalkFrame(int excuseFrames) throws CapturedByRotatoException { int startSteps = curGb.stepCount; // forward to first possible input frame while(true) { Util.runToFirstDifference(0, dir, Metric.DOWN_JOY); State s = curGb.newState(); int add2 = Util.runToAddressNoLimit(0, dir, curGb.p...
4
@Override public void applyComponent(Mat inputMat, ProcessInfo info) { Integer dilateSize = (Integer) dilateSizeSpinner.getValue(); Integer erodeSize = (Integer) erodeSizeSpinner.getValue(); int shape = Imgproc.MORPH_ELLIPSE; switch ((Shape)comboBox.getSelectedItem()) { case CIRCLE: shape = Imgproc...
5
public float abSearch(ABNode node, int depth, float a, float b, Boolean maximizingPlayer) { if(depth == 0 || node.isTerminal()) { return node.getHVal(); } if (maximizingPlayer) { for(ABNode child : node.getChildNodes(1)) { //Each child node a = Math.max(a, abSearch(child, depth -1, a, b, false)); ...
7
protected int findGridlet(Collection obj, int gridletId, int userId) { ResGridlet rgl = null; int found = -1; // means the Gridlet is not in the list try { // Search through the list to find the given Gridlet object int i = 0; Iterator iter = ...
4
public static Pet[] createArray(int size) { return creator.createArray(size); }
0