method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
f0a7f0b4-9efa-478e-b0b5-51df8078e2bd
2
private static void getConnection() { try { /* Remember to change quizAppDB to quizApp (for Dean and possibly others) */ Class.forName("org.apache.derby.jdbc.ClientDriver"); con = DriverManager.getConnection("jdbc:derby://localhost:1527/quizAppdb", "test", "test"); con.setA...
1548012c-ccde-4204-ab2d-f971b4e00751
3
@Override public void keyPressed(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_SPACE: break; case KeyEvent.VK_RIGHT: break; case KeyEvent.VK_LEFT: break; } }
f5144a80-65a6-401f-b8f7-a3232af62c2a
1
public static S3Bucket createBucket(RestS3Service s, String n){ S3Bucket s3bucket= null; try { s3bucket = s.createBucket(n); } catch (S3ServiceException e) { e.printStackTrace(); } return s3bucket; }
e65aba11-50c2-4326-b7a2-9ff9b1da6482
2
public static Descripcion sqlLeer(Descripcion desc){ String sql="SELECT * FROM descripcion WHERE iddescripcion = '"+desc.getId()+"'"; if(!BD.getInstance().sqlSelect(sql)){ return null; } if(!BD.getInstance().sqlFetch()){ return null; } ...
7db806fe-5b07-4bd0-afce-5d95341b601f
7
private void demo(String host, String user, String password) { try { client.connect(host); // AUTHINFO USER/AUTHINFO PASS if (user != null && password != null) { boolean success = client.authenticate(user, password); if (success) { ...
55c95080-98e2-436e-aa6f-235de186d49b
5
public boolean loadGame(String protocolName) { System.out.println("Try loading Protocol " + protocolName); log("Try loading Protocol " + protocolName); myGUI.printOutput("Versuche Protokoll " + protocolName + " zu laden"); protocol = null; try { // Lade Protokoll. protocol = (Protocol) ...
47245b08-f1ef-420f-a55b-65faa007ce31
7
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!this.getClass().equals(obj.getClass())) { return false; } Struct2<?, ?> t = (Struct2<?, ?>) obj; return Calc.areObjectsEqual(a, t.a) && Calc.areObjectsEqual(b, t.b); }
3a834ec7-da27-4ec0-a104-4b3301100e52
0
public static void showMessageBar(String message) { lblMessage.setText(message); add(messageBar); FadeTransition fadeIn = FadeTransitionBuilder.create() .node(messageBar) .duration(Duration.seconds(0.2)) .fromValue(0.0) .toValue(1.0...
1d51410b-f5b6-4ebb-a423-5094ad95e4c9
7
@Override public ArrayList<String> getTagit(String rajaus) { Connection yhteys = null; PreparedStatement kysely = null; ResultSet tulokset = null; try { yhteys = TietokantaYhteys.getYhteys(); //Haetaan yhteysolio kysely = yhteys.prepareStatement("SELECT DIST...
72aaf703-658c-4397-8b2b-0afec8c138c7
6
@EventHandler(priority = EventPriority.LOWEST) public void onEntityDamageByEntity(EntityDamageByEntityEvent event){ final Entity entity = event.getEntity(); Entity damager = event.getDamager(); if(!(entity instanceof Player)) return; try { damager = EntityUtil.projectileCheck(damager); } catch (Shooter...
d151c074-2510-4a37-b6d6-5b67e8ca4935
1
private boolean jj_2_57(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_57(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(56, xla); } }
e679d755-48e0-4a2c-892e-fdffd645f177
4
public static int getIntVal( String c ) { c = c.toUpperCase(); if( c.length() > 3 ) // max col value= XFD in Excel 2007 { return -1; } int i = c.length() - 1; int ret = 0; while( i >= 0 ) { // process least to most-sigificant dig int z = 0; char cc = c.charAt( i ); while( (z < alpharr.lengt...
d40cdc0b-a3d5-466a-a7f9-eedbbdee34c4
9
public void addSelectedConnection() { try { final String ZEROS = "0000000000"; final int initialNumber = 2000000000; String[] children = _preferencesRoot.childrenNames(); if(children.length > 0) { //Falls der letzte Eintrag bereits die aktuellen Daten enthält, ist nichts zu tun Preferences...
42219563-833c-49ec-97e9-39ab0997745a
4
static public void set(String name) { if (states.containsKey(name)) { //set prevState if (currentState!=null && currentStateName!=null) { prevState=currentState; prevStateName=currentStateName; //if this state has a main component ...
f91b50d0-9a22-4eb1-a24e-1d39a725d2df
2
public int getIndex (TreeNode n) { synchronized (children) { for (int i = 0; i < last; i++) if (children [i] == n) return i; } return -1; }
fdc1c218-fa4a-41c8-91b9-762cd378ec79
8
private void addStartButton() { JButton startBtn = new JButton( "Start"); startBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event)//печальные хаки из-за отсутствия указателей на функцию. надо бы разобраться при случае. ...
ec5ed4c0-a923-409e-9a8d-e9c85b0a7746
1
public Expression mergeIntoExpression(Expression expr) { /* assert expr.getFreeOperandCount() == stackMap.length */ for (int i = stackMap.length - 1; i >= 0; i--) { // if (!used.contains(stackMap[i])) // used.addElement(stackMap[i]); expr = expr.addOperand(new LocalLoadOperator(stackMap[i].getType(), ...
950bc8d7-9514-47bd-b5e0-c314064d56a0
5
public synchronized <T extends java.util.EventListener> void remove( final Class<T> listenerClass, final T listener ) { if (listener == null) { return; } int position = -1; for(int i = listenerList.length-1; i > 0; i -= 2) { if (listenerClass == listenerList[i-1] && listener.equals(listenerList[...
e93f1733-1703-4140-bf55-13a36d409fe6
6
public void updateFields() { safeSpeedSetpointDisplay.setText(String.format("%.2f", convertToMPH(TC.velocitySetpoint)) +" MPH"); ctcSuggestedAuthority.setText(String.format("%.2f", convertToM(TC.ctcSuggestedAuthority)) +" M"); ctcSuggestedSpeed.setText(String.format("%.2f", convertToMPH(TC.c...
5337e768-52be-4061-a5ee-7a25b5c42d84
4
public void set(int i, int j, double r){ if ((i>0)&&(i<=rows)&&(j>=0)&&(j<=columns)){ this.elements[i-1][j-1]=r; }else{ System.out.println("wrong indices, or matrix was not initialized"); } }
256d1982-61df-4631-9c37-a0a7300b83cf
4
public static void handleReflectionException(Exception ex) { if (ex instanceof NoSuchMethodException) { throw new IllegalStateException("Method not found: " + ex.getMessage()); } if (ex instanceof IllegalAccessException) { throw new IllegalStateException("Could not access method: " + ex.getMessage...
848029f8-96d0-4684-8ef6-f276907163b1
4
public int countClasses(int depth, String packageName) { if (depth++ >= MAX_PACKAGE_LEVEL) return 0; int number = 0; String prefix = packageName.length() == 0 ? "" : packageName + "."; Enumeration enum__ = ClassInfo.getClassesAndPackages(packageName); while (enum__.hasMoreElements()) { // insert sorted ...
0383a7e3-3714-48cb-82c0-4578888ef236
2
public Iterator generateNames(final Identifier ident) { return new Iterator() { int pos = 0; Iterator backing = null; public boolean hasNext() { return true; } public Object next() { if (pos < keywords.length) return keywords[pos++]; if (backing == null) backing = backup.genera...
593be10a-f871-4f2f-96bc-4e8dfe7545db
2
@Override public void generateDataset( String datasetFile, List<SimpleFile> simpleFiles ) { List<SnapshotFile> files = convertToSnapshotFiles(simpleFiles); List<SnapshotFile> initialFiles = trainFiles(files); try { FileWriter fstream = new FileWriter(datasetFile); BufferedWriter out = new BufferedWri...
90653320-d5bf-4d1e-a9eb-37ad84f3450f
5
public void characterSound() { if (selection == 1) { Greenfoot.playSound("Sound//White//whiteChosen.mp3"); } else if (selection == 2) { Greenfoot.playSound("Sound//Bond//bondChosen.mp3"); } else if (selection == 3) { ...
ca89edc0-3c0b-496a-bd7d-147f79f754f5
6
private void updateCastlingAvailabilities(final Position pos, final Piece movingPiece) { /* * We are doing our move at the moment, so we have to figure out whether * we affect the castling availability and whether it is for king - or * queenside */ final C...
0ace2290-917e-497b-871f-48d6244ea72d
5
public CheckResultMessage checkF04(int day) { int r1 = get(10, 2); int c1 = get(11, 2); int r2 = get(13, 2); int c2 = get(14, 2); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if (0 != getValue(r1 + 3, c1 + day, 2).abs().compare...
71180094-6a2a-4ca1-a84c-60b688a69cec
2
private double[] loge(double[] array){ int n = array.length; double[] ret = new double[n]; this.nPlot = 0; this.nPlot = this.nAnalyteConcns; for(int i=0; i<n; i++){ if(array[i]==0.0){ ret[i] = Double.NaN; this.nPlot--; } ...
bbd59ab0-44a6-448e-9b47-9d49c788a008
3
public void setCrossoverOp(String selectedCrossoverOp) { try { Class crossoverClass = Class.forName(selectedCrossoverOp); crossoverOp = (Crossover) crossoverClass.newInstance(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catc...
e80c9025-6384-4d56-8b47-4078b0edb68f
7
public void update(GameContainer gc) { if(gc.getInput().isKeyPressed(Input.KEY_SPACE)) { for(int i = 0; i < heldPeople.size(); i++) { heldPeople.get(i).actRandomly(); if(heldPeople.get(i).makeBaby()) { heldPeople.get(i).setMakeBab...
d88955ed-c295-4107-b14b-544bce7cc1d4
7
@Override public boolean canSetTrapOn(MOB mob, Physical P) { if(!super.canSetTrapOn(mob,P)) return false; if(mob!=null) { final Item I=findMostOfMaterial(mob.location(),RawMaterial.MATERIAL_ROCK); if((I==null) ||(super.findNumberOfResource(mob.location(),I.material())<100)) { mob.tell(L("You'...
bf35d9f3-4edf-447e-bc5b-507d28c9cd6f
2
private static boolean handleRookMove(Board b, ArrayList<Move> moves, Position p, Position currentPosition, int opponentColor, int piece) { if (b.spaceHasOpponent(currentPosition, opponentColor)) { // There is an opponent here, this will be a possible move moves.add(new Move(p, currentPosition)); // But the ...
6f011c21-ccca-47af-b3da-3e3c0050d17b
9
public synchronized String endGame() { String msg = ""; switch(this.fullVicAchieved) { case 1: msg = players[detPlayer(titato[0][0])].getName(); msg += " won on the 1st row"; msg += ":"+players[detPlayer(titato[0][0])].getPiece(); this.victor = detPlayer(titato[0][0]); break; case 2: ...
d93cd010-2c4c-499b-8f42-d2a479937136
2
public void paretoProbabilityPlot(){ this.lastMethod = 4; // Check for suffient data points this.paretoNumberOfParameters = 2; if(this.numberOfDataPoints<3)throw new IllegalArgumentException("There must be at least three data points - preferably considerably more"); ...
0e63f4fe-be6c-4eec-bd5e-137211c27ce2
0
public static int result(Point[] points){ return -1; }
4edb4f9a-7966-4646-992a-5b6fb2b46ea2
8
public Type checkType(TypeMap tm) { Type t = new Type(); t.typeid = Type.TypeEnum.t_error; switch(this.op){ case negative: t.t1 = e.checkType(tm); if(t.t1.OK()) { if(t.t1.typeid == Type.TypeEnum.t_int) { t.typeid = Type.TypeEnum.t_int; } else { if(Type.isDebug) { ...
a447563b-a3c1-4241-bd82-8737488dc351
2
public static void main(String[] args) { BufferedImage img = SpriteLoader.loadSprite("front1.png"); int colour = img.getRGB(img.getWidth() / 2, img.getHeight() / 2); int r = (colour)&0xFF; int g = (colour>>8)&0xFF; int b = (colour>>16)&0xFF; int a = (colour>>24)&0xFF; System.out.println(r + " " + g + "...
17a8f9d7-e6a6-4c2d-80e4-88b8c8290c26
1
public ClassInfo getClassInfo() { if (classType instanceof ClassInterfacesType) return ((ClassInterfacesType) classType).getClassInfo(); return null; }
f7db3229-3d32-4782-9809-bb6b0442ae51
6
private boolean isElementType(String name, String[] elementList) { if (name == null || elementList == null) { return false; } for (int i = 0; i < elementList.length; i++) { String element = elementList[i]; if (ignoreCase) { if (element.equalsIgnoreCase(name)) { return true; } } else { ...
f16f40a7-b11c-428a-8deb-f2a607a79c29
7
public static void main(String[] args) { //1 is Monday ... 7 is Sunday int currentFirstDay = 1; //Jan 1, 1900 int[] months = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; //get to Jan 1, 1901 for (int i = 0; i < 12; i++) { int daysToAdd = months[i] %...
db4dda9c-a66c-416e-8438-2c45defe4385
8
@Override public void restore(JSONObject obj) throws JSONException { countOfState = obj.getInt(COUNT_OF_STATES); // timeInState = JSONParser.parseVector(tree.get(Time_in_state)); // chastotaNastypleniya = JSONParser.parseVector(tree.get(Lambda)); // changeStateMatrix = JSONParser.parseMatrix(tree.get(Inf_matri...
00b1254d-879d-4936-b1a7-92a72a6a056c
1
public Device getSelectedAndroidDevice() { if (jList1.getSelectedValue() == null) return null; return new Device((String) jList1.getSelectedValue(), adbController); }
c01e1081-13ad-4f6a-a4dd-7766775b2b02
6
public static void main(String[] args) { Random random = new Random(); // 从指定文件读取信息 List<String[]> inputList = CSVManager.readCSVContentAll(); if(inputList == null ||inputList.size() <= 0){ logger.error("输入文件没有信息"); return; } List<String[]> outputList = new ArrayList<String[]>(); long count = 1; f...
27e7c3cd-cadd-4edf-a36d-fe15be5c4874
3
public static String[] trimArrayElements(String[] array) { if (SpringObjectUtils.isEmpty(array)) { return new String[0]; } String[] result = new String[array.length]; for (int i = 0; i < array.length; i++) { String element = array[i]; result[i] = (element != null ? element.trim() : null); } return ...
156cb314-015d-49ce-90b0-bd2be8579637
7
public static String format(int value, int format) { String ret; switch (format) { case ROM.FORMAT_HEX: ret = Integer.toHexString(value); while (ret.length() < 2) ret = "0" + ret; return "$" + ret; case ROM.FORMAT_DEC: ret = Integer.toString(value, 10); while (ret.length() < 3) ret = " " ...
b5ac0eca-4839-4b54-9ee2-a12f874fbe75
0
public Or( Filter a, Filter b ) { this.a = a; this.b = b; }
786a2543-6114-49fc-b437-7f65dfe563a0
0
public void destroy() { doc = null; lineEnd = null; saveEncoding = null; saveFormat = null; ownerName = null; ownerEmail = null; dateCreated = null; dateModified = null; fileProtocol = null; applyFontStyleForComments = null; applyFontStyleForEditability = null; applyFontStyleForMoveability = nul...
3b30d316-5501-43e5-9df0-f6d0cfbd9e02
5
private float[] mdct_kernel(float[] x, float[] w, int n, int n2, int n4, int n8){ // step 2 int xA=n4; int xB=0; int w2=n4; int A=n2; for(int i=0; i<n4;){ float x0=x[xA]-x[xB]; float x1; w[w2+i]=x[xA++]+x[xB++]; x1=x[xA]-x[xB]; A-=4; w[i++]=x0*trig[A...
0e0a1d78-8776-449c-af64-08709835d7cd
9
public void keyPressed (KeyEvent e) { char key = e.getKeyChar(); switch (key){ case W: ship.moveY(-15); break; case A: ship.moveX(-15); break; case S: ship.moveY(15); ...
cd466f4e-28d8-4aed-9da9-ab71a8b82e85
4
public ArrayList<Prestamos> getPendientesByUser(Usuarios u){ PreparedStatement ps; ArrayList<Prestamos> rows = new ArrayList<>(); try { ps = mycon.prepareStatement( "SELECT DISTINCT " + "Prestamos.*, Libros.nombre as lnombre, Usuarios.n...
bd7cf3e5-75ad-45be-937a-8f232eb3a19d
2
private static int DetermineResultSize(int destWidth, int destHeight, int srcWidth, int srcHeight) { double scaleH, scaleV; scaleH = (double) destWidth / (double) srcWidth; scaleV = (double) destHeight / (double) srcHeight; if (scaleH >= 1.0 && scaleV >= 1.0) { return 1; } return 0; }
d0f2b4a4-a3a9-4b00-977c-9223c3f2feb6
9
private static String findLanguage(String rawData){ for(int i = 0; i+5<rawData.length(); i++){ boolean dashDetected = rawData.charAt(i+4)=='-'; if(rawData.charAt(i)==',' && rawData.charAt(i+1)== '"' && ((rawData.charAt(i+4)=='"' && rawData.charAt(i+5)==',') || dashDetected)){ if(dashDetected){...
26275f5f-90d0-4c49-a72f-e53390998ae7
6
protected ControlFile( String filePathName, ControlMain mainDate) throws ExceptionInInitializerError { this.mainDate = mainDate; if ( this.mainDate == null) { throw new ExceptionInInitializerError("ControlMain Handle Cant Are null."); } this.mainFile = new File(filePathName); if ( mainFile.exists() && !( ...
35340d82-8033-4fe5-b5c4-7ecaa3879440
0
public String getMethodName(){ return "按姓名正序"; }
c694941e-6903-4820-9452-785103253c8d
8
public ArrayList<Tile> getValidEdge(Tile tile) { int x = (int) tile.getCoords().getX(); int y = (int) tile.getCoords().getY(); ArrayList<Tile> tiles = new ArrayList<Tile>(); if(y > 0 && !world.tileGrid[y - 1][x].collidable) tiles.add(world.tileGrid[y - 1][x]); if(y < world.loadedMap.tileHeight - 1 && !w...
31030843-8869-4d8d-b9d2-0dd5ffc918ab
1
public static int binaryToDecimal(String binary) { int decimal = 0; for (int i = binary.length() - 1; i >= 0; i--) { decimal += (binary.charAt(i) - '0') * Math.pow(2, binary.length() - i - 1); } return decimal; }
fac4495c-3c7f-4eba-93a1-72bc66aa9e7a
1
public CreatePlist() { try { NSDictionary root = new NSDictionary(); NSDictionary event = new NSDictionary(); event.put("name", "EWI"); event.put("time_begin", new NSDate("2011-09-23T12:32:42Z")); event.put("time_end", new NSDate("2011-09-23T14:32:42Z")); event.put("room", "2.06"); event.put("instruc...
2b442904-1b6b-420d-a9f7-204015a90540
3
private static void calcNoOfNodes(Node node) { if (node instanceof Parent) { if (((Parent) node).getChildrenUnmodifiable().size() != 0) { ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable(); noOfNodes += tempChildren.size(); f...
ca55da1e-7b0d-4103-a813-4ec3e66075e6
7
private void startTask() { if (m_TaskRunning == false && m_TaskQueue.size() > 0) { Thread activeTaskThread; activeTaskThread = new Thread() { public void run() { m_TaskRunning = true; Task currentTask = (Task)m_TaskQueue.pop(); String taskId = (String)m_TaskIdQueue.pop(); TaskSta...
8d164667-cd7e-4bfd-aed6-0afb16b6cbe6
4
@Override public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!this.getClass().isAssignableFrom(other.getClass())) return false; if (id == null) return false; final BaseEntity castOther = (BaseEntity) other; ...
349064a4-f413-4ac4-b551-d8b36a344e26
2
public Object getId (String value) { Integer key = null; for (Map.Entry<Integer, String> entry : sectionNameMap.entrySet()) { if (entry.getValue() == value) { key = entry.getKey(); break; } } return key; }
e19144f8-5c3b-413f-945f-3b4638687f67
2
protected int positionsTotal(Instrument instrument) throws JFException { int counter = 0; for (IOrder order : engine.getOrders(instrument)) { if (order.getState() == IOrder.State.FILLED) { counter++; } } return counter; }
31abcf60-258a-4578-8fe2-c4866865fa16
4
public void clip(){ if (pos_x < 0) pos_x = 0; else if (pos_x > max_x) pos_x = max_x; if (pos_y < 0) pos_y = 0; else if (pos_y > max_y) pos_y = max_y; }
7ce41b7b-e586-418e-ac12-8d3cb475b919
1
public void exitClicked() { WindowStack ws = WindowStack.getLastInstance(); if (ws != null) { ws.close(); } }
94069514-6ec8-43bb-904b-9ca76da1e295
1
@Test public void runTestFieldSensitivity2() throws IOException { InfoflowResults res = analyzeAPKFile("FieldAndObjectSensitivity_FieldSensitivity2.apk"); if (res != null) Assert.assertEquals(0, res.size()); }
348f2174-64ca-47d2-a755-3eccc566e7ab
7
@Override public void run() { logger.log(Level.INFO, "Ticker started."); synchronized (syncObject) { while (running) { if (executionTimes.isEmpty()) { logger.log(Level.INFO, "Ticker is waiting for events."); try { syncObject.wait(); } catch (InterruptedException ie1) { /* *...
c0ec75d7-de60-4295-9251-cf880054c827
9
public static int getMaxDays(int year, String month){ switch(getMonthNumber(month)){ case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 2: if(isLeapYear(year)){ ...
69740e9f-8757-4d8b-8c30-2a1561c601a6
7
public void calcRoute(){ //directions = new ArrayList<Direction>(); Collections.sort(rIndex); int myPos = (int)this.location.getX() + ((int)this.location.getY() * stage.getMatrix_width()); int pacPos = stage.getPacman_location(); if(myPos >= pacPos){ Collections.reverse(rIndex); } in...
1aa205f0-c606-4025-bcc7-a1016f1bd9cf
9
private HashMap<String, Integer> getMapping() { HashMap<String, Integer> map = new HashMap<String, Integer>(); if (itemHeaderCB.isEnabled()) { map.put("ItemName", itemHeaderCB.getSelectedIndex()); } if (categoryHeaderCB.isEnabled()) { map.put("Category", categoryHeaderCB.getSelectedIndex()); } if (ra...
bcc3fd6a-3187-4aaa-9344-56f8ecc0fd9d
2
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((domain == null) ? 0 : domain.hashCode()); result = prime * result + ((local == null) ? 0 : local.hashCode()); return result; }
b67d1074-d3d5-492d-9b35-5ebb5174937c
2
protected Markers loadMarkers(String fileName) { Markers markersSeqChange = Markers.readMarkers(fileName); String label = Gpr.removeExt(Gpr.baseName(fileName)); // Convert 'SeqChange' markers to 'Custom' markers Markers markers = new Markers(); for (Marker m : markersSeqChange) { if (m instanceof Custom) ...
8114925a-93c0-46a2-9d36-4b550d71829d
2
public static double[] tangents_to_circle(double x, double y, double cx, double cy, double r){ double[] result = NONE; double dx = cx - x; double dy = cy - y; double dxSQ = dx * dx; double dySQ = dy * dy; double denom = dxSQ + dySQ; double root = denom - r*r; if(root > -ACCY){ double denomINV = 1.0...
22e39d81-7077-4590-a7a6-5f5e9ccd72f0
1
private TileLoader(){ tileMap = new HashMap<String, URI>(); biEx = new BinaryExporter(); biIn = new BinaryImporter(); ArrayList<File> al = searchTileFiles(); for(File f : al){ tileMap.put(f.getName(), f.toURI()); } }
84478ce8-6c3c-43b4-b6da-8021b42e3512
4
public void SetAnimation(String type, ArrayList<Coordinate> changes){ boolean test = false; if (test || m_test) { System.out.println("Drawing :: SetAnimation() BEGIN"); } gameBoardGraphics.SetAnimation(type, changes); if (test || m_test) System.out.println("Drawing:: SetAnimation()...
85d164f5-4c6d-42b2-ae89-f89d9dddd108
0
public String getPhoneH() { return phoneH; }
37a91a75-d155-4f25-87a8-6098cd2d9f46
5
public void makeMoveTask(ArrayList<Well> startWells, Well endWell, boolean shouldReverse) { //get default dispense amount, can defintitely be a variable (n, TOSET, etc.) String dispenseAmount = view.getDefaultDispense(); MultiTask finalTask = null; //if we're just moving one well to th...
073be682-4bb2-49de-af4c-54cb4f846c72
2
public Quaternion NLerp(Quaternion dest, float lerpFactor, boolean shortest) { Quaternion correctedDest = dest; if(shortest && this.Dot(dest) < 0) correctedDest = new Quaternion(-dest.GetX(), -dest.GetY(), -dest.GetZ(), -dest.GetW()); return correctedDest.Sub(this).Mul(lerpFactor).Add(this).Normalized(); }
7ce57048-5ba4-470c-8446-d5c2d6dce522
0
public Double getHeight() { return height; }
424304d2-08fa-4af4-a89e-b1280e71ec09
4
private void pushData() { File tmp = new File(backupnew); if(!tmp.exists()) { error("No file '" + backupnew + "' exists. Aborting."); return; } String messages = ""; try { Process p = Runtime.getRuntime().exec(new String[] {"adb", "shell", ...
00360a87-21ca-425d-9d44-f54939ef5597
5
public void ktorySegment(){ boolean flag=true; for(int i=0;i<11&&flag;i++){ for(int j=0;j<15&&flag;j++){ if(plansza[j][i]==20){ ktorySegment[0]=j; ktorySegment[1]=i; } } } }
b94d2a58-185c-4516-8a88-b17bb74e151f
8
public HierarchyCluster(double[][] r, int targetClusterNum) { this.r = r; matrix = new double[r.length][r.length]; clusterList = new ArrayList<ArrayList<Integer>>(); //init for (int i = 0; i < r.length; i++) { ArrayList<Integer> tpList = new ArrayList<Integer>(); tpList.add(i); clusterList.add(tpL...
1d7e9390-8368-4cd0-aa19-84e63b20af73
5
private void readFromDb() { BasicDBObject doc = new BasicDBObject(); DBCursor cursor = this.cate.find(doc); try { while (cursor.hasNext()) { DBObject obj = cursor.next(); for (String key : obj.keySet()) { if (key.equals("_id")) { continue; } BasicDBList category = (BasicDBList) obj...
10e24364-4535-4147-8dce-3c7e1b34b75d
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...
74bb3434-5027-4dd6-bd32-81b347596bb3
9
final void setDimensions(int i, int i_119_, int i_120_, int i_121_) { anInt7972++; if ((i ^ 0xffffffff) >= -1 && (-1 + ((NativeToolkit) this).anInt7931 ^ 0xffffffff) >= (i_120_ ^ 0xffffffff) && i_119_ <= 0 && ((NativeToolkit) this).anInt7962 - 1 <= i_121_) la(); else { ((NativeToolkit) ...
b4c1d877-52b3-4d0b-8e70-b1497b871998
8
public int compareColumnValues(int columnIndex, boolean sortDescending, Object obj1, Object obj2) { int result = 0; DataColumn column = getColumn(columnIndex); if (column == null) return result; if (obj1 != null && obj2 != null && !obj1.equals(obj2)) { switch (column.getDataType()) { case DataCol...
32c50369-fda5-45ae-b33c-5a30bebc571e
6
private boolean testHorizontal(String[][] allMarkers) { for (int i = 6; i >= 0; i--) { for (int j = 0; j < 4; j++) { if ("_".equals(allMarkers[i][j])) {} else { if (allMarkers[i][j].equals(allMarkers[i][j+1]) && allMark...
88cbb67a-79d9-495b-837b-96a25ca928c6
6
public static void applyAfterEffects() { for (String p : afterEffects) { Player player = Bukkit.getServer().getPlayer(p); if (player == null) { break; } JumpPort port = JumpPorts.getPort(RDPlayers.getPlayer(p).getString("targetPort")); ...
9a9ba5c3-4b67-4774-bea7-0b0da61f1e49
8
public void testConstructor_int_int_int_int_Chronology() throws Throwable { TimeOfDay test = new TimeOfDay(10, 20, 30, 40, JulianChronology.getInstance()); assertEquals(JulianChronology.getInstanceUTC(), test.getChronology()); assertEquals(10, test.getHourOfDay()); assertEquals(20, test....
6187c4cc-dbaf-4308-a6b8-486d6eac25c8
7
public void removeAtoms(BitSet bs) { if (bs == null) return; int m = iAtom - bs.cardinality(); if (removedAtomList == null) removedAtomList = new ArrayList<Atom>(bs.cardinality()); else removedAtomList.clear(); if (keptAtomList == null) keptAtomList = new ArrayList<Atom>(m); else keptAtomList...
0fca327f-b6a7-4283-b89c-f026bfe0fbb1
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Alumno other = (Alumno) obj; if (this.id != other.id || this.id == 0) { return false; ...
ae62fba2-56af-4ae6-bee2-0d44ca9d6038
6
private int replace(ConstPool cp, CodeIterator iterator, int pos, int opcode, String signature) throws BadBytecode { String castType = null; String methodName = getMethodName(opcode); if (methodName != null) { // See if the object must be cast if (opcode == AA...
9785dc42-48ce-4eff-9b95-d3edd52f022c
5
@Override public void delete(Key key) { if (isEmpty()) return; int i = rank(key); if (i < N && key.compareTo(keys[i]) == 0) { for (int j = i; j < N - 1; j++) { keys[j] = keys[j + 1]; vals[j] = vals[j + 1]; } N--; keys[N] = null; // free memory keys[N] = null; // free memory ...
edc3e870-d144-4891-8975-698af4448af3
4
public static void rectangle(double x, double y, double halfWidth, double halfHeight) { if (halfWidth < 0) throw new RuntimeException("half width can't be negative"); if (halfHeight < 0) throw new RuntimeException("half height can't be negative"); double xs = scaleX(x); double ys = scal...
58f8706f-7539-493a-a86e-59b13dd52c39
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; ...
0922830d-df6e-428c-9623-ecefe88f9a9f
0
@Override public void close() throws IOException { ptr = data.length; }
90067653-9a5e-494c-b1b8-c5aa81c0821c
0
public static UDPTools getInstance(){ return udptools; }
dca093b9-7602-400b-bf8f-65935021651c
4
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } Position other = (Position) obj; return this.x == other.x && this.y == other.y; }
f8e0e312-ae07-4d94-a29a-958e71dc6f0c
7
public int compareTo(InvalidOperation other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; InvalidOperation typedOther = (InvalidOperation)other; lastComparison = Boolean.valueOf(isSetWhat()).compare...
c54878e2-cb54-4436-ac77-aca64d5a15e3
9
public Location getAdjacentLocation(int direction) { // reduce mod 360 and round to closest multiple of 45 int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE; if (adjustedDirection < 0) adjustedDirection += FULL_CIRCLE; adjustedDirection = (adjustedDirect...
2763173c-d32f-4b64-a2e9-d8f4c5e06061
2
public boolean isVerboseEnough(int level) { if (isVerbose() && level <= getVerboseLevel()) { return true; } else { return false; } }