query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
springmanaged object created to allow app to access whitelist filter
@Bean public Whitelist whitelist() { return new Whitelist(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void attachFilter(ConfigContext ctx, Entity entity) {\n\t}", "public PreOauth2SSOGatewayFilter() {\n super(Config.class);\n }", "@Override\r\n protected Filter[] getServletFilters() {\r\n return new Filter[]{\r\n //new DelegatingFilterProxy(\"springSecurit...
[ "0.60698116", "0.59961605", "0.5714515", "0.5664489", "0.5659719", "0.56261146", "0.5581398", "0.55599207", "0.5552693", "0.5400993", "0.53644836", "0.53641516", "0.53402126", "0.5338669", "0.5321059", "0.5320064", "0.5318569", "0.5297592", "0.5296393", "0.5283286", "0.526319...
0.6848885
0
register filter with spring container
@Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor( whitelist() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void register(ExtendedHttpService service, FilterProxy<? extends Filter> filter)\n throws ServletException, NamespaceException {\n service.registerFilter(\"/\", filter, null, null);\n }", "public void onStartup(ServletContext arg0) throws ServletException {\n\n ...
[ "0.6716157", "0.6618821", "0.6578957", "0.65747595", "0.6562385", "0.6557104", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6505315", "0.6495693", "0.6495693", "0.6494361", "0.6494361", "0.6494361", "0.6494361", ...
0.0
-1
synchronized getters and setters here Gets the balance of the account
public double getBalance() { return balance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getBalance()\n \n {\n \n return balance;\n \n }", "public double getBalance()\n {\n return balance;\n }", "public double getBalance() {\n return balance;\n }", "public int getBalance()\n {\n return balance;\n }", "public double getBalance(){\r\n\t\tr...
[ "0.82202697", "0.81223446", "0.8110213", "0.8107666", "0.8101775", "0.8079735", "0.8070787", "0.8067294", "0.80517554", "0.80504715", "0.80504715", "0.80501443", "0.8043045", "0.8026363", "0.8025243", "0.8022944", "0.80133146", "0.80061895", "0.7989951", "0.7989951", "0.79688...
0.80546385
11
Sets the balance of the account
public synchronized void setBalance(double balance) { this.balance = balance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBalance(double bal){\n balance = bal;\r\n }", "public void setBalance( Integer account_id, double balance ){\r\n\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"account_id\", String.valueOf(account_id));\r\n params.put(\"balance\", String.valueOf(balance...
[ "0.7934461", "0.78938913", "0.78023833", "0.7776525", "0.7710409", "0.76446044", "0.7579406", "0.7558338", "0.7544201", "0.75430006", "0.75035566", "0.75035566", "0.74997973", "0.744487", "0.744487", "0.7383514", "0.73834324", "0.73734397", "0.7365012", "0.72299886", "0.72203...
0.7799992
3
Gets the pending balance of the account
public double getPendingBalance() { return pendingBalance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}", "public int getBalance() {\n return total_bal;\n }", "public double getBalance() {\n\n double balance = 0;\n balance = overDraftLimit;\n return balance;\n\n }", "public java.math.BigDec...
[ "0.7199373", "0.7044418", "0.6973423", "0.69332826", "0.6927114", "0.6910341", "0.6910341", "0.6891365", "0.68528414", "0.68422025", "0.68422025", "0.68181854", "0.68181854", "0.680768", "0.67872787", "0.6767901", "0.67489517", "0.67489517", "0.67125607", "0.6702194", "0.6673...
0.7936195
0
Sets the pending balance of the account
public synchronized void setPendingBalance(double pendingBalance) { this.pendingBalance = pendingBalance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setManageTransactionBalance(String balance);", "public void setBalance(){\n balance.setBalance();\n }", "public void setBalance(double bal){\n balance = bal;\r\n }", "public void setNewBalance() {\n\t\tacc.setBankBalance(acc.getBalance() - keyboard.getAmt());\r\n\t}", "public void setBal...
[ "0.6834969", "0.67514235", "0.6601438", "0.64962983", "0.635104", "0.635104", "0.6288475", "0.62242174", "0.62184256", "0.62179416", "0.6131297", "0.6129946", "0.611889", "0.6118115", "0.60950005", "0.6090225", "0.60885704", "0.6071411", "0.60617584", "0.60490316", "0.6000030...
0.7924192
0
Gets the account number
public Integer getAccountNumber() { return accountNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getAccountNumber();", "public String getAccountNumber() {\n\t\tthis.setAccountNumber(this.account);\n\t\treturn this.account;\n\t}", "public static String getAccountNumber() {\n\t\treturn accountNumber;\n\t}", "public int getAccountNumber() {\n\t\treturn accNum;\n\t}", "public int getAccou...
[ "0.89875984", "0.83101714", "0.82991606", "0.8201452", "0.8140186", "0.81178606", "0.8014264", "0.7934047", "0.7934047", "0.7934047", "0.79270905", "0.79233754", "0.7917163", "0.7861226", "0.7855223", "0.78369737", "0.7791793", "0.77814066", "0.77814066", "0.7556412", "0.7522...
0.80555296
7
Sets the account number
public synchronized void setAccountNumber(int number) { this.accountNumber = number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setAccountNumber(java.lang.String accountNumber);", "public void setAccountNo(int number){\n\t\taccountNo = number;\n\t}", "public void setAccountNumer(int accountNumber) {\n\t\tif (this.accountNumber == 0) {\n\t\t\tthis.accountNumber = accountNumber;\n\t\t} else {\n\t\t\tSystem.out.println(\"The account ...
[ "0.84377563", "0.82164717", "0.78231126", "0.7744408", "0.769918", "0.7607604", "0.74539864", "0.7384063", "0.72128004", "0.7178684", "0.7117843", "0.7097472", "0.70503455", "0.69957787", "0.6964519", "0.69273126", "0.66349494", "0.66342443", "0.6623039", "0.6616416", "0.6609...
0.86665803
0
Gets the name of the account owner
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAccountOwner() {\n return accountOwner;\n }", "public String getOwnerName() {\r\n return this.ownerName;\r\n }", "public String getOwner() {\r\n if (mOwner==null) {\r\n return \"n/a\";\r\n }\r\n return mOwner;\r\n }", "public String getownerName() {...
[ "0.8232877", "0.78484315", "0.78019935", "0.7777841", "0.77505475", "0.7714646", "0.7687522", "0.7682898", "0.7682898", "0.7514326", "0.74563354", "0.7412126", "0.74093074", "0.7362259", "0.7362259", "0.7360789", "0.7336235", "0.7257684", "0.7252834", "0.7209076", "0.72086775...
0.0
-1
An overridden toString method for debugging and display purposes.
@Override public String toString() { return "accountNumber=" + accountNumber + ", name='" + name + '\'' + ", balance=" + balance + ", pendingBalance=" + pendingBalance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override String toString();", "@Override public String toString();", "@Override\r\n String toString();", "@Override\r\n\tpublic String toString();", "@Override\n String toString();", "@Override\n String toString();", "@Override\r\n public String toString();", "@Override\r\n\t\tpublic Str...
[ "0.90583146", "0.90140206", "0.8998247", "0.89026994", "0.8898972", "0.8898972", "0.88565075", "0.88130075", "0.8792282", "0.8790001", "0.87568897", "0.87312573", "0.87312573", "0.87312573", "0.87312573", "0.87312573", "0.87312573", "0.86940116", "0.86940116", "0.8689376", "0...
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof GrlesschildP)) { return false; } GrlesschildP other = (GrlesschildP) object; if ((this.grlesschildpId == null && other.grlesschildpId != null) || (this.grlesschildpId != null && !this.grlesschildpId.equals(other.grlesschildpId))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void se...
[ "0.6893787", "0.68366045", "0.67026585", "0.66388494", "0.66388494", "0.6589572", "0.65758747", "0.65758747", "0.6572052", "0.6572052", "0.6572052", "0.6572052", "0.6572052", "0.6572052", "0.6559372", "0.6559372", "0.65421206", "0.65220076", "0.65133774", "0.64854103", "0.647...
0.0
-1
/ String sql = "SELECT dateDiffWorkingDays(:dateFrom, :dateTo)"; Query query = entityManager.createNativeQuery(sql); query.setParameter("dateFrom", dateFrom); query.setParameter("dateTo", dateTo); return (Integer)Utils.first(query.getResultList()); /
@SuppressWarnings("unchecked") @Override public Integer getDateDiffWorkingDays(Date dateFrom, Date dateTo) { String sql = dateFrom.after(dateTo) ? "select count(*) * -1 from calendar where id_date >= :dateTo and id_date < :dateFrom and holiday = 0" : "select count(*) from calendar where id_date > :dateFrom and id_date <= :dateTo and holiday = 0"; Query query = entityManager.createNativeQuery(sql); query.setParameter("dateFrom", dateFrom); query.setParameter("dateTo", dateTo); return Utils.isNull(Utils.first(query.getResultList()), (Integer) null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long days(Date date2) {\n\t\tlong getDaysDiff =0;\n\t\t DateFormat simpleDateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t Date currentDate = new Date();\n\t\t Date date1 = null;\n\t\t Date date3 = null;\n\n\t\t\n\n\t\t try {\n\t\t String startDate = simpleDateFormat.format(date2);\n\t\t S...
[ "0.6508315", "0.6175499", "0.60607874", "0.60096115", "0.5976499", "0.59062725", "0.582968", "0.5763733", "0.5724348", "0.5723278", "0.5695864", "0.56847405", "0.55417573", "0.5540264", "0.55021787", "0.5477702", "0.54520786", "0.54480994", "0.54444116", "0.544048", "0.540913...
0.7682141
0
Request to start are service when the alarm date is upon us We don't start an activity as we just want to pop up a notification into the system bar not a full activity
@Override public void run() { Intent intent = new Intent(context, NotifyService.class); intent.putExtra(NotifyService.INTENT_NOTIFY, true); intent.putExtra("REMINDER", showInfo); PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0); boolean alarmUp = (PendingIntent.getBroadcast(context, 0, new Intent("is.activites.scheduleActivites.INTENT_NOTIFY"), PendingIntent.FLAG_NO_CREATE) != null); // Sets an alarm - note this alarm will be lost if the phone is turned off and on again if(!alarmUp) am.set(AlarmManager.RTC_WAKEUP, date.getTimeInMillis(), pendingIntent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startAlarm(Context context){\n Intent intent = new Intent(this,MonthlyReminderService.class);\n int received = intent.getIntExtra(\"recieved\", 0);\n intent.putExtra(\"received\", received);\n //int type = intent.getIntExtra(\"type\", 0);\n //Log.e(\"SurveyType\", Int...
[ "0.7934945", "0.7440602", "0.7219896", "0.7058358", "0.70387495", "0.6994804", "0.6904422", "0.69036824", "0.68949753", "0.68466014", "0.6805272", "0.67027146", "0.66863143", "0.66602665", "0.66555625", "0.6651339", "0.6639427", "0.66230667", "0.6618946", "0.6608378", "0.6594...
0.7379572
2
Writes the provided digital object to the temporary directoy.
private void saveTempFile(DigitalObject object) { String tempFileName = tempDir.getAbsolutePath() + "/" + System.nanoTime(); OutputStream fileStream; try { fileStream = new BufferedOutputStream(new FileOutputStream(tempFileName)); if (object != null) { byte[] data = object.getData().getData(); if (data != null) { fileStream.write(data); } } fileStream.close(); tempFiles.put(object, tempFileName); } catch (FileNotFoundException e) { log.error("Failed to store tempfile", e); } catch (IOException e) { log.error("Failed to store tempfile", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeDigitalObjects(List<Integer> objectIds, String tempDir) throws IOException, StorageException {\n int counter = 0;\n int skip = 0;\n log.info(\"Writing bytestreams of digital objects. Size = \" + objectIds.size());\n for (Integer id : objectIds) {\n if (count...
[ "0.609535", "0.58318186", "0.57954675", "0.5564857", "0.55400217", "0.55026144", "0.5495735", "0.54913646", "0.54398584", "0.54041785", "0.53778636", "0.5359306", "0.5357255", "0.53382015", "0.5312956", "0.53052586", "0.5303397", "0.5303351", "0.5290809", "0.52804255", "0.527...
0.6858388
0
Set up environment for image comparison.
private void setUp() { if (tempDir != null) { tearDown(); } tempDir = new File(OS.getTmpPath() + "imagecompare" + System.nanoTime()); tempDir.mkdir(); tempDir.deleteOnExit(); tempFiles.clear(); log.debug("using temp directory " + tempDir.getAbsolutePath()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n public void setupEnvironment() {\n TestEnvironment testEnvironment;\n switch (mode) {\n case CLUSTER:\n // This only works because of the quirks we built in the TestEnvironment.\n // We should refactor this in the future!!!\n testEn...
[ "0.6501957", "0.6066527", "0.6045768", "0.5954028", "0.59119165", "0.5781158", "0.5763087", "0.57365215", "0.57365215", "0.57193226", "0.5708826", "0.56955266", "0.5616164", "0.55979705", "0.55858314", "0.55790514", "0.55513793", "0.55493385", "0.5520407", "0.546932", "0.5455...
0.579224
5
Tear down environment for image comparison.
private void tearDown() { if (tempDir != null) { OS.deleteDirectory(tempDir); tempFiles.clear(); tempDir = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@After\n\tpublic void teardown() {\n\t\tdrv.quit();\n\t}", "protected void tearDown() {\n testEnv.close();\n }", "@After\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n TestHelper.cleanupEnvironment();\r\n instance = null;\r\n }", "public void tear...
[ "0.6883036", "0.67982364", "0.67860067", "0.67677087", "0.676313", "0.67410654", "0.67196417", "0.66758204", "0.65085566", "0.65056604", "0.6503522", "0.643088", "0.6429619", "0.6397748", "0.6397187", "0.6395781", "0.63939166", "0.6389152", "0.6375153", "0.6353316", "0.634386...
0.6054986
64
TODO Autogenerated method stub
@Override public void selectDataGridByProvince(PageInfo pageInfo) { Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize()); page.setOrderByField(pageInfo.getSort()); page.setAsc(pageInfo.getOrder().equalsIgnoreCase("asc")); List<Map<String, Object>> list = dataMapper.selectDataPageByProvince(page, pageInfo.getCondition()); pageInfo.setRows(list); pageInfo.setTotal(page.getTotal()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public void selectDataGridByPrinciple(PageInfo pageInfo) { Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize()); page.setOrderByField(pageInfo.getSort()); page.setAsc(pageInfo.getOrder().equalsIgnoreCase("asc")); List<Map<String, Object>> list = dataMapper.selectDataPageByPrinciple(page, pageInfo.getCondition()); pageInfo.setRows(list); pageInfo.setTotal(page.getTotal()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Step 1: Read in the radius Create a scanner object
public static void main(String[] args) { Scanner input = new Scanner(System.in); //Prompt user to enter a radius System.out.print("Please enter a radius: "); double radius = input.nextDouble(); // Step 2: Compute area double area = radius*radius*3.141359; // Step 3: Display the area System.out.println("The area for the circle of radius " + radius + " is " + area); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\r\n\t\tdouble circum;\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"Type the radius:\");\r\n\t int radius = STDIN_SCANNER.nextInt();\r\n\t \r\n\t \r\n\t circum = 2 * Math.PI * radius;\r\n\t \r\n\t System.out.println(\"Circumference of the Circle: \" + circum);\r\...
[ "0.6395212", "0.60446936", "0.5725469", "0.5725469", "0.56906754", "0.56789327", "0.5661981", "0.5543031", "0.54934144", "0.5424186", "0.5422038", "0.5417793", "0.5414527", "0.5389101", "0.5380962", "0.5364675", "0.53375626", "0.5302247", "0.5302247", "0.52994937", "0.5295768...
0.0
-1
ONLY execute in this main method
public static void main(String[] args) { name = "Izzat"; num = 200; System.out.println(name); System.out.println(num); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Main() {\n\n super();\n }", "public static void main() {\n \n }", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public static void main()\n\t{\n\t}", "public static void main(){\n\t}", "public void run() {\n // The run method should be overridden b...
[ "0.71503925", "0.7100356", "0.69079876", "0.6877687", "0.68602115", "0.6792756", "0.6778552", "0.6778312", "0.6738868", "0.6732387", "0.6730313", "0.67268527", "0.669786", "0.6686831", "0.66672766", "0.66672766", "0.6643581", "0.6627343", "0.6618601", "0.6615642", "0.6597712"...
0.0
-1
/ These special emergency number will show ecc in MMI but sent to nw as normal call
public boolean isSpecialEmergencyNumber(String dialString) { return (dialString.equals("110") || dialString.equals("119") || dialString.equals("000") || dialString.equals("08") || dialString.equals("118") || dialString.equals("999") || dialString.equals("120")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String m21400e() {\n try {\n return new BufferedReader(new FileReader(new File(\"/sys/class/net/wlan0/address\"))).readLine();\n } catch (Throwable th) {\n C5205o.m21464a(th);\n return \"02:00:00:00:00:00\";\n }\n }", "public synchronized vo...
[ "0.5970243", "0.57603014", "0.5671708", "0.5653973", "0.56164014", "0.5594028", "0.5587765", "0.55604154", "0.55378246", "0.5523966", "0.5523966", "0.5523966", "0.5523966", "0.5523966", "0.5523966", "0.5523966", "0.54764694", "0.5474616", "0.54588085", "0.5445328", "0.5425166...
0.5641857
4
Customized ecc number when SIM card is not inserted
public boolean isCustomizedEmergencyNumberExt(String number, String plusNumber, String numberPlus) { String []emergencyNumList = {"112", "911", "000", "08", "110", "118", "119", "999", "120"}; for (String emergencyNum : emergencyNumList) { numberPlus = emergencyNum + "+"; if (emergencyNum.equals(number) || numberPlus.equals(number)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEmbossCardNum(String value) {\r\n setAttributeInternal(EMBOSSCARDNUM, value);\r\n }", "@Override\r\n\tpublic int getcc() {\n\t\treturn 120;\r\n\t}", "public String getEmbossCardNum() {\r\n return (String) getAttributeInternal(EMBOSSCARDNUM);\r\n }", "String getCE();", "St...
[ "0.60532945", "0.58796585", "0.5866555", "0.58041257", "0.58041257", "0.58041257", "0.58041257", "0.5767671", "0.5689174", "0.5674918", "0.5665321", "0.56372887", "0.56372887", "0.55832493", "0.55179495", "0.5514721", "0.54905367", "0.5459067", "0.5425899", "0.5413679", "0.54...
0.0
-1
WZQFrame ui = new WZQFrame();
public void WZQFrame() { JFrame jf = new javax.swing.JFrame(); jf.setTitle("五子棋"); jf.setDefaultCloseOperation(3); jf.setSize(1246, 1080); jf.setLocationRelativeTo(null); jf.setResizable(false); jf.setLayout(new FlowLayout()); this.setLayout(new FlowLayout()); this.setPreferredSize(new Dimension(1030, 1080)); // this.setBackground(Color.CYAN); // 把面板对象添加到窗体上 jf.add(this); JPanel jp1 = new JPanel(); jp1.setPreferredSize(new Dimension(200, 1080)); jp1.setLayout(new FlowLayout()); jf.add(jp1); LoginListener ll = new LoginListener(); String[] str = { "悔棋", "重新开始" }; for (int i = 0; i < str.length; i++) { JButton jbu1 = new JButton(str[i]); jbu1.setPreferredSize(new Dimension(150, 80)); jbu1.setFont(new Font("楷体", Font.BOLD,20));//设置字体 jp1.add(jbu1); jbu1.addActionListener(ll); } jf.setVisible(true); Graphics g = this.getGraphics(); this.addMouseListener(ll); ll.setG(g); ll.setU(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Hwk2JFrame() {\n initComponents();\n }", "public Mainframe() {\n initComponents();\n }", "private FrameUIController(){\r\n\t\t\r\n\t}", "public QLHocSinhJFrame() {\n initComponents();\n }", "public mainframe() {\n initComponents();\n }", "public FrameDesign(...
[ "0.66910684", "0.6632719", "0.66072613", "0.65321153", "0.65102524", "0.6476015", "0.64381987", "0.64344275", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", "0.64135855", ...
0.657135
3
do not run scheduler if is set to inactive
@Scheduled(cron = "0 0 */1 * * ?") public void schedule() { if (!active) { return; } // do not process if there is no update if (updateService.count() == 0) { return; } LOGGER.info("Updating indices"); // import all indices list try { List<String> indices = getAllIndices(); for (String index : indices) { StockIndex indexEntity = getIndex(index); try { processIndexCompanies(indexEntity); } catch (IOException ex) { LOGGER.error("EXCEPTION.DOWNLOAD.CMPS." + index, ex); } } } catch (IOException e) { LOGGER.error("EXCEPTION.DOWNLOAD.IDXS", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void disabledPeriodic() {\n\tScheduler.getInstance().run();\n }", "public abstract boolean isScheduled();", "public boolean isScheduled();", "@Override\n\tpublic boolean isScheduled();", "@Override\n public void onDisable()\n {\n if (this.schedulerManager.getScheduler(...
[ "0.72849905", "0.7168799", "0.71326697", "0.70003617", "0.6801155", "0.6606841", "0.6530901", "0.6447676", "0.64170116", "0.6369569", "0.6369569", "0.6338235", "0.6215497", "0.62059855", "0.6191174", "0.61681354", "0.614065", "0.61251545", "0.6119518", "0.61125875", "0.611197...
0.0
-1
Prevents the tusks from trying to change all at the same time
public Sleep() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void bankrupt() {\n this.mortgaged = false;\n }", "private void conmuteFields() {\r\n\t\ttxPassword.setEditable(!txPassword.isEditable());\r\n\t\ttxUsuario.setEditable(!txUsuario.isEditable());\r\n\t\tcheckAdmin.setDisable(!checkAdmin.isDisable());\r\n\t\tcheckTPV.setDisable(!chec...
[ "0.6317449", "0.5938854", "0.59194386", "0.5876985", "0.5814631", "0.57791173", "0.57735705", "0.5731755", "0.57308537", "0.57209563", "0.57059985", "0.56648314", "0.56609505", "0.5656713", "0.56511235", "0.5625781", "0.5617923", "0.5617113", "0.5611275", "0.5597181", "0.5588...
0.0
-1
Bach Conway Doe Smith
@Test(description = "Verify that after click last name, values will be sorted alphabetic order") public void Test8_YK(){ // PASS DONEEEEE driver.findElement(By.xpath("//table[@id='table1']//tr//th[1]")).click(); String[] expectedLastNameOrder = {"Bach", "Conway", "Doe", "Smith"}; List<WebElement> lastnames = driver.findElements(By.xpath("//table[@id='table1']//tbody//tr//td[1]")); for (int i = 0; i<4; i++){ Assert.assertEquals(lastnames.get(i).getText(), expectedLastNameOrder[i], "NOT EQUAL"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getSurname();", "java.lang.String getSurname();", "java.lang.String getFirstName();", "java.lang.String getFirstName();", "String fullName();", "String getCustomerLastName(String bookingRef);", "String getLastName();", "String getLastName();", "public void getFirstAndLastName( String name ){...
[ "0.6947397", "0.68836486", "0.6534487", "0.6534487", "0.65003705", "0.64909387", "0.6480009", "0.6480009", "0.6426362", "0.63263655", "0.6309762", "0.6309762", "0.63080865", "0.62895656", "0.62895656", "0.62895656", "0.6073615", "0.6072242", "0.6060288", "0.6031567", "0.60262...
0.0
-1
traverses node to find matching leaf node
public RegressionTreeNode traverseNode(Serializable value){ if(value instanceof Number && this.value instanceof Number){ Double number = ((Number) value).doubleValue(); return this.traverseNumericalNode(number); }else{ return this.traverseNominalNode(value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\npublic boolean fjern(T verdi) {\n Node<T> curr = hode;\n while (curr != null) {\n if (curr.verdi.equals(verdi)) {\n if (antall == 1) {\n hode = hale = null;\n } else if (curr == hode) {\n hode = hode.neste;\n hode.forrige = ...
[ "0.580675", "0.5762074", "0.5711129", "0.56438696", "0.56417966", "0.5636632", "0.56326777", "0.5596886", "0.5578826", "0.55703574", "0.5566378", "0.5551716", "0.55181897", "0.5505268", "0.5505054", "0.5487797", "0.54863197", "0.54715216", "0.5438903", "0.5429865", "0.5400317...
0.0
-1
traverses numerical node to find matching leaf node
private RegressionTreeNode traverseNumericalNode(Double v) { double val = (Double) this.value; if(v.compareTo(val) <= 0){ return this.leftChild; }else{ return this.rightChild; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int sumRootToLeafNumbers();", "public int scoreLeafNode();", "private int FixAVLtree(IAVLNode node)\r\n\t{\r\n\t\tif (node.isRealNode()) \r\n\t\t{\r\n\t\t\tif(BFCalc(node) == -2) \r\n\t\t\t{\r\n\t\t\t\t//in insert we need to fix if BFCalc(node.getLeft())==-1\r\n\t\t\t\t//in delete we need to fix if BFCalc(node...
[ "0.6008356", "0.577374", "0.5600321", "0.55934894", "0.5571244", "0.5523134", "0.54959285", "0.5453201", "0.53601635", "0.53277296", "0.5306354", "0.52526915", "0.52429104", "0.52357846", "0.52189666", "0.5209216", "0.52006966", "0.5192351", "0.5190808", "0.5161797", "0.51396...
0.5298668
11
traverses nominal node to find matching leaf node
private RegressionTreeNode traverseNominalNode(Serializable value) { if(value.equals(this.value)){ return this.leftChild; }else{ return this.rightChild; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fixAVLTree(Node node) {\n\t\tfinal int lf = getLoadFactor(node);\n\t\t//if (lf == -1 || lf == 0 || lf == 1) {\n\t\tif (lf >= -1 && lf <= 1) {\n\t\t\t// do nothing\n\t\t\treturn;\n\t\t}\t\t\n\t\trotateTree(node);\n\t}", "public void recoverTree(TreeNode root) {\n if(root == null)\n ...
[ "0.5674491", "0.5653049", "0.56218046", "0.55775404", "0.54726005", "0.5464795", "0.5400543", "0.532825", "0.5324603", "0.52687174", "0.52566075", "0.5251731", "0.52378607", "0.5205781", "0.5195405", "0.51917243", "0.5173908", "0.5163372", "0.5159947", "0.51513463", "0.511517...
0.56235236
2
sets new left child of this node
public void setLeftChild(RegressionTreeNode leftChild) { this.leftChild = leftChild; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLeftChild(TreeNode left){\n\t\tleftChild = left;\n\t}", "public void setLeftChild(Node<T> leftChild) {\n this.leftChild = leftChild;\n }", "public void setLeftChild(BinaryNode leftChild) {\n\t\tthis.leftChild = leftChild;\n\t}", "public void setLeftChild(TreeNode leftChild) {\n ...
[ "0.83084154", "0.82234514", "0.81852645", "0.8169852", "0.80874306", "0.80418766", "0.80403256", "0.7797494", "0.77971673", "0.7784631", "0.7782275", "0.7631145", "0.76292413", "0.75808954", "0.75808954", "0.75808954", "0.75808954", "0.75808954", "0.75808954", "0.75808954", "...
0.78303224
7
sets new right child of this node
public void setRightChild(RegressionTreeNode rightChild) { this.rightChild = rightChild; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void setRightChild(WhereNode rightChild) {\n\n\t}", "public void setRightChild(TreeNode right){\n\t\trightChild = right;\n\t}", "@Override\n\tpublic void setRightChild(ASTNode node) {\n\t\tthis.rightChild = node;\n\n\t}", "public void setRightChild(Node<T> rightChild) {\n this.righ...
[ "0.7792961", "0.75892824", "0.74713135", "0.7411916", "0.73788905", "0.72925246", "0.7237142", "0.71354383", "0.7057225", "0.6952203", "0.6930766", "0.6868085", "0.6835947", "0.6824757", "0.6779103", "0.6696141", "0.6665561", "0.6614685", "0.65978456", "0.6551169", "0.6545011...
0.70477283
9
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577...
0.0
-1
index of the resource to get from resList
public MummyThread(String name, int resId) { this.name = name; this.resId = resId; this.shutdown = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static int findResourceInList(List resources, String id)\n\t{\n\t\tfor (int i = 0; i < resources.size(); i++)\n\t\t{\n\t\t\t// if this is the one, return this index\n\t\t\tif (((BrowseItem) (resources.get(i))).getId().equals(id)) return i;\n\t\t}\n\n\t\t// not found\n\t\treturn -1;\n\n\t}", "public int...
[ "0.6473773", "0.6454439", "0.6328271", "0.63259184", "0.62988573", "0.6281324", "0.62772536", "0.6249967", "0.62419343", "0.62419343", "0.62117153", "0.6204525", "0.6204525", "0.6204525", "0.6201321", "0.6201321", "0.6199323", "0.6199323", "0.6199323", "0.6196109", "0.6171488...
0.0
-1
overridden in producer / consumer
@Override public void run() { do{ if(resList[resId].semaphore.tryLock()){ //gets lock and returns true if free (basically wait) try{ this.doJob(); } catch(Exception e){ //just in case System.out.println(e.toString()); } finally{ resList[resId].semaphore.unlock(); //frees resource (basically signal) } } } while(!shutdown); System.out.println(name + " stopped."); //notify that the thread has stopped. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void AsyncPush(String topic){\n\t\t\t\t \t\n\t \t/**\n\t \t * output a map, delete existed items\n\t \t */\n\t \t//Map<Key, Integer> deduplicatedBuff = mergeDuplicatedItemsAndDelte(buff);\n\t \t\n\t \t//not in, create, delay\n\t ...
[ "0.64033204", "0.63426465", "0.61502045", "0.61079", "0.6074678", "0.60518795", "0.60385615", "0.6007881", "0.59675026", "0.59452266", "0.593747", "0.59323937", "0.59023035", "0.58977556", "0.5885339", "0.58381844", "0.5828321", "0.58020693", "0.5782161", "0.57792646", "0.577...
0.0
-1
A empty service order with just the vin, techID, and dealershipID for cars that just came in so not much is know
ServiceOrder(String carVIN, int techID, int dealershipID, String serviceDate){ serviceNumber++; this.carVIN = carVIN; this.techID = techID; this.dealershipID = dealershipID; this.serviceDate = serviceDate; this.serviceDesc = "None"; this.partsUsed = "None"; this.partsCost = 0; this.totalCost = 0; this.laborHours = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ServiceOrder(String carVIN, String serviceDesc, String serviceDate, String partsUsed, int techID, int dealershipID, double partsCost, double totalCost, double laborHours){\n serviceNumber++;\n this.serviceDate = serviceDate;\n this.carVIN = carVIN;\n this.serviceDesc = serviceDesc;\n ...
[ "0.70096403", "0.59276277", "0.5772423", "0.5732867", "0.5480906", "0.54808253", "0.5461864", "0.53306675", "0.5324065", "0.53194183", "0.52921087", "0.52829725", "0.52071875", "0.52058685", "0.5192173", "0.51714015", "0.51525545", "0.51222634", "0.5118072", "0.5114578", "0.5...
0.7636433
0
a service order for when a car is leaving the service department
ServiceOrder(String carVIN, String serviceDesc, String serviceDate, String partsUsed, int techID, int dealershipID, double partsCost, double totalCost, double laborHours){ serviceNumber++; this.serviceDate = serviceDate; this.carVIN = carVIN; this.serviceDesc = serviceDesc; this.partsUsed = partsUsed; this.techID = techID; this.dealershipID = dealershipID; this.partsCost = partsCost; this.totalCost = totalCost; this.laborHours = laborHours; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ServiceOrder(String carVIN, int techID, int dealershipID, String serviceDate){\n serviceNumber++;\n this.carVIN = carVIN;\n this.techID = techID;\n this.dealershipID = dealershipID;\n this.serviceDate = serviceDate;\n this.serviceDesc = \"None\";\n this.partsUsed = ...
[ "0.6353346", "0.6052865", "0.5899312", "0.5797719", "0.5774068", "0.5552094", "0.5533782", "0.5437647", "0.5416232", "0.54075974", "0.5373799", "0.5334539", "0.52925193", "0.52900416", "0.5277955", "0.52694917", "0.5258177", "0.5250732", "0.5225811", "0.5224966", "0.5218805",...
0.59702235
2
Load file, assuming UTF8 encoding
public void load() throws IOException { mText = null; mTicks.clear(); if (mLoadTicks && isAlreadyTicked()) { File tickFile = getTickFile(false); ZipFile zip = new ZipFile(tickFile); String basename = null; // Find ticked file name from ZIP Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String name = entry.getName(); int idx = name.indexOf(TickConstants.TICK_ENTRY_EXT); if (idx != -1) { basename = name.substring(0, idx); } } // file ZipEntry fileEntry = zip.getEntry(basename); byte[] data = FileUtil.load(zip.getInputStream(fileEntry)); mText = new String(data, "UTF-8"); // registry mRegistry = new TickRegistry(); mRegistry.loadDefinitions(); // ticks ZipEntry tickEntry = zip.getEntry(basename + TickConstants.TICK_ENTRY_EXT); mTicks.addAll(loadTicks(zip.getInputStream(tickEntry))); mBasename = basename; } else { byte[] data = FileUtil.load(mFile); mText = new String(data, "UTF-8"); mBasename = mFile.getName(); // registry mRegistry = new TickRegistry(); mRegistry.loadDefinitions(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void load() {\n\t\tFileHandle file = Gdx.files.internal(DogRunner.PARENT_DIR + \"charset.txt\");\n\t\tcharset = file.readString();\n\t}", "@Test\n\tpublic void testUTF8() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new FileInputStream(U...
[ "0.7272873", "0.71061146", "0.6821409", "0.6453972", "0.64396197", "0.63558745", "0.62821734", "0.6205566", "0.61937624", "0.6069887", "0.60007185", "0.5988471", "0.5977934", "0.5927423", "0.5917506", "0.5905434", "0.5895876", "0.58907324", "0.5829466", "0.58033687", "0.57720...
0.0
-1
Load ticks from file
private List<Tick> loadTicks(InputStream pInput) throws IOException { List<Tick> result = new ArrayList<Tick>(); BufferedReader reader = new BufferedReader(new InputStreamReader(pInput)); String line; final Map<String, String> properties = new HashMap<String, String>(); while ( (line = reader.readLine()) != null) { String str = line.trim(); if (str.length() == 0 || str.startsWith("#")) { // Skip comment } else if (str.startsWith("[")) { // start new tick if (!properties.isEmpty()) { Tick tick = new Tick(); tick.restore(mRegistry, properties); result.add(tick); properties.clear(); } String name = str.substring(1, str.length() - 1); properties.put(Tick.P_TICK, name); } else if (properties != null) { // tick parameters int valueSep = str.indexOf('='); if (valueSep != -1) { String key = str.substring(0, valueSep).trim(); String value = str.substring(valueSep + 1).trim(); properties.put(key, value); } } } if (!properties.isEmpty()) { Tick tick = new Tick(); tick.restore(mRegistry, properties); result.add(tick); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void load() \n throws IOException\n {\n mText = null;\n mTicks.clear();\n \n if (mLoadTicks && isAlreadyTicked()) {\n File tickFile = getTickFile(false);\n ZipFile zip = new ZipFile(tickFile);\n\n String basename = null;\n \n ...
[ "0.71057314", "0.6176038", "0.6022164", "0.5732837", "0.5685404", "0.56670696", "0.55022866", "0.5469394", "0.5401758", "0.53991103", "0.5398615", "0.53931016", "0.5392613", "0.53297853", "0.53175575", "0.5312504", "0.5269253", "0.5260094", "0.5258074", "0.52481633", "0.52438...
0.63986313
1
Spring Data JPA repository for the LeLegalEntityTypes entity.
@SuppressWarnings("unused") @Repository public interface LeLegalEntityTypesRepository extends JpaRepository<LeLegalEntityTypes, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n@Repository\npublic interface NonConformanceTypeRepository extends JpaRepository<NonConformanceType, Long> {\n\n}", "@Repository\npublic interface EnumTypeRepository extends BaseRepository<EnumTypeBean,Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface DsC...
[ "0.64948505", "0.64867127", "0.6361164", "0.6254648", "0.62381655", "0.61375034", "0.6125435", "0.6115796", "0.60981745", "0.6086434", "0.6069913", "0.60694987", "0.6040609", "0.599542", "0.5988133", "0.5931309", "0.589343", "0.5892162", "0.5891088", "0.58886695", "0.586387",...
0.7393279
0
interface: the size of output & nums is 4 & within 0~9; used[i] is initialized to false
private void backTrack(List<List<Integer>> output, List<Integer> curList, int[] nums, boolean[] used) { // base case: if (curList.size() == 4) { // assign the output output.add(new LinkedList(curList)); } else { // recursion for (int i = 0; i < 4; i++) { // cope with the duplicate if (used[i] || i > 0 && nums[i] == nums[i - 1] && !used[i - 1]) { continue; } used[i] = true; curList.add(nums[i]); // backTrack part backTrack(output, curList, nums, used); curList.remove(curList.size() - 1); used[i] = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n ...
[ "0.596996", "0.58892065", "0.5856956", "0.5798264", "0.57815737", "0.5780085", "0.57763165", "0.57677317", "0.57599986", "0.57445943", "0.5719198", "0.56992173", "0.5699108", "0.5657415", "0.56268233", "0.5624544", "0.5619513", "0.5595805", "0.5590135", "0.55881846", "0.55835...
0.63007885
0
2nd one the output is an int[] with length 2, the 1st index && the 2nd index
public List<Integer> minLength(int[] nums) { // find the 1st index int first = 0, last = nums.length - 1; for (int i = 0; i < nums.length - 1; i++) { if (nums[i] > nums[i + 1]) { first = i; break; } } // find the 2nd index for (int i = nums.length - 1; i > 0; i--) { if (nums[i] < nums[i - 1]) { last = i; break; } } // find the maximum & minimum int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE; for (int i = first; i <= last; i++) { max = Math.max(nums[i], max); min = Math.min(nums[i], min); } // find the true index for (int i = 0; i < first; i++) { if (nums[i] > min) { first = i; break; } } for (int i = nums.length - 1; i > last; i--) { if (nums[i] < max) { last = i; break; } } List<Integer> l = new LinkedList<>(); l.add(first); l.add(last); return l; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getElementArray2(int index)\n {\n return array2[index];\n }", "public abstract int[] toIntArray();", "int[] populateArray(int[] firstArr,int[] secondArr){\n\t\tlength = firstArr.length + secondArr.length; //Getting length of the resultant array\n\t\tresultArr = new int[length]; //set re...
[ "0.6856582", "0.6787082", "0.67004085", "0.66918", "0.6559547", "0.6379492", "0.63710386", "0.6364984", "0.621051", "0.6200098", "0.61859757", "0.6184905", "0.6183265", "0.6176095", "0.6136535", "0.6111022", "0.60868824", "0.60861325", "0.604685", "0.6021218", "0.6017415", ...
0.0
-1
Initialize the population to a given size.
public void initPop(int num) { if (num % 2 == 1) { num -= 1; } this.individuals = new AI[num]; for (int i = 0; i < num; i++) this.individuals[i] = new AI(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initialize(int size);", "public void initialize(int size) {\n setMaxSize(size);\n }", "protected Population<T, K> initializePopulation(int size, Class<K> clazz)\n\t\t\tthrows InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {\n\t\tPopulation...
[ "0.80612284", "0.788445", "0.7155392", "0.70816094", "0.70364577", "0.6847475", "0.67395294", "0.6686304", "0.65351367", "0.64826185", "0.6414945", "0.64097136", "0.63949496", "0.63369197", "0.63187104", "0.63039213", "0.6295424", "0.6279839", "0.6277455", "0.6265489", "0.626...
0.0
-1
Splits the population to perform tournaments in parallel.
public void split(int cores) { int counter = 0; this.container = new AI[cores][POPULATION_SIZE / cores]; for (AI ai : this.individuals) { ai.fitness = 0; } for (int x = 0; x < cores; x++) { for (int y = 0; y < POPULATION_SIZE / cores; y++) { this.container[x][y] = this.individuals[counter]; counter++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runTournament() {\n\t\t//ArrayList<Gene> tournament = new ArrayList<Gene>();\n\t\tPriorityQueue<Gene> tournament = new PriorityQueue<Gene>(Collections.reverseOrder());\n\t\tint numContenders = (int)(FRAC_IN_TOURNAMENT * geneNumber);\n\t\tSet<Integer> chosenOnes = new HashSet<Integer>();\n\t\t\n\t\twhil...
[ "0.59466666", "0.59140044", "0.57112324", "0.55646116", "0.5556625", "0.5417826", "0.5340843", "0.53397864", "0.53011924", "0.52485156", "0.5227569", "0.5216509", "0.51801413", "0.5095126", "0.5085087", "0.5062935", "0.50570434", "0.50481296", "0.5041226", "0.5028944", "0.501...
0.52533156
9
Shuffles the population of individuals
public void shufflePop() { for (int i = 0; i < this.individuals.length; i += 2) { double random = Math.random(); int rand = (int) (this.individuals.length * random); AI temp = individuals[0]; this.individuals[0] = individuals[rand]; this.individuals[rand] = temp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void shuffle() {\n\t\tCollections.shuffle(inds);\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(Shoe);\n\t}", "public void shuffle();", "public void shuffle() {\n for (int i = size - 1; i > 0; i--) {\n swap(i, (int)(Math.random() * (i + 1)));\n }\n }", "public void shuffle(){\n...
[ "0.7232591", "0.7203722", "0.7149267", "0.71347934", "0.70139325", "0.6978778", "0.6978778", "0.6948495", "0.69216585", "0.69182235", "0.6866473", "0.68206525", "0.68183744", "0.68170977", "0.6770376", "0.67638075", "0.6758994", "0.67560863", "0.67509615", "0.67401594", "0.67...
0.7360559
0
Passes a new array of individuals back to the population class.
public void updatePop(AI[] arr) { this.individuals = arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mutate() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tpopulationArray.set(i, populationArray.get(i).generateNeighbor());\n\t\t}\n\t}", "public static void mutation(Individual[] individuals) {\n for (int i = 0; i < POP_SIZE; i++) {\n for (int j = 0; j < GENE_SIZE; j++) {\n ...
[ "0.67229044", "0.6248145", "0.5905208", "0.5889598", "0.58775777", "0.5854645", "0.58531517", "0.57672745", "0.57405597", "0.5691604", "0.56440836", "0.56304306", "0.55587363", "0.5546325", "0.55397624", "0.5538765", "0.5525868", "0.5522139", "0.5509016", "0.5506633", "0.5500...
0.67893356
0
Prints a given individual to designated file.
public void printToFile(AI input) { try { // Create file FileWriter fstream = new FileWriter(FILENAME); BufferedWriter out = new BufferedWriter(fstream); out.write(input.toString() + "\n"); // Close the output stream out.close(); } catch (Exception e) { // Catch exception if any System.err.println("Error: " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void printToFile() {\n\t\t\n\t}", "public void print() {\n\t\tSystem.out.println(\"ONOMA IDIOKTITH: \" + fname);\n\t\tSystem.out.println(\"EPWNYMO IDIOKTITH: \" + lname);\n\t\tSystem.out.println(\"DIEUTHINSH FARMAKEIOU: \" + address);\n\t\tSystem.out.println(\"THLEFWNO FARMAKEIOU: \" + teleph...
[ "0.6240942", "0.6217596", "0.6150162", "0.61186254", "0.60831606", "0.59919333", "0.5918538", "0.58806294", "0.5880196", "0.5867689", "0.5865128", "0.58497703", "0.5806006", "0.5778152", "0.5768145", "0.5766208", "0.57214826", "0.57019055", "0.5685769", "0.56767124", "0.56527...
0.5942277
6
Prints the population of every generation to a file titled by designated filename. Might be computationally expensive.
public void printPopulationToFile(int i) throws IOException { FileWriter fstream; BufferedWriter out; File f = new File(FILENAME); if (!f.isFile()) { try { // Create file fstream = new FileWriter(FILENAME); out = new BufferedWriter(fstream); out.write("Generation: " + i + "\r\n"); for (AI ai : this.individuals) { out.write(ai.toString() + "\r\n"); } // Close the output stream out.close(); } catch (Exception e) { // Catch exception if any System.err.println("Error: " + e.getMessage()); } } else { try { // append to file if file already exists fstream = new FileWriter(FILENAME, true); out = new BufferedWriter(fstream); out.write("Generation: " + i + "\r\n"); for (AI ai : this.individuals) { out.write(ai.toString() + "\r\n"); } out.close(); } catch (Exception e) { System.err.println("Error: " + e.getMessage()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toFile(String filename) {\n\t\tsortPool();\n\t\ttry (BufferedWriter bw = new BufferedWriter(new FileWriter(filename))) {\n\t\t\tfor(int i = 0; i < genepool.size(); i++) {\n\t\t\t\tbw.write(genepool.get(i).toWrite());\n\t\t\t\tbw.newLine();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(...
[ "0.7024915", "0.6673083", "0.6471239", "0.6422034", "0.6411737", "0.61551553", "0.61059797", "0.59406614", "0.59298736", "0.5927084", "0.5920488", "0.5905651", "0.58804584", "0.5858048", "0.58388495", "0.5832265", "0.5830726", "0.58191675", "0.58149254", "0.5811971", "0.58111...
0.78238404
0
Since many of the individuals in population have same fitness, we will perform one more tournament.
public void printBestIndividual() { System.out.println("Finalizing"); QuoridorBoard board; for (int t = 0; t < (Math.log(individuals.length) / Math.log(2)); t++) { for (int i = 0; i < individuals.length - 1; i++) { if (individuals[i].fitness == t) { for (int j = i + 1; j < individuals.length; j++) { if (individuals[j].fitness == t) { board = new QuoridorBoard(individuals[i], individuals[j]); board.play(); if (board.getWinner() != null) { AI winner = board.getWinner(); AI loser = board.getLoser(); winner.fitness++; individuals[i] = winner; individuals[j] = loser; } break; } } } } } try { FileWriter fstream = new FileWriter("evoOutput.txt"); BufferedWriter out = new BufferedWriter(fstream); int max1 = 0; int max2 = 0; AI best1 = new AI(); AI best2 = new AI(); for (AI ai : individuals) { if (ai.fitness > max1) { max1 = ai.fitness; best1 = ai.clone(); } else if (ai.fitness > max2) { max2 = ai.fitness; best2 = ai.clone(); } } out.write(best1.outputString() + "\r\n" + best2.outputString() + "\r\n"); out.close(); System.out.println("Done"); } catch (Exception e) { System.err.println("Error: " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runTournament() {\n\t\t//ArrayList<Gene> tournament = new ArrayList<Gene>();\n\t\tPriorityQueue<Gene> tournament = new PriorityQueue<Gene>(Collections.reverseOrder());\n\t\tint numContenders = (int)(FRAC_IN_TOURNAMENT * geneNumber);\n\t\tSet<Integer> chosenOnes = new HashSet<Integer>();\n\t\t\n\t\twhil...
[ "0.81174314", "0.7890193", "0.72546154", "0.7254499", "0.7248957", "0.70296127", "0.69970524", "0.6848246", "0.6827707", "0.68226886", "0.6763179", "0.67245334", "0.66572976", "0.66223395", "0.66216946", "0.65907997", "0.65371466", "0.6507709", "0.6486128", "0.6468996", "0.63...
0.647314
19
/ AccountDao adao = new AccountDao(); adao.insert(new Account("Sample Account", 12345L, AccountType.debit,14)); adao.insert(new Account("Sample Account2", 12345L, AccountType.credit,3)); Create and Insert a sample element into the Transaction table / TypeDao typeDao = new TypeDao(); Type type = new Type("one"); typeDao.insert(type); TransactionDao dao = new TransactionDao(); dao.insert(new Transaction("Sample Transaction", type, Math.round(Math.random() 50), "Sample Description", new Date())); Set the title of the application
@Override public void start(Stage primaryStage) throws Exception { primaryStage.setTitle("MyMoney Application"); // Set the scene of the application to the new Scene primaryStage.setScene(createScene()); primaryStage.setResizable(true); // Display the Stage primaryStage.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void insertDemoData() throws SQLException\n {\n insertAccount(new Account(0, \"John Doe\", \"Marvin Gardens\", false));\n insertAccount(new Account(0, \"Robert Roe\", \"Louisiana Avenue\", false));\n }", "private void addSomeItemsToDB () throws Exception {\n/*\n Position ...
[ "0.6657685", "0.66476685", "0.6568574", "0.65552837", "0.65400016", "0.6507349", "0.6482898", "0.6457468", "0.64538234", "0.6385716", "0.6385461", "0.6375739", "0.635887", "0.63566387", "0.6315301", "0.6313687", "0.63115126", "0.62886715", "0.6269423", "0.626341", "0.6262515"...
0.0
-1
remove DefaultUIProvider instances to avoid mapping extraneous UIs if e.g. a servlet is declared as a nested class in a UI class
@Override public void sessionInit(SessionInitEvent event) throws ServiceException { VaadinSession session = event.getSession(); final String DefaultUiProviderCanonicalName = DefaultUIProvider.class.getCanonicalName(); for (UIProvider uiProvider : session.getUIProviders()) { // use canonical names as these may have been loaded with // different classloaders if (DefaultUiProviderCanonicalName.equals(uiProvider.getClass().getCanonicalName())) { session.removeUIProvider(uiProvider); } } //set the GuiceUIProvider session.addUIProvider(this.guiceUIProvider); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Form removeDefaultRendererForElementClass(Class<? extends Element> clazz);", "private UIManager() {\n tableUI = new TableUI();\n snifferUI = new SnifferUI();\n }", "public abstract void removeUI(BaseConfigInstance pPCI);", "@Override\r\n\tpublic Panel getUI() {\n\t\treturn null;\r\n\t}", "...
[ "0.5926586", "0.5557083", "0.5472249", "0.54544705", "0.54544705", "0.54366916", "0.54291904", "0.5416696", "0.532904", "0.5305391", "0.52869797", "0.52415776", "0.5184138", "0.5175846", "0.51497114", "0.51232564", "0.5100436", "0.5092297", "0.50890654", "0.50835544", "0.5081...
0.57923067
1
Gets the single instance of InfoCommand.
public static InfoCommand getInstance(){ return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CommandInfo getInfo() {\n\t\treturn info;\n\t}", "public InfoCommand() {\n\n\t\tsuper(\"info\", Command.ArgumentType.NONE, Command.Category.UTILITY);\n\t}", "public InfoCommand() {\n super(\"info\", \"info <Spieler>\", \"Gib dir Informationen über den Chunk oder Spieler\", SubCommand.NONE_PERMISS...
[ "0.79147655", "0.73374814", "0.6680813", "0.66454756", "0.610843", "0.5955623", "0.58979106", "0.58581126", "0.5849891", "0.5833743", "0.5801596", "0.5785148", "0.57815486", "0.577842", "0.5773068", "0.57581884", "0.57581884", "0.5753124", "0.5751345", "0.5750762", "0.5732847...
0.7995438
0
Instantiates a new info command.
private InfoCommand() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public InfoCommand() {\n\n\t\tsuper(\"info\", Command.ArgumentType.NONE, Command.Category.UTILITY);\n\t}", "public InfoCommand() {\n super(\"info\", \"info <Spieler>\", \"Gib dir Informationen über den Chunk oder Spieler\", SubCommand.NONE_PERMISSION);\n }", "public Info() {\n super();\n ...
[ "0.85030675", "0.8149069", "0.7056777", "0.6770325", "0.6732298", "0.6589024", "0.65332764", "0.65196186", "0.64348626", "0.6362519", "0.62794566", "0.6260401", "0.6227391", "0.6205466", "0.6142277", "0.60754186", "0.6058675", "0.59511095", "0.5950633", "0.59145963", "0.59061...
0.81815666
1
Parses the metadata flac.
void parseMetadataFlac(String pathToAudioFile) { AudioFile f = null; try { f = AudioFileIO.read(new File(pathToAudioFile)); } catch (CannotReadException e) { System.err.println("ParseMedataFlac CannotReadException"+e); setExecutionType("Exception"); } catch (IOException e) { System.err.println("ParseMedataFlac IOException"+e); setExecutionType("Exception"); } catch (TagException e) { System.err.println("ParseMedataFlac TagException"+e); setExecutionType("Exception"); } catch (ReadOnlyFileException e) { System.err.println("ParseMedataFlac ReadOnlyException"+e); setExecutionType("Exception"); } catch (InvalidAudioFrameException e) { System.err.println("ParseMedataFlac InvalidAudioFrameException"+e); setExecutionType("Exception"); } Tag tag = f.getTag(); try{ this.setTitle(tag.getFirst(FieldKey.TITLE)); this.setAlbum(tag.getFirst(FieldKey.ALBUM)); this.setArtist(tag.getFirst(FieldKey.ARTIST)); this.setComposer(tag.getFirst(FieldKey.COMPOSER)); this.setGenre(tag.getFirst(FieldKey.GENRE)); this.setPath(pathToAudioFile); setExecutionType("ok"); } catch(UnsupportedOperationException e){ System.err.println("ParseMedataFlac UnsupportedOperationException"+e); setExecutionType("Exception"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initMetadata() throws IOException {\n \n // start by reading the file header\n in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n metadata.put(\"Byte Order\", new...
[ "0.6962022", "0.6617808", "0.64871913", "0.6417733", "0.63672435", "0.6260404", "0.61522484", "0.6119156", "0.6012388", "0.5965924", "0.5886469", "0.5885803", "0.5858819", "0.5807113", "0.5667707", "0.5569637", "0.5557592", "0.5543503", "0.553895", "0.5498574", "0.5494807", ...
0.69818574
0
Parses the metadata mp3.
void parseMetadataMp3(String pathToAudioFile, String parameters){ try{ Parser parser=null; InputStream input=null; if(Pattern.matches("(.)+.mp3", parameters)){ parser = new Mp3Parser(); input=new FileInputStream(new File(pathToAudioFile)); } ContentHandler handler = new DefaultHandler(); Metadata metadata = new Metadata(); ParseContext parseCtx= new ParseContext(); parser.parse(input,handler,metadata,parseCtx); this.setTitle(metadata.get("title")); this.setAlbum(metadata.get("xmpDM:album")); this.setArtist(metadata.get("xmpDM:artist")); this.setComposer(metadata.get("xmpDM:composer")); this.setGenre(metadata.get("xmpDM:genre")); this.setPath(pathToAudioFile); setExecutionType("ok"); } catch(FileNotFoundException e){ System.err.println("ParseMedataMp3 FileNotFoundException"+e); setExecutionType("Exception"); }catch (IOException e){ System.err.println("ParseMedataMp3 IOException"+e); setExecutionType("Exception"); }catch(SAXException e){ System.err.println("ParseMedataMp3 SAXEException"+e); setExecutionType("Exception"); }catch(TikaException e){ System.err.println("ParseMedataMp3 TikaException"+e); setExecutionType("Exception"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getAlbum(File mp3){\n\t\tString tempString = \"\";\n\t InputStream input;\n\t ContentHandler handler = new DefaultHandler();\n\t Metadata metadata = new Metadata();\n\t Parser parser = new Mp3Parser();\n\t ParseContext parseCtx = new ParseContext();\n\t \n\t\ttry {\n\t\t\tinput = n...
[ "0.6820754", "0.6699472", "0.6376671", "0.6254576", "0.6252274", "0.60907733", "0.60876924", "0.58403915", "0.5792162", "0.57461846", "0.572713", "0.56824636", "0.56483227", "0.5614204", "0.5583717", "0.5558819", "0.55524886", "0.5516306", "0.5515414", "0.54570436", "0.541759...
0.7748263
0
Gets the execution type.
public String getExecutionType() { return executionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ExecutionType executionType() {\n return this.executionType;\n }", "public int getExecutionType() {\n\t\treturn 0;\n\t}", "public Class getRunTimeType() {\n return lho.getRuntimeType();\n }", "public Executable.ExecKind getExecKind() {\n\t\t\treturn ((TSExecutable)this.getTypeSpec(...
[ "0.8263217", "0.78576165", "0.75507325", "0.69559014", "0.69282407", "0.6834094", "0.67429197", "0.6719744", "0.6641405", "0.6586083", "0.65576255", "0.65575665", "0.6552494", "0.64242125", "0.6329066", "0.6308312", "0.6286232", "0.6285029", "0.6282359", "0.62108", "0.6172917...
0.85768443
0
Sets the execution type.
public void setExecutionType(String executionType) { this.executionType = executionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getExecutionType() {\n\t\treturn executionType;\n\t}", "@Override\n\tpublic void setRunType(java.lang.String runType) {\n\t\t_scienceApp.setRunType(runType);\n\t}", "final public void setType(String type)\n {\n setProperty(TYPE_KEY, (type));\n }", "public void set_type(String t)\n {\n ...
[ "0.6650202", "0.64997846", "0.6469655", "0.64407474", "0.6388743", "0.63777566", "0.6371345", "0.63314044", "0.63251996", "0.6307401", "0.63050205", "0.63016766", "0.63016766", "0.63016766", "0.6300728", "0.62503177", "0.6244735", "0.62251645", "0.6216384", "0.6213301", "0.62...
0.7735261
0
Created by Naeem Ibrahim on 10/17/2016.
public interface OnLoadMoreListener { void onLoadMore(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpu...
[ "0.6356007", "0.63338655", "0.609262", "0.6048923", "0.5972795", "0.5928356", "0.5928356", "0.5906302", "0.5901564", "0.5901564", "0.5901564", "0.5901564", "0.5901564", "0.5901564", "0.58808374", "0.58808374", "0.58654755", "0.58522284", "0.5848182", "0.5838211", "0.5800012",...
0.0
-1
capturando valores del form
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String nombre = request.getParameter("nombre"); String descripcion = request.getParameter("descripcion"); String cantidad = request.getParameter("cantidad"); String precio = request.getParameter("precio"); String pago = request.getParameter("pago"); //creando objeto del costructor modelo.ventas venta = new modelo.ventas(); //almacenando datos en las variables con el constructor venta.setNombre(nombre); venta.setDescripcion(descripcion); venta.setCantidad(Integer.parseInt(cantidad)); venta.setPrecio(Double.parseDouble(precio)); venta.setPago(Integer.parseInt(pago)); //creando objeto para guardar cliente modelo.addVenta addventa = new modelo.addVenta(); try { addventa.agrega(venta); } catch (SQLException ex) { Logger.getLogger(formVenta.class.getName()).log(Level.SEVERE, null, ex); } response.sendRedirect("ventas");//si se guarda exitosamente se redirecciona a membresia }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readForm() {\n }", "public void limpiarCamposFormBusqueda() {\n\t}", "void storeFormState();", "private void processFormField(FileItem item) {\n if (item.isFormField()) {\n String name = item.getFieldName();\n String value = item.getString();\n log(\"na...
[ "0.6806757", "0.6633384", "0.58621895", "0.5855404", "0.58400744", "0.5785399", "0.57675904", "0.5744769", "0.5729344", "0.56534404", "0.56481045", "0.5629684", "0.5627266", "0.56164086", "0.55687255", "0.5527424", "0.55266815", "0.55195606", "0.54977566", "0.54806685", "0.54...
0.0
-1
Method to parse the csv file and return list of Lender objects
public List<Lender> readCSVFile(String path){ List<Lender> inputList = new ArrayList<>(); try{ File inputF = new File(path); InputStream inputFS = new FileInputStream(inputF); BufferedReader br = new BufferedReader(new InputStreamReader(inputFS)); // skip the header of the csv inputList = br.lines().skip(1).map(mapToItem).collect(Collectors.toList()); br.close(); } catch (IOException e) { throw new QuoteException("Error reading the csv file", e); } return inputList ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadListFromCsv() {\n List<Publication> list = new ArrayList<>();\n String line;\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(\"saves/data.csv\"))){\n while ((line = bufferedReader.readLine()) != null){\n String[] attributes = li...
[ "0.6655667", "0.6651281", "0.65776753", "0.65264034", "0.6221155", "0.618167", "0.61750364", "0.6161453", "0.6104785", "0.6097387", "0.6085629", "0.6066541", "0.6064003", "0.6055827", "0.6042803", "0.6025385", "0.59851867", "0.59638435", "0.59161204", "0.5915106", "0.5880768"...
0.6874808
0
test the preflight is working
@Test public void testPreflight() throws Exception { final HttpResponse response = Request.Options("http://localhost:" + httpPort.getValue() + CORS_CONFIGURED_ENDPOINT_PATH) .addHeader("Origin", CORS_TEST_ORIGIN) .addHeader(HttpHeaders.Names.ACCESS_CONTROL_REQUEST_METHOD, "GET") .addHeader(HttpHeaders.Names.ACCESS_CONTROL_REQUEST_HEADERS, "X-Allow-Origin") .execute().returnResponse(); Header allowOrigin = response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN); Header allowMethods = response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_METHODS); assertNotNull(allowOrigin); assertNotNull(allowMethods); assertThat(allowOrigin.getValue(), equalTo(CORS_TEST_ORIGIN)); assertThat(allowMethods.getValue(), containsString("GET")); assertThat(allowMethods.getValue(), containsString("PUT")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n void preFlightTestFromAllowedOrigin() {\n ResponseSpec response = client.options()\n .uri(BASE_GUESTBOOK_URL)\n .header(\"Access-Control-Request-Method\", \"GET\")\n .header(\"Origin\", ...
[ "0.6990167", "0.6845425", "0.66727465", "0.654138", "0.62786746", "0.6211294", "0.61422396", "0.61034095", "0.60768837", "0.6026654", "0.60249853", "0.6021717", "0.60205984", "0.5982409", "0.59256977", "0.59157264", "0.59077084", "0.58940667", "0.5861284", "0.5850688", "0.582...
0.7663189
0
configure any origin some not allowed method even without preflight we should be allowed to access the resource
@Test public void testPublicResource() throws Exception { final HttpResponse response = Request.Post("http://localhost:" + httpPort.getValue() + CORS_PUBLIC_ENDPOINT_PATH).addHeader("Origin", "null").execute().returnResponse(); assertNotNull("Response should not be null", response); //allow origin should be * Header allowOrigin = response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN); assertNotNull(allowOrigin); assertThat(allowOrigin.getValue(), equalTo("*")); assertThat(IOUtils.toString(response.getEntity().getContent()), equalTo(EXPECTED_RETURN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPreflight() throws Exception {\n final HttpResponse response = Request.Options(\"http://localhost:\" + httpPort.getValue() + CORS_CONFIGURED_ENDPOINT_PATH)\n .addHeader(\"Origin\", CORS_TEST_ORIGIN)\n .addHeader(HttpHeaders.Names.ACCESS_CONTROL_REQUES...
[ "0.7367805", "0.71910596", "0.7064029", "0.6846067", "0.6800219", "0.679093", "0.6764577", "0.6682165", "0.66686046", "0.663499", "0.6617998", "0.6605534", "0.6482055", "0.64345294", "0.63636655", "0.6294205", "0.6251003", "0.6246772", "0.608295", "0.6050665", "0.6043714", ...
0.60475713
20
send a request to get (no preflight)
@Test public void testDefaultOriginMethod() throws Exception { final HttpResponse response = Request.Get("http://localhost:" + httpPort.getValue() + CORS_DEFAULT_ENDPOINT_PATH).addHeader("Origin", CORS_DEFAULT_ORIGIN).execute().returnResponse(); assertNotNull("Response should not be null", response); //we should have an access control allow origin assertNotNull("Allowed origin should be present", response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN)); assertThat(IOUtils.toString(response.getEntity().getContent()), equalTo(EXPECTED_RETURN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpResponse sendGet() throws Exception {\n // Create the Call using the URL\n HttpGet http = new HttpGet(url);\n // Set the credentials set earlier into the headers\n Header header = new BasicScheme(StandardCharsets.UTF_8).authenticate(creds, http, null);\n // Set...
[ "0.72099185", "0.6887084", "0.6577497", "0.6456418", "0.64498824", "0.64131236", "0.6404304", "0.6390762", "0.6385095", "0.6383808", "0.63729286", "0.6361075", "0.63253754", "0.6189557", "0.6171696", "0.61331344", "0.6086774", "0.60610867", "0.605252", "0.6019567", "0.6010914...
0.0
-1
send a method not allowed and verify the module is filtering the request send a request to get (no preflight)
@Test public void testDefaultOriginMethodNotAllowed() throws Exception { final HttpResponse response = Request.Post("http://localhost:" + httpPort.getValue() + CORS_DEFAULT_ENDPOINT_PATH).addHeader("Origin", CORS_DEFAULT_ORIGIN).execute().returnResponse(); //a well behaved client should have sent a preflight //but we don't want to be well behaved assertNull("Allowed origin should NOT be present", response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN)); //the payload should NOT be the expected response assertThat(IOUtils.toString(response.getEntity().getContent()), not(equalTo(EXPECTED_RETURN))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkRequest(Request req) throws MethodNotAllowed, NotFound {\n if (!req.getHeader(\"Method\").equals(\"GET\") ||\n !req.getHeader(\"Version\").equals(\"HTTP/1.1\")) {\n throw new MethodNotAllowed();\n }\n if (req.getHeader(\"Path\").endsWith(\"/\")) {\n ...
[ "0.6732682", "0.65733624", "0.63028854", "0.6264074", "0.62572175", "0.61559224", "0.61428154", "0.60955983", "0.6054059", "0.6047982", "0.6040786", "0.6031932", "0.59859055", "0.5976106", "0.59505546", "0.5902872", "0.5899868", "0.58991176", "0.58926123", "0.58922", "0.58751...
0.5905127
15
this is a valid scenario but it seems it produces some exceptions.
@Test public void testEmptyConfigPublicResource() throws Exception { final HttpResponse response = Request.Options("http://localhost:" + httpPort.getValue() + CORS_PUBLIC_EMPTY_ENDPOINT_PATH).addHeader("Origin", CORS_TEST_ORIGIN) .addHeader(HttpHeaders.Names.ACCESS_CONTROL_REQUEST_METHOD, "GET").execute().returnResponse(); Header allowOrigin = response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN); Header allowMethods = response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_METHODS); assertNotNull(allowOrigin); assertThat(allowOrigin.getValue(), equalTo("*")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void m9741j() throws cf {\r\n }", "@Test(timeout = 4000)\n public void test069() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.mutatesStructure((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerExceptio...
[ "0.6095937", "0.6022495", "0.59587806", "0.5872536", "0.58521444", "0.5846407", "0.5841461", "0.58392644", "0.5838282", "0.58230364", "0.5816015", "0.5799414", "0.5792861", "0.5791694", "0.5788395", "0.57820004", "0.5775838", "0.5773899", "0.57708186", "0.5764437", "0.5763454...
0.0
-1
send a request to get (no preflight)
@Test public void testExceptionThrown() throws Exception { final HttpResponse response = Request.Get("http://localhost:" + httpPort.getValue() + CORS_EXCEPTION_ENDPOINT_PATH).addHeader("Origin", CORS_DEFAULT_ORIGIN).execute().returnResponse(); assertNotNull("Response should not be null", response); //we should have an access control allow origin assertNotNull("Allowed origin should be present", response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpResponse sendGet() throws Exception {\n // Create the Call using the URL\n HttpGet http = new HttpGet(url);\n // Set the credentials set earlier into the headers\n Header header = new BasicScheme(StandardCharsets.UTF_8).authenticate(creds, http, null);\n // Set...
[ "0.72099185", "0.6887084", "0.6577497", "0.6456418", "0.64498824", "0.64131236", "0.6404304", "0.6390762", "0.6385095", "0.6383808", "0.63729286", "0.6361075", "0.63253754", "0.6189557", "0.6171696", "0.61331344", "0.6086774", "0.60610867", "0.605252", "0.6019567", "0.6010914...
0.0
-1
send a request to get (no preflight)
@Test public void testExceptionThrownInFlowRef() throws Exception { final HttpResponse response = Request.Get("http://localhost:" + httpPort.getValue() + CORS_MAIN_FLOW_ENDPOINT_PATH) .addHeader("Origin", CORS_DEFAULT_ORIGIN).execute().returnResponse(); assertNotNull("Response should not be null", response); //we should have an access control allow origin assertNotNull("Allowed origin should be present", response.getFirstHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpResponse sendGet() throws Exception {\n // Create the Call using the URL\n HttpGet http = new HttpGet(url);\n // Set the credentials set earlier into the headers\n Header header = new BasicScheme(StandardCharsets.UTF_8).authenticate(creds, http, null);\n // Set...
[ "0.72099185", "0.6887084", "0.6577497", "0.6456418", "0.64498824", "0.64131236", "0.6404304", "0.6390762", "0.6385095", "0.6383808", "0.63729286", "0.6361075", "0.63253754", "0.6189557", "0.6171696", "0.61331344", "0.6086774", "0.60610867", "0.605252", "0.6019567", "0.6010914...
0.0
-1
Creates new form AddItems
public AddItems() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addToList(View view) {\n Items newItem = new Items();\n EditText ETNew = (EditText) findViewById(R.id.ETNew);\n newItem.todo = ETNew.getText().toString();\n newItem.done = false;\n helper.create(newItem);\n Toast.makeText(this, \"Item added\", Toast.LENGTH_SHOR...
[ "0.7134488", "0.69429517", "0.69410306", "0.6910472", "0.68333596", "0.68022597", "0.6780334", "0.6766328", "0.6697094", "0.66698146", "0.66531205", "0.65933484", "0.65704376", "0.65308315", "0.6475625", "0.64546", "0.6425732", "0.64250124", "0.6422926", "0.64015007", "0.6389...
0.6941532
2
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); num1 = new javax.swing.JButton(); num2 = new javax.swing.JButton(); num3 = new javax.swing.JButton(); num4 = new javax.swing.JButton(); num5 = new javax.swing.JButton(); num6 = new javax.swing.JButton(); num7 = new javax.swing.JButton(); txtQ = new javax.swing.JTextField(); add = new javax.swing.JButton(); num8 = new javax.swing.JButton(); num9 = new javax.swing.JButton(); num0 = new javax.swing.JButton(); exit = new javax.swing.JButton(); clear = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); num1.setText("1"); num1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num1ActionPerformed(evt); } }); num2.setText("2"); num2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num2ActionPerformed(evt); } }); num3.setText("3"); num3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num3ActionPerformed(evt); } }); num4.setText("4"); num4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num4ActionPerformed(evt); } }); num5.setText("5"); num5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num5ActionPerformed(evt); } }); num6.setText("6"); num6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num6ActionPerformed(evt); } }); num7.setText("7"); num7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num7ActionPerformed(evt); } }); txtQ.setText("0"); add.setText("Add"); add.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addActionPerformed(evt); } }); num8.setText("8"); num8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num8ActionPerformed(evt); } }); num9.setText("9"); num9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num9ActionPerformed(evt); } }); num0.setText("0"); num0.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { num0ActionPerformed(evt); } }); exit.setText("Exit"); exit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitActionPerformed(evt); } }); clear.setText("Clear"); clear.setToolTipText(""); clear.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(num0) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(add, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(num7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(num8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(num9))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(txtQ, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(num4) .addGap(6, 6, 6) .addComponent(num5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(num6)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(num1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(num2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(num3)))))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(clear) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(exit))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(txtQ, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(num2) .addComponent(num3) .addComponent(num1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(num6) .addComponent(num5) .addComponent(num4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(num7) .addComponent(num8) .addComponent(num9)) .addGap(9, 9, 9) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(num0) .addComponent(add)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(exit) .addComponent(clear)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 27, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73191476", "0.72906625", "0.72906625", "0.72906625", "0.72860986", "0.7248112", "0.7213479", "0.72078276", "0.7195841", "0.71899796", "0.71840525", "0.7158498", "0.71477973", "0.7092748", "0.70800966", "0.70558053", "0.69871384", "0.69773406", "0.69548076", "0.69533914", "...
0.0
-1
Default constructor for Price, sets the price at 0.00, the date to the current time and the company to null.
public MF_Price() { this.price = 0.00; this.date = (Date) Calendar.getInstance().getTime(); this.company = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MF_Price(double price, Date date) {\r\n\t\tthis.price = price;\r\n\t\tthis.date = date;\r\n\t\tthis.company = null;\r\n\t}", "public MF_Price(double price, String company) {\r\n\t\tthis.price = price;\r\n\t\tthis.company = company;\r\n\t\tthis.date = Calendar.getInstance().getTime();\r\n\t}", "public Pr...
[ "0.7575942", "0.74350774", "0.7058853", "0.6751901", "0.6719419", "0.6575236", "0.65331024", "0.651993", "0.648403", "0.64091563", "0.64039826", "0.62650335", "0.6245917", "0.6234246", "0.61784923", "0.61465466", "0.61198276", "0.61142784", "0.6113581", "0.61111283", "0.61087...
0.8442495
0
Constructor for Price. Company is set to null.
public MF_Price(double price, Date date) { this.price = price; this.date = date; this.company = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MF_Price() {\r\n\t\tthis.price = 0.00;\r\n\t\tthis.date = (Date) Calendar.getInstance().getTime();\r\n\t\tthis.company = null;\r\n\t}", "public MF_Price(double price, String company) {\r\n\t\tthis.price = price;\r\n\t\tthis.company = company;\r\n\t\tthis.date = Calendar.getInstance().getTime();\r\n\t}", ...
[ "0.75586385", "0.7535797", "0.7019509", "0.70100343", "0.6991913", "0.69147927", "0.657338", "0.65311617", "0.65212274", "0.65060526", "0.64277375", "0.636171", "0.6327287", "0.630927", "0.62792593", "0.62792593", "0.62722445", "0.62722445", "0.6265976", "0.62494427", "0.6225...
0.7230914
2
Constructor for Price. Date is set to the current date and time.
public MF_Price(double price, String company) { this.price = price; this.company = company; this.date = Calendar.getInstance().getTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MF_Price(double price, Date date) {\r\n\t\tthis.price = price;\r\n\t\tthis.date = date;\r\n\t\tthis.company = null;\r\n\t}", "public MF_Price() {\r\n\t\tthis.price = 0.00;\r\n\t\tthis.date = (Date) Calendar.getInstance().getTime();\r\n\t\tthis.company = null;\r\n\t}", "public void setPrice(Date price) {...
[ "0.77914673", "0.7469642", "0.69378716", "0.6619818", "0.6578954", "0.64914894", "0.6478292", "0.64397347", "0.63990813", "0.6342337", "0.62622726", "0.62368417", "0.6212013", "0.6202839", "0.62021554", "0.61549205", "0.6143758", "0.6134989", "0.61206424", "0.6119553", "0.609...
0.63890344
9
Returns the price of the Price object
public double getPrice() { return this.price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Money getPrice() {\n\t\treturn price;\n\t}", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }", "public Money getPrice() {\n return price;\n }", "public Double getPrice() {\r\n return price;\r\n }", "public double g...
[ "0.80891204", "0.80774534", "0.80774534", "0.807133", "0.806516", "0.80511945", "0.8037765", "0.8037765", "0.8036534", "0.8036534", "0.8036534", "0.8036534", "0.8036534", "0.8034811", "0.8029292", "0.8012928", "0.8012928", "0.8012928", "0.8012928", "0.80112785", "0.8004455", ...
0.78611577
61
Returns the date and time associated with this Price object.
public Date getDate() { return this.date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Date getOrderTime();", "public Date getEventTime() {\n\t\treturn time;\n\t}", "public Date getBuy_time() {\r\n\t\treturn buy_time;\r\n\t}", "public String getTime() {\n return dateTime.format(c.getTime());\n }", "public Date time() {\n return _time;\n }", "public Date t...
[ "0.71275896", "0.70679176", "0.7005854", "0.6990938", "0.69661754", "0.69661754", "0.69552934", "0.6952201", "0.6937096", "0.6897667", "0.68869245", "0.68869245", "0.68784535", "0.68739396", "0.68436575", "0.68418366", "0.68411225", "0.68411225", "0.68411225", "0.68411225", "...
0.0
-1
TODO: getDate that returns a string here. Set the price of this Price object
public void setPrice(double price) { this.price = price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPrice(double price)\n {\n this.price = price;\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n }", "public void setPrice(double price) {\r\n this.price = price;\r\n ...
[ "0.81821305", "0.8169151", "0.8169151", "0.8169151", "0.81568843", "0.8137556", "0.8137556", "0.8137556", "0.8137556", "0.8137556", "0.8137556", "0.8137556", "0.8064742", "0.8046877", "0.80352277", "0.7996039", "0.7975971", "0.7975971", "0.7950742", "0.79484147", "0.79484147"...
0.7979231
17
Set the date object associated with the price from java.util.date
public void setDate(Date date) { this.date = date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPrice(Date price) {\n this.price = price;\n }", "void setDate(Date data);", "public void SetDate(Date date);", "public void setServiceDate(java.util.Date value);", "public MF_Price(double price, Date date) {\r\n\t\tthis.price = price;\r\n\t\tthis.date = date;\r\n\t\tthis.company = ...
[ "0.79007477", "0.7308866", "0.7210995", "0.7093392", "0.7016359", "0.6898449", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.68672603", "0.6830915", "0.6805431", "0.67772484", "0.671422", "0.671422", "0.6714...
0.6806974
18
Set the date object associated with the price using an epoch timestamp.
public void setDate(long date) { this.date = new Date(date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEpochDate( String pEpochDate ) {\n mEpochDate = pEpochDate;\n }", "public void setDate(long value) {\n this.date = value;\n }", "public void setPrice(Date price) {\n this.price = price;\n }", "public abstract void setDate(Timestamp uneDate);", "void setDate(Date data);", ...
[ "0.67036706", "0.6677921", "0.6647821", "0.6636595", "0.64378726", "0.6128006", "0.6096323", "0.60683924", "0.6045989", "0.5986934", "0.5981159", "0.5903701", "0.58926535", "0.5876467", "0.5876467", "0.5876467", "0.58672154", "0.58238477", "0.58214134", "0.5812262", "0.580509...
0.6317789
5
Set the date associated with the price from java.util.date Returns the name of the company where the price was found.
public String getCompany() { return company; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPrice(Date price) {\n this.price = price;\n }", "public MF_Price(double price, Date date) {\r\n\t\tthis.price = price;\r\n\t\tthis.date = date;\r\n\t\tthis.company = null;\r\n\t}", "public void setCarbuydate(Date carbuydate) {\n this.carbuydate = carbuydate;\n }", "public v...
[ "0.67745936", "0.6474492", "0.63036066", "0.61712086", "0.59812903", "0.5776619", "0.5763828", "0.57501173", "0.5741603", "0.57342196", "0.57342196", "0.57342196", "0.57309514", "0.57309514", "0.57309514", "0.57309514", "0.57309514", "0.57309514", "0.57309514", "0.57309514", ...
0.0
-1
Sets the name of the company where the price was found.
public void setCompany(String company) { this.company = company; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCompanyName(String name) {\n this.companyName = name;\n }", "public void setCompanyname(java.lang.String newCompanyname) {\n\tcompanyname = newCompanyname;\n}", "public void setCompany(String company)\r\n {\r\n m_company = company;\r\n }", "public void setCompany(String comp...
[ "0.73885494", "0.72693855", "0.7251847", "0.7112902", "0.70430744", "0.70430744", "0.6958958", "0.6893097", "0.6893097", "0.6880292", "0.68596303", "0.6808528", "0.669248", "0.6591443", "0.65901595", "0.65273887", "0.6511303", "0.64898837", "0.6489414", "0.6400948", "0.637707...
0.696432
6
This method is called when the camera is opened. We start camera preview here.
@Override public void onOpened(@NonNull CameraDevice cameraDevice) { mCameraOpenCloseLock.release(); mCameraDevice = cameraDevice; createCameraPreviewSession(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onOpened(CameraDevice camera) {\n Log.e(TAG, \"onOpened\");\n mCameraDevice = camera;\n startPreview();\n }", "private void startPreview() {\n if (cameraConfigured && camera!=null) {\n camera.startPreview();\n inP...
[ "0.86213505", "0.85156125", "0.8437926", "0.8437926", "0.83570015", "0.8355303", "0.82500905", "0.82500905", "0.81772125", "0.81553966", "0.80677384", "0.78405875", "0.7790925", "0.77318037", "0.7727357", "0.76684874", "0.7660506", "0.765517", "0.7622267", "0.7575925", "0.754...
0.773878
13
User RokidCameraBuilder to create an instance of RokidCamera
RokidCamera(RokidCameraBuilder rokidCameraBuilder) { this(rokidCameraBuilder.getActivity(), rokidCameraBuilder.getTextureView()); this.mRokidCameraStateListener = rokidCameraBuilder.getRokidCameraStateListener(); this.mRokidCameraIOListener = rokidCameraBuilder.getRokidCameraIOListener(); this.mRokidCameraRecordingListener = rokidCameraBuilder.getRokidCameraRecordingListener(); this.mRokidCameraOnImageAvailableListener = rokidCameraBuilder.getRokidCameraOnImageAvailableListener(); this.mImageReaderCallbackMode = rokidCameraBuilder.getImageReaderCallbackMode(); this.mPreviewEnabled = rokidCameraBuilder.isPreviewEnabled(); this.mImageFormat = rokidCameraBuilder.getImageFormat(); this.mMaxImages = rokidCameraBuilder.getMaxImages(); this.mSizePreview = rokidCameraBuilder.getRokidCameraSizePreview(); this.mSizeImageReader = rokidCameraBuilder.getRokidCameraSizeImageReader(); this.mSizeVideoRecorder = rokidCameraBuilder.getRokidCameraSizeVideoRecorder(); this.mRokidCameraParamAFMode = rokidCameraBuilder.getRokidCameraParamAFMode(); this.mRokidCameraParamAEMode = rokidCameraBuilder.getRokidCameraParamAEMode(); this.mRokidCameraParamAWBMode = rokidCameraBuilder.getRokidCameraParamAWBMode(); this.mRokidCameraParamCameraId = rokidCameraBuilder.getRokidCameraParamCameraId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Camera getCamera();", "public static Camera open() { \n return new Camera(); \n }", "public void getCameraInstance() {\n newOpenCamera();\n }", "public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n ...
[ "0.6435994", "0.6160698", "0.6151696", "0.6093684", "0.6031215", "0.60213435", "0.6020806", "0.59574115", "0.59538865", "0.595346", "0.59477496", "0.5928392", "0.5905893", "0.5893831", "0.58839303", "0.5853819", "0.58451396", "0.579084", "0.5765657", "0.57559127", "0.57509065...
0.80366844
0
Minimum constructor because RokidCamera will need at least an Activity and a TextureView. User can choose to add callback using the later setter methods.
private RokidCamera(Activity activity, TextureView textureView) { this.mActivity = activity; this.mTextureView = textureView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RokidCamera(RokidCameraBuilder rokidCameraBuilder) {\n this(rokidCameraBuilder.getActivity(), rokidCameraBuilder.getTextureView());\n this.mRokidCameraStateListener = rokidCameraBuilder.getRokidCameraStateListener();\n this.mRokidCameraIOListener = rokidCameraBuilder.getRokidCameraIOListener()...
[ "0.71576893", "0.673246", "0.6709288", "0.6669814", "0.652404", "0.6504527", "0.6423324", "0.6356834", "0.6330876", "0.6258714", "0.6221324", "0.61542916", "0.6147159", "0.6144678", "0.61302066", "0.61284757", "0.6120122", "0.610255", "0.60976374", "0.6092642", "0.60339683", ...
0.7799963
0
Background thread for saving images to SD card
public void onStart() { mVideoFolder = createVideoFolder(); mImageFolder = createImageFolder(); mMediaRecorder = new MediaRecorder(); startBackgroundThread(); if (mTextureView.isAvailable()) { // TODO: see Google Example add comments // pause and resume openCamera(mTextureView.getWidth(), mTextureView.getHeight()); } else { // first time mTextureView.setSurfaceTextureListener(mSurfaceTextureListener); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic void run() {\n\t\t\twhile (put_flag) {\n\t\t\t\tString path;\n\t\t\t\tif (usbImagePathList.size() > 0) {\n\t\t\t\t\tif (currentImg >= usbImagePathList.size()) {\n\t\t\t\t\t\tcurrentImg = 0;\n\t\t\t\t\t}\n\t\t\t\t\tpath = usbImagePathList.get(currentImg++);\n\t\t\t\t\t//Log.d(TAG,\"the PutImag...
[ "0.6917551", "0.6910758", "0.6808562", "0.64967453", "0.6472984", "0.6422356", "0.62842786", "0.6236365", "0.61649", "0.6104375", "0.6078278", "0.60410887", "0.5982373", "0.59575313", "0.5938169", "0.58609253", "0.585947", "0.5857043", "0.58161014", "0.57771134", "0.5771664",...
0.0
-1
Setup camera parameters: Rotation Degree Preview Size Video Recording Size ImageReader Size AutoFocus Support CameraID (If has multiple cameras)
private void setupCamera(int width, int height) { CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE); if (cameraManager == null) { return; } try { for (String cameraId : cameraManager.getCameraIdList()) { // get camera characteristics CameraCharacteristics cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraId); Integer currentCameraId = cameraCharacteristics.get(CameraCharacteristics.LENS_FACING); if (currentCameraId == null) { // The return value of that key could be null if the field is not set. return; } if (currentCameraId != mRokidCameraParamCameraId.getParam()) { // if not desired Camera ID, skip continue; } int deviceOrientation = mActivity.getWindowManager().getDefaultDisplay().getRotation(); mTotalRotation = CameraDeviceUtils.sensorToDeviceRotation(cameraCharacteristics, deviceOrientation, ORIENTATIONS); mImageReader = ImageReader.newInstance(mSizeImageReader.getSize().getWidth(), mSizeImageReader.getSize().getHeight(), mImageFormat, mMaxImages); mImageReader.setOnImageAvailableListener(mOnImageAvailableListener, mBackgroundHandler); // Check if auto focus is supported int[] afAvailableModes = cameraCharacteristics.get( CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); if (afAvailableModes.length == 0 || (afAvailableModes.length == 1 && afAvailableModes[0] == CameraMetadata.CONTROL_AF_MODE_OFF)) { mAutoFocusSupported = false; } else { mAutoFocusSupported = true; } mCameraId = cameraId; return; } } catch (CameraAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setCameraParameters() {\n mParameters = mCameraDevice.getParameters();\n\n// Camera.Size previewSize = getDefaultPreviewSize(mParameters);\n//\n// //获取计算过的摄像头分辨率\n// if(previewSize != null ){\n// mPreviewWidth = previewSize.width;\n// mPreviewHeight = ...
[ "0.7505181", "0.74905276", "0.742294", "0.7409308", "0.730329", "0.7153478", "0.7116762", "0.7086943", "0.69136405", "0.6888323", "0.6864784", "0.68547195", "0.6840804", "0.6831018", "0.68237215", "0.6800759", "0.6716201", "0.66801745", "0.66774946", "0.6575431", "0.6558298",...
0.7413631
3
Opening Camera via CameraManager
private void openCamera(int width, int height) { setupCamera(width, height); configureTransform(width, height); Activity activity = mActivity; CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE); try { if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { // connect the camera // TODO: add comments cameraManager.openCamera(mCameraId, mStateCallback, mBackgroundHandler); } } catch (CameraAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openCamera() {\n \n\n }", "public void openCamera() {\n\n Uri photoURI = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + \".provider\", getTempImage());\n\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n photoURI = Uri.fromFile(getTempImage());...
[ "0.7982744", "0.781916", "0.78052455", "0.7804821", "0.7726779", "0.7602588", "0.75539374", "0.75385535", "0.7318735", "0.73109025", "0.72650856", "0.7229907", "0.7229907", "0.7209537", "0.7193969", "0.71796995", "0.7170999", "0.71671087", "0.7157013", "0.71533793", "0.715185...
0.72374773
11
The camera is already closed
@Override public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) { if (null == mCameraDevice) { return; } // Auto focus should be continuous for camera preview. mCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE); // Finally, we start displaying the camera preview. mPreviewRequest = mCaptureRequestBuilder.build(); mPreviewCaptureSession = cameraCaptureSession; // preview is a video, so we set a repeating request try { mPreviewCaptureSession.setRepeatingRequest(mCaptureRequestBuilder.build(), mPreviewCaptureCallback, mBackgroundHandler); } catch (CameraAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void cameraClosed();", "public void closeCamera()\n {\n }", "private void closeCamera() {\n if (null != cameraDevice) {\n cameraDevice.close();\n cameraDevice = null;\n }\n if (null != imageReader) {\n imageReader.close();\n imageReader = n...
[ "0.819081", "0.80881274", "0.7260934", "0.7144884", "0.7136317", "0.7016478", "0.68920213", "0.68624574", "0.6841933", "0.6812349", "0.68049127", "0.67768633", "0.67685986", "0.674063", "0.66460407", "0.6603918", "0.6600197", "0.6600197", "0.6600033", "0.65916586", "0.6590379...
0.0
-1
Check for permissions and start video recording.
public void startVideoRecording() { try { mVideoFileTest = createVideoFile(mVideoFolder); } catch (IOException e) { e.printStackTrace(); } // set up Recorder try { setupMediaRecorder(); } catch (IOException e) { e.printStackTrace(); } // prepare for recording sendVideoRecordingRequest(); // start recording mMediaRecorder.start(); if (mRokidCameraRecordingListener != null) { mRokidCameraRecordingListener.onRokidCameraRecordingStarted(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startVideoRecording() {\n this.mActivity.getCameraAppUI().switchShutterSlidingAbility(false);\n if (this.mCameraState == 1) {\n setCameraState(2);\n Tag tag = TAG;\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sta...
[ "0.69025886", "0.6620929", "0.6598681", "0.6589281", "0.65782255", "0.64950913", "0.6454522", "0.6360643", "0.62480694", "0.62075853", "0.6179489", "0.6151773", "0.61072963", "0.6090383", "0.6074278", "0.60737735", "0.60419816", "0.602489", "0.60238326", "0.6020804", "0.60166...
0.72903633
0
Set up Preview surface and Recording surface to prepare for recording
private void sendVideoRecordingRequest() { SurfaceTexture surfaceTexture = mTextureView.getSurfaceTexture(); assert surfaceTexture != null; surfaceTexture.setDefaultBufferSize(mSizePreview.getSize().getWidth(), mSizePreview.getSize().getHeight()); Surface previewSurface = new Surface(surfaceTexture); try { // create request for RECORDING template /** * Create a request suitable for video recording. Specifically, this means * that a stable frame rate is used, and post-processing is set for * recording quality. These requests would commonly be used with the * {@link CameraCaptureSession#setRepeatingRequest} method. * This template is guaranteed to be supported on all camera devices except * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT} devices * that are not {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE * BACKWARD_COMPATIBLE}. * * @see #createCaptureRequest */ mCaptureRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD); configureCameraParameters(mCaptureRequestBuilder, mRokidCameraParamAEMode, mRokidCameraParamAFMode, mRokidCameraParamAWBMode); if (mPreviewEnabled) { // add Preview surface to target mCaptureRequestBuilder.addTarget(previewSurface); } // add Record surface to target Surface recordSurface = mMediaRecorder.getSurface(); mCaptureRequestBuilder.addTarget(recordSurface); mCameraDevice.createCaptureSession(Arrays.asList(previewSurface, recordSurface), new CameraCaptureSession.StateCallback() { @Override public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) { try { cameraCaptureSession.setRepeatingRequest(mCaptureRequestBuilder.build(), null, null); } catch (CameraAccessException e) { e.printStackTrace(); } } @Override public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) { } }, null); } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void startPreview() {\n if (null == mCameraDevice || !mTextureView.isAvailable()) {\n return;\n }\n try {\n //\n // Media Recorder\n //\n setUpMediaRecorder();\n\n //\n ...
[ "0.795996", "0.7732268", "0.7604987", "0.75382507", "0.74399966", "0.74196464", "0.7414591", "0.73389435", "0.7314764", "0.7229792", "0.7166446", "0.71616894", "0.71315396", "0.71143395", "0.71122247", "0.71091664", "0.70754683", "0.7040478", "0.700692", "0.69644076", "0.6942...
0.700832
18
Unlock the focus. This method should be called when still image capture sequence is finished.
private void unlockFocus() { try { // Reset the auto-focus trigger mCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL); mPreviewCaptureSession.capture(mCaptureRequestBuilder.build(), mPreviewCaptureCallback, mBackgroundHandler); // After this, the camera will go back to the normal state of preview. mCaptureState = STATE_PREVIEW; mPreviewCaptureSession.setRepeatingRequest(mPreviewRequest, mPreviewCaptureCallback, mBackgroundHandler); } catch (CameraAccessException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n setAutoFlash(mPreviewRequestBuilder);\n mCaptureSession.capture...
[ "0.7994598", "0.79731876", "0.7944067", "0.6697191", "0.6481172", "0.646617", "0.6455761", "0.6430685", "0.641867", "0.639637", "0.6201543", "0.616481", "0.6141927", "0.61394435", "0.6132339", "0.6130657", "0.6130657", "0.6095788", "0.60863024", "0.60519296", "0.60391814", ...
0.7986453
1
TODO: put to a Util class
public File createVideoFolder() { // File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory( // Environment.DIRECTORY_MOVIES + File.separator), "RokidCameraVideo"); // mVideoFolder = mediaStorageDir; File movieFile = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); File mVideoFolder = new File(movieFile, "Camera"); if (!mVideoFolder.exists()) { mVideoFolder.mkdirs(); } return mVideoFolder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Util() { }", "private void strin() {\n\n\t}", "private FormatUtilities() {}", "private JacobUtils() {}", "private static void cajas() {\n\t\t\n\t}", "private ProcessorUtils() { }", "private OMUtil() { }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils()...
[ "0.55688167", "0.51044494", "0.49528146", "0.4911743", "0.49005276", "0.48898774", "0.48555157", "0.48341578", "0.48341578", "0.48341578", "0.48341578", "0.48264524", "0.4815448", "0.48087093", "0.47693783", "0.47481418", "0.47356623", "0.47290322", "0.47135755", "0.4712402", ...
0.0
-1
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES + File.separator), "RokidCameraCamera"); mImageFolder = mediaStorageDir;
public File createImageFolder() { File imageFile = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); File mImageFolder = new File(imageFile, "Camera"); if (!mImageFolder.exists()) { mImageFolder.mkdirs(); } return mImageFolder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void fixMediaDir() {\n String appDirectoryName = PICTURES;\n File imageRoot = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES), appDirectoryName);\n imageRoot.mkdirs();\n }", "void fixMediaDir(){\n File sdcard = ...
[ "0.7528324", "0.7393338", "0.72090846", "0.7159961", "0.7127435", "0.7112427", "0.7105568", "0.7044399", "0.7039726", "0.70320284", "0.7027157", "0.6885333", "0.68834734", "0.68793523", "0.6833828", "0.6797662", "0.6773855", "0.67598933", "0.6759714", "0.66613454", "0.6639261...
0.78888935
0
Author: Oluwatobi Adenekan date: 15/08/2019
public interface CompetitionDetailPresenter { void setCompetition(NameAndId competitionDetail); void onDestroy(); void onPause(); void onResume(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void cajas() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "public void mo4359a() {\n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n protected void getExras() {\n...
[ "0.6012568", "0.5843541", "0.5817111", "0.57552576", "0.57339245", "0.5695001", "0.56003964", "0.55872273", "0.55872273", "0.55872273", "0.55872273", "0.55872273", "0.55872273", "0.55872273", "0.5583071", "0.55576164", "0.5546312", "0.5533875", "0.5533773", "0.5524138", "0.55...
0.0
-1
used to async call instead of runnable
public interface Callable<V> { public void onCall(int state, V jo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void callSync() {\n\n }", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "@Override\r\n\t\tprotected void run...
[ "0.66032803", "0.66032803", "0.65749574", "0.65664226", "0.6564685", "0.6546132", "0.6536174", "0.6536174", "0.6533965", "0.6533965", "0.6533965", "0.65255356", "0.65255356", "0.6520946", "0.6520946", "0.6520946", "0.6520946", "0.6520946", "0.6520946", "0.6520946", "0.6510601...
0.0
-1
Open the database in writable mode
public void openDatabase(@NonNull Context context){ if (databaseClosed) { NoteDatabaseHelper dbHelper = new NoteDatabaseHelper(context, Util.DATABASE_NAME, null, Util.DATABASE_VERSION); noteDatabase = dbHelper.getWritableDatabase(); databaseClosed = false; } else if (noteDatabase.isReadOnly()) { //the database is open, but in the wrong mode (i.e. readonly, and not writeable), // so it needs to be closed, and reopened in writable mode. closeDatabase(); openDatabase(context); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openRWDB() throws SQLException {\r\n\t\tString mPath = DATABASE_PATH + DATABASE_NAME;\r\n\t\tmDataBase = SQLiteDatabase.openDatabase(mPath, null,\r\n\t\t\t\tSQLiteDatabase.OPEN_READWRITE);\r\n\t}", "public DaoSession openWritableDb() {\n isInitOk();\n SQLiteDatabase db = openHelper.getW...
[ "0.7671973", "0.6971642", "0.6964957", "0.69261", "0.6912246", "0.6862251", "0.683994", "0.68348426", "0.6801179", "0.67870384", "0.6763074", "0.6719026", "0.6717559", "0.6667575", "0.6657045", "0.6657045", "0.6657045", "0.6574777", "0.6542141", "0.6536686", "0.65284395", "...
0.6410905
27
only close the database if it wasn't already open. allows the user to manually control open and close of database for perf. reasons.
public void add(@NonNull Context context, @NonNull Note newNote) { boolean closeDatabase = false; if (databaseClosed) { //the database will be opened by this call, set this to true to // ensure it is closed upon exit. closeDatabase = true; openDatabase(context); } addNewNoteQuery(newNote); if (closeDatabase) { noteDatabase.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void close() {\n\n mOpenCounter--;\n\n if(mOpenCounter == 0) {\n // Closing database\n mDatabase.close();\n }\n }", "public static void closeDatabase() {\n\t\ttry {\n\t\t\tif (status == OPEN_SUCCESS) {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.cl...
[ "0.795343", "0.7947412", "0.7941975", "0.7933515", "0.7906428", "0.78522", "0.7786198", "0.77632135", "0.7678995", "0.7674817", "0.76553196", "0.7649959", "0.7640312", "0.76355827", "0.7621712", "0.7621712", "0.7588453", "0.7582098", "0.75714564", "0.75697815", "0.7500559", ...
0.0
-1
Its take the payment type or any inputs from excel sheet & pass it to JSON objects in the name of"to modify" Kishor
public static PageElement modifyPageElement( RepositoryParser repositoryParser, String pageName, String objectName, String... modificationStrings) { PageElement element = repositoryParser.getPageObject(pageName, objectName); PageElement modifiedElement = new PageElement(element); String locatorValue = modifiedElement.getLocatorValue(); for (String modification : modificationStrings) { locatorValue = StringUtils.replaceOnce(locatorValue, "toModify", modification); } modifiedElement.setLocatorValue(locatorValue); return modifiedElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Object generateDeleteAlertsTypeDataJSON(XSSFWorkbook workbook, String sheetName, String scenarioID,ExcelOperation excelOperation) {\n\t\tJSONObject deleteAlertsRequestJsonObject=new JSONObject();\n\t\tList<LinkedHashMap<String, String>>jsonMap=excelOperation.getScenarioData(workbook, sheetName, scenarioID)...
[ "0.5739242", "0.5717288", "0.56112105", "0.55676866", "0.5549923", "0.5526244", "0.5514031", "0.5453504", "0.54523796", "0.5444532", "0.5402348", "0.5391303", "0.5360443", "0.5326479", "0.53076434", "0.5292345", "0.5283625", "0.5283221", "0.5280558", "0.52717364", "0.5258925"...
0.0
-1
method added to find saved card element
public WebElement selectSavedCardPaymentMode() { return wait.until(ExpectedConditions.elementToBeClickable(findElement( repositoryParser, PAGE_NAME, "savedCard"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addCard(){\n WebDriverHelper.clickElement(addCard);\n }", "public void saveCard(card cardToBeSaved)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.saveCard(packId, cardToBeSaved.getCardId(), cardToBeSaved.getFront(),cardToBeSaved.getBack());\n ...
[ "0.6581161", "0.64106244", "0.62861955", "0.605585", "0.6023139", "0.59312445", "0.5803906", "0.57441133", "0.5713303", "0.5707555", "0.5696499", "0.5679864", "0.5648381", "0.5641501", "0.5636685", "0.56078887", "0.5597064", "0.55683905", "0.55455995", "0.5535755", "0.5516132...
0.59593093
5
Method added to find 123Banking payment typeKishor
public WebElement select123BankingPaymentType(String banks123) { return findElement(modifyPageElement(repositoryParser, PAGE_NAME, "123Banking", banks123)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getJP_BankAccountType();", "public String getBankAccountType();", "@Query(value = \"from BankAccount where dtype = 'BankAccount' and user_id = :id\")\n Optional<BankAccount> findBankAccountByUserAndType(Long id);", "public abstract List<CustomerType> findCustomerTypebyCustomerTypeNumber(Stri...
[ "0.63523895", "0.63179463", "0.6026707", "0.59641117", "0.5916973", "0.58872694", "0.58485734", "0.58483547", "0.58290863", "0.574936", "0.57185453", "0.5711788", "0.56769526", "0.56745446", "0.5564812", "0.5562833", "0.55610406", "0.55431664", "0.5513235", "0.5493611", "0.54...
0.57497215
9
Selecting bank transfer paymodeKishor
public WebElement bankTransferPaymentMode() { return findElement(repositoryParser, PAGE_NAME, "bankTransfer"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void changeBanksForPayment(){\n\t\t\tgetLocalBankListforIndicator();\n\t\t\tsetPaymentmodeId(null);\n\t\t\tif(getPaymentCode()!=null && getPaymentCode().equalsIgnoreCase(\"B\"))\n\t\t\t{\n\t\t\t\t\n\t\t\t\tsetBooChequePanel(true);\n\t\t\t\tsetBooCardPanel(false);\n\t\t\t\tsetRemitamount(null);\n\t\t\t\tBigD...
[ "0.6443464", "0.63438886", "0.6102815", "0.5995986", "0.5978999", "0.5947189", "0.5938954", "0.5877667", "0.5832984", "0.5747133", "0.57311505", "0.57058376", "0.5606623", "0.5581177", "0.5569355", "0.55531496", "0.5525877", "0.5520953", "0.5518652", "0.5509473", "0.55026245"...
0.68242776
0
selecting bank transfer payment typeKishor
public WebElement selectingBank(String bank) { return findElement(modifyPageElement(repositoryParser, PAGE_NAME, "selectingBank", bank)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WebElement bankTransferPaymentMode() {\n\t\treturn findElement(repositoryParser, PAGE_NAME, \"bankTransfer\");\n\t}", "public void setPaymentMethodCode_BankTransfer() {\n setPaymentMethodCodeAsPaymentMethod(AppCDef.PaymentMethod.BankTransfer);\n }", "public String getBankAccountType();", "pu...
[ "0.6394701", "0.6285461", "0.62180436", "0.6162519", "0.6132328", "0.607082", "0.60644245", "0.6061648", "0.5966865", "0.5881628", "0.5866391", "0.58588475", "0.5829583", "0.58094007", "0.5762918", "0.57485026", "0.5738911", "0.57150614", "0.56884104", "0.5683842", "0.5660498...
0.53260684
44