method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
86b01606-5c2d-4ff0-8523-eacfbaf87331
2
@Override public void keyPressed(int key, char character, GUIComponent component) { switch (key) { case (Keyboard.KEY_ESCAPE) : { this.deactivate(); Game.linkedGet().resumePlay(); break; } case (Keyboard.KEY_RETURN) : { ...
c27ff002-9c04-45dd-af0d-a63466646d36
5
@Override public boolean retainAll(Collection<?> c) { int n = this.size(); for(LinkedList<E> bucket : buckets) { for(E e : bucket) { if(!(c.contains(e))) { this.remove(e); } } } if(n != this.size()) ...
20160e1b-61b3-4d7a-9c9f-8fd185bba277
1
@Override public void mouseUp(EventMouse eventMouse){ if (action != null) action.go(); }
3d9942f3-cf35-4edf-a775-8ef26bf88917
0
public PeopleTalk(String username, String age) { this.username = username; this.age = age; }
fa7818cb-7d54-4df6-a744-315081de8a9a
9
private void output(PixelArray out){ int temp_x, temp_8y, temp; int k=0; int DU10[], DU20[]; DU10=DU[1][0]; DU20=DU[2][0]; num++; for(int i=0; i<YV; i++){ for(int j=0; j<YH; j++){ temp_8y=i*32; temp_x=temp=j*4; for(int l=0; l<64; l++){ if(x<Xs...
ce479269-738c-4206-9b29-7c806fbe8ba0
1
@Override public final void mouseDragged(MouseEvent mouseevent) { int x = mouseevent.getX(); int y = mouseevent.getY(); if (frame != null) { x -= 4; y -= 22; } idleTime = 0; mouseX = x; mouseY = y; }
3d19242f-4eb6-4abd-a865-d083b365d991
2
public static List<Ville> selectVilleByName(String name) throws SQLException { String query = null; List<Ville> ville1 = new ArrayList<Ville>(); ResultSet resultat; try { query = "SELECT * from VILLE where VINOM like ? order by VINOM asc"; PreparedStatement p...
9066829b-8d6e-43b0-8a41-2b98afa4bb41
8
private void init() { BufferedReader br = null; try { br = new BufferedReader(new FileReader(goldFile)); String line = null; int lineNumber = 0; while ((line = br.readLine()) != null) { lineNumber++; if(lineNumber == 1) { for(String splitLocation:line.split(" ")...
c3e7f904-aa69-42f2-b572-6f8f07487ce6
8
private void readAndValidateRecordFile( Integer recordKey, String xmlPath, String formatPrefix, String state, Connection conn) { File recordFile = _cache.getFile(xmlPath); ValidationInfo validationInfo = null; BufferedReader reader = null; StringBuffer contentBuffer = new...
b97d367d-1a02-4fb9-a2ab-da28058b1afa
3
public static void mutateInAncestorsDirection(int[] gene, int[] inheritedGene, int[] grandpaGenes) { int diff; for (int i = 0; i < Constants.GENE_COUNT; i++) { diff = inheritedGene[i] - grandpaGenes[i]; gene[i] = inheritedGene[i] + (int) (diff * WormUtils.getRandomPercent()); ...
3f422916-289f-4492-b91e-2bda433d58fa
7
private void productionSleeveListSelectioner2() { try { managerStockItem.addObserver(this); modelStocklist = new StockList2TableModel(managerStockItem.getAll()); tblStockList.setModel(modelStocklist); managerOrder.addObserver(this); ...
13b0b93c-659b-4b10-a988-71b1111475e5
7
public String parse(String line) { logger.info("Parser:" + line); row++; Map<Integer,Object> map = new Hashtable<>(simpleFormat.getColumns().size()); String part = ""; for(Column c:simpleFormat.getColumns()){ try { part = line.substring(c.getBeginIndex(), c.ge...
7a3fdfd0-829c-406f-b755-64220b8a14d6
6
private void verifyResource() throws HttpException { //check exists if (this.resource == null || !this.resource.exists() || this.resource.isDirectory()) throw new HttpException("File not found", StatusCode.NOT_FOUND); //check permissions if (!this.domain.isPathInDirectory(this.resource) || !this.resource...
f7431064-aafb-41a6-839c-41b259f215c8
0
public Member getMember() { return member; }
d90ad78a-39ac-4a73-b358-6dccfe14112d
9
public void atualizar(){ //Atualiza as informações da tela e verifica se a batalha terminou caixaDeTexto.setText("<html>"+textoBatalha+"</html>"); hpMonstro.setText("HP: "+Integer.toString(mob.hp)+"/"+maxhp); if(mob.hp<=0){ //VITÓRIA InfoChar.experiencia+=mob.xpReward; In...
4d158889-c55c-4630-adfc-86b2508ca14b
5
@Override public void run() { for(JSONObject article:articleJsonlist){ Date date = new Date(); String name = date.getTime()+".txt"; String path = Path+name; File file = new File(path); if(!file.exists()){ file = new File(path); ...
de78f906-22dc-4486-a278-3f9b97a69c84
2
public void process( Log log ) throws JxrException { Map info = getPackageInfo(); VelocityEngine engine = new VelocityEngine(); setProperties( engine, log ); try { engine.init(); } catch ( Exception e ) { throw new JxrE...
35e013af-4dfc-4b9b-a509-cdda0f7388c4
0
@Override public void setValue(Object o) { nativeValue=convertObject(o); }
103aa967-4ede-4862-9a6a-3898a2fcd31c
3
public void setTimes(TTimes node) { if(this._times_ != null) { this._times_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
4ab43552-1e9d-47c4-b48c-3d4a6a84cdcc
3
final public void parseFile(File file, DirManager dirManager) { try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { parseLine(line, dirManager); } br.close(); } catch (FileNotFoundException e) { e.printStackTrace(); ...
61c7312e-9eef-4e72-8321-cedc381ff919
6
public synchronized void setCountdown(String umessage, int seconds) { try { thaw(); this.secondsRemaining = seconds; long time = seconds * 1000; final String message = umessage; freezeMessage = true; countdownTimer = new java.u...
71b5a25c-35e6-46af-b35b-bf6f4814dec6
1
public void queryUsers() throws SQLException { if (conn != null) { System.out.println("**********USERS**********"); queryTable("crmusers"); System.out.println("**********AVAILABILITIES**********"); queryTable("crmavailabilities"); System.out.println("**********INTERESTS**********"); queryTable("cr...
6909e551-f9d0-40c3-88a4-43e751e0479d
1
public boolean canHaveAsBalance(BigInteger balance) { return (balance != null) && (balance.compareTo(this.getCreditLimit()) >= 0); }
49bfbf9c-10ac-4603-a800-4588ada61da5
0
public void execute() { setPeriod(Math.abs(Robot.shooter.getPIDController().getError())*PERIOD_SCALAR); super.execute(); }
aa212186-0303-4502-aaa2-b7d7ab0eb1f0
1
public void addEntry(int startPc, int length, int nameIndex, int descriptorIndex, int index) { int size = info.length; byte[] newInfo = new byte[size + 10]; ByteArray.write16bit(tableLength() + 1, newInfo, 0); for (int i = 2; i < size; ++i) newInfo[i]...
b9f30269-b3fa-4e49-9203-99eb8e3a1b17
5
public void exitAndCleanUp() { this.mainController.exitAndCleanUp(); if(this.parameterSetup != null) { this.parameterSetup.dispose(); } if(this.parameterConfirm != null) { this.parameterConfirm.dispose(); } if(this.popu...
261bef1e-c753-49ae-b785-a628c1a4a1f4
8
static public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[14]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 7; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { ...
80d67e6a-861f-4b56-a915-dc0f122d1b62
5
public static <GItem> Comparator<GItem> chainedComparator(final Comparator<? super GItem> comparator1, final Comparator<? super GItem> comparator2) throws NullPointerException { if (comparator1 == null) throw new NullPointerException("comparator1 = null"); if (comparator2 == null) throw new NullPointerException("...
13b53f19-1a0e-4c4f-9e08-7bd712b5abc3
9
public void postProcess(SipMessage sipMessage) { if (realm == null || nonce == null || digest == null) { return; } SipHeaders sipHeaders = sipMessage.getSipHeaders(); String cseq = sipHeaders.get( new SipHeaderFieldName(RFC3261.HDR_CSEQ)).getValue(); S...
98e196dc-d266-474e-ac15-285faf27a1e1
4
public void scanForExtensions(String directory, String fileNameFilter) { if(registry == null) { registry = new HashMap<String, LinkedList<Extension>>(); } if(directory == null) { directory = "."; } if(DEBUG) System.out.println("current working directory: " +System.getProperty("user.dir")); scan...
ff58f185-a424-46d7-be04-30488a3eb4ad
0
public void addView(AbstractView view) { registeredViews.add(view); view.addPropertyChangeListener(this); }
912bfea6-b527-4418-ad9d-0feab6fe5da0
9
private void processQueuedCommands() { synchronized (queuedCommands) { if (!queuedCommands.isEmpty()) { logger.log("Processing Queued commands."); } else { logger.log("There are no Queued commands."); } int MAX_ITERATION = 0; for (int i : queuedCommands.keySet()) { if (i > MA...
5f4a25b4-9eac-4b5f-8739-737a921cc687
8
public byte[] handle(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead) throws java.io.IOException { final StringBuffer stringBuffer = new StringBuffer(); boolean inHex = false; for(int i=0; i<bytesRead; i++) { final int value = (buffer[i] & 0xFF); // If it's ASCII, print i...
c2107891-b72f-47f4-bacc-175ebb6eb033
1
public Inventory(){ inv = new Block[16]; for(int i = 0; i < inv.length; i++){ inv[i] = new Block(0,0,16,16,0); } }
7e1bda6f-d0c9-4b98-8943-399d08971926
6
public boolean despiertaProceso(Proceso p) { boolean despertado = false; int prioridadDinamica; int quantum = (140 - p.getPrioridadEstatica()) * (p.getPrioridadEstatica() < 120 ? 20 : 5); /** * Si el proceso aun no tiene tiempo de ejecucion para el CPU se * despacha a l...
a2300e5e-1374-413f-abf0-4f0958941e9a
8
public void keyPressed(int k) { if (k == KeyEvent.VK_A) { player.setLeft(true); } if (k == KeyEvent.VK_D) player.setRight(true); if (k == KeyEvent.VK_UP) player.setUp(true); if (k == KeyEvent.VK_DOWN) player.setDown(true); if (k == KeyEvent.VK_SPACE) player.setJumping(true); if (k == KeyEve...
452f77fe-4650-4790-bade-f5285560aaf8
6
public void move() { paddle.y += yDirection; if(paddle.y <= 25) paddle.y = 25; if(paddle.y >= 250) paddle.y = 250; if(this.id == 2 && players == 1) { collision(); if(((LocalGame) screen).getBallY() < paddle.y+25) setYDirecti...
0c9656ff-222b-4eee-87a6-b5f10d4d475e
8
private void selectedOrderSleeve2() {if(ord == null) { txtOrderName3.setText(""); txtOrderId4.setText(""); lblSleeves.setText(""); } if(operator == null) { txtId1.setText(""); txtName1.setText(""); txtLastName1.s...
ed859a42-2c34-46de-aff3-f0c7afd30184
9
public GamePanel() { /** * Declare a KeyListener interface to try the keyboard events when we * press any key. */ KeyListener n = new KeyListener() { /** * This method works when we press any key. */ @Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub ...
f4152be9-b91c-40d5-938d-e1f84db3bed1
2
public void setMessage(String message) { this.message = message; if(this.message != null && this.message.equals("")) this.message = null; }
291a5981-0fe4-4b33-9e6c-d23fb7ca2e84
5
private String[] getFileNames(String str) throws IllegalArgumentException { // Tokens are split using quotation marks StringTokenizer strTok = new StringTokenizer(str, "\""); // An arraylist is used to store the tokens ArrayList<String> tokens = new ArrayList<String>(); // 2 or 4 tokens required for legal...
e99bc422-6b68-4a01-ac89-29cb4e66ea92
0
public double getY() { return y; }
2a08e6ca-1a35-4595-baaf-1034193b72f3
3
@Override public boolean edgeIsBetween(Long eId, Long v1Id, Long v2Id) { return (this.getSource(eId) == v1Id && this.getTarget(eId) == v2Id) || (this.getSource(eId) == v2Id && this.getTarget(eId) == v1Id); }
596e35fa-6ac0-477f-94d7-4f620daf6ee1
5
public static void main(String args[]) throws java.lang.Exception { URL wsdlURL = MytxtbuddySoapApi_Service.WSDL_LOCATION; if (args.length > 0 && args[0] != null && !"".equals(args[0])) { File wsdlFile = new File(args[0]); try { if (wsdlFile.exists()) { ...
3fe269cf-c31c-41ef-88bb-ba3889cf13d2
2
public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); HashMap<Integer, String> map = new HashMap<Integer, String>(); for (int i = 0; i < 10; i++) { int index = Integer.parseInt(reader.re...
93f28588-5c8b-46ca-b73c-291344f84850
0
public static void main(String[] args) { // Set up Player A, always draw Paper Player player1 = new Player("Player A"); player1.setDrawOutput(Output.Paper); // Set up Player B Player player2 = new Player("Player B"); // Start the manager GameManager manager ...
928f6531-26de-4776-a517-f6a9bb6eb379
0
public StackPane initContent() { StackPane content = new StackPane(); content.setAlignment(Pos.TOP_LEFT); content.setPadding(new Insets(8, 5, 5, 5)); content.getStyleClass().add("popUpBody"); content.setMinHeight(50); GridPane grid = new GridPane(); grid.setHgap(10); grid.setVgap(10); grid.setPaddin...
e7a1a5a8-ef3f-4a09-a846-5bef738fa10c
2
private void initOptionsBarMenu(Color bg) { this.optionsBarMenu = new JPanel(); this.optionsBarMenu.setBackground(bg); this.optionsBarMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT)); // size final Numberfield numfield = new Numberfield(this.skin.getOptionsbarHeight(),...
b0f08ee6-613f-4e5f-930d-5f2801c87a8a
1
public void testCycListPrettyStringDetails() { System.out.println("\n*** testCycListPrettyStringDetails ***"); try { CycList example = null; Map<ArgPosition, Span> map = null; ArgPosition curPos = null; example = (CycList) org.opencyc.parser.CycLParserUtil.parseCycLTerm("(#$isa #$Muffet ...
f11dadb0-1f85-499a-bdfd-37ce53b9a56a
9
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Album that = (Album) o; if (idAlbum != that.idAlbum) return false; if (!Arrays.equals(cover, that.cover)) return false; if (description...
5fa25d2d-0ff5-4459-a9f6-100677ba34e6
0
public void setItemcode(String itemcode) { this.itemcode = itemcode; }
dc95fa1f-bf4f-4277-9a19-5b256fd8e2ab
1
public TypedObject peekResult(int id) { if (results.containsKey(id)) { TypedObject ret = results.remove(id); return ret; } return null; }
61300920-38cd-4d37-9330-86d0e7612b2c
2
public Set<BankAccount> getAccountsSatisfying(Checker<BankAccount> checker) { Set<BankAccount> result = new HashSet<>(); for (BankAccount account: accounts) if (checker.check(account)) result.add(account); return result; }
603c96d8-12ef-495d-a9e5-3f49f658204b
4
@SuppressWarnings("unused") public static void main(String[] args) { int addedElements1 = 0; int addedElements2 = 0; boolean isEmpty = true; // testing size when trees are empty checkSize(addedElements1); // testing isEmpty when trees are empty checkIsEmpty(isEmpty); // testing add, remove and conta...
7da02a95-3977-4822-b45b-213c20e5598f
8
private static void writeTestCompareFile(HashMap<String, HashMap<String, List<List<Double>>>> map) throws Exception { List<String> taxaNames = getTaxaNames(); List<String> mbqcNames = getMBQCIDs(map); BufferedWriter writer = new BufferedWriter(new FileWriter( ConfigReader.getMbqcDir() + File.separator + "a...
0d9c0a98-61a3-43bf-ab81-10263fe86615
3
private static String getTypeString(int type) { if (type == 0) return "fine"; if (type == 1) return "error"; if (type == 2) return "info"; return "type value error"; }
8bdfeb38-6436-44bf-a3aa-97db70bd4222
4
public static void main(String[] args) throws InterruptedException { ExecutorService executor = Executors.newCachedThreadPool(); //anonymous call of Callable Future<Integer> future = executor.submit(new Callable<Integer>() { @Override //return value is Integer ...
208aad4a-afc8-49c4-a571-6dbcf2931e21
9
private void decode() { int index = 0; LinkedHashMap<Integer, String> decodeDictionary = new LinkedHashMap<Integer, String>(); // initialize dictionary w/ single symbols - Same method as encode, decodeDictionary will contain // only single/initial symbols for(int i = 0; i < fileContent.length(); i++) { ...
b4ddda0a-2ac5-4cfd-99bb-7d7f63ca802d
2
void printTable(Map<Person, List<Score>> table){ List<Person> ls = new ArrayList<>(table.keySet()); ls.sort(Comparator.comparing(p -> p.name)); ToIntBiFunction<List<Score>, Person> extra = (t, p) -> { for (Score s: t) { if (s.self.equals(p)) return s.score; ...
238a1b55-3942-4f6a-aff0-15641f3d3f5f
7
public void setHeader(File file, String[] header) { if(!file.exists()) return; try { String currentLine; StringBuilder config = new StringBuilder(""); BufferedReader reader = new BufferedReader(new FileReader(file)); while((currentLine = reader.readLine()) != null) config.append(currentLine...
1054984a-5716-4777-8f39-76a177c66aa9
3
private void goDown(ColorPatch patch, int x, int y) { if ( ++y < image.getHeight() ) { Color color = pixel(x, y); if ( isIncluded(x, y) ) { if ( patch.getColor().distance(color, Color.RGB_DISTANCE) < tolerance ) { patch.add(color); goRight(patch, x, y); goDown(patch, x, y); } } excl...
d9721489-65a3-490f-860d-e24c150a7783
6
public void parseSurroundingEndElement() { try { if (xmlReader.hasNext() && xmlReader.getEventType() == XMLStreamConstants.END_ELEMENT) { xmlReader.next(); while (xmlReader.hasNext() && xmlReader.getEventType() == XMLStreamConstants.CHARACTERS) { if (!xmlReader.isWhiteSpace()) { throw...
78d8a403-c60f-4d76-9331-c70beb268065
2
public DefaultResponse postProfile(String asUserId, Profile aaUserProfile) { if (asUserId == null || asUserId.trim().length() == 0) { throw new IllegalArgumentException("userId is null"); } return post(REST_URL_PROFILE + asUserId, aaUserProfile, DefaultResponse.class); }
8bdd74b6-59ba-4396-9716-bb39f124fb4b
8
public void method545(Stream stream, Class29 class29) { int i = stream.readUnsignedByte(); anIntArray665[0] = i >> 4; anIntArray665[1] = i & 0xf; if(i != 0) { anIntArray668[0] = stream.readUnsignedWord(); anIntArray668[1] = stream.readUnsignedWord(); int j = stream.readUnsignedByte(); for(int k =...
b9b91705-d8f0-48ee-b119-26d4d3155173
5
private void addNewClaim() { String titleValue = titleNAJtxt.getText() , descriptionValue = descriptionNAJtxa.getText(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm a"); Date date = new Date(); if (titleValue == null || titleValue.equals("")) { JOptionPane.showMessageDialog(newActionJf...
393fc807-d6d2-428e-8192-d3f9da8298ba
7
public int getMinFilledBlock(){ int n = block.size(); int min = 0; while (n != 1) { n = n >> 1; ++min; } for (int step = block.size(); step != 1; step /= 2){ boolean stepIsReasonable = false; for (int i = 0; i < block.size(); i += s...
c5db5703-195c-4859-a133-29126e7f575b
4
public static boolean isConfigured(){ return parameters.get("username") != null && parameters.get("password") != null && parameters.get("host") != null && parameters.get("port") != null && parameters.get("database") != null; }
f8b31da3-a58e-4d10-9c5f-736b4449a109
1
public boolean itemSent(String time, String trackingId) { try { itemSentInt = "1"; sentTimeInt = time; sentTrackingInt = trackingId; return true; } catch (Exception e) { return false; } }
f3f97b85-a22f-4fe5-af1f-bf91ec2e6307
0
private void SendFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SendFileButtonActionPerformed // TODO add your handling code here: String dest = myList.getSelectedValue().toString(); String src = client.getName(); dest = dest.trim(); client.sendFile(...
f2159f5a-1348-4031-8a7b-f6e4fe88e85c
2
private void doubleSize() { if (corridors.length == 0) { corridors = new Corridor[2]; return; } Corridor[] newVersionOfCorridors = new Corridor[corridors.length*2]; for (int i=0; i<corridors.length; i++) { newVersionOfCorridors[i] = corridors[i]; } corridors = newVersionOfCorridors; }
facac33d-f44c-47b5-bbc5-6496eff86904
2
public void printBlockLayoutOrder(Writer w) throws Exception { w.write(getNodeName() + " [label=\"" + getNodeName() + "\\l"); for(Instruction i : instructions) { i.printInstruction(w); w.write("\\l"); } w.write("\"]\n"); if(next != null) { w.wr...
b9630dc1-98b8-41ac-a9b5-5b78d2a658ef
8
static int process(String line) { int cases = Integer.parseInt(line.trim()); for(int c = 1; c <= cases; c++) { line = readLine().trim(); StringBuffer temp = new StringBuffer(); for(char ch : line.trim().toCharArray()) { if(Character.isAlphabetic(ch)){ temp.append(ch); } } String a = temp...
a31c743c-4d17-4bfe-b77d-6eac2bb765ef
5
public static List<AbstractCarriage> findCarriages(SimpleTrain train, int minPassengerCount, int maxPassengerCount) { if(train == null){ LOG.error("Train is null"); throw new IllegalArgumentException("Train is null"); } List<AbstractCarriage> list = new ArrayList<AbstractCarriage>(); for (AbstractCarri...
4e8c6d66-a1ff-49ad-8bed-1911673a8188
6
public void fillDeclarables(Collection used) { ClassInfo clazz = getClassInfo(); InnerClassInfo outer = getOuterClassInfo(clazz); ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz); if ((Options.options & Options.OPTION_ANON) != 0 && outer != null && outer.outer == null && outer.name != null ...
3038b463-cde8-4995-aa34-9ce391a1f11d
8
private Vector2f rectCollide(Vector2f oldPos, Vector2f newPos, Vector2f size1, Vector2f pos2, Vector2f size2) { Vector2f result = new Vector2f(0,0); if(newPos.getX() + size1.getX() < pos2.getX() || newPos.getX() - size1.getX() > pos2.getX() + size2.getX() * size2.getX() || oldPos.getY() + size1.getY()...
0da30676-8b59-46b7-a970-04a8cc2afffc
3
@RequestMapping("/showUser") public String showUser(User user, String pages,HttpServletRequest request) { Map<Object, Object> map = new HashMap<Object, Object>(); map.put("cardno", user.getCardno()); map.put("name", user.getName()); map.put("phone", user.getPhone()); map.put("idcard", user.getIdcard()); ...
4ab9916a-a574-41ff-be5f-531b672641c7
9
public static DataD blockDivide(final FunctionTypes.ZeroInBlockD3 func, BlockD3 block, PlotData data) { final int width = data.resolution.width; final int height = data.resolution.height; final double max = data.max; final double error = data.error; final DataD.Builder3 mat = new DataD.Builder3...
2e49fd10-b874-48b1-80f8-b63b8e9d7d99
4
@Override public List<MavenVersion> getVersionsAvalible(Artifact artifact) throws IOException, DownloadException, SAXException, ParseException { Set<MavenVersion> result = new HashSet<MavenVersion>(); for (String repo : repositories) { Metadata artifactMetaData = getArtifactMetaData(repo...
d7f4d1a7-d5ac-4d00-83df-644035187739
7
public static void qsort(Work[] works, int start, int end) { if (start >= end) return; int left = start, right = end; int pivot = works[(left + right) / 2].start; //use the middle node's value for pivot while (left <= right) { while (works[left].start < pivot) left++; ...
5fc0b819-7c65-44a5-8219-a495e7275b54
9
private static Fn makeFn(final List params, final Object body, final Map env) { final boolean hasVarargParam = !params.isEmpty() && ((Symbol) params.get(params.size() - 1)).name.startsWith("&"); final int nofNormalArgs = hasVarargParam ? params.size() - 1 : params.size(); return new Fn() { public Object invoke...
e210918c-e482-4b09-af9a-166e7cc75358
7
private void propagar(int x, int y) { for (int i = x - 1; i < x + 1 && i > 0 && i < rows; i++) { for (int j = y - 1; j < (y + 1) && j > 0 && j < cols; j++) { if (field[i][j].getAjacentMines() == 0) { pintar(i, j, i * 64, j * 64 + 64); } } } }
bea665db-8d7a-4fdf-9527-488859d4e36d
6
private int[][][] generaFoco(int i,int j,int k) { int b[][][]; b=new int [i][j][k]; int x1 = (int) (Math.random() * i); int y1 = (int) (Math.random() * j); int z1= 1+(int) (Math.random() * (k-2)); double capa1,capa2; capa1=Math.sqrt(3.1); //ANALIZAR PARA TAM...
4492dc68-f625-41a4-9c5b-da173513f2c6
1
public static void setprop(String key, Object val) { ThreadGroup tg = Thread.currentThread().getThreadGroup(); if(tg instanceof ErrorHandler) ((ErrorHandler)tg).lsetprop(key, val); }
f16124a2-6297-44d4-b907-81843a8011db
0
public Card(int x){ cardID=x; rank = getRank(); suit = getSuit(); cardValue=getInitialValue(); }
1d81178f-6646-4e33-bc24-4cc2da4e8027
7
@Override public void unInvoke() { if(canBeUninvoked()) { if(affected instanceof MOB) { final MOB mob=(MOB)affected; if((buildingI!=null)&&(!aborted)) { if(messedUp) { if(activity == CraftingActivity.LEARNING) commonEmote(mob,L("<S-NAME> fail(s) to learn how to make @x1.",...
a29fddd6-ec8d-4e8d-910a-7180d16aac55
1
float getBandFactor(float eq) { if (eq==BAND_NOT_PRESENT) return 0.0f; float f = (float)Math.pow(2.0, eq); return f; }
d7fb1ce4-1ee1-4158-94a3-9b0f77f5dfed
2
public static int insertCommandeClient(int identreprise, int idinterlocuteur, Date datecommandeclient,String referencecommandeclient,Float totalhtcommandeclient,Float totalttccommandeclient, Float remisecommandeclient) throws SQLException { String query = ""; ResultSet resultat; int retour=0; ...
fcf2345f-f0bc-4511-9cb1-1371bc7063d4
7
public void valueChanged(ListSelectionEvent arg0) { if(arg0.getValueIsAdjusting())return; int index = arg0.getFirstIndex(); if(index < 0)return; if(arg0.getSource() == this) { Quest q = getSelectedValue(); if(q != null) { update(q); if(qp.olist.getSelectedIndex() == -1)qp.op.clear(); } ...
d4a5ac98-f317-4277-b6b6-168734af8adb
1
@Override public boolean equals(Object obj) { if(!this.getClass().getName().equals(obj.getClass().getName())) return false; return this.hashCode() == obj.hashCode(); }
f1b37433-0bbc-4666-a0cd-145a58eb5f1d
2
double[] p() { int tot = 0; for (int c : counts) { c += FAKE_COUNTS; tot += c; } double p[] = new double[4]; int i = 0; for (int c : counts) { c += FAKE_COUNTS; p[i] = ((double) c) / tot; i++; } return p; }
9570a67a-bf49-4243-8569-eaa85008dcb0
1
public static Binding parseBinding(final CycList rawBinding) { if (rawBinding.size() == 2) { final CycVariable variable = (CycVariable) rawBinding.get(0); final Object term = rawBinding.getDottedElement(); return new DefaultBinding(variable, term); } return null; }
3591ae75-effb-4432-9995-bd1b23bd6c7a
2
public static void main(String[] args) throws Exception{ // Your S3 credentials are required to manage S3 accounts. // These credentials are stored in an AWSCredentials object: AWSCredentials s3Credentials = TransferManager.loadKeys(); // To communicate with S3 use the RestS3Ser...
b54244c7-33aa-4037-a98a-3829b69f9a95
6
@Override public void writePayload(final ByteWriter out) throws IOException { switch(getType()) { case BYTE: out.write((Byte) payload); break; case SHORT: out.write((Short) payload); break; case INT: out.write((Integer) payload); break; case ...
ee0b1a5a-5162-4392-a351-8193aeffd453
1
public boolean hasMagicPeerId() { if (hasPeerId()) return isMagicPeerId(this.peerId.array()); else return false; }
89b106f1-efab-4363-8115-30a96e7d677b
9
public static Node intersectionOf2Lists(LinkedList list, LinkedList list2) { if (list == null || list2 == null || list.size() == 0 || list2.size() == 0) return null; int list1Length = list.size(); int list2Length = list2.size(); Node list1Node = list.g...
abf5d7e4-f16b-4c17-8c1c-8a6de4aec9f0
1
private static HashMap<Long, Integer> readHashMap(String directory) throws IOException, ClassNotFoundException { FileInputStream fin; try { fin = new FileInputStream(directory); } catch (FileNotFoundException e) { writeHashMap(directory, new HashMap<Long, Integer>()); fin = new FileInputStream(directo...
26ca226b-6e98-4ab4-8b34-33c53d753ee7
6
static long getDaysFromBasis( int basis, long date0, long date1 ) { if( (basis == 0) || (basis == 4) ) { // # months * 30 + extra days GregorianCalendar fromDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( new Long( date0 ) ); GregorianCalendar toDate = (GregorianCalendar) DateConverter.getCal...
abb8cc57-42c8-480e-89a5-da39c0d3b8a7
7
public String decodeExtendedStatus(final int ext_status) { switch (ext_status) { case 0x0107: return "Connection not found"; case 0x0204: return "Unconnected send timed out, no module in slot?"; case 0x0312: return "link not found, no module in slot?"; case 0x0318: return "link to self invalid"...
57e13a64-8dcf-45c5-b0cd-017f820df381
6
final boolean method481(byte i, int i_36_) { anInt957++; if (i_36_ == -1) return false; if (i_36_ == ((ObjectDefinition) this).anInt868) return true; if (((ObjectDefinition) this).anIntArray943 != null) { for (int i_37_ = 0; i_37_ < ((ObjectDefinition) this).anIntArray943.length; i_37_++) { if (...
3a2f16c0-2130-494e-a49e-7c79e8725616
4
static public void main(String args[]) { String[] argv; long start = System.currentTimeMillis(); int argc = args.length + 1; argv = new String[argc]; argv[0] = "jlc"; for(int i=0;i<args.length;i++) argv[i+1] = args[i]; jlcArgs ma = new jlcArgs(); if (!ma.processArgs(argv)) System.exit(1); Con...