method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
616d8f50-d33e-4b97-92c8-bde58d597773
5
public void play(){ try{ pause = false; stop = false; int bytesPerFrame = audioInput.getFormat().getFrameSize(); int numBytes = 256 * bytesPerFrame; byte[] tableau = new byte[numBytes]; AudioFormat audioFormat = audioInput.getFormat(); DataLine.Info Info = new DataLine.Info(SourceDataLine.class...
15738586-6b8b-48e4-933a-e9cb5b809cca
0
protected JPanel initInputPanel() { JPanel bigger = new JPanel(new BorderLayout()); JPanel panel = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); panel.setLayout(gridbag); c.fill = GridBagConstraints.BOTH; c.weightx = 0.0; panel.add(new JLab...
34f80930-1b54-47da-ba20-caf9e3afa663
1
public boolean Close() { try{ out.close(); return true; }catch(Exception e){} return false; }
663afa6a-fea5-469b-8d30-21015a703d15
2
public static ArrayList getPlayerList() { ArrayList names = new ArrayList(); for (int i = 0; i < players.size(); i++) { Player p = players.get(i); if (p != null) { names.add(p.getName()); } else { names.add(""); } }...
9b6d540f-56fa-4e30-8936-b84ba053ec85
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TabelOutletType other = (TabelOutletType) obj; if (!Objects.equals(this.kodeType, other.kodeType)) { ...
2a8eade3-4ce8-45ab-839b-0f2b61c0b861
8
private StateSequence<Double> createScaledBackward() { ArrayList<Double> scales = new ArrayList<Double>(); StateSequence<Double> stateProbs = new StateSequence<Double>(hmm.getStates()); for (String state : hmm.getStates()) { for (int i = 0; i < hmm.getEmissionSequence().size(); i++) { stateProbs.add(stat...
ccab287e-b244-4ae2-9a79-b0baab7e4f58
8
private boolean csCompleteWork(Random random, ChangeSet cs) { setWorkLeft(-1); if (getLocation() instanceof HighSeas) { ServerPlayer owner = (ServerPlayer)getOwner(); Europe europe = owner.getEurope(); Map map = getGame().getMap(); Location dst = getDesti...
7357f623-fca1-4176-9efc-d277073680e3
8
static private boolean jj_3R_8() { Token xsp; while (true) { xsp = jj_scanpos; if (jj_3R_19()) { jj_scanpos = xsp; break; } } if (jj_3R_20()) return true; if (jj_scan_token(ID)) return true; if (jj_scan_token(LP)) return true; if (jj_3R_21()) return true; if (jj_scan_token(RP...
4b42089a-857f-4aea-9244-dde9c34a1a83
1
public Type getSubType() { if (elementType instanceof IntegerType) return this; else return tArray(elementType.getSubType()); }
d298c90d-5bb6-46e1-99ca-100d5cef1ee1
4
private static Set findInitial(Automaton a) { Set initialized = new HashSet(); initialized.add(a.getInitialState()); boolean added = true; Transition[] t = a.getTransitions(); while (added) { added = false; for (int i = 0; i < t.length; i++) if (initialized.contains(t[i].getFromState())) added ...
de2c3729-85c5-44ac-84f5-ae02aa957f06
7
public void alimenterContainerCENTER(){ SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); RechercheReservation metierPlanning = new RechercheReservation(); JLabel horaire; int horaireCourant=9; int etatCourant=0; if(jdDateChooser.getDate()==null){ JOptionPane.showMessageDialog(this, "Date ...
9b5aa571-6ee4-441f-a6d4-877145681d9d
0
private void setMass(double[] m) { this.mass = m.clone(); }
288da437-fb2c-4492-824a-356a659e79f2
4
public Map<String, Double> findTermFrequency(ArrayList<String> tokens){ Map<String, Integer> map = new HashMap<String, Integer>(); String[] StopWords = DEFAULT_STOPWORDS.split(" "); ArrayList<String> stopArrayList = new ArrayList<String>(Arrays.asList(StopWords)); for(String word: tokens){ int i=0; if(!...
9a5385aa-9747-47c8-b4e0-372c8b22c222
5
private static double[] getResistPoints(int curvePoints,int lineNumber, double[] highPrices) { double[] rPoints = new double[lineNumber]; for(int i =0;i<lineNumber-1;i++){ double price = 0; for(int j=-curvePoints;j<=0;j++){ if((i+j>=0) && (i+j<lineNumber-1) && hig...
bd2d2e78-e26b-4973-ac6c-094557690687
5
public void showRecentWinners(CommandSender sender, int pageNumber){ reloadConfig(); List<String> raw = getConfig().getStringList("winners"); if(raw == null || raw.size() <= 0){ sender.sendMessage(prefix() + ChatColor.AQUA + "No one has recently won! Be the first, buy a ticket with /lottery buy"); }else{ ...
ff42b8ca-2e94-4f78-a688-a32e84ad5f5f
0
public void addCompleteListener(ActionListener listener){ completeListeners.add(listener); }
99a9bc29-50fd-43ba-b705-5bd6e4e4b8d1
8
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DefaultFunctionExecutorContext<?> other = (DefaultFuncti...
27aa0d0e-4009-42f8-9502-a29e72979b37
9
private static boolean votingPhase(Registry registry, LogItem logItem) { boolean success = true; try { boolean failedServer = false; ICoreServer primary = null; for (String serverName : registry.list()) { //For every server, check it is alright to commit, and pass it the log try { I...
ca0f4719-4e64-4eb2-b292-5c0d39349bbb
4
@Override public void mouseDragged(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled()) { Iterator<mxCellHandler> it = handlers.values().iterator(); while (it.hasNext() && !e.isConsumed()) { it.next().mouseDragged(e); } } }
9cae48c5-a2c0-44e9-a122-59499e013b9c
2
public void addUserPoint(int points) { if(points<0 && -points>this.user_point) points = -this.user_point; this.user_point += points; }
306c9ce0-ed8d-42c2-b055-579f5fa739e7
8
private Pair<EdgeType, VertexType> getNewEdgeForSpanningTree(Vector<VertexType> vertices, Vector<EdgeType> edges) { ArrayList<EdgeType> tempEdgeArray = new ArrayList<EdgeType>(); try { while (true) { EdgeType edge = pq.poll(); if (edge == null) ...
566802f9-9c7d-4ac0-a19a-5b25967a2125
9
private double getSpecialAccuracyModifier(Player player) { Item weapon = player.getEquipment().getItem(Equipment.SLOT_WEAPON); if (weapon == null) return 1; String name = weapon.getDefinitions().getName().toLowerCase(); if (name.contains("whip") || name.contains("dragon longsword") || name.contains("drag...
319d139b-d94b-40c8-b5c6-74e3c4178301
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 Businessvendor)) { return false; } Businessvendor other = (Businessvendor) object; if ((this.businessVendorID =...
7514dcfc-ef6f-45b7-8673-ee7dc00da4ef
3
static void getDifficulty() { String m = r.Difficulty; if (m.equalsIgnoreCase("Hard")) { diff = hard; } else if (m.equalsIgnoreCase("Normal")) { diff = normal; } else if (m.equalsIgnoreCase("Easy")) { diff =...
331798fb-4958-448f-b07e-c33c806a29af
1
private void parseForeignKeys( Token token ) { String thisTable = table.getDomName(); String thisField = token.getValue(); if ( !getNextToken().getValue().equals( "constrainsTo" ) ) throwException( "Expecting keywords 'constrainsTo" ); String other[] = getNextToken().getValu...
5c9399ce-da96-4392-aa32-5073dabdb886
5
@Test public void TestaaOikealtaVasemmalleEste() { rakentaja = new Kartanrakentaja(10, 6); rakentaja.asetaEste(5, 3); rakentaja.asetaEste(4, 3); rakentaja.asetaEste(6, 3); char[][] kartta = rakentaja.getKartta(); Solmu aloitus = new Solmu(5, 5); Solmu maali = ...
df9735d0-be60-434a-9ecc-614f00fa4875
6
protected void addSpinnerListeners(){ final JFormattedTextField textField = getTextField( spinner ); final int minValue = this.min; final int maxValue = this.max; textField.addKeyListener( new KeyAdapter() { @Override public void keyReleased( final KeyEvent e ) { ...
f9bee1c7-0c72-4a5b-a3c3-31721105a6f7
4
public ArrayList<Integer> findLegalMoves(int startIndex, int player, ArrayList<Integer> moves) { for (int offset : getOffsets()) { int move = findMove(startIndex, offset, player); if (move != INVALIDMOVE && !adjacentMove(startIndex, offset, move) && !moves.contains(move)) ...
c28b42e6-1e27-42b5-b118-cde78bc3db3a
2
public int getFirstAddr() { int minAddr = Integer.MAX_VALUE; Enumeration enum_ = usingInstrs.elements(); while (enum_.hasMoreElements()) { InstrInfo info = (InstrInfo) enum_.nextElement(); if (info.instr.getAddr() < minAddr) minAddr = info.instr.getAddr(); } return minAddr; }
190a2aa5-b742-4015-98a3-e6841bc639ec
1
public static synchronized Factory getInstance(){ if (instance == null){ instance = new Factory(); } return instance; }
213427f4-c810-4ef9-a551-ef903fdfa6e7
3
public FutureMeeting getFutureMeeting(int id) { MeetingImpl tempM = null; try { FutureMeeting result = (FutureMeeting) this.getMeeting(id); if(result.equals(null)) { return null; }else{ if(inPast(tempM.meetingDate)) { throw new IllegalArgumentException(); }else{ return resu...
989f4fcb-56aa-4a19-98aa-2b884bee8bb7
5
private boolean scroll(final Item item, Item destination) { if (!ctx.bank.opened()) { return false; } final Component bankContainer = ctx.widgets.component(Constants.BANK_WIDGET, Constants.BANK_ITEMS); int tries = 0; while (tries < 100) { if (!ctx.bank.opened()) { return false; } if (!bankCo...
63aef16f-c3f8-4ea2-baff-03555cc312e9
5
@Override public void run() { if (!locationAttribute.isInLargeArea(ctx)) { //ctx.log.info("large"); doLarge(); } else if (!locationAttribute.isInSmallArea(ctx)) { //ctx.log.info("small"); final Tile destination = ctx.movement.destination(); double distance = IMovement.Euclidean(ctx.players.local().t...
1f73b94e-d1ea-4143-80b8-d88ecd385a7d
2
public void hashOutput() { for (int i = 0; i < length; i++) { if (!hashTable[i].isEmpty()) { hashTable[i].output(); } } }
aace03b2-a4d8-40d3-894e-e213a0c20f2e
3
public void visitLdcInsn(final Object cst) { if (cst instanceof Long || cst instanceof Double) { minSize += 3; maxSize += 3; } else { minSize += 2; maxSize += 3; } if (mv != null) { mv.visitLdcInsn(cst); } }
79aadaad-ff34-48d8-9866-84b274e249db
7
public void decorateChunk(WorldChunk chunk, World w, Random rand) { for(int gen = 0 ; gen < genLoops ; gen++) { int width = rand.nextInt(16); int height = rand.nextInt(maxHeight-minHeight)+minHeight; for(int i = 0 ; i < rand.nextInt(size) ; i++) {...
d922ca86-7616-4c6f-b51f-fbc09e3c3af5
0
public Item select(String itemCode) { String sql = "SELECT * FROM Item where ItemCode = ?;"; return getPersist().read(Item.class, sql, itemCode); }
653909a1-59e1-4a80-93b4-52f5a763c906
1
public void notifyWorldModelListeners() { for (final WorldModelListener listener : this.listenersWorld) { notifyWorldModelListener(listener); } }
dcaa2204-b63e-44ce-bbae-b6b8bd9f1c45
3
public int checkbannedusers() { try { BufferedReader in = new BufferedReader(new FileReader("./data/bannedusers.txt")); String data = null; while ((data = in.readLine()) != null) { if (playerName.equalsIgnoreCase(data)) { return 5; } } } catch (IOException e) { System.out.p...
63fdf5f8-3ee4-4aa3-88db-05db10ebbfa4
8
private static int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset, int options) { // Lots of error checking and exception throwing if (source == null) { throw new NullPointerException("Source array was null."); } // end if if (destina...
92e070ba-cab8-4c2f-acc2-2294bda2c864
2
public static String executeCommand(UserNChatThread user, String command){ if(command.equals("/stop")){ user.parentServer.stopServer = true; return "Stopping server..."; }else if(command.equals("/leave")){ user.stopThread = true; return ""; }else{ return "Invalid command."; } }
7215cb11-9553-4185-9047-58bde421c1ff
2
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); final int x = 6; final int y = 6; final int width = getWidth() - 12; final int height = getHeight() - 12; final FontMetrics fontMetrics = getFontMetrics(font); final int charWidth = fontMetrics.getWidths()[0]; final int ch...
dffae951-4fd7-4e8b-b0ef-04c1cc63f61c
2
public boolean hasMaxBypassPermission() { return this.maxByPassPermission != null && !this.maxByPassPermission.equals("*") && !this.maxByPassPermission.equals(""); }
d27640d8-de48-4a59-8964-27423e276272
3
public boolean playerExists(String playerName) { boolean exists = false; String query = ""; Connection connection = getSQLConnection(); PreparedStatement statement = null; if ( tableExists(TableType.PLAYER) ) { query = "SELECT COUNT(*) AS `playercount` FROM `" + TableName(TableType.PLAYER) + "` WHERE `p...
6dab9f33-8197-4f1f-8913-d63c0557b917
1
public List<Roster> getRosterList() { ArrayList<Roster> tripRosters = new ArrayList<Roster> (); for (Integer i: rosters) { tripRosters.add(MainWindow.rosterDB.getRosterByID(i)); } return tripRosters; }
b34567a7-9544-45eb-969a-3a695b4f2b2d
1
public void testBasicUsage() { // create a couple of events... EntityManager entityManager = entityManagerFactory.createEntityManager(); entityManager.getTransaction().begin(); //entityManager.persist(new Post("Our very first Post!", "Post content here", new Date())); //entityManager.persist(new Post("Our sec...
336ec112-7721-4c7c-a9ea-115259c48580
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Test test = (Test) o; if (id != null ? !id.equals(test.id) : test.id != null) return false; return age != null ? age.equals(test.age) : test.age == null; }
2817e4d5-ef0a-4ed2-a46c-447b5693a2c4
3
public void runUpdate(String queryIn) { try{ if(!con.isValid(1000)){//check if connection is still available interrupted = true; startConnection(); } //create an SQL statement st = con.createStatement(); //Run the update st.executeUpdate(queryIn); } catch(SQLException e) { e.printS...
1aa1e8e1-2cc5-46cd-a835-3a3517b6882b
7
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: if(st.equalsIgnoreCase("Mas")){ if(jList1.getSelectedValue() != null){ for(int i = 0; i < meses.size();i++){ ...
07bbe38e-994e-4cdf-9a1b-9081ec86aa84
6
public void loadLang() { final File lang = new File(getDataFolder(), "messages.yml"); if (!lang.exists()) { try { getDataFolder().mkdir(); lang.createNewFile(); final InputStream defConfigStream = getResource("messages.yml"); if...
5778966a-5e1a-4c80-94e5-0bd8ed271a1c
3
private void tickBackwards(){ time--; if(time % 60 == 0) second--; if(second == 0){ minute--; second = 60; } if(time == 0) finished = true; }
53a8a08f-0ee2-48ae-acbb-7ad1866e4213
6
public static void makeGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) { SpringLayout layout; try { layout = (SpringLayout)parent.getLayout(); } ...
e0509c47-cad9-45d8-80b1-9ab9a798cd04
1
static ArrayList<Quote> getQuotes(WebPage page) { ArrayList<Quote> quotes = new ArrayList<>(); Element container = Jsoup.parse( page.getContent() ).getElementsByAttribute("valign").first(); Elements headers = container.getElementsByClass("quote"); Elements bodies = container.getElementsB...
862a89fd-f1d6-4244-9aa4-b70f243f8ad1
9
public static void main(String [] args) throws Throwable { if (args.length < 2) { usage(); return; } Class stemClass = Class.forName("org.tartarus.snowball.ext." + args[0] + "Stemmer"); SnowballStemmer stemmer = (SnowballStemmer) stemClass.newInstance(); Reader reader; ...
5e800a03-f416-47df-a59e-338cb0c32fd1
6
static final void method3178(IndexLoader class45, int i, int[] is, IndexLoader class45_15_) { try { anInt9506++; if (is != null) Class348_Sub1.anIntArray6547 = is; s.fontIndexLoader = class45; if (i >= -6) method3177(-36, true); Class39.spriteIndexLoader = class45_15_; } catch (Runti...
507ea4aa-da79-48a0-8331-db0600becc09
9
String[] getAllKeyParts(String begin, String end) { if (begin == null) return new String[0]; if (end == null) return new String[0]; Properties allKeys = getAllKeyValuesByBeginAndEnd(begin,end); String[] keys = new String[0]; if (unique == false) { keys = new String[allKeys.size()]; }; Properties uni...
a1a559a1-77bf-4813-be43-570502832189
8
public static String[] sortStrings(String[] strings, String sens) { String temp; if(sens == "asc" || sens == "desc") { for(int i1 = 0; i1 < strings.length; i1++) { for(int i2 = 0; i2 < strings.length; i2++) { switch(sens) { ...
0febba98-f82f-44bd-ac17-13d24a6d1379
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Request request = (Request) o; if (entered != request.entered) return false; if (query != null ? !query.equals(request.query) : request.query !...
2080e0a9-09c1-4fae-9d50-9b0f74116219
1
private void showLine() { for(int i = 0; i < getMessage().length();i++) out.print(symbol); out.println(); }
478e91ed-d92c-468a-8db3-c9715bef1995
4
private void preencherJTableData(Date dataInfo) { carregarJTable(); final int I = 0; ConsultaController uc = new ConsultaController(); modelo.setRowCount(I); PainelRolagem.setViewportView(tabela); System.out.println("getRowCount "); tabela.updateUI(); Pai...
4ce5a6ad-5ecf-4c9c-9bcd-6f40f2cd6632
3
public ResultSet retornarResultSet(String pSQL)throws Exception{ Connection con = null; try { abrirConexao(); } catch (Exception ex) { throw ex; } try { Statement stmt = (Statement)conbco.createStatement(); Re...
c2f9ac91-0e29-4c04-ab8c-24c8e70092f4
0
public TheWorld() throws HeadlessException { super("This is the world, and God syas ..."); p = new Panel(); p.setBackground(Color.black); add(p); btnLand = new LetThereBeLandCommand("Let there be land", p); btnLight = new LetThereBeLightCommand("Let there be light", p); p.add(btnLand); ...
20ef51c9-f9f3-423e-a1da-326d205972ea
2
public void visitMultiANewArrayInsn(final String desc, final int dims) { Item i = cw.newClassItem(desc); // Label currentBlock = this.currentBlock; if (currentBlock != null) { if (compute == FRAMES) { currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i); } else { // updates current stack ...
16d13671-46f1-4ea0-836f-34cddabac322
3
@Override public Iterable<V> values() { ArrayList<V> values = new ArrayList<>();// return container for (int i = 0; i < capacity; i++) { if ((bucket[i] != null) && (bucket[i] != available)) values.add(bucket[i].getValue()); } return values; }
cbb51401-f214-46bd-80b9-dcc50a5992df
0
public void movePegsHere() { movePegsHorizontally(x, y, z); x.centerY = centerY + height/2 - vertMargin; z.centerY = centerY + height/2 - vertMargin; y.centerY = centerY + height/2 - vertMargin; }
7214d611-ad41-443f-b90d-d13bc739482f
8
private void BtonremActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtonremActionPerformed vtexto = Ctexto.getText(); DefaultTableModel tr = (DefaultTableModel)tabla.getModel(); try { Statement s = cone.getMiConexion().createStatement(); String...
169e466c-3f92-4642-a405-a372a68ba921
7
public String getFreemindBaseDir() { if (baseDir == null) { try { File file; String dir = System.getProperty("freemind.base.dir"); if (dir == null) { // Property isn't set, we try to find the // base directory ou...
491debe7-ec89-4ec2-a5c7-3ffacec5a49e
2
public static void newMappingSession() { long newSession = System.currentTimeMillis(); String date = Utils.sessdate(newSession); try { if(Config.autoSaveMinimaps){ (new File("map/" + date)).mkdirs(); Writer currentSessionFile = new FileWriter("map/currentsession.js"); currentSessionFile.write("var cur...
854c24a2-3497-4768-b060-ce46566e890e
7
@Override public void action() { for(PlayerInterface PlayerInterface :GameModel.getPlayers()){ Player player=PlayerInterface.getPlayer(); if(hypetunusan(x,y,player.getPosX(),player.getPosY())<400){ double vinkeln=Math.atan2((x-player.getPosX()), (y-player.getPosY()+1)); int diffX=(int) (Math.s...
b5c17d3d-f170-4840-b962-1a00d27e5d54
5
public void readCounts() throws IOException{ System.out.println("started processing " + dirName); TextFile in = null; String line = ""; String[] splLine; int index = 0; //all genes from bed12, sorted //allTranscr = getAllTranscripts(); getAllGenes(); ...
08cedc00-0ec7-4894-8b8b-8fa98561573d
0
public void setUrl(String url) { this.url = url; }
ccc74e87-d817-4da5-bdaf-34c890768612
0
@Override public String toString() { return "LOAD " + new Integer(offset).toString() + " " + identifier + " <load " + identifier + ">"; }
231ffeba-75a9-4ac2-bdf3-0c232856681f
2
public void print_extraction_method_XML(Hashtable<String, LinkedList<Triple<String,String,String>>> relations) throws IOException { w.write("<?xml version=\"1.0\"?>\n<rdf:RDF\nxmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"); LinkedList<Tuple<String, LinkedList<Triple<String,String,String>>>> relation...
637d2e6e-f7d4-4b30-a242-645358ab34fe
1
public byte[] getMessage(int offset) { int l = PAYLOAD_SIZE - offset; byte[] message = new byte[l]; for(int i = 0; i < l; i++) { message[i] = payload[i + offset]; } return message; }
48c891ff-1ae7-40a5-b460-47c3743581bf
2
@SuppressWarnings("unchecked") public static <T extends Annotation> T getAnnotation(AnnotatedElement elem, Class<T> annType) { T result = null; for(Annotation annot : getAllAnnotations(elem, annType)) { if(annType.isAssignableFrom(annot.getClass())) { result = (T) annot; break; } } return resul...
aaa98012-c2e3-405b-9423-543fa6aaac50
4
public boolean tarkistaRivit(int kuka) { int vierekkaiset = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (poyta[i][j] == kuka) { vierekkaiset++; } } if (vierekkaiset == 3) { retu...
a43ea051-5b0f-4b53-bfe8-cd4b1aa826fe
5
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed System.out.println("leitura"); try { Leitor leitor = new Leitor(this.arqentrada.getText()); System.out.println("Carregamento"); Objeto obj =...
1770f81d-57bc-45c7-967c-623eab39c40a
9
public int GetTestCount(){ int result = 0; Connection conn = null; PreparedStatement st = null; ResultSet rs = null; try { // ConnectionManager.GetComboPooledDataSource() is an instance of c3p0's ComboPooledDataSource conn = ConnectionManager.GetComboPooledDataSource().getConnection(); ...
4e5c30c6-73b5-45ff-b19d-b7c3f6277b38
9
@Override public void actionPerformed(ActionEvent e) { synchronized (accountConfig) { ExecutorService threadsPool = accountConfig.executorService; List<Future<?>> jobs = new ArrayList<>(); for (final AccountVO accountVO : accountList) { System.out.println(...
6671cbc9-e01c-4b1f-b328-147125d69aff
1
public double unwrapFloatingPoint() { if (!isFloatingPoint) { //If not floating point, return intOperand as floating point value (fraction will be 0). double castFloatingPointOperand = (double) intOperand; return castFloatingPointOperand; } return floatingPointOperand; }
badb5050-4db2-4f66-a4ea-d29a85dc6d32
7
public boolean determineIfFinished () { int i = 0, j = 0; /* Checks the size */ if (size.equals("9x9")) { /* Uses nested for loops and if statements to check if the game is finished based on all places being full or more errors remaining */ for (i = 0; i < 9; i++) { for (j = 0; j < 9; j++...
1e1ac0d7-10a0-4513-ac59-86683e6f6cfd
9
public static int getTypeTag(Class type) { if (type == ScriptRuntime.StringClass) return JAVA_STRING_TYPE; if (type == ScriptRuntime.IntegerClass || type == Integer.TYPE) return JAVA_INT_TYPE; if (type == ScriptRuntime.BooleanClass || type == Boolean.TYPE) ...
dc695fd2-9651-419a-8a0b-b90cd787e03c
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Token other = (Token) obj; if (end != other.end) return false; if (start != other.start) return false; if (text == null) { if (other...
792a4cef-952f-4caf-a806-af8b96a2fd48
6
private boolean camposCompletos (){ if((!field_codigo.getText().equals(""))&& (!field_nombre.getText().equals(""))&& (!field_apellido.getText().equals(""))&& (!field_localidad.getText().equals(""))&& (!field_direccion.getText().equals(""))&& (!field_sit_fre...
d1d1aa69-dd12-4614-97c5-62a5a3ce141d
3
public boolean isInside(LonLat l) { return l.getLon() >= leftTop.getLon() && l.getLon() <= rightBottom.getLon() && l.getLat() >= rightBottom.getLat() && l.getLat() <= leftTop.getLat(); }
9da924d3-dc09-4942-9206-1cd9bbd1e942
2
public Direction getEdgeDirection(Edge edge) { for (Map.Entry<Direction, Edge> e : edges.entrySet()){ if (e.getValue() == edge){ return e.getKey(); } } throw new IllegalArgumentException("Edge is not set on this Tile"); }
b668569f-1c61-4a2d-a7fe-c6aedbc2d551
7
private void printSheetContent(Sheet sheet) { /* skip column heads */ //printColumnHeads(); out.format("<tbody>%n"); Iterator<Row> rows = sheet.rowIterator(); while (rows.hasNext()) { Row row = rows.next(); out.format(" <tr>%n"); /* skip fir...
bb41b115-9a81-47c0-b284-6952405cebb4
3
public boolean before(Temps t) { boolean egal= ((this.heures==t.heures) &&( this.minutes==t.minutes) && ( this.secondes==t.secondes)); return (t.after(this) && !egal) ; }
27cc18ba-5489-43b9-ac29-d665b0993bed
4
public SingleTreeNode egreedy() { SingleTreeNode selected = null; if(m_rnd.nextDouble() < egreedyEpsilon) { //Choose randomly int selectedIdx = m_rnd.nextInt(children.length); selected = this.children[selectedIdx]; }else{ //pick the bes...
eeb37c30-e2c1-4d3d-968e-781f9d516933
8
public void putAll( Map<? extends K, ? extends Double> map ) { Iterator<? extends Entry<? extends K,? extends Double>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends K,? extends Double> e = it.next(); this.put( e.getKey(), e.getValue() ); ...
41dc8486-c098-40f4-a6b7-4d7f69e270a1
0
public double getEffMult() { return effectivenessMultiplier; }
ddbac047-6b9f-4a7a-8254-733415495bdc
4
@Override public void execute(CommandSender sender, String worldName, List<String> args) { this.sender = sender; if (worldName == null) { error("No world given."); reply("Usage: /gworld delete <worldname>"); } else if (!hasWorld(worldName)) { reply("World not found: " + worldName); } else { if (...
69cb5dfe-e095-4b56-81cf-c85da71e93ca
7
private void initComponents() { mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); outerSplitPane = new javax.swing.JSplitPane(); rightSplitPane = new javax.swing.JSplitPane(); defaultDisplayPane = new DisplayPane(); // Create the outer split pane, which houses the file tr...
2724d136-2fdf-4ce9-8dee-bc7d9074efd7
0
public void setTarget(String target) { this.target = target; }
080b0a58-68b7-46ad-867b-d020d4cec509
1
public double getDeviation() { double deviation=0; for (int i = 0; i < NFRUIT; i++) { deviation += (mExpDistrib[i] * mPreferences[i] * mPreferences[i]); } return Math.sqrt(deviation); }
6a3cbf9c-97f5-4997-bfe9-0837396baea2
9
@Override public List<ChessPosition> getPosCanMove(ChessPosition current) { List<ChessPosition> pos = new ArrayList<ChessPosition>(); ChessPosition CpTemp; int x, y, upBound, lowBound, leftBound, rightBound, value; int dx[] = { 0, 1, 1, -1, -1 }; int dy[] = { 0, 1, -1, 1, -1 }; // khoi tao gioi han di chuy...
db22f6fa-e0d2-4077-9928-1b7ad91ee5b9
6
public static List<Feed> parseExportedFile(File ExportedFile) { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); try { Reader fileReader = new FileReader(ExportedFile); XMLEventReader reader = inputFactory.createXMLEventReader(fileReader); feeds = new ArrayList<Feed>(); while (reader.hasN...
d724ebb7-b54c-4746-ac3a-5381121d7923
7
public static void main(String[] args) { double[] projectScores; int nStudents; double aScore; double average = 0; double stdDeviation = 0; // // Creates a sScanner object // Scanner keyboard = new Scanner(System.in); // // Prompt the user for the number of students // System.out.prin...
b30cebb4-adc3-450e-b1d9-ea618e63d119
6
@Override public void move(GameBoard b) { initOtherPlayer(b); MoveNode root = new MoveNode(b); addChildren(root); //ok now we have a full map. scoreTree(root); //and we know, for each move, the number of wins, losses, and ties possible. //first, try to avoid losses. MoveNode bestNode = new Mov...
4d1006fe-339d-42be-93b7-6c05ab49cc7d
0
Type(int id) { this.id = id; }