text
stringlengths
14
410k
label
int32
0
9
public void startServer(String serverPort) { int port = 8080; if (!serverPort.isEmpty()) { port = Integer.parseInt(serverPort); } try { sleep(100); socket = new ServerSocket(port); } catch (Exception e) { // TODO Автоматически созданный блок catch e.printStackTrace(); } serverIsRaning = tr...
2
private void btonaceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btonaceptarActionPerformed //yyyy-MM-dd HH:mm:ss java.util.Date fecha = new Date(); String fecreg1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(fecha); fecreg1 = (PROCE.fechasys(fecreg1));...
8
public static Map<String, UIObject> parsePageUIObjects(String pageName) { String objectFile = ConfigReader.getInstance().getObjectsFile(); Map<String, UIObject> pageUIObjectsMap = new HashMap<String, UIObject>(); try { File fXmlFile = new File(objectFile); //TODO : read from class path DocumentBuilderF...
5
@EventHandler(priority = EventPriority.NORMAL) public void onBlockDestroy(final BlockBreakEvent event) { if (event.isCancelled() || event.getPlayer() == null || event.getBlock() == null) { return; } final Player player = event.getPlayer(); // Check for ignore permission node if (plugin.getPermissio...
8
public void nextImage() { if (historyIndex >= history.size() - 1) { textArea.append("No images left!\n"); } else { historyIndex++; imagePanel.updatePanel(history.get(historyIndex)); imagePanel.update(imagePanel.getGraphics()); } }
1
public FSAConfiguration(State state, FSAConfiguration parent, String input, String unprocessed) { super(state, parent); myInput = input; myUnprocessedInput = unprocessed; }
0
* @return Returns the edge that has been flipped. */ public Object flipEdge(Object edge) { if (edge != null && alternateEdgeStyle != null) { model.beginUpdate(); try { String style = model.getStyle(edge); if (style == null || style.length() == 0) { model.setStyle(edge, alternateEdgeSt...
4
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Pair)) return false; Pair pair = (Pair) o; if (a != null ? !a.equals(pair.a) : pair.a != null) return false; if (b != null ? !b.equals(pair.b) : pair.b != null) return false; return true; }
6
public Object read(ByteReader reader) { Object output = null; try { InputStream is = new ByteReaderStream(reader); ObjectInputStream ois = new ObjectInputStream(is); output = ois.readObject(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException( e ); ...
2
private String scanBlockScalarBreaks (int indent) { StringBuilder chunks = new StringBuilder(); while (column < indent && peek() == ' ') forward(); while (FULL_LINEBR.indexOf(peek()) != -1) { chunks.append(scanLineBreak()); while (column < indent && peek() == ' ') forward(); } return chunks.toStr...
5
public void valorarSerie(String idUsuario, String idSerie, float puntuacion) throws Exception{ if (puntuacion < 0 || puntuacion > 10){ throw new Exception("Puntuación no válida."); } Serie serie = buscarSerie(idSerie); UsuarioRegistrado usuario = buscarUsuario(idUsuario); ...
2
private static boolean canRemove(int patientID) { boolean canRemove = false; Models.DatabaseModel.Bill bill = new Models.DatabaseModel.Bill(); ArrayList<Models.DatabaseModel.Bill> patientOutstandingBills = bill.findUserOutstandingBill(patientID); if (!patientOutstandingBills.isEmpty())...
1
public void generateRandoms() { // Number of stations Zone #2 n = new Random().nextInt(10) + 1; // Number of stations Zone #3 m = new Random().nextInt(10) + 1; XtoZoneOne = new int[m]; // Ui (1 < i < m) ZoneTwotoZoneThree = new int[m][n]; //Bij ZoneThreetoY = new int[n]; for(int i = 0; i < m; i++)...
3
private void initLineWriter() { lineWriter = new Thread() { public void run() { byte[] data = new byte[1024]; try { while(!killThread) { if(playing) { if(ais.available() > 0) { ais.read(data); soundLine.write(data, 0, data.length); } else if(repeating) { ...
5
public ConnectToDatabase() { p = new Properties(); (new File(ResourceLoader.dir)).mkdirs(); if (new File(ResourceLoader.dir+"login.xyz").exists()) { try { p.load(new FileInputStream(new File(ResourceLoader.dir+"login.xyz"))); } catc...
4
private boolean etsiRuutuJaLiiku(Robotti robo, int i, int suunta) { for (int j = 0; j < i; j++) { Set<Ruutu>ruudut= new HashSet<>(); ruudut.add(robo.getRuutu()); Ruutu seuraava=lauta.seuraavaRuutu(robo.getRuutu(), suunta); ruudut.add(seuraava); if (...
5
@Override public String toString() { if (etat == Etat.vide) { return "0"; } if (etat == Etat.jeunePousse) { return "1"; } if (etat == Etat.arbuste) { return "2"; } if (etat == Etat.arbre) { return "3"; } ...
7
@Override public double[] computeValue(final char refBase, FastaWindow window, AlignmentColumn col) { value[0] = 0; double counted = 0; if (col.getDepth() > 0) { Iterator<MappedRead> it = col.getIterator(); while(it.hasNext()) { MappedRead read = it.next(); if (read.hasBaseAtReferencePos(col....
6
public void updateUserInfo(UserInfo user) throws Exception { Connection conn = null; // get connection from data source try { conn = datasource.getConnection(); } catch (SQLException e) { throw new RuntimeException("Could not get JDBC Connection", e); } ...
7
public Object[][] getCells() { int i; int n; Vector<Object[]> result; Object[] row; int rowCount; boolean proceed; initialize(); result = new Vector<Object[]>(); try { // do know the number of rows? rowCount = getRowCount(); if (rowCount == -1)...
9
public boolean saveProdutos( Produtos produtos ){ this.getConectaBanco(); try { if (this.getConn() != null || !this.getConn().isClosed()) { this.getConn().setAutoCommit(false); this.setStmt(this.getBuscaProdutos()); this.getStmt().setInt(1, produtos.getIdProduto()); this.s...
6
private void parseDayWordDetails(int i, String checkWord) { int firstOccurance = 0; for (int j=i-1; j>=0; j--) { if (parts[j].equals("next") || parts[j].equals("following") ) { isCommandDetails[j] = false; } else { firstOccurance = j+1; break; } } if (firstOccurance!=i) { isCommandDetail...
8
public static boolean setNumTeams(int n) { if ((n >= 1) && (n <= players.length)) { teams = new Team[n]; //initializing the teams for (int i = 0; i < n; i++) { teams[i] = new Team(); } return true; } else return false; }
3
@Override public void buildSauce() { pizza.setSauce("mild"); }
0
public void setMsgLabel(String txt) { if (t == null || !t.isRunning()) { resetColor(); msgLabel.setText(txt); } }
2
@Test public void test() throws InterruptedException { for (int i = 0; i < 100; i++) { for (ChildData data : PathCacheFactory.getBabyDuncanPathData()) { System.out.println(data.getPath() + " = " + new String(data.getData())); } Thread.sleep(1000); ...
2
public static void selectInverse(Node currentNode, JoeTree tree, OutlineLayoutManager layout) { // select all siblings Node parent = currentNode.getParent(); for (int i = 0, limit = parent.numOfChildren(); i < limit; i++) { Node child = parent.getChild(i); if (child.isSelected()) { tree.removeNod...
3
public void Move(int dir) { switch(dir) { case 0: if(cube.getLoc()%4 != 0) { cube.Left(); } break; case 1: if(cube.getLoc()%4 != 3) { cube.Right(); } break; case 2: if(cube.getLoc() > 3) { cube.Down(); } break; case 3: if(cube.getLoc() < 12) { cube.Up(...
8
static void testJogger() { Scanner in = new Scanner(System.in); Board b = Board.readBoard(in); ArrayList<Integer> nextPiece = new ArrayList<Integer>(); while(in.hasNextInt()) nextPiece.add(in.nextInt()); Searcher s; for (int i = 2; i <7; i++){ for(int j= 1; j < i; j++){ s = new Jogger(new Line...
3
@Override public boolean equals(Object other){ if (other == null) return false; if (other == this) return true; if (!(other instanceof PairInt))return false; PairInt otherMyClass = (PairInt)other; if (otherMyClass.x.equals(this.x) && otherMyClass.y.equals(this.y)) { return tru...
5
public void recibirConnection(String updateId, int precio, long id, long adyacente) { if (!updateIdsList.find(updateId)) { updateIdsList.append(updateId); if (id == this.id) for (int i = 0; i < connections.getLength(); i++) { Connection connection = co...
4
public byte[] extract() { List<Byte> bitData = new ArrayList<Byte>(); // 获得Y的colorid Integer colorid = (Integer) mImg.getColorIDs().toArray()[0]; // 获得Y的color unit JPEGDataUnits dataUnits = mImg.getDataUnits(); List<int[]> YUnits = dataUnits.getColorUnit(colorid); ...
7
private void siftDown(int pos) { if (2 * pos >= size) return; int maxI = getMaxInd(2 * pos, 2 * pos + 1); if (heap.get(maxI).compareTo(heap.get(pos)) > 0) { swap(pos, maxI); siftDown(maxI); } }
2
public ArrayList<String> recListaAmigos(String nick) {//ok //verificar logueo ArrayList<String> amigos; amigos = new ArrayList<String> (); System.out.println(nick); try { String queryString = "select nick2 from serAmigos where nick1=?"; connection = getConnec...
6
public boolean saveSign(Location signLoc, int doorID){ int i=1; while(signConfig.get("signs." + i)!=null){ if(signConfig.get("signs." + i + ".DoorID")!=null){ i++; }else{ break; } } signConfig.set("signs." + i + ".DoorID", doorID); signConfig.set("signs." + i + ".location.world", sig...
3
@Override public ArrayList<Locations> getPath(Locations begin, Locations end) { int startRow = begin.getRow(); int startColumn = begin.getColumn(); int endRow = end.getRow(); int endColumn = end.getColumn(); ArrayList<Locations> list = new ArrayList<Locations>(); i...
7
private void signalEditorDelSignal() { if(se_signal.getSelectionIndex() == -1) return; if(signals == null) signals = new SignalBundle(); Contact contact = new Contact(se_signal.getText()); signals.getSignals().remove(contact); signalEditorSelectionChanged(); ...
2
public static void main(String[] args) { // TODO code application logic here Menu menu = new Menu(); menu.setVisible(true); }
0
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final CreateObjectRequest other = (CreateObjectRequest) obj; if (listOfInitialValues ...
9
public Registration readClass (Input input) { int classID = input.readInt(true); switch (classID) { case Kryo.NULL: if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Read", null); return null; case NAME + 2: // Offset for NAME and NULL. return readName(input); } if (classID == memoizedClassId) ret...
8
public int pit2(Block set, Material m, BlockFace bf) { int x = 1; int a = gen.nextInt(30); if (a < 12) { a = 12; } while (x < a) { int newx = x - 1; Block otherset = set.getRelative(bf, newx); Block clr10 = otherset.getRelative(BlockFace.DOWN, 1); Block clr20 = others...
9
public synchronized static void deleteBlob(String fullPath) { String blobName = FileFunctions.getRelativePath(fullPath); if (blobName.contains("\\")) { blobName = blobName.replace("\\", "/"); } System.out.println("Blob is " + blobName); try { CloudStorageAccount storageAccount = CloudStorageAccount ...
3
public String stringApiValue() { StringBuffer buf = new StringBuffer(bytes.length*4); buf.append( "(read-from-string \"#("); for (int i = 0; i < bytes.length; i++) { buf.append( ' '); int value = bytes[i]; if (value < 0) { value += 256; } buf.append( v...
2
public String toString(){ String ss = ""; ss = ss + this.coeffCopy(0).toString(); if(this.deg>0)ss = ss + " + (" + this.coeffCopy(1).toString() + ").x"; for(int i=2; i<=this.deg; i++){ ss = ss + " + (" + this.coeffCopy(i).toString() + ...
2
public void setBtn_Std_Font(String font) { if ((font == null) || font.equals("")) { this.buttonStdFont = UIFontInits.STDBUTTON.getFont(); } else { this.buttonStdFont = font; } somethingChanged(); }
2
private static boolean isSpatialMaxima(double[][] hmap, int x, int y) { int n = 8; int[] dx = new int[] { -1, 0, 1, 1, 1, 0, -1, -1 }; int[] dy = new int[] { -1, -1, -1, 0, 1, 1, 1, 0 }; double w = hmap[x][y]; for (int i = 0; i < n; i++) { double wk = hmap[x + dx[i]][y + dy[i]]; if (wk >= w) return ...
2
public static short getAgeClass1(int age) { if (age < 16) { return 0; } if (age < 20) { return 16; } if (age < 25) { return 20; } if (age < 30) { return 25; } if (age < 45) { return 30; ...
9
private final short method683(int i, int i_97_, long l, int i_98_, Model class124, int i_99_, float f, int i_100_, int i_101_, float f_102_) { try { anInt5599++; int i_103_ = anIntArray5528[i_101_]; int i_104_ = anIntArray5528[1 + i_101_]; int i_105_ = i_100_; for (int i_106_ = i_1...
5
@Override public void start(Stage stage) throws Exception { AnchorPane main = FXMLLoader.load(PosApplication.class.getResource("main.fxml")); stage.setTitle("みせっこくちない専用POSシステム"); stage.setScene(new Scene(main, 800, 600)); stage.show(); }
0
public void paintComponent(Graphics g) { if (getCreator().automaton.getEnvironmentFrame() !=null) if (!((AutomatonEnvironment)(getCreator().automaton.getEnvironmentFrame().getEnvironment())).shouldPaint()) return; // EDebug.print(Thread.currentThread().getName()); super.paintComponent(g); toolbar.drawTool(...
2
public void setProtocol(FileProtocol protocol) { this.protocol = protocol; setText(protocol.getName()); }
0
public FieldPanel(DataStore datastore) { super(); addComponentListener(new ComponentAdapter() { @Override public void componentShown(ComponentEvent e) { fields = ds.getFields(); classtypes = ds.getTypes(); } @Override public void componentHidden(ComponentEvent e) { ds.setFields(field...
8
private List<String> cleanOfNotPossibleKeywords(List<String> possibleKeywords) { LinkedList<String> result = new LinkedList<String>(); LinkedList<String> finalResult = new LinkedList<String>(); for(int i = 0; i < possibleKeywords.size(); i++) { if(possibleKeywords.get(i).matches(".*;.*;[0-9]+...
5
private void processKilnExchange(int componentId, int packetId) { int itemId = StealingCreation.SACRED_CLAY[index]; int amount = 0; if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET) amount = 1; else if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) amount = 5; else if (packetId == Worl...
7
public Vector<Card> whichCardsShouldISwap() { /** Here we calculate the possible difference in rank for swapping * 1,2 or 3 cards. The double returns the effect on rank of the current * hand for making the specified number of changes */ if (current...
5
private void showMessage(String typeMessage, String text, String title){ if(typeMessage.equals("error")){ JOptionPane.showMessageDialog(this, text, title,JOptionPane.ERROR_MESSAGE); } if(typeMessage.equals("info")){ JOptionPane.showMessageDialog(this, text, title,JOptionP...
2
public void mouseReleased(MouseEvent e) { mouseReleasedX = e.getX(); if(mouseDragged) { mousePressed = mousePressedX; mouseReleased = mouseReleasedX; if (mousePressed > mouseReleased)//selected right to left { int temp = mousePressed; mousePressed...
4
public void dbConnect(String db_connect_string, String db_userid, String db_password) { try { Class.forName("net.sourceforge.jtds.jdbc.Driver"); Connection conn = DriverManager.getConnection(db_connect_string, db_userid, db_password); System.out.printl...
2
public static void main(String[] args) { Image[] input = {new IR(), new IR(), new LS(), new IR(), new LS(), new LS()}; Processor[] procs = {new Processor(), new Processor(), new Processor()}; for (int i = 0, j; i < input.length; ++i) { j = 0; while (!procs[j].handle(input...
2
public void connect(TreeLinkNode root) { if(root==null) { return; } if(root.left != null && root.right !=null) { root.left.next = root.right; } if(root.next!=null) { TreeLinkNode left, right=null; left = root.right==null?root.left...
9
public void update(final Protocol update) { switch(update.command) { case USERSINROOM: SwingUtilities.invokeLater(new Runnable() { @Override public void run() { String room = update.textField; synchronized(messagePane) { int tabIndex = messagePane.indexOfTab(room); if (tabIndex != ...
9
public InformationLine(String[] line, Headline headline) throws EndOfCSVFileException, BrokenCSVFileException { if (line == null) { throw new EndOfCSVFileException("CSV File completely parsed"); } if (headline == null) { throw new BrokenCSVFileException("The given headline was null"); } if (line.leng...
4
@Override public void manageInput(InputEvent e) { if (e.isKeyInput()) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) Launcher.exit(); } for (Item m : menuItems) { m.manageInput(e); } }
3
public void setAvalie(PExp node) { if(this._avalie_ != null) { this._avalie_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
3
public void close() { try { if (read != null) read.close(); if (write != null) write.close(); } catch (IOException e) { e.printStackTrace(); } }
3
@Test public void testGenerate() { byte[] key = ByteHelper.convertBinaryStringToByteArray("00010011 00110100 01010111 01111001 10011011 10111100 11011111 11110001".replace(" ", "")); String[] expectedSubKeysStrings = new String[] { "000110 110000 001011 101111 111111 000111 000001 ...
1
@Override public void allocate(JobMetaData job) { if (job.getNumFiles() < CUTOFF) { // We dont split so just use the regular allocator IAllocator onejob = new JobPerVMAllocator(pool, monitor); onejob.allocate(job); } else { int vmsneeded = 3; ArrayList<SlaveVM> vms = pool.requestVMs(vmsneeded); A...
3
public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new FileReader("stamps.in")); PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("stamps.out"))); int n, k; int[] coins; StringTokenizer st = new StringTokenizer(f.readLine()); k = Integer.pars...
8
public void damage(int amt) { if (health > MAX_HEALTH) health = MAX_HEALTH; health -= amt; System.out.println(health); if (health <= 0) { MainComponent.isRunning = false; System.out.println("GAME OVER!"); } }
2
public void physics( PhysicObject object, float delta ) { PhysicalProperties properties = object.getPhysicalProperties(); if ( properties.getFloat( "gravity" ) != 0 ) { float gravity = (float) Math.sqrt( ( 2 * properties.getFloat( "mass" ) * NEWTON ) / ( AIR_DENSITY * properties.getFloat( "surface" ) * prope...
3
private void changeTrack(int x){ int tempBid=(x-10)/70; System.out.println("Dans ChangeTrack : temp ="+tempBid); if(selectedBid==tempBid){//cancel the selected bid selectedBid=-1; }else if(selectedBid==-1 && tempBid<bidding.getTrack().length){ //select a family selectedBid=tempBid; }else if(tempBid<bidd...
5
public Set keySet() { return map.keySet(); }//keySet
0
private long readNumber ( int db, int l ) { long r = 0, b = 1; int q=0; RandomAccessFile f = ( db==0 ? fdbf : db==1 ? ffpt : fcdx ); byte[] g = new byte[l]; try { f.read(g); } catch (IOException e) { e.printStackTrace(); } if(db>0 && l>1) b<<=((l-1)<<3); for(int i=0;i<l;i++) { q = g[i]; if(q<0...
8
private DisplayMode findDisplayModeInternal(DisplayMode[] displayModes, int requestedWidth, int requestedHeight, int requestedDepth, int requestedRefreshRate) { DisplayMode displayModeToUse = null; for (int i = 0; i < displayModes.length; i++) { DisplayMode displayMode = displayModes[i]; ...
9
public static void sumNegativeBalances() { // External iteration BigInteger total = BigInteger.ZERO; for (BankAccount account: christmasBank.getAllAccounts()) if (account.getBalance().signum() < 0) total = total.add(account.getBalance()); System.out.println("T...
2
public static void main(String[] args) { if(args.length == 0) { System.err.println("No command input"); System.exit(1); } HashMap<String, String> cmd; try { //SETUP PHASE MFESetup setup= new MFESetup(); cmd= setup.getCommands(); if(cmd.isEmpty()) { System.err.println("No command...
6
private void startCut() { btnPause17.setEnabled(true); btnFinish18.setEnabled(true); try { txtStartTime17.setText(jodaTimeFormat.print(startTime)); startTime = jodaTimeFormat.parseDateTime(txtStartTime17.getText()); GregorianC...
7
private void toggleShowOutPut() { this.showOutput = !this.showOutput; if (this.showOutput) { this.panel_1.add(txtrResultats); this.lblConsole.setText("vvv Console :"); } else { this.panel_1.remove(txtrResultats); this.lblConsole.setText(">>> Console :"); } }
1
private void makeDirs(final String key) throws IOException { if (dirs == null) { dirs = new HashSet(); } int idx = 0; int last = 0; while ((last = key.indexOf('/', idx + 1)) != -1) { final String aDir = key.substring(0, last + 1); if (!dirs.contains(aDir)) { dirs.add(aDir); this.putNextEntry(...
3
public void codeProcess() { if (!player.isFreezed) { // atualizar x e y da classe Robo para o user usar Proto.x = (int) (player.x / 50) + 1; Proto.y = (int) (player.y / 50) + 2; //System.out.println("Coordenadas do Robo: [" + Robo.x + ", " + Robo.y + ...
9
public void shutdown() { interrupt(); socket.close(); }
0
private void moveColumn(Board b, int caller) { int posNr = 0; Position tmp = null; int i, j; int foundPos = -1; i = j = 1; while (i <= b.getWidth()) { j = 1; while (j + 1 <= b.getHeight()) { if (b.isFree(i, j) && b.isFree(i, j + 1)) { b.set(i, j); b.set(i, j + 1); foundPos = pos.sea...
9
@Override public void main() { cleanOutput(); Element[] elements = {new ElementOne(), new ElementTwo(), new ElementThree()}; VisitorOne visOne = new VisitorOne(); VisitorTwo visTwo = new VisitorTwo(); for (Element el : elements) { el.accept(visOne); } for (Element el : elements) { el.ac...
2
public GUIAltaEmpleado(){ final ControlErrores control=new ControlErrores(); this.setTitle("Alta Empleado"); setBounds(100, 100, 500, 400); this.setLocationRelativeTo(null); this.setLayout(new BorderLayout()); ArrayList<Departamento> depts = Factori...
7
public int solution(int[] H) { int blocks = 1; Stack stack = new Stack(H.length); stack.push(H[0]); for (int i = 1; i < H.length; i++) { if (stack.peek() < H[i]) { stack.push(H[i]); //increase of wall height, which adds the need of a new block ...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ReadNode other = (ReadNode) obj; if (prompt == null) { if (other.prompt !...
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Cube cube = (Cube) o; if (permutationId != null ? !permutationId.equals(cube.permutationId) : cube.permutationId != null) return false; ...
9
public static String getStreamID(String streamerName) { for (int i = 0 ; i < streamName.size(); i++) { if (streamName.get(i).equalsIgnoreCase(streamerName)) { return streamList.get(i); } } return null; }
2
public void playersMove(Value player) { boolean fault = true; while (fault) { Scanner in = new Scanner(System.in); System.out.println(player + ": Введите число от 1 до " + field.sizeField); try { int x = in.nextInt()-1; int y = in.nextI...
3
public static StorageNodeMetadata getNode(int key){ StorageNodeMetadata nodeMeta; int hashKey = key % moduloRange; if (storageNodes.isEmpty()) return null; else { nodeMeta = null; int diff = modulo...
7
public void setStatement(Integer i, PreparedStatement stmt, Object stuff) throws SQLException { switch (this.s_to_int(this.campos[i][1])) { case 0: stmt.setInt(i, (Integer) stuff); break; case 1: stmt.setString(i, (S...
5
@SuppressWarnings("unchecked") public List<BEValue> getList() throws InvalidBEncodingException { if (this.value instanceof ArrayList) { return (ArrayList<BEValue>)this.value; } else { throw new InvalidBEncodingException("Excepted List<BEvalue> !"); } }
1
public PhasorMatrix subarray_as_Phasor_rowMatrix(int start, int end){ if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1)); Phasor[] pp = this.getArray_as_Phasor(); Phasor[] retArray = new Phasor[end-start+1]; f...
2
public static void main(String[] args) { Set<String> digits = permutate("0123456789"); Set<Long> total = new HashSet<>(); for (String s : digits) { if (getDigits(s, 2) % 2 != 0) continue; if (getDigits(s, 3) % 3 != 0) continue; if (getDigits(s, 4) % 5 != 0) c...
8
public Class getObjectClass() { if (_wrapperObject instanceof Boolean) return boolean.class; else if (_wrapperObject instanceof Integer) return int.class; else if (_wrapperObject instanceof Float) return float.class; else if (_wrapperObject instanceof Double) return double.class; else if (_wrap...
8
public void update() { up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W]; down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S]; left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A]; right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D]; }
4
public void updatePanel() { repaint(); }
0
public void setUserlistImageOverlay_Width(int width) { if (width <= 0) { this.userlistImgOverlay_Width = UISizeInits.USERLIST_IMAGEOVERLAY.getWidth(); } else { this.userlistImgOverlay_Width = width; } somethingChanged(); }
1
public static void main(String[] args){ try{ TestClass to = new TestClass(); String s = to.toString(); System.out.println(s); registerEvents(); Class<?> c = MyJsonUtils.findClass("TestClass"); System.out.println(c); for(Class<?> cl: ClassFinder.find("bluefrost.serializable.objects.v1.json")){...
4
private static String getDay(Calendar c) { int day = c.get(Calendar.DAY_OF_WEEK); switch (day) { case 1: return "Sunday"; case 2: return "Monday"; case 3: return "Tuesday"; case 4: return "Wednesday"; case 5: return "Thursday"; case 6: return "Friday"; case 7: retur...
7