text
stringlengths
14
410k
label
int32
0
9
@Override public void salvar(Cliente cliente) { try { conn = ConnectionFactory.getConnection(); String sql = "INSERT INTO cliente (id, nome, cpf) " + "VALUES ((SELECT NVL(MAX(id),0)+1 FROM cliente), ?, ?)"; ps = conn.prepareStatement(sql); ...
2
@Override public void run() { String recieve; while (running) { boolean isSended = this.clientVerbindung.send("INFO"); if (!isSended) { this.close(); continue; } recieve = this.clientVerbindung.recieve(); if ...
8
public Location getAdjacentLocation(int direction) { // reduce mod 360 and round to closest multiple of 45 int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE; if (adjustedDirection < 0) adjustedDirection += FULL_CIRCLE; adjustedDirection = (adjustedDirect...
9
@SuppressWarnings("unchecked") @Override public boolean put(final String key, final Object data, final String... indexes) throws DataException, InvalidKeyException, DataClassException { if (key == null) { throw new InvalidKeyException("Null is not a valid key."); } ...
7
private void parseReference(Component parentNode, String sectionName, int level) throws TemplateException { try { // look for section XPath xPath = XPathFactory.newInstance().newXPath(); NodeList nodeList = (NodeList) xPath.evaluate("/grammar/define[@name='" + sectionName + "']", template.getXml(), XPathCons...
3
public void run() { while (true) { repaint(); JokemonDriver.manageTime(); frames++; framerateManager(); try { Thread.sleep(slp); } catch(Exception ignored){} } }
2
public boolean chargeForCity() { if (! resForCity()) return false; for (int i = 0; i < BRICK_CITY; i++) _hand.remove(Resource.Brick); for (int i = 0; i < ORE_CITY; i++) _hand.remove(Resource.Ore); for (int i = 0; i < SHEEP_CITY; i++) _hand.remove(Resource.Sheep); for (int i = 0; i < TIMBER_CITY; i++) _hand.re...
6
@Override public String toString() { StringBuilder albumString = new StringBuilder(); Iterator<String> it = keywords.iterator(); Iterator<String> bandIterator = bandMembers.iterator(); albumString.append("-Music Album- \n").append("band: ").append(bandName).append('\n'); ...
4
public static final long mul(long x, long y) { long moflo = (1L<<31); // multiply without overflow if operands < moflo if (x >= 0 && x < moflo && y >= 0 && y < moflo) return (x * y) % p; long res = 0; while (x != 0) { if ((x & 1) == 1) res = (res + y) % p; ...
6
private static int method524(char ac[]) { if(ac.length > 6) return 0; int k = 0; for(int l = 0; l < ac.length; l++) { char c = ac[ac.length - l - 1]; if(c >= 'a' && c <= 'z') k = k * 38 + ((c - 97) + 1); else if(c == '\'') k = k * 38 + 27; else if(c >= '0' && c <= '9') k = k * ...
8
public static List<String> unban(String playerName) { Connection con = DatabaseConnection.getConnection(); PreparedStatement ps; int done = 0; int accountid = 0; List<String> ret = new LinkedList<String>(); try { ps = con.prepareStatement("SELECT accountid FRO...
8
public static String checkLevels(double level) { String message = ""; if (level < 0.0) { message = " below acceptable range."; } if (level > 1.0) { message = " above acceptable range."; } return message; }
2
public XMLNode(String XMLText) { // Figure out where the next tag begins and ends: int lBracket = XMLText.indexOf("<"); int rBracket = XMLText.indexOf(">"); // If we reached the end of the file, we are done: if (lBracket == -1 || rBracket == -1) return; // Sanity check: Is this really XML we're looking...
6
public void onComplete(){ updateButton.setEnabled(true); delMinecraft.setEnabled(true); serverBox.setEnabled(true); txtrn.setText("готово"); }
0
@Override public InputStream openInputStream() throws IOException { if (outputStream != null) { return new ByteArrayInputStream(outputStream.toByteArray()); } else { return new ByteArrayInputStream(new byte[0]); } }
1
private void getfields() { fcount = 0; for(int k=0;;) { k+=32; try { fdbf.seek(k); } catch (IOException e) {} String fn = readChars(0,1); if(fn.charAt(0)==0xd) break; fn+=readChars(0,10); field y = new field(); y.fname = fn.replace((char)0,' ').trim(); char f = readChars(0,1).charAt(0); y.ftype =...
9
@Override protected Integer doInBackground() throws Exception { while(true){ jLabel1.setText(ChatBox.receiverStatus); if (jLabel1.getText().equals("DAFUQ")) { break; } } return 666; }
2
@Test public void passed() { for(int i=1;i<10;i++){ TestResult result = tester.test(StringGenerator.genString(i), 0,i); if(!result.passed){ System.err.println(result.message); } Assert.assertTrue(result.passed); } }
2
public static Class<?> getReturnGenericType(Method method) { Type genericType = method.getGenericReturnType(); Class<?>[] classes = getActualClass(genericType); if (classes.length == 0) { return null; } else { return classes[0]; } }
3
static boolean isAllowed(final CommandSender sender, final String permission, final String targetName) { // Always allowed for self if (sender.getName().equalsIgnoreCase(targetName)) return true; // Check if sender is allowed for all players if (sender.hasPermission(permission + ".playe...
3
public void setCurconnected(int curconnected) { this.curconnected = curconnected; }
0
private void unzip(String file) { final File fSourceZip = new File(file); try { final String zipPath = file.substring(0, file.length() - 4); ZipFile zipFile = new ZipFile(fSourceZip); Enumeration<? extends ZipEntry> e = zipFile.entries(); while (e.hasMoreElements()) { ZipEntry entry = e.nextElement(...
7
protected synchronized boolean insertPacketIntoQueue(Packet pnp) { int srcID = pnp.getSrcID(); // source entity id int destID = pnp.getDestID(); // destination entity id int type = pnp.getNetServiceType(); // packet service type Double nextTime = (Double) flowTable.get("" ...
3
public void configure(Binder binder) { // Singleton Implementations binder.bind(ValidatorJNotifyListener.class).asEagerSingleton(); binder.bind(Watchers.class).asEagerSingleton(); binder.bind(JNotifier.class).asEagerSingleton(); binder.bind(XmlManager.class).asEagerSingleton(); // Interface Implementations...
0
private void checkRobots(){ MyRobot tempMyRobot = null; synchronized(robots){ for(MyRobot r:robots){ if (r.robotState == RobotState.idle && !r.broken){ tempMyRobot = r; break; } } } if (tempMyRobot == null || (glassProcessing != 0)){ if (popUpStatus ==...
9
public boolean utrFromCds(boolean verbose) { if (cdss.size() <= 0) return false; // Cannot do this if we don't have CDS information // All exons minus all UTRs and CDS should give us the missing UTRs Markers exons = new Markers(); Markers minus = new Markers(); // Add all exons for (Exon e : this) exon...
5
public void reserveOneWayTicket() { try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.out.println("Where is your MySQL JDBC Driver?"); e.printStackTrace(); } PreparedStatement ps = null; Connection con =...
6
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component returnValue = null; if ((value != null) && (value instanceof DefaultMutableTreeNode)) { Object userObject = ((DefaultMutableTreeNode...
7
@Override public List<String> callUserServices(String username) { List<String> services = null; System.out.println("[WSClient][callUserServices] Username is "+username); try { Service service = new Service(); Call call = (Call)service.createCall(); QName string = new QName("http://echo.demo.oracle/"...
2
public static void menuRemoveVisit(HousePetList hpArray) { int userChipID = 0; HousePet tempHousePet = new HousePet(); /* new HP created with default chipID */ @SuppressWarnings("resource") Scanner console = new Scanner(System.in); boolean containsHousePet = false; St...
5
public void visitLocalVariable( final String name, final String desc, final String signature, final Label start, final Label end, final int index) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute("", "name", "name", "", name); ...
1
public static void unwrap(Message message, CoreMessageListener coreMessageListener) { if (!(message instanceof ObjectMessage)) return; Object messagePayload = null; try { messagePayload = ((ObjectMessage) message).getObject(); } catch (JMSException e) { e.printStackTrace(); } if (!(messagePayl...
5
public void setPeuplesPris(List<Class<? extends Peuple>> peuplesPris) { this.peuplesPris = peuplesPris; }
1
public GUIManager(PermWriter project) { this.project = project; }
0
public void doCSVPerformanceTest() { try { final String mapping = ConsoleMenu.getString("CSV File ", "SampleCSV.csv"); final boolean data = ConsoleMenu.getBoolean("Traverse the entire parsed file", true); final boolean verbose = ConsoleMenu.getBoolean("Verbose", false); ...
1
static final void method1301(r var_r, int i, int i_0_, int i_1_, boolean[] bools) { if (aa_Sub1.aSArray5191 != Class332.aSArray4142) { int i_2_ = Class348_Sub1_Sub1.aSArray8801[i].method3986(i_0_, i_1_, (byte) -93); for (int i_3_ = 0; i_3_ <= i; i_3_++) { if (bools == null || bools[i_3...
5
@SuppressWarnings("unchecked") private void listen() throws InterruptedException { WatchKey watchKey = watcher.poll(5L, TimeUnit.SECONDS); if (stop || watchKey == null) { return; } for (WatchEvent<?> event : watchKey.pollEvents()) { if (stop || event.kind() == OVERFLOW) { continue; } ...
9
@Override public Boolean getBooleanProp(String key, Boolean value){ Boolean result = value; String propValue = getProperty(key); if (null != propValue){ result = new Boolean(propValue); } return result; }
1
public static void handle ( String input, JTextPane console ) { GUI.commandHistory.add ( input ) ; GUI.commandHistoryLocation = GUI.commandHistory.size ( ) ; GUI.write ( "Processing... [ " + console.getText ( ).replaceAll ( "\r", "" ).replaceAll ( "\n", "" ) + " ]" ) ; console.setText (...
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Node<?> other = (Node<?>) obj; if (data == null) { if (other.data != null) return false; } else if (!data.equals(other.data)...
8
public CheckResultMessage check10(int day) { int r = get(27, 5); int c = get(28, 5); BigDecimal b = new BigDecimal(0); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); b = getValue(r + 3 + day, c, 6).add( getValue(r + 3 + day, ...
5
public void eliminarGrafico( Figura figura ){ if ( figura!=null ){ if ( figura instanceof ClaseGrafica ){ Figura graf ; if ( listaFigura!=null ){ LinkedList<Figura> listaEliminar = new LinkedList<Figura>(); for (int i=0; i<lista...
8
private String map(int depth50m, int depth10m, int depth1m) throws NodeMeaningKeyErrorException { if (depth50m < min50m || depth50m > max50m) { throw new NodeMeaningKeyErrorException(); } if (depth10m < min10m || depth10m > max10m) { throw new NodeMeaningKeyEr...
6
public int GetAveragePersonsWaitTime() { return averagePersonsWaitTime; }
0
public synchronized boolean frameCorrection() { // Copy frame information form CDSs to Exons (if missing) frameFromCds(); // First exon is corrected by adding a fake 5'UTR boolean changedFirst = frameCorrectionFirstCodingExon(); // Other exons are corrected by changing the start (or end) coordinates. // b...
2
public void add( ChunkState state ) { if ( !containsState(state) ) { if ( states == null ) states = new ChunkState[1]; else if ( containsState(ChunkState.none) ) { for ( int i=0;i<states.length;i++ ) { if ( states[i] == ChunkState.none ) { states[i] = state; break; }...
6
public String getChannel(){ return Channel; }
0
public void processOrder(OrderTransaction orderTransaction) throws PointOfSaleSystemException { orderTransaction.setCashier(cashier); Transaction transaction = daoFactory.createTransaction(orderTransactionManager, inventoryDAO, creditManager, feeDAO); try { transaction.start(); ...
7
public int getPriority() { switch (getOperatorIndex()) { case 26: case 27: return 500; case 28: case 29: case 30: case 31: return 550; } throw new RuntimeException("Illegal operator"); }
6
@Override public int getType() { return BuildingType.CITYHALL.ordinal(); }
0
@Override public boolean accept(File f) { String extension = this.getExtension(f); if (extension.equals("txt") || f.isDirectory()) { //Accept only txt files or directories (to allow navigation) return true; } return false; }
2
private boolean criteriaCheck3( String field, Ptg[] curRow, DB db ) { boolean critRowMatch = false; // for each value check all the criteria in a row // multiple rows of criteria are combined for( int x = 0; x < rows.length; x++ ) { critRowMatch = true; // reset // for each row of criteria, iterate cr...
6
@Override public void restoreLimb(String gone) { if (affected != null) { if (affected instanceof MOB) { ((MOB)affected).location().show(((MOB)affected), null, CMMsg.MSG_OK_VISUAL, L("^G<S-YOUPOSS> @x1 miraculously regrows!!^?",gone)); } else if ((affected instanceof DeadBody) && (((Item)affe...
7
@Override public PropertyFilterChain removePropertyFilterChain(String key, int index) { return (PropertyFilterChain) filter_chains.remove(key); }
0
private void registerUser(HttpServletRequest request, HttpServletResponse response) { String key = request.getParameter(CommunityConstants.BASE64_PUBLIC_KEY); String nick = request.getParameter(CommunityConstants.NICKNAME); String remote_ip = request.getRemoteAddr(); String username = request.getRemoteUser()...
8
private static boolean getDeleteDecisionFromConsole() throws CancelOperationException { boolean validInput; char[] result = null; do { validInput = true; System.out.print("Delete the message after retrieving it [Y/N]? "); try { String input = in.nextLine().trim(); System...
7
public HomePage getHomePage() { if (homePage == null) { homePage = new HomePage(this); } return homePage; }
1
@Override public String toString() { return this.getID() + ""; }
0
private ByteBuffer convertImageData(BufferedImage bufferedImage, Texture texture) { ByteBuffer imageBuffer; WritableRaster raster; BufferedImage texImage; int texWidth = 2; int texHeight = 2; // find the closest power of 2 for the width and height // of the produced texture while (texWidth < buffer...
3
private void handleQuery(int userLevel, String[] keywords) { if (isAccountTypeOf(userLevel, ADMIN, MODERATOR, REGISTERED)) { if (keywords.length == 2) { String[] ipFragment = keywords[1].split(":"); if (ipFragment.length == 2) { if (ipFragment[0].length() > 0 && ipFragment[1].length() > 0 && Functions...
9
private void initButtons(){ JButton buttonCancel = new JButton("Cancel"); buttonCancel.setBounds(getWidth() - 135, getHeight() - 65 , Main.buttonSize.width, Main.buttonSize.height); buttonCancel.addMouseListener(new MouseAdapter() { @Override public void m...
0
public int getStartNodeId(){ Iterator<Node> _iter = this._nodes.values().iterator(); while(_iter.hasNext()){ Node _node = _iter.next(); if(_node.isStartpoint()){ return _node.getId(); } } return -1; }
2
public boolean _setSprite(Sprite sprite) { if(sprite != null) { this.sprite = sprite; return true; } else { return false; } }
1
public void setG(int g) { this.g = g; }
0
private void searchLevelExact(ResultSet resultSet, double[] query, Node node, double mindist, float epsError) { // If this is a leaf node. if (node.child1 == null && node.child2 == null) { int index = node.cutDimension; double dist = metric.distance(node.point, query); resultSet.addPoint(dist, index); ...
5
public static void main(String [] args){ if (args.length!=2){ args = new String[2]; args[0] = "localhost"; args[1] = "9000"; } String arg1 = args[1]; final String[] args2 = new String[1]; args2[0] = arg1; final String[] args2final = args2; final String[] argsfinal = args; new Thread(){ publi...
1
public void save(){ int i=0; synchronized(options){ options.clear(); synchronized (timers){ for (Timer timer : timers){ options.setProperty("Timer"+i, String.format("%d,%d",timer.getStart(), timer.getTime())); options.setProperty("Timer"+i+"Name", timer.getName()); i++; } } t...
3
public static boolean isThis(Expression thisExpr, ClassInfo clazz) { return ((thisExpr instanceof ThisOperator) && (((ThisOperator) thisExpr) .getClassInfo() == clazz)); }
1
@Override public void mouseClicked(MouseEvent e) { int mouse = e.getButton(); Rectangle rect = new Rectangle(e.getX(), e.getY(), 1, 1); pressed = true; if(mouse == MouseEvent.BUTTON1) { switch(Game.state) { case GAME: break; case MENU: if(rect.intersects(Game.getInstance().getMenu().play)) ...
7
protected void execute() { double time = _timer.get(); if (time >= _period){ Color c = colors[_rand.nextInt(colors.length)]; Robot.ledStrip.setColor(c.getRed(),c.getBlue(),c.getGreen()); _timer.reset(); } }
1
private ListNode findMover( ListNode head ) { ListNode p1 = head; // move 1 step each step ListNode p2 = head; // move 2 steps each step while ( p2 != null && p2.next != null ) { p1 = p1.next; p2 = p2.next.next; } // 1...
2
public int getUniqueWindowID(){ int id = 0; boolean unique = false; while (!unique){ unique = true; for (int x = 0; x < windowslist.size(); x++){ if (id == windowslist.get(x).getID()){ unique = false; id++; } } } return id; }
3
public void createOpdracht() { try { String vraag = opdrCreatieView.getVraagT().getText(); String antwoord = opdrCreatieView.getAntwoordT().getText(); int maxAantalPogingen = Integer.valueOf((String) opdrCreatieView .getMaxAantalPogingenC().getSelectedItem()); String antwoordHint = opdrCreatieView.ge...
4
@EventHandler public void ZombieHarm(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.getZombieConfig().getDouble("Zombie.Harm.Dodge...
6
AIMove onTestHockeyistFriction(AIHockeyist hockeyist) { AIManager manager = AIManager.getInstance(); AIRectangle rink = manager.getRink(); AIPoint center = manager.getCenter(); AIMove move = new AIMove(); if (!visitedOrigin) { double d = hockeyist.angleTo(rink.origin...
7
public static void test2(int a, int aa, int bb, String op, boolean carry) { String op2 = "("+Integer.toHexString(aa)+" "+op+" "+Integer.toHexString(bb)+") "; a &= 0xFF; // if(a == 0) // return; if(a == aa) return; for(int j=0;j<A.length; j++) { int b = A[j]; test(a+b,a,b,op2+"add",aa); if(carry) ...
4
public final void execute() { boolean start = false; try { start = valid(); } catch (Exception e) { Logger.getLogger("CONCURRENT-VALIDATION").severe(e.getMessage()); e.printStackTrace(); } catch (ThreadDeath td) { Logger.getLogger("CONCURRENT-VALIDATION").severe(td.getMessage()); td.printStackTra...
9
@Override public StateBuffer executeInternal(StateBuffer sb, int minValue) { sb = new UnboundedSegment(new TextSegment(Move.A,false)).execute(sb); // player mon uses attack sb = new CheckMetricSegment(new CheckMoveDamage(isCrit, effectMiss, numEndTexts == 0, false, !player, ignoreDamage, thrashAdditionalTurns),GRE...
4
@Override public boolean tick(Tickable ticking, int tickID) { if(!super.tick(ticking,tickID)) return false; if(tickID==Tickable.TICKID_MOB) { if(nextDirection==-999) return true; if((theTrail==null) ||(affected == null) ||(!(affected instanceof MOB))) return false; final MOB mob=(MOB...
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; JsonArray other = (JsonArray) obj; if (other.hasComments() ^ hasComments()) return false; if (value == null) { if (other.value != n...
9
public DFSTree(Set<Node> nodeList) { removables = new HashSet<Node>(); if (nodeList.isEmpty()) { root = null; return; } nodeMap = new HashMap<Node, DFSNode>(); int labelCount = 0; Set<Node> visitedNodes = new HashSet<Node>(); Node n = nod...
7
private void seekString(StringBuilder strBuilder) { char ch = 0; boolean isEscape = false; ch = jsonStr.charAt(index); if (ch != '"') { vali.disPass(index); } else { while (true) { index++; if (index >= length) { ...
8
public ArrayList<BESong> getAllByPlaylist(int searchWord) throws Exception { try { if (m_songs == null) { m_songs = ds.getAllByPlaylist(searchWord); } return m_songs; } catch (SQLException ex) { throw new Exception("Could not find all songs...
2
public boolean findStartPos(Level level) { while (true) { int x = random.nextInt(level.w); int y = random.nextInt(level.h); if (level.getTile(x, y) == Tile.grass) { this.x = x * 16 + 8; this.y = y * 16 + 8; return true; } } }
2
protected void replaceAll() { init(); if( !replace ) return; txt.setRedraw(false); if( parser != null) parser.setReparse(false); if( wrapButton.getSelection() && replaceText.getText().contains(findText.getText())) wrapButton.setSelection(false); while(true){ if( !find() ) ...
8
public void sendTo(CommandSender s, int page, int perPage) { List<HelpScreenEntry> toSend = toSend(s); int maxpage = (int) (toSend.size() / (float) perPage + 0.999); int from = (page - 1) * perPage; int to = from + perPage; if (from >= toSend.size()) { from = to = 0; } if (to > toSend.size()) { t...
6
public boolean pickAndExecuteAnAction() { try{ for(int i =0; i < Bills.size(); i++){ //print("" + Customers.get(i).s ); if(Bills.get(i).s == OrderState.needToCompute){ Compute(Bills.get(i)); return true; } } for(int i =0; i < Bills.size(); i++){ if(Bills.get(i).s == OrderState.nee...
7
public void caretUpdate(CaretEvent e) { ASection s; s = aDoc.getASectionThatStartsAt(textPane.getCaretPosition()); if (textPane.getText().length()<=0)setText("Откройте сохраненный документ или вставтьте анализируемый текст в центральное окно"); else if(s !=null){ set...
3
public PageNotFoundException(Exception e, String name){ super(e, name); }
0
public String getDiccionario(){ String dic = ""; for(int i=0; i<diccionario.size(); i++){ dic = dic + diccionario.get(i).getPalabra() + "<BR> "; } return dic; }
1
public static StringWrapper javaTranslateTypeSpecHelper(StandardObject typeSpec, boolean functionP) { { Surrogate finalType = null; String typeName = ""; { Surrogate testValue000 = Stella_Object.safePrimaryType(typeSpec); if (Surrogate.subtypeOfParametricTypeSpecifierP(testValue000)) { ...
7
public int getHyperPeriod() { if (workload.size() <= 0) return 0; int hp = workload.get(0).getPeriod(); for (int i = 1; i < workload.size(); i++) { hp = MathUtils.lcm(hp, workload.get(i).getPeriod()); } return hp / 2; }
2
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node node = (Node) o; if (id != null ? !id.equals(node.id) : node.id != null) return false; return true; }
5
public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new FileReader(new File( ConfigReader.getKylie16SDir() + File.separator + "PCA_PIVOT_16Sfamily.txt"))); BufferedWriter writer = new BufferedWriter(new FileWriter(new File( ConfigReader.getKylie16SDir() +...
6
private int root(int i) { while (i != id[i]) { id[i] = id[id[i]]; // to compress the path i = id[i]; } return i; }
1
public Object [][] getDatos(){ Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length]; //realizamos la consulta sql y llenamos los datos en "Object" try{ if (colum_names.length>=0){ r_con.Connection(); String c...
5
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
6
public static Vector<Ticket> valideCaddie (Vector<Caddie> caddies) throws BDException, ParseException { ArrayList<Vector<Place>> placesToChoice = new ArrayList<Vector<Place>>(); ArrayList<Integer> placesPrice = new ArrayList<Integer>(); Vector<Ticket> toReturn = new Vector<Ticket>(); int finalPrice = 0 ; // ...
6
public boolean saveFile(ArrayList<Game> liste) { PrintWriter pw; try { pw = new PrintWriter("words.txt"); for (int i = 0; i < liste.size(); i++) { pw.print(liste.get(i).toSaveString()); System.out.prin...
2
private int getDownPos(String text, int cpos) { String[] lines = text.split("\n"); int line = 0; int tmp = cpos; while(tmp > 0) { tmp -= lines[line].length() + 1; line++; } line--; int all = 0; for(int ...
7