id
stringlengths
24
24
repo
stringlengths
7
59
path
stringlengths
11
234
func_name
stringlengths
3
140
url
stringlengths
102
339
split
stringclasses
3 values
language
stringclasses
1 value
docstring
stringlengths
1
34k
code
stringlengths
63
466k
text
stringlengths
101
467k
token_count
int32
22
125k
doc_chars
int32
1
34k
code_chars
int32
63
466k
license_basis
stringclasses
1 value
source
stringclasses
1 value
added
stringdate
2026-12-05 00:00:00
2026-12-05 00:00:00
record_sha256
stringlengths
64
64
license
stringclasses
18 values
license_class
stringclasses
4 values
license_source
stringlengths
45
101
d2310b6b455d9593e486beaa
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java
BeanToBean.addBeanToBeanMapping
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java#L205-L209
train
java
Add a mapping of properties between two beans @param beanToBeanMapping
public void addBeanToBeanMapping(BeanToBeanMapping beanToBeanMapping) { beanToBeanMappings.put(ClassPair.get(beanToBeanMapping .getSourceClass(), beanToBeanMapping.getDestinationClass()), beanToBeanMapping); }
Add a mapping of properties between two beans @param beanToBeanMapping public void addBeanToBeanMapping(BeanToBeanMapping beanToBeanMapping) { beanToBeanMappings.put(ClassPair.get(beanToBeanMapping .getSourceClass(), beanToBeanMapping.getDestinationClass()), beanToBeanMapping); }
71
71
224
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0e372c2548692bc5dc994a34edc0582d391a453451e9b097e70a1633e7ab0def
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
0f84c1726c452c01bb86414a
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HeaderUtils.java
HeaderUtils.hasCacheableHeaders
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HeaderUtils.java#L123-L150
train
java
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4. <p></p> Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after ...
public static boolean hasCacheableHeaders(Headers headers) { if (headers.contains(VARY_ALL)) { return false; } if (headers.contains(CACHE_CONTROL)) { Optional<CacheControl> cc = headers.getCacheControl(); if (OptionalUtils.exists(cc, (cc2 -> cc2.isNoCache() ||...
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4. <p></p> Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after ...
416
825
1,148
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fb622a1aad1ef0662972d861bbf8694ef596362f2acd76458db35d730c5c5d1b
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
56a42890669a198f0c7e7f03
jbossws/jbossws-spi
src/main/java/org/jboss/wsf/spi/SPIProvider.java
SPIProvider.getInstance
https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/SPIProvider.java#L42-L50
train
java
Gets the a singleton reference to the SPIProvider returned by the SPIProviderResolver retrieved using the default server integration classloader. @return this class instance
public static SPIProvider getInstance() { if (me == null) { final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader(); me = SPIProviderResolver.getInstance(cl).getProvider(); } return me; }
Gets the a singleton reference to the SPIProvider returned by the SPIProviderResolver retrieved using the default server integration classloader. @return this class instance public static SPIProvider getInstance() { if (me == null) { final ClassLoader cl = ClassLoaderProvider.getDefaultProvid...
87
175
277
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9eca49281c20943ff6f78d48049b0cffb170d0513b6e3c1e4b3a6b8f9ace41b8
Apache-2.0
permissive
https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt
22108192ff03f77d47fad6ed
jbossws/jbossws-spi
src/main/java/org/jboss/wsf/spi/SPIProvider.java
SPIProvider.getSPI
https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/SPIProvider.java#L59-L62
train
java
Gets the specified SPI, using the current thread context classloader @param <T> type of spi class @param spiType spi class to retrieve @return object
public <T> T getSPI(Class<T> spiType) { return getSPI(spiType, SecurityActions.getContextClassLoader()); }
Gets the specified SPI, using the current thread context classloader @param <T> type of spi class @param spiType spi class to retrieve @return object public <T> T getSPI(Class<T> spiType) { return getSPI(spiType, SecurityActions.getContextClassLoader()); }
66
156
118
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
41e49fae6b09c970cb8f5b81c2c632a28b82389c196dadbe9f92bf3fc4cab2dc
Apache-2.0
permissive
https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt
6bf4fb5762398226b47afe05
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java
DefaultSoyMsgBundleResolver.resolve
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java#L62-L93
train
java
Based on a provided locale return a SoyMsgBundle file. If a passed in locale object is "Optional.absent()", the implementation will return Optional.absent() as well @param locale - maybe locale @return maybe soy msg bundle
public Optional<SoyMsgBundle> resolve(final Optional<Locale> locale) throws IOException { if (!locale.isPresent()) { return Optional.absent(); } synchronized (msgBundles) { SoyMsgBundle soyMsgBundle = null; if (isHotReloadModeOff()) { soyMsgBu...
Based on a provided locale return a SoyMsgBundle file. If a passed in locale object is "Optional.absent()", the implementation will return Optional.absent() as well @param locale - maybe locale @return maybe soy msg bundle public Optional<SoyMsgBundle> resolve(final Optional<Locale> locale) throws IOException { ...
268
223
1,110
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
172b70e17d130b2e4bb1a7d0bbd20d79757e8d7b0b0e2397095c0ced3cc79687
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
a6669d904de427846c2da382
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java
DefaultSoyMsgBundleResolver.createSoyMsgBundle
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java#L104-L121
train
java
An implementation that using a ContextClassLoader iterates over all urls it finds based on a messagePath and locale, e.g. messages_de_DE.xlf and returns a merged SoyMsgBundle of SoyMsgBundle matching a a pattern it finds in a class path. @param locale - locale @return SoyMsgBundle - bundle @throws java.io.IOException ...
protected SoyMsgBundle createSoyMsgBundle(final Locale locale) throws IOException { Preconditions.checkNotNull(messagesPath, "messagesPath cannot be null!"); final String path = messagesPath + "_" + locale.toString() + ".xlf"; final Enumeration<URL> e = Thread.currentThread().getContextClassLo...
An implementation that using a ContextClassLoader iterates over all urls it finds based on a messagePath and locale, e.g. messages_de_DE.xlf and returns a merged SoyMsgBundle of SoyMsgBundle matching a a pattern it finds in a class path. @param locale - locale @return SoyMsgBundle - bundle @throws java.io.IOException ...
242
330
816
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f3b6694709670e17a36457f275333c8243d28800568e79c978321c2911c2b18d
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
9c1aa5532daded603ce8305e
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java
DefaultSoyMsgBundleResolver.mergeMsgBundles
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/bundle/DefaultSoyMsgBundleResolver.java#L126-L139
train
java
Merge msg bundles together, creating new MsgBundle with merges msg bundles passed in as a method argument
private Optional<? extends SoyMsgBundle> mergeMsgBundles(final Locale locale, final List<SoyMsgBundle> soyMsgBundles) { if (soyMsgBundles.isEmpty()) { return Optional.absent(); } final List<SoyMsg> msgs = Lists.newArrayList(); for (final SoyMsgBundle smb : soyMsgBundles) { ...
Merge msg bundles together, creating new MsgBundle with merges msg bundles passed in as a method argument private Optional<? extends SoyMsgBundle> mergeMsgBundles(final Locale locale, final List<SoyMsgBundle> soyMsgBundles) { if (soyMsgBundles.isEmpty()) { return Optional.absent(); } ...
139
105
539
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f351726af3ba334092586b791fe5508c22af41ffa0f04336b1769699ec8d5018
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
53514a716b0c8a2e88bd9503
matiwinnetou/spring-soy-view
spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/hash/MD5HashFileGenerator.java
MD5HashFileGenerator.hash
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/hash/MD5HashFileGenerator.java#L80-L106
train
java
Calculates a md5 hash for an url If a passed in url is absent then this method will return absent as well @param url - an url to a soy template file @return - md5 checksum of a template file @throws IOException - in a case there is an IO error calculating md5 checksum
@Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPresent(url.ge...
Calculates a md5 hash for an url If a passed in url is absent then this method will return absent as well @param url - an url to a soy template file @return - md5 checksum of a template file @throws IOException - in a case there is an IO error calculating md5 checksum @Override public Optional<String> hash(final...
238
270
776
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d869f9ee91c462f307e0fa88117d7321b287859e419dcb3d86d35a7c9b2df456
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
ad5585e94c7fdf34cfa4c5d5
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/StringUtils.java
StringUtils.allUpperCase
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/StringUtils.java#L20-L28
train
java
Make all elements of a String array upper case. @param strings string array, may contain null item but can't be null @return array containing all provided elements upper case
public static String[] allUpperCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ if(strings[idx] != null){ tmp[idx] = strings[idx].toUpperCase(); } } return tmp; }
Make all elements of a String array upper case. @param strings string array, may contain null item but can't be null @return array containing all provided elements upper case public static String[] allUpperCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ ...
99
174
241
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
24215d7c0324ee334106fcfb545987b70be49bbb19700a24919004390e828e8f
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
b06a9800c4b2cd7e1430fbc5
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/StringUtils.java
StringUtils.allLowerCase
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/StringUtils.java#L35-L43
train
java
Make all elements of a String array lower case. @param strings string array, may contain null item but can't be null @return array containing all provided elements lower case
public static String[] allLowerCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ if(strings[idx] != null){ tmp[idx] = strings[idx].toLowerCase(); } } return tmp; }
Make all elements of a String array lower case. @param strings string array, may contain null item but can't be null @return array containing all provided elements lower case public static String[] allLowerCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ ...
99
174
241
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
611ce09eaa6e793c345e75fffff4e7a458e2d88984d7872a2875041bc8ac3cd2
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
b595c853e256dc2b7358b088
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java
UTCDateTimeRangeController.updateInterval
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java#L117-L127
train
java
interval management
private void updateInterval() { intervalMillis = getCombinedValue(endDate, endTime) - getCombinedValue(startDate, startTime); // if this is zero, most likely the times aren't set and the // dates are the same. in this case we don't really want a // zero interval. if we *really* ...
interval management private void updateInterval() { intervalMillis = getCombinedValue(endDate, endTime) - getCombinedValue(startDate, startTime); // if this is zero, most likely the times aren't set and the // dates are the same. in this case we don't really want a // zero inte...
114
19
498
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6f607f4e0326e583b287a4f7092288a370a7ba289a2dda378e9b99fcf08bfb3c
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
ad17ad7f2a6f05661fd74feb
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java
UTCDateTimeRangeController.getCombinedValue
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java#L201-L221
train
java
This allows us to treat a datetime as a single value, making it easy for comparison and adjustment. We don't actually expose this because the timezone issues make it too confusing to clients.
private long getCombinedValue(UTCDateBox date, UTCTimeBox time) { Long dateValue = date.getValue(); Long timeValue = time.getValue(); if (dateValue != null) { if (timeValue != null) { return dateValue + timeValue; } else { ...
This allows us to treat a datetime as a single value, making it easy for comparison and adjustment. We don't actually expose this because the timezone issues make it too confusing to clients. private long getCombinedValue(UTCDateBox date, UTCTimeBox time) { Long dateValue = date.getValue(); Long timeVa...
148
191
536
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a34f89f340670485a478f68882a1cc6621cc743833e2937098e8dc397268b7d3
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
2c36238795275d5bac3921bb
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java
UTCDateTimeRangeController.setCombinedValue
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCDateTimeRangeController.java#L234-L239
train
java
This allows us to treat a datetime as a single value, making it easy for comparison and adjustment. We don't actually expose this because the timezone issues make it too confusing to clients. @param setTimeValue Sometimes we don't want to set the time value explicitly. Generally this is the case when we haven't specif...
private void setCombinedValue(UTCDateBox date, UTCTimeBox time, long value, boolean setTimeValue) { date.setValue(datePartMillis(value), false); if (setTimeValue) { time.setValue(timePartMillis(value), false); } }
This allows us to treat a datetime as a single value, making it easy for comparison and adjustment. We don't actually expose this because the timezone issues make it too confusing to clients. @param setTimeValue Sometimes we don't want to set the time value explicitly. Generally this is the case when we haven't specif...
130
331
261
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f4e799fdb7333890f2a6e59523a26aa3609fc5c32b3ac9b11c7139d802a05307
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
cc72a43945befdf10abeed17
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/ClassTypeSignature.java
ClassTypeSignature.getTypeErasureSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/ClassTypeSignature.java#L118-L126
train
java
get the type erasure signature
public FullTypeSignature getTypeErasureSignature() { if (typeErasureSignature == null) { typeErasureSignature = new ClassTypeSignature(binaryName, new TypeArgSignature[0], ownerTypeSignature == null ? null : (ClassTypeSignature) ownerTypeSignature .getTypeErasureSignature()); } retu...
get the type erasure signature public FullTypeSignature getTypeErasureSignature() { if (typeErasureSignature == null) { typeErasureSignature = new ClassTypeSignature(binaryName, new TypeArgSignature[0], ownerTypeSignature == null ? null : (ClassTypeSignature) ownerTypeSignature .getTypeE...
88
30
348
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
97c6c583f55338602d519f96ebe82b326d9693836c2f3d025ed5468653305eab
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
a69b063ee92561b7749a2654
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/MIMEType.java
MIMEType.addParameter
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/MIMEType.java#L54-L58
train
java
Adds a parameter to the MIMEType. @param name name of parameter @param value value of parameter @return returns a new instance with the parameter set
public MIMEType addParameter(String name, String value) { Map<String, String> copy = new LinkedHashMap<>(this.parameters); copy.put(name, value); return new MIMEType(type, subType, copy); }
Adds a parameter to the MIMEType. @param name name of parameter @param value value of parameter @return returns a new instance with the parameter set public MIMEType addParameter(String name, String value) { Map<String, String> copy = new LinkedHashMap<>(this.parameters); copy.put(name, value); ...
77
150
217
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
650709b1c096973ac292d18548cbd057c19046dfa6a947c36592bd73b4eda8c8
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
00ce0782266d8f0588af1836
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/DefaultContentNegotiator.java
DefaultContentNegotiator.contentTypes
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/DefaultContentNegotiator.java#L96-L114
train
java
Returns requested content types or default content type if none found. @return Requested content types or default content type if none found.
@Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHeaderValues(request); } if (isEmpty(c...
Returns requested content types or default content type if none found. @return Requested content types or default content type if none found. @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader...
139
142
527
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
26411416eb56ec20389a1bff156e9fe1b40a6eaec57e459d71e01433c488814b
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
bb4ec5dc1ea9fa5801ccfa0a
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java
SerializationUtils.serialize
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java#L102-L123
train
java
<p>Serializes an <code>Object</code> to the specified stream.</p> <p>The stream will be closed once the object is written. This avoids the need for a finally clause, and maybe also exception handling, in the application code.</p> <p>The stream passed in is not buffered internally within this method. This is the respo...
public static void serialize(Serializable obj, OutputStream outputStream) { if (outputStream == null) { throw new IllegalArgumentException("The OutputStream must not be null"); } ObjectOutputStream out = null; try { // stream closed in the finally out ...
<p>Serializes an <code>Object</code> to the specified stream.</p> <p>The stream will be closed once the object is written. This avoids the need for a finally clause, and maybe also exception handling, in the application code.</p> <p>The stream passed in is not buffered internally within this method. This is the respo...
260
637
714
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5d75e78f539fbd220c9ad57eb2b41dd29be8ddf4e000ad680651f0fddef0903b
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
3be083cc367dc5c4381753a1
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java
SerializationUtils.serialize
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java#L133-L137
train
java
<p>Serializes an <code>Object</code> to a byte array for storage/serialization.</p> @param obj the object to serialize to bytes @return a byte[] with the converted Serializable @throws SerializationException (runtime) if the serialization fails
public static byte[] serialize(Serializable obj) { ByteArrayOutputStream baos = new ByteArrayOutputStream(512); serialize(obj, baos); return baos.toByteArray(); }
<p>Serializes an <code>Object</code> to a byte array for storage/serialization.</p> @param obj the object to serialize to bytes @return a byte[] with the converted Serializable @throws SerializationException (runtime) if the serialization fails public static byte[] serialize(Serializable obj) { ByteArrayOutp...
91
246
190
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bd6c4890f0409aae11f3ae204eec8e37628c4fa51072cd592a12c4656feb5fb4
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
fa87ee2680419971bc500787
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java
SerializationUtils.deserialize
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SerializationUtils.java#L189-L195
train
java
<p>Deserializes a single <code>Object</code> from an array of bytes.</p> @param objectData the serialized object, must not be null @return the deserialized object @throws IllegalArgumentException if <code>objectData</code> is <code>null</code> @throws SerializationException (runtime) if the serialization fails
public static Object deserialize(byte[] objectData) { if (objectData == null) { throw new IllegalArgumentException("The byte[] must not be null"); } ByteArrayInputStream bais = new ByteArrayInputStream(objectData); return deserialize(bais); }
<p>Deserializes a single <code>Object</code> from an array of bytes.</p> @param objectData the serialized object, must not be null @return the deserialized object @throws IllegalArgumentException if <code>objectData</code> is <code>null</code> @throws SerializationException (runtime) if the serialization fails publi...
123
313
290
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9faf56cc1b0d0cdd13115cd473660b255106ad2412e3e879f18bfd59d1731756
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
cb6d14224122a012f40b667f
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HTTPRequest.java
HTTPRequest.getAllHeaders
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HTTPRequest.java#L102-L107
train
java
Returns all headers with the headers from the Payload @return All the headers
public Headers getAllHeaders() { Headers requestHeaders = getHeaders(); requestHeaders = hasPayload() ? requestHeaders.withContentType(getPayload().get().getMimeType()) : requestHeaders; //We don't want to add headers more than once. return requestHeaders; }
Returns all headers with the headers from the Payload @return All the headers public Headers getAllHeaders() { Headers requestHeaders = getHeaders(); requestHeaders = hasPayload() ? requestHeaders.withContentType(getPayload().get().getMimeType()) : requestHeaders; //We don't want to add header...
73
78
294
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
15899aae1307a18d9772759a4f7827bb49b5ac5f06f92d753e401f3e2a4b9d03
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
1b93e8ab9d7f6c9b64905715
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/DifferentiableFunctionOpts.java
DifferentiableFunctionOpts.getRegularizedOptimizer
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/DifferentiableFunctionOpts.java#L165-L179
train
java
Converts a standard optimizer to one which the given amount of l1 or l2 regularization.
public static Optimizer<DifferentiableFunction> getRegularizedOptimizer(final Optimizer<DifferentiableFunction> opt, final double l1Lambda, final double l2Lambda) { if (l1Lambda == 0 && l2Lambda == 0) { return opt; } return new Optimizer<DifferentiableFunction>() { ...
Converts a standard optimizer to one which the given amount of l1 or l2 regularization. public static Optimizer<DifferentiableFunction> getRegularizedOptimizer(final Optimizer<DifferentiableFunction> opt, final double l1Lambda, final double l2Lambda) { if (l1Lambda == 0 && l2Lambda == 0) { ...
151
87
635
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
91fe82ef06cfdfa386da19165fc4777eaac4113cfd2fcd4f0b9b19c0201c112c
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
d574f0e6120c60ab6a12c317
Canadensys/canadensys-core
src/main/java/net/canadensys/lang/RomanNumeral.java
RomanNumeral.toRomanNumeral
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/lang/RomanNumeral.java#L82-L94
train
java
Get the Roman Numeral of the current value @return
public String toRomanNumeral() { if (this.romanString == null) { this.romanString = ""; int remainder = this.value; for (int i = 0; i < BASIC_VALUES.length; i++) { while (remainder >= BASIC_VALUES[i]) { this.romanString += BASIC_ROMAN_NUMERALS[i]; remainder -= BASIC_VALUES[i]; } } } ...
Get the Roman Numeral of the current value @return public String toRomanNumeral() { if (this.romanString == null) { this.romanString = ""; int remainder = this.value; for (int i = 0; i < BASIC_VALUES.length; i++) { while (remainder >= BASIC_VALUES[i]) { this.romanString += BASIC_ROMAN_NUMERALS[i]; ...
113
50
347
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3cca07db3d1254e8edbd3e3f4d17f7e2d0646e26de3e2dcb253f5e1c1b3fb4a1
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
3e3677bec9bd238e2809a123
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/AdaGradSchedule.java
AdaGradSchedule.init
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/AdaGradSchedule.java#L51-L55
train
java
Initializes all the parameters for optimization.
@Override public void init(DifferentiableBatchFunction function) { gradSumSquares = new double[function.getNumDimensions()]; Arrays.fill(gradSumSquares, prm.initialSumSquares); }
Initializes all the parameters for optimization. @Override public void init(DifferentiableBatchFunction function) { gradSumSquares = new double[function.getNumDimensions()]; Arrays.fill(gradSumSquares, prm.initialSumSquares); }
51
48
202
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
dc8d753dbe3e3b0e6f849baabc4cd497207b2dc8659885bf8fd933ab8ae66638
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
225f3dbeda176b2251ff92bf
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/AdaGradSchedule.java
AdaGradSchedule.takeNoteOfGradient
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/AdaGradSchedule.java#L58-L66
train
java
A tie-in for subclasses such as AdaGrad.
public void takeNoteOfGradient(IntDoubleVector gradient) { gradient.iterate(new FnIntDoubleToVoid() { @Override public void call(int index, double value) { gradSumSquares[index] += value * value; assert !Double.isNaN(gradSumSquares[index]); ...
A tie-in for subclasses such as AdaGrad. public void takeNoteOfGradient(IntDoubleVector gradient) { gradient.iterate(new FnIntDoubleToVoid() { @Override public void call(int index, double value) { gradSumSquares[index] += value * value; assert...
80
40
348
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
97b90009b0b09e7d741281b403023b29a926030bd823f7576b02d2d554f27ea2
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
73ec2e168b605b89bf7bb3a5
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/BottouSchedule.java
BottouSchedule.getLearningRate
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BottouSchedule.java#L50-L62
train
java
Gets the learning rate for the current iteration. @param iterCount The current iteration. @param i The index of the current model parameter.
@Override public double getLearningRate(int iterCount, int i) { // We use the learning rate suggested in Leon Bottou's (2012) SGD Tricks paper. // // \gamma_t = \frac{\gamma_0}{(1 + \gamma_0 \lambda t)^p} // // For SGD p = 1.0, for ASGD p = 0.75 if (prm.power == 1.0)...
Gets the learning rate for the current iteration. @param iterCount The current iteration. @param i The index of the current model parameter. @Override public double getLearningRate(int iterCount, int i) { // We use the learning rate suggested in Leon Bottou's (2012) SGD Tricks paper. // //...
182
140
536
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
dd365a24000b1d76cda5a818013bc0c146fcf20cb8807155530c52b328aa4459
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
810cb1fd9d1193b542c81a62
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getArrayTypeSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L45-L52
train
java
get the ArrayTypeSignature corresponding to given generic array type @param genericArrayType @return
private ArrayTypeSignature getArrayTypeSignature( GenericArrayType genericArrayType) { FullTypeSignature componentTypeSignature = getFullTypeSignature(genericArrayType .getGenericComponentType()); ArrayTypeSignature arrayTypeSignature = new ArrayTypeSignature( componentTypeSignature); return arra...
get the ArrayTypeSignature corresponding to given generic array type @param genericArrayType @return private ArrayTypeSignature getArrayTypeSignature( GenericArrayType genericArrayType) { FullTypeSignature componentTypeSignature = getFullTypeSignature(genericArrayType .getGenericComponentType()); Array...
84
101
339
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
876758db1e4a26b37e3658702afbd36a71a368a3b676c8e3c7bb6a9ab969542e
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
b126e10b5e1c5c71f4bb1c6f
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getClassTypeSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L60-L78
train
java
get the ClassTypeSignature corresponding to given parameterized type @param parameterizedType @return
private ClassTypeSignature getClassTypeSignature( ParameterizedType parameterizedType) { Class<?> rawType = (Class<?>) parameterizedType.getRawType(); Type[] typeArguments = parameterizedType.getActualTypeArguments(); TypeArgSignature[] typeArgSignatures = new TypeArgSignature[typeArguments.length]; for...
get the ClassTypeSignature corresponding to given parameterized type @param parameterizedType @return private ClassTypeSignature getClassTypeSignature( ParameterizedType parameterizedType) { Class<?> rawType = (Class<?>) parameterizedType.getRawType(); Type[] typeArguments = parameterizedType.getActualTypeA...
224
102
884
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
133dbc5d6256a204e4b98c03803c1006847abf2678571ddf98caf86671d6beaf
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
e1d0eafc3d8d0356f4445988
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getTypeSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L86-L95
train
java
get the type signature corresponding to given java type @param type @return
public TypeSignature getTypeSignature(Type type) { FullTypeSignature typeSignature = getFullTypeSignature(type); if (typeSignature != null) { return typeSignature; } if (type instanceof WildcardType) { return getTypeArgSignature((WildcardType) type); } return null; }
get the type signature corresponding to given java type @param type @return public TypeSignature getTypeSignature(Type type) { FullTypeSignature typeSignature = getFullTypeSignature(type); if (typeSignature != null) { return typeSignature; } if (type instanceof WildcardType) { return getTypeArgSig...
85
76
295
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
eb42e3e1e7e0870961908a869a6ccc640bdc063e08f7d616d85dd73d266b25e5
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
a18ab917570f6f163725aa36
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getFullTypeSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L107-L118
train
java
get the type signature corresponding to given java type @param type @return
private FullTypeSignature getFullTypeSignature(Type type) { if (type instanceof Class<?>) { return getTypeSignature((Class<?>) type); } if (type instanceof GenericArrayType) { return getArrayTypeSignature((GenericArrayType) type); } if (type instanceof ParameterizedType) { return getClassType...
get the type signature corresponding to given java type @param type @return private FullTypeSignature getFullTypeSignature(Type type) { if (type instanceof Class<?>) { return getTypeSignature((Class<?>) type); } if (type instanceof GenericArrayType) { return getArrayTypeSignature((GenericArrayType) t...
103
76
381
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0fe7c64c2368d0e12b093af4577301db0f393bb06c2709c9163c6a8d447f4800
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
ec35ee4c947705e1a011cb50
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getTypeSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L126-L137
train
java
get the type signature corresponding to given class @param clazz @return
private FullTypeSignature getTypeSignature(Class<?> clazz) { StringBuilder sb = new StringBuilder(); if (clazz.isArray()) { sb.append(clazz.getName()); } else if (clazz.isPrimitive()) { sb.append(primitiveTypesMap.get(clazz).toString()); } else { sb.append('L').append(clazz.getName()).append(';'...
get the type signature corresponding to given class @param clazz @return private FullTypeSignature getTypeSignature(Class<?> clazz) { StringBuilder sb = new StringBuilder(); if (clazz.isArray()) { sb.append(clazz.getName()); } else if (clazz.isPrimitive()) { sb.append(primitiveTypesMap.get(clazz).toS...
103
73
404
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
82b666826c21df96e57551c065d2482bd08392204a083ff9ab56e3dd8ec5581d
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
8e38f4171867c5d76f6d5257
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java
JavaTypeToTypeSignature.getTypeArgSignature
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/JavaTypeToTypeSignature.java#L145-L172
train
java
get the TypeArgSignature corresponding to given type @param type @return
private TypeArgSignature getTypeArgSignature(Type type) { if (type instanceof WildcardType) { WildcardType wildcardType = (WildcardType) type; Type lowerBound = wildcardType.getLowerBounds().length == 0 ? null : wildcardType.getLowerBounds()[0]; Type upperBound = wildcardType.getUpperBounds().lengt...
get the TypeArgSignature corresponding to given type @param type @return private TypeArgSignature getTypeArgSignature(Type type) { if (type instanceof WildcardType) { WildcardType wildcardType = (WildcardType) type; Type lowerBound = wildcardType.getLowerBounds().length == 0 ? null : wildcardType.get...
305
73
1,170
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f3c4636b75cd4c748ca99197ffc4832d651d8ee087bf6beca5ca8f7a627b8958
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
4d02e056debd84128e4e48f9
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/functions/L1.java
L1.getValue
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/functions/L1.java#L43-L50
train
java
Gets - \lambda * |\theta|_1.
@Override public double getValue(IntDoubleVector params) { double sum = 0.0; for (int i=0; i<numParams; i++) { sum += Math.abs(params.get(i)); } return - lambda * sum; }
Gets - \lambda * |\theta|_1. @Override public double getValue(IntDoubleVector params) { double sum = 0.0; for (int i=0; i<numParams; i++) { sum += Math.abs(params.get(i)); } return - lambda * sum; }
67
28
221
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
df170b6cc3bd60cc7a0a2760e7110373165d4b9d4403ab3ab31eb0072e971ff8
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
51bf5cc64dbcd62b71c23ac3
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ZipUtils.java
ZipUtils.zipFolder
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ZipUtils.java#L34-L64
train
java
Utility function to zip the content of an entire folder, but not the folder itself. @param folder @param fileName optional @return success or not
public static boolean zipFolder(File folder, String fileName){ boolean success = false; if(!folder.isDirectory()){ return false; } if(fileName == null){ fileName = folder.getAbsolutePath()+ZIP_EXT; } ZipArchiveOutputStream zipOutput = null; try { zipOutput = new ZipArchiveOutputStream(new F...
Utility function to zip the content of an entire folder, but not the folder itself. @param folder @param fileName optional @return success or not public static boolean zipFolder(File folder, String fileName){ boolean success = false; if(!folder.isDirectory()){ return false; } if(fileName == null){ fil...
188
145
627
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0f1b436dd0fb45df79631d48fa6137481784d04739498ad997fc8fc6f9b983a5
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
a8ad71485e9ece13440a7206
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ZipUtils.java
ZipUtils.addFolderContentToZip
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ZipUtils.java#L74-L109
train
java
Add the content of a folder to the zip. If this folder also contains folder(s), this function is called recursively. @param folder @param zipOutput @param folderFromRoot relative path (from archive root) of this folder. @return
private static boolean addFolderContentToZip(File folder, ZipArchiveOutputStream zipOutput, String folderFromRoot){ FileInputStream fileInput; try{ for(File currFile : folder.listFiles()){ ZipArchiveEntry entry = null; if(currFile.isDirectory()){ //as defined by ZipArchiveEntry: //Assumes the e...
Add the content of a folder to the zip. If this folder also contains folder(s), this function is called recursively. @param folder @param zipOutput @param folderFromRoot relative path (from archive root) of this folder. @return private static boolean addFolderContentToZip(File folder, ZipArchiveOutputStream zipOutput,...
336
227
1,227
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
be1218482627b3ea41be5fa48044c2b19e41042924a38d975b4832744d8641c9
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
f2a96df5055f47a65bb5d12b
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ZipUtils.java
ZipUtils.unzipFileOrFolder
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ZipUtils.java#L117-L171
train
java
Unzip a file or a folder @param zipFile @param unzippedFolder optional, if null the file/folder will be extracted in the same folder as zipFile @return
public static boolean unzipFileOrFolder(File zipFile, String unzippedFolder){ InputStream is; ArchiveInputStream in = null; OutputStream out = null; if(!zipFile.isFile()){ return false; } if(unzippedFolder == null){ unzippedFolder = FilenameUtils.removeExtension(zipFile.getAbsolutePath()); } ...
Unzip a file or a folder @param zipFile @param unzippedFolder optional, if null the file/folder will be extracted in the same folder as zipFile @return public static boolean unzipFileOrFolder(File zipFile, String unzippedFolder){ InputStream is; ArchiveInputStream in = null; OutputStream out = null; if(!zi...
375
151
1,313
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7e671499c542e2a52227120392568928e35d68164d283401cf69ae2eb3e36551
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
af0667acc016c63f00852234
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplShared.java
UTCTimeBoxImplShared.formatUsingFormat
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplShared.java#L111-L123
train
java
Formats the value provided with the specified DateTimeFormat
protected static final String formatUsingFormat(Long value, DateTimeFormat fmt) { if (value == null) { return ""; } else { // midnight GMT Date date = new Date(0); // offset by timezone and value date.setTime(UTCDateBox.timezoneOffsetMi...
Formats the value provided with the specified DateTimeFormat protected static final String formatUsingFormat(Long value, DateTimeFormat fmt) { if (value == null) { return ""; } else { // midnight GMT Date date = new Date(0); // offset by timezone ...
95
60
430
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
048dbba07ab64e5dd920186905f28b9a7046e3248e9c7c4d6841df07f39ec9c5
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
eda44d0d328fcfc07c1f8376
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplShared.java
UTCTimeBoxImplShared.parseUsingFallbacksWithColon
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplShared.java#L129-L156
train
java
Attempts to insert a colon so that a value without a colon can be parsed.
protected static final Long parseUsingFallbacksWithColon(String text, DateTimeFormat timeFormat) { if (text.indexOf(':') == -1) { text = text.replace(" ", ""); int numdigits = 0; int lastdigit = 0; for (int i = 0; i < text.length(); i++) { char c =...
Attempts to insert a colon so that a value without a colon can be parsed. protected static final Long parseUsingFallbacksWithColon(String text, DateTimeFormat timeFormat) { if (text.indexOf(':') == -1) { text = text.replace(" ", ""); int numdigits = 0; int lastdigit = 0; ...
242
73
1,026
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f52d5b0e50287a41652e8c9d80cd147bb7493a7598c9c58508a30879cb2919e0
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
aab9f90a101ae7c4a336c7be
jbossws/jbossws-spi
src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
WSFServlet.getDelegate
https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java#L72-L79
train
java
Creates a ServletDelegate instance according to the STACK_SERVLET_DELEGATE_CLASS init parameter. The class is loaded through a ServletDelegateFactory that's retrieved as follows: - if a default ClassLoaderProvider is available, the webservice subsystem classloader from it is used to lookup the factory - otherwise the c...
protected ServletDelegate getDelegate(ServletConfig servletConfig) { ClassLoaderProvider clProvider = ClassLoaderProvider.getDefaultProvider(); ClassLoader cl = clProvider.getWebServiceSubsystemClassLoader(); ServiceLoader<ServletDelegateFactory> sl = ServiceLoader.load(ServletDelegateFactory.class...
Creates a ServletDelegate instance according to the STACK_SERVLET_DELEGATE_CLASS init parameter. The class is loaded through a ServletDelegateFactory that's retrieved as follows: - if a default ClassLoaderProvider is available, the webservice subsystem classloader from it is used to lookup the factory - otherwise the c...
181
452
495
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
be77285cc40566d3bd37aa591c649d6ac1d6860d87606be801b5eabdb5a4de7e
Apache-2.0
permissive
https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt
2d855bbc1a9758b7d32a6ef0
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.getRawType
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L39-L60
train
java
This method returns the actual raw class associated with the specified type.
public static Class<?> getRawType(Type type) { if (type instanceof Class) { return (Class<?>) type; } else if (type instanceof ParameterizedType) { ParameterizedType actualType = (ParameterizedType) type; return getRawType(actualType.getRawType()); } else if (type instanceof GenericArrayType) { Generi...
This method returns the actual raw class associated with the specified type. public static Class<?> getRawType(Type type) { if (type instanceof Class) { return (Class<?>) type; } else if (type instanceof ParameterizedType) { ParameterizedType actualType = (ParameterizedType) type; return getRawType(actual...
230
76
858
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
99e922bc7d5257452a569afbc13b896c6fc7b6b79d88887841a5054d73b5bef5
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
0493fe3ad9dacacb91f9c496
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.isAssignableFrom
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L66-L87
train
java
Check if this type is assignable from the given Type.
public static boolean isAssignableFrom(TypeReference<?> from, TypeReference<?> to) { if (from == null) { return false; } if (to.equals(from)) { return true; } if (to.getType() instanceof Class) { return to.getRawType().isAssignableFrom(from.getRawType()); } else if (to.getType() instanceof Parame...
Check if this type is assignable from the given Type. public static boolean isAssignableFrom(TypeReference<?> from, TypeReference<?> to) { if (from == null) { return false; } if (to.equals(from)) { return true; } if (to.getType() instanceof Class) { return to.getRawType().isAssignableFrom(from.get...
184
53
723
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3c19f0acc148c0e571929d012850ce8d3826681e150f87949bd6ae254a1fb6e6
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
0fdbd98b620eaada54f95e0f
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.isAssignableFrom
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L93-L145
train
java
Private recursive helper function to actually do the type-safe checking of assignability.
private static boolean isAssignableFrom(Type from, ParameterizedType to, Map<String, Type> typeVarMap) { if (from == null) { return false; } if (to.equals(from)) { return true; } // First figure out the class and any type information. Class<?> clazz = getRawType(from); ParameterizedType ptype ...
Private recursive helper function to actually do the type-safe checking of assignability. private static boolean isAssignableFrom(Type from, ParameterizedType to, Map<String, Type> typeVarMap) { if (from == null) { return false; } if (to.equals(from)) { return true; } // First figure out the clas...
400
89
1,403
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ff5e14618d7a2d1e66eeea7219bc1666a815c39c2ee028d590a8bba93bd1ed7b
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
3f56eeafc14ee16e9db9ce3a
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.typeEquals
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L151-L164
train
java
Checks if two parameterized types are exactly equal, under the variable replacement described in the typeVarMap.
private static boolean typeEquals(ParameterizedType from, ParameterizedType to, Map<String, Type> typeVarMap) { if (from.getRawType().equals(to.getRawType())) { Type[] fromArgs = from.getActualTypeArguments(); Type[] toArgs = to.getActualTypeArguments(); for (int i = 0; i < fromArgs.length; i++) { if ...
Checks if two parameterized types are exactly equal, under the variable replacement described in the typeVarMap. private static boolean typeEquals(ParameterizedType from, ParameterizedType to, Map<String, Type> typeVarMap) { if (from.getRawType().equals(to.getRawType())) { Type[] fromArgs = from.getActualTypeA...
144
112
437
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f2768368c4bf559283131f5b25c57d5994aa859ee72642a31a0775847a5504db
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
dc85a5733f6b2c0865ffc9dd
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.matches
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L170-L179
train
java
Checks if two types are the same or are equivalent under a variable mapping given in the type map that was provided.
private static boolean matches(Type from, Type to, Map<String, Type> typeMap) { if (to.equals(from)) return true; if (from instanceof TypeVariable) { return to.equals(typeMap.get(((TypeVariable<?>) from).getName())); } return false; }
Checks if two types are the same or are equivalent under a variable mapping given in the type map that was provided. private static boolean matches(Type from, Type to, Map<String, Type> typeMap) { if (to.equals(from)) return true; if (from instanceof TypeVariable) { return to.equals(typeMap.get(((TypeVariab...
88
116
251
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
33de4a2bcf6f407b8464366107ab9163d349ac5d47e8fe06efd6aa7d9603e0f7
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
58902707a62ce5d76ba1481a
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/type/TypeUtils.java
TypeUtils.isAssignableFrom
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeUtils.java#L185-L205
train
java
Private helper function that performs some assignability checks for the provided GenericArrayType.
private static boolean isAssignableFrom(Type from, GenericArrayType to) { Type toGenericComponentType = to.getGenericComponentType(); if (toGenericComponentType instanceof ParameterizedType) { Type t = from; if (from instanceof GenericArrayType) { t = ((GenericArrayType) from).getGenericComponentType(); ...
Private helper function that performs some assignability checks for the provided GenericArrayType. private static boolean isAssignableFrom(Type from, GenericArrayType to) { Type toGenericComponentType = to.getGenericComponentType(); if (toGenericComponentType instanceof ParameterizedType) { Type t = from; if...
195
98
752
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
560145e36694cbea7e8325805b9d494287529b2b35f451421b085a0356300bbe
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
f6ce6cb09a8d2fe42d39b3d5
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.setValue
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L116-L122
train
java
Selects the specified value in the list. @param value the new value @param fireEvents if true, a ValueChangeEvent event will be fired @see #setAddMissingValue
@Override public void setValue(String value, boolean fireEvents) { boolean added = setSelectedValue(this, value, addMissingValue); if (added && fireEvents) { ValueChangeEvent.fire(this, getValue()); } }
Selects the specified value in the list. @param value the new value @param fireEvents if true, a ValueChangeEvent event will be fired @see #setAddMissingValue @Override public void setValue(String value, boolean fireEvents) { boolean added = setSelectedValue(this, value, addMissingValue); if (added && fireEvent...
84
159
218
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5af777d7c7f073a6df3667a3e3755d9ed3f8fc52d8230758742e0c435f4d3411
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
60d6bbd2590bad7a7ae2a677
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.getSelectedValue
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L146-L149
train
java
Utility function to get the current value.
public static final String getSelectedValue(ListBox list) { int index = list.getSelectedIndex(); return (index >= 0) ? list.getValue(index) : null; }
Utility function to get the current value. public static final String getSelectedValue(ListBox list) { int index = list.getSelectedIndex(); return (index >= 0) ? list.getValue(index) : null; }
44
42
155
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
54f5b91cdfbfc46f51a998366f7260bf390b1b2be407619611ac4910bb23c515
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
8b5f098a47b86c5064af581f
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.getSelectedText
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L154-L157
train
java
Utility function to get the current text.
public static final String getSelectedText(ListBox list) { int index = list.getSelectedIndex(); return (index >= 0) ? list.getItemText(index) : null; }
Utility function to get the current text. public static final String getSelectedText(ListBox list) { int index = list.getSelectedIndex(); return (index >= 0) ? list.getItemText(index) : null; }
45
41
157
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8b5386da95c100422e698f25d8568de99119f376f1ef62c24771c2de0cbbb6af
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
2743f173f11b9210da08baa4
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.findValueInListBox
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L163-L170
train
java
Utility function to find the first index of a value in a ListBox.
public static final int findValueInListBox(ListBox list, String value) { for (int i=0; i<list.getItemCount(); i++) { if (value.equals(list.getValue(i))) { return i; } } return -1; }
Utility function to find the first index of a value in a ListBox. public static final int findValueInListBox(ListBox list, String value) { for (int i=0; i<list.getItemCount(); i++) { if (value.equals(list.getValue(i))) { return i; } } return -1; }
71
65
200
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5f49d5f79ff9dc8e7d056ef3923937b3e256ffc9e62af6900f68d33e5e284153
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
96c4f6092886fdd176b67579
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.setSelectedValue
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L178-L201
train
java
Utility function to set the current value in a ListBox. @return returns true if the option corresponding to the value was successfully selected in the ListBox
public static final boolean setSelectedValue(ListBox list, String value, boolean addMissingValues) { if (value == null) { list.setSelectedIndex(0); return false; } else { int index = findValueInListBox(list, value); if (index >= 0) { list.setSelectedIndex(index); return true; } if ...
Utility function to set the current value in a ListBox. @return returns true if the option corresponding to the value was successfully selected in the ListBox public static final boolean setSelectedValue(ListBox list, String value, boolean addMissingValues) { if (value == null) { list.setSelectedIndex(0); ...
161
159
536
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5fb1b713fa8ae8db7d365a9b5dd021bdcb76f05563c2cddfff8f30d3007bbcc5
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
7c45e89352dbad52d3b58c25
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/SoyTemplateViewResolver.java
SoyTemplateViewResolver.normalize
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/SoyTemplateViewResolver.java#L161-L173
train
java
Remove beginning and ending slashes, then replace all occurrences of / with . @param viewName The Spring viewName @return The name of the view, dot separated.
private String normalize(final String viewName) { String normalized = viewName; if (normalized.startsWith("/")) { normalized = normalized.substring(0); } if (normalized.endsWith("/")) { normalized = normalized.substring(0, normalized.length() - 1); } return normalized.replaceAll("/", "."); }
Remove beginning and ending slashes, then replace all occurrences of / with . @param viewName The Spring viewName @return The name of the view, dot separated. private String normalize(final String viewName) { String normalized = viewName; if (normalized.startsWith("/")) { normalized = normalized.substring(0);...
104
159
314
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fe24ee7a41f79fc0841c5333ca7368cf435bcd8479abce0f41ab50e2c0191315
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
45243a521be15f507d66829a
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/AdaDelta.java
AdaDelta.computeLearningRate
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/AdaDelta.java#L105-L119
train
java
The entire point of this method is to carefully compute the following: <p> Math.sqrt(updAccum[i] + prm.constantAddend) / Math.sqrt(gradAccum[i] + prm.constantAddend); </p> without running into boundary cases. @param i The index of the parameter for which to compute the learning rate. @return The learning rate for that...
private double computeLearningRate(int i) { if (gradAccum[i] < 0) { throw new RuntimeException("Gradient accumulator is < 0: " + gradAccum[i]); } if (updAccum[i] < 0) { throw new RuntimeException("Update accumulator is < 0: " + updAccum[i]); } double lear...
The entire point of this method is to carefully compute the following: <p> Math.sqrt(updAccum[i] + prm.constantAddend) / Math.sqrt(gradAccum[i] + prm.constantAddend); </p> without running into boundary cases. @param i The index of the parameter for which to compute the learning rate. @return The learning rate for that...
235
331
652
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d484b1b6d3d2ebd009952ee4f7b5814e4372fda5a4e30c77167b0810d1042500
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
f51895d0fa8aa8624868a3a5
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java
BeanUtils.capitalizePropertyName
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java#L36-L44
train
java
Return a capitalized version of the specified property name. @param s The property name
public static String capitalizePropertyName(String s) { if (s.length() == 0) { return s; } char[] chars = s.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); }
Return a capitalized version of the specified property name. @param s The property name public static String capitalizePropertyName(String s) { if (s.length() == 0) { return s; } char[] chars = s.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); }
73
88
217
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d1141bf8399d821da67a48e1be53373776ab6db090ec18341355d7ccd9b842eb
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
ea96c19da8990f1bb450e6fc
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java
BeanUtils.getSetters
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java#L72-L88
train
java
get a map of public setters (propertyName -> Method) @param clazz @return
public static Map<String, Method> getSetters(Class<?> clazz) { Map<String, Method> setters = new HashMap<String, Method>(); Method[] methods = clazz.getMethods(); for (Method method : methods) { String methodName = method.getName(); if (method.getParameterTypes().length == 1 && methodName.startsW...
get a map of public setters (propertyName -> Method) @param clazz @return public static Map<String, Method> getSetters(Class<?> clazz) { Map<String, Method> setters = new HashMap<String, Method>(); Method[] methods = clazz.getMethods(); for (Method method : methods) { String methodName = method.getName()...
167
74
638
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
79bc4fe0da697f79243cda036d2a8e9fc91a47526b80b2c463ecedc011b7ce7c
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
e6fdf00a72d08b6ce1a3679e
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java
BeanUtils.getGetters
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java#L96-L122
train
java
get a map of public getters (propertyName -> Method) @param clazz @return
public static Map<String, Method> getGetters(Class<?> clazz) { Map<String, Method> getters = new HashMap<String, Method>(); Method[] methods = clazz.getMethods(); for (Method method : methods) { String methodName = method.getName(); if (method.getParameterTypes().length == 0) { if (methodName.star...
get a map of public getters (propertyName -> Method) @param clazz @return public static Map<String, Method> getGetters(Class<?> clazz) { Map<String, Method> getters = new HashMap<String, Method>(); Method[] methods = clazz.getMethods(); for (Method method : methods) { String methodName = method.getName()...
241
74
965
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f0949031450d10e0af4b6dfab1aafb3646be32df369ab4c9eb2f5563f0f1812f
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
14c702a45dafaf2049855a8d
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java
BeanUtils.getGetterPropertyMethod
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java#L128-L145
train
java
get the getter method corresponding to given property
public static Method getGetterPropertyMethod(Class<?> type, String propertyName) { String sourceMethodName = "get" + BeanUtils.capitalizePropertyName(propertyName); Method sourceMethod = BeanUtils.getMethod(type, sourceMethodName); if (sourceMethod == null) { sourceMethodName = "is" + Be...
get the getter method corresponding to given property public static Method getGetterPropertyMethod(Class<?> type, String propertyName) { String sourceMethodName = "get" + BeanUtils.capitalizePropertyName(propertyName); Method sourceMethod = BeanUtils.getMethod(type, sourceMethodName); if (sourceM...
132
53
580
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cc3186a79b70adebc5d879116d8e7a1cf1d478c6df25d47c4031384e903d217b
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
7855d1fbdabcb2243d21a9b3
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java
BeanUtils.getSetterPropertyMethod
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/utils/BeanUtils.java#L151-L159
train
java
get the setter method corresponding to given property
public static Method getSetterPropertyMethod(Class<?> type, String propertyName) { String sourceMethodName = "set" + BeanUtils.capitalizePropertyName(propertyName); Method sourceMethod = BeanUtils.getMethod(type, sourceMethodName); return sourceMethod; }
get the setter method corresponding to given property public static Method getSetterPropertyMethod(Class<?> type, String propertyName) { String sourceMethodName = "set" + BeanUtils.capitalizePropertyName(propertyName); Method sourceMethod = BeanUtils.getMethod(type, sourceMethodName); return sour...
62
53
278
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f0b5f062e95dab7a705f2617dab4c1d0111b97ec6bafce77123b6472468c4f40
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
a17f3245ea913484c9d12cdf
matiwinnetou/spring-soy-view
spring-soy-view/src/main/java/pl/matisoft/soy/data/NoConvertSoyDataConverter.java
NoConvertSoyDataConverter.toSoyMap
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view/src/main/java/pl/matisoft/soy/data/NoConvertSoyDataConverter.java#L28-L38
train
java
Pass a model object and return a SoyMapData if a model object happens to be a SoyMapData. An implementation will also check if a passed in object is a Map and return a SoyMapData wrapping that map
@Override public Optional<SoyMapData> toSoyMap(@Nullable final Object model) throws Exception { if (model instanceof SoyMapData) { return Optional.of((SoyMapData) model); } if (model instanceof Map) { return Optional.of(new SoyMapData(model)); } retur...
Pass a model object and return a SoyMapData if a model object happens to be a SoyMapData. An implementation will also check if a passed in object is a Map and return a SoyMapData wrapping that map @Override public Optional<SoyMapData> toSoyMap(@Nullable final Object model) throws Exception { if (model ins...
125
197
358
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
132c43016aae9bd924ad80acda4ba3ee6a4b67d33e0a0e21b027b8fa6976bb0a
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
2feab17a82d5378d7ab839a2
matiwinnetou/spring-soy-view
spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/utils/PathUtils.java
PathUtils.arrayToPath
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/utils/PathUtils.java#L23-L29
train
java
Converts a String array to a String with coma separator example: String["a.soy", "b.soy"] - output: a.soy,b.soy @param array - array @return comma separated list
public static String arrayToPath(final String[] array) { if (array == null) { return ""; } return Joiner.on(",").skipNulls().join(array); }
Converts a String array to a String with coma separator example: String["a.soy", "b.soy"] - output: a.soy,b.soy @param array - array @return comma separated list public static String arrayToPath(final String[] array) { if (array == null) { return ""; } return Joiner.on(",").skipNul...
86
161
180
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9bcb81ec55c417df6c0607c147a462d27e8d70bf2aa061348a6573dc40b04b50
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
e780182280175f3afc06cc87
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplHtml4.java
UTCTimeBoxImplHtml4.validate
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCTimeBoxImplHtml4.java#L465-L480
train
java
styling
@Override public void validate() { boolean valid = true; if (hasValue()) { Long value = getValue(); if (value != null) { // scrub the value to format properly setText(value2text(value)); } else { // empty...
styling @Override public void validate() { boolean valid = true; if (hasValue()) { Long value = getValue(); if (value != null) { // scrub the value to format properly setText(value2text(value)); } else { ...
97
7
474
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5f8df85fecc0a027d8566f9147d3ef67c793eb15943959bfb6728bfae254c979
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
088a7214351f05ff848b0819
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingTextArea.java
AutoSizingTextArea.getShadowSize
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingTextArea.java#L102-L107
train
java
Returns the size of the shadow element
@Override public int getShadowSize() { Element shadowElement = shadow.getElement(); shadowElement.setScrollTop(10000); return shadowElement.getScrollTop(); }
Returns the size of the shadow element @Override public int getShadowSize() { Element shadowElement = shadow.getElement(); shadowElement.setScrollTop(10000); return shadowElement.getScrollTop(); }
44
38
168
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ac5868d7aca0056cd8d01ab704975df624ee1c032fd7409ff120ea1c0ed949ba
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
a08765e5faba12540affdd3f
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Headers.java
Headers.getFirstHeaderValueAsDirectives
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Headers.java#L91-L94
train
java
TODO: Eliminate null
public Optional<Directives> getFirstHeaderValueAsDirectives(String headerKey) { Optional<Header> header = getFirstHeader(headerKey); return header.map(Header::getDirectives); }
TODO: Eliminate null public Optional<Directives> getFirstHeaderValueAsDirectives(String headerKey) { Optional<Header> header = getFirstHeader(headerKey); return header.map(Header::getDirectives); }
49
20
196
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9aa8fb887b24b233814649086cd9cc82a435cbfc71a60a8a88eb156d97f092ec
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
9fd6f4356dd99b5a0888104e
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/NumberUtils.java
NumberUtils.parseNumber
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/NumberUtils.java#L19-L49
train
java
Tries to parse value into the targetClass. The implementation is no elegant, but it's faster than targetClass.getConstructor(String.class).newInstance(value); @param value @param targetClass @return T instance of value or null if the parsing failed
@SuppressWarnings("unchecked") public static <T> T parseNumber(String value, Class<T> targetClass){ if(value == null){ return null; } try{ if(Integer.class == targetClass){ return (T)Integer.valueOf(value); } else if(Float.class == targetClass){ return (T)Float.valueOf(value); } else if...
Tries to parse value into the targetClass. The implementation is no elegant, but it's faster than targetClass.getConstructor(String.class).newInstance(value); @param value @param targetClass @return T instance of value or null if the parsing failed @SuppressWarnings("unchecked") public static <T> T parseNumber(String...
239
248
719
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
db699fbe435b7902e3344fdfbe9aa511e954e2316b0fca4bc42de761a5c6ef68
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
b9447bc045c5437de12300c9
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/NumberUtils.java
NumberUtils.parseNumber
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/NumberUtils.java#L60-L66
train
java
Tries to parse value into the targetClass. The implementation is no elegant, but it's faster than targetClass.getConstructor(String.class).newInstance(value); @param value @param targetClass @param defaultValue default value to return if the value can not be parsed. @return T instance of value or defaultValue if the pa...
public static <T> T parseNumber(String value, Class<T> targetClass, T defaultValue){ T number = parseNumber(value,targetClass); if(number == null){ return defaultValue; } return number; }
Tries to parse value into the targetClass. The implementation is no elegant, but it's faster than targetClass.getConstructor(String.class).newInstance(value); @param value @param targetClass @param defaultValue default value to return if the value can not be parsed. @return T instance of value or defaultValue if the pa...
114
332
199
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0586467e23c97b338baab5aedb1fbabd1fe5a5b5f5f28a90640681f2330208ba
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
3bfffb8831fb08ee66c75414
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java
ConvertedObjectPool.get
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java#L43-L47
train
java
get the converted object corresponding to sourceObject as converted to destination type by converter @param converter @param sourceObject @param destinationType @return
public Object get(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { return convertedObjects.get(new ConvertedObjectsKey(converter, sourceObject, destinationType)); }
get the converted object corresponding to sourceObject as converted to destination type by converter @param converter @param sourceObject @param destinationType @return public Object get(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { return convertedObjects.get(new ConvertedObject...
70
169
204
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2bf153d7cb0c119e39298286c97efd8e83647381b0c6509371f9362d769a7f96
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
5c4aedd6bfe53310fabb553c
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java
ConvertedObjectPool.add
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java#L61-L65
train
java
add a converted object to the pool @param converter the converter that made the conversion @param sourceObject the source object that has been converted @param destinationType the destination type @param convertedObject the converted object
public void add(IConverter converter, Object sourceObject, TypeReference<?> destinationType, Object convertedObject) { convertedObjects.put(new ConvertedObjectsKey(converter, sourceObject, destinationType), convertedObject); }
add a converted object to the pool @param converter the converter that made the conversion @param sourceObject the source object that has been converted @param destinationType the destination type @param convertedObject the converted object public void add(IConverter converter, Object sourceObject, TypeReference<?...
94
241
236
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b1b9e30ebb1aa86bbf2e9bfd807add0392fa90a988fcf46d4a700882617eea1b
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
00a153799c333af0277c9c49
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java
ConvertedObjectPool.remove
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/context/ConvertedObjectPool.java#L74-L78
train
java
remove a converted object from the pool @param converter @param sourceObject @param destinationType
public void remove(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { convertedObjects.remove(new ConvertedObjectsKey(converter, sourceObject, destinationType)); }
remove a converted object from the pool @param converter @param sourceObject @param destinationType public void remove(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { convertedObjects.remove(new ConvertedObjectsKey(converter, sourceObject, destinationType)); }
59
100
201
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b5093291fcc4cf2877c38600b7a27e6c8c2aaefcbf2622e527084c093cf0a99f
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
df8e41d76a0053c3de250779
jbossws/jbossws-spi
src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
WebservicesFactory.loadFromVFSRoot
https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java#L101-L120
train
java
Load webservices.xml from <code>META-INF/webservices.xml</code> or <code>WEB-INF/webservices.xml</code>. @param root virtual file root @return WebservicesMetaData or <code>null</code> if it cannot be found
public WebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root) { WebservicesMetaData webservices = null; UnifiedVirtualFile wsdd = root.findChildFailSafe("META-INF/webservices.xml"); // Maybe a web application deployment? if (null == wsdd) { wsdd = root.findChildFailSafe...
Load webservices.xml from <code>META-INF/webservices.xml</code> or <code>WEB-INF/webservices.xml</code>. @param root virtual file root @return WebservicesMetaData or <code>null</code> if it cannot be found public WebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root) { WebservicesMetaData webservices =...
173
206
501
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
73732f0ff4d2ab813fa151be3686069d0f5e987edab3bd0c566fbc7fc788beda
Apache-2.0
permissive
https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt
9df6d379a8d593f830e82d6d
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/SampleFunction.java
SampleFunction.convertBatch
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/SampleFunction.java#L37-L43
train
java
Converts a batch indexing into the sample, to a batch indexing into the original function. @param batch The batch indexing into the sample. @return A new batch indexing into the original function, containing only the indices from the sample.
private int[] convertBatch(int[] batch) { int[] conv = new int[batch.length]; for (int i=0; i<batch.length; i++) { conv[i] = sample[batch[i]]; } return conv; }
Converts a batch indexing into the sample, to a batch indexing into the original function. @param batch The batch indexing into the sample. @return A new batch indexing into the original function, containing only the indices from the sample. private int[] convertBatch(int[] batch) { int[] conv = new int[batch...
102
242
207
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
adbeda1b488e4ce3961316b8066b4380cae2ebc9e48647449d07fb6647aceb1e
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
45f1adb04caee47344fb7bdd
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ListUtils.java
ListUtils.containsAtLeastOneNonBlank
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ListUtils.java#L21-L28
train
java
Check that a list allowing null and empty item contains at least one element that is not blank. @param list can't be null @return
public static boolean containsAtLeastOneNonBlank(List<String> list){ for(String str : list){ if(StringUtils.isNotBlank(str)){ return true; } } return false; }
Check that a list allowing null and empty item contains at least one element that is not blank. @param list can't be null @return public static boolean containsAtLeastOneNonBlank(List<String> list){ for(String str : list){ if(StringUtils.isNotBlank(str)){ return true; } } return false; }
72
129
175
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d4dba8272496eb8f00c68cea1fa883b4aca330d7dea65bd0cfe83583238163af
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
db23fc8a5a01da0968838366
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ListUtils.java
ListUtils.toIntegerList
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ListUtils.java#L37-L53
train
java
Parse a list of String into a list of Integer. If one element can not be parsed, the behavior depends on the value of failOnException. @param strList can't be null @param failOnException if an element can not be parsed should we return null or add a null element to the list. @return list of all String parsed as Integer...
public static List<Integer> toIntegerList(List<String> strList, boolean failOnException){ List<Integer> intList = new ArrayList<Integer>(); for(String str : strList){ try{ intList.add(Integer.parseInt(str)); } catch(NumberFormatException nfe){ if(failOnException){ return null; } else{ ...
Parse a list of String into a list of Integer. If one element can not be parsed, the behavior depends on the value of failOnException. @param strList can't be null @param failOnException if an element can not be parsed should we return null or add a null element to the list. @return list of all String parsed as Integer...
175
347
379
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2d7e14ca202187a97ebd4565096af26e7b52b2fbd88349f78f8c6c54dd6567c0
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
c2648ebcccf61fe12c74761a
mgormley/optimize
src/main/java/edu/jhu/hlt/util/math/Vectors.java
Vectors.add
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/math/Vectors.java#L233-L238
train
java
Each element of the second array is added to each element of the first.
public static void add(double[] array1, double[] array2) { assert (array1.length == array2.length); for (int i=0; i<array1.length; i++) { array1[i] += array2[i]; } }
Each element of the second array is added to each element of the first. public static void add(double[] array1, double[] array2) { assert (array1.length == array2.length); for (int i=0; i<array1.length; i++) { array1[i] += array2[i]; } }
72
71
205
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2a43c42eaab479541255f8bb16794d315f7ec16063cfe3e30218296be2b94cb3
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
239100eb00c41fb5a260e3a3
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ArrayUtils.java
ArrayUtils.containsOnlyNull
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ArrayUtils.java#L17-L24
train
java
Check that an array only contains null elements. @param values, can't be null @return
public static boolean containsOnlyNull(Object... values){ for(Object o : values){ if(o!= null){ return false; } } return true; }
Check that an array only contains null elements. @param values, can't be null @return public static boolean containsOnlyNull(Object... values){ for(Object o : values){ if(o!= null){ return false; } } return true; }
59
85
146
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2c7c082f1609f375212615ece233faf7464c6a46d4aa7e220ff4be03fc54f5ec
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
44bc57af780d58e1c30667ff
Canadensys/canadensys-core
src/main/java/net/canadensys/utils/ArrayUtils.java
ArrayUtils.containsOnlyNotNull
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/ArrayUtils.java#L31-L38
train
java
Check that an array only contains elements that are not null. @param values, can't be null @return
public static boolean containsOnlyNotNull(Object... values){ for(Object o : values){ if(o== null){ return false; } } return true; }
Check that an array only contains elements that are not null. @param values, can't be null @return public static boolean containsOnlyNotNull(Object... values){ for(Object o : values){ if(o== null){ return false; } } return true; }
62
98
149
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
db62a2f5cbef202735826838f9c084a4ca97c201863f5891fc54b3d3454b076a
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
27e2daf52bbecfbadce40dcf
matiwinnetou/spring-soy-view
spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/SoyAjaxController.java
SoyAjaxController.compile
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/SoyAjaxController.java#L156-L163
train
java
An endpoint to compile an array of soy templates to JavaScript. This endpoint is a preferred way of compiling soy templates to JavaScript but it requires a user to compose a url on their own or using a helper class TemplateUrlComposer, which calculates checksum of a file and puts this in url so that whenever a file ch...
@RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, ...
An endpoint to compile an array of soy templates to JavaScript. This endpoint is a preferred way of compiling soy templates to JavaScript but it requires a user to compose a url on their own or using a helper class TemplateUrlComposer, which calculates checksum of a file and puts this in url so that whenever a file ch...
402
1,387
850
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8fc138db85843845deaaa5e0e47b09c4cc3b728019743f4ab3dfe98e7dee8362
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
4fb288b4f3b5c99e04d0987a
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/Viewport.java
Viewport.addFocusHandler
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/Viewport.java#L81-L84
train
java
Adds a {@link FocusEvent} handler. @param handler the handler @return returns the handler registration
@Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return ensureHandlers().addHandler(FocusEvent.getType(), handler); }
Adds a {@link FocusEvent} handler. @param handler the handler @return returns the handler registration @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return ensureHandlers().addHandler(FocusEvent.getType(), handler); }
50
103
154
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f4e237cbd019c08aa153ab536f0c46796a0d2641eb26d4c61bcaa7f2f7214481
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
c59bc7ba92b433676dfcb63c
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/Viewport.java
Viewport.addBlurHandler
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/Viewport.java#L92-L95
train
java
Adds a {@link BlurEvent} handler. @param handler the handler @return returns the handler registration
@Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return ensureHandlers().addHandler(BlurEvent.getType(), handler); }
Adds a {@link BlurEvent} handler. @param handler the handler @return returns the handler registration @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return ensureHandlers().addHandler(BlurEvent.getType(), handler); }
50
102
151
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fa4687bae470bb006ec1347cf821e48da04005aa6ad05944a23d399205eed886
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
0e69a3eb522cab277b9365b8
mgormley/optimize
src/main/java/edu/jhu/hlt/util/stats/Multinomials.java
Multinomials.assertLogNormalized
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/stats/Multinomials.java#L59-L62
train
java
Asserts that the parameters are log-normalized within some delta.
public static void assertLogNormalized(double[] logProps, double delta) { double logPropSum = Vectors.logSum(logProps); assert(Utilities.equals(0.0, logPropSum, delta)); }
Asserts that the parameters are log-normalized within some delta. public static void assertLogNormalized(double[] logProps, double delta) { double logPropSum = Vectors.logSum(logProps); assert(Utilities.equals(0.0, logPropSum, delta)); }
59
65
191
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5353a637d5c3e9e31911a095eeb7a0039b0b5a36a0a3601b747b6b8d065c9b2f
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
19239b2a7c76a876a5b28364
jbossws/jbossws-spi
src/main/java/org/jboss/wsf/spi/util/StAXUtils.java
StAXUtils.createXMLInputFactory
https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java#L70-L86
train
java
Return a new factory so that the caller can set sticky parameters. @param nsAware true is nsAware @return XMLInputFactory
public static XMLInputFactory createXMLInputFactory(boolean nsAware) { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, nsAware); factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); factory.setProperty(XMLInputFactor...
Return a new factory so that the caller can set sticky parameters. @param nsAware true is nsAware @return XMLInputFactory public static XMLInputFactory createXMLInputFactory(boolean nsAware) { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWA...
175
123
791
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fb9039b6585a52c658c08b7db7b0613acb3d31dec9333743dbd1bd203040dc70
Apache-2.0
permissive
https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt
68257431e6b1487418e567ee
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/context/UsedConverters.java
UsedConverters.addUsedConverter
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/context/UsedConverters.java#L56-L65
train
java
add a converter that has been used to convert from sourceObject to destination type (if it has not already been added) @param converter @param sourceObject @param destinationType
public void addUsedConverter(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { UsedConverter usedConverter = new UsedConverter(converter, sourceObject == null ? null : sourceObject.getClass(), destinationType); if (!usedConvertersSet.contains(usedConverter)) { usedCo...
add a converter that has been used to convert from sourceObject to destination type (if it has not already been added) @param converter @param sourceObject @param destinationType public void addUsedConverter(IConverter converter, Object sourceObject, TypeReference<?> destinationType) { UsedConverter usedConver...
127
179
403
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4b31a48395213d165a9be464cfef6f545840023032ac51529e15def20f89a08c
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
f2e8ca1bb2ca818075c6db10
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/BatchSampler.java
BatchSampler.sampleBatchWithReplacement
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BatchSampler.java#L56-L63
train
java
Samples a batch of indices in the range [0, numExamples) with replacement.
public int[] sampleBatchWithReplacement() { // Sample the indices with replacement. int[] batch = new int[batchSize]; for (int i=0; i<batch.length; i++) { batch[i] = Prng.nextInt(numExamples); } return batch; }
Samples a batch of indices in the range [0, numExamples) with replacement. public int[] sampleBatchWithReplacement() { // Sample the indices with replacement. int[] batch = new int[batchSize]; for (int i=0; i<batch.length; i++) { batch[i] = Prng.nextInt(numExamples); } ...
80
74
266
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f77c4e1973efc89a457866c0c17d08217ac91ec02c23085f2cad8fe95e8e6540
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
fb9bdad7d29b40a992aacbcc
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/BatchSampler.java
BatchSampler.sampleBatchWithoutReplacement
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/BatchSampler.java#L66-L78
train
java
Samples a batch of indices in the range [0, numExamples) without replacement.
public int[] sampleBatchWithoutReplacement() { int[] batch = new int[batchSize]; for (int i=0; i<batch.length; i++) { if (cur == indices.length) { cur = 0; } if (cur == 0) { IntArrays.shuffle(indices); } batch[i]...
Samples a batch of indices in the range [0, numExamples) without replacement. public int[] sampleBatchWithoutReplacement() { int[] batch = new int[batchSize]; for (int i=0; i<batch.length; i++) { if (cur == indices.length) { cur = 0; } if (cur == 0) {...
103
77
376
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
54d460b414fd1539015c6ab7a7dd08a4adb7c7f78c8050d324d83fa8a10e6f7a
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
5ff44cf5f5d0345cd5995f85
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.lbfgs
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L843-L1189
train
java
Start a L-BFGS optimization. @param n The number of variables. @param x The array of variables. A client program can set default values for the optimization and receive the optimization result through this array. This array must be allocated by ::lbfgs_malloc function for libLBFGS built with SSE/...
public static StatusCode lbfgs( double[] x, MutableDouble ptr_fx, LBFGSCallback cd, LBFGSPrm _param ) { final int n = x.length; StatusCode ret, ls_ret; MutableInt ls = new MutableInt(0); int i, j, k, end, bound; double step...
Start a L-BFGS optimization. @param n The number of variables. @param x The array of variables. A client program can set default values for the optimization and receive the optimization result through this array. This array must be allocated by ::lbfgs_malloc function for libLBFGS built with SSE/...
3,256
1,703
11,633
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e3b32b87092141d13495e008caa9fffeccc8c9efea2b53d4d8c962ca883b28fa
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
eae52ac4c49d43cdda09975c
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.CUBIC_MINIMIZER
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1786-L1803
train
java
Find a minimizer of an interpolated cubic function. @param cm The minimizer of the interpolated cubic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v). @param du ...
private static double CUBIC_MINIMIZER(double cm, double u, double fu, double du, double v, double fv, double dv) { double a, d, gamma, theta, p, q, r, s; d = (v) - (u); theta = ((fu) - (fv)) * 3 / d + (du) + (dv); p = Math.abs(theta); q = Math.abs(du); r = Math.abs(dv); ...
Find a minimizer of an interpolated cubic function. @param cm The minimizer of the interpolated cubic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v). @param du ...
323
340
679
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ae918e4b76d5a9b94bea028e45b1da27fa65d0b6fee9bb179e2c3fbf11e1ba26
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
5bed6ead1a37ddb3723732a6
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.CUBIC_MINIMIZER2
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1817-L1840
train
java
Find a minimizer of an interpolated cubic function. @param cm The minimizer of the interpolated cubic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v). @param du ...
private static double CUBIC_MINIMIZER2(double cm, double u, double fu, double du, double v, double fv, double dv, double xmin, double xmax) { double a, d, gamma, theta, p, q, r, s; d = (v) - (u); theta = ((fu) - (fv)) * 3 / d + (du) + (dv); p = Math.abs(theta); q = Math.abs(du); ...
Find a minimizer of an interpolated cubic function. @param cm The minimizer of the interpolated cubic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v). @param du ...
399
410
865
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7f97d5ddf503a381fc8632580368bf7b83f7e44166cce06f8548a95f247ac970
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
b3a94e916b67f4fa61318458
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.QUARD_MINIMIZER
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1851-L1856
train
java
Find a minimizer of an interpolated quadratic function. @param qm The minimizer of the interpolated quadratic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v).
private static double QUARD_MINIMIZER(double qm, double u, double fu, double du, double v, double fv) { double a, d, gamma, theta, p, q, r, s; a = (v) - (u); (qm) = (u) + (du) / (((fu) - (fv)) / a + (du)) / 2 * a; return qm; }
Find a minimizer of an interpolated quadratic function. @param qm The minimizer of the interpolated quadratic. @param u The value of one point, u. @param fu The value of f(u). @param du The value of f'(u). @param v The value of another point, v. @param fv The value of f(v). privat...
173
312
262
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c2cdfa1f831ab93aa4f60928d1cea0fb64787a9d3e4e7eeecab4f9e5e5f168d5
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
47d794046616552f7f288b4c
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.QUARD_MINIMIZER2
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1866-L1871
train
java
Find a minimizer of an interpolated quadratic function. @param qm The minimizer of the interpolated quadratic. @param u The value of one point, u. @param du The value of f'(u). @param v The value of another point, v. @param dv The value of f'(v).
private static double QUARD_MINIMIZER2(double qm, double u, double du, double v, double dv) { double a, d, gamma, theta, p, q, r, s; a = (u) - (v); (qm) = (v) + (dv) / ((dv) - (du)) * a; return qm; }
Find a minimizer of an interpolated quadratic function. @param qm The minimizer of the interpolated quadratic. @param u The value of one point, u. @param du The value of f'(u). @param v The value of another point, v. @param dv The value of f'(v). private static double QUARD_MINIMIZER2(d...
153
278
235
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ed4781a97ad5d8b019116b0b247e984917e063a27dae9ea2f0221751a6e8af71
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
8e00212046545a70adf569d2
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java
LBFGS_port.update_trial_interval
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/LBFGS_port.java#L1950-L2132
train
java
int *brackt
private static StatusCode update_trial_interval(UpdVals uv) { double x = uv.x; double fx = uv.fx; double dx = uv.dx; double y = uv.y; double fy = uv.fy; double dy = uv.dy; double t = uv.t; double ft = uv.ft; double dt = uv.dt; double tm...
int *brackt private static StatusCode update_trial_interval(UpdVals uv) { double x = uv.x; double fx = uv.fx; double dx = uv.dx; double y = uv.y; double fy = uv.fy; double dy = uv.dy; double t = uv.t; double ft = uv.ft; double dt = uv.dt; ...
1,581
11
6,129
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ece86fb5241276607f43ad055205455e9e522eeaeb9b40517ecc78648d92ccef
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
48a4538faaf63549b3c85f45
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java
TractionDialogBox.show
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java#L178-L192
train
java
Overrides show to call {@link #adjustGlassSize()} if the dialog is already showing and fires an {@link OpenEvent} after the normal show.
@Override public void show() { boolean fireOpen = !isShowing(); super.show(); // adjust the size of the glass if (isShowing()) { adjustGlassSize(); } // fire the open event if (fireOpen) { OpenEvent.fire(this, this); } }
Overrides show to call {@link #adjustGlassSize()} if the dialog is already showing and fires an {@link OpenEvent} after the normal show. @Override public void show() { boolean fireOpen = !isShowing(); super.show(); // adjust the size of the glass if (isShowing()) { adjustGlassSize(); } // fire the ope...
98
136
248
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
73434530143b9fe76654eb63ab6edd291b3321cff1e203a239f7081b47155893
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
a812728ce190c21850b220fc
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java
TractionDialogBox.adjustGlassSize
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/TractionDialogBox.java#L201-L206
train
java
This can be called to adjust the size of the dialog glass. It is implemented using JSNI to bypass the "private" keyword on the glassResizer.
public void adjustGlassSize() { if (isGlassEnabled()) { ResizeHandler handler = getGlassResizer(); if (handler != null) handler.onResize(null); } }
This can be called to adjust the size of the dialog glass. It is implemented using JSNI to bypass the "private" keyword on the glassResizer. public void adjustGlassSize() { if (isGlassEnabled()) { ResizeHandler handler = getGlassResizer(); if (handler != null) handler.onResize(null); ...
75
140
191
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
02a97e19a3d02d2e346d1699e134819a30bd41302cdc6729546ad71689b63b53
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
4545160a5ba517d786baba50
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/Bounds.java
Bounds.getSymmetricBounds
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/Bounds.java#L67-L75
train
java
Gets bounds which are identical for all dimensions. @param dim The number of dimensions. @param l The value of all lower bounds. @param u The value of all upper bounds. @return The new bounds.
public static Bounds getSymmetricBounds(int dim, double l, double u) { double [] L = new double[dim]; double [] U = new double[dim]; for(int i=0; i<dim; i++) { L[i] = l; U[i] = u; } return new Bounds(L, U); }
Gets bounds which are identical for all dimensions. @param dim The number of dimensions. @param l The value of all lower bounds. @param u The value of all upper bounds. @return The new bounds. public static Bounds getSymmetricBounds(int dim, double l, double u) { double [] L = new double[dim]; double ...
113
193
276
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
871c3c5b8a60edf1a4f75a4c1eb10a88fd10a791b91f715c45ade5e099b702eb
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
d7a52e2b7e313fc614e63e80
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/Bounds.java
Bounds.transformFromUnitInterval
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/Bounds.java#L82-L84
train
java
Maps d \in [0,1] to transformed(d), such that transformed(d) \in [A[i], B[i]]. The transform is just a linear one. It does *NOT* check for +/- infinity.
public double transformFromUnitInterval(int i, double d){ return (B[i]-A[i])*(d-1.0)+B[i]; }
Maps d \in [0,1] to transformed(d), such that transformed(d) \in [A[i], B[i]]. The transform is just a linear one. It does *NOT* check for +/- infinity. public double transformFromUnitInterval(int i, double d){ return (B[i]-A[i])*(d-1.0)+B[i]; }
81
152
101
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
21790fe49d62a9df2e6dd3e0dc4bb919a552d076e476d98ee98e777d8f012818
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
767a0dc745a92fd6bcb86eb8
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/Bounds.java
Bounds.transformRangeLinearly
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/Bounds.java#L91-L93
train
java
Maps d \in [l,u] to transformed(d), such that transformed(d) \in [A[i], B[i]]. The transform is just a linear one. It does *NOT* check for +/- infinity.
public double transformRangeLinearly(double l, double u, int i, double d){ return (B[i]-A[i])/(u-l)*(d-u)+B[i]; }
Maps d \in [l,u] to transformed(d), such that transformed(d) \in [A[i], B[i]]. The transform is just a linear one. It does *NOT* check for +/- infinity. public double transformRangeLinearly(double l, double u, int i, double d){ return (B[i]-A[i])/(u-l)*(d-u)+B[i]; }
86
152
122
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c07aa97347ed576f6ffdfeb080a4576cd81931980dcacbb71b1cc253ae153693
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE
2b1148856e1725fdf4afff9b
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java
Tag.parse
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java#L58-L77
train
java
Parses a tag formatted as defined by the HTTP standard. @param httpTag The HTTP tag string; if it starts with 'W/' the tag will be marked as weak and the data following the 'W/' used as the tag; otherwise it should be surrounded with quotes (e.g., "sometag"). @return A new tag instance. @see <a href="http://www.w3.o...
public static Optional<Tag> parse(final String httpTag) { Tag result = null; boolean weak = false; String internal = httpTag; if (internal.startsWith("W/")) { weak = true; internal = internal.substring(2); } if (internal.startsWith("\""...
Parses a tag formatted as defined by the HTTP standard. @param httpTag The HTTP tag string; if it starts with 'W/' the tag will be marked as weak and the data following the 'W/' used as the tag; otherwise it should be surrounded with quotes (e.g., "sometag"). @return A new tag instance. @see <a href="http://www.w3.o...
230
388
616
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a280771656b51d404c41638b0258c0fefc7323450302185fba2a16aa064eaf54
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
d8f582bba27c0e8984e914ba
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java
Tag.format
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Tag.java#L151-L162
train
java
Returns tag formatted as an HTTP tag string. @return The formatted HTTP tag string. @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11">HTTP Entity Tags</a>
public String format() { if (getName().equals("*")) { return "*"; } else { StringBuilder sb = new StringBuilder(); if (isWeak()) { sb.append("W/"); } return sb.append('"').append(getName()).append('"').toString(...
Returns tag formatted as an HTTP tag string. @return The formatted HTTP tag string. @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11">HTTP Entity Tags</a> public String format() { if (getName().equals("*")) { return "*"; } else { StringB...
120
183
340
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6b5c9438153c96b7dc568d2f0c5a32a8198634c59d2b3bd409a6c9b519a0fddf
Apache-2.0
permissive
https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt
c92c4fe492f6761669760bf4
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCTimeBox.java
UTCTimeBox.getValueForNextHour
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/UTCTimeBox.java#L119-L127
train
java
utils
public static final Long getValueForNextHour() { Date date = new Date(); long value = UTCDateBox.date2utc(date); // remove anything after an hour and add an hour long hour = 60 * 60 * 1000; value = value % UTCDateBox.DAY_IN_MS; return value - (value % hour) + hour; }
utils public static final Long getValueForNextHour() { Date date = new Date(); long value = UTCDateBox.date2utc(date); // remove anything after an hour and add an hour long hour = 60 * 60 * 1000; value = value % UTCDateBox.DAY_IN_MS; return value - (value % hour) + hour...
83
5
320
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b656d526323bfa1c2dc7be6a4d244dc9f320eb59d2d979096890bfc12c002146
Apache-2.0
permissive
https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE
174c9a13dc0c52bbe11acc6a
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/parser/JavaSyntaxTypeSignatureParser.java
JavaSyntaxTypeSignatureParser.parseOuterClassName
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/JavaSyntaxTypeSignatureParser.java#L133-L151
train
java
parse the outer class name @return
private String parseOuterClassName() { StringBuilder sb = new StringBuilder(); sb.append(lexer.nextToken(TokenType.JAVA_ID).text); Token token = lexer.peekToken(0); boolean isFullyQualifiedName = false; while (token.tokenType == TokenType.PACKAGE_SEPARATOR) { isFullyQualifiedName = true; token = lexer.n...
parse the outer class name @return private String parseOuterClassName() { StringBuilder sb = new StringBuilder(); sb.append(lexer.nextToken(TokenType.JAVA_ID).text); Token token = lexer.peekToken(0); boolean isFullyQualifiedName = false; while (token.tokenType == TokenType.PACKAGE_SEPARATOR) { isFullyQua...
143
35
580
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d7dd6796916a09b12a1fcc3b105ed91ed15c79adcea9727919cf0f64920bd413
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
5b2dc572625c484cbde033e0
cchabanois/transmorph
src/main/java/net/entropysoft/transmorph/signature/parser/JavaSyntaxTypeSignatureLexer.java
JavaSyntaxTypeSignatureLexer.parseJavaId
https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/JavaSyntaxTypeSignatureLexer.java#L154-L168
train
java
parse a java id @return
private String parseJavaId() { StringBuilder sb = new StringBuilder(); int ch; while (true) { ch = characterBuffer.peekChar(); if (ch == CharacterBuffer.EOS || !isJavaIdentifierPart(ch)) { if (sb.length() == 0) { return null; } return sb.toString(); } sb.append((char) ch); characte...
parse a java id @return private String parseJavaId() { StringBuilder sb = new StringBuilder(); int ch; while (true) { ch = characterBuffer.peekChar(); if (ch == CharacterBuffer.EOS || !isJavaIdentifierPart(ch)) { if (sb.length() == 0) { return null; } return sb.toString(); } sb.appe...
103
24
346
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cf165346005db9d654f95bdd408928a69bd0e294e8cac52faa0b02f59fe7a060
Apache-2.0
permissive
https://github.com/cchabanois/transmorph/blob/master/LICENSE
59a625fe8e88ed45e059c0e6
Canadensys/canadensys-core
src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java
UTF8PropertyResourceBundle.getBundle
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java#L26-L32
train
java
Get a PropertyResourceBundle able to read an UTF-8 properties file. @param baseName @param locale @return new ResourceBundle or null if no bundle can be found. @throws UnsupportedEncodingException @throws IOException
public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{ InputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream("/"+baseName + "_"+locale.toString()+PROPERTIES_EXT); if(is != null){ return new PropertyResourceBundle(new InputS...
Get a PropertyResourceBundle able to read an UTF-8 properties file. @param baseName @param locale @return new ResourceBundle or null if no bundle can be found. @throws UnsupportedEncodingException @throws IOException public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncod...
119
216
368
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0a21db9932f95572e29e43cdc615ccf23959673b12ced34d229cf302c152789b
MIT
permissive
https://github.com/Canadensys/canadensys-core/blob/master/LICENSE
6fb5957a1f332bd7ef58ceff
matiwinnetou/spring-soy-view
spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/utils/I18nUtils.java
I18nUtils.getLocaleFromString
https://github.com/matiwinnetou/spring-soy-view/blob/a27c1b2bc76b074a2753ddd7b0c7f685c883d1d1/spring-soy-view-ajax-compiler/src/main/java/pl/matisoft/soy/ajax/utils/I18nUtils.java#L44-L76
train
java
Convert a string based locale into a Locale Object. Assumes the string has form "{language}_{country}_{variant}". Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC" @param localeString The String @return the Locale
public static Locale getLocaleFromString(String localeString) { if (localeString == null) { return null; } localeString = localeString.trim(); if (localeString.toLowerCase().equals("default")) { return Locale.getDefault(); } // Extract language ...
Convert a string based locale into a Locale Object. Assumes the string has form "{language}_{country}_{variant}". Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC" @param localeString The String @return the Locale public static Locale getLocaleFromString(String localeString) { if (localeStrin...
314
231
1,306
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e09f791fad251b08452149cf0646dd7c9cbe8f5f580cb817679cff37126dc690
Apache-2.0
permissive
https://github.com/matiwinnetou/spring-soy-view/blob/master/LICENSE
99b518b7599afab4fe174546
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/SGD.java
SGD.minimize
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/SGD.java#L87-L90
train
java
Minimize the function starting at the given initial point.
@Override public boolean minimize(DifferentiableBatchFunction function, IntDoubleVector point) { return minimize(function, point, null); }
Minimize the function starting at the given initial point. @Override public boolean minimize(DifferentiableBatchFunction function, IntDoubleVector point) { return minimize(function, point, null); }
41
58
154
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4ff042d1a1a9c1602fc0915116286c0ad877b2aee576d87cf75c47a9f11344dc
Apache-2.0
permissive
https://github.com/mgormley/optimize/blob/master/LICENSE