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
TODO Autogenerated method stub
public static void main(String[] args) throws MalformedURLException, InterruptedException { DesiredCapabilities capabilities= new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"Rajesh Iphone"); capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"ios"); capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"9.3.5"); capabilities.setCapability("udid","499ae5ae6d066971991c5d27e8fbff07899a489d"); capabilities.setCapability("bundleId","TAmobiletest.safarlauncher"); AppiumDriver driver= new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); Set<String> contextHandles = driver.getContextHandles(); System.out.println(contextHandles.size()); for(String contextname:contextHandles) { System.out.println(contextname); if(contextname.contains("WEBVIEW")) { driver.context(contextname); } } driver.get("http://www.google.com"); Thread.sleep(5000); driver.findElementById("lst-ib").sendKeys("Sachin"); driver.findElementById("tsbb").click(); Thread.sleep(9000); String Actual_Result = driver.findElementByXPath("//span[contains(text(),'Cricketer')]").getText(); System.out.println("Actual Result is "+Actual_Result); }
{ "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.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0...
0.0
-1
Create an image file name
private static File createImageFile() throws IOException { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; File storageDir = MyApplication.getContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES); File image = File.createTempFile( imageFileName, /* prefix */ ".jpg", /* suffix */ storageDir /* directory */ ); return image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private File createImageFileName() throws IOException {\n String timestamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n //there are two types of SimpleDateFormat and Date()\n String prepend = \"JPEG_\" + timestamp + \"_\";\n File imageFile = File.createTempFile(prep...
[ "0.7782615", "0.7292824", "0.6992056", "0.6992056", "0.6943564", "0.6911284", "0.68938434", "0.686538", "0.68592805", "0.68590325", "0.68580544", "0.68443614", "0.67711073", "0.67546785", "0.6751638", "0.6737171", "0.6726197", "0.67170936", "0.6706409", "0.6694521", "0.669251...
0.67068315
18
The initial method to be executed when the class is invoked. The request parameter is extracted to a variable
@Override public void doInit() { action = (String) getRequestAttributes().get("action"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected String onInit(HttpServletRequest req, HttpServletResponse resp, FunctionItem fi,\n\t\t\tHashtable<String, String> params, String action, L l, S s) throws Exception {\n\t\treturn null;\n\t}", "public void request() {\n }", "private Request() {\n initFields();\n }", "public Re...
[ "0.62182343", "0.615576", "0.6108483", "0.6084121", "0.6074229", "0.60479885", "0.5998022", "0.5987606", "0.5855498", "0.58328307", "0.57890075", "0.5746675", "0.5719743", "0.56515366", "0.56476825", "0.5632698", "0.5632698", "0.5592429", "0.55634934", "0.55509806", "0.553565...
0.6617874
0
Checks for the request attribute and invoke the corresponding method for business logic
@Get public String serviceRequest() { counter.increment(endpoint); boolean rateResult = false; boolean cdrResult = false; boolean tcdrResult = false; // Get the list of enabled resources enabledResourceList = getEnabledResources(); // Service the request try { if (action.equalsIgnoreCase("rate")) { logger.debug("Attempting to generate a Rate"); rateResult = generateRate(); } else if (action.equalsIgnoreCase("cdr")) { logger.debug("Attempting to generate a CDR"); cdrResult = generateCdr(); } else if (action.equalsIgnoreCase("t-cdr")) { logger.debug("Attempting to generate a CDR for T-nova"); tcdrResult = generateTNovaCdr(); } // Construct the response if (rateResult) { return "The rate generation was successful"; } else if (cdrResult) { return "The cdr generation was successful"; } else if (tcdrResult) { return "The T-Nova cdr generation was successful"; } else { return "Operation Failed"; } }catch (Exception e){ logger.error("Error while generating it: "+e.getMessage()); return "Operation Failed"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkRequest(String theRequest, HttpServletRequest request, HttpServletResponse response) {\n try {\n\n Method requestMethod = this.getClass().getDeclaredMethod(theRequest, HttpServletRequest.class, HttpServletResponse.class);\n requestMethod.invoke(this, request, response)...
[ "0.6379705", "0.60921293", "0.5943786", "0.5926253", "0.59167856", "0.5886525", "0.57771474", "0.5753215", "0.57345784", "0.57163584", "0.57056355", "0.56977916", "0.5622041", "0.55940866", "0.5587153", "0.5586485", "0.55613434", "0.5558678", "0.5556514", "0.554948", "0.55356...
0.0
-1
Get a list of meters which are selected Pseudo Code 1. Connect to the UDR service to get a list of meters 2. Store the meters which are selected
private ArrayList getEnabledResources() { ArrayList enabledResourceList = new ArrayList(); String meterData; JsonRepresentation responseJson; int meterNameIndex = 0; int meterStatusIndex = 0; JSONArray columnArr, tagArr, pointsArr; // Get the active meters from the meter API from UDR Service try { logger.debug("Attempting to get the Enabled Resources"); meterData = udrServiceClient.getActiveResources(); responseJson = new JsonRepresentation(meterData); JSONObject jsonObj = responseJson.getJsonObject(); columnArr = jsonObj.getJSONArray("columns"); //tagArr = jsonObj.getJSONArray("tags"); for (int i = 0; i < columnArr.length(); i++) { if ("metername".equals(columnArr.get(i))) { meterNameIndex = i; } if ("status".equals(columnArr.get(i))) { meterStatusIndex = i; } } pointsArr = jsonObj.getJSONArray("points"); HashMap<String, String> enabledResourceMap = new HashMap<String, String>(); for (int j = 0; j < pointsArr.length(); j++) { JSONArray arr = (JSONArray) pointsArr.get(j); if (Integer.parseInt(arr.get(meterStatusIndex).toString()) == 1) { if (!enabledResourceList.contains(arr.get(meterNameIndex))) enabledResourceList.add(arr.get(meterNameIndex)); } } } catch (Exception e) { logger.error("Error while getting the Enabled Resources: "+e.getMessage()); e.printStackTrace(); } return enabledResourceList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "InternalResultsResponse<GasMeter> fetchAllGasMeters(InquiryDeviceRequest inquiryDeviceRequest);", "List<DeviceLocation> getDeviceLocations(List<DeviceIdentifier> deviceIdentifiers) throws DeviceDetailsMgtException;", "public DCU() {\r\n meters = new ArrayList<Meter>();\r\n id = \"unknown\";\r\n ...
[ "0.5772522", "0.53011703", "0.51661444", "0.51394516", "0.5134196", "0.51296514", "0.5085443", "0.50267863", "0.5003873", "0.4991577", "0.49823475", "0.49642554", "0.4936203", "0.49242854", "0.4923782", "0.4891943", "0.4869166", "0.48516998", "0.48486373", "0.4813557", "0.480...
0.0
-1
Initiated the generation of rate depending on the existing rating policy Pseudo Code 1. Check for the rating policy 2. Invoke the method to initiate the rate generation
private boolean generateRate() { TSDBData rateObj; boolean result = false; if (Flag.getMeteringType().equalsIgnoreCase("static")) { rateObj = generateStaticRate(); } else { rateObj = generateDynamicRate(); } if (rateObj.getPoints().size() > 0) result = saveRate(rateObj); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRate(int rate) { this.rate = rate; }", "private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayL...
[ "0.6060857", "0.6004596", "0.5949738", "0.58679503", "0.5819153", "0.5813864", "0.5796652", "0.5765595", "0.57314885", "0.5636161", "0.5546626", "0.5536281", "0.55359906", "0.55110323", "0.5495199", "0.5486852", "0.5485733", "0.54723704", "0.5426155", "0.54239863", "0.5418743...
0.6353241
0
Saves a TSDB dataObj into the database Pseudo Code 1. Create a TSDB client object (POJO object) 2. Convert the data object into a json string 3. Save the string into the database
private boolean saveRate(TSDBData rateObj) { InfluxDBClient dbClient = new InfluxDBClient(); ObjectMapper mapper = new ObjectMapper(); String jsonData = null; boolean result; try { jsonData = mapper.writeValueAsString(rateObj); } catch (JsonProcessingException e) { e.printStackTrace(); } result = dbClient.saveData(jsonData); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doSave(T objectToSave) throws SQLException;", "void storeEditorData(int userid,String name,Object bodyContent){\n dbConnection();\n try{\n PGobject editorData = new PGobject();\n editorData.setType(\"json\");\n editorData.setValue(bodyContent.toString())...
[ "0.6831142", "0.6774141", "0.64445674", "0.6443571", "0.6314301", "0.6302217", "0.61327916", "0.61172444", "0.60277236", "0.60156244", "0.6013114", "0.5996221", "0.5970348", "0.5931313", "0.5927814", "0.59097564", "0.58932406", "0.58856916", "0.5880239", "0.58728313", "0.5842...
0.5935687
13
Generates the static rate for a resource Pseudo Code 1. Get the current list of resources along with their static rates 2. Create a dataObj consisting of the resources along with its resources.
private TSDBData generateStaticRate() { //TODO: check if there is generic method to to return rateData ArrayList<String> strArr = StringUtil.strArr("resource", "rate", "rate_policy"); TSDBData rateData = createPOJOObject("rate", strArr, load.getStaticRate()); return rateData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayList<String> strArr = null;\n ArrayList<Object> obj...
[ "0.6976638", "0.6695883", "0.6236558", "0.61495876", "0.6037755", "0.5769019", "0.5678333", "0.56382906", "0.5637266", "0.55735075", "0.5421919", "0.54046243", "0.54033893", "0.5353337", "0.52967155", "0.52960384", "0.5291717", "0.516319", "0.51128113", "0.50240284", "0.49938...
0.7956629
0
Generates the dynamic rate for a resource Pseudo Code 1. For every resources, create a rate through a random function with the value between a range.
private TSDBData generateDynamicRate() { //TODO: replace with single method generateRate and parameter (static, dynamic) double rate; Random rateGenerator = new Random(); TSDBData rateData = new TSDBData(); ArrayList<String> strArr = null; ArrayList<Object> objArrNode; ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>(); // Iterate through the list and generate the rate for each enabled meters for (int k = 0; k < enabledResourceList.size(); k++) { //rate = getDynamicRate(enabledResourceList.get(k).toString()); rate = rateGenerator.nextInt((3 - 1) + 1) + 1; strArr = StringUtil.strArr("resource", "rate", "rate_policy"); //strArr.add("resource"); //strArr.add("rate"); //strArr.add("rate_policy"); objArrNode = new ArrayList<Object>(); objArrNode.add(enabledResourceList.get(k)); objArrNode.add(rate); objArrNode.add(Flag.getMeteringType()); objArr.add(objArrNode); } rateData.setName("rate"); rateData.setColumns(strArr); rateData.setPoints(objArr); return rateData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "private TSDBData generateStaticRate() {\n //TODO: check if there is generic method to to return rateData\n ArrayList<String> strArr = StringUtil.strArr(\"resource\", \"rate\", \"rate_policy\");\n TSDB...
[ "0.63622576", "0.6212645", "0.60962397", "0.6018141", "0.5947577", "0.5861339", "0.5838002", "0.5734345", "0.5681443", "0.56242645", "0.559271", "0.55537826", "0.5536752", "0.54974097", "0.5492895", "0.549211", "0.54878074", "0.5463898", "0.5458776", "0.54565805", "0.54553866...
0.649263
0
Request for generating the dynamic rate from the rule engine Pseudo Code 1. Connect to the rule engine 2. Invoke the getRate method with the resource name 3. Return the generated rate
private double getDynamicRate(String resourceName) { logger.trace("BEGIN double getDynamicRate(String resourceName)"); double rate; RateEngineResponse response; RuleEngineClient client = new RuleEngineClient(); response = client.getRate(resourceName); rate = response.getRate(); //System.out.println("Got the response from rule engine. Rate: " + response.getRate()); logger.trace("END double getDynamicRate(String resourceName)"); return rate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.yandex.ydb.rate_limiter.Resource getResource();", "private TSDBData generateDynamicRate() {\n //TODO: replace with single method generateRate and parameter (static, dynamic)\n double rate;\n Random rateGenerator = new Random();\n TSDBData rateData = new TSDBData();\n ArrayL...
[ "0.698578", "0.68435675", "0.681921", "0.65546817", "0.6442524", "0.6172029", "0.61413556", "0.6133461", "0.6103118", "0.60501134", "0.60432965", "0.60432965", "0.6041667", "0.60083556", "0.59588516", "0.5919654", "0.5898494", "0.58866674", "0.58855927", "0.5884453", "0.58660...
0.80228406
0
Generate the CDR of all the users for the selected meters Pseudo Code 1. Get the list of selected meters 2. Query the UDR service to get the usage information under these meters for all the users for a time period 3. Get the rate for the same meters for a same time period 4. Combine the rate and usage to get the charge value 5. Save it in the db
private boolean generateCdr(){ //TODO: split it into smaller methods Object usage; double charge; String from, to; String[] time; int indexUsage; ArrayList usageListArr, usageArr; ArrayList columnArr; UDRServiceClient udrClient = new UDRServiceClient(); RateResource rateResource = new RateResource(); ArrayList<ArrayList<Object>> objArr = new ArrayList<ArrayList<Object>>(); Double rate; TSDBData tsdbData; boolean result; String userid; ArrayList<ResourceUsage> resourceUsageArray; HashMap tags; POJOUtil pojoUtil = new POJOUtil(); DateTimeUtil dateTimeUtil = new DateTimeUtil(); time = dateTimeUtil.getRange(); from = time[1]; to = time[0]; for (int i = 0; i < enabledResourceList.size(); i++) { tsdbData = rateResource.getResourceRate(enabledResourceList.get(i).toString(), from, to); rate = calculateRate(tsdbData); resourceUsageArray = udrClient.getResourceUsageData(enabledResourceList.get(i).toString(), from, to); for (ResourceUsage resource : resourceUsageArray) { columnArr = resource.getColumn(); usageListArr = resource.getUsage(); tags = resource.getTags(); //indexUserId = columnArr.indexOf("userid"); userid = tags.get("userId").toString(); //userid = userid.substring(0, userid.length()); indexUsage = columnArr.indexOf("mean"); // The below if condition differentiates between the gauge and cumulative meters of openstack if (indexUsage < 0) { indexUsage = columnArr.indexOf("usage");//usage if we are not using the sum in the sql else "sum" } // Iterate through the usage arraylist to extract the userid and usage. // Multiple the usage with the rate of the resource and save it into an arraylist for (int j = 0; j < usageListArr.size(); j++) { usageArr = (ArrayList) usageListArr.get(j); usage = usageArr.get(indexUsage); // Calculate the charge for a resource per user Double d = Double.parseDouble(usage.toString()); charge = (d * rate); String resources = enabledResourceList.get(i).toString(); objArr = pojoUtil.populateList(usageListArr, objArr, resources, userid, usage, charge); } } } // Save the charge array into the database result = savePrice(objArr); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "InternalResultsResponse<GasMeter> fetchAllGasMeters(InquiryDeviceRequest inquiryDeviceRequest);", "public Breakdown generateReport(Date startDate, Date endDate, ArrayList<User> userList, double total) {\n\n //INTIATING VARIABLES\n Breakdown result = new Breakdown();\n\n HashMap<String, Break...
[ "0.5729615", "0.54658014", "0.5424895", "0.53963804", "0.5318598", "0.51455504", "0.5028957", "0.49882022", "0.49597943", "0.49115965", "0.48936146", "0.48702002", "0.48569587", "0.4821464", "0.48157644", "0.4812511", "0.4774883", "0.4763545", "0.47550812", "0.47460762", "0.4...
0.6585418
0
Generate the CDR for TNova service Pseudo Code 1. Get the list of selected meters 2. Query the UDR service to get the usage information under these meters for all the users for a time period 3. Get the rate for the same meters for a same time period 4. Combine the rate and usage to get the charge value 5. Save it in the db
private boolean generateTNovaCdr() throws Exception { // TODO maybe continue here? return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean generateCdr(){\n //TODO: split it into smaller methods\n Object usage;\n double charge;\n String from, to;\n String[] time;\n int indexUsage;\n ArrayList usageListArr, usageArr;\n ArrayList columnArr;\n UDRServiceClient udrClient = new...
[ "0.694999", "0.5785911", "0.57022923", "0.5599027", "0.5525465", "0.5443698", "0.51456684", "0.51331246", "0.5132765", "0.51076734", "0.51025283", "0.5070332", "0.50510067", "0.50452065", "0.5023069", "0.497227", "0.4943914", "0.49227822", "0.49221504", "0.48904502", "0.48848...
0.0
-1
This method computes the cost of a period based on the established period of charging, the time that has being used and the price. Pseudo Code: 1. Get which time policy has been selected (D, W, M and Y for day, week, month and year) 2. Apply the quantity that comes in the period String (1,2,3...) 3. Computes the price and returns it
private double computeCost(String period, long time, double price) { logger.debug("Computing the price of the UDR."); final int secondsPerDay = 86400; final int secondsPerWeek = 604800; final int secondsPerMonth = 2592000;//Based in 30 day month. //TODO: Base the seconds per month in the real number of days of the month. final int secondsPerYear = 31536000; double finalPrice = 0.0; int timePeriod = Integer.parseInt(String.valueOf(period.charAt(1))); char periodPolicy = period.charAt(2); switch (periodPolicy) { case 'D': finalPrice = (time / secondsPerDay * timePeriod) * price; break; case 'W': finalPrice = (time / secondsPerWeek * timePeriod) * price; break; case 'M': finalPrice = (time / secondsPerMonth * timePeriod) * price; break; case 'Y': finalPrice = (time / secondsPerYear * timePeriod) * price; break; } return finalPrice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Double computeCost(double time) {\n // get the time period and policy type\n int timePeriod = Integer.parseInt(period.substring(1, period.length()-1));\n char periodPolicy = period.charAt(period.length()-1);\n\n double finalPrice = 0.0;\n\n // compute the fi...
[ "0.7704654", "0.5737509", "0.56438065", "0.5544376", "0.5502434", "0.54536986", "0.54102707", "0.5368175", "0.5260587", "0.5252559", "0.524806", "0.5242518", "0.5231174", "0.51814425", "0.51746017", "0.51631325", "0.5154602", "0.5130876", "0.51242507", "0.51152706", "0.507798...
0.751986
1
Gets sum of usage of clientID/instanceID mappings and returns ArrayList of last events.
private TSDBData getBillingModel(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient) { logger.trace("BEGIN TSDBData sumUsage(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)"); ArrayList<TSDBData> UDRs = new ArrayList<TSDBData>(); Iterator it = clientInstanceMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); String clientId = pair.getKey().toString(); ArrayList<String> instances = (ArrayList<String>) pair.getValue(); for (String instance : instances) { //System.out.println("instanceid = " + instance); //System.out.println("clientid = " + clientId); String queryString = "SELECT sum(usage) FROM UDR WHERE clientId='" + clientId + "' AND instanceId='" + instance + "' GROUP BY clientID,instanceID"; logger.trace("DATA TSDBData sumUsage(...): query=" + queryString); // TSDBData[] lastEvent = dbClient.query(queryString); //sends the event to array //lastEvents.add(lastEvent[0]); } System.out.println(pair.getKey() + " = " + pair.getValue()); it.remove(); // avoids a ConcurrentModificationException } logger.trace("END ArrayList<TSDBData> captureLastEvents(HashMap<String, ArrayList<String>> clientInstanceMap, InfluxDBClient dbClient)"); return UDRs.get(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private HashMap<String, ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData) {\n logger.trace(\"BEGIN HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)\");\n HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();\n for (TS...
[ "0.5637176", "0.5486621", "0.54747695", "0.5254279", "0.5244751", "0.5153446", "0.5135016", "0.5122536", "0.50785935", "0.50017214", "0.49928045", "0.495837", "0.49513057", "0.49412426", "0.49048412", "0.4904499", "0.49025327", "0.488479", "0.48808566", "0.48794797", "0.48767...
0.64366996
0
Concatenates two column Arrays.
private ArrayList<String> concatColumns(ArrayList<String>... columns) { if (columns.length < 1) { return null; } else if (columns.length < 2) { return columns[0]; } else { ArrayList<String> concatenated = new ArrayList<String>(); for (ArrayList<String> column : columns) { for (String col : column) { concatenated.add(col); } } return concatenated; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n...
[ "0.77817965", "0.72010875", "0.70216894", "0.70017964", "0.6959023", "0.6905474", "0.68206173", "0.67844826", "0.66926515", "0.66307133", "0.657629", "0.6453463", "0.62933767", "0.6261994", "0.6199176", "0.611361", "0.6113201", "0.60732496", "0.60492635", "0.6015048", "0.6010...
0.676861
8
This method takes the POJOobject that contains all events, extracts all clientIDs and maps instanceIds to them which are saved to a HashMap.
private HashMap<String, ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData) { logger.trace("BEGIN HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)"); HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>(); for (TSDBData obj : tsdbData) { ArrayList<String> columns = obj.getColumns(); ArrayList<ArrayList<Object>> points = obj.getPoints(); int clientidIndex = -1; int instanceidIndex = -1; for (int i = 0; i < columns.size(); i++) { if (columns.get(i).equals("clientId")) clientidIndex = i; else if (columns.get(i).equals("instanceId")) instanceidIndex = i; } for (int i = 0; i < points.size(); i++) { String clientId = points.get(i).get(clientidIndex).toString(); String InstanceId = points.get(i).get(instanceidIndex).toString(); if (!(map.containsKey(clientId))) { map.put(clientId, new ArrayList<String>()); if (!(map.get(clientId).contains(InstanceId))) { map.get(clientId).add(InstanceId); } } else { if (!(map.get(clientId).contains(InstanceId))) { map.get(clientId).add(InstanceId); } } } } logger.trace("END HashMap<String,ArrayList<String>> getInstanceIdsPerClientId(TSDBData[] tsdbData)"); return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract Map<String, Serializable> getEventKeyAndIdMap();", "Map<Long,LinkedList<Event>> getAllEvents(List<Long> inRequestIds);", "public abstract java.util.Map<java.lang.String, java.lang.Integer> idiosyncraticEventIncidenceCountMap();", "public Map<String, Object> toMap(){\n Map<String, Ob...
[ "0.6147382", "0.55996937", "0.5458974", "0.54518926", "0.53888226", "0.535826", "0.53511894", "0.5281494", "0.52389556", "0.5103385", "0.5057628", "0.50544417", "0.5021554", "0.4981929", "0.49318543", "0.49155092", "0.4906772", "0.48980096", "0.4874697", "0.48676163", "0.4861...
0.6564211
0
Calculate the average rate for a time period Pseudo Code 1. Get the array of rates for a resource 2. Add the rates and get the average value 3. Return the average rate.
private Double calculateRate(TSDBData tsdbData) { logger.trace("BEGIN Double calculateRate(TSDBData tsdbData)"); int rateIndex; int rateDataPoints; Double rate = 0.0; ArrayList dataPointsArray; rateIndex = tsdbData.getColumns().indexOf("rate"); rateDataPoints = tsdbData.getPoints().size(); for (int i = 0; i < tsdbData.getPoints().size(); i++) { dataPointsArray = tsdbData.getPoints().get(i); rate = rate + Double.parseDouble(dataPointsArray.get(rateIndex) + ""); } logger.trace("DATA Double calculateRate(TSDBData tsdbData): rate=" + rate); rate = rate / tsdbData.getPoints().size(); logger.trace("END Double calculateRate(TSDBData tsdbData)"); return rate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculateRates() {\n if (rateOutput == null || !outputs.containsKey(rateOutput)) throw new RuntimeException(\"Insufficient data to calculate recipe rates\");\n recipesPerMinute = productionRate / outputs.get(rateOutput);\n\n for (String resource : inputs.keySet()) {\n r...
[ "0.60044384", "0.59957486", "0.5901183", "0.5725512", "0.571166", "0.5664603", "0.56547165", "0.56333923", "0.561614", "0.5586534", "0.55618316", "0.5556125", "0.5529448", "0.5518546", "0.5502061", "0.5478964", "0.5472615", "0.5463405", "0.5444757", "0.53909606", "0.53758156"...
0.5585382
10
Save the price generated into the DB Pseudo Code 1. Create the dataobj containing the details 2. Save it into the db
private boolean savePrice(ArrayList<ArrayList<Object>> objArr) { //TODO: create string array construction method with String... array //TODO: create generic method to create POJO object from objArr and map to JSON data logger.trace("BEGIN boolean savePrice(ArrayList<ArrayList<Object>> objArr)"); boolean result = false; TSDBData pricingData = new TSDBData(); ArrayList<String> strArr = new ArrayList<String>(); InfluxDBClient dbClient = new InfluxDBClient(); ObjectMapper mapper = new ObjectMapper(); String jsonData = null; strArr.add("resource"); strArr.add("userId"); strArr.add("usage"); strArr.add("price"); pricingData.setName(Loader.getSettings().getInfluxDBSettings().getCdrRecord()); pricingData.setColumns(strArr); pricingData.setPoints(objArr); //get tags and put them into pricingData logger.trace("DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): pricingData=" + pricingData); try { jsonData = mapper.writeValueAsString(pricingData); } catch (JsonProcessingException e) { logger.error("EXCEPTION JSONPROCESSINGEXCEPTION boolean savePrice(ArrayList<ArrayList<Object>> objArr)"); e.printStackTrace(); } //System.out.println(jsonData); logger.trace("DATA boolean savePrice(ArrayList<ArrayList<Object>> objArr): jsonData=" + jsonData); result = dbClient.saveData(jsonData); logger.trace("END boolean savePrice(ArrayList<ArrayList<Object>> objArr)"); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void save(BuyTicketModel value) {\n String sql = \"insert into buyticket values(?,?,?,?,?,?,?,?,?,?,?,?) \";\r\n \r\n try {\r\n PreparedStatement pstm = database.getCon().prepareStatement(sql);\r\n pstm.setString(1, value.getSlno());\r\n p...
[ "0.6641166", "0.6618838", "0.6530976", "0.64706355", "0.64513516", "0.6417909", "0.63966006", "0.63644373", "0.6328773", "0.6136618", "0.6123842", "0.61123896", "0.60986286", "0.6069324", "0.60490966", "0.6044331", "0.6022922", "0.6009948", "0.6002936", "0.60009575", "0.59991...
0.64519954
4
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. The general contract of the method run is that it may take any action whatsoever.
@Override public void run() { try { evenSemaphore.acquire(); while (true) { if(count % 2 == 0){ System.out.println(Thread.currentThread().getName() + " 偶数 " + count); count++; if (count > 20) { return; } oddSemaphore.release(); evenSemaphore.acquire(); TimeUnit.SECONDS.sleep(1); } if (count > 20) { break; } } } catch (InterruptedException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is fini...
[ "0.70473224", "0.6959602", "0.68878573", "0.67356926", "0.6643415", "0.6577995", "0.65193015", "0.64961", "0.64958775", "0.64664197", "0.6445248", "0.6440278", "0.63915735", "0.63882184", "0.6380882", "0.63735896", "0.6365825", "0.6365825", "0.6365825", "0.6365825", "0.636582...
0.0
-1
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. The general contract of the method run is that it may take any action whatsoever.
@Override public void run() { try { evenSemaphore.acquire(); while (true) { if(count % 2 != 0){ System.out.println(Thread.currentThread().getName() + " 奇数 " + count); count++; if (count > 20) { return; } evenSemaphore.release(); oddSemaphore.acquire(); TimeUnit.SECONDS.sleep(1); } } } catch (InterruptedException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is fini...
[ "0.70486647", "0.69597656", "0.68883115", "0.67373145", "0.6644344", "0.6578161", "0.65179926", "0.64961547", "0.64943063", "0.6465665", "0.6443635", "0.64434725", "0.63917446", "0.63879454", "0.6379522", "0.6372614", "0.6365644", "0.6365644", "0.6365644", "0.6365644", "0.636...
0.0
-1
/ put bubblesort in deeper nested loops. To improve this takes a crossover of bubblesort and a deletion of the whole block (Harder than simply deleting bloat) does the magnitude of the outer loop matter? its removal is an optimisation, regardless of if it adds 0 or 1 wasted loops.
public Sort1LoopCloneProblem(int numReps){ setString(numReps); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\...
[ "0.63851166", "0.62953085", "0.62743723", "0.6254775", "0.6239921", "0.62176687", "0.62123173", "0.61141574", "0.6111701", "0.6105639", "0.6049964", "0.6040918", "0.6012974", "0.6003301", "0.60020745", "0.5980459", "0.59384507", "0.59377855", "0.5915532", "0.5895548", "0.5883...
0.0
-1
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
@Override public Type evaluateType() throws Exception { return new IntegerType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void habilitar() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}...
[ "0.77446616", "0.73747396", "0.69675475", "0.69103026", "0.679555", "0.6773403", "0.6770247", "0.6653279", "0.6639254", "0.6624963", "0.6609852", "0.6609852", "0.65904075", "0.6587144", "0.6556081", "0.6498715", "0.646223", "0.64508164", "0.6429958", "0.6420191", "0.63830656"...
0.0
-1
private static String userFileName; private static String
public User(String email, String username, String password) { this.email = email; this.username = username; this.password = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "File getFile() { return user_file; }", "public String getFileName ();", "public String getFileName() {\n/* 43:43 */ return this.fileName;\n/* 44: */ }", "public String GetFileName() {\r\n\treturn fileName;\r\n }", "public String getFILE_NAME() { return FILE_NAME; }...
[ "0.6960743", "0.6785937", "0.67281544", "0.6675303", "0.6650943", "0.65997154", "0.65997154", "0.65997154", "0.65997154", "0.65997154", "0.6598829", "0.6598829", "0.65867406", "0.6565726", "0.65152526", "0.64911604", "0.6435627", "0.64072716", "0.64023155", "0.6369962", "0.63...
0.0
-1
Advance the iterator and set the new voteBlock.
void nextVoteBlock() { try { if (iter.hasNext()) { voteBlock = iter.next(); } else { voteBlock = null; } } catch (IOException e) { // Even if the error is transient, we are trying to keep in // synch. If we later tried to catch up, we could have a // bunch of URLs we'd already counted for other voters. So // call this Entry finished. installErrorIterator(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void nextVoteBlock(Entry e) {\n // There's no way to tell the PriorityQueue that the entry has\n // changed, and needs to be resorted, other than remove/add.\n participantsQueue.remove(e);\n e.nextVoteBlock();\n participantsQueue.add(e);\n }", "public abstract void setNextBlockInstant();"...
[ "0.6461405", "0.5704368", "0.5569756", "0.5348855", "0.5328955", "0.5319437", "0.52788454", "0.5265593", "0.51109457", "0.50648767", "0.5061989", "0.5051859", "0.50305074", "0.5023814", "0.49992096", "0.497667", "0.49751204", "0.4957323", "0.49493852", "0.49201444", "0.490099...
0.7184621
0
null sorts after everything else.
public int compare(Entry o1, Entry o2) { String url1 = o1.getUrl(); String url2 = o2.getUrl(); return StringUtil.compareToNullHigh(url1, url2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean getSortNoNull();", "public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}", "public List<ValueType> sort() {\r\n // TODO\r\n return null;\r\n }", "boolean getMoveSortNoNull();", "@Test\n\tpublic void testSortNullArray() {\n\t\tint[] array = null;\n\t\tAssert.assertNull(arr...
[ "0.7388629", "0.73375607", "0.6683283", "0.6665908", "0.65582955", "0.6541051", "0.65327674", "0.64685524", "0.64295745", "0.64083767", "0.64012104", "0.63861924", "0.63455635", "0.63455635", "0.6340732", "0.6322746", "0.6311932", "0.6259498", "0.62518877", "0.6239966", "0.62...
0.0
-1
Release unneeded resources used by this object at the end of a poll.
void release() { for (Entry e : participantsList) { e.release(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dispose() {\n story = null;\n backlog = null;\n parent = null;\n }", "public void dispose()\n {\n while( m_count > 0 )\n {\n int i = m_count - 1;\n try\n {\n m_factory.decommission( m_pool[ i ] );\n }\...
[ "0.68281484", "0.68129", "0.6803907", "0.6776638", "0.66657656", "0.6645523", "0.66016537", "0.65757746", "0.65704554", "0.65129215", "0.65129215", "0.647409", "0.64474183", "0.64393616", "0.6422315", "0.6404969", "0.6391512", "0.6382453", "0.636706", "0.6355518", "0.63472503...
0.0
-1
Peek at the next URL known to any participant.
String peekUrl() { Entry e = participantsQueue.peek(); if (e == null) { return null; } return e.getUrl(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void seek(String url) {\n if (url == null) {\n throw new ShouldNotHappenException(\"url is null.\");\n }\n if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) {\n throw new ShouldNotHappenException(\"Current URL is \"+\n\t\t\t\t\t peekUrl()+\", past \"+url);\n }\n for (Entry e : particip...
[ "0.6550826", "0.6228325", "0.6192391", "0.5768297", "0.5724908", "0.5583892", "0.55295235", "0.5297868", "0.52442914", "0.5231545", "0.5222845", "0.51695055", "0.5169057", "0.5168554", "0.51567507", "0.51567507", "0.51471186", "0.51147294", "0.50609475", "0.5035255", "0.50299...
0.70660853
0
Skip all the voters' URLs which are less than the given's URL. Can be useful when checking a repair. The poller has the given URL.
void seek(String url) { if (url == null) { throw new ShouldNotHappenException("url is null."); } if (StringUtil.compareToNullHigh(peekUrl(), url) > 0) { throw new ShouldNotHappenException("Current URL is "+ peekUrl()+", past "+url); } for (Entry e : participantsList) { participantsQueue.remove(e); // todo(bhayes): Change VoteBlockIterator to support a "seek" // operation. // VoteBlocks.getVoteBlock(url) has [unused] code trying to do // something similar. It creates a VoteBlocksIterator, and // iterates over the whole VoteBlocks, [ignoring that it should // already be in URL order] looking for a VoteBlock with the // given URL, and returns that block. What we could use is a // method VoteBlocksIterator.seek(url) that fast-forwards to // the right place. But we don't want to just get the VoteBlock, // we want to advance the iterator. // while (StringUtil.compareToNullHigh(e.getUrl(), url) < 0) { e.nextVoteBlock(); } participantsQueue.add(e); } // NOTE: Since the voters' iterators may not read from disk the // same as in the initial poll, some or all of the voters which // had the URL in the initial poll may deny having it now. // peekUrl() may not equal url. if (StringUtil.compareToNullHigh(peekUrl(), url) < 0) { throw new ShouldNotHappenException("Current URL is "+ peekUrl()+", before "+url); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Document getPageWithRetries(URL url) throws IOException {\n Document doc;\n int retries = 3;\n while (true) {\n sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());\n LOGGER.info(\"Retrieving \" + url);\n doc = Http.url(url)\n ...
[ "0.5470429", "0.5383481", "0.50611216", "0.5032351", "0.4957688", "0.4953103", "0.48966452", "0.489318", "0.4881537", "0.48687416", "0.48219866", "0.47932857", "0.47763476", "0.47751656", "0.47648725", "0.4757302", "0.46995202", "0.4687421", "0.46811998", "0.46522304", "0.463...
0.5771248
0
Called only from testing
boolean voteSpoiled(ParticipantUserData participant) { for (Entry e : participantsList) { if (e.userData == participant) { return e.voteSpoiled(); } } throw new ShouldNotHappenException("participant unknown."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onFirstUse() {}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "private void test() {\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }...
[ "0.6698778", "0.65608686", "0.64087415", "0.6354835", "0.6327425", "0.62489504", "0.62489504", "0.62489504", "0.62489504", "0.62489504", "0.62489504", "0.62449944", "0.6065476", "0.6061684", "0.60571694", "0.6048137", "0.6040899", "0.6021546", "0.6004741", "0.59813845", "0.59...
0.0
-1
Move the entry to the next vote block.
private void nextVoteBlock(Entry e) { // There's no way to tell the PriorityQueue that the entry has // changed, and needs to be resorted, other than remove/add. participantsQueue.remove(e); e.nextVoteBlock(); participantsQueue.add(e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void nextVoteBlock() {\n try {\n\tif (iter.hasNext()) {\n\t voteBlock = iter.next();\n\t} else {\n\t voteBlock = null;\n\t}\n } catch (IOException e) {\n\t// Even if the error is transient, we are trying to keep in\n\t// synch. If we later tried to catch up, we could have a\n\t// bunch of URLs we'd alr...
[ "0.71136475", "0.57954633", "0.5790584", "0.5657253", "0.55882263", "0.55638516", "0.5544045", "0.5537236", "0.5501666", "0.54603195", "0.5414915", "0.5398531", "0.53629804", "0.534247", "0.5294644", "0.52878785", "0.52842605", "0.5282642", "0.5276306", "0.5270531", "0.524089...
0.78866464
0
Skips the next instruction if the key stored in VX is not pressed
@Before public void createOpCode() { opCode = new OpCodeEXA1(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void handleSkipAction(ActionEvent event){\n sender.sendInput(\"skip action\");\n }", "private void chkKeyPressed(KeyEvent e) {\r\n if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\r\n cerrarVentana(false);\r\n } else if (UtilityPtoVenta.verificaVK_F11(e)) {\r\n ace...
[ "0.6181892", "0.59624994", "0.5726039", "0.57075024", "0.5600684", "0.5557655", "0.5532411", "0.54945636", "0.54911894", "0.53823924", "0.5378907", "0.5368882", "0.53454655", "0.53454655", "0.53454655", "0.53454655", "0.53454655", "0.53454655", "0.53454655", "0.53454655", "0....
0.0
-1
Compares searchNodeA with searchNodeB. check for the existence of nodes (x,y,d2) where d2 is less than or equal to d. If there are any such nodes (x,y,d2), then (x,y,d) should not be added to the frontier.
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SearchNode other = (SearchNode) obj; if (x != other.x) return false; if (y != other.y) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int distanceBetweenNodes(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n i...
[ "0.554544", "0.54310375", "0.5334786", "0.5202404", "0.515976", "0.5138248", "0.5135036", "0.5134658", "0.5112613", "0.50713164", "0.5070246", "0.50648993", "0.50480455", "0.50250024", "0.50180906", "0.49951053", "0.4984327", "0.4983281", "0.49675113", "0.4947962", "0.4940642...
0.45930284
92
Expands search node with its neighbours.
public List<SearchNode> expand() { List<SearchNode> neighbours = new ArrayList<>(); if (this.getX() > 0) { SearchNode left = new SearchNode(this.getX() - 1, this.getY(), this.getDepth() + 1); neighbours.add(left); } if (this.getX() < 14) { SearchNode right = new SearchNode(this.getX() + 1, this.getY(), this.getDepth() + 1); neighbours.add(right); } if (this.getY() > 0) { SearchNode up = new SearchNode(this.getX(), this.getY() - 1, this.getDepth() + 1); neighbours.add(up); } if (this.getY() < 14) { SearchNode down = new SearchNode(this.getX(), this.getY() + 1, this.getDepth() + 1); neighbours.add(down); } return neighbours; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void expandNode() {\r\n\t\t\t// Dijkstra's algorithm to handle separately\r\n\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\tCell u;\r\n\t\t\t\t// 11: while Q is not empty:\r\n\t\t\t\tif (graph.isEmpty()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 12: u := vertex in Q (graph) with smallest distance in...
[ "0.6704117", "0.6173976", "0.58178896", "0.5807595", "0.56903726", "0.56502503", "0.5539601", "0.54700893", "0.5465859", "0.54644597", "0.5428894", "0.54267174", "0.54189914", "0.54163617", "0.54146063", "0.5376946", "0.5366787", "0.5365449", "0.53614354", "0.53266215", "0.53...
0.75723296
0
Applies current locale to resource bundle.
private void updateBundle() { this.bundle = ResourceBundle.getBundle("languages", this.locales.get(this.currentLocaleIndex)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setLocale(Locale locale) {\n// Recarga las entradas de la tabla con la nueva localizacion \n RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, locale);\n}", "public void updateLocale() {\r\n\t\tsuper.updateLocale();\r\n\t}", "public static void forceLocale(Context context) {\r\n\t\t...
[ "0.67527443", "0.64280486", "0.618957", "0.61204535", "0.61198425", "0.6076342", "0.6023254", "0.5996667", "0.5909292", "0.58942646", "0.58772", "0.58759934", "0.5857093", "0.58403766", "0.5821699", "0.57602364", "0.57492983", "0.574383", "0.5735469", "0.5711554", "0.5678343"...
0.679073
0
Increments current locale pointer.
void changeLanguage() { this.currentLocaleIndex++; if(this.currentLocaleIndex > this.locales.size() - 1) this.currentLocaleIndex = 0; this.updateBundle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void incrementCurrent() {\n current++;\n }", "public void inc(){\n this.current += 1;\n }", "public void updateLocale() {\r\n\t\tsuper.updateLocale();\r\n\t}", "void setCurrentLocaleIndex(int value) {\n\n this.currentLocaleIndex = value;\n this.updateBund...
[ "0.59830844", "0.59573513", "0.57438785", "0.56182563", "0.54880035", "0.54783803", "0.541031", "0.53926045", "0.5358521", "0.53234595", "0.5289054", "0.524413", "0.5213334", "0.5209228", "0.5170696", "0.51682997", "0.516763", "0.5144282", "0.5140964", "0.5124982", "0.5097548...
0.5924692
2
Sets current language to new pointer.
void setCurrentLocaleIndex(int value) { this.currentLocaleIndex = value; this.updateBundle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setLanguage(Language language);", "public void setLanguage(String newLanguage) {\r\n language = newLanguage;\r\n }", "private void changeLanguage(String newLanguage){\n\tif (newLanguage.contentEquals(\"FR\")){\n\t\t((GameActivity) activity).setStringPreferences(\"language\", \"1\");\n\t} else if...
[ "0.6816161", "0.67508465", "0.64980674", "0.6493099", "0.6387665", "0.63861275", "0.6381363", "0.63465697", "0.62368184", "0.62334377", "0.62334377", "0.62284017", "0.61988604", "0.6190123", "0.6136133", "0.61050946", "0.608979", "0.6073478", "0.6069051", "0.60180736", "0.598...
0.0
-1
add error style to simulate a failed command
@Test public void commandBox_commandSucceedsAfterFailedCommand_textClearedAndErrorStyleClassRemoved() { commandBox.getStyleClass().add(CommandBox.ERROR_STYLE_CLASS); commandBox.runCommand(COMMAND_THAT_SUCCEEDS); assertEquals("", commandBox.getCommandInput()); assertEquals(defaultStyleOfCommandBox, commandBox.getStyleClass()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setStyleToIndicateCommandFailure() {\n //override style and disable syntax highlighting\n commandTextField.overrideStyle(ERROR_STYLE_CLASS);\n }", "public void addExceptionStyle();", "void drawError(String message);", "public static Text error(Text error) {\n\t\treturn error.set...
[ "0.7959343", "0.6859465", "0.6638096", "0.6541474", "0.6540722", "0.6385972", "0.6341001", "0.6338466", "0.6205774", "0.61568063", "0.6114149", "0.61041284", "0.60861546", "0.6064783", "0.6060847", "0.60163945", "0.59346116", "0.5916161", "0.5895293", "0.5865164", "0.5801609"...
0.6777315
2
/ Getter and Setters
public PHeader getHeader() { return header; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Override\n public void get() {}", "protected abstract Set method_1559();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n String get();", "public void get() {\n }", "public String get();", "public abstract String get();", ...
[ "0.68711215", "0.6844532", "0.664339", "0.6552768", "0.650287", "0.64509743", "0.6411258", "0.6336067", "0.6255635", "0.6187035", "0.61691475", "0.61446226", "0.6134795", "0.612337", "0.60946494", "0.6091441", "0.6091071", "0.6086424", "0.60800374", "0.60700417", "0.60657734"...
0.0
-1
Insere um novo Termo
public void insereTermo(Termo t) throws GrauJaExisteExc { if(poli.containsKey(t.grau())) throw new GrauJaExisteExc(); else poli.put(t.grau(), t.coef()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugad...
[ "0.68786603", "0.67889816", "0.6765095", "0.66976726", "0.664651", "0.66332775", "0.6469024", "0.646737", "0.64369935", "0.64294946", "0.6396375", "0.63876504", "0.6380491", "0.63578385", "0.6351507", "0.633266", "0.63222826", "0.6262067", "0.62615", "0.6256893", "0.6235804",...
0.69085723
0
Grau do Termo de maior grau
public int maiorGrau() { return poli.lastKey(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String accionemergencia(){\n\t\tString resp=\"\";\n\t\tif(puntosvida<=5 && acc!=1){\n\t\t\tpuntosvida=puntosvida+15;\n\t\t\tresp=\"\\nAccion de emergencia \"+ tipo +\"activada vida +15\";\n\t\t\tacc=1;\n\t\t}\n\t\treturn resp;\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorn...
[ "0.65371495", "0.6475377", "0.6457848", "0.64351183", "0.626562", "0.6184583", "0.61276275", "0.61092573", "0.6080726", "0.60732496", "0.6070444", "0.60675734", "0.6039763", "0.60133", "0.5992836", "0.59838974", "0.5972368", "0.5935238", "0.593085", "0.5924399", "0.591104", ...
0.6459218
2
Termo de maior Coeficiente
public Termo maiorCoef() { Termo t = null; int grauMaxCoef = Integer.MIN_VALUE; for(int grau : poli.keySet()) { if( poli.get(grau) > grauMaxCoef ) grauMaxCoef = grau; // clone() no fim } return new Termo(grauMaxCoef, poli.get(grauMaxCoef)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getCoeficienteBernua()\n {\n return potenciaCV;\n }", "@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\...
[ "0.6947841", "0.6453553", "0.6427433", "0.64065456", "0.63985604", "0.63787574", "0.634673", "0.6328213", "0.63265437", "0.6309395", "0.6246551", "0.6231024", "0.6207407", "0.6204338", "0.6188178", "0.6133983", "0.6119541", "0.61147654", "0.6088796", "0.6088657", "0.6088657",...
0.6313358
9
Elimina Termo de dado grau, caso exista.
public void eliminaTermo(int grau) throws GrauInexistenteExc { if( !poli.containsKey(grau) ) throw new GrauInexistenteExc(); else poli.remove(grau); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eliminarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setIdGrado(17);\n \tString respuesta = negocio.eliminarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }", "public void removerCarro() {\n\n if (carrosCadastrados.size() > 0) {//verifica se existem carros cadast...
[ "0.70894843", "0.7045725", "0.68565995", "0.67607033", "0.67378056", "0.6719651", "0.67149955", "0.6686477", "0.6630952", "0.6629251", "0.6604856", "0.6543361", "0.65427524", "0.65229255", "0.65166605", "0.6506964", "0.6506682", "0.64999425", "0.64883536", "0.64704406", "0.64...
0.72101045
0
Removes town from the map.
public void removeTownFromWorldMap(String town) { map.get(town).forEach((direction, townInDirection) -> { map.get(townInDirection).remove(directionsInverter.get(direction)); }); map.remove(town); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }", "public void removeFromWorld(World world);", "public void removeWorld(String name){\n worlds.remove(getWorld(name));\n }", "public ...
[ "0.63181293", "0.6271805", "0.61641276", "0.6078989", "0.60679346", "0.60675377", "0.6061107", "0.60293925", "0.6029062", "0.5992073", "0.5953959", "0.58709496", "0.58610517", "0.5826287", "0.5818149", "0.58166337", "0.5779829", "0.5726749", "0.57164794", "0.5680561", "0.5677...
0.8134488
0
Finish the registration screen and return to the Login activity
@Override public void onClick(View v) { Intent intent = new Intent(getApplicationContext(), LoginActivity.class); startActivity(intent); finish(); overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void Register()\n {\n Intent registerIntent = new Intent (LoginActivity.this, RegisterActivity.class);\n startActivity(registerIntent);\n finish();\n }", "private void goRegisterActivity() {\n Intent i = new Intent(this, RegisterActivity.class);\n startActivity(i)...
[ "0.8086164", "0.77731264", "0.77242446", "0.7697819", "0.7574784", "0.75733644", "0.7532319", "0.7504397", "0.747711", "0.74729526", "0.7456112", "0.7364659", "0.7346382", "0.73346394", "0.727328", "0.7270509", "0.72429967", "0.72218686", "0.7218744", "0.7214109", "0.71954346...
0.0
-1
On complete call either onSignupSuccess or onSignupFailed depending on success
public void run() { onSignupSuccess(); // onSignupFailed(); progressDialog.dismiss(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void signup() {\n Log.d(TAG, \"Signup\");\n\n if (!validate()) {\n onSignupFailed();\n return;\n }\n\n createProgressDialog(R.string.creating_account);\n\n final String name = _nameText.getText().toString();\n final String email = _emailText.ge...
[ "0.7497708", "0.74489176", "0.722362", "0.71101546", "0.70998985", "0.70149046", "0.6957749", "0.69231665", "0.68191594", "0.6819136", "0.67941475", "0.678789", "0.67707694", "0.67592144", "0.67497087", "0.6739724", "0.6723576", "0.6701651", "0.6687493", "0.6621188", "0.66007...
0.69215894
14
open TDB dataset create the tdb
public Dataset openTDB(String directory){ Dataset dataset = TDBFactory.createDataset(directory); return dataset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void open()\n\t\t{\n\t\t\tconfig=Db4oEmbedded.newConfiguration();\n\t\t\tconfig.common().objectClass(Census.class).cascadeOnUpdate(true);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tDB=Db4oEmbedded.openFile(config, PATH);\n\t\t\t\tSystem.out.println(\"[DB4O]Database was open\");\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(...
[ "0.5775752", "0.56815505", "0.5634357", "0.5549178", "0.5543773", "0.5501105", "0.5453387", "0.5431364", "0.5398397", "0.5390266", "0.5372141", "0.5294034", "0.5290459", "0.52645713", "0.5254556", "0.5252462", "0.5236095", "0.52004385", "0.5166338", "0.5155015", "0.5152464", ...
0.80544996
0
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_about, container, false); TextView appVersion = (TextView) view.findViewById(R.id.app_version); String versionName = BuildConfig.VERSION_NAME; Resources res = getResources(); String versionText = String.format(res.getString(R.string.app_version), versionName); appVersion.setText(versionText); getActivity().findViewById(R.id.fab).setVisibility(View.INVISIBLE); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
end of insert function
public void InOrder() { InOrder(root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public void insert()\n\t{\n\t}", "@Override\n\tpublic void preInsert() {\n\n\t}", "@Override\n\tpublic void insertar() {\n\t\t\n\t}", "@Override\n\tpublic void insertProcess() {\n\t\t\n\t}", "public void insert(Conge conge) ;", "int insert(Position reco...
[ "0.8180608", "0.7998946", "0.75891286", "0.7564482", "0.74837184", "0.7205812", "0.7154205", "0.71083236", "0.70854414", "0.7074691", "0.7071893", "0.7051059", "0.7026868", "0.7011461", "0.7011392", "0.7007048", "0.699582", "0.6988056", "0.6986743", "0.6984884", "0.6981573", ...
0.0
-1
end of InOrder function
public void PreOrder() { PreOrder(root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void inorder() {\n\n\t}", "public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }", "public void inOrder(){\n inOrder(root);\n }", "int order();", "public void inOrder() {\n inOrder(root);\n }", "pr...
[ "0.7537968", "0.7155268", "0.69415075", "0.6826323", "0.68081516", "0.6711279", "0.66901606", "0.66634685", "0.65341574", "0.6488685", "0.64538485", "0.6443115", "0.64265394", "0.64101994", "0.64101994", "0.63909477", "0.6378961", "0.63758504", "0.6339521", "0.62996596", "0.6...
0.0
-1
end of PreOrder function
public void PostOrder() { PostOrder(root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void preorder() {\n\n\t}", "public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}", "public void PreOrder() {\n\t\tPreOrder(root);\n\t}", "public void preOrder() {\n preOrder(root);\n }", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\...
[ "0.7716203", "0.75111914", "0.69798017", "0.69193536", "0.6791229", "0.6757612", "0.6757612", "0.67429894", "0.66927487", "0.66881824", "0.66710705", "0.6651073", "0.65261906", "0.64674014", "0.6439434", "0.6435962", "0.6415022", "0.6408675", "0.6385902", "0.6336576", "0.6336...
0.0
-1
end of InOrder function
public void delete(int val) { root=delete(root,val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void inorder() {\n\n\t}", "public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }", "public void inOrder(){\n inOrder(root);\n }", "int order();", "public void inOrder() {\n inOrder(root);\n }", "pr...
[ "0.7537968", "0.7155268", "0.69415075", "0.6826323", "0.68081516", "0.6711279", "0.66901606", "0.66634685", "0.65341574", "0.6488685", "0.64538485", "0.6443115", "0.64265394", "0.64101994", "0.64101994", "0.63909477", "0.6378961", "0.63758504", "0.6339521", "0.62996596", "0.6...
0.0
-1
end of delete function
public static Node maxleft(Node ROOT) { Node temp=ROOT.left; while(temp.right!=null) { temp=temp.right; }//end of while return temp;//reference of maxleft }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void delete() {\n\n\t}", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\n\t}", "@Override\r\n\tpublic void delete() {\n\r\n\t}", "@Override\n publ...
[ "0.85273695", "0.80794305", "0.8022285", "0.8022285", "0.7926825", "0.7889706", "0.78429806", "0.78379637", "0.7736196", "0.7736196", "0.7729852", "0.76908404", "0.7658859", "0.7623479", "0.7551571", "0.75080794", "0.74789476", "0.74789476", "0.74789476", "0.74789476", "0.747...
0.0
-1
Spiel mit Anzahl der Runden wird erstellt.
@Before public void erstelleSUT() { Spiel spiel = new Spiel(); // Für jeden Spieler eine Unternehmenskette, damit eine // Konkurrenzsituation entsteht ukette = new Unternehmenskette("KetteNummer1"); ukette1 = new Unternehmenskette("KetteNummer2"); // Es werden für Unternehmenskette ein Report erstellt. Pro Runde // brauchen wir eigentlich ein Report für jede Kette. Report report = new Report(1, ukette); Report report1 = new Report(1, ukette1); ukette.hinzufuegenReport(report); ukette1.hinzufuegenReport(report1); // Dem Spiel werden die Unternehmensketten zugeordnet spiel.hinzufuegenUnternehmenskette(ukette); spiel.hinzufuegenUnternehmenskette(ukette1); // Ein Standort, an dem die Ketten konkurrieren sollen, wird angelegt // für den Kunden: // Praeferenz für ALLE ist Qualität Zufall.setzeTestmodus(true); Zufall.setzeTestZufallszahl(2); Zufall.setzeTestQualitaet(0.4); standort = new Standort(Standorttyp.Standort1); fil1 = new Filiale(standort, ukette); fil1.setzeMitarbeiter(1); fil1.initialisierenKapazitaet(); fil2 = new Filiale(standort, ukette1); fil2.setzeMitarbeiter(1); fil2.initialisierenKapazitaet(); Zufall.setzeTestmodus(false); standort.beeinflussenKunden(ukette, 1); standort.beeinflussenKunden(ukette1, 1); Zufall.setzeTestmodus(true); Zufall.setzeTestZufallszahl(2); Zufall.setzeTestQualitaet(0.4); Produkt p1 = new Produkt(Produkttyp.TEE, 20); Produkt p2 = new Produkt(Produkttyp.KUCHEN, 10); p1.setzePreis(1); p1.setzeQualitaet(0.56); p2.setzePreis(1.2); p2.setzeQualitaet(0.6); ukette.holeLager().einlagern(p1); ukette.holeLager().einlagern(p2); p1.setzePreis(0.8); p1.setzeQualitaet(0.5); ukette1.holeLager().einlagern(p1); // Kette1 bietet Kaffee (P:1; Q:0.56) und Kuchen (P:1.2; Q:0.6) an // Kette2 bietet Kaffe (P:0.8, Q:0.5) an. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int anzahlRundenziel() {\n // TODO: eine Seite aufsetzen mit Informationen zur Datenbank\n // TODO: Anzahl der Einträge pro Tabelle\n int nReturn = 0;\n final Cursor c = mDb.getReadableDatabase().rawQuery(\n \"select count(*) from \" + RundenZielTbl.TABLE_NAME,\n ...
[ "0.6516409", "0.60848683", "0.5882774", "0.5868406", "0.5818903", "0.5769379", "0.57454145", "0.5715526", "0.5691638", "0.56831217", "0.56416315", "0.55812144", "0.5580658", "0.5566053", "0.55420536", "0.5523211", "0.5522815", "0.54738057", "0.546333", "0.54406863", "0.541397...
0.0
-1
TODO Autogenerated method stub
@Override public void onApplicationEvent(ContextStartedEvent event) { System.out.println("start event " + event); }
{ "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
Constructs a new item Requires that none of the inputs are null and p > 0
Item(int i, String n, String c, double p) { this.id = i; this.name = n; this.category = c; this.price = p; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "P createP();", "public Item( Item p ) {\n\t\tif( p != null ) {\n\t\t\tvalue = p.value;\n\t\t\tname = p.name;\n\t\t}\n\t}", "private void makePrioQ()\n\t{\n\t\tprioQ = new PrioQ();\n\t\t\n\t\tfor(int i = 0; i < canonLengths.length; i++)\n\t\t{\n\t\t\tif(canonLengths[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tNode node ...
[ "0.5704168", "0.5649795", "0.5552406", "0.5550814", "0.55089396", "0.5499222", "0.5425714", "0.539696", "0.53710026", "0.53523785", "0.5347332", "0.5328302", "0.5292616", "0.52599216", "0.5237457", "0.52115476", "0.51846653", "0.51824546", "0.5179922", "0.51496947", "0.513293...
0.53331834
11
/ INFO: This method Get the required method from tobeapprove method list and Approves it. if App not found in the list it return false and returns true for happy condition. INPUT: String containing desired App name RETURN: Boolean
public boolean approveApp(String myAppName) { Log.info("Checking if App:" + myAppName + "came for approval"); WebElement myElement = getAppFromList(myAppName); if (myElement != null) { Log.info(myAppName + "came for approval. Approving it now.."); WebElement approveButton = myElement.findElement(By.id("appsEditApprove")); approveButton.click(); app_confrim.click(); if (getAccontDetails(myAppName) != null) { Log.info(myAppName + "is approved now"); return true; } else { Log.info("failed to approve" + myAppName); return false; } } else { Log.info(myAppName + "did not showed up in approval list"); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWe...
[ "0.6133121", "0.58637744", "0.58049905", "0.56893873", "0.56893873", "0.56245726", "0.5618126", "0.5589072", "0.55814934", "0.5566246", "0.5521872", "0.5511616", "0.5405678", "0.53924537", "0.53801525", "0.5373889", "0.53638655", "0.5342499", "0.53038114", "0.528616", "0.5264...
0.69104844
0
/ INFO: This method search for desired app in tobeapprove list INPUT: String containing desired App name RETURN: WebElement ( will contain 'null' if not found )
public WebElement getAppFromList(String myAppName) { WebElement myElement = null; for (WebElement element : allApps) { if (element.getText().contains(myAppName)) { Log.info("App Found"); return element; } } return myElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WebElement getAccontDetails(String myAppName) {\n\t\tLog.info(\"Searching for account details for App: \" + myAppName);\n\t\taccountTab.click();\n\t\tWebElement element = null;\n\t\ttry {\n\t\t\tThread.sleep(2000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.pr...
[ "0.6105588", "0.5755907", "0.56335485", "0.56048226", "0.5417853", "0.53652865", "0.52967966", "0.52389437", "0.5196522", "0.5165188", "0.5090879", "0.50657016", "0.50536776", "0.50391245", "0.49986675", "0.49921536", "0.4984594", "0.49738666", "0.49485406", "0.49409682", "0....
0.75777954
0
/ INFO: This method provides searching desired account based on App names INPUT: String containing desired App name RETURN: RETURN: WebElement ( will contain 'null' if not found )
public WebElement getAccontDetails(String myAppName) { Log.info("Searching for account details for App: " + myAppName); accountTab.click(); WebElement element = null; try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } for (WebElement myelement : allAccounts) { if (myelement.getText().contains(myAppName)) { Log.info("Account details for App" + myAppName + "found"); return myelement; } } Log.info("failed to get account details for App" + myAppName); return element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WebElement getAppFromList(String myAppName) {\n\t\tWebElement myElement = null;\n\t\tfor (WebElement element : allApps) {\n\t\t\tif (element.getText().contains(myAppName)) {\n\t\t\t\tLog.info(\"App Found\");\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\t\treturn myElement;\n\t}", "private static Elements ge...
[ "0.7245342", "0.56928384", "0.54089975", "0.5293681", "0.5077739", "0.50566155", "0.5012349", "0.4993455", "0.4990637", "0.49799663", "0.49777573", "0.49672598", "0.49571142", "0.49471804", "0.49346182", "0.4932054", "0.4930501", "0.49264959", "0.49230915", "0.49156383", "0.4...
0.7196425
1
/ INFO: This method switches Campaign status based on user input i.e considering false = 'disable' and true = 'enable' if user passes true this method will enable the campaign for given app and vice versa INPUT: userValue => boolean, myAppName => String RETURN: VOID
public void switchCampaign(boolean userValue, String myAppName) { Log.info("Trying to get current compaign status for app" + myAppName); boolean currentValue = checkCurrentCampaianStatus(myAppName); WebElement myAccount = getAccontDetails(myAppName); if (userValue != currentValue) { Log.info("Chaging the current compaign status for app" + myAppName); WebElement tab = myAccount.findElement(By.className("adminTable3 ")); WebElement slider = tab.findElement(By.className("slider")); slider.click(); } else { Log.info(myAppName + "is already in desired state. No Action needed"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void switchAccountStatus(boolean userValue, String myAppName) {\n\t\tLog.info(\"Searching for current account status for app\" + myAppName);\n\t\tboolean currentValue = checkAccountAction(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLog.in...
[ "0.70725375", "0.5539794", "0.54287124", "0.5377295", "0.5296427", "0.5287219", "0.5131914", "0.51280254", "0.51169485", "0.5045678", "0.50443006", "0.50443006", "0.4989079", "0.49859798", "0.49823847", "0.4970135", "0.49190098", "0.49174723", "0.49114048", "0.4904377", "0.49...
0.8010035
0
/ INFO: This method will return current campaian status for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public boolean checkCurrentCampaianStatus(String myAppName) { boolean currentValue; Log.info("Searching for current compaign status for app" + myAppName); WebElement myAccount = getAccontDetails(myAppName); WebElement myAccountCampaianStatus = myAccount.findElement(By.className("adminTable3")); String elementPageSource = myAccountCampaianStatus.getAttribute("outerHTML"); boolean ifactive = checkAccountAction(myAppName); if (ifactive) { if (elementPageSource.contains("checked=" + "\"checked\"")) { Log.info(myAppName + " compaign is enabled"); currentValue = true; } else { Log.info(myAppName + " compaign is disabled"); currentValue = false; } return currentValue; } else { if (elementPageSource.contains("disabled=" + "\"disabled\"")) { Log.info(myAppName + " compaign is disabled"); currentValue = false; } else { Log.error(myAppName + " compaign is enabled Which is a deactivatd app"); currentValue = true; } return currentValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkCurrentOfferStatus(String myAppName) {\n\t\tboolean currentValue;\n\t\tLog.info(\"Searching for current compaign status for app\" + myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountOfferStatus = myAccount.findElement(By.className(\"adminTable4 \"));\...
[ "0.6850861", "0.6638901", "0.63945913", "0.63635695", "0.6309649", "0.6278387", "0.62695277", "0.62452704", "0.62452704", "0.62452704", "0.62452704", "0.62452704", "0.6083327", "0.6083327", "0.6083327", "0.6072417", "0.606262", "0.606262", "0.606262", "0.606262", "0.6026459",...
0.7892197
0
/ INFO: This method will return current Offer status for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public boolean checkCurrentOfferStatus(String myAppName) { boolean currentValue; Log.info("Searching for current compaign status for app" + myAppName); WebElement myAccount = getAccontDetails(myAppName); WebElement myAccountOfferStatus = myAccount.findElement(By.className("adminTable4 ")); String elementPageSource = myAccountOfferStatus.getAttribute("outerHTML"); boolean ifactive = checkAccountAction(myAppName); if (ifactive) { if (elementPageSource.contains("checked=" + "\"checked\"")) { Log.info(myAppName + " offer is enabled"); currentValue = true; } else { Log.info(myAppName + " offer is disabled"); currentValue = false; } return currentValue; } else { if (elementPageSource.contains("disabled=" + "\"disabled\"")) { Log.info(myAppName + " offer is disabled"); currentValue = false; } else { Log.error(myAppName + " offer is enabled Which is a deactivated app"); currentValue = true; } return currentValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWe...
[ "0.68721664", "0.6630206", "0.64709383", "0.6332392", "0.5881341", "0.585483", "0.57084656", "0.5693968", "0.5680749", "0.5672589", "0.5639944", "0.5618745", "0.5614241", "0.55942863", "0.5591193", "0.5548944", "0.55476934", "0.55424243", "0.55226326", "0.5516412", "0.550405"...
0.82106894
0
/ INFO: This method switches Account status based on user input i.e considering false = 'disable' and true = 'enable' if user passes true this method will enable the campaign for given app and vice versa INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public void switchAccountStatus(boolean userValue, String myAppName) { Log.info("Searching for current account status for app" + myAppName); boolean currentValue = checkAccountAction(myAppName); WebElement myAccount = getAccontDetails(myAppName); if (userValue != currentValue) { Log.info("Chaging the current account status for app" + myAppName); WebElement tab = myAccount.findElement(By.className("adminTable5")); WebElement slider = tab.findElement(By.id("navButton")); slider.click(); try { Thread.sleep(10000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } app_confrim.click(); } else { Log.info(myAppName + "is already in desired state. No Action needed"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void switchCampaign(boolean userValue, String myAppName) {\n\t\tLog.info(\"Trying to get current compaign status for app\" + myAppName);\n\t\tboolean currentValue = checkCurrentCampaianStatus(myAppName);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tif (userValue != currentValue) {\n\t\t\tLo...
[ "0.67398274", "0.64435446", "0.6172846", "0.61682206", "0.61395234", "0.60906637", "0.60534984", "0.5564542", "0.55485797", "0.55299675", "0.5513603", "0.54180217", "0.5369923", "0.53230363", "0.5299786", "0.52918875", "0.5276039", "0.5246178", "0.5193268", "0.518897", "0.516...
0.68119454
0
/ INFO: This method will return current Account status ( Active/Deactive ) for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public boolean checkAccountAction(String myAppName) { Log.info("Checking current account status for app" + myAppName); boolean currentValue = false; WebElement myAccount = getAccontDetails(myAppName); WebElement Tab = myAccount.findElement(By.className("adminTable5")); String elementPageSource = Tab.getAttribute("outerHTML"); if (elementPageSource.contains("deactivate.png")) { Log.info(myAppName + " account is activated"); currentValue = true; } else { Log.info(myAppName + " account is deactivated"); currentValue = false; } return currentValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAc...
[ "0.8110439", "0.75582117", "0.7353964", "0.7243918", "0.7108234", "0.6686638", "0.653831", "0.63651735", "0.6203867", "0.6175835", "0.6029315", "0.59242445", "0.5920932", "0.59095967", "0.58594495", "0.5824535", "0.58173394", "0.58173394", "0.58173394", "0.5766572", "0.576652...
0.76435345
1
/ INFO: This method will return current Account status active/inactive for given app INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public boolean checkAccountStatus(String myAppName) { Log.info("Checking current account status for app" + myAppName); boolean currentValue; SimpleDateFormat sdfDate = new SimpleDateFormat("dd MMM yyyy"); Date now = new Date(); String strDate = sdfDate.format(now); WebElement myAccount = getAccontDetails(myAppName); WebElement myAccountField = myAccount.findElement(By.xpath("//*[@class='adminTable2 ']")); Log.info(myAccountField.getText()); if (myAccountField.getText().contains("Inactive") && myAccountField.getText().contains(strDate)) { Log.info("current account status for app" + myAppName + "is inactive"); currentValue = true; } else { Log.info("current account status for app" + myAppName + "is active"); currentValue = false; } return currentValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkAccountAction(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue = false;\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement Tab = myAccount.findElement(By.className(\"adminTable5\"));\n\t\tString elementPa...
[ "0.7459833", "0.7424146", "0.7244324", "0.712317", "0.69607675", "0.6524469", "0.6437316", "0.6253495", "0.6177469", "0.60589355", "0.5895189", "0.5895066", "0.5870897", "0.5854983", "0.5839223", "0.5838748", "0.58107805", "0.5809503", "0.5809503", "0.57857186", "0.57813805",...
0.7980579
0
/ INFO: This method will logout from home page INPUT: NULL RETURN: Login Page object
public LoginPage logout() { logoutLink.click(); LoginPage loginPage = new LoginPage(driver, prop); return loginPage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HomePage logout(WebDriver driver) {\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.MILLISECONDS);\n\t\tdriver.findElement(By.xpath(\"/html/body/div[3]/div[1]/div/div/ul/li[3]/a\")).click();\n\t\t\n\t\tlogger.info(\"User is logged out\");\n\t\treturn new HomePage();\n\t}", "private void logout...
[ "0.7756404", "0.75430095", "0.74667054", "0.7426612", "0.74080586", "0.73937106", "0.7377223", "0.7351718", "0.7351718", "0.732464", "0.73166895", "0.7309393", "0.7300037", "0.72906274", "0.72493476", "0.7226966", "0.7139911", "0.7138289", "0.71178824", "0.70800537", "0.70407...
0.79992294
0
/ INFO: This method delete app from data base INPUT: NULL RETURN: VOID
public void deleteApp(String packageName) throws SQLException { String dburl = prop.getProperty("dburl"); String dbuser = prop.getProperty("dbuser"); String dbpw = prop.getProperty("dbpw"); methods_snw.deleteAppFromServer(dburl, dbuser, dbpw, packageName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Result deleteApp(String app);", "@Override\n\tpublic int delApp(int eid) {\n\t\treturn appdao.delapp(eid);\n\t}", "@Delete({ \"delete from iiot_app_list\", \"where app_id = #{appId,jdbcType=INTEGER}\" })\n\tint deleteByPrimaryKey(Integer appId);", "public void deletedb()\n {\n this.appContext.delet...
[ "0.80331963", "0.7566021", "0.7294765", "0.7093077", "0.70611614", "0.6920802", "0.69194186", "0.6892417", "0.6806691", "0.6788675", "0.67451227", "0.66989297", "0.6696177", "0.6686048", "0.65894526", "0.65825945", "0.65550554", "0.6503635", "0.6474643", "0.64638233", "0.6444...
0.7500062
2
/ INFO: This method will reset the verion of app in Database. INPUT: NULL RETURN: VOID
public void updateAppVersion(String appVersion, String appName) throws SQLException { String dburl = prop.getProperty("dburl"); String dbuser = prop.getProperty("dbuser"); String dbpw = prop.getProperty("dbpw"); methods_snw.updateAppVersionOnWeb(dburl, dbuser, dbpw, appVersion, appName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void resetApp() {\n\t\tSession.inResetMode = true;\n\t\t// Stopping alarm and GPS services at reset.\n\t\t// MyAlarmService.cancelMyAlarmService(this.getApplicationContext());\n\t\tif (Sw_LoginScreenActivity.this.stopService(new Intent(Sw_LoginScreenActivity.this, MyAlarmService.class))) {\n\t\t\tMyAlarmSe...
[ "0.6957856", "0.69246364", "0.68103445", "0.6668602", "0.6450354", "0.6188914", "0.61219364", "0.6115564", "0.5985617", "0.58701354", "0.58643246", "0.58604723", "0.5854303", "0.5840103", "0.582643", "0.5812813", "0.5809973", "0.58065647", "0.5776783", "0.5763217", "0.5742316...
0.0
-1
INFO: This method will click the history tab on admin portal.
public void clickHistoryTab(){ History_Tab.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clickOrderHistoryLink()\n\t{\n \telementUtils.performElementClick(wbOrderHistoryLink);\n\t}", "public void clickFreeDaysHistoryMenu() {\r\n\t\tfreeDaysHistoryButton.click();\r\n\t}", "public void AdminLink(){\n\t\tAdminLink.click();\n\t}", "public void clickAdminTab() throws Exception {\n\t\t...
[ "0.7436185", "0.7254325", "0.6926967", "0.67966485", "0.67210686", "0.6709324", "0.6580368", "0.6519598", "0.64376885", "0.63787335", "0.6377543", "0.63168323", "0.6280441", "0.62706196", "0.6256873", "0.6249192", "0.6244019", "0.62439734", "0.6236546", "0.6225168", "0.622215...
0.8264235
0
/ INFO: This method will return current approval status with the approval date for the given app. INPUT: myAppName => String RETURN: boolean, true => 'enable', false => 'disable'
public boolean checkAppApproveStatus(String myAppName) { System.out.println("Checking current account status for app" + myAppName); boolean currentValue; SimpleDateFormat sdfDate = new SimpleDateFormat("dd MMM yyyy"); Date now = new Date(); String strDate = sdfDate.format(now); WebElement myAccount = getAccontDetails(myAppName); WebElement myAccountField = myAccount.findElement(By.xpath("//*[@class='approve_notify']//span]")); System.out.println(myAccountField.getText()); if (myAccountField.getText().contains("Approve") && myAccountField.getText().contains(strDate)) { System.out.println("current approval status for app" + myAppName + "is approved"); currentValue = true; } else { System.out.println("current approval status for app" + myAppName + "is pending"); currentValue = false; } return currentValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean approveApp(String myAppName) {\n\t\tLog.info(\"Checking if App:\" + myAppName + \"came for approval\");\n\t\tWebElement myElement = getAppFromList(myAppName);\n\t\tif (myElement != null) {\n\t\t\tLog.info(myAppName + \"came for approval. Approving it now..\");\n\t\t\tWebElement approveButton = myEle...
[ "0.67194295", "0.6575146", "0.656866", "0.65003043", "0.63033813", "0.63033813", "0.61856467", "0.6139762", "0.6108356", "0.6099527", "0.60697436", "0.6068159", "0.59776354", "0.5966069", "0.59423876", "0.5930808", "0.57989186", "0.57931703", "0.57350296", "0.5723121", "0.570...
0.7939419
0
function to insert elements of the tree to map m
static void insertToHash(Node root, HashSet<Integer> s) { if (root == null) return; insertToHash(root.left, s); s.add(root.data); insertToHash(root.right, s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void treeMapDemo() {\n TreeMap intMap = new TreeMap();\n TreeMap abcMap = new TreeMap();\n \n // Add values to tMap\n intMap.put(1, \"Jonathan\");\n intMap.put(3, \"Kevin\");\n intMap.put(4, \"Craig\");\n \n abcMap.put(\"Name\", \"Jonathan\");\...
[ "0.63555837", "0.6253956", "0.6237054", "0.6024689", "0.59869313", "0.5975098", "0.5962685", "0.58398604", "0.57662153", "0.5739444", "0.5701623", "0.5670206", "0.566682", "0.5663567", "0.56393176", "0.5606058", "0.5572918", "0.5572135", "0.5570387", "0.5566574", "0.55651426"...
0.0
-1
Gets values from standard in Scanner scanner = new Scanner(System.in);
public static void main(String[] args) { Class<?> clazz = ReverseShuffleMerge.class; Scanner scanner = new Scanner( clazz.getResourceAsStream(clazz.getSimpleName() + ".txt")); String input = scanner.next(); scanner.close(); // Gets letter occurrence char minLetter = MAX_ASCII_LOWER + 1; int[] letters = new int[MAX_ASCII_LOWER - MIN_ASCII_LOWER + 1]; for (char letter : input.toCharArray()) { letters[letter - MIN_ASCII_LOWER]++; minLetter = (char) Math.min(minLetter, letter); } // Creates word string builder int wordSize = input.length() / 2; StringBuilder word = new StringBuilder(wordSize); // Loops through letters storing letters that already appeared int[] seenLetters = new int[MAX_ASCII_LOWER - MIN_ASCII_LOWER + 1]; Queue<Character> buffer = new LinkedList<>(); for (int i = input.length() - 1; i >= 0; i--) { char letter = input.charAt(i); int letterIndex = letter - MIN_ASCII_LOWER; seenLetters[letterIndex] += 2; if (letter == minLetter) { // Prints minimum letter as soon as it appears and is still // missing from word if (seenLetters[letterIndex] <= letters[letterIndex]) { word.append(letter); } } else if (seenLetters[letterIndex] > letters[letterIndex]) { // Prints other letters only when inevitable while (!buffer.isEmpty()) { char temp = buffer.poll(); if (temp < letter) { word.append(temp); // seenLetters[temp - MIN_ASCII_LOWER] -= 2; } } word.append(letter); } else { // Sends letter to buffer if (seenLetters[letterIndex] < letters[letterIndex]) { buffer.offer(letter); } } } System.out.print(word.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }", "public void inputScanner(){\n\t\t Scanner sc=new Scanner(System.in); \n\t \n\t\t System.out.println(\"Enter your rollno\"); \n\t\t int rollno=sc.nextInt(); \n\t\t System.out.println(\"Enter your na...
[ "0.7234384", "0.6970491", "0.69697267", "0.67532045", "0.66917855", "0.6667758", "0.66325784", "0.6630381", "0.6626196", "0.6611392", "0.6590251", "0.6585407", "0.6544522", "0.65392214", "0.65153354", "0.6496249", "0.64924765", "0.6486762", "0.6486206", "0.64658344", "0.64406...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View fragmentView = inflater.inflate(R.layout.fragment_quiz_intro_nasilje, container, false); WebView webView = fragmentView.findViewById(R.id.webViewKviz1); webView.loadUrl("file:///android_asset/upute_kviz__nasilje.html"); unbinder = ButterKnife.bind(this, fragmentView); return fragmentView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPA...
[ "0.7884939", "0.7549351", "0.74972624", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", "0.74616987", ...
0.0
-1
///////////////////////////////////////////////////////////////////////// Helper Methods Determines if CDFS is able to create a diagram from the element
protected boolean canDiagramBeCreatedFromElement(IElement pElement) { boolean canCreate = false; if (pElement != null) { // fix for CR 6417670 // IDerivationClassifier is also an instance of IRelationship, so return false only if // pElement is not of type IDerivationClassifier. if (pElement instanceof IDiagram || pElement instanceof ISourceFileArtifact || (pElement instanceof IRelationship && !(pElement instanceof IDerivationClassifier)) ) { return false; } // We shouldn't be able to select elements under an interaction and CDFS. // Therefore, we should disable the CDFS menu if you select any children // of the interaction. IElement owner = pElement.getOwner(); if (owner == null) return false; if (owner instanceof IInteraction || pElement instanceof IMessage || pElement instanceof ICombinedFragment || pElement instanceof IOperation || pElement instanceof IAttribute) { // For operations, we have to make sure the operation can be REed // in order to support CDFS if (pElement instanceof IOperation) { // canCreate = false; // IUMLParsingIntegrator integrator = getUMLParsingIntegrator(); // boolean canRE = integrator.canOperationBeREed((IOperation) pElement); // if (canRE) // { canCreate = true; // } } } else { canCreate = true; } } return canCreate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isDiagram(Filesystem element) {\r\n\t\treturn true;\r\n\t}", "private static boolean isDiagram(ConfigurableUnit element) {\n\t\treturn true;\n\t}", "private static boolean isDiagram(AbstractEditor element){\n\t\treturn true;\n\t}", "public boolean comesFromDiagramElement() {\n ...
[ "0.76409537", "0.7605449", "0.72132593", "0.6979336", "0.62042844", "0.61014634", "0.6043455", "0.6043455", "0.59884936", "0.59387565", "0.5928776", "0.5919256", "0.5878576", "0.585733", "0.5813166", "0.5809937", "0.5783373", "0.57306", "0.57019794", "0.56964076", "0.5676695"...
0.7801333
0
Factory method that creates the desired type of StreamGang subclass implementation.
private static Runnable makeStreamGang(String[] wordList, TestsToRun choice) { switch (choice) { case SEQUENTIAL_STREAM: return new SearchWithSequentialStream(wordList, mInputStrings); case PARALLEL_STREAM: return new SearchWithParallelStream(wordList, mInputStrings); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Inheritance createInheritance();", "private StreamFactory()\n {\n /*\n * nothing to do\n */\n }", "<R> Streamlet<R> newSource(IRichSpout spout);", "GenericSink createGenericSink();", "Reproducible newInstance();", "private StickFactory() {\n\t}", "public static AisPacketStr...
[ "0.5844388", "0.5495362", "0.5474794", "0.5407176", "0.53856856", "0.53375024", "0.5267263", "0.52583086", "0.5151724", "0.51345766", "0.511042", "0.5091778", "0.5074674", "0.50654095", "0.5037952", "0.5032665", "0.50176275", "0.501236", "0.50019723", "0.49911842", "0.4970317...
0.484547
41
This is the entry point into the test program.
static public void main(String[] args) throws Throwable { /* Stream.of(mOneShotInputStrings) .parallel() .forEach(arrayOfStrings -> Stream.of(arrayOfStrings) .parallel() .forEach(string -> Stream.of(mWordList) .parallel() .map(word -> WordMatcher.search(word, string)) .forEach(results -> results.print()))); } */ printDebugging("Starting SearchStreamGangTest"); // Create/run appropriate type of StreamGang to search for words. Stream.of(TestsToRun.values()) .forEach(test -> { printDebugging("Starting " + test); makeStreamGang(mWordList, test).run(); printDebugging("Ending " + test); }); printDebugging("Ending SearchStreamGangTest"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }", "@Test\n public void main() {\n MainApp.main(new String[] {});\n }", "public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }", "@Test\n\tpublic void testMain() {\n\t}", ...
[ "0.81178135", "0.8013764", "0.7851738", "0.7750652", "0.77121854", "0.7657866", "0.7514939", "0.74740905", "0.7459052", "0.7434368", "0.74222714", "0.7361559", "0.7351718", "0.73507166", "0.73464155", "0.7338265", "0.7298572", "0.7275239", "0.72344315", "0.7233278", "0.722394...
0.0
-1
outputs are computed from the synapse list private List outputs;
public List<Synapse> getInputs() { return inputs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Output getOutputs();", "public void setOutputs(ArrayList<Double> outputs)\n {\n this.outputs = outputs;\n }", "public ArrayList<Double> getOutputs()\n {\n return outputs;\n }", "public ArrayList<Double> calculateOutput(){\n for(int i = 0; i < inputSize; i++){\n net...
[ "0.78269017", "0.7559368", "0.750312", "0.7422393", "0.74118584", "0.73950267", "0.7309719", "0.72860837", "0.72013414", "0.7163749", "0.7163749", "0.7163749", "0.71468735", "0.7134493", "0.6888851", "0.68554634", "0.68268305", "0.6816961", "0.6800744", "0.675487", "0.6736319...
0.6082247
73
Sums weighted input signals and produces an output according to the neuron type.
public abstract int calculateOutput();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateOutput() {\n inputSum = 0.0;\n //for output (linear) neuron\n if (layer == 0) {\n for (int i = 0; i < inputs; ++i) {\n inputSum += weights[i] * network.getInput()[i];\n }\n }\n //for Sigmoidal neurons\n else {\n ...
[ "0.63053983", "0.5963177", "0.5763431", "0.5677438", "0.56191945", "0.5609828", "0.55875754", "0.5562895", "0.54889023", "0.53984797", "0.53500444", "0.5261739", "0.52037525", "0.51779085", "0.51718646", "0.5148253", "0.51269007", "0.5124371", "0.50989175", "0.5095264", "0.50...
0.0
-1
Mounts an available index database to the index database object
public IndexDatabase(String index_path) { int k; long p; try { pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r"); pre_file.seek(pre_file.length() - 8); header_pos = read_int(pre_file); pre_file.seek(pre_file.length() - 8 - header_pos); // read the index properties K = read_int(pre_file); mode = read_int(pre_file); ctr_size = read_int(pre_file); pre_len = read_int(pre_file); min_count = read_int(pre_file); max_count = read_int(pre_file); kmers_num = read_long(pre_file); suf_len = K - pre_len; key = new kmer(K, pre_len, suf_len); System.out.println("Indexing " + kmers_num + " kmers... "); // load the prefix file into the memory pre_file.seek(4); int q, len = 1 << (2 * pre_len); prefix_ptr = new long[len]; MappedByteBuffer pre_buff; for (q = 0, p = 0; p < 8; ++p) { pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len); for (k = 0; k < len / 8; ++k, ++q) { prefix_ptr[q] = read_long(pre_buff); } pre_buff = null; } pre_file.close(); // mapping suffix file into the memory suf_rec_size = ctr_size + suf_len / 4; MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size; suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1); suf_parts_size = new long[suf_parts_num]; suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r"); suf_buff = new MappedByteBuffer[suf_parts_num]; for (k = 0; k < suf_parts_num; ++k) { suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]); } // mapping pointers file into the memory MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH; ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1); ptr_parts_size = new long[ptr_parts_num]; ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw"); ptr_buff = new MappedByteBuffer[ptr_parts_num]; for (k = 0; k < ptr_parts_num; ++k) { ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]); } } catch (IOException e) { System.out.println(e.getMessage()); System.exit(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void syncIndex(FundamentalData fd) throws Exception {\n\n List<MarketIndex> indexes = marketIndexService.findBySymbol(fd.getSymbol());\n if(indexes.size()>1){\n throw new Exception(\"Multiple instances (\"+indexes.size()+\") of symbol \"+fd.getSymbol()+\" present in the database.\"...
[ "0.5826022", "0.5690613", "0.55568016", "0.553782", "0.5397263", "0.5369729", "0.5343294", "0.5239177", "0.52003235", "0.5175853", "0.5152517", "0.5150967", "0.51505864", "0.51420325", "0.5103149", "0.5080614", "0.5071591", "0.5071525", "0.5062425", "0.50573957", "0.5037102",...
0.5259567
7
Creates a new index database
public IndexDatabase(String index_path, String genomes_path_file, int K_size, SequenceDatabase genomeDb) { int cores = Runtime.getRuntime().availableProcessors() / 2 + 1; int k; long p; IndexPointer null_pointer = new IndexPointer(); try { Files.createDirectory(Paths.get(index_path)); System.out.println("Running KMC2... "); executeCommand("kmc -r -k" + K_size + " -t" + cores + " -m" + (Runtime.getRuntime().maxMemory() / 1073741824L) + " -ci1 -fm " + (genomeDb.num_genomes > 1 ? "@" + genomes_path_file.trim() : genomeDb.genome_names[1]) + " " + index_path + "/kmers " + index_path); String output = executeCommand("kmc_tools sort " + index_path + "/kmers " + index_path + "/sorted"); if (output.startsWith("This database contains sorted k-mers already!")) { new File(index_path + "/kmers.kmc_pre").renameTo(new File(index_path + "/sorted.kmc_pre")); new File(index_path + "/kmers.kmc_suf").renameTo(new File(index_path + "/sorted.kmc_suf")); //Files.copy(Paths.get(path+"/kmers.kmc_pre"), Paths.get(path+"/sorted.kmc_pre")); //Files.copy(Paths.get(path+"/kmers.kmc_suf"), Paths.get(path+"/sorted.kmc_suf")); } else { new File(index_path + "/kmers.kmc_pre").delete(); new File(index_path + "/kmers.kmc_suf").delete(); } pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r"); pre_file.seek(pre_file.length() - 8); header_pos = read_int(pre_file); pre_file.seek(pre_file.length() - 8 - header_pos); // read the index properties K = read_int(pre_file); mode = read_int(pre_file); ctr_size = read_int(pre_file); pre_len = read_int(pre_file); min_count = read_int(pre_file); max_count = read_int(pre_file); kmers_num = read_long(pre_file); suf_len = K - pre_len; key = new kmer(K, pre_len, suf_len); System.out.println("Indexing " + kmers_num + " kmers... "); // load the prefix file into the memory pre_file.seek(4); int q, len = 1 << (2 * pre_len); prefix_ptr = new long[len]; MappedByteBuffer pre_buff; for (q = 0, p = 0; p < 8; ++p) { pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len); for (k = 0; k < len / 8; ++k, ++q) { prefix_ptr[q] = read_long(pre_buff); } pre_buff = null; } pre_file.close(); // mapping suffix file into the memory suf_rec_size = ctr_size + suf_len / 4; MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size; suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1); suf_parts_size = new long[suf_parts_num]; suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r"); suf_buff = new MappedByteBuffer[suf_parts_num]; for (k = 0; k < suf_parts_num; ++k) { suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]); } // mapping pointers file into the memory MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH; ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1); ptr_parts_size = new long[ptr_parts_num]; ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw"); ptr_buff = new MappedByteBuffer[ptr_parts_num]; for (k = 0; k < ptr_parts_num; ++k) { ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]); } for (p = 0; p < kmers_num; ++p) { put_pointer(null_pointer, p); } } catch (IOException e) { System.out.println(e.getMessage()); System.exit(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createIndex(Index index) {\n Span span = this.tracer.buildSpan(\"Client.CreateIndex\").start();\n try {\n String path = String.format(\"/index/%s\", index.getName());\n String body = index.getOptions().toString();\n ByteArrayEntity data = new ByteArrayEnti...
[ "0.6876626", "0.6870287", "0.67698044", "0.66386825", "0.6595814", "0.652742", "0.6507595", "0.6485415", "0.6478327", "0.6456215", "0.6429751", "0.64169043", "0.6414307", "0.64102507", "0.6403235", "0.63673127", "0.6365072", "0.634749", "0.63363", "0.63001895", "0.6290103", ...
0.0
-1
Updates an available index to include new genomes
public IndexDatabase(String index_path, String genomes_path_file, SequenceDatabase genomeDb, GraphDatabaseService graphDb, int previous_num_genomes) { int cores = Runtime.getRuntime().availableProcessors() / 2 + 1; int i, k, p, trsc, seq_nodes; long c_index, p_index, l, new_kmers_num; IndexPointer null_pointer = new IndexPointer(); Node node; ResourceIterator<Node> nodes; Path old_index_folder; // move current index files to directory old_index try { old_index_folder = Files.createDirectory(Paths.get(index_path+"/old_index")); Files.move(Paths.get(index_path + "/sorted.kmc_pre"), Paths.get(index_path + "/old_index/sorted.kmc_pre")); Files.move(Paths.get(index_path + "/sorted.kmc_suf"), Paths.get(index_path + "/old_index/sorted.kmc_suf")); Files.move(Paths.get(index_path + "/pointers.db"), Paths.get(index_path + "/old_index/pointers.db")); // load old_index IndexDatabase old_index = new IndexDatabase(index_path + "/old_index"); K = old_index.K; // make new index for new genomes System.out.println("Running KMC2... "); executeCommand("kmc -r -k" + K + " -t" + cores + " -m" + (Runtime.getRuntime().maxMemory() / 1073741824L) + " -ci1 -fm " + (genomeDb.num_genomes - previous_num_genomes > 1 ? "@" + genomes_path_file.trim() : genomeDb.genome_names[previous_num_genomes + 1]) + " " + index_path + "/new_kmers " + index_path); // merge two indeces executeCommand("kmc_tools union " + index_path + "/old_index/sorted " + index_path + "/new_kmers " + index_path + "/sorted"); pre_file = new RandomAccessFile(index_path + "/sorted.kmc_pre", "r"); pre_file.seek(pre_file.length() - 8); header_pos = read_int(pre_file); pre_file.seek(pre_file.length() - 8 - header_pos); // read the merged index properties K = read_int(pre_file); mode = read_int(pre_file); ctr_size = read_int(pre_file); pre_len = read_int(pre_file); min_count = read_int(pre_file); max_count = read_int(pre_file); new_kmers_num = read_long(pre_file); kmers_num += new_kmers_num; System.out.println(new_kmers_num + " new kmers generated. "); // load the prefix file into the memory pre_file.seek(4); int q, len = 1 << (2 * pre_len); prefix_ptr = new long[len]; MappedByteBuffer pre_buff; for (q = 0, p = 0; p < 8; ++p) { pre_buff = pre_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + p * len, len); for (k = 0; k < len / 8; ++k, ++q) { prefix_ptr[q] = read_long(pre_buff); //System.out.println(q+" "+prefix_ptr[q]); } pre_buff = null; } pre_file.close(); // mapping suffix file into the memory suf_len = K - pre_len; suf_rec_size = ctr_size + suf_len / 4; MAX_BYTE_COUNT = MAX_BYTE_COUNT / suf_rec_size * suf_rec_size; suf_parts_num = (int) ((kmers_num * suf_rec_size) % MAX_BYTE_COUNT == 0 ? (kmers_num * suf_rec_size) / MAX_BYTE_COUNT : (kmers_num * suf_rec_size) / MAX_BYTE_COUNT + 1); suf_parts_size = new long[suf_parts_num]; suf_file = new RandomAccessFile(index_path + "/sorted.kmc_suf", "r"); suf_buff = new MappedByteBuffer[suf_parts_num]; key = new kmer(K, pre_len, suf_len); for (k = 0; k < suf_parts_num; ++k) { suf_parts_size[k] = (int) (k == suf_parts_num - 1 ? (kmers_num * suf_rec_size) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); suf_buff[k] = suf_file.getChannel().map(FileChannel.MapMode.READ_ONLY, 4 + k * suf_parts_size[0], suf_parts_size[k]); } // mapping pointers file into the memory MAX_BYTE_COUNT = MAX_BYTE_COUNT / POINTER_LENGTH * POINTER_LENGTH; ptr_parts_num = (int) ((kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT == 0 ? (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT : (kmers_num * POINTER_LENGTH) / MAX_BYTE_COUNT + 1); ptr_parts_size = new long[ptr_parts_num]; ptr_file = new RandomAccessFile(index_path + "/pointers.db", "rw"); ptr_buff = new MappedByteBuffer[ptr_parts_num]; for (k = 0; k < ptr_parts_num; ++k) { ptr_parts_size[k] = (int) (k == ptr_parts_num - 1 ? (kmers_num * POINTER_LENGTH) % MAX_BYTE_COUNT : MAX_BYTE_COUNT); ptr_buff[k] = ptr_file.getChannel().map(FileChannel.MapMode.READ_WRITE, k * ptr_parts_size[0], ptr_parts_size[k]); } for (p = 0; p < kmers_num; ++p) { put_pointer(null_pointer, p); } // adjusting available pointers try (Transaction tx = graphDb.beginTx()) { nodes = graphDb.findNodes(DynamicLabel.label("node")); seq_nodes = (int) graphDb.findNodes(DynamicLabel.label("pangenome")).next().getProperty("num_nodes"); tx.success(); } IndexPointer ptr = new IndexPointer(); System.out.println("Updating kmer index... "); for (i = 0; nodes.hasNext();) { try (Transaction tx = graphDb.beginTx()) { for (trsc = 0; trsc < 10000 && nodes.hasNext(); ++trsc, ++i) { node = nodes.next(); l = (long) node.getProperty("first_kmer"); p_index = find(old_index.get_kmer(l)); old_index.get_pointer(ptr, l); put_pointer(ptr, p_index); node.setProperty("first_kmer", p_index); for (l = old_index.get_next_index(l); l != -1L; l = old_index.get_next_index(l)) { c_index = find(old_index.get_kmer(l)); old_index.get_pointer(ptr, l); put_pointer(ptr, c_index); put_next_index(c_index, p_index); p_index = c_index; } put_next_index(-1L, p_index); node.setProperty("last_kmer", p_index); if (i % (seq_nodes / 100 + 1) == 0) { System.out.print((long) i * 100 / seq_nodes + 1 + "% \r"); } } tx.success(); } } old_index.close(); Files.delete(Paths.get(index_path + "/old_index/sorted.kmc_suf")); Files.delete(Paths.get(index_path + "/new_kmers.kmc_pre")); Files.delete(Paths.get(index_path + "/new_kmers.kmc_suf")); Files.delete(Paths.get(index_path + "/old_index/pointers.db")); Files.delete(Paths.get(index_path + "/old_index/sorted.kmc_pre")); //Files.delete(old_index_folder); } catch (IOException e) { System.out.println(e.getMessage() + "\nFailed to make index!"); System.exit(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void updateIndex();", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayL...
[ "0.6985099", "0.6588934", "0.65026206", "0.6369727", "0.62021923", "0.6094138", "0.6044511", "0.59945065", "0.59653753", "0.5870165", "0.5870165", "0.5817983", "0.5725038", "0.5691998", "0.5671577", "0.56199974", "0.5611343", "0.5603455", "0.5475912", "0.5449317", "0.54075927...
0.50037533
80
Gives the length of index.
public long length() { return kmers_num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int length() {\r\n\t\treturn index.length;\r\n\t}", "public int length() { return 1+maxidx; }", "public int length() {\n return nextindex - startIndex;\n }", "int getIndexesCount();", "public int length();", "public int length();", "public int length();", "public int length();", "public i...
[ "0.8569819", "0.82116824", "0.7762646", "0.75263345", "0.7447451", "0.7447451", "0.7447451", "0.7447451", "0.7447451", "0.7398813", "0.7398813", "0.7398813", "0.73702544", "0.73693377", "0.7363487", "0.735119", "0.7339066", "0.7304875", "0.7275255", "0.7274561", "0.7274561", ...
0.0
-1
Gives the prefix length of kmers.
public int get_pre_len() { return pre_len; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long length() {\n return kmers_num;\n }", "private int longestCanonicalPrefixLength()\n\t{\n\t\tAffix currLong; //= this.longestCanonicalPrefix();\n\n\t\tint length;\n\n\t\tif( prefixes.size() < 1 ) {\n\t\t\tlength = 0;\n\t\t} else {\n\t\t\tcurrLong = this.longestCanonicalPrefix();\n\t\t\tlength...
[ "0.77234954", "0.6569389", "0.6391252", "0.6202217", "0.6181078", "0.6118823", "0.61010844", "0.6097451", "0.60055536", "0.59964615", "0.5994521", "0.59818876", "0.5973587", "0.5947285", "0.5933905", "0.5930112", "0.5929897", "0.5928773", "0.5928773", "0.5928338", "0.5919417"...
0.56642574
65
Gives the suffix length of kmers.
public int get_suf_len() { return suf_len; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long length() {\n return kmers_num;\n }", "public int suffixArrayLength() {\r\n return mText.length();\r\n }", "public int getKnownSuffixesCount() {\n if (knownSuffixesBuilder_ == null) {\n return knownSuffixes_.size();\n } else {\n return knownSuffixesBuilder...
[ "0.726541", "0.6685033", "0.65213364", "0.64970565", "0.6176435", "0.6151953", "0.6099317", "0.60983425", "0.607332", "0.6065447", "0.6049843", "0.60447955", "0.600853", "0.600853", "0.600275", "0.59866923", "0.5946989", "0.5907673", "0.59039503", "0.58941305", "0.58941305", ...
0.5545981
72
Closes the index database
public void close() { try { ptr_file.close(); suf_file.close(); int k; for (k = 0; k < ptr_parts_num; ++k) { ptr_buff[k] = null; } for (k = 0; k < suf_parts_num; ++k) { suf_buff[k] = null; } } catch (IOException e) { System.out.println(e.getMessage()); System.exit(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void close() throws IndexException {\n }", "private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}", "public void close() throws IndexerException {\n\t\t//TODO\n\t\t\n\t}", "public void close() {\n\t\t\n...
[ "0.8058744", "0.76378155", "0.758246", "0.75362015", "0.75083023", "0.71673274", "0.7136052", "0.69909674", "0.6962262", "0.6899707", "0.6881291", "0.6881291", "0.68670475", "0.6831806", "0.6819954", "0.6772681", "0.67622286", "0.6728139", "0.66900086", "0.66650426", "0.65936...
0.0
-1
Reads an integer from the byte stream.
private int read_int(RandomAccessFile file) throws IOException { int number = 0; for (int i = 0; i < 4; ++i) { number += (file.readByte() & 0xFF) << (8 * i); } return number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int readInt() throws IOException {\n return in.readInt();\n }", "public int readInt() throws IOException;", "public static final int readInt(InputStream in) throws IOException {\n byte[] buff = new byte[4];\n StreamTool.readFully(in, buff);\n return getInt(buff, 0);\n }", "int readInt() ...
[ "0.7589677", "0.745604", "0.7343956", "0.7236958", "0.7231928", "0.714644", "0.7130498", "0.7094766", "0.6826128", "0.6723859", "0.66989094", "0.668464", "0.6654532", "0.66467506", "0.6641267", "0.6631256", "0.66311204", "0.66090506", "0.6605669", "0.65817565", "0.6575696", ...
0.62032396
57
Reads a long integer from the byte stream.
private long read_long(RandomAccessFile file) throws IOException { long number = 0; for (int i = 0; i < 8; ++i) { number += ((long) (file.readByte() & 0xFF)) << (8 * i); } return number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long readLong() throws IOException;", "public long readLong() throws IOException;", "public long readLong() throws IOException {\n return in.readLong();\n }", "public static final long readLong(InputStream in) throws IOException {\n byte[] buff = new byte[8];\n StreamTool.readFully(in, buff);\n ...
[ "0.8317689", "0.8246908", "0.824032", "0.79463017", "0.7913742", "0.7709309", "0.7627782", "0.7615855", "0.73993635", "0.72097254", "0.71840894", "0.7130915", "0.7092692", "0.7000996", "0.6999538", "0.6993016", "0.69926447", "0.69534385", "0.6897291", "0.68874496", "0.6867397...
0.70973295
12
Reads a long integer from the memory mapped buffer.
private long read_long(MappedByteBuffer buff) throws IOException { long number = 0; for (int i = 0; i < 8; ++i) { number += ((long) (buff.get() & 0xFF)) << (8 * i); } return number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long readLong() throws IOException;", "long readLong() throws IOException;", "public abstract int read_long();", "long readLong();", "public static long readlong()\n\t{\n\t\treturn sc.nextLong();\n\t}", "public long readLong() throws IOException {\n return in.readLong();\n }", "publi...
[ "0.78694624", "0.78141785", "0.77674514", "0.77190524", "0.7567656", "0.7458654", "0.727255", "0.72087413", "0.7130311", "0.7075227", "0.70544606", "0.6948374", "0.6933567", "0.69196874", "0.6899881", "0.679002", "0.67559636", "0.6731585", "0.67195755", "0.67063284", "0.66869...
0.80432767
0
Reads a kmer from th index database.
public kmer get_kmer(long number) { kmer k_mer = new kmer(K, pre_len, suf_len); boolean found = false; int low = 0, high = (1 << (2 * pre_len)) - 1, mid = 0; while (low <= high && !found) { mid = (low + high) / 2; if (number < prefix_ptr[mid]) { high = mid - 1; } else if (number > prefix_ptr[mid]) { low = mid + 1; } else { found = true; } } if (!found) { mid = high; } else { for (; mid < prefix_ptr.length - 1 && prefix_ptr[mid + 1] == prefix_ptr[mid]; ++mid); } k_mer.prefix = mid; suf_buff[(int) (number * suf_rec_size / suf_parts_size[0])].position((int) (number * suf_rec_size % suf_parts_size[0])); suf_buff[(int) (number * suf_rec_size / suf_parts_size[0])].get(k_mer.suffix, 0, suf_len / 4); return k_mer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IndexDatabase(String index_path) {\n int k;\n long p;\n try {\n pre_file = new RandomAccessFile(index_path + \"/sorted.kmc_pre\", \"r\");\n pre_file.seek(pre_file.length() - 8);\n header_pos = read_int(pre_file);\n pre_file.seek(pre_file.lengt...
[ "0.6503544", "0.58549696", "0.58298457", "0.5632296", "0.55087006", "0.5058057", "0.5052891", "0.503855", "0.50131804", "0.49835542", "0.4977191", "0.48612344", "0.48355505", "0.47987166", "0.4795724", "0.4779317", "0.47763258", "0.47763258", "0.47763258", "0.47763258", "0.47...
0.0
-1
Reads a pointer from the kmer index.
public void get_pointer(IndexPointer poniter, long number) { poniter.node_id = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0])); poniter.canonical = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].get((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8)) == 0; poniter.position = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9)); poniter.next_index = ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract int readInternal(int index);", "public long getReadPointer();", "public int[] getIndexPointer(){\r\n \treturn this.index;\r\n \t}", "private WALPointer readPointer(File cpMarkerFile, ByteBuffer buf) throws IgniteCheckedException {\n buf.position(0);\n\n try (FileI...
[ "0.6614945", "0.6533522", "0.635516", "0.6271672", "0.62590826", "0.62590826", "0.62590826", "0.6255022", "0.6207478", "0.6149271", "0.61186194", "0.60756546", "0.5966375", "0.5924649", "0.5843722", "0.58356816", "0.58356816", "0.5804417", "0.5791824", "0.5782883", "0.5738818...
0.5815358
17
Writes a pointer in the index database
public void put_pointer(IndexPointer poniter, long number) { ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]), poniter.node_id); ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].put((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8), (byte) (poniter.canonical ? 0 : 1)); ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), poniter.position); ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), poniter.next_index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getWritePointer();", "protected abstract void writeInternal(int index, int value);", "@Override\r\n\tpublic void write(IByteBuffer target, long offset) {\n\r\n\t}", "@Override\n protected void writeInternal(int index, int value) {\n\n }", "@Override\n protected ...
[ "0.6551198", "0.6415216", "0.5966423", "0.59406936", "0.59406936", "0.5919451", "0.58756727", "0.57795715", "0.57612807", "0.5693024", "0.5681479", "0.5630017", "0.5605925", "0.5598484", "0.5551319", "0.5503368", "0.5476988", "0.54535633", "0.54358786", "0.54186773", "0.54134...
0.64078665
2
Reads the node id of a kmer from the index database.
public long get_node_id(long number) { return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getNodeIndex();", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "NodeId getNodeId();", "@Override public int getNodeId(String name) {\n\t\tint id = node_index_.tryGet(name);\n\t\tif (id == -1) System.err.println(\"Unknown node name=\" + name);\n\t\treturn id;\n\t}"...
[ "0.6272324", "0.61716926", "0.61716926", "0.6099366", "0.59812343", "0.5889243", "0.584015", "0.584015", "0.58311325", "0.57677007", "0.57516545", "0.56938225", "0.56490153", "0.56395054", "0.560418", "0.56018746", "0.55719286", "0.5496584", "0.5491145", "0.5472864", "0.54693...
0.52403116
50
Writes the node id of a kmer into the index database.
public void put_node_id(long node_id, long number) { ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0]), node_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i+...
[ "0.5752877", "0.55147654", "0.54558605", "0.5339208", "0.52023697", "0.5184208", "0.5150775", "0.5119344", "0.5119344", "0.5103429", "0.50957364", "0.50692683", "0.5061059", "0.50225604", "0.5015031", "0.5002563", "0.49884146", "0.4980751", "0.49692342", "0.49638647", "0.4962...
0.5225223
4
Looks if a kmer has been canonical at the first visit.
public boolean get_canonical(long number) { return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].get((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8)) == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isFirst() {\n\t\treturn (prev == null);\n\t}", "protected boolean _isFirstTime() {\n return _firstTime;\n }", "public boolean isFirst() {\n return !hasPrevious();\n }", "@SuppressWarnings(\"unused\")\n public boolean isFirstTime() {\n return firstTime;\n }", ...
[ "0.59918344", "0.5750043", "0.5707491", "0.56456447", "0.55440587", "0.5541954", "0.55274177", "0.55026513", "0.5484003", "0.5434514", "0.5424616", "0.54064584", "0.5352575", "0.53267115", "0.5255478", "0.5236433", "0.5234987", "0.5216274", "0.5183875", "0.51770234", "0.51634...
0.0
-1
Writes the canonical status of a kmer at the first visit.
public void put_canonical(boolean canonical, long number) { ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].put((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 8), (byte) (canonical ? 0 : 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void canonize(int color, StringBuffer canonicalVertexSignature) {\n if (this.getVertexCount() == 0) return;\n \n // Only add a new list of Integers if this is the first time this \n // function is called for a particular root vertex.\n // The labelling that correspond...
[ "0.4980041", "0.47585365", "0.44480968", "0.43847707", "0.43731993", "0.43700278", "0.42995664", "0.4298192", "0.42834753", "0.4253894", "0.42487144", "0.42407176", "0.41991132", "0.41946834", "0.41846094", "0.41830453", "0.4182301", "0.41624606", "0.41616833", "0.40842745", ...
0.4335575
6
Reads the position of a kmer in the node where it occurs.
public int get_position(long number) { return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getPosition() throws IOException\n {\n return (int) randomAccessRead.getPosition();\n }", "public synchronized long getPosition() {\n\t\treturn m_read;\n\t}", "@Override\n\t\tpublic long getPos() throws IOException {\n\t\t\treturn 0;\n\t\t}", "public static int offset_r...
[ "0.6152697", "0.6102783", "0.608616", "0.59681565", "0.5843092", "0.5834955", "0.5834955", "0.5834955", "0.58298254", "0.57823217", "0.57744765", "0.57623184", "0.57444286", "0.57288307", "0.57254153", "0.5687727", "0.56656075", "0.56487405", "0.56377256", "0.5627649", "0.562...
0.0
-1
Writes the position of a kmer in the node where it occurs.
public void put_position(int position, long number) { ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i+...
[ "0.5440271", "0.5031121", "0.49452788", "0.49257421", "0.49104542", "0.4902783", "0.48734972", "0.4863322", "0.48631203", "0.4786421", "0.4779338", "0.4775433", "0.47462967", "0.47462967", "0.47458312", "0.47427472", "0.47199395", "0.47199395", "0.46746504", "0.46714658", "0....
0.46023676
25
Reads the number of the next in the index database.
public long get_next_index(long number) { return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int readerIndex();", "public int nextIndex() {\n\t\t\treturn cursor;\n\t\t}", "public int next() {\n moveToNextIndex();\n return _hash._set[_index];\n }", "public int nextIndex() {\n return curIndex;\n }", "public int nextInt() {\n int temp = results.get(index);\n index = index...
[ "0.67619735", "0.6734448", "0.6557697", "0.6450406", "0.6428978", "0.6398979", "0.63732046", "0.63658047", "0.631205", "0.62624276", "0.6129579", "0.6129332", "0.61276287", "0.60923475", "0.6089478", "0.60816056", "0.6062438", "0.6023321", "0.6011853", "0.5918626", "0.5889609...
0.63818824
6
Writes the number of the next in the index database.
public void put_next_index(long next_index, long number) { ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), next_index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int nextIndex() {\n return curIndex;\n }", "public int nextIndex() {\n\t\t\treturn cursor;\n\t\t}", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "public int nextInt() {\n int temp = results.get(index);\n index = index + 1;\n ...
[ "0.63619393", "0.63564724", "0.6288477", "0.6170552", "0.61421925", "0.61151737", "0.6089959", "0.60428286", "0.6028428", "0.5974196", "0.5963869", "0.5954834", "0.591055", "0.5903457", "0.58556443", "0.5797945", "0.5763323", "0.57574713", "0.5750152", "0.5683381", "0.5657187...
0.6461711
0
Finds the number of a kmer in the database.
public long find(kmer k_mer) { long low, mid, high; int j, comp; low = prefix_ptr[k_mer.prefix]; if (k_mer.prefix == prefix_ptr.length - 1) { high = kmers_num - 1; } else { high = prefix_ptr[k_mer.prefix + 1] - 1; } while (low <= high) { mid = (low + high) / 2; j = (int) (mid * suf_rec_size / suf_parts_size[0]); suf_buff[j].position((int) (mid * suf_rec_size % suf_parts_size[0])); suf_buff[j].get(key.suffix, 0, suf_len / 4); comp = k_mer.compare_suffix(key); if (comp == -1) { high = mid - 1; } else if (comp == 1) { low = mid + 1; } else { return mid; } } return -1L; // not found }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic int kyunggicount() throws Exception {\n\t\treturn dao.kyunggicount();\n\t}", "int findCount();", "public int getGameNumber() {\n\t\tint result = -1;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT count(id) FROM tp.gamerecord\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tresult = rs.getInt...
[ "0.6262294", "0.58835995", "0.5881908", "0.58721864", "0.58371335", "0.5814007", "0.5782743", "0.576411", "0.5756135", "0.57305574", "0.5727463", "0.56991273", "0.56938446", "0.56742764", "0.56727284", "0.56649613", "0.5641435", "0.5596346", "0.55801004", "0.55749923", "0.557...
0.65575945
0