text
stringlengths
14
410k
label
int32
0
9
public static boolean validate(int index, String listAdd, char addChar) { int isParenthesis = 0; if(listAdd.length() > 0) isParenthesis = listAdd.charAt(0) == '(' ? 1 : 0; if(isOperator(addChar) && listAdd.length() > 0 + isParenthesis) if(addChar != '/') return false; if(!listAdd.contains("_") && addC...
9
public void buildFromBEDFile(File bedFile) throws IOException { intervals = new HashMap<String, List<Interval>>(); BufferedReader reader = new BufferedReader(new FileReader(bedFile)); String line = reader.readLine(); while(line != null && line.startsWith("#")) { line = reader.readLine(); } while(li...
6
private void scrapeFootball() { QBsPlaying = new ArrayList<BasketballPlayer>(); WRsPlaying = new ArrayList<BasketballPlayer>(); RBsPlaying = new ArrayList<BasketballPlayer>(); TEsPlaying = new ArrayList<BasketballPlayer>(); DSTPlaying = new ArrayList<BasketballPlayer>(); KickersPlaying = new ArrayList<Baske...
9
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("Suffix")) { if(sender instanceof Player) { Player p = (Player) sender; PlayerUtil pu = new PlayerUtil(p); if(pu.hasPermission("Nostalgia.Command.suffix", Permissio...
8
public void run() { try { enc.SetEndMarkerMode(true); if (LzmaOutputStream.LZMA_HEADER) { enc.WriteCoderProperties(out); // 5d 00 00 10 00 final long fileSize = -1; for (int i = 0; i < 8; i++) ...
6
private Class<?>[] findMeasureClasses() { AutoExpandVector<Class<?>> finalClasses = new AutoExpandVector<Class<?>>(); Class<?>[] classesFound = AutoClassDiscovery.findClassesOfType("moa.evaluation", MeasureCollection.class); for (Class<?> foundClass : classesFound) { ...
7
public synchronized void gameFinished(Player winnerPlayer, List<Player> players) { if (firstPhaseElectionTask != null) { firstPhaseElectionTask.cancel(); firstPhaseElectionTask = null; } if (secondPhaseElectionTask != null) { secondPhaseElectionTask.cancel(); secondPhaseElectionTask = null; } if ...
4
private boolean hasPermission(Player player, String node) { if ( this.permissionHandler != null ) { return this.permissionHandler.has(player, node); } else { return player.hasPermission(node); } }
1
public void loadConfig() { config = new YamlConfiguration(); createConfig(); File file = new File(getDataFolder(), "config.yml"); try { config.load(file); } catch (FileNotFoundException e) { e.printStackTrace(); Logger.warning("Could not load config, using default settings!"); } catch (IOEx...
3
@Override public void paintComponents(Graphics g) { Graphics2D graphics = (Graphics2D) g; graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setRenderingHint(Render...
1
public static Sens getSens(String s){ switch(s){ case "A": return Sens.AVANCER; case "R": return Sens.RECULER; case "G": return Sens.GAUCHE; case "D": return Sens.DROITE; default: ...
4
public boolean registerEventListener(final EventListener listener) { logger.debug("EventBus", "Registering "+listener.getClass().getName(), 0); try { for(Method method : listener.getClass().getMethods()) { EventMethod ema = method.getAnnotation(EventMethod.class); if(ema == null) continue; Class<?>[...
7
private String attack(Pawn enemy) { String message=this.letter + " attacks!\n"; if (this.board.isBonusSquare(x, y)) message+=enemy.suffer(2); else message+=enemy.suffer(1); if (enemy.isDead()) gold++; return message; }
2
public static void validate(Review review) throws ValidationMovieCatalogException { LinkedList<String> errorList = new LinkedList<>(); if (review == null) { errorList.add("Null pointer review"); } else { if(review.getUser() == null){ errorList.add("Null...
8
private static JSONObject toJSONObject(String paramName, Object o, boolean required) throws BadConfig { if (o == null) { if (required) throw new BadConfig("Parameter \"" + paramName + "\" is required"); return null; } if (!(o instanceof JSONObject)) throw new BadConfig("In parameter \"" + paramName +...
3
private boolean isNeedsEscape(String character) { if (character.matches("\\(")) { return true; } else if (character.matches("\\)")) { return true; } else if (character.matches("\\$")) { return true; } else if (character.matches("\\^")) { return true; } else if (character.matches("\\!")) { retur...
5
private String peekToken() { if (token == null) try { while (st == null || !st.hasMoreTokens()) { line = r.readLine(); if (line == null) return null; st = new StringTokenizer(line); } token = st.nextToken(); } catch (IOException e) { } return token; }
5
public static String permillage(double p1, double p2) { String str; double p3 = p1 / p2; if (p1 == 0.0) { return "0.00"; } if (p2 == 0.0 && p1 != 0.0) { return "-"; } DecimalFormat df1 = new DecimalFormat("0.00"); str = df1.format(p...
3
public static String[][] read_data_file(String file_name) { String[][] matrix = null; try { BufferedReader br = new BufferedReader(new FileReader(file_name)); String line, cell = ""; String[] tokens; boolean first_line = true; int row = 0, col ...
6
public String getTopTexture(BlockType type){ // TODO: Make these use official Minecraft texture file names switch (type){ case STONE: return "stone.png"; case GRASS_BLOCK: // TODO: Make grass properly use different colors return "grass_top.png"; case DIRT: return "dirt.png"; case COBBLESTONE: ...
9
public int getEast(){ return this.east; }
0
private static Color setGridChargeColor(float q, float qmin, float qmax) { if (Math.round(q) == 0) return Color.black; // pos. blue, neg. green, neu. black float scale = 1.0f; int ncolor; int isign = Math.round(qmax * qmin); if (isign > 0) { scale = 255.0f / (qmax - qmin); // all pos. or neg. ncolo...
9
public HighscorePanel(Map<String, String> levelNameMap, Map<String, Integer> levelScoreMap) { this.levelNameMap = levelNameMap; this.levelScoreMap = levelScoreMap; header = new String[]{"Level Name", "Score"}; data = new String[this.levelNameMap.size()][2]; int count = 0; ValueComparator comparator = ...
2
public boolean isEmpty() { return messageBuffer.isEmpty() && writePointer == 0; }
1
public boolean editRecord(String badgeId, String lastName, String recordID, String newStatus) { // check if the user is allowed to create this operation if (!isOfficerAuthorized(badgeId)) { log.error(badgeId + " is not a authorized user to perform editRecord"); System.out.println(badgeId + " is n...
9
private Chromasome genChild(Chromasome parent1, Chromasome parent2) { int[] par1 = parent1.returnChrom(); int[] par2 = parent2.returnChrom(); Chromasome child = new Chromasome(par1.length); if (Constants.secondCrossover) { int index = 0; while (index < par1.length / 2) { child.chromasome[index] = par1...
6
private static void swap(int[] array, int index1, int index2) { int tmp = array[index2]; array[index2] = array[index1]; array[index1] = tmp; qSwaps++; }
0
public void stop() { synchronized (MP3Player.this) { isPaused = false; isStopped = true; MP3Player.this.notifyAll(); } if (playingThread != null) { try { playingThread.join(); } catch (InterruptedException e) { LOGGER.log(Level.SEVERE, "join() failed", e); } } }
2
public static void main(String[] args) { System.out.println(new Object().equals(new Object())); int m = 3, n = 4; Object[][] a1 = new Object[m][n], a2 = new Object[m][n]; for(int i = 0; i < m; ++i) { for(int j = 0; j < n; ++j) { a1[i][j] = n...
4
protected int contest(int b, int g, int r) { /* finds closest neuron (min dist) and updates freq */ /* finds best neuron (min dist-bias) and returns position */ /* for frequently chosen neurons, freq[i] is high and bias[i] is negative */ /* bias[i] = gamma*((1/netsize)-freq[i]) */ int i, dist, a, biasdist, ...
6
public static boolean downloadFile(String libName, File libPath, String libURL) { try { URL url = new URL(libURL); URLConnection connection = url.openConnection(); connection.setConnectTimeout(5000); connection.setReadTimeout(5000); InputSupplier<Input...
1
public static void main(String args[]) { Scanner in = new Scanner(System.in); Map<String, String> types = new HashMap<String, String>(); int N = in.nextInt(); // Number of elements which make up the association table. in.nextLine(); int Q = in.nextInt(); // Number Q of file name...
6
public static boolean hasCut(Pokemon[] pokemon) { for (Pokemon aPokemon : pokemon) { if (aPokemon != null) { for (int j = 0; j < 4; j++) { if (aPokemon.move[j] == Pokemon.Move.CUT) return true; } } } ...
4
public @Override void setDNA(String dna) throws IllegalArgumentException { if (dna == null || dna.length() == 0) throw new IllegalArgumentException("argument null or empty"); if (dna.contains("TGC")) throw new IllegalArgumentException("argument contains TGC"); for (int i=...
5
public void loadIdent(String id) { Ident ident = Yaka.tabident.chercheIdent(id); if (ident != null) {// l'ident existe var_param_const if (ident.isVar()) {// ident est une variable int offset =((IdVar) ident).getOffset(); int index=-1*offset/2 - 1;// index de la variable dans la pile des variables if...
5
@Override public void putAll(final Map<? extends K, ? extends V> m) { for (final java.util.Map.Entry<? extends K, ? extends V> entry : m .entrySet()) { final K key = entry.getKey(); final Entry newEntry = new Entry(key, entry.getValue()); final Entry old = this.lookUpMap.put(key, newEntry); if (old =...
6
public static void ConvertToLibSVM(String directory, String outputDirectory) throws FileNotFoundException,IOException{ FileReader fr = new FileReader (directory); BufferedReader br = new BufferedReader(fr); FileWriter stream = new FileWriter(outputDirectory,false); BufferedWriter bo = new BufferedWri...
7
public Message(User u, String m) { this.user = u; this.content = m; }
0
public List<Instance> readData() { ArrayList<Instance> instances = new ArrayList<Instance>(); while (this._scanner.hasNextLine()) { String line = this._scanner.nextLine(); if (line.trim().length() == 0) continue; FeatureVector feature_vector = new FeatureVector(); // Divide the line int...
7
public void deleteAll(Collection<T> entities) { if (entities != null) for (T entity : entities) { session().delete(entity); } }
2
private void sortDACSpartitions(OneMutation mutArray[], int initDepth, int majorSplitPos[], int numPartitions[], PrunedRotamers<Boolean> prunedRotAtRes, Index3 indexMap[][], int numMutable, int strandMut[][], double pruningE, double initEw, RotamerSearch rsP) { RotamerSearch rs = rsP; //no changes should be...
7
public List<TestResultData> process() { List<TestResultData> testResults = new ArrayList<TestResultData>(); try { BufferedReader bufferReader = new BufferedReader(new FileReader( resultFile)); String line = null; while((line = bufferReader.readLine()) != null)...
9
public List<Regional> getRegionals(URL url) { Document doc; Tidy tidy = new Tidy(); List<Regional> retVal = new ArrayList<Regional>(); Regional temp; String link = ""; String name = ""; int teamCounter = 0; try { doc = tidy.parseDOM(url.openStream(), null); XPath xpath = XPathFactory.newIn...
8
@SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: to = (java.lang.CharSequence)value$; break; case 1: from = (java.lang.CharSequence)value$; break; case 2: body = (java.lang.CharSequence)value$; break; default: throw new org.apach...
3
public int GetBus() { return bus; }
0
public Solmu lisaa(Punamustapuu puu, int avain) { Solmu uusi = puu.binaariLisays(puu, avain); uusi.setVari("puna"); Solmu apu; while (uusi.getParent() != null && uusi.getParent().getVari().equals("puna")) { if (uusi.getParent() == uusi.getParent().getParent().getVasen()) { ...
9
public static List nMRSeperate(String arg){ List fileList = new ArrayList(); List fileList1 = new ArrayList(); List pdbList=new ArrayList(); List NMRresult=new ArrayList(); String line= ""; String nextline=""; int modelCount=0, linecount=0; String currDir...
9
public void saveStatus(){ myKeeper.saveStatus(); }
0
public static void initCommandLineParameters(String[] args, LinkedList<Option> specified_options, String[] manditory_args) { Options options = new Options(); if (specified_options != null) for (Option option : specified_options) options.addOption(option); Option option = null; OptionBuilder.with...
9
public boolean isActive() { if (context == 0) { context = -1; try { if (getAppletContext() != null) { context = 1; } } catch (final Exception localException) { ...
4
@Override public String toString() { return "[com.cube.geojson.LngLatAlt lng: " + longitude + " lat: " + latitude + " alt: " + altitude + "]"; }
0
public String getOtherWolve(int current) { String result = ""; boolean first = true; for (int i = 0; i < wolves.size(); i++) { if (wolves.get(i) == current) { continue; } if (!first) { if (i == wolves.size() - 2) { result += " and "; } else { result += ", "; } } first = fa...
4
public void create(ConfigDecripcionLogin configDecripcionLogin) { if (configDecripcionLogin.getCmProfesionalesList() == null) { configDecripcionLogin.setCmProfesionalesList(new ArrayList<CmProfesionales>()); } EntityManager em = null; try { em = getEntityManager()...
7
private JFreeChart getChart(){ /*Create data for building all graphs */ XYSeriesCollection data = new XYSeriesCollection(); /*Mark line*/ int index = 0; for(Coordinates[] kit: listCoordinates ){ /*Add data to kit of one line*/ XYSeries series = new XYSe...
2
public static List<String> buscaSiglas(String texto) { List<String> siglas = new ArrayList<String>(); List<String> siglasFim = new ArrayList<String>(); int countUppers = 0; String[] palavras = texto.split(" "); for (String palavra : palavras) { if (isAllUpper(palavra) && palavra.length() > 2) { count...
9
public final void startTile(final Attributes attributes) { tmpTile = new TileType(); if (attributes.getValue("name") != null) { tmpTile.setName(attributes.getValue("name")); } else { tmpTile.setName(""); } tmpTile.setCount(Integer.parseInt(attributes.get...
4
public void buildClassifier(Instances data) throws Exception { super.buildClassifier(data); // can classifier handle the data? getCapabilities().testWithFail(data); // remove instances with missing class Instances newData = new Instances(data); newData.deleteWithMissingClass(); double su...
7
public void service( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { PrintWriter out = response.getWriter(); moduli.setRequestResponse(request, response); //passaggio di request e response a moduli per il corretto funzionamento modu...
8
public void subgridPressed(final String face) { int[] nulled = {-1, -1}; boolean correct = false; if(face.equals("L") || face.equals("R")) { dir = "Hor"; sub_grids.setColor(face, color_correct); repaint(); } else if(face.equals("U") || face.equals("D")) { dir = "Ver"; sub_grids.setCo...
5
public void run(){ if (time!=0){time=time-1;} GosLink2.dw.append("HeartBeat Started."); while (true){ try { OLH.put(1,0); OLH.put(2,0); OLH.put(3,0); CTH.put(1,0); CTH.put(2,0); CTH.put(3,0); Thread.sleep(60000); for (int v:GosLink2.TNH.keySet()){ checkserver(v); } ...
4
public static String getProperty(String key) { //return rb.getString(key); //TODO make a normal config file! switch(key) { case "path.page.index": return "/index.jsp"; case "path.page.login": return "/jsp/login.jsp"; case "path.page.admin": return "/jsp/admin.jsp"; case "path.page.main": return "/jsp/main.jsp"; ...
7
public static float taxesDue(Actor actor) { final int bracket = actor.vocation().standing ; if (bracket == Background.SLAVE_CLASS) return 0 ; if (bracket == Background.RULER_CLASS) return 0 ; final BaseProfiles BP = actor.base().profiles ; int taxLevel = 0 ; if (bracket == Background.LOWER_...
6
public boolean equals( Object other ) { if ( _set.equals( other ) ) { return true; // comparing two trove sets } else if ( other instanceof Set ) { Set that = ( Set ) other; if ( that.size() != _set.size() ) { return false; // different sizes, no need ...
6
public static String readData(String filename){ File file = new File(filename); FileReader fr; BufferedReader br; String line; int index = -1; int indexstart = 38; String lineresult; StringBuffer sb = new StringBuffer(); try { fr = new FileReader(file); br = new BufferedReader(fr); while(br.r...
3
public void itemSent(Auction auction, String time, String trackingId){ auction.itemSent(time, trackingId); }
0
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
0
public void recursivePrint(LeftistTreeNode root, int parentPosition, Node innerNode, Node p) { Node innerParent; int position; if (root != null) { int height = tree.heightRootToNode(root); int nextTop = getRectNextTop(height); if (innerNode != null) ...
4
public void setBombs(){ boolean duplicateBomb=true; // checks for bombs with the same x,y coordinates Random numGenerator = new Random(); int xcoord,ycoord; for(int numBombs=0;numBombs<10;numBombs++){ xcoord = numGenerator.nextInt(10); ycoord = numGenerator.nextInt(10); duplicateBomb=true; while(du...
7
public GenericObject load(final String filename) { final long startTime = System.nanoTime(); if (!openInStream(filename)) return null; //notify about loading if (settings.isPrintTimingInfo()) System.out.println("Loading " + filename + "."); ...
7
private double pareseMulOrDiv() throws Exception { char op; //运算符 double result; //结果 double partialResult; //子表达式结果 //用指数运算计算当前子表达式的值 result = this.parseExponent(); //如果当前标记的第一个字母是乘、除或者取模运算,则继续进行乘除法运算 while ((op = this.token.charAt(0)) == '*' || op == '/' || op =...
8
public static final Define makeMethod(String proxyPackage, final Class clazz, final String methodName, Class... parameters) { parameters = parameters == null ? new Class[0] : parameters; final Method method = Utilities.getMethod(clazz, methodName, parameters); if (method == null) { t...
8
public final void visitEnd() { addEnd("class"); if (!singleDocument) { addDocumentEnd(); } }
1
public void setLineEnding(String lineEnding) { this.lineEnding = lineEnding; }
0
public void run() { Message message; MessageObject messageObject; Socket socket; try { while (true) { socket = socketServeur.accept(); System.out.println("Connection de " + socket); synchronized (outputStreams) { outputStreams.put(socket, new DataOutputStream(socket.getOutputStream())...
4
public static IMod loadMod(File jar) { try { URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] {jar.toURI().toURL()}); @SuppressWarnings("resource") JarFile jarFile = new JarFile(jar); Enumeration<JarEntry> entries = jarFile.entries(); IMod mainClass = null; while (entries.hasMoreEle...
8
public boolean _setLevel(int level) { if(level > 0) { this.level = level; return true; } else { return false; // Invalid level given. } }
1
static void test(Runnable r) throws InterruptedException { Future<?> f = exec.submit(r); TimeUnit.MILLISECONDS.sleep(100); System.out.println("Interrupting " + r.getClass().getName()); f.cancel(true); // Interrupts if running System.out.println("Interrupt sent to " + r.getClass().getName()); }
1
@EventHandler(priority=EventPriority.HIGH ) public void onBlockRedstone(BlockRedstoneEvent event) { Block block = event.getBlock(); int iBlockID = block.getTypeId(); if (iBlockID==69 || iBlockID==77 || iBlockID==143) { return; } if(event.getOldCurrent() >=1 && event.getNewCurrent() == 0 ) { return; } if(...
6
final public void Integral_type() throws ParseException { /*@bgen(jjtree) Integral_type */ SimpleNode jjtn000 = new SimpleNode(JJTINTEGRAL_TYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(INTEGER); } f...
1
public WebServices() { // TODO Auto-generated constructor stub }
0
public static boolean writeEdges(int numNodes, int idTopology) { try { PrintStream ps = new PrintStream("./Topology/Edges/"+idTopology+"_edge_"+numNodes+".txt"); ps.println("Number of nodes: " + numNodes); Configuration.printConfiguration(ps); ps.println(separator); Iterator<Node> it = Tools...
3
@Override public IautosSellerInfo getIncompletedSeller(String seqID) { EntityManager em = this.getEntityManager(); return em.find(IautosSellerInfo.class, seqID); }
0
public void map(LongWritable key, Text inputValue, Context context) throws IOException, InterruptedException { String htmlLine = inputValue.toString(); String toLowerCaseHtml = htmlLine.toLowerCase(Locale.US); // Get the source URL for this page if (null == _contributingPageUrl && true == toLowerCaseHtm...
7
private int executeViewer(int posX, int posY, boolean stop) { if (stop) return 1; if (posY < 0 || posY == matrix[0].length) return 1; if (posX < 0 || posX == matrix.length) return 1; stop = matrix[posX][posY].showValue(); executeViewer(posX, (posY + 1), stop); executeVi...
5
private boolean validarDatos(){ boolean error= false; if(txtNombre.getText().isEmpty()){ txtNombre.setBorder(javax.swing.BorderFactory.createEtchedBorder(Color.lightGray, Color.red)); txtNombre.setToolTipText("Por favor digite el nombre del producto."); error= true; ...
7
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int count=0; for(int i=0;i<n;i++){ int temp = in.nextInt(); if(5-temp >= k) count++; } System.out.println(count/3); }
2
public void write(int address, int data) { int sets = Cache.MAX_SIZE / this.assoc / this.blockSize; int blockNo = address / this.blockSize; int pos = blockNo % sets; byte tag = (byte) (address / sets); //MRU Way Prediction if (this.mru[pos] >= 0 && tag == this.tags[pos+this.mru[pos]]) { this.hit++; th...
9
public User findByID(String userID) { User foundUser = null; try { // Erforderlicher SQL-Befehl String sqlStatement = "SELECT * FROM bookworm_database.users WHERE id LIKE " + userID + ";"; // SQL-Befehl wird ausgeführt myResultSet = mySQLDatabase.executeSQLQuery(sqlStatement); // da das Sele...
2
public static Command parseCommand(Game game, String desc) throws NoFactoryFoundException{ ArrayList<String> commandDesc = new ArrayList<String>(); String allDescArray[] = desc.split(" "); for (int i = 0; i < allDescArray.length; i++) { commandDesc.add(allDescArray[i]); } String commandName = commandD...
4
private void addVM() { final SlaveVM slave = new SlaveVM(openNebula); slave.createVM(); slave.setState(VMState.INIT); allVms.put(slave.getId(), slave); Thread creator = new Thread() { public void run() { while (!slave.getVm().lcmStateStr().equals("RUNNING")) { slave.getVm().info(); } Syst...
4
public double getDiag(){ return lengh_diag = this.getHig()*Math.sqrt(3); }
0
public void worldInput(int mouseX, int mouseY){ int button = -1; if (Mouse.isButtonDown(0)){ button = 0; } if (mouseX < 800){ int newX = -1; int newY = -1; int cx = Boot.getPlayer().getX(); int cy = Boot.getPlayer().getY(); newX = cx + (mouseX / Standards.TILE_SIZE) - 12; newY = cy +...
4
public void insert(T newVal) { if (newVal == null) { throw new IllegalArgumentException(); } if (root == null) { root = new Node<>(newVal); return; } Node<T> tmp = root; int compRes = -1; while (tmp != null) { com...
7
private ArrayList<String> parseRow(String row) { ArrayList<String> data = new ArrayList<>(); String s = ""; char expect = STRING_CONTAINER; for (int i = 0; i < row.length(); i++) { char c = row.charAt(i); switch (expect) { case STRING_CONTAINER: if (c != STRING_CONTAINER) { System.out.println...
6
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { AnnotationVisitor av = super.visitAnnotation(desc, visible); if (fv != null) { ((TraceAnnotationVisitor) av).av = fv .visitAnnotation(desc, visible); } return av; }
1
public int[] getBoundaryPositions(ByteBuffer b, byte[] boundary) { int matchcount = 0; int matchbyte = -1; List<Integer> matchbytes = new ArrayList<Integer>(); for (int i=0; i<b.limit(); i++) { if (b.get(i) == boundary[matchcount]) { if...
5
static boolean isOnBoard(int x, int y){ return(x >= 0 && x <= 7 && y >= 0 && y <= 7); }
3
protected boolean decodeFrame() throws JavaLayerException { try { AudioDevice out = audio; if (out == null) return false; Header h = bitstream.readFrame(); if (h == null) return false; // sample buffer set when decoder constructed SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h, bits...
4
public boolean stateRight() throws Exception { int[] temp = new int[numbers.length + 1]; int spaces=0; for (int i = 0; i < temp.length; ++i) temp[i] = 0; for (int i = 0; i < numbers.length; ++i) { int x = 0; if (!numbers[i].toString().equals(" ")) { x = new Integer(numbers[i].toString()); ...
8
public AStarGraphics(List<CellDescription> cd, List<Cell> ol, List<Cell> cl, List<CellDescription> rp ) { returnPath = rp; knownCells = cd; openList = ol; closedList = cl; int floorXdimension = 1; floorYdimension = 1; for ( int i ...
4