method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e86fdd8d-8d26-4e9e-886a-2818f1e84b86
7
private Method returnTypeMethod(String name, Class<?> returnType, Class<?>... argTypes) { try { Method method = method(name, argTypes); Ghost<?> ghost = Ghost.me(method.getReturnType()); if (ghost.openEyes().isPrimitive()) { if (Ghost.me(returnType).openEyes().wrapperClass() == ghost.openEyes().wrapperC...
c88b4f52-4024-4384-81b3-331ad7de16f8
0
@Basic @Column(name = "PRP_FORMA_PAGO") public String getPrpFormaPago() { return prpFormaPago; }
c36bee33-ad4d-416f-97a9-f1c3fc1e60e7
4
public void set_side_info(FrameData fd){ for(int ch = 0; ch < channels; ch++) side_info.set_scfsi(fd.si.scfsi[ch], ch); for(int gr = 0; gr < max_gr; gr++) for(int ch = 0; ch < channels; ch++){ Channel gi = fd.si.gr[gr].ch[ch]; if(gi.window_switchi...
9c2ebb4e-ddd0-45e4-b640-70dfd149bd6f
0
public void addContaCorrente(ContaCorrente conta) { //this.aContas.incluir(conta); this.aContas.incluirNoFim(conta); }
a432f12c-e762-4409-b3e8-e469d2855196
9
@Override public void update(Observable o, Object arg) { if (o instanceof MP3Model) { if (arg instanceof List) { List<?> list = (List<?>) arg; if(list.get(0).getClass().equals(TrackBean.class)) { // If the list is full of tracks then we need to update the playlist view.setDisplayedPlaylist(model...
b246ead0-06f6-40ea-acd4-33b0de0edf96
7
public void addModule(String policy,String subjectInput,String resourceInput, String actionInput, String environmentInput) { FilePolicyModule policyModule = new FilePolicyModule(); String policyname=Log4jInit.prefix+"/"+policy; System.out.println(policy); policyModule .addPolicy(policyname); CurrentEnvMo...
69b9ba02-cdaf-4b3c-879f-613601407987
7
private Object findGetMethodInvoke(MBeanAttributeInfo[] attInfos, String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException{ Object value = null; for (MBeanAttributeInfo beanAttributeInfo : attInfos) { if (attribute.equals(beanAtt...
df281b5b-0f16-4faf-b892-a6883bc4bfe1
4
public LinkedList<String> operatePhoenix(String runParse, int extractFlag, File compile) { LinkedList<String> phoenixOutput = new LinkedList<String>(); try { //compile grammar compile(compile); //run parse for file input ProcessBuilder phoenixBuilder = new ProcessBuilder("/bin/tcsh", runParse)...
086f5d17-9ead-4f89-abc3-136c1066fffa
1
@Override public void rotate180(Board board) { int rot = (getRotation()+2) % 4; if (rotateAlgorithm(board, Point.translate(getBase(), BASES[rot]), RELS[rot], getKicks()[(getRotation()+1)%4])) { addRotation(2); } }
7bcc561a-250e-4dff-9f86-8a0d379dd62a
7
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
467beb1e-0897-4a13-a940-053fff3fb68c
2
private static void registrarVinilo() { boolean salir; String nombre, codigo; float precio; Vinilo vinilo; do { try { System.out.print( "Introduce el nombre del Vinilo: "); nombre = scanner.nextLine(); System.out.print( "Introduce el cdigo del Vinilo: "); codigo = scanner.nex...
914f37db-b5cf-4ee3-a014-2f44ff1b35aa
0
static void actionLikeB(B b) { b.action(); }
66e6e27a-6a75-4629-bcdb-b55f8af65d76
9
int checkBlockLine(int par1ArrayOfInteger[], int par2ArrayOfInteger[]) { int ai[] = { 0, 0, 0 }; byte byte0 = 0; int i = 0; for (; byte0 < 3; byte0++) { ai[byte0] = par2ArrayOfInteger[byte0] - par1ArrayOfInteger[byte0]; if...
1caba292-dd38-48bf-b088-d60bd0cff41a
0
public void keyPressed(KeyEvent e) { keys[e.getKeyCode()] = true; game.getCurrentScreen().onKey(e.getKeyCode()); }
e6bdbe92-b91d-436c-babd-635a6efca632
3
@Override public void ParseIn(Connection Main, Server Environment) { Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom); if (Room == null) { return; } if (!Room.CheckRights(Main.Data, true)) { return; } if...
a57ac897-87a9-490e-a734-66e801e6afac
9
public List<Message<?>> purge(MessageSelector selector) { if (selector == null) { return this.clear(); } List<Message<?>> purgedMessages = new ArrayList<Message<?>>(); Object[] array = this.queue.toArray(); for (Object o : array) { Message<?> message = (Message<?>) o; if (!selector.accept(message) &&...
daf4437f-7b3f-475c-9c19-1cde55d1d1db
4
public FieldPainter (int winWidth, int winHeight) { super(); setSize(winWidth, winHeight); fieldWidth = (getWidth() - 200) / cellSize; fieldHeight = (getHeight() - 40) / cellSize; alg = new AStar(fieldWidth, fieldHeight, Integer.valueOf(dTextField.getText())); alg.setDe...
e483faa3-1816-47e6-b708-7639ff05c21a
1
public int getMinimumWidth(TreePanel panel) { int width = TextDrawing.getPreferredSize(getHeaderFont(), getName()).width; if (panel.isUserSortable()) { width += SORTER_WIDTH; } return width; }
9cf77c0a-8a94-4ed4-a1a0-c56fa0848f4a
3
@Override public void putAll(Map<? extends K, ? extends V> m) { for (K k : m.keySet()) { keys.add(k); values.add(m.get(k)); } }
9a65f863-b49f-4699-ad61-9d730220453b
9
public void move(int dir) { direction = dir; setImage(dir); if (dir == def.Frame.UP) { GoingUp = true; GoingDown = false; beStoped(); if (canMoveUp) { dy = -def.Frame.SPEED; } } if (dir == def.Frame.DOWN) { GoingDown = true; GoingUp = false; beStoped(); if (canMoveDown) { d...
0eaca6ba-0cff-4232-9460-17f5851ecf52
6
@BeforeTest @Test(groups = { "MaxHeapIntegers" }) public void testMaxHeapIntPushPop() { Reporter.log("[ ** MaxHeap Integer Push ** ]\n"); testQueueInt = new MaxPriorityQueue<>(new Integer[seed], true); try { Reporter.log("Insertion : \n"); timeKeeper = System.currentTimeMillis(); for (int i = 0; i...
70a7132a-e2d8-446c-86f4-ea908d6ee9ff
0
public Piece getPiece() { return this.placedPiece; }
12967c93-0462-4374-8d17-508c96672948
5
public static Rate getRateByID(int rateID){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } Rate r = null; try { Statement stmnt = conn.c...
f79ddfdb-47b0-4f2b-8e9e-ba2680925a46
0
User(String prefix, String nick) { _prefix = prefix; _nick = nick; _lowerNick = nick.toLowerCase(); }
a6fafb8b-6caf-41cb-8a2d-ef2a21134828
1
public LimitedSkiPass(int id, String type, Date activationDate, Date expirationDate, int numPassages) { super(id, type, activationDate, expirationDate); if (numPassages <= 0) { throw new IllegalArgumentException( "Non-positive number of passages is not allowed...
ae2f8283-5b5a-4e15-acc6-05ce5faab8e1
5
public synchronized String getRawData() throws IOException { byte[] input; //temporary holder if (m_connected) { m_os.write('G'); //request Data System.out.println("Requested Data"); if (m_is.available() <= bufferSize) { input = new byte[m_is.availab...
ea17d269-fd70-4370-a067-5e2747f0bb36
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...
26eaa6d2-120a-4ea8-91e8-24b08b382e94
8
public void setProporties(int type) { this.type = type; switch(type) { case PLAYER: health = 100; damage = -1; points = -1; hitLevel = 2; break; case INVADER1: health = 100; damage = -1; points = 10; hitLevel = 1; break; case INVADER2: health = 100; damage = -1; ...
15ef17bd-50cd-4ddd-a1f4-a5d862568af9
9
public Integer getByeWeekValue(Schedule evolvable) { Integer value = 0; List<Week> weeks = evolvable.getWeeks(); for(int i = 0; i < weeks.size(); i++) { Week w = weeks.get(i); if(i >= 4 && i <= 11) { int byeCount = 0; for(int j = 0; j < Week.DAYS_PER_WEEK; j++) { Day day = w.getDay(j); ...
09440afb-aacb-43d8-97af-5fabee262847
0
public String getRoadHaul() { return roadHaul; }
5a3029e0-ff9c-4f88-959e-7c81f0fe2d7d
4
public void setBoardValue(int i,int j,int token) { if(i < 0 || i >= 3) return; if(j < 0 || j >= 3) return; board[i][j] = token; }
96d7123b-215a-4891-96b8-d5884e3a0f45
0
public static void changeSelectionToNode(JoeTree tree, OutlineLayoutManager layout) { Node selectedNode = tree.getYoungestInSelection(); // Update Selection tree.clearSelection(); tree.addNodeToSelection(selectedNode); // Record State tree.setEditingNode(selectedNode); tree.setCursorPosition(0); tre...
66322b91-6d35-48cd-8235-d9495b1c53b9
3
@Override public Cliente salvar(Cliente entidade) throws ValidacaoException { if (entidade == null) throw new IllegalArgumentException("'entidade' não pode ser nula"); if (!cnpjEstaValido(entidade.getCNPJ())) throw new ValidacaoException( String.format("C...
148d6218-9953-40e8-9d8e-5c09de1a8cc5
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...
cad6bb33-b55f-478a-be69-7693ecc19ffa
0
public synchronized int getInt(ConfigValues path) { return this.yaml.getInt(path.getPath()); }
99870523-da04-4939-97d1-3dfc500d9ba7
1
public boolean contains(E e) { if (search(e) != null) { return true; } return false; }
3f312222-e747-4cf5-a497-974473357d75
8
protected int[] filterPixels( int width, int height, int[] inPixels, Rectangle transformedSpace ) { int index = 0; int[] outPixels = new int[width * height]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int pixel = 0xffffffff; for (int dy = -1; dy <= 1; dy++) { int iy = y+...
85c2b405-2d4d-4500-b8f8-5f9bcd6895dc
1
void move(int delta) { try { DateFormat df = new SimpleDateFormat("yyyy/MM"); Date d = df.parse(currentMonth); Calendar calendar = Calendar.getInstance(); calendar.setTime(d); calendar.add(Calendar.MONTH, delta); DateFormat df2 = new Simpl...
9adbf883-e940-4664-9629-279403845e8f
7
private void createNetwork(ArrayList<Road> roads, ArrayList<RoadLink> roadLinks){ // initialization int totalRoads = roads.size(); network = new int[totalRoads*2][totalRoads*2][NUMBER_OF_ARC_ATTRIBUTES]; // set up road to node relation - needed for adding road links HashMap<Integer, Integer> roadIdToNode = ne...
db161014-9869-4986-adb7-3aff09e95ad5
3
public String solve(){ if(status != NOT_SOLVED){ return status; } double p0 = initAprox; double p = p0; for(int i = 0; i < MAX_ITER; i++){ p = p0 - (f.at(p0) / fp.at(p0)); if( Math.abs(p - p0) < TOLERANCE){ // we're done solution = p; iterations = i; solutionEval = f.at(p); status = ...
2fe94d02-66da-45d9-ae19-07f790738a06
9
private void addCardImageToLabel(int position, boolean naMao, Carta carta) { String caminhoCarta = null; if(carta.isVirada()){ caminhoCarta = "resources/images/" + carta.getNumero() + carta.getNaipe() + ".png"; } if(carta.isFechada()){ caminhoCarta = "resources/i...
fb83b568-7d78-496d-9314-13a78400f46f
4
public int compareTo(Instruction instr) { if (addr != instr.addr) return addr - instr.addr; if (this == instr) return 0; do { instr = instr.nextByAddr; if (instr.addr > addr) return -1; } while (instr != this); return 1; }
83c4245f-98b2-4eb8-a132-272d676d01fd
8
public String translate(final String text) { final StringBuffer rv = new StringBuffer(); Element temp = null; char current; boolean match = false; for (int x = 0; x < text.length(); x++) { current = text.charAt(x); temp = pattern; match = false; while(temp != null) { if (isMatch(curren...
bcb0f401-6375-4d22-8d46-ea30465dddaf
3
public void initTermList(ResultSet rs) { try { while (rs.next()) { String term = rs.getString("term"); if (!termList.contains(term)) { termList.add(term); } } } catch (SQLException e) { e.printStackTrace(); } }
c99d23d5-9d32-4d0c-90a4-5fb0b6e8d6a1
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ThreeDimCoordinate other = (ThreeDimCoordinate) obj; if (x != other.x) return false; if (y != other.y) return false; if (z != other.z) ...
62030910-902f-46df-b42c-058f6630e8f5
6
public static void main(String[] varArgs) { int rows; String option; Pset2Mario m = new Pset2Mario(); do { Console c = System.console(); out.print("How many rows high would you like the pyramid to be? (The number must be between 0 and 23, inclusive.) "); ...
73ce6555-fecd-448c-a6fa-1d9c83db9be6
3
public static void main(String[] args) { Scanner s = new Scanner(System.in); String shortStr, longStr; int count = 0; int seriesCount = 0; System.out.print("Please enter a short string: "); shortStr = s.nextLine(); System.out.print("Now please en...
d26d2513-811a-4d26-96c8-a831cc323795
0
@Override public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getPath().getLastPathComponent(); String key = (String) node.getUserObject(); JScrollPane jsp = (JScrollPane) panelJspMap.get(key); jsp.getVerticalScrollBar().setValue(0); // Scrolls the right pa...
2ffbff0d-16f2-460e-ab96-96b70a83b4c4
8
@Override public void actionPerformed(ActionEvent e) { Reference.lastActionMinute = new DateTime().getMinuteOfDay(); if (e.getSource() == overviewButton) { Reference.overPanel = new OverPanel(); ...
48897302-7bbf-468b-a7f0-9182008cc3d0
7
protected void updateText( final BaseUI UI, Text headerText, Text detailText ) { detailText.setText("") ; headerText.setText("") ; final String name = category.name ;//.toUpperCase() ; headerText.setText(name+" structures:") ; for (final InstallType type : category.types) { final Composi...
577af883-f668-4640-8c37-11249aab0a45
6
public static double wordDifference(Map<String, Integer> t1, Map<String, Integer> t2) { // construct total word counts int totes1 = 0; int totes2 = 0; for (String s : t1.keySet()) { totes1 += t1.get(s); } for (String s : t2.keySet()) { totes2 += t2.get(s); } // construct return value for first aut...
07680f5c-23b3-47dd-91ce-1e468781a1ee
8
public static String getTypeName(Type type) { if (type == null) return "null"; if (! (type instanceof Class<?>)) return type.toString(); Class<?> cls = (Class<?>) type; if (cls.isArray()) { // ??? in Field.getTypeName, this block was wrapped with a try block // which allo...
cf7e730f-bcd1-41e9-bad0-2a686060a23d
0
public String getSavePath() { return savePath; }
5cd379d8-64c1-490c-b1de-45161a4ebca2
1
* @param beep true if the clock should beep */ public void start(int interval, final boolean beep) { ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent event) { Date now = new Date(); System.out.println(...
f3a5f127-6b41-4c8c-90da-8f667055963d
5
public Writer openSource( JPackage pkg, String fileName ) throws IOException { final OutputStreamWriter bw = encoding != null ? new OutputStreamWriter(openBinary(pkg,fileName), encoding) : new OutputStreamWriter(openBinary(pkg,fileName)); // create writer try { ...
aebb349f-e905-48e0-b897-a469505d5849
2
public void actionPerformed(ActionEvent e) { if (automaton.getInitialState() == null) { JOptionPane.showMessageDialog(Universe .frameForEnvironment(environment), "The automaton should have " + "an initial state."); return; } AutomatonChecker ac = new AutomatonChecker(); if (ac.isNFA(automaton)) ...
be2efafa-d558-4070-8861-ba045bf9f196
1
boolean inSubroutine(final long id) { if ((status & Label.VISITED) != 0) { return (srcAndRefPositions[(int) (id >>> 32)] & (int) id) != 0; } return false; }
e11b4f79-765c-40fa-80bc-5e4c52b395c8
5
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String activateString = request.getParameter("activate"); if (activateString != null && !activateString.trim().isEmpty()) { Boolean activate = Boolean.valueOf(activateString); if (acti...
ffed5757-46bc-45dc-9bfe-a9b3ee75aebf
2
public boolean increment(T myKey,double increment) { boolean newObject=false; Double myValue=get(myKey); if (myValue==0) { myValue=new Double(increment); if (increment>0) { newObject=true; } } else { myValue=new Double(myValue.doubleValue()+increment); } put(myKey,myValue); return ne...
e5117b9a-2633-45aa-ae5e-9b4de6558faf
3
private Mnemonic getMnemData(String assemblyLine) throws AssemblerException { String[] assemblyLineSplit = assemblyLine.split("\\s+"); ArrayList<String> assemblyTermList = new ArrayList<String>(); for (String assemblyTerm : assemblyLineSplit) { assemblyTerm = assemblyTerm.replaceAll("^,+", ""); assemblyT...
741153a3-63b7-4142-acd0-0bf5a644157d
3
@Override public int getChildCount ( Object parent ) { Value<?> vprt = ( (BencodeTreeNode) parent ).getValue(); if ( vprt instanceof ListValue ) { return ( (ListValue) vprt ).getSize(); } else if ( vprt instanceof DictionaryValue ) { return ( (DictionaryValue) vprt ).getSize(); } else { return...
83b03265-58e2-4b25-a030-6828c36ba27f
5
private boolean camposCompletos (){ if((combo_tipo.getSelectedIndex()>=0)&& (fecha.isFechaValida(field_desdee.getText()))&& (fecha.isFechaValida(field_hasta.getText()))&& (!field_tasa.getText().equals(""))&& (!field_sobretasa.getText().equals("")) ){ ...
15131437-43b8-4f1f-a0ea-f6e6bc381a05
4
public static int reverse(int x) { int sign = x < 0 ? -1 : 1; int raw = x < 0 ? -1 * x : x; long res = 0; do { res = res * 10L + raw % 10L; raw = raw / 10; } while (raw != 0); if (res > Integer.MAX_VALUE) return 0; else return (int) (sign * res); }
987955b4-a1a6-40ca-98d5-5f04ea803d40
1
@Before public void setUp() { try { tiedosto = new File("JapanimaatinTiedostot/testi.txt"); PrintWriter kirjoitin = new PrintWriter(tiedosto); kirjoitin.print(""); //tyhjennetään tiedosto edellisten testien tms jäljiltä kirjoitin.close(); lukija = ...
72aea229-a4a8-45b8-9a90-21f4f0e1ccdd
7
public static void setAssets(String serverID, String assetID) { List baskets = Basket.getBasketList(serverID, null); if (baskets != null && baskets.size() > 0 && !"Popup Dialog".equalsIgnoreCase(((String[]) baskets.get(0))[0])) { ((BasketTableModel) jTable19.getModel()).setValue(baskets); ...
94b94eee-382a-498b-8936-e152207d8071
2
public void setPosition(float[] position) { if (Float.isNaN(position[0]) || Float.isNaN(position[1])) { throw new RuntimeException("Position is NaN"); } this.position = position; }
707a75cf-8114-4640-be7e-18d013b6533c
0
@Test public void testFindByPrimaryKey() { fail("Not yet implemented"); }
ec6382be-03da-478b-8039-1c13cb64622c
3
private void validateEvaluateStack(){ if(isStackEmpty()) throw new EmptyStackEvaluationException(); if( !( operandStack.size() == operatorStack.size()+1 && operandStack.size() > 1) ) throw new IllegalNumberOfOperandsException(); }
fcfe6223-8a60-400d-bebd-050e8fd73d2f
7
public double[][] rankedAttributes () throws Exception { int i, j; if (m_attributeList == null || m_attributeMerit == null) { throw new Exception("Search must be performed before a ranked " + "attribute list can be obtained"); } int[] ranked = Utils.sort(m_attrib...
b6269c9d-34e4-486e-a6da-bba23f389bc7
5
public boolean searchMatrix(int[][] matrix, int target) { // IMPORTANT: Please reset any member data you declared, as // the same Solution instance will be reused for each test case. if (matrix == null || matrix.length == 0) return false; int m = matrix.length; int n = matrix[0].length; int s = 0; int ...
9e9d904e-7b24-4837-bc22-e474cdd84632
1
protected CycFormulaSentence loadKBQSentence(CycAccess access, CycDenotationalTerm kbq) throws CycApiException, IOException { try { final String command = SubLAPIHelper.makeSubLStmt(KBQ_SENTENCE, kbq); return access.converseSentence(command); } catch (CycApiException xcpt) { throw ne...
9738e799-c1a0-456c-becf-8b12b8f34d03
5
private Tree conditionalExpressionPro(){ Tree conditionalExpression = null, truePart = null, falsePart = null; if((conditionalExpression = orExpressionPro()) != null){ if((accept(Symbol.Id.PUNCTUATORS,"\\?")) != null){ if((truePart = expressionPro()) != null){ if((accept(Symbol.Id.PUNCTUATORS,":")) !...
0b980316-9b35-4b3f-a20a-accdaf7ef28d
5
public void writeTypes(Vector vector) { // A big ol' case statement in a for loop -- what's polymorphism mean, again? // I really wish I could extend the base classes! Enumeration enm = vector.elements(); Object nextObject; while (enm.hasMoreElements()) { nextObject = enm.nextElement(); if (null == nex...
fdc6a3eb-a901-41b3-87e6-663956c1417e
6
public static void main(String[] args) { try { List<String> warnings = new ArrayList<String>(); boolean overwrite = true; File configFile = new File(ClassLoader.getSystemResource(runXMLAUTHORITY).getFile()); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConf...
d7ca1343-1b13-40b6-aed5-24ba5d46a606
8
protected static boolean chantAlignmentCheck(StdAbility A, MOB mob, boolean renderedMundane, boolean auto) { if((!auto) &&(!mob.isMonster()) &&(!A.disregardsArmorCheck(mob)) &&(mob.isMine(A)) &&(!renderedMundane) &&(CMLib.dice().rollPercentage()<50)) { if(!A.appropriateToMyFactions(mob)) { mob....
69de9741-34d7-4186-8528-e451d488764c
1
public String toString() { String s = ""; for (int amount = totalAmount; amount > 0; amount -= coin[amount]) s += coin[amount] + " "; return s; }
6d664159-fddc-4469-b83e-edfb4041fba5
4
public CreditCard() { setTitle("Credit Card Application"); JButton_PerAC.setText("Add Credit-card account"); JButton_Withdraw.setText("Charge"); JButton_CompAC.setText("Generate Monthly bills"); //remove all listener that we have first for (ActionListener al : JButton_P...
b32e886b-fc0c-401f-baa0-a2ce2aaeed55
3
@Override public void sort(T[] comparables) { for (int i = 0; i < comparables.length; i++) { for (int j = i + 1; j < comparables.length; j++) { if (comparables[i].compareTo(comparables[j]) > 0) { swat(comparables, i, j); } } ...
119d8e2e-bcca-4bf5-9f08-58ca0f2d8017
5
@Override public DataTable generateDataTable (Query query, HttpServletRequest request) throws DataSourceException { DataTable dataTable = null; try (final Reader reader = new FilterCsv (new BufferedReader (new InputStreamReader (new URL (this.urlYahoo).openStream())))) { TableRow row = new TableRow (); ...
7dd538f9-d19d-4b93-9b0d-ef21ae36c0d4
9
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the...
3b6d4dd9-bdd5-4300-a8f1-6dcbe806f0fb
9
@SuppressWarnings("empty-statement") private static <T extends Comparable<? super T>> void quickSort(T[] a, int low, int high) { if (low + CUTOFF >= high) { insertionSort(a, low, high); } else { int middle = (low + high) / 2; // Sort low, middle, high ...
0e04c5ff-0c71-4b92-897d-2f12406b0358
5
public void setPitch( float pitch ) { if ( pitch < 0 ) { pitch += 360f; // unnegativize(TM) the number } pitch %= 360; // get the number within 0-359 // the pitch is out of range if ( ( pitch > minPitch ) && ( pitch < maxPitch ) ) { /...
753b50e5-3e22-4627-bdbb-22a3a380469b
8
private static boolean checkEdges(ConnectedGraph G1, ConnectedGraph G2, Map map, int n) { // Check edges in the forward direction. for (int i = 0; i < n; i++) { int key = map.getKey(i); int value = map.getValue(i); if (G1.V[key].children.length != G2.V[value].children.length) { System.out.println("...
6745a841-c6cb-4745-b9c1-80a1d70c421b
5
public void writeWritingAccesses() { String path = output.toString() + "/" + measurementName + "_writingAccesses.txt"; writingAccesses = new File(path); if (writingAccesses.exists()) { try { fr = new FileReader(path); br = new BufferedReader(fr); StringBuffer buffer = new StringBuffer(...
86322bc9-521c-4e19-8fc6-47bbff4021e7
7
private final boolean cons(int i) { switch (b[i]) { case 'a': case 'e': case 'i': case 'o': case 'u': return false; case 'y': return (i==0) ? true : !cons(i-1); default: return true; } }
d7c212dc-52d0-43bd-81ae-0b4fb2f0edad
4
protected void fileScan(File f) throws FileNotFoundException{ //Do not consider the size of pkgs String key=null; boolean chunkEncoding=false; boolean emptyPkg=false; InfoItemSlot item = new InfoItemSlot(null,0,1); // System.out.println("File name: "+f.getName()); FileInputStream fin = new FileInputStre...
4a991ccb-e489-4cba-a352-83846d7b9e56
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Passage other = (Passage) obj; if (role == null) { if (other.role != null) return false; } else if (!role.equals(other.role)) return ...
f005a89e-6d36-4c8e-ba3c-667023e96527
4
String ToStringOnlyBorderInformation(int mark) { String retVal = ""; if (!comparisonResult.numberGenesOnBorderIntervalAllSide.isEmpty()) { for (String gene : comparisonResult.numberGenesOnBorderIntervalAllSide.keySet()) { if (comparisonResult.numberGenesOnBorderIntervalAllSid...
5e6725c8-e4b7-4c16-932b-39f822017f46
2
@Override public void load(FileInputStream in) throws IOException{ int c = in.read(); if (c != -1){ for (int i = 0; i < contains.length; i++){ setItemInSlot(i, new Item(in.read())); } } }
a298b329-b502-4358-8e14-9e1c2acbefd1
7
*@param nivel * @return descuento **/ public long devolverPorcentaje(long valor, int nivel){ long descuento = 0; if(nivel == 1){ descuento = (valor * 2)/100; }else if(nivel == 2){ descuento = (valor * 25)/100; }else if(nivel == 3){ descuento = (valor * 6)/100; }else if(nivel >= 4 && nivel <= 5){...
16413b4b-b84c-4eff-ab1b-2e7c792e18e7
3
public void trajectory(int time){ int activity; for(int i=0; i<time; i++){ for(int j=0;j<numNodes;j++){ System.out.printf(""+(nodes.get(j).getState()? " ":"█") ); } activity = 0; activity = update(activity); System.out.printf("\t%d\t%d\n", activity, state); } }
7b10cf25-f8ef-4f31-9f98-35628597574f
5
@Override public String getColumnName(int column){ String name = "??"; switch (column){ case 0: name ="RaavareId"; break; case 1: name ="Raavare Navn"; break; case 2: name ="LeverandoerId"; break; case 3: name ="Raavare Kost Pris"; break; case 4: name ="Raavare V...
a77e31e5-5cca-41b1-bd5a-b09b8adca8b7
4
@Override public void tileFocusChangedAt(Position p) { // check if a tile was clicked Unit u = game.getUnitAt(p); City c = game.getCityAt(p); if (c != null) { CleanCityUI(); ImageFigure productionFig = new ImageFigure(c.getWorkforceFocus(), new Point(GfxConstants.WORKFORCEFOCUS_X, GfxConst...
33bb840e-dd82-4f94-a264-dfa1b515e22b
1
public void removeMouseMotionListener(MouseMotionListener l) { if(l == null) { return; } this.mouseMotionListener = null; }
a3df2e70-de91-4e67-882e-784803a40a57
2
@Override public void onEnable() { plugin = this; cmdManager = new CommandManager(this); listenerManager = new ListenerManager(this); loadKits = new LoadKits(this); configFile = new File(getDataFolder().getAbsolutePath()+"/config.yml"); voteKits = new File(getDataFolder().getAbsolutePath()+"/kits.yml")...
6b5aeaf0-0cf7-4b1c-b5e7-329355280fbf
0
public void start_logging() { synchronized(logging_enabled) { logging_enabled = true; } }
9cac1b9a-3430-46b0-a9b3-a4585cd58580
4
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed int lastItem = jComboBox1.getItemCount()-1; if(loaded && jComboBox1.getSelectedIndex()==lastItem) { String input = JOptionPane.showInputDialog("Enter the application's ID:"); ...
74bb4863-970f-47f6-a9d3-17d2bce758c6
9
private void updateRanking(int clan) throws SQLException { StringBuilder sb = new StringBuilder(); sb.append("SELECT c.id, "); sb.append(clan != -1 ? "c.jobRank, c.jobRankMove" : "c.rank, c.rankMove"); sb.append(", a.lastlogin AS lastlogin, a.loggedin FROM characters AS c LEFT JOIN accou...
90727150-158f-434c-822e-944e364ca7f5
3
@Override public void onSpawnTick(SinglePlayerGame game) { Set<Location> entityLocations = game.getEntityLocations(this); for (Location loc : entityLocations) { Set<Location> emptyLocations = game.getEmptyLocations(loc.x, loc.y, 1); for (Location empty : emptyLocations) { ...
c609b5be-516b-4bdf-8f2e-2e2c9abda9ac
3
public static List<Car> loadData(String datafile) throws NumberFormatException, IOException { List<Car> cars = new LinkedList<Car>(); int nextuid = 0; //open file from jar BufferedReader in = new BufferedReader(new InputStreamReader(RentalStore.class.getClassLoader(...