text
stringlengths
14
410k
label
int32
0
9
public void loadDictionary(File dictionary) throws Exception { try { BufferedReader is = null; try { is = new BufferedReader (new FileReader(dictionary)); String line = null; while ((line = is.readLine()) != null) { this.attach(line); } } finally { is.close(); } } catch (FileNot...
3
@Override public int compare(Set lhs, Set rhs) { Iterator<State> li = lhs.iterator(); Iterator<State> ri = rhs.iterator(); while (li.hasNext() && ri.hasNext()) { int res = li.next().compareTo(ri.next()); if (res != 0) return res; } if (li.hasNext()) return 1; if (ri.hasNext()) r...
5
public void update(int dt) { double[] jerk = getRandUnitVector(); ax = jerk[0]*force; ay = jerk[1]*force; ArrayList<int[]> gs = ScreenSaver.getCentersOfGravity(); double grav = ScreenSaver.getGravity(); for(int[] g : gs) if(g[0] >= 0) { double[] r = new double[]{g[0]-centerx, g[1]-centery}...
7
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { /*Informs the SMS API that the request has been received*/ resp.setStatus(HttpServletResponse.SC_OK); String number=req.getParameter("msisdn").toString(); try{ String request=req.getParameter("text").toString(); ...
8
public final void method44(int i, AbstractToolkit var_ha) { anInt10092++; Object object = null; r var_r; if (aR10094 == null && aBoolean10064) { Class2 class2 = method2481(true, 262144, -4, var_ha); var_r = class2 == null ? null : ((Class2) class2).aR118; } else { var_r = aR10094; aR10094 = nul...
5
public void exec(){ try { ArrayList<String> erg = util.networkCommand("free"); MemTotal = Double.parseDouble(erg.get(1).split("\\s+ ")[1]) / 1024; MemUsed = Double.parseDouble(erg.get(1).split("\\s+ ")[2]) / 1024; SwapTotal = Double.parseDouble(erg.get(3).split("\\s+ ")[1]) / 1024; SwapUsed = Doubl...
2
protected void func_48458_a(int par1, int par2, Chunk par3Chunk) { Profiler.endStartSection("tickChunk"); par3Chunk.updateSkylight(); Profiler.endStartSection("moodSound"); if (this.ambientTickCountdown == 0) { this.updateLCG = this.updateLCG * 3 + 1013904223; ...
6
public Object getObjectInstance( Object object, Name name, Context context, Hashtable< ?, ? > enviroment ) throws Exception { if ( object instanceof Reference ) { Reference reference = ( Reference ) object; if ( reference.getClass( ).equals( WarehouseConfig.class ) ) { RefAddr maxItemAmountR...
5
public int[] predict(MaltFeatureNode[] x) { final double[] dec_values = new double[nr_class]; final int[] predictionList = Util.copyOf(labels, nr_class); final int n = (bias >= 0)?nr_feature + 1:nr_feature; // final int nr_w = (nr_class == 2 && solverType != SolverType.MCSVM_CS)?1:nr_class; ...
8
@Before public void Init() { board = new Board(numberOfPawns, xSize, ySize, xBonusSquare, yBonusSquare); }
0
public LocalInfo findLocal(String name) { for (int i = 0; i < count; i++) if (locals[i].getName().equals(name)) return locals[i]; return null; }
2
public Client getClient() { return this.client; }
0
public void setPouvoirsDispo(List<Class<? extends Pouvoir>> pouvoirsDispo) { this.pouvoirsDispo = pouvoirsDispo; }
1
public static ResponseDTO execute(RequestDTO reqObj) throws BookingTicketException { log.debug("Start: execute()"); PassengerDAO passengerDAO = new PassengerDAO(ENTITY_MANAGER_FACTORY); StationInRouteDAO sirDAO = new StationInRouteDAO(ENTITY_MANAGER_FACTORY); StationDAO stationDAO = new...
8
public static Properties neuesspiel() throws IOException{ Properties neuesspiel = loadProperties("neuesspiel.txt"); if(neuesspielbutton == true) { Properties spielstand = loadProperties("spielstand.txt"); spielername1 = spielstand.getProperty("spielername1", "Nicht vorhanden"); spielername2 = s...
2
public int getAge() { return age; }
0
public String readLine() throws IOException { StringBuffer line = new StringBuffer(); char ch = read(); try { while (ch != '\n' && ch != '\r') { if (hasComments) { if (ch == lineComment) { skipComments(ch); ...
8
public Camera(GameWorld gameWorld, Ticker ticker, FrameBuffer buffer) { this.gameWorld = gameWorld; this.ticker = ticker; this.cam = gameWorld.getWorld().getCamera(); mouseListener = new MouseListener(buffer); if(!fixedOrientation) mouseListener.hide(); ...
1
public PBKDF2ParameterType createPBKDF2ParameterType() { return new PBKDF2ParameterType(); }
0
private void LoadFriendRequests() throws SQLException { Grizzly.GrabDatabase().SetQuery("SELECT * FROM server_friendships_pending WHERE reciever_id = '" + this.ID + "'"); if (Grizzly.GrabDatabase().RowCount() > 0) { ResultSet Pending = Grizzly.GrabDatabase().GrabTable(); while(Pending.next()) { ...
2
@Test public void testSave() throws Exception { User user = new User(); user.setLoginno("12345"); user.setLoginpwd("45678"); user = repository.save(user); repository.delete(user.getId()); }
0
public String gravarUSuario (String nome, String senha, String email, String login) { String resposta = ""; System.out.println("Iniciando inserçao de usuario"); if(!nome.equals(null) || !senha.equals(null) || email.equals(null) || login.equals(null)){ Usuario usuario = new Usuario (); if (sen...
6
public void add(Word wordObject){ Node newNode = new Node(); newNode.data = wordObject; newNode.left = null; newNode.right = null; if (root == null) {root = newNode;}else {root.addNode(newNode);} fixAfterAdd(newNode); }
1
public boolean remove(int userId) { Contact contact = userIdMap.get(userId); if (contact == null) return false; userIdMap.remove(userId); if (contact.displayName != null) displayNameMap.get(contact.displayName).remove(contact); if (contact.firstName != null) firstNameMap.get(contact.first...
6
public int getHeadNode(int id){ conn = new SQLconnect().getConnection(); int headnodeId = 0; try { String sql = "select * from worlds where display = 'true' and id ="+id; Statement st = (Statement) conn.createStatement(); // 创建用于执行静态sql语句的Statement对象 ResultSet rs = st.executeQuery(sql); // 执行查询操作的s...
2
@Column(name = "PRP_MOA_TIPO") @Id public String getPrpMoaTipo() { return prpMoaTipo; }
0
public void paintThumb(Graphics g) { Icon icon = null; if (slider.getOrientation() == JSlider.HORIZONTAL) { if (isRollover && slider.isEnabled()) { icon = getThumbHorIconRollover(); } else { icon = getThumbHorIcon(); } } else { ...
6
public static void main(String[] args) { System.out.println("Введіть к-сть чисел -->"); Scanner in = new Scanner (System.in); int count = in.nextInt(); int max = 0, min = 0, var = 0; for (int i=0; i < count; i++ ) { System.out.println("Введіть число"); var=in.nextInt(); if (var > min) {max=var; min=var;...
2
private void PrintCurrentRoomContainers() { Iterator<String> iter = currentRoom.GetContainers().iterator(); while (iter.hasNext()) { System.out.print(iter.next()); if (iter.hasNext()) { System.out.print(", "); } } // Set up to print the creatures if (! currentRoom.GetCreatures().isEmpty()) { i...
5
ImagePanel(String name, final JFrame f) { this.add(new JLabel(name)); try { img = ImageIO.read(new File(name)); this.setPreferredSize(new Dimension( img.getWidth(), img.getHeight())); } catch (FileNotF...
7
public void target() { GameActor t = getTargetedActor(); if(t != null) { PhysicsComponent tPC = (PhysicsComponent)t.getComponent("PhysicsComponent"); if(tPC != null) { PhysicsComponent ownPC = (PhysicsComponent)getOwningActor().getComponent("PhysicsComponent"); ...
9
public void render() { int i, j, k; for (j = 0; j < MAPHEIGHT; ++j) for (i = 0; i < MAPWIDTH; ++i) if (MainFrame[i][j] == true) { // render only the frames that are within the radius of the MainFrame // all other frames remain un-drawn FrameMatrix[i][j].draw(xRef + (i * SCREENWIDTH), yR...
6
public Object saveOps() { Stack state = new Stack(); int pos = currentLine.length(); while (currentBP.parentBP != null) { state.push(new Integer(currentBP.breakPenalty)); /* We don't want parentheses or unconventional line breaking */ currentBP.options = DONT_BREAK; currentBP.endPos = pos; currentB...
1
public static List<String> genPar(int l, int r){ ArrayList<String> result = new ArrayList<String>(); if(l == 0){ StringBuilder sb = new StringBuilder(); for(int i = 0; i < r; i++) sb.append(")"); result.add(sb.toString()); return result; } if(l >= 1){ for(String val : genPar(l-1, r)) r...
6
public static Set<Long> findNewFriend(TwitterBrain brain, Twitter twi, int count) { int total = count; ArrayList<Long> located = new ArrayList<Long>(); try { brain.updateFollowers(); for (Long id : brain.getFollowers()) { IDs ids = twi.getFollo...
7
final void method3396(int i, int i_96_) { if (i_96_ > -5) aClass223_7175 = null; anInt7146++; if ((i & ~0x7f) != 0) { if ((i & ~0x3fff ^ 0xffffffff) != -1) { if ((~0x1fffff & i ^ 0xffffffff) != -1) { if ((i & ~0xfffffff) != 0) putByte(0x80 | i >>> 1028243868); putByte(0x80 | i >>> 955016...
5
private boolean generateAndSearchXDLRC(){ BufferedReader input; String[] tokens; String line; try { for(String part : partNames){ if(!new File(part+".xdlrc").exists()){ xdlrcFileNames.add(part+".xdlrc"); if(!RunXilinxTools.generateBriefXDLRCFile(part,part+".xdlrc")){ return false; } ...
9
public LongSet parseString(String txt) { intArray=new int[0]; longArray=new long[0]; txt=txt.trim(); if(txt.length()==0) return null; if((!txt.startsWith("{"))&&(!txt.endsWith("}"))) return null; final int x=txt.indexOf("},{"); if(x<0) return null; if(x>1) { final String[] strs=txt.substr...
8
@Override public Query parse() { if(!this.prepared) { this.prepared = true; StringBuilder sB = new StringBuilder(); sB.append("UPDATE "); sB.append(table.replace("#__", this.db.getPrefix())); sB.append("\n"); sB.append(" SET "); int s = this.set.size(); for(int i = 0; i < s; ++i) { ...
7
@Command(name = "help") public void helpCommand(CommandSender sender, CommandArgs args) { if (args.size() > 0) { String commandName = args.getString(0); SubCommand command = getCommand(commandName); if (command != null) { sender.sen...
5
public void stworzPolaGry(String _nazwaPola, boolean _czyRysowacSymbole, boolean _czyPrzerysowac, JLabel[][] _pola, int _szerPojPola, int _wysPojPola, int _skok, JPanel _obszarPol, JPanel _obszarLiter, JPanel _obszarCyfr, int _szer, int _wys) { JLabel lb_litery[] = new JLabel[10]; JLabel lb_cyfry[] = new JLabel[10...
7
public List<Property<?>> getProperty(String name){ List<Property<?>> ret = new ArrayList<Property<?>>(); if(name == null){ return ret; } for(Property<?> property : properties){ if(name.equals(property.getName())){ ret.add(property); } } return ret; }
7
@EventHandler public void onPotionSplashEvent(PotionSplashEvent e ) { for (Entity entity : e.getAffectedEntities()) { if (entity instanceof Player) { Player p = (Player) entity; if (!UVampires.vampires.containsKey(p)) return; if (UVampires.vampires.get(p)) { if (e.getPotion().getEffects().equals(...
8
public int doCCIR493_160FFT (CircularDataBuffer circBuf,WaveData waveData,int start) { // Get the data from the circular buffer double samData[]=circBuf.extractDataDouble(start,80); int a; double datar[]=new double[FFT_160_SIZE]; for (a=0;a<datar.length;a++) { if ((a>=60)&&(a<120)) datar[a]=samData[a-60]; ...
3
public Object get(String key) { return key == null ? null : mMap.get(key); }
1
private boolean isScrambleCore(String s1, String s2) { boolean result = false; List<String> key = new ArrayList<String>(); key.add( s1 ); key.add( s2 ); if( cache.containsKey( key ) ) return cache.get( key ); if( s1.equals(s2) ) { cache.put( key, true ); ...
8
private void run() { isRunning = true; int frames = 0; long frameCounter = 0; game.init(); double lastTime = TimeHelper.getTime(); double unprocessedTime = 0; while ( isRunning ) { if ( Display.wasResized() ) { reshape( Display.getWidth(), Display.getHeight() ); } boolean render = f...
7
public static Hashtable<Integer, Double> GrowthSort(int start, int range, int averageCount) { Random rnd = new Random(); Hashtable<Integer, Double> NTable = new Hashtable<Integer, Double>(); //Go through the range for (int n = start; n < range+1; n+=50000) { int warm = 0; while (warm < 100...
5
public void removeAllNonCreativeModeEntities() { for(int var1 = 0; var1 < this.width; ++var1) { for(int var2 = 0; var2 < this.depth; ++var2) { for(int var3 = 0; var3 < this.height; ++var3) { List var4 = this.entityGrid[(var3 * this.depth + var2) * this.width + var1]; ...
5
@Override public void receiveProtocol(AsynchronousConnection asynchronousConnection) throws IOException { while (asynchronousConnection.getReader().getBuffer().hasRemaining()) { if (getOpcode() == -1) { setOpcode(asynchronousConnection.getReader().getBuffer().get() - asynchronousConnection.getSecureRead().get...
5
@Override Integer redactEntity(Criteria criteria, AbstractDao dao) throws DaoException { Integer idHotel = (Integer) criteria.getParam(DAO_ID_HOTEL); if (idHotel != null) { return updateHotel(criteria, dao); } else { return createHotel(criteria, dao); } }
1
public void updatePosition() { if (xPos < xDestination) xPos++; else if (xPos > xDestination) xPos--; if (yPos < yDestination) yPos++; else if (yPos > yDestination) yPos--; if (xPos == xDestination && yPos == yDestination) { if (command==Command.GoToSeat) agent.msgAnimationFinishedGoToSeat();...
9
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,null,this,verbal...
7
public void moveSideways(int move) { int unit; boolean left; if(move >= 0) { unit = 1; left = false; } else { unit = -1; left = true; } if(!currentCreatedAndMo...
8
public void entrenar(String[][] entradas){ boolean finalizado = false; int y = 0; double error = 0, errorCuadraticoMedio = 0, valorActivacion = 0; this.numeroEpocasFinal = 0; this.errores.clear(); while(!finalizado){ for(int n = 0; n < entradas.length; n++){ System.out.prin...
4
@SuppressWarnings("unchecked") public List<String> asStringArray(RuleContext ruleContext) { if (ruleContext.getEvents().isDebugEnabled()) { ruleContext.getEvents().debug(" " + TYPE + ".asStringArray: input model path=" + mPath); } Element collection = (Element) ruleContext.getInputModel().se...
6
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { String funcion = request.getParameter("funcion"); ...
8
@Override public int compareTo(PlageHoraire t) { if(this.heureFin.before(t.getHeureDebut()) || this.heureFin.equals(t.getHeureDebut())) { return -1; } else if(this.heureDebut.after(t.getHeureFin()) || this.heureDebut.equals(t.getHeureFin())) { return 1; } ...
4
@Override public String getColumnName(int column) { switch (column) { case 0: return "Код группы"; case 1: return "Номер группы"; case 2: return "Год поступления"; case 3: return "Код факультета";...
5
public ImagePanel() { try { image = ImageIO.read(new File("src/snake.bmp")); // for IDE //image = ImageIO.read(this.getClass().getResource("snake.bmp")); // for Jar'archive } catch (IOException ex) { System.out.print(ex); } }
1
public void mouseExited(MouseEvent e) { String str = "The mouse has left the Frame !"; System.out.println(str); }
0
private void write_Compressed() { try { WriteHand = new BufferedWriter(new FileWriter("comp.txt")); WriteHand.write(mydata_coded); WriteHand.flush(); WriteHand.close(); } catch (IOException ex) { ex.printStackTrace(); } }
1
private String nodeText(Node node){ Node valueNode = node.getChildNodes().item(0); if (valueNode != null && valueNode.getNodeType() == Node.TEXT_NODE){ return valueNode.getNodeValue(); } return null; }
2
public void renderBasicObjects() { for (BasicObject bo : basic) { int[] image = bo.getPixles(); for (int y = 0; y < bo.getHeight(); y++) { for (int x = 0; x < bo.getWidth(); x++) { if(x < 0 || x > width || y < 0 || y >= height )break; if (image[x + y * bo.getWidth()] != ScreenManager.ge...
8
@Test public void insertTest() { for (int i = 1; i < 8; i++) { System.out.println(""); printTime(testArrayListInserts(100000 * (int) Math.pow(2, i))); printTime(testDynamicArrayInserts(100000 * (int) Math.pow(2, i))); } }
1
static double incompleteGammaComplement( double a, double x ) { double ans, ax, c, yc, r, t, y, z; double pk, pkm1, pkm2, qk, qkm1, qkm2; if( x <= 0 || a <= 0 ) return 1.0; if( x < 1.0 || x < a ) return 1.0 - incompleteGamma(a,x); ax = a * Math.log(x) - x - lnGamma(a); if( ax < -MAXLOG ) r...
8
public void start() { try { ExecutorService executor = Executors.newFixedThreadPool(numbersOfThreads); File file = new File(outputPath); if (!file.isDirectory()) { file.mkdirs(); } Calendar start = Calendar.getInstance(); ...
5
public Agent(Simulation controller, int i, String s) { scape = controller; id = i; score = 0; encounters = 0; average = 0; strategy = s; hasMoved = false; //Agent.memory records the past 10 actions of the //encountered agents against this agent....
5
private void anecdote(Actor actor, Actor other) { // // Pick a random recent activity and see if the other also indulged in it. // If the activity is similar, or was undertaken for similar reasons, // improve relations. // TODO: At the moment, we just compare traits. Fix later. final Trait...
4
public boolean intersects(double x0, double y0, double z0, double x1, double y1, double z1) { if (x1 <= x - xr || x0 > x + xr || y1 <= y - yr || y0 > y + yr || z1 <= z || z0 > z + zh) return false; return true; }
6
@Override public void run ( ) { if ( Core.first ) { Core.moves = this.main.computeFirstMove ( ) ; } else { Core.moves = this.main.commuteNextMove ( ) ; } this.moves = Core.moves ; if ( this.moves.isEmpty ( ) ) { if ( this.main.hand.isEmpty ( ) ) { GUI.write ( "Use the comm...
6
private boolean marginBuildings(int x, int y, int m) { for (int dx = x - m; dx < x + m; dx++) { for (int dy = y - m; dy < y + m; dy++) { if (dx > 0 && dy > 0 && buildings[dx][dy] != null) { return true; } } } return false; }
5
public boolean compDistribution() { bDeadline = true; boolean bUsedNewResource = false; double tmp = 0, rest = 0; /* distribute tasks according to the sort */ int k; double lastAllocation; for (int i = 0; i < iClass; i++) { System.out.print(iStage + "Distribution[" + i + "]"); tmp = 0; rest = iaT...
7
private static double[][] sortByRank(double[][] A, int aug){ int index = 0; for(int i = 0; i < A.length-index; i++){ boolean zeroRow = true; for(int j = 0; j<aug; j++){ if(A[i][j] != 0) zeroRow = false; } if(zeroRow){ for(int k = i; k<A.length-1; k++){ for(int j = 0; j <A[0].length; j+...
6
private void collectCategoryChanges(CourseModel model, ArrayList<Change> list) { HashSet<String> newIds = new HashSet<String>(); for (Object id : this.categories.keySet()) { newIds.add((String) id); } for (DescRec rec : model.getCategories(Source.COURSERA)) { if (!newIds.contains(rec.getId())) { li...
5
public static HashMap<Long, LinkedList<Long>> readAndMapTestFile (String filePath, boolean indexByUser) throws FileNotFoundException{ HashMap<Long, LinkedList<Long>> userItemPair = new HashMap<Long, LinkedList<Long>>(); Scanner scan = new Scanner(new File(filePath)); String line = null; //r...
8
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Observacion)) { return false; } Observacion other = (Observacion) object; if ((this.idObservacion == null && ot...
5
public static void SmithWaterman(AlignmentGraphBasic matrix) { int x,y; matrix.setMatrix(0,0,0); for(x=1;x<matrix.getMatrixXLength();x++) { matrix.setMatrix(0, x, Math.max(matrix.getMatrix(0, x-1)+matrix.getEffort()[0], 0)); } for(y=1;y<matrix.getMatrixYLength();y++) { matrix.setMatrix(y, 0, Math.m...
4
public static Measurement[] averageMeasurements(Measurement[][] toAverage) { List<String> measurementNames = new ArrayList<String>(); for (Measurement[] measurements : toAverage) { for (Measurement measurement : measurements) { if (measurementNames.indexOf(measurement.getName...
8
public void writeResultForMap(OpenCellIdCell originalCell, DefaultCell chosenHeuristicCell, DefaultCell otherHeuristicCell, double error) { try { jg.writeObjectFieldStart("cell"); jg.writeObjectField("lon", originalCell.getCellTowerCoordinates().getX()); jg.writeObjectField("lat", originalCell.getCellTowerCo...
4
public void get(int key) { HashPrinter.tryGet(key); /** Run along the array */ int runner = 0; int hash = (key % table.length); while (table[hash] != null && runner < table.length) { if (table[hash].getKey() == key) { break; } runner++; hash = ((key + runner) % table.length); } i...
6
@Override protected Object doInBackground() throws Exception { addPropertyChangeListener(this); try{ if (op.equals(Operation.LOAD))aDoc.load(fis, append, this); if (op.equals(Operation.SAVE))aDoc.save(fos, this); } catch (Exception e){ pw.close(); this.exception = e; e.printStackTrace(); } ...
3
@Override public String buscarDocumentoPorEstado(String estado) { ArrayList<Compra> geResult= new ArrayList<Compra>(); ArrayList<Compra> dbCompras = tablaCompras(); String result=""; try{ for (int i = 0; i < dbCompras.size() ; i++){ if(dbCompras.get(i).ge...
4
public static void main(String[] args) { // TODO Auto-generated method stub /*for(int cnt=1;cnt<6;cnt++){ for(int cnt2=0;cnt2<cnt;cnt2++);{ System.out.println("*"); */ int lim; lim = 5; //ループ回数 //*が1つから増えて行くループ for(int cnt1=0;cnt1<lim;cnt1++){ for(int cnt2=-1;cnt2<cnt1;cnt2++){ ...
9
public final Object opt(int index) { return (index < 0 || index >= length()) ? null : this.myArrayList.get(index); }
2
private int draw_stats(Graphics g, int i, int w, int offset) { g.setColor(COLORS[(i+1)%COLORS.length]); offset += 10; g.drawString("Player "+i+": "+game.getAgent(i).getLabel(), w, offset); int team = 0; for (int j = 0; j < game.pgs.teams.size(); j++) { if (game.pgs.teams.get(j).contains(i...
8
protected void defineWorld(int worldType) { world = new HashMap<Position,Tile>(); String[] layout; if ( worldType == 1 ) { layout = new String[] { "...ooMooooo.....", "..ohhoooofffoo..", ".oooooMooo...oo.", ...
8
public static ClientSender make(String comandStr) { RequestCommand comandInt = RequestCommand.valueOf(comandStr); ClientSender clientSender = null; switch (comandInt.toInt()) { case RequestCommand.LOG_FILE: clientSender = new LogFileStructureSender(); break; case RequestCommand.FILE_CONTENT: clien...
4
public static void startupLists() { if (Stella.currentStartupTimePhaseP(0)) { if (!(Stella.NIL_LIST != null)) { Stella.NIL_LIST = new List(); } Stella.NIL_LIST.theConsList = Stella.NIL; } { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEX...
7
public void update() { float movAmt = (float)(MOVE_SPEED * Time.getDelta()); movementVector.setY(0); Vector3f oldPos = Transform.getCamera().getPos(); Vector3f newPos = oldPos.add(movementVector.normalized().mul(movAmt)); Vector3f collisionVector = Game.getLevel().checkCollisions(oldPos, newPos, ...
2
private static String extractPureNumbers(String word) { StringBuilder sb = new StringBuilder(); Matcher m = allNumsPtn.matcher(word); while (m.find()) { sb.append(m.group()); // System.out.println(m.group()); } return sb.toString(); }
1
/* */ @EventHandler /* */ public void onMobTarget(EntityTargetEvent event) /* */ { /* 422 */ if ((event.getEntity() instanceof Monster)) /* */ { /* 424 */ if ((event.getTarget() instanceof Player)) /* */ { /* 426 */ if (Main.getAPI().isSpectating((Player)event.getTa...
3
public int getBlockTextureFromSideAndMetadata(int par1, int par2) { return par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2) ? (par1 == 0 ? 208 : (par2 == 1 ? 229 : (par2 == 2 ? 230 : 192))) : 176; }
7
@Override public void i3channelListen(MOB mob, String channel) { if((mob==null)||(!i3online())) return; if((channel==null)||(channel.length()==0)) { mob.tell(L("You must specify a channel name listed in your INI file.")); return; } if(Intermud.getLocalChannel(channel).length()==0) { if(Intermu...
7
public boolean kingIsInCheck(int color) { boolean check = false; int y = kingPositions[color].y; int x = kingPositions[color].x; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (chessBoard[i][j].color != color && !(chessBoard[i][j] instanceof Empty)) { if (chessBoard[i][j].isLegalC...
8
@EventHandler(priority = EventPriority.MONITOR) public void onBlockBreak(BlockBreakEvent event){ if(plugin.isEnabled() == true){ Block block = event.getBlock(); Player player = event.getPlayer(); if(!event.isCancelled()) blockCheckQuest(player, block, "blockdestroy", 1); } ...
2
public static void main(String[] args) { try { String str = "\\s \"werj 9234 \\3"; System.out.println("Original: " + str); System.out.println("Got escaped result: " + StringUtils.escapeDoubleQuotes(str)); } catch (Exception e) { e.printStackTrace(); } StringBuffer ex_ascii =...
3
public void execute() { // Initialize the matrix. int firstSize, secondSize; firstSize = s1.size(); secondSize = s2.size(); // Let's see if we're just being silly... if (firstSize < 2 || secondSize < 2) { throw new IllegalArgumentException("Oh come on, do you really need a computer to align those sequ...
8
private void unknowCommand(String command) { System.out.println("Current command is " + currentCommand); if (currentCommand.equalsIgnoreCase("follow")) { if (command.equals("reset")) { currentCommand = ""; sendToUser("Server Working ... "); } else { this.follow(command); } } else if (currentC...
7
public static void main(String[] args) { String reactomeDir = Gpr.HOME + "/snpEff/db/reactome/txt/"; String geneIdsFile = Gpr.HOME + "/snpEff/db/reactome/gene_ids/biomart_query_uniq.txt"; String gtexDir = Gpr.HOME + "/snpEff/db/GTEx"; String gtexSamples = gtexDir + "/GTEx_Analysis_Annotations_Sample_DS__Pilot_2...
2