text
stringlengths
14
410k
label
int32
0
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ReadPK other = (ReadPK) obj; if (idISIEAdministrator != other.idISIEAdministrator) return false; if (idRepport != other.idRepport) return...
5
private void addEmptyThings(){ SortedSet<String> keys = new TreeSet<String>(data.keySet()); for (String path : keys) { while(true){ path = deleteLastLevel(path); if(path == null || path.equals("")) { break; } ...
5
private static void checkProjectValid(){ List<ProjectError> errors = new ArrayList<ProjectError>(); File file; for(String path : allPath){ file = new File(path); if(!file.exists()){ errors.add(new ProjectError(ProjectError.FOLDER_MISSING, path)); ...
3
@Override public HsvImage clone() { HsvImage cloned = shallowClone(); for (int x = 0; x < getWidth(); x++) { for (int y = 0; y < getHeight(); y++) { cloned.setPixel(x, y, HUE, getPixel(x, y, HUE)); cloned.setPixel(x, y, SATURATION, getPixel(x, y, SATURATION)); cloned.setPixel(x, y, VALUE, getPixel(x...
2
public int fileLines(String fileDirectory, String exclusion) throws IOException{ BufferedReader fileReader = null; try { fileReader = new BufferedReader( new InputStreamReader(getClass().getResourceAsStream(fileDirectory))); } catch (NullPointerException propertiesReaderNPE) { try { fileReader = ne...
6
public void actionPerformed(ActionEvent arg0) { if (arg0.getSource().equals(nextMonthButton)) { GregorianCalendar cal = (GregorianCalendar)calendarModel.getCalendarClone(); int day = cal.get(Calendar.DATE); cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONT...
7
@Override public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if(onStart) { switch(key) { case KeyEvent.VK_ENTER: onStart = false; selectLocation = true; } } else if(selectLocation) { switch(key) { case KeyEvent.VK_1: Character.setLocation(LOCATION.LUMBRIDGE); ...
7
public void build(Object object, Container location, IXMLElement xml, Runnable onUpdate) throws GUIBuilderException{ if (!xml.getName().equals("parameters") && !xml.getName().equals("group")){ throw new GUIBuilderException("Top level tag if XML must be <controls>. Parse failed."); } Enumeration children = xml....
9
public static void main(String args[]) { /* Set the Nimbus look and feel */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.get...
6
public String undesiredQueries(String first, String second, String country, String query) { String cheshireResult = null; String countryQuery = ""; try { //********************************************************************************************************** // Undesired Searching Mechanisms // Th...
8
public static void processT(String tempDir) throws FileNotFoundException, NoSuchElementException, IOException, ProcessException { File trigramSortedInterDataFile = FileUtil.getFileInDirectoryWithSuffix(tempDir, TrigramExternalSort.DATA_SUFFIX); File unigramDataFile = FileUtil.getFileInDi...
8
public static void main(String s[]) { JFrame f = new JFrame("See Through Image"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); URL imageSrc = null; try { imageSrc = ((new File(imageFileName)).toU...
1
void ConstructProgramState(LoadType loadType, GUI parentGUI, String filterTag){ //mainGUI.isChangingState = true; switch (loadType){ case Init: Settings.setSettingAndSave("databaseFilePathAndName", getSetting("homeDir")+getSetting("databasePathExt")+getSetting("databaseFileName")); Ini...
9
DeviceImpl (USB bus, String drivername, int a) throws IOException, SecurityException { super (null, bus, a); usb = bus; path = drivername;//f.getPath (); if(MacOSX.trace) System.err.println("in usb.macosx.DeviceImpl()\n"); // should only fail if the device u...
9
public void setQualification(int qualification) { this.qualification = (qualification > 0 && qualification < 5) ? qualification: 0; }
2
private void getStatsFile() throws Exception { BufferedReader r = new BufferedReader(new FileReader("stats_" + nodeName + ".txt")); String str; while ((str = r.readLine()) != null) { out.println(str); } r.close(); }
1
DBPort get( boolean keep , ReadPreference readPref, ServerAddress hostNeeded ){ DBPort pinnedRequestPort = getPinnedRequestPortForThread(); if ( hostNeeded != null ) { if (pinnedRequestPort != null && pinnedRequestPort.serverAddress().equals(hostNeeded)) { r...
7
public int NumShips(int playerID) { int numShips = 0; for (Planet p : planets) { if (p.Owner() == playerID) { numShips += p.NumShips(); } } for (Fleet f : fleets) { if (f.Owner() == playerID) { numShips += f.NumShips(); ...
4
private boolean alter() throws UnsupportedEncodingException { if(storeName == null || storeName.isEmpty()) return false ; if(storeAddr == null || storeAddr.isEmpty()) return false ; String tempName = new String(storeName.getBytes("ISO-8859-1"),"UTF-8") ; Session se = HibernateSessionFactory.getSession...
6
private void treeButtonClick(java.awt.event.ActionEvent evt) { GraphElement[] ges = graph.getMinimalSpanningTree(); if (ges == null) return; for (int i = 0; i < ges.length; i++) { ges[i].getComponent().setColor(TREEANDMINIMUMCOLOR); } ...
2
public static void main(String[] args) throws Throwable{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(;;){ StringTokenizer st = new StringTokenizer(in.readLine().trim()); int N = parseInt(st.nextToken()), M = parseInt(st.nextToken()); if(M==0&&N==0)break; int[] heads = n...
9
private static GameField parseSquares(Scanner scanner) throws MapLoaderException { int width = scanner.nextInt(); int height = scanner.nextInt(); if (!scanner.next().equals("SQUARES")) { throw new MapLoaderException("Squares section not found."); } Square[][] map = new Square[width][height]; char s...
8
private static Set<String> writeMethods(TreeLogger logger, GeneratorContext context, JClassType type, SourceWriter writer) throws UnableToCompleteException { Set<String> allUsedSelectionProperties = new HashSet<String>(); JMethod[] methods = type.getMethods(); for (JMeth...
4
public void testSetPeriod_8ints2() { MutablePeriod test = new MutablePeriod(100L, PeriodType.millis()); try { test.setPeriod(11, 12, 13, 14, 15, 16, 17, 18); fail(); } catch (IllegalArgumentException ex) {} assertEquals(0, test.getYears()); assertEquals(0,...
1
public static boolean isBalance(TreeNode root,ArrayList<Integer> depth){ if(root == null){ return true; } ArrayList<Integer> left = new ArrayList<Integer>(); left.add(0); ArrayList<Integer> right = new ArrayList<Integer>(); right.add(0); if(isBalance(root.left,left)&&isBalance(root.right,right)){ in...
5
private void checkForRepeatRun(Object n, ArrayList array, int[] arrayTotal){ if (array.isEmpty()) { array.add(n); } else { if (array.contains(n)) { array.add(n); if (array.size() >= 7) { array.clear(); arr...
4
@Override protected void commandReceived(Object command) { if (command instanceof Command) { Command message = (Command)command; String action = message.getCommand(); System.out.println("Command received: "+action); if (action.equals("set_username")) { // this.username = (String)message.getBaggage(); ...
8
@Override public boolean isConnected() { return connected; }
0
public model.Order getOrder() { model.Order order = new model.Order(); DefaultTableModel tm = viewCustomer.getTmodel(); for (int i = 0; i < tm.getRowCount(); i++) { Object t = tm.getValueAt(i, 4); if (t == null) continue; int x = Integer.parseInt(t.toString()); if (x > 0) { Product product = n...
3
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple)) return false; Tuple tuple = (Tuple) o; return !(key != null ? !key.equals(tuple.key) : tuple.key != null) && !(value != null ? !value.equals(tuple.value) : tuple.value != null); ...
5
private static String getNextChild(String s) { int end; int nest; end = 0; nest = 0; while (s.charAt(end) != ')' || nest > 1) { if (s.charAt(end) == '(') nest++; else if (s.charAt(end) == ')') nest--; end++; } return (s.substring(0, end + 1)); }
4
@Override public String getCur() {return cur;}
0
private void generateDummyHardwareAlternatives() { if (cpuAlternatives.size() == 0) cpuAlternatives.add(new HardwareAlternative("", "")); if (hddAlternatives.size() == 0) hddAlternatives.add(new HardwareAlternative("", "")); if (memoryAlternatives.size() == 0) memoryAlternatives.add(new HardwareAlternati...
6
public void putAll( Map<? extends Double, ? extends Character> map ) { Iterator<? extends Entry<? extends Double,? extends Character>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends Double,? extends Character> e = it.next(); thi...
8
@Override public boolean tick(Tickable ticking, int tickID) { if(!super.tick(ticking, tickID)) return false; if(ticking instanceof MOB) { final MOB mob=(MOB)ticking; if(mob != invoker()) { if((invoker()!=null)&&(!CMLib.flags().isInTheGame(invoker(), true))) { unInvoke(); return fal...
7
public boolean isWall(int x, int y, int direction) { if (isBorder(x, y, direction)) return true; switch (direction) { case NORTH: if( y<=0 ) return true; else return (columnWalls[x][y - 1]); case SOUTH: if( y>=(this.rows-1)) return true; else return (columnWalls[x][y]); case EAS...
9
@Override public HerbType type() { if (empty()) { return HerbType.HERB_PATCH; } if (dead()) { return HerbType.DEAD; } final int bits = bits(); for (HerbType type : HerbType.values()) { if (type.valid(bits)) { return type; } } throw new IllegalArgumentException("Unknown herb type! bit...
4
public AbstractSaveConvertor(Class<T> clazz, final String namespace, final String localName, final Connection con, final String sqlExists, final String sqlInsert, final String sqlUpdate, final String sqlInsertNoGis, final String sqlUpdateNoGis) throws SQLException { ...
8
public static void Command(CommandSender sender) { if(sender.hasPermission("gm.survival.all")) { for(Player player : Bukkit.getServer().getOnlinePlayers()) { if (player.getGameMode() != GameMode.SURVIVAL) { player.setGameMode(GameMode.SURVIVAL); if(sender instanceof Player) { me....
6
private int copyFieldsWithDeletions(final FieldsWriter fieldsWriter, final IndexReader reader, final FieldsReader matchingFieldsReader) throws IOException, MergeAbortedException, CorruptIndexException { int docCount = 0; final int maxDoc = reader.maxDoc(); if (match...
8
@SuppressWarnings({ "rawtypes", "unchecked" }) public static Enum<?> parseEnum(String s) { String className = s.split(":")[0]; String value = s.split(":")[1]; for (Class<? extends Enum> c : enums_) { if (c.getSimpleName().equals(className)) { return Enum.valueOf(c, value); } } return null; }
4
private void loadConfig(){ FileConfiguration config = new YamlConfiguration(); try{ config.load(this.getResource("config.yml")); /** * debug is initialized to true in case there is a problem reading the * confi...
2
private static BigFraction parse(String s){ try{ if(s == null){ return null; } if(s.isEmpty()){ return null; } char[] c = s.toCharArray(); c = removeChar(c, (char) 32); c = removeChar(c, (char) 43); int l = c.length; byte[] b = new byte[l]; b[0] = findFirst(c[0]); ...
8
public void talk() { Printer.print("A person inexplicitly materalises in front of you purely for you to converse with."); // :P TreeNode currentNode = dialogueTree.getRoot(); String input = null;// could be buggy with the space do { foundDialogue = false; Printer.print(currentNode.getDialogue()); cu...
7
public int minimumTotal(List<List<Integer>> triangle) { int[] min = new int[triangle.size()]; int[] preMin = new int[triangle.size()]; for (int i = 0; i < triangle.size(); i++) { if (i == 0) { min[0] = triangle.get(0).get(0); } else{ for (int k = 0; k < triangle.get(i).size(); k++) { if (k == ...
7
@Override public boolean blockActivated(EntityPlayer player) { if (this instanceof ITrackReversable) { ItemStack current = player.getCurrentEquippedItem(); if (current != null && current.getItem() instanceof IToolCrowbar) { IToolCrowbar crowbar = (IToolCrowbar) curren...
4
public NovacomInstallerView(SingleFrameApplication app) { super(app); initComponents(); String os = System.getProperty("os.name").toLowerCase(); if(os.contains("windows")) { if(System.getenv("ProgramFiles(x86)")==null) { jLabel2.setText("Windows 32bit"); ...
5
private void piirraTyonnin(Graphics g, Ruutu ruutu, int data) { int x=ruutu.getX(); int y=ruutu.getY(); int seina=data%4; List<Integer>lukuja=new ArrayList<>(); if (data<4) { lukuja.add(2); lukuja.add(4); } else { lukuja.add(1); ...
8
private void addVertices(ArrayList<Vertex> vertices, int i, int j, float offset, boolean x, boolean y, boolean z, float[] texCoords) { if(x && z) { vertices.add(new Vertex(new Vector3f(i * SPOT_WIDTH, offset * SPOT_HEIGHT, j * SPOT_LENGTH), new Vector2f(texCoords[1],texCoords[3]))); vertices.add(new Vertex(n...
6
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == yeastTxt){ try { myRecipe.getYeastObj().setCost(SBStringUtils.myNF.parse(yeastTxt.getText()).doubleValue()); } catch (ParseException e1) { e1.printStackTrace(); } displayCost(); } if (o == otherTxt){ ...
8
public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { dx = -1; } if (key == KeyEvent.VK_RIGHT) { dx = 1; } if (key == KeyEvent.VK_UP) { dy = -1; } if (key == KeyEvent.VK_DOWN)...
4
public void finDuJeu() { int tailleTexte = 0; if (Configurations.getGrilleX() < 20) { tailleTexte = 0; } else if (Configurations.getGrilleX() < 30) { tailleTexte = 4; } else if (Configurations.getGrilleX() < 40) { tailleTexte = 8; } else if (Configurations.getGrilleX() <= 50) { tailleTexte...
4
public int majorityNumberTwo(ArrayList<Integer> nums, int k) { int len = nums.size(); if (len < k) { return -1; } Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for (int x : nums) { if (map.size() < k && !map.containsKey(x)) { map.put(x, 1); ...
9
public void run() { while (true) { try { InputStreamReader converter = new InputStreamReader(System.in); BufferedReader in = new BufferedReader(converter); while (true){ String consoleInput = in.readLine(); Stri...
6
public void handle() { // Make sure the player is not already on the server; if so, ignore this packet: if (World.getPlayers().length >= BBServer.getConfig().getPlayerCap()) { BBServer.getSenderDaemon().outgoingPacketQueue.add(new Packet01AuthResponse(username, 0, address, port)); System.out.println("Player "...
5
private void backButtonAction() { // check if it's ok if(currentStepIndex<=1 || currentPanel==null) return; currentPanel.saveUserInput(); lastPressed = "back"; currentStepIndex--; displaySteps(); // update button status if(!nextButton.isEna...
7
public String getStringValue() throws IOException { if (type == INDIRECT) { return dereference().getStringValue(); } else if (type == STRING || type == NAME || type == KEYWORD) { return (String) value; } // wrong type return null; }
4
private void doCommand(String cmd) { if (cmd.startsWith("S")) { doSleep(Integer.parseInt(cmd.substring(1))); } else if (cmd.startsWith("X")) { doShutdown(); } else if (cmd.equals("help")) { doHelp(); } else if (cmd.equals("$DONE")) { logger...
4
public static boolean isBestResult(int difficulty, long time) { long[] times; switch (difficulty) { case Grid.DIFFICULTY_EASY: times = instance.easyTime; break; case Grid.DIFFICULTY_MEDIUM: times = instance.mediumTime; break; case Grid.DIFFICULTY_HARD: times = instanc...
6
private boolean invalidCall(Server server, long ID) { for (Player p : server.players) { if (p.getReaderThreadID() == ID) return true; } return false; }
2
public void setVisible(boolean isVisible) { super.setVisible(isVisible); log.setVisible(isVisible); }
0
@Override public String toString() {return String.valueOf(cur);}
0
@Override public BencodeTreeNode getChild ( Object parent, int index ) { Value<?> vprt = ( (BencodeTreeNode) parent ).getValue(); if ( vprt instanceof ListValue ) { return new BencodeTreeNode( ( (ListValue) vprt ).get( index ), vprt, index ); } else if ( vprt instanceof DictionaryValue ) { Iterator<...
6
public static void downloadFile(File file, String location) { BufferedInputStream input = null; FileOutputStream output = null; try { URL url = new URL(location); input = new BufferedInputStream(url.openStream()); output = new FileOutputStream(file); byte data[] = new byte[1024]; int count; w...
6
public String toString(String input) { return "("+input+")^"+_power; }
0
public static void payFine(int fineId){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCommit(false); PreparedStatement ...
4
public static Class getModelIdType(Class model) { if (model.isAssignableFrom(Model.class)) throw new IllegalArgumentException(EXC_NOTAMODEL); Method[] declareds = CommonStatic.getDeclaredGetters(model); Class returnType = null; boolean found = false; for (Method m : declareds) if (m.isAnnota...
6
public PTrailer loadTrailer(long position) { PTrailer trailer = null; try { if (m_SeekableInput != null) { m_SeekableInput.beginThreadAccess(); long savedPosition = m_SeekableInput.getAbsolutePosition(); m_SeekableInput.seekAbsolute(position); ...
5
public static long find(String name) throws SQLException { long catID = -1; for(Category c : list()) if (c.getName().equals(name)) catID = c.getId(); return catID; }
2
public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
0
public int geocode(DataSetDescriptor dsd, String address) { NominatimConnector nm = new NominatimConnector("http://nominatim.openstreetmap.org/search.php"); nm.setFormat("json"); boolean containColumn = address.contains("{"); int rowCont = 0; if(!containColumn){ // In order to not contain a column name int...
4
public java.security.cert.X509Certificate[] getAcceptedIssuers() { java.security.cert.X509Certificate[] chain = null; try { TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); KeyStore tks = KeyStore.getInstance("JKS"); tks.load(this.getClas...
1
public Integer call() throws InterruptedException { int sum = 0; for (int i = 0; i < 100000; i++) { sum += i; } System.out.println(numberOfThread); return numberOfThread; }
1
@SuppressWarnings("unchecked") public static float[][] restoreData(String findFromFile) { float[][] dataSet = null; try { FileInputStream filein = new FileInputStream(findFromFile); ObjectInputStream objin = new ObjectInputStream(filein); try { dataSet = ( float[][]) objin.readObject(); } catch ...
2
public void addCacheItem( int cacheId, int cacheItem ) { int insertIndex = 0; for( BiffRec br : pivotCacheRecs.get( cacheId + 1 ) ) { if( br.getOpcode() == SXFDB ) { ((SxFDB) br).setNCacheItems( ((SxFDB) br).getNCacheItems() + 1 ); } else if( br.getOpcode() == EOF ) { insertIndex = pivotCa...
4
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { if (!ClassReader.ANNOTATIONS) { return null; } ByteVector bv = new ByteVector(); // write type, and reserve space for values count bv.putShort(cw.newUTF8(desc)).putShort(0); AnnotationWriter aw = new AnnotationWriter(...
2
private void printIssueInfos() throws ParseException, IOException{ boolean cutoff_c = false; boolean cutoff_n = false; for (IssueInfo issueInfo : issueInfos) { String issueInfoPrint = "";//TODO: issueInfo.printString(socialGraph); String durationInfo = "";//TODO: issueInfo.printDurations(); if(!issue...
7
@Override public String toString() { return "isAnnotation()"; }
0
private boolean jj_3_29() { if (jj_3R_46()) return true; return false; }
1
public void setRegion(String region) { this.region = region; }
0
private void emitKeyValues(String key, String... values) { emitKey(key); startArray(); for (String value : values) { emitTabs(); mOut.print("<string>"); //$NON-NLS-1$ mOut.print(value); mOut.println("</string>"); //$NON-NLS-1$ } endArray(); }
1
public void updateRightSideLabels() { for (JLabel label : rolesList) { label.setText(""); } rolesList.clear(); // String roleToString = ""; // // for (Role role : balance.getChosenRoles()) { // roleToString = role.toString(); // i...
6
@Override public Object deponiUovo(String token, String idDinosauro) { try { if (myLogica.isMioTurno(token)) { if ( myLogica.getPlayerByToken(token).getRazza().existsDinosauroWithId(idDinosauro)) { String ret = myLogica.doDeponiUovo(token, idDinosauro); if (ret != null) { return "@ok," + ret; } ...
9
public File saveGrammarDialog(final File cur) { File dir = cur; if(dir == null || !dir.exists()) { dir = INI.getObject("last", "grammarDir", Converter.FILE_CONVERTER, HOME_STR); } final JFileChooser choose = new JFileChooser(dir); choose.setMultiSelectionEnabled(false); choose.setFileSelec...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CardCombination other = (CardCombination) obj; if (cardCombinationEnum != other.cardCombinationEnum) return false; if (cards == null) { i...
7
public synchronized void broadCast(String message,User user){ for(User client:users){ if(client==null)continue; if(client != user) client.getChatSocket().sendMessage(message); } }
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Country other = (Country) obj; if (country == null) { if (other.country != null) return false; } else if (!country.equals(other.country)...
9
private void flipHorizontal() { switch(direction) { case NORTH: case SOUTH: break; case EAST: setDirection(Direction.WEST); break; case WEST: setDirection(Direction.EAST); break; case NORTHEAST: setDirection(Direction.NORTHWEST); break; case NORTHWEST: setDirection(Direction.NORT...
8
private Long getExpiration(URLConnection connection, long baseTime) { DateFormat PATTERN_RFC1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); //, Locale.US String cacheControl = connection.getHeaderField("Cache-Control"); if (cacheControl != null) { java.util.StringToke...
9
@Override public String toString () { switch (operation) { case 0: return "sync operation (" + toEnd + ") to " + startPosition; case 1: return "insert " + data + "(" + toEnd + ")" + " to " + startPosition + " position"; case 2: return "delete " + "data" + " from " + startPosition + "-" + endPosition + " posit...
4
public void setStringAndReminder( String valueName, String s ) { JTextField valueField = stringMap.get( valueName ); if ( valueField != null ) valueField.setText(s); if ( remindersVisible ) setReminder( valueName, s ); }
2
public void writeResultSetSlice(ResultSetSlice rss) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("writeResultSetSlice = " + rss); } ResultSet rs = rss.resultSet(); int first = rss.first(); int last = rss.last(); int columnCount = rss.columnCount(); ...
4
private String process_HTTP_request(String text) { Pattern p = Pattern.compile("GET \\/([\\w\\.]*) HTTP"); Matcher m = p.matcher(text); if (m.find()) { String filename = m.group(1); if (filename.matches("\\s*") || filename == null) filename = "file.txt"; return read_file(filename); } else { ...
3
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int nCase = Integer.parseInt(line.trim()); for (in...
5
public static void rooked(int i, int j, int cur) { max = Math.max(max, cur); for (int k = 0; k < size; k++) { for (int l = 0; l < size; l++) { if (m[k][l] == '.' && checkPos(k, l)) { m[k][l] = 'o'; rooked(0, 0, cur + 1); m[k][l] = '.'; } } } }
4
public boolean checkParams(Map<String, String> params) { Iterator<ParamCons> it = nConstraint.iterator(); while(it.hasNext()) { ParamCons cons = it.next(); if(!checkOneParam(cons, params.get(cons.name))) return false; } return true; }
2
public static void main(String[] args) throws Exception { int ponder = 5; if (args.length > 0) ponder = Integer.parseInt(args[0]); int size = 5; if (args.length > 1) size = Integer.parseInt(args[1]); ExecutorService exec = Executors.newCachedThreadPool(); ...
6
public void setVar(List<?> list) { for(PVar e : this._var_) { e.parent(null); } this._var_.clear(); for(Object obj_e : list) { PVar e = (PVar) obj_e; if(e.parent() != null) { e.parent().removeChild(e); ...
4
public static List<Cottage> getAllCottages(boolean refresh) throws SQLException { if (!refresh) { if (staticCottages != null) return staticCottages; } List<Cottage> cottages = new ArrayList<Cottage>(); List<Zip> zips = ZipConnect.getAllZip(false); List<CottageType> types = getAllCottageTypes(); String...
7
public ArrayList<Customer> deleteCustomer(ArrayList<Customer> c) { boolean looking = true; String proposedFirst = null; String proposedLast = null; while (looking) { boolean notFound = true; System.out.println("Please enter the first name of the customer that you would like to delete."); propose...
5