repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
oblac/jodd
jodd-mail/src/main/java/jodd/mail/EMLParser.java
EMLParser.parse
public ReceivedEmail parse(final String emlContent) throws MessagingException { try { return parse(emlContent, JoddCore.encoding); } catch (final UnsupportedEncodingException ignore) { return null; } }
java
public ReceivedEmail parse(final String emlContent) throws MessagingException { try { return parse(emlContent, JoddCore.encoding); } catch (final UnsupportedEncodingException ignore) { return null; } }
[ "public", "ReceivedEmail", "parse", "(", "final", "String", "emlContent", ")", "throws", "MessagingException", "{", "try", "{", "return", "parse", "(", "emlContent", ",", "JoddCore", ".", "encoding", ")", ";", "}", "catch", "(", "final", "UnsupportedEncodingExce...
Parses EML with provided EML content. @param emlContent {@link String} with EML content. @return {@link ReceivedEmail}. @throws MessagingException if {@link MimeMessage} cannot be created. @see #parse(String, String)
[ "Parses", "EML", "with", "provided", "EML", "content", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EMLParser.java#L75-L81
test
Parses the given string into an ReceivedEmail object.
Of course, here is the Java code you requested: ```java public ReceivedEmail parse(final String emlContent) throws MessagingException { try { return parse(emlContent, JoddCore.encoding); } catch (final UnsupportedEncodingException ignore) { return null; } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/DiskCache2.java
DiskCache2.showCache
public void showCache(PrintStream pw) { pw.println("Cache files"); pw.println("Size LastModified Filename"); File dir = new File(root); File[] files = dir.listFiles(); if (files != null) for (File file : files) { String org = null; try { org = URLDecoder.decod...
java
public void showCache(PrintStream pw) { pw.println("Cache files"); pw.println("Size LastModified Filename"); File dir = new File(root); File[] files = dir.listFiles(); if (files != null) for (File file : files) { String org = null; try { org = URLDecoder.decod...
[ "public", "void", "showCache", "(", "PrintStream", "pw", ")", "{", "pw", ".", "println", "(", "\"Cache files\"", ")", ";", "pw", ".", "println", "(", "\"Size LastModified Filename\"", ")", ";", "File", "dir", "=", "new", "File", "(", "root", ")", "...
Show cache contents, for debugging. @param pw write to this PrintStream.
[ "Show", "cache", "contents", "for", "debugging", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/DiskCache2.java#L398-L414
test
Show the cache information.
Of course, here is the Java code you requested: ```java public void showCache(PrintStream pw) { pw.println("Cache files"); pw.println("Size LastModified Filename"); File dir = new File(root); File[] files = dir.listFiles(); if (files != null) for (File file : files) { String o...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/OStringSerializer.java
OStringSerializer.deserializeFromByteBufferObject
@Override public String deserializeFromByteBufferObject(ByteBuffer buffer) { int len = buffer.getInt(); final char[] chars = new char[len]; final byte[] binaryData = new byte[2 * len]; buffer.get(binaryData); for (int i = 0; i < len; i++) chars[i] = (char) ((0xFF & binaryData[i << 1]) | ((...
java
@Override public String deserializeFromByteBufferObject(ByteBuffer buffer) { int len = buffer.getInt(); final char[] chars = new char[len]; final byte[] binaryData = new byte[2 * len]; buffer.get(binaryData); for (int i = 0; i < len; i++) chars[i] = (char) ((0xFF & binaryData[i << 1]) | ((...
[ "@", "Override", "public", "String", "deserializeFromByteBufferObject", "(", "ByteBuffer", "buffer", ")", "{", "int", "len", "=", "buffer", ".", "getInt", "(", ")", ";", "final", "char", "[", "]", "chars", "=", "new", "char", "[", "len", "]", ";", "final...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/OStringSerializer.java#L159-L206
test
Deserialize from ByteBuffer Object
Of course, here is the Java code you requested: ```java @Override public String deserializeFromByteBufferObject(ByteBuffer buffer) { int len = buffer.getInt(); final char[] chars = new char[len]; final byte[] binaryData = new byte[2 * len]; buffer.get(binaryData); for (int i = 0; i < len; i++) ...
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java
AbstractHashedMap.calculateNewCapacity
protected int calculateNewCapacity(int proposedCapacity) { int newCapacity = 1; if (proposedCapacity > MAXIMUM_CAPACITY) { newCapacity = MAXIMUM_CAPACITY; } else { while (newCapacity < proposedCapacity) { newCapacity <<= 1; // multiply by two }...
java
protected int calculateNewCapacity(int proposedCapacity) { int newCapacity = 1; if (proposedCapacity > MAXIMUM_CAPACITY) { newCapacity = MAXIMUM_CAPACITY; } else { while (newCapacity < proposedCapacity) { newCapacity <<= 1; // multiply by two }...
[ "protected", "int", "calculateNewCapacity", "(", "int", "proposedCapacity", ")", "{", "int", "newCapacity", "=", "1", ";", "if", "(", "proposedCapacity", ">", "MAXIMUM_CAPACITY", ")", "{", "newCapacity", "=", "MAXIMUM_CAPACITY", ";", "}", "else", "{", "while", ...
Calculates the new capacity of the map. This implementation normalizes the capacity to a power of two. @param proposedCapacity the proposed capacity @return the normalized new capacity
[ "Calculates", "the", "new", "capacity", "of", "the", "map", ".", "This", "implementation", "normalizes", "the", "capacity", "to", "a", "power", "of", "two", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L707-L720
test
Calculate the new capacity for a new class.
Of course, here is the Java code you requested: ```java protected int calculateNewCapacity(int proposedCapacity) { int newCapacity = 1; if (proposedCapacity > MAXIMUM_CAPACITY) { newCapacity = MAXIMUM_CAPACITY; } else { while (newCapacity < proposedCapacity) { ...
spring-projects/spring-security
crypto/src/main/java/org/springframework/security/crypto/password/MessageDigestPasswordEncoder.java
MessageDigestPasswordEncoder.encode
public String encode(CharSequence rawPassword) { String salt = PREFIX + this.saltGenerator.generateKey() + SUFFIX; return digest(salt, rawPassword); }
java
public String encode(CharSequence rawPassword) { String salt = PREFIX + this.saltGenerator.generateKey() + SUFFIX; return digest(salt, rawPassword); }
[ "public", "String", "encode", "(", "CharSequence", "rawPassword", ")", "{", "String", "salt", "=", "PREFIX", "+", "this", ".", "saltGenerator", ".", "generateKey", "(", ")", "+", "SUFFIX", ";", "return", "digest", "(", "salt", ",", "rawPassword", ")", ";",...
Encodes the rawPass using a MessageDigest. If a salt is specified it will be merged with the password before encoding. @param rawPassword The plain text password @return Hex string of password digest (or base64 encoded string if encodeHashAsBase64 is enabled.
[ "Encodes", "the", "rawPass", "using", "a", "MessageDigest", ".", "If", "a", "salt", "is", "specified", "it", "will", "be", "merged", "with", "the", "password", "before", "encoding", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/crypto/src/main/java/org/springframework/security/crypto/password/MessageDigestPasswordEncoder.java#L114-L117
test
Encode a password.
Of course, here is the Java code you requested: ```java public String encode(CharSequence rawPassword) { String salt = PREFIX + this.saltGenerator.generateKey() + SUFFIX; return digest(salt, rawPassword); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/Prop.java
Prop.addPropertyName
public void addPropertyName(QualifiedName name) { Assert.isNotNull(name); String nsName = name.getQualifier(); Assert.isTrue(!"".equals(nsName)); //$NON-NLS-1$ String localName = name.getLocalName(); Assert.isNotNull(localName); Assert.isTrue(!localName.equals("")); //$NO...
java
public void addPropertyName(QualifiedName name) { Assert.isNotNull(name); String nsName = name.getQualifier(); Assert.isTrue(!"".equals(nsName)); //$NON-NLS-1$ String localName = name.getLocalName(); Assert.isNotNull(localName); Assert.isTrue(!localName.equals("")); //$NO...
[ "public", "void", "addPropertyName", "(", "QualifiedName", "name", ")", "{", "Assert", ".", "isNotNull", "(", "name", ")", ";", "String", "nsName", "=", "name", ".", "getQualifier", "(", ")", ";", "Assert", ".", "isTrue", "(", "!", "\"\"", ".", "equals",...
Creates a new element with the given name and adds it to this prop. The name must not be <code>null</code> and its qualifier and local name must not be <code>null</code> and must not be the empty string. @param name the <code>QualifiedName</code> of the property to add
[ "Creates", "a", "new", "element", "with", "the", "given", "name", "and", "adds", "it", "to", "this", "prop", ".", "The", "name", "must", "not", "be", "<code", ">", "null<", "/", "code", ">", "and", "its", "qualifier", "and", "local", "name", "must", ...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/Prop.java#L72-L83
test
Add a property name to the class.
Of course, here is the Java code you requested: ```java public void addPropertyName(QualifiedName name) { Assert.isNotNull(name); String nsName = name.getQualifier(); Assert.isTrue(!"".equals(nsName)); //$NON-NLS-1$ String localName = name.getLocalName(); Assert.isNotNull(localN...
subchen/jetbrick-all-1x
jetbrick-orm/src/main/java/jetbrick/dao/orm/DbHelper.java
DbHelper.tableExist
public boolean tableExist(String name) { Connection conn = null; ResultSet rs = null; try { conn = getConnection(); DatabaseMetaData metaData = conn.getMetaData(); rs = metaData.getTables(null, null, name.toUpperCase(), new String[] { "TABLE" }); r...
java
public boolean tableExist(String name) { Connection conn = null; ResultSet rs = null; try { conn = getConnection(); DatabaseMetaData metaData = conn.getMetaData(); rs = metaData.getTables(null, null, name.toUpperCase(), new String[] { "TABLE" }); r...
[ "public", "boolean", "tableExist", "(", "String", "name", ")", "{", "Connection", "conn", "=", "null", ";", "ResultSet", "rs", "=", "null", ";", "try", "{", "conn", "=", "getConnection", "(", ")", ";", "DatabaseMetaData", "metaData", "=", "conn", ".", "g...
判断表是否已经存在
[ "判断表是否已经存在" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-orm/src/main/java/jetbrick/dao/orm/DbHelper.java#L286-L300
test
Check if a table exists.
Of course, here is the Java code you requested: ```java public boolean tableExist(String name) { Connection conn = null; ResultSet rs = null; try { conn = getConnection(); DatabaseMetaData metaData = conn.getMetaData(); rs = metaData.getTables(null, null, nam...
cglib/cglib
cglib/src/main/java/net/sf/cglib/proxy/Enhancer.java
Enhancer.isEnhanced
public static boolean isEnhanced(Class type) { try { getCallbacksSetter(type, SET_THREAD_CALLBACKS_NAME); return true; } catch (NoSuchMethodException e) { return false; } }
java
public static boolean isEnhanced(Class type) { try { getCallbacksSetter(type, SET_THREAD_CALLBACKS_NAME); return true; } catch (NoSuchMethodException e) { return false; } }
[ "public", "static", "boolean", "isEnhanced", "(", "Class", "type", ")", "{", "try", "{", "getCallbacksSetter", "(", "type", ",", "SET_THREAD_CALLBACKS_NAME", ")", ";", "return", "true", ";", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "return", ...
Determine if a class was generated using <code>Enhancer</code>. @param type any class @return whether the class was generated using <code>Enhancer</code>
[ "Determine", "if", "a", "class", "was", "generated", "using", "<code", ">", "Enhancer<", "/", "code", ">", "." ]
cd01695c11fd3c66641b295b9596f74cf13c548b
https://github.com/cglib/cglib/blob/cd01695c11fd3c66641b295b9596f74cf13c548b/cglib/src/main/java/net/sf/cglib/proxy/Enhancer.java#L781-L788
test
Is the class an enhanced class?
Of course, here is the Java code you requested: ```java public static boolean isEnhanced(Class type) { try { getCallbacksSetter(type, SET_THREAD_CALLBACKS_NAME); return true; } catch (NoSuchMethodException e) { return false; } } ``` Hope this helps!
fabric8io/fabric8-maven-plugin
enricher/deprecated/src/main/java/io/fabric8/maven/enricher/deprecated/DocLinkEnricher.java
DocLinkEnricher.replaceProperties
protected static String replaceProperties(String text, Properties properties) { Set<Map.Entry<Object, Object>> entries = properties.entrySet(); for (Map.Entry<Object, Object> entry : entries) { Object key = entry.getKey(); Object value = entry.getValue(); if (key != n...
java
protected static String replaceProperties(String text, Properties properties) { Set<Map.Entry<Object, Object>> entries = properties.entrySet(); for (Map.Entry<Object, Object> entry : entries) { Object key = entry.getKey(); Object value = entry.getValue(); if (key != n...
[ "protected", "static", "String", "replaceProperties", "(", "String", "text", ",", "Properties", "properties", ")", "{", "Set", "<", "Map", ".", "Entry", "<", "Object", ",", "Object", ">", ">", "entries", "=", "properties", ".", "entrySet", "(", ")", ";", ...
Replaces all text of the form <code>${foo}</code> with the value in the properties object
[ "Replaces", "all", "text", "of", "the", "form", "<code", ">", "$", "{", "foo", "}", "<", "/", "code", ">", "with", "the", "value", "in", "the", "properties", "object" ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/enricher/deprecated/src/main/java/io/fabric8/maven/enricher/deprecated/DocLinkEnricher.java#L166-L177
test
Replace properties in text.
Of course, here is the Java code you requested: ```java protected static String replaceProperties(String text, Properties properties) { Set<Map.Entry<Object, Object>> entries = properties.entrySet(); for (Map.Entry<Object, Object> entry : entries) { Object key = entry.getKey(); ...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledClause.java
WAMCompiledClause.addInstructions
public void addInstructions(Functor body, SizeableList<WAMInstruction> instructions) { int oldLength; if (this.body == null) { oldLength = 0; this.body = new Functor[1]; } else { oldLength = this.body.length; this.body ...
java
public void addInstructions(Functor body, SizeableList<WAMInstruction> instructions) { int oldLength; if (this.body == null) { oldLength = 0; this.body = new Functor[1]; } else { oldLength = this.body.length; this.body ...
[ "public", "void", "addInstructions", "(", "Functor", "body", ",", "SizeableList", "<", "WAMInstruction", ">", "instructions", ")", "{", "int", "oldLength", ";", "if", "(", "this", ".", "body", "==", "null", ")", "{", "oldLength", "=", "0", ";", "this", "...
Adds a conjunctive body functor, or head functor, to this clause, along with the instructions that implement it. @param body A conjunctive body functor to add to this clause. @param instructions A list of instructions to add to the body.
[ "Adds", "a", "conjunctive", "body", "functor", "or", "head", "functor", "to", "this", "clause", "along", "with", "the", "instructions", "that", "implement", "it", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledClause.java#L65-L83
test
Add instructions to the exception.
Of course, here is the Java code you requested: ```java public void addInstructions(Functor body, SizeableList<WAMInstruction> instructions) { int oldLength; if (this.body == null) { oldLength = 0; this.body = new Functor[1]; } else { ...
ReactiveX/RxJava
src/main/java/io/reactivex/plugins/RxJavaPlugins.java
RxJavaPlugins.setSingleSchedulerHandler
public static void setSingleSchedulerHandler(@Nullable Function<? super Scheduler, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onSingleHandler = handler; }
java
public static void setSingleSchedulerHandler(@Nullable Function<? super Scheduler, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onSingleHandler = handler; }
[ "public", "static", "void", "setSingleSchedulerHandler", "(", "@", "Nullable", "Function", "<", "?", "super", "Scheduler", ",", "?", "extends", "Scheduler", ">", "handler", ")", "{", "if", "(", "lockdown", ")", "{", "throw", "new", "IllegalStateException", "("...
Sets the specific hook function. @param handler the hook function to set, null allowed
[ "Sets", "the", "specific", "hook", "function", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L636-L641
test
Sets the single scheduler handler.
Of course, here is the Java code you requested: ```java public static void setSingleSchedulerHandler(@Nullable Function<? super Scheduler, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onSingleHandler = handler...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java
AbstractRememberMeServices.logout
@Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { if (logger.isDebugEnabled()) { logger.debug("Logout of user " + (authentication == null ? "Unknown" : authentication.getName())); } cancelCookie(request, response); }
java
@Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { if (logger.isDebugEnabled()) { logger.debug("Logout of user " + (authentication == null ? "Unknown" : authentication.getName())); } cancelCookie(request, response); }
[ "@", "Override", "public", "void", "logout", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "Authentication", "authentication", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", ...
Implementation of {@code LogoutHandler}. Default behaviour is to call {@code cancelCookie()}.
[ "Implementation", "of", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/rememberme/AbstractRememberMeServices.java#L436-L444
test
Logout of the user.
Of course, here is the Java code you requested: ```java @Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { if (logger.isDebugEnabled()) { logger.debug("Logout of user " + (authentication == null ? "Unknown" : authentication.getName()));...
turbomanage/storm-gen
storm-apt/api/src/main/java/com/turbomanage/storm/SQLiteDao.java
SQLiteDao.delete
public int delete(Long id) { if (id != null) { return getWritableDb().delete(th.getTableName(), th.getIdCol() + "=?", new String[]{id.toString()}); } return 0; }
java
public int delete(Long id) { if (id != null) { return getWritableDb().delete(th.getTableName(), th.getIdCol() + "=?", new String[]{id.toString()}); } return 0; }
[ "public", "int", "delete", "(", "Long", "id", ")", "{", "if", "(", "id", "!=", "null", ")", "{", "return", "getWritableDb", "(", ")", ".", "delete", "(", "th", ".", "getTableName", "(", ")", ",", "th", ".", "getIdCol", "(", ")", "+", "\"=?\"", ",...
Deletes a single row by ID. Returns the number of rows deleted or 0 if unsuccessful. @param id @return count of rows deleted
[ "Deletes", "a", "single", "row", "by", "ID", ".", "Returns", "the", "number", "of", "rows", "deleted", "or", "0", "if", "unsuccessful", "." ]
22caa69439548a074d035745215bce5aff55853d
https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-apt/api/src/main/java/com/turbomanage/storm/SQLiteDao.java#L94-L99
test
Delete the record with the given id.
Of course, here is the Java code you requested: ```java public int delete(Long id) { if (id != null) { return getWritableDb().delete(th.getTableName(), th.getIdCol() + "=?", new String[]{id.toString()}); } return 0; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.throttleLast
@CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit) { return sample(intervalDuration, unit); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit) { return sample(intervalDuration, unit); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "ERROR", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "COMPUTATION", ")", "public", "final", "Flowable", "<", "T", ">", "throttleLast", "(", "long", "intervalDuration",...
Returns a Flowable that emits only the last item emitted by the source Publisher during sequential time windows of a specified duration. <p> This differs from {@link #throttleFirst} in that this ticks along at a scheduled interval whereas {@link #throttleFirst} does not tick, it just tracks the passage of time. <p> <im...
[ "Returns", "a", "Flowable", "that", "emits", "only", "the", "last", "item", "emitted", "by", "the", "source", "Publisher", "during", "sequential", "time", "windows", "of", "a", "specified", "duration", ".", "<p", ">", "This", "differs", "from", "{", "@link",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L15986-L15991
test
Throttle the last result of a sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit) { return sample(intervalDuration, unit); } ``` Hope...
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.concatArray
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable concatArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return complete(); } else if (sources.leng...
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable concatArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return complete(); } else if (sources.leng...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "Completable", "concatArray", "(", "CompletableSource", "...", "sources", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "sources"...
Returns a Completable which completes only when all sources complete, one after another. <p> <img width="640" height="283" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.concatArray.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{@code concatArray} does not operate by default on a p...
[ "Returns", "a", "Completable", "which", "completes", "only", "when", "all", "sources", "complete", "one", "after", "another", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "283", "src", "=", "https", ":", "//", "raw", ".", "github", ".", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L187-L199
test
Concatenates two CompletableSources.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable concatArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { r...
GojaFramework/goja
goja-web/src/main/java/goja/mvc/Controller.java
Controller.getDateTime
protected DateTime getDateTime(String name, DateTime defaultValue) { String value = getRequest().getParameter(name); if (Strings.isNullOrEmpty(value)) { return defaultValue; } return DateKit.parseDashYMDHMSDateTime(value); }
java
protected DateTime getDateTime(String name, DateTime defaultValue) { String value = getRequest().getParameter(name); if (Strings.isNullOrEmpty(value)) { return defaultValue; } return DateKit.parseDashYMDHMSDateTime(value); }
[ "protected", "DateTime", "getDateTime", "(", "String", "name", ",", "DateTime", "defaultValue", ")", "{", "String", "value", "=", "getRequest", "(", ")", ".", "getParameter", "(", "name", ")", ";", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "value", ...
JodaTime time request @param name param. the datetime format : yyyy-MM-dd HH:mm:ss @param defaultValue the default value. @return datetime.
[ "JodaTime", "time", "request" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/Controller.java#L500-L506
test
Get a date from the request parameter.
Of course, here is the Java code you requested: ```java protected DateTime getDateTime(String name, DateTime defaultValue) { String value = getRequest().getParameter(name); if (Strings.isNullOrEmpty(value)) { return defaultValue; } return DateKit.parseDashYMDHMSDateTime(valu...
playframework/playframework
core/play-guice/src/main/java/play/inject/guice/GuiceBuilder.java
GuiceBuilder.configure
public final Self configure(Map<String, Object> conf) { return configure(ConfigFactory.parseMap(conf)); }
java
public final Self configure(Map<String, Object> conf) { return configure(ConfigFactory.parseMap(conf)); }
[ "public", "final", "Self", "configure", "(", "Map", "<", "String", ",", "Object", ">", "conf", ")", "{", "return", "configure", "(", "ConfigFactory", ".", "parseMap", "(", "conf", ")", ")", ";", "}" ]
Add additional configuration. @param conf the configuration to add @return a copy of this builder configured with the supplied configuration
[ "Add", "additional", "configuration", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play-guice/src/main/java/play/inject/guice/GuiceBuilder.java#L91-L93
test
Configure the Self object with the configuration from a map of configuration properties.
Of course, here is the Java code you requested: ```java public final Self configure(Map<String, Object> conf) { return configure(ConfigFactory.parseMap(conf)); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.timeout
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Completable", "timeout", "(", "long", "timeout", ",", "TimeUnit", "unit", ",", "Scheduler", "scheduler", ")", "{", "return", "timeout0", "(", "time...
Returns a Completable that runs this Completable and emits a TimeoutException in case this Completable doesn't complete within the given time while "waiting" on the specified Scheduler. <p> <img width="640" height="348" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.timeout.s.png" alt...
[ "Returns", "a", "Completable", "that", "runs", "this", "Completable", "and", "emits", "a", "TimeoutException", "in", "case", "this", "Completable", "doesn", "t", "complete", "within", "the", "given", "time", "while", "waiting", "on", "the", "specified", "Schedul...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L2523-L2527
test
Timeout to retrieve a single entity from the cache.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); } ``` Hope this helps!
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java
Node.getLastChildElement
public Element getLastChildElement(final String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child...
java
public Element getLastChildElement(final String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMENT && elementName.equals(child.getNodeName())) { child...
[ "public", "Element", "getLastChildElement", "(", "final", "String", "elementName", ")", "{", "if", "(", "childNodes", "==", "null", ")", "{", "return", "null", ";", "}", "int", "from", "=", "childNodes", ".", "size", "(", ")", "-", "1", ";", "for", "("...
Returns last child <b>element</b> with given name or <code>null</code> if no such child node exist.
[ "Returns", "last", "child", "<b", ">", "element<", "/", "b", ">", "with", "given", "name", "or", "<code", ">", "null<", "/", "code", ">", "if", "no", "such", "child", "node", "exist", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java#L697-L710
test
Gets the last child element with the given name.
Of course, here is the Java code you requested: ```java public Element getLastChildElement(final String elementName) { if (childNodes == null) { return null; } int from = childNodes.size() - 1; for (int i = from; i >= 0; i--) { Node child = childNodes.get(i); if (child.getNodeType() == NodeType.ELEMEN...
spring-projects/spring-security
core/src/main/java/org/springframework/security/core/parameters/AnnotationParameterNameDiscoverer.java
AnnotationParameterNameDiscoverer.getParameterNames
public String[] getParameterNames(Method method) { Method originalMethod = BridgeMethodResolver.findBridgedMethod(method); String[] paramNames = lookupParameterNames(METHOD_METHODPARAM_FACTORY, originalMethod); if (paramNames != null) { return paramNames; } Class<?> declaringClass = method.getDeclaring...
java
public String[] getParameterNames(Method method) { Method originalMethod = BridgeMethodResolver.findBridgedMethod(method); String[] paramNames = lookupParameterNames(METHOD_METHODPARAM_FACTORY, originalMethod); if (paramNames != null) { return paramNames; } Class<?> declaringClass = method.getDeclaring...
[ "public", "String", "[", "]", "getParameterNames", "(", "Method", "method", ")", "{", "Method", "originalMethod", "=", "BridgeMethodResolver", ".", "findBridgedMethod", "(", "method", ")", ";", "String", "[", "]", "paramNames", "=", "lookupParameterNames", "(", ...
/* (non-Javadoc) @see org.springframework.core.ParameterNameDiscoverer#getParameterNames(java .lang.reflect.Method)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/parameters/AnnotationParameterNameDiscoverer.java#L109-L126
test
Get parameter names for a method.
Of course, here is the Java code you requested: ```java public String[] getParameterNames(Method method) { Method originalMethod = BridgeMethodResolver.findBridgedMethod(method); String[] paramNames = lookupParameterNames(METHOD_METHODPARAM_FACTORY, originalMethod); if (paramNames != null) { return paramN...
boonproject/boon
boon/src/main/java/org/boon/messages/MessageSpecification.java
MessageSpecification.doCreateMessage
@SuppressWarnings ( "unchecked" ) private String doCreateMessage( String message, Object[] actualArgs ) { return ValidationContext.get().createMessage( message, getSubject(), actualArgs ); }
java
@SuppressWarnings ( "unchecked" ) private String doCreateMessage( String message, Object[] actualArgs ) { return ValidationContext.get().createMessage( message, getSubject(), actualArgs ); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "String", "doCreateMessage", "(", "String", "message", ",", "Object", "[", "]", "actualArgs", ")", "{", "return", "ValidationContext", ".", "get", "(", ")", ".", "createMessage", "(", "message", ",...
Actually creates the message. @param message The message that was looked up. @param actualArgs Arguments to the message. @return
[ "Actually", "creates", "the", "message", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/messages/MessageSpecification.java#L176-L180
test
Create a message for the CRM.
Of course, here is the Java code you requested: ```java @SuppressWarnings ( "unchecked" ) private String doCreateMessage( String message, Object[] actualArgs ) { return ValidationContext.get().createMessage( message, getSubject(), actualArgs ); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/geotiff/GeotiffWriter.java
GeotiffWriter.replaceMissingValues
private ArrayFloat replaceMissingValues(IsMissingEvaluator grid, Array data, MAMath.MinMax dataMinMax) { float minValue = (float) (dataMinMax.min - 1.0); ArrayFloat floatArray = (ArrayFloat) Array.factory(DataType.FLOAT, data.getShape()); IndexIterator dataIter = data.getIndexIterator(); IndexIterator ...
java
private ArrayFloat replaceMissingValues(IsMissingEvaluator grid, Array data, MAMath.MinMax dataMinMax) { float minValue = (float) (dataMinMax.min - 1.0); ArrayFloat floatArray = (ArrayFloat) Array.factory(DataType.FLOAT, data.getShape()); IndexIterator dataIter = data.getIndexIterator(); IndexIterator ...
[ "private", "ArrayFloat", "replaceMissingValues", "(", "IsMissingEvaluator", "grid", ",", "Array", "data", ",", "MAMath", ".", "MinMax", "dataMinMax", ")", "{", "float", "minValue", "=", "(", "float", ")", "(", "dataMinMax", ".", "min", "-", "1.0", ")", ";", ...
Replace missing values with dataMinMax.min - 1.0; return a floating point data array. @param grid GridDatatype @param data input data array @return floating point data array with missing values replaced.
[ "Replace", "missing", "values", "with", "dataMinMax", ".", "min", "-", "1", ".", "0", ";", "return", "a", "floating", "point", "data", "array", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/geotiff/GeotiffWriter.java#L273-L288
test
Replace missing values in the data array
Of course, here is the Java code you requested: ```java private ArrayFloat replaceMissingValues(IsMissingEvaluator grid, Array data, MAMath.MinMax dataMinMax) { float minValue = (float) (dataMinMax.min - 1.0); ArrayFloat floatArray = (ArrayFloat) Array.factory(DataType.FLOAT, data.getShape()); IndexIterat...
Unidata/thredds
opendap/src/main/java/opendap/dap/DArray.java
DArray.squeeze
public void squeeze(){ if(dimVector.size()==1) return; Vector<DArrayDimension> squeezeCandidates = new Vector<DArrayDimension>(); for (DArrayDimension dim: dimVector){ if(dim.getSize()==1) squeezeCandidates.add(dim); } if(squeezeCandid...
java
public void squeeze(){ if(dimVector.size()==1) return; Vector<DArrayDimension> squeezeCandidates = new Vector<DArrayDimension>(); for (DArrayDimension dim: dimVector){ if(dim.getSize()==1) squeezeCandidates.add(dim); } if(squeezeCandid...
[ "public", "void", "squeeze", "(", ")", "{", "if", "(", "dimVector", ".", "size", "(", ")", "==", "1", ")", "return", ";", "Vector", "<", "DArrayDimension", ">", "squeezeCandidates", "=", "new", "Vector", "<", "DArrayDimension", ">", "(", ")", ";", "for...
Use this method to "squeeze" out all of the array dimensions whose size is equal to 1. <br> Many queries that contstrain Arrays return an Array that has dimensions whose size has been reduced to 1. In effect that the dimension no longer really exists, except as a notational convention for tracking the hyperslab that th...
[ "Use", "this", "method", "to", "squeeze", "out", "all", "of", "the", "array", "dimensions", "whose", "size", "is", "equal", "to", "1", ".", "<br", ">", "Many", "queries", "that", "contstrain", "Arrays", "return", "an", "Array", "that", "has", "dimensions",...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DArray.java#L316-L339
test
Squeeze the matrix.
Of course, here is the Java code you requested: ```java public void squeeze(){ if(dimVector.size()==1) return; Vector<DArrayDimension> squeezeCandidates = new Vector<DArrayDimension>(); for (DArrayDimension dim: dimVector){ if(dim.getSize()==1) squeez...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/misc/Uspln.java
Uspln.open
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); isExtended = checkFormat(); isoDateFormat = new SimpleDateFormat(); isoDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); isoDateFormat.applyP...
java
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); isExtended = checkFormat(); isoDateFormat = new SimpleDateFormat(); isoDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); isoDateFormat.applyP...
[ "public", "void", "open", "(", "RandomAccessFile", "raf", ",", "NetcdfFile", "ncfile", ",", "CancelTask", "cancelTask", ")", "throws", "IOException", "{", "super", ".", "open", "(", "raf", ",", "ncfile", ",", "cancelTask", ")", ";", "isExtended", "=", "check...
Open existing file, and populate ncfile with it. This method is only called by the NetcdfFile constructor on itself. The provided NetcdfFile object will be empty except for the location String and the IOServiceProvider associated with this NetcdfFile object. @param raf the file to work on, it has already passed...
[ "Open", "existing", "file", "and", "populate", "ncfile", "with", "it", ".", "This", "method", "is", "only", "called", "by", "the", "NetcdfFile", "constructor", "on", "itself", ".", "The", "provided", "NetcdfFile", "object", "will", "be", "empty", "except", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/misc/Uspln.java#L219-L234
test
This method is called by the SequenceFile class to open the file. It creates the necessary data structures and creates the necessary data structures.
Of course, here is the Java code you requested: ```java public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); isExtended = checkFormat(); isoDateFormat = new SimpleDateFormat(); isoDateFormat.setTimeZone(java.uti...
oblac/jodd
jodd-http/src/main/java/jodd/http/HeadersMultiMap.java
HeadersMultiMap.addHeader
public void addHeader(final String name, final String value) { List<String> valuesList = super.getAll(name); if (valuesList.isEmpty()) { super.add(name, value); return; } super.remove(name); valuesList.add(value); super.addAll(name, valuesList); }
java
public void addHeader(final String name, final String value) { List<String> valuesList = super.getAll(name); if (valuesList.isEmpty()) { super.add(name, value); return; } super.remove(name); valuesList.add(value); super.addAll(name, valuesList); }
[ "public", "void", "addHeader", "(", "final", "String", "name", ",", "final", "String", "value", ")", "{", "List", "<", "String", ">", "valuesList", "=", "super", ".", "getAll", "(", "name", ")", ";", "if", "(", "valuesList", ".", "isEmpty", "(", ")", ...
Adds new header value. If existing value exist, it will be removed so the store the new key value.
[ "Adds", "new", "header", "value", ".", "If", "existing", "value", "exist", "it", "will", "be", "removed", "so", "the", "store", "the", "new", "key", "value", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HeadersMultiMap.java#L40-L49
test
Add a header to the response.
Of course, here is the Java code you requested: ```java public void addHeader(final String name, final String value) { List<String> valuesList = super.getAll(name); if (valuesList.isEmpty()) { super.add(name, value); return; } super.remove(name); valuesList.add(value); super.addAll(name, valuesList);...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/MediaAudioResampler.java
MediaAudioResampler.resample
public int resample(MediaSampled out, MediaSampled in) { return VideoJNI.MediaAudioResampler_resample(swigCPtr, this, MediaSampled.getCPtr(out), out, MediaSampled.getCPtr(in), in); }
java
public int resample(MediaSampled out, MediaSampled in) { return VideoJNI.MediaAudioResampler_resample(swigCPtr, this, MediaSampled.getCPtr(out), out, MediaSampled.getCPtr(in), in); }
[ "public", "int", "resample", "(", "MediaSampled", "out", ",", "MediaSampled", "in", ")", "{", "return", "VideoJNI", ".", "MediaAudioResampler_resample", "(", "swigCPtr", ",", "this", ",", "MediaSampled", ".", "getCPtr", "(", "out", ")", ",", "out", ",", "Med...
Convert audio.<br> <br> in can be set to null to flush the last few samples out at the<br> end.<br> <br> If more input is provided than output space then the input will be buffered.<br> You can avoid this buffering by providing more output space than input.<br> Conversion will run directly without copying whenever poss...
[ "Convert", "audio", ".", "<br", ">", "<br", ">", "in", "can", "be", "set", "to", "null", "to", "flush", "the", "last", "few", "samples", "out", "at", "the<br", ">", "end", ".", "<br", ">", "<br", ">", "If", "more", "input", "is", "provided", "than"...
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/MediaAudioResampler.java#L204-L206
test
Resample the video from the input to the output.
Of course, here is the Java code you requested: ```java public int resample(MediaSampled out, MediaSampled in) { return VideoJNI.MediaAudioResampler_resample(swigCPtr, this, MediaSampled.getCPtr(out), out, MediaSampled.getCPtr(in), in); } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/widget/URLDumpPane.java
URLDumpPane.openURL2
@Urlencoded private void openURL2(String urlString, Command cmd) { HTTPMethod m; try (HTTPSession httpclient = HTTPFactory.newSession(urlString)) { /* you might think this works, but it doesnt: URI raw = new URI(urlString.trim()); appendLine("raw scheme= " + raw.getScheme() + "\n a...
java
@Urlencoded private void openURL2(String urlString, Command cmd) { HTTPMethod m; try (HTTPSession httpclient = HTTPFactory.newSession(urlString)) { /* you might think this works, but it doesnt: URI raw = new URI(urlString.trim()); appendLine("raw scheme= " + raw.getScheme() + "\n a...
[ "@", "Urlencoded", "private", "void", "openURL2", "(", "String", "urlString", ",", "Command", "cmd", ")", "{", "HTTPMethod", "m", ";", "try", "(", "HTTPSession", "httpclient", "=", "HTTPFactory", ".", "newSession", "(", "urlString", ")", ")", "{", "/* you mi...
Uses apache commons HttpClient
[ "Uses", "apache", "commons", "HttpClient" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/URLDumpPane.java#L251-L358
test
Open a URL with the specified command and URL encoded with HTTPSession
Of course, here is the Java code you requested: ```java @Urlencoded private void openURL2(String urlString, Command cmd) { HTTPMethod m; try (HTTPSession httpclient = HTTPFactory.newSession(urlString)) { /* you might think this works, but it doesnt: URI raw = new URI(urlString.trim()); ...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/KyeroReadingExample.java
KyeroReadingExample.printToConsole
protected static void printToConsole(KyeroDocument doc) throws JAXBException { Root root = doc.toObject(); // process properties in the document for (PropertyType obj : root.getProperty()) { // get object nr String objectNr = (obj.getId() != null) ? o...
java
protected static void printToConsole(KyeroDocument doc) throws JAXBException { Root root = doc.toObject(); // process properties in the document for (PropertyType obj : root.getProperty()) { // get object nr String objectNr = (obj.getId() != null) ? o...
[ "protected", "static", "void", "printToConsole", "(", "KyeroDocument", "doc", ")", "throws", "JAXBException", "{", "Root", "root", "=", "doc", ".", "toObject", "(", ")", ";", "// process properties in the document", "for", "(", "PropertyType", "obj", ":", "root", ...
Print some content of a {@link KyeroDocument} to console. @param doc the document to process @throws JAXBException if XML conversion into Java objects failed
[ "Print", "some", "content", "of", "a", "{", "@link", "KyeroDocument", "}", "to", "console", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/KyeroReadingExample.java#L132-L155
test
Print to console.
Of course, here is the Java code you requested: ```java protected static void printToConsole(KyeroDocument doc) throws JAXBException { Root root = doc.toObject(); // process properties in the document for (PropertyType obj : root.getProperty()) { // get object nr String...
cologneintelligence/FitGoodies
fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/ActionFixture.java
ActionFixture.start
public void start() throws Exception { actor = Class.forName(row.cells().get(1).getFitValue()).newInstance(); }
java
public void start() throws Exception { actor = Class.forName(row.cells().get(1).getFitValue()).newInstance(); }
[ "public", "void", "start", "(", ")", "throws", "Exception", "{", "actor", "=", "Class", ".", "forName", "(", "row", ".", "cells", "(", ")", ".", "get", "(", "1", ")", ".", "getFitValue", "(", ")", ")", ".", "newInstance", "(", ")", ";", "}" ]
Actions //////////////////////////////////
[ "Actions", "//////////////////////////////////" ]
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/ActionFixture.java#L74-L76
test
Start the test.
Of course, here is the Java code you requested: ```java public void start() throws Exception { actor = Class.forName(row.cells().get(1).getFitValue()).newInstance(); } ``` Hope this helps!
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/BigFunctions.java
BigFunctions.ln
public static BigDecimal ln (@Nonnull final BigDecimal x, final int scale) { // Check that x > 0. if (x.signum () <= 0) { throw new IllegalArgumentException ("x <= 0: " + x); } // The number of digits to the left of the decimal point. final int magnitude = x.toString ().length () - x.sc...
java
public static BigDecimal ln (@Nonnull final BigDecimal x, final int scale) { // Check that x > 0. if (x.signum () <= 0) { throw new IllegalArgumentException ("x <= 0: " + x); } // The number of digits to the left of the decimal point. final int magnitude = x.toString ().length () - x.sc...
[ "public", "static", "BigDecimal", "ln", "(", "@", "Nonnull", "final", "BigDecimal", "x", ",", "final", "int", "scale", ")", "{", "// Check that x > 0.", "if", "(", "x", ".", "signum", "(", ")", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException...
Compute the natural logarithm of x to a given scale, x &gt; 0. @param x Base value @param scale Scale @return ln(x)
[ "Compute", "the", "natural", "logarithm", "of", "x", "to", "a", "given", "scale", "x", "&gt", ";", "0", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/BigFunctions.java#L244-L270
test
Compute the ln of a number of digits.
Of course, here is the Java code you requested: ```java public static BigDecimal ln (@Nonnull final BigDecimal x, final int scale) { // Check that x > 0. if (x.signum () <= 0) { throw new IllegalArgumentException ("x <= 0: " + x); } // The number of digits to the left of the decimal point....
blazsolar/HorizontalPicker
HorizontalPicker/src/main/java/com/wefika/horizontalpicker/HorizontalPicker.java
HorizontalPicker.getColor
private int getColor(int scrollX, int position) { int itemWithPadding = (int) (itemWidth + dividerSize); float proportion = Math.abs(((1f * scrollX % itemWithPadding) / 2) / (itemWithPadding / 2f)); if(proportion > .5) { proportion = (proportion - .5f); } else { p...
java
private int getColor(int scrollX, int position) { int itemWithPadding = (int) (itemWidth + dividerSize); float proportion = Math.abs(((1f * scrollX % itemWithPadding) / 2) / (itemWithPadding / 2f)); if(proportion > .5) { proportion = (proportion - .5f); } else { p...
[ "private", "int", "getColor", "(", "int", "scrollX", ",", "int", "position", ")", "{", "int", "itemWithPadding", "=", "(", "int", ")", "(", "itemWidth", "+", "dividerSize", ")", ";", "float", "proportion", "=", "Math", ".", "abs", "(", "(", "(", "1f", ...
Calculates color for specific position on time picker @param scrollX @return
[ "Calculates", "color", "for", "specific", "position", "on", "time", "picker" ]
df93a4dd2515474d86b6704cbdeb00a3f98576c2
https://github.com/blazsolar/HorizontalPicker/blob/df93a4dd2515474d86b6704cbdeb00a3f98576c2/HorizontalPicker/src/main/java/com/wefika/horizontalpicker/HorizontalPicker.java#L938-L959
test
Get the color of the page which is used to display the page in the page.
Of course, here is the Java code you requested: ```java private int getColor(int scrollX, int position) { int itemWithPadding = (int) (itemWidth + dividerSize); float proportion = Math.abs(((1f * scrollX % itemWithPadding) / 2) / (itemWithPadding / 2f)); if(proportion > .5) { propor...
rest-assured/rest-assured
json-path/src/main/java/io/restassured/path/json/JsonPath.java
JsonPath.getFloat
public float getFloat(String path) { final Object value = get(path); //Groovy will always return a Double for floating point values. if (value instanceof Double) { return ((Double) value).floatValue(); } else { return ObjectConverter.convertObjectTo(value, Float.c...
java
public float getFloat(String path) { final Object value = get(path); //Groovy will always return a Double for floating point values. if (value instanceof Double) { return ((Double) value).floatValue(); } else { return ObjectConverter.convertObjectTo(value, Float.c...
[ "public", "float", "getFloat", "(", "String", "path", ")", "{", "final", "Object", "value", "=", "get", "(", "path", ")", ";", "//Groovy will always return a Double for floating point values.", "if", "(", "value", "instanceof", "Double", ")", "{", "return", "(", ...
Get the result of an Object path expression as a float. @param path The Object path. @return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object cannot be casted to the expected type.
[ "Get", "the", "result", "of", "an", "Object", "path", "expression", "as", "a", "float", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/JsonPath.java#L298-L306
test
Gets a float value from the cache.
Of course, here is the Java code you requested: ```java public float getFloat(String path) { final Object value = get(path); //Groovy will always return a Double for floating point values. if (value instanceof Double) { return ((Double) value).floatValue(); } else { ...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/CellControlsUtility.java
CellControlsUtility.setupControlAttributes
public static void setupControlAttributes(final int originRowIndex, final FacesCell fcell, final Cell poiCell, final SheetConfiguration sheetConfig, final CellAttributesMap cellAttributesMap) { int rowIndex = originRowIndex; if (rowIndex < 0) { rowIndex = poiCell.getRowIndex(); } String sk...
java
public static void setupControlAttributes(final int originRowIndex, final FacesCell fcell, final Cell poiCell, final SheetConfiguration sheetConfig, final CellAttributesMap cellAttributesMap) { int rowIndex = originRowIndex; if (rowIndex < 0) { rowIndex = poiCell.getRowIndex(); } String sk...
[ "public", "static", "void", "setupControlAttributes", "(", "final", "int", "originRowIndex", ",", "final", "FacesCell", "fcell", ",", "final", "Cell", "poiCell", ",", "final", "SheetConfiguration", "sheetConfig", ",", "final", "CellAttributesMap", "cellAttributesMap", ...
Setup control attributes. @param originRowIndex the origin row index @param fcell the fcell @param poiCell the poi cell @param sheetConfig the sheet config @param cellAttributesMap the cell attributes map
[ "Setup", "control", "attributes", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CellControlsUtility.java#L384-L418
test
Sets the control attributes of a cell.
Of course, here is the Java code you requested: ```java public static void setupControlAttributes(final int originRowIndex, final FacesCell fcell, final Cell poiCell, final SheetConfiguration sheetConfig, final CellAttributesMap cellAttributesMap) { int rowIndex = originRowIndex; if (rowIndex < 0) { ...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/properties/ParsedProperties.java
ParsedProperties.setPropertyIfNull
public int setPropertyIfNull(String propname, int value) { return Integer.parseInt(setPropertyIfNull(propname, Integer.toString(value))); }
java
public int setPropertyIfNull(String propname, int value) { return Integer.parseInt(setPropertyIfNull(propname, Integer.toString(value))); }
[ "public", "int", "setPropertyIfNull", "(", "String", "propname", ",", "int", "value", ")", "{", "return", "Integer", ".", "parseInt", "(", "setPropertyIfNull", "(", "propname", ",", "Integer", ".", "toString", "(", "value", ")", ")", ")", ";", "}" ]
Helper method for setting properties to defaults when they are not already set. @param propname The name of the system property to set. @param value The value to set it to. @return The value of the property after this method call.
[ "Helper", "method", "for", "setting", "properties", "to", "defaults", "when", "they", "are", "not", "already", "set", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ParsedProperties.java#L188-L191
test
Set the value of the property with the specified name to the specified value.
Of course, here is the Java code you requested: ```java public int setPropertyIfNull(String propname, int value) { return Integer.parseInt(setPropertyIfNull(propname, Integer.toString(value))); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/metric/ClosestPoint2D_F64.java
ClosestPoint2D_F64.closestPoint
public static Point2D_F64 closestPoint( LineGeneral2D_F64 line, Point2D_F64 p, Point2D_F64 output ) { if( output == null ) output = new Point2D_F64(); double AA = line.A*line.A; double AB = line.A*line.B; double BB = line.B*line.B; output.y = AA*p.y - AB*p.x - line.B*line.C; outpu...
java
public static Point2D_F64 closestPoint( LineGeneral2D_F64 line, Point2D_F64 p, Point2D_F64 output ) { if( output == null ) output = new Point2D_F64(); double AA = line.A*line.A; double AB = line.A*line.B; double BB = line.B*line.B; output.y = AA*p.y - AB*p.x - line.B*line.C; outpu...
[ "public", "static", "Point2D_F64", "closestPoint", "(", "LineGeneral2D_F64", "line", ",", "Point2D_F64", "p", ",", "Point2D_F64", "output", ")", "{", "if", "(", "output", "==", "null", ")", "output", "=", "new", "Point2D_F64", "(", ")", ";", "double", "AA", ...
<p> Finds the closest point on 'line' to the specified point. </p> @param line Line along which the closest point is to be found. @param p Point. @param output Where the solution is stored. If null a new instance is created. Modified. @return Closest point on the line.
[ "<p", ">", "Finds", "the", "closest", "point", "on", "line", "to", "the", "specified", "point", ".", "<", "/", "p", ">" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/ClosestPoint2D_F64.java#L47-L64
test
Computes the closest point from the line to the given point.
Of course, here is the Java code you requested: ```java public static Point2D_F64 closestPoint( LineGeneral2D_F64 line, Point2D_F64 p, Point2D_F64 output ) { if( output == null ) output = new Point2D_F64(); double AA = line.A*line.A; double AB = line.A*line.B; double BB = line.B*line....
RestComm/jain-slee
api/jar/src/main/java/javax/slee/management/ResourceAdaptorEntityNotification.java
ResourceAdaptorEntityNotification.getUsageMBeanProperties
public static String getUsageMBeanProperties(String entityName) { if (entityName == null) throw new NullPointerException("entityName is null"); return RESOURCE_ADAPTOR_ENTITY_NAME_KEY + '=' + ObjectName.quote(entityName); }
java
public static String getUsageMBeanProperties(String entityName) { if (entityName == null) throw new NullPointerException("entityName is null"); return RESOURCE_ADAPTOR_ENTITY_NAME_KEY + '=' + ObjectName.quote(entityName); }
[ "public", "static", "String", "getUsageMBeanProperties", "(", "String", "entityName", ")", "{", "if", "(", "entityName", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"entityName is null\"", ")", ";", "return", "RESOURCE_ADAPTOR_ENTITY_NAME_KEY", "...
Get a JMX Object Name property string that uniquely identifies the specified resource adaptor entity, suitable for inclusion in the Object Name of a Usage MBean. This method makes use of the {@link ObjectName#quote}</code> method to ensure that the resource adaptor entity name is valid for inclusion as property values...
[ "Get", "a", "JMX", "Object", "Name", "property", "string", "that", "uniquely", "identifies", "the", "specified", "resource", "adaptor", "entity", "suitable", "for", "inclusion", "in", "the", "Object", "Name", "of", "a", "Usage", "MBean", ".", "This", "method",...
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/management/ResourceAdaptorEntityNotification.java#L122-L125
test
Get the usage MBean properties string for the specified entity name.
Of course, here is the Java code you requested: ```java public static String getUsageMBeanProperties(String entityName) { if (entityName == null) throw new NullPointerException("entityName is null"); return RESOURCE_ADAPTOR_ENTITY_NAME_KEY + '=' + ObjectName.quote(entityName); } ``` Hope this help...
ReactiveX/RxJava
src/main/java/io/reactivex/processors/BehaviorProcessor.java
BehaviorProcessor.createDefault
@CheckReturnValue @NonNull public static <T> BehaviorProcessor<T> createDefault(T defaultValue) { ObjectHelper.requireNonNull(defaultValue, "defaultValue is null"); return new BehaviorProcessor<T>(defaultValue); }
java
@CheckReturnValue @NonNull public static <T> BehaviorProcessor<T> createDefault(T defaultValue) { ObjectHelper.requireNonNull(defaultValue, "defaultValue is null"); return new BehaviorProcessor<T>(defaultValue); }
[ "@", "CheckReturnValue", "@", "NonNull", "public", "static", "<", "T", ">", "BehaviorProcessor", "<", "T", ">", "createDefault", "(", "T", "defaultValue", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "defaultValue", ",", "\"defaultValue is null\"", ")", ...
Creates a {@link BehaviorProcessor} that emits the last item it observed and all subsequent items to each {@link Subscriber} that subscribes to it. @param <T> the type of item the BehaviorProcessor will emit @param defaultValue the item that will be emitted first to any {@link Subscriber} as long as the {@link Behavio...
[ "Creates", "a", "{", "@link", "BehaviorProcessor", "}", "that", "emits", "the", "last", "item", "it", "observed", "and", "all", "subsequent", "items", "to", "each", "{", "@link", "Subscriber", "}", "that", "subscribes", "to", "it", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/processors/BehaviorProcessor.java#L210-L215
test
Create a new instance of the default type.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public static <T> BehaviorProcessor<T> createDefault(T defaultValue) { ObjectHelper.requireNonNull(defaultValue, "defaultValue is null"); return new BehaviorProcessor<T>(defaultValue); } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/cq/CqQueueListener.java
CqQueueListener.close
@Override public void close() { if (cqQuery != null) { try { cqQuery.close(); } catch (Exception e){Debugger.println(e.getMessage());} } }
java
@Override public void close() { if (cqQuery != null) { try { cqQuery.close(); } catch (Exception e){Debugger.println(e.getMessage());} } }
[ "@", "Override", "public", "void", "close", "(", ")", "{", "if", "(", "cqQuery", "!=", "null", ")", "{", "try", "{", "cqQuery", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "Debugger", ".", "println", "(", "e", ".",...
------------------------------------------------
[ "------------------------------------------------" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/cq/CqQueueListener.java#L42-L49
test
Close the connection.
Of course, here is the Java code you requested: ```java @Override public void close() { if (cqQuery != null) { try { cqQuery.close(); } catch (Exception e){Debugger.println(e.getMessage());} } } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java
ServerProxy.restartModule
@Override public void restartModule(IModule[] module, IOperationListener listener) { // TODO Auto-generated method stub server.restartModule(module, listener); }
java
@Override public void restartModule(IModule[] module, IOperationListener listener) { // TODO Auto-generated method stub server.restartModule(module, listener); }
[ "@", "Override", "public", "void", "restartModule", "(", "IModule", "[", "]", "module", ",", "IOperationListener", "listener", ")", "{", "// TODO Auto-generated method stub", "server", ".", "restartModule", "(", "module", ",", "listener", ")", ";", "}" ]
/* (non-Javadoc) @see org.eclipse.wst.server.core.IServer#restartModule(org.eclipse.wst.server.core.IModule[], org.eclipse.wst.server.core.IServer.IOperationListener)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java#L541-L545
test
Restart a module.
Of course, here is the Java code you requested: ```java @Override public void restartModule(IModule[] module, IOperationListener listener) { // TODO Auto-generated method stub server.restartModule(module, listener); } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/dap/parsers/Dap2Parse.java
Dap2Parse.errparse
public int errparse(String text, DAP2Exception err) throws ParseException { return dapparse(text, null, null, err); }
java
public int errparse(String text, DAP2Exception err) throws ParseException { return dapparse(text, null, null, err); }
[ "public", "int", "errparse", "(", "String", "text", ",", "DAP2Exception", "err", ")", "throws", "ParseException", "{", "return", "dapparse", "(", "text", ",", "null", ",", "null", ",", "err", ")", ";", "}" ]
Call this to parse an error{} body
[ "Call", "this", "to", "parse", "an", "error", "{}", "body" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/parsers/Dap2Parse.java#L146-L151
test
This method is called to parse a sequence of CBE AUDENT SETTINGS from a String.
Of course, here is the Java code you requested: ```java public int errparse(String text, DAP2Exception err) throws ParseException { return dapparse(text, null, null, err); } ``` Hope this helps!
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
ASHelper.getServletForName
public static ServletMetaData getServletForName(final JBossWebMetaData jbossWebMD, final String servletName) { for (JBossServletMetaData servlet : jbossWebMD.getServlets()) { if (servlet.getName().equals(servletName)) { return servlet; } } return null; ...
java
public static ServletMetaData getServletForName(final JBossWebMetaData jbossWebMD, final String servletName) { for (JBossServletMetaData servlet : jbossWebMD.getServlets()) { if (servlet.getName().equals(servletName)) { return servlet; } } return null; ...
[ "public", "static", "ServletMetaData", "getServletForName", "(", "final", "JBossWebMetaData", "jbossWebMD", ",", "final", "String", "servletName", ")", "{", "for", "(", "JBossServletMetaData", "servlet", ":", "jbossWebMD", ".", "getServlets", "(", ")", ")", "{", "...
Returns servlet meta data for requested servlet name. @param jbossWebMD jboss web meta data @param servletName servlet name @return servlet meta data
[ "Returns", "servlet", "meta", "data", "for", "requested", "servlet", "name", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java#L136-L144
test
Gets the servlet metadata for the servlet with the specified name.
Of course, here is the Java code you requested: ```java public static ServletMetaData getServletForName(final JBossWebMetaData jbossWebMD, final String servletName) { for (JBossServletMetaData servlet : jbossWebMD.getServlets()) { if (servlet.getName().equals(servletName)) { return ...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/utils/DescriptorUtils.java
DescriptorUtils.validateDescriptor
public static String validateDescriptor(String descriptor) { if (descriptor.length() == 0) { throw EeLogger.ROOT_LOGGER.cannotBeEmpty("descriptors"); } if (descriptor.length() > 1) { if (descriptor.startsWith("L")) { if (!descriptor.endsWith(";")) { ...
java
public static String validateDescriptor(String descriptor) { if (descriptor.length() == 0) { throw EeLogger.ROOT_LOGGER.cannotBeEmpty("descriptors"); } if (descriptor.length() > 1) { if (descriptor.startsWith("L")) { if (!descriptor.endsWith(";")) { ...
[ "public", "static", "String", "validateDescriptor", "(", "String", "descriptor", ")", "{", "if", "(", "descriptor", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "EeLogger", ".", "ROOT_LOGGER", ".", "cannotBeEmpty", "(", "\"descriptors\"", ")", ";",...
performs basic validation on a descriptor
[ "performs", "basic", "validation", "on", "a", "descriptor" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/utils/DescriptorUtils.java#L184-L216
test
Validate the descriptor.
Of course, here is the Java code you requested: ```java public static String validateDescriptor(String descriptor) { if (descriptor.length() == 0) { throw EeLogger.ROOT_LOGGER.cannotBeEmpty("descriptors"); } if (descriptor.length() > 1) { if (descriptor.startsWith("L")) ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/IospHelper.java
IospHelper.makePrimitiveArray
static public Object makePrimitiveArray(int size, DataType dataType, Object fillValue) { if (dataType.getPrimitiveClassType() == byte.class || (dataType == DataType.CHAR)) { byte[] pa = new byte[size]; byte val = ((Number) fillValue).byteValue(); if (val != 0) for (int i = 0; i < si...
java
static public Object makePrimitiveArray(int size, DataType dataType, Object fillValue) { if (dataType.getPrimitiveClassType() == byte.class || (dataType == DataType.CHAR)) { byte[] pa = new byte[size]; byte val = ((Number) fillValue).byteValue(); if (val != 0) for (int i = 0; i < si...
[ "static", "public", "Object", "makePrimitiveArray", "(", "int", "size", ",", "DataType", "dataType", ",", "Object", "fillValue", ")", "{", "if", "(", "dataType", ".", "getPrimitiveClassType", "(", ")", "==", "byte", ".", "class", "||", "(", "dataType", "==",...
Create 1D primitive array of the given size and type, fill it with the given value @param size the size of the array to create @param dataType dataType of the variable @param fillValue must be Number if dataType.isNumeric(), or String for STRING, byte[] for Structure, or null for none @return primitive array wit...
[ "Create", "1D", "primitive", "array", "of", "the", "given", "size", "and", "type", "fill", "it", "with", "the", "given", "value" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/IospHelper.java#L634-L699
test
Make a primitive array of the specified size with the specified fill value.
Of course, here is the Java code you requested: ```java static public Object makePrimitiveArray(int size, DataType dataType, Object fillValue) { if (dataType.getPrimitiveClassType() == byte.class || (dataType == DataType.CHAR)) { byte[] pa = new byte[size]; byte val = ((Number) fillValue).byteValu...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/io/ClientInputStream.java
ClientInputStream.read
public int read(byte[] b) throws IOException { try { ByteBlock block = source.read(b); System.arraycopy(block.data, 0, b, 0, block.count); return block.count; } catch (RemoteException e) { throw new IOException("There was a Re...
java
public int read(byte[] b) throws IOException { try { ByteBlock block = source.read(b); System.arraycopy(block.data, 0, b, 0, block.count); return block.count; } catch (RemoteException e) { throw new IOException("There was a Re...
[ "public", "int", "read", "(", "byte", "[", "]", "b", ")", "throws", "IOException", "{", "try", "{", "ByteBlock", "block", "=", "source", ".", "read", "(", "b", ")", ";", "System", ".", "arraycopy", "(", "block", ".", "data", ",", "0", ",", "b", "...
Reads some number of bytes from the input stream and stores them into the buffer array b. @param b The buffer into which the data is read. @return The total number of bytes read into the buffer, or -1 is there is no more data because the end of the stream has been reached. @throws IOException If an I/O error occurs...
[ "Reads", "some", "number", "of", "bytes", "from", "the", "input", "stream", "and", "stores", "them", "into", "the", "buffer", "array", "b", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/io/ClientInputStream.java#L157-L171
test
Reads a single byte array from the source.
Of course, here is the Java code you requested: ```java public int read(byte[] b) throws IOException { try { ByteBlock block = source.read(b); System.arraycopy(block.data, 0, b, 0, block.count); return block.count; } catch (RemoteException e) ...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.distinct
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector, Callable<? extends Collection<? super K>> collectionSupplier) { ObjectHelper.requireNonNull(keySelector, "keySelector is null"); ObjectHelper.requireNonNull(coll...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector, Callable<? extends Collection<? super K>> collectionSupplier) { ObjectHelper.requireNonNull(keySelector, "keySelector is null"); ObjectHelper.requireNonNull(coll...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "K", ">", "Observable", "<", "T", ">", "distinct", "(", "Function", "<", "?", "super", "T", ",", "K", ">", "keySelector", ",", "Callable", ...
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct according to a key selector function and based on {@link Object#equals(Object)} comparison of the objects returned by the key selector function. <p> <img width="640" height="310" src="https://raw.github.com/wiki/Reactive...
[ "Returns", "an", "Observable", "that", "emits", "all", "items", "emitted", "by", "the", "source", "ObservableSource", "that", "are", "distinct", "according", "to", "a", "key", "selector", "function", "and", "based", "on", "{", "@link", "Object#equals", "(", "O...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7875-L7881
test
Asynchronous implementation of distinct operation.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <K> Observable<T> distinct(Function<? super T, K> keySelector, Callable<? extends Collection<? super K>> collectionSupplier) { ObjectHelper.requireNonNull(keySelector, "keySel...
leanix/leanix-sdk-java
src/main/resources/codegen-templates/net/leanix/api/common/ApiClientBuilder.java
ApiClientBuilder.withTokenProviderHost
public ApiClientBuilder withTokenProviderHost(String host) { withOAuth2TokenUrl(URI.create(String.format("https://%s/services/mtm/v1/oauth2/token", host))); return this; }
java
public ApiClientBuilder withTokenProviderHost(String host) { withOAuth2TokenUrl(URI.create(String.format("https://%s/services/mtm/v1/oauth2/token", host))); return this; }
[ "public", "ApiClientBuilder", "withTokenProviderHost", "(", "String", "host", ")", "{", "withOAuth2TokenUrl", "(", "URI", ".", "create", "(", "String", ".", "format", "(", "\"https://%s/services/mtm/v1/oauth2/token\"", ",", "host", ")", ")", ")", ";", "return", "t...
Specifies all urls needed to get an access token based on given host name and common url naming convention. @param host @return
[ "Specifies", "all", "urls", "needed", "to", "get", "an", "access", "token", "based", "on", "given", "host", "name", "and", "common", "url", "naming", "convention", "." ]
9516ac593d6a8f73baccc516a45877b4e5920c47
https://github.com/leanix/leanix-sdk-java/blob/9516ac593d6a8f73baccc516a45877b4e5920c47/src/main/resources/codegen-templates/net/leanix/api/common/ApiClientBuilder.java#L71-L74
test
Sets the host to use for token provider.
Of course, here is the Java code you requested: ```java public ApiClientBuilder withTokenProviderHost(String host) { withOAuth2TokenUrl(URI.create(String.format("https://%s/services/mtm/v1/oauth2/token", host))); return this; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.acquireDataset
static public NetcdfDataset acquireDataset(DatasetUrl location, ucar.nc2.util.CancelTask cancelTask) throws IOException { return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null); }
java
static public NetcdfDataset acquireDataset(DatasetUrl location, ucar.nc2.util.CancelTask cancelTask) throws IOException { return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null); }
[ "static", "public", "NetcdfDataset", "acquireDataset", "(", "DatasetUrl", "location", ",", "ucar", ".", "nc2", ".", "util", ".", "CancelTask", "cancelTask", ")", "throws", "IOException", "{", "return", "acquireDataset", "(", "null", ",", "location", ",", "defaul...
Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode, without the need of setting the enhanceMode via the signature. You still close with NetcdfDataset.close(), the release is handled automatically. You must first call initNetcdfFileCache() for caching to actually take place. @para...
[ "Same", "as", "openDataset", "but", "file", "is", "acquired", "through", "the", "File", "Cache", "with", "defaultEnhanceMode", "without", "the", "need", "of", "setting", "the", "enhanceMode", "via", "the", "signature", ".", "You", "still", "close", "with", "Ne...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L460-L462
test
Acquires a dataset from the specified location.
Of course, here is the Java code you requested: ```java static public NetcdfDataset acquireDataset(DatasetUrl location, ucar.nc2.util.CancelTask cancelTask) throws IOException { return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null); } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.internalServerError
public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
java
public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
[ "public", "static", "Result", "internalServerError", "(", "File", "content", ",", "boolean", "inline", ")", "{", "return", "internalServerError", "(", "content", ",", "inline", ",", "StaticFileMimeTypes", ".", "fileMimeTypes", "(", ")", ")", ";", "}" ]
Generates a 500 Internal Server Error result. @param content The file to send. @param inline Whether the file should be sent inline, or as an attachment. @return the result
[ "Generates", "a", "500", "Internal", "Server", "Error", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L4014-L4016
test
Returns an error response with an error message.
Of course, here is the Java code you requested: ```java public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/servlet/AbstractServlet.java
AbstractServlet.anyExceptionHandler
public void anyExceptionHandler(Throwable e, ReqState rs) { log.error("DODServlet ERROR (anyExceptionHandler): " + e); printThrowable(e); try { if(rs == null) throw new DAP2Exception("anyExceptionHandler: no request state provided"); log.error(rs.toString()); HttpServletRes...
java
public void anyExceptionHandler(Throwable e, ReqState rs) { log.error("DODServlet ERROR (anyExceptionHandler): " + e); printThrowable(e); try { if(rs == null) throw new DAP2Exception("anyExceptionHandler: no request state provided"); log.error(rs.toString()); HttpServletRes...
[ "public", "void", "anyExceptionHandler", "(", "Throwable", "e", ",", "ReqState", "rs", ")", "{", "log", ".", "error", "(", "\"DODServlet ERROR (anyExceptionHandler): \"", "+", "e", ")", ";", "printThrowable", "(", "e", ")", ";", "try", "{", "if", "(", "rs", ...
************************************************************************ Sends an error to the client. @param e The exception that caused the problem. @param rs The <code>ReqState</code> for the client.
[ "************************************************************************", "Sends", "an", "error", "to", "the", "client", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servlet/AbstractServlet.java#L420-L452
test
This is the exception handler method.
Of course, here is the Java code you requested: ```java public void anyExceptionHandler(Throwable e, ReqState rs) { log.error("DODServlet ERROR (anyExceptionHandler): " + e); printThrowable(e); try { if(rs == null) throw new DAP2Exception("anyExceptionHandler: no request state provided");...
Unidata/thredds
cdm/src/main/java/ucar/ma2/ArrayStructureMA.java
ArrayStructureMA.factoryMA
static public ArrayStructureMA factoryMA(Structure from, int[] shape) throws IOException { StructureMembers sm = from.makeStructureMembers(); for (Variable v : from.getVariables()) { Array data; if (v instanceof Sequence) { data = Array.factory(DataType.SEQUENCE, shape); // an array se...
java
static public ArrayStructureMA factoryMA(Structure from, int[] shape) throws IOException { StructureMembers sm = from.makeStructureMembers(); for (Variable v : from.getVariables()) { Array data; if (v instanceof Sequence) { data = Array.factory(DataType.SEQUENCE, shape); // an array se...
[ "static", "public", "ArrayStructureMA", "factoryMA", "(", "Structure", "from", ",", "int", "[", "]", "shape", ")", "throws", "IOException", "{", "StructureMembers", "sm", "=", "from", ".", "makeStructureMembers", "(", ")", ";", "for", "(", "Variable", "v", "...
Create an ArrayStructure for a Structure. Allow nested Structures. Create the data arrays, and an iterator. @param from copy from here. If from is a ArrayStructureMA, return it. @param shape the shape of the ArrayStructure @return equivilent ArrayStructureMA @throws java.io.IOException on error reading a sequence
[ "Create", "an", "ArrayStructure", "for", "a", "Structure", ".", "Allow", "nested", "Structures", ".", "Create", "the", "data", "arrays", "and", "an", "iterator", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayStructureMA.java#L281-L302
test
Creates an ArrayStructureMA object from the given structure.
Of course, here is the Java code you requested: ```java static public ArrayStructureMA factoryMA(Structure from, int[] shape) throws IOException { StructureMembers sm = from.makeStructureMembers(); for (Variable v : from.getVariables()) { Array data; if (v instanceof Sequence) { data =...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/tables/EcmwfLocalConcepts.java
EcmwfLocalConcepts.storeConcept
private void storeConcept(String tableVersion, String parameterNumber, String key, String value) { HashMap<String, HashMap<String, String>> tmpTable; if (localConcepts.containsKey(tableVersion)) { tmpTable = localConcepts.get(tableVersion); if (tmpTable.containsKey(parameterNumb...
java
private void storeConcept(String tableVersion, String parameterNumber, String key, String value) { HashMap<String, HashMap<String, String>> tmpTable; if (localConcepts.containsKey(tableVersion)) { tmpTable = localConcepts.get(tableVersion); if (tmpTable.containsKey(parameterNumb...
[ "private", "void", "storeConcept", "(", "String", "tableVersion", ",", "String", "parameterNumber", ",", "String", "key", ",", "String", "value", ")", "{", "HashMap", "<", "String", ",", "HashMap", "<", "String", ",", "String", ">", ">", "tmpTable", ";", "...
Store localConcept information in super HashMap localConcepts @param tableVersion - version of the table to add parameter to @param parameterNumber - parameter number @param key Type of metadata to be added (shortName, Description, Units) @param value Value of metadata
[ "Store", "localConcept", "information", "in", "super", "HashMap", "localConcepts" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/tables/EcmwfLocalConcepts.java#L144-L168
test
Store a single concept in the database.
Of course, here is the Java code you requested: ```java private void storeConcept(String tableVersion, String parameterNumber, String key, String value) { HashMap<String, HashMap<String, String>> tmpTable; if (localConcepts.containsKey(tableVersion)) { tmpTable = localConcepts.get(tableVer...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/io/ClientInputStream.java
ClientInputStream.read
public int read(byte[] b, int off, int len) throws IOException { try { ByteBlock block = source.read(b, off, len); System.arraycopy(block.data, off, b, off, len); return block.count; } catch (RemoteException e) { throw new IOE...
java
public int read(byte[] b, int off, int len) throws IOException { try { ByteBlock block = source.read(b, off, len); System.arraycopy(block.data, off, b, off, len); return block.count; } catch (RemoteException e) { throw new IOE...
[ "public", "int", "read", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "try", "{", "ByteBlock", "block", "=", "source", ".", "read", "(", "b", ",", "off", ",", "len", ")", ";", "System", ".",...
Reads up to len bytes of data from the input stream into an array of bytes. @param b The buffer into which the data is read. @param off The start offset in array b at which the data is written. @param len The maximum number of bytes to read. @return The total number of bytes read into the buffer, or -1 is there ...
[ "Reads", "up", "to", "len", "bytes", "of", "data", "from", "the", "input", "stream", "into", "an", "array", "of", "bytes", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/io/ClientInputStream.java#L186-L200
test
Read a block of bytes from the source.
Of course, here is the Java code you requested: ```java public int read(byte[] b, int off, int len) throws IOException { try { ByteBlock block = source.read(b, off, len); System.arraycopy(block.data, off, b, off, len); return block.count; } catc...
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFile.java
NetcdfFile.readSection
public Array readSection(String variableSection) throws IOException, InvalidRangeException { /* if (unlocked) throw new IllegalStateException("File is unlocked - cannot use"); */ ParsedSectionSpec cer = ParsedSectionSpec.parseVariableSection(this, variableSection); if (cer.child == null) { retu...
java
public Array readSection(String variableSection) throws IOException, InvalidRangeException { /* if (unlocked) throw new IllegalStateException("File is unlocked - cannot use"); */ ParsedSectionSpec cer = ParsedSectionSpec.parseVariableSection(this, variableSection); if (cer.child == null) { retu...
[ "public", "Array", "readSection", "(", "String", "variableSection", ")", "throws", "IOException", ",", "InvalidRangeException", "{", "/* if (unlocked)\n throw new IllegalStateException(\"File is unlocked - cannot use\"); */", "ParsedSectionSpec", "cer", "=", "ParsedSectionSpec",...
Read a variable using the given section specification. The result is always an array of the type of the innermost variable. Its shape is the accumulation of all the shapes of its parent structures. @param variableSection the constraint expression. @return data requested @throws IOException if error @throws I...
[ "Read", "a", "variable", "using", "the", "given", "section", "specification", ".", "The", "result", "is", "always", "an", "array", "of", "the", "type", "of", "the", "innermost", "variable", ".", "Its", "shape", "is", "the", "accumulation", "of", "all", "th...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L2109-L2123
test
Read the variable section.
Of course, here is the Java code you requested: ```java public Array readSection(String variableSection) throws IOException, InvalidRangeException { /* if (unlocked) throw new IllegalStateException("File is unlocked - cannot use"); */ ParsedSectionSpec cer = ParsedSectionSpec.parseVariableSection(this, ...
oblac/jodd
jodd-db/src/main/java/jodd/db/type/FloatSqlType.java
FloatSqlType.set
@Override public void set(final PreparedStatement st, final int index, final Float value, final int dbSqlType) throws SQLException { st.setFloat(index, value.floatValue()); }
java
@Override public void set(final PreparedStatement st, final int index, final Float value, final int dbSqlType) throws SQLException { st.setFloat(index, value.floatValue()); }
[ "@", "Override", "public", "void", "set", "(", "final", "PreparedStatement", "st", ",", "final", "int", "index", ",", "final", "Float", "value", ",", "final", "int", "dbSqlType", ")", "throws", "SQLException", "{", "st", ".", "setFloat", "(", "index", ",",...
{@inheritDoc}
[ "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/type/FloatSqlType.java#L45-L48
test
Set a Float value in the PreparedStatement.
Of course, here is the Java code you requested: ```java @Override public void set(final PreparedStatement st, final int index, final Float value, final int dbSqlType) throws SQLException { st.setFloat(index, value.floatValue()); } ``` Hope this helps!
js-lib-com/tiny-container
src/main/java/js/container/ArgumentsProcessor.java
ArgumentsProcessor.preProcessArguments
public Object[] preProcessArguments(ManagedClassSPI managedClass, Object... args) { // arguments can be null if on invocations chain there is Proxy handler invoked with no arguments if (args == null) { args = EMPTY_ARGS; } if (managedClass.getImplementationClass() == null) { return args; } Con...
java
public Object[] preProcessArguments(ManagedClassSPI managedClass, Object... args) { // arguments can be null if on invocations chain there is Proxy handler invoked with no arguments if (args == null) { args = EMPTY_ARGS; } if (managedClass.getImplementationClass() == null) { return args; } Con...
[ "public", "Object", "[", "]", "preProcessArguments", "(", "ManagedClassSPI", "managedClass", ",", "Object", "...", "args", ")", "{", "// arguments can be null if on invocations chain there is Proxy handler invoked with no arguments\r", "if", "(", "args", "==", "null", ")", ...
Pre-process constructor arguments for local managed classes. A managed class is <code>local</code> if is of {@link InstanceType#POJO} or {@link InstanceType#PROXY} type. Attempting to pre-process arguments for other managed class types is silently ignored. This method delegates {@link #preProcessArguments(ManagedClassS...
[ "Pre", "-", "process", "constructor", "arguments", "for", "local", "managed", "classes", ".", "A", "managed", "class", "is", "<code", ">", "local<", "/", "code", ">", "if", "is", "of", "{", "@link", "InstanceType#POJO", "}", "or", "{", "@link", "InstanceTy...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ArgumentsProcessor.java#L33-L49
test
Pre - processes arguments for a managed class.
Of course, here is the Java code you requested: ```java public Object[] preProcessArguments(ManagedClassSPI managedClass, Object... args) { // arguments can be null if on invocations chain there is Proxy handler invoked with no arguments if (args == null) { args = EMPTY_ARGS; } if (managedClass.getImpl...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java
JCublas2.cublasSasum
public static int cublasSasum( cublasHandle handle, int n, Pointer x, int incx, Pointer result)/** host or device pointer */ { return checkResult(cublasSasumNative(handle, n, x, incx, result)); }
java
public static int cublasSasum( cublasHandle handle, int n, Pointer x, int incx, Pointer result)/** host or device pointer */ { return checkResult(cublasSasumNative(handle, n, x, incx, result)); }
[ "public", "static", "int", "cublasSasum", "(", "cublasHandle", "handle", ",", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "result", ")", "/** host or device pointer */", "{", "return", "checkResult", "(", "cublasSasumNative", "(", "handl...
host or device pointer
[ "host", "or", "device", "pointer" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java#L1444-L1452
test
Compute the SASUM for a UNIQUE A record set.
Of course, here is the Java code you requested: ```java public static int cublasSasum( cublasHandle handle, int n, Pointer x, int incx, Pointer result)/** host or device pointer */ { return checkResult(cublasSasumNative(handle, n, x, incx, result)); }...
blademainer/common_utils
qrcode/src/main/java/com/xiongyingqi/qrcode/QRCode.java
QRCode.decode
public String decode(String path) throws IOException, NotFoundException { if (path == null || path.equals("")) { System.out.println("文件路径不能为空!"); } File file = new File(path); BufferedImage image = ImageIO.read(file); /*判断是否是图片*/ if (image != null) { ...
java
public String decode(String path) throws IOException, NotFoundException { if (path == null || path.equals("")) { System.out.println("文件路径不能为空!"); } File file = new File(path); BufferedImage image = ImageIO.read(file); /*判断是否是图片*/ if (image != null) { ...
[ "public", "String", "decode", "(", "String", "path", ")", "throws", "IOException", ",", "NotFoundException", "{", "if", "(", "path", "==", "null", "||", "path", ".", "equals", "(", "\"\"", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"文件...
解析二维码 @param path 图片的绝对路径
[ "解析二维码" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/qrcode/src/main/java/com/xiongyingqi/qrcode/QRCode.java#L198-L209
test
Decode a file in a Base64 encoded string.
Of course, here is the Java code you requested: ```java public String decode(String path) throws IOException, NotFoundException { if (path == null || path.equals("")) { System.out.println("文件路径不能为空!"); } File file = new File(path); BufferedImage image = ImageIO.read(file); ...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.oauth2
public static AuthenticationScheme oauth2(String accessToken, OAuthSignature signature) { OAuth2Scheme scheme = new OAuth2Scheme(); scheme.setAccessToken(accessToken); scheme.setSignature(signature); return scheme; }
java
public static AuthenticationScheme oauth2(String accessToken, OAuthSignature signature) { OAuth2Scheme scheme = new OAuth2Scheme(); scheme.setAccessToken(accessToken); scheme.setSignature(signature); return scheme; }
[ "public", "static", "AuthenticationScheme", "oauth2", "(", "String", "accessToken", ",", "OAuthSignature", "signature", ")", "{", "OAuth2Scheme", "scheme", "=", "new", "OAuth2Scheme", "(", ")", ";", "scheme", ".", "setAccessToken", "(", "accessToken", ")", ";", ...
OAuth sign the request. Note that this currently does not wait for a WWW-Authenticate challenge before sending the the OAuth header. All requests to all domains will be signed for this instance. @param accessToken @param signature @return The authentication scheme
[ "OAuth", "sign", "the", "request", ".", "Note", "that", "this", "currently", "does", "not", "wait", "for", "a", "WWW", "-", "Authenticate", "challenge", "before", "sending", "the", "the", "OAuth", "header", ".", "All", "requests", "to", "all", "domains", "...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1395-L1400
test
Create an OAuth2 AuthenticationScheme
Of course, here is the Java code you requested: ```java public static AuthenticationScheme oauth2(String accessToken, OAuthSignature signature) { OAuth2Scheme scheme = new OAuth2Scheme(); scheme.setAccessToken(accessToken); scheme.setSignature(signature); return scheme; } ``` Hope ...
truward/brikar
brikar-server/src/main/java/com/truward/brikar/server/context/StandardWebApplicationContextInitializer.java
StandardWebApplicationContextInitializer.register
@Nonnull public static AutoCloseable register(@Nonnull ServletInitializer servletInitializer, @Nonnull PropertySource<?> source) { final BigInteger bigInteger = new BigInteger(64, ThreadLocalRandom.current()); final String key = bigInteger.toString(16); if (PROPERTI...
java
@Nonnull public static AutoCloseable register(@Nonnull ServletInitializer servletInitializer, @Nonnull PropertySource<?> source) { final BigInteger bigInteger = new BigInteger(64, ThreadLocalRandom.current()); final String key = bigInteger.toString(16); if (PROPERTI...
[ "@", "Nonnull", "public", "static", "AutoCloseable", "register", "(", "@", "Nonnull", "ServletInitializer", "servletInitializer", ",", "@", "Nonnull", "PropertySource", "<", "?", ">", "source", ")", "{", "final", "BigInteger", "bigInteger", "=", "new", "BigInteger...
Encapsulates the logic for associating property source with a given servlet. @param servletInitializer A callback that encapsulates the call to the container specific way to set init parameter @param source Property source, that needs to be registered and later available to the spring context @return A closeable insta...
[ "Encapsulates", "the", "logic", "for", "associating", "property", "source", "with", "a", "given", "servlet", "." ]
9a2f6d0149b281fff0f704f169021187f5f9115f
https://github.com/truward/brikar/blob/9a2f6d0149b281fff0f704f169021187f5f9115f/brikar-server/src/main/java/com/truward/brikar/server/context/StandardWebApplicationContextInitializer.java#L60-L81
test
Register a new resource with the given servlet initializer and a property source.
Of course, here is the Java code you requested: ```java @Nonnull public static AutoCloseable register(@Nonnull ServletInitializer servletInitializer, @Nonnull PropertySource<?> source) { final BigInteger bigInteger = new BigInteger(64, ThreadLocalRandom.current()); fina...
Unidata/thredds
cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java
RandomAccessFile.readIntUnbuffered
public final int readIntUnbuffered(long pos) throws IOException { byte[] bb = new byte[4]; read_(pos, bb, 0, 4); int ch1 = bb[0] & 0xff; int ch2 = bb[1] & 0xff; int ch3 = bb[2] & 0xff; int ch4 = bb[3] & 0xff; if ((ch1 | ch2 | ch3 | ch4) < 0) { throw new EOFException(); } ...
java
public final int readIntUnbuffered(long pos) throws IOException { byte[] bb = new byte[4]; read_(pos, bb, 0, 4); int ch1 = bb[0] & 0xff; int ch2 = bb[1] & 0xff; int ch3 = bb[2] & 0xff; int ch4 = bb[3] & 0xff; if ((ch1 | ch2 | ch3 | ch4) < 0) { throw new EOFException(); } ...
[ "public", "final", "int", "readIntUnbuffered", "(", "long", "pos", ")", "throws", "IOException", "{", "byte", "[", "]", "bb", "=", "new", "byte", "[", "4", "]", ";", "read_", "(", "pos", ",", "bb", ",", "0", ",", "4", ")", ";", "int", "ch1", "=",...
Read an integer at the given position, bypassing all buffering. @param pos read a byte at this position @return The int that was read @throws IOException if an I/O error occurs.
[ "Read", "an", "integer", "at", "the", "given", "position", "bypassing", "all", "buffering", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L1234-L1250
test
Reads an int from the input stream without writing to the stream.
Of course, here is the Java code you requested: ```java public final int readIntUnbuffered(long pos) throws IOException { byte[] bb = new byte[4]; read_(pos, bb, 0, 4); int ch1 = bb[0] & 0xff; int ch2 = bb[1] & 0xff; int ch3 = bb[2] & 0xff; int ch4 = bb[3] & 0xff; if ((ch1 | ch2 | ch...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createPersonennummer
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "personennummer") public JAXBElement<String> createPersonennummer(String value) { return new JAXBElement<String>(_Personennummer_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "personennummer") public JAXBElement<String> createPersonennummer(String value) { return new JAXBElement<String>(_Personennummer_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"personennummer\"", ")", "public", "JAXBElement", "<", "String", ">", "createPersonennummer", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "Str...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1090-L1093
test
Create an instance of a Personennummer in the immoxml. de.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "personennummer") public JAXBElement<String> createPersonennummer(String value) { return new JAXBElement<String>(_Personennummer_QNAME, String.class, null, value); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/properties/ParsedProperties.java
ParsedProperties.setPropertyIfNull
public short setPropertyIfNull(String propname, short value) { return Short.parseShort(setPropertyIfNull(propname, Short.toString(value))); }
java
public short setPropertyIfNull(String propname, short value) { return Short.parseShort(setPropertyIfNull(propname, Short.toString(value))); }
[ "public", "short", "setPropertyIfNull", "(", "String", "propname", ",", "short", "value", ")", "{", "return", "Short", ".", "parseShort", "(", "setPropertyIfNull", "(", "propname", ",", "Short", ".", "toString", "(", "value", ")", ")", ")", ";", "}" ]
Helper method for setting properties to defaults when they are not already set. @param propname The name of the system property to set. @param value The value to set it to. @return The value of the property after this method call.
[ "Helper", "method", "for", "setting", "properties", "to", "defaults", "when", "they", "are", "not", "already", "set", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ParsedProperties.java#L175-L178
test
Sets a property of type CID to the given value.
Of course, here is the Java code you requested: ```java public short setPropertyIfNull(String propname, short value) { return Short.parseShort(setPropertyIfNull(propname, Short.toString(value))); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.flatMapMaybe
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> flatMapMaybe(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return flatMapMaybe(mapper, false, Integer.MAX_VALUE); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> flatMapMaybe(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return flatMapMaybe(mapper, false, Integer.MAX_VALUE); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "UNBOUNDED_IN", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Flowable", "<", "R", ">", "flatMapMaybe", "(", "Functio...
Maps each element of the upstream Flowable into MaybeSources, subscribes to all of them and merges their onSuccess values, in no particular order, into a single Flowable sequence. <dl> <dt><b>Backpressure:</b></dt> <dd>The operator consumes the upstream in an unbounded manner.</dd> <dt><b>Scheduler:</b></dt> <dd>{@code...
[ "Maps", "each", "element", "of", "the", "upstream", "Flowable", "into", "MaybeSources", "subscribes", "to", "all", "of", "them", "and", "merges", "their", "onSuccess", "values", "in", "no", "particular", "order", "into", "a", "single", "Flowable", "sequence", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L10283-L10288
test
Flattens the source MaybeSource into an Flowable of the type T using the provided Function.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final <R> Flowable<R> flatMapMaybe(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return flatMapMaybe(mapp...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/dataobjects/CachedCells.java
CachedCells.isValueChanged
public final boolean isValueChanged(final Cell cell) { String newValue = CellUtility.getCellValueWithFormat(cell, parent.getFormulaEvaluator(), parent.getDataFormatter()); return isValueChanged(cell, newValue); }
java
public final boolean isValueChanged(final Cell cell) { String newValue = CellUtility.getCellValueWithFormat(cell, parent.getFormulaEvaluator(), parent.getDataFormatter()); return isValueChanged(cell, newValue); }
[ "public", "final", "boolean", "isValueChanged", "(", "final", "Cell", "cell", ")", "{", "String", "newValue", "=", "CellUtility", ".", "getCellValueWithFormat", "(", "cell", ",", "parent", ".", "getFormulaEvaluator", "(", ")", ",", "parent", ".", "getDataFormatt...
Checks if is value changed. @param cell the cell @return true, if is value changed
[ "Checks", "if", "is", "value", "changed", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/dataobjects/CachedCells.java#L126-L130
test
Check if the value of a cell has changed.
Of course, here is the Java code you requested: ```java public final boolean isValueChanged(final Cell cell) { String newValue = CellUtility.getCellValueWithFormat(cell, parent.getFormulaEvaluator(), parent.getDataFormatter()); return isValueChanged(cell, newValue); } ``` Hope this helps!
jkuhnert/ognl
src/main/java/ognl/OgnlRuntime.java
OgnlRuntime.getTargetClass
public static Class getTargetClass(Object o) { return (o == null) ? null : ((o instanceof Class) ? (Class) o : o.getClass()); }
java
public static Class getTargetClass(Object o) { return (o == null) ? null : ((o instanceof Class) ? (Class) o : o.getClass()); }
[ "public", "static", "Class", "getTargetClass", "(", "Object", "o", ")", "{", "return", "(", "o", "==", "null", ")", "?", "null", ":", "(", "(", "o", "instanceof", "Class", ")", "?", "(", "Class", ")", "o", ":", "o", ".", "getClass", "(", ")", ")"...
Gets the "target" class of an object for looking up accessors that are registered on the target. If the object is a Class object this will return the Class itself, else it will return object's getClass() result.
[ "Gets", "the", "target", "class", "of", "an", "object", "for", "looking", "up", "accessors", "that", "are", "registered", "on", "the", "target", ".", "If", "the", "object", "is", "a", "Class", "object", "this", "will", "return", "the", "Class", "itself", ...
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlRuntime.java#L443-L446
test
Get the target class of the object.
Of course, here is the Java code you requested: ```java public static Class getTargetClass(Object o) { return (o == null) ? null : ((o instanceof Class) ? (Class) o : o.getClass()); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/findfile/ClassScanner.java
ClassScanner.scanJarFile
protected void scanJarFile(final File file) { final ZipFile zipFile; try { zipFile = new ZipFile(file); } catch (IOException ioex) { if (!ignoreException) { throw new FindFileException("Invalid zip: " + file.getName(), ioex); } return; } final Enumeration entries = zipFile.entries(); while (...
java
protected void scanJarFile(final File file) { final ZipFile zipFile; try { zipFile = new ZipFile(file); } catch (IOException ioex) { if (!ignoreException) { throw new FindFileException("Invalid zip: " + file.getName(), ioex); } return; } final Enumeration entries = zipFile.entries(); while (...
[ "protected", "void", "scanJarFile", "(", "final", "File", "file", ")", "{", "final", "ZipFile", "zipFile", ";", "try", "{", "zipFile", "=", "new", "ZipFile", "(", "file", ")", ";", "}", "catch", "(", "IOException", "ioex", ")", "{", "if", "(", "!", "...
Scans classes inside single JAR archive. Archive is scanned as a zip file. @see #onEntry(ClassPathEntry)
[ "Scans", "classes", "inside", "single", "JAR", "archive", ".", "Archive", "is", "scanned", "as", "a", "zip", "file", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/findfile/ClassScanner.java#L267-L307
test
Scan the given jar file for classes and resources.
Of course, here is the Java code you requested: ```java protected void scanJarFile(final File file) { final ZipFile zipFile; try { zipFile = new ZipFile(file); } catch (IOException ioex) { if (!ignoreException) { throw new FindFileException("Invalid zip: " + file.getName(), ioex); } return; } ...
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java
D4Cursor.setElements
public D4Cursor setElements(D4Cursor[] instances) { if(!(getScheme() == Scheme.SEQARRAY || getScheme() == Scheme.STRUCTARRAY)) throw new IllegalStateException("Adding element to !(structure|sequence array) object"); DapVariable var = (DapVariable) getTemplate(); ...
java
public D4Cursor setElements(D4Cursor[] instances) { if(!(getScheme() == Scheme.SEQARRAY || getScheme() == Scheme.STRUCTARRAY)) throw new IllegalStateException("Adding element to !(structure|sequence array) object"); DapVariable var = (DapVariable) getTemplate(); ...
[ "public", "D4Cursor", "setElements", "(", "D4Cursor", "[", "]", "instances", ")", "{", "if", "(", "!", "(", "getScheme", "(", ")", "==", "Scheme", ".", "SEQARRAY", "||", "getScheme", "(", ")", "==", "Scheme", ".", "STRUCTARRAY", ")", ")", "throw", "new...
D4Cursor Extensions
[ "D4Cursor", "Extensions" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java#L349-L358
test
Set the elements of the sequence array.
Of course, here is the Java code you requested: ```java public D4Cursor setElements(D4Cursor[] instances) { if(!(getScheme() == Scheme.SEQARRAY || getScheme() == Scheme.STRUCTARRAY)) throw new IllegalStateException("Adding element to !(structure|sequence array) object"); ...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java
EntityHelper.setMethodOfBeanByField
public static Method setMethodOfBeanByField(Class<?> clazz, Field field) { return prefixMethodOfBeanByField("set", clazz, field, field.getType()); }
java
public static Method setMethodOfBeanByField(Class<?> clazz, Field field) { return prefixMethodOfBeanByField("set", clazz, field, field.getType()); }
[ "public", "static", "Method", "setMethodOfBeanByField", "(", "Class", "<", "?", ">", "clazz", ",", "Field", "field", ")", "{", "return", "prefixMethodOfBeanByField", "(", "\"set\"", ",", "clazz", ",", "field", ",", "field", ".", "getType", "(", ")", ")", "...
根据字段获取Class类的set方法 <br> 2013-10-21 下午12:05:53 @param clazz @param field @return
[ "根据字段获取Class类的set方法", "<br", ">", "2013", "-", "10", "-", "21", "下午12", ":", "05", ":", "53" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java#L323-L325
test
Gets the method of bean by field.
Of course, here is the Java code you requested: ```java public static Method setMethodOfBeanByField(Class<?> clazz, Field field) { return prefixMethodOfBeanByField("set", clazz, field, field.getType()); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/concurrent/LockFreeNQueue.java
LockFreeNQueue.offer
public boolean offer(E o) { /*log.fine("public boolean offer(E o): called");*/ /*log.fine("o = " + o);*/ // Ensure that the item to add is not null. if (o == null) { throw new IllegalArgumentException("The 'o' parameter may not be null."); } // D...
java
public boolean offer(E o) { /*log.fine("public boolean offer(E o): called");*/ /*log.fine("o = " + o);*/ // Ensure that the item to add is not null. if (o == null) { throw new IllegalArgumentException("The 'o' parameter may not be null."); } // D...
[ "public", "boolean", "offer", "(", "E", "o", ")", "{", "/*log.fine(\"public boolean offer(E o): called\");*/", "/*log.fine(\"o = \" + o);*/", "// Ensure that the item to add is not null.", "if", "(", "o", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "...
Inserts the specified element onto the tail of this queue. @param o the element to add, may not be null. @return <tt>true</tt> (as per the general contract of <tt>Queue.offer</tt>). @todo Compare and set possibly not needed after the succesfull tail join. Straight update looks like it should work? I may have miss...
[ "Inserts", "the", "specified", "element", "onto", "the", "tail", "of", "this", "queue", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/concurrent/LockFreeNQueue.java#L206-L275
test
Offer an element to the cache.
Of course, here is the Java code you requested: ```java public boolean offer(E o) { /*log.fine("public boolean offer(E o): called");*/ /*log.fine("o = " + o);*/ // Ensure that the item to add is not null. if (o == null) { throw new IllegalArgumentException("The ...
js-lib-com/tiny-container
src/main/java/js/servlet/AppServlet.java
AppServlet.sendJsonObject
protected static void sendJsonObject(RequestContext context, Object object, int statusCode) throws IOException { final HttpServletResponse httpResponse = context.getResponse(); if (httpResponse.isCommitted()) { log.fatal("Abort HTTP transaction. Attempt to send JSON object after reponse commited."); retur...
java
protected static void sendJsonObject(RequestContext context, Object object, int statusCode) throws IOException { final HttpServletResponse httpResponse = context.getResponse(); if (httpResponse.isCommitted()) { log.fatal("Abort HTTP transaction. Attempt to send JSON object after reponse commited."); retur...
[ "protected", "static", "void", "sendJsonObject", "(", "RequestContext", "context", ",", "Object", "object", ",", "int", "statusCode", ")", "throws", "IOException", "{", "final", "HttpServletResponse", "httpResponse", "=", "context", ".", "getResponse", "(", ")", "...
Send object back to client encoded JSON with given HTTP status code. Take care to set content type, length and language. Content language is extracted from request context locale. @param context running request context, @param object object to serialize back to client, @param statusCode response status code. @throws I...
[ "Send", "object", "back", "to", "client", "encoded", "JSON", "with", "given", "HTTP", "status", "code", ".", "Take", "care", "to", "set", "content", "type", "length", "and", "language", ".", "Content", "language", "is", "extracted", "from", "request", "conte...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/AppServlet.java#L347-L366
test
Sends a JSON object to the client.
Of course, here is the Java code you requested: ```java protected static void sendJsonObject(RequestContext context, Object object, int statusCode) throws IOException { final HttpServletResponse httpResponse = context.getResponse(); if (httpResponse.isCommitted()) { log.fatal("Abort HTTP transaction. Attempt...
apache/parquet-mr
parquet-column/src/main/java/org/apache/parquet/internal/filter2/columnindex/RowRanges.java
RowRanges.create
static RowRanges create(long rowCount, PrimitiveIterator.OfInt pageIndexes, OffsetIndex offsetIndex) { RowRanges ranges = new RowRanges(); while (pageIndexes.hasNext()) { int pageIndex = pageIndexes.nextInt(); ranges.add(new Range(offsetIndex.getFirstRowIndex(pageIndex), offsetIndex.getLastRowIndex(...
java
static RowRanges create(long rowCount, PrimitiveIterator.OfInt pageIndexes, OffsetIndex offsetIndex) { RowRanges ranges = new RowRanges(); while (pageIndexes.hasNext()) { int pageIndex = pageIndexes.nextInt(); ranges.add(new Range(offsetIndex.getFirstRowIndex(pageIndex), offsetIndex.getLastRowIndex(...
[ "static", "RowRanges", "create", "(", "long", "rowCount", ",", "PrimitiveIterator", ".", "OfInt", "pageIndexes", ",", "OffsetIndex", "offsetIndex", ")", "{", "RowRanges", "ranges", "=", "new", "RowRanges", "(", ")", ";", "while", "(", "pageIndexes", ".", "hasN...
/* Creates a new RowRanges object with the following ranges. [firstRowIndex[0], lastRowIndex[0]], [firstRowIndex[1], lastRowIndex[1]], ..., [firstRowIndex[n], lastRowIndex[n]] (See OffsetIndex.getFirstRowIndex and OffsetIndex.getLastRowIndex for details.) The union of the ranges are calculated so the result ranges alw...
[ "/", "*", "Creates", "a", "new", "RowRanges", "object", "with", "the", "following", "ranges", ".", "[", "firstRowIndex", "[", "0", "]", "lastRowIndex", "[", "0", "]]", "[", "firstRowIndex", "[", "1", "]", "lastRowIndex", "[", "1", "]]", "...", "[", "fi...
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/internal/filter2/columnindex/RowRanges.java#L116-L123
test
Create a RowRanges object from a list of page indexes and an offset index.
Of course, here is the Java code you requested: ```java static RowRanges create(long rowCount, PrimitiveIterator.OfInt pageIndexes, OffsetIndex offsetIndex) { RowRanges ranges = new RowRanges(); while (pageIndexes.hasNext()) { int pageIndex = pageIndexes.nextInt(); ranges.add(new Range(offsetIndex....
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil.outChars
protected static void outChars(final File dest, final char[] data, final String encoding, final boolean append) throws IOException { if (dest.exists()) { checkIsFile(dest); } Writer out = new BufferedWriter(StreamUtil.outputStreamWriterOf(new FileOutputStream(dest, append), encoding)); try { out.write(dat...
java
protected static void outChars(final File dest, final char[] data, final String encoding, final boolean append) throws IOException { if (dest.exists()) { checkIsFile(dest); } Writer out = new BufferedWriter(StreamUtil.outputStreamWriterOf(new FileOutputStream(dest, append), encoding)); try { out.write(dat...
[ "protected", "static", "void", "outChars", "(", "final", "File", "dest", ",", "final", "char", "[", "]", "data", ",", "final", "String", "encoding", ",", "final", "boolean", "append", ")", "throws", "IOException", "{", "if", "(", "dest", ".", "exists", "...
Writes characters to {@link File} destination. @param dest destination {@link File} @param data Data as a {@link String} @param encoding Encoding as a {@link String} @param append {@code true} if appending; {@code false} if {@link File} should be overwritten. @throws IOException if something went wrong.
[ "Writes", "characters", "to", "{", "@link", "File", "}", "destination", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L658-L668
test
Write a char array to a file.
Of course, here is the Java code you requested: ```java protected static void outChars(final File dest, final char[] data, final String encoding, final boolean append) throws IOException { if (dest.exists()) { checkIsFile(dest); } Writer out = new BufferedWriter(StreamUtil.outputStreamWriterOf(new FileOutputS...
streamsets/datacollector
commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java
ProtobufTypeUtil.populateDefaultsAndExtensions
public static void populateDefaultsAndExtensions( Map<String, Descriptors.FileDescriptor> fileDescriptorMap, Map<String, Set<Descriptors.FieldDescriptor>> typeToExtensionMap, Map<String, Object> defaultValueMap ) { for (Descriptors.FileDescriptor f : fileDescriptorMap.values()) { // go ove...
java
public static void populateDefaultsAndExtensions( Map<String, Descriptors.FileDescriptor> fileDescriptorMap, Map<String, Set<Descriptors.FieldDescriptor>> typeToExtensionMap, Map<String, Object> defaultValueMap ) { for (Descriptors.FileDescriptor f : fileDescriptorMap.values()) { // go ove...
[ "public", "static", "void", "populateDefaultsAndExtensions", "(", "Map", "<", "String", ",", "Descriptors", ".", "FileDescriptor", ">", "fileDescriptorMap", ",", "Map", "<", "String", ",", "Set", "<", "Descriptors", ".", "FieldDescriptor", ">", ">", "typeToExtensi...
Populates a map of protobuf extensions and map with the default values for each message field from a map of file descriptors. @param fileDescriptorMap Map of file descriptors @param typeToExtensionMap Map of extensions to populate @param defaultValueMap Map of default values to populate
[ "Populates", "a", "map", "of", "protobuf", "extensions", "and", "map", "with", "the", "default", "values", "for", "each", "message", "field", "from", "a", "map", "of", "file", "descriptors", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java#L167-L191
test
Populates the default values and extensions map.
Of course, here is the Java code you requested: ```java public static void populateDefaultsAndExtensions( Map<String, Descriptors.FileDescriptor> fileDescriptorMap, Map<String, Set<Descriptors.FieldDescriptor>> typeToExtensionMap, Map<String, Object> defaultValueMap ) { for (Descriptors.FileDes...
sialcasa/mvvmFX
examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/countries/DataFxCountrySelector.java
DataFxCountrySelector.setCountry
@Override public void setCountry(Country country) { if (country == null) { subdivisionLabel.set(null); subdivisions.clear(); return; } subdivisionLabel.set(countryCodeSubdivisionNameMap.get(country)); subdivisions.clear(); if (countryCodeSubdivisionMap.containsKey(country)) { subdivisions.addAl...
java
@Override public void setCountry(Country country) { if (country == null) { subdivisionLabel.set(null); subdivisions.clear(); return; } subdivisionLabel.set(countryCodeSubdivisionNameMap.get(country)); subdivisions.clear(); if (countryCodeSubdivisionMap.containsKey(country)) { subdivisions.addAl...
[ "@", "Override", "public", "void", "setCountry", "(", "Country", "country", ")", "{", "if", "(", "country", "==", "null", ")", "{", "subdivisionLabel", ".", "set", "(", "null", ")", ";", "subdivisions", ".", "clear", "(", ")", ";", "return", ";", "}", ...
Set the currently selected country. This will lead to an update of the {@link #subdivisions()} observable list and the {@link #subdivisionLabel()}. @param country the country that will be selected or <code>null</code> if no country is selected.
[ "Set", "the", "currently", "selected", "country", ".", "This", "will", "lead", "to", "an", "update", "of", "the", "{", "@link", "#subdivisions", "()", "}", "observable", "list", "and", "the", "{", "@link", "#subdivisionLabel", "()", "}", "." ]
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/countries/DataFxCountrySelector.java#L87-L101
test
Sets the country.
Of course, here is the Java code you requested: ```java @Override public void setCountry(Country country) { if (country == null) { subdivisionLabel.set(null); subdivisions.clear(); return; } subdivisionLabel.set(countryCodeSubdivisionNameMap.get(country)); subdivisions.clear(); if (countryCodeSub...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/BeanData.java
BeanData.newBeanInstance
public Object newBeanInstance() { if (beanDefinition.ctor == CtorInjectionPoint.EMPTY) { throw new PetiteException("No constructor (annotated, single or default) founded as injection point for: " + beanDefinition.type.getName()); } int paramNo = beanDefinition.ctor.references.length; Object[] args = new Obj...
java
public Object newBeanInstance() { if (beanDefinition.ctor == CtorInjectionPoint.EMPTY) { throw new PetiteException("No constructor (annotated, single or default) founded as injection point for: " + beanDefinition.type.getName()); } int paramNo = beanDefinition.ctor.references.length; Object[] args = new Obj...
[ "public", "Object", "newBeanInstance", "(", ")", "{", "if", "(", "beanDefinition", ".", "ctor", "==", "CtorInjectionPoint", ".", "EMPTY", ")", "{", "throw", "new", "PetiteException", "(", "\"No constructor (annotated, single or default) founded as injection point for: \"", ...
Creates a new instance.
[ "Creates", "a", "new", "instance", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/BeanData.java#L132-L163
test
Creates a new instance of the bean.
Of course, here is the Java code you requested: ```java public Object newBeanInstance() { if (beanDefinition.ctor == CtorInjectionPoint.EMPTY) { throw new PetiteException("No constructor (annotated, single or default) founded as injection point for: " + beanDefinition.type.getName()); } int paramNo = beanDef...
Unidata/thredds
dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java
ChunkWriter.writeDSR
public void writeDSR(String dsr) throws IOException { if(state != State.INITIAL) throw new DapException("Attempt to write DSR twice"); if(dsr == null) throw new DapException("Attempt to write empty DSR"); // Strip off any trailing sequence of CR or L...
java
public void writeDSR(String dsr) throws IOException { if(state != State.INITIAL) throw new DapException("Attempt to write DSR twice"); if(dsr == null) throw new DapException("Attempt to write empty DSR"); // Strip off any trailing sequence of CR or L...
[ "public", "void", "writeDSR", "(", "String", "dsr", ")", "throws", "IOException", "{", "if", "(", "state", "!=", "State", ".", "INITIAL", ")", "throw", "new", "DapException", "(", "\"Attempt to write DSR twice\"", ")", ";", "if", "(", "dsr", "==", "null", ...
Write the DSR; do not bother to cache. @param dsr The DSR string @throws IOException on IO related errors
[ "Write", "the", "DSR", ";", "do", "not", "bother", "to", "cache", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java#L131-L160
test
Write a DSR to the output stream.
Of course, here is the Java code you requested: ```java public void writeDSR(String dsr) throws IOException { if(state != State.INITIAL) throw new DapException("Attempt to write DSR twice"); if(dsr == null) throw new DapException("Attempt to write empty DSR"...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java
WebMetaDataHelper.newParamValue
private static ParamValueMetaData newParamValue(final String key, final String value) { final ParamValueMetaData paramMD = new ParamValueMetaData(); paramMD.setParamName(key); paramMD.setParamValue(value); return paramMD; }
java
private static ParamValueMetaData newParamValue(final String key, final String value) { final ParamValueMetaData paramMD = new ParamValueMetaData(); paramMD.setParamName(key); paramMD.setParamValue(value); return paramMD; }
[ "private", "static", "ParamValueMetaData", "newParamValue", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "final", "ParamValueMetaData", "paramMD", "=", "new", "ParamValueMetaData", "(", ")", ";", "paramMD", ".", "setParamName", "(", ...
Creates new parameter with specified key and value. @param key the key @param value the value @return new parameter
[ "Creates", "new", "parameter", "with", "specified", "key", "and", "value", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java#L379-L386
test
Create a new ParamValueMetaData object.
Of course, here is the Java code you requested: ```java private static ParamValueMetaData newParamValue(final String key, final String value) { final ParamValueMetaData paramMD = new ParamValueMetaData(); paramMD.setParamName(key); paramMD.setParamValue(value); return paramMD; } `...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasCgeru
public static void cublasCgeru(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgeruNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); }
java
public static void cublasCgeru(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgeruNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); }
[ "public", "static", "void", "cublasCgeru", "(", "int", "m", ",", "int", "n", ",", "cuComplex", "alpha", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ",", "Pointer", "A", ",", "int", "lda", ")", "{", "cublasCgeruNa...
<pre> cublasCgeru (int m, int n, cuComplex alpha, const cuComplex *x, int incx, const cuComplex *y, int incy, cuComplex *A, int lda) performs the symmetric rank 1 operation A = alpha * x * transpose(y) + A, where alpha is a single precision complex scalar, x is an m element single precision complex vector, y is an n...
[ "<pre", ">", "cublasCgeru", "(", "int", "m", "int", "n", "cuComplex", "alpha", "const", "cuComplex", "*", "x", "int", "incx", "const", "cuComplex", "*", "y", "int", "incy", "cuComplex", "*", "A", "int", "lda", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L5349-L5353
test
Cgeru for complex matrix.
Of course, here is the Java code you requested: ```java public static void cublasCgeru(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgeruNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); } ``` Hope this helps!
rest-assured/rest-assured
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java
MockMvcRequestSpecBuilder.addMultiPart
public MockMvcRequestSpecBuilder addMultiPart(String controlName, File file) { spec.multiPart(controlName, file); return this; }
java
public MockMvcRequestSpecBuilder addMultiPart(String controlName, File file) { spec.multiPart(controlName, file); return this; }
[ "public", "MockMvcRequestSpecBuilder", "addMultiPart", "(", "String", "controlName", ",", "File", "file", ")", "{", "spec", ".", "multiPart", "(", "controlName", ",", "file", ")", ";", "return", "this", ";", "}" ]
Specify a file to upload to the server using multi-part form data uploading with a specific control name. It will use the content-type <tt>application/octet-stream</tt>. If this is not what you want please use an overloaded method. @param file The file to upload @param controlName Defines the control name of th...
[ "Specify", "a", "file", "to", "upload", "to", "the", "server", "using", "multi", "-", "part", "form", "data", "uploading", "with", "a", "specific", "control", "name", ".", "It", "will", "use", "the", "content", "-", "type", "<tt", ">", "application", "/"...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java#L430-L433
test
Add a multi - part request.
Of course, here is the Java code you requested: ```java public MockMvcRequestSpecBuilder addMultiPart(String controlName, File file) { spec.multiPart(controlName, file); return this; } ``` Hope this helps!
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java
PrologParser.peekAndConsumeMore
public boolean peekAndConsumeMore() { Token nextToken = tokenSource.peek(); if ((nextToken.kind == ATOM) && ";".equals(nextToken.image)) { try { consumeToken(ATOM); } catch (SourceCodeException e) { ...
java
public boolean peekAndConsumeMore() { Token nextToken = tokenSource.peek(); if ((nextToken.kind == ATOM) && ";".equals(nextToken.image)) { try { consumeToken(ATOM); } catch (SourceCodeException e) { ...
[ "public", "boolean", "peekAndConsumeMore", "(", ")", "{", "Token", "nextToken", "=", "tokenSource", ".", "peek", "(", ")", ";", "if", "(", "(", "nextToken", ".", "kind", "==", "ATOM", ")", "&&", "\";\"", ".", "equals", "(", "nextToken", ".", "image", "...
Peeks at the next token to see if it is an {@link #ATOM} which is equal to ";" and if it is consumes it. If the symbol is consumed then the return value indicates that this has happened. This is intended to be usefull for interactive interpreters when querying the user to see if they want more solutions to be found. @...
[ "Peeks", "at", "the", "next", "token", "to", "see", "if", "it", "is", "an", "{", "@link", "#ATOM", "}", "which", "is", "equal", "to", ";", "and", "if", "it", "is", "consumes", "it", ".", "If", "the", "symbol", "is", "consumed", "then", "the", "retu...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java#L729-L752
test
Peek and consume more tokens.
Of course, here is the Java code you requested: ```java public boolean peekAndConsumeMore() { Token nextToken = tokenSource.peek(); if ((nextToken.kind == ATOM) && ";".equals(nextToken.image)) { try { consumeToken(ATOM); } cat...
dmfs/iterators
src/main/java/org/dmfs/iterators/utils/SlimSet.java
SlimSet.rehash
private static Object[] rehash(final Object[] values, final int newSize) { Object[] newArray = new Object[newSize]; for (Object value : values) { if (value == null) { continue; } newArray[predictedPosition(newArray, value, val...
java
private static Object[] rehash(final Object[] values, final int newSize) { Object[] newArray = new Object[newSize]; for (Object value : values) { if (value == null) { continue; } newArray[predictedPosition(newArray, value, val...
[ "private", "static", "Object", "[", "]", "rehash", "(", "final", "Object", "[", "]", "values", ",", "final", "int", "newSize", ")", "{", "Object", "[", "]", "newArray", "=", "new", "Object", "[", "newSize", "]", ";", "for", "(", "Object", "value", ":...
Rebuild the backing array with a different size. @param values The values to put into the new array. @param newSize The size of the new array. @return The new backing array.
[ "Rebuild", "the", "backing", "array", "with", "a", "different", "size", "." ]
3a07bd39455ee669fafac40ec6ac849ef079101c
https://github.com/dmfs/iterators/blob/3a07bd39455ee669fafac40ec6ac849ef079101c/src/main/java/org/dmfs/iterators/utils/SlimSet.java#L229-L244
test
Rehash an array of objects to a new size.
Of course, here is the Java code you requested: ```java private static Object[] rehash(final Object[] values, final int newSize) { Object[] newArray = new Object[newSize]; for (Object value : values) { if (value == null) { continue; } ...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/ref/LiveRef.java
LiveRef.ofy
private Objectify ofy() { // If we have an expired transaction context, we need a new context if (ofy == null || (ofy.getTransaction() != null && !ofy.getTransaction().isActive())) ofy = ObjectifyService.ofy(); return ofy; }
java
private Objectify ofy() { // If we have an expired transaction context, we need a new context if (ofy == null || (ofy.getTransaction() != null && !ofy.getTransaction().isActive())) ofy = ObjectifyService.ofy(); return ofy; }
[ "private", "Objectify", "ofy", "(", ")", "{", "// If we have an expired transaction context, we need a new context\r", "if", "(", "ofy", "==", "null", "||", "(", "ofy", ".", "getTransaction", "(", ")", "!=", "null", "&&", "!", "ofy", ".", "getTransaction", "(", ...
Get the current objectify instance associated with this ref
[ "Get", "the", "current", "objectify", "instance", "associated", "with", "this", "ref" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/ref/LiveRef.java#L61-L67
test
Returns the objectify object that was created.
Of course, here is the Java code you requested: ```java private Objectify ofy() { // If we have an expired transaction context, we need a new context if (ofy == null || (ofy.getTransaction() != null && !ofy.getTransaction().isActive())) ofy = ObjectifyService.ofy(); return ofy; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
Core/src/main/java/org/openestate/io/core/NumberUtils.java
NumberUtils.isNumeric
public static boolean isNumeric(String value, Locale locale) { if (value == null) return false; int start = 0; final DecimalFormatSymbols symbols = (locale != null) ? DecimalFormatSymbols.getInstance(locale) : DecimalFormatSymbols.getInstance(); if (valu...
java
public static boolean isNumeric(String value, Locale locale) { if (value == null) return false; int start = 0; final DecimalFormatSymbols symbols = (locale != null) ? DecimalFormatSymbols.getInstance(locale) : DecimalFormatSymbols.getInstance(); if (valu...
[ "public", "static", "boolean", "isNumeric", "(", "String", "value", ",", "Locale", "locale", ")", "{", "if", "(", "value", "==", "null", ")", "return", "false", ";", "int", "start", "=", "0", ";", "final", "DecimalFormatSymbols", "symbols", "=", "(", "lo...
Test, if a string contains a parsable number. @param value the value to check @param locale the locale, against which the value is checked (checks locale specific decimal and grouping separators) @return true, if the provided value contains of numbers
[ "Test", "if", "a", "string", "contains", "a", "parsable", "number", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Core/src/main/java/org/openestate/io/core/NumberUtils.java#L44-L68
test
Check if a string is a numeric value.
Of course, here is the Java code you requested: ```java public static boolean isNumeric(String value, Locale locale) { if (value == null) return false; int start = 0; final DecimalFormatSymbols symbols = (locale != null) ? DecimalFormatSymbols.getInstance(locale) : ...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/AbstractQuery.java
AbstractQuery.build
static @NonNull String build(@NonNull Map<String, String> parameters) { StringBuilder stringBuilder = new StringBuilder(); try { for (Map.Entry<String, String> entry : parameters.entrySet()) { String key = entry.getKey(); if (stringBuilder.length() > 0) ...
java
static @NonNull String build(@NonNull Map<String, String> parameters) { StringBuilder stringBuilder = new StringBuilder(); try { for (Map.Entry<String, String> entry : parameters.entrySet()) { String key = entry.getKey(); if (stringBuilder.length() > 0) ...
[ "static", "@", "NonNull", "String", "build", "(", "@", "NonNull", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "for", "(", "Map", ".", "Entry",...
Build a query string from a map of URL parameters. @return A string suitable for use inside the query part of a URL (i.e. after the question mark).
[ "Build", "a", "query", "string", "from", "a", "map", "of", "URL", "parameters", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/AbstractQuery.java#L185-L203
test
Build a URL - encoded string from a map of parameters.
Of course, here is the Java code you requested: ```java static @NonNull String build(@NonNull Map<String, String> parameters) { StringBuilder stringBuilder = new StringBuilder(); try { for (Map.Entry<String, String> entry : parameters.entrySet()) { String key = entry.getKey(...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/tables/Grib1Customizer.java
Grib1Customizer.getLevelType
protected VertCoordType getLevelType(int code) { VertCoordType result = wmoTable3.get(code); if (result == null) result = new VertCoordType(code, "unknownLayer"+code, null, "unknownLayer"+code, null, false, false); return result; }
java
protected VertCoordType getLevelType(int code) { VertCoordType result = wmoTable3.get(code); if (result == null) result = new VertCoordType(code, "unknownLayer"+code, null, "unknownLayer"+code, null, false, false); return result; }
[ "protected", "VertCoordType", "getLevelType", "(", "int", "code", ")", "{", "VertCoordType", "result", "=", "wmoTable3", ".", "get", "(", "code", ")", ";", "if", "(", "result", "==", "null", ")", "result", "=", "new", "VertCoordType", "(", "code", ",", "...
shared by all instances
[ "shared", "by", "all", "instances" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/tables/Grib1Customizer.java#L199-L204
test
Gets the level type.
Of course, here is the Java code you requested: ```java protected VertCoordType getLevelType(int code) { VertCoordType result = wmoTable3.get(code); if (result == null) result = new VertCoordType(code, "unknownLayer"+code, null, "unknownLayer"+code, null, false, false); return result; } ``` H...
rupertlssmith/lojix
lojix/learning/src/main/com/thesett/aima/math/InformationTheory.java
InformationTheory.pForJointDistribution
public static double[][] pForJointDistribution(int[][] counts) { double[][] results = new double[counts.length][]; // Loop over all the symbols of A for (int i = 0; i < counts.length; i++) { // Extract the next distribution array of the symbols of G given A. ...
java
public static double[][] pForJointDistribution(int[][] counts) { double[][] results = new double[counts.length][]; // Loop over all the symbols of A for (int i = 0; i < counts.length; i++) { // Extract the next distribution array of the symbols of G given A. ...
[ "public", "static", "double", "[", "]", "[", "]", "pForJointDistribution", "(", "int", "[", "]", "[", "]", "counts", ")", "{", "double", "[", "]", "[", "]", "results", "=", "new", "double", "[", "counts", ".", "length", "]", "[", "", "]", ";", "/...
Supposing a stream generates pairs of symbols. Let the first be A and the second be G. A ranges over a set of symbols, {h1, ... , hv} and G ranges over a set of symbols, {g1, ..., gn}. <p>This function estimates p(g|h), the probability of a symbol g (of G) occuring given a symbol h (of A), over all the symbols g and h...
[ "Supposing", "a", "stream", "generates", "pairs", "of", "symbols", ".", "Let", "the", "first", "be", "A", "and", "the", "second", "be", "G", ".", "A", "ranges", "over", "a", "set", "of", "symbols", "{", "h1", "...", "hv", "}", "and", "G", "ranges", ...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/learning/src/main/com/thesett/aima/math/InformationTheory.java#L188-L203
test
Convert the frequency distribution array of counts into a probability distribution array.
Of course, here is the Java code you requested: ```java public static double[][] pForJointDistribution(int[][] counts) { double[][] results = new double[counts.length][]; // Loop over all the symbols of A for (int i = 0; i < counts.length; i++) { // Extract the next dis...
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/Main.java
Main.arePoolsFinished
public static boolean arePoolsFinished() { boolean finished = true; for (int i = 0; i < intentionSelectors.length; i++) { finished &= (intentionSelectors[i] == null); } return finished; }
java
public static boolean arePoolsFinished() { boolean finished = true; for (int i = 0; i < intentionSelectors.length; i++) { finished &= (intentionSelectors[i] == null); } return finished; }
[ "public", "static", "boolean", "arePoolsFinished", "(", ")", "{", "boolean", "finished", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "intentionSelectors", ".", "length", ";", "i", "++", ")", "{", "finished", "&=", "(", "intention...
Checks if the {@link io.github.agentsoz.jill.core.IntentionSelector} pools have finished, i.e., all agents in the pools are idle. @return true if pools have finished, false otherwise
[ "Checks", "if", "the", "{", "@link", "io", ".", "github", ".", "agentsoz", ".", "jill", ".", "core", ".", "IntentionSelector", "}", "pools", "have", "finished", "i", ".", "e", ".", "all", "agents", "in", "the", "pools", "are", "idle", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/Main.java#L269-L275
test
Checks if all the pool pools have finished.
Of course, here is the Java code you requested: ```java public static boolean arePoolsFinished() { boolean finished = true; for (int i = 0; i < intentionSelectors.length; i++) { finished &= (intentionSelectors[i] == null); } return finished; } ``` Hope this helps!
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/PositionalTermTraverserImpl.java
PositionalTermTraverserImpl.getParentContext
public PositionalContext getParentContext() { PositionalTermTraverserImpl.PositionalContextOperator position = contextStack.peek(); return (position != null) ? position.getParentContext() : null; }
java
public PositionalContext getParentContext() { PositionalTermTraverserImpl.PositionalContextOperator position = contextStack.peek(); return (position != null) ? position.getParentContext() : null; }
[ "public", "PositionalContext", "getParentContext", "(", ")", "{", "PositionalTermTraverserImpl", ".", "PositionalContextOperator", "position", "=", "contextStack", ".", "peek", "(", ")", ";", "return", "(", "position", "!=", "null", ")", "?", "position", ".", "get...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/PositionalTermTraverserImpl.java#L163-L168
test
Gets the parent context of the current node.
Of course, here is the Java code you requested: ```java public PositionalContext getParentContext() { PositionalTermTraverserImpl.PositionalContextOperator position = contextStack.peek(); return (position != null) ? position.getParentContext() : null; } ``` Hope this helps!
oblac/jodd
jodd-db/src/main/java/jodd/db/jtx/DbJtxSessionProvider.java
DbJtxSessionProvider.getDbSession
@Override public DbSession getDbSession() { log.debug("Requesting db TX manager session"); final DbJtxTransaction jtx = (DbJtxTransaction) jtxTxManager.getTransaction(); if (jtx == null) { throw new DbSqlException( "No transaction is in progress and DbSession can't be provided. " + "It seems that ...
java
@Override public DbSession getDbSession() { log.debug("Requesting db TX manager session"); final DbJtxTransaction jtx = (DbJtxTransaction) jtxTxManager.getTransaction(); if (jtx == null) { throw new DbSqlException( "No transaction is in progress and DbSession can't be provided. " + "It seems that ...
[ "@", "Override", "public", "DbSession", "getDbSession", "(", ")", "{", "log", ".", "debug", "(", "\"Requesting db TX manager session\"", ")", ";", "final", "DbJtxTransaction", "jtx", "=", "(", "DbJtxTransaction", ")", "jtxTxManager", ".", "getTransaction", "(", ")...
Returns session from JTX transaction manager and started transaction.
[ "Returns", "session", "from", "JTX", "transaction", "manager", "and", "started", "transaction", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/jtx/DbJtxSessionProvider.java#L55-L68
test
Get the db session.
Of course, here is the Java code you requested: ```java @Override public DbSession getDbSession() { log.debug("Requesting db TX manager session"); final DbJtxTransaction jtx = (DbJtxTransaction) jtxTxManager.getTransaction(); if (jtx == null) { throw new DbSqlException( "No transaction is in progress ...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java
WebMetaDataModifier.modify
void modify(final Deployment dep) { final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep, JBossWebMetaData.class); if (jbossWebMD != null) { this.configureEndpoints(dep, jbossWebMD); this.modifyContextRoot(dep, jbossWebMD); } }
java
void modify(final Deployment dep) { final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep, JBossWebMetaData.class); if (jbossWebMD != null) { this.configureEndpoints(dep, jbossWebMD); this.modifyContextRoot(dep, jbossWebMD); } }
[ "void", "modify", "(", "final", "Deployment", "dep", ")", "{", "final", "JBossWebMetaData", "jbossWebMD", "=", "WSHelper", ".", "getOptionalAttachment", "(", "dep", ",", "JBossWebMetaData", ".", "class", ")", ";", "if", "(", "jbossWebMD", "!=", "null", ")", ...
Modifies web meta data to configure webservice stack transport and properties. @param dep webservice deployment
[ "Modifies", "web", "meta", "data", "to", "configure", "webservice", "stack", "transport", "and", "properties", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java#L59-L66
test
Modify the deployment.
Of course, here is the Java code you requested: ```java void modify(final Deployment dep) { final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep, JBossWebMetaData.class); if (jbossWebMD != null) { this.configureEndpoints(dep, jbossWebMD); this.modifyContextRoo...
amedia/meteo
meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java
ObjectFactory.createLocationTypeMinTemperature
@XmlElementDecl(namespace = "", name = "minTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeMinTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeMinTemperature_QNAME, Temperature.class, LocationType.class, value); }
java
@XmlElementDecl(namespace = "", name = "minTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeMinTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeMinTemperature_QNAME, Temperature.class, LocationType.class, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"minTemperature\"", ",", "scope", "=", "LocationType", ".", "class", ")", "public", "JAXBElement", "<", "Temperature", ">", "createLocationTypeMinTemperature", "(", "Temperature", "value", "...
Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Temperature", "}", "{", "@code", ">", "}}" ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java#L402-L405
test
Create an instance of the JAXBElement required to represent a MinTemperature value in the LocationType.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "minTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeMinTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeMinTemperature_QNAME, Temperatu...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasScopy
public static void cublasScopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasScopyNative(n, x, incx, y, incy); checkResultBLAS(); }
java
public static void cublasScopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasScopyNative(n, x, incx, y, incy); checkResultBLAS(); }
[ "public", "static", "void", "cublasScopy", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ")", "{", "cublasScopyNative", "(", "n", ",", "x", ",", "incx", ",", "y", ",", "incy", ")", ";", "checkRes...
<pre> void cublasScopy (int n, const float *x, int incx, float *y, int incy) copies the single precision vector x to the single precision vector y. For i = 0 to n-1, copies x[lx + i * incx] to y[ly + i * incy], where lx = 1 if incx >= 0, else lx = 1 + (1 - n) * incx, and ly is defined in a similar way using incy. Inp...
[ "<pre", ">", "void", "cublasScopy", "(", "int", "n", "const", "float", "*", "x", "int", "incx", "float", "*", "y", "int", "incy", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L1326-L1330
test
CUBLAS - Shrink type translation for Cublas.
Of course, here is the Java code you requested: ```java public static void cublasScopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasScopyNative(n, x, incx, y, incy); checkResultBLAS(); } ``` Hope this helps!
rest-assured/rest-assured
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java
MockMvcRequestSpecBuilder.setWebAppContextSetup
public MockMvcRequestSpecBuilder setWebAppContextSetup(WebApplicationContext context, MockMvcConfigurer... mockMvcConfigurers) { spec.webAppContextSetup(context, mockMvcConfigurers); return this; }
java
public MockMvcRequestSpecBuilder setWebAppContextSetup(WebApplicationContext context, MockMvcConfigurer... mockMvcConfigurers) { spec.webAppContextSetup(context, mockMvcConfigurers); return this; }
[ "public", "MockMvcRequestSpecBuilder", "setWebAppContextSetup", "(", "WebApplicationContext", "context", ",", "MockMvcConfigurer", "...", "mockMvcConfigurers", ")", "{", "spec", ".", "webAppContextSetup", "(", "context", ",", "mockMvcConfigurers", ")", ";", "return", "thi...
Initialize with a {@link WebApplicationContext} that will be used to create the {@link MockMvc} instance. <p/> Note that this will override the any {@link MockMvc} instances configured by other setters. @param context The WebApplicationContext to use @param mockMvcConfigurers {@link MockMvcConfigurer}'s to ...
[ "Initialize", "with", "a", "{", "@link", "WebApplicationContext", "}", "that", "will", "be", "used", "to", "create", "the", "{", "@link", "MockMvc", "}", "instance", ".", "<p", "/", ">", "Note", "that", "this", "will", "override", "the", "any", "{", "@li...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java#L677-L680
test
Set the application context setup.
Of course, here is the Java code you requested: ```java public MockMvcRequestSpecBuilder setWebAppContextSetup(WebApplicationContext context, MockMvcConfigurer... mockMvcConfigurers) { spec.webAppContextSetup(context, mockMvcConfigurers); return this; } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/Logger.java
Logger.error
@Deprecated public static void error(String message, Supplier<?> args) { logger.error(message, args); }
java
@Deprecated public static void error(String message, Supplier<?> args) { logger.error(message, args); }
[ "@", "Deprecated", "public", "static", "void", "error", "(", "String", "message", ",", "Supplier", "<", "?", ">", "args", ")", "{", "logger", ".", "error", "(", "message", ",", "args", ")", ";", "}" ]
Log a message with the ERROR level. @param message message to log @param args Suppliers that contain arguments to apply to the message String @deprecated Deprecated as of 2.7.0. Create an instance of {@link ALogger} via {@link #of(String)} / {@link #of(Class)} and use the same-named method. Or use SLF4J directly.
[ "Log", "a", "message", "with", "the", "ERROR", "level", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/Logger.java#L441-L444
test
Log an error message.
Of course, here is the Java code you requested: ```java @Deprecated public static void error(String message, Supplier<?> args) { logger.error(message, args); } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/binary/impl/index/OCompositeKeySerializer.java
OCompositeKeySerializer.serializeInByteBufferObject
@Override public void serializeInByteBufferObject(OCompositeKey object, ByteBuffer buffer, Object... hints) { final OType[] types = getKeyTypes(hints); final List<Object> keys = object.getKeys(); final int keysSize = keys.size(); final int oldStartOffset = buffer.position(); buffer.posit...
java
@Override public void serializeInByteBufferObject(OCompositeKey object, ByteBuffer buffer, Object... hints) { final OType[] types = getKeyTypes(hints); final List<Object> keys = object.getKeys(); final int keysSize = keys.size(); final int oldStartOffset = buffer.position(); buffer.posit...
[ "@", "Override", "public", "void", "serializeInByteBufferObject", "(", "OCompositeKey", "object", ",", "ByteBuffer", "buffer", ",", "Object", "...", "hints", ")", "{", "final", "OType", "[", "]", "types", "=", "getKeyTypes", "(", "hints", ")", ";", "final", ...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/binary/impl/index/OCompositeKeySerializer.java#L273-L312
test
Serialize the composite key in the ByteBuffer.
Of course, here is the Java code you requested: ```java @Override public void serializeInByteBufferObject(OCompositeKey object, ByteBuffer buffer, Object... hints) { final OType[] types = getKeyTypes(hints); final List<Object> keys = object.getKeys(); final int keysSize = keys.size(); final ...
ReactiveX/RxJava
src/main/java/io/reactivex/Single.java
Single.merge
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> Single<T> merge(SingleSource<? extends SingleSource<? extends T>> source) { ObjectHelper.requireNonNull(source, "source is null"); return RxJavaPlugins.onA...
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> Single<T> merge(SingleSource<? extends SingleSource<? extends T>> source) { ObjectHelper.requireNonNull(source, "source is null"); return RxJavaPlugins.onA...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "<", "T", ">", "Single", "<", "T", ">", "merge...
Flattens a {@code Single} that emits a {@code Single} into a single {@code Single} that emits the item emitted by the nested {@code Single}, without any transformation. <p> <img width="640" height="412" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.merge.oo.png" alt=""> <dl> <dt><b>Schedu...
[ "Flattens", "a", "{", "@code", "Single", "}", "that", "emits", "a", "{", "@code", "Single", "}", "into", "a", "single", "{", "@code", "Single", "}", "that", "emits", "the", "item", "emitted", "by", "the", "nested", "{", "@code", "Single", "}", "without...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L941-L948
test
Merge two single sources into one single.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> Single<T> merge(SingleSource<? extends SingleSource<? extends T>> source) { ObjectHelper.requireNonNull(so...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
BaseNDArrayFactory.complexValueOf
@Override public IComplexNDArray complexValueOf(int[] shape, double value) { IComplexNDArray ones = complexOnes(shape); ones.assign(Nd4j.scalar(value)); return ones; }
java
@Override public IComplexNDArray complexValueOf(int[] shape, double value) { IComplexNDArray ones = complexOnes(shape); ones.assign(Nd4j.scalar(value)); return ones; }
[ "@", "Override", "public", "IComplexNDArray", "complexValueOf", "(", "int", "[", "]", "shape", ",", "double", "value", ")", "{", "IComplexNDArray", "ones", "=", "complexOnes", "(", "shape", ")", ";", "ones", ".", "assign", "(", "Nd4j", ".", "scalar", "(", ...
Creates an shape ndarray with the specified value @param shape the shape of the ndarray @param value the value to assign @return a complex ndarray of the specified size and value
[ "Creates", "an", "shape", "ndarray", "with", "the", "specified", "value" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L975-L980
test
Create a complex value array.
Of course, here is the Java code you requested: ```java @Override public IComplexNDArray complexValueOf(int[] shape, double value) { IComplexNDArray ones = complexOnes(shape); ones.assign(Nd4j.scalar(value)); return ones; } ``` Hope this helps!
Unidata/thredds
httpservices/src/main/java/ucar/httpservices/HTTPSession.java
HTTPSession.getSessionID
public String getSessionID() { String sid = null; String jsid = null; List<Cookie> cookies = this.sessioncontext.getCookieStore().getCookies(); for(Cookie cookie : cookies) { if(cookie.getName().equalsIgnoreCase("sessionid")) sid = cookie.getValue(); ...
java
public String getSessionID() { String sid = null; String jsid = null; List<Cookie> cookies = this.sessioncontext.getCookieStore().getCookies(); for(Cookie cookie : cookies) { if(cookie.getName().equalsIgnoreCase("sessionid")) sid = cookie.getValue(); ...
[ "public", "String", "getSessionID", "(", ")", "{", "String", "sid", "=", "null", ";", "String", "jsid", "=", "null", ";", "List", "<", "Cookie", ">", "cookies", "=", "this", ".", "sessioncontext", ".", "getCookieStore", "(", ")", ".", "getCookies", "(", ...
Extract the sessionid cookie value @return sessionid string
[ "Extract", "the", "sessionid", "cookie", "value" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/httpservices/src/main/java/ucar/httpservices/HTTPSession.java#L939-L951
test
Gets the session ID.
Of course, here is the Java code you requested: ```java public String getSessionID() { String sid = null; String jsid = null; List<Cookie> cookies = this.sessioncontext.getCookieStore().getCookies(); for(Cookie cookie : cookies) { if(cookie.getName().equalsIgnoreCase("se...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.replaceFiltersWith
public static void replaceFiltersWith(List<Filter> filters) { Validate.notNull(filters, "Filter list cannot be null"); RestAssured.filters.clear(); filters(filters); }
java
public static void replaceFiltersWith(List<Filter> filters) { Validate.notNull(filters, "Filter list cannot be null"); RestAssured.filters.clear(); filters(filters); }
[ "public", "static", "void", "replaceFiltersWith", "(", "List", "<", "Filter", ">", "filters", ")", "{", "Validate", ".", "notNull", "(", "filters", ",", "\"Filter list cannot be null\"", ")", ";", "RestAssured", ".", "filters", ".", "clear", "(", ")", ";", "...
Sets the default filters to apply to each request. @param filters The filter list
[ "Sets", "the", "default", "filters", "to", "apply", "to", "each", "request", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L528-L532
test
Replaces all filters in the current class loader with the given list of filters.
Of course, here is the Java code you requested: ```java public static void replaceFiltersWith(List<Filter> filters) { Validate.notNull(filters, "Filter list cannot be null"); RestAssured.filters.clear(); filters(filters); } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java
FastConcurrentReadLruLfuFifoCache.put
public void put( KEY key, VALUE value ) { CacheEntry<KEY, VALUE> entry = map.get( key ); if ( entry == null ) { entry = new CacheEntry<>( key, value, order(), type, time() ); list.add( entry ); map.put( key, entry ); } else { entry.readCount.incr...
java
public void put( KEY key, VALUE value ) { CacheEntry<KEY, VALUE> entry = map.get( key ); if ( entry == null ) { entry = new CacheEntry<>( key, value, order(), type, time() ); list.add( entry ); map.put( key, entry ); } else { entry.readCount.incr...
[ "public", "void", "put", "(", "KEY", "key", ",", "VALUE", "value", ")", "{", "CacheEntry", "<", "KEY", ",", "VALUE", ">", "entry", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "entry", "=", "new", "C...
Put the value. This touches the lock so puts are **not** fast. @param key the key key @param value the value value
[ "Put", "the", "value", ".", "This", "touches", "the", "lock", "so", "puts", "are", "**", "not", "**", "fast", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java#L195-L208
test
Put a value into the cache.
Of course, here is the Java code you requested: ```java public void put( KEY key, VALUE value ) { CacheEntry<KEY, VALUE> entry = map.get( key ); if ( entry == null ) { entry = new CacheEntry<>( key, value, order(), type, time() ); list.add( entry ); map.put( key, e...