text
stringlengths
14
410k
label
int32
0
9
public static void main(String[] args) { Dinosaur n = new Dinosaur(); n.f(); n.i = 40; n.j++; }
0
private void saveCompletedLevel(String mapName) { boolean createdNewFile = false; try { File file = new File(COMPLETED_TXT_PATH.toString()); if (!file.exists()) { createdNewFile = file.createNewFile(); } String mapUrl = COMPLETED_TXT_PATH.toString(); File inFile = new File(mapUrl); //...
4
public void expandPath(TreePath path) { for(Object node : path.getPath()){ TreeItem parentItem = (TreeItem) node; if(parentItem != path.getLastPathComponent() && !isExpanded(new TreePath(parentItem.getPath()))){ return; } } super.expandPath(pat...
3
public void followWaypoint() { if(!close) { setWaypoint(targetX + (scrollX - state.get(9)), targetY + (scrollY - state.get(10))); //calculate speed and direction to waypoint (same as last turn) double eachTurn; //turn this frame is a fraction of the total turn if...
6
public String updateGradeItem() throws IOException { InputStreamReader in = new InputStreamReader(System.in); BufferedReader keyboard = new BufferedReader(in); DBConnector db = new DBConnector(); System.out.println("Updating an assignment"); System.out.println("Assignmen...
1
public void disabledPeriodic() { if (System.currentTimeMillis() >= time + 20) { time = System.currentTimeMillis(); if (oi.getGunS() > 0.5) auton = "Left"; else if (oi.getGunS() < -0.5) auton = "Right"; else auton = "None"; Log.println(auton); } SmartDashboard.putString("Auton selector"...
3
public void setLeft(PExp node) { if(this._left_ != null) { this._left_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } ...
3
@Override public boolean insert(DataRow row) { String statement = "INSERT INTO " + row.getTableName(); String args = ""; String values = ""; boolean isFirst = true; for(DataCell cell : row.row) { if(isFirst) { isFirst = false; ...
3
public long getLong(int bits) throws IOException { if (bits > 64) { throw new IllegalArgumentException("Argument \"bits\" must be <= 64"); } long res = 0; if (endian == LITTLE_ENDIAN) { for (int i = 0; i < bits; i++) { if (getBit()) { ...
6
public Result execute(Command command) { LabelDTO labelDTO = (LabelDTO) command.getCommandSource(); Account account; account = accountDAO.getAccountByname(labelDTO.getAccount()); Set<Label> labels = account.getLabel(); //labels = account.getLabel(); for (Iterator<Label> ...
2
protected String toLetter(String c) { if(" ".equals(c)) return "space"; if("<".equals(c)) return "less then"; if(">".equals(c)) return "grater then"; if("&".equals(c)) return "ampersand"; if("\\".equals(c)) return "back slash"; if("/".equals(c)) return "slash"; if("'".equals(c)) return "quot...
8
public void setId(long Id) { this.Id = Id; }
0
final private boolean jj_3R_63() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_29()) return true; if (jj_scan_token(RPAREN)) return true; Token xsp; xsp = jj_scanpos; if (jj_scan_token(88)) { jj_scanpos = xsp; if (jj_scan_token(87)) { jj_scanpos = xsp; if (jj_scan_token(73)...
9
private void checkWeekend() { //Friday is 5 //Saturday is 6 //Sunday is 7 if (weekday == 5) { infoList.add(bundle.getString("SaturdayTomorrow")); tomorrowValid = false; eventPresent = true; } else if (weekday == 6) { infoList.add(b...
3
@Override public void handleNewConnection(Socket client) { try { new ChatGUI(client); } catch (IOException e) { System.out.println("Failed to connect!"); e.printStackTrace(); } }
1
@Test public void nonceTest() throws IOException { String nonce = "myUniqueNonce" + System.currentTimeMillis(); String result = null; TeleSignRequest tr; if(!timeouts && !isHttpsProtocolSet) tr = new TeleSignRequest("https://rest.telesign.com", "/v1/phoneid/standard/" + PHONE_NUMBER, "GET", CUSTOMER_ID, SEC...
6
public boolean getBoolean(int index) throws JSONException { Object object = this.get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equal...
6
public Explosion(int x, int y , TankClient tc){ this.x = x; this.y = y; this.tc = tc; }
0
@Override public void train(List<Instance> instances) { // initialize w values for (Instance instance : instances) { for (Entry<Integer, Double> entry : instance.getFeatureVector().getVector().entrySet()) { linearParam.add(entry.getKey(), 0.0); } } int iter = 0; while (iter < iters) { iter ++...
6
final byte getByte(int pos) { int b0 = charAt(pos) - '0'; int b1 = charAt(pos + 1) - '0'; if (b0 > 9) { b0 -= 7; if (b0 > 16) { b0 -= 32; } } if (b1 > 9) { b1 -= 7; if (b1 > 16) { b1 -= 32; } } return (byte) ((b0 << 4) + b1); }
4
public Edge get(){ if(lastStack == null || Configuration.hasEdgeTypeChanged()){ lastStackTypeName = Configuration.getEdgeType(); lastStack = stacks.get(lastStackTypeName); if(lastStack == null) { lastStack = new Stack<Edge>(); stacks.put(Configuration.getEdgeType(), lastStack); } } if(lastStac...
4
@Override public void run() { long time = System.nanoTime(); final double maxTick = 30.0 * gameSpeed; double ns = 1000000000 / maxTick; double delta = 0; while(running) { long now = System.nanoTime(); delta += (now - time) / ns; ...
2
@Override public KThread nextThread() { boolean debug = false; Lib.assertTrue(Machine.interrupt().disabled()); ThreadState winner = null; if (queue.isEmpty()) { return null; } ...
8
public boolean getCollision(ArrayList<Tetromino> tetrominoArray) { // Can't use TetrisPanel's getArray()'s, because that will include // itself. ArrayList<Double> xArray = new ArrayList<Double>(); ArrayList<Double> yArray = new ArrayList<Double>(); for (Tetromino tetr : tetrominoArray) if (tetr != this) ...
9
@Override public Object getValueAt(int row, int col) { { StockItem s = si.get(row); switch (col) { case 0: return s.getID(); case 1: return s.getStockQuantity(); case 2: ...
6
public void AddNew(ServerHandleConnect serverHandleConnect) { this.curconnected++; this.serverHandleConnectList.add(serverHandleConnect); }
0
public int getATK() { return atk; }
0
public boolean vihkoTaynna(){ for(int i=0; i<pelaajat.size(); i++){ if(!pelaajat.get(i).getVihko().full()){ return false; } } return true; }
2
public Menu getMenu() throws NoPagesException, InvalidMenuException{ if(style == null){ throw new InvalidMenuException("No style set"); } if(pages.size() <= 0){ throw new NoPagesException(); } Menu menu = new Menu(); menu.setStyle(style); for(Page page : pages){ try{ menu.addPage(page); }c...
4
public JSONObject asJson() { JSONObject obj = new JSONObject(); if (minValue != null) { obj.put("min", new JSONNumber(minValue)); } if (maxValue != null) { obj.put("max", new JSONNumber(maxValue)); } if (decimalPrecision != null) { obj.put("tickDecimals", new JSONNumber(decimalPrecision)); } if...
9
static byte[] transferArray(byte[] buffer, int start, int x, byte[] hashArray, int hashStart, boolean hashToBuffer) { if(buffer == null) { return null; } int bufferPos = startPoint[x] + start; int thisStep1 = step1[x]; int hashPos = hashStart; for(int outer=0;outer<16;outer++) { for(int mid=0;mid<1...
5
private void updatePlayerList(Buffer stream, int count) { while (stream.bitPosition + 10 < count * 8) { int pId = stream.readBits(11); if (pId == 2047) break; if (players[pId] == null) { players[pId] = new Player(); if (playerAppearanceData[pId] != null) players[pId] .updatePlayerAppe...
7
public static void main(String[] args) { try { CsvReader trips = new CsvReader("C:\\Users\\ThejaSwarup\\Box Sync\\Fall 2014\\CS 424\\Project2\\InputFiles\\trips_updated.csv"); String allDates = "C:\\Users\\ThejaSwarup\\Box Sync\\Fall 2014\\CS 424\\Project2\\TempFiles\\Temp1.csv"; String execptionCase = "...
8
public boolean isEatable() { String s = GetResName(); if (s.indexOf("gfx/invobjs/bread") >= 0) return true; if (s.indexOf("gfx/invobjs/meat") >= 0) return true; if (s.indexOf("gfx/invobjs/mussel-boiled") >= 0) return true; return false; }
3
@Test public void random_test() { try{ double [][]mat= {{1.0,2.0}, {3.0,1.0}}; int m=2; int n=2; double[][]result = Matrix.random(m,n); double exp[][]={{1.0,2.0},{3.0,1.0}}; Assert.assertNotSame(exp, result); } catch (Exception e) { // TODO Auto-generated catch block fail("Not yet implemen...
1
public void randomizeCurrentGeneration() { Random random = new Random(); for (int row = 0; row < currentGeneration.getHeight(); row++) { for (int col = 0; col < currentGeneration.getWidth(); col++) { if (random.nextBoolean()) currentGeneration.resurrectCell(col, row); } } }
3
protected void processEndSimulation() { resList_.clear(); arList_.clear(); if (regionalList_ != null) { regionalList_.clear(); } if (globalResList_ != null) { globalResList_.clear(); } if (globalResARList_ != null) { glob...
5
private final void method702(byte byte0, int i, Stream stream, int j) { if (i != 1) { if (i != 2) { if (i != 3) { if (i == 4) { anInt1013 = -1; } } else { aBoolean1020 = true; ...
5
public boolean equals(Token t) { if(!(t.getType()==type)) { return false; } if(!(t.getUnderlyingObject().equals(this.underlyingObject))) { return false; } return true; }
2
public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String sNumber1 = reader.readLine(); String sNumber2 = reader.readLine(); String sNumber3 = reader.readLine(); String sNumber4 = reader.read...
3
private static void fillData(Sheet s, int rownum, ProcessedCell cell){ //Assume that a header was already generated Row r = s.createRow(rownum); String[] headers = ProcessedCell.getTags(); Cell c = null; for(int i = 0; i < headers.length; i++){ c = r.createCell(i); c.setCellValue(cell.getAttribute(heade...
1
public void newParamSet() { for (OptParam op : opt_params) { Param p = op.getParam(); double new_mean = random.nextDouble() * op.getRange() + p.getLower(); op.setMean(new_mean); // Calculate new parameter values based on the random mean. double[] pro_...
4
private boolean crossingInternal(Point2DInt direction1, Point2DInt direction2) { if (angles.size() < 2) { return false; } final double angle1 = convertAngle(new LineSegmentInt(center, direction1).getAngle()); final double angle2 = convertAngle(new LineSegmentInt(center, direction2).getAngle()); Double las...
9
public String toString() { String ret = ""; try { ret = getLocation(); if( (ret.indexOf( "!" ) == -1) && (sheetname != null) ) { // prepend sheetname if( (sheetname.indexOf( ' ' ) == -1) && (sheetname.charAt( 0 ) != '\'') ) // 20081211 KSC: Sheet names with spaces must have surrounding quotes ...
5
@Override public StringConverter<?> findConverter(Class<?> cls) { if (cls.isArray()) { if (cls == Long[].class) { return LongArrayStringConverter.INSTANCE; } if (cls == Integer[].class) { return IntArrayStringConverter.INSTANCE; ...
8
@Override public List<List<String>> breakOutMudChatVs(String MUDCHAT, TriadList<String,String,Integer> behaviors) { final int mndex=behaviors.indexOfFirst(MUDCHAT); String mudChatStr=(mndex<0)?"":(String)behaviors.get(mndex).second; if(mudChatStr.startsWith("+")) mudChatStr=mudChatStr.substring(1); final L...
7
public void itemExpanded(TreeItem item){ if(item == tree.getRoot()){return;} expand(((FilePathTreeItem) item).getFilePath()); for(int i=0; i<item.getChildCount(); i++){ FilePathTreeItem childItem = (FilePathTreeItem) item.getChildAt(i); if(childItem.isLe...
5
public Map<Integer, Integer> getCountReps(Map<String, Integer> map) { List<Integer> list = new ArrayList<>(map.values()); Map<Integer, Integer> reps = new TreeMap<>(); Integer first = 1; Integer current; for (Integer e : list) { if (reps.containsKey(e)) { current = reps.get(e); current++; reps.put(e, ...
2
public static void main(String args[]){ int op; do{ System.out.println("\n\n1- Agregar Servidor"); System.out.println("2- Agregar Entry"); System.out.println("3- Navegar"); System.out.println("4- Ver Detalle"); System.out.println("5- Consultar ...
7
protected void readAllocation() throws DecoderException { // start to read audio data: for (int i = 0; i < num_subbands; ++i) subbands[i].read_allocation(stream, header, crc); }
1
public Boolean loadPlayer(String file) { boolean test = false; if (test || m_test) { System.out.println("Loader :: loadPlayer() BEGIN"); } m_valid = false; m_playerInfo = new String[PLAYER_INFO_SIZE]; m_hashString = ""; try { ...
8
@Override public Object drawCell(mxCellState state) { Map<String, Object> style = state.getStyle(); if (state.getAbsolutePointCount() > 1) { List<mxPoint> pts = state.getAbsolutePoints(); // Transpose all points by cloning into a new array pts = mxUtils.translatePoints(pts, translate.x, translate.y...
3
public static void computePaths(Vertex source) { source.minDistance = 0.; PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>(); vertexQueue.add(source); while (!vertexQueue.isEmpty()) { Vertex u = vertexQueue.poll(); // Visit each edge exiting u for ...
3
public void writeCSV(Collection<?> entities, String fileName, boolean override) throws ParsingException, ClassValidationException, ConverterException { if (configuration == null) { throw new NullPointerException("Initialize engine with init method first!"); } StringBuil...
6
private boolean correctChar(char a) { if (a >= '0' && a <= '9') { return true; } if (a == 'A') { return true; } else if (a == 'B') { return true; } else if (a == 'C') { return true; } else if (a == 'D') { re...
8
public Account create () { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("create", true); $in = _invoke ($out); Account $result = AccountHelper.read ($in); return $result...
2
@Test public void getSurplus() { AmateurAthlete test = null; AmateurAthlete test1 = null; try { test = new AmateurAthlete("Franz", 3); test1 = new AmateurAthlete("Karl", 5); } catch (Exception e) { // expected } try { AmateurAthlete test3 = new AmateurAthlete("Sepp", 12); } catch (ValueExcept...
5
public void assemble() throws MbiException, IOException { if(deBruijnGraph == null) System.out.println("graph NULL"); // System.out.println("edges: " + deBruijnGraph.getEdgeCount()); // System.out.println("vertices: " + deBruijnGraph.getVertexCount()); List<String> path = deBruijnGraph.findEulerPath_FleuryA...
3
public static void main(String args[]) { String players[] = new String[4]; for (int i = 1; i <= 4; i++) { players[i-1] = "P" + i; } StringBuilder playbackString = new StringBuilder(); InputStreamReader input = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(inp...
3
public void updateMemory() { DecimalFormat format = new DecimalFormat("0.0"); Runtime rt = java.lang.Runtime.getRuntime(); float maxMemory = rt.maxMemory() / (1024f * 1024f); float totalUsed = (rt.totalMemory() - rt.freeMemory()) / (1024f * 1024f); float docMem = 0; float undoMem = 0; CPArtwork artwork ...
3
private static void missingNumber(int[] array) { int startingTerm = array[0]; int commonDiff = array[1] - startingTerm; int currentTerm = startingTerm; for (int i = 0; i < array.length; i++) { if (currentTerm != array[i]) { //System.out.println(currentTerm); //System.out.println(array[i]); ...
2
public String getPredictedThrow() { if(computerResponse == 0) return "Scissors"; else if(computerResponse == 1) return "Rock"; else return "Paper"; }
2
public int maxProfit(int[] stations, int demand) { if(stations == null || stations.length == 0 || demand < 1) { throw new IllegalArgumentException("error"); } Comparator<Integer> comp = new Comparator<Integer>() { @Override public int compare(Integer a, Integer b) { return b - a; } }; Priorit...
9
public ExportTrackingResponse exportTrackings(ParametersTrackingExport parameters) throws AftershipAPIException,IOException,ParseException,JSONException{ List<Tracking> trackingList = null; String requestParams = parameters.generateQueryString(); JSONObject response = this.request("...
2
public static Cons cppTranslateFunctionCall(Cons tree, MethodSlot method) { { Symbol functionname = ((Symbol)(tree.value)); Cons functionargs = Cons.copyConsList(tree.rest); Stella_Object firstarg = functionargs.value; MethodSlot function = ((method != null) ? method : Symbol.lookupFunction(functi...
8
public QuickFind(int n){ id = new int[n]; for(int i=0;i<n;i++) id[i]=i; }
1
public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { minSize += 3; maxSize += 3; if (mv != null) { mv.visitFieldInsn(opcode, owner, name, desc); } }
1
private int IncDigit(int number, int pos) { int term = 1; int i; for (i = 0; i < pos; i++) term *= 10; return number + term; }
1
public void saveScore(String pseudo, int time, Calendar date, String gD) { Score newScore = new Score(pseudo, time, date); ObjectOutputStream os = null; try { this.removeLastElement(); os = new ObjectOutputStream(new FileOutputStream(gD+".ser", false)); bestSc...
3
protected void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 450, 371); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } meaningsLabel = new JLabel("...
3
protected static void removeCompressTag(MediaWiki wiki, String fileFullName) throws MediaWiki.BlockException { while (true) { try { MediaWiki.EditToken editToken = wiki.startEdit(fileFullName); // Remove the {{compress}} tag from the description page. Iterator<MediaWiki.Revision> descriptionPageRevisio...
9
*/ public void setSplashBackgroundColor(String s) { String prevText = IOSImageUtil.isNullOrWhiteSpace(this.splashBackgroundColor.getText()) ? PLACEHOLDER_SPLASH_BGCOL : this.splashBackgroundColor.getText(); Color col = null; if (!IOSImageUtil.isNullOrWhiteSpace(s)) { while (s.length() < 6) s = "0".concat(s); ...
8
static boolean isStandardProperty(Class clazz) { return clazz.isPrimitive() || clazz.isAssignableFrom(Byte.class) || clazz.isAssignableFrom(Short.class) || clazz.isAssignableFrom(Integer.class) || clazz.isAssignableFrom(Long.class) ...
9
private static void attackColonyAnt(Ant ant) { int XLoc = ant.getLocationX(); int YLoc = ant.getLocationY(); int randNum = RandomNumGen.randomNumber(0, 3); // 50% Chance of killing an ant in the same node as the bala // If the number 1 or 3 is generated, the attack is successful and an ant is killed i...
7
private void loadPlugins() { print("Loading modules"); File pluginsDir = new File(homeDir, "plugins"); // Create plugins folder if it doesn't exist if (!pluginsDir.isDirectory()) { pluginsDir.mkdir(); } // Scan for plugins File[] pluginFiles = pluginsDir.listFiles(new FilenameFilter() { @Over...
9
public void dfs(Graph G, int v) { marked[v] = true; preAnyAdjacentVerticesVisit(G, v); for (int w : G.adj(v)) if (!marked[w]) { preAdjacentVertexVisit(v, w); dfs(G, w); postAdjacentVertexVisit(v, w); } }
2
private static void init() { Class<Selenium> selC = Selenium.class; for (Method m : selC.getMethods()) { if ("void".equals(m.getReturnType().toString()) ||"boolean".equals(m.getReturnType().toString()) || m.getReturnType().isAssignableFrom(String.class)) { Class<?>[] types = m.getParameterTypes()...
9
public boolean writeMsg (String sender,String message) { DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Calendar cal = Calendar.getInstance(); String date = " Sent on-" + dateFormat.format(cal.getTime()); String text = message; String Msg = sender + ": " + text + date; Buff...
3
public static ArrayList<CubeNode> getSuccessors(CubeNode node) { ArrayList<CubeNode> successors = new ArrayList<CubeNode>(); for (Map.Entry<Character, int[]> face : Cube.FACES.entrySet()) { // Make a clockwise turn char[] newState = Cube.rotate(node.state, face.getKey(), 1); // Encode the corner int enc...
3
public void populateMap() throws FroshProjectException { // Get the list of IDs // String idList = FroshProjectConfig.getProperty("WorldMap.ids"); // Log a message // FroshProject.getLogger().log(Level.FINE, "List of Element ids " + idList); // C...
7
protected void UpdateLineColumn(char c) { column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else line += (column = 1); ...
6
public static void main(String args[]) { Gongming gongming = new Gongming(merchantId, merchantSecret); try { String userIdentityNumber = "1" + String.format("%017d", new Random().nextInt(1000000000)); logger.log(Level.INFO, "创建理财账户"); CreateUserRequest createUserRequest = new CreateUserRequ...
3
@Override public void run() { if (isAlive) { System.out.println(name + " running"); Controller.start(); hunger = new stats.Hunger(); health = new stats.Health(); social = new stats.Social(); } else { kill(); } }
1
public void run() { for(int i = 0; i < _rounds; i ++){ ClusterRound(_minSpanningTree); } }
1
public List<QuadTree> getTopNeighbors() { QuadTree sibling = this.getTopSibling(); if ( sibling == null ) return new ArrayList<QuadTree>(); return sibling.getBottomChildren(); }
1
public void repaint(Game game){ for(List<Token> row : game.getBoard().tokens()){ for(Token token : row){ fieldButtons[token.yPos()][token.xPos()].setState(token.color(),token.isMoveable()); } } String startText = "<html><ul style='list-style-type:disc; margin:0 0 0 15; padding:0;'>"; String endText...
4
public V put (K newKey, V newValue) { if (root == null) { root = new Node(newKey, newValue); size++; return null; } Node node = root; while (true) { if (newKey.compareTo(node.mKey) < 0) { if (node.left == null) { node.left = new Node(newKey, newValue); size++; return null; ...
6
public void Tick() { while (true) { if (this.stage == 1) { this.LH = new LobbyHandler(net, userName); StageFlipper passOn = LH.init(new StageFlipper()); stop(passOn); } else if (this.stage == 20) { this.TH = new TiarHandler(net, userName); StageFlipper passOn = this.TH.init(lastMsg); sto...
4
private Tile[] getLine(int idx) { Tile[] result = new Tile[4]; for (int i : _0123) { result[i] = tileAt(i, idx); } return result; }
1
public long directorySize(boolean includeSubDirs) throws IOException { if (!file.isDirectory()) { throw new IOException("FileConnection.directorySize() cannot be invoked on a file: " + file); } else { if (includeSubDirs) { throw new RuntimeException("FileConnection.directorySize(includingSubDirs) not i...
5
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
protected Content getNavSummaryLinks() throws Exception { Content li = HtmlTree.LI(summaryLabel); li.addContent(getSpace()); Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) configuration.getBuilderF...
7
private void dumpBArray( BitSet[] barray ) { for ( int i=0;i<barray.length;i++ ) { StringBuilder sb = new StringBuilder(); for (int j = barray[i].nextSetBit(1); j>= 0; j = barray[i].nextSetBit(j+1)) { if ( j <= sigla.size()&&j>0 ) ...
4
public void render(Point top_left, int width, int height) { DungeonFloor dungeonFloor = dungeonHandler.getActiveDungeon().getActiveFloor(); float ppt = (DisplayConstant.width_no_ui / (float) width); float scale = (float) ppt / (float) DisplayConstant.sprite_size; for (int x = (int) top_l...
6
private void openMainPage() { driver.get(baseUrl + "/addressbookv4.1.4/index.php"); }
0
private void drawWorld(Graphics2D g) { BufferedImage i = Main.getLoadedWorld().draw((int)screen.getMinX(), (int)screen.getMinY(), (int)Math.ceil(screen.getWidth()), (int)Math.ceil(screen.getHeight())); g.drawImage(i, 0, 0, GraphicsMain.WIDTH, GraphicsMain.HEIGHT, null); }
0
private void compute_pcm_samples2(Obuffer buffer) { final float[] vp = actual_v; //int inc = v_inc; final float[] tmpOut = _tmpOut; int dvp =0; // fat chance of having this loop unroll for( int i=0; i<32; i++) { final float[] dp = d16[i]; float pcm_sample; pcm_sample = (float)(((vp[2 + ...
1
public void generateNQueens(ArrayList<String[]> result,String[] temp,int[] position,int insertN,int n) { for (int i=0;i<n;i++){ position[insertN-1] = i; boolean satis = true; for (int j=0;j<insertN-1;j++){ if(insertN-1-j==position[insertN-1]-position[j]||inser...
8
public boolean removeTile(int x, int y) { for (int i = 0; i < tiles.size(); i++) { Tile t = tiles.get(i); if (t.getX() == x && t.getY() == y) { tiles.remove(i); return true; } } return false; }
3
public Tiedostonlukija(String tiedostonnimi) throws Exception { this.tiedosto = new File(tiedostonnimi); lukija = new Scanner(tiedosto); this.rivit = new ArrayList(); rivitTalteen(); }
0