query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Return the maximum element in the tree, in natural order.
public T findMax() { if ( isEmpty() ) return null; return findMax( root ).element; }
[ "public E max(){\n \t \n \t \n \t \n \t BSTNode<E> temp = root; \t \n \t while(temp.getRight() != null)\n \t\t temp = temp.getRight();\n \t \n \t return temp.getValue();\n }", "public T findMax() throws EmptyCollectionException \n {\n T result = null;\n\n if (isEmpty())\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Coordinate of the waypoint.
public void setWaypoint(Coordinate waypoint) { this.cells[waypoint.getY()][waypoint.getX()].setCellType(Cell.WAYPOINT); this.waypoint = waypoint; }
[ "public void setLocation ()\r\n {\r\n dots.moveTo (Place.getX(), Place.getY());\r\n }", "public void setCoordinate(Coordinate coord);", "public void setLocation( Point p ) {\r\n this.x = p.x;\r\n this.y = p.y;\r\n }", "public void setRobotLocation(Point p);", "public void setLoca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Contacts the repository web service at the specified endpoint URL, and returns the repository metadata information.
@SuppressWarnings("unchecked") public static RepositoryInfoType getRepositoryMetadata(String endpointUrl) throws RepositoryException { try { HttpGet getRequest = new HttpGet(endpointUrl + REPOSITORY_METADATA_ENDPOINT); HttpResponse response = execute(getRequest); ...
[ "String getRepositoryURL();", "@GET\n @Path(\"repository-metadata\")\n @Produces(MediaType.TEXT_XML)\n public JAXBElement<RepositoryInfoType> getRepositoryMetadata() throws RepositoryException {\n return objectFactory.createRepositoryInfo(repositoryMetadataResource.getResource());\n }", "Obje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will lookup another class element by name. If it cannot be found an empty optional will be returned.
default Optional<ClassElement> getClassElement(Class<?> type) { if (type != null) { return getClassElement(type.getName()); } return Optional.empty(); }
[ "default Optional<ClassElement> getClassElement(String name) {\n return Optional.empty();\n }", "default Optional<ClassElement> getClassElement(String name, ElementAnnotationMetadataFactory annotationMetadataFactory) {\n return Optional.empty();\n }", "@Override\n public <T extends Parsed...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getShort This helper method returns a 16bit integer from the mResponse byte array, which is in little endian format.
public static short getShort(byte[] response, int startByte) { byte[] subResponse = Arrays.copyOfRange(response, startByte, startByte + 2); ByteBuffer byteBuffer = ByteBuffer.wrap(subResponse); byteBuffer.order(ByteOrder.LITTLE_ENDIAN); short iResponse = byteBuffer.getShort(); return iResponse; ...
[ "static final int get16(byte b[], int off) {\n return (b[off] & 0xff) | ((b[off + 1] & 0xff) << 8);\n }", "private short convertToShort() throws IOException {\n checkBuffer(2);\n short s = (short) (this.buffer[this.bufferOffset] << 8 | this.buffer[this.bufferOffset + 1] & 0xFF);\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field949' field.
public void setField949(java.lang.CharSequence value) { this.field949 = value; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField949(java.lang.CharSequence value) {\n validate(fields()[949], value);\n this.field949 = value;\n fieldSetFlags()[949] = true;\n return this; \n }", "public void setField932(java.lang.CharSequence value) {\n this.field932 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for the field cellCount.
protected int getCellCount() { return this.cellCount ; }
[ "public int getCellCount() {\n return getWidth() * getHeight();\n }", "public int getNumberOfCells() {\n return tableCellList.size();\n }", "public int size() {\r\n return cells.size();\r\n }", "int getMergedCellCount();", "public int getCellSize()\n {\n return cellSize;\n }", "l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the resource path.
public void setResourcePath(String path) { this.path = path; }
[ "public void setResourcePath(IPath path) {\n setResourcePath(path != null ? path.toString() : \"\");\n }", "public void setResourcePath(String resourcePath) {\n //To change body of implemented methods use File | Settings | File Templates.\n }", "void setPath(String path);", "public void setPath(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the player already has a bounty, adds that value to it
public void addBounty(UUID playerUUID, int amount) { if (bountyPlayers.containsKey(playerUUID)) { int pastAmount = this.bountyPlayers.get(playerUUID); this.bountyPlayers.put(playerUUID, pastAmount + amount); } else this.bountyPlayers.put(playerUUID, amount); }
[ "public void addBounty(Bounty b) {\n this.bounties.add(b);\n }", "private void addPlayerSheild() {\n this.playerShield += 1;\n }", "private void givePlayerItem() {\n\t\tif (containedItem != 0) {\r\n\t\t\tPlayer.getPlayer().addItem(containedItem);\r\n\t\t\tcontainedItem = 0;\r\n\t\t}\r\n\t\t/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a scoreboard objective.
public abstract Objective createObjective(Scoreboard parent, String identifier, String title);
[ "public Creator(String score_name) {\n this.score_name = score_name;\n\n this.bukkitScoreboard = Bukkit.getScoreboardManager().getNewScoreboard();\n this.obj = this.bukkitScoreboard.registerNewObjective(randomString(), \"dummy\", \"test\");\n\n this.obj.setDisplaySlot(DisplaySlot.SIDEBAR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate sales trend, seasonal and random values for whsArtTimeline
public void calculateWhsArtTimelineTrendSeasonalAndRandom(WhsArtTimeline whsArtTimeline) throws Exception { // Make timeSeries RCommonConnection connection = null; try { String salesSmootedValues = whsArtTimeline.getSalesSmootedSortedByDate(); LocalDate startTraining = whsArtTimeline.getTimeMoments().g...
[ "private List<SalesAndPriceDeviation> prepareXdataAndYdataForElasticity(WhsArtTimeline whsArtTimeline) {\r\n\t\tList<SalesAndPriceDeviation> salesAndPriceDeviationList = new ArrayList<>();\r\n\r\n\t\tif (whsArtTimeline == null || whsArtTimeline.getTimeMoments() == null || whsArtTimeline.getTimeMoments().size() < 2)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
whenComplete() is a flexible way to handle result/exception
@Test public void whenComplete() throws InterruptedException, ExecutionException { CompletableFuture.supplyAsync(() -> { Random random = new Random(); if (random.nextBoolean()){ return "success"; }else{ //if an error happens, the next stage will not be invoked throw new RuntimeException("error")...
[ "CompletableFuture<WebClientServiceResponse> whenComplete();", "@Override\n public void onError(Exception e) {\n completableFuture.completeExceptionally(e);\n }", "public abstract void finished(Object result);", "public static void completeActionTest() throws ExecutionExce...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'tradeCode' field.
public String getTradeCode() { return tradeCode; }
[ "public String getTradeCode() {\n return tradeCode;\n }", "public String getTradeCode() {\n return tradeCode;\n }", "public void setTradeCode(String value) {\n this.tradeCode = value;\n }", "public java.lang.String getClassOfTradeCode() {\r\n return classOfTradeCode;\r\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List all of images in the blob container
public static String[] ListImages() throws Exception{ String ContainerSas = getContainerSAS(); CloudBlobContainer container = new CloudBlobContainer(new URI(ContainerSas)); Iterable<ListBlobItem> blobs = container.listBlobs(); LinkedList<String> blobNames = new LinkedList<>(); ...
[ "List<ContainerImage> list();", "List<ImageElement> getAllImages();", "public static List<Image> getAllImages() throws SQLException {\n System.out.println(\"Start getAllImages\");\n Statement stmt = null;\n ResultSet rs = null;\n List<Image> listAllImages = new ArrayList<>();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used internally by Word: Web View is on when set to 1
public boolean isFWebView() { return fWebView.isSet( field_32_viewFlags ); }
[ "public void setFWebView( boolean value )\n {\n field_32_viewFlags = fWebView.setBoolean( field_32_viewFlags, value );\n\n }", "@Override\n public boolean handleDocumentView(DocumentView docView) {\n return false;\n }", "public void setFWrapToWwd( boolean value )\n {\n field_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a document from the index.
public void del(String docId);
[ "public void removeByDocumentId(long documentId);", "void unindexDocument(String documentReference, boolean now);", "public void removeDocument(int index) {\n\t\t\tDocument doc = theModel.getUserDocuments()[index];\n\t\t\ttheModel.removeDocument(doc);\n\t\t}", "public void remove(int index);", "public void ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current sample language code.
public String getSampleLanguage () { return sampleLanguage; }
[ "public String getCurrentLanguage() {\n return getStringData(Key.APP_CURRENT_LANGUAGE + \"\", \"zh\");\n }", "public String getCurrentLanguage() {\n return myCurrentLanguage;\n }", "java.lang.String getLanguage();", "public String getSourceLanguage(){\n return source_language;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
!wca! removeIcon: (element: Element | null): void Remove an icon from the given element by undoing the changes effected by applyIcon. element: The element from which the icon is removed.
public void removeIcon(@Nullable Component<?> element) { getElement().removeIcon(element.getElement()); }
[ "void removeIcon(int i);", "public void removeIcon(){\n HomeForm.JPanel1.remove(icon);\n }", "public void removeIcon()\n\t{\n this.setIcon(new ImageIcon());\n\t}", "public void setRemoveIcon(Icon icon) {\n\t\tthis.removeAction.setIcon(icon);\n\t}", "public void clearMainIcon();", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional int32 is_bao_jing = 19;
int getIsBaoJing();
[ "public int getIsBaoJing() {\n return isBaoJing_;\n }", "public int getIsBaoJing() {\n return isBaoJing_;\n }", "boolean getB21();", "boolean getB23();", "boolean getB22();", "boolean getB19();", "boolean getB20();", "boolean getB27();", "boolean getB25();", "public boolean isT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column b_order_list.ship_status
public void setShipStatus(Boolean shipStatus) { this.shipStatus = shipStatus; }
[ "public Boolean getShipStatus() {\n return shipStatus;\n }", "public void setOrderStatusOnSuccessfullShipping(final String value)\n\t{\n\t\tsetOrderStatusOnSuccessfullShipping( getSession().getSessionContext(), value );\n\t}", "public void setMemshipStatus(Number value) {\n setAttributeInternal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action active photop 3.
@FXML public void actionActivePhotop3() { try { moveActivephotoNumTo(+3); refreshAllPhoto(); } catch (IOException | SQLException e) { Context.popupalertException(e); Context.excptlog(e, LOGGER); } }
[ "@FXML\n public void actionActivePhotom3() {\n try {\n moveActivephotoNumTo(-3);\n refreshAllPhoto();\n } catch (IOException | SQLException e) {\n Context.popupalertException(e);\n Context.excptlog(e, LOGGER);\n }\n }", "@FXML\n public void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter for property Do_wa_libelle.
public void setDo_wa_libelle(java.lang.String Do_wa_libelle) { this.Do_wa_libelle = Do_wa_libelle; }
[ "public void setDo_libelle(java.lang.String Do_libelle) {\r\n this.Do_libelle = Do_libelle;\r\n }", "public java.lang.String getDo_wa_libelle() {\r\n return Do_wa_libelle;\r\n }", "public java.lang.String getDo_libelle() {\r\n return Do_libelle;\r\n }", "public void setMa_libelle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disambiguate log(String,String) which could be either log(Object,String) or log(String,Object).
public void log(String p1, String p2) { log(p1, (Object)p2); }
[ "void log(String format, Object arg);", "public void log(int level, String message, Object param1, Object param2);", "protected void log(String str,Object...objects){\n if(log != null)\n log.printf(str,objects);\n else\n System.out.printf(str,objects);\n }", "public void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints the current state table and sorts entries by resources
public void printByResource() { TUseStatus useStatus; for (int b=0; b < m_current_users_count; b++) for (int a=0; a < m_current_resources_count; a++) { useStatus = m_associations[a][b]; if (useStatus!=null) System.out.println(useStatus.toString()); } ...
[ "public void displayStateTable() {\n if (!logger.isDebugEnabled()) {\n return;\n }\n\n for (Entry<String, String> me : STATE_TABLE.entrySet()) {\n String key = me.getKey() + me.getValue().replace(\".\", \",\");\n logger.debug(\"{}\", key);\n }\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the transition style name
public void setTransitionStyle(String transitionStyle) { this.transitionStyle = transitionStyle; }
[ "public void setCurrentStyleName(String name)\n\t{\n\t\tif (name != null)\n\t\t{\n\t\t\tthis.guiController.getCurrentStyle().setName(name);\n\t\t\tthis.styleComboBox.repaint();\n\t\t}\n\t}", "public void setStyleName(java.lang.String styleName)\n {\n synchronized (monitor())\n {\n chec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return whether a given column is deleted by the container having this deletion info.
public boolean isDeleted(IColumn column) { return isDeleted(column.name(), column.mostRecentLiveChangeAt()); }
[ "public static boolean isDelete(String command) {\r\n\t\tassert command != null;\r\n\t\tcommandType = Logic.determineCommandType(command);\r\n\t\tswitch (commandType) {\r\n\t\tcase DELETE:\r\n\t\t\treturn true;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean deleteBy(String ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
aqui temos um metodo chamado getAllUsers ele eh acessivel atraves da url ( como eh para consulta, ele retorna uma lista porem usamos o ResponseEntity para que a gente manipule tb o cabecalho HTTP
@GetMapping("/usuarios") public ResponseEntity<ArrayList<Usuario>> getAllUsers(){ ArrayList<Usuario> lista = (ArrayList<Usuario>)dao.findAll(); return ResponseEntity.ok(lista); }
[ "public synchronized void getUsers() {\n AndroidNetworking.get(BASE_URL + \"users\")\n .setTag(this)\n .setPriority(Priority.LOW)\n .build()\n .getAsObject(UserJsonDataHolder.class, new ParsedRequestListener<UserJsonDataHolder>() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If there is a cached library, then discard the library and notify others that the library is no longer being analyzed
private void discardLibrary(Context context, File libraryFile) { Library library = context.getCachedLibrary(libraryFile); if (library != null) { discardLibrary(context, library); } }
[ "private void discardLibrary(Context context, Library library) {\n AnalysisEvent event = new AnalysisEvent(\n library.getFile(),\n library.getSourceFiles(),\n AnalysisError.NONE);\n\n context.discardLibrary(library);\n discardedLibraries.add(library);\n\n for (AnalysisListener liste...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.com.example.nettyserver.protobuf.EmployeeInfo employeelist = 3;
com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist();
[ "com.example.nettyserver.protobuf.Employee.EmployeeInfoOrBuilder getEmployeelistOrBuilder();", "cn.kungreat.netty.domain.Company.EmployeeOrBuilder getEmployeeOrBuilder();", "cn.kungreat.netty.domain.Company.Employee getEmployee();", "com.zzsong.netty.protobuff.two.ProtoData.Person getPerson();", "com.zzsong...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of scanFile method, of class Engine.
@Test public void testScanFile() throws DatabaseException { try (Engine instance = new Engine(getSettings())) { instance.addFileTypeAnalyzer(new JarAnalyzer()); File file = BaseTest.getResourceAsFile(this, "dwr.jar"); Dependency dwr = instance.scanFile(file); ...
[ "@Override\n public void onScan(File file) {\n }", "@Test\n public void testGetFileScanner() throws Exception {\n //get file scanner cannot be accurately tested as it is dependant on user input\n System.out.println(\"getFileScanner\");\n Scanner expResult = null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
solving the problem with constant space
public boolean findConstantSpace(int num) { int slow = num; int fast = sumSquare(num); while (fast != slow) { if (fast == 1) return true; slow = sumSquare(slow); fast = sumSquare(sumSquare(fast)); } return false; }
[ "public void restructure(double percent, boolean fromLeft, double maxCSPval) throws SolutionFoundException{\n ArrayList<Integer> ind = new ArrayList<Integer>();\n int temp = -1;\n for (ArrayList<Integer> grp : satisfactions_.subList(0, Math.min(satisfactions_.size(), userInput_.totalConstraints...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a listener to the blog.
public Lease addListener(RemoteEventListener<BlogEvent> listener) throws RemoteException;
[ "void addTagListener(final TagListener tagListener);", "public void addListener(Listener listener) {\n m_listeners.add(listener);\n }", "void addListener(URL listenerURL) throws Exception;", "public void addListener(L listener) {\n listeners.add(listener);\n }", "void addServiceListener(Serv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates a new multiple downloads status.
public MultipleDownloadsStatus() { status = NOT_DONE; }
[ "private synchronized void pumpDownloads() {\n int index = 1;\n for(Iterator i = waiting.iterator(); i.hasNext(); ) {\n ManagedDownloader md = (ManagedDownloader)i.next();\n if(md.isAlive()) {\n continue;\n } else if(md.isCancelled() ||md.isCompleted()) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Since pairing flow supports are removed error will be returned in callback
private static void pairingError(MasterpassCheckoutCallback masterpassCheckoutCallback) { Log.e(TAG, "Pairing without checkout is no longer supported"); MasterpassError error = new MasterpassError(MasterpassError.ERROR_CODE_NOT_SUPPORTED, "Pairing without checkout is no longer supported"); masterp...
[ "void onPairingComplete(int errorCode);", "void onPairingDeleted(int errorCode);", "public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }", "@LatchPair(pairingKey = PairingKeyFactory.class)\n public static Result pair() {\n // Get the account ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "entryRuleXFeatureCall" $ANTLR start "ruleXFeatureCall" ../org.xtext.lwc.instances.ui/srcgen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1201:1: ruleXFeatureCall : ( ( rule__XFeatureCall__Group__0 ) ) ;
public final void ruleXFeatureCall() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1205:2: ( ( ( rule__XFeatureCall__Group__0 ) ) ) ...
[ "public final void ruleXFeatureCall() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:1340:2: ( ( ( rule__XFeatureCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__GXorExpression__Group_1__2" $ANTLR start "rule__GXorExpression__Group_1__2__Impl" ../org.gemoc.gel.xtext.ui/srcgen/org/gemoc/gel/ui/contentassist/antlr/internal/InternalGEL.g:6579:1: rule__GXorExpression__Group_1__2__Impl : ( ( rule__GXorExpression__RightOperandAssignment_1_2 ) ) ;
public final void rule__GXorExpression__Group_1__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.gemoc.gel.xtext.ui/src-gen/org/gemoc/gel/ui/contentassist/antlr/internal/InternalGEL.g:6583:1: ( ( ( rule__GXorExpression__RightOperandAss...
[ "public final void rule__GXorExpression__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.gemoc.gel.xtext.ui/src-gen/org/gemoc/gel/ui/contentassist/antlr/internal/InternalGEL.g:6491:1: ( ( ( rule__GXorExpression__Group...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SEARCH /_search/projectmembers?query=:query : search for the projectMember corresponding to the query.
@GetMapping("/_search/project-members") @Timed public ResponseEntity<List<ProjectMemberDTO>> searchProjectMembers(@RequestParam String query, @ApiParam Pageable pageable) { log.debug("REST request to search for a page of ProjectMembers for query {}", query); Page<ProjectMemberDTO> page = project...
[ "List<ImportedMember> search(ImportedMemberQuery params);", "@Query(\"SELECT * FROM memberData WHERE parentProject = :projectID\")\n List<MemberData> searchByProject(String projectID);", "private String handleMemberNameSearch(String query, Map<String, Object> searchFields, String memberText){\n if(memb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test submit() with successful tx provider submit()
@Test public void testSubmitSucceed(){ CachingReadWriteTx cacheRWTx = new CachingReadWriteTx(testTx); CheckedFuture<Void, TransactionCommitFailedException> cf = cacheRWTx.submit(); try { cf.checkedGet(); } catch (Exception e) { fail("Get unexpected exception f...
[ "@Test(dependsOnMethods = \"checkByCustomer\")\n public void submitByTranslator(){\n pluginPage.passThisPage();\n assertTrue(homePage.getSignIn().isDisplayed(),\n var.getElementNotFoundErrMsg());\n homePage.clickSignInButton();\n loginPage.loginAccount(var.getTranslator...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if a lock associated with the given subsystem name is present in the version information table.
public boolean isLocked( String subsystemName ) { try { Statement update = executeSQLWithResult( "SELECT update_lock FROM " + versionTableName() + " WHERE subsystem = '" + subsystemName + "'" ); ResultSet resultSet = update.getResultSet(); ...
[ "public boolean tryToLock( String subsystemName )\n {\n log.debug( \"attempting to lock database for \" + subsystemName );\n try\n {\n Statement update = executeSQLWithResult(\n \"SELECT update_lock FROM \" + versionTableName()\n + \" WHERE subsystem ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Lifeline' reference. If the meaning of the 'Lifeline' reference isn't clear, there really should be more of a description here...
Lifeline getLifeline();
[ "public Integer getLlref() {\r\n\t\treturn llref;\r\n\t}", "public String getLifelineAddress() {\n return this.lifelineAddress;\n }", "LineReferenceType getLineReference();", "public String getLyricLine() { \n checkRep();\n return lyricLine; \n }", "public String getLFN() {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is setter of mAge
public void setAge(int mAge) { this.mAge = mAge; }
[ "protected void setAge(Age age) {\n this.age = age;\n }", "protected void setAge(int age) {\r\n\t\tthis.age = age;\r\n\t}", "public void setAge( int age )\r\n {\r\n myAge = age;\r\n }", "@Override\n public void setAge(int age) {\n _person.setAge(age);\n }", "public void s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Give money and fame to specified player
public void giveFunds(Player player, int money, int fame) { player.setCredit(money); player.setFame(fame); }
[ "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
zipalign p 4 input\appreleaseunsigned.apk input\appreleaseunsigned.apk
private static String apkZipalign(String v1Apk) throws IOException, InterruptedException { String zipalignName = v1Apk.substring(0, v1Apk.indexOf(".apk")) + "_align.apk"; String cmd[] = {"cmd.exe", "/C ", AppManager.RUNTIME_PATH + "bin/zipalign", "-p", "4", v1Apk, zipalignName}; CmdUtils.exec("...
[ "public static void main(String[] args) throws Exception {\n// GameConfig gameConfig = new GameConfig();\n// gameConfig.setGameDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\GameApk\\\\product_anysdk-release.apk\");\n// gameConfig.setGameOutDir(\"G:\\\\amber2\\\\03_tools\\\\Andr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively descend the Preset, starting at group and try to find the item
private boolean contains(@NonNull PresetGroup group, @NonNull PresetItem item) { for (PresetElement element : group.getElements()) { if (element.equals(item)) { return true; } else if (element instanceof PresetGroup) { boolean found = contains((PresetGroup...
[ "private PropertyItem findItem(IPropertySheetEntry entry) {\r\n\t\t// Iterate through treeItems to find item\r\n\t\tPropertyItem[] items = pv2.getItems();\r\n\t\tfor (int i = 0; i < items.length; i++) {\r\n\t\t\tPropertyItem item = items[i];\r\n\t\t\tPropertyItem findItem = findItem(entry, item);\r\n\t\t\tif (findI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CUSTOM_EXCLUDE_BEGIN Attaches an envelope to this message. The envelope is used by the ACC for interplatform messaging.
public void setEnvelope(Envelope e) { messageEnvelope = e; }
[ "public void setEnvelope(Envelope envelope) {\n this.envelope = envelope;\n }", "protected void setInEnvelope(boolean inEnvelope) {\tthis.inEnvelope = inEnvelope;\t}", "public interface AddressedEnvelope<M, A extends SocketAddress> extends ReferenceCounted {\n M content();\n\n A recipient();\n\n Ad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the "damage" element
java.lang.String getDamage();
[ "int getDamage();", "org.apache.xmlbeans.XmlString xgetDamage();", "public int getDamage() {\r\n return damage;\r\n }", "public int getDamage() {\n return damage;\n }", "public int getDamage(){\n\t\t\treturn damage;\n\t\t}", "public int getDamage() {\r\n\t\treturn myDamage;\r\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a perf thread for the specified test instance.
public SingleTestRunner(PerfTest test) { this.test = test; }
[ "DriverThread(RacingThreadsTest test) {\n super(\"DriverThread\");\n this.test = test;\n }", "private Thread startTestThread(Runnable runnable) {\n Thread t = new Thread(runnable);\n t.setDaemon(true);\n return t;\n }", "public SingleTestRunner(long id, PerfT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a StepTracker object with minimum steps per day to be considered an active day. Initializes day, activeDay, and totalSteps to 0.
StepTracker(int minimum) { STEPS = minimum; day=0; activeDay=0; totalSteps=0; }
[ "public void addDailySteps(int steps) {\n totalSteps+=steps;day++;\n if (steps>=STEPS) activeDay++;\n }", "public Dayplanner() {\n activitySize = 0;\n\t}", "public void startCountdown() {\n removeAnyPreviousObservers();\n currentStartingValue = 0L;\n currentD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drawOn draws the number of lives on top of the screen.
@Override public void drawOn(DrawSurface d) { d.setColor(Color.black); d.drawText(100, 10, "Lives: " + lives, 10); }
[ "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
play(Hand hand1, Hand hand2) ONE PAIR VS
@Test public void play_OnePairVsOnePair() throws Exception { Hand hand1 = new Hand(); hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_6)); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7)); hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_8)); hand1.addCard(new Ca...
[ "@Test\n public void play_TwoPairVsTwoPair() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_3));\n hand1.add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
build one customer. User should use builder to create new instance of Customer class. ie Customer customer = new Customer.CustomerBuilder().id(id).build(); every builder is optional
public Customer build() { return new Customer(this); }
[ "private Customer(CustomerBuilder customerBuilder) {\n id = customerBuilder.id;\n friends = customerBuilder.friends;\n purchases = customerBuilder.purchases;\n }", "private Customer(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public static Builder newB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a Scope for a given Context; if a scope with such a context already exists, it will be returned, otherwise a new scope will be created and registered to the respective index
public Scope getScope(Topic context){ Scope s = this.getScopeByContext(context); if(s != null) return s; s = new Scope(); s.addToContext(context); scopes.put(s.getId(), s); return s; }
[ "public Scope getScope(Set<Topic> context){\n\t\tScope s = this.getScopeByContext(context);\n\t\tif(s != null)\n\t\t\treturn s;\n\t\ts = new Scope();\n\t\ts.setContext(context);\n\t\tscopes.put(s.getId(), s);\n\t\treturn s;\n\t}", "public Scope getScopeByContext(Topic context){\n\t\tScope curS;\n\t\tIterator<Stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the offer throughput for this offer.
public void setOfferThroughput(int throughput) { this.getContent().put(Constants.Properties.OFFER_THROUGHPUT, throughput); }
[ "public void setThroughput(double throughput)\n {\n \tthis.throughput= throughput;\n }", "public void setThroughput(double throughput) {\n\t\tthis.throughputRequired = throughput;\n\t}", "public void setSendRequestThroughput(Double sendRequestThroughput)\r\n {\r\n this.sendRequestThroughput =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to withdraw trip using trip Id.
public void withdrawTrip(final String tripId) { Optional<Trip> optionalTrip = this.getTrip(tripId); if (!optionalTrip.isPresent()) { throw new TripNotFoundException( "No Trip found for the given Id = " + tripId + ", please try with valid Trip Id."); } Trip trip = optionalTrip.get(); ...
[ "public void setTripId(String tripId) {\n this.tripId = tripId;\n }", "public void setTripId(){\n tripId = \"mXdgfyxOyh1zaolkJQPU\";\n }", "public abstract void withdraw(String id, Money amount);", "public String getTripId() {\n return tripId;\n }", "public static Task<Void> de...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upon clicking this link, go to Hvac1Page.
@Override public void onClick() { setResponsePage(new HvacPage()); }
[ "@Override\r\n public void onClick() {\r\n setResponsePage(new Hvac2Page());\r\n }", "public HomePage clickQuickView1Link() {\n quickView1.click();\n return this;\n }", "HtmlPage clickSiteLink();", "public void navigateToHomePagefromActivity(){\n\t\tcloseInstIcon();\n\t\tmous...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the api item list
public final ArrayList<ApiItem> getApiItems() { return apiItems; }
[ "public static List<Item> getItems() {\n\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/item/all\")).setHeader(\"Cookie\", Authenticator.SESSION_COOKIE).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve session response Retrieves the response of a single identifaction session. REMARK: Only authenticate users when the identitication status is equal to SUCCESS.
public IdentificationResponse retrieveSessionResponse(String requestId, Boolean metaData) throws Exception, IdfyException { // create path and map variables String localVarPath = "/session"; // Base path still needs to be added manually. Some APIs (such as Signature) are missing the "base path"...
[ "@Path(\"/{id}\")\n @GET\n public Response getSession(@PathParam(\"id\") Long id) {\n log.debug(\"REST request to get Session : {}\", id);\n Session session = sessionRepository.find(id);\n return Optional.ofNullable(session)\n .map(result -> Response.status(Response.Status....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clip a bid such that no power value in the bid exceeds the given floor. Any value in the resulting bid will have resulted from the given bid (i.e. no new power level values will have been introduced).
private ArrayBid clipBelow(final ArrayBid bid, final double floor) { double[] demand = bid.getDemand(); // find end of unclipped region int end = this.findLastIndexOfUnclippedRegion(demand, floor); if (end == -1) { // if there is no unclipped region we use the first (highes...
[ "private ArrayBid clipAbove(final ArrayBid bid, final double ceiling) {\n double[] demand = bid.getDemand();\n\n // find start of unclipped region\n int start = this.findFirstIndexOfUnclippedRegion(demand, ceiling);\n\n // if there is no unclipped region we use the last (lowest value)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the new orientation according the current orientation and the action specified.
private Orientation getNewOrientation(Orientation currentOrientation, Action turn) { Orientation next = null; if (turn == Action.LEFT) { if (currentOrientation == Orientation.NORTH) { next = Orientation.WEST; } else if (currentOrientation == Orientation.WEST) { next = Orientation.SOUTH; } else if (...
[ "public abstract void rotateTo(int orientation);", "public int getNewOrientation() {\n return newOrientation;\n }", "public void setNewOrientation(int value) {\n this.newOrientation = value;\n }", "private void updateOrientation(){\n double rawOrientation = getAngle();\n dou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a MelatiLocale based on a language tag. Locales are cached for future use.
public MelatiLocale getLocale(String languageHeader) { // language headers may have multiple language tags sperated by , String tags[] = StringUtils.split(languageHeader, ','); MelatiLocale ml = null; // loop through until we find a tag we like for (int i=0; i<tags.length; ...
[ "public static Locale forLanguageTag(String langtag) {\n LanguageTag tag = null;\n while (true) {\n try {\n tag = LanguageTag.parse(langtag);\n break;\n } catch (InvalidLocaleIdentifierException e) {\n // remove the last subtag and try...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__State__Group_2__1__Impl" $ANTLR start "rule__State__Group_2__2" ../org.xtext.example.rmodp.ui/srcgen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:7001:1: rule__State__Group_2__2 : rule__State__Group_2__2__Impl rule__State__Group_2__3 ;
public final void rule__State__Group_2__2() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:7005:1: ( rule__State__Group_2__2__Impl rule_...
[ "public final void rule__State__Group__2__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:6857:1: ( ( ( rule__Stat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if child shadow is enabled. This is not only for enable/disable default shadow implementation but also subclass must respect this flag.
public final boolean getShadowEnabled() { return mShadowEnabled; }
[ "public boolean hasShadow() {\n\t\treturn !hasElevation() && getShadowRadius() > 0.0f;\n\t}", "public boolean isShadowCastingEnabled() {\n return this.enableShadows;\n }", "public Boolean getShadow() {\r\n\t\treturn shadow;\r\n\t}", "boolean hasShadowRules();", "public final void setShadowEnabled(boolea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the manager to contain the scheduled workouts for the previous week
void setToLastWeek(ScheduleWeek scheduleWeek);
[ "void setToCurrentWeek(ScheduleWeek scheduleWeek);", "void setToNextWeek(ScheduleWeek scheduleWeek);", "public void setPrevWeek()\n\t{\n\t\tm_calendar.set(Calendar.WEEK_OF_MONTH,getWeekOfMonth()-1);\n\n\t}", "public void resetWeek()\n {\n for (int k = 0; k < currentEmployees; k++)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Does the current dialect support propogating changes to LOB values back to the database? Talking about mutating the underlying value as opposed to supplying a new LOB instance...
protected boolean supportsLobValueChangePropogation() { if ( ! getDialect().supportsLobValueChangePropogation() ) { reportSkip( "database/driver does not support propogating LOB value change back to database", "LOB support" ); return false; } return true; }
[ "public boolean isColumnLongDirty(java.lang.Long value) {\n\t throw new java.lang.UnsupportedOperationException(\"IsDirty is not supported on tombstones\");\n\t }", "boolean getAClobChanged();", "public boolean isLeadChangesDirty(java.lang.Long value) {\n\t throw new java.lang.UnsupportedOperationExcepti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Splits a string on any charachter that is not a number or a minus symbol
private static String[] split(String nos) { if(nos.contains("\n") && nos.startsWith("//")) { nos = nos.substring(nos.indexOf('\n') + 1, nos.length()); } return nos.split("[^0-9&^-]+"); }
[ "static String[] splitIntoAlphasAndNums( String s )\n\t{\n\t\tif ( \"\".equals( s ) )\n\t\t{\n\t\t\treturn new String[]{\"\"};\n\t\t}\n\t\ts = s.toLowerCase( Locale.ENGLISH );\n\n\t\tList<String> splits = new ArrayList<String>();\n\t\tString tok = \"\";\n\n\t\tchar c = s.charAt( 0 );\n\t\tboolean isDigit = isDigit(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the 'Discipline' field has been set
public boolean hasDiscipline() { return fieldSetFlags()[2]; }
[ "public boolean isDiscipline()\n\t{\n\t\treturn (dataObj.getClass().equals(Discipline.class));\n\t}", "public boolean isSetCourse() {\r\n return this.course != null;\r\n }", "public String getDiscipline() {\n return discipline;\n }", "boolean isSetCourse();", "public boolean isSetCusIntro(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns top (with maximum value) 1000 elements. Could be called anytime. can return only 1000 and now less. If Less 1000 then thread is waiting
@SneakyThrows public synchronized List<T> getTop() { while (incomeStoredList.size() < MAX_COUNT_IN_TOP) { System.out.println("I'm sleeping. ActualStored = " + incomeStoredList.size()); Thread.sleep(1000); } resizeToMaxCountInTop(); return incomeStoredList; ...
[ "int getTopN();", "public int getTopN() {\n return topN_;\n }", "public int getTopN() {\n return topN_;\n }", "com.braincs.attrsc.protocol.protobuf.Protocol.Recognize.Result getTop(int index);", "public LinkedList<Home> topTenHighestConsumers(){\n\t\t// Sort houses from the highest to th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the position of the sensor to the given Rotation2d pos_
public void setRotation(RoundRotation2d pos_) { getMaster().setSensorPosition(pos_); }
[ "public void setCoordinates(double[] pos) {\n \tthis.currentX = pos[0];\n \tthis.currentY = pos[1];\n }", "void setPosition(double xPos, double yPos);", "public void setPosition(Position pos);", "public void setPosEnEntrante(Position<Arco<E>> pos){\r\n\t\tposV2 = pos;\r\n\t}", "public void setPosit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Implements OperationSetMultiUserChatremoveInvitationListener( ChatRoomInvitationListener).
public void removeInvitationListener(ChatRoomInvitationListener listener) { synchronized (invitationListeners) { invitationListeners.remove(listener); } }
[ "private void removeInvitation() {\n User currentUser = userManager.getLoggedUser(); \n event.getInvitedUsers().remove(currentUser);\n eventManager.update(event); \n currentUser.getInvitations().remove(event);\n userManager.update(currentUser);\n }", "private void dele...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set notch bar width. The length, in screen coordinates, of the x Axis of the notches. Zero (0) will be the minRange and notchBarWidth will be the maxRange right point. The use will scroll the whole notch bar width to go from minRange to maxRange.
public void setNotchBarWidth(Integer notchBarWidth) { this.notchBarWidth = notchBarWidth; invalidate(); }
[ "public Integer getNotchBarWidth() {\n\t\treturn notchBarWidth;\n\t}", "public void setBarWidth(float value) {\n this.barWidth = value;\n }", "private void setHorizontalScrollBar() {\n\t\tfor (int i = 0; i < changelog_output.getLineCount(); ++i) {\n\t\t\tif (changelog_output.getLine(i).length() > line...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tear down: Delete reference to connector. (Called after every test case method.)
@Override public void tearDown() { connector = null; }
[ "@After\n\tpublic void tearDown() throws Exception {\n\t\tserverChannel.close();\n\t\tchannel = null;\n\t\tclient = null;\n\t}", "public void removeConnector(Connector connector);", "private void disconnect() {\n if (orderConnector != null) {\n orderConnector.disconnect();\n orderCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the pairing value of 'name' is a string, return it, otherwise return null
@Override public String getString(String name) { return (list.get(name) instanceof String) ? (String)list.get(name) : null; }
[ "public NameSurferEntry findEntry(String name) {\n\t\tchar ch = name.charAt(0);\n\t\tif(Character.isLowerCase(ch) == true) {\n\t\t\tch = Character.toUpperCase(ch);\n\t\t}\n\t\tString otherLetters = name.substring(1);\n\t\totherLetters = otherLetters.toLowerCase();\n\t\tname = ch + otherLetters;\n\t\tif (nameFromDat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs the supplied op codes and returns the value of the accumulator upon termination Terminates upon infinite loop. Optionally can try to fix the infinite loop.
private static OpCodeResult run(String[] commands, boolean fixInfiniteLoop) { int accumulator = 0; Integer pointer = 0; HashSet<Integer> visitedCommands = new HashSet<>(); int pointerLastCommand = commands.length - 1; boolean foundInfiniteLoop = false; // Re-usable v...
[ "public int nextValue(int code, int ops[]) {\n \tfor(int i = 31; i>= 0; i--) {\n \t\tif(this.isLegalOperation(code, ops, i)) {\n \t\t\treturn this.performOperation(code, ops, i);\n \t\t}\n \t\telse {\n \t\t\tops[i] = -ops[i]; // change operation\n \t\t}\n \t} \t\n \treturn 0; // this ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the route average propagation speed in km per second, as the ratio between the total route length and the total route delay (not including the processing time in the traversed resources)
public double getPropagationSpeedInKmPerSecond () { double accumDelaySeconds = 0; double accumLengthKm = 0; for (Link e : cache_seqLinksRealPath) { accumDelaySeconds += e.lengthInKm / e.propagationSpeedInKmPerSecond; accumLengthKm += e.lengthInKm; } return accumLengthKm / accumDelaySeconds; }
[ "public double getAvgSpeed(){\n\t\treturn (int)(totalSpeed/prevGameTime * 10) / 10.0; //return average with one decimal point (*10 / 10.0)\n\t}", "public double avgSpeed();", "public float getAvgSpeed() {\n return (Math.round(avgSpeed * 10f) / 10.0f);\n }", "double getAverageLatency();", "public v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines a generic Selenium RMI Server to communicate with multiple Selenium RMI Agents. A Selenium RMI Server is the centralized controller embedded within each remote Selenium Standalone Server. This provides an RMI gateway to the remote host machines running a Selenium Server allowing us to provide additional functio...
public interface SeleniumRMIServer extends Remote { /** * 'SAFS/SeleniumRMIServer' */ public static final String DEFAULT_RMI_SERVER = "SAFS/SeleniumRMIServer"; /** * 'safs.server.running' System Property signifying this JVM contains the RMI Server * and any RMI Agents should shutdown and not attempt to...
[ "public RmiServer()\n throws RemoteException, MalformedURLException\n {\n\n startRegistery();\n startServer();\n this.model = new ModelManagerServer();\n \n }", "public static void main ( String args [] )\n {\n // Variable deceleration\n String hostname = \"localhost...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "K_END" $ANTLR start "K_PROTO"
public final void mK_PROTO() throws RecognitionException { try { int _type = K_PROTO; int _channel = DEFAULT_TOKEN_CHANNEL; // /Users/ckbest83/Documents/workspace/Test/src/test/Test.g:218:11: ( 'PROTO' ) // /Users/ckbest83/Documents/workspace/Test/src/test/Test.g:...
[ "public final void mPROTO_KW() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = PROTO_KW;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// src/VSLLexer.g:28:11: ( 'PROTO' )\n\t\t\t// src/VSLLexer.g:28:13: 'PROTO'\n\t\t\t{\n\t\t\tmatch(\"PROTO\"); \n\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns render size modifier
@Override public float getRenderSizeModifier() { return getScale(); }
[ "public abstract int getRenderSize();", "public SizeModifier getSizeModifier()\n {\n return m_sizeModifier;\n }", "protected String sizeString()\n {\n return (\" (\" + map.getSizeX() + \" x \" + map.getSizeY() + \")\");\n }", "private JCExpression getSize() {\n if (refSym.isSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates MergedSpectraTable to SpectraTable
void changeMergedTableNameToSpectrumTable(){ try (Statement stmt = specDbConnection.createStatement() ){ int deletedRows = stmt.executeUpdate("ALTER TABLE "+MergedSpectrumTable+" RENAME TO "+SpectraTable); } catch (SQLException ex) { ex.printStackTrace(); } }
[ "void createNewMergedSpectraTable(){\n\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS \"+MergedSpectrumTable+\" (\\n\"\n + \" peptideID integer PRIMARY KEY,\\n\"\n + \" peakMZ Binary,\\n\"\n + \" peakIntensi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output has been completed in a section of the test result.
void completedOutput(TestResult tr, Section section, String outputName);
[ "void completedSection(TestResult tr, Section section);", "public void ex02() {\n\n boolean hasFinished = false;\n\n\n if (hasFinished==true) {\n printResults();\n }\n\n\n }", "void completed(TestResult tr);", "void updatedOutput(TestResult tr, Section section, String output...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Class Variable' containment reference. If the meaning of the 'Class Variable' containment reference isn't clear, there really should be more of a description here...
ClassVariable getClassVariable();
[ "Variable getVariable();", "VariableReference getVariableReference();", "private static RubyModule getClassVariableBase(ThreadContext context, Ruby runtime) {\n SinglyLinkedList cref = context.peekCRef();\n RubyModule rubyClass = (RubyModule) cref.getValue();\n if (rubyClass.isSingleton(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that existing friend connection will not result in save.
@Test public void addDuplicateConnection2ExistingUserWithConnections() { Person record = new Person().setEmail("person1@email.com").setId(new ObjectId()).setFriends(new ArrayList<>(Arrays.asList("person1Friend1@email.com"))); Person friendRecord1 = new Person().setId(new ObjectId()).setEmail("person...
[ "@Test\r\n\tpublic void testOutgoingFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.nonDatabase = true;\r\n\t\tassertTrue(p1.newOutgoingFriendRequest(\"test\"));\r\n\t\tassertFalse(p1.newOutgoingFriendRequest(\"test\")); // Fail if duplicate\r\n\t}", "@Test\n public void testCheckBuddiesFalse() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that we can open files that come via Lotus notes. These have a top level directory without a name....
@Test void testNotesOLE2Files() throws Exception { // Check the contents DirectoryNode root = openSample("Notes.ole2"); assertEquals(1, root.getEntryCount()); Entry entry = root.getEntries().next(); assertTrue(entry.isDirectoryEntry()); assertTrue(entry instanceof Di...
[ "@Test\n public void testFileInDirectoryFileDoesNotExists() {\n\n assertFalse(parent.fileInDirectory(\"file1\"));\n }", "@Test\n public void testLsFile() {\n FileTree myTree = new FileTree();\n String[] paths = {};\n try {\n myTree.makeFile(\"/file\");\n } catch (NotDirectoryException | Alr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Record a new violation of the contextual rule, at the given node.
public void addViolation(Node location) { addViolationWithMessage(location, getDefaultMessage(), NO_ARGS); }
[ "Violation createViolation();", "public void visit(FailNode node);", "private void addError(ParserRuleContext node, String message) {\n int line = node.getStart().getLine();\n int column = node.getStart().getCharPositionInLine();\n message = String.format(\"Line %d:%d - %s\", line, column, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "RULE_ACTION_STRING_LITERAL" $ANTLR start "RULE_ACTION_CHAR_LITERAL"
public final void mRULE_ACTION_CHAR_LITERAL() throws RecognitionException { try { // InternalUniMapperGenerator.g:5129:35: ( '\\'' ( RULE_ACTION_ESC | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) // InternalUniMapperGenerator.g:5129:37: '\\'' ( RULE_ACTION_ESC | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ...
[ "public final void mSTRING_LITERAL() throws RecognitionException {\n try {\n int _type = STRING_LITERAL;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n int c;\n\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cq...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the "ProductCode" element
java.lang.String getProductCode();
[ "public java.lang.String getProductCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PRODUCTCODE$0, 0);\n if (target == ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates triangle data input
public boolean validateTriangleData(){ if(getUnparsedTriangleString() == null) throw new NullPointerException("Unparsed triangle string cannot be null!!"); if(unparsedTriangleString.equals("") || unparsedTriangleString.equals(" ")) throw new IllegalArgumentException("Invalid in...
[ "void checkTriangleType() {\n\n int x = triangle.x;\n int y = triangle.y;\n int z = triangle.z;\n\n if (x <= 0 || y <= 0 || z <= 0) triangle.triangleType = TriangleType.INVALID; // INVALID\n else if (x >= y + z || z >= x + y || y >= x + z) triangle.triangleType =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses a "SetCookie" header and creates/updates/deletes cookies according to the parsed values. Parsing is done according to the specification in RFC 2109
public void parseCookieHeader(String s) { StringTokenizer t = new StringTokenizer(s, ";"); Cookie cookie = new Cookie(); while (t.hasMoreTokens()) { Matcher m = pNvPair.matcher(t.nextToken()); if (m.matches()) { String n = m.group(1); ...
[ "void setCookies(String headerValue);", "public static RequestCookie parseSetCookieHeader(RequestHeader setHeader, final String cookieName){\n\n if ( ! setHeader.getName().equalsIgnoreCase(SET_COOKIE_HEADER_NAME)){\n LOGGER.warn(\"Provider header (\" + setHeader +\") is not \\\"\" + \"Set-Cookie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies a file src to a destination dest.
public static void copyFile(File src, File dest){ try { dest.createNewFile(); FileChannel inputChannel = null; FileChannel outputChannel = null; try { inputChannel = new FileInputStream(src).getChannel(); outputChannel = new FileOutputStream(dest).getChannel(); outputChannel.transferFr...
[ "private static void copy(File src, File dest) throws IOException {\n\t\tInputStream in = new FileInputStream(src);\n\t\tOutputStream out = new FileOutputStream(dest);\n\t\tbyte[] buf = new byte[1024];\n\t\tint len;\n\t\twhile ((len = in.read(buf)) > 0) {\n\t\t\tout.write(buf, 0, len);\n\t\t}\n\t\tin.close();\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if(RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE)!=null) /if(ringtone_to_set.toString()!="") RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE, ringtone_to_set);
public void setRingtone(Uri ringtone_to_set){ Settings.System.putString(getContentResolver(), Settings.System.RINGTONE, ringtone); }
[ "private Uri getDefaultRingtone(){\n return RingtoneManager.getActualDefaultRingtoneUri(DetailActivity.this,\n RingtoneManager.TYPE_ALARM);\n }", "private Uri getCurrentRingtone(){\n return mAlarmRingtone != null ? mAlarmRingtone : getDefaultRingtone();\n }", "public void play...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field gcmId is set (has been assigned a value) and false otherwise
public boolean isSetGcmId() { return this.gcmId != null; }
[ "public boolean isSetGid() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GID_ISSET_ID);\n }", "private boolean registerGCM() {\n\t\tif (relayMode == RelayMode.GCM) {\n\t\t\tregistrationId = GCMRegistrationUtil.getRegistrationId(context, gcmSenderId);\n\t\t\treturn registrationId !...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the nc pass of this events.
@Override public void setNcPass(java.lang.String ncPass) { _events.setNcPass(ncPass); }
[ "@Override\n\tpublic java.lang.String getNcPass() {\n\t\treturn _events.getNcPass();\n\t}", "public void setPassCounter()\r\n {\r\n passCounter++;\r\n\r\n }", "public void setPass(boolean pass) {\r\n this.pass = pass;\r\n\r\n setChanged();\r\n notifyObservers(this);\r\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SEARCH /_search/buckets?query=:query : search for the bucket corresponding to the query.
@GetMapping("/_search/buckets") @Timed public ResponseEntity<List<BucketDTO>> searchBuckets(@RequestParam String query, @ApiParam Pageable pageable) { log.debug("REST request to search for a page of Buckets for query {}", query); Page<BucketDTO> page = bucketService.search(query, pageable); ...
[ "List<Codebadge> search(String query);", "List<SearchResult> search(SearchQuery searchQuery);", "void executeSearch(String query);", "List<Tache> search(String query);", "private void searchFor(String query) {\n AnalyticsHelper.sendEvent(SCREEN_LABEL, \"Search\", \"\");\n Bundle args = new Bun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the thumbnail image for the given ImageInfo, or return null.
RenderedImage getImage(ImageInfo info, int maxImageSize) { try { return maybeGetImage(info, maxImageSize); } catch (Throwable t) { logNonFatal(t, info); return null; } }
[ "public Articleimage getThumbnail()\n {\n if(hasThumbnails())\n return (Articleimage)thumbnails.firstElement();\n\n return null;\n }", "private static Bitmap getImage(JSONObject volumeInfo) throws JSONException {\n Bitmap image = null;\n JSONObject imageLinks = volumeI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the Stock API URL.
public String getStockSearchURL() { StringBuilder URL = getStockURL(); URL.append(applicationConfig.getStockSearchURL()); return URL.toString().replace("<token>", applicationConfig.getStockAPIToken()); }
[ "java.lang.String getApiUrl();", "private String getApiURL() {\n\t\treturn getWebsiteURL() + \"/api\";\n\t}", "public String getUrl()\n\t\t{\n\t\t\treturn \"https://developer.zohoapis.eu\";\n\t\t}", "public String getUrl()\n\t\t{\n\t\t\treturn \"https://sandbox.zohoapis.eu\";\n\t\t}", "public String getURL(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether there are any transactions which exceed the set time limit.
public void checkTransactions() { if (log.isDebugEnabled()) { log.debug("Checking {} transaction threads", registeredThreads.size()); } List<Thread> toInterrupt = registeredThreads.entrySet() .stream().filter(entry -> { long now = System.currentTimeMillis(); long dur = now - entry.getValue(); lo...
[ "boolean hasTransactionLimit();", "private static boolean ifTotalExpired() {\n ArrayList<Transaction> usageList = findTransactionsByUser();\n String today = new SimpleDateFormat(\"yyyyMMdd\").format(new Date());\n long totalDiff = 0;\n Transaction takeTransaction = null;\n\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Con that help us get an num in order to pick a category num.
Category(int num) { this.num = num; }
[ "public int category() {\n return 11;\n }", "public int getCategory(double[] classification);", "public static int getNumberCategory(Context context, String number) {\n int category = 0;\n if (isInBlackList(context, number)) {\n category = BlacklistData.BlacklistTable.CATEGORY...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the root of the mock data directory,
public File getDataDirectoryRoot() { return data; }
[ "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "public String getDataDir() {\n return dataDir.getAbsolutePath();\n }", "public Path getDataDirectory();", "private static String getDataDir() {\n return self.get(\"dataDir\");\n }", "File getRoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "RULE_TOKENS_SPEC" $ANTLR start "RULE_RULE_REF"
public final void mRULE_RULE_REF() throws RecognitionException { try { int _type = RULE_RULE_REF; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalUniMapperGenerator.g:5105:15: ( 'a' .. 'z' ( RULE_NAME_CHAR )* ) // InternalUniMapperGenerator.g:5105:17: 'a' .. 'z' ...
[ "public final void ruleref() throws RecognitionException {\n try {\n // ASTVerifier.g:307:5: ( ^( ROOT RULE_REF ( ARG_ACTION )? ) | ^( BANG RULE_REF ( ARG_ACTION )? ) | ^( RULE_REF ( ARG_ACTION )? ) )\n int alt41=3;\n switch ( input.LA(1) ) {\n case ROOT:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__IterateExp__IteratorsAssignment_3" $ANTLR start "rule__IterateExp__IteratorsAssignment_4_1" InternalOCLlite.g:10768:1: rule__IterateExp__IteratorsAssignment_4_1 : ( ruleIterator ) ;
public final void rule__IterateExp__IteratorsAssignment_4_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalOCLlite.g:10772:1: ( ( ruleIterator ) ) // InternalOCLlite.g:10773:2: ( ruleIterator ) { // InternalO...
[ "public final void rule__IterateExp__IteratorsAssignment_3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalOCLlite.g:10757:1: ( ( ruleIterator ) )\n // InternalOCLlite.g:10758:2: ( ruleIterator )\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parsing method for coefficient ring. syntax: Rat | Q | Int | Z | Mod modul | Complex | C | Quat | AN[ (var) ( poly ) | AN[ modul (var) ( poly ) ]
@SuppressWarnings("unchecked") public RingFactory nextCoefficientRing() throws IOException { RingFactory coeff = null; coeffType ct = null; int tt; tt = tok.nextToken(); if ( tok.sval != null ) { if ( tok.sval.equalsIgnoreCase("Q") ) { coef...
[ "@SuppressWarnings(\"unchecked\")\n public RingFactory nextCoefficientRing() throws IOException {\n RingFactory coeff = null;\n coeffType ct = null;\n int tt;\n tt = tok.nextToken();\n if (tok.sval != null) {\n if (tok.sval.equalsIgnoreCase(\"Q\")) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }