query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
sets the value of the useragent suffix.
public void setUserAgentSuffix(String userAgentSuffix) { this.userAgentSuffix = userAgentSuffix; }
[ "public String getUserAgentSuffix() {\n return this.userAgentSuffix;\n }", "public void setUseragent(String useragent) {\n this.useragent = useragent == null ? null : useragent.trim();\n }", "public static void setUserAgent(String agent) {\n userAgent = agent;\n }", "@Override\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the SecurityPoliciesClient object to access its operations.
public SecurityPoliciesClient getSecurityPolicies() { return this.securityPolicies; }
[ "SecurityPoliciesClient getSecurityPolicies();", "PoliciesClient getPolicies();", "AccessPoliciesClient getAccessPolicies();", "public PoliciesClient getPolicies() {\n return this.policies;\n }", "public interface PoliciesClient {\n /**\n * List policies in a given policy set.\n *\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the nth message entry (line) for this event.
public EventLogMessageEntry getEventLogMessage(int index);
[ "public int get_line() {\r\n\t\treturn this.line_number;\r\n\t}", "public int line() {\n\t\treturn this.firstOccurrenceLine;\n\t}", "public int getLine() {\n\t\treturn line;\n\t}", "public PropertiesFileEntry getNthEntry(int index) {\n if (entries == null) {\n notifyEntriesNotInitialized();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field fromUserId is set (has been assigned a value) and false otherwise
public boolean isSetFromUserId() { return this.fromUserId != null; }
[ "public boolean isSetUserId() {\n return this.userId != null;\n }", "public boolean isSetToUserId() {\n return this.toUserId != null;\n }", "public boolean isSetUserId() {\n return this.userId != null;\n }", "public boolean isSetUserID() {\n return this.userID != null;\n }", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the change from 50 day average in percent.
public synchronized BigDecimal getChange50DayAvgPercent(){ return change50DayAvgPercent; }
[ "public synchronized BigDecimal getChange200DayAvgPercent(){\n\t\treturn change200DayAvgPercent;\n\t}", "public synchronized BigDecimal getChange50DayAvg(){\n\t\treturn change50DayAvg;\n\t}", "double getChangePercent()\n\t{\n\t\treturn (currentPrice - previousClosingPrice) / previousClosingPrice;\n\t}", "doub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of addProduto method, of class CriarCandidaturaExposicaoController.
@Test public void testAddProduto() { System.out.println("addProduto"); CentroExposicoes centro = new CentroExposicoes(); Exposicao e = new Exposicao(); String user = "Teste"; String caracterizacao = ""; CriarCandidaturaExposicaoController instance = ne...
[ "@Test\n public void testAddProduc() {\n System.out.println(\"addProduc\");\n Product product = new Product(15,\"Picafresa\", 13, 11);\n ProductDao instance = new ProductDao();\n int expResult = 1;\n int result = instance.addProduc(product);\n assertEquals(expResult, res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field763' field.
public void setField763(java.lang.CharSequence value) { this.field763 = value; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField763(java.lang.CharSequence value) {\n validate(fields()[763], value);\n this.field763 = value;\n fieldSetFlags()[763] = true;\n return this; \n }", "public void setField762(java.lang.CharSequence value) {\n this.field762 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
copy the contents of readFilename into writefilename.
private static void copyFile(String readFilename, String writefilename, boolean close) { long stim; // 1. delete the write file if it already exists stim = System.currentTimeMillis(); FileAccess.delete(writefilename); stim = System.currentTimeMillis() - stim; log.log(Level.FINE, "delete: {0}ms", sti...
[ "public static void fileCopy(BufferedReader inFileStreamName, PrintWriter outFileStreamName)\r\n\t\t\tthrows IOException\t\t// Declare the IOException exception \r\n\t{\r\n\t\t// Read line by line from input file and copy it to output file\r\n\t\tString s;\r\n\t\t\r\n\t\ts = inFileStreamName.readLine();\r\n\t\twhil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the currently cached parsed paths. Only for use in tests.
@VisibleForTesting public static void clearCachedPaths() { requireNonNull(CACHE, "CACHE"); CACHE.asMap().clear(); }
[ "public void clearPaths() {\n _thePaths.clear();\n }", "public void removeAllPaths() {\n pathHashMap.clear();\n }", "public void clearPossiblePaths() { possiblePaths.clear(); }", "public void clear() {\n File[] files = cacheDir.listFiles();\n for (File f : files)\n f.del...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functional interface to support passing of method name to getStmtUriBatch function
@FunctionalInterface private interface StmtUriBatchRequest { public List<IRI> retrieve(IRI subject, IRI predicate, Value object, RMapSearchParams params, Rdf4jTriplestore triplestore); }
[ "@FunctionalInterface\n\tprivate interface UriBatchRequest {\n\t public List<IRI> retrieve(IRI uri, RMapSearchParams params, Rdf4jTriplestore triplestore);\n\t}", "String getCallSql(String name);", "String getBindMethodName();", "private ResultBatch<URI> getStmtUriBatch(java.net.URI subject, \n\t\t\tjava.net...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the attribute value for CatName, using the alias name CatName.
public String getCatName() { return (String)getAttributeInternal(CATNAME); }
[ "public String getAttribute(String name)\n {\n return getValue(name);\n }", "public String getCategoryName() {\n return (String)getAttributeInternal(CATEGORYNAME);\n }", "public String getCatName() {\n return catName;\n }", "public String getAttribute(String name) {\n String...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the given target is valid.
public boolean isValidTarget(Targetable target) { return (target != null); }
[ "@SideOnly(Side.CLIENT)\n\tprivate boolean isTargetValid(EntityPlayer player, EntityLivingBase target) {\n\t\treturn (target != null && !target.isDead && target.getHealth() > 0F \n\t\t\t\t&& player.getDistance(target) < (float) getRange() \n\t\t\t\t&& !target.isInvisible());\n\t}", "private void checkTarget () {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to create the sword.
public Sword createSword() { if (!random) sword = new Sword(1, 8); else { sword = generateSword(); } return sword; }
[ "public void MakeWordStructure()\n\t{\n\t\t\n\t\tArrayList<Syllable> suffixes;\n\t\t\n\t\ttargetWeight = Math.max(3 + rng.nextGaussian() / 2, 2);\n\t\t\n\t\trestrictInitialOpenSyllables = true;\t// if true, prevents a word from beginning with\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// two consecutive open syllables\n\t\tif (r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the thong tin xu ly vi pham of this qlvt cap phep phuong tien van tai.
@AutoEscape public String getThongTinXuLyViPham();
[ "public void xuatGVThinhGiang() {\n\t\tString output= super.xuatGiangVien();\n\t\toutput += \" - Noi cong tac: \"+ noiCT;\n\t\tSystem.out.println(output);\n\t\tsuper.xemMonHoc(); // hien thi cac mon hoc cua giang vien\n\t}", "private void vypisTahy() {\n\t\tSystem.out.println(\"Vyzrebovane cisla:\");\n\t\tfor (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method populates the child menu list for parent menu 'Notifications' for the host context
private List<MenuItem> getNotificationsChildMenuForHost() { // Populate the notificationsChildMenuList for (HostActionEnum.Notifications notificationsEnum : HostActionEnum.Notifications .values()) { MenuItem menuItem = new MenuItem(); // menuItem // .setActionListener(createActionListenerMethodBi...
[ "private List<MenuItem> getNotificationsChildMenuForHostGroup() {\r\n\t\t// Populate the notificationsChildMenuList\r\n\t\tfor (HostGroupActionEnum.Notifications notificationsEnum : HostGroupActionEnum.Notifications\r\n\t\t\t\t.values()) {\r\n\t\t\tMenuItem menuItem = new MenuItem();\r\n\t\t\t// menuItem\r\n\t\t\t/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor, which opens an UDP socket on a given port. If that port is being used by another process on the computer, this constructor will throw an exception.
public Communicator(int localPort) throws java.net.SocketException { datagramSocket = new DatagramSocket(localPort); }
[ "public UDPReceiver(int port) throws SocketException {\n\t\tthis.socket = new DatagramSocket(port);\n\t}", "public UDPLayer() \n\t\tthrows SocketException\n\t{\n\t\tthis(0, true); // use any available port on the local host machine\n\t\t// TODO use -1 instead of 0?\n\t}", "public void open(int port) throws IOEx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The constructor of a new Dvd
public Dvd (int id, String title , int year, String thumbnail , String director , int runtime ,String language ,ArrayList<String> subLanguages) { super(id,title,year,thumbnail); this.director=director; this.runtime=runtime; this.language=language; this.subLanguages=subLanguages; this.type = "Dvd"; // creat...
[ "DODSStructure(DODSNetcdfFile dodsfile, Group parentGroup, Structure parentStructure, String dodsShortName,\n DodsV dodsV) throws IOException {\n\n super(dodsfile, parentGroup, parentStructure, DODSNetcdfFile.makeShortName(dodsShortName));\n setDODSName(DODSNetcdfFile.makeDODSName(dodsShortName));\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a raw axis value from a AxisDef
public double getRawAxis(final AxisDef def) { return controllerModels[activeModelIndex].getRawAxis(this::getJoystick, def); }
[ "double getAxisValue(Axis axisKind);", "public Object getValueForAxis(AxisModel axis) {\n return null;\n }", "int getAxisTypeValue();", "public double getAxisValue(int axis) {\n\t\tif (axis < 0)\n\t\t\treturn 0;\n\t\t\n\t\tdouble sign = (axis == 1 || axis == 5) ? -1 : 1;\n\t\tdouble tempAxis = joyst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the Store Activity.
public void startStore(View view) { Intent intent = new Intent(this, Store.class); intent.putExtra("User", user); startActivity(intent); }
[ "@Override\n public void navigateToStoreActivity() {\n mNavigator.startStoreActivity(this);\n finish();\n }", "private void onStoresButtonClick() {\n new ManagementStoreScreen(this.authentificationStore).open();\n }", "void navigateToStoreOrders() {\n Intent gotoStoreOrders ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tells the character to consume the ICollidable with index 'index' in the list of interactables.
void consumeObject(int index);
[ "void interactObject(int index);", "void interactItem(int index);", "public void interact(Item i);", "void attackObject(int index);", "void attackItem(int index);", "void consumeItem(int index);", "public void foundationClicked(int index)\n {\n //IMPLEMENT ME\n if(display.isPileSelected...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hardcodes default dice number map (keys exactly as above) (assumes size <= 7)
private void setupDefaultDiceMap() { defaultDiceNumberMap.put(getHashCodeofPair(0,-2), 0); defaultDiceNumberMap.put(getHashCodeofPair(-7,1), 6); defaultDiceNumberMap.put(getHashCodeofPair(7,1), 8); defaultDiceNumberMap.put(getHashCodeofPair(-7,-1), 5); defaultDiceNumberMap.put(ge...
[ "public static EnumMap<Die, Integer> creatingTheMap(){\n\n howManyToRoll.put(Die.D4, 0);\n howManyToRoll.put(Die.D6, 0);\n howManyToRoll.put(Die.D8, 0);\n howManyToRoll.put(Die.D10, 0);\n howManyToRoll.put(Die.D12, 0);\n howManyToRoll.put(Die.D20, 0);\n howManyToRoll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the surface of the object (i.e Flat surface).
public void setSurface(ISurface surface);
[ "public void surface() {\n surfacing = -1;\n }", "public void setSurface(org.landxml.schema.landXML11.SurfaceDocument.Surface surface)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.SurfaceDocument.Surface target = n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array containing the left team's positions.
public Vector2D[] leftTeamPos() { return new Vector2D[] { Vector2D.of(data[LEFT_1_X], data[LEFT_1_Y]), Vector2D.of(data[LEFT_2_X], data[LEFT_2_Y]), Vector2D.of(data[LEFT_3_X], data[LEFT_3_Y]) }; }
[ "private int[] getLeft(int numLeft, int[] players) {\n // System.out.println(\"NumLeft: \" + numLeft);\n // printRoster(players);\n int j = 0;\n int[] left = new int[numLeft];\n for (int i = 0; i < players.length; i++) {\n if (players[i] == UNCLAIMED) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filing Note by ID Returns the XBRL filing note contents in HTML or text format for a specified Intrinio XBRL filing note ID.
public FilingNote getNote(String identifier, String contentFormat) throws ApiException, NoSuchMethodException { Method targetMethod = FilingApi.class.getMethod("getNoteWithHttpInfo", String.class, String.class); Object[] apiCallArguments = { identifier, contentFormat }; ApiResponse<FilingNote> ...
[ "public Note getNote(Integer id);", "public String getFilingHtml(String identifier) throws ApiException, NoSuchMethodException {\n Method targetMethod = FilingApi.class.getMethod(\"getFilingHtmlWithHttpInfo\", String.class);\n \n Object[] apiCallArguments = { identifier };\n ApiResponse<String...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Const__Group__0__Impl" $ANTLR start "rule__Const__Group__1" ../org.waml.w3c.webidl.ui/srcgen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:8922:1: rule__Const__Group__1 : rule__Const__Group__1__Impl rule__Const__Group__2 ;
public final void rule__Const__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:8926:1: ( rule__Const__Group__1__Impl rule__Const__Gro...
[ "public final void rule__Const__Group__0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:8895:1: ( rule__Const__Group__0__Impl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the map of diffs.
public Map<Diff<K>, Diff<V>> getMap() { return map; }
[ "public List<Diff> getDiffs();", "private static List<Map<ExpressionToMonitor, DebuggerEvaluationResult>> getDiff(\n Map<ExpressionToMonitor, DebuggerEvaluationResult> entryMap,\n Map<ExpressionToMonitor, DebuggerEvaluationResult> exitMap) {\n List<Map<ExpressionToMonitor, DebuggerEva...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ clause = key ( ';' keyOrAttribute ) ( '=' attributeValue ) attributes
private void clause() { Attributes attrs = new Attributes(); // key String key = qt.nextToken(";,"); if (key == null) return; put(uniqueKey(key), attrs); while (qt.getSeparator() == ';') { String keyOrAttribute = qt.nextToken(";=,"); error(keyOrAttribute == null, "expected a clause ke...
[ "private SelectorPart parseAttribute() {\n if (!seekIf(Chars.LEFT_SQUARE_BRACKET)) {\n return null;\n }\n\n int saveIndex = index;\n Node key = null;\n if (match(ATTRIBUTE_KEY)) {\n key = new Anonymous(token);\n } else {\n key = parseQuoted();\n }\n if (key == null) {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Controls whether the stylesheet is reloaded for every transform. Setting this to true may get around a bug in certain XalanJ versions, default is false.
public void setReloadStylesheet(final boolean b) { reuseLoadedStylesheet = !b; }
[ "public void reload() {\n reloading = true;\n }", "private boolean hasStylesheet() {\n\t\treturn stylesheet != null;\n\t}", "public void setIsXmlTransformation(boolean isXmlTransformation) {\r\n this.isXmlTransformation = isXmlTransformation;\r\n }", "public static boolean cssRefreshEnable...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the fragment is no longer in use. Destroys the internal state of the WebView.
@Override public void onDestroy() { if (mWebView != null) { mWebView.destroy(); mWebView = null; } super.onDestroy(); }
[ "private void destroyWebView() {\n webViewContainer.removeAllViews();\n webView.clearHistory();\n // NOTE: clears RAM cache, if you pass true, it will also clear the disk cache.\n // Probably not a great idea to pass true if you have other WebViews still alive.\n webView.clearCach...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Standard parking fee is calculated as $5.00 for the first 3 hours parked, then $1.00/hour per time parked beyond 3 hours. Standard parking fees do not go higher than $15.
@Override public void getFee(ParkingBill parkingBill) { double hoursParked = parkingBill.getHoursParked(); if(hoursParked <= 3) { parkingBill.setAmountDue(5.00); } else if(hoursParked > 3 && hoursParked <= 13) { parkingBill.setAmountDue(5....
[ "public void feeSchedule()\n {\n if (tierVal == 1)\n {\n fee = 0.00;\n }\n else if (tierVal == 2)\n {\n fee = 0.002*value;\n }\n else if (tierVal == 3)\n {\n fee = 0.0025*value;\n }\n else if (tierVal == 4)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add number to pog number menu.
private void createPogNumberMenuItem(final MenuBar pogNumberMenu, final int i) { pogNumberMenu.addItem("" + i, new Command() { @Override public void execute() { ServiceManager.getDungeonManager().updateNumberOfSelectedPog(i); hide(); } }); }
[ "private void addPogNumberMenu(final MenuBar menu) {\n\t\tMenuBar pogNumberMenu = new MenuBar(true);\n\t\tfor (int i = 0; i <= Constants.MAX_POGNUMBER; ++i) {\n\t\t\tcreatePogNumberMenuItem(pogNumberMenu, i);\n\t\t}\n\t\tmenu.addItem(\"Pog Number\", pogNumberMenu);\n\t}", "public void numberPressed(int number) //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ The trees that are scattered around the area. Tree trees[]; The area tile map, with each tile represented as an integer. int tiles[][]; The tile values for grass (0) and stone (1) tiles. int grass; int stone; The number of tiles on the xaxis, and yaxis. int numTilesX; int numTilesY; The maximum position of a tree on ...
public OurArea(int numberOfTrees) { super(); // A magic function. I wonder what it does? //* Exercise #1. Setup the tree objects at random locations. trees = new Tree[numberOfTrees]; for (int i = 0; i < numberOfTrees; i++) { trees[i] = new Tree((int)(Math.random() * maxTreeX), ...
[ "public void createTrees() {\n\t\tif (terrain != null) {\r\n\t\t\ttreeGrid = new Grid();\r\n treeGrid.addRows((int) treeGridDimension.a, (int) treeGridDimension.b);\r\n\t\t\tterrain2treeGridRatio = new Tuple2f(terrain.getRows()/treeGridDimension.a, terrain.getColumns()/treeGridDimension.b); \r\n\t\t\ttre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the total cost of all VMs a given broker executed, for the entire simulation time.
public double getTotalCost(final DatacenterBroker broker) { final SlaContract contract = getContract(broker); final AwsEc2Template template = templatesMap.get(broker); final double totalPriceForVmsInOneHour = getActualPriceForAllVms(contract, template); final double totalExecutionTimeFo...
[ "private double getTotalExecutionTimeForVmsInHours(final DatacenterBroker broker) {\n return broker.getVmCreatedList().stream().mapToDouble(Vm::getTotalExecutionTime).sum()/3600.0;\n }", "public void setTotalCost() {\n\t\t// serviceRequest cost: execution cost...\n\t\t//double cost = getProcessingCost()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Automatic result conversion allowed by default. Override to change this behavior.
@Override public boolean allowAutomatedResultConversion() { return true; }
[ "Boolean getUseDefaultConversion();", "protected void convert() {\n\n\t}", "public void convert();", "public boolean supportsConvert()\n throws SQLException\n {\n return false;\n }", "MemberMetadata setUseDefaultConversion(Boolean flag);", "public abstract boolean explicitConversion(Type to)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======== read word map
static public Map<String, String> readWordMap(String mapFile) throws IOException{ LineReader mapReader = new LineReader(mapFile); Map<String, String> wordMap = new HashMap<String, String>(); for (String line : mapReader) { String[] fds = line.trim().split("\\s+\\|{3}\\s+"); wordMap.put(fds[0], fds[...
[ "private void readWordFile(\n Path path, Map<String, Integer> word2index, Map<Integer, String> index2word) {\n\n try (BufferedReader in = Files.newBufferedReader(\n path, StandardCharsets.UTF_8)) {\n String line;\n int cnt = 1;\n while ((line = in.readLine()) != null) {\n //Syst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
copy Exception info to sdCard
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private void leadExceptionToSD(Throwable exc) throws Exception { if (!sdExist()) return; File dir = new File(LOG_PATH); if (!dir.exists() || !dir.isDirectory()) dir.mkdirs(); String time = new SimpleDateFormat(...
[ "public void writeException(Throwable ex) {\n try {\n if (!errorFile.exists()) {\n errorFile.createNewFile();\n }\n PrintWriter bwErr = new PrintWriter(new FileWriter(errorFile, true));\n bwErr.append(Util.formatTime(Util.getCurrentTimeWithGpsOffset()) + \"\\n\");\n ex.printStackT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an array of alphanumeric product codes, sort them by priority
private static void OrderProductsByPriority(String[] products){ if(products == null || products.length == 0) return; Map<Integer, List<String>> priorityMap = new TreeMap<Integer, List<String>>(); for(String s : products){ int priority = getPriority(s); if(!priorityMap.containsKey(priority)){ ...
[ "public static List<String> sortOrders(List<String> orderList) {\n // Write your code here\n List<String> primeOrders = new ArrayList<>();\n LinkedHashSet<String> nonPrimeOrders = new LinkedHashSet<>();\n for (String order : orderList) {\n String orderType = order.split(\" \")[1];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a command item to the list with commandItem
public void addCommandItem( CommandItem commandItem) { commandItems.put(commandItem.getId(), commandItem); }
[ "public void addCommand(Command command) {\r\n\t\tcommandList.add(command);\r\n\t}", "public void addItem(String option, MenuCommand command) \r\n\t{\r\n\t\toptions.add(option);\r\n\t\tcommands.add(command);\r\n\t}", "public final void add(C command) {\n commands.put(command.getName(), command);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check commands on string name
ACommand CheckCommand(String NameCommand);
[ "boolean isAvailableCommand(String command);", "public boolean isCommand(String aString)\n {\n return validCommands.keySet().contains(aString);\n }", "public abstract boolean canHandle(String commandName);", "boolean matches(String command) {\n return this.commandString.equals(command)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of setStype method, of class Setting.
@Test public void testSetStype() { System.out.println("setStype"); Setting.SETTING_TYPE stype; Setting instance = Setting.getSetting("test"); stype = instance.getStype(); assertEquals(Setting.SETTING_TYPE.UND, stype); instance.setStype(Setting.SETTING_TYPE.TSTRING); ...
[ "@Test\n public void testGetStype() {\n System.out.println(\"getStype && setStype\");\n Setting instance = Setting.factory();\n Setting.SETTING_TYPE expResult = Setting.SETTING_TYPE.UND;\n Setting.SETTING_TYPE result = instance.getStype();\n assertEquals(expResult, result);\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the operator state to the given contant. use when you known what you do!
public void setOperatorState(final byte aState) { operatorState = aState; }
[ "void setCqState(int state);", "@Override\n public void setOperationalState(MatchOperationalState state) {\n MatchOperationalState oldState = this.operationalState;\n this.operationalState = state;\n if (oldState != state) {\n this.notifyObservers(new MatchOperationalStateUpdate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field1027' field.
public void setField1027(java.lang.CharSequence value) { this.field1027 = value; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField1027(java.lang.CharSequence value) {\n validate(fields()[1027], value);\n this.field1027 = value;\n fieldSetFlags()[1027] = true;\n return this; \n }", "public void setField1033(java.lang.CharSequence value) {\n this.fiel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to print details on all items within pList by using getDetails for personality class
public void list() { for(Personality objectHolder : pList) { String toPrint = objectHolder.getDetails(); System.out.println(toPrint); } }
[ "public void printDetails() {\n\t\tinitialize();\n\t\tif (person != null) {\n\t\t\tfor (int index = 0; index < person.size(); index++) {\n\t\t\t\tSystem.out.println(\"Name: \" + person.get(index).getFirstName() + \" \" + person.get(index).getLastName());\n\t\t\t\tSystem.out.println(\"Email: \" + person.get(index).g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
shapelet_first_m will take the data from a file and for each sequence in the file it will find the max and min extreme points. It will then determine which one comes first and will create a new shapelet based off of that extreme point.
private static List<List<String>> shapelet_first_m(List<String> list, int range_len) throws IOException { List<List<String>> new_list = new ArrayList<List<String>>(); String line; int max_index, min_index, index; for (int i = 0; i < list.size(); i++) { List<String> ret_line = new ArrayList<String>(); ...
[ "public Shape getFirstShape()\n {\n return firstShape;\n }", "public int findBestPointsForInstantation(PointSetRelationshipManager manager) {\r\n\t\tILogger logger = OpenGeoProver.settings.getLogger();\r\n\t\t\r\n\t\t// NOTE: This method is used to find best elements for process of transformation\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Private helper method that toggles the action's enabled state based on any type of item being selected.
private void toggleItemSelectedActions(boolean state) { mRemoveItemAction.setEnabled(state); mRenameItemAction.setEnabled(state); mDetailsViewToggleButton.setSelected(mDetailsViewDock.isVisible()); mGalleryViewToggleButton.setSelected(mGalleryViewDock.isVisible()); }
[ "private void toggleItem(View view) {\n adapter.toggleItemChecked(recyclerView.getChildAdapterPosition(view));\n\n if (adapter.getCheckedItemCount() == 0) {\n if (actionMode != null) {\n actionMode.finish();\n }\n actionModeEnabled = false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the best place to position text
@Override public void calculateTextPosition(int canvasW, int canvasH, ShowcaseView showcaseView) { Rect showcase = showcaseView.hasShowcaseView() ? mCalculator.getShowcaseRect() : new Rect(); int[] areas = new int[4]; //left, top, right, bottom areas[POSITION_LEFT] = showcase.left...
[ "@Override\r\n public int compare(TextPosition pos1, TextPosition pos2)\r\n {\n if (pos1.getDir() < pos2.getDir())\r\n {\r\n return -1;\r\n }\r\n else if (pos1.getDir() > pos2.getDir())\r\n {\r\n return 1;\r\n }\r\n \r\n // get the ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables the buttons for which you place ships/coordinates.
private void disablePlacementbuttons(){ addAircraftCarrierButton.setEnabled(false); addDestroyerButton.setEnabled(false); addSubmarineButton.setEnabled(false); }
[ "private void disableButtons()\r\n {\r\n }", "private void disableButtons() {\n for (DeployCommand cmd : DeployCommand.values()){\n setButtonEnabled(cmd, false);\n }\n butDone.setEnabled(false);\n setLoadEnabled(false);\n setUnloadEnabled(false);\n setAssau...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if the game ended set the number of rocks in the pit to zero add the remaining rocks to each corresponding Mancala
public void checkEndGame() { boolean gameFinished = false; //boolean playerOne = false; //boolean playerTwo = false; if (bucket[13].getnumOfRocks() == 0 && bucket[12].getnumOfRocks() == 0 && bucket[11].getnumOfRocks() == 0 && bucket[10].getnumOfRocks() == 0 && bucket[9].getnumOfRocks() == 0 && ...
[ "public boolean checkForOverallArmies() {\n\t\tint numb = 0;\n\t\tfor (int i = 0; i < this.gamePlayModel.getPlayers().size(); i++) {\n\t\t\tif (this.gamePlayModel.getPlayers().get(i).getremainTroop() != 0) {\n\t\t\t\tnumb++;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (numb == 0) {\n\t\t\tthis.gamePlayModel.getG...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets an event. Waits until all previous commands have finished the given stage to unsignal the event.
public void resetEvent(ZEPipelineStage stage, ZERenderEvent event);
[ "void unsetEvent();", "public synchronized void reset() {\n msg = null;\n events.clear();\n }", "protected void onReset() {}", "public synchronized void reset () {\r\n start = System.currentTimeMillis();\r\n if (paused) {\r\n end = start;\r\n }\r\n halt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs an AgentInitializationException with the specified detail message.
public AgentInitializationException(String s) { super(s); returnValue = 0; }
[ "public InitializationException(String msg) {\n super(msg);\n }", "public InitializationFailedException() {\n super();\n }", "public AgentInitializationException() {\n\t\treturnValue = 0;\n\t}", "public FactoryArtifactNotInitializedException(String msg) {\n super(msg);\n }", "public Uni...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints any model validation errors stored within the factory.
private void printValidationMessages(final List messages) { // - log all error messages if (messages != null && !messages.isEmpty()) { final StringBuffer header = new StringBuffer("Model Validation Failed - " + messages.size() + " VALIDATION ERROR"); ...
[ "public void showErrors();", "public void printErrors() {\n final int size = _errors.size();\n if (size > 0) {\n System.err.println(new ErrorMsg(ErrorMsg.COMPILER_ERROR_KEY));\n for (int i = 0; i < size; i++) {\n System.err.println(\" \" + _errors.get(i));\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna una lista con los lados de un grafo.
public ArrayList<Lado> lados(Grafo g);
[ "public List<MyArray> getArticulosGastosAss() throws Exception{\n\t\tRegisterDomain rr = RegisterDomain.getInstance();\n\t\tList<ArticuloGasto> list = rr.getArticulosGastosRG();\n\t\tList<MyArray> listaArticulosGastos = new ArrayList<MyArray>();\n\t\tfor(ArticuloGasto articuloGasto : list){\n\t\t\tMyArray articuloG...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the JSONArray for the given key.
public JSONArray getJSONArray(String key) { return (JSONArray)this.jsonObject.get(key); }
[ "public JSONArray getJSONArray(String key) {\n\t\treturn body.getJSONArray(key);\n\t}", "public JsonArray getArray(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null || value.value == null)\n\t\t\treturn null;\n\t\tif(value.type != ValueType.ARRAY)\n\t\t\tthr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DELETE /leads/:id : delete the "id" lead.
@RequestMapping(value = "/leads/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Void> deleteLead(@PathVariable Long id) { log.debug("REST request to delete Lead : {}", id); leadRepository.delete(id); leadSear...
[ "@DeleteMapping(\"/learners/{id}\")\n @Timed\n public ResponseEntity<Void> deleteLearner(@PathVariable Long id) {\n log.debug(\"REST request to delete Learner : {}\", id);\n learnerService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if the header of the APDU indicates Secure Messaging.
public final boolean isSecureMessaging() { return ((header[0] & (byte) 0x0F) == (byte) 0x0C); }
[ "boolean isSetMessageHeader();", "public Boolean hasMsgEncryption() {\n\t\t\n\t\treturn encryptedKey!=null;\n\t}", "public final void setSecureMessaging() {\n\theader[0] = (byte) (header[0] | 0x0C);\n }", "public SecureMessageHeader getSecureMessageHeader() {\r\n\t\treturn this.secureMessageHeader;\r\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. This particular comparator will compare two genomes diversity score.
@Override public int compare(Genome one, Genome two) { int ans = 0; if(one.getDiversity_score() < two.getDiversity_score()) ans = 1; else if(one.getDiversity_score() > two.getDiversity_score()) ans = -1; return ans; }
[ "@Override\r\n\tpublic int compare(Score inp1, Score inp2) {\r\n\t\tint score1 = inp1.getScore();\r\n int score2 = inp2.getScore();\r\n \r\n if (score1 > score2){\r\n return -1;\r\n }else if (score1 < score2){\r\n return +1;\r\n }else{\r\n return 0;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scan and Register the given list of Types
public void scanAndRegister(List<Class> listOfTypesToScan) { for (Class aClass : listOfTypesToScan) { scanAndRegister(aClass); } }
[ "private void scanAndRegisterTypes() throws Exception {\n ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();\n // search annotations\n Iterator<Metadata> it = scl.getAll(MetadataType.class, Metadata.class); //CellFactorySPI.class);\n logger.log(Level.INFO, \"[Metadata Service] ab...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
///////////////////////////////////////////// some convenience functions for manipulating arrays of LedColor ///////////////////////////////////////////// build an array of preinitialized LED color objects
public static LedColor[] createColorArray(int nLeds) { LedColor[] ledColors = new LedColor[nLeds]; for (int i = 0; i < nLeds; i++) { ledColors[i] = new LedColor(); } return ledColors; }
[ "public void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo NONNULL_PTR this_ptr, bool val);
public static native void DirectionalChannelInfo_set_enabled(long this_ptr, boolean val);
[ "public static native boolean DirectionalChannelInfo_get_enabled(long this_ptr);", "public static native void ChannelConfig_set_announced_channel(long this_ptr, boolean val);", "abstract void setChannelIdEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "@JsonSetter(\"dnisEnabled\")\r\n pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the property 'hookId'
@Test public void hookIdTest() { // TODO: test hookId }
[ "@Test\n public void hookRunIdTest() {\n // TODO: test hookRunId\n }", "public UUID getHookId() {\n return this.hookId;\n }", "protected boolean isHooked() {\n\t\treturn getHandle() instanceof NMSEntityHook;\n\t}", "@Test\n public void testHookRun() {\n // TODO: test HookRun\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
write data with version check, if version check error, return immediately
@Override public boolean writeWithVersionCheck(ProcessorContext context, DataSet<Row> dataSet, int expireTime) { Row row = dataSet.getFirstItem().orElse(new Row()); String key = row.getFieldValue(AllFieldName.tair_key); String value = row.getFieldValue(AllFieldName.tair_value); Objec...
[ "void writeLatestVersion(String version) {\n try {\n File file = new File(\"./AppData/Version.dta\");\n BufferedWriter versionWriter = new BufferedWriter(new FileWriter(file));\n versionWriter.write(version);\n versionWriter.flush();\n } catch (IOException i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GENFIRST:event_jRadioModificarActionPerformed TODO add your handling code here:
private void jRadioModificarActionPerformed(java.awt.event.ActionEvent evt) { eventosModificar(); }
[ "private void RadioButtonAgregarActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void botonRadioTextoActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public void actionPerformed( ActionEvent eve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated int32 countries = 12;
int getCountries(int index);
[ "java.util.List<java.lang.Integer> getCountriesList();", "int getCountriesCount();", "int[][][] generateFlags(int ratio, String country);", "public int getCountryIndex()\n {\n return countryIndx;\n }", "public int getCountryIndex()\n {\n return countryIndex;\n }", "public void se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case number: 6 / 2 covered goals: 1 oasis.names.tc.ciq.xsdschema.xal._2.AddressLine.getContent()Ljava/lang/String;: rootBranch 2 oasis.names.tc.ciq.xsdschema.xal._2.AddressLine.()V: rootBranch
@Test public void test6() throws Throwable { AddressLine addressLine0 = new AddressLine(); String string0 = addressLine0.getContent(); assertNull(string0); }
[ "@Test\n public void test5() throws Throwable {\n AddressLine addressLine0 = new AddressLine();\n addressLine0.setCode(\"\");\n assertNull(addressLine0.getContent());\n }", "@Test\n public void test71() throws Throwable {\n Thoroughfare.DependentThoroughfare thoroughfare_DependentThorou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method binds the poster image for each movie listing to it's grid cell. If the device in use is a tablet, the selection indicator is shown if the position matches the tracked position.
@Override public void onBindViewHolder(MovieListingViewHolder holder, int position) { Picasso.with(holder.itemView.getContext()).load(movieListings.get(position).getPosterUrl()).placeholder(R.color.blue).into(holder.posterView); if (MoviesApplication.getApp().isLargeLayout()) { holder.in...
[ "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder viewHolder = null;\n /**\n * checks if the view that the adapter got is null which means that\n * this view hasn't been inflated yet so it will be inflated first\n */\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get word count from scanner.
public static long count(final Scanner scanner) { return scanner.useDelimiter("\\s+").tokens().count(); }
[ "int getWordCount();", "public int count(String word);", "int getNumberOfWords();", "public int getWordCount() {\n int count = lexicon.size();\n return count;\n }", "private static int countWords(){\r\n int wordCount = 0;\r\n \r\n try{\r\n File file = new File(fileNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Modify Amount' attribute. If the meaning of the 'Modify Amount' attribute isn't clear, there really should be more of a description here...
BigDecimal getModifyAmount();
[ "public Integer getModifyMan() {\n return modifyMan;\n }", "public String getModifyId() {\n return modifyId;\n }", "public Integer getModifyPerson() {\n return modifyPerson;\n }", "public String getChangeAmount() {\r\n return changeAmount;\r\n }", "public Long getModi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtain a collection of of configuration modules representing each configuration file contained in this configuration directory.
public Collection<ConfigurationModule> getConfigurationModules() { return configurationModules.values(); }
[ "@SuppressWarnings(\"unchecked\")\n private List<ModuleDesc> getModulesFromConfigurationFile() {\n List<ModuleDesc> rueckgabe = new ArrayList<>();\n String fileName = ConfigCore.getKitodoConfigDirectory() + \"modules.xml\";\n if (!(new File(fileName).exists())) {\n Helper.setFehle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleTypeInfo" $ANTLR start "entryRuleActionRef" InternalGaml.g:2510:1: entryRuleActionRef : ruleActionRef EOF ;
public final void entryRuleActionRef() throws RecognitionException { int entryRuleActionRef_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 175) ) { return ; } // InternalGaml.g:2511:1: ( ruleActionRef EOF ) // InternalGaml.g:25...
[ "public final void entryRuleTypeRef() throws RecognitionException {\n int entryRuleTypeRef_StartIndex = input.index();\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 171) ) { return ; }\n // InternalGaml.g:2453:1: ( ruleTypeRef EOF )\n // InternalGaml....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to force a trojan flock into the model
public void forceTrojan(Flock trojan){ this.vVillages[this.vVillages.length-1].insertTrojan(trojan); }
[ "public void settleForce(Force f){\n if(!f.getOwner().equals(this.owner)){\n if(this.troops != 0)\n throw new IllegalArgumentException(\"Can't settle a Force in an occupied Territory\");\n this.owner = f.getOwner();\n }\n this.troops += f.getTroops();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the Highest ntuple in this hand where n=1..4
public Rank getHighestTuple() { List<Map.Entry<Rank, Integer>> list = this.sortCards(); return list.get(list.size() - 1).getKey(); }
[ "public Rank getSecHighestTuple() {\n \t\tList<Map.Entry<Rank, Integer>> list = this.sortCards();\n \t\treturn list.get(list.size() - 2).getKey();\n \t}", "public int highestValue(int n);", "public static short highPair(short[] hand) {\n hand = sortHighA(hand);\n for(int i=4;i>0;i--){\n if(cardRank(h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this element is an VNF instance
public boolean isVnfInstance () { return this instanceof WVnfInstance; }
[ "public native boolean isInstance(Object obj);", "public Boolean isInstanceVariable() {\n\t\treturn instancePosition != null;\n\t}", "protected Boolean deriveIsObjectCreation() {\r\n InstanceCreationExpression self = this.getSelf();\r\n ElementReference referent = self.getReferent();\r\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts listToSort and compares the result to sortedList.
private static boolean testSort(DoubleLinkedListADT<Integer> listToSort, DoubleLinkedListADT<Integer> sortedList, Comparator<Integer> c) { try { SearchAndSort.sort(listToSort, c); if (!equivalentLists(listToSort, sortedList)) { printLists(listToSort, sortedList); return false; } else { return tru...
[ "abstract public List<? extends Comparable<T>> performSort(List<? extends Comparable<T>> list);", "private Boolean sortList()\n\t{\n\t\tBoolean listSorted = true;\n\n\t\t// Perform a bubble sort on the unsorted list\n\t\tfor(int i = 0; i < (listSize-1); i++) \n\t\t{\n\t\t\tif(sortedList[i] > sortedList[i+1]) {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Essential. The LockSmith which made this Lock.
public FeLockSmith lockSmith() { return myLockSmith; /* udanax-top.st:27959:Lock methodsFor: 'protected:'! {FeLockSmith} lockSmith "Essential. The LockSmith which made this Lock." ^myLockSmith! */ }
[ "Thread getLocker();", "public Lock getLock() {\n return lock;\n }", "void lockGranted(LockHandle lockHandle);", "void holdsLock(Object lock);", "public Object getProperLock(Object context);", "@Override\n public void onLock(Myo myo, long timestamp) {\n }", "final public Lock test_get_lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Limits the original stream (3 items ) to a list with 2 items
@Test void limitMethod() { Stream<TransactionBean> transactionBeanStream = transactions.stream().limit(2); List<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new)); assertSame("wrong type", 2, afterStreamList.size()); }
[ "public static <E> List<E> take(Stream<? extends E> stream, int n){\n if (stream == null) return null;\n List<E> output_list = new LinkedList<E>();\n if ( n != 0) {\n Iterator<? extends E> iter = stream.iterator();\n while( n-- != 0 && iter.hasNext()) { output_list.add(ite...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ 5. Bitwise operators & performs bit wise AND operation | performs bit wise OR operation
public void bitwise() { System.out.println("BITWISE OPERATIONS"); int a, b; System.out.println("please enter a and b values"); a = s.nextInt();//5 = 0101 b = s.nextInt();//3 = 0011 // & System.out.printf("a & b is " + (a & b));//0001 = 1 // | System.out.printf("a | b is " + (a | b));//0111 = 7 ...
[ "public Object visitBitwiseAndExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Contexts: RecvExpr returns RecvExpr Constraint: exp=Expression
protected void sequence_RecvExpr(ISerializationContext context, RecvExpr semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, GoPackage.Literals.RECV_EXPR__EXP) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObj...
[ "Expression getExpr();", "public Expression getConstraintExpr()\n {\n return constraintExpr;\n }", "Expression getExpression () { return exp; }", "Expression getExpression();", "private Expression getConstraint(Type type, Expression exp, Type etype)\n {\n return Validation.getConstraint(typ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a set of enum constants from a set of flag bits.
private Set<E> parse( int flags ) { EnumSet<E> set = EnumSet.noneOf( enumClass ); for( Map.Entry<Integer, E> entry : bits2enums.entrySet() ) { int bits = entry.getKey(); E e = entry.getValue(); if(( flags & bits ) != 0 ) set.add( e ); } return set; }
[ "private Flags parseFlags() {\n\t\tFlags flags = new Flags();\n\t\tString[] flag = this.flags.split(\"\\\\+\");\n\t\tfor(String flg : flag) {\n\t\t\tString[] parts = flg.split(\"=\");\n\t\t\tif(parts.length <= 2 && parts.length >= 1) {\n\t\t\t\tswitch(parts[0]) {\n\t\t\t\t\tcase \"REQUIRES_LIVE\":\n\t\t\t\t\t\tflag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Overwrites the name of the entry with the given name.
public void setName (String newname, String oldName) { setName(newname, entryNames.indexOf(oldName)); }
[ "public void add_name_entry(String name, Entry new_entry)\n {\n names.put(name, new_entry);\n }", "public void setEntryName(String ename);", "public void updateName(String name){\r\n\t\tsuper.name = name;\r\n\t}", "public void setName (String newName, int index) {\n if (index < entryNames.size...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
and csmi_nation is null
public M csmiNationNull(){if(this.get("csmiNationNot")==null)this.put("csmiNationNot", "");this.put("csmiNation", null);return this;}
[ "boolean getCountryNull();", "boolean isNullOmittable();", "public void setNation(String nation) {\r\n this.nation = nation == null ? null : nation.trim();\r\n }", "public M csseBattleNull(){if(this.get(\"csseBattleNot\")==null)this.put(\"csseBattleNot\", \"\");this.put(\"csseBattle\", null);return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the panel. Order Panel
@SuppressWarnings("serial") // Make sure it doesn't complain about serialisation public OrderPanel() { setBackground(new Color(252, 252, 252)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{20, 0, 0, 0, 0, 122, 0, 0, 20}; gridBagLayout.rowHeights = new int[]{100, 0, ...
[ "public void newOrderPanel() {\n\t\tnewOrderPanel.removeAll(); //Clear the components\n\t\tnewOrderPanel.updateUI(); //Update the panel\n\n\t\t//If theres no items\n\t\tif(tempOrder.items.size() == 0) {\n\t\t\t//Set up the title and place it\n\t\t\tint newOrderPanelLabelWidth = orderFontMetrics.stringWidth(\"Order ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the creature in the cell.
public Creature getCellCreature() { return cellCreature; }
[ "@Override public Creature getCreature() {\n return zombie;\n }", "boolean resultingCellHasCreature(MazePoint point, Direction dir,\r\n CreatureType creatureType, int distance);", "public BaseCreature getCreature(Point p) {\n \tif(getVertex(p) != null) {\n\t\t\tret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Columna = "idMatricula", nullable = false, length = 50.
@ManyToOne(optional=false) @JoinColumn(name="idMatricula") @ForeignKey(name = "fkMatriculaAsistencia") public Matricula getMatricula() { return matricula; }
[ "public void setMatricula(long value) {\r\n this.matricula = value;\r\n }", "public void setId_ufficio(long id_ufficio);", "public void setApellidoMaterno(String apellidoMaterno);", "public Long getIdMarca() {\n return idMarca;\n }", "public void setMatricula(java.lang.String matricula) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new instance of ModuleDependency, where the sub module is idenfied by its name and version and wheter the containing module requires a private copy or not
public ModuleDependency(String name, String version, boolean shared, boolean reexport) { this.name = name; this.version = version; this.shared = shared; this.reexport = reexport; }
[ "public ModuleDependency(String name, String version) {\n this.name = name;\n this.version = version;\n this.shared = true;\n this.reexport = false;\n }", "Dependency createDependency();", "DependencySpec createModuleDependency(Import i) {\n ModuleIdentifier mi = createMod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prompt the user to input option and return next status.
public static void doOption() { System.out.print("換零錢 1)是 2)否?"); input = scanner.nextInt(); if (input == 1) { amount = 0; status = 1; } else if (input == 2) status = -1; else { System.out.print("Input error!"); status = 0; } }
[ "public void nextCommand() \r\n\t{\r\n\t\t// Prompt is an integer between 0 and options.size() - 1\r\n\t\tInputPrompt<Integer> optionPrompt = new InputPrompt<Integer>(\r\n\t\t\t\t\"Option: \", new IntegerValidator(0, options.size() - 1));\r\n\t\t\r\n\t\t// Continually prompt until a valid option is chosen.\r\n\t\ti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Writes the given HeapPage to disk. Because of the need to seek through the file, a RandomAccessFile object should be used in this method.
public void writePage(HeapPage p) { int pageId = p.getId(); byte[] data = p.getPageData(); File file = getFile(); RandomAccessFile raf; try { raf = new RandomAccessFile(file, "rw"); // Set current pointer raf.seek(PAGE_SIZE * pageId); raf.write(data); raf.close(); } catch (IOExcept...
[ "public void writePage(HeapPage p) {\r\n\t\tRandomAccessFile page = null;\r\n\t\ttry {\r\n\t\t\tpage = new RandomAccessFile(f, \"rw\");\r\n\t\t\tpage.seek(p.getId() * PAGE_SIZE);\r\n\t\t\tpage.write(p.getPageData(), 0 , PAGE_SIZE);\r\n\t\t\tpage.close();\r\n\t\t}catch (IOException e)\r\n\t\t{e.printStackTrace();}\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
java.lang.String getDirectoryTitle() Returns the value of field 'hostName'.
public java.lang.String getHostName() { return this._hostName; }
[ "public java.lang.String getDirectoryTitle()\n {\n return this._directoryTitle;\n }", "String getDomainTitle();", "public URL_HOST_NAMEElements getURL_HOST_NAMEAccess() {\n\t\treturn pURL_HOST_NAME;\n\t}", "public String getDesktopTitle() {\n return desktopFileData.header.desktopName;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the created GeofenceRequest to the device's monitoring list
private void addGeofence(GeofencingRequest request) { Log.d(TAG, "addGeofence"); GeofencingClient fence = getGeofencingClient(this); //check permissions if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISS...
[ "private void addGeofence(GeofencingRequest request) {\n Log.d(\"****\", \"addGeofence\" + request.toString());\n Log.d(TAG, Boolean.toString(checkPermission()));\n if (checkPermission())\n\n geofencingClient.addGeofences(request, createGeofencePendingIntent()).addOnSuccessListener(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column yinpiao_bill.pro_num
public String getProNum() { return proNum; }
[ "public void setProNum(String proNum) {\r\n this.proNum = proNum;\r\n }", "public Integer getProId() {\n return proId;\n }", "public String getprop_no() {\n return (String)getNamedWhereClauseParam(\"prop_no\");\n }", "public BigDecimal getProjectNumber(String pName) throws SQLExc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a public.trips table reference
public Trips() { this("trips", null); }
[ "TableInstance createTableInstance();", "public void createPollsTable(Connection conn) throws DAOException;", "private void createStressTestControlTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Container's getter for ReserveVO2.
public ReserveVOImpl getReserveVO2() { return (ReserveVOImpl)findViewObject("ReserveVO2"); }
[ "public ViewObjectImpl getReserveVO1() {\n return (ViewObjectImpl)findViewObject(\"ReserveVO1\");\n }", "public ReserveVOImpl getReserveVO3() {\n return (ReserveVOImpl)findViewObject(\"ReserveVO3\");\n }", "public Reserve getReserve() {\n return reserve;\n }", "public RowIterator...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the fixture for this Communication Path test case.
@Override protected CommunicationPath getFixture() { return (CommunicationPath)fixture; }
[ "protected ConnectionInfo getFixture() {\r\n\t\treturn fixture;\r\n\t}", "protected Channel getFixture() {\n\t\treturn fixture;\n\t}", "protected OpcDevice getFixture()\n {\n return fixture;\n }", "protected Endpoint getFixture() {\n\t\treturn fixture;\n\t}", "protected Diary getFixture() {\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prune set of changes (for ORE)
public Set<OWLAxiom> pruneChanges(Set<OWLAxiom> axioms) { Set<OWLAxiom> toRemove = new HashSet<OWLAxiom>(); for(OWLAxiom ax : axioms) { if(ax.isOfType(AxiomType.RBoxAxiomTypes) || ax.isOfType(AxiomType.ABoxAxiomTypes)) toRemove.add(ax); /* * On 20 July the commented lines below were introduced. T...
[ "void prune() {\n\n }", "protected void pruneBranches() {\n \t pruneTimer.start();\n activeList = pruner.prune(activeList); \n \t pruneTimer.stop();\n }", "public void prune() {\n this.getTree().prune();\n }", "public void resetChanges() {\n\t\tchanges = new HashSet<Integer>();\n\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disconnects from the given endpoint.
protected void disconnect(Endpoint endpoint) { mConnectionsClient.disconnectFromEndpoint(endpoint.getId()); mEstablishedConnections.remove(endpoint.getId()); }
[ "public void disconnect(String endpoint) {\n EdgeOpcUaClient client = sessionMap.getNode(endpoint).get();\n\n try {\n client.disconnect();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void disconnectArtist(UUID requestId) throws\n ArtistDisconnectingFailedException...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
In this test, the connection is configured for pull callbacks, and the acknowledgements should be made by an explicit call to Client.acknowledgeCallback() after the callbacks have been retrieved and (presumably) processed. Two InvokerCallbackHandlers are registered.
public void testBlockingPullApplicationAckDifferentHandlers() { log.info("entering " + getName()); try { TestCallbackHandler callbackHandler1 = new TestCallbackHandler(); client.addListener(callbackHandler1); TestCallbackHandler callbackHandler2 = new TestCallbackHandler(...
[ "public void testPullRemotingAckDifferentHandlers()\n {\n log.info(\"entering \" + getName());\n try\n {\n TestCallbackHandler callbackHandler1 = new TestCallbackHandler();\n client.addListener(callbackHandler1);\n TestCallbackHandler callbackHandler2 = new TestCallbackHandl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates the Fan In (FI) Primary Metric and its subceeded values in the csv file.
private void generateFI() { try { // Primary Metric Fan In (FI) csvWriter.append(",,Fan In (FI),,,,"); // For each class in the project for(String key: classNames) { csvWriter.append(String.valueOf(calc.getPrimaryMetrics().getFanIn().get(key)) + ","); } csvWriter.append("\n"); } catch (IOExce...
[ "private void generateFO() {\n\t\ttry {\n\t\t\t// Primary Metric Fan Out (FO)\n\t\t\tcsvWriter.append(\",,Fan Out (FO),,,,\");\n\t\t\t// For each class in the project\n\t\t\tfor(String key: classNames) {\n\t\t\t\tcsvWriter.append(String.valueOf(calc.getPrimaryMetrics().getFanOut().get(key)) + \",\");\n\t\t\t}\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field tdeletes is set (has been assigned a value) and false otherwise
public boolean isSetTdeletes() { return this.tdeletes != null; }
[ "public boolean isSetTdelete() {\n return this.tdelete != null;\n }", "public boolean isSetIsDelete() {\n\t\treturn org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISDELETE_ISSET_ID);\n\t}", "public boolean is_set_deleted() {\n return __isset_bit_vector.get(__DELETED_ISSET_ID);\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
"OK name" the command GET was performed correctly.
public String GET(String name){ return "OK " + this.clientData.get(name); }
[ "@Test\n\tpublic void testSimpleFindGetHandler() {\n\t\tHTTPRequest request = new HTTPRequest(\"GET /find HTTP/1.1\");\n\t\tHTTPResponse response = connection.getResponse(request);\n\t\tassertTrue(response.isValid());\n\t}", "@Test\n public void getMethod() throws BonitaException, InterruptedException {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the given entity with the given nonPK values.
public int update(final GenericEntity entity, final EntityConditionParam nonPkCondition) throws GenericEntityException { final ModelEntity modelEntity = entity.getModelEntity(); if (modelEntity == null) { throw new GenericModelException("Could not find ModelEntity for entityName:...
[ "ProductPriceEntity update(ProductPriceEntity entity) ;", "int updateByPrimaryKeySelective(GameSinglePrize entity);", "public PtJJdwcy update(PtJJdwcy entity);", "public void updateTg000003(Tg000003 entity) throws Exception;", "int updateByPrimaryKey(GameSinglePrize entity);", "private <X> void updateInBa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the associated RowIterator using masterdetail link HierarchyChildDetailVO.
public RowIterator getHierarchyChildDetailVO() { return (RowIterator)getAttributeInternal(HIERARCHYCHILDDETAILVO); }
[ "public Iterator getDetailEntries();", "public int getChildRowId()\n {\n return m_childRowId;\n }", "public <T extends GenericDetail> Iterator<T> getDetailsAndDescendants(\n Class<T> detailClass)\n {\n assertConnected();\n\n return infoRetreiver.getDetailsAndDescendants(uin, det...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }