method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
60bc07a4-1e34-4856-b66d-801744d71b16
9
public static void main(String[] args) throws IOException { FileSystem fs = FileSystem.get(new Configuration()); Path[] pages = FileUtil.stat2Paths(fs.listStatus(new Path(args[0]), new PathFilter(){ @Override public boolean accept(Path path) { return path.getName().endsWith(".html"); } })); FS...
cde95637-e140-4da6-b30d-6fae2562edc1
4
private Koordinate getMax(WarMachine warMachine, Koordinate koord, Ausrichtung ausrichtung) { switch (ausrichtung) { case XPLUS: return new Koordinate(koord.getX() + warMachine.getLaenge() - 1, koord.getY() + warMachine.getBreite() - 1); case XMINUS: return koord; case YPLUS: return new Koordin...
4d728a7c-62d4-4d22-8a73-ce57f06f10bb
3
public static int getMouseButtonCode(MouseEvent e) { switch (e.getButton()) { case MouseEvent.BUTTON1: return MOUSE_BUTTON_1; case MouseEvent.BUTTON2: return MOUSE_BUTTON_2; case MouseEvent.BUTTON3: return MOUSE_BUTTON_3; ...
abc78712-df69-47cc-bfa3-879213424867
9
public synchronized boolean equals(Object obj) { if (!(obj instanceof BatchFileFetchResult)) return false; BatchFileFetchResult other = (BatchFileFetchResult) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equal...
c45d8b0a-dc79-44e8-b238-f88d28f96be3
6
private boolean validarDatos() { //unicamente valido el numero de cuenta boolean valido = false; Validaciones val = new Validaciones(); if (jTextField1.getText().equals("") || jTextField2.getText().equals("")){ mensajeError("Ingrese un valor para Desde.. Hasta."); ...
a9d540ff-7c75-4790-a55f-d1acac8d9194
3
private void createWheel(int n, boolean edges) { double d = canvas.getHeight() / 3 * Math.sqrt(n) / 5; createVertex(0.0, 0.0, getNewVertexID()); for (int i = 0; i < n; ++i) { createVertex(d * Math.sin(i * 2 * Math.PI / n), -d * Math.cos(i * 2 * Math.PI / n), getN...
73291e5d-f5fd-47e3-9acc-9809ac417a4c
1
public Connection avaaYhteys() throws DAOPoikkeus { try { return DriverManager.getConnection( DBConnectionProperties.getInstance().getProperty("url"), DBConnectionProperties.getInstance().getProperty("username"), DBConnectionProperties.getInstance().getProperty("password")); } catch(Exception e)...
76a1bef6-624b-48d8-b87f-73f6e674ecde
5
public void start() { end = false; try { ServerSocket ss = new ServerSocket(port); while (!end) { //Accept socket and create a new ClientThread Socket s = ss.accept(); ClientThread ct = new ClientThread(s); clientList.add(ct); ct.start(); } try { //Attempt to close sockets/clients...
5cc78529-a192-469d-9d4d-f35a54d3b87d
3
private BufferedImage decode() throws IOException { ImageReadParam readParam = null; if (getDecode() != null) { // we have to allocate our own buffered image so that we can // install our colour model which will do the desired decode readParam = n...
d72d2556-342d-4345-b954-28a776f09624
3
public boolean equals(Object obj) { if (!(obj instanceof UUID)) return false; if (((UUID)obj).variant() != this.variant()) return false; UUID id = (UUID)obj; return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); }
2ccedeb2-b411-4c84-a69a-74160f42828a
0
@Override public String introduceYourself() { return "TextQuest"; }
5128a8d3-c59a-4b8d-ba68-2acd82dc160c
4
private boolean check1(int i, int j) { int first = getMatrix(i, j); if (first == 0 || first == -1) { return false; } int second = getMatrix(i, j + 1); int third = getMatrix(i, j + 2); if (first == second && first == third) { return true; } return false; }
4cee75fe-9ecb-4519-9ed6-2a21eae67243
7
public Void doInBackground() { setProgress(0); ArrayList<Point2D> ser = new ArrayList<Point2D>(); int count = 0; int total = seqs.size()*(seqs.size()-1)/2; int step = total/10+1; int[] hist = new int[seqs.getMaxSeqLength()]; ...
c9a02ea7-51a4-4aae-a7f7-4b6ec5f37adb
9
private String checkFieldAndReturnTransferType() { int fromProjectID = ((KeyValue) cmbFromProject.getSelectedItem()).getKey(); int toProjectID = ((KeyValue) cmbToProject.getSelectedItem()).getKey(); int fromDepartmentID = ((KeyValue) cmbFromDepartment.getSelectedItem()).getKey(); int toD...
997f3997-ed0a-4500-82a9-5ac51e4edf8e
6
public Date getToOpenDate () { Date toOpenDate = null; for (ReceptionsFilter filter: filters) { if (filter instanceof OpenDateReceptionsFilter) { OpenDateReceptionsFilter openDateFilter = (OpenDateReceptionsFilter) filter; Date filterToOpenDate = openDateFil...
82e0a438-fdb0-47f6-954a-605a88a92815
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
2c676124-94b9-4d17-82dc-cdaec051f510
7
private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i - 1) || !cons(i - 2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
9858eda7-7f64-4145-9c0e-21173478923b
8
public static void rotateExpansionVector() { int eX = expansionVector.x, eY = expansionVector.y; if(eX == 1 && eY == 0) { eX = 0; eY = 1; } else if(eX == 0 && eY == 1) { eX = -1; eY = 0; } else if(eX == -1 && eY == 0) { eX = 0; eY = -1; } else if(eX == 0 && eY == -1) { e...
ecade30c-9ee3-445d-bc16-f3167b3d6ed2
4
public static boolean canUseReju(){ return ActionBar.getNode(0).canUse() && Equipment.containsOneOf(EquipShield.shieldId) && ActionBar.getAdrenaline() == 1000 && getHpPercent() <= Eat.HEAL_PERCENT && getHpPercent() > Eat.HEAL_PERCENT - 10; }
711fc9b7-dd37-4cd0-8d2b-e0bb7d66978c
5
@Override public void mousePressed(MouseEvent e) { if (_action != null) { if ((!isInBounds(e.getPoint())) || (_cards == null)) { return; } for (int i = _cards.size() - 1; i >= 0; i--) { if (_cards.get(i).isInBounds(e.getPoint())) { ...
dcef64ee-827e-456f-89a6-7f6834d5de63
1
public InnerClassInfo[] getOuterClasses() { if ((status & OUTERCLASSES) == 0) loadInfo(OUTERCLASSES); return outerClasses; }
cf074961-5aec-4c16-97fb-5fe00d24d807
4
static void setEngineColor(String turn) throws IOException { switch (turn) { case "white": color = "white"; isForced = false; while (true) { if (Moves.computeMove() == 1) { break; } ...
a9752869-5679-4d6d-87c6-87ee923f8ae4
9
public static void Filegen(String srcFilePath, String destFilePath,int rtpStreamPort) { int bytesRecieved = 0; int fileIndex=0; FileOutputStream fo=null; DataOutputStream dOut=null; long videoDuration = 0; File sourceVideo=new File(srcFilePath); VideoDetails ...
338d910e-34db-4aea-a0bf-f95168596838
0
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed // TODO add your handling code here: programmerThread.stop(); hidePanels(lastPane); world.worldDeleter(); world.initWorld(); //paint this.repaint()...
9dcb9b90-39ef-4165-9c31-22f54a120253
4
private void getLastLogin() { try { directory = new File("C:/PassGuard/"); lastLoginName = new File("C:/PassGuard/LatestLogin"); if (!directory.isDirectory()) { directory.mkdir(); } if (lastLoginName.isFile()) { reader = new BufferedReader(new FileReader(lastLoginName));...
a338e704-0deb-487a-ba37-5941a7b54bab
0
public SkipWhileIterator(Iterable<T> source, Predicate<T> predicate) { this._source = source.iterator(); this._predicate = predicate; }
a2946924-1139-478a-8adc-f2dfdd47a733
5
private static void startPlugins() { List<IPlugin> pluginList = plugins.getPluginList(); for (IPlugin plugin : pluginList) { try { // if (plugin instanceof org.myjfinal.plugin.activerecord.ActiveRecordPlugin) { org.myjfinal.plugin.activerecord.ActiveRecordPlugin arp = (ActiveRecordPlugin) plugin; ...
2e9152d5-66d7-4e78-9810-14fdc60784ed
3
public void restorePlayerData() { p.getEquipment().clear();//clear equipment, without this it doesn't remove items p.getInventory().setContents(inventory); p.setExp(exp); p.getInventory().setBoots(boots); p.getInventory().setLeggings(leggins); p.getInventory().setChestpla...
a786287b-f011-4201-93a4-c0df5eca00b4
1
public void mergeContinueStack(VariableStack stack) { if (continueStack == null) continueStack = stack; else continueStack.merge(stack); }
7e105fda-a195-48d0-b832-27c9edd14506
7
private long fromVals(final int wordNumber, final int[] vals) { if(wordNumber * 32 > vals.length) { System.out.println("Wordnumber is too large for vals\t" + wordNumber + "\t" + vals.length); return -1; } int last = (wordNumber + 1) * 32; if(last > vals.length) { last = vals.length; } ...
275b61e9-27db-4dac-8d6b-95ec3f77c33c
4
private void bijnamenToevoegen(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { List<String> fouten = new ArrayList<>(); long docentNr = Long.parseLong(request.getParameter("docentNr")); String bijnaam = request.getParameter("bijnaam"); if (bijnaam == null || b...
a057b4e1-d11b-455c-8cc1-c58cade01615
1
@Override public Object applyFilters(PropertyContainer container, Object value) { for (int i = 0; i < filters.size(); i++) { PropertyFilter filter = (PropertyFilter) filters.get(i); value = filter.filter(container, value); } return value; }
dc580bbe-32e1-4156-8950-674f92bf2915
2
public ArrayList<Integer> spiralOrder(int[][] matrix) { ArrayList<Integer> result = new ArrayList<Integer>(); if (matrix.length == 0) return result; init(matrix.length, matrix[0].length); while (!closed) { result.add(matrix[index[0]][index[1]]); next()...
7858f95b-a9d2-419a-b73e-23f49cfe16ca
3
@Override protected void reactPressed(MouseEvent event) { ProgramState curr = StateMachine.getState(); if (curr != ProgramState.ARR_EDITING && curr != ProgramState.ARR_PLAYING) { if (isPressed) { isPressed = false; releaseImage(); StateMach...
0c7987ec-e10a-4d0a-bb80-b163598f653b
9
@Override public E getEdge(D s, D e) { IndexVertex<D> vs = null ; IndexVertex<D> ve = null ; double weight = -1; Iterator<IndexVertex<D>> it = vset.iterator(); while ( it.hasNext()) { IndexVertex<D> iv = it.next(); if ( iv.getData().equals(s) ) { vs = iv; } if ( iv.ge...
7e2caeb1-81e2-4bb3-ab5f-6c7f89a02dad
4
public boolean loadClassDuration(OffRec off, boolean ignoreSSL) throws IOException { if (off.getKey() == null) return false; // https://www.edx.org/api/catalog/v2/courses/course-v1:DelftX+TP101x+3T2015 // "https://www.edx.org/api/catalog/v2/courses/course-v1:"; String newUrl = "https://www.edx.org/api/cat...
bb5ee44b-3d4a-4604-8985-6d3f428976f8
3
private ArrayList<MelhorPropostaCupom> ordenarPropostas(ArrayList<MelhorPropostaCupom> propostasAceitas){ ArrayList<MelhorPropostaCupom> propostasOrdenadas = new ArrayList<MelhorPropostaCupom>(); int count = propostasAceitas.size(); AID menorAID; while(propostasAceitas.size() > 0){ MelhorPropostaCu...
c97eb252-4106-4459-834b-620e7e089ba7
7
private static void checkColumnForMostWanted() throws Exception { HashMap<String, Double> outputVals = new HashMap<String, Double>(); BufferedReader reader = new BufferedReader(new FileReader(new File( ConfigReader.getChinaDir() + File.separator + "Kathryn_update_NCBI_MostWanted" + File.separator + ...
629fc38b-5b78-4713-8726-44f267545904
0
public NodeList findNodes(String expr) throws XPathExpressionException { return (NodeList) evaluateXPath(expr, NODESET); }
095fedbf-6bae-4891-af59-2316dd832c3b
4
* The type of the patch, as a constant from OPT. */ public void storeUndo(UndoPatch undo, int patchType) { undo.opTag = patchType; while (patchIndex < undoPatches.size()) { undoPatches.remove(undoPatches.size() - 1); } if (!undoCanMerge || patchIndex == 0 || !undoCompatible(und...
a3f17dad-8e6f-4d4b-b5e9-95eddae44476
7
public static int position(Byte[] jeu, byte player){ int val=0; byte opponent=0; Byte empty = 0; if (player == 1) opponent = 2; else if (player == 2) opponent = 1; else System.out.println("erreur IA"); /* POSITION IA */ int [] tabIA = {0, 0,500, 1000, //vert ...
75d5b575-ee86-47b4-98a5-b4e7c60e996d
8
public static void findMaxSubArray(int[] inputArray) { int maxStartIndex = 0; int maxEndIndex = 0; int maxSum = Integer.MIN_VALUE; int cumulativeSum = 0; int maxStartIndexUntilNow = 0; for (int currentIndex = 0; currentIndex < inputArray.length; currentIndex++) { ...
b36ad862-7f97-462a-bbef-2e6fa8e37667
5
public void run() { while (running == true) { if (socket.isClosed()) { listener.receiveMessage("DIS:", client); } String line; try { line = in.readLine(); if (line != null) listener.receiveMessage(line, client); } catch (SocketTimeoutException e) { c...
332b155c-b65f-4372-81bc-0d2110364bce
7
public static char[][] build_trans_block(int[] key_num,String key) { int col=key_num.length; int row=26/col; if(row*col!=26) { row+=1; } char[][] result=new char[row][col]; boolean[] filled=new boolean[26]; int cur_row=0; int cur_col=0; for(int i=0;i<key.length();i++) { char cur...
77d872b1-13f1-42b4-897f-30b1561dd1ba
9
public void execute(String[] args) throws Exception { processArguments(args); String theAttr = (String)attributeNames.toArray()[0]; String theVal = (String)attributeNames.toArray()[1]; if (objectName == null) throw new CommandException("Missing object name"); log.debug("attribute names: " + at...
799f299b-fa27-4a24-b2f8-f645ae6dcce7
7
public void stopKI() { // Set the State to KI stop switch (state) { case caculateKI: setState(State.stopCaculateKI); break; case caculateHelpKI: setState(State.stopCaculateHelpKI); break; case checkPossible: ...
53e1a2f3-becb-4856-b8ae-c013ecef741f
1
public Object getStat() throws Exception { Connection c = con.connect(); try { ResultSet set = c.prepareStatement(query).executeQuery(); if (set.next()) { return set.getObject(1); } else { return "<Empty Query Result>"; ...
5a755870-9234-4aed-9aa3-bb761d169726
4
public static Position getNextPosition(LineNumberReader reader) { try { String line = reader.readLine(); if(line == null) { throw new PositionFileException("The specified file contains not enough positions"); } try { String[] parts = line.split(","); if(parts.length < 3) { throw new Posi...
e58ec61b-9339-4395-8cf2-a1d455423777
1
public Wall[] getWalls(){ Wall[] wallsRes = new Wall[walls.size()]; for (int i = 0; i < walls.size(); i++){ wallsRes[i] = walls.get(i); } return wallsRes; }
bd8557fc-f0ca-4ee1-becc-150b03bbf1ac
7
public static int findNumThanks(String content) { if (content != null && !content.equals("")) if (content.contains("Thanks") || content.contains("thanks") || content.contains("Thank you") || content.contains("thank you") || content.contains("thx")) return 1; return 0; }
c16dde3d-b8ba-4e88-aa98-266725ef8d2e
1
private ArrayList<String> sortAlphanumeric(ArrayList<String> array) { ArrayList<String> sorted = new ArrayList<String>(); for (String s : array) { sorted.add(binarySearch(s, sorted), s); } return sorted; }
41417648-018a-46c3-a3a5-8e0ae54cabb7
2
@Inject public SchedulerProvider( SchedulerConfiguration schedulerConfiguration ) throws SchedulerException { StdSchedulerFactory schedulerFactory = new StdSchedulerFactory(); if ( schedulerConfiguration.getProperties() != null ) { schedulerFactory.initialize( schedu...
ad27795f-4aa7-4872-ac27-91fe3faa65f3
4
public void addThread(ChatServerThread thread){ //replaces the first dead thread with this one, taking its id int count = threads.size(); boolean found = false; for (int i = 0; i<count; i++){ ChatServerThread thread2 = threads.get(i); if (thread2==null || !thread2.isAlive()){ ...
9c4e9c58-202f-4906-99d9-61b823036720
9
public void displayInfo(){ String myPieces = ""; String needPieces = ""; for(int i=0; i < manager.myPieces.length; i++){ if(manager.myPieces[i]){ myPieces = myPieces + i + ", "; } else { needPieces = needPieces + i + ", "; } } myPiecesPanel.havePieces.setText(myPieces); neededPiecesPanel.ne...
aa8787c2-b6a2-4a22-8f2f-bafe6133a520
5
private final String getChunk(String s, int slength, int marker) { StringBuilder chunk = new StringBuilder(); char c = s.charAt(marker); chunk.append(c); marker++; if (isDigit(c)) { while (marker < slength) { c = s.charAt(marker...
53724ca5-424c-4661-9555-cff92ede97bd
5
protected void attemptFeedSheep(Player player, Sheep sheep) { /* Support for sheared state (setting), using that now. * If the sheep is sheared, then add to growing (if holding a food item and the sheep isn't growing already. Remove from naked list. * If not sheared, then add to naked list. */ if ( sheep....
f8f5af4b-bf83-4042-8daa-25cd9c0cf9c8
0
public static void main(String[] args) { String[][] test={{"JFK","SFO"},{"JFK","ATL"},{"SFO","ATL"},{"ATL","JFK"},{"ATL","SFO"}}; System.out.println(new OJ332().findItinerary(test)); }
f19a3d97-c5b7-44fb-9ef6-87158a96bee1
5
public boolean containsPoint(float pointX, float pointY) { // FIRST MOVE THE POINT TO LOCAL COORDINATES pointX = pointX - x; pointY = pointY - y; boolean inXRange = false; if ((pointX > aabbX) && (pointX < (aabbX + aabbWidth))) { inXRange = true; ...
069c2a77-7ba1-4c26-9529-98747983371b
6
public void stillGraphics(Client curPlr, int absX, int absY, int heightLevel, int id, int pause) { for(Player p : Server.getPlayerManager().getClientRegion((curPlr).currentRegion)){ if (p == null) continue; if (!p.isActive) continue; if (p.disconnected) continue; Client c = (Client) p; i...
9174a53c-14ef-4667-93ae-af6acc0f616a
0
public Item(String aDescription, int aPartNumber) { description = aDescription; partNumber = aPartNumber; }
ae5d504f-11c8-4e07-825f-16f3b26c8542
4
public static synchronized Address getInstance(String addressType) { int index = -1; if (addresses == null) { addresses = new ArrayList<>(); Address address = new Address(addressType); addresses.add(address); index = 0; } else { int counter = 0; for (Address address : addresses) { if (addr...
686f10aa-67e4-419c-b0ce-8cbd9c8850cc
4
private void getVariables() { for (int i = 0; i < exprBool.length(); i++) { char c = exprBool.charAt(i); if (c >= 'A' && c <= 'Z') { if (variables.indexOf(c) < 0) variables += c; } } }
5e987257-d242-473b-8927-2c4bf882e393
1
public static void main(String[] args) { /* Exceptions - Rules to Remember * A try block may be followed by multiple catch blocks, and the catch blocks may be followed by a single finally block * A try block may be followed by either a catch or a finally block...
a60e70cd-4705-4d87-b4ff-91db0a7df483
1
private void addOption(Element rootElement, String attrName, Serializable attrValue) { if (attrValue != null) { rootElement.setAttribute(attrName, attrValue.toString()); } }
8d18512e-fc63-4b45-8585-d976892a283f
2
@ Override public boolean equals(Object obj) { if (obj instanceof Coordinate2D) { Coordinate2D another = (Coordinate2D) obj; return (x == another.getX () && y == another.getY ()); } else return false; }
f3b2536d-62d3-4a59-b704-bdbcadb19f13
0
public void setConcurrent(){ this.concurrent = true; }
1665122e-f267-4a99-a2b5-fa574a493c5b
4
@Override public void removeEdgesTo(N to) { if(containsNode(to)) { for(N node : nodes.keySet()) { List<WeightedEdge<N, W>> edgesFrom = edgesFrom(node); for(WeightedEdge<N, W> edge : edgesFrom) { if(edge.to.equals(to)) { nodes.get(node).remove(edge); } } } } }
1fb5534e-1ab8-44be-841d-4c062ca672ad
7
public void test5() { if (b) ; else if (b) { if (b || (new Integer(i)).toString().contains("Whatever") && new Double(d).compareTo(new Double(5.0)) > 55 || !(i >> 2 > 0) && (new String()) instanceof Object) ; } else ; }
c3d33031-f30e-4810-ac61-c3c91461332b
1
private static int facSum(int n, int[] f){ int s = 0; for(char c : Integer.toString(n).toCharArray()){ s+=f[Integer.parseInt(""+c)]; } return s; }
dea523ff-2c19-4f85-8344-a24843f46156
4
public void load(){ Scanner sc; try { sc = new Scanner(new File("save.txt")).useDelimiter("\\s"); // Luetaan tiedostosta save.txt, käytetään erottimena " " pelaajat.removeAll(pelaajat); pelaajat.add(new Pelaaja(sc.nextLine())); pelaajat.add(new Pelaaja(sc.nextLine())); currentPelaaja=sc.nextInt(); ...
05cfdb11-dbaf-464b-a767-15ec60a28e8a
0
@Override public YamlPermissionRcon getRcon() throws DataLoadFailedException { checkCache(PermissionType.GROUP, "rcon"); return (YamlPermissionRcon) cache.get(PermissionType.RCON).get("rcon"); }
2a142e7d-25c9-45d2-9c9c-fe03d00a49f2
2
private void push(JSONObject jo) throws JSONException { if (this.top >= maxdepth) { throw new JSONException("Nesting too deep."); } this.stack[this.top] = jo; this.mode = jo == null ? 'a' : 'k'; this.top += 1; }
29dd7c74-37d6-4a19-9cbc-3b9ae3176bfe
0
@After public void tearDown() throws Exception { this.cacheKey = null; this.cache = null; }
2ec77f87-fd8b-49df-96b3-453e0861c35d
5
public HashMap<String, String> getRow(String testcase,String ...sheetName) { HashMap<String,String> testData = new HashMap<String,String>(); String testSheetName; if (sheetName.length == 1){ testSheetName = sheetName[0]; }else{ testSheetName = getTestSheetName(testcase); } HSSFSheet testSheet...
5984e254-2db8-4140-9dde-8675047e9ad8
7
public static Family getFamily() { String name = System.getProperty("os.name"); if(name.equalsIgnoreCase("freebsd")) return Family.FREEBSD; else if(name.equalsIgnoreCase("openbsd")) return Family.OPENBSD; else if(name.equalsIgnoreCase("mac os x")) return Family.OSX; else if(name.equalsIgnoreCase("solaris") |...
f8f401d1-b411-405b-9a00-79d3c67088fb
0
@Override public String toString(){ return "Hero : " + hero.toString() + "\n"; //"Weapon : " + weaponSlot.toString() + "\n"+ //"head armor : " + headArmorSlot.toString() + "\n" + //"Body armor : " + bodyArmorSlot.toString() + "\n"; }
07d8795e-08e6-4adb-99ad-5767bd216688
5
@Override public void incCount(E data) { if(head == null){ // We have an empty list - create the first node with data as its value head = new ListNode(data); }else { // We have a non-empty list - let's try to find a matching node ListNode current = head; // Is the head a match? If so, increment and ...
0866e01e-aaa8-4657-9a74-e4a8c14f6408
6
public static boolean isCacheOld(String player) { PlayerCache checkPlayer = getPlayerCache(player); if(checkPlayer._playerJobs.isEmpty()) return true; if (Bukkit.getPlayer(player) != null) return false; boolean deletecache = false; Iterator<Stri...
6200bfa2-b450-41f0-bb96-2d027262d510
8
private int checkNumber(int i) { int sum = 0; List<Integer> djelitelji = new ArrayList<Integer>(); for (Integer prim : primBrojevi) { if (i == prim) { return 1; } else { if (i % prim == 0) { sum++; djelitelji.add(prim); } } } if (sum == 1) { return 4; } else if (sum % 2 =...
8029a0c6-67d5-4839-a13b-64a127d8efaa
0
public String getRef() { return ref; }
e18457bd-7cb8-4eba-aef6-cbdc4871ac34
7
public void log(Clickstream clickstream) { if (clickstream == null) return; StringBuilder output = new StringBuilder(); String hostname = clickstream.getHostname(); HttpSession session = clickstream.getSession(); String initialReferrer = clickstream.getInitialReferrer(); Date start = clickstream.getStart(...
581be5a9-4ab2-4724-964f-83bd664500be
1
@Override public Object getCellEditorValue() { if (isPushed) { doEditing(); } isPushed = false; return new String(label); }
3a610ec1-4bed-4426-ac5c-7a182749fe1e
8
public void populateSerialsJlist() { journalSerialListModel.clear(); conferenceSerialListModel.clear(); viewConferences.clear(); viewJournals.clear(); if (!model.getConferences().isEmpty()) { getAddConPaperButton().setEnabled(true); for (int i = 0; i < model.getConferences().size(); i++) { ...
fd7f895c-8fbd-4fe4-ac7d-d90eb4c87587
3
public synchronized void cancel(Cancelable root) { root.cancelTask(); TreeNode rootNode = findNodeInTaskTrees(root); if (rootNode instanceof TreeNode) { List children = rootNode.getChildren(); TreeNode parentNode = rootNode.getParent(); for (Iterator iter = children.iterator(); iter.hasNex...
740ebc21-6709-42e5-8b02-ae019f817678
9
public void enter(String plr,int num) throws InterruptedException, FileNotFoundException, UnsupportedEncodingException{ String gname; int found=0; int amt=0; int write=0; int cnt=0; String nme; while (found==0){ cnt=GosLink2.names.size(); for (int i=0;i<cnt;i++){ if(GosLink2.names.get(i)!=null){...
fdd4920c-cb47-47e0-8fb9-240215e5f8a6
4
@Override public boolean verifier() throws SemantiqueException { if(gauche instanceof Identificateur && !gauche.verifier()){ GestionnaireSemantique.getInstance().add(new SemantiqueException("La declaration de la variable "+((Identificateur) gauche).getNom()+" a la ligne "+line+" est manquant...
e1f1143a-8ef5-4bb5-b711-a9cd3d6b6a84
6
private Roster readRoster(ByteArrayInputStream inputStream) throws XmlException, IOException { final Roster roster = new Roster(); try { SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); saxParser.parse(inputStream, new DefaultHandler() { @Overr...
36c9ad9c-4123-46d3-8e61-5a928c00c678
0
@Override public Object getClock() { return (Object) this.clock; }
d20de29d-46b0-4e6c-a0c5-69e7524fefec
5
public static void main(String[] args){ boolean estMisAssertion = false; assert estMisAssertion = true; System.out.println("Lancement du programme Pair"); if (estMisAssertion) System.out.println("Veuillez patienter quelques instants ...\n"); FichierConfiguration fichierConf = new FichierConfiguration("confi...
710a1d03-2e6c-4d6e-ba45-ef5b459193df
2
public String getTypeAlias(String typeSig) { String alias = (String) aliasesHash.get(typeSig); if (alias == null) { StringBuffer newSig = new StringBuffer(); int index = 0, nextindex; while ((nextindex = typeSig.indexOf('L', index)) != -1) { newSig.append(typeSig.substring(index, nextindex + 1)); i...
23487b5a-7346-4408-91ba-5c3a07c138b7
0
@Override public void fatalError(JoeException someException) { System.out.println(someException.getMessage()) ; this.errorOccurred = true; } // end method fatalError
c83b93fb-c018-4399-9c85-7e544b6148a7
5
protected void checkForHitLeft(Paddle paddle) { if (ballX <= (paddle.getX() + ballSize)) { if (ballY >= paddle.getY() - ballSize + 1 && ballY <= paddle.getY() + paddle.getLength() - 1) { hits1++; dx = right; dy = 0; // this is a direct hit int paddleCenter = paddle.getY() + paddle.getLength() ...
0ebc3b1d-74bd-4e81-ab3a-a5a3db86ee0b
0
public String getName() { return name; }
79771669-dd17-4258-a155-f8b66d0a21db
6
@NotifyChange({"sessionChronometrages","finisOrNotCreated"}) public void initSession(){ //sessionChronometragePrincipale =new SessionChronometrage(course, voiture); //voiturePrincipale = voiture; if(course != null){ if(voiturePrincipale != null){ this.sessionChronometragePrincipale =null; for(Session...
909237e6-65ca-4cfd-a30e-597d23d06ae8
8
private Object processMessage(Object obj, Throwable t) { StringBuilder str = new StringBuilder(); obj = str.append("会话ID:").append(ESBSessionUtils.getSessionID()).append(":").append(ESBSessionUtils.getServers().length) .append(":").append(obj); if (t != null && t ins...
822ac40d-6baa-44c8-aedd-9e619849f11a
3
public void delStep(int i){ if (steps.size()>i && !steps.isEmpty() && i > -1){ steps.remove(i); calcMashSchedule(); } }
45016a78-e418-49a2-99aa-05577ec65531
1
public boolean isInferenceComplete() { if (inferenceWorker != null) { return inferenceWorker.isDone(); } return true; }
db4be5fd-50d6-414c-a6a3-143ca255202b
3
@Override public boolean isDone(Game game) { boolean ended = super.isFinished(game); if(ended) return true; if(game.getNumSprites(itype) - game.getNumDisabledSprites(itype) >= limit && canEnd) { countScore(game); return true; } return fa...
5cf9c29b-1be4-4c80-b172-07e4905f0dad
8
private List<INode> mergeVirtualPlaces(ISubModel model) { List<INode> markToBeDeleted = new ArrayList<INode>(); /* Parcours des places susceptibles d'être liées (VIRTUAL) */ LOG.fine("Processing virtual places"); for (IPlace place : model.getPlaces()) { if (place.isTyped(IPlace.VIRTUAL)) { IPlace virtua...
6e4bed97-ae47-4402-967d-2456acea580b
5
public void move() { x += dx; y += dy; if (x < 1) { x = 1; } if (y < 1) { y = 1; } //System.out.println("OLD-Mouse: " + this.oldMousePos[0] + " | " + this.oldMousePos[1] + " Neue Mouse-Pos " + this.mousePosition[0] + " | " ...