method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
9a9e9396-bb1f-4c18-ba0d-c517b03db05a
4
public int arrowKeyValue() { switch (key) { case Input.KEY_UP: return Entity.UP; case Input.KEY_DOWN: return Entity.DOWN; case Input.KEY_LEFT: return Entity.LEFT; case Input.KEY_RIGHT: return Entity.R...
16f9fbe7-e14c-40b2-b2bf-537c5d144ea4
0
public CircularArrayQueue(int capacity) { elements = new Object[capacity]; count = 0; head = 0; tail = 0; }
bfcaaca3-f2f2-4b8f-ab49-5943545ac648
0
public void setTotalNoOfSeats(int totalNoOfSeats) { this.totalNoOfSeats = totalNoOfSeats; }
ad7186b3-60a5-4a07-a06a-95dc87437364
0
private void startGUI() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { appFrame = new CustomFrame("Drools fusion lighter"); appFrame.init(); } }); }
275f626f-71ee-4412-8171-4485c546a5d1
2
private static String getStringOutputLine(String titel, String referenz, JSONObject obj) throws JSONException, IOException { if (obj.has(referenz)) { if (obj.get(referenz).toString().length() < 35) { return titel + ": " + obj.get(referenz) + "\n"; } else { JSONObject childobj = fetchObject(referenz +...
311f5fc9-9242-4c95-ae52-b14acfa50d50
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...
f9bee759-f7f7-4a22-861d-310d22dbe8fd
4
public static void main(String[] CHEESE) { int[] ans = new int[]{ 1, -1}; for(int den = 1; den < 1000; den++) { int count = -1; ArrayList<Integer> xs = new ArrayList<Integer>(); ArrayList<Integer> top = new ArrayList<Integer>(); int x = 1; while( x != 0 ) { xs.add(x); top.add(x/den); ...
b0cd986e-200e-4e91-8aed-218067ed8e01
2
public String getStringId(){ if (id == 0){ return "Bullet"; }else if (id == 1){ return "Artillery"; }else{ return "Laser"; } }
5acde443-85df-4a12-8ea3-349a5f2b0d98
2
public void display(Integer level) { String space = ""; for (int i = 0; i < level; i++) { space += "-"; } System.out.println(space + name); for (Root branch : branchs) { // 递归调用 branch.display(level + 2); } }
b752b719-a14f-4ae4-9c21-e5454c3e39a4
2
@Override public boolean canOpenSelection() { if (mOpenableProxy != null && !mSelectedRows.isEmpty()) { return mOpenableProxy.canOpenSelection(); } return false; }
199ac9e8-f356-4a3a-b23d-caf76a728bf6
8
public static String simpleReadFile(String filePath){ FileInputStream fis=null; InputStreamReader isr = null; BufferedReader br=null; try{ StringBuilder sb=new StringBuilder(); File file = new File(filePath); fis = new FileInputStream(file); isr= new InputStreamReader(fis); br= new BufferedR...
5f3cb757-e5d5-4a68-8c33-eb1298dc1b9f
2
private void clearEntities() { for (int i = 0; i < entities.size(); i++) { Entity e = entities.get(i); if (e.isRemoved()) { entities.remove(i); } } }
b8b3cbd9-0c30-4798-beff-bc366b6e9e47
9
@Override public Faction getFaction(String factionID) { if(factionID==null) return null; Faction F=factionSet.get(factionID.toUpperCase()); if((F==null)&&(!factionID.toLowerCase().endsWith(".ini"))) { F=getFaction(factionID+".ini"); } if(F!=null) { if(F.isDisabled()) return null; if(!F.a...
7a620710-3574-4101-9e26-f64e64ac5e18
7
private static HashMap<String, String> getKeyValue(HashMap<String, String> map, int pos, String allNameValuePairs, String listDelimiter, String nameValueSeparator) { if (pos >= allNameValuePairs.length()) { // dp("end as "+pos+" >= "+allNameValuePairs.length() ); return map; } int equals...
dd3e10cf-c8e4-4eb6-a017-df967d4c2bfa
2
public ClassAnalyzer getInnerClassAnalyzer(String name) { /** require name != null; **/ int innerCount = inners.length; for (int i = 0; i < innerCount; i++) { if (inners[i].name.equals(name)) return inners[i]; } return null; }
9beb28d9-2c02-48b4-9789-d08828e1f273
1
@Test public void testTimeStep_DAILY() throws Exception { printDebug("----------------------------"); printDebug("DAILY: " + this.toString()); printDebug("----------------------------"); CSTable t = DataIO.table(r, "obs"); Assert.assertNotNull(t); // 1 YEAR D...
3034f0dd-0ea4-4e7e-8920-c4086997073d
9
public void processLoginMessage(OMMMsg respMsg) { // *_log<< "Received login response" << endl; myCallback.notifyStatus("Received login response"); if (respMsg.has(OMMMsg.HAS_ATTRIB_INFO)) { OMMAttribInfo attribInfo = respMsg.getAttribInfo(); if (attribInfo.h...
f36de40d-2ac3-4a16-b93f-fee02d11091a
5
public static void computeOperator(Stack<Float> stack, String operator) { //Be careful with the order you pop things off here. //Choose an order and stick with it. float b = stack.pop(); float a = stack.pop(); float result; //If we had more operators, we wouldn't use cas...
76d1c209-f961-47ea-89e0-4e8ad5f55752
9
public void actionPerformed(ActionEvent e){ String option = e.getActionCommand(); if(option.equals("back")){ PhotoDisplay.this.setVisible(false); PhotoDisplay.this.photosScreen.setVisible(true); } else if(option.equals("move photo")){ Hashtable<String,Album> albumsHT = control.l...
9385cf7b-6f2d-4c6b-a33c-6af67069c0e2
3
public static void unbanPlayer( String sender, String player ) throws SQLException { if ( !PlayerManager.playerExists( player ) ) { PlayerManager.sendMessageToPlayer( sender, Messages.PLAYER_DOES_NOT_EXIST ); return; } if ( !isPlayerBanned( player ) ) { Player...
7e7df36a-c70b-4d76-ae09-6455c4af0321
0
public void setOperator(Operator<Boolean> operator) { this.operator = operator; }
afe8123e-f49d-47d9-b92c-1794c38ed19b
3
public boolean matches(final Context context) { if (this.handler.actions.size() == 1) return true; final int generation = this.getGeneration(); if (context.arguments.size() <= generation) return false; if (context.arguments.get(generation).equalsIgnoreCase(this.name)) return true; ...
65ba137b-c7a5-4818-86c0-ed5621ac433d
5
public void tarjanSCC(int u) { dfs_num[u] = dfs_low[u] = dfsNumberCounter++; s.push(u); visited[u] = true; for (int i = 0; i < ady[u].size(); i++) { int v = ady[u].get(i); if (dfs_num[v] == -1) tarjanSCC(v); if (visited[v]) dfs_low[u] = Math.min(dfs_low[u], dfs_low[v]); } if (dfs...
00d907d9-5861-450b-9945-a32fc1b2dea2
3
public boolean intersects(Rectangle rect) { return !(rect.getLeft() > getRight() || rect.getRight() < getLeft() || rect.getTop() < getBottom() || rect.getBottom() > getTop()); }
2b114cad-f7fa-4402-8672-ebef76452328
5
public void disconnect(Vertex a, Vertex b){ if(isConnected(a,b)){ int edgeWeight = this.weight.get(new Edge(a,b)); if(edgeWeight!=1){ this.withWeight--; } if(edgeWeight<0){ this.withNegativeWeight--; } this.w...
8b74f6b4-ca27-4358-8a84-9537ce4db950
3
public void switch_in(Point p) { if (!outerBorder.remove(p)) { return; } addToInnerBorder(p); for (Point n : n4(p)) { if (tita.getValue(n) == 3) { addToOuterBorder(n); } } }
5e30dd06-f7d6-4da0-98c7-ffd35f7beb01
2
public ResultSet execute(String query) { try { Statement stm = this.con.createStatement(); if(stm.execute(query)){ return stm.getResultSet(); } return null; } catch (SQLException e) { LogHandler.writeStackTrace(log, e, Level.SEVERE); return null; } }
9275098d-f458-419e-9455-4e765ca8b58c
8
private void main_declaration(){ main = true; type_specifier(); // pregunta por el especificador de tipo tokenActual = analizadorLexico.consumirToken(); if(!tokenActual.obtenerLexema().equals("main")){ error(16,tokenActual.obtenerLexema(),tok...
0d5c20ae-0434-41ea-b156-f845852499fc
0
@Test(expected = ParkException.class) public void out_a_car_when_all_park_is_empty() { parkBoy.out(new Ticket()); }
3223a4e5-ccc1-4a30-a4ff-84522017053c
0
public Date getDefaultTime() { return defaultTime; }
85c4dbea-b2b5-45ff-87b1-cf7c4b56a12b
8
public static void dec0_custom_memory() { GAME=0; //i8751_timer=NULL; if (strcmp(Machine.gamedrv.name,"hbarrelw")==0) hbarrel_custom_memory(); if (strcmp(Machine.gamedrv.name,"hbarrel")==0) hbarrelu_custom_memory(); if (strcmp(Machine.gamedrv.name,"baddudes")==0) GAME=2; if (strcmp(Machine.gamedrv.name,"...
f7d2ce52-19f8-4ab3-aaca-c04e96c5b716
5
public void onRender(GameContainer gc, Graphics g, StateBasedGame game){ float mouseX = gc.getInput().getMouseX(); float mouseY = gc.getInput().getMouseY(); if(mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y+height){ highlightFont.drawString(x, y, text, highlightColor); if(gc.getInput().isM...
753663bf-6f62-482d-bb40-158c1140e606
5
public int score(String[] cards) { int c = 0; String a; for(int i = 0; i < cards.length; i++) { a = cards[i].substring(0, 1); if(a.equalsIgnoreCase("A")) c += 11; else if(a.equalsIgnoreCase("K") || a.equalsIgnoreCase("Q") || a.equalsIgnoreCase("T")) c += 10; else c += Inte...
fe3a23d6-93c3-4258-b09c-266e17afb4ae
1
@Test public void getLeegKnooppunt() { Knooppunt knooppunt = null; for (int i = 0; i < 100; i++) { knooppunt = eenSpeelveld1.getLeegKnooppunt(); assertEquals(eenVeldType1[knooppunt.rij][knooppunt.kol], VeldType.LEEG) ; } }
952ab419-fc8f-44c0-bdc2-76dfc948b0f4
3
private JSONWriter end(char m, char c) throws JSONException { if (this.mode != m) { throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray."); } this.pop(m); try { this.writer.write(c); } catch (IOException e) { ...
655c149f-a910-4b8c-8652-ff3e0773b3f1
9
private List<String> ParseMIX(String lines[], int end_idx) { StringBuilder record = new StringBuilder(RECORD_INIT_SIZE); List<String> records = new ArrayList<String>(); for (int i = 0; i < end_idx; i++) { boolean match_first = first_line_pattern_.matcher(lines[i]).matches(); boolean match_last =...
40b13fb1-78fd-4443-a1f8-cf480831c666
2
public Piece getPiece(int index) { if (this.pieces == null) { throw new IllegalStateException("Torrent not initialized yet."); } if (index >= this.pieces.length) { throw new IllegalArgumentException("Invalid piece index!"); } return this.pieces[index]; }
97d3c684-272b-485f-ba58-24653dd73e4a
9
static int multiplications(int target) { LinkedList<ArrayList<Integer>> sets = new LinkedList<ArrayList<Integer>>(); ArrayList<Integer> starterSet = new ArrayList<Integer>(); starterSet.add(1); sets.addFirst(starterSet); int currentRound = 1; while (true) { boolean found = false; int numSets = sets...
f03a03b1-0be5-4127-9d8a-b23ff8ac9d30
4
public static String join(Collection<?> c, String deli) { StringBuilder sb = new StringBuilder(); if (c.size() > 0) { boolean first = true; for (Object o : c) { if (!first) { sb.append(deli); } else { first = false; } sb.append(o.toString()); ...
7586009f-d5d1-4847-a4d1-fa4a53adf9f5
7
public void input() { mouseX = Mouse.getX(); mouseY = Display.getHeight() - Mouse.getY(); mouseLeft = Mouse.isButtonDown(0); mouseRight = Mouse.isButtonDown(1); while(Keyboard.next()){ if(Keyboard.getEventKeyState()){}else{ if (Keyboard.getEventKey() == Keyboard.KEY_S && Keyboard.isKeyDown(Keyboard.KEY...
62dd43ad-4ec5-4556-b025-12f0e84ab2a6
0
private CarJsonConverter() { }
add7a863-907d-48a9-a63f-103ee210bf27
6
public static void main(String[] args) { JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter( "Midi files", "mid"); chooser.setFileFilter(filter); System.out.println("Enter operation (grt/w/b): "); Scanner scanIn = new Scanner(System.in); ...
508a61d4-5a2b-48b2-9e63-26d520c6a5c2
4
protected int match(int c, int pos, CodeIterator iterator, int typedesc, ConstPool cp) throws BadBytecode { if (newIndex == 0) { int nt = cp.addNameAndTypeInfo(cp.addUtf8Info(newMethodname), typedesc); int ci = cp.add...
7dbb5ae4-003b-46dd-9c31-fc4615f8ee82
0
protected void interrupted() { end(); }
5b7b080d-dffb-45d0-96b9-37de30212837
1
public void processEvent(AWTEvent e) { if (e.getID() == Event.WINDOW_DESTROY) { dispose(); } else { super.processEvent(e); } }
6035a32a-1461-4bc1-9336-96c0a2c0ec8d
4
public static boolean renderItemIn3d(int i) { return i == 0 ? true : (i == 13 ? true : (i == 10 ? true : (i == 11 ? true : i == 16))); }
5b008150-c73b-41ca-9685-938c3eaa685b
1
public void create(String query){ try { this.statement.executeQuery(query); } catch (SQLException ex) { Logger.getLogger(DatabaseConnection.class.getName()).log(Level.SEVERE, null, ex); } }
24c69517-e472-4dc2-9998-8044191d2b9c
1
public final void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute("", "min", "min", "", Integer.toString(min)); attrs.addAttribute("", "max", "max", "", Integer.toString(max)); attrs.addAttribute("", ...
664743ee-1226-4b6e-b634-b4359da4ec98
3
@Override public Funcao listById(int id) { Connection conn = null; PreparedStatement pstm = null; ResultSet rs = null; Funcao f = new Funcao(); try { conn = ConnectionFactory.getConnection(); pstm = conn.prepareStatement(LISTBYID); pstm.s...
439cbaa6-7ca4-48bd-a80d-82f9cd80c662
3
@Override protected void initializeCPointer() { assert this.cPointer != 0; assert tracer != null; assert name != null; final int r = ppaml_phase_init(tracer.cPointer, this.cPointer, name); switch (r) { case 0: break; case -1: throw new ...
4a287d9b-9419-4f13-acc9-49fbd9c2db29
8
protected void setInstancesFromDBaseQuery() { try { if (m_InstanceQuery == null) { m_InstanceQuery = new InstanceQuery(); } String dbaseURL = m_InstanceQuery.getDatabaseURL(); String username = m_InstanceQuery.getUsername(); String passwd = m_InstanceQuery.getPassword(); /*dbas...
85dcb865-3726-4616-a3bd-ef241adc1f84
1
public void releaseRemoteLock(String source){ synchronized (this) { if(lockedBy.equalsIgnoreCase(source)){ isLOcked = false; lockedBy = null; } } }
a804e701-c3e1-4863-add3-cfe5f64d7463
4
@Override public State transition(TransitionContext context) { if(context.isLetter() || context.value() == '_' || context.isDigit()) { context.pushChar(); return this; } String word = context.accumulated(); context.emit(context.getKeywords().containsKey(word) ? context.getKeywords().get(word) : ...
b2821fc2-11bf-4fd8-8a4f-86294d5bb229
4
@SuppressWarnings({ "rawtypes", "unchecked" }) public boolean validate(T t) { Class classType = t.getClass(); Class fieldType = isValidField(classType); String accessorMethod = null; Object actualValue = null; Object validatorValue = null; if (fieldType.toString() == Boolean.class.getSimpleName()) { ac...
56820ec4-2fd6-4792-a3ec-2359888a04a7
2
private void displayOneLiner(CommandSender sender, CodCommand meta) { String cmd = getCommand(meta); if (meta.usage().length == 1) { sender.sendMessage(meta.usage()[0].replace("<command>", cmd)); } else { StringBuilder sb = new StringBuilder(); sb.append("§2")...
69932443-9642-46bf-ad9a-38431a5ec620
9
public String receiveMessage() { throw_exception(); if(block_channel==1){ return null; } if(reorder_msg==0){ synchronized(test_network.test_queues[test_index]) { if(lose_msg==1){ while(!test_network.test_queues[test_index].isEmpty()) test_network.test_queues[tes...
a04887a3-528f-47f9-9bef-8581da1657df
7
public void buildClassifier(Instances data) throws Exception { // can classifier handle the data? getCapabilities().testWithFail(data); // remove instances with missing class data = new Instances(data); data.deleteWithMissingClass(); if (!(m_Classifier instanceof weka.classifiers.meta...
941294db-ccab-4bfd-b1ef-af26b91a65b5
1
public void zoomOut(double mouseXCoord, double mouseYCoord) { if (visibleArea.getyLength() + quadTreeToDraw.getQuadTreeLength() / 10 >= quadTreeToDraw.getQuadTreeLength()) { return; } double mouseMapXCoord = convertMouseXToMap(mouseXCoord); double mouseMapYCoord = convertMouseYToMap(mouseYCoord); double...
61475b8c-4b8c-40d4-bb7b-9784facbf649
9
@Override public boolean isEnspelled(Physical F) { for(int a=0;a<F.numEffects();a++) // personal affects { final Ability A=F.fetchEffect(a); if((A!=null)&&(A.canBeUninvoked())&&(!A.isAutoInvoked())&&(!A.isSavable()) &&(((A.classificationCode()&Ability.ALL_ACODES)==Ability.ACODE_SPELL) ||((A.classif...
f5aeb411-581d-467d-9750-7a759e584a6f
1
final void load() throws IOException { if (!isLoaded) { HtmlPage page = loadPage(url); resources = fetchResources(page); articleHtml = fetchArticleHtml(page, resources); articleTitle = fetchArticleTitle(page); isLoaded = true; LOG.info(form...
02a05dbe-3cb8-4cc8-ab41-ee921bc3533f
1
public void showPortrait(boolean s) { if (portraitHUD != null) { portraitHUD.setShouldRender(s); } }
3cf83c4f-357f-4500-ad0e-702fec4f1b28
8
private void filterButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_filterButtonActionPerformed String keyword = searchTextField.getText().toLowerCase(); Date from = (Date) dateFromSpinner.getValue(); Date to = (Date) dateToSpinner.getValue(); if (from.after(to)) { D...
ade5fdc0-25ec-4d23-bd81-253bc2c6cb23
5
public static StompFrame factory(String wholeMessage){ HashMap<String, String> headers= parseHeaders(wholeMessage); if (headers == null) return ErrorFrame.factory(wholeMessage, "cannot read headers"); if (headers.get("accept-version") == null) return ErrorFrame.factory(wholeMessage, "invalid connection: no ...
d8dd88be-7941-4561-a544-b16b660bc229
6
@Override public boolean processObjectClick2(WorldObject object) { int id = object.getId(); if (id == 36579 || id == 36586) { player.getInventory().addItem(new Item(4049, 5)); return false; } else if (id == 36575 || id == 36582) { player.getInventory().addItem(new Item(4053, 5)); return false; } el...
81467a05-9e66-4572-8755-62bb3897f294
5
public double maf() { double maf = -1; // Do we have it annotated as AF or MAF? if (hasField("AF")) maf = getInfoFloat("AF"); else if (hasField("MAF")) maf = getInfoFloat("MAF"); else { // No annotations, we have to calculate int ac = 0, count = 0; for (VcfGenotype gen : this) { count += 2; ...
c5918b51-e10f-4917-8b96-6d3f95318994
1
public boolean register(String userID, String password, String email) { // TODO Auto-generated method stub ClientDB c = new ClientDB(userID, password, email); if(getFact.addUser(c)){ return true; } else return false; }
85f68ffd-fb32-49c6-9d02-5ef5bb58cdf0
8
public final void list_iter() throws RecognitionException { try { // Python.g:419:11: ( list_for | list_if ) int alt120=2; int LA120_0 = input.LA(1); if ( (LA120_0==82) ) { alt120=1; } else if ( (LA120_0==85) ) { alt120=2; } else { if (state.backtracking>0) {state.failed=true; ret...
dec1d121-4b0d-47ff-aa5d-0c9413db2810
5
public void update() { switch(Keyboard.getEventKey()) { case Keyboard.KEY_W: setUp(Keyboard.getEventKeyState()); break; case Keyboard.KEY_A: setLeft(Keyboard.getEventKeyState()); break; case Keyboard.KEY_S: setDown(Keyboard.getEventKeyState()); break; case Keyboard.KEY_D: setRi...
82e474e4-4a75-43d0-ba1f-e9941c73f22c
9
public VariableStack mapStackToLocal(VariableStack stack) { if (type == DOWHILE) { VariableStack afterBody = bodyBlock.mapStackToLocal(stack); if (afterBody != null) mergeContinueStack(afterBody); if (continueStack != null) { VariableStack newStack; int params = cond.getFreeOperandCount(); i...
35b2950e-d01a-4b6b-9b93-ed56e9f9f113
9
private void collectWordInfo(String path, Searcher wid, String prefix, ArrayList<ArrayList<WordInfo>> ws) throws ParseException, IOException { final ReadLine rl = new ReadLine(path, encoding); try { for(String s=rl.read(); s!=null; s=rl.read()) { final boolean iscomma = s.startsWith("\",\","); final int...
e401e5cd-0f35-42c9-ad04-a35c54795f5b
3
public void visitForceChildren(final TreeVisitor visitor) { if (visitor.reverse()) { for (int i = dimensions.length - 1; i >= 0; i--) { dimensions[i].visit(visitor); } } else { for (int i = 0; i < dimensions.length; i++) { dimensions[i].visit(visitor); } } }
700b76b5-f919-43ae-9fe4-4010126d4cf9
0
@Override public void onDisable() { Utils.Info("Version " + this.getDescription().getVersion() + " disabled."); }
09b7a6fe-c866-44a5-b655-03535b78bb6e
0
private void setDecisionQuest(DecisionQuest quest, ArrayList<String> answerList, ArrayList<String> goToList) { quest.setDecisionAnswer(answerList, goToList); }
d8830a27-9064-490c-9743-7f3cc2ef10de
3
private int LoadMapFromFile(String mapFilename) { StringBuffer s = new StringBuffer(); BufferedReader in = null; try { in = new BufferedReader(new FileReader(mapFilename)); String line; while ((line = in.readLine()) != null) { s.append(line); s.append("\n"); } } catch (Exception e) { retu...
0454b1ff-56f4-445a-a34e-ef589bc02efd
2
public int yCoordToRowNumber(int y) { Insets insets = getInsets(); if (y < insets.top) return -1; double rowHeight = (double)(getHeight()-insets.top-insets.bottom) / rows; int row = (int)( (y-insets.top) / rowHeight); if (row >= rows) return rows; else retu...
ca42e00d-a0c6-4a1c-bc0e-0846c5db8050
0
public static void question11() { /* QUESTION PANEL SETUP */ questionLabel.setText("What kind of music do you listen to?"); questionNumberLabel.setText("11"); /* ANSWERS PANEL SETUP */ //resetting radioButton1.setSelected(false); ra...
7373fa20-6787-4955-8c5c-b4069f412747
3
@Override public void run() { addSystemMessage("请选择备付金报表存放的文件夹"); while (true) { // 如果队列里有消息,显示并移除 if (Main1.list.size() > 0) { CheckResultMessage message = Main1.list.remove(0); addMessage(message); } // 需要sleep try { Thread.sleep(50); } catch (InterruptedException e) { // TODO...
533abc82-69ac-4c15-8d3b-728d0ecde057
8
public List<DateWithDayCount> calculateFixingDates(List<DateWithDayCount> adjustedDates, ResetDates resetDates, HolidayCalendarContainer allCalendars) { HolidayCalendarContainer resetCalendars = new HolidayCalendarContainer(allCalendars, resetDates.getResetDatesAdjustments().getBusinessCenters()); RelativeDateO...
27a9ac0e-201f-4fea-bd39-0bbef1fa9053
2
public DefaultComboBoxModel<String> buildSelectCombo() { DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>(); if(!MapPanel.actors.isEmpty()) { for(int x = 0; x<MapPanel.actors.size(); x++) { model.addElement(MapPanel.actors.get(x).getID()); } } return model; }
23fa0f03-7a82-44c8-b095-3af348dfff3f
9
public void commit() throws IOException { //write all uncommited free records Iterator<Long> rowidIter = freeBlocksInTransactionRowid.iterator(); PageCursor curs = new PageCursor(pageman, Magic.FREELOGIDS_PAGE); //iterate over filled pages while (curs.next() != 0) { long freePage = curs.getCurrent(); ...
e6993f0b-04a9-496d-aa2f-65d335f651fe
6
private void useBank() { if (Util.inBank() && !Players.getLocal().isMoving()) { if (Bank.open()) { if (Bank.depositInventory()) { int time = 0; while (Inventory.isFull() && time <= 4000) { time += 50; Time.sleep(50); } } } } }
08d44ba8-09e3-49c4-b0a2-c8c90506306f
6
public void sendZMessages() throws PostServiceNotSetException{ if (this.postservice == null){ throw new PostServiceNotSetException(); } switch (Athena.shuffleMessage){ case 1: Object[] arrayx = this.getVariables().toArray(); arra...
a1ccee03-a6ec-4d82-8330-50c4b2c32718
2
@Override public void init(ServletConfig config) throws ServletException { try { // Create a JNDI Initial context to be able to lookup the DataSource InitialContext ctx = new InitialContext(); // Lookup the DataSource. pool = (DataSource)ctx.lookup("java:comp/env/jdbc/mysql...
fefd72da-5801-4e80-8b02-3ced43dd8a36
0
public void setCuenta(String cuenta) { this.cuenta = cuenta; }
26665bb1-625b-45ca-9661-bfa6c8dfdb26
0
public StringResource(String value) { this.value = value; }
fe434555-9c5f-436a-8c4c-d30dfffc9a77
0
public static void setFrameInfoList(Vector list) { frameInfoList = list; }
6d9cc51a-6c9d-43d1-b56a-dd8c12d26942
0
public String toLowerCase(String input){ return input.toLowerCase(); }
8cd353c0-6187-4f47-8194-c21a175ebbd3
1
public boolean isLambdaTransition(Transition transition) { FSATransition trans = (FSATransition) transition; if (trans.getLabel().equals(LAMBDA)) return true; return false; }
698db84b-744e-42f8-9fb0-04ff094f8224
7
public void run() { int frameCount = 0; while(_soundSupported){ // if(bufferReady) { if(oldWay) { soundInputLine.write(soundBuffer, soundBufferOffset, soundBufferChunkSize); notifyBufferUpdates( soundBufferOffset, soundBufferChunkSize); soundBufferOffset += soundBufferChunkSize;...
b8bd7971-ea50-445a-8458-a67169ce933f
7
private void startClustersMonitor(){ try{ // Create a new selector Selector selector = Selector.open(); // Create a new non-blocking server socket channel ServerSocketChannel serverChannel = ServerSocketChannel.open(); serverChannel.configureBlocking(false); InetSocketAddress isa = new Ine...
b04e1c67-e6db-4948-8470-1199371e9a8e
8
protected void processMinMaxRecordTime(final LineTermInfoHandler termInfo) { if (termInfo == null) { return; } if (termInfo.javaDate == null) { return; } final Calendar cal = GregorianCalendar.getInstance(); cal.setTime(termInfo.javaDate); ...
90bbde2f-8f33-48f2-945d-be468e4dae55
7
public int removeEdge(Integer source, Integer target) { if (!directed) { for (Iterator<AdjacencyListElement> iter = lists[source].iterator(); iter.hasNext();) { AdjacencyListElement e = iter.next(); if (e.target.equals(target)) { iter.remove(); } ...
b5d00b57-30c8-42fd-84b4-1a7afada101a
9
short wrapResponseAPDU(byte[] ssc, APDU aapdu, short plaintextOffset, short plaintextLen, short sw1sw2) { byte[] apdu = aapdu.getBuffer(); short apdu_p = 0; // smallest multiple of 8 strictly larger than plaintextLen short do87DataLen = SmartIDUtil.lengthWithPadding(plaintext...
8d8b2401-6313-4ff9-9d8c-5c0f53997181
6
public static void main(String[] args) { int k = 0; try { k = Integer.parseInt(args[0]); } catch (NumberFormatException e) { System.out.println("Expected an argument with the number of elements to print."); System.out.println("USAGE: Subset k - to print k values from the input."); Sy...
39aa594b-e85d-43d5-8993-b53dacb829c4
1
public void enableAction() {actionEnabled = true; if (hover) showBorder();}
20855337-34a4-4606-a8d1-99083ae2986f
3
public static void saveItemData() { String output ="savedata/"+idString+"_"+area+".itemData"; try { PrintWriter fout=new PrintWriter(new FileWriter(output)); if(VERSION.equals("Peaches")) fout.println("PDAE"+idString); else fout.println("CDAE"+idString); int length=foundItem.length; fou...
4f68a53a-1596-48dd-8bdc-b4287e24f718
4
@SuppressWarnings("resource") public static ZipEntry[] getZipEntriesIn(File zipFile) { final ArrayList<ZipEntry> entries = new ArrayList<ZipEntry>(); if (!zipFile.toString().endsWith(".zip")) throw new IllegalArgumentException("File isn't a Zip! " + zipFile.toString()); try { final ZipFile zip = new ZipF...
3ab6595d-e7af-4277-87fa-e9c30971a2e0
8
private void setPolarProjectionOptions() { JTextField field_real = new JTextField(); double temp_xcenter = xCenter - rotation_center[0]; double temp_ycenter = yCenter - rotation_center[1]; double temp3 = temp_xcenter * rotation_vals[0] - temp_ycenter * rotation_vals[1] + rotation_cente...
4be5ef29-d7af-4966-9f82-c0f517937492
5
protected Floor decodeFloor(VorbisStream vorbis, BitInputStream source) throws VorbisFormatException, IOException { //System.out.println("decodeFloor"); if(!source.getBit()) { //System.out.println("null"); return null; } Floor1 clone=(Floor1)clone(); clone.yList=new int[x...
758fceec-5e47-41b1-a17e-9a82b74a12ef
9
public static String getYoutubeInfo(String s) throws IOException { String info; String title = null; String likes = null; String dislikes = null; String user = null; String veiws = null; @SuppressWarnings("unused") String publishdate; Document doc ...