text
stringlengths
14
410k
label
int32
0
9
public LibrationODE(double a, double epsilon, double delta, double omega0) { this.a = a; this.epsilon = epsilon; this.delta = delta; this.omega0 = omega0; }
0
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { if(plugin.config.getBoolean("Apply.Enabled")) { Player player = event.getPlayer(); String pw = plugin.config.getString("Apply.Password"); String group = plugin.config.getString("Apply.Group"); ...
6
@SuppressWarnings("unchecked") @Override public void recoverCharStats() { baseCharStats.setClassLevel(baseCharStats.getCurrentClass(), basePhyStats().level() - baseCharStats().combinedSubLevels()); baseCharStats().copyInto(charStats); final Rideable riding = riding(); if (riding != null) riding.affec...
9
@Test public void test() { PersonnageService perso = new PersonnageImpl(); Random rand = new Random(); System.out.println("Tests de pré-condition non atteignable"); perso.init(0, 0); System.out.println("Tests de couverture des postconditions de init"); assertTrue("Le personnage est mort après init", perso....
3
private static SpriteSheet getSpriteSheet(String path, float scale) { try { SpriteSheet spriteSheet; Color col = new Color(0, 0, 255); Image img = new Image(path); if (scale != 1) { img = img.getScaledCopy(scale); } img.set...
2
private void asetaJonoonArvollinen() throws IllegalStateException { if (seuraavaArvollinen == null) { throw new IllegalStateException(); } nykyinenJono().lisaaSeuraavaArvollinen(seuraavaArvollinen); this.seuraavaArvollinen = null; }
1
public void writeToDebugFile(String value) throws IOException { if(debug) { //append text to log //text = Date + time + " || " + value FileWriter write = new FileWriter(System.getProperty("user.dir") + "/" + debugFile + ".txt", true); PrintWriter print_line = ne...
1
public String getColumnName(int columnIndex) { switch (columnIndex) { case 0: return "Name"; case 1: return "Week Day"; } return ""; }
2
public static void main(String[] args) { if (args.length != 1) { System.out.println("Usage: java Chess input-file"); System.exit(0); } String inputFileName = args[0]; BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(inputFileName)); } catch (IOException e) { Syste...
9
public String getrank() {//Accesses the Card's rank return rank; }
0
public static Image createTransparentImageFromBitmap( byte[] bytes, int width, int height) { Display.check(); int pix[] = new int[width * height]; int index = 0; int srcPos = 0; int dstPos = 0; int[] colors = { 0x000ffffff, 0x0ffffffff, 0x0ff000000, 0x0ff000000 }; for (int y ...
4
public static double getDoubleParameter(String key) throws CorruptConfigurationEntryException { key = key.toLowerCase(); if(parameters.containsKey(key)) { try { return Double.parseDouble(parameters.get(key)); } catch(NumberFormatException e) { throw new CorruptConfigurationEntryException("The entry '"...
2
public boolean isGameOver() { return (board.numberOfPawns()==1) || (board.maxGold() >= 3); }
1
public User(String name) { if (name == null || name == "") throw new IllegalArgumentException(); this.name = name; }
2
public static void render(Item item){ int dialogWidth; if(item.getName().length() > item.getDescription().length()){ dialogWidth = item.getName().length() * 8 + 20; }else{ dialogWidth = item.getDescription().length() * 8 + 20; } // 20 + 12 * i (i = desc lines) int dialogHeight = 20 + 12 * (item....
9
@SuppressWarnings("unchecked") public String getEventsLineChart() { PreparedStatement st = null; ResultSet rs = null; JSONArray json = new JSONArray(); try { conn = dbconn.getConnection(); st = conn.prepareStatement("SELECT m.event_id, e.name, sum(m.auton_top)...
3
private void especialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_especialActionPerformed // TODO add your handling code here: }//GEN-LAST:event_especialActionPerformed
0
private static void generateLeafs(){ for(int i = 0 ; i < Config.labels.size() ; i++){ ArrayList<Composant> list = Config.hash.get(Config.labels.get(i)); int j = 0 ; while(j < list.size()){ Composant c = list.get(j); System.out.println("\t " + c); if(c.getList().size() == 1){ if(c.getList()....
5
public static void doubleWalk(int current, boolean[] visited, UndirectedGraph ug, ArrayList<Integer> doublePath){ if(visited[current]){ return; } doublePath.add(current); visited[current]=true; for(int i=0;i<ug.dist[current].length;i++){ int to=ug.dist[current][i]; if(!visited[to]){ doubleWalk(to,visi...
3
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { ArrayList<CompRequest> comp = new ArrayList<Com...
9
public ArrayList<Meeting> getMeetingNotificationsByUsername(String username){ ArrayList<Meeting> meetings = new ArrayList<>(); ArrayList<MeetingInvite> meetingInvites = meetingInvites().getMeetingInvitesByUsername(username); for(MeetingInvite meetingInvite : meetingInvites){ Meeting...
4
public void test_constructor1() { OffsetDateTimeField field = new OffsetDateTimeField( ISOChronology.getInstance().secondOfMinute(), 3 ); assertEquals(DateTimeFieldType.secondOfMinute(), field.getType()); assertEquals(3, field.getOffset()); try { ...
3
static int KMP(char[] p, char[] t) { int i = 0, j = 0, m = p.length, n = t.length; boolean palindrome = false, alindrome = false; while (i < n) { while (j >= 0 && t[i] != p[j]) j = b[j]; i++; j++; if (j == m) { if (i == j) palindrome = true; else if (i != n) alindrome = true; ...
8
private final List<Integer> getIntegerList (Object[] objList) { List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < objList.length; i++) { list.add((Integer)objList[i]); } return list; }
1
public void get(String url) { try { URI requestUrl = URI.create(url); Map<String, List<String>> params = prepareParameters(requestUrl.getQuery()); String path = requestUrl.getPath(); if(!routes.containsKey(path)) { System.out.println("No service found for path '" + path + "'!!!"); return; ...
2
public void flipH() { for (Connector c : connectors) { if (c.getPosition() == Position.left) c.setPosition(Component.Position.right); else if (c.getPosition() == Position.right) c.setPosition(Position.left); } }
3
public List<Class<? extends Pet>> types() {return types;}
1
@Override public void connectionLost(String message) { c = null; connectionSemaphore.acquireUninterruptibly(); System.out.println("[DcStation " + alias + "] Connection lost: " + message); }
0
public void setPcaSecuen(Integer pcaSecuen) { this.pcaSecuen = pcaSecuen; }
0
private void be(String label) { if (verbose) System.out.println("(Branch? " + (acc == 0 ? "YES" : "NO") + ")"); if (acc == 0) index = branches.get(label) - 1; }
3
public static void main(String[] args) { System.out.println(1 + 2); // 3 System.out.println(2 - 3); // -1 System.out.println(3 * 4); // 12 System.out.println(16 / 5); // 3 System.out.println(16 % 5); // 1 }
0
public Matrix plus(Matrix B) { Matrix A = this; if (B.M != A.M || B.N != A.N) throw new RuntimeException("Illegal matrix dimensions."); Matrix C = new Matrix(M, N); for (int i = 0; i < M; i++) for (int j = 0; j < N; j++) C.data[i][j] = A.data[i][j] + B.data[i]...
4
@Override public List<SearchResult<SequenceMatcher>> searchForwards(final WindowReader reader, final long fromPosition, final long toPosition) throws IOException { // Initialise: final int longestMatchEndPosition = sequences.getMaximumLength() - 1; long searchPosition = fromPosi...
9
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[Sales:"); buffer.append(" id: "); buffer.append(id); buffer.append(" datetime: "); buffer.append(datetime); buffer.append(" total: "); buffer.append(total); buffer...
0
@Nullable public Table loadTable(@NotNull String name) { if(tableCache.containsKey(name)) { return tableCache.get(name); } int ignore = 0; int attributesCount = 0; int firstPage = 0; List<Attribute> attributes = null; for(Record rec: table) { Map<Second...
7
private Repository getRepositoryFork(GitHubClient gitHubClient, Repository masterRepository) throws IOException { Properties properties = ApplicationProperties.getProperties(); RepositoryService repositoryService = new RepositoryService(gitHubClient); List<SearchRepository> searchReposi...
2
public ArrayList<Integer> getMostConstrainedMeeting() { HashMap<Integer, ArrayList<Integer>> slotsForMeetings = this.SlotsForMeetings; int minNumSlots = Integer.MAX_VALUE; ArrayList<Integer> meeting = new ArrayList<Integer>(); for(Integer key: slotsForMeetings.keySet()) { int numSlots = slotsForMeetings.g...
4
public AsciiImage execute(AsciiImage img) throws OperationException { AsciiImage newI = new AsciiImage(img); String[] lines = data.split("\n"); if(lines.length < img.getHeight()) { throw new OperationException("Not enough lines"); } for(int y = 0; y < lines.length; ...
5
public void visiteurSuivant(){ int index = getVue().getjComboBoxVisiteur().getSelectedIndex()+1; if(index== getVue().getjComboBoxVisiteur().getItemCount())index=0; getVue().getjComboBoxVisiteur().setSelectedIndex(index); }
1
public Integer GetCount(Stone Color) { Integer retCnt = 0; Pos workPos = new Pos(); for (int x = Common.X_MIN_LEN; x < Common.X_MAX_LEN; x++) { workPos.setX(x); for (int y = Common.Y_MIN_LEN; y < Common.Y_MAX_LEN; y++) { workPos.setY(y); if (getColor(workPos) == Color) { retCnt++; } } ...
3
public static String getAvailableTimeSlot(long[] aUid) { TimeSlotHelper helper = new TimeSlotHelper(DateUtil.getStartOfDay(TimeMachine.getNow() .getTime()), 5); for (long uid : aUid) { helper.removeByUser(uid); } return helper.toSentence(); }
1
public void selectNextStream() { int selectedRow = table.getSelectedRow(); int numberOfStreams = controlStreams.getStreamVector().size(); //no stream is selected if(selectedRow == -1 && numberOfStreams > 0) { selectedRow = 0; } else if (selectedRow >= (numberOfStreams-1)) { selectedRow = 0; } else ...
4
final public void AppExp() throws ParseException {/*@bgen(jjtree) AppExp */ SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTAPPEXP); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { jj_consume_token(LEFTB); Expression(); Expression(); jj_consume_token(RIGHTB)...
8
public initiateRemoval() { this.requireLogin = true; this.addParamConstraint("id", ParamCons.INTEGER); this.addRtnCode(405, "permission denied"); }
0
protected MOB getCharmer() { if(charmer!=null) return charmer; if((invoker!=null)&&(invoker!=affected)) charmer=invoker; else if((text().length()>0)&&(affected instanceof MOB)) { final Room R=((MOB)affected).location(); if(R!=null) charmer=R.fetchInhabitant(text()); } if(charmer==null) ...
7
public void setPopTerminal(String popTerminal) { this.popTerminal = popTerminal; }
0
private static boolean is2Pawn(final ChessBoardEntity board, final ChessmenEntity c, final PositionEntity p) { boolean result = false; for (int y = 0; y < 9; y++) { ChessmenEntity cto = getChessmen(board, p.getX(), y); if (null != cto) { if (cto.isPlayer() && Type.Pawn == cto.getType() && !cto.isPromote()...
5
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public void resume_ingress() { ++resume_ingress_count; }
0
private void resetZoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetZoomButtonActionPerformed diagramPanel.getScaleRatio()[0] = 1; diagramPanel.getScaleRatio()[1] = 1; diagramPanel.getScaleRatio()[0] = Math.max(0.3, getDiagramPanel().getScaleRatio()[0]); d...
7
protected boolean isOfType(final Object object) { if (object instanceof CycList) { return parse((CycList) object, false) != null; } else if (object instanceof CycNaut) { return parse((CycNaut) object, false) != null; } else { return false; } }
2
public ListNode reverseBetween(ListNode head, int m, int n) { if(head == null || head.next == null) return head; ListNode preNode = new ListNode(0); preNode.next = head; ListNode ahead = head; ListNode current = head; for(int i=0; i<n-m; i++) ahead = ahead.next; for(int i=1; i<m; i++){ preN...
7
@Override public Measurement add(Measurement m) { Connection conn = db.getConnection(); Vector<PreparedStatement> vps = new Vector<PreparedStatement>(); ResultSet rs = null; try { conn.setAutoCommit(false); int measurementId = HomeFactory.getMeasurementHome().executeInsertUpdate(vps, m); // wi...
5
public boolean getAlwaysDrawGrouting() { return alwaysDrawGrouting; }
0
public Value unaryOperation(final AbstractInsnNode insn, final Value value) { int size; switch (insn.getOpcode()) { case LNEG: case DNEG: case I2L: case I2D: case L2D: case F2L: case F2D: case D2L: size = 2; break; case GETFIELD: size = Type.getType(((FieldInsnNode) insn).desc).getSize();...
9
public final boolean isWalkable(final Point p) { final Point point = sanitizeCoordinates(p); if (point == null) { return false; } if (wall.contains(point)) { return false; } return true; }
2
public static long S1() { // S1: No student writes more than one exam in a time slot. long numS1 = 0; for(Student s : Environment.get().students.objects()){ // TODO: this is slow, is there a better than N^2 way to check this? for(Lecture l1 : s.lectures){ if(l1.session == null) continue; for(Lecture...
9
protected boolean yObstacleAhead(double time) { final int halfOfWidth = this.currentWidth / 2; for (StaticObject so : AppFrame.getFrameDesign().getStaticObjects()) { if (checkYObstacle(so, time, halfOfWidth)) { if (obstacleReaction(so)) { currentVerticalSp...
5
static private int[] permutation(int N) { int[] a = new int[N]; // insert integers 0..N-1 for (int i = 0; i < N; i++) { a[i] = i; } // shuffle for (int i = 0; i < N; i++) { int r = (int) (Math.random() * (i + 1)); // int between 0 and i ...
2
static void scanJarForMatchingFiles(List<String> matchingFiles, File jarfile, Logger log) { try { JarFile jar = new JarFile(jarfile); Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { String name = entries.nextElement().toStrin...
7
public Transform getTransform() { if ( parent != null ) return parent.getTransform(); return new Transform(); }
1
public Frame11() { try{ Class.forName(JDBC_DRIVER); conn = DriverManager.getConnection(DB_URL,USER, PASS); statement = conn.createStatement(); }catch(SQLException se){ se.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } setTitle("Blok E, 1 - 35"); setDefaultCloseOperation(JF...
8
@Override public void update() { if (attributes.get(primaryKey) == null) { throw new NullPointerException("Can't update a non inserted object"); } StringBuilder sb = new StringBuilder("UPDATE "); sb.append(tableName).append(" SET "); StringBuilder where = new Stri...
8
private void cargarSetAprendizaje(){ DefaultTableModel temp = (DefaultTableModel) this.tablaSetAprendizaje.getModel(); String csvFile = "dataset/diabetes_aprendizaje_quickpropagation.csv"; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; try { double maximo0 = normalizacion.o...
9
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
private boolean satisfyNEGATE(Variable v0, Variable v1, Trail trail) { IntDomain d0 = (IntDomain) v0.getDomain(); IntDomain d1 = (IntDomain) v1.getDomain(); if (d1.size() == 1) { // v0 = -v1 int value = -d1.value(); if (!d0.contains(value)) return false; if (d0.size() > 1) v0.updateDomain(new...
8
public JSONObject putOnce(String key, Object value) throws JSONException { if (key != null && value != null) { if (this.opt(key) != null) { throw new JSONException("Duplicate key \"" + key + "\""); } this.put(key, value); } return this; }
3
public JMenuItem createOpenItem() { open = new JMenuItem("Open"); open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK)); open.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { if ...
3
public void clearship () { switch (this.dir) { case 0: { if (!this.invalid) for (j=this.y1;j<this.y2;j++) { Battleship.getPlayers(Battleship.getYou()).setBboard(this.x1,j,null); Battleship.getPlayers(Battleship.getYou()).setHitOrMiss(this.x1,j,false); ...
6
public static ListNode insertionSortList(ListNode head) { if (head == null || head.next == null) return head; ListNode newHead = new ListNode(head.val); ListNode pointer = head.next; // loop through each element in the list while (pointer != null) { // insert this element to the new list ListNode i...
9
public void addPedestrian(){ int n = rand.nextInt(4); int m = rand.nextInt(2); switch(n){ case Pedestrian.GO_DOWN: if(m==0) pedestrians.add(new Pedestrian(260, 0, Pedestrian.GO_DOWN)); else pedestrians.add(new Pedestrian(412, 0, Pedestrian.GO_DOWN)); break; case Pedestrian.GO_UP: if(m==0) ...
8
public void close() throws IOException { if(r != null) { r = null; ogg.close(); ogg = null; } if(w != null) { w.bufferPacket(info.write(), true); w.bufferPacket(tags.write(), false); long lastGranule = 0; for(Sp...
6
public static void abundantOTUToSparseThreeColumn(String abundantOTUClust, String outFile, HashMap<String, String> sequenceToSampleMap) throws Exception { File in = new File(abundantOTUClust); BufferedReader reader = abundantOTUClust.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamRe...
8
protected String stripData(StringBuffer str, String div) { final StringBuffer data = new StringBuffer(""); while(str.length()>0) { if(str.length() < div.length()) return null; for(int d=0;d<=div.length();d++) { if(d==div.length()) { str.delete(0,div.length()); return data.toString(...
9
protected ESBLogUtils(Class<?> clazz) { if (!ESBServerContext.isProductMode()) { StackTraceElement[] ste = Thread.currentThread().getStackTrace(); String className = ste[3].getClassName(); Class<?> callClazz = null; try { callClazz = Class.forName...
9
@Override public void processLine(InOutParam inOutParam) { //Prepare output LineOutput lineOut = new LineOutput(); try { //Remove "is" and "?" String formattedLine = this.line.split("(\\sis\\s)")[1]; formattedLine = formattedLine.replace("?","").trim(); // search for all numerals for their v...
9
Module removeCommand(String name) { if (null == this.commands || StringUtils.isEmpty(name)) { return this; } if (null != this.commands.remove(name) && this.commands.isEmpty()) { this.commands = null; } return this; }
4
@Override public String getPageTitle() { String title = ""; if ((this.id >= 1) && (this.id <= 5)) { title = " - partner projektu Bezpečné paneláky"; } if (this.id == 4) { title = " - elektrikár - Bratislava"; } if ((this.id == 12) || (this.i...
7
public void run(boolean wait) { // Create an Akka system ActorSystem workQueue = ActorSystem.create("vcfWorkQueue"); // Create the master ActorRef master; if (masterClazz != null) master = workQueue.actorOf(new Props(masterClazz), "masterVcf"); else master = workQueue.actorOf(masterProps, "masterVcf"); ...
2
private Point chooseRandomLocation() { Point randomLocation; ArrayList<Point> listOfEmptyLocations = new ArrayList<>(); Player[][] locations = this.board.getBoardLocations(); // create list of empty locations for (int row = 0; row < locations.length; row++) { Player...
5
public String getIsKey() { return isKey; }
0
public char nextClean() throws JSONException { for (;;) { char c = next(); if (c == 0 || c > ' ') { return c; } } }
3
public void stopMoving(Direction dir) { boolean foundDir = false; for(int i = 0; i < queuedMoveDirectionPreferences.length - 1; i++) { if(!foundDir && queuedMoveDirectionPreferences[i] == dir) foundDir = true; if(foundDir) queuedMoveDirectionPreferences[i] = queuedMoveDirectionPreferences[i + 1]; } ...
4
private static void handleMoveType3(PGNMove move, String strippedMove, byte color, byte[][] board) throws PGNParseException { byte piece = WHITE_PAWN; int fromhPos = getChessATOI(strippedMove.charAt(1)); int tohPos = getChessATOI(strippedMove.charAt(2)); int tovPos = strippedMove.charAt(3) - '1'; int fromvPos...
8
public List<String> tableNames(String schema) throws SQLException { ArrayList result = new ArrayList(); ResultSet rs = statement.executeQuery(String.format(getTableStatement, schema)); while (rs.next()) { result.add(rs.getString(1)); } return result; }
1
public void setTarget(Slot target) { switch (destAction) { case (DEST_VISIBLE_TRUE): { component.setVisible(false); break; } case (DEST_VISIBLE_FALSE): { component.setVisible(true); break; } }...
3
public void addShow(Show show){ if (show instanceof Movie){ movies.add((Movie) show); }else{ theatricals.add((Theatrical) show); } }
1
public String useItem(int itemSlot) { if(inventory.hasItem(itemSlot)) { if(inventory.getItem(itemSlot).getRoomUsedIn() == currentRoom) { String ret = inventory.getItem(itemSlot).getUsedDescription(); inventory.removeItem(itemSlot); currentRoom.itemUsed(); itemRemove...
2
public int getDepartmentId() { return departmentId; }
0
public void firstDeal() { this.dealerHand = new Hand(shoe.dealCard(), shoe.dealCard()); System.out .println("===================================================="); System.out.println(">Dealer's visible card is: " + dealerHand.getHand().get(1).toString()); System.out.println("TESTING: DEALER'S SECON...
5
private void diceButtonListeners() { diceButton.addMouseMotionListener(genericMouseMotionListener); diceButton.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent...
4
public static void initialMgrsDisplay() { System.out.println("You've entered the Manager's verification."); LoginDisplay.username(); Employee employee = LoginDisplay.getLoggedInEmployee(); if (employee.getAccessLevel().equalsIgnoreCase("Manager")) { System.out.print("Would you like Employee Management (E...
4
public boolean peutConsulter(Utilisateur utilisateur) { return (utilisateur != null && utilisateur.getRole().getValeur() >= getConsultationRoleMinimum().getValeur()) || getConsultationRoleMinimum() == Role.Visiteur; }
2
@After public void tearDown() { }
0
@Override public void printApplication(Employee employee, HttpServletResponse httpServletResponse, XMLGenerator xmlGenerator, Map<String, String[]> parameterMap, HttpSession httpSession) { udane = false; String selectedOperation = null; if (parameterMap.get("Dalej") != null) { ...
9
@Override public Object getRoot() { if (document == null) return null; return new XMLNodeWrapper(document.getRootElement()); }
1
private void handlePotentialConflicts(double[][] costs, int[] assigns, SegmentedImage A, SegmentedImage B){ //TODO: test some constants List<MergeCell> merges = detectPotentialMerge(costs, assigns, A, B, .9); List<SplitCell> splits = detectPotentialSplit(costs, assigns, A, B, .9); //TODO: finish method }
0
public String getReturnType() { return returnType == null ? null : returnType.toString(); }
1
public static void main(String[] args) throws Exception { try { if (args.length > 0) Logger.setActivated(Integer.parseInt(args[0]) != 0); if (args.length > 1) Logger.setLogSuffix(args[1]); } catch (NumberFormatException e) { } try { Reader reader = new Reader(); while (true) { reader.rea...
6
public static String getKeyFromLock(String item) throws IOException{ String lock = sanitizeKey(item,1); int len = lock.length(); //computing the key String key = ""+(char)(lock.charAt(0) ^ lock.charAt(len-1) ^ lock.charAt(len-2) ^ 5); for...
2