method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
bdb1fe81-eac6-4c93-9aa6-469e1517c56c
2
public void checkConsistent() { super.checkConsistent(); if (trueBlock.jump == null || !(trueBlock instanceof EmptyBlock)) throw new alterrs.jode.AssertError("Inconsistency"); }
c636ce5e-f65c-4fda-b07e-05e3c32eb2ed
5
public static void hexdump(final ByteBuffer buffer, final StringBuilder out) { final int start = buffer.position(); final int end = buffer.limit(); for (int pos = 0; pos < end; pos += ELEMENTS_PER_LINE) { out.append(String.format("%04X - ", pos)); for (int i=0; i<ELEMENTS_PER_LINE; +...
e20c8800-0f15-4034-9c23-f406c44c04b4
2
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened //ouverture windows chargement combobox fonction List<projetrf.model.Fonction> vv1 = null; try { vv1 = RequetesFonction.selectFonction(); } catch (SQLException ...
f37fe4a3-1624-459f-a87d-0c5a3e5edf31
7
@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost,msg); if((affected!=null)&&(affected instanceof MOB)) { if((msg.amISource((MOB)affected) ||msg.amISource(((MOB)affected).amFollowing()) ||(msg.source()==invoker())) &&(msg.sourceMinor()==CMMsg.T...
286e386e-fd95-48ee-8372-081cb64fd3b0
4
@Override public void caretUpdate (CaretEvent e) { int dot = e.getDot(); int mark = e.getMark(); int begin = Math.min(dot, mark); // int length = Math.abs(dot-mark); //try to find current ASection to edit currentASection = null; // if found mark the section with caret if((dot==mark) && (aDoc.getASection...
ee360175-0b73-4870-b9ad-4b28c9dee104
2
private void jList1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseClicked // TODO add your handling code here: if (evt.getClickCount() == 2) { int index = jList1.locationToIndex(evt.getPoint()); System.out.println("Double clicked on Item " + index); ...
895535bb-6983-4cb8-9767-6056449d81b6
0
@Override public void destroy() { node = null; }
22c3fdc9-ba4a-4522-a1b4-43822accbcc8
6
public GBoard() { //initializes the board board = new BlockType[HEIGHT][WIDTH]; clearBoard(); //defines edges of the board edges = new ArrayList<Point>(); for (int row = 0; row < board.length; row++) { for (int col = 0; col < board[row].length; col++) { if (row < 1 || row >= HEIGHT-1) edges.ad...
d4949dfa-13e1-4372-a283-c8fe2092530e
5
private void operaciones(){ boolean ok=true; int op; while(ok){ op=Pantalla.menuCuentas(); switch(op){ case 0: //salir cerrarFichero(); ok=false; break; case 1: //ingr...
dc9204e8-f15e-4031-b17f-e660cf24b2ca
6
public void calcAdjacencies() { // Iterates through every row and column, checking the validity of the cells on all four sides of a given cell. // If it is valid, it adds it to the adjList for (int i = 0; i < NUMBER_OF_ROWS; i++) { for (int j = 0; j < NUMBER_OF_COLUMNS; j++) { if (isValidCell(i + 1, j)) ...
ce49a34b-52e7-4965-a459-895a63ce9248
5
@Override public boolean checkTable(String table) { try { //Connection connection = open(); //this.connection = this.open(); Statement statement = connection.createStatement(); ResultSet result = statement.executeQuery("SELECT * FROM " + table); if (result == null) return...
adb786d7-c39c-4488-8259-b9b36622870b
9
private Result getResult(HttpURLConnection connection) { BufferedReader in = null; Printer.printWithTime(TAG, "receiving inputstream"); try { // get result stream from connection in = new BufferedReader(new InputStreamReader( connection.getInputStream())); } catch (IOException e) { // TODO Auto-ge...
87ed6e4e-47aa-45d7-ba48-4d3b74ae4d2b
0
public boolean getRight(){ return moveRight; }
af7f0327-defc-475d-ae45-e62cea2d830d
9
private static String replaceParameters(String msg, Object[] messageParameters, Locale locale) { if (messageParameters != null) { int count = 0; for (Object param : messageParameters) { if (param != null) { if (String.class.isAssignableFrom...
9c9df096-1016-46ac-8409-2604d6209b48
2
public void plotVandI(){ // Fill data arrays double [][] data = PlotGraph.data(4, this.numberOfPoints); double increment = this.segmentLength/(double)(this.numberOfPoints-1); data[0][0] = 0.0D; data[2][0] = 0.0D; for(int i=1; i<this.numberOfPoints; i++){ dat...
1b74f371-dd53-4fa5-9364-5a947f85f043
1
private void bAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAddActionPerformed try { App.ge.extractShapes(getGmlTextWrapped()); doClose(RET_ADD); } catch (XMLStreamException ex) { System.err.println(ex.getMessage()); JOptionPane.sh...
c49baaa7-5197-425b-b40c-227adcfa57af
0
public String getPINKeyId() { return pinKeyId; }
7e7cf56f-0031-4064-ad64-b53fdc557229
3
public void run() { while (pollingThread.isAlive()) { synchronized (server) { Iterator keys = keySet().iterator(); while (keys.hasNext()) { String key = keys.next().toString(); Integer port = (Integer) get(key); log.info("Checking User[" + key + "]-[" + port + "]"); server.s...
7d5af776-1cc4-4be6-a6fe-7e1814780fc9
7
public InvokeOperator(MethodAnalyzer methodAnalyzer, int methodFlag, Reference reference) { super(Type.tUnknown, 0); this.ref = reference; this.methodType = Type.tMethod(reference.getType()); this.methodName = reference.getName(); this.classType = Type.tType(reference.getClazz()); this.hints = null; Ma...
05700a96-4b00-4c89-9786-e63cd34cab81
6
public void testKeySet() { int element_count = 20; int[] keys = new int[element_count]; String[] vals = new String[element_count]; TIntObjectMap<String> map = new TIntObjectHashMap<String>(); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; va...
f02d16e5-9895-4f3b-80e8-381c03680f33
9
public void sanguinePrice(Player p){ if((p.inventory.contains(Card.veil) || p.inventory.contains(Card.veilii) || p.status.containsKey(Card.luxgearveil)) && !spectralImmune(p)){ int price = 6; if(p.avatar.groupClass == GroupClass.NEPHILIM && p.revealed){ price += 3; } if(p.inventory.contains(Card.veili...
1c5b6de1-0e93-4ca1-a3e1-f94ba5b5b804
3
public boolean equals(Object obj) { Users user = (Users) obj; if (this.uId != user.uId){ return false; } if (!this.userName.equals(user.getUserName())){ return false; } if (!this.email.equals(user.getEmail())){ return false; } return true; }
bb9259e8-406f-49e8-a8eb-0a26fa0f4fef
4
@Override public void init() { setSize(800, 480); setFocusable(true); addKeyListener(this); Frame frame = (Frame) this.getParent().getParent(); frame.setTitle("Bloom"); frame.setLocation(100, 100); frame.setResizable(false); try { base = getDocumentBase(); } catch (Exception e) { } setImages...
38410a27-4e70-4f00-9882-35f32c7856a4
1
public Transition getTransition(StateEnum stateFrom, EventEnum event) { Map<EventEnum, Transition> transitionMap = transitionFromState.get(stateFrom); return transitionMap == null ? null : transitionMap.get(event); }
3f9cd08b-80e2-432c-95ff-f94438293200
4
public void flatten(byte flattening) { // If flattening is one we can skip the calculations // since it wouldn't change anything. (e.g. 2 power 1 = 2) if (flattening <= 1) { return; } float[] minmax = findMinMaxHeights(); normalizeTerrain(1f); for (...
1ce4af3d-aa17-420e-b081-f80a2800e5ce
8
public static void main(String[] args){ finishedHTML = ""; final LinkProcessor linkProcessor = new LinkProcessor(); final SummaryProcessor summaryProcessor = new SummaryProcessor(); final ThemeProcessor themeProcessor = new ThemeProcessor(); final QuoteProcessor quoteProcessor = new QuoteProcessor(); Ripper...
23305e02-3ef8-4080-86ea-cb986259f7d8
1
private static void dayDirLog() throws Exception{ Date date = new Date(); //создание папки дня try{ String myDay = dayDirFormat.format(date); File myDayDir = new File(dateDir + "/" +myDay); myDayDir.mkdir(); dayDir = myDayDir.getAbsolutePath(); ...
0dc1663f-f1fc-4bb2-8966-42410f7c7f42
1
public void remove(Booking booking) throws InstanceNotFoundException { if (bookings.contains(booking)) { bookings.remove(booking); } else { throw new InstanceNotFoundException(booking, "Booking"); } }
34d31a5b-33b3-4f08-ae20-3a3198609384
2
@Override public boolean emailPasswordComboIsInDatabase(String email, String password) { String sql = "SELECT * FROM customer WHERE email='" + email + "' AND cust_password='" + password + "';"; Connection con = null; try { con = getConnection(); PreparedStatement statement = con.prepareStatement(sq...
462e8f17-e497-4606-b669-3256aacd1088
6
private String getMime(String extension) { String mime = ""; switch (extension) { case ".pdf": mime = "application/pdf"; break; case ".png": mime = "image/png"; case "....
dba74bc6-d936-4665-ada9-7ef27468b2a2
3
@Override public void caseAConstanteDeclaracao(AConstanteDeclaracao node) { inAConstanteDeclaracao(node); if(node.getConst() != null) { node.getConst().apply(this); } if(node.getIdentificador() != null) { node.getIdentificador().apply(this)...
d39a4e5f-1312-4cca-a8ec-153d391c58c8
8
public void update() { if(focus != null && focus.alive()) { x = focus.getX() - windowWidth/2; y = focus.getY() - windowHeight/2; mapExcess(); } else if(playerDeath || focus == null) { if(gameContainer.getInput().isKeyDown(Input.KEY_LEFT)) x -= 20; if(gameContainer.getInput().isKeyDown(In...
b2709474-2765-421c-b35a-1a1bee6b8e99
0
public void addSelectionListener(SelectionListener listener) { selectionListeners.add(listener); }
942bb0e8-1f9c-4d95-88a6-c2743d8d6b5c
2
public Message findUserByLogin(int id){ Message Msg = new Message(); String requete = "select * from Message where 'Id'=?"; try { PreparedStatement ps = MyConnection.getInstance().prepareStatement(requete); ps.setInt(1, id); ResultSet resultat = ps.executeQuery(); ...
1455f13e-15a0-44b9-a003-96b7d7aa7563
9
public int evaluateSurroundingRows(Position position, Token token, Map<Position, Token> tokenMap) { int row = position.getRow(); int column = position.getColumn(); Position[] position1 = { new Position(row, column), new Position(row + 1, column), new Position(row + 2, column) }; Position[] position2 =...
a15b9388-c17f-4dcd-b288-9346a6f5d71d
3
public Vector<BaseClass> getRankedClasses(int rank) { Vector<BaseClass> bc = new Vector<>(); for (ClassMap item : _classMap) { if (item.getRace().getName().equals(_race.getName())) { if (item.getAverage() == rank) { bc.add(item.getClassType()); ...
109e1e55-49a0-41b9-8d5b-e13db1531062
2
public ArrayList<UsuarioBean> getPage(int intRegsPerPag, int intPage, ArrayList<FilterBean> alFilter, HashMap<String, String> hmOrder) throws Exception { ArrayList<Integer> arrId; ArrayList<UsuarioBean> arrUsuario = new ArrayList<>(); try { oMysql.conexion(enumTipoConexion); ...
e24a0907-a1f3-4abd-91b0-0c2193a8de2e
7
public void mouseExited(HoverEvent event) { if (event.getSource() instanceof TabbedPanel) { TabbedPanel tp = (TabbedPanel) event.getSource(); tp.removeTabListener(tabListener); if (titleBarPropsAdded && tp.getSelectedTab() != null) { DockingWindow w = ((WindowTab) tp.getSelectedTab()).getW...
921c9af5-2a6d-4d17-a08b-862ffe284b4a
7
private boolean validaDados(String nome, String login, String email, char[] pass1, char[] pass2) { Sound teste = new Sound("/som/button.wav"); Sound erro = new Sound("/som/error.wav"); teste.play(); String msg = ""; boolean preenchido = true, verificacao; Validad...
817df974-d56d-45ae-ae29-56443379f085
7
public JButton createButton(final int index, String text) { JButton b = new JButton(); b.setText(text); b.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { switch (index) { case 0: ...
e4bfe8ff-7361-4164-9f94-556672c45916
7
public void start() { ConsoleReader consoleReader; try { consoleReader = new ConsoleReader(); } catch (IOException e) { throw new RuntimeException(e); } while(true) { int key; try { key = consoleReader.readVirtualKey...
81c2e1b0-9942-4a07-b145-f88830f3c132
2
private static int getSuperTypes(int types) { int result = 0; for (int i = 0; i < NUM_TYPES; i++) { if (((1 << i) & types) != 0) result |= superTypes[i]; } return result; }
6041972c-3006-4f0a-a2a0-26c21128c571
3
@Override public boolean isCompleteMatch(List<Character> currentMatching) { if(currentMatching.size() != 2) return false; if(currentMatching.get(0) != KeyMappingProfile.ESC_CODE) return false; if(!Character.isLetterOrDigit(currentMatching.get(1))) return f...
c7365ccc-e4e0-4374-9540-7f928a5b044b
0
public void rejectedExecution(Runnable runnable, ThreadPoolExecutor executor) { LOG.error(StringUtil.concatenateStrings("Failed to process - " + runnable.toString())); }
33b2c6e6-0bf2-4039-b3bf-9a42f7e3c68e
6
public void testNullArgs() { Client client = new ClientImpl(TEST_HOST, TEST_PORT); try { client.ignore(null); fail("didn't throw"); } catch (BeanstalkException be) { assertEquals("null tubeName", be.getMessage()); } catch (Exception e) { fail("caught unexpected exception: " + e.getClass().getCanoni...
5d35b102-0023-47c3-9008-ce8a95b26e1b
0
@Test public void createMoveFromStringTest() { Move move = new Move("R 5"); assertEquals("R 5", move.toString()); }
574d6edf-8dff-4e24-99ef-2e8f617aa1a5
3
@Override public void run() { while (isAlive) { int direction = new Random().nextInt(4); Position toPosition = calculatePosition(direction); try { sleep(new Random().nextInt(3) * 100); } catch (InterruptedException ex) { } ...
d3a86b38-19ef-4b45-9af6-d5f11eb9d9ff
1
@Override public String toString() { StringBuilder builder = new StringBuilder(); for (Sentence sentence : getElements()) { builder.append(sentence.toString()); } builder.append("\n"); return builder.toString(); }
42672fcc-7a50-43d0-9a6d-9c257b832061
0
public void setFesFecmod(Date fesFecmod) { this.fesFecmod = fesFecmod; }
1ceca60d-1be1-4b4f-8e8a-bd7f89d6d76f
0
public void setWeight(int weight) { this.weight = weight; }
68f4f422-6d29-4dbd-8ba5-0c58540fe9a6
9
private static void build(ArrayList<String> sentences) { for (String sentence : sentences) { String[] words = sentence.split(" "); int len = words.length; if (len < prefix_len) continue; // Set the first prefix to be the empty string's suffix String suffix = ""; for (int i = 0;...
a4cd7869-8fac-444c-a766-24af289800a1
8
public Double testModuleClinical(String thisNetwork, int limit, boolean flag){ if (this.stat.toUpperCase().equals("FISHER")){ return testModuleFisher(thisNetwork, limit); } String[] genes = thisNetwork.split(":"); HashSet<String> truePatients = new HashSet<String>(); String[] thesePatients; for (int ...
2f31aeeb-467c-4c32-a84e-f5f4746c98d2
1
public ResultSet listeMetaDonnee() { Connection connexion; java.sql.Statement requete; ResultSet resultat = null; try { Class.forName("org.sqlite.JDBC"); connexion = DriverManager.getConnection("jdbc:sqlite:dbged"); requete = connexion.createStatement(); resultat = requete.executeQuery("select * fro...
27d7ffe3-e56c-49c1-ab36-19028317a8ce
5
private boolean camposCompletos (){ if((combo_tipo.getSelectedIndex()>=0)&& (fecha.isFechaValida(field_desdee.getText()))&& (fecha.isFechaValida(field_hasta.getText()))&& (!field_tasa.getText().equals(""))&& (!field_sobretasa.getText().equals("")) ){ ...
29e35b02-dcb2-4676-84ae-3a3f025d62b9
0
public void setDesc(String value) { this.desc = value; }
00bc0bd0-9ce6-4135-8e08-e999fc764576
9
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ClassNotFoundException { Class.forName("org.sqlite.JDBC"); request.setCharacterEncoding("UTF-8"); String num_vuelo = request.getParameter("n...
14249963-2d2e-4232-8618-1a9d2756db07
8
public void sendAssignLFO(Receiver output_device, int lfoNum, int paramNum, int paramValue) { if (output_device == null) { return; } if (lfoNum < 0 || lfoNum > 15) { return; } if (paramNum < 0 || paramNum > 7) { return; } if (paramValue < 0 || paramValue > 127) { return; } byte b1 = (by...
9adeb682-7c9b-483b-9c25-9a87a9280a70
2
private KeyValuePair getKeyValuePair(String key) { KeyValuePair kvp; iter = bucket.iterator(); while(iter.hasNext()) { kvp = iter.next(); if(kvp.getKey().equals(key)) { return kvp; } } return null; }
d9f0f4a8-088d-4941-9f9d-e3e7eb4d8c2a
5
public void setBirthday(int b_d, int b_m, int b_y) { //Set borrower's birthday. If the date is incorrect, then set all as 0 in order to be checked later. if (b_d <= 31 && b_m <= 12 && b_y < 2015) { if (b_m == 2 && b_d > 28){ birthday.day = 0; birthday.month = 0; birthday.year = 0; } else{ birt...
f1368b72-7cd0-47f5-99a5-b57c2b28e003
5
@EventHandler(priority = EventPriority.LOW) public void onMobSpawn(CreatureSpawnEvent event) { int randomnum = (int) (Math.random() * 100.0D); Location spawnLoc = event.getLocation(); spawnLoc = spawnLoc.getWorld().getHighestBlockAt(spawnLoc) .getLocation(); spawnLoc.add(0.0D, 2.0D, 0.0D); World world = ...
095823f9-769d-4933-a00b-2721ad140cea
3
public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_W) { keyUp = true; } else if (e.getKeyCode() == KeyEvent.VK_A) { keyLeft = true; // } else if (e.getKeyCode() == KeyEvent.VK_S) { // keyDown = true; } else if (e.getKeyCode() == KeyEvent.VK_D) { keyRight = true; } }
089bf211-808d-47e0-be92-ee2618d2e066
2
void init() throws IOException { if(!initialized) { super.init(); for(int i=0; i<AVAILABLE_CPUS*2; i++) { newChunk(); } } }
8d38b7df-1e68-4c53-ad8e-83cfb39045bf
2
public LoyaltyProgram(int id){ SQLiteJDBC db = new SQLiteJDBC(); String sql = String.format("SELECT * FROM loyalty_programs WHERE id ='%d'", id); ResultSet resultSet = db.query(sql); try { if(resultSet.next()) { this.id = resultSet.getInt("id"); t...
36e332e2-4317-42a4-9582-46576f1d3630
8
public void determineIfOnSplit(Transcript t){ //It has been compared so mark it as having no spans. spanCount = 0; int startLocation = t.getProtein().indexOf(this.sequence); int test = t.getProtein().substring(startLocation + 1).indexOf(this.sequence); if(test != -1){ // U.p("Double peptide found!!"); co...
9b929acf-79ab-47ed-8c71-cf9bd3380c8e
8
private FileChannel initializeFile(String filePath, long fileSize) { /* Check to see if the file exists. Verify that it is a valid * PojoStick object store, and then do some further validations * to make sure that it is useable. If it doesn't exist, create * it. */ File newFile...
ff0f9acd-68fb-4964-b52d-01f6164e5f78
1
public void load(List<int[]> list){ int size = 0; for(int[] t : list){ size +=t.length; } target = new int[size]; firstArray = list.get(0); secondArray = list.get(1); }
a342ded2-6841-414a-8b79-a08e25f6f9d1
7
public Selection(Location pos1, Location pos2) { if(pos1.getWorld().equals(pos2.getWorld())) { this.world = pos1.getWorld(); this.pos1 = pos1; this.pos2 = pos2; int x1 = pos1.getBlockX(); int y1 = pos1.getBlockY(); int z1 = pos1.getBlockZ(); int x2 = pos2.getBlockX(); int y2 = pos2.getBlock...
491f638a-b99b-43f9-bd67-986091de2bc7
2
private static boolean isLocalChannel( Channel c ) { if ( c.isDefault() && BungeeSuite.proxy.getServers().containsKey( c.getName().split( " " )[0] ) ) { return true; } return false; }
81ba3130-a2fa-4432-8213-91d8c33f82ca
4
private String getLabelText(PieceType pieceType) { switch (pieceType) { case ROAD: return "Place a Road!"; case SETTLEMENT: return "Place a Settlement!"; case CITY: return "Place a City!"; case ROBBER: return "Move the Robber!"; default: assert false; return...
5f329303-494d-4e53-8eee-8c1dfa95fd74
5
private void borrowMenu() throws Exception { System.out.println("You chose to borrow something from the stock."); Boolean valid = false; Integer itemId = 0; while (!valid) { itemId = pickItemInStock(); if (itemId == -1) { // go back ...
5e0d9842-198b-4229-bc59-a70a2f1c09cc
0
public char[] getListeCouleur(){ return propriete.getProperty("couleur").toCharArray(); }
a7728961-9cb5-423c-93bb-d68b484ea50d
1
public static ArrayList<Excel> rotateZ(int angle, ArrayList<Excel> toScale) { ArrayList<Excel> result = new ArrayList<Excel>(); double matrix[][] = { {Math.cos(angle * Math.PI/180), Math.sin(angle* Math.PI/180),0,0}, {(-Math.sin(angle* Math.PI/180)),Math.cos(angle* Math.PI/180),0,0},...
b6c06aca-d5b5-45d0-a256-74df44e1b26b
9
@Override protected boolean includeInMigration(Element e) { if (e.getName().equals("user")) { return false; } String name = e.getChildText("name"); if (name.equals("admin")) { return false; } else if (name.startsWith("comment") || name.startsWith("sta...
c3506280-6101-41d7-a1c2-92d70a72b5a3
8
@Override public List<String> doTest() { List<String> result = new ArrayList<String>(); EARMARKDocument doc = getDocument(); result.add("\n[i] Check number of nodes"); Set<EARMARKChildNode> nodes = doc.getAllEARMARKNode(); String msg1 = "Number of node in the document, test"; if (nodes.size() == node...
ddffe43f-9761-44a0-98be-2f29a07f5a18
8
public static void mousePressed(MouseEvent mouseEvent) { Iterator<PComponent> it = components.iterator(); while(it.hasNext()) { PComponent comp = it.next(); if(comp == null) continue; if (shouldHandleMouse) { if (comp.shouldHandleMouse(...
3e818268-0a4e-4a86-b3d3-ad48ca7e32a1
5
private static String getSQL(String table) { InputStream is = null; BufferedReader br = null; String line; StringBuilder sb = new StringBuilder(); try { is = GateKeeper.class.getResourceAsStream("/sql/" + table); br = new BufferedReader(new InputStreamReader(is)); while (null != (line = br.readLine...
6c6845df-6b6a-45fa-8fed-85079cd53c3c
4
@Override public void run(){ try{ Socket socket=new Socket("localhost",1490); synchronized(this){ BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); String filename=sentFile.toStrin...
dcf4e0cf-a88b-4d19-97c5-3da36c50f5d5
0
public boolean getRegExp(int i) { return ((Boolean) this.regExps.get(i)).booleanValue(); }
7fc0dc45-3f3e-4d22-b58c-45a6f69ae952
2
public String join(String separator) throws JSONException { int len = this.length(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i += 1) { if (i > 0) { sb.append(separator); } sb.append(JSONObject.valueToString(this.myArrayL...
ea46f0fc-6396-424f-8b30-13c7e59af014
7
@Override public boolean execute(CommandSender sender, String[] args) { if(args.length > 1 && sender.hasPermission("plots.list.other")) { sender.sendMessage(GREEN+""+args[1]+" owns the following chunks:"); for(String chunk: this.p.getChunkManager().getOwnedChunks(args[1])...
e7cecb41-8a74-41b5-b8d5-9eb2d1ebb0f1
3
public boolean liesOnAxes(Point p) { return GenUtils.closeEnough(p.x, x, 1) || GenUtils.closeEnough(p.y, y, 1) || GenUtils.closeEnough(p.x, right, 1) || GenUtils.closeEnough(p.y, bottom, 1); }
a0838057-6124-401e-98ec-aa4fa3fac07d
7
private char yy_advance () throws java.io.IOException { int next_read; int i; int j; if (yy_buffer_index < yy_buffer_read) { return yy_buffer[yy_buffer_index++]; } if (0 != yy_buffer_start) { i = yy_buffer_start; j = 0; while (i < yy_buffer_read) { yy_buffer[j] = yy_buffer[i]; ++i; ...
29f893ac-8e65-4c6c-b7ae-ed24639f5b6e
1
public static void testFindFieldsbyName() throws Exception { try{ getDriver().get("http://www.google.com/webhp?complete=1&hl=en"); // assertEquals("Google", getDriver().getTitle()); // Find the text input element by its name WebElement element = getDriver().findElement(By.name("q")); ...
38ba45bb-62ce-4f28-aa5e-ed7b7b204e7c
3
@Override public int hashCode() { int result; long temp; result = cashCountId; result = 31 * result + (logTime != null ? logTime.hashCode() : 0); temp = amount != +0.0d ? Double.doubleToLongBits(amount) : 0L; result = 31 * result + (int) (temp ^ (temp >>> 32)); ...
aff318e1-0bc1-4a42-99b8-493b3b8b3720
2
@Override public void startSetup(Attributes atts) { String title = atts.getValue(A_TITLE); String id = atts.getValue(A_ID); // Add this panel to the PreferencesFrame. PreferencesFrame pf = (PreferencesFrame) GUITreeLoader.reg.get(GUITreeComponentRegistry.PREFERENCES_FRAME); // Add the preference p...
bd61a231-03b4-45b8-bd2f-6aaa61cb14f1
9
private void extractData(String[] param, int a, int b, int c, int d, int e) { int degree, minute, fraction; float latitude = Float.NaN, longitude = Float.NaN; if (param[a].length() > 8 && param[b].length() == 1) { degree = Integer.parseInt(param[a].substring(0, 2)); minute = Integer.parseInt(param[a].substr...
fa18c0a0-cc9b-408b-8c91-dfbfcf3a02c9
4
public void graphDrawScale(Graphics2D g2d) { for(int x = (int)(this.getPreferredSize().width/2); x <= (int)(this.getPreferredSize().width); x += (int)(xScale * xZoom)) { g2d.drawLine( x, (int)(this.getPreferredSize().height/2...
8b8a4102-6076-4cc2-8034-a3dc4eb8ccdd
0
public Distance prevDistance() { _setDistance(_currIndex-1); return _distances[_currIndex]; }
fe7da3d4-2c95-471c-a009-bed500aef08a
0
public String getName() { return result.Name; }
4949da34-9223-4b79-b088-2bddb23da5c5
5
private Gun getRandomGun() { switch (random.nextInt(5)) { case 0: return (Gun) Item.revolver; case 1: return (Gun) Item.laserRevolver; case 2: return (Gun) Item.shotgun; case 3: return (Gun) Item.assaultRifle; case 4: return (Gun) Item.crossBow; default: return (Gun) Item.bazooka; } }
7eaae58f-fd52-451b-9d3a-78cc1e03cbb2
3
@Override public void draw(Graphics2D g,float interpol) { // if (position == null) // updateDimsandPositions(); //Profiler.start(); g.setColor(Color.WHITE); g.setFont(getFont()); if (!isTextDetermined) { updateTextPosition(g.getFontMetrics()); isTextDetermined = true; } //Profiler.lapRe...
71cee438-ec5f-4ca2-8bf0-e22d71f81d1f
1
private void showTimes() { // Removing old data resultBox.removeAll(); // Prepare data for showing JPanel resultLine; for (int i = 0; i < results.size(); ++i) { resultLine = new JPanel(); results.get(i).putIntoPanel(resultLine); re...
8f214eeb-7285-4549-9a9c-c69d5ed2af6a
6
public int[][] getIntegerArray(int f[]) { int i = 1; int j = 1; int k = 0; int arrayCoeff[][] = new int[SIZE_BLOCK][SIZE_BLOCK]; for (int element = 0; element < SIZE_BLOCK * SIZE_BLOCK; element++) { arrayCoeff[i - 1][j - 1] = f[k]; k++; if ((i ...
359469e8-1bc0-4162-9af3-61dea1bc42db
6
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...
a6f4897f-e4a0-431b-a5a4-113c0d0216da
8
@Override public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp) { final java.util.Map<String,String> parms=parseParms(parm); final String last=httpReq.getUrlParameter("COMPONENT"); if(parms.containsKey("RESET")) { if(last!=null) httpReq.removeUrlParameter("COMPONENT"); retu...
e477f301-cbfe-43a7-a7f8-5139a6ecc073
9
Permission resolvePermission( PermissionEntry pe, GrantEntry ge, KeyStore ks, boolean resolve ) throws Exception { String className = pe.getKlass(); String name = pe.getName(); String actions = pe.getActions(); String signer = pe.getSigners(); ...
14782f7c-7a60-48bb-a11a-ebb6230bc573
1
@Override public String getActionCommand() { if (mOutlineToProxy != null) { return mOutlineToProxy.getActionCommand(); } return super.getActionCommand(); }
e1c2fbec-f53b-4075-9f61-30dfd68fdd1f
2
public void rayleighProbabilityPlot(){ this.lastMethod = 3; // Check for suffient data points this.rayleighNumberOfParameters = 1; if(this.numberOfDataPoints<3)throw new IllegalArgumentException("There must be at least three data points - preferably considerably more"); ...
f80744b7-cd6f-48c7-9b27-f507684f1c01
1
@Override public void run() { boolean quit = false; while (!quit) { } }
8e795293-010d-470e-9d18-a30fcfea2710
0
private void type(String locator, String nameF) { driver.findElement(By.name(locator)).clear(); driver.findElement(By.name(locator)).sendKeys(nameF); }