text
stringlengths
14
410k
label
int32
0
9
@Override public void setTargetItem( DefaultBox<?> targetItem ) { if( comment == null ) { super.setTargetItem( targetItem ); } else { comment.setConnection( null ); super.setTargetItem( targetItem ); comment.setConnection( this ); } }
2
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String nextPage = request.getPathInfo(); if (nextPage != null && !nextPage.contentEquals("/")) { if (nextPage.contentEquals("/article")) { ajoutArticleEnSession(request); request.getSe...
4
private void appendDisclaimer(StringBuilder builder) { try { Document doc = Jsoup.parse(BakaTsuki.getResourceAsStream("resources/disclaimer.html"), "UTF-8", ""); Element table = doc.select("table#contributors").first(); // Append header row if(!config.getTitle().equals("")) table.append("<tr><th col...
6
private void markSubroutineWalk( final Subroutine sub, final int index, final BitSet anyvisited) { if (LOGGING) { log("markSubroutineWalk: sub=" + sub + " index=" + index); } // First find those instructions reachable via normal execution markSubr...
8
@Override public void onDraw(Graphics G, int viewX, int viewY) { if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300) { G.setColor(Color.white); int deg = r.nextInt(360); G.fillArc((int)(X-1)-viewX, (int)(Y-1)-viewY, 2, 2, deg, 60); deg = r.nex...
4
private void checkValuePlacement() throws RrdException { Matcher m = VALUE_PATTERN.matcher(text); if ( m.find() ) { normalScale = (text.indexOf(SCALE_MARKER) >= 0); uniformScale = (text.indexOf(UNIFORM_SCALE_MARKER) >= 0); if ( normalScale && uniformScale ) throw new RrdException( "Can't sp...
5
private void highlightRemaining() { editingGrammarView.dehighlight(); mainLabel.setText("Productions to convert are selected."); for (int i = 0; i < need.length; i++) editingGrammarView.highlight(need[i]); }
1
public synchronized static int countBrothers(ArrayList<Ant> ants) { int brothers = 0; for (int a = 0; a < ants.size(); a++) { boolean brothersOk = false; for (int b = 0; b < ants.size(); b++) { if (a != b) { if (!isTheBrother(ants.get(a), ants.get(b))) { brothersOk = true; } } } ...
5
public void setId(int id) { this.id = id; }
0
public String execute(String[] args){ return runList.toString(); }
0
private boolean parseRooms(Document doc) { int x, y; Tile elevatorTile = null; NodeList nodes = doc.getElementsByTagName(XmlTag.ROOM_SECTION.toString()); NodeList rooms = ((Element)nodes.item(0)).getElementsByTagName(XmlTag.ROOM.toString()); for(int room_num = 0; room_num < rooms.getLength(); room_num++) {...
6
public void print() { System.out.println("ID: " + id); System.out.println("Name: " + name); System.out.println("Gender " + gender); System.out.println("Birthdate " + birthday + " " + birthyear); System.out.println("Deathdate: " + deathday + " " + deathyear); if (mother != null) { System.out.println("Moth...
5
public void paint(Graphics g){ super.paint(g); Dimension size = getSize(); int boardTop = (int) size.getHeight() - BoardHeight * squareHeight(); //vykresleni uz dopadenych dilku for (int i = 0; i < BoardHeight; ++i) { for (int j = 0; j < BoardWidth; ++j) { ...
5
public void deleteArrow() { synchronized(c) { if (c.playerEquipment[c.playerCape] == 10499 && Misc.random(5) != 1 && c.playerEquipment[c.playerArrows] != 4740) return; if(c.playerEquipmentN[c.playerArrows] == 1) { c.getItems().deleteEquipment(c.playerEquipment[c.playerArrows], c.playerArrows); } i...
6
private void createRecursively(IBlockNode node, Node sceneNode, int depth, Map<HingeJoint, JointProperties> jointsMap) { if(depth <= this.maxDepth && numNodes<=tempMaxNodes) { List<BlockNode> addedChildren = new ArrayList<BlockNode>(); for(int i=0; i<8; i++) { boolean ticketToPass = (numNodes==1 && i=...
9
public void fillKeplerElements(OsculatoryElements[] _el) { int body; int i; double s[] = new double[3]; double p[] = new double[3]; double r2[] = new double[3]; double v2[] = new double[3]; double rr[] = new double[3]; double vv[] = new double[3]; double b1[] = new double[3]; double b2[] = new doubl...
9
public String getLocation() { return location; }
0
private void addListeners() { this.wordCountRadioButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { StringBasicPanel.this.main.clearOutput(); System.out.print("Number of words in the above string is :\t"); System.out.println(StringDemo.wordCount(St...
1
static private boolean jj_3R_88() { if (jj_scan_token(FOR)) return true; if (jj_scan_token(70)) return true; if (jj_3R_20()) return true; if (jj_scan_token(72)) return true; if (jj_3R_20()) return true; if (jj_scan_token(72)) return true; if (jj_3R_20()) return true; if (jj_scan_token(71...
9
public double heightAt(double x, double z) { if (x < 0) { x = 0; } if (x > this.getWidth() - 1) { x = this.getWidth() - 1; } if (z < 0) { z = 0; } if (z > this.getLength() - 1) { z = this.getLength() - 1; } int leftX = (int) x; if (leftX == this.getWidth() - 1) { leftX--; } doubl...
6
public static void updateCalendar(int aMonth, int aYear){ String[] months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; int days; int startOfMonth; prev.setEnabled(true); next.setEnabled(true); // Prevents going backward or fo...
7
@Override protected long calculateBase(final long base, final long remainder, final int droppedDigits, final int layoutBase) { final long baseWithRemainder = base + (remainder == 0 ? 0 : remainder / DPU.getScale(droppedDigits - 1) / 5); if (layoutBase != 1) { final long layoutRemainder = baseWithRemainder % l...
3
public void addPlantsToWorld(final Grid g) { Thread plantWatcher = new Thread(new Runnable() { @Override public void run() { int n = 0; while (true) { while (Grid.plants.size() < nPlantsInWorld) { if (nPlantsInWorld - Grid.plants.size() >= 4) { n = 4; } else { n = nPlantsInWo...
3
@EventHandler public void onJoin(PlayerJoinEvent e) { String channel = plugin.getConfig().getString("CustomChannels.Channel-on-Join"); ConfigurationSection s = ChannelsConfig.getChannels().getConfigurationSection("channels"); Player p = e.getPlayer(); /* * Critical null-check. It is easy to mess this confi...
4
public Move move(Field from, Field to) { Move move = this.getMove(this.window.board, from, to, from.getPiece()); this.executeMove(move); return move; }
0
public static byte[] gzip(String input) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzos = null; try { gzos = new GZIPOutputStream(baos); gzos.write(input.getBytes("UTF-8")); } catch (IOException e) { e.printStackTrace...
3
public static void main(String[] arsg) { printOutGameStateTransition("", ""); }
0
private Rectangle2D.Double DrawText(Graphics2D g2, Font font, Rectangle2D.Double r1, String text) { Rectangle d = font.getStringBounds(text, g2.getFontRenderContext()).getBounds(); Rectangle2D.Double r2; if (r1 == null) r2 = new Rectangle2D.Double(width / 2 - d.width / 2 - (int) (0.0...
1
public void actionPerformed( ActionEvent e ) { // don't handle the keys in other components TKeyLock.keys.lock() ; TProject project = TGlobal.projects.getCurrentProject() ; TProjectData current = project.getProjectData() ; // project instance available if ( current != null ) { if (...
6
public void winnings() { //Divide exp amongst characters int div = 0; ArrayList<People> team = _user.getTeam(); for ( People p : team ) { if ( !p.getDead() ) div += 1; } gainE = gainE/div; for ( People p : team ) { if ( !p.getDead() ) { System.out.println(p.getName() + " gained " + gainE + " exp!...
4
public final void run_startup_configurations() { try { FileReader fileReader = new FileReader(System.getProperty("net.sf.odinms.login.config")); initialProp.load(fileReader); fileReader.close(); Registry registry = LocateRegistry.getRegistry(initialProp.getProperty("net.sf.odinms.world.host"), Regi...
7
@Override public void Actualizar(Object value) { Session session = null; try { Cuentas cuenta = (Cuentas) value; session = NewHibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); session.update(cuenta); session.get...
2
void init(int n){ bitrev=new int[n/4]; trig=new float[n+n/4]; log2n=(int)Math.rint(Math.log(n)/Math.log(2)); this.n=n; int AE=0; int AO=1; int BE=AE+n/2; int BO=BE+1; int CE=BE+n/2; int CO=CE+1; // trig lookups... for(int i=0; i<n/4; i++){ trig[AE+i*2]=(float)Math...
5
protected void appendQueue(Point curTileIJ,Point end) { Point p[] = new Point[8]; int withOrWithoutDiag; p[0] = new Point(curTileIJ.x, curTileIJ.y - 1); p[1] = new Point(curTileIJ.x - 1, curTileIJ.y); p[2] = new Point(curTileIJ.x + 1, curTileIJ.y); p[3] = new Point(curTileIJ.x, curTileIJ.y + 1); p[4] =...
5
@Override protected void initializationManagerGraphForm() { ArrayList<GraphicForm> graphicForms = new ArrayList<GraphicForm>(); graphicForms.add(new InformationForm(900, 568, 1500, 600, 800, 200, "Information", this)); graphicForms.add(new Radar(900-800+256, 568, 500, 400, 256,200, "Radar",...
0
protected void genClanStatus(MOB mob, Clan C, int showNumber, int showFlag) { if((showFlag>0)&&(showFlag!=showNumber)) return; mob.tell(L("@x1. Clan Status: @x2",""+showNumber,Clan.CLANSTATUS_DESC[C.getStatus()])); if((showFlag!=showNumber)&&(showFlag>-999)) return; switch(C.getStatus()) { case Clan....
7
private int getDir(char c) { int d = 0; switch (c) { case 'L': case 'l': d = 2; break; case 'R': case 'r': d = 8; break; case 'F': case 'f': d = 1; ...
8
public AuthenticatedService(Server server, String name, String type, Map<?, ?> config) throws Exception { super(server, name, type, config); log.debug("Finding the authenticator"); Object obj = config.get("authenticator"); if (obj != null && !(obj instanceof String)) throw new Exception("Problem loading c...
4
public String format(LogRecord lr) { Date date = new Date(lr.getMillis()); StringBuffer sb = new StringBuffer(); sb.append("<DebugAusgabe>").append(NEWLINE); sb.append("<LfdNr>"); sb.append(_numberFormat.format(lr.getSequenceNumber())); sb.append("</LfdNr>").append(NEWLINE); sb.append("<Zeitpunkt>"); ...
7
public static ArrayList<int[]> getBoxLocations(State state) { ArrayList<int[]> boxList = new ArrayList<int[]>(); int[] boxPosition = {0, 0}; ArrayList<ArrayList<String>> temp; temp = copy(state.getData()); for (int k = 0; k < temp.size(); k++) { for(int m = 0; m < temp.get(k).size(); m++) { if (temp.ge...
5
private PickVO getList100PVO(PickVO pvo, ArrayList<LineAnaVO> list100) { if (list100.size() > 7) { LineAnaVO v = getGap(0, list100); if (v != null) { pvo.add(v.getBnu()); } v = getGap(3, list100); if (v != null) { pvo.add(v.getBnu()); } v = getGap(4, list100...
8
private int cheminPlusLongVersRacine(Model model, Generalization g) { if(g == null){ return 0; } else { Generalization root = null; for(Generalization g_root : model.getGeneralization()){ for(String str_enfant : g_root.getArrayIdent()){ if(str_enfant.equals(g.getIdentifier())){ root = g_root...
4
private void btnbuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnbuscarActionPerformed //se toma lo que hay en la caja de texto y sele asigna a nombre String nombre = String.valueOf(txtNombreArchivo.getText()); //Se crea un objeto g de la clase General del Paquete Prog...
3
@Override public List<T> findAll() throws DaoException { waitCompete(); return new ArrayList<T>(getEntities().values()); }
0
public void runUpdate(String sql) { try { stat.executeUpdate(sql); } catch (SQLException ex) { Logger.getLogger(SQLHelper.class.getName()).log(Level.SEVERE, null, ex); } }
1
private static boolean testPhylogenyBranch() { try { final PhylogenyNode a1 = new PhylogenyNode( "a" ); final PhylogenyNode b1 = new PhylogenyNode( "b" ); final PhylogenyBranch a1b1 = new PhylogenyBranch( a1, b1 ); final PhylogenyBranch b1a1 = new PhylogenyBranch(...
9
@Override public boolean equals(Object o) { if (o instanceof Triangle) { Triangle t = (Triangle) o; int[] sortedSelf = new int[] { v0, v1, v2 }; Arrays.sort(sortedSelf); int[] sortedT = new int[] { t.v0, t.v1, t.v2 }; Arrays.sort(sortedT); for (int i = 0; i < sortedSelf.length; i++) { if (sorte...
3
public Mp3Loader( String filePath ){ in = null; valid = true; try { in = new FileInputStream( filePath ); } catch (FileNotFoundException e) { e.printStackTrace(); } int maxFrameCount = Integer.MAX_VALUE; // int testing; // maxF...
7
public void setNote(String note) { this.note = note; setDirty(); }
0
public static final Ptg calculateFunction( Ptg[] ptgs ) throws FunctionNotSupportedException, CalculationException { // the function identifier Ptg funk = ptgs[0]; int funkId = 0; //what function are we calling? // if ptgs are missing parent_recs, populate from funk XLSRecord bpar = funk.getParentRec(); ...
9
@Override public Map<String, ClassNode> load() throws IOException { Map<String, ClassNode> classes = new HashMap<String, ClassNode>(); Enumeration<JarEntry> entries = jar.entries(); while(entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (name.endsWit...
3
@Override protected int analyzeRequestPOST(HttpServletRequest request) { String timeString = request.getParameter("shutdown"); this.errors.clear(); if (timeString != null) { // Ошибка пустого ввода if (timeString.isEmpty()) { this.errors.add("Empty In...
4
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String s = Double.toString(d); if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0) { ...
7
public static List<String[]> readCSVFile(final String fileName, final String separator, final int expectedColumns) { final List<String[]> data = new ArrayList<String[]>(); FileReader fileReader = null; BufferedReader in = null; try { final File file = new File(fileName); if (!file.exists()) { throw...
7
public Tuote haeKuljetusmaksu() throws DAOPoikkeus { Tuote tuote = new Tuote(); // avataan yhteys Connection yhteys = avaaYhteys(); try { // Haetaan tietokannasta Kuljetusmaksu-niminen tuote String kuljetusQuery = "select nimi, hinta, tuoteID from Tuote where nimi='Kuljetusmaksu'"; Prepare...
2
private void calculateVelocities() { double r1 = Math.random(); double r2 = Math.random(); for(int i = 0; i < position.length; i++){ double[]cognitive = calculateCognitiveVelocity(i, r1); double[]social = calculateSocialVelocity(i, r2); for(int k = 0; k < position[i].length; k++){ velocities[i][k] = ...
2
public void remove(int wearID, int slot) { if(addItem(playerEquipment[slot], playerEquipmentN[slot])) { if(wearID == 6070) { npcId = 0; isNpc = false; updateRequired = true; appearanceUpdateRequired = true; } resetItems(3214); // THIS MIGHT ...
3
public void findPath() { chooser = new JFileChooser(); if(gamePath!= null) chooser.setCurrentDirectory(new java.io.File(gamePath)); else chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle(choosertitle); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); c...
3
public void actionPerformed(ActionEvent event) { Component source = null; lastFileOpened = false; try { source = (Component) event.getSource(); } catch (Throwable e) { // Might not be a component, or the event may be null. // Who cares. } // Apple is so stupid. File tempFile = fileChooser.get...
7
public static boolean accept(AbstractSyntaxNode node, TokenReader reader) { boolean result = false; if (Number.accept(node, reader) || FunctionCall.accept(node, reader) || Identifier.accept(node, reader)) { result = true; } else if (reader...
5
public int process(int signal) throws MaltChainedException { if (cachedGraph == null) { marking_strategy = OptionManager.instance().getOptionValue(getOptionContainerIndex(), "pproj", "marking_strategy").toString().trim(); covered_root = OptionManager.instance().getOptionValue(getOptionContainerIndex(), "pproj",...
9
private void buttonSearchActionPerformed(ActionEvent pEvent) { TableViewAdapter adapter = (TableViewAdapter) getModel(); List selection = getSelectedRowObjects(); if ("".equals(mTextFieldSearchTest.getText())) { adapter.search(mCurrentCollumn, null); } else { ...
4
public void paintComponent(Graphics g) { if (isLocked) return; isLocked = true; //g.setColor(Color.black); //g.fillRect(0,0,DynamicConstants.WND_WDTH,DynamicConstants.WND_HGHT); if (game != null) { if (isWaving) { PavoImage buffer = game.getBuffer(); Thread.currentThread().setPriority(Thread....
6
public IndexedModel toIndexedModel(){ IndexedModel result = new IndexedModel(); IndexedModel normalModel = new IndexedModel(); HashMap<OBJIndex, Integer> resultIndexMap = new HashMap<>(); HashMap<Integer, Integer> normalIndexMap = new HashMap<>(); HashMap<Integer, Integer> indexMap = new HashMap<>(); for...
8
int[] getRowGaps(ContainerWrapper parent, BoundSize defGap, int refSize, boolean before) { BoundSize gap = before ? gapBefore : gapAfter; if (gap == null || gap.isUnset()) { gap = defGap; } if (gap == null || gap.isUnset()) { return null; } ...
7
public AnnotationVisitor visitAnnotation(final String name, final String desc) { if (name != null) { cp.newUTF8(name); } cp.newUTF8(desc); return new AnnotationConstantsCollector(av.visitAnnotation(name, desc), cp); }
1
public static String toString(JSONObject jo) throws JSONException { StringBuffer sb = new StringBuffer(); sb.append(escape(jo.getString("name"))); sb.append("="); sb.append(escape(jo.getString("value"))); if (jo.has("expires")) { sb.append(";expires="); s...
4
public void visitFieldExpr(final FieldExpr expr) { expr.visitChildren(this); genPostponed(expr); if (expr.isDef()) { boolean UC = false; // Do we need an UC? // Look at the FieldExpr's object for a UCExpr Node check = expr.object(); while (check instanceof CheckExpr) { if (check instanceof UCEx...
5
@Override public List<Customer> getByName(String name) { List<Customer> found = new ArrayList<>(); for (Customer c : findRange(0, count())) { if (c.getFname().equals(name) || c.getLname().equals(name)) { found.add(c); } } return found; }
3
public static void main(String[] args) throws Exception { HashSet<String> set = getNamesWithCaseControl(); BufferedReader reader = new BufferedReader(new FileReader( new File( "C:\\Users\\corei7\\git\\metagenomicsTools\\src\\gamlssDemo\\genusPivotedTaxaAsColumnsNorm.txt"))); BufferedWriter writer...
6
public Liste getListe() { return liste; }
0
@Override public void huolehdi(){ int maxXnopeus = Math.max((int) h1.getVaakaNopeus(), (int) h2.getVaakaNopeus()); int maxYnopeus = Math.max((int) h1.getPystyNopeus(), (int) h2.getPystyNopeus()); int maxNopeus = Math.max(maxXnopeus, maxYnopeus); int maxNopeusVarmistettu = Math.max(1,...
4
@SuppressWarnings("static-access") private void ROUND1() { System.out.println("Round1:)))))"); for (int i = 0; i < level.getWidth(); i++) { for (int j = 0; j < level.getHeight(); j++) { if ((level.getPixel(i, j) & 0x0000FF) == 128) { Transform monsterTran...
3
public static void main(String[] args) { OptionBuilder.withArgName("Service"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Service type Exchange (MX) or Vault (DX)"); Option numRecs = OptionBuilder.create("s"); Options options = new Options(); options.addOption(numRecs); CommandLineP...
8
public void dumpSource(TabbedPrintWriter writer) throws java.io.IOException { if (predecessors.size() != 0) { writer.untab(); writer.println(getLabel() + ":"); writer.tab(); } if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_INOUT) != 0) { writer.println("in: " + in); } block.dumpSource(w...
5
public void undo() { if (!undo.empty()) { ArrayList<Delta> toUndo = undo.pop(); for (Delta d : toUndo) { d.undo(colorArr); } redo.push(toUndo); } }
2
public boolean printCluster2(StringBuilder sb, Collection<Line> lines, StringBounder stringBounder) { // Log.println("Cluster::printCluster " + this); final Set<String> rankSame = new HashSet<String>(); for (Line l : lines) { if (l.hasEntryPoint()) { continue; } final String startUid = l.getStartUid...
8
private int getLength () { // the size of all the table directory entries int length = 12 + (getNumTables () * 16); // for each directory entry, get the size, // and don't forget the padding! for (Iterator i = tables.values ().iterator (); i.hasNext ();) { Object tab...
3
@Override public void onAudioSamples(IAudioSamplesEvent event) { IAudioSamples samples = event.getAudioSamples(); for (int i = 0; i < samples.getNumSamples(); ++i) { int index = (int) (event.getTimeStamp(TimeUnit.SECONDS) / granularity); int amplitude = sample...
2
public void setUniversity(String university) { this.university = university; }
0
public boolean onCommand(CommandSender s, Command cmd, String commandLabel, String[] args){ Player player = (Player) s; if (cmd.getName().equalsIgnoreCase("psetwarp")){ if (args.length == 1){ World cWorld = player.getWorld(); String warpName = args[0].toLowerC...
6
public void writeNonTerminal(NonTerminalNode nt, String id) throws MaltChainedException { try { writer.write(" <nt"); writer.write(" id=\"");writer.write(id);writer.write("\" "); for (ColumnDescription column : dataFormatInstance.getPhraseStructureNodeLabelColumnDescriptionSet()) { if (nt.hasLab...
8
private static void infect(Organism o1, Organism o2) { if ((o1.timeSick < 0 && o2.timeSick < 0) || (o1.timeSick > -1 && o2.timeSick > -1)) { return; } if (o1.timeSick > -1 && o2.timeSick < DISEASE_RECURANCE_TIME) { o2.timeSick = o1.random.nextDouble() < o1.diseaseVirulence ? 0 : -1; } else if (o1.timeSick...
9
@Override public void execute(CommandSender sender, String[] args) { if (args.length == 0) { sender.sendMessage(new TextComponent(ChatColor.RED + "Usage: /pmreply <message ...>")); return; } if (!IRC.sock.isConnected()) { sender.sendMessage(new TextCompone...
5
public static String getSuffix(IrcUser u) { System.out.println("getsuffix");//debug for(String s : Suffixes) { System.out.println("suffixindb - " + s);//debug String[] split = s.split(" "); if(u.getSource().equalsIgnoreCase(split[0])) return split[1].repla...
2
public void setEnabled(Boolean isEnabled) { enabled = isEnabled; if(enabled) { rescheduleAlarm(); } else { scheduledTask.cancel(); } }
1
@SuppressWarnings({ "unchecked", "rawtypes" }) private Object unmarshalClass(Class reflector, Node node) throws InstantiationException, IllegalAccessException, InvocationTargetException { Constructor cons = null; try { cons = reflector.getConstructor((Class[]) null); ...
6
public Object getCellValue(HSSFCell cell) { Object o = null; switch (cell.getCellType()) { case HSSFCell.CELL_TYPE_NUMERIC: o = cell.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING: o = cell.getStringCellValue(); break; case HSSFCell.CELL_TYPE_BOOLEAN: o = cell.getBooleanCellValue(...
4
public BigDecimal[] subtractMean_as_BigDecimal() { BigDecimal[] arrayminus = new BigDecimal[length]; switch (type) { case 1: case 12: BigDecimal meanb = this.mean_as_BigDecimal(); ArrayMaths amb = this.minus(meanb); arrayminus = amb.getArray_as_BigDecimal(); meanb = null; break; case 14: thr...
3
public static void main(String[] args){ PropertyConfigurator.configure("rc\\log4j.properties"); Date d = new Date(); // Get config file logger.info(""); logger.info("========================================================================="); logger.info("---------------------------------------------------...
9
public static Rule parseTableChanges(Rule rule, TableItem[] items) { if (!items[1].getText(1).isEmpty()) rule.setDl_src(items[1].getText(1)); if (!items[2].getText(1).isEmpty()) rule.setDl_dst(items[2].getText(1)); if (!items[3].getText(1).isEmpty()) ...
8
final public void Uop() throws ParseException {/*@bgen(jjtree) Uop */ SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTUOP); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);Token t; try { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case FST:{ t = jj_consume_token(FST); ...
8
public String getBestLink(int[] seedArray, int[] leechArray, String mediaType){ /* * Determines the best link to pull the torrent from. */ float sizeMinimum; float sizeMaximum; if (mediaType.toLowerCase().equals("movie") || mediaType.toLowerCase().equals("movies")){ sizeMinimum = Variables.movieSizeMin...
9
public static String doPost(String urlString, Map<String, String> nameValuePairs) throws IOException { URL url = new URL(urlString); URLConnection connection = url.openConnection(); connection.setDoOutput(true); PrintWriter out = new PrintWriter(connection.getOutputStream())...
6
private void openDialog(){ JFileChooser fileOpen = new JFileChooser("./"); FileNameExtensionFilter filter = new FileNameExtensionFilter( "Algorythm workspace files .wks", "wks"); fileOpen.setFileFilter(filter); int ret = fileOpen.showDialog(null, "Open file"); if ...
2
public String[] getOptions() { Vector result; String[] options; int i; result = new Vector(); if (getDebug()) result.add("-D"); if (getSilent()) result.add("-S"); result.add("-N"); result.add("" + getNumInstances()); if (getE...
7
public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals(TRANSACTIONS_ELEMENT)) { parentElement = ROOT_ELEMENT; } if (currentElement.equals("transaction")) { xmlTransaction.append("</" + qName + ">"); } if (...
6
@Override public boolean placeResearvation(int rowNum, Column column, Passenger passenger) throws ClassCastException, IndexOutOfBoundsException, IllegalArgumentException, NullPointerException { if (!isInitialized) { throw new NullPointerException("Passenger List has not been initialized"); ...
6
public void setFilter(String filter){ if (captor != null) try { captor.setFilter(filter, true); } catch (IOException e) { e.printStackTrace(); } }
2
public void act() { // Add your action code here. try { if ( null != co ){ m = new Message("Check coin"); getWorld().addObject(m , getX(), getY()); Greenfoot.delay(delay); getWorld().removeObject(m); ...
5