text
stringlengths
14
410k
label
int32
0
9
private long determineFileCount(String path) { long fileCount = 0; for(File f : new File(path).listFiles()) { if(f.isFile()) fileCount++; if(f.isDirectory()) fileCount += determineFileCount(f.getAbsolutePath()); } return fileCount; }
3
public void checkDatafromCassandraDatastax(int uID, int noOfReplicas, int noOfSamples, String lcheckfile, int rate, int delayTime, String logFileName) { Double sum = 0.0; int minute = noOfSamples / (rate * 60) + delayTime; int[] samplesPerMinute = new int[minute]; // stores the samples per // minu...
9
@Override public V put(K key, V value) { V oldValue = null; int index = Math.abs(key.hashCode()) % SIZE; if(buckets[index] == null) { buckets[index] = new LinkedList<MapEntry<K, V>>(); } LinkedList<MapEntry<K, V>> bucket = buckets[index]; MapEntry<K, V> ...
4
@Override public void run() { try{ init(); }catch(Exception e){ e.printStackTrace(); } long lastTime = System.nanoTime(); final double amountOfTicks = 60; double ns = 1000000000 / amountOfTicks; double delta = 0; int updates = 0; int frames = 0; long timer = System.currentTimeMillis(); ...
4
public Query select(String query) { Connection connection = null; Statement statement = null; ResultSet result = null; try { connection = this.open(); //WARN ODR_OPEN_DATABASE_RESOURCE /* * The method creates a database resource * (such as a database connection or row set), * does not ass...
4
@Override public void AttribChanged (AbstractEntity entity, ConditionTypes attrib) { int conditionValue = (Integer) entity.getAttribute (attrib).getValue (); JPanel targetPanel = nodePanels.get (entity); int idx = panels.indexOf (targetPanel); Integer count = panelCount.get (idx); ...
9
@Override public void set_irq_line(int irqline, int linestate) { if(m6502log!=null) fprintf(m6502log,"M6502#%d before_irqline :PC:%d,PPC:%d,SP:%d,ZP:%d,EA:%d,A:%d,X:%d,Y:%d,P:%d,p_irq:%d,a_c:%d,nmi:%d,irq:%d,so:%d\n", cpu_getactivecpu(),m6502.pc.D,m6502.ppc.D,m6502.sp.D,m6502.zp.D,m6502.ea.D,m6502.a,m6502...
9
public ArrayList<Gebruiker> getAlleKlantenBrieven90(){ if(alleKlantenBrief.isEmpty()) { alleKlantenBrief = new GebruikersDAO().getAlleGebruikersDB(); Calendar test = Calendar.getInstance(); test.add(Calendar.DATE, -90); Date date1 = test.getTime(); for (Gebruiker k : alleKlantenBrief)...
6
@Override public boolean mutate(Mutation.Type type) { switch (type) { case REPLICATE: return false; case SWAP: Mutation.swapArgs(this); return true; case COPY: return Mutation.copy(this); case COPY_TREE: return copyTree(this); case REMOVE: return handleRemove(); case CREATE_PARENT: c...
6
public void visitUCExpr(final UCExpr expr) { if (expr.expr() instanceof UCExpr) { // Remove redundent update checks final UCExpr uc = (UCExpr) expr.expr(); if (uc.kind() == expr.kind()) { node = uc; if (replace) { // uc(uc(x)) --> uc(x) expr.visit(new ReplaceVisitor(uc, uc.expr())); ...
3
public void listePreceder(int idProjet) { serveur.envoyerCommande("H#" + idProjet); //On prend donc tout le monde Fonction fTache = serveur.lireCommande(); if(fTache == null || ! fTache.getAction().equals("h")) { return; } Iterator<String> iterator = fTache.getArguments().iterator(); while(iterator.h...
8
public static final void spawnTempGroundObject(final WorldObject object, final int replaceId, long time) { final int regionId = object.getRegionId(); WorldObject realMapObject = getRegion(regionId).getRealObject(object); final WorldObject realObject = realMapObject == null ? null : new WorldObject(realMapO...
9
public static void main(String[] args) throws FileNotFoundException { //library = parseLibrary(); library = parseLibraryTFIDF(); Scanner console = new Scanner(System.in); String input; intro(); do { System.out.print("> "); input = console.next(); switch (input) { case "help": printH...
8
public static void unzipFolder(File zipFile, File destFolder) { try { BufferedOutputStream dest = null; FileInputStream fis = new FileInputStream(zipFile); ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); ZipEntry entry; while ((entry = zis.getNextE...
8
public void setUserName(String userName) { this.userName = userName; }
0
private void dropTable(String tableName) { boolean ee = false; try { String sql = "drop table " + tableName; Statement statement = connection.createStatement(); statement.executeUpdate(sql); } catch (SQLException e) { if (e.getMessage().startsWith("ORA-00942: table or view does not exist")) S...
3
@SuppressWarnings("rawtypes") private BeanDefinition createExporterBeanDefinition(String beanName, String serviceName, Class serviceInterface, Exposer exposer) { BeanDefinitionBuilder beanDefinitionBuilder = null; if (Exposer.BURLAP == exposer) { beanDefinitionBuilder = BeanDefinitionBuilder .genericB...
7
private long getRandomUnscaledValue(IntegerAttributeType iType) { IntegerValueRange range = null; try { range = iType.getRange(); } catch(ConfigurationException e) { } long val = 0; boolean valInRange = false; if(range != null) { try { long min = range.getMinimum(); long max = ...
9
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerLogin(PlayerLoginEvent event) { if (CTServer.getBanManager().isBanned(event.getPlayer()) || CTServer.getIPBanManager().isBanned(event.getAddress())) { event.disallow(Result.KICK_BANNED, Util.maskedStringReplace(i18n._("banmessage_to_disconnectpla...
4
public Customer customerLogin(String username, String password) { Customer customer; try { customer = (Customer) this.em.createNamedQuery("findByEmail") .setParameter("paramEmail", username).getSingleResult(); if (!customer.getPassword().equals(password)) { throw new Exception(); } } catch (Exc...
2
public int evaluateSurroundingLeftDiagnolPositions(Position position, Token token, Map<Position, Token> tokenMap) { int row = position.getRow(); int column = position.getColumn(); Position[] position1 = { new Position(row, column), new Position(row - 1, column - 1), new Position(row - 2, column - 2) };...
9
private void validerNombreHeuresSurGroupeSpecial() { String[] listeCategorie = { CATEGORIE_COURS, CATEGORIE_ATELIER, CATEGORIE_SEMINAIRE, CATEGORIE_COLLOQUE, CATEGORIE_CONFERENCE, CATEGORIE_LECTURE_DIRIGEE }; if (heuresAccum...
1
public static Sexp apply(Sexp sexp, Map<AtomSymbol, Sexp> env) throws FunctionException { Sexp ret = sexp; sexp = (sexp instanceof IPair && ((IPair)sexp).getCdr() == Atom.NIL)?((IPair)sexp).getCar():sexp; if (sexp instanceof AtomSymbol && env.containsKey((AtomSymbol) sexp)) { ...
9
@Override public String fetch(FetcherCallBack fetcherCallBack) { try { Thread.sleep(1000); } catch (InterruptedException e) { logger.error(e.getMessage(), e); } String s = "foobar"; fetcherCallBack.fetchSuccess(s); return s; }
1
public ItemStack getTrade(Chest chest,MaterialData data){ if(chest==null || data==null) return null; Object price = stores.get(chest).getPrice(data); if(price instanceof Integer) return null; else return (ItemStack) price; }
3
@Override public String toString() { if (category != null) return category.toString() + ": " + (include ? "include" : "ignore"); else return type.toString() + ": " + (include ? "include" : "ignore"); }
3
@EventHandler public void GiantWeakness(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getGiantConfig().getDouble("Giant.Weakness....
6
public Node inDistNodeList(String word, double distance,int direction){ Double dist = new Double(distance); Node flagNode = new Node("NULL",0,0); if(direction == DFSSearch.LEFT){ if(LeftDistNodeList.containsKey(dist)) { ArrayList<Node> tempList = LeftDistNodeList.get(dist); int length = tempList.size()...
8
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked String[] temp = new String[6]; for (int i = 0; i < 6; i++) { temp[i] =(String) pileCarteEnnemis.get(i); } for (int i = 0; i < 6; i++) { pileCarteEnnemis.remov...
4
private void binarySearch(int[] A, int left, int right, int target, int[] result) { // not exist if (left > right) { result[0] = -1; result[1] = -1; return; } int middle = (left + right) / 2; if (target == A[middle]) { int start = ...
8
@Override public long periodUntil(DateTime endDateTime, PeriodUnit unit) { if (endDateTime instanceof LocalTime == false) { throw new DateTimeException("Unable to calculate period between objects of two different types"); } LocalTime end = (LocalTime) endDateTime; if (unit instanceof ChronoUnit...
9
public void visitArrayLengthExpr(final ArrayLengthExpr expr) { if (expr.array() != null) { expr.array().visit(this); } print(".length"); }
1
public void insert(V val,K k) { String[] v = k.toString().split("-"); String[] u = key.toString().split("-"); if (Integer.parseInt(u[1]) == Integer.parseInt(v[1])) { value = val; } else if (Integer.parseInt(u[1])< Integer.parseInt(v[1])) { if(r...
4
public void parseCommand(String command) { boolean isCommand = false; String[] cmd = command.split(" "); String[] args = new String[cmd.length - 1]; int count = 0; command = cmd[0]; for(String s : cmd) { if(count != 0) { args[count-1] = s; } count++; } for(Command c: command...
5
@Override public String getDesc() { return "MeteorStorm"; }
0
private int startX(Point[][] matrix) { for (int row = 0; row < matrix.length; row++) { for (int col = 0; col < matrix[0].length; col++) { if (matrix[row][col] != null) { return matrix[row][col].x - row; } } } throw new R...
3
public void calculateDerived() { xStats.calculateDerived(); yStats.calculateDerived(); differencesStats.calculateDerived(); correlation = Double.NaN; if (!Double.isNaN(xStats.stdDev) && !Double.isNaN(yStats.stdDev) && !Utils.eq(xStats.stdDev, 0)) { double slope = (xySum - xStats.sum * yStat...
9
public Capital(String type, int a1, int a2, int b1, int b2, int b3, int b4, int b5, int b6, double c, int d, int e1, int e2, int e3, int f1, int f2, int f3, int g1, int g2, int g3){ //Constructor this.type=type; resource1=a1; //Set dynamic resource if (a2!=-1){ //Set proportional resource resource2=a2; ...
1
public Integer call() { int sum = 0; for (int i = 0; i < 100000; i++) { sum += i; } System.out.println(numberOfThread); return Integer.parseInt(word); }
1
static private boolean jj_3R_11() { if (jj_scan_token(INSTANTIATE)) return true; if (jj_scan_token(TYPEIDENT)) return true; if (jj_scan_token(LPAREN)) return true; Token xsp; xsp = jj_scanpos; if (jj_3_19()) jj_scanpos = xsp; if (jj_scan_token(RPAREN)) return true; return false; }
5
public void unMuteMedia() { if (Debug.audio) System.out.println("AudioPlayer -> unMuteMedia called"); if ((null != player) && realizeComplete) { gainControl.setMute(false); if (Debug.audio) System.out.println("AudioPlayer -> unMuteMedia un-set"); } }
4
@Override public int getNumPlayers() { int tempInt = 0; while(true){ tempInt = getIntFromUser("PLEASE CHOOSE HOW MANY OF PEOPLE"); if(tempInt <= 1) { displayError("Please enter an integer greater than 1.\n (but not TOO large...)"); } else { break; } } this.players = tempInt; return pla...
2
@Override public void e(float sideMot, float forMot) { if (this.passenger == null || !(this.passenger instanceof EntityHuman)) { super.e(sideMot, forMot); this.W = 0.5F; // Make sure the entity can walk over half slabs, // instead of jumping return; } EntityHuman human = (EntityHuman) this.passe...
8
@Override public boolean authorize(AuthorizationToken token) { if (token.getType().equals(getType())) { if (userExists(token.getId()) && users.get(token.getId()).equals(token.getPasscode())) { return true; } System.out.println("Access denied."); } else { System.out.println("Invalid Authorizati...
3
@Override public boolean isTriggered(Rectangle bbox) { boolean result = ( pos.x > bbox.x && pos.x < (bbox.x + bbox.width) && pos.y > bbox.y && pos.y < (bbox.y + bbox.height) && System.currentTimeMillis() > timeSafe); ...
4
public float nextLog() { // Generate a non-zero uniformly-distributed random value. float u; while ((u = gen.nextFloat()) == 0); // try again if 0 return (float) (-mean*Math.log(u)); }
1
public void setCategoryName(String categoryName) { this.categoryName = categoryName; }
0
public boolean chunkExists(int var1, int var2) { if(!this.canChunkExist(var1, var2)) { return false; } else if(var1 == this.lastQueriedChunkXPos && var2 == this.lastQueriedChunkZPos && this.lastQueriedChunk != null) { return true; } else { int var3 = var1 & 31; int ...
6
public void save(File dst) throws IOException { JarOutputStream jos = new JarOutputStream(new FileOutputStream(dst)); for (ClassNode c : classes.values()) { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); c.accept(cw); JarEntry je = new JarEntry(c.name + ".class"); jos.putNextEntry(je); j...
1
public static void loadFileToCars(Connection connection, String filePath) { ReadCVS cvsReader = new ReadCVS(); String[] record; PreparedStatement statement = null; try { cvsReader.readFile(filePath); String insertTableRequest = "INSERT INTO cars" + ...
7
@Override public boolean execute(double perc) { clearVar(); preExecute(perc); //sorting terminals list for (int i = 0; i < terminals.length; i++) { sortedTerminals.add(new S2DDelay(source, terminals[i], spTerCosts[i])); } Collections.sort(sortedTerminals, new S2DDelayComparator()); HashSet un...
9
@Override public void copyFrom(MapLayer other) { for (int y = bounds.y; y < bounds.y + bounds.height; y++) { for (int x = bounds.x; x < bounds.x + bounds.width; x++) { setTileAt(x, y, ((TileLayer) other).getTileAt(x, y)); } } }
2
public void sendCommand(String command) { outputBuffer.setLength(0); try { out.writeBytes(command + "\n"); out.flush(); // try{Thread.sleep(100);}catch(Exception ee){} // InputStreamReader isr = new InputStreamReader(in); // BufferedRea...
7
public Vector splitAscii(int split, String msg) { int j; msg=this.return_ascii(msg); Vector blocks=new Vector(); for(int i=0;i<msg.length();) { j=i+1; //System.out.println("i= "+i); while(Integer.valueOf(msg.substring(i, j))<split) { //System.out.println("j= "+j); if(j+1>msg.length()) ...
3
public Object insert(K value) { // // We initialise the node first, based on the assumption we can always add // more. In the special case of an empty tree, assign this as the root. final Node i = new Node() ; i.value = value ; i.belongs = this ; if (root == null) { i.side = Side.R ...
5
private static double[][] calculateSubMatrix(double[][] matrix){ int equations = matrix.length; int coefficients = matrix[0].length; double[][] result = new double[equations - 1][coefficients - 1]; for (int eq = 1; eq < equations; eq++) { double factor = matrix[0][0] / matrix...
9
public boolean validity() { return isValid; }
0
public double getLastPacketTime(int entityTo) { double time = 0.0; for (int i = 0; i < data.size(); i++) { if ((((Event)(data.elementAt(i))).getType() == NetworkSimulator.FROM_LAYER_3) && (((Event)(data.elementAt(i))).ge...
3
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); System.out.println(Math.min(n, m)%2==0?"Malvika":"Akshat"); }
1
private boolean allNumbers(String value) { boolean uniqueDot = true; for (int x = 0; x < value.length(); x++) { if (value.charAt(x) != '.' && value.charAt(x) < '0' || value.charAt(x) > '9') return false; else if (value.charAt(x) == '.' && uniqueDot) uniqueDot = false; else if (value.charAt(x) ...
8
public static String join(String deliminator, Iterable<String> iterable) { StringBuilder buffer = new StringBuilder(); for (String string : iterable) { buffer.append(string).append(deliminator); } if (buffer.length() < deliminator.length()) return ""; retu...
2
Node splitArcAt( Node n, short version, int pos, int offset, boolean atStart ) throws Exception { Arc a = null; Node splitNode = null; Node orig = n; while ( n != end ) { a = n.pickOutgoingArc( version ); if ( pos+a.dataLen() < offset || (!atStart && pos+a.dataLen() == offset) ) { ...
9
public static boolean isPalindrome(LinkedListNode n) { if(n == null) return false; Stack<Integer> half = new Stack<Integer>(); LinkedListNode quick=n, slow=n; while(true) { if(quick == null || quick.next == null) break; quick = quick.next.next; slow = slow.next; half.push(slow.val); ...
7
public void suljeYhteys(Connection yhteys) throws DAOPoikkeus { try { if (yhteys != null && !yhteys.isClosed()) yhteys.close(); } catch(Exception e) { throw new DAOPoikkeus("Tietokantayhteyden sulkeminen epäonnistui.", e); } }
3
public void setField3(Object field3) { this.field3 = field3; }
0
public static void findWay(int[][] maze, Pair start, Pair end) { LinkedList<Pair> queue = new LinkedList<>(); Map<Pair, Pair> parent = new HashMap<>(); queue.addLast(start); parent.put(start, null); while(!queue.isEmpty()) { Pair p = queue.removeFirst(); ...
7
public static ItemWithBehaviour createItem(String name, int sellIn, int quality) { if (name.contains("Aged Brie")) return new AgedBrie(name,sellIn,quality); if (name.contains("Backstage passes")) return new BackstagePasses(name,sellIn,quality); if (name.contains("Sulfuras")) return new Sul...
4
protected void fireDocumentAddedEvent(Document doc) { addedEvent.setDocument(doc); for (int i = 0, limit = documentRepositoryListeners.size(); i < limit; i++) { ((DocumentRepositoryListener) documentRepositoryListeners.get(i)).documentAdded(addedEvent); } // Cleanup addedEvent.setDocument(null); }
1
public Coord xlate(Coord c, boolean in) { Coord ctl = wbox.tloff(); if (in) return (c.add(ctl).add(tlo).add(mrgn)); else return (c.add(ctl.inv()).add(tlo.inv()).add(mrgn.inv())); }
1
private void button9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button9MouseClicked if(numberofpins < 4) { if(numberofpins == 0) { Login_form.setString1("8"); } if(numberofpins == 1) { Login_form.setString2("8"); } if(numberofpins == 2) { Login_...
5
public static Solucao VND(Solucao solucaoxx, int k){ int x = 0; Solucao solucao = new Solucao(solucaoxx); while(true){ if(k==0){ EstruturasVizinhanca oneflip = new EstruturasVizinhanca(solucao); Solucao solucao2 = oneflip.One_flip_best(solucao, 0); ...
5
public void addHuman(Human human) { if (getSize() == BUILDING_CAPACITY) return; humans[size++] = human; }
1
/* */ protected List<Node> getChildElements(String localName) /* */ { /* 201 */ NodeList nl = this.e.getChildNodes(); /* 202 */ List l = new ArrayList(); /* 203 */ for (int i = 0; i < nl.getLength(); i++) /* */ { /* 205 */ if ((nl.item(i).getNodeType() == 1) && /* 206 */ (...
3
public int size() { int i = 0; if (this.getFirstNode() == null) return i; else i++; if (firstNode.getNext() != null) { DListNode<T> nextNode = firstNode.getNext(); while (nextNode.getNext() != null) { i++; nextNode = nextNode.getNext(); } } else { return i; } i++; return i; ...
3
public int registerPacket(Class<? extends APacket> p) { if(!PList.contains(p)) { PList.add(p); } return PList.indexOf(p); }
2
public boolean isNearlyLowerTriagonal(double tolerance){ boolean test = true; for(int i=0; i<this.numberOfRows; i++){ for(int j=0; j<this.numberOfColumns; j++){ if(i>j && Math.abs(this.matrix[i][j])>Math.abs(tolerance))test = false; } } retu...
4
public ResultSet executarSql(String sql) { Connection conn = this.getConn(); ResultSet rs = null; try { Statement stm = conn.createStatement(); rs = stm.executeQuery(sql); } catch (SQLException ex) { Logger.getLogger(ConectorMySql.class.getName()).log(...
1
@Override public void displayFromExcel(String xlsPath) { InputStream inputStream = null; try { inputStream = new FileInputStream(xlsPath); POIFSFileSystem fileSystem = null; try { fileSystem = new POIFSFileSystem(inputStream); HSSFWorkbook workBook = new HSSFWorkbook(fileSystem); HSSFSheet s...
8
public Complacency getComplacency() { // int complacencyPercentage = (complacencyVal / complacencyMax * 100); if (getComplacencyVal() < 400) { complacency = Complacency.REBELLIOUS; } else if (getComplacencyVal() > 399 && getComplacencyVal() < 750) { complacency = Complacency.IRRITATED; ...
8
public boolean cantarTruco(){ if((this.getCartas()[0].getValor() > 7)&&(this.getCartas()[1].getValor() > 7)){ return true; }else if((this.getCartas()[1].getValor() > 7)&&(this.getCartas()[2].getValor() > 7)){ return true; }else if((this.getCartas()[0].getValor() > 7)&&(this.getCartas()[2].getValor() > 7)){ ...
6
public void method216(int i, int j, int k, int l, int i1, boolean flag) { int j1 = 256; if(flag) j1 += 0x20000; k -= anInt290; l -= anInt291; if(i == 1 || i == 3) { int k1 = j; j = i1; i1 = k1; } for(int l1 = k; l1 < k + j; l1++) if(l1 >= 0 && l1 < anInt292) { for(int i2 = l; i2 <...
9
public Object getFieldValue(_Fields field) { switch (field) { case FIRST_NAME: return getFirstName(); case LAST_NAME: return getLastName(); case STATUS: return getStatus(); case ID: return Integer.valueOf(getId()); } throw new IllegalStateException(); }
4
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 setInnerRadius(double radius){ if(radius<=0.0D)throw new IllegalArgumentException("The inner radius, " + radius + ", must be greater than zero"); if(this.outerRadius!=-1.0D && this.outerRadius<=radius)throw new IllegalArgumentException("The inner radius, " + radius + ", must be less than the...
5
public TransactionSet twoItemSubsets(TransactionSet candidSet, double minSupportLevel, TransactionSet transSet) { //System.out.println("2 ItemSubsets starting"); //System.out.println("Starting ItemSet to make 2 item subsets"); TransactionSet allSubsets = new TransactionSet();/*New subset of transactions to ret...
3
public void addMeteor(){ if(Math.random()<.05) { for (int x = 0; x < 1; x++) { int sizerandom = 0; int spawnx = 0; int spawny = 0; boolean inSpawnzone = false; do { sizerandom = (int) (Math.random() *...
3
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS-ARE> ...
8
private void printResult(StaticState[] resultState, int tracing) {//Highlight String[] sides = {"left", "down", "right", "up"}; // Walls & Traps for (int i = 0; i < resultState[tracing].getStaticMaze().length; i++) { for (int j = 0; j < resultState[tracing].getStaticMaze().length; j++) ...
9
public void testWithFieldAdded2() { TimeOfDay test = new TimeOfDay(10, 20, 30, 40); try { test.withFieldAdded(null, 0); fail(); } catch (IllegalArgumentException ex) {} }
1
public void removeBankAccount(CommandSender sender, String name, String player) { Bank bank = iConomy.getBank(name); if (!iConomy.hasAccount(player)) { Messaging.send(this.Template.color("error.bank.account.none")); return; } if (bank == null) { Messaging.send(this.Template....
3
public List<String> getSomeList() { return someList; }
0
public void delete(int index) { assert 0 <= index && index < length; DNode previousNode = (index - 1 >= 0) ? getNode(index - 1) : null; DNode deleteNode = (previousNode != null) ? previousNode.next : getNode(index); DNode nextNode = (deleteNode != null) ? deleteNode.next : null; if (previousNode != null) ...
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CellPhone other = (CellPhone) obj; if (serialNumber == null) { if (other.serialNumber != null) return false; } else if (!serialNumber.eq...
6
public static File directoriesToFile(String ... directoryNames) { if(directoryNames.length == 0) { throw new IllegalArgumentException("No directory names"); } File f = null; for(String dn : directoryNames) { f = f == null ? new File(dn) : new File(f, dn); } return f; }
3
public ArrayList<RunePage> generateAllPages(ArrayList<Rune> marks, ArrayList<Rune> quints) { ArrayList<RunePage> pages = new ArrayList<RunePage>(); RunePage tempPage = new RunePage(); tempPage.fillPage(marks.get(0), quints.get(0)); pages.add(new RunePage(tempPage)); List<Rune> thisMarks = tempPage.getMarks...
4
private static void fourthStrategy() { Semaphore MReading = new Semaphore(1); Semaphore MWriting = new Semaphore(1); int RCounter = 0; int WCounter = 0; Random r = new Random(); while(true) { if(r.nextDouble() > 0.5) new Lecteur3(MReading,MWriting, RCounter).run(); else new Redacteur3(M...
2
final public Expression FloatExpression() throws ParseException { final Variable v; final String s; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VARIABLE: v = Variable(); {if (true) return new VariableExpression(v);} break; case STRING_END: case INTEGER: ...
8
public String generateOrder() { FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) facesContext.getExternalContext() .getSession(false); // Session object holds current username String userId = (String) session.getAttribute("username"); String role=(String...
4
private CommandType(Class<? extends Command> cls) { this.cls = cls; }
1
public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) { if (cmd.getName().equals("displaytables")) { if (args.length != 1) return false; if (!args[0].equalsIgnoreCase("reload")) return false; if ( sender instanceof Player && !canUse((Player)sender, "displaytable.reload"...
5