text
stringlengths
14
410k
label
int32
0
9
public void setCurrentItem(int par1, int par2, boolean par3, boolean par4) { boolean var5 = true; int var7; if (par3) { var7 = this.getInventorySlotContainItemAndDamage(par1, par2); } else { var7 = this.getInventorySlotContainItem(par1...
7
@Override public void mouseWheelMoved(int change){ selectedInv += change / 120; if(selectedInv > player.playerInv.inv.length - 1) selectedInv = 0; if(selectedInv < 0) selectedInv = player.playerInv.inv.length -1; }
2
public String classifyIt(String word) { int n = word.length(); char c[] = new char[n]; char cf[] = new char[n]; c = word.toCharArray(); int ans = 0; for(int i = 0;i < n;i++){ if(c[i] != c[n - i - 1]){ ans = 1; } } if(ans == 0)return "PALINDROME"; int ans1 = 0; int k = 0; for(int i = 0;i ...
9
public ProBotGame() { //For JFrame super("ProBot"); setDefaultCloseOperation(EXIT_ON_CLOSE); setResizable(false); this.upgradeManager = new UpgradeManager(); this.menuManager = new MenuManager(this); this.gui = new Gui(this); this.canvas = new GameCanvas(this); add(this.canvas, BorderLayout.C...
0
public void readParams() throws IOException { Set<String> allParams = paramsSet(); // Read normal non-multipart params. Map<String, String> parentParams = mParent.getParams(); for (String name : allParams) { if (!parentParams.containsKey(name)) { ...
9
public ScreenShotsManager(String videoFileName) { filePrefix = videoFileName.substring(0, videoFileName.indexOf(".")); File outputDir = new File(outputDirectory); if (!outputDir.exists()) outputDir.mkdirs(); }
1
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 fe...
6
public static void createAccessorUnitsForSlot(StorageSlot slot, Stella_Class renamed_Class, boolean mixinaccessorsP, boolean signaturesonlyP) { { Cons methodtree = null; MethodSlot method = null; if (StorageSlot.systemDefinedSlotReaderP(slot)) { methodtree = StorageSlot.yieldSlotReaderTree(slot...
9
public final String getFinger() { return _finger; }
0
@Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; //draw points for (Point p : points) { g.drawRect(p.x, p.y, 1, 1); } //draw rectangle if (rectangle != null) { for (int i = 0; i < 4; i++) { Point p1 = rectangle[i]; Point p2 = rect...
3
static String ReadLn(int maxLength) { // utility function to read from stdin, // Provided by Programming-challenges, edit for style only byte line[] = new byte[maxLength]; int length = 0; int input = -1; try { while (length < maxLength) ...
6
public String toString() { return super.toString(); }
0
public RefereeProgram() { // initialise the number of elements in the referee class array elementsInArray = 0; // initialise the referee class array with null values refereeClassArray = new RefereeClass[MAX_REFEREES]; for (int i = 0; i < MAX_REFEREES; i++) refereeClassArray[i] = null; }
1
private void renderBubble( Rendering rendering, Bubble bubble, Vec3D flatPoint, boolean fromRight ) { // // Some of this could be moved to the constants section- final float x = flatPoint.x + bubble.xoff, y = flatPoint.y + bubble.yoff, //TW = BUBBLE_TEX.xdim(), //TH = BUBB...
4
private void appendStmt(final Stmt stmt) { if (Tree.DEBUG) { System.out.println(" append: " + stmt); } stmt.setParent(this); stmts.add(stmt); }
1
private static void printPartialFieldMap(Field[][] pMap) { System.err.println("pMap"); for (int y=0; y<pMap[0].length; y++) { for (int x=0; x<pMap.length; x++) { if (pMap[x][y] != null) { Object o = pMap[x][y].object; if (x==2 && y==2) System.err.print(" a"); if (o instanceof Box) System.err...
7
@Test @Ignore // not supported yet in FlowDroid public void runTestStaticInitialization1() throws IOException { InfoflowResults res = analyzeAPKFile("GeneralJava_StaticInitialization1.apk"); Assert.assertEquals(1, res.size()); }
0
public static void printPascalTriangle(int n) { int[][] grid = new int[n][n]; // first loop for number of rows for( int i=0; i< grid.length; i++) { //second loop for number of elements for( int j = 0; j < i+1; j++) { // i-1 and j-1 are greater or equals to...
7
public static void extractPlaces(JSONObject root, ArrayList<Bookmark> bookmarksList) { if (root.get("type").equals("text/x-moz-place-container")) { // recursion JSONArray rootChildren = (JSONArray) root.get("children"); if (rootChildren != null) { for (Object child : rootChildren) { extractPlaces((J...
7
public void playTurn(Player p, int diceThrow) { Cell currCell = this.getCell(p.getCurrentCell()); if(currCell.canBeLeftNow()){ int idxNextCell; // Makes the score stay within the bounds System.out.print(p.getName()+" throws a "+diceThrow+""); if(p.getCurrentCell()+diceThrow==63){ System.err.println(...
4
void radf4(final int ido, final int l1, final double in[], final int in_off, final double out[], final int out_off, final int offset) { final double hsqt2 = 0.707106781186547572737310929369414225; int i, ic; double ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4, w1r, w1i, w...
7
public InteractiveObject getInteractiveObject(int x, int y, int z) { Ground tile = groundArray[z][x][y]; if (tile == null) return null; for (int e = 0; e < tile.entityCount; e++) { InteractiveObject entity = tile.interactiveObjects[e]; if ((entity.uid >> 29 & 3) == 2 && entity.tileLeft == x && entit...
5
public static Func getCallableSingleFunctions(Object obj, String funcStr) { if (StringUtils.isEmpty(funcStr) || StringUtils.isBlank(funcStr)) { return null; } int PRE_ARGS_NUM = -1; Class<?>[] PRE_ARGS_TYPE = null; try { PRE_ARGS_NUM = obj.getClass().getD...
9
protected void majVoieSuivante(Voie voie) { if (route == null) { route = new Route(voie); setChanged(); notifyObservers(route); } else if (route.setTo(voie)) { setChanged(); notifyObservers(route); } voieCourante = voie; }
2
public void setSelectionObjects() { getCurrentGraph().deselectAll(); for (Vertex vertex : selectionVertexes) { vertex.selectOn(); } for (Edge edge : selectionEdges) { edge.selectOn(); } for (Vertex vertex : getCurrentGraph().getVertexes()) { if (vertex.isVertexInArea(pointSelectionBegin, pointSelec...
6
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof NotFilter)) return false; NotFilter notFilter = (NotFilter) o; if (filter != null ? !filter.equals(notFilter.filter) : notFilter.filter != null) return false; return true; }
4
public void keyReleased(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_C: gui.switchTool(new ChainPolygon(vertices, gui)); break; case KeyEvent.VK_F: gui.switchTool(new FreeDraw(vertices, gui)); break; ...
9
public void passRightMouseClick(float mouseX, float mouseY) { ArrayList<GameEntity> s = main.menuSystem.stack; if (s.size() > 0) { //System.out.println(s.size()); Tile t = main.menuSystem.getMouseHighlighted(); if (t != null) { if (main.grid.hasEnemy(s.get(0), t.row, t.col) != null) { i...
8
public void processGroups() { groups = new ArrayList<GroupAi>(); for (Square[] c : squares) { for (Square s : c) { if (s.piece != null) { boolean inGroup = false; for (GroupAi g : groups) { if (g.pieces.contains(s.piece)) { inGroup = true; break; } ...
6
private Action nextSomaOrderFor(Actor actor) { if (stocks.amountOf(SOMA) <= 0) return null ; if (actor.traits.traitLevel(SOMA_HAZE) > 0) return null ; final float price = priceFor(SOMA) / 10f ; if ((price > actor.gear.credits() / 2) || ! isManned()) return null ; final Action drops = new Action...
4
public static Color getColor(String name) { if (name == null) return null; if (name.charAt(0) == '#') // hex encoding return Color.decode(name); for (ColorNameMap col : map) { if (name.equalsIgnoreCase(col.colorName)) return col.jColor; } return null; }
4
public int bonusUnite() { int count = 0; List<Peuple> lstTmp; for (Territoire t : this.territoiresOccupes) { boolean vide = true; for (int i = 0; i < Partie.getInstance().getTourEnCours(); i++) { lstTmp = t.getPrisesDuTerritoire(i); if (lstTmp.size() > 0) { if (! lstTm...
7
void drawEntity(Entity entStore) { double x = entStore.intLocX-LocX+viewRange; double y = entStore.intLocY-LocY+viewRange; //Draw flag if (entStore.intFlag != 0) { if (entStore.intFlag == 1) { gD.setColor(Color.green); gD.drawRoundRect((int)(x*intImageSize),(int)(y*intImageSize), intImag...
7
public String [] getOptions() { String [] options = new String [10]; int current = 0; if (m_noCleanup) { options[current++] = "-L"; } if (m_unpruned) { options[current++] = "-U"; } else { if (!m_subtreeRaising) { options[current++] = "-S"; } options[current++] = ...
7
public static void hit(int x, int y) { System.out.println("AI - hit!"); if(!destroyingFoundShip) { System.out.println("AI - found a ship!"); destroyingFoundShip = true; lastNewShip = new Point(x, y); } hitLocs.add(new Point(x , y)); }
1
public Tile getTile(int x, int y) { if(0 > x||x>=width||0 > y||y>=height){return Tile.VOID;} return Tile.tiles[tiles[x+y*width]]; }
4
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed JFileChooser chooser = new JFileChooser("/"); int returnVal = chooser.showOpenDialog(this); if(returnVal == JFileChooser.APPROVE_OPTION) { jTextField8 .setText(chooser.getS...
1
public Term substitute(Term term, Term replacement) { // The only thing that you can substitute in a predicate is an argument, // so we just have to iterate over all arguments and propagate the // substitution request. List<Term> substitutedArgs = new ArrayList<Term>(args.size()); ...
1
private IMOperation getImOperation() { IMOperation imOp = new IMOperation(); imOp.addImage("-"); if (iMagickSettings.isUnsharpMaskEnabled()) { double radius = iMagickSettings.getUnsharpMaskRadius(); double sigma = Math.sqrt(radius); imOp.unsharp(radius, sigma,...
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; PointWithHamma that = (PointWithHamma) o; if (Double.compare(that.hamma, hamma) != 0) return false; ...
5
public static void rebuildSessionFactory() { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } }
1
public Object getValueAt(int row, int column) { if ((row < getRowCount()) && (column < getColumnCount()) && (row >= 0) && (column >= 0)) { switch (column) { case StatisticsModel.NAME_COLUMN: return data[NAME_COLUMN][row]; ca...
6
public Karte ziehKarte() { Karte k = deck.remove(0); if(!enableNine && k.getTyp() == Typ.Neun) { return ziehKarte(); } return k; }
2
public static String stringCheck (String input, HashSet<String> dictionary){ // This method makes sure user input is four letters, is in the dictionary HashSet, and is lower case, and informs user of specific errors boolean error = false; if (input.length() != 4){ System.out.println("Error: Your word is not f...
3
private static void write() { try { File file = new File(SavePath.getSettingsPath()); if (!file.exists()) { file.createNewFile(); } FileWriter fileWriter = new FileWriter(file.getAbsoluteFile()); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); bufferedWriter...
2
public void apply() { if(!applied) { applied = true; prevPosition = model.positions.get(actor); nextPosition = prevPosition; Vector2 velocity = actor.velocity; if(actor instanceof Collidable) { SortedMap<Double, Collidable> intersections = Collision.collision(model, (Collidable)actor, velocity); ...
6
boolean validTreeLocation() { int[] var1 = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; int[] var2 = new int[]{this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; int var3 = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); i...
4
public Texture getErrorTexture() { Texture tex = (Texture) table.get("Error"); if (tex != null) { return tex; } try { tex = org.newdawn.slick.opengl.TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream(System.getProperty("resources") + "/sprites/Error.png")); } ...
3
public void updateImage() { if (facing == 0) { toggleImage(4); } if (facing == 1) { toggleImage(1); } if (facing == 2) { toggleImage(3); } if (facing == 3) { toggleImage(2); } }
4
public static ArrayList getRepresentativeTags(Map imagesTags, int percentage) { ArrayList representativeTags = new ArrayList<String>(); /* 1. Create Map "alltags" tag => count (0) 2. Count all occurrences and add to tag pool 3. Choose "int count" REFERENCE_TAG_PERCE...
6
public void addVictim(Animal animal) { victims.add(animal); }
0
public void paint(Graphics g) { super.paintComponent(g); g.setColor(Color.white); g.fillRect(0, 0, 3000, 2000); g.setColor(Color.black); g.drawString("Play Speed: "+playSpeed, box.resolution().width-120, box.resolution().height-100); long currentTime = System.currentTimeMillis(); if (currentTime > nextS...
5
public void initialize() throws Exception { int numOfAttributes; int numOfInstances; int i; int j; Change = 0.0; //Manipulate Data if (NormalizeData) { m_Filter = new Normalize(); m_Filter.setInputFormat(m_Instances); m_Instances = Filter.useFilter(m_Instances, m_Filter);...
9
@Override public List<Produto> findProdutosRelacionados(Long idProduto) { Produto produto = findById(idProduto); List<Categoria> categorias = produto.getCategorias(); Set<Long> idsCategorias = new HashSet<>(); for (Categoria categoria : categorias) { idsCategorias.add(categoria.getId()); } List<Pr...
2
private void initComponents() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { System.out.println("Unable to set LookAndFeel..."); } timer = new Timer(1000, taskPerformer); setLayout(...
1
private void addOccupant(T occupant) { Class cl = occupant.getClass(); do { if ((cl.getModifiers() & Modifier.ABSTRACT) == 0) occupantClasses.add(cl); cl = cl.getSuperclass(); } while (cl != Object.class); }
2
@Override public V put(K key, V value) { // Check and call rehash() if needed: if(this.size() > 0.75 * capacity) { rehash(); } V oldValue = null; int index = Math.abs(key.hashCode()) % SIZE; if(buckets[index] == null) { buckets[index] = new L...
5
public void init() { int index = 0; for (int r = 0; r < 6; r++) { for (int g = 0; g < 6; g++) { for (int b = 0; b < 6; b++) { int rr = (r * 255 / 5); int gg = (g * 255 / 5); int bb = (b * 255 / 5); colours[index++] = rr << 16 | gg << 8 | bb; } } } screen = new Screen(WIDTH, HEI...
3
private void bLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bLoadActionPerformed JFileChooser jfc = new JFileChooser(); if (lastLoadDir != null) { jfc.setCurrentDirectory(lastLoadDir); } jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); if (j...
4
public void visit_irem(final Instruction inst) { stackHeight -= 2; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 1; }
1
public Integer getDistanceToStart() { if (river == null) return 0; return river.getDistanceToStart(); }
1
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "KeySize", scope = EncryptionMethodType.class) public JAXBElement<BigInteger> createEncryptionMethodTypeKeySize(BigInteger value) { return new JAXBElement<BigInteger>(_EncryptionMethodTypeKeySize_QNAME, BigInteger.class, EncryptionMetho...
0
public int countAll(){ Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConnection(dbCon.getDATABASE_URL(), dbCon.getDB_U...
5
public void run() { running = true; final int CHAT_PORT = 4712; try { ServerSocket chatServerSocket = new ServerSocket(CHAT_PORT); ServerDataBaseManager sDBM = new ServerDataBaseManager(); while (true) { if (running) { new ChatServerExecutionThread(chatServerSocket.accept(), sDBM).start(); }...
3
public float ms_per_frame() // E.B { if (h_vbr == true) { double tpf = h_vbr_time_per_frame[layer()] / frequency(); if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2; return ((float) (tpf * 1000)); } else { float ms_per_frame_array[][] = {{8.707483f, 8.0f, 12.0f}, ...
3
private void outputAndCompare(String line) throws ControllerException { output.println(line); output.flush(); if (gui != null) { gui.outputFileUpdated(); gui.setCurrentOutputLine(outputLinesCounter); } outputLinesCounter++; if (comparisonFile !=...
5
private void afterDataAccess(CacheResult cacheResult, Object[] args) throws CacheUnreachableException { CacheDefinition cacheDefinition = cacheDefinitionCollection.getCacheDefinition(); // 如果不是缓存获取操作,则只需要进行简单的缓存删除和版本信息更新 if (cacheDefinition == null) { updateVersion(args); deleteCache(args); return; } ...
7
public static Graph tree(int V) { Graph G = new Graph(V); // special case if (V == 1) return G; // Cayley's theorem: there are V^(V-2) labeled trees on V vertices // Prufer sequence: sequence of V-2 values between 0 and V-1 // Prufer's proof of Cayley's theorem: Prufer sequences are in 1-1 // with la...
8
public Shape clone() { Shape clone = null; try { clone = (Shape) super.clone(); } catch (CloneNotSupportedException exception) { System.out.println("Exception :" + exception); exception.printStackTrace(); } return clone; }
1
private int executeRandomMusics() { int countMusics = 0; int index = 0; while(countMusics != getMusics().size()){ index = getAleatoryNumber(index); getMusics().get(index).play(); if(!isRamdom) break; } return index; }
2
static void gwar_draw_sprites_16x16(osd_bitmap bitmap, int xscroll, int yscroll ){ GfxElement gfx = Machine.gfx[GFX_SPRITES]; //const unsigned char *source = &memory_region(REGION_CPU1)[0xe800]; UBytePtr source = new UBytePtr(memory_region(REGION_CPU1),0xe800); ...
8
@Override protected void mutate(Individual indiv) { Sudoku sudoku = (Sudoku)indiv; Random r = new Random(); for(int i=0; i<numOfTries; i++){ //choose a row int row = r.nextInt(9); //choose a begin point of cut int cut1 = r.nextInt(9); //choose a end point of cut int cut2 = r.nextInt(9); ...
9
public void pruneAllNodeEvents() { EventQueue eq = new EventQueue(); eq.listeners = this.listeners; // inherit the listeners Iterator<Event> eventIter = iterator(); while(eventIter.hasNext()){ Event e = eventIter.next(); if(e.isNodeEvent()) { e.free(); // also frees a corresponding packet event, incl...
2
public static void main(String[] args) throws IOException { if (args.length == 0 || args[0].equals("help")) { System.out.println("\n \tSNP-SVM v. 0.02"); System.out.println("\tBrendan O'Fallon, ARUP Labs, Salt Lake City, Utah"); System.out.println("\tbrendan.d.ofallon@aruplab.com"); System.out.pr...
6
public static Op GOT(Op newOp) { int k = 0, j = 0; StateVector vecNew = newOp.getStateVec(); for (k = 0; k < hBuffer.size(); k++) { Op opTmp = hBuffer.get(k); StateVector vecTmp = opTmp.getStateVec(); // a, b are independent if (!isDependent(vecTmp...
8
public ExprInfo(final Expr expr, final ExprKey key) { this.key = key; prototype = (Expr) expr.clone(); // Clean up the expression's children (remember that expr's children // are also cloned, so we aren't changing the tree). prototype.visitChildren(new TreeVisitor() { public void visitStoreExpr(fin...
3
private int[] getCampusDistributionData() { CourseList model = super.getModel(); campusDistribution.clear(); CourseOffering[] offerings = model.getSelectedCoursesOfferings(); String campus = null; for(int i = 0; i < offerings.length; i++) { campus = offerings[i].getLocation().toUpperCase(); if(campus.eq...
4
@EventHandler public void PlayerResistance(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.getPlayerConfig().getDouble("Player.Resi...
6
public int getSetDamage(String type) { if(type.equals("face")) { return FACE_DAMAGE; } else if(type.equals("slash")) { return SLASH_DAMAGE; } else if(type.equals("gutpunch")) { return GUTPUNCH_DAMAGE; } return 0; }
3
public Set<Map.Entry<K,Byte>> entrySet() { return new AbstractSet<Map.Entry<K,Byte>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TObjectByteMapDecorator.this.isEmpty(); } public bool...
6
private void generateClassroom() { ArrayList<Point> doors; if (day.getNextCourse().ordinal() == 0) // first class (could hardcode as HUMANITIES) { playerX = playerY = 5; screenX = screenY = 0; destination = null; doors = campus.getDoors(true); for (int i=0; i<TILESX; i++) { for (int j=0...
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 void txtSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchActionPerformed DefaultTableModel model=(DefaultTableModel)jTable1.getModel(); model.getDataVector().removeAllElements(); tableIndex=0; model.fireTableDataChanged(); int key...
8
public static void warpSign(Player player, Warp to) { if (Settings.delay == 0 || (Settings.opsBypassDelay && player.isOp()) || (Settings.permsBypassDelay && player.hasPermission("easywarp.delay.bypass")) || (Settings.signsBypassDelay)) { warp(player, to); return; } dela...
6
@Override protected void paintComponent(Graphics graphics) { super.paintComponent(graphics); for (Piirrettava piirrettava : piirrettavat){ piirrettava.piirra(graphics); } }
1
protected Integer calcBPB_SecPerClus() throws UnsupportedEncodingException { byte[] bTemp = new byte[1]; for (int i = 13;i < 14; i++) { bTemp[i-13] = imageBytes[i]; } BPB_SecPerClus = byteArrayToInt(bTemp); System.out.println("BPB_SecPerClus = " + BPB_SecPerClus); ...
1
public AnimationPoints(int directions, int frames, String points) { this.points = new Point2D[directions][frames]; ArrayList<Point2D> temp = new ArrayList<Point2D>(); String[] line = points.split(";"); for(int x = 0; x<line.length; x++) { String[] tempPoint = line[x].split(","); temp.add(new Point2D.Fl...
3
public void run(){ while (true){ for (int i = 0; i<anzahlAmpeln; i++){ int x=(Math.random()<0.5)?0:1; //System.out.println("random x=" +x); if (x==0){ ampeln[i].setRed(); System.out.println("Ampel #" +i+" auf rot gesetzt."); try { sleep(100); } catch (InterruptedExcept...
6
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
0
private static Set<Class<?>> getFromJARFile(String jar, String packageName) throws FileNotFoundException, IOException, ClassNotFoundException { Set<Class<?>> classes = new HashSet<Class<?>>(); JarInputStream jarFile = new JarInputStream(new FileInputStream(jar)); JarEntry jarEntry; do { ...
7
static void AgentsCreation(){ /* Initialises all teams, agents and weapons. Currently initialises agents by input * and weapons by hand. To do: initialise create more weapons, add random initialisation, etc * also add checks for all the input getting */ Gun pistol = new Gun("Pistol", 3, 70, 2); Gun h...
9
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!plugin.hasPerm(sender, "user", true)) { sender.sendMessage(ChatColor.YELLOW + "You do not have permission to use /" + label); return true; } if ((args.length == 3) && (args[1].equalsIgnoreCase("ren...
5
public void testConstructor_ObjectStringEx6() throws Throwable { try { new LocalDateTime("10:20:30.040+14:00"); fail(); } catch (IllegalArgumentException ex) {} }
1
public String[] toDTO(Ticket ticket) throws ParseException { String[] dto = new String[8]; try { String place = new PlaceTranslator().toDTO(ticket.getPlace()); String row = new RowTranslator().toDTO(ticket.getPlace().getRow()); String seance = new SeanceTranslator().toDTO(ticket.getSeance());...
1
public static Object escape(Object original) { if (original instanceof Character) { char u = (char) ((Character)original); int idx = "\b\t\n\f\r\"\'\\".indexOf(u); if (idx >= 0) return "\\"+"btnfr\"\'\\".charAt(idx); if (u < 32) re...
8
public Person2(String pname) { name = pname; }
0
public boolean isEmpty() { return (id == null) && (name == null); }
1
private void ok() { mcdobject.clearInformations(); for (int i = 0; i < listDroite.getSize(); i++) { data.setUse(listDroite.getKey(i), true); mcdobject.addInformation(listDroite.getKey(i)); } // Vérifie que le nom n'est pas utilisé par quelqu'un d'autre ...
4
public void ustalKtoWygral() { iloscTrafionychGRACZ = 0; iloscTrafionychPRZECIWNIK = 0; JLabel ikonaTrafionePole2 = new JLabel(img_trafionePole2); for(int a = 0;a < 10; a++) for(int b = 0;b < 10; b++) { if(lb_polaGry_GRACZ[b][a].getIcon().toString().equals(ikonaTrafionePole2.getIcon().toStr...
8
public boolean checkRomanNr(String romanNumber) { float[] substractOperations = new float[9]; char currentLetter = romanNumber.charAt(0); if (romanNumber.length() > 1) { char nextLeter = romanNumber.charAt(1); float globalMax; if (getValue(currentLetter) < g...
8