text
stringlengths
14
410k
label
int32
0
9
public ConstantArrayOperator(Type type, int size) { super(type); argType = (type instanceof ArrayType) ? Type .tSubType(((ArrayType) type).getElementType()) : Type.tError; Object emptyVal; if (argType == type.tError || argType.isOfType(Type.tUObject)) emptyVal = null; else if (argType.isOfType(Type.tB...
8
@Override public GameState doAction(GameState state, Card card, int time) { if(time == Time.DAY) { state = preacherDay(state, card); } else if(time == Time.DUSK) { PickTreasure temp = new PickTreasure(); state = temp.doAction(state, card, time); } else if(time == Time.NIGHT) { //Do nothi...
3
private void buttonClicked(int id){ System.out.println("click click : " + id); if(id == 0){ Crafting.craft(player, Crafting.Sticks); } if(id == 1){ Crafting.craft(player, Crafting.CraftTable); } }
2
public static void programme(String chaine, int nbEch, float amplMin, float amplMax, String forme, float snr, boolean sondes) throws InformationNonConforme { // Forme int type; // Message aleatoire ? boolean aleatoire; float teb; if (Pattern.matches("\\d{1,6}", chaine)) { aleatoire = true; } ...
9
public List<SubCategory> getDataForMoment(int year, int month) { // Itereer door alle subsets heen en retourneer de dichtsbijzijnde selected subcat periods List<SubCategory> result = new ArrayList<SubCategory>(); // Itereer de datasets for (DataSet set: this.datasets) { for (Category cat: s...
8
public Chlodzenie produkujemyChlodzenie(){ return null; }
0
@Override public void actionPerformed(ActionEvent ev) { if (ev.getSource().equals(btnCancel)) { fireWizardEvent(new WizardEvent(WizardEvent.WIZARD_EVENT_CANCEL)); } else if (ev.getSource().equals(btnNext) && ev.getActionCommand().equals(FINISH_TEXT)) { fireWizardEvent(new WizardEvent(WizardEvent.WIZARD_E...
9
public void deleteAdmin(int index){ if (getAdminSize()==1) JOptionPane.showMessageDialog(null, "There should be at least one Admin user, user is not deleted","Delete", JOptionPane.ERROR_MESSAGE); else{ admin.remove(index); JOptionPane.showMessageDialog(null, "Admin is deleted","Delete", JOptionPane.PLAIN_M...
1
public static OperatingSystem detect() { String s = System.getProperty("os.name").toLowerCase(); if (s.contains("win")) { return OperatingSystem.WINDOWS; } if (s.contains("mac")) { return OperatingSystem.MAC_OS_X; } if (s.contains("solaris") || s.c...
6
* @param errorP * @return Module */ public static Module getStellaModule(String pathname, boolean errorP) { { StringWrapper wrappedpathname = new StringWrapper(); Module module = null; wrappedpathname.wrapperValue = pathname; { MemoizationTable memoTable000 = null; Cons memoizedEn...
8
public int getUptime() { return lastUptime; }
0
public static <E extends Comparable<E>> BinaryTreeNode<E> deleteNodeRec(BinaryTreeNode<E> node, E value) { if(node == null) { return node; } if(value.compareTo(node.value)<=0) { node.left = deleteNodeRec(node.left, value); } else if(value.compareTo(node.value)>0) { node.right = deleteNodeRec(node.ri...
8
@Override public JSONObject main(Map<String, String> params, Session session) throws Exception { JSONObject rtn = new JSONObject(); long activeUserId = session.getActiveUserId(); long venueId = Long.parseLong(params.get("id")); Venue venue = Venue.findById(venueId); if(venue == null) { rtn.put("rtnC...
1
public static void main(String args[]){ CountDownLatch latch = new CountDownLatch(3); ExecutorService ex = Executors.newFixedThreadPool(3); for (int i =0; i<3;i++){ ex.submit(new processor(latch)); } try { latch.await(); } catch (InterruptedException e) { // TODO Auto-generated catch block ...
2
@Override public void execute(CommandSender sender, String worldName, List<String> args) { this.sender = sender; if (worldName == null) { error("No world given."); reply("Usage: /gworld setgamerule <worldname> <rulename> <value>"); } else if (!hasWorld(worldName)) { reply("World not found: " + worldN...
4
public boolean validarFeed(Feed feed) throws ObjetoNuloException{ if(feed == null){ throw new ObjetoNuloException("Feed is null"); } if(feed.getDescription().equals("")){ throw new ObjetoNuloException("Feed.description is null"); } if(feed.getLi...
4
private OthelloBoardPrinter(){}
0
public Point getDrawLocation() { Point p = this.getLocation(); int sizepx = 10; if (layout == Port.RELATIVE) { } else if (layout == Port.NORTH) { p.y -= sizepx; p.x -= sizepx / 2; } else if (layout == Port.EAST) { p.y -= sizepx / 2; } else if (layout == Port.WEST) { p.x -= sizepx; p.y -= size...
9
private void expand2(byte[] src, byte[] dst) { for(int i=1,n=dst.length ; i<n ; i+=4) { int val = src[1 + (i >> 2)] & 255; switch(n-i) { default: dst[i+3] = (byte)((val ) & 3); case 3: dst[i+2] = (byte)((val >> 2) & 3); case 2: dst[i+...
4
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { String dir=CMParms.combine(commands,0); if(commands.size()>0) dir=commands.get(commands.size()-1); final int dirCode=CMLib.directions().getGoodDirectionCode(dir); if(!preInvoke(mob,commands,gi...
8
public boolean canSplitInDim(int i) { int data = 0; boolean seen = false; for (MultiColor c : freqTable.keySet()) if (inside(c)) if (c.data[i] != -1) if (!seen) //First val we see { ...
5
public static void createSubBatchfile(String path, String batchfile, int contentInPercent, int session) { int numberExamples= -1; try { numberExamples = TestSupervisor.count(path + batchfile); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } ArrayList<Integer> num...
9
public Persistent LoadData() { Persistent p = null; try { p = DataWorker.Instance().LoadObjectById(this.Id, this); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } return p; }
1
private void writeBKGD() throws IOException { if (param.isBackgroundSet()) { ChunkStream cs = new ChunkStream("bKGD"); switch (colorType) { case PNG_COLOR_GRAY: case PNG_COLOR_GRAY_ALPHA: int gray = ((mxPngEncodeParam.Gray) param) .getBackgroundGray(); cs.writeShort(gray); b...
6
private void executeNextAction() { if (actions != null && actions.size() > 0) { switch (actions.get(0)) { case A: avancer(); break; case G: rotateLeft(); break; case D: rotateRight(); break; } } }
5
public int historicalNumParams(int type){ switch (type) { case HE_POP_SIZE: return 1; case HE_POP_SIZE_EXP: return 3; /* end_gen, start_size, end_size */ case HE_BOTTLENECK: return 1; case HE_ADMIX: return 1; case HE_MIGRATION: return 1; case HE_SPLIT: return 0; case HE_SWEEP: ...
7
private void addComponentsToPane() { JButton button = new JButton("Clear"); //button.addActionListener(this); typingArea = new JTextField(20); typingArea.addKeyListener(this); displayArea = new JTextArea(); displayArea.setEditable(false); ...
0
protected void onUnknown(String line) { // And then there were none :) }
0
private void createProgram() { shaderProgram = ARBShaderObjects.glCreateProgramObjectARB(); if(shaderProgram == 0) return; /* * if the vertex and fragment shaders setup sucessfully, * attach them to the shader program, link the sahder program * (into the GL context I suppose), and validate */ ARBSha...
3
static String toText(Color color) { String text = colorMap.get(color); if (null == text && null != color) { StringBuilder sb = new StringBuilder(); sb.append('[').append(color.getRed()). append(',').append(color.getGreen()). append(',').app...
2
@Override public Set<Record> getRecords(Account account) { Set<Record> records = new HashSet<Record>(); PreparedStatement pStmt = null; ResultSet rs = null; try { pStmt = conn.prepareStatement("SELECT * FROM RECORD WHERE id_account = ? ORDER BY id;"); pStmt.setInt(1, account.getId()); rs = p...
2
@Override public void execute(String args) { String[] array = args.split(" "); String temp = ""; for (int i = 1; i < array.length; i++) { temp += array[i] + " "; } try { Server.broadcast((new Data(temp, "[SERVER]", Color.MAGENTA, InetAddress.getLocalHost())).getData()); } catch (Socke...
3
public void createTable() throws Exception { String columnFamilyDir; String DBLocation; Configuration config = new Configuration(); DBLocation = config.getDBLoc(); long StartTime = System.currentTimeMillis(); MetaStore meta = new MetaStore(); meta.setTable(this.TableName); meta.setColumnFamily(this.Col...
5
public String getParsedTime() { String time = ""; if(!ampm) { if(minute <10) { time += Integer.toString(hour) +":0" +Integer.toString(minute); } else { time += Integer.toString(hour) +":" +Integer.toS...
5
public boolean GenerateRoomItem() { Grizzly.GrabDatabase().SetQuery("SELECT * FROM server_room_items WHERE room = '" + this.ID + "' ORDER BY id DESC LIMIT 1"); try { ResultSet Results = Grizzly.GrabDatabase().GrabTable(); while (Results.next()) { this.FloorItems.put(Results.getInt("id"), ne...
2
@Test public void pointIsAdded() { Point p = vc.addPoint(3, 5); Vertex test = vc.getVertices().toLinkedList().getNext(); assertTrue(p.X() == 3 && p.Y() == 5 && test.X() == 3 && test.Y() == 5); }
3
private List<Integer> availableIndex() { List<Integer> list = new LinkedList<>(); for (int i = 0; i < tiles.length; i++) { if (tiles[i].empty()) list.add(i); } return list; }
2
public static void main(String[] args) { final double[][] matrix = generateMatrix(10, 1000000); evaluate(new Runnable(){ @Override public void run() { for (int i = 0; i<matrix.length; i++){ for (int j = 0; j< matrix[i].length; j++){ ...
5
public void setSpecialArrangement(int i, String sa){ specialArrangement[i]=sa; }
0
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { String[] queue = plugin.queue; if (args.length == 0) { queue = new String[queue.length]; return true; } return false; }
1
public void setTab(GraphicsTab tab) { Control[] children = tabControlPanel.getChildren(); for (int i = 0; i < children.length; i++) { Control control = children[i]; control.dispose(); } if (this.tab != null) this.tab.dispose(); this.tab = tab; if (tab != null) { setDoubleBuffered(tab.getDoubleBuffered()); ...
8
@Test public void reTest1() { userInput.add("hi"); userInput.add("my name is meng meng"); userInput.add("can you tell me about hamburger"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add("handle the error"); ...
7
public static int[] generaVector(int tamaño, boolean modo) { int[] res = new int[tamaño]; if (modo) { for (int i = 0; i < tamaño; i++) { res[i] = i + 1; } java.util.Random r = new java.util.Random(); for (int i = 0; i < tamaño; i++) { ...
4
@Override public void fill(Graphics2D g){ velocity*=decay; Point2D prev = new Point2D.Double(phys.getX(),phys.getY()); boolean moveWithPlayer=false; if(Display.player.me(0,1).intersects(phys)&&collide){ moveWithPlayer=true; } phys=new Rectangle2D.Double(phys.getX(),phys.getY()+velocity,phys.getWidth(),p...
3
private void initComponents() { saveButton = new JButton(rh.getString(PROPERTY_NAME, BUTTON_SAVE)); saveButton.addActionListener(this); saveButton.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { if (e.getKeyChar() == KeyEvent...
9
private void getNextChangingElement(int a0, boolean isWhite, int[] ret) { // Local copies of instance variables int[] pce = this.prevChangingElems; int ces = this.changingElemSize; // If the previous match was at an odd element, we still // have to search the preceeding element. // int start = lastChanging...
5
public Point2D getPointAt( double position ) { if( position < 0 || position > 1 ) { throw new IllegalArgumentException( "position out of range: " + position ); } int segment = segmentAt( position ); double delta = position * totalLength - segmentLengthsSum[segment]; delta /= segmentLengths[segment]; Po...
2
public static int[] readCode(String filename) throws Exception { FileInputStream in = new FileInputStream(filename); ArrayList<Integer> r = new ArrayList<Integer>(); int b; int count = 0; int current = 0; while((b = in.read()) != -1) { current = current | (b ...
3
public boolean registrarSeriales(entidadElemento datos_elementos){ conectarse(); boolean retornarObj = false; String regser = "insert into tbl_seriales (Seriales,Estado,Codigo) values(?,?,?)"; ArrayList seriales_recorrer = datos_elementos.getSeriales(); String estado = datos_elementos...
3
Calculator(String s) { // Начало определения конструктора Calculator super(s); // Вызов конструктора суперкласса (JFrame) temp = 0; op = ' '; setLayout(new GridBagLayout()); // Отказ от менеджера размещения setSize(250, 250); // Установка размеров окна setVisible(true); ...
4
public static MaplePacket showThread(int localthreadid, ResultSet threadRS, ResultSet repliesRS) throws SQLException, RuntimeException { MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendPacketOpcode.BBS_OPERATION); mplew.write(0x07); ...
5
@Test public void testInit() { Puzzle puzzle = new Puzzle(2); for(int r = 0; r < 4; r++) for(int c = 0; c < 4; c++) assertEquals(puzzle.getColor(r, c), '.'); assertEquals(puzzle.getCliques().length, 3); for(Clique[] cliques : puzzle.getCliques()){ assertEquals(cliques.length, 4); for(Clique ...
4
public String SetLength(String x){ String y = null; if(x.length()==1){ y = "00000"+x; }else if(x.length()==2){ y = "0000"+x; }else if(x.length()==3){ y = "000"+x; }else if(x.length()==4){ y = "00"+x; }else if(x.length()==5){...
6
public Collection<Camino> getPaths(Nodo origen, Nodo destino) { if(!this.containsNodo(origen) || !this.containsNodo(destino)) throw new IllegalArgumentException("Nodo no contenido en el grafo"); ArrayList<Camino> caminos = new ArrayList<Camino>(); ArrayList<Camino> caminosValido...
7
private double probLessThan(double b) { if (sigma<1e-8) { if (b>mu) { return 1; }else { return 0; } } return Phi((b - mu) / sigma); }
2
public List<Schedule> getScheduleByDayList(String day) { List<Schedule> list = new ArrayList<Schedule>(); try { PreparedStatement ps = con.prepareStatement("SELECT * FROM schedule WHERE week_day=?"); ps.setString(1, day); ResultSet rs = ps.executeQuery(); while(rs.next()) { list.add(getS...
2
public FailureEvent(int NodeID, int eventType, double startTime, double endTime){ this.NodeID = NodeID; if(this.eventType == null) { this.eventType = new ArrayList<Integer>(); } if(this.startTime == null) { this.startTime = new ArrayList<Double>(); } if(this.endTime == null) { thi...
3
public static void main(String[] g) throws IOException { Scanner s = new Scanner(new File(g[0])); String l; while (s.hasNext()) { String[] L = new String[5]; String[] R = new String[5]; for (int i = 0; i < 5; i++) { L[i] = replace(s.next()); } for (int i = 0; i < 5; i++) { R[i] = replac...
9
static Object toEnum(Object value, Class cls) throws ConversionException { if (value.getClass().equals(cls)) { return value; } else if (value instanceof String) { try { Method valueOfMethod = cls.getMethod("valueOf", new Class[] { String.class ...
5
public CommandAction(CLC clc) { this.clc = clc; }
0
public void run() { if(url != null) { // Obtain the results of the project's file feed if(readFeed()) { if(versionCheck(versionTitle)) { String fileLink = getFile(versionLink); ...
6
@Override public void manageDigits(int[] digits, Queue<SpellResult> results) throws SpellOutException { super.manageDigits(digits, results); // manages its figure EnglishSpellResult result = new EnglishSpellResult(false, false); result.setFigure(digits[2]); result.setMag...
9
public void start() { Set<Long> vertices = graph.getVertexes(); Set<Long> edges = graph.getEdges(); // Step 1 // initialize the two hashmaps for storing the distance // and predecessor distance = new HashMap<>(); predecessor = new HashMap<>(); for (long vId : vertices) { if (vId == this.srcVId) ...
7
private RowsIEventData.Row parseRow(ByteArrayInputStream input, RowsIEventData data) throws IOException { RowsIEventData.Row row = new RowsIEventData.Row(); // row.setNullColumns(input.readBitSet(getNonZeroLength(data.getColumnUsageBeforeUpdate()), true)); TableMapIEventData tableData = TableMapC...
9
public Element output(Document doc, String slot) { String realslot = slot.toLowerCase(); TNode main = new TNode(realslot, getName(), doc); if (realslot == "helmet" || realslot == "chestplate" || realslot == "leggings" || realslot == "boots") { if (getVisiblename() != null) { ...
8
public int getCategoryIndex() { if (options.mode == Mode.BURIAL_ARMOUR) { switch (options.ingotGrade) { case ONE: return 0; case TWO: return 1; case THREE: return 2; } } return 0; }
4
private void zipDir(String zipName, String dirToZip, File dirToZipFile, ZipOutputStream zos, JProgressBar Fortschritt) { if (zipName == null || dirToZip == null || dirToZipFile == null || zos == null || !dirToZipFile.isDirectory()) return; // Inhalt des Ü...
9
public void set(String key, String state) { if(!Quest.allowedStates.contains(state)){ System.out.println("INVALID STATE: " + key); } else { if(flag.containsKey(key)){ flag.remove(key); } flag.put(key, state); } }
2
@Override public void update(GameContainer container,StateBasedGame sbg,int delta) throws SlickException { xpos = container.getInput().getMouseX(); ypos = container.getInput().getMouseY(); if (mousePress==1){ enterGameState(sbg); } else if(mousePress==2){ enterCreditState(sbg); } }
2
public boolean setWeights(double[] weights) { if (weights == null) { return false; } // check whether the value of weights are correct for (int i = 0; i < weights.length; i++) { if (weights[i] <= 0) { System.out.println(nam...
3
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 visit_dup2_x1(final Instruction inst) { // If the top two values are of category 1, then dup them and put // them three down. Otherwise, the top two values are of category // 2 and the top value is put two down. final Set top = atDepth(0); final int category = checkCategory(top); if (category ...
1
public void generateMoves(Piece[][] squares, ArrayList<Move> validMoves, ArrayList<Move> validCaptures) { // for each possible direction (NE, SE, SW, NW) int xPos; int yPos; for (int direction = 0; direction < xMoves.length; direction++) { xPos = xPosition + xMoves[direction]; yPos = yPosition + yMoves[d...
7
public void setH(int h) { this.h = h; }
0
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (boolValue ? 1231 : 1237); result = prime * result + byteValue; result = prime * result + ((dateTimeValue == null) ? 0 : dateTimeValue.hashCode()); result = prime * result + ((decimalValue == null) ? 0...
6
public void render() { glBegin(GL_QUADS); { for (int y = 0; y < map.length; y++) { for (int x = 0; x < map[0].length; x++) { if (map[y][x] == 1) { if (Collision.isPlayerIntersectingBlock(getObsticleMap(), x, y)) { glColor3d(1, 0, 0); } glVertex2d(x * BLOCK_SIZE, y * BLOCK_SIZE);...
4
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 this...
1
@Override public Object getValueAt(int rowIndex, int columnIndex) { switch (columnIndex) { case 0: return saves.get(rowIndex).getName(); case 1: return DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.SHORT).format(saves.get(rowIndex).getCreationDate()); case 2: return saves.get(rowIndex).g...
4
public static boolean setMode(final StoreMode m) { if (m == null) return false; WidgetChild wc; return getMode() == m || visible(wc = getChild(m == StoreMode.WIDE ? WIDE_MODE : THIN_MODE)) && wc.click(true) && new TimedCondition(1400) { @Override public boolean isDone() { return getMode() ...
5
private static void createTrees(int width, int height) { Random rand = new Random(); for(int i = 0; i < width; i++) { if(rand.nextInt(10) == 9) { if(blockSheet[i-1][dirtBoundary-1] == World.AIR) { for(int x = 0; x < tree.length; x++) { for(int y = 0; y < tree[x].length; y++) { if(x + i <...
7
private void resize(Signature signature, int size) { double minX = Double.MAX_VALUE; double maxX = Double.MIN_VALUE; double minY = Double.MAX_VALUE; double maxY = Double.MIN_VALUE; for (Point point : signature.getPoints()) { if (point.getX() < minX) minX = point.getX(); if (point.getX() > maxX) ...
7
public static void lcs(String x, String y) { int n = x.length(); int m = y.length(); for (int i = 0; i < n + 1; i++) for (int j = 0; j < m + 1; j++) if (i == 0 || j == 0) dp[i][j] = 0; else if (x.charAt(i - 1) == y.charAt(j - 1)) dp[i][j] = dp[i - 1][j - 1] + 1; else dp[i][j] = Math....
5
public static BufferedImage rotate(Rotn rotn, BufferedImage img) { int W = img.getWidth(); int H = img.getHeight(); int W1; int H1; int angle; double WOffSet = 0; double HOffSet = 0; if (W % 2 == 1) WOffSet = 0.5; if (H % 2 == 1) HOffSet = 0.5; switch (rotn) { case COUNTER_QUARTER: W1 ...
7
private static String combatDiffColor(int i, int j) { int k = i - j; if(k < -9) return "@red@"; if(k < -6) return "@or3@"; if(k < -3) return "@or2@"; if(k < 0) return "@or1@"; if(k > 9) return "@gre@"; if(k > 6) return "@gr3@"; if(k > 3) return "@gr2@"; if(k > 0) return "@gr1@...
8
public void visitTree(final Tree tree) { final Stmt last = tree.lastStmt(); if (last instanceof JumpStmt) { final JumpStmt stmt = (JumpStmt) last; if (FlowGraph.DEBUG) { System.out.println(" Replacing " + oldDst + " with " + newDst + " in " + stmt); } if (stmt.catchTargets().remove(oldDst)...
3
@Override public void mouseClicked(float x, float y, Integer objNumber, MouseEvent e) { mouseClickButton = e.getButton(); if (objNumber != null) { active = models.get(objNumber); } if (active == null) { // deligiere an moegliche untergruppen weiter ...
5
@Override public void deserialize(Buffer buf) { type = buf.readByte(); if (type < 0) throw new RuntimeException("Forbidden value on type = " + type + ", it doesn't respect the following condition : type < 0"); worldX = buf.readShort(); if (worldX < -255 || worldX > 255) ...
5
private boolean isWalkable(FieldState state) { if (mode == Mode.EDITOR) { if (state == FieldState.EMPTY || state == FieldState.GOAL || state == FieldState.DIAMOND || state == FieldState.PLAYER) { return true; } } else if (mode == Mode.GAME) { if (state == FieldState.EMPTY || state == FieldState.GO...
8
public void atMethodArgs(ASTList args, int[] types, int[] dims, String[] cnames) throws CompileError { int i = 0; while (args != null) { ASTree a = args.head(); a.accept(this); types[i] = exprType; dims[i] = arrayDim; ...
1
@Override public void create(DataObject obj) throws SQLException { if(!(obj instanceof ItemDO)) throw new IllegalArgumentException("Tried to save a non StorageUnit in " + "DBStorageUnitDAO"); PreparedStatement stmt = null; Statement keyStmt = null; ResultSet keyRS = null; SQLException exception = nul...
7
private List<CalEvent> processGCalData(List<GoogleCal> calendarData) throws ParseException { // TODO Auto-generated method stub List<CalEvent> list=new ArrayList<CalEvent>(); try { for (GoogleCal cal : calendarData) { if(cal.getData() != null) { JSONObject eventJson=new JSONObject(cal.getData()); ...
5
private boolean getSymbolFreqBin (CircularDataBuffer circBuf,WaveData waveData,int start) { boolean bit; // Run FFTs on the early and late parts of the symbol double early[]=do160FFTHalfSymbolBinRequest(circBuf,start,lowBin,highBin); start=start+((int)samplesPerSymbol/2); double late[]=do160FFTHalfSymbolBinRe...
4
private Quality randomQuality(){ switch(randNum.nextInt(5)){ case 0: return library.shoddy; case 1: return library.inferior; case 2: return library.average; case 3: return library.superior; case 4: return library.masterwork; } return null; }
5
public String getWord(int number) { word=""; getWordFromNumber(number); int i = 0; for (String s : words) { boolean dx = false; if (i < words0.size()) { for (int j = 19; j < 27; j++) { if (s.equals(wordsOfNumber.get(j))) { dx = true; break; } } if (!dx) word += s + "...
6
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { CertificateFactory cf; try { crlM.createCRL(getServletContext().getRealPath("/")+"certificat.p12", "toto", "webmail.monsite.fr", "webmail.monsite.fr", "toto"); crlM.save(getServletConte...
8
protected void move(double nx, double ny) { if (level.tileCollision(x, y, nx, ny, 7)) { remove(); onCollision(); } this.x += nx; this.y += ny; if (distance() > range) { remove(); } }
2
public void update(GameContainer gc, StateBasedGame sb, int delta) { Input in = gc.getInput(); int bposx = this.owner.getPosX(); int bposy = this.owner.getPosY(); int nposx = bposx; int nposy = bposy; int limx = RPG372.gameInstance.getMap().getX(); int limy = RPG372.gameInstance.getMap().getY(); if(in....
9
private void remove() { String key; List<String> keys = new ArrayList<String>(); for (int i = 0; i < listDroite.getSize(); i++) { if (droite.isSelectedIndex(i)) keys.add(listDroite.getKey(i)); } for (Iterator<String> e = keys.iterator(); e.hasNext(...
3
@Override public void execute(Tuple tuple) { speed++; if (speed == 1){ ptime = System.currentTimeMillis(); } if (logger.isInfoEnabled()){ logger.info(format("updateTimeBolt received:%s,%s", tuple.getString(0), tuple.getLong(1))); } long time = ...
8
private void calculateScores () { resetScores(); Champion[] champions = getChampions(); Strategy[] strategies = Strategy.values(); for (int i = 0; i < strategies.length; i++) { for (int j = 0; j < 10; j++) { if (champions [j] != null && (Initialiser.getMainFrame().getButtonPanel().isTacticEnabled (i) ...
7