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
======================================================================= Game Object Methods =======================================================================
public void drawGraph() { MatrixStack transformStack = new MatrixStack(); transformStack.getTop().mul(getWorldTransform()); drawSelfAndChildren(transformStack); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void loadGame() {\n\n }", "@Override\n public void beginGame() {\n }", "public Game() {}", "@Override\n public void newGame() {\n //TODO Implement this method\n }", "public abstract void gameObjectAwakens();", "public Game() \n {\n gameLoaded = false;...
[ "0.71436846", "0.7068885", "0.6968655", "0.6968238", "0.6928733", "0.69172543", "0.688182", "0.68535024", "0.6816481", "0.6797159", "0.6794511", "0.6754325", "0.6751565", "0.6748429", "0.6748429", "0.6748429", "0.6734147", "0.6709166", "0.6699973", "0.6694955", "0.6683451", ...
0.0
-1
not gonna test this at the moment
@Override public boolean shouldContinueSwitchedRootFound() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void method_4270() {}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic...
[ "0.57123035", "0.5679305", "0.55567217", "0.55262494", "0.55178463", "0.54945326", "0.5430614", "0.54119354", "0.54055816", "0.53589284", "0.53523684", "0.53274316", "0.53040004", "0.52949464", "0.5281327", "0.52614605", "0.52204865", "0.5211626", "0.5211626", "0.52094877", "...
0.0
-1
Constructs a new View given the UI to work with
public View(UI ui) { this.ui = ui; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "View createView();", "public ViewClass() {\n\t\tcreateGUI();\n\t\taddComponentsToFrame();\n\t\taddActionListeners();\n\t}", "ViewElement createViewElement();", "ViewContainer createViewContainer();", "ViewComponent createViewComponent();", "@Override\n public void Create() {\n\n initView();\n ...
[ "0.7829621", "0.7195394", "0.7095784", "0.7075716", "0.69101095", "0.6727194", "0.66562223", "0.6655742", "0.66329193", "0.6625924", "0.6622662", "0.66142285", "0.65994054", "0.6596082", "0.6590095", "0.651308", "0.6509622", "0.65072185", "0.650703", "0.6486382", "0.6485898",...
0.7559128
1
Displays an message to the user
public void say(String message) { ui.say(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showMessage(String message);", "private void displayMessage(String message) {\n }", "public void showMessage(String message) \r\n\t\t{\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void showMessage(String message) {\n\t\t\t\r\n\t\t}", "public void DisplayMessage(String massage);", "void displa...
[ "0.813668", "0.8009303", "0.7993049", "0.7958481", "0.7955853", "0.79391223", "0.7912763", "0.7912763", "0.7872067", "0.78475314", "0.7825584", "0.7794455", "0.77866817", "0.7752842", "0.7667692", "0.7619443", "0.75851166", "0.7580185", "0.7518482", "0.7503148", "0.75023675",...
0.0
-1
Displays an error to the user
public void error(String message) { ui.say("ERROR: " + message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showError(String error);", "void showError(String message);", "void showError(String message);", "public void showError(String errorMessage);", "void showError(String errorMessage);", "@Override\n public void showError() {\n }", "@Override\n\tpublic void showError(String message) {\n\...
[ "0.8229624", "0.79366064", "0.79366064", "0.7869481", "0.78116584", "0.7579488", "0.7550397", "0.7481312", "0.7382475", "0.73077935", "0.7285263", "0.7265077", "0.71999305", "0.7168863", "0.71562207", "0.71171767", "0.70988184", "0.7080039", "0.70628065", "0.70568866", "0.702...
0.6865892
26
Displays an array of orders to the user
public void displayOrders(HashMap<Integer, Order> orders) { Set<Integer> orderNumbers; orderNumbers = orders.keySet(); for (var orderNumber: orderNumbers) { ui.say("\n======== ORDER " + orderNumber + " ========"); displayOrder(orders.get(orderNumber)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showCustomerOrders() {\n\t\ttextArea.setText(\"\");\n\t\tfor (int i = 0; i < driver.getOrderDB().getCustomerOrderList().size(); i++) {\n\t\t\tOrder order = (driver.getOrderDB().getCustomerOrderList().get(i));\n\t\t\ttextArea.append(\"Order \" + order.getId() + \" was created by \"\n\t\t\t\t\t+ order.ge...
[ "0.7310296", "0.7228129", "0.7227488", "0.7057885", "0.7056149", "0.7029254", "0.68981755", "0.6844607", "0.6717359", "0.6649841", "0.65852606", "0.6535573", "0.6448853", "0.63828784", "0.63607156", "0.6359507", "0.6329833", "0.62997663", "0.6280373", "0.62498283", "0.6233683...
0.71030563
3
Displays an order to the user
public void displayOrder(Order order) { ProductType productType; // State state; productType = order.getProductType(); // state = order.getState(); ui.say( "Customer Name: " + order.getCustomerName() + "\n" + "State: " + order.getState().getName() + "\n" + "Product Type: " + productType.getName() + "\n" + "Area: " + order.getArea()+ " sq ft\n" + // "Material Cost Per Square Foot: $" + productType.getMaterialCostPerSquareFoot() + "\n" + "Material Cost: $" + order.getMaterialCost() + "\n" + // "Labor Cost Per Square Foot: $" + productType.getLaborCostPerSquareFoot() + "\n" + "Labor Cost: $" + order.getLaborCost() + "\n" + // "Tax Rate: " + state.getTaxRate() + "\n" + "Tax: $" + order.getTax() + "\n" + "Total: $" + order.getTotal() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void viewOrder() {\n\t\tSystem.out.print(\"\\t\\t\");\n\t\tSystem.out.println(\"************Viewing existing orders************\");\n\t\t// TODO - implement RRPSS.viewOrder\n\t\tOrderManager orderManager = new OrderManager();\n\t\tList listOfOrders = orderManager.viewOrder();\n\n\t\tOrderedItemManage...
[ "0.7398287", "0.6968887", "0.69354445", "0.67504907", "0.66591316", "0.6656296", "0.6610727", "0.6589958", "0.6552392", "0.649839", "0.6482761", "0.6459484", "0.64521456", "0.64448273", "0.6418694", "0.64050657", "0.63816863", "0.63789904", "0.6362111", "0.63617224", "0.63204...
0.7668747
0
Prompts the user to select a menu item
public String promptMenu() { String selection; promptMenu: do { selection = promptString( "\n======== FLOORING PROGRAM MAIN MENU ========\n" + "DISPLAY - Display Orders\n" + "ADD - Add an Order\n" + "EDIT - Edit an Order\n" + "REMOVE - Remove an Order\n" + "EXPORT - Export all data to file\n" + "EXIT - Exit\n" + "What would you like to do?" ); switch(selection.toLowerCase()) { case "display": case "add": case "edit": case "remove": case "export": case "exit": break promptMenu; default: continue; } } while(true); return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void select() {\n \t\t\tString sinput = \"\";\r\n \t\t\tOption selected = null;\r\n \t\t\tErrorLog.debug(name + \" selected.\");\r\n \t\t\t\r\n \t\t\twhile (true) {\r\n \t\t\t\tSystem.out.println(toString()); //Print menu.\r\n \t\t\t\tsinput = read(); //Get user selection.\r\n \t\t\t\tif (!sinput.equalsIgno...
[ "0.77002114", "0.7542242", "0.7450196", "0.7345421", "0.7325162", "0.7197887", "0.7104851", "0.70440733", "0.7035269", "0.70196", "0.70176727", "0.6999392", "0.69748497", "0.69719917", "0.696617", "0.69571847", "0.69459295", "0.69364023", "0.68844676", "0.6876029", "0.6810484...
0.70913863
7
Prompts the user to create a new order
public OrderDetails promptNewOrder(State[] states, ProductType[] productTypes, String dateFormat) { DateTimeFormatter dateFormatter; OrderDetails orderDetails; LocalDate date; String customerName, selection, listOfStates, listOfProductTypes; HashMap<String, State> statesMap; State state; HashMap<String, ProductType> productTypesMap; ProductType productType; BigDecimal area; dateFormatter = DateTimeFormatter.ofPattern(dateFormat); // Prompt the date until the date is a future date date = promptDate( "\nToday's date is " + LocalDate.now().format(dateFormatter) + ".\n" + "Please input a date for the order: (" + dateFormat + ")", dateFormat ); while(date.compareTo(LocalDate.now()) <= 0) { date = promptDate( "Your order's date must be in the future.\n\n" + "Today's date is " + LocalDate.now().format(dateFormatter) + ".\n" + "Please input a date for the order: (" + dateFormat + ")", dateFormat ); } // Prompt the customer name until it is a valid name customerName = promptString("\nPlease input your Customer Name:"); while(!customerName.matches("[\\w\\., ]+")) { customerName = promptString( "\nYour name must contain only [a-zA-Z0-9 ,].\n" + "Please input your Customer Name:" ); } // Display all of the available states statesMap = new HashMap(states.length); listOfStates = ""; ui.say("======== AVAILABLE STATES ========"); for (var availableState: states) { statesMap.put(availableState.getAbbreviation().toLowerCase(), availableState); listOfStates += availableState.getAbbreviation() + ", "; } listOfStates += "\b\b"; ui.say(listOfStates); // Prompt the state until it is a valid state selection = promptString("\nPlease select a State to place the order in:").toLowerCase(); while (!statesMap.containsKey(selection)) { selection = promptString( "Invalid State.\n\n" + "States: " + listOfStates + "\n" + "Please select a State to place the order in:").toLowerCase(); } state = statesMap.get(selection); // Display all of the available product types productTypesMap = new HashMap(productTypes.length); listOfProductTypes = ""; ui.say("======== AVAILABLE STATES ========"); for (var availableProductType: productTypes) { productTypesMap.put(availableProductType.getName().toLowerCase(), availableProductType); listOfProductTypes += availableProductType.getName() + ", "; } listOfProductTypes += "\b\b"; ui.say(listOfProductTypes); // Prompt the product type until it is a valid product type selection = promptString("\nPlease select a Product Type to place the order in:").toLowerCase(); while (!productTypesMap.containsKey(selection)) { selection = promptString( "Invalid Product Type.\n\n" + "Product Types: " + listOfProductTypes + "\n" + "Please select a Product Type:").toLowerCase(); } productType = productTypesMap.get(selection); // Prompt for the area of the Order area = promptNumber("\nPlease input an area in square feet:"); orderDetails = new OrderDetails( date, customerName, state, productType, area ); return orderDetails; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean promptNewOrder(String productName) {\r\n System.out.println(\"It doesn't look like you've placed this order before. \"\r\n + \"Would you like to place a new order for - \" + productName + \"?\\n\"\r\n + \"ENTER \\\"YES\\\" to Place a New Order or \\\"NO\\\" to...
[ "0.6738151", "0.6467407", "0.6429892", "0.61749256", "0.61267215", "0.60340035", "0.59691733", "0.5933298", "0.59119576", "0.59017605", "0.58705", "0.5869334", "0.58686715", "0.5817191", "0.5791781", "0.5747197", "0.5718735", "0.5709316", "0.5697816", "0.5686302", "0.56519616...
0.5850708
13
Prompts the user to edit an order
public Order promptEditOrder(Order order, State[] states, ProductType[] productTypes) { Order newOrder; String customerName, selection, listOfStates, listOfProductTypes, currentState, currentProductType; HashMap<String, State> statesMap; HashMap<String, ProductType> productTypesMap; BigDecimal area, currentArea; newOrder = order.copy(); // Prompt the customer name until it is a valid name customerName = promptString("\nPlease input your Customer Name: (" + order.getCustomerName() + ")"); while( !( (customerName.matches("[\\w\\., ]+")) || (customerName.equals("")) ) ) { customerName = promptString( "\nYour name must contain only [a-zA-Z0-9 ,].\n" + "Please input your Customer Name: (" + order.getCustomerName() + ")" ); } if (customerName.equals("")) { // do nothing } else { newOrder.setCustomerName(customerName); } // Display all of the available states statesMap = new HashMap(states.length); listOfStates = ""; ui.say("======== AVAILABLE STATES ========"); for (var availableState: states) { statesMap.put(availableState.getAbbreviation().toLowerCase(), availableState); listOfStates += availableState.getAbbreviation() + ", "; } listOfStates += "\b\b"; ui.say(listOfStates); // Prompt the state until it is a valid state currentState = order.getState().getAbbreviation(); selection = promptString("\nPlease select a State to place the order in: (" + currentState + ")").toLowerCase(); while ( !( selection.equals("") || statesMap.containsKey(selection) ) ) { selection = promptString( "\nInvalid State.\n" + "States: " + listOfStates + "\n" + "Please select a State to place the order in: (" + currentState + ")").toLowerCase(); } if (selection.equals("")) { // do nothing } else { newOrder.setState( statesMap.get(selection) ); } // Display all of the available product types productTypesMap = new HashMap(productTypes.length); listOfProductTypes = ""; ui.say("======== AVAILABLE PRODUCT TYPES ========"); for (var availableProductType: productTypes) { productTypesMap.put(availableProductType.getName().toLowerCase(), availableProductType); listOfProductTypes += availableProductType.getName() + ", "; } listOfProductTypes += "\b\b"; ui.say(listOfProductTypes); // Prompt the product type until it is a valid product type currentProductType = order.getProductType().getName(); selection = promptString("\nPlease select a Product Type to place the order in: (" + currentProductType + ")").toLowerCase(); while ( !( selection.equals("") || productTypesMap.containsKey(selection) ) ) { selection = promptString( "\nInvalid Product Type.\n" + "Product Types: " + listOfProductTypes + "\n" + "Please select a Product Type to place the order in: (" + currentProductType + ")").toLowerCase(); } if (selection.equals("")) { // do nothing } else { newOrder.setProductType( productTypesMap.get(selection) ); } // Prompt for the area of the Order currentArea = order.getArea(); do { selection = promptString("\nPlease input an area in square feet: (" + currentArea + ")"); if (selection.equals("")) { // do nothing break; } try { newOrder.setArea( (new BigDecimal(selection)).setScale(2, RoundingMode.HALF_UP) ); break; } catch (NumberFormatException e) { ui.say("Invalid number format."); continue; } } while(true); return newOrder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Order editOrder(String orderId, Order editedOrder) throws \n OrderBookOrderException;", "@Override\n\tpublic int edit(OrderIn orderIn) {\n\t\treturn orderInDao.edit(orderIn);\n\t}", "private void editProduct() {\n\t\tif (!CartController.getInstance().isCartEmpty()) {\n\t\t\tSystem.out.println(\"Ente...
[ "0.7272614", "0.65805185", "0.6377004", "0.6220188", "0.6185945", "0.6151521", "0.6117987", "0.6098073", "0.6075161", "0.60173213", "0.6006924", "0.6005028", "0.59526235", "0.5946638", "0.593699", "0.59200305", "0.5876649", "0.5874747", "0.58680785", "0.58352923", "0.58340544...
0.62915766
3
Prompts the user to select a date
public LocalDate promptDate(String message, String dateFormat) { DateTimeFormatter dateFormatter; String selection; LocalDate date; dateFormatter = DateTimeFormatter.ofPattern(dateFormat); // Prompt the date until it can be parsed correctly promptDate: do { selection = promptString(message); try { date = LocalDate.parse(selection, dateFormatter); break promptDate; } catch (DateTimeParseException e) { ui.say("Text cannot be parsed. The date format should be (" + dateFormat + ")."); } } while(true); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void promptDate(String date)\n {\n this.date = date;\n }", "public void selectDate(){\r\n\t\tcloseDateText.sendKeys(ConvertDate());\r\n\t}", "public void selectDate()\r\n\t{\r\n\t\tsetLayout(new FlowLayout());\r\n\t\t\r\n\t\t// Create the DatePicker\r\n\t\tUtilDateModel model = new UtilDate...
[ "0.7961984", "0.7622985", "0.74008566", "0.70937407", "0.6881527", "0.68404627", "0.67408025", "0.67188483", "0.6632193", "0.65801597", "0.6578623", "0.65673727", "0.65480685", "0.6487945", "0.64723134", "0.6431083", "0.63725936", "0.63652974", "0.6357771", "0.63284403", "0.6...
0.6010828
42
Prompts the user to input a String
public String promptString(String message) { ui.say(message); return ui.readString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String userInputString() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }", "private static String inputString() {\n Scanner userInput = new Scanner(System.in);\n System.out.print(\"Insert text: \");\n String inputText = userInput.nextLin...
[ "0.7577929", "0.7450691", "0.7366091", "0.73584723", "0.72675335", "0.71902573", "0.7106357", "0.70591027", "0.70006216", "0.69537497", "0.6947707", "0.6941373", "0.69401395", "0.69340575", "0.6902306", "0.69001013", "0.6874158", "0.68110245", "0.6796568", "0.67840546", "0.67...
0.63167936
64
Prompts the user to select an order id
public OrderID promptOrderID(String dateFormat, boolean mustBeFuture) { DateTimeFormatter dateFormatter; LocalDate date; int number; String selection; dateFormatter = DateTimeFormatter.ofPattern(dateFormat); // Prompt the date until the date is a future date date = promptDate( "\nToday's date is " + LocalDate.now().format(dateFormatter) + ".\n" + "Please input a date for the order: (" + dateFormat + ")", dateFormat ); while((mustBeFuture) && (date.compareTo(LocalDate.now()) <= 0)) { date = promptDate( "Your order's date must be in the future.\n\n" + "Today's date is " + LocalDate.now().format(dateFormatter) + ".\n" + "Please input a date for the order: (" + dateFormat + ")", dateFormat ); } // Prompt the order number until it is a positive integer do { selection = promptString( "\nPlease input an order number:" ); try { number = Integer.parseInt(selection); } catch (NumberFormatException e) { ui.say("Invalid format."); continue; } if (number < 0) { ui.say("Order numbers are positive integers."); continue; } else { break; } } while(true); return new OrderID(number, date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showOrderGui(int ID) throws OrderNotFoundException;", "void acceptOrd(final int vId) {\r\n Orders emp = OrdersFactory.getvalidateOrders();\r\n if (emp != null) {\r\n showPlacedOrders(vId);\r\n System.out.println(\"Enter the Order ID to Accept :\");\r\n int ordid = option.nextInt(...
[ "0.64498025", "0.6131753", "0.60688615", "0.5904372", "0.5886869", "0.58753747", "0.5872613", "0.5870575", "0.58111686", "0.576274", "0.5762469", "0.5747128", "0.56179404", "0.56024665", "0.5587777", "0.55431384", "0.5529141", "0.5524237", "0.5507223", "0.549872", "0.54932255...
0.5542579
16
Prompts the user to input a positive number
private BigDecimal promptNumber(String message) { String selection; BigDecimal number; do { ui.say(message); selection = ui.readString(); try { number = (new BigDecimal(selection)).setScale(2, RoundingMode.HALF_UP); } catch (NumberFormatException e) { ui.say("Invalid number format."); continue; } if (number.compareTo(BigDecimal.ZERO) <= 0) { ui.say("Area must be a postive number."); continue; } else { break; } } while(true); return number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void determineIsPositiveInt() {\n System.out.println(\"Enter a number:\");\r\n Scanner s = new Scanner(System.in);\r\n int i = Integer.parseInt(s.nextLine());\r\n if (i > 0)\r\n System.out.println(\"Positive i\");\r\n else if (i == 0)\r\n Syst...
[ "0.74661314", "0.7395179", "0.72243327", "0.7098307", "0.7039233", "0.7001727", "0.6988901", "0.6988043", "0.6777578", "0.6712805", "0.6573622", "0.65654224", "0.64871687", "0.64750063", "0.6423616", "0.6393249", "0.6388554", "0.63884294", "0.6356094", "0.6345419", "0.6341655...
0.6002353
40
/ renamed from: com.ali.auth.third.core.b.b
public interface C0984b extends C0983a { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "public interface C26438t {\n /* renamed from: b */\n void mo5959b(boolean z, String str, Bundle bundle);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModul...
[ "0.60124105", "0.5772009", "0.57678866", "0.57410145", "0.57289934", "0.57272947", "0.57213527", "0.572076", "0.56970227", "0.56930697", "0.56641364", "0.5606825", "0.55832493", "0.5583154", "0.55679655", "0.5559824", "0.55581015", "0.55523247", "0.55523247", "0.5537202", "0....
0.0
-1
Truncate TupleList by removing tuples that
public void truncate(List<String> keywords) { List<OverloadedTuple> newTupleList = new ArrayList<>(); for(OverloadedTuple tuple: this.tuples) if (tuple.containsAllKeywords(keywords)) newTupleList.add(tuple); this.tuples = newTupleList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remove(Tuple t){\r\n\t\ttuples.remove(t);\r\n\t\tsize--;\r\n\t}", "public void removeAllTuples(List<OverloadedTuple> tuples) {\n this.tuples.removeAll(tuples);\n }", "protected Tuple cleanTuple(Tuple result)\n {\n return result;\n }", "private List<Coordinate> trim(List<Coo...
[ "0.61001635", "0.6089409", "0.5947582", "0.5602334", "0.5433597", "0.53498375", "0.53442276", "0.5222819", "0.517423", "0.50511295", "0.50359046", "0.50133795", "0.5010604", "0.49919406", "0.49881548", "0.4986462", "0.49837133", "0.493411", "0.4910822", "0.48985788", "0.48860...
0.5635777
3
Sublists the result to the desired number if only there are more tuples.
public void subList(int size){ if (this.tuples.size() > size) this.tuples = this.tuples.subList(0, size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void numberResults ()\r\n {\r\n int partIndex = 0;\r\n\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n scorePart.setId(++partIndex);\r\n }\r\n }", "private void helper(i...
[ "0.527931", "0.5260959", "0.521698", "0.51676536", "0.5088599", "0.5042066", "0.5027201", "0.5013484", "0.5007815", "0.49707434", "0.49320343", "0.49301392", "0.4927639", "0.49231306", "0.49226898", "0.49225235", "0.4908403", "0.48841506", "0.48676574", "0.4862432", "0.485379...
0.55050004
0
Removes list of tuples.
public void removeAllTuples(List<OverloadedTuple> tuples) { this.tuples.removeAll(tuples); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remove(Tuple t){\r\n\t\ttuples.remove(t);\r\n\t\tsize--;\r\n\t}", "protected Tuple cleanTuple(Tuple result)\n {\n return result;\n }", "public Tuple remove(int[] pos) {\n verifyModifiable();\n\n // calculate offsets to apply when removing values from elements\n int offset[] = ...
[ "0.6953155", "0.6136447", "0.59863985", "0.5886364", "0.5581657", "0.5474756", "0.53656185", "0.53208494", "0.53181434", "0.52947456", "0.52560526", "0.52314353", "0.52302", "0.5186757", "0.51866096", "0.51797533", "0.5149746", "0.5127188", "0.51233417", "0.51200944", "0.5101...
0.74397236
0
Returns true if tuples is empty.
public boolean isEmpty() { return this.tuples.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}", "public boolean isEmpty()\n\t{\n\t\treturn vertices.isEmpty();\n\t}", "public boolean empty() {\n return data.size() == 0;\n }", "public boolean isEmpty() {\n return points.isEmpty();\n }", "public boolean empty() {\n ret...
[ "0.73175925", "0.72380024", "0.7170764", "0.71451133", "0.71345234", "0.7131739", "0.71178836", "0.7112154", "0.7107563", "0.7101702", "0.70909256", "0.7081171", "0.70624393", "0.7061489", "0.7061489", "0.7061489", "0.7057677", "0.7053669", "0.704534", "0.70431596", "0.703672...
0.8518014
0
Prints the list of tuples in an SQL like format.
public void print() { if (this.tuples == null || this.tuples.isEmpty()) return; // Initialize number of attributes. int attributesNumber = attributes.size(); // An array storing the max length of Strings per column. // The Strings per column are tuple Values and attributes. int[] maxColumnLengthOfStrings = new int[attributesNumber]; // Loop all the attributes and fill the max length array for (int index = 0; index < attributesNumber; index++) { // Initialize the array with the attributes name length. maxColumnLengthOfStrings[index] = attributes.get(index).getName().length(); // Loop the values and find the longest value toString(). for (int rowIndex = 0; rowIndex < this.tuples.size(); rowIndex++) { // Loop the rows String value = this.tuples.get(rowIndex).getValues().get(index).toString(); if (value.length() > maxColumnLengthOfStrings[index]){ maxColumnLengthOfStrings[index] = value.length(); } } } // A set of tables whose columns are in the attributes list. Set<SQLTable> tablesSet = new HashSet<>(); // The list of attributes to String format. String attributesList = new String(); // A line used to separate the attributes from the data. String separationLine = new String(); // Create the separation line and the attributes line. for (int index = 0; index < attributesNumber; index++) { // The score column has a null table. Dont search it. if (!this.attributes.get(index).getName().equals("score")) tablesSet.add((this.attributes.get(index).getTable()) ); attributesList += "|" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], this.attributes.get(index).getName(), " "); separationLine += "+" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], "", "-"); } attributesList += "|"; // Add the last "|". separationLine += "+"; // Add the last "+". // Print the tables which contain this tuples (HACK WAY). String tablesInString = new String ("Tables joined : "); for (SQLTable table: tablesSet) { tablesInString += table.toAbbreviation() + " |><| "; } System.out.println(tablesInString.substring(0, tablesInString.length()-5)); // Print the attributes between separation lines. System.out.println(separationLine); System.out.println(attributesList); System.out.println(separationLine); // Print all the rows of Tuple Values. for (OverloadedTuple tuple: this.tuples) { String rowOfValues = new String(); for (int index = 0; index < attributesNumber; index++) { rowOfValues += "|" + PrintingUtils.addStringWithLeadingChars( maxColumnLengthOfStrings[index], tuple.getValues().get(index).toString(), " "); } rowOfValues += "|"; System.out.println(rowOfValues); } // Print a separation line. System.out.println(separationLine); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n if (this.tuples == null || this.tuples.isEmpty()) return \"i\"; \n String retStr = new String(); \n\n // Initialize number of attributes.\n int attributesNumber = attributes.size();\n\n // An array storing the max length of String...
[ "0.6593712", "0.59293705", "0.5915827", "0.58999014", "0.5866282", "0.57904583", "0.57628673", "0.57207716", "0.57165956", "0.569484", "0.56141585", "0.55736524", "0.5530139", "0.55288863", "0.5516686", "0.54955894", "0.54886", "0.54740447", "0.5472671", "0.5455342", "0.54505...
0.68230873
0
Prints the list of tuples in an SQL like format.
@Override public String toString() { if (this.tuples == null || this.tuples.isEmpty()) return "i"; String retStr = new String(); // Initialize number of attributes. int attributesNumber = attributes.size(); // An array storing the max length of Strings per column. // The Strings per column are tuple Values and attributes. int[] maxColumnLengthOfStrings = new int[attributesNumber]; // Loop all the attributes and fill the max length array for (int index = 0; index < attributesNumber; index++) { // Initialize the array with the attributes name length. maxColumnLengthOfStrings[index] = attributes.get(index).getName().length(); // Loop the values and find the longest value toString(). for (int rowIndex = 0; rowIndex < this.tuples.size(); rowIndex++) { // Loop the rows String value = this.tuples.get(rowIndex).getValues().get(index).toString(); if (value.length() > maxColumnLengthOfStrings[index]){ maxColumnLengthOfStrings[index] = value.length(); } } } // A set of tables whose columns are in the attributes list. Set<SQLTable> tablesSet = new HashSet<>(); // The list of attributes to String format. String attributesList = new String(); // A line used to separate the attributes from the data. String separationLine = new String(); // Create the separation line and the attributes line. for (int index = 0; index < attributesNumber; index++) { // The score column has a null table. Dont search it. if (!this.attributes.get(index).getName().equals("score")) tablesSet.add((this.attributes.get(index).getTable()) ); attributesList += "|" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], this.attributes.get(index).getName(), " "); separationLine += "+" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], "", "-"); } attributesList += "|"; // Add the last "|". separationLine += "+"; // Add the last "+". // Print the tables which contain this tuples (HACK WAY). // String tablesInString = new String ("Tables joined : "); // for (SQLTable table: tablesSet) { // tablesInString += table.toAbbreviation() + " |><| "; // } // System.out.println(tablesInString.substring(0, tablesInString.length()-5)); // Print the attributes between separation lines. retStr += this.network + "\n"; retStr += separationLine + "\n"; retStr += attributesList + "\n"; retStr += separationLine + "\n"; // Print all the rows of Tuple Values. for (OverloadedTuple tuple: this.tuples) { String rowOfValues = new String(); for (int index = 0; index < attributesNumber; index++) { rowOfValues += "|" + PrintingUtils.addStringWithLeadingChars( maxColumnLengthOfStrings[index], tuple.getValues().get(index).toString(), " "); } rowOfValues += "|"; // Replace any \n with a space retStr += rowOfValues.replace('\n', ' ') + "\n"; } // Print a separation line. retStr += separationLine + "\n"; return retStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print() {\n if (this.tuples == null || this.tuples.isEmpty()) return; \n\n // Initialize number of attributes.\n int attributesNumber = attributes.size();\n\n // An array storing the max length of Strings per column.\n // The Strings per column are tuple Values...
[ "0.68230873", "0.59293705", "0.5915827", "0.58999014", "0.5866282", "0.57904583", "0.57628673", "0.57207716", "0.57165956", "0.569484", "0.56141585", "0.55736524", "0.5530139", "0.55288863", "0.5516686", "0.54955894", "0.54886", "0.54740447", "0.5472671", "0.5455342", "0.5450...
0.6593712
1
Get all the goods.
@Override @Transactional(readOnly = true) public List<Goods> findAll() { log.debug("Request to get all Goods"); return goodsRepository.findAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Goods> getGoodsList();", "@Override\n\tpublic List<Goods> getGoodsList() {\n\t\treturn goodsMapper.selectAllGoods();\n\t}", "public List<Buy> getAll() throws PersistException;", "public void listGoods() {\n\t\tfor (String goodId : goods.keySet()) {\n\t\t\tBoolean value = goods.get(goodId).forSale();\n\t...
[ "0.7535921", "0.7455258", "0.7206758", "0.70378697", "0.70209473", "0.70161325", "0.70129186", "0.6871248", "0.68557614", "0.6764873", "0.67500275", "0.67500275", "0.67500275", "0.67420936", "0.6740588", "0.67219347", "0.6711398", "0.66646564", "0.6630352", "0.65773535", "0.6...
0.7624942
0
Get one goods by id.
@Override @Transactional(readOnly = true) public Optional<Goods> findOne(Long id) { log.debug("Request to get Goods : {}", id); return goodsRepository.findById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Goods getid(Integer id) {\n\t\treturn sm.selectOne(\"com.huyu.entity.Goods.getById\", id);\n\t}", "@Override\n\tpublic Goods selectById(Integer id) {\n\t\treturn goodsDao.selectById(id);\n\t}", "@Override\r\n\tpublic Dx_Goods getByid(int id) {\n\t\treturn dx_GoodsDao.getByid(id);\r\n\t}", "@Override\n...
[ "0.8263722", "0.7901618", "0.78303987", "0.7767715", "0.7396645", "0.7285393", "0.72720355", "0.715874", "0.70113635", "0.694482", "0.6929796", "0.69252396", "0.6862573", "0.68603617", "0.68377954", "0.6835389", "0.6829655", "0.6789346", "0.67869794", "0.67412317", "0.6734685...
0.8009242
1
Delete the goods by id.
@Override public void delete(Long id) { log.debug("Request to delete Goods : {}", id); goodsRepository.deleteById(id); goodsSearchRepository.deleteById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int del(Integer id) {\n\t\treturn sm.delete(\"com.huyu.entity.Goods.del\", id);\n\t}", "@Override\n\tpublic void deleteGoods(int goodsId) {\n\t\tgoodsMapper.deleteByPrimaryKey(goodsId);\n\t}", "@Override\n\tpublic void deletePrice(int goodsId) {\n\t\tgoodsMapper.deleteByPrimaryKey(goodsId);\n\t}", "pu...
[ "0.79762244", "0.77765626", "0.7600943", "0.7408607", "0.7408607", "0.7408607", "0.7391177", "0.7384893", "0.73817736", "0.7368148", "0.73586637", "0.7330766", "0.7330766", "0.7330766", "0.7330766", "0.7330766", "0.7287566", "0.7281683", "0.7281683", "0.7261205", "0.7260311",...
0.85184795
0
Search for the goods corresponding to the query.
@Override @Transactional(readOnly = true) public List<Goods> search(String query) { log.debug("Request to search Goods for query {}", query); return StreamSupport .stream(goodsSearchRepository.search(queryStringQuery(query)).spliterator(), false) .collect(Collectors.toList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Inventory searchForItem (TheGroceryStore g, Inventory i, String key);", "private static void searchForItem() {\r\n\t\tSystem.out.println(\"******************************************************************************************\");\r\n\t\tSystem.out.println(\" Please type your search ...
[ "0.65628624", "0.64475465", "0.64398974", "0.639564", "0.63722813", "0.6260868", "0.61918783", "0.61830807", "0.6176691", "0.61569875", "0.6152312", "0.6107513", "0.60833627", "0.60093915", "0.597283", "0.5972485", "0.5960528", "0.59569305", "0.5939049", "0.59384435", "0.5938...
0.7147454
0
count graphlets on max 5 nodes
@Override public long[ ][ ] count() { // precompute common nodes for (int x = 0; x < n; x++) { for (int n1 = 0; n1 < deg[x]; n1++) { int a = adj[x][n1]; for (int n2 = n1 + 1; n2 < deg[x]; n2++) { int b = adj[x][n2]; Tuple ab = createTuple(a, b); common2.put(ab, common2.getOrDefault(ab, 0) + 1); for (int n3 = n2 + 1; n3 < deg[x]; n3++) { int c = adj[x][n3]; boolean st = adjacent(adj[a], b) ? (adjacent(adj[a], c) || adjacent(adj[b], c)) : (adjacent(adj[a], c) && adjacent(adj[b], c)); if (!st) continue; Tuple abc = createTuple(a, b, c); common3.put(abc, common3.getOrDefault(abc, 0) + 1); } } } } // precompute triangles that span over edges int[ ] tri = countTriangles(); // count full graphlets long[ ] C5 = new long[n]; int[ ] neigh = new int[n]; int[ ] neigh2 = new int[n]; int nn, nn2; for (int x = 0; x < n; x++) { for (int nx = 0; nx < deg[x]; nx++) { int y = adj[x][nx]; if (y >= x) break; nn = 0; for (int ny = 0; ny < deg[y]; ny++) { int z = adj[y][ny]; if (z >= y) break; if (adjacent(adj[x], z)) { neigh[nn++] = z; } } for (int i = 0; i < nn; i++) { int z = neigh[i]; nn2 = 0; for (int j = i + 1; j < nn; j++) { int zz = neigh[j]; if (adjacent(adj[z], zz)) { neigh2[nn2++] = zz; } } for (int i2 = 0; i2 < nn2; i2++) { int zz = neigh2[i2]; for (int j2 = i2 + 1; j2 < nn2; j2++) { int zzz = neigh2[j2]; if (adjacent(adj[zz], zzz)) { C5[x]++; C5[y]++; C5[z]++; C5[zz]++; C5[zzz]++; } } } } } } int[ ] common_x = new int[n]; int[ ] common_x_list = new int[n]; int ncx = 0; int[ ] common_a = new int[n]; int[ ] common_a_list = new int[n]; int nca = 0; // set up a system of equations relating orbit counts for (int x = 0; x < n; x++) { for (int i = 0; i < ncx; i++) common_x[common_x_list[i]] = 0; ncx = 0; // smaller graphlets orbit[x][0] = deg[x]; for (int nx1 = 0; nx1 < deg[x]; nx1++) { int a = adj[x][nx1]; for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = adj[x][nx2]; if (adjacent(adj[a], b)) orbit[x][3]++; else orbit[x][2]++; } for (int na = 0; na < deg[a]; na++) { int b = adj[a][na]; if (b != x && !adjacent(adj[x], b)) { orbit[x][1]++; if (common_x[b] == 0) common_x_list[ncx++] = b; common_x[b]++; } } } long f_71 = 0, f_70 = 0, f_67 = 0, f_66 = 0, f_58 = 0, f_57 = 0; // 14 long f_69 = 0, f_68 = 0, f_64 = 0, f_61 = 0, f_60 = 0, f_55 = 0, f_48 = 0, f_42 = 0, f_41 = 0; // 13 long f_65 = 0, f_63 = 0, f_59 = 0, f_54 = 0, f_47 = 0, f_46 = 0, f_40 = 0; // 12 long f_62 = 0, f_53 = 0, f_51 = 0, f_50 = 0, f_49 = 0, f_38 = 0, f_37 = 0, f_36 = 0; // 8 long f_44 = 0, f_33 = 0, f_30 = 0, f_26 = 0; // 11 long f_52 = 0, f_43 = 0, f_32 = 0, f_29 = 0, f_25 = 0; // 10 long f_56 = 0, f_45 = 0, f_39 = 0, f_31 = 0, f_28 = 0, f_24 = 0; // 9 long f_35 = 0, f_34 = 0, f_27 = 0, f_18 = 0, f_16 = 0, f_15 = 0; // 4 long f_17 = 0; // 5 long f_22 = 0, f_20 = 0, f_19 = 0; // 6 long f_23 = 0, f_21 = 0; // 7 for (int nx1 = 0; nx1 < deg[x]; nx1++) { int a = inc[x][nx1]._1, xa = inc[x][nx1]._2; for (int i = 0; i < nca; i++) common_a[common_a_list[i]] = 0; nca = 0; for (int na = 0; na < deg[a]; na++) { int b = adj[a][na]; for (int nb = 0; nb < deg[b]; nb++) { int c = adj[b][nb]; if (c == a || adjacent(adj[a], c)) continue; if (common_a[c] == 0) common_a_list[nca++] = c; common_a[c]++; } } // x = orbit-14 (tetrahedron) for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (!adjacent(adj[a], b)) continue; for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) { int c = inc[x][nx3]._1, xc = inc[x][nx3]._2; if (!adjacent(adj[a], c) || !adjacent(adj[b], c)) continue; orbit[x][14]++; f_70 += common3.getOrDefault(createTuple(a, b, c), 0) - 1; f_71 += (tri[xa] > 2 && tri[xb] > 2) ? (common3.getOrDefault(createTuple(x, a, b), 0) - 1) : 0; f_71 += (tri[xa] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, a, c), 0) - 1) : 0; f_71 += (tri[xb] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0; f_67 += tri[xa] - 2 + tri[xb] - 2 + tri[xc] - 2; f_66 += common2.getOrDefault(createTuple(a, b), 0) - 2; f_66 += common2.getOrDefault(createTuple(a, c), 0) - 2; f_66 += common2.getOrDefault(createTuple(b, c), 0) - 2; f_58 += deg[x] - 3; f_57 += deg[a] - 3 + deg[b] - 3 + deg[c] - 3; } } // x = orbit-13 (diamond) for (int nx2 = 0; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (!adjacent(adj[a], b)) continue; for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) { int c = inc[x][nx3]._1, xc = inc[x][nx3]._2; if (!adjacent(adj[a], c) || adjacent(adj[b], c)) continue; orbit[x][13]++; f_69 += (tri[xb] > 1 && tri[xc] > 1) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0; f_68 += common3.getOrDefault(createTuple(a, b, c), 0) - 1; f_64 += common2.getOrDefault(createTuple(b, c), 0) - 2; f_61 += tri[xb] - 1 + tri[xc] - 1; f_60 += common2.getOrDefault(createTuple(a, b), 0) - 1; f_60 += common2.getOrDefault(createTuple(a, c), 0) - 1; f_55 += tri[xa] - 2; f_48 += deg[b] - 2 + deg[c] - 2; f_42 += deg[x] - 3; f_41 += deg[a] - 3; } } // x = orbit-12 (diamond) for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (!adjacent(adj[a], b)) continue; for (int na = 0; na < deg[a]; na++) { int c = inc[a][na]._1, ac = inc[a][na]._2; if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue; orbit[x][12]++; f_65 += (tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0; f_63 += common_x[c] - 2; f_59 += tri[ac] - 1 + common2.getOrDefault(createTuple(b, c), 0) - 1; f_54 += common2.getOrDefault(createTuple(a, b), 0) - 2; f_47 += deg[x] - 2; f_46 += deg[c] - 2; f_40 += deg[a] - 3 + deg[b] - 3; } } // x = orbit-8 (cycle) for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (adjacent(adj[a], b)) continue; for (int na = 0; na < deg[a]; na++) { int c = inc[a][na]._1, ac = inc[a][na]._2; if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue; orbit[x][8]++; f_62 += (tri[ac] > 0) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0; f_53 += tri[xa] + tri[xb]; f_51 += tri[ac] + common2.getOrDefault(createTuple(c, b), 0); f_50 += common_x[c] - 2; f_49 += common_a[b] - 2; f_38 += deg[x] - 2; f_37 += deg[a] - 2 + deg[b] - 2; f_36 += deg[c] - 2; } } // x = orbit-11 (paw) for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (!adjacent(adj[a], b)) continue; for (int nx3 = 0; nx3 < deg[x]; nx3++) { int c = inc[x][nx3]._1, xc = inc[x][nx3]._2; if (c == a || c == b || adjacent(adj[a], c) || adjacent(adj[b], c)) continue; orbit[x][11]++; f_44 += tri[xc]; f_33 += deg[x] - 3; f_30 += deg[c] - 1; f_26 += deg[a] - 2 + deg[b] - 2; } } // x = orbit-10 (paw) for (int nx2 = 0; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (!adjacent(adj[a], b)) continue; for (int nb = 0; nb < deg[b]; nb++) { int c = inc[b][nb]._1, bc = inc[b][nb]._2; if (c == x || c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue; orbit[x][10]++; f_52 += common_a[c] - 1; f_43 += tri[bc]; f_32 += deg[b] - 3; f_29 += deg[c] - 1; f_25 += deg[a] - 2; } } // x = orbit-9 (paw) for (int na1 = 0; na1 < deg[a]; na1++) { int b = inc[a][na1]._1, ab = inc[a][na1]._2; if (b == x || adjacent(adj[x], b)) continue; for (int na2 = na1 + 1; na2 < deg[a]; na2++) { int c = inc[a][na2]._1, ac = inc[a][na2]._2; if (c == x || !adjacent(adj[b], c) || adjacent(adj[x], c)) continue; orbit[x][9]++; f_56 += (tri[ab] > 1 && tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0; f_45 += common2.getOrDefault(createTuple(b, c), 0) - 1; f_39 += tri[ab] - 1 + tri[ac] - 1; f_31 += deg[a] - 3; f_28 += deg[x] - 1; f_24 += deg[b] - 2 + deg[c] - 2; } } // x = orbit-4 (path) for (int na = 0; na < deg[a]; na++) { int b = inc[a][na]._1, ab = inc[a][na]._2; if (b == x || adjacent(adj[x], b)) continue; for (int nb = 0; nb < deg[b]; nb++) { int c = inc[b][nb]._1, bc = inc[b][nb]._2; if (c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue; orbit[x][4]++; f_35 += common_a[c] - 1; f_34 += common_x[c]; f_27 += tri[bc]; f_18 += deg[b] - 2; f_16 += deg[x] - 1; f_15 += deg[c] - 1; } } // x = orbit-5 (path) for (int nx2 = 0; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (b == a || adjacent(adj[a], b)) continue; for (int nb = 0; nb < deg[b]; nb++) { int c = inc[b][nb]._1, bc = inc[b][nb]._2; if (c == x || adjacent(adj[a], c) || adjacent(adj[x], c)) continue; orbit[x][5]++; f_17 += deg[a] - 1; } } // x = orbit-6 (claw) for (int na1 = 0; na1 < deg[a]; na1++) { int b = inc[a][na1]._1, ab = inc[a][na1]._2; if (b == x || adjacent(adj[x], b)) continue; for (int na2 = na1 + 1; na2 < deg[a]; na2++) { int c = inc[a][na2]._1, ac = inc[a][na2]._2; if (c == x || adjacent(adj[x], c) || adjacent(adj[b], c)) continue; orbit[x][6]++; f_22 += deg[a] - 3; f_20 += deg[x] - 1; f_19 += deg[b] - 1 + deg[c] - 1; } } // x = orbit-7 (claw) for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) { int b = inc[x][nx2]._1, xb = inc[x][nx2]._2; if (adjacent(adj[a], b)) continue; for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) { int c = inc[x][nx3]._1, xc = inc[x][nx3]._2; if (adjacent(adj[a], c) || adjacent(adj[b], c)) continue; orbit[x][7]++; f_23 += deg[x] - 3; f_21 += deg[a] - 1 + deg[b] - 1 + deg[c] - 1; } } } // solve equations orbit[x][72] = C5[x]; orbit[x][71] = (f_71 - 12 * orbit[x][72]) / 2; orbit[x][70] = (f_70 - 4 * orbit[x][72]); orbit[x][69] = (f_69 - 2 * orbit[x][71]) / 4; orbit[x][68] = (f_68 - 2 * orbit[x][71]); orbit[x][67] = (f_67 - 12 * orbit[x][72] - 4 * orbit[x][71]); orbit[x][66] = (f_66 - 12 * orbit[x][72] - 2 * orbit[x][71] - 3 * orbit[x][70]); orbit[x][65] = (f_65 - 3 * orbit[x][70]) / 2; orbit[x][64] = (f_64 - 2 * orbit[x][71] - 4 * orbit[x][69] - 1 * orbit[x][68]); orbit[x][63] = (f_63 - 3 * orbit[x][70] - 2 * orbit[x][68]); orbit[x][62] = (f_62 - 1 * orbit[x][68]) / 2; orbit[x][61] = (f_61 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][67]) / 2; orbit[x][60] = (f_60 - 4 * orbit[x][71] - 2 * orbit[x][68] - 2 * orbit[x][67]); orbit[x][59] = (f_59 - 6 * orbit[x][70] - 2 * orbit[x][68] - 4 * orbit[x][65]); orbit[x][58] = (f_58 - 4 * orbit[x][72] - 2 * orbit[x][71] - 1 * orbit[x][67]); orbit[x][57] = (f_57 - 12 * orbit[x][72] - 4 * orbit[x][71] - 3 * orbit[x][70] - 1 * orbit[x][67] - 2 * orbit[x][66]); orbit[x][56] = (f_56 - 2 * orbit[x][65]) / 3; orbit[x][55] = (f_55 - 2 * orbit[x][71] - 2 * orbit[x][67]) / 3; orbit[x][54] = (f_54 - 3 * orbit[x][70] - 1 * orbit[x][66] - 2 * orbit[x][65]) / 2; orbit[x][53] = (f_53 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63]); orbit[x][52] = (f_52 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59]) / 2; orbit[x][51] = (f_51 - 2 * orbit[x][68] - 2 * orbit[x][63] - 4 * orbit[x][62]); orbit[x][50] = (f_50 - 1 * orbit[x][68] - 2 * orbit[x][63]) / 3; orbit[x][49] = (f_49 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][62]) / 2; orbit[x][48] = (f_48 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][68] - 2 * orbit[x][67] - 2 * orbit[x][64] - 2 * orbit[x][61] - 1 * orbit[x][60]); orbit[x][47] = (f_47 - 3 * orbit[x][70] - 2 * orbit[x][68] - 1 * orbit[x][66] - 1 * orbit[x][63] - 1 * orbit[x][60]); orbit[x][46] = (f_46 - 3 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][65] - 1 * orbit[x][63] - 1 * orbit[x][59]); orbit[x][45] = (f_45 - 2 * orbit[x][65] - 2 * orbit[x][62] - 3 * orbit[x][56]); orbit[x][44] = (f_44 - 1 * orbit[x][67] - 2 * orbit[x][61]) / 4; orbit[x][43] = (f_43 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59]) / 2; orbit[x][42] = (f_42 - 2 * orbit[x][71] - 4 * orbit[x][69] - 2 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][55]); orbit[x][41] = (f_41 - 2 * orbit[x][71] - 1 * orbit[x][68] - 2 * orbit[x][67] - 1 * orbit[x][60] - 3 * orbit[x][55]); orbit[x][40] = (f_40 - 6 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][66] - 4 * orbit[x][65] - 1 * orbit[x][60] - 1 * orbit[x][59] - 4 * orbit[x][54]); orbit[x][39] = (f_39 - 4 * orbit[x][65] - 1 * orbit[x][59] - 6 * orbit[x][56]) / 2; orbit[x][38] = (f_38 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][63] - 1 * orbit[x][53] - 3 * orbit[x][50]); orbit[x][37] = (f_37 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63] - 4 * orbit[x][62] - 1 * orbit[x][53] - 1 * orbit[x][51] - 4 * orbit[x][49]); orbit[x][36] = (f_36 - 1 * orbit[x][68] - 2 * orbit[x][63] - 2 * orbit[x][62] - 1 * orbit[x][51] - 3 * orbit[x][50]); orbit[x][35] = (f_35 - 1 * orbit[x][59] - 2 * orbit[x][52] - 2 * orbit[x][45]) / 2; orbit[x][34] = (f_34 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51]) / 2; orbit[x][33] = (f_33 - 1 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][58] - 4 * orbit[x][44] - 2 * orbit[x][42]) / 2; orbit[x][32] = (f_32 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][43] - 2 * orbit[x][41] - 1 * orbit[x][40]) / 2; orbit[x][31] = (f_31 - 2 * orbit[x][65] - 1 * orbit[x][59] - 3 * orbit[x][56] - 1 * orbit[x][43] - 2 * orbit[x][39]); orbit[x][30] = (f_30 - 1 * orbit[x][67] - 1 * orbit[x][63] - 2 * orbit[x][61] - 1 * orbit[x][53] - 4 * orbit[x][44]); orbit[x][29] = (f_29 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][60] - 1 * orbit[x][59] - 1 * orbit[x][53] - 2 * orbit[x][52] - 2 * orbit[x][43]); orbit[x][28] = (f_28 - 2 * orbit[x][65] - 2 * orbit[x][62] - 1 * orbit[x][59] - 1 * orbit[x][51] - 1 * orbit[x][43]); orbit[x][27] = (f_27 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][45]) / 2; orbit[x][26] = (f_26 - 2 * orbit[x][67] - 2 * orbit[x][63] - 2 * orbit[x][61] - 6 * orbit[x][58] - 1 * orbit[x][53] - 2 * orbit[x][47] - 2 * orbit[x][42]); orbit[x][25] = (f_25 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][52] - 1 * orbit[x][48] - 1 * orbit[x][40]) / 2; orbit[x][24] = (f_24 - 4 * orbit[x][65] - 4 * orbit[x][62] - 1 * orbit[x][59] - 6 * orbit[x][56] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][39]); orbit[x][23] = (f_23 - 1 * orbit[x][55] - 1 * orbit[x][42] - 2 * orbit[x][33]) / 4; orbit[x][22] = (f_22 - 2 * orbit[x][54] - 1 * orbit[x][40] - 1 * orbit[x][39] - 1 * orbit[x][32] - 2 * orbit[x][31]) / 3; orbit[x][21] = (f_21 - 3 * orbit[x][55] - 3 * orbit[x][50] - 2 * orbit[x][42] - 2 * orbit[x][38] - 2 * orbit[x][33]); orbit[x][20] = (f_20 - 2 * orbit[x][54] - 2 * orbit[x][49] - 1 * orbit[x][40] - 1 * orbit[x][37] - 1 * orbit[x][32]); orbit[x][19] = (f_19 - 4 * orbit[x][54] - 4 * orbit[x][49] - 1 * orbit[x][40] - 2 * orbit[x][39] - 1 * orbit[x][37] - 2 * orbit[x][35] - 2 * orbit[x][31]); orbit[x][18] = (f_18 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][45] - 2 * orbit[x][36] - 2 * orbit[x][27] - 1 * orbit[x][24]) / 2; orbit[x][17] = (f_17 - 1 * orbit[x][60] - 1 * orbit[x][53] - 1 * orbit[x][51] - 1 * orbit[x][48] - 1 * orbit[x][37] - 2 * orbit[x][34] - 2 * orbit[x][30]) / 2; orbit[x][16] = (f_16 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][36] - 2 * orbit[x][34] - 1 * orbit[x][29]); orbit[x][15] = (f_15 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][35] - 2 * orbit[x][34] - 2 * orbit[x][27]); } return orbit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getNodesCount();", "int getNodesCount();", "int getNodeCount();", "int getNodeCount();", "int totalNumberOfNodes();", "public int getNumberOfNodesEvaluated();", "@Override\n public int nodeCount() {\n return graphNodes.size();\n }", "int getNumberOfEdges();", "public int numEdges()...
[ "0.73892033", "0.73892033", "0.69444096", "0.69444096", "0.6852587", "0.6690624", "0.6630265", "0.6615789", "0.6586324", "0.65366006", "0.6526854", "0.6515189", "0.6510064", "0.65033066", "0.6494097", "0.6467776", "0.6449461", "0.64194906", "0.6366126", "0.62939346", "0.62922...
0.7169379
2
/ this saves world options
public Save(Player player, String worldname) { this(player.game, "/saves/" + worldname + "/"); writeGame("Game"); //writePrefs("KeyPrefs"); writeWorld("Level"); writePlayer("Player", player); writeInventory("Inventory", player); writeEntities("Entities"); Game.notifications.add("World Saved!"); player.game.asTick = 0; player.game.saving = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void configureWorlds(){\n switch (gameWorld){\n case NORMAL:\n world.setPVP(true);\n world.setKeepSpawnInMemory(false);\n world.setAutoSave(false);\n world.setStorm(false);\n world.setThundering(false);\n ...
[ "0.6817094", "0.6739283", "0.65474254", "0.6340246", "0.626026", "0.6233442", "0.6215135", "0.6207621", "0.6201398", "0.6165909", "0.61170214", "0.60000086", "0.5965327", "0.5965024", "0.5916867", "0.5907856", "0.5902089", "0.5806542", "0.5794555", "0.57572615", "0.5719352", ...
0.6148267
10
this saves global options
public Save(Game game) { this(game, "/"); writePrefs("Preferences"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void saveOptions() {\r\n\t\tMain.bagValue = GameOptions.bagValue.getSelectedItem();\r\n\t\tMain.nilValue = GameOptions.nilValueTextField.getText();\r\n\t\tMain.doubleNilValue = GameOptions.doubleNilValueTextField.getText();\r\n\t\tMain.winScore = GameOptions.winScoreTextField.getText();\r\n\t\tMain.l...
[ "0.703158", "0.67143136", "0.65474063", "0.635973", "0.63137466", "0.63076895", "0.6299503", "0.62937456", "0.6280322", "0.62340444", "0.6188988", "0.60577434", "0.605555", "0.60343456", "0.60302436", "0.6002918", "0.5969839", "0.5962944", "0.59558886", "0.5955326", "0.593494...
0.5142249
97
TODO Autogenerated method stub
@Override //查询数据 public Student selectStudent(String id) { Student student =null; Connection connection =null; PreparedStatement pstatement = null; ResultSet rset = null; String sql ="SELECT * FROM mwfj_jdbc.Student WHERE id = ? "; try { connection = MySQLConnectUtil.getMySQLConnection(); System.out.println("connection: "+connection); pstatement = connection.prepareStatement(sql); pstatement.setString(1,id); rset = pstatement.executeQuery(); while(rset.next()){ student = new Student(); student.setId(rset.getString(1)); student.setName(rset.getString(2)); student.setAge(rset.getInt(3)); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { MySQLConnectUtil.closeResultset(rset); MySQLConnectUtil.closePreparestatement(pstatement); MySQLConnectUtil.closeConnection(connection); } return student; }
{ "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 List<Student> selectStudents() { Connection connection =null; PreparedStatement ps = null; ResultSet rs = null; List<Student> sList = new ArrayList<Student>(); try { connection = MySQLConnectUtil.getMySQLConnection(); ps = connection.prepareStatement(QUARYSQL); rs = ps.executeQuery(); while (rs.next()) { Student student = new Student(); student.setId(rs.getString("ID")); student.setName(rs.getString("NAME")); student.setAge(rs.getInt("AGE")); sList.add(student); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { MySQLConnectUtil.closeResultset(rs); MySQLConnectUtil.closePreparestatement(ps); MySQLConnectUtil.closeConnection(connection); } return sList; }
{ "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 int totalColum() { Connection connection = null; int total_count = 0; PreparedStatement pStatement = null; ResultSet rSet = null; try { connection = MySQLConnectUtil.getMySQLConnection(); pStatement = connection.prepareStatement(COUNT); rSet = pStatement.executeQuery(); while (rSet.next()) { total_count = rSet.getInt("totalCount"); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ MySQLConnectUtil.closeResultset(rSet); MySQLConnectUtil.closePreparestatement(pStatement); MySQLConnectUtil.closeConnection(connection); } return total_count; }
{ "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 insertStudent(Student student) { Connection conn = null; PreparedStatement pStatement = null; try { conn = MySQLConnectUtil.getMySQLConnection(); pStatement = conn.prepareStatement(INSERT); pStatement.setString(1, student.getId()); pStatement.setString(2, student.getName()); pStatement.setInt(3, student.getAge()); int i =pStatement.executeUpdate(); System.out.println("影响行数"+i); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { MySQLConnectUtil.closePreparestatement(pStatement); MySQLConnectUtil.closeConnection(conn); } }
{ "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 deleteStudent(String id) { Connection conn = null; PreparedStatement pStatment = null; try { conn = MySQLConnectUtil.getMySQLConnection(); pStatment = conn.prepareStatement(DELETE); pStatment.setString(1, id); int i = pStatment.executeUpdate(); System.out.println("删除影响行数:" +i); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { MySQLConnectUtil.closePreparestatement(pStatment); MySQLConnectUtil.closeConnection(conn); } }
{ "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 /** * 修改数据 * update mwfj_jdbc.Student set paramr=? where id=? */ public void updateStudent(Student student) { }
{ "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
code for the 3in1 sensor
public static void main(String[] args) throws Exception { Port port = LocalEV3.get().getPort("S1"); MindsensorsAbsoluteIMU gyro = new MindsensorsAbsoluteIMU(port); SensorMode gyroprovider = (SensorMode) gyro.getAccelerationMode(); float[] sample = new float[gyro.sampleSize()]; //code for communication NXTCommConnector connector = Bluetooth.getNXTCommConnector(); NXTConnection connection = connector.connect("00:16:53:44:66:05", NXTConnection.RAW); DataOutputStream output = connection.openDataOutputStream(); //byte array that is being communicated byte[] data = new byte[1]; // main loop of the program, exits when escape button is pressed while(Button.getButtons() != Button.ID_ESCAPE) { //variable that's used to determine if the acceleartion state has changed from the previous loop byte temp = data[0]; //fetches data from the sensor and stores it in sample gyroprovider.fetchSample(sample, 0); //conditional logic for which value should be passed to the data stream if(sample[0] < -threshold) //forward data[0] = 0; else if (sample[0] > threshold) //backward data[0] = 1; else if (sample[1] > threshold) //left data[0] = 2; else if (sample[1] < -threshold)//right data[0] = 3; //writes the data variable to the stream if it changed if(data[0] != temp) output.write(data); output.flush(); } gyro.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void message3Pressed() {\n // display\n TextLCD.print(MESSAGE3);\n // current sensor state?\n boolean sensorState = fSensorState[0];\n // activate/passivate sensor\n if(sensorState)\n Sensor.S3.passivate();\n else\n Sensor.S3.activate();...
[ "0.63851416", "0.575505", "0.5737322", "0.5715285", "0.56645715", "0.56629854", "0.5637496", "0.5631558", "0.5631558", "0.5631558", "0.5630067", "0.56167006", "0.5595369", "0.55657715", "0.5560612", "0.55537325", "0.5553593", "0.55388683", "0.5484489", "0.5471324", "0.5464112...
0.55269915
18
Persist the event and customer data. Uses AWS Transaction support for DynamoDBMapper, so both tables are saved as one transaction
public Customer persist() { TransactionWriteRequest writeRequest = new TransactionWriteRequest(); writeRequest.addPut(customerEvent.getData()); writeRequest.addPut(customerEvent); mapper.transactionWrite(writeRequest); return customerEvent.getData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "p...
[ "0.5833043", "0.577585", "0.5717608", "0.56961495", "0.55946285", "0.5579766", "0.5517504", "0.54762375", "0.5398811", "0.5398733", "0.53284454", "0.5283667", "0.5279663", "0.5272669", "0.526676", "0.5260731", "0.5237332", "0.51733315", "0.5167239", "0.5159979", "0.51514786",...
0.7131674
0
Check money in purse that they have this currency or not if some money is not remove it.
public static <E extends Valuable> List<E> filterByCurrency(List<E> money, String currency) { List<E> c = new ArrayList<E>(); for (E coin : money) { if (coin.getCurrency().equals(currency)) c.add(coin); } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void takeoutMoney (double amount) {\n if(amount >= 2.0) {\n int numberToRemove = (int) Math.min(getToonie(), amount / 2.0);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 2.0...
[ "0.6572459", "0.62737095", "0.6152619", "0.6146607", "0.60496247", "0.60430366", "0.6032562", "0.5882798", "0.5882798", "0.5836117", "0.58064485", "0.5789842", "0.57377124", "0.57106674", "0.5709625", "0.56448466", "0.5630374", "0.561423", "0.5580507", "0.55696845", "0.555847...
0.0
-1
print money in purse
public static void printList(List<? extends Valuable> money) { for (Valuable m : money) { System.out.println(m); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void display()\r\n\t{\r\n\t\tSystem.out.println(\"Dollar: $\"+getAmount());\r\n\t\tSystem.out.println(\"Rupiah: Rp.\"+dollarTorp());\r\n\t}", "public void getCredit(){\n System.out.println(\"Total Credit: \" +\"£\" + getUserMoney());\n }", "public void printCost() {\r\n double cost;\r\n...
[ "0.7191073", "0.70472187", "0.6946549", "0.6833923", "0.6804675", "0.6754383", "0.66808546", "0.66685325", "0.6612954", "0.6610189", "0.6561946", "0.65589315", "0.6541811", "0.6514284", "0.6502996", "0.6496079", "0.64799035", "0.64721036", "0.6435562", "0.64174944", "0.641039...
0.0
-1
Sort money that minimum value will come first
public static void sortMoney(List<? extends Valuable> money) { Comparator<Valuable> com = new ValueComparator(); Collections.sort(money, com); printList(money); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x...
[ "0.64431036", "0.6116207", "0.6109781", "0.601966", "0.5967909", "0.5939795", "0.5926427", "0.5913391", "0.58803594", "0.58632267", "0.5825833", "0.57867455", "0.577403", "0.5759112", "0.57163006", "0.57094663", "0.57053065", "0.56923956", "0.5689545", "0.5680813", "0.566801"...
0.6655045
0
Return the larger argument, based on sort order, using the objects' own compareTo method for comparing.
public static <E extends Comparable<? super E>> E max(E... args) throws IllegalArgumentException { E max = args[0]; for (int i = 0; i < args.length; i++) { if (args[i].compareTo(max) > 0) max = args[i]; } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Object max(Comparable c1, Comparable c2) {\n return (compare(c1, c2, false) >= 0 ? c1 : c2);\n }", "@Override\r\n public int compareTo(Object o) {\r\n Pokemon p = (Pokemon) o; // like o2\r\n return (this.getNumber() - p.getNumber()); // smallest to biggest\r\n }", "@...
[ "0.6219204", "0.61819553", "0.6114081", "0.6049161", "0.6042889", "0.60298914", "0.6006106", "0.5994246", "0.5991273", "0.59477407", "0.5919294", "0.59138674", "0.58992213", "0.58753264", "0.58721364", "0.5867244", "0.581182", "0.58077484", "0.57625055", "0.5750045", "0.57352...
0.0
-1
Purse p = new Purse(5); p.insert(new Coin(10,"Baht")); p.insert(new Coin(5, "b")); p.insert(new Coin(1, "a")); p.insert(new Coin(5, "Baht")); filterByCurrency(p.getMoney(), "Baht"); sortCoins(filterByCurrency(p.getMoney(), "Baht"));
public static void main(String[] args) { String max = MoneyUtil.max("dog", "aebra", "cat"); System.out.println(max); System.out.println("------------------------------------------"); Money m1 = new BankNote(100, "Baht"); Money m2 = new BankNote(500, "Baht"); Money m3 = new Coin(20, "Baht"); Money maxMoney = MoneyUtil.max(m1, m2, m3); System.out.println(maxMoney); System.out.println("------------------------------------------"); List<BankNote> list = new ArrayList<BankNote>(); list.add(new BankNote(10, "USD")); list.add(new BankNote(500, "Baht")); MoneyUtil.sortMoney(list); System.out.println("------------------------------------------"); List<Coin> coins = Arrays.asList(new Coin(5, "Baht"), new Coin(0.1, "Ringgit"), new Coin(5, "Cent")); List<Coin> result = MoneyUtil.filterByCurrency(coins, "Baht"); printList(result); }
{ "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.6038818", "0.59044325", "0.5631731", "0.5623184", "0.5591912", "0.5508793", "0.5461854", "0.545806", "0.5449126", "0.5443426", "0.54386014", "0.54131603", "0.5386209", "0.5372299", "0.5312599", "0.5303422", "0.52951056", "0.52578616", "0.5247066", "0.5241567", "0.52256167"...
0.5359789
14
TODO Autogenerated method stub
@Override public int mover() { return posicaoTopoEscada; }
{ "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 int getPosicao() { return posicaoBaixoEscada; }
{ "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
Sets the associated upgrade entity.
public void setUpgrade(UpgradeEntity upgrade) { this.upgrade = upgrade; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setFuelUpgrade(int fuelUp){fuelUpgrade = fuelUp;}", "public void setEntity(org.openejb.config.ejb11.Entity entity) {\n this._entity = entity;\n }", "public void setUpgradeFile( UpgradeFile file ) {\r\n\t\tupgradeFile = file;\r\n\t}", "public void setContext( UpgradeContext context...
[ "0.56090814", "0.55393237", "0.54733104", "0.54497343", "0.53889877", "0.53569853", "0.5339856", "0.5318342", "0.5114774", "0.51036775", "0.5094482", "0.5089382", "0.5068364", "0.5023189", "0.49882787", "0.4936985", "0.49342403", "0.4892768", "0.48917922", "0.48800465", "0.48...
0.73125005
0
... write your unit tests here ...
@Test public void exampleTest1() { try { Version version = new Version(null); } catch(IllegalArgumentException e) { Assert.assertEquals(errorVersionMustNotBeNull, e.getMessage()); } catch(Exception e) { Assert.fail("No exception thrown when null version passed to constructor: "+e.getClass().getName()+" "+e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSanity() {\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\n public void testQuickMapList() {\n//TODO: Test goes here... \n }", "@Test\n public void testAddACopy() {\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "@Test\n public void simpleUse(...
[ "0.7326505", "0.7051204", "0.69949985", "0.69775045", "0.6964535", "0.69457877", "0.6941164", "0.69340944", "0.6921915", "0.6908237", "0.69028133", "0.69028133", "0.6902757", "0.68700093", "0.68211925", "0.6805274", "0.6802246", "0.6799826", "0.67897093", "0.67831385", "0.676...
0.0
-1
Write a method to find out the maximum odd number in the range 3 to 11 and return square of it.
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getSquareNumber();", "@Test\n public void test4() {\n //I want find the max of 5,10,22\n int expected = 22;\n int actual = findMax(22,5,10);\n }", "public static int square( int num ) {\n\t\treturn num * num;\n\t}", "private int largestPowerOf2(int n) { \...
[ "0.63794523", "0.6346012", "0.627326", "0.6238829", "0.6090253", "0.6064104", "0.6049579", "0.6031534", "0.6019557", "0.6018378", "0.597452", "0.59169644", "0.59089375", "0.58953226", "0.58756226", "0.58702993", "0.58636975", "0.58458173", "0.5842574", "0.5839885", "0.5821745...
0.0
-1
This is a public constructor that Instantiates a new Decoder.
public DecoderImpl(String codingSymbols) throws IllegalArgumentException { if (codingSymbols == null || codingSymbols.isEmpty()) { throw new IllegalArgumentException("The argument cannot be empty or null."); } root = new GroupTreeNode("root"); for (int i = 0; i < codingSymbols.length(); i++) { encodingArray.add(codingSymbols.charAt(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Encoder() {}", "public CharsetDecoder newDecoder() { \n throw new Error(\"Decoder is not implemented for Symbol Charset\");\n }", "public static JSONDecoder getDecoder() throws CharonException {\n return decoder;\n }", "public static BinaryMessageDecoder<DeviceInfo> getDecoder() {...
[ "0.6688514", "0.6656839", "0.6531983", "0.649139", "0.64752084", "0.6408333", "0.63702255", "0.6347574", "0.62983155", "0.6292362", "0.6260897", "0.62425584", "0.62183756", "0.6210097", "0.6209302", "0.6207627", "0.6195749", "0.6186792", "0.61848104", "0.61760825", "0.6162647...
0.5454525
95
This method that takes a symbol and its code as a character and string respectively. This method should add this code to the coding tree.
@Override public void addCode(char symbol, String code) throws IllegalStateException { if (symbol == '\0' || code == null || code.equals("")) { throw new IllegalStateException("the code or symbol cannot be null or empty."); } for (int i = 0; i < code.length(); i++) { if (!encodingArray.contains(code.charAt(i))) { throw new IllegalStateException("the code contains illegal entry."); } } allCode = allCode + symbol + ":" + code + "\n"; for (String sym : symbolDictonary.keySet()) { String indir = symbolDictonary.get(sym); String a = indir.length() > code.length() ? indir : code; String b = indir.length() <= code.length() ? indir : code; if (b.equals(a.substring(0, b.length()))) { throw new IllegalStateException("prefix code detected!"); } } if (!symbolDictonary.keySet().contains(symbol + "")) { root = root.addChild(symbol + "", code); } else { throw new IllegalStateException("trying to insert duplicate symbol."); } symbolDictonary.put(symbol + "", code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void addCode(char symbol, String code) throws IllegalStateException {\r\n if (code == null || code.length() == 0 || symbol == '\\u0000') {\r\n throw new IllegalStateException();\r\n }\r\n //if any digit of the code doesn't belong to the symbol set, throw exception\r\n for (ch...
[ "0.7531203", "0.63471186", "0.6246811", "0.62185735", "0.61678624", "0.6145089", "0.61296093", "0.5975215", "0.5966648", "0.5960585", "0.5954025", "0.59033316", "0.59021324", "0.58116096", "0.5810979", "0.57820034", "0.5777342", "0.57546014", "0.57101125", "0.57048017", "0.56...
0.7939501
0
This method takes an encoded message as a string, and generates the decoded message as a string using the coding tree created thus far.
@Override public String decode(String code) throws IllegalStateException { if (code == null || code.equals("")) { throw new IllegalStateException("the code cannot be null or empty."); } Tree iterator = root; decode = ""; for (int i = 0; i < code.length(); i++) { if (!encodingArray.contains(code.charAt(i))) { throw new IllegalStateException("The encoded string contains illegal symbol"); } } code = decoder(code, iterator); if (code.length() != 0) { throw new IllegalStateException("there is some problem with decoding."); } return decode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String decode(String codedMessage) {\n StringBuilder result = new StringBuilder(); //Create a new stringbuilder\n BinaryTree<HuffData> currentTree = huffTree; //Get the Huffman Tree\n for (int i = 0; i < codedMessage.length(); i++) { //Loop through the coded message\n //If th...
[ "0.7423621", "0.71915686", "0.6887375", "0.6800758", "0.669171", "0.66693944", "0.65678304", "0.6546618", "0.6514961", "0.64868486", "0.6300313", "0.61951035", "0.6140465", "0.60943425", "0.6028436", "0.5974335", "0.59544444", "0.5910839", "0.5908613", "0.5905253", "0.5874654...
0.63374287
10
This method will return the codes entered thus far as a string. This string contains each symbol x and its code yyy on a separate line, in the form x:yyy.
@Override public String allCodes() { return allCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getCode();", "java.lang.String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "public static void printAllPossibleCodes(String input) {\n\n String[] str=helper(input);\n for (int i=0;i<str.length;i++...
[ "0.625114", "0.625114", "0.6154706", "0.6154706", "0.6154706", "0.6154706", "0.6154706", "0.60623014", "0.60539305", "0.6040618", "0.5965657", "0.5961272", "0.59080017", "0.5888632", "0.5880269", "0.5857022", "0.58408713", "0.5800348", "0.5785455", "0.5740421", "0.5731602", ...
0.5954711
12
A isCodeComplete method that yields true if the code entered so far is complete, false otherwise. A code is said to be complete if every valid encoded message can be successfully decoded. If the decoding is done by using a coding tree, then this condition is fulfilled if the coding tree is full.
@Override public boolean isCodeComplete() { Tree iterator = root; return iterator.isCodeComplete(encodingArray.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isCodeComplete(int size);", "public synchronized boolean isComplete() throws MessagingException {\n/* 366 */ parse();\n/* 367 */ return this.complete;\n/* */ }", "public boolean isComplete(){\r\n\r\n\t\t// TODO\r\n\t\t\r\n\t\tif(!isValid()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\...
[ "0.69145924", "0.6266072", "0.6086989", "0.5962248", "0.58623326", "0.58393383", "0.58393383", "0.58393383", "0.58141637", "0.580328", "0.5800229", "0.5762301", "0.574701", "0.57390136", "0.57301646", "0.57208085", "0.57208085", "0.56410635", "0.5635762", "0.5596804", "0.5588...
0.79858166
0
This method does operations on the coded message that was passed.
private String decoder(String code, Tree iterator) { for (int i = 0; i < code.length(); i++) { String decodedChar = iterator.decode(code.substring(0, i + 1)); if (decodedChar != null) { decode = decode + decodedChar; code = code.substring(i + 1); i = -1; } } return code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo80456b(Message message);", "@Override\n\tpublic void processMessage(byte[] message) {\n\t}", "void mo80453a(Message message);", "public void setCodedMessage(String codedMessage, int key){ \r\n this.codedMessage = codedMessage;\r\n this.key = key;\r\n decode();\r\n }", "@Overr...
[ "0.6846696", "0.6844189", "0.67433745", "0.6733647", "0.6703", "0.650621", "0.649149", "0.64561844", "0.6229895", "0.62235683", "0.6197756", "0.6102322", "0.610024", "0.6070839", "0.60600543", "0.60591114", "0.6038531", "0.60177565", "0.5987084", "0.5984616", "0.59787434", ...
0.0
-1
Constructs a new absorber with given parameters
public Absorber(String name, int x, int y, int width, int height) { this.name = name; this.boundingBoxPosition = new Vect(x,y); this.width = width; this.height = height; this.storedBalls = new LinkedList<Ball>(); //initially has no stored ball this.storePosition = new Vect(boundingBoxPosition.x()+this.width-.25,boundingBoxPosition.y()+this.height-.25); //construct bounding lines LineSegment top = new LineSegment(x,y,x+width,y); LineSegment left = new LineSegment(x,y,x,y+height); LineSegment right = new LineSegment(x+width,y,x+width,y+height); LineSegment bottom = new LineSegment(x,y+height,x+width,y+height); this.boundaries = new ArrayList<LineSegment>(Arrays.asList(left,right,top,bottom)); instanceUID = NetworkProtocol.getUID(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void construct();", "@FunctionalInterface\n private interface AbilityConstructor<A extends Ability> {\n /**\n * Creates a new ability instance from the given values.\n */\n A create(\n String name,\n AbilityType abilityType,\n int level,\n int manaCos...
[ "0.5919533", "0.55084807", "0.54893005", "0.5425193", "0.5402484", "0.54019713", "0.54005486", "0.5376495", "0.536501", "0.5354561", "0.5340217", "0.530855", "0.53051317", "0.53038955", "0.5300465", "0.5297824", "0.52570295", "0.5253578", "0.5243699", "0.52068835", "0.5184069...
0.51460785
27
States true iff ball is inside this absorber.
private boolean contains(Ball ball) { checkRep(); boolean contains = ball.getPosition().x() > this.boundingBoxPosition.x() && ball.getPosition().x() < this.boundingBoxPosition.x() + this.width && ball.getPosition().y() > this.boundingBoxPosition.y() && ball.getPosition().y() < this.boundingBoxPosition.y() + this.height; return contains; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isAround(Ball ball)\n {\n int delta = 10;\n Rectangle2D rectangle = new Rectangle2D.Double(mPosition.getX() - delta, mPosition.getY() - delta, 2 * delta, 2 * delta);\n \n return rectangle.contains(ball.getPosition());\n }", "private boolean isBallInside(Ball ball) {...
[ "0.7656233", "0.7596846", "0.69698673", "0.68511593", "0.6668596", "0.6551473", "0.6427647", "0.6392834", "0.6376878", "0.63538784", "0.63211143", "0.62796545", "0.6274054", "0.6260834", "0.6239382", "0.6212725", "0.6195139", "0.6182754", "0.6178899", "0.61765087", "0.6173412...
0.71997476
2
Jump forward to collision (progressing ball to position of collision is unnecessary) Collide
@Override public void progressAndCollide(double amountOfTime, Ball ball) { checkRep(); ball.setPosition(storePosition); //store ball ball.setActive(false); ball.setVelocity(new Vect(0,0)); storedBalls.add(ball); checkRep(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void handleJumping(){\r\n\r\n if ( !collide) {\r\n speedY += 1;\r\n if ((centerY + speedY >= 630 || collide )) {\r\n centerY = 630;\r\n speedY = 0;\r\n jumped = false;\r\n }\r\n }\r\n }", "@Override\n protect...
[ "0.6962695", "0.69498223", "0.69094384", "0.6873783", "0.6622791", "0.659478", "0.6568205", "0.6533344", "0.6507711", "0.6489583", "0.6473783", "0.64696234", "0.64540964", "0.64114064", "0.639947", "0.6375723", "0.636651", "0.6361921", "0.6340514", "0.63364017", "0.6320525", ...
0.59641004
64
Activates and releases one stored ball, if one exists.
@Override public void doAction() { checkRep(); if (!storedBalls.isEmpty()) { Ball ballToShootOut = storedBalls.remove(); ballToShootOut.setVelocity(new Vect(0,STOREDBALLVELOCITY)); ballToShootOut.setActive(true); } checkRep(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void makeActive(){\n active = true;\n \n // loads in asset and turns it into bitmaps\n ballBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.ball);\n ballBitmap = Bitmap.createScaledBitmap(ballBitmap,\n bitmapDimensions.width, bitmapD...
[ "0.6556509", "0.6318144", "0.58395493", "0.575108", "0.5711803", "0.5708205", "0.5627052", "0.55340564", "0.5483266", "0.5382168", "0.5373987", "0.53469706", "0.5288874", "0.5270863", "0.52679265", "0.5195632", "0.5163476", "0.5152117", "0.5136726", "0.5114105", "0.50778055",...
0.57018864
6
Checks the rep invariant. Rep invariant absorber is within board and is not larger than board.
private void checkRep() { assert (width <= Board.SIDELENGTH); assert (height <= Board.SIDELENGTH); assert (this.boundingBoxPosition.x() >= 0 && this.boundingBoxPosition.x() <= Board.SIDELENGTH); assert (this.boundingBoxPosition.y() >= 0 && this.boundingBoxPosition.y() <= Board.SIDELENGTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkRep() {\n assert(wall.p1().x() >= BOARD_MIN_BOUND && wall.p1().x() <= BOARD_MAX_BOUND) :\n \"x coordinate of p1 must be within in the board\";\n assert(wall.p2().x() >= BOARD_MIN_BOUND && wall.p2().x() <= BOARD_MAX_BOUND) :\n \"x coordinate of p2 must be with...
[ "0.75021595", "0.72608393", "0.6706713", "0.65167", "0.649796", "0.63523376", "0.610953", "0.60705894", "0.59963685", "0.59270555", "0.5892729", "0.58871394", "0.5886428", "0.5883486", "0.58800435", "0.58785254", "0.58775115", "0.58736354", "0.5861088", "0.58574474", "0.58503...
0.74648505
1
Represents information for a model
@Data public class <XXX>ModelInfo extends AbstractModelInfo { private <Field1DataType> <Field1>; /** * @return an corresponding {@link <XXX>Transformer} for this model info */ @Override public Transformer getTransformer() { return new <XXX>Transformer(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ModelInfo generateInfo() { \n ModelInfo info = new ModelInfo();\n \n // Store basic info\n info.author = Author;\n info.citation = Citation;\n info.description = Description;\n info.property = Property;\n info.training = Model.TrainingStats.NumberTeste...
[ "0.7153399", "0.68251973", "0.6345661", "0.63011813", "0.624892", "0.622074", "0.61609346", "0.6160883", "0.6140776", "0.61277694", "0.6109582", "0.6109582", "0.6109582", "0.6106085", "0.6084677", "0.60811836", "0.60784876", "0.6053448", "0.60227036", "0.6019776", "0.60143673...
0.5885187
27
This function runs the seond MR job of performing the joins and predicting the flights
public static void predictionJob(Configuration conf, String input,String src, String dest, String[] args)throws IOException, InterruptedException, ClassNotFoundException{ Job j = Job.getInstance(conf,"Prediction Job"); j.setJarByClass(FlightPrediction.class); j.setMapperClass(FlightPrediction.FlightPredictionMapper.class); j.setMapOutputKeyClass(Text.class); j.setMapOutputValueClass(LongWritable.class); j.setReducerClass(FlightPrediction.FlightPredictionMapper.FlightPredictionReducer.class); j.setOutputKeyClass(Text.class); j.setOutputValueClass(LongWritable.class); j.setInputFormatClass(NonSplitableTextInputFormat.class); j.getConfiguration().set("input",input); FileInputFormat.addInputPath(j, new Path(args[1]+"/phase1output")); FileOutputFormat.setOutputPath(j, new Path(args[1]+"/finalOutput/"+src+"-"+dest)); j.waitForCompletion(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static List<Pair> runFlightMapReduce(String[] passengerData) {\n\n logger.debug(\"Mapping flights\");\n Mapper flightMapper = new FlightMapper();\n List<Pair> mappedFlights = flightMapper.execute(passengerData);\n\n logger.debug(\"Shuffling flights\");\n Shuffler flightSh...
[ "0.6357745", "0.6118017", "0.56892776", "0.5672121", "0.5492945", "0.5489461", "0.54805404", "0.54108626", "0.53905314", "0.53850776", "0.5357093", "0.53451604", "0.53252685", "0.53028846", "0.52969277", "0.5294647", "0.52593106", "0.5256151", "0.52354795", "0.5233395", "0.52...
0.0
-1
This function performs the first MR job of finding all single hop routes for the year of prediction ie for all years before the prediction is to be made.
public static void singleHopJob(Configuration conf, String year,String[] args) throws IOException, InterruptedException, ClassNotFoundException{ Job j = Job.getInstance(conf,"Single Hops"); j.setJarByClass(SingleHopFlights.class); j.setMapperClass(SingleHopFlights.SingleHopFlightsMapper.class); j.setPartitionerClass(SingleHopFlights.FlightsPartitioner.class); j.setMapOutputKeyClass(Text.class); j.setMapOutputValueClass(DelayWritable.class); j.setReducerClass(SingleHopFlights.SingleHopFlightsReducer.class); j.setOutputKeyClass(Text.class); j.setOutputValueClass(DoubleWritable.class); j.setInputFormatClass(NonSplitableTextInputFormat.class); j.getConfiguration().set("year",year); j.getConfiguration().set("mapreduce.output.textoutputformat.separator", ","); j.setNumReduceTasks(12); FileInputFormat.addInputPath(j, new Path(args[0])); FileOutputFormat.setOutputPath(j, new Path(args[1]+"/phase1output")); j.waitForCompletion(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void suggestTourPlan(Tour alternativeRoute) throws JSONException, ParseException {\n String tourId = alternativeRoute.getTourName(); //get this from session\n Tour tourDetails = new TourDAOs().getTour(alternativeRoute.getTourName());\n System.out.println(\"Tour Details :\" + tourDetails...
[ "0.50533366", "0.50251514", "0.50009435", "0.49416566", "0.48634946", "0.4793808", "0.47917327", "0.47325245", "0.47315595", "0.47089002", "0.47044808", "0.46986586", "0.46955878", "0.46822727", "0.46491542", "0.46334547", "0.4633313", "0.46234852", "0.4618302", "0.46163622", ...
0.45606428
22
Retrieves the attribute specified by given id
@GetMapping("/{id}") AttributeDto fetchAttributeById(@PathVariable String id) { log.info("Fetch Attribute[id: {}]", id); return attributeService.fetchAttributeById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAttributeValue(int id) {\n Attribute attr = super.findById(id, false);\n if (attr != null ) {\n return attr.getValue();\n } else {\n return \"unknown attribute\";\n }\n }", "public Attribute fetchAttributeById(int attribId);", "Object getAtt...
[ "0.815968", "0.7797517", "0.73237765", "0.7058408", "0.70065176", "0.69976157", "0.69976157", "0.69976157", "0.68256056", "0.67845094", "0.67845094", "0.6766813", "0.6733389", "0.6722323", "0.66775584", "0.6666417", "0.66304696", "0.66191876", "0.6612795", "0.6442603", "0.643...
0.74330586
2
Inserts a new attribute in case given attributeDto does not provide an id Updates an existing attribute in case given attributeDto provides an id
@PostMapping(consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) ResponseEntity saveAttribute(@RequestBody AttributeDto attributeDto) { log.info("Save Attribute[{}]", attributeDto.toString()); attributeService.save(attributeDto); return new ResponseEntity<>(HttpStatus.CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addAttribute(String attrName, Attribute<?> newAttr);", "void updateAttribute(final AuthValues authToken, final UUID garId, final Attribute attribute) throws WorkflowException;", "@PostMapping(\"/addAttribute\")\n public String addAttribute(String uid, String attribute, String value)\n { \n St...
[ "0.6116672", "0.5910068", "0.5840467", "0.58129025", "0.5797356", "0.5738345", "0.5595903", "0.5554608", "0.54521817", "0.54447144", "0.5441734", "0.54342866", "0.54333425", "0.54139096", "0.54089177", "0.54055953", "0.53665745", "0.5362963", "0.53567696", "0.53567696", "0.53...
0.6823211
0
/ Deletes the attribute specified by the given id
@DeleteMapping("/{id}") ResponseEntity deleteAttribute(@PathVariable String id) { log.info("Delete Attribute with id [{}]", id); attributeService.deleteAttribute(id); return new ResponseEntity<>(HttpStatus.NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void delete(Long attributeId) throws TalentStudioException;", "@DeleteMapping(\"/attractions/{id}\")\n @Timed\n public ResponseEntity<Void> deleteAttraction(@PathVariable Long id) {\n log.debug(\"REST request to delete Attraction : {}\", id);\n\n attractionRepository.deleteById(id);\n ...
[ "0.8270676", "0.7722778", "0.7315365", "0.719708", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71883655", "0.71287537", "0.71287537", "0.71287537", "0.71287537", "0.71287537", "0.70861965", "...
0.82910496
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.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { play_pause = new javax.swing.JToggleButton(); anterior = new javax.swing.JButton(); siguiente = new javax.swing.JButton(); Fondo = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setSize(new java.awt.Dimension(280, 300)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); play_pause.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/play.png"))); // NOI18N play_pause.setContentAreaFilled(false); play_pause.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/play.png"))); // NOI18N play_pause.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/pause.png"))); // NOI18N play_pause.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { play_pauseActionPerformed(evt); } }); getContentPane().add(play_pause, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 220, 80, 70)); anterior.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/anterior.png"))); // NOI18N anterior.setContentAreaFilled(false); anterior.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/anterior2.png"))); // NOI18N anterior.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { anteriorActionPerformed(evt); } }); getContentPane().add(anterior, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 220, 88, 70)); siguiente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/siguiente.png"))); // NOI18N siguiente.setContentAreaFilled(false); siguiente.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/siguiente2.png"))); // NOI18N siguiente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { siguienteActionPerformed(evt); } }); getContentPane().add(siguiente, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 220, 80, 69)); Fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Accesorios/reproductor 6.jpg"))); // NOI18N getContentPane().add(Fondo, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 280, 300)); 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.73185146", "0.7290127", "0.7290127", "0.7290127", "0.7285798", "0.7247533", "0.7214021", "0.720785", "0.71952385", "0.71891224", "0.7184117", "0.7158779", "0.7147133", "0.70921415", "0.70792264", "0.7055538", "0.6986984", "0.6976409", "0.6955238", "0.69525516", "0.69452786...
0.0
-1
/ Set the Nimbus look and feel / If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. For details see
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Musica().setVisible(true); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setLookAndFeel() {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n ...
[ "0.7949643", "0.7767799", "0.77002686", "0.7505234", "0.72879374", "0.7227305", "0.7224322", "0.7218896", "0.71813357", "0.7155084", "0.7119508", "0.7112593", "0.70994085", "0.70618683", "0.705027", "0.69137263", "0.68172556", "0.67057467", "0.66947204", "0.6585162", "0.65746...
0.5583949
58
End of variables declaration//GENEND:variables
private void setIcon() { setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/Icons/logo musica.png"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n pu...
[ "0.6359434", "0.6280371", "0.61868024", "0.6094568", "0.60925734", "0.6071678", "0.6052686", "0.60522056", "0.6003249", "0.59887564", "0.59705925", "0.59680873", "0.5967989", "0.5965816", "0.5962006", "0.5942372", "0.5909877", "0.5896588", "0.5891321", "0.5882983", "0.5881482...
0.0
-1
Calculate hash of the given data using the algorithm name.
public byte[] hash( final String algorithm, final byte[] data) throws HashException { try { final MessageDigest md = MessageDigest.getInstance(algorithm); final byte[] hash = md.digest(data); return hash; } catch (final NoSuchAlgorithmException problem) { final Throwable unknownAlgorithm = new UnknownMessageDigestAlgorithmException(algorithm, problem); final HashException hashProblem = new HashException(unknownAlgorithm); throw hashProblem; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getHashAlgorithm();", "@Override\n public int getHash(String name) {\n int x = 0;\n int sum = 0;\n while (x < name.length()) {\n sum += name.charAt(x);\n x++;\n }\n int result = sum % size;\n return result;\n }", "private static byte[...
[ "0.7251609", "0.6887024", "0.6719323", "0.6651926", "0.6626788", "0.6589425", "0.64582855", "0.6449961", "0.63106304", "0.63106304", "0.62591094", "0.6256029", "0.6253615", "0.6193251", "0.6192733", "0.61258405", "0.61103225", "0.60997486", "0.60713243", "0.6062931", "0.60143...
0.74604714
0
An interface that give access to all API methods.
public interface EasyDonateSDK { String API_ENDPOINT = "https://easydonate.ru/api/v1/shop/"; ObjectMapper OBJECT_MAPPER = new ObjectMapper(); DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); /** * Create new SDK instance using your shop key. * @param accessKey - shop key that hidden by default. * @return Created SDK instance ready to use. */ static EasyDonateSDK create(String accessKey) { return new EasyDonateSDKImpl(accessKey); } /** * Query available information about your shop. * @return The {@link ShopModel} object that contains all information about the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see ShopModel */ ShopModel getShopInfo() throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available products in your shop. * @return List of {@link ProductModel} objects that represents products in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see ProductModel */ List<ProductModel> getProductsList() throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available information about this product. * @param productId - ID of product information about which you want to get. * @return The {@link ProductModel} object that represents a product in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see ProductModel */ ProductModel getProductInfo(int productId) throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available servers which added in your shop. * @return List of {@link ServerModel} objects that represents servers which added in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see ServerModel */ List<ServerModel> getServersList() throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available information about this added server. * @param serverId - ID of server information about which you want to get. * @return The {@link ServerModel} object that represents an added server in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see ServerModel */ ServerModel getServerInfo(int serverId) throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available completed payments in your shop. * @return List of {@link PaymentModel} objects that represents completed payments in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see PaymentModel */ List<PaymentModel> getPaymentsList() throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Query available information about this payment. * * @param paymentId - ID of payment information about which you want to get. * @return The {@link PaymentModel} object that represents a pending or completed payment in the remote shop. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see PaymentModel */ PaymentModel getPaymentInfo(int paymentId) throws BadResponseException, ErrorResponseException, FailedRequestException; /** * Create new pending payment depending on your {@link PreparedPaymentData}. * <br> * You can use {@link PaymentCreator} as chain-builder to create new payment data. * * @param paymentData - any customizable data to prepare payment. * @return The URL link to created pending payment. * * @throws BadResponseException if EasyDonate API server sent invalid or API error response. * @throws ErrorResponseException if this request is not successfull. * @throws FailedRequestException if this request has been failed due any internal reason. * * @see PreparedPaymentData * @see PaymentCreator */ String createPayment(PreparedPaymentData paymentData) throws BadResponseException, ErrorResponseException, FailedRequestException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ApiMethod\n{\n\tpublic void func(ApiContext ac) throws JSONException, LibException;\n}", "public interface ApiAction {}", "public interface RestApi {\n}", "public interface ApiService {\n\n\n}", "public interface APIService {\n}", "public interface RequestAPI {\n public void signIn(St...
[ "0.79833704", "0.735593", "0.7348207", "0.73290336", "0.7294869", "0.72518635", "0.7250985", "0.7216035", "0.71284425", "0.7125594", "0.70204663", "0.7019617", "0.6998513", "0.69934064", "0.6975988", "0.69353086", "0.69329894", "0.69192785", "0.6900873", "0.68942314", "0.6893...
0.0
-1
Create new SDK instance using your shop key.
static EasyDonateSDK create(String accessKey) { return new EasyDonateSDKImpl(accessKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeHERESDK() {\n String accessKeyID = \"YOUR_ACCESS_KEY_ID\";\n String accessKeySecret = \"YOUR_ACCESS_KEY_SECRET\";\n SDKOptions options = new SDKOptions(accessKeyID, accessKeySecret);\n try {\n Context context = getApplicationContext();\n SDKN...
[ "0.5710801", "0.541506", "0.52943707", "0.52737606", "0.52697635", "0.5204277", "0.5179281", "0.5057172", "0.5035402", "0.50352466", "0.5030372", "0.5023796", "0.5020041", "0.4998196", "0.49872166", "0.49644235", "0.4951998", "0.49416173", "0.49327415", "0.48835757", "0.48818...
0.58439493
0
This test asserts that white space between tokens is not allowed.
private void testAclConstraints001() { try { DefaultTestBundleControl.log("#testAclConstraints001"); new org.osgi.service.dmt.Acl("Add=test&Exec=test &Get=*"); DefaultTestBundleControl.failException("",IllegalArgumentException.class); } catch (IllegalArgumentException e) { DefaultTestBundleControl.pass("White space between tokens of a Acl is not allowed."); } catch (Exception e) { tbc.failExpectedOtherException(IllegalArgumentException.class, e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testWhitespace() throws TokenizerException {\n assertTokenizes(\" \", new Token[0]);\n }", "private void unconsumedTokensShouldBe(String expectedTokens) {\n Token expectedToken;\n Token actualToken;\n \n Tokenizer unconsumedTokens = parser.getTokenizer...
[ "0.75598943", "0.68659973", "0.6864408", "0.67698175", "0.67000073", "0.66986305", "0.66062087", "0.6568233", "0.6530523", "0.651594", "0.6396663", "0.6380147", "0.6366737", "0.6344693", "0.63422334", "0.6274755", "0.62480783", "0.624467", "0.6212108", "0.6205765", "0.6098782...
0.0
-1
This test asserts that if the root node ACL is not explicitly set, it should be set to Add=&Get=&Replace=.
private void testAclConstraints002() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints002"); session = tbc.getDmtAdmin().getSession(".",DmtSession.LOCK_TYPE_EXCLUSIVE); String expectedRootAcl = "Add=*&Get=*&Replace=*"; String rootAcl = session.getNodeAcl(".").toString(); TestCase.assertEquals("This test asserts that if the root node ACL is not explicitly set, it should be set to Add=*&Get=*&Replace=*.",expectedRootAcl,rootAcl); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.closeSession(session); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints004() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints004\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\",DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tString expectedRootAcl = \"Add=*&Exec=*&Replace=*\";\n\t\t\tsession.setNodeA...
[ "0.7508182", "0.7493802", "0.73583186", "0.73369515", "0.7053985", "0.69929254", "0.6782052", "0.67475194", "0.6635225", "0.6548661", "0.6532366", "0.6525875", "0.65102804", "0.6383946", "0.6305144", "0.61043715", "0.6018849", "0.59560454", "0.5946636", "0.5891085", "0.586396...
0.7774921
0
This test asserts that the root node of DMT must always have an ACL associated with it
private void testAclConstraints003() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints003"); session = tbc.getDmtAdmin().getSession(".",DmtSession.LOCK_TYPE_EXCLUSIVE); session.setNodeAcl(".",null); DefaultTestBundleControl.failException("",DmtException.class); } catch (DmtException e) { TestCase.assertEquals("Asserts that the root node of DMT must always have an ACL associated with it", DmtException.COMMAND_NOT_ALLOWED,e.getCode()); } catch (Exception e) { tbc.failExpectedOtherException(DmtException.class, e); } finally { try { session.setNodeAcl(".",new org.osgi.service.dmt.Acl("Add=*&Get=*&Replace=*")); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.closeSession(session); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints004() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints004\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\",DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tString expectedRootAcl = \"Add=*&Exec=*&Replace=*\";\n\t\t\tsession.setNodeA...
[ "0.7515603", "0.7484275", "0.7367889", "0.7034199", "0.7029181", "0.7024939", "0.69816715", "0.6837192", "0.6687649", "0.6554607", "0.6551259", "0.6296836", "0.61551833", "0.6058838", "0.6029021", "0.5970061", "0.5897659", "0.58604217", "0.58307934", "0.57627624", "0.5744843"...
0.76821923
0
This test asserts that the root's ACL can be changed
private void testAclConstraints004() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints004"); session = tbc.getDmtAdmin().getSession(".",DmtSession.LOCK_TYPE_EXCLUSIVE); String expectedRootAcl = "Add=*&Exec=*&Replace=*"; session.setNodeAcl(".",new org.osgi.service.dmt.Acl(expectedRootAcl)); String rootAcl = session.getNodeAcl(".").toString(); TestCase.assertEquals("Asserts that the root's ACL can be changed.",expectedRootAcl,rootAcl); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { try { session.setNodeAcl(".",new org.osgi.service.dmt.Acl("Add=*&Get=*&Replace=*")); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.closeSession(session); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints002() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints002\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\",DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tString expectedRootAcl = \"Add=*&Get=*&Replace=*\";\n\t\t\tString rootAcl = ...
[ "0.75040936", "0.7468248", "0.73721224", "0.72614384", "0.7197457", "0.71575785", "0.69812995", "0.6979373", "0.68095046", "0.67735976", "0.6606843", "0.64291495", "0.63679236", "0.6311404", "0.62148196", "0.61974365", "0.614388", "0.6105695", "0.60681176", "0.59739953", "0.5...
0.7519693
0
The Dmt Admin service synchronizes the ACLs with any change in the DMT that is made through its service interface. This test case we test if the deleteNode method deletes also the ACL of that node.
private void testAclConstraints005() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints005"); session = tbc.getDmtAdmin().getSession(".", DmtSession.LOCK_TYPE_EXCLUSIVE); session.setNodeAcl(TestExecPluginActivator.INTERIOR_NODE, new org.osgi.service.dmt.Acl("Replace=*")); session.deleteNode(TestExecPluginActivator.INTERIOR_NODE); TestCase.assertNull("This test asserts that the Dmt Admin service synchronizes the ACLs with any change " + "in the DMT that is made through its service interface", session.getNodeAcl(TestExecPluginActivator.INTERIOR_NODE)); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.closeSession(session); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testAdminDelete() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"temp\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"...
[ "0.6414825", "0.64025414", "0.63913465", "0.63124496", "0.6279692", "0.61970794", "0.6020847", "0.6009786", "0.6000211", "0.58547574", "0.5698937", "0.5666951", "0.5564767", "0.5560759", "0.55547917", "0.55304426", "0.5508554", "0.547999", "0.5465355", "0.5458905", "0.5451193...
0.6479448
0
This test case we test if the rename method renames also the ACL of that node.
private void testAclConstraints006() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints006"); session = tbc.getDmtAdmin().getSession(".", DmtSession.LOCK_TYPE_EXCLUSIVE); String expectedRootAcl = "Add=*"; session.setNodeAcl(TestExecPluginActivator.INTERIOR_NODE, new org.osgi.service.dmt.Acl(expectedRootAcl)); session.renameNode(TestExecPluginActivator.INTERIOR_NODE,TestExecPluginActivator.RENAMED_NODE_NAME); TestExecPlugin.setAllUriIsExistent(true); TestCase.assertNull("Asserts that the method rename deletes the ACL of the source.",session.getNodeAcl(TestExecPluginActivator.INTERIOR_NODE)); TestCase.assertEquals("Asserts that the method rename moves the ACL from the source to the destiny.", expectedRootAcl,session.getNodeAcl(TestExecPluginActivator.RENAMED_NODE).toString()); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.cleanUp(session,TestExecPluginActivator.RENAMED_NODE); TestExecPlugin.setAllUriIsExistent(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameFileToSelf() throws Throwable {\n if (!renameSupported()) return;\n Path filepath = path(\"test/file\");\n createFile(filepath);\n //HDFS expects rename src, src -> true\n rename(filepath, filepath, true, true, true);\n //verify the fil...
[ "0.69220406", "0.6816331", "0.66497177", "0.6481904", "0.637152", "0.6342403", "0.6324046", "0.6307628", "0.6284525", "0.6266066", "0.6219724", "0.6212301", "0.61224043", "0.6047974", "0.6042698", "0.6016265", "0.6005436", "0.59932935", "0.5959943", "0.59417903", "0.5936572",...
0.6826607
1
This test asserts that if a principal has Replace access to a node, the principal is permitted to change the ACL of all its child nodes, regardless of the ACLs that are set on the child nodes.
private void testAclConstraints007() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints007"); tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.LEAF_NODE, DmtConstants.PRINCIPAL_2, Acl.GET ); tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.INTERIOR_NODE, DmtConstants.PRINCIPAL, Acl.REPLACE ); tbc.setPermissions(new PermissionInfo(DmtPrincipalPermission.class.getName(),DmtConstants.PRINCIPAL,"*")); session = tbc.getDmtAdmin().getSession(DmtConstants.PRINCIPAL,TestExecPluginActivator.ROOT,DmtSession.LOCK_TYPE_EXCLUSIVE); session.setNodeAcl(TestExecPluginActivator.LEAF_NODE,new org.osgi.service.dmt.Acl("Get=*")); DefaultTestBundleControl.pass("If a principal has Replace access to a node, the principal is permitted to change the ACL of all its child nodes"); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.cleanUp(session,TestExecPluginActivator.LEAF_NODE); tbc.cleanAcl(TestExecPluginActivator.INTERIOR_NODE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints008() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints008\");\n //We need to set that a parent of the node does not have Replace else the acl of the root \".\" is gotten\n tbc.openSessionAndSetNodeAcl(TestExe...
[ "0.730522", "0.71427304", "0.6920541", "0.67065096", "0.66941065", "0.6599633", "0.65410334", "0.6397618", "0.63863695", "0.6044008", "0.58521795", "0.5791755", "0.5740762", "0.57358724", "0.57175815", "0.56700224", "0.5661808", "0.56575215", "0.5647662", "0.5630437", "0.5625...
0.77280277
0
This test asserts that Replace access on a leaf node does not allow changing the ACL property itself.
private void testAclConstraints008() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints008"); //We need to set that a parent of the node does not have Replace else the acl of the root "." is gotten tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.INTERIOR_NODE, DmtConstants.PRINCIPAL, Acl.DELETE ); tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.LEAF_NODE, DmtConstants.PRINCIPAL, Acl.REPLACE ); tbc.setPermissions(new PermissionInfo(DmtPrincipalPermission.class.getName(),DmtConstants.PRINCIPAL,"*")); session = tbc.getDmtAdmin().getSession(DmtConstants.PRINCIPAL,TestExecPluginActivator.LEAF_NODE,DmtSession.LOCK_TYPE_EXCLUSIVE); session.setNodeAcl(TestExecPluginActivator.LEAF_NODE,new org.osgi.service.dmt.Acl("Get=*")); DefaultTestBundleControl.failException("",DmtException.class); } catch (DmtException e) { TestCase.assertEquals("Asserts that Replace access on a leaf node does not allow changing the ACL property itself.", DmtException.PERMISSION_DENIED,e.getCode()); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.cleanUp(session,TestExecPluginActivator.LEAF_NODE); tbc.cleanAcl(TestExecPluginActivator.INTERIOR_NODE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints007() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints007\");\n tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.LEAF_NODE, DmtConstants.PRINCIPAL_2, Acl.GET );\n tbc.openSessionAndSetNodeAcl(TestExecPlug...
[ "0.70464045", "0.6709405", "0.6486107", "0.6479976", "0.64370865", "0.6386434", "0.63451767", "0.6290928", "0.62301326", "0.5844368", "0.57613367", "0.57399225", "0.57019365", "0.5654255", "0.5580932", "0.5573279", "0.54433215", "0.54355025", "0.54346216", "0.5431869", "0.542...
0.74863374
0
Asserts that ACLs must only be verified by the Dmt Admin service when the session has an associated principal.
private void testAclConstraints009() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints009"); session = tbc.getDmtAdmin().getSession(TestExecPluginActivator.ROOT, DmtSession.LOCK_TYPE_EXCLUSIVE); session.setNodeAcl(TestExecPluginActivator.INTERIOR_NODE, new org.osgi.service.dmt.Acl("Replace=*")); session.deleteNode(TestExecPluginActivator.INTERIOR_NODE); DefaultTestBundleControl.pass("ACLs is only verified by the Dmt Admin service when the session has an associated principal."); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.closeSession(session); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints003() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints003\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\",DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tsession.setNodeAcl(\".\",null);\n\t\t\tDefaultTestBundleControl.failExceptio...
[ "0.63214207", "0.6256098", "0.62543607", "0.62028354", "0.61587006", "0.61263245", "0.60581005", "0.58874744", "0.58764166", "0.58529484", "0.5848349", "0.5842278", "0.58258843", "0.58219606", "0.5739382", "0.5725595", "0.5647408", "0.56233096", "0.5611229", "0.56037307", "0....
0.7054666
0
This method asserts that the copy methods does not copy the Acl. It also tests that the copied nodes inherit the access rights from the parent of the destination node.
private void testAclConstraints010() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints010"); tbc.cleanAcl(TestExecPluginActivator.INEXISTENT_NODE); session = tbc.getDmtAdmin().getSession(".", DmtSession.LOCK_TYPE_EXCLUSIVE); Acl aclParent = new Acl(new String[] { DmtConstants.PRINCIPAL },new int[] { Acl.REPLACE }); session.setNodeAcl(TestExecPluginActivator.ROOT, aclParent); session.setNodeAcl(TestExecPluginActivator.INTERIOR_NODE, new Acl(new String[] { DmtConstants.PRINCIPAL }, new int[] { Acl.EXEC })); TestExecPlugin.setAllUriIsExistent(false); session.copy(TestExecPluginActivator.INTERIOR_NODE, TestExecPluginActivator.INEXISTENT_NODE, true); TestExecPlugin.setAllUriIsExistent(true); TestCase.assertTrue("Asserts that the copied nodes inherit the access rights from the parent of the destination node.", aclParent.equals(session.getEffectiveNodeAcl(TestExecPluginActivator.INEXISTENT_NODE))); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.cleanUp(session, TestExecPluginActivator.INTERIOR_NODE); tbc.cleanAcl(TestExecPluginActivator.ROOT); TestExecPlugin.setAllUriIsExistent(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkCopy(IAstNode node, IAstNode copy) {\n \t\tassertEquals(node.getClass(), copy.getClass());\n \t\tassertFalse(node.toString(), node == copy);\n \t\tif (node.getParent() != null)\n \t\t\tassertFalse(node.toString(), node.getParent() == copy.getParent());\n \t\tIAstNode[] kids = node.getChildren();\...
[ "0.73943776", "0.6358635", "0.63113403", "0.6121073", "0.6094803", "0.60617083", "0.5949997", "0.5899495", "0.58614904", "0.5799342", "0.57795197", "0.5743152", "0.5733718", "0.57077956", "0.5694094", "0.5676852", "0.5652672", "0.56382203", "0.562149", "0.5613681", "0.5588442...
0.6902284
1
This method asserts that when copy method is called if the calling principal does not have Replace rights for the parent, the destiny node must be set with an Acl having Add, Delete and Replace permissions
private void testAclConstraints011() { DmtSession session = null; try { DefaultTestBundleControl.log("#testAclConstraints011"); tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.INTERIOR_NODE, DmtConstants.PRINCIPAL, Acl.GET | Acl.ADD ); tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.ROOT, DmtConstants.PRINCIPAL, Acl.ADD ); Acl aclExpected = new Acl(new String[] { DmtConstants.PRINCIPAL },new int[] { Acl.ADD | Acl.DELETE | Acl.REPLACE }); tbc.setPermissions(new PermissionInfo(DmtPrincipalPermission.class .getName(), DmtConstants.PRINCIPAL, "*")); session = tbc.getDmtAdmin().getSession(DmtConstants.PRINCIPAL, ".", DmtSession.LOCK_TYPE_EXCLUSIVE); session.copy(TestExecPluginActivator.INTERIOR_NODE, TestExecPluginActivator.INEXISTENT_NODE, true); TestExecPlugin.setAllUriIsExistent(true); session.close(); session = tbc.getDmtAdmin().getSession(".",DmtSession.LOCK_TYPE_EXCLUSIVE); TestCase.assertTrue("Asserts that if the calling principal does not have Replace rights for the parent, " + "the destiny node must be set with an Acl having Add, Delete and Replace permissions.", aclExpected.equals(session.getNodeAcl(TestExecPluginActivator.INEXISTENT_NODE))); } catch (Exception e) { tbc.failUnexpectedException(e); } finally { tbc.cleanUp(session, TestExecPluginActivator.INTERIOR_NODE); tbc.cleanAcl(TestExecPluginActivator.ROOT); tbc.cleanAcl(TestExecPluginActivator.INEXISTENT_NODE); TestExecPlugin.setAllUriIsExistent(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void testAclConstraints010() {\n DmtSession session = null;\n try {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints010\");\n tbc.cleanAcl(TestExecPluginActivator.INEXISTENT_NODE);\n \n session = tbc.getDmtAdmin().getSession(\".\",\n ...
[ "0.64334255", "0.6353467", "0.6236319", "0.6048091", "0.59213454", "0.5889518", "0.58660483", "0.57184505", "0.55969936", "0.55909336", "0.5561575", "0.5513506", "0.5505495", "0.54610693", "0.5460356", "0.5438406", "0.54004276", "0.53870636", "0.5382343", "0.53816897", "0.531...
0.60977834
3
Asserts that Acl is a public final class
private void testAclConstraints012() { try { int aclModifiers = Acl.class.getModifiers(); TestCase.assertTrue("Asserts that Acl is a public final class", aclModifiers == (Modifier.FINAL | Modifier.PUBLIC)); } catch (Exception e) { tbc.failUnexpectedException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkPublic() {\n }", "public void testClassAnnotation() {\r\n TestHelper.assertClassAnnotation(ConfluenceManagementServiceLocal.class, Local.class);\r\n }", "@Test\n public void finalInnerClassesShouldBecomeNonFinal() throws Exception {\n MockClassLoader mockClassLoader = ne...
[ "0.5999545", "0.5960489", "0.58268976", "0.57945544", "0.55613565", "0.54869574", "0.5463165", "0.5421108", "0.5396801", "0.53512573", "0.53374696", "0.53324187", "0.5320767", "0.5286305", "0.52671117", "0.5262729", "0.52368766", "0.5176025", "0.51758057", "0.51628274", "0.51...
0.74541366
0
Load the preferences from an XML resource
@Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.preferences, rootKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadPreferences() {\n\t\tXSharedPreferences prefApps = new XSharedPreferences(PACKAGE_NAME);\n\t\tprefApps.makeWorldReadable();\n\n\t\tthis.debugMode = prefApps.getBoolean(\"waze_audio_emphasis_debug\", false);\n }", "void loadPreferences() throws OntimizeJEERuntimeException;", "private void lo...
[ "0.6325364", "0.6273263", "0.6254157", "0.62462354", "0.6165279", "0.60642046", "0.60406", "0.6015898", "0.59732085", "0.5951365", "0.58436936", "0.5820871", "0.5778513", "0.57635826", "0.5751787", "0.5713918", "0.5660983", "0.5633989", "0.56185824", "0.56013775", "0.55631536...
0.57963324
12
Konstruktor za unos. Nap. Ukoliko je sa Idom ima moguce dodatne operacije kao sto su: Update ili Delete.
public MySqlKateggorija(Context _cont) { super(_cont); this.cont=_cont; SettingsActivity podesavanja=new SettingsActivity(); notifUkl= podesavanja.jelNotifikacionaPorukaUkljucena(); toasUklj=podesavanja.jelToastPorukaUkljucena(); mNotificationManager = (NotificationManager)cont.getSystemService(Context.NOTIFICATION_SERVICE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "@Override\n\tpublic void delete(Unidade obj) {\n\n\t}", "protected void cmdRemove() throws Exception{\n\t\t//Determinamos los elementos a eliminar. De cada uno sacamos el id y el timestamp\n\t\tVector entities = new Vector();\n\t\tStringTokenizer claves ...
[ "0.59134316", "0.5909479", "0.58403575", "0.5837736", "0.57843333", "0.5777318", "0.57767224", "0.56706285", "0.5624949", "0.5598863", "0.5587501", "0.55759346", "0.552566", "0.5520067", "0.55089146", "0.5470454", "0.5436893", "0.5410455", "0.54049104", "0.54033816", "0.53888...
0.0
-1
Konstruktor sa Idom je ukoliko saljemo u cilju update ili brisanja podatka.
public MySqlKateggorija(Context _cont, int _id) { super(_cont); this.cont=_cont; this.id=_id; SettingsActivity podesavanja=new SettingsActivity(); notifUkl= podesavanja.jelNotifikacionaPorukaUkljucena(); toasUklj=podesavanja.jelToastPorukaUkljucena(); mNotificationManager = (NotificationManager)cont.getSystemService(Context.NOTIFICATION_SERVICE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ustaw(){\n\t driver.initialize(this);\n\t driver.edit(new DodajSerwisDTO());\n\t }", "@Override\n\t\tpublic void update(Metodologia metodologia,String name) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}",...
[ "0.6638491", "0.6547737", "0.6359318", "0.63375646", "0.6311534", "0.6274528", "0.6219933", "0.6194158", "0.61752707", "0.6167415", "0.6134498", "0.60974365", "0.60292614", "0.5986126", "0.5974992", "0.59697425", "0.59318995", "0.59082663", "0.59006494", "0.5888271", "0.58508...
0.0
-1
Vraca listu svih objekata Kateggorija
public List<Kateggorija> getSviGlumci() { List<Kateggorija> glumci=null; try { glumci= getDaoKateggorija().queryForAll(); } catch (SQLException e) { e.printStackTrace(); } return glumci; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Categoria> listarCategorias();", "public List<DVDCategorie> listDVDCategorie();", "private void listadoCategorias() {\r\n sessionProyecto.getCategorias().clear();\r\n sessionProyecto.setCategorias(itemService.buscarPorCatalogo(CatalogoEnum.CATALOGOPROYECTO.getTipo()));\r\n }",...
[ "0.7285044", "0.7203312", "0.6799411", "0.6754172", "0.6750744", "0.6691181", "0.66532177", "0.66455907", "0.6520673", "0.6509077", "0.6483183", "0.64559734", "0.64506304", "0.6442606", "0.6438188", "0.6408607", "0.6355566", "0.634175", "0.6333347", "0.6321049", "0.6319681", ...
0.6460869
11
Trazi vrednost jela po ID zapisu
public Kateggorija getKateggorijaPoId(int _id) { try { return getDaoKateggorija().queryForId(_id); } catch (SQLException e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getId() {\r\n\t\treturn id;\r\n\t}", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.Strin...
[ "0.7557509", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.7496008", "0.74728715", ...
0.0
-1
Vraca listu jela po kategoriji
public List<Kateggorija> getKateggorijaiPioStavkka(Stavkka _stavkka) { List<Kateggorija> glumci=null; try { QueryBuilder upit = getDaoKateggorija().queryBuilder(); Where<Kateggorija,Integer> where=upit.where().idEq(getDaoStavkka(),_stavkka); glumci=where.query(); } catch (SQLException e) { e.printStackTrace(); } return glumci; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<DVDCategorie> listDVDCategorie();", "private void listadoCategorias() {\r\n sessionProyecto.getCategorias().clear();\r\n sessionProyecto.setCategorias(itemService.buscarPorCatalogo(CatalogoEnum.CATALOGOPROYECTO.getTipo()));\r\n }", "public ArrayList<Categoria> listarCategorias();",...
[ "0.7222446", "0.69883305", "0.69331706", "0.6770564", "0.66965336", "0.667427", "0.6665994", "0.6525891", "0.6482431", "0.6441169", "0.64366144", "0.64261127", "0.6394958", "0.63902", "0.6380411", "0.6375033", "0.63539255", "0.6339065", "0.63322276", "0.63253015", "0.62870514...
0.65313387
7
aqui probamos tanto el metodo usarCarta() como haSidoUSada()
public void testUsarCarta(){ assertFalse(c1.haSidoUsada()); c1.usarCarta(); assertTrue(c1.haSidoUsada()); c1.reiniciarCarta(); assertFalse(c1.haSidoUsada()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void usarCartao(String tipoCartao) throws Exception {\n terminarAVez();\n\n if (listaJogadoresNaPrisao.contains(listaJogadores.get(jogadorAtual()).getNome())) {\n this.listaJogadores.get(jogadorAtual()).gastarCartaoSaidaDePrisao(tipoCartao);\n this.processarJogada(2, 1, t...
[ "0.73664623", "0.699528", "0.6954807", "0.6855144", "0.67910117", "0.6778041", "0.6759376", "0.6666159", "0.6616532", "0.6570324", "0.65617687", "0.65216035", "0.64222145", "0.6413477", "0.64026165", "0.63958836", "0.63237", "0.631847", "0.6289", "0.62825066", "0.6268427", ...
0.7532337
0
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (SAXException ex) { throwException(ex); } catch (ParserConfigurationException ex) { throwException(ex); } catch (UnmarshallingException ex) { throwException(ex);; } catch (TransformerException ex) { throwException(ex); } catch (ConfigurationException ex) { throwException(ex); } catch (XMLParserException ex) { throwException(ex); } catch (ValidationException ex) { throwException(ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro...
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234",...
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (SAXException ex) { throwException(ex); } catch (ParserConfigurationException ex) { throwException(ex); } catch (UnmarshallingException ex) { throwException(ex); } catch (TransformerException ex) { throwException(ex); } catch (ConfigurationException ex) { throwException(ex); } catch (XMLParserException ex) { throwException(ex); } catch (ValidationException ex) { throwException(ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n ...
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197"...
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short d...
[ "0.8762916", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.87315136", "0.869834", "0.869834", "0.869834", "0.869834", "0.869834", "0.869834", "0.85301465", "0.85301465", "0.8527069", "0.8527069...
0.0
-1
TODO Autogenerated method stub
@Override public synchronized void unregisterListener(EventListener<T> listener) { listeners.removeElement(listener); }
{ "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
Checks that a string is not null or empty
public static void checkEmptyString(String string, String error) { String errorMessage = "string is null or empty"; if (string == null || string.trim().length() <= 0 || error == null || error.trim().length() <= 0) { throw new IllegalArgumentException(errorMessage); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkForEmptyString(Object value)\n\t{\n\t\tif (value == null || value.toString().isEmpty()) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "static boolean isNullOrEmpty(String string) {\n return string == null || string.isEmpty();\n }", "public static boolean isBlankOrNullString(String s){...
[ "0.7912096", "0.7905152", "0.78441244", "0.7815123", "0.78058094", "0.77757466", "0.7740623", "0.77314603", "0.77188766", "0.7715319", "0.7627391", "0.7620475", "0.76084477", "0.7603124", "0.7589474", "0.75790423", "0.7563785", "0.75419736", "0.75147724", "0.74852526", "0.748...
0.0
-1
/ JADX WARNING: inconsistent code. / Code decompiled incorrectly, please refer to instructions dump.
public boolean equals(java.lang.Object r6) { /* r5 = this; r1 = 1; r2 = 0; if (r5 != r6) goto L_0x0006; L_0x0004: r2 = r1; L_0x0005: return r2; L_0x0006: if (r6 == 0) goto L_0x0005; L_0x0008: r3 = r5.getClass(); r4 = r6.getClass(); if (r3 != r4) goto L_0x0005; L_0x0012: r0 = r6; r0 = (com.twitter.sdk.android.core.internal.scribe.ScribeItem) r0; r3 = r5.itemType; if (r3 == 0) goto L_0x005e; L_0x0019: r3 = r5.itemType; r4 = r0.itemType; r3 = r3.equals(r4); if (r3 == 0) goto L_0x0005; L_0x0023: r3 = r5.id; if (r3 == 0) goto L_0x0063; L_0x0027: r3 = r5.id; r4 = r0.id; r3 = r3.equals(r4); if (r3 == 0) goto L_0x0005; L_0x0031: r3 = r5.description; if (r3 == 0) goto L_0x0068; L_0x0035: r3 = r5.description; r4 = r0.description; r3 = r3.equals(r4); if (r3 == 0) goto L_0x0005; L_0x003f: r3 = r5.cardEvent; if (r3 == 0) goto L_0x006d; L_0x0043: r3 = r5.cardEvent; r4 = r0.cardEvent; r3 = r3.equals(r4); if (r3 == 0) goto L_0x0005; L_0x004d: r3 = r5.mediaDetails; if (r3 == 0) goto L_0x0072; L_0x0051: r3 = r5.mediaDetails; r4 = r0.mediaDetails; r3 = r3.equals(r4); if (r3 != 0) goto L_0x005c; L_0x005b: r1 = r2; L_0x005c: r2 = r1; goto L_0x0005; L_0x005e: r3 = r0.itemType; if (r3 == 0) goto L_0x0023; L_0x0062: goto L_0x0005; L_0x0063: r3 = r0.id; if (r3 == 0) goto L_0x0031; L_0x0067: goto L_0x0005; L_0x0068: r3 = r0.description; if (r3 == 0) goto L_0x003f; L_0x006c: goto L_0x0005; L_0x006d: r3 = r0.cardEvent; if (r3 == 0) goto L_0x004d; L_0x0071: goto L_0x0005; L_0x0072: r3 = r0.mediaDetails; if (r3 != 0) goto L_0x005b; L_0x0076: goto L_0x005c; */ throw new UnsupportedOperationException("Method not decompiled: com.twitter.sdk.android.core.internal.scribe.ScribeItem.equals(java.lang.Object):boolean"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2241() {\r\n // $FF: Couldn't be decompiled\r\n }", "private void method_7083() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_1148() {\r\n // $FF: Couldn't be decompil...
[ "0.7617936", "0.75741047", "0.7527031", "0.745184", "0.7451754", "0.7438811", "0.73831093", "0.73831093", "0.7367915", "0.7354955", "0.73436034", "0.7316427", "0.7309142", "0.73070383", "0.7274693", "0.7253796", "0.72229284", "0.7198688", "0.7178801", "0.7138237", "0.71080256...
0.0
-1
/ VP_Theme() Private constructor. Cannot be instantiated No Parameters.
private VP_Theme() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Theme() {\n\t\tpalette = new HashMap<>();\n\t\tinitDefaultPalette(palette);\n\t}", "public DefaultTheme() {\r\n //sets up alpha values for a nicer look\r\n p1.a = 0.85f;\r\n p2.a = 0.85f;\r\n p3.a = 0.85f;\r\n\r\n s1.a = 0.85f;\r\n s2.a = 0.85f;\r\n ...
[ "0.7750749", "0.6937755", "0.6925567", "0.67099124", "0.66384304", "0.65109336", "0.64389145", "0.64328164", "0.61841536", "0.6171695", "0.615303", "0.6122723", "0.6059791", "0.6057493", "0.6036058", "0.5969478", "0.59422296", "0.5925587", "0.5919767", "0.5904959", "0.5893681...
0.91080254
0
Construct a user with the given values
public User(String name, int studentId, int accessLevel, Connection conn) { this.name = name; this.id = studentId; this.accessLevel = accessLevel; this.conn = conn; initializeCompletedCourses(); initializeStudentRegList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "p...
[ "0.70805776", "0.6748902", "0.65129244", "0.63963526", "0.62605625", "0.6246843", "0.6246504", "0.62048566", "0.6198126", "0.6152982", "0.6117314", "0.6067703", "0.60672444", "0.60579365", "0.60452884", "0.6043313", "0.60421515", "0.60382986", "0.60165685", "0.59699756", "0.5...
0.0
-1
Initialize the completed courses array from the database
private void initializeCompletedCourses() { try { String query = "SELECT * FROM completedregistrations WHERE studentid=?"; PreparedStatement pstmt = conn.prepareStatement(query); pstmt.setInt(1, id); ResultSet rs = pstmt.executeQuery(); completeCourses = new ArrayList<>(); while (rs.next()) { completeCourses.add(new Registration(rs.getInt("studentid"), rs.getInt("courseid"), rs.getInt("secnum"), rs.getString("grade"), conn)); } } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadCourses(final MyCallback2 myCallback) {\n //Reading courses\n mDatabase = FirebaseDatabase.getInstance().getReference().child(\"courses\");\n mDatabase.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNu...
[ "0.66811967", "0.659299", "0.65082103", "0.64454985", "0.62748015", "0.6181997", "0.6165778", "0.6126396", "0.60750216", "0.6027457", "0.6014709", "0.59821904", "0.5931338", "0.5904286", "0.588811", "0.58871657", "0.58810997", "0.58483183", "0.57845765", "0.5774583", "0.57654...
0.8317546
0
Initialize the ongoing courses from the database
private void initializeStudentRegList() { try { String query = "SELECT * FROM ongoingregistrations WHERE studentid=?"; PreparedStatement pstmt = conn.prepareStatement(query); pstmt.setInt(1, id); ResultSet rs = pstmt.executeQuery(); studentRegList = new ArrayList<>(); while (rs.next()) { studentRegList.add(new Registration(rs.getInt("studentid"), rs.getInt("courseid"), rs.getInt("secnum"), rs.getString("grade"), conn)); } } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeCompletedCourses() {\r\n try {\r\n String query = \"SELECT * FROM completedregistrations WHERE studentid=?\";\r\n PreparedStatement pstmt = conn.prepareStatement(query);\r\n pstmt.setInt(1, id);\r\n ResultSet rs = pstmt.executeQuery();\r\n ...
[ "0.76583004", "0.69140077", "0.6768214", "0.67026854", "0.64436936", "0.63918865", "0.6379251", "0.6346592", "0.63233936", "0.62620044", "0.6248574", "0.6239035", "0.61479604", "0.6125201", "0.61131513", "0.6089771", "0.60881346", "0.6076737", "0.6054339", "0.6030644", "0.602...
0.53534555
100
Print the info of the student
public String toString() { String st = "Student Name: " + getStudentName() + " ID: " + getStudentId() + "\n"; return st; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printStudentInfo(){\r\n System.out.println(\"Name: \" + getName());\r\n System.out.println(\"Student Id: \" + getId());\r\n printMarks();\r\n System.out.println(\"\\nAverage \" + getAverage() + \"%\");\r\n printNumberOfCoursesInEachLetterGradeCategory();\r\n }", ...
[ "0.8931974", "0.862671", "0.81034607", "0.7985693", "0.7769405", "0.77375835", "0.7720369", "0.7703742", "0.76903456", "0.7685483", "0.76620895", "0.7638551", "0.7593308", "0.75509477", "0.7484052", "0.7449977", "0.7449318", "0.7415705", "0.73283404", "0.73186964", "0.7302831...
0.7072971
36
Add a registration to the student ongoing courses
public void addRegistration(Registration registration) { studentRegList.add(registration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void registerIncourse(String cname, int sec, String fname, String lname) {\n\t\tString user, pass, first, last;\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tif (CourseManager.courses.get(i).getName().equals(cname) && CourseManager.courses.get(i).getSection() == sec) {\n\t\t\t\tfor (i...
[ "0.7701944", "0.7465351", "0.7189123", "0.71889824", "0.7156276", "0.7113346", "0.7098512", "0.69894016", "0.6976836", "0.6915001", "0.6893587", "0.68122363", "0.67742884", "0.6704106", "0.6675769", "0.659868", "0.64975834", "0.6483234", "0.63982064", "0.6392276", "0.63899964...
0.72927684
2