text
stringlengths
14
410k
label
int32
0
9
public void removeWeather() { if(side1.contains(FieldCondition.Sun)) side1.remove(FieldCondition.Sun); if(side1.contains(FieldCondition.Sandstorm)) side1.remove(FieldCondition.Sandstorm); if(side1.contains(FieldCondition.Rain)) side1.remove(FieldCondition.Rain); if(side1.contains(FieldCondition.Hail))...
8
private void decodeParms(String parms, Map<String, String> p) { if (parms == null) { queryParameterString = ""; return; } queryParameterString = parms; StringTokenizer st = new StringTokenizer(parms, "&"); while (st.hasMoreToke...
3
public void hurt (final Body b) { life--; runnableManager.add(new Runnable() { public void run () { if (b != null) { if (b.getUserData() != null) { System.out.println("hej"); Objects.world.destroyBody(b); b.setUserData(null); } } } }); }
2
public List<Integer> getSecondaryGroups(Connection con, String user) { List<Integer> groups = new ArrayList<>(); /* Compose query. */ String SQL_QUERY = "SELECT secondary_group_ids " + "FROM xf_user " + "WHERE username=?;"; /* Execute query. */ try { PreparedStatement stmt = con.prepareStatement(S...
4
@SuppressWarnings("unused") private static void testAllClasses(Hashtable<String, TestCase> tests) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, URISyntaxException { Class<SaraQuestion>[] clazzez = TestRig.<SaraQuestion>getClasses("teach.solve_these"); ...
2
public void run() { try { ois = new ObjectInputStream(skt.getInputStream()); pkt = (Packet)ois.readObject(); //Casts packet if(pkt instanceof ChatPacket) { // If its a chatpacket - new connections username = ((ChatPacket)pkt).get_message(); // Get username } server.writeServerMessage("Client Connec...
4
public static void main(String[] args) { for (int a=1; a<=100;a++){ System.out.println("Jamil Anowari" + a); } }
1
private void calculate(){ int total = 0; for(int count = 0; count < neighborstate.length; count++){ if(count == 4){} else{total += neighborstate[count];} if(total > 1024){total = 1024;} if(total < -1024){total = -1024;} } state = total; }
4
@Override public Float get(int index) { switch(index) { case 0: return x; case 1: return y; case 2: return z; case 3: return w; default: throw new IndexOutOfBoundsException(); } }
4
public boolean exist1(char[][] board, String word) { if (board == null || board.length == 0) { return false; } if (word == null || word.length() == 0) { return true; } boolean[][] visited = new boolean[board.length][board[0].length]; for (int i =...
8
public void printpaint() { int[] is = new int[8001]; int last = -1; for( int i = 0;i < lptr.size();i++) { Pointer p = lptr.get(i); if( p.r == 0 ) continue; if ( p.color == -1 ) { last = -1; continue;} if ( last != p.color ) { is[p.color]++; last = p.color; } ...
6
@Override public void handleEmptyEventQueue() { // TODO Auto-generated method stub super.handleEmptyEventQueue(); if (exec1xTraffic) { TrafficExportImport.changeReabilityModel(); TrafficExportImport.readEvents("./Traffic/" + id_execution + "_traffic_"+ Tools.getNodeList().size() + ".txt"); //Tr...
2
public static int minPress(String start, String end, String[] forbids) { String ff[][] = new String[forbids.length][]; for (int i = 0; i < forbids.length; i++) { ff[i] = forbids[i].split(" "); } // int a1 = w2i("aaaa"); // int a2 = w2i("zzzz"); // System.out.println("aaaa="+a1+ " =>"+ i2w(a1...
9
public static void turnNegationsIntoNegativeMultplication(LinkedList<Token> list) throws MalformedParenthesisException, MalformedDecimalException, InvalidOperandException, MalformedTokenException { //TODO: Add parenthesis around expressions that we modify //Create a parenthetical expression out of these token...
6
public boolean isSizeChange() { return ((toSize != null )||(fromSize!=null))&&(toSize!=fromSize); }
2
@Override public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException { timer -= delta; Input input = container.getInput(); TowerGame tg = (TowerGame) game; if (input.isKeyPressed(Input.KEY_SPACE) || input.isKeyPressed(Input.KEY_ENTER) || timer <= 0) { tg.ente...
3
public void execute(Object target, String fieldname, boolean refresh) { if (target != null && fieldname != null) { try { Method getter = target.getClass().getMethod( "is" + fieldname); Method setter = target.getClass().getMethod( "set" + fieldname, new Class[] { boolean.class });...
7
public CustomFrame(String title) throws HeadlessException { super(title); }
0
public void readFromFileINET(String fileName) { try { Scanner scanner = new Scanner(new File(fileName)); int nodeCount = scanner.nextInt(); scanner.nextInt();//skip edge count for (int i = 0; i < nodeCount; i++) { ASNode node = new ASNode(i); ...
8
private String[] deleteEmptyElements(String[] array) { ArrayList<String> dynamicArrayNoEmptyElements = new ArrayList<>(); for (String str : array) { if (!str.isEmpty()) dynamicArrayNoEmptyElements.add(str); } String[] arrayNoEmptyElements = new Str...
2
@Override public void sendFileToBuyer(String buyer, String serviceName, String seller) { loggerNetwork.info("send file to buyer"); long length; int offset, numRead; byte[] fileBytes; String filename = serviceName; File verifyFile = new File(filename); InputStream serviceFile = null; try { ...
6
public void setCustomFieldField(String nodeName, String content) { if (nodeName.equals("name")) setName(content); if (nodeName.equals("type")) setType(content); if (nodeName.equals("value")) setValue(content); if (nodeName.equals("shortname")) setShortname(content); }
4
public PetriNet(List<IBlock> blockList) { System.out.println("Creating Analog Computer Petri Net:"); blocks = blockList; // // Number of transitions is the number of blocks: // numTransitions = blocks.size(); System.out.println("Number of transitions: " + numTransitions); // // Count number of...
7
public void mouseClicked(MouseEvent e) { }
0
private void parseArguementsAndSetCountJob(String[] args, Job countJob, Job genJob) throws Exception { for (int i = 0; i < args.length; ++i) { if (args[i].equals("-input")) { FileInputFormat.addInputPaths(countJob, args[++i]); FileInputFormat.addInputPaths(genJob, args[i]); } else if (args[i].equals("-c...
7
private void addReplaceFile(COMMAND cmd, boolean isLastMessage, String filename, int dataLength, byte[][] data) { try { File file = null; // Open the file to write if(cmd.equals(COMMAND.A)) { String fileOutputLocation = Server.SERVERDIRECTORIES[0].concat("/" + filename); file = new File(fileOutpu...
9
public void makeMove(Player p){ rollDie(); startTargets(p.currentIndex, die); if(p instanceof ComputerPlayer){ humansTurn = false; ArrayList<BoardCell> roomList = new ArrayList<BoardCell>(); ArrayList<BoardCell> list = new ArrayList<BoardCell>(); boolean hasRoom = false; for(BoardCell cell : ...
6
public static int evalRPN(String[] tokens) { int sLen = tokens.length; int token[] = new int[sLen]; int l=0; for (int i=0; i<sLen; i++) { if (tokens[i].length() > 1) { token[l] = Integer.parseInt(tokens[i]); l++; } else { char ch = tokens[i].charAt(0); if (('0'<=ch) && (ch <=...
8
private static String getWebSiteViaProxy(){ // TODO Auto-generated method stub String proxyIp = "intpxy1.hk.hsbc"; int proxyPort = 8080; HttpHost target = new HttpHost("itunes.apple.com", 80, "http"); HttpHost proxy = new HttpHost(proxyIp, proxyPort); CredentialsProvider credsProvider = new B...
5
public int macdFixLookback( int optInSignalPeriod ) { if( (int)optInSignalPeriod == ( Integer.MIN_VALUE ) ) optInSignalPeriod = 9; else if( ((int)optInSignalPeriod < 1) || ((int)optInSignalPeriod > 100000) ) return -1; return emaLookback ( 26 ) + emaLookback ( optInSignal...
3
private Map invert(Map map) { Set entries = map.entrySet(); Iterator it = entries.iterator(); Map inverse = null; try { inverse = (Map) map.getClass().newInstance(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); inverse.put(entry.getValue(), entry.getKey()); } } catch (Throw...
2
public Entity(int x, int y) { this.x = x; this.y = y; }
0
public void quickSort(int[] array, int left, int right){ int p = (left + right)/2; int pivot = array[p]; int i = left; int j = right; while(i < j){ while(i < p && pivot >= array[i]){ ++i; } if(i < p){ array[p] = array[i]; p = i; } while(j > p && pivot <= array[j]){ --j; } ...
9
private static void snake(int аrray[][]) { int step = 1; int row = (аrray.length / 2); int col = row; System.out.println("Обход по с пирали, начиная с центра :"); while (step < аrray.length) { for (int i = col; i > (col - step); i--) { System.out.print...
7
@Override public void deserialize(Buffer buf) { setId = buf.readShort(); if (setId < 0) throw new RuntimeException("Forbidden value on setId = " + setId + ", it doesn't respect the following condition : setId < 0"); int limit = buf.readUShort(); setObjects = new short[lim...
3
public ContinueBlock(LoopBlock continuesBlock, boolean needsLabel) { this.continuesBlock = continuesBlock; if (needsLabel) continueLabel = continuesBlock.getLabel(); else continueLabel = null; }
1
public Placeable loadContainer(int x, ArrayList<Drop> drops) { int mapY = 0; Placeable placeable = null; mapY = findFloor(x); placeable = new ItemContainer(this, registry, "Placeables/Placed/ItemContainer", "Placeables/Placed/ItemContainer", x, mapY, Placeable.State.Placed, drops); ...
3
public void render(FadingSpriteBatch sb){ int marginL = cornerTL.getRegionWidth(), marginD = cornerBL.getRegionHeight(); int d = innerWidth * (side - 1)/2, o = 10; // float z = main.getCam().zoom / Camera.ZOOM_NORMAL; float x = 2*(float) Math.cos(lifetime); float y = 2*(float) Math.sin(lifetime); Vector2 v =...
4
private void fillConceptList(Student student, JList<String> list) { bookingService = BookingService.getInstance(); DefaultListModel<String> dlm = new DefaultListModel<String>(); list.setModel(dlm); dlm.removeAllElements(); Set<Activity> activities = student.getActivities(); for (Activity a : activities) { ...
3
public synchronized ORB getInstance(String initialHost, int initialPort) { if (orb_ == null) { Properties props = new Properties(); props.put("com.sun.CORBA.POA.ORBPersistentServerPort", Integer.toString(initialPort)); props.put("com.sun.CORBA.POA.ORBPersi...
1
@Override public void shutdown() { if (shutdown) return; super.shutdown(); final Queue<Task<?>> queue = this.queue; while (true) { final Task<?> task = queue.poll(); if (task != null) { task.cancel(false); } else { break; } } for (final Thread thread : threads) { thread.interrupt...
6
private void drawParticleFeeders(Graphics2D g) { List<ParticleFeeder> particleFeeders = model.getParticleFeeders(); if (particleFeeders.isEmpty()) return; Stroke oldStroke = g.getStroke(); Color oldColor = g.getColor(); Symbol.ParticleFeederIcon s = new Symbol.ParticleFeederIcon(Color.GRAY, Color.WHITE, fa...
7
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 1; i <= size / 3; i++) { sb.append(array[size / 3 - i] != null && size / 3 - i < stacks.get(StackIndex.FIRST).curr ? array[size / 3 - i] : ".") .append('\t') .append(array[2 * size / 3 - i] != null &&...
7
@Override protected void validateConstructor(List<Throwable> errors) { // Get the constructor Constructor<?>[] constructors = this.getTestClass().getJavaClass() .getDeclaredConstructors(); if (constructors.length == 0) { return; } // Search for a valid one for (Constructor<?> c : constructors) { ...
7
public void mousePressed(MouseEvent event) { if (getDrawer().getAutomaton().getEnvironmentFrame() !=null) ((AutomatonEnvironment)getDrawer().getAutomaton().getEnvironmentFrame().getEnvironment()).saveStatus(); state = getAutomaton().createState(event.getPoint()); getView().repaint(); }
1
private static String nextImmediateLine(RandomAccessFile r) throws IOException { String l; while ((l = r.readLine()) != null && l.startsWith("//")) { //Reading file done in loop condition! } return l; }
2
public int getSelectedIndex() { for(int i=0;i<markers;i++) { if(marker[i].isSelected()) { return i; } } return -1; }
2
private final void method3214(int i, ByteBuffer class348_sub49, int i_6_) { if (i_6_ == 60) { if (i != 1) { if ((i ^ 0xffffffff) == -3) { int i_7_ = class348_sub49.getUByte(); ((Class348_Sub42_Sub10) this).anIntArray9566 = new int[i_7_]; for (int i_8_ = 0; (i_7_ ^ 0xffffffff) < (i...
9
private ArrayList<String> compareOutput(String actOut, String expOut, String otherChannelOut, String channnelId, String otherChannelId) { ArrayList<String> extractedVariables = new ArrayList<String>(); if (expOut.equals("-")) { if (actOut.length() < 1) { fail(); print("expected some output on " + chan...
9
protected void paintComponent(Graphics g) { // Let UI delegate paint first // (including background filling, if I'm opaque) super.paintComponent(g); g.drawRect(0,0, getWidth() - 1, getHeight() - 1); g.setColor(Color.gray); g.drawLine(colWidth,padding, colWidth, statusTextHeight - padd...
7
@Override public void actionPerformed(ActionEvent e) { while(true) { new Thread(new Runnable() { @Override public void run() { while(true) { new Thread(new Runnable() { @Override ...
3
public boolean process(DatagramPacket datagram) { //Let the mailbox know if this session is ending boolean discard = false; try { Scanner in = new Scanner(new DataInputStream (new ByteArrayInputStream(datagram.getData(), 0, datagram.getLength()))); String input = in.nextLine(); String[] tokens ...
5
public void act() { if (state.getState().equals("idle")) { if(dying()) { Main.simulation.removeMapItem(this); Main.taxiService.removeTaxi(this); } } if (state.getState().equals("Collecting Person")) { if(! person.inTaxi()) { setLocation(route.nextPoint(speed/2));...
8
public static boolean isUnicode( String s ) { byte[] strbytes = null; try { strbytes = s.getBytes( "UnicodeLittleUnmarked" ); } catch( UnsupportedEncodingException e ) { ; } for( int i = 0; i < strbytes.length; i++ ) { if( strbytes[i] >= 0x7f ) { return true; // deal with non-compres...
4
private void anadirCliente(){ boolean especialNew = false; if(especialN.isSelected()){ especialNew = true; } Cliente clienteN = new Cliente(nombreN.getText(), apellidosN.getText(), apodoN.getText(),especialNew); System.out.println(especialNew); GestionarClient...
1
public static boolean checkRunMode(String testCase){ //for the excel file to read for(int i=2; i<=datatable.getRowCount("Test Cases"); i++){ if(datatable.getCellData("Test Cases", "TCID", i).equalsIgnoreCase(testCase)){ if(datatable.getCellData("Test Cases", "Runmode", i).equalsIgnoreCase("Y")){ ...
3
public static void main(String[] ops) { int n = Integer.parseInt(ops[0]); if(n<=0) n=10; long seed = Long.parseLong(ops[1]); if(seed <= 0) seed = 45; RandomVariates var = new RandomVariates(seed); double varb[] = new double[n]; try { System.out.println("Generate "+n+" val...
8
public void run() { while (true) { for (int i = 1; i <= 100000; i++) { d += (Math.E+ Math.PI)/i; if (i % 1000 == 0) Thread.yield(); } if(countDown-- <=0 ) break; println(this.id +":" + this.countDown + ":...
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Feature other = (Feature) obj; if (description == null) { if (other.description != null) return false; } else if (!description.equa...
7
public final void visitInnerClass( final String name, final String outerName, final String innerName, final int access) { StringBuffer sb = new StringBuffer(); appendAccess(access | ACCESS_INNER, sb); AttributesImpl att = new AttributesImpl(); att.add...
3
@Override public String getEndNode() { int size = connections.size(); if (size > 0) { return connections.get(size-1).getEndNode(); } return null; }
1
private int getFrame() { if (!movingX && !movingY) return 0; if (xIndex < 2) return xIndex; if (xIndex == 2) return 0; if (xIndex == 3) return 2; return 0; }
5
private String calc(String input) { //Person 1 put your implementation here String n = ""; for(int i = 0; i < input.length(); i++){ char temp = input.charAt(i); temp++; n = n + temp; } return n; }
1
public boolean isCuboid(HashMap<Integer, Double> solutionFitness) { for(int i = 1; i < 11; i++){ if(i * i * i == solutionFitness.size()){ return true; } } return false; }
2
@EventHandler(priority = EventPriority.LOWEST) public void onChunkLoad(ChunkLoadEvent e) { if (!Settings.amrs) { return; } if (Settings.world || WorldSettings.worlds.contains(e.getWorld().getName())) { // Iterate through the entities in the chunk for (Entity en : e.getChunk().getEntities()) { fi...
7
public void putSeed(long x) { /* --------------------------------------------------------------- * Use this function to set the state of the current random number * generator stream according to the following conventions: * if x > 0 then x is the state (unless too large) * if x < 0 then the state is obtained ...
8
public List<Branch> getBranchesSummary() { List<Branch> list = new ArrayList<>(); Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConnectio...
5
synchronized void writeAll(String str) { //ʹ׽Ϣ PrintWriter write=null; Socket socket; for(int i=0;i<size();i++) { socket=(Socket)get(i); // ȡ׽ try { write=new PrintWriter(socket.getOutputStream(),true); // if(write != null) write.println(str); //ͨϢ }catch(Exception e){ e.printStackTrace...
3
private void ingresar() { // Según el permiso de usuario, podrá acceder al sector correspondiente switch (permiso) { case 0: // Usuario Administrador Menu menu = new Menu(conexion, id_personal, this); menu.setVisible(true); brea...
8
@Override public void actionPerformed(ActionEvent arg0) { JButton source = (JButton) arg0.getSource(); if (source == deleteGame) { int games_num = list.getSelectedValuesList().size(); if (games_num > 0 && showDialog("You are going to remove " + games_num + " games from SIB. Are you sure about that?")) ...
9
public static int determinApproporiateDepth(MorrisBoard bd) { int depth = SEARCH_DEP_LIMIT_DEFAULT; int numEmpty = bd.countEmpty(); if ((numEmpty >= HIGH_BOTTOM) && (numEmpty <= HIGH_TOP)) { depth = depthForHigh(numEmpty); } else if ((numEmpty >= MED_BOTTOM) && (numEmpty <= MED_TOP)) { depth = depthF...
6
private static int indexOfName(String name, ArrayList list) { for (int i = 0, limit = list.size(); i < limit; i++) { if (name.equals(list.get(i).toString())) { return i; } } return -1; }
2
public IllegalOrphanException(List<String> messages) { super((messages != null && messages.size() > 0 ? messages.get(0) : null)); if (messages == null) { this.messages = new ArrayList<String>(); } else { this.messages = messages; } }
3
public static void main(String[] args) { String uri = "hdfs://localhost:9000/HFCube/cubeElement/baseCube/1"; Configuration conf = new Configuration(); FileSystem fs = null; try { fs = FileSystem.get(URI.create(uri), conf); } catch (IOException e) { e.print...
5
public double standardizedItemRange(int index){ if(!this.dataPreprocessed)this.preprocessData(); if(index<1 || index>this.nItems)throw new IllegalArgumentException("The item index, " + index + ", must lie between 1 and the number of items," + this.nItems + ", inclusive"); if(!this.variancesCalcu...
4
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int size = Integer.parseInt(line.trim()); int[] ma...
6
private static boolean insertValuesInEdge(int idStartNode, int idEndNode, float etx, float rate, float mtm, float ett) { Node startNode = Tools.getNodeByID(idStartNode); Node endNode = Tools.getNodeByID(idEndNode); if(!startNode.outgoingConnections.contains(startNode, endNode)) return false; Iter...
3
private void limitVelocity() { assert(velocities != null); for(int i = 0; i < velocities.length; i++){ for(int k = 0; k < velocities[i].length; k++){ if(velocities[i][k] < 0 - maxVelocity[i]){ velocities[i][k] = 0 - maxVelocity[i]; }else if(velocities[i][k] > maxVelocity[i]){ velocities[i][k] =...
4
public List<EventComment> findAllEventCommentsByHallEventId(final Long hallEventId) { return new ArrayList<EventComment>(); }
0
public static void main(String argv[]) { int n = new Integer(argv[0]).intValue(); DESRandom prng = new DESRandom(); for (int i = 0; i < n; i++) System.out.println(Long.toString(prng.nextLong(), 16)); }
1
public static void main(String[] args) { java.util.ArrayList list = new java.util.ArrayList(); }
0
public String toString() { return "Session info \nUser: " + username + "\nDate: " + date + "\nPassword: " + password; }
0
public static void main(String[] args) throws Exception{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(in.readLine().trim()); for (int i = 0; i < t; i++) { int n = Integer.parseInt(in.readLine().trim()); int casos = Integer.parseInt(in.readLine().trim(...
9
private void doWork() { System.out.println("NewsWorker start to work!"); long start = System.currentTimeMillis(); try { NewsDao.instance().writeToIniFile(); long end = System.currentTimeMillis(); long period = end - start; System.out.println("NewsWorker cost time in millis : " + period); if (perio...
3
@Test public void testIterator() throws Exception { // first, populate the aggregator via sum over scan1 scan1.open(); StringAggregator agg = new StringAggregator(0, Type.INT_TYPE, 1, Aggregator.Op.COUNT); try { while (true) agg.mergeTupleIntoGroup(scan1.next()); } catch (NoSuchElement...
7
public COP_Instance fixItUp(){ if (debug>=3) { String dmethod = Thread.currentThread().getStackTrace()[2].getMethodName(); String dclass = Thread.currentThread().getStackTrace()[2].getClassName(); System.out.println("---------------------------------------"); ...
7
public Object nextContent() throws JSONException { char c; StringBuilder sb; do { c = next(); } while (Character.isWhitespace(c)); if (c == 0) { return null; } if (c == '<') { return XML.LT; } sb = new St...
7
void await() throws InterruptedException { synchronized (lock) { while (count > 0) { lock.wait(); } } }
1
public CtField lookupFieldByJvmName2(String jvmClassName, Symbol fieldSym, ASTree expr) throws NoFieldException { String field = fieldSym.get(); CtClass cc = null; try { cc = lookupClass(jvmToJavaName(jvmClassName), true); } ...
2
static void layoutComponent(Component component) { synchronized (component.getTreeLock()) { component.doLayout(); if (component instanceof Container) { for (Component child : ((Container)component).getComponents()) { layoutComponent(child); ...
2
public static String escape(String string) { char c; String s = string.trim(); StringBuffer sb = new StringBuffer(); int len = s.length(); for (int i = 0; i < len; i += 1) { c = s.charAt(i); if (c < ' ' || c == '+' || c == '%' || c =...
6
public static User findOne(String field, String value) throws SQLException { ResultSet result = Data._find(User.class.getSimpleName(), field, value); if(result.next()) { return User.createOneFromResultSet(result); } else { return null; } }
1
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TipoEndereco other = (TipoEndereco) obj; if (this.idTipoEndereco != other.idTipoEndereco && (this.idTipoE...
5
public void Receive() throws ClassNotFoundException, IOException { System.out.println("Entered Recieve"); if (input.hasNext()) { System.out.println("Input got more to recieve"); String message = input.nextLine(); System.out.println("Message: " + message); String option = message.substring(0, 3); ...
4
@EventHandler public void itemClick( InventoryClickEvent e ){ if( e.getCurrentItem() != null ){ if (String.valueOf(e.getCurrentItem().getItemMeta().getLore()).contains("Smeltery I")) { if( e.getInventory().getType() == InventoryType.ANVIL ){ e.setCancelled(tru...
3
public String proposeFilename(String filename, Serializable structure) { if (!filename.endsWith(SUFFIX)) return filename + SUFFIX; return filename; }
1
@EventHandler public void PigZombieFireResistance(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.getPigZombieConfig().getDouble("P...
6
@Override public String[] listAll() throws IOException { Set<String> files = new HashSet<>(); // LUCENE-3380: either or both of our dirs could be FSDirs, // but if one underlying delegate is an FSDir and mkdirs() has not // yet been called, because so far everything is written to the other, // in ...
8
public ExportFileMenuItem(FileProtocol protocol) { setProtocol(protocol); addActionListener(this); }
0
public static char[][] shift_square(char[][] square,int start,int shift_pos,boolean row) { int total_row=square.length; int total_col=square[0].length; char[][] result=new char[total_row][total_col]; for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { result[i][j]=square[i][j]; } } if(row) { ...
5