query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Case ID:120896. Test Case Name: Show applications in "COMPANY" list.
@Test public void test01_ShowApplicationsInCOMPANYList() { info("Test 1: Show applications in COMPANY list"); /*Step Number: 1 *Step Name: - Connect to Intranet *Step Description: - Login as a user - Connect to Intranet *Input Data: *Expected Outcome: - The left Navigation is displayed ...
[ "@Test\n public void testGetHostApplicationList_0args() {\n System.out.println(\"getHostApplicationList\");\n CompssDatasourceAdaptor instance = new CompssDatasourceAdaptor();\n instance.setMonitoringDirectory(\"./test_example_files\");\n instance.setMonitoringFile(\"/COMPSs_state_run...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
// normalize // // Compute the distance normalizing factor
private void normalize () { double norm = hypot(a, b); a /= norm; b /= norm; c /= norm; }
[ "double normalizedDistance(double distance);", "public void normalize() {\n double n = FastMath.sqrt(x*x + y*y + z*z + w*w);\n x /= n;\n y /= n;\n z /= n;\n w /= n;\n }", "public void normalize() {\n\t\tcoord = coord.normalize();\n\t}", "public void normalize() {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Read file and populate CountriesList
private void getCountries(File finput) throws Exception{ FileInputStream fis = new FileInputStream(finput); BufferedReader br = new BufferedReader(new InputStreamReader(fis)); String line = null; br.readLine(); /* Read the first line and ignore it */ while ((line = br.readLine()) != null) { /*** modified from...
[ "public static void loadCountries(String filePath){\n File inputFile = new File(filePath);\n // Scans the file if the file path is correctly formatted.\n // If not, returns an error message.\n Scanner scanner = null;\n try {\n scanner = new Scanner(inputFile);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MozuClient mozuClient=GetDBValueClient( appKeyId, dbEntryQuery); client.setBaseAddress(url); client.executeRequest(); JObject json = client.Result();
public static MozuClient<com.fasterxml.jackson.databind.JsonNode> getDBValueClient(String appKeyId, String dbEntryQuery) throws Exception { return getDBValueClient( appKeyId, dbEntryQuery, null); }
[ "public static MozuClient<com.fasterxml.jackson.databind.JsonNode> getDBValueClient(String appKeyId, String dbEntryQuery, String responseFields) throws Exception\r\n\t{\r\n\t\tMozuUrl url = com.mozu.api.urls.platform.SecureAppDataUrl.getDBValueUrl(appKeyId, dbEntryQuery, responseFields);\r\n\t\tString verb = \"GET\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Write a for loop that prints the odd integers 11 through 121 inclusive, separated by spaces.
public static void main(String[] args) { for (int i=11; i<=121; i+=2){ System.out.print(i +" "); } }
[ "public static void printOddInt() {\n\t\t\n\t\t//For Loop\n\t\tfor(int i=4; i<10; i++) {\n\t\t\tif(i%2!=0) {\n\t\t\t\tSystem.out.print(i + \" \");\n\t\t\t}\n\t\t}\n\t}", "public static void printOddNumbers (int from, int to) {//when we dont know the range\n for(int i=from; i<=to; i++){\n if(i%...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the URIs for the Article Types which can be displayed on the Recent Articles tab on the home page. If there is no list of acceptable Article Type URIs, then an empty List is returned. This method should never return null. As an example, this XML is used to create a List of two Strings for the PLoS One Journal: &lt;...
private List<URI> getArticleTypesToShow(String basePath) { String baseString = basePath + ".typeUriArticlesToShow"; List<URI> typeUriArticlesToShow; /* * Iterate through the defined article types. This is ugly since the index needs to be given * in xpath format to access the element, so we calcu...
[ "public List<URI> getType();", "List<URI> getURIs();", "default List<URI> getUris(String identifier, MimeType mimeType) throws ResourceIOException {\n return getUris(identifier).stream()\n .filter(u -> MimeType.fromURI(u).matches(mimeType))\n .collect(Collectors.toList());\n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ trimSampleName Remove extra letters from sample names
public void trimSampleName() { for (int i = 0; i < numSample; i++) { sampleName.set(i, sampleName.get(i).alphaNumSign().removeExtraWhite()); sample[i].name = sample[i].name.alphaNumSign().removeExtraWhite(); } }
[ "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/================================================= Verify Enabled Status of an Object
public static void verifyEnabledStatus(By byObj, Boolean status) throws IllegalArgumentException, IllegalAccessException, IOException { Boolean currentStatus = getEnabledStatus(byObj); String sObjName = getObjectName(byObj); if (status.equals(true)) { if (currentStatus.equals(true)) { TestNotify.pass(GenLo...
[ "boolean isSetObjectives();", "boolean isInternalStateCheckingEnabled();", "boolean isCheckinEnabled(CalObject object);", "boolean hasIsControlled();", "boolean getObjTure();", "public static void isElementEnabled(WebElement element) {\n \tboolean elementEnabled= element.isEnabled();\n \t\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets the array of messages to be shown and updates the table.
void setMessages(ArrayList<Message> messages) { this.messages = messages; fireTableDataChanged(); }
[ "public void refreshMessages() {\r\n messagesTxtArea.append(controller.getModel().getNewMessage() + \"\\n\");\r\n }", "public void displayMessages(ArrayList<String> messages) {\n \t\n \tif (!txMessages.getText().isEmpty()) { \n \t\ttxMessages.clear();\n \t}\n \tfor (int i = 0; i < message...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.DeleteBackUp deleteBackUp = 12;
public boolean hasDeleteBackUp() { return msgCase_ == 12; }
[ "edu.usfca.cs.dfs.StorageMessages.DeleteBackUp getDeleteBackUp();", "boolean hasDeleteBackUp();", "public edu.usfca.cs.dfs.StorageMessages.DeleteBackUp getDeleteBackUp() {\n if (msgCase_ == 12) {\n return (edu.usfca.cs.dfs.StorageMessages.DeleteBackUp) msg_;\n }\n return edu.usfca.cs.dfs....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method handles the lookup of the correct datasource factory It uses a filter to obtain a reference to the correct DataSourceFactory and returns it.
protected DataSourceFactory lookupDsf(String driverName) { System.out.println("Lookup (" + driverName + ")"); String filter = "(&("+DataSourceFactory.OSGI_JDBC_DRIVER_CLASS+"="+driverName+"))"; ServiceReference<?>[] refs = null; try { refs = context.getServiceReferences(DataSourceFactory.class.getN...
[ "@Override\n public IDataSourceFactory getDataSourceFactory() {\n if (this.dataSourceFactory == null) {\n this.dataSourceFactory = getObjectFactory().getNamedObject(\"dataSourceFactory\", IDataSourceFactory.class);\n if (this.dataSourceFactory == null) {\n log.debug(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Using the URI scheme for showing a location found on a map. This superhandy intent can is detailed in the "Common Intents" page of Android's developer site:
private void showPreferedLocationOnMap() { if ( null != mAdapter ) { Cursor c = mAdapter.getCursor(); if ( null != c ) { c.moveToPosition(0); String posLat = c.getString(COL_COORD_LAT); String posLong = c.getString(COL_COORD_LONG); ...
[ "public void showMap(EventClass event) {\n //GET SEARCH URI\n String location = event.location.getDisplayName()+\" \"+event.location.getCountry();\n Uri geoLocation = Uri.parse(\"geo:0,0?q=\"+location);\n\n Intent intent = new Intent(Intent.ACTION_VIEW, geoLocation);\n intent.setP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fix for URL rewriting
private String fixURLRewriting(Request req, String redirectURI ) { ServerSession session=req.getSession( false ); if( session != null && Request.SESSIONID_FROM_URL.equals(req.getSessionIdSource())) { String id=";jsessionid="+req.getSessionId() ; redirectURI += id ; } return redirectURI; ...
[ "String replaceUrl();", "protected abstract String urlPostfix();", "static String fix(String url) {\n int index = url.indexOf(\"://\");\n\n // absolute url\n if (index > 0) {\n String suffix = url.substring(index + 3).replaceAll(\"//\", \"/\");\n\n url = url.substring(0, index + 3).concat(suf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility to update a foreignkey (and distinguisher) in the element in the case of a unidirectional 1N relationship.
private boolean updateElementFk(DNStateManager ownerSM, Object element, Object owner) { if (element == null) { return false; } validateElementForWriting(ownerSM.getExecutionContext(), element, null); boolean retval; ExecutionContext ec = ownerSM.getExecu...
[ "private boolean setForeignKeys( EntityInstanceImpl ei )\n {\n final EntityDef entityDef = ei.getEntityDef();\n final Set<EntityInstanceImpl> srcInstances = fkSourcesForEi.get( ei );\n if ( srcInstances == null || srcInstances.size() == 0 )\n return true; // No FKs to set.\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate we are using Google Cloud. Should be called in all Providers in this module. This allows us to install this module and rely on Guiceified flag parsing, and not do a separate parse to conditionally install this module. TODO: Can this be removed? In the new modular structure, will this code only be run/loaded fo...
private void validateUsingGoogle(String cloud) { if (!cloud.equals(GOOGLE_CLOUD_NAME)) { throw new IllegalStateException( "Injecting Google objects when cloud != Google! (cloud was " + cloud); } }
[ "boolean hasIsGoogleCn();", "private boolean supportsGooglePlayServices() {\n return GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) ==\n ConnectionResult.SUCCESS;\n }", "boolean getIsGoogleCn();", "boolean isGoogleServicesAvailable();", "@java.lang.Override\n public boo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field optFloatVal is set (has been assigned a value) and false otherwise
public boolean isSetOptFloatVal() { return this.optFloatVal != null; }
[ "public boolean isSetFloatVal() {\n return this.floatVal != null;\n }", "public boolean isFloat() { return (asFloat() != null); }", "public void setFloat(boolean value) {\r\n\t\tisFloatType = value;\r\n\t}", "public boolean isfloat() {\n return type == DDFType.DDF_FLOAT;\n }", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Traverse nodeList and check if there is a package with a particular qualified name.
private static Node<EcucEntry> locatePackageWithQName(List<Node<EcucEntry>> nodeList, String packageQName) { String[] qName = MetaModelUtils.splitQualifiedName(packageQName); int index = 0; List<Node<EcucEntry>> children = nodeList; Node<EcucEntry> pack = null; while (index < qName.length) { String name...
[ "@Override\n public boolean packageExists(String name) {\n return head.packageExists(name) || tail.packageExists(name);\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static boolean checkPackage(String packageName) {\r\n\t\tList<String> packages = (List<String>) ContextInformation\r\n\t\t\t\t.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method corresponds to the database table AAM_CITY_BUILDING
CityBuilding selectByPrimaryKey(String building);
[ "public void buildCity() {\n\t}", "public void setBuildingArea(String buildingArea) {\n this.buildingArea = buildingArea;\n }", "@Override\n public List<Building> allBuildings() {\n return dao.all(Building.class);\n }", "public void setBuildingId(Long buildingId) {\n this.buildin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if this test some how failure, this mean that Jetty client now be able to switch between HTTP/1 and HTTP/2.2 protocol dynamically therefore rolling updates will be easier we should then notify this to users
public void testConnectToOldNodesUsingHttp2() throws Exception { JettyConfig jettyConfig = JettyConfig.builder() .withServlet(new ServletHolder(Http2SolrClientTest.DebugServlet.class), "/debug/*") .useOnlyHttp1(true) .build(); createAndStartJetty(legacyExampleCollecti...
[ "@Test\n public void testEarlyUpgrade() throws Exception\n {\n ChannelPoolManagerFactoryImpl channelPoolManagerFactory =\n new ChannelPoolManagerFactoryImpl(_eventLoopGroup, _scheduler,\n SSL_SESSION_RESUMPTION_ENABLED, _newPipelineEnabled, HttpClientFactory.DEFAULT_CHANNELPOOL_WAITER_TIMEOUT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if shortName can not be translated, return shortName
public static String shortToLong(String shortName) { String longName = languagesByShortName.get(shortName); // MsgTextPane.write("shortToLong "+shortName+" > "+longName); if (longName == null) { return shortName; } else { return longName; } ...
[ "public static String longToShort(String longName) {\n String shortName = languagesByLongName.get(longName);\r\n// MsgTextPane.write(\"longToShort \"+longName+\" > \"+shortName);\r\n if (shortName == null) {\r\n return longName;\r\n } else {\r\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called by RPC to deallocate ID for 'consumer'.
public synchronized void deallocateId(MaapiChannel maapiChannel, String poolName, String consumer) throws ResourceAllocationException { IdPoolList idPools = new SingtelRm().resourceManager().pools().idPool(); if (!idPools.elem(poolName)._exists(maapiChannel)) { throw new ResourceAllocationEx...
[ "@Override\n public void freeId( long id )\n {\n }", "public synchronized void deallocateObject(MaapiChannel maapiChannel, String poolName, String consumer) throws ResourceAllocationException {\n ObjectPoolList objectPools = new SingtelRm().resourceManager().pools().objectPool();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
it is used to set visible a number equal to quantity of ImageView ( resources, leaderCard, DevCard)
public static void settingImageView(int quantity, ImageView... resources){ String path = "/images/res-marbles/"; for(int i = 0; i < quantity; i++){ resources[i].setImage(new Image(path + resourceString)); resources[i].setVisible(true); } for(int i = quantity; i <...
[ "private void ShowImage() {\n binding.imvImageContainer.setVisibility(View.VISIBLE);\n binding.tbarAdd.setElevation(Utility.dpToPx(10));\n binding.clyAddTbar.setElevation(10);\n }", "public void assigncards(int card,ImageView image)\n {\n switch(card)\n {\n case...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the currentSkill of the Player
public final Skill getCurrentSkill() { return this.mCurrentSkill; }
[ "java.lang.String getSkill();", "public String getSkill() {\r\n return skill;\r\n }", "public Skill getSkill() {\n return skill;\n }", "Skill getSkill();", "public String getSkillName()\n {\n return skillName;\n }", "public Player getCurrentPlayer() {\n return this.currentP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
inject corresponding cookies to the requst message
public void inject(@NotNull ApiRequestMessage message) { String key = getHashKey(message); Map<String, String> cookies = redisTemplate.<String, String>opsForHash().entries(key); StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> cookie : cookies.entrySet()) { ...
[ "public void receive(CookieMessage msg);", "HttpClientRequest addCookie(Cookie cookie);", "public void setResponseCookies(HashMap cookies);", "Response addCookie(Cookie cookie);", "public void addCookie (HttpCookie cookie);", "Response addCookie(String name, String value);", "private void parseCookie(){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Writes the averages and bounds to a file for storage
private static void writeToFile(String measurementName, Double median, ArrayList<Double> Bounds) throws IOException { File dataFile = new File("analysis.txt"); FileWriter writer = new FileWriter(dataFile, true); BufferedReader reader = new BufferedReader(new FileReader(dataFile)); String line; String...
[ "public void writeOverallAverageToFile() {\n\t\ttry {\n\t\t\tString filename = \"selectionAvg.txt\";\n\t\t\tString folder_name=\"2_Filter/selection/\";\t\t\n\t\t\t\n\t\t\n\t\t\tFile file = new File(filepath+folder_name);\n\t\t//\tFile file = new File(filepath+\"/selection\");\n\t\t\t//String folder_name=\"2_Filter/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets value as the attribute value for the calculated attribute SrcId
public void setSrcId(Number value) { setAttributeInternal(SRCID, value); }
[ "private void setSrcId(int value) {\n \n srcId_ = value;\n }", "private void addSrcId(int value) {\n ensureSrcIdIsMutable();\n srcId_.addInt(value);\n }", "public void setSrcCtryId(Number value) {\r\n setAttributeInternal(SRCCTRYID, value);\r\n }", "public...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method calculates the shipping fees of order
public int calculateShippingFee(Order order) { Random rand = new Random(); int fees = (int) (((rand.nextFloat() * 10) / 100) * order.getAmount()); LOGGER.info("Order Amount: " + order.getAmount() + " -- Shipping Fees: " + fees); return fees; }
[ "public void calculateShipFee(Order order) {\n }", "public BigDecimal getShipping_fee() {\n return shipping_fee;\n }", "public double calculateFees(){\n switch (reservation.getRouter().getModel()) {\n case \"Huawei310\":\n fees = (reservation.numberOfRentingDays)*2;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "QMark" $ANTLR start "Colon"
public final void mColon() throws RecognitionException { try { int _type = Colon; int _channel = DEFAULT_TOKEN_CHANNEL; // src/grammar/TL.g:231:10: ( ':' ) // src/grammar/TL.g:231:12: ':' { match(':'); } state.typ...
[ "private STNode parseColon() {\n STToken nextToken = peek();\n if (nextToken.kind == SyntaxKind.RE_LITERAL_CHAR &&\n nextToken.text().equals(Character.toString(LexerTerminals.COLON))) {\n return getToken(consume(), SyntaxKind.COLON_TOKEN);\n } else {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleAgreeLibrary" $ANTLR start "entryRuleAgreeSubclause" InternalAgreeParser.g:242:1: entryRuleAgreeSubclause returns [EObject current=null] : iv_ruleAgreeSubclause= ruleAgreeSubclause EOF ;
public final EObject entryRuleAgreeSubclause() throws RecognitionException { EObject current = null; EObject iv_ruleAgreeSubclause = null; try { // InternalAgreeParser.g:243:2: (iv_ruleAgreeSubclause= ruleAgreeSubclause EOF ) // InternalAgreeParser.g:244:2: iv_ruleAgre...
[ "public final EObject entryRuleAgreeSubclause() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleAgreeSubclause = null;\n\n\n try {\n // ../com.rockwellcollins.atc.agree/src-gen/com/rockwellcollins/atc/agree/parser/antlr/internal/InternalAgree.g:199:2: (iv_r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Synchronizes nodes to DataStore based on their modification state which results in create/update/remove of Node.
public void syncNodes(Node dataAfter, Node dataBefore) { if (isControllerConfigNode(dataAfter, dataBefore)) { LOG.trace("{} is ignored by VPP-renderer", CONTROLLER_CONFIG_NODE); return; } // New node if (dataBefore == null && dataAfter != null) { creat...
[ "@Transactional\n public abstract void updateNode(OnmsNode node);", "void nodeUpdated(Node n) throws RepositoryException;", "static void forceSync(DatasetGraphTDB dsg) {\n dsg.getTripleTable().getNodeTupleTable().getNodeTable().sync();\n dsg.getQuadTable().getNodeTupleTable().getNodeTable().syn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The set of statuses to filter time off requests
public TimeOffRequestQueryBody statuses(List<StatusesEnum> statuses) { this.statuses = statuses; return this; }
[ "List<Lookup> getServiceRequestStatuses();", "ResponseEntity<List<Status>> findTaskStatuses();", "@RequestMapping(value=\"/statuses\", method=RequestMethod.GET, produces={MediaType.APPLICATION_JSON_VALUE})\n\tpublic @ResponseBody List<RequestStatus> getRequestStatuses() {\t\n\t\treturn Arrays.asList(RequestStat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function browse the Element and (recursively)its children and count the number of keyword in the inner html
private int getKeywordCount(Element element) { List<Node> children = element.childNodes(); ArrayList<String> potentialKeywords = new ArrayList<String>(); Pattern wordPattern; int res = 0; int wordIndex = 0; for(Node n : children) { if(!n.nodeName().equals("#text")) { res += ge...
[ "@Basic\n @Override\n public final int getNbOccurrencesOf(Object element) {\n // Re-implementation for reasons of efficiency.\n return (getRootElement().equals(element) ? 1 : 0);\n }", "public int getDescendantCount();", "void countTagStatistics(){\t\n\t\thtmlParsed.traverse(new NodeVisit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET /:id : get the "id" session.
@Path("/{id}") @GET public Response getSession(@PathParam("id") Long id) { log.debug("REST request to get Session : {}", id); Session session = sessionRepository.find(id); return Optional.ofNullable(session) .map(result -> Response.status(Response.Status.OK).entity(sessio...
[ "Session get(int id);", "SessionToken getSession(int id);", "InternalSession findSession(String id);", "public Session getSession(String id) {\r\n return sessionMap.get(id);\r\n }", "synchronized Session getSession(long id) {\n return (Session) sessionMap.get(id);\n }", "public static ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a course and its grade
public void addCourseGrade(String course, int grade) { courses[numCourses] = course; grades[numCourses] = grade; ++numCourses; }
[ "public void addCourse(String course, Double grade) {\r\n this.courses.put(course, grade + 1);\r\n \r\n }", "void addCourse(Course course);", "public void addGrade(String course, double grade){\n this.courses.add(course);\n this.grades.add(grade);\n }", "public void addCourse( dou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether this view reacts to context clicks or not.
public boolean isContextClickable() { throw new RuntimeException("Stub!"); }
[ "public boolean onContextClick(android.view.View v);", "boolean hasClickView();", "public boolean isClickTouchScreen() {\n return impl.isClickTouchScreen();\n }", "public boolean isClicked() {\n\n if (!longPress) {\n BoundingBox bound = getCollisionBox();\n if (clickID !...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For each date, summarizedHR11val = (0 + 4 + 8) = 12
@Test void historicalPrecipitationDataSummarizerTestsForSummarizedHR11val() throws Exception { assertEquals(12.0, main.HistoricalPrecipitationDataSummarizer.summarizeHistoricalPrecipitationData("src/example/Example Station 1.csv").get("02-26").get(1 + 6 * 11)); assertEquals(12.0, main.HistoricalPrecipitationDataSu...
[ "@Test\n\tvoid historicalPrecipitationDataSummarizerTestsForTotalCountOfValuesInSummarizedHR11val() throws Exception {\n\t\tassertEquals(3.0, main.HistoricalPrecipitationDataSummarizer.summarizeHistoricalPrecipitationData(\"src/example/Example Station 1.csv\").get(\"02-26\").get(4 + 6 * 11));\n\t\tassertEquals(3.0,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs an empty HashMap with minimum minBuckets buckets and maximum maxBuckets buckets. These lower and upper bounds on the number of buckets should be maintained at all times! Expected complexity: O(minBuckets)
HashMap(int minBuckets, int maxBuckets) { if(minBuckets < 1 || minBuckets > maxBuckets || maxBuckets > TWO_TO_THE_28){ throw new IllegalArgumentException("\nError! Creating a HashMap," + " the following should be true: 1 <= minBuckets <= maxBuckets <= 2^28\n"); } ...
[ "HashMap(int minBuckets) {\r\n this(minBuckets, DEFAULT_MAX_CAPACITY);\r\n }", "public IntHistogram(int buckets, int min, int max) {\n \t// some code goes here\n this.min = min;\n this.max = max;\n this.buckets = new int[buckets];\n for(int i=0;i<buckets;++i){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a line representing the line from the given point outwards at the given angle that goes as far as the nearest obstacle
public static Line getLOS(float startx, float starty, float angle){ // Get the diagonal length of the screen, which is the max length line possible float a = Settings.getWindowWidth(); float b = Settings.getWindowHeight(); float screenDiagonal = (float)Math.sqrt((a*a) + (b*b)); ...
[ "public StdLine toStdLine() {\n \n StdLine stdLine = new StdLine();\n \n //System.out.println(\" pt->line: \"+pt.toString()+\" heading:\" +heading);\n \n double den = pt.y*Math.cos(heading) - pt.x*Math.sin(heading);\n\n // NavPoints parallel to x-axis need special h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the predicate to the default one where all is true.
void resetPredicate();
[ "public void setToDefaultPredicate() {\n this.currentPredicate = this.defaultPredicate;\n this.categoryName = this.defaultCategoryName;\n }", "default boolean every( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Endpoint: get_script_languages Returns available script types, languages and contexts
public CompletableFuture<GetScriptLanguagesResponse> getScriptLanguages() throws IOException { return this.transport.performRequestAsync(GetScriptLanguagesRequest.INSTANCE, GetScriptLanguagesRequest.ENDPOINT, this.requestOptions); }
[ "public GetSupportedLanguagesResponse getSupportedLanguages();", "public abstract String[] getAvailableLanguages();", "public Future<List<String>> getAvailableLanguages() throws DynamicCallException, ExecutionException {\n return call(\"getAvailableLanguages\");\n }", "public Future<List<String>> ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GeometricFigure gf = new GeometricFigure(); System.out.println(GeometricFigure.a); Rectangle r = new Rectangle(); r.sayHello();
public static void main(String[] args) { Rectangle r1 = new Rectangle(10, 20); System.out.println(r1.areaToPerimeterRatio()); Rectangle r2 = new Rectangle(1, 2); System.out.println(r2.areaToPerimeterRatio()); Rectangle r3 = new Rectangle(5, 5); System.out.println(r3.areaToPerimeterRatio()); Circle c...
[ "public static void main(String[] args){ Rectangle box1 = new Rectangle(5,4);\n// System.out.println(box1.getArea());\n// System.out.println(box1.getPerimeter());\n//// Rectangle box2 = new Square(5);\n// System.out.println(box2.getArea());\n// System.out.println(box2.getPe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
costruttore della classe rotta, riceve in ingresso il numero di citta e le citta lette dalla classe LeggiXML, che saranno passate nel main tramite i due metodi get della classe citata poco prima.
public Rotta(String nome,int numeroCitta,ArrayList<Citta> cittaLette) {//arrivano dal main this.nome=nome; mappa=new HashMap<Integer,LinkedList<Citta>>(); this.numeroCitta=numeroCitta; for(int i=0;i<numeroCitta;i++) mappa.put(i, new LinkedList<>()); this.cittaLette=cittaLette; }
[ "public ListaTacos(){\n\t\ttry{\n\t\t\tLectorXML lector=new LectorXML();\n\t\t\tLinkedList<Taco> ligada=lector.readLinkedList(\"src/BaseDeDatos/TaqueriaSaturno.xml\");\n\t\t\tHashtable<String,Taco> tabla=lector.readHashtable(\"src/BaseDeDatos/TaqueriaMercurio.xml\");\n\t\t\tTaco[] arreglo=lector.readArray(\"src/Bas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XVariableDeclaration__Group_2_0_0__1" $ANTLR start "rule__XVariableDeclaration__Group_2_0_0__1__Impl" ../org.xtext.guicemodules.ui/srcgen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:12504:1: rule__XVariableDeclaration__Group_2_0_0__1__Impl : ( ( rule__XVariableDeclara...
public final void rule__XVariableDeclaration__Group_2_0_0__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:12508:1: ( ( ( rule_...
[ "public final void rule__XVariableDeclaration__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:3015:1: ( ( ( r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Triggers buffs at the end of the turn
private void triggerEndOfTurnBuffs() { }
[ "private void triggerStartOfTurnBuffs()\r\n\t{\r\n\t\tfor(GameObjectState state : map.getObjectStatesOnTeam(this.team))\r\n\t\t{\r\n\t\t\tfor(Buff buff : state.getBuffs())\r\n\t\t\t{\r\n//\t\t\t\tif(buff.getParameters().get)\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void doTurn() {\n\t\tGFrame.getInstance().aiHold();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Atomic__Group_9__4" $ANTLR start "rule__Atomic__Group_9__4__Impl" InternalDsl.g:33845:1: rule__Atomic__Group_9__4__Impl : ( '(' ) ;
public final void rule__Atomic__Group_9__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDsl.g:33849:1: ( ( '(' ) ) // InternalDsl.g:33850:1: ( '(' ) { // InternalDsl.g:33850:1: ( '(' ) // ...
[ "public final void rule__Atomic__Group_4__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDsl.g:33378:1: ( rule__Atomic__Group_4__1__Impl )\n // InternalDsl.g:33379:2: rule__Atomic__Group_4__1__Impl\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Warning this method won't work in the case the id_plani fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Planilla)) { return false; } Planilla other = (Planilla) object; if ((this.id_plani == null && other.id_plani != null) || (this.id_plani != null && !this.id_plani.equals(other.id_plani))) { ...
[ "public void setPlanId(Integer planId) {\n this.planId = planId;\n }", "private void abrirPlanParaEditar() {\n final AdaptadorTablaPlanTrabajoAcademia planSeleccionado = obtenerPlanSeleccionado();\n posicionSeleccionada = planesTabla.indexOf(planSeleccionado);\n if (planSeleccionado...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
register 1 to n IFlushListener
public void registerFlushListener(IFlushListener iFlush) { callbacks.add(iFlush); }
[ "@Override\n public void subscribe(FlowableEmitter<Integer> e) throws Exception {\n for (int i = 0; i < 128; i++) {\n Log.e(TAG, \"emit \" + i);\n e.onNext(i);\n }\n }", "private final void listen(){\n IntSetIterator ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper Method to check for NULL response object
protected boolean validateResponseNotNull(Object response, String responseObjectName) throws OffAmazonPaymentsServiceException { return Utilities.validateResponseNotNull(response, responseObjectName); }
[ "public boolean isNilErrorResponse() {\n synchronized (monitor()) {\n check_orphaned();\n\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString) get_store()\n .find_element_user(ERRORRE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Splits the enumerable into multiple enumerables using the provided predicate(s).
public Enumerable<T>[] split(Predicate<T>... predicates) { Enumerable<BiPredicate<T, Integer>> biPredicates = Enumerable.of(predicates).map(x -> (y, i) -> x.test(y)); return split(biPredicates.toArray()); }
[ "public Enumerable<T>[] split(BiPredicate<T, Integer>... predicates) {\n IteratorSplitter<T> splitter = new IteratorSplitter<>(this, predicates);\n\n return Enumerable.of(predicates)\n .map(x -> new Enumerable<T>(() -> splitter.getIterator(x)))\n .concat(new Enumerable<T>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "NMSTART" $ANTLR start "NMCHAR"
public final void mNMCHAR() throws RecognitionException { try { // /Volumes/Mercurial/web-main/css.lib/src/org/netbeans/modules/css/lib/Css3.g:856:25: ( '_' | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '-' | NONASCII | ESCAPE ) int alt9=7; int LA9_0 = input.LA(1); if...
[ "public final void mNMSTART() throws RecognitionException {\n try {\n // /Volumes/Mercurial/web-main/css.lib/src/org/netbeans/modules/css/lib/Css3.g:849:25: ( '_' | 'a' .. 'z' | 'A' .. 'Z' | NONASCII | ESCAPE )\n int alt8=5;\n int LA8_0 = input.LA(1);\n\n if ( (LA8...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies each of a set of symbolizers in turn to a given feature. This is an internal method and should only be called by processStylers.
private void processSymbolizers(final Feature feature, final Symbolizer[] symbolizers) { for (int m = 0; m < symbolizers.length; m++) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("applying symbolizer " + symbolizers[m]); } resetFill(graphics);...
[ "private void processStylers(final FeatureCollection features,\n final FeatureTypeStyle[] featureStylers) {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"processing \" + featureStylers.length + \" stylers\");\n }\n \n for (int i = 0; i < featureStylers.length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__RootElementType__LanguageAssignment_7" $ANTLR start "rule__ExtendedAddress__StreetAssignment_3" ../org.xtext.example.mydsl.extensions.ui/srcgen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:1825:1: rule__ExtendedAddress__StreetAssignment_3 : ( ruleString0 ) ;
public final void rule__ExtendedAddress__StreetAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:1829:1: ( ...
[ "public final void rule__Address_Impl__StreetAssignment_3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Spring Data MongoDB repository for the Copie entity.
@SuppressWarnings("unused") @Repository public interface CopieRepository extends MongoRepository<Copie, String> { }
[ "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ClipExtractRepository extends MongoRepository<ClipExtract, String> {\n\n}", "public interface ElecPoleRepository extends MongoRepository<ElectricPole, String> {\n\t\n\t/**\n\t * Find ElectricPole by id.\n\t *\n\t * @param _id the id\n\t * @return the e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the position length of this Token. The default value is one.
public void setPositionLength(int positionLength);
[ "public void setLength(long length);", "private void setTokenLength() {\n\t\tfor (Token ts : Token.values()) {\n\t\t\tif (ts.getValue().length() == 1) ts.setOneChar(true);\n\t\t\telse ts.setOneChar(false);\n\t\t}\n\t}", "public void setLengthOverride(int length) throws CodeUnitInsertionException;", "public vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests to see if the expected number of results returns when searching from ACFT root for the System
@Test public void testSearchFromAcftRootForSystem() throws Exception { InventoryKey lOpenedFrom = AIRCRAFT_KEY; // get default arguments DataSetArgument lArguments = getDefaultArguments( lOpenedFrom ); lArguments.add( "aShowInitialized", false ); lArguments.addWhereLike( "rvw_inv_task...
[ "@Transactional\n\t@Test\n\tpublic void test_advancedSearch_resultReturnsNumMeaningfulUse() throws InvalidArgumentsException {\n\t\tSearchRequest sr = new SearchRequest();\n\t\tsr.setPageNumber(0);\n\t\tsr.setPageSize(50);\n\t\tsr.setOrderBy(\"developer\");\n\t\tsr.setSortDescending(true);\n\t\tsr.setDeveloper(\"Ve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if element has two children in the heap
private boolean hasTwoChildren(int i) { int left=left(i); int right=right(i); int sizee=heap.size(); if(left<sizee-1 && right<sizee-1){ return true; } return false; }
[ "public boolean isHeap() \n {\n \tint childIndex;\n \tfor (int i=0 ; i < this.getSize() ; i++) {\n \t\tfor (int j=1 ; j <= this.d ; j++) {\n \t\t\tif( (childIndex=child(i, j, this.d))>=this.getSize() ) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tif ( array[i].getKey()>array[childIndex].getKey...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all the participants with a given class name
public Collection<BlockingParticipant> getParticipants(String className) { // check if the provided participant name has been remembered as the // first participant of a certain class if (repParticipantClassnames.containsKey(className)) { ArrayList<BlockingParticipant> pa...
[ "public List<CfgParticipant> customFindByParticipantName(String name) {\r\n\t\tQuery q1 = new Query(where(\"i18n.i18nFields.string\").is(name));\r\n\t\tLOG.info(q1.getQueryObject());\r\n\t\treturn this.getMongoTemplate().find(q1, CfgParticipant.class);\r\n\t}", "public Participant searchParticipant(String partici...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the subscriber function id.
public int getSubscriberFunctionId() { return subscriberFunctionId; }
[ "String getFunctionId();", "public Integer getSubscriberID()\r\n\t{\r\n\t\treturn subscriber_id;\r\n\t}", "long getListenerId();", "public java.lang.String getSubscriberId() {\n return subscriberId;\n }", "int getSubscriptionId();", "String getSubscriptionId();", "@Override\n public String ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the asynchronous request failed, supplying a cause for failure.
void onFailure(Throwable cause);
[ "public void onFailure(HttpRequestException requestException);", "public void requestFailed(RequestFailureEvent e);", "private void requestFailed() {\n EventBus.getDefault().post(new PlanEvents.PlansUpdateFailed());\n }", "public void downloadFailed(Throwable t);", "@Override\n public void on...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'PRPSL_LN_KEY_ID' field.
public java.lang.Long getPRPSLLNKEYID() { return PRPSL_LN_KEY_ID; }
[ "public java.lang.Long getPRPSLLNKEYID() {\n return PRPSL_LN_KEY_ID;\n }", "public void setPRPSLLNKEYID(java.lang.Long value) {\n this.PRPSL_LN_KEY_ID = value;\n }", "public java.lang.Long getPRPSLLNQTRKEYID() {\n return PRPSL_LN_QTR_KEY_ID;\n }", "public java.lang.Long getPRPSLLNQTRKEYID() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends and returns a new empty "in1" element
public org.xmlsoap.schemas.soap.encoding.String addNewIn1() { synchronized (monitor()) { check_orphaned(); org.xmlsoap.schemas.soap.encoding.String target = null; target = (org.xmlsoap.schemas.soap.encoding.String)get_store().add_elem...
[ "public org.apache.xmlbeans.XmlObject addNewIn()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlObject target = null;\r\n target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(IN$6);\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the tweets message
public void setMessage(String message) throws TweetTooLongException;
[ "public void setTweetMessage( String _strTweetMessage )\n {\n this._strTweetMessage = _strTweetMessage;\n }", "public void setTweetText(String tweetText) {\n\t\ttweetTxt.setText(tweetText);\n\t}", "ImportantTweet(String message){\n super(message);\n }", "public void tweet() {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAssignmentContent Access all AssignmentContent objects known to us (not from external providers).
protected List getAssignmentContents(String context) { List contents = m_contentStorage.getAll(context); return contents; }
[ "public AssignmentContent getContent()\n\t\t{\n\t\t\tAssignmentContent retVal = null;\n\t\t\tif (m_assignmentContent != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tretVal = getAssignmentContent(m_assignmentContent);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tM_log.warn(\":getContent() \" + ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the template entry in the database if it is the current template selected.
public void removeTemplate(String template) { SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.query("Preferences", new String[] {"LastTemplate"}, null, null, null, null, null); if (cursor.moveToNext()) { String current = cursor.getString(0); if (templa...
[ "public void deleteTemplate(Template template)\n\t{\n\t\tTemplateDAO dao = new TemplateDAO();\n\t\tdao.delete(template);\t\t\n\t\t//return template.getId();\n\t}", "public void removeFromDatabase(Template template) throws DAOException {\n templateDAO.remove(template);\n }", "private void removeTemplat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stop the thread pool.
public void stop() { pooltg.stop(); }
[ "@Override\n public void stop() {\n scheduler.shutdown();\n try {\n // Wait a while for existing tasks to terminate\n if (!scheduler.awaitTermination(THREAD_EXECUTOR_SHUTDOWN_AWAIT_TIME_IN_SEC, TimeUnit.SECONDS)) {\n scheduler.shutdownNow(); // Cancel currently ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all type picking listeners for a specific picking type.
public void removeAllTypePickingListeners(String pickingType) { Set<IPickingListener> pickingListeners = typePickingListeners.get(pickingType); if (pickingListeners == null) { return; } pickingListeners.clear(); }
[ "public void removeAllPickingListeners() {\n\t\tidPickingListeners.clear();\n\t\ttypePickingListeners.clear();\n\t}", "public void removeAllIDPickingListeners(String pickingType, int pickedObjectID) {\n\n\t\tHashMap<Integer, Set<IPickingListener>> map = idPickingListeners.get(pickingType);\n\t\tif (map == null) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Accept. Criteria: Story 32 Add Grade Group to Driver The grade group is displayed when the driver is displayed.
public void testExistingDriverHasGradeGroup() throws MalBusinessException{ unallocatedDriverId = ((BigDecimal)em.createNativeQuery(TestQueryConstants.READ_DRIVER_ID_UNALLOCATED).getSingleResult()).longValue(); driver = driverService.getDriver(unallocatedDriverId); assertNotNull("Grade Group does not exist for d...
[ "public void addGrade (int grade){\n this.grade.add(grade);\n }", "@Override\n\tpublic void recordVisitAssessment(String matriculation, UoGGrade grade,\n\t\t\tString description) {\n\t\t//Add grade thing\n\t\tSystem.out.println(\"Send an email to \" + matriculation + \" & employer to let them kn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiate custom Output Queue.
private BoundedWorkQueue createOutputQueue(int aQueueSize) throws Exception { // Get the class that implements the queue if (cpeFactory.getCPEConfig().getOutputQueue() != null && cpeFactory.getCPEConfig().getOutputQueue().getClass() != null) { String outputQueueClass = cpeFactory.getCPEConfig(...
[ "public static OutputQueue createOutputThread() {\n\tfinal OutputQueue queue = new OutputQueue();\n\tThread t = new Thread() {\n\t public void run() {\n\t\tUtterance utterance = null;\n\t\tdo {\n\t\t utterance = queue.pend();\n\t\t if (utterance != null) {\n\t\t\tVoice voice = utterance.getVoice();\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
C++: void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, vector_Point2f prevPts, vector_Point2f& nextPts, vector_uchar& status, vector_float& err, Size winSize = Size(21,21), int maxLevel = 3, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags = 0, double minEigThreshold = ...
private static native void calcOpticalFlowPyrLK_0(long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_mat_nativeObj, long nextPts_mat_nativeObj, long status_mat_nativeObj, long err_mat_nativeObj, double winSize_width, double winSize_height, int maxLevel, int criteria_type, int criteria_maxCount, double criteri...
[ "public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel, TermCriteria criteria, int flags, double minEigThreshold)\n {\n Mat prevPts_mat = prevPts;\n Mat nextPts_mat = nextPts;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Failure test for the getDigitalRunPointsType(long pointsTypeId) method with the pointsTypeId is negative. IllegalArgumentException is expected.
public void testGetDigitalRunPointsType_WithNegativeId() throws Exception { try { impl.getDigitalRunPointsType(-1); fail("IllegalArgumentException should be thrown."); } catch (IllegalArgumentException e) { // expected } }
[ "public void testCreateDigitalRunPointsType_WithIdPositive() throws Exception {\r\n DigitalRunPointsType pointsType = new DigitalRunPointsType();\r\n pointsType.setId(2);\r\n try {\r\n impl.createDigitalRunPointsType(pointsType);\r\n fail(\"IllegalArgumentException should ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(Attempt to) send a message to the given receiver The message must exist in the default lang.yml or lang.yml on disk
public void sendMessage(String messagePath, CommandSender receiver) { sendMessage(messagePath,receiver,new LinkedHashMap<>()); }
[ "public static void send(MessageReceiver r, Text message) {\n\t\tsend(r, message, null);\n\t}", "public void send(String msg) {\n sender.sendMessage(msg);\n }", "public boolean send(String to, String msg);", "public void send(Message msg);", "public abstract void send(String destination, Message m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add an short and long option(CliOptStruct class)
public void addOption(char _argShort, String _argLong, String _description, boolean _argReq, boolean _valReq) { opts.add(new CliOptStruct(_argShort, _argLong, _description, _argReq, _valReq)); }
[ "public void addOption(char _argShort, String _description, boolean _argReq, boolean _valReq) {\r\n\t\tCliOptStruct opt = new CliOptStruct(_argShort, \" \", _description, _argReq, _valReq);\r\n\t\topts.add(opt);\r\n\t}", "public void addOption(String _argLong, String _description, boolean _argReq, boolean _valRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A data entry field that is preserved on a completion item between a completion and a completion resolve request. .google.protobuf.Any data = 17;
public com.google.protobuf.Any getData() { return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; }
[ "com.google.protobuf.Any getData();", "com.google.protobuf.AnyOrBuilder getDataOrBuilder();", "public com.google.protobuf.AnyOrBuilder getDataOrBuilder() {\n return getData();\n }", "com.google.protobuf.Any getContent();", "com.google.protobuf2.Any getContent();", "com.google.protobuf.ByteString getDa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Casts this to a VoidType or returns null if not a VoidType.
public VoidType asVoid() { return null; }
[ "public static RVoid getVoidType(StructuralView structuralView) {\r\n for (Type type : structuralView.getTypes()) {\r\n if (RVoid.class.isInstance(type)) {\r\n return (RVoid) type;\r\n }\r\n }\r\n \r\n return null;\r\n }", "public boolean isVoid()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests sobre el repositori Test que comprova que repositoriEscola es un component
@Test public void test_repositori_es_component() { Assert.assertNotNull(repositori); }
[ "@Test\n public void testAdicionandoEmOrdem() {\n \n \n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "@Test\n public void testRegionCRUD() throws Exception {\n PaqueteComponent principal = new RegionComponent(\"Europa\");\n PaqueteComponent pais1 = new Reg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a tag entity by its tag type code and display name.
public TagEntity getTagByTagTypeAndDisplayName(String tagTypeCode, String displayName);
[ "public TagEntity getTagByKey(TagKey tagKey);", "Tag findByName(String name);", "public Object getTag(String tagName);", "Object getTag();", "java.lang.String getTag();", "Tag findByName(final String name);", "@VTID(91)\r\n java.lang.String getTag();", "public String getFromTag();", "String getTag(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getComputer is the factory Method
Computer getComputer(ComputerType type, String model, String cores, String memory, String disk);
[ "Computer getComputerById(long id);", "public void getComputer() {\n\n\t\tSystem.out.println(\"\\n***************** GET A COMPUTER ***********************************\\n\");\n\t\tshowComputers();\n\n\t\tSystem.out.println(\"\\nchoose a computer to check (ID of the computer):\");\n\t\tint id = HelperCli.getIntInpu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns path of work log for a given baseDir, network, snapshot, and workId. This function is a temporary helper until filebased logging in batfish worker is abstracted away.
public static @Nonnull Path getWorkLogPath( Path baseDir, NetworkId network, SnapshotId snapshot, String workId) { return new FileBasedStorage(baseDir, null).getWorkLogPath(network, snapshot, workId); }
[ "String getFullWorkfileName();", "public static String getInstanceWorkerIdRootNodePath() {\n return String.join(\"/\", \"\", ROOT_NODE, COMPUTE_NODE, WORKER_ID);\n }", "java.lang.String getQuerylogsPath();", "public static String getInstanceWorkerIdNodePath(final String instanceId) {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns, as a java.sql.Date object, the value at the current row and at the column identified by col which should be a CycVariable in the original query. Returns null if no value is set for the current row and given column. NOTE: Fails on dates that are not CycNauts using $YearFn (i.e. it will not work on skolemized da...
@Override public Date getDate(int colIndex) throws CycApiException, IllegalArgumentException, ArrayIndexOutOfBoundsException, ClassCastException { Object obj = getObject(colIndex); return new Date(DateConverter.parseCycDate(((Naut) NautImpl.convertIfPromising(obj))).getTime()); }
[ "public java.util.Date getDateColumn(String column)\n {\n if (! hasColumn(column))\n throw new IllegalArgumentException(\"No such column \" + column);\n \n String name = canonicalize(column);\n \n if (isColumnNull(name))\n return null;\n \n Object value = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'nama_hari' field.
public java.lang.CharSequence getNamaHari() { return nama_hari; }
[ "public java.lang.CharSequence getNamaHari() {\n return nama_hari;\n }", "public java.lang.CharSequence getNamaKelas() {\n return nama_kelas;\n }", "public String getNama()\n {\n return this.nama;\n }", "public String getNama(){\r\n return this.namaBangunDatar;\r\n }", "public...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sun's JAXB FAQ states that their implementation of JAXBContext is threadsafe. So let's create a cache for them. We try to get the 99,99% case fast and unsychronized.
private static JAXBContext getJAXBContext(Class<?> klass) throws JAXBException { String packageName = klass.getPackage().getName(); // Quick unsychronized try, if it works, hurray! JAXBContext context = jaxbContextCache.get(packageName); if (context != null) { return context; } // Dammit. ...
[ "private JAXBContext getJaxContext()\n {\n JAXBContext jc = null;\n \n try\n {\n jc = JAXBContext.newInstance(\"generated\");\n }\n catch (JAXBException e)\n {\n e.printStackTrace();\n }\n return jc;\n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a UML style qualified class name string like RM::org::openehr::rm::entity::physical_entity::...::class_name to a fixed depth form like org.openehr.rm.entity.class_name (for pkgDepth = 4) For generic types, the result will be something like org.openehr.rm.data_types.DV_INTERVAL what we need is org.openehr.rm.dat...
String convertToQualified (String umlQualifiedTypeName) { String qualifiedTypeName = packageQualifiedClassName (umlQualifiedTypeName, packageDepth); if (qualifiedTypeName.contains("<")) { StringBuilder genericTypeNameSb = new StringBuilder(qualifiedTypeName.substring(0, qualifiedTypeName.ind...
[ "protected String packageQualifiedClassName (String umlQualifiedName, int pkgDepth) {\n String[] parts = umlQualifiedName.split (\"::\");\n int depth = Math.min(parts.length, pkgDepth);\n if (parts.length > depth) {\n StringBuilder sb = new StringBuilder();\n for (int i = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
RC: best results so far are scanWithNIODirectoryStreamAsyncCounting and scanWithListFilesAsyncCounting they are in 5% from each other, and I think it is not a significant difference given quite pure benchmark quality. Interesting facts: seems like larger FJP pool (FJP_X2) performs slightly worse than commonPool. This s...
@Test public void scanWithListFilesNoop() throws IOException { final long startedAtNs = System.nanoTime(); scanDirectoryWithListFiles(ROOT, dir -> { return true; }, file -> { ...
[ "public static void main(String[] args) {\n\n /* public static Stream<Path> list(Path dir) throws IOException\n - List the contents of a directory */\n try (Stream<Path> files = Files.list(Path.of(\"D:\\\\Java\"))) { /* we put our Stream objects inside a\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the Accrual Interval Change
public double accrualChange() { return _dblAccrualChange; }
[ "public double interval() {\n return interval;\n }", "public int get_interval() {\n return (int)getUIntBEElement(offsetBits_interval(), 16);\n }", "protected AtomicInteger getTimeInterval() {\n return timeInterval;\n }", "public int getAvpfRrInterval();", "public double getRate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Does the file exist on a parent branch. This is called only when the given fileId is not found on a child branch. We want to determine if the file exists on the branch's parent branches, so this method 'walks' up the branch tree until it gets to the Trunk. If it gets to the trunk without finding the file then it return...
private boolean doesFileExistOnParentBranch(Branch branch, int fileId) { boolean foundFileOnParentBranch = false; ProjectView projectView = ViewManager.getInstance().getView(projectName, branch.getBranchName()); if (projectView.getRemoteViewProperties().getParentProjectName() != null) { ...
[ "public static boolean fileExistsChild() {\n try {\n ManagerView.readFile = new Scanner(new File(\"TicketFiles\\\\\" + CustomerEntry.ticketNumber+\".txt\"));\n } catch (FileNotFoundException e) {\n return false;\n } catch (NullPointerException e) {\n return true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The condition of org.eclipse.core.runtime.Assert.isLegal is considered always true and alters the following analysis suitably.
public void testBug127575l() { this.runNegativeTest( new String[] { "Test.java", "public class Test {\n" + " void foo(Object a, Object b, Object c) {\n" + " org.eclipse.core.runtime.Assert.isLegal( a == null);\n " + " if (a!=null) {\n" + " System.out.println(\"a is not null\");\n" + ...
[ "public void testBug127575h() {\n\t\tthis.runNegativeTest(\n\t\t\tnew String[] {\n\t\t\t\t\"X.java\",\n\t\t\t\t\"public class X {\\n\" +\n\t\t\t\t\" void m() {\\n\" +\n\t\t\t\t\" X foo = new X();\\n\" +\n\t\t\t\t\"\t org.eclipse.core.runtime.Assert.isLegal (foo != null);\\n\" +\t// redundant check - don't warn\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method populates Attribute Data type Map.
private void populateAttributeDatatypeMap() { this.attributeDatatypeMap.put("specimenClass", "string"); this.attributeDatatypeMap.put("container", "string"); }
[ "private void initializeAttributes() {\r\n\t\tif (attributes == null)\r\n\t\t\tattributes = new TreeSet<>();\r\n\t\tfor (T dataObject : dataList)\r\n\t\t\tif (dataObject instanceof IKeyValueProvider) {\r\n\t\t\t\tIKeyValueProvider<?> keyValueStore = (IKeyValueProvider<?>) dataObject;\r\n\t\t\t\tMap<String, Class<?>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scales this notification by the link traversal depth.
public EmissionNotification scale(Percentile scale, int depth, Direction dir) { final float scalar = (float) Math.pow(scale.floatValue(), depth); final Percentile scaled = intensity.scale(new Percentile(scalar)); return new EmissionNotification(this.key(), scaled, dir.reverse()); }
[ "private void scalePath() {\n\t\tgeometry = getOrCreateGeometry();\n\t\tlengthPathDevice = geometry.lengthOfPath();\n\t\tuserWidth = max - min;\n\t\tunitUserToDevice = new Double(lengthPathDevice) / userWidth;\n\t}", "@Override\n public void graph(double note) {\n currentNote = scaleNote(note);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format open type, depending on status.
public String formatOpenType(OpenType openType) { if (openType == null) { return "null"; } switch (openType.getStatus()) { case OPENING_SOON: StringBuffer buf = new StringBuffer(formatWeekday(openType)); buf.append(", "); buf.append(formatDateTime(openType.getDateTime())); return buf.toString(); ...
[ "public String getIssueStatusClass() {\r\n String statusName = getStatusName().trim().toLowerCase();\r\n\r\n if (statusName.equals(ISSUE_STATUS_RESOLVED.toLowerCase())\r\n || statusName.equals(ISSUE_STATUS_CLOSED.toLowerCase())) {\r\n return \"resolved\";\r\n } else if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use SCDailyLootMapRevival.newBuilder() to construct.
private SCDailyLootMapRevival(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); }
[ "private CSDailyLootMapRevival(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "@NotNull public static Reservoir.Builder reservoir() { return new Reservoir.Builder(new HashMap<String,Object>()); }", "private CSLoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the dtCriacao value for this ResultadoBuscarListaUFUF.
public void setDtCriacao(java.util.Calendar dtCriacao) { this.dtCriacao = dtCriacao; }
[ "public void setDataCadastroCota(Date dataCadastroCota) {\n\t\tif(dataCadastroCota != null){\n\t\t\tthis.dataCadastroCota = new DateTimeDB(dataCadastroCota.getTime());\n\t\t} else{\n\t\t\tthis.dataCadastroCota = null;\t\n\t\t}\n\t}", "public java.util.Calendar getDtCriacao() {\n return dtCriacao;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get admin by branch
public static JSONObject getAdminByBranch (JSONObject inputJson){ JSONObject returnJson = new JSONObject(); try{ Branch branch = BranchDAO.getBranchById((long)inputJson.get(Key.BRANCHID)); if(branch != null){ Admin admin = branch.getAdmin(); returnJson.put(Key.STATUS, Value.SUCCESS); returnJson.pu...
[ "HibBranch getBranch(InternalActionContext ac, HibProject project);", "java.lang.String getAdmin();", "int getBranchId();", "String getBranchName();", "IBranch getBranch(String pBranchString) throws AditoGitException;", "java.lang.String getBranchId();", "public String getUserBranch() {\r\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor for CircularLinkedList with int value
public CircularLinkedList(int value){ data = value; next = null; prev = null; }
[ "public Node(int value){ \n this.value = value;\n this.next = null;\n }", "public Node(int item) {\n intItem = item;\n next = null;\n }", "public CircularList(int elements) {\n }", "public ValueNode(int value) {\n setValue(value);\n }", "public Nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize this event with the specified source JPPF client and Job.
public ClientQueueEvent(final JPPFClient client, final JPPFJob job, final JPPFPriorityQueue queue) { super(client); this.job = job; this.queue = queue; }
[ "public Request(StartingJob job) { setJob( job );}", "public void setJob( StartingJob job ) { this.job = job;}", "void onJobStarted(Job job) {}", "JobClient createJobClient();", "public void init(int jid, Job job, Queue queue, Queue workerQueue\r\n\t\t\t,JobStateCache jobStateCache, JobQueueController jobQu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets sub type at the index.
@NotNull public Optional<GenericDeclaration> getSubTypeAt(final int index) { return index >= this.subTypes.size() ? Optional.empty() : Optional.ofNullable(this.subTypes.get(index)); }
[ "public Type getMember(int index);", "public int typeIndex();", "public static EquipmentSubType getEquipmentSubType(int index) {\r\n EquipmentSubType[] equipmentSubType = EquipmentSubType.values();\r\n\r\n return equipmentSubType[index];\r\n }", "public ChildType getChildAt( int index );", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Required. Instance type. .google.cloud.datafusion.v1beta1.Instance.Type type = 3 [(.google.api.field_behavior) = REQUIRED];
public Builder setType(com.google.cloud.datafusion.v1beta1.Instance.Type value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; type_ = value.getNumber(); onChanged(); return this; }
[ "public void setInstanceType(String instanceType) {\n this.instanceType = instanceType;\n }", "public void setInstanceType(String instanceType) {\n this.instanceType = instanceType;\n }", "@java.lang.Override\n public com.google.cloud.datafusion.v1beta1.Instance.Type getType() {\n com.goog...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests collection of the 1st key. The payer navigates to the top of the totem pole and collects.
@Test public void testTotemPole() { //Moves the player to the top totem pole game.goRoom2("south"); game.goRoom2("south"); game.goRoom2("up"); //Takes the key game.take(); //Checks the key has been collected assertEquals(game.player.searchInventory...
[ "@Test\n public void testAllItemsRegularlyPriced() {\n Order order = bakeshop.startNewOrder(LocalDate.of(2020, 9, 3)); // Thursday\n\n // Treat Ids -> Brownie -> 1, Cheesecake ->2 , Cookie -> 3, Donut -> 4\n order.addTreat(bakeshop.getInventory().getTreatById(3), 1); // 1 x Cookie -> $1.25 (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the connector the given connector end belongs to.
public static Connector getConnector(final ConnectorEnd connectorEnd) { EObject container = connectorEnd.eContainer(); if (!(container instanceof Connector)) { throw new IllegalArgumentException("The eContainer of the connector end is not an instance of Connector!"); } ret...
[ "public static ConnectorEnd getConnectorEnd(final Port port) {\n if (port.getEnds().isEmpty()) {\n throw new IllegalArgumentException(\"The given port has no connector ends.\");\n }\n // TODO [BR] A port can have multiple connector ends. If this this is necessary, this method\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts the given params into the table "simulation_parameters". The identifier for the simulation in this table will be the given sim_key.
public void writeToDB(Connection con, String sim_key, Map<String, String> params) throws SQLException { PreparedStatement prepareStatement = null; try { prepareStatement = con.prepareStatement( "INSERT INTO " + "simulation_parameters (" + "sim_key, " + "param_key, " + "pa...
[ "public void deleteInDB(Connection con, String sim_key, Map<String, String> params) throws SQLException {\n PreparedStatement prepareStatement = null;\n try {\n prepareStatement = con.prepareStatement(\n \"DELETE FROM \" + \"simulation_parameters WHERE sim_key=? AND param...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the given SID has the given permission.
public boolean hasPermission(String sid, Permission p) { for (; p != null; p = p.impliedBy) { Set<String> set = grantedPermissions.get(p); if (set != null && set.contains(sid)) return true; } return false; }
[ "boolean hasPermission(String permission);", "public boolean checkPermission(Permission permission);", "int hasPrivileges(Privileges privilegeLevel, String sid);", "@Override\n\tpublic boolean can(String permission)\n\t{\n\t\treturn this.auth() != null && this.auth().getRole() != null && this.auth().getRole()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }