query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Returns the computed total Sales tax for the ReceiptItems that will be displayed in the receipt.
private BigDecimal calculateTotalSalesTax(List<ReceiptItem> receiptItems){ final String METHOD_NAME = "calculateTotalSalesTax"; if(LOGGER.isInfoEnabled()) LOGGER.info("Entering :"+CLASS_NAME+" "+METHOD_NAME); //calculate the total tax of the items BigDecimal totalSalesTax = new BigDecimal("0.00"); for(Receipt...
[ "public double getTaxtotal() {\n\t\tdouble taxtotal = 0;\n\t\tfor (Item item : itemMap.keySet()){\t\t\n\t\t\tdouble subTotal = item.getPrice() * getQuantity(item);\n\t\t\tdouble subInitTotal = item.getInitPrice() * getQuantity(item);\n\t\t\ttaxtotal += subTotal - subInitTotal;\n\t\t}\n\t\treturn taxtotal;\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads a XML file from directory inotadoapi/api/resources/xml
@SuppressWarnings("resource") protected String readXmlFromFile(String fileName) { BufferedReader br; String xmlStr = "No content available!"; // get the file location URL location = this.getClass().getProtectionDomain().getCodeSource() .getLocation(); String pathCurrent = location.getFile(); String pat...
[ "public void readXmlFile() {\r\n try {\r\n ClassLoader classLoader = getClass().getClassLoader();\r\n File credentials = new File(classLoader.getResource(\"credentials_example.xml\").getFile());\r\n DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates residue type by comparing seq length to feat length. If there is more than 2 base pairs per residue than its assigned AA. Otherwise sets it to DNA. It would be nice if the residue type came from the data itself, but barring that we do this little trick. Michele writes: Nasty hack to tell peptide from dna. Bl...
public static String guessResidueTypeFromFeatureLength(int seqLength, int featureLength) { float basepairsPerResidue = (Math.abs((float)featureLength/ (float)seqLength)); return (basepairsPerResidue > 2.0 ? SequenceI.AA ...
[ "public void determineType(AcidSequence sequence) {\r\n\t\t// Ensure that the sequences provided are all upper case.\r\n\t\tString seq = sequence.getSequence().toUpperCase();\r\n\t\t// The FASTA format for nucleic acid codes do not contain\r\n\t\t// the following options. Thus, if they are present,\r\n\t\t// it mu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the line with the given key
@Nonnull Optional<ScoreboardLine> getLine(@Nonnull String key);
[ "public int getLineNumber(String key) {\n\t\t\treturn lineNumbers.get(key);\n\t\t}", "public String get(String key) {\n\t\t//get this file's text\n\t\tString text = FileIO.read(this.getPath());\n\t\tString value = null;\n\t\ttry {\n\t\t\t//try matching the pattern: key : value\\n \n\t\t\tPattern pattern = Pattern...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the number of sectors in a pattern
public int getNumberOfSectors(int pattern) { int numberOfSectors; // Patterns 1 + 2 + 3 + 4 have 9 sectors if (pattern < 5) { numberOfSectors = 9; } // Patterns 7 + 8 have 21 sectors else if (pattern > 6) { numberOfSectors = 21...
[ "int getS2CCardHoleCount();", "public static int getNSectors()\n {\n return Disk.NUM_OF_SECTORS - ADisk.REDO_LOG_SECTORS - 1;\n }", "public static int getSectorCount(int track) {\n if (track > 30) return 17;\n if (track > 24) return 18;\n if (track > 17) return 19;\n return 21;\n }", "int ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Vista__Group__3" $ANTLR start "rule__Vista__Group__3__Impl" ../org.xtext.estilos.ui/srcgen/org/xtext/ui/contentassist/antlr/internal/InternalEstilos.g:724:1: rule__Vista__Group__3__Impl : ( ( rule__Vista__Group_3__0 )? ) ;
public final void rule__Vista__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.estilos.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalEstilos.g:728:1: ( ( ( rule__Vista__Group_3__0 )? ) ) // ../or...
[ "public final void rule__Vista__Group_3__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.estilos.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalEstilos.g:911:1: ( rule__Vista__Group_3__1__Impl )\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test parsing when the following options are set: XX:+PrintTenuringDistribution (output ignored) XX:+PrintGCApplicationStoppedTime (output ignored) XX:+PrintGCApplicationConcurrentTime (output ignored)
@Test public void printApplicationTimePrintTenuringDistribution() throws Exception { TestLogHandler handler = new TestLogHandler(); handler.setLevel(Level.WARNING); GCResource gcResource = new GcResourceFile("SampleSun1_7_0_02PrintApplicationTimeTenuringDistribution.txt"); gcResource...
[ "public void testPrintGCDetailsDisabled() {\n String jvmOptions = \"-Xss128k -XX:-PrintGCDetails -Xms2048M\";\n GcManager gcManager = new GcManager();\n Jvm jvm = new Jvm(jvmOptions, null);\n JvmRun jvmRun = gcManager.getJvmRun(jvm, Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleXParenthesizedExpression" $ANTLR start "entryRuleXIfExpression" ../com.euclideanspace.pbase/srcgen/com/euclideanspace/pbase/parser/antlr/internal/InternalTutorial.g:3888:1: entryRuleXIfExpression returns [EObject current=null] : iv_ruleXIfExpression= ruleXIfExpression EOF ;
public final EObject entryRuleXIfExpression() throws RecognitionException { EObject current = null; EObject iv_ruleXIfExpression = null; HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens("RULE_SL_COMMENT", "RULE_WS"); try { /...
[ "public final EObject entryRuleXIfExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject iv_ruleXIfExpression = null;\r\n\r\n\r\n try {\r\n // ../com.avaloq.tools.dslsdk.checkcfg.core/src-gen/com/avaloq/tools/dslsdk/checkcfg/parser/antlr/internal/Inter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort an array of real numbers using the selection sort algorithm.
private static void selectionSort(double[] numbers) { for (int top = numbers.length-1; top > 0; top-- ) { int maxloc = 0; for (int i = 1; i <= top; i++) { if (numbers[i] > numbers[maxloc]) maxloc = i; } double temp = numbers[top]; numbers[top] = numbers[maxloc]; ...
[ "static double [] selectionSort (double a[]){\r\n\r\n for(int i=0;i<a.length-1;i++)\r\n {\r\n \t int min=i;\r\n \t for(int j=i+1;j<a.length;j++)\r\n \t {\r\n \t\t if(a[j]<a[min])\r\n \t\t {\r\n \t\t\t min=j;\r\n \t\t }\r\n \t }\r\n \t do...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
jacob.scheduler.system.callTaskSynchronizer.castor.types.WarrentystatusType getWarrentystatus() Returns the value of field 'workgroup_name'. The field 'workgroup_name' has the following description: Name des AKs
public java.lang.String getWorkgroup_name() { return this._workgroup_name; }
[ "public jacob.scheduler.system.callTaskSynchronizer.castor.types.WarrentystatusType getWarrentystatus()\n {\n return this._warrentystatus;\n }", "public String getWorkgroupName() {\n return this.workgroupName;\n }", "public String getWorkGroupName() {\n return this.workGroupName;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns this agent's individual Qvalue source
public QSourceForSingleAgent getMyQSource(){ return myQSource; }
[ "protected Q currentSource() {\n\t\treturn _currentSource;\n\t}", "public final SimObject getSource() {return source;}", "public double getSourceValue() {\n return sourceValue;\n }", "public HarvestSource getSource() {\n\t\treturn source;\n\t}", "public Object getSource() {\n\t\treturn fSource;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Metode que comprova si un codi es correcte
boolean comprovarCodi(String codi) { if(codi == id) { return true; } else { return false; } }
[ "public ErrorMessage verifyCode(String code, Integer year, Long exception);", "@Override\n\tpublic boolean verificaAgencia(String codigo)\n\t{\n\t\tchar[] digitos = capturaDigitos(codigo, 4, 0);\n\t\treturn (digitos != null);\n\t}", "public boolean isValidCode()\r\n {\r\n boolean valid = false;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets (as xml) the "lastname" element
org.apache.xmlbeans.XmlString xgetLastname();
[ "public WebElement getLastName() {\n\t\treturn findByID(\"lnamewish\");\n\t}", "public org.apache.xmlbeans.XmlString xgetPassengerLastName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the calculMetricSuperior method in case the teacher has the best score but the student does not lose points
@Test public void calculMetricSuperiorTeacherBetterScoreButNoLostPointsTest() { Assert.assertEquals(UtilCalculGrade.calculMetricSuperior(new ModelValue(25f, 1f), 12f, 11f), new Float(0)); }
[ "@Test\r\n\tpublic void calculMetricInferiorTeacherBetterScoreButNoLostPointsTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculMetricInferior(new ModelValue(25f, 1f), 12f, 13f), new Float(0));\r\n\t}", "@Test\r\n\tpublic void calculMetricInferiorStudentBetterScoreTest() {\r\n\t\tAssert.assertEquals(UtilCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns the list of kpi scores of all countries for all the years for a kpi
@Override public List<KpiResultForAllCountriesAllYear> getAllKpiResultListForKpi(Integer kpiId, Locale locale) { LOGGER.debug("Getting the kpi scores of all countries for all the years for a kpi!"); List<KpiScoreNormalized> kpiScoreNormalizedEntityList = kpiScoreNormalizedService .getKpiScoreNormalizedListByKp...
[ "@Override\n\tpublic Map<String, Object> getKpiScoreAll(Integer kpiId, Locale locale) {\n\n\t\tList<KpiResult> kpiResultEntityList = kpiResultService.getKpiResultListByKpiId(kpiId, locale);\n\t\tCountriesNew countryDomain = null;\n\t\tMap<Integer, Map<String, Object>> yearMap = new HashMap<Integer, Map<String, Obje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a seqfeature at the specified position rename getChild(i) for clarity?
public SeqFeatureI getFeatureAt (int i);
[ "ChildPath getChildFeature();", "public int getFeatureIndex(SeqFeatureI child);", "public SeqFeatureI getFeatureContaining (int position);", "public ChildType getChildAt( int index );", "public SequenceI getFeatureSequence();", "int getChildIndex();", "public NodeSlr getChild(int pos) {\n \n if (pos ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to obtain the MySQLConnector object for database communication
public MySQLConnector getDbConnector() { return this.dbConnector; }
[ "public static MySQLConnector getInstance() {\n if (instance == null) {\n instance = new MySQLConnector();\n }\n return instance;\n }", "public static MySQLConnector getInstance() {\n\t\tif (instance == null) {\n\t\t\tinstance = new MySQLConnector();\n\t\t}\n\t\treturn instance;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Reset all player cards won in round
public static void resetPlayerCardsWon() { for(int i = 0; i < playerList.size(); i++) { playerList.get(i).resetWonCards(); } }
[ "public static void resetPlayers() {\r\n System.out.println(\"RESETTING PLAYERS...\");\r\n for (Person p : players) {\r\n if (p.chips > 0) {\r\n p.fold(); //Ensures all hand related variables are zeroed\r\n p.status = 1; //Puts the players in the game\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: runGuiLoop instead, to prevent errors from happening while the warning screen is open?
@Override public void showWarningScreen(CrashReport report) { addScheduledTask(() -> displayGuiScreen(new GuiWarningScreen(report, currentScreen))); }
[ "private void updateGUIStatus() {\r\n\r\n }", "public void warning() {\n\t\tLog.i(TAG, \"SafeSpeed.warning()\");\n\t\tLog.i(TAG, \"Screen on: \" + pm.isScreenOn() + \" isOpen: \" + !settings.getBoolean(\"isOpen\", false));\n\t\n\t\tif(pm.isScreenOn() && !settings.getBoolean(\"isOpen\", false)) {\n\t\t\teditor....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column resource_devices.snmp_port
public String getSnmpPort() { return snmpPort; }
[ "public Uuid probePortUuid() {\n return probePortUuid;\n }", "public final String getDevicePort(){\n return peripheralPort;\n }", "public int externalPort() {\n return alert.getExternal_port();\n }", "@ConfigDoc( name=\"RMIPort\", \n desc=\"RMI port of the endpoint bin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'EVENT_DT' field.
public java.lang.CharSequence getEVENTDT() { return EVENT_DT; }
[ "public java.lang.CharSequence getEVENTDT() {\n return EVENT_DT;\n }", "public void setEVENTDT(java.lang.CharSequence value) {\n this.EVENT_DT = value;\n }", "public String getMSDT() {\r\n for (int i = 0; i < eventFields.size(); i++) {\r\n EventDataEntry currentEntry = eventFields....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check all gateways for unhundled packets
private static void checkAllGateways(IPsecRule rule) { // for (IPsecGateway ig : IPsecGatewayBuffer.getGateways()) { // // for each gateways // IPsecRule tmpRule; // Iterator<IPsecRule> unHundled = ig.UnHundledPackets().iterator(); // while (unHundled.hasNext()) { // ...
[ "boolean dropAll() {\n logger.info(\"Dropping all data traffic\");\n try {\n droppingAll = true;\n RuleSet rs = new RuleSet(config);\n addDefaultRules(rs, switchPorts.getPort(myID));\n rs.add(new Rule(dataVIP, ZNetlink2Message.NULLPORT));\n RuleSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The createPauseAnalysis calculates the magnitude of the acceleration vector at each reading and if that magnitude is less than some defined minimum it marks it. If x number of magnitudes are below the minimum in a row then a pause had occured.
private void createPauseAnalysisCSV(String file_path, CSVReader reader, String user_id, String min_acceleration, String pause_window) throws IOException, ParseException { String path_to_csv; path_to_csv = initialFileSetup(file_path, user_id); CSVReader pause_reader; CSVWriter pause_csv_w...
[ "@Override\n public void processingFinished() {\n for (int i = 0; i < spectralFlux.size(); i++) {\n\n int start = Math.max(0, i - CUTOFF);\n int end = Math.min(spectralFlux.size() - 1, i + CUTOFF);\n\n double mean = 0;\n for (int j = start; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take a movie user BufferedReader and parse the ID to MovieUser object.
private void parseUser(BufferedReader userF) throws IOException { String one; userF.readLine(); while ((one = userF.readLine()) != null) { String[] data = one.split("::|,"); int idU, idI; try { idU = Integer.parseInt(data[0]); idI = Integer.parseInt(data[1]); } catch (NumberFormatException e) ...
[ "public User parseUser(InputStream in) throws DataParseException;", "public String parseUser(String userLine) {\n final int START_OF_USER_NAME = 6;\n \t\tString userName = userLine.substring(\n START_OF_USER_NAME, userLine.indexOf(\"Date: \") - 1).trim();\n \n \t\treturn userName;\n \t}", "Reco...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add an annotation to be stored in the "Annotation" attribute of this given artifact.
public void addAnnotation(ArtifactAnnotation newAnnotation) throws OseeCoreException { // Update attribute if it already exists for (Attribute<String> attr : getAttributes()) { ArtifactAnnotation annotation = new ArtifactAnnotation(attr.getValue()); if (newAnnotation.equals(annotation)) {...
[ "public void addAnnotation(Annotation annotation)\n {\n int annotationsCount = targetAnnotationsAttribute.u2annotationsCount;\n Annotation[] annotations = targetAnnotationsAttribute.annotations;\n\n // Make sure there is enough space for the new annotation.\n if (annotat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This methods sets the name of the restaurant
public void setName(String restaurantName) { // Sets the restaurant's name name = restaurantName; }
[ "public void setRestaurantName( String restaurantName ) {\n this.restaurantName = restaurantName;\n }", "public void setRestaurantName(String restaurantName) {\n this.restaurantName = restaurantName;\n }", "public void setRestaurantName(String newName)\n {\n restaurantName = newNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks the leaf "nsresettimer" with operation "replace".
public void markNsResetTimerReplace() throws JNCException { markLeafReplace("nsResetTimer"); }
[ "public void markNsTestTimerReplace() throws JNCException {\n markLeafReplace(\"nsTestTimer\");\n }", "public void markNsResetTimerMerge() throws JNCException {\n markLeafMerge(\"nsResetTimer\");\n }", "public void markNsAliveTimerReplace() throws JNCException {\n markLeafReplace(\"ns...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'WORD' containment reference. If the meaning of the 'WORD' containment reference isn't clear, there really should be more of a description here...
EObject getWORD();
[ "public String getWord()\n\t{\n\t\treturn word;\n\t}", "java.lang.String getWord();", "public String getWord() {\n if(words[index] != null) {\n return words[index];\n } else {\n return \"\";\n }\n }", "public String getWord() {\r\n\t\treturn item03;\r\n\t}", "EO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms an object to Binary. As default returns a NullType object;
@Override public ITypes transformtoBinary() { return FlyweightNull.getFNull().createNull(); }
[ "public T caseBinary(Binary object) {\n\t\treturn null;\n\t}", "@Override\n public BinaryType asBinary() {\n return TypeFactory.getBinaryType(this.getValue());\n }", "@Override\n public ITypes orwithBinary(Binary b) {\n return FlyweightNull.getFNull().createNull();\n }", "public Obje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the Data (defined) object that starts at the given address. If no Data object is defined at that address, then return null.
public Data getDefinedDataAt(Address addr);
[ "public Data getDefinedDataContaining(Address addr);", "public Data getDataAt(Address addr);", "public Data getDefinedDataBefore(Address addr);", "public Data getDefinedDataAfter(Address addr);", "public Data getDataContaining(Address addr);", "public Data getUndefinedDataAt(Address addr);", "public Dat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ getDocName() Get the String document name. Return: String document name.
public String getDocName() { return this.docName; }
[ "public long getDocumentName() {\n\t\treturn _tempNoTiceShipMessage.getDocumentName();\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"The name of the document.\")\n\n public String getName() {\n return name;\n }", "@Override\n\tpublic long getDocumentName() {\n\t\treturn _tempNoTiceShipM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
builds BusinessUnitStatusChangedMessagePayload with checking for nonnull required values
public BusinessUnitStatusChangedMessagePayload build() { Objects.requireNonNull(active, BusinessUnitStatusChangedMessagePayload.class + ": active is missing"); return new BusinessUnitStatusChangedMessagePayloadImpl(active); }
[ "public static BusinessUnitStatusChangedMessagePayloadBuilder of() {\n return new BusinessUnitStatusChangedMessagePayloadBuilder();\n }", "public BusinessUnitStatusChangedMessagePayload buildUnchecked() {\n return new BusinessUnitStatusChangedMessagePayloadImpl(active);\n }", "public static ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the "specimen" element
org.hl7.fhir.ResourceReference getSpecimen();
[ "org.hl7.fhir.Specimen getSpecimen();", "Reference getSpecimen();", "public ExperimentDesignElementSpec getItemSpec() {\n return this.spec;\n }", "public String getSpecimenID() {\n\t\treturn specimenID;\n\t}", "MeasurementSpecification getMeasurementSpecification();", "public String getSpec() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a game ID, where are we saving it to storage (file name)?
private static String getFilePath(int gameId) { return DaoUtils.storageDirectoryName() + File.separator + "game" + gameId + ".txt"; }
[ "private void saveGame(int gameId, String fileName){\n\n }", "public void saveGame(File fileLocation);", "void save(Game game, File file) throws IOException;", "public void SaveGame() {\n\n\t\tObjectOutputStream oos = null;\n\n\t\ttry {\n\t\t\t// first, create the my documents\\my games\\Khazad\\Worlds fol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the band pass gain pot is manipulated.
public void bpGainChanged(BoostCutSlidePot p) { ((ParametricEQWithUI)aa).bandPassPeakGain(p.getGain()); }
[ "public void lpGainChanged(BoostCutSlidePot p) {\r\n\r\n\t\t((ParametricEQWithUI)aa).lowPassShelfGain(p.getGain());\r\n\t}", "public void hpGainChanged(BoostCutSlidePot p) {\r\n\r\n\t\t((ParametricEQWithUI)aa).highPassShelfGain(p.getGain());\r\n\t}", "private void gainEnergy() { energyLevel += energyGainPerFish...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column wallet_translog_type.trans_config
public String getTransConfig() { return transConfig; }
[ "public String getp_trans_type() {\n return (String)getNamedWhereClauseParam(\"p_trans_type\");\n }", "public String getTransType() {\n return transType;\n }", "java.lang.String getTransType();", "public String getConfigType() {\n\t\treturn configType;\n\t}", "public String getTransactio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The PerpendicularOffset element of a LinePlacement gives the perpendicular distance away from a line to draw a label. The distance is in uoms and is positive to the lefthand side of the line string. Negative numbers mean right. The default offset is 0.
@XmlElement("PerpendicularOffset") Expression getPerpendicularOffset();
[ "public void setLabelOffset(double v) {\n label.setOffset(v);\n }", "public Point2D\ngetPerpLinePtFromOffSetPt(Point2D offsetPt)\n{\n\treturn (this.ptAtT(this.offsetPtTValue(offsetPt)));\n}", "public double getLabelOffset() {\n return label.getOffset();\n }", "public GLine2D perpendicularL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize a new level: create the edges, blocks, balls, paddle and info bar, and add them to the game.
public void initialize() { this.addSprite(level.getBackground()); // Create edge blocks. addFrameEdges(); // Add playing blocks to the game. addBlocks(); // Add balls to the game. addBalls(); // Add the paddle. this.paddle.addToGame(this);...
[ "public void initialize() {\r\n levelInformation.getBackground().addToGame(this);\r\n ScoreTrackingListener scoreTrackingListener = new ScoreTrackingListener(score);\r\n ScoreIndicator scoreIndicator = new ScoreIndicator(score, guiWidth);\r\n BlockRemover blockRemover = new BlockRemover(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the Read and Write Nodes in this Workflow. NOTE: The execute function uses the list received in the parameters and not these
public void findIONodes() { Node [] aoNodes = m_oGraph.getNodes(); if (aoNodes == null) return; if (aoNodes.length == 0) return; for (int iNodes=0; iNodes<aoNodes.length;iNodes++) { Node oNode = aoNodes[iNodes]; if (oNode.getOperatorName().equals("Read")) { m_oLogger.info("WasdiGraph.findIONo...
[ "private final void computeNodesToLockOnRead() {\n\t\tfinal Map<String, Set<String>> dependencyClosure = DependencyGraphUtils.computeDependencyClosure();\n\n\t\tfinal Predicate<String> aDependentNodeIsRemote = //\n\t\tnode -> dependencyClosure.get(node).stream() //\n\t\t .anyMatch(depNode -> !depNode.split(\"@\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add uuid tag item stack.
public static ItemStack addUUIDTag(UUID id, ItemStack item) { if (item.hasItemMeta()) { ItemMeta im = item.getItemMeta(); im.getPersistentDataContainer().set(key, PersistentDataType.STRING, id.toString()); item.setItemMeta(im); } return item; }
[ "public void add(UUID uuid);", "private void push(String tag) {\n\t\tif (tags == null) tags = new ArrayList<String>();\n\t\ttags.add(tag);\n\t}", "public abstract void addItemStackToItemList(Object stack);", "@Test\n public void addTagToItemTest() throws ApiException {\n RequestItemTag body = nul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Page name: sponsor_reg_detail_1 Method : GET Purpose : only get page with param is "id" field from jsp page
@RequestMapping(value = "/register/edit1", method = RequestMethod.GET) public String updateSponsorRegDetail1(HttpSession session, @RequestParam("id") Integer id,Model model) { try { SponsorEntity sponsor = sponsorService.findOne(id); List<CategoryEntity> listMembershipFeeType = categoryService.findByGroupId((s...
[ "@RequestMapping(value = \"/register/edit2\", method = RequestMethod.GET)\n\tpublic String updateSponsorRegDetail2(HttpSession session, @RequestParam(\"id\") Integer id,Model model) {\n\t\ttry {\n\t\t\tSponsorEntity sponsor = sponsorService.findOne(id);\n\t\t\tList<CategoryEntity> listMembershipFeeType = categorySe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register a callback to be invoked when the Photo displayed by this View is tapped with a single tap.
public void setOnPhotoTapListener(OnPhotoTapListener listener) { mAttacher.setOnPhotoTapListener(listener); }
[ "void onPhotoTap(View view, float x, float y);", "void onImageTapped();", "public void tap() {\n\t\ttapped = true;\n\t}", "public static interface OnPhotoTapListener {\n\n /**\n * A callback to receive where the user taps on a photo. You will only receive a callback if\n * the user taps...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the user clicks the Upgrades button
public void viewUpgrades(View view) { Intent intent = new Intent(this, UpgradesActivity.class); startActivity(intent); }
[ "public void onUpgradeAppButtonClicked(View arg0) {\n Log.d(TAG, \"Upgrade button clicked; launching purchase flow for upgrade.\");\n setWaitScreen(true);\n\n startBuyFlow(Skus.SKU_PREMIUM_ID);\n }", "public void onUpgradeAppButtonClicked(View arg0) {\n\t\tLog.d(TAG,\n\t\t\t\t\"Upgrade button clicked; l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an ordered range of all the products where companyId = &63; and userId = &63; and status = &63;, optionally using the finder cache. Useful when paginating results. Returns a maximum of end start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result...
public java.util.List<Product> findByC_U_S( long companyId, long userId, int[] statuses, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<Product> orderByComparator, boolean useFinderCache);
[ "public java.util.List<Product> findByC_U_S(\n\t\tlong companyId, long userId, int status, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<Product>\n\t\t\torderByComparator);", "public java.util.List<Product> findByC_U_S(\n\t\tlong companyId, long userId, int status, int start, int end,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete note from the database
private void delete(){ if(NoteBeanController.removeNote(noteInfo)){ ((JInternalFrame)this.getParent().getParent().getParent()).dispose(); JOptionPane.showMessageDialog(this, "Note successfully deleted from the database", "Success", ...
[ "@Delete\n void delete(Note note);", "private void deleteNoteOnFirebaseManager(Note note){\n firebase.deleteNoteOnDB(note, unused -> {\n Toast.makeText(this, R.string.note_deletion_success, Toast.LENGTH_LONG).show();\n finish();\n }, e -> {\n Toast.makeText(this, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns True if o is a DataItem with the same label
@Override public boolean equals(Object o) { if (o instanceof DataItem) { DataItem x = (DataItem) o; if (x.getLabel() == null || x.getLabel().isEmpty()) { return false; } else { return x.getLabel().equals(this.label); ...
[ "public boolean isMaybeSingleObjectLabel() {\n checkNotPolymorphicOrUnknown();\n return object_labels != null && object_labels.size() == 1;\n }", "public boolean hasSameItem(DropEntry other) {\n\t\treturn item.equals(other.item);\n\t}", "@Override\r\n public boolean equals(final Object o) {\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the assessment target that is specified by the ARN of the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.
java.util.concurrent.Future<UpdateAssessmentTargetResult> updateAssessmentTargetAsync(UpdateAssessmentTargetRequest updateAssessmentTargetRequest);
[ "java.util.concurrent.Future<UpdateAssessmentTargetResult> updateAssessmentTargetAsync(UpdateAssessmentTargetRequest updateAssessmentTargetRequest,\n com.amazonaws.handlers.AsyncHandler<UpdateAssessmentTargetRequest, UpdateAssessmentTargetResult> asyncHandler);", "public TargetGroupSummary withArn(Stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method sets up the stations loaded from the file in the model to the dropdown menus in the View
private void setUpDropDowns() { List<String> stations = model.getListOfStations(); Map<String, List<String>> stationColorMap = model.getStationColorMap(); view.customizeDropDowns(stationColorMap); view.fillStationsOptions(stations); }
[ "private void initStationLists(){\n stationsDir1 = new ArrayList<>();\n stationsDir2 = new ArrayList<>();\n String[] stationNames = stations.getStationNames();\n\n for(int i = 0; i < stationNames.length; i++){\n stationsDir1.add(new StationModel(stationNames[i], \"dir1\", this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates and returns a new not present exception for this element.
public JavaModelException newNotPresentException() { return new JavaModelException(newDoesNotExistStatus()); }
[ "Exception createException();", "public ElementExistsException() {\n super();\n }", "public E createException() {\n return createException(getDiagnosticListener().getDiagnostics());\n }", "SpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException createSp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls unequip to unequip the current weapon/armor takes out the equip from hero's items and puts it in weapon or armor slot adds the equip rating to attack or defense
public void equip(Equip equipment) { if (equipment.getType() == Equip.WEAPON) { if (weapon!=null) unequip(weapon); items.remove(equipment); weapon = equipment; attack = attack + equipment.getRating(); } else //if (equipment....
[ "private void unequip(Equip e)\r\n { \r\n if (e.getType()==Equip.WEAPON)\r\n {\r\n attack -= e.getRating();\r\n items.add(e);\r\n }\r\n else if (e.getType() == Equip.ARMOR)\r\n {\r\n items.add(e);\r\n defense -= e.getRating();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets widget to the specified value.
public void setWidget(Object value) throws DmcValueException { ((ViewDMO) core).setWidget(value); }
[ "void setControlValue(Object value);", "public void setValue(final Object value) {\n spinner.setValue(value);\n }", "IWebElementWrapper setValue(String value);", "public void setValue(View<?> view, T value) {\n\t\tinternal_setValue(view, value);\n\t\t// FIXME: fire event!\n\t}", "public void setSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an array of num dmultiplicative cells (multiplicative delta correction).
public int dmultiplicativeCells(final int num) { return this.cells(num, CellType.DMULTIPLICATIVE); }
[ "private static void demoMultiDArrays() {\r\n\t\tint[][] nums = new int[3][5];\r\n\t\tnums[0][2] = 10;\r\n//\t\tcompact, hard to read version: **note: slower. its worse in every way.**\r\n//\t\tnums[nums.length-1][nums[nums.length-1].length-1] = 14;\r\n\t\tint lastRow = nums.length-1;\r\n\t\tint lastCol = nums[last...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the y component of the last received acceleration data. If no data has been received since the last call to requestAccelData(), this method returns Double.NaN. Acceleration is measured in meters per second squared
public double getAccelY() { if (accel == null) { return Double.NaN; } else { return accel.y; } }
[ "public double getYAccel() {\n acceleration = imu.getLinearAcceleration();\n return acceleration.yAccel;\n }", "public double getAccelY() {\n\t\treturn this.accel.getY();\n\t}", "public double getyAccel() {\n return yAccel;\n }", "public float getAccelY() {\n return mAccelY;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the global MetaClass object
public MetaClass getMetaclass() { return this.xwiki.getMetaclass(); }
[ "public Class getMetafacadeClass()\r\n {\r\n return metafacadeClass;\r\n }", "private ClassObj createGlobalClass(String name) {\n ClassObj metaclass = new ClassObj(mClass, name + \"Class\", mClass);\n \n // Create the class object itself. This will hold the instance methods for\n // o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes the entire Sheet object Returns a list of lists, the first list corresponding to the headers, and the rest corresponding to data items in the sheet
public ArrayList<ArrayList<String>> readSheet(Sheet sheet) { if(sheet == null) return null; ArrayList<ArrayList<String>> rowValueList = new ArrayList<ArrayList<String>>(); Iterator<Row> rowIterator = sheet.iterator(); //Get the row iterator for the sheet int columnCount; //First row consi...
[ "private static List<List<String>> loadSheetDataTable(XSSFSheet sheet) {\n List<List<String>> ret = new ArrayList<List<String>>();\n // Get the first and last sheet row number.\n int firstRowNum = sheet.getFirstRowNum();\n int lastRowNum = sheet.getLastRowNum();\n if (lastRowNum >...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an array with size of TRAINING_VALUE_COUNT and checks count of previous interpolated data values
private static double[] createTargetTrainingArray(int gapPos, float[] data, boolean[] targetInterpolationFlags) { double[] result = new double[TRAINING_VALUE_COUNT]; int startPos = gapPos-TRAINING_VALUE_COUNT; int interpolatedCounter = 0; for(int i=startPos;i<gapPos;i++) { if(Float.isNaN(data[i])) { retu...
[ "private static double[] createSourceTrainingArray(int gapPos, float[] data) {\n\t\tdouble[] result = new double[TRAINING_VALUE_COUNT+1];\n\t\tint startPos = gapPos-TRAINING_VALUE_COUNT;\t\t\n\t\tfor(int i=startPos;i<=gapPos;i++) {\n\t\t\tif(Float.isNaN(data[i])) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tres...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the method reads data from file properly. Matches the text to be read to the text read straight from the file
@Test public void testReadDataFromFile() throws IOException { try { TextModel instance = new TextModel(inputFile.getAbsolutePath(), outputFile.getAbsolutePath()); instance.readDataFromFile(); assertTrue("Data read from file", instance.getOriginalText().contains(inpu...
[ "@Test\n\tpublic void testReadTxtFile() throws FileNotFoundException {\n\t\tFileParser fp = new FileParser();\n\t\tArrayList<String> parsedLines = fp.readTxtFile(\"test.txt\");\n\t\tassertEquals(\"This is a test file\", parsedLines.get(0));\n\t\tassertEquals(\"University of Virginia\", parsedLines.get(1));\n\n\t\tA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an EventResponse to an Event.
public Event(EventResponse response){ this.id = response.eventID; this.username = response.descendant; this.personId = response.personID; this.eventType = response.eventType; this.year = response.year; this.eventLocation = new Location(response.country, ...
[ "public ResponseEvent getResponseEvent() {\n return responseEvent;\n }", "private Event convertToEvent(String message) {\n\t\tJSONParser parser = new JSONParser();\n\t\tJSONObject jsonObject;\n\t\ttry {\n\t\t\tjsonObject = (JSONObject) parser.parse(message);\n\t\t} catch (ParseException e) {\n\t\t\tthrow new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interface Rule defines complex conditions and, if given a OpSystem, can determine if the conditions are met or not.
public interface Rule { /** * Determine if a rule meets all of its conditions. * @param OpSystem The overall system for this rule. * @return true if the rule meets its condition. */ public boolean meetsCondition(OpSystem system); }
[ "@Override\n public boolean meetsCondition(OpSystem system) {\n boolean doesMeet = false;\n for (Rule rule : rules) {\n doesMeet = doesMeet || rule.meetsCondition(system);\n if (doesMeet) {\n return true;\n }\n }\n return false;\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents the billing cycle where a ramp interval starts.
public Integer getStartingBillingCycle() { return this.startingBillingCycle; }
[ "Constant getCyclePeriodConstant();", "Expression getTimeCycle();", "public long getCycleInterval() {\r\n return cycleInterval;\r\n }", "public int getCycle() {\n return cycle;\n }", "public java.lang.Integer getBillCycleDay() {\n return billCycleDay;\n }", "java.util.Calendar getI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TIMEChunk chunk creator method.
public TIMEChunk(TCFile parentFile, long startByte, long length, PNGFileChunk parentChunk, TCRaf raf) throws IOException { super(parentFile, startByte, length); this.parentChunk = parentChunk; if (parentFile.length() < (startByte + length)) { throw new IOException("Chunk does not have enough bytes"); } ...
[ "private Chunk generateChunk(int size) {\n String json;\n ObjectMapper objectMapper = new ObjectMapper();\n List<Record> recordList = new ArrayList<>();\n int i = 1;\n while (i <= size) {\n json = \"{ \\\"Price\\\" :\" + priceGenerator.nextDouble() * 100 + \" }\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
onUploadEventSuccess will get callback When event triggered successfully
public void onUploadEventSuccess() { if (iUploadEventListener != null) { iUploadEventListener.onUploadEventSuccess(); } }
[ "protected void fireUploadSuccess(Events.SucceededEvent evt) {\n LoggerFactory.getLogger(getClass()).debug(\"fireUploadSuccess {}\", evt);\n if(preprocessOnSuccess(evt)) {\n LoggerFactory.getLogger(getClass()).debug(\"before fireEvent {}\", evt);\n fireEvent(evt);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the set of term IDs containing the given termID's ancestors.
public Set<TermID> getTermParents(TermID goTermID) { HashSet<TermID> terms = new HashSet<TermID>(); if (rootTerm.getID().id == goTermID.id) return terms; Term goTerm; if (goTermID.equals(rootTerm.getIDAsString())) goTerm = rootTerm; else goTerm = termContainer.get(goTermID); Iterator<Edge<Term>>...
[ "public Set<String> getTermParentsAsStrings(String termID)\n\t{\n\t\tTerm term = getTermOrRoot(termID);\n\n\t\tHashSet<String> terms = new HashSet<String>();\n\n\t\tIterator<Edge<Term>> edgeIter = graph.getInEdges(term);\n\t\twhile (edgeIter.hasNext())\n\t\t\tterms.add(edgeIter.next().getSource().getIDAsString());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a data scheme in the filter.
public final String getDataScheme(int index) { return mDataSchemes.get(index); }
[ "public FeatureFilter getSchema();", "public DataFilter getDataFilter() {\r\n return dataFilter;\r\n }", "java.lang.String getDataItemFilter();", "public abstract INexusFilterDescriptor getFilterDescriptor();", "public HashMap getFilterDataComplex() {\r\n return this.filterComplexData;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column TRS_SYN_SETLMT_ACC.PAYMENT_METHOD
public String getPAYMENT_METHOD() { return PAYMENT_METHOD; }
[ "io.opencannabis.schema.commerce.Payments.PaymentMethod getMethod();", "PaymentMethod getPaymentMethod();", "@Override\n public String getPaymentMethodCode() {\n return this.getAdvanceTravelPayment().getPaymentMethodCode();\n }", "public String getPaymentMethod() {\n return paymentMethod;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
C TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: ORIGINAL LINE: public override void setBeatsPerMinute(uint value)
@Override public void setBeatsPerMinute(int value) { for (Tag tag : tags) { if (tag != null) { tag.setBeatsPerMinute(value); } } }
[ "public void setBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public static void setBeatsPerMinute(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.Integer value) {\r\n\t\tBase.set(model, instanceResource...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Input two Strings representing length and width measurements; Returns calculated area as String.
public final String calculateAreaOfRectangle(String length, String width) throws NumberFormatException,IllegalArgumentException{ if(Double.parseDouble(length) < MIN_INPUT || Double.parseDouble(width) < MIN_INPUT || width.isEmpty() || width == null || length.isEmpty() || ...
[ "public double areaOfRectangle(int length, int width){\n return length * width;\n }", "public static double rectangleArea(double length, double width)\r\n {\r\n return length * width; \r\n }", "public void calculate(String length, String width) \r\n\t{\t\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a value of property Invalidated as an RDF2Go node
public void removeInvalidated( org.ontoware.rdf2go.model.node.Node value) { Base.remove(this.model, this.getResource(), INVALIDATED, value); }
[ "public void setInvalidated( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), INVALIDATED, value);\r\n\t}", "public void addInvalidated( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), INVALIDATED, value);\r\n\t}", "public ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter function for this gadget's list of gadgets to trigger
public List<Gadget> getGadgetsToTrigger() { return gadgetsToTrigger; }
[ "public List<Gadget> getGadgetList() {\n List<Gadget> gadgets = new ArrayList<>();\n orders.entrySet().stream().forEach((s) -> s.getValue().forEach((s1) -> gadgets.add(s1)));\n return gadgets;\n }", "private void triggerGadgets(Gadget[] gadgetArray) {\n\n for (Gadget gadget : gadget...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if a pattern of words is inside a string.
public boolean matchWord(String pattern, String str){ //unify the pattern and string pattern = unifyString(pattern); str = unifyString(str); if(str.equals("NULL")) return false; if(pattern.equals("NULL")) return true; //splits the pattern into an array of words. String[] pattern_wo...
[ "@tags.HashTable\n @tags.Company.Dropbox\n @tags.Company.Uber\n public boolean wordPattern(String pattern, String str) {\n String[] words = str.split(\" \");\n if (words.length != pattern.length()) {\n return false;\n }\n\n Map<Character, String> map = new HashMap<>()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "isDisplay" element
void setIsDisplay(java.lang.String isDisplay);
[ "public void setDisplay(Boolean display) {\n this.display = display;\n }", "void xsetIsDisplay(org.apache.xmlbeans.XmlString isDisplay);", "public boolean isSetDisplay() {\n return this.display != null;\n }", "public void setDisplay(Display display) {\n\t\tthis.display = display;\n\t}", "publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the Y axis view.
public AxisViewY getAxisViewY() { AxisType axisType = getAxisTypeY(); return (AxisViewY) _chartHelper.getAxisView(axisType); }
[ "public ChartYAxis getYAxis() { return _yaxis; }", "public String getYaxis() {\n return yaxis;\n }", "double getLayoutY();", "public static Vec2d axisY() {\n return new Vec2d(0, 1);\n }", "public double GetRotationAxisY()\n {\n return axisY;\n }", "public String getYAxisInfo();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a TextureRegion[] with spikes in the correct orientation.
private TextureRegion[] getTextureRegion(spikeOrientation ori){ switch(ori){ case UP: return TextureRegion.split(Content.getInstance().getTexture("upSpike"), 16, 21)[0]; case DOWN: return TextureRegion.split(Content.getInstance().getTexture("downSpike"), 16, 21)[0]; case LEFT: return TextureRegion....
[ "private List<Region> experimentFullRegions() {\n\t\tList<Region> rs = new ArrayList<Region>();\n\t\tRegion r;\n\n\t\t// Vassar St\n\t\tr = new Region(\"Vassar-1\");\n\t\tr.addVertex(42.36255147026933, -71.09034599930573);\n\t\tr.addVertex(42.36240877523236, -71.08975591332245);\n\t\tr.addVertex(42.36013353836458, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when information about a route provider and its routes changes.
public void onDescriptorChanged(MediaRouteProvider provider, RouteProviderDescriptor descriptor) { }
[ "public void preloaderNotifyNewRoutes();", "@Override\n public void onRouteChanged(MediaRouter router, MediaRouter.RouteInfo route) {\n if (route == null) return;\n\n if (route.matchesSelector(mRouteSelector)) {\n onRouteAdded(router, route);\n } else {\n onRouteRemov...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ index 0 corresponds to start delta is nm/index
public void set_nm(float start, float delta){ float temp; for (int i = 0; i < daten.length; i++){ temp = delta*i; display.nm[i] = start + temp; } nm_left= (int)display.nm[0]; nm_right=(int)display.nm[daten.length-1]; }
[ "double label(int index) { return (m_start + index) * m_spacing; }", "int getOffsetDelta();", "int getDelta();", "public void getDelta(int base);", "public int moveIndex(int delta) { throw new RuntimeException(\"Stub!\"); }", "public int getNameStartPosition ()\n {\n return (mNameStart);\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Cuenta el numero de elementos en el subarbol derecho del vertice
protected int obtenerElementosSubArbolDerecho(VerticeArbolBinario<T> vertice) { if (!vertice.hayDerecho()) return 1; return obtenerNumeroElementos(vertice.derecho()) + 1; }
[ "protected int obtenerElementosSubArbolIZquierdo(VerticeArbolBinario<T> vertice) {\n if (!vertice.hayIzquierdo()) return 1;\n return obtenerNumeroElementos(vertice.izquierdo()) + 1;\n }", "public int getNumElementos()\n {\n return objetos.length;\n }", "public abstract int getNumDataElements...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To force fetch all tenant features from Cloud Services
private Mono<Map<String, Boolean>> forceAllRemoteFeaturesForTenant(String tenantId) { Mono<String> instanceIdMono = configService.getInstanceId(); String appsmithVersion = releaseNotesService.getRunningVersion(); return instanceIdMono .map(instanceId -> { Feat...
[ "@Cache(cacheName = \"tenantNewFeatures\", key = \"{#tenantId}\")\n @Override\n public Mono<CachedFeatures> fetchCachedTenantNewFeatures(String tenantId) {\n return this.forceAllRemoteFeaturesForTenant(tenantId).flatMap(flags -> {\n CachedFeatures cachedFeatures = new CachedFeatures();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Return first tab in the ruler. If an autoTab, it is at position zero, and all subsequent tabs will be autotabs at autoSpacing intervals.
public TabStop firstTab() { if (fTabs != null && fTabs.length > 0) { return fTabs[0]; } return AUTO_ZERO; }
[ "public boolean getAutoTab() {\n\t\treturn autoTab;\n\t}", "public TabStop nextTab(float position) {\r\n if (fTabs != null) {\r\n for (int i = 0; i < fTabs.length; ++i) {\r\n if (position < fTabs[i].getPosition()) {\r\n return fTabs[i];\r\n }\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a Munsell Neutral value to a remittance value.
private static float munsellNeutralReflectanceValue(double v) { double v2, v3, v4, v5; double r = 0.0; if (v > 9.9) { r = 1.0; } else if (v > 0.0) { v2 = v * v; v3 = v2 * v; v4 = v3 * v; v5 = v4 * v; r = ((1.2219 * v - 0.23111 * v2 + 0.23951 * v3 - 0.021009 * v4 + 0.0008404 * v5) / 1...
[ "private static double munsellNeutralValue(String s) {\r\n\t\tint i = s.indexOf(\"/\");\r\n\t\tString ss = (i < 0) ? s.substring(2) : s.substring(2, i);\r\n\t\tdouble r = 0.0;\r\n\t\ttry {\r\n\t\t\tr = Double.valueOf(ss).doubleValue();\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tnew ParameterValueError(\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a RowSorterListener to receive notification about this RowSorter. If the same listener is added more than once it will receive multiple notifications. If l is null nothing is done.
public void addRowSorterListener(RowSorterListener l) { listenerList.add(RowSorterListener.class, l); }
[ "public void removeRowSorterListener(RowSorterListener l) {\n listenerList.remove(RowSorterListener.class, l);\n }", "public void addListener(RemoteTrancheServerListener l) {\n synchronized (listeners) {\n listeners.add(l);\n }\n }", "public void addGridListener(GridListene...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method romanToInt() accepts String s Declares variable foo at 0 uses 'for' loop to pass character by character through length of string using charAt() method, evaluates each character according to values of Roman Numerals and translates the letter to that int value, then passes that value to foo
public static int romanToInt(String s) { int foo = 0; for (int i = 0; i < s.length(); i ++) { char j = s.charAt(i); if (j == 'M') { foo += 1000; } else if (j == 'D' && s.charAt(i-1) == 'C') ...
[ "public int romanToInt(String s) {\n int result = 0;\n char chars[] = s.toCharArray();\n int size = s.length();\n char temp = ' ';\n \n for(int i = 0; i < size; i++) {\n temp = s.charAt(i);\n if(temp == 'M') { //check 1000\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the externalKey value for this MObjStatus.
public void setExternalKey(com.marketo.www.mktows.Attrib externalKey) { this.externalKey = externalKey; }
[ "public void setExternalKey(java.lang.String externalKey) {\n this.externalKey = externalKey;\n }", "public void setExternalId(String externalId) {\n\t\tthis.externalId = externalId;\n\t\tmarkDirty(\"externalId\",externalId);\n\t}", "public void setExternalClKey(String externalClKey) {\n this.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that tests the horizontal method if there are no patterns one pattern or more than one pattern
@Test public void findHorizontalTest() { FindSequence test = new FindSequence(noPattern); int actual = test.findHorizontal(); int expected = 0; Assert.assertEquals(expected, actual); FindSequence test2 = new FindSequence(oneHorizontalPattern); actual = test2.findHorizontal(); expected = 1; Assert.asse...
[ "private boolean checkPattern() {\n if (pattern == null) {\n return false;\n }\n char leftSeparator = getLeftSeparator();\n char rightSeparator = getRightSeparator();\n Stack<Character> separatorStack = new Stack<Character>();\n for (int i = 0; i < pattern.length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute a shell command on the device
public String exec(String cmd) throws IOException { Socket socket = null; try { socket = new Socket(host, port); InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream(); ProtocolSupport.send("host:transport:" + serial, in, out); ProtocolSupport.send("shell:" + cmd, in, ...
[ "ShellStatus executeCommand(Environment env, String arguments);", "private void shellExec( final String shellCommand )\n throws MojoExecutionException\n {\n try\n {\n this.logger.debug( \"Executing shell command '\" + shellCommand + \"' ...\" );\n PtShellExecuter.exec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Oneparameter constructor for a ThreeStonesPlayer object. Calls the two parameter constructor, with 15 set as the default number of Stones.
public ThreeStonesPlayer(Stone stoneColour) { this(stoneColour, 15); }
[ "public ThreeStonesPlayer(Stone stoneColour, int numStones) {\n this.score = 0;\n this.stoneColour = stoneColour;\n this.numStones = numStones;\n }", "public SinglePlayerGame() {\n super(2);\n }", "public SquarePlanter(int flowersPerside)\n {\n /*# Do any work to init...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure can ratify if have authorization header.
public void testRatifyWithAuthorizationHeader() throws IOException { final MockHttpRatifyContext<HttpAccessControl> ratifyContext = new MockHttpRatifyContext<>( "Digest credentials"); // Test this.replayMockObjects(); // Create and initialise the security HttpSecurity<HttpAuthentication<Void>, HttpAcce...
[ "@Test\n public void testInvalidBearerHeader() {\n Response r = target(\"/token\")\n .request()\n .header(AUTHORIZATION, \"Bearer some_secluded_rendezvous\")\n .get();\n\n assertEquals(Status.UNAUTHORIZED.getStatusCode(), r.getStatus());\n }", "@Tes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that the UserConstants.PREFS_GENERAL_NOTIFICATION constant is equal to "prefsgeneralnotification".
public void testPreferencesGeneralNotificationConstant() { assertEquals("PREFS_GENERAL_NOTIFICATION is incorrect", UserConstants.PREFS_GENERAL_NOTIFICATION, "prefs-general-notification"); }
[ "public void testPreferencesSoundConstant() {\n assertEquals(\"PREFS_SOUND is incorrect\", UserConstants.PREFS_SOUND, \"prefs-sound\");\n }", "private boolean shouldCheckForNotifications(Context context, SharedPreferences preferences) {\n AudioManager am = (AudioManager) context.getSystemService...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a predicate accepting only row results with row names less than or equal to the given page token (or greater than or equal if isReversed).
private Predicate<RowResult<Value>> getLimitingPredicate(final byte[] pageToken, final boolean isReversed, boolean moreAvailable) { if (!moreAvailable) { return Predicates.always...
[ "boolean ltExpr(InternalRow row, int ordinal);", "Page<Entity> page(BooleanExpression predicate, List<Order> orders, int page, int size);", "boolean hasSortlimit();", "boolean hasMoreByHeader();", "Condition lessThan(QueryParameter parameter, Object x);", "@Test\n \tpublic void whereClauseForNodeIsToken()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hook called on receipt of a EditorDocumentMutator. The event has been translated into a DocumentCommand which can now be manipulated by interested parties. By default, the hook forwards the command to the installed instances of AutoEditStrategy.
public void customizeDocumentCommand(DocumentCommand command) { // if (isIgnoringAutoEditStrategies()) // return; Document document = getDocument(); // if (fTabsToSpacesConverter != null) // fTabsToSpacesConverter.customizeDocumentCommand(document, command); Array<A...
[ "private void configureDocument() {\n\t\thandleEditorInputChanged();\n\t}", "@Override\n public void applied(final ICompletionProposal proposal) {\n if (!canReopenAssistantProgramatically) {\n return;\n }\n if (shouldActivateAssist(proposal)) {\n canReopenAssistantPro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determines the number of persons in the "decision making" household of type: drivingage student. returns the count, or 3, if count is 3 or more.
public int getDrivingAgeStudents() { Person[] p = hh.getPersons(); // get the count of persons of type: driving-age student; if more than // 3, // return 3. int count = 0; for (int i = 1; i < p.length; i++) { count += p[i].getPersonIsStudentDrivin...
[ "public int getNonDrivingAgeStudents()\n {\n Person[] p = hh.getPersons();\n\n // get the count of persons of type: non-driving-age student; if more\n // than 3,\n // return 3.\n int count = 0;\n for (int i = 1; i < p.length; i++)\n {\n count += p[i].ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the access control service is available. To be available, the following conditions must be verified : the Bean service is not null the pluginaccesscontrol must be enable
public boolean isAvailable( ) { return _bServiceAvailable && ( _provider != null ) && PluginService.isPluginEnable( "accesscontrol" ); }
[ "private boolean serviceAvailable() {\n if (service == null) {\n return false;\n }\n return service.isActive();\n }", "private boolean isAccess() {\n\t\treturn (getAccount().getAccess().isAtLeast(Account.Access.PRIVILEGED)\n \t\t\t\t&& !context.getServer().isLanMode());\n \t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the 'Theme' literal with the specified literal value.
public static Theme get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { Theme result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; }
[ "java.lang.String getTheme();", "String getTheme();", "public static Theme get(int value) {\n\t\tswitch (value) {\n\t\t\tcase STRUCTURE_VALUE: return STRUCTURE;\n\t\t\tcase NAMING_VALUE: return NAMING;\n\t\t\tcase REQUIREMENTS_VALUE: return REQUIREMENTS;\n\t\t\tcase FUNCTIONALITY_VALUE: return FUNCTIONALITY;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modiife la variable nbErreurs
public void setNbErreurs(int nbErreurs) { if (nbErreurs < 0) throw new IllegalArgumentException("Le nombre d'erreurs ne peut pas être négatif"); this.nbErreurs = nbErreurs; }
[ "private int nieuwRekeningNummer() {\r\n return volgnummer++;\r\n }", "public int nbLibres() {\n\t\tint libre = 0;\n\t\tfor(Borne b : bornes) {\n\t\t\tlibre += b.getEtatBorne();\n\t\t}\n\t\treturn libre;\n\t}", "public Integer cantidadCompras(){\n\t\t// Implementar\n\t\treturn this.compras.size();\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a Person equals another Person
@Override public boolean equals(Object other) { if (!(other instanceof Person)) { return false; } Person otherPerson = (Person) other; return otherPerson.forename.equals(forename) && otherPerson.sirname.equals(sirname) && otherPerson.birthDate.equals(birthDate); }
[ "public boolean equals( Object other){\n \tif( other instanceof Person){\n \t\treturn personId == ((Person)other).getPersonId();\n \t}\n \treturn false;\n }", "@Override\n public boolean equals(Object person) {\n if(!(person instanceof Person)){\n // If the argument is not a pe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ThroughputListener provides a notification mechanism from a ThroughputMonitor to an interested client. The details of the throughput are encapsulated in a ThroughputEvent.
public interface ThroughputListener { /** * Notification of the number of bytes transferred across the channel over * the last sample interval. * * @param event Event containing the throughput information. */ void currentThroughput(ThroughputEvent event); }
[ "public interface StatsListener extends ServiceListener\n{\n /**\n * Notification of data throughput in kilobytes per second.\n * \n * @param kbs Throughput per second.\n */\n void throughput(int kbs);\n}", "public void setThroughput(double throughput)\n {\n \tthis.throughput= throughp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes the checksum of a byte[] based on the IFI checksum. This is a one byte negative sum of all the packet contents (excluding escapes, and mod 256)
private static byte checksum(byte[] toChecksum) { byte result = 0; for(byte b : toChecksum) { result -= b; } return result; }
[ "java.lang.String getChecksum();", "private static long calculateChecksum(final byte[] array) {\n final long crc;\n\n if ((array != null) && (array.length > 0)) {\n final Checksum checksum = new CRC32();\n checksum.update(array, 0, array.length);\n\n crc = checksum.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getCarbsPerHundredGrams method, of class FoodBean.
@Test public void testGetCarbsPerHundredGrams() { System.out.println("getCarbsPerHundredGrams"); FoodBean instance = new FoodBean(5, "Beans on toast", Date.valueOf("2014-04-01"), Time.valueOf("10:00:00"), 100, 120, 5, 7, 500, 0, 3); double expResu...
[ "@Test\r\n public void testGetProteinPerHundredGrams()\r\n {\r\n System.out.println(\"getProteinPerHundredGrams\");\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set static field value
public abstract IReflector setStatic(Object value);
[ "public static void setStaticField(String clazz, String field, Object value)\n\t{\n\t\tsetStaticField(getClass(clazz), field, value);\n\t}", "public static void setNewStatic(String value) {\n }", "public static void setStaticField(Class<?> clazz, String field, Object value)\n\t{\n\t\tObjects.requireNonNu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines whether or not this policy has an open cancellation.
public boolean hasOpenCancellationJob() { return ((com.guidewire.pc.domain.policy.PolicyPublicMethods)__getDelegateManager().getImplementation("com.guidewire.pc.domain.policy.PolicyPublicMethods")).hasOpenCancellationJob(); }
[ "public boolean hasOpenCancellationJob() {\n return ((com.guidewire.pc.domain.policy.PolicyPublicMethods)__getDelegateManager().getImplementation(\"com.guidewire.pc.domain.policy.PolicyPublicMethods\")).hasOpenCancellationJob();\n }", "protected abstract boolean isCancelEnabled();", "public boolean isSetCan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select the next defined parameter (in namelexical order).
public void selectNextName() { SelectedSpatial spatial = cgm.getSpatial(); List<String> nameList = spatial.listMatParamNames("", WhichParams.Defined); if (isSelected() && !nameList.isEmpty()) { int numNames = nameList.size(); int index = nameList.ind...
[ "public Parameter readFirstParameter(String name) throws IOException {\r\n Parameter param = readNextParameter();\r\n Parameter result = null;\r\n \r\n while ((param != null) && (result == null)) {\r\n if (param.getName().equals(name)) {\r\n result = param;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }