method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
a743d177-2d19-42e4-9784-1b3e002d6e43
0
public String getHexPeerId() { return this.hexPeerId; }
7e125687-c115-4e00-b2d9-0e134c4a29b4
0
private HeaderType(String type) { this.typeOf=type; }
45a4ffff-c673-46c7-890f-e8194cfed541
5
String []frequencey(double array[]){ // find mode. int [][]tools = new int[array.length][2]; String shed[] = new String [2]; double []check = array; int big = 0; ArrayList<Integer> counter = new ArrayList<Integer>(); int count = 0; for (int i = 0; i < array.leng...
74be39bc-490f-4298-ab55-74ad70eb68af
6
public void day() { List<Subject> movedAlready = new ArrayList<Subject>(); for (int i = 0; i < grid.getWidth(); i++) { for (int j = 0; j < grid.getDepth(); j++) { if (getSubject(i, j) == null || movedAlready.contains(getSubject(i, j))) { ...
d3fac04b-40f3-4358-a472-a715ae65cced
7
public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for (String line ; (line = in.readLine())!=null; ) { StringTokenizer st = new StringTokenizer( line ); int i = Integer.parseInt(st.nextToken()); int j = Integer.parseInt(st.ne...
9eadf934-94da-4edd-9b9f-bed819af8a76
7
public Boolean process() { // Permissions if(!plugin.permission.isAdmin(player)) { noPermission(); return true; } // Invalid args if(args.length < 3) { sendMessage("Usage:"); sendMessage("/casino type add <type>"); sendMessage("/casino type edit <type>"); sendMessage("/casino type ...
61ebfcea-7542-4848-bd96-d1c469b9774a
6
public void HoldIfNotActive(){ Iterator<Entry<CallFrame, List<String>>> linkBridgeIterator = linkBridgeLines.entrySet().iterator(); while (linkBridgeIterator.hasNext()) { Entry<CallFrame, List<String>> entry = linkBridgeIterator.next(); List<String> bridgeList = (List<String>) entry.getValue();...
5493b297-d5de-4ad8-8eab-9bfa7f8e1366
1
protected static String pumpString(String s, int i) { StringBuffer sb = new StringBuffer(); for(int n = i; n > 0; n--) sb.append(s); return sb.toString(); }
9e73e101-fd42-4b34-a626-48d6b078d22f
9
public static Hand findHighestStraight(Set<Card> cardSet) { CardSetStats stats = new CardSetStats(cardSet); if (stats.rankList.size() < 5) { return null; } Rank pointerRank = null; List<Rank> straight = new ArrayList<Rank>(); boolean containsAce = false; // used for wheel straight for...
0fd8e1bf-e80e-4fed-8b90-fb49cbcafaee
1
public static long imageToLong(String name) { name = name.toUpperCase(); long encoded = 0L; for (int i = 0; i < name.length(); i++) { encoded = encoded * 61L + name.charAt(i) - 32L; encoded = encoded + (encoded >> 56) & 0xffffffffffffffL; } return encoded; }
1f3f0922-f48f-4c32-8b87-7a3d1ca9edac
5
public List<MenuItem> getMenuChoices() throws RuntimeException { List<MenuItem> items = new ArrayList<MenuItem>(); try { // Make sure you always open a connection before trying to // send commands to the database. db.openConnection(DRIVER, URL, ADMIN, PAS...
3d76e09e-3990-484e-ae4b-3f9d499e0d68
5
private Calendar promptForDate(BufferedReader keyboard) throws IOException { Calendar date = new GregorianCalendar(); boolean valid = true; do { // Prompt and read input System.out .print("Task date (Format = DD/MM/YYYY, Default = today): "); String dateString = keyboard.readLine(); ...
44f32408-73ba-4e7f-9c9e-2b1d07c3237e
3
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); }...
76741b3e-660b-4254-8819-cf8667e63a12
7
public boolean func_48457_a(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5) { if (par5 == 0) { --par3; } if (par5 == 1) { ++par3; } if (par5 == 2) { --par4; } if (par5 == 3) ...
bc972a8f-8e8a-47ea-a6dd-bec687e148e6
0
@Override public String toString() { return getURLString(); }
3e894692-f505-459c-a22e-da9c76f427ff
7
public void renderBackground(SpriteSheets sprite, boolean clouds) { int pixelIndex; for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { int xAbs = x + cameraXCoord; int yAbs = y + cameraYCoord; pixelIndex = (xAbs) + (yAbs) * sprite.getXSheetSize(); if(xAbs > 0 && yAbs > 0 && xAbs <...
3fa7f9f0-f299-4eb8-af7f-01c348d70cee
5
private static void assemblyC(ArrayList<Integer> cList){ //"spaja" listy wszystkich cykli w jedną listę ułożoną w kolejności asmC.addAll(cycles[cList.get(0)].vxList); cList.remove(0); do{ for(int i : cList){ if(asmC.get(asmC.size()-1) == cycles[i].vxList.get(0)){ //jeżeli ostatni == prerwszy asmC.addA...
db21a78b-5f32-49f2-bc62-4a619b2d5d4e
2
public boolean inServerDB(Connection con, String file_path) { boolean result = false; try { PreparedStatement ps = con .prepareStatement("SELECT * FROM db_like_files WHERE path_local = ?"); ps.setString(1, file_path); ResultSet rs = ps.executeQuery(); if (rs.next()) { result = true; } else {...
d01e3090-c50e-4a69-a450-ff79f5d0a829
1
public static void main(String args[]){ System.out.println("Usage of MySQLAccess Object..."); try { MySQLAccess dbAccess = new MySQLAccess(); dbAccess.register(); dbAccess.connect(); dbAccess.createStatement(); //dbAccess.markerIsTaken(1, "kash098"); //dbAccess.deletePlayer("dice098"); //dbA...
b2cf957c-ae55-4316-8f6e-043af4331473
0
@RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView index() { return new ModelAndView("index"); }
55ad06ae-83b6-4ef3-b55a-eb54a4071579
1
@Override public boolean scan(String c) { if (mapOfProductsList.containsKey(c)) return scanProducts.add(c); return false; }
ccfc9864-5471-4e45-a886-3687b044b38e
7
public void doLoad(String path) { FileInputStream inputStream = null; ObjectInputStream deserializer = null; try { inputStream = new FileInputStream(path); deserializer = new ObjectInputStream(inputStream); dictionary = (Map<String, TreeSet<Document>>) deseria...
8f210a62-9177-4ca1-9234-916f0a7ac941
3
private static void sqlStore(Status status) throws SQLException{ long sql_pid = Settings.pid; Settings.pid++; SimpleDateFormat tempDate = new SimpleDateFormat("yyyy-MM-dd, HH:mm:ss, z"); String sqlCreateAt = tempDate.format(new java.util.Date(status.getCreatedAt().getTime())); double sqlGeoLocationLat = 0...
caa2193d-a55d-4ef4-893f-c15a485169a9
0
@Override public double access(Balance balance) { return balance.getBalance(); }
1db1f606-ec05-4525-9814-779b645d1803
1
public Button(JButton button) { this.button = button; button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { if (clickHandler != null) clickHandler.run(); } }); }
71585850-77c9-434b-97d8-3aeebc62f19e
7
public boolean setTileNoUpdate(int var1, int var2, int var3, int var4) { if(var1 >= 0 && var2 >= 0 && var3 >= 0 && var1 < this.width && var2 < this.depth && var3 < this.height) { if(var4 == this.blocks[(var2 * this.height + var3) * this.width + var1]) { return false; } else { ...
b3fcf1e3-07bd-40cf-aa3a-17121cb9a698
4
public int[] bigPower(int pN, int pn){ int[] number = new int[(int) Math.ceil(Math.log10(pN)*pn) + 1]; java.util.Arrays.fill(number,0); number[0]=pN; for(int n = 1; n < pn; n++){ for(int i = 0; i < number.length; i++){ number[i] = number[i]*2; } for(int j=0;j<number.length;j++){ if(number[j]>...
788f37af-77e1-4494-9263-be883f56aea2
1
public void sendMessage(Message msg){ try{ b.writeObject(msg); }catch(Exception e){ e.printStackTrace(); } }
5745be07-197f-4074-9362-2324a1e2d05a
3
protected boolean isVector (double x, double y, double z) { if(x != 0 && y != 0 && z != 0) { return true; } return false; }
dafd4f84-4003-4532-acbd-8254d06a0001
5
public static int getRegimeOfGame(){ Scanner scanner = new Scanner(System.in); int regimeOfGame = 0; System.out.println("Please choose regime of game:"); System.out.println("1 - Two players on one computer"); System.out.println("2 - Player vs computer"); System.out.printl...
5b69ffef-5475-45eb-a72e-4dc6fdde1c93
9
public static void TrieIntTreeDemo() { TrieTreeAPI<Integer> api = new TrieTreeAPI<Integer>() { @Override public Integer[] toArray(Object integer) { String valueStr = integer.toString(); char[] valueChars = valueStr.toCharArray(); Integer[] value = new Integer[valueChars.length]; for(int i=0;i<va...
917785c1-c806-4c8f-9488-487c944313f0
5
public void update() { if(!stallListen) { up = Keys[KeyEvent.VK_UP] || Keys[KeyEvent.VK_W]; down = Keys[KeyEvent.VK_DOWN] || Keys[KeyEvent.VK_S]; left = Keys[KeyEvent.VK_LEFT] || Keys[KeyEvent.VK_A]; right = Keys[KeyEvent.VK_RIGHT] || Keys[KeyEvent.VK_D]; } }
d8dd9f00-0367-4d1b-b067-fdeb3ae69de4
4
public boolean find(int value) { System.out.println("happen " + this.value); if (value == this.value) { return true; } else if (value > this.value) { if (right == null) return false; return right.find(value); } else { if (left == null) return false; return left.find(value); ...
4f4cf409-511b-442a-b9ae-a6f4b56b5cdf
7
@Override public void actionPerformed(ActionEvent e) { if (e.getSource().equals(anteriorBt)) { anterior(); } else if (e.getSource().equals(proximoBt)) { proximo(); } else if (e.getSource().equals(gravarBt)) { gravar(); } else if (e.getSource().equals(apagarBt)) { apagar(); } else if (e....
78f777c8-56a4-434c-8817-af1667296e81
0
public String get(String key){ return configproperty.get(key); }
dcf81ad9-37f4-4fbe-920f-154cf09f5452
6
private void updateTopBottom(int myRoot, int destRoot) { if (toTop[myRoot]) { toTop[destRoot] = true; } else if (toTop[destRoot]) { toTop[myRoot] = true; } if (toBottom[myRoot]) { toBottom[destRoot] = true; } else if (toBottom[destRoot]) { toBottom[myRoot] = true; } ...
2b5b03d1-7f69-43c6-b2c3-7178d46a04ff
0
@Override public String toString() { return "{VirtualReplayGain}"; }
5ee07e97-e66c-4a6c-a7ee-4a99e6fbca4c
0
public static void main(String[] args) { Grammar g=new ContextFreeGrammar(); Production[] p=new Production[5]; /* p[0]=new Production("S","bAC"); p[1]=new Production("A","C"); p[2]=new Production("A","a"); p[3]=new Production("B","bAE"); p[4]=new Production("C","cC"); p[5]=new Production("C","B"); p[6...
4711c939-f9bc-460c-a2a1-600b2b0a2d1e
5
@Test public void deepMiddleTest() { IntArray arr = IntArray.from( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26); for(int i = 8; i >= 6; i--) { arr = arr.remove(i); } for(int i = 15; i >= 9; i--) { arr = arr.remo...
fe434f56-fa3b-4171-884f-da6eb0e6cf2f
9
public boolean exists(){ String path = Directory.toString(); //Special case for a directory whose path represents a server name (e.g. "\\192.168.0.1") if (isWindows && path.startsWith("\\\\")){ if (path.endsWith(PathSeparator)) path = path.substring(0, path.length()-1); ...
7dffe130-ccbf-4dad-a912-20e28738193d
3
@Override public double[] get2DData(int px, int pz, int sx, int sz) { double[] sa = a.get2DData(px, pz, sx, sz); double[] sb = b.get2DData(px, pz, sx, sz); double[] sw = weight.get2DData(px, pz, sx, sz); int s = sx*sz; for(int i = 0; i < s; i++) { double w = sw[i]; i...
e968efb4-82b5-4ffa-8440-915da5779db1
7
public boolean compleixRes(Clausula c, ClausulaNom cn) { String d = cn.getDia(); Integer h = cn.getHora(); int g = c.getGrup(); if(h !=-1 && dia != null){ if (!CompleixResDiaHora(c.getAssignatura(), g, d, h)) return false; } else if(dia!=null){ if ...
6d64e679-58a1-482c-9699-abdde7924e2a
4
@Override public Operation simplify() { Expression L = Simplify.mod(this.L); Expression R = Simplify.mod(this.R); if ( "1.0".equals(R.getString()) ){ return L.operation; } else if ( "0.0".equals(L.getString()) ){ return new Number(0); } else if ( "x".equals(L.getString()) && "x".equals(R.getString()) )...
53398f37-038c-40e1-a42f-f3d1e1c0c0b8
9
private void setLanguageComboBox(JComboBox comboBox) { ItemListener[] il = comboBox.getItemListeners(); for (ItemListener i : il) comboBox.removeItemListener(i); if (Locale.getDefault().equals(Locale.US)) comboBox.setSelectedIndex(0); else if (Locale.getDefault().equals(Locale.CHINA)) comboBox.setSelec...
d2d96722-1317-43a2-9015-e962af30ca5c
3
public static void main(String[] args) { try { Configuration configuration = new Configuration(); configuration .set("header", "id,tstamp,Queue Time,Hold Time,Talk Time,Agent Skill,Agent Tenure,Case Severity,Answer Within Service Level,Brand,Case Status,Product,Vendor,Location,Customer Satisfaction,...
6d92a493-39bc-4a2a-808b-ab3954b2b868
6
@RequestMapping(value = "/hello2/{names}/{ages}", method = RequestMethod.GET) @ResponseBody public String testMatrixVariable(@MatrixVariable(pathVar = "names", required = false, defaultValue = ValueConstants.DEFAULT_NONE) Map<String, List<String>> names, @MatrixVariable(pathVar = "ages", required = false) Map<String,...
286e16dc-c1ae-451f-b10d-a808b6dc994e
1
@Override public void remove(ClienteBean oClienteBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.removeOne(oClienteBean.getId(), "cliente"); oMysql.desconexion(); } catch (Exception e) { throw new Exception("ClienteDao.removeCl...
66abd572-21f0-4cb3-990d-5a9a61b675da
5
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBorderCollision(PlayerMoveEvent event) { Player player = event.getPlayer(); User user = EdgeCoreAPI.userAPI().getUser(player.getName()); Location location = player.getLocation().clone(); Location spawnLoc = player.getWor...
4b87d46b-115e-4509-968a-3db2dc2a85bb
1
@Override public String toString() { StringBuffer s = new StringBuffer(); int counter = 0; for (MatterInterval mi : intervals) { s.append("" + (counter++) + " : "); s.append(mi.toString() + "\n"); } return s.toString(); }
20489396-171d-428a-b671-2accfac3c4f2
7
public Card[] contains(Hand h) { Card[] nums = {null, null}; for(int i = 0; i < deck.size(); i++) if(deck.get(i).getValue() == h.getCard(0).getValue()) for(int j = 0; j < deck.size(); j++) if(deck.get(j).getValue() == h.getCard(1).getValue() && i != j) ...
56ceb03b-82e5-4bf6-9aa1-fd9cd793bdb8
5
public void updateDeletePicturefromAlbum(String filePath){ this.albumDao.deletePicture(filePath); String albumName = ""; for(PictureObject f: pictureList){ if(f.getPath().equals(filePath)) pictureList.remove(f); albumName = f.getAlbum().getAlbumName(); } files.setPictureList(pictureList); if(album...
2808de86-ea61-49f3-86c3-6be34a0e89b5
4
@SuppressWarnings({ "unchecked", "rawtypes" }) public Generator() { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setTitle("ASM Generator"); setBounds(100, 100, 500, 351); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayo...
0176ba31-8799-499b-8599-be6455fdeb3c
8
public Card draw(boolean from_throwpile) { synchronized(Rummy.this) { if (Rummy.this.getCurrentPlayer() != p.getPlayer()) return null; } if ((player_state != PlayerState.EXPECTING_DRAW) && (player_state != PlayerState.DEALING)) return null; Card c = null; if (!hand.holdingExtraC...
e6eec4ae-3232-4147-89e6-eb70068371cb
2
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try { String nome = jTextField1.getText(); String descricao = jTextArea1.getText(); int ano = Integer.parseInt(jTextField3.getText()); double valor = D...
cd164acc-4e79-4870-bec8-bf8a059ecc38
8
private Constant parseMemberLookup(byte refKind, List<Object> args) { // E.g.: lookup().findStatic(Foo.class, "name", MethodType) if (args.size() != 4) return null; int argi = 0; if (!"lookup".equals(args.get(argi++))) return null; short cindex, ntindex, nin...
63752bd7-8289-4346-b202-e56988c05512
3
public String toString() { if (this == UNINITIALIZED_VALUE) { return "."; } else if (this == RETURNADDRESS_VALUE) { return "A"; } else if (this == REFERENCE_VALUE) { return "R"; } else { return type.getDescriptor(); } }
9d4186a4-d921-4feb-b7cf-4a86a7948333
8
@Override public void run() { if (SwingUtilities.isEventDispatchThread() == false) { long WAIT = 1500; while ((System.currentTimeMillis() - this.myStamp) < WAIT) { try { long delay = WAIT - (System.currentTimeMillis() - thi...
3c351c42-e535-4322-a28d-84747add4623
5
public int read( ) throws IOException { String bits = ""; int bit; int decode; while( true ) { bit = bin.readBit( ); if( bit == -1 ) throw new IOException( "Unexpected EOF" ); bits += bit; decode = codeTree.getChar( bits ); if( decode == HuffmanTree.INCOMPLETE_CODE ) continue; el...
38678f39-cef8-4337-88d1-87857b2401a4
9
public List<OSMWay> readWaysFromOSMFile(Document doc) { List<OSMWay> osmWays = new ArrayList<OSMWay>(); NodeList waysList = doc.getElementsByTagName("way"); // NOTICE: don't put this into condition part of a for-loop, // because getLength() is a O(n) function. int length = waysList.getLength(); ...
256f15ac-26b9-40ad-8d13-d17615f8c886
6
@Override protected void addNewChildrenToOpen(SearchNode parent) { boolean[] percepts = board.getPercepts(parent.location.x, parent.location.y); int danger = 0; for(int i = 0; i < 2; i++) if(percepts[i]) danger++; Point location = parent.getLocation(); SearchNode node = createSearchNode(location.x, l...
f3d07421-86f9-47b7-92c3-0a99af0d1da3
5
private void updateTabla(){ //** pido los datos a la tabla Object[][] vcta = this.getDatos(); //** se colocan los datos en la tabla DefaultTableModel datos = new DefaultTableModel(); tabla.setModel(datos); ...
c4d043cb-1ca0-47ab-8a20-8826f3f28dea
6
@Override public void caseAProgram(AProgram node) { inAProgram(node); if(node.getPrograma() != null) { node.getPrograma().apply(this); } if(node.getId() != null) { node.getId().apply(this); } if(node.getInicio() != null) ...
1efd5ffd-1942-47a5-a05a-a2ab9cc32f39
1
@Override public Long getLongProp(String key, Long value){ Long result = value; String propValue = getProperty(key); if (null != propValue){ result = new Long(propValue); } return result; }
5851a932-3fd6-49b1-8a85-3bb4e4d07b57
0
public int f() { return 1; }
feb6049d-7a0d-47c7-935a-b0dbe88bd3ca
1
public File getFile( String fname ) { JFileChooser fc = new JFileChooser(); fc.setSelectedFile( new File(fname) ); int result = fc.showSaveDialog(new JFrame()); File recvfile; if (result == JFileChooser.APPROVE_OPTION) { recvfile = fc.getSelectedFile(); filename = recvfile.getAbsolutePath(); //System...
34b5b130-6b71-47b3-a6c2-48355f721b06
8
@Override public final void mouseDragged(MouseEvent me) { int sliderIndex = 0; for (TButton slider : sliders) { if (slider.inUse) if (orientation == VERTICAL) { slider.y = me.getY() - 12.5f; if (slider.y < y) slider.y = y; else if (slider.y > y...
6321df34-c6b7-422f-8f03-1ff7d5e9a9e3
5
private static void bootStrap() throws InstantiationException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException { // print the classpath // String classPath = System.getProperty("java.class.path"); // System.out.printf("JVM classpath: %s\n", classP...
f7bc17e7-fe00-4bf0-b5c8-06c92885a400
4
public static String selectAccountType(){ Scanner scan = new Scanner(System.in); do{ System.out.printf("\n***TIPOS DE CUENTA***\n1-%s\n2-%s\n3-%s\nEscoja uno: ", PLANILLA, NORMAL, VIP); int opt = scan.nextInt(); switch(opt){ case 1: ret...
d8b23e27-98c2-4463-8bff-c297104c644e
5
public int spaceFor(Service good) { switch (upgradeForGood(good)) { case (-1) : return 0 ; case ( 0) : return 20 ; case ( 1) : return 35 ; case ( 2) : return 45 ; case ( 3) : return 50 ; } return 0 ; }
dd08bedd-ca8b-4d5f-abd2-5c4133b081b1
0
protected void transitionChange(AutomataTransitionEvent event) { invalidate(); }
962e4129-cd9e-4b10-8d8c-5baf1bda0ade
9
public static void loadOptionsFile() { File file = new File("options.ini"); if (file.exists()) { BufferedReader br; try { br = new BufferedReader(new FileReader(file)); String tempString; try { while ((tempString...
1d7a3812-c8a5-4404-9fb9-1b99ba3c8f5f
0
public void setName(String name) { Name = name; }
1f352d7d-9b6f-4174-9f24-6f05c2aac884
7
public GerirEscolasEquipas(AssociacaoEscolasFutebol a) { this.a = a; this.a.addObserver(this); initComponents(); this.setVisible(true); for (Escola escola : a.getDAOEscola().values()) { Escola_ComboBox.addItem(escola.getNome()); } for (Escola escola ...
e183c3d8-0978-4224-abb8-3e1a855ab7ae
4
public static String getPlayerFromUUID(final UUID uuid) { if (uuid == null) return null; final Map<UUID, String> players = getPlayers(Arrays.asList(uuid)); if (players == null) return null; if (players.isEmpty()) return null; if (players.get(uuid) == null) { throw new Nul...
f08b2bef-cbde-45f4-b663-e7d77e9aa7a7
1
@Override public void fromMessage(Message message) throws JMSException { try { inputStream = ((BlobMessage) message).getInputStream(); } catch (IOException e) { logger.error("Can't get input stream.", e); } }
6159d968-c013-4606-b218-c04a6f933eb5
0
public void setX(int x) { this.x = x; }
0d0af45a-fac6-42d6-adb9-36cafd37ee57
6
public void addNode (int coefficient, int exponent) { if (head == null) { head = new Node(coefficient, exponent); return; } if (head.exponent < exponent) { Node added = new Node(coefficient, exponent); added.next = head; head = added; return; } else if (head.exponent == exponent) { ...
a5fd164e-0c23-4f34-8d48-3e446e719b26
0
public void setPerson(PersonBean person) { this.person = person; }
f607d87f-b227-4cc8-a666-fd7d74a1a909
9
public final void parameters() throws RecognitionException { try { // Python.g:99:12: ( LPAREN ( varargslist )? RPAREN ) // Python.g:99:14: LPAREN ( varargslist )? RPAREN { match(input,LPAREN,FOLLOW_LPAREN_in_parameters261); if (state.failed) return; // Python.g:99:21: ( varargslist )? int alt10=2; ...
cc0f207e-4038-45a4-a458-141e43346a52
6
@Override public void run(int interfaceId, int componentId) { Master master = (Master) player.getTemporaryAttributtes().get( "SlayerMaster"); if (stage == -1) { stage = 0; sendEntityDialogue(SEND_4_OPTIONS, new String[] { SEND_DEFAULT_OPTIONS_TITLE, "How many monsters do I have left?", "Wh...
262970fb-23dd-496f-8871-4ee4498c24e3
5
public static boolean handleOption(int option, int longind, String arg) { if (arg == null) options ^= 1 << option; else if ("yes".startsWith(arg) || arg.equals("on")) options |= 1 << option; else if ("no".startsWith(arg) || arg.equals("off")) options &= ~(1 << option); else { GlobalOptions.err.print...
316e25f4-4b5c-4ff8-a326-201adbe02929
7
private void checkObstacleBounds(boolean positiveSide, float delta, float half) { positionCenter = originalCenter + delta; if (positiveSide) { positionCorner = Math.abs(originalCorner + delta); delta = 0.5f * (positionCenter + positionCorner - half); if (delta > 0) { positionCenter -= delta; positi...
808fa6b2-e533-455b-b88d-69b09455ee93
1
private static void drawHistogram(GC gc, int x, int y, int[] histogram, int MAX, int width, int height) { int gap = 1; gc.setForeground(Colors.red); int thickness = 5; gc.drawRectangle(x - thickness, y - thickness, 256 * gap + 2 * thickness, height + 2 * thickness); gc.setForeground(Colors.blue); gc.setLi...
f72e2693-cf3c-4443-b2e1-01ced1d4f06e
3
public String toString () { if (!isDisposed () && (parent.getStyle () & SWT.VIRTUAL) != 0 && !cached) { return "CTableItem {*virtual*}"; //$NON-NLS-1$ } return super.toString (); }
73d36269-728b-4ea8-88ab-9347d0d3dc96
3
private int calcNumberOfNodes(double serialProb, double pow2Prob, double uLow, double uMed, double uHi, double uProb) { double u = random.nextDouble(); if (u <= serialProb) {// serial job return 1; } double par = twoStageUniform(uLow, uMed, uHi, uProb); if (u <= (serialP...
b478a933-9e1e-4036-85c0-4d195893dcba
0
@Override public void mouseExited(MouseEvent e) {}
00bc156b-63de-41b5-a81e-c6f719fc3c84
3
Client1() throws IOException { String s; System.out.println(getCurrentTime() + "::" +"Starting Client .."); clientSocket = new Socket("localhost", 38000); serverIn=new DataInputStream(clientSocket.getInputStream()); serverOut=new DataOutputStream(clientSocket.getOutputStream()); /*--------Reading file from ...
1b207fe6-85b6-4878-bd13-10ec30ef5aa3
1
private void downloadIfNeeded(String videoID) throws Exception { if ( !cacheContains(videoID) ) downloadParseSave(videoID); }
c4670369-1e87-4acd-9713-35d632106053
4
private void process_incoming_soap() { try { // Copy output stream to input stream to simulate // coordinated streams over a network connection. coordinate_streams(); // Create the "received" SOAP message from the // input stream. SOAPMessa...
94a48764-281a-404b-99d2-c6a58379ca9a
0
ListeTableModel(ArrayList<Metadonnee> listeMetadonnees) { this.liste = liste; }
05f471b2-584b-4200-bc93-65773839f863
7
public static void main(String[] args) { String jobName = ""; String jobId = null; // set command line usage Arguments.usage = usage; // get command line arguments Arguments arguments = new Arguments(args); jobName = arguments.getOptionalArgument("Default Job Name"); System.out.println("jobName: " + jo...
61d54b42-4a11-4bf9-b300-1a074ba7c3d2
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Square other = (Square) obj; if (x == null) { if (other.x != null) return false; } else if (!x.equals(other.x)) return false; if (y...
6306c848-4d35-449d-91a4-17468f5cc6cb
0
@Test public void test_gold(){ assertNotNull(pawn); assertEquals(gold, pawn.getGold()); }
918d3b0f-24f3-4ced-8ea6-a9edef7c8434
4
public void update(Activity activity) throws InstanceNotFoundException { boolean found = false; Iterator<Activity> iter; iter = activities.iterator(); while (iter.hasNext() && !found) { Activity a = iter.next(); if (a.equals(activity)) { found = true; a.setPlaces(activity.getPlaces()); a.setPr...
79522982-c47c-4d82-a332-867489d929dc
7
@Override public boolean onCommand(CommandSender sender, ItemStackRef itemStackRef, Command command, String label, String[] args) { // Check the player is holding the item ItemStack held = itemStackRef.get(); if (held == null || held.getTypeId() == 0) { sender.sendMessage(plugin....
ef66e96e-4661-4a0d-838f-961857a67e9f
5
public int getRetainPercentage(Player player) { if (plugin.getWorldGuardClass().isWorldGuardReady()) { RegionManager regionManager = wgPlugin.getRegionManager(player .getWorld()); if (regionManager != null) { ApplicableRegionSet set = regionManager .getApplicableRegions(player.getLocation()); ...
5fff2688-985b-4fa8-8da0-3b8722530811
2
public static double[][] sub( double[][] mat1, double[][] mat2 ) { int m = mat1.length; int n = mat1[0].length; double[][] matres = new double[m][]; for ( int i = 0; i < m; ++i ) { matres[i] = new double[n]; for ( int j = 0; j < n; ++j ) matres[i][j] = mat1[i][j] - mat2[i][j]; } return(matres); }
bbec5671-87b2-4bb7-9f59-7bdb625c4fa2
2
private static void initStuIDVec() { StuIDs.clear(); unAssignedStudents.clear(); for (int i = 0; i < Students.size(); i++) { Student thisStu = new Student((Student) Students.get(i)); StuIDs.add(thisStu.getID()); unAssignedStudents.add(thisStu.getID()); } System.out.println("initStuIDVec"); for (int...
2369e1de-6d4e-4983-8cfe-a4a90e309849
5
public static TreeNode commomAncestorWithBinarySearchTree(TreeNode p,TreeNode q,TreeNode root){ if(root==null){ return null; } if(root.data > p.data && root.data < q.data){ return root; } TreeNode left = commomAncestorWithBinarySearchTree(p,q,root.left); if(left!=null){ return left; } TreeNode ...
7992548d-85f4-45cd-ae34-4e999ecb0696
3
private ArrayList<String> removeHTMLCommands(ArrayList<String> array) { for (int i = 0; i < array.size(); i++) { if (array.get(i).contains("<") || array.get(i).contains(">")) { array.remove(i); i--; } } return array; }