code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java public static GlClient createStrict() throws IOException { Injector injector = Guice.createInjector(getLocalStrictImgtHlaModules()); Nomenclature nomenclature = injector.getInstance(Nomenclature.class); nomenclature.load(); return ...
Create a Java method that does the following: "Create a Strict GlClient instance.".
Of course, here is the Java code you requested: ```java public static Date getDateOfYearsBack(final int yearsBack, final Date date) { return dateBack(Calendar.YEAR, yearsBack, date); } ``` Hope this helps!
Create a Java method that does the following: "Gets date years back.".
Of course, here is the Java code you requested: ```java public void executeListIndepActions() { if (getList().getMetadata().getItemDetailDefinition(getParamListAction()) != null) { // toggle item details getList().getMetadata().toogleDetailState(getParamListAction()); // la...
Create a Java method that does the following: "List Indep Actions".
Of course, here is the Java code you requested: ```java boolean recoverLease(final DistributedFileSystem dfs, final int nbAttempt, final Path p, final long startWaiting) throws FileNotFoundException { boolean recovered = false; try { recovered = dfs.recoverLease(p); LOG.i...
Create a Java method that does the following: "recoverLease - Recover the lease.".
Of course, here is the Java code you requested: ```java public static <IN, OUT> FluxProcessor<IN, OUT> wrap(final Subscriber<IN> upstream, final Publisher<OUT> downstream) { return new DelegateProcessor<>(downstream, upstream); } ``` Hope this helps!
Create a Java method that does the following: "Wrap a subscriber and a publisher.".
Of course, here is the Java code you requested: ```java static Object doubleBinaryOperation(double lhs, double rhs, int kind) throws UtilEvalError { switch(kind) { // arithmetic case PLUS: if ( lhs > 0d && (Double.MAX_VALUE - lhs) < rhs ) ...
Create a Java method that does the following: "This method is a binary operation of two double values.".
Of course, here is the Java code you requested: ```java private static void setContentTypeHeader(HttpResponse response, File file) { MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap(); response.headers().set(HttpHeaderNames.CONTENT_TYPE, mimeTypesMap.getContentType(file.getPath())); } `...
Create a Java method that does the following: "Sets the content type header.".
Of course, here is the Java code you requested: ```java public static void transform(InputStream css, OutputStream stylerSetup, boolean validate) throws ClassNotFoundException, IllegalAccessException, InstantiationException, CSSException, IOException { // find and use a SAC parser and document handler Stri...
Create a Java method that does the following: "Transform a CSS document into a CSS stylesheet.".
Of course, here is the Java code you requested: ```java public static IntComparator rowComparator(Column<?> column, Sort.Order order) { IntComparator rowComparator = column.rowComparator(); if (order == Sort.Order.DESCEND) { return ReversingIntComparator.reverse(rowComparator); } el...
Create a Java method that does the following: "Get the row comparator.".
Of course, here is the Java code you requested: ```java public static appfwprofile_stats get(nitro_service service, String name) throws Exception{ appfwprofile_stats obj = new appfwprofile_stats(); obj.set_name(name); appfwprofile_stats response = (appfwprofile_stats) obj.stat_resource(service); return respons...
Create a Java method that does the following: "Use this API to fetch statistics of appfwprofile_stats resource of given name.".
Of course, here is the Java code you requested: ```java private static Map<Circuit, Collection<TileRef>> getCircuits(MapTile map) { final MapTileGroup mapGroup = map.getFeature(MapTileGroup.class); final Map<Circuit, Collection<TileRef>> circuits = new HashMap<>(); final MapCircuitExtra...
Create a Java method that does the following: "Gets the circuits and tile references from the map.".
Of course, here is the Java code you requested: ```java @Override public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { RandomVariable values = new RandomVariableFromDoubleArray(0.0); for(int productIndex = 0; productIndex < products.length...
Create a Java method that does the following: "This method returns the value of the CnCDF random variable.".
Of course, here is the Java code you requested: ```java @Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WHeading heading = (WHeading) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:heading"); xml.appendAttribute("id", c...
Create a Java method that does the following: "Renders the given WHeading.".
Of course, here is the Java code you requested: ```java protected Element cloneForPlaceholder(CmsListItem listItem) { Element clone = CmsDomUtil.clone(listItem.getElement()); clone.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragPlaceholder()); // remove hoverbar List<Elemen...
Create a Java method that does the following: "Clones the given listItem for placeholder.".
Of course, here is the Java code you requested: ```java public GeneratedValue<Id<T>> getOrCreateGeneratedValue() { Node node = childNode.getOrCreate("generated-value"); GeneratedValue<Id<T>> generatedValue = new GeneratedValueImpl<Id<T>>(this, "generated-value", childNode, node); return generatedV...
Create a Java method that does the following: "Get the GeneratedValue object from the Node.".
Of course, here is the Java code you requested: ```java public static MozuUrl updateProductVariationLocalizedDeltaPriceUrl(String currencyCode, String productCode, String responseFields, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations...
Create a Java method that does the following: "Get Resource Url for UpdateProductVariationLocalizedDeltaPrice".
Of course, here is the Java code you requested: ```java public Object getStartIcon() { Object iconStart = null; Record recCalendarCategory = ((ReferenceField)this.getField(CalendarEntry.CALENDAR_CATEGORY_ID)).getReference(); if ((recCalendarCategory == null) || (recCalendarCategory.getEditM...
Create a Java method that does the following: "Get the start icon for this SETTINGS.".
Of course, here is the Java code you requested: ```java public static boolean containsAtLeastOneNonBlank(List<String> list){ for(String str : list){ if(StringUtils.isNotBlank(str)){ return true; } } return false; } ``` Hope this helps!
Create a Java method that does the following: "Checks if a list contains at least one non blank string.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "usesCS") public JAXBElement<CoordinateSystemRefType> createUsesCS(CoordinateSystemRefType value) { return new JAXBElement<CoordinateSystemRefType>(_UsesCS_QNAME, CoordinateSystemRefType...
Create a Java method that does the following: "Create an instance of the CoordinateSystemRefType class in the CRS specification.".
Of course, here is the Java code you requested: ```java public static Matcher<Long> closeTo(Long operand, Long error) { return new LongCloseTo(operand, error); } ``` Hope this helps!
Create a Java method that does the following: "Create a matcher that matches when the given value is closed to the given value.".
Of course, here is the Java code you requested: ```java public void setAttributes(java.util.Collection<String> attributes) { if (attributes == null) { this.attributes = null; return; } this.attributes = new java.util.ArrayList<String>(attributes); } ``` Hope this h...
Create a Java method that does the following: "Sets the value of the attributes property.".
Of course, here is the Java code you requested: ```java public boolean copyToScan(UpdateScan s) { if (!this.next()) return false; s.insert(); for (String fldName : sch.fields()) { s.setVal(fldName, this.getVal(fldName)); } return true; } ``` Hope this helps!
Create a Java method that does the following: "Copy the contents of this UpdateScan to another UpdateScan.".
Of course, here is the Java code you requested: ```java public static String getPath(String uriStr) { URI uri = null; try { uri = new URI(uriStr); } catch (URISyntaxException e) { throw new UtilException(e); } return uri.getPath(); } ``` Hope this helps!
Create a Java method that does the following: "Returns the path of the given URI.".
Of course, here is the Java code you requested: ```java public void beginStart(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { beginStartWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().single().body(); } ``` Hope this...
Create a Java method that does the following: "Creates a new CDN image.".
Of course, here is the Java code you requested: ```java public void skipUntil(final TokenType... tokenTypes) { Set<TokenType> tokenTypeSet = Sets.newHashSet(tokenTypes); tokenTypeSet.add(Assist.END); while (!tokenTypeSet.contains(lexer.getCurrentToken().getType())) { lexer.nextToken...
Create a Java method that does the following: "Skip until one of the given token types is found.".
Of course, here is the Java code you requested: ```java public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception { Class<?> cls = getClass(className); ArrayList<Object> newArgs = new ArrayList<>(); newArgs.add(pluginArgs); ...
Create a Java method that does the following: "Call a function on a class.".
Of course, here is the Java code you requested: ```java public ProcessesXmlParse createParse() { ProcessesXmlParse processesXmlParse = new ProcessesXmlParse(this); processesXmlParse.setSchemaResource(ReflectUtil.getResourceUrlAsString(PROCESS_APPLICATION_XSD)); return processesXmlParse; } ``` Hope this ...
Create a Java method that does the following: "Create a new ProcessesXmlParse object.".
Of course, here is the Java code you requested: ```java public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, boolean isToCamelCase, CopyOptions copyOptions) { if (MapUtil.isEmpty(map)) { return bean; } if (isToCamelCase) { map = MapUtil.toCamelCaseMap(map); } return BeanCopier.create(map, ...
Create a Java method that does the following: "Fill a bean with a map.".
Of course, here is the Java code you requested: ```java @NonNull public ObservableDataBuilder<T> loading(@Nullable Observable<Boolean> loading) { mLoading = loading; return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the loading flag.".
Of course, here is the Java code you requested: ```java public static base_responses add(nitro_service client, snmptrap resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { snmptrap addresources[] = new snmptrap[resources.length]; for (int i=0;i<resou...
Create a Java method that does the following: "Use this API to add snmptrap resources.".
Of course, here is the Java code you requested: ```java void createTotalSpecifications(final File dir, final String packageDirectory) throws MojoExecutionException { if (dir.equals(null)) { throw new MojoExecutionException("Could not read from directory " + dir.getPath()); } final ...
Create a Java method that does the following: "Creates the total specifications for a directory.".
Of course, here is the Java code you requested: ```java public Vector3fc dir(float x, float y, Vector3f dir) { float y1x = nxnyX + (nxpyX - nxnyX) * y; float y1y = nxnyY + (nxpyY - nxnyY) * y; float y1z = nxnyZ + (nxpyZ - nxnyZ) * y; float y2x = pxnyX + (pxpyX - pxnyX) * y; floa...
Create a Java method that does the following: "Compute the direction of the image at x y.".
Of course, here is the Java code you requested: ```java @Override public GetResourceShareInvitationsResult getResourceShareInvitations(GetResourceShareInvitationsRequest request) { request = beforeClientExecution(request); return executeGetResourceShareInvitations(request); } ``` Hope this hel...
Create a Java method that does the following: "Retrieves the list of resource share invitations for a resource share.".
Of course, here is the Java code you requested: ```java public PixelFormat[] getSupportedPixelFormats() { IntPointer formatsPointer = avCodec.pix_fmts(); if (getType() != MediaType.VIDEO || formatsPointer == null) return null; List<PixelFormat> pixelFormats = new ArrayList<PixelFormat>(); int format; i...
Create a Java method that does the following: "Returns the supported pixel formats for this media type.".
Of course, here is the Java code you requested: ```java public static void byCorrelation(Matrix m, boolean saveNegatives) { double totalSum = 0; // Generate the total value in each row and column. double[] rowSums = new double[m.rows()]; double[] colSums = new double[m.columns()]; ...
Create a Java method that does the following: "By correlation.".
Of course, here is the Java code you requested: ```java public EnvironmentSettingInner beginCreateOrUpdate(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGro...
Create a Java method that does the following: "Creates or updates an environment setting.".
Of course, here is the Java code you requested: ```java @Override public void processValidation(Object entity) { // Si la classe cible n'est pas specifiee if(annotation.targetClass() == null) { // On sort return; } // Si le champ id n'est pas specifie if(annotation.idField() == null...
Create a Java method that does the following: "A method to perform processing on the DAO validation.".
Of course, here is the Java code you requested: ```java public ServiceFuture<PoolStatistics> getAllLifetimeStatisticsAsync(final ServiceCallback<PoolStatistics> serviceCallback) { return ServiceFuture.fromHeaderResponse(getAllLifetimeStatisticsWithServiceResponseAsync(), serviceCallback); } ``` Hope this ...
Create a Java method that does the following: "Gets all lifetime statistics.".
Of course, here is the Java code you requested: ```java public Iterable<IEObjectDescription> getCandidateDescriptions(XExpression expression, EReference reference, /* @Nullable */ EObject toBeLinked, IFeatureScopeSession session, IResolvedTypes types) throws IllegalNodeException { if (toBeLinked == null) { ret...
Create a Java method that does the following: "Replies the list of error descriptions for the given expression.".
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.PPORG__RG_LENGTH: return getRGLength(); case AfplibPackage.PPORG__OBJ_TYPE: return getObjType(); case AfplibPackage.PPORG_...
Create a Java method that does the following: "Override eGet to return the object for the featureID".
Of course, here is the Java code you requested: ```java public String selectColor(List<String> colors) { String tr="transparent"; for (String c: colors) { if (!(c.equals(tr))) return c; } return tr; } ``` Hope this helps!
Create a Java method that does the following: "Select a color from a list of colors.".
Of course, here is the Java code you requested: ```java public void setOpaque( String scheme, String schemeSpecificPart ) { if ( scheme == null || scheme.length() == 0 || schemeSpecificPart == null || schemeSpecificPart.length() == 0 || schemeSpecificPart.ind...
Create a Java method that does the following: "Sets the opaque URI.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("checkstyle:nestedifdepth") protected synchronized String replaceAuthor(File sourceFile, int sourceLine, String text, ExtendedArtifact artifact, ReplacementType replacementType) throws MojoExecutionException { String result = text; final...
Create a Java method that does the following: "Replace the author of the given text.".
Of course, here is the Java code you requested: ```java @Pure public static File makeRelative(File filenameToMakeRelative, File rootPath) throws IOException { return makeRelative(filenameToMakeRelative, rootPath, true); } ``` Hope this helps!
Create a Java method that does the following: "Make a relative file.".
Of course, here is the Java code you requested: ```java private PortMapper getPortMapper() { if (portMapper == null) { PortMapperImpl portMapper = new PortMapperImpl(); portMapper.setPortMappings(httpsPortMappings); this.portMapper = portMapper; } return portMapper; } ``` Hope this helps!
Create a Java method that does the following: "Get the port mapper.".
Of course, here is the Java code you requested: ```java public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { return new Compound( ClassConstant.of(methodDescription.getDeclaringType()), methodName(), ArrayFactory.forType(...
Create a Java method that does the following: "This method is called to get the size of the class.".
Of course, here is the Java code you requested: ```java public RouteMatcher options(String pattern, Handler<HttpServerRequest> handler) { addPattern(pattern, handler, optionsBindings); return this; } ``` Hope this helps!
Create a Java method that does the following: "Add a pattern that matches OPTIONS requests.".
Of course, here is the Java code you requested: ```java void setupSetterAndGetter(Object target) { //if (mProperty != null) { // // check to make sure that mProperty is on the class of target // try { // Object testValue = mProperty.get(target); // for (Keyfr...
Create a Java method that does the following: "Setup the setter and getter for the target object.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "kantine_cafeteria") public JAXBElement<Boolean> createKantineCafeteria(Boolean value) { return new JAXBElement<Boolean>(_KantineCafeteria_QNAME, Boolean.class, null, value); } ``` Hope this helps!
Create a Java method that does the following: "Create an instance of the KantineCafeteria JAXBElement.".
Of course, here is the Java code you requested: ```java public static String toJsonString(Object value) { if (value == null) { return "null"; } else if (value.getClass().equals(String.class)) { return "\"" + StringUtils.jsonEncoding(value.toString()) + "\""; } ...
Create a Java method that does the following: "Convert a value to a JSON string.".
Of course, here is the Java code you requested: ```java @Override public ModifyInstanceGroupsResult modifyInstanceGroups(ModifyInstanceGroupsRequest request) { request = beforeClientExecution(request); return executeModifyInstanceGroups(request); } ``` Hope this helps!
Create a Java method that does the following: "Modify an existing instance group.".
Of course, here is the Java code you requested: ```java public void setController(EditController controller) { if (this.controller != null) { this.controller.onDeactivate(); } this.controller = controller; if (controller != null) { controller.setMaxBoundsDisplayed(isMaxBoundsDisplayed()); controller.o...
Create a Java method that does the following: "Sets the edit controller.".
Of course, here is the Java code you requested: ```java public ServiceFuture<ClusterInner> getAsync(String resourceGroupName, String workspaceName, String clusterName, final ServiceCallback<ClusterInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspa...
Create a Java method that does the following: "Gets a cluster.".
Of course, here is the Java code you requested: ```java public byte[] decrypt(byte[] iv, byte[] cipherText) throws RuntimeException { AEADParameters aeadParams = new AEADParameters( new KeyParameter(key), TAG_LENGTH, iv, authData); cipher.init(false, ae...
Create a Java method that does the following: "Decrypt a byte array using the AEAD.".
Of course, here is the Java code you requested: ```java protected static ListResponse<CloudFileShare> getShareList(final InputStream stream, final CloudFileClient serviceClient) throws ParserConfigurationException, SAXException, IOException { SAXParser saxParser = Utility.getSAXParser(); Sh...
Create a Java method that does the following: "Get the list of shares from the specified stream.".
Of course, here is the Java code you requested: ```java public String getOldAvatarUrl() { return previous == null ? null : String.format(AVATAR_URL, getSelfUser().getId(), previous, previous.startsWith("a_") ? ".gif" : ".png"); } ``` Hope this helps!
Create a Java method that does the following: "Get the old avatar url for the user.".
Of course, here is the Java code you requested: ```java public static Map createMap(Class<?> mapType, int initialCapacity) { if (mapType.isInterface()) { if (Map.class.equals(mapType)) { return new LinkedHashMap(initialCapacity); } else if (SortedMap.class.equals(mapType) || mapType.equals(navigableMapC...
Create a Java method that does the following: "Creates a new instance of the given Map type.".
Of course, here is the Java code you requested: ```java @GuardedBy("lock") protected T[] getRow(int index) { T[] row=matrix[index]; if(row == null) { row=(T[])new Object[elements_per_row]; matrix[index]=row; } return row; } ``` Hope this helps!
Create a Java method that does the following: "Gets the row.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public void setSettings(Object presets) { if (presets == null) { m_settingPresets = null; } else if (!(presets instanceof Map)) { throw new IllegalArgumentException( "cms:...
Create a Java method that does the following: "Sets the settings for the application.".
Of course, here is the Java code you requested: ```java public static void removeLegacyNonScopesFromMapping(Map<ScopeImpl, PvmExecutionImpl> mapping) { Map<PvmExecutionImpl, List<ScopeImpl>> scopesForExecutions = new HashMap<PvmExecutionImpl, List<ScopeImpl>>(); for (Map.Entry<ScopeImpl, PvmExecutionImpl> map...
Create a Java method that does the following: "Remove legacy non - scopes from the given mapping.".
Of course, here is the Java code you requested: ```java public static <V> ListenableFuture<V> whenAnyComplete(Iterable<? extends ListenableFuture<? extends V>> futures) { requireNonNull(futures, "futures is null"); checkArgument(!isEmpty(futures), "futures is empty"); ExtendedSettableFutur...
Create a Java method that does the following: "When any of the given futures complete returns a ListenableFuture that is completed with the first future.".
Of course, here is the Java code you requested: ```java static private NetcdfFile acquireNcml(FileCache cache, FileFactory factory, Object hashKey, String location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { if (cache == null...
Create a Java method that does the following: "This method is used to acquire a NcML file from the cache.".
Of course, here is the Java code you requested: ```java protected final void setProperty(Synset synset, PropertyName name, Property property) { Cast.as(synset, SynsetImpl.class).setProperty(name, property); } ``` Hope this helps!
Create a Java method that does the following: "Sets a property on a synset.".
Of course, here is the Java code you requested: ```java @Nonnull public static UAProfile getUAProfile (@Nonnull final HttpServletRequest aHttpRequest) { ValueEnforcer.notNull (aHttpRequest, "HttpRequest"); UAProfile aUAProfile = (UAProfile) aHttpRequest.getAttribute (UAProfile.class.getName ()); if (a...
Create a Java method that does the following: "Get the UAProfile from the request.".
Of course, here is the Java code you requested: ```java public RTMClient rtmConnect(String apiToken, boolean fullUserInfoRequired) throws IOException { try { RTMConnectResponse response = methods().rtmConnect(RTMConnectRequest.builder().token(apiToken).build()); if (response.isOk()) { ...
Create a Java method that does the following: "Connect to the RTM API endpoint.".
Of course, here is the Java code you requested: ```java public void unregisterAll() { for (KvStateInfo kvState : registeredKvStates) { registry.unregisterKvState(jobId, jobVertexId, kvState.keyGroupRange, kvState.registrationName, kvState.kvStateId); } } ``` Hope this helps!
Create a Java method that does the following: "Unregister all registered KvState objects.".
Of course, here is the Java code you requested: ```java public void log(final Priority priority, final Object message, final Throwable t) { provider.log(STACKTRACE_DEPTH, null, translatePriority(priority), t, message == t ? null : message, (Object[]) null); } ``` Hope this helps!
Create a Java method that does the following: "Log a message and throwable at the stack trace depth.".
Of course, here is the Java code you requested: ```java public Iterable<DContact> queryByLatitude(Object parent, java.lang.Float latitude) { return queryByField(parent, DContactMapper.Field.LATITUDE.getFieldName(), latitude); } ``` Hope this helps!
Create a Java method that does the following: "query - by method for field latitude".
Of course, here is the Java code you requested: ```java void pushBaseIndentifier(String baseID) { if (null != baseID) { int posOfHash = baseID.indexOf('#'); if (posOfHash > -1) { m_fragmentIDString = baseID.substring(posOfHash + 1); m_shouldProcess = false; } e...
Create a Java method that does the following: "Push base identifier.".
Of course, here is the Java code you requested: ```java @Override public Object js_split(Context cx, Scriptable scope, String target, Object[] args) { // create an empty Array to return; Scriptable result = cx.newArray(scope, 0); // Use the second arg...
Create a Java method that does the following: "This method is called by the JS code in the JS code to split a string into a single array of strings.".
Of course, here is the Java code you requested: ```java static PathAddress resolvePathAddress(final ObjectName domainRoot, final Resource rootResource, final ObjectName name) { String domain = domainRoot.getDomain(); if (!name.getDomain().equals(domain)) { return null; } if ...
Create a Java method that does the following: "Resolve a path address from a domain name to a resource.".
Of course, here is the Java code you requested: ```java public ServiceFuture<RedisAccessKeysInner> regenerateKeyAsync(String resourceGroupName, String name, RedisKeyType keyType, final ServiceCallback<RedisAccessKeysInner> serviceCallback) { return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsy...
Create a Java method that does the following: "Regenerate a Redis key.".
Of course, here is the Java code you requested: ```java private CmsObject initCmsObject( HttpServletRequest req, HttpServletResponse res, String user, String password, String ouFqn) throws CmsException { String siteroot = null; // gather information from req...
Create a Java method that does the following: "This method initializes the CmsObject.".
Of course, here is the Java code you requested: ```java public double sqDifference(int index, double val1, double val2) { double val = difference(index, val1, val2); return val*val; } ``` Hope this helps!
Create a Java method that does the following: "Gets the squared difference of two vectors.".
Of course, here is the Java code you requested: ```java private static JobConf createJobConf(Configuration conf, boolean useFastCopy) { Class<? extends InputFormat> inputFormat = (useFastCopy) ? FastCopyInputFormat.class : CopyInputFormat.class; JobConf jobconf = new JobConf(conf, DistCp.class); jobc...
Create a Java method that does the following: "Create a job conf object for the DFS".
Of course, here is the Java code you requested: ```java public Cat get(Integer id) { if (DB.isEmpty()) { addExampleCats(); } return DB.get(id); } ``` Hope this helps!
Create a Java method that does the following: "Get a Cat object from the database.".
Of course, here is the Java code you requested: ```java public void addAttribute(HeaderKeys label, CBORObject value, int where) throws CoseException { addAttribute(label.AsCBOR(), value, where); } ``` Hope this helps!
Create a Java method that does the following: "Add an attribute to the CSE object.".
Of course, here is the Java code you requested: ```java public DataSetBasicAttributesWorkflow basicAttributes(final DataSetProviderType type) { final boolean isSQL = type != null && DataSetProviderType.SQL.equals(type); final boolean isBean = type != null && DataSetProviderType.BEAN.equals(type); ...
Create a Java method that does the following: "Gets the basic attributes workflow.".
Of course, here is the Java code you requested: ```java public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) { File reserveCacheDir = createReserveDiskCacheDir(context); if (diskCacheSize > 0 || diskCacheFileCount > 0)...
Create a Java method that does the following: "Creates a disk cache.".
Of course, here is the Java code you requested: ```java public static Object spawn(Context cx, Scriptable thisObj, Object[] args, Function funObj) { Scriptable scope = funObj.getParentScope(); Runner runner; if (args.length != 0 && args[0] instanceof Function)...
Create a Java method that does the following: "Spawn a new thread.".
Of course, here is the Java code you requested: ```java private List<SchemaColumn> findPartitioningColumns() { if (m_partitioningColumns != null) { return m_partitioningColumns; } m_partitioningColumns = new ArrayList<>(); assert(getScanPartitioning() != null); if ...
Create a Java method that does the following: "Find the partitioning columns.".
Of course, here is the Java code you requested: ```java protected double getRuleMajorityClassIndex(RuleClassification r) { double maxvalue = 0.0; int posMaxValue = 0; for (int i = 0; i < r.obserClassDistrib.numValues(); i++) { if (r.obserClassDistrib.getValue(i) > maxvalue) { maxvalue = r.obserClassDistri...
Create a Java method that does the following: "Gets the rule majority class index.".
Of course, here is the Java code you requested: ```java public String encryptOrNull(String data) { try { return encrypt(data); } catch (Exception e) { e.printStackTrace(); return null; } } ``` Hope this helps!
Create a Java method that does the following: "Encrypts the data and returns the result as a String.".
Of course, here is the Java code you requested: ```java public static int compare(long serial1, long serial2) { if (serial1 < 0 || serial1 > MAX32) throw new IllegalArgumentException(serial1 + " out of range"); if (serial2 < 0 || serial2 > MAX32) throw new IllegalArgumentException(serial2 + " out of range"); lo...
Create a Java method that does the following: "Compare two 32 - bit integers.".
Of course, here is the Java code you requested: ```java @Override protected void closeJedisCommands(JedisCommands jedisCommands) { if (jedisCommands instanceof Jedis) { ((Jedis) jedisCommands).close(); } else throw new IllegalArgumentException("Argument is not of type [" + J...
Create a Java method that does the following: "Close the JedisCommands object.".
Of course, here is the Java code you requested: ```java public static void info(Object message) { log(Level.INFO, message, null, (Object[])null); } ``` Hope this helps!
Create a Java method that does the following: "Log a message object with a level of INFO.".
Of course, here is the Java code you requested: ```java protected void didStartup () { // let our delegates know that we've started up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate) { ...
Create a Java method that does the following: "Called by the PlaceManager to inform our delegates that we have started up the base class.".
Of course, here is the Java code you requested: ```java protected String getCommonSuperClassBase(final String type1, final String type2) { Class<?> c, d; try { c = classForName(type1.replace('/', '.')); d = classForName(type2.replace('/', '.')); } catch (Exception e) { ...
Create a Java method that does the following: "Get the common super class base.".
Of course, here is the Java code you requested: ```java protected Timestamp eval(final Object[] _value) throws EFapsException { final Timestamp ret; if (_value == null || _value.length == 0 || _value[0] == null) { ret = null; } else { final DateTime dateTime...
Create a Java method that does the following: "Method to evaluate the value of the tc_lang attribute.".
Of course, here is the Java code you requested: ```java private boolean scrollAndFocus(int directionY, int top, int bottom, int directionX, int left, int right) { boolean handled = true; int height = getHeight(); int containerTop = getScrollY(); int containerBottom = containerTop + heig...
Create a Java method that does the following: "Scroll and focus.".
Of course, here is the Java code you requested: ```java @Override public SortedSet<String> getPDPDomainNamesForPDB(String pdbId) throws IOException{ SortedSet<String> results = null; try { URL u = new URL(server + "getPDPDomainNamesForPDB?pdbId="+pdbId); logger.info("Fetching {}",u); InputStream response...
Create a Java method that does the following: "Get the list of domain names for a given PDB ID.".
Of course, here is the Java code you requested: ```java public void writeUncommitted(SIMPMessage m) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "writeUncommitted", new Object[] { m }); TickRange tr = ...
Create a Java method that does the following: "This method is called by the SIB0105C. 1".
Of course, here is the Java code you requested: ```java public static void elementMult(DMatrixD1 a , DMatrixD1 b ) { if( a.numCols != b.numCols || a.numRows != b.numRows ) { throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions"); } int ...
Create a Java method that does the following: "Multiplies the elements of two matrices.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<OperationStatus>> deleteWithServiceResponseAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter th...
Create a Java method that does the following: "Deletes the Crafter App Service Environment.".
Of course, here is the Java code you requested: ```java @Nonnull public static LSrtBinaryOperator srtBinaryOperatorFrom(Consumer<LSrtBinaryOperatorBuilder> buildingFunction) { LSrtBinaryOperatorBuilder builder = new LSrtBinaryOperatorBuilder(); buildingFunction.accept(builder); return builder.build(); } ``` H...
Create a Java method that does the following: "Create a LSrtBinaryOperator from a consumer.".
Of course, here is the Java code you requested: ```java protected T getPlugin(final Object... args) { TreeSet<T> applicable = new TreeSet<>((o1, o2) -> { Integer o1Priority = getPriority(o1, args); Integer o2Priority = getPriority(o2, args); int i = o2Priority.compareTo(o1P...
Create a Java method that does the following: "Get the plugin from the list of plugins.".
Of course, here is the Java code you requested: ```java void setAnimatedValue(Object target) { //if (mProperty != null) { // mProperty.set(target, getAnimatedValue()); //} if (mSetter != null) { try { mTmpValueArray[0] = getAnimatedValue(); ...
Create a Java method that does the following: "Set the value of the resource attribute in the target object.".
Of course, here is the Java code you requested: ```java public static long[] squeeze(long[] shape) { if (isColumnVectorShape(shape)) return shape; List<Long> ret = new ArrayList<>(); //strip all but last dimension for (int i = 0; i < shape.length; i++) if (shap...
Create a Java method that does the following: "Squeeze a long array.".
Of course, here is the Java code you requested: ```java public DescribeReservationResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; } ``` Hope this helps!
Create a Java method that does the following: "A map of tags to be included in the reservation.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) .con...
Create a Java method that does the following: "List usage of a Virtual Network.".