method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
71932129-5d2c-4c82-9a6e-ecc3731038bb
7
private static Map<Integer,Integer> getMinPath(List<String> lines){ Map<Integer, List<Integer>> adjacencyMap = new HashMap<Integer, List<Integer>>(); List<Edge> edgeList = new ArrayList<Edge>(); Map<Integer,Integer> processedVertices = new HashMap<Integer,Integer>(); Map<Integer,Integer>...
42b4f050-aede-4dbf-a106-d5f0d40642e7
0
public EndExam(int submitTime,ExecutorService exec) { super(null,submitTime); this.exec = exec; }
96e41372-fa70-4520-be13-1cc063b70c60
5
public boolean isClicked(int mouseX, int mouseY) { if (Mouse.isButtonDown(0)) { if ((mouseX > x) && (mouseX < x + width) && (mouseY > y) && (mouseY < y + height)) { return true; } } return false; }
2674d936-2d89-457f-a1d2-5c79bab526d6
6
/* package */TrackerResponse ( boolean failed, String failureReason, String warning, long interval, long minInterval, byte[] trackerId, long complete, long incomplete, List<PeerInfo> peers) { this.failed = failed; if (failed) { if (failureReason == null) { ...
bd575c6a-9761-451a-80b1-b4c861fe7dee
8
private void drawLabel(Graphics2D g2d, int tanknr) { // x = posx - (width) int width = (int) mytanks[tanknr].get_tankdata().width; int posx = (int) mytanks[tanknr].get_tankdata().posx; int x; Color mycolor = g2d.getColor(); if (tanknr%2==0) { x = 100 + (40 * ...
02eaf46f-0456-40f6-b21b-6f25c21b0004
4
@Override public void onDisable(){ try { SQLManager.disconnect(); } catch(Exception e){ log.severe("SQL Database encountered an error while disconnecting."); if(e.getMessage()!=null) log.severe("Error: " + e.getMessage()); if(e.getCause()!=null) log.severe("Caused by: " + e.getCause().toString()); } ...
982e8f69-ec79-4db3-aa11-ee93ea56be98
0
public AntBrainTest() { }
5e2781b4-7adf-4fd7-968c-b4d91e588b31
4
public List<String> splitTextMsgTo3Parts(String xml) { if (xml.isEmpty() || xml == null) return null; String regex = "^(<xml><ToUserName><!\\[CDATA\\[\\w+?\\]\\]><\\/ToUserName><FromUserName><\\!\\" + "[CDATA\\[\\w+?\\]\\]\\><\\/FromUserName><CreateTime>\\d+?<\\/CreateTime><MsgType><\\!...
30b0d6df-54c9-4991-bc3e-c30216066e57
0
protected boolean test4 () { return true; }
7d999365-ef86-4535-9910-f4bb034186b5
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; LinkingObject other = (LinkingObject) obj; if (linkingObjectIdentifier == null) { ...
9d71a538-c7da-4f6a-a8ea-20f93dff65a9
9
public String convertHarga(int harga) { // jadi tar kalo 50000 jadi 50.000 // dst... // harga = 444; int ribuan[] = new int[10]; int counter = 0; String temphasil = ""; while (harga / 1000 != 0) { ribuan[counter] = harga % 1000; counter++; // temphasil = temphasil + ribuan+"."; harga ...
999ce82b-b4c2-4174-94b4-6e1d7da76daf
6
boolean classContainsMethod(Class clas, String methodName, String[] paramTypes) { while (clas != null) { Method[] methods = clas.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(methodName)) { String[] methodParamTypes = getTypeDescriptors(method.getParameterTypes()); ...
4319c0c3-d191-45b3-8c56-36d4ea6a0da7
5
public ZoneAff selectMenu() { ZoneAff curMenu; switch (Fenetre._state) { case MenuPause : curMenu = _menuPause; _menuPause.updateScore(); break; case MenuHigh : curMenu = _menuHigh; break; case LevelLoad : _menuLevel = new MenuLevel(); curMenu = _menuLevel; break; ...
aa33980d-a98c-4968-9d22-15f405118d04
0
public void load() { worldBuilder.loadWorld(); }
015c70d1-bc9a-4b9a-86e8-0d29399ddba4
4
public void removeEvent(String type , int id) { List<MyEvent<T>> list = map.get(type); if(list != null){ if(id < 0 ) { map.put(type, null); } else { for(MyEvent<T> event : list ) { if(event.getId() == id) { list.remove(event); break; } } } } }
d8ab5683-6c9a-4fd3-b375-5a2d817952d1
5
public void onAddUser(final String name, final int result) { //tests if wanted user is already watched or exists in general if(result == Client.USER_ALREADY_WATCHED) { topbarHint.displayMessage(String.format(ALREADY_WATCHING_STRING, name)); return; } else if(result == Client.USER_INVALID) { topbarHint.di...
9ef93a0e-2e42-42cb-8147-bd66ad2871cc
4
public SchedulJob(int schedulJobID,int streamID, long startTime, long stopTime, int howOftenID, boolean enable, String comment) { this.schedulID = schedulJobID; this.streamID = streamID; this.startTime = startTime; this.stopTime = stopTime; this.enableJob = enable; this.comment = comment; if(howOftenI...
891c01b4-a9c8-4cef-befb-0bfa880ac316
4
public boolean colision (int ancho, int alto){ // No dejo que bueno salga por la derecha if ((this.getPosX() + this.getAncho() >= ancho) || (this.getPosX() <= 0) || (this.getPosY() + this.getAncho() >= alto) || (this.getPosY() <= 0)) { return true; } else return false; }
8a69a690-8723-4204-8f3f-9fb915d2543a
5
private void processOverPaint(Boolean OP, Boolean op) { // PDF 1.2 and earlier, only a single overprint parameter if (enabledOverpaint && OP != null && op == null && overprintMode == 1) { overprintStroking = OP; overprintOther = overprintStroking; } ...
c1564fae-9b50-4729-9624-47b3b0713b12
3
public static void findModifyMoreThan (Matrix modifyTarget, Matrix findTarget, double beta) { double [][] findTar = findTarget.getArray(); double [][] modifyTar = modifyTarget.getArray(); for (int row = 0; row < findTarget.getRowDimension(); row++) { for (int col = 0; col < findTarge...
9c351134-1ae0-466b-8fdb-59af0c234be0
6
public String longestPalindrome(String string) { String s = preprocess(string); char[] T = s.toCharArray(); int n = T.length; int[] LPS = new int[n]; int centerPos = 0, centerRightPos = 0; for (int i=1; i<n-1; i++) { int i_mirror = 2*centerPos-i; ...
7e84c547-feec-403e-a30b-88cb29900859
3
public static String textUnpack(byte packedData[], int size) { int idx = 0, highNibble = -1; for(int i = 0; i < size*2; i++) { int val = packedData[i/2] >> (4-4*(i%2)) & 0xf; if(highNibble == -1) { if(val < 13) decodeBuf[idx++] = xlateTable[val]; else highNibble = val; } else { decodeBuf[id...
e3cc9e02-f744-426d-a077-70720994b556
5
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Location other = (Location) obj; if (this.x != other.x) { return false; } if ...
0b779e63-0148-4527-afa3-0fecf3f9471a
4
private boolean query(Class c) { Set<Location> neighbors = neighbors(ORTHOGONAL); for(Actor a : actors) { Location location = locations.get(a); if(c.isInstance(a) && location != null && neighbors.contains(location)) { return true; } } return false; }
72952e8a-a146-45af-9890-a56d8b259a1b
8
public String startUserStream()throws Exception { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.setOAuthConsumerKey(KEY); builder.setOAuthConsumerSecret(SECRET); AccessToken accessToken=null; Configuration conf = builder.build(); TwitterFactory factory = new TwitterFactory...
8c753fe5-290c-48a8-9cd9-4a44a668055d
9
public static String longestPalindrome (String s) { char[] S = s.toCharArray(); if (s == null || s == "" || S.length == 0) return ""; boolean T[][] = new boolean[S.length][S.length]; int maxi = 0; int maxLen = 1; // len = 1 Arrays.fill(T[0], true); //len = 2 for (int i=0; i<S.length-...
7623ad60-a855-49e1-aed9-a1628bae725f
6
private void canonicalizeReifications(NamedGraph g){ ArrayList<String[]> sigs=g.getMSGSignatures(); if (sigs!=null && !sigs.isEmpty()){ for (String[] sig:sigs){ for (int i=0; i<=2; i+=2){ if (sig[i].startsWith("_")){ Integer lookupName = lookupTable.get(sig[i]); if (lookupName!=null){ ...
0677f632-c41d-4d8a-abdf-d4e974a03738
1
public void testConstructor_ObjectStringEx2() throws Throwable { try { new LocalTime("1970-04-06T+14:00"); fail(); } catch (IllegalArgumentException ex) {} }
dda1423e-4a2a-440a-9ef9-421029c4580d
7
private Node makeCourseNode(CourseRec rec, Document dom, CourseModel model) { Element node = dom.createElement("Class"); node.setAttribute("id", String.valueOf(rec.getId())); node.setAttribute("short", rec.getShortName()); node.setAttribute("lang", rec.getLanguage()); node.setAttribute("src", "" + rec.getSour...
0b0cb249-23ac-4d4d-bce9-adbaba21c4ce
1
@Override public RemoteEvent encode(Event event) { OutputStream os; try { os = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(os); o.writeObject(event); return new RemoteEvent(os.toString()); } catch (IOException e...
1ca5fa89-d2ba-4f6e-9b84-2bfdbfa31a19
9
public static String addScore(String fileName, String username, long win, long lose) throws IOException {//System.out.println("addScore"); Scanner scan; String[] usernames; long[] wins, losses; int fileLength = 0; username = fixName(username); try { scan = new Scanner(new File(file...
e4b38fc4-2138-4e25-a8b7-d02ecce3b973
2
@POST @Path("/v2.0/ports") @Produces(MediaType.APPLICATION_JSON) public Response createPort(final String request) throws MalformedURLException, IOException{ //Convert input object NetworkData into a String like a Json text Object port; port = JsonUtility.fromResponseStringToObject(request,ExtendedPort.class); ...
19fb2f05-1491-4056-8d3c-b7d6572f7719
6
public static void main(String[] args) { // TODO Auto-generated method stub //采用堆栈来进行解决,声明一个数组 int[]arr = new int[15];//存储十五个数字 int[]arr1 = new int[15]; int[]arr2 = new int[10000]; for(int i=0;i<15;i++){ arr[i]=0; arr1[i]=1; arr2[i]=0; } int top=0;//记录当前栈最顶的对应下标+1 Map<Inte...
ae4670a2-471d-46c8-bfc9-259790fe3880
2
public FIBAnswer[] getModel(int Question_ID) { /** *get mcqOPtions for a question * @param Question_ID * @return */ ArrayList<FIBAnswer> fibAnswers=new ArrayList<FIBAnswer>(); try { StringBuffer sql = new StringBuffer(""); sql.append("SELECT A...
b29c510d-9a39-41fb-917b-0973f91c5b54
6
private void ensureCapacity (int n) { if (n <= 0) { return; } int max; if (data == null || data.length == 0) { max = 25; } else if (data.length >= n * 5) { return; } else { max = data.length; } ...
d497864d-49be-4ac0-a3ad-5dd59c893e12
3
public void actionPerformed(ActionEvent ev) { try { InstituicaoSubmissao objt = classeView(); if (obj == null) { long x = new InstituicaoSubmissaoDAO().inserir(objt); objt.setId(x); JOptionPane.showMessageDialog(null, "Os dados foram inseridos com sucesso", "Sucesso", JOptionPane.INFORMA...
630fc98b-6936-4b23-b16b-c34c8a6dca70
3
@Override public void incrementDeathCount(String player_name) { PreparedStatement pst = null; int player_id = getPlayerId(player_name); int deathcount = getDeathCount(player_id); try { pst = conn.prepareStatement("UPDATE ffa_leaderboards SET deaths=? WHERE player_id=?"); pst.setInt(1, deathcount + 1/2); ...
18df4c44-f072-4250-8ea0-0e76839ba391
5
public void update() { int dist = (int)((step + (timer/(float)TIMER_MAX)) * (Matrix.CASE_SIZE / NB_STEPS)); switch(dir) { case UP: distMove.setY(-dist); break; case DOWN: distMove.setY(dist); break; case LEFT: distMove.s...
aeed68bb-e2b7-467a-bff3-cf546d69c1ad
5
@Override public void onReceive(Object message) throws Exception { log.debug("message in ActorRegistry {}", message); if (message instanceof Register) { log.debug("{} added to registry", ((Register) message).actorRef.path().name()); registry.put(((Register) message).actorRef...
688c5918-3843-43b2-bcb1-2527b9b62990
5
private void checkHit() { // Enemy e = (Enemy) getOneIntersectingObject(Enemy.class); List<Enemy> hit = getObjectsInRange(10,Enemy.class); if ( hit.size() != 0 && hit.contains (target) ) { if (debuffList != null ){ for (int i = 0; i < this.debuffList.len...
d392fe8a-50b7-4730-8e0d-b52054bb3902
8
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
51cfb0a7-2a81-4eea-a9b5-7204c69bc131
4
@Test public void testIncludes2() throws JSONException { List<Object> categoryIds = Lists.newArrayList(); categoryIds.add(10); categoryIds.add(120); Query q = new Query().field("category_ids").includesAnyList(categoryIds); ReadResponse resp = factual.fetch(TABLE, q); assertOk(resp); for (...
51e45fdf-6373-4ca3-96e3-5183c4af50e9
8
public static Cons javaTranslateDefineNativeClass(Stella_Class renamed_Class) { { Stella_Object parentclass = null; Cons interfaceclasses = Stella.NIL; Cons instancevardefs = Stella.NIL; Cons constructordefs = Stella.NIL; Cons modifiers = Stella.NIL; Cons methoddefs = Stella.NIL; ...
87bec587-1f44-4f7b-a6a7-091e2942652e
6
public static void main(String[] args) throws FileNotFoundException, IOException { System.out.println("loading graph..."); Kosaraju kos = new Kosaraju(); System.out.println("1st pass..."); kos.dfsLoop(null, kos.gRev, 1); /* reset the visited[] for the second pass */ for (int i=0; i<kos.N; i++) kos.visited...
7ba57761-923c-48dd-8962-ddacd7bc6091
6
@Override public V put(K key, V value) { int size = list.size(); Entry<K, V> entry = null; int i; if (key == null) { for (i = 0; i < size; i++) { entry = (list.get(i)); if (entry.getKey() == null) { break; } } } else { for (i = 0; i < size; i++) { entry = (list.get(i)); if (...
436d2c1a-190a-4e0b-b5c2-bff5d02a372e
4
public void loadAllElements(){ try { ResultSet dbAllElements = null; Statement statement; statement = connection.createStatement(); dbAllElements = statement.executeQuery( "SELECT Element.elementID, Element.elementName, SetOFAssets.assetID" + ...
38785cdb-936e-498a-8348-eb468b33c330
1
private boolean sendMessage(CommandSender sender, String message) { boolean sent = false; if (isPlayer(sender)) { Player player = (Player) sender; player.sendMessage(message); sent = true; } return sent; }
d60408b4-86be-41f3-ba61-bfbf248bf8de
1
public static synchronized org.slf4j.Logger getInstance() { if (instance == null) { instance = LoggerFactory.getLogger("Arietta"); } return instance; }
ad402b4f-cc62-4acf-85f1-68e0c8fadab6
0
public Robot(Point position, int baseSpeed, int baseForce, int healt, int maxhealth, World currentWorld, String name, Color color, int energy) { super(position, baseSpeed, baseForce, healt, maxhealth, currentWorld, false); this.legForce = baseForce; this.armForce = baseForce; this.name = name; this.color =...
0aac38e3-47d3-4e27-b33d-a0a86f222461
9
void popDuskObject(DuskObject objIn) { synchronized(objEntities) { if (objIn.intLocX < 0 || objIn.intLocY < 0 || objIn.intLocX >= MapColumns || objIn.intLocY >= MapRows) { return; } if (objEntities[objIn.intLocX][objIn.intLocY] == null) { return; }else { if (objEntities[objIn.intLo...
69bb854e-cf0b-4561-8df6-307539bd1edd
0
public SQLPermissionEntity(String n) { super(n); }
06b1807a-236c-46b0-aadf-89b219154f83
3
public void generateButtons() { for(int k=0;k<9;k++) { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { Button button = new Button(String.valueOf(sudoku[k].cell[i][j])); bList.add(button); } } } }
c8bf292c-8b87-4e98-9e0f-7b24d968f390
0
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
f5f997dd-c075-41f8-a3e9-8d44c8fe4344
2
public static void allToString(Vector<?> v) { for (int i = 0; i < v.size(); i++) { System.out.println(v.get(i).toString()); } }
f238fa39-35ae-4227-8ca6-1573c055094f
3
public void run() { if(e.getEntity() instanceof Player) { if(e.getDamager() instanceof Snowball) { Player p = (Player)e.getEntity(); Dodgeball m = mm.getPlayerMinigame(p.getName()); if(m != null) { m.handleEn...
9830ad24-ae88-4ddc-95cd-2b1f5793ebdc
7
static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
127d2d41-955c-497b-a05a-d33b0aed2589
5
public boolean equals(Object o) { if ( this == o ) { return true; } else if ( !(o instanceof Move) ) { return false; } else { Move mo = (Move) o; // Check that each Atomic Move is the same. // Make copies so as not to modify state. Move this_copy = (Move) this.clone(); Move mo_cop...
00de691e-b0af-46aa-93e6-b1ced135d17f
1
private void getDescription(AbstractDao dao, List<Direction> directions) throws DaoException { for (Direction dir : directions) { Criteria crit = new Criteria(); crit.addParam(DAO_ID_DESCRIPTION, dir.getDescription().getIdDescription()); List<Description> desc = dao.findDescr...
c6777f19-2f55-40cc-8964-6ae4bdeeae3c
6
private void joinSets() { Random rand = new Random(); /* Randomly join sets together */ for(int i=1; i<current.length-1; i+=2){ //checks only at wall locations /* make sure they are eligible to be combined: * they have wall between then * they are not part of the same set * ...
bb1dcf99-c148-4a44-8d19-78a31f53fc19
0
private ItemStorageInventory() { itemList = new LinkedList<Item>(); }
51c7e6f2-52d8-4f63-9de6-ed8f20544813
9
public void run() { if (state == GameState.Running) { while (true) { robot.update(); if (robot.isJumped()) { currentSprite = characterJumped; } else if (robot.isJumped() == false && robot.isDucked() == false) { currentSprite = anim.getImage(); } ArrayList projectiles = robot.getProj...
e7f3aaf2-af45-46c5-86a9-676cfba7a21b
7
protected static Map<AlgebraicParticle, Integer> factors(AlgebraicParticle algebra){ LinkedHashMap<AlgebraicParticle, Integer> factors = new LinkedHashMap<AlgebraicParticle, Integer>(); if(algebra instanceof Term){ Term term = (Term) algebra; for(int i = 0; i < term.length(); i++) combine(factors, factors(ter...
93420581-626d-497d-b1dc-d0aba73da2b0
2
public final void setDefaultPerms(HashMap<PermissionFlag, Boolean> flags) { if (flags == null) { ChunkyManager.getPermissions(this, this).clearFlags(); DatabaseManager.getDatabase().removePermissions(this, this); return; } for (Map.Entry<PermissionFlag, Boole...
3d388538-b763-404b-98e8-c29599bf372a
1
public String getElementContentModel(String name) { Object element[] = (Object[]) elementInfo.get(name); if (element == null) { return null; } else { return (String) element[1]; } }
42cbd699-bd6a-46f6-91a2-b9773ff25d44
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FaceValue other = (FaceValue) obj; if (description == null) { ...
459060f8-7126-4ded-a40b-66ec45136123
6
public void sendOobabooData() { HashMap<String, Player> players = new HashMap<String, Player>(registry.getPlayerManager().getPlayers()); try { for (String key : players.keySet()) { Player p = (Player) players.get(key); if (p != null && p.getOobaboo() != null) ...
c50faef4-d866-4807-9327-a8eae6bdbed4
3
public synchronized int addNewQuiz( QuizServer quizAccess){ System.out.println("Lets add a new quiz"); int newQuizId=0; String quizTitle=""; Set<Question> questionList=null; List<Integer>quizIdList= new ArrayList<Integer>(); try{ //Set<Quiz> quizList= quizAccess.getQuizList(); List<Result> resultLi...
123f0c1d-a9c9-484d-bf52-add4159c97c2
1
private static void loadRankURIs(URL[] URLs, String urlBase) { for (int i = 0; i < 13; i++) { URLs[i] = ImageManager.class.getResource(urlBase + i + ".svg"); } }
cfc26a55-ca34-4202-bd82-470d44b5d132
1
public synchronized boolean hasRecordedIncomingPacket(Packet packet) { return (packet == null ? false : hasReceivedPacketWithSequenceNumber(packet.getSequenceNumber())); }
8d0a7865-46a0-49aa-831f-3263049677f1
4
private boolean createWindow() throws Exception { if (!this.isInit()) { throw new Exception("You need to init first the engine"); } try { Display.setDisplayMode(new DisplayMode(this.getWindowConfiguration().getSize().getX(), this.getWindowConfiguration().getSize().getY())); } catch (LWJGLException e1) { ...
7646f37d-2336-4d34-a9c8-466847168e05
7
public static int stringToMidi(String str) { if (!str.matches("[a-gA-G][s#b]?-?[0-9]?")) return -1; int baseNote = noteSeq[(Character.toUpperCase(str.charAt(0)) - 'A')] + 60; str = str.substring(1); if (str.matches("[s#b]-?[0-9]?")) { if (str.charAt(0) == 's' || str.charAt(0) == '#') baseNote++; el...
8843d691-eb28-42f6-968a-c2377c47bb2c
5
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("locals = ["); for (int i = 0; i < locals.length; i++) { buffer.append(locals[i] == null ? "empty" : locals[i].toString()); if (i < locals.length - 1) buffer.append(", "); ...
a7d48fbd-4802-4a03-a11b-9a02ede2538e
0
@Override public void keyPressed(KeyEvent e) {}
b0334ca1-3934-48ba-a892-4c91b16478af
6
@Override public void doTag() throws JspException { JspWriter out = getJspContext().getOut(); FilmothekModel model = new FilmothekModel(); try { // bearbiete Optionen für normale Nutzer if(this.film.getBorrowerID() == this.user.getId()){ // ist keine ...
1b0ef721-2d3a-4a99-a529-dbe7c51cf1cd
6
public static void open(File path) { if (!path.exists()) { return; } try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().open(path); } else if (getCurrentOS() == OS.UNIX) { // Work-around to support non-GNOME Linux desktop environments with xdg-open installed if (new File("/usr/bin...
ad302df3-0e25-4338-9e17-0fe5f491e876
8
@SuppressWarnings("unchecked") private void loadViewers() { // add filters in the filters folder File filtersFolder = new File("viewers"); File [] classes = filtersFolder.listFiles(new FilenameFilter () { public boolean accept(File dir, String name) { return name.endsWith(".class"); } }); for (File...
0c21de7a-d00e-4217-a330-897c270cb151
4
private void doDebug(Graphics2D g){ if(debug){ if(canMove){ g.setColor(Color.black); for(int i=0;i<moveX.length;i++){ g.fill(new Ellipse2D.Double(moveX[i]-5,moveY[i]-5,10,10)); } g.setColor(Color.red); g.setStroke(new BasicStroke(4,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); for(in...
01835e7d-fced-4600-8553-0b813029ee51
6
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
078f7174-0499-44d6-b099-4a29fa13943e
3
public Set<DependencyRule> getPublishedRules() { Set<DependencyRule> rules = new TreeSet<DependencyRule>(); if (getProperties() == null) { return rules; } String mavenRules = getProperties().get("debian.mavenRules"); if (mavenRules != null) { for(String ru...
069b228b-1fea-475e-af3f-1761e2d3ddc0
1
public boolean deleteMessage(String sender, String receiver, String message){ PreparedStatement st; Integer rs; String query; query="DELETE FROM messages WHERE sender='"+sender+"' AND receiver='"+receiver+"' AND message='"+message+"'"; try { st = conn.prepareStatement(query); rs = st.executeUpdate(); ...
82cb2577-7993-4904-8117-147b799757a4
0
public Car getCar() { return this._car; }
8b3f0010-147d-452f-b408-a1098b8cdf60
2
public static boolean isTrackFuzzyAt(World world, int x, int y, int z) { return BlockRailBase.func_150049_b_(world, x, y, z) ? true : (BlockRailBase.func_150049_b_(world, x, y + 1, z) ? true : BlockRailBase.func_150049_b_(world, x, y - 1, z)); }
55fbcb61-1286-444e-9960-b9f8230838ee
6
private void updateBlack2(Getal g) { int x = g.getX(); int y = g.getY(); Boolean [][] omg = g.getOmgeving(); for (int i=(x>0 ? -1 : 0); i<(x<width-1 ? 2 : 1); i++) { for (int j=(y>0 ? -1 : 0); j<(y<height-1 ? 2 : 1); j++) { black[x+i][y+j] = omg[i+1][j+1]; } } }
6b527dbe-0c9b-486f-8f6c-28c29eeb7365
0
public Cat(){}
75f80a01-c569-41a3-901b-c9712bcaace5
8
public boolean SelectAdjacentConstruct(boolean next) { if(selected == null) return false; Construct parent = selected.construct.parent; if(parent == null) return false; int myIndex = parent.children.indexOf(selected.construct); int selectIndex = (next) ? ++myIndex : --myIndex; if(selectIndex >= pare...
293de787-004c-45a8-a2da-6615dbe9afb0
6
protected void dispatch(SOSPFPacket inputPacket, SelectionKey key) { if (inputPacket == null) { System.out.println("WARNING: read null message in dispatch"); selector.wakeup(); return; } switch (inputPacket.sospfType) { case 1: processHello(inputPacket, key); break; ...
8ba48676-035d-4e9a-8811-07d125b3502c
1
public String toString() { return newObj != null ? newObj.toString() : "" + value; }
882a986a-4a41-46a2-a4db-119db8717d99
6
public boolean worldBreak(String s , Set<String> dict){ if(dict.contains(s)) return true; for (int i=1;i < s.length() ;i++ ) { if(!map.containsKey(s.substring(0,i))){ map.put(s.substring(0,i),worldBreak(s.substring(0,i),dict)); } if(!map.co...
75c3f9b1-1be9-43c1-93d0-4ec1060acc21
7
static final public int one_line() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case MINUS: case CONSTANT: case 12: sum(); jj_consume_token(11); {if (true) return 0;} break; case 11: jj_consume_token(11); {if (true) return 1;} break; defau...
890af8a1-1100-4eed-8f80-ac21089e596a
4
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); String userName = "", password = ""; userName = request.getParameter("userName"); password = request.g...
d509f17f-3545-4553-bdb4-31cee49f85af
9
public void actionPerformed(ActionEvent event){ if(event.getSource() == addDeck){ String deckName = deckText.getText(); deckText.setText(""); boolean invalid = false; if(deckName != null){ //Prevents the user from inputting a deck name that is a space or one that already exists for(...
17278873-9676-418f-87a0-6c3b9737d086
5
public void prepareWriting(GrowableConstantPool gcp) { gcp.putUTF8(name); gcp.putUTF8(typeSig); if (constant != null) { gcp.putUTF8("ConstantValue"); if (typeSig.charAt(0) == 'J' || typeSig.charAt(0) == 'D') gcp.putLongConstant(constant); else gcp.putConstant(constant); } if (syntheticFlag) ...
d2af2bcc-659a-4f5a-b5f1-de8da1640fb0
4
public boolean opEquals(Operator o) { if (o instanceof InvokeOperator) { InvokeOperator i = (InvokeOperator) o; return classType.equals(i.classType) && methodName.equals(i.methodName) && methodType.equals(i.methodType) && methodFlag == i.methodFlag; } return false; }
84a9c472-f117-4b1a-944a-9c4db38a34ff
5
public List<String> getResults() { List<String> results = new ArrayList<String>(); results.add("---------------------------------------------------------"); results.add("Scanning: " + archive.getName()); results.add("Time: " + new Date(System.currentTimeMillis())); results.add("\n"); for (ThreatClass threat...
7a2874a1-8661-4e27-8401-ed6224554655
1
public static void loadResources() { try { PillarEntity.PILLAR_IMAGE = new Image("images/pillar.gif", false, Image.FILTER_NEAREST); } catch (SlickException e) { } }
347740e9-ce77-4994-a0a2-2d31c3592342
1
public static void toggleMoveableAndClearForSingleNode(Node node, CompoundUndoable undoable) { toggleMoveableForSingleNode(node, undoable); for (int i = 0, limit = node.numOfChildren(); i < limit; i++) { clearMoveableForSingleNode(node.getChild(i), undoable); } }
74676a92-b267-4d52-8afb-c05ddb395c93
1
public void addBlockTypeOverride(StringTokenizer tokens) { int tokenCount = tokens.countTokens(); String[] settings = new String[tokenCount+1]; String line = ""; for (int i = 0; i < tokenCount; i++) { settings[i] = tokens.nextToken(); line += " " + settings[i]; ...
cc2518db-7bf1-475f-87d8-77519926e1d9
8
public final WaiprParser.handler_return handler() throws RecognitionException { WaiprParser.handler_return retval = new WaiprParser.handler_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token ID24=null; Token char_literal25=null; Token char_literal27=null; Token char_literal28=null; ...
e4b8adfd-0e27-4eb8-a764-63fbabe4b2e4
6
public static final BufferedImage filterImage(BufferedImage img, Color c) { BufferedImage imgClone = deepCopy(img); float cHSB[] = new float[3]; WritableRaster trame = img.getRaster(); WritableRaster trameClone = imgClone.getRaster(); ColorModel model = img.getColorModel(); ...
bd9c607c-0d02-4ea1-800a-1e24b25d5244
1
public void moveLayer(int x, int y) { for (DrawableItem pi : this.ditems) { pi.move(x, y); } }