text
stringlengths
14
410k
label
int32
0
9
private boolean isSkill(final String checkSkill) { for (String skill : SKILLS) { if (skill.equalsIgnoreCase(checkSkill)) return true; } return false; }
2
public String createMessage(String forumId, String subForumId, User user, String title, String content) { Forum forum = this.getForum(forumId); if (forum != null) { SubForum subforum = forum.getSubForumById(subForumId); if (subforum != null) return subforum.createMessage(user, title, content); } re...
2
private void initUsermenuImageMenu(Color bg) { this.usermenuImageMenu = new JPanel(); this.usermenuImageMenu.setBackground(bg); this.usermenuImageMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT)); // size int[] size = new int[] { this.skin.getUsertileImageWidth(), this....
6
private boolean isFullHouse(ArrayList<Card> player) { ArrayList<Integer> sortedHand=sortHand(player); int doubleCounter=0; int tripleCounter=0; for(int i=0;i<player.size()-1;i++) { if(sortedHand.get(i)==sortedHand.get(i+1)) { if(tripleCounter==1) { sortedHand.remove(i+1); sortedHand.remove(i); ...
8
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Utilisateur)) { return false; } Utilisateur other = (Utilisateur) object; if ((this.mail == null && other.mail ...
5
private void actionBtStart() { // test de source et dest if(dirSource==null) { JOptionPane.showMessageDialog(null, "Veuillez sélectionner un dossier SOURCE.", "ERREUR",JOptionPane.ERROR_MESSAGE); return; } if(!(new File(dirSource.getPath())).isDirectory()) // cas où le dossier est suppr par le user...
5
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { RequestDispatcher rd = null; try { producten.changeMinVoorraad(Integer.parseInt(req.getParameter("onderdeelId")), Integer.parseInt(req.getParameter("minVoorraad"))); } catch (SQLException e)...
2
public double bonusDefense(Territoire t, Peuple attaquant) { return t.has(Laboratoire.class) ? 2.0 : 0.0; }
1
public static void floodfill(Room r, int x, int y) { if(x < 0 || x >= h) { return; } if(y < 0 || y >= w) { return; } if(roomA[x][y] == null) { roomA[x][y] = r; r.incrementSize(); // west wall if(castle[x][y]%2 == 0) { floodfill(r, x, y-1); } // north wall if((castle[x][y]/2)%2 == 0) { ...
9
public void testConstructor_Object2_Chronology() throws Throwable { LocalTime test = new LocalTime("T10:20"); assertEquals(10, test.getHourOfDay()); assertEquals(20, test.getMinuteOfHour()); assertEquals(0, test.getSecondOfMinute()); assertEquals(0, test.getMillisOfSecond()); ...
1
private boolean r_Step_4() { int among_var; int v_1; // (, line 140 // [, line 141 ket = cursor; // substring, line 141 among_var = find_among_b(a_7, 18); if (among_var == 0) ...
9
public synchronized void saveAllImages() { if (history.isEmpty()) { System.out.println("No images to save"); return; } JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new java.io.File(".")); jfc.setDialogTitle("Choose a Directory"); jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY...
3
public void optimizeParam(int numItns) { assert wordTopicHist != null; // update histograms int njMax = wordTopicCountsNorm[0]; for (int j=1; j<T; j++) if (wordTopicCountsNorm[j] > njMax) njMax = wordTopicCountsNorm[j]; wordTopicNormHist = new int[njMax + 1]; for (int j=0; j<...
8
void RendreVelo(Utilisateur user) { Velo velo = null; for (Velo s : ConfigGlobale.velos) { if (s.getId_velo() == user.getFk_id_velo()) { velo = s; break; } } ArrayList<Borne> listeBorneStation = new ArrayList<Borne>(); Ite...
9
public static <T> boolean contains( final T[] array, final T v ) { for ( final T e : array ) if ( e == v || v != null && v.equals( e ) ) return true; return false; }
4
private BigDecimal processBudgetItemsList(Budget budget, List<? extends BudgetItem> budgetItems) throws BudgetItemsMissingException { if(budget.getCoreBudgetItemList() != null && budget.getSocialBudgetItemList() != null) { return calculateTotalBudgetItems(budgetItems); } else { ...
3
private ArrayList<Tilausrivi> paivitaTuote(HttpServletRequest request, ArrayList<Tilausrivi> tilausrivit) { // otetaan vastaan tuotteen muokattavat tiedot int tilausriviNumero = Integer.parseInt(request.getParameter("btn").substring(5)); int kplmaara = Integer.parseInt(request.getParameter("kpl-maara")); ...
2
public final static boolean isArchiveFileName(String name) { int nameLength = name == null ? 0 : name.length(); int suffixLength = SUFFIX_JAR.length; if (nameLength < suffixLength) return false; // try to match as JAR file for (int i = 0; i < suffixLength; i++) { char c = name.charAt(nameLength - i - 1); ...
9
public static Date getDateFromRange(String dropdownValue) { if (dropdownValue == null) { throw new IllegalArgumentException("Logic Error: input argument may not be null"); } int nDays = -1; for (Range d : dateRanges) { if (dropdownValue.equals(d.choiceValue)) { nDays = d.days; break; } } if...
4
@Override final public void compute() { // // reset time. // final int last = this.frameidx; this.setFrameIdx(0); // for (int t = 0; t <= last; t++) { // if (t > 0) { this.copyOutput(this.frameidx - 1, this.frameidx); ...
4
private void writeMsgLength(OutputStream out) throws IOException { int msgLength = messageLength(); int val = msgLength; do { byte b = (byte) (val & 0x7F); val >>= 7; if (val > 0) { b |= 0x80; } out.write(b); } while (val > 0); }
2
void parstt() { double[] xMax = new double[numOfParams]; double[] xMin = new double[numOfParams]; double[] xMean = new double[numOfParams]; double delta = Math.pow(10, -20); // double delta = 10E-20; double peps = Math.pow(10, -3); // minimum standard deviation // d...
4
private void endFormals() { if (hasFormals) { hasFormals = false; buf.append('>'); } }
1
@Override protected boolean hasRightNumberOfPieces(Map<PieceType, Integer> redPieceCount, Map<PieceType, Integer> bluePieceCount) { int redOffby = 0; int blueOffby = 0; for(PieceType piece : validPieceCount.keySet()) { int requiredNumber = validPieceCount.get(piece); Integer redCount = redPieceCou...
7
private int findNextStartIndex(String[] words, int start, int L, List<String> lines) { // find end index for a line int i = start; List<String> lineWords = new ArrayList<String>(); int len = 0; while (len < L && i < words.length) { String word = words[i]; ...
4
public ArrayList<String> search(String title){ boolean find = false; byte count = 0; ArrayList<String> res = new ArrayList<String>(); ArrayList<String> html=null; try { html = getHTML("http://www.lyricsmania.com/searchnew.php?k="+URLEncoder.encode(title,"UTF-8")+"&x=0&y=0");//"http://webservices.lyrdb...
8
private List<LastFMEventMetaData> processingSearchResults( JSONObject response) { JSONObject responseEvents = (JSONObject) response.get("events"); List<LastFMEventMetaData> container = new ArrayList<LastFMEventMetaData>(); if (responseEvents.containsKey("event") && responseEvents.containsKey("event")) { ...
5
public JSONObject apiHome(String endpoint, String urlParameters, String method){ String YOUR_REQUEST_URL = "http://chicosystems.com:3000/api/"+endpoint; // String YOUR_REQUEST_URL = "http://chicosystems.com:3000/api/imgurdl/adduse"; URL imgURL; String os = System.getProperty("os.name"); String ver = ge...
4
@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
public int binair_zoeken(char target) { int top = rij.length -1; //Maximale arry index positie of maximale positie na een breuk int bottom = 0; //start positie of laagste positie na een breuk while (bottom <= top) // zolang de bottom waarde kleiner is dan top waarde herhaalt de loop zich. ...
3
private void checkFilename(String filename, int len) throws BadHttpRequest { for (int i = 0; i < len; ++i) { char c = filename.charAt(i); if (!Character.isJavaIdentifierPart(c) && c != '.' && c != '/') throw new BadHttpRequest(); } if (filenam...
5
private List<AchievementRecord> readAchievements(InputStream in) throws IOException { int achievementCount = readInt(in); List<AchievementRecord> achievements = new ArrayList<AchievementRecord>(achievementCount); for (int i = 0; i < achievementCount; i++) { String achName = readString(in); int diff...
2
public static void listDatabase() { for(String s : database) { System.out.println(s); } }
1
public DuplexLink get_link(int port) { if (this.links.containsValue(port)) { Iterator<DuplexLink> itr = this.links.keySet().iterator(); while (itr.hasNext()) { DuplexLink link = itr.next(); if (this.links.get(link) == port) return link; } } return null; }
3
public void deleteElement(ValueType value) throws NotExistException { ListElement<ValueType> previous = head; ListElement<ValueType> current = head.next; if (exist(value)) { while (current != tail.next) { if (current.value == value) { previous.next...
3
public void setString(PString node) { if(this._string_ != null) { this._string_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
3
@Override public boolean stopVideoProcessing() { // First clean created data ... cleanUp(); // Then attempt to stop the processThread if (processThread == null || !processThread.isAlive()) return false; // Didn't find any better way to kill the thread pr...
2
protected String[] doparse(String str) { List<String> list = new LinkedList<String>(); for (String s : str.split(",")) { list.add(s); } String[] result = new String[list.size()]; list.toArray(result); return result; }
1
public void onPriceChanged(int price) { setText(INIT_TEXT + price); }
0
private String GetPrecision(String value) { String precision = "undefined"; // 1991-12-23 // 1992-9-3T10:00.... if (value.matches("^(1[6789][0-9]{2}|20[0-9]{2})-[0-9]{1,2}-[0-9]{1,2}(T.*)?$")) { precision = "day"; } // 1991-...
7
public void salvar() { if (dao.Salvar(entidade)) { exibirMensagem("Salvo"); entidade = new Pessoa(); } else { exibirMensagem("Erro!"); } }
1
@Override public void build(String catadata) { List<XMLLibrary.XMLTag> V=null; if((catadata!=null)&&(catadata.length()>0)) { V=CMLib.xml().parseAllXML(catadata); final XMLTag piece=CMLib.xml().getPieceFromPieces(V,"CATALOGDATA"); if((piece!=null)&&(piece.contents()!=null)&&(piece.contents().siz...
7
public static Stella_Object finishWalkingArgumentListTree(Slot self, Cons tree, StandardObject firstargtype, Object [] MV_returnarray) { if (self.slotName == Stella.SYM_STELLA_ALLOCATE_ITERATOR) { { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get(); try { Native.setBooleanSpecia...
6
public void removeItem(DrawableItem item) { if (item == null) { return; } if (item instanceof PathItem) { boolean active = false; if (((PathItem) item).getPanel() != null) { for (PathItem pi : ((PathItem) item).getPanel().getLines()) { ...
5
public long previousTransition(long instant) { return (instant > transition ? transition : transition - 180L * DateTimeConstants.MILLIS_PER_DAY); }
1
public static MonthOfYearEnum fromValue(String v) { for (MonthOfYearEnum c: MonthOfYearEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
2
private void visit(GraphRelationship graphRel, GraphNode graphNode, List<GraphComponent> currentPathList) { if (currentPathList.contains(graphNode)) { // we've come round to a node that we've already visited so add at end of list and return currentPathList.add(graphNode); // no further action ...
9
@SuppressWarnings("deprecation") void pauseExecution() { for(ThreadsInformation threadInfo : ThreadsAgent) threadInfo.threadInfo.suspend(); }
1
public void update() { // If master volume has been changed, update all volumes if(adjustVolume) { // Sound effects for(int x = 0; x<soundEffects.size(); x++) { soundEffects.get(x).adjustVolume(masterVolume); } // Tracks for(int x = 0; x<tracks.size(); x++) { tracks.get(x).adjustVolume(master...
9
private byte[] trim(byte[] in) { // remove the extra space of a byte array byte[] temp = in; int realLength = 0; for (int i = 0; i < temp.length; i++) {// count length if (temp[i] != 0) { realLength = i + 1; } } byte[] out = new byte[realLength]; for (int j = 0; j < out.length; j++) {// copy dat...
3
public void run(SensesPackage senses) { //TODO this code is potentially buggy because it doesn't check collision always. if (senses.playerVisible()) { //Check if the player is visible and update the path as necessary path = Pathfinding.pathTo(parent.getPos(), senses.getPlayerLocation(), senses); ...
4
private static void createDirt(int width, int height) { for(int x = 0; x < width; x++) { for(int y = dirtBoundary + 1; y < stoneBoundary; y++) { blockSheet[x][y] = World.DIRT; } } }
2
private static final Object[] decodeString(byte[] bencoded_bytes, int offset) throws BencodingException { StringBuffer digits = new StringBuffer(); while(bencoded_bytes[offset] > '/' && bencoded_bytes[offset] < ':') { digits.append((char)bencoded_bytes[offset++]); } ...
3
public boolean hasAccount(String account) { Connection conn = null; ResultSet rs = null; PreparedStatement ps = null; boolean exists = false; try { conn = iConomy.getiCoDatabase().getConnection(); ps = conn.prepareStatement("SELECT * FROM " + Constants.SQLTable + "_BankRelations WH...
7
private final void writeAbcTrack(final OutputStream out, final DropTarget<JPanel, JPanel, JPanel> abcTrack, final Map<DragObject<JPanel, JPanel, JPanel>, Integer> abcPartMap) { for (final DragObject<JPanel, JPanel, JPanel> midiTrack : abcTrack) { final Integer pitch = BruteParams.PITCH.getLocalValue(midiTra...
3
public Element(Grid grid) { if (grid == null) throw new IllegalArgumentException("The given Grid is invalid!"); this.grid = grid; }
1
void solve() { NHL nhl = new NHL(in); double e1 = 0, c = 0, e2 = 0; double minProfit = -0; int cBets = 0; double prPerBank = 0; nhl.deep = 6; for (double eps1 = 0.5; eps1 <= 0.5; eps1 += 0.25) for (double eps2 = 0.5; eps2 <= 0.5; eps2 += 0.25) ...
5
@SuppressWarnings("unchecked") private AsyncComponent<T> getAsyncComponent() { if (asyncComponent == null) { // distinguish components that are already wrapped with AsyncComponent if (this instanceof AsyncComponent<?>) { asyncComponent = ((AsyncComponent<T>) this); } else { asyncComponent = new Asy...
3
public CommandListener(Trd_match plugin) { this.plugin = plugin; }
0
public static int getArgumentSize(String methodTypeSig) { int nargs = 0; int i = 1; for (;;) { char c = methodTypeSig.charAt(i); if (c == ')') return nargs; i = skipType(methodTypeSig, i); if (usingTwoSlots(c)) nargs += 2; else nargs++; } }
3
public void skipTag(String name) throws IOException { String marker; if (SHOW_SKIPPED_TAGS) { Log.warn("Skipping tag: " + name); //$NON-NLS-1$ } require(XMLNodeType.START_TAG, name); marker = getMarker(); do { next(); } while (withinMarker(marker)); }
2
private void populateList(String[] list){ for(int i = 0; i < list.length; i++){ if(list[i].endsWith(".jpg") || list[i].endsWith(".gif") || list[i].endsWith(".png") || list[i].endsWith(".jpeg") || list[i].endsWith(".tiff")){ downloadedFiles.add(list[i]); System.err.println(list[i]); } } }
6
public boolean passable() { return this == TILE_TREASURE || this == TILE_FLOOR; }
1
public void set(String path, Object value) { Configuration root = getRoot(); if (root == null) { throw new IllegalStateException("Cannot use section without a root"); } final char separator = root.options().pathSeparator(); // i1 is the leading (higher) index ...
5
@EventHandler public void onPlayerInteract(PlayerInteractEvent event){ if(event.getClickedBlock()==null) return; if(!(event.getClickedBlock().getState() instanceof Chest)) return; Chest chest = (Chest) event.getClickedBlock().getState(); Player player = event.getPlayer(); if(!plugin.isCoffer(che...
4
public boolean isEdgeIgnored(Object edge) { mxIGraphModel model = graph.getModel(); return !model.isEdge(edge) || !graph.isCellVisible(edge) || model.getTerminal(edge, true) == null || model.getTerminal(edge, false) == null; }
3
private Constants.Error createTemporaryData() { { LOGGER.debug("Creating Temporary Data!"); } Constants.Error ret = null; ret = createBackUpFiles(); if (ret == null) { try { FileUtil.createDirectory(Constants.PROGRAM_TMP_PATH); ...
5
public E put(E obj, int x, int y, int z) throws ConstraintException { if (obj == null) { return null; } if (x > sideLength || y > sideLength || z > sideLength || x < 0 || y < 0 || z < 0) { throw new ConstraintException("Cannot place a data value at that point!"); ...
8
public int getUpperLeftY() { if (y1 > y2) { return y1; } else { return y2; } }
1
public void checkLasers(){ for (Iterator<Laser> iterator = lasers.iterator(); iterator.hasNext(); ) { Laser b = iterator.next(); if(collisionCircle(getX(),getY(),h/2+h/4,(int)b.getX(),(int)b.getY(),2)&&b.kind!=kind){ health-=b.getDamage(); for(int y=0;y<...
8
public static <GSource, GTarget> Collection<GTarget> translatedCollection(final Collection<GSource> items, final Translator<GSource, GTarget> translator) throws NullPointerException { if (items == null) throw new NullPointerException("items = null"); if (translator == null) throw new NullPointerException("transla...
7
private PieceMessage(ByteBuffer buffer, int piece, int offset, ByteBuffer block) { super(Type.PIECE, buffer); this.piece = piece; this.offset = offset; this.block = block; }
0
private void doBankCommand(Command command) throws RemoteException, RejectedException { CommandName inputCommand = command.getCommandName(); String userOrItemName = command.getUserOrItemName(); Float amount = command.getAmount(); account = bankobj.getAccount(clientname); switch (inputCommand) { case bal...
5
public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); BindingEnvironment env = context.getEnv(); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (n1.isLiteral() && n2.isLiteral()) { Object v1 = n...
8
@FXML private void handleTextFieldAction() { target = addrField.getText(); }
0
public Unit getUnitAt(Position p) { if ( p.getRow() == 2 && p.getColumn() == 3 || p.getRow() == 3 && p.getColumn() == 2 || p.getRow() == 3 && p.getColumn() == 3 ) { return new StubUnit(GameConstants.ARCHER, Player.RED); } if ( p.getRow() == 4 && p.getColumn() == 4 ) { return new StubUnit(GameConstan...
8
protected List<Teleporter> getTeleporterList(int amount) { final List<Teleporter> teleports = new ArrayList<Teleporter>(); for (int i = 0; i < amount; i++) teleports.add(getTeleporter()); for (Teleporter tp : teleports) tp.setDestination(getRandomDestination(tp, teleports)); return teleports; }
2
public void deposit(int value) { if(value >= 0) { notifyPropertyChangeListeners(money, money + value); money += value; } else { throw new IllegalArgumentException("You can't deposit a negative number of dollars!"); } }
1
@Override public String toString() { String result = getClass().getSimpleName() + " "; if (name != null && !name.trim().isEmpty()) result += "name: " + name; if (city != null && !city.trim().isEmpty()) result += ", city: " + city; if (country != null && !country.trim().is...
9
public static void clear() { try { root.clear(); String[] children = root.childrenNames(); for (int i = 0; i < children.length; i++) { Preferences node = root.node(children[i]); node.removeNode(); } root.sync(); } catch(BackingStoreException e) { vlog.error(e....
2
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { JFrame frame = new BounceFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } ...
0
@Override public void adjust() { boolean enable = false; Duplicatable duplicatable = getTarget(Duplicatable.class); if (duplicatable != null) { enable = duplicatable.canDuplicateSelection(); } setEnabled(enable); }
1
public void removePush() { StructuredBlock[] subBlocks = getSubBlocks(); for (int i = 0; i < subBlocks.length; i++) subBlocks[i].removePush(); }
1
@EventHandler public void onInteract(PlayerInteractEvent event) { if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getPlayer().hasPermission("decapitation.info") && event.getClickedBlock().getType() == Material.SKULL) { Skull s = (Skull) event.getClickedBlock().getState(); ...
4
Dimension getThumbDimensions(){ Dimension returnDim = null; switch(fullType){ case Original: returnDim = originalImage.thumbDimensions; case Filtered: returnDim = filteredImage.thumbDimensions; case Icon: returnDim = ico...
4
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((wordid1 == null) ? 0 : wordid1.hashCode()); result = prime * result + ((wordid2 == null) ? 0 : wordid2.hashCode()); return result; }
2
static void dradf4(int ido, int l1, float[] cc, float[] ch, float[] wa1, int index1, float[] wa2, int index2, float[] wa3, int index3){ int i, k, t0, t1, t2, t3, t4, t5, t6; float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4; t0=l1*ido; t1=t0; t4=t1<<1; t2=t1+(t1<<...
7
@Test public void missingSubPatternReplacementTest() throws URISyntaxException { patternReplacer = new PatternReplacer( "{scheme:3} {host:0} {port} {path:0} {fragment:0}") .setScheme(SCHEME_PATTERN) .setHost( HOST_PATTERN ) .setPath( PATH_PATTERN ) .setFragment( FRAGMENT_PATTERN ); try { pattern...
4
@Override public void printWay() { ArrayList<Coordinate> finderWay = new ArrayList<Coordinate>(); while(finderDuo_1.fHistory.top > 0 ) finderWay.add(finderDuo_1.fHistory.popLocation()); for(int i = finderWay.size()-1 ; i >= 0 ; i--) System.out.println(finderWay.get(i)); while(finderDuo_2.fHistory...
3
private ArrayList<String> validPossible(String s) { ArrayList<String> possible = new ArrayList<String>(); if (s.length() >= 1) { possible.add(s.substring(0, 1)); } if (s.length() >= 2) { String xx = s.substring(0, 2); if (!xx.startsWith("0")) { ...
6
private static List<ItemStack> parseItems(List<String> raw) { List<ItemStack> result = new ArrayList<ItemStack>(raw.size()); for (String string : raw) { String[] split = string.split(","); if (split.length == 0 || split.length == 1) { result.add(new ItemStack(Inte...
5
public static void main(String[] args) { IConsumes BMW = new Car_luxury("Registered E92"); IConsumes Oldsmobile = new Car_oldies("Unregistered Alero"); Car Lastun = new Car_oldies("Unregistered Dacia"); Car Ferrari = new Car_luxury("Registered 599 GTO"); Car_luxury Mercedes = new Car_luxury("Registered Mer...
5
public void processMyoEvent(MyoEvent me){ //System.out.println(me.frame.pose); if(me.frame.pose.contains("fingersSpread")) { System.out.println("All off received"); reset(); /* while(track.size() > 0) { for(int i = 0; i < track.size(); i++) { track.remove(track.get...
7
public final void quant(final float[] lsp, final float[] qlsp, final int order, final Bits bits) { int i; float tmp1, tmp2; int id; float[] quant_weight = new float[MAX_LSP_SIZE]; for (i=0;i<order;i++) qlsp[i]=lsp...
8
public static void printHandHidden(Hand hand) { // print hand header ArrayList<String> attrs = new ArrayList<String>(3); if(!hand.getDescription().equals("")) attrs.add(hand.getDescription()); if(hand.getBet() > 0.0f) attrs.add("bet: $" + hand.getBet()); output.println(hand.getPlayer().getName() + "\'...
9
public int[] twoSum(int[] numbers, int target) { int[] clone = Arrays.copyOf(numbers, numbers.length); Arrays.sort(clone); int i = 0, j = clone.length - 1; while (clone[i] + clone[j] != target) { if (clone[i] + clone[j] > target) { j--; } else if (...
9
public boolean isWhitelistedItem(ItemStack item, String group) { List<String> whitelist = plugin.getWhitelistedItems(group); @SuppressWarnings("deprecation") int dataValue = item.getTypeId(); @SuppressWarnings("deprecation") int damageValue = item.getData().getData(); for (String whitelistedItem : whiteli...
7
@Override public <X> X getScreenshotAs(OutputType<X> outType) { try { if (driver instanceof FirefoxDriver) { return ((FirefoxDriver) driver).getScreenshotAs(outType); } else if (driver instanceof ChromeDriver) { return ((ChromeDriver) driver).getScreen...
5
public static Properties getProperties() { if (config == null) { // Create once config = new Properties(); try { config.load(Configuration.class.getResourceAsStream(Constants.CONFIG_FILENAME)); } catch (IOException ex) { Logger.getL...
2
private static void ReadAttrisGrp(Element attrisgrpnode, GeneratorAttriGrp attrisgrp) { NodeList nodelist; Node node; Element elem; String name; int i; nodelist = attrisgrpnode.getChildNodes(); for (i = 0; i < nodelist.getLength(); i++) { node = nodelist.item(i); //find a attribute node if ...
5