method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
584590bd-90d2-446d-9e24-b8c396e843c4
7
private int ssSubstringPartition (final int PA, final int first, final int last, final int depth) { final int[] SA = this.SA; int a, b; int t; for (a = first - 1, b = last;;) { for (; (++a < b) && ((SA[PA + SA[a]] + depth) >= (SA[PA + SA[a] + 1] + 1));) { SA[a] = ~SA[a]; } for (; (a < --b) && ((...
3b6e90fd-27a3-4ee7-a3fe-f47dd2aa96e1
9
public void step() { if (!prg.isHalted()) { try { prg.execute(pro); } catch (CodeAccessException e) { String msg; if (pro.getProgramCounter() < 0 || pro.getProgramCounter() >= Program.MEMORY_MAX_SIZE) { JOptionPane.showMessageDialog(null, "Error! Line "+ pro.getProgramCounter() + " "+ ...
b65f6cfc-1cf9-4585-bb42-b31ac7a7a4f6
8
public static void main() throws Exception{ BufferedReader br = new BufferedReader(new FileReader("STREGGS.input")); int T = Integer.parseInt(br.readLine()); while(T-- > 0){ StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken());...
7d544297-3bdf-458c-af71-ea34c42dcb26
7
public void prim(int startNode) { Node[] S = new Node[size]; //vertices in the spanning tree PriorityQueue<Node> V_S = new PriorityQueue(); //remaining vertices Node[] p = new Node[size]; //source vertex for edge Node[] spanningTree = new Node[size]; initNodes(spanningTree); ...
45260c7a-d522-463f-b9c6-dbb053d3737a
2
private void outputErrorDialog(JTextPane pane){ Scanner fileScanner; System.out.println("Default Output Error File Path: " + outputErrorFilePath); try { fileScanner = new Scanner(new FileInputStream(outputErrorFilePath)); writeOutput(pane, "\nOutput Error File : " + outputErrorFilePath); writeOutput...
d50d341a-bfc6-470f-a687-fc2a60a37e2f
3
static public CycList convertResponseToCycList(Object response, Object command) { if (response.equals(CycObjectFactory.nil)) { return new CycList(); } else { if (response instanceof CycList) { return (CycList) response; } } String request; if (command instanceof CycList) ...
52b0a15c-5c0d-403b-a928-f4ce6b0852df
6
@Override public void delMaterie(String materieDeSters) { BufferedReader fisier; try { fisier = new BufferedReader(new FileReader("fmaterii")); BufferedWriter fisier_nou; ArrayList<String> vector = new ArrayList<>(); for(String line; (line = fisier...
edbd9968-989e-4c28-ab45-618e137bcb2a
6
public void modifyPrompt(int exp) { String result = (String)JOptionPane.showInputDialog(null,"Enter the modified value: ", "Modify Value", JOptionPane.OK_CANCEL_OPTION, null, null, ""); float value = 0.0f; try { value = Float.parseFloat(result); } catch(NumberFormatException e) { JOptionPane.sh...
5d3616e4-cc10-4933-a6f6-9f0826e22eed
3
@Override public void run() { try { while (true) { System.out.println(new Date()); Thread.sleep(6 * 10000); try { in.getWS(); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (Interrupte...
6f0bd3c9-c43f-494e-886f-37b9cc2ae9a1
7
public static <E extends Comparable<? super E>> boolean isBinaryTreeBst_InLine(BinaryTreeNode<E> node) { if (node == null) { return true; } boolean isLeftNodeSmall = node.left == null || node.left.data.compareTo(node.data) < 0; boolean isRightNodeBig = node.right == null || n...
cffd4d76-0969-47dd-9102-af19583b1c35
1
public ByteVector putLong(final long l) { int length = this.length; if (length + 8 > data.length) { enlarge(8); } byte[] data = this.data; int i = (int) (l >>> 32); data[length++] = (byte) (i >>> 24); data[length++] = (byte) (i >>> 16); data[le...
d71294c3-3d21-40b6-b7b5-cd7830f62c60
8
OpenGLModelData(ModelLoader model) { VAOID = glGenVertexArrays(); glBindVertexArray(VAOID); glEnableClientState(GL_VERTEX_ARRAY); if (!model.normals.isEmpty()) { normals = true; glEnableClientState(GL_NORMAL_ARRAY); } else { glDisableClientState(GL_NORMAL_ARRAY); } if (!model.color.i...
05db1d5b-e252-41ca-96d5-ba6bca48637d
5
public WindowsLaunchParameters() { // Hashtable winLaunch = library.getDictionary(entries, "Win"); Object value = getObject(FILE_KEY); if (value instanceof Hashtable) { launchFileSpecification = new FileSpecification(library, (Hashtable)value);...
89af0e27-6eff-4ba7-b5be-7ca029e0273e
7
@Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._identificador_ == oldChild) { setIdentificador((TIdentificador) newChild); return; } for(ListIterator<PDe...
83c6f247-343d-413c-8510-b4612f607300
9
public static double CalculTarifDepl(int i, Saisie saisies ,List<AR> AR , List<AS> AS) //calculer les frais { double prix = 0.0; if(saisies.getTypeduTrajet().equals("AS")) { //Aller - Simple if(saisies.getJour().equals("S") && saisies.getHeure().equals("J")) { prix = (AS...
e642b5df-2c3e-4d6d-a9ac-d5552480aafb
5
private int getNewLiftID(){ if(new File(liftPath).listFiles().length==0){ return 1; }else{ int[] lifts = new int[new File(liftPath).listFiles().length]; for(int i=0;i<lifts.length;i++){ lifts[i] = Integer.parseInt(new File(liftPath).listFiles()[i].toString().split(".y")[0].split("elevators/")[1]); ...
f7459601-2a9c-4400-9a52-872d1ea31e2d
2
public boolean decryptSerializedKey(String password, String keyFilename, String keyFilenameEncrypted) { try { File f = new File(keyFilename); File fe = new File(keyFilenameEncrypted); f.createNewFile(); fe.createNewFile(); FileInputStream fis = new FileInputStream(keyFilenameEncrypted); FileOu...
0cbe5787-f643-486a-9437-91d68cde3ebf
3
public String getTime(){ int minutes = 0; int seconds = time; while(seconds>=60){ seconds-=60; minutes++; } String time; if(minutes<10) time = new String("0"+minutes+":"); else time = new String(minutes+":"); if(seconds<10) time = new String(time+"0"+seconds); else time = new S...
19c108c0-12e7-4c37-ac4c-658341ab8bb2
0
public static void main(String[] args) { Manager ceo = new Manager("Gus Greedy", 800000, 2003, 12, 15); Manager cfo = new Manager("Sid Sneaky", 600000, 2003, 12, 15); Pair<Manager> buddies = new Pair<Manager>(ceo, cfo); printBuddies(buddies); ceo.setBonus(1000000); cfo.setBonus(5...
54e7eac1-7a37-4e9f-8ba4-06ca5fea76d6
8
private PrecisionLayoutData getData(Component[][] grid, int row, int column, int rowCount, boolean first) { Component component = grid[row][column]; if (component != null) { PrecisionLayoutData data = mConstraints.get(component); int hSpan = Math.max(1, Math.min(data.getHorizontalSpan(), mColumns)); int vS...
8cbc7ba5-756c-410c-8d3c-d11cb1557614
6
@Override public int compare(Drillable one, Drillable two) { Date date1 = one.getPractice() == null ? null : one.getPractice().getLastPracticed(); Date date2 = two.getPractice() == null ? null : two.getPractice().getLastPracticed(); if (date1 == null && date2 == null) { return 0; } if (date1 == null) {...
10dc23fd-e020-4bd1-b67d-225baf5fe27f
7
public boolean checkFrequency(Player player, double frequency) throws IOException{ File myFile = new File("plugins/CakesMinerApocalypse/frequencies.txt"); if (myFile.exists()){ Scanner inputFile = new Scanner(myFile); String setFrequency = ""; while (inputFile.hasNextLine()){ String name = inputFile.ne...
c2483699-dc8f-4904-8441-5a603bf3c7d6
2
public boolean compDate(String a){ boolean b=true; int c= Integer.parseInt(a); if(c>1999 || c<1960){ b=false; error1.setText("Edad no aceptada"); } return b; }
f990d131-c9e5-45c7-98b7-a2b65138f371
2
public boolean matchesFunction(String text) { int functionCount = this.functionList.size(); for(int i = 0;i<functionCount;i++) { String currentFunction = this.functionList.get(i).getLiteral(); boolean isMatchingExpression = text.equals(currentFunction); if (isMatchingExpression) { return true; } ...
d2dc8161-8434-4f8a-a54c-d0be0a3b906e
0
public String getFirstName() { return firstName; }
a12c035f-fe5b-46b5-b248-7b62134d106e
4
private void sink(int k) { while (2*k <= N) { int j = 2*k; if (j < N && greater(j, j+1)) j++; if (!greater(k, j)) break; exch(k, j); k = j; } }
a7e99ecb-2c21-4085-b6b8-1b8c2cccfd94
2
public void addScreen(GameScreen g) { if (!screens.isEmpty()) { GameScreen s = screens.get(screens.size()-1); if (g.isFullscreen()) s.state = ScreenState.HIDDEN; else s.state = ScreenState.PARTIALLYCOVERED; } screens.add(g); }
20ab437d-1f45-45db-a1e9-84e5dd875372
1
public void testWrongUser(){ Client c =Client.getInstance(); try { c.connect(url,"asdf","false"); fail(); } catch (XmlRpcException e) { log.error(e.getMessage()); } }
396d0529-800f-4b37-8420-e10daf40e1ee
9
public boolean isLocation(Location location) { // null check if(location == null) return false; // Define the variables String world = location.getWorld().getName(); int x = location.getBlockX(); int y = location.getBlockY(); int z = location.getBlockZ(); // If the world isn't the world of this chest...
fb0a2354-9253-4bab-8309-253273946aee
0
@Override public Object clone() { return new LightRabin((HashSet<Integer>) states.clone(), (HashSet<Integer>) liveStates.clone(), new Integer(initialState)); }
8cd83cbb-a6b5-44ed-a0cc-21f507f3c258
3
public int getTestFailures(UUID batchId, Boolean persist){ int failures=0; if(persist){ connectDb(); String env = System.getenv("ENV"); String tableName = env.substring(0, 1).toUpperCase() + env.substring(1).toLowerCase() + "TestResults"; try { ...
da32d7c1-e541-4bcb-9d07-9c83c11505ac
7
public static WargusMap loadFromXML(Element e) { assert e.getName().equals("map") : "WargusMap.loadFromXML: Invalid XML Element " + e.getName(); int width = Integer.parseInt(e.getChildText("size-x")); int height = Integer.parseInt(e.getChildText("size-y")); WargusMap map = new WargusMap(width, h...
16a1b461-77c5-4d06-8967-66f8e8bf9a22
4
protected boolean in_grouping_b(char [] s, int min, int max) { if (cursor <= limit_backward) return false; char ch = current.charAt(cursor - 1); if (ch > max || ch < min) return false; ch -= min; if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return false; cursor--; return true; }
9d5873d5-7f6d-47fe-984a-51111eb17b13
4
@Test public void test() { for(int i=0; i<2000; i++) { for(int j=i%5; j<800; j+= 100) { float val = i * 3.9f + j/8.1f; matrix.setValue(i, j, val); } } for(int i=0; i<2000; i++) { for(int j=i%5; j<800; j+= 100) { float val = i * 3.9f + j/8.1f; assertEquals(matrix.getValue(i, j), val, 1e-1...
0c799bdc-e3dd-46dc-b618-d03a36451722
6
@SuppressWarnings("unchecked") @Override public void open(File file) { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new FileInputStream(file)); shapes = ((ListenedList<ShapeComponent>) ois.readObject()); shapes.setRunnable(new Runnable() { @Override public void run() { ...
b9b48fe6-2335-4abe-a243-730f68c4e725
0
public void setPrice(double price) { this.price = price; }
3cdf8ff0-aa51-4ecb-9486-f742336a5758
9
public int[] pu_and_py(){ //count the purines ans the pyrimidines int[] count = new int[2]; //purines, pyrimidines for (int i=0; i<DNA_analyse.w.raw.length(); ++i){ switch (DNA_analyse.w.raw.charAt(i)){ case 'a': case 'A': case 'g': case 'G': ++count[0]; break; case 'c': case 'C': case 't': case ...
9a845551-b2e8-4eae-9054-ebbad60c0c75
0
public String toString() { DecimalFormat df = new DecimalFormat("#.##"); return this.getDesc() + " with " + df.format(this.getHealth()) + "hp" + " and " + df.format(this.getStrength()) + "dmg"; }
d9646528-8f79-4abf-9806-fbabffc4911b
0
public void setType(TileType t) { type = t; }
b4b19229-ae1b-4a2a-974f-526d4a331348
5
private int longestRoadDFS(Node current, Node parent, Set<Node> visitedNodes, Map<Coordinate, Node> nodeMap, String playerName) { int maxLength = 0; // Add the current node to the set of visited nodes visitedNo...
ff3ae38a-764a-48ef-bff4-c3038856c8df
9
public void run() { while (!stop.get()) { RPCEnvelope req = requestQueue.poll(); if (req != null) { try { encoder.encode(sout, req); if(req.getEnvelopeType()==RPCEnvelope.RPC_ENVELOPE_TYPE_ADMIN){ RPCAdminEnvelope admin = (RPCAdminEnvelope)req; if(admin.getAdminCommand()==RPCAdminComma...
2c047f19-acfa-4db2-8c63-e078cf2dddc3
8
void dataBufferNormalize() { int i = 0; int j = 0; int end = dataBufferPos; // Skip whitespace at the start. while (j < end && isWhitespace(dataBuffer[j])) { j++; } // Skip whitespace at the end. while (end > j && isWhitespace(dataBuffer[...
2020fa19-fa17-40d0-8b21-f4f982297988
9
public static Vector<Integer> SLO(GraphModel g, Vector<Integer> V) { List<Pair<Integer, Integer>> VertexDegree = new Vector<>(); Vector<Integer> Ordering = new Vector<>(); //Compute N_2-degree for all vertices in V for (int v : V) { VertexDegree.add(new Pair<>(v, Neighbors.N_2(g, v).size())); ...
ebf424d3-9379-405b-a74a-5d470053242b
0
public String getAddress() { return address; }
6613e128-d273-49a1-81ff-c23d80db507e
6
private void handleUrganceQueue() { for (int i = 8; i < 11; i++) { HospitalPart hp = HospitalPart.values()[i]; Sector sec = sectors.get(hp); LinkedBlockingDeque<Patient> q = doc_queues.get(hp); if (sec.hasBusyDoc()) { int[] tmp = sec.getFinishTimes(); for (int j = 0; j < sec.getDocCount(); j++) ...
f9b7610c-0f0d-4f01-8694-845698236db6
6
public static boolean findPairWithSumAllowSort(final int[] numbers, int sum, int excludeIndex) { /* * If allowed to change the original array * O(nlogn+n) */ if(numbers.length == 0) { return false; } Arrays.sort(numbers); boolean found = false; int ahead = numbers.length - 1; int behind =...
71b8233a-490b-4d22-a040-70b337af9ee8
2
@Override public void actionPerformed(GUIComponent source) { if (source == forwardArrow) { nextSlide(); } else if (source == backArrow) { previousSlide(); } }
47ea634a-6492-43b9-8758-8044d8d66efe
3
public static boolean canOpenScreen(UserInterface ui) { if (ui instanceof Inventory) { if (Console.isActive()) { return false; } else { return true; } } else if (ui instanceof Console) { return true; } return false; }
e4ea70ef-bc8c-4bd1-af7e-256521802533
7
public FieldAccessBenchmark () throws Exception { int count = 1000000; Object[] dontCompileMeAway = new Object[count]; FieldAccess access = FieldAccess.get(SomeClass.class); SomeClass someObject = new SomeClass(); int index = access.getIndex("name"); Field field = SomeClass.class.getField("name"); for ...
c2376080-7102-46ee-963b-8a046cf16863
7
public boolean addLine (String line) { int noOfAtts = Structure.numAttributes(); DenseInstance inst = new DenseInstance(noOfAtts); inst.setDataset(Structure); String attrs[] = line.split(","); for (int i = 0; i < Structure.numAttributes(); i++) { if (i == (attrs.lengt...
97121024-8ead-4739-9a05-d1fac0bad64c
5
public void mousePressed(MouseEvent e) { boolean isFaceUp, hasBeenRemoved; String information = ""; Rectangle cardArea; Point pressPt = e.getPoint(); for (int i = 0; i < cards.length; i++) { cardArea = cards[i].getCardArea(); if (cards[i]...
07432c54-44a6-48d0-9afd-55b3133b1a6a
8
public void proteomeLite(boolean debug , boolean useModifiedStopsStarts, boolean preFilterForStartCodon){ //Set variables displayInfo = debug; modStopStart = useModifiedStopsStarts; preFilterStarts = preFilterForStartCodon; //Get the current time cal = Calendar.getInstance(); startTime = sdf.format(cal...
5c12bf92-54cb-43d9-9cac-be5b22353272
2
@Override public void handleFile(File file) { if (getProcessMode() == MODE_BIG_CHUNK) { inspectContents(file, FileTools.readFileToString(file, lineEnding)); } else if (getProcessMode() == MODE_ARRAYS) { ArrayList lines = new ArrayList(); ArrayList lineEndings = new ArrayList(); FileTools.readFileToArra...
aff55833-1fcb-43fb-9628-b139213a4f86
7
public void renderSprite(int xp,int yp,Sprite sprite,boolean Fixed){ if(Fixed){ xp -= xOffset; yp -= yOffset; } for(int y = 0; y < sprite.getheight(); y++){ int ya = y + yp; for(int x = 0; x < sprite.getwidth(); x++){ int xa = x + xp; if (xa < 0 || xa >= width || ya < 0 || ya >= height) contin...
0973c275-5597-453d-b3a3-202fdfea8c2d
1
public Particle(ParticleEmitter pm, Registry rg, Actor as, String im, int x, int y, float vx, float vy, float a, float av, float s, int t, boolean f, boolean p, boolean dt, int d, boolean vbr) { particleEmitter = pm; registry = rg; source = as; mapX = x; mapY = y; velocit...
b277616b-ebac-43fa-a82b-5f5f70156eb2
2
public FieldVisitor visitField(final int access, final String name, final String desc, final String signature, final Object value) { checkState(); checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_VOLATILE + Opc...
51088a52-cc82-48e3-a2c7-97d6f5fe7e1c
5
private static void readByteFile (Path path){ DataInputStream dataIn=null; try { //apertura del stream. dataIn= new DataInputStream(Files.newInputStream(path)); try{ while (true){ System.out.println(dataIn.readUTF()+ " " ...
96cd9e7e-501b-4103-be9e-f034b1a9f1cf
0
public void basicBoard() { System.out.println("====================================================================="); System.out.println("| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |"); }
5b0db5b4-a88d-4d5a-8035-d7e09d125298
2
private static <Label, Out> Set<List<Out>> run(List<TreeNode<Label>> paths, F1<Label, Out> selector) { SequencesSemiRing<Out> c = new SequencesSemiRing<>(); Set<List<Out>> allResults = c.zero(); for (TreeNode<Label> path : paths) { Set<List<Out>> result = c.one(); for (Label step : path.getPath()) { ...
ded90d51-0f52-411b-9bd9-da1d34b1f02a
4
private boolean takeNeighbours(String player, Hexpos hp) { // return immediately if player is not a valid string if (!(player.equals("red") || player.equals("blue"))) return false; // iterate over a list of all neighbours MyList neighbours = hp.neighbours(); Iterator it = neighbours.iterator(); while (i...
e8eb91ba-83fc-41e3-9724-eeb4c812af9a
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Jpa20Employee other = (Jpa20Employee) obj; if (divisionName == null) { if...
51b02932-50eb-4043-bc33-b45129bd112b
9
public static int[] pair(ArrayList<Player> players){ int numPlayers = players.size(); int[] order = new int[numPlayers]; int orderhealth = 0; boolean valid = true; int[] opt_order = new int[numPlayers]; int opt_orderhealth = Integer.MAX_VALUE; PermutationGenerator pg = new PermutationGenerator(pla...
03cade86-5386-48a6-8298-7627d4980262
5
private String computeProbabilites(int iterations, int players, boolean suited) throws Exception { Card.SIGN suitedSign = SIGN.HEARTS; // for all suited rollouts we draw 2x hearts Card.SIGN unsuitedSign = SIGN.DIAMONDS; // for all unsuited rollouts: 1x hearts and 1x diamonds String outputStr = ""; // loop ov...
d7bd9296-e8a4-457d-8e78-465e8f665027
7
void setMouseEntered(boolean entered) { if (useMouseEnterExit) { if (entered && !mouseEntered) { super.processMouseEvent( new MouseEvent(this, MouseEvent.MOUSE_ENTERED, System.currentTimeMillis(), 0, 0, 0, 0, false)); } else if (!entered && mouseEntered) { super.process...
c49c039e-c0ad-4786-95f7-f7cc8a1f87c3
9
public String attack(Actor attacker, Actor target) { boolean playerAttacking = attacker.type.equals("player"); boolean playerDefending = target.type.equals("player"); if (target.status.equals("dead")) { assert playerAttacking; return "You "+attackMsgPlayer+" the "+target.name+"'s corpse."; }...
69ff357e-d17b-4a1e-b138-78ce4b6a8f98
9
public Matrix solve (Matrix B) { if (B.getRowDimension() != m) { throw new IllegalArgumentException("Matrix row dimensions must agree."); } if (!this.isNonsingular()) { throw new RuntimeException("Matrix is singular."); } // Copy right hand side with pivoting int n...
348edf0a-120a-4953-8d02-d84d383fc79f
6
public boolean hasBannedMac() { if (macs.isEmpty()) { return false; } boolean ret = false; int i = 0; try { Connection con = DatabaseConnection.getConnection(); StringBuilder sql = new StringBuilder("SELECT COUNT(*) FROM macbans WHERE mac IN ("...
f379e046-ee32-47cb-a520-117215a83152
1
public boolean isLeaf( ) { return (left == null) && (right == null); }
5a822c01-fca7-41d9-b654-857cea648dee
1
private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja cancelar a" + " compra ?","",JOptionPane.OK_CANCEL_OPTION) == 0){ this.dispose(); } ...
0904b713-1eea-4a79-bc08-0858201c297a
6
public boolean isReadOnly(ELContext context, Object base, Object property) { if ((base == null) || (property == null)) { return false; } context.setPropertyResolved(true); FacesContext fcontext = (FacesContext) context.getContext(FacesContext.class); ELContext elCon...
08d15999-fc20-47e2-9acc-08818ffd08df
9
@Override public void readAllSequence() throws IOException, FileFormatException { String id = null; String qual = null; StringBuffer seq = new StringBuffer(); String line = null; while ((line = reader.readLine()) != null) { lineRead++; if (line.isEmpty()) continue; if (Pattern.matches(ID_RGX, l...
e9735525-f0dd-4e3c-a844-081d6f46ce39
0
@Test public void testNum2wordWithMoreThanOneResults() { List<String> wordList = _phonewordFinder.num2words("625673278"); assertTrue(wordList.size() > 0); }
c921901e-6590-45ee-a7b2-8908f0195b56
1
public int compareTo(Object object) { if (!(object instanceof CycSymbol)) { throw new ClassCastException("Must be a CycSymbol object"); } return toFullStringForced().compareTo(((CycSymbol) object).toFullStringForced()); }
0c299d57-f2d6-4e51-89de-a6f4a6ee3aca
0
@Basic @Column(name = "cost_price") public double getCostPrice() { return costPrice; }
72e6ddef-6493-420b-952d-6d200fb83c35
0
public String getApellido2() { return apellido2; }
5667b9c5-d799-43c1-8119-58d141aadcc7
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 Project)) { return false; } Project other = (Project) object; if ((this.id == null && other.id != null) || (thi...
569e6719-13c9-4883-9657-9d5e2e89f11e
6
public DirtStairsTile(int dir) { super(new SpriteBody()); this.dir = dir; Random random = new Random(1000); int w = 6; int h = 8; double ws = 1.0 / (w); double hs = 1.0 / (h); for (int x = -1; x < w + 1; x++) { for (int z = 0; z < w * 3; z++) ...
1832d8ee-049f-4f1e-b248-c217fffba9c2
8
public static Cons walkSetqTree(Cons tree, Object [] MV_returnarray) { if (Cons.badArgumentCountP(tree, 2)) { return (Stella_Object.walkDontCallMeTree(tree, Stella.SGT_STELLA_VOID, MV_returnarray)); } { Stella_Object variable = tree.rest.value; Stella_Object value = tree.rest.rest.value; S...
7be7b432-1633-434d-8b70-762cc205bc55
8
public List<Long> getLongList(String path) { List<?> list = getList(path); if (list == null) { return new ArrayList<Long>(0); } List<Long> result = new ArrayList<Long>(); for (Object object : list) { if (object instanceof Long) { result....
6c114a1c-25d4-41f8-b9f3-d7e2deba7f35
0
@Override public void mouseReleased(MouseEvent e) {}
52f1715d-447f-4874-bdf5-ac00a35486a1
5
public static void parsePacket(byte[] packet, int length, RODashboardData dashboardData) { // Split up the packet byte[] packetPayload = Arrays.copyOfRange(packet, 0, length-2); byte[] feedbackData = Arrays.copyOfRange(packet, 6, length-2); byte[] packetChecksum = Arrays.copyOfRange(pack...
527a802f-7b55-4d8c-a8f1-654011d34c8f
5
@Override public boolean doSmall() { if (CANIFIS_PUB.contains(ctx.players.local())) { for (GameObject door : ctx.objects.select().id(CLOSED_DOOR).nearest().first()) { door.bounds(DoorOpener.DOOR_BOUNDS_EW); if (DoorOpener.open(ctx, door)) { Condition.sleep(300); } } } final TilePath path ...
341bee68-3285-4551-8f77-f6bbe54eaf62
1
public T update(long id, T entity){ T oldEntity = read(id); if(oldEntity != null){ merge(oldEntity, entity); entity.setId(id); } return entityManager.merge(entity); }
df103a43-586e-4043-af83-70b50f27ec0d
7
public void nextBytes(byte[] out, int offset, int length) throws IllegalStateException, LimitReachedException { if (out == null) { return; } if (!initialised) { throw new IllegalStateException(); } if (offset < 0 || offset >= out.length || length < 1) { retu...
87dc9a29-0abc-4a49-bc19-bf7be38d9a87
8
public void buildClassifier(Instances data) throws Exception { // can classifier handle the data? getCapabilities().testWithFail(data); data = new Instances(data); numExamples = data.numInstances(); Enumeration e = data.enumerateInstances(); // Checks on data not implemented. // reset ...
1952908c-72fe-4d12-af44-1b2048730265
5
public static void attack(SimulatedPlanetWars simpw, int objective) { // Objective is 0 GR, 1 planet, 2 ships, 3 Dcal + distance Planet source = null; Planet dest = null; List<Planet> asw; switch (objective){ case 0 : asw = forGR(simpw); break; case 1 : asw = forPlanet(simpw); break; case 2 : ...
efd1c544-14e6-408b-b94d-7748d5337e7f
6
public void setNext(Tetromino next){ // determine best orientation; this.next = next; switch(next.toString()) { case "TypeJ":orientation = 3; offset = 30; break; case "TypeZ": case "TypeI": orientation = 2; offset = 20; break; case "TypeS": orientation = 2; offset = 30; break; case "TypeL": orientation ...
66ab9780-db62-464e-9c5e-381ef37d8bf4
3
public void addObjects(StageChoose[] stageChooseds) { if (stageChooseds != null) { ArrayList<StageObject> MapObjects = compile(stageChooseds); if (MapObjects != null) { for (StageObject mapObject : MapObjects) { stage.addMapObject(mapObject); ...
985ec46d-bd95-43a6-adad-af2defb9fdae
4
public List<IWorkbenchPartReference> partsInActivationOrder(List<IWorkbenchPartReference> editorReferences) { ArrayList<IWorkbenchPartReference> results = new ArrayList<IWorkbenchPartReference>(); for (IWorkbenchPart part : activationOrder) { IWorkbenchPartReference matchingPartReference = null; for (IWork...
54cb42dc-cc33-4654-8537-e39de847e75b
8
public static void main(String argv[]) { //--------------------------------------------------------------- // Parse arguments. //--------------------------------------------------------------- CommandArgs cmd = new CommandArgs (argv, // arguments to parse "CD...
0d8c5066-2f59-433d-88e5-8c0ec03e16f3
8
@Override protected Map<String, String> localValidation() { final Map<String, String> error = new HashMap<String, String>(); if(getTimeRange().split(",").length == 2){ String timeMin = getTimeRange().split(",")[MIN]; String timeMax = getTimeRange().split(",")[MAX]; ...
ea2145ff-2c68-4ee1-b73c-a12ddfb3cbde
3
@Override public void update(long deltaMs) { super.update(deltaMs); if(firing) { elapsed += deltaMs; if(elapsed >= delay) { fireOnce(); fired++; elapsed = 0; if(fired >= burst) { firi...
3d9baf5f-52f1-41b3-8938-07310951b376
0
public void hide() { stage.close(); }
32431034-a4a4-4ceb-a7a4-772d8eef7227
1
@Override public int attack(double agility, double luck) { if(random.nextInt(100) < luck) { System.out.println("I just did a suicide bombing!"); return random.nextInt((int) agility) * 2; } return 0; }
91d7c69a-1af5-4449-ae50-395c17b740b3
0
private void initComponents() { setLayout(new GroupLayout()); add(getJButton0(), new Constraints(new Leading(70, 86, 30, 20), new Leading(95, 30, 20))); add(getJLabel1(), new Constraints(new Leading(70, 150, 12, 12), new Leading(26, 41, 10, 10))); // add(getJLabel2(), new Constraints(new Leading(70, 150, 12, 12)...
2cb131dc-baba-4940-81f1-5a7da3330a51
6
* @Post: No changes * @Return: Whether or not the chosen piece can en passant in the current direction */ private boolean checkIfCanEnPassant(boolean leftOrRight) { if(leftOrRight==RIGHT) { if(lastMove.getCurrentLocation().equals(new Point(chosenPiece.getX()+1,chosenPiece.getY()))) { if(Math.abs(last...
579247df-a6c3-4796-94f8-b70a48b47077
4
public void checkMove() { if (c.getCharSheetPosX() > 1000) { g.shiftRight(); c.setCharSheetPosX(950); repaint(); } else if (c.getCharSheetPosX() < 10) { g.shiftLeft(); c.setCharSheetPosX(128); repaint(); } else if (c.getCharSheetPosY() > 550) { g.shiftDown(); c.setCharSheetPosY(500); ...
eab5668a-d9bd-4751-8b38-18ba90fa3aed
3
public String getBatteryStatus () { switch (statusTable [8]) { case 0: return "good"; case 1: return "weak"; case 2: return "empty"; default: throw new InternalError (); } }
fb764fe2-bd78-4434-8626-73f3a1ad77ce
7
public void createTail() { if (!canCreateTail) return; double dir = getDirection(); double tailx = (dir == Const.left) ? X() + getWidth() : oldX(); double taily = (dir == Const.up) ? Y() + getHeight() : oldY(); //Each tail segment is ratspeed in length because it is created...
d1e6f381-e449-45d7-a1a9-3357ae275fc7
7
public NumberNodeEditor(NumberNode node) { this.m_Node = node; String name = node.getText(); Number value = node.getValue(); int iteratorType = node.getIteratorType(); boolean showCheckBox = node.getCheckable(); boolean selected = node.getSelected(); textForeground = UIManager.getC...