text
stringlengths
14
410k
label
int32
0
9
public synchronized void deleteWay(int pos, long wayId){ if (ways.size()>pos) ways.get(pos).remove(wayId); }
1
public int minDistance(String word1, String word2) { int a = word1.length(); int b = word2.length(); int [][]tem = new int[a+1][b+1]; for (int i=0;i<=a;i++){ tem[i][0] = i; } for (int i=1;i<=b;i++){ tem[0][i] = i; } for (int i = 1;i...
7
public void setPreviewimage(Path image) { try { this.skin.setImage(image); this.skin.setSkinChanged(true); } catch (IOException e) { Main.showProblemMessage(e.getMessage()); } }
1
private static Set<EEnum> getAllEEnumerations(EClass sysmlClass, LinkedHashSet<EEnum> linkedHashSet) { for (EAttribute eAttribute : sysmlClass.getEAllAttributes()) { if (eAttribute.getEType() instanceof EEnum) { EEnum eEnum = (EEnum) eAttribute.getEType(); linkedHashSet.add(eEnum); } } for (ERef...
9
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect =...
9
public void close() { try { this.bufferWriter.close(); } catch (IOException ex) { System.out.println(ex); for (StackTraceElement el : ex.getStackTrace()) { System.out.println(el); } } }
2
public int getNewLineIndex(byte[] bytes, Charset charset) { String firstBytes = new String(bytes, charset); String separator = "\r\n"; int index = firstBytes.indexOf("\r\n"); int indexCR = firstBytes.indexOf("\r"); int indexLF = firstBytes.indexOf("\n"); if (indexCR != -1...
4
private void createTopPanel(){ JPanel topPanel = new JPanel(); topPanel.setOpaque(false); topPanel.setPreferredSize(new Dimension(180, 420)); // fill out inventory label add(Box.createVerticalStrut(50)); slotPanel = new JPanel(); slotPanel.setOpaque(false); slotPanel.setLayout(new FlowLayout(FlowL...
4
protected int readBlock() { blockSize = read(); int n = 0; if (blockSize > 0) { try { int count = 0; while (n < blockSize) { count = in.read(block, n, blockSize - n); if (count == -1) break; n += count; ...
5
public void undoLastMove() { if (moveHistorySokoX.size() > 0 && moveHistorySokoY.size() > 0 && Direction.size() > 0) { if ((Direction.elementAt(Direction.size() - 1) == left)) { undoBaggMove(LEFT_COLLISION); } if ((Direction.elementAt(Direction.size() - 1) == right)) { undoBaggMove(RIGHT_COLL...
7
final public byte[] load(String frameId,int dataLen,RandomAccessFile openFile) throws IOException { offset = new Long(openFile.getFilePointer()); this.frameIdentifier=frameId; this.dataLength=dataLen; return this.load_from_current_position(frameId, dataLen, openFile); }
0
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: String nome, cod, cnpj, desc; nome = txt_nomeforn.getText(); cod = txt_codforn.getText(); cnpj = txt_cnpjforn.getText(); ...
4
public PanelGrille getPanelGrid() { return pnlGrid; }
0
protected void loadPlays(Position position, Player cpu,int largestCapture){ FactoryOfPlays factory = new FactoryOfPlaysForPiece(position,cpu.getBoard()); int bestEvalution=-100; // valore inizializzato a -inf. for(AbstractPlay play:factory){ int evaluation = evaluate(play,cpu,largestCapture); if(evaluation>...
3
public List<GeneratedImage> buildCreatedFiles() throws IOException, InterruptedException { boolean error = false; final List<GeneratedImage> result = new ArrayList<GeneratedImage>(); for (File f : dir.listFiles()) { if (error) { continue; } if (f.isFile() == false) { continue; } if (fileToP...
9
@Test public void testRemover(){ try { facade.remover(1); Assert.assertEquals(facade.listarProdutos().size(), 3); } catch (FacadeException e1) { Assert.fail(e1.getMessage()); } try { facade.remover(5); Assert.fail("devia lanÁa uma execeÁ„o"); } catch (FacadeException e1) { // tem que lanÁa ...
4
public Component getComponent(int r1, int c1, int r2, int c2) { for (Component c : components) { if ( c.getEndPt1().equals(terminals[r1][c1]) && c.getEndPt2().equals(terminals[r2][c2]) || c.getEndPt2().equals(terminals[r1][c1]) && c.getEndPt1().equals(terminals[r2][c2]) ) { ...
5
public double get(int i, int j) { if (0 <= i && 0 <= j && i < s.length && j < s.length) { if (i == j) { return 1.0; } else if (i > j) { return s[i][j]; } else if (i < j) { return s[j][i]; } } return Double.NaN; }
7
private void setOptions(String[] options, int selectedOption) throws IllegalArgumentException { if ((selectedOption < 0) || (selectedOption > options.length - 1)) { throw new IllegalArgumentException("invalid selection"); } if ((options == null) || (options.length == 0)) { throw n...
7
public void zombie(Boolean mode){ if (mode != null){ zombie = mode; }else{ zombie = true; } }
1
public static boolean verificaUsuario(String nome, String senha) throws SQLException{ nome = nome.toUpperCase(); Connection con = null; nomeTabela = "login"; boolean retorno = false; try { con = ConexaoMySQL.getConexaoMySQL(); Statement stmt = con...
4
@Override public void uploadAttendance(Scanner sn) { System.out .println("You can enter attendance from a barcode scanned CSV file"); System.out.println("Please enter the file name"); String csvFile = sn.next(); BufferedReader br = null; String line = ""; String cvsSplitBy = ","; String[] headers; ...
8
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String[] args) { if(!(Commands.isPlayer(sender))) return false; Player p = (Player)sender; String pName = p.getName(); if(args.length != 0) return false; if(PlayerChat.plugin.getConfig().getBoolean("AdminChat.Enabled", true)) {...
3
@Command(cmd = {"ftc", "fairytailcraft", "ft", "fairytail"}, firstArg = {"cast"}) public boolean setCastMagic(CommandSender sender, String cmd, String[] args) { if (sender instanceof Player) { Player sent = (Player) sender; String magic = Util.getPlayerConfig(sent).getMageType();...
7
public void testPropertySetCopyDay() { LocalDateTime test = new LocalDateTime(1972, 6, 9, 10, 20, 30, 40); LocalDateTime copy = test.dayOfMonth().setCopy(12); check(test, 1972, 6, 9, 10, 20, 30, 40); check(copy, 1972, 6, 12, 10, 20, 30, 40); try { test.dayOfM...
2
public int firstMissingPositive(int[] A) { for (int i = 0; i < A.length; i++) { while (A[i] != i + 1 && A[i] > 0 && A[i] <= A.length && A[i] != A[A[i] - 1]) { int temp = A[A[i] - 1]; A[A[i] - 1] = A[i]; A[i] = te...
7
public void load(ResultSet rs) throws Exception{ if(rs.next()){ setPersonID(rs.getInt("personid")); setLastName(rs.getString("lastname")); setFirstName(rs.getString("firstname")); setEmail(rs.getString("email")); setPersonType(rs.getString("persontype"...
2
private static boolean isCollection(Object object) { return (object == null ? false : Collection.class.isAssignableFrom(object.getClass())); }
1
public boolean isInCooldown(UUID uidz) { if (!kewlDowwwwn.containsKey(uidz)) { return false; } else if (kewlDowwwwn.get(uidz) > System.currentTimeMillis()) { return true; } else { kewlDowwwwn.remove(uidz); return false; } ...
2
private void calculateFitness() { for(int i = 0; i < numberOfParticles; i++){ double currentfitness = objectiveFunction.CalculateFitness(positions[i]); if(maximum){ if(currentfitness > fitness.get(i)){ fitness.put(i, currentfitness); updatePersonalBest(i); } }else{ if(currentfitness < f...
4
public Point getFirstpoint() { return firstpoint; }
0
public void setFloatformat(String format) { fformat = (!format.startsWith("%")) ? ('%' + format) : format; }
1
@Override public void endSetup(Attributes atts) { super.endSetup(atts); }
0
public void run() { byte[] buffer = new byte[1024]; try { group = InetAddress.getByName("224.0.0.31"); //Broadcast group on Inet 130.0.0.1 broadcast - client match } catch (UnknownHostException e) { System.err.println("Unknown Host - Reduce error"); e.printStackTrace(); } while(true){ //Continuous Ex...
5
public byte[] parsePacket(byte[] packet) throws IOException { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); // byte[] preamble = new byte[5]; //Always "DATA " byte[] checksum = new byte[16]; byte filenameLength = packet[16]; byte[] filename = new byt...
4
@Override public boolean equals( Object that ) { if ( that == this ) return true; if ( that == null || !getClass().equals( that.getClass() ) ) return false; Row other = (Row) that; return option.equals( other.option ) && description.equals( other.description ...
4
public ItemKey<? extends Box> getSource() { return source; }
1
public boolean isValid() { return isValidGivenName() && isValidSurname() && isValidAddress() && isValidEmail() && isValidAddress() && isValidCountry() && isValidState() && isValidPoscode() && isValidCreditNo(); }
8
public void combine(StatsCollector collector) { Assert.notNull(collector); Assert.isTrue(Math.abs(min - collector.min) < 0.000001); Assert.isTrue(Math.abs(range - collector.range) < 0.000001); Assert.isTrue(numBuckets == collector.numBuckets); instances += collector.instances; mean = ((numObs * mean) + (col...
1
private static List<String> makeIPAddresses(String str, int count) { if (str==null || str.isEmpty()) { return null; } List<String> answer = new ArrayList<>(); if (count==4) { if (Integer.parseInt(str)>255) { return null; } else { answer.add(str); return answer; } } for (int i=0...
9
public List<Book> getBooksByParameters(String name, String authorName,String year, String bookType, String series, String availibility) { boolean available = false; int yearInt = 0; if (!IntegerUtil.isInteger(year) || year.equals("")) { yearInt = 0; } else { yearInt = Integer.parseInt(year); } ...
4
public static boolean verifieGroupePheromone(List<int[]> groupePheromone){ int taille = groupePheromone.size(); boolean isValide = true; for(int i=0; i<taille-1; i++){ int[] compare1 = groupePheromone.get(i); int x1 = compare1[0]; int y1 = compare1[1]; for(int j=i+1; j<taille; j++){ int[...
8
public static PDFAction getAction(PDFObject obj, PDFObject root) throws IOException { // figure out the action type PDFObject typeObj = obj.getDictRef("S"); if (typeObj == null) { throw new PDFParseException("No action type in object: " + obj); } ...
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Cell other = (Cell) obj; if (super.getX() != other.getX()) { ...
4
public Item peek() { if (isEmpty()) throw new NoSuchElementException("Queue underflow"); return first.item; }
1
public static String normalize(String buffer) { if (buffer != null) { buffer = buffer.trim(); if (buffer.length() > 0 && buffer.charAt(0) == '+') { buffer = buffer.substring(1); } } return buffer; }
3
private synchronized void removeClassFile() { if (classfile != null && !isModified() && hasMemberCache() == null) classfile = null; }
3
public static LinkedListNode appendLastKNodes(LinkedListNode head, int k) { if (head == null) return null; LinkedListNode slow = head; LinkedListNode fast = head; for (int i = 0;i < k;i++) { if (fast == null) return null; fast = fast....
6
public void update(){ key.update(); if(key.up)y--; if(key.down)y++; if(key.left)x--; if(key.right)x++; }
4
private short processInternalAuthenticate(APDU apdu, boolean protectedApdu) { if (!hasInternalAuthenticationKeys() || (hasMutualAuthenticationKeys() && (!protectedApdu || !hasMutuallyAuthenticated()))) { ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED); } ...
9
private int getOtherToken(String content, int startOffset, int endOffset) { int endOfToken = startOffset + 1; while (endOfToken <= endOffset) { if (Character.isWhitespace(content.substring(endOfToken, endOfToken + 1).charAt(0))) break; endOfToken++; } String token = content.substring(startOffset,...
4
final void method3500(int i) { int i_56_ = 0; if (i != 700) method3509(120, true, false, 4, -12, 14, -33, -109); for (/**/; (((Class361) this).anInt4437 ^ 0xffffffff) < (i_56_ ^ 0xffffffff); i_56_++) { for (int i_57_ = 0; ((Class361) this).anInt4443 > i_57_; i_57_++) { if (i_56_ != 0 && (i_57...
7
public void itemStateChanged(ItemEvent e) { CheckboxMenuItem menu = (CheckboxMenuItem)e.getSource(); if (menu.getState()) { String label = menu.getLabel(); if(label.equals(CLEAR)){ }else if(label.equals(TWEET)){ this.model.enablePostField(); }else if(label.equals(ONLY_MENTION)){ ...
9
public ArrayList<MatchScheduling> scheduleFinal() throws SQLException { ArrayList<MatchScheduling> matches = new ArrayList(); ArrayList<Team> f1Teams = new ArrayList(); for (int k = 0; k <= 1; k++) { int homeTeamId = getById(listByMatchRound(8).get(k).getId()).getHomeTe...
3
private void AutoGolo_CheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AutoGolo_CheckBoxActionPerformed //Atualiza Jogador_ComboBox Jogador_ComboBox.removeAllItems(); if(Equipa1_RadioButton.isSelected()) { if(!AutoGolo_CheckBox.isSelected()) { ...
8
public void run() { try { Synthesizer synthesizer = MidiSystem.getSynthesizer(); synthesizer.open(); channel = synthesizer.getChannels()[0]; while (true) { // get 8 notes & check if in major scale // additionally play root note for (int iEight = 0; iEight < 8; iEight++) { pause = 0; ...
8
public AddressPopup(final Stage parentStage, String titleText, String addressType) throws MalformedURLException { this.root = new StackPane(); this.root.autosize(); this.scene = new Scene(root, AppSettings.getDoubleValue("address.popup.width"), AppSettings.getDoubleValue("address.popup.height"), ...
0
public boolean compare(Predicate.Op op, Field val) { StringField iVal = (StringField) val; int cmpVal = value.compareTo(iVal.value); switch (op) { case EQUALS: return cmpVal == 0; case NOT_EQUALS: return cmpVal != 0; case GREATER_THAN: return cmpVal > 0; case GREATER_THAN_OR_EQ: return cm...
7
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Usuario other = (Usuario) obj; if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) { ...
4
private String createAuction() { if (user.isOnline()) { int duration = 0; String describtion = ""; try { duration = Integer.parseInt(stringParts[1]); if (duration <= 0) { return "Error: The duration has to be > 0!"; } for (int i = 2; i < stringParts.length; i++) { desc...
5
public int victoryCond() { int result = 0; boolean fullCond = false; //0 = nothing, 1-3 = Rows, 4-6 = Columns, 7&8=Diags, 9 = full if(result == 0) { result = checkAcross(); } if(result == 0) { result = checkDown(); } if(result == 0) { result = checkDiag(); } if(result == 0) { fullCond = ch...
5
private void gridInitialize() { for (int i = 2; i <= 3; i++) { for (int j = 0; j < 5; j++) { gameGrid[i][j] = 1; node[i][j].setPlayer(1); gameGrid[i + 3][j] = 3; node[i + 3][j].setPlayer(2); } } for (int i = 0; i <= 1; i++) { for (int j = 0; j < 5; j++) { if (i == 0) { if (j % 2 ...
9
public byte[] getSpecialSequence(int function) { byte[] sequence = null; switch (function) { case TerminalIO.STORECURSOR: sequence = new byte[2]; sequence[0] = ESC; sequence[1] = 55; // Ascii Code of 7 break; case ...
5
public static String getAssetTypeName(String assetTypeID, String serverID) { String name = otapiJNI.OTAPI_Basic_GetAssetType_Name(assetTypeID); if (Utility.VerifyStringVal(name)) { return name; } if (!Utility.VerifyStringVal(otapiJNI.OTAPI_Basic_LoadAssetContract(assetType...
5
@Override public LoginResult createCharacter(String login, Session session) throws IOException { final SessionStatus status=session.getStatus(); final LoginSessionImpl loginObj=new LoginSessionImpl(); loginObj.acct=null; loginObj.login=login; loginObj.mob=null; final MOB prevMOB=session.mob(); LoginResu...
8
public static Matrix loadARFF(String filepath) throws IOException { BufferedReader in = new BufferedReader(new FileReader(filepath)); Matrix matrix = new Matrix(); boolean isProcessingData = false; String line; while ((line = in.readLine()) != null) { li...
7
public List<Reservation> getReservationsByCustomerId(int customerid){ List<Reservation> res=new ArrayList<Reservation>(); Connection con=null; Statement stmt=null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverMan...
5
public static void main(String[] args) { // If the system tray isn't supported... Exit. if (!SystemTray.isSupported()) { JOptionPane.showMessageDialog(null, "SwiftSnap isn't compatible with your computer."); return; } // Get the OS system tray. Sy...
3
public void califLetra () { if (getCl() >= 'A' && getCl() <= 'D') { System.out.println("Bajo rendimiento"); } else { if ( getCl() =='E' || getCl() == 'F') { System.out.println("Rendimiento aceptable"); } ...
6
public void print(){ System.out.println(); for (int i = 0; i < d.length; i++) { for (int k = 0; k < d.length; k++) { if(d[i][k]>100000) System.out.print("* "); else System.out.print(d[i][k]+" "); } System.out.println(); } }
3
@Override public void onBrowserEvent(Event event) { if (!event.getCurrentEventTarget().cast().equals(getElement())) { super.onBrowserEvent(event); return; } if (width == -1) { determineSizes(); } boolean mouseEvent = false; int type = DOM.eventGetType(event); switch (type) { case Event.ONMOU...
9
public void tryMove() { for(BB bb : level.collidables) { if(bb.pointIntersects(this.x + this.xa, this.y)) { if(this.x < bb.getX()) { this.x = bb.getX(); } else if(this.x > bb.getX() + bb.getWidth()) { this.x = bb.getX() + bb.getWidth(); } this.xa = -this.xa; } if(bb.pointIn...
7
public static double density(double temperature){ double[] tempc = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 60, 65, 70, 75, 80, 85, 90, 95, ...
2
public void addLoop(int loopNum) { //Making the button ImageButton loopImage = new ImageButton(parent, "Loop " + loopNum, 50 + (loopNum - 1) * 120, screenHeight - 32, 100, 25, 1) { @Override public void onMousePress(int x, int y) { //Opens loop menu if not open already if (!loopMenuOpen) { ...
1
@Override public void deserialize(Buffer buf) { teleporterType = buf.readByte(); if (teleporterType < 0) throw new RuntimeException("Forbidden value on teleporterType = " + teleporterType + ", it doesn't respect the following condition : teleporterType < 0"); int limit = buf.read...
4
public static void main(String[] args) { String line; if (args.length == 0) { System.out.println("CCalculator v0.1"); System.out.println(); System.out.println("Input a combination of numbers, basic arithmetic operators and brackets, then press <Enter> to g...
7
private void checkForKeyPress() { if(moving) { if(Mouse.isButtonDown(0) && currentReloadTime == 0) { bullets.add(new Bullet(getX(), getY(), 2, direction, 3, true)); currentReloadTime = maxReloadTime; } if(!Mouse.isButtonDown(0) && currentReloadTime > 0) { currentReloadTime-...
9
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(negative ? "N" : "n"); sb.append(overflow ? "V" : "v"); sb.append(direct_page ? "P" : "p"); sb.append(break_flag ? "B" : "b"); sb.append(half_carry ? "H" : "h"); sb.append(indirect_master ? "I" : "i"); sb.append(zero...
8
private void drawPauseScreen(Graphics page) { if(pause) { //Screen Fade out page.setColor(new Color(0,0,0,150)); page.fillRect(0,0,this.getWidth(), this.getHeight()); //Middle Box page.setColor(new Color(255,255,255,40)); page.fillRoundRect(160, 50, 670, 325,25,25); //Pause Sign page.setCol...
1
@Override public List<AssemblyLine> generate(Context context) { final List<AssemblyLine> lines = Lists.newLinkedList(); Data value = getValue(context, lines); if (context.getAddress(ident) == null) { Context.error("Try to assign a non-existent variab...
9
@EventHandler public void GhastBlindness(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("Ghast.Blindne...
7
private void copyRGBtoBGRA(ByteBuffer buffer, byte[] curLine) { if(transPixel != null) { byte tr = transPixel[1]; byte tg = transPixel[3]; byte tb = transPixel[5]; for(int i=1,n=curLine.length ; i<n ; i+=3) { byte r = curLine[i]; by...
6
public void keyPressed2(KeyEvent w) { int code = w.getKeyCode(); if (code == KeyEvent.VK_SPACE) { if (I == 0) { //Looking Left if (nS == 1) { x = X; y = Y; stop = false; shoot = true; ...
7
@Override public void handleCommand(CommandMessage m) { String[] args = m.getArgs(); if (args.length == 1) { String nick = m.getNick(); if (pozdravy.containsKey(nick)) { ph.sendMessage(nick + ": " + pozdravy.get(nick)); } } else if (args.length ...
9
public void addModulesFromPackage(String packageName, ClassLoader classLoader, Class<?>... ignores) throws Exception { for(Class<? extends Module> clazz : ReflectionsUtilities.getSubtypesOf(Module.class, packageName, classLoader, ignores)) { try { modules.add(clazz.newInstance()); ...
4
static final public void terme() throws ParseException { facteur(); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ET: case MUL: case DIV: ; break; default: jj_la1[19] = jj_gen; break label_9; } opMul(); fa...
5
private double getCustomScore(String token1, String token2, int minNumTokens){ try{ int t1 = Integer.parseInt(token1); int t2 = Integer.parseInt(token2); if(t1 != t2){ return 2; } else{ return 1; ...
9
protected void onVoice(String channel, String sourceNick, String sourceLogin, String sourceHostname, String recipient) {}
0
protected Behaviour getNextStep() { if (numLookups > MAX_LOOKUPS) return null ; if (topic == null) topic = pickResearchTopic(actor, archive) ; if (topic == null) return null ; final float persist = actor.traits.scaleLevel(STUBBORN) ; if (numLookups > (BASE_LOOKUPS * persist)) { if (Rand.i...
5
public int largestRectangleAreaII(int[] height) { if (height == null || height.length == 0) return 0; int area = 0; Stack<Integer> stack = new Stack<Integer>(); for (int i = 0; i <= height.length; i++) { int h = i < height.length ? height[i] : 0; if (stack.empty() || height[stack.peek()] < h) { sta...
7
private void getNodeVariableList(ParseTree node) { if (node.attribute.equals("DECLARE")) if (!containsVariable(node.children.get(0).value)) variableList.add(new VariableInformation(node.children.get(0).value, node.children.get(1).value)); //Iterate children for (int i = 0; i < node.children.size(); i...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Player other = (Player) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return fa...
6
private static List<byte[]> generatePossiblePasswordBytes( String passwordString) { final List<byte[]> possibilties = new ArrayList<byte[]>(); for (final PasswordByteGenerator generator : PASSWORD_BYTE_GENERATORS) { byte[] generated = generator.generateBytes(passwordString); ...
5
public void Traitement() { try { ServerSocket serveur = new ServerSocket( port ); System.out.println( "Serveur echo en ligne. " ); System.out.println("Ce serveur utilise le port : " + port); while(true) { if (NbrConnexion < ...
4
public String toString() { try { return this.toJSON().toString(4); } catch (JSONException e) { return "Error"; } }
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; User other = (User) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(...
6
public static String findCentroidEditDistance(String[] queries) { HashMap<String, Float> hm = new HashMap<String, Float>(); float max = Float.MIN_VALUE; String centroidQuery = null; for (int i = 0; i < queries.length; i++) { String query = queries[i]; float[] distances = new float[queries.length]; for ...
5
private void loadUserPrefVariables() { Variables.setSetting("launch.UseXmxArgument", "true"); Variables.setSetting("launch.XmxArgument", MemoryField.getText()); Variables.setSettingPriority("launch.XmxArgument", "int:largest"); if (!JavaPathField.getText().equalsIgnoreCase("defa...
4
public static void main(String[] args) throws Exception { Command command = processArgs(args, "VorbisComment"); VorbisFile vf = new VorbisFile(new File(command.inFile)); if (command.command == Commands.List) { listTags(vf.getComment()); } else { ...
3
public boolean isBusiness() { return business; }
0