text
stringlengths
14
410k
label
int32
0
9
public Menu_seleccion(ArrayList<Guerrero> array,int desp,Juego juego) { initComponents(); ImageIcon iconLogo = new ImageIcon(IMG.getImage("menu_soldados.png")); jLabel1.setIcon(iconLogo); ImageIcon iconLogo2 = new ImageIcon(IMG.getImage("Label_nombre.png")); int x=60; int...
2
public static void main(String[] args) { final int A = 1234; final int B = 9876; System.out.println("A = " + Integer.toBinaryString(A)); System.out.println("B = " + Integer.toBinaryString(B)); System.out.println("A & B = " + Integer.toBinaryString(A & B)); System.out.prin...
0
@Override public String toString() { StringBuilder builder = new StringBuilder(); try { XIO.write( this, builder ); } catch( IOException e ) { throw new XException( e ); } return builder.toString(); }
1
public Board(City_Graph city_graph){ this.city_graph = city_graph; // set Variables boardOffset = 200; citySquareSize = 40; neutralColor = new Color(190,190,190); romColor = new Color(210, 20, 20); cathargoColor = new Color(20, 20, 210); // init jframe jframe = new JFrame("test"); jf...
0
public Builder id(int receivedId) { if (receivedId < 0) { log.warn("Wrong ID. receivedId ={}", id); throw new IllegalArgumentException("Id must be integer value more than 0. Received value =" + receivedId); } this.id = receivedId; return th...
1
public boolean containsFieldAliasDirectly(String fieldName, String typeSig, IdentifierMatcher matcher) { for (Iterator i = fieldIdents.iterator(); i.hasNext();) { Identifier ident = (Identifier) i.next(); if (((Main.stripping & Main.STRIP_UNREACH) == 0 || ident .isReachable()) && ident.wasAliased()...
7
public void mouseClicked(MouseEvent e) { if( e.getX() >= 5 && e.getX() <= 45 && e.getY() >= 5 && e.getY() <= 45){ this.mainFrame.backToMenu(); } }
4
public static int abs(int num, int n) { /** * This method had to simple cases, either the number was negative or positive. I created a mask of the correct bit * length to test if the number was negative. If it was positive I would just return the number given. If it was negative * I did a simple negation, a...
1
public void getVal() { try { //System.err.println("DBThread Runs"); Class.forName("com.mysql.jdbc.Driver"); connect = DriverManager.getConnection("jdbc:mysql://localhost/cdr_data?user=root&password=root"); preparedStatement = connect.prepareStatement("select ID_CD...
4
public boolean compare(String file1, String file2, String type) { // Check if both the files are present if(!CompareFiles.checkIfFileExists(file1) || !CompareFiles.checkIfFileExists(file2)) { if(!CompareFiles.checkIfFileExists(file1)) System.out.println(file1+" does not exist"); if(!CompareFiles.checkIfFi...
5
public MyByteArrayInputStream(byte[] b) { this.data = b; }
0
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed if (lab_modo.getText().equals("Alta")){ if (camposCompletos()){ ocultar_Msj(); insertar(); menuDisponible(true); ...
9
@Column(name = "PRP_MOA_CONSEC") @Id public int getPrpMoaConsec() { return prpMoaConsec; }
0
public boolean matches(Dependency dependency) { return groupRule.match(dependency.getGroupId()) && artifactRule.match(dependency.getArtifactId()) && typeRule.match(dependency.getType()) && versionRule.match(dependency.getVersion()) && scopeRule.ma...
5
static private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } } else { jj_scanpo...
9
@Override public void deserialize(Buffer buf) { super.deserialize(buf); days = buf.readShort(); if (days < 0) throw new RuntimeException("Forbidden value on days = " + days + ", it doesn't respect the following condition : days < 0"); hours = buf.readShort(); if (...
3
private JPanel constructBreakpointPanel() { JPanel mainPanel = new JPanel(); mainPanel.setBorder(new TitledBorder("Breakpoints")); mainPanel.setLayout(new GridLayout(1,2)); try { JPanel panel = new JPanel(); mainPanel.add(panel); panel.setBorder(new T...
6
@Test public void twentyInchesIsBetterThanOneFoot(){ ArithmeticQuantity twenty_inch = new ArithmeticQuantity(20, Distance.INCHES); ArithmeticQuantity one_foot = new ArithmeticQuantity(1, Distance.FEET); assertTrue(twenty_inch.isBetter(one_foot)); assertTrue(!one_foot.isBetter(twenty...
0
public void handleClass(String clName) { int i = 0; while (i < clName.length() && clName.charAt(i) == '[') i++; if (i < clName.length() && clName.charAt(i) == 'L') { clName = clName.substring(i + 1, clName.length() - 1); Main.getClassBundle().reachableClass(clName); } }
4
private void insertCast(BinExpr expr, int type1, int type2) throws CompileError { if (CodeGen.rightIsStrong(type1, type2)) expr.setLeft(new CastExpr(type2, 0, expr.oprand1())); else exprType = type1; }
1
private boolean topRightCorner(int particle, int cubeRoot) { for(int i = 1; i <= cubeRoot; i++){ if(particle == i * cubeRoot * cubeRoot - 1){ return true; } } return false; }
2
private void init() { try { Boolean append = true; // append messages to the log file -> default yes path = new Control_GetPath().getStreamRipStarPath() + "/output.log"; //delete here the log file first, if it has a large size File logFile = new File(path); //if its larger then ~0.5MB, o...
4
public OperatoerDTO getOperatoer(int oprId) throws DALException { ResultSet rs = Connector.doQuery("SELECT * FROM operatoer WHERE opr_id = " + oprId); try { if (!rs.first()) throw new DALException("Operatoeren " + oprId + " findes ikke"); return new OperatoerDTO (rs.getInt(1), rs.getString(2), rs.get...
2
public static Reference getReference(String className, String name, String type) { int hash = className.hashCode() ^ name.hashCode() ^ type.hashCode(); Iterator iter = unifier.iterateHashCode(hash); while (iter.hasNext()) { Reference ref = (Reference) iter.next(); if (ref.clazz.equals(className) && ref.n...
4
@Override public int compareTo(final ArraySection<GArray> section) { final GArray array1 = this.array(), array2 = section.array(); int startIndex1 = this.startIndex(); int startIndex2 = section.startIndex(); final int finalIndex1 = this.finalIndex(); final int finalIndex2 = section.finalIndex(); final int ...
6
public void doMotion() { if( (xSpeed < 0.05) && (xSpeed > -0.05) ) { xSpeed = 0; }; if( (ySpeed < 0.05) && (ySpeed > -0.05) ) { ySpeed = 0; }; if( (zSpeed < 0.05) && (zSpeed > -0.05) ) { zSpeed = 0; }; x += xSpeed; y += ySpeed; z += zSpeed; zoom += zoomSpeed; }
6
public void updateTripList () { if (tripListModel == null) return; tripListModel.removeAllElements(); for (Trip t : MainWindow.tripDB.getAllTrips (targetDay.getTime())) tripListModel.addElement (new TripComponent (t)); tfRoster.setText(MainWindow.tripDB.getRosterCount(targetDay.getTime()) + "/" + avai...
3
private static Set<String> permutate(Set<String> digits){ if (digits.size()==1) return digits; Set<String> set = new HashSet<String>(); Set<String> newDigits = new HashSet<String>(); newDigits.addAll(digits); for(String n : digits){ newDigits.remove(n); // System.out.println(newDigits.size()); addAll(...
2
public void setRegip(String regip) { this.regip = regip; }
0
public Music() { Debug.println("Music.Music()"); paused = false; AudioInputStream as = null; URL MUSIC = getClass().getClassLoader().getResource("Sounds/music.wav"); try { as = AudioSystem.getAudioInputStream(MUSIC); } catch (UnsupportedAudioFileException e) { e.printStac...
3
public CustomButton(int x, int y, int width, int height) { //Construct the button super(); setBounds(x, y, width, height); //Set all the visibility to false, besides the text this.setBorder(null); setBorderPainted(false); setOpaque(true); setContentAreaFilled(false); this.setFocusPainted(false); //...
2
public void initFilter(boolean g) { sun = new DirectionalLight(); sun.setDirection(new Vector3f(1f, -1, 0f).normalizeLocal()); sun.setColor(new ColorRGBA(1f, 0.96f, 0.91f, 1f).mult(0.1f)); if(g) rootNode.addLight(sun); sun1 = new DirectionalLight(); sun1.setDirectio...
5
private void firtsFase() { while (y < start.HEIGHT*80/100) { time = (1000 / start.FPS) - (System.currentTimeMillis() - time); if (time > 0) { try { down(); Thread.sleep(200); } catch (Exception e) { } } } }
3
private float readFloat() { switch ( type ) { case MatDataTypes.miUINT8: return (float)( buf.get() & 0xFF); case MatDataTypes.miINT8: return (float) buf.get(); case MatDataTypes.miUINT16: return (float)( buf.getShort...
8
public boolean dealerHit() { if (this.hand.totalvalues()[0] < 17 && this.hand.totalvalues()[0] == this.hand.totalvalues()[1]) { return true; } else if (this.hand.totalvalues()[0] <= 17 && this.hand.totalvalues()[0] != this.hand.totalvalues()[1]) { return true; } else if (this.hand.totalvalues()[1] < 17 && t...
6
private static void setLookAndFeel() { try { OUTER: for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { //System.out.println(info.getName()); switch (info.getName()) { case "Windows": ...
4
public static List<GroupDetailInfo> getGroupsByUser(int userId) throws HibernateException { List<GroupDetailInfo> userGroupsList = null; Session session = HibernateUtil.getSessionFactory().getCurrentSession(); try { // Begin unit of work session.beginTransaction(); String hqlString = "select distinct...
5
public static void deleteDirectory(Path directory) throws IOException { if (!FileUtil.controlDirectory(directory)) { return; } Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttrib...
4
public void revertAndAppend(char c) { if (c != '0' && c != '1') { throw new IllegalArgumentException("Argument must be '0' or '1'"); } append(revert(c)); }
2
public void refresh() { if(!hasBeenActivated) return; synchronized(mutex) { //If any resize operations are in the queue, execute them resizeScreenIfNeeded(); Map<TerminalPosition, ScreenCharacter> updateMap = new TreeMap<TerminalPosition, Scr...
9
public TestBoGenerator( Table table ) { super( table ); this.daoName = "Test" + table.getDomName() + "Bo"; filePath = "src/test/java/" + packageToPath() + "/bo/" + daoName + ".java"; for ( Column column : table.getColumns() ) { if ( column.isKey() ) { ...
2
public CtrlVisiteur(CtrlPrincipal ctrlPrincipal) { super(ctrlPrincipal); vue = new VueVisiteur(this); actualiser(); }
0
@Override public void removeAllWorkSheets() { try { Object ob = mybook.getTabID().getTabIDs().get( 0 ); mybook.getTabID().getTabIDs().removeAllElements(); mybook.getTabID().getTabIDs().add( ob ); mybook.getTabID().updateRecord(); } catch( Exception ex ) { ; } WorkSheetHandle[] ws = getWo...
4
public static String velocityUnitIndexToString(int index) { switch (index) { case 0: return "kph"; case 1: return "mph"; case 2: return "m/s"; case 3: return "kn"; case 4: ...
5
private void updateTrend() { if (getSkinnable().isTrendVisible()) { switch (getSkinnable().getTrend()) { case UP: trendUp.setOpacity(1); trendRising.setOpacity(0); trendSteady.setOpacity(0); trendFalling....
6
private ViterbiNode parseImpl(CharSequence text) { final int len = text.length(); final ArrayList<ArrayList<ViterbiNode>> nodesAry = new ArrayList<ArrayList<ViterbiNode>>(len+1); final ArrayList<ViterbiNode> perResult = new ArrayList<ViterbiNode>(); nodesAry.add(BOS_NODES); for(int i=1; i <= len; i++) node...
6
public void debugPrint() { System.out.println("---------- DEBUG PRINT ----------"); System.out.println("W - Worm"); System.out.println("b - Bacteria"); System.out.println(". - Empty slot"); System.out.println(); for (int y = 0; y < size_y; ++y) { for (int x =...
8
public void rafraichir() { Color[] colors = Constantes.COLORS; int colorInc = 0; boutonChargerLivraisons.setEnabled(false); boutonCalculerItineraire.setEnabled(false); HashMap<Integer, Itineraire> itineraires = manager.getItineraires(); Set<Map.Entry<Integer, Itineraire>> set = itineraires.entrySet(); f...
5
private boolean checkSideCollision(Hitbox prospective, Cell[][] tiles){ int prospectiveY = prospective.getY()/Cell.CELL_HEIGHT; if (prospectiveY > 0 && prospectiveY < tiles.length){ for(int i = 0; i < tiles[0].length; i++){ if(tiles[prospectiveY][i] != null && tiles[prospectiveY][i].getHitbox() != null && pr...
6
private void validate() throws IOException, NullPointerException { if(IndexConfig.statLoc == null ) throw new NullPointerException(); statFolder = new File(IndexConfig.statLoc); if( statFolder.isDirectory() ) { System.err.println("Directory at STAT_LOC already exists, ...
4
@Override public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); switch (cmd.charAt(0)) { case '1': // Send button main.questionG(getInput()); chat.setCaretPosition(chat.getDocument().getLength()); ...
6
public void testCompareTo() { MonthDay test1 = new MonthDay(6, 6); MonthDay test1a = new MonthDay(6, 6); assertEquals(0, test1.compareTo(test1a)); assertEquals(0, test1a.compareTo(test1)); assertEquals(0, test1.compareTo(test1)); assertEquals(0, test1a.compareTo(test1a));...
3
public void undoMove(CheckersMove move, Player turn) { int x1 = move.start.x; int x2 = move.destination.x; int y1 = move.start.y; int y2 = move.destination.y; CheckersPiece captured = move.captured; CheckersPiece moved = array[x2][y2]; array[x2][y2] = null; array[x1][y1] = moved; array[x1][y1].move(new BoardS...
9
@Override public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{ if(setWidth){ width=gc.getWidth(); height=gc.getHeight(); MenuManager.initClick(sbg, width, height); setWidth=false; } if(MenuManager.getMenuType()==0) MenuManager.menuSelect(gc,sbg,g); else ...
3
private void qSortBase(int array[], int left, int right){ if(left>=right) return; int l = left, r = right; int pivot = array[r]; do{ while(array[l]<pivot) l++; while(pivot<array[r]) r--; if(l<=r)...
5
public void startApp() { effect = new EnergyCalculation(); InputStream is = getClass().getResourceAsStream(fileName); try { E = effect.calcEnergy(is, 0, 3000); is.close(); } catch (Exception ex) { ex.printStackTrace(); } System.out....
3
public boolean isValid() { int sum = 0; for(int i = digits.length; i > 0; i--){ int coeff = digits.length - i+1; sum += (digits[i-1]*coeff); } return sum%11 == 0; }
1
private DataPacket ProcessDataPacket(DataPacket dpkt) { DataPacket retval = null; if (dpkt.UltimateDestination == this.MeZone) { // data found me! stop doing everything and eat the data! this.MyColor = new Color(0.0f, 1.0f, 0.0f);// bright green return retval; } int FirstZoneDex = dpkt...
4
public static String sendHttpGet(String url, Header[] headers) { // initializes new HTTP client and GET request CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(url); // sets content type httpGet.setHeaders(headers); // sends HTTP GET request CloseableHttpRespo...
3
public static List<? extends Chewable> printSize( List<? extends Chewable> list) { // Line 10 System.out.println(list.size()); return list; }
2
private WSResponse addFSQData(WSResponse response, FSQData fsqData) { if(fsqData!=null){ if(fsqData.getEvents()!=null && fsqData.getEvents().size()>0){ for (FSQEvent fsq : fsqData.getEvents()) { Events event=new Events(); event.setMessage(fsq.getMessage()); event.setMood(fsq.getMood().getType())...
7
public void testDirectInstantiation() throws Exception { File path = new File(System.getProperty("tempDir")); int sz = 3; Directory[] dirs = new Directory[sz]; dirs[0] = new SimpleFSDirectory(path, null); dirs[1] = new NIOFSDirectory(path, null); dirs[2] = new MMapDirectory(path, null); f...
7
public void run() // Execution { try { NetObjectReader input = new NetObjectReader(socket); //try create a reader with the socket while (true){ //constant loop String updatemsg = (String) input.get(); // create string from the reader.get Scanner sc = new Scanner(up...
5
private void decq(int q) { if (q < 0) { this.quality = q; hq = false; } else { int fl = (q & 0xff000000) >> 24; this.quality = (q & 0xffffff); hq = ((fl & 1) != 0); } }
1
public void repair(int count,Node n,Node badLink) throws ClassNotFoundException, IOException{ Node neighborL = new Node(); Node neighborR = new Node(); if( count !=0 && n.links.get(count -1) !=null){ neighborL = save.read(n.links.get(count -1)); } if(count+1 < n.links.size() && count+1 != n.links.size(...
8
public static int numDistinct(String S, String T) { int slen = S.length(); int tlen = T.length(); if (slen < tlen) return 0; int[][] num = new int[slen][tlen]; for (int i = 0; i < slen; i++) { for (int j = 0; j < tlen; j++) { if (i < j) num[i][j] = 0; else if...
9
public void randomize() { Random r = new Random(); Piece[][] temp = new Piece[8][8]; for (int i = 0; i < temp.length; i++) { for (int j = 0; j < temp.length; j++) { temp[i][j] = null; } } for (int i = 0; i < arr.length; i++) { for (int j = 0; j < arr.length; j++) { int a = r.nextInt(8); i...
5
private boolean isClassEntry(final ZipEntry ze) { String name = ze.getName(); return inRepresentation == SINGLE_XML && name.equals(SINGLE_XML_NAME) || name.endsWith(".class") || name.endsWith(".class.xml"); }
3
public int compareTo(Comp o) { if (value != o.value) { return value < o.value ? 1 : -1; } int res = Long.valueOf(count).compareTo((long) o.count); if (res == 0) { res = Integer.valueOf(key.getRank()).compareTo(o.key.getRank()); ...
4
public static void bringPlayer(Player player, String playerName, String teleportPlayerName) { if (player == null) { StefsAPI.MessageHandler.buildMessage().addSender("$") .setMessage("error.onlyIngame", AdminEye.messages).build(); return; } ArrayList<Player> teleportPlayers = AdminEyeUtils .req...
5
public static void addByChance(LivingEntity entity, MobAbilityConfig ma) { if (entity == null || ma == null) return; if (isValid(entity) && ma.babyRate <= 1.0F && ma.babyRate != 0.0F) { // If the random number is higher than the baby chance we don't turn the mob into a baby if (ma.babyRate == 1.0F ||...
7
public MapObject doNextDeathSpinAction(MapEngine engine, double s_elapsed) { if (!death_spin_started) { death_spin_started = true; death_spin_direction = direction; death_spin_time_left = DEATH_SPIN_TIME; move_speed /= DEATH_SPIN_MOVE_SPEED_DIVISOR; death_spin_delta_direction = turn_sp...
8
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
protected void thinkOfNewTask() { //System.out.println(getName() + " is thinking of a new task to do."); String desiredTask = "reproduce"; //"wear a backpack" is not programmed yet //if(getBackpack() == null) {desiredTask = "wear a backpack";} if(getHealth() < 1) //CHANGE ...
3
public void setFlowBlock(FlowBlock flowBlock) { if (this.flowBlock != flowBlock) { this.flowBlock = flowBlock; StructuredBlock[] subs = getSubBlocks(); for (int i = 0; i < subs.length; i++) { if (subs[i] != null) subs[i].setFlowBlock(flowBlock); } } }
3
public void setRelativeMouseMode(boolean mode) { if (mode == isRelativeMouseMode()) { return; } if (mode) { try { robot = new Robot(); recenterMouse(); } catch (AWTException ex) { // couldn't create ...
3
@SuppressWarnings("unchecked") public Map<String, Object> readDaily(String file) { Map<String, Object> result = new LinkedHashMap<String, Object>(); try{ // Open the file FileInputStream fstream = new FileInputStream(file); // Get the object of DataInputStream ...
9
static void copy(InputStream in, OutputStream out) throws IOException { while (true) { int c = in.read(); if (c == -1) break; out.write((char)c); } }
2
private void resetQuest(int reason) { if(text().length()>0) { Quest theQ=null; for(int q=0;q<CMLib.quests().numQuests();q++) { final Quest Q=CMLib.quests().fetchQuest(q); if((Q!=null)&&(""+Q).equals(text())) { theQ=Q; break; } } if((theQ==null)||(!theQ.running())) affec...
7
public boolean within(final int chunkX, final int chunkZ) { return chunkX >= this.minChunkX && chunkX <= this.maxChunkX && chunkZ >= this.minChunkZ && chunkZ <= this.maxChunkZ; }
3
public String vypisAuto(int i, Auto auto){ String str = "Auto "+ i +"\n"; double potrebaNaloz = 0; for(int k = 0; k < auto.getUdalost().size(); k++){ potrebaNaloz += auto.getUdalost().get(k).getDobaNakl(); } /*System.out.println(potrebaNaloz);*/ str += "Potreba nalozit: " + (1000.0 / 30.0)*p...
8
public JSeparator getjSeparator1() { return jSeparatorTitre; }
0
private static void getCollection() { try { Mongo mongo = new Mongo("localhost", 27017); DB db = mongo.getDB("paldb"); boolean auth = db.authenticate("pal", "admin123".toCharArray()); logger.debug("authenticated: " + auth); Set<String> collections = db.getCollectionNames(); for (String collection...
3
public BufferedImage use(BufferedImage src, Vector<SOMVector> inputVectors) { BufferedImage result = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB); SOMVector tempVec = null; if (closestType) { for (int i = 0; i < getWidth(); i++) { for (int j = 0; j < getHeight(); j++) {...
5
public WidgetStack(int width, int height, int size, int layers, int r, int c) { super(); //setCursor(PointingHandCursor); row = r; col = c; layer = new WidgetHolder[layers]; setMinimumSize(width, height); for (int i=0; i<layers; ++i) { layer[i] = new WidgetHolder(this, width, height, null); l...
1
public static String readFirstLine(InputStream inputStream){ try { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = bufferedReader.readLine().trim(); return line; } catch (FileNotFoundException e) { e.pr...
2
public List<TransformType> getTransform() { if (transform == null) { transform = new ArrayList<TransformType>(); } return this.transform; }
1
public static boolean intToBoolean(int bool) { if(bool == 0) return false; else return true; }
1
public void setPrpMoaTipo(BigInteger prpMoaTipo) { this.prpMoaTipo = prpMoaTipo; }
0
public static void main(String[] args) { char[] message = {79,59,12,2,79,35,8,28,20,2,3,68,8,9,68,45,0,12,9,67,68,4, 7,5,23,27,1,21,79,85,78,79,85,71,38,10,71,27,12,2,79,6,2,8,13,9,1,13,9, 8,68,19,7,1,71,56,11,21,11,68,6,3,22,2,14,0,30,79,1,31,6,23,19,10,0,73, 79,44,2,79,19,6...
5
public void setFeatures(List<Feature> features) { this.features = features; }
0
void chequearTecla(KeyEvent evento) { //jugador 1 if (evento.getKeyCode() == 38) { System.out.println("Mover Arriba"); mover_arriba(); } if (evento.getKeyCode() == 40) { System.out.println("Mover Abajo"); mover_abajo(); } i...
8
private void addActionListeners() { addBackground1btn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { getPicturesPath(background1Field); } }); addBackground2btn.addActionListener(new ActionListener() { @Override public void actionPer...
0
public static LuaTable make(boolean weakkeys, boolean weakvalues) { LuaString mode; if (weakkeys && weakvalues) { mode = LuaString.valueOf("kv"); } else if (weakkeys) { mode = LuaString.valueOf("k"); } else if (weakvalues) { mode = LuaString.valueOf("v"); } else { return LuaTable.tableOf(); } ...
4
public List<Room> getPath() { List<Room> list = new ArrayList<Room>(); HousePath path = this; while (path != null) { list.add(path.last); path = path.getPrevious(); } Collections.reverse(list); final int index = script.roomStorage.getIndex(ctx.players.local()); if (index != -1) { // Clean up p...
6
public void accept(final ClassVisitor cv) { FieldVisitor fv = cv.visitField(access, name, desc, signature, value); if (fv == null) { return; } int i, n; n = visibleAnnotations == null ? 0 : visibleAnnotations.size(); for (i = 0; i < n; ++i) { AnnotationNode an = (AnnotationNode) visibleAnnotations.get...
7
public static String generateCard() { String temp = new String(); String newCard = new String(); int tmp; Random rand = new Random(); int cardDigits[] = new int[16]; // For Visa, 1st digit is always 4 cardDigits[0] = 4; newCard += cardDigits[0]; // Initialize the 2nd-15th digit to a random number ...
5
public static void downloadFile(RestS3Service ss, String bucketName, String objectName, File outputFile, byte[] bytes) throws IOException, ServiceException { // Download an object from its name S3Object downloadedObjectNew = TransferServer.downloadObject(ss, bucketName, objectName); OutputStream output = ne...
1
private boolean displayModesMatch(DisplayMode mode1, DisplayMode mode2) { if (mode1.getWidth() != mode2.getWidth() || mode1.getHeight() != mode2.getHeight()) return false; if (mode1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI && mode2.getBitDepth() != DisplayMode.BIT_DEPTH_MULT...
8
private void addItemToHrefs(String href) { if (href.contains("https")) { String properHref = href.replace("https://" + base_url, ""); if (!(temporaryInternalHrefs.contains(properHref))) temporaryInternalHrefs.add((properHref)); } else if (href.contains("#")) { String properHref = href....
5