query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Gets the value of the numberOfNights property.
public int getNumberOfNights() { return numberOfNights; }
[ "public void setNumberOfNights(int value) {\n this.numberOfNights = value;\n }", "public int getNbKnight() {\n\t\treturn nbKnight;\n\t}", "private Integer getNightCount() {\n SharedPreferences mSharedPreferences = getSharedPreferences(\"Night Count\", MODE_PRIVATE);\n Integer nightCount ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new preferences object.
private Preferences() { }
[ "public Preference() {\n\n }", "@Override\n\tpublic UserPreferences newInstance() {\n\t\treturn new UserPreferences();\n\t}", "public UserPreferences() {\n\t\tthis(\"user_preferences\", null);\n\t}", "private PreferencesModule() {\n }", "public Prefs() {\r\n\r\n }", "public static Preferences get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validation of calendar DMYcount
public abstract boolean isValid(DMYcount DMYcount);
[ "private boolean checkValidDay() {\n return numDays >= 0 && numDays <= 7;\n }", "void validateDays(int days) throws YakShopException;", "public long getCountInvalidFormatDates() {\n\t\treturn countInvalidFormatDates;\n\t}", "void validateDates(ComponentSystemEvent event);", "@Test\n\tpublic void t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////// Static Methods //////////////////////// Returns the statistic descriptors for TPCCStats.
public static StatisticDescriptor[] getStatisticDescriptors() { boolean largerIsBetter = true; return new StatisticDescriptor[] { factory().createIntGauge ( VM_COUNT, "When aggregated, the number of VMs using this statistics object.", "VMs" ), factory().createIntC...
[ "java.util.List<org.tensorflow.proto.profiler.XStat> \n getStatsList();", "public int[] getStats() {\n\t\tint[] stats = new int[9];\n\t\tstats[0] = getIntelligence();\n\t\tstats[1] = getStrength();\n\t\tstats[2] = getPresence();\n\t\tstats[3] = getWits();\n\t\tstats[4] = getDexterity();\n\t\tstats[5] = getMa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints a ticket for the client after they reserve a seat (also prints to the console)
public Ticket printTicket(String boxOfficeId, Seat seat, int client) { try { // Create and print the ticket Ticket ticket = new Ticket(show, boxOfficeId, seat, client); ticketsSold.add(ticket); numTicketsSold++; System.out.println(ticket); Thread.sleep...
[ "void printTicketSeat(String soldSeat)\n {\n\tSystem.out.println(hostName + \",\" + threadName + \" got one ticket\");\n\n }", "public Ticket printTicket(String boxOfficeId, Seat seat, int client) {\r\n\t\tif (seat == null &&printer==false) {\r\n\t\t\tthis.printer=true;\r\n\t\t\tSystem.out.println(\"Sorry, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column cal_fault_elevator.ele_model
public void setEle_model(String ele_model) { this.ele_model = ele_model == null ? null : ele_model.trim(); }
[ "public void setElevator(Elevator elevator){\r\n\t\tthis.elevator = elevator;\r\n\t}", "public String getEle_model() {\n\t\treturn ele_model;\n\t}", "public void setElevator(double elevator) {\n send(\"flight/elevator \", String.valueOf(elevator));\n }", "public void setModeloEquipamento(com.gvt.www...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the live ordered list of initializer expressions in this for statement. The list should consist of either a list of so called statement expressions (JLS2, 14.8), or a single VariableDeclarationExpression. Otherwise, the for statement would have no Java source equivalent.
public List<Expression> initializers() { return this.initializers; }
[ "public List initializers() {\n return initializers; }", "Expression getInitializer();", "public List<VariableDeclaration> getVariableDeclarations()\n {\n return new ArrayList<VariableDeclaration>(m_variable_declaration);\n }", "public final void forInit() throws RecognitionException ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests getTransitionsFrom() for a state with only one transition.
public void testGetTransitionsFromOne() { logger_.info("Running testGetTransitionsFromOne..."); StateMachine machine = new DefaultStateMachine("testGetTransFrom1"); State state1 = StateMachineFactory.createState("state1"); State state2 = StateMachineFactory.createState("state2"); ...
[ "public void testGetTransitionsOne()\n {\n logger_.info(\"Running testGetTransitionsOne...\"); \n\n StateMachine machine = new DefaultStateMachine(\"testGetTransitions1\");\n State state1 = StateMachineFactory.createState(\"state1\");\n State state2 = StateMachineFactory.createState(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uses bilinear interpolation to find the pixel value at real coordinates (x,y).
private final int getInterpolatedPixel(double x, double y, int[] pixels) { int xbase = (int) x; int ybase = (int) y; double xFraction = x - xbase; double yFraction = y - ybase; int offset = ybase * width + xbase; int lowerLeft = pixels[offset]; int rll = (lowerLeft & 0xff0000) >> 16; int gll = (lowerLe...
[ "public int getPixel(int x, int y);", "@Override\n\tprotected float compute(ImageUInt8 img, float x, float y) {\n\t\tInterpolatePixelS a = new ImplPolynomialPixel_I(DOF,0,255);\n\t\ta.setImage(img);\n\t\treturn a.get(x,y);\n\t}", "public float getValue(ImageCoordinate coord);", "private int bilinearInterpolat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the car property.
public void setCar(long value) { this.car = value; }
[ "public void setCar(Car car) {\r\n\t\tthis.car = car;\r\n\t}", "public void setCar(Car car){\r\n\t\tthis.car = car;\r\n\t}", "public void setCar(long value) {\n this.car = value;\n }", "public void setCarNumber(String newCarNumber)\n {\n carNumber = newCarNumber; \n }", "public com.tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the "lineID" element
public int getLineID() { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LINEID$2, 0); if (target == null) { ...
[ "public Number getLineId() {\n return (Number) getAttributeInternal(LINEID);\n }", "public Number getLineId() {\n return (Number)getAttributeInternal(LINEID);\n }", "public String getLineId() {\n return lineId;\n }", "public Integer getLineId() {\n return lineId;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load a grocery list from the database.
@Override public GroceryList loadList(Integer id) { // Gets the data repository in write mode SQLiteDatabase db = this.getWritableDatabase(); Cursor c = db.rawQuery("SELECT GL." + DatabaseContract.GroceryListEntry.NAME_COLUMN + ", LI." + DatabaseContract.ListItemEntry._ID + ...
[ "public ResultSet fetchGroceryList() {\r\n\t\ttry {\r\n\t\t\tpreparedStatement = connect.prepareStatement(\"select * from Grocery\");\r\n\t\t\tresultSet = preparedStatement.executeQuery();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn resultSet;\r\n\t}", "public void loadI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
download url for html/pdf
@Schema(description = "download url for html/pdf") public String getUrl() { return url; }
[ "java.lang.String getPdfUrl();", "private void downloadPDF(WebDriver driver, String link, File targetDir) {\n\t\ttry {\n\t\t\ttargetDir.mkdirs();\n\n\t\t\t// create connection\n\t\t\tURL url = new URL(link);\n\t\t\tHttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n\t\t\thttpURLConne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds time of action to given time if on actual(last added TimeStamp to this Route) is action rquired from ship
private void addTimeOfAction(Time timeToNext){ //if actual have non-default action + time of that action if(Ship.Status.actionToPerform(actual.getAction())){ timeToNext.add(Ship.DEFAULT_TIME_OF_ACTION); } }
[ "public Long rescheduleToTime(Long scheduledTimerID_, Date date_, TimeOfDay time_, boolean moveToNextDayIfInPast_, Long actionKey_);", "public void addRTTPoint(SpaceObject so){\n\t\tTime timeToNext = new Time(0);\n\t\tif(actual != null){\n\t\t\taddTimeOfAction(timeToNext); \t\t//add time of acton on actual point ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will run any hash function 50 times on the given size adding .25, .5, .75, 1, 1.25, and 1.5 density factor worth of elements. Un comment some printlns to see some cool stuff
public static void runHash(int size, int hash) { String hashNames[] = { "", "Additive Hashing", "Multiplicative Hashing", "Rotate Additive Hashing", "Rotate Multiplicative Hashing" }; double percentToFill = .25; // for each num of elements to fill ...
[ "static int optimalNumOfHashFunctions(long expectEntries, long bitSize) {\n return Math.max(1, (int) Math.round((double) bitSize / expectEntries * Math.log(2)));\n }", "public HashTableChained(int sizeEstimate) {\r\n double buckets = sizeEstimate / 0.75; //initializes number of buckets so th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy constructor for IndexNumber
public IndexNumber(IndexNumber another) { this.indexNum = another.indexNum; this.tutorialGroup = another.tutorialGroup; this.waitlist = another.waitlist; this.vacancy = another.vacancy; this.students = another.students; this.lessons = another.lessons; }
[ "public Index(int index){\n\t\tthis.index = index;\n\t}", "public Index copy() {\r\n\t\treturn value < INSTANCES.length ? this : new Index(value);\r\n\t}", "public NodeIterator cloneIterator() {\n\tKeyIndex other = new KeyIndex(_arraySize);\n\n\tother._index = _index;\n\tother._nodes = _nodes.cloneArray();\n\to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Is point (x,y) aligned to angle theta, up to precision 'prec'?
boolean isaligned(int x, int y, image_double angles, double theta, double prec) { double a; /* check parameters */ if (angles == null || angles.data == null) error("isaligned: invalid image 'angles'."); if (x < 0 || y < 0 || x >= (int) angles.xsize || y >= (int) angles.ysize) error("isaligned: (x,...
[ "public double\nangleInXYPlane()\n{\n\tBVector2d transPt = new BVector2d(\n\t\tthis.getP2().getX() - this.getP1().getX(),\n\t\tthis.getP2().getY() - this.getP1().getY());\n\t\n\t// debug(\"transPt: \" + transPt);\n\n\tdouble angle = MathDefines.RadToDeg * new Vector2d(1.0, 0.0).angle(transPt);\n\tif (transPt.getY()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
// Devuelve el identificador de parque. 0 si no existe
public int getId(String nombre)throws SQLException{ Connection con = null; int id=0; try{ con = DriverManager.getConnection(url,user,pass); PreparedStatement ps = con.prepareStatement("Select Id_parque from Parque where Nombre=?"); p...
[ "boolean existeParqueadero(Long id);", "java.lang.String getParID();", "Long crearParqueadero(Parqueadero parqueadero);", "private int obtenerUltimoIdPersona() {\r\n int lastId = 0;\r\n Nodo nodo2 = getNodo(Maquina.MAQUINA_2);\r\n Nodo nodo3 = getNodo(Maquina.MAQUINA_3);\r\n Nodo n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the list of Organisms populating the Environment
public List<T> getOrganisms();
[ "public abstract List<Organism> getOrganisms();", "public ArrayList<OrganismType> getOrganismList();", "private Organisms() {\n OrganismFactory organism_factory = new OrganismFactory();\n RandomLocations random_locations = RandomLocations.getInstance();\n for (int i = 0; i < NUMBER_OF_BUGS; ++i) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Use to delete football club from premier league Football clubs remove from the array list
@Override public void relegateFootballClub(String footballClubName) { Scanner scan = new Scanner(System.in); if (footballClubList.size() == 0) { System.out.println("\n ***The Premier League is already empty!!"+ footballClubName +" isn't an existing football club in Premier League!!***\n"...
[ "public void deleteTeam() {\n System.out.println(\"Enter the name of the club you want to delete: \");\n String name = scanner.nextLine().toLowerCase();\n for(FootballClub fc : footballClubs){\n if(fc.getName().toLowerCase().equals(name)){\n footballClubs.remove(fc);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the Modifier.ModifierType getIncrementType() method test.
@Test public void testGetIncrementType_1() throws Exception { Modifier fixture = new Modifier("", 1.0f, Modifier.ModifierType.ADDITIVE); fixture.setIncrement(Modifier.ModifierType.ADDITIVE, 1.0f, new Turn(1), new Turn(1)); fixture.setValue(1.0f); fixture.setType(Modifier.ModifierType.ADDITIVE); fixture.set...
[ "@Test\n\tpublic void testSetIncrementType_1()\n\t\tthrows Exception {\n\t\tModifier fixture = new Modifier(\"\", 1.0f, Modifier.ModifierType.ADDITIVE);\n\t\tfixture.setIncrement(Modifier.ModifierType.ADDITIVE, 1.0f, new Turn(1), new Turn(1));\n\t\tfixture.setValue(1.0f);\n\t\tfixture.setType(Modifier.ModifierType....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides a database connection using a passed datasource, retrying the operation in the default manner in case of transient failures. Autocommit is disabled to allow the client code to manage transactions.
Connection getConnection(DataSource ds) throws SQLException { return getConnection(ds, maxRetryCount, retryDelay, false, true); }
[ "Connection getConnection(DataSource ds, boolean logException)\n throws SQLException {\n return getConnection(ds, maxRetryCount, retryDelay, false, logException);\n }", "Connection getConnection(DataSource ds, boolean autoCommit,\n boolean logException) throws SQLException {\n return getConnectio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of edit method, of class SupplyFacade.
@Test public void testEdit() throws Exception { System.out.println("edit"); Supply entity = null; EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer(); SupplyFacade instance = (SupplyFacade)container.getContext().lookup("java:global/classes/SupplyFacade"); ...
[ "@Test\n public void testEdit() throws Exception {\n System.out.println(\"edit\");\n Choferes choferes = t;\n ChoferesServices instance = ts;\n choferes.setDireccion(\"Prueba\");\n instance.edit(choferes);\n assertTrue(\"Prueba\".equals(ts.findChoferes(t.getId()).getDire...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the network cable link status.
public boolean getLinkStatus() { if (dummyMode) { return true; } if(mEthManager == null) { return false; } return mEthManager.getLinkStatus("eth0"); }
[ "public static cryptix.util.core.LinkStatus getLinkStatus() { return linkStatus; }", "public NetInterfaceStatus getStatus() {\n\t\treturn m_status;\n\t}", "public int getCBRStatus();", "com.google.ads.googleads.v13.enums.AccountLinkStatusEnum.AccountLinkStatus getStatus();", "public String getStatusLink() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Constructor This method is responsible for getting the superblock from the disk and checking if the values are valid. It does this by comparing the values read from the disk to the int passed in representing the total number of block in the disk. If they are not the same, the superblock will be formated
public SuperBlock(int diskSize) { byte[] superBlock = new byte[512]; try { SysLib.rawread(0, superBlock); totalBlocks = SysLib.bytes2int(superBlock, 0); totalInodes = SysLib.bytes2int(superBlock, 4); freeList = SysLib.bytes2int(superBlock, 8); ...
[ "private void readSuperblock() {\r\n if(sb == null)\r\n sb = new Superblock();\r\n \r\n try {\r\n filesystem.seek(1024);\r\n sb.totalInodes = readInt();\r\n sb.totalBlocks = readInt();\r\n filesystem.seek(1024 + 24);\r\n sb.block...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all the flights where uuid = &63; from the database.
@Override public void removeByUuid(String uuid) { for (Flight flight : findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(flight); } }
[ "public void removeByUuid(String uuid);", "@Override\n\tpublic void removeByUuid_C(String uuid, long companyId) {\n\t\tfor (Flight flight :\n\t\t\t\tfindByUuid_C(\n\t\t\t\t\tuuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,\n\t\t\t\t\tnull)) {\n\n\t\t\tremove(flight);\n\t\t}\n\t}", "@Override\n\tpublic voi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a text string into an HTML document. No HTML headers or footers are added to the result. Headers and footers are added at display time.
public static String textToHtml(String text) { return EmailTextToHtml.convert(text); }
[ "public static String textToHtmlFragment(String text)\n {\n return TextToHtml.toHtmlFragment(text);\n }", "private static final String formatTextAsHtml(String text) {\n StringBuffer html = new StringBuffer();\n html.append(\"<tt>\");\n for (int idx = 0; idx < text.length(); idx++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the specified Bitmap to a temporary file.
private void saveBitmap(String key, Bitmap bitmap) { if (bitmap == null) return; if (context == null) return; FileOutputStream out = null; try { File folder = new File(context.getFilesDir(), TEMP_FOLDER_NAME); if (!folder.exists()) folder.mkdirs(); Fil...
[ "private File bitmapToFile(Bitmap bitmap) {\n try {\n File outputDir = context.getCacheDir();\n File outputFile = File.createTempFile(\"file\", \".png\", outputDir);\n OutputStream\n os\n = new FileOutputStream(outputFile);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function returns the tenant ID linked to tenantName for pointed cloud.
public String getID(){ return this.getKey().getTenantId(this.getTenantName()); }
[ "long getTenantID();", "java.lang.String getTenant();", "public String getTenantUuid() {\n if (injectedTenantUuid != null){\n return injectedTenantUuid;\n }\n return \"SingleTenant\";\n }", "String getTenantId();", "public String getTenant_id() {\n\t\treturn DataUtil.toSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
int64 change_pokemon_end_ms = 12;
@java.lang.Override public long getChangePokemonEndMs() { return changePokemonEndMs_; }
[ "@java.lang.Override\n public long getChangePokemonEndMs() {\n return changePokemonEndMs_;\n }", "public Builder setChangePokemonEndMs(long value) {\n \n changePokemonEndMs_ = value;\n onChanged();\n return this;\n }", "@Override\n public int getNextPowerUpTimeMs() {\n int ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls a PUT to create Transaction and return PUT Status Received.
protected PutStatus putTransactionRequest(Transaction transaction, int expectedStatusCode) { Response transactionCreateResponse = putTransactionRequestReponse(transaction); assertEquals(INCORRECTSTATUSCODEMSG, expectedStatusCode, transactionCreateResponse.getStatusCode()); return TransactionJson...
[ "private Response putTransactionRequestReponse(Transaction transaction) {\n Response response = given().body(transaction)\n .when()\n .contentType(ContentType.JSON)\n .put(\"/transaction/\" + transaction.getTransaction_id());\n return response;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prints out the contents of the tasksMap Hash Map by printing the robotID(keys) and the associated Array List(values associated with the ids(keys) in the map)
public void displayRobotAndRobotTasks() { int index = 1; for (Map.Entry<Integer, ArrayList<RobotTask>> robotID : tasksMap.entrySet()) { int key = robotID.getKey(); ArrayList<RobotTask> value = robotID.getValue(); System.out.println(index + " " + key); for ...
[ "private void printAllTaskInformation()\n\t{\n\t\t\n\t\tif(app.getActiveProject().getTasks().size() == 0)\n\t\t{\n\t\t\tSystem.out.println(\"There are currently no tasks.\");\n\t\t} else\n\t\t{\n\t\t\tfor(int i = 0; i<app.getActiveProject().getTasks().size();i++)\n\t\t\t{\n\t\t\t\tSystem.out.println(i+\": \"+app.ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generic function to delete a node on a specific dataStore.
public static boolean deleteNode(DataBroker dataBroker, InstanceIdentifier<?> genericNode, LogicalDatastoreType store) { LOG.info("Received a request to delete node {}", genericNode); boolean result = false; final WriteTransacti...
[ "void deleteStore(Store store);", "void deleteNode(ZVNode node);", "public boolean handleDeleteNode(Node node);", "int delRouteStoreByIdStore(Long id_store);", "public void deleteWikiNode(String uuid);", "public void dataTypeDeleted(String namespace, IMetaStoreElementType dataType);", "public void delet...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the InvalidConfigurationException setParamName(String) method test.
@Test public void testSetParamName_fixture16_1() throws Exception { InvalidConfigurationException fixture = getFixture16(); String paramName = "0123456789"; InvalidConfigurationException result = fixture.setParamName(paramName); // add additional test code here assertNotNull(result); assertEquals("0123...
[ "@Test\n\tpublic void testSetParamName_fixture15_1()\n\t\tthrows Exception {\n\t\tInvalidConfigurationException fixture = getFixture15();\n\t\tString paramName = \"0123456789\";\n\n\t\tInvalidConfigurationException result = fixture.setParamName(paramName);\n\n\t\t// add additional test code here\n\t\tassertNotNull(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the client communicating to a MockServer at the specified host and port for example: MockServerClient mockServerClient = new MockServerClient("localhost", 1080);
public MockServerClient(ClientConfiguration configuration, String host, int port) { this(configuration, host, port, ""); }
[ "public MockServerClient(String host, int port) {\n this(host, port, \"\");\n }", "public MockServerClient(String host, int port, String contextPath) {\n this.clientClass = MockServerClient.class;\n if (isEmpty(host)) {\n throw new IllegalArgumentException(\"Host can not be null...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HP software table initialization. No rules required.
private void installHPSoftwareTable() {}
[ "private void installHPHardwareTable() {\n TrafficSelector.Builder selector = DefaultTrafficSelector.builder();\n\n TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();\n //treatment.setOutput(PortNumber.NORMAL);\n treatment.transition(HP_SOFTWARE_TABLE);\n\n Fl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'Enum'.
Enum createEnum();
[ "EEnum createEEnum();", "ENUM createENUM();", "EnumVal createEnumVal();", "EnumTypeDefinition createEnumTypeDefinition();", "EFEnum createEFEnum();", "EnumLiteral createEnumLiteral();", "EnumValue createEnumValue();", "EnumRef createEnumRef();", "EEnumLiteral createEEnumLiteral();", "EnumConstant ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column t_news.tn_intr
public void setTnIntr(String tnIntr) { this.tnIntr = tnIntr == null ? null : tnIntr.trim(); }
[ "public void setInsnodeid(Integer insnodeid) {\n this.insnodeid = insnodeid;\n }", "public void setInstNo(Integer instNo) {\n\t\tthis.instNo = instNo;\n\t}", "public void setItmNumber(java.lang.String itmNumber) {\n this.itmNumber = itmNumber;\n }", "public void setIn_num(Integer in_num) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
addBranchCycles adds a cycle for taking a branch and adds another cycle if the branch jumps to a new page
public void addBranchCycles(StepInfo info) { this.Cycles++; if(pagesDiffer(info.pc, info.address)){ this.Cycles++; } }
[ "public void incrementBranchCount() {\n this.branchCount++;\n }", "public synchronized void incrementBranchNumber(){\n\t\tbranchCount++;\n\t}", "private void addCycle(int cycle) {\n // Add entries to history in case none is present yet for the given cycle\n if (!historyPackets.containsKe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the average color in the bounding box
public Color getAverageInArea() { if(this.rect == null) return null; int r = 0; int g = 0; int b = 0; for (int y = 0; y < (int) rect.getHeight(); y++) { for (int x = 0; x < (int)rect.getWidth(); x++) { if(rangedRawMatrix[y][x] !=null) { ...
[ "int getAverageARGB();", "private Color computeAverageColor(AbstractCollection<Pixel> pixels)\n {\n int r=0, g=0, b=0;\n for(Pixel p : pixels)\n {\n Color c = new Color(image.getRGB(p.p, p.q));\n r+=c.getRed();\n g+=c.getGreen();\n b+=c.getBlue();\n }\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end ViewHolder Create a new view to display a bug. Return the ViewHolder that stores references to the widgets on the new view.
@Override public BugAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { // Get the layout inflater from parent that contains the bug view item. Context context = parent.getContext(); LayoutInflater inflater = LayoutInflater.from(context); // Inflate the layout to...
[ "public ViewHolder(View itemView) {\n super(itemView);\n\n // Store references to the widgets on the view item\n bugTitleTextView = itemView.findViewById(R.id.bug_list_item_titleTextView);\n bugDateTextView = itemView.findViewById(R.id.bug_list_item_dateTextView);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
evaluate expression values in a map and return all that were evaluated as expressions.
@SuppressWarnings({"squid:S3776"}) public static Map<String, String> mapEvaluateAllExpressionValues(Map<String, String> source, Map<String, Object> contextMap) { JexlEngine jexl = new JexlBuilder().create(); JxltEngine jxlt = jexl.createJxltEngine(); JexlContext jc = new MapContext(contextM...
[ "java.util.Map<java.lang.String, java.lang.String>\n getExpressions();", "protected void selectTraceableExpressions(Map<String, Expression> mapExprs)\n {\n for (AstNode node : children())\n {\n if (node instanceof Expression expr)\n {\n if (expr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if no layout manager is set, return the delegate's preferred size, otherwise use the default implementation
@Override public Dimension getPreferredSize() { if (getLayout() == null) { return delegate.getPreferredSize(); } return super.getPreferredSize(); }
[ "@Override\r\n\tpublic Dimension getMinimumSize() {\r\n\t\tif (getLayout() == null) {\r\n\t\t\treturn delegate.getMinimumSize();\r\n\t\t}\r\n\t\treturn super.getMinimumSize();\r\n\t}", "@Override\r\n\tpublic Dimension getMaximumSize() {\r\n\t\tif (getLayout() == null) {\r\n\t\t\treturn delegate.getMaximumSize();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send out the study accrual notification.
private void sendStudyAccrualNotification(StudySubject studySubjectAfterSave) { try { this.notificationEmailer.sendEmail(studySubjectAfterSave); } catch (Exception e) { // TODO throw a C3PRCodedUncheckedException log.error(e.getMessage()); throw new Run...
[ "public void sendNotificationToStudents(){\n noti = new EventNotification();\n noti.sendEventNotificationtoStudents();\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 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get one contributionType by id.
@Transactional(readOnly = true) public Optional<ContributionType> findOne(Long id) { log.debug("Request to get ContributionType : {}", id); return contributionTypeRepository.findById(id); }
[ "@Override\n public Optional<FundContributionDTO> findOne(String id) {\n\tlog.debug(\"Request to get FundContribution : {}\", id);\n\treturn fundContributionRepository.findById(id).map(fundContributionMapper::toDto);\n }", "private ItemType getItemTypeByID(Integer id) {\n\n SQLiteDatabase db = this.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getAllAnswers method, of class AnswersManager.
@Test public void testGetAllAnswers() { Answers ansTest = new Answers("typeTest", "Answer", qtest); answersManagerTester.setAnswers(ansTest); Answers ansTest2 = new Answers("typeTest2", "Answer2", qtest); answersManagerTester.setAnswers(ansTest2); Answers ansTest3 = new Answe...
[ "@Test\n public void testGetQuestionAnswers() {\n Answers ansTest = new Answers(\"typeTest\", \"Answer\", qtest);\n answersManagerTester.setAnswers(ansTest);\n Answers ansTest2 = new Answers(\"typeTest2\", \"Answer2\", qtest);\n answersManagerTester.setAnswers(ansTest2);\n Answ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__SingleEventUpdate__AssignerAssignment_3" $ANTLR start "rule__DistributedEventUpdate__AssigneeAssignment_0_1" ../eu.quanticol.caspa.ui/srcgen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:10231:1: rule__DistributedEventUpdate__AssigneeAssignment_0_1 : ( ruleUpdateReference ) ;
public final void rule__DistributedEventUpdate__AssigneeAssignment_0_1() throws RecognitionException { int stackSize = keepStackSize(); try { // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:10235:1: ( ( ruleUpdateReference ) ) ...
[ "public final void rule__DistributedEventUpdate__AssigneeAssignment_1_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:10280:1: ( ( ruleUpdateRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a scope registration listener from this registry. If the listener was not previously added, this should result in no effect.
public void removeScopeRegistrationListener( ScopeEventListener listener);
[ "void removeScopeChangeListener(IScopeChangeListener listener);", "public void clearScopeRegistrationListeners();", "public void removeRegistryListener (final DescriptorRegistryListener listener) {\n writeAccess (new Runnable() {\n public void run () {\n listeners.remove (listen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the queue tracker with a reported timeline change.
public void onTimelineChanged(Player player) { currentPlayerMediaPeriod = findCurrentPlayerMediaPeriodInQueue(player, mediaPeriodQueue, playingMediaPeriod, period); updateMediaPeriodTimelines(/* preferredTimeline= */ player.getCurrentTimeline()); }
[ "public void playerQueueUpdated(IPlayerQueue queue);", "public void onQueueUpdated(\n List<MediaPeriodId> queue, @Nullable MediaPeriodId readingPeriod, Player player) {\n mediaPeriodQueue = ImmutableList.copyOf(queue);\n if (!queue.isEmpty()) {\n playingMediaPeriod = queue.get(0);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a DataSource Object from the spec.
public DataSourceObjectBuilder(DataSourceSpec spec) { this.spec = spec; executor = new MethodExecutor(); }
[ "public static DataSource createDataSource(final String datasource, final Properties props) {\r\n DataSource dsConf = new DataSource();\r\n dsConf.setClassName(datasource);\r\n\r\n Iterator<Map.Entry<Object, Object>> iter = props.entrySet().iterator();\r\n while (iter.hasNext()) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Table interface defines the methods for each of the datasets. For each of the datasets methods are required to generate the html used to display the datasets selection, collect the selection information from the form submittal, and generate the database query. Table objects are created and initialized from the Tabl...
public interface Table extends Cloneable { /** * The unique identifier of this table as defined in the Tables table * @return the id */ int getId(); /** * The table identifier is set when the class is loaded, either for * initial display of the analysis form, or when the request i...
[ "protected void getDataAndMakeTables() throws ModelException {\n\n if (m_oLegend == null) {\n return;\n }\n\n m_oChartFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\n\n DetailedOutputFileManager oManager = m_oLegend.getDetailedOutputFileManager();\n int iNumTimesteps = m_oLegen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test failed run of job creation with empty job id.
@Test(expected = BadRequestException.class) public void testCreateJob_Failure_JobIdNotSpecified() throws Exception { JobsPut.createOrUpdateJob("partition", "", makeJob()); }
[ "private static void testFail() throws Throwable {\n Scheduler userInt = SchedulerTHelper.getSchedulerInterface();\n\n for (int i = 0; i < jobs_fail; i++) {\n String job_path = new File(jobs_path.toURI()).getAbsolutePath() + \"/flow_fail_\" + (i + 1) +\n \".xml\";\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the mouse listeners to the panel. Here, we need methods from both MouseListener and MouseMotionListener.
@Override protected void addListeners(JPanel panel) { panel.addMouseListener(this); panel.addMouseMotionListener(this); }
[ "public void addListeners() {\n \t\tsuper.addListeners();\n \t\taddMouseWheelListener(this);\n \t}", "protected void addListeners() {\n \n \t\tmoduleGroupListener = new ModuleGroupListener();\n \t\tgetNavigationNode().addListener(moduleGroupListener);\n \n \t\tpaintDelegation = new PaintDelegation();\n \t\taddPai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of DataObjectService to the given value.
public void setDataObjectService(DataObjectService dataObjectService) { this.dataObjectService = dataObjectService; }
[ "public void setServiceValue(YangString serviceValue) throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"service\",\n serviceValue,\n childrenNames());\n }", "public void setValue(Object value)\n // post: sets a new value for this object\n {\n m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stop this LevelElement's horizontal movement.
void stopHorizontally();
[ "public void stopHorizontal() {\n super.setRun(0);\n }", "public void stopMovement() {\n this.movementComposer.stopMovement();\n }", "public void stop()\n\t{\n\t\tfrogVelocityX = 0;\n\t}", "public void stop() {\n moveLeftMotorStack(0.0);\n moveRightMotorStack(0.0);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
10 seconds Use argparse4j to parse the program arguments and return a map. Handle arguments validation, set default values, show usage output, etc.
private static Map<String,Object> parseArgs(String[] args) { // Where to save the parsed arguments as they go through the parsers? Map<String,Object> parsedArgs = new HashMap<String,Object>(); // Build the Argument Parser and Argument Groups before using it ArgumentParser myArgParser = ArgumentParsers.new...
[ "void parseCommandLine(String argv[])\n{\n gRunInfo.quiet = false; // Set up defaults for run.\n gRunInfo.verbose = false;\n gRunInfo.numThreads = 2;\n gRunInfo.validating = false;\n gRunInfo.dom = false;\n gRunInfo.reuseParser = false;\n gRunInfo.inMemory = false;\n gRunInfo.d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Specifies the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer..
Update withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription);
[ "String partnerTopicFriendlyDescription();", "public String partnerTopicFriendlyDescription() {\n return this.partnerTopicFriendlyDescription;\n }", "public EventChannelProperties withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription) {\n this.partnerTopicFriendlyDescriptio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes in a parameter and sets the pwaeIdsite object variable to that parameters. Pre the Parameter must be a Pwae Object. post the pwaeIdsite value has been updated.
public void setPwaeIdsite(Pwae pwaeIdsite) { this.pwaeIdsite = pwaeIdsite; }
[ "public Pwae getPwaeIdsite() {\r\n return pwaeIdsite;\r\n }", "public void setSite(Site aSite) {\n this.site = aSite;\n }", "public void setSite(Site site) throws ParameterException {\n\n\t\twillsSiteParam.setValue((String)site.getParameter(WILLS_SITE_NAME).getValue());\n\t\tthis.site = site...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the attack frequency in seconds.
public int getAttackFrequency() { return this.attackFrequency; }
[ "public final double getAttackTimeCounter()\n {\n return attackTimeCounter;\n }", "public float getEffectiveClockFrequency() {\n return (float) getCpu().getTime() * NANOSECS_IN_MSEC / getUptime();\n }", "public int getAutoAttackCheckFrequency() {\r\n\t\treturn this.autoAttackCheckFrequenc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleCoordinationMasterPort" $ANTLR start "entryRuleComponentParametersRef" InternalComponentDefinition.g:1069:1: entryRuleComponentParametersRef : ruleComponentParametersRef EOF ;
public final void entryRuleComponentParametersRef() throws RecognitionException { try { // InternalComponentDefinition.g:1070:1: ( ruleComponentParametersRef EOF ) // InternalComponentDefinition.g:1071:1: ruleComponentParametersRef EOF { before(grammarAccess.getC...
[ "public final void ruleDerivedComponentElement() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalComponentDefinition.g:207:2: ( ( ruleComponentParametersRef ) )\n // InternalComponentDefinition.g:208:2: ( ruleComponentParame...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the finAcctBusinessType value for this Account.
public void setFinAcctBusinessType(java.lang.String finAcctBusinessType) { this.finAcctBusinessType = finAcctBusinessType; }
[ "public java.lang.String getFinAcctBusinessType() {\n return finAcctBusinessType;\n }", "public void setBusinessType(String businessType) {\n\t\tthis.businessType = businessType;\n\t}", "public void setBusinessType(String BusinessType) {\n this.BusinessType = BusinessType;\n }", "public vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a remote player session
public PlayerSession(EuchreClient client, String playerName, String hostAddr, int port, long sessionID){ this.client = client; this.hostAddr = hostAddr; this.port = port; this.sessionID = sessionID; this.remotePlayer = new RemotePlayer( playerName, new PlayerA...
[ "Player createPlayer();", "void createPlayer(Player player);", "private CSCreatePlayer() {}", "private void openRemoteSession()\n {\n\n String sessionType = \"vrdp\";\n String env = \"DISPLAY=:0.0\";\n\n logger.info(\"Opening the remote session\");\n\n // openExistingSession();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load plan data into the UI fields
public void loadPlanDataInGui() { String id = String.valueOf(load_plan_table.getValueAt(load_plan_table.getSelectedRow(), 0)); Helper.startSession(); Query query = Helper.sess.createQuery(HQLHelper.GET_LOAD_PLAN_BY_ID); query.setParameter("id", Integer.val...
[ "private void populateForm() {\n Part selectedPart = (Part) PassableData.getPartData();\n partPrice.setText(String.valueOf(selectedPart.getPrice()));\n partName.setText(selectedPart.getName());\n inventoryCount.setText(String.valueOf(selectedPart.getStock()));\n partId.setText(Str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the destination city identifier
public Long getDestinationCityId() { return destination.getCityId(); }
[ "public String getDestinationcity() {\n return destinationcity;\n }", "public String getdDestinationcityid() {\n return dDestinationcityid;\n }", "public String getDestinationCityName() {\n return destination.getCityName();\n }", "public String getdDestinationcity() {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the byte user by the review Id
@Query(value="select bu.byte_role , bu.email , bu.first_name , bu.id , bu.last_name , bu.\"password\" , bu.profile_pic , bu.user_created , bu.user_terminated , bu.username " + "from review r , byte_order bo , byte_user bu " + "where r.byte_order_id = bo.id and r.id = :reviewId and bu.id ...
[ "Review getReviewById(int reviewId);", "@Query(value=\"select bu.byte_role , bu.email ,bu.first_name , bu.id , bu.last_name , bu.last_name , bu.\\\"password\\\" , bu.profile_pic , bu.user_created , bu.user_terminated , bu.username \" +\n \"from review r , byte_order bo , byte_user bu , product_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a child code block.
public CodeBlock getChildCodeBlock(int index) { return children.get(index); }
[ "public CodeBlock getParent() {\r\n\t\treturn parent;\r\n\t}", "CodeBlock createCodeBlock();", "public CodeBlock() {}", "protected void visitChildOfBlock(BlockStmt parent, Stmt child) {\r\n // Override in subclass if needed\r\n }", "public String getCodeBlock() {\n return codeBlock;\n }", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleSequenceExp" $ANTLR start "entryRuleSetExp" InternalOCLlite.g:1128:1: entryRuleSetExp : ruleSetExp EOF ;
public final void entryRuleSetExp() throws RecognitionException { try { // InternalOCLlite.g:1129:1: ( ruleSetExp EOF ) // InternalOCLlite.g:1130:1: ruleSetExp EOF { before(grammarAccess.getSetExpRule()); pushFollow(FOLLOW_1); ruleSetExp(...
[ "public final void entryRuleSetExp() throws RecognitionException {\n try {\n // InternalSymboleoide.g:1154:1: ( ruleSetExp EOF )\n // InternalSymboleoide.g:1155:1: ruleSetExp EOF\n {\n before(grammarAccess.getSetExpRule()); \n pushFollow(FOLLOW_1);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The remaining driving time for the 'current_route_segment'. This field facilitates journey sharing between the Driver app and the Consumer app. This value is updated by the Driver SDK. Fleet Engine does not update it. The value is unspecified if the `Vehicle.current_route_segment` field is empty, or if the Driver app h...
@java.lang.Override public com.google.protobuf.Int32Value getRemainingTimeSeconds() { return remainingTimeSeconds_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : remainingTimeSeconds_; }
[ "public Long getRemainingTime() {\n return remainingTime;\n }", "public void setRemainingTime(Long remainingTime) {\n this.remainingTime = remainingTime;\n }", "public Integer getRemainingTime() {\n return remainingElectionTimeout;\n }", "public void setRemainingTime(int remainin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Point__Alternatives" $ANTLR start "rule__PowEvent__Alternatives" InternalSymboleoide.g:1672:1: rule__PowEvent__Alternatives : ( ( 'pTRIGGERED' ) | ( 'pACTIVATED' ) | ( 'pSUSPENDED' ) | ( 'pRESUMED' ) | ( 'pEXERTED' ) | ( 'pEXPIRED' ) | ( 'pTERMINATED' ) );
public final void rule__PowEvent__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalSymboleoide.g:1676:1: ( ( 'pTRIGGERED' ) | ( 'pACTIVATED' ) | ( 'pSUSPENDED' ) | ( 'pRESUMED' ) | ( 'pEXERTED' ) | ( 'pEXPIRED' ) | ( 'pTERMINATED' ) ...
[ "public final void rulePowEvent() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:841:2: ( ( ( rule__PowEvent__Alternatives ) ) )\n // InternalSymboleoide.g:842:2: ( ( rule__PowEvent__Alternatives ) )\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test if the constructor has set the object to its correct value test also the toString() method together with that
@Test public void constructorTest(){ assertSame("Constructor sets the correct value", exampleDateString, date1.toString()); }
[ "public static boolean settConstructorTest() {\r\n Sett test1 = new Sett();\r\n if (test1 == null) // checks whether the sett has been initialized or not\r\n return false; // false is returned if the sett is null\r\n\r\n if (test1.getTopBadger() != null) // checks whether the topBadger is null or not\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Crea una instancia de ContenedorSesiones y la devuelve.
public static ContenedorSesiones getInstancia() { if (instancia == null) { instancia = new ContenedorSesiones(); } return instancia; }
[ "public void crearControladorInfoCriaturas(){\r\n this.contInfo = new ControladorInfoCriaturas (this);\r\n }", "public ControladorCoche() {\n\t}", "private void iniciarControladores() {\n\t\tRepositorioChamada rc = new RepositorioChamada();\n\t\tchamada = new ControllerChamada(rc);\n\t\t\n\t\tReposito...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the totalSearchCount value for this RegistrationNumberLinkInfoArray.
public void setTotalSearchCount(java.lang.String totalSearchCount) { this.totalSearchCount = totalSearchCount; }
[ "public void setTotalCount(int totalCount) {\n this.totalCount = totalCount;\n }", "public void setTotalCount(int value) {\n this.totalCount = value;\n }", "public java.lang.String getTotalSearchCount() {\n return totalSearchCount;\n }", "public void setTotalCount(Long totalCount...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
713. Subarray Product Less Than K need to why count of the sub array is exactly ji+1 when the subarray is continugual
public int numSubarrayProductLessThanK(int[] nums, int k) { int mul = 1, count = 0, start = 0, end = 0; while(end < nums.length){ mul *= nums[end]; while(start <= end&&mul>=k){ mul /= nums[start++]; } count+=end-start+1; end++; ...
[ "public int numberOfSubarrays(int[] nums, int k) {\n LinkedList<Integer> queue = new LinkedList();\n int min = 0;\n queue.add(-1);\n for(int i = 0; i < nums.length; i++){\n if(nums[i] %2 == 1){ queue.add(i);}\n if(queue.size() > k + 1) { queue.pop();}\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load a string from a file on the classpath.
public static String loadStringFromClasspathFile(ClassLoader loader, String name) throws IOException { InputStream in = loader.getResourceAsStream(name); if (in == null) throw new IllegalArgumentException("Cannot find: " + name + " on the classpath"); try { BufferedInputStream bufferd = new Buffe...
[ "public void loadResource(String file) throws LoadException;", "public String loadResourceAsString(String path) throws IOException;", "Path load(String filename);", "Resource loadAsResource(String filename);", "public static String loadText(String path) {\n\t\tString text = \"\";\n\t\t\n\t\tInputStream stre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use to GET All Shop Details
@RequestMapping(value = "/getAllShopList", method = RequestMethod.GET) public ResponseEntity<List> getShopList( ) { List shopList = new ArrayList(); for (Map.Entry<String,List<ShopBean>> shopMap : RetailStoreMap.shopmap.entrySet()) { for (ShopBean shopBean : shopMap.getValue()) { shopList.add(shopBean); ...
[ "public Iterable<Shop> getAllShops() {\n return this.shopRepository.findAll();\n }", "@RequestMapping(value = \"/getShopDetails\")\n\tpublic ResponseEntity get() {\n\t\tShopBean shopBean = new ShopBean();\n\t\tShopAddress shopAddress = new ShopAddress();\n\t\tshopAddress.setShopNumber(1);\n\t\tshopAddre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TDD PART 2 Test1 : Not a formula spec but a string because of space in front
@Test public void testFormulaSpec() { sheet.put("B1", " =7"); // note leading space assertEquals("Not a formula", " =7", sheet.get("B1")); assertEquals("Unchanged", " =7", sheet.getLiteral("B1")); }
[ "@Test\n public void testCalculator() {\n String s = \"(5-(1+(5)))\";\n System.out.println(calculate(s));\n }", "@Test\r\n public void deriveFromIncSuffixExpressionWithSIUnits() throws IOException {\r\n //example with siunit literal\r\n check(\"4km++\", \"(int,km)\");\r\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List Attendance History by user ID
List<Attendance> list(Long userId);
[ "public List<Events> getAllEventsAndHistoryForUser(long userId);", "public List<UserLogs> getAllUserLogs(int uid);", "@Override\n\t@Transactional(readOnly = true)\n public List<UserHistory> getUserHistoryByUserId(Long userId) throws ResourceNotFoundException {\n return userHistoryRepository.findByUser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the sum of income from date1 to date2
public double getIncome(LocalDate from, LocalDate to) throws SQLException { try (PreparedStatement statement = conn.prepareStatement("select sum(Amount) from transaction where date between ? and ? and type=\"Income\"")) { statement.setDate(1, Date.valueOf(from)); statement.setDate(2, Date.valueOf(to)); try (...
[ "double getTodaysIncomeAmount() {\n Long time = new Date().getTime();\n Date date = new Date(time - time % (DAY_DURATION));\n return getIncomeAmount(date.getTime(), date.getTime() + DAY_DURATION);\n }", "public static void total(double income, double expense){\n double dailyIncome =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs a query and returns an iterator over the resulting sequence of Items.
public SequenceOfItems runQuery(String query) { CharStream charStream = CharStreams.fromString(query); JsoniqLexer lexer = new JsoniqLexer(charStream); JsoniqParser parser = new JsoniqParser(new CommonTokenStream(lexer)); parser.setErrorHandler(new BailErrorStrategy()); Jsoni...
[ "public Iterator<ResultItem> iterateItems() {\r\n\t\treturn items.iterator();\r\n\t}", "public XQResultSequence executeQuery(java.io.Reader query) throws XQException;", "protected abstract Stream<T> executeQuery(Query query);", "public XQResultSequence executeQuery(String query) throws XQException;", "publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a resource type to this activity manager.
public void add(ResourceType rt) { resourceTypeList.add(rt); }
[ "public abstract void setResourceType(ResourceTypes type);", "@Override\n public void addResourceTypeCacheCandidate(String resourceType, Integer resourceTypeId) throws FHIRPersistenceException {\n final String METHODNAME = \"addResourceTypeCacheCandidate\";\n log.entering(CLASSNAME, METHODNAME);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the number of children in a specified group.
int getChildrenCount(int groupPosition);
[ "int getChildCount();", "public static int getGroupCount(String group, Document formData) {\n if (group == null || formData == null) {\n return 0;\n }\n String[] split = group.split(Pattern.quote(\".\"));\n return formData.getElementsByTagName(split[split.length - 1]).getLength();\n }", "publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the PitchClass name for this NoteSymbol
public String getPitchString() { return pitchClass.toString(); }
[ "public String getClassName(){\n\n return className; // returns class name Triangle\n\n }", "public PitchClass getPitchClass() {\n return pitchClass;\n }", "public String getClassificatioName() {\n return classificatioName;\n }", "public PitchClass getPitchClass()\n {\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a channel from the space. This channel will no longer be checked for updates or recieve updates from this space
public void removeChannel(TransportChannel channel) { MessageChannel msg = channelMap.remove(channel); channels.remove(msg); }
[ "void removeChannel(Channel channel);", "public void removeActiveChannel(String channel)\n {\n if (activeChannels.contains(channel))\n {\n activeChannels.remove(channel);\n }\n }", "@SuppressWarnings(\"unused\")\r\n\tpublic void removeSubscript...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field fromVariables is set (has been assigned a value) and false otherwise
public boolean isSetFromVariables() { return this.fromVariables != null; }
[ "public boolean is_set_variables() {\n return this.variables != null;\n }", "public boolean hasVariables() {\n // we check both to exclude object_id\n return getMetaClass().getRealClass().getVariableTableSize() > 0 && varTable.length > 0;\n }", "public abstract boolean hasVarAndVarSons()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints out the longest cycle; just for kicks.
private void dumpLongestCycle(Catalog cat) { DependencyCycle longest = null; for (DependencyCycle cycle : cat.getCycles()) { if (longest == null || longest.getCycleSegments().size() < cycle.getCycleSegments().size()) { longest = cycle; } } if (lon...
[ "private static void cycle(int limit, int cycle) {\n\t\tint counter = 1;\n\t\tfor (int i = 0; i < limit; i++) {\n\t\t\tif (counter % cycle == 1) {\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\tSystem.out.print(counter++ + \" \"); // <--- printing\n\t\t}\n\t}", "private static void showCycles(IMoleculeSet cy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Drawns a range of the saved timed points on the screen. The view needs to be in present mode to do this.
public void presentPointsRange(int startIndex, int endIndex) { if (mMode != MODE_PRESENT) { return; } if (startIndex >= endIndex) { return; } if (startIndex < 0) { return; } if (endIndex >= mTimedPoints.size()) { r...
[ "public void draw() {\n StdDraw.setXscale(-0.05, 1.05);\r\n StdDraw.setYscale(-0.05, 1.05);\r\n for (Point2D p : pointSet) {\r\n StdDraw.point(p.x(), p.y());\r\n }\r\n}", "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the buy sell productses before and after the current buy sell products in the ordered set where title LIKE &63;.
@Override public BuySellProducts[] findByTITLEBASEDSEARCH_PrevAndNext(long id, String title, OrderByComparator<BuySellProducts> orderByComparator) throws NoSuchBuySellProductsException { BuySellProducts buySellProducts = findByPrimaryKey(id); Session session = null; try { session = openSession(); Bu...
[ "List<Product> getProductsSortedBySells();", "@Override\n\tpublic List<BuySellProducts> findByTITLEBASEDSEARCH(String title) {\n\t\treturn findByTITLEBASEDSEARCH(title, QueryUtil.ALL_POS,\n\t\t\tQueryUtil.ALL_POS, null);\n\t}", "private void getSales(){\n//\t\tint i = 7;\n//\t\tfor (Entry<EntityType, Integer> e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests opening the badges menu to display the preview.
public void testSelectBadgesToPreview() { robot.wait(1.0); robot.pressKey(KeyEvent.VK_ENTER); robot.releaseKey(KeyEvent.VK_ENTER); robot.robotMouseMove(RobotGUITester.BadgesButtonPoint); robot.leftClickPressAndRelease(); robot.robotDragMouse(RobotGUITester.TopOfSelectionPanelPoint, seconds, fps); robo...
[ "@When(\"^I see Giphy preview page$\")\n public void ISeeGiphyPreviewPage() throws Exception {\n Assert.assertTrue(\"Giphy Image is not visible\", getGiphyPreviewPage().isPreviewVisible());\n Assert.assertTrue(\"Giphy Cancel Button is not visible\", getGiphyPreviewPage().isButtonVisible(\"Cancel\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add tabs and fragments
private void setupTabs() { TabAdapter adapter = new TabAdapter(getSupportFragmentManager()); adapter.addFragment(new RestaurantListFragment(), getString(R.string.tab_title_nearby)); adapter.addFragment(new BookmarkedRestaurantListFragment(), getString(R.string.tab_title_bookmarked)); vie...
[ "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the creditResponse value for this ERechargeRevResponseDTO.
public void setCreditResponse(co.com.tigo.gatewaytigov19.webscp.ws.CreditResponseDTO creditResponse) { this.creditResponse = creditResponse; }
[ "public void setRechargeRevResponse(co.com.tigo.gatewaytigov19.webscp.ws.RechargeRevResponseDTO rechargeRevResponse) {\n this.rechargeRevResponse = rechargeRevResponse;\n }", "public co.com.tigo.gatewaytigov19.webscp.ws.CreditResponseDTO getCreditResponse() {\n return creditResponse;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of the default target of the project.
public String getDefaultTarget() { return defaultTarget; }
[ "public java.lang.String getDefaultTargetName() {\n return defaultTargetName;\n }", "public String getDefaultTargetName()\n {\n if (defaultTargetAttribute != null)\n {\n return defaultTargetAttribute.getValue();\n }\n else\n {\n return \"\";\n }\n }", "public void setDefa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds a list of default tasks. These are defined by specifying defaultTasks 'task name' in the gradle file. There can be multiple default tasks. This only returns default tasks directly for this project and does not return them for subprojects.
public List<TaskVersion1> getDefaultTasks();
[ "public List<TaskVersion1> getDefaultTasks() {\n return TaskWrapper.convertTasks(projectView.getDefaultTasks());\n }", "private List<SOTask> createTaskForDefaultSKU(WorkOrderSKU workOrderSKU) {\r\n\t\tString defaultSku \t\t\t= \"\";\r\n\t\tString defaultTaskComment \t= \"\";\r\n\t\tString defaultTaskNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the initial Look and Feel.
public String getLookAndFeel() { return _initialLookAndFeel; }
[ "private void storeInitialLook() {\r\n\t\tthis.initialFont = this.control.getFont();\r\n\t\tthis.initialBackgroundColor = this.control.getBackground();\r\n\t\tthis.initialForegroundColor = this.control.getForeground();\r\n\t}", "private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter for the assetTypes property.
public void setAssetTypes(final List<String> assetTypes) { this.assetTypes = assetTypes; }
[ "public List<String> getAssetTypes() {\n return this.assetTypes;\n }", "@Schema(description = \"The specific asset type(s) the user wishes to receive leg options for\")\n \n public List<String> getUseAssetTypes() {\n return useAssetTypes;\n }", "public void setTypes(Types types);", "java.uti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trims the recent file list to the configured size and numbers the remaining files according to their position in the list
public void numberItems() { int delPos = _recentFiles.size(); boolean wasEmpty = (delPos == 0); while (delPos > MAX) { _recentFiles.remove(delPos - 1); _remove(_initPos+1-(delPos-1)); delPos = _recentFiles.size(); } for (int i = 0; i < _recentFiles.size(); i++ ) { fina...
[ "private synchronized void trimToSize(UISettings uiSettings) {\n final int limit = uiSettings.RECENT_FILES_LIMIT + 1;\n while (myEntriesList.size() > limit) {\n HistoryEntry removed = myEntriesList.remove(0);\n removed.destroy();\n }\n }", "private void shuffleBySize(){\n PPod p_temp = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Put a new QuartzJobHistory in the WSFilePackagerFactory livePackagers Map and return a JobDetail
@Override public Object invoke(final Invocation invocation) throws Throwable { wsFilePackagerFactory.putQuartzJobHistory(UUID.randomUUID(), new QuartzJobHistory()); return new JobDetail(); }
[ "private QuartzJobHistory getPretendFinishedQuartzJobHistory(final UUID uuid) {\r\n\r\n final QuartzJobHistory result = new QuartzJobHistory();\r\n result.setJobName(uuid.toString());\r\n result.setJobGroup(FilePackagerEnqueuer.JOB_GROUP_FILE_PACKAGER);\r\n result.setStatus(QuartzJobStat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup expectations: Radio app is open and Favourite/saved station list should be open This method is used to find and play the provided channelName from the list of saved stations
void playFavoriteStation(String channelName);
[ "public void testCase01_ChannelOpenPerformance() throws Exception {\n Log.i(LOGTAG, \">> testChannelOpenPerformance\");\n mBindHelper.setDescription(\"test for open channel performance\");\n // make sure we have data in DB first\n Uri uri = Uri.parse(\"content://com.mediatek.FMRadio.FMRa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of substracting this NameSet from 'from' NameSet
public NameSet substractFrom(NameSet from) { return from.substract(this); }
[ "public NameSet substract(NameSet what) {\n if (_isFinite) {\n if (what._isFinite) {\n // it's the subst of _finiteSet with what._finiteSet\n Set<String> subst = new HashSet<>();\n subst.addAll(_finiteSet);\n subst.removeAll(what._finiteS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
marker for having selected the slot containing array length Compress a potentially large array into a more displayable shortened form. Compresses an array field name list to a maximum of VISIBLE_ARRAY_START which are guaranteed to be displayed at the start, then some [..] expansion slots, followed by VISIBLE_ARRAY_TAIL...
private List<FieldInfo> compressArrayList(DebuggerObject arrayObject) { // mimic the public length field that arrays possess // according to the java spec... indexToSlotList = new LinkedList<Integer>(); indexToSlotList.add(0, new Integer(ARRAY_LENGTH_SLOT_VALUE)); // the +1 ...
[ "private void selectArrayElement()\n {\n String response = DialogManager.askString(this, \"ask-index\");\n\n if (response != null) {\n try {\n int slot = Integer.parseInt(response);\n // check if within bounds of array\n if (slot >= 0 && slot ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method gets the field sourceRepoUrl.
String getSourceRepoUrl();
[ "java.lang.String getRepoSource();", "@ApiModelProperty(example = \"null\", value = \"If provided, get source from this location in a Cloud Repo.\")\n public RepoSource getRepoSource() {\n return repoSource;\n }", "public String getSourceRepositoryURL() {\n \treturn sourceRepositoryURL;\n }", "void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }