method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
b2d9fbf7-c194-4f7a-8439-956f54c85375
1
public void testConstructor_ObjectStringEx5() throws Throwable { try { new LocalDate("T10:20:30.040+14:00"); fail(); } catch (IllegalArgumentException ex) {} }
ec7fc9b7-b2cd-4c31-b22e-7ec6860b8551
1
public void setPouvoirsPris(List<Class<? extends Pouvoir>> pouvoirsPris) { this.pouvoirsPris = pouvoirsPris; }
6636c0eb-0728-4aaa-9681-c3a6fd6b1f91
4
public void handleCommand(boolean admin, String command, String sender) { try { String[] cmd = command.split(" "); String commandName = cmd[0]; StringBuilder commandContent = new StringBuilder(); for (int i = 1; i < cmd.length; ++i) { commandConten...
db3b745a-dc9f-4bed-b4f8-48c56fb44f97
8
public ImageData addSnippedImage(Rectangle rect){ ImageData.resetId(getSheetData().getAllImageData()); boolean autoColl = Boolean.parseBoolean(Preferences.PREFS.get("coll_auto")); boolean autoHull = Boolean.parseBoolean(Preferences.PREFS.get("hull_auto")); boolean autoAnchor = Boolean.parseBoolean(Preferences.P...
4a22fad6-43cf-41a4-abb8-c133425e3296
8
@BeforeClass public static void setUpBeforeClass() throws Exception { sm = new StockManager(); phoneDescription = new HashMap<String, Object>(); phoneDescription.put("name", "Cink Five"); phoneDescription.put("brandName", "Wiko"); phoneDescription.put("screenSize", 5); phoneDescription.put("screenTyp...
e59b6639-3dcd-4806-90c7-f52a336ca61e
4
public static double[][] GetConfusionMatrix() { //row r and column c is the percentage of test images from class r that are classified as class c //matrix[0][0] -> percentage of test images from class IsFace that are classified as class IsFace //matrix[0][1] -> percentage of test images from class IsFace that ar...
9f392615-a3de-4217-89b6-566af09258a9
1
public void showConnections() { System.out.println("City to City Connections"); System.out.println("\nCity\tCity\tDistance"); for(int index = 0; index < 17; index++) { System.out.println(connections[index].getFirstElement()+"\t"+ connections[index].getS...
6b557de3-9ad7-460c-97cd-e1c177f46e34
7
private String[] loadConfig() { String[] defaults = new String[] { "ip=localhost", "port=9190", "heartbeat=1000", "name=UNSET", "pass=UNSET", "debug=false" }; String[] data = new String[defaults.length]; try { File folder = getDataFolder(); if(!folder.exists()) { ...
e465c71f-c920-4c44-993b-1effbc95463b
1
public static void main(String[] args) { Map<Integer, Employee> empMap =new TreeMap<Integer, Employee>(); empMap.put(2, new Employee(101, "Atul", 01)); empMap.put(5, new Employee(104, "Ram", 03)); empMap.put(1, new Employee(102, "John", 02)); empMap.put(3, new Employee(105, "Smith", 02)); empMap.put(4, new...
6f882dbe-eeac-4012-89e0-d514bbd6ae2f
6
protected void updateTraits(int numUpdates) { final Batch <Trait> allTraits = new Batch <Trait> (levels.size()) ; for (Trait t : levels.keySet()) allTraits.add(t) ; for (Trait t : allTraits) if (t.type != CONDITION) { final Level level = levels.get(t) ; if (level.bonus != 0) level.bonus = 0 ; ...
5f34b7c5-8f84-455a-ace4-812fdeb04002
3
private boolean hasPlayersPositionAnActiveLightGrenade(Player player) { for (Element element : getGrid().getElementsOnPosition(getGrid().getElementPosition(player))) if (element instanceof LightGrenade && ((LightGrenade) element).isActive()) return true; return false; }
93360944-485b-4491-8efc-d12dfe336d20
8
public static Component smartRequestFocus(Component component) { if (requestFocus(component)) return component; if (component instanceof JComponent) { FocusTraversalPolicy policy = ((JComponent) component).getFocusTraversalPolicy(); if (policy != null) { Component focusComponent = po...
e6e60938-26b1-4150-8cd2-d4f512b469dd
9
@Override public String stateString(Rider R) { switch(rideBasis) { case Rideable.RIDEABLE_AIR: case Rideable.RIDEABLE_LAND: case Rideable.RIDEABLE_WAGON: case Rideable.RIDEABLE_WATER: return "riding in"; case Rideable.RIDEABLE_ENTERIN: return "in"; case Rideable.RIDEABLE_SIT: return "on"; c...
6cbc2f9d-b19c-4ab2-be1a-0277374431ad
8
private static void doArchiveTest() { System.out.print("Testing archive command "); try { // create an MVD from the Renaissance folder File folder = new File( TEST_DATA+File.separator+RENAISSANCE ); String mvdName = createTestMVD( folder ); MVD mvd = MVDFile.internalise( new File(mvdName), null ); ...
9d944c1c-966e-4328-8d5b-bad0f5215877
5
public boolean isCompatible(ValueType type) { if (this == type || this == NONE || this == VOID) return true; if (this.isNumeric() && type.isNumeric()) return true; return false; }
ea6e5b93-4834-4c5f-852c-9789206e2172
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PersistentSet<?> other = (PersistentSet<?>) obj; if (set == null) { if (other.set != null) return false; } else if (!set.equals(other.set)) re...
2bc93720-dccb-4052-ac85-392bfa1b78e1
9
public boolean isDifferent(UNote n) { if(note!=n.note) return true; if(duration!=n.duration) return true; if(channel!=n.channel) return true; if(velocity!=n.velocity) return true; if(liveness!=n.liveness) return true; if(mute!=n.mute) return true; if(pan!=n.pan) return true; ...
c4be84b8-d721-43e5-a9ab-ed6af898c119
9
public void eliminate(){ int []a = new int[10]; int maxNum = 10; for (int i = 0; i < a.length; i++) { a[i] = (int) (Math.random()*maxNum); System.out.print(a[i]+"\t"); } System.out.println(""); int counter = 0; for (int j = 0; j < maxNum; j++) { for (int i = 0; i < a.length; i++) { if(a[i]...
2b6cfe68-7783-431f-9e5d-f32bb5186e36
4
private static Items sequentialSearch(ItemList lm, String target, Items[] items) { Items retVal = null; System.out.println("Searching for " + target + "."); int counter = 0; //Items currentItem = new Items(); Items currentItem = lm.g...
75751b18-75d6-4770-8236-003ba2cf4557
1
public void setDistance( TextDistanceStrategy distance ) { if( distance == null ) { throw new IllegalArgumentException( "distance must not be null" ); } this.distance = distance; regraph(); }
a928c8d0-8fe6-47d2-bb11-a1f26a26175c
6
private void processMethods0(int mod, CtClass clazz, CtMethod m, int identifier, boolean dontSearch) throws CannotCompileException, NotFoundException { CtMethod body; String name = m.getName(); if (isExcluded(name)) // internally-used method inherited ...
edb72253-b1c5-4aba-bbfd-3258a178da2e
9
public static void extractJAR(LauncherAPI api, GameFile source, File file, File dest, int min, int max) throws Exception { JarFile jar = null; try { jar = new JarFile(file); } catch (final IOException e) { e.printStackTrace(); ...
88aaeb04-26c5-43e6-b3d7-d4a7932502d9
1
public synchronized int SelctArticleID(String url) { int id = 0; try { ResultSet re = tags_ste.executeQuery("SELECT * from zhangyu_sca.article WHERE (url = '" + url + "');"); re.next(); id = re.getInt("id"); } catch (SQLException e) { e.printStackT...
2338d4bc-cf76-4dfa-8067-bb5b10c8ec4f
3
@Override public UserModel getUser(String email) throws WebshopAppException { if (isValidEmail(email, "GET_USER")) { try (Connection conn = getConnection()) { String sql = "SELECT * FROM users WHERE email = ?"; try (PreparedStatement pstmt = conn.prepareStatement(sql)) { setString(pstmt, 1, email)...
5f63e672-3b30-46fb-bb43-6942adcae692
1
protected void closeall(){ JInternalFrame [] x = desktop.getAllFrames(); for(int i=0 ; i<x.length ; i++){ x[i].setVisible(false); } }
01c49bae-95f9-4cb1-8385-97bb4fadfccf
0
public CtrlPraticiens(VuePraticiens vueCR, VueAbstrait vueA) { super(vueA); this.vue = vueCR; this.vue.setCtrl(this); // Gérer la persistance em = EntityManagerFactorySingleton.getInstance().createEntityManager(); em.getTransaction().begin(); //préparation des c...
75ca5d37-5a16-4374-b2e4-f594898f2128
3
public static void schoolEducationalDetails(BufferedReader inp) throws Exception,IOException { @SuppressWarnings("unused") SchoolEducationalBean schoolEducationalBean = new SchoolEducationalBean(); QualificationTbl qualificationTbl = new QualificationTbl(); LocationTbl locationTbl = new LocationTbl(); In...
deb3568c-00d9-4308-a711-1a0a8a1b88ab
4
public void construct2DMatrixFromStringSet(int currentRow,int startIndex,int numRows,int numColumns,List<String> rawData){ String sCurrentLine=""; String _convertedPattern=""; int trackNumberOfRows = 0; int sIndex = 0; _pattern = new String[numRows]; while(true){ ...
1338233b-0009-49f7-819d-e3a59b134f0f
3
* @return Whether the specified outline refers to this outline or a proxy of it. */ public boolean isSelfOrProxy(Outline outline) { Outline self = getRealOutline(); if (outline == self) { return true; } for (OutlineProxy proxy : self.mProxies) { if (outline == proxy) { return true; } } retur...
005da5b3-c712-43d4-9a72-0a0521a1e00b
5
public static String getName(int difficulty, int i) { if (instance == null) { return null; } switch (difficulty) { case Grid.DIFFICULTY_EASY: return instance.easyName[i]; case Grid.DIFFICULTY_MEDIUM: return instance.mediumName[i]; case Grid.DIFFICU...
21632c0f-6f4d-4106-a89e-e680fa68ba8f
1
public void setHasRealUse(final Block block, final boolean flag) { final int blockIndex = cfg.preOrderIndex(block); hasRealUse[blockIndex] = flag; if (SSAPRE.DEBUG) { System.out.println(this); } }
12fca9b1-63b3-4080-b775-d29116e11d73
1
public void testConstructor_invalidObject() throws Throwable { try { new DateMidnight(new Object()); fail(); } catch (IllegalArgumentException ex) {} }
bf59a91f-e672-469a-92fe-93810f04425f
8
protected Boolean tryCheckHLine5(boolean remove) { for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; j++) { //trace(i, j) int count = (gemArray[i][j]); if (i + 4 <= 5) { if (count == gemArray[i + 1][j] && count == gemArray[i + 2]...
b5ae072d-f7fb-4db1-a94f-6a95316dc23f
2
public String ToString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) sb.append("[" + matrix[i][j] + "]"); return sb.toString(); }
bc5fc4f0-0d17-4eaf-ac3a-2b77f12486cd
5
public void closeDoor(String name, InternalDoor door) { Avatar a = null; for(Avatar b: avatars){ if(b.getName().equals(name)){ a = b; } } if(a!= null){ String locName = a.getLocationName(); String doorName = door.getName(); Location l = locations.get(locName); for(GameObject g: l.getAllObj...
45e71507-729e-476d-9c4f-5f739030a286
7
public static String getAppName(final String line) { if ((line.contains(" in ") && line.indexOf(" in ") < 20) || (line.contains(" out ") && line.indexOf(" out ") < 20)) { StringTokenizer st = new StringTokenizer(line); String temp; while (st.hasMoreElements())...
5dbe923c-47eb-4203-bcd3-0fa82b8c2ebc
9
private boolean currentBlockCounst(boolean nextToken,boolean showError){ boolean result = false; if(currentTokenEquals(nextTokenTRUE, "const")){ boolean error = false; //Пока не встретим вар или бегин или ошибку while(!currentTokenEquals("begin")&&!currentTokenEquals...
0ef24365-b58e-4054-aa65-6f571f0294b1
9
static public Color getColorForState( final DataState dataState) { if(dataState == DataState.NO_DATA) { return Color.green; } else if(dataState == DataState.NO_SOURCE) { return Color.orange; } else if(dataState == DataState.NO_RIGHTS) { return Color.red; } else if(dataState == DataState.POSSIBLE_...
f3e381d3-39da-438d-820d-882f01befb7f
3
@Test public void getMaxDiagonal1Product() { String expected = "[1, 0][0, 1] [1, 1][0, 2] [2, 0][1, 1] [2, 1][1, 2] "; int numbers = 2; String actual = ""; for (int x = numbers - 1; x < DATA.length; x++) { for (int y = 0; y + numbers <= DATA.length; y++) { ...
95f8b349-e3b7-4461-80be-3c6fbc120b21
1
@Override public TextModifier getTextModifier() { TextModifier modifier = new TextModifier(); if(textColor != null) { modifier.addModifier(TextModValue.COLOR, textColor); } return modifier; }
58ec5743-456b-4832-99b6-f8ffaf48c77c
9
private void changeEndDateAndAmount(){ System.out.println("there"); Membership membership= new Membership(); if(jComboBox1.getSelectedObjects()!=null) membership = (Membership)jComboBox1.getSelectedObjects()[0]; boolean validStartDate= false; int year=0,month...
aa7cbec2-90f4-45dc-8b07-cd507af0ccb9
6
protected void whenClicked() { if (! showScroll) return ; final float mX = myHUD.mouseX(), mY = myHUD.mouseY() ; if (grabArea.contains(mX, mY)) { initScrollPos = scrollPos ; } else { initScrollPos = -1 ; final float inc = Math.max( MIN_SCROLL_DIST / (mapArea.ydim() - ydim()...
5ed3464f-aded-4bea-9751-396dd9cadcd9
1
private void repaintCards() { cardsPanel.removeAll(); for (int i = 0; i < game.getTurnCards().size(); i++) cardsPanel.add(new GameCardComponent(game.getTurnCards().get(i))); }
253144dd-5d0d-4f6b-836d-9756bfbf00ef
3
public OpenGLTexture getCharacter(char character) { for(int line = 0; line < map.length; line++){ String list = map[line]; for(int i = 0; i < list.length(); i++){ char c = list.charAt(i); if(c == character){ return sheet.getSprite(...
6972fa04-2b54-4d0f-b5be-dd395f5c0f8a
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof User)) { return false; } User other = (User) object; if ((this.id == null && other.id != null) || (this.id != n...
74be9dd9-fa3f-4cc3-aa89-ced42eb0bcb3
7
private void copyHeadersToWebBrowser(final HttpURLConnection con, final OutputStream outputToWebBrowser) throws IOException { int i=0; while (true) { String value = con.getHeaderField(i); if (value == null) { break; // End of headers } String name = con.getHeaderFieldKey(i); i++; i...
378d0b6e-2220-40e5-a54f-32cef20c78d1
8
public static int code_init() { int i; /* allocate */ code_map = new code_info[(int)__code_max];//(struct code_info*)malloc( __code_max * sizeof(struct code_info) ); for(int k=0; k< code_map.length; k++) code_map[k]=new code_info(); if (code_map==null) return -1; cod...
7902138d-6fd3-4d0b-9419-e985f0617303
4
private static List<File> getDirFiles(File srcDir) { List<File> files = Lists.newArrayList(); if (srcDir.exists() && srcDir.isDirectory()) { //js文件 File[] filesInSrcDir = srcDir.listFiles((FileFilter) new SuffixFileFilter(".js")); for (File file : filesInSrcDir) { files.add(file); ...
7351c2d7-97f1-43ec-a28c-155597207233
4
public void display() { System.out.println("Source \n"); for (int i = 0; i < dim; i++) { for (int j = 0; j < dim; j++) { System.out.print(source[i][j] + " "); } System.out.println(); } System.out.println("result \n"); for (...
0d02e2e2-907e-47fd-93d4-1325a989ab72
4
private boolean hasDifferentSign(double a, double b){ if((a<0&&b<0) || (a>0&&b>0)){ return false; } return true; }
b371e7ec-a788-40aa-9011-c69f23b169c2
1
@Override public void mouseClick(int X, int Y) { if(this.getMouseListener() != null) { this.getMouseListener().MouseClick(this); } }
62b5c10a-e7ed-445f-8d09-42f68c800942
2
private String[] getColumnsNames(String tabla) { String[] columns = new String[getColumns(tabla)]; String query = "SELECT column_name FROM information_schema.columns WHERE table_name='" + tabla + "' AND table_schema='" + vg.baseDeDatos + "' GROUP BY column_name ORDER BY column_default"; try { ...
24a0903b-114e-426e-b282-d6f4a44dffb7
2
public static void printmenuConsole() { Connection c = null; Statement stmt = null; try { Class.forName("org.sqlite.JDBC"); c = DriverManager.getConnection("jdbc:sqlite:Restuarant.db"); c.setAutoCommit(false); System.out.println("Opened database successfully"); stmt = c.createStatement(); Result...
50164e7a-8be4-4f10-89cb-8fdaa1009009
8
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage("Commands are designed to be run by players only."); return true; } Player player = (...
8efafb3f-8bb4-4371-95a4-883664ac94bd
0
public LimitSwitchedMotor(SpeedController controller,Trigger top,boolean topOnValue, Trigger bottom,boolean bottomOnValue) { _controller = controller; _top = top; _bottom = bottom; _bgThread.schedule(_bgTask, 0, (long)(DEFAULT_PERI...
5b7f6de1-7762-4ea7-921f-7a2d80c95bf7
0
public int getArea(){ return area; }
7306f084-9d9a-4956-a6aa-66f7aff78d83
0
public void setFecha(Date fecha) { this.fecha = fecha; }
26e01ee9-a4b0-4b7e-9a3c-2d8608605f02
8
public static int countPath3(int m, int n) { if (m < 0 || n < 0) { return 0; } if (m == 0 && n == 0) { return 1; } if (m == 0 && n != 0) { return 1; } if (n == 0 && m != 0) { return 1; } return countPath3(m - 1, n) + countPath3(m, n - 1); }
f081c6b1-1cae-40ec-8a9d-28493ec5b703
2
public static void main(String[] args) throws IOException, ClassNotFoundException { allDirRecords = new ArrayList<DirRecord>(); try { ServerSocket serverSocket = new ServerSocket(portNumber); Socket clientSocket = serverSocket.accept(); int x = 0; for (x = 0; x < 8; x++) { clientSocket = serv...
ab533b67-f2ee-4533-b6a3-a2660e1ca0bb
0
@Override public boolean supportsDocumentAttributes() {return true;}
442485ee-5841-4420-a7d4-f4a9452fdfbf
9
ScriptSegment consumeBuffer(String pBuffer) { //Index of the closest escape character int lClosestEscapeIdx = Integer.MAX_VALUE; EscapeDelimiter lClosestEscapedDelimiter = null; //Index of the closest statement delimiter int lClosestDelimiterIndex = Integer.MAX_VALUE; //Loop t...
0ec81933-c132-49b9-8e02-454cb4b06c72
8
public String position() { if (this.x == 0 && this.y == 0) { return "Origin"; } else if (this.x > 0 && this.y > 0) { return "First Quadrant"; } else if (this.x < 0 && this.y > 0) { return "Second Quadrant"; } else if (this.x < 0 && this.y < 0) { return "Third Quadrant"; } else return "Fourth Qu...
0a275b65-6a6f-48aa-8b81-762e815ceb09
5
public static void deleteUsers(long[] userids) throws MoodleRestUserException, UnsupportedEncodingException, MoodleRestException { String functionCall=MoodleCallRestWebService.isLegacy()?MoodleServices.MOODLE_USER_DELETE_USERS:MoodleServices.CORE_USER_DELETE_USERS; try { StringBuilder data=n...
05b5ca3b-f1b5-4ff2-b586-3c8c367d9dc2
9
* @param onlysupersP * @param MV_returnarray * @return Cons */ public static Cons findDirectSupersAndSubs(Description self, boolean onlysupersP, Object [] MV_returnarray) { Logic.finalizeObjects(); if (self == null) { { Cons _return_temp = Stella.NIL; MV_returnarray[0] = Stella.NIL; ...
7f764c04-834c-471c-99ec-072ea9dd5c28
5
@Override public void mousePressed(MouseEvent e) { super.mousePressed(e); if (Game.currentGame.placedStruct) return; if (Game.currentGame.state == 0 && Game.world.selectedEntity != null && Game.world.selectedEntity instanceof Struct) if (((Struct) Game.world.selectedEntity).guiPoint != null) Game.world.sel...
a8d44003-30ab-46db-9d1e-7133a4f1ecf9
0
@SuppressWarnings("deprecation") private static long getDelayFromNow() { Date nowD = new Date(); Long now = nowD.getTime(); Long start = new Date(nowD.getYear(), nowD.getMonth(), nowD.getDate()).getTime() + Notification.SCHEDULE_DELAY; long diff = now - start; return Notification.SCHEDULE_PERIOD - (diff % No...
4b1570e6-ec42-4e25-838c-62f13616fa13
2
public void run() { try { sleep(10000); // 10s until work starts. while (true) { System.out.println(theBuffer.getLine()); } } catch (Exception e) {/* Let thread terminate. */}; } // run
bb8ff515-1312-4221-b5e0-84911702d824
5
@SuppressWarnings("deprecation") @Override public boolean b(){ Entity ep = null; String[] s = this.entitycreature.getCustomName().split(""); if((CraftPlayer)Bukkit.getServer().getPlayer(s[0]) != null){ ep = ((CraftPlayer)Bukkit.getServer().getPlayer(s[0])).getHandle(); } if(ep == null){ return false; ...
854395d4-dcb1-4eb6-8741-7ab84ac809c8
2
private static void gestionarPrecio( Tienda tienda) { boolean salir; Integer idMusica; float precio; do { try { System.out.print( "Introduce el Id del producto msica: "); idMusica = Integer.parseInt( scanner.nextLine()); System.out.println( "El precio actual de este producto es: " + tien...
464d0a91-78fa-4077-b298-c20aee84d0be
2
public Boolean InRoom() { if (this.CurrentRoom == null) { return false; } if (this.CurrentRoom.ID == 0) { return false; } return true; }
4da6d659-6f30-4d04-b21f-a637d1d2e321
7
public Boom(int x, int y){ this.x = x; this.y = y; if(booms.size()<3){ booms.add(this); final Rectangle r = new Rectangle(); r.setBounds(x,y,width,height); final Boom b = this; new Thread(){ public void run(){ try{ while(alive){ Thread.sleep(10); if(r.intersects(PlayerS...
fdb0fe9a-8127-4fe3-b064-ae3d6143b043
1
public static void main(String args[]) { Random rand = new Random(); Cycle[] cyclesArray = {Bicycle.factory.getCycle(), Tricycle.factory.getCycle(), Unicycle.factory.getCycle()}; for (int i=0; i<5; i++) { cyclesArray[rand.nextInt(3)].ride(); } }
099f5bff-376e-48ae-8a6c-7a57d7394070
3
private void jbStartGameKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jbStartGameKeyPressed if (evt.getKeyCode() == KeyEvent.VK_G) { jbStartGameActionPerformed(null); } else if (evt.getKeyCode() == KeyEvent.VK_H) { jbHowToPlayActionPerformed(null); } else if...
8a9a878f-109b-4f43-8abd-5b801db28231
9
private static void method377(int ai[], int i, int j, int l, int i1) { int k;//was parameter if(aBoolean1462) { if(i1 > DrawingArea.centerX) i1 = DrawingArea.centerX; if(l < 0) l = 0; } if(l >= i1) return; i += l; k = i1 - l >> 2; if(anInt1465 == 0) { while(--k >= 0) { ai[...
ce555b68-6e3a-436d-ada7-98323169cc22
7
private boolean IremoveResourceNode(String resource_id) { boolean nodeRemoved = false; OrientGraph graph = null; try { //String pathname = getPathname(region,agent,plugin); String node_id = getResourceNodeId(resource_id); if(node_id == null) ...
56840206-ee31-4f5b-902b-fd897d04e7b7
1
public void addTag(StatusTag tag) { if (this.tags == null) { this.tags = new ArrayList<StatusTag>(); this.tags.add(tag); } else { this.tags.add(tag); } }
22365540-4170-4ed3-a081-61977efcae09
0
public void setStepOutPending(boolean b) { stepOutPending = b; }
13121860-2548-4911-9397-01d7b53128ac
9
int insertKeyRehash(long val, int index, int hash, byte state) { // compute the double hash final int length = _set.length; int probe = 1 + (hash % (length - 2)); final int loopIndex = index; int firstRemoved = -1; /** * Look u...
ab8958b8-8e37-43ce-89ef-f0207832af85
5
protected void installDoubleClickHandler() { graphControl.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { if (isEnabled()) { if (!e.isConsumed() && isEditEvent(e)) { Object cell = getCellAt(e.getX(), e.getY(), false); if (cell != nul...
a2e2319e-2c4f-4930-929d-832b31f4bd26
4
private void expandCapacity(int minimumCapacity) { int newCapacity = (payload.length + 1) * 2; if (newCapacity < 0) { newCapacity = Integer.MAX_VALUE; } else if (minimumCapacity > newCapacity) { newCapacity = minimumCapacity; } byte[] newPayload = new byte[newCapacity]; try { while (curLength > pay...
b3d21ca5-5b1b-4082-8b57-e72915e35162
9
private boolean expandKeywordsByChi(double ratio){ int wordID, aspectID, selID = -1; double maxChi, chiV; Iterator<Map.Entry<String, Integer>> vIt = m_vocabulary.entrySet().iterator(); while(vIt.hasNext()){//first iteration, select the maxAspect Map.Entry<String, Integer> entry = vIt.next(); wordID = entr...
9b9e3bcd-ec7b-47b2-bf05-f419e42e0d50
7
protected void setBaud(int baud) { this.baud = baud; try { if (baud == 9600) p.writeBytes(BAUD9600); else if (baud == 57600) p.writeBytes(BAUD57600); else if (baud == 1200) p.writeBytes(BAUD1200); else if (baud == 19200) p.writeBytes(BAUD19200); else if (baud == 115200) p.writeByt...
fa8e3ff9-bca6-425c-94b8-01c040bebbc9
5
private static void getPath(String line) { int index = line.indexOf('='); String path = line.substring(index + 1); path = path.trim(); String key = line.substring(0, index); key = key.trim(); File filePath = new File(path); if (filePath.isAbsolute() && filePath.canRead() && filePath.isDirectory()) ...
f59611aa-cfc6-4c46-8981-a48b865d6b10
2
public static EncryptableObject fromByteArray(byte[] array){ try{ ByteArrayInputStream bis = new ByteArrayInputStream(array); ObjectInput in = null; in = new ObjectInputStream(bis); Object o = in.readObject(); try{ bis.close(); in.close(); }catch(Exception e){System.out.println("A Memory Le...
8f217c4b-6c1e-4969-90de-9bc72e26a580
2
private static void goKillSomething(GuildWarsInstance gwInstance) throws IOException { // Moving to the exit portal gwInstance.getPlayer().moveToEx(7510, 5615, 100); // Make the movement look a little less suspicous (this can be done way better though...) gwInstance.getRemainingCommands...
df8d4db2-d69f-4565-b2e8-1604a6b1f0e1
2
public void addFollowing(String email, String friendEmail) { initConnection(); String preparedString = null; PreparedStatement preparedQuery = null; try { //Prepare Statement preparedString = "INSERT INTO friends VALUES (?, ?);"; preparedQuery = (PreparedStatement) connection.prepareStatement(pr...
925cf64e-727f-4f6f-b5a7-cbee75f6e563
2
public MainGUI() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); this.contentPane = new JPanel(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); this.contentPane.setLayout(new MigLayout("", "[424px,grow][]", "[20%:22.52%:20%][][][]...
3f3d9320-0462-421a-ac91-7fd348957586
9
private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } } else { jj_scanpos = jj_...
bb68f3aa-fa4f-4994-acce-d20527781138
1
private Vector[] getArray(){ Vector res[] = new Vector[beings.size()]; for (int i = 0; i < beings.size(); i++){ res[i] = new Vector(beings.get(i).getX(), beings.get(i).getY(), beings.get(i)); } return res; }
e37d0e3e-e0f1-49ec-96c1-9947e50ea0b0
0
public static Test suite() { return new TestSuite( AppTest.class ); }
b4e67d62-e829-4e44-89fc-4252f71385cf
2
public static boolean putAdminChat(Player p, String pName) { if (!PlayerChat.plugin.AdminChat.containsKey(pName)) { PlayerChat.plugin.CustomChat.remove(pName); PlayerChat.plugin.ModChat.remove(pName); PlayerChat.plugin.AdminChat.put(pName, true); Messenger.tell(p, Msg.ADMIN_CHAT_ENTERED); ...
8332a6b9-7513-49fe-9afd-84cf4d5bea1a
7
@Override public boolean write(Writer out, boolean atNewline) throws IOException { if (!isInline() && !atNewline) out.write(DocletConstants.NL); String tagString = htmlTag.toString(); out.write("<"); out.write(tagString); Iterator<HtmlAttr> iterator = attrs.keySet...
97909b3a-9492-4e7c-9529-e329a80c8ee1
6
private void propagate(){ this.latestInput = this.sum; this.sum += this.biasWeight; this.latestSum = this.sum; if(this.type == NeuronType.Hidden){ this.latestoutput = this.funs.activation(this.sum); } else if(this.type == NeuronType.Input){ this.latestoutput = this.sum; } else if(this.t...
fc8b92a0-4502-4f56-984f-7f2990789501
2
public Polynomial pow(int e) { Polynomial x = this; Polynomial r = one(); while (e > 0) { if ((e & 1) != 0) r = r.mul(x); e >>= 1; x = x.mul(x); } return r; }
44cc5e5c-63b5-4b0d-bce4-402cb4ca3b34
7
public void updateUITables() { String[][] table; long time = MainWindow.getCurrentNode(); int n; // signals Map<Contact, Signal> signals = engine.getResults().getSignals(); table = new String[signals.size()][2]; n = 0; for (Contact contact : signals.keySe...
bbe12d50-9a22-429e-b812-08c24291a305
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...
991254b4-73d9-4fd0-8cde-38ada18177e7
9
private void enterBoxData(Map<String, String> request) throws InvalidAttributeValueException { String height = PackagePanel.getPanel().getPackageHeight(); String width = PackagePanel.getPanel().getPackageWidth(); String depth = PackagePanel.getPanel().getPackageDepth(); if ((null == height || height.length() ==...
c14d8c2f-f644-4057-a86a-fa487e1e4fc6
4
private String seperate() { String field = ""; for(int i = 1; i <= dsl.temp.length(); i++) { if(dsl.temp.substring(i - 1, i).equals(":") && (i + 1 < dsl.temp.length())) { if(dsl.temp.substring(i, i + 1).equals(":")) { ...
ee57fa2f-2561-4d78-a54f-f86c36417fc5
6
private void fillAnimationPanel() { for (ImageLabel actObject : dragObject) { if (actObject.getCategory().compareTo(CategoryType.BASS)==0){ actObject.setToolTipText("Bass"); } if (actObject.getCategory().compareTo(CategoryType.BEATS)==0){ actObject.setToolTipText("Beats"); } if (actObject.getCa...
863b2017-f129-40c0-9915-7c2826bf3e56
3
/* */ public void updateGroundEffects(Graphics g) { /* 422 */ for (int i = 0; i < groundEffects.size(); i++) { /* 423 */ Effect e = (Effect)groundEffects.get(i); /* 424 */ e.update(17); /* 425 */ if ((e.isElapsed()) || (!e.alive)) { /* 426 */ groundEffects.remove(i); /* 427 */ ...