text
stringlengths
14
410k
label
int32
0
9
private void expTypeChanged() { if (m_Exp == null) return; // update parameter ui if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) { m_ExperimentParameterLabel.setText("Number of folds:"); m_ExperimentParameterTField.setText("" + m_numFolds); } else { m_Experi...
7
private double[] charToDouble(char[] responses){ int n = responses.length; double[] converted = new double[n]; for(int i=0; i<n; i++){ double holdi = (double)((int)responses[i]); if(holdi>96.0){ converted[i] = holdi-96.0; } else{ ...
2
public void drawCities(){ for ( int r = 0; r < GameConstants.WORLDSIZE; r++ ) { for ( int c = 0; c < GameConstants.WORLDSIZE; c++ ) { City city = game.getCityAt(new Position(r, c)); if (city != null){ CityFigure cf = new CityFigure(city, ...
3
@Override public boolean equals(Object obj) { if (!(obj instanceof LabelBlock)) { return false; } LabelBlock that = (LabelBlock) obj; if (!this.text.equals(that.text)) { return false; } if (!this.font.equals(that.font)) { return fal...
8
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { currentRound++; jLabel7.setText(g.makeThrow(2)); jLabel3.setText(g.getScore()); jLabel6.setText(g.getPredictedThrow()); if(currentRound == numberOfThrows) { JOptionPane.showMessageDialog(this, "Final Score: " + g...
1
public char skipTo(char to) throws JSONException { char c; try { int startIndex = this.index; int startCharacter = this.character; int startLine = this.line; reader.mark(Integer.MAX_VALUE); do { c = next(); if (c...
3
private static void doArchive() throws MVDException { try { MVD mvd = loadMVD(); File m = new File( mvdFile ); File archiveDir; XMLGuideFile guideFile = new XMLGuideFile( mvd ); // create default archive name if ( archiveName == null ) { archiveName = m.getName(); int index = archiveNa...
4
int getId() { return id; }
0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Note note = (Note) o; if (id != note.id) return false; if (headLine != null ? !headLine.equals(note.headLine) : note.headLine != null) return f...
8
public Deck() { cards = new ArrayList<DevCard>(25); for (int i = 0; i < 14; i++) cards.add(new DevCard("Knight")); cards.add(new DevCard("Progress", "Road building")); cards.add(new DevCard("Progress", "Road building")); cards.add(new DevCard("Progress", "Year of plenty")); cards.add(new DevCard("Prog...
2
public static int nextSequenceNumber(int sequenceNumber) { if(sequenceNumber == Packet.SEQUENCE_NUMBER_NOT_APPLICABLE || sequenceNumber == Packet.MAXIMUM_SEQUENCE_NUMBER) return Packet.MINIMUM_SEQUENCE_NUMBER; return sequenceNumber + 1; }
2
public Quicksort(int[] values) { this.numbers = values; }
0
public void addItem(Item item) { for(int x = 0; x<size; x++) { if(items.get(x).getID() == 0) { items.set(x, item); break; } } }
2
public String toString() { String rankStr = null; if(rank == 11) { rankStr = "jack"; String str = rankStr+suit; return str; } else if(rank == 12) { rankStr = "queen"; String str = rankStr+suit; return str; } ...
4
@Override public int read(char cbuf[], int off, int len) throws IOException { // System.out.println("read() off:" + off + " len:" + len); // Fetch new line if necessary if (curLine == null) { getNextLine(); } // Return characters from current line if (cur...
7
@Override public void run() { try { String dur=null; int[][] A = new int[cnt][cnt],B=new int[cnt][cnt],C=new int[cnt][cnt]; int_mat(A); int_mat(B); long start=System.currentTimeMillis(); integer_operation(A, B, C); long end=System.currentTimeMillis(); dur=end-start+""; Syst...
1
@Override public void actionPerformed(ActionEvent event) { String userkey = projectName.getText().toString(); String mess = p_dao.saveProject(userkey); if(event.getActionCommand().equals("Add")){ if(!userkey.equals("")) { message.setText(mess); projectName.setText(""); if(mess.contain...
6
private void buildTranslationTable(BufferedReader buf) throws IOException { translationTable = new Hashtable<String, String>(); String line = buf.readLine(); while(line!=null && ! line.contains(";")) { String[] parts = line.split("\\s+"); if (parts.length>2) { int index = 0; while(index<parts.len...
7
public static void main(String [] args){ String path = new String("/home/elblonko/Desktop/DICOMFiles/BRAINIX/sequence/IM-0001-0001.dcm"); //Number of files in the path File fileDir = new File("/home/elblonko/Desktop/DICOMFiles/BRAINIX/sequence"); int numFiles = fileDir.listFiles().leng...
3
public int compare(Object d1, Object d2) { //put non display modes at bottom if(!(d1 instanceof DisplayMode)) { return 1; } if(!(d2 instanceof DisplayMode)) { return 1; } //now compare bit depth and resolution ...
8
public boolean SetBusActiveStatus(int busNumber, int inputBufferNumber, int packetSequence, int TIME, ConfigFile cfg) { //REMOVE IN CROSSBAR FABRIC TYPE //only one bus present in this fabric type, busNumber = 0; //ensure valid busNumber chosen //if(((busNumber+1)<= ...
7
public boolean estVoisin(Region r) { int i = 0; while ((r.nom != voisins[i].nom) && (i != voisins.length)) { i++; } if (!(r.nom == voisins[i].nom)) return false; return true; }
3
private String[] getEnabled() { enabledMods.clear(); if(folder.exists()) { for(String name : folder.list()) { if(name.toLowerCase().endsWith(".zip")) { enabledMods.add(name); } else if(name.toLowerCase().endsWith(".jar")) { enabledMods.add(name); } else if(name.toLowerCase().endsWith(".lite...
6
public ManaCrystal getClosestCrystal(Point point) { double min = Double.POSITIVE_INFINITY; ManaCrystal closestManaCrystal = null; for(ManaCrystal manaCrystal : manaCrystals) { if(manaCrystal instanceof ManaCrystal) { if(Geometry.squareDistance(point, manaCrystal.getPoint()) < min) { min = Geometry.squ...
3
public static String getSig() { StackTraceElement st = (new Throwable()).getStackTrace()[1]; return st.getClassName() + "#" + st.getMethodName(); }
0
@Override public String toString() { String result = "\tHandicap Situation:"; if(problemWithFontSize) result = result + "\n\t\tPROBLEM WITH FONT SIZE!"; if(problemWithMagnification) result = result + "\n\t\tPROBLEM WITH MAGNIFICATION!"; if(problem...
6
private RequirementElement parseReqElementInfo(List<String> factors) { /* * this part is exclusively for requirement elements 0)notation,element; * 1)id,51670; 2)shape,Hexagon; 3)name,Calculate price; * 4)layer,Business; 5)thickness, 1.0; 6)double stroke; 7)size: * 117.945899963379 43.817626953125; 8)no f...
9
public void mouseWheelMoved (MouseWheelEvent event) { if (!(doorgaan_thread) && (doorgaan_wheel)) // deze methode alleen uitvoeren als de thread uitstaat EN { // 'het verplaatsen mbv het wieltje' aan int ticks = event.getWheelRotation(); // wat levert dit op? ...
4
@Override public WriteMsg write(long txnID, long msgSeqNum, FileContent data) throws RemoteException, IOException { String fileName = data.getFileName(); // if this is the first message, we obtain a lock on file first if (msgSeqNum == 1) { Semaphore lock = null; if (!fileLock.containsKey(fileName)) { ...
3
public boolean hasNext() { return current != null; }
0
static void mergeTryCatch(FlowBlock tryFlow, FlowBlock catchFlow) { if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_ANALYZE) != 0) GlobalOptions.err.println("mergeTryCatch(" + tryFlow.getAddr() + ", " + catchFlow.getAddr() + ")"); tryFlow.updateInOutCatch(catchFlow); tryFlow.mergeSuccessors(catchF...
1
@POST @Path("/{algorithm}/{provider}/list") @Consumes(APPLICATION_JSON) public String list(@PathParam("algorithm") String algorithm, @PathParam("provider") String provider, String keystoreAndPassword) { InputStream inputStream = null; try { KeyStore keySto...
9
@Override public void selectElement() { assert isInitialized : "Menu not initialized"; Choice pointedChoice = Choice.values()[getPointedElementId()]; switch (pointedChoice) { case RETURN: close(); break; case USE: setChanged(); ...
5
@Test public void getBeansWithObjectAndAnyQualifierShouldReturnGenericBeans() { final Collection<Object> beans = beanLoader.getBeans(Object.class, "any"); assertNotNull(beans); assertEquals(BeanCount.SCANNED.getNumberOfBeans(), beans.size()); boolean foundListOfOneStuffBean = false...
7
public NotFunc() { setLayout(new BorderLayout(0, 0)); JButton btnSorrynotImplementedYet = new JButton("sorry,not implemented yet (not enough time ; < )"); btnSorrynotImplementedYet.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { MainFrame.cardLayout.show(getParent()...
0
private void flushFlags(int totalFields, int[] fieldNums) throws IOException { // check if fields always have the same flags boolean nonChangingFlags = true; int[] fieldFlags = new int[fieldNums.length]; Arrays.fill(fieldFlags, -1); outer: for (DocData dd : pendingDocs) { for (FieldData fd...
8
private int get() throws IOException { if (start > end) { if (end > BACK) { int len = Math.min(BACK, end - BACK + 1); System.arraycopy(buf, end + 1 - len, buf, BACK - len, len); back = BACK - len; } if (in != null) { if (!in.markSupported()) in = new BufferedInputStream(in); this.reader ...
6
public Node<Integer> findKthToLastElemItr(Node<Integer> head, int k) { Node<Integer> p = head; for (int i = 0; i < k - 1; i++) { if (p == null) return null; p = p.next; } Node<Integer> q = head; while (p.next != null) { p = p.next; q = q.next; } return q; }
3
public static boolean createContactAccount(int index, String contactID, String label, String nymID, String acctID, String assetID, String serverID, String serverType, String publickey, String memo) { System.out.println("createContactAccount contactID:"+contactID); boolean status = false; Address...
7
public void create( int subdivisions, Vector3f p1, Vector3f p2, Vector3f p3, Vector3f p4 ) { if ( subdivisions <= 0 ) { if ( pok % 2 == 0 ) { triangles.add( new Triangle( p3, p1, p4 ) ); triangles.add( new Triangle( p4, p1, p2 ) ); } else { triangles.add( new Triangle( p1, p2, p3 ) ); ...
2
public ArrayList<Molecule> split(int[] MoleculeID){ ArrayList<Molecule> fragments = new ArrayList<Molecule>(); int len = (Arrays.equals(MoleculeID, new int[0])) ? 0 : MoleculeID.length; Molecule splitPoint = getFromMoleculeID(MoleculeID, MoleculeID.length, 0); //System.out.println("S...
1
public static int value(tile input) { int output = 0; for (int y = -1; y < 2; y++) { for (int x = -1; x < 2; x++) { if (x != 0 || y != 0) { if (input.getX() + x >= 0 && input.getX() + x <= 9 && input.getY() + y >= 0 && input.getY() + y <= 9) { if (board[input.getX() + x][input.getY() + y].g...
9
public void update(GameContainer gc, StateBasedGame sbg, int delta)throws SlickException { if(!isGameOver) { if(!isPause) { } else { } } else { } }
2
public List<Partner> findPartnersByHallEventIdAndRoleName( final Long hallEventId, final String partnerRoleName ) throws WrongTypeNameException { return new ArrayList<Partner>(); }
0
public int move(int d, boolean findChange) { if (d == 0) return moveDown(findChange); if (d == 1) return moveLeft(findChange); if (d == 2) return moveUp(findChange); if (d == 3) return moveRight(findChange); if (d > 3 || d < 0) System.err.println("Invalid move"); return -...
6
private Object readBinding(Object source) { try { if (source == null) { return null; } if (this.pathName == ".") { return source; } else { return source.getClass().getMethod("get" + this.pathName).invoke(source); ...
5
@Override public Object getValueAt(Object object, int row, int col) { Prestamo prestamo = (Prestamo) object; try { if (col == 0) { return prestamo.getUsuario().getDNI(); } else if (col == 1) { return prestamo.getUsua...
8
public int[] returnInts () { int itotal=totalLength/8; int out[]=new int[itotal]; BitSet bset=new BitSet(); int a,tc=counter,bcount=0,ocount=0; for (a=0;a<totalLength;a++) { if (this.get(tc)==true) bset.set(bcount); else bset.clear(bcount); bcount++; if (bcount==8) { out[ocount]=binaryToInt8(b...
4
public static void markText(JTextComponent pane, int start, int end, SimpleMarker marker) { try { Highlighter hiliter = pane.getHighlighter(); int selStart = pane.getSelectionStart(); int selEnd = pane.getSelectionEnd(); // if there is no selection or selection do...
8
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((base == null) ? 0 : base.hashCode()); result = prime * result + ((seed == null) ? 0 : seed.hashCode()); return result; }
2
@Override public boolean tick(Tickable ticking, int tickID) { if(!(affected instanceof MOB)) return super.tick(ticking,tickID); final MOB mob=(MOB)affected; if(tickID!=Tickable.TICKID_MOB) return true; if(!proficiencyCheck(null,0,false)) return true; if((mob.curState().getHunger()<=0) ||(mob.c...
8
protected Behaviour getNextStep() { if (lead == null) findLead() ; if (expired()) { //I.say(actor+" performance has expired...") ; return null ; } if (client != null) { final Recreation r = new Recreation(client, venue, type) ; if (client.matchFor(r) == null) { final Acti...
4
public void treatBackstageOnly(Item item){ if (item.isLessSellInThan(11) && item.isLessQualityThan(50)) { item.increaseQuality(); } if (item.isLessSellInThan(6) && item.isLessQualityThan(50)) { item.increaseQuality(); } }
4
public static RepNotification GET_NOTIFICATIONS(OVNotification oVNotification) throws SQLException { RepNotification rep = new RepNotification(); Connection connexion = GET_CONNECTION(); try { int distance = oVNotification.getDistance(); int major = oVNotification.getOvB...
6
private String keyToString(JsonElement keyElement) { if (keyElement.isJsonPrimitive()) { JsonPrimitive primitive = keyElement.getAsJsonPrimitive(); if (primitive.isNumber()) { return String.valueOf(primitive.getAsNumber()); } else if (primitive.isBoolean()) { return Boo...
5
void copyIso8859_1ReadBuffer(int count) { int i, j; for (i = 0, j = readBufferPos; i < count; i++, j++) { readBuffer[j] = (char) (rawReadBuffer[i] & 0xff); if (readBuffer[j] == '\r') { sawCR = true; } } readBufferLength = j; }
2
public void build () throws ExceptionInvalidParam { if ( upperXBound <= lowerXBound || upperZBound <= lowerZBound || destWidth <= 0 || destHeight <= 0 || sourceModule == null || destNoiseMap == null) throw new ExceptionInvalidParam ("Invalid ...
9
public static void move(int d) { if (d == 0) { System.out.println("down"); Main.fenrir.pressKey(40); } else if (d == 1) { System.out.println("left"); Main.fenrir.pressKey(37); } else if (d == 2) { System.out.println("up"); M...
4
public void updateInterventionForce() { Specification spec = getSpecification(); int interventionTurns = spec.getInteger("model.option.interventionTurns"); if (interventionTurns > 0) { int updates = getGame().getTurn().getNumber() / interventionTurns; for (AbstractUnit un...
7
private void deleteSelected() { if (JOptionPane.showConfirmDialog(frmDictionaryEditor, Localization.getInstance().get("messageConfirmEntryDelete")) != JOptionPane.OK_OPTION) { return; } try { for (Long id : getSelectedIDs()) { dic.deleteEntry(id); } } catch (Exception ex) { showError(Localizatio...
3
private void render() { if (this.world != null) { Iterable<Chunk> chunks = this.world.getLoadedChunks(); for (Chunk chunk : chunks) { for (int section = 0; section < 8; section++) { if (chunk.getVboId(section) == 0) { int vboId = glGenBuffersARB(); chunk.setVboId(section, vboId);...
5
public ListenerThread(ActiveMQConnectionFactory factory, ConcurrentMap<String, MessageAdaptor> messageResponse, String topic) { this.factory = factory; this.messageResponse = messageResponse; this.topic = topic; }
0
private int swim(int i) { Key t = pq[i]; // Save key for later restoring while (i > 1 && greater(pq[i / 2], pq[i])) { // exch(pq, i / 2, i); pq[i] = pq[i / 2]; // half exchanges i = i / 2; } pq[i] = t; // restore key return i; }
2
public Map load(String path, Sprite sprite) { try { inputStream = new FileInputStream(new File(getClass().getResource(path).toURI())); //Some crap to read file BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); byte[] data = ...
2
public boolean isWide() { return (desc.charAt(0) == Type.LONG_CHAR) || (desc.charAt(0) == Type.DOUBLE_CHAR); }
1
Subject[] generateSubjectGroup(int size, int[] code, int[] slot, String[] name){ Subject[] s = new Subject[size]; ArrayList<Subject> arr = new ArrayList<>(size); int t = 1; for(int i=0; i<size; i++){ int k = (int)(size * Math.random()); arr.add(new Subject(code[k ...
4
@Override public void iterate() { try { if (isAllyControlled()) { targets = renderer.getEnemyShips(); } else { targets = renderer.getAllyShips(); } } catch (NullPointerException ex) { this.setRemovable(); } ...
9
@Override // KEY LISTENER FUNCTIONS public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); if(keyCode == KeyEvent.VK_LEFT){ mainPlayer.setLeft(true); } if(keyCode == KeyEvent.VK_RIGHT){ mainPlayer.setRight(true); } if(keyCode == KeyEvent.VK_UP){ mainPlayer.setUp(true); } if(keyCo...
5
private void printEntitiesInNary(ORASSNode node, String naryRelName, List<String> entities, int currEntityIndex, int numOfTabs) { String entityName = node.getName(); writer.println(getTabs(numOfTabs) + "<xs:element name=\""+entityName+"\" minOccurs=\"0\" maxOccurs=\"unbounded\">"); writer.println(getTabs(numOf...
7
protected void initDefaultStyle() { if(this.styleMap == null) { this.styleMap = DefaultStyle.getDefaults(); } //background if(!styleMap.containsKey(BACKGROUND_KEY)) styleMap.put(BACKGROUND_KEY, new Color(209,215,226)); //header title font if(...
8
public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative"); if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative"); double ...
4
public State[] getUnreachableStates() { ArrayList list = new ArrayList(); State[] states = myAutomaton.getStates(); /** Create nodes for DFS. */ initializeNodes(states); Node initialNode = getNodeForState(myAutomaton.getInitialState()); /** Start DFS at node representing initial state. */ visit(initialNo...
2
public static synchronized void updateDynmapVersion(String dynmapVersion) { if (Main.dynmapVersion != null) { if (!Main.dynmapVersion.equals(dynmapVersion)) { logger.error("You use different Versions of Dynmaps"); System.exit(-1); } } else { ...
2
public void doINTERPRET(){ try{ System.out.print("> "); in.readLine(); String curWord = null; while((curWord = in.getNextWord()) != null){ int word = dict.find(curWord); if(word != -1){ if(state == STATE_INTERP){ dict.runWord(word, this); }else...
7
private int yy_advance () throws java.io.IOException { int next_read; int i; int j; if (yy_buffer_index < yy_buffer_read) { return yy_buffer[yy_buffer_index++]; } if (0 != yy_buffer_start) { i = yy_buffer_start; j = 0; while (i < yy_buffer_read) { yy_buffer[j] = yy_buffer[i]; ++i; ...
7
public DotBracketNotation(Sequence aSequence, String aDotBracketNotation) throws InvalidDotBracketNotationException { if (aSequence.getLength() != aDotBracketNotation.length()) { throw new InvalidDotBracketNotationException( "Sequence and dot bracket notation are not the same length."); } if (!this.is...
9
StructInfo(Class<?> clz) { this.clz = clz; Field[] fields = clz.getDeclaredFields(); List<FieldMarshal> required = new ArrayList<FieldMarshal>(); for (Field i : fields) { boolean ignore = Modifier.isStatic(i.getModifiers()) || ...
8
public String getSqlStatement() throws ParseException, IOException { StringBuilder sb = new StringBuilder(); // for (int k = 1; k <= 1; k++) { for (int k = 1; k <= 66; k++) { for (int chapter = 1; chapter <= CHAPTER_COUNT_1TO66[k]; chapter++) { String str = g...
2
public static AutomatonTable getConnections(Map<Integer, ZState> states){ List<Connection> connections = new ArrayList<>(states.size()); List<String> ids = new ArrayList<>(); List<boolean []> codes = new ArrayList<>(); AutomatonTable table = new AutomatonTable(); table.c...
4
@Override public String getSex() { return super.getSex(); }
0
public synchronized void update(long timePassed) { if (scenes.size() > 1) { movieTime += timePassed; if (movieTime >= totalTime) { movieTime = 0; sceneIndex = 0; } if(movieTime > getScene(sceneIndex).endTime) { scene...
3
public static void main(String args[]) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for (int circle = 1; ; circle++) { int number = Integer.parseInt(reader.readLine()); if (number != 0) { String currentStr = reader.readLine(); System.out.println...
8
protected Script createAddScript(Path resourcefile, List<ResourceVO> resources, Path resHackerLog) { assert (resourcefile != null) && (resHackerLog != null); assert (resources != null) && !resources.isEmpty(); List<String> sb = new LinkedList<>(); Iterator<ResourceVO> i = resources.list...
4
public void move() { switch(direction) { //1 Up/Left case 1: { TLY -= DY * localG.delta; TRY -= DY * localG.delta; BLY -= DY * localG.delta; BRY -= DY * localG.delta; TLX -= DX * localG.delta; BLX -= DX * localG.delta; TRX -= DX * localG.delta; BRX -= DX * localG.delta...
6
public void makeMatrix(boolean andriodOnly) throws Exception{ ASTClassNode acn=(ASTClassNode)this.beginNode; PrintWriter pwOut=new PrintWriter(new FileOutputStream(jarName+".txt")); // this.json=new PrintWriter(new FileOutputStream(this.jarName+"_json.txt")); for(ASTNode tempHead:acn.getChild()){ ASTClassNode...
8
public void executeQuery(String query) throws ExecutorException { Connection connection = null; Statement statement = null; try { connection = DriverManager.getConnection(url, user, password); statement = connection.createStatement(); statement.executeUpdate(query); } catch (SQLExcept...
4
private void txtNomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtNomActionPerformed
0
@Override public String toString() { String result; switch(type) { case CLASS_LABEL: boolean firstLabel = true; result = ""; for(String val : values) { if(!firstLabel) { result += ", "; } else { firstLabel = false; } result += val; } break; case INPUT_CONTINUOUS: res...
9
private byte[] findError(DatagramPacket packet) { byte temp[] = new byte[2]; System.arraycopy(packet.getData(), 2, temp, 0, 2); if(this.packetType == 1 || this.packetType == 2) { for (int i = 0; i < 4; i++) { if(packet.getData()[i] != this.comparitorA[i]) return packet.getData(); } return makeError(p...
8
protected JTable createTable(final Transition transition) { TableModel model = createModel(transition); final TipLambdaCellRenderer[] renders = new TipLambdaCellRenderer[model .getColumnCount()]; for (int i = 0; i < model.getColumnCount(); i++) renders[i] = transition instanceof TMTransition ? new TipLambd...
6
public static void main(String[] args) { System.out.println("Hello World!"); FileInputStream ml_file = null; String parent_path = "I:\\JetBrains\\PsychoCompiler\\src\\main\\resources\\MyLang_code\\"; String file_name = "MyLang_simple_1.ml"; File file = new File(parent_path + f...
6
public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) { if (triangle == null || triangle.size() == 0) { return 0; } int n = triangle.size(); int[][] sum = new int[n][n]; for (int i = 0; i < n; i++) { sum[n - 1][i] = triangle.get(n - 1).get(i); } for (int i = n - 2; i >= 0; i--) { for...
5
static final boolean method245(int i, int i_2_, int i_3_, byte i_4_) { if (i_4_ < 38) return false; anInt8619++; Interface10 interface10 = (Interface10) r_Sub2.method3297(i, i_2_, i_3_); boolean bool = true; if (interface10 != null) bool &= Class55.method520(interface10, -1); interface10 = ((Interf...
5
@Override public List<ValidateException> validate(String parameter) { List<ValidateException> validateExceptionList = new LinkedList<>(); final int identificationNumberLength = 10; if (!ValidateUtils.stringLengthValidation(parameter, identificationNumberLength)) { String exMsg =...
1
@Override public void doLogic() { if (inputList[0] == true || inputList[1] == true){ power = false; } else { power = true; } // Resets power if not still pressed inputList[0] = false; inputList[1] = false; }
2
private void insert_recursive(LUSTree node){ build_id = node.index+1; //The new card cannot be inserted here (wouldn't be sorted) if (node.card < card) build_result = false; else{ build_result = false; //Check to see if it can be inserted somewhere further for (LUSTree n: branches){ //T...
7
public DLLResource(Path script) { if (script == null) { IllegalArgumentException iae = new IllegalArgumentException("The scriptfile path must not be null!"); Main.handleUnhandableProblem(iae); } this.packer = new ResourcePacker(RESOURCE_HACKER); this.script = new...
1
public int getTimeout() { if (socket != null) try { return socket.getSoTimeout(); } catch (IOException exc) { exc.printStackTrace(); return -1; } else return timeout; }
2
public List<Survivor> getSurvivorsNotPicked() { List<Survivor> res = new LinkedList<Survivor>(); for (Survivor s : game.getSurvivors()) { boolean alreadyChosen = false; for (RaidSettings raid : this.raids) { if (raid.getTeam().contains(s)) { alreadyChosen = true; } } if (!alreadyChosen) ...
4
private SGFLeaf readLeaf( StreamTokenizer st ) throws IOException, SGFException { SGFLeaf leaf = null; SGFToken sgfToken; int token; // Keep reading in tokens until the end of the file, the start of a new // leaf, start of a new tree, or end of the current tree/game. These // are a semi...
8