repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.checkImage | public void checkImage(IFD ifd, int n, IfdTags metadata) {
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("PhotometricInterpretation"))) {
validation.addErrorLoc("Missing Photometric Interpretation", "IFD" + n);
} else if (metadata.get(TiffTags.getTagId("Photometri... | java | public void checkImage(IFD ifd, int n, IfdTags metadata) {
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("PhotometricInterpretation"))) {
validation.addErrorLoc("Missing Photometric Interpretation", "IFD" + n);
} else if (metadata.get(TiffTags.getTagId("Photometri... | [
"public",
"void",
"checkImage",
"(",
"IFD",
"ifd",
",",
"int",
"n",
",",
"IfdTags",
"metadata",
")",
"{",
"CheckCommonFields",
"(",
"ifd",
",",
"n",
",",
"metadata",
")",
";",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"get... | Check if the tags that define the image are correct and consistent.
@param ifd the ifd
@param n the ifd number
@param metadata the ifd metadata | [
"Check",
"if",
"the",
"tags",
"that",
"define",
"the",
"image",
"are",
"correct",
"and",
"consistent",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L193-L246 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.moveAll | public void moveAll(ParticleEmitter emitter, float x, float y) {
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
pool.particles[i].move(x, y);
}
}
} | java | public void moveAll(ParticleEmitter emitter, float x, float y) {
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
pool.particles[i].move(x, y);
}
}
} | [
"public",
"void",
"moveAll",
"(",
"ParticleEmitter",
"emitter",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePool",
")",
"particlesByEmitter",
".",
"get",
"(",
"emitter",
")",
";",
"for",
"(",
"int",
"i",
"="... | Move all the particles owned by the specified emitter
@param emitter The emitter owning the particles that should be released
@param x The amount on the x axis to move the particles
@param y The amount on the y axis to move the particles | [
"Move",
"all",
"the",
"particles",
"owned",
"by",
"the",
"specified",
"emitter"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L607-L614 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java | BuildTool.buildMeta | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
if(params instanceof Map){
buildMapMeta( writer , indexType, indexName, (Map) params, action, clientOption, upper7);
return;
}
Obje... | java | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
if(params instanceof Map){
buildMapMeta( writer , indexType, indexName, (Map) params, action, clientOption, upper7);
return;
}
Obje... | [
"public",
"static",
"void",
"buildMeta",
"(",
"Writer",
"writer",
",",
"String",
"indexType",
",",
"String",
"indexName",
",",
"Object",
"params",
",",
"String",
"action",
",",
"ClientOptions",
"clientOption",
",",
"boolean",
"upper7",
")",
"throws",
"IOExceptio... | String docIdKey,String parentIdKey,String routingKey
@param writer
@param indexType
@param indexName
@param params
@param action
@throws IOException | [
"String",
"docIdKey",
"String",
"parentIdKey",
"String",
"routingKey"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java#L347-L369 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java | ODataRendererUtils.getContextURL | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataRenderException {
return getContextURL(oDataUri, entityDataModel, false);
} | java | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataRenderException {
return getContextURL(oDataUri, entityDataModel, false);
} | [
"public",
"static",
"String",
"getContextURL",
"(",
"ODataUri",
"oDataUri",
",",
"EntityDataModel",
"entityDataModel",
")",
"throws",
"ODataRenderException",
"{",
"return",
"getContextURL",
"(",
"oDataUri",
",",
"entityDataModel",
",",
"false",
")",
";",
"}"
] | This method returns odata context based on oDataUri.
Throws ODataRenderException in case context is not defined.
@param entityDataModel The entity data model.
@param oDataUri is object which is the root of an abstract syntax tree that describes
@return string that represents context
@throws ODataRenderException... | [
"This",
"method",
"returns",
"odata",
"context",
"based",
"on",
"oDataUri",
".",
"Throws",
"ODataRenderException",
"in",
"case",
"context",
"is",
"not",
"defined",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L51-L53 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/WritableName.java | WritableName.setName | public static synchronized void setName(Class writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | java | public static synchronized void setName(Class writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | [
"public",
"static",
"synchronized",
"void",
"setName",
"(",
"Class",
"writableClass",
",",
"String",
"name",
")",
"{",
"CLASS_TO_NAME",
".",
"put",
"(",
"writableClass",
",",
"name",
")",
";",
"NAME_TO_CLASS",
".",
"put",
"(",
"name",
",",
"writableClass",
"... | Set the name that a class should be known as to something other than the
class name. | [
"Set",
"the",
"name",
"that",
"a",
"class",
"should",
"be",
"known",
"as",
"to",
"something",
"other",
"than",
"the",
"class",
"name",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/WritableName.java#L46-L49 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.isNumber | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class })
public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) {
Check.notNull(value, "value");
Check.notNull(type, "type");
final Number ... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class })
public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) {
Check.notNull(value, "value");
Check.notNull(type, "type");
final Number ... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNumberArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Number",
">",
"T",
"isNumber",
"(",
"@",
"Nonnull",
"final",
... | Ensures that a String argument is a number. This overload supports all subclasses of {@code Number}. The number
is first converted to a {@code BigDecimal} or {@code BigInteger}. Floating point types are only supported if the
{@code type} is one of {@code Float, Double, BigDecimal}.
<p>
This method does also check agai... | [
"Ensures",
"that",
"a",
"String",
"argument",
"is",
"a",
"number",
".",
"This",
"overload",
"supports",
"all",
"subclasses",
"of",
"{",
"@code",
"Number",
"}",
".",
"The",
"number",
"is",
"first",
"converted",
"to",
"a",
"{",
"@code",
"BigDecimal",
"}",
... | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1294-L1312 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java | WatchedDoubleStepQREigen_DDRM.exceptionalShift | public void exceptionalShift( int x1 , int x2) {
if( printHumps )
System.out.println("Performing exceptional implicit double step");
// perform a random shift that is of the same magnitude as the matrix
double val = Math.abs(A.get(x2,x2));
if( val == 0 )
val = ... | java | public void exceptionalShift( int x1 , int x2) {
if( printHumps )
System.out.println("Performing exceptional implicit double step");
// perform a random shift that is of the same magnitude as the matrix
double val = Math.abs(A.get(x2,x2));
if( val == 0 )
val = ... | [
"public",
"void",
"exceptionalShift",
"(",
"int",
"x1",
",",
"int",
"x2",
")",
"{",
"if",
"(",
"printHumps",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"Performing exceptional implicit double step\"",
")",
";",
"// perform a random shift that is of the same mag... | Perform a shift in a random direction that is of the same magnitude as the elements in the matrix. | [
"Perform",
"a",
"shift",
"in",
"a",
"random",
"direction",
"that",
"is",
"of",
"the",
"same",
"magnitude",
"as",
"the",
"elements",
"in",
"the",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java#L166-L187 |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/OptionsBuilder.java | OptionsBuilder.addStep | public void addStep(String name, String robot, Map<String, Object> options){
steps.addStep(name, robot, options);
} | java | public void addStep(String name, String robot, Map<String, Object> options){
steps.addStep(name, robot, options);
} | [
"public",
"void",
"addStep",
"(",
"String",
"name",
",",
"String",
"robot",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"steps",
".",
"addStep",
"(",
"name",
",",
"robot",
",",
"options",
")",
";",
"}"
] | Adds a step to the steps.
@param name {@link String} name of the step
@param robot {@link String} name of the robot used by the step.
@param options {@link Map} extra options required for the step. | [
"Adds",
"a",
"step",
"to",
"the",
"steps",
"."
] | train | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/OptionsBuilder.java#L20-L22 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.createOdataFilterForTags | public static String createOdataFilterForTags(String tagName, String tagValue) {
if (tagName == null) {
return null;
} else if (tagValue == null) {
return String.format("tagname eq '%s'", tagName);
} else {
return String.format("tagname eq '%s' and tagvalue eq... | java | public static String createOdataFilterForTags(String tagName, String tagValue) {
if (tagName == null) {
return null;
} else if (tagValue == null) {
return String.format("tagname eq '%s'", tagName);
} else {
return String.format("tagname eq '%s' and tagvalue eq... | [
"public",
"static",
"String",
"createOdataFilterForTags",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"if",
"(",
"tagName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"tagValue",
"==",
"null",
")",
"{",
"ret... | Creates an Odata filter string that can be used for filtering list results by tags.
@param tagName the name of the tag. If not provided, all resources will be returned.
@param tagValue the value of the tag. If not provided, only tag name will be filtered.
@return the Odata filter to pass into list methods | [
"Creates",
"an",
"Odata",
"filter",
"string",
"that",
"can",
"be",
"used",
"for",
"filtering",
"list",
"results",
"by",
"tags",
"."
] | 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#L90-L98 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java | CmsVfsTabHandler.getSubFolders | public void getSubFolders(String path, AsyncCallback<List<CmsVfsEntryBean>> callback) {
m_controller.getSubFolders(path, callback);
} | java | public void getSubFolders(String path, AsyncCallback<List<CmsVfsEntryBean>> callback) {
m_controller.getSubFolders(path, callback);
} | [
"public",
"void",
"getSubFolders",
"(",
"String",
"path",
",",
"AsyncCallback",
"<",
"List",
"<",
"CmsVfsEntryBean",
">",
">",
"callback",
")",
"{",
"m_controller",
".",
"getSubFolders",
"(",
"path",
",",
"callback",
")",
";",
"}"
] | Gets the sub-folders of a given folder.<p>
@param path the path of the folder whose subfolders should be retrieved
@param callback the callback for processing the subfolders | [
"Gets",
"the",
"sub",
"-",
"folders",
"of",
"a",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java#L123-L126 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Rot.java | Rot.encodeChar | private static char encodeChar(char c, int offset, boolean isDecodeNumber) {
if (isDecodeNumber) {
if (c >= CHAR0 && c <= CHAR9) {
c -= CHAR0;
c = (char) ((c + offset) % 10);
c += CHAR0;
}
}
// A == 65, Z == 90
if (c >= ACHAR && c <= ZCHAR) {
c -= ACHAR;
c = (char) ((c + off... | java | private static char encodeChar(char c, int offset, boolean isDecodeNumber) {
if (isDecodeNumber) {
if (c >= CHAR0 && c <= CHAR9) {
c -= CHAR0;
c = (char) ((c + offset) % 10);
c += CHAR0;
}
}
// A == 65, Z == 90
if (c >= ACHAR && c <= ZCHAR) {
c -= ACHAR;
c = (char) ((c + off... | [
"private",
"static",
"char",
"encodeChar",
"(",
"char",
"c",
",",
"int",
"offset",
",",
"boolean",
"isDecodeNumber",
")",
"{",
"if",
"(",
"isDecodeNumber",
")",
"{",
"if",
"(",
"c",
">=",
"CHAR0",
"&&",
"c",
"<=",
"CHAR9",
")",
"{",
"c",
"-=",
"CHAR0... | 解码字符
@param c 字符
@param offset 位移
@param isDecodeNumber 是否解码数字
@return 解码后的字符串 | [
"解码字符"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Rot.java#L106-L128 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java | PropertyBuilder.buildSignature | public void buildSignature(XMLNode node, Content propertyDocTree) {
propertyDocTree.addContent(writer.getSignature(currentProperty));
} | java | public void buildSignature(XMLNode node, Content propertyDocTree) {
propertyDocTree.addContent(writer.getSignature(currentProperty));
} | [
"public",
"void",
"buildSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"propertyDocTree",
")",
"{",
"propertyDocTree",
".",
"addContent",
"(",
"writer",
".",
"getSignature",
"(",
"currentProperty",
")",
")",
";",
"}"
] | Build the signature.
@param node the XML element that specifies which components to document
@param propertyDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java#L164-L166 |
cubedtear/aritzh | aritzh-gameEngine/src/main/java/io/github/aritzhack/aritzh/awt/util/SpriteUtil.java | SpriteUtil.rotate90 | public static Sprite rotate90(Sprite original, Rotation angle) {
int newWidth = angle == Rotation._180 ? original.getWidth() : original.getHeight();
int newHeight = angle == Rotation._180 ? original.getHeight() : original.getWidth();
int[] newPix = new int[original.getPixels().length];
for (int x = 0; x < orig... | java | public static Sprite rotate90(Sprite original, Rotation angle) {
int newWidth = angle == Rotation._180 ? original.getWidth() : original.getHeight();
int newHeight = angle == Rotation._180 ? original.getHeight() : original.getWidth();
int[] newPix = new int[original.getPixels().length];
for (int x = 0; x < orig... | [
"public",
"static",
"Sprite",
"rotate90",
"(",
"Sprite",
"original",
",",
"Rotation",
"angle",
")",
"{",
"int",
"newWidth",
"=",
"angle",
"==",
"Rotation",
".",
"_180",
"?",
"original",
".",
"getWidth",
"(",
")",
":",
"original",
".",
"getHeight",
"(",
"... | Rotates an image by multiples of 90 degrees
This is a much faster version of
{@link io.github.aritzhack.aritzh.awt.util.SpriteUtil#rotate(io.github.aritzhack.aritzh.awt.render.Sprite, double) SpriteUtil.rotate(Sprite, double)}
@param original The sprite to rotate
@param angle The rotation angle
@return The rotated ... | [
"Rotates",
"an",
"image",
"by",
"multiples",
"of",
"90",
"degrees",
"This",
"is",
"a",
"much",
"faster",
"version",
"of",
"{",
"@link",
"io",
".",
"github",
".",
"aritzhack",
".",
"aritzh",
".",
"awt",
".",
"util",
".",
"SpriteUtil#rotate",
"(",
"io",
... | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-gameEngine/src/main/java/io/github/aritzhack/aritzh/awt/util/SpriteUtil.java#L367-L381 |
tvesalainen/util | security/src/main/java/org/vesalainen/net/ssl/SSLServerSocketChannel.java | SSLServerSocketChannel.open | public static SSLServerSocketChannel open(int port, SSLContext sslContext) throws IOException
{
return open(new InetSocketAddress(port), sslContext);
} | java | public static SSLServerSocketChannel open(int port, SSLContext sslContext) throws IOException
{
return open(new InetSocketAddress(port), sslContext);
} | [
"public",
"static",
"SSLServerSocketChannel",
"open",
"(",
"int",
"port",
",",
"SSLContext",
"sslContext",
")",
"throws",
"IOException",
"{",
"return",
"open",
"(",
"new",
"InetSocketAddress",
"(",
"port",
")",
",",
"sslContext",
")",
";",
"}"
] | Creates and binds SSLServerSocketChannel using given SSLContext.
@param port
@param sslContext
@return
@throws IOException | [
"Creates",
"and",
"binds",
"SSLServerSocketChannel",
"using",
"given",
"SSLContext",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/security/src/main/java/org/vesalainen/net/ssl/SSLServerSocketChannel.java#L94-L97 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/DataTracker.java | DataTracker.markCompactedSSTablesReplaced | public void markCompactedSSTablesReplaced(Collection<SSTableReader> oldSSTables, Collection<SSTableReader> allReplacements, OperationType compactionType)
{
removeSSTablesFromTracker(oldSSTables);
releaseReferences(oldSSTables, false);
notifySSTablesChanged(oldSSTables, allReplacements, compa... | java | public void markCompactedSSTablesReplaced(Collection<SSTableReader> oldSSTables, Collection<SSTableReader> allReplacements, OperationType compactionType)
{
removeSSTablesFromTracker(oldSSTables);
releaseReferences(oldSSTables, false);
notifySSTablesChanged(oldSSTables, allReplacements, compa... | [
"public",
"void",
"markCompactedSSTablesReplaced",
"(",
"Collection",
"<",
"SSTableReader",
">",
"oldSSTables",
",",
"Collection",
"<",
"SSTableReader",
">",
"allReplacements",
",",
"OperationType",
"compactionType",
")",
"{",
"removeSSTablesFromTracker",
"(",
"oldSSTable... | that they have been replaced by the provided sstables, which must have been performed by an earlier replaceReaders() call | [
"that",
"they",
"have",
"been",
"replaced",
"by",
"the",
"provided",
"sstables",
"which",
"must",
"have",
"been",
"performed",
"by",
"an",
"earlier",
"replaceReaders",
"()",
"call"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L275-L281 |
apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.compareTo | public int compareTo(byte[] bytes, int offset, int len) {
Preconditions.checkArgument(offset >= 0 && len >= 0 && offset + len <= bytes.length);
return compareToUnchecked(bytes, offset, len);
} | java | public int compareTo(byte[] bytes, int offset, int len) {
Preconditions.checkArgument(offset >= 0 && len >= 0 && offset + len <= bytes.length);
return compareToUnchecked(bytes, offset, len);
} | [
"public",
"int",
"compareTo",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"offset",
">=",
"0",
"&&",
"len",
">=",
"0",
"&&",
"offset",
"+",
"len",
"<=",
"bytes",
".",
... | Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result
if the first sequence is less than, equal to, or greater than the second. The comparison is
performed starting with the first byte of each sequence, and proceeds until a pair of bytes
differs, or one sequence runs out of byt... | [
"Compares",
"this",
"to",
"the",
"passed",
"bytes",
"byte",
"by",
"byte",
"returning",
"a",
"negative",
"zero",
"or",
"positive",
"result",
"if",
"the",
"first",
"sequence",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
"."... | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L233-L236 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Base64Util.java | Base64Util.encodeString | public static String encodeString(final String string, final String encoding) throws
UnsupportedEncodingException {
byte[] stringBytes = string.getBytes(encoding);
return encode(stringBytes);
} | java | public static String encodeString(final String string, final String encoding) throws
UnsupportedEncodingException {
byte[] stringBytes = string.getBytes(encoding);
return encode(stringBytes);
} | [
"public",
"static",
"String",
"encodeString",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"byte",
"[",
"]",
"stringBytes",
"=",
"string",
".",
"getBytes",
"(",
"encoding",
")",
";",
... | Encodes a string into Base64 format. No blanks or line breaks are inserted.
@param string a String to be encoded.
@param encoding The character encoding of the string.
@return A String with the Base64 encoded data.
@throws UnsupportedEncodingException if the java runtime does not support <code>encoding</code>. | [
"Encodes",
"a",
"string",
"into",
"Base64",
"format",
".",
"No",
"blanks",
"or",
"line",
"breaks",
"are",
"inserted",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Base64Util.java#L102-L106 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addHours | public static Date addHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | java | public static Date addHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addHours",
"(",
"Date",
"d",
",",
"int",
"hours",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"HOU... | Add hours to a date
@param d date
@param hours hours
@return new date | [
"Add",
"hours",
"to",
"a",
"date"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L457-L462 |
qspin/qtaste | plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/TabGetter.java | TabGetter.executeCommand | @Override
public String executeCommand(int timeout, String componentName, Object... data) throws QTasteException {
Component component = getComponentByName(componentName);
// sanity checks
if (component == null) {
throw new QTasteTestFailException("Unable to find the component ... | java | @Override
public String executeCommand(int timeout, String componentName, Object... data) throws QTasteException {
Component component = getComponentByName(componentName);
// sanity checks
if (component == null) {
throw new QTasteTestFailException("Unable to find the component ... | [
"@",
"Override",
"public",
"String",
"executeCommand",
"(",
"int",
"timeout",
",",
"String",
"componentName",
",",
"Object",
"...",
"data",
")",
"throws",
"QTasteException",
"{",
"Component",
"component",
"=",
"getComponentByName",
"(",
"componentName",
")",
";",
... | Executes the a command on a component.
@param timeout a timeout for the command execution (not used here)
@param componentName name of the component to execute the command on.
@param data additional data (not used here)
@return the selected tab index, title or id, according to the specified info selector.
@throws QTas... | [
"Executes",
"the",
"a",
"command",
"on",
"a",
"component",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/TabGetter.java#L61-L102 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.requestAsMessages | private static MessageSet requestAsMessages(TextChannel channel, int limit, long before, long after) {
DiscordApiImpl api = (DiscordApiImpl) channel.getApi();
return new MessageSetImpl(
requestAsJsonNodes(channel, limit, before, after).stream()
.map(jsonNode -> ap... | java | private static MessageSet requestAsMessages(TextChannel channel, int limit, long before, long after) {
DiscordApiImpl api = (DiscordApiImpl) channel.getApi();
return new MessageSetImpl(
requestAsJsonNodes(channel, limit, before, after).stream()
.map(jsonNode -> ap... | [
"private",
"static",
"MessageSet",
"requestAsMessages",
"(",
"TextChannel",
"channel",
",",
"int",
"limit",
",",
"long",
"before",
",",
"long",
"after",
")",
"{",
"DiscordApiImpl",
"api",
"=",
"(",
"DiscordApiImpl",
")",
"channel",
".",
"getApi",
"(",
")",
"... | Requests the messages from Discord.
@param channel The channel of which to get messages from.
@param limit The limit of messages to get.
@param before Get messages before the message with this id.
@param after Get messages after the message with this id.
@return The messages. | [
"Requests",
"the",
"messages",
"from",
"Discord",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L757-L763 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createEllipseInternal | private Shape createEllipseInternal(int x, int y, int w, int h) {
ellipse.setFrame(x, y, w, h);
return ellipse;
} | java | private Shape createEllipseInternal(int x, int y, int w, int h) {
ellipse.setFrame(x, y, w, h);
return ellipse;
} | [
"private",
"Shape",
"createEllipseInternal",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"ellipse",
".",
"setFrame",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
")",
";",
"return",
"ellipse",
";",
"}"
] | Return a path for an ellipse.
@param x the X coordinate of the upper-left corner of the ellipse
@param y the Y coordinate of the upper-left corner of the ellipse
@param w the width of the ellipse
@param h the height of the ellipse
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"an",
"ellipse",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L749-L753 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/ConfigHelper.java | ConfigHelper.setInputRange | public static void setInputRange(Configuration conf, String startToken, String endToken, List<IndexExpression> filter)
{
KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken).setRow_filter(filter);
conf.set(INPUT_KEYRANGE_CONFIG, thriftToString(range));
} | java | public static void setInputRange(Configuration conf, String startToken, String endToken, List<IndexExpression> filter)
{
KeyRange range = new KeyRange().setStart_token(startToken).setEnd_token(endToken).setRow_filter(filter);
conf.set(INPUT_KEYRANGE_CONFIG, thriftToString(range));
} | [
"public",
"static",
"void",
"setInputRange",
"(",
"Configuration",
"conf",
",",
"String",
"startToken",
",",
"String",
"endToken",
",",
"List",
"<",
"IndexExpression",
">",
"filter",
")",
"{",
"KeyRange",
"range",
"=",
"new",
"KeyRange",
"(",
")",
".",
"setS... | Set the KeyRange to limit the rows.
@param conf Job configuration you are about to run | [
"Set",
"the",
"KeyRange",
"to",
"limit",
"the",
"rows",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L254-L258 |
adyliu/jafka | src/main/java/io/jafka/server/ServerRegister.java | ServerRegister.registerBrokerInZk | public void registerBrokerInZk() {
logger.info("Registering broker " + brokerIdPath);
String hostname = config.getHostName();
if (hostname == null) {
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
... | java | public void registerBrokerInZk() {
logger.info("Registering broker " + brokerIdPath);
String hostname = config.getHostName();
if (hostname == null) {
try {
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
... | [
"public",
"void",
"registerBrokerInZk",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Registering broker \"",
"+",
"brokerIdPath",
")",
";",
"String",
"hostname",
"=",
"config",
".",
"getHostName",
"(",
")",
";",
"if",
"(",
"hostname",
"==",
"null",
")",
"... | register broker in the zookeeper
<p>
path: /brokers/ids/<id> <br>
data: creator:host:port | [
"register",
"broker",
"in",
"the",
"zookeeper",
"<p",
">",
"path",
":",
"/",
"brokers",
"/",
"ids",
"/",
"<",
";",
"id>",
";",
"<br",
">",
"data",
":",
"creator",
":",
"host",
":",
"port"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/server/ServerRegister.java#L119-L145 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listHierarchicalEntities | public List<HierarchicalEntityExtractor> listHierarchicalEntities(UUID appId, String versionId, ListHierarchicalEntitiesOptionalParameter listHierarchicalEntitiesOptionalParameter) {
return listHierarchicalEntitiesWithServiceResponseAsync(appId, versionId, listHierarchicalEntitiesOptionalParameter).toBlocking()... | java | public List<HierarchicalEntityExtractor> listHierarchicalEntities(UUID appId, String versionId, ListHierarchicalEntitiesOptionalParameter listHierarchicalEntitiesOptionalParameter) {
return listHierarchicalEntitiesWithServiceResponseAsync(appId, versionId, listHierarchicalEntitiesOptionalParameter).toBlocking()... | [
"public",
"List",
"<",
"HierarchicalEntityExtractor",
">",
"listHierarchicalEntities",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListHierarchicalEntitiesOptionalParameter",
"listHierarchicalEntitiesOptionalParameter",
")",
"{",
"return",
"listHierarchicalEntitiesWit... | Gets information about the hierarchical entity models.
@param appId The application ID.
@param versionId The version ID.
@param listHierarchicalEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Gets",
"information",
"about",
"the",
"hierarchical",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1373-L1375 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.fromHierarchicalMap | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("source");
final Map<String, String> propsParams =
(Map<String, String>) propsMap.get("props");
final Map<String, Object> p... | java | public static Props fromHierarchicalMap(final Map<String, Object> propsMap) {
if (propsMap == null) {
return null;
}
final String source = (String) propsMap.get("source");
final Map<String, String> propsParams =
(Map<String, String>) propsMap.get("props");
final Map<String, Object> p... | [
"public",
"static",
"Props",
"fromHierarchicalMap",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"propsMap",
")",
"{",
"if",
"(",
"propsMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"source",
"=",
"(",
"String",
... | Convert a hierarchical Map to Prop Object
@param propsMap a hierarchical Map
@return a new constructed Props Object | [
"Convert",
"a",
"hierarchical",
"Map",
"to",
"Prop",
"Object"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L399-L414 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java | CompareUtil.elementIsNotContainedInArray | public static <T> boolean elementIsNotContainedInArray(T element, T... values) {
if (element != null && values != null) {
return elementIsNotContainedInList(element, Arrays.asList(values));
}
else {
return false;
}
} | java | public static <T> boolean elementIsNotContainedInArray(T element, T... values) {
if (element != null && values != null) {
return elementIsNotContainedInList(element, Arrays.asList(values));
}
else {
return false;
}
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"elementIsNotContainedInArray",
"(",
"T",
"element",
",",
"T",
"...",
"values",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
"&&",
"values",
"!=",
"null",
")",
"{",
"return",
"elementIsNotContainedInList",
"(",
... | Checks if the element is contained within the list of values. If the element, or the list are null then true is returned.
@param element to check
@param values to check in
@param <T> the type of the element
@return {@code true} if the element and values are not {@code null} and the values does not contain the element,... | [
"Checks",
"if",
"the",
"element",
"is",
"contained",
"within",
"the",
"list",
"of",
"values",
".",
"If",
"the",
"element",
"or",
"the",
"list",
"are",
"null",
"then",
"true",
"is",
"returned",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java#L103-L110 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java | Instructions.mergeAndOverrideExisting | public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) {
Properties properties = new Properties();
properties.putAll(props1);
properties.putAll(props2);
return properties;
} | java | public static Properties mergeAndOverrideExisting(Properties props1, Properties props2) {
Properties properties = new Properties();
properties.putAll(props1);
properties.putAll(props2);
return properties;
} | [
"public",
"static",
"Properties",
"mergeAndOverrideExisting",
"(",
"Properties",
"props1",
",",
"Properties",
"props2",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"putAll",
"(",
"props1",
")",
";",
"properti... | Utility method to merge instructions from {@code props2} into the {@code props1}. The instructions
from {@code props2} override the instructions from {@code props1} (when both contain the same instruction)
@param props1 the first set of instructions
@param props2 the second set of instructions
@return the new set of ... | [
"Utility",
"method",
"to",
"merge",
"instructions",
"from",
"{",
"@code",
"props2",
"}",
"into",
"the",
"{",
"@code",
"props1",
"}",
".",
"The",
"instructions",
"from",
"{",
"@code",
"props2",
"}",
"override",
"the",
"instructions",
"from",
"{",
"@code",
"... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java#L64-L69 |
mcdiae/kludje | kludje-core/src/main/java/uk/kludje/MetaConfig.java | MetaConfig.withObjectEqualsChecks | public MetaConfig withObjectEqualsChecks(ObjectEqualsPolicy equalsPolicy, ObjectHashCodePolicy hashCodePolicy) {
Ensure.that(equalsPolicy != null, "equalsPolicy != null");
Ensure.that(hashCodePolicy != null, "hashCodePolicy != null");
return new MetaConfigBuilder(this)
.setObjectEqualsPolicy(equalsPo... | java | public MetaConfig withObjectEqualsChecks(ObjectEqualsPolicy equalsPolicy, ObjectHashCodePolicy hashCodePolicy) {
Ensure.that(equalsPolicy != null, "equalsPolicy != null");
Ensure.that(hashCodePolicy != null, "hashCodePolicy != null");
return new MetaConfigBuilder(this)
.setObjectEqualsPolicy(equalsPo... | [
"public",
"MetaConfig",
"withObjectEqualsChecks",
"(",
"ObjectEqualsPolicy",
"equalsPolicy",
",",
"ObjectHashCodePolicy",
"hashCodePolicy",
")",
"{",
"Ensure",
".",
"that",
"(",
"equalsPolicy",
"!=",
"null",
",",
"\"equalsPolicy != null\"",
")",
";",
"Ensure",
".",
"t... | Allows consumers to set special handling for {@link Getter#get(Object)} responses for
{@link Meta#equals(Object, Object)}, {@link Meta#hashCode(Object)}.
@param equalsPolicy a non-null equals policy
@param hashCodePolicy a non-null hash policy
@return the new config
@see #withShallowArraySupport() | [
"Allows",
"consumers",
"to",
"set",
"special",
"handling",
"for",
"{",
"@link",
"Getter#get",
"(",
"Object",
")",
"}",
"responses",
"for",
"{",
"@link",
"Meta#equals",
"(",
"Object",
"Object",
")",
"}",
"{",
"@link",
"Meta#hashCode",
"(",
"Object",
")",
"}... | train | https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-core/src/main/java/uk/kludje/MetaConfig.java#L168-L176 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/DisksInner.java | DisksInner.beginDeleteAsync | public Observable<OperationStatusResponseInner> beginDeleteAsync(String resourceGroupName, String diskName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
p... | java | public Observable<OperationStatusResponseInner> beginDeleteAsync(String resourceGroupName, String diskName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
p... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginDeleteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
")",
"{",
"return",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
")",
".",
"map",
"(... | Deletes a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@throws IllegalArgumentE... | [
"Deletes",
"a",
"disk",
"."
] | 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/DisksInner.java#L667-L674 |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201811/Pql.java | Pql.resultSetToStringArrayList | public static List<String[]> resultSetToStringArrayList(ResultSet resultSet) {
List<String[]> stringArrayList = Lists.newArrayList();
stringArrayList.add(getColumnLabels(resultSet).toArray(new String[] {}));
if (resultSet.getRows() != null) {
for (Row row : resultSet.getRows()) {
try {
... | java | public static List<String[]> resultSetToStringArrayList(ResultSet resultSet) {
List<String[]> stringArrayList = Lists.newArrayList();
stringArrayList.add(getColumnLabels(resultSet).toArray(new String[] {}));
if (resultSet.getRows() != null) {
for (Row row : resultSet.getRows()) {
try {
... | [
"public",
"static",
"List",
"<",
"String",
"[",
"]",
">",
"resultSetToStringArrayList",
"(",
"ResultSet",
"resultSet",
")",
"{",
"List",
"<",
"String",
"[",
"]",
">",
"stringArrayList",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"stringArrayList",
"."... | Gets the result set as list of string arrays, which can be transformed to a CSV using {@code
CsvFiles} such as
<pre>
<code>
ResultSet combinedResultSet = Pql.combineResultSet(resultSet1, resultSet2);
//...
combinedResultSet = Pql.combineResultSet(combinedResultSet, resultSet3);
CsvFiles.writeCsv(Pql.resultSetToStringA... | [
"Gets",
"the",
"result",
"set",
"as",
"list",
"of",
"string",
"arrays",
"which",
"can",
"be",
"transformed",
"to",
"a",
"CSV",
"using",
"{",
"@code",
"CsvFiles",
"}",
"such",
"as"
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201811/Pql.java#L313-L326 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.qualified | private static Path qualified(Path rootPath, Path path) {
URI rootUri = rootPath.toUri();
return path.makeQualified(rootUri, new Path(rootUri.getPath()));
} | java | private static Path qualified(Path rootPath, Path path) {
URI rootUri = rootPath.toUri();
return path.makeQualified(rootUri, new Path(rootUri.getPath()));
} | [
"private",
"static",
"Path",
"qualified",
"(",
"Path",
"rootPath",
",",
"Path",
"path",
")",
"{",
"URI",
"rootUri",
"=",
"rootPath",
".",
"toUri",
"(",
")",
";",
"return",
"path",
".",
"makeQualified",
"(",
"rootUri",
",",
"new",
"Path",
"(",
"rootUri",
... | Qualifies a path so it includes the schema and authority from the root path. | [
"Qualifies",
"a",
"path",
"so",
"it",
"includes",
"the",
"schema",
"and",
"authority",
"from",
"the",
"root",
"path",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L110-L113 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.setSharedKeyAsync | public Observable<ConnectionSharedKeyInner> setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).map(new Func1<ServiceResponse<ConnectionSharedKeyInner>, ... | java | public Observable<ConnectionSharedKeyInner> setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).map(new Func1<ServiceResponse<ConnectionSharedKeyInner>, ... | [
"public",
"Observable",
"<",
"ConnectionSharedKeyInner",
">",
"setSharedKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"String",
"value",
")",
"{",
"return",
"setSharedKeyWithServiceResponseAsync",
"(",
"resourceGroup... | The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnect... | [
"The",
"Put",
"VirtualNetworkGatewayConnectionSharedKey",
"operation",
"sets",
"the",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"for",
"passed",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"through"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L883-L890 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getWritableChannel | public WritableGridFileChannel getWritableChannel(String pathname, boolean append, int chunkSize) throws IOException {
GridFile file = (GridFile) getFile(pathname, chunkSize);
checkIsNotDirectory(file);
createIfNeeded(file);
return new WritableGridFileChannel(file, data, append);
} | java | public WritableGridFileChannel getWritableChannel(String pathname, boolean append, int chunkSize) throws IOException {
GridFile file = (GridFile) getFile(pathname, chunkSize);
checkIsNotDirectory(file);
createIfNeeded(file);
return new WritableGridFileChannel(file, data, append);
} | [
"public",
"WritableGridFileChannel",
"getWritableChannel",
"(",
"String",
"pathname",
",",
"boolean",
"append",
",",
"int",
"chunkSize",
")",
"throws",
"IOException",
"{",
"GridFile",
"file",
"=",
"(",
"GridFile",
")",
"getFile",
"(",
"pathname",
",",
"chunkSize",... | Opens a WritableGridFileChannel for writing to the file denoted by pathname.
@param pathname the file to write to
@param append if true, the bytes written to the channel will be appended to the end of the file
@param chunkSize the size of the file's chunks. This parameter is honored only when the file at pathname does
... | [
"Opens",
"a",
"WritableGridFileChannel",
"for",
"writing",
"to",
"the",
"file",
"denoted",
"by",
"pathname",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L228-L233 |
jtrfp/jfdt | src/main/java/org/jtrfp/jfdt/Parser.java | Parser.writeBean | public void writeBean(ThirdPartyParseable bean,OutputStream os){
writeBean(bean,new EndianAwareDataOutputStream(new DataOutputStream(os)));
} | java | public void writeBean(ThirdPartyParseable bean,OutputStream os){
writeBean(bean,new EndianAwareDataOutputStream(new DataOutputStream(os)));
} | [
"public",
"void",
"writeBean",
"(",
"ThirdPartyParseable",
"bean",
",",
"OutputStream",
"os",
")",
"{",
"writeBean",
"(",
"bean",
",",
"new",
"EndianAwareDataOutputStream",
"(",
"new",
"DataOutputStream",
"(",
"os",
")",
")",
")",
";",
"}"
] | Write ThirdPartyParseable bean to the given OutputStream.
@param bean
@param os
@since Sep 17, 2012 | [
"Write",
"ThirdPartyParseable",
"bean",
"to",
"the",
"given",
"OutputStream",
"."
] | train | https://github.com/jtrfp/jfdt/blob/64e665669b5fcbfe96736346b4e7893e466dd8a0/src/main/java/org/jtrfp/jfdt/Parser.java#L175-L177 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeUUIDWithDefault | @Pure
public static UUID getAttributeUUIDWithDefault(Node document, boolean caseSensitive, UUID defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
final String v = getAttributeValue(document, caseSensitive, 0, path);
if (v != null && !v.isEmpty()) {
try {
final U... | java | @Pure
public static UUID getAttributeUUIDWithDefault(Node document, boolean caseSensitive, UUID defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
final String v = getAttributeValue(document, caseSensitive, 0, path);
if (v != null && !v.isEmpty()) {
try {
final U... | [
"@",
"Pure",
"public",
"static",
"UUID",
"getAttributeUUIDWithDefault",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"UUID",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",... | Replies the UUID that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param defaultValue is the defa... | [
"Replies",
"the",
"UUID",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1117-L1132 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/JarClassLoader.java | JarClassLoader.loadJar | public static void loadJar(URLClassLoader loader, File jarFile) throws UtilException {
try {
final Method method = ClassUtil.getDeclaredMethod(URLClassLoader.class, "addURL", URL.class);
if (null != method) {
method.setAccessible(true);
final List<File> jars = loopJar(jarFile);
for (File jar :... | java | public static void loadJar(URLClassLoader loader, File jarFile) throws UtilException {
try {
final Method method = ClassUtil.getDeclaredMethod(URLClassLoader.class, "addURL", URL.class);
if (null != method) {
method.setAccessible(true);
final List<File> jars = loopJar(jarFile);
for (File jar :... | [
"public",
"static",
"void",
"loadJar",
"(",
"URLClassLoader",
"loader",
",",
"File",
"jarFile",
")",
"throws",
"UtilException",
"{",
"try",
"{",
"final",
"Method",
"method",
"=",
"ClassUtil",
".",
"getDeclaredMethod",
"(",
"URLClassLoader",
".",
"class",
",",
... | 加载Jar文件到指定loader中
@param loader {@link URLClassLoader}
@param jarFile 被加载的jar
@throws UtilException IO异常包装和执行异常 | [
"加载Jar文件到指定loader中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/JarClassLoader.java#L57-L70 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java | PackageManagerUtils.isPackageInstalled | public static boolean isPackageInstalled(Context context, String targetPackage) {
PackageManager manager = context.getPackageManager();
Intent intent = new Intent();
intent.setPackage(targetPackage);
return manager.resolveActivity(intent, 0) != null;
} | java | public static boolean isPackageInstalled(Context context, String targetPackage) {
PackageManager manager = context.getPackageManager();
Intent intent = new Intent();
intent.setPackage(targetPackage);
return manager.resolveActivity(intent, 0) != null;
} | [
"public",
"static",
"boolean",
"isPackageInstalled",
"(",
"Context",
"context",
",",
"String",
"targetPackage",
")",
"{",
"PackageManager",
"manager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
")",
... | Checks if the target package is installed on this device.
@param context the context.
@param targetPackage the target package name.
@return {@code true} if installed, false otherwise. | [
"Checks",
"if",
"the",
"target",
"package",
"is",
"installed",
"on",
"this",
"device",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java#L87-L92 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java | DPathUtils.setValue | public static void setValue(Object target, String dPath, Object value) {
setValue(target, dPath, value, false);
} | java | public static void setValue(Object target, String dPath, Object value) {
setValue(target, dPath, value, false);
} | [
"public",
"static",
"void",
"setValue",
"(",
"Object",
"target",
",",
"String",
"dPath",
",",
"Object",
"value",
")",
"{",
"setValue",
"(",
"target",
",",
"dPath",
",",
"value",
",",
"false",
")",
";",
"}"
] | Set a value to the target object specified by DPath expression.
<p>
Note: intermediated nodes will NOT be created.
</p>
<p>
Note: if {@code value} is {@code null}:
<ul>
<li>If the specified item's parent is a list or array, the item
(specified by {@code dPath}) will be set to {@code null}.</li>
<li>If the specified i... | [
"Set",
"a",
"value",
"to",
"the",
"target",
"object",
"specified",
"by",
"DPath",
"expression",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java#L607-L609 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java | SimulatorTaskTracker.createTaskAttemptCompletionEvent | private TaskAttemptCompletionEvent createTaskAttemptCompletionEvent(
SimulatorTaskInProgress tip, long now) {
// We need to clone() status as we modify and it goes into an Event
TaskStatus status = (TaskStatus)tip.getTaskStatus().clone();
long delta = tip.getUserSpaceR... | java | private TaskAttemptCompletionEvent createTaskAttemptCompletionEvent(
SimulatorTaskInProgress tip, long now) {
// We need to clone() status as we modify and it goes into an Event
TaskStatus status = (TaskStatus)tip.getTaskStatus().clone();
long delta = tip.getUserSpaceR... | [
"private",
"TaskAttemptCompletionEvent",
"createTaskAttemptCompletionEvent",
"(",
"SimulatorTaskInProgress",
"tip",
",",
"long",
"now",
")",
"{",
"// We need to clone() status as we modify and it goes into an Event",
"TaskStatus",
"status",
"=",
"(",
"TaskStatus",
")",
"tip",
"... | Creates a signal for itself marking the completion of a task attempt.
It assumes that the task attempt hasn't made any progress in the user
space code so far, i.e. it is called right at launch for map tasks and
immediately after all maps completed for reduce tasks.
@param tip the simulator task in progress
@param now ... | [
"Creates",
"a",
"signal",
"for",
"itself",
"marking",
"the",
"completion",
"of",
"a",
"task",
"attempt",
".",
"It",
"assumes",
"that",
"the",
"task",
"attempt",
"hasn",
"t",
"made",
"any",
"progress",
"in",
"the",
"user",
"space",
"code",
"so",
"far",
"i... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L274-L291 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/DoradusServer.java | DoradusServer.initEmbedded | private void initEmbedded(String[] args, String[] services) {
if (m_bInitialized) {
m_logger.warn("initEmbedded: Already initialized -- ignoring");
return;
}
m_logger.info("Initializing embedded mode");
initConfig(args);
initEmbeddedServices(service... | java | private void initEmbedded(String[] args, String[] services) {
if (m_bInitialized) {
m_logger.warn("initEmbedded: Already initialized -- ignoring");
return;
}
m_logger.info("Initializing embedded mode");
initConfig(args);
initEmbeddedServices(service... | [
"private",
"void",
"initEmbedded",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"[",
"]",
"services",
")",
"{",
"if",
"(",
"m_bInitialized",
")",
"{",
"m_logger",
".",
"warn",
"(",
"\"initEmbedded: Already initialized -- ignoring\"",
")",
";",
"return",
";"... | Initialize server configuration and given+required services for embedded running. | [
"Initialize",
"server",
"configuration",
"and",
"given",
"+",
"required",
"services",
"for",
"embedded",
"running",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/DoradusServer.java#L305-L315 |
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.addMillis | public final Timestamp addMillis(long amount)
{
if (amount == 0 && _precision.includes(Precision.SECOND) && _fraction != null && _fraction.scale() >= 3) {
// Zero milliseconds are to be added, and the precision does not need to be increased.
return this;
}
return addM... | java | public final Timestamp addMillis(long amount)
{
if (amount == 0 && _precision.includes(Precision.SECOND) && _fraction != null && _fraction.scale() >= 3) {
// Zero milliseconds are to be added, and the precision does not need to be increased.
return this;
}
return addM... | [
"public",
"final",
"Timestamp",
"addMillis",
"(",
"long",
"amount",
")",
"{",
"if",
"(",
"amount",
"==",
"0",
"&&",
"_precision",
".",
"includes",
"(",
"Precision",
".",
"SECOND",
")",
"&&",
"_fraction",
"!=",
"null",
"&&",
"_fraction",
".",
"scale",
"("... | Returns a timestamp relative to this one by the given number of
milliseconds.
<p>
This method always returns a Timestamp with SECOND precision and a seconds
value precise at least to the millisecond. For example, adding one millisecond
to {@code 2011T} results in {@code 2011-01-01T00:00:00.001-00:00}. To receive
a Time... | [
"Returns",
"a",
"timestamp",
"relative",
"to",
"this",
"one",
"by",
"the",
"given",
"number",
"of",
"milliseconds",
".",
"<p",
">",
"This",
"method",
"always",
"returns",
"a",
"Timestamp",
"with",
"SECOND",
"precision",
"and",
"a",
"seconds",
"value",
"preci... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2250-L2257 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacter | public void getCharacter(String API, String name, Callback<Character> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacter(name, API).enqueue(callback);
} | java | public void getCharacter(String API, String name, Callback<Character> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacter(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacter",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"Character",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",... | For more info on character overview API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters">here</a><br/>
Get character information for the given character name that is linked to given API key
@param API API key
@param name name of character
@param callback callback that is going to be used for {@l... | [
"For",
"more",
"info",
"on",
"character",
"overview",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L690-L693 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/util/IOHelper.java | IOHelper.addRequestProperties | private static void addRequestProperties(final Map<String, String> requestProperties, final HttpURLConnection connection) {
if (requestProperties != null) {
for (Entry<String, String> entry : requestProperties.entrySet()) {
connection.addRequestProperty(entry.getKey(), entry.getValue... | java | private static void addRequestProperties(final Map<String, String> requestProperties, final HttpURLConnection connection) {
if (requestProperties != null) {
for (Entry<String, String> entry : requestProperties.entrySet()) {
connection.addRequestProperty(entry.getKey(), entry.getValue... | [
"private",
"static",
"void",
"addRequestProperties",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"requestProperties",
",",
"final",
"HttpURLConnection",
"connection",
")",
"{",
"if",
"(",
"requestProperties",
"!=",
"null",
")",
"{",
"for",
"(",
"En... | Copies request properties to a connection.
@param requestProperties
(if null, connection will not be changed)
@param connection | [
"Copies",
"request",
"properties",
"to",
"a",
"connection",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/util/IOHelper.java#L59-L65 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.setCrossNoDisturb | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
return _crossAppClient.setCrossNoDisturb(username, array);
} | java | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
return _crossAppClient.setCrossNoDisturb(username, array);
} | [
"public",
"ResponseWrapper",
"setCrossNoDisturb",
"(",
"String",
"username",
",",
"CrossNoDisturb",
"[",
"]",
"array",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_crossAppClient",
".",
"setCrossNoDisturb",
"(",
"username",
",",
... | Set cross app no disturb
https://docs.jiguang.cn/jmessage/server/rest_api_im/#api_1
@param username Necessary
@param array CrossNoDisturb array
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Set",
"cross",
"app",
"no",
"disturb",
"https",
":",
"//",
"docs",
".",
"jiguang",
".",
"cn",
"/",
"jmessage",
"/",
"server",
"/",
"rest_api_im",
"/",
"#api_1"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L658-L661 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java | Instance.allocateSimpleSlot | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
synchronized (instanceLock) {
if (isDead) {
throw new InstanceDiedException(this);
}
Integer nextSlot = availableSlots.poll();
if (nextSlot == null) {
return null;
}
else {
SimpleSlot slot = new SimpleSlot(this, locat... | java | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
synchronized (instanceLock) {
if (isDead) {
throw new InstanceDiedException(this);
}
Integer nextSlot = availableSlots.poll();
if (nextSlot == null) {
return null;
}
else {
SimpleSlot slot = new SimpleSlot(this, locat... | [
"public",
"SimpleSlot",
"allocateSimpleSlot",
"(",
")",
"throws",
"InstanceDiedException",
"{",
"synchronized",
"(",
"instanceLock",
")",
"{",
"if",
"(",
"isDead",
")",
"{",
"throw",
"new",
"InstanceDiedException",
"(",
"this",
")",
";",
"}",
"Integer",
"nextSlo... | Allocates a simple slot on this TaskManager instance. This method returns {@code null}, if no slot
is available at the moment.
@return A simple slot that represents a task slot on this TaskManager instance, or null, if the
TaskManager instance has no more slots available.
@throws InstanceDiedException Thrown if the i... | [
"Allocates",
"a",
"simple",
"slot",
"on",
"this",
"TaskManager",
"instance",
".",
"This",
"method",
"returns",
"{",
"@code",
"null",
"}",
"if",
"no",
"slot",
"is",
"available",
"at",
"the",
"moment",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java#L220-L236 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2/src/com/ibm/ws/security/csiv2/server/config/tss/ServerConfigHelper.java | ServerConfigHelper.getTSSConfig | public TSSConfig getTSSConfig(Map<String, Object> properties, Map<String, List<TransportAddress>> addrMap) throws Exception {
TSSConfig tssConfig = new TSSConfig();
printTrace("IIOP Server Policy", null, 0);
PolicyData policyData = extractPolicyData(properties, KEY_POLICY, TYPE);
if (p... | java | public TSSConfig getTSSConfig(Map<String, Object> properties, Map<String, List<TransportAddress>> addrMap) throws Exception {
TSSConfig tssConfig = new TSSConfig();
printTrace("IIOP Server Policy", null, 0);
PolicyData policyData = extractPolicyData(properties, KEY_POLICY, TYPE);
if (p... | [
"public",
"TSSConfig",
"getTSSConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"TransportAddress",
">",
">",
"addrMap",
")",
"throws",
"Exception",
"{",
"TSSConfig",
"tssConfig",
"=",
"new",
... | /*
The TSSConfig object is the modal representation of <iiopServerPolicy> configuration, the user specify
in server.xml. An example of <iiopServerPolicy> entry is shown here for quick reference.
<iiopServerPolicy id="jaykay">
--<csiv2 stateful="false">
----<layers>
------<attributeLayer identityAssertionEnabled="true" ... | [
"/",
"*",
"The",
"TSSConfig",
"object",
"is",
"the",
"modal",
"representation",
"of",
"<iiopServerPolicy",
">",
"configuration",
"the",
"user",
"specify",
"in",
"server",
".",
"xml",
".",
"An",
"example",
"of",
"<iiopServerPolicy",
">",
"entry",
"is",
"shown",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2/src/com/ibm/ws/security/csiv2/server/config/tss/ServerConfigHelper.java#L98-L114 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Add | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real + z2.real, z1.imaginary + z2.imaginary);
} | java | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real + z2.real, z1.imaginary + z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Add",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"+",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"+",
"z2",
".",
"imaginary",
")",... | Adds two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the sum of specified complex numbers. | [
"Adds",
"two",
"complex",
"numbers",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L241-L243 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getArgumentType | public HeadedSyntacticCategory getArgumentType() {
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables, rootIndex + 1, semanticVariables.length);
int argumentRoot = argumentSyntax.getNumReturnSubcategories();
return new H... | java | public HeadedSyntacticCategory getArgumentType() {
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables, rootIndex + 1, semanticVariables.length);
int argumentRoot = argumentSyntax.getNumReturnSubcategories();
return new H... | [
"public",
"HeadedSyntacticCategory",
"getArgumentType",
"(",
")",
"{",
"SyntacticCategory",
"argumentSyntax",
"=",
"syntacticCategory",
".",
"getArgument",
"(",
")",
";",
"int",
"[",
"]",
"argumentSemantics",
"=",
"ArrayUtils",
".",
"copyOfRange",
"(",
"semanticVariab... | Gets the syntactic type and semantic variable assignments to the
argument type of this category.
@return | [
"Gets",
"the",
"syntactic",
"type",
"and",
"semantic",
"variable",
"assignments",
"to",
"the",
"argument",
"type",
"of",
"this",
"category",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L247-L252 |
aws/aws-sdk-java | aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/PropertyGroup.java | PropertyGroup.withPropertyMap | public PropertyGroup withPropertyMap(java.util.Map<String, String> propertyMap) {
setPropertyMap(propertyMap);
return this;
} | java | public PropertyGroup withPropertyMap(java.util.Map<String, String> propertyMap) {
setPropertyMap(propertyMap);
return this;
} | [
"public",
"PropertyGroup",
"withPropertyMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"propertyMap",
")",
"{",
"setPropertyMap",
"(",
"propertyMap",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Describes the value of an application execution property key-value pair.
</p>
@param propertyMap
Describes the value of an application execution property key-value pair.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Describes",
"the",
"value",
"of",
"an",
"application",
"execution",
"property",
"key",
"-",
"value",
"pair",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/PropertyGroup.java#L119-L122 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java | DeferredAttr.attribSpeculative | JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
return attribSpeculative(tree, env, resultInfo, treeCopier,
(newTree)->new DeferredAttrDiagHandler(log, newTree), null);
} | java | JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
return attribSpeculative(tree, env, resultInfo, treeCopier,
(newTree)->new DeferredAttrDiagHandler(log, newTree), null);
} | [
"JCTree",
"attribSpeculative",
"(",
"JCTree",
"tree",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"ResultInfo",
"resultInfo",
")",
"{",
"return",
"attribSpeculative",
"(",
"tree",
",",
"env",
",",
"resultInfo",
",",
"treeCopier",
",",
"(",
"newTree",
")... | Routine that performs speculative type-checking; the input AST node is
cloned (to avoid side-effects cause by Attr) and compiler state is
restored after type-checking. All diagnostics (but critical ones) are
disabled during speculative type-checking. | [
"Routine",
"that",
"performs",
"speculative",
"type",
"-",
"checking",
";",
"the",
"input",
"AST",
"node",
"is",
"cloned",
"(",
"to",
"avoid",
"side",
"-",
"effects",
"cause",
"by",
"Attr",
")",
"and",
"compiler",
"state",
"is",
"restored",
"after",
"type"... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java#L471-L474 |
upwork/java-upwork | src/com/Upwork/api/Routers/Reports/Time.java | Time.getByTeamFull | public JSONObject getByTeamFull(String company, String team, HashMap<String, String> params) throws JSONException {
return _getByType(company, team, null, params, false);
} | java | public JSONObject getByTeamFull(String company, String team, HashMap<String, String> params) throws JSONException {
return _getByType(company, team, null, params, false);
} | [
"public",
"JSONObject",
"getByTeamFull",
"(",
"String",
"company",
",",
"String",
"team",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"team",
",",
"null",
",",... | Generate Time Reports for a Specific Team (with financial info)
@param company Company ID
@param team Team ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Generate",
"Time",
"Reports",
"for",
"a",
"Specific",
"Team",
"(",
"with",
"financial",
"info",
")"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Reports/Time.java#L80-L82 |
stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660Directory.java | ISO9660Directory.sortedIterator | public Iterator<ISO9660Directory> sortedIterator() {
if (sortedIterator == null) {
sortedIterator = new ISO9660DirectoryIterator(this, true);
}
sortedIterator.reset();
return sortedIterator;
} | java | public Iterator<ISO9660Directory> sortedIterator() {
if (sortedIterator == null) {
sortedIterator = new ISO9660DirectoryIterator(this, true);
}
sortedIterator.reset();
return sortedIterator;
} | [
"public",
"Iterator",
"<",
"ISO9660Directory",
">",
"sortedIterator",
"(",
")",
"{",
"if",
"(",
"sortedIterator",
"==",
"null",
")",
"{",
"sortedIterator",
"=",
"new",
"ISO9660DirectoryIterator",
"(",
"this",
",",
"true",
")",
";",
"}",
"sortedIterator",
".",
... | Returns a directory iterator to traverse the directory hierarchy according to the needs of ISO 9660 (sort order
of Path Tables and Directory Records)
@return Iterator | [
"Returns",
"a",
"directory",
"iterator",
"to",
"traverse",
"the",
"directory",
"hierarchy",
"according",
"to",
"the",
"needs",
"of",
"ISO",
"9660",
"(",
"sort",
"order",
"of",
"Path",
"Tables",
"and",
"Directory",
"Records",
")"
] | train | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660Directory.java#L519-L525 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/DateUtil.java | DateUtil.roundToHour | public static long roundToHour(final long pTime, final TimeZone pTimeZone) {
int offset = pTimeZone.getOffset(pTime);
return ((pTime / HOUR) * HOUR) - offset;
} | java | public static long roundToHour(final long pTime, final TimeZone pTimeZone) {
int offset = pTimeZone.getOffset(pTime);
return ((pTime / HOUR) * HOUR) - offset;
} | [
"public",
"static",
"long",
"roundToHour",
"(",
"final",
"long",
"pTime",
",",
"final",
"TimeZone",
"pTimeZone",
")",
"{",
"int",
"offset",
"=",
"pTimeZone",
".",
"getOffset",
"(",
"pTime",
")",
";",
"return",
"(",
"(",
"pTime",
"/",
"HOUR",
")",
"*",
... | Rounds the given time down to the closest hour, using the given timezone.
@param pTime time
@param pTimeZone the timezone to use when rounding
@return the time rounded to the closest hour. | [
"Rounds",
"the",
"given",
"time",
"down",
"to",
"the",
"closest",
"hour",
"using",
"the",
"given",
"timezone",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/DateUtil.java#L178-L181 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/nfs/NfsResponseBase.java | NfsResponseBase.makeNfsGetAttributes | protected static NfsGetAttributes makeNfsGetAttributes(Xdr xdr, boolean force) {
NfsGetAttributes attributes = null;
if (force || xdr.getBoolean()) {
attributes = new NfsGetAttributes();
attributes.unmarshalling(xdr);
}
return attributes;
} | java | protected static NfsGetAttributes makeNfsGetAttributes(Xdr xdr, boolean force) {
NfsGetAttributes attributes = null;
if (force || xdr.getBoolean()) {
attributes = new NfsGetAttributes();
attributes.unmarshalling(xdr);
}
return attributes;
} | [
"protected",
"static",
"NfsGetAttributes",
"makeNfsGetAttributes",
"(",
"Xdr",
"xdr",
",",
"boolean",
"force",
")",
"{",
"NfsGetAttributes",
"attributes",
"=",
"null",
";",
"if",
"(",
"force",
"||",
"xdr",
".",
"getBoolean",
"(",
")",
")",
"{",
"attributes",
... | Create the object if it is there, or skip the existence check if
<code>force</code> is <code>true</code>. Convenience method for use in
subclasses.
@param xdr
@param force
do not check whether it is there
@return the created object | [
"Create",
"the",
"object",
"if",
"it",
"is",
"there",
"or",
"skip",
"the",
"existence",
"check",
"if",
"<code",
">",
"force<",
"/",
"code",
">",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
".",
"Convenience",
"method",
"for",
"use",
"in",
"subclasse... | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/nfs/NfsResponseBase.java#L190-L197 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/classloading/ThreadContextClassLoaderBuilder.java | ThreadContextClassLoaderBuilder.addPath | public ThreadContextClassLoaderBuilder addPath(final String path) {
// Check sanity
Validate.notEmpty(path, "path");
// Convert to an URL, and delegate.
final URL anUrl;
try {
anUrl = new File(path).toURI().toURL();
} catch (MalformedURLException e) {
... | java | public ThreadContextClassLoaderBuilder addPath(final String path) {
// Check sanity
Validate.notEmpty(path, "path");
// Convert to an URL, and delegate.
final URL anUrl;
try {
anUrl = new File(path).toURI().toURL();
} catch (MalformedURLException e) {
... | [
"public",
"ThreadContextClassLoaderBuilder",
"addPath",
"(",
"final",
"String",
"path",
")",
"{",
"// Check sanity",
"Validate",
".",
"notEmpty",
"(",
"path",
",",
"\"path\"",
")",
";",
"// Convert to an URL, and delegate.",
"final",
"URL",
"anUrl",
";",
"try",
"{",... | Converts the supplied path to an URL and adds it to this ThreadContextClassLoaderBuilder.
@param path A path to convert to an URL and add.
@return This ThreadContextClassLoaderBuilder, for builder pattern chaining.
@see #addURL(java.net.URL) | [
"Converts",
"the",
"supplied",
"path",
"to",
"an",
"URL",
"and",
"adds",
"it",
"to",
"this",
"ThreadContextClassLoaderBuilder",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/classloading/ThreadContextClassLoaderBuilder.java#L157-L172 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6AddressPool.java | IPv6AddressPool.deAllocate | public IPv6AddressPool deAllocate(final IPv6Network toDeAllocate)
{
if (!contains(toDeAllocate))
{
throw new IllegalArgumentException(
"Network to de-allocate[" + toDeAllocate + "] is not contained in this allocatable range [" + this + "]");
}
// find... | java | public IPv6AddressPool deAllocate(final IPv6Network toDeAllocate)
{
if (!contains(toDeAllocate))
{
throw new IllegalArgumentException(
"Network to de-allocate[" + toDeAllocate + "] is not contained in this allocatable range [" + this + "]");
}
// find... | [
"public",
"IPv6AddressPool",
"deAllocate",
"(",
"final",
"IPv6Network",
"toDeAllocate",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"toDeAllocate",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Network to de-allocate[\"",
"+",
"toDeAllocate",
"+"... | Give a network back to the pool (de-allocate).
@param toDeAllocate network to de-allocate | [
"Give",
"a",
"network",
"back",
"to",
"the",
"pool",
"(",
"de",
"-",
"allocate",
")",
"."
] | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6AddressPool.java#L230-L274 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/URIName.java | URIName.nameConstraint | public static URIName nameConstraint(DerValue value) throws IOException {
URI uri;
String name = value.getIA5String();
try {
uri = new URI(name);
} catch (URISyntaxException use) {
throw new IOException("invalid URI name constraint:" + name, use);
}
... | java | public static URIName nameConstraint(DerValue value) throws IOException {
URI uri;
String name = value.getIA5String();
try {
uri = new URI(name);
} catch (URISyntaxException use) {
throw new IOException("invalid URI name constraint:" + name, use);
}
... | [
"public",
"static",
"URIName",
"nameConstraint",
"(",
"DerValue",
"value",
")",
"throws",
"IOException",
"{",
"URI",
"uri",
";",
"String",
"name",
"=",
"value",
".",
"getIA5String",
"(",
")",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"name",
")",
... | Create the URIName object with the specified name constraint. URI
name constraints syntax is different than SubjectAltNames, etc. See
4.2.1.11 of RFC 3280.
@param value the URI name constraint
@throws IOException if name is not a proper URI name constraint | [
"Create",
"the",
"URIName",
"object",
"with",
"the",
"specified",
"name",
"constraint",
".",
"URI",
"name",
"constraints",
"syntax",
"is",
"different",
"than",
"SubjectAltNames",
"etc",
".",
"See",
"4",
".",
"2",
".",
"1",
".",
"11",
"of",
"RFC",
"3280",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/URIName.java#L156-L181 |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.updateInfoByIdService | public Integer updateInfoByIdService(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr) throws Exception{
return updateInfoServiceInner(id,requestParamMap,tableName,cusCondition,cusSetStr,null);
} | java | public Integer updateInfoByIdService(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr) throws Exception{
return updateInfoServiceInner(id,requestParamMap,tableName,cusCondition,cusSetStr,null);
} | [
"public",
"Integer",
"updateInfoByIdService",
"(",
"String",
"id",
",",
"Map",
"requestParamMap",
",",
"String",
"tableName",
",",
"String",
"cusCondition",
",",
"String",
"cusSetStr",
")",
"throws",
"Exception",
"{",
"return",
"updateInfoServiceInner",
"(",
"id",
... | ���id������ݼ�¼
@param id ��������
@param requestParamMap �ύ����
@param tableName �����
@param cusCondition ���������ַ�
@param cusSetStr ����set�ַ�
@param modelName ����
@return
@throws Exception | [
"���id������ݼ�¼"
] | train | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L1688-L1690 |
line/armeria | thrift/src/main/java/com/linecorp/armeria/common/thrift/text/TTextProtocol.java | TTextProtocol.writeNameOrValue | private <T> void writeNameOrValue(TypedParser<T> helper, T val)
throws TException {
getCurrentContext().write();
try {
if (getCurrentContext().isMapKey()) {
getCurrentWriter().writeFieldName(val.toString());
} else {
helper.writeValue(g... | java | private <T> void writeNameOrValue(TypedParser<T> helper, T val)
throws TException {
getCurrentContext().write();
try {
if (getCurrentContext().isMapKey()) {
getCurrentWriter().writeFieldName(val.toString());
} else {
helper.writeValue(g... | [
"private",
"<",
"T",
">",
"void",
"writeNameOrValue",
"(",
"TypedParser",
"<",
"T",
">",
"helper",
",",
"T",
"val",
")",
"throws",
"TException",
"{",
"getCurrentContext",
"(",
")",
".",
"write",
"(",
")",
";",
"try",
"{",
"if",
"(",
"getCurrentContext",
... | Write out the given value, either as a JSON name (meaning it's
escaped by quotes), or a value. The TypedParser knows how to
handle the writing. | [
"Write",
"out",
"the",
"given",
"value",
"either",
"as",
"a",
"JSON",
"name",
"(",
"meaning",
"it",
"s",
"escaped",
"by",
"quotes",
")",
"or",
"a",
"value",
".",
"The",
"TypedParser",
"knows",
"how",
"to",
"handle",
"the",
"writing",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/thrift/src/main/java/com/linecorp/armeria/common/thrift/text/TTextProtocol.java#L367-L379 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.createProjectiveToMetric | public static DMatrixRMaj createProjectiveToMetric( DMatrixRMaj K ,
double v1 , double v2 , double v3 ,
double lambda,
@Nullable DMatrixRMaj H )
{
if( H == null )
H = new DMatrixRMaj(4,4);
else
H.reshape(4,4);
CommonOps_DDRM.insert(K,H,0,0);
H.set(0,3,0);
H.se... | java | public static DMatrixRMaj createProjectiveToMetric( DMatrixRMaj K ,
double v1 , double v2 , double v3 ,
double lambda,
@Nullable DMatrixRMaj H )
{
if( H == null )
H = new DMatrixRMaj(4,4);
else
H.reshape(4,4);
CommonOps_DDRM.insert(K,H,0,0);
H.set(0,3,0);
H.se... | [
"public",
"static",
"DMatrixRMaj",
"createProjectiveToMetric",
"(",
"DMatrixRMaj",
"K",
",",
"double",
"v1",
",",
"double",
"v2",
",",
"double",
"v3",
",",
"double",
"lambda",
",",
"@",
"Nullable",
"DMatrixRMaj",
"H",
")",
"{",
"if",
"(",
"H",
"==",
"null"... | Given the calibration matrix for the first view, plane at infinity, and lambda (scaling factor) compute
the rectifying homography for changing a projective camera matrix into a metric one.
<p>H = [K 0;v' &lambda]</p>
@param K 3x3 calibration matrix for view 1
@param v1 plane at infinity
@param v2 plane at infinity
@p... | [
"Given",
"the",
"calibration",
"matrix",
"for",
"the",
"first",
"view",
"plane",
"at",
"infinity",
"and",
"lambda",
"(",
"scaling",
"factor",
")",
"compute",
"the",
"rectifying",
"homography",
"for",
"changing",
"a",
"projective",
"camera",
"matrix",
"into",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1577-L1597 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java | CommonHelper.assertNotBlank | public static void assertNotBlank(final String name, final String value, final String msg) {
assertTrue(!isBlank(value), name + " cannot be blank" + (msg != null ? ": " + msg : ""));
} | java | public static void assertNotBlank(final String name, final String value, final String msg) {
assertTrue(!isBlank(value), name + " cannot be blank" + (msg != null ? ": " + msg : ""));
} | [
"public",
"static",
"void",
"assertNotBlank",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
",",
"final",
"String",
"msg",
")",
"{",
"assertTrue",
"(",
"!",
"isBlank",
"(",
"value",
")",
",",
"name",
"+",
"\" cannot be blank\"",
"+",
"("... | Verify that a String is not blank otherwise throw a {@link TechnicalException}.
@param name name if the string
@param value value of the string
@param msg an expanatory message | [
"Verify",
"that",
"a",
"String",
"is",
"not",
"blank",
"otherwise",
"throw",
"a",
"{",
"@link",
"TechnicalException",
"}",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java#L123-L125 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java | PathTemplate.validatedMatch | public ImmutableMap<String, String> validatedMatch(String path, String exceptionMessagePrefix) {
ImmutableMap<String, String> matchMap = match(path);
if (matchMap == null) {
throw new ValidationException(
String.format(
"%s: Parameter \"%s\" must be in the form \"%s\"",
... | java | public ImmutableMap<String, String> validatedMatch(String path, String exceptionMessagePrefix) {
ImmutableMap<String, String> matchMap = match(path);
if (matchMap == null) {
throw new ValidationException(
String.format(
"%s: Parameter \"%s\" must be in the form \"%s\"",
... | [
"public",
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"validatedMatch",
"(",
"String",
"path",
",",
"String",
"exceptionMessagePrefix",
")",
"{",
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"matchMap",
"=",
"match",
"(",
"path",
")",
";",
"if",... | Matches the path, returning a map from variable names to matched values. All matched values
will be properly unescaped using URL encoding rules. If the path does not match the template,
throws a ValidationException. The exceptionMessagePrefix parameter will be prepended to the
ValidationException message.
<p>If the pa... | [
"Matches",
"the",
"path",
"returning",
"a",
"map",
"from",
"variable",
"names",
"to",
"matched",
"values",
".",
"All",
"matched",
"values",
"will",
"be",
"properly",
"unescaped",
"using",
"URL",
"encoding",
"rules",
".",
"If",
"the",
"path",
"does",
"not",
... | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java#L407-L416 |
twilio/twilio-java | src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrackReader.java | SubscribedTrackReader.previousPage | @Override
public Page<SubscribedTrack> previousPage(final Page<SubscribedTrack> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.VIDEO.toString(),
... | java | @Override
public Page<SubscribedTrack> previousPage(final Page<SubscribedTrack> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.VIDEO.toString(),
... | [
"@",
"Override",
"public",
"Page",
"<",
"SubscribedTrack",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"SubscribedTrack",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
"."... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrackReader.java#L176-L187 |
haraldk/TwelveMonkeys | imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/KCMSSanitizerStrategy.java | KCMSSanitizerStrategy.fixProfileXYZTag | private static boolean fixProfileXYZTag(final ICC_Profile profile, final int tagSignature) {
byte[] data = profile.getData(tagSignature);
// The CMM expects 0x64 65 73 63 ('XYZ ') but is 0x17 A5 05 B8..?
if (data != null && intFromBigEndian(data, 0) == CORBIS_RGB_ALTERNATE_XYZ) {
in... | java | private static boolean fixProfileXYZTag(final ICC_Profile profile, final int tagSignature) {
byte[] data = profile.getData(tagSignature);
// The CMM expects 0x64 65 73 63 ('XYZ ') but is 0x17 A5 05 B8..?
if (data != null && intFromBigEndian(data, 0) == CORBIS_RGB_ALTERNATE_XYZ) {
in... | [
"private",
"static",
"boolean",
"fixProfileXYZTag",
"(",
"final",
"ICC_Profile",
"profile",
",",
"final",
"int",
"tagSignature",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"profile",
".",
"getData",
"(",
"tagSignature",
")",
";",
"// The CMM expects 0x64 65 73 63 ('... | Fixes problematic 'XYZ ' tags in Corbis RGB profile.
@return {@code true} if found and fixed, otherwise {@code false} for short-circuiting
to avoid unnecessary array copying. | [
"Fixes",
"problematic",
"XYZ",
"tags",
"in",
"Corbis",
"RGB",
"profile",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/KCMSSanitizerStrategy.java#L81-L93 |
thorntail/thorntail | fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/MPJWTExtension.java | MPJWTExtension.observesAfterBeanDiscovery | void observesAfterBeanDiscovery(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) {
log.debugf("observesAfterBeanDiscovery, %s", claims);
installClaimValueProducerMethodsViaSyntheticBeans(event, beanManager);
} | java | void observesAfterBeanDiscovery(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) {
log.debugf("observesAfterBeanDiscovery, %s", claims);
installClaimValueProducerMethodsViaSyntheticBeans(event, beanManager);
} | [
"void",
"observesAfterBeanDiscovery",
"(",
"@",
"Observes",
"final",
"AfterBeanDiscovery",
"event",
",",
"final",
"BeanManager",
"beanManager",
")",
"{",
"log",
".",
"debugf",
"(",
"\"observesAfterBeanDiscovery, %s\"",
",",
"claims",
")",
";",
"installClaimValueProducer... | Create producer methods for each ClaimValue injection site
@param event - AfterBeanDiscovery
@param beanManager - CDI bean manager | [
"Create",
"producer",
"methods",
"for",
"each",
"ClaimValue",
"injection",
"site"
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/cdi/MPJWTExtension.java#L216-L219 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/impl/EntryWrappingInterceptor.java | EntryWrappingInterceptor.shouldCommitDuringPrepare | protected boolean shouldCommitDuringPrepare(PrepareCommand command, TxInvocationContext ctx) {
return totalOrder ?
command.isOnePhaseCommit() && (!ctx.isOriginLocal() || !command.hasModifications()) :
command.isOnePhaseCommit();
} | java | protected boolean shouldCommitDuringPrepare(PrepareCommand command, TxInvocationContext ctx) {
return totalOrder ?
command.isOnePhaseCommit() && (!ctx.isOriginLocal() || !command.hasModifications()) :
command.isOnePhaseCommit();
} | [
"protected",
"boolean",
"shouldCommitDuringPrepare",
"(",
"PrepareCommand",
"command",
",",
"TxInvocationContext",
"ctx",
")",
"{",
"return",
"totalOrder",
"?",
"command",
".",
"isOnePhaseCommit",
"(",
")",
"&&",
"(",
"!",
"ctx",
".",
"isOriginLocal",
"(",
")",
... | total order condition: only commits when it is remote context and the prepare has the flag 1PC set
@param command the prepare command
@param ctx the invocation context
@return true if the modification should be committed, false otherwise | [
"total",
"order",
"condition",
":",
"only",
"commits",
"when",
"it",
"is",
"remote",
"context",
"and",
"the",
"prepare",
"has",
"the",
"flag",
"1PC",
"set"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/impl/EntryWrappingInterceptor.java#L847-L851 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/NetworkEntryEvent.java | NetworkEntryEvent.addNodeActiveParticipant | public void addNodeActiveParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
null,
networkId);
} | java | public void addNodeActiveParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
null,
networkId);
} | [
"public",
"void",
"addNodeActiveParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"false",
",",
"null... | Add an Active Participant to this message representing the node doing
the network entry
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Add",
"an",
"Active",
"Participant",
"to",
"this",
"message",
"representing",
"the",
"node",
"doing",
"the",
"network",
"entry"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/NetworkEntryEvent.java#L52-L61 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java | DatabaseAdvisorsInner.getAsync | public Observable<AdvisorInner> getAsync(String resourceGroupName, String serverName, String databaseName, String advisorName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName).map(new Func1<ServiceResponse<AdvisorInner>, AdvisorInner>() {
@Override
... | java | public Observable<AdvisorInner> getAsync(String resourceGroupName, String serverName, String databaseName, String advisorName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName).map(new Func1<ServiceResponse<AdvisorInner>, AdvisorInner>() {
@Override
... | [
"public",
"Observable",
"<",
"AdvisorInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"advisorName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Returns details of a Database Advisor.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param advisorName The name of ... | [
"Returns",
"details",
"of",
"a",
"Database",
"Advisor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java#L205-L212 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Strings.java | Strings.startsWithIgnoreCase | public static boolean startsWithIgnoreCase(String str, String prefix) {
if (str == null || prefix == null) {
return false;
}
if (str.startsWith(prefix)) {
return true;
}
if (str.length() < prefix.length()) {
return false;
}
Stri... | java | public static boolean startsWithIgnoreCase(String str, String prefix) {
if (str == null || prefix == null) {
return false;
}
if (str.startsWith(prefix)) {
return true;
}
if (str.length() < prefix.length()) {
return false;
}
Stri... | [
"public",
"static",
"boolean",
"startsWithIgnoreCase",
"(",
"String",
"str",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"prefix",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"str",
".",
"startsWith",
"(... | Test if the given String starts with the specified prefix,
ignoring upper/lower case.
@param str the String to check
@param prefix the prefix to look for
@see java.lang.String#startsWith | [
"Test",
"if",
"the",
"given",
"String",
"starts",
"with",
"the",
"specified",
"prefix",
"ignoring",
"upper",
"/",
"lower",
"case",
"."
] | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Strings.java#L297-L310 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/URI.java | URI.prevalidate | protected boolean prevalidate(String component, BitSet disallowed) {
// prevalidate the given component by disallowed characters
if (component == null) {
return false; // undefined
}
char[] target = component.toCharArray();
for (int i = 0; i < target.length; i++) {
... | java | protected boolean prevalidate(String component, BitSet disallowed) {
// prevalidate the given component by disallowed characters
if (component == null) {
return false; // undefined
}
char[] target = component.toCharArray();
for (int i = 0; i < target.length; i++) {
... | [
"protected",
"boolean",
"prevalidate",
"(",
"String",
"component",
",",
"BitSet",
"disallowed",
")",
"{",
"// prevalidate the given component by disallowed characters",
"if",
"(",
"component",
"==",
"null",
")",
"{",
"return",
"false",
";",
"// undefined",
"}",
"char"... | Pre-validate the unescaped URI string within a specific component.
@param component the component string within the component
@param disallowed those characters disallowed within the component
@return if true, it doesn't have the disallowed characters
if false, the component is undefined or an incorrect one | [
"Pre",
"-",
"validate",
"the",
"unescaped",
"URI",
"string",
"within",
"a",
"specific",
"component",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/URI.java#L1808-L1820 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java | PaymentSession.createFromUrl | public static ListenableFuture<PaymentSession> createFromUrl(final String url, final boolean verifyPki)
throws PaymentProtocolException {
return createFromUrl(url, verifyPki, null);
} | java | public static ListenableFuture<PaymentSession> createFromUrl(final String url, final boolean verifyPki)
throws PaymentProtocolException {
return createFromUrl(url, verifyPki, null);
} | [
"public",
"static",
"ListenableFuture",
"<",
"PaymentSession",
">",
"createFromUrl",
"(",
"final",
"String",
"url",
",",
"final",
"boolean",
"verifyPki",
")",
"throws",
"PaymentProtocolException",
"{",
"return",
"createFromUrl",
"(",
"url",
",",
"verifyPki",
",",
... | Returns a future that will be notified with a PaymentSession object after it is fetched using the provided url.
url is an address where the {@link Protos.PaymentRequest} object may be fetched.
If the payment request object specifies a PKI method, then the system trust store will
be used to verify the signature provided... | [
"Returns",
"a",
"future",
"that",
"will",
"be",
"notified",
"with",
"a",
"PaymentSession",
"object",
"after",
"it",
"is",
"fetched",
"using",
"the",
"provided",
"url",
".",
"url",
"is",
"an",
"address",
"where",
"the",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java#L149-L152 |
lightoze/gwt-i18n-server | src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java | LocaleFactory.put | public static <T extends LocalizableResource> void put(Class<T> cls, T m) {
put(cls, null, m);
} | java | public static <T extends LocalizableResource> void put(Class<T> cls, T m) {
put(cls, null, m);
} | [
"public",
"static",
"<",
"T",
"extends",
"LocalizableResource",
">",
"void",
"put",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"T",
"m",
")",
"{",
"put",
"(",
"cls",
",",
"null",
",",
"m",
")",
";",
"}"
] | Populate localization object cache for <em>current</em> locale.
@param cls localization interface class
@param m localization object
@param <T> localization interface class | [
"Populate",
"localization",
"object",
"cache",
"for",
"<em",
">",
"current<",
"/",
"em",
">",
"locale",
"."
] | train | https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java#L83-L85 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/StrategyIO.java | StrategyIO.readLine | public static void readLine(final String line, final Map<Long, List<Pair<Long, Double>>> mapUserRecommendations) {
String[] toks = line.split("\t");
// mymedialite format: user \t [item:score,item:score,...]
if (line.contains(":") && line.contains(",")) {
Long user = Long.parseLong(t... | java | public static void readLine(final String line, final Map<Long, List<Pair<Long, Double>>> mapUserRecommendations) {
String[] toks = line.split("\t");
// mymedialite format: user \t [item:score,item:score,...]
if (line.contains(":") && line.contains(",")) {
Long user = Long.parseLong(t... | [
"public",
"static",
"void",
"readLine",
"(",
"final",
"String",
"line",
",",
"final",
"Map",
"<",
"Long",
",",
"List",
"<",
"Pair",
"<",
"Long",
",",
"Double",
">",
">",
">",
"mapUserRecommendations",
")",
"{",
"String",
"[",
"]",
"toks",
"=",
"line",
... | Read a file from the recommended items file.
@param line The line.
@param mapUserRecommendations The recommendations for the users where
information will be stored into. | [
"Read",
"a",
"file",
"from",
"the",
"recommended",
"items",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/StrategyIO.java#L43-L71 |
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B) {
A.assertSquare();
B.assertSquare();
FloatMatrix W = new FloatMatrix(A.rows);
SimpleBlas.sygvd(1, 'N', 'U', A.dup(), B.dup(), W);
return W;
} | java | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B) {
A.assertSquare();
B.assertSquare();
FloatMatrix W = new FloatMatrix(A.rows);
SimpleBlas.sygvd(1, 'N', 'U', A.dup(), B.dup(), W);
return W;
} | [
"public",
"static",
"FloatMatrix",
"symmetricGeneralizedEigenvalues",
"(",
"FloatMatrix",
"A",
",",
"FloatMatrix",
"B",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
")",
";",
"FloatMatrix",
"W",
"=",
"new",
"FloatMatrix",
... | Compute generalized eigenvalues of the problem A x = L B x.
@param A symmetric Matrix A. Only the upper triangle will be considered.
@param B symmetric Matrix B. Only the upper triangle will be considered.
@return a vector of eigenvalues L. | [
"Compute",
"generalized",
"eigenvalues",
"of",
"the",
"problem",
"A",
"x",
"=",
"L",
"B",
"x",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L393-L399 |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/StaticMapsApi.java | StaticMapsApi.newRequest | public static StaticMapsRequest newRequest(GeoApiContext context, Size size) {
return new StaticMapsRequest(context).size(size);
} | java | public static StaticMapsRequest newRequest(GeoApiContext context, Size size) {
return new StaticMapsRequest(context).size(size);
} | [
"public",
"static",
"StaticMapsRequest",
"newRequest",
"(",
"GeoApiContext",
"context",
",",
"Size",
"size",
")",
"{",
"return",
"new",
"StaticMapsRequest",
"(",
"context",
")",
".",
"size",
"(",
"size",
")",
";",
"}"
] | Create a new {@code StaticMapRequest}.
@param context The {@code GeoApiContext} to make this request through.
@param size The size of the static map.
@return Returns a new {@code StaticMapRequest} with configured size. | [
"Create",
"a",
"new",
"{",
"@code",
"StaticMapRequest",
"}",
"."
] | train | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/StaticMapsApi.java#L31-L33 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.wrapKey | public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) {
return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body();
} | java | public KeyOperationResult wrapKey(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value) {
return wrapKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value).toBlocking().single().body();
} | [
"public",
"KeyOperationResult",
"wrapKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"JsonWebKeyEncryptionAlgorithm",
"algorithm",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"return",
"wrapKeyWithServiceResponseAsync",
"... | Wraps a symmetric key using a specified key.
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can ... | [
"Wraps",
"a",
"symmetric",
"key",
"using",
"a",
"specified",
"key",
".",
"The",
"WRAP",
"operation",
"supports",
"encryption",
"of",
"a",
"symmetric",
"key",
"using",
"a",
"key",
"encryption",
"key",
"that",
"has",
"previously",
"been",
"stored",
"in",
"an",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2602-L2604 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.setHours | public static <T extends java.util.Date> T setHours(final T date, final int amount) {
return set(date, Calendar.HOUR_OF_DAY, amount);
} | java | public static <T extends java.util.Date> T setHours(final T date, final int amount) {
return set(date, Calendar.HOUR_OF_DAY, amount);
} | [
"public",
"static",
"<",
"T",
"extends",
"java",
".",
"util",
".",
"Date",
">",
"T",
"setHours",
"(",
"final",
"T",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"date",
",",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"amount",
")"... | Copied from Apache Commons Lang under Apache License v2.
<br />
Sets the hours field to a date returning a new object. Hours range
from 0-23.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to set
@return a new {@code Date} set with the specified value
@throws Illega... | [
"Copied",
"from",
"Apache",
"Commons",
"Lang",
"under",
"Apache",
"License",
"v2",
".",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L751-L753 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaManager.java | PartitionReplicaManager.checkAndGetPrimaryReplicaOwner | PartitionReplica checkAndGetPrimaryReplicaOwner(int partitionId, int replicaIndex) {
InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);
PartitionReplica owner = partition.getOwnerReplicaOrNull();
if (owner == null) {
logger.info("Sync replica targe... | java | PartitionReplica checkAndGetPrimaryReplicaOwner(int partitionId, int replicaIndex) {
InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);
PartitionReplica owner = partition.getOwnerReplicaOrNull();
if (owner == null) {
logger.info("Sync replica targe... | [
"PartitionReplica",
"checkAndGetPrimaryReplicaOwner",
"(",
"int",
"partitionId",
",",
"int",
"replicaIndex",
")",
"{",
"InternalPartitionImpl",
"partition",
"=",
"partitionStateManager",
".",
"getPartitionImpl",
"(",
"partitionId",
")",
";",
"PartitionReplica",
"owner",
"... | Checks preconditions for replica sync - if we don't know the owner yet, if this node is the owner or not a replica | [
"Checks",
"preconditions",
"for",
"replica",
"sync",
"-",
"if",
"we",
"don",
"t",
"know",
"the",
"owner",
"yet",
"if",
"this",
"node",
"is",
"the",
"owner",
"or",
"not",
"a",
"replica"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaManager.java#L160-L187 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/modules/ServerCommonLoginModule.java | ServerCommonLoginModule.setCredentials | protected void setCredentials(Subject subject,
String securityName,
String urAuthenticatedId) throws Exception {
// Principal principal = new WSPrincipal(securityName, accessId, authMethod);
if (urAuthenticatedId != null && !urAuthentica... | java | protected void setCredentials(Subject subject,
String securityName,
String urAuthenticatedId) throws Exception {
// Principal principal = new WSPrincipal(securityName, accessId, authMethod);
if (urAuthenticatedId != null && !urAuthentica... | [
"protected",
"void",
"setCredentials",
"(",
"Subject",
"subject",
",",
"String",
"securityName",
",",
"String",
"urAuthenticatedId",
")",
"throws",
"Exception",
"{",
"// Principal principal = new WSPrincipal(securityName, accessId, authMethod);",
"if",
"(",
"urAuthentica... | Set the relevant Credentials for this login module into the Subject,
and set the credentials for the determined accessId.
@throws Exception | [
"Set",
"the",
"relevant",
"Credentials",
"for",
"this",
"login",
"module",
"into",
"the",
"Subject",
"and",
"set",
"the",
"credentials",
"for",
"the",
"determined",
"accessId",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/modules/ServerCommonLoginModule.java#L137-L149 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object,
final boolean testTransients) {
return reflectionHashCode(initialNonZeroOddNumber, multiplierNonZeroOddNumber, object, testTr... | java | @GwtIncompatible("incompatible method")
public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object,
final boolean testTransients) {
return reflectionHashCode(initialNonZeroOddNumber, multiplierNonZeroOddNumber, object, testTr... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"int",
"reflectionHashCode",
"(",
"final",
"int",
"initialNonZeroOddNumber",
",",
"final",
"int",
"multiplierNonZeroOddNumber",
",",
"final",
"Object",
"object",
",",
"final",
"boolean",
... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security exception if run under a security manager, if the permissions are not set up correctly. It is
also no... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java#L307-L311 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_route_POST | public OvhRouteHttp serviceName_http_route_POST(String serviceName, OvhRouteHttpAction action, String displayName, Long frontendId, Long weight) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | java | public OvhRouteHttp serviceName_http_route_POST(String serviceName, OvhRouteHttpAction action, String displayName, Long frontendId, Long weight) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | [
"public",
"OvhRouteHttp",
"serviceName_http_route_POST",
"(",
"String",
"serviceName",
",",
"OvhRouteHttpAction",
"action",
",",
"String",
"displayName",
",",
"Long",
"frontendId",
",",
"Long",
"weight",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"... | Add a new HTTP route to your frontend
REST: POST /ipLoadbalancing/{serviceName}/http/route
@param weight [required] Route priority ([0..255]). 0 if null. Highest priority routes are evaluated last. Only the first matching route will trigger an action
@param frontendId [required] Route traffic for this frontend
@param ... | [
"Add",
"a",
"new",
"HTTP",
"route",
"to",
"your",
"frontend"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L121-L131 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java | DirectoryConnection.sendConnectProtocol | private ErrorCode sendConnectProtocol(long to) {
String sessId = session.id;
ErrorCode ec = ErrorCode.OK;
ConnectProtocol conReq = new ConnectProtocol(0, lastDxid,
session.timeOut, sessId, session.password, authData.userName, authData.secret, authData.obfuscated);
Servic... | java | private ErrorCode sendConnectProtocol(long to) {
String sessId = session.id;
ErrorCode ec = ErrorCode.OK;
ConnectProtocol conReq = new ConnectProtocol(0, lastDxid,
session.timeOut, sessId, session.password, authData.userName, authData.secret, authData.obfuscated);
Servic... | [
"private",
"ErrorCode",
"sendConnectProtocol",
"(",
"long",
"to",
")",
"{",
"String",
"sessId",
"=",
"session",
".",
"id",
";",
"ErrorCode",
"ec",
"=",
"ErrorCode",
".",
"OK",
";",
"ConnectProtocol",
"conReq",
"=",
"new",
"ConnectProtocol",
"(",
"0",
",",
... | Send the Connect Protocol to the remote Directory Server.
@param to
the connection timeout.
@return
the ErrorCode of the request, OK for success. | [
"Send",
"the",
"Connect",
"Protocol",
"to",
"the",
"remote",
"Directory",
"Server",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java#L748-L775 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findAll | @Override
public List<CommerceCountry> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceCountry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCountry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce countries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"countries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L4996-L4999 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java | TraceServiceClient.batchWriteSpans | public final void batchWriteSpans(String name, List<Span> spans) {
BatchWriteSpansRequest request =
BatchWriteSpansRequest.newBuilder().setName(name).addAllSpans(spans).build();
batchWriteSpans(request);
} | java | public final void batchWriteSpans(String name, List<Span> spans) {
BatchWriteSpansRequest request =
BatchWriteSpansRequest.newBuilder().setName(name).addAllSpans(spans).build();
batchWriteSpans(request);
} | [
"public",
"final",
"void",
"batchWriteSpans",
"(",
"String",
"name",
",",
"List",
"<",
"Span",
">",
"spans",
")",
"{",
"BatchWriteSpansRequest",
"request",
"=",
"BatchWriteSpansRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"ad... | Sends new spans to new or existing traces. You cannot update existing spans.
<p>Sample code:
<pre><code>
try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
ProjectName name = ProjectName.of("[PROJECT]");
List<Span> spans = new ArrayList<>();
traceServiceClient.batchWriteSpans(name... | [
"Sends",
"new",
"spans",
"to",
"new",
"or",
"existing",
"traces",
".",
"You",
"cannot",
"update",
"existing",
"spans",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java#L205-L210 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java | MLStructure.getField | public MLArray getField(String name, int m, int n)
{
return getField(name, getIndex(m,n) );
} | java | public MLArray getField(String name, int m, int n)
{
return getField(name, getIndex(m,n) );
} | [
"public",
"MLArray",
"getField",
"(",
"String",
"name",
",",
"int",
"m",
",",
"int",
"n",
")",
"{",
"return",
"getField",
"(",
"name",
",",
"getIndex",
"(",
"m",
",",
"n",
")",
")",
";",
"}"
] | Gets a value of the field described by name from (m,n)'th struct
in struct array or null if the field doesn't exist.
@param name
@param m
@param n
@return | [
"Gets",
"a",
"value",
"of",
"the",
"field",
"described",
"by",
"name",
"from",
"(",
"m",
"n",
")",
"th",
"struct",
"in",
"struct",
"array",
"or",
"null",
"if",
"the",
"field",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L186-L189 |
wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.hasJsonSchemaFile | private boolean hasJsonSchemaFile(ZipFile jarFile, Class<?> modelClass) throws IOException {
String path = JsonSchemaBundleTracker.SCHEMA_CLASSPATH_PREFIX + "/" + modelClass.getName() + ".json";
return jarFile.getEntry(path) != null;
} | java | private boolean hasJsonSchemaFile(ZipFile jarFile, Class<?> modelClass) throws IOException {
String path = JsonSchemaBundleTracker.SCHEMA_CLASSPATH_PREFIX + "/" + modelClass.getName() + ".json";
return jarFile.getEntry(path) != null;
} | [
"private",
"boolean",
"hasJsonSchemaFile",
"(",
"ZipFile",
"jarFile",
",",
"Class",
"<",
"?",
">",
"modelClass",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"JsonSchemaBundleTracker",
".",
"SCHEMA_CLASSPATH_PREFIX",
"+",
"\"/\"",
"+",
"modelClass",
"... | Gets bundle header/mainfest entry Caravan-HalDocs-DomainPath from given JAR file.
@param jarFile JAR file
@return Header value or null
@throws IOException | [
"Gets",
"bundle",
"header",
"/",
"mainfest",
"entry",
"Caravan",
"-",
"HalDocs",
"-",
"DomainPath",
"from",
"given",
"JAR",
"file",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L304-L307 |
chemouna/Decor | decor/src/main/java/com/mounacheikhna/decor/DecorLayoutInflater.java | DecorLayoutInflater.onCreateView | @Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base
// classes, if this fails its pretty certain the app will fail at this point.
View view = null;
... | java | @Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base
// classes, if this fails its pretty certain the app will fail at this point.
View view = null;
... | [
"@",
"Override",
"protected",
"View",
"onCreateView",
"(",
"String",
"name",
",",
"AttributeSet",
"attrs",
")",
"throws",
"ClassNotFoundException",
"{",
"// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base",
"// classes, if this fails its pretty cer... | The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
BUT only for none CustomViews.
Basically if this method doesn't inflate the View nothing probably will. | [
"The",
"LayoutInflater",
"onCreateView",
"is",
"the",
"fourth",
"port",
"of",
"call",
"for",
"LayoutInflation",
".",
"BUT",
"only",
"for",
"none",
"CustomViews",
".",
"Basically",
"if",
"this",
"method",
"doesn",
"t",
"inflate",
"the",
"View",
"nothing",
"prob... | train | https://github.com/chemouna/Decor/blob/82b1c1be3c7769e0b63c6eb16f0c01055fb3e4ca/decor/src/main/java/com/mounacheikhna/decor/DecorLayoutInflater.java#L130-L146 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/spout/AmBaseSpout.java | AmBaseSpout.emitWithNoKeyIdAndGrouping | protected void emitWithNoKeyIdAndGrouping(StreamMessage message, String groupingKey)
{
this.getCollector().emit(new Values(groupingKey, message));
} | java | protected void emitWithNoKeyIdAndGrouping(StreamMessage message, String groupingKey)
{
this.getCollector().emit(new Values(groupingKey, message));
} | [
"protected",
"void",
"emitWithNoKeyIdAndGrouping",
"(",
"StreamMessage",
"message",
",",
"String",
"groupingKey",
")",
"{",
"this",
".",
"getCollector",
"(",
")",
".",
"emit",
"(",
"new",
"Values",
"(",
"groupingKey",
",",
"message",
")",
")",
";",
"}"
] | Not use this class's key history function, and not use MessageId(Id identify by storm).<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<li>Not use this class's key history function.</li>
<li>Not use storm's fault detect function.</li>
</ol>
@param message sending message
... | [
"Not",
"use",
"this",
"class",
"s",
"key",
"history",
"function",
"and",
"not",
"use",
"MessageId",
"(",
"Id",
"identify",
"by",
"storm",
")",
".",
"<br",
">",
"Send",
"message",
"to",
"downstream",
"component",
"with",
"grouping",
"key",
".",
"<br",
">"... | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/spout/AmBaseSpout.java#L372-L375 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.scoreExamplesMultiDataSet | public JavaDoubleRDD scoreExamplesMultiDataSet(JavaRDD<MultiDataSet> data, boolean includeRegularizationTerms) {
return scoreExamplesMultiDataSet(data, includeRegularizationTerms, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | java | public JavaDoubleRDD scoreExamplesMultiDataSet(JavaRDD<MultiDataSet> data, boolean includeRegularizationTerms) {
return scoreExamplesMultiDataSet(data, includeRegularizationTerms, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | [
"public",
"JavaDoubleRDD",
"scoreExamplesMultiDataSet",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
",",
"boolean",
"includeRegularizationTerms",
")",
"{",
"return",
"scoreExamplesMultiDataSet",
"(",
"data",
",",
"includeRegularizationTerms",
",",
"DEFAULT_EVAL_SCORE_... | Score the examples individually, using the default batch size {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}. Unlike {@link #calculateScore(JavaRDD, boolean)},
this method returns a score for each example separately. If scoring is needed for specific examples use either
{@link #scoreExamples(JavaPairRDD, boolean)} or {@link #s... | [
"Score",
"the",
"examples",
"individually",
"using",
"the",
"default",
"batch",
"size",
"{",
"@link",
"#DEFAULT_EVAL_SCORE_BATCH_SIZE",
"}",
".",
"Unlike",
"{",
"@link",
"#calculateScore",
"(",
"JavaRDD",
"boolean",
")",
"}",
"this",
"method",
"returns",
"a",
"s... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L466-L468 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.dedicated_server_firewall_firewallModel_GET | public OvhPrice dedicated_server_firewall_firewallModel_GET(net.minidev.ovh.api.price.dedicated.server.OvhFirewallEnum firewallModel) throws IOException {
String qPath = "/price/dedicated/server/firewall/{firewallModel}";
StringBuilder sb = path(qPath, firewallModel);
String resp = exec(qPath, "GET", sb.toString(... | java | public OvhPrice dedicated_server_firewall_firewallModel_GET(net.minidev.ovh.api.price.dedicated.server.OvhFirewallEnum firewallModel) throws IOException {
String qPath = "/price/dedicated/server/firewall/{firewallModel}";
StringBuilder sb = path(qPath, firewallModel);
String resp = exec(qPath, "GET", sb.toString(... | [
"public",
"OvhPrice",
"dedicated_server_firewall_firewallModel_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"dedicated",
".",
"server",
".",
"OvhFirewallEnum",
"firewallModel",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"... | Get price of available firewall models
REST: GET /price/dedicated/server/firewall/{firewallModel}
@param firewallModel [required] Model of firewall | [
"Get",
"price",
"of",
"available",
"firewall",
"models"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L115-L120 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/ds/ActiveDirectory.java | ActiveDirectory.setupBasicProperties | private Hashtable<?,?> setupBasicProperties(Hashtable<String,Object> env)
throws NamingException
{
return setupBasicProperties(env,this.fullUrl);
} | java | private Hashtable<?,?> setupBasicProperties(Hashtable<String,Object> env)
throws NamingException
{
return setupBasicProperties(env,this.fullUrl);
} | [
"private",
"Hashtable",
"<",
"?",
",",
"?",
">",
"setupBasicProperties",
"(",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"env",
")",
"throws",
"NamingException",
"{",
"return",
"setupBasicProperties",
"(",
"env",
",",
"this",
".",
"fullUrl",
")",
";",
... | Sets basic LDAP connection properties in env.
@param env
The LDAP security environment
@param url
The LDAP URL
@param tracing
LDAP tracing level. Output to System.err
@param referralType
Referral type: follow, ignore, or throw
@param aliasType
Alias type: finding, searching, etc.
@throws NamingException
Thrown if the ... | [
"Sets",
"basic",
"LDAP",
"connection",
"properties",
"in",
"env",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/ds/ActiveDirectory.java#L200-L204 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/PRCurve.java | PRCurve.fmeasure | public double fmeasure(int numleft, int numright) {
int tp = 0, fp = 0, fn = 0;
tp = numpositive[numright];
fp = numright - tp;
fn = numleft - numnegative[numleft];
return f1(tp, fp, fn);
} | java | public double fmeasure(int numleft, int numright) {
int tp = 0, fp = 0, fn = 0;
tp = numpositive[numright];
fp = numright - tp;
fn = numleft - numnegative[numleft];
return f1(tp, fp, fn);
} | [
"public",
"double",
"fmeasure",
"(",
"int",
"numleft",
",",
"int",
"numright",
")",
"{",
"int",
"tp",
"=",
"0",
",",
"fp",
"=",
"0",
",",
"fn",
"=",
"0",
";",
"tp",
"=",
"numpositive",
"[",
"numright",
"]",
";",
"fp",
"=",
"numright",
"-",
"tp",
... | the f-measure if we just guess as negativ the first numleft and guess as poitive the last numright | [
"the",
"f",
"-",
"measure",
"if",
"we",
"just",
"guess",
"as",
"negativ",
"the",
"first",
"numleft",
"and",
"guess",
"as",
"poitive",
"the",
"last",
"numright"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/PRCurve.java#L181-L187 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java | AsymmetricCipher.buildInstance | public static CipherUtil buildInstance(byte[] privateKey, byte[] publicKey) {
PrivateKey priKey = KeyTools.getPrivateKeyFromPKCS8(Algorithms.RSA.name(),
new ByteArrayInputStream(privateKey));
PublicKey pubKey = KeyTools.getPublicKeyFromX509(Algorithms.RSA.name(),
new ByteArrayInp... | java | public static CipherUtil buildInstance(byte[] privateKey, byte[] publicKey) {
PrivateKey priKey = KeyTools.getPrivateKeyFromPKCS8(Algorithms.RSA.name(),
new ByteArrayInputStream(privateKey));
PublicKey pubKey = KeyTools.getPublicKeyFromX509(Algorithms.RSA.name(),
new ByteArrayInp... | [
"public",
"static",
"CipherUtil",
"buildInstance",
"(",
"byte",
"[",
"]",
"privateKey",
",",
"byte",
"[",
"]",
"publicKey",
")",
"{",
"PrivateKey",
"priKey",
"=",
"KeyTools",
".",
"getPrivateKeyFromPKCS8",
"(",
"Algorithms",
".",
"RSA",
".",
"name",
"(",
")"... | 非对称加密构造器
@param privateKey PKCS8格式的私钥(BASE64 encode过的)
@param publicKey X509格式的公钥(BASE64 encode过的)
@return AsymmetricCipher | [
"非对称加密构造器"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java#L54-L60 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/CloudantClient.java | CloudantClient.getActiveTasks | public List<Task> getActiveTasks() {
InputStream response = null;
URI uri = new URIBase(getBaseUri()).path("_active_tasks").build();
try {
response = couchDbClient.get(uri);
return getResponseList(response, couchDbClient.getGson(), DeserializationTypes.TASKS);
} f... | java | public List<Task> getActiveTasks() {
InputStream response = null;
URI uri = new URIBase(getBaseUri()).path("_active_tasks").build();
try {
response = couchDbClient.get(uri);
return getResponseList(response, couchDbClient.getGson(), DeserializationTypes.TASKS);
} f... | [
"public",
"List",
"<",
"Task",
">",
"getActiveTasks",
"(",
")",
"{",
"InputStream",
"response",
"=",
"null",
";",
"URI",
"uri",
"=",
"new",
"URIBase",
"(",
"getBaseUri",
"(",
")",
")",
".",
"path",
"(",
"\"_active_tasks\"",
")",
".",
"build",
"(",
")",... | Get the list of active tasks from the server.
@return List of tasks
@see <a href="https://console.bluemix.net/docs/services/Cloudant/api/active_tasks.html">
Active tasks</a> | [
"Get",
"the",
"list",
"of",
"active",
"tasks",
"from",
"the",
"server",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/CloudantClient.java#L180-L189 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.getByResourceGroupAsync | public Observable<DomainInner> getByResourceGroupAsync(String resourceGroupName, String domainName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() {
@Override
public DomainInner call(ServiceRes... | java | public Observable<DomainInner> getByResourceGroupAsync(String resourceGroupName, String domainName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() {
@Override
public DomainInner call(ServiceRes... | [
"public",
"Observable",
"<",
"DomainInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
")",
".",
"map",
"... | Get a domain.
Get properties of a domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DomainInner object | [
"Get",
"a",
"domain",
".",
"Get",
"properties",
"of",
"a",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L153-L160 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_serviceInfos_PUT | public void organizationName_service_exchangeService_serviceInfos_PUT(String organizationName, String exchangeService, OvhService body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos";
StringBuilder sb = path(qPath, organizationName, exchangeService);
... | java | public void organizationName_service_exchangeService_serviceInfos_PUT(String organizationName, String exchangeService, OvhService body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos";
StringBuilder sb = path(qPath, organizationName, exchangeService);
... | [
"public",
"void",
"organizationName_service_exchangeService_serviceInfos_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/servic... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/serviceInfos
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L351-L355 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java | RegistriesInner.beginUpdatePoliciesAsync | public Observable<RegistryPoliciesInner> beginUpdatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).map(new Func1<ServiceRe... | java | public Observable<RegistryPoliciesInner> beginUpdatePoliciesAsync(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).map(new Func1<ServiceRe... | [
"public",
"Observable",
"<",
"RegistryPoliciesInner",
">",
"beginUpdatePoliciesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryPoliciesInner",
"registryPoliciesUpdateParameters",
")",
"{",
"return",
"beginUpdatePoliciesWithServiceResponseA... | Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registryPoliciesUpdateParameters The parameters for updating policies of a container registry.
@thro... | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java#L1682-L1689 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertSame | public static void assertSame(String message, Object expected, Object actual) {
String expectedInQuotes = inQuotesIfNotNull(expected);
String actualInQuotes = inQuotesIfNotNull(actual);
if (expected == actual) {
pass(message);
} else {
fail(message, actualInQuot... | java | public static void assertSame(String message, Object expected, Object actual) {
String expectedInQuotes = inQuotesIfNotNull(expected);
String actualInQuotes = inQuotesIfNotNull(actual);
if (expected == actual) {
pass(message);
} else {
fail(message, actualInQuot... | [
"public",
"static",
"void",
"assertSame",
"(",
"String",
"message",
",",
"Object",
"expected",
",",
"Object",
"actual",
")",
"{",
"String",
"expectedInQuotes",
"=",
"inQuotesIfNotNull",
"(",
"expected",
")",
";",
"String",
"actualInQuotes",
"=",
"inQuotesIfNotNull... | Assert that an actual value is the same object as an expected value.
<p>
Sameness is tested with the == operator.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param expected the expected v... | [
"Assert",
"that",
"an",
"actual",
"value",
"is",
"the",
"same",
"object",
"as",
"an",
"expected",
"value",
".",
"<p",
">",
"Sameness",
"is",
"tested",
"with",
"the",
"==",
"operator",
".",
"<p",
">",
"If",
"the",
"assertion",
"passes",
"a",
"green",
"t... | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L314-L324 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/SpectrumUtils.java | SpectrumUtils.isWithinPpm | public static boolean isWithinPpm(double mz1, double mz2, double ppm) {
return Math.abs(amu2ppm(mz1, mz1 - mz2)) <= ppm;
} | java | public static boolean isWithinPpm(double mz1, double mz2, double ppm) {
return Math.abs(amu2ppm(mz1, mz1 - mz2)) <= ppm;
} | [
"public",
"static",
"boolean",
"isWithinPpm",
"(",
"double",
"mz1",
",",
"double",
"mz2",
",",
"double",
"ppm",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"amu2ppm",
"(",
"mz1",
",",
"mz1",
"-",
"mz2",
")",
")",
"<=",
"ppm",
";",
"}"
] | Check if the 2nd m/z value is within some PPM distance from the 1st one. PPM will be calculated
based on the 1st m/z value.
@param mz1 PPM tolerance will be calculated relative to this value
@param mz2 the value to check for being within some PPM range | [
"Check",
"if",
"the",
"2nd",
"m",
"/",
"z",
"value",
"is",
"within",
"some",
"PPM",
"distance",
"from",
"the",
"1st",
"one",
".",
"PPM",
"will",
"be",
"calculated",
"based",
"on",
"the",
"1st",
"m",
"/",
"z",
"value",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/SpectrumUtils.java#L57-L59 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_sqlserver_serviceName_upgrade_duration_GET | public OvhOrder license_sqlserver_serviceName_upgrade_duration_GET(String serviceName, String duration, OvhSqlServerVersionEnum version) throws IOException {
String qPath = "/order/license/sqlserver/{serviceName}/upgrade/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "version", vers... | java | public OvhOrder license_sqlserver_serviceName_upgrade_duration_GET(String serviceName, String duration, OvhSqlServerVersionEnum version) throws IOException {
String qPath = "/order/license/sqlserver/{serviceName}/upgrade/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "version", vers... | [
"public",
"OvhOrder",
"license_sqlserver_serviceName_upgrade_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhSqlServerVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/license/sqlserver/{serviceName}/u... | Get prices and contracts information
REST: GET /order/license/sqlserver/{serviceName}/upgrade/{duration}
@param version [required] This license version
@param serviceName [required] The name of your SQL Server license
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1411-L1417 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.