text
stringlengths
14
410k
label
int32
0
9
private void moveOnX(Vector<Integer> ans, int xDis, int yDis){ if (xDis >= 0){ ans.add(1); if (yDis >= 0){ ans.add(0); ans.add(3); ans.add(2); } else { ans.add(2); ans.add(3); ans.add(0); } } else { ans.add(3); if (yDis >= 0){ ans.add(0); ans.add(1); ans.ad...
3
public void getInput() { Scanner scanner=new Scanner(System.in); int n, serial=1; while(scanner.hasNextInt()) { n=scanner.nextInt(); if(n<0) break; if(n==0||n==1) { System.out.println("Case "+serial+": 0"); }else if(n==2) { System.out.println("Case "+serial+": 1"); }else ...
8
private boolean _jspx_meth_c_import_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:import org.apache.taglibs.standard.tag.rt.core.ImportTag _jspx_th_c_import_0 = (org.apache.taglibs.standard....
3
public Double getTagWeight(Integer userID, Integer resourceID) { if (! userResourceTagMaping.containsKey(userID) || ! userResourceTagMaping.get(userID).containsKey(resourceID)) { return 0.0; } //get user's tag for the provided resource Map<Integer, List<Integer>> resourceTagMaping = userResourceTagMapin...
4
@Override public Object getValueAt(int row, int col) { Osoba osoba = data.get(row); switch (col) { case 0: return row; case 1: return osoba.getNazwisko(); case 2: return osoba.getImie(); case 3: return osoba.getKodPocztowy(); case 4: return osoba.getMiasto(); case 5: return osoba.getU...
8
public List getSearchArticles(int start, int end,String search, String val, int area) throws Exception{ Connection conn = null; Statement stmt = null; ResultSet rs = null; List<BoardDataBean> articleList = null; try{ conn = getConnection(); // val = new String(val.getBytes("iso_8859-1"),"utf-8"); Stri...
9
public static void main(String args[]) { new Win(); }
0
public boolean ValidateTicker(String ticker){ if("".equals(ticker)){ return false; } this.inputStream = getClass().getResourceAsStream("/allTickerSymbols.txt"); this.fileScanner = new Scanner(this.inputStream); while(this.fileScanner.hasNextLine()){ ...
3
@Override public int loop() { if (Game.getClientState() != Game.INDEX_MAP_LOADED) { return 1000; } if (client != Bot.client()) { WidgetCache.purge(); Bot.context().getEventManager().addListener(this); client = Bot.client(); } ...
6
@EventHandler public void CreeperWaterBreathing(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.getCreeperConfig().getDouble("Creep...
6
public void mousePressed(MouseEvent e) { for(int i = 0;i < ui.getButtons().size();i++) { b = ui.getButtons().get(i); if(e.getX()>=b.getX() && e.getX()<=b.getX()+b.getWidth()) { if(e.getY()>=b.getY() && e.getY()<=b.getY()+b.getHeight()) { b.setBgColor(C...
5
protected int getPageAddressLarge(int va, boolean inst, boolean priv, boolean read, int entryL1, int entryL2) { int dom = BitOp.getField32(entryL1, 5, 4); int base = BitOp.getField32(entryL2, 16, 16); //int ap3 = BitOp.getField32(entryL2, 10, 2); //int ap2 = BitOp.getField32(entryL2, 8, ...
9
private String format(LogRecord e) { StringBuilder sb = new StringBuilder(); Level lvl = e.getLevel(); if (lvl == Level.INFO) { sb.append("[INFO] "); } else if (lvl == Level.SEVERE) { sb.append("[SEVERE] "); }else if (lvl == Level.FINE) { sb.append("[MSG] "); } else { sb.append("[OTHER] "); } ...
4
public String post(String name, Paste paste, ReportFormat format, ExpireDate expireDate) { if(name == null) name = ""; String report_url = ""; try { URL urls = new URL(this.POST_URL); HttpURLConnection conn = (HttpURLConnection) urls.openConnection(); ...
5
public void displayResult(boolean success) { String text; if (success) { display.setForeground(Color.GREEN); text = "Success!"; } else { display.setForeground(Color.RED); text = "Failed"; } display.setText(text); display.setEchoChar((char) 0); display.setEditable(false); for(int i=0;i<butt...
4
public void setTurnOffCommand(Command turnOffCommand) { this.turnOffCommand = turnOffCommand; }
0
Type(int type) { this.type = type; }
0
private void lsUpdateGroup (final int ISA, final int first, final int last) { final int[] SA = this.SA; int a, b; int t; for (a = first; a < last; ++a) { if (0 <= SA[a]) { b = a; do { SA[ISA + SA[a]] = a; } while ((++a < last) && (0 <= SA[a])); SA[b] = b - a; if (last <= a) { ...
7
@Override public void mouseClicked(MouseEvent e) { System.out.println("CLICK"); new Thread(new Runnable(){ public void run() { synchronized(Main.lignes) { MenuDroite.lblVitesse.setText(""+bus.getVitesse());// = new JLabel("OH YEAH "+bus.getId()); Utils.removeAllListeners(MenuDroite.btnAugmenterVit...
1
public void method346(int i, int j) { i += anInt1442; j += anInt1443; int l = i + j * DrawingArea.width; int i1 = 0; int j1 = myHeight; int k1 = myWidth; int l1 = DrawingArea.width - k1; int i2 = 0; if(j < DrawingArea.topY) { int j2 = DrawingArea.topY - j; j1 -= j2; j = DrawingArea.topY; ...
6
@Override public boolean doTest(FuzzySet set, IDomain domain) { boolean isSymmetric = new SymmetryTestCommand( set.getName()).doTest(set, domain); System.out.println(isSymmetric ? "YES" : "NO"); boolean isReflexive = new ReflexivityTestCommand( set.getName()).doTest(set, domain); System.out.pr...
5
public void handleReceivedPacket(DatagramPacket packet){ byte [] data=packet.getData(); String temp_name=extractName(data); if(temp_name.equals(name)){ return;//if packet with the name of the host arrived -> dont do anything } String message; if(!members.contains(temp_name)){ // first time connected...
8
public static void main(String[] args) throws DatumException { SortedSet<Voertuig> voertuigen; voertuigen = new TreeSet<>(); try { voertuigen.add(new Personenwagen("opel", DATUM_1, 1000, 5, Color.YELLOW, BESTUURDER_A, INGEZETENE_A, INGEZETENE_B)); voertuigen.add(new Pers...
7
@SuppressWarnings("unchecked") public void addTag(String tag, String filePath){ Picture picture = findById(filePath); if(picture != null){ List<TagI> tags = new ArrayList<TagI>(); try{ tags = (List<TagI>) picture.getTags(); }catch(Exception y){ Log.getLogger().log(Level.INFO, "Couldn't get any tag...
6
public static boolean isNumeric(String str) { NumberFormat formatter = NumberFormat.getInstance(); ParsePosition pos = new ParsePosition(0); formatter.parse(str, pos); return str.length() == pos.getIndex(); }
0
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: final Thread serverThread = new Thread(){ public void run(){ basicslick.server.GameServer server = new basi...
0
private static int fac(int n){ if (n==0) return 1; if (n==1) return 1; return n*fac(n-1); }
2
@EventHandler public void SnowmanStrength(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.getsnowgolemConfig().getDouble("Snowman.S...
6
public void printToFile(String filePath) { try { StringBuilder sbOutput = new StringBuilder(); // Output each member of settings. for (Field field : this.getClass().getDeclaredFields()) { String typestr = field.getType().toString().toLowerCase(); if (typestr.endsWith("string") || typestr.endsWith("in...
7
private static String defineCord(HashMap<String, List<String>> pDictionary, String cordType) { for (int i=0; i < pDictionary.get(allURIs.get(cordType)).size(); i++) { if (cordType.equalsIgnoreCase("x")) {X.add(Double.parseDouble(pDictionary.get(allURIs.get(cordType)).get(i)));} else if (cordType.equalsIgnoreCas...
7
public synchronized void closeCon() throws Exception { // 清空用户列表 sleep(300); listModel.removeAllElements(); listmodel.removeAllElements(); onLineUsers.clear(); chatRooms.clear(); objChatRooms.clear(); btn_start.setEnabled...
3
private Object getFieldValue(final Field field, Object entity) { try { Class<?> clazz = field.getType(); if (clazz.equals(Integer.TYPE)) { return field.getInt(entity); } if (clazz.equals(Long.TYPE)) { return field.getLong(entity); ...
9
private void handleEntityEnd() { if (currentArea == null || currentAttributes == null) { log.warning("Can't handle this entity! Current Value: " + currentValue + ", Current Attributes: " + currentAttributes); return; } if (currentArea.equals("accessible")) { String entity = null; for (int i ...
9
public static void main(String[] args) { openConfig(".jifirc"); //if we have arguments...don't use a gui //Usage: jifi <device> <hex file> if (args.length == 2 && true) { String dev = args[0]; String file = args[1]; IfiComm comm = new IfiComm(Jifi.lastPort); try { comm.open(); ...
8
@Override protected void onTermination(Throwable exception) { System.out.printf("MyWorkerThread %d:%d\n",getId(),taskCounter.get()); super.onTermination(exception); }
0
private void startUpdate() { if(periodicAddonUpdate == null) setPeriodicUpdate(1000); }
1
@Override public boolean verifyInput() { if (lineCommentsEnabledCB.isSelected()) { String lineCommentStart = lineCommentStartField.getText().trim(); if (lineCommentStart.length()==0) { app.validateError(lineCommentStartField, "Error.NoEolCommentStart"); return false; } } if (mlcsEnabledCB.isSe...
8
private void evalPutField(int opcode, int index, Frame frame) throws BadBytecode { String desc = constPool.getFieldrefType(index); Type type = zeroExtend(typeFromDesc(desc)); verifyAssignable(type, simplePop(frame)); if (opcode == PUTFIELD) { Type objectType = resolveClassI...
1
public static DictItem find(List<DictItem> dictionary, String groupId, String artifactId, String version) { DictItem match=null; for(DictItem item:dictionary) { if(item.groupId.equals(groupId)&& ...
8
protected Map readStates(Node node, Automaton automaton, Set locatedStates, Document document) { Map i2s = new java.util.HashMap(); if(node == null) return i2s; NodeList allNodes = node.getChildNodes(); ArrayList stateNodes = new ArrayList(); for (int k = 0; k < allNodes.getLength(); k++) { if (al...
7
@Override public Iterator<AbstractPlay> iterator() { return bestPlays.iterator(); }
0
public static String NumberToText( int n) { if ( n < 0 ) return "Minus " + NumberToText(-n); else if ( n == 0 ) return ""; else if ( n <= 19 ) return new String[] {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen"...
8
@Override public User createUser(User user) { Connection cn = null; PreparedStatement ps = null; ResultSet rs = null; try { cn = ConnectionHelper.getConnection(); ps = cn.prepareStatement(QTPL_INSERT_USER, new String[] { "user_id" }); ps.setString...
5
public void buildAssociations(Instances instances) throws Exception { m_errorMessage = null; m_targetSI.setUpper(instances.numAttributes() - 1); m_target = m_targetSI.getIndex(); Instances inst = new Instances(instances); inst.setClassIndex(m_target); inst.deleteWithMissingClass(); // can ...
8
public static void initializeMappingFile (String sourceDir, String mappingFileName) throws IOException { GenUtil.validateString (sourceDir); GenUtil.validateString(mappingFileName); try { CSVReader br = new CSVReader (new FileRea...
9
public static void assertReferenceIsGCed(String text, Reference<?> ref) { List<byte[]> alloc = new ArrayList<>(); int size = 100000; for (int i = 0; i < 50; i++) { if (ref.get() == null) { return; } try { System.gc(); ...
8
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 Vector<Vector<Object>> userTable() { try { String[] keys = {"username", "active"}; crs = qb.selectFrom(keys, "users").all().executeQuery(); data.clear(); while(crs.next()) { Vector<Object> row = new Vector<Object>(); ResultSetMetaData metadata = crs.getMetaData(); int numberOfColumns...
4
@Test(expected = PersistencyException.class) public void WhenLoadingFromFileWithInvalidPort_ExpectIllegalArgumentException() throws PersistencyException { RoutingTable routingTable = new RoutingTable(); try { persistenceDelegate_.load(INVALID_PORT_FILE, routingTable); } catch (Fi...
1
public ArrayList<Integer> findSubstring(String S, String[] L) { int n = S.length(); int m = L[0].length(); int l = L.length; Map<String, Integer> needFind = new HashMap<String, Integer>(); Map<String, Integer> hasFound = new HashMap<String, Integer>(); for (int i = 0; i < l; i++) { if (!ne...
9
static synchronized void remove(LinkedList list, String name) { if (list == null) return; ListIterator iterator = list.listIterator(); while (iterator.hasNext()) { AttributeInfo ai = (AttributeInfo)iterator.next(); if (ai.getName().equals(name)) ...
3
private static final FileOnDisk getPreferencesFileOnDisk(String string, int i, String string_14_, int i_15_) { String string_16_; if (i_15_ == 33) string_16_ = "jagex_" + string_14_ + "_preferences" + string + "_rc.dat"; else if (i_15_ != 34) string_16_ = "jagex_" + string_14_ + "_preferences" + ...
7
public void makeActive() { this.setBackground(this.BACKGROUND_ACTIVE); }
0
private void intelligenceMode() { int count = 0; gameMode = "Intelligence Mode"; System.out.println("----------- INTELLIGENCE MODE -----------"); System.out.println("Tip: Press \"Q\" for quit Game"); while (true) { Coordinate scanPosition = this.inputPosition(); ...
8
public void parse() { if (Compiler.verbose()) System.out.println("Scanning..."); lexer.scann(text); if (Compiler.verbose()) { while (lexer.hasNext()) System.out.println(lexer.nextToken().getToken() + ", "); lexer.reset(); } if (Compiler.verbose()) System.out.println("Parsing..."); /...
4
public int getRank() { return myRank; }
0
private int readBytes(byte[] b, int offs, int len) throws BitstreamException { int totalBytesRead = 0; try { while (len > 0) { int bytesread = source.read(b, offs, len); if (bytesread == -1) { break; } totalBytesRead += bytesread; offs += bytesread; len -= bytesread; }...
3
public int ladderLength1(String start, String end, HashSet<String> dict) { HashSet<String> visited = new HashSet<String>(); LinkedList<String> queue = new LinkedList<String>(); HashSet<String> termi = new HashSet<String>(); for(String str : dict){ if(diffInOne(str, end)) term...
9
public static void main(String[] args) { // TODO code application logic here Scanner entrada = new Scanner(System.in); String Cadena1=""; Cadena1=JOptionPane.showInputDialog("Ingrese Frase"); Cadena1=" "+ Cadena1 +" "; int longitud = Cadena1.length(); ch...
5
public void mouseReleased(MouseEvent arg0) {}
0
public boolean triggerShimmyOut(){ if( ! hideTimer.isRunning() && isShimmyVisible() && !menu.isMenuItemOpen() && !menu.isLock()){ hideTimer.start(); mmMenuBar.reposition(0,0); mmMenuBar.rescale(Gui.getContentPane().getWidth(), 10); return true; } else return false; }
4
public WorldModelImpl(int width, int height, double bombPercentage, boolean isThorique, GameDifficulty gd) throws WidthException, HeightException, BombPercentageException { if (bombPercentage < 100) { this.bombPercentage = bombPercentage; } else { throw new BombPercentageExceptio...
4
public static AccessibilityEnumeration fromValue(String v) { for (AccessibilityEnumeration c: AccessibilityEnumeration.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
2
public SearchCondition build_search_condition() { SearchCondition cond = new SearchCondition(); if (this.m.get("city") != null) { cond.setCity((String)m.get("city")); } if (this.m.get("country") != null) { cond.setCountry((String)m.get("country")); } ...
8
public static boolean isNumeric(String s){ if(s==null) return false; if(s.contains("E")){ String mantissa = s.substring(0, s.indexOf("E")); String power = s.substring(s.indexOf("E")+1); return isNumeric(mantissa) && isNumeric(power); } if (s.matches("((-|\\+)?[0-9]+(\\.[0-9]+)?)+")) return true; ...
4
private void fillActionComboBox() { actionComboBox.removeAllItems(); Object o = modelComboBox.getSelectedItem(); if (o instanceof BasicModel) { BasicModel model = (BasicModel) o; Map changeMap = model.getChanges(); if (changeMap != null) { synchronized (changeMap) { for (Object x : changeMap.val...
7
private boolean validateXML(Document dom) { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = null; for (int i = 0; i < schemaLocations.length; i++) { try { schema = factory.newSchema(schemaLocations[i]); } catch (Excep...
6
public List<String[]> solveNQueens(int n) { String []board= new String[n]; char[] init = new char[n]; Arrays.fill(init,'.'); for (int i =0; i < n ;i++ ) { board[i]= new String(init,0,n); } nextQueens(board,0,n); return list; }
1
private TreeNode initTree() { DefaultMutableTreeNode tmodel = new DefaultMutableTreeNode("Thème"); try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); } catch (ClassNotFoundException ex) { JOptionPane.showMessageDialog(this, "Driver" + ex.getMessage(), nu...
8
PetiRound valueOf(RoundingMethod roundingMethod) { switch (roundingMethod) { case DOWN: return PetiRound.DOWN; case UP: return PetiRound.UP; case HALF_UP: return PetiRound.HALF_UP; default: throw new IllegalArgumentException("Unexpected roundingMethod: " + roundingMethod); } }
3
public boolean TableExists(Connection conn, String tname) { DatabaseMetaData md; ResultSet rs; try { md = conn.getMetaData(); } catch (SQLException e) { // This shouldn't really happen plugin.Warn("Unable to read DatabaseMetaData from DB connection!"); e.printStackTrace(); return false; } ...
4
public void start(int interval, final boolean beep) { class TimePrinter implements ActionListener { public void actionPerformed(ActionEvent event) { Date now = new Date(); System.out.println("At the tone, the time is " + now); if (beep) Toolkit.getDef...
0
public static void OBRADI_odnosni_izraz(boolean staviNaStog){ String linija = mParser.ParsirajNovuLiniju(); int trenLabela = mBrojacLabela++; if (linija.equals("<aditivni_izraz>")){ OBRADI_aditivni_izraz(staviNaStog); return; } if (linija.equals("<odnosni_izraz>")){ OBRADI_odnosni_izraz(true);...
7
private void sendIncorrectMessage(Player p, boolean hasPermission, boolean invalidArgs) { if (!hasPermission) plugin.tell(p, "You do not have permission to use this command."); if (!invalidArgs) plugin.tell(p, "Invalid arguments. Use &e/hunger help&r for a list of commands."); }
2
private void dfs(TreeNode node, int level) { if(node.left == null && node.right == null) { minDepth = level < minDepth ? level : minDepth; return; } if(level > minDepth) return; if(null != node.left) { dfs(node.left, level + 1); } if(null != node.right) ...
6
public static boolean validadePlaca(String placa) throws PlacaInvalidaException{ PlacaInvalidaException a = new PlacaInvalidaException(); //checar tamanho if(placa.length()!=8){ throw a; //checando se h� numeros onde deve haver n�meros }else{ for(int i = 0; i <placa.length(); i++){ if(i>=4){ i...
9
@Override public void execute(Stack<Double> st, String userInput, Map<String, Double> def) { String[] mas = userInput.split(" "); try{ double pushValue = 0.0; boolean flag = false; // check the presence of parameter in def and, if found, define pushValue ...
6
Class18(OpenGlToolkit var_ha_Sub2) { anInt286 = 1; aClass262_292 = new Deque(); aBoolean293 = true; aClass258_Sub3Array295 = new Class258_Sub3[2]; aBoolean297 = true; aBoolean294 = true; aBoolean299 = true; anInt302 = 0; anInt301 = -1; aBoolean303 = false; aHa_Sub2_290 = var_ha_Sub2; if (((OpenGlToolkit) aH...
5
private boolean sendPacket() { boolean var1 = false; try { Packet var2; Object var3; int var10001; int[] var10000; if (!this.dataPackets.isEmpty() && (this.chunkDataSendCounter == 0 || System.currentTimeMillis() - ((Packet)this.da...
9
private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { jj_gen++; if (++jj_gc > 100) { jj_gc = 0; ...
6
@Override public void validate() { if (newrt == null) { addActionError("Please Enter New Rate"); } if (cfrt == null) { addActionError("Please Enter Confirm New Rate"); } else if (!cfrt.equals(newrt)) { addActionError("New Rate & Confirm New Rat...
3
@After public void tearDown() { }
0
public int lengthOfLongestSubstring(String s) { int rstart = 0; int rend = 0; int mstart = 0; int mend = 0; if (s == null) return 0; if (s.length() == 0) return 0; if (s.length() == 1) return 1; for (int start = 0; start...
8
public static void main(String[] args) { /** * Created 2 threads, and assign tasks (Processor(i).run) to the threads */ ExecutorService executor = Executors.newFixedThreadPool(2);//2 Threads for (int i = 0; i < 2; i++) { // call the (Processor(i).run) 2 times with 2 threads ...
2
public void dispose() { if (program != 0) { disposeShaders(); GL20.glDeleteProgram(program); program = 0; } }
1
@EventHandler public void SkeletonHarm(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.getZombieConfig().getDouble("Skeleton.Harm.D...
7
public ArrayList<SignatureFile> getSelectedFiles() { ArrayList<SignatureFile> list = new ArrayList<SignatureFile>(); for (int i = 0; i < user.getFiles().size(); i++) { if (this.isSelected(i)) { list.add(user.getFiles().get(i)); } }...
2
public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); Point[] horizontal = new Point[n]; Point[] vertic...
9
private boolean setPlus(int cardNumber, int playerNumber) throws ContradictionException { if (table[cardNumber][playerNumber] == Resolution.Minus) { Card card = cardSet.cards.get(cardNumber); String player = getCompartments().get(playerNumb...
5
private String convertProduct(Product product) { StringBuffer result = new StringBuffer(); //First the uriref for the subject String subjectURIREF = product.toString(); //rdf:type result.append(createTriple( subjectURIREF, createURIref(RDF.type), createURIref(BSBM.Product))); //rdfs:...
7
public void addCommand(Command command) { commands.put(command.getName(), command); }
0
public void insert(Comparable c) { if (list.isEmpty()) { list.insertFront(c); return; } try { if (c.compareTo(list.front().item()) < 0) { list.insertFront(c); return; } if (c.compareTo(list.back().item()) > 0) { list.insertBack(c); return; } ListNode node = list.front(); wh...
7
public static void createFurnace(Player p){ createRecipesDirectory(); ItemStack in = null; //9, 10, 11, 18, 19, 20, 27, 28, 29 .. 17 in = (p.getInventory().getItem(29) != null) ? p.getInventory().getItem(29) : null; ItemStack out = (p.getInventory().getItem(17) != null) ? p.getInventory().getItem(17) : new...
9
public Pass1(File source) { this.temp = new File(source.getName() + ".tmp"); // Create the temporary file this.tempLabel = new File(source.getName() + ".label.tmp"); lineNumber = 0; // Used to indicate what the line number of the file we are working on recursionCounter = 0; ...
1
public omaArrayList<Aim> getShortestRoute(Tile endPoint) { int distance = pathTable[endPoint.getRow()][endPoint.getCol()]; omaArrayList<Aim> path = new omaArrayList<Aim>(); Aim[] table = { Aim.NORTH, Aim.EAST, Aim.SOUTH, Aim.WEST }; Tile tile = endPoint; Tile newTile; while (distance > 0) { for (int i = ...
7
public void stringToBlockMap(String key){//Make it a 2D array instead of a long list int i = 0; if(key != null){ for(int z=0; z<depth; z++){ for(int y=0; y<height; y++){ for(int x=0; x<width; x++){ if(key.length() > i){ s...
9
public static <F> DiscreteObjectChooser<F> estimate(FeatureExtractor<F> featureExtractor, List<List<F>> alternativeObjectss, int[] choices, int minFeatureCount, RegressionPrior prior, int priorBlockSize, Annea...
9
@Override public Imagem aplica(Imagem imagem) { Imagem novaImagem = new Imagem(imagem.getWidth(), imagem.getHeight()); int metadeTamanho = (int) Math.floor((float)getTamanho() / 2); for(int x = metadeTamanho; x < imagem.getWidth() - metadeTamanho; x++) { for(in...
4
protected void printWordTopicDistribution(_Doc d, File wordTopicDistributionFolder, int k) { _ParentDoc4DCM pDoc = (_ParentDoc4DCM) d; String wordTopicDistributionFile = pDoc.getName() + ".txt"; try { PrintWriter pw = new PrintWriter(new File( wordTopicDistributionFolder, wordTopicDistributionFile)); ...
5
public void request() { if (mState != null) { mState.handle(this); } }
1