text
stringlengths
14
410k
label
int32
0
9
public double[] subarray_as_degrees_phase_of_Phasor(int start, int end){ if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1)); Phasor[] pp = this.getArray_as_Phasor(); double[] phased = new double[end-start+1]; ...
2
public static List<ArrayList<Double>> getCenters(String inputpath){ List<ArrayList<Double>> result = new ArrayList<ArrayList<Double>>(); Configuration conf = new Configuration(); try { FileSystem hdfs = FileSystem.get(conf); Path in = new Path(inputpath); FSDa...
3
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AutomatoImpl automato = (AutomatoImpl) o; if (!alfabeto.equals(automato.alfabeto)) return false; if (!estadoInicial.equals(automato.estadoInici...
8
public OutlinerSubMenuItem() {}
0
public TestCompareCds(String genomeVersion, String configFile) { config = new Config(genomeVersion, configFile); cdsByTrId = new HashMap<String, String>(); try { if (!quiet) System.out.print("Loading predictor " + config.getGenome().getVersion() + " "); config.loadSnpEffectPredictor(); if (!quiet) Syste...
3
public int AddCell(String Text, String ID, int colspan, int rowspan) { //Controllo se è stato creato l'oggetto tabella if (this._PdfPTable != null) { //Controllo se l'ID sia presente nella lista for (int i = 0; i < this._MyCellList.size(); i++) { if (this._MyCell...
3
public static String findFile(File root, String name) throws PatternSyntaxException { Pattern p = Pattern.compile(name, Pattern.CASE_INSENSITIVE); Deque<Filer> next = new ArrayDeque<Filer>(); for (File f : root.listFiles()) { if (p.matcher(f.getName()).matches()) return f.getName() + (f.isDirectory() ? ...
9
public static Color[] createMultiGradient(Color[] colors, int numSteps) { // we assume a linear gradient, with equal spacing between colors // The final gradient will be made up of n 'sections', where n = // colors.length - 1 int numSections = colors.length - 1; int gradientIndex = 0; // points to the next op...
5
private void buildOutlineElement(Node node, String lineEnding, StringBuffer buf, int max_style_depth) { indent(node, buf); // Calculate CSS Class String cssClass = ""; if (node.isLeaf()) { if (node.isComment()) { cssClass = CSS_LEAF_COMMENT; } else { cssClass = CSS_LEAF; } } else { if (...
6
public void setStatustextZoomedFontsize(int fontsize) { if (fontsize <= 0) { this.statustextZoomedFontSize = UIFontInits.STATUSZOOMED.getSize(); } else { this.statustextZoomedFontSize = fontsize; } somethingChanged(); }
1
public InvalidMove() { }
0
public static double getMinObservation(ArrayList<Observation>[] list, Vector2d reference){ if(list == null) return 0; double result = Double.MAX_VALUE; for(int i=0; i<list.length; i++){ for(int j=0; j<list[i].size(); j++){ double distance = list[i].get(j).position.dist(reference)...
5
public void calculateRelativeFrequenciesPerRole() { featureValueFrequency.put("all", new MultiSet<String>()); featureValueFrequency.get("all").add("all", totalCount); for (String featureType : FeatureTypes.getUsedFeatures()) { if (featureType.contains(Const.roleTypeIdentifier)) { int roleIndex = 0; St...
7
public void onStart(IContext context) throws JFException { engine = context.getEngine(); indicators = context.getIndicators(); console = context.getConsole(); }
0
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Board)) return false; Board other = (Board) obj; if (N != other.N) return false; if (hamming != other.hamming) return false; if (manhattan != other.manhattan) ...
7
private void consolodateInts() { for(int i=0;i<intArray.length-1;i++) { if(((intArray[i]&NEXT_FLAG)==0) &&(intArray[i]+1==(intArray[i+1]&INT_BITS))) { if((intArray[i+1]&NEXT_FLAG)>0) { if((i>0)&&((intArray[i-1]&NEXT_FLAG)>0)) { shrinkIntArray(i,2); return; } shrinkI...
8
public void onMessage(IMessage message) throws JFException { }
0
@Override public List<Orientador> Buscar(Orientador obj) { String sql = "select a from Orientador a"; String filtros = ""; if(obj != null){ if(obj.getId() != null){ filtros += "a.id = " + obj.getId(); } //ver ...
7
public void decrement(int by) { // if given value is negative, we have to increment if (by < 0) { decrement(Math.abs(by)); return; } // cut off full overflows by %= (range + 1); // check if we would still overflow int space_down = value - min; if (by > space_down) { // we check how big overfl...
2
@Override public Set<FoodObject> lookUpFoodByCollection(Collection<String> names) { Set<FoodObject> result = new HashSet<FoodObject>(); for (String name : names) { if (cachedFoodObjectMap.containsKey(name)) { result.add(cachedFoodObjectMap.get(name)); //TODO: fall back to db } } return result; }
2
public static void extractEntry(ZipFile zipFile, ZipEntry entry, String destDir) throws IOException { File file = new File(destDir + "/" + entry.getName().replace("\\", "/")); if (entry.isDirectory()) file.mkdirs(); else { file.getParentFile().mkdirs(); InputStream is = null; OutputStream os = null; t...
4
private Boolean isAPropertiesFile(final String filePath) { String[] splitted = filePath.split("\\."); if ((splitted.length > 1) && (splitted[1]).compareTo(PROPERTIES_FILE_EXTENSION) == 0) { return true; } return false; }
2
public void speciate(List<Organism> organisms) { /* All other genomes are placed into species as follows: * A random member of each existing species is chosen as its permanent representative. * Genomes are tested one at a time; if a genome’s distance to the representative of any * e...
4
protected void execute() { velocity = oi.getRawAnalogStickALY(); turn = oi.getRawAnalogStickARX(); if (Math.abs(velocity) < .05) { velocity = 0; } if (Math.abs(turn) < .05) { turn = 0; } if (vPrev - velocity > rampThreshold) { ...
8
private Color getColorWithIndex(int index) { Color color = null; switch (index) { case 0: color = Color.ORANGE.darker(); break; case 1: color = Color.CYAN.darker(); break; case 2: color = Color.GREEN.darker(); break; case 3: color = Color.YELLOW.darker(); break; case 5: color = ...
8
public ArrayList<String> getQuestAnswer() { return questAnswer; }
0
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) { ...
9
public final void need(int count) throws VerifyException { if (stackHeight < count) throw new VerifyException("stack underflow"); }
1
public static void sendPlayerToLastBack( BSPlayer player, boolean death, boolean teleport ) { if ( player.hasDeathBackLocation() || player.hasTeleportBackLocation() ) { player.sendMessage( Messages.SENT_BACK ); } else { player.sendMessage( Messages.NO_BACK_TP ); } ...
8
@Override public void scoreGame(boolean won, int score) { if (won) System.out.println("You won the game!\n"); else System.out.println("You lost the game.\n"); }
1
public int read() { try { FileInputStream inStream = new FileInputStream("options.txt"); DataInputStream in = new DataInputStream(inStream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); url = br.readLine(...
4
private void handleResize() { paintCanvas.update(); Rectangle visibleRect = paintCanvas.getClientArea(); visibleWidth = visibleRect.width; visibleHeight = visibleRect.height; ScrollBar horizontal = paintCanvas.getHorizontalBar(); if (horizontal != null) { displayFDC.xOffset = Math.min(horizontal.getSel...
4
public int removeDuplicates(int[] A) { int count = 1; int countAll = 0; int pre = Integer.MIN_VALUE; int removed = 0; HashSet<Integer> set = new HashSet<Integer>(); for (int i = 0; i < A.length; i++) { int a = A[i]; if (a == pre) { ...
6
public void replace(String statement) throws CannotCompileException { thisClass.getClassFile(); // to call checkModify(). ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); Javac jc = new Javac(thisClass); ClassPool cp =...
3
public static Level forName(final String name) { if (name == null) { throw new IllegalArgumentException("Name cannot be null for level"); } if (name.toUpperCase().equals("NONE")) { return NONE; } else if (name.toUpperCase().equals("NOVICE")) { return N...
6
public void moveOneStep(){ int sizeBase = AppliWindow.getInstance().getTilesSize(); boolean agentArrived = ((this.position.x > baseDestination.getPosition().x) && (this.position.x < baseDestination.getPosition().x + sizeBase)) && ((this.position.y > baseDestination.getPosition().y) && (this.position.y < bas...
4
public static boolean tryAvoidingEnemyTanks(Unit unit) { // Our own tanks should engage enemy tanks. if (unit.getType().isTank()) { return false; } Collection<Unit> allKnownEnemyTanks = getEnemyTanksThatAreDangerouslyClose(unit); for (Unit enemyTank : allKnownEnemyTanks) { double distance = enemyTank...
6
void setTouched(int tt) { map[tt] |= VISIT; if ((map[tt] & NEB) == 0) { // no bomb around, auto flip for (int i = 0; i < 8; i++) { if ((map[tt + directions[i]] & VISIT) == 0) { // 已翻開就不用再做了 setTouched(tt + directions[i]); } } } }
3
public boolean isAssignableTo(Type type) { if (eq(type.getCtClass(), Type.OBJECT.getCtClass())) return true; if (eq(type.getCtClass(), Type.CLONEABLE.getCtClass())) return true; if (eq(type.getCtClass(), Type.SERIALIZABLE.getCtClass())) return true; ...
9
public DefaultLinkNormalizer(final String beginUrl) { if ((beginUrl == null) || (beginUrl.trim().length() == 0)) { throw new IllegalArgumentException("beginUrl cannot be null or empty"); } this.beginUrl = beginUrl; }
2
private static BufferedImage initRotatedImage(BufferedImage givenImage, int rotationCenterX, int rotationCenterY, double rotatingAngle) { double maxR = -99999; // double minR = 99999; final int maxX = givenImage.getWidth() - 1; final int maxY = givenImage.getHeight() - 1; final int minX = 0; final int mi...
4
public int addUser() { String username = textField.getText(); char[] newpw = PWField.getPassword(); char[] repeat = PWField2.getPassword(); String repeatString = new String(repeat); String newpwString = new String(newpw); if (repeatString.equals(newpwString)) { try { answer = Switch.switchMethod("ad...
5
private void keyActionPerformed(final KeyEvent e) { if (e.isControlDown()) { if (e.getKeyCode() == KeyEvent.VK_N) { this.actionPerformed(new ActionEvent(e.getSource(), -1, "New")); } else if (e.getKeyCode() == KeyEvent.VK_O) { this.actionPerformed(new Acti...
8
public int compareTo(NGram other){ if(weight > other.getWeight()) return -1; else if(weight < other.getWeight()) return 1; else return 0; }
2
public synchronized ArrayList<String> mobilesToBeDeleted() { ArrayList<String> mobilesToBeDeleted = new ArrayList<String>(); ResultSet result = null; String sqlUpdateTable; double curtime = System.currentTimeMillis()/1000; try { connection = (Connection) DriverManager...
4
void buildPolyhedra() { boolean useBondAlgorithm = radius == 0 || bondedOnly; for (int i = atomCount; --i >= 0;) if (centers.get(i)) { Polyhedron p = ( haveBitSetVertices ? constructBitSetPolyhedron(i) : useBondAlgorithm ? constructBondsPolyhedron(i) : construc...
7
private void GenreSearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GenreSearchButtonActionPerformed try { userSocket = new Socket("127.0.0.1", 6666); out = new PrintWriter(userSocket.getOutputStream(), true); in = new BufferedReader(new InputStre...
8
public boolean isInterleave2(String s1, String s2, String s3){ if(s1.length() + s2.length() != s3.length()) return false; boolean[][] matched = new boolean[s1.length() + 1][s2.length() + 1]; matched[0][0] = true; for(int i1 = 1; i1 <= s1.length(); i1++){ if(s3.charAt(i1-1) == s1.charAt(i1-1)) { matched[i...
9
private void setToBlack(byte[] buffer, int lineOffset, int bitOffset, int numBits) { int bitNum = (8 * lineOffset) + bitOffset; int lastBit = bitNum + numBits; int byteNum = bitNum >> 3; // Handle bits in first byte int shift = bitNum & 0x7; if (shift > 0) { int maskVal = 1 << (7 - shift); byte v...
5
public static List<Item> itemList(List<? extends Item> items, char c, HTTPRequest httpReq, boolean one) { if(items==null) items=new Vector<Item>(); final Vector<Item> classes=new Vector<Item>(); List<Item> itemlist=null; if(httpReq.isUrlParameter(c+"ITEM1")) { itemlist=RoomData.getItemCache(); for(i...
9
public void update(int delta){ if(direction==LEFT){ setX(getX()-(SPEED*delta)); }else if(direction==RIGHT){ setX(getX()+(SPEED*delta)); } }
2
public ConditionalEditor() { setTitle("Conditional Editor"); setBounds(100, 100, 450, 300); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); cont...
7
@Override public void run() { mainLoop: while (true) { // update running status for (int i = 0; i < maxClients; i++) { running[i] = listeners[i].clientRunning(); success[i] = listeners[i].success(); } boolean tmp = true...
7
public void changeSignature(String person, String path, String newSign) { try { ArrayList<User> users = DataBase.getInstance().getUsers(); for (Iterator it = users.iterator(); it.hasNext();) { User user = (User) it.next(); if (user.getLogin().equals(person...
5
@Override public DataStructures getKit(){ return outData; }
0
public boolean canMove(int player, Point position) throws IllegalMoveException, CorruptedBoardException, GameEndedException, DrawGameEndedException{ //previousBoard.print("PRZED RUCHEM (S)"); //checking if boards are equal try{ areBoard...
9
public mainClass() { long startTime = System.nanoTime(); //System.out.println("Time 1: " + (System.nanoTime() - startTime) / 1000000); Globals.getInstance().mainFrame = this; Globals.getInstance().listsPacks = this; Globals.getInstance().initializeFolders(); Globals.getInstance().loadPrefe...
7
public SingleTreeNode treePolicy(StateObservation state) { SingleTreeNode cur = this; while (!state.isGameOver() && cur.m_depth < ROLLOUT_DEPTH) { if (cur.notFullyExpanded()) { return cur.expand(state); } else { SingleTreeNode next = cur...
3
private void addSensorEx(){ Sensor input = new Sensor(); input.setUnity("m"); input.setAddDate(new Date(System.currentTimeMillis())); input.setLowBattery(false); input.setStatementFrequency(1222); input.setSamplingFrequency(1000); input.setGpsLocation(-0.127512, 51.507222); input.setName("Sensor_Arrow")...
2
public static int getMaxStandardGenreId() { return MAX_STANDARD_GENRE_ID; }
0
public void changeSocket( int port, String host ) { Socket newSocket; System.out.println( "Connecting to " + host + ":" + port ); try { newSocket = new Socket( host, port ); System.out.println( "Connected to new socket" ); } catch( ClosedByInterruptException ex ) { System.out.println( "input str...
5
boolean canMove() { if (!isFull()) { return true; } for (int x : _0123) { for (int y : _0123) { Tile t = tileAt(x, y); if ((x < ROW - 1 && t.equals(tileAt(x + 1, y))) || (y < ROW - 1 && t.equals(tileAt(x, y + 1)))) {...
7
private void exec(String cmd){ try { Process p = Runtime.getRuntime().exec(cmd); p.waitFor(); if (DEBUG) { BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); String line=reader.readLine(); while(line != null) { System.out.println(line); l...
5
@Override public Writer addRecordEntry(final String columnName, final Object value) { if (value != null) { final ColumnMetaData metaData = this.getColumnMetaData(columnName); final String valueString = value.toString(); if (valueString.length() > metaData.getColLength())...
2
public void addVertices(Vertex[] vertices, int[] indices, boolean calcNormals) { if (calcNormals) { calcNormals(vertices, indices); } size = indices.length; glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData...
1
public void izvrsi(HttpServletRequest req, HttpServletResponse res){ try{ int opcija=Integer.parseInt(req.getParameter("rd")); atributPretrage=""; if(opcija==1){ atributPretrage = "naziv"; } if(opcija==2){ atributPretrage = "opis"; } ...
5
@Override public void handle(Log log) { String start = (String) this.getProperties().get("StartTime"); String end = (String) this.getProperties().get("EndTime"); if(start == null || end == null){ throw new IllegalArgumentException("Start and End Time NOT null"); } List<Log> result = new ArrayList<Log>(); ...
8
Object remove(Object key) throws IOException { int hash = hashCode(key); long child_recid = _children[hash]; if (child_recid == 0) { // not bucket/page --> not found return null; } else { HashNode node = (HashNode) _recman.fetch( child_recid ); ...
6
@SuppressWarnings("unused") // For the console clearer below. public static void main(String[] args) throws InterruptedException { // System.out.println("The other threads dont like all these turtles" // + " drawing over each other,\nJust ignore the oncomming spam"); World world = new World(); Turtle starte...
5
public static void readFile(String fileName) { if (fileName == null) // Go back to reading standard input readStandardInput(); else { BufferedReader newin; try { newin = new BufferedReader( new FileReader(fileName) ); } catch (Exception e) { ...
4
public Agent(int color, boolean learn){ bestMove = nullMove; this.color = color; if(color == Piece.BLACK){ currentMove = 1; } DatabaseParser parser = new DatabaseParser(); allOpeningMoves = parser.parseOpenings(); values = new HashMap<String, Integer>(); if(learn){ values.put("pawn",10); value...
9
public static synchronized Compiler singleton(URLClassLoader parent) { if (instance == null) { instance = new Compiler(parent); } return instance; }
1
public Expression combine(CombineableOperator comb) { Operator combOp = (Operator) comb; if (comb.lvalueMatches(this)) { /* We already checked in canCombine that subExpressions match */ comb.makeNonVoid(); combOp.parent = parent; return combOp; } for (int i = 0; i < subExpressions.length; i++) { ...
3
public void BuildAdventureWorld(String AdventureFile) throws IOException { String line; String data[]; Scanner scan = new Scanner (new File(AdventureFile)); for (int linenr = 1; scan.hasNextLine (); ++linenr) { //looking for "r,d,o,t" //split line //split command --> myString.split("\\s+");...
9
public String getTypeSignature() { if (clazz != null) return "L" + clazz.getName().replace('.', '/') + ";"; else if (ifaces.length > 0) return "L" + ifaces[0].getName().replace('.', '/') + ";"; else return "Ljava/lang/Object;"; }
2
public static int[] twoPair(Carta[] j){ int[] arr = new int[15]; for (int i = 0; i < j.length; i++) arr[j[i].valor]++; int par1 = 0, par2 = 0, remaining = 0; for (int i = 0; i < arr.length; i++) if(arr[i] == 2 && par1==0)par1 = i; else if(arr[i] == 2)par2 = i; else if(arr[i] == 1)remaining = i; ...
8
@Override public void valueUpdated(Setting s, Value v) { if (s.getName().equals(EndTrigger)) { try { boolean b = v.getBoolean(); if (b && endTrigger_ == null) { endTrigger_ = addOutput("End trigger", ValueType.VOID); } else if (!b && endTrigger_ != null) { removeOutput(endTrigger_); end...
6
public void start() { if(thread == null) { thread = new Thread(this); } if(thread.getState() == Thread.State.NEW) { thread.start(); } }
2
private void updateStateNotFound(List<Keyword> keywords, List<String> terms, List<String> approval) { if (approval.size() == 1) { if (approval.get(0).equals("yes") || approval.get(0).equals("Yes")) { getCurrentDialogState().setCurrentState(Start.S_WAITING_FOR_EMPLOYEE_STATUS); return; } else { ...
3
public static Car driverCar(String car) throws Exception { // 判断逻辑,返回具体的产品角色给Client if (car.equalsIgnoreCase("Benz")) { // equalsIgnoreCase:String类的方法,两个字符串比较,不考虑大小写 return new Benz(); } if (car.equalsIgnoreCase("Bmw")) { return new Bmw(); } if (car.equalsIgnoreCase("Audo")) { return new Audo(); ...
3
private void initComponents() { ListaAtracoes lstAtracoes = new ListaAtracoes(); PnlConjuntoImagens imagemMonumento = null; JScrollBar scrollBar = new JScrollBar(); //Monumento mais Visto Atracao monumento = lstAtracoes.monumetoMaisVisto(); try { imagemMonum...
6
@Override public void updateView() { listModel.removeAllElements(); for (File p : controller.getModel().getFilesToExclude()) { listModel.addElement(p); } excludedPathsList.setModel(listModel); }
1
@Override public int hashCode() { return (sequence == null ? 0 : sequence.hashCode()) ^ (value == null ? 0 : value.hashCode()); }
2
public double getGyroAngle(){ return _gyro.getAngle(); }
0
public static String getHumanSpeed(Long speed) { if (speed == null) { return ""; } String s = ""; double num = 0; if (speed < 1024) { num = speed; } else if (speed < (1024 * 1024)) { num = (double) speed / 1024; s = "Kb/s...
4
public static int calcSoftFour(Session aSession, Lecture aLecture) { int penalty = 0; List<Student> studentsEnrolledInLec = aLecture.getEnrolledStudents(); for(Student student : studentsEnrolledInLec){ List<Lecture> studentsLectures = student.getEnrolledLectures(); List<Session> studentSessions = new ArrayL...
6
private static ConnectedComponent findComponent(Long2ShortHashMapInterface hm, long startKmer, LongArrayFIFOQueue queue, int k, int b2, int newFreqThreshold) { ConnectedComponent comp = new ConnectedComponent(); ...
8
public static String[] print(int[] result) { String[] w = new String[result.length]; for (int i=0; i<w.length; i++) w[i] = ""; for (int i=0; i<result.length; i++) { for (int j=0; j<result.length; j++) { if(j == result[i]) { w[i] = w[i] + "Q";...
4
public static void main(String[] args) { Demo02 demo = new Demo02(); demo.method_1(10, 20,new MyHanderInt() { @Override public int doThis(int a, int b) { return a+b; } }); }
0
@Override public void actionPerformed(ActionEvent e) { Component source = (Component) e.getSource(); if(e.getSource().equals(file)){ new FilePopup(dw).show(source,0,getHeight()); }else if(e.getSource().equals(edit)){ new EditPopup(paint).show(source,0,getHeight()); }else if(e.getSource().equals(di...
4
public void keyPressed(boolean[] keys, KeyEvent e) { int keyCode = e.getKeyCode(); if (keyCode==37) parent.cellsManager.shiftSelectButton(-1);// left if (keyCode==39) parent.cellsManager.shiftSelectButton(1);// right if (keyCode==8) parent.cellsManager.deleteLastChar(); if (keyCode!=37 && keyCode!=39 && keyCo...
9
@Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("LineString")) { inLineString = false; } if (inCoordinate && inLineString && qName.equals("coordinates")) { String[] data = coordinates.toString().trim().split("\\s+"); dou...
8
public void actionPerformed(ActionEvent e) { String selected = e.getActionCommand(); if (selected == "ダイアログ") { displayDialog(); } else if(selected == "exit") { Pref.saveLayout(getX(), getY()); Pref.save(tp.getBColor(), tp.getSColor(), tp.getFontName(), String.valueOf(tp.getFontSize())); System.exit(0...
6
public static int[][] get(int x) { if(x == 1) return level1; else if(x == 2) return level2; else if (x == 3) return level3; else if (x == 4) return level4; else if(x == 5) return level5; else if (x == 6) return level6; else if (x == 7) return level7; else if (x == 8) return leve...
8
public double getCond() { if (cond == Double.MIN_VALUE) { Double max = Double.MIN_VALUE; Double min = Double.MAX_VALUE; double[] sngValues = getSingularValues(); for (int idx = 0; idx < sngValues.length; idx++) { if (sngValues[idx] > max) { max = sngValues[idx]; } if (sngValues[idx] < m...
5
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
@Override public boolean containsAll(Collection<?> c) { for (Object o : c) { if (!typeKey.containsKey(o)) return false; } return true; }
3
public void setPlayerSpawnLocation(Location playerspawn) { this.playerspawn = playerspawn; }
0
public static void main(String[] rags) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] l = in.readLine().split(" "); int n = Integer.parseInt(l[0]); int total = n; long c = Long.parseLong(l[1]); ArrayList<Integer> chpts = new ArrayList<Integer>(); int...
4
public boolean addFrame(BufferedImage im) { if ((im == null) || !started) { return false; } boolean ok = true; try { if (!sizeSet) { // use first frame's size setSize(im.getWidth(), im.getHeight()); } image = im; getImagePixels(); // convert to correct format if necessary analyzePixels...
7