text
stringlengths
14
410k
label
int32
0
9
@Override public boolean equals( Object other ) { if ( other == this ) { return true; } if ( !( other instanceof TFloatList ) ) return false; if ( other instanceof TFloatArrayList ) { TFloatArrayList that = ( TFloatArrayList )other; if ( that.size...
9
private String withdrawSavings(Scanner in) throws FileNotFoundException { System.out.println("Current balance: " + supportedBank.getSavingsBalance(currentCustomer)); boolean successWithdraw = false; while(!successWithdraw) { System.out.println( "Please enter an...
7
public static void main(String[] args) { currentPathExtensions = Installation.class.getProtectionDomain() .getCodeSource().getLocation().getPath() .replaceAll(Installation.filenameJar, ""); Control.writeFile(currentPathExtensions + "BEval.sh", Installation.bEvalSh.replaceFirst("!currentPathExtensions...
7
protected void movePlayHead(int delta) { if (flip && Math.abs(delta) == 1) return; if (Math.abs(delta) > 1) delta /= 2; SimStream stream = model.getStream(); int index = model.getPlayHead() + delta; if (!model.isLoaded()) return; while (index > stream.getMaxIndex()) { model....
6
public void Save_Waypoints() { try { FileWriter fw = new FileWriter(System.getProperty("user.dir") + "/" + "level_waypoints.cfg", false); BufferedWriter output = new BufferedWriter(fw); for (Waypoint curr : waypoints) { output.write(String.format("\n")); output.write(String.format("%d %d\n", (...
3
private int buildStraight(int xo, int maxLength, boolean safe) { int length = random.nextInt(10) + 2; if (safe) length = 10 + random.nextInt(5); if (length > maxLength) length = maxLength; int floor = height - 1 - random.nextInt(4); for (int x = xo; x < xo + length; x++) ...
7
public void add(String str) { Node current = this.HEAD; Node[] update = new Node[MAX_LEVEL + 1]; for (int i = this.level; i >= 0; i--) { while (current.pointer[i] != null && current.pointer[i].val.compareTo(str) < 0) { current = current.pointer[i]; ...
8
public String encode(String plain) { String v_key_u=v_key.toUpperCase(); // String h_key_u=h_key.toUpperCase(); char[][] ct_table=new char[v_key_u.length()][26]; for(int i=0;i<v_key_u.length();i++) { // int mv_pos=0; char first_c=v_key_u.charAt(i); char[] ct_line=build_keyed_alphabet(h_key,26,0); ...
6
public void update(PeerState state, long uploaded, long downloaded, long left) { if (PeerState.STARTED.equals(state) && left == 0) { state = PeerState.COMPLETED; } if (!state.equals(this.state)) { logger.info("Peer " + this + " " + state.name().toLowerCase() + " download of " + this.torrent + ".");...
3
public static void InsertInToTable(String table,String[] values){ try { con = DriverManager.getConnection(url, user, password); st = con.createStatement(); String insertSQL = "INSERT INTO "+table+" VALUES ("; for (int i = 0; i < value...
8
@Override public String getDef() {return def.toString();}
0
static boolean tagcompare(byte[] s1, byte[] s2, int n) { int c = 0; byte u1, u2; while (c < n) { u1 = s1[c]; u2 = s2[c]; if ('Z' >= u1 && u1 >= 'A') { u1 = (byte) (u1 - 'A' + 'a'); } if ('Z' >= u2 && u2 >= 'A') { ...
6
public static void main(String[] args){ try{ Chap12Q20 cq = new Chap12Q20(); cq.atBat(); }catch(PopFoul e){ System.out.println(e); }catch(RainedOut e){ System.out.println(e); }catch(BaseballException e){ System.out.println(e); } try{ Inning i = new Chap12Q20(); i.atBat(); }catch...
7
public static String introduceXMLEntities(String inputString) { StringBuffer stringBuffer = new StringBuffer(); int length = inputString.length(); char c; for (int i = 0; i < length; i++) { c = inputString.charAt(i); if (ENTITY_REFERENCES.containsKey(new Character(c))) { stringBuffer...
2
private void loadIdCounts() { try { this.idCounts.clear(); if (this.saveHandler == null) { return; } File var1 = this.saveHandler.getMapFileFromName("idcounts"); if (var1 != null && var1.exists()) ...
6
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { Player player = (Player) sender; if (commandLabel.equalsIgnoreCase("Assassin") && sender instanceof Player){ if (player.hasPermission("EasyPvpKits.Assassin")){ if (!plugin.kits.contains(player.getName())){ ...
7
@FXML private void handleBtnRegisterAction(ActionEvent event) { if (!validate()) { return; } String itemCode = txtBarCode.getText(); Item item = select(itemCode); if (item == null) { String insert = "INSERT INTO Item (ItemCode, Name, Price, SupplierC...
2
@Override public void run() { try { ss = new ServerSocket(port); System.out.println("Listening on " + ss); while (true) { Socket s = ss.accept(); if (!bannedAddresses.contains(s.getInetAddress())) { System.out.println("C...
3
public ArrayList<Tree> findLoopControlStatements(){ ArrayList<Tree> statements = new ArrayList<Tree>(); if(body instanceof LoopControlStatement){ statements.add(body); return statements; } if(body instanceof WhileStatement) return statements; if(body instanceof Statements) statements.addA...
3
@Override public void run() throws ClienteException { try { while (seguir) { Object object = Conexion.getIn().readObject(); AudioChatService.recibirObjeto(object); } } catch (IOException e) { throw new ClienteException("Error al crear la conexion: " + e.getMessage(), e); } catch (ClassNotFo...
3
@JavaScriptMethod public boolean toggleDemoMode() { CiLightGlobalConfiguration config = CiLightGlobalConfiguration.get(); List<Endpoint> endpoints = config.getEndpoints(); for (Endpoint endpoint : endpoints) { try { if (demoModeEnabled) { sendD...
3
public void fireKeyEvent(KeyEvent event) { processKeyEvent(event); }
0
public static void makeKeys () { V=new Vector(); Hmenu=new Hashtable(); Hcharkey=new Hashtable(); // collect all predefined keys Enumeration e=Global.names(); if (e==null) return; while (e.hasMoreElements()) { String key=(String)e.nextElement(); if (key.startsWith("key.")) { String menu=key.substring...
8
public ListNode addTwoNumbers(ListNode l1, ListNode l2) { //build a new list ListNode temp = new ListNode(0); ListNode move = temp; //record the sum of the value int number = 0; while (l1 != null || l2 != null) { //check if there is 1 the add up ...
5
public static File getRelativeFile(File target, File base) throws IOException { String[] baseComponents = base.getCanonicalPath().split(Pattern.quote(File.separator)); String[] targetComponents = target.getCanonicalPath().split(Pattern.quote(File.separator)); // skip common components int index = 0; ...
8
@Override public boolean equals (Object obj) { if (!(obj instanceof TorrentFileInfo)) { return false; } TorrentFileInfo tfi = (TorrentFileInfo) obj; return tfi.length == length && path.equals(tfi.path); }
2
private int obterUltimoIDdoBD() throws Exception { String sql = "SELECT max(id) FROM veiculo"; Connection con = null; PreparedStatement stmt = null; ResultSet rs = null; try { con = obtemConexao(); stmt = con.prepareStatement(sql); rs = stmt.executeQuery(); if(rs != null && rs.next()) { ...
8
public void visitOuterClass(final String owner, final String name, final String desc) { enclosingMethodOwner = newClass(owner); if (name != null && desc != null) { enclosingMethod = newNameType(name, desc); } }
2
@Command(command = "promote", aliases = {"pr"}, arguments = {"target player[s]"}, description = "promotes the target player[s]", permissions = {"promote"}, consoleOnly = true) public static boolean promoteFromConsole(CommandSender sender, String targetPlayer) throws EssentialsCommandException { // mak...
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
@Override public void execute(ArrayList signature) { try { String className = (String) signature.get(1); String protocolName = (String) signature.get(2); Outliner.fileProtocolManager.createFileProtocol(protocolName, className); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("ERROR:...
1
@Override public String getDbDriverName() { return dbdrivername; }
0
/*package*/ void packet(Packet packet) { logger.fine(String.format("writing packet %s", packet)); final Manager self = this; if (!self.encoding) { self.encoding = true; this.encoder.encode(packet, new Parser.Encoder.Callback() { @Override ...
4
@Override public PowerHost findHostForVm(Vm vm) { ArrayList<PowerHost> SuitablesHosts = new ArrayList<>(); PowerHost moreAvailHost = null; for (PowerHost host : this.<PowerHost> getHostList()) { if (host.isSuitableForVm(vm)) { SuitablesHosts.add(host); } ...
9
static boolean equalIdentity(Matrix3f mat) { if (Math.abs(mat.m00 - 1) > 1e-4) { return false; } if (Math.abs(mat.m11 - 1) > 1e-4) { return false; } if (Math.abs(mat.m22 - 1) > 1e-4) { return false; } if (Math.abs(mat.m01) > 1e...
9
private static int value(int[][] ways, int i, int j){ if (i<0 || j<0) return 0; else return ways[i][j]; }
2
public static String blessings(Deity E, HTTPRequest httpReq, java.util.Map<String,String> parms) { while(E.numBlessings()>0) { final Ability A=E.fetchBlessing(0); if(A!=null) E.delBlessing(A); } if(httpReq.isUrlParameter("BLESS1")) { int num=1; String aff=httpReq.getUrlParameter("BLESS"+num);...
7
public hanoiTowers(int count) { stack1 = new Stack<Integer>(); stack2 = new Stack<Integer>(); stack3 = new Stack<Integer>(); for (int i = count; i > 0; i--) { stack1.push(new Integer(i)); } }
1
@Override public boolean isTypeOf(Property p) { if(p==null) return true; if(equals(p)) return true; if(this.superProperty!=null) { return this.superProperty.isTypeOf(p); } return false; }
3
synchronized Connection getConnection() throws JMSException, TemplateClosedException { if (closed.get()) { throw new JMSException("JMSTemplate Closed"); } if (connection == null) { connection = getConnectionFactory().createConnection(); connection.setException...
7
public KeyStroke createKeyStroke() { KeyStroke result = null; int modifiers = 0; if (isAcceleratorCtrlMask()) { modifiers = modifiers | InputEvent.CTRL_MASK; } if (isAcceleratorShiftMask()) { modifiers = modifiers | InputEvent.SHIFT_MASK; } if (isAcceleratorAltMask()) { modifiers = modifiers | In...
8
public static void testSystem(String qPath, String docsPath) { window.clearWindow(); // only create docSet once if ( docSet == null || !(docsPath.equals(documentsPath)) ) { long docStart = System.currentTimeMillis(); documentsPath = docsPath; docSet =...
9
public Trame(int id, int dlc, long date, int[] data) { this.id = id; this.dlc = dlc; this.date = date; this.data = data; }
0
private Node encontrarHojaDondeEstaQ(Node node, double[] q) { comparaciones++; node.setVisitado(true); if (node.getLeft() == null || node.getRight() == null) { double distNueva = Math.sqrt((Math.pow((q[0] - node.getValue()[0]), 2) + Math.pow((q[1] - node.getValue()[1]), 2))); distActual = distNueva; ...
6
public void commit(Instruction instruction) { String d = ROB.getEntry(ROB.getHead()).getDest(); String value = ROB.getValue(ROB.getHead()); String type = instruction.getOpcode(); if (type.equals("BEQ")) { } else if (type.equals("SW")) { String regVal = getRegister(d).getValue(); memory.iMemory.put(regV...
6
private int getShortBigEndian(byte[] a, int offs) { return (a[offs] & 0xff) << 8 | (a[offs + 1] & 0xff); }
0
@Override public boolean supportsDocumentAttributes() {return false;}
0
private void remCallObj(Long key) { sync.remove(key); }
0
final boolean isLoaded(int archiveId, int childId) { anInt638++; if (!isValidChild(archiveId, childId)) return false; if (childBuffers[archiveId] != null && childBuffers[archiveId][childId] != null) return true; if (archiveBuffers[archiveId] != null) return true; loadArchive(archiveId); if (archive...
5
public synchronized boolean collect(int id){ while ( buffer[id-1] == null && !faliureDetector.isSuspect(id)){ try{ Utils.out(pid, "waiting for " + id + " "+ faliureDetector.isSuspect(id)); wait(); }catch (InterruptedException e){ Utils.out(pid,"interrupted exception"); } } Utils.out(pid,"wait ...
3
public void addParticleEffect(String effectName, ParticleEffect effect) { if (effectName == null || effect == null) { throw new IllegalArgumentException("Cannot add a null ParticleEffect!"); } particleEffects.put(effectName, effect); }
2
public void nextValue() { value++; if (value >= values.length) { value = 0; } }
1
final public void PackageDeclaration() throws ParseException { /*@bgen(jjtree) PackageDeclaration */ BSHPackageDeclaration jjtn000 = new BSHPackageDeclaration(JJTPACKAGEDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(PACKAGE); ...
8
@Override public void startSetup(Attributes atts) { super.startSetup(atts); addActionListener(this); }
0
public static StringBuilder check(String path) { // TODO Auto-generated method stub StringBuilder sb = new StringBuilder(); byte[] size = null; StringBuilder noAlgorithm=new StringBuilder("无法使用MD5算法,这可能是你的JAVA虚拟机版本太低"); StringBuilder fileNotFound=new StringBuilder("未能找到文件,请重新定位文件路径"); StringBuilder IOerror=...
5
@Override public void train(List<Instance> instances) { // TODO Auto-generated method stub // init clusters for (int i = 0 ; i < clustering_training_iterations ; i++) { this.EStep(instances); this.Mstep(instances); } }
1
private boolean fillBuffer(int minimum) throws IOException { char[] buffer = this.buffer; lineStart -= pos; if (limit != pos) { limit -= pos; System.arraycopy(buffer, pos, buffer, 0, limit); } else { limit = 0; } pos = 0; int total; while ((total = in.read(buffer, limi...
7
private static void render2D() { // Clear the screen and depth buffer GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); for (int k = 0; k < world.getDepth(); k++) { for (int i =0; i < world.getWidth(); i++) { for (int j = 0; j < world.getHeight(); j++) { determineColor(worl...
4
public void execute(ActionInvocation invocation) throws Exception { long startTime = System.currentTimeMillis(); String location = getStylesheetLocation(); if (parse) { ValueStack stack = ActionContext.getContext().getValueStack(); location = TextParseUtil.translateVaria...
9
public BufferedImage yellowHSVFilter(){ this.yellowImage = originalImage; Color actualPixel; int actualRedValue; int actualGreenValue; int actualBlueValue; for (int i = 0; i < originalImage.getWidth(); i++) { for (int j = 0; j < originalImage.getHeight(); j++) { actualPixel = new Color(originalImage....
6
private static int check(int i, int j, int k, int l, int m){ if(i+j+k+l+m < 792) return Integer.MAX_VALUE; for(int temp1=0;temp1<5;temp1++){ for(int temp2=temp1+1;temp2<5;temp2++){ if(primeSet.contains(Integer.toString(temp1) + Integer.toString(temp2)) && primeSet.contains(Integer.toString(temp2) + Int...
5
private <T extends Enum<? extends IntValueHolder> & IntValueHolder> int getValue(String name, T[] values, int def) { String prop = props.getProperty(name); if (prop != null && prop.length() > 0) { String trimmed = prop.trim(); String[] args = trimmed.split(" "); int base = 0; String offset; if (args....
7
@Test public void testPathFinding(){ getNewBoard(); // test path to room List<Square> path = board.getBestPathTo(p3, spa); if (path.size() != 9){ fail("path size should be 9: " + path.size()); } // test path is empty if blocked board.setPlayerPosition(p1, spaEntrance); path = board.getBestP...
8
public static void unhideCell(BoardModel boardModel, Point position) { Cell currentCell = boardModel.getBoard()[position.getPosX()][position.getPosY()]; if (currentCell.isMine()) { boardModel.gameOver(); } else if (currentCell.isEmpty()) { unhideNeighborEmptyCell...
2
public void func_27463_a(Reader var1, J_JsonListener var2) throws J_InvalidSyntaxException, IOException { J_PositionTrackingPushbackReader var3 = new J_PositionTrackingPushbackReader(var1); char var4 = (char)var3.read(); switch(var4) { case 91: var3.func_27334_a(var4); var2.fun...
3
public int getLoopLength(BrainFuckCode code, boolean forwardSearch) { int loopLenght = 0; int numberOfInnerLoops = 0; int currentPosition = code.getCurrentPosition(); while (currentPosition > 0 && currentPosition < code.getCode().size()) { Command currentCommand = code.getCo...
6
public void setColor(Color color) { this.color = color; }
0
@Override public void run() { DatagramPacket paquete; byte recibidos[] = new byte[1024]; String IPRemota; try { boolean finalizar = false; while (!finalizar) { paquete = new DatagramPacket(recibidos, recibidos.length); socke...
3
private Map<Integer, List<ServletSource>> groupServicesByPort( List<ServletSource> services) { Map<Integer, List<ServletSource>> servicesByPort = new HashMap<Integer, List<ServletSource>>(); for (ServletSource service : services) { URL url = service.getUrl(); int port = url.getPort(); ...
5
private boolean readRequest(Request request) { String resource = request.resource; // Presumption : resource exists. // try all sites that holds the key. // There should be at least one site that holds this key. for (Site site : sitesAvaliable.get(resource)) { // ch...
5
public void setIdProducto(int idProducto) { this.idProducto = idProducto; }
0
public void removeHost(String name) { Host h = hosts.remove(name); boolean disconnectHost = true; int option = JOptionPane .showConfirmDialog( null, RemoteResourcesLocalization .getMessage(RemoteResourcesMessages.HostPanel_RemoveHost), "Remove Host", JOptionPane.YES_NO_OPTION, ...
5
public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Welcome to the Chess Game!"); Scanner inputUser = new Scanner(System.in); Board myBoard = Board.getmyBoard(); // myBoard.input = inputUser; myBoard.sortPieces(); myBoard.showBoard(); boolean playerWhoNow = tru...
3
public PNGDecoder(InputStream input) throws IOException { this.input = input; this.crc = new CRC32(); this.buffer = new byte[4096]; readFully(buffer, 0, SIGNATURE.length); if(!checkSignature(buffer)) { throw new IOException("Not a valid PNG file"); } ...
7
public static void sumNegativeBalances() { // External iteration BigInteger total = BigInteger.ZERO; for (BankAccount account: christmasBank.getAllAccounts()) if (account.getBalance().signum() < 0) total = total.add(account.getBalance()); System.out.println("T...
2
public static boolean check1DArrayHasAllNumbers(int[] elements, int boardSize) throws IllegalInput { int[] numCount = new int[boardSize]; int expectedSum = boardSize * (boardSize + 1) / 2; if (elements.length != boardSize) throw new IllegalInput("Board Size is illegal"); for (int i = 0; i < elements.le...
8
public LinkedList<ListEmp> getFaults(){ LinkedList<ListEmp> psl = new LinkedList<ListEmp>(); Connection Conn; ListEmp ps = null; ResultSet rs = null; try { Conn = _ds.getConnection(); } catch (Exception et) { System.out.println("No connection"); return null; } PreparedStatement pmst = null; ...
7
public PreferenceLineEnding getLineEnd() { if (useDocumentSettings()) { return this.lineEnd; } else { return Preferences.getPreferenceLineEnding(Preferences.SAVE_LINE_END); } }
1
public void update(Graphics g, JComponent c) { boolean divider = c.getName() == null ? false : c.getName().equals("dividerButton"); if(divider) { return; } if(c.getHeight() > 255 * 2) { return; // exceedingly high component not supported } Border bo = null; int...
8
@Override protected void paintComponent(Graphics g) { // draw background g.drawImage(this.imgBackground, 0, 0, null); // draw pieces for (FigureGUI guiFigure : this.guiFigures) { if(!guiFigure.isCaptured()) { g.drawImage(guiFigure.getImg(), guiFigure.getX(), guiFigure....
8
public boolean loadLevel(String xmlFilePath) { try { File xmlFile = new File(xmlFilePath); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); doc.getDocumentElement().normalize();...
8
@Override public void update(int delta) { for(Entity entity : entities) entity.update(delta); }
1
private boolean r_postlude() { int among_var; int v_1; // repeat, line 75 replab0: while(true) { v_1 = cursor; lab1: do { // (, line 75 ...
8
public void buildTree(Instances data, SimpleLinearRegression[][] higherRegressions, double totalInstanceWeight, double higherNumParameters) throws Exception{ //save some stuff m_totalInstanceWeight = totalInstanceWeight; m_train = new Instances(data); m_isLeaf = true...
9
private void setTracking(BoundaryArea tracking) { if (tracking != mAdjuster) { mAdjuster = tracking; Cursor cursor = mAdjuster.getCursor(); mComponent.setCursor(cursor); WindowUtils.getWindowForComponent(mComponent).setCursor(cursor); mListener.boundaryAreaChanged(mAdjuster); } }
1
public void process() { // System.out.println("Mapa:"); // for (int i = 2; i <= N; i++) { // System.out.print(i + "\t"); // } // System.out.println(); BigDecimal sumaReda; for (int i = 2; i <= N; i++) { switch (checkNumber(i)) { case 1: // Broj je prim broj sumaReda = getSumAll(i); // Sy...
4
public void makeMove(Player p){ for (BoardCell target : targets) { target.setTarget(false); } rollDie(); startTargets(p.currentIndex, die); if(p instanceof ComputerPlayer){ humansTurn = false; ArrayList<BoardCell> roomList = new ArrayList<BoardCell>(); ArrayList<BoardCell> list = new ArrayList<...
9
public void doGenerate(){ Random rand = new Random(); StringBuilder sb = new StringBuilder(); roll = (rand.nextInt(100)+1); if(roll <= 25) { value = ((rand.nextInt(4)+1)+(rand.nextInt(4)+1)+(rand.nextInt(4)+1)+(rand.nextInt(4)+1)); randGem = tier1[rand.nextInt(tier1.length)]; } else if(roll <= 50)...
6
public Object get(String key) throws JSONException { if (key == null) { throw new JSONException("Null key."); } Object object = this.opt(key); if (object == null) { throw new JSONException("JSONObject[" + quote(key) + "] not found."); } return obje...
2
public String nextString() throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } String result; if (p == PEEKED_UNQUOTED) { result = nextUnquotedValue(); } else if (p == PEEKED_SINGLE_QUOTED) { result = nextQuotedValue('\''); } else if (p == PEEKED_DO...
7
public void transferCert(String title, String exe_query, String filter, String table_name) { DBHandler db = new DBHandler(); String cert_query_where = ""; String cert_query_hint = ""; String cert_query = ""; Pattern pattern = Pattern.compile("where\\s.{1,};$"); Matcher match_regxp = pattern.matcher(ex...
9
private double[] getStatisticalSpectrumDescriptor(double[] dataRow) { int N = dataRow.length; double ssd[] = new double[N_STATISTICAL_DESCRIPTORS]; ssd[0] = new Mean().evaluate(dataRow); ssd[1] = new Variance().evaluate(dataRow); ssd[2] = new Skewness().evaluate(dataRow); ...
1
public int tLineCount(){ int count = item.tLineCount(); if(this.items != null) count += this.items.tLineCount(); return count; }
1
public void fixNode (String footpath, pgrid.service.corba.repair.RepairIssue issue) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("fixNode", true); $out.write_string (footpath); pgrid....
2
public String toString() { String gasStore = " Name: " + name + " (id: " + id + ")" + "\n\n" + " Address: " + address + "\n" + " Phone: " + phone + "\n" + " Brand: " + brand + "\n" + " Distance: " + distance + " miles...
4
public static void awardBonusInternal() { BigInteger bonusReduction = BigInteger.valueOf(100); christmasBank.getAllAccounts().parallelStream(). filter(account -> account.getBalance().signum() > 0). forEach(account -> account.deposit(account.getBalance().divide(bonusReduc...
1
public AuthFrame(final AuthModule module) { super("Авторизация", true, false, false, false); setFrameIcon(Resources.getImageIcon("frame.png")); setBounds(100, 100, 203, 213); getContentPane().setLayout(null); okButton = new JButton("Вход"); okButton.addActionListener(new ActionListener() { public void...
1
public String[] getElementsInline() { return this.ELEMENTS_INLINE; }
0
@Override public HumanNameDt fromString(HumanNameDt name, String value) { String[] pcs = value.split("\\,", 2); String[] pcs1 = pcs[0].split("\\ "); String[] pcs2 = pcs.length == 1 ? null : pcs[1].split("\\ "); if (name == null) { name = new HumanNameDt(); ...
7
public static double erlangBprobabilityNIR(double totalTraffic, double totalResources) { double prob = 0.0D; // blocking probability // numerator double lognumer = totalResources * Math.log(totalTraffic) - totalTraffic; // denominator (incomplete Gamma Function) double oneplustr = 1.0D + totalResources; d...
4