repo
stringclasses
11 values
path
stringlengths
41
214
func_name
stringlengths
7
82
original_string
stringlengths
77
11.9k
language
stringclasses
1 value
code
stringlengths
77
11.9k
code_tokens
listlengths
22
1.57k
docstring
stringlengths
2
2.27k
docstring_tokens
listlengths
1
352
sha
stringclasses
11 values
url
stringlengths
129
319
partition
stringclasses
1 value
summary
stringlengths
7
191
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
looly/hutool
hutool-core/src/main/java/cn/hutool/core/net/URLEncoder.java
URLEncoder.createQuery
public static URLEncoder createQuery() { final URLEncoder encoder = new URLEncoder(); // Special encoding for space encoder.setEncodeSpaceAsPlus(true); // Alpha and digit are safe by default // Add the other permitted characters encoder.addSafeCharacter('*'); encoder.addSafeCharacter('-'); encod...
java
public static URLEncoder createQuery() { final URLEncoder encoder = new URLEncoder(); // Special encoding for space encoder.setEncodeSpaceAsPlus(true); // Alpha and digit are safe by default // Add the other permitted characters encoder.addSafeCharacter('*'); encoder.addSafeCharacter('-'); encod...
[ "public", "static", "URLEncoder", "createQuery", "(", ")", "{", "final", "URLEncoder", "encoder", "=", "new", "URLEncoder", "(", ")", ";", "// Special encoding for space\r", "encoder", ".", "setEncodeSpaceAsPlus", "(", "true", ")", ";", "// Alpha and digit are safe by...
创建用于查询语句的{@link URLEncoder}<br> 编码器针对URI路径编码,定义如下: <pre> 0x20 ' ' =》 '+' 0x2A, 0x2D, 0x2E, 0x30 to 0x39, 0x41 to 0x5A, 0x5F, 0x61 to 0x7A as-is '*', '-', '.', '0' to '9', 'A' to 'Z', '_', 'a' to 'z' Also '=' and '&' 不编码 其它编码为 %nn 形式 </pre> 详细见:https://www.w3.org/TR/html5/forms.html#application/x-www-form-urlencoded-e...
[ "创建用于查询语句的", "{", "@link", "URLEncoder", "}", "<br", ">", "编码器针对URI路径编码,定义如下:" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/net/URLEncoder.java#L109-L123
train
Creates a new URLEncoder for use with the URL Query class.
[ 30522, 2270, 10763, 24471, 7770, 16044, 2099, 3443, 4226, 2854, 1006, 1007, 1063, 2345, 24471, 7770, 16044, 2099, 4372, 16044, 2099, 1027, 2047, 24471, 7770, 16044, 2099, 1006, 1007, 1025, 1013, 1013, 2569, 17181, 2005, 2686, 4372, 16044, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalStater.java
CanalStater.buildMQProperties
private static MQProperties buildMQProperties(Properties properties) { MQProperties mqProperties = new MQProperties(); String servers = CanalController.getProperty(properties, CanalConstants.CANAL_MQ_SERVERS); if (!StringUtils.isEmpty(servers)) { mqProperties.setServers(servers); ...
java
private static MQProperties buildMQProperties(Properties properties) { MQProperties mqProperties = new MQProperties(); String servers = CanalController.getProperty(properties, CanalConstants.CANAL_MQ_SERVERS); if (!StringUtils.isEmpty(servers)) { mqProperties.setServers(servers); ...
[ "private", "static", "MQProperties", "buildMQProperties", "(", "Properties", "properties", ")", "{", "MQProperties", "mqProperties", "=", "new", "MQProperties", "(", ")", ";", "String", "servers", "=", "CanalController", ".", "getProperty", "(", "properties", ",", ...
构造MQ对应的配置 @param properties canal.properties 配置 @return
[ "构造MQ对应的配置" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalStater.java#L146-L220
train
Build MQProperties from properties
[ 30522, 2797, 10763, 1049, 4160, 21572, 4842, 7368, 3857, 2213, 4160, 21572, 4842, 7368, 1006, 5144, 5144, 1007, 1063, 1049, 4160, 21572, 4842, 7368, 1049, 4160, 21572, 4842, 7368, 1027, 2047, 1049, 4160, 21572, 4842, 7368, 1006, 1007, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
DataSet.partitionByHash
public <K extends Comparable<K>> PartitionOperator<T> partitionByHash(KeySelector<T, K> keyExtractor) { final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, getType()); return new PartitionOperator<>(this, PartitionMethod.HASH, new Keys.SelectorFunctionKeys<>(clean(keyExtractor), this....
java
public <K extends Comparable<K>> PartitionOperator<T> partitionByHash(KeySelector<T, K> keyExtractor) { final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, getType()); return new PartitionOperator<>(this, PartitionMethod.HASH, new Keys.SelectorFunctionKeys<>(clean(keyExtractor), this....
[ "public", "<", "K", "extends", "Comparable", "<", "K", ">", ">", "PartitionOperator", "<", "T", ">", "partitionByHash", "(", "KeySelector", "<", "T", ",", "K", ">", "keyExtractor", ")", "{", "final", "TypeInformation", "<", "K", ">", "keyType", "=", "Typ...
Partitions a DataSet using the specified KeySelector. <p><b>Important:</b>This operation shuffles the whole DataSet over the network and can take significant amount of time. @param keyExtractor The KeyExtractor with which the DataSet is hash-partitioned. @return The partitioned DataSet. @see KeySelector
[ "Partitions", "a", "DataSet", "using", "the", "specified", "KeySelector", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L1283-L1286
train
Partitions this DataSet by a hash function.
[ 30522, 2270, 1026, 1047, 8908, 12435, 1026, 1047, 1028, 1028, 13571, 25918, 8844, 1026, 1056, 1028, 13571, 3762, 14949, 2232, 1006, 6309, 12260, 16761, 1026, 1056, 1010, 1047, 1028, 3145, 10288, 6494, 16761, 1007, 1063, 2345, 2828, 2378, 14...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java
Configuration.getSocketAddr
public InetSocketAddress getSocketAddr( String hostProperty, String addressProperty, String defaultAddressValue, int defaultPort) { InetSocketAddress bindAddr = getSocketAddr( addressProperty, defaultAddressValue, defaultPort); final String host = get(hostProperty); if (host == null || host.isE...
java
public InetSocketAddress getSocketAddr( String hostProperty, String addressProperty, String defaultAddressValue, int defaultPort) { InetSocketAddress bindAddr = getSocketAddr( addressProperty, defaultAddressValue, defaultPort); final String host = get(hostProperty); if (host == null || host.isE...
[ "public", "InetSocketAddress", "getSocketAddr", "(", "String", "hostProperty", ",", "String", "addressProperty", ",", "String", "defaultAddressValue", ",", "int", "defaultPort", ")", "{", "InetSocketAddress", "bindAddr", "=", "getSocketAddr", "(", "addressProperty", ","...
Get the socket address for <code>hostProperty</code> as a <code>InetSocketAddress</code>. If <code>hostProperty</code> is <code>null</code>, <code>addressProperty</code> will be used. This is useful for cases where we want to differentiate between host bind address and address clients should use to establish connection...
[ "Get", "the", "socket", "address", "for", "<code", ">", "hostProperty<", "/", "code", ">", "as", "a", "<code", ">", "InetSocketAddress<", "/", "code", ">", ".", "If", "<code", ">", "hostProperty<", "/", "code", ">", "is", "<code", ">", "null<", "/", "c...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2275-L2292
train
Get the SocketAddress from the properties.
[ 30522, 2270, 1999, 8454, 30524, 21572, 4842, 3723, 1010, 5164, 12398, 4215, 16200, 4757, 10175, 5657, 1010, 20014, 12398, 6442, 1007, 1063, 1999, 8454, 7432, 12928, 14141, 8303, 14187, 4215, 13626, 1027, 4152, 7432, 12928, 14141, 2099, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.newHashSet
public static <T> HashSet<T> newHashSet(boolean isSorted, Collection<T> collection) { return isSorted ? new LinkedHashSet<T>(collection) : new HashSet<T>(collection); }
java
public static <T> HashSet<T> newHashSet(boolean isSorted, Collection<T> collection) { return isSorted ? new LinkedHashSet<T>(collection) : new HashSet<T>(collection); }
[ "public", "static", "<", "T", ">", "HashSet", "<", "T", ">", "newHashSet", "(", "boolean", "isSorted", ",", "Collection", "<", "T", ">", "collection", ")", "{", "return", "isSorted", "?", "new", "LinkedHashSet", "<", "T", ">", "(", "collection", ")", "...
新建一个HashSet @param <T> 集合元素类型 @param isSorted 是否有序,有序返回 {@link LinkedHashSet},否则返回{@link HashSet} @param collection 集合,用于初始化Set @return HashSet对象
[ "新建一个HashSet" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L459-L461
train
Creates a new set of objects from the given collection.
[ 30522, 2270, 10763, 1026, 1056, 1028, 23325, 13462, 1026, 1056, 1028, 2047, 14949, 7898, 3388, 1006, 22017, 20898, 26354, 15613, 1010, 3074, 1026, 1056, 1028, 3074, 1007, 1063, 2709, 26354, 15613, 1029, 2047, 5799, 14949, 7898, 3388, 1026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
MysqlEventParser.buildMysqlConnection
private MysqlConnection buildMysqlConnection(AuthenticationInfo runningInfo) { MysqlConnection connection = new MysqlConnection(runningInfo.getAddress(), runningInfo.getUsername(), runningInfo.getPassword(), connectionCharsetNumber, runningInfo.getDefaultDatabaseN...
java
private MysqlConnection buildMysqlConnection(AuthenticationInfo runningInfo) { MysqlConnection connection = new MysqlConnection(runningInfo.getAddress(), runningInfo.getUsername(), runningInfo.getPassword(), connectionCharsetNumber, runningInfo.getDefaultDatabaseN...
[ "private", "MysqlConnection", "buildMysqlConnection", "(", "AuthenticationInfo", "runningInfo", ")", "{", "MysqlConnection", "connection", "=", "new", "MysqlConnection", "(", "runningInfo", ".", "getAddress", "(", ")", ",", "runningInfo", ".", "getUsername", "(", ")",...
=================== helper method =================
[ "===================", "helper", "method", "=================" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java#L313-L330
train
Build a MysqlConnection object.
[ 30522, 2797, 2026, 2015, 4160, 22499, 10087, 7542, 3857, 8029, 2015, 4160, 22499, 10087, 7542, 1006, 27280, 2378, 14876, 2770, 2378, 14876, 1007, 1063, 2026, 2015, 4160, 22499, 10087, 7542, 4434, 1027, 2047, 2026, 2015, 4160, 22499, 10087, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java
HttpPostRequestEncoder.setBodyHttpDatas
public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws ErrorDataEncoderException { if (datas == null) { throw new NullPointerException("datas"); } globalBodySize = 0; bodyListDatas.clear(); currentFileUpload = null; duringMixedMode = false; ...
java
public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws ErrorDataEncoderException { if (datas == null) { throw new NullPointerException("datas"); } globalBodySize = 0; bodyListDatas.clear(); currentFileUpload = null; duringMixedMode = false; ...
[ "public", "void", "setBodyHttpDatas", "(", "List", "<", "InterfaceHttpData", ">", "datas", ")", "throws", "ErrorDataEncoderException", "{", "if", "(", "datas", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"datas\"", ")", ";", "}", "gl...
Set the Body HttpDatas list @throws NullPointerException for datas @throws ErrorDataEncoderException if the encoding is in error or if the finalize were already done
[ "Set", "the", "Body", "HttpDatas", "list" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L312-L324
train
Sets the body http datas.
[ 30522, 2270, 30524, 1000, 1007, 1025, 1065, 3795, 23684, 5332, 4371, 1027, 1014, 1025, 2303, 9863, 2850, 10230, 1012, 3154, 1006, 1007, 1025, 2783, 8873, 2571, 6279, 11066, 1027, 19701, 1025, 2076, 4328, 19068, 5302, 3207, 1027, 6270, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java
LogBuffer.getPackedLong
public final long getPackedLong(final int pos) { final int lead = getUint8(pos); if (lead < 251) return lead; switch (lead) { case 251: return NULL_LENGTH; case 252: return getUint16(pos + 1); case 253: ...
java
public final long getPackedLong(final int pos) { final int lead = getUint8(pos); if (lead < 251) return lead; switch (lead) { case 251: return NULL_LENGTH; case 252: return getUint16(pos + 1); case 253: ...
[ "public", "final", "long", "getPackedLong", "(", "final", "int", "pos", ")", "{", "final", "int", "lead", "=", "getUint8", "(", "pos", ")", ";", "if", "(", "lead", "<", "251", ")", "return", "lead", ";", "switch", "(", "lead", ")", "{", "case", "25...
Return packed number from buffer. (little-endian) A Packed Integer has the capacity of storing up to 8-byte integers, while small integers still can use 1, 3, or 4 bytes. The value of the first byte determines how to read the number, according to the following table. <ul> <li>0-250 The first byte is the number (in the ...
[ "Return", "packed", "number", "from", "buffer", ".", "(", "little", "-", "endian", ")", "A", "Packed", "Integer", "has", "the", "capacity", "of", "storing", "up", "to", "8", "-", "byte", "integers", "while", "small", "integers", "still", "can", "use", "1...
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1002-L1016
train
Gets the packed long value of a record.
[ 30522, 2270, 2345, 2146, 2131, 23947, 2098, 10052, 1006, 2345, 20014, 13433, 2015, 1007, 1063, 2345, 20014, 2599, 1027, 2131, 20023, 2102, 2620, 1006, 13433, 2015, 1007, 1025, 2065, 1006, 2599, 1026, 22582, 1007, 2709, 2599, 1025, 6942, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
server/src/main/java/com/networknt/server/Server.java
Server.register
public static URL register(String serviceId, int port) { try { registry = SingletonServiceFactory.getBean(Registry.class); if (registry == null) throw new RuntimeException("Could not find registry instance in service map"); // in kubernetes pod, the hostIP is ...
java
public static URL register(String serviceId, int port) { try { registry = SingletonServiceFactory.getBean(Registry.class); if (registry == null) throw new RuntimeException("Could not find registry instance in service map"); // in kubernetes pod, the hostIP is ...
[ "public", "static", "URL", "register", "(", "String", "serviceId", ",", "int", "port", ")", "{", "try", "{", "registry", "=", "SingletonServiceFactory", ".", "getBean", "(", "Registry", ".", "class", ")", ";", "if", "(", "registry", "==", "null", ")", "t...
Register the service to the Consul or other service registry. Make it as a separate static method so that it can be called from light-hybrid-4j to register individual service. @param serviceId Service Id that is registered @param port Port number of the service
[ "Register", "the", "service", "to", "the", "Consul", "or", "other", "service", "registry", ".", "Make", "it", "as", "a", "separate", "static", "method", "so", "that", "it", "can", "be", "called", "from", "light", "-", "hybrid", "-", "4j", "to", "register...
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/server/src/main/java/com/networknt/server/Server.java#L473-L506
train
Register a service with the service registry.
[ 30522, 2270, 10763, 24471, 2140, 4236, 1006, 5164, 2326, 3593, 1010, 20014, 3417, 1007, 1063, 3046, 1063, 15584, 1027, 28159, 8043, 7903, 12879, 18908, 10253, 1012, 2131, 4783, 2319, 1006, 15584, 1012, 2465, 1007, 1025, 2065, 1006, 15584, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java
ServiceOperations.init
public static void init(Service service, HiveConf configuration) { Service.STATE state = service.getServiceState(); ensureCurrentState(state, Service.STATE.NOTINITED); service.init(configuration); }
java
public static void init(Service service, HiveConf configuration) { Service.STATE state = service.getServiceState(); ensureCurrentState(state, Service.STATE.NOTINITED); service.init(configuration); }
[ "public", "static", "void", "init", "(", "Service", "service", ",", "HiveConf", "configuration", ")", "{", "Service", ".", "STATE", "state", "=", "service", ".", "getServiceState", "(", ")", ";", "ensureCurrentState", "(", "state", ",", "Service", ".", "STAT...
Initialize a service. The service state is checked <i>before</i> the operation begins. This process is <i>not</i> thread safe. @param service a service that must be in the state {@link Service.STATE#NOTINITED} @param configuration the configuration to initialize the service with @throws RuntimeException on a state cha...
[ "Initialize", "a", "service", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java#L64-L68
train
Initializes the service with the given configuration.
[ 30522, 2270, 10763, 11675, 1999, 4183, 1006, 2326, 2326, 1010, 26736, 8663, 2546, 9563, 1007, 1063, 2326, 1012, 2110, 2110, 1027, 2326, 1012, 4152, 2121, 7903, 4355, 3686, 1006, 1007, 1025, 5676, 10841, 14343, 7666, 12259, 1006, 2110, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.resize
public static <T> T[] resize(T[] buffer, int newSize, Class<?> componentType) { T[] newArray = newArray(componentType, newSize); if (isNotEmpty(buffer)) { System.arraycopy(buffer, 0, newArray, 0, Math.min(buffer.length, newSize)); } return newArray; }
java
public static <T> T[] resize(T[] buffer, int newSize, Class<?> componentType) { T[] newArray = newArray(componentType, newSize); if (isNotEmpty(buffer)) { System.arraycopy(buffer, 0, newArray, 0, Math.min(buffer.length, newSize)); } return newArray; }
[ "public", "static", "<", "T", ">", "T", "[", "]", "resize", "(", "T", "[", "]", "buffer", ",", "int", "newSize", ",", "Class", "<", "?", ">", "componentType", ")", "{", "T", "[", "]", "newArray", "=", "newArray", "(", "componentType", ",", "newSize...
生成一个新的重新设置大小的数组<br> 调整大小后拷贝原数组到新数组下。扩大则占位前N个位置,缩小则截断 @param <T> 数组元素类型 @param buffer 原数组 @param newSize 新的数组大小 @param componentType 数组元素类型 @return 调整后的新数组
[ "生成一个新的重新设置大小的数组<br", ">", "调整大小后拷贝原数组到新数组下。扩大则占位前N个位置,缩小则截断" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L506-L512
train
Resize the given array to the given size.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 1031, 1033, 24501, 4697, 1006, 1056, 1031, 1033, 17698, 1010, 20014, 2739, 4697, 1010, 30524, 6922, 13874, 1010, 2739, 4697, 1007, 1025, 2065, 1006, 3475, 12184, 27718, 2100, 1006, 17698, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/dictionary/DictionaryMaker.java
DictionaryMaker.add
public void add(IWord word) { Item item = trie.get(word.getValue()); if (item == null) { item = new Item(word.getValue(), word.getLabel()); trie.put(item.key, item); } else { item.addLabel(word.getLabel()); } }
java
public void add(IWord word) { Item item = trie.get(word.getValue()); if (item == null) { item = new Item(word.getValue(), word.getLabel()); trie.put(item.key, item); } else { item.addLabel(word.getLabel()); } }
[ "public", "void", "add", "(", "IWord", "word", ")", "{", "Item", "item", "=", "trie", ".", "get", "(", "word", ".", "getValue", "(", ")", ")", ";", "if", "(", "item", "==", "null", ")", "{", "item", "=", "new", "Item", "(", "word", ".", "getVal...
向词典中加入一个词语 @param word 词语
[ "向词典中加入一个词语" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/DictionaryMaker.java#L44-L56
train
Add a single entry to the CRA.
[ 30522, 2270, 11675, 5587, 1006, 1045, 18351, 2773, 1007, 1063, 8875, 8875, 1027, 13012, 2063, 1012, 2131, 1006, 2773, 1012, 2131, 10175, 5657, 1006, 1007, 1007, 1025, 2065, 1006, 8875, 1027, 1027, 19701, 1007, 1063, 8875, 1027, 2047, 8875, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java
AbstractFsCheckpointStorage.initializeLocationForSavepoint
@Override public CheckpointStorageLocation initializeLocationForSavepoint( @SuppressWarnings("unused") long checkpointId, @Nullable String externalLocationPointer) throws IOException { // determine where to write the savepoint to final Path savepointBasePath; if (externalLocationPointer != null) { sav...
java
@Override public CheckpointStorageLocation initializeLocationForSavepoint( @SuppressWarnings("unused") long checkpointId, @Nullable String externalLocationPointer) throws IOException { // determine where to write the savepoint to final Path savepointBasePath; if (externalLocationPointer != null) { sav...
[ "@", "Override", "public", "CheckpointStorageLocation", "initializeLocationForSavepoint", "(", "@", "SuppressWarnings", "(", "\"unused\"", ")", "long", "checkpointId", ",", "@", "Nullable", "String", "externalLocationPointer", ")", "throws", "IOException", "{", "// determ...
Creates a file system based storage location for a savepoint. <p>This methods implements the logic that decides which location to use (given optional parameters for a configured location and a location passed for this specific savepoint) and how to name and initialize the savepoint directory. @param externalLocationP...
[ "Creates", "a", "file", "system", "based", "storage", "location", "for", "a", "savepoint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java#L127-L167
train
Initialize the location for a savepoint.
[ 30522, 1030, 2058, 15637, 2270, 26520, 23809, 4270, 4135, 10719, 3988, 4697, 4135, 10719, 29278, 3736, 3726, 8400, 1006, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 15171, 1000, 1007, 2146, 26520, 3593, 1010, 1030, 19701, 3085, 5164, 6327, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) { return wrappedBuffer(maxNumComponents, CompositeByteBuf.BYTE_BUFFER_WRAPPER, buffers); }
java
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) { return wrappedBuffer(maxNumComponents, CompositeByteBuf.BYTE_BUFFER_WRAPPER, buffers); }
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "int", "maxNumComponents", ",", "ByteBuffer", "...", "buffers", ")", "{", "return", "wrappedBuffer", "(", "maxNumComponents", ",", "CompositeByteBuf", ".", "BYTE_BUFFER_WRAPPER", ",", "buffers", ")", ";", "}" ]
Creates a new big-endian composite buffer which wraps the slices of the specified NIO buffers without copying them. A modification on the content of the specified buffers will be visible to the returned buffer.
[ "Creates", "a", "new", "big", "-", "endian", "composite", "buffer", "which", "wraps", "the", "slices", "of", "the", "specified", "NIO", "buffers", "without", "copying", "them", ".", "A", "modification", "on", "the", "content", "of", "the", "specified", "buff...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L336-L338
train
Creates a new byte buffer that wraps the given byte buffers.
[ 30522, 2270, 10763, 24880, 8569, 2546, 5058, 8569, 12494, 1006, 20014, 4098, 19172, 9006, 29513, 7666, 1010, 24880, 8569, 12494, 1012, 1012, 1012, 17698, 2015, 1007, 1063, 2709, 5058, 8569, 12494, 1006, 4098, 19172, 9006, 29513, 7666, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java
HashCodeBuilder.reflectionHashCode
public static int reflectionHashCode(final Object object, final String... excludeFields) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false, null, excludeFields); }
java
public static int reflectionHashCode(final Object object, final String... excludeFields) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false, null, excludeFields); }
[ "public", "static", "int", "reflectionHashCode", "(", "final", "Object", "object", ",", "final", "String", "...", "excludeFields", ")", "{", "return", "reflectionHashCode", "(", "DEFAULT_INITIAL_VALUE", ",", "DEFAULT_MULTIPLIER_VALUE", ",", "object", ",", "false", "...
<p> Uses reflection to build a valid hash code from the fields of {@code object}. </p> <p> This constructor uses two hard coded choices for the constants needed to build a hash code. </p> <p> It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will throw a security...
[ "<p", ">", "Uses", "reflection", "to", "build", "a", "valid", "hash", "code", "from", "the", "fields", "of", "{", "@code", "object", "}", ".", "<", "/", "p", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L457-L460
train
Get the hashCode of the given object using reflection.
[ 30522, 2270, 10763, 20014, 9185, 14949, 16257, 10244, 1006, 2345, 4874, 4874, 1010, 2345, 5164, 1012, 1012, 1012, 23329, 15155, 1007, 1063, 2709, 9185, 14949, 16257, 10244, 1006, 12398, 1035, 3988, 1035, 3643, 1010, 12398, 1035, 4800, 24759, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
service/src/main/java/com/networknt/service/ServiceUtil.java
ServiceUtil.constructByNamedParams
public static Object constructByNamedParams(Class clazz, Map params) throws Exception { Object obj = clazz.getConstructor().newInstance(); Method[] allMethods = clazz.getMethods(); for(Method method : allMethods) { if(method.getName().startsWith("set")) { Object [] o...
java
public static Object constructByNamedParams(Class clazz, Map params) throws Exception { Object obj = clazz.getConstructor().newInstance(); Method[] allMethods = clazz.getMethods(); for(Method method : allMethods) { if(method.getName().startsWith("set")) { Object [] o...
[ "public", "static", "Object", "constructByNamedParams", "(", "Class", "clazz", ",", "Map", "params", ")", "throws", "Exception", "{", "Object", "obj", "=", "clazz", ".", "getConstructor", "(", ")", ".", "newInstance", "(", ")", ";", "Method", "[", "]", "al...
Build an object out of a given class and a map for field names to values. @param clazz The class to be created. @param params A map of the parameters. @return An instantiated object. @throws Exception when constructor fails.
[ "Build", "an", "object", "out", "of", "a", "given", "class", "and", "a", "map", "for", "field", "names", "to", "values", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/service/src/main/java/com/networknt/service/ServiceUtil.java#L66-L81
train
Construct by named params.
[ 30522, 2270, 10763, 4874, 9570, 3762, 18442, 18927, 5400, 5244, 1006, 2465, 18856, 10936, 2480, 1010, 4949, 11498, 5244, 1007, 11618, 6453, 1063, 4874, 27885, 3501, 1027, 18856, 10936, 2480, 1012, 2131, 8663, 3367, 6820, 16761, 1006, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.list
public static <T> List<T> list(boolean isLinked, Enumeration<T> enumration) { final List<T> list = list(isLinked); if (null != enumration) { while (enumration.hasMoreElements()) { list.add(enumration.nextElement()); } } return list; }
java
public static <T> List<T> list(boolean isLinked, Enumeration<T> enumration) { final List<T> list = list(isLinked); if (null != enumration) { while (enumration.hasMoreElements()) { list.add(enumration.nextElement()); } } return list; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "list", "(", "boolean", "isLinked", ",", "Enumeration", "<", "T", ">", "enumration", ")", "{", "final", "List", "<", "T", ">", "list", "=", "list", "(", "isLinked", ")", ";", "if", "(", "n...
新建一个List<br> 提供的参数为null时返回空{@link ArrayList} @param <T> 集合元素类型 @param isLinked 是否新建LinkedList @param enumration {@link Enumeration} @return ArrayList对象 @since 3.0.8
[ "新建一个List<br", ">", "提供的参数为null时返回空", "{", "@link", "ArrayList", "}" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L600-L608
train
Creates a list of objects from an enumeration.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2862, 1026, 1056, 1028, 2862, 1006, 22017, 20898, 2003, 13767, 2098, 1010, 4372, 17897, 8156, 1026, 1056, 1028, 4372, 2819, 8156, 1007, 1063, 2345, 2862, 1026, 1056, 1028, 2862, 1027, 2862, 1006, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
ParameterTool.fromPropertiesFile
public static ParameterTool fromPropertiesFile(InputStream inputStream) throws IOException { Properties props = new Properties(); props.load(inputStream); return fromMap((Map) props); }
java
public static ParameterTool fromPropertiesFile(InputStream inputStream) throws IOException { Properties props = new Properties(); props.load(inputStream); return fromMap((Map) props); }
[ "public", "static", "ParameterTool", "fromPropertiesFile", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "props", ".", "load", "(", "inputStream", ")", ";", "return", "fromMa...
Returns {@link ParameterTool} for the given InputStream from {@link Properties} file. @param inputStream InputStream from the properties file @return A {@link ParameterTool} @throws IOException If the file does not exist @see Properties
[ "Returns", "{", "@link", "ParameterTool", "}", "for", "the", "given", "InputStream", "from", "{", "@link", "Properties", "}", "file", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L150-L154
train
Creates a ParameterTool from a properties file.
[ 30522, 2270, 10763, 16381, 3406, 4747, 2013, 21572, 4842, 7368, 8873, 2571, 1006, 20407, 25379, 20407, 25379, 1007, 11618, 22834, 10288, 24422, 1063, 5144, 24387, 1027, 2047, 5144, 1006, 1007, 1025, 24387, 1012, 7170, 1006, 20407, 25379, 1007...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/dialect/sqlserver/clause/SQLServerTopClauseParser.java
SQLServerTopClauseParser.parse
public void parse(final SelectStatement selectStatement) { if (!lexerEngine.skipIfEqual(SQLServerKeyword.TOP)) { return; } int beginPosition = lexerEngine.getCurrentToken().getEndPosition(); if (!lexerEngine.skipIfEqual(Symbol.LEFT_PAREN)) { beginPosition = lexerE...
java
public void parse(final SelectStatement selectStatement) { if (!lexerEngine.skipIfEqual(SQLServerKeyword.TOP)) { return; } int beginPosition = lexerEngine.getCurrentToken().getEndPosition(); if (!lexerEngine.skipIfEqual(Symbol.LEFT_PAREN)) { beginPosition = lexerE...
[ "public", "void", "parse", "(", "final", "SelectStatement", "selectStatement", ")", "{", "if", "(", "!", "lexerEngine", ".", "skipIfEqual", "(", "SQLServerKeyword", ".", "TOP", ")", ")", "{", "return", ";", "}", "int", "beginPosition", "=", "lexerEngine", "....
Parse top. @param selectStatement select statement
[ "Parse", "top", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/dialect/sqlserver/clause/SQLServerTopClauseParser.java#L57-L86
train
Parse the SQL statement.
[ 30522, 2270, 11675, 11968, 3366, 1006, 2345, 27034, 12259, 3672, 27034, 12259, 3672, 1007, 1063, 2065, 1006, 999, 17244, 7869, 3070, 3170, 1012, 13558, 29323, 26426, 1006, 29296, 8043, 6299, 14839, 18351, 1012, 2327, 1007, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java
RpcUtils.extractImplementedRpcGateways
public static Set<Class<? extends RpcGateway>> extractImplementedRpcGateways(Class<?> clazz) { HashSet<Class<? extends RpcGateway>> interfaces = new HashSet<>(); while (clazz != null) { for (Class<?> interfaze : clazz.getInterfaces()) { if (RpcGateway.class.isAssignableFrom(interfaze)) { interfaces.add...
java
public static Set<Class<? extends RpcGateway>> extractImplementedRpcGateways(Class<?> clazz) { HashSet<Class<? extends RpcGateway>> interfaces = new HashSet<>(); while (clazz != null) { for (Class<?> interfaze : clazz.getInterfaces()) { if (RpcGateway.class.isAssignableFrom(interfaze)) { interfaces.add...
[ "public", "static", "Set", "<", "Class", "<", "?", "extends", "RpcGateway", ">", ">", "extractImplementedRpcGateways", "(", "Class", "<", "?", ">", "clazz", ")", "{", "HashSet", "<", "Class", "<", "?", "extends", "RpcGateway", ">", ">", "interfaces", "=", ...
Extracts all {@link RpcGateway} interfaces implemented by the given clazz. @param clazz from which to extract the implemented RpcGateway interfaces @return A set of all implemented RpcGateway interfaces
[ "Extracts", "all", "{", "@link", "RpcGateway", "}", "interfaces", "implemented", "by", "the", "given", "clazz", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java#L51-L65
train
Extract all implemented RpcGateways from a class.
[ 30522, 2270, 10763, 2275, 1026, 2465, 1026, 1029, 8908, 1054, 15042, 5867, 4576, 1028, 1028, 14817, 5714, 10814, 3672, 2098, 14536, 2278, 5867, 14035, 1006, 2465, 1026, 1029, 1028, 18856, 10936, 2480, 1007, 1063, 23325, 13462, 1026, 2465, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
RabbitProperties.determinePassword
public String determinePassword() { if (CollectionUtils.isEmpty(this.parsedAddresses)) { return getPassword(); } Address address = this.parsedAddresses.get(0); return (address.password != null) ? address.password : getPassword(); }
java
public String determinePassword() { if (CollectionUtils.isEmpty(this.parsedAddresses)) { return getPassword(); } Address address = this.parsedAddresses.get(0); return (address.password != null) ? address.password : getPassword(); }
[ "public", "String", "determinePassword", "(", ")", "{", "if", "(", "CollectionUtils", ".", "isEmpty", "(", "this", ".", "parsedAddresses", ")", ")", "{", "return", "getPassword", "(", ")", ";", "}", "Address", "address", "=", "this", ".", "parsedAddresses", ...
If addresses have been set and the first address has a password it is returned. Otherwise returns the result of calling {@code getPassword()}. @return the password or {@code null} @see #setAddresses(String) @see #getPassword()
[ "If", "addresses", "have", "been", "set", "and", "the", "first", "address", "has", "a", "password", "it", "is", "returned", ".", "Otherwise", "returns", "the", "result", "of", "calling", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java#L228-L234
train
Determine the password for the user.
[ 30522, 2270, 5164, 5646, 15194, 18351, 1006, 1007, 1063, 2065, 1006, 3074, 21823, 4877, 1012, 2003, 6633, 13876, 2100, 1006, 2023, 1012, 11968, 6924, 4215, 16200, 11393, 2015, 1007, 1007, 1063, 2709, 2131, 15194, 18351, 1006, 1007, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.addTransitionPath
private void addTransitionPath(MDAGNode originNode, String str) { if (!str.isEmpty()) { MDAGNode currentNode = originNode; int charCount = str.length(); //Loop through the characters in str, iteratevely adding // a _transition path corresponding to it...
java
private void addTransitionPath(MDAGNode originNode, String str) { if (!str.isEmpty()) { MDAGNode currentNode = originNode; int charCount = str.length(); //Loop through the characters in str, iteratevely adding // a _transition path corresponding to it...
[ "private", "void", "addTransitionPath", "(", "MDAGNode", "originNode", ",", "String", "str", ")", "{", "if", "(", "!", "str", ".", "isEmpty", "(", ")", ")", "{", "MDAGNode", "currentNode", "=", "originNode", ";", "int", "charCount", "=", "str", ".", "len...
给节点添加一个转移路径<br> Adds a _transition path starting from a specific node in the MDAG. @param originNode the MDAGNode which will serve as the start point of the to-be-created _transition path @param str the String to be used to create a new _transition path from {@code originNode}
[ "给节点添加一个转移路径<br", ">", "Adds", "a", "_transition", "path", "starting", "from", "a", "specific", "node", "in", "the", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L574-L595
train
Add a _transition path to the MDAGNode.
[ 30522, 2797, 11675, 30524, 9108, 8490, 3630, 3207, 2783, 3630, 3207, 1027, 4761, 3630, 3207, 1025, 20014, 25869, 3597, 16671, 1027, 2358, 2099, 1012, 3091, 1006, 1007, 1025, 1013, 1013, 7077, 2083, 1996, 3494, 1999, 2358, 2099, 1010, 2009, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java
HashUtil.rotatingHash
public static int rotatingHash(String key, int prime) { int hash, i; for (hash = key.length(), i = 0; i < key.length(); ++i) { hash = (hash << 4) ^ (hash >> 28) ^ key.charAt(i); } // 使用:hash = (hash ^ (hash>>10) ^ (hash>>20)) & mask; // 替代:hash %= prime; // return (hash ^ (hash>>10) ^ (hash>>20)...
java
public static int rotatingHash(String key, int prime) { int hash, i; for (hash = key.length(), i = 0; i < key.length(); ++i) { hash = (hash << 4) ^ (hash >> 28) ^ key.charAt(i); } // 使用:hash = (hash ^ (hash>>10) ^ (hash>>20)) & mask; // 替代:hash %= prime; // return (hash ^ (hash>>10) ^ (hash>>20)...
[ "public", "static", "int", "rotatingHash", "(", "String", "key", ",", "int", "prime", ")", "{", "int", "hash", ",", "i", ";", "for", "(", "hash", "=", "key", ".", "length", "(", ")", ",", "i", "=", "0", ";", "i", "<", "key", ".", "length", "(",...
旋转hash @param key 输入字符串 @param prime 质数 @return hash值
[ "旋转hash" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L35-L45
train
Returns the hash value of the given key.
[ 30522, 2270, 10763, 20014, 13618, 14949, 2232, 1006, 5164, 3145, 1010, 20014, 3539, 1007, 1063, 20014, 23325, 1010, 1045, 1025, 2005, 1006, 23325, 1027, 3145, 1012, 3091, 1006, 1007, 1010, 1045, 1027, 1014, 1025, 1045, 1026, 3145, 1012, 309...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroDeserializationSchema.java
AvroDeserializationSchema.forSpecific
public static <T extends SpecificRecord> AvroDeserializationSchema<T> forSpecific(Class<T> tClass) { return new AvroDeserializationSchema<>(tClass, null); }
java
public static <T extends SpecificRecord> AvroDeserializationSchema<T> forSpecific(Class<T> tClass) { return new AvroDeserializationSchema<>(tClass, null); }
[ "public", "static", "<", "T", "extends", "SpecificRecord", ">", "AvroDeserializationSchema", "<", "T", ">", "forSpecific", "(", "Class", "<", "T", ">", "tClass", ")", "{", "return", "new", "AvroDeserializationSchema", "<>", "(", "tClass", ",", "null", ")", "...
Creates {@link AvroDeserializationSchema} that produces classes that were generated from avro schema. @param tClass class of record to be produced @return deserialized record
[ "Creates", "{", "@link", "AvroDeserializationSchema", "}", "that", "produces", "classes", "that", "were", "generated", "from", "avro", "schema", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroDeserializationSchema.java#L65-L67
train
Create an AvroDeserializationSchema for a specific class.
[ 30522, 2270, 10763, 1026, 1056, 8908, 3563, 2890, 27108, 2094, 1028, 20704, 14127, 6810, 14482, 22318, 5403, 2863, 1026, 1056, 1028, 2005, 13102, 8586, 18513, 1006, 2465, 1026, 1056, 1028, 22975, 27102, 1007, 1063, 2709, 2047, 20704, 14127, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphCsvReader.java
GraphCsvReader.types
@SuppressWarnings("unchecked") public <K, VV, EV> Graph<K, VV, EV> types(Class<K> vertexKey, Class<VV> vertexValue, Class<EV> edgeValue) { if (edgeReader == null) { throw new RuntimeException("The edge input file cannot be null!"); } DataSet<Tuple3<K, K, EV>> edges = edgeReader.types(vertexKey, vertexKey...
java
@SuppressWarnings("unchecked") public <K, VV, EV> Graph<K, VV, EV> types(Class<K> vertexKey, Class<VV> vertexValue, Class<EV> edgeValue) { if (edgeReader == null) { throw new RuntimeException("The edge input file cannot be null!"); } DataSet<Tuple3<K, K, EV>> edges = edgeReader.types(vertexKey, vertexKey...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "K", ",", "VV", ",", "EV", ">", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "types", "(", "Class", "<", "K", ">", "vertexKey", ",", "Class", "<", "VV", ">", "vertexValue", ",", ...
Creates a Graph from CSV input with vertex values and edge values. The vertex values are specified through a vertices input file or a user-defined map function. @param vertexKey the type of the vertex IDs @param vertexValue the type of the vertex values @param edgeValue the type of the edge values @return a Graph with...
[ "Creates", "a", "Graph", "from", "CSV", "input", "with", "vertex", "values", "and", "edge", "values", ".", "The", "vertex", "values", "are", "specified", "through", "a", "vertices", "input", "file", "or", "a", "user", "-", "defined", "map", "function", "."...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/GraphCsvReader.java#L101-L126
train
Returns a Graph from CSV input data set of vertex values and edge values.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 10629, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 4127, 1006, 2465, 1026, 1047, 1028, 19449, 14839...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
HadoopUtils.getHadoopConfiguration
public static Configuration getHadoopConfiguration(org.apache.flink.configuration.Configuration flinkConfiguration) { Configuration retConf = new Configuration(); // We need to load both core-site.xml and hdfs-site.xml to determine the default fs path and // the hdfs configuration // Try to load HDFS configur...
java
public static Configuration getHadoopConfiguration(org.apache.flink.configuration.Configuration flinkConfiguration) { Configuration retConf = new Configuration(); // We need to load both core-site.xml and hdfs-site.xml to determine the default fs path and // the hdfs configuration // Try to load HDFS configur...
[ "public", "static", "Configuration", "getHadoopConfiguration", "(", "org", ".", "apache", ".", "flink", ".", "configuration", ".", "Configuration", "flinkConfiguration", ")", "{", "Configuration", "retConf", "=", "new", "Configuration", "(", ")", ";", "// We need to...
Returns a new Hadoop Configuration object using the path to the hadoop conf configured in the main configuration (flink-conf.yaml). This method is public because its being used in the HadoopDataSource. @param flinkConfiguration Flink configuration object @return A Hadoop configuration instance
[ "Returns", "a", "new", "Hadoop", "Configuration", "object", "using", "the", "path", "to", "the", "hadoop", "conf", "configured", "in", "the", "main", "configuration", "(", "flink", "-", "conf", ".", "yaml", ")", ".", "This", "method", "is", "public", "beca...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java#L65-L119
train
Get the Hadoop configuration from the given Flink configuration
[ 30522, 2270, 10763, 9563, 2131, 16102, 18589, 8663, 8873, 27390, 3370, 1006, 8917, 1012, 15895, 1012, 13109, 19839, 1012, 9563, 1012, 9563, 13109, 19839, 8663, 8873, 27390, 3370, 1007, 1063, 9563, 2128, 13535, 2239, 2546, 1027, 2047, 9563, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java
ShuffleInMemorySorter.insertRecord
public void insertRecord(long recordPointer, int partitionId) { if (!hasSpaceForAnotherRecord()) { throw new IllegalStateException("There is no space for new record"); } array.set(pos, PackedRecordPointer.packPointer(recordPointer, partitionId)); pos++; }
java
public void insertRecord(long recordPointer, int partitionId) { if (!hasSpaceForAnotherRecord()) { throw new IllegalStateException("There is no space for new record"); } array.set(pos, PackedRecordPointer.packPointer(recordPointer, partitionId)); pos++; }
[ "public", "void", "insertRecord", "(", "long", "recordPointer", ",", "int", "partitionId", ")", "{", "if", "(", "!", "hasSpaceForAnotherRecord", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"There is no space for new record\"", ")", ";", "}"...
Inserts a record to be sorted. @param recordPointer a pointer to the record, encoded by the task memory manager. Due to certain pointer compression techniques used by the sorter, the sort can only operate on pointers that point to locations in the first {@link PackedRecordPointer#MAXIMUM_PAGE_SIZE_BYTES} bytes of a da...
[ "Inserts", "a", "record", "to", "be", "sorted", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java#L146-L152
train
Insert a record into the record array.
[ 30522, 2270, 11675, 19274, 2890, 27108, 2094, 1006, 2146, 2501, 8400, 2121, 1010, 20014, 13571, 3593, 1007, 1063, 2065, 1006, 999, 2038, 23058, 29278, 6761, 12399, 2890, 27108, 2094, 1006, 1007, 1007, 1063, 5466, 2047, 6206, 9153, 17389, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
resolver/src/main/java/io/netty/resolver/AddressResolverGroup.java
AddressResolverGroup.getResolver
public AddressResolver<T> getResolver(final EventExecutor executor) { if (executor == null) { throw new NullPointerException("executor"); } if (executor.isShuttingDown()) { throw new IllegalStateException("executor not accepting a task"); } AddressResolv...
java
public AddressResolver<T> getResolver(final EventExecutor executor) { if (executor == null) { throw new NullPointerException("executor"); } if (executor.isShuttingDown()) { throw new IllegalStateException("executor not accepting a task"); } AddressResolv...
[ "public", "AddressResolver", "<", "T", ">", "getResolver", "(", "final", "EventExecutor", "executor", ")", "{", "if", "(", "executor", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"executor\"", ")", ";", "}", "if", "(", "executor", ...
Returns the {@link AddressResolver} associated with the specified {@link EventExecutor}. If there's no associated resolved found, this method creates and returns a new resolver instance created by {@link #newResolver(EventExecutor)} so that the new resolver is reused on another {@link #getResolver(EventExecutor)} call ...
[ "Returns", "the", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver/src/main/java/io/netty/resolver/AddressResolverGroup.java#L54-L90
train
Get a new AddressResolver for the given executor.
[ 30522, 2270, 4769, 6072, 4747, 6299, 1026, 1056, 1028, 2131, 6072, 4747, 6299, 1006, 2345, 2724, 10288, 8586, 16161, 2099, 4654, 8586, 16161, 2099, 1007, 1063, 2065, 1006, 4654, 8586, 16161, 2099, 1027, 1027, 19701, 1007, 1063, 5466, 2047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopOutputFormatBase.java
HadoopOutputFormatBase.configure
@Override public void configure(Configuration parameters) { // enforce sequential configure() calls synchronized (CONFIGURE_MUTEX) { // configure MR OutputFormat if necessary if (this.mapredOutputFormat instanceof Configurable) { ((Configurable) this.mapredOutputFormat).setConf(this.jobConf); } else ...
java
@Override public void configure(Configuration parameters) { // enforce sequential configure() calls synchronized (CONFIGURE_MUTEX) { // configure MR OutputFormat if necessary if (this.mapredOutputFormat instanceof Configurable) { ((Configurable) this.mapredOutputFormat).setConf(this.jobConf); } else ...
[ "@", "Override", "public", "void", "configure", "(", "Configuration", "parameters", ")", "{", "// enforce sequential configure() calls", "synchronized", "(", "CONFIGURE_MUTEX", ")", "{", "// configure MR OutputFormat if necessary", "if", "(", "this", ".", "mapredOutputForma...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopOutputFormatBase.java#L91-L103
train
Override this method to configure the MR OutputFormat.
[ 30522, 1030, 2058, 15637, 2270, 11675, 9530, 8873, 27390, 2063, 1006, 9563, 11709, 1007, 1063, 1013, 1013, 16306, 25582, 9530, 8873, 27390, 2063, 1006, 1007, 4455, 25549, 1006, 9530, 8873, 27390, 2063, 1035, 20101, 2595, 1007, 1063, 1013, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.appendLines
public static <T> File appendLines(Collection<T> list, File file, String charset) throws IORuntimeException { return writeLines(list, file, charset, true); }
java
public static <T> File appendLines(Collection<T> list, File file, String charset) throws IORuntimeException { return writeLines(list, file, charset, true); }
[ "public", "static", "<", "T", ">", "File", "appendLines", "(", "Collection", "<", "T", ">", "list", ",", "File", "file", ",", "String", "charset", ")", "throws", "IORuntimeException", "{", "return", "writeLines", "(", "list", ",", "file", ",", "charset", ...
将列表写入文件,追加模式 @param <T> 集合元素类型 @param list 列表 @param file 文件 @param charset 字符集 @return 目标文件 @throws IORuntimeException IO异常 @since 3.1.2
[ "将列表写入文件,追加模式" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2982-L2984
train
Append the lines of the collection to the file.
[ 30522, 2270, 10763, 1026, 1056, 1028, 5371, 10439, 10497, 12735, 1006, 3074, 1026, 1056, 1028, 2862, 1010, 5371, 5371, 1010, 5164, 25869, 13462, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 2709, 4339, 12735, 1006, 2862, 1010, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressImage
public static BufferedImage pressImage(Image srcImage, Image pressImg, int x, int y, float alpha) { return Img.from(srcImage).pressImage(pressImg, x, y, alpha).getImg(); }
java
public static BufferedImage pressImage(Image srcImage, Image pressImg, int x, int y, float alpha) { return Img.from(srcImage).pressImage(pressImg, x, y, alpha).getImg(); }
[ "public", "static", "BufferedImage", "pressImage", "(", "Image", "srcImage", ",", "Image", "pressImg", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "{", "return", "Img", ".", "from", "(", "srcImage", ")", ".", "pressImage", "(", "pressIm...
给图片添加图片水印<br> 此方法并不关闭流 @param srcImage 源图像流 @param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 @return 结果图片
[ "给图片添加图片水印<br", ">", "此方法并不关闭流" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L972-L974
train
Press an image on the specified coordinates.
[ 30522, 2270, 10763, 17698, 2098, 9581, 3351, 2811, 9581, 3351, 1006, 3746, 5034, 6895, 26860, 1010, 3746, 2811, 5714, 2290, 1010, 20014, 1060, 1010, 20014, 1061, 1010, 14257, 6541, 1007, 1063, 2709, 10047, 2290, 1012, 2013, 1006, 5034, 6895...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java
ExceptionUtils.findThrowableWithMessage
public static Optional<Throwable> findThrowableWithMessage(Throwable throwable, String searchMessage) { if (throwable == null || searchMessage == null) { return Optional.empty(); } Throwable t = throwable; while (t != null) { if (t.getMessage() != null && t.getMessage().contains(searchMessage)) { ret...
java
public static Optional<Throwable> findThrowableWithMessage(Throwable throwable, String searchMessage) { if (throwable == null || searchMessage == null) { return Optional.empty(); } Throwable t = throwable; while (t != null) { if (t.getMessage() != null && t.getMessage().contains(searchMessage)) { ret...
[ "public", "static", "Optional", "<", "Throwable", ">", "findThrowableWithMessage", "(", "Throwable", "throwable", ",", "String", "searchMessage", ")", "{", "if", "(", "throwable", "==", "null", "||", "searchMessage", "==", "null", ")", "{", "return", "Optional",...
Checks whether a throwable chain contains a specific error message and returns the corresponding throwable. @param throwable the throwable chain to check. @param searchMessage the error message to search for in the chain. @return Optional throwable containing the search message if available, otherwise empty
[ "Checks", "whether", "a", "throwable", "chain", "contains", "a", "specific", "error", "message", "and", "returns", "the", "corresponding", "throwable", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java#L372-L387
train
Find a Throwable with a message.
[ 30522, 2270, 10763, 11887, 1026, 5466, 3085, 1028, 2424, 2705, 10524, 3085, 24415, 7834, 3736, 3351, 1006, 5466, 3085, 5466, 3085, 1010, 5164, 3945, 7834, 3736, 3351, 1007, 1063, 2065, 1006, 5466, 3085, 1027, 1027, 19701, 1064, 1064, 3945, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java
DefaultGridRegistry.newInstance
public static GridRegistry newInstance(Hub hub) { DefaultGridRegistry registry = new DefaultGridRegistry(hub); registry.start(); return registry; }
java
public static GridRegistry newInstance(Hub hub) { DefaultGridRegistry registry = new DefaultGridRegistry(hub); registry.start(); return registry; }
[ "public", "static", "GridRegistry", "newInstance", "(", "Hub", "hub", ")", "{", "DefaultGridRegistry", "registry", "=", "new", "DefaultGridRegistry", "(", "hub", ")", ";", "registry", ".", "start", "(", ")", ";", "return", "registry", ";", "}" ]
Creates a new {@link GridRegistry} and starts it. @param hub the {@link Hub} to associate this registry with @return the registry
[ "Creates", "a", "new", "{", "@link", "GridRegistry", "}", "and", "starts", "it", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java#L98-L102
train
Create a new instance of the default grid registry.
[ 30522, 2270, 10763, 8370, 2890, 24063, 2854, 2047, 7076, 26897, 1006, 9594, 9594, 1007, 1063, 12398, 16523, 3593, 2890, 24063, 2854, 15584, 1027, 2047, 12398, 16523, 3593, 2890, 24063, 2854, 1006, 9594, 1007, 1025, 15584, 1012, 2707, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java
DynaBean.invoke
public Object invoke(String methodName, Object... params){ return ReflectUtil.invoke(this.bean, methodName, params); }
java
public Object invoke(String methodName, Object... params){ return ReflectUtil.invoke(this.bean, methodName, params); }
[ "public", "Object", "invoke", "(", "String", "methodName", ",", "Object", "...", "params", ")", "{", "return", "ReflectUtil", ".", "invoke", "(", "this", ".", "bean", ",", "methodName", ",", "params", ")", ";", "}" ]
执行原始Bean中的方法 @param methodName 方法名 @param params 参数 @return 执行结果,可能为null
[ "执行原始Bean中的方法" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java#L137-L139
train
Invoke the specified method on the bean.
[ 30522, 2270, 4874, 1999, 6767, 3489, 1006, 5164, 4118, 18442, 1010, 4874, 1012, 1012, 1012, 11498, 5244, 1007, 1063, 2709, 8339, 21823, 2140, 1012, 1999, 6767, 3489, 1006, 2023, 1012, 14068, 1010, 4118, 18442, 1010, 11498, 5244, 1007, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java
AbstractAsymmetricCrypto.encrypt
public byte[] encrypt(String data, String charset, KeyType keyType) { return encrypt(StrUtil.bytes(data, charset), keyType); }
java
public byte[] encrypt(String data, String charset, KeyType keyType) { return encrypt(StrUtil.bytes(data, charset), keyType); }
[ "public", "byte", "[", "]", "encrypt", "(", "String", "data", ",", "String", "charset", ",", "KeyType", "keyType", ")", "{", "return", "encrypt", "(", "StrUtil", ".", "bytes", "(", "data", ",", "charset", ")", ",", "keyType", ")", ";", "}" ]
加密 @param data 被加密的字符串 @param charset 编码 @param keyType 私钥或公钥 {@link KeyType} @return 加密后的bytes
[ "加密" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L77-L79
train
Encrypts the given data using the specified key type.
[ 30522, 2270, 24880, 1031, 1033, 4372, 26775, 22571, 2102, 1006, 5164, 2951, 1010, 5164, 25869, 13462, 1010, 3145, 13874, 3145, 13874, 1007, 1063, 2709, 4372, 26775, 22571, 2102, 1006, 2358, 22134, 4014, 1012, 27507, 1006, 2951, 1010, 25869, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java
MapUtil.inverse
@Deprecated public static <K, V> Map<V, K> inverse(Map<K, V> map) { Map<V, K> inverseMap; if (map instanceof LinkedHashMap) { inverseMap = new LinkedHashMap<>(map.size()); } else if (map instanceof TreeMap) { inverseMap = new TreeMap<>(); } else { inverseMap = new HashMap<>(map.size()); } ...
java
@Deprecated public static <K, V> Map<V, K> inverse(Map<K, V> map) { Map<V, K> inverseMap; if (map instanceof LinkedHashMap) { inverseMap = new LinkedHashMap<>(map.size()); } else if (map instanceof TreeMap) { inverseMap = new TreeMap<>(); } else { inverseMap = new HashMap<>(map.size()); } ...
[ "@", "Deprecated", "public", "static", "<", "K", ",", "V", ">", "Map", "<", "V", ",", "K", ">", "inverse", "(", "Map", "<", "K", ",", "V", ">", "map", ")", "{", "Map", "<", "V", ",", "K", ">", "inverseMap", ";", "if", "(", "map", "instanceof"...
逆转Map的key和value @param <K> 键类型,目标的值类型 @param <V> 值类型,目标的键类型 @param map 被转换的Map @return 逆转后的Map @deprecated 请使用{@link MapUtil#reverse(Map)} 代替
[ "逆转Map的key和value" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L613-L628
train
Returns the inverse of the given map.
[ 30522, 1030, 2139, 28139, 12921, 2270, 10763, 1026, 1047, 1010, 1058, 1028, 4949, 1026, 1058, 1010, 1047, 1028, 19262, 1006, 4949, 1026, 1047, 1010, 1058, 1028, 4949, 1007, 1063, 4949, 1026, 1058, 1010, 1047, 1028, 19262, 2863, 2361, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/util/KeySelectorUtil.java
KeySelectorUtil.getBaseRowSelector
public static BaseRowKeySelector getBaseRowSelector(int[] keyFields, BaseRowTypeInfo rowType) { if (keyFields.length > 0) { InternalType[] inputFieldTypes = rowType.getInternalTypes(); String[] inputFieldNames = rowType.getFieldNames(); InternalType[] keyFieldTypes = new InternalType[keyFields.length]; St...
java
public static BaseRowKeySelector getBaseRowSelector(int[] keyFields, BaseRowTypeInfo rowType) { if (keyFields.length > 0) { InternalType[] inputFieldTypes = rowType.getInternalTypes(); String[] inputFieldNames = rowType.getFieldNames(); InternalType[] keyFieldTypes = new InternalType[keyFields.length]; St...
[ "public", "static", "BaseRowKeySelector", "getBaseRowSelector", "(", "int", "[", "]", "keyFields", ",", "BaseRowTypeInfo", "rowType", ")", "{", "if", "(", "keyFields", ".", "length", ">", "0", ")", "{", "InternalType", "[", "]", "inputFieldTypes", "=", "rowTyp...
Create a BaseRowKeySelector to extract keys from DataStream which type is BaseRowTypeInfo. @param keyFields key fields @param rowType type of DataStream to extract keys @return the BaseRowKeySelector to extract keys from DataStream which type is BaseRowTypeInfo.
[ "Create", "a", "BaseRowKeySelector", "to", "extract", "keys", "from", "DataStream", "which", "type", "is", "BaseRowTypeInfo", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/util/KeySelectorUtil.java#L45-L69
train
Get a BaseRowKeySelector for the given key fields and row type.
[ 30522, 2270, 10763, 2918, 10524, 14839, 11246, 22471, 2953, 2131, 15058, 10524, 11246, 22471, 2953, 1006, 20014, 1031, 1033, 3145, 15155, 1010, 2918, 10524, 13874, 2378, 14876, 5216, 13874, 1007, 1063, 2065, 1006, 3145, 15155, 1012, 3091, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/AttributeKey.java
AttributeKey.newInstance
@SuppressWarnings("unchecked") public static <T> AttributeKey<T> newInstance(String name) { return (AttributeKey<T>) pool.newInstance(name); }
java
@SuppressWarnings("unchecked") public static <T> AttributeKey<T> newInstance(String name) { return (AttributeKey<T>) pool.newInstance(name); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "AttributeKey", "<", "T", ">", "newInstance", "(", "String", "name", ")", "{", "return", "(", "AttributeKey", "<", "T", ">", ")", "pool", ".", "newInstance", "(", "nam...
Creates a new {@link AttributeKey} for the given {@code name} or fail with an {@link IllegalArgumentException} if a {@link AttributeKey} for the given {@code name} exists.
[ "Creates", "a", "new", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AttributeKey.java#L53-L56
train
Create an instance of an attribute key.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1056, 1028, 17961, 14839, 1026, 1056, 1028, 2047, 7076, 26897, 1006, 5164, 2171, 1007, 1063, 2709, 1006, 17961, 14839, 1026, 1056, 1028, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
java/server/src/org/openqa/grid/common/RegistrationRequest.java
RegistrationRequest.fromJson
public static RegistrationRequest fromJson(Map<String, Object> raw) throws JsonException { // If we could, we'd just get Json to coerce this for us, but that would lead to endless // recursion as the first thing it would do would be to call this very method. *sigh* Json json = new Json(); RegistrationRe...
java
public static RegistrationRequest fromJson(Map<String, Object> raw) throws JsonException { // If we could, we'd just get Json to coerce this for us, but that would lead to endless // recursion as the first thing it would do would be to call this very method. *sigh* Json json = new Json(); RegistrationRe...
[ "public", "static", "RegistrationRequest", "fromJson", "(", "Map", "<", "String", ",", "Object", ">", "raw", ")", "throws", "JsonException", "{", "// If we could, we'd just get Json to coerce this for us, but that would lead to endless", "// recursion as the first thing it would do...
Create an object from a registration request formatted as a json string.
[ "Create", "an", "object", "from", "a", "registration", "request", "formatted", "as", "a", "json", "string", "." ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/common/RegistrationRequest.java#L119-L144
train
Convert a JSON object to a RegistrationRequest object
[ 30522, 2270, 10763, 8819, 2890, 15500, 2013, 22578, 2239, 1006, 4949, 1026, 5164, 1010, 4874, 1028, 6315, 1007, 11618, 1046, 3385, 10288, 24422, 1063, 1013, 1013, 2065, 2057, 2071, 1010, 2057, 1005, 1040, 2074, 2131, 1046, 3385, 2000, 24873...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/TransactionalIdsGenerator.java
TransactionalIdsGenerator.generateIdsToUse
public Set<String> generateIdsToUse(long nextFreeTransactionalId) { Set<String> transactionalIds = new HashSet<>(); for (int i = 0; i < poolSize; i++) { long transactionalId = nextFreeTransactionalId + subtaskIndex * poolSize + i; transactionalIds.add(generateTransactionalId(transactionalId)); } return tr...
java
public Set<String> generateIdsToUse(long nextFreeTransactionalId) { Set<String> transactionalIds = new HashSet<>(); for (int i = 0; i < poolSize; i++) { long transactionalId = nextFreeTransactionalId + subtaskIndex * poolSize + i; transactionalIds.add(generateTransactionalId(transactionalId)); } return tr...
[ "public", "Set", "<", "String", ">", "generateIdsToUse", "(", "long", "nextFreeTransactionalId", ")", "{", "Set", "<", "String", ">", "transactionalIds", "=", "new", "HashSet", "<>", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pool...
Range of available transactional ids to use is: [nextFreeTransactionalId, nextFreeTransactionalId + parallelism * kafkaProducersPoolSize) loop below picks in a deterministic way a subrange of those available transactional ids based on index of this subtask.
[ "Range", "of", "available", "transactional", "ids", "to", "use", "is", ":", "[", "nextFreeTransactionalId", "nextFreeTransactionalId", "+", "parallelism", "*", "kafkaProducersPoolSize", ")", "loop", "below", "picks", "in", "a", "deterministic", "way", "a", "subrange...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/TransactionalIdsGenerator.java#L71-L78
train
Generate transactional ids to use.
[ 30522, 2270, 2275, 1026, 5164, 1028, 9699, 9821, 24826, 3366, 1006, 2146, 2279, 23301, 6494, 3619, 18908, 19301, 3593, 1007, 1063, 2275, 1026, 5164, 1028, 12598, 11475, 5104, 1027, 2047, 23325, 13462, 1026, 1028, 1006, 1007, 1025, 2005, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java
MemorySegment.putCharBigEndian
public final void putCharBigEndian(int index, char value) { if (LITTLE_ENDIAN) { putChar(index, Character.reverseBytes(value)); } else { putChar(index, value); } }
java
public final void putCharBigEndian(int index, char value) { if (LITTLE_ENDIAN) { putChar(index, Character.reverseBytes(value)); } else { putChar(index, value); } }
[ "public", "final", "void", "putCharBigEndian", "(", "int", "index", ",", "char", "value", ")", "{", "if", "(", "LITTLE_ENDIAN", ")", "{", "putChar", "(", "index", ",", "Character", ".", "reverseBytes", "(", "value", ")", ")", ";", "}", "else", "{", "pu...
Writes the given character (16 bit, 2 bytes) to the given position in big-endian byte order. This method's speed depends on the system's native byte order, and it is possibly slower than {@link #putChar(int, char)}. For most cases (such as transient storage in memory or serialization for I/O and network), it suffices t...
[ "Writes", "the", "given", "character", "(", "16", "bit", "2", "bytes", ")", "to", "the", "given", "position", "in", "big", "-", "endian", "byte", "order", ".", "This", "method", "s", "speed", "depends", "on", "the", "system", "s", "native", "byte", "or...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L536-L542
train
Puts a char value in Big Endian byte order.
[ 30522, 2270, 2345, 11675, 2404, 7507, 15185, 29206, 11692, 1006, 20014, 5950, 1010, 25869, 3643, 1007, 1063, 2065, 1006, 2210, 1035, 2203, 2937, 1007, 1063, 2404, 7507, 2099, 1006, 5950, 1010, 2839, 1012, 7901, 3762, 4570, 1006, 3643, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java
CollUtil.union
@SafeVarargs public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2, Collection<T>... otherColls) { Collection<T> union = union(coll1, coll2); for (Collection<T> coll : otherColls) { union = union(union, coll); } return union; }
java
@SafeVarargs public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2, Collection<T>... otherColls) { Collection<T> union = union(coll1, coll2); for (Collection<T> coll : otherColls) { union = union(union, coll); } return union; }
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "Collection", "<", "T", ">", "union", "(", "Collection", "<", "T", ">", "coll1", ",", "Collection", "<", "T", ">", "coll2", ",", "Collection", "<", "T", ">", "...", "otherColls", ")", "{", "Colle...
多个集合的并集<br> 针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最多的个数<br> 例如:集合1:[a, b, c, c, c],集合2:[a, b, c, c]<br> 结果:[a, b, c, c, c],此结果中只保留了三个c @param <T> 集合元素类型 @param coll1 集合1 @param coll2 集合2 @param otherColls 其它集合 @return 并集的集合,返回 {@link ArrayList}
[ "多个集合的并集<br", ">", "针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最多的个数<br", ">", "例如:集合1:", "[", "a", "b", "c", "c", "c", "]", ",集合2:", "[", "a", "b", "c", "c", "]", "<br", ">", "结果:", "[", "a", "b", "c", "c", "c", "]", ",此结果中只保留了三个c" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L108-L115
train
Returns the union of the specified collections.
[ 30522, 1030, 3647, 24516, 10623, 2015, 2270, 10763, 1026, 1056, 1028, 3074, 1026, 1056, 1028, 2586, 1006, 3074, 1026, 1056, 1028, 8902, 2140, 2487, 1010, 3074, 1026, 1056, 1028, 8902, 2140, 2475, 1010, 3074, 1026, 1056, 1028, 1012, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java
TrafficCounter.writeTimeToWait
@Deprecated public long writeTimeToWait(final long size, final long limitTraffic, final long maxTime) { return writeTimeToWait(size, limitTraffic, maxTime, milliSecondFromNano()); }
java
@Deprecated public long writeTimeToWait(final long size, final long limitTraffic, final long maxTime) { return writeTimeToWait(size, limitTraffic, maxTime, milliSecondFromNano()); }
[ "@", "Deprecated", "public", "long", "writeTimeToWait", "(", "final", "long", "size", ",", "final", "long", "limitTraffic", ",", "final", "long", "maxTime", ")", "{", "return", "writeTimeToWait", "(", "size", ",", "limitTraffic", ",", "maxTime", ",", "milliSec...
Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait time. @param size the write size @param limitTraffic the traffic limit in bytes per second. @param maxTime the max time in ms to wait in case of excess of traffic. @return the current time to wait (in ms) if n...
[ "Returns", "the", "time", "to", "wait", "(", "if", "any", ")", "for", "the", "given", "length", "message", "using", "the", "given", "limitTraffic", "and", "the", "max", "wait", "time", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L555-L558
train
Write time to wait.
[ 30522, 1030, 2139, 28139, 12921, 2270, 2146, 4339, 7292, 18790, 4886, 2102, 1006, 2345, 2146, 2946, 1010, 2345, 2146, 5787, 6494, 26989, 2278, 1010, 2345, 2146, 4098, 7292, 1007, 1063, 2709, 4339, 7292, 18790, 4886, 2102, 1006, 2946, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/ByteBufUtil.java
ByteBufUtil.setShortBE
@SuppressWarnings("deprecation") public static ByteBuf setShortBE(ByteBuf buf, int index, int shortValue) { return buf.order() == ByteOrder.BIG_ENDIAN? buf.setShort(index, shortValue) : buf.setShortLE(index, shortValue); }
java
@SuppressWarnings("deprecation") public static ByteBuf setShortBE(ByteBuf buf, int index, int shortValue) { return buf.order() == ByteOrder.BIG_ENDIAN? buf.setShort(index, shortValue) : buf.setShortLE(index, shortValue); }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "static", "ByteBuf", "setShortBE", "(", "ByteBuf", "buf", ",", "int", "index", ",", "int", "shortValue", ")", "{", "return", "buf", ".", "order", "(", ")", "==", "ByteOrder", ".", "BIG_ENDIAN", ...
Sets a big-endian 16-bit short integer to the buffer.
[ "Sets", "a", "big", "-", "endian", "16", "-", "bit", "short", "integer", "to", "the", "buffer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L426-L429
train
Sets a signed short value in the buffer.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 2139, 28139, 10719, 1000, 1007, 2270, 10763, 24880, 8569, 2546, 4520, 27794, 4783, 1006, 24880, 8569, 2546, 20934, 2546, 1010, 20014, 5950, 1010, 20014, 2460, 10175, 5657, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java
AsyncWaitOperator.stopResources
private void stopResources(boolean waitForShutdown) throws InterruptedException { emitter.stop(); emitterThread.interrupt(); executor.shutdown(); if (waitForShutdown) { try { if (!executor.awaitTermination(365L, TimeUnit.DAYS)) { executor.shutdownNow(); } } catch (InterruptedException e) { ...
java
private void stopResources(boolean waitForShutdown) throws InterruptedException { emitter.stop(); emitterThread.interrupt(); executor.shutdown(); if (waitForShutdown) { try { if (!executor.awaitTermination(365L, TimeUnit.DAYS)) { executor.shutdownNow(); } } catch (InterruptedException e) { ...
[ "private", "void", "stopResources", "(", "boolean", "waitForShutdown", ")", "throws", "InterruptedException", "{", "emitter", ".", "stop", "(", ")", ";", "emitterThread", ".", "interrupt", "(", ")", ";", "executor", ".", "shutdown", "(", ")", ";", "if", "(",...
Close the operator's resources. They include the emitter thread and the executor to run the queue's complete operation. @param waitForShutdown is true if the method should wait for the resources to be freed; otherwise false. @throws InterruptedException if current thread has been interrupted
[ "Close", "the", "operator", "s", "resources", ".", "They", "include", "the", "emitter", "thread", "and", "the", "executor", "to", "run", "the", "queue", "s", "complete", "operation", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/AsyncWaitOperator.java#L350-L381
train
Stop all the resources and wait for shutdown
[ 30522, 2797, 11675, 2644, 6072, 8162, 9623, 1006, 22017, 20898, 3524, 29278, 14235, 2102, 7698, 1007, 11618, 7153, 10288, 24422, 1063, 12495, 12079, 1012, 2644, 1006, 1007, 1025, 12495, 12079, 2705, 16416, 2094, 1012, 17938, 1006, 1007, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java
ExpectedConditions.invisibilityOf
public static ExpectedCondition<Boolean> invisibilityOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return isInvisible(element); } @Override public String toString() { return "invisibility...
java
public static ExpectedCondition<Boolean> invisibilityOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return isInvisible(element); } @Override public String toString() { return "invisibility...
[ "public", "static", "ExpectedCondition", "<", "Boolean", ">", "invisibilityOf", "(", "final", "WebElement", "element", ")", "{", "return", "new", "ExpectedCondition", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "public", "Boolean", "apply", "(", "WebD...
An expectation for checking the element to be invisible @param element used to check its invisibility @return Boolean true when elements is not visible anymore
[ "An", "expectation", "for", "checking", "the", "element", "to", "be", "invisible" ]
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1331-L1344
train
An expectation for checking that an element is invisible.
[ 30522, 2270, 10763, 3517, 8663, 20562, 1026, 22017, 20898, 1028, 1999, 11365, 13464, 11253, 1006, 2345, 4773, 12260, 3672, 5783, 1007, 1063, 2709, 2047, 3517, 8663, 20562, 1026, 22017, 20898, 1028, 1006, 1007, 1063, 1030, 2058, 15637, 2270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java
BinTrie.entrySet
public Set<Map.Entry<String, V>> entrySet() { Set<Map.Entry<String, V>> entrySet = new TreeSet<Map.Entry<String, V>>(); StringBuilder sb = new StringBuilder(); for (BaseNode node : child) { if (node == null) continue; node.walk(new StringBuilder(sb.toString())...
java
public Set<Map.Entry<String, V>> entrySet() { Set<Map.Entry<String, V>> entrySet = new TreeSet<Map.Entry<String, V>>(); StringBuilder sb = new StringBuilder(); for (BaseNode node : child) { if (node == null) continue; node.walk(new StringBuilder(sb.toString())...
[ "public", "Set", "<", "Map", ".", "Entry", "<", "String", ",", "V", ">", ">", "entrySet", "(", ")", "{", "Set", "<", "Map", ".", "Entry", "<", "String", ",", "V", ">", ">", "entrySet", "=", "new", "TreeSet", "<", "Map", ".", "Entry", "<", "Stri...
获取键值对集合 @return
[ "获取键值对集合" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java#L185-L195
train
Get the EntrySet for this BaseNode.
[ 30522, 2270, 2275, 1026, 4949, 1012, 4443, 1026, 5164, 1010, 1058, 1028, 1028, 4443, 13462, 1006, 1007, 1063, 2275, 1026, 4949, 1012, 4443, 1026, 5164, 1010, 1058, 1028, 1028, 4443, 13462, 1027, 2047, 3628, 3388, 1026, 4949, 1012, 4443, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.getName
public static String getName(String filePath) { if (null == filePath) { return filePath; } int len = filePath.length(); if (0 == len) { return filePath; } if (CharUtil.isFileSeparator(filePath.charAt(len - 1))) { // 以分隔符结尾的去掉结尾分隔符 len--; } int begin = 0; char c; for (int ...
java
public static String getName(String filePath) { if (null == filePath) { return filePath; } int len = filePath.length(); if (0 == len) { return filePath; } if (CharUtil.isFileSeparator(filePath.charAt(len - 1))) { // 以分隔符结尾的去掉结尾分隔符 len--; } int begin = 0; char c; for (int ...
[ "public", "static", "String", "getName", "(", "String", "filePath", ")", "{", "if", "(", "null", "==", "filePath", ")", "{", "return", "filePath", ";", "}", "int", "len", "=", "filePath", ".", "length", "(", ")", ";", "if", "(", "0", "==", "len", "...
返回文件名 @param filePath 文件 @return 文件名 @since 4.1.13
[ "返回文件名" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1721-L1746
train
Gets the name of the file.
[ 30522, 2270, 10763, 5164, 2131, 18442, 1006, 5164, 5371, 15069, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5371, 15069, 1007, 1063, 2709, 5371, 15069, 1025, 1065, 20014, 18798, 1027, 5371, 15069, 1012, 3091, 1006, 1007, 1025, 2065, 1006, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java
RandomUtil.randomEles
public static <T> List<T> randomEles(List<T> list, int count) { final List<T> result = new ArrayList<T>(count); int limit = list.size(); while (result.size() < count) { result.add(randomEle(list, limit)); } return result; }
java
public static <T> List<T> randomEles(List<T> list, int count) { final List<T> result = new ArrayList<T>(count); int limit = list.size(); while (result.size() < count) { result.add(randomEle(list, limit)); } return result; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "randomEles", "(", "List", "<", "T", ">", "list", ",", "int", "count", ")", "{", "final", "List", "<", "T", ">", "result", "=", "new", "ArrayList", "<", "T", ">", "(", "count", ")", ";",...
随机获得列表中的一定量元素 @param <T> 元素类型 @param list 列表 @param count 随机取出的个数 @return 随机元素
[ "随机获得列表中的一定量元素" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L311-L319
train
Returns a random subset of the specified list of elements.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2862, 1026, 1056, 1028, 6721, 26741, 1006, 2862, 1026, 1056, 1028, 2862, 1010, 20014, 4175, 1007, 1063, 2345, 2862, 1026, 1056, 1028, 2765, 1027, 2047, 9140, 9863, 1026, 1056, 1028, 1006, 4175, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyProtocol.java
NettyProtocol.getClientChannelHandlers
public ChannelHandler[] getClientChannelHandlers() { NetworkClientHandler networkClientHandler = creditBasedEnabled ? new CreditBasedPartitionRequestClientHandler() : new PartitionRequestClientHandler(); return new ChannelHandler[] { messageEncoder, new NettyMessage.NettyMessageDecoder(!creditBasedEnab...
java
public ChannelHandler[] getClientChannelHandlers() { NetworkClientHandler networkClientHandler = creditBasedEnabled ? new CreditBasedPartitionRequestClientHandler() : new PartitionRequestClientHandler(); return new ChannelHandler[] { messageEncoder, new NettyMessage.NettyMessageDecoder(!creditBasedEnab...
[ "public", "ChannelHandler", "[", "]", "getClientChannelHandlers", "(", ")", "{", "NetworkClientHandler", "networkClientHandler", "=", "creditBasedEnabled", "?", "new", "CreditBasedPartitionRequestClientHandler", "(", ")", ":", "new", "PartitionRequestClientHandler", "(", ")...
Returns the client channel handlers. <pre> +-----------+----------+ +----------------------+ | Remote input channel | | request client | +-----------+----------+ +-----------+----------+ | | (1) write +---------------+----------------------------...
[ "Returns", "the", "client", "channel", "handlers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyProtocol.java#L124-L132
train
Returns an array of ChannelHandlers that can be used to handle the request.
[ 30522, 2270, 3149, 11774, 3917, 1031, 1033, 2131, 20464, 11638, 26058, 11774, 12910, 1006, 1007, 1063, 2897, 20464, 11638, 11774, 3917, 2897, 20464, 11638, 11774, 3917, 1027, 4923, 15058, 4181, 3085, 2094, 1029, 2047, 4923, 15058, 18927, 8445...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java
PartitionOperator.withOrders
@PublicEvolving public PartitionOperator<T> withOrders(Order... orders) { Preconditions.checkState(pMethod == PartitionMethod.RANGE, "Orders cannot be applied for %s partition " + "method", pMethod); Preconditions.checkArgument(pKeys.getOriginalKeyFieldTypes().length == orders.length, "The number of key " + ...
java
@PublicEvolving public PartitionOperator<T> withOrders(Order... orders) { Preconditions.checkState(pMethod == PartitionMethod.RANGE, "Orders cannot be applied for %s partition " + "method", pMethod); Preconditions.checkArgument(pKeys.getOriginalKeyFieldTypes().length == orders.length, "The number of key " + ...
[ "@", "PublicEvolving", "public", "PartitionOperator", "<", "T", ">", "withOrders", "(", "Order", "...", "orders", ")", "{", "Preconditions", ".", "checkState", "(", "pMethod", "==", "PartitionMethod", ".", "RANGE", ",", "\"Orders cannot be applied for %s partition \""...
Sets the order of keys for range partitioning. NOTE: Only valid for {@link PartitionMethod#RANGE}. @param orders array of orders for each specified partition key @return The partitioneOperator with properly set orders for given keys
[ "Sets", "the", "order", "of", "keys", "for", "range", "partitioning", ".", "NOTE", ":", "Only", "valid", "for", "{", "@link", "PartitionMethod#RANGE", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java#L110-L119
train
Sets the order of the results of the operation.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 13571, 25918, 8844, 1026, 1056, 1028, 2007, 8551, 2545, 1006, 2344, 1012, 1012, 1012, 4449, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 14148, 12259, 1006, 7610, 11031, 7716, 1027, 1027, 13571, 1136...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/concurrent/DefaultPromise.java
DefaultPromise.notifyListener
protected static void notifyListener( EventExecutor eventExecutor, final Future<?> future, final GenericFutureListener<?> listener) { checkNotNull(eventExecutor, "eventExecutor"); checkNotNull(future, "future"); checkNotNull(listener, "listener"); notifyListenerWithStackOverF...
java
protected static void notifyListener( EventExecutor eventExecutor, final Future<?> future, final GenericFutureListener<?> listener) { checkNotNull(eventExecutor, "eventExecutor"); checkNotNull(future, "future"); checkNotNull(listener, "listener"); notifyListenerWithStackOverF...
[ "protected", "static", "void", "notifyListener", "(", "EventExecutor", "eventExecutor", ",", "final", "Future", "<", "?", ">", "future", ",", "final", "GenericFutureListener", "<", "?", ">", "listener", ")", "{", "checkNotNull", "(", "eventExecutor", ",", "\"eve...
Notify a listener that a future has completed. <p> This method has a fixed depth of {@link #MAX_LISTENER_STACK_DEPTH} that will limit recursion to prevent {@link StackOverflowError} and will stop notifying listeners added after this threshold is exceeded. @param eventExecutor the executor to use to notify the listener ...
[ "Notify", "a", "listener", "that", "a", "future", "has", "completed", ".", "<p", ">", "This", "method", "has", "a", "fixed", "depth", "of", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java#L399-L405
train
Notify a GenericFutureListener with a stack over flow protection.
[ 30522, 5123, 10763, 11675, 2025, 8757, 9863, 24454, 1006, 2724, 10288, 8586, 16161, 2099, 2724, 10288, 8586, 16161, 2099, 1010, 2345, 2925, 1026, 1029, 1028, 2925, 1010, 2345, 12391, 11263, 11244, 9863, 24454, 1026, 1029, 1028, 19373, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java
UnilateralSortMerger.getIterator
@Override public MutableObjectIterator<E> getIterator() throws InterruptedException { synchronized (this.iteratorLock) { // wait while both the iterator and the exception are not set while (this.iterator == null && this.iteratorException == null) { this.iteratorLock.wait(); } if (this.iteratorExc...
java
@Override public MutableObjectIterator<E> getIterator() throws InterruptedException { synchronized (this.iteratorLock) { // wait while both the iterator and the exception are not set while (this.iterator == null && this.iteratorException == null) { this.iteratorLock.wait(); } if (this.iteratorExc...
[ "@", "Override", "public", "MutableObjectIterator", "<", "E", ">", "getIterator", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "this", ".", "iteratorLock", ")", "{", "// wait while both the iterator and the exception are not set", "while", "(", ...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L641-L657
train
Returns an iterator that returns the sorted object iterator.
[ 30522, 1030, 2058, 15637, 2270, 14163, 10880, 16429, 20614, 21646, 8844, 1026, 1041, 1028, 2131, 21646, 8844, 1006, 1007, 11618, 7153, 10288, 24422, 1063, 25549, 1006, 2023, 1012, 2009, 6906, 4263, 7878, 1007, 1063, 1013, 1013, 3524, 2096, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java
AbstractEpollStreamChannel.spliceTo
public final ChannelFuture spliceTo(final FileDescriptor ch, final int offset, final int len, final ChannelPromise promise) { checkPositiveOrZero(len, "len"); checkPositiveOrZero(offset, "offser"); if (config().getEpollMode() != EpollMode.LEVEL_TRIGGERED) ...
java
public final ChannelFuture spliceTo(final FileDescriptor ch, final int offset, final int len, final ChannelPromise promise) { checkPositiveOrZero(len, "len"); checkPositiveOrZero(offset, "offser"); if (config().getEpollMode() != EpollMode.LEVEL_TRIGGERED) ...
[ "public", "final", "ChannelFuture", "spliceTo", "(", "final", "FileDescriptor", "ch", ",", "final", "int", "offset", ",", "final", "int", "len", ",", "final", "ChannelPromise", "promise", ")", "{", "checkPositiveOrZero", "(", "len", ",", "\"len\"", ")", ";", ...
Splice from this {@link AbstractEpollStreamChannel} to another {@link FileDescriptor}. The {@code offset} is the offset for the {@link FileDescriptor} and {@code len} is the number of bytes to splice. If using {@link Integer#MAX_VALUE} it will splice until the {@link ChannelFuture} was canceled or it was failed. Pleas...
[ "Splice", "from", "this", "{", "@link", "AbstractEpollStreamChannel", "}", "to", "another", "{", "@link", "FileDescriptor", "}", ".", "The", "{", "@code", "offset", "}", "is", "the", "offset", "for", "the", "{", "@link", "FileDescriptor", "}", "and", "{", ...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java#L214-L229
train
Splice to a file.
[ 30522, 2270, 2345, 3149, 11263, 11244, 11867, 13231, 3406, 1006, 2345, 6406, 2229, 23235, 2953, 10381, 1010, 2345, 20014, 16396, 1010, 2345, 20014, 18798, 1010, 2345, 3149, 21572, 28732, 4872, 1007, 1063, 4638, 6873, 28032, 3512, 2953, 6290, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java
KeyGroupPartitioner.reportAllElementKeyGroups
protected void reportAllElementKeyGroups() { Preconditions.checkState(partitioningSource.length >= numberOfElements); for (int i = 0; i < numberOfElements; ++i) { int keyGroup = KeyGroupRangeAssignment.assignToKeyGroup( keyExtractorFunction.extractKeyFromElement(partitioningSource[i]), totalKeyGroups); ...
java
protected void reportAllElementKeyGroups() { Preconditions.checkState(partitioningSource.length >= numberOfElements); for (int i = 0; i < numberOfElements; ++i) { int keyGroup = KeyGroupRangeAssignment.assignToKeyGroup( keyExtractorFunction.extractKeyFromElement(partitioningSource[i]), totalKeyGroups); ...
[ "protected", "void", "reportAllElementKeyGroups", "(", ")", "{", "Preconditions", ".", "checkState", "(", "partitioningSource", ".", "length", ">=", "numberOfElements", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfElements", ";", "++", ...
This method iterates over the input data and reports the key-group for each element.
[ "This", "method", "iterates", "over", "the", "input", "data", "and", "reports", "the", "key", "-", "group", "for", "each", "element", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L147-L156
train
Report all key groups of the elements in the partitioning source.
[ 30522, 5123, 11675, 3189, 24164, 16930, 4765, 14839, 17058, 2015, 1006, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 14148, 12259, 1006, 13571, 8613, 8162, 3401, 1012, 3091, 1028, 1027, 2193, 11253, 12260, 8163, 1007, 1025, 2005, 1006, 20014, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java
BinaryString.trimLeft
public BinaryString trimLeft(BinaryString trimStr) { ensureMaterialized(); if (trimStr == null) { return null; } trimStr.ensureMaterialized(); if (trimStr.isSpaceString()) { return trimLeft(); } if (inFirstSegment()) { int searchIdx = 0; while (searchIdx < this.sizeInBytes) { int charBytes...
java
public BinaryString trimLeft(BinaryString trimStr) { ensureMaterialized(); if (trimStr == null) { return null; } trimStr.ensureMaterialized(); if (trimStr.isSpaceString()) { return trimLeft(); } if (inFirstSegment()) { int searchIdx = 0; while (searchIdx < this.sizeInBytes) { int charBytes...
[ "public", "BinaryString", "trimLeft", "(", "BinaryString", "trimStr", ")", "{", "ensureMaterialized", "(", ")", ";", "if", "(", "trimStr", "==", "null", ")", "{", "return", "null", ";", "}", "trimStr", ".", "ensureMaterialized", "(", ")", ";", "if", "(", ...
Walk each character of current string from left end, remove the character if it is in trim string. Stops at the first character which is not in trim string. Return the new substring. @param trimStr the trim string @return A subString which removes all of the character from the left side that is in trim string.
[ "Walk", "each", "character", "of", "current", "string", "from", "left", "end", "remove", "the", "character", "if", "it", "is", "in", "trim", "string", ".", "Stops", "at", "the", "first", "character", "which", "is", "not", "in", "trim", "string", ".", "Re...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L716-L747
train
Returns a new string with characters from this string that are not in the trim string.
[ 30522, 2270, 12441, 3367, 4892, 12241, 2571, 6199, 1006, 12441, 3367, 4892, 12241, 3367, 2099, 1007, 1063, 5676, 8585, 14482, 3550, 1006, 1007, 1025, 2065, 1006, 12241, 3367, 2099, 1027, 1027, 19701, 1007, 1063, 2709, 19701, 1025, 1065, 122...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java
AbstractLexicalAnalyzer.segment
protected void segment(final String sentence, final String normalized, final List<String> wordList, final List<CoreDictionary.Attribute> attributeList) { if (attributeList != null) { final int[] offset = new int[]{0}; CustomDictionary.parseLongestText(sentence, new AhoCorasic...
java
protected void segment(final String sentence, final String normalized, final List<String> wordList, final List<CoreDictionary.Attribute> attributeList) { if (attributeList != null) { final int[] offset = new int[]{0}; CustomDictionary.parseLongestText(sentence, new AhoCorasic...
[ "protected", "void", "segment", "(", "final", "String", "sentence", ",", "final", "String", "normalized", ",", "final", "List", "<", "String", ">", "wordList", ",", "final", "List", "<", "CoreDictionary", ".", "Attribute", ">", "attributeList", ")", "{", "if...
分词 @param sentence 文本 @param normalized 正规化后的文本 @param wordList 储存单词列表 @param attributeList 储存用户词典中的词性,设为null表示不查询用户词典
[ "分词" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L109-L140
train
segmentAfterRule This method is called after the sentence is parsed.
[ 30522, 5123, 11675, 6903, 1006, 2345, 5164, 6251, 1010, 2345, 5164, 3671, 3550, 1010, 2345, 2862, 1026, 5164, 1028, 2773, 9863, 1010, 2345, 2862, 1026, 4563, 29201, 3258, 5649, 1012, 17961, 1028, 17961, 9863, 1007, 1063, 2065, 1006, 17961, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java
Bindable.of
public static <T> Bindable<T> of(ResolvableType type) { Assert.notNull(type, "Type must not be null"); ResolvableType boxedType = box(type); return new Bindable<>(type, boxedType, null, NO_ANNOTATIONS); }
java
public static <T> Bindable<T> of(ResolvableType type) { Assert.notNull(type, "Type must not be null"); ResolvableType boxedType = box(type); return new Bindable<>(type, boxedType, null, NO_ANNOTATIONS); }
[ "public", "static", "<", "T", ">", "Bindable", "<", "T", ">", "of", "(", "ResolvableType", "type", ")", "{", "Assert", ".", "notNull", "(", "type", ",", "\"Type must not be null\"", ")", ";", "ResolvableType", "boxedType", "=", "box", "(", "type", ")", "...
Create a new {@link Bindable} of the specified type. @param <T> the source type @param type the type (must not be {@code null}) @return a {@link Bindable} instance @see #of(Class)
[ "Create", "a", "new", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java#L246-L250
train
Creates a new instance of the specified type.
[ 30522, 2270, 10763, 1026, 1056, 1028, 14187, 3085, 1026, 1056, 1028, 1997, 1006, 24501, 4747, 12423, 13874, 2828, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 2828, 1010, 1000, 2828, 2442, 2025, 2022, 19701, 1000, 1007, 1025, 24501, 47...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.wrap
public static Long[] wrap(long... values) { if (null == values) { return null; } final int length = values.length; if (0 == length) { return new Long[0]; } final Long[] array = new Long[length]; for (int i = 0; i < length; i++) { array[i] = Long.valueOf(values[i]); } return arra...
java
public static Long[] wrap(long... values) { if (null == values) { return null; } final int length = values.length; if (0 == length) { return new Long[0]; } final Long[] array = new Long[length]; for (int i = 0; i < length; i++) { array[i] = Long.valueOf(values[i]); } return arra...
[ "public", "static", "Long", "[", "]", "wrap", "(", "long", "...", "values", ")", "{", "if", "(", "null", "==", "values", ")", "{", "return", "null", ";", "}", "final", "int", "length", "=", "values", ".", "length", ";", "if", "(", "0", "==", "len...
将原始类型数组包装为包装类型 @param values 原始类型数组 @return 包装类型数组
[ "将原始类型数组包装为包装类型" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1443-L1457
train
Wraps the specified long array in a new array.
[ 30522, 2270, 10763, 2146, 1031, 1033, 10236, 1006, 2146, 1012, 1012, 1012, 5300, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5300, 1007, 1063, 2709, 19701, 1025, 1065, 2345, 20014, 3091, 1027, 5300, 1012, 3091, 1025, 2065, 1006, 1014, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java
NFACompiler.compileFactory
@SuppressWarnings("unchecked") public static <T> NFAFactory<T> compileFactory( final Pattern<T, ?> pattern, boolean timeoutHandling) { if (pattern == null) { // return a factory for empty NFAs return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling); } else { final NFAFactory...
java
@SuppressWarnings("unchecked") public static <T> NFAFactory<T> compileFactory( final Pattern<T, ?> pattern, boolean timeoutHandling) { if (pattern == null) { // return a factory for empty NFAs return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling); } else { final NFAFactory...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "NFAFactory", "<", "T", ">", "compileFactory", "(", "final", "Pattern", "<", "T", ",", "?", ">", "pattern", ",", "boolean", "timeoutHandling", ")", "{", "if", "(", "pa...
Compiles the given pattern into a {@link NFAFactory}. The NFA factory can be used to create multiple NFAs. @param pattern Definition of sequence pattern @param timeoutHandling True if the NFA shall return timed out event patterns @param <T> Type of the input events @return Factory for NFAs corresponding to the given p...
[ "Compiles", "the", "given", "pattern", "into", "a", "{", "@link", "NFAFactory", "}", ".", "The", "NFA", "factory", "can", "be", "used", "to", "create", "multiple", "NFAs", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java#L68-L80
train
Compile a NFAFactory for a given pattern.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1056, 1028, 1050, 7011, 21450, 1026, 1056, 1028, 4012, 22090, 21450, 1006, 2345, 5418, 1026, 1056, 1010, 1029, 1028, 5418, 1010, 22017, 2089...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-db/src/main/java/cn/hutool/db/DbUtil.java
DbUtil.getJndiDs
public static DataSource getJndiDs(String jndiName) { try { return (DataSource) new InitialContext().lookup(jndiName); } catch (NamingException e) { throw new DbRuntimeException(e); } }
java
public static DataSource getJndiDs(String jndiName) { try { return (DataSource) new InitialContext().lookup(jndiName); } catch (NamingException e) { throw new DbRuntimeException(e); } }
[ "public", "static", "DataSource", "getJndiDs", "(", "String", "jndiName", ")", "{", "try", "{", "return", "(", "DataSource", ")", "new", "InitialContext", "(", ")", ".", "lookup", "(", "jndiName", ")", ";", "}", "catch", "(", "NamingException", "e", ")", ...
获得JNDI数据源 @param jndiName JNDI名称 @return 数据源
[ "获得JNDI数据源" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DbUtil.java#L223-L229
train
Returns a DataSource object for the specified JNDI name.
[ 30522, 2270, 10763, 2951, 6499, 3126, 3401, 2131, 22895, 4305, 5104, 1006, 5164, 1046, 16089, 18442, 1007, 1063, 3046, 1063, 2709, 1006, 2951, 6499, 3126, 3401, 1007, 2047, 3988, 8663, 18209, 1006, 1007, 1012, 2298, 6279, 1006, 1046, 16089,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Validator.java
Validator.validateMoney
public static <T extends CharSequence> T validateMoney(T value, String errorMsg) throws ValidateException { if (false == isMoney(value)) { throw new ValidateException(errorMsg); } return value; }
java
public static <T extends CharSequence> T validateMoney(T value, String errorMsg) throws ValidateException { if (false == isMoney(value)) { throw new ValidateException(errorMsg); } return value; }
[ "public", "static", "<", "T", "extends", "CharSequence", ">", "T", "validateMoney", "(", "T", "value", ",", "String", "errorMsg", ")", "throws", "ValidateException", "{", "if", "(", "false", "==", "isMoney", "(", "value", ")", ")", "{", "throw", "new", "...
验证是否为货币 @param <T> 字符串类型 @param value 值 @param errorMsg 验证错误的信息 @return 验证后的值 @throws ValidateException 验证异常
[ "验证是否为货币" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L598-L604
train
Validate a money value.
[ 30522, 2270, 10763, 1026, 1056, 8908, 25869, 3366, 4226, 5897, 1028, 1056, 9398, 3686, 8202, 3240, 1006, 1056, 3643, 1010, 5164, 7561, 5244, 2290, 1007, 11618, 9398, 3686, 10288, 24422, 1063, 2065, 1006, 6270, 1027, 1027, 2003, 8202, 3240, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-http/src/main/java/cn/hutool/http/HttpUtil.java
HttpUtil.urlWithForm
public static String urlWithForm(String url, Map<String, Object> form, Charset charset, boolean isEncodeParams) { if (isEncodeParams && StrUtil.contains(url, '?')) { // 在需要编码的情况下,如果url中已经有部分参数,则编码之 url = encodeParams(url, charset); } // url和参数是分别编码的 return urlWithForm(url, toParams(form, charset),...
java
public static String urlWithForm(String url, Map<String, Object> form, Charset charset, boolean isEncodeParams) { if (isEncodeParams && StrUtil.contains(url, '?')) { // 在需要编码的情况下,如果url中已经有部分参数,则编码之 url = encodeParams(url, charset); } // url和参数是分别编码的 return urlWithForm(url, toParams(form, charset),...
[ "public", "static", "String", "urlWithForm", "(", "String", "url", ",", "Map", "<", "String", ",", "Object", ">", "form", ",", "Charset", "charset", ",", "boolean", "isEncodeParams", ")", "{", "if", "(", "isEncodeParams", "&&", "StrUtil", ".", "contains", ...
将表单数据加到URL中(用于GET表单提交)<br> 表单的键值对会被url编码,但是url中原参数不会被编码 @param url URL @param form 表单数据 @param charset 编码 @param isEncodeParams 是否对键和值做转义处理 @return 合成后的URL
[ "将表单数据加到URL中(用于GET表单提交)<br", ">", "表单的键值对会被url编码,但是url中原参数不会被编码" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L604-L612
train
Returns a URL with the specified form data.
[ 30522, 2270, 10763, 5164, 24471, 2140, 24415, 14192, 1006, 5164, 24471, 2140, 1010, 4949, 1026, 5164, 1010, 4874, 1028, 2433, 1010, 25869, 13462, 25869, 13462, 1010, 22017, 20898, 2003, 2368, 16044, 28689, 5244, 1007, 1063, 2065, 1006, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java
MultipartFormData.parseRequestStream
public void parseRequestStream(InputStream inputStream, String charset) throws IOException { setLoaded(); MultipartRequestInputStream input = new MultipartRequestInputStream(inputStream); input.readBoundary(); while (true) { UploadFileHeader header = input.readDataHeader(charset); if (header == nu...
java
public void parseRequestStream(InputStream inputStream, String charset) throws IOException { setLoaded(); MultipartRequestInputStream input = new MultipartRequestInputStream(inputStream); input.readBoundary(); while (true) { UploadFileHeader header = input.readDataHeader(charset); if (header == nu...
[ "public", "void", "parseRequestStream", "(", "InputStream", "inputStream", ",", "String", "charset", ")", "throws", "IOException", "{", "setLoaded", "(", ")", ";", "MultipartRequestInputStream", "input", "=", "new", "MultipartRequestInputStream", "(", "inputStream", "...
提取上传的文件和表单数据 @param inputStream HttpRequest流 @param charset 编码 @throws IOException IO异常
[ "提取上传的文件和表单数据" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java#L68-L108
train
Parses an input stream and populates the related fields.
[ 30522, 2270, 11675, 11968, 8043, 2063, 15500, 21422, 1006, 20407, 25379, 20407, 25379, 1010, 5164, 25869, 13462, 1007, 11618, 22834, 10288, 24422, 1063, 2275, 17468, 1006, 1007, 1025, 4800, 19362, 7913, 15500, 2378, 18780, 21422, 7953, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java
InitializrServiceMetadata.getDefaultType
public ProjectType getDefaultType() { if (this.projectTypes.getDefaultItem() != null) { return this.projectTypes.getDefaultItem(); } String defaultTypeId = getDefaults().get("type"); if (defaultTypeId != null) { return this.projectTypes.getContent().get(defaultTypeId); } return null; }
java
public ProjectType getDefaultType() { if (this.projectTypes.getDefaultItem() != null) { return this.projectTypes.getDefaultItem(); } String defaultTypeId = getDefaults().get("type"); if (defaultTypeId != null) { return this.projectTypes.getContent().get(defaultTypeId); } return null; }
[ "public", "ProjectType", "getDefaultType", "(", ")", "{", "if", "(", "this", ".", "projectTypes", ".", "getDefaultItem", "(", ")", "!=", "null", ")", "{", "return", "this", ".", "projectTypes", ".", "getDefaultItem", "(", ")", ";", "}", "String", "defaultT...
Return the default type to use or {@code null} if the metadata does not define any default. @return the default project type or {@code null}
[ "Return", "the", "default", "type", "to", "use", "or", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java#L110-L119
train
Get the default type.
[ 30522, 2270, 2622, 13874, 2131, 3207, 7011, 11314, 13874, 1006, 1007, 1063, 2065, 1006, 2023, 1012, 2622, 13874, 2015, 1012, 2131, 3207, 7011, 11314, 4221, 2213, 1006, 1007, 999, 1027, 19701, 1007, 1063, 2709, 2023, 1012, 2622, 13874, 2015,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java
WebSocketServerHandshaker.handshake
public ChannelFuture handshake(Channel channel, FullHttpRequest req) { return handshake(channel, req, null, channel.newPromise()); }
java
public ChannelFuture handshake(Channel channel, FullHttpRequest req) { return handshake(channel, req, null, channel.newPromise()); }
[ "public", "ChannelFuture", "handshake", "(", "Channel", "channel", ",", "FullHttpRequest", "req", ")", "{", "return", "handshake", "(", "channel", ",", "req", ",", "null", ",", "channel", ".", "newPromise", "(", ")", ")", ";", "}" ]
Performs the opening handshake. When call this method you <strong>MUST NOT</strong> retain the {@link FullHttpRequest} which is passed in. @param channel Channel @param req HTTP Request @return future The {@link ChannelFuture} which is notified once the opening handshake completes
[ "Performs", "the", "opening", "handshake", ".", "When", "call", "this", "method", "you", "<strong", ">", "MUST", "NOT<", "/", "strong", ">", "retain", "the", "{", "@link", "FullHttpRequest", "}", "which", "is", "passed", "in", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java#L141-L143
train
Handshake the request.
[ 30522, 2270, 3149, 11263, 11244, 2398, 20459, 2063, 1006, 3149, 3149, 1010, 2440, 11039, 25856, 2890, 15500, 2128, 4160, 1007, 1063, 2709, 2398, 20459, 2063, 1006, 3149, 1010, 2128, 4160, 1010, 19701, 1010, 3149, 1012, 2047, 21572, 28732, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
store/src/main/java/com/alibaba/otter/canal/store/helper/CanalEventUtils.java
CanalEventUtils.createPosition
public static LogPosition createPosition(Event event) { EntryPosition position = new EntryPosition(); position.setJournalName(event.getJournalName()); position.setPosition(event.getPosition()); position.setTimestamp(event.getExecuteTime()); // add serverId at 2016-06-28 p...
java
public static LogPosition createPosition(Event event) { EntryPosition position = new EntryPosition(); position.setJournalName(event.getJournalName()); position.setPosition(event.getPosition()); position.setTimestamp(event.getExecuteTime()); // add serverId at 2016-06-28 p...
[ "public", "static", "LogPosition", "createPosition", "(", "Event", "event", ")", "{", "EntryPosition", "position", "=", "new", "EntryPosition", "(", ")", ";", "position", ".", "setJournalName", "(", "event", ".", "getJournalName", "(", ")", ")", ";", "position...
根据entry创建对应的Position对象
[ "根据entry创建对应的Position对象" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/store/src/main/java/com/alibaba/otter/canal/store/helper/CanalEventUtils.java#L48-L62
train
Create a log position object from an event.
[ 30522, 2270, 10763, 8833, 26994, 3443, 26994, 1006, 2724, 2724, 1007, 1063, 4443, 26994, 2597, 1027, 2047, 4443, 26994, 1006, 1007, 1025, 2597, 1012, 2275, 23099, 12789, 19666, 14074, 1006, 2724, 1012, 2131, 23099, 12789, 19666, 14074, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/LongHashPartition.java
LongHashPartition.updateIndex
private void updateIndex( long key, int hashCode, long address, int size, MemorySegment dataSegment, int currentPositionInSegment) throws IOException { assert (numKeys <= numBuckets / 2); int bucketId = hashCode & numBucketsMask; // each bucket occupied 16 bytes (long key + long pointer to data...
java
private void updateIndex( long key, int hashCode, long address, int size, MemorySegment dataSegment, int currentPositionInSegment) throws IOException { assert (numKeys <= numBuckets / 2); int bucketId = hashCode & numBucketsMask; // each bucket occupied 16 bytes (long key + long pointer to data...
[ "private", "void", "updateIndex", "(", "long", "key", ",", "int", "hashCode", ",", "long", "address", ",", "int", "size", ",", "MemorySegment", "dataSegment", ",", "int", "currentPositionInSegment", ")", "throws", "IOException", "{", "assert", "(", "numKeys", ...
Update the address in array for given key.
[ "Update", "the", "address", "in", "array", "for", "given", "key", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/LongHashPartition.java#L286-L343
train
Update the index of the key in the array.
[ 30522, 2797, 11675, 10651, 22254, 10288, 1006, 2146, 3145, 1010, 20014, 23325, 16044, 1010, 2146, 4769, 1010, 20014, 2946, 1010, 3638, 3366, 21693, 4765, 2951, 3366, 21693, 4765, 1010, 20014, 2783, 26994, 7076, 13910, 3672, 1007, 11618, 22834...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java
MetricQueryService.replaceInvalidChars
private static String replaceInvalidChars(String str) { char[] chars = null; final int strLen = str.length(); int pos = 0; for (int i = 0; i < strLen; i++) { final char c = str.charAt(i); switch (c) { case ' ': case '.': case ':': case ',': if (chars == null) { chars = str.toCh...
java
private static String replaceInvalidChars(String str) { char[] chars = null; final int strLen = str.length(); int pos = 0; for (int i = 0; i < strLen; i++) { final char c = str.charAt(i); switch (c) { case ' ': case '.': case ':': case ',': if (chars == null) { chars = str.toCh...
[ "private", "static", "String", "replaceInvalidChars", "(", "String", "str", ")", "{", "char", "[", "]", "chars", "=", "null", ";", "final", "int", "strLen", "=", "str", ".", "length", "(", ")", ";", "int", "pos", "=", "0", ";", "for", "(", "int", "...
Lightweight method to replace unsupported characters. If the string does not contain any unsupported characters, this method creates no new string (and in fact no new objects at all). <p>Replacements: <ul> <li>{@code space : . ,} are replaced by {@code _} (underscore)</li> </ul>
[ "Lightweight", "method", "to", "replace", "unsupported", "characters", ".", "If", "the", "string", "does", "not", "contain", "any", "unsupported", "characters", "this", "method", "creates", "no", "new", "string", "(", "and", "in", "fact", "no", "new", "objects...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java#L208-L234
train
Replaces invalid characters in the string.
[ 30522, 2797, 10763, 5164, 5672, 2378, 10175, 3593, 7507, 2869, 1006, 5164, 2358, 2099, 1007, 1063, 25869, 1031, 1033, 25869, 2015, 1027, 19701, 1025, 2345, 20014, 2358, 20927, 2078, 1027, 2358, 2099, 1012, 3091, 1006, 1007, 1025, 20014, 134...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/trie/DoubleArrayTrie.java
DoubleArrayTrie.get
public V get(String key) { int index = exactMatchSearch(key); if (index >= 0) { return getValueAt(index); } return null; }
java
public V get(String key) { int index = exactMatchSearch(key); if (index >= 0) { return getValueAt(index); } return null; }
[ "public", "V", "get", "(", "String", "key", ")", "{", "int", "index", "=", "exactMatchSearch", "(", "key", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "return", "getValueAt", "(", "index", ")", ";", "}", "return", "null", ";", "}" ]
精确查询 @param key 键 @return 值
[ "精确查询" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/DoubleArrayTrie.java#L989-L998
train
Gets the value of the appid.
[ 30522, 2270, 1058, 2131, 1006, 5164, 3145, 1007, 1063, 20014, 5950, 1027, 6635, 18900, 18069, 14644, 2818, 1006, 3145, 1007, 1025, 2065, 1006, 5950, 1028, 1027, 1014, 1007, 1063, 2709, 2131, 10175, 5657, 4017, 1006, 5950, 1007, 1025, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
example/src/main/java/io/netty/example/http2/helloworld/server/HelloWorldHttp2Handler.java
HelloWorldHttp2Handler.sendResponse
private void sendResponse(ChannelHandlerContext ctx, int streamId, ByteBuf payload) { // Send a frame for the response status Http2Headers headers = new DefaultHttp2Headers().status(OK.codeAsText()); encoder().writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise()); encoder().wr...
java
private void sendResponse(ChannelHandlerContext ctx, int streamId, ByteBuf payload) { // Send a frame for the response status Http2Headers headers = new DefaultHttp2Headers().status(OK.codeAsText()); encoder().writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise()); encoder().wr...
[ "private", "void", "sendResponse", "(", "ChannelHandlerContext", "ctx", ",", "int", "streamId", ",", "ByteBuf", "payload", ")", "{", "// Send a frame for the response status", "Http2Headers", "headers", "=", "new", "DefaultHttp2Headers", "(", ")", ".", "status", "(", ...
Sends a "Hello World" DATA frame to the client.
[ "Sends", "a", "Hello", "World", "DATA", "frame", "to", "the", "client", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/http2/helloworld/server/HelloWorldHttp2Handler.java#L88-L95
train
Sends a response frame to the server.
[ 30522, 2797, 11675, 4604, 6072, 26029, 3366, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 20014, 5460, 3593, 1010, 24880, 8569, 2546, 18093, 1007, 1063, 1013, 1013, 4604, 1037, 4853, 2005, 1996, 3433, 3570, 8299, 2475, 4974, 254...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.cut
public static void cut(InputStream srcStream, OutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); }
java
public static void cut(InputStream srcStream, OutputStream destStream, Rectangle rectangle) { cut(read(srcStream), destStream, rectangle); }
[ "public", "static", "void", "cut", "(", "InputStream", "srcStream", ",", "OutputStream", "destStream", ",", "Rectangle", "rectangle", ")", "{", "cut", "(", "read", "(", "srcStream", ")", ",", "destStream", ",", "rectangle", ")", ";", "}" ]
图像切割(按指定起点坐标和宽高切割),此方法并不关闭流 @param srcStream 源图像流 @param destStream 切片后的图像输出流 @param rectangle 矩形对象,表示矩形区域的x,y,width,height @since 3.1.0
[ "图像切割", "(", "按指定起点坐标和宽高切割", ")", ",此方法并不关闭流" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L268-L270
train
Cut the contents of srcStream to destStream using the specified rectangle.
[ 30522, 2270, 10763, 11675, 3013, 1006, 20407, 25379, 5034, 6169, 25379, 1010, 27852, 25379, 4078, 3215, 25379, 1010, 28667, 23395, 28667, 23395, 1007, 1063, 3013, 1006, 3191, 1006, 5034, 6169, 25379, 1007, 1010, 4078, 3215, 25379, 1010, 28667...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java
StyleUtil.createFont
public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) { final Font font = workbook.createFont(); return setFontStyle(font, color, fontSize, fontName); }
java
public static Font createFont(Workbook workbook, short color, short fontSize, String fontName) { final Font font = workbook.createFont(); return setFontStyle(font, color, fontSize, fontName); }
[ "public", "static", "Font", "createFont", "(", "Workbook", "workbook", ",", "short", "color", ",", "short", "fontSize", ",", "String", "fontName", ")", "{", "final", "Font", "font", "=", "workbook", ".", "createFont", "(", ")", ";", "return", "setFontStyle",...
创建字体 @param workbook {@link Workbook} @param color 字体颜色 @param fontSize 字体大小 @param fontName 字体名称,可以为null使用默认字体 @return {@link Font}
[ "创建字体" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L120-L123
train
Creates a font with the specified color and font size and font name.
[ 30522, 2270, 10763, 15489, 3443, 14876, 3372, 1006, 2147, 8654, 2147, 8654, 1010, 2460, 3609, 1010, 2460, 15489, 5332, 4371, 1010, 5164, 15489, 18442, 1007, 1063, 2345, 15489, 15489, 1027, 2147, 8654, 1012, 3443, 14876, 3372, 1006, 1007, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java
KeyGroupPartitioner.buildHistogramByAccumulatingCounts
private int buildHistogramByAccumulatingCounts() { int sum = 0; for (int i = 0; i < counterHistogram.length; ++i) { int currentSlotValue = counterHistogram[i]; counterHistogram[i] = sum; sum += currentSlotValue; } return sum; }
java
private int buildHistogramByAccumulatingCounts() { int sum = 0; for (int i = 0; i < counterHistogram.length; ++i) { int currentSlotValue = counterHistogram[i]; counterHistogram[i] = sum; sum += currentSlotValue; } return sum; }
[ "private", "int", "buildHistogramByAccumulatingCounts", "(", ")", "{", "int", "sum", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "counterHistogram", ".", "length", ";", "++", "i", ")", "{", "int", "currentSlotValue", "=", "counterHist...
This method creates a histogram from the counts per key-group in {@link #counterHistogram}.
[ "This", "method", "creates", "a", "histogram", "from", "the", "counts", "per", "key", "-", "group", "in", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L170-L178
train
Builds the histogram by accumulating counts.
[ 30522, 2797, 20014, 3857, 24158, 3406, 13113, 3762, 6305, 24894, 10924, 3597, 16671, 2015, 1006, 1007, 1063, 20014, 7680, 1027, 1014, 1025, 2005, 1006, 20014, 1045, 1027, 1014, 1025, 1045, 1026, 4675, 24158, 3406, 13113, 1012, 3091, 1025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
PendingCheckpoint.reportFailedCheckpoint
private void reportFailedCheckpoint(Exception cause) { // to prevent null-pointers from concurrent modification, copy reference onto stack final PendingCheckpointStats statsCallback = this.statsCallback; if (statsCallback != null) { long failureTimestamp = System.currentTimeMillis(); statsCallback.reportFai...
java
private void reportFailedCheckpoint(Exception cause) { // to prevent null-pointers from concurrent modification, copy reference onto stack final PendingCheckpointStats statsCallback = this.statsCallback; if (statsCallback != null) { long failureTimestamp = System.currentTimeMillis(); statsCallback.reportFai...
[ "private", "void", "reportFailedCheckpoint", "(", "Exception", "cause", ")", "{", "// to prevent null-pointers from concurrent modification, copy reference onto stack", "final", "PendingCheckpointStats", "statsCallback", "=", "this", ".", "statsCallback", ";", "if", "(", "stats...
Reports a failed checkpoint with the given optional cause. @param cause The failure cause or <code>null</code>.
[ "Reports", "a", "failed", "checkpoint", "with", "the", "given", "optional", "cause", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java#L486-L493
train
Reports a failed checkpoint.
[ 30522, 2797, 11675, 3189, 7011, 18450, 5403, 3600, 8400, 1006, 6453, 3426, 1007, 1063, 1013, 1013, 2000, 4652, 19701, 1011, 20884, 2015, 2013, 16483, 14080, 1010, 6100, 4431, 3031, 9991, 2345, 14223, 5403, 3600, 26521, 29336, 2015, 26319, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java
DefaultConfigurableOptionsFactory.configure
@Override public DefaultConfigurableOptionsFactory configure(Configuration configuration) { for (String key : CANDIDATE_CONFIGS) { String newValue = configuration.getString(key, null); if (newValue != null) { if (checkArgumentValid(key, newValue)) { this.configuredOptions.put(key, newValue); } ...
java
@Override public DefaultConfigurableOptionsFactory configure(Configuration configuration) { for (String key : CANDIDATE_CONFIGS) { String newValue = configuration.getString(key, null); if (newValue != null) { if (checkArgumentValid(key, newValue)) { this.configuredOptions.put(key, newValue); } ...
[ "@", "Override", "public", "DefaultConfigurableOptionsFactory", "configure", "(", "Configuration", "configuration", ")", "{", "for", "(", "String", "key", ":", "CANDIDATE_CONFIGS", ")", "{", "String", "newValue", "=", "configuration", ".", "getString", "(", "key", ...
Creates a {@link DefaultConfigurableOptionsFactory} instance from a {@link Configuration}. <p>If no options within {@link RocksDBConfigurableOptions} has ever been configured, the created OptionsFactory would not override anything defined in {@link PredefinedOptions}. @param configuration Configuration to be used for...
[ "Creates", "a", "{", "@link", "DefaultConfigurableOptionsFactory", "}", "instance", "from", "a", "{", "@link", "Configuration", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java#L351-L363
train
Override this to configure the options based on the configuration.
[ 30522, 1030, 2058, 15637, 2270, 12398, 8663, 8873, 27390, 3085, 7361, 9285, 21450, 9530, 8873, 27390, 2063, 1006, 9563, 9563, 1007, 1063, 2005, 1006, 5164, 3145, 1024, 4018, 1035, 9530, 8873, 5620, 1007, 1063, 5164, 2047, 10175, 5657, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/JobLeaderIdService.java
JobLeaderIdService.addJob
public void addJob(JobID jobId) throws Exception { Preconditions.checkNotNull(jobLeaderIdActions); LOG.debug("Add job {} to job leader id monitoring.", jobId); if (!jobLeaderIdListeners.containsKey(jobId)) { LeaderRetrievalService leaderRetrievalService = highAvailabilityServices.getJobManagerLeaderRetriever...
java
public void addJob(JobID jobId) throws Exception { Preconditions.checkNotNull(jobLeaderIdActions); LOG.debug("Add job {} to job leader id monitoring.", jobId); if (!jobLeaderIdListeners.containsKey(jobId)) { LeaderRetrievalService leaderRetrievalService = highAvailabilityServices.getJobManagerLeaderRetriever...
[ "public", "void", "addJob", "(", "JobID", "jobId", ")", "throws", "Exception", "{", "Preconditions", ".", "checkNotNull", "(", "jobLeaderIdActions", ")", ";", "LOG", ".", "debug", "(", "\"Add job {} to job leader id monitoring.\"", ",", "jobId", ")", ";", "if", ...
Add a job to be monitored to retrieve the job leader id. @param jobId identifying the job to monitor @throws Exception if the job could not be added to the service
[ "Add", "a", "job", "to", "be", "monitored", "to", "retrieve", "the", "job", "leader", "id", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/JobLeaderIdService.java#L145-L156
train
Add a job to the job leader id monitoring.
[ 30522, 2270, 11675, 5587, 5558, 2497, 1006, 3105, 3593, 3105, 3593, 1007, 11618, 6453, 1063, 3653, 8663, 20562, 2015, 1012, 4638, 17048, 11231, 3363, 1006, 3105, 19000, 8524, 22014, 1007, 1025, 8833, 1012, 2139, 8569, 2290, 1006, 1000, 5587...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
redisson/redisson
redisson/src/main/java/org/redisson/api/CronSchedule.java
CronSchedule.monthlyOnDayAndHourAndMinute
public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) { String expression = String.format("0 %d %d %d * ?", minute, hour, dayOfMonth); return of(expression); }
java
public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) { String expression = String.format("0 %d %d %d * ?", minute, hour, dayOfMonth); return of(expression); }
[ "public", "static", "CronSchedule", "monthlyOnDayAndHourAndMinute", "(", "int", "dayOfMonth", ",", "int", "hour", ",", "int", "minute", ")", "{", "String", "expression", "=", "String", ".", "format", "(", "\"0 %d %d %d * ?\"", ",", "minute", ",", "hour", ",", ...
Creates cron expression which schedule task execution every given day of the month at the given time @param hour of schedule @param minute of schedule @param dayOfMonth of schedule @return object
[ "Creates", "cron", "expression", "which", "schedule", "task", "execution", "every", "given", "day", "of", "the", "month", "at", "the", "given", "time" ]
d3acc0249b2d5d658d36d99e2c808ce49332ea44
https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/CronSchedule.java#L97-L100
train
Gets the CronSchedule for a monthly on day.
[ 30522, 2270, 10763, 13675, 5644, 7690, 9307, 7058, 29067, 7054, 16425, 8162, 5685, 10020, 10421, 1006, 20014, 2154, 11253, 9629, 2232, 1010, 20014, 3178, 1010, 20014, 3371, 1007, 1063, 5164, 3670, 1027, 5164, 1012, 4289, 1006, 1000, 1014, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
SSLUtils.createSSLClientSocketFactory
public static SocketFactory createSSLClientSocketFactory(Configuration config) throws Exception { SSLContext sslContext = createInternalSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled"); } return sslContext.getSocketFactory(); }
java
public static SocketFactory createSSLClientSocketFactory(Configuration config) throws Exception { SSLContext sslContext = createInternalSSLContext(config); if (sslContext == null) { throw new IllegalConfigurationException("SSL is not enabled"); } return sslContext.getSocketFactory(); }
[ "public", "static", "SocketFactory", "createSSLClientSocketFactory", "(", "Configuration", "config", ")", "throws", "Exception", "{", "SSLContext", "sslContext", "=", "createInternalSSLContext", "(", "config", ")", ";", "if", "(", "sslContext", "==", "null", ")", "{...
Creates a factory for SSL Client Sockets from the given configuration. SSL Client Sockets are always part of internal communication.
[ "Creates", "a", "factory", "for", "SSL", "Client", "Sockets", "from", "the", "given", "configuration", ".", "SSL", "Client", "Sockets", "are", "always", "part", "of", "internal", "communication", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L101-L108
train
Creates a SocketFactory for SSL client.
[ 30522, 2270, 10763, 22278, 21450, 9005, 14540, 20464, 11638, 6499, 19869, 24475, 18908, 10253, 1006, 9563, 9530, 8873, 2290, 1007, 11618, 6453, 1063, 7020, 22499, 10111, 18413, 7020, 22499, 10111, 18413, 1027, 3443, 18447, 11795, 9777, 14540, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/algorithm/Viterbi.java
Viterbi.computeEnum
public static <E extends Enum<E>> List<E> computeEnum(List<EnumItem<E>> roleTagList, TransformMatrixDictionary<E> transformMatrixDictionary) { int length = roleTagList.size() - 1; List<E> tagList = new ArrayList<E>(roleTagList.size()); double[][] cost = new double[2][]; // 滚动数组 Iter...
java
public static <E extends Enum<E>> List<E> computeEnum(List<EnumItem<E>> roleTagList, TransformMatrixDictionary<E> transformMatrixDictionary) { int length = roleTagList.size() - 1; List<E> tagList = new ArrayList<E>(roleTagList.size()); double[][] cost = new double[2][]; // 滚动数组 Iter...
[ "public", "static", "<", "E", "extends", "Enum", "<", "E", ">", ">", "List", "<", "E", ">", "computeEnum", "(", "List", "<", "EnumItem", "<", "E", ">", ">", "roleTagList", ",", "TransformMatrixDictionary", "<", "E", ">", "transformMatrixDictionary", ")", ...
标准版的Viterbi算法,查准率高,效率稍低 @param roleTagList 观测序列 @param transformMatrixDictionary 转移矩阵 @param <E> EnumItem的具体类型 @return 预测结果
[ "标准版的Viterbi算法,查准率高,效率稍低" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/Viterbi.java#L175-L233
train
Compute the enumeration of the class.
[ 30522, 2270, 10763, 1026, 1041, 8908, 4372, 2819, 1026, 1041, 1028, 1028, 2862, 1026, 1041, 1028, 24134, 2368, 2819, 1006, 2862, 1026, 4372, 12717, 18532, 1026, 1041, 1028, 1028, 2535, 15900, 9863, 1010, 10938, 18900, 17682, 29201, 3258, 56...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java
RandomUtil.randomDouble
public static double randomDouble(int scale, RoundingMode roundingMode) { return NumberUtil.round(randomDouble(), scale, roundingMode).doubleValue(); }
java
public static double randomDouble(int scale, RoundingMode roundingMode) { return NumberUtil.round(randomDouble(), scale, roundingMode).doubleValue(); }
[ "public", "static", "double", "randomDouble", "(", "int", "scale", ",", "RoundingMode", "roundingMode", ")", "{", "return", "NumberUtil", ".", "round", "(", "randomDouble", "(", ")", ",", "scale", ",", "roundingMode", ")", ".", "doubleValue", "(", ")", ";", ...
获得指定范围内的随机数 @param scale 保留小数位数 @param roundingMode 保留小数的模式 {@link RoundingMode} @return 随机数 @since 4.0.8
[ "获得指定范围内的随机数" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L182-L184
train
Returns a random double with the specified scale and roundingMode rounded to the specified scale.
[ 30522, 2270, 10763, 3313, 6721, 26797, 3468, 1006, 20014, 4094, 1010, 26939, 5302, 3207, 26939, 5302, 3207, 1007, 1063, 2709, 2193, 21823, 2140, 1012, 2461, 1006, 6721, 26797, 3468, 1006, 1007, 1010, 4094, 1010, 26939, 5302, 3207, 1007, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/SimpleCache.java
SimpleCache.get
public V get(K key) { // 尝试读取缓存 readLock.lock(); V value; try { value = cache.get(key); } finally { readLock.unlock(); } return value; }
java
public V get(K key) { // 尝试读取缓存 readLock.lock(); V value; try { value = cache.get(key); } finally { readLock.unlock(); } return value; }
[ "public", "V", "get", "(", "K", "key", ")", "{", "// 尝试读取缓存\r", "readLock", ".", "lock", "(", ")", ";", "V", "value", ";", "try", "{", "value", "=", "cache", ".", "get", "(", "key", ")", ";", "}", "finally", "{", "readLock", ".", "unlock", "(", ...
从缓存池中查找值 @param key 键 @return 值
[ "从缓存池中查找值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/SimpleCache.java#L30-L40
train
Gets the value associated with the specified key from the cache.
[ 30522, 2270, 1058, 2131, 1006, 1047, 3145, 1007, 1063, 1013, 1013, 100, 100, 100, 100, 100, 100, 3191, 7878, 1012, 5843, 1006, 1007, 1025, 1058, 3643, 1025, 3046, 1063, 3643, 1027, 17053, 1012, 2131, 1006, 3145, 1007, 1025, 1065, 2633, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.copyImage
public static BufferedImage copyImage(Image img, int imageType) { final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), imageType); final Graphics2D bGr = bimage.createGraphics(); bGr.drawImage(img, 0, 0, null); bGr.dispose(); return bimage; }
java
public static BufferedImage copyImage(Image img, int imageType) { final BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), imageType); final Graphics2D bGr = bimage.createGraphics(); bGr.drawImage(img, 0, 0, null); bGr.dispose(); return bimage; }
[ "public", "static", "BufferedImage", "copyImage", "(", "Image", "img", ",", "int", "imageType", ")", "{", "final", "BufferedImage", "bimage", "=", "new", "BufferedImage", "(", "img", ".", "getWidth", "(", "null", ")", ",", "img", ".", "getHeight", "(", "nu...
将已有Image复制新的一份出来 @param img {@link Image} @param imageType {@link BufferedImage}中的常量,图像类型,例如黑白等 @return {@link BufferedImage} @see BufferedImage#TYPE_INT_RGB @see BufferedImage#TYPE_INT_ARGB @see BufferedImage#TYPE_INT_ARGB_PRE @see BufferedImage#TYPE_INT_BGR @see BufferedImage#TYPE_3BYTE_BGR @see BufferedImage#TYPE_4...
[ "将已有Image复制新的一份出来" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1213-L1220
train
Copy an image to a new BufferedImage.
[ 30522, 2270, 10763, 17698, 2098, 9581, 3351, 6100, 9581, 3351, 1006, 3746, 10047, 2290, 1010, 20014, 3746, 13874, 1007, 1063, 2345, 17698, 2098, 9581, 3351, 12170, 26860, 1027, 2047, 17698, 2098, 9581, 3351, 1006, 10047, 2290, 1012, 2131, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
metrics/src/main/java/io/dropwizard/metrics/MetricName.java
MetricName.tagged
public MetricName tagged(String... pairs) { if (pairs == null) { return this; } if (pairs.length % 2 != 0) { throw new IllegalArgumentException("Argument count must be even"); } final Map<String, String> add = new HashMap<>(); for (int i = 0; i ...
java
public MetricName tagged(String... pairs) { if (pairs == null) { return this; } if (pairs.length % 2 != 0) { throw new IllegalArgumentException("Argument count must be even"); } final Map<String, String> add = new HashMap<>(); for (int i = 0; i ...
[ "public", "MetricName", "tagged", "(", "String", "...", "pairs", ")", "{", "if", "(", "pairs", "==", "null", ")", "{", "return", "this", ";", "}", "if", "(", "pairs", ".", "length", "%", "2", "!=", "0", ")", "{", "throw", "new", "IllegalArgumentExcep...
Same as {@link #tagged(Map)}, but takes a variadic list of arguments. @see #tagged(Map) @param pairs An even list of strings acting as key-value pairs. @return A newly created metric name with the specified tags associated with it.
[ "Same", "as", "{", "@link", "#tagged", "(", "Map", ")", "}", "but", "takes", "a", "variadic", "list", "of", "arguments", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/MetricName.java#L119-L135
train
Get a tagged name with the specified tag pairs.
[ 30522, 2270, 12046, 18442, 26610, 1006, 5164, 1012, 1012, 1012, 7689, 1007, 1063, 2065, 1006, 7689, 1027, 1027, 19701, 1007, 1063, 2709, 2023, 1025, 1065, 2065, 1006, 7689, 1012, 3091, 1003, 1016, 999, 1027, 1014, 1007, 1063, 5466, 2047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java
GroupedMap.containsValue
public boolean containsValue(String group, String value) { group = StrUtil.nullToEmpty(group).trim(); readLock.lock(); try { final LinkedHashMap<String, String> valueMap = this.get(group); if (MapUtil.isNotEmpty(valueMap)) { return valueMap.containsValue(value); } } finally { readLock.u...
java
public boolean containsValue(String group, String value) { group = StrUtil.nullToEmpty(group).trim(); readLock.lock(); try { final LinkedHashMap<String, String> valueMap = this.get(group); if (MapUtil.isNotEmpty(valueMap)) { return valueMap.containsValue(value); } } finally { readLock.u...
[ "public", "boolean", "containsValue", "(", "String", "group", ",", "String", "value", ")", "{", "group", "=", "StrUtil", ".", "nullToEmpty", "(", "group", ")", ".", "trim", "(", ")", ";", "readLock", ".", "lock", "(", ")", ";", "try", "{", "final", "...
指定分组中是否包含指定值 @param group 分组 @param value 值 @return 是否包含值
[ "指定分组中是否包含指定值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java#L198-L210
train
Checks if the specified group contains the specified value.
[ 30522, 2270, 22017, 20898, 3397, 10175, 5657, 1006, 5164, 2177, 1010, 5164, 3643, 1007, 1063, 2177, 1027, 2358, 22134, 4014, 1012, 19701, 3406, 6633, 13876, 2100, 1006, 2177, 1007, 1012, 12241, 1006, 1007, 1025, 3191, 7878, 1012, 5843, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.isNumber
public static boolean isNumber(String str) { if (StrUtil.isBlank(str)) { return false; } char[] chars = str.toCharArray(); int sz = chars.length; boolean hasExp = false; boolean hasDecPoint = false; boolean allowSigns = false; boolean foundDigit = false; // deal with any possible sign up ...
java
public static boolean isNumber(String str) { if (StrUtil.isBlank(str)) { return false; } char[] chars = str.toCharArray(); int sz = chars.length; boolean hasExp = false; boolean hasDecPoint = false; boolean allowSigns = false; boolean foundDigit = false; // deal with any possible sign up ...
[ "public", "static", "boolean", "isNumber", "(", "String", "str", ")", "{", "if", "(", "StrUtil", ".", "isBlank", "(", "str", ")", ")", "{", "return", "false", ";", "}", "char", "[", "]", "chars", "=", "str", ".", "toCharArray", "(", ")", ";", "int"...
是否为数字 @param str 字符串值 @return 是否为数字
[ "是否为数字" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1051-L1146
train
Checks if the given string is a number.
[ 30522, 2270, 10763, 22017, 20898, 3475, 29440, 1006, 5164, 2358, 2099, 1007, 1063, 2065, 1006, 2358, 22134, 4014, 1012, 2003, 28522, 8950, 1006, 2358, 2099, 1007, 1007, 1063, 2709, 6270, 1025, 1065, 25869, 1031, 1033, 25869, 2015, 1027, 235...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-socket/src/main/java/cn/hutool/socket/aio/AioServer.java
AioServer.setOption
public <T> AioServer setOption(SocketOption<T> name, T value) throws IOException { this.channel.setOption(name, value); return this; }
java
public <T> AioServer setOption(SocketOption<T> name, T value) throws IOException { this.channel.setOption(name, value); return this; }
[ "public", "<", "T", ">", "AioServer", "setOption", "(", "SocketOption", "<", "T", ">", "name", ",", "T", "value", ")", "throws", "IOException", "{", "this", ".", "channel", ".", "setOption", "(", "name", ",", "value", ")", ";", "return", "this", ";", ...
设置 Socket 的 Option 选项<br> 选项见:{@link java.net.StandardSocketOptions} @param <T> 选项泛型 @param name {@link SocketOption} 枚举 @param value SocketOption参数 @throws IOException IO异常
[ "设置", "Socket", "的", "Option", "选项<br", ">", "选项见:", "{", "@link", "java", ".", "net", ".", "StandardSocketOptions", "}" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-socket/src/main/java/cn/hutool/socket/aio/AioServer.java#L95-L98
train
Sets a socket option.
[ 30522, 2270, 1026, 1056, 1028, 9932, 9232, 2099, 6299, 2275, 7361, 3508, 1006, 22278, 7361, 3508, 1026, 1056, 1028, 2171, 1010, 1056, 3643, 1007, 11618, 22834, 10288, 24422, 1063, 2023, 1012, 3149, 1012, 2275, 7361, 3508, 1006, 2171, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java
BeetlUtil.renderFromStr
public static Writer renderFromStr(String templateContent, Map<String, Object> bindingMap, Writer writer) { return render(getStrTemplate(templateContent), bindingMap, writer); }
java
public static Writer renderFromStr(String templateContent, Map<String, Object> bindingMap, Writer writer) { return render(getStrTemplate(templateContent), bindingMap, writer); }
[ "public", "static", "Writer", "renderFromStr", "(", "String", "templateContent", ",", "Map", "<", "String", ",", "Object", ">", "bindingMap", ",", "Writer", "writer", ")", "{", "return", "render", "(", "getStrTemplate", "(", "templateContent", ")", ",", "bindi...
渲染模板 @param templateContent 模板内容 @param bindingMap 绑定参数 @param writer {@link Writer} 渲染后写入的目标Writer @return {@link Writer}
[ "渲染模板" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java#L237-L239
train
Renders a string template into a Writer.
[ 30522, 2270, 10763, 3213, 17552, 19699, 22225, 16344, 1006, 5164, 23561, 8663, 6528, 2102, 1010, 4949, 1026, 5164, 1010, 4874, 1028, 8031, 2863, 2361, 1010, 3213, 3213, 1007, 1063, 2709, 17552, 1006, 4152, 16344, 18532, 15725, 1006, 23561, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
Task.releaseNetworkResources
private void releaseNetworkResources() { LOG.debug("Release task {} network resources (state: {}).", taskNameWithSubtask, getExecutionState()); for (ResultPartition partition : producedPartitions) { taskEventDispatcher.unregisterPartition(partition.getPartitionId()); if (isCanceledOrFailed()) { partition...
java
private void releaseNetworkResources() { LOG.debug("Release task {} network resources (state: {}).", taskNameWithSubtask, getExecutionState()); for (ResultPartition partition : producedPartitions) { taskEventDispatcher.unregisterPartition(partition.getPartitionId()); if (isCanceledOrFailed()) { partition...
[ "private", "void", "releaseNetworkResources", "(", ")", "{", "LOG", ".", "debug", "(", "\"Release task {} network resources (state: {}).\"", ",", "taskNameWithSubtask", ",", "getExecutionState", "(", ")", ")", ";", "for", "(", "ResultPartition", "partition", ":", "pro...
Releases network resources before task exits. We should also fail the partition to release if the task has failed, is canceled, or is being canceled at the moment.
[ "Releases", "network", "resources", "before", "task", "exits", ".", "We", "should", "also", "fail", "the", "partition", "to", "release", "if", "the", "task", "has", "failed", "is", "canceled", "or", "is", "being", "canceled", "at", "the", "moment", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L881-L892
train
Release the network resources associated with this task.
[ 30522, 2797, 11675, 2713, 7159, 6198, 6072, 8162, 9623, 1006, 1007, 1063, 8833, 1012, 2139, 8569, 2290, 1006, 1000, 2713, 4708, 1063, 1065, 2897, 4219, 1006, 2110, 1024, 1063, 1065, 1007, 1012, 1000, 1010, 4708, 18442, 24415, 6342, 19279, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java
PythonStreamExecutionEnvironment.from_collection
public PythonDataStream from_collection(Iterator<Object> iter) throws Exception { return new PythonDataStream<>(env.addSource(new PythonIteratorFunction(iter), TypeExtractor.getForClass(Object.class)) .map(new AdapterMap<>())); }
java
public PythonDataStream from_collection(Iterator<Object> iter) throws Exception { return new PythonDataStream<>(env.addSource(new PythonIteratorFunction(iter), TypeExtractor.getForClass(Object.class)) .map(new AdapterMap<>())); }
[ "public", "PythonDataStream", "from_collection", "(", "Iterator", "<", "Object", ">", "iter", ")", "throws", "Exception", "{", "return", "new", "PythonDataStream", "<>", "(", "env", ".", "addSource", "(", "new", "PythonIteratorFunction", "(", "iter", ")", ",", ...
Creates a python data stream from the given iterator. <p>Note that this operation will result in a non-parallel data stream source, i.e., a data stream source with a parallelism of one.</p> @param iter The iterator of elements to create the data stream from @return The data stream representing the elements in the ite...
[ "Creates", "a", "python", "data", "stream", "from", "the", "given", "iterator", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java#L164-L167
train
Creates a PythonDataStream from an iterator.
[ 30522, 2270, 18750, 2850, 10230, 25379, 2013, 1035, 3074, 1006, 2009, 6906, 4263, 1026, 4874, 1028, 2009, 2121, 1007, 11618, 6453, 1063, 2709, 2047, 18750, 2850, 10230, 25379, 1026, 1028, 1006, 4372, 2615, 1012, 9909, 8162, 3401, 1006, 2047...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
common/network-common/src/main/java/org/apache/spark/network/crypto/TransportCipher.java
TransportCipher.addToChannel
public void addToChannel(Channel ch) throws IOException { ch.pipeline() .addFirst(ENCRYPTION_HANDLER_NAME, new EncryptionHandler(this)) .addFirst(DECRYPTION_HANDLER_NAME, new DecryptionHandler(this)); }
java
public void addToChannel(Channel ch) throws IOException { ch.pipeline() .addFirst(ENCRYPTION_HANDLER_NAME, new EncryptionHandler(this)) .addFirst(DECRYPTION_HANDLER_NAME, new DecryptionHandler(this)); }
[ "public", "void", "addToChannel", "(", "Channel", "ch", ")", "throws", "IOException", "{", "ch", ".", "pipeline", "(", ")", ".", "addFirst", "(", "ENCRYPTION_HANDLER_NAME", ",", "new", "EncryptionHandler", "(", "this", ")", ")", ".", "addFirst", "(", "DECRYP...
Add handlers to channel. @param ch the channel for adding handlers @throws IOException
[ "Add", "handlers", "to", "channel", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/crypto/TransportCipher.java#L103-L107
train
Add this encryption handler to the channel.
[ 30522, 2270, 11675, 5587, 3406, 26058, 1006, 3149, 10381, 1007, 11618, 22834, 10288, 24422, 1063, 10381, 1012, 13117, 1006, 1007, 1012, 5587, 8873, 12096, 1006, 21999, 1035, 28213, 1035, 2171, 1010, 2047, 21999, 11774, 3917, 1006, 2023, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java
Configuration.writeXml
public void writeXml(String propertyName, Writer out) throws IOException, IllegalArgumentException { Document doc = asXmlDocument(propertyName); try { DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(out); TransformerFactory transFactory = TransformerFactory.newInstance(); ...
java
public void writeXml(String propertyName, Writer out) throws IOException, IllegalArgumentException { Document doc = asXmlDocument(propertyName); try { DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(out); TransformerFactory transFactory = TransformerFactory.newInstance(); ...
[ "public", "void", "writeXml", "(", "String", "propertyName", ",", "Writer", "out", ")", "throws", "IOException", ",", "IllegalArgumentException", "{", "Document", "doc", "=", "asXmlDocument", "(", "propertyName", ")", ";", "try", "{", "DOMSource", "source", "=",...
Write out the non-default properties in this configuration to the given {@link Writer}. <li> When property name is not empty and the property exists in the configuration, this method writes the property and its attributes to the {@link Writer}. </li> <p> <li> When property name is null or empty, this method writes al...
[ "Write", "out", "the", "non", "-", "default", "properties", "in", "this", "configuration", "to", "the", "given", "{", "@link", "Writer", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L3124-L3141
train
Write XML to a writer.
[ 30522, 2270, 11675, 4339, 2595, 19968, 1006, 5164, 3200, 18442, 1010, 3213, 2041, 1007, 11618, 22834, 10288, 24422, 1010, 6206, 2906, 22850, 15781, 2595, 24422, 1063, 6254, 9986, 1027, 2004, 2595, 19968, 3527, 24894, 4765, 1006, 3200, 18442, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
RecordWriter.getBufferBuilder
private BufferBuilder getBufferBuilder(int targetChannel) throws IOException, InterruptedException { if (bufferBuilders[targetChannel].isPresent()) { return bufferBuilders[targetChannel].get(); } else { return requestNewBufferBuilder(targetChannel); } }
java
private BufferBuilder getBufferBuilder(int targetChannel) throws IOException, InterruptedException { if (bufferBuilders[targetChannel].isPresent()) { return bufferBuilders[targetChannel].get(); } else { return requestNewBufferBuilder(targetChannel); } }
[ "private", "BufferBuilder", "getBufferBuilder", "(", "int", "targetChannel", ")", "throws", "IOException", ",", "InterruptedException", "{", "if", "(", "bufferBuilders", "[", "targetChannel", "]", ".", "isPresent", "(", ")", ")", "{", "return", "bufferBuilders", "...
The {@link BufferBuilder} may already exist if not filled up last time, otherwise we need request a new one for this target channel.
[ "The", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java#L245-L251
train
Get the buffer builder for the given channel.
[ 30522, 2797, 17698, 8569, 23891, 2099, 2131, 8569, 12494, 8569, 23891, 2099, 1006, 20014, 4539, 26058, 1007, 11618, 22834, 10288, 24422, 1010, 7153, 10288, 24422, 1063, 2065, 1006, 17698, 8569, 23891, 2869, 1031, 4539, 26058, 1033, 1012, 2003...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.readLines
public static <T extends Collection<String>> T readLines(File file, String charset, T collection) throws IORuntimeException { return FileReader.create(file, CharsetUtil.charset(charset)).readLines(collection); }
java
public static <T extends Collection<String>> T readLines(File file, String charset, T collection) throws IORuntimeException { return FileReader.create(file, CharsetUtil.charset(charset)).readLines(collection); }
[ "public", "static", "<", "T", "extends", "Collection", "<", "String", ">", ">", "T", "readLines", "(", "File", "file", ",", "String", "charset", ",", "T", "collection", ")", "throws", "IORuntimeException", "{", "return", "FileReader", ".", "create", "(", "...
从文件中读取每一行数据 @param <T> 集合类型 @param file 文件路径 @param charset 字符集 @param collection 集合 @return 文件中的每行内容的集合 @throws IORuntimeException IO异常
[ "从文件中读取每一行数据" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2220-L2222
train
Reads the contents of the file into the collection.
[ 30522, 2270, 10763, 1026, 1056, 8908, 3074, 1026, 5164, 1028, 1028, 1056, 3191, 12735, 1006, 5371, 5371, 1010, 5164, 25869, 13462, 1010, 1056, 3074, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 2709, 5371, 16416, 4063, 1012, 3443, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
StateDescriptor.initializeSerializerUnlessSet
public void initializeSerializerUnlessSet(ExecutionConfig executionConfig) { if (serializer == null) { checkState(typeInfo != null, "no serializer and no type info"); // instantiate the serializer serializer = typeInfo.createSerializer(executionConfig); // we can drop the type info now, no longer needed...
java
public void initializeSerializerUnlessSet(ExecutionConfig executionConfig) { if (serializer == null) { checkState(typeInfo != null, "no serializer and no type info"); // instantiate the serializer serializer = typeInfo.createSerializer(executionConfig); // we can drop the type info now, no longer needed...
[ "public", "void", "initializeSerializerUnlessSet", "(", "ExecutionConfig", "executionConfig", ")", "{", "if", "(", "serializer", "==", "null", ")", "{", "checkState", "(", "typeInfo", "!=", "null", ",", "\"no serializer and no type info\"", ")", ";", "// instantiate t...
Initializes the serializer, unless it has been initialized before. @param executionConfig The execution config to use when creating the serializer.
[ "Initializes", "the", "serializer", "unless", "it", "has", "been", "initialized", "before", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java#L283-L293
train
Initialize the serializer if it is not set.
[ 30522, 2270, 11675, 3988, 10057, 11610, 28863, 4609, 3238, 13462, 1006, 7781, 8663, 8873, 2290, 7781, 8663, 8873, 2290, 1007, 1063, 2065, 1006, 7642, 17629, 1027, 1027, 19701, 1007, 1063, 14148, 12259, 1006, 2828, 2378, 14876, 999, 1027, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
http-url/src/main/java/com/networknt/url/URLNormalizer.java
URLNormalizer.removeWWW
public URLNormalizer removeWWW() { String host = toURL().getHost(); String newHost = StringUtils.removeStartIgnoreCase(host, "www."); url = StringUtils.replaceOnce(url, host, newHost); return this; }
java
public URLNormalizer removeWWW() { String host = toURL().getHost(); String newHost = StringUtils.removeStartIgnoreCase(host, "www."); url = StringUtils.replaceOnce(url, host, newHost); return this; }
[ "public", "URLNormalizer", "removeWWW", "(", ")", "{", "String", "host", "=", "toURL", "(", ")", ".", "getHost", "(", ")", ";", "String", "newHost", "=", "StringUtils", ".", "removeStartIgnoreCase", "(", "host", ",", "\"www.\"", ")", ";", "url", "=", "St...
<p>Removes "www." domain name prefix.</p> <code>http://www.example.com/ &rarr; http://example.com/</code> @return this instance
[ "<p", ">", "Removes", "www", ".", "domain", "name", "prefix", ".", "<", "/", "p", ">", "<code", ">", "http", ":", "//", "www", ".", "example", ".", "com", "/", "&rarr", ";", "http", ":", "//", "example", ".", "com", "/", "<", "/", "code", ">" ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/URLNormalizer.java#L635-L640
train
Remove www. from the URL.
[ 30522, 2270, 24471, 19666, 2953, 9067, 17629, 6366, 2860, 2860, 2860, 30524, 21823, 4877, 1012, 20362, 7559, 3775, 26745, 2890, 18382, 1006, 3677, 1010, 1000, 7479, 1012, 1000, 1007, 1025, 24471, 2140, 1027, 5164, 21823, 4877, 1012, 5672, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/math/Combination.java
Combination.select
private void select(int dataIndex, String[] resultList, int resultIndex, List<String[]> result) { int resultLen = resultList.length; int resultCount = resultIndex + 1; if (resultCount > resultLen) { // 全部选择完时,输出组合结果 result.add(Arrays.copyOf(resultList, resultList.length)); return; } // 递归选择下一个 ...
java
private void select(int dataIndex, String[] resultList, int resultIndex, List<String[]> result) { int resultLen = resultList.length; int resultCount = resultIndex + 1; if (resultCount > resultLen) { // 全部选择完时,输出组合结果 result.add(Arrays.copyOf(resultList, resultList.length)); return; } // 递归选择下一个 ...
[ "private", "void", "select", "(", "int", "dataIndex", ",", "String", "[", "]", "resultList", ",", "int", "resultIndex", ",", "List", "<", "String", "[", "]", ">", "result", ")", "{", "int", "resultLen", "=", "resultList", ".", "length", ";", "int", "re...
组合选择 @param dataList 待选列表 @param dataIndex 待选开始索引 @param resultList 前面(resultIndex-1)个的组合结果 @param resultIndex 选择索引,从0开始
[ "组合选择" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Combination.java#L94-L107
train
Select a list of strings from the array.
[ 30522, 2797, 11675, 7276, 1006, 20014, 2951, 22254, 10288, 1010, 5164, 1031, 1033, 2765, 9863, 1010, 20014, 2765, 22254, 10288, 1010, 2862, 1026, 5164, 1031, 1033, 1028, 2765, 1007, 1063, 20014, 2765, 7770, 1027, 2765, 9863, 1012, 3091, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-db/src/main/java/cn/hutool/db/Page.java
Page.addOrder
public void addOrder(Order... orders) { if(null != this.orders){ ArrayUtil.append(this.orders, orders); } this.orders = orders; }
java
public void addOrder(Order... orders) { if(null != this.orders){ ArrayUtil.append(this.orders, orders); } this.orders = orders; }
[ "public", "void", "addOrder", "(", "Order", "...", "orders", ")", "{", "if", "(", "null", "!=", "this", ".", "orders", ")", "{", "ArrayUtil", ".", "append", "(", "this", ".", "orders", ",", "orders", ")", ";", "}", "this", ".", "orders", "=", "orde...
设置排序 @param orders 排序
[ "设置排序" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/Page.java#L123-L128
train
Adds the given orders to the end of the list.
[ 30522, 2270, 11675, 5587, 8551, 2121, 1006, 2344, 1012, 1012, 1012, 4449, 1007, 1063, 2065, 1006, 19701, 999, 1027, 2023, 1012, 4449, 1007, 1063, 9140, 21823, 2140, 1012, 10439, 10497, 1006, 2023, 1012, 4449, 1010, 4449, 1007, 1025, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java
CassandraSink.setParallelism
public CassandraSink<IN> setParallelism(int parallelism) { if (useDataStreamSink) { getSinkTransformation().setParallelism(parallelism); } else { getStreamTransformation().setParallelism(parallelism); } return this; }
java
public CassandraSink<IN> setParallelism(int parallelism) { if (useDataStreamSink) { getSinkTransformation().setParallelism(parallelism); } else { getStreamTransformation().setParallelism(parallelism); } return this; }
[ "public", "CassandraSink", "<", "IN", ">", "setParallelism", "(", "int", "parallelism", ")", "{", "if", "(", "useDataStreamSink", ")", "{", "getSinkTransformation", "(", ")", ".", "setParallelism", "(", "parallelism", ")", ";", "}", "else", "{", "getStreamTran...
Sets the parallelism for this sink. The degree must be higher than zero. @param parallelism The parallelism for this sink. @return The sink with set parallelism.
[ "Sets", "the", "parallelism", "for", "this", "sink", ".", "The", "degree", "must", "be", "higher", "than", "zero", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L143-L150
train
Sets the parallelism for this sink.
[ 30522, 2270, 15609, 11493, 2243, 1026, 1999, 1028, 2275, 28689, 6216, 28235, 1006, 20014, 5903, 2964, 1007, 1063, 2065, 1006, 2109, 6790, 21422, 11493, 2243, 1007, 1063, 4152, 19839, 6494, 3619, 14192, 3370, 1006, 1007, 1012, 2275, 28689, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java
DnsNameResolverBuilder.copy
public DnsNameResolverBuilder copy() { DnsNameResolverBuilder copiedBuilder = new DnsNameResolverBuilder(); if (eventLoop != null) { copiedBuilder.eventLoop(eventLoop); } if (channelFactory != null) { copiedBuilder.channelFactory(channelFactory); } ...
java
public DnsNameResolverBuilder copy() { DnsNameResolverBuilder copiedBuilder = new DnsNameResolverBuilder(); if (eventLoop != null) { copiedBuilder.eventLoop(eventLoop); } if (channelFactory != null) { copiedBuilder.channelFactory(channelFactory); } ...
[ "public", "DnsNameResolverBuilder", "copy", "(", ")", "{", "DnsNameResolverBuilder", "copiedBuilder", "=", "new", "DnsNameResolverBuilder", "(", ")", ";", "if", "(", "eventLoop", "!=", "null", ")", "{", "copiedBuilder", ".", "eventLoop", "(", "eventLoop", ")", "...
Creates a copy of this {@link DnsNameResolverBuilder} @return {@link DnsNameResolverBuilder}
[ "Creates", "a", "copy", "of", "this", "{", "@link", "DnsNameResolverBuilder", "}" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java#L456-L511
train
Copy the DnsNameResolverBuilder.
[ 30522, 2270, 1040, 3619, 18442, 6072, 4747, 6299, 8569, 23891, 2099, 6100, 1006, 1007, 1063, 1040, 3619, 18442, 6072, 4747, 6299, 8569, 23891, 2099, 15826, 8569, 23891, 2099, 1027, 2047, 1040, 3619, 18442, 6072, 4747, 6299, 8569, 23891, 209...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...