query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Get the drawable resource for the given unicode.
@Override public int getIcon(String unicode) { return hasEmoticonIcon(unicode) ? EmoticonList.EMOTICONS.get(unicode) : -1; }
[ "public Drawable getDrawable(String source);", "public Drawable getDrawableResource(LocaleDrawableResource resource){\n Context c = ConnectedApp.getContextStatic();\n switch(resource){\n case logo_splash:\n String name = resource.toString();\n String nameLoca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the title of the issue.
public String getTitle() { return this.issue.getSummary(); }
[ "public String getBugTitle() {\n\t\treturn bugTitle;\n\t}", "public String getTitle() {\r\n return (String) get(\"title\");\r\n }", "public @Nullable\n String getTitleErrorString() {\n return titleErrorString;\n }", "public String title() {\n\t\treturn title;\n\t}", "public static Str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows the error message during loading. Since the general IO exception is handled when executing the process, the error leads to this would be the file is edited in a wrong way.
public void showLoadingError() { System.out.println("You edit the file in a wrong format. Please check."); }
[ "public void showFileLoadingError() {\n System.out.println(\"Data cannot be loaded\");\n }", "public String showLoadingError(Exception e){\n return \"File not found\" + e.getMessage() + \"\\n\";\n }", "public void showLoadingError() {\n System.out.println(\"Failed to load from saved d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Solves Sudoku with BFS
private static boolean BFSSolve(State board) { counter = 1; // Adds initial board state in to queue queue.enqueue(board); while (true) { // If Queue is empty, the Sudoku is unsolvable if (queue.isEmpty()) return false; // Returns true ...
[ "public abstract void solveBFS();", "public void solveBFS() {\n\t\tbuildGraph();\n\t\tLinkedList<Node> list = new LinkedList<Node>();\n\t\tNode currnode, goal;\n\n\t\tgoal = maze[goalx][goaly];\n\t\tcurrnode = maze[startX][startY];\n\t\tcurrnode.visited = true;\n\t\t\n\t\t\n\t\t\n\t\tlist.add(currnode);\n\t\tNode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns site key which is used in recaptcha
public static String getSiteKey(Context context) { HyperLog.i(TAG,"Getting site key"); InputStream rawResource=null; try { Resources resources = context.getResources(); rawResource = resources.openRawResource(R.raw.config); Properties properties = new Prop...
[ "java.lang.String getCaptchaToken();", "public static String generateKeyFromSite(String theSite, CryptnosApplication theApp) {\n try {\n if (theSite != null && theSite.length() > 0) {\n MessageDigest hasher = MessageDigest.getInstance(\"SHA-512\");\n return base64St...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
judge whether the item is a header with item's position
boolean isHeader(int position);
[ "abstract protected boolean isHeaderLine(String line);", "public abstract boolean isFirstLineHeader();", "public boolean isHeaderShown();", "boolean hasRentalHeader();", "boolean isSetHeader();", "public int getPinnedHeaderState(int position) {\n\t\t\tfinal Cursor cursor = getCursor();\n\t\t if (mIndex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a hex representation to a Java long.
public static long hexToLong(String s) { return Long.parseLong(s, 16); }
[ "long decodeLong();", "public static long toNumber(final String hexadecimal) {\n\t\treturn toNumber(toBytes(hexadecimal));\n\t}", "public static long toNumber(final char[] hexadecimal) {\n\t\treturn toNumber(toBytes(hexadecimal));\n\t}", "public static long parseIdFromHex(String hex) {\n if (hex != nul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Selects a random species, species with higher total fitness have a better chance
private Species getRandomSpeciesBaisedAdjustedFitness(Random random) { double completeWeight = 0.0; for (Species s : species) { completeWeight += s.totalAdjustedFitness; } double r = Math.random() * completeWeight; double countWeight = 0.0; for (Species s : species) { countWeight += s.totalAdj...
[ "private int intGetRandomGenomeBiasedAdjustedFitness(Species selectFrom, Random random) {\r\n\t\tdouble completeWeight = 0.0;\r\n\t\tfor (integerFitnessGenome fg : selectFrom.fitnessInt) {\r\n\t\t\tcompleteWeight += fg.fitness;\r\n\t\t}\r\n\t\tdouble r = Math.random() * completeWeight;\r\n\t\tdouble countWeight = 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculateReward method: returns the number of reward points earned for a given transaction total.
private static int calculateReward(int total) { if (total <= 50) { return 0; } else if (total <= 100) { return total - 50; } else { int dblPts = total - 100; return 50 + 2 * dblPts; } }
[ "double getTotalReward();", "int getExtraRewardCount();", "public double getLastReward();", "public float calulateReward(){\n\t\t\n\t\tif(this.currentDepth==0){\n\t\t\treturn this.evaluate();\n\t\t}\n\t\t// else calculate the value of all the children\n\t\telse if(this.opponent){\n\t\t\t// Pick lowest r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that removes values from the position cache for the two move possible after the first move.
private void removeTwoStepForwardFromPositionCache(Key currentKey) { // Create a two square forward position Key newKey =createTwoStepForwardFromCurrentKey(currentKey); // Gets current values stored with key and adds the extra position Set<Key> currentKeyMapping = positionCache.get(currentKey); // Remove k...
[ "void retract() {\n assert movesMade() > 0;\n Move move = _moves.remove(_moves.size() - 1);\n Piece replaced = move.replacedPiece();\n int c0 = move.getCol0(), c1 = move.getCol1();\n int r0 = move.getRow0(), r1 = move.getRow1();\n Piece movedPiece = move.movedPiece();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns end of the search
int getEndSearch();
[ "public int getEnd() {\r\n\t\treturn this.offset + this.numResults;\r\n\t}", "int getPhraseMatchEnd();", "void setEndSearch(int endSearch);", "public void FinishedSearch();", "String getEnd();", "public int endLocation() {\r\n\t\treturn endingLocation;\r\n\t}", "String getIfEnd();", "private int findE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs an Observable object
public Observable() { this.observers = new Vector<Observer>(); }
[ "public Observable()\n {\n observers = new HashSet<>();\n }", "public Observable() {\n\n\t\tobservers = new ArrayList<Observer<C>>();\n\t}", "Observable<TResult> toObservable();", "private static void createColdObservable() {\n var observable = Observable.just(1, 2, 3, 4, 5);\n\n ob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the property 'bindDn'
@Test public void bindDnTest() { // TODO: test bindDn }
[ "@Test\n public void bindDnPasswordTest() {\n // TODO: test bindDnPassword\n }", "public String bindDn() {\n return this.bindDn;\n }", "@Test\n public void testBind()\n {\n StudioProgressMonitor monitor = getProgressMonitor();\n ConnectionParameter connectionParameter ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: check if already signup from shared preference / db
private void checkIfSignup() { }
[ "public void signup(View view){\r\n if(editText1.getText().toString().isEmpty()||editText2.getText().toString().isEmpty()||editText3.getText().toString().isEmpty()\r\n ||editText4.getText().toString().isEmpty()||editText5.getText().toString().isEmpty()){\r\n Toast.makeText(this, \"Π...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method called from the VisitorClient when the ClientHandler receives an AskPlayer message.
void askPlayer(int clientIndex, boolean firstTime);
[ "void askNPlayer();", "protected abstract void onPlayerCommand(Player player);", "pb4server.FindAllPlayerAskReq getFindAllPlayerAskReq();", "public void selectResponse(String response , Player player);", "public void confirm() {\n\n if(!nickSet) {\n String name = nickname.getCharacters().t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that will get the requested data according to the repo and id provided. The method will work the following way: 1. Check if the data exists. 2. If it does exist, it will fetch it and return it. 3. If it doesn't exist, it will return null.
public Data getData(String repository,String id) { Data result = null; //Check if the repository is there if(doesDataExist(repository,id)){ //Fetch the data result = storage.get(repository).get(id); } return result; }
[ "public boolean doesDataExist(String repository,String id){\n boolean result = true;\n\n //Check if the repository is there\n HashMap<String,Data> repositoryData = storage.get(repository);\n\n if(repositoryData!=null){\n\n //Try to get the data with that id\n Data t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a BinaryTree with a single item.
public BinaryTree(E item) { root = new TreeNode<E>(item); }
[ "public BinaryTree(T item){\n root = new TreeNode<T>(item);\n size = 1;\n }", "public BinarySearchTree(E item) {\n\t\tsuper(item);\n\t}", "ABST<T> insert(T item) {\n return new Node<T>(item, new Leaf<T>(this.order), new Leaf<T>(this.order), this.order);\n }", "public mbynum_TreeNode(T ite...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isActiveEdit Close the edit object it cannot be used after this.
protected void closeEdit() { m_active = false; }
[ "public void closeEditArea() {\n editableAlternative = null;\n }", "public boolean isActiveEdit()\n\t\t{\n\t\t\treturn m_active;\n\n\t\t}", "protected void exitEditMode(){\n editName.setEnabled(false);\n editEmail.setEnabled(false);\n saveButton.setVisibility(View.INVISIBLE);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a list of merged metadata arrays from a list of component meta data providers.
public List<Object[]> createMergedMetaDataAsArray(String dtiKey, List<MetaDataProvider> mdProviderList, boolean includeDataType) { return createMergedMetaDataAsArray(dtiKey, mdProviderList, includeDataType, null); }
[ "public List<Object[]> createMergedMetaDataAsArray(String dtiKey, List<MetaDataProvider> mdProviderList,\r\n boolean includeDataType, Set<String> columnFilter)\r\n {\r\n Utilities.checkNull(dtiKey, \"dtiKey\");\r\n Utilities.checkNull(mdProviderList, \"mdProviderList\");\r\n\r\n D...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stores the instance of the controller in the cache, so that it can be reused the next time the route is called.
@Override public <C extends AbstractComponentController<?, ?, ?>> void storeInCache(C controller) { ControllerFactory.INSTANCE.storeInCache(controller); controller.setCached(true); }
[ "<C extends AbstractCompositeController<?, ?, ?>> void storeInCache(C controller);", "public Controller controller() {\n\t\tif (this._cached_controller == null)\n\t\t\tthis._cached_controller = new Controller(this);\n\t\treturn this._cached_controller;\n\t}", "public static Controller getInstance() { return INS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testing when ringBuffer is empty
@Test public void testIsEmpty() { assertTrue(ringBuffer.isEmpty()); }
[ "@Test\n public void notIsEmpty() {\n ringBuffer.enqueue(1.0);\n assertFalse(ringBuffer.isEmpty());\n }", "@Test\n public void notIsFull() {\n assertFalse(ringBuffer.isFull());\n }", "@Test\n public void testIsFull() {\n for (int i = 0; i < 10; i++) {\n rin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Count the number of times a string occurs in the list
@Override public int count(String str){ // Count all matching nodes StringNode node = listHeader; int count = 0; while((node = node.next) != null){ if (StringHandler.areEqual(node.value, str)) count++; } return count; }
[ "private int count(ArrayList<String> list, String value){\n \n int result = 0;\n \n Iterator<String> iter = list.iterator();\n \n while(iter.hasNext()){\n String aktIter = iter.next();\n \n if(aktIter.equals(value))\n result++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of createComparatorByName method, of class BankAccount.
@Test public void testCreateComparatorByName() { System.out.println("createComparatorByName"); // in decreasing order boolean increasing = false; BankAccount instance = new BankAccount("Kelly", 99.99); BankAccount instance2 = new BankAccount("Nelly", 199.99); int resu...
[ "@Test\n public void testCreateComparatorByBalance() {\n System.out.println(\"createComparatorByName\");\n // in decreasing order\n boolean increasing = false;\n BankAccount instance = new BankAccount(\"Kelly\", 99.99);\n BankAccount instance2 = new BankAccount(\"Nelly\", 199.9...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split the attribute values into lines of text that are no more than MAX_LINE_LENGTH_PER_ATTRIBUTE chars long. String will be split on spaces only, unless there are more than MAX_LINE_LENGTH_PER_ATTRIBUTE nonspace characters in a row. Consecutive spaces will be kept unless a split happens within the run of spaces, in wh...
public static ArrayList<String> splitTextIntoLines(final String text) { final ArrayList<String> lines = new ArrayList<>(); if (text != null) { String remaining = text.trim(); int prevSpace = Integer.MIN_VALUE; while (!remaining.isEmpty() && lines.size() < MAX_LINES_...
[ "private List<String> wrapLines(String line, final int maxLength) {\n List<String> rv = new ArrayList<String>();\n for (String restOfLine : line.split(\"\\\\n\")) {\n while (restOfLine.length() > maxLength) {\n // try to wrap at space, but don't try too hard as some languages don't even have\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the oauth_identifier of this tincan agent.
@Override public java.lang.String getOauth_identifier() { return _tincanAgent.getOauth_identifier(); }
[ "@java.lang.Override\n public java.lang.String getOauthClientId() {\n return oauthClientId_;\n }", "@java.lang.Override\n public java.lang.String getOauthClientId() {\n return instance.getOauthClientId();\n }", "private static String getAppTokenId() {\n if (appTokenId == null) {\n synchr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Log object value change.
@SuppressWarnings({ "rawtypes", "unchecked", "null" }) <E, F extends ObjectField<E, F>> void logChange(final int theStructIndex, final ObjectField<E, F> theField, @Nullable final E theOldValue, @Nullable final E theNewValue) { final ObjectField newField = STRUCT.getNew().object...
[ "public void loggingChanged(boolean oldValue, boolean newValue);", "void valueChanged(T oldValue, T newValue);", "void logModification(Auditable newObject, Auditable oldObject);", "protected void updateDueToValueChanging(){\n\t}", "public void valueForPathChanged(TreePath path, Object newValue) {\n S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this native operation can be called with the given receiver type.
boolean acceptReceiver(Type receiverType);
[ "boolean getCallMethodSupported();", "@CalledByNative\n public static boolean isTelephonySupported() {\n Context context = ContextUtils.getApplicationContext();\n TelephonyManager tm =\n (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n return (tm.get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A sample interface which defines a contract for plugins. This interface defines contracts for binary operation on number
public interface BinaryOperation{ /** * Gets name of operation * @return name of operation */ public String getName(); /** * performs operation on operands to return the result. The operation is * a choice of implementer * @param num1 operand 1 * @param num2 operand 2 ...
[ "interface MatrixBinaryOperation {\r\n\r\n /**\r\n * Defines operation to be executed with two parameters.\r\n *\r\n * @param value1 value for first parameter.\r\n * @param value2 value for second parameter.\r\n * @return value returned by the operation.\r\n */...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
' Extracting relevant elements for the paragraph. This includes: Run, CommentRangeStart and CommentRangeEnd
private static List<Object> getAllElementForParagraph(P paragraph) { List<Object> result = new ArrayList<Object>(); List<?> children = paragraph.getContent(); for(Object obj : children){ if (obj instanceof JAXBElement) obj = ((JAXBElement<?>) obj).getVa...
[ "String getParagraph();", "@Test\n public void testExtractPage04Paragraph01() {\n Paragraph paragraph = getParagraph(4, 1);\n\n String expectedText = \"The task remained hard, with the best system achieving an NDCG@R of 37% \"\n + \"and an R-Precision (P@10 was not reported that year) of 32% even for ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the Message that contains the content. Follows the parent chain up through containing Multipart objects until it comes to a Message object, or null.
public Message getMessage() { try { return getMessage(part); } catch (MessagingException ex) { return null; } }
[ "private static Message getMessage(Part p) throws MessagingException {\n\twhile (p != null) {\n\t if (p instanceof Message)\n\t\treturn (Message)p;\n\t BodyPart bp = (BodyPart)p;\n\t Multipart mp = bp.getParent();\n\t if (mp == null)\t// MimeBodyPart might not be in a MimeMultipart\n\t\treturn null;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ insideBet() is used for all the inside bets
private static boolean insideBet(int[] bet) { int point = spin(); for (int i = 0; i < bet.length; i++) { if (bet[i] == point) { System.out.println("You win!"); return true; } } System.out.println("You lose"); return false; ...
[ "double getCurrentBet();", "private static int getBet(int bet)\n\t{\n\t\treturn bet;\n\t}", "boolean placeBet(Player player, int bet);", "public void Bet() {\n\n\t\tfor (Player player : table.getPlayers()) {\n\t\t\tplayer.bet(table);\n\t\t}\n\n\t}", "public abstract void placeBet(BetData bet);", "public s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utilizes TreeSet parent's remove function. If it returns true, item is removed and, if item is selected in combobox model, selected model is updated to first item if size > 0, null otherwise. Model is saved after item is removed
@Override public boolean remove(Object o) //Modify to take in Authenication ID for future logging function { if(super.remove(o)){ if(comboBoxModelSelectedItem.equals(o)) comboBoxModelSelectedItem = ((this.size()>0)? this.first() : null); modelListenersNotify(); ...
[ "public void removeSelectedItem() {\r\n\t\tint i = getSelectedIndex();\r\n\t\tif(i != -1)\r\n\t\t\tlistModel.removeElementAt(i);\r\n\t}", "private void removeSelectedItem() {\r\n DefaultListModel listModel = (DefaultListModel) dataList.getModel();\r\n int index = dataList.getSelectedIndex();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If set, specifies an allowlist of service/methods that will have individual stats emitted for them. Any call that does not match the allowlist will be counted in a stat with no method specifier: `cluster.&lt;name&gt;.grpc.`. .envoy.config.core.v3.GrpcMethodList individual_method_stats_allowlist = 2;
public Builder mergeIndividualMethodStatsAllowlist(io.envoyproxy.envoy.config.core.v3.GrpcMethodList value) { if (individualMethodStatsAllowlistBuilder_ == null) { if (perMethodStatSpecifierCase_ == 2 && perMethodStatSpecifier_ != io.envoyproxy.envoy.config.core.v3.GrpcMethodList.getDefaultIns...
[ "@java.lang.Override\n public io.envoyproxy.envoy.config.core.v3.GrpcMethodList getIndividualMethodStatsAllowlist() {\n if (perMethodStatSpecifierCase_ == 2) {\n return (io.envoyproxy.envoy.config.core.v3.GrpcMethodList) perMethodStatSpecifier_;\n }\n return io.envoyproxy.envoy.config.core.v3.GrpcMe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getMaxFileId method, of class DynamicGraph.
@Test public void testGetMaxFileId() { System.out.println("getMaxFileId"); int expResult = 6;//noOfVertices int result = dynamicGraphInstance.getMaxFileId(); assertEquals(expResult, result); }
[ "@Override\n public int getMaxFileId(){\n int maxFileId = -1;\n for(int id : mapAllVertices.getIds()){\n V v = mapAllVertices.get(id);\n // get File ids for all time frames if exist, take for one ans break since file id will be same for all time frames for a vertex\n List<String> listF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the partners value for this Account.
public java.lang.String getPartners() { return partners; }
[ "public List<Partner> getPartners() {\n\t\tList<Partner> sharedPartners = new ArrayList<Partner>();\n\t\tfor(FederationConfiguration config : federationConfigurations) {\n\t\t\tsharedPartners.add(config.getPartner());\n\t\t}\n\t\treturn sharedPartners;\n\t}", "public List<Challenge.Participant> getParticipants() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print the number of asterisks associated with a number
public static void printBar(int numberAsterisks) { int i = 1; while(i <= numberAsterisks) { System.out.print("*"); i++; } System.out.println(); }
[ "static void printStar(int count) {\n\t\t//int count = 7;\n\t\tfor(int i=1; i<=count; i++)\n\t\t{\n\t\t\tfor(int j=1; j<=i; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public String printAsterisk(){\n return \"*\";\n }", "private static void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the dtUltimaAlteracao value for this ResultadoBuscarListaUFUF.
public void setDtUltimaAlteracao(java.util.Calendar dtUltimaAlteracao) { this.dtUltimaAlteracao = dtUltimaAlteracao; }
[ "public void setDataUltimaAtualizacao(DateTime dataUltimaAtualizacao) {\n this.dataUltimaAtualizacao = dataUltimaAtualizacao;\n }", "public void setDataHoraUltimaAtualizacao(DateTimeDB dataHoraUltimaAtualizacao) {\n this.dataHoraUltimaAtualizacao = dataHoraUltimaAtualizacao;\n }", "public vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The ChemicalElement class enables an object that represents a chemical element from the periodic table of elements.
public ChemicalElement() { nameOfElement = " "; chemicalSymbol = " "; atomicNumber = 0; numOfElements++; }
[ "public Element(String symbol, int atomicNumber, double atomicMass) {\n this.symbol = symbol;\n this.atomicNumber = atomicNumber;\n this.atomicMass = atomicMass;\n }", "public SiacTCronopElem() {\n\t}", "CHEMICAL getChemical();", "public Elemento() {\r\n this.setIdentificador(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the bytecode for a given class. It will be used when class will be loaded.
void addClassDefinition(final String className, final byte[] bytecode);
[ "public void addCodeAttribute(ProgramClass programClass,\n ProgramMethod programMethod)\n {\n addCodeAttribute(programClass,\n programMethod,\n new ConstantPoolEditor(programClass));\n }", "public byte[] __tc_getBytecode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the item to the item sub group of the mod id group.
public void addItem(final String modId, final Item item, final int meta);
[ "public void addItem(final String modId, final Item item);", "public void addMisc(final String modId, final Item item);", "public void addGroup(Group group);", "Item addItem(Item item);", "public void addMisc(final String modId, final Item item, final int meta);", "protected void addItem() {\n\n\t}", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reduction with binary operator and initial value
default double reduce(double initial, DoubleBinaryOperator op) { double acc = initial; for (int i = 0; i < size(); i++) { acc = op.applyAsDouble(acc, getDouble(i)); } return acc; }
[ "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of the textEl property.
public void setTextEl ( Object textEl ) { getStateHelper().put(PropertyKeys.textEl, textEl); handleAttribute("textEl", textEl); }
[ "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "public void setText (String text) {\r\n this.text = text;\r\n }", "public void setText(String text) \n { \n this.text = text;\n }", "public Xen setText(Object text) {\n if (text != null)\n this.text = text....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a new screen and displays the supplied layout file, also configures layout's controller using configuration closure
public static <T> Stage newScreenAndConfigureController(String layoutFilename, BiConsumer<T, Stage> controllerConfigurationFunction) throws IOException { log.debug("Creating new screen: " + layoutFilename); FXMLLoader loader = new FXMLLoader(FXUtils.class.getClassLoader().getResource(layoutFilename)); ...
[ "public static <T> Stage switchToScreenAndConfigureController(Stage stage, String layoutFilename, BiConsumer<T, Stage> controllerConfigurationFunction) throws IOException {\n log.debug(\"Switching to screen: \" + layoutFilename);\n\n FXMLLoader loader = new FXMLLoader(FXUtils.class.getClassLoader().getRes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the QueryString attribute of the UrlConfig object, using UTF8 to encode the URL
public String getQueryString() { // We use the encoding which should be used according to the HTTP spec, which is UTF-8 return getQueryString(EncoderCache.URL_ARGUMENT_ENCODING); }
[ "public String toQueryUrl() {\n StringBuilder urlBuilder = new StringBuilder();\n Set<Map.Entry<String, Object>> entrySet = params.entrySet();\n int i = entrySet.size();\n for (Map.Entry<String, Object> entry : entrySet) {\n try {\n if (null != entry.getValue())...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find events by corresponding app module id.
public Page<Event> findEventsByAppModuleId(Long moduleId , Pageable pageable);
[ "EventInfo findEvent(Long eventId) throws InstanceNotFoundException;", "@Override\r\n public Events findEventbyId(Integer EventID) {\r\n return em.find(Events.class, EventID);\r\n }", "public void searchEventsBasedOnEventId(Integer eventID) throws Exception, AssertionError{\n\t\tUtils.WebdriverWait...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Guest Updates Adds A New Guest To The List
@FXML public void newGuest() { Guest g = new Guest(); g.setFirstName("[New Guest]"); guests.add(g); FXCollections.sort(guests); guestSelect.setItems(guests); guestSelect.setValue(g); updateGuestTextField(g); }
[ "public void updateGuest(Guest guest) {\n guestList.remove(guest);\n guestList.add(guest);\n storeData();\n }", "public void addGuest(Guest guest) {\n guestList.add(guest);\n storeData();\n }", "private void doNewGuest() {\n String name = getUserNameTextInput();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find nearest route to a city given the origin and the destination
@Override public ConnectionDTO findNearestRouteToCity(String origin, String destination) { log.info("Searching connections"); List<Object> resultSet = new ArrayList<>(); cityRepository.findByIncomingAndOutgoing(origin, destination).forEach(resultSet::add); List<ConnectionDTO> conn...
[ "@RequestMapping(\n value=\"/router/city/shortest/{origin}/to/{destination}\", \n method = RequestMethod.GET)\n public List<Map<String, String>> calculateShortestRoute(@PathVariable(\"origin\") Integer origin, \n @PathVariable(\"destination\") Integer destination) {\n return routeServ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the fiducial is visible.
public void setFiducialIsVisible(boolean visible){ MusiqueFiducial.fiducialIsVisible = visible; }
[ "public void setVisible(boolean value) {\n this.visible = value;\n }", "public void setVisible( boolean v) {\r\n visible = v;\r\n }", "public void setIsVisible(java.lang.Boolean isVisible);", "public void showFace() {\n mFaceImage.setVisibility(View.VISIBLE);\n }", "public void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end public static int weaponSpawnLocation(int cellCount) Randomly selects a weapon to be used in the game instance Date created: Nov 1, 2018
public static Weapon spawnWeapon() { final int numberOfWeapons = 5; //update as weapons are added //Create weapons in order to access attributes / randomly select a weapon Sword sword = new Sword(); Stick stick = new Stick(); Bazooka bazooka = new Bazooka(); AtomicBomb atomicBomb = new AtomicBom...
[ "public static int weaponSpawnLocation(int cellCount)\r\n\t{\r\n\t\tRandom rng = new Random ();\t\r\n\t\treturn rng.nextInt(cellCount);\r\n\t}", "public void randomizeSpawnPoint() {\n\t\tspawn = TunnelSpawns.SPAWNS[(int) (Math.random() * TunnelSpawns.SPAWNS.length)];\n\t}", "public Weapon buildWeapon() {\n\t\tR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears a user's rating on a song. If this user has rated this song and the rating has not already been cleared, then the rating is cleared and the state will appear as if the rating was never made. If there is no such rating on record (either because this user has not rated this song, or because the rating has already ...
public void clearRating(User theUser, Song theSong) throws IllegalArgumentException, NullPointerException;
[ "public boolean clearRating(User theUser, Video theVideo) throws IllegalArgumentException, NullPointerException;", "void removeRating(Rating p_rating);", "void onRemoveRating();", "public void setRating(double rating) throws RatingWasAlreadySetExecption {\n if (!isRated) {\n this.rating = ra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set accessor for persistent attribute: peti_alta
public abstract void setPeti_alta(java.lang.Long newPeti_alta);
[ "public void setAutor (Pessoa p){\n }", "public static Expression aida() {\n DotExpression dotExpression = new DotExpression(Expressions.property(\"additionalProperties\"));\n dotExpression.add(\"get\",\n Collections.singletonList(Expressions.constant(\"_aida\", String.class)));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the background drawable to be used in selection mode.
public void setSelectionModeBackgroundDrawable(Drawable selectionModeBackgroundDrawable) { mSelectionModeBackgroundDrawable = selectionModeBackgroundDrawable; if (mIsSelectable) { itemView.setBackgroundDrawable(selectionModeBackgroundDrawable); } }
[ "public void setSelectionBackground( final Image image ) {\n checkWidget();\n selectionBgImage = image;\n }", "public void setBackgroundSelectionColor(Color color);", "public Drawable getSelectionModeBackgroundDrawable() {\n return mSelectionModeBackgroundDrawable;\n }", "public void setSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description: Returns the Cougaar Desktop instance the desktop frame is displayed within.
public CougaarDesktop getDesktop() { return(((CDesktopPane)getDesktopPane()).getDesktop()); }
[ "public CougaarDesktop getDesktop()\n {\n return(desktop);\n }", "public MainDesktopPane getDesktop() {\n\t\treturn desktop;\n\t}", "public static Desktop getDesktop() {\n return desktop;\n }", "public Desktop getDesktop() {\r\n return desktop;\r\n }", "Desktop getDesktop()\r\n {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method fetches My Company data and renders the page.
public static void loadMyCompany() { MyCompany myCompany = fetchFromDB(); render("@myCompany", myCompany); }
[ "public static void showCompanies(){\n\t\tCompanyDao.getAllCompanies();\n\t}", "public void showPagedCompany() {\n\t\tList<Company> companies;\n\t\twhile (true) {\n\t\t\tcompanies = new ArrayList<>();\n\t\t\ttry {\n\t\t\t\tcompanies = companyPage.getCurrent();\n\t\t\t} catch (DAOException e) {\n\t\t\t\tlogger.war...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that after sending a message with the disableMessageID hint set, which already had a JMSMessageID value, that the message object then has a null JMSMessageID value, and no messageid field value was set.
@Test(timeout = 20000) public void testSendForeignMessageWithDisableMessageIDHintAndExistingMessageID() throws Exception { try (TestAmqpPeer testPeer = new TestAmqpPeer();) { Connection connection = testFixture.establishConnecton(testPeer); testPeer.expectBegin(); testPee...
[ "@Test\n public void testSetMsgId() {\n System.out.println(\"setMsgId\");\n String msgId = \"\";\n Message instance = null;\n instance.setMsgId(msgId);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts watching content root for changes and reloads files them when they happen.
private void watch(Path root) { if (!watcherThread.isAlive()) { watcherThread.start(); } watcherThread.watch(root); }
[ "public void startWatching() {\n LOG.info(\"Started watching {} directory for new log files\", dirPath);\n taskHandle = service.scheduleAtFixedRate(this, refreshInterval, refreshInterval, TimeUnit.MILLISECONDS);\n }", "public void start() throws Exception {\n // create the watcher for futu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compression type string compression = 3;
public java.lang.String getCompression() { java.lang.Object ref = compression_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); compression_ = s; return s; ...
[ "public java.lang.String getCompression() {\n java.lang.Object ref = compression_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read short represented as two bytes.
short readShort() throws PacketStreamException { return ((short) readChar()); }
[ "public short readShort() throws IOException;", "protected int readShort() {\n\t\treturn read() | (read() << 8);\n\t}", "public final short readShortLE() throws IOException {\n int ch1 = this.read();\n int ch2 = this.read();\n if ((ch1 | ch2) < 0)\n throw new EOFException();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Service permettant de blacklister une immatriculation
public boolean immatriculationBlacklister(String immatriculation);
[ "void blacklist(String token);", "public void setBlacklist(Blacklist blacklist)\n\t{\n\t\tthis.blacklist = blacklist;\n\t}", "public interface BlackList\n{\n /**\n * Add a service to this blacklist.\n * \n * @param ref The reference of the service that is blacklisted\n */\n public void add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switches to the default keyword search
void setKeywordSearch();
[ "public void search(String keyword){\n \r\n }", "DocSearchResponse keywordSearch(KeywordSearchParam param);", "private void doSearch() {\n doSearch(searchString);\n }", "private void keywordSearch() throws DaoException {\r\n String kWord = v.getKeyword();\r\n List<Movie> resu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Returns a Person array in which with every Person that has age above the parameter age from the listOfPatients array. The return array has to be completely full with no empty spots, that is the array size should be equal to the number of persons with age above the parameter age. Return null if there is no Person with...
public Person[] getPatientsWithAgeAbove(int age) { int count = 0; for(int i = 0; i < listOfPatients.length; i++) { if(listOfPatients[i].getAge()> age) count++; } if(count == 0) return null; int index = 0; Person[] ...
[ "public static List<String> listOfStudentsWhoseAgeBelow(List<MyStudent> l, int age){\n\t List<String> names= l.stream().filter(e->e.getAge()<age).map(e->e.getFirstName()).collect(Collectors.toList());\n\t return names;\n\t }", "@Override\n public Set PatientsOlderThenEnlistedAfter() {\n S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Activate device by id.
@GetMapping("/{id}/activate") public ResponseEntity<String> activateDeviceById(@PathVariable(name = "id") long id) { LOG.info("start DeviceController activateDeviceById"); long nanoTime = System.nanoTime(); ResponseEntity<String> responseEntity = null; try { deviceService.activateDeviceById(id); response...
[ "ActivateDeviceIdentifierResult activateDeviceIdentifier(ActivateDeviceIdentifierRequest activateDeviceIdentifierRequest);", "void setDeviceID(String id);", "public boolean registerDevice(int id, ILineDevice te) ;", "public void activate(long id, IActivator activator) {\n\t\tif (! enabled) {\n\t\t\treturn;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column commodity_classification_association.association_id
public Integer getAssociationId() { return associationId; }
[ "public Integer getAssociationId() {\n\t\treturn associationId;\n\t}", "private static long getTgtEntityIdOfAttribute(long associationId, JDBCDAO jdbcdao)\r\n\t\t\tthrows SQLException, DAOException\r\n\t{\r\n\t\tLong entityId = null;\r\n\t\tfinal String getEntityIdQuery = \"select TARGET_ENTITY_ID from DYEXTN_ASS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If parameter string length is greater than 4, the string will be masked. Otherwise, will return original String. This function will return string by keeping the first 2 and last 2 characters, the rest of the chars will be masked with four ''
public static String maskSensitive3(String str) { if (StringUtil.isEmpty(str)) { return str; } if (str.length() > 4){ String beginStr = str.substring(0, 2); String endStr = str.substring(str.length() - 2); return beginStr + "****" + endStr; } return str; }
[ "public static String maskSensitive4(String str) {\r\n\t\tif (StringUtil.isEmpty(str)) {\r\n\t\t\treturn str;\r\n\t\t}\r\n\t\treturn \"***************\" + str.substring(str.length() - 4);\r\n\t}", "public static String maskSensitive2(String str) {\r\n\t\tif (StringUtil.isEmpty(str)) {\r\n\t\t\treturn str;\r\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the clavePaginacion value for this LRFiltroEmitidasType.
public es.gob.agenciatributaria.www2.static_files.common.internet.dep.aplicaciones.es.aeat.ssii.fact.ws.SuministroInformacion_xsd.IDFacturaExpedidaBCType getClavePaginacion() { return clavePaginacion; }
[ "public java.lang.Double getClavePaginacion() {\r\n return clavePaginacion;\r\n }", "public void setClavePaginacion(es.gob.agenciatributaria.www2.static_files.common.internet.dep.aplicaciones.es.aeat.ssii.fact.ws.SuministroInformacion_xsd.IDFacturaExpedidaBCType clavePaginacion) {\r\n this.claveP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Default Values for the the STream Generator Page
private StreamGeneratorParam constructDefaultStreamGeneratorParam() { StreamGeneratorParam param = new StreamGeneratorParam(); param.setEventEmitterClassName("hortonworks.hdp.refapp.trucking.simulator.impl.domain.transport.Truck"); param.setEventCollectorClassName("hortonworks.hdp.refapp.trucking.simulator.impl....
[ "protected void setDefaults() {\n\t\thideWidgets.setState(0);\n\t\twaveLengthBox.setValue(WAVELENGTH_DEFAULT);\n\t\twidthBox.setValue(FPRound.toSigVal(WIDTH_DEFAULT,4));\t\t\n\t\tzDistanceBox.setValue(Z_DISTANCE_DEFAULT);\n\t\t\n\t\tupdateScreen();\n\n\t}", "public void defaultSettings()\n\t{\n\t\tdirectionsLabel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build a suffix tree of the string text and return a list with all of the labels of its edges (the corresponding substrings of the text) in any order.
public List<String> computeSuffixTreeEdges(String text) { List<String> result = new ArrayList<String>(); // Implement this function yourself int size = text.length(); List<Node> stree = new ArrayList<Node>(); stree.add(new Node()); for (int pos=0; pos<size; pos++){ ...
[ "public List<String> computeSuffixTreeEdges(String text) {\n List<String> result = new ArrayList<String>();\n List<JavaNode> tree = textToTree(text);\n Queue<Integer> queue = new LinkedList<>();\n queue.add(0);\n while (!queue.isEmpty()) {\n JavaNode currentJavaNode = t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a list of test exercises
public static List<Exercise> createMultipleExercises(int howmany) { List<Exercise> expectedExercises = new ArrayList<>(); for (int i = 1; i <= howmany; i++) { expectedExercises.add(new Exercise(i,"Test exercise title " + i, "Test exercise description " + i)); } ...
[ "List<ExamPackage> getListExercise();", "public List<Exercise> getAllExercises() {\n\n\t\tList<Exercise> exer = new ArrayList<>();\n\n\t\texerciseRepository.findAll().forEach(exer::add);\n\t\treturn exer;\n\t}", "public ArrayList<Ejercicio> getExercises (){\r\n\t\t\r\n\t\treturn daoEjercicio.getExerciseList();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'CADENA TRAMA' attribute. If the meaning of the 'CADENA TRAMA' attribute isn't clear, there really should be more of a description here...
String getCADENA_TRAMA();
[ "public Number getTara()\n {\n return (Number)getAttributeInternal(TARA);\n }", "public Number getTallaId() {\n return (Number)getAttributeInternal(TALLAID);\n }", "public String getCRLAttribute(){\n\t\treturn (String) data.get(CRLATTRIBUTE);\n\t}", "public String getARLAttribute(){\n\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
doubleCapacity method doubles the capacity of the array
protected void doubleCapacity() { T[] temp = (T[]) data; data = (T[]) new Object[2 * data.length]; for(int i = 0; i < temp.length; i++) { data[i] = temp[i]; } }
[ "private void doubleCapacity() {\n\t\tarr = Arrays.copyOf(arr, capacity *= 2); // These operators (+=, -=, *=, etc) return their value when used as expressions (i.e. without \";\").\n\t}", "private void doubleCapacityAndCopy() {\n\t\tObject[] oldArray = elements;\n\t\tcapacity *= 2;\n\t\telements = new Object[cap...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is method is used as a weighted Investment for stocks already present in the portfolio with equal weights for investment. A valid portfolio name is required for which the investment strategy is executed just once. A hashmap containing the key value pair of the stocks and their %weights for investment.
void weightedInvestEqual(String portfolioName, Date date, double value, double commission);
[ "void weightedInvestmentUnequal(String portfolioName, HashMap<String, Double> stockWeights,\r\n double value, Date date, double commission);", "void createUnequalStrategy(String portfolioName, HashMap<String, Double> weights,\r\n Date startDate, Date end...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks for any inactive Stages and, for those found, deregisters their associated Scene from eye strain control. (Prevents the software from trying to change the color of a Scene which is no longer active).
private void deregisterInactivesFromEyeStrainControl() { for (Entry<Stage, Scene> entrySS : scenesForStrainReliefMap.entrySet()) { if (!entrySS.getKey().isShowing()) { scenesForStrainReliefMap.remove(entrySS.getKey()); } } }
[ "private void deregisterInactivesFromBrightnessControl() {\n for (Entry<Stage, Node> entrySN : nodesForBriteMap.entrySet()) {\n if (!entrySN.getKey().isShowing()) {\n nodesForBriteMap.remove(entrySN.getKey());\n }\n }\n\n }", "public void Unload() {\n\t\tscene...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the id tipo vehiculo.
public Long getIdTipoVehiculo() { return IdTipoVehiculo; }
[ "public int getIdTipoValor() {\n return idTipoValor;\n }", "TipoCarro findOne(Long id);", "public int getTipoEleicao(int idEleicao){\n return this.eleicaoDB.getTipoEleicao(idEleicao);\n }", "public int getIdtipodevehiculo() {\n return idtipodevehiculo;\n }", "public int getId...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Direction gh issue query builder.
public GHIssueQueryBuilder direction(GHDirection direction) { req.with("direction", direction); return this; }
[ "QueryOperation getQueryOperation();", "private interface PurchaseOrderTableQuery {\r\n\t\tfinal String[] PROJECTION = { PurchaseTable._ID,\r\n\t\t\t\tPurchaseTable.ORDER_NO, PurchaseTable.ETA };\r\n\r\n\t\tint ORDER_NO = 1;\r\n\t\tint ETA = 2;\r\n\r\n\t\tfinal String SORT_ORDER = PurchaseTable.ORDER_NO + \" ASC\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle whether volume should be restricted or not.
private void toggleShouldRestrictVolume() { boolean shouldRestrict = this.shouldRestrictVolume(); this.getShouldRestrictVolumeCheckBox().setChecked(!shouldRestrict); }
[ "public boolean shouldModifyVolume();", "public void toggle() {\n if (volume == 1f) {\n volume = 0f;\n }\n else if (volume == 0f) {\n volume = 1f;\n }\n\n }", "private boolean shouldRestrictVolume()\n\t{\n\t\treturn this.getShouldRestrictVolumeCheckBox().isCh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [ addDoubleShapedRecipe ] XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
public void addDoubleShapedRecipeitem(char in1, Material i, char in2, Material i2, String[] shape, Material type) { Server server = getServer(); ShapedRecipe rec = new ShapedRecipe(new ItemStack(type)); rec.shape(shape); rec.setIngredient(in1, i); rec.setIngredient(in2, i2); is.put(rec, ty...
[ "@Override\n\tpublic void addRecipes() \n\t{\n GameRegistry.addRecipe(new ItemStack(this), \"xxx\", \"xyx\", \"xxx\",\t\t\t\t\t\t\n 'x', Items.fireworks, \n 'y', Items.string\n ); \n \n // Bundle of rockets back to 8 rockets\n GameRegistry.addShapeles...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__OpaqueAction__Group_3__2" $ANTLR start "rule__OpaqueAction__Group_3__2__Impl" InternalActivityDiagram.g:2419:1: rule__OpaqueAction__Group_3__2__Impl : ( ( rule__OpaqueAction__ExpressionsAssignment_3_2 ) ) ;
public final void rule__OpaqueAction__Group_3__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalActivityDiagram.g:2423:1: ( ( ( rule__OpaqueAction__ExpressionsAssignment_3_2 ) ) ) // InternalActivityDiagram.g:2424:1: ( ( ru...
[ "public final void rule__OpaqueAction__Group_3_3__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // InternalActivityDiagram.g:2551:1: ( ( ( rule__OpaqueAction__ExpressionsAssignment_3_3_1 ) ) )\n // InternalActivityDiagram...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the first unrecognized option stops options processing and falls into rests.
@Test public void unknownOptionStopsProcessing() { final String[] args = new String[]{"-unknown"}; final CliActuators actuators = parser.parse(args, OPTIONS); Assert.assertEquals("-unknown", actuators.getRests().get(0)); }
[ "private void processExtraOption(String option)\r\n {\r\n //if (option.equals(\"null\")) this.extra.set(C.X_NULL);\r\n // else if ...\r\n/* \telse\r\n {\r\n System.err.println(\"Error: unknown option: -\"+option);\r\n Error.die(C.JUST_EXIT);\r\n }\r\n*/\r\n \r\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
selectUrlType gets the URL as a string and sets the correspondent URL as a new value. This value is split at each dot, and the last index contains the type. theUrlType is updated with the correct type value, and if it is RLE, the RLEDecoder is instantiated.
public void selectUrlType(String inURL) { try { URL url = new URL(inURL); String[] fileType = url.getFile().split("[.]"); int itemCount = fileType.length; if (fileType[itemCount - 1].contains("txt") || fileType[itemCount - 1].contains("cells")) { ...
[ "public String getUrlType() {\n return theUrlType;\n }", "URI getType();", "@JsonSetter(\"types_url\")\r\n public void setTypesUrl (String value) { \r\n this.typesUrl = value;\r\n }", "private void getMatchType(int type) {\n if (type == 1) {\n matcher = new MatchByName...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Click on G Suite Integration Link.
public zoho clickGSuiteIntegration1Link() { gSuiteIntegration1.click(); return this; }
[ "public void I_Should_click_My_Account_link(){\n\t MyAccountLink.click();\n\t \n}", "public void clickAccountLink(){\n\t\ttry{\n\t\t\tlink_account.click();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "HtmlPage clickSiteLink();", "public OPEN_POSITIONS clickContinuousIntegrationLink(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XMemberFeatureCall__Group_1_1_1__0" $ANTLR start "rule__XMemberFeatureCall__Group_1_1_1__0__Impl" ../com.avaloq.tools.dslsdk.check.ui/srcgen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:10583:1: rule__XMemberFeatureCall__Group_1_1_1__0__Impl : ( '<' ) ;
public final void rule__XMemberFeatureCall__Group_1_1_1__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:10587:1: (...
[ "public final void rule__XMemberFeatureCall__Group_1_1_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:8335:1: ( ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a new SNS topic
public void createNewSNSTopic(String topicName) { CreateTopicRequest createTopicRequest = new CreateTopicRequest(topicName); CreateTopicResult createTopicResult = amazonSNS.createTopic(createTopicRequest); String topicArn = createTopicResult.getTopicArn(); log.info("New topic ARN :" + topicArn); ...
[ "@Override\r\n public void onDeliverCreateTopic(CreateTopicRequest req) {\r\n Topic newTopic = new Topic(req.getTopicID());\r\n newTopic.setAccessControlRules(req.getAccessRules());\r\n /*\r\n * DODALEM TO\r\n */\r\n newTopic.setOwner(new Subscriber(newTopic, req.getSo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets the eviction policy on the heap caching tier
@Deprecated void setEvictionPolicy(Policy policy);
[ "public synchronized void setEvictionPolicy(EvictionPolicy policy)\n {\n int nType = (policy == null ? EVICTION_POLICY_HYBRID\n : EVICTION_POLICY_EXTERNAL);\n configureEviction(nType, policy);\n }", "public void cacheSetStoragePolicy(int policy);", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the targetResource property: Target ARM resource, on which alert got created.
public Essentials withTargetResource(String targetResource) { this.targetResource = targetResource; return this; }
[ "public String targetResourceId() {\n return this.targetResourceId;\n }", "@Override\n public void setResource(final Resource pResource) {\n resource = pResource;\n }", "public String targetResource() {\n return this.targetResource;\n }", "public void setResource(Resource reso...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the artifact from the given input steam. Then adds it as a dependency in the provided parent carbon application.
private Artifact buildAppArtifact(CarbonApplication parentApp, InputStream artifactXmlStream) throws CarbonException { Artifact artifact = null; try { OMElement artElement = new StAXOMBuilder(artifactXmlStream).getDocumentElement(); if (Artifact.ARTIFACT.equals(artEl...
[ "Artifact createArtifact();", "private void deployCarbonApps(String artifactPath) throws CarbonException {\n\n File cAppDirectory = new File(this.cAppDir);\n\n String archPathToProcess = AppDeployerUtils.formatPath(artifactPath);\n String cAppName = archPathToProcess.substring(archPathToProce...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates X509 encoded public key bytes from a given modulus and public exponent.
public static byte[] generateX509PublicKey(BigInteger modulus, BigInteger publicExponent) throws Exception { RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec(modulus, publicExponent); PublicKey javaRsaPublicKey = KEY_FACTORY.generatePublic(rsaPublicKey...
[ "public static byte[] generateX509PublicKey(PublicKey publicKey)\n throws Exception {\n X509EncodedKeySpec x509EncodedPublicKey =\n KEY_FACTORY.getKeySpec(publicKey, X509EncodedKeySpec.class);\n return x509EncodedPublicKey.getEncoded();\n }", "public RsaPublicKey(BigInte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
int type = value/13; int num = value%13 +1; return (num+""+suits.charAt(type);
public String get(){ String s = value%13+1+""+suits[value/13]+" "; return s; }
[ "public String getModulo11(String campo, int type) {\n\n int multiplicador = 2;\n int multiplicacao = 0;\n int soma_campo = 0;\n\n for (int i = campo.length(); i > 0; i--) {\n multiplicacao = Integer.parseInt(campo.substring(i - 1, i)) * multiplicador;\n\n soma_camp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========== CONSTRUCTOR ================== The Stores constructor we initialize the store with all the products in place and all prices in place, sorted
public Store(){ //Fill the shop with Food for when we start it up foodToOffer.add(new cowMeat()); foodToOffer.add(new horseMeat()); foodToOffer.add(new Apple()); foodToOffer.add(new Peanut()); foodToOffer.add(new Seeds()); foodToOffer.add(new catFood()); f...
[ "public Store()\n {\n // initialise instance variables\n p1 = new Product();\n p2 = new Product();\n p3 = new Product();\n }", "public Shop() {\r\n\t\tthis.inventory = new Inventory();\r\n\t\tthis.suppliers = new ArrayList<Supplier>();\r\n\t}", "public GroceryStore () {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get copy progress per account.
public List<CopyProgress> copyProgress() { return this.copyProgress; }
[ "public int getProgress();", "com.google.spanner.admin.database.v1.OperationProgress getProgress(int index);", "public final String getProgress() {\n return snapshot.getProgress();\n }", "@ApiOperation(value = \"Get user profile progress info\", notes = \"<p>Get current logged user profi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a matrix from the data set, where each row represent a data point, and each column is one of the numeric example from the data set. This matrix can be altered and will not effect any of the values in the data set.
public Matrix getDataMatrix() { if (this.size() > 0 && this.getDataPoint(0).getNumericalValues().isSparse()) { SparseVector[] vecs = new SparseVector[this.size()]; for (int i = 0; i < size(); i++) { Vec row = getDataPoint(i).getNumericalValues(); vecs[i] =...
[ "private static Matrix makeXMat(int nDataPoints, int nTerms, Vector xV){\n Matrix matrix = new Matrix(nDataPoints, nTerms);\n for (int row = 1; row <= nDataPoints; row++){\n matrix.putValue(row,1, new BigDecimal(1.0));\n for (int col = 2; col <= nTerms; col++)\n ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of isBottom method, of class Border.
@Test public void testIsBottom() { for (final Border border : Border.values()) { if (border.toString().contains("BOTTOM") || border.toString().contains("ALL")) { Assert.assertTrue(border.isBottom()); } else { Assert.assertFalse(border.isBottom()); ...
[ "public boolean isDrawBottom(){\r\n return this.drawBottom;\r\n }", "public String getBorderBottom();", "public boolean atBottom() {\n // return bottomSwitch.get() || this.extenderHeight < RobotMap.VE_SAFETY_MARGIN;\n return this.getRelativePosition() - this.extenderBottom < RobotMap.VE_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Method: boolean canBeAltered(Mensuration mensinfo) Purpose: Check whether note can be altered under a given mensuration Parameters: Input: Mensuration mensinfo mensuration information Output: Return: whether note can be altered
public boolean canBeAltered(Mensuration mensinfo) { switch (notetype) { case NT_Minima: return mensinfo.prolatio==Mensuration.MENS_TERNARY; case NT_Semibrevis: return mensinfo.tempus==Mensuration.MENS_TERNARY; case NT_Brevis: return mensinfo.modus_minor=...
[ "public boolean canBePerfect(Mensuration mensinfo)\n {\n switch (notetype)\n {\n case NT_Semibrevis:\n return mensinfo.prolatio==Mensuration.MENS_TERNARY;\n case NT_Brevis:\n return mensinfo.tempus==Mensuration.MENS_TERNARY;\n case NT_Longa:\n return mensinfo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the ending position of the attribute value.
public void setValueEndPosition (int end) { mValueEnd = end; setValue (null); // uncache value }
[ "public void setQualifiedEnd(End value) {\r\n\t\tBase.set(this.model, this.getResource(), QUALIFIEDEND, value);\r\n\t}", "public void setEnd(int end)\n {\n _end = end;\n this.end = end;\n this.endSpecified = true;\n }", "public void setEnd(int end)\n {\n this.end = end;\n this.endSpeci...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wipes and repopulates the data source schema between tests.
@After public void wipeSchema() { schemaManager.wipeSchema(configLoader.getConfig() .getDataSourceCoordinates()); schemaManager.createOrUpgradeSchema(configLoader.getConfig() .getDataSourceCoordinates()); }
[ "private void cleanupTestDatabase() {\r\n executeUpdateQuietly(\"drop table table1\", dataSource);\r\n executeUpdateQuietly(\"drop table table2\", dataSource);\r\n executeUpdateQuietly(\"drop table table3\", dataSource);\r\n }", "protected void cleanupTestDatabase() {\r\n executeUpd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modify state as if a backoff had just happened. Call this after failed attempts.
public void backoff() { retryTime = Clock.unixTime() + sleepIncrement; sleepIncrement *= 2; backoffCount++; }
[ "public void backoff() {\n\tif (backoff) return;\n\tbackoff = true;\n\tnormalInterval = interval;\n\tnormalTimeout = clientTimeout;\n\n\tinterval = (long)(BACKOFF_FACTOR*interval);\n\tclientTimeout = interval/2;\n }", "public boolean isBackingOff() { return backoff; }", "@Override\n public synchroni...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an input handle back to the corresponding java element.
public static IJavaElement handleToElement(final String project, final String handle) { return handleToElement(project, handle, true); }
[ "public static InputElement getImplAsInputElement(ContentElement element) {\n return InputElement.as(element.getImplNodelet());\n }", "public IJavaElement getInputElement();", "public abstract IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner);", "abstract vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/This function is used to find multiple occurances of a given word in a Sentence
public static String findMultipleOccorancesOfGivenWord(String sentence,String word) { if(sentence == null || word == null || sentence == "" || word == ""){ return "Please enter valid sentence and word.It should not be empty and null"; } String result = ""; Pattern pattern...
[ "public String findMultipleOccurrence(String sentence){\n if(sentence==null)\n return null;\n // sentence=\"She sells seashells by the seashore\";\n String regex=\"se\";\n Pattern pattern=Pattern.compile(regex);\n Matcher match=pattern.matcher(sentence);\n String...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if there is exactly one employee with no manager (The CEO)
private boolean isExactlyOneCEO(List<Employee> employees) { //check if exactly one employee doesn't have a manager (The CEO) return employees.stream().filter(e -> e.getManagerId() == null).count() == 1; }
[ "public boolean isNotNullEmployee() {\n return genClient.cacheValueIsNotNull(CacheKey.employee);\n }", "private boolean isValidManagerIds(List<Employee> employees) {\n // if an employee's manager id refers to his own employee id, then this is invalid\n if (employees.stream().filter(e -> e.getEmp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method releases shapelevel read lock, and read locks for object and global
@Override public void shapeReadUnlock(Object object, AllocationShape shape) { objectReadUnlock(object); }
[ "private void releaseGlobalReadLock()\n {\n // Get the global write lock to ensure only one thread at a time can execute this code.\n globalLock.readLock().unlock();\n }", "private void releaseReadAccess() throws ParallelException {\r\n _g.releaseReadAccess();\r\n }", "@Override\n pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set time period by pointing start and end time
public void setTimePeriode(Timestamp tsBegin, Timestamp tsEnd) { long loTimePeriod = tsEnd.getTime() - tsBegin.getTime(); setTimePeriode(loTimePeriod); }
[ "public TimePeriod( TimePoint start, TimePoint end ) {\r\n\t\tthis( start, false, end, true );\r\n\t}", "private void setBeginAndEnd() {\n for (int i=1;i<keyframes.size();i++){\n if (curTime <= ((PointInTime)keyframes.get(i)).time){\n beginPointTime=(PointInTime)keyframes.get(i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }