query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Tests replacing a complex image.
@Test public void testComplex(){ List<Tone> palette = StandardPalettes.PWG_STANDARD; BufferedImage image = ImageFileUtils.loadImageResource("/sampleImages/complex/rooves.jpg"); PaletteReplacer replacer = new PaletteReplacer(); BufferedImage result = replacer.replace(image,...
[ "public void testRefreshImage()\n {\n Image orig = cover.getImage();\n cover.setType(GamePiece.O);\n cover.refreshImage();\n assertEquals(false, orig.equals(cover.getImage()));\n }", "public void testScaleTransparent() throws Exception {\n \n Simapi simapi = new Simapi();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Empresa__Group_7__0" $ANTLR start "rule__Empresa__Group_7__0__Impl" ../org.xtext.catalogo.ui/srcgen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:1145:1: rule__Empresa__Group_7__0__Impl : ( 'urlImagen' ) ;
public final void rule__Empresa__Group_7__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:1149:1: ( ( 'urlImagen' ) ) // ../org.xtext.ca...
[ "public final void rule__Empresa__Group_7__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:1179:1: ( ( ( rule__Empresa__UrlImagenAssignme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the faceLandmarks value.
public FaceLandmarks faceLandmarks() { return this.faceLandmarks; }
[ "private PointF getLandmarkPosition(Face face, int landmarkId) {\n for (Landmark landmark : face.getLandmarks()) {\n if (landmark.getType() == landmarkId) {\n return landmark.getPosition();\n }\n }\n\n PointF prop = mPreviousProportions.get(landmarkId);\n if (prop == null) {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a list of all the subscriber identifiers associated with the given SPID.
public static Collection<String> getSubscriberIdentifiers(final Context context, final CRMSpid spid) throws HomeException { return getSubscriberIdentifiers(context, spid.getId()); }
[ "public static Collection<String> getSubscriberIdentifiers(final Context context, final int spid)\r\n throws HomeException\r\n {\r\n final Collection<String> subscriberIdentifiers = new ArrayList<String>();\r\n\r\n final XDB xdb = (XDB) context.get(XDB.class);\r\n\r\n final XStatement...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a parabolic mask (intensity=x^2+x^y).
public static ImageProcessor makeParabolicMask(int width, int height) { double[] resPixels = new double[width*height]; int xc = width>>1; int yc = height>>1; for (int row = 0; row < height; row++) for (int col = 0; col < width; col++) resPixels[col+row*width] ...
[ "public static ImageProcessor makeInverseParabolicMask(int width, int height) {\n int size = width*height;\n double[] resPixels = new double[size];\n int xc = width>>1;\n int yc = height>>1;\n for (int row = 0; row < height; row++)\n for (int col = 0; col < width; col++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form FrmKashidashi
public FrmKashidashi() { initComponents(); }
[ "public frm_registro_admision_ingreso_registro() {\n }", "@RequestMapping(params = {\"create\", \"form\"}, produces = \"text/html\")\n public String createForm_new(Model uiModel) {\n \tpopulateEditForm(uiModel, new Flight());\n return \"flights/create_new\";\n }", "FORM createFORM();", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asigna el tipo de tarifario.
public void setTipoTarifario(final TipoTarifario tipoTarifario) { this.tipoTarifario = tipoTarifario; }
[ "public TipoTarifario getTipoTarifario() {\r\n\t\t\r\n\t\treturn (this.tipoTarifario);\r\n\t}", "public TipoJugador getTipo() {\n\t\treturn tipo;\n\n\t}", "public void setTipo(String tipo) {\r\n this.tipo = tipo;\r\n }", "public void setTipoArchivo(java.lang.String tipoArchivo) {\n this.tipoA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field params is set (has been assigned a value) and false otherwise
public boolean isSetParams() { return this.params != null; }
[ "public boolean isSetParams() {\n return this.params != null;\n }", "public boolean isSetParam() {\n return this.param != null;\n }", "public boolean isSetParam() {\n return this.param != null;\n }", "public boolean isSetParameters() {\n return this.parameters != null;\n }", "public bool...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trying to resolve keyStorePath if it's not defined according to the DEFAULT_KEYSTORE_TRUSTSTORE on NX environment it may look like: /home/mpastern/.ovirtsdk/ovirtsdkkeystore.truststore
private String resolveKeyStorePath() { if (this.keyStorePath == null) { String keyStorePathCandidate = System.getProperty("user.home") + File.separator + ".ovirtsdk" + File.separator + DEFAULT_KEYSTORE_TRUSTSTORE; ...
[ "String getKeystoreloc();", "public String getTrustStoreFile() { return this.getOrCreateGlobalProperty(PROP_NAME_JKSTRUST_STORE, \"\"); }", "public static void setUpAppKeystoreForTest() {\t\n System.setProperty(\"javax.net.ssl.trustStore\", KEYSTORE_PATH);\n System.setProperty(\"javax.net.ssl.trus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if all the items are locked on the current thread.
public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.get(t); if (!lock.isHeldByCurrentThread()) { return false; } } return true; }
[ "public boolean isLocked()\r\n\t{\r\n\t\tif (CollectionStatus.LOCK_TE.equals(status_) \r\n\t\t\t\t|| CollectionStatus.LOCK_RST.equals(status_)\r\n\t\t\t\t|| CollectionStatus.LOCK_CUSTOM.equals(status_))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "boolean isLocked();", "public final boolea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function returns the smallest possible cost to reach station N1 from station 0.
static int minCost(int cost[][], int destinationStation) { // dist[i] stores minimum cost to reach station i // from station 0. int minCost[] = new int[destinationStation]; Arrays.fill(minCost, Integer.MAX_VALUE); minCost[0] = 0; // Go through every station and...
[ "public int minCostClimbingStairs1(int[] cost) {\n int dp1 = 0; //f(n-1)\n int dp2 = 0; //f(n-2)\n\n //!!! <= !!!\n for (int i = 2; i <= cost.length; i++) {\n int dp = Math.min(dp1 + cost[i - 1], dp2 + cost[i - 2]);\n dp2 = dp1;\n dp1 = dp;\n }\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A boolean value that indicates if a calculated field is included in the topic.
public Boolean getIsIncludedInTopic() { return this.isIncludedInTopic; }
[ "boolean isCalculated();", "public Boolean isIncludedInTopic() {\n return this.isIncludedInTopic;\n }", "public boolean isCalculated() {\n return isCalculated;\n }", "public Boolean getIsCalculated() {\n return this.isCalculated;\n }", "public boolean getIsCalculatedValue()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the Object from the given ObjectInformation by calling the appropriate Strategy.
protected Object createObjectFromObjectInformation(ObjectInformation objectInformation) throws FillingException { AbstractCreatorStrategy strategy = getStrategyManager().getStrategyFor(objectInformation); return strategy.createObject(objectInformation); }
[ "protected abstract Object createObjectInternal(ObjectInformation objectInformation) throws FillingException;", "protected Creator getCreator(ObjectInformation objectInformation) {\n\n return getCreatorRegistry().getCreator(objectInformation.getClazz(), objectInformation.getField());\n }", "public Obj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct ApplicationPanel with a Model instance used for information.
public ApplicationPanel(Model m) { super(); this.model = m; initialize(); }
[ "public View(Application application, M model) {\n this.application = application;\n\n presenter = createPresenter(model);\n }", "protected IApplicationModel createModel() {\n \t\treturn new ApplicationModel();\n \t}", "public AppDetailsPanel() {\n initComponents();\n initialize()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clips the feature collection using the clippingFeature
private final void clipFeatureCollectionUsingClippingFeature( final FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollectionToClip, final CoordinateReferenceSystem featureToClipCrs, final SimpleFeature clippingFeature, final CoordinateReferenceSystem clippi...
[ "private void clipFeatureUsing(final SimpleFeature featureToClip,\n final CoordinateReferenceSystem featureToClipCrs,\n final Geometry clippingGeometryOnMap,\n final CoordinateRefere...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tell if the given path refers to a parent directory (e.g. contains ".." entries)
public static boolean isPathInParent(IPath path) { // first see if any segments are ".." at all for (int i = 0; i < path.segmentCount(); i++) { if (path.segment(i).equals("..")) { //$NON-NLS-1$ // comprehensive check, canonicalizing path = new Path(path.toString()); if (path.segmentCount() > 0 ...
[ "public boolean getParentDir() {\n\n if (currentDir.equals(\"/\"))\n return true;\n\n //Get the current folder's parent folder.\n File currentFolder = new File(currentDir);\n String parentFolder = \"\";\n try {\n parentFolder = currentFolder.getParentFile().g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the configuracion value for this ITarjetasTransaccion_400ConsultaTarjeta.
public org.datacontract.schemas._2004._07.TransActV4ConcentradorWS_TransActV4Concentrador.ITarjetasTransaccion_400Configuracion getConfiguracion() { return configuracion; }
[ "public es.gob.agenciatributaria.www2.static_files.common.internet.dep.aplicaciones.es.aeat.ssii.fact.ws.SuministroInformacion_xsd.ContraparteConsultaType getContraparte() {\r\n return contraparte;\r\n }", "public String getTransacaoUsuarioConsultar() {\n\t\treturn TRANSACAO_USUARIO_CONSULTAR;\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restrict the motion of the dragged child view along the vertical axis. The default implementation does not allow vertical motion; the extending class must override this method and provide the desired clamping.
public int clampViewPositionVertical(@NonNull View child, int top, int dy) { return 0; }
[ "@SuppressWarnings(\"unused\")\n public int getViewVerticalDragRange(@NonNull View child) {\n return 0;\n }", "private void clampVelocity() {\n\t\tif (Math.abs(velocity.x) > currentMaxVelocity)\r\n\t\t\tvelocity.x = Math.signum(velocity.x) * currentMaxVelocity;\r\n\t\t\r\n\t\t// clamp the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Init shared prefs with default values
private void initSharedPrefs() { // Add shared prefs init here }
[ "public void initializeSharedPrefs(){\n if(sharedPreferences==null){\n sharedPreferences = context.getSharedPreferences(Constants.PREFERENCE_FILE_NAME\n ,Context.MODE_PRIVATE);\n editor = sharedPreferences.edit();\n }\n }", "private void initSharedRefences...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interface for a writer which creates an Alluxio keyvalue partition.
public interface KeyValuePartitionWriter extends Closeable, Cancelable { /** * Factory for {@link KeyValuePartitionWriter}. */ class Factory { private Factory() {} // prevent instantiation /** * Factory method to create a {@link KeyValuePartitionWriter} instance that writes key-value * da...
[ "void write(@Nonnull Key key, @Nonnull Value value);", "E create(K key) throws CreateException;", "@SuppressWarnings(\"unchecked\")\n public void write(Object key, Object value, Schema keySchema, Schema valSchema, String baseOutputPath)\n throws IOException, InterruptedException {\n checkBaseOutputPath...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Treasure description for the spell. spellEnum = Value to associate. spellText = Clean text to associate. gold = Spell value, in gold, to associate. treasureDesc = Treasure description for the spell. actionButtonEnum = Associated action button enumeration value.
private SpellEnum(int spellEnum, String spellText, int gold, String treasureDesc, ActionButtonEnum actionButtonEnum) { // The constructor sets the values for each enumeration. this.spellEnum = spellEnum; this.spellText = spellText; this.gold = gold; ...
[ "public String getValue_TreasureDesc() \n {\n return treasureDesc;\n }", "private void getFormattedTreasuresDescription(StringBuilder string) {\n string.append(\"The treasure is: \");\n for (int i = 0; i < treasures.size(); i++) {\n if (treasures.get(i).getContain...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create budget with error handling
public void createBudget(View view) { if (String.valueOf(budgetName.getText()).equals("")) { new ToastMessages(this, "Must enter a budget name"); return; } else if (String.valueOf(budgetAmount.getText()).equals("")) { new ToastMessages(this, "Must enter a budget amoun...
[ "public Calc(Budget budget) {\n this.budget = budget;\n }", "@PostMapping(\"/budgets\")\n @Timed\n public ResponseEntity<Budget> createBudget(@RequestBody Budget budget) throws URISyntaxException {\n log.debug(\"REST request to save Budget : {}\", budget);\n if (budget.getId() != nul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves all the PatientState objects for a particular form that have been recorded since the provided Date.
public List<PatientState> getPatientsStates(Integer formId, Integer locationId, Date sinceDate, String reprintStateName);
[ "public synchronized Cursor allRecordsSince(long date) {\n return database.query(sourceName, fieldNames,\n \"date>\" + date, null,\n null, null, \"date ASC\", null);\n }", "public List<Diagnosis> retrieveDiagnosisByDate(Date date, int patientId) throws ApplicationException;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares two tasks by their completion status. Tasks that are unfinished come before tasks that are finished.
public int compare(Task lhs, Task rhs) { if (!lhs.isCompleted() && rhs.isCompleted()) return -1; else if (lhs.isCompleted() && !rhs.isCompleted()) return 1; else return 0; }
[ "@Override\n\tpublic int compare(T task1, T task2) {\n\t\tEasyDate due1 = task1.getDueDate();\n\t\tEasyDate due2 = task2.getDueDate();\n\t\tif ( due2.getYear() > due1.getYear() )\n\t\t\treturn 1;\n\t\tif ( due2.getYear() < due1.getYear() )\n\t\t\treturn -1;\n\t\tif ( due2.getMonth() > due1.getMonth() )\n\t\t\tretur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to get formatted armed forces branch
public static String toString(ArmedForces armedForces) { String parent; if (armedForces.getParent() != null){ parent = armedForces.getParent().getName(); } else parent = "Has no parent"; if (armedForces != null) return "Armed forces branch " + armedForces.getName(...
[ "public String getAbnormalBranchString() { return abnormalBranchStr; }", "public String toString(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif(isFlag()==true){\n\t\t\t\tif(isDownBlock()==true){\n\t\t\t\t\tsb.append(\"g\"); //use G represent the goal\n\t\t\t\t\t\t\t\t\t\t// if down block is a block use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "SW" $ANTLR start "LW"
public final void mLW() throws RecognitionException { try { int _type = LW; int _channel = DEFAULT_TOKEN_CHANNEL; // /home/benkio/workspace/LPeMC Lab // Project/src/firstVMProject/VM.g:107:5: ( 'lw' ) // /home/benkio/workspace/LPeMC Lab // Project/src/firstVMProject/VM.g:107:7: 'lw' ...
[ "public final EObject ruleSWRLOperator() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token otherlv_1=null;\n Token otherlv_3=null;\n Token otherlv_5=null;\n Token otherlv_7=null;\n EObject lv_rule_2_0 = null;\n\n EObject...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolve Wikipedia redirects in results Wikipedia uses inconsistent internal links, therefore, we need to check each result record for redirects, map redirects to their targets and sum up resulting duplicates.
public static DataSet<WikiSimResult> resolveRedirects(ExecutionEnvironment env, DataSet<WikiSimResult> wikiSimResults, String filename) { // fields int hash = 0; int pageA = 1; int pageB = 2; int redirectSource = 0; int redirectTarget = 1; DataSet<Tuple2<String, ...
[ "private void prefetchRedirects(List<Integer> widsToPrefetch)\n\t\t\tthrows IOException, ParserConfigurationException, SAXException, XPathExpressionException {\n\t\tif (widsToPrefetch.isEmpty())\n\t\t\treturn;\n\t\tString requestList = \"\";\n\t\tfor (int j = 0; j < widsToPrefetch.size(); j++)\n\t\t\trequestList +=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XAttributeType__Group_16__0" $ANTLR start "rule__XAttributeType__Group_16__0__Impl" ../org.eclipse.osee.framework.core.dsl.ui/srcgen/org/eclipse/osee/framework/core/dsl/ui/contentassist/antlr/internal/InternalOseeDsl.g:3945:1: rule__XAttributeType__Group_16__0__Impl : ( 'description' ) ;
public final void rule__XAttributeType__Group_16__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.eclipse.osee.framework.core.dsl.ui/src-gen/org/eclipse/osee/framework/core/dsl/ui/contentassist/antlr/internal/InternalOseeDsl.g:3949:1: ...
[ "public final void rule__XAttributeType__Group_2__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.osee.framework.core.dsl.ui/src-gen/org/eclipse/osee/framework/core/dsl/ui/contentassist/antlr/internal/InternalOseeDsl.g:365...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the total stones in the large pit.
public int getTotalStones() { return this.largePit.getNumberOfStones(); }
[ "int getNumberOfStonesLeftToPlace();", "public Integer getAmountOfStones() {\n return amountOfStones;\n }", "int getNumberOfStonesOnBoard();", "public void getRemainingStones() {\n int CountP1 = 0;\n int CountP2 = 0;\n for (int i = 0; i < P1_STORE_PIT; i++) {\n CountP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compiles/closes and shows this world in a window.
public void showWorld(int w,int h) { world.run(); frame.add("Center",world); frame.setSize(w,h); frame.validate(); //frame.pack(); do not do this! frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { stopWorld(); ...
[ "private void createInternalFrames() {\n\t\tworldWindow = new WorldWindow(world);\n\t\t((BasicInternalFrameUI) worldWindow.getUI()).setNorthPane(null);\n\t\tthis.add(worldWindow);\n\n\t\tworldWindow.show();\n\t\tworldWindow.setLocation(0, 0);\n\t\tworldWindow.setBorder(BorderFactory.createLineBorder(Color.WHITE, 5)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Linked to FirstStageScene2 onAction = "Ok" This grabs the text that's in the TextField and stored in location Then we open up the MainStageScene Where we display the weather information for the user
public void Ok(ActionEvent event) throws Exception{ locationTracker++; String location = locationTextField.getText(); mainController.setLocation(location); root = FXMLLoader.load(getClass().getResource("MainStageScene.fxml")); // This switches to the FirstStageScene2.fxml file stage = (Stage)((Node)event.ge...
[ "public void gotoReservaOneWay(){\n try {\n FXMLReservaOneWayController verReservaOW = (FXMLReservaOneWayController) replaceSceneContent(\"FXMLReservaOneWay.fxml\");\n verReservaOW.setApp(this);\n verReservaOW.setText(cityO, cityD, depDate);\n } catch (Exception ex) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ /Methods to list all active shares we can connect to /
List<BudaShare> getAllShares() { String msg = "<BUDA SOURCE='SHARE' CMD='ALLSHARES' HOST='" + host_id + "' />"; AllShares as = new AllShares(); mint_control.send(msg,as,MINT_MSG_ALL_REPLIES); Collection<Share> shs = as.waitForReply(500); if (shs == null || shs.size() == 0) return null; return new Ar...
[ "List<? extends ShareNetwork> list();", "@Test\n public void share() {\n System.out.println(Arrays.toString(client.getShares(0)));\n }", "public ShareResources shareResources() {\n return this.shares;\n }", "@Override\r\n public List<ResourceLinkShare> getShares(ResourceLink resourceLi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
view forms for supervisors
public List<TRForm> viewFormforSupervisors(int eid);
[ "public HarvesterAdminForm() {\n\n\t\tsetShSet(\"split\");\n\n\t\tprtln(\"HarvesterAdminForm() \");\n\n\t}", "@RequestMapping(\"/ShowForm\")\n\tpublic String showForm() {\n\t\treturn \"studentForm\";\n\t}", "public administrateur_super() {\n initComponents();\n }", "public Form getViewForm() throws ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the FontRender object that should be used to render for child classes
public FontRender getRenderFont() { return this.fontRender; }
[ "public FontRenderer getFontRenderer()\n {\n return this.textRenderer;\n }", "public FontRenderer getFontRenderer() {\n\t\treturn fontRenderer;\n\t}", "public RMFont getFont() { return getParent()!=null? getParent().getFont() : null; }", "public Object getFont()\n {\n return font;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of createMyDid method, of class CryptoService.
@Test public void testCreateMyDid() throws SodiumException { CryptoService instance = new CryptoService(); Pair<Did, Keys> result = instance.createMyDid(new MyDidInfo("NcYxiDXkpYi6ov5FcYDi1e", null)); assertEquals(result.first.did, "NcYxiDXkpYi6ov5FcYDi1e"); }
[ "@Test\r\n public void testCreateTheirDid() throws CryptoException {\r\n CryptoService instance = new CryptoService();\r\n String did = \"8wZcEriaNLNKtteJvx7f8i\";\r\n String verkey = \"5L2HBnzbu6Auh2pkDRbFt5f4prvgE2LzknkuYLsKkacp\";\r\n TheirDidInfo info = new TheirDidInfo(did, verke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get text size in pixel unit
public float getTextSizePx() { return mPaint.getTextSize(); }
[ "public double getTextSize ()\n {\n return textSize;\n }", "Size measureText(String text, double availWidth, double availHeight);", "public float getTextSize() {\n return mTextContainer.getTextSize();\n }", "public float getTextSize() {\n\t\treturn mTextSize;\n\t}", "public int getFon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the metadata for the specified class (if available).
protected abstract AbstractClassMetaData loadMetaDataForClass(Class c, ClassLoaderResolver clr);
[ "ClassMetadata getClassMetadata( String className , int dimensions , Provider<ClassLoader> classLoaderProvider );", "protected FileMetaData loadAnnotationsForClass(Class cls, ClassLoaderResolver clr, boolean register, boolean populate)\r\n {\r\n if (!allowAnnotations || cls.isAnnotation() || isClassWith...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for optional child SuperClassAccess
@SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); }
[ "public String getPublicSuperField();", "public java.lang.Object getSuperiorClassForClass() throws G2AccessException;", "protected int getSuperClassAccessOptChildPosition() {\n return 1;\n }", "public boolean hasSuperClassAccess() {\n\t\treturn getSuperClassAccessOpt().getNumChild() != 0;\n\t}", "@Overr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add tests for the getDailyAmount method to the overall test suite.
private void addTestSuiteFor$TestGetDailyAmount (junit.framework.TestSuite overallTestSuite$) { junit.framework.TestSuite methodTests$ = this.emptyTestSuiteFor("getDailyAmount"); try { org.jmlspecs.jmlunit.strategies.IndefiniteIterator receivers...
[ "@Test\n\tvoid testGetDailyBonus() {\n\t\tFarm testFarm = new Farm();\n\t\ttestFarm.setType(\"Plain\");\n\t\ttestFarm.getAnimals().addAnimal(testFarm.createAnimal(\"cow\"));\n\t\tDouble balance = testFarm.getBalance();\n\t\ttestFarm.getDailyBonus();\n\t\tassertEquals(testFarm.getBalance(), balance + 25.0 * (testFar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset command position to 1.
private void resetCommandPosition() { this.commandPosition = 0 - 1; }
[ "public void reset() {\n position = 0;\n }", "public synchronized void reset() {\n pos = mark;\n }", "@Override\n public void reset(){\n this.pos = this.mark;\n }", "public void resetPosition()\n {\n resetPosition(false);\n }", "public void resetMove() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
allow() returns when action is possible according to throttled/shaped speed
void allow();
[ "public void simpleThrottleAction() {\n cruise();\n dontHitVehicleInFront();\n dontEnterIntersection();\n }", "boolean getThrottled();", "void throttled(long inflight);", "public boolean allowedToMove() { //to slow down enemy movement\n if (allowedToMove == allowedToMoveMax) {\n al...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column st_device_info.accuracy
public Integer getAccuracy() { return accuracy; }
[ "public double accuracy() {\n return _info.getAccuracy();\n }", "public double getAccuracy() {\r\n return accuracy;\r\n }", "public float getAccuracy() {\n return accuracy;\n }", "public double getAccuracy() {\n return accuracy;\n }", "double getAccuracy();", "public doub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the StringTerm3 field.
void setStringTerm3(String value);
[ "void setChoiceTerm3(String value);", "public void setText3(String text3) {\n this.text3 = text3 == null ? null : text3.trim();\n }", "public Builder setC3(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an aliased provuser table reference
public Provuser(Name alias) { this(alias, PROVUSER); }
[ "private static TableRef createAliasedTableRef( final TableMeta table,\n final String alias ) {\n return new TableRef() {\n public String getColumnName( String rawName ) {\n return alias + \".\" + rawName;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an input string and replace all non alpha numeric characters with a given string.
public static String replaceNonAlphaNum(String inputStr, String replaceStr) { String output = inputStr.replaceAll("[^A-Za-z0-9 ]", replaceStr); // if the output string ends with a replace string, remove it if (output.endsWith(replaceStr)) { output = output.substring(0, output.length...
[ "public String stripNonAlphaNum(String in) {\r\n String out = \"\";\r\n if (in == null) {\r\n return \"\";\r\n }\r\n int l = in.length();\r\n for (int i = 0; i < l; i++) {\r\n char c = in.charAt(i);\r\n if ((c >= 'A' & c <= 'Z')\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the editor currently set to readOnly?.
public boolean isReadOnly() { return bjEditor.isReadOnly(); }
[ "public boolean isEditorEnabled() {\n return getState(false).editorEnabled;\n }", "public boolean isReadOnly() {\n\tif ( null == data ) return false;\n\treturn data.readOnly;\n }", "public boolean isIsReadOnly() {\r\n return isReadOnly;\r\n }", "public final boolean isReadOnly() {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsets the "BrandID" element
public void unsetBrandID() { synchronized (monitor()) { check_orphaned(); get_store().remove_element(BRANDID$4, 0); } }
[ "void unsetBrandID();", "void unsetBrandCode();", "public void unsetVendorId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(VENDORID$10, 0);\n }\n }", "public void xsetBrandID(org.apache.xmlbeans.XmlInt brandID)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Submit a Runnable to the main thread pool.
protected void submitJobMe(final Runnable r) { EvalTools.notNull(r, this); this.mainThreadPool.execute(r); }
[ "public static void submitToPool(Runnable r){\n\t\tworkerPool.submit(r);\n\t}", "public void submitToThreadPool(Runnable r) {\n\t\tif(!pool.isShutdown()) {\n\t\t\tpool.submit(r);\n\t\t}\n\t}", "public void submitJob(Runnable runnable) {\r\n if (runnable == null) {\r\n throw new IllegalArgument...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Closes all the producers in the pool
public void close() { synchronized (lock) { info("Closing all sync producers"); Iterator<SyncProducer> iter = syncProducers.values().iterator(); while (iter.hasNext()) iter.next().close(); } }
[ "public void close() {\n if (CollectionUtils.isEmpty(producers)) {\n return;\n }\n\n for (KafkaProducer<String, byte[]> producer : producers) {\n producer.close();\n }\n }", "public void closePool() {\n threadPool.destroy();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the getters of the Team class.
@Test public void testTeamGetters() throws DBAccessException, InvalidActionException, InvalidAccessException { setUp(); addUsers(2); Game g1 = Game.addGame("Test game", "Have fun", 2, Collections.singletonList(User.fromID(1)), 3, false); Game g2 = Game.addGame("Another test game", "Don’...
[ "public void testGetTeam() {\n\t\ttry {\n\t\t\tTeam result = test.getTeam(\"Team 1\");\n\t\t\tassertEquals(\"Team 1\", result.getTeamNumber());\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Exception\");\n\t\t}\n\t}", "@Test\n public void testGetPlayerTeam() {\n System.out.println(\"getPlayerTeam\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the icon that is shown in the title.
public Icon getTitleIcon(){ return station.getTitleIcon(); }
[ "java.lang.String getIcon();", "public String getIcon()\n\t\t{\n\t\t\treturn icon;\n\t\t}", "public String getIcon() {\r\n\t\treturn icon;\r\n\t}", "public String getIcon() {\n return icon;\n }", "Icon getIcon();", "public Icon getIcon();", "public String iconName() {\n\t\treturn getProducto()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the magnification spec for a window given its token. If the window has a compatibility scale it is also folded in the returned magnification spec.
MagnificationSpec getCompatibleMagnificationSpecForWindow(in IBinder windowToken);
[ "void setMagnificationSpec(in MagnificationSpec spec);", "public double getMagnification() {return magnification;}", "public float getMagnification() {\n \n return magnification;\n \n }", "public void setMagnification(float magnification) {\n \n this.magnification = magni...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hook method definition for whenever a vertex has been discovered
protected void vertexDiscovered(Vertex<String> vertex) { // add current vertex discovered to the hashmap discoveredVertices.put(vertex, discoveredCounter); discoveredCounter++; }
[ "public void visit(int vertex);", "public void visit(Object edge, Object vertex);", "public void vertexAdded(final GraphView<V, E>.VisualVertex vertex);", "void acquire(VertexDescriptor descriptor);", "Vertex findYourVertex(String vertexName);", "public void startVertex(int vertex);", "public interface ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if p, q, r are collinear.
static boolean collinear(PointDouble p, PointDouble q, PointDouble r) { return Math.abs(cross(vector(p, q), vector(p, r))) < EPS; }
[ "private static boolean isCollinear(Point[] points) {\n int num = points.length;\n if (num < 2)\n return true;\n else {\n double baseSlope = points[0].slopeTo(points[1]);\n for (int i = 2; i < num; i++) {\n if (baseSlope != points[0].slopeTo(point...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
bool isForceUpdate = 7;
boolean getIsForceUpdate();
[ "public boolean getIsForceUpdate() {\n return isForceUpdate_;\n }", "public boolean getIsForceUpdate() {\n return isForceUpdate_;\n }", "boolean getIsUpdate();", "boolean hasIsUpdate();", "@Override\n public boolean checkGlobalFlags(Update update) {\n return true;\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Waits for the element specified by the selector to become visible Note that waitForElementToAppear waits for the element to be present in the dom, visible or not. waitForVisible waits for an element that already exists in the dom to become visible.
protected final void waitForVisible(String selector) { waitForCondition(ExpectedConditions.visibilityOfElementLocated(convertLocator(selector))); }
[ "private void waitForElementVisible(By locator) {\r\n try {\r\n waitLong().until(new VisibilityOfElementByLocator(locator));\r\n } catch (Exception ignored) {\r\n }\r\n }", "public void waitUntilElementIsVisible() {\n WebDriverWait wait = new WebDriverWait(driver, 30);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates anim which method animate uses to animate the units
public void updateAnimation() { if (anim < 1000) { anim++; } else anim = 0; }
[ "public void update() {\n //conduct animate to change parameters of object and then update object\n if (gameTimer == null) {\n gameTimer = new GameClock();\n }\n time = (int)gameTimer.getElapsedTime();\n\n //need to switch tweenParam to apply transition\n for(Twe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Count down wait latch.
private void releaseWaitLatch() { waitLatch.countDown(); }
[ "public synchronized void countDown()\n {\n if (this.m_count > 0)\n {\n if (--this.m_count == 0)\n {\n notifyAll();\n }\n }\n }", "public void countDown() {\n\t\t// phaser.arriveAndDeregister();\n\t\tsynchronized (lock) {\n\t\t\tcounter--;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes an Identification message.
protected Identification makeIdentification() { return new Identification(getHost(), getAssignments()); }
[ "Ident createIdent();", "private static String generateMsgId() {\n\t\treturn UUID.randomUUID().toString();\n\t}", "public void makeAndSendAgentID(){\n sendID(id, x, y);\n }", "public void generateId()\n\t{\n\t\t// generate random id\n\t\tRandom rn = new Random(); // new random, seed to current time\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the task instances are the same, so the same task released on different days will get false
@Override public boolean equals(Object other) { // If the other one does not even exist, we are not the same - because we exist! if (other == null) { return false; } if (other instanceof GenericTask) { GenericTask otherGenericTask = (GenericTask) other; // If our values for title are different... ...
[ "private boolean checkIfSameDate(Task t) {\n if (t instanceof TimedTask) {\n TimedTask tt = (TimedTask) t;\n return tt.getDate().isEqual(date);\n }\n return false;\n }", "private boolean verifyTransientDate(TransientTask task) {\n for (int i = 0; i < transientT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a task that we are about to execute, let's tell the replicators to replicate the task's execution information so that the workflow is survivable.
private void replicate(Version theTask) { synchronized(_replicatorQueue) { for (int i = 0; i < _replicatorQueue.size(); i++) { ReplicatorHandle rh = (ReplicatorHandle) _replicatorQueue.get(i); rh.replicate(theTask, _replicatorQueue, this); } } }
[ "private void alertReplicatorsExecutingTask(Version theTask) {\n\tsynchronized(_replicatorQueue) {\n\t for (int i = 0; i < _replicatorQueue.size(); i++) {\n\t\tReplicatorHandle rh = (ReplicatorHandle) \n\t\t _replicatorQueue.get(i);\n\t\trh.alertExecutingTask(theTask, this);\n\t }\n\t}\t\n }", "privat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for constructing a simplicial complex in which the vertices and edges are set directly and the rest is inferred
public static SimplicialComplex getSimplicialComplexFromVerticesAndEdges( ArrayList<? extends Vector3D> vertices, ArrayList<? extends Edge> edges ) throws InconsistencyException { SimplicialComplex s = new SimplicialComplex(); s.setVertices(vertices); s.setEdges(edges); s.inferFacesFromEdges(); /...
[ "public SimplicialComplex()\n\tthrows InconsistencyException\n\t{\n\t\tthis(null, null, null, null);\n\t}", "Complex(){\r\n real = 1;\r\n imaginary = 1;\r\n }", "public Complex() {\n\t\tthis(0, 0);\n\t}", "public SimpleGraphView() {\n // Graph<V, E> where V is the type of the vertices ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Randomize the current matrix with user defined bounds
public void randomizeValues(double lowerBound, double upperBound) { Random r = new Random(); for (int i = 0; i < this.rowNum; i++) { for (int j = 0; j < this.colNum; j++) { this.matrix[i][j] = r.nextDouble() * upperBound - lowerBound; } } }
[ "@Test\n void randomMatrix05() {\n randomMatrix = Matrices.randomMatrix(ROWS, COLS);\n\n assertValuesBetweenMinAndMax(randomMatrix, 0, 1);\n }", "public void random() {\n Random ran = new Random(); \n\t\tfor (int i = 0; i < diag.length; i++) {\n\t\t\tdiag[i] = ran.nextDouble();\n\t\t}\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use Login_S.newBuilder() to construct.
private Login_S(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); }
[ "private Login_C(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private LoginRes(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private LoginReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the AirbornePositionMessage(String,int,int,long) constructor test.
@Test public void testAirbornePositionMessage_2() throws Exception { String binarySentence = "1000110101001100101000100101100001011000110000111000010000011001000001011111100101110011110110100111011011001001"; //binarySentence in object(substring(32)): 0101100011000011100001000001100100000101111110010111001111011...
[ "@Test\n\tpublic void testAirbornePositionMessage_1()\n\t\tthrows Exception {\n\t\tString jedisString = \"11;5022296;01011000110000111000010000011001000001011111100101110011110110100111011011001001;1432557564600\";\n\n\t\tAirbornePositionMessage result = new AirbornePositionMessage(jedisString);\n\n\t\t// add addit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove a set menu item and check that the set menu has no items
@Test public void testSetMenuFactoryRemoveSetMenuItem() { SetMenu setMenuController = setMenuFactory.getSetMenu(); Menu menuController = menuFactory.getMenu(); menuController.addMenuItem(MENU_NAME, MENU_PRICE, MENU_TYPE, MENU_DESCRIPTION); ArrayList<MenuItem> menuItems = new ArrayLis...
[ "public void clearItems() {\n menu.clearItems();\n }", "void removeMenuItem(int itemId, String itemName);", "public void clear() {\r\n menuItems.clear();\r\n }", "public void removeMenu() {\n\t\tint leave = 1;\n\t\twhile(leave == 1) {\n\t\t\ta_view.displayRemoveMenu();\n\t\t\tchar[] removeMenuOp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
opens the network listener, sends attend event to other nodes and gets initial state from other nodes
public void open() { if (this.netWorkListener != null && this.netWorkListener.isRunning()) { throw new IllegalStateException("Network Manager is already opened"); } logger.info("network listener is starting"); EventListener eventListener = new EventListenerImpl(this.distrib...
[ "public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all users with the given username.
public void removeUser(String username) { Iterator<User> current = users.iterator(); while(current.hasNext()) { User currentUser = current.next(); if(currentUser.getUsername() == username) { current.remove(); } } }
[ "public void removeUser(String username) {\n userList.remove(username);\n }", "public void removeUser(String username);", "void userRemoved(String username) throws IOException {\n\t\tfor (String repName : getRepositoryNames()) {\n\t\t\tgetRepository(repName).removeUser(username);\n\t\t}\n\t}", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the 'field668' field.
public void setField668(java.lang.CharSequence value) { this.field668 = value; }
[ "public com.maxpoint.cascading.avro.TestExtraLarge.Builder setField668(java.lang.CharSequence value) {\n validate(fields()[668], value);\n this.field668 = value;\n fieldSetFlags()[668] = true;\n return this; \n }", "public void setField667(java.lang.CharSequence value) {\n this.field667 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setter for ICD10DC_List sets
public void setICD10DC_List(NonEmptyFSList v) { if (ICD10DCGROUP_Type.featOkTst && ((ICD10DCGROUP_Type)jcasType).casFeat_ICD10DC_List == null) jcasType.jcas.throwFeatMissing("ICD10DC_List", "edu.cmu.lti.uima.types.ICD10DCGROUP"); jcasType.ll_cas.ll_setRefValue(addr, ((ICD10DCGROUP_Type)jcasType).casFeatCo...
[ "public void setList(DList2 list1){\r\n list = list1;\r\n }", "protected void setDatacenterIdsList(List<Integer> datacenterIdsList) {\nthis.datacenterIdsList = datacenterIdsList;\n}", "protected void setDatacenterIdsList(List<Integer> datacenterIdsList) {\n\t\tthis.datacenterIdsList = datacenterIdsList;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Activation du bluetooth directement si possible
void activateBlue(BluetoothAdapter bluetoothAdapter){ if (!bluetoothAdapter.isEnabled()) { Intent enableBlueTooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBlueTooth, REQUEST_CODE_ENABLE_BLUETOOTH); } }
[ "private void checkBluetooth() {\n\t\t// Get local Bluetooth adapter\n\t\tmBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n\t\t// If the adapter is null, then Bluetooth is not supported\n\t\tif (mBluetoothAdapter == null) {\n\t\t\tToast.makeText(this, \"Bluetooth is not available\", Toast.LENGTH_LONG).s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an ControllerLayer.OrganizerSystem object and sets its variables am, es, om, and sm to the ones passed in the constructor.
public OrganizerSystem(AttendeeManager am, EventScheduler es, OrganizerManager om, SpeakerManager sm, VipManager vm){ this.am = am; this.es = es; this.om = om; this.sm = sm; this.vm = vm; }
[ "private EntityManager initSystems() {\n CameraSystem cameraSystem = new CameraSystem(Constants.WINDOW_WIDTH, Constants.WINDOW_HEIGHT);\n addSystem(cameraSystem);\n addSystem(new ZoomSystem());\n //Physics System\n addSystem(new PhysicsSystem());\n //Player movement system\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a dinosaur object to the ArrayList
public static void addDinosaur(Dinosaur dinosaur) { dinosaurs.add(dinosaur); }
[ "public void addAnimal(Animal a) {\r\n animalList.add(a);\r\n }", "private void addDog() {\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tString numID = id.get(i);\n\t\t\tString name = names.get(i);\n\t\t\tString breed = breeds.get(i);\n\t\t\tString dateBirth = date.get(i+1);\n\t\t\tString img = dogImg.get(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the human readable description of this filter. For example: "JPEG and GIF Image Files (.jpg, .gif)"
@Override public String getDescription() { if(fullDescription == null) { if(description == null || isExtensionListInDescription()) { fullDescription = description==null ? "(" : description + " ("; // build the description from the exten...
[ "public String getDescription() {\r\n return filterDesc;\r\n }", "public String getDescription()\r\n {\r\n return descriptionFilter;\r\n }", "java.lang.String getDescription();", "@Override\n\tpublic String toString() {\n\t\treturn \"filter for \" + this.describe();\n\t}", "@O...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine the max afs file size for the system we are running on
public static synchronized long getMaxAfsFileSize() throws IcofException { long maxSize = Constants.MAX_FILE_SIZE_AFS; if (isAfsLfe()) { maxSize = Constants.MAX_FILE_SIZE_AFS_LFE; } return maxSize; }
[ "public long getMaxFileSize();", "public static int getMaximumFilesize() {\n\ttry {\n\t return Integer.parseInt(\n\t\t properties.getProperty(\"situationHandler.network.MaximumFileSize\")) * 1_000_000;\n\t} catch (NumberFormatException e) {\n\t return 15_000_000;\n\t}\n }", "public static int getMax...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
@ServiceMethod(returns = ReturnType.SINGLE) void reimage( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, Context context);
[ "@ServiceMethod(returns = ReturnType.SINGLE)\n void reimage(String resourceGroupName, String vmScaleSetName, String instanceId);", "@ServiceMethod(returns = ReturnType.SINGLE)\n void reimage(\n String resourceGroupName,\n String vmScaleSetName,\n String instanceId,\n VirtualMachi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Agrega un profesor a la lista de profesores. pre: El profesor no existe en la lista de profesores. post: Se agrega un profesor a la lista de profesores.
public void addProfesor(Profesor profesor) { assert !profesores.contains(profesor) : "El profesor ya existe en la lista de profesores."; profesores.add(profesor); assert profesores.contains(profesor) : "El profesor no fue agregado a la lista de profesores."; verificarInvariante(); }
[ "public void setProfesores(ArrayList<Profesor> profesores) {\n this.profesores = profesores;\n verificarInvariante();\n }", "public boolean agregarProfesor(Curso curso,Grupo grupo){\n \n if(miCurso.equals(curso)){\n System.out.println(\"ya esta ese curso\");\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scale the generated image and add it to the print preview pane.
private void addPage( final Image pageImage, final JPanel target ) { // Create a component representing the scaled page preview image. JPanel panel = new JPanel() { private Image scaled = null; private Dimension dim = new Dimension(); /** Return preview ...
[ "public void printImage() {\r\n final String jobtitle = \"Printing Image\";\r\n\r\n final PrintJob prtJob = getToolkit().getPrintJob(this, jobtitle, null);\r\n\r\n if (prtJob != null) {\r\n final Graphics pGraphics = prtJob.getGraphics();\r\n\r\n if (pGraphics != null) {\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set distance mode to Short, Medium, or Long based on VL53L1_SetDistanceMode()
boolean setDistanceMode(DistanceMode mode) { // save existing timing budget int budget_us = getMeasurementTimingBudgetNew(); switch (mode) { case Short: // from VL53L1_preset_mode_standard_ranging_short_range() // timing config writeR...
[ "public void setDistanceFunction(DistanceFunction distanceFunction);", "public void changeDistance(String distance) {\n getSettings().setDistance(distance);\n Log.d(TAG,\"Changing the distance search: \" + distance);\n }", "public void setDistance(int distance);", "public void setDistance(dou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GWT 1.4's Math class does not include JDK's Math.log10so emulate it.
private static double log10(double x) { return Math.log(x)/Math.log(10.0); }
[ "public static double log10(double value) {\n \t return (0.4342944819 * java.lang.Math.log(value));\n \t // If you want to get rid of the constant:\n \t // return ((1.0f / Math.log(10.0f)) * Math.log(value));\n }", "public static native double logAbs(double x) ;", "double log(double a, double base){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void setSIM(java.lang.String) Sets the value of field 'voucherNo'.
public void setVoucherNo(java.lang.String voucherNo) { this._voucherNo = voucherNo; }
[ "public void setSIM(java.lang.String SIM)\r\n {\r\n this._SIM = SIM;\r\n }", "public void setVOUCHER_NO(String VOUCHER_NO) {\n this.VOUCHER_NO = VOUCHER_NO == null ? null : VOUCHER_NO.trim();\n }", "void setInvoiceNo(java.lang.String invoiceNo);", "public void setSVC_SNO(String sVC_SNO)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function get all the matched HTML content items matching with the input string value
public Iterator<LineDetail> getAllMatches(String strHTMLPath) { ArrayList<LineDetail> lines = new ArrayList<LineDetail>(); LineReader reader = new LineReader(strFlatHTMLPath); reader.open(); String strLine = ""; String strCurrentHTMLPath = ""; for(long i = 0; ; i++){ strLine = reader.readNext...
[ "public List<WebElement> locateElements(String type, String value);", "private static Set<String> scrapeHTML(String html) {\n\t\tSet<String> set = new HashSet<String>();\n\t\tint skipLength = 0;\n\t\tint counter = 0;\n\t\t// the subtraction of 15 is because of the number of characters in \n\t\t// \"<a href=\\\"/w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare two key objects: aKey1 with aKey2.
public int compare(final IKey aKey1, final IKey aKey2);
[ "public int compare(final Object aKey1, final Object aKey2);", "protected abstract boolean equalityTest(Object key, Object key2);", "public static boolean compareKeys(Object[] key1, Object[] key2)\n {\n boolean same = true;\n if (key1.length == key2.length)\n {\n for (int i = 0; i < key1.length; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make sure you know what you're doing if you this method instead of the simpler version. If you set updateListRender to false, you will have to perform the rendering of the underlying object to strings yourself. Normally this is handled for you.
public void setRenderer(StringRenderer objectRenderer, boolean updateListRenderer) { this.objectRenderer = objectRenderer; model.setRenderer(objectRenderer); list.setCellRenderer(UIUtilities.createListCellRenderer(objectRenderer)); }
[ "protected abstract void updateList();", "private void updateListSelection() {\n if (list.getModel().getSize() > 0) {\n name.setEnabled(true);\n nameLabel.setEnabled(true);\n name.setText(((IListManagerObject)list.getSelectedValue()).getDescription());\n removeButton.setEnabled(true);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a Row for Test Count text
public void createResultsCountAndStyle(int passCount, int failCount, XSSFSheet sheet, XSSFWorkbook book) throws IOException { XSSFRow row = sheet.createRow(1); XSSFCell testCount= row.createCell(1); XSSFCell testCount1= row.createCell(2); testCount.setCellValue("Test Count"); // Merge the two columns shee...
[ "private void createTotalTestCase(BufferedWriter writer) throws IOException {\r\n\t\tString parent = \"<label style='margin-top: 8px;position: absolute;'>\";\r\n\t\tString content = \"<span style='display: inline;color: #000000;margin-left: 8px;font-weight: bold;font-family: Roboto, sans-serif;'>Total TestCases</sp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the maximum size of SPARQL GET requests.
public Integer getMaxGetRequestSize() { return maxGetRequestSize; }
[ "long getMaxResultSize();", "int getFetchSize();", "public Integer getMaxPageSize();", "public long getMaxResultSize() {\n return maxResultSize_;\n }", "public int getMaxResponseSize() {\n return maxResponseSize;\n }", "public long getMaxResultSize() {\n return maxResultSize_;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new plugin manager.
public PluginManager( Path pluginDir ) { this.pluginDirectory = pluginDir; pluginMonitor = new PluginMonitor( this ); }
[ "public static PluginManager getInstance() {\n\t\tif (pm == null) {\n\t\t\tpm = new PluginManager();\n\t\t}\n\t\treturn pm;\n\t}", "public Plugin() {}", "public static PluginManager getManager() {\n if (mainManager==null) mainManager=new PluginManager();\n return mainManager;\n }", "public De...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tries to find an encoder for the given MIMEType
public Encoder getEncoderFor(String contentType) { Supplier<Encoder> factory = encoderFactories.get(contentType); if (factory == null) { return null; } return factory.get(); }
[ "public static CodecInfo getCodecForType(String mimeType, boolean isEncoder)\n {\n for(CodecInfo codec : codecs)\n {\n if( !codec.isBanned()\n && codec.mediaType.equals(mimeType)\n && codec.codecInfo.isEncoder() == isEncoder )\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the senderCountry value for this FormFreeTransactionInfo.
public java.lang.String getSenderCountry() { return senderCountry; }
[ "public java.lang.String getOriginatingCountry() {\r\n return originatingCountry;\r\n }", "public java.lang.String getReceiverCountry() {\r\n return receiverCountry;\r\n }", "@ApiModelProperty(value = \"If the transaction is a money transfer and cross-border or U.S. domestic, this field must...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the recent chat msg type.
public void setRecentChatMsgType(String recentChatMsgType) { this.recentChatMsgType = recentChatMsgType; }
[ "public void setRecentChatType(String recentChatType) {\n this.recentChatType = recentChatType;\n }", "public String getRecentChatType() {\n return recentChatType;\n }", "public void setMsgType(MsgType msgType) {\n this.msgType = msgType;\n }", "public int getChatType() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all text objects in the model.
public ArrayList<BText> getTexts() { return texts; }
[ "@Override\n public List<TextDAO> findAllText() {\n return textRepository.findAll();\n }", "public ArrayList<TextObject> getTextObjects() {\n ArrayList<TextObject> narrations = new ArrayList<>();\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n Narration narrati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will unit test addDccAnnotationToXml() or addDccAnnotationToJson(), depending on the given ReturnType with the following preconditions: diseaseAsString has an Id match itemTypeAsString has no match
private void testAddDccAnnotationItemTypeNoMatch(final WebServiceUtil.ReturnType returnType) { testAddDccAnnotationItemTypeNoMatch(returnType, "ItemTypeName4", "<p>Item type 'ItemTypeName4' does not exist.<br/>"); }
[ "private void testAddDccAnnotation(final WebServiceUtil.ReturnType returnType)\n throws AnnotationQueries.AnnotationQueriesException, BeanException {\n\n // Expected Annotation values\n final String expectedAnnotationId = \"1\";\n final String expectedDiseaseAsString = \"1\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.teledon.client.TeledonResponse.Type type = 1;
public Builder setType(teledon.network.protobuffprotocol.TeledonProtobufs.TeledonResponse.Type value) { if (value == null) { throw new NullPointerException(); } type_ = value.getNumber(); onChanged(); return this; ...
[ "teledon.network.protobuffprotocol.TeledonProtobufs.TeledonResponse.Type getType();", "teledon.network.protobuffprotocol.TeledonProtobufs.TeledonRequest.Type getType();", "public teledon.network.protobuffprotocol.TeledonProtobufs.TeledonResponse.Type getType() {\n teledon.network.protobuffprotocol.Te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs the object. Sets the reference to the master entry record file and instantiates the ConfigManager.
public Importer() { System.out.println("Importer initialized."); System.out.println("Accessing master entry record..."); this.setMasterFile(new File("data/master.csv")); System.out.println("Parsing configuration files..."); this.configManager = new ConfigManager(); }
[ "public Config(){\n loadProperties(PROPERTIESFILES);\n }", "public ConfigManager() {\n\t\ttry {\n\t\t\tlog.info(\"Cargando fichero de propiedades de aplicacion\");\n\t\t\tapp_properties = new Properties();\n\t\t\tInputStream is = this.getClass().getResourceAsStream(FILE_PROPERTIES);\n\t\t\tif (is != nul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the value of the menu.grupo column for the specified row.
public String getMenuGrupo(int row) throws DataStoreException { return getString(row, MENU_GRUPO); }
[ "public void setMenuGrupo(int row, String newValue) throws DataStoreException {\r\n\t\tsetString(row, MENU_GRUPO, newValue);\r\n\t}", "public String getMenuNombre(int row) throws DataStoreException {\r\n\t\treturn getString(row, MENU_NOMBRE);\r\n\t}", "public String getMenuGrupo() throws DataStoreException {\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resume automatic tapping, if it was setup.
public void resumeAutomaticTapping(){ if (this.autoTap && this.autoTapPaused) { autoTapTimer.start(); this.autoTapPaused = false; } }
[ "public void pauseAutomaticTapping() {\n\t\tthis.autoTapPaused = true;\n\t\tif (autoTapTimer != null) {\n\t\t\tautoTapTimer.stop();\n\t\t}\n\t}", "public void tap() {\n\t\ttapped = true;\n\t}", "public void untap() {\n\t\ttapped = false;\n\t}", "public synchronized void tap() {\r\n this.press();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a validator for registered constraint links.
public RegisteredConstraintLinkValidator() { setDomainID(RegisteredConstraintLinkValidator.class.getName()); }
[ "Validator createValidator();", "private CONSTRAINTREF(Builder builder) {\n super(builder);\n }", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "Constraint createConstraint();", "protected Validator createValidator() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR start "entryRuleMachine" ../ac.soton.xtext.machineDsl/srcgen/ac/soton/xtext/parser/antlr/internal/InternalMachineDsl.g:68:1: entryRuleMachine returns [EObject current=null] : iv_ruleMachine= ruleMachine EOF ;
public final EObject entryRuleMachine() throws RecognitionException { EObject current = null; EObject iv_ruleMachine = null; try { // ../ac.soton.xtext.machineDsl/src-gen/ac/soton/xtext/parser/antlr/internal/InternalMachineDsl.g:69:2: (iv_ruleMachine= ruleMachine EOF ) ...
[ "public final EObject entryRuleMachine() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleMachine = null;\n\n\n try {\n // InternalStl.g:783:48: (iv_ruleMachine= ruleMachine EOF )\n // InternalStl.g:784:2: iv_ruleMachine= ruleMachine EOF\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Delete option set of a car
public void deleteOptionSet(String makeModel, String optionSet) { String sql = "DELETE FROM "+d.getTableNameProperties()+ " WHERE MAKE_MODEL = '"+makeModel+ "' AND OPTION_SET_NAME = '"+optionSet+"'"; try { d.executeUpdate(d.getConn(), sql); } catch (SQLException e) ...
[ "public void deleteOptsetByName(String name) {\n int index = findIndexOfOptset(name);\n if (index != -1) {\n this.optionSet.remove(index);\n } else {\n System.out.println(\"The optionset named \" + name + \" no exists !!!\");\n }\n }", "public void deleteOptio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter function to set the mood list
public void setMoodList(ArrayList<Mood> moodList) { this.moodList = moodList; }
[ "public void setMood(String mood) {\n this.mood = mood;\n }", "public boolean setMood(int mood) {\n\t\tif (mood > maxMoodIndex || mood <0){\n\t\t\tmood_index = 0;\n\t\t\treturn false;\n\t\t}else{\n\t\t\tmood_index = mood;\n\t\t\treturn true;\n\t\t}\n\t}", "public void setSmellList(String list);", "@...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }