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
However, the type of reference of b is Baap so b.h will always refer to Baap's h
public static void main(String[] args) { Baap b = new Beta(); //Here, b refers to an object of class Beta //so b.getH() will always call the overridden (subclass's method) System.out.println("Baap b = new Beta(): " + b.h/*2*/ + " " + b.getH())/*1*/; // also 1) prints getH(), 2) prints diese mit b.h und b.getH() mit Return Wert Beta bb = (Beta) b; System.out.println("Beta bb = (Beta) b : " + bb.h/*4*/ + " " + bb.getH()/*3*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void b(ahd paramahd) {}", "public void b() {\n ((a) this.a).b();\n }", "public t b() {\n return a(this.a);\n }", "public abstract BoundType b();", "MagReference getHvRef();", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 4...
[ "0.5760162", "0.56714755", "0.54906285", "0.5480289", "0.5438917", "0.5430128", "0.5428197", "0.54005575", "0.54005575", "0.5400227", "0.53536654", "0.52887976", "0.5283663", "0.5281222", "0.5277332", "0.5268807", "0.5264003", "0.52555037", "0.52462023", "0.52306324", "0.5228...
0.5199437
23
lnd must be ready
@Override public void work() { if (!lnd_.isRpcReady()) return; if (!started_) { // NOTE: start protocol to recover in-flight payments' state: // - get all payments w/ 'sending' state from db // - get all payments from lnd // - find 'sending' payments within lnd payments // - update found payments, reset state for not-found // - delete all payments from lnd to clear it // - started_ = true, can process new payments now if (!starting_) { starting_ = true; List<Job> sendingJobs = dao_.getSendingJobs(); checkPayments(sendingJobs); } return; } if (!notified_ && nextWorkTime_ > System.currentTimeMillis()) return; // reset notified_ = false; List<Job> pending = dao_.getPendingJobs(System.currentTimeMillis()); for (Job job: pending) { WalletData.SendPayment p = (WalletData.SendPayment)job.objects.get(0); if (p.paymentHashHex() != null || p.isKeysend()) { queryRoutes(job, p); } else if (p.paymentRequest() != null) { decodePayment(job, p); } } nextWorkTime_ = System.currentTimeMillis() + WORK_INTERVAL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void ready();", "@Override\n public boolean isReady() {\n return true;\n }", "@Override\n public boolean isReady() {\n return true;\n }", "void isReady();", "void isReady();", "@Override\r\n\t\t\tpublic boolean isReady() {\n\t\t\t\treturn false;\r\n\t\t\t}", "@Over...
[ "0.59829897", "0.5862426", "0.5836489", "0.58303344", "0.58303344", "0.57747763", "0.5713609", "0.5713609", "0.56896836", "0.56695676", "0.56695676", "0.5667692", "0.56576747", "0.5655243", "0.5630367", "0.55788666", "0.5569819", "0.5565842", "0.555607", "0.55503523", "0.5550...
0.0
-1
Compare values with largest number
public static void main(String[] args) { Scanner val = new Scanner(System.in); int num1 = val.nextInt(); int num2 = val.nextInt(); int num3 = val.nextInt(); val.close(); num1 = (num2 > num1)? num2:num1; num3 = (num3 > num1)? num3:num1; System.out.println(num3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\t...
[ "0.6982909", "0.6863735", "0.67158955", "0.6662198", "0.66158956", "0.6591017", "0.6567861", "0.6518906", "0.6509642", "0.65014374", "0.64639837", "0.64552444", "0.6446018", "0.64428425", "0.6419264", "0.6408566", "0.6404517", "0.63789874", "0.6353375", "0.63469666", "0.63390...
0.0
-1
List list = new Vector(); List list = Collections.synchronizedList(new ArrayList());
public static void main(String[] args) { CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<>(); for (int i = 0; i < 30; i++) { new Thread(()->{ set.add(UUID.randomUUID().toString()); System.out.println(set); },String.valueOf(i)).start(); } /** * 1.故障现象 * java.util.ConcurrentModificationException * 2.导致原因 * 并发争抢修改导致 * 3.解决方案 * List<String> list = new Vector<>(); * List<String> list = Collections.synchronizedList(new ArrayList<>()); * CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); * 4.优化建议 * CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>(); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n \tpublic static <T> List<T> createConcurrentList() {\n \t\treturn (List<T>) Collections.synchronizedList(createArrayList());\n \t}", "public static void main(String[] args) {\n\t\tList<Integer> list=Collections.synchronizedList(new ArrayList<>());\n\t\t\n\t\t\n\t}", "private ...
[ "0.7255283", "0.71889967", "0.7147631", "0.6872272", "0.653382", "0.6502858", "0.6354238", "0.6206271", "0.6106977", "0.6044963", "0.6011033", "0.595015", "0.5949338", "0.5938644", "0.5907712", "0.58640844", "0.5856065", "0.58477587", "0.5832252", "0.5735379", "0.57306033", ...
0.5937854
14
boolean returnValue = true;
private synchronized void print4() { try { int jNum = 0; byte[] printText22 = new byte[10240]; byte[] oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setInternationalCharcters('3'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("FoodCiti"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\nOrder No : " + order.getOrderNo()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(SessionManager.get(getActivity()).getRestaurantName() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; String location = SessionManager.get(getActivity()).getRestaurantLocation(); int spacecount = commacount(location); oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (spacecount >= 1) { oldText = getGbk(location.substring(0, location.indexOf(',')) + "\n" + location.substring(location.indexOf(',') + 1) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk(location + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(SessionManager.get(getActivity()).getRestaurantPostalCode() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Tel:" + SessionManager.get(getActivity()).getRestaurantPhonenumber()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getOrderSpecialInstruction() != null) { oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(order.getOrderSpecialInstruction()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + "GBP" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // Toast.makeText(getContext(),"Size "+order.getOrderedItemList().size(),Toast.LENGTH_LONG).show(); for (int i = 0; i < order.getOrderedItemList().size(); i++) { OrderedItem orderedItem = order.getOrderedItemList().get(i); oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // int qntity = Integer.parseInt(orderedItem.getQuantity()); oldText = getGbk(" " + orderedItem.getQuantity() + " x " + orderedItem.getItemData().getItemName()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; Double total_price = Double.valueOf(orderedItem.getTotalPrice()) * Double.valueOf(orderedItem.getQuantity()); oldText = getGbk(" " + String.format(Locale.getDefault(), "%.2f", total_price) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; for (int j = 0; j < orderedItem.getSubItemList().size(); j++) { oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(35); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; SubItem subItem = orderedItem.getSubItemList().get(j); String subitemname = subItem.getItemName(); int subItemOrderQty = Integer.parseInt(subItem.getOrderedQuantity()); if (subItemOrderQty > 1) { oldText = getGbk(" " + subItem.getOrderedQuantity() + " x " + subitemname + "\n"); } else { oldText = getGbk(" " + subitemname + "\n"); } System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // By Ravi // oldText = getGbk("........................\n"); // System.arraycopy(oldText, 0, printText22, jNum, oldText.length); // jNum += oldText.length; ////////////////////////////////////////////////////////////////////////////////////////////////////////// /** TODO * change here for print suboptions text * **/ //print text for suboptions items if (subItem.getSubOptions() != null && subItem.getSubOptions().size() > 0) { List<SubOptions> subOptions = subItem.getSubOptions(); for (int k = 0; k < subOptions.size(); k++) { SubOptions options = subOptions.get(k); oldText = getGbk(" - " + options.getName() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } } } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /*oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length;*/ oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("-----------------------\n"); oldText = getGbk("........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Subtotal : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getOrderSubtotal())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (Double.valueOf(order.getDiscount()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Discount : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getDiscount())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } if (Double.valueOf(order.getTax()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Service Charge : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getTax() != null) { oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getTax())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk(" " + "0.00" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } } if (!order.getOrderDelivery().equals(Consts.PICK_UP) && Double.valueOf(order.getDeliveryCharges()) > 0) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Delivery Charges : "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(390); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getDeliveryCharges())) + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("TOTAL Price: "); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setCusorPosition(370); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; //Toast.makeText(getActivity(),String.valueOf(order.getOrderTotal()),Toast.LENGTH_LONG).show(); oldText = getGbk(" " + String.format(" %.2f", Double.valueOf(order.getOrderTotal()))); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getFreenDrinkText() != null && !TextUtils.isEmpty(order.getFreenDrinkText())) { oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; String freeTxt = "Free " + order.getFreenDrinkText(); oldText = getGbk(freeTxt); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /** TODO * change here to print payment method text * **/ //print text for payment method if (order.getOrderPaid().equalsIgnoreCase("paypal") || order.getOrderPaid().equalsIgnoreCase("worldpay")) { oldText = getGbk(order.getOrderPaid() + " PAID " + "\n"); } else { oldText = getGbk(order.getOrderPaid() + " NOT PAID " + "\n"); } // oldText = getGbk("ORDER BY " + order.getOrderPaid() + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; if (order.getOrderDelivery().equals(Consts.PICK_UP)) { oldText = getGbk("COLLECTION" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } else { oldText = getGbk("DELIVERY" + "\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; } oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // String strTmp2 = new SimpleDateFormat("dd-MM-yyyy hh:mm a", Locale.UK).format(new Date()); oldText = getGbk(getDate(order.getOrderTime())); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('0'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('4'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Customer Details: " + "\n" + order.getUser().getUserName().toUpperCase() + "\n" + order.getUser().getAddress().toUpperCase() + "\n" + order.getUser().getCity().toUpperCase() + "\n" + order.getUser().getPostalCode().toUpperCase() + "\n" + order.getUser().getPhNo().toUpperCase() ); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('5'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("Ref:"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk(order.getOrderId()); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(false); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; // oldText = getGbk("\n-----------------------\n"); oldText = getGbk("\n........................\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setAlignCenter('1'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setBold(true); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = setWH('2'); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("www.foodciti.co.uk"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; oldText = getGbk("\n\n"); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; /*String s = new String(printText22); Toast.makeText(getActivity(),s,Toast.LENGTH_LONG).show();*/ oldText = CutPaper(); System.arraycopy(oldText, 0, printText22, jNum, oldText.length); jNum += oldText.length; Intent intent = new Intent(PrintUtils.ACTION_PRINT_REQUEST); intent.putExtra(PrintUtils.PRINT_DATA, printText22); localBroadcastManager.sendBroadcast(intent); // mOutputStream.write(printText22); } catch (Exception ex) { Exlogger exlogger = new Exlogger(); exlogger.setErrorType("Print Error"); exlogger.setErrorMessage(ex.getMessage()); exlogger.setScreenName("OrderInfo->>print4() function"); logger.addException(exlogger); Toast.makeText(getActivity(), ex.getMessage(), Toast.LENGTH_LONG).show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getReturn();", "public boolean get_return(){\n return local_return;\n }", "boolean doSomething() {\n\t\treturn true;\n\t}", "boolean getVarReturn();", "boolean test();", "boolean test();", "boolean test();", "boolean test() {\n ...
[ "0.7621053", "0.76199734", "0.73888505", "0.7333712", "0.7181328", "0.7181328", "0.7181328", "0.71305335", "0.708852", "0.69825774", "0.6982471", "0.6982471", "0.6982471", "0.6982471", "0.69568735", "0.6927141", "0.6872325", "0.68402606", "0.6830471", "0.68129027", "0.6812902...
0.0
-1
A constructor that adds a reference to the parent JDA instance
LavoisierListener(JDA jda) { instance = jda; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Parent() {\n super();\n }", "Parent() {\n\t System.out.println(\"i am from Parent Class\");\n\t }", "public ReferenceDatabaseSettingsGUI(AdminJavaGUI parent) {\n initComponents();\n windowMenu(); \n parentFrame = parent;\n getParentReferenceDatabase...
[ "0.6358775", "0.6299422", "0.59706277", "0.59537953", "0.5919605", "0.581985", "0.57945395", "0.57553303", "0.57457966", "0.5745647", "0.5720582", "0.5698625", "0.56379545", "0.5595008", "0.55935496", "0.5574735", "0.55375904", "0.5523305", "0.55084", "0.5507268", "0.5505589"...
0.5978528
2
Load answer data into program
private void loadData() { try { URL source = new URL(CSV_URL); URLConnection connect = source.openConnection(); BufferedReader f = new BufferedReader(new InputStreamReader(connect.getInputStream())); header = f.readLine().split(","); // Replace third header with Difficulty Rating header[3] = "Difficulty"; String line; while((line = f.readLine()) != null) { String[] row = line.split(","); // Section: 0, 1, 2, 3 for now, 3 will be WCC int problemNumber = Integer.parseInt(row[0]); int section; int year; String exam = row[1]; String answer = row[2]; if(row.length > 3) { answer += "~" + row[3]; } if(exam.matches("USNCO .*")) { exam = exam.substring(6); year = Integer.parseInt(exam.substring(1, 5)); if(exam.charAt(0) == 'N') { section = 1; } else { section = 0; } } else { year = Integer.parseInt(exam.substring(4, 8)); section = 3; } int id = year*240 + problemNumber*4 + section; data.put(id, answer); } } catch (Exception e) { // Solution given by StackOverflow: https://stackoverflow.com/questions/1149703/ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); String sStackTrace = sw.toString().substring(0, 800); // stack trace as a string // Send error messages to me instance.retrieveUserById(CREATOR).queue( user -> user.openPrivateChannel().queue( channel -> channel.sendMessage(sStackTrace).queue())); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readData() throws IOException {\n // as long as there are stuff left, keep reading by sets, which are\n // pairs of description + answer\n while (hasNext()) {\n counter++;\n readSet();\n }\n }", "public void readQuestion()\n\t{\n\t\tnumLines = (int)numScan.nextDouble();\n\t\tqu...
[ "0.61766297", "0.6150806", "0.5977766", "0.5976423", "0.59274155", "0.58778036", "0.58778036", "0.5844642", "0.58321124", "0.5796271", "0.5782386", "0.57492834", "0.5722469", "0.5642073", "0.5641588", "0.5635279", "0.55793136", "0.5528215", "0.55194646", "0.5514423", "0.54881...
0.5360267
31
A method to print out the help message
private void printHelpMessage(Message msg, String[] parameters) { // No parameters if(parameters.length == 1) { MessageEmbed embed = new MessageEmbed(null, "*Current Commands*", "**$help:** Display the help page for all commands." + "\n\n**$query [-s PART_CODE] [-y YEARS] [-p PROBLEMS]**: Query a USNCO Locals " + "or Nationals problem. A part code, year range, or problem range is optional. For more " + "information, type `$help query`. The query command returns an embed containing " + "an image of the problem and various attributes. For more information on attributes, " + "type `$help attributes`.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, null, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } else { String command = parameters[1]; if(!command.equals("query") && !command.equals("attributes")) { MessageChannel ch = msg.getChannel(); ch.sendMessage("The command you queried either does not have a" + "help page or does not exist. For general help, type $help.").queue(); } else if(command.equals("attributes")) { MessageEmbed embed = new MessageEmbed(null, "*Query Attributes*", "*Attributes: Source, Problem, Answer, Difficulty, " + "Problem Image*" + "\n\nSource: the year and test type of the test. " + "For example, `2020 USNCO Nationals Part I`. Will " + "come in the format [year] USNCO [Locals, Nationals " + "Part I, or Nationals Part II]." + "\n\nProblem: The problem number for the problem (i.e. 60)" + "\n\nAnswer: An answer with spoiler tags for the problem, if the " + "problem is multiple choice (from Part I or Locals). For example," + "the answer could look like ||B||." + "\n\nDifficulty: There are five different difficulty ratings." + "\n\t\t * **Unrated**: There is no data on the difficulty on the problem." + "\n\t\t * **Easy**: On an exam, more than two-thirds of test takers got it right." + "\n\t\t * **Medium**: On an exam, over half of test takers got it right." + "\n\t\t * **Hard**: On an exam, less than half of test takers got it right." + "\n\t\t * **Insane**: On an exam, less than one-third of test takers got it right." + "\n\nBelow is an example image of a query result.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, EXAMPLE_IMAGE, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } else { MessageEmbed embed = new MessageEmbed(null, "*Query Problems*", "**query: ** `query [-s PART_CODE] [-y YEARS] [-p PROBLEMS]`" + "\n\nQuery a USNCO Locals or Nationals problem." + "\n\n" + "-s, -section __part code__: " + "\n\tOptional, restricts the part of the USNCO problems" + "\n\tqueried. Can be either 0, 1, or 2. See explanation below:" + "\n\t\t * Code 0: Locals (Part 0 like pre-nationals)" + "\n\t\t * Code 1: Nationals Part I" + "\n\t\t * Code 2: Nationals Part II" + "\n\nDefault queries only query Locals and Nationals Part I, " + "\n\tMake sure that -s comes before -y or -p." + "\n\n" + "-y, -year __year range__: " + "\n\tOptional, restricts the year range. Year range should" + "\n\tbe formatted as either a single year or two years with" + "\n\ta dash in between (i.e. 2000 or 2003-2007). Inclusive." + "\n\n" + "-p, -problem __problem range__: " + "\n\tOptional, restricts the problem range. Problem range" + "\n\tshould be formatted as either a single problem number" + "\n\tor two problem numbers with a dash in between " + "\n\t(i.e. 60 or 12-17). Inclusive." + "\n\nNote that part 2 values should be between 1-8" + "\n\n" + "**Usage Examples**" + "\n\n" + "`$query`: grabs a random problem from locals/nationals part I.\n" + "`$query -s 2:` grabs a random problem from nationals part II\n" + "`$query -s 0 -y 2005 -p 60`: problem #60 from 2005 USNCO Locals.\n" + "`$query -s 2 -y 2010 -p 6`: problem #6 from 2010 USNCO Part II\n" + "`$query -y 2010-2020 -p 25-30`: grabs a random kinetics question\n" + "\tfrom the past 10 years.", null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, null, null); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void printHelp();", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view...
[ "0.8836242", "0.85331684", "0.8478557", "0.83347934", "0.8316819", "0.8307558", "0.8243017", "0.8239322", "0.8224657", "0.8204919", "0.8184006", "0.81792295", "0.8172836", "0.81561935", "0.8114366", "0.81087106", "0.81049263", "0.8079019", "0.80702466", "0.8050532", "0.804858...
0.0
-1
A method to get a random value within a range
private int getValue(int lowerBound, int upperBound) { int problemRange = upperBound - lowerBound + 1; return lowerBound + rng.nextInt(problemRange); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "private int _getRandomFromRange(int min, int max) {\n\t \n return min + random_.nextInt(max - min + 1);\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomN...
[ "0.75973296", "0.73689204", "0.7355706", "0.73053247", "0.7255473", "0.71772355", "0.71658367", "0.70838153", "0.70410717", "0.70400995", "0.70379484", "0.70335454", "0.6987245", "0.6965747", "0.6964726", "0.69549984", "0.694985", "0.6938311", "0.69274753", "0.6925244", "0.69...
0.65674686
58
A method to query a USNCO problem
private void queryImage(Message msg, int actualYear, int actualProblem, int section) { // Query from GitHub String sectionVal; String sectionDescription; switch(section) { case 0: sectionVal = "locals"; sectionDescription = "Locals"; break; case 1: sectionVal = "part_i"; sectionDescription = "Nationals Part I"; break; default: sectionVal = "part_ii"; sectionDescription = "Nationals Part II"; break; } List<MessageEmbed.Field> fields = new ArrayList<>(); int problemID = actualYear*240 + actualProblem*4 + section; fields.add(new MessageEmbed.Field(header[1], actualYear + " USNCO " + sectionDescription, false)); fields.add(new MessageEmbed.Field(header[0], "" + actualProblem, true)); if(data.containsKey(problemID)) { String[] info = data.get(problemID).split("~"); fields.add(new MessageEmbed.Field(header[2], "||" + info[0] + "||", true)); if(info.length < 2) { fields.add(new MessageEmbed.Field(header[3], "Unrated", true)); } else { double percent = Double.parseDouble(info[1].substring(0, info[1].length() - 1)); if(percent > 66.6) { fields.add(new MessageEmbed.Field(header[3], "Easy (" + percent + "%)", true)); } else if(percent > 50.0) { fields.add(new MessageEmbed.Field(header[3], "Normal (" + percent + "%)", true)); } else if(percent > 33.3) { fields.add(new MessageEmbed.Field(header[3], "Hard (" + percent + "%)", true)); } else { fields.add(new MessageEmbed.Field(header[3], "Insane (" + percent + "%)", true)); } } } String url = "https://raw.githubusercontent.com/thewindsofwinter/usnco-problems/master/tests/" + sectionVal + "/" + actualYear + "/" + actualProblem + ".png"; MessageEmbed.ImageInfo image = new MessageEmbed.ImageInfo(url, null, 1200, 673); MessageEmbed embed = new MessageEmbed(null, null, null, null, msg.getTimeCreated().plusSeconds(5), MESSAGE_COLOR, null, null, AUTHOR_INFO, null, FOOTER, image, fields); MessageChannel ch = msg.getChannel(); ch.sendMessage(embed).queue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Query query();", "public String susi(String query) throws Exception {\n\n \t\tthis.query = query;\n \t\tif (this.query != \"\") {\n \t\t\tString url = this.susiUrl + \"?q=\" +this.query;\n\n \t\t\tURL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n ...
[ "0.55613244", "0.5428159", "0.541852", "0.5391133", "0.53482777", "0.5298249", "0.5256226", "0.5215686", "0.52028286", "0.5165698", "0.5151723", "0.51313573", "0.5103518", "0.50899047", "0.5059625", "0.5040657", "0.50326234", "0.50304765", "0.50262433", "0.50065285", "0.49816...
0.48901302
31
A method to reset year, problem, and restriction parameters to their original value
private void resetParams() { lowerYear = 1999; upperYear = 2020; yearRestriction = false; lowerProblem = 1; upperProblem = 60; problemRestriction = false; partTwo = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setYear(int _year) { year = _year; }", "public void inputTempForYear() {\n\t\t\n\t\tfor (int i=0; i<12; i++)\n\t\t\tinputTempForMonth(i);\n\t}", "public void setYear(int year){\r\n\t\ttry{\r\n\t\t\tif(year>=1900)\r\n\t\t\tthis.year = year;\r\n\t\t\telse\r\n\t\t\t\tthrow new cardYearException();\r\n...
[ "0.65275615", "0.6162822", "0.6144697", "0.61259294", "0.6055855", "0.6013104", "0.6007035", "0.59928924", "0.59585834", "0.59047645", "0.58721936", "0.58694136", "0.5855274", "0.5848585", "0.58383906", "0.58254445", "0.57638866", "0.5758579", "0.5756033", "0.57522064", "0.57...
0.82811934
0
A method to restrict the year range problems are queried from
private int restrictYear(Message msg, String parameter, int section) { int[] years = setYearRestriction(msg, parameter, section); if (years[0] == ERROR_CODE[0]) { return -1; } yearRestriction = true; lowerYear = years[0]; upperYear = years[1]; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String dateRangeRestriction(String startDate, String endDate){\r\n String restriction = \"\";\r\n String[] startDateParts = startDate.split(\"/\");\r\n String[] endDateParts = endDate.split(\"/\");\r\n int prevYear = Integer.parseInt(endDateParts[0]) - 1; //year previus t...
[ "0.6461501", "0.64567184", "0.6359415", "0.6349753", "0.63127935", "0.61866397", "0.6178176", "0.60279995", "0.6016391", "0.5997309", "0.5984758", "0.5984758", "0.5975242", "0.5975242", "0.5975242", "0.5932926", "0.58727413", "0.5850893", "0.5844806", "0.5839853", "0.5825709"...
0.74214554
0
A method to restrict the problem range problems are queried from
private int restrictProblem(Message msg, String parameter) { int[] problems = setProblemRestriction(msg, parameter); if (problems[0] == ERROR_CODE[0]) { return -1; } problemRestriction = true; lowerProblem = problems[0]; upperProblem = problems[1]; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Range controlLimits();", "@Override\n public boolean isRange() {\n return false;\n }", "private void setDefaultValidRange ()\r\n\t{\r\n\t\tm_lowerBounds = Integer.MIN_VALUE;\r\n\t\tm_upperBounds = Integer.MAX_VALUE;\r\n\t}", "void calculateRange() {\n //TODO: See Rules\n }", "Limits limits()...
[ "0.6051895", "0.59386593", "0.574081", "0.5694922", "0.5655285", "0.56469244", "0.5617134", "0.5489708", "0.5472333", "0.5461008", "0.5432687", "0.54020053", "0.5387173", "0.5363844", "0.53595334", "0.5352464", "0.53450567", "0.5326257", "0.5324107", "0.5307986", "0.528972", ...
0.6296766
0
A method to restrict the test (local, part I, part II) our problems are queried from
private int restrictSection(Message msg, String parameter) { int sec = Integer.parseInt(parameter); if(sec > 2) { MessageChannel ch = msg.getChannel(); ch.sendMessage("`Error: Invalid query [section not 0-2]. Query terminated.`").queue(); return -1; } else if(sec == 2) { partTwo = true; upperProblem = 8; } return sec; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean needsProblem();", "@Test\n public void testAircraftPartNoNotApplicable777() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem <> 777\";\n\n // verify on wing engine 777 is not applicable\n int lResult = execute( ON_WING_ENGINE_777, lTaskApplSqlLdesc );\n ...
[ "0.5759807", "0.5632411", "0.5592196", "0.55807394", "0.55704653", "0.5568658", "0.54862475", "0.54737324", "0.54440826", "0.5433054", "0.5429019", "0.54279935", "0.54256517", "0.53538674", "0.5329615", "0.532692", "0.53252614", "0.53053427", "0.5287198", "0.52184004", "0.520...
0.5123393
25
A method to query a problem based on user input
private void queryProblems(Message msg, String[] parameters) { if(data.isEmpty()) loadData(); // Bounds on the problem number and year number resetParams(); int section = -1; int currentOption = -1; int success = 0; for(int i = 1; i < parameters.length; i++) { if(success == -1) return; String parameter = parameters[i]; switch(currentOption) { case 0: success = restrictYear(msg, parameter, section); currentOption = -1; break; case 1: success = restrictProblem(msg, parameter); currentOption = -1; break; case 2: section = restrictSection(msg, parameter); // If -1, we need to break to avoid errors success = section; currentOption = -1; break; default: if (parameter.matches("-y(ear)?")) { currentOption = 0; } else if (parameter.matches("-p(roblem)?")) { currentOption = 1; } else if(parameter.matches("-s(ection)?")) { currentOption = 2; } else { MessageChannel ch = msg.getChannel(); ch.sendMessage("`Error: Invalid option in query [not -s, -y, or -p]. Query terminated.`").queue(); return; } } } // Check if last command is in error if(success == -1) return; // Assign section if none selected if(section == -1) { section = rng.nextInt(2); lowerYear = LOWER_YEARS[section]; upperYear = UPPER_YEARS[section]; } int problem = getValue(lowerProblem, upperProblem); int year = getValue(lowerYear, upperYear); queryImage(msg, year, problem, section); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String userInput(String question);", "private static String getQuery(String query) {\n\t\tScanner reader = new Scanner(System.in);\n\t\tString state = \"\";\n\t\twhile (true) {\n\t\t\tSystem.out.println(\"Please Type in a \" + query + \":\");\n\t\t\ttry {\n\t\t\t\tstate = reader.nextLine();\n\t\t\t\treturn state...
[ "0.61423576", "0.5864194", "0.5753262", "0.5723401", "0.56442285", "0.56279784", "0.56262416", "0.55856955", "0.55575085", "0.55325246", "0.55118245", "0.55029655", "0.5493009", "0.5487937", "0.5478411", "0.54781795", "0.54720646", "0.54460365", "0.5435567", "0.54047483", "0....
0.6413918
0
A method to handle commands overall
private void handleCommand(Message msg, String commands) { String[] tokens = commands.split(" "); String command = tokens[0]; switch(command) { case "query": queryProblems(msg, tokens); break; case "help": printHelpMessage(msg, tokens); break; default: // Implement more commands later break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleCommands() {\n for (Command c : commands) {\n try {\n if (!game.isPaused()) {\n switch (c) {\n case INTERACT:\n game.interact();\n break;\n case...
[ "0.7654008", "0.7396491", "0.73099214", "0.71171105", "0.70430857", "0.7041614", "0.70197445", "0.70138", "0.69875056", "0.69785947", "0.69703794", "0.6970316", "0.69506824", "0.690399", "0.6879779", "0.68422073", "0.6832724", "0.67766094", "0.677409", "0.6726003", "0.6723890...
0.68986565
14
Handle message sending and receiving
@Override public void onMessageReceived(MessageReceivedEvent event) { if(event.getAuthor().isBot()) return; Message msg = event.getMessage(); String content = msg.getContentRaw(); if(content.charAt(0) == PREFIX) { handleCommand(msg, content.substring(1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void messageHandler(String read){\n\n try {\n buffer.append(read);\n }catch (MalformedMessageException e){\n System.out.println(\"[CLIENT] The message received is not in XML format.\");\n }\n\n while(!buffer.isEmpty()) {\n if (buffer.getPong()) p...
[ "0.74563", "0.7406282", "0.73414356", "0.7280701", "0.7273313", "0.7231558", "0.7195365", "0.7180781", "0.69980264", "0.69897616", "0.6987571", "0.69682205", "0.69441956", "0.69424266", "0.69161946", "0.69100785", "0.6900865", "0.6873043", "0.68487865", "0.6822763", "0.681170...
0.0
-1
Add "." to start and end of pattern to fully match any string containing the pattern
@Override public Stream<String> filter(Stream<String> stringStream, String pattern) { String regex = ".*" + pattern + ".*"; return stringStream.filter(str -> { return !Pattern.compile(regex).matcher(str).matches(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n ...
[ "0.5914358", "0.52938", "0.5281211", "0.52144426", "0.5166466", "0.51592064", "0.51315033", "0.5123095", "0.5097771", "0.5090073", "0.5039961", "0.49998975", "0.49818164", "0.49716192", "0.49581355", "0.4957681", "0.49394077", "0.49049667", "0.48970428", "0.4896198", "0.48935...
0.0
-1
/ checked out cust flush single rooms flush dob flush prm flush sut del cust
public static void main(String[] args) throws Exception, IOException { DateTimeFormatter f = DateTimeFormatter.ofPattern("dd/MM/yyyy"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Map<String, Custo> c = null; Map<String, Custo> sin = null; Map<String, Custo> dobl = null; Map<String, Custo> pre = null; Map<String, Custo> sut = null; List<Custo> cust = null; int flag = 0; do { int ch = 0; System.out.println("<<<<<<<< Welcome in Hotel xyz mangement >>>>>>>>"); System.out.println("1. List Checked-out Customers"); System.out.println("2. Delete Customers"); System.out.println("3. Delete Customers from Single Room "); System.out.println("4. Delete Customers from Double Room "); System.out.println("5. Delete Customers from Premium Room "); System.out.println("6. Delete Customers from Suite "); System.out.println("Please Enter the serial no of your choice....."); int choice = Integer.parseInt(br.readLine()); switch (choice) { case 1: try(FileInputStream fiis = new FileInputStream("test\\out.dat")) { try(ObjectInputStream obc = new ObjectInputStream(fiis)){ cust = (List<Custo>)obc.readObject(); System.out.println(cust); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 2: try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); do { if(c.size() > 1) { System.out.println(c); System.out.println("\n" + "Enter the mobile no. of Customer to Delete :"); String mob = br.readLine(); if(c.containsKey(mob)) { //Single rom del try(FileInputStream ss = new FileInputStream("test\\single.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sin = (Map<String, Custo>)sss.readObject(); if(sin.containsKey(c.get(mob).getRoom_name())) { if(sin.size() > 1) { sin.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); sin.put(ca.getRoom_name(), ca); sin.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //double room del try(FileInputStream ss = new FileInputStream("test\\double.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ dobl = (Map<String, Custo>)sss.readObject(); if(dobl.containsKey(c.get(mob).getRoom_name())) { if(dobl.size() > 1) { dobl.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); dobl.put(ca.getRoom_name(), ca); dobl.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //Premium room del try(FileInputStream ss = new FileInputStream("test\\premium.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ pre = (Map<String, Custo>)sss.readObject(); if(pre.containsKey(c.get(mob).getRoom_name())) { if(pre.size() > 1) { pre.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); pre.put(ca.getRoom_name(), ca); pre.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //Suite room del try(FileInputStream ss = new FileInputStream("test\\suite.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sut = (Map<String, Custo>)sss.readObject(); if(sut.containsKey(c.get(mob).getRoom_name())) { if(sut.size() > 1) { sut.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } else { LocalDate in = LocalDate.parse("01/01/2020", f); LocalDate out = LocalDate.parse("02/01/2020", f); Custo ca = new Custo("12345", "default", "sameer123", in, out, 1, "test"); sut.put(ca.getRoom_name(), ca); sut.remove(c.get(mob).getRoom_name()); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } c.remove(mob); try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("/n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Mobile no. : " + mob);} } else { System.out.println("No values to delete except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 3: try(FileInputStream ss = new FileInputStream("test\\single.dat")) { try(ObjectInputStream sss = new ObjectInputStream(ss)){ sin = (Map<String, Custo>)sss.readObject(); do { if(sin.size() > 1) { System.out.println(sin); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(sin.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(sin.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } sin.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\single.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sin); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 4: try(FileInputStream ss1 = new FileInputStream("test\\double.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ dobl = (Map<String, Custo>)ss2.readObject(); do { if(dobl.size() > 1) { System.out.println(dobl); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(dobl.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(dobl.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } dobl.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\double.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(dobl); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 5: try(FileInputStream ss1 = new FileInputStream("test\\premium.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ pre = (Map<String, Custo>)ss2.readObject(); do { if(pre.size() > 1) { System.out.println(pre); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(pre.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(pre.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } pre.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\premium.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(pre); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; case 6: try(FileInputStream ss1 = new FileInputStream("test\\suite.dat")) { try(ObjectInputStream ss2 = new ObjectInputStream(ss1)){ sut = (Map<String, Custo>)ss2.readObject(); do { if(sut.size() > 1) { System.out.println(sut); System.out.println("\n" + "Enter the Room no. of Customer to Delete :"); String room = br.readLine(); if(sut.containsKey(room)) { try(FileInputStream fis = new FileInputStream("test\\custo.dat")) { try(ObjectInputStream ob = new ObjectInputStream(fis)){ c = (Map<String, Custo>)ob.readObject(); c.remove(sut.get(room).getCust_mob()); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try(FileOutputStream fos = new FileOutputStream("test\\custo.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(c); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } sut.remove(room); try(FileOutputStream fos = new FileOutputStream("test\\suite.dat")) { try(ObjectOutputStream obj = new ObjectOutputStream(fos)){ obj.writeObject(sut); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println("\n"+"Customer Details removed Successfully ..."); System.out.println("press 0 to continue and 1 to exit deleting function.."); ch = Integer.parseInt(br.readLine()); } else {System.out.println("NO such Customer with Room no. : " );} } else { System.out.println("No Customers except default values"); break; } }while(ch != 1); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } break; default: System.out.println("Please enter Proper option"); break; } System.out.println("Press 0 to continue || Press 1 to exit"); flag = Integer.parseInt(br.readLine()); }while(flag != 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flush(){\r\n\t\tSystem.out.println(\"\\nCreating a customer by flush:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Selim\", \"Aslan\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\tlong id = c1.getC...
[ "0.63320124", "0.557104", "0.55518925", "0.5459013", "0.5418892", "0.5370092", "0.5326914", "0.5319819", "0.5300342", "0.52911866", "0.52776676", "0.5275197", "0.5236168", "0.5233664", "0.52224684", "0.5213094", "0.52072126", "0.5191101", "0.5190921", "0.5186526", "0.5179781"...
0.0
-1
Instantiate this function with an infinite width.
public AllDifferent() { this(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Plain(int width) {\n this.width = width;\n }", "public FixedWidthFunction(GroupingExpression exp, Number width) {\n this(null, null, exp,\n width instanceof Double ? new DoubleValue(width.doubleValue()) : new LongValue(width.longValue()));\n }", "double getNewWidth();", ...
[ "0.64823556", "0.5968908", "0.5893348", "0.58884764", "0.5641955", "0.5613188", "0.5593008", "0.5591713", "0.55780673", "0.5537561", "0.5511492", "0.54675525", "0.54661113", "0.54651093", "0.54115677", "0.5406519", "0.5383397", "0.5383397", "0.5379138", "0.5377192", "0.537679...
0.0
-1
if a duplicate entry has been found and the width is infinite.
@Override public Boolean getValue(Object x) { if (m_falseCount > 0 && m_width <= 0) return false; allDifferent = true; // if duplicate entries were found in previous calls if (m_falseCount > 0) { m_falseCount--; allDifferent = false; } // compare this entry to every previous one for (int i = m_previousInputs.size() - 1; i >= 0; i--) { if (m_previousInputs.get(i).equals(x)) { // this function will return false at least until this entry is removed m_falseCount = Math.max(m_falseCount, i + (m_width - m_previousInputs.size() - 1)); allDifferent = false; break; } } // update previous entries m_previousInputs.add(x); if (m_width > 0 && m_previousInputs.size() >= m_width) { m_previousInputs.remove(); } return allDifferent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\t\t\tprotected boolean removeEldestEntry(Map.Entry e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn size()>5;\r\n\t\t\t\t\t}", "boolean hasWidth();", "boolean hasWidth();", "boolean hasWidth();", "public boolean removeEldestEntry(Map.Entry entry){\n return size() > capacity;\n ...
[ "0.5627829", "0.5563654", "0.5563654", "0.5563654", "0.5423416", "0.54012316", "0.53828716", "0.53736985", "0.5370324", "0.5356995", "0.5322876", "0.53048307", "0.52965814", "0.5267565", "0.5233001", "0.52117383", "0.51820254", "0.5158915", "0.5151776", "0.5139773", "0.513675...
0.0
-1
this li1ne number is 0 base.
private int getLineNumber(@NonNull String contents, int offset) { String preContents = contents.substring(0, offset); String remContents = preContents.replaceAll("\n", ""); return preContents.length() - remContents.length(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getNumberBase(String n1){\n return Integer.parseUnsignedInt(n1, base);\n }", "public void changeToBaseOne() {\r\n\t\tthis.numberBase = 1;\r\n\t}", "public String negBase2(int n) throws Exception {\r\n\t\t String binaryStr=\"\";\r\n\r\n\t\t int minValue = -256;//allowed min decimal\r\n\...
[ "0.6643646", "0.6513608", "0.6176411", "0.61259305", "0.5929572", "0.58271587", "0.5821877", "0.580789", "0.57892466", "0.5766924", "0.57455724", "0.57062405", "0.56925964", "0.5682736", "0.5681638", "0.56375444", "0.5636765", "0.5636586", "0.5630927", "0.5622785", "0.5604633...
0.0
-1
this column number is 0 base.
private int getColumnNumber(@NonNull String contents, int offset) { String preContents = contents.substring(0, offset); String[] preLines = preContents.split("\n"); int lastIndex = preLines.length -1; return preContents.endsWith("\n") ? 0 : preLines[lastIndex].length(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getIntialSortedColumn()\n { \n return 0; \n }", "@Override\n\tpublic int getNumColumns() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getNumericCode() {\n\t\treturn 0;\n\t}", "public Column(int num)\n {\n colNum = num;\n }", "private int getColumn() {\n re...
[ "0.6459548", "0.6433609", "0.63993835", "0.6370728", "0.6113064", "0.61004806", "0.60702616", "0.60422206", "0.6034876", "0.6025026", "0.5995975", "0.5980472", "0.5980472", "0.5978248", "0.5962278", "0.5929069", "0.5922747", "0.5909779", "0.59080815", "0.5898374", "0.58811396...
0.0
-1
Source of biological unit. Mostly: SYNTHETIC
public StrColumn getSrcMethod() { return delegate.getColumn("src_method", DelegatingStrColumn::new); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getSource();", "public abstract String getSource();", "public String getSource ();", "public String getSource();", "public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }", "public String get_source() {\n\t\treturn source;\n\t}", "java.lang.String getSource();", ...
[ "0.6335917", "0.6234252", "0.62193584", "0.6158671", "0.6150574", "0.6111239", "0.6029425", "0.6029425", "0.5974726", "0.5967423", "0.59562695", "0.59553146", "0.5931785", "0.59167606", "0.5890848", "0.58608466", "0.58188987", "0.5798793", "0.5783144", "0.57827646", "0.575245...
0.0
-1
Spring Data ElasticSearch repository for the Pricing entity.
public interface PricingSearchRepository extends ElasticsearchRepository<Pricing, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ServicePriceSearchRepository extends ElasticsearchRepository<ServicePrice, Long> {\n}", "public interface ProductPricingRepository extends JpaRepository<ProductPricing, Long> {\n}", "public interface GroupRateSearchRepository extends ElasticsearchRepository<GroupRate, Long> {\n}", "@Suppress...
[ "0.7286061", "0.702248", "0.678128", "0.6780915", "0.6644016", "0.6632004", "0.6592339", "0.65712065", "0.6555739", "0.6553429", "0.65470034", "0.6468063", "0.6438855", "0.643353", "0.6415669", "0.6399343", "0.6388844", "0.6373593", "0.63693845", "0.6359977", "0.6359254", "...
0.780306
0
/ This endpoint creates a repository with an starter tag and an optional develop branch.
@RequestMapping(method = RequestMethod.POST, value = "/startRepo") public String initializeRepo(@RequestBody CreateRepoRequestTemplate createRepoRequestTemplate) throws ResourceNotFoundException, BadRequestException { return gitLabService.initializeRepo(createRepoRequestTemplate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "WithCreate withRepoUrl(String repoUrl);", "@Override\n public CreateRepositoryResult createRepository(CreateRepositoryRequest request) {\n request = beforeClientExecution(request);\n return executeCreateRepository(request);\n }", "TRepo createRepo();", "public CompletableFuture<CreateRepo...
[ "0.64799607", "0.61946714", "0.5942678", "0.5871605", "0.58289343", "0.58199525", "0.5801379", "0.5650184", "0.5566602", "0.54939413", "0.54794806", "0.54685163", "0.5384734", "0.5363201", "0.53159964", "0.5276887", "0.5116236", "0.51124275", "0.502043", "0.48835814", "0.4875...
0.5987682
2
TODO Autogenerated method stub
@Override public void editPost(Integer postID, String message, String posterName, String[] imageName, String[] imageID) { }
{ "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 editThread(Integer threadID, String topic, String message, String posterName, String[] imageName, String[] imageID) { }
{ "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 createPost(Integer postID, Integer parentPostID, String posterName, String message, String[] imageName, String[] imageID) { }
{ "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
Process the attack in the animal through the strategy and recalculates the available life power.
public final void receiveAttack(Weapon weapon) { this.availableLifePower = damageStrategy.processAttack(this, weapon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWi...
[ "0.67076623", "0.66352063", "0.6561955", "0.63321954", "0.63310575", "0.63203114", "0.62993586", "0.6287019", "0.62765193", "0.614935", "0.61477584", "0.6080914", "0.6074547", "0.6058662", "0.60457003", "0.6042471", "0.60414237", "0.6028139", "0.60210776", "0.60148257", "0.60...
0.5603315
88
Creates an authorized Credential object.
public static Credential authorize() throws IOException { // Load client secrets. InputStream in = YouTubeDownloader.class.getResourceAsStream("/youtube/downloader/resources/clients_secrets.json"); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader( in )); // Build flow and trigger user authorization request. GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) .setDataStoreFactory(DATA_STORE_FACTORY) .setAccessType("offline") .build(); Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); System.out.println("Credentials saved to " + DATA_STORE_DIR.getAbsolutePath()); return credential; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AbstractCredentialModel createBasicCredential(String username, String password);", "protected static Credentials getServiceCredentials() throws AnaplanAPIException {\n if (authType == AUTH_TYPE.CERT) {\n try {\n return new Credentials(getCertificate(), getPrivateKey());\n } catch (Exception e...
[ "0.66188663", "0.6506624", "0.638938", "0.62834114", "0.6251041", "0.62424284", "0.61427015", "0.6054992", "0.6031464", "0.6030351", "0.60015774", "0.59658563", "0.5901143", "0.5878223", "0.586457", "0.5840592", "0.5813233", "0.5796609", "0.5740635", "0.57173693", "0.5711749"...
0.58576566
15
Build and return an authorized API client service, such as a YouTube Data API client service.
public static YouTube getYouTubeService() throws IOException { Credential credential = authorize(); return new YouTube.Builder( HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName(APPLICATION_NAME) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private YouTube getService() throws GeneralSecurityException, IOException {\n final NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();\n return new YouTube.Builder(httpTransport, JSON_FACTORY, null)\n .setApplicationName(APPLICATION_NAME)\n .build();\n }", "public...
[ "0.63384336", "0.6336757", "0.6198538", "0.6143181", "0.6020759", "0.5928088", "0.58776295", "0.58676696", "0.5846059", "0.5843613", "0.58411926", "0.58395433", "0.5824829", "0.580408", "0.5759715", "0.5748068", "0.57446945", "0.5728541", "0.57241565", "0.5689256", "0.5688689...
0.5493431
35
Use Comparator.comparing and thenComparing to sort the list by balance and then by ownerName Collect your stream into a list and print the sorted result to the console
public static void main(String[] args) { List<Account> accounts = new ArrayList<Account>() { { add(new Account("Bob", 5000, 1001)); add(new Account("Jim", 10000, 1002)); add(new Account("Bruce", 5300, 1003)); add(new Account("Li", 12000, 1004)); add(new Account("Sam", 9000, 1005)); add(new Account("Rick", 11000, 1006)); } }; BiFunction<List<Account>, Integer, List<Account>> MYLIB = (list, f) -> { return list.stream().filter(e -> e.getBalance() > f).collect(Collectors.toList()); }; MYLIB.apply(accounts, 2000).forEach(x -> System.out.println(x.getOwnerName())); MYLIB.apply(accounts, 40000).forEach(x -> System.out.println(x.getOwnerName())); accounts.stream().filter(a -> a.getBalance() > 50000).collect(Collectors.toList()); class A { public A() { } boolean test() { return true; } public String toString(){ return test() + ""; } }; // A a = new A(); // accounts.stream().filter(A::test).collect(Collectors.toList()); Stream.generate(A::new).limit(10).forEach(System.out::println); // s.forEach(System.out::println); //sorting code here System.out.println("----------------------------"); System.out.println(accounts); Collections.sort(accounts, Comparator.comparing(Account::getBalance).thenComparing(Account::getOwnerName).reversed()); // Collections.sort(accounts, Comparator.comparing(Account::getBalance).thenComparing(Account::getOwnerName)); System.out.println(accounts); MyF f = new MyF(); List<Integer> n = Arrays.asList(1, 2, 3, 4,5, 6, 7); f.filter(n, (x) -> ((int) x) > 3).forEach(System.out::println); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n ArrayList<BankAccount> accounts = makeBankingSystem();\n \n Collections.sort(accounts, BankAccount.createComparatorByBalance(false));\n for (BankAccount c: accounts){\n System.out.println(c.getName(c)+\", \"+c.getBalance(c));\n ...
[ "0.7342798", "0.62204266", "0.61799073", "0.61594415", "0.5991168", "0.5972254", "0.59635943", "0.5947595", "0.5941119", "0.5855189", "0.5837831", "0.5768275", "0.57673025", "0.5755676", "0.57053995", "0.569247", "0.56918305", "0.5656489", "0.5646564", "0.56400543", "0.559406...
0.68962926
1
Runs when the job is started
@Override public boolean onStartJob(JobParameters job) { Log.d(LOG_TAG, "Sync job started..."); new Thread(new SyncRunnable(job)).start(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void beforeJobExecution() {\n\t}", "private void scheduleJob() {\n\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "private void startJobs() {\n List<Jo...
[ "0.7282081", "0.708519", "0.7032158", "0.6967531", "0.6950059", "0.6950059", "0.69261444", "0.6897287", "0.688294", "0.68201", "0.6818587", "0.67837304", "0.67837304", "0.6782441", "0.6774908", "0.6769945", "0.67609227", "0.67575425", "0.6755716", "0.67514807", "0.6741714", ...
0.6722545
30
Runs when the job is stopped
@Override public boolean onStopJob(JobParameters job) { Log.d(LOG_TAG, "Sync job stopped"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stop() {\n \t\t\tif (isJobRunning) cancel();\n \t\t}", "@Override\n public boolean onStopJob(JobParameters job) {\n return true;\n }", "@Override\n protected void onStop() {\n stopService(new Intent(this, MyJobScheduler.class));\n super.onStop();\n }", "@Override\...
[ "0.7679481", "0.7384585", "0.7330686", "0.73277533", "0.73160166", "0.7285944", "0.727875", "0.72000724", "0.72000724", "0.7185586", "0.71746755", "0.7173771", "0.7158877", "0.71486473", "0.7144053", "0.71437716", "0.71392363", "0.70970917", "0.70948863", "0.70948863", "0.706...
0.70090365
46
When the sync has completed in a background thread, calls jobFinished()
private void onSyncFinished(JobParameters job) { jobFinished(job, false); // Is a reschedule needed? Log.d(LOG_TAG, "Sync job finished"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void jobFinished(Progress job) {\n }", "protected void finished(){\n if (doFilterUpdate) {\n //runFilterUpdates();\n }\n \n double groupTotalTimeSecs = (System.currentTimeMillis() - (double) groupStartTime) / 1000;\n log.info(\"Job \"+id+\" finished \" /...
[ "0.7151507", "0.7034199", "0.69863266", "0.6974351", "0.68917555", "0.6668809", "0.65870774", "0.6490893", "0.6362296", "0.6340109", "0.6321839", "0.6309747", "0.6287309", "0.6278736", "0.6278736", "0.62505555", "0.6249185", "0.620791", "0.6179291", "0.6169736", "0.6156029", ...
0.79219
0
Dispatches a sync for as soon as the network is available
public static void dispatchSyncNow(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context)); Job syncJob = dispatcher.newJobBuilder() .setTag(SYNC_TAG) .setService(FirebaseSyncJobService.class) .setTrigger(Trigger.NOW) .setRecurring(false) .setReplaceCurrent(true) .setLifetime(Lifetime.UNTIL_NEXT_BOOT) .addConstraint(Constraint.ON_ANY_NETWORK) .build(); dispatcher.mustSchedule(syncJob); Log.d(LOG_TAG, "Sync job dispatched"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void callSync() {\n\n }", "public void requestExtraSync()\n {\n executor.requestExtraSync();\n }", "private void invokeSync()\n \t{\n if (iDeviceList.size() == 0)\n {\n System.out.println(\"No devices found, so nothing to test\");\n ...
[ "0.66346747", "0.643447", "0.61977726", "0.61440086", "0.61266696", "0.5971272", "0.5899578", "0.5873551", "0.57837105", "0.5738586", "0.5730113", "0.5719214", "0.57124233", "0.5709851", "0.5683954", "0.5662162", "0.56315243", "0.5574711", "0.5574383", "0.55683446", "0.554105...
0.5435903
33
Dispatches a sync for midnight on the day it was triggered; The sync will run as soon as the network is available after midnight
public static void dispatchScheduledSync(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context)); Job syncJob = dispatcher.newJobBuilder() .setTag(SYNC_TAG_SCHEDULED) .setService(FirebaseSyncJobService.class) .setTrigger(Trigger.NOW) .setRecurring(false) .setReplaceCurrent(true) .setLifetime(Lifetime.UNTIL_NEXT_BOOT) .addConstraint(Constraint.ON_ANY_NETWORK) .build(); dispatcher.mustSchedule(syncJob); Log.d(LOG_TAG, "Recurring sync job dispatched"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void dispatchSyncNow(Context context) {\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context));\n Job syncJob = dispatcher.newJobBuilder()\n .setTag(SYNC_TAG)\n .setService(FirebaseSyncJobService.class)\n .setTrigge...
[ "0.63342047", "0.5996821", "0.5919967", "0.589004", "0.5886641", "0.58731973", "0.58548844", "0.58517325", "0.58481634", "0.5836042", "0.5832729", "0.5803721", "0.5782976", "0.5780491", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5766398", "0.5760471",...
0.6004485
1
TODO Autogenerated method stub
@Override protected JsonUtil getJsonUtil() { return super.getJsonUtil(); }
{ "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
= new XStream(/new DomDriver()/);
public UE2_0_3Serializer(){ xstream = new XStream(/*new DomDriver()*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static XStream createXStream(){\r\n\t\tXStream xstream = new XStream();\r\n\t\txstream.alias(\"configuration\", FilterConfig.class);\r\n\t\txstream.alias(\"filter\", FilterEnumeration.class);\r\n\t\txstream.alias(\"displayable\", DisplayableValue.class);\r\n\t\treturn xstream;\r\n\t}", "private XStream b...
[ "0.6437617", "0.61609674", "0.6097178", "0.6033878", "0.5750813", "0.56777906", "0.56417257", "0.56292987", "0.5612706", "0.5545476", "0.5510748", "0.54784656", "0.54489815", "0.5396621", "0.53856915", "0.53856915", "0.53856915", "0.5377515", "0.5365683", "0.5359267", "0.5346...
0.7016496
0
overridden in subclasses which handle StsObjects (DBStsClassType) and StsObject arrays (DBArrayType)
public void addToModel(Object object, StsModel model) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test public void getBaseTypeShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array;\n\t\tfor (int type : Array.TYPES_SUPPORTED) {\n\t\t\tarray = new ListArray(list, type);\n\t\t\tassertEquals(type, array.getBaseType());\n\t\t}\n\t}", "public Object[] getOrac...
[ "0.62701625", "0.6001787", "0.59190506", "0.5896174", "0.56076545", "0.55986786", "0.5593873", "0.5554742", "0.5491266", "0.5434515", "0.5389556", "0.5347643", "0.5283941", "0.52790344", "0.5270215", "0.526104", "0.52586496", "0.5224994", "0.52160054", "0.5215911", "0.5214756...
0.0
-1
initilize the MDP space
public MarkovDecisionProcess(int totalWorkloadLevel, int totalGreenEnergyLevel, int totalBatteryLevel, double prob[][][][], int maxTimeInterval) { this.totalWorkloadLevel = totalWorkloadLevel; this.totalGreenEnergyLevel = totalGreenEnergyLevel; this.totalBatteryLevel = totalBatteryLevel; this.prob = prob; this.maxTimeInterval = maxTimeInterval; //Initial State, we set it at [0,0,0] initialState = new State(0, 0, 0, 1, -999, -1); initialState.setPath(initialState.toString()); grid = new State[maxTimeInterval][totalWorkloadLevel][totalGreenEnergyLevel][totalBatteryLevel]; //initialize the reward matix as all 0 rewardMatrix = new double[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; batteryLevelMatrix = new int[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; actionMatrix = new String[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel]; for(int i = 0; i < maxTimeInterval; i++) { for(int j = 0; j < totalWorkloadLevel*totalGreenEnergyLevel; j++) { for(int k = 0; k < totalWorkloadLevel*totalGreenEnergyLevel; k++) { rewardMatrix[i][j][k] = 0.0; batteryLevelMatrix[i][j][k] = 0; actionMatrix[i][j][k] = null; } } } //Initialize actions space, numActions = totalWorkloadLevel * totalBatteryLevel; for(int t =0; t < maxTimeInterval; t++) { for(int i = 0; i < totalWorkloadLevel; i++) { for(int j = 0; j < totalGreenEnergyLevel; j++) { for(int k = 0; k < totalBatteryLevel; k++) { grid[t][i][j][k] = new State(i ,j, k, prob[t][i][j][k], 0.0, t); if( t == maxTimeInterval - 1) { grid[t][i][j][k].setTerminate(); } } } } } reachableStates = new Vector(totalWorkloadLevel*totalGreenEnergyLevel*totalBatteryLevel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "protected void...
[ "0.6601136", "0.6157716", "0.61171573", "0.6083329", "0.60725474", "0.60689014", "0.6026129", "0.59705883", "0.59691113", "0.5969023", "0.5964641", "0.5938181", "0.5920524", "0.5860429", "0.586032", "0.5830627", "0.58145696", "0.5762541", "0.57598805", "0.57218087", "0.570203...
0.0
-1
Identify the possible actions at a time interval
public void compileActions(int totalWorkloadLevel, int totalBatteryLevel) { //possible actions possibleActions = new Vector(totalWorkloadLevel * totalBatteryLevel); for(int i = 0; i < totalWorkloadLevel; i++ ) { for(int j = 0; j < totalBatteryLevel; j++) { possibleActions.add(new Action(i ,j)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected IntervalAction action() {\n CCSize s = Director.sharedDirector().winSize();\n return MoveBy.action(duration, s.width-ADJUST_FACTOR,0);\n }", "public java.lang.String getTimeLimitAction();", "private void getAllTotesCenterTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0...
[ "0.62615496", "0.6211173", "0.6034601", "0.5910164", "0.58662784", "0.5834497", "0.5767944", "0.57226425", "0.5710012", "0.5602206", "0.55739397", "0.5552535", "0.5488966", "0.54438037", "0.5385042", "0.5383318", "0.53721845", "0.53507763", "0.5339337", "0.5339281", "0.533384...
0.0
-1
Find the reachable states. The states with 0 probability are not considered. The following 4 methods are related to states
public void compileStates(int timeinterval) { if(timeinterval == -1) { //Add initial State reachableStates.add(initialState); this.numReachableState = 1; }else{ State s; int index = 0; reachableStates.clear(); for(int i = 0; i < totalWorkloadLevel; i++) { for(int j = 0; j < totalGreenEnergyLevel; j++) { for(int k = 0; k < totalBatteryLevel; k++) { s = grid[timeinterval][i][j][k]; if(s.getProbability() != 0) { //If probability of state is not 0, put this state into the reachable list. s.index = index; index++; reachableStates.add(s); } } } } this.numReachableState = index; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Set<Integer> getStatesFromWichReachableAccepting(LabelledTransitionSystem ret) {\n\t\tMap<Integer, Set<Integer>> reversedReachable = this.computeInverseTransitionRelation(ret);\n\n\t\tSet<Integer> reachable = new HashSet<>();\n\n\t\tlogger.debug(\"Accepting states: \" + ret.getAccepting());\n\t\tSet<Integ...
[ "0.6960649", "0.6578546", "0.6324636", "0.63120854", "0.62913", "0.6270745", "0.6253968", "0.62040216", "0.6181632", "0.6178198", "0.61097604", "0.59901774", "0.5923785", "0.59135926", "0.5866732", "0.5804204", "0.5799127", "0.5793137", "0.5774621", "0.5748617", "0.5748397", ...
0.614467
10
The following methods are related to actions.
public void setAction(State s, Action a) { if(s.isTerminated()) return ; s.action = a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "@Override\n\tpublic void action() {\n\n\t}", "public void a...
[ "0.7511674", "0.7511674", "0.7511674", "0.7497134", "0.7301133", "0.7022942", "0.701082", "0.701082", "0.6969324", "0.6966433", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.6960882", "0.69602305", "0.6944075", "0.6889046", "0...
0.0
-1
To validate the transit is possible, e.g. using some actions can reach out of boundary. The next state should belong to [0, maxLevel)
public boolean isPossibleTransit(State s, Action a) { // int newWorkloadLevel = s.getWorkload() + a.getChangedWorkload(); int maxBatteryLevel = getNextBatteryLevel(s, a); int maxActionLevel = s.getWorkload(); if((a.getChangedWorkload() <= maxActionLevel) && (a.getBatteryUsed() <= maxBatteryLevel)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isFeasibleState(int[] state){\n if((state[0] <= totalMissionaries && state[0] >= 0)&&(state[1] <= totalCannibals && state[1] >= 0)) {\n return true;\n }\n return false;\n }", "private boolean isLegalState(int[] state){\n int[] stat...
[ "0.6315222", "0.6267551", "0.582121", "0.57448274", "0.56248367", "0.55508405", "0.54710585", "0.5460037", "0.5436863", "0.543296", "0.5431234", "0.5420635", "0.54013866", "0.53622645", "0.535507", "0.53387207", "0.53198844", "0.5304792", "0.5287709", "0.5286305", "0.5277106"...
0.60037935
2
Handle when the module create
private void onModuleCreate(HTMLCanvasElement element, Display.Preference preference) { Window.current().getDocument().addEventListener("visibilitychange", evt -> { if (isHidden()) { mLifecycle.onPause(); } else { mLifecycle.onResume(); } }); mDisplay.onModuleCreate(element, preference); //! //! Create audio module. //! mAudio.onModuleCreate(new WebOpenALES10()); mAudioThread.schedule(new TimerTask() { @Override public void run() { mAudio.onModuleUpdate(); } }, 0L, THREAD_AUDIO_DELAY); //! //! Create input module. //! mInput.onModuleCreate( new WebInputKeyboard(Window.current().getDocument().getDocumentElement()), new WebInputMouse(element)); mInputThread.schedule(new TimerTask() { @Override public void run() { mInput.onModuleUpdate(); } }, 0L, THREAD_INPUT_DELAY); //! //! Create render module. //! mRender.onModuleCreate(new WebOpenGLES32(element)); //! //! Create resource module. //! mResources.registerAssetLocator("EXTERNAL", new XHRAssetLocator()); mResources.registerAssetLoader(new TexturePNGAssetLoader(), "png"); mResources.registerAssetLoader(new TextureDDSAssetLoader(), "dds", "s3tc"); mResources.registerAssetLoader(new AudioWAVAssetLoader(), "wav"); mResources.registerAssetLoader(new AudioOGGAssetLoader(), "ogg"); mResources.registerAssetLoader(new FontBinaryAssetLoader(), "fnt"); mResources.registerAssetLoader(new ShaderBinaryAssetLoader(QKRender.getCapabilities()), "shader"); //! //! Handle the create notification. //! mLifecycle.onCreate(); mLifecycle.onResize(mDisplay.getWidth(), mDisplay.getHeight()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Module createModule();", "private void onModuleCreate(Display.Preference preference) {\n //!\n //! Create display module.\n //!\n final GLFWFramebufferSizeCallback resize = GLFWFramebufferSizeCallback.create((window, width, height) ->\n {\n mLifecycle.onResize(width,...
[ "0.68034625", "0.6711702", "0.6527934", "0.6393818", "0.63243264", "0.6164201", "0.6121402", "0.6116891", "0.6078842", "0.6066631", "0.6059779", "0.6052971", "0.6052953", "0.6026041", "0.6000761", "0.5979037", "0.5970702", "0.5948964", "0.59469575", "0.5939309", "0.5925476", ...
0.62566835
5
Handle when the module destroy
private void onModuleDestroy() { //! //! Handle the destroy notification. //! mLifecycle.onPause(); mLifecycle.onDispose(); //! //! Unload resource module. //! mResources.onModuleDestroy(); mResources.unloadAll(); //! //! Unload input module. //! mInputThread.cancel(); mInput.onModuleDestroy(); //! //! Unload audio module. //! mAudioThread.cancel(); mAudio.onModuleDestroy(); //! //! Unload render module. //! //! NOTE: Update the render to destroy all render component(s) //! mRender.onModuleUpdate(); mRender.onModuleDestroy(); //! //! Unload display module. //! mDisplay.onModuleDestroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void onModuleDestroy() {\n //!\n //! Handle the destroy notification.\n //!\n mLifecycle.onPause();\n mLifecycle.onDispose();\n\n //!\n //! Unload resource module.\n //!\n mResources.onModuleDestroy();\n mResources.unloadAll();\n\n ...
[ "0.8181511", "0.75969905", "0.7558324", "0.7558324", "0.7441234", "0.7431554", "0.74286646", "0.74250126", "0.7419767", "0.74126613", "0.73860735", "0.7385367", "0.73809224", "0.7374312", "0.7363231", "0.7361256", "0.73571324", "0.73571324", "0.73571324", "0.73571324", "0.735...
0.81478137
1
Handle when the module update
private void onModuleUpdate() { if (mTime == -1L) { mTime = System.currentTimeMillis(); } //! //! Render until the display is not active. //! onModuleRender(System.currentTimeMillis()); //! //! Request to render again. //! onAnimationRequest(this::onModuleUpdate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\tpublic void onUpdateFound(boolean newVersion, String whatsNew) {\n\t\t\t\t\t}", "public void receivedUpdateFromServer();", "protected void onUpdate() {\r\n\r\n\t}", "private void checkForUpdates() {\n UpdateManager.register(this);\n }", "private void checkForUpdates() {\n ...
[ "0.6469783", "0.64249146", "0.6423273", "0.62885034", "0.62885034", "0.62644833", "0.6256242", "0.62548566", "0.62518567", "0.62348956", "0.6197051", "0.6189723", "0.61573714", "0.6141606", "0.61268306", "0.61223435", "0.61118865", "0.6096208", "0.6074734", "0.6072602", "0.60...
0.6269706
5
Handle when the module render
private void onModuleRender(long time) { //! //! Handle the render notification. //! mLifecycle.onRender((time - mTime) / 1000.0f); //! //! Update the new delta time. //! mTime = time; //! //! Update the render. //! //! NOTE: House-keeping of render component(s). //! mRender.onModuleUpdate(); //! //! Update the display. //! //! NOTE: Will synchronise with the window. //! mDisplay.onModuleUpdate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onModuleLoad() {\n }", "protected void render(){}", "private void onModuleUpdate() {\n if (mTime == -1L) {\n mTime = System.currentTimeMillis();\n }\n\n //!\n //! Render until the display is not active.\n //!\n onModuleRender(Sy...
[ "0.66186696", "0.6570539", "0.65294087", "0.6513774", "0.6488292", "0.6309487", "0.6306284", "0.62951434", "0.6203096", "0.6157021", "0.612381", "0.61110157", "0.6097233", "0.60969275", "0.60931396", "0.6078594", "0.6070372", "0.6069029", "0.6024401", "0.601679", "0.59685624"...
0.64993
4
Construct the conditional element from an XML node
public SCondition(Node node) { super(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ConditionalExpression createConditionalExpression();", "public Instruction startConditionalNode(final PsiElement element, final PsiElement condition, final boolean result) {\n final ConditionalInstruction instruction = new ConditionalInstructionImpl(this, element, condition, result);\n addNode(instruction)...
[ "0.6060902", "0.59389997", "0.5817393", "0.5599313", "0.5585734", "0.543987", "0.53712994", "0.5344337", "0.5213824", "0.5054645", "0.5044381", "0.49947184", "0.4972317", "0.4969138", "0.4935641", "0.493025", "0.48860538", "0.4874012", "0.48736987", "0.48621866", "0.4859078",...
0.5184418
9
/ access modifiers changed from: protected
public void updateBackground(int i, int i2, int i3, int i4) { if (this.mLauncher.getDeviceProfile().isVerticalBarLayout()) { View revealView = getRevealView(); int i5 = i; int i6 = i2; int i7 = i3; int i8 = i4; InsetDrawable insetDrawable = new InsetDrawable(this.mBaseDrawable, i5, i6, i7, i8); revealView.setBackground(insetDrawable); View contentView = getContentView(); InsetDrawable insetDrawable2 = new InsetDrawable(new ColorDrawable(0), i5, i6, i7, i8); contentView.setBackground(insetDrawable2); return; } getRevealView().setBackground(this.mBaseDrawable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override...
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.640...
0.0
-1
/ access modifiers changed from: protected
public void onFinishInflate() { super.onFinishInflate(); getContentView().setOnFocusChangeListener(new OnFocusChangeListener() { public void onFocusChange(View view, boolean z) { if (z) { AllAppsContainerView.this.mAppsRecyclerView.requestFocus(); } } }); this.mAppsRecyclerView = (AllAppsRecyclerView) findViewById(C0622R.C0625id.apps_list_view); this.mAppsRecyclerView.setApps(this.mApps); this.mAppsRecyclerView.setLayoutManager(this.mLayoutManager); this.mAppsRecyclerView.setAdapter(this.mAdapter); this.mAppsRecyclerView.setHasFixedSize(true); this.mAppsRecyclerView.setItemAnimator(null); this.mAppsRecyclerView.setSpringAnimationHandler(this.mSpringAnimationHandler); this.mSearchContainer = findViewById(C0622R.C0625id.search_container_all_apps); this.mSearchUiManager = (SearchUiManager) this.mSearchContainer; this.mSearchUiManager.initialize(this.mApps, this.mAppsRecyclerView); FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(this.mAppsRecyclerView); this.mAppsRecyclerView.addItemDecoration(focusedItemDecorator); this.mAppsRecyclerView.preMeasureViews(this.mAdapter); this.mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener()); getRevealView().setVisibility(0); getContentView().setVisibility(0); getContentView().setBackground(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override...
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.640...
0.0
-1
/ access modifiers changed from: protected
public void onMeasure(int i, int i2) { DeviceProfile deviceProfile = this.mLauncher.getDeviceProfile(); deviceProfile.updateAppsViewNumCols(); if (!(this.mNumAppsPerRow == deviceProfile.inv.numColumns && this.mNumPredictedAppsPerRow == deviceProfile.inv.numColumns)) { this.mNumAppsPerRow = deviceProfile.inv.numColumns; this.mNumPredictedAppsPerRow = deviceProfile.inv.numColumns; this.mAppsRecyclerView.setNumAppsPerRow(deviceProfile, this.mNumAppsPerRow); this.mAdapter.setNumAppsPerRow(this.mNumAppsPerRow); this.mApps.setNumAppsPerRow(this.mNumAppsPerRow, this.mNumPredictedAppsPerRow); } super.onMeasure(i, i2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override...
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.640...
0.0
-1
Creates new form UdpExample
public UdpExample() { initComponents(); myInitComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createClient() {\n client = new UdpClient(Util.semIp, Util.semPort, this);\n\n // Le paso true porque quiero que lo haga en un hilo nuevo\n client.connect(true);\n }", "private void createThreadUdp(){\n System.out.println(\"dirport: \"+serverDirPort);\n System.ou...
[ "0.58957815", "0.57204866", "0.55944467", "0.5585818", "0.5500188", "0.54953784", "0.5358484", "0.5327305", "0.523669", "0.5218695", "0.518186", "0.51683307", "0.5143919", "0.5135067", "0.5125136", "0.51148444", "0.51035833", "0.5090125", "0.50848883", "0.50686747", "0.503856...
0.6603273
0
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. //GENBEGIN:initComponents
private void initComponents() { udpServer = new UdpServer(); jLabel1 = new javax.swing.JLabel(); portField = new javax.swing.JFormattedTextField(0); jLabel2 = new javax.swing.JLabel(); groupField = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); incomingArea = new javax.swing.JTextArea(); jLabel3 = new javax.swing.JLabel(); stateLabel = new javax.swing.JLabel(); startStopButton = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); receiveIndicator = new IndicatorLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Udp Server Example"); jLabel1.setText("Port:"); portField.setColumns(12); portField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { portFieldActionPerformed(evt); } }); portField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { portFieldFocusLost(evt); } }); jLabel2.setText("Multicast Group:"); groupField.setColumns(12); groupField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { groupFieldActionPerformed(evt); } }); groupField.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { groupFieldFocusLost(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Incoming")); incomingArea.setColumns(20); incomingArea.setLineWrap(true); incomingArea.setRows(5); incomingArea.setWrapStyleWord(true); jScrollPane1.setViewportView(incomingArea); 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() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE) .addContainerGap()) ); jLabel3.setText("State:"); stateLabel.setText("Unknown"); startStopButton.setText("Start/Stop"); startStopButton.setEnabled(false); startStopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startStopButtonActionPerformed(evt); } }); jButton1.setText("Stress"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); receiveIndicator.setText("RECV"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(stateLabel)) .addGroup(layout.createSequentialGroup() .addComponent(groupField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(startStopButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addGap(18, 18, 18) .addComponent(receiveIndicator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(4, 4, 4))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(portField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3) .addComponent(stateLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(groupField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(startStopButton) .addComponent(jButton1))) .addComponent(receiveIndicator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public Form() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public GUIForm() { \...
[ "0.7392436", "0.7392436", "0.7392436", "0.73524207", "0.7332867", "0.73308986", "0.729576", "0.7267236", "0.72270304", "0.721562", "0.7159843", "0.71548635", "0.715188", "0.71416056", "0.7137083", "0.7133313", "0.71205837", "0.7119088", "0.71151245", "0.7110943", "0.7088094",...
0.0
-1
Devuelve el siguiente elemento de la iteracion.
public T getNext() { T elem = handler.getTop(); handler.pop(); return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object nextElement() {\n/* 75 */ return this.iterator.next();\n/* */ }", "@Override public T next() {\n T elem = null;\n if (hasNext()) {\n Nodo<T> nodo = pila.pop();\n elem = nodo.elemento;\n nodo = nodo.derecho;\n while(nod...
[ "0.7192707", "0.6767897", "0.67309755", "0.6702413", "0.6571108", "0.6538033", "0.6536762", "0.6527444", "0.64980906", "0.64886534", "0.647263", "0.64412105", "0.6434362", "0.6362155", "0.63204587", "0.6312327", "0.63089746", "0.6299254", "0.62807673", "0.6239724", "0.6233277...
0.0
-1
Devuelve cierto si aun quedan elementos sin visitar en la iteracion.
public boolean hasNext() { return !handler.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean hasNext() {\n return numeroDiNodiAncoraVisitabili>0;\n }", "@Override\n public boolean hasNext() {\n return nextElementSet || setNextElement();\n }", "public boolean hasNext() {\n return neste.neste != null;\n }", ...
[ "0.7592424", "0.6926388", "0.6878384", "0.6870281", "0.68617177", "0.68286926", "0.67438436", "0.6730197", "0.67210704", "0.6719351", "0.6699117", "0.6674327", "0.66348255", "0.6598542", "0.6592435", "0.6578686", "0.6569268", "0.65667766", "0.65659076", "0.65659076", "0.65510...
0.0
-1
Restablece el iterador al comienzo.
public void reset() { handler = new StackDynamic<T>(restart); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n//...
[ "0.692098", "0.6857741", "0.64886135", "0.6363798", "0.63234025", "0.63232815", "0.6194288", "0.6186084", "0.6163172", "0.61521715", "0.61305285", "0.61029303", "0.60938513", "0.6057746", "0.6014972", "0.59946156", "0.59726554", "0.5968486", "0.58997965", "0.58735925", "0.587...
0.0
-1
========================================================================== Misc. Method(s) ========================================================================== JBuilder init method. Constructs the Add Vehicle Dialog. Using XYLayout to allow rapid building, final version will use swing layout manager(s).
void jbInit() throws Exception { //setup file dialog filer1.setFrame(f); filer1.setMode(FileDialog.LOAD); filer1.setTitle("Select Vehicle Image"); panel1.setLayout(xYLayout1); jLabel1.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel1.setText("VIN"); jLabel2.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel2.setText("Name"); jLabel3.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel3.setText("Year"); jLabel4.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel4.setText("Make"); jLabel5.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel5.setText("Model"); jLabel6.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel6.setText("Color"); jLabel7.setFont(new java.awt.Font("Dialog", 1, 12)); jLabel7.setText("Mileage"); jLabel8.setForeground(Color.darkGray); jLabel8.setText("(Required)"); addButton.setText("Add Vehicle"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { addButton_actionPerformed(e); } }); cancelButton.setText("Cancel "); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton_actionPerformed(e); } }); panel1.setBorder(BorderFactory.createLineBorder(Color.black)); jLabel9.setForeground(Color.darkGray); jLabel9.setText("(Required)"); xYLayout1.setHeight(300); xYLayout1.setWidth(462); imagePath.setText("Path to vehicle image"); jButton1.setText("jButton1"); imageLabel.setFont(new java.awt.Font("SansSerif", 1, 12)); imageLabel.setText("Vehicle Image"); getContentPane().add(panel1); panel1.add(jLabel2, new XYConstraints(11, 56, 45, 26)); panel1.add(jLabel1, new XYConstraints(11, 21, 45, 26)); panel1.add(jLabel8, new XYConstraints(306, 21, 76, 20)); panel1.add(vinField, new XYConstraints(92, 21, 196, 26)); panel1.add(nameField, new XYConstraints(92, 56, 159, 26)); panel1.add(mileageField, new XYConstraints(92, 232, 130, 26)); panel1.add(jLabel7, new XYConstraints(11, 232, 45, 26)); panel1.add(jLabel3, new XYConstraints(11, 91, 45, 26)); panel1.add(jLabel5, new XYConstraints(11, 165, 45, 26)); panel1.add(jLabel6, new XYConstraints(11, 200, 45, 26)); panel1.add(yearField, new XYConstraints(92, 91, 74, 26)); panel1.add(modelField, new XYConstraints(92, 165, 130, 26)); panel1.add(colorField, new XYConstraints(92, 200, 130, 26)); panel1.add(makeField, new XYConstraints(92, 128, 130, 26)); panel1.add(jLabel4, new XYConstraints(11, 128, 45, 26)); panel1.add(cancelButton, new XYConstraints(233, 267, 102, 29)); panel1.add(addButton, new XYConstraints(50, 267, 102, 29)); panel1.add(jLabel9, new XYConstraints(306, 60, 76, 20)); panel1.add(imagePath, new XYConstraints(241, 128, 180, 26)); panel1.add(imageLabel, new XYConstraints(241, 103, 97, 22)); panel1.add(jButton1, new XYConstraints(428, 129, 25, 24)); panel1.add(vehicleImageLabel, new XYConstraints(242, 163, 209, 95)); //add listeners imagePath.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(FocusEvent e) { imagePath_focusLost(e); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CarRentalGUI() {\n initComponents();\n this.setLocationRelativeTo(null);\n\n //set outer border\n Border globalBorder = BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLUE);\n jPanel6.setBorder(globalBorder);\n\n Border labelBorder = BorderFactory.createMatteBord...
[ "0.6469756", "0.6445048", "0.6428486", "0.6292821", "0.6272948", "0.6254247", "0.6250972", "0.62066776", "0.6204562", "0.6202428", "0.61703134", "0.61426735", "0.61191094", "0.6111631", "0.6110794", "0.6087033", "0.60704136", "0.60688585", "0.6065546", "0.60648066", "0.606238...
0.61838967
10
Add ActionListener(s) to this object's components.
public void addActionlistener(ActionListener l) { cancelButton.addActionListener(l); addButton.addActionListener(l); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addActionListeners() {\n\t\tif(this.actionListener == null)\n\t\t\t\treturn; \n\t\t\n\t\t\n\t\t/**\n\t\t\tADD ACTION LISTENERS FOR BUTTONS HERE \n\t\t*/\n\t\tclearButton.addActionListener(this.actionListener);\n\t\tsinButton.addActionListener(this.actionListener);\n\t\tcosButton.addActionListener(thi...
[ "0.7544628", "0.70504725", "0.70274967", "0.7007636", "0.69900686", "0.6946617", "0.69072986", "0.6870675", "0.6811738", "0.6727979", "0.67126465", "0.6658835", "0.66560894", "0.6621376", "0.6617824", "0.65839547", "0.65759295", "0.6573816", "0.653521", "0.65268123", "0.65120...
0.60643977
55
========================================================================== Accessor Method(s) ========================================================================== get VIN field
public String getVinField() { return vinField.getText(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getVin() {\r\n return vin;\r\n }", "public String getVin() {\r\n return vin;\r\n }", "public String getVin() {\n\t\treturn vin;\n\t}", "@java.lang.SuppressWarnings(\"all\")\n\t@javax.annotation.Generated(\"lombok\")\n\tpublic Integer getVout() {\n\t\treturn this.vout;\n\t}",...
[ "0.8019909", "0.8019909", "0.7904182", "0.6519607", "0.6426085", "0.6360435", "0.6318972", "0.63120234", "0.6292406", "0.62828076", "0.6263334", "0.6227649", "0.6151719", "0.6117357", "0.61125505", "0.60916674", "0.60594875", "0.59920293", "0.5984074", "0.5974455", "0.5945448...
0.793292
2
Add a barge to the schedule. The schedule should be sorted on the latest starting time in order to construct waiting profiles. Because LinkedHashMap (in which schedule is stored) does not provide this functionality out of the box, we implemented that in this method as well.
public void addAppointment(Barge barge, int LAT, int LST, int PT) { // determine position where the appointment should be inserted. // the schedule should be sorted on the LST in order to create // a right waiting profile // to keep track of the position we use integer i. int i = 0; for (Barge b : this.appointments.keySet()) { // compare LAT of Barge b with the LAT of the new barge if (LST > this.appointments.get(b)[1]) { i++; } else { break; } } // create a new LinkedHashMap that replaces appointments at the end of // this method LinkedHashMap<Barge, int[]> newAppointments = new LinkedHashMap<Barge, int[]>(); for (int j = 0; j < appointments.size() + 1; j++) { if (j < i) { // add the appointment from appointments to newAppointments Barge key = (Barge) appointments.keySet().toArray()[j]; int[] value = appointments.get(key); newAppointments.put(key, value); } else if (j == i) { // add the new appointment at this position int PST = LST; int EDT = PST + PT; newAppointments .put(barge, new int[] { LAT, LST, PST, PT, EDT }); } else { // add the remaining appointment after the new appointment Barge key = (Barge) appointments.keySet().toArray()[j - 1]; int[] value = appointments.get(key); newAppointments.put(key, value); } } // replace appointments with newAppointments this.appointments = newAppointments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bargeArrives(Barge barge, int time) {\r\n\t\tthis.actualArrival.put(barge, time);\r\n\t\tthis.queue.add(barge);\r\n\t\t//System.out.println(barge+\" arrived to \"+this.name+\"// arraival list= \"+this.actualArrival);\r\n\r\n\t\tif (Port.terminalLogic.equals(\"Unreserved\")\r\n\t\t\t\t&& this.state == T...
[ "0.5888798", "0.5256955", "0.52559215", "0.5074789", "0.49696532", "0.4933672", "0.47966903", "0.4784746", "0.47363544", "0.4670205", "0.46597457", "0.45890528", "0.45849794", "0.45724517", "0.45602462", "0.45258614", "0.4513077", "0.45021588", "0.44744876", "0.44405648", "0....
0.64348143
0
Construct and send the waiting profile
public WaitingProfile constructWaitingProfile(Barge barge, int currentTime) { /*if(Port.eventsToExcel.equals("Yes")){ Port.stats.addEvent(currentTime, barge.bargeNumber, (barge.toString()+ " asked Terminal " + this.toString()+ " for appoints "+ " ||appointements= " +this.appointmentsToString())); }*/ return new WaitingProfile(this, barge, currentTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WaitMessage() {\n super(\"Wait for other player...\\n\");\n }", "public WaitingScreen() {\r\n super(\"Please wait...\", new Item[0]);\r\n mWaitString = new StringItem(\"Network\", \"\\nServer contacting...\");\r\n append(mWaitString);\r\n }", "public void takeABus() {\n...
[ "0.5978791", "0.593957", "0.57592046", "0.57502234", "0.5711542", "0.56396985", "0.54175526", "0.54088545", "0.53503424", "0.5343656", "0.5277495", "0.5212677", "0.51851505", "0.51746285", "0.51730317", "0.51724344", "0.5170638", "0.5169571", "0.5169422", "0.51569474", "0.514...
0.6625135
0
[ISchedulableAction] Starts the handling of a barge
public void bargeArrives(Barge barge, int time) { this.actualArrival.put(barge, time); this.queue.add(barge); //System.out.println(barge+" arrived to "+this.name+"// arraival list= "+this.actualArrival); if (Port.terminalLogic.equals("Unreserved") && this.state == Terminal.IDLE) { // //////////////////////////////////the last two argument defined // by me//////////////////////////////////////////////////// Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); } else if (Port.terminalLogic.equals("Reserved") && this.state == Terminal.IDLE) { boolean []c=checkIfHandleBarge(barge, time); //if could not handle the barge and it was late check && c[1] for next one if(!c[0] ){ checkNextPossibleBargeToHandle(time); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void startAction() {\n\t if (!balls.isEmpty() && firingBall == null) {\n\t gb.addToActiveList(this);\n\t //fire next ball\n\t firingBall = (Ball)balls.remove(0);\n\t firingBall.setAbsorbed(false);\n\t firingBall.setVy(-50*25);\n\t //align balls that ...
[ "0.60295343", "0.5606827", "0.5590184", "0.55576533", "0.5528375", "0.5524553", "0.5486794", "0.5465112", "0.54485816", "0.5447672", "0.54170245", "0.54109377", "0.54080003", "0.53897685", "0.53719693", "0.5360487", "0.5346576", "0.53193474", "0.5295799", "0.526556", "0.52616...
0.5785605
1
/ returns a boolean array the cell 0 is if barge handled and cell 1 if rejected
private boolean[] checkIfHandleBarge(Barge barge, int time) { boolean [] result={false, false}; // if there is no other barge in the appointment list start handling // directly if (this.appointments.size() == 1) { Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } else { // we need the following information to check whether or not the // barge can start handling /*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0]; Barge secondBargeInSchedule = (Barge) this.appointments.keySet().toArray()[1];*/ int expectedEndTimeThisBarge = time+ barge.handlingTimes.get(barge.terminals.indexOf(this)); int latThisBarge= this.appointments.get(barge)[0]; //System.out.println(this.name+" wants to check "+barge+" in this arrival list "+this.actualArrival+" and que= "+this.queue); int actualArrive = this.actualArrival.get(barge); /*int lstNextAppointment = this.appointments.get(nextBargeInSchedule)[1]; int lstSecondAppointment = this.appointments.get(secondBargeInSchedule)[1];*/ //if next in schedule and it was not late if ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge >= actualArrive)) { this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } //if next barge in schedule but it was late check to see if it is possible to handle it without interrupting other appointments else if ((barge.equals(this.appointments.keySet().toArray()[0]) == true && latThisBarge <= actualArrive)) { if (expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[1])[1]){ this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } else { this.queue.remove(barge); this.appointments.remove(barge); //System.out.println(barge+" removed from "+this.name); //System.out.println(barge+" removed from the "+ this.name); if (Port.eventsToExcel.equals("Yes")) { Port.stats .addEvent( time, barge.bargeNumber, ("rejected at Terminal " + this.toString() + "due to delay")); } // notify barge to calculate rotation again barge.recalculateRotation(time); result[0]=false; result[1]=true; return result; } } // if it is not the next one see if it is possible to service it without interrupting others //also if the next barge is late start this one else if ((barge.equals(this.appointments.keySet().toArray()[0]) == false && expectedEndTimeThisBarge <= this.appointments.get(this.appointments.keySet().toArray()[0])[1]) ||(barge.equals(this.appointments.keySet().toArray()[0]) == false && time > this.appointments.get(this.appointments.keySet().toArray()[0])[1])){ this.state=Terminal.HANDLING; Port.schedule.schedule(ScheduleParameters.createOneTime( time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", barge, time); result[0]=true; return result; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean arrCompleted(Boolean[] boolarray) {\n for (int i=0; i < boolarray.length; i++) {\n if (boolarray[i] == false) {\n return false;\n }\n }\n return true;\n }", "public abstract boolean[] calculate();", "public boolean[] binaryRep() {\r\n\t\tint ...
[ "0.6177478", "0.58768654", "0.5826917", "0.57497036", "0.57344043", "0.5653771", "0.55440766", "0.55113983", "0.5510413", "0.5458107", "0.5432543", "0.5430274", "0.54228544", "0.5409766", "0.5367916", "0.5297036", "0.52512187", "0.5243054", "0.5242889", "0.5239475", "0.523783...
0.55202043
7
[ISchedulableAction] Finish handling of a barge
public void finishHandling(Barge barge, int time) { // remove the barge from appointments of terminal this.appointments.remove(barge); this.numHandling--; //this.state = Terminal.IDLE; // let the barge decide what to do after it finished handling barge.afterFinish(time, this); if (Port.eventsToExcel.equals("Yes")) { Port.stats.addEvent(time, barge.bargeNumber, ("Finished handling at Terminal " + this.toString())); } if (this.queue.size() == 0) { this.state = Terminal.IDLE; } else if (Port.terminalLogic.equals("Unreserved") ) { Barge nextBarge = this.queue.peek(); Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBarge, time); } else if (Port.terminalLogic.equals("Reserved")) { // System.out.print("queue "+this.queue); // System.out.print(" appointments "+this.appointments); // System.out.println(this.name); if (!checkNextPossibleBargeToHandle(time)){ this.state = Terminal.IDLE; } /*Barge nextBargeInSchedule = (Barge) this.appointments.keySet().toArray()[0]; if (this.queue.contains(nextBargeInSchedule) == true) { Port.schedule.schedule(ScheduleParameters.createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBargeInSchedule, time); } else { int lstNextAppointment = this.appointments .get(nextBargeInSchedule)[1]; boolean startNextBarge = false; for (Barge nextBarge : this.queue) { //System.out.print(nextBarge); //System.out.print(nextBarge.terminals); //System.out.print(" handeling times"+ nextBarge.handlingTimes); //System.out.println(" "+this.name); int expectedEndTimeThisBarge = time + nextBarge.handlingTimes.get(nextBarge.terminals.indexOf(this)); if (expectedEndTimeThisBarge <= lstNextAppointment) { Port.schedule.schedule(ScheduleParameters .createOneTime(time, ScheduleParameters.LAST_PRIORITY), this, "handleBarge", nextBarge, time); startNextBarge = true; break; } } if (startNextBarge == false) { this.state = Terminal.IDLE; } }*/ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void finish() {\n if ( actor.hasActions() )\r\n actor.getActions().first().act(100000);\r\n // remove any remaining actions\r\n actor.clearActions();\r\n }", "public void bargeArrives(Barge barge, int time) {\r\n\t\tthis.actualArrival.put(barge, time);\r\n\t\tthis.queue....
[ "0.6180914", "0.6005668", "0.59980047", "0.5964356", "0.59331924", "0.58989424", "0.58989424", "0.583515", "0.58235973", "0.5820916", "0.58036083", "0.58036083", "0.58036083", "0.5775158", "0.57534784", "0.5750173", "0.5719388", "0.5704176", "0.5671254", "0.56403315", "0.5607...
0.6209253
0
used to display the queue size in the chart in the GUI
public int getQueueSize() { return this.queue.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void refreshQueueCount(){\n queueCountLabel.setText(\"Count: \" + String.valueOf(builder.size()));\n }", "public static void setSizeOfQueue(Label sizeOfQueueValue) {\n \tsizeOfQueueValue.setText(String.valueOf(Capture.getInspectionQueue().size()));\n }", "private void updateQueueSize() {...
[ "0.7117305", "0.7057366", "0.63759696", "0.6305131", "0.6222833", "0.6218054", "0.61677057", "0.61127317", "0.6040652", "0.59914076", "0.59774333", "0.5955932", "0.59541416", "0.59411484", "0.59391844", "0.5908418", "0.58950377", "0.5893207", "0.5882426", "0.58606815", "0.583...
0.5706392
35
used to display the number of busy terminals in the GUI
public int getNumhandling() { return this.numHandling; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumIdle();", "protected void printNumberSelectedPicturesOnStatusLine( ) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\t \n\t\t\tpublic void run() {\n\t\t\t\tString text;\n\t\t\t\tint count = indexData.pictureSelected.cardinality();\n\t\t\t\tif (count == 1) {\n\t\t\t\t\ttext = \"1 picture...
[ "0.61746365", "0.594273", "0.5871741", "0.58549523", "0.58340186", "0.5815044", "0.58114344", "0.5793308", "0.5776639", "0.5737697", "0.57220066", "0.57064086", "0.5644291", "0.56392187", "0.56334", "0.56326735", "0.5588907", "0.55809414", "0.55712754", "0.5569568", "0.552272...
0.0
-1
Initializes the controller class.
@Override public void initialize(URL url, ResourceBundle rb) { model=DomainController.getInstance(); addDataToChoiceBox(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Co...
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.691256...
0.0
-1
nastavenie komponentov ktore sa zobrazia v scene
public void setUpEditStage(){ solvableCircle = solvableCircleComponents(); Circle wCircle = whiteButtonComponents(); whiteCellButton = new Button("", wCircle); whiteCellButton.getStyleClass().add("edit-buttons"); whiteCellButton.setOnAction(e-> whiteCellButtonAction()); Circle bCircle = blackButtonComponents(); blackCellButton = new Button("", bCircle); blackCellButton.getStyleClass().add("edit-buttons"); blackCellButton.setOnAction(e-> blackCellButtonAction()); removeCellButton = new Button(""); removeCellButton.getStyleClass().add("edit-buttons"); removeCellButton.setOnAction(e-> removeCellButtonAction()); StackPane sp = plusButtonComponents(); plusButton = new Button("", sp); plusButton.getStyleClass().add("edit-buttons"); plusButton.setOnAction(e-> plusButtonAction()); Rectangle minusRect = minusButtonComponents(); minusButton = new Button("", minusRect); minusButton.getStyleClass().add("edit-buttons"); minusButton.setOnAction(e-> minusButtonAction()); leftButtons = new HBox(); leftButtons.setPrefHeight(25); leftButtons.setSpacing(10); leftButtons.getChildren().addAll(whiteCellButton, blackCellButton, removeCellButton); rightButtons = new HBox(); rightButtons.setPrefHeight(25); rightButtons.setSpacing(10); rightButtons.getChildren().addAll(plusButton, minusButton); topPane = new BorderPane(); topPane.setStyle("-fx-background-color: linear-gradient(to right, #2b5876, #4e4376);"); topPane.setRight(rightButtons); topPane.setCenter(solvableCircle); topPane.setLeft(leftButtons); getBack.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); getBack.setOnAction(e-> getBackButtonAction()); check.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); check.setOnAction(e-> checkButtonAction()); save.getStyleClass().addAll("bottomButtonStyle", "bottomButtonStyle-edit"); save.setOnAction(e-> saveButtonAction()); bottomPane = new BorderPane(); bottomPane.setPrefHeight(50); bottomPane.setLeft(getBack); bottomPane.setCenter(check); bottomPane.setRight(save); root = new BorderPane(); root.getStyleClass().add("edit-root"); root.setTop(topPane); root.setCenter(editPane); root.setBottom(bottomPane); Scene scene = new Scene(root , 700, 500); scene.getStylesheets().addAll("shirokuro/Main/Styles_Images/ButtonStyles.css", "shirokuro/Main/Styles_Images/Background.css", "shirokuro/Main/Styles_Images/PaneBG.css", "shirokuro/Main/Styles_Images/TextStyles.css", "shirokuro/Main/Styles_Images/CellStyles.css"); this.getIcons().add(new Image("shirokuro/Main/Styles_Images/Images/logo.png")); this.setTitle("Shirokuro - Level Edit"); this.setResizable(false); this.setScene(scene); editPane.paint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openGamePane() {\n\t\tParent root;\n\t\ttry {\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(GAMEPANELOCATION));\n\t\t\tloader.setController(this);\n\t\t\troot = loader.load();\n\t\t\tScene scene = new Scene(root);\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\...
[ "0.6433536", "0.6386917", "0.63868225", "0.6306565", "0.62969285", "0.6271738", "0.62116677", "0.61733717", "0.6113407", "0.6103242", "0.60831636", "0.6067678", "0.60670996", "0.6039509", "0.60127896", "0.60028297", "0.6002209", "0.5993976", "0.5989704", "0.5987455", "0.59620...
0.0
-1
metoda nastavi tlacitko na clicked
public void setClickedStyle(Button button){ whiteCellButton.getStyleClass().clear(); blackCellButton.getStyleClass().clear(); removeCellButton.getStyleClass().clear(); if (button == whiteCellButton) { whiteCellButton.getStyleClass().add("edit-buttons-selected"); blackCellButton.getStyleClass().add("edit-buttons"); removeCellButton.getStyleClass().add("edit-buttons"); } else if (button == blackCellButton) { blackCellButton.getStyleClass().add("edit-buttons-selected"); whiteCellButton.getStyleClass().add("edit-buttons"); removeCellButton.getStyleClass().add("edit-buttons"); } else if (button == removeCellButton) { removeCellButton.getStyleClass().add("edit-buttons-selected"); whiteCellButton.getStyleClass().add("edit-buttons"); blackCellButton.getStyleClass().add("edit-buttons"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "@Override\n public void mouseClicked(MouseEvent e) {\n System.out.println(\"MouseClicked\");\n //kwadrat.clicked();\n trojkat.clicked();\n ...
[ "0.7876019", "0.778278", "0.7736392", "0.7692161", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.76845366", "0.7661894", "0.76599073", "0.7659045", "0.7659045", "0.76515555", "0.7...
0.0
-1
zmenenie stredneho kruhu cervena = naeditovany level sa neda ulozit (neriesitelne/neskotrolovane) zelena = naeditovany level sa moze ulozit
public void setCenterCircleFill(){ if(solvable){ solvableCircle.setFill(Color.GREEN); } else{ solvableCircle.setFill(Color.RED); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String vylozZvieraZVozidla() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz index zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n ...
[ "0.6767371", "0.6633183", "0.64145553", "0.62401587", "0.6121189", "0.61192626", "0.6100647", "0.60957485", "0.6095744", "0.60916644", "0.60828686", "0.60758895", "0.6063912", "0.60594857", "0.6058851", "0.6058851", "0.60219103", "0.6021792", "0.6021792", "0.60154843", "0.600...
0.0
-1
associate deeplinks with activity
public Intent parseAndGetIntent(Uri uri) { Log.d(TAG, uri.toString()); List<String> pathSegments = uri.getPathSegments(); Intent intent = null; String tagKey = pathSegments.get(0).toLowerCase(); Log.d(TAG, "tagKey:" + tagKey); if (AppIndexApplication.getInstance().cabSet.contains(tagKey)) { intent = new Intent(AppIndexApplication.getInstance(), BookCabActivity.class); } else if (AppIndexApplication.getInstance().restaurantSet.contains(tagKey)) { intent = new Intent(AppIndexApplication.getInstance(), RestaurantActivity.class); } else { intent = new Intent(AppIndexApplication.getInstance(), BookCabActivity.class); } return intent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deepLinkingFlow() {\n\n if (getActivity().getIntent().hasExtra(\"deeplink\")) {\n destination = getActivity().getIntent().getParcelableExtra(\"deeplink\");\n hotelSearchPresenter.checkDeepLinking(destination, getActivity().getSupportFragmentManager().beginTransaction());\n...
[ "0.72185796", "0.7126579", "0.6626288", "0.65022343", "0.6062156", "0.59453773", "0.5880377", "0.57237476", "0.57166815", "0.5701771", "0.55898273", "0.55171055", "0.5362321", "0.5286225", "0.52378446", "0.52260053", "0.51831055", "0.5182679", "0.51498914", "0.5131103", "0.51...
0.0
-1
end main Takes the input count and generates that number of random double precision floating point numbers. Counts how many times the first decimal place occurs in the sequence. Prints out each digit and the number of times it occurred in ascending order of the number of times it occurred.
public static void printEachInstance(int count) { List<RandGeneratedValue> list = new ArrayList<RandGeneratedValue>(); for(int i = 0; i < count; i++) { Double rand = Math.random(); RandGeneratedValue rdv = new RandGeneratedValue(); //Store the randomly generated value rdv.setRandValue(rand); //Determine the first decimal place value int firstDecimal = (int) (rand * 10); rdv.setFirstDecimal(firstDecimal); //Determine the number of instances of the first decimal place value String regexString = "[^"+ rdv.getFirstDecimal() + "]*"; String randStr = rdv.getRandValue().toString(); int instancesOfFirstDecimal = randStr.replaceAll(regexString, "").length(); rdv.setDigitCount(instancesOfFirstDecimal); list.add(rdv); } //Sort the list in ascending order of number of instances Collections.sort(list, new Comparator<RandGeneratedValue>() { @Override public int compare(RandGeneratedValue p1, RandGeneratedValue p2) { return p1.getDigitCount() - p2.getDigitCount(); // Ascending } }); //Output the list for (int j = 0; j < list.size(); j++) { //System.out.println("Random value generated = " + list.get(j).getRandValue()); System.out.println("First decimal = " + list.get(j).getFirstDecimal()); System.out.println("Number of instances of first decimal = " + list.get(j).getDigitCount()); System.out.println("=-=-=-=-=-=-=-=-=-=-="); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n String s=sc.next();\n double n=0;\n int dcount=0;\n int pointer=0;\n for(int i=0;i<s.length();i++)\n {\n if(s.charAt(i)!='.')\n {\n n=n*10+(s.charAt(i)-'0');\n if(pointer==1)\n d...
[ "0.6357716", "0.6274294", "0.6172699", "0.6132539", "0.6061748", "0.602409", "0.60066456", "0.5984489", "0.5982982", "0.5876075", "0.58709735", "0.5817232", "0.5802197", "0.57959926", "0.5793088", "0.5787493", "0.5783517", "0.5776166", "0.5747733", "0.57294", "0.5724716", "...
0.6398065
0
Creates a new instance of AcuityTest
public AcuityTest() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClimbingClubTest()\n {\n \n }", "public AuthorityFactoriesTest() {\n }", "public AllLaboTest() {\n }", "public PerezosoTest()\n {\n }", "public ActivitiTestCase() {\n }", "private AccuracyTestHelper() {\n // empty\n }", "public UnitTests()\n {\n }", "...
[ "0.671001", "0.66987014", "0.65943927", "0.65567654", "0.6551962", "0.6513047", "0.64711994", "0.6424128", "0.6409134", "0.6346423", "0.6339013", "0.6308003", "0.6306722", "0.6261673", "0.6260099", "0.6229242", "0.61984223", "0.6176624", "0.6161638", "0.6157369", "0.6154755",...
0.849121
0
add the patient answer to the answer list
public void saveAnswer(long answerTime, Element element, boolean patientAnswer, String patientAnswerStr){ getTestAnswers().add( new TestAnswer(answerTime, patientAnswer, element, patientAnswerStr) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addQuestionAnswer(Answer answer);", "void addAnswer(Answer answer);", "@Override\r\n public void addAnswer(String answer) {\r\n this.answers.add(answer);\r\n }", "public void addAnswer(Answer ans) {\n // TODO implement here\n }", "public void addAnswer(Answer answer) {\n \t\tans...
[ "0.7742983", "0.7580539", "0.74334913", "0.74326485", "0.71915084", "0.6991407", "0.69699365", "0.6904292", "0.68483573", "0.6835915", "0.67260784", "0.6725295", "0.66842264", "0.65206254", "0.63380796", "0.6259477", "0.6219937", "0.6208152", "0.61172754", "0.6098837", "0.607...
0.62877834
15
add the patient answer to the answer list
public void saveAnswer(Element element, boolean patientAnswer, String patientAnswerStr){ getTestAnswers().add( new TestAnswer(patientAnswer, element, patientAnswerStr) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addQuestionAnswer(Answer answer);", "void addAnswer(Answer answer);", "@Override\r\n public void addAnswer(String answer) {\r\n this.answers.add(answer);\r\n }", "public void addAnswer(Answer ans) {\n // TODO implement here\n }", "public void addAnswer(Answer answer) {\n \t\tans...
[ "0.7742983", "0.7580539", "0.74334913", "0.74326485", "0.71915084", "0.6991407", "0.69699365", "0.6904292", "0.68483573", "0.6835915", "0.67260784", "0.6725295", "0.66842264", "0.63380796", "0.62877834", "0.6259477", "0.6219937", "0.6208152", "0.61172754", "0.6098837", "0.607...
0.65206254
13
You can call method from the class name with className.method if that method is defined with static
public static String placePostData() { String res="/maps/api/place/add/json"; return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "MethodName getMethod();", "public static void staticMethod() {\n Log.e(\"LOG_TAG\", \"Company: STATIC Instance method\");\n }", "static void method1() {\r\n\t\r\n}", "static void staticShow() {\n System.out.println(\"In a static class static method\");\n }", "static void method2(){\n...
[ "0.6563972", "0.6557888", "0.6542901", "0.64990366", "0.6412168", "0.63668305", "0.6343916", "0.6343916", "0.6322235", "0.6314092", "0.631077", "0.6288914", "0.6238323", "0.6209906", "0.6209906", "0.6204279", "0.6168336", "0.6167555", "0.61606055", "0.6139141", "0.6139141", ...
0.0
-1
get loan amount from the textView and convert it to double
@Override public void onClick(View view) { double loan = Double.parseDouble(binding.loanAmount.getText().toString()); // get tenure amount from the textView and convert it to double double tenure = Double.parseDouble(binding.loanTenure.getText().toString()); // get interest amount from the textView and convert it to double, then divide it by 12 to get the interest per month double interest = Double.parseDouble(binding.interestRate.getText().toString()) / 12.0; // variable to hold the (1-i)^n value double i = Math.pow((1.0 + interest / 100.0), (tenure * 12.0)); // equation to calculate EMI (equated monthly installments) double emi = loan * (interest/100.0) * i / ( i - 1 ); // after calculated EMI, set it to the textView in the interface binding.monthlyPayment.setText("$" + String.format("%.2f", emi)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getMonthlyPayment(View view) {\n //Get all the EditText ids\n EditText principal = findViewById(R.id.principal);\n EditText interestRate = findViewById(R.id.interestRate);\n EditText loanTerm = findViewById(R.id.loanTerm);\n\n //Get the values for principal, MIR and t...
[ "0.68901944", "0.6743956", "0.6568079", "0.65575397", "0.6494578", "0.6481042", "0.6464636", "0.63911104", "0.6341193", "0.63255805", "0.631663", "0.62941325", "0.6275098", "0.6236251", "0.6236251", "0.6207866", "0.61204135", "0.611987", "0.6101559", "0.6098905", "0.6091936",...
0.68577594
1
choose the video encoder by name.
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) private static MediaCodecInfo chooseVideoEncoder(String name) { int nbCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < nbCodecs; i++) { MediaCodecInfo mci = MediaCodecList.getCodecInfoAt(i); if (!mci.isEncoder()) { continue; } String[] types = mci.getSupportedTypes(); for (int j = 0; j < types.length; j++) { if (types[j].equalsIgnoreCase(VCODEC)) { LogUtil.i(TAG, String.format("vencoder %s types: %s", mci.getName(), types[j])); if (name == null) { return mci; } if (mci.getName().contains(name)) { return mci; } } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getVideoPreset();", "private void configureEncoder() throws IOException\n {\n encoder = MediaCodec.createByCodecName(encoderName);\n MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, width, height);\n mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, BITRATE)...
[ "0.60611564", "0.60441685", "0.5655714", "0.56289583", "0.5604947", "0.55679303", "0.5521886", "0.5517504", "0.5512166", "0.5490423", "0.5457824", "0.5401785", "0.53775036", "0.5355942", "0.5340001", "0.52557766", "0.52379006", "0.5225033", "0.51944387", "0.519398", "0.513101...
0.82752746
0
INDEXING MANAGEMENT [MODIFIED] Inserts new information provided by new occurence of token in docID at offset.
public void insert( String token, int docID, int offset ) { // Add to map of postingslist //if (docID % 100 == 0) //System.err.println("Trying to insert ''" + token + "'' found in doc "+docID); if (this.index.containsKey(token)){ //System.err.println(token+" already in memory"); this.index.get(token).insert(docID, offset); } else{ //System.err.println("new token: " +token+" stored"); PostingsList postingslist = new PostingsList(); postingslist.insert(docID, offset); this.index.put(token, postingslist); } // Add to matrix of tf if (!this.tfMap.containsKey(docID)){ HashMap<String, Integer> m = new HashMap<String, Integer>(); m.put(token, 1); this.tfMap.put(docID, m); if (this.idfMap.containsKey(token)) this.idfMap.put(token, this.idfMap.get(token)+1); else this.idfMap.put(token, 1); } else if (!this.tfMap.get(docID).containsKey(token)){ this.tfMap.get(docID).put(token, 1); if (this.idfMap.containsKey(token)) this.idfMap.put(token, this.idfMap.get(token)+1); else this.idfMap.put(token, 1); } else{ int v = this.tfMap.get(docID).get(token) + 1; this.tfMap.get(docID).put(token, v); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insert( String token, int docID, int offset ) {\r\n PostingsList posting = this.getPostings(token);\r\n if(posting != null){\r\n posting.insertElement(docID, (double)0, offset);\r\n index.put(token, posting);\r\n }\r\n else{\r\n PostingsList ...
[ "0.6344753", "0.63235545", "0.60032284", "0.59595346", "0.59330505", "0.578764", "0.5781231", "0.5760061", "0.5738502", "0.5733359", "0.57019573", "0.569972", "0.5683141", "0.5683141", "0.5674248", "0.562783", "0.5595195", "0.55493456", "0.5527176", "0.55203867", "0.5482442",...
0.6843133
0
DISK/MEMORY MANAGEMENT [NEW] Recovers the essential files required to retrieve information in memory. This includes hashmap mapping tokens with respective terms and list of names of the retrieved documents.
public void load(){ // Recover docIDs try(Reader reader = new FileReader("postings/docIDs.json")){ this.docIDs = (new Gson()).fromJson(reader, new TypeToken<Map<String, String>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } try(Reader reader = new FileReader("postings/docLengths.json")){ this.docLengths = (new Gson()).fromJson(reader, new TypeToken<Map<String, Integer>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } try(Reader reader = new FileReader("postings/titleToNumber.json")){ this.titleToNumber = (new Gson()).fromJson(reader, new TypeToken<Map<String, Integer>>(){}.getType()); } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void scanDocuments()\n{\n document_counts = new HashMap<>();\n kgram_counts = new HashMap<>();\n for (File f : root_files) {\n addDocuments(f);\n }\n}", "public static void main(String[] args) throws IOException{\n\t\tint termIndex = 1;\n\t\t\n\t\t// startOffset holds the start offset for e...
[ "0.5995485", "0.5839277", "0.57960045", "0.55711436", "0.5396472", "0.5236064", "0.52118707", "0.51939565", "0.5157785", "0.5112572", "0.51100713", "0.5089438", "0.5079131", "0.50780505", "0.50760406", "0.5066933", "0.5057492", "0.50543725", "0.50523096", "0.5043695", "0.5038...
0.0
-1
[NEW] Saves the tokentermIDs map and list with document names
public void saveAll(){ // Store postings for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) { saveJSON("postings/t"+hash(entry.getKey())+".json", entry.getValue()); System.err.println("postings/t"+hash(entry.getKey())+".json"); count++; if (count%1000==0) System.err.println("storing "+ count); } // Store mapping ID<->document names mapping this.saveJSON("postings/docIDs.json", this.docIDs); this.saveJSON("postings/docLengths.json", this.docLengths); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveToken() throws IOException {\n\t\t\n\t\tFileWriter termIdx = new FileWriter(StoragePath+Path.termIdxDir);\n\t\t\n\t\tfor(Entry<String, Integer> term: termDic.entrySet()){\n\t\t\ttermIdx.append(term.getKey() + \"\\n\" + term.getValue() + \"\\n\");\n\t\t}\n\t\t\n\t\ttermIdx.close();\n\t\t\n\t}", "...
[ "0.61611456", "0.588707", "0.5825966", "0.5631039", "0.56064516", "0.5588778", "0.5588274", "0.5588257", "0.5482481", "0.54597014", "0.53377825", "0.53221774", "0.5288427", "0.5280946", "0.5271845", "0.526328", "0.52533746", "0.5247164", "0.5237755", "0.52139837", "0.5147063"...
0.55061305
8
[NEW] Saves object "o" as a JSON file called fileName
public void saveJSON(String fileName, Object o){ // System.err.println("accessing disk"); Gson gson = new Gson(); try(FileWriter writer = new FileWriter(fileName)){ gson.toJson(o, writer); //System.err.println("\n Token stored"); }catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void writeJsonObjectFile(JsonEntity objectToWrite, String filePath) \n\t{\n\t\tGson gsonParser = new Gson();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFiles.write(gsonParser.toJson(objectToWrite).getBytes(), new File(filePath));\n\t\t}\n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.err.println(\"Can't write to...
[ "0.7685922", "0.7182024", "0.7159729", "0.7137173", "0.7057812", "0.70540637", "0.7053874", "0.7003681", "0.6954736", "0.6898823", "0.6881606", "0.6876142", "0.6826735", "0.6755188", "0.67119867", "0.6710243", "0.66534215", "0.66483724", "0.6613342", "0.6548435", "0.65134025"...
0.86886233
0
No need for cleanup in a HashedIndex.
public void cleanup() { this.index = new TreeMap<String, PostingsList>(); this.count = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@AfterClass\n\tpublic static void cleanIndex() {\n\t\tEntityTest et = new EntityTest(id, \"EntityTest\");\n\t\tRedisQuery.remove(et, id);\n\t}", "void indexReset();", "public void clear() {\n index.clear();\n }", "private Reindex() {}", "private Reindex() {}", "void clearAllIndexes();", "publ...
[ "0.6721599", "0.6681743", "0.66589624", "0.65445966", "0.65445966", "0.6508383", "0.63637435", "0.6360245", "0.63154876", "0.62771064", "0.62437534", "0.6216059", "0.6196626", "0.61939406", "0.61733735", "0.61713153", "0.6138556", "0.61282516", "0.61186033", "0.6097255", "0.6...
0.6162504
16
SEARCH MANAGEMENT (USER) [MODIFIED] Returns the postings for a specific term, or null if the term is not in the index.
public PostingsList getPostings( String token ) { PostingsList post = new PostingsList(); if(this.index.containsKey(token)) post = (this.index.get(token)).clone(); /*System.err.println("start search..."); // Read JSON file associated to token and return it as a postingslist String filename = "postings/t"+hash(token)+".json"; PostingsList post = new PostingsList(); try(Reader reader = new FileReader(filename)){ post = (new Gson()).fromJson(reader, PostingsList.class); } catch (IOException e) { e.printStackTrace(); }*/ return post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<Post> searchInfResult(String word) {\n\t\tpostDao=new PostDaoImpl(TransactionManager.connection);\r\n\t\treturn postDao.selectPosts(word);\r\n\t}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists =...
[ "0.5979783", "0.59439623", "0.5828963", "0.5720514", "0.5714142", "0.56416255", "0.563343", "0.5438755", "0.5398442", "0.53896147", "0.5354768", "0.5341725", "0.531625", "0.5312132", "0.53009015", "0.5274076", "0.5270938", "0.52231854", "0.5207723", "0.5195788", "0.51900214",...
0.5259476
17
QUERIES MANAGEMENT Searches the index for postings matching the query.
public PostingsList search( Query query, int queryType, int rankingType, int structureType ) { double idf_threshold = new Double(0); double index_elimination = new Double(0.008); // System.err.println(pageRank[docNumber.get("121")]); if (query.size()>0){ switch (queryType){ case Index.INTERSECTION_QUERY: System.err.println("Intersection query"); return intersect(query); case Index.PHRASE_QUERY: System.err.println("Phrase query"); return phrase_query(query); case Index.RANKED_QUERY: System.err.println("Ranked query"); switch(rankingType){ case Index.TF_IDF: return ranked_query(query, 1, idf_threshold); case Index.PAGERANK: return ranked_query(query, 0, idf_threshold);//ranked_query(query, 0, idf_threshold);//ranked_query2(query, 0); case Index.COMBINATION: return ranked_query(query, index_elimination, idf_threshold); } default: System.out.println("not valid query"); return null; } } else // Query was empty return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void queryPosts() {\n ParseQuery<OutfitPost> query = ParseQuery.getQuery(OutfitPost.class);\n // only include data referred by user key\n query.include(OutfitPost.KEY_USER);\n query.whereEqualTo(OutfitPost.KEY_USER, ParseUser.getCurrentUser());\n // limit query to latest ...
[ "0.5320133", "0.52384716", "0.51909447", "0.51793134", "0.51689667", "0.5166202", "0.51531994", "0.511496", "0.51019454", "0.50839907", "0.5083817", "0.5078615", "0.5059571", "0.5005355", "0.5002798", "0.49850202", "0.49844736", "0.49838942", "0.49333358", "0.4925261", "0.489...
0.4517407
70
query: Query inserted by the user w: Weight the tfidf score, usually very small to account for scale difference with pagerank idf_threshold: Threshold to perform index elimination / 1) Obtain union of results containing the considered query terms
public PostingsList ranked_query(Query query, double w, double idf_threshold){ long startTime = System.nanoTime(); PostingsList result = new PostingsList(); // Obtain union of terms above idf threshold if indexElimination is true // (Set idf_threshold to zero to disable this feature) Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold); result = this.union_query(query, termsToConsider); //System.err.println("Size of result is " + result.size()); long estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Union took: " + estimatedTime); /* * 2) Iterate over PostingsEntries and build the solution */ startTime = System.nanoTime(); // Required when iterating over a PostingsList PostingsEntry postEnt = new PostingsEntry(); // Number of documents in the collection double nDocs = this.docIDs.size(); // Weight of a query vector coefficient double w_query_term; // Document tf-idf variables double termFrequency_doc, documentFrequency_doc, w_doc_term; for(String term : termsToConsider){ // Obtain idf of the term documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term))); // Obtain weight of the term w_query_term = query.weights.get(term); // Iterate over all documents containing the term and update the score(q,d) Iterator<PostingsEntry> it_d = result.iterator(); while(it_d.hasNext()){ postEnt = it_d.next(); if (this.tfMap.get(postEnt.docID).containsKey(term)){ termFrequency_doc = this.tfMap.get(postEnt.docID).get(term); w_doc_term = documentFrequency_doc*termFrequency_doc; postEnt.score += w_query_term*w_doc_term; } } } estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Building solution took: " + estimatedTime); /* * 3) Normalize the scores */ startTime = System.nanoTime(); Iterator<PostingsEntry> it = result.iterator(); while(it.hasNext()){ postEnt = it.next(); postEnt.score /= (new Double(this.docLengths.get(""+postEnt.docID)));//(Math.sqrt(postEnt.norm2)); postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID); } estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Normalizing took: " + estimatedTime); /* * 4) Sort the resulting solution */ startTime = System.nanoTime(); result.sort(); estimatedTime = (System.nanoTime() - startTime)/1000000; System.err.println("* Sorting took: " + estimatedTime); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> queryTermsConsidered(Query query, double idf_threshold){\n double idf, nDocs = this.docIDs.size();\n String term;\n\n Set<String> termsToConsider = new HashSet<String>();\n\n Iterator<String> it = query.terms.iterator();\n while(it.hasNext()){\n term...
[ "0.713265", "0.67490345", "0.6708787", "0.6570831", "0.65290445", "0.65091664", "0.6301124", "0.62564147", "0.62462723", "0.62303966", "0.6121615", "0.6092577", "0.60881495", "0.6067615", "0.6061933", "0.60572237", "0.6025526", "0.59403056", "0.5899081", "0.58948946", "0.5887...
0.7497625
0
Which terms should be considered? Based on Index elimination theory, idfthresholding!
public Set<String> queryTermsConsidered(Query query, double idf_threshold){ double idf, nDocs = this.docIDs.size(); String term; Set<String> termsToConsider = new HashSet<String>(); Iterator<String> it = query.terms.iterator(); while(it.hasNext()){ term = it.next(); idf = -1; if(this.idfMap.containsKey(term)) idf = Math.log(nDocs/new Double(this.idfMap.get(term))); if (idf >= idf_threshold){ termsToConsider.add(term); } /*else{ System.err.println(term + " not considered since idf = " + idf); }*/ } return termsToConsider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int numberOfTerms();", "int DF(String term) {\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(term)) {\n df++;\n }\n }\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(term)) {\n ...
[ "0.60107577", "0.5797017", "0.5660234", "0.5633843", "0.5564556", "0.5551654", "0.554559", "0.5543597", "0.5539202", "0.55127895", "0.54864407", "0.54860085", "0.54856205", "0.54337925", "0.5350816", "0.5343665", "0.5324684", "0.53126794", "0.5291859", "0.5283408", "0.5283391...
0.6349889
0
[NEW] Finds documents containing the query as a phrase TODO: Skip pointer
public PostingsList phrase_query(Query query){ LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>(); // List with postings corresponding to the queries for (int i = 0; i<query.size(); i++){ // If any query has zero matches, return 0 results //if(!(new File("postings/t"+hash(query.terms.get(i))+".json")).exists()){ if (!this.index.containsKey(query.terms.get(i))){ return null; } // Otherwise store postings in the list listQueriedPostings.add(this.getPostings(query.terms.get(i))); } PostingsList result = new PostingsList(); result = listQueriedPostings.get(0); // In case only one word is queried if (listQueriedPostings.size() == 1){ return result; } // Apply algorithm as many times as words in the query for(int i = 1; i < listQueriedPostings.size(); i++){ result = phrase_query(result, listQueriedPostings.get(i)); if (result.isEmpty()){ return null; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n ...
[ "0.7247035", "0.6326672", "0.61507344", "0.614432", "0.6127424", "0.61083686", "0.60629725", "0.60173154", "0.5970413", "0.59642434", "0.595486", "0.59493905", "0.5948072", "0.5947946", "0.5944434", "0.5918083", "0.59072393", "0.5887826", "0.58828676", "0.58804107", "0.587460...
0.60083085
8
[NEW] Finds documents containing a twowords phrase
public PostingsList phrase_query(PostingsList l1, PostingsList l2){ PostingsList phrase = new PostingsList(); // Counters to iterate docIDs int count1 = 0; int count2 = 0; // Counters to iterate positional indices int subcount1 = 0; int subcount2 = 0; // First posting PostingsEntry p1 = l1.get(0); PostingsEntry p2 = l2.get(0); // List of positional indices (changes at each iteration) LinkedList<Integer> ll1; LinkedList<Integer> ll2; // Used to store positional index int pp1; int pp2; while(true){ // docID match (1/2) // if (p1.docID == p2.docID){ // Obtain list of positional indices ll1 = p1.positions; ll2 = p2.positions; // First positional indices pp1 = ll1.get(0); pp2 = ll2.get(0); // Initialize counter subcount1 = 0; subcount2 = 0; // Search if the phrase exists while(true){ // Match, consecutive words (2/2) - EUREKA! // if (pp1+1 == pp2){ // Save found match (docID and positional index of last // word) phrase.insert(p1.docID, pp2); // Increase counters and pos indices if list is not finished subcount1++; subcount2++; if (subcount1<ll1.size() && subcount2<ll2.size()){ pp1 = ll1.get(subcount1); pp2 = ll2.get(subcount2); } // If list finished, break else break; } // Not match else if (pp1+1 < pp2){ subcount1++; if (subcount1<ll1.size()) pp1 = ll1.get(subcount1); // If list finished, break else break; } // Not match else{ subcount2++; if (subcount2<ll2.size()) pp2 = ll2.get(subcount2); else break; } } // Once we finished looking at the list of positional indices of one // posting, increase counters and go to next postings (if there are) count1++; count2++; if (count1<l1.size() && count2<l2.size()){ p1 = l1.get(count1); p2 = l2.get(count2); } else{ break; } } // docID not match, increase lowest counter else if (p1.docID < p2.docID){ count1++; if (count1<l1.size()){ p1 = l1.get(count1); } else{ break; } } // docID not match, increase lowest counter else{ count2++; if (count2<l2.size()){ p2 = l2.get(count2); } else{ break; } } } return phrase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n ...
[ "0.68965036", "0.60956764", "0.59332526", "0.5928022", "0.58062935", "0.57813257", "0.57707757", "0.5745215", "0.5720394", "0.5696968", "0.5672093", "0.5598769", "0.55674994", "0.5545627", "0.551981", "0.5488837", "0.5467346", "0.5463441", "0.5459747", "0.54115915", "0.540834...
0.56311864
11
[NEW] Intersects a set of queries TODO: Skip pointer
public PostingsList intersect(Query query){ LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>(); // List with postings corresponding to the queries for (int i = 0; i<query.size(); i++){ // If any query has zero matches, return 0 results //if(!(new File("postings/t"+hash(query.terms.get(i))+".json")).exists()){ if (!this.index.containsKey(query.terms.get(i))){ return null; } // Otherwise store postings in the list listQueriedPostings.add(this.getPostings(query.terms.get(i))); } // Order the posting list by increasing document frequency listQueriedPostings = sortByIncreasingFrequency(listQueriedPostings); PostingsList result = (PostingsList)listQueriedPostings.get(0); // In case only one word is queried if (listQueriedPostings.size() == 1){ return result; } // Apply algorithm as many times as words in the query for(int i = 1; i < listQueriedPostings.size(); i++){ result = intersect(result, listQueriedPostings.get(i)); if (result.isEmpty()){ return null; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\tt...
[ "0.601857", "0.5893896", "0.575646", "0.56862754", "0.5679482", "0.5663984", "0.56257683", "0.5607326", "0.5603596", "0.5601509", "0.5576574", "0.55470616", "0.55435514", "0.5515671", "0.55070364", "0.5502553", "0.5489338", "0.54770523", "0.5475129", "0.5470427", "0.5450035",...
0.6197183
0
[NEW] Intersects two queries (represented by the postingslist)
public PostingsList intersect(PostingsList l1, PostingsList l2){ PostingsList intersection = new PostingsList(); // Counters to iterate docIDs int count1 = 0; int count2 = 0; // First posting PostingsEntry p1 = l1.get(0); PostingsEntry p2 = l2.get(0); while(true){ // Match - EUREKA! // if (p1.docID == p2.docID){ // Add match intersection.insert(p1.docID); // Increase counters count1++; count2++; // Go to next postings (check for nullpointer) if (count1<l1.size() && count2<l2.size()){ p1 = l1.get(count1); p2 = l2.get(count2); } else break; } // No match else if (p1.docID < p2.docID){ count1++; if (count1<l1.size()) p1 = l1.get(count1); else break; } // No match else{ count2++; if (count2<l2.size()) p2 = l2.get(count2); else break; } } return intersection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PostingsList intersect(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n ...
[ "0.69769245", "0.6333911", "0.5428158", "0.5357878", "0.530351", "0.5271801", "0.51897854", "0.51882815", "0.51229084", "0.50980556", "0.5068206", "0.50642776", "0.506333", "0.5041754", "0.502724", "0.5019483", "0.5001322", "0.49797273", "0.49742696", "0.4948692", "0.49297482...
0.6708024
1
[NEW] Sorts a set of postings list according to the document frequency
public LinkedList<PostingsList> sortByIncreasingFrequency(LinkedList<PostingsList> l){ Collections.sort(l, new Comparator<PostingsList>(){ @Override public int compare(PostingsList p1, PostingsList p2){ if(p1.size() < p2.size()){ return -1; } if(p1.size() > p2.size()){ return 1; } return 0; } }); return l; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sort() {\n documents.sort();\n }", "public void sortDocumentsByDocnos() {\n order = new int[mDocSet.length];\n mDocSet_tmp = new double[mDocSet.length];\n accumulated_scores_tmp = new float[mDocSet.length];\n\n for (int i = 0; i < order.length; i++) {\n order[i] = i;\n mDocS...
[ "0.67374855", "0.63989174", "0.6172652", "0.5989494", "0.59094334", "0.5851778", "0.57968163", "0.57893056", "0.5646224", "0.5625188", "0.5610343", "0.56095076", "0.559386", "0.55909723", "0.5517896", "0.5515005", "0.5512062", "0.5501602", "0.54893845", "0.54655427", "0.54344...
0.6929145
0
OTHERS [MODIFIED] Returns all the words in the index.
public Set<String> keySet() { return this.index.keySet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> getWords() {\n\t\treturn Collections.unmodifiableSet(this.invertedIndex.keySet());\n\t}", "public Iterator words() {\n return index.keySet().iterator();\n }", "public void showAllWords() {//out\n System.out.println(\"No\\t|English\\t|Vietnamese\");\n ArrayList<Word> f...
[ "0.6683834", "0.63288605", "0.60075307", "0.5970147", "0.5862826", "0.5859984", "0.58519155", "0.5818616", "0.57877696", "0.57772887", "0.57062596", "0.5672519", "0.5668082", "0.56145406", "0.5612684", "0.5563824", "0.55119944", "0.550613", "0.54892987", "0.5488961", "0.54867...
0.0
-1
[NEW] Hashes the string to unique int representation
public static String hash(String token){ return Integer.toString( token.hashCode() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int toHashKey(String s)\n\t{\n\t\tint A = 1952786893;\n\t\tint B = 367257;\n\t\tint v = B;\n\t\tfor (int j = 0; j < s.length(); j++)\n\t\t{\n\t\t\tchar c = s.charAt(j);\n\t\t\tv = A * (v + (int) c + j) + B;\n\t\t}\n\n\t\tif (v < 0) v = -v;\n\t\treturn v;\n\t}", "private int hash(String string) {\n\t\tint hash = ...
[ "0.7137949", "0.6897674", "0.6708983", "0.6634139", "0.6602896", "0.6580906", "0.6529667", "0.6447881", "0.64134866", "0.64026445", "0.6386157", "0.6376087", "0.6344094", "0.6320488", "0.6314912", "0.6302626", "0.62619746", "0.62537754", "0.62481886", "0.62098116", "0.6183987...
0.5671831
78
[NEW] Strings the map containing all postingslist and tokens
public String toString(){ String s = " "; for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) { s += entry.getKey()+" - " + entry.getValue().toString() + "\n"; } return s;//this.indexInMemory.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map<String, String> getTokens();", "@Override\r\n public String toString() {\r\n String s = new String();\r\n for (String t : tokenList)\r\n s = s + \"~\" + t;\r\n return s;\r\n }", "@Override\n public String toString() {\n StringJoiner sj = new StringJoiner(\", \", \"{\", \"}\\n\");\...
[ "0.6758433", "0.58897084", "0.5630534", "0.5508794", "0.5503969", "0.54728544", "0.5447173", "0.53018135", "0.5263845", "0.5251088", "0.5191312", "0.51761514", "0.51590157", "0.51570046", "0.5153402", "0.5152076", "0.51318806", "0.5107668", "0.51008123", "0.51008123", "0.5100...
0.5571595
3
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() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); txtNombre = new javax.swing.JTextField(); txtPuesto = new javax.swing.JTextField(); txtDepartamento = new javax.swing.JTextField(); btnInsertar = new javax.swing.JButton(); btnAyudas = new javax.swing.JButton(); btnReportes = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel1.setText("Nombre"); jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel2.setText("Puesto"); jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel3.setText("Departamento"); txtNombre.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N txtPuesto.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N txtDepartamento.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N btnInsertar.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N btnInsertar.setText("Ingresar"); btnInsertar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnInsertarActionPerformed(evt); } }); btnAyudas.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N btnAyudas.setText("Ayudas"); btnAyudas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAyudasActionPerformed(evt); } }); btnReportes.setText("Reportes"); btnReportes.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReportesActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE) .addComponent(txtPuesto) .addComponent(txtDepartamento)) .addGap(49, 81, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(btnInsertar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnAyudas, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnReportes, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(43, 43, 43)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(35, 35, 35) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(txtPuesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(txtDepartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(38, 38, 38) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnInsertar, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnAyudas, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnReportes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(64, 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.73206544", "0.7291311", "0.7291311", "0.7291311", "0.7286492", "0.7249181", "0.7213362", "0.72085494", "0.71965617", "0.7190475", "0.7184897", "0.7159234", "0.71483016", "0.7094075", "0.7081491", "0.70579433", "0.6987627", "0.69776064", "0.69552463", "0.69549114", "0.69453...
0.0
-1
TODO Autogenerated method stub
public void addUser(User user) { userMapper.insert(user); }
{ "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