method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
580e72a0-199d-4fd4-9cb2-f4d1fa7cdc2c
4
private void copyDirectoryAndBackUpOldFiles(File source, File target) { for (File f : source.listFiles()) { if (f.isFile()) { try { copyFileAndBackUpOldCopy(f, new File(target, f.getName())); } catch (IOException ex) { System.ou...
e2bdf33d-ef8b-4e54-9c79-486c233ba798
8
private Point xBinarySearch(Point left, Point right) { int y = left.y; // the same for right and left Point mid; while (true) { if (abs(left.x - right.x) == 1) { if (abs(left.dF) <= abs(right.dF)) { return left; } else { ...
55a2c5ba-254f-4cec-8022-3cea1fe69d82
0
public Mob(Level level, int x, int y) { super(level, x, y); }
8253333e-4011-4e5d-bc1c-a8260e37c36b
4
public static void quickSort2(int[] array, int[] array2, int lowIndex, int highIndex) { // this.printArray(); // System.out.println("low:high="+lowIndex+":"+highIndex); if (lowIndex >= highIndex) return; count2 += (highIndex - lowIndex); int i = lowIndex + 1; int pivot = choosePivot(array, lowIndex,...
68ef597b-baae-4cc4-8001-1a96dfee356a
6
@Override public void execute() { if (cadencia == Constantes.SUBIR) { if (ciclista.getCadencia() < 2) ciclista.setCadencia(ciclista.getCadencia() + 1); } else if (cadencia == Constantes.BAJAR) { if (ciclista.getCadencia() > 0) ciclista.setCadencia(ciclista.getCadencia() - 1); } else if (cadencia...
f4824ca4-e8ab-4c42-b276-095b0e9ed895
6
public boolean exists(ArrayList<Edge> edges, Node p1, Node p2){ boolean result = false; if(edges.isEmpty()) return false; for(Edge edge: edges){ if((edge.a.equals(p1) && edge.b.equals(p2)) || (edge.b.equals(p1) && edge.a.equals(p2))){ result = true; br...
940278d9-f0cd-4d18-8d64-75c05ddf4619
4
public boolean batchAddConfig(String key, Map<String, Class> stringClassMap) { int index = key.indexOf(':'); String chain = key.substring(0, index); String cmdName = key.substring(index + 1); Command command = this.getCommandByChain(Arrays.asList(StringUtils.split(chain, ".")), cmdName)...
6fc0dbea-b1ac-4fd9-8575-ca22ef2d1194
9
private void readLuminance() { int type = sourceImage.getType(); if (type == BufferedImage.TYPE_INT_RGB || type == BufferedImage.TYPE_INT_ARGB) { int[] pixels = (int[]) sourceImage.getData().getDataElements(0, 0, width, height, null); for (int i = 0; i < picsize; i++) { int p = pixels[i]; int r = (p &...
127087e2-7aac-4500-a154-5cfacb071b2c
3
public int[] cycleLengthDistrb(){ int maxCL=0; Network A; for(int i=0; i<bucket.size(); i++){ A = library.get( bucket.get(i).getID() ); maxCL = (A.getCycleLength() > maxCL)? A.getCycleLength() : maxCL; } int[] CLDistrb = new int[maxCL+1]; for(int i=0; i<bucket.siz...
06c603a7-7275-40ff-a716-1466f8cc0d4c
8
private boolean safeToPlace(int x, int y, Boolean[][] grid){ for(int i=0; i<grid.length; i++){ if(grid[i][y] == true){ return false; } } for(int j=0; j<grid.length; j++){ if(grid[x][j] == true){ return false; } ...
474c9073-39de-4de2-aee6-f2e6a22205b5
8
private void XposTFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_XposTFKeyTyped boolean OK = false; if((evt.getKeyChar()=='-')&&(XposTF.getText().equals("")))OK = true; if((evt.getKeyChar()=='.')&&(!XposTF.getText().equals("")&&!XposTF.getText().equals("-")))OK = true; if((evt...
26496123-191a-48ea-a439-0f5af48933e5
2
@Override public void fire(T arg) { queue.add(arg); if ( queue.size() >= 3 ) { for ( T next = queue.poll(); next != null; next = queue.poll() ) { logger.info("Event Decorator firing event for type: [{}]", arg); event.fire(next); } } }
cadfec84-89f6-4218-afb2-82cc1514506f
8
public void putAll( Map<? extends Integer, ? extends Character> map ) { Iterator<? extends Entry<? extends Integer,? extends Character>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends Integer,? extends Character> e = it.next(); ...
30c1d103-6b38-4353-9b9c-da37a0793793
7
static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
8f52d94f-3a07-46c2-bea9-68d0be5044a1
8
public Segment getBestMatchingSegment() { boolean found=false; Segment bestMatchingSegment = new Segment(); int max=MinThreshold; if(distSegments.size()>0){ for(Segment seg : distSegments){ //can't be the segment made this prediction if(seg.sequenceSegment==false && seg.segmentActive(false, true)==fa...
54b7418f-714f-471b-8f2f-1539392b9692
8
* @param count the number of rows to be removed * @param shift whether to shift subsequent rows up to fill the empty space */ public void removeRows( int first, int count, boolean shift ) { for( int rowIdx = first; rowIdx < (first + count); rowIdx++ ) { //this.removeRowContents(rowIdx); Row row = rows...
a16fa17f-df93-4e38-a37d-d50f374a6083
0
public SimpleStringProperty extensionProperty() { return extension; }
4fa3c1ee-f47b-4073-a646-b7d5e058aae9
5
private static String hmacDigest(String msg, String keyString, String algorithm) { String digest = null; try { SecretKeySpec key = new SecretKeySpec((keyString).getBytes("UTF-8"), algorithm); Mac mac = Mac.getInstance(algorithm); mac.init(key); byte[] byt...
05f14b96-3196-417a-b219-dbd415b68f86
6
private static long getMillisPerUnit(int unit) { long result = Long.MAX_VALUE; switch (unit) { case Calendar.DAY_OF_YEAR: case Calendar.DATE: result = MILLIS_PER_DAY; break; case Calendar.HOUR_OF_DAY: result = MILLIS_PER...
365e0b45-857c-436e-a795-18505df7f7fa
0
@Override public boolean supportsEditability() {return true;}
2a4b697c-3919-48cf-ae03-3106d2cb2f08
9
private void findCutOff(double[] pos, double[] neg){ int[] pOrder = Utils.sort(pos), nOrder = Utils.sort(neg); /* System.err.println("\n\n???Positive: "); for(int t=0; t<pOrder.length; t++) System.err.print(t+":"+Utils.doubleToString(pos[pOrder[t]],0,2)+" "); System.err.println...
9292b627-4ce0-41f3-94f7-4d16ee55689d
9
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { Player player = null; if (sender instanceof Player) { player = (Player) sender; } if (player == null) { sender.sendMessage("This command can only be run by a player"); return true; } ...
8358b5fa-5114-478d-b393-992edcfe3653
4
public static Set executeQuery(Connection con, String sql, List predicates, int numReturnColumns, String errorMessage) { PreparedStatement ps = null; Set rows = new HashSet(); try { ps = con.prepareStatement(sql); for (int i = 0; i < predicates.size(); i++) { int index = i + 1; ps.setObje...
9e90b7e5-7881-4ac5-a63b-500f3200496a
5
public static void main( String[] args ) { Options options = new Options(); CmdLineParser parser = new CmdLineParser( options); boolean goodCommandLine; try { parser.parseArgument(args); goodCommandLine = true; } catch (CmdLineException exc) { goodCommandLine = fal...
95dbd715-55d3-4226-ac93-74b08473ccf8
7
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){ try { Object o1 = session.getAttribute("UserID"); Object o2 = session.getAttribute("UserRights"); boolean bRedirect = false; ...
876b3d0f-41d2-49ed-8977-b93fdc4ba75e
8
private static boolean isValidInteger(String value) { final int l = value.length(); if(l > 0) { int i = 1, c = value.charAt(0); if(c == CP || c == CM || (c >= C0 && c <= C9)) { for (; i < l; i++) { c = value.charAt(i); if (c < C0 || c > C9) ...
cdab9083-bce7-4f9a-b7ae-f00bf5c4ffbe
4
private final static void init(String path) throws MasterException { if(path == null || path.equals("")) throw new MasterException("The path is not null or empty string"); if(MasterMetadata.initFlag) //If it is already initialized. return; MasterMetadata.dir= new File(path); if(MasterMetadata...
b4897765-a0e1-46cd-9671-e53a9a3e218c
7
public static void main(String... args) { Flag flag = Flag.NO_FLAGS; if(args.length==1){ flag = Flag.HELP; } if(args.length==2){ args[0] = args[0].toLowerCase(); //Si se usa la bandera de archivo if(args[0].equals("-f")){ //Asignamos e...
01abed81-d3d5-406b-b07f-cf016fe41448
9
public void refreshCustomTablist(Player player, List<String> slots) { if (this.playerCustomTablists.containsKey(player)) { List<String> tablist = new ArrayList<String>(); for (String string : slots) { tablist.add(string); } for (int i = 0; i < tablist.size(); i++) { String slot = (Stri...
a82daa8f-6f7f-4436-b392-84ab90a38d16
6
public void drawTo(Graphics g){ if(settings.drawXAxis) drawXAxis(g); if(settings.drawYAxis) drawYAxis(g); if(settings.drawXTicks) drawXTicks(g); if(settings.drawYTicks) drawYTicks(g); for(int i = 0; i < equations.size(); i++) drawEquation(equations.get(i),g); for(int i = 0; i < points.size();...
dddc6a2b-e1fc-4614-b53b-55a6bfe9dbac
5
public void actionPerformed(ActionEvent e) { if ("btnOK".equals(e.getActionCommand())) { int type; if (optCont.isSelected()) type = 2; else type = 1; String name = objective.getName(); objective.updateDetails(type, txtName.getText(), txtUnit.getText()); con.g...
08386230-1c1f-4b5d-b752-d45087e71a97
3
public void wavePresence(){ spawnedWave.checkPresence(); if (spawnedWave.checkPresence() == spawnedWave.enemyStrength()){ bottomButtons[4].setEnabled(true); bottomButtons[5].setEnabled(false); waveActive = false; if (!fastPaced){ enemyMover.stop(); bulletTime.stop(); } else{ enemyMover...
e72b7b26-1692-4273-9ae4-7d6c89cc9ef5
4
public static void assertElementContainsTextPosition(MyElement myElement, String elementText, int expectedPosition, WebDriver driver) { log.info("enter to function assertElementContainsTextPosition with element '" + myElement.getName() + "'"); options.setDriver(driver); options.setMyElement(myElement); optio...
4bee6da4-bb2d-4e61-b388-375aa86b4b1b
6
public static void main(String[] args) { int array[] = {1,4,9,7,3,9,4,7,2,7,3,0,1,2,9,6,5,7,8,9}; int maxIndex = 0; int count = 0; for(int i= 0;i<array.length;i++){ if(array[maxIndex] == array[i]) count++; else if(array[maxIndex] < array[i]){ maxIndex = i; count = 1; } } int len = array...
dedd8320-7c36-4e56-92f6-795eeea69158
0
public void setAlertid(int alertid) { this.alertid = alertid; }
9a8ceae8-0e28-440b-841f-61d4f167d987
7
public boolean execute(Robot paramRobot) { if ((paramRobot.getAssembly(1) instanceof Launcher)) { Launcher localLauncher = (Launcher)paramRobot.getAssembly(1); if (!localLauncher.isEmpty()) { Vector localVector = paramRobot.getEnvironment().getObjectAt(paramRobot.getPosition().getMap...
6c772c26-4d85-4884-b24a-9e21ef2f151f
3
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof Product) { Product other = (Product) obj; if (null == this.name) { return false; } else { return this.name.equals(other.name); } } return false; }
15b701e2-4e59-443d-8da9-c33a9512b42d
0
public void setBase(int b) { baseWeeklySalary=b; }
4136cf31-d193-4840-a765-fe753d9dfe92
9
boolean statement() { switch (_input.peek()) { case "create": createStatement(); break; case "load": loadStatement(); break; case "exit": case "quit": exitStatement(); return false; case "*EOF*": ...
799ac61e-9dc1-428e-84ab-57435634b79a
8
public Main() { frame = new JFrame("CommandsEX Builder"); if (tempDir.exists()){ if (!tempDir.isDirectory()){ JOptionPane.showMessageDialog(frame, "The file " + tempDir.getPath() + " is not a directory", "Error", JOptionPane.ERROR_MESSAGE); System.exit(1); ...
3fa4876e-1748-4d83-831a-651e33dd0740
9
public int run() { reset(); boolean finished = false; while (!finished) { updateSearchBox(); listProducts(); draw(); String option = getInput(); if (option.equals("<")) { finished = true; } else if (option.startsWit...
ed9e57e1-917d-44ec-9ae9-0174c90cb9a6
8
public static void main(String[] args) { // TODO code application logic here boolean validar=true; int opcion; char continuar; double monto; Account oAccount=new Account(); Scanner teclado=new Scanner(System.in); while...
7f10fb17-ba0a-4249-9ed8-0dd3329ec398
5
public NameTree getNameTree() { if (!namesTreeInited) { namesTreeInited = true; Object o = library.getObject(entries, "Names"); if (o != null && o instanceof Hashtable) { Hashtable dest = (Hashtable) o; Object names = library.getObject(dest, "D...
9503f705-69f5-4c49-8f87-ac99d73646d6
6
private void loadMap(String filename) throws IOException { // TODO Auto-generated method stub ArrayList lines = new ArrayList(); int width = 0; int height = 0; BufferedReader reader = new BufferedReader(new FileReader(filename)); while (true) { String line = reader.readLine(); // no more lines to re...
71646417-9e9f-4b8f-8398-42eb2ac6be4e
5
@Override public boolean checkPassword(String login, String password) throws ProfileExceptions { if (login == null || login.isEmpty() || password == null || password.isEmpty()) return false; currentUser = FileParser.getFileParser().loadUser(login, password); if (currentUser == null) return false; ...
9c7b0951-bdf4-4d8d-a202-2f901ef7ff1b
6
public static void main(String[] a) { // player array, in order Player [] players; // local var for now, while we get things in order, better than it being static // get the number of players System.out.print("How many players are there? "); int numPlayers = 5; System.out.print("\n There are...
955bbb68-3033-4323-90fd-3034aa105414
4
public org.icepdf.core.pobjects.fonts.Font getFont(String s) { org.icepdf.core.pobjects.fonts.Font font = null; if (fonts != null) { Object ob = fonts.get(s); // check to make sure the library contains a font if (ob instanceof org.icepdf.core.pobjects.fonts.Font) { ...
6ae07bdb-129d-47f4-a18a-060a9b3abe8a
5
public boolean dropthing(Widget w, Coord c, Object thing) { if (w instanceof DropTarget) { if (((DropTarget) w).dropthing(c, thing)) return (true); } for (Widget wdg = w.lchild; wdg != null; wdg = wdg.prev) { Coord cc = w.xlate(wdg.c, true); if...
1ac06ec4-be91-4424-8fbb-567224473944
1
public synchronized void setMaxSize(int max_size) { this.max_size = max_size; if (getSize() > max_size) { queue.setSize(max_size); } }
68e432ec-463c-4118-8018-bd903a857f0d
1
@Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { if (!shouldSkip(path)) { mHandler.processFile(path); } return FileVisitResult.CONTINUE; }
778a10e4-ca24-45e7-94af-9d72d4dc92e8
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://download.oracle.com/javase/t...
6fed7025-5c36-4308-8bb2-7e2f44dd7430
1
private int matchAddress(Matcher matcher) { int addr = 0; for (int i = 1; i <= 4; ++i) { int n = (rangeCheck(Integer.parseInt(matcher.group(i)), -1, 255)); addr |= ((n & 0xff) << 8*(4-i)); } return addr; }
a61bfe5c-080f-4288-937f-5ee97dc273bb
7
@Override public boolean equals(Object obj) { boolean equal = false; if(obj != null && obj instanceof SubjectID) { SubjectID right = (SubjectID) obj; if(right.contributor != null && right.value != null && this.contributor != null && this.value != null) { equal = this.contributor.equals(right.contr...
ece57855-7597-446f-86e1-e9396c476bcd
7
@Override public String getReply(String message, String pnumber) { if(state==-1){ message=convertMessageFromShortcut(message); state=0; } if(state==0){ String reply=new PIDGetter(getUserID(),pnumber,this,true,getLanguage().getLanguage()).getReply(message, pnumber); if(deleteSession==true) retu...
84b3faa5-d938-4d15-8337-ebe649f0149d
6
private double[][] calResponsibility(double[][] smatrix, double[][] amatrix) { double[][] rmatrix = new double[dNum][dNum]; for (int i = 0; i < dNum; i++) { for (int k = 0; k < dNum; k++) { //计算 max{A(i,j)+S(i,j)} double maxAS = -Double.MAX_VALUE; ...
e596e154-6ab0-44e0-b9ad-181d7272e4eb
0
public boolean addNode(Root node) { return branchs.add(node); }
54087683-08fa-4e62-a9f4-2c5d1f8140ef
4
private void checkBestSolution() { if (!haveBest) { haveBest = true; Ant ant = ants[0]; best.copyAnt(ant); } //currently only PROJECT_ACTUAL_DURATION int currentBest = best.getActualDuration(); int bestIndex = -1; for (int antIndex = 0; antIndex < ants.length; antIndex++) { Ant ant = ants[a...
bd1d3e46-6258-4079-9fa8-1e2af0e13823
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...
61bafb18-097a-444a-ba6c-630ce6aa840c
9
static private int jjMoveStringLiteralDfa1_0(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0); return 1; } switch(curChar) { case 97: return jjMoveStringLiteralDfa2_0(active0, 0x40000000L); case...
7ef81e27-0f21-4a3a-a1b8-71a6a2de877a
3
@Override public double getHeight() { double height = 0; double y = getY(); double temp = 0; ModelSubset[] subs = getAnimatedModel().getSubsets(); for (int i = 0; i < subs.length; i++) { for (int j = 0; j < subs[i].getVertices().length; j++) { temp = subs[i].getVertices()[j].getY() - y; Math.abs(t...
227c1a95-5a3c-4f69-9a3d-bc80c26887f7
4
public void clearMap(GameAction gameAction) { for (int i=0; i<keyActions.length; i++) { if (keyActions[i] == gameAction) { keyActions[i] = null; } } for (int i=0; i<mouseActions.length; i++) { if (mouseActions[i] == gameAction) { ...
fe1e251c-7dfb-40f0-a77c-6486878988ed
5
public short write_msg(short severity, final String msg) { if (!is_init) { MsgDumperCmnDef.WriteErrorSyslog(__FILE__(), __LINE__(), "Library has been initialized"); return MsgDumperCmnDef.MSG_DUMPER_FAILURE_INCORRECT_OPERATION; } short ret = MsgDumperCmnDef.MSG_DUMPER_SUCCESS; // Mark the time that the ...
6ddd617f-2bf8-4700-8333-bdf6e99a8ecc
6
public boolean testForcedJump(){ // Boolean for whether or not it passed the test. boolean forceJumpTest = true; // Find out who has control of the board. // Should be the same as the last test. int turn = testFacade.whosTurn(); // Position the p...
0247687e-e3f0-4044-8111-2070f24b9bce
9
private void randomizeBackground(Background background) { int j = 256; for (int k = 0; k < anIntArray1190.length; k++) anIntArray1190[k] = 0; for (int l = 0; l < 5000; l++) { int i1 = (int) (Math.random() * 128D * j); anIntArray1190[i1] = (int) (Math.random() * 256D); } for (int j1 = 0; j1 < 20; j1...
e08b9a86-f334-403b-90b0-811729c91893
4
private static boolean determineVerbosity(String[] args) { if (args != null && args.length > 0) { for (int i = 0; i < args.length; i++) { if ("-c".equals(args[i])) { return false; } } } return true; }
398eb35d-0d06-4e45-bf63-4afe9b970697
0
public static void main(String[] args) { Receiver receiver = new Receiver(); Command command = new ConcreteCommand(receiver); Invoker invoker = new Invoker(command); invoker.action(); }
62ce90a4-9f7b-4eda-9671-c84b92efdc01
6
public int attack(NPC jM, Entity target) { int attack = Utils.getRandom(3); int hit = Utils.getRandom(600); int distanceX = target.getX() - jM.getX(); int distanceY = target.getY() - jM.getY(); NPCCombatDefinitions defs = jM.getCombatDefinitions(); int size = jM.getSize(); if (distanceX < -1 || distanceY ...
d55cf086-6917-4794-9fd7-44a351407adc
7
@Override public void run() { try { this.previous = this.getSelectedText(User32.INSTANCE, CustomUser32.INSTANCE); } catch (Exception e) { this.previous = null; } while (this.turnedOn) { String selectedText = null; if (this.isThereAnySubs()) { try { selectedText = thi...
048611a9-5487-49a7-a341-cdca95de7211
9
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String temp = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for (int t = 1; t <= n; t++) { String s = sc.next(); int[] arr = new int[62]; ...
a9519b2b-572e-46b8-9549-6078c5ff5543
5
@Override public double itemSimilarity(long arg0, long arg1) throws TasteException { // TODO Auto-generated method stub Movie movie1 = movieMap.get(arg0); if(movie1 == null){ return 0;//TODO throw exception } Movie movie2 = movieMap.get(arg1); if(movie2 == null){ return 0;//TODO throw exception ...
3dfa9927-69c0-4d33-90e7-9cc7f750fc4f
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof StatusAtendimento)) { return false; } StatusAtendimento other = (StatusAtendimento) object; if ((this.codstatus...
94306370-4b4d-4b35-82b8-27a47c7a7d35
8
public boolean During (interval index, long minStart, long maxStart, long minEnd, long maxEnd) { if ((index.Start.before(CurrentInterval.Start) || index.Start.equals(CurrentInterval.Start)) && abs(CurrentInterval.Start.getTime() - index.Start.getTime()) >= minStart ...
b353322a-201a-432d-8745-fa09bee44ff0
7
public void initializeParameters() { File myFile = new File("src/data.xml"); if (!myFile.exists()) { System.out.println(); System.out.println("File with parameters is NOT found!!!"); } if (!myFile.canRead() || !myFile.canWrite()) { System.out.println(...
68d0e673-6541-4822-8ea9-e29e2559064a
9
public static void computePuz() { for(int i = 0; i < DataInfo.numUsers; i++) { int numrate = DataInfo.userInfo[i].length; double[] temp = new double[DataInfo.hidVariables]; for(int k = 0; k < DataInfo.hidVariables; k++) temp[k] = 0; for(int j = 0; j < numrate; j++) { int item = DataInf...
0575af75-e098-4a5c-a530-6481b9b7ad2b
9
@Override protected void download() throws Exception { ChartInputDto chartInput = this.getInput(); Util.print("Fetching %s&%s=%s&%s=%s&%s=%s", Constant.SEARCH_URL, Constant.CHART_PREFIX, chartInput.getChartPrefix(), Constant.CHART_NUMBER, chartInput.getChartNumber(), Constant.CHART_SUFFIX, chartInput.getCha...
7c4c7450-da38-40f3-8b3a-4b4a004dbaa1
9
public void getLabel(StringBuffer s) throws Exception { //for now just return identity //StringBuffer s = new StringBuffer(); FastVector tmp = (FastVector)m_ranges.elementAt(0); if (m_classObject != null && m_training.classAttribute().isNominal()) { s.append("Classified by\...
913e62a1-187b-49ea-88e5-bd92e6314b21
2
public synchronized void queueStatus(HTSMsg msg, int clientId){ Subscription s = getSubscription((Long) msg.get("subscriptionId"), clientId); HTSPServerConnection c = monitor.getServerConnection(s.serverConnectionId); msg.put("subscriptionId", s.serverSubscriptionId); try { c.send(msg); } catch (IOExceptio...
d52ebc68-4f53-4266-aff7-cb84bb9a95f0
3
private void getToEdgeBeeper() { while (beepersPresent() && frontIsClear()) { move(); } turnAround(); if (noBeepersPresent()) { move(); } }
1c1c788f-c90d-4e14-9c82-12f86fc5d26a
8
private void Add_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Add_ButtonActionPerformed Panel_Ajouter panajout = new Panel_Ajouter(); Deal deal = new Deal(); int result = JOptionPane.showConfirmDialog(null, panajout, "Test", JOption...
cf42d9a8-75f4-44f8-9caa-40b40a55a591
9
private float getRelativeAngle() { int y = -((int) player.getY() - (int) enemy.getY()); int x = (int) player.getX() - (int) enemy.getX(); float hyp = (float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); if (hyp == 0) { return 0; } if (y == 0) { if (...
915e0888-34a5-4fd7-bf33-eb67b011847c
7
@Override public synchronized Object[][] getBooks(UnaryOperator filter) { List<Object[]> title_books = new ArrayList(); int i=0; for(TTitle_book next2:mTitle_books) for(TBook next:next2.getmBooks()) { if(filter!=null && !filter.call(next.getmTitle_book...
83ca7808-e773-405e-baf7-3daef6f3420d
1
public void saveMoveToUndo(ArrayList<DrawableItem> selected) { ArrayList<UndoableItem> toAdd = new ArrayList<>(); for (DrawableItem selection : selected) { UndoableItem ud = new UndoableItem(selection, 2); Panel temp = (Panel) selection; int dx = ((Panel) selection).g...
1a9b40f0-bcae-4ba3-b553-251fb6ce696c
4
public void CHI(HashMap<String, _stat> featureStat, int[] classMemberNo){ m_selectedFeatures.clear(); int classNo = classMemberNo.length; int N = Utils.sumOfArray(classMemberNo), sumDF; double[] X2tc = new double [classNo]; double X2avg = 0; for(String f: featureStat.keySet()){ //Filter the feature...
de03cef8-b5b7-494f-b6ff-3926194f38fb
7
public int[] getGoodStuff(LevelEntity[][] level){ int[] goodArray = new int[level.length]; Arrays.fill(goodArray, Integer.MAX_VALUE); int distanceFromGround = level.length; for (int xx = 0; xx < level.length; xx++){ for (int yy = 0; yy < level[0].length; yy++){ if (level[xx][yy] == LevelEntity.Coin || l...
7cbb76eb-ed1b-42cd-8205-660c74633cec
3
private static void checkOpenGlCaps() { log(""); log(getVersion()); log("" + new Date()); log("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")); log("Java: " + System.getProperty("java.version") + ", "...
1325cef8-e7d6-402d-8160-6a1b107ae430
3
private void addBarcodes(final Document document, PdfWriter writer) { /** * Mögliche Barcodes: * BarcodeEAN, BarcodeEANSUPP, Barcode128, BarcodeInter25, * BarcodePostnet, Barcode39, BarcodeCodabar * BarcodePDF417, BarcodeDatamatrix, BarcodeQRCode */ final CMY...
ba620259-f305-4b84-923f-ac6b799448c5
2
static void drawGui() { fixedGraphics.setColor(Color.BLACK); fixedGraphics.fillRect(10 - OUTLINE_WIDTH, 10 - OUTLINE_WIDTH, 100 + OUTLINE_WIDTH * 2, 10 + OUTLINE_WIDTH * 2); if (Player.health > 0) { fixedGraphics.setColor(Color.CYAN); fixedGraphics.fillRect(10, 10, Player...
97946937-b23a-4d61-9b24-9a75e074ca1d
8
public String getPlayerAvalableAction(int playerIndex) { Player currentPlayer = playerList.get(playerIndex); //player's state is fold or all-in or lose if(currentPlayer.getState().equals(Player.States.ALL_IN) || currentPlayer.getState().equals(Player.States.FOLD) || currentPlayer.getState().equals(Player...
5b01ffea-4c1d-4be2-b88a-9a75333ac25c
0
public int getLastDay() { return lastDay; }
7156eb47-9abc-47a6-b413-ea85d0a9497a
0
@Override public void mouseClicked(MouseEvent e) { //System.out.println("DND Mouse Clicked: " + e.paramString()); }
6a97eafe-fd27-40f2-acb3-dfe14ce85614
7
public void create(PypAdmControlProfesionales pypAdmControlProfesionales) { if (pypAdmControlProfesionales.getPypAdmAsistConList() == null) { pypAdmControlProfesionales.setPypAdmAsistConList(new ArrayList<PypAdmAsistCon>()); } EntityManager em = null; try { em = g...
a92f65b8-b14d-43d3-8a29-364fbb75e380
7
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){ try { Object o1 = session.getAttribute("UserID"); Object o2 = session.getAttribute("UserRights"); boolean bRedirect = false; ...
05aa1178-e3ae-41fa-975e-3bf698d405e0
2
private void checkButtonState(DefaultListModel listModel, JButton botonAdd, JButton botonRemove) { //Habilita o deshabilita el boton ADD o Remove if (listModel.isEmpty()) { botonAdd.setEnabled(false); botonRemove.setEnabled(true); } else if (!botonRemove.isEnabled()) { ...
d43bff0e-09ea-4e21-81cd-6c25ed10f873
2
public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException { if (label != null) { writer.untab(); writer.println(label + ":"); writer.tab(); } writer.print("switch ("); instr.dumpExpression(writer.EXPL_PAREN, writer); writer.print(")"); writer.openBrace(); for (int i = 0;...
36ec2cdf-f859-4276-98ce-39658e6fb708
5
public void loadParentDoc(String fileName) { if (fileName == null || fileName.isEmpty()) return; JSONObject json = LoadJSON(fileName); String title = Utils.getJSONValue(json, "title"); String content = Utils.getJSONValue(json, "content"); String name = Utils.getJSONValue(json, "name"); String[] sentence...
cca17a06-f972-4c26-95c2-0d171daf3f0e
9
public void visitConstant(Attribute.Constant _value) { Object value = _value.value; switch (_value.type.tag) { case BYTE: databuf.appendByte('B'); break; case CHAR: databuf.appendByte('C'); break; ...
13f97829-bd81-49fb-88ba-7186a9502018
7
public void onUpdate() { if (isEntityAlive()) { lastActiveTime = timeSinceIgnited; int i = getCreeperState(); if (i > 0 && timeSinceIgnited == 0) { worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F); } ...
3362ef0e-0303-4f1c-8354-65eead93fd32
6
public void keyReleased(KeyEvent e) { // aktion auswahl bildschirm beim drücken von e ein/ausblenden if (e.getKeyChar() == 'e') { showActionSelect = !showActionSelect; } // nur status ändern wenn Gotchi nicht beschäftig ist! if (showActionSelect && gotchi.getState() == GotchiState.DEFAULT) { switch (e...
e89bcbf0-9a79-405c-8206-85826a23b958
0
public List<String> getCommandList() { return accesscommands; }
21159ab9-9392-4cfd-9275-0152a78a9dd3
0
public String getExecCommand() { return execCommand; }