text
stringlengths
14
410k
label
int32
0
9
int emptyBuckets() { int n = 0; for (int i = 0; i < buckets(); i++) { if (!filter_.get(i)) { n++; } } return n; }
2
public static void exit(){ DebugUtils.info("Closing application"); moduleManager.unloadAllModules(); desktop.getFrame().dispose(); }
0
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, IsActive__typeInfo)) { ...
9
public double interpolate(double[] unknownCoord){ int nUnknown = unknownCoord.length; if(nUnknown!=this.nDimensions)throw new IllegalArgumentException("Number of unknown value coordinates, " + nUnknown + ", does not equal the number of tabulated data dimensions, " + this.nDimensions); sw...
8
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int numOfCases = sc.nextInt(); for(int i = 0; i < numOfCases;i++) { //Gets how long the test key is int tesetLength = sc.nextInt(); //Need to jump to next line to get the data sc.nextLine(); String testAnswers = sc.ne...
3
public static void main(String[] args) throws IOException { // Text file, where // First line contains int dimension value // Second line contains monoms' power values // Third line contains coefficients, startin' with major monom coefficient String filePath = "c:\\NumMath\\EQ3....
5
private void setOutput(Quote quote) { String[] lines = quote.getContent(); for ( String line : lines ) reaction.add( Formatter.removeHTML(line) ); String url = "-- http://bash.org/?" + quote.getTextId() + " -- Next bash in " + getNextBashTime(); reaction.add(url); }
1
public ArrayList generateTokens(String docContents, String tokenizationType) { ArrayList<String> tokens = new ArrayList<>(); if (tokenizationType.equals("1-Grams")) { tokens = generateOneGrams(docContents); } else if (tokenizationType.equals("Bi-Grams")) { token...
7
public void actionPerformed(ActionEvent e) { if(e.getSource() == frame.btnGetModels){ txtArea.append(" " + "\r\n"); txtArea.append("----- Getting native models ------------------" + "\r\n"); List<Uuid> objUUIDs = getAllUUIDs(); ArrayOfUUID arrayUUIDs = new ArrayOfUUID(); List<Uuid> listUUIDs = arr...
8
public String getNotes() { if(this.contactNotes==null) { return ""; }else{ return contactNotes; } }
1
public static Point2D coordinates(final Rectangle2D rectangle, final RectangleAnchor anchor) { Point2D result = new Point2D.Double(); if (anchor == RectangleAnchor.CENTER) { result.setLocation(rectangle.getCenterX(), rectangle.getCenterY()); } ...
9
public TranscriptSet(Genome genome) { transcripts = new HashSet<Transcript>(); transcriptsByChromo = new AutoHashMap<String, ArrayList<Transcript>>(new ArrayList<Transcript>()); for (Gene gene : genome.getGenes()) { if (gene.numChilds() > MAX_TRANSCRIPTS_PER_GENE) { System.err.println("Ignoring gene '" + ...
5
private void addChosenPlattform() { lblPlattformError.setVisible(false); DefaultListModel<Plattform> dlm = (DefaultListModel<Plattform>) listChosenPlattformar.getModel(); Plattform chosen = (Plattform) cbPlattformar.getSelectedItem(); boolean exists = false; // search if the same plattfo...
4
@Override public void onReceive(int clientId, String message) { System.out.println("Received message from client " + clientId + ": \"" + message + "\""); Message msg = Message.parse(message); switch(msg.getType()) { case ID_REQUEST: //TODO send id response, send spawn messages to client, send spawn messag...
2
public void doAction(){ //*** have to check if it is sorted ************************************************************ String[] oldShopList = GasDecisionProcess.getShopListCopy(); GasDecisionProcess.resetShopList(); //Set the ShopList to null if (userChoice == 1) { DPH...
2
public void valueChanged(ListSelectionEvent lse) { JList list = (JList) lse.getSource(); if (list == allAccounts) { if (!lse.getValueIsAdjusting() && allAccounts.getSelectedIndex() != -1 && project != null) { moveTo.setEnabled(true); } else { moveTo.setEnabled(false); } } else if (list == project...
7
public void load() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new org.xml.sax.ErrorHandler() { public void fatalError(SAXParseException e) thr...
6
public static QuestionPower decode(String str) throws DecodeException { QuestionPower res; if (str.substring(0,14).compareTo("#QuestionPower") == 0) { res = new QuestionPower(); int i = 14; if (str.charAt(i) == '<') { while (str.charAt(i) != '>') { ...
9
@Override public String execute() throws Exception { try { Random rand = new Random(); setConfcode(rand.nextInt()); if (pwd.equals(getConfirmpwd())) { TempUser tuser = new TempUser(getConfcode(), email, pwd, userEnum.NotRegistered.getUserType(), uname...
5
public static void load() { try { File f = new File("./Data/data/map_index"); byte[] buffer = new byte[(int) f.length()]; DataInputStream dis = new DataInputStream(new FileInputStream(f)); dis.readFully(buffer); dis.close(); ByteStream in = new ByteStream(buffer); int size = in.length() /...
7
private void maybeAddPassword(final CycFort cyclist, final CycDenotationalTerm applicationTerm, final StringBuilder stringBuilder) { if (cyclist instanceof CycConstant) { final PasswordManager passwordManager = new PasswordManager(this); try { if (passwordManager.isPasswordRequired()) ...
4
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(name); if (options.size() == 0) { sb.append("\t").append(description); } else { int maxLen = 0; for (CommandOption option : options) { if (!"".equals(option.getName()) && option.getName().length() > maxLen) maxLen = option...
6
public void setCurrentPoint(int current){ currentPoint.setText(Integer.toString(current)); }
0
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { Player player = (Player) sender; int X = player.getLocation().getBlockX(); int Y = player.getLocation().getBlockY();; int Z = player.getLocation().getBlockZ();; if(args.length >= 1){ //EASYレベル if(arg...
4
public void setPos2(int val){ if (val == 1){p2 = true;} else { p2 = false; }}
1
@EventHandler (priority = EventPriority.HIGH) public void onUpdateJoin(PlayerJoinEvent e) { Player p = e.getPlayer(); // They must have this permission to receieve any notification. if(!p.hasPermission("playerchat.mod")) return; if(!PlayerChat.update) return; Messenger.tell(p, PlayerChat.name + " is a...
2
public final void sendNotice(String target, String notice) { _outQueue.add("NOTICE " + target + " :" + notice); }
0
public void driver() { System.out.println("benz drive"); }
0
private void finishText() { if (currentText != null) { String strValue = currentText.toString(); if (currentTextObject != null) { if (DefaultXmlNames.ELEMENT_Unicode.equals(insideElement)) { currentTextObject.setText(strValue); } else if (DefaultXmlNames.ELEMENT_PlainText.equals(insideElem...
9
public void jvnLockRead() throws JvnException { boolean ask = false; synchronized(this){ System.out.println("lock read Etat courant :"+STATE+" sur l'objet "+joi+" "+System.currentTimeMillis()); if(STATE != STATE_ENUM.RC && STATE != STATE_ENUM.WC){ ask = true; } } if(ask){ obj = JvnServerImp...
6
@Override public Color getPixel() { int random = r.nextInt(3); if (random == 0) { return new Color(r.nextInt(256), 0, 0); } else if (random == 1) { return new Color(0, r.nextInt(256), 0); } else { return new Color(0, 0, r.nextInt(256)); } }
2
public void loadRocketSprites(){ rocketSprites = new ArrayList(); ArrayList anims = new ArrayList(); for(int i = 0; i < rocketImages.size(); i++){ Animation a = new Animation(); for(int j = 0; j < rocketImages.get(i).size(); j++){ a.addFrame((Image) rocketImages.get(i).get(j), 200); ...
3
private void updateAllRQ() { int c = movie.getCapacity(); for (int i = 0; i < numberOfAtoms; i++) { try { atom[i].updateRQ(); } catch (Exception e) { atom[i].initializeRQ(c); atom[i].updateRQ(); } } if (obstacles != null && !obstacles.isEmpty()) { RectangularObstacle obs = null; synch...
7
public void init() throws IOException { ServerSocketChannel channel = ServerSocketChannel.open(); channel.bind(new InetSocketAddress(host, port)); channel.configureBlocking(false); System.out.println("Server Launched!"); //Creates a selector that will be used for multiplexing //Registers the Server...
9
* @param arguments * @return boolean */ public static boolean applyBooleanMethod(java.lang.reflect.Method code, Cons arguments) { switch (arguments.length()) { case 0: throw ((StellaException)(StellaException.newStellaException("Can't call method code on 0 arguments.").fillInStackTrace())); ...
6
public static void trackAdd(String tag) { if(trackedTags.containsKey(tag) && trackedTags.get(tag)) { System.out.println("[Debugger] Tag " + tag + " is being tracked already."); } else { trackedTags.put(tag, true); System.out.println("[Debugger] Now tracking " + tag); } }
2
protected void saveNBT(NBTTagCompound data) { NBTTagList list = new NBTTagList(); for (WorldCoordinate c : pairings) { NBTTagCompound tag = new NBTTagCompound(); tag.setIntArray("coords", new int[]{c.dimension, c.x, c.y, c.z}); list.appendTag(tag); } d...
2
public void drawPlane() { if(!init) { init = true; centerX = getWidth() / 2; centerY = getHeight() / 2; } int width = getWidth(); int height = getHeight(); for(int i = centerX % pixelUnit; i < width; i += pixelUn...
7
public void equip(Equipment newItem) { if(newItem.getPosition() == Equipment.Position.OffHand) { Equipment mainHand = getEquipment(Equipment.Position.MainHand); if(mainHand != null && mainHand instanceof Weapon && ((Weapon)mainHand).isTwoHanded()) _equipment.r...
8
public void search(String name) { DefaultMutableTreeNode root = (DefaultMutableTreeNode) treeThreats.getModel().getRoot(); Enumeration<?> children = root.children(); while (children.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement(); if (child.getUse...
3
@Test public void testValue() { System.out.println("value"); Equals<Double> instance = this._instance; for (int i = 0; i < this._values.length; i++) for (int j = 0; j < this._values.length; j++) { boolean expResult = true; for (Equals<Double> e : t...
5
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page = ConfigurationManager.getProperty("path.page.edittourist"); try { resaveParamsSaveOrder(request); Criteria criteria = new Criteria(); Order order = (Order) r...
4
public boolean sendRMessages() throws PostServiceNotSetException{ //System.out.println("Sono nella sendR"); if (this.postservice == null){ throw new PostServiceNotSetException(); } boolean atLeastOneUpdated = false; switch (Athena.shuffleMessage){ case ...
9
public static void main(String[] args) throws Exception{ ArrayList<File> files = FileFinder.GetAllFiles("/home/lizhou/Desktop/nursing", "", true); for(File f: files){ String name = f.getName(); @SuppressWarnings("resource") PrintStream ps = new PrintStream(new FileOutputStream("/home/lizhou/Desktop/nursing...
4
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 ...
8
public void twittThisInBehalf(String twitterMessage) { try { Twitter twitter = new TwitterFactory().getInstance(); try { // get request token. // this will throw IllegalStateException if access token is already available RequestToken reques...
8
@Override public HandshakeState acceptHandshakeAsServer( ClientHandshake handshakedata ) { if( handshakedata.getFieldValue( "Upgrade" ).equals( "WebSocket" ) && handshakedata.getFieldValue( "Connection" ).contains( "Upgrade" ) && handshakedata.getFieldValue( "Sec-WebSocket-Key1" ).length() > 0 && !handshakedata.getF...
5
private final void method641() { synchronized (this) { for (int i = 0; i < anInt5387; i++) { int i_302_ = anIntArray5312[i]; anIntArray5312[i] = anIntArray5356[i]; anIntArray5356[i] = -i_302_; if (aClass360Array5360[i] != null) { i_302_ = ((Class360) aClass360Array5360[i]).anInt4427; ((Class36...
6
protected void addItem() { Item item = null; CatItems sel = (CatItems) jCbItemType.getSelectedItem(); switch (sel) { case GOODS: String gDescr = jTextGoodsDescr.getText(); double gPrice = Double.valueOf(jTextGoodsPrice.getText()); int g...
7
public void testMinus_Minutes() { Minutes test2 = Minutes.minutes(2); Minutes test3 = Minutes.minutes(3); Minutes result = test2.minus(test3); assertEquals(2, test2.getMinutes()); assertEquals(3, test3.getMinutes()); assertEquals(-1, result.getMinutes()); ...
1
public void fall() { point.setLocation(location); point.translate(0, -1); if (assertLegal(pane, block, point, block, location)) { free(); location.translate(0, -1); draw(); } else { sink(); } }
1
private boolean crossingInternal(Point2D.Double direction1, Point2D.Double direction2) { if (angles.size() < 2) { return false; } final double angle1 = convertAngle(getAngle(new Line2D.Double(center, direction1))); final double angle2 = convertAngle(getAngle(new Line2D.Double(center, direction2))); Double...
9
public void deleteFolder(String bucket, List<String> listFolders) throws Exception{ ListObjectsRequest listObjectsRequest; ObjectListing objectListing; for(String folderItem : listFolders){ if(!folderItem.trim().equalsIgnoreCase("/") && !folderItem.isEmpty()){ try { ...
8
public void setColor() { int truthState = getTruthState(); if(truthState==-1) { stateColor = Color.RED; } if(truthState==0) { stateColor = Color.YELLOW; } if(truthState==1) { stateColor = Color.GREEN; ...
3
public final synchronized float readFloat(){ this.inputType = true; String word=""; float ff=0.0F; if(!this.testFullLineT) this.enterLine(); word = nextWord(); if(!eof)ff = Float.parseFloat(word.trim()); re...
2
@Override public Serializable callMethod(String methodName, ArrayList<Object> params){ Object resu = null; if(methodName.equals("deposit")){ try { deposit((String) params.get(0), (double) params.get(1)); } catch (InvalidParamException e) { // TODO Auto-generated catch block e.printStackTrace(); ...
6
public boolean Equals(Move move){ return (this.initialRow == move.initialRow && this.initialCol == move.initialCol && this.finalRow == move.finalRow && this.finalCol == move.finalCol)?true:false; }
4
public void setCashOffice(CashOffice cashOffice) { this.cashOffice = cashOffice; if ( !cashOffice.exists(this)) { cashOffice.addTicket(this); } }
1
private void loadTexture(String pTextureUrl) { if(pTextureUrl != null) { Path texture = FileSystems.getDefault().getPath(pTextureUrl); if(texture.toFile().exists()) { try { skyTexture = TextureIO.newTexture(texture.toFile(), true); ...
3
public Game() { super("Checkers"); setSize(WIDTH, HEIGHT); setLocationRelativeTo(null); //lo centra nello schermo this.board = new Board(); this.black=new Cpu(Board.BLACK, board); setLayout(new GridLayout(8,8)); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowLis...
0
@Override public Success<SourceFile> parse(String s, int p) { p = optWS(s, p); // Parse the module keyword. Success<String> resModule = IdentifierParser.singleton.parse(s, p); if (resModule == null || !resModule.value.equals("module")) throw new NiftyException("Missing m...
8
public Double[] maximizeMod(Double[] max, int[] numberOfValues, NodeVariable x, int xIndex, FunctionEvaluator fe, HashMap<NodeVariable, MessageQ> modifierTable){ if(debug>=3){ System.out.print("Oplus_MaxSum.maximizeMod: modifier table size="+modifierTable.size()); if (modifierTable.size...
6
@Override public void actionPerformed(ActionEvent e) { exportOutlinerDocument((OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(), getProtocol()); }
0
public void disableAllBut(JButton[] b){ JButton allButton[] = {createMatrix, selectMatrix, deleteMatrix, helpButton, transposeButton, detButton, rowRedButton, inverseButton}; for(int i = 0; i<allButton.length; i++){ boolean disable = true; for(int j = 0; j<b.length; j++){ if(b[j] == allButton[i]) dis...
4
private void appointmentManager(){ System.out.println("=========Appointment manager========="); System.out.println("0: Back to main menu"); System.out.println("1: Show my appointments weekwise"); System.out.println("2: Show my appointments this week/month"); System.out.println("3: Make an appointment"); Sys...
9
private void initListeners() { PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.addDocumentChangedListener(new DocumentChangedListener() { @Override public void documentChanged(DocumentChangedEvent dce) { document = dce.getDocument(); SwingUtilities.invokeLater(new Runnable() {...
9
public boolean EliminarPlaga(Plaga p){ if (p!=null) { cx.Eliminar(p); return true; }else { return false; } }
1
public static void main(String[] args) { int[] summable = new int[28124]; // 0 will not be used ArrayList<Integer> abundantnums = new ArrayList<>(); for (int i = 1; i <= 28123; i++) { if (p21amicable.calcDivisors(i) > i) { // System.out.println(i + " is abundant."); ...
7
public void setLoglevel(LOGLEVEL loglevel) { if(loglevel == LOGLEVEL.Nothing) { logLevel = -1; } else if(loglevel == LOGLEVEL.Error) { logLevel = 0; } else if(loglevel == LOGLEVEL.Normal) { logLevel = 1; } else if(loglevel == LOGLEVEL.Debug) { logLevel = 2; } else { ...
4
public static void blockUntilProcessEnd(Process process, int timeOut) { int maxCount = timeOut * 5; for (int i = 0; i < maxCount && checkProcessEnd(process); i++) { try { Thread.sleep(200); } catch (InterruptedException e) { logger.error(e); ...
3
public boolean sameBearingAsNearFriend(double[] position, double bearing) { for (double[] agentVals : agentInfo.values()) { double normal = Math.abs(agentVals[2] - bearing); if (normal >= 345 || normal <= 10) { //Similar heading, check proximity. if (agent...
5
public void visitArithExpr(final ArithExpr expr) { if (previous == expr.left()) { previous = expr; expr.parent.visit(this); } else if (previous == expr.right()) { check(expr.left()); } }
2
public boolean isNearlyTridiagonal(double tolerance){ boolean test = true; for(int i=0; i<this.numberOfRows; i++){ for(int j=0; j<this.numberOfColumns; j++){ if(i<(j+1) && Math.abs(this.matrix[i][j])>Math.abs(tolerance))test = false; if(j>(i+1) && Math.ab...
6
public void toFtanML(Writer writer) { try { writer.append("["); Iterator<FtanValue> iterator=values.iterator(); if(iterator.hasNext()) { iterator.next().toFtanML(writer); while(iterator.hasNext()) { writer.append(","); iterator.next().toFtanML(writer); } } writer.append("]"); ...
3
public ArrayList<TreeRow> getSelectedRows() { ArrayList<TreeRow> selection = new ArrayList<>(); if (!mSelectedRows.isEmpty()) { for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) { if (mSelectedRows.contains(row) && !isAncestorSelected(row)) { selection.add(row); } } } ret...
4
public boolean checkArc(Arc paArc, Graph graph) { Element p1 = paArc.getOutElement(); Element p2 = paArc.getInElement(); // Petri Net - Place / Transition if (graph instanceof PetriNet) { if (((p1 instanceof AbsPlace) && (p2 instanceof Transition)) | ((p2 instanceof AbsPlace...
8
public boolean save(File file) { checkPaths(); file.getParentFile().mkdirs(); if (!file.exists()) { try { file.createNewFile(); } catch (IOException ex) { Debug.p("Deck file could not be created: " + file + ": " + ex...
4
*/ public InferenceParameters getHLQueryProperties() { synchronized (defaultQueryProperties) { if (!queryPropertiesInitialized) { initializeQueryProperties(); } return (InferenceParameters) defaultQueryProperties.clone(); } }
1
public void setDiscount(float discount) { this.discount = discount; }
0
public ISocketServerConnection getClientConnection() { return clientConnection; }
0
protected static boolean removeProtection(Path file) { assert FileUtil.control(file); boolean ret = false; String cmdTmp = SAVEACL_CMD_1 + file.toString() + SAVEACL_CMD_2 + acl + file.getFileName().toString().replaceAll("\\.", "") + SAVEACL_CMD_3; cmdTmp += AND + TAKEOWN...
1
@Override public void keyPressed(KeyEvent e) { if(e.getKeyCode() == KeyEvent.VK_W) upPressed = true; if(e.getKeyCode() == KeyEvent.VK_S) downPressed = true; if(e.getKeyCode() == KeyEvent.VK_A) leftPressed = true; if(e.getKeyCode() == KeyEvent.VK_D) rightPressed = true; if(e.getKeyCode() == KeyEvent.VK_1) one...
9
public Object getValue(Object obj,String propName) { Object val = null; PropInfo propInfo = propInfoByPropName.get(propName); if (propInfo != null){ Method readMethod = propInfo.getReadMethod(); if (readMethod == null){ throw new RuntimeException(format("propName %s does not not have readMethod",propNam...
3
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @SuppressWarnings("unchecked") Map<Integer,Integer> mandje = (Map<Integer,Integer>)request.getSession().getAttribute(MANDJE); int nummer = 0; try { nummer = Integer.parseInt(request.getParame...
4
@Test public void testCheckCbolOriginalDir() { new DirCbol().checkCbolOriginalDir(); new DirCbol().checkCbolOriginalDirV2(); new DirCbol().checkCbolOriginalDirV3(); new DirCbol().checkCbolOriginalDirV4(); }
0
@SuppressWarnings("unchecked") public List<Product> retrieveAllProducts() { return em.createNamedQuery("findAllProducts").getResultList(); }
0
public JSONArray optJSONArray(int index) { Object o = this.opt(index); return o instanceof JSONArray ? (JSONArray)o : null; }
1
private int deleteFileFromStorage(String fileName, boolean deleteMaster, boolean justTest) { Storage tempStorage = null; File tempFile = null; int msg = DataGridTags.FILE_DELETE_ERROR; for (int i = 0; i < storageList_.size(); i++) { tempStorage = (Storage) storag...
7
public static void main(String[] argsv) { // Setting op a bank. Bank christmasBank = new Bank(); christmasBank.addAccount(new BankAccount(BigInteger.valueOf(100))); christmasBank.addAccount(new BankAccount(BigInteger.valueOf(50), BigInteger.valueOf(-1000))); // Award a bonus to...
2
@Test public void testCheckValidForTournament() throws Exception { System.out.println("checkValidForTournament"); World instance = new World(); instance.readInWorld("2.world"); boolean expResult = true; boolean result = instance.checkValidForTournament(); assertEquals...
0
protected synchronized boolean isFullLine(int yCoordinate) { boolean isFullLine = true; int minX = lowerLimit.getX(); int maxX = upperLimit.getX(); for (int currentX = minX; currentX<=maxX; currentX++) { Point point = new Point(currentX, yCoordinate); if (isInGridRange(point)) { ...
3
public void alustaPeliLauta() { x = 30; y = 600; s = 300; r = 600; p = 30; q = 30; winCondition = 0; arvausMaara = 0; vari = -1; rivi = 0; sarake = 0; vinkkiRivi = 0; oikeaKoodi = new kuvio[4]; for (int i = 0...
5
@Override public void actionPerformed(ActionEvent e) { if(e.getSource().equals(finish)){ ansname = name.getText(); anstype = type.getText(); ansx = xsize.getText(); ansy = ysize.getText(); if(tset == null){ tset = new TileSet(); ...
4
public static String getTextBetweenNestedDelims( String originalText, String beginDelim, String endDelim ) { StringBuffer sb = new StringBuffer( originalText.length() ); // Check to see that both delimiters exist in the string if( (originalText.indexOf( beginDelim ) < 0) || (originalText.lastIndexOf( endDelim ) ...
7
public void createSong(BESong aSong) throws Exception { try { ds.createSong(aSong); m_songs.add(aSong); } catch (SQLException ex) { throw new Exception("Could not create the song " + aSong.getTitle()); } }
1
public void drawShapedSprite(int height, int arg1, int dest[], int arg3, int src[], int arg5, int arg6, int arg7, int width, int arg9) { try { int j2 = -width / 2; int k2 = -height / 2; int sineStep = (int) (Math.sin(arg1 / 326.11000000000001D) * 65536D); int cosStep = (int) (Math.cos(arg1 / 326.110000000...
3
@SuppressWarnings("deprecation") public static void main(String[] args) { HashMap<String, ArrayList<Integer>> finalMap = new HashMap<String, ArrayList<Integer>>(); HashMap<String, HashMap<Integer,Integer>> dayCountForStnMap = new HashMap<String, HashMap<Integer,Integer>>(); HashMap<Integer, String> stationIdName...
9
public String getEntryText(int pos) { int current = 0; for (Widget i = wdg().child; i != null; i = i.next) { if (i instanceof TextEntry) { current++; if (current == pos) { TextEntry te = (TextEntry) i; return te.text; } } } return ""; }
3
public static void saveFile(INIFile file, String path){ FileUtility.createFile(path); ArrayList<String> contents = new ArrayList<String>(); for(INISection section : file.getSections()){ String sectionOutput = "[" + section.getName() + "]"; contents.add(sectionOutput);...
2
public boolean equals( Object o) { if (o == null || !(o instanceof ASN1Sequence)) { return false; } ASN1Sequence other = (ASN1Sequence)o; if (this.size() != other.size()) { return false; } Enumeration s1 = this.get...
5