method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
b08aed58-5016-4971-adb9-1e779d77d134
0
public boolean[][] getBooleans() { return grid; }
f363a4c4-9645-41c2-abde-85befbd86752
3
public boolean checkPermission(CommandSender sender) { if ((this.permission == null) || (this.permission.length() == 0) || (sender.hasPermission(this.permission))) { return true; } sender.sendMessage(ChatColor.RED + "Insufficient permissions"); sender.sendMessage(ChatColor.RED + "Requires " + permission); ...
bfb826f2-6650-4766-9f5a-a156888e97d7
4
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null) { return false; } if (getClass() != other.getClass()) { return false; } State that = (State) other; return colorToPlay == that.colorToPlay && Arrays.deepEquals(squares, that.squares); }
ed3e1c43-c37c-4dcf-a61f-96fd30771690
1
public Svd (Matrix[] toBeSvdMat, boolean codeCbCr) { svdResult = new SingularValueDecomposition[3]; matU = new Matrix[3]; matV = new Matrix[3]; matS = new Matrix[3]; svdResult[0] = new SingularValueDecomposition(toBeSvdMat[0]); matU[0] = svdResult[0].getU(); mat...
d58f3e13-8616-4e23-944e-a10c82be95fa
3
public OverviewPane(Gui gui) { this.gui = gui; try { font = Font.createFont(Font.TRUETYPE_FONT, OverviewItem.class.getResourceAsStream("/font/arvo.ttf")).deriveFont(Font.PLAIN, 24f); } catch (Exception e) { font = new Font(Font.SERIF, Font.PLAIN, 24); } listPane = new JPanel(); listPane.setLayou...
bd6baefe-db1f-464a-9caa-7c667d4868b5
0
public void depositar(double valor) { this.saldo += valor ; }
9666d30d-05f3-4992-95ef-39dd3a0e9c3c
6
@EventHandler public void MagmaCubeNausea(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getMagmaCubeConfig().getDouble("MagmaCube...
3218e5f3-8296-4505-b667-589e98e49538
4
@Override public void draw(GL2 gl) { if(skyTexture == null) { loadTexture(textureToLoad); } if(parentPanel != null) { GLU glu = GLU.createGLU(gl); if(skyTexture != null) { skyTexture.enable(gl); skyTexture.bind(...
f4948431-2d89-4185-9a36-f85c1e50bad9
3
private static boolean isFX2 (Device dev) { DeviceDescriptor desc; if (dev == null) return false; desc = dev.getDeviceDescriptor (); // Only the cypress development platform uses these IDs if (desc.getVendorId () == 0x04b4 && desc.getProductId () == 0x8613) return true; // Other products will hav...
dc64ae64-5bd4-4c94-9099-54a903262b76
3
private static void inputCheck(int port, int windowSizeN, int timeout) { if (port > 65535 || port < 1024) { System.err.println("Port number must be in between 1024 and 65535"); System.exit(1); } if (windowSizeN < 0) { System.err.println("Window size must be larger than 0"); System.exit(1); } }
2e9a1bf6-6c96-48bb-87f1-a54215d110a8
4
public boolean isInPanesSelector(int mouseX, int mouseY){ if (mouseX > 800 && mouseX < 1280){ if (mouseY > 0 && mouseY < 288){ return true; } } return false; }
d0e890e5-a969-41a6-a320-26e9a26662e7
2
public void testAddPartialConverterSecurity() { if (OLD_JDK) { return; } try { Policy.setPolicy(RESTRICT); System.setSecurityManager(new SecurityManager()); ConverterManager.getInstance().addPartialConverter(StringConverter.INSTANCE); f...
d9b194ed-28cf-4f41-aa78-002c9f3424d7
7
public static final String trimTrailingZeroes(String text, boolean localized) { if (text == null) { return null; } int dot = text.indexOf(localized ? LOCALIZED_DECIMAL_SEPARATOR.charAt(0) : '.'); if (dot == -1) { return text; } int pos = text.length() - 1; if (dot == pos) { return text; } whi...
c4a01280-62ec-4630-aef7-92e3f34eed30
5
public TetrisTormays(Tetrimino tetrimino, Pelialue pelialue) { tormaykset = new ArrayList<Tormays>(); if(tetrimino.palikkakokoelma().lisattyja() <= 0) return; try { for(Palikka palikka : tetrimino.palikkakokoelma().palikat()) { ...
537dcfcb-d1b4-41b3-9f1e-398f63d5525f
1
public TabContainer(int width, int height) { super(JTabbedPane.BOTTOM); setBorder( BorderFactory.createEmptyBorder(-2, -1, 1, -3) ); GUI.setPreferredSize(this, width, height); addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent...
e3e9d9df-d02c-4c2e-b130-b4a50bc5930c
1
public int beforeBind() throws RemoteException { /* * The ID to this server, it will compose the serviceName, like this: * ServiceID */ int nid = nextServerID(); try { System.out.println("Server " + RemoteServer.getClientHost() + " asked a ID, sending " + nid); } catch (ServerNotActiveException...
70848de7-b388-4ce8-86d5-583936e46b9e
1
public List<CategorieType> getCategorie() { if (categorie == null) { categorie = new ArrayList<CategorieType>(); } return this.categorie; }
ab83eedd-eb6d-4f48-809f-ed083f5a47c8
2
public void setCommissionRate(double rate) { if (rate > 0.0 && rate < 1.0) commissionRate = rate; else throw new IllegalArgumentException( "Commission rate must be > 0.0 and < 1.0"); }
b5f8077d-164b-43fe-9466-37efeb443766
1
public static double getBalance(String uid) { if(checkUserExistance(uid)) { UserStorageAccess xmlAccessor = new UserStorageAccess(); return xmlAccessor.getUserBalance(uid); }else { return 0; } }
5d5d9a7c-cbea-429a-85bc-6a7cb61785b3
3
void doPermute(char[] in, StringBuffer outputString, boolean[] used, int inputLength, int level) { // System.out.println(outputString.toString()); // System.out.print("used: "); // for (boolean c : used) { // System.out.print(c + ","); // } // System.out.println();...
b0f53e20-f5b6-4a0d-b91d-46c4c323eaae
8
public boolean mobs(MOB mob, List<String> commands) { if(commands.size()<3) { mob.tell(L("You have failed to specify the proper fields.\n\rThe format is DESTROY MOB [MOB NAME]\n\r")); mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell.")); return false; } Stri...
6e0216f4-a83c-4dcf-a2b7-21dd538bdb70
5
public String RecieveMessages(){ byte[] data = null; try { int length = inputStream.read(); data = new byte[length]; length = 0; if (length != data.length) ...
52247969-3953-4ebf-9e57-a9fc40ef4152
3
@Override public void takeTurn(GameBoard currentBoard) { Random rand = new Random(); int randomlySelectedRow = 0; int tokensInRow = 0; ArrayList<Integer> validRowNumbers = new ArrayList<Integer>(); int[] validRowNumberValues = { 1, 2, 3 }; for(int i: validRowNumberValues){ validRowNumbers.add(i); }...
aaad32fa-0675-4b21-8931-4476d8d35d77
4
public synchronized boolean startsWith(byte[] seq) { if (seq.length > buffer.length) throw new IllegalArgumentException(); if (seq.length > bsize) return false; for (int i = 0; i < seq.length; ++i) { if (seq[i] != buffer[(offset + i) % buffer.length]) return false; } return true; }
42adaab5-9a5e-4307-886b-06a4ba624dee
9
public static double sinh(double x) { boolean negate = false; if (x != x) { return x; } // sinh[z] = (exp(z) - exp(-z) / 2 // for values of z larger than about 20, // exp(-z) can be ignored in comparison with exp(z) if (x > 20) { if (x >= LOG_MAX_VALUE) {...
869e47a6-e93d-498a-83b4-afd841a79d6e
3
public static boolean isUnix() { String OS = System.getProperty("os.name").toLowerCase(); return (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("") >= 0 || OS.indexOf("aix") >= 0); }
93f845aa-7c0b-4351-94b8-3202244b4d19
4
public static String qualifyPatternString( String pattern ) { pattern = StringTool.strip( pattern, "*" ); pattern = StringTool.strip( pattern, "_(" ); // width placeholder pattern = StringTool.strip( pattern, "_)" ); // width placeholder pattern = StringTool.strip( pattern, "_" ); pattern = pattern.rep...
1b0d1e68-e5d5-41d1-ad54-2d1ee74f8603
9
public static void update() { if (nextWave <= 0) { if (monsters.size() > 0) { new Thread() { @Override public void run() { EnumMap<Monster, Integer> monsters = WaveManager.monsters.clone(); WaveManager.monsters.clear(); int leftLength = 0; int rightLength = 0; int...
ee3ada30-0aac-4b64-bad7-8431b1314810
2
public static Color get(ChatColor color) { for (TeamColor enumm : TeamColor.class.getEnumConstants()) { if (enumm.toString().equals(color.toString())) { return enumm.getColor(); } } return null; }
d8f03272-04e9-4af4-a7c7-2e6dcd15eae7
7
private void triFusion(int debut, int fin) { // tableau o� va aller la fusion int[] tFusion = new int[fin - debut + 1]; int milieu = (debut + fin) / 2; // Indices des �l�ments � comparer int i1 = debut, i2 = milieu + 1; // indice de la prochaine case du tableau tFusion � remplir int...
7bab29bd-c32a-404e-9df8-65957d0a0ea8
2
protected void verifySize() throws MatrixError { if (width < 1) throw new MatrixError("Width of matrix must be greater than 1"); if (height < 1) throw new MatrixError("Height of matrix must be greater than 1"); }
8e474ab6-e934-4028-83a8-d069e4ec2953
8
void setExampleWidgetSize () { int size = SWT.DEFAULT; if (preferredButton == null) return; if (preferredButton.getSelection()) size = SWT.DEFAULT; if (tooSmallButton.getSelection()) size = TOO_SMALL_SIZE; if (smallButton.getSelection()) size = SMALL_SIZE; if (largeButton.getSelection()) size = LARGE_SIZE; ...
411d86dc-dac6-4493-ac1c-efb983b8c790
0
public boolean isOutgoing() { return !isIncoming(); }
e563d9ac-aade-4d60-a0df-6df32c09e117
6
public String toJSONString() { StringBuilder json = new StringBuilder(); json.append( "{" ); if ( className !=null && className.length()>0 ) { json.append( "\"class\":\"" ); json.append( className ); json.append( "\"," ); } if ( id ...
91d6b371-2efa-44fc-8456-940f570545b6
8
private boolean r_prelude() { int among_var; int v_1; // repeat, line 36 replab0: while (true) { v_1 = cursor; lab1: do { // (, line 36 // [, line 37 bra = cursor; // substring, line 37 among_var = find_among(a_0, 3); if (among_var == 0) { break lab1; } // ], line 37 ...
63142afc-ab7a-4c62-b282-e8c4181fab3f
0
public double getRelativeX() {return pos.getX();}
2083e597-d13e-4910-b32d-0c16c5ae9dfd
6
private void setMainPanel() { //getsections according to examId getSections(examId); sectionChosen = new JCheckBox[sections.size()]; sectionLabels = new JLabel[sections.size()]; //set editbuttons, editbuttons and sectionlabels for (int i = 1; i < sections.size() + 1; i...
16e9835a-7f43-4f40-b117-1afc1956fd08
8
public static int overallMines(MineGen theGrid, int gridX, int gridY) { // This method receives the coordinates of the square that is on the overall grid // and returns the number of its closest mines. int a = gridX; int b = gridY; int mineCount = 0; if (theGrid.hasMine(b, a + 1)) mineCount++; if (th...
82882691-f313-442b-898a-bf75831d9c3b
4
public void encryptFile(String filePath, byte[][][] subKeys) { System.out.println(); System.out.println("Encrypting"); try { final File inputFile = new File(filePath); final File outputFile = new File(filePath + ".des"); final InputStream inputStream = new Bu...
71be2ac2-66db-4354-b756-587a248b3bd7
2
@Override public Entity createEntity() { Entity enemyEntity = new Entity(entityManager, entityManager.createEntity(), new Spatial(0, 0, enemyGraphic.getWidth(), enemyGraphic.getHeight()), new Draw(enemyGraphic, DrawOrder.ENEMY), new MinimapDrawn(0xFFFFFF), // random AI, just for testing new...
68940647-caae-4c29-8f57-2d662c59b52d
5
public static Vector getOffset(BlockFace facing) { if (facing == null) return new Vector((int)(Smelter.WIDTH / 2), (int)(-Smelter.HEIGHT / 2), 0); if (facing.equals(BlockFace.NORTH)) { return new Vector((int)(Smelter.WIDTH / 2), (int)(-Smelter.HEIGHT / 2), 0); } else if (facing.equals(BlockFace.EAST...
a98824eb-70c5-414a-bdba-bb2ee6f24039
1
private void buildComponents(Container window) { if (window instanceof Frame) frame = (Frame) window; window.setFont(new Font("dialog", Font.PLAIN, 10)); classpathField = new TextField(50); classField = new TextField(50); sourcecodeArea = new TextArea(20, 80); errorArea = new TextArea(3, 80); verbose...
0424df99-08f6-457f-b663-47632a14b9b2
6
@Override public void mouseReleased(MouseEvent e) { try { int[] koords = haeKoordinaatit(e.getSource()); if (koords != null) { int mouseEvent = e.getButton(); switch (mouseEvent) { case 1: avaaYksi(koords[0]...
0ea158b3-935d-490b-b730-795a4fd431eb
8
@Override public void renameRooms(Area A, String oldName, List<Room> allMyDamnRooms) { final List<Room> onesToRenumber=new Vector<Room>(); for(Room R : allMyDamnRooms) { synchronized(("SYNC"+R.roomID()).intern()) { R=getRoom(R); R.setArea(A); if(oldName!=null) { if(R.roomID().toUpperC...
c0b59491-4ed8-4eb0-9729-ad6ddc947c43
2
public static byte get(byte[] header, byte[] data, int i) { if (i < header.length) { return header[i]; } if (i - header.length < data.length) { return data[i - header.length]; } return (byte) 0x00; }
4f2b9f04-8fc8-4eab-894e-2315f99d6659
4
private void calcSum(int p, int currentFrame) { for (int f = 1; f <= currentFrame; f++) { scoreBoard[p][2][f] = scoreBoard[p][2][f-1] + scoreBoard[p][0][f] + scoreBoard[p][1][f]; if (scoreBoard[p][0][f] == 10){ if(scoreBoard[p][0][f+1] == 10){ scoreBoard[p][2][f] = scoreBoard[p][2][f]+scoreBoard[p][0][...
4dd7573f-af2d-4fa3-a183-4d443279a4b3
8
public void getEventStream(CallBack callback) throws MalformedURLException, IOException { HttpRequest request = generateRequest("/eventstream", new TreeMap<String, String>(), false); ApiResponse response = null; response = streamApi(request); BufferedReader br = new BufferedReader(new InputStreamReader(resp...
36c054e7-6cfd-4528-83f7-3703ac67b359
1
public NodeList getNodeList(String tagName) throws ParserConfigurationException, SAXException, IOException{ // Sucht nach die tagName tags if(current==null){ return xmlFile.getElementsByTagName(tagName); } return current.getElementsByTagName(tagName); }
dd128697-5f9a-4f4b-aff5-21c39d89145d
4
public Principal authenticate(final String username, final String credentials) { logger.info("authenticate called for user: " + username ); CommunityAccount purported = (new SQLStatementProcessor<CommunityAccount>("SELECT * FROM valid_accounts WHERE username = ?") { CommunityAccount process( PreparedStatem...
cbcabe8f-e27e-4e38-a33c-1820d3de07eb
0
public HashMap<String, HostInfo> getHosts(){ return this.hosts; }
77d4a20c-55dd-47ba-8e9d-cdfbf3bb242b
0
public void warn(String message) { log(Level.WARNING, message); }
961efacf-2dc3-4552-ac60-dcf61fed817d
4
protected Boolean process(String command){ File script; String suffix = ".sh"; if(SystemUtils.IS_OS_WINDOWS){ suffix = ".bat"; } if((script= setData(command, suffix))==null){ return false; } script.setExecutable(true); //starts and wait for the process ProcessBuilder pb = new ProcessBuilder("."+...
c19a83d7-07b9-4aa9-9627-4b0c59088e85
4
public static byte[] InputStreamToByte(InputStream in) { int BUFFER_SIZE = 4096; ByteArrayOutputStream outStream = null; byte[] data = new byte[4096]; int count = -1; try { outStream = new ByteArrayOutputStream(); while ((count = in.read(data, 0, BUFFER_SIZE)) != -1) { outStream.write(data,...
a4676657-9a8c-46bb-a6a4-6072f2bec6c2
2
public void go(){ // 1 получить json с инстаграмма while(run){ try { process(getRecent()); Thread.sleep(timeout); DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date today = Calendar.getInstance().getTime(); ...
bdbf18ff-21e1-4018-9a83-6934a3906804
1
public static void doTowers(PrintWriter out,int topN, char from, char inter, char to) { if (topN == 1){ out.println("Ring 1 from " + from + " to " + to); }else { doTowers(out,topN - 1, from, to, inter); out.println("Ring " + topN + " from " + from + " to " + to); doTowers(out...
af3efe34-279d-4681-a5b3-081a6053c106
7
public static byte[] getMacAddress() { if(cachedMacAddress != null && cachedMacAddress.length >= 10) { return cachedMacAddress; } try { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while(networkInterfaces.hasMoreElements()) { NetworkInterface network = ne...
7d2a69e5-f66d-4357-abdc-0ccd7d1d5d0f
0
public Integer interpret(Context ctx) { // this 为调用interpret 方法的Variable 对象 return ctx.LookupValue(this); }
0126b6de-35a9-46fc-822c-e317af37d960
9
private SolveStateEnum solve() { try { boolean run1 = true; while (run1 && solveState != SolveStateEnum.ERROR) { int starCount = getStarCountInRiddle(); checkByBlock(); if (starCount <= getStarCountInRiddle()) { solveState = SolveStateEnum.MUST_...
a54c6d6f-9610-4108-a197-5530169ded24
3
public int overColumnDivider(int x) { int divider = getColumnDividerWidth(); int count = mColumns.size() - 1; int pos = 0; for (int i = 0; i < count; i++) { TreeColumn column = mColumns.get(i); pos += column.getWidth(); if (x >= pos - HIT_SLOP && x <= pos + HIT_SLOP) { return i; } pos += divi...
ecab70f4-7b3e-48fa-8a6c-b82f667e56fe
0
@Test public void testStartPlagiatsSearchInt() { assertEquals(0, 0); }
4a7d9d7f-8919-4e0a-997c-05b2ec40d4ec
1
public ArrayList<AbilityType> getAbilities() { ArrayList<AbilityType> abilities = new ArrayList<AbilityType>(); for (int c = 0; c < activeEnchants.size(); c++) { abilities.add(ActiveWeaponEnchant.getAbility(activeEnchants.get(c))); } return abilities; }
6601573d-84ce-40fd-b28b-761e3ec27a23
5
@Override public void handleCollision(Actor other) { if(other instanceof Projectile){ hitPoints -= ((Projectile) other).getDamage(); } else if ( other instanceof Asteroid || other instanceof actor.ship.Ship){ // Don't collide with our siblings if(other.getParentId...
a2a8bc76-f40c-492b-a64f-11974309cc2c
7
public void testSetValue() { Integer scalar = 0; List<Integer> list = Arrays.asList(1, 2, 3); ListELResolver resolver = new ListELResolver(); ListELResolver resolverReadOnly = new ListELResolver(true); // base == null --> unresolved context.setPropertyResolved(false); resolver.setValue(context, null, "fo...
0b601bf3-bf7f-481f-bb9b-68a0d3aff989
5
public double getLatticeAngle(double arcFraction) { if (arcLattice == null) { generateArcLattice(); } if (arcFraction < 0) { return 0; } double hemispherePortion = (int)(arcFraction / 0.5) * Math.PI; double remainderArcLength = (arcFraction % 0....
c93cc54c-49ff-4f4f-bb29-6199b7a60486
3
private static String constructNEPerson(String input, String verb) throws InvalidFormatException, IOException { if (!verb.equals("") && !verb.equals("is")) { return "Did you " + verb + " " + nameFinderChatbot.findNames(input)[0] + "?"; } else if (verb.equals("is")) return "Nice to meet you " + nameFinder...
33ea9733-91d4-459f-a6e6-d5da02716bb4
5
public int CheckAdd() throws SQLException { int NbreAjout=0; ResultSet R=M.exec("SELECT value FROM variable WHERE ID=1"); if(R!=null && R.absolute(1)) { int x=R.getInt("Value"); ResultSet RS=M.exec("SELECT COUNT(*)FROM message"); if (RS!=null && RS.absolute(1)) { int y=RS.ge...
534b4acb-16da-4600-b974-223bb94b7cbb
4
@Override public void run() { ServerSocket serverSocket = null; try { serverSocket = new ServerSocket(this.port); //If no haertbeat from worker process ... then timeout. serverSocket.setSoTimeout(ACCEPT_TIMEOUT); while(true) { Socket clientSocket = null; try { clientSocket = serverSocket....
9434e50c-3c0e-449d-afd4-4fdafa0fe515
7
private Mode extractRuleMode() throws XMLStreamException, ParserException { String modeName = ""; boolean isModeNegation = false; Tag startTag = currTag; if (Tag.NOT.equals(currTag)) isModeNegation = true; do { int event = reader.next(); switch (event) { case XMLStreamConstants.START_ELEMENT: c...
a9f625c0-ab93-4fd3-adbb-42882f05ccad
6
public boolean canPlaceRoad(EdgeLocation edgeLoc) { if (!playingRoadBuildingCard) { if (presenter.getState().getStatus().equals("FirstRound") || presenter.getState().getStatus().equals("SecondRound")) { return presenter.canPlaceRoad(edgeLoc, true); } else { return presenter.canPlaceRoad(edgeLoc, fals...
7d367aca-afdd-4de2-afd7-0326c603c82f
8
@Override public void run() { boolean stop = false; while (!isInterrupted() && !stop) try { Thread.sleep(1000); if (appBehaviorObserver == null) continue; ResourcePrincipal[] tmp = bean.getApplications(); Set<ResourcePrincipal> newSet = new HashSet<Re...
027819ae-8da9-4e85-8490-30f3e6fe5c33
9
public void execute(final JGraphLayout layout) { if (graph != null && graph.isEnabled() && graph.isMoveable() && layout != null) { final JGraphFacade facade = createFacade(graph); final ProgressMonitor progressMonitor = (layout instanceof JGraphLayout.Stoppable) ? createProgressMonitor( graph, (JGraph...
010b3e3c-9ba5-4393-98a5-cd0d5e0c4ba6
9
public static void openURL(String url) { try { //attempt to use Desktop library from JDK 1.6+ Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[]{java.net.URI.class}).invoke( d.getDeclaredMethod("getDesktop").invoke(null), ...
79a49f21-538a-494a-8583-6bcc43d9f4e9
2
private void dfs(Digraph G, int v) { marked[v] = true; preOrder.add(v); for (int w : G.adj(v)) if (!marked[w]) dfs(G, w); postOrder.add(v); reversePostOrder.push(v); }
2eb37a19-99b3-4804-a3b7-4d6e5fc9a869
9
@EventHandler public void onMove(PlayerMoveEvent e) { Location locFrom = e.getFrom(); Location locTo = e.getTo(); Player p = e.getPlayer(); Benutzer b = this.plugin.alleBenutzer.get(p.getName()); for (Map.Entry<String, Gebiet> mapGebiet : this.plugin.alleGebiete.entrySet()) {...
d7899017-d537-464f-8ef3-f7e8e0e6fcf8
7
public UserView() { frame = this; this.setTitle("Library"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); contentPanel = new JPanel(); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPanel.setLayout(new BorderLayout(0,0)); setContentPane(contentPanel); tabbedPane = new JTabbedPane(JTabbe...
283703c7-c6e5-44a8-bb6e-011f5ec6927b
3
public ArrayList<Local> listar(long pesquisaId) throws Exception { String sql = "SELECT * FROM pesquisalocal WHERE id1 = ?"; ArrayList<Local> listaLocal = new ArrayList<Local>(); if (pesquisaId > 0) { try { PreparedStatement stmt = Connectio...
ebfc4c88-3850-4a42-99fa-709f31502b33
6
@Override public final String getSqlPredicat() { if (this.isPolesCollision()) { return null; } final List ranges = (List) computeRange(); final List<Double[]> raRanges = (List<Double[]>) ranges.get(0); final double[] decRange = (double[]) ranges.get(1); String predicatDefinition; i...
168148f7-3b39-4027-aec3-e7769c4571ad
8
@Override public int castingQuality(MOB mob, Physical target) { if((mob!=null)&&(target!=null)) { if(anyWeapons(mob)) return Ability.QUALITY_INDIFFERENT; if(mob.rangeToTarget()>0) return Ability.QUALITY_INDIFFERENT; if(CMLib.flags().isSitting(mob)) return Ability.QUALITY_INDIFFERENT; if(mo...
b54d2b89-752e-4f79-8e1e-210e236c5954
7
static final void getClientSignature(ByteBuffer buffer, byte i) { anInt8248++; byte[] is = new byte[24]; if (i == 55) { if (Class374.randomDatBufferedFile != null) { try { Class374.randomDatBufferedFile.method789(0L, (byte) -120); Class374.randomDatBufferedFile.method784(-89, is); int i_170_...
68291ef1-36bc-4597-a92b-5545dba201c0
9
public String[][] cantidadCitasMedico (String mes,String ano ){ String sql_consult; String fecha_ini, fecha_fin; String [] [] resultado = null; String dia_final; int mes_entero = Integer.parseInt(mes); switch (mes_entero) { case 2 : dia_final = "28"; ...
f2516e9e-351c-4c10-a9b5-aebbf02155b7
1
private int getNumeroInstruccion (String nombre) { int procACargar = 0; while (!procedimientos.get(procACargar).getNombre().equals(nombre)) procACargar++; return procedimientos.get(procACargar).getQuadruploInicio(); }
e105f889-02f3-4560-93f5-c26da82b3979
3
public void print(PrintStream out) { out.println("Settings"); for (Setting setting : map.values()) { if (setting instanceof AlgFileSetting) continue; if (setting.getLocked()) { out.println(" " + setting.getName() + ": " + setting.getString()); ...
e3aa5090-e675-42c1-b4ae-13cb9e7654f3
6
public static void main(String[] args)throws IOException { double finalAnswer=-99999; double finalcurvePoints=0; double finalPeriod=0; double finalPercDif=0; double finalminSRDif=0; double finalTP=0; double[] PortfolioValue=new double[60*260]; ...
f62ddb13-3241-405e-a948-29b167f24eae
4
public void run() { // Сначала нужно проинициализировть данные откуда то // Создать мир this.init(); long startTime; long currentTime; startTime = System.currentTimeMillis(); while (true) { // Допустим, я не хочу чтобы игра просчитывалась чаще чем 6...
5a8f0a41-becf-40fb-8cc3-cfbe34b87b3d
8
public Object calculate(SecuredTaskBean task) throws GranException { HashMap<String, SecuredUDFValueBean> m = task.getUDFValues(); SecuredUDFValueBean ci = m.get(INCIDENT_PRODUCT_UDFID); List<String> bf = new ArrayList<String>(); if (ci != null) { Object value = ci.getValue(...
3228c9e6-2997-4665-8656-d8c1bceacb66
7
public byte[] HandleRevealMessage(byte[] data) { RevealationMessage message = new RevealationMessage(ByteBuffer.wrap(data)); switch(message._revealationApi) { case (byte) 0xE3: // ECM/Appliance Info return HandleDeviceInformation(message._transactionId,message._revealationOpcode,message._revealationA...
0fbf20d6-8152-4a1b-a5ce-3f40c027016e
4
private void lol() { Calendar cal = new GregorianCalendar(TimeZone.getDefault()); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); if (month == 3 && day == 1) { xAuthLog.warning("Your trial version of xAuth expires today!"); xAuthLog.warning("Purchase the full version on Ste...
214aa4ac-8b9f-4f6f-947b-a0f37f760156
0
private void jButton0MouseMouseClicked(MouseEvent event) { SelectFrame lf = new SelectFrame(); lf.setDefaultCloseOperation(SelectFrame.EXIT_ON_CLOSE); lf.setTitle("SELECT"); lf.getContentPane().setPreferredSize(lf.getSize()); lf.pack(); lf.setLocationRelativeTo(null); lf.setVisible(true); this.dispose()...
397313a1-c0cf-45aa-b6bc-051023a5f922
4
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int y = 0; y < board.length; y++) { for (int x = 0; x < board[y].length; x++) { if (x > 0) { sb.append( ' ' ); } sb.append( board[y][x] ? 'O' : '-' ); } sb.append( '\n' ); } return sb.toStri...
e8210518-7bb6-4061-8a5f-d6932603428a
3
private void setupFromQuestion(BonusQuestion bq) { tfPromptInput.setText(bq.getPrompt()); if (bq.getBonusType() == BonusQuestion.BONUS_TYPE.MULTI) { rbMultChoice.setSelected(true); String[] choice = bq.getChoices(); for (int i = 0; i < tfMultiList.size(); i++) { tfMultiList.get(i).setText(choice...
6990382a-9324-4960-b2bb-20ab08e588ac
3
@Override public boolean equals(Object object){ if(!(object instanceof Move)){ return false; } Move move = (Move)object; boolean equals = getColumn() == move.getColumn(); equals = equals && getRow() == move.getRow(); equals = equals && getPlayer() == move.getPlayer(); ...
ddce3a14-a75d-42d9-a4c7-be18495dd8a5
2
HospitalPart getHospitalizeRoom() { double t = nextRand(); if ( t < 0.5 ) return HospitalPart.SURGERY; else if ( t < 0.75 ) return HospitalPart.ICU; else return HospitalPart.CCU; }
39116dc9-89df-4333-9728-26ff1d3babea
6
public boolean canSplit2() { //Whoa... This gets complicated if I have to //take into acount the "don't care" of transparent colors... int[] data = new int[min.length]; boolean[] seen = new boolean[min.length]; for (MultiColor c : freqTable.keySet()) ...
55f43adc-b768-4649-8245-e70f8ac4a3d3
4
boolean isUnzipAddDirectory(String targetPath, String fileName) throws RemoteException { // result:Used to store the result information of the command execution ArrayList<String> result = new ArrayList<String>(0); // errorResult:Used to store the error information of the command // execution ArrayList<String>...
278c0b84-1b36-4af1-93b4-ec31163c1427
4
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!plugin.hasPerm(sender, "reply", false)) { sender.sendMessage(ChatColor.YELLOW + "You do not have permission to use /" + label); return true; } Player player = (Player) sender; String msg = plugin.m...
f5034aac-559d-483a-bac3-b81231d54ab9
3
public void keyTyped(KeyEvent pEvent) { char key = pEvent.getKeyChar(); String strKey = TableViewAdapter.removeSpecialCharacter(new Character(key).toString()); if (System.currentTimeMillis() - mPreviousTime < RESET_TIME) { mTextToFind = mTextToFind + strKey; ...
bcdfc71c-acb7-4661-897a-dbb8f482fd8e
9
@Override @SuppressWarnings("SleepWhileInLoop") public void run() { try { int countSent = 0; int countUnsent = 0; String from = null; String date = null; String body = null; for (int i = 0; i < s...
e6f3e7d4-adb2-422a-8d68-4e4f8e583673
1
public Row getByKey(String tableName, String key) throws DataBaseTableException { Table table = tableHashMap.get(tableName); if (table == null) { throw new DataBaseTableException("no such table"); } return table.get(key); }
6a39e99f-71ec-488a-853b-c7145552803d
7
public Metadata readNextMetadata() throws IOException { Metadata metadata = null; boolean isLast = (bitStream.readRawUInt(Metadata.STREAM_METADATA_IS_LAST_LEN) != 0); int type = bitStream.readRawUInt(Metadata.STREAM_METADATA_TYPE_LEN); int length = bitStream.readRawUInt(Metadata...
6ba442f5-088d-476c-85c4-b148aa8f6de2
1
public boolean getCopyEnabled() { return this instanceof ClipboardInterface && copyEnabled; }