method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
cc3e24c4-f0d5-44eb-afe2-f0084d546b2a
6
@Override public int[] getInts(int par1, int par2, int par3, int par4) { int i1 = par1 - 1; int j1 = par2 - 1; int k1 = par3 + 2; int l1 = par4 + 2; int[] aint = this.parent.getInts(i1, j1, k1, l1); int[] aint1 = IntCache.getIntCache(par3 * par4); for (in...
46072b57-1816-4bec-8797-8daa75d36ea8
5
public static String asURL(String uri) { try { new URL(uri); return uri; } catch (Exception e) {} Request req = Request.getCurrent(); if (req == null) return uri; Map<String, Object> attrs = req.getAttributes(); Series<?> series = (Series<?>) attrs...
9510bbe2-8b4f-4d8f-b876-9a299814be3a
5
private void drawFogOfWar(Graphics2D g){ List<Integer[]> visibleTiles = player.getVisibleTiles(); g.setColor(GROUND_COLOUR_UNSEEN); g.fillRect((int)-panX, (int)-panY, width, height); g.setColor(GROUND_COLOUR_SEEN); for(int i = 0; i < visibleTiles.size(); i++) { I...
b339e8c4-133d-439d-8e4b-16711a52de49
0
public void init(List<String> argumentList) { label = argumentList.get(0); }
a27d0c0a-cc33-4dcb-ab6c-1e49c472b375
7
public void caseAVariableOccursFixedOrVariable(AVariableOccursFixedOrVariable node) { inAVariableOccursFixedOrVariable(node); if(node.getOccurs() != null) { node.getOccurs().apply(this); } if(node.getOccursTo() != null) { node.getOccursTo().app...
41cae6d4-fdef-4044-82f9-6e3135631d91
4
static void bfs(int node, ArrayList<ArrayList<Integer>> g, boolean[] visited, int[] dist){ if(visited[node]) return; Queue<Integer> toDo = new LinkedList<Integer>(); dist[node]=0; toDo.add(node); while(!toDo.isEmpty()){ int n = toDo.poll(); visited[n]=true; for(int neighbor:g.get(n)){ if(!visited...
4bfdd870-a707-4fb4-ab18-d72d563bd563
5
public void set(int key, int value) { LRUnit lrunit = cacheMap.get(key); if(lrunit!=null){// found ,just set new value lrunit.setValue(value); lrunit.flushDate(); return; }else{// not found int len = cacheMap.size(); if(len<capacity){// not reach capacity,new one cac...
32a347c5-987a-4dd0-a1ee-558c8a7253d2
6
public boolean isBST(JTreeNode<T> n){ boolean leftVal; boolean rightVal; if(n==null) return true; if(n.getLeftNode()!=null && n.getLeftNode().getValue().compareTo(n.getValue())>0) return false; else leftVal = isBST(n.getLeftNode()); if(n.getRightNode()!=null && n.getRightNode().getValue().compar...
4a55a650-f4ec-4cd0-bfef-d2c5ce4ecbe3
4
boolean posValida(int lin, int col) { if( ((lin >= 0 ) && (col >= 0)) && ((lin < l) && (col < c)) ) return true; return false; }
8439cc86-0099-44ea-9be4-081ade8f30fa
1
public void stoppedCurrentSong() { EIError.debugMsg("stoppedCurrentSong "+hitFadeOutNext); if(!hitFadeOutNext) { startNextSong(); } hitFadeOutNext = false; }
4e331425-617f-426e-85a8-b528557dec09
4
private void textNombreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textNombreKeyTyped // TODO add your handling code here: if (!Character.isLetter(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar())) { Toolkit.getDe...
8f568d45-6527-4b58-be24-fc4c43c52975
2
public static Fonction SelectFonctionById(int id) throws SQLException { String query = ""; Fonction fonction = new Fonction(); ResultSet resultat; try { query = "SELECT * from FONCTION where ID_FONCTION=? "; PreparedStatement pStatement = ConnectionBDD.getInstan...
4768d44c-7b2d-4a3a-ac40-4dd5d8ebbdba
2
public void handle(Throwable throwable) { String message = null; String report = null; try { // Read the error message. InputStream is = getClass().getResource(ERROR_LOCATION) .openStream(); BufferedReader reader = new BufferedReader( new InputStreamReader(is)); StringBuffer sb = new StringB...
56136ace-420d-4f2a-8e6e-d69d9cd4b37d
7
@Override public final Object execute(final Context context) throws Exception { final ITemplate template = this.getTemplate().getTemplate(); final Map arguments = this.expression2 == null ? null : (Map) this.expression2.execute(context); final String location = Operation.toString(expression1...
aa8f33be-80c5-46c7-ba71-ddab000c6286
8
public void muutaVoittosuoraa(int pituus) { if (pituus == 2 || pituus == 3 || pituus == 4 || pituus == 5 || pituus == 6 || pituus == 7 || pituus == 8 || pituus == 9) { this.voittosuora = pituus; } }
25b6cf1e-9412-4696-b83a-44d9dc659b79
2
private void createButtonActionPerformed(java.awt.event.ActionEvent evt) { if((pendingN.equals("")) && (pendingT == null)) { player.promptVote(); pendingN = propNameField.getText(); pendingT = player.getGround(); supportField.setText(player.getName()+" proposes a new nation: "+pendingN); ...
ebd5302e-53ee-4085-9b96-7a5d8076f7dc
9
public float returnTotalCostByCustomerTypeAndTime(String customerType,int[] customrDate){ float totalAfford = 0; if(customerType.equals("")||customrDate.length==0){ // check the data whether is valid! // the data is invalid! System.out.println("Oh! when hotel check the total offord, your data is wrong!! pl...
7153a5d6-1589-461f-a548-19123d63bac2
9
public void save() { //---Enables the users to save the canvas image buffer to file if(canvas._changesMade) if(fileName == null || fileName.isEmpty()) { //final JFileChooser sFile = new JFileChooser(); int response = fileChooser.showSaveDialog(canvas); if(response == JFil...
60d20e5f-4381-4982-81b1-2a269fe9497b
7
public void drawTrans(Bitmap image, int xPos, int yPos, int xo, int yo, int w , int h, int amount){ for(int y = 0; y < h; y++){ int yPix = y+yPos; if(yPix < 0 || yPix >= height)continue; for(int x = 0; x < w; x++){ int xPix = x+xPos; if(xPix < 0 || xPix >= width)continue; int src = image.pixels[...
29fd0831-b014-411f-ad71-873f502b1ed6
7
public void mouseDragged(MouseEvent mouseEvent) { Iterator<PComponent> it = components.iterator(); while (it.hasNext()) { PComponent comp = it.next(); if (shouldHandleMouse) { if (comp.shouldHandleMouse()) comp.mouseDragged(mouseEvent); ...
e3ceb4e5-199c-499b-b64d-268f9508dfdd
6
private void build(int depth, int indexAtRow, Integer idParent, boolean isLeft) { DepthRow depthRow = depthManager.getDepth(depth); if (depthRow != null) { DepthRowNode node = depthRow.getNodeElement(indexAtRow); if (node != null && node.containsElement()) { ListT...
0f5e108d-2a3a-4a97-a0d5-554737bf72b6
2
public String getLabelCode(){ String str = condition.getLabelCode() + this.printLineNumber(true) + "goto := " + this.labelFalse + " if " + condition.place + " == false \n"; String trueCode = truePart.getCode(); str += (trueCode == "" ? "" : trueCode ) + this.printLineNumber(true) ...
7a419049-1c0b-47ff-b411-46ef2b37fff0
4
public int setBaudRate(int baudrate) { int bd = getBaudRate(); try { String parityStr = ""; if (parity == SerialPort.PARITY_EVEN) { parityStr = "even"; } else if (parity == SerialPort.PARITY_ODD) { parityStr = "odd"; } else if (parity == SerialPort.PARITY_NONE) { parityStr = "none"; ...
6d6e9197-75ba-430c-bd56-44bba2454c99
0
@Before public void setup() { this.mockMvc = webAppContextSetup(this.wac).build(); //ставим заглушку EmployeeDao stubEmployeeDao = mock(EmployeeDao.class); when(stubEmployeeDao.getAll()).thenReturn(Arrays.asList(new Employee[] {new Employee(), new Employee()})); when(stubEmpl...
6dee6c13-5214-46fc-8dd0-03194fed9b25
1
public boolean onMouseDown(int mX, int mY, int button) { if(button == 0) { screenClicked = true; } return false; }
0a2d4d4d-8c4e-4708-8488-3ca66ba4ba98
8
private void addDataD(int nGaussians) { //for now just assumes 6 orbitals in the order XX YY ZZ XY XZ YZ if (atomCoordBohr[atomIndex] == null) { moCoeff += 6; return; } if (doDebug) dumpInfo(nGaussians, "XXYYZZXYXZYZ"); setMinMax(nGaussians); int moCoeff0 = moCoeff; for (in...
cee0e433-db57-440f-8eef-c3fa654bcd33
2
private static char readChar() { // return and discard next character from input char ch = lookChar(); if (buffer == null) { if (readingStandardInput) throw new IllegalArgumentException("Attempt to read past end-of-file in standard input???"); else throw new Illega...
6333188e-f077-495d-aa08-8486d2e72a1e
7
protected Look (VorbisStream source, Mode mode) { int dim=0, acc=0, maxstage=0; map=mode.getMapping(); parts=Residue.this.getClassifications(); fullbooks=source.getSetupHeader().getCodeBooks(); phrasebook=fullbooks[Residue.this.getClassBook()]; dim=phrasebook.getDi...
4ad633f4-4c33-4ff3-9941-885ebb147561
4
public void keyReleased(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { dx = 0; } if (key == KeyEvent.VK_RIGHT) { dx = 0; } if (key == KeyEvent.VK_UP) { dy = 0; } if (key == KeyE...
bdbe150d-5155-48ef-9e72-52bd6ef54921
5
private void jButtonBookActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBookActionPerformed // Checks if the ID field is empty, if it is, there will be a error message(See else) if (!jTextFieldID.getText().equals("")) { // Formats the jXDatePickerSportDate into a St...
383ba167-54f1-460a-9ad3-b11eb88257b4
4
public void testBinaryCycAccess5() { System.out.println("\n**** testBinaryCycAccess 5 ****"); CycAccess cycAccess = null; try { try { if (connectionMode == LOCAL_CYC_CONNECTION) { cycAccess = new CycAccess(testHostName, testBasePort); } else if (connectionMode == SOAP_CYC_CO...
1ea07391-ff80-41d1-bb5b-49256723434e
9
public void parseFileForProperties(String filename) { try { BufferedReader br = new BufferedReader(new FileReader(filename)); String line; String segment = ""; String segmentTitle = ""; while ((line = br.readLine()) != null) { if (line.startsWith("-->")) { if (!segment.equals("")) ...
286f2eba-d353-4915-8ff9-f299e9419aa8
1
public void startTimer() { if (messageDelay.isRunning()) messageDelay.restart(); else messageDelay.start(); }
bdc3e6fd-073f-40d1-9db2-2c66843cb525
8
public int getPingjiaoStatusTotalPages(String grade, String semester, String course_name, String professionalName, String executiveClass) { PingjiaoDAO dao = new PingjiaoDAO(); if (course_name != null && course_name.equals("总计")) { course_name = "all"; } else if (course_name != null && course_name.equals("全...
cf79eea1-45d5-4041-beab-9a258d7f4232
4
@EventHandler public void onBlockBreak( BlockBreakEvent event ) { Player player = event.getPlayer(); Block block = event.getBlock(); if( block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN ){ Sign s = (Sign)block.getState(); ...
8db5fe8b-6b0c-491c-8110-98224934ddeb
9
public void createButtonSelected(SelectionEvent event) { /* * Remember the example shells so they * can be disposed by the user. */ if (shellCount >= shells.length) { Shell [] newShells = new Shell [shells.length + 4]; System.arraycopy (shells, 0, newShells, 0, shells.length); shells = newShells...
f1229cbf-4340-4807-b8b7-f0ef941b09a3
5
@Override protected void doPoll() { logger.fine("xhr poll"); Request req = this.request(); final PollingXHR self = this; req.on(Request.EVENT_DATA, new Listener() { @Override public void call(final Object... args) { EventThread.exec(new Runnabl...
596b6c48-0754-4c34-bd7a-65ce64a652ec
5
public static int CheckSubmit(Submit submit){ if (submit.getMsgType()!=6) return 30; if (!submit.getFeetype().equals("00") && !submit.getFeetype().equals("01") && submit.getFeetype().equals("02")) return 32; if (submit.getMsgFormat()>15) return 34; return 0; }
fed76a82-6436-45cf-a30c-06cf56a0658e
9
private void actionCompare() { new Thread() { @Override public void run() { CompareTabChooser chooser = new CompareTabChooser(AdminViewFrame.this); int result = JOptionPane.showConfirmDialog(getFrame(), chooser, "Compare Managers", JOptionPane.OK_CANCEL_...
f9a8f40f-2d0a-4b17-94e3-54a40bb0fe46
2
public void setErrorBars(int nc, double[] err){ if(err.length!=this.nPoints[nc])throw new IllegalArgumentException("input array of wrong length"); this.errorBar[nc] = true; for(int i=0; i<this.nPoints[nc]; i++){ this.errors[nc][i] = err[i]; this.errorsCopy[nc][i] =...
20b57d1f-3244-4219-8669-05f5a824a50d
8
private int getSenseDirection() { char read = (char) readAhead; int s = -1; switch(read) { case'A': case'a': break; case'H': case'h': break; case'L': case'l': break; case'R': case'r': break; default: break; } return s; }
aa0fe3a5-9377-4114-aadf-1dd022e70344
2
@Test public void insertTest(){ long start = System.currentTimeMillis(); for (int i = 100000; i >= 0; i--){ heap.insert(i); } long end = System.currentTimeMillis(); System.out.println("Time spent adding 100 000: " + (end-start)*1.0 + "ms."); long ...
3afe96e9-8177-412c-822c-933ef7b83191
2
public boolean clicked() { if(key.isPressed() && !key.isHeld()) return true; else return false; }
64aa46ca-a63d-4540-9064-d554f0b10387
1
private static boolean deleteSchedule(Schedule bean, PreparedStatement stmt) throws SQLException{ stmt.setDate(1, bean.getWorkDay()); stmt.setString(2, bean.getUsername()); int affected=stmt.executeUpdate(); if(affected==1){ System.out.println("Employee with username "+bean.getUsername()+" is not work...
de7dc4bb-90e5-49fa-871d-89a5950d1fe8
8
public void putShips(int x1, int y1, int x2, int y2) { if (x1 > this.getSize() || x2 > this.getSize() || y1 > this.getSize() || y2 > this.getSize()) { System.out.println("Cant place a ship outside of board "); return; } this.shipArr.add(new Ship(x1,y1,x2,y2)); if (x1 == x2) { // horizontal for...
ae65f968-10e8-4ad8-9e93-3c3601d3e139
5
@SuppressWarnings("CallToThreadDumpStack") private void pegaCaminhoArquivoXML() { try { File xml = new File("config.xml"); boolean x = false; while (x != true) { if (xml.isFile() && xml.exists()) { txtCaminhoArquivoXML.setBackground(new...
75410c16-ffeb-42c4-8736-bb73cdfcd836
4
public void loadMidi(String name, String location) { SoundMidi midi = null; URL midiLocation = Thread.currentThread().getContextClassLoader().getResource(location); if (midiLocation != null) { try { midi = new SoundMidi(midiLocation); } catch (SoundFileException e) ...
d4c5889b-73b3-4c53-af62-8798cb235847
7
static final Class348_Sub21 method3479(int i) { anInt4378++; if (i != -1) calendarTime = 43; if (Class75.aClass262_1254 == null || r.aClass312_9716 == null) return null; for (Class348_Sub21 class348_sub21 = (Class348_Sub21) r.aClass312_9716.method2329(10); class348_sub21 != null; class348_s...
562c15a5-c027-4f1f-8a42-42774d13b025
2
public void actionPerformed(ActionEvent e) { Component[] components = getComponents(); for (Component c : components) { if (c != e.getSource()) { ((CPIconButton) c).setSelected(false); } } ((CPIconButton) e.getSource()).setSelected(true); }
c820090f-408c-4842-ab6f-092f0cc55e85
8
@SuppressWarnings("rawtypes") public WSMessagesIn checkFromAddress(MessageContext msgContext) throws Exception { WSMessagesIn wsMessage = new WSMessagesIn(); wsMessage.setStatusId(3); try { //we write it to log for now DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:S"); Da...
3e550af8-084e-4bd8-92c7-efb5d404c36a
8
public int compareTo(Time other) { short greater = 1; short less = -1; if (COMPARISON_TYPE == COMPARISON_DESCENDING) { greater = -1; less = 1; } if (this.getTimeSector() != other.getTimeSector()) { if (this.getTimeSector() < other.getTimeSector()) return less; else return greater; } else { ...
022eea5d-8bea-4836-9c97-27307c5ac985
4
public void update() { up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W]; down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S]; left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A]; right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D]; }
dc850b02-7b0c-4c88-a09a-f731839b487b
6
@Override public ArrayList<User> findByBirthday(Date date) { ArrayList userList = new ArrayList(); try { connection = getConnection(); ptmt = connection.prepareStatement(QUERY_SELECT + " WHERE Birthday=?;"); ptmt.setDate(1, date); resultSet = ptmt.exec...
082f03d5-1102-4020-b7c9-365e4e98cfb4
5
@Override public boolean onCommand(CommandSender sender, Command cmd, String str, String[] args) { if (cmd.getName().equalsIgnoreCase("eventothor")) { if (args.length == 0) { return new PlayGameSetup().getSubCommand(sender, args); } else { if (args[0]...
f57b4291-e3b1-42c8-af4b-305ae9802a51
6
private String getFile(String link) { String download = null; try { // Open a connection to the page URL url = new URL(link); URLConnection urlConn = url.openConnection(); InputStreamReader inStream = new InputStreamReader(urlConn.getInputStrea...
deb0fa0c-041a-4116-bbe0-a43d89946207
4
public void paint(Graphics g) { //if you are still alive it goes and does the user interface. //if your dead, it says game over. if(me.getLives()>0&&!gameOver){ g.fillRect(me.getX(), me.getY(), 20, 20); g.drawString("Score: "+score, width/8, height - height/5); g.drawString("Lives: "+me.getLives(), width ...
7adde16e-41bc-4db8-915c-fc1268beb435
9
public static HashSet<Section> parseKnownInput(String fileLocation, HashMap<String, Course> histCourses ){ String line = null; HashSet<Section> knownCourseList = new HashSet<Section>(); // Open a buffered/file reader to read the input file. try { BufferedReader br = new BufferedReader(new FileReader(System...
dc87d566-7a89-4ce7-977a-fe303556c24c
7
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException { HttpSession sesionOk = request.getSession(); if (sesionOk.getAttribute("usuario") != null) { response.setContentType("text/html;charset=UT...
2d2a26c9-8d74-4125-a779-ff8aaa795c95
4
public List<Point> getPoints(){ //this seems like a much nicer way of possibly storing the piece //in the first place. ArrayList<Point> points = new ArrayList<Point>(); for (int i = 0; i<shape.length; i++){ for(int j = 0; j<shape[0].length; j++){ if (shape[i][j] > 0 || shape[i][j] == STRENGTH_MANA){ ...
6f1d0703-7ad5-4bcf-989e-29eb15daf979
5
protected int fillInternalBuffer() throws IOException { int numRead = 0; while (numRead < (buffer.length - 260)) { // && i != 128) { int i = in.read(); if (i < 0) break; if (i < 128) { numRead += fillBufferFromInputStream(numRead, i + ...
fdeb1e48-2172-4bcc-af64-2fe8ecf193e4
4
private static final JsonElement createValueElement(String key, Configuration configuration) { String value = configuration.getString(key); Object actualValue = configuration.getProperty(key); Matcher floatMatcher = IS_FLOATING_NUMBER_PATTERN.matcher(value); floatMatcher.find(); Matcher intMatcher = IS_...
90aaefd6-bfc8-47e2-8541-5a8a8dad972d
1
private boolean commit() { //no need but i'm paranoid ;) if(this.transaction){ return writeData(this.queries); } log.warning("No current Transaction!"); return false; }
09af642e-5d29-4f75-8b75-9db6de6bef66
4
@Override public String getColumnName(int columnIndex) { switch (columnIndex) { case 0: return "Texture"; case 1: return "ID"; case 2: return "Name"; case 3: return "Tags"; } retur...
0061d08a-e7ba-42b3-b353-277fc30b3f5f
9
public void getListOperacionesByDate(String fechaIni, String fechaFin) throws IOException { String formato; String numCuentaTeclado; CuentaBancaria ctaBancAux = new CuentaBancaria(); OperacionBancaria obj = new OperacionBancaria(); SimpleDateFormat sdf = new SimpleDateFormat("dd/...
296a94fa-ee2f-41e4-ad9b-214ee8822192
4
private void jTable20MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable20MouseClicked if (evt.getButton() == java.awt.event.MouseEvent.BUTTON3) { System.out.println("Right Click"); int r = jTable20.rowAtPoint(evt.getPoint()); if (r >= 0 && r < jTable20.ge...
74213512-8667-4f57-a7d0-3b79e2cd3f79
3
public static void closeResultSet(ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException ex) { LOGGER.trace("关闭JDBC ResultSet失败", ex); } catch (Throwable ex) { // We don't trust the JDBC driver: It might throw // RuntimeException or Error. LOGGER.trace("关闭JDBC ResultSet...
a11543d0-0115-47f7-91ae-608eba103aee
7
public static void main(String[] args) throws Exception { String env = null; if (args != null && args.length > 0) { env = args[0]; } if (! "dev".equals(env)) if (! "prod".equals(env)) { System.out.println("Usage: $0 (dev|prod)\n"); ...
0324061e-b623-42cd-a14e-cf711b5a169c
8
public void DBUpdateQuests(List<Quest> quests) { if(quests==null) quests=new Vector<Quest>(); String quType="DefaultQuest"; if(quests.size()>0) quType=CMClass.classID(quests.get(0)); DBConnection D=null; DB.update("DELETE FROM CMQUESTS WHERE CMQUTYPE='"+quType+"'"); CMLib.s_sleep((1000+(quests.size()...
6b9baedc-aa2a-4855-93e5-67664688e431
0
public void destroy() { removeAll(); removeNotify(); node = null; button = null; lineNumber = null; iComment = null; iEditable = null; iMoveable = null; }
a29c0022-ed8c-4798-b155-4d8026535d2a
4
@Override public void actionPerformed(ActionEvent ae) { System.out.print(this); System.out.println(".actionPerformed"); if(ae.getSource() instanceof Formulario){ Formulario form = (Formulario)ae.getSource(); if(form.isResult()){ if(formState =...
6d66944c-6984-4c28-acfe-b6949b91a5f3
0
@Basic @Column(name = "SOL_TERMINAL") public String getSolTerminal() { return solTerminal; }
658f91e5-b322-4137-b952-989935a095fe
6
@Override boolean accepts(A value) { switch (polarity) { case Pos: for (BooleanTerm<A> subExpr : this.subTerms) { if (!subExpr.accepts(value)) { return false; } } return true; case Neg: for (BooleanTerm<A> subExpr : this.subTerms) { if (subExpr.accepts(value)) { return true; ...
5fb75fba-d3c3-40dc-80d1-ce68b26ed093
4
public static void shuffleSubArray(int[] array, int subArrayLength, Random rand) { if (subArrayLength == 0) return; int subArrays = array.length / subArrayLength; for (int subArraysNum = 0; subArraysNum < subArrays; subArraysNum++) { int subArrayEndIndex = (subArraysNum+1)*subArrayLength; int subArray...
5f637940-fa2d-453f-b169-2b320905fe29
0
public static Hand StraightFlush(Rank highCard, Suit suit) { return new Hand(HandRank.StraightFlush, suit, highCard, Rank.Null, Rank.Null, Rank.Null, Rank.Null); }
780a5656-6d3b-467f-a672-c053bb357d8b
1
private static ArrayList<String> cloneArrayList(ArrayList<String> list) { ArrayList<String> result = new ArrayList<String>(); for (String s : list) result.add(s); return result; }
1a4d1846-337f-4258-80b2-5f9dbac00f67
9
public void welcomePage() throws IOException{ //Lecture des shapes if(shapeType.shapeTypes==null) shapeType.readShapes(); if(options==null) options=new Options(); if(dictionary==null) dictionary=new Dictionary(); ...
5da84e33-0d2a-4e8d-921c-382e065f89df
8
private void calcGravAndCollisions() { ArrayList<Body> finished = new ArrayList<Body>(); for(Body a: bodies) { finished.add(a); for(Body b: bodies.subtractCollection(finished)) { if(a.checkCollision(b.getCollisionBox()))//check for collisions among the two { collisionOccurred(a, b); } ...
db9bc831-e7da-487d-8210-215ab5f8a94f
5
public CycList treeConstants() { final CycList constants = new CycList(); final Stack stack = new Stack(); stack.push(this); while (!stack.empty()) { final Object obj = stack.pop(); if (obj instanceof CycConstant) { constants.add(obj); } else if (obj instanceof CycAssertion) { ...
eebd5f58-bfd2-49c3-a5a0-7421ef3d0034
0
public String getName() { return s; }
c0efd066-2199-4fb5-bf52-792dadebd679
2
public double[] columnMaxima(){ double[] maxima = new double[this.numberOfRows]; for(int i=0; i<this.numberOfColumns; i++){ double[] hold = new double[this.numberOfRows]; for(int j=0; j<this.numberOfRows; j++){ hold[i] = this.matrix[j][i]; ...
0fdc56cb-9c4b-4932-8e82-53e596f8ef20
7
static void fillDefiniteValues (Cell[][] board, Cell[][] blocks, int p) { int x = 0; int y = 0; int emptyCellCount = -1; boolean flag = false; do { emptyCellCount = -1; //loop through each cell on the board checking if the cell is empty (has a cell value: 0) for (x = 0; x < 9; x++) { for (y = ...
6e61cd5e-f00c-4ac3-826f-1e7f0b63f6c3
9
public boolean similar(Object other) { try { if (!(other instanceof JSONObject)) { return false; } Set<String> set = this.keySet(); if (!set.equals(((JSONObject)other).keySet())) { return false; } Iterator<St...
103581d2-4d0f-4d4c-8910-5f9cfdacf9d0
9
void render1(short mad, short colix) { if (frame.cellInfos == null) return; UnitCell unitCell = viewer.getCurrentUnitCell(); if (unitCell == null) return; Frame.CellInfo cellInfo = frame.cellInfos[viewer.getDisplayModelIndex()]; Point3f[] vertices = unitCell.getVertices(); Point3f of...
388bb9bb-3ebf-4bc9-8184-8da4623cc42a
0
public String getMACKeyReference() { return macKeyReference; }
135ee5bf-0bd1-4f66-b7ef-b5700f87cc77
5
public int set_halffloat(float fpin, int offset) { // converts float to half precision with proper rounding float absfpin, signfpin; int signbit, n, man,e, halfExponent; //System.out.println("conversion constants " + HALF_MXMAG + " " + HALF_NOMRTRIG + " " + HALF_NORMFACTOR); ...
fb60ff18-1861-4b1d-a111-b3de9997cd4a
1
@Override public int getRowCount() { if (data == null) return 0; else return data.size(); }
cb384e2e-3238-44ca-af32-1cf489f7d686
8
public void moveForward(){ if(direction.equals("n")==true){ this.y -= this.bulletSpeed; if (y < 0) currState = false; } else if(direction.equals("l")==true){ this.x -= this.bulletSpeed; if (x < 0) currState = false; } else if(direction.equals("r")==true){ this.x += this.bulletSpeed; ...
0198b02b-5ace-4dc6-9c6d-157a57cf8da2
9
protected void assign(String line, int idx) { String vals[] = line.split(separator); // Populate values int maxFieldNum = Math.min(vals.length, fieldNames.length); for (int i = 0; i < maxFieldNum; i++) { // If the name of the field is empty => Skip this field if (!fieldNames[i].isEmpty()) { try { ...
db2e2bd0-fc3b-4f73-b7ea-1b70402568fc
2
public Date execute() throws IOException, ParseException{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); boolean gotCorrect = false; while(!gotCorrect){ try{ System.out.println("Introduzca una fecha (dd-mm-yyyy)"); String...
675d2a2a-21b5-42ba-861e-9de4f5935841
9
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (email != null ? !email.equals(user.email) : user.email != null) return false; if (id != null ? !id.equals(user.id) : ...
6e3700c2-9a24-4ff1-9bf8-6a7a1ef6d584
2
private static int getYOnSide(int y, ForgeDirection side) { switch (side) { case UP: return y + 1; case DOWN: return y - 1; default: return y; } }
7c35d9d4-09ee-4a24-ae6c-f86dd2ae2cee
6
private boolean method320(int i, int j, int k) { int l = anIntArrayArrayArray445[i][j][k]; if(l == -anInt448) return false; if(l == anInt448) return true; int i1 = j << 7; int j1 = k << 7; if(method324(i1 + 1, anIntArrayArrayArray440[i][j][k], j1 + 1) && method324((i1 + 128) - 1, anIntArrayArrayArray...
9a49cac2-2aea-45b5-b265-6766b93b7947
9
private Object formatPrimitiveKeys(List<Number> keys, Class<?> componentType, int length) { if (long.class.equals(componentType)) { Long[] array = keys.toArray(new Long[length]); return ArrayHelper.toPrimitive(array); } if (int.class.equals(componentType)) { Integer[] array = keys.toArray(new Integer[len...
99ee86ff-756a-4db1-9f35-8873f0c91411
6
@Override public boolean deleteChild(Expression<?> n) { if (!(n instanceof BinaryArithmeticOperator)) { return false; } if (children.get(0).equals(n))//left { children.set(0, ((Expression<?>) (n.randomChild()))); } else if (children.get(1).equals(n))//...
29a2438a-39e0-43eb-a7ff-69d38657280b
7
@Override public ArrayList<Road> Reroute(ArrayList<Road> roads, ArrayList<RoadLink> roadLinks) { // Create network to reroute in System.out.println("Starting rerouting roads"); System.out.println("- creating network"); createNetwork(roads, roadLinks); System.out.println("- rerouting roads"); // Reroute all...
03cf9f80-3b6d-43a4-bfa3-4fae7dc52d0c
5
public synchronized void squash(int runs) throws IOException, InterruptedException{ threads = Constants.numThreads; for(String s : Constants.files){ gen.generate(Constants.numThreads, runs, s); for(int i = 0; i < threads; i++){ File file = new File(Constants._OUTPUT_PATH + s + "_final.txt"); if(!file....
630cd16e-1ea5-4c40-a809-df68ccc08c70
2
private final static byte[] getAlphabet(int options) { if ((options & URL_SAFE) == URL_SAFE) { return _URL_SAFE_ALPHABET; } else if ((options & ORDERED) == ORDERED) { return _ORDERED_ALPHABET; } else { return _STANDARD_ALPHABET; } } // end getAlphabet
7dbc3e43-b5b7-4de7-914a-6ed28e5a9368
1
@Override public String request() { if(subject == null) { return "Protection Proxy: Authenticate first"; } else { return "Protection Proxy: Call to " + subject.request(); } }//Fin request
461bddf5-eb75-44a9-b2a2-e70d0108066b
2
public int GetTimeLeft() { if (cmeter >= 0) { long now = System.currentTimeMillis(); double m = cmeter / 100.0; if (cticks >= 0) { double ot = cticks * 0.06; double pt = ((double) (now - gettime)) / 1000.0; m *= (ot - pt) / ot; } return (int) Math.round(m * 100); } return 0; }
532dfbe4-6161-4daa-b693-06e11d39b6f4
7
public void create(AccessConfigUser accessConfigUser) { if (accessConfigUser.getAccessEspecialesList() == null) { accessConfigUser.setAccessEspecialesList(new ArrayList<AccessEspeciales>()); } EntityManager em = null; try { em = getEntityManager(); em....