text
stringlengths
14
410k
label
int32
0
9
@Override public boolean containsValue(V value) { if (value == null) { return false; } for (Entry entry : this.array) { if (entry != null && value.equals(entry.value) && !entry.isDeleted) { return true; } } return false; ...
5
public GenericConverter find(Class<?> sourceType, Class<?> targetType) { List<Class<?>> sourceCandidates = getTypeHierarchy(sourceType); List<Class<?>> targetCandidates = getTypeHierarchy(targetType); for (Class<?> sourceCandidate : sourceCandidates) { for (Class<?> targetCandidate : targetCandidates) { ...
9
private void downHeapify(int p) { for (int c = p * 2 + 1; c < values; p = c, c = p * 2 + 1) { if (c + 1 < values && distance[c] < distance[c + 1]) { c++; } if (distance[p] < distance[c]) { // Swap the points Object pData = data[p]; double pDist = distance[p]; data[p] = data[c]; ...
4
private int low() { return (isInclusiveHostCount() ? network() : broadcast() - network() > 1 ? network() + 1 : 0); }
2
public SPKIDataType createSPKIDataType() { return new SPKIDataType(); }
0
private static synchronized UserEntry getEntry(long curUser) { UserEntry entry = unfinished_map.remove((Long) curUser); if (entry == null) { MyArrayList list = new MyArrayList(); entry = new UserEntry(-1, list); list.add(curUser); } return entry; }
1
public void move (int xMove, int yMove) { if (xMove != 0 && yMove != 0) { move (xMove, 0); move (0, yMove); return; } if (xMove > 0) dir = 1; if (xMove < 0) dir = 3; if (yMove > 0) dir = 2; if (yMove < 0) dir = 0; if (!collision (xMove, yMove)) { x += xMove; y += yMove; } }
7
public static String underscoreToCamelCase(String underscore) { StringBuilder builder = new StringBuilder(); boolean prevIsUnderscore = false; char[] chars = underscore.toCharArray(); for (char c : chars) { if (c == '_') { prevIsUnderscore = true; } else if (prevIsUnderscore) { prevIsUnderscore = ...
3
public Type intersection(Type type) { if (type == tError) return type; if (type == Type.tUnknown) return this; Type newBottom = getSpecializedType(type); Type newTop = getGeneralizedType(type); Type result; if (newTop.equals(newBottom)) result = newTop; else if (newTop instanceof ReferenceType ...
6
public boolean camposobrigatoriospreenchidos() { if (TfDescNotaCompra.getText().equals("")) { msg.CampoObrigatorioNaoPreenchido(LbNotificacao, "Digite o código da nota do fornecedor!"); TfDescNotaCompra.grabFocus(); return false; } if (TfCodFuncionario.getText...
9
protected void clearCase(int i) { try { myLemma.clearCase(i); myCases.remove(i); myMessage.setText("Case #" + (i + 1) + " deleted."); refresh(); } catch(ArrayIndexOutOfBoundsException e) { /* * This sho...
1
public void inserir(long pesquisaId, ArrayList<Local> locais) throws Exception { String sql = "INSERT INTO pesquisalocal(id1,id2) VALUES (?, ?)"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); for (Local local : locais) { ...
2
public boolean isViable(Field field) { // How many counts are non-zero. int nonZero = 0; if(!countsValid) { generateCounts(field); } for(Class<?> key : counters.keySet()) { Counter info = counters.get(key); if(info.getCount() > 0) { ...
4
public static void runInstrumentedManyTimes( final MultithreadedTestCase test, int count, int[] failureCount) throws Throwable { int failures = 0; Throwable t = null; boolean failed = false; System.out.println("Testing " + test.getClass()); for (int i = 0; i < count; i++) { try { runOnce(test); ...
9
private void atualizaCamposFormulario(){ lblValorTotal.setText(Float.toString(venda.getValor())); modelo = new DefaultTableModel(); modelo.addColumn("Id"); modelo.addColumn("Produto"); modelo.addColumn("Quantidade"); modelo.addColumn("Valor Unitário"); fo...
1
public boolean tickUpdates(boolean var1) { int var2 = this.scheduledTickTreeSet.size(); if (var2 != this.scheduledTickSet.size()) { throw new IllegalStateException("TickNextTick list out of synch"); } else { if (var2 > 1000) { var2 = 1000; } ...
8
public double noise(double xin, double yin) { double n0, n1, n2; // Noise contributions from the three corners // Skew the input space to determine which simplex cell we're in final double F2 = 0.5 * (Math.sqrt(3.0) - 1.0); double s = (xin + yin) * F2; // Hairy factor for 2D int i = fastfloor(xin + s); int...
4
public void lostPower(int type) { switch(type) { case PowerUp.FLY: break; case PowerUp.TALL: width = DEFAULT_WIDTH; height = DEFAULT_HEIGHT; break; } }
2
@Override public void mouseMoved(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled()) { Iterator<mxCellHandler> it = handlers.values().iterator(); while (it.hasNext() && !e.isConsumed()) { it.next().mouseMoved(e); } } }
4
public void listDirectory(String dir) {//list in System.out.println the nwt files of a folder File file = new File(dir); File[] files = file.listFiles(new FilenameFilter() { public boolean accept(File file, String fileName) { return fileName.endsWith(".nwt"); } }); if (files != null)...
5
public boolean belongsInLambdaSet(String variable, Grammar grammar, Set lambdaSet) { if (isVariableWithLambdaProduction(variable, grammar)) return true; GrammarChecker gc = new GrammarChecker(); Production[] productions = GrammarChecker.getProductionsOnVariable( variable, grammar); for (int k = 0; k <...
3
@Override public void deserialize(Buffer buf) { super.deserialize(buf); firstNameId = buf.readShort(); if (firstNameId < 0) throw new RuntimeException("Forbidden value on firstNameId = " + firstNameId + ", it doesn't respect the following condition : firstNameId < 0"); la...
6
private void checkHSExists(){ File f = new File(HIGHSCORES_PATH); if(!f.exists()){ for(int i = 0; i < Board.NUM_SCORES; i++){ HighScore.write(new HighScore(), i, Board.HIGHSCORES_PATH); } } }
2
public void stopHosting(String hostName){ if(matchNameExists(hostName)){ setStatusToIdle(hostName); deletePlayerFromMarker(hostName); setIsHostToZero(hostName); resetMatchIDOfPlayers(hostName); deletePlayerFromTeam(hostName); deleteTeamsOfHost(hostName); deleteHostFromTeams(hostName); deleteHo...
1
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int times = 1; while ((line = in.readLine()) != null && line.length() != 0) { if (line.trim().equals("-1")) break; totalDis = Double.parseDouble(line....
4
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 switch_out(Point p) { if (!innerBorder.remove(p)) { return; } addToOuterBorder(p); for (Point n : n4(p)) { if (tita.getValue(n) == -3) { addToInnerBorder(n); } } }
3
public static Client getClientInstance(ElasticClientType clientType) { String HOSTNAME; int PORT; switch(clientType) { case TEST: System.out.println("Getting client"); if(node == null) { System.out.println("Got New Node"); node = new NodeBuilder().settings(getTestSettings()).node(); } return...
6
private void calculateEnabledState(OutlinerDocument doc) { if (doc == null) { setEnabled(false); return; } if (doc.hoistStack.isHoisted()) { setEnabled(true); } else { setEnabled(false); } }
2
public void sleep(long duration) { try { Thread.sleep(duration); } catch (InterruptedException e) { print("Sleep Interrupted."); } }
1
private double sIB_local_MI(Matrix m, double[] Pt) { double Hy = 0.0, Ht = 0.0; for (int i = 0; i < Pt.length; i++) { Ht += Pt[i] * Math.log(Pt[i]); } Ht = -Ht; for (int i = 0; i < m_numAttributes; i++) { double Py = 0.0; for (int j = 0; j < m_numCluster; j++) { Py += m.get(i...
8
private final void draw00(byte[] is, int[] is_49_, int i, int i_50_, int i_51_, int i_52_, int i_53_, int i_54_, int i_55_) { int i_56_ = -(i_52_ >> 2); i_52_ = -(i_52_ & 0x3); for (int i_57_ = -i_53_; i_57_ < 0; i_57_++) { for (int i_58_ = i_56_; i_58_ < 0; i_58_++) { if (is[i_50_++] != 0) ...
8
public void setSequence_Id(int sequenceId) { sequence_Id = sequenceId; }
0
private void initListeners() { automaton.addTransitionListener(new AutomataTransitionListener() { public void automataTransitionChange(AutomataTransitionEvent e) { if (!e.isAdd()) { return; } Transition transition = e.getTransition(); if (!tToP.containsKey(transition) || alreadyDone.cont...
4
public Tile getTileAt(Position p) { if ( p.getRow() == 0 && p.getColumn() == 0 ) { return new StubTile(GameConstants.FOREST, 0, 0); } if ( p.getRow() == 1 && p.getColumn() == 0 ) { return new StubTile(GameConstants.HILLS, 1, 0); } return new StubTile(GameConstants.PLAINS, 0, 1); }
4
private Type mergeArray(Type type) { Type typeRoot = getRootComponent(type); Type thisRoot = getRootComponent(this); int typeDims = type.getDimensions(); int thisDims = this.getDimensions(); // Array commponents can be merged when the dimensions are equal if (typeDims ==...
5
public void addEdge(Object u, Object v, int weight) { try { if(!isVertex(u) || !isVertex(v)) { // graph is unchanged if neither vertices are in the graph return; } else { if (edgeHashTable == null) { // initialize the edgeHashTable when adding the first edge edgeHashTable = new HashTableChained...
7
@Test public void runTestSourceCodeSpecific1() throws IOException { InfoflowResults res = analyzeAPKFile("GeneralJava_SourceCodeSpecific1.apk"); Assert.assertEquals(1, res.size()); }
0
@Override public boolean equals(Object obj){ if(!(obj instanceof FailureTransition)) return false; if(obj == this) return true; FailureTransition ft = (FailureTransition)obj; boolean sameState = true; for(Tree<PhraseData> state : ft.getState()){ ...
9
public String evaluateTemplate(String template, Map<String, String> variables) { if (template == null) { return template; } StringBuffer result = new StringBuffer(); int startIndex = template.indexOf(VAR_START); int endIndex = -1; while (startIndex >= 0 && ...
6
public void connect() { // Step 0 : Build URL int step = 0; long t0 = System.currentTimeMillis(); if (debug) Gpr.debug("Connect Step = " + step); try { URL url = buildUrl(); // Step 1: Open connection step = 1; if (debug) Gpr.debug("Connect Step = " + step); URLConnection httpConnection = url....
9
private static void loadPackSettings(JSONObject packConfig, List<String> installationQueue) { //Set Minecraft version setting Variables.setSetting("general.MinecraftVersion", (String) packConfig.get("minecraftversion")); //Load pack settings if (packConfig.get("settings...
3
public boolean getBoolean(int index) throws JSONException { Object object = get(index); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String)object).equalsIgnoreCase("false"))) { return false; } else if (object.equals(Boolean.TRUE)...
6
private void initializeGraphicComponents() throws IOException { /* this method will initialize all the graphic components displayed * on the screen and ensuring that no NullPointerException is generated */ searchField = new JIconTextField(); menuBar=new MenuBar(); menu=new Menu("Menu"); newMenuItem=new...
3
@Override public void mouseClicked(MouseEvent e) { //System.out.println(e.isPopupTrigger()); // never works if (e.getButton() == MouseEvent.BUTTON3 && tab.getSelectedValue() != null) { JPopupMenu menu = new JPopupMenu(); for (int i = 0; i < tabs.size(); i++) { final JList destination = tabs.get(i); ...
4
@Override public ArrayList<String> getColumnsNames() throws Exception { ArrayList<String> alColumns = null; try { oMysql.conexion(enumTipoConexion); alColumns = oMysql.getColumnsName("usuario", Conexion.getDatabaseName()); oMysql.desconexion(); } catch (E...
1
protected MoveResult checkGameOver() { MoveResult result = MoveResult.OK; boolean blueflysurrounded = false; boolean redflysurrounded = false; // check surrounded butterflys if(bluefly != null) { if(num_adjacent(bluefly) == 6) { blueflysurrounded = true; } } if(redfly != null) { if(num_adj...
8
private static boolean containsDuplicate(List<Character> chars, int start, int end) { for (int i = start; i <= end-1; i++) { if (chars.get(i)== chars.get(end)) { return true; } } return false; }
2
public static void deposit(int type, int amount) { if(type == WOOD) { wood += amount; } else if(type == STONE) { stone += amount; } else if(type == GOLD) { gold += amount; } else if(type == FOOD) { food += amount; } }
4
private boolean jj_3R_63() { Token xsp; xsp = jj_scanpos; if (jj_3_71()) { jj_scanpos = xsp; if (jj_3_72()) return true; } return false; }
2
@Override public boolean checkTable(String table) { DatabaseMetaData dbm = null; try { dbm = this.open().getMetaData(); ResultSet tables = dbm.getTables(null, null, table, null); if (tables.next()) { tables.close(); return true; } else { tables.close(); return false; } } catch (SQL...
2
public void run() { // Put a spiffy message in the console try { // Loop while we are active while(active) { MazewarPacket headQueuePacket; headQueuePa...
9
public stringMutation(char[] cArray, int len) { this.charCount = len; this.charCountTail = len - 1; this.charArray = new char[charCount]; this.charArrayNoTail = new char[charCount]; for(int i=0; i< charCount;i++){ this.charArray[i] = cArray[i]; this.charArrayNoTail[i] = cArray[i]; } this.charArra...
1
private double getInterval(double l) { double interval = 0.1; if (l >= 1.0) { for (int i = 0; l / interval > 10; ++i) { if (i % 3 == 0) interval *= 2; else if (i % 3 == 1) interval *= 2.5; else interval *= 2; ...
8
@Override public int getSlotSpacingX() { return isNotPlayerInventory() ? 50 : 18; }
1
public void remove(HiloBean oHiloBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.removeOne(oHiloBean.getId(), "hilo"); oMysql.desconexion(); } catch (Exception e) { throw new Exception("HiloDao.removeHilo: Error: " + e.getMessage()...
1
public static boolean isApplicable(Serializable object) { return object instanceof TuringMachine; }
0
public boolean epsilonEquals(Matrix3d m1, double epsilon) { return Math.abs(m00 - m1.m00) <= epsilon && Math.abs(m01 - m1.m01) <= epsilon && Math.abs(m02 - m1.m02 ) <= epsilon && Math.abs(m10 - m1.m10) <= epsilon && Math.abs(m11 - m1.m11) <= epsilon && Math.abs(m12 - m1.m12) <= epsilon && Math.abs(m20...
8
private void decodeHeader(BufferedReader in, Properties pre, Properties parms, Properties header) throws InterruptedException { try { // Read the request line String inLine = in.readLine(); if (inLine == null) return; StringTokenizer st = new StringTokenizer( inLine ); if ( !st.hasMoreToken...
9
static final void method1138(String string, boolean bool, String string_0_, byte i) { try { anInt1908++; Class64_Sub3.playerPassword = string; Class186.playerUsername = string_0_; Mob.aBoolean10238 = bool; if (!Mob.aBoolean10238 && (Class64_Sub3.playerPassword.equals("") || Class1...
7
public static String bytesToHexString(byte[] b) { if (b == null || b.length < 0) { return null; } StringBuilder stringBuilder = new StringBuilder(); String hv; for (int i = 0; i < b.length; i++) { hv = Integer.toHexString(b[i] & 0xFF); if (hv.length() < 2) { stringBuilder.append(0); ...
4
public static void main(String[] args) { if(args.length == 2){ int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); System.out.println((a>b)? a : b); } }
2
private boolean jj_3R_58() { Token xsp; xsp = jj_scanpos; if (jj_3R_63()) { jj_scanpos = xsp; if (jj_3R_64()) { jj_scanpos = xsp; if (jj_3R_65()) { jj_scanpos = xsp; if (jj_3R_66()) { jj_scanpos = xsp; if (jj_3R_67()) { jj_scanpos = xsp; if (jj_3R_68()) { ...
7
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 boolean getBoolean(String key) throws JSONException { Object object = this.get(key); if (object.equals(Boolean.FALSE) || (object instanceof String && ((String) object) .equalsIgnoreCase("false"))) { return false; } else if (object.equals...
6
@Override public void executeMsg(Environmental host, CMMsg msg) { if((msg.target()==affected) &&((msg.source()==invoker())||(msg.source().Name().equals(text()))) &&(msg.sourceMessage()!=null) &&(msg.sourceMinor()==CMMsg.TYP_SPEAK) &&(msg.sourceMessage().toUpperCase().indexOf("OPEN")>=0) &&(affected instan...
7
public <T2> Query<T2> cast(final Class<T2> t2) { return this.select(new Selector<T, T2>(){ @Override public T2 select(T item) { return t2.cast(item); }}); }
0
public boolean containsDuplicate(int[] nums) { if(nums==null || nums.length<=1){ return false; } boolean res =false; HashMap s = new HashMap<>(); for(int i:nums){ if(s.get(i)==null){ s.put(i,i); }else{ res = true; break; } } return res; }
4
public void setY(int y) { this.y = y; }
0
public String Wert2String() { if ((wert>=2)&&(wert<=10)) return ""+wert; switch (wert) { case 1: return "A"; case 11: return "B"; case 12: return "D"; case 13: return "K"; } return "-1"; }
6
public static void fetchAd(final Context context) { final Activity activity = (Activity) context; // Only do this if we haven't already got an ad preloading or loading if (adState != AdState.NONE){ return; } setAdStateToLoading(); activity.runOnUiThread(new Runnable(){ @Override public void r...
7
public static void runGame() { // GL setup try { Display.setTitle("TankyTanks - DEV"); Display.setDisplayMode(new DisplayMode(800, 600)); Display.create(); } catch(Exception e) { e.printStackTrace(); System.exit(-1); } GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); G...
2
public Location getLocation(World world) { UUID uid = globalUID == null ? world.getUID() : globalUID; Location loc = locations.get(uid); return loc == null ? world.getSpawnLocation() : loc; }
2
public static boolean comienza(String baseDeDatos, String entrada) { /* ENTRADA DE DATOS */ String[] cadena; StringTokenizer tokenizerBD = new StringTokenizer(baseDeDatos, " "); int cantTokensBD = tokenizerBD.countTokens(); StringTokenizer tokenizerEntrada = new StringTokenizer(entrada, " "); int cantTokens...
9
@Override public boolean equals(Object obj) { if (obj instanceof Teaches) { Teaches t = (Teaches)obj; return t.teacher == this.teacher && t.classTaught == this.classTaught; } return false; }
2
public static void rect( double x, double y, double w, double h ) { if ( filling ) { pane.setColor( fillColor ); if ( rectMode == 0 ) pane.fillRect( (int) x, (int) y, (int) w, (int) h ); else if ( rectMode == 1 ) pane.fillRect( (int) ( x - w / 2 ), (int) ( y - h / 2 ), (int) w, (int) h ); } if...
6
@Test public void gameStateTransitionTest2() { City_Graph city_graph2 = new City_Graph(); city_graph2.loadMap("res/test2.mp"); Move move = new Move("R 2"); city_graph2 = city_graph2.gameStateTransition(move); assertEquals(city_graph2.convertGameStateToString(),"CRRNNNRNNC"); }
0
public void mouseClicked(MouseEvent me) { int x, y; Rectangle r = new Rectangle(0, 0, (int) (m_nPaddedNodeWidth * m_fScale), (int) (m_nNodeHeight * m_fScale)); x = me.getX(); y = me.getY(); for (int iNode = 0; iNode < m_BayesNet.getNrOfNodes(); iNode++) { r.x = (int) (m_BayesNet.getPositionX(iNode)...
7
public static void main(String[] args) { String text = "Sample text"; File directory = new File("output/example"); directory.mkdirs(); // だめな例:ストリームをクローズしない BufferedWriter output1 = null; try { output1 = new BufferedWriter(new FileWriter( "output/example/output5.txt")); output1.write(text); ...
8
private void closeConnection(Connection connection) { if (connection == null) return; try { connection.close(); } catch (SQLException e) {} }
2
protected void init() { Arrays.fill(m_diag, 0); double lambda = 1.0/Math.sqrt(m_lambda); for(int i=0; i<m_beta.length; i++) m_beta[i] = Normal.staticNextDouble(0, lambda); if (m_signs!=null) {//enforce sign over the initial setting of feature weights for(int i=0; i<m_beta.length; i++) { if (m_...
4
public static String[][] getEvaluationResults() { String [][] evaluationdata; String read; ArrayList<String> evaluationData = new ArrayList<String>(); try { BufferedReader reader = new BufferedReader(new FileReader("evaluation.txt")); while((read = reader.readLine()) != null) { evaluationData.add(read...
3
public DCStation(String alias) { this.alias = alias; net = new Network(); kh = new KeyHandler(alias); connectionSemaphore = new Semaphore(0); Debugger.println(2, "[DCStation] Station " + alias + " started"); }
0
public void move(Game game, boolean[] actionMask) { lastMovementType = Types.MOVEMENT.MOVE; //Map from the action mask to a Vector2D action. Direction action2D = Utils.processMovementActionKeys(actionMask, getPlayerID()); //Update the orientation for this cycle's movement, ...
3
public String Impresion(String palabra) { String temporal = ""; boolean finalizar = false; int contador = 0; while (!finalizar) { if (contador == 0) { temporal += palabra.charAt(contador); contador = palabra.length() - 1; } else if ...
7
public int getCurrRow(){ return currRow; }
0
private static boolean occupySameSpace(Positioned a, Positioned b) { return a.leftBorder() == b.leftBorder() && a.rightBorder() == b.rightBorder() && a.topBorder() == b.topBorder() && a.bottomBorder() == b.bottomBorder(); }
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Endereco other = (Endereco) obj; if (this.codEndereco != other.codEndereco) { return false; ...
7
public TuringTestAction() { //super("Test Turing Machines", null); super("Test Turing Machines", KeyEvent.VK_T); }
0
public static void main(String[] argv) throws IOException { int i; // parse options for (i = 0; i < argv.length; i++) { if (argv[i].charAt(0) != '-') break; ++i; switch (argv[i - 1].charAt(1)) { case 'b': try { ...
7
private boolean isFalsePositive(String[] checks, String org) { for (String check : checks) { if (org.contains(check)) { return true; } } return false; }
2
public String[][] toRowData() { // return array String[][] rowData = new String[BPO.size()][13]; // set values for all blueprints for (int i = 0; i < BPO.size(); i++) { rowData[i] = BPO.get(i).toStringArray(); } return rowData; }
1
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Job job = new Job(conf, "requestcounts"); job.setOutputKeyClass(Text.class); job.setOutputValueClass(Text.class); job.setMapperClass(MapRequest.class); job.setReducerClass(ReduceRequest.class); job.set...
9
void create(Map m, Tile t) { m.rect(x, y, x + width, y + height, true, false, t); m.rect(x, y, x + width, y + height, true, true, t); switch (doorwall) { case UR: m.getTile(x + doorpos, y - 1).setWall(Tile.WALL_LL, false); break; case UL: m.getTile(x - 1, y + doorpos).setWall(Tile.WALL_LR, fa...
4
private void publishTopList() { // calculate top list: SortedMap<Long, String> top = new TreeMap<Long, String>(); for (Map.Entry<String, Long> entry : counter.entrySet()) { long count = entry.getValue(); String word = entry.getKey(); top.put(count, word); ...
4
private boolean setupPermissions() { if( getServer().getPluginManager().getPlugin("Vault") != null ) { RegisteredServiceProvider<Permission> permissionProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class); if (permissionProvider != null) { vaultPerms = ...
2
private static MessageType decodeMessageType(byte messageType) { switch(messageType) { case Packet.MESSAGE_TYPE_APPLICATION: return MessageType.APPLICATION; case Packet.MESSAGE_TYPE_PING: return MessageType.PING; case Packet.MESSAGE_TYPE_PING_RESPONSE: return MessageType.PING_RESPONSE; case Pa...
8
@Test public void testRunStartServerSpotGuest()throws Exception{ AccessControlServer server = new AccessControlServer(1933); server.start(); SpotStub spot = new SpotStub("139",1933); spot.start(); sleep(1000); String ans = ""; int x = 0; ...
3
public static Stack<Integer> sort(Stack<Integer> st1) { Stack<Integer> st2=null; int max=0,counter=0,temp=0; while(!st1.isEmpty()) { if(max==0) max=st1.peek(); else if(st1.peek()>max) max=st1.peek(); if(st2==null) { st2=new Stack<Integer>(); st2.push(st1.pop()); } else ...
9
public static Matrix identity(int N) { Matrix I = new Matrix(N, N); for (int i = 0; i < N; i++) { I.data[i][i] = 1; } return I; }
1