method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
60c378d0-a5e8-4d9d-a932-8d0e81626290
2
@Override public void setTargetItem( DefaultBox<?> targetItem ) { if( comment == null ) { super.setTargetItem( targetItem ); } else { comment.setConnection( null ); super.setTargetItem( targetItem ); comment.setConnection( this ); } }
8ebb4fa2-63f5-442d-b863-ed00e0775c82
4
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...
ad3129a3-07eb-47ab-90ba-dbf36800c187
6
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...
041f7fea-3611-4845-97f0-2d11756d8456
8
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...
43a70030-30e4-4593-9a9a-5a658fa43974
4
@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...
742648b9-b379-4687-b218-8db5f01040a7
5
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...
61b74a44-4b3c-4ec3-9571-22d6f539d8d4
1
private void highlightRemaining() { editingGrammarView.dehighlight(); mainLabel.setText("Productions to convert are selected."); for (int i = 0; i < need.length; i++) editingGrammarView.highlight(need[i]); }
649d3dbf-dcee-48ca-bb16-a5c5c832ee70
5
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; } } } ...
6a6f5dd6-4ab3-4bc2-a49b-6473c55244b4
0
public void setId(int id) { this.id = id; }
bf40f3f0-d564-40bd-ba1c-4c9ef1f9910c
0
public String execute(String[] args){ return runList.toString(); }
782a0215-f222-4f93-84e1-6306f456f9ad
6
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++) {...
671531d0-56d9-4cd6-b768-0f2bb674047c
5
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...
5391c427-39ab-44a7-bd4e-49d15648422a
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) { ...
0cc402c0-ec16-4db0-a51d-da0553521dd2
6
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...
1d7105a9-8413-4e94-9a8a-93105547e198
9
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=...
f3bd5ace-c6df-4d77-9370-e59f0ba79cee
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...
ccec3e0e-210b-4b68-af49-85077b3fb5a4
0
public String getLocation() { return location; }
ee92ae7e-b75a-4204-80cd-35f964c55d4e
1
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...
82c9cd9d-26dc-4353-9b3d-2f87772e1dd9
9
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...
a7ecf9d5-1bed-4c99-ba69-2b2033bd5a5c
6
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...
abfa6213-4dff-40dc-a8d9-480d1140bb46
7
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...
a1252a5e-ea0d-4c75-9e92-9c174f6f7795
3
@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...
67e5cc1f-b327-4ee9-89f5-f4b3bac9ffca
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...
1a066077-d8e5-4b92-ba01-c399979733aa
4
@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...
f076e245-7ba0-4801-8707-f2da30fbf4ec
0
public Move move(Field from, Field to) { Move move = this.getMove(this.window.board, from, to, from.getPiece()); this.executeMove(move); return move; }
555826d9-8193-4ac0-88ec-07f70e92deb7
3
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...
1d1f93e3-b122-43bb-a3ac-01ba4333fa77
0
public static void main(String[] arsg) { printOutGameStateTransition("", ""); }
406b2dbb-9d19-43ed-b45b-9a0e5a35ac59
1
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...
690fd8a2-417d-40af-9ee4-3c91fac0ffa7
6
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 (...
6c43a786-2b10-4989-ab42-695a10cdb3a1
4
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!...
a8be3ccd-46cb-4fd1-8e2e-368c7c0e761e
7
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...
e492a648-8062-4825-b878-ae926b2ce749
2
@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...
67821d0e-9794-4df3-ab4e-fe1669a4a53d
5
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...
6f828a26-23be-4582-8450-ff77b74cfaf7
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] =...
90584189-9545-4439-b7c2-bf5ee22e84cc
0
@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",...
6f6b96a0-eeb9-44c9-ae8c-c4512cf07092
7
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....
acd62f61-47b7-4ff8-813d-addff04cc52f
8
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; ...
b505ef56-cec7-4597-b516-d62d93b64386
4
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...
60139a38-54fd-4d07-8d5a-7d700d0b0b21
7
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>"); ...
091a8d8a-b408-47be-9bf5-e8e8d9891cd9
5
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...
60c68095-3bc3-49a6-9a51-b06448309c44
8
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...
4c69fca7-5773-49b8-a482-88876882e0bb
4
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...
66106d84-6080-4d8c-bdf9-482ed56ce97f
3
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...
ec0b33ce-3a0c-4a44-a392-02deb8b81923
0
@Override public List<T> findAll() throws DaoException { waitCompete(); return new ArrayList<T>(getEntities().values()); }
4c746826-7af3-462a-8e63-ded79e82eaca
1
public void runUpdate(String sql) { try { stat.executeUpdate(sql); } catch (SQLException ex) { Logger.getLogger(SQLHelper.class.getName()).log(Level.SEVERE, null, ex); } }
9cf7caba-7049-461f-a074-1ebe4fa0e9e0
9
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(...
57f3fae7-3b76-4281-b025-54d80a3d2e0a
3
@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...
dcbc6670-a6d4-4263-b464-12e9d05f6b17
7
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...
ea9351ea-23dc-4518-b99e-33cf47db2765
0
public void setNote(String note) { this.note = note; setDirty(); }
7d88ecc8-8a4d-41e3-8d68-cdb5c22615f9
9
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(); ...
0e5abb55-06e7-437a-b513-a66770345f8f
3
@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...
54ce971d-5bae-49b5-8cb5-5911c999696d
4
@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...
b3064c0d-7858-4fe3-9c06-0c238677a651
7
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) { ...
a204f6f0-3234-4f57-b134-60ad1b140b50
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...
6952c270-2528-44fd-8ebe-e345789d5fc1
2
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...
e9650263-6981-4fd2-9387-010cf16cc229
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] = ...
f31c32d0-1112-4433-9bf8-53c601a0ffe5
3
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 ...
a892e0a6-7ac3-46d0-8d91-e8eeafaccae3
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...
0b151c56-02e4-4e32-a7cd-e22dcc922119
7
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...
8d5d5a3d-f071-43ed-b6c9-1da495a71724
5
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...
53796a0b-0281-4d4f-a110-3d9b02691881
9
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",...
6813a39a-9cfa-466b-93f4-802be646b495
4
private void buttonSearchActionPerformed(ActionEvent pEvent) { TableViewAdapter adapter = (TableViewAdapter) getModel(); List selection = getSelectedRowObjects(); if ("".equals(mTextFieldSearchTest.getText())) { adapter.search(mCurrentCollumn, null); } else { ...
bcca3f43-03d6-466b-8b4b-600063b5b930
6
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....
040f62c5-b24b-4a93-93a1-32e6d56c1375
8
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...
7bb206cb-2d74-4e88-b1cc-17937c3138b2
7
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; } ...
84b8611a-f480-405f-ac99-a3285eda9846
1
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); }
62e1cc6c-0b04-41f3-ac4f-e57a5ff450bf
4
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...
b396d2e6-409c-46bd-99ae-43aa03e1467b
5
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...
ea71880b-6471-4f59-8a13-3f52ca50138d
3
@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; }
0e6e3987-118f-4b46-ae88-c69eb8961dbf
6
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...
f0728ecc-d20b-43c0-b574-f04d941977a6
0
public Liste getListe() { return liste; }
fcd98f42-15e2-45fb-b233-0d06ab78cc3d
4
@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,...
d049cbfd-0bd7-4fd7-8ae4-895305778100
3
@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...
ea8ae420-ae4d-4e03-b421-1da45777d82d
8
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...
0fbf832a-1f94-440b-9c0d-c575374c6050
5
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...
2272b1c9-e726-4a9d-8e8d-c20cafc61ba5
2
public void undo() { if (!undo.empty()) { ArrayList<Delta> toUndo = undo.pop(); for (Delta d : toUndo) { d.undo(colorArr); } redo.push(toUndo); } }
9d5563e2-9bf5-4ddf-a0d7-463ebd4e6044
8
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...
9a9495c5-e6c1-4775-99a8-6b9f614ac77a
3
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...
3586dae3-4bfb-40ca-9123-d149fb609f93
2
@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...
44be7deb-5e43-4464-98a0-5e845d0fce3c
0
public void setUniversity(String university) { this.university = university; }
9c0d888b-b20d-4555-aefc-923f96492a91
6
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...
cc901adf-6a6b-4d68-9274-64ffb807ec42
8
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...
8414b6b1-7ef7-46c8-a73b-ffdd2a44d3a6
9
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...
cefaa1a7-9e43-40fd-846a-9ab817d3440d
5
@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...
0743e648-1299-47ba-915b-bc41f6b0b1fb
2
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...
6327e609-da6e-4a9e-9ef8-c2d5816b8125
1
public void setEnabled(Boolean isEnabled) { enabled = isEnabled; if(enabled) { rescheduleAlarm(); } else { scheduledTask.cancel(); } }
51c768dc-103e-46d0-822e-5a808b1f7016
6
@SuppressWarnings({ "unchecked", "rawtypes" }) private Object unmarshalClass(Class reflector, Node node) throws InstantiationException, IllegalAccessException, InvocationTargetException { Constructor cons = null; try { cons = reflector.getConstructor((Class[]) null); ...
972b4c7e-314b-49d3-8056-676bc3a510c3
4
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(...
2711f8ff-0610-458b-89e5-90f073347f09
3
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...
34c8bc39-5544-43e0-90de-411d38ba9f01
9
public static void main(String[] args){ PropertyConfigurator.configure("rc\\log4j.properties"); Date d = new Date(); // Get config file logger.info(""); logger.info("========================================================================="); logger.info("---------------------------------------------------...
f8d8339e-3cf6-4d1f-a94d-192fd49798f6
8
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()) ...
f0d879c2-7d7d-4e49-9eb6-cae4109bd672
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); ...
1ae3e1e7-3b69-46cd-a593-f0469e2faf43
9
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...
b7a28f8d-49e2-4271-a16c-c0cd9ba1e5c2
6
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())...
5649732a-7330-425c-9def-ce919b74441a
2
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 ...
e5cd30f8-0e35-49a7-831d-ae9b0b00e796
7
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...
5c334279-541b-48f0-8be0-7193b5c8a6b7
6
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 (...
153f8ae0-5188-4129-acdd-4fc585c8b322
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"); ...
e12e1c7f-084e-4322-8e69-fece7335aafb
2
public void setFilter(String filter){ if (captor != null) try { captor.setFilter(filter, true); } catch (IOException e) { e.printStackTrace(); } }
8358993e-4a02-4195-9188-f3a03f88a75c
5
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); ...