text
stringlengths
14
410k
label
int32
0
9
public boolean[][] getBooleans() { return grid; }
0
public boolean checkPermission(CommandSender sender) { if ((this.permission == null) || (this.permission.length() == 0) || (sender.hasPermission(this.permission))) { return true; } sender.sendMessage(ChatColor.RED + "Insufficient permissions"); sender.sendMessage(ChatColor.RED + "Requires " + permission); ...
3
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null) { return false; } if (getClass() != other.getClass()) { return false; } State that = (State) other; return colorToPlay == that.colorToPlay && Arrays.deepEquals(squares, that.squares); }
4
public Svd (Matrix[] toBeSvdMat, boolean codeCbCr) { svdResult = new SingularValueDecomposition[3]; matU = new Matrix[3]; matV = new Matrix[3]; matS = new Matrix[3]; svdResult[0] = new SingularValueDecomposition(toBeSvdMat[0]); matU[0] = svdResult[0].getU(); mat...
1
public OverviewPane(Gui gui) { this.gui = gui; try { font = Font.createFont(Font.TRUETYPE_FONT, OverviewItem.class.getResourceAsStream("/font/arvo.ttf")).deriveFont(Font.PLAIN, 24f); } catch (Exception e) { font = new Font(Font.SERIF, Font.PLAIN, 24); } listPane = new JPanel(); listPane.setLayou...
3
public void depositar(double valor) { this.saldo += valor ; }
0
@EventHandler public void MagmaCubeNausea(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.getMagmaCubeConfig().getDouble("MagmaCube...
6
@Override public void draw(GL2 gl) { if(skyTexture == null) { loadTexture(textureToLoad); } if(parentPanel != null) { GLU glu = GLU.createGLU(gl); if(skyTexture != null) { skyTexture.enable(gl); skyTexture.bind(...
4
private static boolean isFX2 (Device dev) { DeviceDescriptor desc; if (dev == null) return false; desc = dev.getDeviceDescriptor (); // Only the cypress development platform uses these IDs if (desc.getVendorId () == 0x04b4 && desc.getProductId () == 0x8613) return true; // Other products will hav...
3
private static void inputCheck(int port, int windowSizeN, int timeout) { if (port > 65535 || port < 1024) { System.err.println("Port number must be in between 1024 and 65535"); System.exit(1); } if (windowSizeN < 0) { System.err.println("Window size must be larger than 0"); System.exit(1); } }
3
public boolean isInPanesSelector(int mouseX, int mouseY){ if (mouseX > 800 && mouseX < 1280){ if (mouseY > 0 && mouseY < 288){ return true; } } return false; }
4
public void testAddPartialConverterSecurity() { if (OLD_JDK) { return; } try { Policy.setPolicy(RESTRICT); System.setSecurityManager(new SecurityManager()); ConverterManager.getInstance().addPartialConverter(StringConverter.INSTANCE); f...
2
public static final String trimTrailingZeroes(String text, boolean localized) { if (text == null) { return null; } int dot = text.indexOf(localized ? LOCALIZED_DECIMAL_SEPARATOR.charAt(0) : '.'); if (dot == -1) { return text; } int pos = text.length() - 1; if (dot == pos) { return text; } whi...
7
public TetrisTormays(Tetrimino tetrimino, Pelialue pelialue) { tormaykset = new ArrayList<Tormays>(); if(tetrimino.palikkakokoelma().lisattyja() <= 0) return; try { for(Palikka palikka : tetrimino.palikkakokoelma().palikat()) { ...
5
public TabContainer(int width, int height) { super(JTabbedPane.BOTTOM); setBorder( BorderFactory.createEmptyBorder(-2, -1, 1, -3) ); GUI.setPreferredSize(this, width, height); addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent...
1
public int beforeBind() throws RemoteException { /* * The ID to this server, it will compose the serviceName, like this: * ServiceID */ int nid = nextServerID(); try { System.out.println("Server " + RemoteServer.getClientHost() + " asked a ID, sending " + nid); } catch (ServerNotActiveException...
1
public List<CategorieType> getCategorie() { if (categorie == null) { categorie = new ArrayList<CategorieType>(); } return this.categorie; }
1
public void setCommissionRate(double rate) { if (rate > 0.0 && rate < 1.0) commissionRate = rate; else throw new IllegalArgumentException( "Commission rate must be > 0.0 and < 1.0"); }
2
public static double getBalance(String uid) { if(checkUserExistance(uid)) { UserStorageAccess xmlAccessor = new UserStorageAccess(); return xmlAccessor.getUserBalance(uid); }else { return 0; } }
1
void doPermute(char[] in, StringBuffer outputString, boolean[] used, int inputLength, int level) { // System.out.println(outputString.toString()); // System.out.print("used: "); // for (boolean c : used) { // System.out.print(c + ","); // } // System.out.println();...
3
public boolean mobs(MOB mob, List<String> commands) { if(commands.size()<3) { mob.tell(L("You have failed to specify the proper fields.\n\rThe format is DESTROY MOB [MOB NAME]\n\r")); mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell.")); return false; } Stri...
8
public String RecieveMessages(){ byte[] data = null; try { int length = inputStream.read(); data = new byte[length]; length = 0; if (length != data.length) ...
5
@Override public void takeTurn(GameBoard currentBoard) { Random rand = new Random(); int randomlySelectedRow = 0; int tokensInRow = 0; ArrayList<Integer> validRowNumbers = new ArrayList<Integer>(); int[] validRowNumberValues = { 1, 2, 3 }; for(int i: validRowNumberValues){ validRowNumbers.add(i); }...
3
public synchronized boolean startsWith(byte[] seq) { if (seq.length > buffer.length) throw new IllegalArgumentException(); if (seq.length > bsize) return false; for (int i = 0; i < seq.length; ++i) { if (seq[i] != buffer[(offset + i) % buffer.length]) return false; } return true; }
4
public static double sinh(double x) { boolean negate = false; if (x != x) { return x; } // sinh[z] = (exp(z) - exp(-z) / 2 // for values of z larger than about 20, // exp(-z) can be ignored in comparison with exp(z) if (x > 20) { if (x >= LOG_MAX_VALUE) {...
9
public static boolean isUnix() { String OS = System.getProperty("os.name").toLowerCase(); return (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("") >= 0 || OS.indexOf("aix") >= 0); }
3
public static String qualifyPatternString( String pattern ) { pattern = StringTool.strip( pattern, "*" ); pattern = StringTool.strip( pattern, "_(" ); // width placeholder pattern = StringTool.strip( pattern, "_)" ); // width placeholder pattern = StringTool.strip( pattern, "_" ); pattern = pattern.rep...
4
public static void update() { if (nextWave <= 0) { if (monsters.size() > 0) { new Thread() { @Override public void run() { EnumMap<Monster, Integer> monsters = WaveManager.monsters.clone(); WaveManager.monsters.clear(); int leftLength = 0; int rightLength = 0; int...
9
public static Color get(ChatColor color) { for (TeamColor enumm : TeamColor.class.getEnumConstants()) { if (enumm.toString().equals(color.toString())) { return enumm.getColor(); } } return null; }
2
private void triFusion(int debut, int fin) { // tableau o� va aller la fusion int[] tFusion = new int[fin - debut + 1]; int milieu = (debut + fin) / 2; // Indices des �l�ments � comparer int i1 = debut, i2 = milieu + 1; // indice de la prochaine case du tableau tFusion � remplir int...
7
protected void verifySize() throws MatrixError { if (width < 1) throw new MatrixError("Width of matrix must be greater than 1"); if (height < 1) throw new MatrixError("Height of matrix must be greater than 1"); }
2
void setExampleWidgetSize () { int size = SWT.DEFAULT; if (preferredButton == null) return; if (preferredButton.getSelection()) size = SWT.DEFAULT; if (tooSmallButton.getSelection()) size = TOO_SMALL_SIZE; if (smallButton.getSelection()) size = SMALL_SIZE; if (largeButton.getSelection()) size = LARGE_SIZE; ...
8
public boolean isOutgoing() { return !isIncoming(); }
0
public String toJSONString() { StringBuilder json = new StringBuilder(); json.append( "{" ); if ( className !=null && className.length()>0 ) { json.append( "\"class\":\"" ); json.append( className ); json.append( "\"," ); } if ( id ...
6
private boolean r_prelude() { int among_var; int v_1; // repeat, line 36 replab0: while (true) { v_1 = cursor; lab1: do { // (, line 36 // [, line 37 bra = cursor; // substring, line 37 among_var = find_among(a_0, 3); if (among_var == 0) { break lab1; } // ], line 37 ...
8
public double getRelativeX() {return pos.getX();}
0
private void setMainPanel() { //getsections according to examId getSections(examId); sectionChosen = new JCheckBox[sections.size()]; sectionLabels = new JLabel[sections.size()]; //set editbuttons, editbuttons and sectionlabels for (int i = 1; i < sections.size() + 1; i...
6
public static int overallMines(MineGen theGrid, int gridX, int gridY) { // This method receives the coordinates of the square that is on the overall grid // and returns the number of its closest mines. int a = gridX; int b = gridY; int mineCount = 0; if (theGrid.hasMine(b, a + 1)) mineCount++; if (th...
8
public void encryptFile(String filePath, byte[][][] subKeys) { System.out.println(); System.out.println("Encrypting"); try { final File inputFile = new File(filePath); final File outputFile = new File(filePath + ".des"); final InputStream inputStream = new Bu...
4
@Override public Entity createEntity() { Entity enemyEntity = new Entity(entityManager, entityManager.createEntity(), new Spatial(0, 0, enemyGraphic.getWidth(), enemyGraphic.getHeight()), new Draw(enemyGraphic, DrawOrder.ENEMY), new MinimapDrawn(0xFFFFFF), // random AI, just for testing new...
2
public static Vector getOffset(BlockFace facing) { if (facing == null) return new Vector((int)(Smelter.WIDTH / 2), (int)(-Smelter.HEIGHT / 2), 0); if (facing.equals(BlockFace.NORTH)) { return new Vector((int)(Smelter.WIDTH / 2), (int)(-Smelter.HEIGHT / 2), 0); } else if (facing.equals(BlockFace.EAST...
5
private void buildComponents(Container window) { if (window instanceof Frame) frame = (Frame) window; window.setFont(new Font("dialog", Font.PLAIN, 10)); classpathField = new TextField(50); classField = new TextField(50); sourcecodeArea = new TextArea(20, 80); errorArea = new TextArea(3, 80); verbose...
1
@Override public void mouseReleased(MouseEvent e) { try { int[] koords = haeKoordinaatit(e.getSource()); if (koords != null) { int mouseEvent = e.getButton(); switch (mouseEvent) { case 1: avaaYksi(koords[0]...
6
@Override public void renameRooms(Area A, String oldName, List<Room> allMyDamnRooms) { final List<Room> onesToRenumber=new Vector<Room>(); for(Room R : allMyDamnRooms) { synchronized(("SYNC"+R.roomID()).intern()) { R=getRoom(R); R.setArea(A); if(oldName!=null) { if(R.roomID().toUpperC...
8
public static byte get(byte[] header, byte[] data, int i) { if (i < header.length) { return header[i]; } if (i - header.length < data.length) { return data[i - header.length]; } return (byte) 0x00; }
2
private void calcSum(int p, int currentFrame) { for (int f = 1; f <= currentFrame; f++) { scoreBoard[p][2][f] = scoreBoard[p][2][f-1] + scoreBoard[p][0][f] + scoreBoard[p][1][f]; if (scoreBoard[p][0][f] == 10){ if(scoreBoard[p][0][f+1] == 10){ scoreBoard[p][2][f] = scoreBoard[p][2][f]+scoreBoard[p][0][...
4
public void getEventStream(CallBack callback) throws MalformedURLException, IOException { HttpRequest request = generateRequest("/eventstream", new TreeMap<String, String>(), false); ApiResponse response = null; response = streamApi(request); BufferedReader br = new BufferedReader(new InputStreamReader(resp...
8
public NodeList getNodeList(String tagName) throws ParserConfigurationException, SAXException, IOException{ // Sucht nach die tagName tags if(current==null){ return xmlFile.getElementsByTagName(tagName); } return current.getElementsByTagName(tagName); }
1
public Principal authenticate(final String username, final String credentials) { logger.info("authenticate called for user: " + username ); CommunityAccount purported = (new SQLStatementProcessor<CommunityAccount>("SELECT * FROM valid_accounts WHERE username = ?") { CommunityAccount process( PreparedStatem...
4
public HashMap<String, HostInfo> getHosts(){ return this.hosts; }
0
public void warn(String message) { log(Level.WARNING, message); }
0
protected Boolean process(String command){ File script; String suffix = ".sh"; if(SystemUtils.IS_OS_WINDOWS){ suffix = ".bat"; } if((script= setData(command, suffix))==null){ return false; } script.setExecutable(true); //starts and wait for the process ProcessBuilder pb = new ProcessBuilder("."+...
4
public static byte[] InputStreamToByte(InputStream in) { int BUFFER_SIZE = 4096; ByteArrayOutputStream outStream = null; byte[] data = new byte[4096]; int count = -1; try { outStream = new ByteArrayOutputStream(); while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) { outStream.write(data,...
4
public void go(){ // 1 получить json с инстаграмма while(run){ try { process(getRecent()); Thread.sleep(timeout); DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date today = Calendar.getInstance().getTime(); ...
2
public static void doTowers(PrintWriter out,int topN, char from, char inter, char to) { if (topN == 1){ out.println("Ring 1 from " + from + " to " + to); }else { doTowers(out,topN - 1, from, to, inter); out.println("Ring " + topN + " from " + from + " to " + to); doTowers(out...
1
public static byte[] getMacAddress() { if(cachedMacAddress != null && cachedMacAddress.length >= 10) { return cachedMacAddress; } try { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while(networkInterfaces.hasMoreElements()) { NetworkInterface network = ne...
7
public Integer interpret(Context ctx) { // this 为调用interpret 方法的Variable 对象 return ctx.LookupValue(this); }
0
private SolveStateEnum solve() { try { boolean run1 = true; while (run1 && solveState != SolveStateEnum.ERROR) { int starCount = getStarCountInRiddle(); checkByBlock(); if (starCount <= getStarCountInRiddle()) { solveState = SolveStateEnum.MUST_...
9
public int overColumnDivider(int x) { int divider = getColumnDividerWidth(); int count = mColumns.size() - 1; int pos = 0; for (int i = 0; i < count; i++) { TreeColumn column = mColumns.get(i); pos += column.getWidth(); if (x >= pos - HIT_SLOP && x <= pos + HIT_SLOP) { return i; } pos += divi...
3
@Test public void testStartPlagiatsSearchInt() { assertEquals(0, 0); }
0
public ArrayList<AbilityType> getAbilities() { ArrayList<AbilityType> abilities = new ArrayList<AbilityType>(); for (int c = 0; c < activeEnchants.size(); c++) { abilities.add(ActiveWeaponEnchant.getAbility(activeEnchants.get(c))); } return abilities; }
1
@Override public void handleCollision(Actor other) { if(other instanceof Projectile){ hitPoints -= ((Projectile) other).getDamage(); } else if ( other instanceof Asteroid || other instanceof actor.ship.Ship){ // Don't collide with our siblings if(other.getParentId...
5
public void testSetValue() { Integer scalar = 0; List<Integer> list = Arrays.asList(1, 2, 3); ListELResolver resolver = new ListELResolver(); ListELResolver resolverReadOnly = new ListELResolver(true); // base == null --> unresolved context.setPropertyResolved(false); resolver.setValue(context, null, "fo...
7
public double getLatticeAngle(double arcFraction) { if (arcLattice == null) { generateArcLattice(); } if (arcFraction < 0) { return 0; } double hemispherePortion = (int)(arcFraction / 0.5) * Math.PI; double remainderArcLength = (arcFraction % 0....
5
private static String constructNEPerson(String input, String verb) throws InvalidFormatException, IOException { if (!verb.equals("") && !verb.equals("is")) { return "Did you " + verb + " " + nameFinderChatbot.findNames(input)[0] + "?"; } else if (verb.equals("is")) return "Nice to meet you " + nameFinder...
3
public int CheckAdd() throws SQLException { int NbreAjout=0; ResultSet R=M.exec("SELECT value FROM variable WHERE ID=1"); if(R!=null && R.absolute(1)) { int x=R.getInt("Value"); ResultSet RS=M.exec("SELECT COUNT(*)FROM message"); if (RS!=null && RS.absolute(1)) { int y=RS.ge...
5
@Override public void run() { ServerSocket serverSocket = null; try { serverSocket = new ServerSocket(this.port); //If no haertbeat from worker process ... then timeout. serverSocket.setSoTimeout(ACCEPT_TIMEOUT); while(true) { Socket clientSocket = null; try { clientSocket = serverSocket....
4
private Mode extractRuleMode() throws XMLStreamException, ParserException { String modeName = ""; boolean isModeNegation = false; Tag startTag = currTag; if (Tag.NOT.equals(currTag)) isModeNegation = true; do { int event = reader.next(); switch (event) { case XMLStreamConstants.START_ELEMENT: c...
7
public boolean canPlaceRoad(EdgeLocation edgeLoc) { if (!playingRoadBuildingCard) { if (presenter.getState().getStatus().equals("FirstRound") || presenter.getState().getStatus().equals("SecondRound")) { return presenter.canPlaceRoad(edgeLoc, true); } else { return presenter.canPlaceRoad(edgeLoc, fals...
6
@Override public void run() { boolean stop = false; while (!isInterrupted() && !stop) try { Thread.sleep(1000); if (appBehaviorObserver == null) continue; ResourcePrincipal[] tmp = bean.getApplications(); Set<ResourcePrincipal> newSet = new HashSet<Re...
8
public void execute(final JGraphLayout layout) { if (graph != null && graph.isEnabled() && graph.isMoveable() && layout != null) { final JGraphFacade facade = createFacade(graph); final ProgressMonitor progressMonitor = (layout instanceof JGraphLayout.Stoppable) ? createProgressMonitor( graph, (JGraph...
9
public static void openURL(String url) { try { //attempt to use Desktop library from JDK 1.6+ Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[]{java.net.URI.class}).invoke( d.getDeclaredMethod("getDesktop").invoke(null), ...
9
private void dfs(Digraph G, int v) { marked[v] = true; preOrder.add(v); for (int w : G.adj(v)) if (!marked[w]) dfs(G, w); postOrder.add(v); reversePostOrder.push(v); }
2
@EventHandler public void onMove(PlayerMoveEvent e) { Location locFrom = e.getFrom(); Location locTo = e.getTo(); Player p = e.getPlayer(); Benutzer b = this.plugin.alleBenutzer.get(p.getName()); for (Map.Entry<String, Gebiet> mapGebiet : this.plugin.alleGebiete.entrySet()) {...
9
public UserView() { frame = this; this.setTitle("Library"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); contentPanel = new JPanel(); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPanel.setLayout(new BorderLayout(0,0)); setContentPane(contentPanel); tabbedPane = new JTabbedPane(JTabbe...
7
public ArrayList<Local> listar(long pesquisaId) throws Exception { String sql = "SELECT * FROM pesquisalocal WHERE id1 = ?"; ArrayList<Local> listaLocal = new ArrayList<Local>(); if (pesquisaId > 0) { try { PreparedStatement stmt = Connectio...
3
@Override public final String getSqlPredicat() { if (this.isPolesCollision()) { return null; } final List ranges = (List) computeRange(); final List<Double[]> raRanges = (List<Double[]>) ranges.get(0); final double[] decRange = (double[]) ranges.get(1); String predicatDefinition; i...
6
@Override public int castingQuality(MOB mob, Physical target) { if((mob!=null)&&(target!=null)) { if(anyWeapons(mob)) return Ability.QUALITY_INDIFFERENT; if(mob.rangeToTarget()>0) return Ability.QUALITY_INDIFFERENT; if(CMLib.flags().isSitting(mob)) return Ability.QUALITY_INDIFFERENT; if(mo...
8
static final void getClientSignature(ByteBuffer buffer, byte i) { anInt8248++; byte[] is = new byte[24]; if (i == 55) { if (Class374.randomDatBufferedFile != null) { try { Class374.randomDatBufferedFile.method789(0L, (byte) -120); Class374.randomDatBufferedFile.method784(-89, is); int i_170_...
7
public String[][] cantidadCitasMedico (String mes,String ano ){ String sql_consult; String fecha_ini, fecha_fin; String [] [] resultado = null; String dia_final; int mes_entero = Integer.parseInt(mes); switch (mes_entero) { case 2 : dia_final = "28"; ...
9
private int getNumeroInstruccion (String nombre) { int procACargar = 0; while (!procedimientos.get(procACargar).getNombre().equals(nombre)) procACargar++; return procedimientos.get(procACargar).getQuadruploInicio(); }
1
public void print(PrintStream out) { out.println("Settings"); for (Setting setting : map.values()) { if (setting instanceof AlgFileSetting) continue; if (setting.getLocked()) { out.println(" " + setting.getName() + ": " + setting.getString()); ...
3
public static void main(String[] args)throws IOException { double finalAnswer=-99999; double finalcurvePoints=0; double finalPeriod=0; double finalPercDif=0; double finalminSRDif=0; double finalTP=0; double[] PortfolioValue=new double[60*260]; ...
6
public void run() { // Сначала нужно проинициализировть данные откуда то // Создать мир this.init(); long startTime; long currentTime; startTime = System.currentTimeMillis(); while (true) { // Допустим, я не хочу чтобы игра просчитывалась чаще чем 6...
4
public Object calculate(SecuredTaskBean task) throws GranException { HashMap<String, SecuredUDFValueBean> m = task.getUDFValues(); SecuredUDFValueBean ci = m.get(INCIDENT_PRODUCT_UDFID); List<String> bf = new ArrayList<String>(); if (ci != null) { Object value = ci.getValue(...
8
public byte[] HandleRevealMessage(byte[] data) { RevealationMessage message = new RevealationMessage(ByteBuffer.wrap(data)); switch(message._revealationApi) { case (byte) 0xE3: // ECM/Appliance Info return HandleDeviceInformation(message._transactionId,message._revealationOpcode,message._revealationA...
7
private void lol() { Calendar cal = new GregorianCalendar(TimeZone.getDefault()); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); if (month == 3 && day == 1) { xAuthLog.warning("Your trial version of xAuth expires today!"); xAuthLog.warning("Purchase the full version on Ste...
4
private void jButton0MouseMouseClicked(MouseEvent event) { SelectFrame lf = new SelectFrame(); lf.setDefaultCloseOperation(SelectFrame.EXIT_ON_CLOSE); lf.setTitle("SELECT"); lf.getContentPane().setPreferredSize(lf.getSize()); lf.pack(); lf.setLocationRelativeTo(null); lf.setVisible(true); this.dispose()...
0
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int y = 0; y < board.length; y++) { for (int x = 0; x < board[y].length; x++) { if (x > 0) { sb.append( ' ' ); } sb.append( board[y][x] ? 'O' : '-' ); } sb.append( '\n' ); } return sb.toStri...
4
private void setupFromQuestion(BonusQuestion bq) { tfPromptInput.setText(bq.getPrompt()); if (bq.getBonusType() == BonusQuestion.BONUS_TYPE.MULTI) { rbMultChoice.setSelected(true); String[] choice = bq.getChoices(); for (int i = 0; i < tfMultiList.size(); i++) { tfMultiList.get(i).setText(choice...
3
@Override public boolean equals(Object object){ if(!(object instanceof Move)){ return false; } Move move = (Move)object; boolean equals = getColumn() == move.getColumn(); equals = equals && getRow() == move.getRow(); equals = equals && getPlayer() == move.getPlayer(); ...
3
HospitalPart getHospitalizeRoom() { double t = nextRand(); if ( t < 0.5 ) return HospitalPart.SURGERY; else if ( t < 0.75 ) return HospitalPart.ICU; else return HospitalPart.CCU; }
2
public boolean canSplit2() { //Whoa... This gets complicated if I have to //take into acount the "don't care" of transparent colors... int[] data = new int[min.length]; boolean[] seen = new boolean[min.length]; for (MultiColor c : freqTable.keySet()) ...
6
boolean isUnzipAddDirectory(String targetPath, String fileName) throws RemoteException { // result:Used to store the result information of the command execution ArrayList<String> result = new ArrayList<String>(0); // errorResult:Used to store the error information of the command // execution ArrayList<String>...
4
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!plugin.hasPerm(sender, "reply", false)) { sender.sendMessage(ChatColor.YELLOW + "You do not have permission to use /" + label); return true; } Player player = (Player) sender; String msg = plugin.m...
4
public void keyTyped(KeyEvent pEvent) { char key = pEvent.getKeyChar(); String strKey = TableViewAdapter.removeSpecialCharacter(new Character(key).toString()); if (System.currentTimeMillis() - mPreviousTime < RESET_TIME) { mTextToFind = mTextToFind + strKey; ...
3
@Override @SuppressWarnings("SleepWhileInLoop") public void run() { try { int countSent = 0; int countUnsent = 0; String from = null; String date = null; String body = null; for (int i = 0; i < s...
9
public Row getByKey(String tableName, String key) throws DataBaseTableException { Table table = tableHashMap.get(tableName); if (table == null) { throw new DataBaseTableException("no such table"); } return table.get(key); }
1
public Metadata readNextMetadata() throws IOException { Metadata metadata = null; boolean isLast = (bitStream.readRawUInt(Metadata.STREAM_METADATA_IS_LAST_LEN) != 0); int type = bitStream.readRawUInt(Metadata.STREAM_METADATA_TYPE_LEN); int length = bitStream.readRawUInt(Metadata...
7
public boolean getCopyEnabled() { return this instanceof ClipboardInterface && copyEnabled; }
1