text
stringlengths
14
410k
label
int32
0
9
public static float[][] GeneratePerlinNoise(float[][] baseNoise, int octaveCount) { int width = baseNoise.length; int height = baseNoise[0].length; float[][][] smoothNoise = new float[octaveCount][][]; //an array of 2D arrays containing float persistance = 0.5f; //generate smooth noise ...
6
public int selectByMouse(int index, int method) { if (index != -1) { if (mAnchor >= 0 && (method & MOUSE_EXTEND) == MOUSE_EXTEND) { select(mAnchor, index, true); } else if ((method & MOUSE_FLIP) == MOUSE_FLIP) { if (isSelected(index)) { deselect(index); } else { select(index, true); } ...
7
public static void main(String[] args) throws Exception { HashMap<String, BufferedWriter> writerMap = new HashMap<String, BufferedWriter>(); HashMap<String, DeMultiplex> sampleIDs =DeMultiplex.getBarcodeMap(); BufferedReader leftReader = new BufferedReader(new FileReader(new File( ConfigReader.getIanNov...
9
protected void openGD(BasicGraphEditor editor, File file, mxGdDocument document) { mxGraph graph = editor.getGraphComponent().getGraph(); // Replaces file extension with .mxe String filename = file.getName(); filename = filename.substring(0, filename.length() - 4) + ".mxe"; if (new File(filename)...
2
public MapCreator findCreatorForMode(int difficulty) { if (difficulty == 1) return new SafemapCreator(); else if (difficulty == 2) return new HazardousmapCreator(); else return null; }
2
public Object getObject() { if( cxnSp != null ) { return cxnSp; } if( graphicFrame != null ) { return graphicFrame; } if( pic != null ) { return pic; } if( sp != null ) { return sp; } if( grpSp != null ) { return grpSp; } return null; }
5
protected Map.Entry<String, List<String>> parseMapEntry(String entry) { // Trim whitespace and return null if empty entry = entry.trim(); if(entry.isEmpty()) return null; // Check if this is a switch if(entry.startsWith("-")) { // Get the rest of the string ...
8
public static void update(float dt) { float cameraSpeed=untranslateDistance(Camera.cameraSpeed); if (scale-Point.epsilon>scaleObject) setScale(Math.max(scaleObject, scale-dt*scaleSpeed)); else if (scale+Point.epsilon<scaleObject) setScale(Math.min(scaleObject, scale+dt*scaleSpeed)); e...
6
private boolean intArrayNotContains(int[] array, int value) { for (int i = 0; i < array.length; i++) { if (array[i] == value) return false; } return true; }
2
public void handleHandshake(Packet2Handshake par1Packet2Handshake) { boolean var2 = true; String var3 = par1Packet2Handshake.username; if (var3 != null && var3.trim().length() != 0) { if (!var3.equals("-")) { try { ...
8
public boolean canMerge(Polygon polygon) { for(Edge edge : edges) { for(Edge otherEdge : polygon.edges) { if(edge.contains(otherEdge.start) || edge.contains(otherEdge.end)) { return true; } } } return false; }
4
public static void concurrentTest() { final int BUFFER_SIZE = 10; final int NUM_PRODUCERS = 5; final int NUM_CONSUMERS = 3; Buffer buffer = new ConcurrentRingBuffer(BUFFER_SIZE); for (int i = 0; i < NUM_PRODUCERS; ++i) { new Thread(new Producer(buffer)).start(); ...
2
private void autoUpdate_settingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_autoUpdate_settingsButtonActionPerformed if (debug) logger.log(Level.DEBUG, "Setting preference \"autoUpdate\" from " + settings.autoUpdate() + " to " + autoUpdate_settingsButton.isSelect...
1
@EventHandler(priority = EventPriority.LOWEST) public void onChunkUnLoad(ChunkUnloadEvent 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()) { ...
7
public Test_OneConfig(List<Case> trainingData,List<Case> testingData, ArrayList<String> config, int testNum){ this.config=config; this.testNum = String.valueOf(testNum); double []Attributesweights; // Set the retrieval k int k = Integer.valueOf(this.config.get(0)); // Set the retrieval distances ...
5
public Transition addOutgoingTransition(Transition t, boolean consistency) throws Exception{ //check if there is not yet another transition with the same target state Transition existing = getExistingOutgoingTransition(t); if(existing != null) { //merge return mergeOutgo...
6
public boolean isAnnotated() { return isSource || isSink || isNeitherNor; }
2
public boolean Salvar(Endereco obj,int idPessoa){ try{ if(obj.getId() == 0){ PreparedStatement comando = banco.getConexao() .prepareStatement("INSERT INTO enderecos (rua,cep,bairro,numero,id_pessoa,cidade,estado,ativo) " + "VALUES(?,?,?...
2
private static void mergeFlatStatements(SequenceStatement sequence) { while (true) { Statement next; Statement current = null; boolean found = false; for (int i = sequence.getStats().size() - 1; i >= 0; i--) { next = current; current = sequence.getStats().get(i); ...
8
int selectSecurityType() throws Exception { int secType = SecTypeInvalid; // Read the list of secutiry types. int nSecTypes = readU8(); if (nSecTypes == 0) { readConnFailedReason(); return SecTypeInvalid; // should never be executed } byte[] secTypes = new byte[nSecTypes]; readFully(secTypes); /...
7
@Override public void completed(Object result, Object attachment) { while (buffer.position() < buffer.capacity()) { socket.write(buffer, null, this); } buffer.clear(); try { socket.close(); } catch (IOException exc) { exc.printStack...
2
private void initSuperclass(String superclass) { if (superclass != null) { this.superClass = constPool.addClassInfo(superclass); cachedSuperclass = superclass; } else { this.superClass = constPool.addClassInfo("java.lang.Object"); cachedSuperclass ...
1
@Override public void update(int mouseX, int mouseY, boolean pressed) { this.s += ds; if(this.s <= 20 || 40 <= this.s) this.ds *= -1; if(Game.instance.random.nextInt(Game.instance.requestedUPS/10) == 0) this.c = Game.instance.random.nextInt(); if(this.btnBack.wasClicked()) { if(this.win) ...
5
public void loadMasterTileList(String directory, String fileName) throws IOException{ String[] tileList = new String[1]; String[] temp; FileReader fr = new FileReader(directory+fileName); BufferedReader br = new BufferedReader(fr); //init based on number of tiles in file int numOfTile = Integer.parseInt...
4
public static PLConceptContainer createConceptContainer(List collectedconcepts, Module module, boolean includechildrenP) { { PLConceptContainer container = PLConceptContainer.new_PLConceptContainer(); List plconcepts = List.newList(); { Description concept = null; Cons iter000 = collectedconcep...
8
private void updateDistribution(int[] plate) { int sum = 0, max = 0; double normalfactor = 1.0 * numfruits * (choice + 1) / length; double normalweight = 0.6 - (1.2 * (choice + 1) / nplayers); choicelist[choice] = plate.clone(); for(int i = 0; i < length; i++) { observedlist[i] = observedlist[i] + plat...
5
@Override public void run() { if (this.ID != null) { csearch (this.ID); } this._view.init(); }
1
public void saveDoc() { try { // if (this.pdfwriter != null) { // pdfwriter.close(); // } if (document != null) { document.close(); } } catch (Exception e) { e.printStackTrace(); } }
2
public static ArrayList<Track> randomTracks(int nArtists) { ArrayList<Track> tracks = new ArrayList<Track>(); final int albumsPerArtist = 3; final int tracksPerAlbum = 8; for (int i = 0; i < nArtists; i++) { String artist = getRandomString(4); for (int j = 0; j < albumsPerArtist; j++) { String albu...
3
@Override public void mouseClicked(MouseEvent e) { if (game.getPlayer(game.getCurrentPlayerIndex()).getPlaysLeft() > 0) { int x = e.getX(); int y = e.getY(); game.setSelectedTile(null); if ((x >= 30) && (x <= 30 + 2 * BoardComponent.HEX_WIDTH)) { for (int i = 0; i < 6; i++) { if ((y >= (30 + i *...
7
@Override public void updatePerson(Person person) throws SQLException { Connection dbConnection = null; java.sql.Statement statement = null; try { dbConnection = PSQL.getConnection(); statement = dbConnection.createStatement(); String positionUpdate = "UPDATE person SET phone_number = "+ person.getP...
3
public void doCSVLarge() { try { final int cols = ConsoleMenu.getInt("Number of cols", 10); final int rows = ConsoleMenu.getInt("Number of rows", 2000000); final String filename = "LargeSampleCSV.csv"; CSVTestFileCreator.createFile(cols, rows, filename); ...
1
public static void main(String[] args) throws Exception { HashMap<String, DeMultiplex> sampleIDs = getBarcodeMap(); System.out.println(sampleIDs.size()); HashSet<Integer> sampleID = new HashSet<Integer>(); for( DeMultiplex d : sampleIDs.values()) { if( sampleID.contains(d.sampleID)) throw new Ex...
6
private void initProgressBar(){ progressBar = new JProgressBar(); progressBar.setSize(frame.getWidth()/2,25); progressBar.setStringPainted(true); progressBar.setMaximum(100); progressBar.setMinimum(0); progressBar.setValue(0); frame.add(progressBar); }
0
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { modificar = new javax.swing.JFrame(); descripFt = new javax.swing.JTextField(); refFt = new javax.swing.JTextField(); precioFt...
0
private void resize() { size = getSkinnable().getWidth() < getSkinnable().getHeight() ? getSkinnable().getWidth() : getSkinnable().getHeight(); width = getSkinnable().getWidth(); height = getSkinnable().getHeight(); if (getSkinnable().isKeepAspect()) { if (aspectRatio * wi...
6
public void render(Screen screen) { screen.renderSprite(animation.getCurrentSprite(), x - animation.getCurrentSprite().getWidth() / 2, y - animation.getCurrentSprite().getHeight() / 2, direction, true); if (level.game.showHitboxes) screen.drawQuad(0x0000ff, (int) getBounds().getX(), (int) ge...
1
public static void round(Image image) { for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { double red = image.getPixel(x, y, RED); double green = image.getPixel(x, y, GREEN); double blue = image.getPixel(x, y, BLUE); if (red > Image.MAX_VAL || red < 0) { ...
8
public void setupBankTable() throws Exception { Connection conn = getConnection(); PreparedStatement ps = null; ResultSet rs = null; if (Misc.is(Constants.DatabaseType, new String[] { "sqlite", "h2", "h2sql" })) { try { ps = conn.prepareStatement("CREATE TABLE " + Constants.SQLTable...
9
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!super.okMessage(myHost, msg)) return false; if((msg.source()==affected) &&(msg.target() instanceof Item) &&((msg.targetMinor()==CMMsg.TYP_HOLD)||(msg.targetMinor()==CMMsg.TYP_WIELD)) &&(isWearableItem((Item)msg.target()...
7
public void findPatternKMP(String string, String pattern) { if (string == null || pattern == null) { System.out.println("String or pattern null "); return; } int stringlen = string.length(); int patternlen = pattern.length(); for (int i = 0; i <= stringlen - patternlen; i++) { if (string.charAt(i...
8
public List<Boolean> getBooleanList(String path) { List<?> list = getList(path); if (list == null) { return new ArrayList<Boolean>(0); } List<Boolean> result = new ArrayList<Boolean>(); for (Object object : list) { if (object instanceof Boolean) { ...
7
public void lancerManche() { joueurCourrant = designerPremierJoueur(joueurs.size()); boolean mancheFinie = false; do { joueurs.get(joueurCourrant).jouer(); AvancerJoueur(); //remplacer ça par un système de levé d'exception for (Joueur j : joueurs) { if(j.getNbCarte() == 0) mancheFin...
3
public void setPrpMoaTipo(String prpMoaTipo) { this.prpMoaTipo = prpMoaTipo; }
0
public void setAge(int age) { this.age = age; }
0
public void draw(int window_x, int window_y, int window_width, int window_height, Graphics g, Level level) { g.drawImage( level.getBackground().getSubimage(this.x, this.y, this.width, this.height), window_x, window_y, window_width, window_height, null); for (List<Member> l : level.getRenders().va...
6
public void persistRoomType() { em.persist(typeEntity); }
0
private void checkDeleteTrap(int x, int y){ //delete traps. for(ListIterator<Trap> i = traps.listIterator(); i.hasNext();){ Trap t = i.next(); if(t.getX() == x && t.getY() == y){ i.remove(); continue; } } }
3
public static void STARTUP_MARSHALLER() { { Object OLD_$MODULE$_000 = Stella.$MODULE$.get(); Object OLD_$CONTEXT$_000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/STELLA/XML-OBJECTS", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Ste...
7
public void go() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { new MoveAction(being, being.getPosition().plus(Random.getRandomIdentityVector2(being.ID()).multiply(3.0))).go(); }
0
public boolean stem() { int v_1; int v_2; int v_3; int v_4; // (, line 157 // do, line 159 v_1 = cursor; lab0: do { // call prelude, line 159 if...
8
public boolean startup() throws IOException { String userId = node.getUserId(); RPCMessageFactory messageFactory = node.getMessageFactory(); NodeSecurityAgent securityAgent = node.getSecurityAgent(); StringBuilder buffer = new StringBuilder(); buffer.append("\nStarting initi...
9
public Point getPoint() { return point; }
0
void refillGoodStart() { System.out.println("good Bag"); pointer = 0; DynamicArray<Type> left = new DynamicArray<>(index); boolean gotOne = false; while (!gotOne) { int i = rand.nextInt(6); if (left.get(i) != Type.S && left.get(i) != Type.Z & left.get(i) != Type.O) { tetrominos[0] = left.remove(i); ...
4
public boolean equals(VertexSet that) { return this.laenderMap.keySet().equals(that.laenderMap.keySet()); }
0
public Coffin(TextGame _game) { super("Closed Coffin", ""); this.game = _game; this.addAction(new ActionInitial("open") { @Override public Result execute(Actor actor) { if (Coffin.this.getData("unlocked") == null) { if (((Player) actor).hasOne("key")) { // transform the coffin into vampire ...
8
public MathGame() { System.out.println("initing"); thisUser = new User("blank", "pass"); setPreferredSize(new Dimension(appWidth, appHeight)); // setSize(appWidth, appHeight); setLayout(null); // ((JComponent) getContentPane()).setBorder(new // LineBorder(Color.yellow)); // setBorder(new LineBorder(C...
6
public final String getConfigValue(final String section, final String key, final String defaultValue) { synchronized (this.configOld) { synchronized (this.configNew) { final Map<String, String> map0 = this.configNew.get(section); final Map<String, String> map1 = this.configOld.get(section); if (map0...
4
public int getTense ( String posTaggedSentence ) { int count = 0; String[] wordsAndTags = posTaggedSentence.split(" "); int size = wordsAndTags.length; for ( int i = 0 ; i < size ; i++ ) { String temp = wordsAndTags[i].substring(wordsAndTags[i].indexOf('/')+1); if...
3
public void writeRecord(byte[] record) throws IOException { int length = record.length; // // The record length must be a positive value // if (length < 1) throw new IllegalArgumentException("Record length "+length+" is not valid"); // // Flush the o...
5
@EventHandler(priority = EventPriority.LOWEST) @SuppressWarnings("unused") void onDamage(final EntityDamageEvent event) { Entity target = event.getEntity(); if (event instanceof EntityDamageByEntityEvent) { Entity attacker = ((EntityDamageByEntityEvent) event).getDamager(); ...
9
public Object put(Object key, Object value) { touch(key); return map.put(key, value); }//put
0
private void updateVillainMissiles2() { ArrayList<VillainMissile2> deadVillainMissiles = new ArrayList<VillainMissile2>(); for(int i = 0; i < villainMissiles2.size(); i++) { VillainMissile2 v = villainMissiles2.get(i); v.move(); if(CollisionDetector.isColliding(v, sc)) { if(!sc.isShieldActive()) ...
5
@RequestMapping(value = "del", method = RequestMethod.POST) @ResponseBody public Map del(@RequestParam int[] id) { Map<String, Object> map = new HashMap<>(); List<String> l1 = new ArrayList<>(); List<String> l2 = new ArrayList<>(); List<String> l3 = new ArrayList<>(); f...
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
private static String getFileContents(String filename) throws IOException, FileNotFoundException { File file = new File(filename); StringBuilder contents = new StringBuilder(); BufferedReader input = new BufferedReader(new FileReader(file)); try { String line = ...
1
public static Player generatePlayer(String teamName){ String firstName, lastName; Player.POSITION position; double height, weight; int age, salary; String alphabets = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; Random randomNum = new Random(); //Create first name firstName = ""; for (i...
4
public void doAlarm() { System.out.println("Beep!"); theDisplay.setAlarmPulse(true); try {Thread.sleep(300);} catch (InterruptedException e) {} theDisplay.setAlarmPulse(false); }
1
public BouncyBallSimulation(Planet simulatedPlanet, Ball bouncyBall) { if (simulatedPlanet == null) { throw new IllegalArgumentException("The simulated planet can not be missing!"); } if (bouncyBall == null) { throw new IllegalArgumentException("The bouncy ball can not be missing!"); } bouncyBall.addHit...
2
* @return the translation vector */ public static MCVector3 translate(int position) { switch(position) { case MCNeighbour.SOUTH: return new MCVector3(0,0,-2*SIZE); case MCNeighbour.NORTH: return new MCVector3(0,0,2*SIZE); c...
6
public final boolean equals(AttributeBaseValue attributeBaseValue) { if(attributeBaseValue == null) { return false; } if(_attribute.getId() != attributeBaseValue.getAttribute().getId()) { return false; } try { DataValue value1 = (DataValue)attributeBaseValue.getValue(); if((_value == null) && (val...
9
public int calculateCharge(int startingX, int startingY,int endingX, int endingY, final LinkedList<CellDescription> map) { /*initialize some variables*/ int chargeRequiredForReturnTrip; graphics = false; LinkedList<CellDescription> returnCells = new LinkedList<>(); sX = startin...
5
public static void main(String[] args) { Scanner scn = new Scanner(System.in); StringTokenizer lineTokenizer = new StringTokenizer(scn.nextLine() .trim()); int n = Integer.parseInt(lineTokenizer.nextToken()); int p = Integer.parseInt(lineTokenizer.nextToken()); ...
9
@Override public String getHTTPStatusCode(HTTPStatusCodes httpStatusCodes) { return isCredentialMatch() ? httpStatusCodes.getStatus(200) : httpStatusCodes.getStatus(401); }
1
public BufferedImage paneToBufferedImg() { BufferedImage bi; if (canvas.getWidth() <= 0 || canvas.getHeight() <= 0) { bi = new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB); } else { bi = new BufferedImage(canvas.getWidth(), canvas.getHeight(), BufferedImage.TYPE_INT_...
2
public void createNtables() throws Exception{ Connection conn = JDBC.createConnection(); String table_name = ""; for (int i=97;i<123;i++) { table_name = "n_gram_"+(char)i; String sql = " create table "+table_name+"(wordGroup varchar(100) primary key, wordAttribute varchar(100), frequence double(10,8), cou...
1
private void buildStack(Stack<BTPosition<T>> s, ArrayList<BTPosition<T>> al) { BTPosition<T> c; while (!s.isEmpty()) { c = s.pop(); // let right first if (c.getRight() != null) s.push(c.getRight()); if (c.getLeft() != null) s.push(c.getLeft()); al.add(c); } }
3
public void testRefcount2() throws Exception { Prot p1=new Prot("P1"), p2=new Prot("P2"); fc1=new ForkChannel(a, "stack", "fc1", p1, p2); fc2=new ForkChannel(a, "stack", "fc2"); // uses p1 and p2 from fc1 fc3=new ForkChannel(a, "stack", "fc3"); // uses p1 and p2 from fc1 assert ...
9
public void loadFile(String filename){ String path = "data/" + filename; try { BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(path), "Shift_JIS")); String line; while ((line = br.readLine()) != null) { ...
6
public Event removeTimer(int entity) { int timerIndex = -1; Event timer = null; for (int i = 0; i < data.size(); i++) { if ((((Event)(data.elementAt(i))).getType() == NetworkSimulator.TIMER_INTERRUPT) && ...
4
public boolean InsertarPlaga(Plaga p){ if (p!=null) { cx.Insertar(p); return true; }else { return false; } }
1
@Override public List<String> translateSingleWord(String word) { word = word.trim(); /* Die Website des zu uebersetzenden Wortes einlesen */ List<Document> contents = null; try { source = "http://" + sitePrefix(From, To) + website + URLEncoder.encode(word, "UTF-8"); contents = webparser.readUrls(source...
7
public void paintOverlayMouseOut(Graphics g, int cornerRadius) { switch(fPaintMode) { case ALWAYS: case MOUSE_OUT: paintMouseOut(g, cornerRadius); break; default: break; } fDecorator.paintOverlayMouseOut(g, cornerRadius); }
2
public void dumpExpression(TabbedPrintWriter writer) throws java.io.IOException { writer.print("("); writer.printType(castType); writer.print(") "); writer.breakOp(); /* * There are special cases where a cast isn't allowed. We must cast to * the common super type before. This cases always give a run...
1
public static String autodetectProjection(String directorio) { File archivoPrj = buscarArchivoPrj(new File(directorio)); if (archivoPrj != null){ try { return autodetectProjectionFromFile(archivoPrj); } catch (IOException e) { e.printStackTrace(); } } return ""; }
2
@Override public int loop() throws Exception { if(ctx.inventory.isFull()) { if(!ctx.bank.isOpen()) { final NPC banker = ctx.npcs.getNearest("Banker"); if(banker != null) { if(banker.interact("Bank")) { Time.sleep(new Con...
7
private void loginBtnMouseClicked(java.awt.event.MouseEvent evt) { Map<String, Object> map = new HashMap<String, Object>(); map.put(Constants.USER_NO, this.userNO.getText()); map.put(Constants.USER_PWD, String.valueOf(this.userPwd.getPassword())); map.put(Constants.USER_STATUS, this.status.getSelectedIndex() + ...
5
public boolean Update() { if (KeyPress.IsPressed(V_KEY) && !PRESSED) { return PRESSED = true; } else if (!KeyPress.IsPressed(V_KEY) && PRESSED) { return PRESSED = false; } return false; }
4
public int getCategoryId() { return categoryId; }
0
public void putAll( Map<? extends Short, ? extends Short> map ) { Iterator<? extends Entry<? extends Short,? extends Short>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends Short,? extends Short> e = it.next(); this.put( e.getKey...
8
public void getPeopleYouMightKnow() { ArrayList<String> ppl = new ArrayList<>(); for (User user : followers) { if (user.getFollowers().size() == 0) { ppl.add("You might know " + user.getName() + "'s followees..." + "but they don't follow anybody.:( ");...
8
public <T> void hear(TypeLiteral<T> typeLiteral, TypeEncounter<T> typeEncounter) { for (Class<?> c = typeLiteral.getRawType(); c != Object.class; c = c.getSuperclass()) { for (Field field : c.getDeclaredFields()) { if (field.getType() == Logger.class && field.isAnnotationPresent(InjectLogger.class)) { typ...
5
private void loadEndpoints(final String fileName){ try{ BufferedReader input = new BufferedReader(new FileReader(fileName)); String line; String[] array; Endpoint endpoint; /* reads each line of servers.txt and then converts them into Endpoint * objects to be inserted into the endpointManager...
4
public void CreateSkinNakedAlternativeTexturesMale() throws Exception { SPProgressBarPlug.setStatus("Create SkinNaked alternative textures for males"); ARMO skinNaked = (ARMO) SkyProcStarter.merger.getArmors().get(new FormID("000D64Skyrim.esm")); for (ARMA sourceAA : SkyProcStarter.patch.getArma...
7
private Opcode toOpcode( byte opcode ) throws InvalidFrameException { switch ( opcode ) { case 0: return Opcode.CONTINUOUS; case 1: return Opcode.TEXT; case 2: return Opcode.BINARY; // 3-7 are not yet defined case 8: return Opcode.CLOSING; case 9: return Opcode.PING; case 10:...
6
public boolean isChomsky(Production production) { String[] tokens = separateString(production.getRHS()); switch (tokens.length) { case 1: return grammar.isTerminal(tokens[0]); case 2: return !(grammar.isTerminal(tokens[0]) || grammar .isTerminal(tokens[1])); default: return false; } }
3
public String getFileName(){ int last = fileName.lastIndexOf("\\"); if(last == -1) last = fileName.lastIndexOf("/"); return fileName.substring(last+1); }
1
public void getNewsLink( String url, Config config, String encode ) { Document doc = null; try { doc = getDocument(url, encode); Element sourceEle = doc.select(config.ruleSource.sourceEle).first(); Elements newsEles = sourceEle.select(config.ruleSource.sourceEles); ...
7
private int getEuclideanDistance(Tile start) { int dx = Math.abs(start.getX() - end.getX()); int dy = Math.abs(start.getY() - end.getY()); return (int) Math.sqrt(dx * dx + dy * dy); }
0
@Override public int getType() { return BuildingType.SIDEWALK.ordinal(); }
0