query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Returns the specific letter instance from a stringwrapped character
public static Letter fromString(String character) { try { return Letter.valueOf(character); } catch (Exception e) { return null; } }
[ "public static char getLetter(String s){\n //A variable used in the helper method\n int i = 0;\n return getLetter(codeTree, s, i);\n }", "public Letter getLetter(Character c) {\n return get(c);\n }", "public TurkicLetter getLetter(char c) {\r\n if (c >= MAX_CHAR_VALUE |...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column private_letter.sending_time
public void setSendingTime(Date sendingTime) { this.sendingTime = sendingTime; }
[ "public void setSendTime(Date sendTime) {\r\n this.sendTime = sendTime;\r\n }", "public void setSendTime(Date sendTime) {\n this.sendTime = sendTime;\n }", "public void setSendtime(Date sendtime) {\n this.sendtime = sendtime;\n }", "public Builder setSendCommandTime(long value) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form QLDog
public QLDog() { initComponents(); }
[ "FORM createFORM();", "public void createTFQuestion(){\r\n Categories c = new Categories(); // Category of the question\r\n c = categoriesFacade.find(this.getQcategory());\r\n Questions temp = new Questions();\r\n //set question attributes\r\n temp.setQid(this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets (as xml) the "SignatureProviderId" element
void xsetSignatureProviderId(com.microsoft.schemas.office.x2006.digsig.STUniqueIdentifierWithBraces signatureProviderId);
[ "void setSignatureProviderId(java.lang.String signatureProviderId);", "java.lang.String getSignatureProviderId();", "void xsetSignatureProviderDetails(org.apache.xmlbeans.XmlInt signatureProviderDetails);", "void setSignatureProviderDetails(int signatureProviderDetails);", "void xsetSignatureProviderUrl(com...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'JZ Gesture'.
JZGesture createJZGesture();
[ "JZTarget createJZTarget();", "public GestureClass getGestureClass(){\r\n return gestureClass;\r\n }", "JZPads createJZPads();", "JZJazzInterface createJZJazzInterface();", "JzOscTarget createJzOscTarget();", "Gesture<E> getGesture();", "JZSwitches createJZSwitches();", "JZFader createJZFader()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move recursively by distance
private void moveRecursive(double distance) { double usedDistance; Waypoint newWaypoint; if(distanceFromWaypoint + distance < waypoint.getDistance()) { usedDistance = distance; newWaypoint = waypoint; distanceFromWaypoint += distance; } else { usedDistance...
[ "private void moveRecursiveHelper (double pixels) {\n if (pixels <= 0 + PRECISION_LEVEL) return;\n \n Location currentLocation = getLocation();\n Location nextLocation = getLocation();\n Location nextCenter = nextLocation;\n nextLocation.translate(new Vector(getHeading(), pix...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a iterator for a domain object. (This function can be applied on all domain types)
Iterator<List<SymbolicExpression>> getDomainIterator( SymbolicExpression domain);
[ "@Override\n public Iterator<Entity> iterator() {\n return entities.iterator();\n }", "Iterator<DicomElement> iterator();", "Iterator<T> createIterator();", "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\r\n public static <T> Iterator<T> getIterator(Object obj)\r\n {\r\n if (obj instanceo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the config associated with the given id, and returns it.
FlexibleConfig removeConfig(SimpleUri configId);
[ "public void removeConfiguration(String id);", "@RequestMapping(\"/remove/{id}\")\n public String removeConfiguration(@PathVariable(\"id\") int id) {\n\n this.configurationService.removeConfiguration(id);\n return \"redirect:/configurations\";\n }", "public void removeFiBcoinPayconfig(final ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the indices of the slices that intersect with [offset, offset + width)
public List<Integer> getIndices(double offset, double width) { List<Integer> indices = new ArrayList<>(); int begin = getIndex(offset); int range = getRange(offset, width); while (range > 0) { int index = begin % _totalPoints; indices.add(index); begin += 1; ...
[ "public int[] getSlicePosition();", "public int getIndex(double offset)\n {\n double length = 0;\n int index = 0;\n while (index < _totalPoints)\n {\n length += getUnitWidth(index);\n // At slice boundary, return the next index\n if (isEqual(length, offset, Ring.DELTA))...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add an portlet to the page and set the ID of this portlet on the page to the given value. If any other portlet exists on the page with the same ID the old portlet is removed.
void addPortlet(PortletKey portletKey, String instanceKey);
[ "void addPortlet(PortletKey portletKey);", "@UiChild(tagname = \"portlet\")\n public void add(Portlet portlet, int column) {\n insert(portlet, getWidget(column).getWidgetCount(), column);\n }", "void add( Portlet portlet, int column );", "public void addPortlet(org.light.portal.portlet.config.Portlet vPo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "RULE_STRING" $ANTLR start "RULE_NATURAL"
public final void mRULE_NATURAL() throws RecognitionException { try { int _type = RULE_NATURAL; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalEsm.g:13292:14: ( ( ( '0' .. '9' )+ | '\\u221E' ) ) // InternalEsm.g:13292:16: ( ( '0' .. '9' )+ | '\\u221E' ) ...
[ "@Override\r\n protected Rule fromStringLiteral(String string) {\r\n return string.endsWith(\" \") ?\r\n Sequence(String(string.substring(0, string.length() - 1)), WhiteSpace()) :\r\n String(string);\r\n }", "static public Rule parse(OrchestraSystem catalog, String rule,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the ValidFrom field. Date (inclusive) from which this letter of credit is valid.
Date getValidFrom();
[ "public Date getValidFrom();", "@Override\n\tpublic java.util.Date getValidatedFrom() {\n\t\treturn _dictData.getValidatedFrom();\n\t}", "public Calendar getValidityFrom()\n\t{\n\t\treturn validityFrom;\n\t}", "protected Date getFromDate() {\n\t\treturn from;\n\t}", "public java.lang.String getValidFrom() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the new Url and announce the PeerCache
public void setUrl(String value) { if (value == null) { return; } if ((pathloadConfigUrl != null) && (pathloadConfigUrl.equals(value))) { logger.log(Level.FINEST, "The URLs are the same. " + value); return; } String oldValue = pathloadConfigUr...
[ "void updateRemoteUrl(String url);", "public void setServerUrl(String newUrl) {\n if(newUrl == null){\n return;\n }\n props.setProperty(\"url\", newUrl);\n saveProps();\n }", "public abstract void setURL(String url);", "void updateForUrl(String url);", "EasyRequest ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets new instances of all unreferenced plugins.
@SuppressWarnings("unchecked") public static List<IPlugable> getUnreferencedPluginSamples( IPluginFilter filter) { ArrayList<IPlugable> filtered = new ArrayList<IPlugable>( ); for (UnrefPluginContainer container : unrefPlugins.values( )) { IPlugable plugin = container.getSample( ); if (plugin != nul...
[ "@SuppressWarnings(\"unchecked\")\r\n\tprivate static List<IPlugable> getAllPlugins() {\r\n\t\tArrayList<IPlugable> plugins = new ArrayList<IPlugable>( );\r\n\t\tfor (RobotPluginContainer container : robotPlugins.values( )) {\r\n\t\t\tplugins.addAll(container.getPlugins( ));\r\n\t\t}\r\n\t\tfor (UnrefPluginContaine...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets estimated radio source position.
public P getEstimatedPosition() { return mRssiPositionEnabled ? mRssiInnerEstimator.getEstimatedPosition() : mRangingInnerEstimator.getEstimatedPosition(); }
[ "public double getPosition()\r\n\t{\r\n\t\t//SmartDashboard.putNumber(\"sensor position\", Master.getSelectedSensorPosition(0));\r\n\t\treturn Master.getSelectedSensorPosition(0)/165.0;\r\n\t}", "public double getRelativePosition() {\n return (this.getPosition() - this.initialPosition) * Motors.POSITION_CO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get XAPIVerb from map object
public XAPIVerb getByMap(Map verb) { String id = (String)verb.get("id"); if (!this.idMap.containsKey(id)) { this.addVerb(verb); } return this.getById(id); }
[ "org.apache.xmlbeans.XmlString xgetVerb();", "public XAPIVerb getById(String id) {\r\n if (!this.idMap.containsKey(id)) {\r\n System.out.println(\"Verb not found: \" + id);\r\n return null;\r\n }\r\n return this.idMap.get(id);\r\n }", "public XAPIVerb getByName(Stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Navigate to the StoreOrdersActivity
void navigateToStoreOrders() { Intent gotoStoreOrders = new Intent(this, StoreOrdersActivity.class); startActivity(gotoStoreOrders); }
[ "void navigateToCurrentOrder() {\n Intent gotoCurrentOrder = new Intent(this, CurrentOrderActivity.class);\n startActivity(gotoCurrentOrder);\n }", "void navigateToOrderingDonut() {\n Intent gotoOrderDonut = new Intent(this, OrderingDonutActivity.class);\n startActivity(gotoOrderDon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form TelaQuartos
public TelaQuartos() { initComponents(); }
[ "public void createTFQuestion(){\r\n Categories c = new Categories(); // Category of the question\r\n c = categoriesFacade.find(this.getQcategory());\r\n Questions temp = new Questions();\r\n //set question attributes\r\n temp.setQid(this.getQid());\r\n te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables player first randomspawn as it will be handled here.
public static void disableLocalRandomSpawn() { MercuryAPI.sendGlobalMessage("info|randomspawn|disable", "BetterShards"); }
[ "protected void performSpawnNoChecks(final Player player) {\n spawnPacket.sendPacket(player);\n }", "private void spawnAdditionalRandom() {\n if ( gameTime % 1 >= 0.5 && 0.5 - (gameTime - timeLastSpawn) < 0) {\n Random rand = new Random();\n int randomInt = rand.nextInt(1000...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A utility to group active tenant nodes by application
protected Map<ApplicationId, NodeList> activeNodesByApplication() { return nodeRepository().nodes() .list(Node.State.active) .nodeType(NodeType.tenant) .not().tester() .groupingBy(node -> ...
[ "protected static EnactmentGraph application2EnactmentGraph(\n final Application<Task, Dependency> application) {\n final EnactmentGraph result = new EnactmentGraph();\n // add the nodes\n for (final Task task : application) {\n result.addVertex(task);\n }\n // add the edges\n for (final...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleEventOccurence" $ANTLR start "entryRuleStateOccurence" PsiInternalStateConstraintTransition.g:1131:1: entryRuleStateOccurence returns [Boolean current=false] : iv_ruleStateOccurence= ruleStateOccurence EOF ;
public final Boolean entryRuleStateOccurence() throws RecognitionException { Boolean current = false; Boolean iv_ruleStateOccurence = null; try { // PsiInternalStateConstraintTransition.g:1131:56: (iv_ruleStateOccurence= ruleStateOccurence EOF ) // PsiInternalStateCons...
[ "public final Boolean entryRuleEventOccurence() throws RecognitionException {\n Boolean current = false;\n\n Boolean iv_ruleEventOccurence = null;\n\n\n try {\n // PsiInternalStateConstraintTransition.g:1104:56: (iv_ruleEventOccurence= ruleEventOccurence EOF )\n // PsiInte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method used to spawn other ships.
private void spawn() { isSpawning = true; for(int i = 0; i < numGen.nextInt(15)+1; i++) { Engine.instance.addShip(new XShip((int)xPos, (int)yPos)); } }
[ "boolean testSpawnShips(Tester t) {\n return t.checkExpect(new NBullets(lob3, los3, 8, 12, 23, new Random(10)).spawnShips(),\n new NBullets(lob3, los3, 8, 12, 23))\n && t.checkExpect(new NBullets(lob3, los3, 8, 12, 24, new Random(10)).spawnShips(),\n new NBullets(lob3,\n n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Places the wave info at the given point. Handles there being no prior infos at that point correctly.
private void putInfoAt(Integer pos, WaveInfo info) { Set<WaveInfo> waves = waveInfos.getOrDefault(pos, new HashSet<>()); waves.add(info); waveInfos.put(pos, waves); }
[ "private void updateMeasurement(Point measuredPoint) {\n measurement.put(0, 0, measuredPoint.x);\n measurement.put(1, 0, measuredPoint.y);\n }", "public void saveSignal(Point point){\n\n String query = String.format(\"INSERT INTO emt_map_signal(Id, lng, lat, type) VALUES (%s, '%s', '%s', '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method corresponds to the database table tbl_profile
List<TblProfile> selectByExample(TblProfileExample example);
[ "public int getProfile_id() {\n return profileID;\n }", "@Select({ \"select\", \"id, sign_user_id, user_name, address, chain_id, group_id, user_status, gmt_create, \", \"gmt_modified, description\", \"from tb_user\", \"where id = #{id,jdbcType=INTEGER}\" })\n @Results({ @Result(column = \"id\", property = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the list of available PerNodeServiceLevels.
public com.zeus.soap.zxtm._1_0.SystemStatsPerNodeServiceLevel[] getPerNodeServiceLevels() throws java.rmi.RemoteException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperat...
[ "public SortedSet<String> getAvailableLevels() {\n if (allAvailableLevels == null) {\n allAvailableLevels = new TreeSet<String>();\n\n try {\n List<String> dataTypeList = new ArrayList<String>();\n dataTypeList.add(dataType);\n\n List<String>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
"Composite goals are loaded as defined in the map file. The player does not "win" until the composite expression is true." This tests a more complicated composite expression, as well as that goals can be "desatisfied" FloorSwitches must remain pushed down, and the player must be standing on top of the exit to win.
@ParameterizedTest @MethodSource(value = "createEverythingGoals") public void AC1MultiLevelled(Goal everythingGoal) { Game g1 = Game.createMockGame(everythingGoal, "" + "PS! \n" + "TE B_ \n" ); g1.movePlayer(Direction.DOWN); g1.movePlayer(Direction.UP); g1.movePlayer(Direction.RIGHT); g...
[ "@Test\n public void testConditionlManaWorksIfCavernIsReplayed() {\n addCard(Zone.HAND, playerA, \"Cavern of Souls\");\n addCard(Zone.HAND, playerA, \"Gladecover Scout\"); // Elf costing {G}\n addCard(Zone.HAND, playerA, \"Fume Spitter\"); // Horror costing {B}\n\n // Instant - {U}{U}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setter method of accSeqNo
public void setAccSeqNo(int accSeqNo) { this.accSeqNo = accSeqNo; }
[ "public int getAccSeqNo() {\r\n\t\treturn accSeqNo;\r\n\t}", "void setSequence(int seq);", "public void setSeqNum(long value) {\n this.seqNum = value;\n }", "public void setBatSeqNo(long batSeqNo);", "@Override\n\tpublic void setSeq(java.lang.Integer seq) {\n\t\t_codeDto.setSeq(seq);\n\t}", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes the drop down list for color options for the intensity label text color
protected void makeIntensityLabelColorOptions(final GridBagConstraints gbc, final GridBagLayout gbl) { final JLabel l1 = new JLabel("Intensity label color:"); l1.setFont(MipavUtil.font12); l1.setForeground(Color.black); gbc.insets = new Insets(0, 0, 0, 5); gbc.gridwidth = ...
[ "private void changeColors(){\n \n Color vaccanceColor = vaccance.getValue();\n String vaccRGB = getRGB(vaccanceColor);\n databaseHandler.setTermColor(\"vaccance\", vaccRGB);\n \n Color travailColor = travail.getValue();\n String travailRGB = getRGB(travailColor);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the set of outgoing states.
public Set<StateVertex> getOutgoingStates(StateVertex stateVertix) { final Set<StateVertex> result = new HashSet<StateVertex>(); for (Eventable c : getOutgoingClickables(stateVertix)) { result.add(sfg.getEdgeTarget(c)); } return result; }
[ "public HashSet<LocalState> getNextStates() {\r\n\t\tHashSet<LocalState> nextStates = new HashSet<LocalState>();\r\n\t\tfor (LocalTransition tr : outgoingTransitions) {\r\n\t\t\tnextStates.add(tr.getDest());\r\n\t\t}\r\n\t\treturn nextStates;\r\n\t}", "public List<NavArc> listOutgoing() {\r\n List<NavArc> ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to get the reservations in specified interval
List<Reservation> getReservationsByInterval(LocalDateTime fromTime, LocalDateTime tillTime);
[ "@Test\n\tpublic void testListReservationsOfUserInInterval() {\n\t\t// create a reservation\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t// list start is now\n\t\tDate listStart = cal.getTime();\n\t\tcal.add(Calendar.HOUR, 24);\n\t\t// list end is now + 24h\n\t\tDate listEnd = cal.getTime();\n\n\t\tcal.add(Ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Profile Section Location' reference. If the meaning of the 'Profile Section Location' reference isn't clear, there really should be more of a description here...
IfcShapeAspect getProfileSectionLocation();
[ "public String getProfilesLocation() {\n return profilesLocation;\n }", "public java.lang.String getProfileReference() {\r\n return profileReference;\r\n }", "public URI getProfile() { \n\t\treturn getProfileElement().getValue();\n\t}", "public String getLocation() {\r\n return (St...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a div of Fight Card into a fight event.
private static FightEvent parseFightCard(Element fightCard, Integer eventId) { // Fight Card table tags. final String ROUND_CLASS = "div.round"; final String WEIGHT_CLASS = "div.weightclass"; final String CHAMP_BELT_TAG = "img[src*=mma_champ_belt.gif]"; final String PLAYER_ONE_CLASS = "div.player1"; final S...
[ "public static ArrayList<FightEvent> parseFightEvent(int eventId)\n\t\t\tthrows IOException {\n\t\t// Establish Connection.\n\t\tString url = String.format(FIGHT_SITE, eventId);\n\t\tDocument doc = Jsoup.connect(url).get();\n\t\tElements fightCards = doc.select(FIGHT_TAG);\n\t\tArrayList<FightEvent> fightEvents = n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets cars carType. Should not be directly changed.
private void setCarType(CarType carType) throws IllegalArgumentException { if (carType != null) { this.carType = carType; } else { throw new IllegalArgumentException("carType of the car can not be set to null."); } }
[ "public void setCarType(CarTypeEnum carType) {\n\t\tthis.carType = carType;\n\t}", "public void setCarType(String carType) {\r\n\t\tthis.carType = carType;\r\n\t}", "public void setCarType(Integer carType) {\n this.carType = carType;\n }", "public String getCarType() {\r\n\t\treturn carType;\r\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the raw schema
public String getRawSchema() { return rawSchema; }
[ "public String getSchema()\n {\n return schema;\n }", "String getRemoteSchema();", "public java.lang.String getSchema() {\r\n return schema;\r\n }", "public String getRemoteSchema();", "@Override\n\tpublic Fields getSchema() {\n\t\treturn schema;\n\t}", "public Schema getSchema() {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Atom'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseAtom(Atom object) { return null; }
[ "Atom getAtom();", "@SuppressWarnings(\"all\") /* package private class QuotedTextAtom is defined in file TextAtom rather than its own file. */\n private Atom parseAtom(Tokens.SExpToken t) {\n if (t instanceof Tokens.BooleanToken) {\n if (((Tokens.BooleanToken)t).getValue())\n return Bool...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Finds the appearance weighting of a junction node using the Sethuraman junction weight / / The x position of the node / The y position of the node / A binary threshold buffer of that region / The maximum radius around the node to use for this weighting / The minimum radius around the node to use for this weighting / ...
protected int findJunctionAppearanceWeight(int x, int y, byte[][] thresholdBuffer, int Rmax, int Rmin) { int weightingFactor = thresholdBuffer[x][y] > 0 ? 1 : 0; boolean onWall = false; //double root2 = Math.sqrt(2.0); final int minWallWidth = 4; ...
[ "private int getWeight(ArrayList<Node> nodePair) {\n int xDif = Math.abs(nodePair.get(0).getLocX() - nodePair.get(1).getLocX());\n int yDif = Math.abs(nodePair.get(0).getLocY() - nodePair.get(1).getLocY());\n int finalDif = (int) Math.pow(xDif, 2) + (int) Math.pow(yDif, 2);\n return (int...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a string at the end of the name of an ItemStack instance
public static ItemStack nameAdd(ItemStack is, String add) { return name(is, getName(is) + add); }
[ "public void addNameTag(){\r\n \t\tGameRegistry.addRecipe(new ItemStack(Items.name_tag, 4),\r\n\t \t\t\t\"SIS\",\r\n\t \t\t\t'I', Items.sign,\r\n\t \t\t\t'S', Items.string);\r\n \t\r\n }", "private void setItemName() {\n Recipe recipe = CraftingManager.getRecipe(type);\n\n JPanel recipeDispl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
write code to show the uploads
public void showUpload(){ }
[ "public void showFiles() {\n\t\tif (showFiles != null) {\n\t\t\tfor (int i = 0; i < showFiles.size(); i++) {\n\t\t\t\ttext(showFiles.get(i).name, 10, 40 + i * 16);\n\t\t\t}\n\t\t}\n\t}", "private void setFileUploader() {\n\t\tfinal ProgressBar progressBar = new ProgressBar(0.0, 1.0, 0.0, new CancelProgressBarText...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checking if reservation of given id is not canceled
private boolean checkNotCanceledReservation(int id) throws SQLException { checkNotCanceledReservationStatement.clearParameters(); checkNotCanceledReservationStatement.setInt(1, id); checkNotCanceledReservationStatement.setString(2, this.username); ResultSet result = checkNotCanceledReservationStatement.executeQ...
[ "private boolean privateCancel(int id){\n\t\tint index = -1;\n\t\tboolean found = false;\n\t\tfor (Reservation res : reservations){\n\t\t\tif(res.getId() == id){\n\t\t\t\tindex = reservations.indexOf(res);\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(found){\n\t\t\tReservation target = reservation...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "entryRuleRelationalExpression" $ANTLR start "ruleRelationalExpression" ../eu.artist.postmigration.nfrvt.lang.gml/srcgen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2529:1: ruleRelationalExpression returns [EObject current=null] : (this_ComparableExpression_0= ruleComparableExp...
public final EObject ruleRelationalExpression() throws RecognitionException { EObject current = null; EObject this_ComparableExpression_0 = null; EObject lv_operator_2_0 = null; EObject lv_operator_4_0 = null; EObject lv_operator_6_0 = null; EObject lv_ope...
[ "public final EObject ruleRelationalExpression() throws RecognitionException {\n EObject current = null;\n\n Token lv_operator_2_1=null;\n Token lv_operator_2_2=null;\n Token lv_operator_2_3=null;\n Token lv_operator_2_4=null;\n Token lv_operator_2_5=null;\n Token lv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a byte buffer to an hexadecimal string.
public static String toHex(byte[] buffer) { StringBuilder hexBuilder = new StringBuilder(); for (int byteIndex = 0; byteIndex < buffer.length; byteIndex++) { hexBuilder.append(toHex(buffer[byteIndex])); } return hexBuilder.toString(); }
[ "public static String bufferToHexString(byte[] buffer, Character separator) {\r\n StringBuffer hexBuilder = new StringBuffer();\r\n boolean alreadySetADigit = false;\r\n\r\n for (int currentOffset = 0; currentOffset < buffer.length; currentOffset++) {\r\n\r\n if (separator != null) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Commit the staged move currently on the board
public void commitMove() { // Nothing currently staged if ( board.currentState() == Board.NORMAL ) { // Dilemma - nulling this now helps the gui know that nothing was committed // However, it prevents us from referencing the previous move if an errant commit occurs la...
[ "public void commit() {\n\t\tcommitted = true;\n\t\tbackUp();\n\t\t//back up the current board info at the meanwhile\n\t}", "protected void commit()\n\t{\n\t\tActionStructural actStruct = _actionset.getActionStructural();\n\t\tCommandStructuralCommit commit = new CommandStructuralCommit();\n\t\tactStruct.submit(c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form TypeOfLeave
public TypeOfLeave() { initComponents(); }
[ "public final LeaveType getLeaveType() {\n return leaveType;\n }", "MedicalLeave create(MedicalLeave medicalLeave);", "public CreateLeaveCommand(UserVisitPK userVisitPK, CreateLeaveForm form) {\n super(userVisitPK, form, COMMAND_SECURITY_DEFINITION, FORM_FIELD_DEFINITIONS, false);\n }", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an address for a serial communication, associating a serial interface and various serial signal carcteristics.
public SerialAddress(String name, int bauds, DataBits dataBits, StopBits stopBits, Parity parity, FlowControl flowControl) { if (name == null) { throw new IllegalArgumentException("name"); } name = name.trim(); if (name.length() == 0) { throw new IllegalArgumentException("Empty name."); } if (bauds...
[ "void connect(String serialNumber) throws DeviceException;", "private void setupSerial() {\n if (Boolean.parseBoolean(GatewayProperties.getProperty(\"arduino.enabled\"))) {\n serialCommunication = new SerialCommunication();\n }\n }", "public final void setSerial(String serial){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy constructor for the Appearance objects. Performs a deep copy of all the data fields from the passed object to the one called.
public Appearance(final Appearance toCopy) { if (toCopy.colorFill != null) { this.colorFill = toCopy.colorFill; } if (toCopy.colorLine != null) { this.colorLine = toCopy.colorLine; } if (toCopy.imageFileName != null) { this.imageFileName = toCopy.imageFileName; } if (toCopy.imageReference != null...
[ "public Appearance() {\n\t\timageFileName = null;\n\t\timageReference = null;\n\t\tcolorFill = null;\n\t\tcolorLine = null;\n\t\tstrokeWeight = 2;\n\t}", "private Appearance cuboAppearance () {\n Appearance appearance = new Appearance();\n appearance.setDuplicateOnCloneTree(false);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given coordinates of two base vertices, two bar lengths and local orientation, solve for a third point constructed using rulerandcompass
public static Point2D solve(Point2D p1, Point2D p2, double r1, double r2, int orient) { // TODO: double r3 = p1.distance(p2); assert (r3 != 0); // a = (r0^2 - r1^2 + d^2 ) / (2 d) double a = (r1 * r1 - r2 * r2 + r3 * r3) / (2 * r3); // double a = ((2 * pp1.x() * pp1.x() - 2 * pp1.x() * pp.x() ...
[ "private void solveIntersectionPoints() {\n\t\tRadialGauge gauge = getMetricsPath().getBody().getGauge();\n\n\t\t// define first circle which is gauge outline circle\n\t\tx0 = gauge.getCenterDevice().getX();\n\t\ty0 = gauge.getCenterDevice().getY();\n\t\tr0 = gauge.getRadius();\n\t\tarc0 = new Arc2D.Double(x0 - r0,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional bool selectFemale = 8;
public boolean getSelectFemale() { return selectFemale_; }
[ "boolean getSelectFemale();", "boolean hasSelectFemale();", "public boolean isFemale();", "boolean couldBeFemale();", "boolean getSelectMale();", "boolean hasSelectMale();", "public void setGender (boolean g) {\n gender = g;\n }", "public void setFemale(int value) {\n this.female = va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate Linewidth, RMS edge roughness, and PkPk edge roughness
public void analyzeData(){ linewidth = rt.getValue("Mean", 1) - rt.getValue("Mean", 0); RMS_edge_roughness = Math.sqrt((Math.pow(rt.getValue("StdDev", 1), 2) + Math.pow(rt.getValue("StdDev", 0), 2))/2); // this is the correct form if(rt.getValue("Max",1) - rt.getValue("Min", 1) > rt.getValue("Max", 0) - rt.getVa...
[ "double getEdgeLength();", "int getEdgeLength();", "public int getPitStrokeThickness() {\n return 8;\n }", "double getEdgeWeight();", "public float getUnit_line_thickness() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 2456);\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets neighbors ordered by code.
public Neighbors getNeighborsOrderedByCode() { return (Neighbors) orderByCode(); }
[ "public java.util.List<Integer> getNeighbors(int index);", "@Override\n\tpublic List<Cell> getOrderedNeighbors(Cell cell) {\n\t\tList<Cell> neighbors = new ArrayList<Cell>();\n\t\tint northwest, north, northeast, east, southeast, south, southwest, west;\n\t\t\n\t\tnorthwest = getNorthWestCell(cell);\n\t\tnorth = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change the view mode.
public void setMode(WhichVariables mode) { if (!mode.equals(m_mode)) { m_mode = mode; m_viewer.refresh(); } }
[ "public void setViewMode(java.lang.String viewMode) {\n this.viewMode = viewMode;\n }", "public void changeMode(int mode);", "public void setMode(int mode);", "ViewMode getViewMode();", "public void setViewMode(int mode) {\r\n\t\t// you should do something with the new viewmode here\r\n\t\t_view_m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Counts jobs that have the specified status.
long countJobsWithStatus(JobStatus status);
[ "long countJobs(Status status) throws ServiceRegistryException;", "public int countByStatus(int status);", "public static int countByJobStatus(int jobStatus) {\n\t\treturn getPersistence().countByJobStatus(jobStatus);\n\t}", "@Override\n\tpublic int countByStatus(int status) {\n\t\tFinderPath finderPath = _fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses and shows the content of one sheet using the specified styles and sharedstrings tables.
public List<Map<String, String>> processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException { InputSource sheetSource = new InputSource(sheetInputStream); SAXParserFactory saxFactory = SAXParserFa...
[ "public StyledString parseStringForStyles(String text, int defaultStyle){\r\n\t\tint startPos = -1;\r\n\t\tint endPos = 0;\r\n\t\t\r\n\t\tStyledString output = new StyledString();\r\n\t\t// Setup the strings to color here.\r\n\t\tString styStrings[] = {\"http://\", \"beshare:\", \"audio://\", \r\n\t\t\t\t\t\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find time space detail from timestart and time end
public List<Integer> timeSpaceDeatail(String timeStart, String timeEnd, int countLocation) { List<Integer> timeSpaceDetail = new ArrayList<Integer>(); int timeS = convertTime(timeStart); int timeE = convertTime(timeEnd); int timeES = timeE - timeS; int timeSpace = timeES / countLocation; for (int i = 0; ...
[ "private String calculateTimeInterval(long startTime, long endTime){\n\t\tTimeSpanItem ti = TimeSpanItem.creatTimeItem(startTime, endTime);\n\t\tint intervalHour=ti.getHour();\n\t\tint intervalMin=ti.getMinute();\n\t\tString hourString=\"\";\n\t\tif(intervalHour>=1){\n\t\t\tif(intervalHour==1){\n\t\t\t\thourString=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a feature value from SparseVector
public double getFeature(String symbol) { int key = dict.getAlphabetAt(dictId).getIndex(symbol); return sparseVector.findValue(key); }
[ "public double getFeature(int index) {\n\t\treturn denseVector.getValue(index);\n\t}", "public SeqFeatureI getFeatureAt (int i);", "FeatureValue getValue();", "public void getFeature(String symbol) {\n\t\tint key = dict.getAlphabetAt(dictId).getIndex(symbol);\n\t\tsparseVector.findValue(key);\n\t}", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define el valor de la propiedad severalLocations.
public void setSeveralLocations(boolean value) { this.severalLocations = value; }
[ "public void setLocations(entity.GL7Location[] value);", "public boolean isSeveralLocations() {\r\n return severalLocations;\r\n }", "public abstract void setLocations(java.util.Set locations);", "public void addAllLocations(List<Location> locations) {\n this.locations = locations;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Obtains a road based on direction.
public Road getRoad(Direction dir) { Road[] roads = new Road[] {roadNS, roadSN, roadEW, roadWE}; for (Road r : roads) { if (r.getDirection() == dir) { return r; } } throw new NoSuchElementException(); }
[ "public RoadInterface getConnectedRoad (Direction dir) {\n if (dirOne == dir) {\n return (interOne);\n } else if (dirTwo == dir) {\n return (interTwo);\n } else {\n return (null);\n }\n }", "public IRoad getRoad(EdgeLocation edge);", "org.landxml.schema.landXML11.RoadwayDocument.Road...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The getIndirectEdges returns a list of integers representing the possible target program locations for a given callsite. This is auxilliary information that is supplied at the command line which is used for a variety of analysis questions.
public List getIndirectEdges(int callsite) { return (List)indirectEdges.get(new Integer(callsite)); }
[ "public void addIndirectEdge(int callsite, int target) {\n Integer c = new Integer(callsite);\n Integer t = new Integer(target);\n\n List l = (List)indirectEdges.get(c);\n\n if (l == null) {\n l = new LinkedList();\n l.add(t);\n indirectEdges.put(c, l);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate if no exception occurs on confirmation SP
private void validateConfirmationSp() { try { List<ConfirmedOrderModel> list = confirmedOrdersSp.execute(); logger.info(list.size()); assertTrue("validateConfirmationSp List must not be null.", list != null); } catch (DataAccessException e) { assertTrue("validateConfirmationSp Error : " + e.getMess...
[ "boolean isConfirmationRequired();", "private void validateCancelledSp()\n\t{\n\t\ttry\n\t\t{\n\t\t\tList<CancelledOrderModel> list = cancelledOrdersSp.execute();\n\t\t\tlogger.info(list.size());\n\t\t\tassertTrue(\"validateCancelledSp List must not be null.\", list != null);\n\t\t} catch (DataAccessException e)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Class Type Scope'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseClassTypeScope(ClassTypeScope object) { return null; }
[ "public T caseTypeScope(TypeScope object)\n {\n return null;\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/include/clang/Sema/Scope.h\", line = 326,\n FQN=\"clang::Scope::isClassScope\", NM=\"_ZNK5clang5Scope12isClassScopeEv\",\n cmd=\"jclank.sh -java-options=$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TextareaProperties: commonProperties=CommonProperties ("text=" text=STRING)? ("editable=" editable=BOOLEAN)?;
public TextareaPropertiesElements getTextareaPropertiesAccess() { return pTextareaProperties; }
[ "com.sagas.meta.model.MetaTextAreaFieldOrBuilder getTextAreaFieldOrBuilder();", "com.sagas.meta.model.MetaTextAreaField getTextAreaField();", "public abstract NSText setUpFieldEditorAttributes(NSText textObj);", "protected void addTextareaOptionalPropertyPropertyDescriptor(Object object) {\n\t\titemPropertyDe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
At first glance this code looks wrong. A composing transition applies transition2 over transition1's outputs, not the original options. We don't have to worry about that here because the reason we pass the options is so Starlark transitions can map individual flags like "//command_line_option:copts" to the fragments th...
@Override public void addRequiredFragments( RequiredConfigFragmentsProvider.Builder requiredFragments, BuildOptionDetails optionDetails) { transition1.addRequiredFragments(requiredFragments, optionDetails); transition2.addRequiredFragments(requiredFragments, optionDetails); }
[ "private static BuildOptions applyTransition(\n BuildOptions buildOptionsToTransition,\n Map<String, Object> newValues,\n Map<String, OptionInfo> optionInfoMap,\n StarlarkDefinedConfigTransition starlarkTransition)\n throws EvalException {\n BuildOptions buildOptions = buildOptionsToTran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to convert a cursor row location to a Journey object
private Journey cursorToJourney(Cursor cursor) { /* index is as follows: 0: id, 1: carID, 2: useType, 3: startTime 4: stopTime, 5:startOdo, 6: stopOdo, 7: fuelAvgEco, 8: fuelTotalUsed 9: totalDistance, 10: averageSpeed */ Journey journey = new Journey(cursor.getLong(0), cursor.getLong(1),...
[ "public Journey createJourney(Journey journey) {\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(JourneySQLHelper.COLUMN_CAR_ID, journey.getCarID());\n\t\tvalues.put(JourneySQLHelper.COLUMN_USE_TYPE, journey.getUseType().toString());\n\t\tvalues.put(JourneySQLHelper.COLUMN_START_TIME, journey.getSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the 'var212' field has been set.
public boolean hasVar212() { return fieldSetFlags()[213]; }
[ "public boolean hasVar211() {\n return fieldSetFlags()[212];\n }", "public boolean hasVar112() {\n return fieldSetFlags()[113];\n }", "public boolean hasVar213() {\n return fieldSetFlags()[214];\n }", "public boolean hasVar12() {\n return fieldSetFlags()[13];\n }", "public bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rename every new record file, named lastRecord+number to "recordId/recordElementid_SegmentPosition"
private void renameLastRecord(int recordId, int elementRecordId, int segmentCount) { Log.v(App.getTag(), "Segments to Process " + segmentCount); SupportMethods.createFolderinAppFolder(String.valueOf(recordId)); for (int i = 1; i < segmentCount; i++) { File file = new File(appFolder +...
[ "private String getNewName(String filename, Path directoryPath) {\n if (Files.exists(directoryPath.resolve(filename))){\n Matcher m = PATTERN.matcher(filename);\n if (m.matches()){\n String prefix = m.group(1);\n String number = m.group(2);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the room availability view
public void updateAvailability(String type) { String title = ""; if (startDate != null & endDate != null) { title = "Available Rooms " + formatDate(startDate) + " - " + formatDate(endDate); } availabilityDisplay.setText(guestModel.getRooms(type)); availabilityLabel.setText(title); add(availabilityLabel...
[ "public void setRoomAvailability(boolean roomAvailability ){\n\tthis.roomAvailability = roomAvailability;\n}", "public void availRooms() {\n boolean valid = validTimes(false);\n if (valid) {\n // Get selected times\n ArrayList<GregorianCalendar> cals = gCalsFromCurrTimes();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POST /orderpairfees : Create a new orderPairFee.
@PostMapping("/order-pair-fees") @Timed public ResponseEntity<OrderPairFeeDTO> createOrderPairFee(@RequestBody OrderPairFeeDTO orderPairFeeDTO) throws URISyntaxException { log.debug("REST request to save OrderPairFee : {}", orderPairFeeDTO); if (orderPairFeeDTO.getId() != null) { thr...
[ "@GetMapping(\"/order-pair-fees/{id}\")\n @Timed\n public ResponseEntity<OrderPairFeeDTO> getOrderPairFee(@PathVariable Long id) {\n log.debug(\"REST request to get OrderPairFee : {}\", id);\n OrderPairFeeDTO orderPairFeeDTO = orderPairFeeService.findOne(id);\n return new ResponseEntity<>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ getNextAvailableStates return all the people that are able to move which means that the torch location is the same location as them example: If the torch location is on the left side, whoever is on the left side is available to move. return: newStates The list of all the next available states.
public LinkedList<State> getNextAvailableStates() { LinkedList<Integer> currentSide = new LinkedList<>(); LinkedList<Integer> otherSide = new LinkedList<>(); LinkedList<State> newStates = new LinkedList<>(); if(isLeft) { if(leftSide != null) currentSide = new LinkedList<>(lef...
[ "public HashSet<LocalState> getNextStates() {\r\n\t\tHashSet<LocalState> nextStates = new HashSet<LocalState>();\r\n\t\tfor (LocalTransition tr : outgoingTransitions) {\r\n\t\t\tnextStates.add(tr.getDest());\r\n\t\t}\r\n\t\treturn nextStates;\r\n\t}", "@Test\r\n\tpublic void shouldReturnAllThePossibleMovesOfState...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleDivisionStatement" $ANTLR start "entryRulePowerStatement" InternalArithmetic.g:228:1: entryRulePowerStatement : rulePowerStatement EOF ;
public final void entryRulePowerStatement() throws RecognitionException { try { // InternalArithmetic.g:229:1: ( rulePowerStatement EOF ) // InternalArithmetic.g:230:1: rulePowerStatement EOF { before(grammarAccess.getPowerStatementRule()); pushFollo...
[ "public final EObject entryRulePower() throws RecognitionException {\n EObject current = null;\n\n EObject iv_rulePower = null;\n\n\n try {\n // InternalAnn.g:1656:46: (iv_rulePower= rulePower EOF )\n // InternalAnn.g:1657:2: iv_rulePower= rulePower EOF\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds component to sidebar, used for tools and so forth.
protected final void addToSidebar(JComponent component) { component.setMaximumSize(new Dimension((int) component.getMaximumSize().getWidth(), (int) component .getPreferredSize().getHeight())); component.setAlignmentX(Component.RIGHT_ALIGNMENT); component.setBackground(Color.WHITE); this.sidebar.add(compone...
[ "private void createSidebar() {\r\n JPanel sidebarArea = new JPanel();\r\n sidebarArea.setLayout(new GridLayout(0,1));\r\n\r\n JButton saveButton = new JButton(saveString);\r\n saveButton.setActionCommand(saveString);\r\n saveButton.addActionListener(new SaveListener());\r\n\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the appropriate doctor.
Doctor getDoctor();
[ "public Doctor getDoctor() {\r\n\t\treturn doctor;\r\n\t}", "@GET(DOCTOR_PATH)\n\tDoctor getCurrentDoctor();", "private Doctor getDoctor(String doctorName)\n {\n for(Doctor doctor:humanPlayer.getDoctors())\n {\n if(doctor.getName().equals(doctorName) && !doctor.isOccupied())\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
La funzione che permette di generare il checksum sui byte dell'array passato come parametro
public byte CreateCheckSum(byte[] bytes) { byte sum = 0; for (byte b : bytes) { sum ^= b; } return sum; }
[ "public \n CheckSum\n (\n byte[] bytes\n ) \n {\n initBytes(bytes); \n }", "java.lang.String getChecksum();", "String getChecksum();", "private static byte checksum(byte[] toChecksum)\n\t{\n\t\tbyte result = 0;\n\t\t\n\t\tfor(byte b : toChecksum)\n\t\t{\n\t\t\tresult -= b;\n\t\t}\n\t\t\n\t\treturn r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the access key for the add button
public void setAddButtonAccessKey(String key) { _addButton.setAccessKey(key); }
[ "public void setSaveButtonAccessKey(String key) {\r\n\t\t_saveButton.setAccessKey(key);\r\n\t}", "public void addCredential(){\r\n addCredBtn.click();\r\n }", "final public void setAccessKey(char accessKey)\n {\n setProperty(ACCESS_KEY_KEY, Character.valueOf(accessKey));\n }", "public void setD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method initializes jPanelInputs
private JPanel getJPanelInputs() { if (jPanelInputs == null) { GridLayout gridLayout1 = new GridLayout(); gridLayout1.setRows(12); gridLayout1.setHgap(6); gridLayout1.setVgap(5); gridLayout1.setColumns(1); jPanelInputs = new JPanel(); jPanelInputs.setLayout(gridLayout1); jPanelInputs....
[ "public InputPanel() {\n initComponents();\n }", "private void initializePanel() \n\t{\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBorder( new EmptyBorder(5, 5, 5, 5) );\n\t\tsetContentPane(contentPane);\n\t\tcontentPane.setLayout(null);\n\t\t\n\t\tinitializeTextFields(contentPane);\n\t\tcreate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inner Method to set the default parsing rules
private void addAllRules() { parseRules.add(new DateRule()); // 1st rule ParseRule numberRule = new NumbersRules(); parseRules.add(numberRule); // 2nd rule parseRules.add(new BetweenRule(numberRule)); // 3rd rule wordPhraseEntitiesRule = new WordPhraseEntitiesRule(numberRule)...
[ "public void setParseRules(ArrayList<ParseRule> parseRules)\n {\n if(parseRules == null) return;\n this.parseRules = parseRules;\n }", "void initBeforeParsing() {\r\n }", "@Override\n void setParser(Parser parser) {\n super.setParser(parser);\n MethodCallStrategy.instance...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
associate a sequence ID with a marker if the sequence is not associated with a problem clone. Problem Clone lookup only applies to therefore only contains genbank sequences, for simplicity we apply all seqids to this lookup. RefSeqs will not be found.
private void makeSeqAssociationToMarker(Integer logicalDBKey, String seqID, Integer markerKey) throws MGIException { if ( ! this.problemClones.lookup(seqID)) { AccessionLib.createMarkerAssociation( logicalDBKey, seqID, markerKey, new Integer(Constants.EGLOAD_R...
[ "public gov.nih.nlm.ncbi.www.PDBSeqIdDocument.PDBSeqId addNewPDBSeqId()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.PDBSeqIdDocument.PDBSeqId target = null;\r\n target = (gov...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets (as xml) the "serviceID" element
public void xsetServiceID(org.apache.xmlbeans.XmlString serviceID) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.XmlString target = null; target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SERVICEID$6, 0); if (ta...
[ "void xsetServiceId(com.microsoft.schemas._2003._10.serialization.Guid serviceId);", "public void setServiceID(java.lang.String serviceID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apach...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get list of consumers
public LinkedList getConsumers() { return consumer; }
[ "public List<IConsumer> getConsumers() {\n return pipe.getConsumers();\n }", "public static ArrayList<Consumer> getConsumers() { return new ArrayList(consumerList.values()); }", "Collection<? extends Consumer> getConsumers() throws RegistrationException;", "public List<InputConsumer> getConsumers() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
At this point, the file is in outputFile/partr0000. We move it out of that dir and into it's own wellnamed file. This will not work if the last step was a merge (assuming saveAsNewAPIHadoopFile doesn't cause the last step to be a reduce).
private static void RenameHadoopSingleShard(String outputFile) throws IOException { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); String ouputParentDir = outputFile.substring(0, outputFile.lastIndexOf("/") + 1); // First, check for the _SUCCESS file. ...
[ "private void newOutputFile() throws FileNotFoundException {\n if (filePart != null) {\n filePart.flush();\n filePart.close();\n }\n String newFilePartName = filePath + \"_\" + chunks.size();\n File newFilePart = new File(newFilePartName);\n //Make a temporal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds reviews for playlists
Page<ReviewsEntity> findByPlaylist(PlaylistEntity playlist, Pageable pageable);
[ "List<Review> getAllReviews();", "private void getReviews() {\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(getString(R.string.base_url))\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n\n //this call creates the retrofit ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is used to validate the status code of workFlowTaskStatusCode
public void verifyWorkFlowTaskStatusCode(int statusCode) { verificationHelperClass.verifyStatusCode(response, statusCode); log.info("WorkFlowTask StatusCode is " + statusCode + " and its Pass"); }
[ "public void validateTaskStatus(String strTaskStatus){\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"TasksTab\"), \"TasksTab\");\n\t\tif(libManhattanCommonFunctions.verifyElementPresent(\"//sp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the number of points located on a given edge indexed by 'a'
public int getNumPoints(int a) { int[] C = this.toNumber(curvw1+curvw2); int L=this.getSurfaceLength(); M1 =new int[L]; //counts how many of each pair there are for( int i = 0; i<L;i++) { for (int j = 0;j<curvw1.length()+curvw2.length();j++) { if ( C[j] == i) { M1[i]++; } } ...
[ "public int getnumConnected(Vec a) {\n\t\tint count = 0;\n\t\tif (springs != null) {\n\t\t\tfor (VSpring s : springs) {\n\t\t\t\tif ((s.a == a) || (s.b == a)) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int getNextEdgeCount();", "protected abstract int getNumEdges();", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use ExchangeRecord.newBuilder() to construct.
private ExchangeRecord(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); }
[ "private ExchangeRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Record(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public MessageRecord() {\n super(Message.MESSAGE);\n }", "private PassageRec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the sync rid in valid time stamp failure test.
@Test public void getSyncRidInValidTimeStampFailureTest() { InvalidIDException exp = new InvalidIDException(RidExceptionProperty.INVALID_RID_TIMESTAMP.getErrorCode(), RidExceptionProperty.INVALID_RID_TIMESTAMP.getErrorMessage()); Mockito.when(ridValidator.validateId("12345678901234567890123456799")).thenThrow(exp)...
[ "@Test\n\tpublic void getSyncPridInValidTimeStampFailureTest() {\n\t\tInvalidIDException exp = new InvalidIDException(RidExceptionProperty.INVALID_RID_TIMESTAMP.getErrorCode(), RidExceptionProperty.INVALID_RID_TIMESTAMP.getErrorMessage());\n\t\tMockito.when(ridValidator.validateId(\"12345678901234567890123456799\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. insert runtime service info into db. 2. set db's auto column id to registry.
public void insert(int serverId, List<ServiceInfo> serviceList, ServiceRuntimeRegistry runtimeRegistry) throws Exception { conn = pool.getConnection(); logger.debug("Query : " + INSERT_SERVICE_SQL); PreparedStatement pstmt = conn.prepareStat...
[ "abstract protected void setupRdbmsOperations();", "private void initializeIdGen() {\n try {\n InitialContext context = new InitialContext();\n Object o = context.lookup(\"idgenerator/IdGenEJB\");\n IdGenHome idGenHome = (IdGenHome) PortableRemoteObject.narrow(o, IdGenHome....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true when the player is within 0.25 pixels of the given coordinates
public boolean atPosition(float x, float y) { return (Math.abs(y-this.y) <= 0.25 || Math.abs(x-this.x) <= 0.25); }
[ "private boolean checkMouseInsidePlayer(Point2D.Float mouse, GameEntity e) {\n PositionComponent pos = pm.get(e);\n return Math.abs(pos.x + pos.originX - mouse.x) <= 5 && Math.abs(pos.y + pos.originY - mouse.y) <= 5;\n }", "protected boolean inPlayArea() {\n\t\treturn 55.942617 < this.latitude &&...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Data constructor: it generates a random Data object consisting of n bytes, and with probability p in [0,1] to have bits equal to 1
public Data(int n,double p) { try { if (n <= 0) throw new Exception("Specified size for random Data object is zero or even negative"); if (p < 0.0 || p > 1.0) throw new Exception("Specified probability of 1 bits in random Data object should be contained in [0,1]"); Random r = ...
[ "public Data(int n, double p) {\n try {\n if (n <= 0) throw new Exception(\"Specified size for random Data object is zero or even negative\");\n if (p < 0.0 || p > 1.0)\n throw new Exception(\"Specified probability of 1 bits in random Data object should be contained in [0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a new bottom sheet.
void showSheet();
[ "private void createBottomSheet() {\n new BottomSheet.Builder(this, R.style.BottomSheet_Dialog)\n .sheet(R.menu.journey_route_bottom_sheet_menu)\n .listener(new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column lt_google_adwords_report_ad.creative_tracking_url_template
public void setCreativeTrackingUrlTemplate(String creativeTrackingUrlTemplate) { this.creativeTrackingUrlTemplate = creativeTrackingUrlTemplate; }
[ "public String getCreativeTrackingUrlTemplate() {\r\n return creativeTrackingUrlTemplate;\r\n }", "public void setTrackingUrlTemplate(String trackingUrlTemplate) {\r\n this.trackingUrlTemplate = trackingUrlTemplate;\r\n }", "public void setTrackingUrlTemplate(java.lang.String trackingUrlTemp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search source roots under which given file resides and return true if it's a test source folder.
protected static boolean isInTestSource(final @NotNull JpsModule module, final @NotNull File file) { final JpsModuleSourceRoot sourceRoot = JpsModelUtil.findSourceRootForFile(module, file); return sourceRoot != null && sourceRoot.getRootType().equals(JavaSourc...
[ "public static boolean isSourceFolder( final IFolder folder ) {\n IProject project = folder.getProject();\n /*IHaskellProject hsProject = HaskellProjectManager.get( project );\n IPath folderPath = folder.getProjectRelativePath();\n return hsProject.getSourcePaths().contains( folderPath );\n */\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ If UPDATE_SKIP_NULL_ATTRIBUTES or APPEND_SET is configured, we don't delete null value attributes.
@Override protected void onNullNonKeyAttribute(String attributeName) { if (getLocalSaveBehavior() == DynamoDBMapperConfig.SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES || getLocalSaveBehavior() == DynamoDBMapperConfig.SaveBehavior.APPEND_SET) { ...
[ "@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }", "public abstract boolean keepOldAttributes();", "@Override\n public vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Implementations of this interface provide a strategy for compressing and uncompressing data.
public interface CompressionStrategy { /** * The type of compression performed. */ String getType(); /** * Uncompresses the data. The array received should not be modified, but it * may be returned unchanged. * * @param data compressed data. * @return uncompressed data....
[ "public interface DataCompressor {\n\n /**\n * This method does the compression of String data using GZIP\n *\n * @param toBeCompressedData - data to be compressed\n * @return - compressed byte[] for the given String data\n */\n public byte[] compressString(String toBeCompressedData);\n\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleSetpoint" $ANTLR start "entryRuleColorpicker" InternalSitemap.g:5716:1: entryRuleColorpicker returns [EObject current=null] : iv_ruleColorpicker= ruleColorpicker EOF ;
public final EObject entryRuleColorpicker() throws RecognitionException { EObject current = null; EObject iv_ruleColorpicker = null; try { // InternalSitemap.g:5716:52: (iv_ruleColorpicker= ruleColorpicker EOF ) // InternalSitemap.g:5717:2: iv_ruleColorpicker= ruleColo...
[ "public final EObject entryRuleColor() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject iv_ruleColor = null;\r\n\r\n\r\n try {\r\n // InternalCk2Gfx.g:134:46: (iv_ruleColor= ruleColor EOF )\r\n // InternalCk2Gfx.g:135:2: iv_ruleColor= ruleColor EOF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a MlibMinFilterOpImage given an image source, an optional BorderExtender, a maskType and maskSize. The image dimensions are derived the source image. The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
public MlibMinFilterOpImage(RenderedImage source, BorderExtender extender, Map config, ImageLayout layout, MinFilterShape maskType, int maskSize)...
[ "@Nullable\n @Generated\n @CFunction\n public static native CGImageRef CGImageCreateWithMask(@Nullable CGImageRef image, @Nullable CGImageRef mask);", "public BandMergeOpImage(List sources, Map config, Range[] noData, ROI roi,\n double destinationNoData, boolean setAlpha, ImageLayout layout) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sum the element of the list
protected int sumList(ArrayList<Integer> list){ int result =0; for(int i: list){ result = result + i; } return result; }
[ "public int sumListeForEach(ArrayList<Integer> list) {\r\n int resultat = 0;\r\n for (int tal : list) {\r\n resultat = resultat + tal;\r\n }\r\n return resultat;\r\n }", "public long sum() {\n\t\tlong result = 0;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult += t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Conditional update Validates if an 'IfMatch' header comes in the request, then it's value must match the value of the eTag of the resource we want to update. This will assure we are not working with stale data. Example Request: PUT /v1/todo HTTP/1.1 IfMatch: "81422713435543276343221"
private ResponseBuilder validateConditionalUpdate(Todo item, Request request) { //get the ETag of the resource we want to update. EntityTag updateETag = new EntityTag(Integer.toString(item.hashCode())); try { //verify if request contains an If-Match header with with an eTa...
[ "interface WithIfMatch {\n /**\n * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the\n * header response of the GET request or it should be * for unconditional update..\n *\n * @param ifMatch ETag of the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ask user whether the dicom receiver should be enabled on startup.
private void queryForDicomAutostart() { final String message = "Would you like to have the DICOM receiver begin when MIPAV starts?"; dialog = new JDialog(); dialog.setLayout(new BorderLayout()); dialog.setTitle("Auto-start option"); final JPanel message...
[ "@Override\r\n\tprotected void onStart() {\r\n\t\tsuper.onStart();\r\n\t\t\r\n\t\tif (dontAsk==0 && !getIMEStatus()) {\r\n\t\t\tdontAsk=1;\r\n\t\t\tshowDialog(D_ENABLE);\r\n\t\t} else if (dontAsk==1 && getIMEStatus()) {\r\n\t\t\tdontAsk=2;\r\n\t\t\tshowDialog(D_PICKER);\r\n\t\t}\r\n\t}", "void checkBluetooth() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines whether the user may be deleted. A user may be deleted if they are not associated with any events and their status is inactive.
public boolean isOkToDelete() { // TODO - implement User.isOkToDelete throw new UnsupportedOperationException(); }
[ "@Override\n\tprotected boolean isDeleteAllowed(CollectableGenericObjectWithDependants clct) {\n\t\tfinal boolean result;\n\n\t\tif(isHistoricalView()) {\n\t\t\tLOG.debug(\"isDeleteAllowed: historical view\");\n\t\t\tresult = false;\n\t\t}\n\t\telse if(!MetaDataClientProvider.getInstance().getEntity(getEntityName()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides the interface for calling the backpropagation Mfunction where the first input, an instance of List, receives the output of the Mfunction and the second input, also an instance of List, provides the input to the Mfunction.
public void backpropagation(List lhs, List rhs) throws MWException { fMCR.invoke(lhs, rhs, sBackpropagationSignature); }
[ "private List<Matrix> feedForward ( Matrix inputs )\n\t{\n\t\tMatrix current = inputs;\n\t\tList<Matrix> outputs = new ArrayList<Matrix>();\n\t\toutputs.add(inputs);\n\t\tfor ( int layer = 0; layer < numberOfNodes.length - 1; layer++ )\n\t\t{\n\t\t\tcurrent = weights.get( layer ).matrixMultiplication( current );\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mail header name for flagging a message as not spam. If set, this takes precedence over zimbraSpamHeader.
@ZAttr(id=1257) public String getSpamWhitelistHeader() { return getAttr(Provisioning.A_zimbraSpamWhitelistHeader, null); }
[ "@ZAttr(id=210)\n public String getSpamHeader() {\n return getAttr(Provisioning.A_zimbraSpamHeader, \"X-Spam-Flag\");\n }", "@ZAttr(id=465)\n public String getSpamReportSenderHeader() {\n return getAttr(Provisioning.A_zimbraSpamReportSenderHeader, \"X-Zimbra-Spam-Report-Sender\");\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn the task objects into JSON and save to file
public void writeToFile(Map<Integer, Task> tasks) { JSONObject jsonObj = new JSONObject(); JSONArray jsonArray = new JSONArray(); for (Task task : tasks.values()) { JSONObject taskObj = new JSONObject(); String desc = task.getDescription(); taskObj.put("desc", desc); String startDateTime = task.getSt...
[ "public void exportSchedule() {\r\n // Get valid file name from user\r\n String fileName = getFileName();\r\n\r\n try {\r\n // Open file\r\n FileWriter fileWriter = new FileWriter(fileName);\r\n\r\n JSONArray jsonArray = new JSONArray();\r\n\r\n // It...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }