text
stringlengths
14
410k
label
int32
0
9
@Override public Object esegui() throws ExtraTokenException, OperazioneNonValidaException, ParentesiParsingException, OperandoMissingException, ParsingException, OperatoreMissingException { VarRepository variabili = VarRepository.getInstance(); ArrayList<Token> lineaCodiceProvvisoria = (ArrayList<Token>)lineaCodi...
8
public DialogSettings() { super(); initComponents(); }
0
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public void editStartURL() { JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(false); int result = fc.showOpenDialog(null); if (result != JFileChooser.APPROVE_OPTION) return; URL url = null; try { url = fc.getSelectedFile().toURI().toURL(); ...
2
private void timeOut() { boolean timedOutBeforeConnecting = false; boolean timedOutAfterConnecting = false; synchronized(CONNECTION_LOCK) { if(isAttemptingToConnect) { logger.fine("Connection to " + serverAddress + ":" + serverPort + " timed out"); closeConnection(); timedOutBeforeConnecting = true...
5
public static void main( String[] argv ) throws IOException { BufferedReader reader = new BufferedReader( new FileReader( ITEM_KEYWORDS ) ); System.out.println( "Scanning for keyword array size" ); int linesComplete = 0; String line = reader.readLine(); while( line != ...
8
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { AjaxRequest ajaxRequest = AjaxRequest.action(request); Player player = ajaxRequest.getPlayer(); Field field = ajaxRequest.getField(); String status = "true"; Integer amount = 0; Transa...
6
public boolean load(String audiofile) { try { setFilename(audiofile); sample = AudioSystem.getAudioInputStream(getURL(filename)); clip.open(sample); return true; } catch (IOException e) { return false; } catch (UnsupportedAudioFileException e) { return false; } catch (LineUnavailableException...
3
public void handshake() throws Exception { String raw_message = ""; String[] token = new String[3]; generateHash(); while(true) { while(incoming.ready()) { raw_message = incoming.readLine(); token = raw_message.split(":"); if(token[0].equals("hash")) { sendHandshakeMessage("hash:" + serverI...
9
public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[58]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 31; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { i...
9
@Override public void deserialize(Buffer buf) { msgType = buf.readByte(); if (msgType < 0) throw new RuntimeException("Forbidden value on msgType = " + msgType + ", it doesn't respect the following condition : msgType < 0"); msgId = buf.readShort(); if (msgId < 0) ...
3
public boolean notReadyToPlay() { detectLinesAndCols(); for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) if (matrixb[i][j]) return true; return false; }
3
public List<E> getAll() { List<E> clients = new ArrayList<E>(); try { ResultSet rs = select.executeQuery(); while(rs.next()){ clients.add(build(rs)); } } catch(Exception ex) { ex.printStackTrace(); } return clients; }
2
protected Integer calcBPB_TotSec16() { byte[] bTemp = new byte[2]; for (int i = 19;i < 21; i++) { bTemp[i-19] = imageBytes[i]; } BPB_TotSec16 = byteArrayToInt(bTemp); System.out.println(BPB_TotSec16); return BPB_TotSec16; }
1
public void populateCritter(int numCritters, Class<? extends Critter> critterType) { populationCounters.put(critterType, new Integer(numCritters)); for (int i = 0; i < numCritters; i++) { if (population == maxPopulation) { return; } try { addCritter(critterType.newInstance()); } catch (Insta...
5
private static final long[] evaluate(long[] data) { long[] evl = new long[smp.length]; for (int i = 0; i < smp.length; i++) { evl[i] = 1L; for (long j : data) evl[i] = PF.mul(evl[i], PF.sub(smp[i],j)); } return evl; }
2
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public void makeDeclaration(Set done) { super.makeDeclaration(done); if (isConstructor() && !isStatic() && (Options.options & Options.OPTION_ANON) != 0) { ClassInfo clazz = getClassInfo(); InnerClassInfo outer = getOuterClassInfo(clazz); ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz);...
6
protected void readChild(XMLStreamReader in) throws XMLStreamException { Game game = getGame(); if (in.getLocalName().equals(IndianSettlement.MISSIONARY_TAG_NAME)) { in.nextTag(); // advance to the Unit tag missionary = updateFreeColGameObject(in, Unit.class); in.next...
7
public static void parse(final File file, final ConfigHandler handler) throws IOException, ParseException { final String raw = IOUtils.toString(new FileInputStream(file)); final JSONArray routes = (JSONArray) JSONValue.parseWithException(raw); for (Iterator<Object> iter= routes.iterator() ; iter...
5
private void updateBuyButton() { if (Inventory.money >= amount && amount > 0) buyButton.setEnabled(true); else buyButton.setEnabled(false); }
2
public boolean addStore(OfflinePlayer player,Chest chest){ if(player==null || chest==null) return false; if(isStore(chest)) return false; if(isCoffer(chest)) return false; stores.put(chest, new Store(this,player,chest)); saveStores(); return true; }
4
public void ensureContainedTablesExist(ConnectionWrapper cw) throws SQLException, SchemaPermissionException { // a list of contained classes that must be added ArrayList<Class<?>> containedClasses = new ArrayList<Class<?>>(); if (this.clazz.isArray()) { if (!ObjectTools.isDatabasePrimitive(clazz.getCompone...
9
public int getBoilerState() { return this.boilerState; }
0
public List<List<Card>> getSets(List<Card> cards) { List<Card> flushSet; List<Card> pairSet1; List<Card> pairSet2; List<Card> straitSet; List<List<Card>> pairSets; List<List<Card>> sets; sets = new ArrayList<>(); pairSets = Ranking.checkP...
6
public boolean accept(File file){ if (file.isDirectory()){ return true; } else { String path = file.getAbsolutePath().toLowerCase(); for (int i = 0, n = extensions.length; i < n; i++) { String extension = extensions[i]; if ((path.endsWith(extension) && (path.charAt(path.length() - extension.lengt...
4
public static Object invokeMethod(Object o, String methodName) { if (Functions.isEmpty(methodName)) return null; if (o == null) return null; Object retObj; try { Class<?> c = o.getClass(); if (c == null) return null; Method m = c.getMethod(methodName); retObj = m.invoke(o,new Object[0]); } catch (...
5
@Override public void mouseMoved(MouseEvent e) { Point point = e.getPoint(); if (e.getSource() == _north) { if (point.x <= _borderWidth) { // Mouse located at North-West edge _north.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR)); ...
8
public static void main(String[] args) throws InterruptedException { final Terminal rawTerminal = new TestTerminalFactory(args).createTerminal(); rawTerminal.enterPrivateMode(); int currentRow = 0; rawTerminal.moveCursor(0, 0); while(true) { Key key = rawTerminal...
5
public void update(Object target, String fieldname) { if (target != null && fieldname != null) { try { Method getter = target.getClass().getMethod( "is" + fieldname); if (getter != null) { Object current = getter.invoke(target); if (current instanceof Boolean) {...
5
public int []nextWinningMove(int token) { for(int i=0;i<3;i++) for(int j=0;j<3;j++) if(getBoardValue(i, j)==EMPTY) { board[i][j] = token; boolean win = isWin(token); board[i][j] = EMPTY; if(win) return new int[]{i,j}; } return null; }
4
public boolean deplacerPiece(Piece p, Point point) { boolean succes = false; if (Echiquier_deplacement_Utils.estAutorise(p, this, point)) { if (this.getPieceCase(point) != null) { if (this.jeuCourant == this.j1) { this.j2.mangerPieceCase(point); ...
5
public int uniquePathsWithObstacles(int[][] obstacleGrid) { int m = obstacleGrid.length; int n = obstacleGrid[0].length; int[][] A = new int[m][n]; for (int i = 0; i < m; i++) { if (obstacleGrid[i][0] == 1) break; A[i][0] = 1; } for (int i = 0; i < n; i++) { if (obstacleGrid[0][i] == 1) bre...
7
public void show() { for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) System.out.printf("%9.4f ", data[i][j]); System.out.println(); } }
2
public void use(BattleFunction iface, PokeInstance user, PokeInstance target, Move move) { if (this.target == Target.target) { target.battleStatus.resetStats(); } else { user.battleStatus.resetStats(); } if (text != null) { text = text.replace("$target", target.getName()); if (target.battleStatus.la...
3
private static void writeAllData(String filename) throws IOException { FileWriter fw = new FileWriter(filename, false); HashMap<String, Averaging> statistic = new HashMap<String, Averaging>(); // // Write header to file // Object[] headers = keys.keySet().toArray(); java.util.Arrays.sort(headers); ...
7
private char escapedStringChar(PositionTrackingPushbackReader par1PositionTrackingPushbackReader) throws IOException, InvalidSyntaxException { char c1 = (char)par1PositionTrackingPushbackReader.read(); char c; switch (c1) { case 34: c = '"'; ...
9
public static void plot(int size) { PlotFrame frame = new PlotFrame("Energy", "Propagation", "Propagation"); frame.setSize(600, 600); for (int i = 0; i < size; i++) { // frame.append(0, x[i], y[i]); frame.append(0, i, i); frame.append(1, i, i * i); } ...
1
public void set(AlumnoBean oAlumnoBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.initTrans(); if (oAlumnoBean.getId() == 0) { oAlumnoBean.setId(oMysql.insertOne("alumno")); } oMysql.updateOne(oAlumnoBean.getId...
3
void add(Map<SearchState,SearchState> nextQueue, Node<String> node, int startIndex, double chunkScore, boolean isTokenEnd, Map<Dp,Chunk> chunking, char[] cs, int end) { if (chunkScore > mDistanceThreshold) return; SearchState state2 = new ...
8
@Override public void onGameEnd(int result, Object arg) { if (result == 1) { this.send("GAME-END " + result + " " + ((Player) arg).getName()); } else if (result == -1) { this.send("GAME-END " + result); } }
2
@Override public String getName() { String name = super.getName(); if (name == null) { return DEFAULT_NAME; } else { return name; } }
1
public static void main(String[] args) { //String protocolName = "rmi"; String protocolName = "triple"; BasicProvider<DemoService> basicProvider = new BasicProvider<DemoService>(protocolName); basicProvider.exportService(DemoService.class); System.out.println("input 'stopServer' to stop provider service"); ...
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Permissao other = (Permissao) obj; if (grupo == null) { if (other.grupo != null) return false; } else if (!grupo.equals(other.grupo)) ...
9
public void printPaths() { for(int i = 0; i < Game.map.height; i++) { System.out.print("["); for(int j = 0; j < Game.map.width; j++) { if(movement[j][i] > 0) { System.out.print(movement[j][i] + ",\t"); } ...
4
public void mkFile(HashMap<String, SVGGraphics2D> p_recentPaintingObjects) { for (Entry<String, SVGGraphics2D> pair : p_recentPaintingObjects.entrySet()) { // Begin : How are the directory paths this SVG objects will need String objectDir = pair.getKey().substring(0, pair.getKey().lastIndex...
4
@Override public long execute(AMD64Environment env, IInstruction instruction) { List<IOperand> operands = instruction.getOperands(); if (operands.size() == 2) { IOperand op1 = operands.get(0); IOperand op2 = operands.get(1); int op_width1 = env.getOperandWidth(op...
8
short deinitialize() { // Before killing this thread, check if the thread is STILL alive if(!t.isAlive()) MsgAnalyzerCmnDef.WriteDebugSyslog("The worker thread in the SerialReceiver object did NOT exist......"); else { exit.set(true); MsgAnalyzerCmnDef.WriteDebugSyslog("The worker thread in the SerialRe...
4
public void draw (JEditorPane editor) { StringBuffer buf = new StringBuffer (); String name = toString (); editor.setContentType ("text/html"); buf.append ("<html>\n<head><title>"); buf.append (name); buf.append ("</title></head>\n<body><font size=+1><b>"); buf.append (name); buf.append ("</b></font><br>...
2
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ComputerPart other = (ComputerPart) obj; if (nam...
9
public void clear_buffer() { for (int i = 0; i < channels; ++i) bufferp[i] = (short)i; }
1
public String nextCDATA() throws TXMLException { char c; int i; StringBuffer sb = new StringBuffer(); for(;;) { c = next(); if(end()) { throw syntaxError("Unclosed CDATA"); } sb.append(c); i = sb.length() - 3; if(i >= 0 && sb.charAt(i) == ']' && sb.charAt(i + 1) == ']' && sb.charAt(i ...
6
private static String createExecutionEnvironment(HardwareAlternative platformAlternative, String hardwareSetId, DeploymentAlternative deploymentAlternative) { String executionEnvironment = "\t\t<nestedNode xmi:type=\"uml:ExecutionEnvironment\" xmi:id=\"" + platformAlternative.getId() + "\" name=\"" + platformAlternat...
2
private void copyAndStrip(File sourceJar, File targetJar) throws IOException { ZipFile in = new ZipFile(sourceJar); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(targetJar))); for(ZipEntry e : Collections.list(in.entries())) { if...
3
@Override public double access(Balance balance) { return balance.getBalance(); }
0
void deleteArrow(int col) { switch(col) { case 1: if(_arrows[4][0]!=null) { _arrows[4][0]=null; upArrowDeleted=true; } break; case 2: if(_arrows[4][1]!=null) { _arrows[4][1]=null; leftArrowDeleted=true; } break; case 3: if(_arrows[4][2]!=null) { ...
8
private String getTeacher(List<String> teachers) { String s = ""; for(String t : teachers){ s += t + ", "; } if(s.length() > 0) { s = s.substring(0, s.length()-2); } else { s = "None"; } return s; }
2
private userDao() { Properties properties = new Properties(); try { properties.load(new FileInputStream("c:\\Users\\Igos\\workspace\\newsLine\\config.properties")); String dbURL = properties.getProperty("baseurl"); String user = properties.getProperty("user"); String password = properties.getProperty("...
3
private String getListBy( String variable ) { StringBuilder sb = new StringBuilder(); if ( hasSearch ) { for ( int i = 1; i < searchList.size() + 1; i++ ) { sb.append( "\n" + TAB + TAB + "List<" + variable + "> list" + i + "= " ); sb.a...
2
@Override public void mousePressed(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e)) { if (Main.modState == ModState.Editing) { Point clickedPoint = getClickedPoint(e); handlePointSelection(clickedPoint); } } }
2
public void setStworz(String stworz) { this.stworz = stworz; }
0
public mxGraphHierarchyModel(mxHierarchicalLayout layout, Object[] vertices, List<Object> roots, Object parent, boolean ordered, boolean deterministic, boolean scanRanksFromSinks) { mxGraph graph = layout.getGraph(); this.deterministic = deterministic; this.scanRanksFromSinks = scanRanksFromSinks; this.r...
9
public void Process(int id){ switch(id){ case 241:ColorReasoning(0);//浅 break; case 242:ColorReasoning(1);//相等 break; case 243:ColorReasoning(2);//深 break; case 301:ActivateForceSpace(); break; case 341:DynamicForceReasoning(); break; case 401:ActivateObjectSpace(); break; case 261:Ge...
9
public void setMapValue(){ if( pointer_x >=0 && pointer_x < Constant.MAP_Array_SIZE && pointer_y < 80 && pointer_y >=0) this.array[pointer_x][pointer_y] = this.current_type ; }
4
@Override protected void lock() { while (true) { if (!calcLocker.isWriteLocked() && calcLocker.writeLock().tryLock()) if (calcLocker.getWriteHoldCount() != 1) calcLocker.writeLock().unlock(); else if (hasAdjustment() == PRO_ADJ_PAR ...
6
public HiddenNode(double act, NeuralNet dd, int lNo){ super(act,dd); layerNo=lNo; int hlp; if(layerNo==0) hlp = dis.getInputNo(); else hlp = dis.getHiddenLayers()[layerNo-1]; brnI = new Branch[hlp]; if(dd.getHiddenLayersNo()==layerNo+1) hlp = dis.getOutputNo(); else hlp = dis.getHiddenLayers()[lay...
2
public void connectHLine(String fieldType, CABot3Net retNet, CABot3Net linesNet) { int netSize =retNet.getInputSize(); int retinaOffset = getRetOffset(fieldType)*netSize; int lineOffset = getLineOffset(fieldType, "Hline")*netSize; int column; int row; int cols = retNet.getCols(); double weig...
9
@SuppressWarnings("deprecation") @EventHandler public void onProjectileHit(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile instanceof Arrow)) return; Arrow arrow = (Arrow)projectile; if (!(arrow.getShooter() instanceof Player)) { return; } BlockIterator b...
9
public void initListe() { TableModel listeModele = new AbstractTableModel() { @Override public String getColumnName(int col) { return titres[col].toString(); } public int getColumnCount() { return titres.length; } public Object getValueAt(int row, int col) { return donnees[row][col]; ...
0
public static List<Integer> preorderTraversal(TreeNode root) { List<TreeNode> stack = new ArrayList<TreeNode>(); List<Integer> res = new ArrayList<Integer>(); TreeNode node = root; while (null != node || 0 != stack.size()) { while (null != node) { res.add(node.val); stack.add(node); node = node.l...
3
public String getAttribute(String attribName) { if ((pdu.getPdu().equals("PSSRR")) || (pdu.getPdu().equals("PSSDR"))) { ArrayList attribs = pdu.getAttribs(); for (int i=0; i < attribs.size(); i++){ String[] attrib = (String[])attribs.get(i); if (attrib[0]....
4
private void removePars() { try{ String inPars; boolean foundEndPars=false; int beginPars=0, endPars=0; while(beginPars!=-1&&endPars!=-1) { foundEndPars=false; beginPars=input.indexOf("("); endPars=beginPars; if (beginPars!=-1) ...
7
private boolean jj_3R_93() { Token xsp; while (true) { xsp = jj_scanpos; if (jj_3_16()) { jj_scanpos = xsp; break; } } return false; }
2
public Point2D getTopRight() { return new Point2D(width, y); }
0
@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { if(msg.amITarget(this)) { final MOB mob=msg.source(); switch(msg.targetMinor()) { case CMMsg.TYP_WAND_USE: if((mob.isMine(this)) &&(!amWearingAt(Wearable.IN_INVENTORY)) &&(msg.targetMessage()!=null)) { ...
7
@Override public void lock(int thread_id) { choosing_[thread_id] = true; choosing_ = choosing_; //force the other threads to see that choosing_[thread_id] has updated number_[thread_id] = max() + 1; choosing_[thread_id] = false; choosing_ = choosing_; //force the other threads to see that choosing_[thread_i...
7
@Override public int compareTo(StarSystem o) { return (this.getMass() < o.getMass()) ? -1 : (this.getMass() > o.getMass()) ? 1 : 0; }
2
public void mouseClicked(MouseEvent e){ //sets the string details equal to the click count. details = ("You clicked: "+ e.getClickCount()); //if the button that was pressed is equal to the //left button, middle wheel, or the right button //the string details gets this text added on depending wh...
3
public static void win(int elapsedTime, int numMoves) { prefs.putInt("wins", prefs.getInt("wins", 0) + 1); if (getLowestMoves() > numMoves) { setLowestMoves(numMoves); } if (getBestTime() > elapsedTime) { setBestTime(elapsedTime); } }
2
@Override public void actionPerformed(ActionEvent e) { //browse button if(e.getActionCommand().equals(Strings.MENU_DATA[4])){ JFileChooser fc = new JFileChooser(); fc.setPreferredSize(new Dimension(600,600)); int returnVal = fc.showOpenDialog(Soartex_Patcher.frame); if (returnVal != JFileChooser.APPROV...
5
@Override public String getNamespaceURI(String prefix) { String url = XMLConstants.NULL_NS_URI; if(this.map != null && this.map.containsKey(prefix)) { url = this.map.get(prefix); } return url; }
2
public static void dolaresToEuros(){ final BufferedReader stdin=new BufferedReader (new InputStreamReader(System.in)); try{ System.out.print("Intoduce el importe en dolares => "); dolar=Double.parseDouble(stdin.readLine()); System.out.println("El valor de cambio es "+cambio+"€ => 1 $"); System.out.prin...
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypeDeclarationNode other = (TypeDeclarationNode) obj; if (ident == null) { if (other.ident != null) return false; } else if (!ident....
9
private double exptLessThan(double b) { double sum=0,interval=(b-12)/1000,val=12; for (int i = 0; i <1000; i++) { sum+=phi(val, mu, sigma)*val*interval; val+=interval; } return sum/probLessThan(b); }
1
private JPanel prepareParamControls(JTextField posStart, JTextField posEnd, final JTextField winSize, final JTextField shiftIncr, JCheckBox useSlide) { JPanel controlField = new JPanel(), startField = new JPanel(), endField = new JPanel(), checkBoxField = new JPanel(), windowField = new JPanel(), shiftField...
2
public int[] getSlotItemIDs() { Vector<Integer> v = new Vector<Integer>(); for (Widget slot : getSlotWidgets()) { int i = slot.getParentId(); if (i != -1) { v.add(i); } } int[] ia = new int[v.size()]; int index = 0; for (int i : v) { ia[index] = i; index++; } return ia; }
3
@Override public void execute(CommandSender sender, String[] arg1) { if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) { sender.sendMessage(plugin.NO_PERMISSION); return; } if (arg1.length == 0) { ChatChannel cc = plugin.getChannel("Global"); ChatPlayer cp = plugin.getChatPlayer(sender.getNa...
7
public void match(Pipe pipe_) { int idx = pipes.indexOf (pipe_); // If pipe is already matching do nothing. if (idx < matching) return; // If the pipe isn't eligible, ignore it. if (idx >= eligible) return; // Mark the pipe as matchin...
2
public static void writeCommandsForU(ArrayList<String> tl){ ArrayList<String> cmds=rfa.readInputStream(GenerateInitScripts.class.getResourceAsStream("config/srcOds/CommandsForU.sh"),"UTF-8"); StringBuffer content=new StringBuffer(); for (int i = 0; i < cmds.size(); i++) { if(cmds.get...
6
public Integer getErrorCount() { return errorCount; }
0
public static List<Person> getAllPeople() { List<Person> people = new ArrayList<Person>(); Connection conn = null; Statement stmt = null; try { // STEP 2: Register JDBC driver Class.forName("com.mysql.jdbc.Driver"); // STEP 3: Open a connection System.out.println("Connecting to database..."); co...
7
public static boolean isAdjacentTo(Board board, int player, int x, int y) { int boardSize = board.boardSize; int[][] intersections = board.intersections; return (x > 0 && intersections[x - 1][y] == player) || (x < boardSize - 1 && intersections[x + 1][y] == player) || (y > 0 && intersections[x][y - 1] == ...
7
public int look(int bits){ int ret; int m=mask[bits]; bits+=endbit; if(endbyte+4>=storage){ if(endbyte+(bits-1)/8>=storage) return (-1); } ret=((buffer[ptr])&0xff)>>>endbit; if(bits>8){ ret|=((buffer[ptr+1])&0xff)<<(8-endbit); if(bits>16){ ret|=((buffer[p...
7
private int getOption() { while (true) { try { System.out.print("\nEnter option: "); int option = new Scanner(System.in).nextInt(); if (option >= 1 && option <= menuItems.length || option == EXIT_OPTION) ...
5
@Override public void start(final Stage primaryStage) throws JAXBException { primaryStage.setTitle("een"); opslag = new ObjectenOpslag(root, null); label = new Label("Welkom!!!!"); root.getChildren().add(label); rz = new Rugzak(); ...
6
@Test public void itShouldNotSerializeEmptyProperties() throws Exception { TestGeoJsonObject testObject = new TestGeoJsonObject(); Assert.assertEquals("{\"type\":\"TestGeoJsonObject\"}", mapper.toJson(testObject)); }
0
public boolean game_over(){ return table.is_complete() || WHITE_SCORE ==0 || BLACK_SCORE == 0 || (cpuValidMoves.size()==0 && playerValidMoves.size()==0); } // end game_over
4
protected String queryWithWhoisServer(final String domainName, final String whoisServer) { String result = ""; try { WhoisClient whois = new WhoisClient(); whois.connect(whoisServer); result = whois.query(domainName); whois.disconnect(); } catch (SocketException e) { } catch (IOException e) { } ...
2
public boolean translate(Polyomino poly, int dx, int dy){ for (Point loc:poly.getTranslateLocs(dx, dy)){ if (loc.y<0 || loc.x<0 || loc.x>=fWidth || contents[loc.y][loc.x] != null) return false; } poly.translate(dx, dy); return true; }
5
@Override public int getLockWriteCount(String objectType) { int result = 0; String lockStart = objectType + lockSeparate; for (int i = 0; i < writeLocks.size(); i++) { String lockName = writeLocks.get(i); if (lockName.startsWith(lockStart)) result++; } return result; }
2