repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 201 | func_name stringlengths 4 126 | whole_func_string stringlengths 75 3.57k | language stringclasses 1
value | func_code_string stringlengths 75 3.57k | func_code_tokens listlengths 21 599 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/SecurityActions.java | SecurityActions.createURLCLassLoader | static URLClassLoader createURLCLassLoader(final URL[] urls, final ClassLoader parent)
{
return (URLClassLoader)AccessController.doPrivileged(new PrivilegedAction<Object>()
{
public Object run()
{
return new URLClassLoader(urls, parent);
}
});
} | java | static URLClassLoader createURLCLassLoader(final URL[] urls, final ClassLoader parent)
{
return (URLClassLoader)AccessController.doPrivileged(new PrivilegedAction<Object>()
{
public Object run()
{
return new URLClassLoader(urls, parent);
}
});
} | [
"static",
"URLClassLoader",
"createURLCLassLoader",
"(",
"final",
"URL",
"[",
"]",
"urls",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"(",
"URLClassLoader",
")",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Object"... | Create an URLClassLoader
@param urls The urls
@param parent The parent class loader
@return The class loader | [
"Create",
"an",
"URLClassLoader"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/SecurityActions.java#L128-L137 |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java | XCodePackageManager.packageArtifacts | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException
{
File mainArtifact = createMainArtifactFile(project);
attachBundle(compileDir, project, bundles, mainArtifact);
final File mainArtifactFile = archiveMainArtifact(project, mainArtifact);
setMainArtifact(project, mainArtifactFile);
} | java | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException
{
File mainArtifact = createMainArtifactFile(project);
attachBundle(compileDir, project, bundles, mainArtifact);
final File mainArtifactFile = archiveMainArtifact(project, mainArtifact);
setMainArtifact(project, mainArtifactFile);
} | [
"void",
"packageArtifacts",
"(",
"final",
"File",
"compileDir",
",",
"final",
"MavenProject",
"project",
",",
"final",
"Set",
"<",
"String",
">",
"bundles",
")",
"throws",
"IOException",
",",
"XCodeException",
"{",
"File",
"mainArtifact",
"=",
"createMainArtifactF... | Packages all the artifacts. The main artifact is set and all side artifacts are attached for
deployment.
@param bundles
@param buildDir | [
"Packages",
"all",
"the",
"artifacts",
".",
"The",
"main",
"artifact",
"is",
"set",
"and",
"all",
"side",
"artifacts",
"are",
"attached",
"for",
"deployment",
"."
] | train | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java#L65-L76 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DeviceTypesApi.java | DeviceTypesApi.getManifestProperties | public ManifestPropertiesEnvelope getManifestProperties(String deviceTypeId, String version) throws ApiException {
ApiResponse<ManifestPropertiesEnvelope> resp = getManifestPropertiesWithHttpInfo(deviceTypeId, version);
return resp.getData();
} | java | public ManifestPropertiesEnvelope getManifestProperties(String deviceTypeId, String version) throws ApiException {
ApiResponse<ManifestPropertiesEnvelope> resp = getManifestPropertiesWithHttpInfo(deviceTypeId, version);
return resp.getData();
} | [
"public",
"ManifestPropertiesEnvelope",
"getManifestProperties",
"(",
"String",
"deviceTypeId",
",",
"String",
"version",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ManifestPropertiesEnvelope",
">",
"resp",
"=",
"getManifestPropertiesWithHttpInfo",
"(",
"devic... | Get manifest properties
Get a Device Type's manifest properties for a specific version.
@param deviceTypeId Device Type ID. (required)
@param version Manifest Version. (required)
@return ManifestPropertiesEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"manifest",
"properties",
"Get",
"a",
"Device",
"Type'",
";",
"s",
"manifest",
"properties",
"for",
"a",
"specific",
"version",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DeviceTypesApi.java#L760-L763 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.setAtt | public static void setAtt(Element el, String name, int d) {
el.setAttribute(name, Integer.toString(d));
} | java | public static void setAtt(Element el, String name, int d) {
el.setAttribute(name, Integer.toString(d));
} | [
"public",
"static",
"void",
"setAtt",
"(",
"Element",
"el",
",",
"String",
"name",
",",
"int",
"d",
")",
"{",
"el",
".",
"setAttribute",
"(",
"name",
",",
"Integer",
".",
"toString",
"(",
"d",
")",
")",
";",
"}"
] | Set a SVG attribute
@param el element
@param name attribute name
@param d integer value | [
"Set",
"a",
"SVG",
"attribute"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L305-L307 |
alkacon/opencms-core | src/org/opencms/util/CmsParameterEscaper.java | CmsParameterEscaper.enableAntiSamy | public void enableAntiSamy(CmsObject cms, String policyPath, Set<String> params) {
m_antiSamy = createAntiSamy(cms, policyPath);
m_cleanHtml = params;
} | java | public void enableAntiSamy(CmsObject cms, String policyPath, Set<String> params) {
m_antiSamy = createAntiSamy(cms, policyPath);
m_cleanHtml = params;
} | [
"public",
"void",
"enableAntiSamy",
"(",
"CmsObject",
"cms",
",",
"String",
"policyPath",
",",
"Set",
"<",
"String",
">",
"params",
")",
"{",
"m_antiSamy",
"=",
"createAntiSamy",
"(",
"cms",
",",
"policyPath",
")",
";",
"m_cleanHtml",
"=",
"params",
";",
"... | Enables the AntiSamy HTML cleaning for some parameters.<p>
@param cms the current CMS context
@param policyPath the policy site path in the VFS
@param params the parameters for which HTML cleaning should be enabled | [
"Enables",
"the",
"AntiSamy",
"HTML",
"cleaning",
"for",
"some",
"parameters",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsParameterEscaper.java#L156-L160 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idhandling/IDHandler.java | IDHandler.writeRelationType | public static void writeRelationType(WriteBuffer out, long relationTypeId, DirectionID dirID, boolean invisible) {
assert relationTypeId > 0 && (relationTypeId << 1) > 0; //Check positive and no-overflow
long strippedId = (IDManager.stripEntireRelationTypePadding(relationTypeId) << 1) + dirID.getDirectionInt();
VariableLong.writePositiveWithPrefix(out, strippedId, dirID.getPrefix(invisible, IDManager.isSystemRelationTypeId(relationTypeId)), PREFIX_BIT_LEN);
} | java | public static void writeRelationType(WriteBuffer out, long relationTypeId, DirectionID dirID, boolean invisible) {
assert relationTypeId > 0 && (relationTypeId << 1) > 0; //Check positive and no-overflow
long strippedId = (IDManager.stripEntireRelationTypePadding(relationTypeId) << 1) + dirID.getDirectionInt();
VariableLong.writePositiveWithPrefix(out, strippedId, dirID.getPrefix(invisible, IDManager.isSystemRelationTypeId(relationTypeId)), PREFIX_BIT_LEN);
} | [
"public",
"static",
"void",
"writeRelationType",
"(",
"WriteBuffer",
"out",
",",
"long",
"relationTypeId",
",",
"DirectionID",
"dirID",
",",
"boolean",
"invisible",
")",
"{",
"assert",
"relationTypeId",
">",
"0",
"&&",
"(",
"relationTypeId",
"<<",
"1",
")",
">... | The edge type is written as follows: [ Invisible & System (2 bit) | Relation-Type-ID (1 bit) | Relation-Type-Count (variable) | Direction-ID (1 bit)]
Would only need 1 bit to store relation-type-id, but using two so we can upper bound.
@param out
@param relationTypeId
@param dirID | [
"The",
"edge",
"type",
"is",
"written",
"as",
"follows",
":",
"[",
"Invisible",
"&",
"System",
"(",
"2",
"bit",
")",
"|",
"Relation",
"-",
"Type",
"-",
"ID",
"(",
"1",
"bit",
")",
"|",
"Relation",
"-",
"Type",
"-",
"Count",
"(",
"variable",
")",
... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idhandling/IDHandler.java#L103-L108 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Cosine | public static double Cosine(double[] p, double[] q) {
double sumProduct = 0;
double sumP = 0, sumQ = 0;
for (int i = 0; i < p.length; i++) {
sumProduct += p[i] * q[i];
sumP += Math.pow(Math.abs(p[i]), 2);
sumQ += Math.pow(Math.abs(q[i]), 2);
}
sumP = Math.sqrt(sumP);
sumQ = Math.sqrt(sumQ);
double result = 1 - (sumProduct / (sumP * sumQ));
return result;
} | java | public static double Cosine(double[] p, double[] q) {
double sumProduct = 0;
double sumP = 0, sumQ = 0;
for (int i = 0; i < p.length; i++) {
sumProduct += p[i] * q[i];
sumP += Math.pow(Math.abs(p[i]), 2);
sumQ += Math.pow(Math.abs(q[i]), 2);
}
sumP = Math.sqrt(sumP);
sumQ = Math.sqrt(sumQ);
double result = 1 - (sumProduct / (sumP * sumQ));
return result;
} | [
"public",
"static",
"double",
"Cosine",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"sumProduct",
"=",
"0",
";",
"double",
"sumP",
"=",
"0",
",",
"sumQ",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Gets the Cosine distance between two points.
@param p A point in space.
@param q A point in space.
@return The Cosine distance between x and y. | [
"Gets",
"the",
"Cosine",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L317-L333 |
mikereedell/sunrisesunsetlib-java | src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java | SolarEventCalculator.getLongitudeHour | private BigDecimal getLongitudeHour(Calendar date, Boolean isSunrise) {
int offset = 18;
if (isSunrise) {
offset = 6;
}
BigDecimal dividend = BigDecimal.valueOf(offset).subtract(getBaseLongitudeHour());
BigDecimal addend = divideBy(dividend, BigDecimal.valueOf(24));
BigDecimal longHour = getDayOfYear(date).add(addend);
return setScale(longHour);
} | java | private BigDecimal getLongitudeHour(Calendar date, Boolean isSunrise) {
int offset = 18;
if (isSunrise) {
offset = 6;
}
BigDecimal dividend = BigDecimal.valueOf(offset).subtract(getBaseLongitudeHour());
BigDecimal addend = divideBy(dividend, BigDecimal.valueOf(24));
BigDecimal longHour = getDayOfYear(date).add(addend);
return setScale(longHour);
} | [
"private",
"BigDecimal",
"getLongitudeHour",
"(",
"Calendar",
"date",
",",
"Boolean",
"isSunrise",
")",
"{",
"int",
"offset",
"=",
"18",
";",
"if",
"(",
"isSunrise",
")",
"{",
"offset",
"=",
"6",
";",
"}",
"BigDecimal",
"dividend",
"=",
"BigDecimal",
".",
... | Computes the longitude time, t in the algorithm.
@return longitudinal time in <code>BigDecimal</code> form. | [
"Computes",
"the",
"longitude",
"time",
"t",
"in",
"the",
"algorithm",
"."
] | train | https://github.com/mikereedell/sunrisesunsetlib-java/blob/6e6de23f1d11429eef58de2541582cbde9b85b92/src/main/java/com/luckycatlabs/sunrisesunset/calculator/SolarEventCalculator.java#L148-L157 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.addToListIfNotExists | public static void addToListIfNotExists(List<String> list, String value) {
boolean found = false;
for (String item : list) {
if (item.equalsIgnoreCase(value)) {
found = true;
break;
}
}
if (!found) {
list.add(value);
}
} | java | public static void addToListIfNotExists(List<String> list, String value) {
boolean found = false;
for (String item : list) {
if (item.equalsIgnoreCase(value)) {
found = true;
break;
}
}
if (!found) {
list.add(value);
}
} | [
"public",
"static",
"void",
"addToListIfNotExists",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"value",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"String",
"item",
":",
"list",
")",
"{",
"if",
"(",
"item",
".",
"equalsIg... | Adds a value to the list if does not already exists.
@param list the list
@param value value to add if not exists in the list | [
"Adds",
"a",
"value",
"to",
"the",
"list",
"if",
"does",
"not",
"already",
"exists",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L173-L184 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/shared/SharedBaseRecordTable.java | SharedBaseRecordTable.setHandle | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
this.setCurrentRecord(this.getBaseRecord());
Object[] rgobjEnabledFields = this.getBaseRecord().setEnableFieldListeners(false);
try {
Record record = (Record)super.setHandle(bookmark, iHandleType);
if (record == null)
return null;
this.getBaseRecord().setEnableFieldListeners(rgobjEnabledFields);
this.getBaseRecord().handleValidRecord(); // Display Fields
record = this.moveToCurrentRecord(record);
if (record != null) if (record != this.getBaseRecord())
record.handleValidRecord(); // Display Fields
return record;
} catch (DBException ex) {
throw ex;
} finally {
this.getBaseRecord().setEnableFieldListeners(rgobjEnabledFields);
}
} | java | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
this.setCurrentRecord(this.getBaseRecord());
Object[] rgobjEnabledFields = this.getBaseRecord().setEnableFieldListeners(false);
try {
Record record = (Record)super.setHandle(bookmark, iHandleType);
if (record == null)
return null;
this.getBaseRecord().setEnableFieldListeners(rgobjEnabledFields);
this.getBaseRecord().handleValidRecord(); // Display Fields
record = this.moveToCurrentRecord(record);
if (record != null) if (record != this.getBaseRecord())
record.handleValidRecord(); // Display Fields
return record;
} catch (DBException ex) {
throw ex;
} finally {
this.getBaseRecord().setEnableFieldListeners(rgobjEnabledFields);
}
} | [
"public",
"FieldList",
"setHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"this",
".",
"setCurrentRecord",
"(",
"this",
".",
"getBaseRecord",
"(",
")",
")",
";",
"Object",
"[",
"]",
"rgobjEnabledFields",
"=",
... | Reposition to this record Using this bookmark.
@exception DBException File exception. | [
"Reposition",
"to",
"this",
"record",
"Using",
"this",
"bookmark",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedBaseRecordTable.java#L254-L276 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/HirshbergMatcher.java | HirshbergMatcher.getLCS | public String getLCS(String strA, String strB) {
if ("".equals(strA)) {
return "";
}
StringBuilder sb = new StringBuilder();
algC(sb, strA.length(), strB.length(), strA, strB);
return sb.toString();
} | java | public String getLCS(String strA, String strB) {
if ("".equals(strA)) {
return "";
}
StringBuilder sb = new StringBuilder();
algC(sb, strA.length(), strB.length(), strA, strB);
return sb.toString();
} | [
"public",
"String",
"getLCS",
"(",
"String",
"strA",
",",
"String",
"strB",
")",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"strA",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"algC",... | Gets the Longest Common Subsequence of two strings, using Dynamic
programming techniques, and minimal memory
@param strA the first String
@param strB the second String
@return the Longest Common Subsequence of strA and strB | [
"Gets",
"the",
"Longest",
"Common",
"Subsequence",
"of",
"two",
"strings",
"using",
"Dynamic",
"programming",
"techniques",
"and",
"minimal",
"memory"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/HirshbergMatcher.java#L137-L145 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java | LongExtensions.operator_lessThan | @Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(long a, double b) {
return a < b;
} | java | @Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(long a, double b) {
return a < b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 < $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"boolean",
"operator_lessThan",
"(",
"long",
"a",
",",
"double",
"b",
")",
"{",
"return",
"a",
"<",
"b",
";",
"}"
] | The binary <code>lessThan</code> operator. This is the equivalent to the Java <code><</code> operator.
@param a a long.
@param b a double.
@return <code>a<b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"lessThan<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"<code",
">",
"<",
";",
"<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java#L320-L324 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.copyRange | protected IOException copyRange(InputStream istream, ServletOutputStream ostream) {
// Copy the input stream to the output stream
IOException exception = null;
byte[] buffer = new byte[m_input];
int len = buffer.length;
while (true) {
try {
len = istream.read(buffer);
if (len == -1) {
break;
}
ostream.write(buffer, 0, len);
} catch (IOException e) {
exception = e;
len = -1;
break;
}
}
return exception;
} | java | protected IOException copyRange(InputStream istream, ServletOutputStream ostream) {
// Copy the input stream to the output stream
IOException exception = null;
byte[] buffer = new byte[m_input];
int len = buffer.length;
while (true) {
try {
len = istream.read(buffer);
if (len == -1) {
break;
}
ostream.write(buffer, 0, len);
} catch (IOException e) {
exception = e;
len = -1;
break;
}
}
return exception;
} | [
"protected",
"IOException",
"copyRange",
"(",
"InputStream",
"istream",
",",
"ServletOutputStream",
"ostream",
")",
"{",
"// Copy the input stream to the output stream",
"IOException",
"exception",
"=",
"null",
";",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",... | Copy the contents of the specified input stream to the specified
output stream, and ensure that both streams are closed before returning
(even in the face of an exception).<p>
@param istream the input stream to read from
@param ostream the output stream to write to
@return the exception which occurred during processing | [
"Copy",
"the",
"contents",
"of",
"the",
"specified",
"input",
"stream",
"to",
"the",
"specified",
"output",
"stream",
"and",
"ensure",
"that",
"both",
"streams",
"are",
"closed",
"before",
"returning",
"(",
"even",
"in",
"the",
"face",
"of",
"an",
"exception... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L808-L828 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.divideAndRound | private static long divideAndRound(long ldividend, long ldivisor, int roundingMode) {
int qsign; // quotient sign
long q = ldividend / ldivisor; // store quotient in long
if (roundingMode == ROUND_DOWN)
return q;
long r = ldividend % ldivisor; // store remainder in long
qsign = ((ldividend < 0) == (ldivisor < 0)) ? 1 : -1;
if (r != 0) {
boolean increment = needIncrement(ldivisor, roundingMode, qsign, q, r);
return increment ? q + qsign : q;
} else {
return q;
}
} | java | private static long divideAndRound(long ldividend, long ldivisor, int roundingMode) {
int qsign; // quotient sign
long q = ldividend / ldivisor; // store quotient in long
if (roundingMode == ROUND_DOWN)
return q;
long r = ldividend % ldivisor; // store remainder in long
qsign = ((ldividend < 0) == (ldivisor < 0)) ? 1 : -1;
if (r != 0) {
boolean increment = needIncrement(ldivisor, roundingMode, qsign, q, r);
return increment ? q + qsign : q;
} else {
return q;
}
} | [
"private",
"static",
"long",
"divideAndRound",
"(",
"long",
"ldividend",
",",
"long",
"ldivisor",
",",
"int",
"roundingMode",
")",
"{",
"int",
"qsign",
";",
"// quotient sign",
"long",
"q",
"=",
"ldividend",
"/",
"ldivisor",
";",
"// store quotient in long",
"if... | Divides {@code long} by {@code long} and do rounding based on the
passed in roundingMode. | [
"Divides",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4128-L4141 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml | public static void escapeHtml(final Reader reader, final Writer writer, final HtmlEscapeType type, final HtmlEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (type == null) {
throw new IllegalArgumentException("The 'type' argument cannot be null");
}
if (level == null) {
throw new IllegalArgumentException("The 'level' argument cannot be null");
}
HtmlEscapeUtil.escape(reader, writer, type, level);
} | java | public static void escapeHtml(final Reader reader, final Writer writer, final HtmlEscapeType type, final HtmlEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (type == null) {
throw new IllegalArgumentException("The 'type' argument cannot be null");
}
if (level == null) {
throw new IllegalArgumentException("The 'level' argument cannot be null");
}
HtmlEscapeUtil.escape(reader, writer, type, level);
} | [
"public",
"static",
"void",
"escapeHtml",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"HtmlEscapeType",
"type",
",",
"final",
"HtmlEscapeLevel",
"level",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null"... | <p>
Perform a (configurable) HTML <strong>escape</strong> operation on a <tt>Reader</tt> input, writing
results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.html.HtmlEscapeType} and {@link org.unbescape.html.HtmlEscapeLevel}
argument values.
</p>
<p>
All other <tt>Reader</tt>/<tt>Writer</tt>-based <tt>escapeHtml*(...)</tt> methods call this one with preconfigured
<tt>type</tt> and <tt>level</tt> values.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>
@param reader the <tt>Reader</tt> reading the text to be escaped.
@param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will
be written at all to this writer if input is <tt>null</tt>.
@param type the type of escape operation to be performed, see {@link org.unbescape.html.HtmlEscapeType}.
@param level the escape level to be applied, see {@link org.unbescape.html.HtmlEscapeLevel}.
@throws IOException if an input/output exception occurs
@since 1.1.2 | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"HTML",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L805-L822 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/JodaBeanSer.java | JodaBeanSer.withNewLine | public JodaBeanSer withNewLine(String newLine) {
JodaBeanUtils.notNull(newLine, "newLine");
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | java | public JodaBeanSer withNewLine(String newLine) {
JodaBeanUtils.notNull(newLine, "newLine");
return new JodaBeanSer(indent, newLine, converter, iteratorFactory, shortTypes, deserializers, includeDerived);
} | [
"public",
"JodaBeanSer",
"withNewLine",
"(",
"String",
"newLine",
")",
"{",
"JodaBeanUtils",
".",
"notNull",
"(",
"newLine",
",",
"\"newLine\"",
")",
";",
"return",
"new",
"JodaBeanSer",
"(",
"indent",
",",
"newLine",
",",
"converter",
",",
"iteratorFactory",
... | Returns a copy of this serializer with the specified pretty print new line.
@param newLine the new line, not null
@return a copy of this object with the new line changed, not null | [
"Returns",
"a",
"copy",
"of",
"this",
"serializer",
"with",
"the",
"specified",
"pretty",
"print",
"new",
"line",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/JodaBeanSer.java#L137-L140 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.handleLoginSuccess | protected void handleLoginSuccess(USER_ENTITY userEntity, LoginSpecifiedOption option) {
assertUserEntityRequired(userEntity);
final USER_BEAN userBean = saveLoginInfoToSession(userEntity);
if (userBean instanceof SyncCheckable) {
((SyncCheckable) userBean).manageLastestSyncCheckTime(timeManager.currentDateTime());
}
if (option.isRememberMe()) {
saveRememberMeKeyToCookie(userEntity, userBean);
}
if (!option.isSilentLogin()) { // mainly here
saveLoginHistory(userEntity, userBean, option);
processOnBrightLogin(userEntity, userBean, option);
} else {
processOnSilentLogin(userEntity, userBean, option);
}
} | java | protected void handleLoginSuccess(USER_ENTITY userEntity, LoginSpecifiedOption option) {
assertUserEntityRequired(userEntity);
final USER_BEAN userBean = saveLoginInfoToSession(userEntity);
if (userBean instanceof SyncCheckable) {
((SyncCheckable) userBean).manageLastestSyncCheckTime(timeManager.currentDateTime());
}
if (option.isRememberMe()) {
saveRememberMeKeyToCookie(userEntity, userBean);
}
if (!option.isSilentLogin()) { // mainly here
saveLoginHistory(userEntity, userBean, option);
processOnBrightLogin(userEntity, userBean, option);
} else {
processOnSilentLogin(userEntity, userBean, option);
}
} | [
"protected",
"void",
"handleLoginSuccess",
"(",
"USER_ENTITY",
"userEntity",
",",
"LoginSpecifiedOption",
"option",
")",
"{",
"assertUserEntityRequired",
"(",
"userEntity",
")",
";",
"final",
"USER_BEAN",
"userBean",
"=",
"saveLoginInfoToSession",
"(",
"userEntity",
")"... | Handle login success for the found login user.
@param userEntity The found entity of the login user. (NotNull)
@param option The option of login specified by caller. (NotNull) | [
"Handle",
"login",
"success",
"for",
"the",
"found",
"login",
"user",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L316-L331 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java | VirtualMachineImagesInner.getAsync | public Observable<VirtualMachineImageInner> getAsync(String location, String publisherName, String offer, String skus, String version) {
return getWithServiceResponseAsync(location, publisherName, offer, skus, version).map(new Func1<ServiceResponse<VirtualMachineImageInner>, VirtualMachineImageInner>() {
@Override
public VirtualMachineImageInner call(ServiceResponse<VirtualMachineImageInner> response) {
return response.body();
}
});
} | java | public Observable<VirtualMachineImageInner> getAsync(String location, String publisherName, String offer, String skus, String version) {
return getWithServiceResponseAsync(location, publisherName, offer, skus, version).map(new Func1<ServiceResponse<VirtualMachineImageInner>, VirtualMachineImageInner>() {
@Override
public VirtualMachineImageInner call(ServiceResponse<VirtualMachineImageInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"VirtualMachineImageInner",
">",
"getAsync",
"(",
"String",
"location",
",",
"String",
"publisherName",
",",
"String",
"offer",
",",
"String",
"skus",
",",
"String",
"version",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"l... | Gets a virtual machine image.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@param offer A valid image publisher offer.
@param skus A valid image SKU.
@param version A valid image SKU version.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualMachineImageInner object | [
"Gets",
"a",
"virtual",
"machine",
"image",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L121-L128 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateZYX | public Matrix4f rotateZYX(Vector3f angles) {
return rotateZYX(angles.z, angles.y, angles.x);
} | java | public Matrix4f rotateZYX(Vector3f angles) {
return rotateZYX(angles.z, angles.y, angles.x);
} | [
"public",
"Matrix4f",
"rotateZYX",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateZYX",
"(",
"angles",
".",
"z",
",",
"angles",
".",
"y",
",",
"angles",
".",
"x",
")",
";",
"}"
] | Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.x</code> radians about the X axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin.
When used with a left-handed coordinate system, the rotation is clockwise.
<p>
If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix,
then the new matrix will be <code>M * R</code>. So when transforming a
vector <code>v</code> with the new matrix by using <code>M * R * v</code>, the
rotation will be applied first!
<p>
This method is equivalent to calling: <code>rotateZ(angles.z).rotateY(angles.y).rotateX(angles.x)</code>
@param angles
the Euler angles
@return this | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"z<",
"/",
"code",
">",
"radians",
"about",
"the",
"Z",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L5469-L5471 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.loadCSV | public static <E extends Exception> DataSet loadCSV(final Class<?> entityClass, final File csvFile, final Collection<String> selectColumnNames,
final long offset, final long count, final Try.Predicate<String[], E> filter) throws UncheckedIOException, E {
InputStream csvInputStream = null;
try {
csvInputStream = new FileInputStream(csvFile);
return loadCSV(entityClass, csvInputStream, selectColumnNames, offset, count, filter);
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
IOUtil.closeQuietly(csvInputStream);
}
} | java | public static <E extends Exception> DataSet loadCSV(final Class<?> entityClass, final File csvFile, final Collection<String> selectColumnNames,
final long offset, final long count, final Try.Predicate<String[], E> filter) throws UncheckedIOException, E {
InputStream csvInputStream = null;
try {
csvInputStream = new FileInputStream(csvFile);
return loadCSV(entityClass, csvInputStream, selectColumnNames, offset, count, filter);
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
IOUtil.closeQuietly(csvInputStream);
}
} | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"DataSet",
"loadCSV",
"(",
"final",
"Class",
"<",
"?",
">",
"entityClass",
",",
"final",
"File",
"csvFile",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"long",
... | Load the data from CSV.
@param entityClass
@param csvFile
@param selectColumnNames
@param offset
@param count
@param filter
@return | [
"Load",
"the",
"data",
"from",
"CSV",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L240-L253 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextMap | public <T> Map<String, T> nextMap(@NonNull Class<T> valueType) throws IOException {
return nextMap(null, valueType);
} | java | public <T> Map<String, T> nextMap(@NonNull Class<T> valueType) throws IOException {
return nextMap(null, valueType);
} | [
"public",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"T",
">",
"nextMap",
"(",
"@",
"NonNull",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"IOException",
"{",
"return",
"nextMap",
"(",
"null",
",",
"valueType",
")",
";",
"}"
] | Reads in the next object as a map with an expected value type
@param <T> the value type parameter
@param valueType the value type class information
@return the map
@throws IOException Something went wrong reading | [
"Reads",
"in",
"the",
"next",
"object",
"as",
"a",
"map",
"with",
"an",
"expected",
"value",
"type"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L536-L538 |
alkacon/opencms-core | src/org/opencms/file/types/CmsResourceTypeXmlContent.java | CmsResourceTypeXmlContent.getXsdLink | protected CmsLink getXsdLink(CmsObject cms, CmsXmlContent xmlContent) {
String schema = xmlContent.getContentDefinition().getSchemaLocation();
if (schema.startsWith(CmsXmlEntityResolver.OPENCMS_SCHEME)) {
if (CmsXmlEntityResolver.isInternalId(schema)) {
return null;
}
schema = schema.substring(CmsXmlEntityResolver.OPENCMS_SCHEME.length() - 1);
} else if (CmsXmlEntityResolver.isCachedSystemId(schema)) {
// schema may not exist as a VFS file because it has just been cached (some test cases do this)
return null;
}
try {
CmsResource schemaRes = cms.readResource(cms.getRequestContext().removeSiteRoot(schema));
CmsLink xsdLink = new CmsLink(
null,
CmsRelationType.XSD,
schemaRes.getStructureId(),
schemaRes.getRootPath(),
true);
return xsdLink;
} catch (CmsException e) {
LOG.error(e.getLocalizedMessage(), e);
}
return null;
} | java | protected CmsLink getXsdLink(CmsObject cms, CmsXmlContent xmlContent) {
String schema = xmlContent.getContentDefinition().getSchemaLocation();
if (schema.startsWith(CmsXmlEntityResolver.OPENCMS_SCHEME)) {
if (CmsXmlEntityResolver.isInternalId(schema)) {
return null;
}
schema = schema.substring(CmsXmlEntityResolver.OPENCMS_SCHEME.length() - 1);
} else if (CmsXmlEntityResolver.isCachedSystemId(schema)) {
// schema may not exist as a VFS file because it has just been cached (some test cases do this)
return null;
}
try {
CmsResource schemaRes = cms.readResource(cms.getRequestContext().removeSiteRoot(schema));
CmsLink xsdLink = new CmsLink(
null,
CmsRelationType.XSD,
schemaRes.getStructureId(),
schemaRes.getRootPath(),
true);
return xsdLink;
} catch (CmsException e) {
LOG.error(e.getLocalizedMessage(), e);
}
return null;
} | [
"protected",
"CmsLink",
"getXsdLink",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContent",
"xmlContent",
")",
"{",
"String",
"schema",
"=",
"xmlContent",
".",
"getContentDefinition",
"(",
")",
".",
"getSchemaLocation",
"(",
")",
";",
"if",
"(",
"schema",
".",
"start... | Creates a new link object for the schema definition.<p>
@param cms the current CMS context
@param xmlContent the xml content to crete the link for
@return the generated link | [
"Creates",
"a",
"new",
"link",
"object",
"for",
"the",
"schema",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/types/CmsResourceTypeXmlContent.java#L597-L622 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/components/Cashflow.java | Cashflow.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
// Note: We use > here. To distinguish an end of day valuation use hour of day for cash flows and evaluation date.
if(evaluationTime > flowDate) {
return model.getRandomVariableForConstant(0.0);
}
RandomVariable values = model.getRandomVariableForConstant(flowAmount);
if(isPayer) {
values = values.mult(-1.0);
}
// Rebase to evaluationTime
if(flowDate != evaluationTime) {
// Get random variables
RandomVariable numeraire = model.getNumeraire(flowDate);
RandomVariable numeraireAtEval = model.getNumeraire(evaluationTime);
// RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(getPaymentDate());
values = values.div(numeraire).mult(numeraireAtEval);
}
// Return values
return values;
} | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
// Note: We use > here. To distinguish an end of day valuation use hour of day for cash flows and evaluation date.
if(evaluationTime > flowDate) {
return model.getRandomVariableForConstant(0.0);
}
RandomVariable values = model.getRandomVariableForConstant(flowAmount);
if(isPayer) {
values = values.mult(-1.0);
}
// Rebase to evaluationTime
if(flowDate != evaluationTime) {
// Get random variables
RandomVariable numeraire = model.getNumeraire(flowDate);
RandomVariable numeraireAtEval = model.getNumeraire(evaluationTime);
// RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(getPaymentDate());
values = values.div(numeraire).mult(numeraireAtEval);
}
// Return values
return values;
} | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"// Note: We use > here. To distinguish an end of day valuation use hour of day for cash flows and ... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
cash-flows prior evaluationTime are not considered.
@param evaluationTime The time on which this products value should be observed.
@param model The model used to price the product.
@return The random variable representing the value of the product discounted to evaluation time
@throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the <code>cause()</code> method. | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/components/Cashflow.java#L67-L91 |
ZuInnoTe/hadoopoffice | hiveserde/src/main/java/org/zuinnote/hadoop/excel/hive/daoserde/ExcelSpreadSheetCellDAOSerde.java | ExcelSpreadSheetCellDAOSerde.serialize | @Override
public Writable serialize(Object arg0, ObjectInspector arg1) throws SerDeException {
if (!(arg1 instanceof StructObjectInspector)) {
throw new SerDeException("Expect a row of Strings for serialization");
}
final StructObjectInspector outputOI = (StructObjectInspector) arg1;
final List<? extends StructField> outputFields = outputOI.getAllStructFieldRefs();
if (outputFields.size()!=ExcelSpreadSheetCellDAOSerde.columnNames.length) {
throw new SerDeException("Expected "+ExcelSpreadSheetCellDAOSerde.columnNames.length+" fields characterizing a cell: \"formattedValue\",\"comment\",\"formula\",\"address\",\"sheetName\", but found "+outputFields.size()+" fields");
}
if (arg0==null) {
return null;
}
// get field data
// formattedValue
int columnNum=0;
final Object foFormattedValue = outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiFormattedValue = outputFields.get(columnNum).getFieldObjectInspector();
String formattedValue = String.valueOf(((PrimitiveObjectInspector) oiFormattedValue).getPrimitiveJavaObject(foFormattedValue));
// comment
columnNum=1;
final Object foComment= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiComment = outputFields.get(columnNum).getFieldObjectInspector();
String comment = String.valueOf(((PrimitiveObjectInspector) oiComment).getPrimitiveJavaObject(foComment));
// formula
columnNum=2;
final Object foFormula= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiFormula = outputFields.get(columnNum).getFieldObjectInspector();
String formula = String.valueOf(((PrimitiveObjectInspector) oiFormula).getPrimitiveJavaObject(foFormula));
// address
columnNum=3;
final Object foAddress= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiAddress = outputFields.get(columnNum).getFieldObjectInspector();
String address = String.valueOf(((PrimitiveObjectInspector) oiAddress).getPrimitiveJavaObject(foAddress));
// sheetName
columnNum=4;
final Object foSheetName= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiSheetName = outputFields.get(columnNum).getFieldObjectInspector();
String sheetName = String.valueOf(((PrimitiveObjectInspector) oiSheetName).getPrimitiveJavaObject(foSheetName));
return new SpreadSheetCellDAO(formattedValue,comment,formula,address,sheetName);
} | java | @Override
public Writable serialize(Object arg0, ObjectInspector arg1) throws SerDeException {
if (!(arg1 instanceof StructObjectInspector)) {
throw new SerDeException("Expect a row of Strings for serialization");
}
final StructObjectInspector outputOI = (StructObjectInspector) arg1;
final List<? extends StructField> outputFields = outputOI.getAllStructFieldRefs();
if (outputFields.size()!=ExcelSpreadSheetCellDAOSerde.columnNames.length) {
throw new SerDeException("Expected "+ExcelSpreadSheetCellDAOSerde.columnNames.length+" fields characterizing a cell: \"formattedValue\",\"comment\",\"formula\",\"address\",\"sheetName\", but found "+outputFields.size()+" fields");
}
if (arg0==null) {
return null;
}
// get field data
// formattedValue
int columnNum=0;
final Object foFormattedValue = outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiFormattedValue = outputFields.get(columnNum).getFieldObjectInspector();
String formattedValue = String.valueOf(((PrimitiveObjectInspector) oiFormattedValue).getPrimitiveJavaObject(foFormattedValue));
// comment
columnNum=1;
final Object foComment= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiComment = outputFields.get(columnNum).getFieldObjectInspector();
String comment = String.valueOf(((PrimitiveObjectInspector) oiComment).getPrimitiveJavaObject(foComment));
// formula
columnNum=2;
final Object foFormula= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiFormula = outputFields.get(columnNum).getFieldObjectInspector();
String formula = String.valueOf(((PrimitiveObjectInspector) oiFormula).getPrimitiveJavaObject(foFormula));
// address
columnNum=3;
final Object foAddress= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiAddress = outputFields.get(columnNum).getFieldObjectInspector();
String address = String.valueOf(((PrimitiveObjectInspector) oiAddress).getPrimitiveJavaObject(foAddress));
// sheetName
columnNum=4;
final Object foSheetName= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
final ObjectInspector oiSheetName = outputFields.get(columnNum).getFieldObjectInspector();
String sheetName = String.valueOf(((PrimitiveObjectInspector) oiSheetName).getPrimitiveJavaObject(foSheetName));
return new SpreadSheetCellDAO(formattedValue,comment,formula,address,sheetName);
} | [
"@",
"Override",
"public",
"Writable",
"serialize",
"(",
"Object",
"arg0",
",",
"ObjectInspector",
"arg1",
")",
"throws",
"SerDeException",
"{",
"if",
"(",
"!",
"(",
"arg1",
"instanceof",
"StructObjectInspector",
")",
")",
"{",
"throw",
"new",
"SerDeException",
... | Writes a row in Hive containing exactly 5 elements (String) to a SpreadSheetCellDAO. Order: "formattedValue","comment","formula","address","sheetName" | [
"Writes",
"a",
"row",
"in",
"Hive",
"containing",
"exactly",
"5",
"elements",
"(",
"String",
")",
"to",
"a",
"SpreadSheetCellDAO",
".",
"Order",
":",
"formattedValue",
"comment",
"formula",
"address",
"sheetName"
] | train | https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/hiveserde/src/main/java/org/zuinnote/hadoop/excel/hive/daoserde/ExcelSpreadSheetCellDAOSerde.java#L111-L151 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.intersectRayAab | public static boolean intersectRayAab(Rayd ray, AABBd aabb, Vector2d result) {
return intersectRayAab(ray.oX, ray.oY, ray.oZ, ray.dX, ray.dY, ray.dZ, aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ, result);
} | java | public static boolean intersectRayAab(Rayd ray, AABBd aabb, Vector2d result) {
return intersectRayAab(ray.oX, ray.oY, ray.oZ, ray.dX, ray.dY, ray.dZ, aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ, result);
} | [
"public",
"static",
"boolean",
"intersectRayAab",
"(",
"Rayd",
"ray",
",",
"AABBd",
"aabb",
",",
"Vector2d",
"result",
")",
"{",
"return",
"intersectRayAab",
"(",
"ray",
".",
"oX",
",",
"ray",
".",
"oY",
",",
"ray",
".",
"oZ",
",",
"ray",
".",
"dX",
... | Test whether the given ray intersects given the axis-aligned box
and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and far point of intersection..
<p>
This method returns <code>true</code> for a ray whose origin lies inside the axis-aligned box.
<p>
If many boxes need to be tested against the same ray, then the {@link RayAabIntersection} class is likely more efficient.
<p>
Reference: <a href="https://dl.acm.org/citation.cfm?id=1198748">An Efficient and Robust Ray–Box Intersection</a>
@see #intersectRayAab(double, double, double, double, double, double, double, double, double, double, double, double, Vector2d)
@see RayAabIntersection
@param ray
the ray
@param aabb
the AABB
@param result
a vector which will hold the resulting values of the parameter
<i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and far point of intersection
iff the ray intersects the axis-aligned box
@return <code>true</code> if the given ray intersects the axis-aligned box; <code>false</code> otherwise | [
"Test",
"whether",
"the",
"given",
"ray",
"intersects",
"given",
"the",
"axis",
"-",
"aligned",
"box",
"and",
"return",
"the",
"values",
"of",
"the",
"parameter",
"<i",
">",
"t<",
"/",
"i",
">",
"in",
"the",
"ray",
"equation",
"<i",
">",
"p",
"(",
"t... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L2438-L2440 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbooksInner.java | RunbooksInner.updateAsync | public Observable<RunbookInner> updateAsync(String resourceGroupName, String automationAccountName, String runbookName, RunbookUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, parameters).map(new Func1<ServiceResponse<RunbookInner>, RunbookInner>() {
@Override
public RunbookInner call(ServiceResponse<RunbookInner> response) {
return response.body();
}
});
} | java | public Observable<RunbookInner> updateAsync(String resourceGroupName, String automationAccountName, String runbookName, RunbookUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, parameters).map(new Func1<ServiceResponse<RunbookInner>, RunbookInner>() {
@Override
public RunbookInner call(ServiceResponse<RunbookInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"RunbookInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"runbookName",
",",
"RunbookUpdateParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"... | Update the runbook identified by runbook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The runbook name.
@param parameters The update parameters for runbook.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RunbookInner object | [
"Update",
"the",
"runbook",
"identified",
"by",
"runbook",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbooksInner.java#L422-L429 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java | DBService.getRows | public Iterable<DRow> getRows(String storeName, Collection<String> rowKeys) {
List<DRow> rows = new ArrayList<>(rowKeys.size());
for(String rowKey: rowKeys) {
rows.add(new DRow(m_tenant, storeName, rowKey));
}
return rows;
} | java | public Iterable<DRow> getRows(String storeName, Collection<String> rowKeys) {
List<DRow> rows = new ArrayList<>(rowKeys.size());
for(String rowKey: rowKeys) {
rows.add(new DRow(m_tenant, storeName, rowKey));
}
return rows;
} | [
"public",
"Iterable",
"<",
"DRow",
">",
"getRows",
"(",
"String",
"storeName",
",",
"Collection",
"<",
"String",
">",
"rowKeys",
")",
"{",
"List",
"<",
"DRow",
">",
"rows",
"=",
"new",
"ArrayList",
"<>",
"(",
"rowKeys",
".",
"size",
"(",
")",
")",
";... | Get iterator for rows with a specific set of keys. Results are returned as an
Iterator of {@link DRow} objects. If any given row is not found, no entry
with its key will be returned.
@param storeName Name of store to query.
@param rowKeys Collection of row keys to read.
@return Iterator of {@link DRow} objects. May be empty but not null. | [
"Get",
"iterator",
"for",
"rows",
"with",
"a",
"specific",
"set",
"of",
"keys",
".",
"Results",
"are",
"returned",
"as",
"an",
"Iterator",
"of",
"{",
"@link",
"DRow",
"}",
"objects",
".",
"If",
"any",
"given",
"row",
"is",
"not",
"found",
"no",
"entry"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java#L324-L330 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.intersects | private boolean intersects(Point point, int fudge, QuadCurve2D.Float c) {
if (!c.intersects(point.x - fudge, point.y - fudge, fudge << 1,
fudge << 1))
return false;
if (c.getFlatness() < fudge)
return true;
QuadCurve2D.Float f1 = new QuadCurve2D.Float(), f2 = new QuadCurve2D.Float();
c.subdivide(f1, f2);
return intersects(point, fudge, f1) || intersects(point, fudge, f2);
} | java | private boolean intersects(Point point, int fudge, QuadCurve2D.Float c) {
if (!c.intersects(point.x - fudge, point.y - fudge, fudge << 1,
fudge << 1))
return false;
if (c.getFlatness() < fudge)
return true;
QuadCurve2D.Float f1 = new QuadCurve2D.Float(), f2 = new QuadCurve2D.Float();
c.subdivide(f1, f2);
return intersects(point, fudge, f1) || intersects(point, fudge, f2);
} | [
"private",
"boolean",
"intersects",
"(",
"Point",
"point",
",",
"int",
"fudge",
",",
"QuadCurve2D",
".",
"Float",
"c",
")",
"{",
"if",
"(",
"!",
"c",
".",
"intersects",
"(",
"point",
".",
"x",
"-",
"fudge",
",",
"point",
".",
"y",
"-",
"fudge",
","... | Checks if something is on the line. If it appears to be, then it
subdivides the curve into halves and tries again recursively until the
flatness of the curve is less than the fudge. Frankly, I am a fucking
genius. I am one of two people in this department that could have
possibly thought of this.
@param point
the point to check intersection
@param fudge
the "fudge" factor
@param c
the curve we're checking for intersection with
@return <TT>true</TT> if the point is on the curve within a certain
fudge factor, <TT>false</TT> otherwise | [
"Checks",
"if",
"something",
"is",
"on",
"the",
"line",
".",
"If",
"it",
"appears",
"to",
"be",
"then",
"it",
"subdivides",
"the",
"curve",
"into",
"halves",
"and",
"tries",
"again",
"recursively",
"until",
"the",
"flatness",
"of",
"the",
"curve",
"is",
... | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L363-L372 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java | DelegatedClientAuthenticationAction.restoreAuthenticationRequestInContext | protected Service restoreAuthenticationRequestInContext(final RequestContext requestContext,
final J2EContext webContext,
final String clientName) {
val logoutEndpoint = isLogoutRequest(webContext.getRequest());
if (logoutEndpoint) {
return null;
} else {
try {
val client = (BaseClient<Credentials, CommonProfile>) this.clients.findClient(clientName);
return delegatedClientWebflowManager.retrieve(requestContext, webContext, client);
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
}
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, "Service unauthorized");
}
} | java | protected Service restoreAuthenticationRequestInContext(final RequestContext requestContext,
final J2EContext webContext,
final String clientName) {
val logoutEndpoint = isLogoutRequest(webContext.getRequest());
if (logoutEndpoint) {
return null;
} else {
try {
val client = (BaseClient<Credentials, CommonProfile>) this.clients.findClient(clientName);
return delegatedClientWebflowManager.retrieve(requestContext, webContext, client);
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
}
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, "Service unauthorized");
}
} | [
"protected",
"Service",
"restoreAuthenticationRequestInContext",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"J2EContext",
"webContext",
",",
"final",
"String",
"clientName",
")",
"{",
"val",
"logoutEndpoint",
"=",
"isLogoutRequest",
"(",
"webContext",... | Restore authentication request in context service (return null for a logout call).
@param requestContext the request context
@param webContext the web context
@param clientName the client name
@return the service | [
"Restore",
"authentication",
"request",
"in",
"context",
"service",
"(",
"return",
"null",
"for",
"a",
"logout",
"call",
")",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java#L456-L471 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/interceptor/LoggingClientInterceptor.java | LoggingClientInterceptor.appendHeaders | private void appendHeaders(HttpHeaders headers, StringBuilder builder) {
for (Entry<String, List<String>> headerEntry : headers.entrySet()) {
builder.append(headerEntry.getKey());
builder.append(":");
builder.append(StringUtils.arrayToCommaDelimitedString(headerEntry.getValue().toArray()));
builder.append(NEWLINE);
}
} | java | private void appendHeaders(HttpHeaders headers, StringBuilder builder) {
for (Entry<String, List<String>> headerEntry : headers.entrySet()) {
builder.append(headerEntry.getKey());
builder.append(":");
builder.append(StringUtils.arrayToCommaDelimitedString(headerEntry.getValue().toArray()));
builder.append(NEWLINE);
}
} | [
"private",
"void",
"appendHeaders",
"(",
"HttpHeaders",
"headers",
",",
"StringBuilder",
"builder",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headerEntry",
":",
"headers",
".",
"entrySet",
"(",
")",
")",
"{",
"b... | Append Http headers to string builder.
@param headers
@param builder | [
"Append",
"Http",
"headers",
"to",
"string",
"builder",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/interceptor/LoggingClientInterceptor.java#L147-L154 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.getInstanceViewAsync | public Observable<VirtualMachineScaleSetInstanceViewInner> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) {
return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<VirtualMachineScaleSetInstanceViewInner>, VirtualMachineScaleSetInstanceViewInner>() {
@Override
public VirtualMachineScaleSetInstanceViewInner call(ServiceResponse<VirtualMachineScaleSetInstanceViewInner> response) {
return response.body();
}
});
} | java | public Observable<VirtualMachineScaleSetInstanceViewInner> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) {
return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<VirtualMachineScaleSetInstanceViewInner>, VirtualMachineScaleSetInstanceViewInner>() {
@Override
public VirtualMachineScaleSetInstanceViewInner call(ServiceResponse<VirtualMachineScaleSetInstanceViewInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetInstanceViewInner",
">",
"getInstanceViewAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"getInstanceViewWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetNam... | Gets the status of a VM scale set instance.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualMachineScaleSetInstanceViewInner object | [
"Gets",
"the",
"status",
"of",
"a",
"VM",
"scale",
"set",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1320-L1327 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/data/AbstractDirtyMarker.java | AbstractDirtyMarker.setDirty | public static void setDirty(DirtyMarker aDirtyMarker, Object aObject1, Object aObject2)
{
if(aDirtyMarker == null)
return;
if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true);
} | java | public static void setDirty(DirtyMarker aDirtyMarker, Object aObject1, Object aObject2)
{
if(aDirtyMarker == null)
return;
if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true);
} | [
"public",
"static",
"void",
"setDirty",
"(",
"DirtyMarker",
"aDirtyMarker",
",",
"Object",
"aObject1",
",",
"Object",
"aObject2",
")",
"{",
"if",
"(",
"aDirtyMarker",
"==",
"null",
")",
"return",
";",
"if",
"(",
"aObject1",
"==",
"null",
"||",
"!",
"aObjec... | if(aObject1 == null || !aObject1.equals(aObject2))
aDirtyMarker.setDirty(true)
@param aDirtyMarker
@param aObject1
@param aObject2 | [
"if",
"(",
"aObject1",
"==",
"null",
"||",
"!aObject1",
".",
"equals",
"(",
"aObject2",
"))",
"aDirtyMarker",
".",
"setDirty",
"(",
"true",
")"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/data/AbstractDirtyMarker.java#L53-L61 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.outputColorNumbers | void outputColorNumbers(Color color, float tint) {
PdfXConformanceImp.checkPDFXConformance(writer, PdfXConformanceImp.PDFXKEY_COLOR, color);
int type = ExtendedColor.getType(color);
switch (type) {
case ExtendedColor.TYPE_RGB:
content.append((float)(color.getRed()) / 0xFF);
content.append(' ');
content.append((float)(color.getGreen()) / 0xFF);
content.append(' ');
content.append((float)(color.getBlue()) / 0xFF);
break;
case ExtendedColor.TYPE_GRAY:
content.append(((GrayColor)color).getGray());
break;
case ExtendedColor.TYPE_CMYK: {
CMYKColor cmyk = (CMYKColor)color;
content.append(cmyk.getCyan()).append(' ').append(cmyk.getMagenta());
content.append(' ').append(cmyk.getYellow()).append(' ').append(cmyk.getBlack());
break;
}
case ExtendedColor.TYPE_SEPARATION:
content.append(tint);
break;
default:
throw new RuntimeException("Invalid color type.");
}
} | java | void outputColorNumbers(Color color, float tint) {
PdfXConformanceImp.checkPDFXConformance(writer, PdfXConformanceImp.PDFXKEY_COLOR, color);
int type = ExtendedColor.getType(color);
switch (type) {
case ExtendedColor.TYPE_RGB:
content.append((float)(color.getRed()) / 0xFF);
content.append(' ');
content.append((float)(color.getGreen()) / 0xFF);
content.append(' ');
content.append((float)(color.getBlue()) / 0xFF);
break;
case ExtendedColor.TYPE_GRAY:
content.append(((GrayColor)color).getGray());
break;
case ExtendedColor.TYPE_CMYK: {
CMYKColor cmyk = (CMYKColor)color;
content.append(cmyk.getCyan()).append(' ').append(cmyk.getMagenta());
content.append(' ').append(cmyk.getYellow()).append(' ').append(cmyk.getBlack());
break;
}
case ExtendedColor.TYPE_SEPARATION:
content.append(tint);
break;
default:
throw new RuntimeException("Invalid color type.");
}
} | [
"void",
"outputColorNumbers",
"(",
"Color",
"color",
",",
"float",
"tint",
")",
"{",
"PdfXConformanceImp",
".",
"checkPDFXConformance",
"(",
"writer",
",",
"PdfXConformanceImp",
".",
"PDFXKEY_COLOR",
",",
"color",
")",
";",
"int",
"type",
"=",
"ExtendedColor",
"... | Outputs the color values to the content.
@param color The color
@param tint the tint if it is a spot color, ignored otherwise | [
"Outputs",
"the",
"color",
"values",
"to",
"the",
"content",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2311-L2337 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.dropWhile | public static <U> Stream<U> dropWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
return StreamSupport.stream(new SkipWhileSpliterator<U>(stream.spliterator(),predicate), stream.isParallel());
} | java | public static <U> Stream<U> dropWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
return StreamSupport.stream(new SkipWhileSpliterator<U>(stream.spliterator(),predicate), stream.isParallel());
} | [
"public",
"static",
"<",
"U",
">",
"Stream",
"<",
"U",
">",
"dropWhile",
"(",
"final",
"Stream",
"<",
"U",
">",
"stream",
",",
"final",
"Predicate",
"<",
"?",
"super",
"U",
">",
"predicate",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"n... | skip elements in a Stream while Predicate holds true
<pre>
{@code Streams.dropWhile(Stream.of(4,3,6,7).sorted(),i->i<6).collect(CyclopsCollectors.toList())
// [6,7]
}</pre>
@param stream
@param predicate
@return | [
"skip",
"elements",
"in",
"a",
"Stream",
"while",
"Predicate",
"holds",
"true"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L1192-L1194 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.notIn | public QueryExpression notIn(String propertyName,String... values)
{
return new MultiValueQueryExpression(propertyName, ComparisonOperator.NOT_IN,wrap(values));
} | java | public QueryExpression notIn(String propertyName,String... values)
{
return new MultiValueQueryExpression(propertyName, ComparisonOperator.NOT_IN,wrap(values));
} | [
"public",
"QueryExpression",
"notIn",
"(",
"String",
"propertyName",
",",
"String",
"...",
"values",
")",
"{",
"return",
"new",
"MultiValueQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"NOT_IN",
",",
"wrap",
"(",
"values",
")",
")",
";",... | Create a not in expression
@param propertyName The propery name
@param values The values
@return The query expression | [
"Create",
"a",
"not",
"in",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L434-L437 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java | AbstractInvocationFuture.warnIfSuspiciousDoubleCompletion | private void warnIfSuspiciousDoubleCompletion(Object s0, Object s1) {
if (s0 != s1 && !(s0 instanceof CancellationException) && !(s1 instanceof CancellationException)) {
logger.warning(String.format("Future.complete(Object) on completed future. "
+ "Request: %s, current value: %s, offered value: %s",
invocationToString(), s0, s1));
}
} | java | private void warnIfSuspiciousDoubleCompletion(Object s0, Object s1) {
if (s0 != s1 && !(s0 instanceof CancellationException) && !(s1 instanceof CancellationException)) {
logger.warning(String.format("Future.complete(Object) on completed future. "
+ "Request: %s, current value: %s, offered value: %s",
invocationToString(), s0, s1));
}
} | [
"private",
"void",
"warnIfSuspiciousDoubleCompletion",
"(",
"Object",
"s0",
",",
"Object",
"s1",
")",
"{",
"if",
"(",
"s0",
"!=",
"s1",
"&&",
"!",
"(",
"s0",
"instanceof",
"CancellationException",
")",
"&&",
"!",
"(",
"s1",
"instanceof",
"CancellationException... | received a response, but before it cleans up itself, it receives a HazelcastInstanceNotActiveException | [
"received",
"a",
"response",
"but",
"before",
"it",
"cleans",
"up",
"itself",
"it",
"receives",
"a",
"HazelcastInstanceNotActiveException"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/AbstractInvocationFuture.java#L388-L394 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/Word2VecModel.java | Word2VecModel.fromBinFile | public static Word2VecModel fromBinFile(File file)
throws IOException {
return fromBinFile(file, ByteOrder.LITTLE_ENDIAN, ProfilingTimer.NONE);
} | java | public static Word2VecModel fromBinFile(File file)
throws IOException {
return fromBinFile(file, ByteOrder.LITTLE_ENDIAN, ProfilingTimer.NONE);
} | [
"public",
"static",
"Word2VecModel",
"fromBinFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"fromBinFile",
"(",
"file",
",",
"ByteOrder",
".",
"LITTLE_ENDIAN",
",",
"ProfilingTimer",
".",
"NONE",
")",
";",
"}"
] | Forwards to {@link #fromBinFile(File, ByteOrder, ProfilingTimer)} with the default
ByteOrder.LITTLE_ENDIAN and no ProfilingTimer | [
"Forwards",
"to",
"{"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/Word2VecModel.java#L108-L111 |
apache/groovy | src/main/groovy/groovy/lang/ExpandoMetaClass.java | ExpandoMetaClass.getProperty | public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass) {
if (hasOverrideGetProperty(name) && getJavaClass().isInstance(object)) {
return getPropertyMethod.invoke(object, new Object[]{name});
}
if ("mixedIn".equals(name)) {
return new MixedInAccessor(object, mixinClasses);
}
return super.getProperty(sender, object, name, useSuper, fromInsideClass);
} | java | public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass) {
if (hasOverrideGetProperty(name) && getJavaClass().isInstance(object)) {
return getPropertyMethod.invoke(object, new Object[]{name});
}
if ("mixedIn".equals(name)) {
return new MixedInAccessor(object, mixinClasses);
}
return super.getProperty(sender, object, name, useSuper, fromInsideClass);
} | [
"public",
"Object",
"getProperty",
"(",
"Class",
"sender",
",",
"Object",
"object",
",",
"String",
"name",
",",
"boolean",
"useSuper",
",",
"boolean",
"fromInsideClass",
")",
"{",
"if",
"(",
"hasOverrideGetProperty",
"(",
"name",
")",
"&&",
"getJavaClass",
"("... | Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass
@see MetaClassImpl#getProperty(Class, Object, String, boolean, boolean) | [
"Overrides",
"default",
"implementation",
"just",
"in",
"case",
"getProperty",
"method",
"has",
"been",
"overridden",
"by",
"ExpandoMetaClass"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ExpandoMetaClass.java#L1146-L1156 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/SpatialUtil.java | SpatialUtil.unionTolerant | public static ModifiableHyperBoundingBox unionTolerant(SpatialComparable mbr1, SpatialComparable mbr2) {
if(mbr1 == null && mbr2 == null) {
return null;
}
if(mbr1 == null) {
// Clone - intentionally
return new ModifiableHyperBoundingBox(mbr2);
}
if(mbr2 == null) {
// Clone - intentionally
return new ModifiableHyperBoundingBox(mbr1);
}
return union(mbr1, mbr2);
} | java | public static ModifiableHyperBoundingBox unionTolerant(SpatialComparable mbr1, SpatialComparable mbr2) {
if(mbr1 == null && mbr2 == null) {
return null;
}
if(mbr1 == null) {
// Clone - intentionally
return new ModifiableHyperBoundingBox(mbr2);
}
if(mbr2 == null) {
// Clone - intentionally
return new ModifiableHyperBoundingBox(mbr1);
}
return union(mbr1, mbr2);
} | [
"public",
"static",
"ModifiableHyperBoundingBox",
"unionTolerant",
"(",
"SpatialComparable",
"mbr1",
",",
"SpatialComparable",
"mbr2",
")",
"{",
"if",
"(",
"mbr1",
"==",
"null",
"&&",
"mbr2",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"mb... | Returns the union of the two specified MBRs. Tolerant of "null" values.
@param mbr1 the first MBR
@param mbr2 the second MBR
@return the union of the two specified MBRs | [
"Returns",
"the",
"union",
"of",
"the",
"two",
"specified",
"MBRs",
".",
"Tolerant",
"of",
"null",
"values",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/SpatialUtil.java#L395-L408 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java | CaptchaPanel.newImage | protected Image newImage(final String id, final IResource imageResource)
{
return ComponentFactory.newImage(id, imageResource);
} | java | protected Image newImage(final String id, final IResource imageResource)
{
return ComponentFactory.newImage(id, imageResource);
} | [
"protected",
"Image",
"newImage",
"(",
"final",
"String",
"id",
",",
"final",
"IResource",
"imageResource",
")",
"{",
"return",
"ComponentFactory",
".",
"newImage",
"(",
"id",
",",
"imageResource",
")",
";",
"}"
] | Factory method for creating a new {@link Image}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
Button.
@param id
the wicket id
@param imageResource
the image resource.
@return the new {@link Image} | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Image",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"the... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java#L92-L95 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java | DateTimePatternGenerator.replaceFieldTypes | public String replaceFieldTypes(String pattern, String skeleton) {
return replaceFieldTypes(pattern, skeleton, MATCH_NO_OPTIONS);
} | java | public String replaceFieldTypes(String pattern, String skeleton) {
return replaceFieldTypes(pattern, skeleton, MATCH_NO_OPTIONS);
} | [
"public",
"String",
"replaceFieldTypes",
"(",
"String",
"pattern",
",",
"String",
"skeleton",
")",
"{",
"return",
"replaceFieldTypes",
"(",
"pattern",
",",
"skeleton",
",",
"MATCH_NO_OPTIONS",
")",
";",
"}"
] | Adjusts the field types (width and subtype) of a pattern to match what is
in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
"dd-MMMM hh:mm". This is used internally to get the best match for the
input skeleton, but can also be used externally.
<p>Example code:{@sample external/icu/android_icu4j/src/samples/java/android/icu/samples/text/datetimepatterngenerator/DateTimePatternGeneratorSample.java replaceFieldTypesExample}
@param pattern input pattern
@param skeleton For the pattern to match to.
@return pattern adjusted to match the skeleton fields widths and subtypes. | [
"Adjusts",
"the",
"field",
"types",
"(",
"width",
"and",
"subtype",
")",
"of",
"a",
"pattern",
"to",
"match",
"what",
"is",
"in",
"a",
"skeleton",
".",
"That",
"is",
"if",
"you",
"supply",
"a",
"pattern",
"like",
"d",
"-",
"M",
"H",
":",
"m",
"and"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java#L824-L826 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.toFilterPath | public static IPath toFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
IPath commonPath;
if (project != null) {
commonPath = project.getLocation();
IPath relativePath = getRelativePath(path, commonPath);
if (!relativePath.equals(path)) {
return relativePath;
}
}
commonPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
return getRelativePath(path, commonPath);
} | java | public static IPath toFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
IPath commonPath;
if (project != null) {
commonPath = project.getLocation();
IPath relativePath = getRelativePath(path, commonPath);
if (!relativePath.equals(path)) {
return relativePath;
}
}
commonPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
return getRelativePath(path, commonPath);
} | [
"public",
"static",
"IPath",
"toFilterPath",
"(",
"String",
"filePath",
",",
"IProject",
"project",
")",
"{",
"IPath",
"path",
"=",
"new",
"Path",
"(",
"filePath",
")",
";",
"IPath",
"commonPath",
";",
"if",
"(",
"project",
"!=",
"null",
")",
"{",
"commo... | Checks the given absolute path and convert it to relative path if it is
relative to the given project or workspace. This representation can be
used to store filter paths in user preferences file
@param filePath
absolute OS file path
@param project
might be null
@return filter file path as stored in preferences which matches given
path | [
"Checks",
"the",
"given",
"absolute",
"path",
"and",
"convert",
"it",
"to",
"relative",
"path",
"if",
"it",
"is",
"relative",
"to",
"the",
"given",
"project",
"or",
"workspace",
".",
"This",
"representation",
"can",
"be",
"used",
"to",
"store",
"filter",
"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L441-L453 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.streamAll | @SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
checkJdbcSettingsForAllQuery(jdbcSettings);
if (jdbcSettings == null || N.isNullOrEmpty(jdbcSettings.getQueryWithDataSources())) {
return stream(sql, statementSetter, recordGetter, jdbcSettings, parameters);
}
final Collection<String> dss = jdbcSettings.getQueryWithDataSources();
return Stream.of(dss).map(new Function<String, JdbcSettings>() {
@Override
public JdbcSettings apply(String ds) {
return jdbcSettings.copy().setQueryWithDataSources(null).setQueryWithDataSource(ds);
}
}).__(new Function<Stream<JdbcSettings>, Stream<JdbcSettings>>() {
@Override
public Stream<JdbcSettings> apply(Stream<JdbcSettings> s) {
return jdbcSettings.isQueryInParallel() ? s.parallel(dss.size()) : s;
}
}).flatMap(new Function<JdbcSettings, Stream<T>>() {
@Override
public Stream<T> apply(JdbcSettings newJdbcSettings) {
return stream(sql, statementSetter, recordGetter, newJdbcSettings, parameters);
}
});
} | java | @SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
checkJdbcSettingsForAllQuery(jdbcSettings);
if (jdbcSettings == null || N.isNullOrEmpty(jdbcSettings.getQueryWithDataSources())) {
return stream(sql, statementSetter, recordGetter, jdbcSettings, parameters);
}
final Collection<String> dss = jdbcSettings.getQueryWithDataSources();
return Stream.of(dss).map(new Function<String, JdbcSettings>() {
@Override
public JdbcSettings apply(String ds) {
return jdbcSettings.copy().setQueryWithDataSources(null).setQueryWithDataSource(ds);
}
}).__(new Function<Stream<JdbcSettings>, Stream<JdbcSettings>>() {
@Override
public Stream<JdbcSettings> apply(Stream<JdbcSettings> s) {
return jdbcSettings.isQueryInParallel() ? s.parallel(dss.size()) : s;
}
}).flatMap(new Function<JdbcSettings, Stream<T>>() {
@Override
public Stream<T> apply(JdbcSettings newJdbcSettings) {
return stream(sql, statementSetter, recordGetter, newJdbcSettings, parameters);
}
});
} | [
"@",
"SafeVarargs",
"public",
"final",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"streamAll",
"(",
"final",
"String",
"sql",
",",
"final",
"StatementSetter",
"statementSetter",
",",
"final",
"JdbcUtil",
".",
"BiRecordGetter",
"<",
"T",
",",
"RuntimeException",
... | Remember to close the returned <code>Stream</code> list to close the underlying <code>ResultSet</code> list.
{@code stream} operation won't be part of transaction or use the connection created by {@code Transaction} even it's in transaction block/range.
@param sql
@param statementSetter
@param jdbcSettings
@param parameters
@return | [
"Remember",
"to",
"close",
"the",
"returned",
"<code",
">",
"Stream<",
"/",
"code",
">",
"list",
"to",
"close",
"the",
"underlying",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"list",
".",
"{",
"@code",
"stream",
"}",
"operation",
"won",
"t",
"be",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L2915-L2942 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java | GenericsUtils.getReturnClass | public static Class<?> getReturnClass(final Method method, final Map<String, Type> generics) {
final Type returnType = method.getGenericReturnType();
return resolveClass(returnType, generics);
} | java | public static Class<?> getReturnClass(final Method method, final Map<String, Type> generics) {
final Type returnType = method.getGenericReturnType();
return resolveClass(returnType, generics);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getReturnClass",
"(",
"final",
"Method",
"method",
",",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"generics",
")",
"{",
"final",
"Type",
"returnType",
"=",
"method",
".",
"getGenericReturnType",
"(",
")",... | Called to properly resolve return type of root finder or inherited finder method.
Supposed to return enough type info to detect return type (collection, array or plain object).
<p>
Note: may return primitive because it might be important to differentiate actual value.
Use {@link TypeUtils#wrapPrimitive(Class)} to box possible primitive, if required.
@param method method to analyze
@param generics generics resolution map for method class (will be null for root)
@return return type class | [
"Called",
"to",
"properly",
"resolve",
"return",
"type",
"of",
"root",
"finder",
"or",
"inherited",
"finder",
"method",
".",
"Supposed",
"to",
"return",
"enough",
"type",
"info",
"to",
"detect",
"return",
"type",
"(",
"collection",
"array",
"or",
"plain",
"o... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java#L70-L73 |
finmath/finmath-lib | src/main/java6/net/finmath/functions/AnalyticFormulas.java | AnalyticFormulas.bachelierOptionImpliedVolatility | public static double bachelierOptionImpliedVolatility(
double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue)
{
if(forward == optionStrike) {
return optionValue / Math.sqrt(optionMaturity / Math.PI / 2.0) / payoffUnit;
}
// Limit the maximum number of iterations, to ensure this calculation returns fast, e.g. in cases when there is no such thing as an implied vol
// TODO: An exception should be thrown, when there is no implied volatility for the given value.
int maxIterations = 100;
double maxAccuracy = 0.0;
// Calculate an lower and upper bound for the volatility
double volatilityLowerBound = 0.0;
double volatilityUpperBound = Math.sqrt(2 * Math.PI * Math.E) * (optionValue / payoffUnit + Math.abs(forward-optionStrike)) / Math.sqrt(optionMaturity);
// Solve for implied volatility
GoldenSectionSearch solver = new GoldenSectionSearch(volatilityLowerBound, volatilityUpperBound);
while(solver.getAccuracy() > maxAccuracy && !solver.isDone() && solver.getNumberOfIterations() < maxIterations) {
double volatility = solver.getNextPoint();
double valueAnalytic = bachelierOptionValue(forward, volatility, optionMaturity, optionStrike, payoffUnit);
double error = valueAnalytic - optionValue;
solver.setValue(error*error);
}
return solver.getBestPoint();
} | java | public static double bachelierOptionImpliedVolatility(
double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue)
{
if(forward == optionStrike) {
return optionValue / Math.sqrt(optionMaturity / Math.PI / 2.0) / payoffUnit;
}
// Limit the maximum number of iterations, to ensure this calculation returns fast, e.g. in cases when there is no such thing as an implied vol
// TODO: An exception should be thrown, when there is no implied volatility for the given value.
int maxIterations = 100;
double maxAccuracy = 0.0;
// Calculate an lower and upper bound for the volatility
double volatilityLowerBound = 0.0;
double volatilityUpperBound = Math.sqrt(2 * Math.PI * Math.E) * (optionValue / payoffUnit + Math.abs(forward-optionStrike)) / Math.sqrt(optionMaturity);
// Solve for implied volatility
GoldenSectionSearch solver = new GoldenSectionSearch(volatilityLowerBound, volatilityUpperBound);
while(solver.getAccuracy() > maxAccuracy && !solver.isDone() && solver.getNumberOfIterations() < maxIterations) {
double volatility = solver.getNextPoint();
double valueAnalytic = bachelierOptionValue(forward, volatility, optionMaturity, optionStrike, payoffUnit);
double error = valueAnalytic - optionValue;
solver.setValue(error*error);
}
return solver.getBestPoint();
} | [
"public",
"static",
"double",
"bachelierOptionImpliedVolatility",
"(",
"double",
"forward",
",",
"double",
"optionMaturity",
",",
"double",
"optionStrike",
",",
"double",
"payoffUnit",
",",
"double",
"optionValue",
")",
"{",
"if",
"(",
"forward",
"==",
"optionStrike... | Calculates the Bachelier option implied volatility of a call, i.e., the payoff
<p><i>max(S(T)-K,0)</i></p>, where <i>S</i> follows a normal process with constant volatility.
@param forward The forward of the underlying.
@param optionMaturity The option maturity T.
@param optionStrike The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.
@param payoffUnit The payoff unit (e.g., the discount factor)
@param optionValue The option value.
@return Returns the implied volatility of a European call option under the Bachelier model. | [
"Calculates",
"the",
"Bachelier",
"option",
"implied",
"volatility",
"of",
"a",
"call",
"i",
".",
"e",
".",
"the",
"payoff",
"<p",
">",
"<i",
">",
"max",
"(",
"S",
"(",
"T",
")",
"-",
"K",
"0",
")",
"<",
"/",
"i",
">",
"<",
"/",
"p",
">",
"wh... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/functions/AnalyticFormulas.java#L860-L893 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java | BigtableTableAdminClient.dropRowRangeAsync | @SuppressWarnings("WeakerAccess")
public ApiFuture<Void> dropRowRangeAsync(String tableId, String rowKeyPrefix) {
return dropRowRangeAsync(tableId, ByteString.copyFromUtf8(rowKeyPrefix));
} | java | @SuppressWarnings("WeakerAccess")
public ApiFuture<Void> dropRowRangeAsync(String tableId, String rowKeyPrefix) {
return dropRowRangeAsync(tableId, ByteString.copyFromUtf8(rowKeyPrefix));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"ApiFuture",
"<",
"Void",
">",
"dropRowRangeAsync",
"(",
"String",
"tableId",
",",
"String",
"rowKeyPrefix",
")",
"{",
"return",
"dropRowRangeAsync",
"(",
"tableId",
",",
"ByteString",
".",
"copyFrom... | Drops rows by the specified key prefix and tableId asynchronously
<p>Please note that this method is considered part of the admin API and is rate limited.
<p>Sample code:
<pre>{@code
ApiFuture<Void> dropFuture = client.dropRowRangeAsync("my-table", "prefix");
ApiFutures.addCallback(
dropFuture,
new ApiFutureCallback<Void>() {
public void onSuccess(Void tableNames) {
System.out.println("Successfully dropped row range.");
}
public void onFailure(Throwable t) {
t.printStackTrace();
}
},
MoreExecutors.directExecutor()
);
}</pre> | [
"Drops",
"rows",
"by",
"the",
"specified",
"key",
"prefix",
"and",
"tableId",
"asynchronously"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java#L644-L647 |
jhg023/SimpleNet | src/main/java/simplenet/packet/Packet.java | Packet.putInt | public Packet putInt(int i, ByteOrder order) {
var buffer = HEAP_BUFFER_POOL.take(Integer.BYTES);
var array = buffer.putInt(order == ByteOrder.LITTLE_ENDIAN ? Integer.reverseBytes(i) : i).array();
try {
return enqueue(Arrays.copyOfRange(array, 0, Integer.BYTES));
} finally {
HEAP_BUFFER_POOL.give(buffer);
}
} | java | public Packet putInt(int i, ByteOrder order) {
var buffer = HEAP_BUFFER_POOL.take(Integer.BYTES);
var array = buffer.putInt(order == ByteOrder.LITTLE_ENDIAN ? Integer.reverseBytes(i) : i).array();
try {
return enqueue(Arrays.copyOfRange(array, 0, Integer.BYTES));
} finally {
HEAP_BUFFER_POOL.give(buffer);
}
} | [
"public",
"Packet",
"putInt",
"(",
"int",
"i",
",",
"ByteOrder",
"order",
")",
"{",
"var",
"buffer",
"=",
"HEAP_BUFFER_POOL",
".",
"take",
"(",
"Integer",
".",
"BYTES",
")",
";",
"var",
"array",
"=",
"buffer",
".",
"putInt",
"(",
"order",
"==",
"ByteOr... | Writes a single {@code int} with the specified {@link ByteOrder} to this {@link Packet}'s payload.
@param i An {@code int}.
@param order The internal byte order of the {@code int}.
@return The {@link Packet} to allow for chained writes. | [
"Writes",
"a",
"single",
"{",
"@code",
"int",
"}",
"with",
"the",
"specified",
"{",
"@link",
"ByteOrder",
"}",
"to",
"this",
"{",
"@link",
"Packet",
"}",
"s",
"payload",
"."
] | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/packet/Packet.java#L230-L239 |
h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParseUUID.java | ParseUUID.attemptUUIDParseLow | private static Long attemptUUIDParseLow(BufferedString str) {
final byte[] buf = str.getBuffer();
int i=str.getOffset();
if( i+36 > buf.length ) return markBad(str);
long lo=0;
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
if( buf[i++]!='-' ) return markBad(str);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
if( buf[i++]!='-' ) return markBad(str);
lo = get2(lo,buf,(i+=2)-2);
return attemptUUIDParseEnd(str, lo, buf, i);
} | java | private static Long attemptUUIDParseLow(BufferedString str) {
final byte[] buf = str.getBuffer();
int i=str.getOffset();
if( i+36 > buf.length ) return markBad(str);
long lo=0;
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
if( buf[i++]!='-' ) return markBad(str);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
if( buf[i++]!='-' ) return markBad(str);
lo = get2(lo,buf,(i+=2)-2);
return attemptUUIDParseEnd(str, lo, buf, i);
} | [
"private",
"static",
"Long",
"attemptUUIDParseLow",
"(",
"BufferedString",
"str",
")",
"{",
"final",
"byte",
"[",
"]",
"buf",
"=",
"str",
".",
"getBuffer",
"(",
")",
";",
"int",
"i",
"=",
"str",
".",
"getOffset",
"(",
")",
";",
"if",
"(",
"i",
"+",
... | (and return Long.MIN_VALUE but this is a valid long return value). | [
"(",
"and",
"return",
"Long",
".",
"MIN_VALUE",
"but",
"this",
"is",
"a",
"valid",
"long",
"return",
"value",
")",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParseUUID.java#L55-L70 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withCharSequence | public Postcard withCharSequence(@Nullable String key, @Nullable CharSequence value) {
mBundle.putCharSequence(key, value);
return this;
} | java | public Postcard withCharSequence(@Nullable String key, @Nullable CharSequence value) {
mBundle.putCharSequence(key, value);
return this;
} | [
"public",
"Postcard",
"withCharSequence",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"CharSequence",
"value",
")",
"{",
"mBundle",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return current | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L361-L364 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java | EasyRandomParameters.dateRange | public EasyRandomParameters dateRange(final LocalDate min, final LocalDate max) {
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min date should be before max date");
}
setDateRange(new Range<>(min, max));
return this;
} | java | public EasyRandomParameters dateRange(final LocalDate min, final LocalDate max) {
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min date should be before max date");
}
setDateRange(new Range<>(min, max));
return this;
} | [
"public",
"EasyRandomParameters",
"dateRange",
"(",
"final",
"LocalDate",
"min",
",",
"final",
"LocalDate",
"max",
")",
"{",
"if",
"(",
"min",
".",
"isAfter",
"(",
"max",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Min date should be befor... | Set the date range.
@param min date
@param max date
@return the current {@link EasyRandomParameters} instance for method chaining | [
"Set",
"the",
"date",
"range",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java#L455-L461 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/jama/QRDecomposition.java | QRDecomposition.getH | public Matrix getH () {
Matrix X = new Matrix(m,n);
double[][] H = X.getArray();
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i >= j) {
H[i][j] = QR[i][j];
} else {
H[i][j] = 0.0;
}
}
}
return X;
} | java | public Matrix getH () {
Matrix X = new Matrix(m,n);
double[][] H = X.getArray();
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i >= j) {
H[i][j] = QR[i][j];
} else {
H[i][j] = 0.0;
}
}
}
return X;
} | [
"public",
"Matrix",
"getH",
"(",
")",
"{",
"Matrix",
"X",
"=",
"new",
"Matrix",
"(",
"m",
",",
"n",
")",
";",
"double",
"[",
"]",
"[",
"]",
"H",
"=",
"X",
".",
"getArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m... | Return the Householder vectors
@return Lower trapezoidal matrix whose columns define the reflections | [
"Return",
"the",
"Householder",
"vectors"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/jama/QRDecomposition.java#L132-L145 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java | TypesWalker.isCompatible | @SuppressWarnings("checkstyle:CyclomaticComplexity")
private static boolean isCompatible(final Type one, final Type two) {
final Class[] oneBounds = GenericsUtils.resolveUpperBounds(one, IGNORE_VARS);
final Class[] twoBounds = GenericsUtils.resolveUpperBounds(two, IGNORE_VARS);
boolean res = true;
final boolean oneWildcard = one instanceof WildcardType;
final boolean twoWildcard = two instanceof WildcardType;
if (oneWildcard || twoWildcard) {
// check if both wildcards are lower bounded (? super)
if (oneWildcard && twoWildcard) {
res = isLowerBoundsCompatible((WildcardType) one, (WildcardType) two);
}
// check if left wildcard is lower bounded (? super Something)
if (res && oneWildcard) {
res = isLowerBoundCompatible((WildcardType) one, twoBounds);
}
// check if right wildcard is lower bounded (? super Something)
if (res && twoWildcard) {
res = isLowerBoundCompatible((WildcardType) two, oneBounds);
}
// compare upper bounds for compatibility (? extends Something)
if (res) {
res = TypeUtils.isAssignableBounds(oneBounds, twoBounds)
|| TypeUtils.isAssignableBounds(twoBounds, oneBounds);
}
} else {
// no wildcards - types must be simply assignable
res = isCompatibleClasses(oneBounds[0], twoBounds[0]);
}
return res;
} | java | @SuppressWarnings("checkstyle:CyclomaticComplexity")
private static boolean isCompatible(final Type one, final Type two) {
final Class[] oneBounds = GenericsUtils.resolveUpperBounds(one, IGNORE_VARS);
final Class[] twoBounds = GenericsUtils.resolveUpperBounds(two, IGNORE_VARS);
boolean res = true;
final boolean oneWildcard = one instanceof WildcardType;
final boolean twoWildcard = two instanceof WildcardType;
if (oneWildcard || twoWildcard) {
// check if both wildcards are lower bounded (? super)
if (oneWildcard && twoWildcard) {
res = isLowerBoundsCompatible((WildcardType) one, (WildcardType) two);
}
// check if left wildcard is lower bounded (? super Something)
if (res && oneWildcard) {
res = isLowerBoundCompatible((WildcardType) one, twoBounds);
}
// check if right wildcard is lower bounded (? super Something)
if (res && twoWildcard) {
res = isLowerBoundCompatible((WildcardType) two, oneBounds);
}
// compare upper bounds for compatibility (? extends Something)
if (res) {
res = TypeUtils.isAssignableBounds(oneBounds, twoBounds)
|| TypeUtils.isAssignableBounds(twoBounds, oneBounds);
}
} else {
// no wildcards - types must be simply assignable
res = isCompatibleClasses(oneBounds[0], twoBounds[0]);
}
return res;
} | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:CyclomaticComplexity\"",
")",
"private",
"static",
"boolean",
"isCompatible",
"(",
"final",
"Type",
"one",
",",
"final",
"Type",
"two",
")",
"{",
"final",
"Class",
"[",
"]",
"oneBounds",
"=",
"GenericsUtils",
".",
"res... | Check if one types are wildcards and apply wildcard rules:
<ul>
<li>Wildcard with multiple upper bounds (repackaged T extends A & B) must be checked against all bounds</li>
<li>Wildcard with lower bound (? super A) compatible only with A and it's supertypes</li>
</ul>
<p>
Non wildcard types are projected to class
@param one type to check
@param two type to check with
@return true if types compatible according to wildcard rules | [
"Check",
"if",
"one",
"types",
"are",
"wildcards",
"and",
"apply",
"wildcard",
"rules",
":",
"<ul",
">",
"<li",
">",
"Wildcard",
"with",
"multiple",
"upper",
"bounds",
"(",
"repackaged",
"T",
"extends",
"A",
"&",
"B",
")",
"must",
"be",
"checked",
"again... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java#L160-L196 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.alwaysAssert | private void alwaysAssert(boolean expression, String msg,
Object... formatArgs) {
if (!expression) {
throw new AssertionError(String.format(msg, formatArgs));
}
} | java | private void alwaysAssert(boolean expression, String msg,
Object... formatArgs) {
if (!expression) {
throw new AssertionError(String.format(msg, formatArgs));
}
} | [
"private",
"void",
"alwaysAssert",
"(",
"boolean",
"expression",
",",
"String",
"msg",
",",
"Object",
"...",
"formatArgs",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"AssertionError",
"(",
"String",
".",
"format",
"(",
"msg",
",",
... | @throws AssertionError if the given expression is not true.
The message of the exception is formatted using the 'msg' and
'formatArgs' parameters.
This should be used in preference to Java's built-in assert in
non-performance-critical paths, where a failure of this invariant
might cause the protocol to lose data. | [
"@throws",
"AssertionError",
"if",
"the",
"given",
"expression",
"is",
"not",
"true",
".",
"The",
"message",
"of",
"the",
"exception",
"is",
"formatted",
"using",
"the",
"msg",
"and",
"formatArgs",
"parameters",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L784-L789 |
hdecarne/java-default | src/main/java/de/carne/io/IOUtil.java | IOUtil.copyUrl | public static long copyUrl(OutputStream dst, URL src) throws IOException {
long copied;
try (InputStream srcStream = src.openStream()) {
copied = copyStream(dst, srcStream);
}
return copied;
} | java | public static long copyUrl(OutputStream dst, URL src) throws IOException {
long copied;
try (InputStream srcStream = src.openStream()) {
copied = copyStream(dst, srcStream);
}
return copied;
} | [
"public",
"static",
"long",
"copyUrl",
"(",
"OutputStream",
"dst",
",",
"URL",
"src",
")",
"throws",
"IOException",
"{",
"long",
"copied",
";",
"try",
"(",
"InputStream",
"srcStream",
"=",
"src",
".",
"openStream",
"(",
")",
")",
"{",
"copied",
"=",
"cop... | Copies all bytes from a {@linkplain URL} to an {@linkplain OutputStream}.
@param dst the {@linkplain OutputStream} to copy to.
@param src the {@linkplain URL} to copy from.
@return the number of copied bytes.
@throws IOException if an I/O error occurs. | [
"Copies",
"all",
"bytes",
"from",
"a",
"{",
"@linkplain",
"URL",
"}",
"to",
"an",
"{",
"@linkplain",
"OutputStream",
"}",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/io/IOUtil.java#L152-L159 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicy.java | BoxRetentionPolicy.createRetentionPolicy | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action,
RetentionPolicyParams optionalParams) {
URL url = RETENTION_POLICIES_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject requestJSON = new JsonObject()
.add("policy_name", name)
.add("policy_type", type)
.add("disposition_action", action);
if (!type.equals(TYPE_INDEFINITE)) {
requestJSON.add("retention_length", length);
}
if (optionalParams != null) {
requestJSON.add("can_owner_extend_retention", optionalParams.getCanOwnerExtendRetention());
requestJSON.add("are_owners_notified", optionalParams.getAreOwnersNotified());
List<BoxUser.Info> customNotificationRecipients = optionalParams.getCustomNotificationRecipients();
if (customNotificationRecipients.size() > 0) {
JsonArray users = new JsonArray();
for (BoxUser.Info user : customNotificationRecipients) {
JsonObject userJSON = new JsonObject()
.add("type", "user")
.add("id", user.getID());
users.add(userJSON);
}
requestJSON.add("custom_notification_recipients", users);
}
}
request.setBody(requestJSON.toString());
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJSON = JsonObject.readFrom(response.getJSON());
BoxRetentionPolicy createdPolicy = new BoxRetentionPolicy(api, responseJSON.get("id").asString());
return createdPolicy.new Info(responseJSON);
} | java | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action,
RetentionPolicyParams optionalParams) {
URL url = RETENTION_POLICIES_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject requestJSON = new JsonObject()
.add("policy_name", name)
.add("policy_type", type)
.add("disposition_action", action);
if (!type.equals(TYPE_INDEFINITE)) {
requestJSON.add("retention_length", length);
}
if (optionalParams != null) {
requestJSON.add("can_owner_extend_retention", optionalParams.getCanOwnerExtendRetention());
requestJSON.add("are_owners_notified", optionalParams.getAreOwnersNotified());
List<BoxUser.Info> customNotificationRecipients = optionalParams.getCustomNotificationRecipients();
if (customNotificationRecipients.size() > 0) {
JsonArray users = new JsonArray();
for (BoxUser.Info user : customNotificationRecipients) {
JsonObject userJSON = new JsonObject()
.add("type", "user")
.add("id", user.getID());
users.add(userJSON);
}
requestJSON.add("custom_notification_recipients", users);
}
}
request.setBody(requestJSON.toString());
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJSON = JsonObject.readFrom(response.getJSON());
BoxRetentionPolicy createdPolicy = new BoxRetentionPolicy(api, responseJSON.get("id").asString());
return createdPolicy.new Info(responseJSON);
} | [
"private",
"static",
"BoxRetentionPolicy",
".",
"Info",
"createRetentionPolicy",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"String",
"type",
",",
"int",
"length",
",",
"String",
"action",
",",
"RetentionPolicyParams",
"optionalParams",
")",
"{",
... | Used to create a new retention policy with optional parameters.
@param api the API connection to be used by the created user.
@param name the name of the retention policy.
@param type the type of the retention policy. Can be "finite" or "indefinite".
@param length the duration in days that the retention policy will be active for after being assigned to content.
@param action the disposition action can be "permanently_delete" or "remove_retention".
@param optionalParams the optional parameters.
@return the created retention policy's info. | [
"Used",
"to",
"create",
"a",
"new",
"retention",
"policy",
"with",
"optional",
"parameters",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicy.java#L160-L193 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java | ReplicationsInner.beginUpdate | public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body();
} | java | public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body();
} | [
"public",
"ReplicationInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"replicationName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"... | Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param replicationName The name of the replication.
@param tags The tags for the replication.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the ReplicationInner object if successful. | [
"Updates",
"a",
"replication",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java#L815-L817 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/OnlineAccuracyUpdatedEnsemble.java | OnlineAccuracyUpdatedEnsemble.computeWeight | protected double computeWeight(int i, Instance example) {
int d = this.windowSize;
int t = this.processedInstances - this.ensemble[i].birthday;
double e_it = 0;
double mse_it = 0;
double voteSum = 0;
try{
double[] votes = this.ensemble[i].classifier.getVotesForInstance(example);
for (double element : votes) {
voteSum += element;
}
if (voteSum > 0) {
double f_it = 1 - (votes[(int) example.classValue()] / voteSum);
e_it = f_it * f_it;
} else {
e_it = 1;
}
} catch (Exception e) {
e_it = 1;
}
if(t > d)
{
mse_it = this.ensemble[i].mse_it + e_it/(double)d - this.ensemble[i].squareErrors[t % d]/(double)d;
}
else
{
mse_it = this.ensemble[i].mse_it*(t-1)/t + e_it/(double)t;
}
this.ensemble[i].squareErrors[t % d] = e_it;
this.ensemble[i].mse_it = mse_it;
if(linearOption.isSet())
{
return java.lang.Math.max(mse_r - mse_it, Double.MIN_VALUE);
}
else
{
return 1.0 / (this.mse_r + mse_it + Double.MIN_VALUE);
}
} | java | protected double computeWeight(int i, Instance example) {
int d = this.windowSize;
int t = this.processedInstances - this.ensemble[i].birthday;
double e_it = 0;
double mse_it = 0;
double voteSum = 0;
try{
double[] votes = this.ensemble[i].classifier.getVotesForInstance(example);
for (double element : votes) {
voteSum += element;
}
if (voteSum > 0) {
double f_it = 1 - (votes[(int) example.classValue()] / voteSum);
e_it = f_it * f_it;
} else {
e_it = 1;
}
} catch (Exception e) {
e_it = 1;
}
if(t > d)
{
mse_it = this.ensemble[i].mse_it + e_it/(double)d - this.ensemble[i].squareErrors[t % d]/(double)d;
}
else
{
mse_it = this.ensemble[i].mse_it*(t-1)/t + e_it/(double)t;
}
this.ensemble[i].squareErrors[t % d] = e_it;
this.ensemble[i].mse_it = mse_it;
if(linearOption.isSet())
{
return java.lang.Math.max(mse_r - mse_it, Double.MIN_VALUE);
}
else
{
return 1.0 / (this.mse_r + mse_it + Double.MIN_VALUE);
}
} | [
"protected",
"double",
"computeWeight",
"(",
"int",
"i",
",",
"Instance",
"example",
")",
"{",
"int",
"d",
"=",
"this",
".",
"windowSize",
";",
"int",
"t",
"=",
"this",
".",
"processedInstances",
"-",
"this",
".",
"ensemble",
"[",
"i",
"]",
".",
"birth... | Computes the weight of a learner before training a given example.
@param i the identifier (in terms of array learners)
of the classifier for which the weight is supposed to be computed
@param example the newest example
@return the computed weight. | [
"Computes",
"the",
"weight",
"of",
"a",
"learner",
"before",
"training",
"a",
"given",
"example",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/OnlineAccuracyUpdatedEnsemble.java#L300-L346 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.orthoSymmetricLH | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, Matrix4f dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | java | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, Matrix4f dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | [
"public",
"Matrix4f",
"orthoSymmetricLH",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"Matrix4f",
"dest",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
"... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float, Matrix4f) orthoLH()} with
<code>left=-width/2</code>, <code>right=+width/2</code>, <code>bottom=-height/2</code> and <code>top=+height/2</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>O</code> the orthographic projection matrix,
then the new matrix will be <code>M * O</code>. So when transforming a
vector <code>v</code> with the new matrix by using <code>M * O * v</code>, the
orthographic projection transformation will be applied first!
<p>
In order to set the matrix to a symmetric orthographic projection without post-multiplying it,
use {@link #setOrthoSymmetricLH(float, float, float, float) setOrthoSymmetricLH()}.
<p>
Reference: <a href="http://www.songho.ca/opengl/gl_projectionmatrix.html#ortho">http://www.songho.ca</a>
@see #setOrthoSymmetricLH(float, float, float, float)
@param width
the distance between the right and left frustum edges
@param height
the distance between the top and bottom frustum edges
@param zNear
near clipping plane distance
@param zFar
far clipping plane distance
@param dest
will hold the result
@return dest | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7569-L7571 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java | PatchHandler.initialize | public ResponseBuilder initialize(final Resource parent, final Resource resource) {
if (MISSING_RESOURCE.equals(resource)) {
// Can't patch non-existent resources
throw new NotFoundException();
} else if (DELETED_RESOURCE.equals(resource)) {
// Can't patch non-existent resources
throw new ClientErrorException(GONE);
} else if (updateBody == null) {
LOGGER.error("Missing body for update: {}", resource.getIdentifier());
throw new BadRequestException("Missing body for update");
} else if (!supportsInteractionModel(LDP.RDFSource)) {
throw new BadRequestException(status(BAD_REQUEST)
.link(UnsupportedInteractionModel.getIRIString(), LDP.constrainedBy.getIRIString())
.entity("Unsupported interaction model provided").type(TEXT_PLAIN_TYPE).build());
} else if (syntax == null) {
// Get the incoming syntax and check that the underlying I/O service supports it
LOGGER.warn("Content-Type: {} not supported", getRequest().getContentType());
throw new NotSupportedException();
}
// Check the cache headers
final EntityTag etag = new EntityTag(buildEtagHash(getIdentifier(), resource.getModified(),
getRequest().getPrefer()));
checkCache(resource.getModified(), etag);
setResource(resource);
resource.getContainer().ifPresent(p -> setParent(parent));
return ok();
} | java | public ResponseBuilder initialize(final Resource parent, final Resource resource) {
if (MISSING_RESOURCE.equals(resource)) {
// Can't patch non-existent resources
throw new NotFoundException();
} else if (DELETED_RESOURCE.equals(resource)) {
// Can't patch non-existent resources
throw new ClientErrorException(GONE);
} else if (updateBody == null) {
LOGGER.error("Missing body for update: {}", resource.getIdentifier());
throw new BadRequestException("Missing body for update");
} else if (!supportsInteractionModel(LDP.RDFSource)) {
throw new BadRequestException(status(BAD_REQUEST)
.link(UnsupportedInteractionModel.getIRIString(), LDP.constrainedBy.getIRIString())
.entity("Unsupported interaction model provided").type(TEXT_PLAIN_TYPE).build());
} else if (syntax == null) {
// Get the incoming syntax and check that the underlying I/O service supports it
LOGGER.warn("Content-Type: {} not supported", getRequest().getContentType());
throw new NotSupportedException();
}
// Check the cache headers
final EntityTag etag = new EntityTag(buildEtagHash(getIdentifier(), resource.getModified(),
getRequest().getPrefer()));
checkCache(resource.getModified(), etag);
setResource(resource);
resource.getContainer().ifPresent(p -> setParent(parent));
return ok();
} | [
"public",
"ResponseBuilder",
"initialize",
"(",
"final",
"Resource",
"parent",
",",
"final",
"Resource",
"resource",
")",
"{",
"if",
"(",
"MISSING_RESOURCE",
".",
"equals",
"(",
"resource",
")",
")",
"{",
"// Can't patch non-existent resources",
"throw",
"new",
"N... | Initialze the handler with a Trellis resource.
@param parent the parent resource
@param resource the Trellis resource
@return a response builder | [
"Initialze",
"the",
"handler",
"with",
"a",
"Trellis",
"resource",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java#L118-L146 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.minAll | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> minAll(final boolean areAllSmallestSame) {
return minAll(Integer.MAX_VALUE, areAllSmallestSame);
} | java | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> minAll(final boolean areAllSmallestSame) {
return minAll(Integer.MAX_VALUE, areAllSmallestSame);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"minAll",
"(",
"final",
"boolean",
"areAllSmallestSame",
")",
"{",
"return",
... | Use occurrences to save the count of largest objects if {@code areAllSmallestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the smallest object {@code n} times.
@param areAllSmallestSame
@return
@see Collectors#maxAll(Comparator, int, boolean) | [
"Use",
"occurrences",
"to",
"save",
"the",
"count",
"of",
"largest",
"objects",
"if",
"{",
"@code",
"areAllSmallestSame",
"=",
"true",
"}",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"Number",
"/",
"String",
"/",
"...",
"}",
")",
"and",
"return",
"a",
"l... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2548-L2551 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java | ReadCommEventLogResponse.setEvent | public void setEvent(int index, int event) {
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
}
events[index] = (byte)event;
} | java | public void setEvent(int index, int event) {
if (events == null || index < 0 || index >= events.length) {
throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
}
events[index] = (byte)event;
} | [
"public",
"void",
"setEvent",
"(",
"int",
"index",
",",
"int",
"event",
")",
"{",
"if",
"(",
"events",
"==",
"null",
"||",
"index",
"<",
"0",
"||",
"index",
">=",
"events",
".",
"length",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"i... | setEvent -- store an event number in the event log
@param index Event position
@param event Event ID | [
"setEvent",
"--",
"store",
"an",
"event",
"number",
"in",
"the",
"event",
"log"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/msg/ReadCommEventLogResponse.java#L149-L155 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java | ColumnFamilyRecordReader.next | public boolean next(ByteBuffer key, SortedMap<ByteBuffer, Cell> value) throws IOException
{
if (this.nextKeyValue())
{
key.clear();
key.put(this.getCurrentKey().duplicate());
key.flip();
value.clear();
value.putAll(this.getCurrentValue());
return true;
}
return false;
} | java | public boolean next(ByteBuffer key, SortedMap<ByteBuffer, Cell> value) throws IOException
{
if (this.nextKeyValue())
{
key.clear();
key.put(this.getCurrentKey().duplicate());
key.flip();
value.clear();
value.putAll(this.getCurrentValue());
return true;
}
return false;
} | [
"public",
"boolean",
"next",
"(",
"ByteBuffer",
"key",
",",
"SortedMap",
"<",
"ByteBuffer",
",",
"Cell",
">",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"nextKeyValue",
"(",
")",
")",
"{",
"key",
".",
"clear",
"(",
")",
";",
... | and ColumnFamilyRecordReader don't support them, it should be fine for now. | [
"and",
"ColumnFamilyRecordReader",
"don",
"t",
"support",
"them",
"it",
"should",
"be",
"fine",
"for",
"now",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java#L564-L578 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/FilenameMaskFilter.java | FilenameMaskFilter.accept | public boolean accept(File pDir, String pName) {
WildcardStringParser parser;
// Check each filename string mask whether the file is to be accepted
if (inclusion) { // Inclusion
for (String mask : filenameMasksForInclusion) {
parser = new WildcardStringParser(mask);
if (parser.parseString(pName)) {
// The filename was accepted by the filename masks provided
// - include it in filename list
return true;
}
}
// The filename not was accepted by any of the filename masks
// provided - NOT to be included in the filename list
return false;
}
else {
// Exclusion
for (String mask : filenameMasksForExclusion) {
parser = new WildcardStringParser(mask);
if (parser.parseString(pName)) {
// The filename was accepted by the filename masks provided
// - NOT to be included in the filename list
return false;
}
}
// The filename was not accepted by any of the filename masks
// provided - include it in filename list
return true;
}
} | java | public boolean accept(File pDir, String pName) {
WildcardStringParser parser;
// Check each filename string mask whether the file is to be accepted
if (inclusion) { // Inclusion
for (String mask : filenameMasksForInclusion) {
parser = new WildcardStringParser(mask);
if (parser.parseString(pName)) {
// The filename was accepted by the filename masks provided
// - include it in filename list
return true;
}
}
// The filename not was accepted by any of the filename masks
// provided - NOT to be included in the filename list
return false;
}
else {
// Exclusion
for (String mask : filenameMasksForExclusion) {
parser = new WildcardStringParser(mask);
if (parser.parseString(pName)) {
// The filename was accepted by the filename masks provided
// - NOT to be included in the filename list
return false;
}
}
// The filename was not accepted by any of the filename masks
// provided - include it in filename list
return true;
}
} | [
"public",
"boolean",
"accept",
"(",
"File",
"pDir",
",",
"String",
"pName",
")",
"{",
"WildcardStringParser",
"parser",
";",
"// Check each filename string mask whether the file is to be accepted\r",
"if",
"(",
"inclusion",
")",
"{",
"// Inclusion\r",
"for",
"(",
"Strin... | This method implements the {@code java.io.FilenameFilter} interface.
@param pDir the directory in which the file was found.
@param pName the name of the file.
@return {@code true} if the file {@code pName} should be included in the file
list; {@code false} otherwise. | [
"This",
"method",
"implements",
"the",
"{",
"@code",
"java",
".",
"io",
".",
"FilenameFilter",
"}",
"interface",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FilenameMaskFilter.java#L168-L203 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.getAxisName | public String getAxisName(int controller, int axis) {
return ((Controller) controllers.get(controller)).getAxisName(axis);
} | java | public String getAxisName(int controller, int axis) {
return ((Controller) controllers.get(controller)).getAxisName(axis);
} | [
"public",
"String",
"getAxisName",
"(",
"int",
"controller",
",",
"int",
"axis",
")",
"{",
"return",
"(",
"(",
"Controller",
")",
"controllers",
".",
"get",
"(",
"controller",
")",
")",
".",
"getAxisName",
"(",
"axis",
")",
";",
"}"
] | Get the name of the axis with the given index
@param controller The index of the controller to check
@param axis The index of the axis to read
@return The name of the specified axis | [
"Get",
"the",
"name",
"of",
"the",
"axis",
"with",
"the",
"given",
"index"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L863-L865 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java | SHPRead.readShape | public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException {
readShape(connection, fileName, tableReference, null);
} | java | public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException {
readShape(connection, fileName, tableReference, null);
} | [
"public",
"static",
"void",
"readShape",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"readShape",
"(",
"connection",
",",
"fileName",
",",
"tableReference",
",... | Copy data from Shape File into a new table in specified connection.
@param connection Active connection
@param tableReference [[catalog.]schema.]table reference
@param fileName File path of the SHP file or URI
@throws java.io.IOException
@throws java.sql.SQLException | [
"Copy",
"data",
"from",
"Shape",
"File",
"into",
"a",
"new",
"table",
"in",
"specified",
"connection",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPRead.java#L75-L77 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java | KeyVisualization.findDepth | private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) {
if(hier.numChildren(cluster) > 0) {
for(It<Cluster<M>> iter = hier.iterChildren(cluster); iter.valid(); iter.advance()) {
findDepth(hier, iter.get(), size);
}
size[0] += 1; // Depth
}
else {
size[1] += 1; // Leaves
}
} | java | private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) {
if(hier.numChildren(cluster) > 0) {
for(It<Cluster<M>> iter = hier.iterChildren(cluster); iter.valid(); iter.advance()) {
findDepth(hier, iter.get(), size);
}
size[0] += 1; // Depth
}
else {
size[1] += 1; // Leaves
}
} | [
"private",
"static",
"<",
"M",
"extends",
"Model",
">",
"void",
"findDepth",
"(",
"Hierarchy",
"<",
"Cluster",
"<",
"M",
">",
">",
"hier",
",",
"Cluster",
"<",
"M",
">",
"cluster",
",",
"int",
"[",
"]",
"size",
")",
"{",
"if",
"(",
"hier",
".",
"... | Recursive depth computation.
@param hier Hierarchy
@param cluster Current cluster
@param size Counting array. | [
"Recursive",
"depth",
"computation",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java#L109-L119 |
j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.getHelper | public static synchronized <T extends OrmLiteSqliteOpenHelper> T getHelper(Context context, Class<T> openHelperClass) {
if (openHelperClass == null) {
throw new IllegalArgumentException("openHelperClass argument is null");
}
innerSetHelperClass(openHelperClass);
return loadHelper(context, openHelperClass);
} | java | public static synchronized <T extends OrmLiteSqliteOpenHelper> T getHelper(Context context, Class<T> openHelperClass) {
if (openHelperClass == null) {
throw new IllegalArgumentException("openHelperClass argument is null");
}
innerSetHelperClass(openHelperClass);
return loadHelper(context, openHelperClass);
} | [
"public",
"static",
"synchronized",
"<",
"T",
"extends",
"OrmLiteSqliteOpenHelper",
">",
"T",
"getHelper",
"(",
"Context",
"context",
",",
"Class",
"<",
"T",
">",
"openHelperClass",
")",
"{",
"if",
"(",
"openHelperClass",
"==",
"null",
")",
"{",
"throw",
"ne... | Create a static instance of our open helper from the helper class. This has a usage counter on it so make sure
all calls to this method have an associated call to {@link #releaseHelper()}. This should be called during an
onCreate() type of method when the application or service is starting. The caller should then keep the helper
around until it is shutting down when {@link #releaseHelper()} should be called. | [
"Create",
"a",
"static",
"instance",
"of",
"our",
"open",
"helper",
"from",
"the",
"helper",
"class",
".",
"This",
"has",
"a",
"usage",
"counter",
"on",
"it",
"so",
"make",
"sure",
"all",
"calls",
"to",
"this",
"method",
"have",
"an",
"associated",
"call... | train | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L73-L79 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, DoubleAttribute attribute) {
attribute.setValue(toDouble(formWidget.getValue(name)));
} | java | @Api
public void getValue(String name, DoubleAttribute attribute) {
attribute.setValue(toDouble(formWidget.getValue(name)));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"DoubleAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"toDouble",
"(",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
")",
";",
"}"
] | Get a double value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"double",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L705-L708 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/crypto/HDKeyDerivation.java | HDKeyDerivation.deriveThisOrNextChildKey | public static DeterministicKey deriveThisOrNextChildKey(DeterministicKey parent, int childNumber) {
int nAttempts = 0;
ChildNumber child = new ChildNumber(childNumber);
boolean isHardened = child.isHardened();
while (nAttempts < MAX_CHILD_DERIVATION_ATTEMPTS) {
try {
child = new ChildNumber(child.num() + nAttempts, isHardened);
return deriveChildKey(parent, child);
} catch (HDDerivationException ignore) { }
nAttempts++;
}
throw new HDDerivationException("Maximum number of child derivation attempts reached, this is probably an indication of a bug.");
} | java | public static DeterministicKey deriveThisOrNextChildKey(DeterministicKey parent, int childNumber) {
int nAttempts = 0;
ChildNumber child = new ChildNumber(childNumber);
boolean isHardened = child.isHardened();
while (nAttempts < MAX_CHILD_DERIVATION_ATTEMPTS) {
try {
child = new ChildNumber(child.num() + nAttempts, isHardened);
return deriveChildKey(parent, child);
} catch (HDDerivationException ignore) { }
nAttempts++;
}
throw new HDDerivationException("Maximum number of child derivation attempts reached, this is probably an indication of a bug.");
} | [
"public",
"static",
"DeterministicKey",
"deriveThisOrNextChildKey",
"(",
"DeterministicKey",
"parent",
",",
"int",
"childNumber",
")",
"{",
"int",
"nAttempts",
"=",
"0",
";",
"ChildNumber",
"child",
"=",
"new",
"ChildNumber",
"(",
"childNumber",
")",
";",
"boolean... | Derives a key of the "extended" child number, ie. with the 0x80000000 bit specifying whether to use
hardened derivation or not. If derivation fails, tries a next child. | [
"Derives",
"a",
"key",
"of",
"the",
"extended",
"child",
"number",
"ie",
".",
"with",
"the",
"0x80000000",
"bit",
"specifying",
"whether",
"to",
"use",
"hardened",
"derivation",
"or",
"not",
".",
"If",
"derivation",
"fails",
"tries",
"a",
"next",
"child",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/crypto/HDKeyDerivation.java#L121-L134 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Entity.java | Entity.getList | public List<?> getList(PMContext ctx, EntityFilter filter) throws PMException {
return getList(ctx, filter, null, null, null);
} | java | public List<?> getList(PMContext ctx, EntityFilter filter) throws PMException {
return getList(ctx, filter, null, null, null);
} | [
"public",
"List",
"<",
"?",
">",
"getList",
"(",
"PMContext",
"ctx",
",",
"EntityFilter",
"filter",
")",
"throws",
"PMException",
"{",
"return",
"getList",
"(",
"ctx",
",",
"filter",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Returns a list of this entity instances with null from and count and with
the given filter
@param ctx The context
@param filter The filter
@return The list
@throws PMException | [
"Returns",
"a",
"list",
"of",
"this",
"entity",
"instances",
"with",
"null",
"from",
"and",
"count",
"and",
"with",
"the",
"given",
"filter"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Entity.java#L146-L148 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/context/debug/report/tree/ContextTreeRenderer.java | ContextTreeRenderer.renderScopeContent | private void renderScopeContent(final ContextTreeConfig config, final TreeNode root, final Class<?> scope) {
renderScopeItems(config, root, scope);
final List<Class<Object>> bundles = service.getData()
.getItems(Filters.registeredBy(scope).and(Filters.type(ConfigItem.Bundle)));
for (Class<Object> bundle : bundles) {
renderBundle(config, root, scope, bundle);
}
} | java | private void renderScopeContent(final ContextTreeConfig config, final TreeNode root, final Class<?> scope) {
renderScopeItems(config, root, scope);
final List<Class<Object>> bundles = service.getData()
.getItems(Filters.registeredBy(scope).and(Filters.type(ConfigItem.Bundle)));
for (Class<Object> bundle : bundles) {
renderBundle(config, root, scope, bundle);
}
} | [
"private",
"void",
"renderScopeContent",
"(",
"final",
"ContextTreeConfig",
"config",
",",
"final",
"TreeNode",
"root",
",",
"final",
"Class",
"<",
"?",
">",
"scope",
")",
"{",
"renderScopeItems",
"(",
"config",
",",
"root",
",",
"scope",
")",
";",
"final",
... | Render entire scope subtree. Scope items are rendered first and bundles at the end (because most likely
they will be subtrees).
@param config tree config
@param root root node
@param scope scope to render | [
"Render",
"entire",
"scope",
"subtree",
".",
"Scope",
"items",
"are",
"rendered",
"first",
"and",
"bundles",
"at",
"the",
"end",
"(",
"because",
"most",
"likely",
"they",
"will",
"be",
"subtrees",
")",
"."
] | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/context/debug/report/tree/ContextTreeRenderer.java#L91-L100 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntryContext.java | JournalEntryContext.storeInMap | private <T> void storeInMap(MultiValueMap<T> map, T key, String[] values) {
try {
map.set(key, values);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} | java | private <T> void storeInMap(MultiValueMap<T> map, T key, String[] values) {
try {
map.set(key, values);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} | [
"private",
"<",
"T",
">",
"void",
"storeInMap",
"(",
"MultiValueMap",
"<",
"T",
">",
"map",
",",
"T",
"key",
",",
"String",
"[",
"]",
"values",
")",
"{",
"try",
"{",
"map",
".",
"set",
"(",
"key",
",",
"values",
")",
";",
"}",
"catch",
"(",
"Ex... | This method covers the totally bogus Exception that is thrown by
MultiValueMap.set(), and wraps it in an IllegalArgumentException, which
is more appropriate.
@param <T> | [
"This",
"method",
"covers",
"the",
"totally",
"bogus",
"Exception",
"that",
"is",
"thrown",
"by",
"MultiValueMap",
".",
"set",
"()",
"and",
"wraps",
"it",
"in",
"an",
"IllegalArgumentException",
"which",
"is",
"more",
"appropriate",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntryContext.java#L81-L87 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.setSecurityEnabled | private static void setSecurityEnabled( Catalog catalog, SecurityType security) {
Cluster cluster = catalog.getClusters().get("cluster");
Database database = cluster.getDatabases().get("database");
cluster.setSecurityenabled(security.isEnabled());
database.setSecurityprovider(security.getProvider().value());
} | java | private static void setSecurityEnabled( Catalog catalog, SecurityType security) {
Cluster cluster = catalog.getClusters().get("cluster");
Database database = cluster.getDatabases().get("database");
cluster.setSecurityenabled(security.isEnabled());
database.setSecurityprovider(security.getProvider().value());
} | [
"private",
"static",
"void",
"setSecurityEnabled",
"(",
"Catalog",
"catalog",
",",
"SecurityType",
"security",
")",
"{",
"Cluster",
"cluster",
"=",
"catalog",
".",
"getClusters",
"(",
")",
".",
"get",
"(",
"\"cluster\"",
")",
";",
"Database",
"database",
"=",
... | Set the security setting in the catalog from the deployment file
@param catalog the catalog to be updated
@param security security element of the deployment xml | [
"Set",
"the",
"security",
"setting",
"in",
"the",
"catalog",
"from",
"the",
"deployment",
"file"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2024-L2030 |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.readFromStream | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion)
{
return readFromStream (aISP, aCharset, eVersion, null, null);
} | java | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion)
{
return readFromStream (aISP, aCharset, eVersion, null, null);
} | [
"@",
"Nullable",
"public",
"static",
"CSSDeclarationList",
"readFromStream",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
")",
"{",
"return",
... | Read the CSS from the passed {@link IHasInputStream}.
@param aISP
The input stream provider to use. May not be <code>null</code>.
@param aCharset
The charset to be used. May not be <code>null</code>.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@return <code>null</code> if reading failed, the CSS declarations
otherwise. | [
"Read",
"the",
"CSS",
"from",
"the",
"passed",
"{",
"@link",
"IHasInputStream",
"}",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L446-L452 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImageListsImpl.java | ListManagementImageListsImpl.updateAsync | public Observable<ImageList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
return updateWithServiceResponseAsync(listId, contentType, bodyParameter).map(new Func1<ServiceResponse<ImageList>, ImageList>() {
@Override
public ImageList call(ServiceResponse<ImageList> response) {
return response.body();
}
});
} | java | public Observable<ImageList> updateAsync(String listId, String contentType, BodyModel bodyParameter) {
return updateWithServiceResponseAsync(listId, contentType, bodyParameter).map(new Func1<ServiceResponse<ImageList>, ImageList>() {
@Override
public ImageList call(ServiceResponse<ImageList> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ImageList",
">",
"updateAsync",
"(",
"String",
"listId",
",",
"String",
"contentType",
",",
"BodyModel",
"bodyParameter",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"listId",
",",
"contentType",
",",
"bodyParameter",
")"... | Updates an image list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageList object | [
"Updates",
"an",
"image",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImageListsImpl.java#L282-L289 |
Guichaguri/MinimalFTP | src/main/java/com/guichaguri/minimalftp/FTPConnection.java | FTPConnection.registerOption | public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
} | java | public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
} | [
"public",
"void",
"registerOption",
"(",
"String",
"option",
",",
"String",
"value",
")",
"{",
"options",
".",
"put",
"(",
"option",
".",
"toUpperCase",
"(",
")",
",",
"value",
")",
";",
"}"
] | Registers an option for the OPTS command
@param option The option name
@param value The default value | [
"Registers",
"an",
"option",
"for",
"the",
"OPTS",
"command"
] | train | https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L356-L358 |
arquillian/arquillian-core | container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java | ContainerDeployController.undeployManaged | public void undeployManaged(@Observes UnDeployManagedDeployments event) throws Exception {
forEachDeployedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event<DeploymentEvent> event;
@Override
public void perform(Container container, Deployment deployment) throws Exception {
if (container.getState().equals(Container.State.STARTED) && deployment.isDeployed()) {
event.fire(new UnDeployDeployment(container, deployment));
}
}
});
} | java | public void undeployManaged(@Observes UnDeployManagedDeployments event) throws Exception {
forEachDeployedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event<DeploymentEvent> event;
@Override
public void perform(Container container, Deployment deployment) throws Exception {
if (container.getState().equals(Container.State.STARTED) && deployment.isDeployed()) {
event.fire(new UnDeployDeployment(container, deployment));
}
}
});
} | [
"public",
"void",
"undeployManaged",
"(",
"@",
"Observes",
"UnDeployManagedDeployments",
"event",
")",
"throws",
"Exception",
"{",
"forEachDeployedDeployment",
"(",
"new",
"Operation",
"<",
"Container",
",",
"Deployment",
">",
"(",
")",
"{",
"@",
"Inject",
"privat... | Undeploy all deployments marked as managed, and all manually deployed.
@throws Exception | [
"Undeploy",
"all",
"deployments",
"marked",
"as",
"managed",
"and",
"all",
"manually",
"deployed",
"."
] | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java#L103-L115 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java | HomographyDirectLinearTransform.computeH | protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) {
if( !solverNullspace.process(A.copy(),1,H) )
return true;
H.numRows = 3;
H.numCols = 3;
return false;
} | java | protected boolean computeH(DMatrixRMaj A, DMatrixRMaj H) {
if( !solverNullspace.process(A.copy(),1,H) )
return true;
H.numRows = 3;
H.numCols = 3;
return false;
} | [
"protected",
"boolean",
"computeH",
"(",
"DMatrixRMaj",
"A",
",",
"DMatrixRMaj",
"H",
")",
"{",
"if",
"(",
"!",
"solverNullspace",
".",
"process",
"(",
"A",
".",
"copy",
"(",
")",
",",
"1",
",",
"H",
")",
")",
"return",
"true",
";",
"H",
".",
"numR... | Computes the SVD of A and extracts the homography matrix from its null space | [
"Computes",
"the",
"SVD",
"of",
"A",
"and",
"extracts",
"the",
"homography",
"matrix",
"from",
"its",
"null",
"space"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyDirectLinearTransform.java#L189-L198 |
ryanbrainard/richsobjects | richsobjects-cache-memcached/src/main/java/com/github/ryanbrainard/richsobjects/api/client/ClassLoaderRegisteringObjectInputStream.java | ClassLoaderRegisteringObjectInputStream.resolveClass | @Override
protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
for (ClassLoader loader : classLoaderRegistration) {
try {
return resolveClass(classDesc, loader);
} catch (ClassNotFoundException e) {
// ignore
}
}
return super.resolveClass(classDesc);
} | java | @Override
protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
for (ClassLoader loader : classLoaderRegistration) {
try {
return resolveClass(classDesc, loader);
} catch (ClassNotFoundException e) {
// ignore
}
}
return super.resolveClass(classDesc);
} | [
"@",
"Override",
"protected",
"Class",
"resolveClass",
"(",
"ObjectStreamClass",
"classDesc",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"for",
"(",
"ClassLoader",
"loader",
":",
"classLoaderRegistration",
")",
"{",
"try",
"{",
"return",
"reso... | Use the registered ClassLoaders to resolve and then use system class loader | [
"Use",
"the",
"registered",
"ClassLoaders",
"to",
"resolve",
"and",
"then",
"use",
"system",
"class",
"loader"
] | train | https://github.com/ryanbrainard/richsobjects/blob/d1af259d9098557c2abd53f94c20cc663cf9b6e7/richsobjects-cache-memcached/src/main/java/com/github/ryanbrainard/richsobjects/api/client/ClassLoaderRegisteringObjectInputStream.java#L49-L59 |
apereo/cas | support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java | MetadataUIUtils.locateMetadataUserInterfaceForEntityId | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final EntityDescriptor entityDescriptor, final String entityId,
final RegisteredService registeredService, final HttpServletRequest requestContext) {
val mdui = new SamlMetadataUIInfo(registeredService, requestContext.getLocale().getLanguage());
if (entityDescriptor == null) {
LOGGER.trace("Entity descriptor not found for [{}]", entityId);
return mdui;
}
val spssoDescriptor = getSPSsoDescriptor(entityDescriptor);
if (spssoDescriptor == null) {
LOGGER.trace("SP SSO descriptor not found for [{}]", entityId);
return mdui;
}
val extensions = spssoDescriptor.getExtensions();
if (extensions == null) {
LOGGER.trace("No extensions in the SP SSO descriptor are found for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
return mdui;
}
val spExtensions = extensions.getUnknownXMLObjects(UIInfo.DEFAULT_ELEMENT_NAME);
if (spExtensions.isEmpty()) {
LOGGER.trace("No extensions in the SP SSO descriptor are located for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
return mdui;
}
spExtensions.stream().filter(UIInfo.class::isInstance).forEach(obj -> {
val uiInfo = (UIInfo) obj;
LOGGER.trace("Found MDUI info for [{}]", entityId);
mdui.setUiInfo(uiInfo);
});
return mdui;
} | java | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final EntityDescriptor entityDescriptor, final String entityId,
final RegisteredService registeredService, final HttpServletRequest requestContext) {
val mdui = new SamlMetadataUIInfo(registeredService, requestContext.getLocale().getLanguage());
if (entityDescriptor == null) {
LOGGER.trace("Entity descriptor not found for [{}]", entityId);
return mdui;
}
val spssoDescriptor = getSPSsoDescriptor(entityDescriptor);
if (spssoDescriptor == null) {
LOGGER.trace("SP SSO descriptor not found for [{}]", entityId);
return mdui;
}
val extensions = spssoDescriptor.getExtensions();
if (extensions == null) {
LOGGER.trace("No extensions in the SP SSO descriptor are found for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
return mdui;
}
val spExtensions = extensions.getUnknownXMLObjects(UIInfo.DEFAULT_ELEMENT_NAME);
if (spExtensions.isEmpty()) {
LOGGER.trace("No extensions in the SP SSO descriptor are located for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
return mdui;
}
spExtensions.stream().filter(UIInfo.class::isInstance).forEach(obj -> {
val uiInfo = (UIInfo) obj;
LOGGER.trace("Found MDUI info for [{}]", entityId);
mdui.setUiInfo(uiInfo);
});
return mdui;
} | [
"public",
"static",
"SamlMetadataUIInfo",
"locateMetadataUserInterfaceForEntityId",
"(",
"final",
"EntityDescriptor",
"entityDescriptor",
",",
"final",
"String",
"entityId",
",",
"final",
"RegisteredService",
"registeredService",
",",
"final",
"HttpServletRequest",
"requestCont... | Locate mdui for entity id simple metadata ui info.
@param entityDescriptor the entity descriptor
@param entityId the entity id
@param registeredService the registered service
@param requestContext the request context
@return the simple metadata ui info | [
"Locate",
"mdui",
"for",
"entity",
"id",
"simple",
"metadata",
"ui",
"info",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java#L81-L109 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/builder/AbstractProcessorBuilder.java | AbstractProcessorBuilder.registerForConstraint | public <A extends Annotation> void registerForConstraint(final Class<A> anno, final ConstraintProcessorFactory<A> factory) {
this.constraintHandler.register(anno, factory);
} | java | public <A extends Annotation> void registerForConstraint(final Class<A> anno, final ConstraintProcessorFactory<A> factory) {
this.constraintHandler.register(anno, factory);
} | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"void",
"registerForConstraint",
"(",
"final",
"Class",
"<",
"A",
">",
"anno",
",",
"final",
"ConstraintProcessorFactory",
"<",
"A",
">",
"factory",
")",
"{",
"this",
".",
"constraintHandler",
".",
"register",
... | 制約のCellProcessorを作成するクラスを登録する。読み込み時と書き込み時は共通です。
@param <A> アノテーションのクラス
@param anno 関連づけるアノテーション
@param factory アノテーションを処理する{@link ConstraintProcessorFactory}の実装。 | [
"制約のCellProcessorを作成するクラスを登録する。読み込み時と書き込み時は共通です。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/AbstractProcessorBuilder.java#L215-L217 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | DTDAttribute.reportValidationProblem | protected String reportValidationProblem(InputProblemReporter rep, String msg)
throws XMLStreamException
{
rep.reportValidationProblem("Attribute definition '"+mName+"': "+msg);
return null;
} | java | protected String reportValidationProblem(InputProblemReporter rep, String msg)
throws XMLStreamException
{
rep.reportValidationProblem("Attribute definition '"+mName+"': "+msg);
return null;
} | [
"protected",
"String",
"reportValidationProblem",
"(",
"InputProblemReporter",
"rep",
",",
"String",
"msg",
")",
"throws",
"XMLStreamException",
"{",
"rep",
".",
"reportValidationProblem",
"(",
"\"Attribute definition '\"",
"+",
"mName",
"+",
"\"': \"",
"+",
"msg",
")... | Method called during parsing of DTD schema, to report a problem.
Note that unlike during actual validation, we have no option of
just gracefully listing problems and ignoring them; an exception
is always thrown. | [
"Method",
"called",
"during",
"parsing",
"of",
"DTD",
"schema",
"to",
"report",
"a",
"problem",
".",
"Note",
"that",
"unlike",
"during",
"actual",
"validation",
"we",
"have",
"no",
"option",
"of",
"just",
"gracefully",
"listing",
"problems",
"and",
"ignoring",... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java#L505-L510 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/generator/trace/internal/AbstractTrace.java | AbstractTrace.createLocationInResourceFor | protected ILocationInResource createLocationInResourceFor(ILocationData location, AbstractTraceRegion traceRegion) {
SourceRelativeURI path = location.getSrcRelativePath();
if (path == null)
path = traceRegion.getAssociatedSrcRelativePath();
if (path == null)
return null;
return createLocationInResource(location, path);
} | java | protected ILocationInResource createLocationInResourceFor(ILocationData location, AbstractTraceRegion traceRegion) {
SourceRelativeURI path = location.getSrcRelativePath();
if (path == null)
path = traceRegion.getAssociatedSrcRelativePath();
if (path == null)
return null;
return createLocationInResource(location, path);
} | [
"protected",
"ILocationInResource",
"createLocationInResourceFor",
"(",
"ILocationData",
"location",
",",
"AbstractTraceRegion",
"traceRegion",
")",
"{",
"SourceRelativeURI",
"path",
"=",
"location",
".",
"getSrcRelativePath",
"(",
")",
";",
"if",
"(",
"path",
"==",
"... | Creates a new location for a target resource that matches the given {@code location}.
@param location the location
@return the location in resource, <code>null</code> detecting a path fails. | [
"Creates",
"a",
"new",
"location",
"for",
"a",
"target",
"resource",
"that",
"matches",
"the",
"given",
"{"
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/generator/trace/internal/AbstractTrace.java#L221-L228 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java | CacheHeader.setExpires | public static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date) {
if (date == null) {
response.setHeader(HEADER_EXPIRES, "-1");
}
else {
response.setHeader(HEADER_EXPIRES, formatDate(date));
}
} | java | public static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date) {
if (date == null) {
response.setHeader(HEADER_EXPIRES, "-1");
}
else {
response.setHeader(HEADER_EXPIRES, formatDate(date));
}
} | [
"public",
"static",
"void",
"setExpires",
"(",
"@",
"NotNull",
"HttpServletResponse",
"response",
",",
"@",
"Nullable",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"response",
".",
"setHeader",
"(",
"HEADER_EXPIRES",
",",
"\"-1\"",
... | Set expires header to given date.
@param response Response
@param date Expires date | [
"Set",
"expires",
"header",
"to",
"given",
"date",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java#L218-L225 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLog.java | FileLog.writeRecord | public synchronized void writeRecord(byte[] record, String header) {
long length = record.length + nlen;
PrintStream ps = getPrintStream(length, header);
if (isWindows)
ps.write(record, 0, (int) length - 2);
else
ps.write(record, 0, (int) length - 1);
ps.println();
} | java | public synchronized void writeRecord(byte[] record, String header) {
long length = record.length + nlen;
PrintStream ps = getPrintStream(length, header);
if (isWindows)
ps.write(record, 0, (int) length - 2);
else
ps.write(record, 0, (int) length - 1);
ps.println();
} | [
"public",
"synchronized",
"void",
"writeRecord",
"(",
"byte",
"[",
"]",
"record",
",",
"String",
"header",
")",
"{",
"long",
"length",
"=",
"record",
".",
"length",
"+",
"nlen",
";",
"PrintStream",
"ps",
"=",
"getPrintStream",
"(",
"length",
",",
"header",... | Write a pre-formated record. This is used for when we have
signed and/or encrypted audit records.
@param record | [
"Write",
"a",
"pre",
"-",
"formated",
"record",
".",
"This",
"is",
"used",
"for",
"when",
"we",
"have",
"signed",
"and",
"/",
"or",
"encrypted",
"audit",
"records",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLog.java#L223-L232 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecuteSQLQueryBuilder.java | ExecuteSQLQueryBuilder.validate | public ExecuteSQLQueryBuilder validate(String column, String ... values) {
action.getControlResultSet().put(column, Arrays.asList(values));
return this;
} | java | public ExecuteSQLQueryBuilder validate(String column, String ... values) {
action.getControlResultSet().put(column, Arrays.asList(values));
return this;
} | [
"public",
"ExecuteSQLQueryBuilder",
"validate",
"(",
"String",
"column",
",",
"String",
"...",
"values",
")",
"{",
"action",
".",
"getControlResultSet",
"(",
")",
".",
"put",
"(",
"column",
",",
"Arrays",
".",
"asList",
"(",
"values",
")",
")",
";",
"retur... | Set expected control result set. Keys represent the column names, values
the expected values.
@param column
@param values | [
"Set",
"expected",
"control",
"result",
"set",
".",
"Keys",
"represent",
"the",
"column",
"names",
"values",
"the",
"expected",
"values",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ExecuteSQLQueryBuilder.java#L165-L168 |
hoegertn/restdoc-java-server | src/main/java/org/restdoc/server/impl/util/SchemaResolver.java | SchemaResolver.getSchemaFromType | public static String getSchemaFromType(final Type type, Map<String, Schema> schemaMap, IRestDocGeneratorExtension ext) {
String schema = SchemaResolver.getSchemaFromTypeOrNull(type, schemaMap, ext);
if (schema != null) {
return schema;
}
final String s = String.format("SchemaType %s is not annotated with RestDocSchema.", type);
throw new RestDocException(s);
} | java | public static String getSchemaFromType(final Type type, Map<String, Schema> schemaMap, IRestDocGeneratorExtension ext) {
String schema = SchemaResolver.getSchemaFromTypeOrNull(type, schemaMap, ext);
if (schema != null) {
return schema;
}
final String s = String.format("SchemaType %s is not annotated with RestDocSchema.", type);
throw new RestDocException(s);
} | [
"public",
"static",
"String",
"getSchemaFromType",
"(",
"final",
"Type",
"type",
",",
"Map",
"<",
"String",
",",
"Schema",
">",
"schemaMap",
",",
"IRestDocGeneratorExtension",
"ext",
")",
"{",
"String",
"schema",
"=",
"SchemaResolver",
".",
"getSchemaFromTypeOrNul... | same as getSchemaFromClassOrNull but throws {@link RestDocException} if no schema is found
@param type the type to scan
@param schemaMap the map to add the schema to
@param ext the IRestDocGeneratorExtension to invoke on new schema
@return the schema URI | [
"same",
"as",
"getSchemaFromClassOrNull",
"but",
"throws",
"{",
"@link",
"RestDocException",
"}",
"if",
"no",
"schema",
"is",
"found"
] | train | https://github.com/hoegertn/restdoc-java-server/blob/a9c86c21b59c7580c7997cc8a38e45928919b459/src/main/java/org/restdoc/server/impl/util/SchemaResolver.java#L44-L51 |
derari/cthul | matchers/src/main/java/org/cthul/matchers/diagnose/nested/NestedMatcher.java | NestedMatcher.nestedDescribe | protected void nestedDescribe(SelfDescribing nested, Description description, String message) {
Nested.describeTo(this, nested, description, message);
} | java | protected void nestedDescribe(SelfDescribing nested, Description description, String message) {
Nested.describeTo(this, nested, description, message);
} | [
"protected",
"void",
"nestedDescribe",
"(",
"SelfDescribing",
"nested",
",",
"Description",
"description",
",",
"String",
"message",
")",
"{",
"Nested",
".",
"describeTo",
"(",
"this",
",",
"nested",
",",
"description",
",",
"message",
")",
";",
"}"
] | Appends description of {@code s} to {@code d},
enclosed in parantheses if necessary.
@param description
@param nested
@param message | [
"Appends",
"description",
"of",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/nested/NestedMatcher.java#L37-L39 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/apis/CustomObjectsApi.java | CustomObjectsApi.deleteNamespacedCustomObjectAsync | public com.squareup.okhttp.Call deleteNamespacedCustomObjectAsync(String group, String version, String namespace, String plural, String name, V1DeleteOptions body, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, final ApiCallback<Object> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = deleteNamespacedCustomObjectValidateBeforeCall(group, version, namespace, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Object>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
} | java | public com.squareup.okhttp.Call deleteNamespacedCustomObjectAsync(String group, String version, String namespace, String plural, String name, V1DeleteOptions body, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, final ApiCallback<Object> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = deleteNamespacedCustomObjectValidateBeforeCall(group, version, namespace, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Object>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
} | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"deleteNamespacedCustomObjectAsync",
"(",
"String",
"group",
",",
"String",
"version",
",",
"String",
"namespace",
",",
"String",
"plural",
",",
"String",
"name",
",",
"V1DeleteOptions",
"body",
",",
... | (asynchronously)
Deletes the specified namespace scoped custom object
@param group the custom resource's group (required)
@param version the custom resource's version (required)
@param namespace The custom resource's namespace (required)
@param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. (required)
@param name the custom object's name (required)
@param body (required)
@param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional)
@param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional)
@param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. (optional)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializing the request body object | [
"(",
"asynchronously",
")",
"Deletes",
"the",
"specified",
"namespace",
"scoped",
"custom",
"object"
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/apis/CustomObjectsApi.java#L743-L768 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java | NodeUtil.isOriginalURI | @Deprecated
public static boolean isOriginalURI(Node node, String uri) {
if (node.getUri().equals(uri)) {
return true;
}
if (node.hasProperty(APM_ORIGINAL_URI)) {
return node.getProperties(APM_ORIGINAL_URI).iterator().next().getValue().equals(uri);
}
return false;
} | java | @Deprecated
public static boolean isOriginalURI(Node node, String uri) {
if (node.getUri().equals(uri)) {
return true;
}
if (node.hasProperty(APM_ORIGINAL_URI)) {
return node.getProperties(APM_ORIGINAL_URI).iterator().next().getValue().equals(uri);
}
return false;
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"isOriginalURI",
"(",
"Node",
"node",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"node",
".",
"getUri",
"(",
")",
".",
"equals",
"(",
"uri",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"no... | This method determines whether the supplied URI matches the
original URI on the node.
@param node The node
@param uri The URI
@return Whether the supplied URI is the same as the node's original
@deprecated Only used in original JavaAgent. Not to be used with OpenTracing. | [
"This",
"method",
"determines",
"whether",
"the",
"supplied",
"URI",
"matches",
"the",
"original",
"URI",
"on",
"the",
"node",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java#L80-L89 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.swapPivot | public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
// get swap row and col
int swapRow = diag;
int swapCol = diag;
double maxValue = Math.abs(source[diag][diag]);
int rows = source.length;
int cols = source[0].length;
double abs = 0;
double[] r = null;
for (int row = diag; row < rows; row++) {
r = source[row];
for (int col = diag; col < cols; col++) {
abs = Math.abs(r[col]);
if (abs > maxValue) {
maxValue = abs;
swapRow = row;
swapCol = col;
}
}
}
// swap rows and columns
if (swapRow != diag) {
swapRows(source, swapRow, diag);
swapRows(t, swapRow, diag);
}
if (swapCol != diag) {
swapCols(source, swapCol, diag);
swapCols(s, swapCol, diag);
}
} | java | public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
// get swap row and col
int swapRow = diag;
int swapCol = diag;
double maxValue = Math.abs(source[diag][diag]);
int rows = source.length;
int cols = source[0].length;
double abs = 0;
double[] r = null;
for (int row = diag; row < rows; row++) {
r = source[row];
for (int col = diag; col < cols; col++) {
abs = Math.abs(r[col]);
if (abs > maxValue) {
maxValue = abs;
swapRow = row;
swapCol = col;
}
}
}
// swap rows and columns
if (swapRow != diag) {
swapRows(source, swapRow, diag);
swapRows(t, swapRow, diag);
}
if (swapCol != diag) {
swapCols(source, swapCol, diag);
swapCols(s, swapCol, diag);
}
} | [
"public",
"static",
"void",
"swapPivot",
"(",
"double",
"[",
"]",
"[",
"]",
"source",
",",
"int",
"diag",
",",
"double",
"[",
"]",
"[",
"]",
"s",
",",
"double",
"[",
"]",
"[",
"]",
"t",
")",
"{",
"// get swap row and col",
"int",
"swapRow",
"=",
"d... | Swap the matrices so that the largest value is on the pivot
@param source
the matrix to modify
@param diag
the position on the diagonal
@param s
the matrix s
@param t
the matrix t | [
"Swap",
"the",
"matrices",
"so",
"that",
"the",
"largest",
"value",
"is",
"on",
"the",
"pivot"
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L818-L848 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(MarkerOptions markerOptions, GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage);
return setFeatureStyle(markerOptions, featureStyleExtension, featureRow, density, iconCache);
} | java | public static boolean setFeatureStyle(MarkerOptions markerOptions, GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage);
return setFeatureStyle(markerOptions, featureStyleExtension, featureRow, density, iconCache);
} | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"MarkerOptions",
"markerOptions",
",",
"GeoPackage",
"geoPackage",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
",",
"IconCache",
"iconCache",
")",
"{",
"FeatureStyleExtension",
"featureStyleExtension",
... | Set the feature row style (icon or style) into the marker options
@param markerOptions marker options
@param geoPackage GeoPackage
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@param iconCache icon cache
@return true if icon or style was set into the marker options | [
"Set",
"the",
"feature",
"row",
"style",
"(",
"icon",
"or",
"style",
")",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L79-L84 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.addRelationType | public CmsRelationType addRelationType(String name, String type) throws CmsConfigurationException {
// check if new relation types can still be added
if (m_frozen) {
throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
}
CmsRelationType relationType = new CmsRelationType(m_configuredRelationTypes.size(), name, type);
m_configuredRelationTypes.add(relationType);
return relationType;
} | java | public CmsRelationType addRelationType(String name, String type) throws CmsConfigurationException {
// check if new relation types can still be added
if (m_frozen) {
throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
}
CmsRelationType relationType = new CmsRelationType(m_configuredRelationTypes.size(), name, type);
m_configuredRelationTypes.add(relationType);
return relationType;
} | [
"public",
"CmsRelationType",
"addRelationType",
"(",
"String",
"name",
",",
"String",
"type",
")",
"throws",
"CmsConfigurationException",
"{",
"// check if new relation types can still be added",
"if",
"(",
"m_frozen",
")",
"{",
"throw",
"new",
"CmsConfigurationException",
... | Adds a new relation type from the XML configuration to the list of user defined relation types.<p>
@param name the name of the relation type
@param type the type of the relation type, weak or strong
@return the new created relation type instance
@throws CmsConfigurationException in case the resource manager configuration is already initialized | [
"Adds",
"a",
"new",
"relation",
"type",
"from",
"the",
"XML",
"configuration",
"to",
"the",
"list",
"of",
"user",
"defined",
"relation",
"types",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L526-L536 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java | JdbcAccessImpl.harvestReturnValue | private void harvestReturnValue(
Object obj,
CallableStatement callable,
FieldDescriptor fmd,
int index)
throws PersistenceBrokerSQLException
{
try
{
// If we have a field descriptor, then we can harvest
// the return value.
if ((callable != null) && (fmd != null) && (obj != null))
{
// Get the value and convert it to it's appropriate
// java type.
Object value = fmd.getJdbcType().getObjectFromColumn(callable, index);
// Set the value of the persistent field.
fmd.getPersistentField().set(obj, fmd.getFieldConversion().sqlToJava(value));
}
}
catch (SQLException e)
{
String msg = "SQLException during the execution of harvestReturnValue"
+ " class="
+ obj.getClass().getName()
+ ","
+ " field="
+ fmd.getAttributeName()
+ " : "
+ e.getMessage();
logger.error(msg,e);
throw new PersistenceBrokerSQLException(msg, e);
}
} | java | private void harvestReturnValue(
Object obj,
CallableStatement callable,
FieldDescriptor fmd,
int index)
throws PersistenceBrokerSQLException
{
try
{
// If we have a field descriptor, then we can harvest
// the return value.
if ((callable != null) && (fmd != null) && (obj != null))
{
// Get the value and convert it to it's appropriate
// java type.
Object value = fmd.getJdbcType().getObjectFromColumn(callable, index);
// Set the value of the persistent field.
fmd.getPersistentField().set(obj, fmd.getFieldConversion().sqlToJava(value));
}
}
catch (SQLException e)
{
String msg = "SQLException during the execution of harvestReturnValue"
+ " class="
+ obj.getClass().getName()
+ ","
+ " field="
+ fmd.getAttributeName()
+ " : "
+ e.getMessage();
logger.error(msg,e);
throw new PersistenceBrokerSQLException(msg, e);
}
} | [
"private",
"void",
"harvestReturnValue",
"(",
"Object",
"obj",
",",
"CallableStatement",
"callable",
",",
"FieldDescriptor",
"fmd",
",",
"int",
"index",
")",
"throws",
"PersistenceBrokerSQLException",
"{",
"try",
"{",
"// If we have a field descriptor, then we can harvest\r... | Harvest a single value that was returned by a callable statement.
@param obj the object that will receive the value that is harvested.
@param callable the CallableStatement that contains the value to harvest
@param fmd the FieldDescriptor that identifies the field where the
harvested value will be stord.
@param index the parameter index.
@throws PersistenceBrokerSQLException if a problem occurs. | [
"Harvest",
"a",
"single",
"value",
"that",
"was",
"returned",
"by",
"a",
"callable",
"statement",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java#L704-L740 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/DistributedSchedulingLock.java | DistributedSchedulingLock.getDistributedScheduleByType | public static DistributedSchedulingLock getDistributedScheduleByType(EntityManager em, long type) {
requireArgument(em != null, "Entity manager can not be null.");
TypedQuery<DistributedSchedulingLock> query = em.createNamedQuery("DistributedSchedulingLock.GetEntryById", DistributedSchedulingLock.class);
query.setHint(QueryHints.REFRESH, HintValues.TRUE);
try {
query.setParameter("type", type);
return query.getSingleResult();
} catch (NoResultException ex) {
return null;
}
} | java | public static DistributedSchedulingLock getDistributedScheduleByType(EntityManager em, long type) {
requireArgument(em != null, "Entity manager can not be null.");
TypedQuery<DistributedSchedulingLock> query = em.createNamedQuery("DistributedSchedulingLock.GetEntryById", DistributedSchedulingLock.class);
query.setHint(QueryHints.REFRESH, HintValues.TRUE);
try {
query.setParameter("type", type);
return query.getSingleResult();
} catch (NoResultException ex) {
return null;
}
} | [
"public",
"static",
"DistributedSchedulingLock",
"getDistributedScheduleByType",
"(",
"EntityManager",
"em",
",",
"long",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager can not be null.\"",
")",
";",
"TypedQuery",
"<",
"DistributedS... | Obtains a distributed schedule object of a given type.
@param em The entity manager to use. Cannot be null.
@param type The scheduling type represented as a long value.
@return The distributed schedule object of a given type. | [
"Obtains",
"a",
"distributed",
"schedule",
"object",
"of",
"a",
"given",
"type",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/DistributedSchedulingLock.java#L125-L136 |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java | Input.withAudioSelectors | public Input withAudioSelectors(java.util.Map<String, AudioSelector> audioSelectors) {
setAudioSelectors(audioSelectors);
return this;
} | java | public Input withAudioSelectors(java.util.Map<String, AudioSelector> audioSelectors) {
setAudioSelectors(audioSelectors);
return this;
} | [
"public",
"Input",
"withAudioSelectors",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AudioSelector",
">",
"audioSelectors",
")",
"{",
"setAudioSelectors",
"(",
"audioSelectors",
")",
";",
"return",
"this",
";",
"}"
] | Use Audio selectors (AudioSelectors) to specify a track or set of tracks from the input that you will use in your
outputs. You can use mutiple Audio selectors per input.
@param audioSelectors
Use Audio selectors (AudioSelectors) to specify a track or set of tracks from the input that you will use
in your outputs. You can use mutiple Audio selectors per input.
@return Returns a reference to this object so that method calls can be chained together. | [
"Use",
"Audio",
"selectors",
"(",
"AudioSelectors",
")",
"to",
"specify",
"a",
"track",
"or",
"set",
"of",
"tracks",
"from",
"the",
"input",
"that",
"you",
"will",
"use",
"in",
"your",
"outputs",
".",
"You",
"can",
"use",
"mutiple",
"Audio",
"selectors",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java#L219-L222 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlPkStatement.java | SqlPkStatement.appendWhereClause | protected void appendWhereClause(ClassDescriptor cld, boolean useLocking, StringBuffer stmt)
{
FieldDescriptor[] pkFields = cld.getPkFields();
FieldDescriptor[] fields;
fields = pkFields;
if(useLocking)
{
FieldDescriptor[] lockingFields = cld.getLockingFields();
if(lockingFields.length > 0)
{
fields = new FieldDescriptor[pkFields.length + lockingFields.length];
System.arraycopy(pkFields, 0, fields, 0, pkFields.length);
System.arraycopy(lockingFields, 0, fields, pkFields.length, lockingFields.length);
}
}
appendWhereClause(fields, stmt);
} | java | protected void appendWhereClause(ClassDescriptor cld, boolean useLocking, StringBuffer stmt)
{
FieldDescriptor[] pkFields = cld.getPkFields();
FieldDescriptor[] fields;
fields = pkFields;
if(useLocking)
{
FieldDescriptor[] lockingFields = cld.getLockingFields();
if(lockingFields.length > 0)
{
fields = new FieldDescriptor[pkFields.length + lockingFields.length];
System.arraycopy(pkFields, 0, fields, 0, pkFields.length);
System.arraycopy(lockingFields, 0, fields, pkFields.length, lockingFields.length);
}
}
appendWhereClause(fields, stmt);
} | [
"protected",
"void",
"appendWhereClause",
"(",
"ClassDescriptor",
"cld",
",",
"boolean",
"useLocking",
",",
"StringBuffer",
"stmt",
")",
"{",
"FieldDescriptor",
"[",
"]",
"pkFields",
"=",
"cld",
".",
"getPkFields",
"(",
")",
";",
"FieldDescriptor",
"[",
"]",
"... | Generate a where clause for a prepared Statement.
Only primary key and locking fields are used in this where clause
@param cld the ClassDescriptor
@param useLocking true if locking fields should be included
@param stmt the StatementBuffer | [
"Generate",
"a",
"where",
"clause",
"for",
"a",
"prepared",
"Statement",
".",
"Only",
"primary",
"key",
"and",
"locking",
"fields",
"are",
"used",
"in",
"this",
"where",
"clause"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlPkStatement.java#L107-L125 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java | CollisionCategoryConfig.exports | public static void exports(Xml root, CollisionCategory category)
{
Check.notNull(root);
Check.notNull(category);
final Xml node = root.createChild(NODE_CATEGORY);
node.writeString(ATT_NAME, category.getName());
node.writeString(ATT_AXIS, category.getAxis().name());
node.writeInteger(ATT_X, category.getOffsetX());
node.writeInteger(ATT_Y, category.getOffsetY());
node.writeBoolean(ATT_GLUE, category.isGlue());
for (final CollisionGroup group : category.getGroups())
{
final Xml groupNode = node.createChild(TileGroupsConfig.NODE_GROUP);
groupNode.setText(group.getName());
}
} | java | public static void exports(Xml root, CollisionCategory category)
{
Check.notNull(root);
Check.notNull(category);
final Xml node = root.createChild(NODE_CATEGORY);
node.writeString(ATT_NAME, category.getName());
node.writeString(ATT_AXIS, category.getAxis().name());
node.writeInteger(ATT_X, category.getOffsetX());
node.writeInteger(ATT_Y, category.getOffsetY());
node.writeBoolean(ATT_GLUE, category.isGlue());
for (final CollisionGroup group : category.getGroups())
{
final Xml groupNode = node.createChild(TileGroupsConfig.NODE_GROUP);
groupNode.setText(group.getName());
}
} | [
"public",
"static",
"void",
"exports",
"(",
"Xml",
"root",
",",
"CollisionCategory",
"category",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"category",
")",
";",
"final",
"Xml",
"node",
"=",
"root",
".",
"cr... | Export the collision category data as a node.
@param root The node root (must not be <code>null</code>).
@param category The collision category to export (must not be <code>null</code>).
@throws LionEngineException If error on writing. | [
"Export",
"the",
"collision",
"category",
"data",
"as",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java#L168-L185 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java | PhotosetsInterface.getList | public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException {
return getList(userId, 0, 0, primaryPhotoExtras);
} | java | public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException {
return getList(userId, 0, 0, primaryPhotoExtras);
} | [
"public",
"Photosets",
"getList",
"(",
"String",
"userId",
",",
"String",
"primaryPhotoExtras",
")",
"throws",
"FlickrException",
"{",
"return",
"getList",
"(",
"userId",
",",
"0",
",",
"0",
",",
"primaryPhotoExtras",
")",
";",
"}"
] | Get a list of all photosets for the specified user.
This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated.
@param userId
The User id
@param primaryPhotoExtras
A comma-delimited list of extra information to fetch for the primary photo
@return The Photosets collection
@throws FlickrException | [
"Get",
"a",
"list",
"of",
"all",
"photosets",
"for",
"the",
"specified",
"user",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java#L329-L331 |
spotbugs/spotbugs | eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java | ASTUtil.getFieldDeclaration | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, String fieldName)
throws FieldDeclarationNotFoundException {
requireNonNull(type, "type declaration");
requireNonNull(fieldName, "field name");
for (FieldDeclaration field : type.getFields()) {
for (Object fragObj : field.fragments()) {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragObj;
if (fieldName.equals(fragment.getName().getIdentifier())) {
return field;
}
}
}
throw new FieldDeclarationNotFoundException(type, fieldName);
} | java | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, String fieldName)
throws FieldDeclarationNotFoundException {
requireNonNull(type, "type declaration");
requireNonNull(fieldName, "field name");
for (FieldDeclaration field : type.getFields()) {
for (Object fragObj : field.fragments()) {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragObj;
if (fieldName.equals(fragment.getName().getIdentifier())) {
return field;
}
}
}
throw new FieldDeclarationNotFoundException(type, fieldName);
} | [
"public",
"static",
"FieldDeclaration",
"getFieldDeclaration",
"(",
"TypeDeclaration",
"type",
",",
"String",
"fieldName",
")",
"throws",
"FieldDeclarationNotFoundException",
"{",
"requireNonNull",
"(",
"type",
",",
"\"type declaration\"",
")",
";",
"requireNonNull",
"(",... | Returns the <CODE>FieldDeclaration</CODE> for the specified field name.
The field has to be declared in the specified
<CODE>TypeDeclaration</CODE>.
@param type
The <CODE>TypeDeclaration</CODE>, where the
<CODE>FieldDeclaration</CODE> is declared in.
@param fieldName
The simple field name to search for.
@return the <CODE>FieldDeclaration</CODE> found in the specified
<CODE>TypeDeclaration</CODE>.
@throws FieldDeclarationNotFoundException
if no matching <CODE>FieldDeclaration</CODE> was found. | [
"Returns",
"the",
"<CODE",
">",
"FieldDeclaration<",
"/",
"CODE",
">",
"for",
"the",
"specified",
"field",
"name",
".",
"The",
"field",
"has",
"to",
"be",
"declared",
"in",
"the",
"specified",
"<CODE",
">",
"TypeDeclaration<",
"/",
"CODE",
">",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L305-L320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.