text
stringlengths
14
410k
label
int32
0
9
@Override public void printBPB(javax.swing.JTextArea a, javax.swing.JTextArea b) { b.append("\t\t 0\t 1\t 2\t 3\t 4\t 5\t 6\t 7\t\t 8\t 9\t A\t B\t C\t D\t E\t F"); for (i = 0; i < bytes_per_Sector; i++) { if (i % 16 == 0) { b.append(String.format("\n%07X0\t", address++))...
6
public CheckExit() { super("Are you sure?"); this.setResizable(false); this.setLayout(new BorderLayout()); JLabel label=new JLabel("Do you really want to exit?"); label.setHorizontalAlignment(SwingConstants.CENTER); this.add(label, BorderLayout.CENTER); JPanel yesNo = new JPanel(); yesNo.setLayout(new FlowLayou...
0
public void run() { while (true) { try { //get the data from the client byte[] receivedData = new byte[1024]; DatagramPacket receivePacket = new DatagramPacket(receivedData, receivedData.length); datagramSocket.receive(receivePacket); ...
5
public static void printFields(Class<?> c){ display2.append("フィールド\r\n"); Field[] declaredfields = c.getDeclaredFields(); Field[] fields = c.getFields(); ArrayList<Field> fieldList = new ArrayList<Field>(fields.length); for(int i = 0; i < fields.length; i++){ fieldList.add(fields[i]); } for(int i = 0;...
5
public void setRectXOR(int[] buffer, CPRect rect) { CPRect r = new CPRect(0, 0, width, height); r.clip(rect); int w = r.getWidth(); int h = r.getHeight(); for (int j = 0; j < h; j++) { for (int i = 0; i < w; i++) { data[(j + r.top) * width + i + r.left] = data[(j + r.top) * width + i + r.left] ^ buffe...
2
public boolean execute(CommandSender sender, String[] args) { if (!(sender instanceof ConsoleCommandSender)) { return true; } String command = args[0]; if (command.equalsIgnoreCase("getconfig")) { return GetConfig((ConsoleCommandSender)sender, args); } els...
6
private void shutdown(){ // Escribo archivo pozos if(!getNombreArchivoPozos().equals("")){ escribirArchivoPozos(); } // Escribo archivo multilang if(!getNombreArchivoMultilang().equals("")){ escribirArchivoMultilang(); } imprimirDebug("Link...
8
protected static String getLine() throws IOException{ String input; if (replayIn != null && controlInput) { // get a packet from the replay input file Packet line; try { line = getPacket(); } catch (CorruptPacketException e) { throw new ReplayException("Error while reading replay file"); } ...
7
@Test public void testNonExistingClass() throws Exception { PersistenceManager pm = new PersistenceManager(driver, database, login, password); // drop all tables pm.dropTable(Object.class); pm.close(); pm = new PersistenceManager(driver, database, login, password); // test deleting object of non-existing...
2
private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); for (PropertyChangeListener l : getPropertyChangeListeners()) { if (l instanceof Serializable) { s.writeObject(l); } } for (VetoableChangeListener l : get...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SpeciesReference other = (SpeciesReference) obj; if (species == null) { if (other.species != null) return false; } else if (!species.equ...
6
public Room getStep(String direction){ Room locRoom = (Room) getLoc(); Map map = getWorld().getMap(); Cell locCell = map.getCell(locRoom); int x = locCell.getX(); int y = locCell.getY(); int z = locCell.getZ(); switch (direction){ cas...
7
public boolean clickContinue() { final Component component = getContinue(); if (!component.valid()) { return false; } if (component.valid() && ((Random.nextBoolean() && component.contains(ctx.input.getLocation()) && ctx.input.click(true)) || component.click())) { if (Condition.wait(new Callable<Boole...
7
private static void zipSingleFile(ZipOutputStream out, File file, String entryName, WithProgressAdapter progress, Progress zipProgress) throws ZipException, IOException { ZipEntry entry = new ZipEntry(entryName); if (file.isDirectory()) { entryName += "/"; out.putNextEntry(entry); out.closeEntry(); for ...
7
public void print() { for (int i = 0; i < id.length; i++) { System.out.print(id[i] + " "); } System.out.println(); }
1
private boolean zzRefill() throws java.io.IOException { /* first: make room (if you can) */ if (zzStartRead > 0) { System.arraycopy(zzBuffer, zzStartRead, zzBuffer, 0, zzEndRead-zzStartRead); /* translate stored positions */ zzEndRead-= zzStartRe...
3
public static boolean checkLibrary(Library library) throws ModelingException { for(String elementName : library.library.keySet()) { Element element = library.library.get(elementName); if(!element.check()) { throw new ModelingException(0x50, elementName); } ...
2
public static CarListJsonConverter getInstance() { return instance; }
0
@Override public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if (s==Return) { MenuHandler.CloseMenu(); } else if (s==Prev) { Game.edit.ChangePlayer(false); } else if (s==Next) { Game.edit.ChangePlayer(true); } for (int i = 0; i < Game.displayU.size(); i++) { if (s==Units[...
9
public void showDebugGrid(boolean draw) { if(draw == true) { DRAW_DEBUG_GRID = true; } else { DRAW_DEBUG_GRID = false; } }
1
void parseDocument() throws DaoException { try { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = null; parser = factory.newSAXParser(); if (file != null) { parser.parse(file, this); } } catch (Exception e) { if (log.isEnabledFor(Level.ERROR)) { log.error(e); ...
3
@Override public boolean validateAndStartScriptExecutable(ScriptExecutable pScriptExecutable, int pStatementSequence) { if(pScriptExecutable instanceof ScriptSQL && isRerun()){ try { ScriptSQL lSQL = (ScriptSQL) pScriptExecutable; boolean lRunAllowed = validateScriptExecutable(lSQL); ...
3
private void setCell(int c, int x, int y, BufferedImage myBoard) { Point pos = window.getPos(x, y);new Point(x, y); if(Color.isBlue(c) && Color.isOne(pos, myBoard)) { //Cell is 1 board[x][y] = 1; } else if(Color.isTwo(pos, myBoard)) { //Cell is 2 board[x][y] = 2; } else if(Color.isTh...
6
public int longestConsecutive(int[] num) { if (num == null || num.length == 0) return 0; if (num.length == 1) return 1; HashMap<Integer, Boundary> map = new HashMap<Integer, Boundary>(); int maxlen = 0; for (int i = 0; i < num.length; i++) { if...
9
@Override public void run() { List<File> rawFiles = null; Processor processor = null; while (true) { if (null != (rawFiles = rawEntityStore.getRawFiles())) { for (File file : rawFiles) { processor = new EmployeeProcessor(file); if (null != processor.getEntityList()) { PoolExecutor.addProce...
5
public User getUser() { return user; }
0
private void display_list_content(myDataList myLink_list) { data my_Data; for (int i = 0; i < myLink_list.size(); i++) { my_Data = ((data) myLink_list.get(i)); System.out.println(my_Data.getChar() + " " + my_Data.get_probability() + " " + my_Data.isFlag() + " " ...
1
public synchronized boolean stopped() { debug("Route.stopped() returning " + stopped); return stopped; }
0
public void insertSupplierData(order tempOrder) throws SQLException{ try { databaseConnector = myConnector.getConnection(); SQLQuery = "INSERT INTO familydoctor.order "+"VALUES(?,?,?,?,?)"; PreparedStatement preparedStatement = dat...
3
boolean isReference(String ent) { if (!(ent.charAt(0) == '&') || !ent.endsWith(";")) { return false; } if (ent.charAt(1) == '#') { if (ent.charAt(2) == 'x') { try { // CheckStyle:MagicNumber OFF Integer.parseInt(ent.substring(3, ent.length() - 1), HEX); // CheckStyle:MagicNum...
8
private void notifyListeners(final CycLeaseManagerReason cycLeaseManagerReason) { //// Preconditions assert cycLeaseManagerReason != null : "cycLeaseManagerReason must not be null"; assert listeners != null : "listeners must not be null"; assert cycAccess != null : "cycAccess must not be null"; if (...
4
public static void main(String[] args) throws Exception { ChessMan a = new ChessMan(1); ChessMan b = new ChessMan(2); ChessMan c = new ChessMan(3); ChessMan d = new ChessMan(4); ChessMan e = new ChessMan(5); ChessMan f = new ChessMan(6); List<ChessMan> list= new ArrayList<ChessMan>(); list.add(a); lis...
7
private void updateTableColor(Thread t, int index) { switch (t.getState().toString()) { case "NEW": colors.set(index, Color.GREEN); break; case "RUNNABLE": colors.set(index, Color.CYAN); break; case "BLOCKED": colors.set(index, Color.RED); break; case "WAITING": colors.set(index, Color.YE...
6
@Override public int loop() { if(startscript) { if(task == null || !task.hasNext()) { task = container.iterator(); } else { final Node curr = task.next(); if(curr.activate()) { curr.execute(); } } ...
4
public int algorithm(List<Integer> L, int k, Callback iteration, Callback comparison){ int pivot = L.get(r.nextInt(L.size())); iteration.callback(0); ArrayList<Integer> l1 = new ArrayList<Integer>(); ArrayList<Integer> l2 = new ArrayList<Integer>(); for(int element : L){ ...
5
@Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : ""; if((mob.isAttributeSet(MOB.Attrib.AUTOMAP) && (parm.length()==0))||(parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB.Attr...
8
private void addType(final Type type) { if (type.isMethod()) { // Add all of the types of the parameters and the return type final Type[] paramTypes = type.paramTypes(); for (int i = 0; i < paramTypes.length; i++) { // db("typeref " + type + " -> " + paramTypes[i]); addType(paramTypes[i]); } ...
6
protected void addRandomNucleotide() { double dr = 4 * Math.random(); Nucleotide nn = null; if (dr >= 0 && dr < 1) nn = Nucleotide.ADENINE; else if (dr >= 1 && dr < 2) nn = Nucleotide.GUANINE; else if (dr >= 2 && dr < 3) nn = Nucleotide.CYTOSINE; else if (dr >= 3 && dr < 4) nn = Nucleotide.URACI...
8
public void fixCamera() { if (fc_yaw >= 360) { fc_yaw -= 360; } if (fc_yaw < 0) { fc_yaw += 360; } if (fc_pitch < -75) { fc_pitch = -75; } if (fc_pitch > -10) { fc_pitch = -10; } }
4
@Override public Iterable<ExtendedAttribute> listExtendedAttributes(String path) throws PathNotFoundException, AccessDeniedException, UnsupportedFeatureException { if (extendedAttributes) { try { String[] lines = FileSystemUtils.readLines(attributeFs, getAttributePath(path)); List<ExtendedAttribu...
8
public static void main(String[] args) throws Exception{ SOP("==========Chapter 9 Recursion And Dynamic Programming==="); SOP("To run: java c9 [function name] [function arguments]"); SOP("Example: java c9 fib 10"); SOP(""); SOP("Possible functions:"); SOP("fib\tCompute nth fibo...
9
@Override public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) { if (getWidth() <= 0 && (infoflags & WIDTH) != 0) { // The image's width has been finalized. setWidth(width); } if (getHeight() <= 0 && (infoflags & HEIGHT) != 0) { // The image's height has been fina...
5
public Animator getAnimator() { if (_painter == null) { throw new IllegalStateException(); } Animator returnValue = new SwingAnimator(_painter, "Traffic Simulator", VP.displayWidth, VP.displayHeight, VP.displayDelay); _painter = null; return returnValue; }
1
@Override public boolean equals(Object obj) { if (obj instanceof Command) { Command cmd = (Command) obj; if (this.thrust == cmd.getThrustCommand()) { if (this.direction == cmd.getDirectionCommand()) { if (this.speed == cmd.getSpeedCommand()) { ...
5
public float getWidth(char code, String name) { int idx = (code & 0xff) - getFirstChar(); // make sure we're in range if (idx < 0 || widths == null || idx >= widths.length) { // try to get the missing width from the font descriptor if (getDescriptor() != null) { ...
4
@Override public void run() { if (ctx.bank.opened() && ctx.bank.close()) { if (!Condition.wait(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return !ctx.bank.opened(); } }, Random.nextInt(100, 200), 15)) { return; } } final Item potion = ItemHelper.ge...
6
public BaseDO update(final BaseDO baseDO) { return getEntityManager().merge(baseDO); }
0
public void close() throws IOException { if (DEBUG) { dbg.printf("%s closed%n", this); } out.close(); try { eth.join(); if (DEBUG) { dbg.printf("%s joined %s%n", this, eth); } } ...
4
public void doDelimitedFileExportToExcel() { try { final String mapping = ConsoleMenu.getString("Mapping ", DelimitedFileExportToExcel.getDefaultMapping()); final String data = ConsoleMenu.getString("Data ", DelimitedFileExportToExcel.getDefaultDataFile()); DelimitedFileExp...
1
public static Persist getPersist() { return new Persist(getConnection()); }
0
public int FindHighestPrec(LinkedList<Element> linkedList, int startPos, int endPos) { int elmWithHighPrec = startPos; int highestPrec = 8; int currPos = startPos; int parenMatcher = 0; Element currObj; Operator currOp = new Operator(); currObj = (Element) list.get(currPos); for (currPos = startP...
9
public SimpleStringProperty lastNameProperty() { return lastName; }
0
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((majorVersion == null) ? 0 : majorVersion.hashCode()); result = prime * result + ((minorVersion == null) ? 0 : minorVersion.hashCode()); result = prime * result + ((version == null) ? 0 : version.hashCo...
3
void highlightGuide(Integer pos, Color color, int offset) { if (pos == null) { if (guide[offset] != null) { removeFeedback(guide[offset]); guide[offset] = null; } location[offset] = pos; return; } // pos is an integer relative to target's client area. // translate pos to absolute, and then ...
8
public int getMinMaand(int jaar) { int maand = 12; // Itereer de datasets for (DataSet set: this.datasets) { for (Category cat: set.categories) { for (SubCategory scat: cat.subcategories) { SubCategory subcat = new SubCategory(scat.id, scat.naam, scat.datatype, s...
6
static int findColumn(TableModel model, String name) { for (int i = 0; i<model.getColumnCount(); i++) { if (name.equals(model.getColumnName(i))) { return i; } } return -1; }
2
public void searchByBookTitle (LYNXsys system, String query, int page) { // search for books by Title for (int i = 0; i < system.getBooks().size(); i ++) { // loop through arraylist of books if (system.getBooks().get(i).getTitle().equalsIgnoreCase(query)){ // check if book title matches search query displayedS...
6
@Override public boolean contains(Object o) { if (o != null) { int i = index(o.hashCode()); synchronized (table[i]) { Node<E> c = table[i].next; while (c != null) { if (c.element == o || c.element.equals(o)) { return true; } c = c.next; } } } return false; }
4
public void paintComponent(Graphics g){ for(int x = 0; x < 500; x += 50){ for(int y = 0; y < 500; y += 50){ g.setColor(Color.WHITE); g.fillRect(x, y, 50, 50); g.setColor(Color.BLACK); g.drawLine(x, y, x + 50, y); g.drawLine(x, y, x, y + 50); if(player.xPos == x/50 && player.yPos == y/50...
5
@Override public MarkovChain constructChain() throws Exception { // @debug sampleValueIndices = new ArrayList<>(); MarkovChain mcResultante = new MarkovChain(stats); transitionResultante = new double[stats.length][stats.length]; MarkovChain mcSimulation = new MarkovChain(s...
7
public InputStream send() { //Prepare parameters prepare(); try { HttpURLConnection con = prepareConnection(new URL(String.format(URL_FORMAT, this.url, this.parameters))); int responseCode = con.getResponseCode(); String responseMessage = con.getResponseMessage(); if (responseCode == HttpURLConn...
5
public static JScanner getInstance(Component component) { Container parent = component.getParent(); if (parent instanceof JPopupMenu) return getInstance(((JPopupMenu) parent).getInvoker()); while (parent != null) { if (parent instanceof JScanner) return (JScanner) parent; parent = parent.getParent();...
3
public static TopQueue search(String target, String dictFile) throws IOException { BufferedReader reader; reader = new BufferedReader(new FileReader(dictFile)); TopQueue topQueue = new TopQueue(); String word; int distance; while((word = reader.readLine()) != null) ...
3
public void keyPressed(KeyEvent e) { System.out.println("KeyPressed "+e.getKeyCode()); try { switch (e.getKeyCode()) { case KeyEvent.VK_UP : { System.out.println("UP"); model.move(Directions.UP, score); ...
5
public double[] evaluateNeuralNetwork(double[] inputVector){ ArrayList<Node> inputLayer = networkLayers.get(0).getNodes(); ArrayList<Node> outputLayer = networkLayers.get(networkLayers.size()-1).getNodes(); //If the input vector is not of the same size as the input layer return null. if(...
5
public void mouseDragged(MouseEvent event) { return; }
0
public void update() { List<Zombie> zombies = house.zombieList; Rectangle2D box; int x, y, width, height; charactersGraphics.clearRect(0, 0, characters.getWidth(), characters.getHeight()); backgroundGraphics.setColor(Color.BLUE); for (Tile t : house.tileList) { x = (int) t.getX() * 50; ...
2
public static void main(String[] args) throws Exception { new HelloWorldOGL().loop(); }
0
public Flooder(String host) throws java.net.UnknownHostException, java.net.SocketException { t = new Thread((Runnable) this); this.host = InetAddress.getByName(host); sock = new DatagramSocket(); stop = false; //t.start(); }
0
public void updatePlayer() { if (userRace.equalsIgnoreCase("human")) user = new Human(this, userName, null, -1); else if (userRace.equalsIgnoreCase("cyborg") && userColor.equalsIgnoreCase("purple")) user = new Cyborg(this, "purple", userName, null, -1); else if (userRace.equalsIgnoreCase("cyborg") && userCo...
8
public static ArrayList<bDefeito> getDefeitos(String arg_serial) throws SQLException, ClassNotFoundException { ArrayList<bDefeito> sts = new ArrayList<bDefeito>(); bDefeito bObj; ResultSet rs; Connection conPol = conMgr.getConnection("PD"); if (conPol == null) { throw...
3
public HalfEdge findEdge (Vertex vt, Vertex vh) { HalfEdge he = he0; do { if (he.head() == vh && he.tail() == vt) { return he; } he = he.next; } while (he != he0); return null; }
3
void buttonClicked(final String answer) { state.setPictureChanged(false); state.setResultFromButton(true); List<String> currentRightAnswers = state.getRightAnswers(); //если верно: увеличиваем счет и показывем картинку. если неверно: уменьшаем счет if (currentRightAnswers.contain...
3
public static boolean rectIntersection(CvRect rect1, CvRect rect2) { if (rect1.isNull() || rect2.isNull() || rect1.width() <= 0 || rect1.height() <= 0 || rect2.width() <= 0 || rect2.height() <= 0) { return false; } int x0 = rect1.x(); int y0 = ...
9
public String status() { return "#" + id + "(" + (countDown > 0 ? countDown : "Liftoff!") + "), "; }
1
public static void set_connect(_YM2151 chip,int op_offset, int v, int cha) { OscilRec om1 = chip.Oscils[op_offset]; OscilRec om2 = chip.Oscils[op_offset+8]; OscilRec oc1 = chip.Oscils[op_offset+16]; /*OscilRec *oc2 = om1+24;*/ /*oc2->connect = &chanout[cha];*/ /* set connect al...
8
public void outputAllGameScreenStatistics() { for (GameScreen gameScreen : gameScreens.values()) { logger.info(gameScreen.toString()); } }
1
public static void getStrings(String... text) { for(String s:text) { System.out.println(s); } }
1
@Override public Screen respondToInput(KeyEvent key) { switch (key.getKeyCode()) { case KeyEvent.VK_1: return new LoadGameScreen(slot, 1); case KeyEvent.VK_2: return new LoadGameScreen(slot, 2); case KeyEvent.VK_3: return new LoadGameScreen(slot, 3); case KeyEvent.VK_4: return new LoadGameScreen(...
6
public static float getMaxDestToRad() { return MaxDestToRad; }
0
public void remover(long id) throws Exception { String sql = "DELETE FROM Pesquisacolaboradores WHERE id1 = ?"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); stmt.setLong(1, id); } catch (SQLException e) { throw e; } }
1
public void setHTML(String html, String base_url) { Graphics2D graphics = (Graphics2D) xhtml_panel.getGraphics(); // graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, Joculus.settin...
1
public static boolean isUpdated(ClassNode cached, String jarLink) { try { URL url = new URL("jar:"+jarLink+"!/"); JarURLConnection conn = (JarURLConnection)url.openConnection(); conn.setDoOutput(true); JarFile jar = conn.getJarFile(); Enumeration<?> en...
5
private int muokkaaTuote(ArrayList<Tilausrivi> tilausrivit, String action) throws IOException { // otetaan tuoteID irti valuesta int tilausriviNumero = Integer.parseInt(action.substring(5)); // etsitään tuote tilausriveistä ja asetetaan tuoteID url:n parametriksi int numero = 0; for (int i = 0; i < til...
2
public synchronized void deposer(Site n) { // Compteur du nombre de personnes descendues pour le print. int cpt = 0; for (int i = 0; i < tfest.length; i++) { if ((tfest[i] != null) && (n.equals(tfest[i].destination))){ cpt++; // On "reveille" le festivalier tfest[i].setStop(true); delFestiv...
5
public void fire_shot(double v, double angle, double height, int team) { double i=0.0, x=0.0, y=1.0, vx, vy, maxY=0.0, a=0.0; final int fixed_angle = 100; mydata.clear(); vx = v * (Math.cos(angle * (3.1416 / 180))); vy = v * (Math.sin(angle * (3.1416 /...
9
public void updatePos(){ xspeed += xacc / speedDivider; yspeed += (yacc + gravity) / speedDivider; xspeed *= friction; yspeed *= friction; x += xspeed; y += yspeed; if(x < 0){ x = 0; xspeed = -xspeed * elasticity; ballColour = n...
9
public static boolean isTokenDelimiter(int c) { switch (c) { case 'ä': case 'ö': case 'ü': case 'ß': case 'Ö': case 'Ä': case 'Ü': return false; } return c < 10 || c > 126 || DELIMITER_TOKEN.cont...
9
private void addSchema(Document doc) throws IOException, XPathExpressionException { if(doc != null) { Node srcSchemaNode = Utilities.selectSingleNode(doc, "/xsd:schema", this.namespaces); String name = Utilities.getAttributeValue(srcSchemaNode, "targetNamespace"); if(!this.schemas.containsKey(name)) { ...
2
public void calculcate() { Rectangle r = this.getBounds(); float width = (float) r.getWidth(); float height = (float) r.getHeight(); // System.out.println("Width : " + width + " Height : " + height); float xScale = width / (bX + sX); float yScale = height / (bY + sY); scale = 0.0F; if (xScale > yScal...
3
public XmlNode CreateReplica(XmlNode parent, XmlNode node, String name) { if (parent == null || node == null || name == null) return null; XmlNode replicanode = new XmlNode(XmlNodeType.REPLICA, name); parent.addChild(replicanode); String path = tree.getPath(replicanode, node); replicanode.setAttribu...
3
public static void right() { if(viewX + 100 < WIDTH - 100) { viewX += 1; } }
1
public static PeerID generateMagic() throws java.security.NoSuchAlgorithmException { boolean notFound = true; Random random = new Random(System.currentTimeMillis()); byte[] peerid = new byte[20]; int tries = 0; while (notFound) { tries++; random.nextBytes(peerid); notFound = isMagic(peerid); } ...
1
public static void paint(Ocean sea) { if (sea != null) { int width = sea.width(); int height = sea.height(); /* Draw the ocean. */ for (int x = 0; x < width + 2; x++) { System.out.print("-"); } System.out.println(); for (int y = 0; y < height; y++) { System...
7
public void addFile(String directory) throws IOException { Path path = Paths.get(directory); String ZipDirectory = path.getFileName().toString(); zipEntry = new ZipEntry(ZipDirectory); byte[] buffer = new byte[1024]; int bytesRead=0; CRC32 crc = new CRC32(); ...
3
private void sendMessageToChat_Lobby() { // TODO Auto-generated meth od stub String message = lobby.fetchJTextValue("lobbyChat_message"); String result = sendMessageToSomeSocket(ChatSocketServer.MESSAGE, ",message=" + message, chatSocket); if (result.contains(ChatSocketServer.MESSAGE_RECEIVED)) { updateC...
1
public void deleteAuthHeaderByToken(String token){ Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConnection(dbCon.getDATABASE_URL(), ...
4
public void enviarPecasParaJogador(Socket[] lista,int player) throws Exception{ for(int i =0;i<player;i++){ DataOutputStream info = new DataOutputStream(lista[i].getOutputStream()); if(player==1){ for(i=0; i<jogo.pecas1.size(); i++){ info.writeByte...
9
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); }...
3
public String toSource(String className) throws Exception { StringBuffer result; int i; result = new StringBuffer(); if (m_ZeroR != null) { result.append(((ZeroR) m_ZeroR).toSource(className)); } else { result.append("class " + className + " {\n"); ...
7