text
stringlengths
14
410k
label
int32
0
9
public void move(int dir, boolean didPlayerSend){ int[][] gameBoard= game.getBoard(); if (checkCell(dir)) moveToCell(dir, gameBoard); else if (didPlayerSend) this.savedDir= dir; else { if (this.savedDir != dir) this.savedDir= dir; else this.savedDir= -1; } }
3
public static void main(String[] args) { BufferedReader reader = null; String sql = "insert into location (location) values (?)"; Connection connection = null; PreparedStatement statement = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); connection = DriverManager.getConnection("jdbc:oracl...
9
public static boolean[] getSieve(int size) { boolean[] isPrime = new boolean[size]; for(int i = 2; i < isPrime.length; i++) isPrime[i] = true; for(int i = 2; i < isPrime.length; i++) if( isPrime[i] ) for(int j = 2; j*i < isPrime.length; j++) isPrime[i*j] = false; return isPrime; }
4
public void test_10() { int nmerSize = 32; String seqStr[] = { "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" // , "caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaag" // Prepend 'c', append 'g' }; SuffixIndexerNmer<DnaSequence> seqIndex = new SuffixIndexerNmer<DnaSequence>(new DnaSubsequenceCompara...
2
public int largestRectangleArea(int[] heights) { Deque<Integer> deque = new LinkedList<>(); int maxArea = 0; int i = 0; while (i < heights.length) { int height = heights[i]; if (deque.isEmpty() || height > heights[deque.peekLast()]) { deque.add(i...
8
@Override public void Volum (double n) { this.volume=Math.PI*rad*rad*hight*n; this.hight = hight*Math.pow(n, 1/3); this.rad = rad*Math.pow(n, 1/3); }
0
public ArrayList<ArrayList<Integer>> threeSumOverTimeLimit(int[] num) { ArrayList<ArrayList<Integer>> result = new ArrayList<>(); Map<Integer, ArrayList<Pair<Integer, Integer>>> map = new HashMap<Integer, ArrayList<Pair<Integer,Integer>>>(); if(num.length < 3) return result; //sort num fisrt: Arrays.sort(num)...
8
public static HashMap<Integer, String> getNumericalAndNumericalUnderscoreFilenames_HashMap( File directory, String underscore) { HashMap<Integer, String> result = new HashMap<Integer, String>(); int index = 0; String[] list = directory.list(); int count = 0; ...
6
public static ArrayList<Television> getAllTelevision(int montoMin,int montoMax,char consumo) { ArrayList<Television> colElectrodomestico=new ArrayList<Television>(); String sqlFiltros=""; if(montoMin>0) sqlFiltros=sqlFiltros.concat(" and preciobase>"+montoMin+" "); if(montoMax>0) sqlFiltros=sqlFiltros.co...
6
public boolean isValid() { if (root.isNil()) { return true; } else { return getRoot().isBSTValid() && getRoot().isBlackValid() && getRoot().isRedValid(); } }
3
private static Set<GridPacking<CatCage>> solve_aux(Sequence<CatCage> cagePlacementSequence, List<CatCage> catCageList, int rowCount, int columnCount) { assert isViable(cagePlacementSequence, rowCount, columnCount) : String.format("cagePlacementSequence is not viable! : cagePlacementSequence =\n %s", new GridPackingI...
6
public void reset (int port) throws IOException { if (port <= 0 || port > ports) throw new IllegalArgumentException (); ControlMessage.setFeature (dev, ControlMessage.TYPE_CLASS | ControlMessage.RECIPIENT_OTHER, PORT_RESET, port ); }
2
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
7
@Override public boolean equals( Object obj ) { if(!(obj instanceof ChunkCoord)) return false; return x == ((ChunkCoord)obj).x && z == ((ChunkCoord)obj).z && world.equals(((ChunkCoord)obj).world); }
3
private final String getChunk(String s, int slength, int marker) { StringBuilder chunk = new StringBuilder(); char c = s.charAt(marker); chunk.append(c); marker++; if (isDigit(c)) { while (marker < slength) { c = s.charAt(marker...
5
public void Find(int k, HashSet<Integer> qp, HashSet<Integer> qm){ HashSet<Integer> gg = new HashSet(); int delt; if (qp.isEmpty() && qm.isEmpty()){ HashSet<Integer> tmp = new HashSet(); for (int i = 0; i < k;i++) tmp.add(ss[i]); sets.add(tmp);...
9
public static void calculateAndControl(LocationData angles, Main main) { int x1 = angles.picX; int x2 = angles.picX2; int y1 = angles.picY; int y2 = angles.picY2; int dx = Math.abs(x1 - x2); int dy = Math.abs(y1 - y2); if (dy != 0) { int angle = (int) Math.toDegrees(Math.atan(dx / dy)) - 90; if...
6
public void receive_packet(DuplexLink link, Packet packet) { int enlace = this.links.get(link); RouterBuffer buffer = this.buffers.get(enlace); packet.decrease_ttl(); //dropando pacote: buffer lotado ou TTL == 0 if (buffer.is_full() || packet.getTTL() == 0) { if(buffer.is_full()) System.out.pri...
3
public void Show(String uname) { //Instantiate classes ASCII_Sound beep = new ASCII_Sound(false); ASCII_Art welcome = new ASCII_Art(); Options o = new Options(); MehMurray mm = new MehMurray(); MainMenu m = new MainMenu(); PlayMenu p = new PlayMenu(); ...
9
@Override public boolean isAnyFieldDifferentFromDefault() { boolean same = this.active.isSelected() && this.SKU.getText().isEmpty() && this.name.getText().isEmpty() && this.description.getText().isEmpty() && this.UOM.getText().isEmpty() && this.price.getText().equals("0.00") && this.stock.getText...
8
public boolean skipAndClauseP(ControlFrame frame, Cons forbiddenvars) { { IncrementalPartialMatch self = this; { boolean forbiddenvarsP = !(forbiddenvars == Stella.NIL); boolean failunconstrainedclausesP = Logic.$FAIL_UNBOUND_CLAUSESp$; Stella_Object conjunct = (frame.proposition.arguments.th...
8
public static List<Dependencia> listaDeDependencias() { ResultSet tr = null; String select = "SELECT * FROM dependencias"; ArrayList<Dependencia> listaDependencia = new ArrayList<Dependencia>(); Connection conexion = null; Statement statement = null; try { co...
9
private boolean isElementPresent(By by) { try { driver.findElement(by); return true; } catch (NoSuchElementException e) { return false; } }
1
public static void listDir(JFrame jframe, Collection<File> files, Collection<File> folders, int depth, final List<Pattern> dangerousFolders) { String frameTitle = jframe.getTitle(); try { for (File folder : folders) { Log.info("Folder to scan: '...
9
private char validateGuessIsALetter(String guess) { while (guess.length() > 1) { System.out.println("Please only enter one character:"); guess = sc.next(); } return guess.charAt(0); }
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BaseFractalAlgorithm other = (BaseFractalAlgorithm) obj; if (Double.doubleToLongBits(...
9
public int[] getCubie(Point p) { int cubieSize = squareSize / 3; for (int f = 0; f < 6; f++) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { Point l = getSideLocation(TileColor.get(f)); if (p.x >= l.x + 1 + cubieSize * x && p.x <= (l.x + 1 + cubieSize * x) + cubieSize && p.y >= l.y + ...
7
private void doWork() { System.out.println("CopyWorker start to work!"); FileReaderUtils.copy(this.src, this.des); long start = System.currentTimeMillis(); String name = des.getName(); String ext = name.substring(name.lastIndexOf("."), name.length()); String path = des.getAbsolutePath(); String size = Str...
4
public void createAbstractXxxVMethods(ClassGenerator classGen) { if (returnVType().equals(owner)) { JType xxxV = owner.jType(XxxV); ImmutableList<VType> rest = isEndofunctionForOwner() ? skipOne(toVType(vParams)) : toVType(vParams); boolean isAnyBasicInRest = isAnyBasic(rest); boo...
9
private void update() { final int ASCII = getSkinnable().getCharacter().isEmpty() ? 20 : getSkinnable().getCharacter().toUpperCase().charAt(0); final String ON_STYLE = getSkinnable().getSegmentStyle().ON_CLASS; final String OFF_STYLE = getSkinnable().getSegmentStyle().OFF_CLASS; ...
5
@EventHandler(ignoreCancelled = true) public void onPlayerInteract(final PlayerInteractEvent event) { final boolean leftClickCheckFire = this.protectFire && event.getAction() == Action.LEFT_CLICK_BLOCK; if (!leftClickCheckFire && !this.rightClickTargetFace(event)) return; final Location tar...
7
@Override public void tick(InputHandler input, Level level) { boolean left = input.keys[KeyEvent.VK_LEFT]; boolean right = input.keys[KeyEvent.VK_RIGHT]; boolean up = input.keys[KeyEvent.VK_UP]; boolean down = input.keys[KeyEvent.VK_DOWN]; xx = 0; yy = 0; if (left) xx--; if (right) xx++; if ...
7
public void onCommand(CommandSender sender, ChunkyCommand command, String label, String[] args) { if (!(sender instanceof Player)) { Language.IN_GAME_ONLY.bad(sender); return; } if (args.length < 3) { Language.CMD_CHUNKY_PERMISSION_HELP.bad(sender); ...
5
public Element getElementWithAttribute(String attribute, String value, String tagName){ NodeList dbs=null; if(this.current==null){ dbs = xmlFile.getElementsByTagName(tagName); } else{ dbs = current.getElementsByTagName(tagName); } Element element = null; for(int i=0; i<dbs.getLength(); i++){ ele...
4
public ServerEnterFrame(int type){ super(); String sType; switch (type) { case ServerDataBaseManager.QUERY: sType = "Query"; break; case ServerDataBaseManager.UPDATE: sType = "Update"; break; default: sType = "Default"; break; } setTitle("Enter " + sType); setLayout(new BorderLayout(...
2
public <TResult> Query<TResult> select(Selector<T, TResult> selector) { Iterable<TResult> rs = new SelectIterable<TResult>(this._source, selector); return new Query<TResult>(rs); }
0
private Local getAvailableLocal(Local cls) { // TODO Auto-generated method stub for(Local l: b.getLocals()){ if(l.toString().equals(cls.toString()) && l.getType().equals(cls.getType())) return l; } return null; }
3
public boolean checkBeforeMove(int x, int y) { String checkArray[][] = {{RowA.cell0, RowA.cell1, RowA.cell2},{RowB.cell0, RowB.cell1, RowB.cell2},{RowC.cell0, RowC.cell1, RowC.cell2}}; boolean output; if (output = x < 0 || x > 3 || y < 0 || y > 2) System.out.println("Неверный ход. Но...
6
private void setup() { this.imageData = new byte[this.tileWidth * this.tileWidth * 4]; this.watchIconImageData = new int[this.tileWidth * this.tileWidth]; this.dialImageData = new int[this.tileWidth * this.tileWidth]; this.tileImage = 1; try { BufferedImage ioexcepti...
9
public static String getStringValue(String key){ return properties.getProperty(key); }
0
private Set<TKey<?, ?>> setupDataKeys() { Set<TKey<?, ?>> dataKeys = new HashSet<>(); dataKeys.add(DatasetKeys.DIGITISATION_STATUS); dataKeys.add(DatasetKeys.EXPECTED_RECORDS); dataKeys.add(DatasetKeys.EXPECTED_DIGITAL_OBJECTS); dataKeys.add(DatasetKeys.DATA_FORMAT); va...
6
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the ...
9
public Editor(Composite parent, int style) { super(parent, style); if (fontSize == null) { try { FontData[] fD = this.getFont().getFontData(); fontSize = fD[0].getHeight(); System.out.println("Editor default font size detected = " + fontSize); } catch (Exception ex) { ex.printStackTrace...
2
public void loadProperties(File filename) { try { Properties prop = new Properties(); FileInputStream in = new FileInputStream( filename); prop.load(in); setUsername(prop.getProperty(usernameProperty)); setHost(prop.getProperty(hostnameProperty)); setOpenID(prop.getProperty(openidProperty)); ...
3
public void jouerEnForteresseDeGlace(Dieu deus, GeantDeGivre gdg, De de, DomaineDesMorts ddm, DemeureDesElfes dde, JFrame page) { int forcedieu = deus.getFORCEINITIALE(); partieRestanteAjouer--; if (this.getNom().compareTo("Freyja") == 0) { Freyja f = (Freyja) this; f.se...
9
public GrammarViewer(Grammar grammar) { setModel(new GrammarTableModel()); this.grammar = grammar; // setLayout(new BorderLayout()); Production[] prods = grammar.getProductions(); data = new Object[prods.length][2]; Object[] columnNames = { "Production", "Created" }; for (int i = 0; i < prods.length; i++...
1
public void bind() { if(texture != null && !isBound) { //Save the previous texture to set back, otherwise there's issues with fonts prevTexture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D); GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getTextureID()); isBound = true; } else if(texture != null && ...
4
private void addToBucketMap(Map<Integer, List<Integer>> bucketMap, int ibucket, int element) { List<Integer> list; if (bucketMap.containsKey(ibucket)) { list = bucketMap.get(ibucket); } else { list = new ArrayList<Integer>(); bucketMap.put(ibucket, list); ...
7
/* package */ static Request addScope(Request request, String[] scopes) { if (scopes != null && scopes.length > 0) { StringBuilder scope = new StringBuilder(); for (int i=0; i<scopes.length; i++) { scope.append(scopes[i]); if (i < scopes.length-1) scope.ap...
4
@Override public int compare(Object o1, Object o2) { Map<Object, Integer> m1 = order.get(o1), m2 = order.get(o2); if (m1 == null || m2 == null) throw new IllegalArgumentException(o1 + " " + o2); if (m1.containsKey(o2)) return m1.get(o2); Set<Object> mutual = new HashSet<>(m1.keySet()); mutual.retainAll...
5
public double getNormalDistribution(double lowerLimit, double upperLimit, double standardDeviationSpread) { if (standardDeviationSpread < 1.0 || standardDeviationSpread > 5.0) // if standardDeviationSpread is < 1.0 there is a risk of excessive iterations of the range-checking do-while() loop throw new Illegal...
4
public boolean disjointBelow(RPChromosomeRegion testRegion) { if (endChromID < testRegion.startChromID || endChromID == testRegion.startChromID && endBase <= testRegion.startBase) return true; else return false; }
3
public void addClassAnalyzer(ClassAnalyzer clazzAna) { if (parent != null) parent.addClassAnalyzer(clazzAna); }
1
public void setOverlayPainter(Painter<? super JXMapViewer> overlay) { Painter<? super JXMapViewer> old = getOverlayPainter(); this.overlay = overlay; PropertyChangeListener listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValu...
9
public synchronized void removeStation(String alias) { boolean contained = stations.remove(alias); if(!contained) { throw new IllegalStateException("The station with alias " + alias + " was not part of this network."); } }
1
public void unpauseDownload(final int gid) { switch (downloads.get(gid).getStatus()) { case PAUSED: taskManager.unpause(gid); break; default: break; } }
1
@Override public synchronized InputStream getInputStream() throws IOException { if(toAppStream == null) { toAppStream = new ConnectionEndPointInputStream(); // if there is already some data, copy it to stream // and delete buffer if(toAppBuffer != null) { for(Object obj : toAppBuffer) { toA...
3
public GameController() { super("PACMAN BY Amador Navarro"); map = new Map(); player = new GamePlayer(); int rows = map.getRowLength(); int columns = map.getColumnLength(); int[][] cellValues = initCellValues(rows, columns); ...
2
final public Expression StringExpression(int str_type) 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 ...
8
public void visitIfZeroStmt(final IfZeroStmt stmt) { print("if0 ("); stmt.expr().visit(this); print(" "); switch (stmt.comparison()) { case IfStmt.EQ: print("=="); break; case IfStmt.NE: print("!="); break; case IfStmt.GT: print(">"); break; case IfStmt.GE: print(">="); break; ...
7
public ArrayList<Card> chooseAttackers(ArrayList<Card> controlledCreatures) { int playerIndex = 0; ArrayList<Card> attackingCreatures = new ArrayList<Card>(); for (Card creature : controlledCreatures) { if (!creature.hasSummoningSickness()) { creature.setTapped(true); creature.setAttacking(true); a...
4
public void store(OutputStream out) throws IOException { PrintStream p = new PrintStream(out); TreeMap tm = new TreeMap(omsParams); int maxlen = -1; for (Iterator it = tm.keySet().iterator(); it.hasNext();) { String elem = (String) it.next(); ...
3
public List<Event> getEvents(){ //returns the list of all events return manager.createQuery("FROM Event").getResultList(); }
0
public final <T> T getObject(Class<T> clazz, String name) { // If we have a valid factory for this clazz and valid asset name if (isValidAssetType(clazz, name)) { return clazz.cast(factoryList.get(clazz).getObject(name, data.get(name))); } return null; }
1
public static ArxFile readArxFile(File f) { HashMap<String, String> result = new HashMap(); try { BufferedReader br = new BufferedReader(new FileReader(f)); String line; String tag; String value; while ((line = br.readLine()) != null) { ...
6
public void ocultarProcesos(){ //mbLog.setVisible(false); NodosListaProceso aux = this.PrimerNodo; int i = 0; while (aux.siguiente!=null && i<cant) { //aux.proceso.setVisible(false); i++; aux=aux.siguiente; } //aux.proceso.setVisible(false); }
2
private InputStream getConnectionInputStream(HttpURLConnection conn) throws IOException { if (conn.getHeaderField("Content-Encoding") != null) { if (conn.getHeaderField("Content-Encoding").contains("gzip")) { return new GZIPInputStream(conn.getInputStream()); } } return conn.getInputStream(); }
2
public Vector<String[]> getCachedData() { return allPorts; }
0
public static String to(double input) throws ParseException { if (input < 1 || input % 1 != .0D) throw new ParseException( new Diagnosis().append("diagnosis.roman-numeral-to-invalid-value", input), ParseException.ParseType.GENERIC ); int n...
6
private void writeResults(List<Combo> combs, String infos, boolean noinfo) { File out = new File("_out" + File.separator); out.mkdirs(); if (combs == null || combs.size() < 1) return; try { long time = System.currentTimeMillis(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( new F...
5
public LoadCDDDomainTask(CyNetwork net, CDDDomainManager manager) { super(); this.domainManager = manager; if (net != null) this.network = net; else this.network = domainManager.getCurrentNetwork(); this.table = network.getDefaultNodeTable(); ArrayList<String> columns = new ArrayList<String>(); co...
6
public String addBinary(String a, String b) { if (a.length() == 0) return b; if (b.length() == 0) return a; char[] charA = a.toCharArray(); char[] charB = b.toCharArray(); int lenA = charA.length - 1; int lenB = charB.length - 1; int carry = 0; int sum = 0; StringBuff...
9
private Map getPropertiesTree(Properties properties) { Map<String, Object> tree = new LinkedHashMap<>(); for (String name : properties.stringPropertyNames()) { String[] parts = name.split("\\."); Map<String, Object> nextTree = tree; for (int i = 0, partsLength = parts.length; i < partsLength; i++) { S...
6
private static LinkedHashSet<EStructuralFeature> getAllEStructuralFeatures( EClass eClass, LinkedHashSet<EStructuralFeature> eStructuralFeatures) { for (EAttribute eAttribute : eClass.getEAllAttributes()) { // System.out.println("\t\t\t" + eAttribute.getName()); eStructuralFeatures.add(eAttribute); } for...
9
private void setupVault(boolean debug) { if(debug) { this.getLogger().info("Setting up with Vault"); } // Check vault if(getServer().getPluginManager().getPlugin("Vault") == null) { if(debug) { this.getLogger().info("Vault not found."); } return; ...
7
public void moveAnt(boolean advancingOnX, boolean advancingOnY, int velocityX, int velocityY) { this.setAge(this.getAge() + 1); if (advancingOnX) { if (!this.collisionX_MAX(terrainWidth, this.getX())) { this.advanceX(velocityX); } else { advancingOnX = false; } } else { if (!this.collisionX...
6
@EventHandler public void onBlockPlace(BlockPlaceEvent event){ if(event.getBlock().getType().compareTo(Material.WOOL) == 0 && plugin.isPlacing()){ if(event.getBlock().getData() == 11){ plugin.getBlockMap().put(event.getBlock().getLocation(), "BLUE"); } else if(event.getBl...
4
public void visit_aload(final Instruction inst) { final int index = ((LocalVariable) inst.operand()).index(); if (index + 1 > maxLocals) { maxLocals = index + 1; } if (inst.useSlow()) { if (index < 256) { addOpcode(Opcode.opc_aload); addByte(index); } else { addOpcode(Opcode.opc_wide); ...
8
private void getPeers(TorrentHandler handler) throws IOException{ String ih_str = ""; for (int i = 0; i < info_hash.length; i++) { if ((info_hash[i] & 0x80) == 0x80) { // if the byte data has the most // significant byte set (e.g. it // is negative) ih_str += "%" + this.HEXCHARS[(inf...
7
public void run() { byte[] buffer = new byte[1024]; int len = -1, i, temp; try { while (!end) { if ((in.available()) > 0) { if ((len = this.in.read(buffer)) > -1) { for (i = 0; i < len; i++) { temp = buffer[i]; // adjust from C-Byte to Java-Byte if (temp < 0) ...
9
public static JSGob[] objectIdList(int radius, Coord offset, String... objects) { ArrayList<Integer> objids = new ArrayList<Integer>(); Coord myCurrentCoord = MyCoord(); myCurrentCoord = MapView.tilify(myCurrentCoord); Coord objectOffset = new Coord...
6
public void draw(Graphics g){ requestFocus(); if(b.getNumberOfLifes() != 0) { g.setColor(Color.decode("#666666")); g.fillOval(b.getBall().x, b.getBall().y, b.getBall().width, b.getBall().height); drawPaddle(g, b.getP1().getId(), b.getP1().getPaddle()); if(...
7
public JSplitPane getjSplitPane1() { return jSplitPane1; }
0
public static IntMatrix computeIntersectionMatrix(List<IIntervalsTimeDomain> domains) { // create matrix IntMatrix matrix = new IntMatrix(domains.size()); // for each pair test if intersecting for (int i = 0; i < domains.size(); i++) { matrix.set(i, i, 0); ...
4
@Override public void run() { try { new WordLengthCallable().call(); } catch (InterruptedException e) { e.printStackTrace(); } }
1
public void Clean(Person D1, ArrayList<PersonApplication> PersonApplications){ if(D1.isDuty()==true){ for(int i=0; i<PersonApplications.size(); i++){ if(PersonApplications.get(i).getPerson().getID().equals(D1.getID())){ PersonApplications.remove(i); } } } }
3
private boolean r_verb_suffix() { int among_var; int v_1; int v_2; int v_3; // setlimit, line 164 v_1 = limit - cursor; // tomark, line 164 if (cursor < I_pV) { ...
9
public static boolean addfriend(Connection conn, String loggedas, String friendlogin) { ResultSet resultSet = null; Statement statement = null; String query1 = "select `ID` from 8306_traffii1.user Where `Login` = (?)"; PreparedStatement preparedStmt1; PreparedStatement preparedStmt2; PreparedStateme...
7
* @param String fieldName 値を設定したいフィールドの名前 * @param Object value フィールドに設定したい値 */ public static void setField(Object o, String fieldName, Object value) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException{ Field field; try{ field = o.getClass().getField(fieldName); ...
3
private void makeOrderButtonActionPerformed(java.awt.event.ActionEvent evt) { request.setService(Constants.ClientService.buyTicket); if (orderFromUser.getFirstName() == null || orderFromUser.getFirstName().equals("")) { JOptionPane.showMessageDialog(null, "Некорректно введено имя. Повторите...
8
public Integer getCategoryObjectID (String name) { Integer data = null; for (int i = 0; i < this.arr_data.size(); i++) { if (name.equals(this.arr_data.get(i).getDescr())) data = this.arr_data.get(i).getID(); } return data; ...
2
public void codageNRZ() { for (int i = 0; i < informationRecue.nbElements(); i++) { for (int j = 0; j < nbEchantillon; j++) { if (informationRecue.iemeElement(i)) informationEmise.add(max); else informationEmise.add(min); } } }
3
private static void initGrid() { grid = new Site[xSize][ySize]; for(int x = 0; x < xSize; x++) { for(int y = 0; y < ySize; y++) { grid[x][y] = new Site(x, y); } } }
2
private void runTest() { int i, min, max; TesterThread tester; // Get the min and max rows to be processed by each TesterThread int[] ranges = getRanges(); if (ranges == null) { return; } if (ranges[0] == -1) { System.err.println("No test records found in target table."); return; } // Get f...
6
@EventHandler public void onTimeUnbanEvent(TimeBanUnbanEvent event) { String admin; if (event.getSender() != null && event.isSenderPlayer()) { admin = event.getSender().getDisplayName(); } else { admin = "console"; } // get ban Ban ban = event...
6
@Override public void setToolTip(ToolTip tt) { tt.setX(this.x * SIZE + SIZE); tt.setY(this.y * SIZE + SIZE); ArrayList<String> message = new ArrayList<>(); message.add(territory.getName()); switch (id % 6){ case 0: message.add( "\nPlains territory"); break; case 1: message.add( "\nForest terr...
7
private void writeCHRM() throws IOException { if (param.isChromaticitySet() || param.isSRGBIntentSet()) { ChunkStream cs = new ChunkStream("cHRM"); float[] chroma; if (!param.isSRGBIntentSet()) { chroma = param.getChromaticity(); } else { chroma = srgbChroma; // SRGB chromaticities ...
4
public boolean contains(final Point point) { Point[] bounds = {new Point(0.0, 0.0), new Point(0.0, 10.0), new Point(10.0, 0.0), new Point(10.0, 10.0)}; boolean intersected; for (int i = 0; i < bounds.length; i++) { intersected = false; //This loop checks that a line...
5
public void setManaged(boolean managed) { this.managed = managed; }
0
@Override public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("device")) { devices.add(device); } else if (qName.equals("origin")) { device.setOrigin(content); } else if (qName.equals("price")) { device...
9