method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e581ba8e-9a15-4e96-9542-1746fc2372a0
2
public static void checkLangYAML() { File lang = new File(path + "lang.yml"); if(!lang.exists()) { try { lang.createNewFile(); FileConfiguration l = YamlConfiguration.loadConfiguration(lang); l.set("Channel.Same", "&4You are already on that channel!"); l.set("Channel.Switch", "&7You have switch t...
781a0203-a059-4503-9465-94bdf777c267
7
public void updatePosition() { if (xPos < xDestination) xPos++; else if (xPos > xDestination) xPos--; if (yPos < yDestination) yPos++; else if (yPos > yDestination) yPos--; if (xPos == xDestination && yPos == yDestination) { ...
bb2596e3-537d-4a8f-a793-df055e64a934
0
public SignedInfoType createSignedInfoType() { return new SignedInfoType(); }
46e9fc4a-d712-467f-9541-e2375d30fd65
1
@Override public void run() { Loader loader = new Loader(); try { loader.setUrl(url); loader.load(); } catch (Exception e) { e.printStackTrace(); } }
28b5fff6-4a34-4811-80db-b2b5bc5ff820
6
@Override public void run() { if (Updater.this.url != null) { // Obtain the results of the project's file feed if (Updater.this.read()) { if (Updater.this.versionCheck(Updater.this.versionName)) { if ((Updater.this.versionLi...
c1adfca1-e0a3-4be1-b82a-8207c880a4b7
6
public void permutation2( int[][] board ){ int n_permutation = 2 * DIGITS; int perm = g.nextInt(n_permutation); System.out.println( perm ); boolean horz_perm = (perm >= DIGITS); perm %= DIGITS; int group = perm / SQRT_DIGITS; perm %= SQRT_DIGITS; int x=0, ...
77508526-dfdd-4a5f-9525-ebc23b0f7fef
0
@Basic @Column(name = "hora") public int getHora() { return hora; }
bde12a8f-0659-46a1-93ff-121399873f07
1
public void initRoute() { route = new Point[getHeight()][]; for (int i=0; i<getHeight(); ++i) { route[i] = new Point[getWidth()]; } }
0f44ec7d-d83c-496d-884d-b17292bcaff9
8
public List<Place> findPath(Location sourceLoc, Location destinationLoc, List<Place> lstplaces, float time, float budget) { AssignTimeAndCost(lstplaces); CreateGraph(sourceLoc, destinationLoc, lstplaces); Vertex v=null; while (!vertexQueue.isEmpty()) { v = vertexQueue.poll(); for(Edge edge:v.getAdjacen...
a68bf58a-92d7-4fed-956a-a7565521cae1
3
protected boolean connect(String path,String addr,int port,String username,String password ){ boolean result=false; ftp=new FTPClient(); int reply; try { ftp.connect(addr, port); ftp.login(username, password); reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ...
7c4f7752-ccea-4ca2-80d1-cc0cffa4519b
4
private Face connectHalfEdges ( HalfEdge hedgePrev, HalfEdge hedge) { Face discardedFace = null; if (hedgePrev.oppositeFace() == hedge.oppositeFace()) { // then there is a redundant edge that we can get rid off Face oppFace = hedge.oppositeFace(); HalfEdge hedgeOpp; if (hedgeP...
b45360fa-7e4f-410e-985e-cbc574e8f0fe
6
public boolean ok(String[] board,int row, int col,int n){ for(int i =0 ; i < row; i++){ // 确保列上不会重复 if(board[i].charAt(col) == 'Q') return false; // 确保对角线不会重复 int temp = col - row +i; if(temp >=0 && board[i].charAt(temp) == 'Q') ...
fb2799ec-9106-4b90-abab-689d286e0664
5
private void searchForBiggest(){ //Postcondition: this.width and this.height are set and an array of two // ints which contains biggestHeight and biggestWidth // Unnecessary, but don't have time to change String tmp[]; this.height = 0; this.width = 0; for(int i = 0;i < repeated.length; i+...
6a707695-5104-4aa8-a0ad-1f53a6f08286
7
private void updateCityChecksSelected() { for (int i = 0; i < 18; i++) { checkboxes[i].setSelected(false); } for (int i = 3; i < 7; i++) { int population = gamestate.getPlayer(gamestate.getCurrentPlayer()) .getCity(i).currentPopulation(); for (int j = 0; j < population; j++) { switch (i) { ...
d2bc4310-4689-41c2-bfca-f69cd1d25c18
2
@Override public Point[] getPath(int x1, int y1, int x2, int y2) { startX = x1; startY = y1; finishX = x2; finishY = y2; /* here we add points, which are already marked with wave * to spread next front of wave from them too*/ //points.add(Panel.tiles[x1][y1]...
eee750b8-cca1-4c60-9fd6-44fb940ac6e2
7
public SearchPerson() { setModal(true); setIconImage(Toolkit.getDefaultToolkit().getImage(SearchPerson.class.getResource("/InterfazGrafica/Images/Search.png"))); setTitle("BUSQUEDA"); setBounds(100, 100, 450, 210); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, ...
2973c8bf-1a9c-4215-a1f4-aa9e83351792
8
public static boolean isPermutation(String a, String b) { if(a == null || b == null) return false; if(a.length() != b.length() ) return false; HashMap<Character,Integer> letters = new HashMap<Character, Integer>(); for(int i = 0; i< a.length(); i++ ) { char c = a.charAt(i); if(letters.conta...
07e43949-dccc-4191-ae2e-99c67851a8d3
4
public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{ // Draw the "Difficulty" text. g.drawImage(difficultyText, 170, 0); // Draw the difficulties, and highlight the selected one. if(Settings.difficulty != 1){g.drawImage(easyButton, 210, 100);} else{g.drawImage(easyButto...
6a04ec2e-165a-45d5-8aa0-f12b33788ccd
9
private String indexToString(int i){ switch (i){ case 0: return "Book"; case 1: return "BookCopy"; case 2: return "Borrower"; case 3: return "BorrowerType"; case 4: return "Borrowing"; case 5: return "Fine"; case 6: return "HasAuthor"; case 7: return "HasSubject"; case 8: return "HoldRequest"; def...
aed82c17-0e5b-4fd9-8f8d-f2ea79823ea5
5
public void testStaticQueryInvalidSourceText1() { String goal = "bad goal"; try { Query.hasSolution(goal); // should throw exception fail(goal + " (bad syntax) succeeded"); // shouldn't get to here } catch (org.jpl7.PrologException e) { // expected exception if (e.term().hasFunctor("error", 2) && e.term(...
adaa1779-90b8-447e-a626-a92efc1c12de
3
@Override public String toString() { String tyyppi = "E "; if (this.tyyppi == EsteenTyyppi.ESTE) { tyyppi = "E "; } else if (this.tyyppi == EsteenTyyppi.KUOLO) { tyyppi = "K "; } else if (this.tyyppi == EsteenTyyppi.MAALI) { tyyppi = "M "; ...
209f10cf-f6ec-4cfa-8939-c7860a5d8cda
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; WashingMachine other = (WashingMachine) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.nam...
f8f60e64-80e8-46d1-80b1-f1e6fc84fa86
3
public static void sendData(SelectionKey key, Object dataObj) { byte[] data = null; byte[] lengthPacket = null; try { //serialize the data to be sent data = NetworkPacketManager.serialize(dataObj); //compute the length of the package lengthPacket = NetworkPacketManager.packetLength(data); ...
3222719a-0b4b-4c1c-b5c6-b741580b9a46
8
public static void main(String[] args) { TicTacToe game = new TicTacToe(); System.out.println("Welcome to TicTacToe!\n"); game.setMark(5); game.newBoard(); while (!game.isQuitGame()) { System.out.println("\nWhat do you want to do?"); System.out.println...
c1d56db7-1edd-4103-b162-bc8472121c98
9
@Override void doRotate(int lo, int mid, int hi) { final int len1 = mid - lo; final int len2 = hi - mid; if (len1 == len2) { while (mid < hi) { swap(lo++, mid++); } } else if (len2 < len1 && len2 <= maxTempSlots) { save(mid, len2); for (int i = lo + len1 - 1, j = hi - 1...
c1ef44eb-f4df-4af6-9f87-482c4dbcbb90
7
private void saveExpression() { switch(Equation.getSelectedIndex()+1) { case 1: fx=getExpression(); break; case 2: gx=getExpression(); break; case 3: ax=getExpression(); ...
b33e780e-a124-4b8a-aec0-210d0bdfdf21
2
@SuppressWarnings("nls") public static final Point toPoint(String encoded) throws NumberFormatException { if (encoded == null) { throw new NumberFormatException("Not a point"); } String[] parts = encoded.split(",", 2); if (parts.length != 2) { throw new NumberFormatException("Not a point"); } return ...
9a09b36e-54db-4cc4-9b87-d8201bbd9bd3
5
public void move(){ super.move(); x = parent.x - Math.cos(-offset)*radius; y = parent.y + Math.sin(offset)*radius; offset += 1; // removing if out of range if(x <= -32 || y <= -32 || x-32 >= game.pfWidth() || y-32 >= game.pfHeight()) remove(); // die if parent died if(!parent.isAlive()){ ...
d0b1e087-7928-403d-a70a-de1c4c71c819
3
public static void pagar(Cliente cli, Integer horaSaida){ Integer totalHoras = horaSaida - cli.getHorarioEntrada(); Integer totalAPagar = 0; if(totalHoras >= 0 || totalHoras <= 2){ totalAPagar += 8; } else if(totalHoras > ...
609b1a0a-a424-4b19-b73f-d769351be17c
9
void _processDont(int option) throws IOException { if (debugoptions) { System.err.println("RECEIVED DONT: " + TelnetOption.getOption(option)); } if (__notifhand != null) { __notifhand.receivedNegotiation( TelnetNotificat...
2bf779ef-3096-4b73-865f-4d0a52e5cbaa
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...
7acca437-97dc-4759-9b54-4b2a918bb978
1
public boolean isCharData(int token) { return (token != '<' && token != '&'); }
051a7c3f-e6e6-4e32-9b19-dc3d51787d30
5
public int getOffsetByChunk( String chunkID, int startOffset, int endOffset ) { for (int i = startOffset; i < endOffset; i++) { try { wavFile.seek( i ); } catch (IOException e) { Logger.writeInFile(e.toString()); } char [ ] charBu...
8731bdbe-a8d4-4f00-abdc-8d603d31a8a2
7
public void spatialLearning(){ if(activeColumns.size()>0){ for(Column c : activeColumns){ if(c.overlap!=0){ for(Synapse s : c.proxSegment.synapses){ if(inputMatrix[s.destCoor[0]][s.destCoor[1]]) s.permanenceInc(); else s.permanenceDec(); } } } } for(int r=0;r<row;r++){ fo...
fc352f0f-e32f-40d9-a9e3-503fe42191bb
2
@EventHandler public void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); if (!plugin.canInteract(player)) { event.setCancelled(true); if (message != null) message.sendMessage(player); } }
e9009106-d35e-475b-9a2e-a3efbe55b830
0
public static ICacheable parse(byte[] data){ StringCache s = new StringCache(); String s1 = new String(data); s.mContent = s1; return s; }
5a27a6ee-2c77-49fb-ad3e-294f6ada1c23
9
private void calculateMultipleArrayGradient (Color[] loColors, Color[] hiColors) { //set the flag so we know later it is a non-simple lookup isSimpleLookup = false; int rgb1; //2 colors to interpolate int rgb2; // These are fixed point 8.16 (start with 0.5) ...
1ddcb180-5f6a-4ccb-a5bb-9281ef00ae45
2
private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyTyped // TODO add your handling code here: try { clearPedidos(); clearPedHas(); String sql = "SELECT t2.idpedidos AS id_pedido , t1.nombres AS clientes, t3.nombre AS emplead...
6060054f-6427-4998-9b58-41796fe69b62
0
public String getVersion() { return version; }
1618d92b-990d-4956-8e75-704b293abdb5
3
public static void main(String[] args) { fillScanShots(); for(int y = 0; y < sea[0].length; y++) { for(int x = 0; x < sea.length; x++) { String extraSpaces = ""; if((sea[x][y]+"").length() == 1) extraSpaces = " "; System.out.print(sea[x][y]+extraSpaces+" "); } System.out.println(); ...
121f78a9-6b4b-486b-9b8e-41d7c60544ca
0
public void set(float a, float b, float h, float k) { this.a = a; this.b = b; this.h = h; this.k = k; }
d9871377-75c4-4a75-8463-b5459ff9b99b
1
public void run() { while (true) { HW.waitClerkButton(id); mon.clerkFree(id); } }
2cc71cef-528d-468c-be74-0c7c579378e1
5
public void edit(Periodo periodo) throws NonexistentEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); periodo = em.merge(periodo); em.getTransaction().commit(); } catch (Exception ex) ...
76501174-cfde-4553-a59e-3114e11628cb
3
@Override public String execute() { if (databaseContext.table != null && databaseContext.getChanges() != 0) { return Integer.toString(databaseContext.getChanges()) + " unsaved changes"; } Table old = databaseContext.table; databaseContext.table = databaseContext.provider...
2407b73e-b27a-4b55-8929-2a575399bd60
6
public boolean searchInEnglishTree(String findThis) { boolean found = false; TreeNode currentNodeSearch; TreeNode previousNodeSearch; currentNodeSearch = rootEnglish; previousNodeSearch = rootEnglish; //while there are nodes in the tree and the node has not been fou...
9d39a916-4034-4548-b02e-1ea658133811
8
public static void main(String[] args) throws IOException { // Parse the command line. String[] manditory_args = { "mode"}; createCommandLineOptions(); CommandLineUtilities.initCommandLineParameters(args, Classify.options, manditory_args); String mode = CommandLineUtilities.getOptionValue("mode"); String ...
800aeac7-f303-475a-9a1a-c923f70e8580
9
private void parse_tag() throws IOException { int i_ch = 0; String _tag = ""; if(state != STATE.ENDHDR) { // If last state is not ENDHDR - </DOCHDR> // set default state to STARTEL while encountering character < state = STATE.STARTEL; } while((i_ch = buffer_rd.read()) != -1) { char ch =...
8153b556-8ca3-43f2-8359-a71b2e4ee955
6
private void render() { long time1 = System.nanoTime(); BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(2); bs = getBufferStrategy(); } if (bs != null) { Graphics g = bs.getDrawGraphics(); if (rendering) renderableObject...
847fffb4-ed72-4dd4-86c0-03197c19eb74
7
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(cmd.getName().equalsIgnoreCase("cheat")) { if(sender instanceof Player) { Player p = (Player) sender; PlayerUtil pu = new PlayerUtil(p); if(pu.hasPermission("Nostalgia.Command.cheat", PermissionT...
426429d7-3c29-40e4-968d-f092e7ec25a8
9
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { Raster source = sources[0]; Rectangle srcRect = mapDestRect(destRect,0); // Hack: derive the source format tag as if it was writing to // a destinati...
a4a007ad-7cf2-477d-8567-d3166f583f49
4
public boolean contraintesRespectees(int indicePile1, int indicePile2) { boolean contraintesRespectees = true; if(indiceNonValide(indicePile1)) { System.out.println("[ERREUR] La Pile "+indicePile1+" n'existe pas"); contraintesRespectees = false; } else if(indiceNo...
06348460-9b93-4c60-a4a0-1ebf66a46a1c
9
public ATMInterface() { getContentPane().setBackground(Color.LIGHT_GRAY); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(450, 150, 500, 500); getContentPane().setLayout(null); setResizable(false); setFont(new Font("Arial", Font.PLAIN, 15)); JButton btnNum1 = new JButton("1"); btnNum1.set...
da1a9642-5ec8-4e60-8f30-6f8cd61293da
3
protected char[] escapeData( char[] chars ) { StringBuilder sb= new StringBuilder(); for ( int i=0;i<chars.length;i++ ) { if ( chars[i] == '\\' ) { sb.append( '\\' ); sb.append( '\\' ); } else if ( chars[i] == ']' ) { sb.append( '\\' ); sb.append( ']' ); } else sb.append(...
971ae401-8624-4433-931a-01d864988ab1
5
private void mainMenu() { System.out.println("Main menu:"); System.out.println("0. Wait a few days"); System.out.println("1. Send ship to barter"); System.out.println("2. Build a new ship"); System.out.println("3. Send ship out for repair"); System.out.println("4. Send ship out for combat"); System.out.pr...
02f01e69-464f-40ec-848b-65e1c12c74fd
6
public void keyPressed(KeyEvent e){ int code = e.getKeyCode(); if (code == KeyEvent.VK_RIGHT) { myPinko.setCurrentDirection(RIGHT); } else if (code == KeyEvent.VK_LEFT){ myPinko.setCurrentDirection(LEFT); } else if (code == KeyEvent.VK_UP){ ...
fd8b7e91-cff9-4d34-901f-79be3dfddd95
9
public int ladderLength(String start, String end, HashSet<String> dict) { if (start.equals(end) || !dict.contains(start) || !dict.contains(end) || dict.size() < 2) { return 0; } buildNet(start, end, dict); Queue<Node> q = new LinkedList<Node>(); q.add(startNode); ...
8585041b-bb11-48d2-9373-0b7ce87cc60f
4
public static Schema constructedFromString(String schemaStr) throws InvalidObjectStringException { String name; SortedSet<Dimension> dimensions = new TreeSet<Dimension>(); if (!schemaStr.matches(regex)) { throw new InvalidObjectStringException("object string(" + schemaStr...
75826d05-aeb4-46e7-a89e-25d5cf1e7202
3
int inflate_trees_bits(int[] c, // 19 code lengths int[] bb, // bits tree desired/actual depth int[] tb, // bits tree result int[] hp, // space for trees ZStream z // for messages ){ int res...
6ece9f29-af2c-4454-b437-6056f8d2db16
8
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
7f20bc21-ca30-4f3b-99b7-f10c564db0a6
3
private void lookForNPCAction() { Character nearbyCharacter = checkWhoIsNear(); if (nearbyCharacter == null) { System.out.println(); return; } if (nearbyCharacter.getHostile() && nearbyCharacter.getLocation() == player.getLocation()) { // allows the ch...
b1e60653-4988-4723-a5b6-760ed7c711d5
0
public void setLibelle(String libelle) { this.libelle = libelle; }
a7874a3f-6edd-45c4-b170-31a61de1557e
3
public byte[] getHash(String file) throws Exception { MessageDigest md = MessageDigest.getInstance("SHA1"); FileInputStream input_file = new FileInputStream(file); byte[] data_bytes = new byte[1024]; for (int i = 0; i < data_bytes.length && i < sign_header.length; ++i) data_b...
19274cc2-a185-4fad-9c8e-4f6f79b77cdb
9
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY .equals(prop))) { Object value = optionPane.getValue(); if (value == JOptionPa...
2a155629-e17a-4e76-b8e3-83dcdb5a794e
8
@Override public boolean setBoots(Wearable boots) throws NoSuchItemException, WrongItemTypeException { if (boots != null) { if (boots instanceof Boots) { if (boots.getLevelRequirement() > level || boots.getStrengthRequirement() > stats[0] || boots.getDexterityRequirement() > stats[1] || boots.getMagicRe...
f8af45cf-098e-4782-8390-59e1f36a2a26
4
private boolean writeToSocket () throws IOException { SocketChannel socketChannel = this.socketChannel; if (socketChannel == null) throw new SocketException("Connection is closed."); ByteBuffer buffer = writeBuffer; buffer.flip(); while (buffer.hasRemaining()) { if (bufferPositionFix) { buffer.compact...
0a32300d-fe79-48ad-90ff-8a8ee24f6605
3
@Override public void mouseDragged(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e)) { if (Main.modState == ModState.Editing) { if (selectedPoint != -1) { Point draggedPoint = getClickedPoint(e); handlePointMovement(draggedPoint); } } } }
443a52f2-665e-4bf2-ae63-0024cabade20
1
public ajclient(String hn, int port, ajclientdata data, boolean usetrans) throws IOException, ClassNotFoundException{ hostname = new String(hn); prt = port; cdata = data; soc = new Socket(hostname, prt); out = new ObjectOutputStream(soc.getOutputStream()); in = new ObjectInputStream(soc.getInputStre...
43d15453-ab49-4e0c-b3c3-b71181329081
2
public static double[] getColor(double n, double range) { //0 to range n = n % range; double mag = 255.0/2; System.out.println(n); //lightness goes from 0 to 100 //each color then oscillates from -100 to 155 double[] r = new double[3]; //each color offset ...
c884800b-0f5f-4deb-97f4-5821c4b60730
4
private static void exportTable(Connection connect, List<String> names, String zipName) throws SQLException, FileNotFoundException, IOException { FileOutputStream fos = null; ZipOutputStream zos = null; ZipEntry ze = null; try { fos = new FileOutputStream(zi...
1e6a58d0-79ff-446b-b8b1-ef386e6e62b4
0
public static void setHandle(boolean handle) { isHandle = handle; }
690588f5-d18c-4835-bc12-4da5ed4895d6
6
public int getMax(int npc) { switch (npc) { case 2627: return 4; case 2630: return 7; case 2631: return 13; case 2741: return 28; case 2743: return 54; case 2745: return 97; } return 5; }
9835ba70-bfdb-4dbb-ba3a-b336fa694074
7
private void updateGate(String A, String B, String G, String Y0, String Y1, String Y2, String Y3) throws InvalidPinException { if (this.isHigh(G)) { this.resetGate(Y0, Y1, Y2, Y3); } else { int count = 0; if (this.isHigh(B)) { count += 2; } else if (this.isHigh(A)) { count += 1; } switch (...
64807616-4e32-4468-8ae1-0fc9be44794e
5
@Override public void run() { try { ServerSocket servsock = new ServerSocket(SERVER_PORT); System.out.printf("ImageListener listening on port %s.\n", SERVER_PORT); File myFile = new File(IMAGE_FILE); FileOutputStream fos = null; BufferedInputStream bis = null; while (true) { Socket sock = servs...
25f0acb0-4e71-4953-8e77-b114633b00d6
7
private void checkScrollBar(AdjustmentEvent e) { // The scroll bar listModel contains information needed to determine // whether the viewport should be repositioned or not. JScrollBar scrollBar = (JScrollBar)e.getSource(); BoundedRangeModel listModel = scrollBar.getModel(); int value = listModel.getValue(...
5d2fd3d9-8877-4d59-8917-9241a565ab5c
8
@Override public void unInvoke() { // undo the affects of this spell if((affected==null)||(!(affected instanceof MOB))||(recurse)) return; recurse=true; final MOB mob=(MOB)affected; super.unInvoke(); if(canBeUninvoked()) { if(statue!=null) statue.destroy(); if((mob.location()!=null)&&(!mob...
bfe8f865-cf94-4d14-ba9d-8fb6cf3597e5
0
@Override public void hello(String name) { log.debug("Hello " + name); }
e6f38934-8bc0-49e8-9dd3-1aad4901288b
0
public String getSrcTermid() { return SrcTermid; }
0de2d9d8-6a24-4a07-9a9e-4d5228bb8841
2
public TriangleDivisionNormalDistributedOrdersGenerator( int numberOfForerunPeriods, int offSet) { if (numberOfForerunPeriods < 1 || offSet < 0) throw new IllegalArgumentException(); this.numberOfOrderPeriods = numberOfForerunPeriods; this.offSet = offSet; }
bfbc82d6-270a-4851-88de-23b904dcc91a
0
public final double getAngleChange() { return angleChange; }
528f6f3a-6373-4fa3-b956-18873ae74580
8
protected void onDeathUpdate() { ++this.deathTicks; if (this.deathTicks >= 180 && this.deathTicks <= 200) { float var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; float var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; float var3 = (this.rand.nextFloat() - 0.5F)...
b8da1939-5fd3-41dd-b402-d373d4e59b70
1
private static int countSlots(Expression[] exprs, int length) { int slots = 0; for (int i = 0; i < length; i++) slots += exprs[i].getType().stackSize(); return slots; }
a9c5d384-93cc-4bf4-b8fd-c1043baec541
3
public List<List<Double>> readData() { List<List<Double>> data = new ArrayList<List<Double>>(); HSSFSheet sheet = wb.getSheetAt(0); Iterator<Row> rowIt = sheet.iterator(); if (rowIt.hasNext()) { rowIt.next(); //skip caption row } while (rowIt.hasNext()) { ...
f2f48069-657c-42a1-8d90-498eadd1140a
9
public ArrayList<Producao> concatenaProducoes(ProducoesForParser linhaColuna, ProducoesForParser LinhaColunaAnt) throws Exception{ try{ ArrayList<Producao> concatenados = new ArrayList<Producao>(); if(!(linhaColuna.getProducoes().isEmpty()) && !(LinhaColunaAnt.getProducoes().isEmpty())){//Se ninguem for va...
9a61c9fd-0876-4dab-bdfe-f511bfea826a
5
private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed // TODO add your handling code here: String s = (String) listaProfesori.getSelectedValue(); liceu.Administrator admin = new liceu.Administrator(); admin.delUser(s); ...
1c3e09a8-ee5f-4500-a48b-41f810865567
2
public int getTileHeightMax() { int maxHeight = tileHeight; for (TileSet tileset : tileSets) { int height = tileset.getTileHeight(); if (height > maxHeight) { maxHeight = height; } } return maxHeight; }
243cec99-77f0-41b6-8740-b946219679f6
0
public void renew(){ long deltaTime = System.currentTimeMillis() - lastLoopTime; this.lastLoopTime = System.currentTimeMillis(); player.move(deltaTime); }
daa53dce-c11d-4b1d-87b0-3c8aaa09065e
8
boolean navigateNextAnchor(int direction) { EditPart focus = getCurrentViewer().getFocusEditPart(); AccessibleAnchorProvider provider; provider = (AccessibleAnchorProvider) focus .getAdapter(AccessibleAnchorProvider.class); if (provider == null) return false; List list; if (isTarget()) list = pro...
88b9decb-19ec-435e-ae04-5f0bf68802b0
9
@Override public void update(GameContainer gc, double delta) throws SlickException { AdvGraphics g = Client.getClient().getGC(); Input in = gc.getInput(); double turnspeed = 1.5; if (in.isKeyDown(Input.KEY_UP)) { // Accelerate } if (in.isKeyDown(Input.KEY_DOWN)) { // De-Accelerate } i...
07016f0a-761c-47ff-9946-daa5abad6d60
4
private static void dateAuPlutTot(Tache t){ ArrayList<Tache> dependances = t.getDependances(); Tache max = dependances.get(0); double tmpMax = max.getDatePlusTot(); for(Tache dependence : dependances){ if(dependence.getDatePlusTard() == -1){ dateAuPlu...
6e0c6760-0ffc-4553-965f-9fc9f929a19d
6
private void filterAndSort() { // First for each coordinate, get the most probable circle Map<Coordinate2D, Map.Entry<Integer, MutableFloat>> topRadiusPerCoord = new HashMap<Coordinate2D, Map.Entry<Integer, MutableFloat>>(); { for(Map.Entry<Coordinate2D, Map<Integer, MutableFloat>> entry : data.entryS...
c1432ab0-1d7b-4422-a8a5-76fda3281f7b
3
public String toString() { StringBuffer buf = new StringBuffer("{"); if (values != null) { for (int i = 0; i < values.length; i++) { buf.append(values[i].toString()); if (i + 1 < values.length) buf.append(", "); } } ...
c583cf17-9356-4fd4-acdf-e04094c9c66c
1
private void startWritingTxt(String filename) { try { fw = new FileWriter(filename); } catch (Exception e) { e.printStackTrace(); } }
514376b1-9166-40b5-9399-7b8683cf8fe1
1
public void addVertex(DirectedNode vertex) { if (!this.vertices.contains(vertex)) { this.vertices.add(vertex); } }
2dede135-96df-42f3-8777-a591f240a119
9
void show(final Parameter[] p) { final XYGrapher graph = new XYGrapher(); graph.addSnapshotListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComponent c = (JComponent) e.getSource(); Object g = c.getClientProperty("graph"); if (g instanceof XYGrapher) { model.notifyPa...
3f48cd60-7c89-46a4-81ad-d1d82df7208d
9
* @param tile The Tile to draw. */ private void displayTileItems(Graphics2D g, Tile tile) { // ATTENTION: we assume that only overlays and forests // might be taller than a tile. if (!tile.isExplored()) { g.drawImage(lib.getTerrainImage(null, tile.getX(), tile.getY()), 0, 0,...
508b2953-bf34-49ea-a072-adb608585c75
4
private static RoutingTable createRemoteRT(Host host, Case CASE) throws UnknownHostException { // the following are stored in the REMOTE host RoutingTable remoteRT = new RoutingTable(); remoteRT.setLocalhost(host); if (CASE.compareTo(Case.BOOTSTRAP_1) == 0 || CASE.compareTo(Case.BOOTSTR...
7f54e05f-dcc9-4329-89ef-ef6f1b62815d
3
public String generateRequestUrl() throws Exception { int i = 0; StringBuilder commandString = new StringBuilder(); commandString.append("apiKey=").append(apiKey); commandString.append("&").append("command=").append(command); Map<String, String> paramsLowerCase = new HashMap<String, String>(); paramsLowe...
9e221863-9caa-4529-9b96-0676ad5c347b
1
@Override public void commitTrans() throws Exception { try { oConexionMySQL.commit(); } catch (SQLException e) { throw new Exception("Mysql.commitTrans: Error en commit: " + e.getMessage()); } }
3b42a2e5-2f68-495e-9677-af2f8a2f2d33
8
public void printSelf(){ StringBuilder b = new StringBuilder(); //Dangers b.append("Dangers:\n"); for(Danger d : dangers){ b.append(" "+d.getName()+": "); for(int i=0;i<10;i++){ if(i<d.getLevel()*10) b.append("*"); else b.append("-"); } b.append("\n"); } //Nodes b.append("Complete:\n...
eb77772f-9505-4670-bc51-d3b404baaae1
5
@Override public boolean absolute(int row) { ensureOpen("absolute"); if ((row < 1) || (row > rs.size())) { waitTillProcessingDone(); if (row < 0) { row = rs.size() + row + 1; } } if (row < 0) { row = 0; } if (row > rs.size()) { row = rs.size() + 1; c...