query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Returns the result of interpreting the object as an instance of 'Role Type'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseRoleType(RoleType object) { return null; }
[ "RoleType getRoleType();", "public String getRoleType() {\n return roleType;\n }", "public T caseRole(Role object) {\n\t\treturn null;\n\t}", "public String getRoletype() {\n return roletype;\n }", "public Byte getRoleType() {\n return roleType;\n }", "RoleType getRoleTypeRef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__VarDefinition__Group__1" $ANTLR start "rule__VarDefinition__Group__1__Impl" InternalDsl.g:21209:1: rule__VarDefinition__Group__1__Impl : ( ( rule__VarDefinition__NameAssignment_1 ) ) ;
public final void rule__VarDefinition__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDsl.g:21213:1: ( ( ( rule__VarDefinition__NameAssignment_1 ) ) ) // InternalDsl.g:21214:1: ( ( rule__VarDefinition__NameAssignment_...
[ "public final void rule__VarDefinition__Group_2__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDsl.g:21347:1: ( ( ( rule__VarDefinition__NameAssignment_2_1 ) ) )\n // InternalDsl.g:21348:1: ( ( rule__VarDefinitio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a launcher URL by the given object name to the persistence.
private void addFreeLauncher(String deploymentName) { persistence.addFreeLauncher(getLauncherUrlFromObjectName(deploymentName)); }
[ "private String getLauncherUrlFromObjectName(String objectName) {\n if (objectName != null) {\n return objectName.replace(Constants.BPG_APP_TYPE_LAUNCHER, Constants.LAUNCHER_URL_PREFIX) +\n \".\" +\n rootDomainName;\n }\n\n throw new IllegalArgum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns array of buttons is button corresponds to is floor.
Button[] getFloorButtons();
[ "List<ButtonSliderType> getBtnSwitches();", "public List<TestBenchElement> getButtons() {\n return $(\"vaadin-menu-bar-button\").all().stream().filter(\n element -> !isOverflowButton(element) && isVisible(element))\n .collect(Collectors.toList());\n }", "public int[] getP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write data to reserved address
void writeToReservedAddress(DRAMAddress address, DRAMData data);
[ "public static void WRMEMZ(int addr, int data) {\n cpu_writemem21((h6280.u8_mmr[1] << 13) | ((addr) & 0x1fff), data & 0xFF);\n }", "protected void direct_write(int address, byte val) {\n segment_data[address] = val;\n }", "public void writeByte(int address, int data) {\n data &= 0xff;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Animates in the dropdown list
private void openDropdown() { if (dropdownLinearLayout.getVisibility() != View.VISIBLE) { ScaleAnimation anim = new ScaleAnimation(1, 1, 0, 1); anim.setDuration(getResources().getInteger(R.integer.dropdown_amination_time)); dropdownLinearLayout.startAnimation(anim); ...
[ "private void fadeSelectorWheel(long animationDuration) {\n // mInputText.setVisibility(VISIBLE);\n // mDimSelectorWheelAnimator.setDuration(animationDuration);\n // mDimSelectorWheelAnimator.start();\n }", "public void itemAnimation() {\n //add item animation from wassbeef library...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the rounded and adjusted weighting. For example a weighting of 1.3 and a multiplier of 3 results in a value of 3.9, which is rounded to 4.
public int getRoundedAdjustedWeighting(BigDecimal weightingMultiplier) { BigDecimal adjustedWeighting = getAdjustedWeighting(weightingMultiplier); BigDecimal roundedWeighting = adjustedWeighting.setScale(0, RoundingMode.HALF_UP); roundedWeighting = roundedWeighting.max(BigDecimal.ONE); return roundedWeighting.i...
[ "public double getWeighting() {\r\n return weighting;\r\n }", "public void reCalcuateWeight() {\n if (totalConnections > 0) {\n double weightRatio = (double) fixedWeight / totalWeight;\n double connectionRatio = (double) currentConnectionCount / totalConnections;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for verifying that a request is correct, by ensuring that it has all the fields indicated by the request type. The logic of this is quite ugly, but I think it does work.
private static boolean verifyRequest(JSONObject json) { var type = RequestType.fromString(json.getString(FieldNames.TYPE)); if (type != RequestType.CREATE_USER_REQUEST && type != RequestType.LOGIN_REQUEST && !hasString(FieldNames.AUTH_TOKEN, json)) { Logger.log(Logger.Level.DEBUG,"Does not h...
[ "private void validate(RequestDto request) throws Exception {\r\n\t\tString error = null;\r\n\t\t\r\n\t\tif(null == request.getRoomSize() \r\n\t\t\t\t|| request.getRoomSize().size() != 2\r\n\t\t\t\t|| null == request.getCoords()\r\n\t\t\t\t|| request.getCoords().size() != 2){\r\n\t\t\terror = \"Invalid room size an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to add patients information
public void addPatient() { System.out.println("Enter Your Details ..."); System.out.println("Enter Name: "); this.pname=scanner.nextLine(); System.out.println(); System.out.println("Enter Id: "); this.pid=scanner.nextInt(); System.out.println(); System.out.println("Enter Age: "); this.age=scanner...
[ "public void addPatient() {\n if (DoctsPatients.isEmpty()) {\n System.out.println(\"No Doctors at the moment.\");\n System.out.println(\"Can't admit a patient. Sorry.\");\n return;\n }\n Patient pat = new Patient();\n pat.getInput();\n ++totalnoofp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a BlockExpression that contains the given variables and expressions.
public static BlockExpression block(Iterable<ParameterExpression> variables, Expression[] expressions) { throw Extensions.todo(); }
[ "public static BlockExpression block(Iterable<ParameterExpression> variables, Iterable<Expression> expressions) { throw Extensions.todo(); }", "BlockExpression createBlockExpression();", "public static BlockExpression block(Expression[] expressions) { throw Extensions.todo(); }", "public static BlockExpressio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Estimate duplicate count using the end point positions.
private long countEstimateHandleDups() { final byte[] currentKey = cursorImpl.getCurrentKey(); final DatabaseEntry twoPartKey = DupKeyData.removeData(currentKey); final Cursor c1 = dup(false /*samePosition*/); try { c1.setNonCloning(true); setPrefixConstraint(c1,...
[ "private int countHandleDups() {\n final byte[] currentKey = cursorImpl.getCurrentKey();\n final DatabaseEntry twoPartKey = DupKeyData.removeData(currentKey);\n\n final Cursor c = dup(false /*samePosition*/);\n try {\n c.setNonCloning(true);\n setPrefixConstraint(c,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Operation Call Invalid Parameter'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseOperationCallInvalidParameter(OperationCallInvalidParameter object) { return null; }
[ "public T caseOperationCallInvalid(OperationCallInvalid object) {\n\t\treturn null;\n\t}", "public T caseOperationCallInvalidNumberOfParameters(OperationCallInvalidNumberOfParameters object) {\n\t\treturn null;\n\t}", "public T caseInvalidArgument(InvalidArgument object) {\n\t\treturn null;\n\t}", "public T c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the current hospital where the ambulance is assigned to.
public Hospital getCurrentHospital() { return currentHospital; }
[ "public Hospital getHospital(){\r\n\t\treturn hospital;\r\n\t}", "public Hospital getHospital() {\n return hospital;\n }", "public String getHospital() {\r\n return hospital;\r\n }", "public String getHospital() {\r\n return hospital;\r\n }", "public String getHospital() {\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the frequency of the bin with the greatest frequency
public double getMaxCount() { if (maxCountBin < 0) return 0; else return hist[maxCountBin]; // double max = 0; // for(int i=0; i<hist.length; i++) { // if (hist[i] > max) { // max = hist[i]; // } // } // return max; }
[ "BigInteger getMax_freq();", "float getMostCommonFloatFrequency();", "public int getMaxfrequency() {\n return maxfrequency;\n }", "private int getUpperFrequency(int currentFrequency) {\n\t\tint res = Integer.MAX_VALUE;\n\t\tfor(Integer possibleFrequency:possibleFrequencies){\n\t\t\tif(possibleFreque...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a HashSet containing the components that were not reachable by the Tab traversal.
protected HashSet getNotTraversable(){ tester.removeTraversedComponents(); return tester.traversableComponents; }
[ "public Set<TupleSet> getUniqueNonFreeTupleSets() {\n Set<TupleSet> nonFreeTupleSets = new HashSet<TupleSet>();\n for (TupleSet tupleSet : this.networkTupleSets) {\n if (!(tupleSet instanceof FreeTupleSet)) {\n nonFreeTupleSets.add(tupleSet);\n }\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the last offset for each partition for the given topic.
@SuppressWarnings("unchecked") public Map<Integer, Long> getEndingOffsets(String kafkaBrokers, String topic) { Map<Integer, Long> retval = new HashMap<>(); KafkaConsumer consumer = buildConsumer(kafkaBrokers); try { Map<String, List<PartitionInfo>> topics = consumer.listTopics();...
[ "public Map<TopicAndPartition, Long> getLatestOffsets() {\n\n Map<TopicAndPartition, Long> returnOffsetsMap = new HashMap<>();\n for (String topic : topicList) {\n returnOffsetsMap.putAll(getLatestOffsets(topic));\n }\n return returnOffsetsMap;\n }", "public Map<TopicAndP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
si la commande n'est ni "total", ni "quit", on informe l'utilisateur et on lui donne une aide
public void printCommand() { System.out.println("Cette commande n'est pas supportee"); System.out.println("Quitter : \"quit\", Total: \"total\" , Liste: \"list\" ou Time: \"time\""); System.out.println("--------"); }
[ "public void evoluer(Commande commandeUser);", "private void checkTotalFacturado(SuiAlcantarillado sui) {\n }", "private void totales(){\n if(!textoPeso.getText().equals(\"\")){\n total = (Integer.parseInt(textoPeso.getText()))*(vRecep.marco.vLogin.conect.pcConeC.precioLibra);\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column sys_message.SENDER_UID
public String getSenderUid() { return senderUid; }
[ "java.lang.String getSenderId();", "String getSenderId();", "public java.lang.CharSequence getSenderID() {\n return SenderID;\n }", "public String getSenderID()\n\t{\n\t\treturn senderID;\n\t}", "public java.lang.String getSenderId() {\r\n return senderId;\r\n }", "public int getSenderId() {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The keyword plan negative keyword referenced in the query. .google.ads.googleads.v1.resources.KeywordPlanNegativeKeyword keyword_plan_negative_keyword = 34;
com.google.ads.googleads.v1.resources.KeywordPlanNegativeKeyword getKeywordPlanNegativeKeyword();
[ "com.google.ads.googleads.v1.resources.KeywordPlanNegativeKeywordOrBuilder getKeywordPlanNegativeKeywordOrBuilder();", "boolean hasKeywordPlanNegativeKeyword();", "com.google.ads.googleads.v1.resources.KeywordPlanKeyword getKeywordPlanKeyword();", "com.google.ads.googleads.v1.resources.KeywordPlanKeywordOrBui...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates thread to draw graph
public void drawGraph(){ this.post(new Runnable(){ @Override public void run(){ removeAllSeries(); addSeries(xySeries); addSeries(currentPoint); //addSeries(currentPoint); } }); }
[ "public void startThread() {\n Thread runnerThread;\n\n runnerThread = new Thread(this, AddEntryGraphThread.class.getSimpleName());\n isRunning = true;\n runnerThread.start();\n }", "protected void launchThread() {\n Thread refreshThread = new Thread(new Runnable() {\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.build_event_stream.BuildMetrics.TargetMetrics target_metrics = 3;
com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildMetrics.TargetMetricsOrBuilder getTargetMetricsOrBuilder();
[ "com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildMetrics.TargetMetrics getTargetMetrics();", "com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildMetrics getBuildMetrics();", "com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildEventId.Bui...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XRelationalExpression__Group_1_1_0_0__0__Impl" $ANTLR start "rule__XRelationalExpression__Group_1_1_0_0__1" ../org.xtext.example.helloxcore.ui/srcgen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:4820:1: rule__XRelationalExpression__Group_1_1_0_0__1 : rule__XRelatio...
public final void rule__XRelationalExpression__Group_1_1_0_0__1() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:4824:1: ( rul...
[ "public final void rule__XRelationalExpression__Group_1_0_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:4...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Precondition: Term is an array that is not null Postcondition: the Array has been added to the Polynomial
private void addToPolynomial(Term[] newTerms) { //this loops through the array of terms and adds them if(newTerms != null) { for(int i = 0; i < newTerms.length; i++) { addTerm(newTerms[i]); } sort(); } }
[ "PolynomialNode addTerm(int coefficient, int power);", "private static void addTermToPolynomial(int choice)\n {\n //takes care of the adding and error handling\n addAWholePolynomial(choice);\n }", "@Override\n\tpublic Polynomial add(Polynomial q) {\n\t\tif(q == null){\n\t\t\tthrow new NullPointerExcepti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to combine each scenario from the targetScenario with each scenario from the scenariosToCombine.
public List< Scenario > combine( final List< Scenario > targetScenarios, final List< Scenario > scenariosToCombine ) { List< Scenario > combinedScenarios = new ArrayList< Scenario >(); if ( scenariosToCombine.isEmpty() ) { combinedScenarios.addAll( targetScenarios ); return combinedScenari...
[ "private void queueScenarioSuccessors(Queue<Task> taskQueue, List<Task> scenario, int id)\n\t{\n\t\tTask current = scenario.get(id);\n\t\tcurrent.getSuccessors().forEach(nextLv ->\n\t\t{\n\t\t\tTask toAdd = scenario.get(nextLv.getSuccessor().getId());\n\t\t\ttaskQueue.add(toAdd);\n\t\t});\n\t}", "@Override\n\tpub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Centers an Actor within the specified stage.
public static void centerActor(Actor actor, Stage stage) { centerActorX(actor, stage); centerActorY(actor, stage); }
[ "private void center()\r\n\t{\r\n\t\tDimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();\r\n\t\tDimension FrameSize = this.getSize();\r\n\t\tint x = (ScreenSize.width - FrameSize.width)/2;\r\n\t\tint y = (ScreenSize.height - FrameSize.height)/2;\r\n\t\tthis.setLocation(x, y);\r\n\t}", "public void...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method for property regex.
public String getRegex() { return regex; }
[ "public final String getRegex() {\n\t\treturn JsUtils.getNativePropertyString(this, \"regex\");\n\t}", "public ValueExpression getPattern() {\n\treturn this.regex;\n }", "java.lang.String getRegex();", "public java.lang.String getRegexStr() {\r\n return regexStr;\r\n }", "public void setRegex ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the designated column with a java.sql.Date value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.
public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { notOnARow(); columnIndexOutOfRange(columnIndex); _currentRow.update(columnIndex - 1, x); }
[ "public void updateDate(int columnIndex, java.sql.Date x) throws SQLException\n {\n m_rs.updateDate(columnIndex, x);\n }", "public void updateDate(String columnName, java.sql.Date x) throws SQLException\n {\n m_rs.updateDate(columnName, x);\n }", "public void updateDate(String columnName, java...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
working with json file
@Test public void readJSONFromFile() { JsonPath jsonFile = new JsonPath(new File ("C:\\Users\\cmlzd\\Desktop\\employees.json")); System.out.println(jsonFile.getString("items.email")); }
[ "protected void readJsonFile() {\n ObjectMapper mapper = new ObjectMapper();\n try {\n // JSON file to Java object\n stockData = mapper.readValue(new File(\"E:\\\\BridgeLabs Training\\\\Java\\\\OOPs Program\\\\StockAccountManagement\\\\StockData.json\"), StockMap.class );\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Options options = new Options.Builder().server("nats://172.26.34.80:4222").maxReconnect(1);
public static void main(String... args) throws Exception { Options options = new Options.Builder().server("nats://172.26.34.80:4222").maxReconnects(-1).build(); Connection nc = Nats.connect(options); Dispatcher d = nc.createDispatcher((msg) -> {}); Subscription s = d.subscribe( ...
[ "public Connection getNatsConnection() throws IOException, InterruptedException {\n String bufferSize = natsProperties.getProperty(NatsConstants.BUFFER_SIZE);\n String turnOnAdvancedStats = natsProperties.getProperty(NatsConstants.TURN_ON_ADVANCED_STATS);\n String traceConnection = natsProperti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Simplifies all possible tags in the source part of a given text unit resource.
public static void simplifyCodes (ITextUnit textUnit, boolean removeLeadingTrailingCodes) { if (textUnit == null) { LOGGER.warning("Text unit is null."); return; } if (textUnit.getTargetLocales().size() > 0) { LOGGER.warning(String.format("Text unit %s has one or more targets, " + ...
[ "private void filterTu(Element p_tu)\n {\n String srcLang = p_tu.attributeValue(Tmx.SRCLANG);\n if (srcLang == null)\n {\n srcLang = m_defaultSrcLang;\n }\n\n // can't use xpath here because xml:lang won't be matched\n List nodes = p_tu.selectNodes(\"./tuv\");...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers user with RMI server for callbacks
public void registerUser(IUserClient ucl) throws RemoteException;
[ "private void registerUserOnServer() throws IOException {\r\n\t\tdataSending.sendMessage(Server.REGISTER+\" \"+userName, Long.toString(userModel.ID));\r\n\t}", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "private void ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compute the product of this vec4 and a scalar.
public vec4 mul( double f){ return new vec4 ( this.x * f,this.y * f,this.z * f,this.w * f ); }
[ "public abstract Vector3dc mul(double scalar);", "public double scalarProduct(Vector other){\n return this.getX() * other.getX() + this.getY() * other.getY();\n }", "public double scalar_product(Vector p_other)\n {\n return p_other.scalar_product(this);\n }", "public static double scala...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The unique ID of the policy store that contains the schema.
public String getPolicyStoreId() { return this.policyStoreId; }
[ "java.lang.String getSchemaId();", "public String schemaId() {\n return this.schemaId;\n }", "String getSchemaId(String schema) {\n final String schemaId = schemaToIdCache.get(schema);\n\n if (schemaId != null) {\n // Simulate an access so that the entry does not e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse ResultSet object rs
protected abstract List<T> parseResultSet(ResultSet rs);
[ "public abstract List<T> parseResultSet(ResultSet rs) throws DaoMySqlException;", "public static void parse(ResultSet rs){\n\ttry{\n\t while ( rs.next() ) {\n\t\tint hotel_id = rs.getInt(\"hotel_id\");\n\t\tint star = rs.getInt(\"star\");\n\t\tint r1 = rs.getInt(\"one_adult\");\n\t\tint r2 = rs.getInt(\"two_a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'Named Element'.
NamedElement createNamedElement();
[ "NameElement createNameElement();", "NamedElement getBase_NamedElement();", "IFMLNamedElement createIFMLNamedElement();", "public Element(String name) {\n\t\tsetName(name);\n\t}", "public Element allocateElement(String name) {\n return factory.createElement(name);\n }", "public GNElement newElem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sns id detail get
public SnsBean getSnsDetail(String sns_id) { SnsBean sb = null; try { con = getConnection(); sql = "select * from sns where sns_id = ?"; pstmt = con.prepareStatement(sql); pstmt.setString(1, sns_id); rs = pstmt.executeQuery(); if (rs.next()) { sb = new SnsBean(); sb.setContent(rs.getString...
[ "int getSnId();", "String getStor_id();", "public int getSnId() {\n return snId_;\n }", "@JsonProperty(\"Sns\") abstract Object getSNS();", "int getSourceSnId();", "public ResearchObject getSIP(String id);", "String getSickDetail(Integer docloginid, Integer usersickid) throws Exception;", "jav...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new instance for a single resource that uses the precompiled XSLT ISO Schematron validation.
@Nonnull public static ValidationExecutorSchematron createXSLT (@Nonnull final IReadableResource aRes, @Nullable final IIterableNamespaceContext aNamespaceContext) { return createXSLT (aRes, null, aNamespaceContext); }
[ "@Nonnull\n public static ValidationExecutorSchematron createXSLT (@Nonnull final IReadableResource aRes,\n @Nullable final String sPrerequisiteXPath,\n @Nullable final IIterableNamespaceContext aNamespa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a parametrized constructor of CheckTile.
public CheckTile(GameBoard board) { this.board = board; this.boardWidth = (board.getWidth() - MARGIN) / SIDELENGTH; this.boardHeight = (board.getHeight() - MARGIN) / SIDELENGTH; }
[ "public Tile() {\r\n\t\t// default constructor\r\n\t}", "private Tile(Tile.Type t) {\n this.type = t;\n }", "public Tile(int row, int column){\n this.row = row;\n this.column = column;\n this.piece = null;\n }", "public Tile(Item item) {\n super();\n this.item = item;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates a new import requirement wizard page select document.
public ImportRequirementWizardPageSelectDocument(String pageName, PageController pageController) { super(pageName); controller = pageController; }
[ "public ImportRequirementWizardPageSelectFormat(String pageName, PageController pageController)\n {\n super(pageName);\n controller = pageController;\n }", "private void startImportWizard()\r\n {\r\n ImportFeaturesWizard wizard = new ImportFeaturesWizard(this.window.getShell());\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a single BibMitglied
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity<Optional<BibMitglied>> getSingleBibMitarbeiter (@PathVariable Long id) { return new ResponseEntity<>(bibMitgliedService.getSingleBibMitglied(id), HttpStatus.OK); }
[ "String getBibliomisc();", "public int getBibNumber() {\n return bibNumber;\n }", "public String getBibtexEntry(){\n return \"@ARTICLE { REF\" + this.getMyUniqueID() + \",\\n\" +\n \"author = \\\"\" + this.getAuthor() + \"\\\",\\n\" +\n \"title = \\\"\" + this.getT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__IfDef__Group__3" $ANTLR start "rule__IfDef__Group__3__Impl" InternalDsl.g:20345:1: rule__IfDef__Group__3__Impl : ( ( rule__IfDef__CondAssignment_3 ) ) ;
public final void rule__IfDef__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDsl.g:20349:1: ( ( ( rule__IfDef__CondAssignment_3 ) ) ) // InternalDsl.g:20350:1: ( ( rule__IfDef__CondAssignment_3 ) ) { ...
[ "public final void rule__IfDef__Group__3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDsl.g:20337:1: ( rule__IfDef__Group__3__Impl rule__IfDef__Group__4 )\n // InternalDsl.g:20338:2: rule__IfDef__Group__3__Impl rule__If...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for real run 'repair addpartitionmeta'.
@Test public void testAddPartitionMetaWithRealRun() throws IOException { // create commit instant Files.createFile(Paths.get(tablePath, ".hoodie", "100.commit")); // create partition path String partition1 = Paths.get(tablePath, HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH).toString(); St...
[ "@Test\n public void testAddPartitionMetaWithDryRun() throws IOException {\n // create commit instant\n Files.createFile(Paths.get(tablePath, \".hoodie\", \"100.commit\"));\n\n // create partition path\n String partition1 = Paths.get(tablePath, HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH).toSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if courseId passed as parameter matches the courseId of the Course it is being called on
public boolean hasCourseID(String courseID) { if (COURSE_ID.equals(courseID)) { return true; } else { return false; } }
[ "private Course verifyCourse(int courseId) throws NoSuchElementException {\n return courseRepository.findById(courseId).orElseThrow(() ->\n new NoSuchElementException(\"Course does not exist \" + courseId));\n }", "public void setCourseId(long courseId) {\n this.courseId=courseId;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The framing rectangle, relative to this view. Use to draw the rectangle. Will never be null while the preview is active.
public Rect getFramingRect() { return framingRect; }
[ "public Rect getPreviewFramingRect() {\n return previewFramingRect;\n }", "public Rect computeFramingRect() {\n\t\tPoint screenResolution = configManager.getScreenResolution();\n//\t\tLog.d(TAG, \"screenResolution: \" + screenResolution);\n\t\tif (cropRect == null) {\n\t\t\tif (camera == null) {\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The number of solutions is actually the number of dividers of (N!)^2 (We have indeed: y = N! + (N!)^2 / x' where x' = x N!, x' > 0) and we know x > N! (otherwise y < 0) A prime number that divides (N!)^2 has to divide of the factor N(N1)...2. It is then less than N We are looking for the decomposition in a product of p...
public long numberOfSolutionsMod1000007() { List<Integer> primesBelowN = generatePrimesBelowN(); List<Integer> exponentsMax = new ArrayList<Integer>(); // for each prime below N look for its exponent in the decomposition in a product of prime numbers of N! for (Integer prime : primesBelowN){ int exponentMax ...
[ "private static int countDivisorsSquared(int n){\r\n int count=1;\r\n for(int i=2,end=Library.sqrt(n);i<=end;i++){\r\n if(n%i==0){\r\n int j=0;\r\n do{\r\n n/=i;\r\n j++;\r\n }while(n%i==0);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Method for generating boat id
private int generateId(Boat boat) { int id = (int) (Math.random() * 90) + 10; for (int i = 0; i < boats.size(); i++) { if (boat.getId() == id) { id = (int) (Math.random() * 90) + 10; i = 0; } } return id; }
[ "public static String generateBiospecimenId()\n\t{\n\t\tcalendar = Calendar.getInstance();\n\t\tjava.util.Date now = calendar.getTime();\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyyMMddhhmmss\");\n\t\tbiospecimenId = simpleDateFormat.format(now);\n\t\treturn biospecimenId;\n\t}", "public v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the favorite state locally.
public void saveFavoriteState();
[ "public void saveFavorite(){\n //make sure movie is NOT already a favorite\n if(!mMovieStaff.alreadyFavorite(mMovie.getTMDBId())){\n //is a new favorite, favorite movie list status has changed\n mFavoriteChanged = true;\n\n //set movie item favorite status as true\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for Collisions with a Block
public boolean collides(Block block) { for (Block oneBlock : this.blocks) if (block.collides(oneBlock)) return true; return false; }
[ "private void CheckBlockCollision(){\n blockRowCollision(theblocks1);\n blockRowCollision(theblocks2);\n blockRowCollision(theblocks3);\n snake.updateSnakeLengthDisp();\n }", "private void collideWith(final AbstractBlock block) {\n Rectangle shape = (Rectangle) getShape();\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write reference to complex data type
void writeReference(Object obj);
[ "void serialize(@NotNull DataOutput out, @NotNull VcsRefType type) throws IOException;", "protected void writeReference(long offset, Object reference) {\n assert referenceMessageSize != 0 : \"References are not in use\";\n // Is there a way to compute the element offset once and just\n // ari...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the GLFW MouseButton ID to check for.
public static int getMouseButton(MouseButton button) { switch (button) { case LEFT: return 0; case RIGHT: return 1; case WHEEL: return 2; } return GLFW_KEY_UNKNOWN; }
[ "protected GLFWMouseButtonCallback getMouseButtonCallback()\n\t{\n\t\treturn mouseButton;\n\t}", "public static int getButton() {\n\t\treturn mouseB;\n\t}", "protected GLFWCursorPosCallback getMousePosCallback()\n\t{\n\t\treturn mousePos;\n\t}", "public double getMouseClickedX() {\n\t\treturn Lel.coreEngine.p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split a block into multiple block so that each block size is within maxBlockSize. Currently, For row data block, we split for row type dataBlock. For columnar data block, exceptions are thrown. For metadata block, split is not supported.
public static Iterator<TransferableBlock> splitBlock(TransferableBlock block, DataBlock.Type type, int maxBlockSize) { List<TransferableBlock> blockChunks = new ArrayList<>(); if (type == DataBlock.Type.ROW) { // Use estimated row size, this estimate is not accurate and is used to estimate numRowsPerChunk...
[ "public static Block[] splitBlock(Block b, int size) {\n Block nb = new Block(b.start, size);\n b = new Block(b.start + size, b.length - size);\n return new Block[]{nb, b};\n }", "public Split split(ByteBuffer b) { return split(new Data(b)); }", "@Test\n public void test...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get character corresponding to a given state
protected char getCharImpl(final int state) { switch (state) { case 0: return '0'; case 1: return '1'; case 2: return UNKNOWN_CHARACTER; default: return UNKNOWN_CHARACTER; } }
[ "protected char getCharImpl(final int state) {\n if(state<conversionTable_.length&&state>=0){\n return conversionTable_[state];\n }\n return UNKNOWN_CHARACTER;\n }", "CharacterInfo getCharacter();", "public String getState() {\n Scanner scanner = new Scanner(System.in);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the 'unionDefNull' field has been set
public boolean hasUnionDefNull() { return fieldSetFlags()[6]; }
[ "public boolean isSetUnionVal() {\n return this.unionVal != null;\n }", "public boolean isSetUnionId() {\n return this.unionId != null;\n }", "public boolean isSetUnionid() {\n return this.unionid != null;\n }", "public boolean isSetUnionId() {\n return this.unionId !=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the maximum varchar size.
void setMaxVarcharSize(int value);
[ "void setMaxCharSize(int value);", "public void setMaxLength(int maxLength){\n mMaxLengthOfString = maxLength;\n }", "@Field\n public void setMaxStringLength(int maxStringLength) {\n this.maxStringLength = maxStringLength;\n }", "int getMaxVarcharSize();", "public void setMaxLength(ja...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a new UUID
public void generateUUID() { uuid = Util.randomInt(9999, 1000, true); }
[ "private String generateUuid() {\n final UUID uuid = UUID.randomUUID();\n final String result = extractValue(uuid);\n return result;\n }", "private String generate_uuid() {\n\n int random_length = 12;\n int time_length = 4;\n\n byte[] output_byte = new byte[random_len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return itListCell.refNext != first;
@Override public boolean hasNext() { return itListCell != first; }
[ "private boolean hasNext(){\n return current !=null;\n\n }", "private boolean iterAddAfterPreviousAndNextFromSingleElementList_testHasNext() {\n\t\ttry {\n\t\t\tDoubleLinkedList<Integer> list = new DoubleLinkedList<Integer>();\n\t\t\tListIterator<Integer> iter = list.listIterator();\n\t\t\titer.add(new Integer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an IntBox from its lower left and upper right corners.
public IntBox(IntPoint p_ll, IntPoint p_ur) { ll = p_ll; ur = p_ur; }
[ "public IntBox(int p_ll_x, int p_ll_y, int p_ur_x, int p_ur_y)\n {\n ll = new IntPoint(p_ll_x, p_ll_y);\n ur = new IntPoint(p_ur_x, p_ur_y);\n }", "public static IntervalBox newInstance(Box box) {\n double[] leftBounds = new double[box.dimensions()];\n double[] rightBounds = new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__AdditionOpExp__TargetAssignment_1_2" $ANTLR start "rule__MultiOpExp__NameAssignment_1_1" InternalOCLlite.g:10629:1: rule__MultiOpExp__NameAssignment_1_1 : ( ( rule__MultiOpExp__NameAlternatives_1_1_0 ) ) ;
public final void rule__MultiOpExp__NameAssignment_1_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalOCLlite.g:10633:1: ( ( ( rule__MultiOpExp__NameAlternatives_1_1_0 ) ) ) // InternalOCLlite.g:10634:2: ( ( rule__MultiOpExp__NameAl...
[ "public final void rule__AdditionOpExp__NameAssignment_1_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalOCLlite.g:10603:1: ( ( ( rule__AdditionOpExp__NameAlternatives_1_1_0 ) ) )\n // InternalOCLlite.g:10604:2: ( ( rule...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JPanel containing the input fields for username, ip, and port. Also a list of users and the preview window for images that should be sent. Also contains buttons for choosing an image, cancelling this choice, and sending the message.
private JPanel serverPanel() { JPanel panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEADING)); panel.setPreferredSize(new Dimension(290, 720)); panel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); listUsers.setLayoutOrientation(JList.VERTICAL); listUsers.setSelectionMode(Lis...
[ "public ChatClientWindow () {\n\n int portNumber = 0;\n\n String host = (String)JOptionPane.showInputDialog(null, \"Enter the host to connect to : \", \"Welcome to HUB Chat!\", JOptionPane.QUESTION_MESSAGE, null, null, \"localhost\" );\n String port = (String)JOptionPane.showInputDialog(null, \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method which finds a developer into the database after his firstName and lastName.
Developer findByName(String firstName, String lastName) throws SQLException;
[ "Developer findByUserId(int userId) throws SQLException;", "Developer findById(int developerId) throws SQLException;", "Owner findByLastName(String lastName);", "@Override\n\tpublic Developer findDeveloperById(int developerId) {\n\t\tDeveloper developer = null;\n\t\ttry {\n\t\t\tjava.sql.Connection conn = Con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For each date, confidenceOfSummarizedHR00Val = 2 / 3 100.00 = 66.66...% which rounds to 67.0%
@Test void historicalPrecipitationDataSummarizerTestsForConfidenceOfSummarizedHR00Val() throws Exception { assertEquals(67.0, Math.ceil(main.HistoricalPrecipitationDataSummarizer.summarizeHistoricalPrecipitationData("src/example/Example Station 1.csv").get("02-26").get(5 + 6 * 0))); assertEquals(67.0, Math.ceil(ma...
[ "@Test\n\tvoid historicalPrecipitationDataSummarizerTestsForConfidenceOfSummarizedHR01val() throws Exception {\n\t\tassertEquals(67.0, Math.ceil(main.HistoricalPrecipitationDataSummarizer.summarizeHistoricalPrecipitationData(\"src/example/Example Station 1.csv\").get(\"02-26\").get(5 + 6 * 1)));\n\t\tassertEquals(6...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
w = the total weight i = item i m[i, w] = maximum value attained with weight w, the new item's weight > current weight limit m[i, w] = max(m[i1, w], m[i1, ww(i)] + v(i), if w(i) <= w
public static void main(String[] args){ w = the total weight // i = item i // m[i, w] = maximum value attained with weight <= w using items up to i // // recurrence relation: // m[0, w] = 0, if there's zero items, the sum is zero // m[i, w] = m[i-1, w], if w(i) > w, the new item's weight > current weight li...
[ "public static int knapsack(int[] v, int[] w, int W) {\n // T[i][j] stores the maximum value of knapsack having weight\n // less than equal to j with only first i items considered.\n int[][] T = new int[v.length + 1][W + 1];\n\n // do for ith item\n for (int i = 1; i <= v.length; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests whether a double nested Map will be produced correctly (generics should be preserved). Here the number of generic types on both sides (of the Key and Value side) are uneven.
@Test public void testDoubleNestedAsymmetricGenericMap() { // double nested map final NestedDoubleAssymetricMapClass dummyDouble = dummyCreator.create(NestedDoubleAssymetricMapClass.class); assertSame(HashMap.class, dummyDouble.getMapsOfCharacters().getClass()); final Entry<Map<Integer, NestedDoubleMa...
[ "@Test\n public void testDoubleNestedGenericMap() {\n // double nested map\n final NestedDoubleMapClass dummyDouble = dummyCreator.create(NestedDoubleMapClass.class);\n assertSame(HashMap.class, dummyDouble.getMapsOfNumbers().getClass());\n final Entry<Map<Integer, NestedDoubleMapClass>, Map<Double, Lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A Setter for the valueWithWhichCompare.
public void setValueWithWhichCompare(String valueWithWhichCompare) { this.valueWithWhichCompare = valueWithWhichCompare; }
[ "public void setValueToCompare(String valueToCompare) {\n this.valueToCompare = valueToCompare;\n }", "public String getValueWithWhichCompare() {\n return valueWithWhichCompare;\n }", "public void setCompare(String compare) {\r\n\t\tthis.compare = compare; // save parameter compare to this c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
READ ALL SaleInvoice By a Customer in a period
public List<SaleInvoice> getAllSaleInvoicesByCustomerAndPeriod(int customerId, Date startDate, Date endDate) { // Find customer Customer customer = customerRepository.findById(customerId).orElseThrow(NullPointerException::new); // Normalized Datetime to the beginning and very end of the date ...
[ "x0101.oecdStandardAuditFileTaxPT1.SourceDocumentsDocument.SourceDocuments.SalesInvoices getSalesInvoices();", "public List<Invoice> findByCustomerContaining(String customer);", "public List getCustInvestment(Long custId);", "public List getPreCustInvestment(Long custId);", "List<OrdersRecord> getOrdersByCu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the number of deer specified by the user to random locations on the earth.
public void setDeers() { for (int i = 1; i <= numDeers; i++) { boolean isSet = false; while(! isSet) { int randX = (int) (Math.random() * earth.length); int randY = (int) (Math.random() * earth[0].length); if(earth ...
[ "public int getLocation()\r\n\t{\r\n\t\treturn random.nextInt(100);\r\n\t}", "private void setRandLocation() {\n\t\tint x = Math.abs(rand.nextInt(450) +20);\n\t\t//add the 20 to keep it within the boundaries\n\t\tint y = Math.abs(rand.nextInt(450)+20);\n\t\t// Make random generation\n\t\tsuper.setX((float) x);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of the text analyzer service.
public TextAnalyzerServiceImpl() { super(JOB_TYPE); }
[ "public TextAnalyzer()\n {\n \n }", "public static Analyzer createSearchAnalyzer()\r\n {\r\n return new SearchAnalyzer();\r\n }", "public SELF the_analyzer_is_instantiated() {\n analyzer = builder.build();\n return self();\n }", "public NaiveTextAnalyzer() {\r\n\t\t// TODO\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if the current instance of the storage model refer to the same storage of another instance of the storage model
public boolean referToSameStorage(IAbstractStorageModel another);
[ "public abstract boolean isWithinSameStore();", "public static boolean isSameStorage(Intent intent, String sMountPoint) {\n StorageVolume storage = (StorageVolume) intent\n .getParcelableExtra(StorageVolume.EXTRA_STORAGE_VOLUME);\n boolean same = false;\n String mountPoint = nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the threshold force value used to detect is a foot is in contact with the ground.
public void setContactForceThreshold(double threshold) { opensimMocoJNI.MocoStepTimeAsymmetryGoal_setContactForceThreshold(swigCPtr, this, threshold); }
[ "public void setThreshold(double value){\n threshold = value;\n }", "public void setThreshold(float threshold){\n this.threshold = threshold;\n postInvalidate();\n }", "void setSignalDetectedThreshold(double threshold);", "public void setThresholdFlag(boolean flag) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate cell style names for given property and item using column definition.
protected String generatePropertyStyle(P property, T item) { PropertyColumn<T, P> column = getPropertyColumn(property); if (column != null && (column.getStyle() != null || column.getAlignment() != null)) { final StringBuilder sb = new StringBuilder(); if (column.getAlignment() != null) { if (ColumnAlignme...
[ "public interface CellStyleGenerator extends Serializable {\n\n /**\n * Called by Grid to generate a style name for a column.\n * \n * @param cell\n * the cell to generate a style for\n * @return the style name to add to this cell, or {@code null} to not\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Translates the given object to a type the database can process.
public static Object translate(Object ob) { if (ob == null) { return null; } else if (ob instanceof String) { return StringObject.fromString((String) ob); } else if (ob instanceof StringObject || ob instanceof BigNumber || ob instanceof Date || ob i...
[ "Object convertToType(Object ob, int sqlType) throws SQLException {\r\n // PENDING, no conversion of Java ob to SQL types done currently...\r\n return ob;\r\n }", "public T caseTyped(Typed object) {\n\t\treturn null;\n\t}", "private Object convertTypeIfNecessary(Object o) {\n\t\treturn o;\n\t}", "Objec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method calculates the needed threadpool size. If possible, always keep one processor free from threadpool allocation to ensure system responsiveness, i.e. if the number of tasks is greater than the number of available processors, all but one processor are allocated. Obvious exception is if there is only 1 processo...
private int getPoolSize() { int numberOfTasks = SpectralDescriptionType.values().length; int procs = Runtime.getRuntime().availableProcessors(); return numberOfTasks < procs ? numberOfTasks : procs > 1 ? procs - 1 : 1; }
[ "Integer getThreadPoolSize();", "public int poolSize() {\n return partitionWorkers.size();\n }", "int threadPoolQueueSize();", "public static int getOptimalExecutorServicePoolSize() {\r\n return Runtime.getRuntime().availableProcessors() * 2;\r\n }", "public static int getDefaultThreadPo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if passed QuadTree is neighboring to us
public boolean isNeighbour(QuadTree q) { boolean is_neighbour = false; double[][] our_size = this.getSize(); double[][] new_size = q.getSize(); // X is i=0, Y is i=1 for (int i = 0; i < 2; i++) { // we are smaller than q // -------------- q /...
[ "public boolean hasNeighbours() {\n\t\tif (this.eltZero != null || this.eltOne != null || this.eltTwo != null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "boolean hasLeftNeighbor();", "boolean hasIsBoundaryNodeOf();", "boolean hasRightNeighbor();", "private boolean isNeighbor(Variable variabl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper method when it's the computer's turn disables roll and hold buttons & while loop to loop over computer's turns
private void computerTurn() { final Handler handler = new Handler(); r = new Runnable() { @Override public void run() { rollButton.setEnabled(false); holdButton.setEnabled(false); doARoll(); computerTurnScore += ...
[ "@Override\n public void loop(){\n robotBase.shooterHandler(gamepad1.left_bumper || gamepad2.left_bumper, gamepad1.left_trigger > 0.2 || gamepad2.left_trigger > 0.2);\n\n //manually reloads a ball when gamepad2's right bumper is activated\n robotBase.reloadHandler(gamepad2.right_bumper);\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Doubles the current bag's size, returning the new size.
private int doubleBagSize() { modCount++; // Increase our modCount for the iterator Object[] tBag = new Object[currentCapacity * 2]; position = 0; for (int i = 0; i < aBag.length; i++) { tBag[i] = aBag[i]; position++; } aBag = tBag; return ...
[ "public void doubleSize()\r\n\t{\r\n \t\tint newSize = Stack.length * 2;\r\n\t Stack = Arrays.copyOf(Stack, newSize);\r\n\t}", "public double totalSize() {\n if (bag != null) {\n return bag.getSize();\n } else {\n return 0;\n }\n\n }", "public void sizeDecrease1(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update the index of song being played
public void updateCurrentSongIndex(int index) { this.currentSongIndex = index; }
[ "public void updateSongIndex(boolean hasStar, int index) {\n\t\t\n\t\t// iterate through the songs after the song being deleted and decrement indice\n\t\tfor (int i = index; i <= this.getCurrentList(hasStar).getHeapSize(); i++) {\n\t\t\tthis.getSong(i, hasStar).setIndex(hasStar, this.getSong(i, hasStar).getIndex(ha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the brojPoruka property.
public void setBrojPoruka(int value) { this.brojPoruka = value; }
[ "public void setPoruka(String poruka) {\r\n\t\tif (poruka == null || poruka.length() > 140) {\r\n\t\t\tthrow new RuntimeException(\"Poruka mora biti uneta i mora imati najvise 140 znakova\");\r\n\t\t}\r\n\t\tthis.poruka = poruka;\r\n\t}", "public int getBrojPoruka() {\n return brojPoruka;\n }", "publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get prices difference connected by comma
private String getPricesDeviationFormatted(List<SalesAndPriceDeviation> salesAndPricesDeviationLists){ String result = salesAndPricesDeviationLists.stream().map (e -> e.getPriceDeviatin().toString()).collect(Collectors.joining (",")); return result; }
[ "public BigDecimal getDifferencePrice();", "public int getTickDifference(Price basePrice, Price price);", "public String SplitCurrencyValueString(String str) {\n\t\t\n\t\tString temp = null;\n\t\tPattern pattern;\n\n\t\tif (str.contains(\",\") && str.contains(\".\")) {\n\t\t\tpattern = Pattern.compile(\"(\\\\d{...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the ponto marcacoes to the database. Also notifies the appropriate model listeners.
@Override public com.desafio.ponto.model.PontoMarcacoes addPontoMarcacoes( com.desafio.ponto.model.PontoMarcacoes pontoMarcacoes) { return _pontoMarcacoesLocalService.addPontoMarcacoes(pontoMarcacoes); }
[ "@Override\n\tpublic com.desafio.ponto.model.PontoMarcacoes createPontoMarcacoes(\n\t\tcom.desafio.ponto.service.persistence.PontoMarcacoesPK pontoMarcacoesPK) {\n\t\treturn _pontoMarcacoesLocalService.createPontoMarcacoes(pontoMarcacoesPK);\n\t}", "public void crearMarca(Marca marca) {\n EntityManager em ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the qualifier variable.
public PosSymbol getQualifier() { return qualifier; }
[ "public String getQualifier() {\r\n\t\treturn (getAttributeValue(QUALIFIER_NAME));\r\n\t}", "public String getValueOfQualifier (String qualifier_name)\n throws InvalidRelationException {\n final StringVector values = getValuesOfQualifier (qualifier_name);\n\n if (values == null) {\n return null;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the attribute value for the calculated attribute PersonId
public Number getPersonId() { return (Number)getAttributeInternal(PERSONID); }
[ "public Number getEmployeePersonId() {\n return (Number)getAttributeInternal(EMPLOYEEPERSONID);\n }", "io.dstore.values.IntegerValue getPersonId();", "io.dstore.values.IntegerValue getPersonCharacteristicId();", "String getIdAttribute();", "public Integer getIdPerson() {\r\n return idPerson...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the globalRailcapInitial property.
public int getGlobalRailcapInitial() { return globalRailcapInitial; }
[ "public void setGlobalRailcapInitial(int value) {\n this.globalRailcapInitial = value;\n }", "public int getGlobalAircapInitial() {\n return globalAircapInitial;\n }", "public int getGlobalRailcapCurrent() {\n return globalRailcapCurrent;\n }", "public int...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the Display Size attribute
public void setDisplaysize(String val) { _displaySize = val; }
[ "public void setDisplayWidth(int value)\n {\n this.displayWidth = value;\n }", "void setPaperSize(short size);", "public void setDisplayWidth(java.lang.Integer displayWidth) { \n this.displayWidth = displayWidth; \n }", "@Override\n public void settings() {\n size(800, 600); // sets th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the given entitiy parameters to the given request object. The request object should be a HttpPost or HttpPut object.
public void addEntityParameters(HttpEntityEnclosingRequestBase request, List<NameValuePair> parameters) { try { request.setEntity(new UrlEncodedFormEntity(parameters, getRequestEncoding())); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
[ "private void addPostParams(final Request request) {\n if (attributes != null) {\n request.addPostParam(\"Attributes\", attributes);\n }\n\n if (assignmentStatus != null) {\n request.addPostParam(\"AssignmentStatus\", assignmentStatus.toString());\n }\n\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "selected" attribute of the Equipo controller in order to display its data in its View dialog.
public void prepareIdEquipo(ActionEvent event) { Rentadevolucion selected = this.getSelected(); if (selected != null && idEquipoController.getSelected() == null) { idEquipoController.setSelected(selected.getIdEquipo()); } }
[ "@Test\n public void testSetSelected() {\n \n Cuestionario selected = null;\n CuestionarioController instance = new CuestionarioController();\n instance.setSelected(selected);\n\n \n }", "public void setSelected()\n\t{\n\t\tset(\"selected\", true);\n\t}", "public void setSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the total degrees between mStartAngle and mEndAngle, and sets mTotalCircleDegrees to this value.
protected void calculateTotalDegrees() { mTotalCircleDegrees = (360f - (mStartAngle - mEndAngle)) % 360f; // Length of the entire circle/arc if (mTotalCircleDegrees <= 0f) { mTotalCircleDegrees = 360f; } }
[ "protected void calculateTotalDegrees() {\r\n\t\tmTotalCircleDegrees = (360f - (mStartAngle - mEndAngle)) % 360f; // Length of the entire circle/arc\r\n\t\tif (mTotalCircleDegrees <= 0f) {\r\n\t\t\tmTotalCircleDegrees = 360f;\r\n\t\t}\r\n\t}", "protected void calculateProgressDegrees() {\n this.mProgre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
aces_clicked: a method called when the aces "button" is clicked
public void aces_clicked(View view){ TextView aces; FrameLayout aces_button; if(is_player_one_turn) { aces = (TextView) findViewById(R.id.player_one_aces); aces_button = (FrameLayout) findViewById(R.id.aces_button_one); aces_one_clicked = true; ...
[ "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "public void clickedOn(){\n _clicked = true;\n }", "public void actionPerformed(ActionEvent e) {\r\n\t\t\tmode = InputMode.ACCESS;\r\n\t\t\tinstr.setText(\"Click an element to access it. It will change to red.\");\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the link of the jira issue.
public String getIssueLink() { return ConfigUtils.getIssueTrackingConfig().getJiraIssueURLPrefix() + this.issue.getKey(); }
[ "public java.lang.String getIssue_url() {\n return issue_url;\n }", "String getIssueURI();", "public String getIssueId() {\r\n return issue.getId();\r\n }", "public DirectProjectMetadata getJiraURL() {\n return jiraURL;\n }", "public String getISSUE_NBR() {\r\n return IS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This Feature Scoring uses ChiSquare method to calculate scores for Features Following implementation was used as calculation template: If only one category is present, no features are selected.. or all features should be selected?
@Override public Map<String, Double> score(ICorpus corpus, Double cutOff) { // TODO Auto-generated method stub Map<String, Double> result = new HashMap<>(); Double chisquareScore, previousScore; int observationCount = corpus.getDocumentCount(); // iterate over all features in corpus for (Feature feat...
[ "@Override\n public void evaluateFeatures() {\n featureValues = new double[numFeatures];\n double[] meanFeatures = new double[numFeatures]; // the mean values of each feature\n double[][] meanFeatureClass = new double[numClass][numFeatures]; // the mean values of each feature on each class\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
float applyAsFlt(float a1,float a2) ;
default float applyAsFlt(float a1, float a2) { // return nestingApplyAsFlt(a1,a2); try { return this.applyAsFltX(a1, a2); } catch (Throwable e) { // NOSONAR throw Handling.nestCheckedAndThrow(e); } }
[ "float applyAsFltX(float a1, float a2) throws Throwable;", "static Scalar f(Scalar b0, Scalar b1) {\n Scalar f1 = b0.multiply(b0).add(b1.multiply(b1)).multiply(_1_68);\n Scalar f2 = b0.multiply(b1).multiply(_1_46);\n Scalar f3 = _1_4;\n return b0.add(b1).multiply(f1.subtract(f2).subtract(f3));\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Counts lines in file
private static int countLines(){ int lineCount = 0; try{ File file = new File(fileName); Scanner in = new Scanner(file); lineCount = 0; while(in.hasNextLine()) { in.nextLine(); lineCount++ ; ...
[ "int countLines(File inFile);", "public int getLineCount(){\n int lines = 0;\n BufferedReader reader = null;\n try{\n reader = new BufferedReader(new FileReader(\"file.txt\"));\n \n } catch(FileNotFoundException e) {\n System...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change Vehicle Modal on New Car Insurance Quote Page
public void changeVehicleModal(String fVehicleName) { if (fVehicleName.isEmpty()) { logger.info("Vehicle Name {} is taking from config. file", fVehicleName); editVehicleModal.click(); enterVehicleModal.clear(); enterVehicleModal.sendKeys(prop.getProperty("c_Change...
[ "public void clickOnAddVehicleButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary\"), SHORTWAIT);\r\n\t}", "public void addVehicleSaveButton() {\r\n\t\tsafeJavaScriptClick(addMarkerOkButton.replace(\".ant-modal-footer ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test ID: ibmnotwfP68ibm68n01.xml Test URI: notwf/P68/ibm68n01.xml Comment: Tests EntityRef with a required field missing. The Name is missing in the EntityRef in the content of the element "root". Sections: 4.1 Version:
@Test public void testibm_not_wf_P68_ibm68n01xml() throws IOException { try( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P68/ibm68n01.xml" ) ) ) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ...
[ "@Test\n public void testibm_not_wf_P68_ibm68n07xml()\n throws IOException\n {\n try( Reader reader = new FileReader( new File( testResourcesDir, \"not-wf/P68/ibm68n07.xml\" ) ) )\n {\n parser.setInput(reader);\n while (parser.nextToken() != XmlPullParser.END_DOCUMEN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a campaign banner to an activity.
public void addBanner(Activity activity, MCMCampaignDTO.CampaignType campaignType, int duration, MCMCampaignNotifiedDelegate delegate) { this.activity = activity; this.type = campaignType; setDuration(duration); this.delegate = delegate; mHandler.removeCallbacks(mRemoveC...
[ "public Boolean addActivity(String client, String cisId, AActivity activity);", "private void bannerAds() {\n Log.d(TAG, \"bannerAds invoked\");\n BannerAdView bannerAdView = new BannerAdView(MainActivity.this);\n bannerAdView.loadOnAttach();\n FrameLayout bannerPlaceholder = findViewB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a decimal IPv4 notation to a binary value.
public static String decimalIPv4ToBinary(String ip) { StringBuilder result = new StringBuilder(); List<String> segment = Arrays.asList(ip.split("\\.")); for (int i = 0; i < 4; i++) { int decimal = Integer.parseInt(segment.get(i)); result.append(decimalToBinary(decimal) + ((i < 3) ? "." : "")); } return ...
[ "public static String binaryIPv4ToDecimal(String ip) {\n\t\tStringBuilder result = new StringBuilder();\n\t\tList<String> segment = Arrays.asList(ip.split(\"\\\\.\"));\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tString binary = segment.get(i);\n\t\t\tresult.append(binaryToDecimal(binary) + ((i < 3) ? \".\" : \"\"));\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Below are the tests related to the generateCode() method. These are all interactive tests, once running you need to input data from the user screen to be able to move forward. The input entered must b...
@Test public void testGenerateCodeI (){ assertEquals(4,guessGenerator.generateCode(colorBank, pegs).getCode().size()); }
[ "byte[] genCode(String input) throws Exception {\r\n\t\t\r\n\t\t//scan, parse, and type check\r\n\t\tScanner scanner = new Scanner(input);\r\n\t\tshow(input);\r\n\t\tscanner.scan();\r\n\t\tParser parser = new Parser(scanner);\r\n\t\tProgram program = parser.parse();\r\n\t\tTypeChecker v = new TypeChecker();\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grouping of SyncMember update stages.
interface UpdateStages { /** * The stage of the syncmember update allowing to specify DatabaseName. */ interface WithDatabaseName { /** * Specifies databaseName. * @param databaseName Database name of the member database in the sync member ...
[ "private void syncAll() {\n List<SwimMember> syncMembers = discoveryService.getNodes().stream()\n .map(node -> new SwimMember(MemberId.from(node.id().id()), node.address()))\n .filter(member -> !member.id().equals(localMember.id()))\n .collect(Collectors.toList());\n for (SwimMember membe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Import__Group__0__Impl" $ANTLR start "rule__Import__Group__1" ../org.xtext.lwc.instances.ui/srcgen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2590:1: rule__Import__Group__1 : rule__Import__Group__1__Impl ;
public final void rule__Import__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2594:1: ( rule__Import__Group__1__Impl ) ...
[ "public final void rule__Import__Group__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:5426:1: ( rule__Import__Group...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether to retry on request timeout.
public boolean shouldRetryOnTimeout() { return configuration.shouldRetryOnTimeout(); }
[ "public boolean shouldRetry() {\n\t\treturn lastFailedTime > 0 && Calendar.getInstance().getTimeInMillis() - lastFailedTime < 10 * 1000;\n\t}", "@Override\n\t\tpublic boolean isRetry() { return true; }", "boolean hasRetryDurationSec();", "public boolean isRetry() {\n return curRequest.isPresent();\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the vocabulary for training
public boolean buildVocab() { readStopWords(); if(cache.vocabExists()) { log.info("Loading vocab..."); cache.loadVocab(); cache.resetWeights(); return true; } //vectorizer will handle setting up vocab meta data if(vectorizer == nu...
[ "private void SortVocab() {\n\t\tint a, size;\n\t\tint hash;\n\t\t// Sort the vocabulary and keep </s> at the first position\n\t\t// Note this uses a stable sorting algorithm to make debugging easier.\n\t\tArrays.sort(vocab, 1, vocab_size);\n\n\t\tfor (a = 0; a < vocab_hash_size; a++)\n\t\t\tvocab_hash[a] = -1;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }