method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e5ea23c9-b90e-4f34-9ba1-ac6c2c265b97
2
@Override public void actionPerformed(ActionEvent event) { // Wenn auf den Button "Abbrechen" geklickt wird, wird das Login-Fenster // geschlossen if (event.getActionCommand().contains("Abbrechen")) { guiLogin.closeLoginDialog(); } // Wenn auf den Button "Login" geklickt wird, wird die Anmeldung // ver...
d0b99bb0-1511-4ce1-b1e9-82bbb7f345ed
1
private String getCreate( String variable ) { StringBuilder sb = new StringBuilder(); sb.append( "\n" + TAB + TAB + TAB + variable + " " + toJavaCase( variable ) + " = Test" + variable + "Dao.create" + variable + "();\n" ); if ( !getCreatedCalled ) { sb.append( "\n"...
d8d8e620-843e-4e6c-9d44-958f28308bc0
5
public void ActivateForceSpace(){ //20130709总之现在C++的版本上进行修改 //马上发现一个巨大的问题,这里的Symbol是从ObjectList中得到的,但我这次没有建OjectList…… //另外就是一个比较长远的问题,那就是我肯定是要有一个类似ObjectList的东西的,但远比现在这个什么都没有,只有Symbol属性的复杂。 //但放在那里好呢?MainSpace里,还是Mind里?这一方面是个理论问题,另一方面是个实现的问题。因为要控制可访问性。 //如果仅是为一时使用的话,可以把Object放在Attribute里。 //1.找到当前激活强度为2的节点...
0459b9d9-8749-48f1-9855-8a4cf785ada7
4
protected Automaton createEmptyAutomaton(Document document) { Map e2t = elementsToText(document.getDocumentElement()); String s = (String) e2t.get(TURING_TAPES_NAME); if (s == null) s = "1"; try { int tapes = Integer.parseInt(s); if (tapes < 1 || tapes > 5) throw new DataException(tapes + " i...
0797294f-0b41-4695-97c9-9f789fd6e6e7
5
private static void Sortingbydifference() { // TODO Auto-generated method stub int i = 0; int j = 0; for (i = 0; i < 10000; i++) { for (j = 0; j < 9999; j++) { if (jobs[j][2] < jobs[j + 1][2]) { int l, m, n; l = jobs[j][0]; m = jobs[j][1]; n = jobs[j][2]; jobs[j][0] = jobs[j + 1...
f26b0067-bcfb-420d-ae46-53cf69f1cf74
6
public String getDescription() { if (fullDescription == null) { if (description == null || isExtensionListInDescription()) { fullDescription = description == null ? "(" : description + " ("; // build the description from the extension list Enumeration ...
387d8961-3e43-4d25-a537-504773922a77
3
public static Pair<String, String> findBothinFile(String fileName, Pattern pattern1, int group1, Pattern pattern2, int group2 ) throws FileNotFoundException { Pair<String, String> p = new Pair<String, String>(null, null); Scanner sFile = new Scanner(new File(fileName)); while (sFile.hasNextLine()) { ...
d9f448e1-3ff6-4bf6-a0a7-55f85e9cb4b8
9
public boolean loadGame(boolean[][] givenCells, int[][] allFilledCells) { initialGrid = new int[SudokuFrontEnd.colCount][SudokuFrontEnd.rowCount]; partialSolvedGrid = new int[SudokuFrontEnd.colCount][SudokuFrontEnd.rowCount]; boolean[][] cellsLocked = new boolean[SudokuFrontEnd.colCount][SudokuFrontEnd.rowCount]...
5a2bf1af-ab97-4d80-803a-693a2f590b0d
3
public TreeRow overRow(int y) { if (y < 0) { return null; } int dividerHeight = getRowDividerHeight(); for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) { y -= getRowHeight(row) + dividerHeight; if (y < 0) { return row; } } return null; }
bac011a2-d2e4-4d2a-a1c9-116f22ef4ac1
9
private static Object createLoaderKey(String className, ClassLoader parentLoader, ProtectionDomain domain) { String packageName; { int index = className.lastIndexOf('.'); if (index < 0) { packageName = ""; ...
070205ae-909f-47da-a656-17d7f040664f
1
public String getString(int index) throws JSONException { Object object = this.get(index); if (object instanceof String) { return (String) object; } throw new JSONException("JSONArray[" + index + "] not a string."); }
6bc77f67-cf3f-46b6-baf4-18ed5b77a328
4
public static void updateMarker(Spawn point) { Marker m = set.findMarker(point.getName()); if (m != null) { if (m.getX() != point.getX() || m.getY() != point.getY() || m.getZ() != point.getZ()) { m.setLocation(point.getWorldName(), point.getX(), point.getY(), point.getZ()); ...
248b936c-d722-4dea-a600-2ed8e4cdaf72
9
@Override public void subSample(int[] input, int[] output) { int offs = this.offset; final int h = this.height; final int w = this.width; final int st = this.stride; final int[] buf1 = this.buffer1; final int[] buf2 = this.buffer2; final int count = this.dim * this.dim; ...
5fd29328-35b7-4407-a8bd-5822d2a4eea2
9
public List<Location> circle (Location loc, Integer r, Integer h, Boolean hollow, Boolean sphere, int plus_y) { List<Location> circleblocks = new ArrayList<Location>(); int cx = loc.getBlockX(); int cy = loc.getBlockY(); int cz = loc.getBlockZ(); for (int x = cx - r; x <= cx +r; ...
d7cc3446-2904-483a-b915-abb003fb7f7b
7
private void deleteAt(MouseEvent arg0) { System.out.println("gonna click"); Iterator<Map.Entry<Integer, Point>> it = panel.rectangles.entrySet().iterator(); ClassInstance instance = null; Point click_point = arg0.getPoint(); while(it.hasNext()) { Map.Entry<Integer, Point> entry = it.next(); Point p = en...
16ad789a-3900-437e-9a3b-204561cb3e68
9
public static boolean isSameTree(TreeNode p, TreeNode q) { if(p == null && q == null) return true; else if (p == null && q != null) return false; else if (p != null && q == null) return false; else if (p.val != q.val) return false; ...
777d0e31-4961-435f-aec9-67d82c221636
1
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); size = Integer.parseInt( this.getServletConfig().getInitParameter("size") ); codes = this.getServletConfig().getInitParameter("codes"); Random rd = new...
bd141ae8-3e64-46d8-8042-a220f9df38e3
1
public void showSplash() { JPanel content = (JPanel)getContentPane(); content.setBackground(new Color(255, 140, 0, 255)); // Set the window's bounds, centering the window int width = 600; int height = 300; Dimension screen = Toolkit.getDefaultToolkit().g...
43166eae-d379-4fac-8175-de0cbc55b24e
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...
81775917-0513-48f3-9f12-5bf9d92dbc31
9
public String listItem(User user) { String result = ""; result += "Book: " + super.getName() + " - " + getAuthor() + "\n"; if (super.getNumberOfCopies() <= 0 && !super.isElectronicallyAvailable()) { result += "Currently unavailable.\n"; } else { result += "Availab...
3ec00e13-910d-4476-b82f-aaae2c954fcd
8
public ArrayList<Membership> GetPromotionsData() throws UnauthorizedUserException, BadConnectionException, DoubleEntryException { /* Variable Section Start */ /* Database and Query Preperation */ PreparedStatement statment = null; ResultSet results = null; ...
b9dcb5e9-67cf-4ada-b2e8-abfe3adb9e35
5
public Ol(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "compact": compact = Compact.parse(this, v); break; case "reversed": reversed = Reversed.parse(this, v);...
94ac9de7-5b3a-4df0-88aa-82bbe68f4edd
9
protected ExecutionResult readOlrunnerVerdict(final Path verdictFile) throws IOException, IllegalStateException, NumberFormatException { final String text = FileAccess.readUTF8String(verdictFile).trim(); /* * Capture one of the following: $1 $1($2) $1($2,$3,$4) */ final Pattern pattern = Pattern .c...
8c5eb6a8-dccd-49c7-9d44-2ca2ceb6b9dd
2
public void serverDelete(Connection connection, String local_path) { try { Statement stmt = connection.createStatement(); if (inServerDB(connection, local_path))// already exists so should // update { PreparedStatement ps = connection .prepareStatement("DELETE db_like_files WHERE pat...
35f84d70-5352-4bb8-87d1-a5be6f1ce5f6
2
public Boolean isIgnore(int c) { if ((char) c == ' '|| (char) c == '\n') return true; else return false; }
1e7e21f4-23d9-45e4-9ec8-0971a89041e8
7
public void fromElement(Node hijoDeNodo) { NodeList hijosDeUnidad = hijoDeNodo.getChildNodes(); for (int i = 0; i < hijosDeUnidad.getLength(); i++) { Node hijoDeUnidad = hijosDeUnidad.item(i); if (hijoDeUnidad.getNodeName().equals("costo")) { this.costo = Integer.valueOf(hijoDeUnidad.getTextContent()); ...
076f4741-a977-4d8c-bd91-99d5cbd4dbc8
5
public static boolean delete(File path) { if (!path.exists()) return false; boolean ret = true; if (path.isDirectory()){ for (File f : path.listFiles()){ ret = ret && delete(f); } } return ret && path.delete(); }
9ad2d592-71ce-4eca-ad8a-2cab4216f8a4
2
@SuppressWarnings("unused") public static void applySkin(String filename) { Path skinPath; if (!filename.endsWith(Constants.SKINFILE_SUFFIX)) { skinPath = Constants.PROGRAM_SKINS_PATH.resolve(filename + Constants.SKINFILE_SUFFIX); } else { skinPath = Constants.PROGRAM...
a5fc1860-62b7-4194-8141-da76c04f0bf0
4
public final static void main(final String[] args) throws ReflectiveOperationException { final ModuleLoader loader = ModuleLoader.createLoader(); final Class<?> scClass = loader.loadClass("stone.StartupContainer"); final Class<?> mainClass = loader.loadClass("stone.modules.Main"); final Class<?> flagClass = ...
93447088-aadc-48be-b83f-5fa7eeda7c8c
4
private void miCidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miCidadeActionPerformed if (getCadCidade() != null && !cadCidade.isVisible()) { deskPane.remove(getCadCidade()); setCadCidade(null); } if (getCadCidade() == null) { setCadC...
751d5c71-1ba0-4e82-99bf-8b9bc37bc182
2
private void endFrame() { if (previousFrame != null) { // do not write the first frame if (stackMap == null) { stackMap = new ByteVector(); } writeFrame(); ++frameCount; } previousFrame = frame; frame = null; }
f803b0b2-edb6-4de4-bcc6-d02ae3b81eeb
9
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: labelNotificaciones.setText(""); if (!agente.getColorJugador().equalsIgnoreCase(labelColor.getText())) { labelNotificacio...
33474393-a5fa-4ba5-8970-cef93b6b9cbe
7
public boolean push(Tache t) { if (t == null) return false; int id = t.id(); if (id == 0) return false; Map<Integer, Tache> m = table(id); if (m.containsKey(id)) return false; m.put(id, t); if (t.isTache()) { if (t.rid() != 0) ids(t.rid()).add(id); if (id > lid) lid = id; } e...
8a8f3834-df49-4e50-9ed3-7000fedb5ad3
1
public void updateItems() { StockItem[] items = new StockItem[model.getWarehouseTableModel().getRowCount()]; model.getWarehouseTableModel().getTableRows().toArray(items); productSelectionJComboBoxField.removeAllItems(); for(StockItem item : items) { productSelectionJComboBoxField.addItem(item); } }
cbdcefe4-bd49-4da2-8967-e54c3658ef24
9
public Card(int value,String suit){ this.suit=suit; this.value=value; cardNumber = value; /** determine card number **/ if(suit.equals("Diamonds")) cardNumber += 13; else if(suit.equals("Hearts")) cardNumber += 26; else if(suit.equals("Spades")) cardNumber += 39; /** determine card name, va...
2bc90526-c81c-4860-a16b-bdc476b30674
1
public static Matrix4f toOrtho(Matrix4f m, float left, float right, float bottom, float top, float near, float far) { if (m==null) { m = new Matrix4f(); } float x_orth = 2 / (right - left); float y_orth = 2 / (top - bottom); float z_orth = -2 / (far - near); ...
db9db2ae-d07a-42db-a530-08b50302b902
2
public float[][] getM() { float[][] res = new float[4][4]; for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) res[i][j] = m[i][j]; return res; }
7f3a9434-e13c-4f58-878b-640d5bbf33d0
1
private String formatTestMethods(List<Test> tests) { StringBuilder code = new StringBuilder(); for (int i = 0; i < tests.size(); i++) { Test test = tests.get(i); code.append(formatTestMethod(test, i)); } return code.toString(); }
f5e91356-3c21-400e-8180-3176ea97f8a1
7
public static synchronized void playSound(final String url, boolean loop) { try { if (url.contains("hit")) { if (hit != null) hit.stop(); hit = AudioSystem.getClip(); String path = "/sounds/" + url; AudioInputStream inputStream = AudioSystem.getAudioInputStream(Game.class.getResource(path)); hi...
bd922553-f0b7-4e23-aaa3-bf4bb2f75c93
1
public List<TimeSeriesDescription> getTimeSeriesDescription() { if (timeSeriesDescription == null) { timeSeriesDescription = new ArrayList<TimeSeriesDescription>(); } return this.timeSeriesDescription; }
e005f1b7-94c9-4e24-b82b-bcbf7b244d62
8
private String getString(boolean fork, List<FormQuestion> toAsk) { long start = System.currentTimeMillis(); String obsId = UUID.randomUUID().toString(); String result = ""; for(int i = 0; i < toAsk.size(); i++) { FormQuestion q = toAsk.get(i); String tag = i == toAsk.size() - 1 ? "OK" : "DATA_MISSING";...
1832aad7-d413-45b8-a389-998666cb7091
5
private static void openFile(String filepath) { if ((filepath != null) && (!filepath.equals("")) && (!filepath.equals("%1"))) { try { // ensure that we have a full pathname [srk] filepath = new File(filepath).getCanonicalPath(); // grab the file's extension String extension = filepath.substring(fi...
9d31f55a-61ff-4293-a806-b2e1d396c577
7
@Override public boolean tick(Tickable ticking, int tickID) { super.tick(ticking,tickID); if((canAct(ticking,tickID))&&(ticking instanceof MOB)) { final MOB mob=(MOB)ticking; if(debug) Log.sysOut("ZAPHUNT", "Tick starting"); if(!isHunting(mob)) { if(debug) Log.sysOut("ZAPHUNT", "'"+mob....
99cc0ecc-87e1-4582-8789-4f26e79bb98a
9
public BigDecimal value() { if (op == null) return value; BigDecimal l = left.value(); BigDecimal r = (right != null) ? right.value() : null; switch (op) { case ADD: return l.add(r); case SUB: return r != null ? l.subtract(r) : l.negate...
80af8fd4-eadc-4d24-bfce-8d937e4e7eff
1
public DatabaseTaskResult queueAndWaitIndefinitely(IDatabaseTask theTaskOf, Object[] runArgs) throws InterruptedException { if (!isAlive) throw new RuntimeException("Cannot queue job; the database has been shut down."); DeferredDBTask theTask = new DeferredDBTask(theTaskOf, runArgs); runQueue.put(theTask); ...
a8cbd58e-121f-4530-ad7b-0e5a2bed05ae
9
public boolean equalsHelper (Expression theorem, Expression e) { // base case if (theorem == null || e == null) { return true; } /* The given expression must contain at least all of the operators in the theorem. This if statement checks that all of * the theorem's operators are present in the given e...
4cb7d46f-a863-46ef-a7fb-fe4b3027c870
8
private void BtnEncerraOpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnEncerraOpActionPerformed int idprod=0; double estoqueatu=0,qtdprod=0; String Item = null,Qtde = null,unidade=null; //pega o id do produto produzido while (Item == null || Item.equals("")) { ...
69bea76d-a73c-4a64-aa33-487526372a2d
3
public final void set(final String s) { if ((s == null) || s.isEmpty()) { clear(); return; } if (this.content[this.cIdx].length < (s.length() + (StringBuilder.PATTERN_SIZE * 2))) { this.content[this.cIdx] = new char[(s.length() + (StringBuilder.PATTERN_SIZE * 4)) - (s.length() % (StringBuilder.PATTE...
61a85646-37ce-44b0-82fb-308ea66fe774
9
private AlgebraicParticle multiplyBy(Equation eq) { AlgebraicParticle left = eq.left(), right = eq.right(); if(left instanceof Fraction && right instanceof Fraction && left.exponent() == 1 && right.exponent() == 1) { Fraction fracLeft = (Fraction) left, fracRight = (Fraction) right; //if the bottom left is co...
a26cd51b-60e6-489b-9477-41a570e3658f
7
public void run() { while(!terminated) { try { synchronized(this) { while(!activated) wait(); } activated = false; while(true) { try { sleep(2000); } catch(InterruptedException e) { terminated = true; return; } try { if(_disconn...
b8335482-de1d-4656-bf07-922f56e6bbbc
6
private void lifeCycle() { String s = ""; String event1StringView = ""; String event2StringView = ""; while (isInputActive) { try { s = readInput(); if (s.length()==0) { break; } if (this.isValidInput(s)) { if (!isEventSet1) { event1StringView = s; this....
51664319-7762-4e9e-95d1-b9aaa11d348d
2
private void partition(Object data) { String str = data.toString(); int seq = 0; while (str.length() != 0) { Datagram newGram = new Datagram(); newGram.setDstaddr(desIP); newGram.setDstport(desPort); newGram.setSrcaddr(srcIP); newGram.setSrcport(srcPort); newGram.setChecksum((short) 0); ...
b5c16d1f-26b6-4cdf-b62d-ff5ce517e5f4
7
public List<Area> getBuildableAreasPlusUnits(Player player, List<Area> areasWithAVirtualUnit) { List<Area> result = new ArrayList<Area>(); for (Area area : getAreas()) { int nbUnitsVirtuallyAddedToThisZone = 0; for (Area a : areasWithAVirtualUnit) { if (a == area) { nbUnitsVirtuallyAddedToThisZone++;...
169e3e69-1cb2-48bf-b8f1-b0036952747e
4
public Game.PlayerTurn getValue() { boolean test = false; if (test || m_test) { System.out.println("Coordinate :: getValue() BEGIN"); } if (test || m_test) { System.out.println("Coordinate :: getValue() END"); } return m_Value; }
8b7d34ae-b285-4efc-a5f9-0a2f6d52e7d1
8
public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int M = in.nextInt(); double V = in.nextDouble(); int A = in.nextInt(); int B = in.nextInt(); ArrayList<Link> links = new ArrayList<Link>(); for (int i = 0; i < M; i++) { int first = in.nextInt(); ...
65c1346b-abc7-425c-af9a-381749f34403
5
@Override public String toString() { int i; StringBuilder sb = new StringBuilder(); if (this.getMarks() != null) { try { if (average() != 0) { sb.append(super.toString()); sb.append("\n\tPromotion: " + p.getName()); sb.append("\n\tId: ").append(id).append("\n\tMarks: "); for (i = 0; ...
db79e465-519f-4f78-8827-9acb4e317edd
1
public synchronized void stopServer() { this.isStopped = true; try { this.serverSocket.close(); } catch (IOException e) { throw new RuntimeException("Error deteniendo el servidor", e); } }
50f3001b-1f3a-423b-abd3-53ebdf862193
8
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS...
0ae86b62-4e28-443d-9835-ad4f41a4bbab
9
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("gm")){ if(sender instanceof Player){ Player p = (Player) sender; if(p.isOp() || p.hasPermission("scmds.gm")){ if(!(args.length < 1)){ if(args[0].equalsIgnoreCa...
37fec9eb-8baa-4179-bb2f-0e76566a7e1a
8
private resultFindMax FindMax(int level, TKind me, TKind opponent) { int min, score, tnb, tnw; TKind[][] TempBoard = new TKind[8][8]; int[] TempCounter = new int[2]; resultFindMax res = new resultFindMax(); level--; res.nb = counter[0]; res.nw = counter[1]; ...
50ccd8ef-412b-44d9-b5cb-79e66328a969
7
public void combine(String IP_PORT,String apiKey){ DBService dbService = new DBService(); HashMap data = null; if(this.link.contains("jd.com")){ PageJingdong pageJingdong = new PageJingdong(); data = pageJingdong.getInfo(this.link); } FileService fileServi...
f28538a7-18ec-49a9-9e5f-1ea6cc5fd647
2
public boolean isPNG(String path) { int i = path.length() - 3; if (path.substring(i).equals("png") || path.substring(i).equals("PNG")) { return true; } return false; }
c6d22b5f-f01b-4cef-9a68-bed1f7001a0e
9
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Edge other = (Edge) obj; if (from == null) { if (other.from != null) return false; } else if (!from.equals(other.from)) return false; if...
50c368e5-6c35-4610-8a6e-c5126fc8a440
4
public void makeSprings() { Mass one; Mass two; double restLength; double constant; NodeList nodes = myDoc.getElementsByTagName(SPRING); for (int i = 0; i < nodes.getLength(); i++) { restLength = -1; constant = 1; Node springItem = nodes.item(i); NamedNodeMap nodeMap = springItem.getAttributes...
3fd2d00e-ccfe-41b8-a92e-c4bbba7ff98d
5
@EventHandler public void onInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); Block block = event.getClickedBlock(); int found = 0;//how many pending displays for player boolean canBuild = false; if (event.getAction() == Action.RIGHT_CLICK_BLOCK && player.getItemInHand().getType() ...
5d71e88c-1079-4d66-83b9-27e5ec1d6106
8
@Override public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp) { final java.util.Map<String,String> parms=parseParms(parm); final String last=httpReq.getUrlParameter("GOVERNMENT"); if(parms.containsKey("RESET")) { if(last!=null) httpReq.removeUrlParameter("GOVERNMENT"); re...
ebe192a6-8d05-4a64-bf12-a3dec960f167
8
private static ServerType getServerType(final BasicDBObject isMasterResult) { if (isReplicaSetMember(isMasterResult)) { if (isMasterResult.getBoolean("ismaster", false)) { return ServerType.ReplicaSetPrimary; } if (isMasterResult.getBoolean("secondary", false...
d7efafea-7618-4966-bb94-1ed56b14dbf8
2
public Connection connect() throws SQLException { if (con == null || !con.isValid(0)) { con = DriverManager.getConnection(url, user, password); } return con; }
ec4c5a10-4969-477a-bbda-f553b04c0358
9
public void actionPerformed(ActionEvent e) { if (inGame) { double curDelay = (double) (System.currentTimeMillis()-timerHelp); fps = (int) (1/((double)(curDelay/1000))); timerHelp = System.currentTimeMillis(); checkCollision(); } //checks to see if key is held down every game loop if (wPres...
2e2f3a31-86e7-46db-8d89-bf580f4c02b8
4
public ParseTreeNode excludeSet() throws SyntaxError { ParseTreeNode node = new ParseTreeNode("<exclude-set>"); if (accept('^')) { node.addChild("^"); node.addChild(charSet()); if (accept(']')) { node.addChild("["); } if (accept('I')) { node.addChild("I"); } if (accept('N')) { node....
32426348-d76a-41af-b9cc-4748902d1de6
8
public static StudentBean fetchStudentInfo(int id) { StudentBean bean = new StudentBean(); ResultSet rs=null; Connection con=null; PreparedStatement ps=null; try{ String sql="SELECT S.S_ID, S.DEPTID, S.MAJOR, D.DEPTNAME " + "FROM STUDENT S, DEPARTMENT D WHERE S.DEPTID=D.DEPTID AND" + " S_ID=?"; ...
d4e18d38-5d22-41d3-bef5-a36bbb446558
4
public Injector injector(Object who, String fieldName) { Preconditions.notNull(who); Preconditions.hasText(fieldName); Field field = null; boolean hasField = false; try { Method[] setters = setters(fieldName); if (setters.length == 1) { return Injectors.newSetterInjector(who, setters[0]); } ...
14d557cb-da15-4024-b614-eec942598a99
5
public void keyReleased(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_SPACE: case KeyEvent.VK_W: this.player.setMovingUp(false); break; case KeyEvent.VK_D: this.player.setMovingRight(false); break; case KeyEvent.VK_S: ...
a421f595-c1d4-4050-89c3-e0ec59fb09df
0
public X509Certificate[] getAcceptedIssuers() { return sunJSSEX509TrustManager.getAcceptedIssuers(); }
f42412f1-2913-404f-a10f-b83c95526a50
3
@Test public void passed() { for(int i=5;i<100;i++){ TestResult result = tester.test(StringGenerator.genString(i), i); if( !result.passed ){ System.out.println(result.message); } Assert.assertTrue(result.passed); result = tester.test(StringGenerator.genString(i-1), i); if( !result.passed ){...
820f5cd3-10b9-4149-8e49-7183c84efa75
7
@Override public void layoutContainer(Container parent) { synchronized(parent.getTreeLock()) { Insets insets = parent.getInsets(); Component comps[] = parent.getComponents(); if(comps.length == 0) return; int comp = 0; int wGaps = (cols - 1) * colGap; int wNoInsets = parent.getWidth...
fcd05811-3c44-457f-b980-c1ec86801318
0
private String socketRepr(Socket s) { return new StringBuilder(s.getInetAddress().getHostName()) .append(":").append(s.getPort()).toString(); }
4f3e51d3-5c24-4a04-9146-ff51432eb32b
1
public CallFrame() { setSize(WIDTH, HEIGHT); Toolkit kit = Toolkit.getDefaultToolkit(); if(MainFrame.xLocationForCallFrame+450>=kit.getScreenSize().width) MainFrame.xLocationForCallFrame=MainFrame.xLocationForCallFrame-MainFrame.frame.getWidth()+550; setLocation(MainFrame.xLocationFo...
5658ca0c-df62-47f0-a9b0-107b18cc22a1
9
public TableData join (String outputName,TableData leftTable, TableData rightTable, ArrayList <String> leftHash, ArrayList <String> rightHash, OutputStructure outputStructure, String selectionStatement) { System.out.println ("Start running a join on "+outputName); ArrayList <Attribute> inAttsLeft = getAtt...
9a992cd9-d18e-4cf8-ae06-59698f6ec310
9
@Override public boolean isHandlerAt(final Point p) { if (this.handlerType == NO_HANDLERS) { return false; } final Boolean squareHandlers = this.nw.isAt(p) || this.ne.isAt(p) || this.se.isAt(p) || this.sw.isAt(p); if (this.handlerType == RECTANGLE_HANDLERS) { ...
85e725b7-e3aa-4132-b330-7b88a35a8181
0
public StarMessageShower(String message,IOnStringInput onStringInput) { super(message, SYMBOL, onStringInput); }
9abb8590-e210-450b-8d96-2e3b95d11c16
2
public void testWithers() { MonthDay test = new MonthDay(10, 6); check(test.withMonthOfYear(5), 5, 6); check(test.withDayOfMonth(2), 10, 2); try { test.withMonthOfYear(0); fail(); } catch (IllegalArgumentException ex) {} try { test.with...
0737daed-cd1e-44a8-a862-be05d6863ece
3
@Override public double getYRotation() { double lowest = 9001; double highest = 0; for (Block block : blockArray) { if (block.getYValue() > highest) highest = block.getYValue(); if (block.getYValue() < lowest) lowest = block.getYValue(); } return (highest + lowest) / 2; }
acd54a2f-d585-484f-8d43-87788c616901
0
public void mouseClicked(MouseEvent e){ }
79752cb5-b541-4461-88c8-d6f5d8526ce9
6
public void codageNRZT() { float penteMontante = 0.0f; float penteDescendante = 0.0f; for (int i = 0; i < informationRecue.nbElements(); i++) { if (informationRecue.iemeElement(i)) { // cas d'un "1" // Pente montante for (int j = 0; j < nbEchantillon / 3; j++) { penteMontante = ((max - min) * 3...
7b4d7eb2-0f34-4cf5-943c-4701cdd133cc
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Station station = (Station) o; if (id != station.id) return false; if (name != null ? !name.equals(station.name) : station.name != null) return...
23620cd1-6e2e-4bde-9739-6e8dacb12d37
6
private static void matchBookNames() { //do simple match first Iterator<Desc> iter = descs.iterator(); while (iter.hasNext()) { Desc desc = iter.next(); int matchIndex = simpleNameMatch(desc.keywords); if (matchIndex >= 0) { //simple match succ ...
47485f88-4b09-4d9c-9e88-fbaa40914f8f
6
@EventHandler public void SpiderMiningFatigue(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.getSpiderConfig().getDouble("Spider.M...
8808b9fb-eebc-4fa2-8c65-30e0f7b30a24
8
static void generate_adpcm(ADPCMVoice voice, ShortPtr buffer, int samples) { /* if this voice is active */ if (voice.playing != 0) { UBytePtr _base = voice._base; int sample = (int) voice.sample; int signal = (int) voice.signal; int count = (int) voice.cou...
8c7c3281-913d-4ab2-8e05-10a45338e1f0
3
protected static void revertFile(OutlinerDocument document) { // get the document info and file protocol DocumentInfo docInfo = document.getDocumentInfo(); FileProtocol protocol = Outliner.fileProtocolManager.getProtocol(PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PROTOCOL_NAME)); // ...
b62541f2-fb96-4dac-ba2a-a036df15f105
8
private void scaleDrawing(Mesh mesh, float newScale) { /* * allows for Draw to scale object * have to watch out for double-listed vertices * */ if (newScale == 0 || mesh.vertexCount == 0 || mesh.scale == newScale) return; Vector3f diff = new Vector3f(); float f = newScale / me...
dbfdca79-7686-453a-b911-5f38e9feb25a
0
public void incFrequency(){ this.termFrequency++; }
41f9bfe0-8929-4251-bbfd-7b29a4d3bc7d
9
static int decode_packet(Pointer<Integer> got_frame, int cached) throws IOException { int ret = 0; int decoded = pkt.get().size(); got_frame.setInt(0); if (pkt.get().stream_index() == video_stream_idx.get()) { /* decode video frame */ ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, p...
5c58c085-876e-461e-b666-e8836f97259a
4
public List<String> extractPathLocally(String startUrl) { List<String> pathList = new ArrayList<String>(); // home verzeichnis pfad über system variable // String loc = System.getenv("HOME")+"/wsp/configs"; // out.println("hom variable + conf datei : "+loc); File f = new File(startUrl); // out.println("read...
d9a73774-6243-4fbd-a970-2bbbdac0228f
7
public LabourData(FreeColClient client) { Specification spec = client.getGame().getSpecification(); for (UnitType unitType : spec.getUnitTypeList()) { if (!unitType.isAvailableTo(client.getMyPlayer())) { continue; } GoodsType production = unitType.getE...
4c6bb83b-a5b7-4f5a-bdd5-d32d44673466
2
private void sendMessage(String text) { Config.Log("[WorldData] " + text); if (notifyPlayer != null && notifyPlayer.isOnline()) notifyPlayer.sendMessage("[WorldData] " + text); }
4719f792-a140-441a-90dd-7382193cf556
1
public void stop() { try { stopPlayer(); } catch (JavaLayerException ex) { System.err.println(ex); } }
d0303068-6cd4-4e7e-9641-b390cd315a54
7
private double calcNiceNumber(final double RANGE, final boolean ROUND) { final double EXPONENT = Math.floor(Math.log10(RANGE)); // exponent of range final double FRACTION = RANGE / Math.pow(10, EXPONENT); // fractional part of range //final double MOD = FRACTION % 0.5; /...
886484b5-1c6f-481c-939a-fbfc01b2c21a
6
public ArrayList<EmpleadoDTO> getAll() { ArrayList<EmpleadoDTO> empleados = new ArrayList<EmpleadoDTO>(); try { conn = PaginaWebConnectionFactory.getInstance().getConnection(); String query = "select * from usuario"; ps = conn.prepareStatement(query); rs = ps.executeQuery(); EmpleadoDTO emp; ...
bde1a414-7ade-42ba-81c6-017d0df878fc
0
public void onTick(Instrument instrument, ITick tick) throws JFException { }