blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
854a265c82c9cb9bffa81bc72fc7377dbf751d41
|
fc599e54ff0a7f8ee0c4d9052d80f1f7648d0417
|
/elasticsearch-client-scripting/src/main/java/org/elasticsearch/script/ContentParseElement.java
|
518fa8c99311dcf48c88bbcb8f10262268d4450c
|
[
"Apache-2.0"
] |
permissive
|
jshiying/elasticsearch-client
|
f1b149d76504c2c0641afd4935b455cfdca84313
|
b60408a6854c3ae9bee5a0866a71d14096494991
|
refs/heads/master
| 2021-01-21T07:53:13.975489
| 2012-11-28T22:14:23
| 2012-11-28T22:14:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,655
|
java
|
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.script;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.script.ContentScript;
//import org.elasticsearch.search.fetch.script.ScriptFieldsContext;
import org.elasticsearch.common.xcontent.ContentContext;
/**
*
*/
public class ContentParseElement {
public void parse(XContentParser parser, ContentContext context) throws Exception {
XContentParser.Token token = parser.currentToken();
if (token == XContentParser.Token.START_ARRAY) {
boolean added = false;
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
String name = parser.text();
if (name.contains("_source.") || name.contains("doc[")) {
// script field to load from source
//SearchScript searchScript = context.scriptService().search(context.lookup(), "mvel", name, null);
//context.scriptFields().add(new ScriptFieldsContext.ScriptField(name, searchScript, true));
} else {
added = true;
//context.fieldNames().add(name);
}
}
if (!added) {
//context.emptyFieldNames();
}
} else if (token == XContentParser.Token.VALUE_STRING) {
String name = parser.text();
if (name.contains("_source.") || name.contains("doc[")) {
// script field to load from source
//SearchScript searchScript = context.scriptService().search(context.lookup(), "mvel", name, null);
//context.scriptFields().add(new ScriptFieldsContext.ScriptField(name, searchScript, true));
} else {
//context.fieldNames().add(name);
}
}
}
}
|
[
"joergprante@gmail.com"
] |
joergprante@gmail.com
|
62e838e4b5ffae01be98cbe253fbca49c8c8ff89
|
c3c0a3116e2a0dee2610a057063d9638a66f3b70
|
/src/main/java/com/guchaolong/algorithm/zuoshensuanfa/public_class/class03/Code01_LongestNoRepeatSubstring.java
|
f25177755c94cc8af0f4326763079599b9178f30
|
[] |
no_license
|
guchaolong/java-learn
|
8523ecad5bb1ed4b61e563e0507cafb12b3ea95d
|
ac3b744551a185c7fc1601aa5633c9192c2b8aca
|
refs/heads/master
| 2023-08-19T07:49:15.351765
| 2023-08-17T14:25:47
| 2023-08-17T14:25:47
| 159,709,168
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,856
|
java
|
package com.guchaolong.algorithm.zuoshensuanfa.public_class.class03;
public class Code01_LongestNoRepeatSubstring {
/*
* 给定一个只由小写字母(a~z)组成的字符串str, 返回其中最长无重复字符的子串长度
*
*/
public static int lnrs1(String s) {
if (s == null || s.length() == 0) {
return 0;
}
char[] str = s.toCharArray();
int N = str.length;
int max = 0;
for (int i = 0; i < N; i++) {
boolean[] set = new boolean[26];
for (int j = i; j < N; j++) {
if (set[str[j] - 'a']) {
break;
}
set[str[j] - 'a'] = true;
max = Math.max(max, j - i + 1);
}
}
return max;
}
public static int lnrs2(String s) {
if (s == null || s.length() == 0) {
return 0;
}
char[] str = s.toCharArray();
int N = str.length;
int[] last = new int[26];
for (int i = 0; i < 26; i++) {
last[i] = -1;
}
last[str[0] - 'a'] = 0;
int max = 1;
int preMaxLen = 1;
for (int i = 1; i < N; i++) {
preMaxLen = Math.min(i - last[str[i] - 'a'], preMaxLen + 1);
max = Math.max(max, preMaxLen);
last[str[i] - 'a'] = i;
}
return max;
}
// for test
public static String getRandomString(int possibilities, int maxSize) {
char[] ans = new char[(int) (Math.random() * maxSize) + 1];
for (int i = 0; i < ans.length; i++) {
ans[i] = (char) ((int) (Math.random() * possibilities) + 'a');
}
return String.valueOf(ans);
}
public static void main(String[] args) {
int possibilities = 26;
int strMaxSize = 100;
int testTimes = 1000000;
System.out.println("test begin, test time : " + testTimes);
for (int i = 0; i < testTimes; i++) {
String str = getRandomString(possibilities, strMaxSize);
int ans1 = lnrs1(str);
int ans2 = lnrs2(str);
if (ans1 != ans2) {
System.out.println("Oops!");
}
}
System.out.println("test finish");
}
}
|
[
"guclno1@qq.com"
] |
guclno1@qq.com
|
31e6b3274f9fd491af6b02f7ed4970501869bfc8
|
9b45ff5d545aa9eda394ed4255b0962d55931827
|
/Selenium/src/Package/JavaTutorial/AbstractClasExampleOne.java
|
b1a763da6cc88797d7aa33b9d444434de34ecd5d
|
[] |
no_license
|
anand16/Download_Classes_V1
|
b5987d4a8aaa51901db2323473d167913bf1eb3f
|
706c611731edc3db8cf736d5ad321af56cab1637
|
refs/heads/master
| 2020-12-25T14:38:58.468057
| 2016-07-30T13:12:53
| 2016-07-30T13:12:53
| 64,544,854
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 402
|
java
|
package Package.JavaTutorial;
abstract class exampleone
{
abstract void getName();
}
class AbstractImpl extends exampleone
{
void getName()
{
System.out.println("Name of the class is AbstractClass session");
}
}
public class AbstractClasExampleOne {
public static void main(String[] args) {
// TODO Auto-generated method stub
AbstractImpl ail=new AbstractImpl();
ail.getName();
}
}
|
[
"you@example.com"
] |
you@example.com
|
292d1fad04a253234a2acbb1f275e4179ad87806
|
144044f9282c50253a75bd8d5c23f619ad38fdf8
|
/biao-boss/src/main/java/com/thinkgem/jeesite/modules/market/service/MkRelayAutoRecordService.java
|
9b4fb0c8997f98730e89164bcfc51044061b2e60
|
[] |
no_license
|
clickear/biao
|
ba645de06b4e92b0539b05404c061194669f4570
|
af71fd055c4ff3aa0b767a0a8b4eb74328e00f6f
|
refs/heads/master
| 2020-05-16T15:47:33.675136
| 2019-09-25T08:20:28
| 2019-09-25T08:20:28
| 183,143,104
| 0
| 0
| null | 2019-04-24T03:46:28
| 2019-04-24T03:46:28
| null |
UTF-8
|
Java
| false
| false
| 1,409
|
java
|
/**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.market.service;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.market.entity.MkRelayAutoRecord;
import com.thinkgem.jeesite.modules.market.dao.MkRelayAutoRecordDao;
/**
* 接力自动撞奖配置Service
* @author zzj
* @version 2018-09-26
*/
@Service
@Transactional(readOnly = true)
public class MkRelayAutoRecordService extends CrudService<MkRelayAutoRecordDao, MkRelayAutoRecord> {
public MkRelayAutoRecord get(String id) {
return super.get(id);
}
public List<MkRelayAutoRecord> findList(MkRelayAutoRecord mkRelayAutoRecord) {
return super.findList(mkRelayAutoRecord);
}
public Page<MkRelayAutoRecord> findPage(Page<MkRelayAutoRecord> page, MkRelayAutoRecord mkRelayAutoRecord) {
return super.findPage(page, mkRelayAutoRecord);
}
@Transactional(readOnly = false)
public void save(MkRelayAutoRecord mkRelayAutoRecord) {
super.save(mkRelayAutoRecord);
}
@Transactional(readOnly = false)
public void delete(MkRelayAutoRecord mkRelayAutoRecord) {
super.delete(mkRelayAutoRecord);
}
}
|
[
"1072163919@qq.com"
] |
1072163919@qq.com
|
994dc84837fc1fd394a4e41587f7bce9009cadb2
|
f3aec68bc48dc52e76f276fd3b47c3260c01b2a4
|
/core/drugstore-tier/src/main/java/org/hl7/v3/RoleClassTerritoryOfAuthority.java
|
c5460a304d780e05b25ac6061161a1ab3d7cdd3e
|
[] |
no_license
|
MarsStirner/core
|
c9a383799a92e485e2395d81a0bc95d51ada5fa5
|
6fbf37af989aa48fabb9c4c2566195aafd2b16ab
|
refs/heads/master
| 2020-12-03T00:39:51.407573
| 2016-04-29T12:28:32
| 2016-04-29T12:28:32
| 96,041,573
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 761
|
java
|
package org.hl7.v3;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for RoleClassTerritoryOfAuthority.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="RoleClassTerritoryOfAuthority">
* <restriction base="{urn:hl7-org:v3}cs">
* <enumeration value="TERR"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "RoleClassTerritoryOfAuthority")
@XmlEnum
public enum RoleClassTerritoryOfAuthority {
TERR;
public String value() {
return name();
}
public static RoleClassTerritoryOfAuthority fromValue(String v) {
return valueOf(v);
}
}
|
[
"NosovDE@gmail.com"
] |
NosovDE@gmail.com
|
29252ec58509fb2681ee59838df02f841c7cca18
|
70edcbd9d6c1bb2e565f5d71d7dcdc71cab740f9
|
/liferay-workspace/apps/service-builder/jndi/jndi-api/src/main/java/com/liferay/blade/samples/jndiservicebuilder/model/RegionSoap.java
|
d57b62f6b4f5ccffbe3ec23b582f0c66cd386e69
|
[
"Apache-2.0"
] |
permissive
|
inacionery/liferay-blade-samples
|
c163f0889f1ea0ac5ab8fdfb0eaf0cd61d1fb35c
|
1e6ab401d3ad140ade140b1dfa3f20f0488ff466
|
refs/heads/7.1
| 2022-02-05T17:39:22.438990
| 2019-04-22T15:38:29
| 2019-04-22T15:38:29
| 191,175,732
| 0
| 0
|
Apache-2.0
| 2019-06-10T20:39:43
| 2019-06-10T13:42:23
|
Java
|
UTF-8
|
Java
| false
| false
| 2,515
|
java
|
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.blade.samples.jndiservicebuilder.model;
import aQute.bnd.annotation.ProviderType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* This class is used by SOAP remote services.
*
* @author Brian Wing Shun Chan
* @generated
*/
@ProviderType
public class RegionSoap implements Serializable {
public static RegionSoap toSoapModel(Region model) {
RegionSoap soapModel = new RegionSoap();
soapModel.setRegionId(model.getRegionId());
soapModel.setRegionName(model.getRegionName());
return soapModel;
}
public static RegionSoap[] toSoapModels(Region[] models) {
RegionSoap[] soapModels = new RegionSoap[models.length];
for (int i = 0; i < models.length; i++) {
soapModels[i] = toSoapModel(models[i]);
}
return soapModels;
}
public static RegionSoap[][] toSoapModels(Region[][] models) {
RegionSoap[][] soapModels = null;
if (models.length > 0) {
soapModels = new RegionSoap[models.length][models[0].length];
}
else {
soapModels = new RegionSoap[0][0];
}
for (int i = 0; i < models.length; i++) {
soapModels[i] = toSoapModels(models[i]);
}
return soapModels;
}
public static RegionSoap[] toSoapModels(List<Region> models) {
List<RegionSoap> soapModels = new ArrayList<RegionSoap>(models.size());
for (Region model : models) {
soapModels.add(toSoapModel(model));
}
return soapModels.toArray(new RegionSoap[soapModels.size()]);
}
public RegionSoap() {
}
public long getPrimaryKey() {
return _regionId;
}
public void setPrimaryKey(long pk) {
setRegionId(pk);
}
public long getRegionId() {
return _regionId;
}
public void setRegionId(long regionId) {
_regionId = regionId;
}
public String getRegionName() {
return _regionName;
}
public void setRegionName(String regionName) {
_regionName = regionName;
}
private long _regionId;
private String _regionName;
}
|
[
"gregory.amerson@liferay.com"
] |
gregory.amerson@liferay.com
|
3143f067dad9d41d065b3ae44deacc32d0ef8ab6
|
7d0945868b491ec90a2018c05ed7f934d797b581
|
/auth/aaron-auth-zuul/src/main/java/com/aaron/zuul_demo/config/FilterConfig.java
|
135f8359f4c4c57b5c4559b27ef2a5d9ab1757e8
|
[] |
no_license
|
agilego99/spring-cloud-aaron
|
761dc937f5e6504d41b9b5e1e530b0954e6a375a
|
ba42d96bd40fedaf9bfca80a3777741b4cea0463
|
refs/heads/master
| 2022-12-20T11:22:58.250243
| 2021-02-01T06:05:14
| 2021-02-01T06:05:14
| 214,135,914
| 1
| 0
| null | 2022-12-10T03:56:24
| 2019-10-10T09:02:54
|
Java
|
UTF-8
|
Java
| false
| false
| 339
|
java
|
package com.aaron.zuul_demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.aaron.zuul_demo.filter.AuthHeaderFilter;
@Configuration
public class FilterConfig {
@Bean
public AuthHeaderFilter authHeaderFilter() {
return new AuthHeaderFilter();
}
}
|
[
"agilego99@gmail.com"
] |
agilego99@gmail.com
|
5ec65e0716255df087dd226bdefd71964f7c9a50
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/apache/hadoop/hdfs/TestFileConcurrentReader.java
|
e56738a10910b3ea5c9511b54b9be3936d6f64e9
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 7,847
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hdfs;
import DFSConfigKeys.DFS_BLOCK_SIZE_KEY;
import LeaseManager.LOG;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.StringUtils;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* This class tests the cases of a concurrent reads/writes to a file;
* ie, one writer and one or more readers can see unfinsihed blocks
*/
public class TestFileConcurrentReader {
private enum SyncType {
SYNC,
APPEND;}
private static final Logger LOG = Logger.getLogger(TestFileConcurrentReader.class);
{
GenericTestUtils.setLogLevel(LeaseManager.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(FSNamesystem.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
static final long seed = 3735928559L;
static final int blockSize = 8192;
private static final int DEFAULT_WRITE_SIZE = 1024 + 1;
private static final int SMALL_WRITE_SIZE = 61;
private Configuration conf;
private MiniDFSCluster cluster;
private FileSystem fileSystem;
/**
* Test that that writes to an incomplete block are available to a reader
*/
@Test(timeout = 30000)
public void testUnfinishedBlockRead() throws IOException {
// create a new file in the root, write data, do no close
Path file1 = new Path("/unfinished-block");
FSDataOutputStream stm = TestFileCreation.createFile(fileSystem, file1, 1);
// write partial block and sync
int partialBlockSize = (TestFileConcurrentReader.blockSize) / 2;
writeFileAndSync(stm, partialBlockSize);
// Make sure a client can read it before it is closed
checkCanRead(fileSystem, file1, partialBlockSize);
stm.close();
}
/**
* test case: if the BlockSender decides there is only one packet to send,
* the previous computation of the pktSize based on transferToAllowed
* would result in too small a buffer to do the buffer-copy needed
* for partial chunks.
*/
@Test(timeout = 30000)
public void testUnfinishedBlockPacketBufferOverrun() throws IOException {
// check that / exists
Path path = new Path("/");
System.out.println((("Path : \"" + (path.toString())) + "\""));
// create a new file in the root, write data, do no close
Path file1 = new Path("/unfinished-block");
final FSDataOutputStream stm = TestFileCreation.createFile(fileSystem, file1, 1);
// write partial block and sync
final int bytesPerChecksum = conf.getInt("io.bytes.per.checksum", 512);
final int partialBlockSize = bytesPerChecksum - 1;
writeFileAndSync(stm, partialBlockSize);
// Make sure a client can read it before it is closed
checkCanRead(fileSystem, file1, partialBlockSize);
stm.close();
}
// use a small block size and a large write so that DN is busy creating
// new blocks. This makes it almost 100% sure we can reproduce
// case of client getting a DN that hasn't yet created the blocks
@Test(timeout = 30000)
public void testImmediateReadOfNewFile() throws IOException {
final int blockSize = 64 * 1024;
final int writeSize = 10 * blockSize;
Configuration conf = new Configuration();
conf.setLong(DFS_BLOCK_SIZE_KEY, blockSize);
init(conf);
final int requiredSuccessfulOpens = 100;
final Path file = new Path("/file1");
final AtomicBoolean openerDone = new AtomicBoolean(false);
final AtomicReference<String> errorMessage = new AtomicReference<String>();
final FSDataOutputStream out = fileSystem.create(file);
final Thread writer = new Thread(new Runnable() {
@Override
public void run() {
try {
while (!(openerDone.get())) {
out.write(DFSTestUtil.generateSequentialBytes(0, writeSize));
out.hflush();
}
} catch (IOException e) {
TestFileConcurrentReader.LOG.warn("error in writer", e);
} finally {
try {
out.close();
} catch (IOException e) {
TestFileConcurrentReader.LOG.error("unable to close file");
}
}
}
});
Thread opener = new Thread(new Runnable() {
@Override
public void run() {
try {
for (int i = 0; i < requiredSuccessfulOpens; i++) {
fileSystem.open(file).close();
}
openerDone.set(true);
} catch (IOException e) {
openerDone.set(true);
errorMessage.set(String.format("got exception : %s", StringUtils.stringifyException(e)));
} catch (Exception e) {
openerDone.set(true);
errorMessage.set(String.format("got exception : %s", StringUtils.stringifyException(e)));
writer.interrupt();
Assert.fail("here");
}
}
});
writer.start();
opener.start();
try {
writer.join();
opener.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
Assert.assertNull(errorMessage.get(), errorMessage.get());
}
// for some reason, using tranferTo evokes the race condition more often
// so test separately
@Test(timeout = 30000)
public void testUnfinishedBlockCRCErrorTransferTo() throws IOException {
runTestUnfinishedBlockCRCError(true, TestFileConcurrentReader.SyncType.SYNC, TestFileConcurrentReader.DEFAULT_WRITE_SIZE);
}
@Test(timeout = 30000)
public void testUnfinishedBlockCRCErrorTransferToVerySmallWrite() throws IOException {
runTestUnfinishedBlockCRCError(true, TestFileConcurrentReader.SyncType.SYNC, TestFileConcurrentReader.SMALL_WRITE_SIZE);
}
@Test(timeout = 30000)
public void testUnfinishedBlockCRCErrorNormalTransfer() throws IOException {
runTestUnfinishedBlockCRCError(false, TestFileConcurrentReader.SyncType.SYNC, TestFileConcurrentReader.DEFAULT_WRITE_SIZE);
}
@Test(timeout = 30000)
public void testUnfinishedBlockCRCErrorNormalTransferVerySmallWrite() throws IOException {
runTestUnfinishedBlockCRCError(false, TestFileConcurrentReader.SyncType.SYNC, TestFileConcurrentReader.SMALL_WRITE_SIZE);
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
fb1acb3dfe6a035886ce004bc20f713cdfaeca3c
|
7c4c2011d97d6f2ad81a2a74fc50e34b409b9779
|
/JavaAndroid/AutoBoxingandUnboxing/src/com/juhuyoon/Main.java
|
a79209f042207700e1c8974a4df64e2540866f70
|
[
"MIT"
] |
permissive
|
juhuyoon/codeLibrary
|
f001982baa94bc12bae8f40d2411ae97c1966337
|
4a964a2d326772659715f9fdd807a91f480642f8
|
refs/heads/master
| 2023-01-11T07:25:24.651877
| 2020-07-23T03:23:38
| 2020-07-23T03:23:38
| 121,058,856
| 14
| 18
| null | 2023-01-03T15:39:12
| 2018-02-10T22:12:00
|
Java
|
UTF-8
|
Java
| false
| false
| 1,319
|
java
|
package com.juhuyoon;
import java.lang.reflect.Array;
import java.util.ArrayList;
class IntClass {
private int myValue;
public IntClass(int myValue) {
this.myValue = myValue;
}
public int getMyValue() {
return myValue;
}
public void setMyValue(int myValue) {
this.myValue = myValue;
}
}
public class Main {
public static void main(String[] args) {
String[] strArray = new String[10];
int[] intArray = new int[10];
ArrayList<String> strArrayList = new ArrayList<String>();
strArrayList.add("Tim");
//ArrayList<int> intArrayList = new ArrayList<int>(); Runs into issues here as int is a primitive type.
ArrayList<IntClass> intClassArrayList = new ArrayList<IntClass>();
intClassArrayList.add(new IntClass(54));
Integer integer = new Integer(54);
Double doubleValue = new Double(12.25);
ArrayList<Integer> intArrayList = new ArrayList<Integer>();
for(int i = 0; i <= 10; i++) {
intArrayList.add(Integer.valueOf(i)); //taking the value of i as a primitive type
//and then converting it to Integer class.
}
for(int i = 0; i <= 10; i++) {
System.out.println(i + " ->" + intArray.get(i).intValue());
}
}
}
|
[
"juhuyoon@yahoo.com"
] |
juhuyoon@yahoo.com
|
53277d3c684d0c4d78e84f2fd81d0692521cccf5
|
192449dc52bf7874e5dea4d0e95cfee4a2ebdf47
|
/DatabaseMetaData/src/main/LocalFile.java
|
5c4c272ae506c7a3a4aaee1f58ea1962f5cc204c
|
[
"Apache-2.0"
] |
permissive
|
scp504677840/JDBC
|
f5ffa706598329447cef8bbe09ed13a489826ade
|
d9451b55fc7f9a7145720a951c57fdfc385fe6a5
|
refs/heads/master
| 2020-03-20T19:52:20.990620
| 2018-06-20T04:38:22
| 2018-06-20T04:38:22
| 137,658,230
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,273
|
java
|
package main;
import exception.DBUtilsException;
import utils.DBUtils;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
public class LocalFile {
public static void main(String[] args) {
Connection conn = null;
try {
conn = DBUtils.conn();
DatabaseMetaData metaData = conn.getMetaData();
//检索此数据库是否为每个表使用文件。
//usesLocalFiles
boolean usesLocalFiles = metaData.usesLocalFiles();
System.out.println("usesLocalFiles: " + usesLocalFiles);
//usesLocalFiles: false
//检索此数据库是否将表存储在本地文件中。
//usesLocalFilePerTable
boolean usesLocalFilePerTable = metaData.usesLocalFilePerTable();
System.out.println("usesLocalFilePerTable: " + usesLocalFilePerTable);
//usesLocalFilePerTable: false
} catch (DBUtilsException | SQLException e) {
e.printStackTrace();
} finally {
try {
DBUtils.close(null, null, conn);
} catch (DBUtilsException e) {
e.printStackTrace();
}
}
}
}
|
[
"15335747148@163.com"
] |
15335747148@163.com
|
006329080b1b8571ebf90699d1a5ef35c018990a
|
afb51692b6cd582b2d17c2fba564eedae334014b
|
/webanno-api/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/ProjectLifecycleAware.java
|
97152eda750dd7e8ac1328042b612661265706af
|
[
"Apache-2.0"
] |
permissive
|
somiyagawa/webanno
|
8b4e243023fe6a50220dfc077a5a646966ed6ff9
|
ef1766dd07db79710d0263ce96d24ae49e64d550
|
refs/heads/master
| 2020-06-26T07:19:26.518302
| 2017-07-12T10:31:10
| 2017-07-12T10:31:10
| 97,009,139
| 1
| 0
| null | 2017-07-12T13:06:17
| 2017-07-12T13:06:17
| null |
UTF-8
|
Java
| false
| false
| 1,194
|
java
|
/*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab and FG Language Technology
* Technische Universität Darmstadt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.clarin.webanno.api;
import java.util.zip.ZipFile;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
public interface ProjectLifecycleAware
{
void afterProjectCreate(Project aProject)
throws Exception;
void beforeProjectRemove(Project aProject)
throws Exception;
void onProjectImport(ZipFile zip,
de.tudarmstadt.ukp.clarin.webanno.export.model.Project aExportedProject,
Project aProject)
throws Exception;
}
|
[
"richard.eckart@gmail.com"
] |
richard.eckart@gmail.com
|
b8640c6b9a2eb0894135f691a7398e7180ad652b
|
84e5be2bbacfb7de0364a9badd7d0c9a69d381c1
|
/middle_chapter_01/src/main/java/ru/job4j/blockingqueue/SimpleBlockingQueue.java
|
05910bd8f3d0e93c4f2d6b849e091d61f2823bcf
|
[
"Apache-2.0"
] |
permissive
|
RomanMorozov88/job4j
|
48b0c068c4ff7c8a012f42c1d9cc1e21e7e470b0
|
915584a57a0a0cfd6315589ab5739747e3305cab
|
refs/heads/master
| 2022-12-27T00:06:12.972273
| 2020-05-25T09:04:36
| 2020-07-09T12:23:21
| 137,212,032
| 0
| 0
|
Apache-2.0
| 2022-12-16T15:33:52
| 2018-06-13T12:24:04
|
Java
|
UTF-8
|
Java
| false
| false
| 1,225
|
java
|
package ru.job4j.blockingqueue;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import java.util.LinkedList;
import java.util.Queue;
/**
* Блокирующая очередь.
* При пустой очереди или при количестве элементов в очереди
* более чем значение sizeLimit будет вызван метод wait()
* для вызывающего потока.
*
* @param <T>
*/
@ThreadSafe
public class SimpleBlockingQueue<T> {
@GuardedBy("this")
private Queue<T> queue = new LinkedList<>();
private final int sizeLimit;
public SimpleBlockingQueue(int sizeLimit) {
this.sizeLimit = sizeLimit;
}
public synchronized boolean isEmpty() {
return this.queue.isEmpty();
}
public synchronized void offer(T value) throws InterruptedException {
while (this.queue.size() >= this.sizeLimit) {
wait();
}
this.queue.offer(value);
notify();
}
public synchronized T poll() throws InterruptedException {
while (this.queue.size() < 1) {
wait();
}
notify();
return this.queue.poll();
}
}
|
[
"MorozovRoman.88@mail.ru"
] |
MorozovRoman.88@mail.ru
|
77138b79999f6f92f2c91f715ed222f2a2515b36
|
f52a5fc41c384393314af6a10af0e6daa545d37a
|
/AE-go_GameServer/src/com/aionemu/gameserver/network/aion/serverpackets/SM_CHARACTER_LIST.java
|
1c78dbce179875eefeddad013daca88ad83332d8
|
[] |
no_license
|
flagada08/Aion-emu_project_1.9
|
f8f8e0bdf5f9a5c78acf8511d6f2aee359d66634
|
cab40fdc84ca8742b5badde954958ef323cca355
|
refs/heads/master
| 2023-01-20T09:03:37.704021
| 2020-11-26T12:11:38
| 2020-11-26T12:11:38
| 316,220,578
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,872
|
java
|
/**
* This file is part of aion-emu <aion-emu.com>.
*
* aion-emu is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-emu is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-emu. If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.network.aion.serverpackets;
import java.nio.ByteBuffer;
import com.aionemu.gameserver.model.account.Account;
import com.aionemu.gameserver.model.account.PlayerAccountData;
import com.aionemu.gameserver.network.aion.AionConnection;
import com.aionemu.gameserver.network.aion.PlayerInfo;
/**
* In this packet Server is sending Character List to client.
*
* @author Nemesiss, AEJTester
*
*/
public class SM_CHARACTER_LIST extends PlayerInfo
{
/**
* PlayOk2 - we dont care...
*/
private final int playOk2;
/**
* Constructs new <tt>SM_CHARACTER_LIST </tt> packet
*/
public SM_CHARACTER_LIST(int playOk2)
{
this.playOk2 = playOk2;
}
/**
* {@inheritDoc}
*/
@Override
protected void writeImpl(AionConnection con, ByteBuffer buf)
{
writeD(buf, playOk2);
Account account = con.getAccount();
writeC(buf, account.size());// characters count
for(PlayerAccountData playerData : account)
{
writePlayerInfo(buf, playerData);
writeB(buf, new byte[14]);
}
}
/**
* @param buf
* @param playerData
* @param items
*/
}
|
[
"flagada08@gmail.com"
] |
flagada08@gmail.com
|
d6b15ea1b80542b06e6458306d2a0d53a5895611
|
81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13
|
/src/com/facebook/AccessTokenTracker$CurrentAccessTokenBroadcastReceiver.java
|
7cba0fd05ceec4030f2f69a2767bb4b977854a5f
|
[] |
no_license
|
reverseengineeringer/me.lyft.android
|
48bb85e8693ce4dab50185424d2ec51debf5c243
|
8c26caeeb54ffbde0711d3ce8b187480d84968ef
|
refs/heads/master
| 2021-01-19T02:32:03.752176
| 2016-07-19T16:30:00
| 2016-07-19T16:30:00
| 63,710,356
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 974
|
java
|
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
class AccessTokenTracker$CurrentAccessTokenBroadcastReceiver
extends BroadcastReceiver
{
private AccessTokenTracker$CurrentAccessTokenBroadcastReceiver(AccessTokenTracker paramAccessTokenTracker) {}
public void onReceive(Context paramContext, Intent paramIntent)
{
if ("com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED".equals(paramIntent.getAction()))
{
paramContext = (AccessToken)paramIntent.getParcelableExtra("com.facebook.sdk.EXTRA_OLD_ACCESS_TOKEN");
paramIntent = (AccessToken)paramIntent.getParcelableExtra("com.facebook.sdk.EXTRA_NEW_ACCESS_TOKEN");
this$0.onCurrentAccessTokenChanged(paramContext, paramIntent);
}
}
}
/* Location:
* Qualified Name: com.facebook.AccessTokenTracker.CurrentAccessTokenBroadcastReceiver
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
dfe155cac35dc20249eb7c1bf78e3955f828a65d
|
006576b09a56194796d7d7b21c633389ccbf246b
|
/testsuite/src/java/net/sf/ohla/rti/testsuite/hla/rti1516e/object/ObjectNameReservationTestNG.java
|
7452755df6c8a48a79f4616f3a869735f93f95e7
|
[
"Apache-2.0"
] |
permissive
|
zhj149/OpenHLA
|
ca20ab74ff70404189b5bb606d36718e233c0155
|
1fed36211e54d5dc09cc30b92a1714d5a124b82d
|
refs/heads/master
| 2020-11-25T19:12:34.090527
| 2019-12-20T02:08:17
| 2019-12-20T02:08:17
| 228,805,204
| 2
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,075
|
java
|
/*
* Copyright (c) 2005-2011, Michael Newcomb
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.ohla.rti.testsuite.hla.rti1516e.object;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import net.sf.ohla.rti.testsuite.hla.rti1516e.BaseFederateAmbassador;
import net.sf.ohla.rti.testsuite.hla.rti1516e.BaseTestNG;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import hla.rti1516e.RTIambassador;
import hla.rti1516e.exceptions.FederateInternalError;
import hla.rti1516e.exceptions.IllegalName;
import hla.rti1516e.exceptions.ObjectInstanceNameNotReserved;
@Test
public class ObjectNameReservationTestNG
extends BaseTestNG<ObjectNameReservationTestNG.TestFederateAmbassador>
{
private static final String FEDERATION_NAME = ObjectNameReservationTestNG.class.getSimpleName();
private static final String ILLEGAL_NAME_1 = "HLA illegal name 1";
private static final String ILLEGAL_NAME_2 = "HLA illegal name 2";
private static final String LEGAL_NAME_1 = "legal name 1";
private static final String LEGAL_NAME_2 = "legal name 2";
private static final String LEGAL_NAME_3 = "legal name 3";
private static final String LEGAL_NAME_4 = "legal name 4";
private static final String LEGAL_NAME_5 = "legal name 5";
private static final String LEGAL_NAME_6 = "legal name 6";
public ObjectNameReservationTestNG()
{
super(3, FEDERATION_NAME);
}
@BeforeClass
public void setup()
throws Exception
{
connect();
createFederationExecution();
joinFederationExecution();
synchronize(SYNCHRONIZATION_POINT_SETUP_COMPLETE, federateAmbassadors);
}
@AfterClass
public void teardown()
throws Exception
{
resignFederationExecution();
destroyFederationExecution();
disconnect();
}
@Test(expectedExceptions = IllegalName.class)
public void testReserveIllegalObjectInstanceName()
throws Exception
{
rtiAmbassadors.get(0).reserveObjectInstanceName(ILLEGAL_NAME_1);
}
@Test(expectedExceptions = IllegalName.class)
public void testReserveIllegalObjectInstanceNames()
throws Exception
{
Set<String> illegalNames = new HashSet<String>();
illegalNames.add(ILLEGAL_NAME_1);
illegalNames.add(ILLEGAL_NAME_2);
rtiAmbassadors.get(0).reserveMultipleObjectInstanceName(illegalNames);
}
@Test
public void testReserveObjectInstanceName()
throws Exception
{
rtiAmbassadors.get(0).reserveObjectInstanceName(LEGAL_NAME_1);
federateAmbassadors.get(0).checkObjectInstanceNameReserved(LEGAL_NAME_1);
}
@Test(dependsOnMethods = "testReserveObjectInstanceName")
public void testReserveObjectInstanceNameAgain()
throws Exception
{
rtiAmbassadors.get(0).reserveObjectInstanceName(LEGAL_NAME_1);
federateAmbassadors.get(0).checkObjectInstanceNameNotReserved(LEGAL_NAME_1);
}
@Test
public void testReserveMultipleObjectInstanceName()
throws Exception
{
Set<String> names = new HashSet<String>();
names.add(LEGAL_NAME_2);
names.add(LEGAL_NAME_3);
rtiAmbassadors.get(1).reserveMultipleObjectInstanceName(names);
federateAmbassadors.get(1).checkObjectInstanceNameReserved(LEGAL_NAME_2);
federateAmbassadors.get(1).checkObjectInstanceNameReserved(LEGAL_NAME_3);
}
@Test(dependsOnMethods = "testReserveMultipleObjectInstanceName")
public void testReserveMultipleObjectInstanceNameAgain()
throws Exception
{
Set<String> names = new HashSet<String>();
names.add(LEGAL_NAME_2);
names.add(LEGAL_NAME_3);
rtiAmbassadors.get(2).reserveMultipleObjectInstanceName(names);
federateAmbassadors.get(2).checkObjectInstanceNameNotReserved(LEGAL_NAME_2);
federateAmbassadors.get(2).checkObjectInstanceNameNotReserved(LEGAL_NAME_3);
}
@Test
public void testReleaseObjectInstanceName()
throws Exception
{
rtiAmbassadors.get(0).reserveObjectInstanceName(LEGAL_NAME_4);
federateAmbassadors.get(0).checkObjectInstanceNameReserved(LEGAL_NAME_4);
rtiAmbassadors.get(0).releaseObjectInstanceName(LEGAL_NAME_4);
rtiAmbassadors.get(0).reserveObjectInstanceName(LEGAL_NAME_4);
federateAmbassadors.get(0).checkObjectInstanceNameReserved(LEGAL_NAME_4);
}
@Test
public void testReleaseMultipleObjectInstanceName()
throws Exception
{
Set<String> names = new HashSet<String>();
names.add(LEGAL_NAME_5);
names.add(LEGAL_NAME_6);
rtiAmbassadors.get(2).reserveMultipleObjectInstanceName(names);
federateAmbassadors.get(2).checkObjectInstanceNameReserved(LEGAL_NAME_5);
federateAmbassadors.get(2).checkObjectInstanceNameReserved(LEGAL_NAME_6);
rtiAmbassadors.get(2).releaseMultipleObjectInstanceName(names);
rtiAmbassadors.get(2).reserveMultipleObjectInstanceName(names);
federateAmbassadors.get(2).checkObjectInstanceNameReserved(LEGAL_NAME_5);
federateAmbassadors.get(2).checkObjectInstanceNameReserved(LEGAL_NAME_6);
}
@Test(expectedExceptions = ObjectInstanceNameNotReserved.class)
public void testReleaseUnreservedObjectInstanceName()
throws Exception
{
rtiAmbassadors.get(0).releaseObjectInstanceName("xxx");
}
@Test(expectedExceptions = ObjectInstanceNameNotReserved.class)
public void testReleaseMultipleUnreservedObjectInstanceNames()
throws Exception
{
Set<String> names = new HashSet<String>();
names.add("xxx");
names.add("yyy");
rtiAmbassadors.get(0).releaseMultipleObjectInstanceName(names);
}
protected TestFederateAmbassador createFederateAmbassador(RTIambassador rtiAmbassador)
{
return new TestFederateAmbassador(rtiAmbassador);
}
public static class TestFederateAmbassador
extends BaseFederateAmbassador
{
private final Set<String> reservedObjectInstanceNames = new HashSet<String>();
private final Set<String> notReservedObjectInstanceNames = new HashSet<String>();
public TestFederateAmbassador(RTIambassador rtiAmbassador)
{
super(rtiAmbassador);
}
public void checkObjectInstanceNameReserved(final String objectInstanceName)
throws Exception
{
evokeCallbackWhile(new Callable<Boolean>()
{
public Boolean call()
{
return !reservedObjectInstanceNames.contains(objectInstanceName);
}
});
assert reservedObjectInstanceNames.contains(objectInstanceName);
}
public void checkObjectInstanceNameNotReserved(final String objectInstanceName)
throws Exception
{
evokeCallbackWhile(new Callable<Boolean>()
{
public Boolean call()
{
return !notReservedObjectInstanceNames.contains(objectInstanceName);
}
});
assert notReservedObjectInstanceNames.contains(objectInstanceName);
}
@Override
public void objectInstanceNameReservationSucceeded(String name)
throws FederateInternalError
{
reservedObjectInstanceNames.add(name);
}
@Override
public void multipleObjectInstanceNameReservationSucceeded(Set<String> names)
throws FederateInternalError
{
reservedObjectInstanceNames.addAll(names);
}
@Override
public void objectInstanceNameReservationFailed(String name)
throws FederateInternalError
{
notReservedObjectInstanceNames.add(name);
}
@Override
public void multipleObjectInstanceNameReservationFailed(Set<String> names)
throws FederateInternalError
{
notReservedObjectInstanceNames.addAll(names);
}
}
}
|
[
"mnewcomb@c6f40f97-f50e-0410-af12-a330f67be530"
] |
mnewcomb@c6f40f97-f50e-0410-af12-a330f67be530
|
5770394c47a626a437c6bc96c383fd7a1c04cc87
|
832c756923d48ace3f338b27ae9dc8327058d088
|
/src/contest/ioi/IOI_2010_Traffic_Congestion2.java
|
8cb339bcb22edd1f73a310b6feac6f40be63fb45
|
[
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
luchy0120/competitive-programming
|
1331bd53698c4b05b57a31d90eecc31c167019bd
|
d0dfc8f3f3a74219ecf16520d6021de04a2bc9f6
|
refs/heads/master
| 2020-05-04T15:18:06.150736
| 2018-11-07T04:15:26
| 2018-11-07T04:15:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,628
|
java
|
package contest.ioi;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Stack;
import java.util.StringTokenizer;
public class IOI_2010_Traffic_Congestion2 {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer st;
static int n;
static int[] sum;
static boolean[] visited;
static int[] dp;
static ArrayList<ArrayList<Integer>> adjlist;
public static void main (String[] args) throws IOException {
int n = readInt();
adjlist = new ArrayList<ArrayList<Integer>>();
sum = new int[n];
visited = new boolean[n];
dp = new int[n];
for (int x = 0; x < n; x++) {
adjlist.add(new ArrayList<Integer>());
sum[x] = readInt();
}
for (int x = 0; x < n - 1; x++) {
int a = readInt();
int b = readInt();
adjlist.get(a).add(b);
adjlist.get(b).add(a);
}
Stack<Integer> moves = new Stack<Integer>();
Stack<int[]> bottom = new Stack<int[]>();
moves.push(0);
bottom.push(new int[] {0, -1});
while (!moves.isEmpty()) {
int curr = moves.pop();
visited[curr] = true;
for (int x = 0; x < adjlist.get(curr).size(); x++) {
int next = adjlist.get(curr).get(x);
if (visited[next])
continue;
moves.push(next);
bottom.push(new int[] {next, curr});
}
}
while (!bottom.isEmpty()) {
int[] curr = bottom.pop();
int total = sum[curr[0]];
dp[curr[0]] = 0;
for (int x = 0; x < adjlist.get(curr[0]).size(); x++) {
int next = adjlist.get(curr[0]).get(x);
if (curr[1] == next)
continue;
total += sum[next];
dp[curr[0]] = Math.max(dp[curr[0]], sum[next]);
}
sum[curr[0]] = total;
}
int min = Integer.MAX_VALUE;
int index = 0;
for (int x = 0; x < n; x++) {
dp[x] = Math.max(dp[x], sum[0] - sum[x]);
if (dp[x] < min) {
min = dp[x];
index = x;
}
}
System.out.println(index);
}
static String next () throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine().trim());
return st.nextToken();
}
static long readLong () throws IOException {
return Long.parseLong(next());
}
static int readInt () throws IOException {
return Integer.parseInt(next());
}
static double readDouble () throws IOException {
return Double.parseDouble(next());
}
static String readLine () throws IOException {
return br.readLine().trim();
}
}
|
[
"jeffrey.xiao1998@gmail.com"
] |
jeffrey.xiao1998@gmail.com
|
5263635ef5cc196aa3ac2a45b7233481a2760a5c
|
ee9aa986a053e32c38d443d475d364858db86edc
|
/src/main/java/com/springrain/erp/common/persistence/proxy/PaginationMapperProxy.java
|
31a96c421c472ff9173c0811855cc235cb958096
|
[
"Apache-2.0"
] |
permissive
|
modelccc/springarin_erp
|
304db18614f69ccfd182ab90514fc1c3a678aaa8
|
42eeb70ee6989b4b985cfe20472240652ec49ab8
|
refs/heads/master
| 2020-05-15T13:10:21.874684
| 2018-05-24T15:39:20
| 2018-05-24T15:39:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,740
|
java
|
/**
* Copyright © 2012-2013 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.springrain.erp.common.persistence.proxy;
import org.apache.ibatis.binding.BindingException;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.session.SqlSession;
import com.springrain.erp.common.persistence.Page;
import com.springrain.erp.common.utils.Reflections;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashSet;
import java.util.Set;
/**
* <p>
* .
* </p>
*
* @author poplar.yfyang
* @version 1.0 2012-05-13 上午10:07
* @since JDK 1.5
*/
public class PaginationMapperProxy implements InvocationHandler {
private static final Set<String> OBJECT_METHODS = new HashSet<String>() {
private static final long serialVersionUID = -1782950882770203583L;
{
add("toString");
add("getClass");
add("hashCode");
add("equals");
add("wait");
add("notify");
add("notifyAll");
}
};
private boolean isObjectMethod(Method method) {
return OBJECT_METHODS.contains(method.getName());
}
private final SqlSession sqlSession;
private PaginationMapperProxy(final SqlSession sqlSession) {
this.sqlSession = sqlSession;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
if (isObjectMethod(method)) {
return null;
}
final Class<?> declaringInterface = findDeclaringInterface(proxy, method);
if (Page.class.isAssignableFrom(method.getReturnType())) {
// 分页处理
return new PaginationMapperMethod(declaringInterface, method, sqlSession).execute(args);
}
// 原处理方式
final MapperMethod mapperMethod = new MapperMethod(declaringInterface, method, sqlSession.getConfiguration());
final Object result = mapperMethod.execute(sqlSession, args);
if (result == null && method.getReturnType().isPrimitive()) {
throw new BindingException(
"Mapper method '"
+ method.getName()
+ "' ("
+ method.getDeclaringClass()
+ ") attempted to return null from a method with a primitive return type ("
+ method.getReturnType() + ").");
}
return result;
}
private Class<?> findDeclaringInterface(Object proxy, Method method) {
Class<?> declaringInterface = null;
for (Class<?> mapperFaces : proxy.getClass().getInterfaces()) {
Method m = Reflections.getAccessibleMethod(mapperFaces,
method.getName(),
method.getParameterTypes());
if (m != null) {
declaringInterface = mapperFaces;
}
}
if (declaringInterface == null) {
throw new BindingException(
"Could not find interface with the given method " + method);
}
return declaringInterface;
}
@SuppressWarnings("unchecked")
public static <T> T newMapperProxy(Class<T> mapperInterface, SqlSession sqlSession) {
ClassLoader classLoader = mapperInterface.getClassLoader();
Class<?>[] interfaces = new Class[]{mapperInterface};
PaginationMapperProxy proxy = new PaginationMapperProxy(sqlSession);
return (T) Proxy.newProxyInstance(classLoader, interfaces, proxy);
}
}
|
[
"601906911@qq.com"
] |
601906911@qq.com
|
20090dd42ed0cb8904f35a1f0c0f33068e7faca2
|
c2fb6846d5b932928854cfd194d95c79c723f04c
|
/java_backup/my java/pinka/project_2011_half_yearly/Binary.java
|
a8ff08cdd69fab43963d05697f3eef164fb37f5d
|
[
"MIT"
] |
permissive
|
Jimut123/code-backup
|
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
|
8d4c16b9e960d352a7775786ea60290b29b30143
|
refs/heads/master
| 2022-12-07T04:10:59.604922
| 2021-04-28T10:22:19
| 2021-04-28T10:22:19
| 156,666,404
| 9
| 5
|
MIT
| 2022-12-02T20:27:22
| 2018-11-08T07:22:48
|
Jupyter Notebook
|
UTF-8
|
Java
| false
| false
| 1,223
|
java
|
package project_2011_half_yearly;
import java.io.*;
class Binary
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int x[]=new int[10];
int i,j,tmp,f,n,v,l,u,mid;
Binary(int n1)throws IOException
{
n=n1;
for(i=0;i<n;i++)
{
System.out.println("Enter number");
x[i]=Integer.parseInt(br.readLine());
//System.out.println(x[i]);
}
original();
arrangement();
sorted();
search();
}
void original()
{
System.out.println("Original arrangment"+n);
for(i=0;i<n;i++)
{
//System.out.println("Original arrangment1");
System.out.println(x[i]);
}
}
void arrangement()
{
for(i=0;i<n;i++)
{
for(j=0;j<n-i-1;j++)
if(x[j]>x[j+1])
{
tmp=x[j];
x[j]=x[j+1];
x[j+1]=tmp;
}
}
}
void sorted()
{
System.out.println("Sorted arrangement");
for(i=0;i<n;i++)
{
System.out.println(x[i]);
}
}
void search()throws IOException
{
System.out.println("Give element");
v=Integer.parseInt(br.readLine());
f=0;
l=0;
u=n-1;
mid=(l+u)/2;
while(l<=u)
{
if(x[mid]==v)
{
f=1;
break;
}
else
if(v>x[mid])
l=mid+1;
else
if(v<x[mid])
l=mid-1;
mid=(l+u)/2;
}
if(f==1)
{
System.out.println("Element found");
}
else
{
System.out.println("Element not found");
}
}
}
|
[
"jimutbahanpal@yahoo.com"
] |
jimutbahanpal@yahoo.com
|
e5dd7430e5356d781408123aae75d0861a491096
|
013e83b707fe5cd48f58af61e392e3820d370c36
|
/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceTransformerSupport.java
|
7939ca08efa10b4b215cd26dad7c36a5fb0dda3a
|
[] |
no_license
|
yuexiaoguang/spring4
|
8376f551fefd33206adc3e04bc58d6d32a825c37
|
95ea25bbf46ee7bad48307e41dcd027f1a0c67ae
|
refs/heads/master
| 2020-05-27T20:27:54.768860
| 2019-09-02T03:39:57
| 2019-09-02T03:39:57
| 188,770,867
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,761
|
java
|
package org.springframework.web.servlet.resource;
import java.util.Collections;
import javax.servlet.http.HttpServletRequest;
import org.springframework.core.io.Resource;
/**
* {@code ResourceTransformer}的基类, 带有可选的帮助方法, 用于解析转换后的资源中的公共链接.
*/
public abstract class ResourceTransformerSupport implements ResourceTransformer {
private ResourceUrlProvider resourceUrlProvider;
/**
* 配置{@link ResourceUrlProvider}以在解析转换后的资源中的链接的公共URL时使用 (e.g. CSS文件中的import链接).
* 这仅对表示为完整路径的链接是必需的, i.e. 包括上下文和servlet路径, 而不是相对链接.
* <p>默认未设置此属性.
* 在这种情况下, 如果需要{@code ResourceUrlProvider}, 则尝试查找通过
* {@link org.springframework.web.servlet.resource.ResourceUrlProviderExposingInterceptor
* ResourceUrlProviderExposingInterceptor}公开的{@code ResourceUrlProvider} (默认情况下在MVC Java配置和XML命名空间中配置).
* 因此, 在大多数情况下, 不需要显式配置此属性.
*
* @param resourceUrlProvider 要使用的URL提供器
*/
public void setResourceUrlProvider(ResourceUrlProvider resourceUrlProvider) {
this.resourceUrlProvider = resourceUrlProvider;
}
/**
* 返回配置的{@code ResourceUrlProvider}.
*/
public ResourceUrlProvider getResourceUrlProvider() {
return this.resourceUrlProvider;
}
/**
* 当转换的资源包含指向其他资源的链接时, 转换器可以使用此方法.
* 这些链接需要由资源解析器链确定的公共的链接替换 (e.g. 公共URL可能插入了版本).
*
* @param resourcePath 需要重写的资源的路径
* @param request 当前的请求
* @param resource 要转换的资源
* @param transformerChain 转换器链
*
* @return 转换后的URL, 或{@code null}
*/
protected String resolveUrlPath(String resourcePath, HttpServletRequest request,
Resource resource, ResourceTransformerChain transformerChain) {
if (resourcePath.startsWith("/")) {
// 完整的资源路径
ResourceUrlProvider urlProvider = findResourceUrlProvider(request);
return (urlProvider != null ? urlProvider.getForRequestUrl(request, resourcePath) : null);
}
else {
// 尝试解析为相对路径
return transformerChain.getResolverChain().resolveUrlPath(
resourcePath, Collections.singletonList(resource));
}
}
private ResourceUrlProvider findResourceUrlProvider(HttpServletRequest request) {
if (this.resourceUrlProvider != null) {
return this.resourceUrlProvider;
}
return (ResourceUrlProvider) request.getAttribute(
ResourceUrlProviderExposingInterceptor.RESOURCE_URL_PROVIDER_ATTR);
}
}
|
[
"yuexiaoguang@vortexinfo.cn"
] |
yuexiaoguang@vortexinfo.cn
|
3a2fc841b1f210fb7dd88889ba5913e63ca8bb6f
|
c09b2a634dabfc458f1d0aae9bf792b4d3bf6a3a
|
/Udemy/build_an_online_bank_with_java_angular2_spring_and_more/UserFront/src/main/java/com/userfront/config/SecurityConfig.java
|
bd564472c9749ad998fd7e3e25909e732230eaf6
|
[] |
no_license
|
kadensungbincho/Online_Lectures
|
539bed24e344a6815e090cd0bda194db9fa801cd
|
21afbfe9c4c41a9041ffedaf51c6c980c6e743bb
|
refs/heads/master
| 2023-01-12T18:59:05.128000
| 2022-02-20T13:04:45
| 2022-02-20T13:04:45
| 124,209,787
| 2
| 1
| null | 2023-01-07T20:04:16
| 2018-03-07T09:11:09
|
Jupyter Notebook
|
UTF-8
|
Java
| false
| false
| 2,935
|
java
|
package com.userfront.config;
import java.security.SecureRandom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import com.userfront.service.UserServiceImpl.UserSecurityService;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private Environment env;
@Autowired
private UserSecurityService userSecurityService;
private static final String SALT = "salt"; // Salt should be protected carefully
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder(12, new SecureRandom(SALT.getBytes()));
}
private static final String[] PUBLIC_MATCHERS = {
"/webjars/**",
"/css/**",
"/js/**",
"/static/**",
"/images/**",
"/",
"/about/**",
"/contact/**",
"/error/**/*",
"/console/**",
"/signup"
};
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests().
// antMatchers("/**").
antMatchers(PUBLIC_MATCHERS).
permitAll().anyRequest().authenticated();
http
.csrf().disable().cors().disable()
.formLogin().failureUrl("/index?error").defaultSuccessUrl("/userFront").loginPage("/index").permitAll()
.and()
.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/index?logout").deleteCookies("remember-me").permitAll()
.and()
.rememberMe();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
// auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); //This is in-memory authentication
auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder());
}
}
|
[
"kadensungbincho@gmail.com"
] |
kadensungbincho@gmail.com
|
2beb9796d89ee64221afdfa600c71f149266e15a
|
3c1f488d822e8231f349de037ef63721e1e93734
|
/algorithm/src/com/jinfenglee/search/BinarySearch.java
|
c499887b49daef53bd8d0cfd201b77c20c77dc59
|
[] |
no_license
|
jinfengli/algorithm
|
579fa79d30d53097ee6ed9ac5b3fe3c71de0205f
|
2a47ddd54d730c1229cce5bcd96a8210298e2a8c
|
refs/heads/master
| 2021-01-12T19:18:15.131779
| 2019-10-24T08:46:29
| 2019-10-24T08:46:29
| 34,402,012
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,255
|
java
|
package com.jinfenglee.search;
import java.util.Arrays;
/**
* BinarySearch
*
* @author li.jf
* @date 2017-10-17 21:34:02
*
*/
public class BinarySearch {
/**
* 二分查找 复杂度 O(log(n)) 特点:要求待查表必须是有序表,并且顺序存储
*
* @param arr
* @param num 待查找的数
* @return
*/
private static int binarySearch(int[] arr, int num) {
int low = 0;
int high = arr.length - 1;
while (low <= high) {
// 网上有的写法是这样的:middle = low + ((high - low) >> 1), 效果实际一样的.
// int mid = (low + high) / 2;
int mid = low + ((high - low) >> 1);
if (num > arr[mid]) {
low = mid + 1;
} else if (num < arr[mid]) {
high = mid - 1;
} else {
return mid;
}
}
return -1;
}
public static void main(String[] args) {
int[] arr = { 2, 5, 11, 3, 91, 13, 35, 4 };
Arrays.sort(arr); // 二分查找要求数组有序,先排序
for (int a : arr) {
System.out.print(a + " ");
}
System.out.println();
int num = 5;
int result = binarySearch(arr, num);
if (result != -1) {
System.out.println("存在该数" + num + " ,索引下标为:" + result);
} else {
System.out.println("数组中不存在该数据");
}
}
}
|
[
"lijinfeng.ljf@gmail.com"
] |
lijinfeng.ljf@gmail.com
|
9e5fe27cbc231cea9df28813b778eea88fde6170
|
2d53d6f8d3e0e389bba361813e963514fdef3950
|
/Sql_injection/s01/CWE89_SQL_Injection__console_readLine_executeBatch_51b.java
|
f43b396b661508f0f8b4319618f7dc8d097dde3d
|
[] |
no_license
|
apobletts/ml-testing
|
6a1b95b995fdfbdd68f87da5f98bd969b0457234
|
ee6bb9fe49d9ec074543b7ff715e910110bea939
|
refs/heads/master
| 2021-05-10T22:55:57.250937
| 2018-01-26T20:50:15
| 2018-01-26T20:50:15
| 118,268,553
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,590
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE89_SQL_Injection__console_readLine_executeBatch_51b.java
Label Definition File: CWE89_SQL_Injection.label.xml
Template File: sources-sinks-51b.tmpl.java
*/
/*
* @description
* CWE: 89 SQL Injection
* BadSource: console_readLine Read data from the console using readLine()
* GoodSource: A hardcoded string
* Sinks: executeBatch
* GoodSink: Use prepared statement and executeBatch (properly)
* BadSink : data concatenated into SQL statement used in executeBatch(), which could result in SQL Injection
* Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package
*
* */
package testcases.CWE89_SQL_Injection.s01;
import testcasesupport.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.logging.Level;
public class CWE89_SQL_Injection__console_readLine_executeBatch_51b
{
public void badSink(String data ) throws Throwable
{
if (data != null)
{
String names[] = data.split("-");
int successCount = 0;
Connection dbConnection = null;
Statement sqlStatement = null;
try
{
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.createStatement();
for (int i = 0; i < names.length; i++)
{
/* PRAETORIAN: data concatenated into SQL statement used in executeBatch(), which could result in SQL Injection */
sqlStatement.addBatch("update users set hitcount=hitcount+1 where name='" + names[i] + "'");
}
int resultsArray[] = sqlStatement.executeBatch();
for (int i = 0; i < names.length; i++)
{
if (resultsArray[i] > 0)
{
successCount++;
}
}
IO.writeLine("Succeeded in " + successCount + " out of " + names.length + " queries.");
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Statament", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(String data ) throws Throwable
{
if (data != null)
{
String names[] = data.split("-");
int successCount = 0;
Connection dbConnection = null;
Statement sqlStatement = null;
try
{
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.createStatement();
for (int i = 0; i < names.length; i++)
{
/* POTENTIAL FLAW: data concatenated into SQL statement used in executeBatch(), which could result in SQL Injection */
sqlStatement.addBatch("update users set hitcount=hitcount+1 where name='" + names[i] + "'");
}
int resultsArray[] = sqlStatement.executeBatch();
for (int i = 0; i < names.length; i++)
{
if (resultsArray[i] > 0)
{
successCount++;
}
}
IO.writeLine("Succeeded in " + successCount + " out of " + names.length + " queries.");
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Statament", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(String data ) throws Throwable
{
if (data != null)
{
String names[] = data.split("-");
int successCount = 0;
Connection dbConnection = null;
PreparedStatement sqlStatement = null;
try
{
/* FIX: Use prepared statement and executeBatch (properly) */
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.prepareStatement("update users set hitcount=hitcount+1 where name=?");
for (int i = 0; i < names.length; i++)
{
sqlStatement.setString(1, names[i]);
sqlStatement.addBatch();
}
int resultsArray[] = sqlStatement.executeBatch();
for (int i = 0; i < names.length; i++)
{
if (resultsArray[i] > 0)
{
successCount++;
}
}
IO.writeLine("Succeeded in " + successCount + " out of " + names.length + " queries.");
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
}
|
[
"anna.pobletts@praetorian.com"
] |
anna.pobletts@praetorian.com
|
7a9bf04b27cfc39b9a3feec5aee95ca1863b90f0
|
1073ccdac34de3ca95a4c69628a4ffa47795a949
|
/CodeFirstDB/src/main/java/entity/User.java
|
4d5be7a7d47bd51ae58088cc559c506edfc9d43c
|
[] |
no_license
|
Polina-MD80/SpringData
|
9cf0cdfed8c770df019687d6adb6be05730f8cc5
|
39c1cce63b93ac630a4fa61fa8ada6bba8d39eed
|
refs/heads/main
| 2023-06-27T00:16:46.123151
| 2021-08-01T09:37:14
| 2021-08-01T09:37:14
| 387,726,795
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 933
|
java
|
package entity;
import javax.persistence.*;
@Entity
@Table(name = "users")
@Inheritance(strategy= InheritanceType.JOINED)
public abstract class User extends BaseEntity{
private String firstName;
private String lastName;
private String phoneNumber;
public User() {
}
@Column(name = "first_name",nullable = false, length = 50)
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column(name = "last_name",nullable = false, length = 50)
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Column(name = "phone_number")
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
|
[
"poli.paskaleva@gmail.com"
] |
poli.paskaleva@gmail.com
|
69c78777ba4376b67e7f4f68b328b2f3a391ed71
|
280314e9f507ae049480d0d8be0fe1538fc12f74
|
/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestArchiveExtraction.java
|
8e85e2f30f257532bf6de31bfb5bcc5296b32a93
|
[
"Apache-2.0",
"W3C"
] |
permissive
|
leachuk/jackrabbit-filevault
|
427a9234c20f5a1b51ae4fb48905161ea9ce2cc4
|
fa8fe8fcdc60876699401b3ede371e0bd31eaa92
|
refs/heads/trunk
| 2020-06-01T23:03:30.785483
| 2019-06-21T00:14:07
| 2019-06-21T00:14:07
| 190,960,143
| 0
| 1
|
Apache-2.0
| 2019-06-21T00:14:08
| 2019-06-09T03:32:31
|
Java
|
UTF-8
|
Java
| false
| false
| 7,585
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.jackrabbit.vault.packaging.integration;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import javax.jcr.ItemExistsException;
import javax.jcr.RepositoryException;
import org.apache.jackrabbit.vault.fs.io.Archive;
import org.apache.jackrabbit.vault.fs.io.ImportOptions;
import org.apache.jackrabbit.vault.fs.io.ZipStreamArchive;
import org.apache.jackrabbit.vault.packaging.JcrPackage;
import org.apache.jackrabbit.vault.packaging.PackageException;
import org.apache.jackrabbit.vault.packaging.PackageId;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Test cases for shallow package installation
*/
@RunWith(Parameterized.class)
public class TestArchiveExtraction extends IntegrationTestBase {
@Parameterized.Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{{0, false}, {1000, false}, {1024*1024, true}});
}
private final int streamBufferSize;
private final boolean isBuffered;
public TestArchiveExtraction(int streamBufferSize, boolean isBuffered) {
this.streamBufferSize = streamBufferSize;
this.isBuffered = isBuffered;
}
@Override
public Archive getFileArchive(String name) {
if (streamBufferSize > 0) {
try {
return super.getStreamArchive(name, streamBufferSize);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
return super.getFileArchive(name);
}
private void validateArchive(Archive a) {
if (a instanceof ZipStreamArchive) {
assertEquals("isBuffered", isBuffered, ((ZipStreamArchive) a).isBuffered());
}
}
@Test
public void testDefaultArchiveInstall() throws RepositoryException, IOException, PackageException {
Archive a = getFileArchive("testpackages/tmp.zip");
ImportOptions opts = getDefaultOptions();
PackageId[] ids = packMgr.extract(a, opts, true);
validateArchive(a);
assertEquals(1, ids.length);
assertEquals(TMP_PACKAGE_ID, ids[0]);
assertNodeExists("/tmp/foo/bar/tobi");
assertPackageNodeExists(TMP_PACKAGE_ID);
// check if size is 0
long size = admin.getProperty(getInstallationPath(TMP_PACKAGE_ID) + "/jcr:content/jcr:data").getLength();
assertEquals("package binary size", 0, size);
JcrPackage pack = packMgr.open(ids[0]);
assertTrue("Package should be marked as installed", pack.isInstalled());
assertTrue("Package should be marked as empty", pack.isEmpty());
assertNull("Package should not have a snapshot", pack.getSnapshot());
assertNotNull("Package should have a definition", pack.getDefinition());
assertNotNull("Package should have a definition creation date", pack.getDefinition().getCreated());
assertNotNull("Package should have properties", pack.getPackage().getProperties());
assertNotNull("Package should have a properties creation date", pack.getPackage().getCreated());
try {
pack.install(getDefaultOptions());
fail("re-install of a hollow package should fail.");
} catch (IllegalStateException e) {
// ok
}
}
@Test
public void testDefaultArchiveInstallFailsWithoutReplace() throws RepositoryException, IOException, PackageException {
uploadPackage("testpackages/tmp.zip");
Archive a = getFileArchive("testpackages/tmp.zip");
ImportOptions opts = getDefaultOptions();
try {
packMgr.extract(a, opts, false);
fail("extract w/o replace should fail.");
} catch (ItemExistsException e) {
// expected
} catch (PackageException e) {
// expected
}
}
@Test
public void testDefaultArchiveInstallCanReplace() throws RepositoryException, IOException, PackageException {
uploadPackage("testpackages/tmp.zip");
Archive a = getFileArchive("testpackages/tmp.zip");
ImportOptions opts = getDefaultOptions();
PackageId[] ids = packMgr.extract(a, opts, true);
assertEquals(1, ids.length);
assertEquals(new PackageId("my_packages", "tmp", ""), ids[0]);
}
@Test
public void testNonRecursive() throws RepositoryException, IOException, PackageException {
Archive a = getFileArchive("testpackages/subtest.zip");
// install
ImportOptions opts = getDefaultOptions();
opts.setNonRecursive(true);
PackageId[] ids = packMgr.extract(a, opts, false);
assertEquals(1, ids.length);
assertEquals(new PackageId("my_packages", "subtest", ""), ids[0]);
// check for sub packages
assertPackageNodeExists(PACKAGE_ID_SUB_A);
long size = admin.getProperty(getInstallationPath(PACKAGE_ID_SUB_A)+ "/jcr:content/jcr:data").getLength();
assertTrue("sub package must have data", size > 0);
assertNodeMissing("/tmp/a");
assertPackageNodeExists(PACKAGE_ID_SUB_B);
size = admin.getProperty(getInstallationPath(PACKAGE_ID_SUB_B)+ "/jcr:content/jcr:data").getLength();
assertTrue("sub package must have data", size > 0);
assertNodeMissing("/tmp/b");
}
@Test
public void testRecursive() throws RepositoryException, IOException, PackageException {
Archive a = getFileArchive("testpackages/subtest.zip");
// install
ImportOptions opts = getDefaultOptions();
PackageId[] ids = packMgr.extract(a, opts, false);
assertEquals(3, ids.length);
Set<PackageId> testSet = new HashSet<>(Arrays.asList(ids));
assertTrue(testSet.contains(new PackageId("my_packages", "subtest", "")));
assertTrue(testSet.contains(PACKAGE_ID_SUB_A));
assertTrue(testSet.contains(PACKAGE_ID_SUB_B));
// check for sub packages
assertPackageNodeExists(PACKAGE_ID_SUB_A);
long size = admin.getProperty(getInstallationPath(PACKAGE_ID_SUB_A)+ "/jcr:content/jcr:data").getLength();
assertEquals("sub package must no data", 0, size);
assertNodeExists("/tmp/a");
assertPackageNodeExists(PACKAGE_ID_SUB_B);
size = admin.getProperty(getInstallationPath(PACKAGE_ID_SUB_B)+ "/jcr:content/jcr:data").getLength();
assertEquals("sub package must no data", 0, size);
assertNodeExists("/tmp/b");
}
}
|
[
"tripod@apache.org"
] |
tripod@apache.org
|
ef465bd33136d90e46ea89b533e8f057b08f9d0b
|
96a1e3b146e35fd86482147c1f648865f9b4b94c
|
/TSS.Java/src/tss/tpm/NV_ReadLockResponse.java
|
8122a3fbe17bb33631745cab3cd97f08048f09e8
|
[
"MIT"
] |
permissive
|
CIPop/TSS.MSR
|
c496182503e8792c0a703369a7e8c181f5ccda45
|
66425274b1c93765678cc845865366d0e67829af
|
refs/heads/master
| 2021-08-23T01:14:06.776704
| 2017-12-01T06:25:03
| 2017-12-01T06:25:03
| 107,336,461
| 0
| 0
| null | 2017-10-17T23:53:09
| 2017-10-17T23:53:08
| null |
UTF-8
|
Java
| false
| false
| 1,808
|
java
|
package tss.tpm;
import tss.*;
// -----------This is an auto-generated file: do not edit
//>>>
/**
* If TPMA_NV_READ_STCLEAR is SET in an Index, then this command may be used to prevent further reads of the NV Index until the next TPM2_Startup (TPM_SU_CLEAR).
*/
public class NV_ReadLockResponse extends TpmStructure
{
/**
* If TPMA_NV_READ_STCLEAR is SET in an Index, then this command may be used to prevent further reads of the NV Index until the next TPM2_Startup (TPM_SU_CLEAR).
*/
public NV_ReadLockResponse()
{
}
@Override
public void toTpm(OutByteBuf buf)
{
return;
}
@Override
public void initFromTpm(InByteBuf buf)
{
}
@Override
public byte[] toTpm()
{
OutByteBuf buf = new OutByteBuf();
toTpm(buf);
return buf.getBuf();
}
public static NV_ReadLockResponse fromTpm (byte[] x)
{
NV_ReadLockResponse ret = new NV_ReadLockResponse();
InByteBuf buf = new InByteBuf(x);
ret.initFromTpm(buf);
if (buf.bytesRemaining()!=0)
throw new AssertionError("bytes remaining in buffer after object was de-serialized");
return ret;
}
public static NV_ReadLockResponse fromTpm (InByteBuf buf)
{
NV_ReadLockResponse ret = new NV_ReadLockResponse();
ret.initFromTpm(buf);
return ret;
}
@Override
public String toString()
{
TpmStructurePrinter _p = new TpmStructurePrinter("TPM2_NV_ReadLock_RESPONSE");
toStringInternal(_p, 1);
_p.endStruct();
return _p.toString();
}
@Override
public void toStringInternal(TpmStructurePrinter _p, int d)
{
};
};
//<<<
|
[
"Andrey.Marochko@microsoft.com"
] |
Andrey.Marochko@microsoft.com
|
1e49d609597d3578ef43d731f029f427b008c898
|
e69e5d899856b185e23b6ca0ed50df38b2aff5d1
|
/workorder-data-services/src/main/java/com/tip/fetchtechnician/repository/TechnicianDetailsRepository.java
|
ee8bd19426a6cad650142ba54fe4fe81ea31fcf3
|
[] |
no_license
|
shuvankar999/git_backup
|
10edee9a3db6e4dcb6b67df2a712ebce10c33f31
|
b39e126e45df1c6147aace22aabbcc75b3d65322
|
refs/heads/main
| 2023-06-14T17:12:55.874523
| 2021-07-09T16:16:14
| 2021-07-09T16:16:14
| 384,487,809
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package com.tip.fetchtechnician.repository;
import com.tip.fetchtechnician.model.TechnicianDetailsRequest;
import java.util.Map;
@FunctionalInterface
public interface TechnicianDetailsRepository {
public Map<String, Object> getTechnicianDetails(TechnicianDetailsRequest technicianDetailsRequest);
}
|
[
"shuvankar999@gmail.com"
] |
shuvankar999@gmail.com
|
e0d2ba4fabcab2ab56edcd31fe76cf6c9da030cd
|
606cd7931bc5288ffe91cf58f45d3e4f64a9b3df
|
/pk-ejb/src/java/com/pelindo/ebtos/ejb/facade/remote/MasterCountryFacadeRemote.java
|
74d5c24bbd4e10fdd15f1c3c5aa06cd0a5b7ff6f
|
[] |
no_license
|
surachman/iconos-tarakan
|
5655284ac69059935922d92ee856b6926b656d1d
|
d7fa1c120d22d391983dab95c5654cb63b27e1f7
|
refs/heads/master
| 2021-01-20T20:21:40.937285
| 2016-06-27T14:51:22
| 2016-06-27T14:51:22
| 61,995,382
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 653
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.pelindo.ebtos.ejb.facade.remote;
import com.pelindo.ebtos.model.db.master.MasterCountry;
import java.util.List;
import javax.ejb.Remote;
/**
*
* @author dycoder
*/
@Remote
public interface MasterCountryFacadeRemote {
void create(MasterCountry masterCountry);
void edit(MasterCountry masterCountry);
void remove(MasterCountry masterCountry);
MasterCountry find(Object id);
List<MasterCountry> findAll();
List<MasterCountry> findRange(int[] range);
List<Object[]> findAllNative();
int count();
}
|
[
"surachman026@gmail.com"
] |
surachman026@gmail.com
|
af56ec5c0d9663c9c7af15033db80b8449ab59f5
|
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
|
/tags/2010-02-27/seasar2-2.4.41/s2-tiger/src/test/java/org/seasar/extension/dxo/Employee.java
|
9d1d9185f5d674bcec38b81e217831fe2f72b349
|
[
"Apache-2.0"
] |
permissive
|
svn2github/s2container
|
54ca27cf0c1200a93e1cb88884eb8226a9be677d
|
625adc6c4e1396654a7297d00ec206c077a78696
|
refs/heads/master
| 2020-06-04T17:15:02.140847
| 2013-08-09T09:38:15
| 2013-08-09T09:38:15
| 10,850,644
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,682
|
java
|
/*
* Copyright 2004-2010 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.extension.dxo;
/**
*
*/
public class Employee {
private static final long serialVersionUID = -8378271087258215629L;
private long empno;
private String ename;
private String job;
private Employee mgr;
private java.util.Date hiredate;
private Float sal;
private Float comm;
private Integer deptno;
private byte[] password;
private String dummy;
private Department department;
/**
*
*/
public Employee() {
}
/**
* @param empno
*/
public Employee(long empno) {
this.empno = empno;
}
/**
* @return
*/
public long getEmpno() {
return this.empno;
}
/**
* @param empno
*/
public void setEmpno(long empno) {
this.empno = empno;
}
/**
* @return
*/
public java.lang.String getEname() {
return this.ename;
}
/**
* @param ename
*/
public void setEname(java.lang.String ename) {
this.ename = ename;
}
/**
* @return
*/
public java.lang.String getJob() {
return this.job;
}
/**
* @param job
*/
public void setJob(java.lang.String job) {
this.job = job;
}
/**
* @return
*/
public Employee getMgr() {
return this.mgr;
}
/**
* @param mgr
*/
public void setMgr(Employee mgr) {
this.mgr = mgr;
}
/**
* @return
*/
public java.util.Date getHiredate() {
return this.hiredate;
}
/**
* @param hiredate
*/
public void setHiredate(java.util.Date hiredate) {
this.hiredate = hiredate;
}
/**
* @return
*/
public Float getSal() {
return this.sal;
}
/**
* @param sal
*/
public void setSal(Float sal) {
this.sal = sal;
}
/**
* @return
*/
public Float getComm() {
return this.comm;
}
/**
* @param comm
*/
public void setComm(Float comm) {
this.comm = comm;
}
/**
* @return
*/
public Integer getDeptno() {
return this.deptno;
}
/**
* @param deptno
*/
public void setDeptno(Integer deptno) {
this.deptno = deptno;
}
/**
* @return
*/
public byte[] getPassword() {
return this.password;
}
/**
* @param password
*/
public void setPassword(byte[] password) {
this.password = password;
}
/**
* @return
*/
public String getDummy() {
return this.dummy;
}
/**
* @param dummy
*/
public void setDummy(String dummy) {
this.dummy = dummy;
}
/**
* @return
*/
public Department getDepartment() {
return this.department;
}
/**
* @param department
*/
public void setDepartment(Department department) {
this.department = department;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Employee))
return false;
Employee castOther = (Employee) other;
return this.getEmpno() == castOther.getEmpno();
}
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(empno).append(", ");
buf.append(ename).append(", ");
buf.append(job).append(", ");
buf.append(mgr).append(", ");
buf.append(hiredate).append(", ");
buf.append(sal).append(", ");
buf.append(comm).append(", ");
buf.append(deptno).append(" {");
buf.append(department).append("}");
return buf.toString();
}
@Override
public int hashCode() {
return (int) this.getEmpno();
}
}
|
[
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] |
koichik@319488c0-e101-0410-93bc-b5e51f62721a
|
5dbc20d1ed7d260dadafff59400984054c758aea
|
ea5232155e2322aa598ddce46fcb12564d048413
|
/src/test/java/com/avaje/ebeaninternal/server/transaction/TestAutoCommitDataSource.java
|
a7614d5cc533ac0f088f497040bccf003d3328d6
|
[
"Apache-2.0"
] |
permissive
|
nedge/avaje-ebeanorm
|
bc8472fa8d34313841cd244af3ae596c7f7a7cc7
|
1065a8470933b15c1379d8ec0012ef38a1797262
|
refs/heads/master
| 2021-01-21T08:54:45.288237
| 2014-10-14T06:10:31
| 2014-10-14T06:10:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,457
|
java
|
package com.avaje.ebeaninternal.server.transaction;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.EbeanServerFactory;
import com.avaje.ebean.Transaction;
import com.avaje.ebean.config.GlobalProperties;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.tests.model.basic.UTDetail;
public class TestAutoCommitDataSource extends BaseTestCase {
@Test
public void test() {
ServerConfig config = new ServerConfig();
config.setName("h2autocommit");
config.loadFromProperties();
config.addClass(UTDetail.class);
config.setDdlGenerate(true);
config.setDdlRun(true);
config.setAutoCommitMode(true);
GlobalProperties.setSkipPrimaryServer(true);
EbeanServer ebeanServer = EbeanServerFactory.create(config);
UTDetail detail1 = new UTDetail("one", 12, 30D);
UTDetail detail2 = new UTDetail("two", 11, 30D);
UTDetail detail3 = new UTDetail("three", 8, 30D);
Transaction txn = ebeanServer.beginTransaction();
try {
txn.setBatchMode(true);
ebeanServer.save(detail1);
ebeanServer.save(detail2);
ebeanServer.save(detail3);
txn.commit();
} finally {
txn.end();
}
List<UTDetail> details = ebeanServer.find(UTDetail.class).findList();
Assert.assertEquals(3, details.size());
}
}
|
[
"robin.bygrave@gmail.com"
] |
robin.bygrave@gmail.com
|
bea95b0ba90c79f1ce86baf043622f3864e4e150
|
d2b3e2f6a39661cee817f3ea4dce26530634b5fe
|
/tool/xstudio-exception/src/main/java/com/xstudio/tool/exception/EmptyKeyException.java
|
31fc4b42466e86b3bf6349ad907e03b5ea4b437e
|
[] |
no_license
|
beeant0512/xstudio-platform-tool
|
dcfbc1cd59bb9f1d7db0bcd6413abc250455e239
|
59e89a31d2c62a5399ca44bd6fc45ffb5476563a
|
refs/heads/master
| 2020-08-06T22:04:28.231866
| 2019-10-10T04:46:06
| 2019-10-10T04:46:06
| 213,174,151
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,387
|
java
|
package com.xstudio.tool.exception;
/**
* @author xiaobiao
* @version 2019/5/13
*/
public class EmptyKeyException extends RuntimeException {
/**
* Constructs a new runtime exception with the specified detail message and
* cause. <p>Note that the detail message associated with
* {@code cause} is <i>not</i> automatically incorporated in
* this runtime exception's detail message.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
* @since 1.4
*/
public EmptyKeyException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a new runtime exception with the specified detail message.
* The cause is not initialized, and may subsequently be initialized by a
* call to {@link #initCause}.
*
* @param message the detail message. The detail message is saved for
* later retrieval by the {@link #getMessage()} method.
*/
public EmptyKeyException(String message) {
super(message);
}
}
|
[
"huangxb0512@gmail.com"
] |
huangxb0512@gmail.com
|
7487ad78e0fe67a0b60b241e9c3ee8a782baa3e5
|
ed5159d056e98d6715357d0d14a9b3f20b764f89
|
/test/irvine/oeis/a012/A012865Test.java
|
c9e7d5d3cb4159d71399f892aad22bd25cc69186
|
[] |
no_license
|
flywind2/joeis
|
c5753169cf562939b04dd246f8a2958e97f74558
|
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
|
refs/heads/master
| 2020-09-13T18:34:35.080552
| 2019-11-19T05:40:55
| 2019-11-19T05:40:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 195
|
java
|
package irvine.oeis.a012;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A012865Test extends AbstractSequenceTest {
}
|
[
"sairvin@gmail.com"
] |
sairvin@gmail.com
|
7553459009885daece7bea0670a98a6b7949d6f9
|
9254e7279570ac8ef687c416a79bb472146e9b35
|
/sofa-20190815/src/main/java/com/aliyun/sofa20190815/models/QueryLDCFlowRecordResponseBody.java
|
fdfdb8ab081df03a2df45422963e5a1ffbcd6421
|
[
"Apache-2.0"
] |
permissive
|
lquterqtd/alibabacloud-java-sdk
|
3eaa17276dd28004dae6f87e763e13eb90c30032
|
3e5dca8c36398469e10cdaaa34c314ae0bb640b4
|
refs/heads/master
| 2023-08-12T13:56:26.379027
| 2021-10-19T07:22:15
| 2021-10-19T07:22:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,251
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sofa20190815.models;
import com.aliyun.tea.*;
public class QueryLDCFlowRecordResponseBody extends TeaModel {
@NameInMap("RequestId")
public String requestId;
@NameInMap("ResultCode")
public String resultCode;
@NameInMap("ResultMessage")
public String resultMessage;
@NameInMap("CurrentPage")
public Long currentPage;
@NameInMap("PageSize")
public Long pageSize;
@NameInMap("TotalCount")
public Long totalCount;
@NameInMap("Data")
public java.util.List<QueryLDCFlowRecordResponseBodyData> data;
public static QueryLDCFlowRecordResponseBody build(java.util.Map<String, ?> map) throws Exception {
QueryLDCFlowRecordResponseBody self = new QueryLDCFlowRecordResponseBody();
return TeaModel.build(map, self);
}
public QueryLDCFlowRecordResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public QueryLDCFlowRecordResponseBody setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public String getResultCode() {
return this.resultCode;
}
public QueryLDCFlowRecordResponseBody setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
return this;
}
public String getResultMessage() {
return this.resultMessage;
}
public QueryLDCFlowRecordResponseBody setCurrentPage(Long currentPage) {
this.currentPage = currentPage;
return this;
}
public Long getCurrentPage() {
return this.currentPage;
}
public QueryLDCFlowRecordResponseBody setPageSize(Long pageSize) {
this.pageSize = pageSize;
return this;
}
public Long getPageSize() {
return this.pageSize;
}
public QueryLDCFlowRecordResponseBody setTotalCount(Long totalCount) {
this.totalCount = totalCount;
return this;
}
public Long getTotalCount() {
return this.totalCount;
}
public QueryLDCFlowRecordResponseBody setData(java.util.List<QueryLDCFlowRecordResponseBodyData> data) {
this.data = data;
return this;
}
public java.util.List<QueryLDCFlowRecordResponseBodyData> getData() {
return this.data;
}
public static class QueryLDCFlowRecordResponseBodyData extends TeaModel {
@NameInMap("Operator")
public String operator;
@NameInMap("PushTime")
public String pushTime;
@NameInMap("ResultCode")
public String resultCode;
@NameInMap("ResultMsg")
public String resultMsg;
@NameInMap("RuleType")
public String ruleType;
@NameInMap("Value")
public String value;
@NameInMap("Apps")
public java.util.List<String> apps;
@NameInMap("Targets")
public java.util.List<String> targets;
public static QueryLDCFlowRecordResponseBodyData build(java.util.Map<String, ?> map) throws Exception {
QueryLDCFlowRecordResponseBodyData self = new QueryLDCFlowRecordResponseBodyData();
return TeaModel.build(map, self);
}
public QueryLDCFlowRecordResponseBodyData setOperator(String operator) {
this.operator = operator;
return this;
}
public String getOperator() {
return this.operator;
}
public QueryLDCFlowRecordResponseBodyData setPushTime(String pushTime) {
this.pushTime = pushTime;
return this;
}
public String getPushTime() {
return this.pushTime;
}
public QueryLDCFlowRecordResponseBodyData setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public String getResultCode() {
return this.resultCode;
}
public QueryLDCFlowRecordResponseBodyData setResultMsg(String resultMsg) {
this.resultMsg = resultMsg;
return this;
}
public String getResultMsg() {
return this.resultMsg;
}
public QueryLDCFlowRecordResponseBodyData setRuleType(String ruleType) {
this.ruleType = ruleType;
return this;
}
public String getRuleType() {
return this.ruleType;
}
public QueryLDCFlowRecordResponseBodyData setValue(String value) {
this.value = value;
return this;
}
public String getValue() {
return this.value;
}
public QueryLDCFlowRecordResponseBodyData setApps(java.util.List<String> apps) {
this.apps = apps;
return this;
}
public java.util.List<String> getApps() {
return this.apps;
}
public QueryLDCFlowRecordResponseBodyData setTargets(java.util.List<String> targets) {
this.targets = targets;
return this;
}
public java.util.List<String> getTargets() {
return this.targets;
}
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
1ce93445b2ef56d9ebab2c365ed165001f5ba3f1
|
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
|
/Code Snippet Repository/Spring/Spring12872.java
|
ff5d939f61fd4eead222367bc3cf293179730320
|
[] |
no_license
|
saber13812002/DeepCRM
|
3336a244d4852a364800af3181e03e868cf6f9f5
|
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
|
refs/heads/master
| 2023-03-16T00:08:06.473699
| 2018-04-18T05:29:50
| 2018-04-18T05:29:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 505
|
java
|
@Test
public void shouldHandleInvalidIfNoneMatchWithHttp200() throws Exception {
String etagValue = "\"deadb33f8badf00d\"";
servletRequest.addHeader(HttpHeaders.IF_NONE_MATCH, "unquoted");
ResponseEntity<String> returnValue = ResponseEntity.ok().eTag(etagValue).body("body");
initStringMessageConversion(MediaType.TEXT_PLAIN);
processor.handleReturnValue(returnValue, returnTypeResponseEntity, mavContainer, webRequest);
assertConditionalResponse(HttpStatus.OK, "body", etagValue, -1);
}
|
[
"Qing.Mi@my.cityu.edu.hk"
] |
Qing.Mi@my.cityu.edu.hk
|
ff25d24e08e0601c0a3af38f6fe72c798f9c2eff
|
c993f8fa180a11fc98a2e1a0424e6a07e2b83cf5
|
/src/main/java/com/github/jengo/java/program/design10/TestArrayListNew.java
|
146f497a3b24c25dd97b86191d99fd80e579f613
|
[
"Apache-2.0"
] |
permissive
|
jengowong/java_program_design_10
|
a894412b410b9b1769882aff5f789a00b6edbd66
|
217737454bd764dfdd72a6873a6bc31af8f36930
|
refs/heads/master
| 2021-01-19T10:10:58.933964
| 2019-09-19T01:54:49
| 2019-09-19T01:54:49
| 82,166,516
| 0
| 0
|
Apache-2.0
| 2020-10-12T20:15:04
| 2017-02-16T10:02:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,733
|
java
|
package com.github.jengo.java.program.design10;
import java.util.ArrayList;
public class TestArrayListNew {
public static void main(String[] args) {
// Create a list to store cities
ArrayList<String> cityList = new ArrayList<String>();
// Add some cities in the list
cityList.add("London");
cityList.add("New York");
cityList.add("Paris");
cityList.add("Toronto");
cityList.add("Hong Kong");
cityList.add("Singapore");
System.out.println("List size? " + cityList.size());
System.out.println("Is Toronto in the list? " +
cityList.contains("Toronto"));
System.out.println("The location of New York in the list? "
+ cityList.indexOf("New York"));
System.out.println("Is the list empty? " +
cityList.isEmpty()); // Print false
// Insert a new city at index 2
cityList.add(2, "Beijing");
// Remove a city from the list
cityList.remove("Toronto");
// Remove a city at index 1
cityList.remove(1);
// Display London Beijing Paris Hong Kong Singapore
for (int i = 0; i < cityList.size(); i++)
System.out.print(cityList.get(i) + " ");
System.out.println();
// Create a list to store two circles
ArrayList<Circle> list = new ArrayList<Circle>();
// Add a circle and a cylinder
list.add(new Circle(2));
list.add(new Circle(3));
// Display the area of the first circle in the list
System.out.println("The area of the circle? " +
((Circle) list.get(0)).getArea());
}
}
|
[
"wangzhenguo02@meituan.com"
] |
wangzhenguo02@meituan.com
|
11d5eb819589e49536a29aa10df1abde5c37c930
|
1e3ec34d42f65c31c8f59ca172250d57af1f9db5
|
/src/com/emerson/accountApi/GetAccountwishlists.java
|
d933dcfaf0abf3566f086ecf319e82c7281157f6
|
[] |
no_license
|
vivekimpressico/GitRepoSel
|
04a762751466f4aa15a85a1a97c248ff510ee46c
|
ec0187e60145e0cd816f80a29495e79479ad9bdc
|
refs/heads/master
| 2021-01-19T22:56:48.533235
| 2017-04-29T20:40:49
| 2017-04-29T20:40:49
| 88,898,479
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,353
|
java
|
package com.emerson.accountApi;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import com.emerson.APIBaseData;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.testng.annotations.Test;
import com.google.gson.JsonObject;
import com.wellevate.utilities.ExcelReaderExpected;
import com.wellevate.utilities.GenericsMethods;
import com.wellevate.utilities.SoftAssertions;
import net.iharder.Base64;
public class GetAccountwishlists extends APIBaseData {
static APIBaseData api = new APIBaseData();
File file = new File("src\\com\\wellevate\\configuration\\ApiValue.properties");
static HashMap<String, String> response;
static HashMap<String, String> response1;
GenericsMethods genericMethods = new GenericsMethods();
ArrayList<String> brand;
HashMap map = new HashMap();
public static JsonObject parameterList;
ExcelReaderExpected excel = new ExcelReaderExpected();
int i = 0;
public static HttpResponse responseApi;
@Test(priority = 1)
public void AccountwishlistsWithoutToken() throws Exception {
try {
URL url1 = new URL("http://qa-aresapi.emersonecologics.com/account/wishlists");
HttpURLConnection connection1 = (HttpURLConnection) url1.openConnection();
connection1.setRequestMethod("GET");
connection1.connect();
int code1 = connection1.getResponseCode();
System.out.println("Response code of the object is " + code1);
if (code1 == 20000) {
System.out.println("OK");
SoftAssertions.verifyEqualsApi(code1, 20000, "Response code is :" + code1,
"Wrong Response code is :" + code1);
} else {
SoftAssertions.verifyEqualsApi(code1, 401, "Response code is :" + code1,
"Wrong Response code is :" + code1);
}
} catch (Exception e) {
// TODO: handle exception
}
SoftAssertions.throwAsserationOnFailure();
}
@org.testng.annotations.Test(priority = 2)
@SuppressWarnings({ "static-access", "unused" })
public void CodeForAccountWrightEmailId() throws InterruptedException, ClientProtocolException, IOException {
String auth_token = getUserAuthToken();
HttpGet request = new HttpGet("http://qa-aresapi.emersonecologics.com/account/wishlists");
request.addHeader("Content-Type", "application/json");
request.addHeader("authorization", "Bearer " + auth_token);
responseApi = client.execute(request);
int code = responseApi.getStatusLine().getStatusCode();
System.out.println("Response code of the object is " + code);
if (code == 20000) {
System.out.println("OK");
SoftAssertions.verifyEqualsApi(code, 20000, "Response code is :" + code, "Wrong Response code is :" + code);
} else {
SoftAssertions.verifyEqualsApi(code, 401, "Response code is :" + code, "Wrong Response code is :" + code);
}
response = APIBaseData.getData(request);
String wishListId = response.get("response_currentPage_0_wishListId");
String listName = response.get("response_currentPage_0_listName");
SoftAssertions.verifyEqualsApi(wishListId, "8652", " wishListId matches", "wishListId not matches");
SoftAssertions.verifyEqualsApi(listName, "Special Orders", "listName matches", "listName is not matches");
SoftAssertions.throwAsserationOnFailure();
}
}
|
[
"email@example.com"
] |
email@example.com
|
74eb4c74e0fe45f59294306ebd587073ec66728c
|
f38abeabc68bcc469ee82167e3016328066b3923
|
/src/day15jdbc01/JdbcDemo01.java
|
5cd3d7a8d2bfea3cfc99df92a1220b50cbe4187e
|
[] |
no_license
|
Leader0721/JavaStudyDemo
|
673207f46efe0ba5fd8ad2092e8839d324fc7dda
|
55708d2969b99127c6df3295be3b890673193fce
|
refs/heads/master
| 2021-05-06T17:20:30.155192
| 2017-11-23T14:56:13
| 2017-11-23T14:56:13
| 111,821,897
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,243
|
java
|
package day15jdbc01;
import java.sql.*;
/**
* Created by 83731 on 2017/09/17.
* create table users(
* id int primary key auto_increment,
* name varchar(40),
* password varchar(40),
* email varchar(60),
* birthday date
* )character set utf8 collate utf8_general_ci;
* insert into users(name,password,email,birthday) values('zs','123456','zs@sina.com','1980-12-04');
* insert into users(name,password,email,birthday) values('lisi','123456','lisi@sina.com','1981-12-04');
* insert into users(name,password,email,birthday) values('wangwu','123456','wangwu@sina.com','1979-12-04');
* <p>
* <p>
* <p>
* JDBC的编码步骤
* 查询users表中的所有的数据 打印到控制台上
*/
public class JdbcDemo01 {
public static void main(String[] args) throws SQLException {
// 1.注册驱动
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
// 2.获取和数据库的链接
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/day15", "root", "123456");
System.out.println(conn.getClass().getName());//如果想要知道驱动的具体类型,就这样进行打印
// 3.创建代表SQL语句的对象
Statement statement = conn.createStatement();
// 4.执行SQL语句
ResultSet resultSet = statement.executeQuery("select id,name,password,email,birthday from users");
// 5.如果是查询语句,需要遍历结果集
while (resultSet.next()) {
System.out.println(resultSet.getObject("id"));//如果想要知道驱动的具体类型,就这样进行打印
System.out.println(resultSet.getObject("name"));//如果想要知道驱动的具体类型,就这样进行打印
System.out.println(resultSet.getObject("password"));//如果想要知道驱动的具体类型,就这样进行打印
System.out.println(resultSet.getObject("email"));//如果想要知道驱动的具体类型,就这样进行打印
System.out.println(resultSet.getObject("birthday"));//如果想要知道驱动的具体类型,就这样进行打印
}
// 6.释放占用的资源
resultSet.close();
statement.close();
conn.close();
}
}
|
[
"18410133533@163.com"
] |
18410133533@163.com
|
d98d25c7a82bfe054aa4bf673a6c99ab68825ddf
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-kms/src/main/java/com/aliyuncs/kms/model/v20160120/UpdateCertificateStatusRequest.java
|
21c0c74bebd33c2352ddbfd7e972a3194a95c5c7
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286
| 2023-09-01T09:03:00
| 2023-09-01T09:03:00
| 39,555,898
| 1,542
| 1,317
|
NOASSERTION
| 2023-09-14T07:27:05
| 2015-07-23T08:41:13
|
Java
|
UTF-8
|
Java
| false
| false
| 1,990
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.kms.model.v20160120;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.ProtocolType;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.kms.Endpoint;
/**
* @author auto create
* @version
*/
public class UpdateCertificateStatusRequest extends RpcAcsRequest<UpdateCertificateStatusResponse> {
private String certificateId;
private String status;
public UpdateCertificateStatusRequest() {
super("Kms", "2016-01-20", "UpdateCertificateStatus", "kms");
setProtocol(ProtocolType.HTTPS);
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public String getCertificateId() {
return this.certificateId;
}
public void setCertificateId(String certificateId) {
this.certificateId = certificateId;
if(certificateId != null){
putQueryParameter("CertificateId", certificateId);
}
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
if(status != null){
putQueryParameter("Status", status);
}
}
@Override
public Class<UpdateCertificateStatusResponse> getResponseClass() {
return UpdateCertificateStatusResponse.class;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
39bd3737ca27f315ce49dd4e526e10c7a3be7b7f
|
c6a852f5f4ea5b665638eb1e2176a1c3f52f174e
|
/IntegralWall/src/com/marck/common/QueryService.java
|
c539eb82712d478b4e532664eb8874dce4d600bc
|
[] |
no_license
|
FreeDao/private
|
92507aef24e4254f87e78dbb03a0854f979faad6
|
45cfcbc0feb6efe7f7fe2a0545942a7e4c6df914
|
refs/heads/master
| 2020-12-26T00:25:03.242039
| 2014-08-30T18:40:38
| 2014-08-30T18:40:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,794
|
java
|
package com.marck.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.marck.common.dao.HDB;
import com.marck.common.model.Apply;
import com.marck.common.model.User;
import com.marck.common.model.UserIntergral;
import com.marck.common.model.UserIntergralQuery;
@Component("queryService")
@Transactional(readOnly = true,propagation=Propagation.REQUIRED)
public class QueryService {
@Autowired
private HDB hdb;
public Boolean checkPassword(String password) {
// TODO Auto-generated method stub
try {
String hql = "from User u where u.phone ='admin'";
List<User> users = (List<User>) hdb.findHql(hql);
if(users.size() > 0){
if( users.get(0).getPassword().equals(CommonUtil.Md5(password))){
return true;
}else{
return false;
}
}else{
return false;
}
} catch (Exception e) {
// TODO: handle exception
return false;
}
}
public PageUtil findAccountList(String queryValue, Integer pageNow,
Integer limit) {
// TODO Auto-generated method stub.
String hql = "from User u where u.phone <> 'admin' ";
if(!CommonUtil.validParams(queryValue)){
hql += " and ( u.phone like '%"+queryValue+"%' or u.integral like '%"+queryValue+"%' or u.lastlogin like '%"+queryValue+"%')";
}
PageUtil pu = hdb.findHql(hql, pageNow, limit);
for(User u : (List<User>)pu.getData()){
String sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 1 and ui.userId ="+u.getId();
u.setSx( (Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 2 and ui.userId ="+u.getId();
u.setJp((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 3 and ui.userId ="+u.getId();
u.setDl((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 4 and ui.userId ="+u.getId();
u.setMd((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 5 and ui.userId ="+u.getId();
u.setDm((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 6 and ui.userId ="+u.getId();
u.setMp((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 7 and ui.userId ="+u.getId();
u.setAw((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 8 and ui.userId ="+u.getId();
u.setYm((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 9 and ui.userId ="+u.getId();
u.setYjf((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 10 and ui.userId ="+u.getId();
u.setCk((Double) hdb.findUniqueSql(sql));
sql = "select sum(ui.intergral) from userintergral ui where ui.platform = 11 and ui.userId ="+u.getId();
u.setLm((Double) hdb.findUniqueSql(sql));
}
return pu;
}
public PageUtil findApplyList(String queryValue, Integer pageNow,
Integer limit) {
// TODO Auto-generated method stub
String hql = "select a from Apply a,User u where a.userId = u.id ";
if(!CommonUtil.validParams(queryValue)){
hql += " and ( a.alipay like '%"+queryValue+"%' or a.id like '%"+queryValue+"%' or a.userId like '%"+queryValue+"%' or a.alipay like '%"+queryValue+"%' or a.num like '%"+queryValue+"%' or a.name like '%"+queryValue+"%' or a.addTime like '%"+queryValue+"%' or u.phone like '%"+queryValue+"%') ";
}
hql += " order by a.status asc";
PageUtil pu = hdb.findHql(hql, pageNow, limit);
for(Apply a : (List<Apply>)pu.getData()){
User u = (User) hdb.find(User.class, a.getUserId());
a.setAccount(u.getPhone());
a.setIntegral(u.getIntegral());
}
return pu;
}
@Transactional(readOnly = false,propagation=Propagation.REQUIRED)
public void delAccount(Integer id) {
// TODO Auto-generated method stub
String hql ="from Apply a where a.userId = "+id;
List<Apply> as = (List<Apply>) hdb.findHql(hql);
for(Apply a : as){
hdb.delete(a);
}
hql ="from UserIntergral ui where ui.userId = "+id;
List<UserIntergral> uis = (List<UserIntergral>) hdb.findHql(hql);
for(UserIntergral ui : uis){
hdb.delete(ui);
}
User u = (User) hdb.find(User.class, id);
hdb.delete(u);
}
@Transactional(readOnly = false,propagation=Propagation.REQUIRED)
public void delApply(Integer id) {
// TODO Auto-generated method stub
Apply a = (Apply) hdb.find(Apply.class, id);
a.setStatus(1);
hdb.saveOrUpdate(a);
}
public void myStatistics(String type, String timestart, String timeend, String qd, String username, Map<String, Object> map) {
// TODO Auto-generated method stub
String sql = "";
if( type.equals("3")){
sql = "select count(*),sum(ui.intergral) from userintergral ui,user u where ui.userId=u.id and u.phone like '"+username+"%'";
}else{
sql = "select count(*),sum(ui.intergral) from userintergral ui where 1=1 ";
}
if( type.equals("2")){
sql += " and ui.platform ='"+Integer.parseInt(qd)+"'";
}
if(!CommonUtil.validParams(timestart)){
sql += " and ui.time >='"+timestart+"'";
}
if(!CommonUtil.validParams(timeend)){
sql += " and ui.time <='"+timeend+"'";
}
List<Object[]> objs = (List<Object[]>) hdb.findSql(sql);
map.put("num", objs.get(0)[0]);
map.put("integral", objs.get(0)[1]);
}
}
|
[
"215757815@qq.com"
] |
215757815@qq.com
|
cd8332170fd35fa5f11e54b0fa054728a6153b24
|
d3cc35c159af7a74624338d253b0af0f53a17b3c
|
/src/ba/bitcamp/homework/Emir/generics/CollectionUtilsTest.java
|
14bb759213049804e74617c16dc49a8bf84e0449
|
[] |
no_license
|
Amra7/ZADACA_S10
|
5b3f41c47f288f18a91297323d29e37015bb6500
|
af6120677d489119e758258ab996eda4dbc2a7f4
|
refs/heads/master
| 2021-01-16T21:16:34.815759
| 2015-01-19T08:16:04
| 2015-01-19T08:16:13
| 29,311,988
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,852
|
java
|
package ba.bitcamp.homework.Emir.generics;
import java.util.ArrayList;
import java.util.Collection;
public class CollectionUtilsTest {
public static void main(String[] args) {
ArrayList<String> names = new ArrayList<String>();
names.add("test");
names.add(null);
names.add("another test");
// before cleanup
System.out.println("Before cleanup: " + names);
int removed = CollectionUtils.removeNulls(names);
System.out.println("Removed: " + removed);
System.out.println("After cleanup: " + names);
Collection<String> prefixedRaw = CollectionUtils.withPrefixRaw(names, "te");
System.out.println("Prefixed raw: " + prefixedRaw);
Collection<String> prefixed = CollectionUtils.withPrefix(names, "te");
System.out.println("Prefixed: " + prefixed);
names.add(null);
System.out.println("\nAdded null: " + names);
//need to cast
Collection<String> cleanedNames = (Collection<String>)CollectionUtils.toCleanedRaw(names);
System.out.println("Cleaned raw: " + cleanedNames);
System.out.println("\nStill have null: " + names);
cleanedNames = CollectionUtils.toCleaned(names);
System.out.println("Cleaned parameterized: " + cleanedNames);
// check duplicates
System.out.println("\nHas duplicates names: " + CollectionUtils.hasDuplicates(names));
System.out.println("Has duplicates cleaned: " + CollectionUtils.hasDuplicates(cleanedNames));
names.add(null);
System.out.println("\nDuplicate null: " + names);
System.out.println("Has duplicates names: " + CollectionUtils.hasDuplicates(names));
cleanedNames.add("test");
System.out.println("\nDuplicate test: " + cleanedNames);
System.out.println("Has duplicates cleaned: " + CollectionUtils.hasDuplicates(cleanedNames));
System.out.println("\nFirst duplicate value: " + CollectionUtils.firstDuplicateValue(cleanedNames));
}
}
|
[
"amrapop@gmail.com"
] |
amrapop@gmail.com
|
49e78cae7c51a862345951fc3ee3efacf3c3ca02
|
e9814144d06806fe1456e6326538b8d132933f0a
|
/demos/java300/GOF23/BehaviorMode/TemplateMethodMode/Example.java
|
87425c02e3bf2ea810224c82b54928134709f5a7
|
[] |
no_license
|
oudream/hello-java
|
e64102923e2795505b58e3291338c3188d4768a7
|
9766c65e7a2ae81fde7edb05cf01a82b102922d6
|
refs/heads/master
| 2021-08-15T01:58:27.785384
| 2021-08-08T05:12:22
| 2021-08-08T05:12:22
| 228,291,829
| 1
| 0
| null | 2020-10-14T00:14:51
| 2019-12-16T03:05:30
|
Java
|
UTF-8
|
Java
| false
| false
| 278
|
java
|
package GOF23.BehaviorMode.TemplateMethodMode;
/**
* 说明:实例化方法
*
* @Auther: 11432_000
* @Date: 2019/1/29 14:40
* @Description:
*/
public class Example extends Tempalte{
@Override
public void second() {
System.out.println("冲茶");
}
}
|
[
"oudream@126.com"
] |
oudream@126.com
|
7225cca4e8f6b9674c3f26e9720ad70633870596
|
52eb55e4b1253d9246b581249a4d338fcd2df075
|
/org.mbari.kb.core/src/main/java/org/mbari/kb/core/VARSPersistenceException.java
|
fe6034baa681beee6bda3a7b4da5e29d60fae529
|
[
"Apache-2.0"
] |
permissive
|
mbari-media-management/vars-kb
|
fa8fe56fcd435910528bd76e27be8411ba33dd5b
|
bc487bb7e10e5d792e7d900f1fdc7588741a6830
|
refs/heads/master
| 2023-02-20T15:23:33.226887
| 2023-02-14T22:13:53
| 2023-02-14T22:13:53
| 90,171,500
| 0
| 0
| null | 2017-05-03T16:43:00
| 2017-05-03T16:43:00
| null |
UTF-8
|
Java
| false
| false
| 603
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mbari.kb.core;
/**
* Thrown when something bad happens in the DataPersistenceService
* @author brian
*/
public class VARSPersistenceException extends VARSException {
public VARSPersistenceException(Throwable throwable) {
super(throwable);
}
public VARSPersistenceException(String s, Throwable throwable) {
super(s, throwable);
}
public VARSPersistenceException(String s) {
super(s);
}
public VARSPersistenceException() {
}
}
|
[
"bschlining@gmail.com"
] |
bschlining@gmail.com
|
480b79fdaa1c63b4dafbbe0d7a3777a7049dc8a9
|
d7de50fc318ff59444caabc38d274f3931349f19
|
/src/com/fasterxml/jackson/databind/ser/BeanPropertyFilter.java
|
d47ebdcb6fffee025dd291220e61e8480385f227
|
[] |
no_license
|
reverseengineeringer/fr.dvilleneuve.lockito
|
7bbd077724d61e9a6eab4ff85ace35d9219a0246
|
ad5dbd7eea9a802e5f7bc77e4179424a611d3c5b
|
refs/heads/master
| 2021-01-20T17:21:27.500016
| 2016-07-19T16:23:04
| 2016-07-19T16:23:04
| 63,709,932
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,204
|
java
|
package com.fasterxml.jackson.databind.ser;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
import com.fasterxml.jackson.databind.node.ObjectNode;
@Deprecated
public abstract interface BeanPropertyFilter
{
public abstract void depositSchemaProperty(BeanPropertyWriter paramBeanPropertyWriter, JsonObjectFormatVisitor paramJsonObjectFormatVisitor, SerializerProvider paramSerializerProvider)
throws JsonMappingException;
@Deprecated
public abstract void depositSchemaProperty(BeanPropertyWriter paramBeanPropertyWriter, ObjectNode paramObjectNode, SerializerProvider paramSerializerProvider)
throws JsonMappingException;
public abstract void serializeAsField(Object paramObject, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, BeanPropertyWriter paramBeanPropertyWriter)
throws Exception;
}
/* Location:
* Qualified Name: com.fasterxml.jackson.databind.ser.BeanPropertyFilter
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
5ed86631ef63d8ade0d45471cfbf543e2907d88b
|
6d943c9f546854a99ae27784d582955830993cee
|
/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v202002/ForecastServiceLocator.java
|
b991d629744cd11e9443d7aa27a2ac4f154c7d22
|
[
"Apache-2.0"
] |
permissive
|
MinYoungKim1997/googleads-java-lib
|
02da3d3f1de3edf388a3f2d3669a86fe1087231c
|
16968056a0c2a9ea1676b378ab7cbfe1395de71b
|
refs/heads/master
| 2021-03-25T15:24:24.446692
| 2020-03-16T06:36:10
| 2020-03-16T06:36:10
| 247,628,741
| 0
| 0
|
Apache-2.0
| 2020-03-16T06:36:35
| 2020-03-16T06:36:34
| null |
UTF-8
|
Java
| false
| false
| 6,532
|
java
|
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* ForecastServiceLocator.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.admanager.axis.v202002;
public class ForecastServiceLocator extends org.apache.axis.client.Service implements com.google.api.ads.admanager.axis.v202002.ForecastService {
public ForecastServiceLocator() {
}
public ForecastServiceLocator(org.apache.axis.EngineConfiguration config) {
super(config);
}
public ForecastServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
super(wsdlLoc, sName);
}
// Use to get a proxy class for ForecastServiceInterfacePort
private java.lang.String ForecastServiceInterfacePort_address = "https://ads.google.com/apis/ads/publisher/v202002/ForecastService";
public java.lang.String getForecastServiceInterfacePortAddress() {
return ForecastServiceInterfacePort_address;
}
// The WSDD service name defaults to the port name.
private java.lang.String ForecastServiceInterfacePortWSDDServiceName = "ForecastServiceInterfacePort";
public java.lang.String getForecastServiceInterfacePortWSDDServiceName() {
return ForecastServiceInterfacePortWSDDServiceName;
}
public void setForecastServiceInterfacePortWSDDServiceName(java.lang.String name) {
ForecastServiceInterfacePortWSDDServiceName = name;
}
public com.google.api.ads.admanager.axis.v202002.ForecastServiceInterface getForecastServiceInterfacePort() throws javax.xml.rpc.ServiceException {
java.net.URL endpoint;
try {
endpoint = new java.net.URL(ForecastServiceInterfacePort_address);
}
catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
return getForecastServiceInterfacePort(endpoint);
}
public com.google.api.ads.admanager.axis.v202002.ForecastServiceInterface getForecastServiceInterfacePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
try {
com.google.api.ads.admanager.axis.v202002.ForecastServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v202002.ForecastServiceSoapBindingStub(portAddress, this);
_stub.setPortName(getForecastServiceInterfacePortWSDDServiceName());
return _stub;
}
catch (org.apache.axis.AxisFault e) {
return null;
}
}
public void setForecastServiceInterfacePortEndpointAddress(java.lang.String address) {
ForecastServiceInterfacePort_address = address;
}
/**
* For the given interface, get the stub implementation.
* If this service has no port for the given interface,
* then ServiceException is thrown.
*/
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.admanager.axis.v202002.ForecastServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.admanager.axis.v202002.ForecastServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v202002.ForecastServiceSoapBindingStub(new java.net.URL(ForecastServiceInterfacePort_address), this);
_stub.setPortName(getForecastServiceInterfacePortWSDDServiceName());
return _stub;
}
}
catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
}
/**
* For the given interface, get the stub implementation.
* If this service has no port for the given interface,
* then ServiceException is thrown.
*/
public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
if (portName == null) {
return getPort(serviceEndpointInterface);
}
java.lang.String inputPortName = portName.getLocalPart();
if ("ForecastServiceInterfacePort".equals(inputPortName)) {
return getForecastServiceInterfacePort();
}
else {
java.rmi.Remote _stub = getPort(serviceEndpointInterface);
((org.apache.axis.client.Stub) _stub).setPortName(portName);
return _stub;
}
}
public javax.xml.namespace.QName getServiceName() {
return new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202002", "ForecastService");
}
private java.util.HashSet ports = null;
public java.util.Iterator getPorts() {
if (ports == null) {
ports = new java.util.HashSet();
ports.add(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202002", "ForecastServiceInterfacePort"));
}
return ports.iterator();
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("ForecastServiceInterfacePort".equals(portName)) {
setForecastServiceInterfacePortEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
setEndpointAddress(portName.getLocalPart(), address);
}
}
|
[
"christopherseeley@users.noreply.github.com"
] |
christopherseeley@users.noreply.github.com
|
33df534900180adb3d7be87d158917c0c76582fd
|
6d109557600329b936efe538957dfd0a707eeafb
|
/src/com/google/api/ads/dfp/v201306/CreativeSetServiceInterface.java
|
b16e57f85f09610960083e1c06211a001c841184
|
[
"Apache-2.0"
] |
permissive
|
google-code-export/google-api-dfp-java
|
51b0142c19a34cd822a90e0350eb15ec4347790a
|
b852c716ef6e5d300363ed61e15cbd6242fbac85
|
refs/heads/master
| 2020-05-20T03:52:00.420915
| 2013-12-19T23:08:40
| 2013-12-19T23:08:40
| 32,133,590
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,020
|
java
|
/**
* CreativeSetServiceInterface.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.v201306;
public interface CreativeSetServiceInterface extends java.rmi.Remote {
/**
* Creates a new {@link CreativeSet}.
*
*
* @param creativeSet the creative set to create
*
* @return the creative set with its ID filled in
*/
public com.google.api.ads.dfp.v201306.CreativeSet createCreativeSet(com.google.api.ads.dfp.v201306.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException;
/**
* Returns the {@link CreativeSet} uniquely identified by the
* given ID.
*
*
* @param creativeSetId the ID of the creative set, which must already
* exist
*
* @return the {@code CreativeSet} uniquely identified by the given ID
*/
public com.google.api.ads.dfp.v201306.CreativeSet getCreativeSet(java.lang.Long creativeSetId) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException;
/**
* Gets a {@link CreativeSetPage} of {@link CreativeSet} objects
* that satisfy the
* given {@link Statement#query}. The following fields are supported
* for
* filtering:
*
* <table>
* <tr>
* <th scope="col">PQL Property</th> <th scope="col">Object Property</th>
* </tr>
* <tr>
* <td>{@code id}</td>
* <td>{@link CreativeSet#id}</td>
* </tr>
* <tr>
* <td>{@code name}</td>
* <td>{@link CreativeSet#name}</td>
* </tr>
* <tr>
* <td>{@code masterCreativeId}</td>
* <td>{@link CreativeSet#masterCreativeId}</td>
* </tr>
* <tr>
* <td>{@code lastModifiedDateTime}</td>
* <td>{@link CreativeSet#lastModifiedDateTime}</td>
* </tr>
* </table>
*
*
* @param filterStatement a Publisher Query Language statement used to
* filter
* a set of creative sets
*
* @return the creative sets that match the given filter
*/
public com.google.api.ads.dfp.v201306.CreativeSetPage getCreativeSetsByStatement(com.google.api.ads.dfp.v201306.Statement statement) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException;
/**
* Updates the specified {@link CreativeSet}.
*
*
* @param creativeSet the creative set to update
*
* @return the updated creative set
*/
public com.google.api.ads.dfp.v201306.CreativeSet updateCreativeSet(com.google.api.ads.dfp.v201306.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException;
}
|
[
"api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098"
] |
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
|
de9dcb10642e6f565a3f7d56e9f5e98d6a013459
|
3f605d058523f0b1e51f6557ed3c7663d5fa31d6
|
/eclipse/plugins/org.ebayopensource.vjet.eclipse.ui/src/org/ebayopensource/vjet/eclipse/internal/ui/typehierarchy/EnableMemberFilterAction.java
|
30c0f41639d38b02d7f69c281c2e8c01dcaba051
|
[] |
no_license
|
vjetteam/vjet
|
47e21a13978cd860f1faf5b0c2379e321a9b688c
|
ba90843b89dc40d7a7eb289cdf64e127ec548d1d
|
refs/heads/master
| 2020-12-25T11:05:55.420303
| 2012-08-07T21:56:30
| 2012-08-07T21:56:30
| 3,181,492
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,099
|
java
|
/*******************************************************************************
* Copyright (c) 2005-2011 eBay Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.ebayopensource.vjet.eclipse.internal.ui.typehierarchy;
import org.eclipse.dltk.mod.ui.DLTKPluginImages;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.custom.BusyIndicator;
/**
* Action enable / disable member filtering
*/
public class EnableMemberFilterAction extends Action {
private VJOTypeHierarchyViewPart fView;
public EnableMemberFilterAction(VJOTypeHierarchyViewPart v, boolean initValue) {
super(TypeHierarchyMessages.EnableMemberFilterAction_label);
setDescription(TypeHierarchyMessages.EnableMemberFilterAction_description);
setToolTipText(TypeHierarchyMessages.EnableMemberFilterAction_tooltip);
DLTKPluginImages.setLocalImageDescriptors(this, "impl_co.gif"); //$NON-NLS-1$
fView= v;
setChecked(initValue);
//PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.ENABLE_METHODFILTER_ACTION);
}
/*
* @see Action#actionPerformed
*/
public void run() {
BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable() {
public void run() {
fView.enableMemberFilter(isChecked());
}
});
}
}
|
[
"pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6"
] |
pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6
|
33d1b7a5ba298bdf1293f88ecb827e90f9450592
|
2943f233ac0e073f585c9142f5ff66ecba7d8b13
|
/MessageStore/src/main/java/jpa/data/preload/RuleNameEnum.java
|
031d4872a34bca5b46e681809770047715151e53
|
[] |
no_license
|
barbietunnie/jboss-5-to-7-migration
|
1a519afeee052cf02c51823b5bf2003d99056112
|
675e33b8510ca09e7efdb5ca63ccb73c93abba8a
|
refs/heads/master
| 2021-01-10T18:40:13.068747
| 2015-05-29T19:01:26
| 2015-05-29T19:01:26
| 57,383,835
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,161
|
java
|
package jpa.data.preload;
import java.util.ArrayList;
import java.util.List;
import jpa.constant.RuleCategory;
import jpa.constant.RuleType;
//
// define SMTP Built-in Rule Types
//
public enum RuleNameEnum {
/*
* From MessageParserBo, when no rules were matched
*/
GENERIC("Generic", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Non bounce or system could not recognize it"), // default rule name for SMTP Email
/*
* From RFC Scan routine, rule reassignment, or custom routine
*/
HARD_BOUNCE("Hard Bounce", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "From RFC Scan Routine, or from postmaster with sub-rules"), // Hard bounce - suspend,notify,close
SOFT_BOUNCE("Soft Bounce", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Soft bounce, from RFC scan routine"), // Soft bounce - bounce++,close
MAILBOX_FULL("Mailbox Full", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Mailbox full from postmaster with sub-rules"), // treated as Soft Bounce
SIZE_TOO_LARGE("Size Too Large", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Message size too large"), // message length exceeded administrative limit, treat as Soft Bounce
MAIL_BLOCK("Mail Block", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Bounced from Bulk Email Filter"), // message content rejected, treat as Soft Bounce
SPAM_BLOCK("Spam Block", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Spam blocker"), // blocked by SPAM filter,
VIRUS_BLOCK("Virus Block", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Virus blocker"), // blocked by Virus Scan,
CHALLENGE_RESPONSE("Challenge Response", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Challenge Response"), // human response needed
AUTO_REPLY("Auto Reply", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Auto reply from email sender software"), // automatic response from mail sender
CC_USER("Carbon Copies", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "From scan routine, message received as recipient of CC or BCC"), // Mail received from a CC address, drop
MDN_RECEIPT("MDN Receipt", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "From RFC scan, Message Delivery Notification, a positive receipt"), // MDN - read receipt, drop
UNSUBSCRIBE("Unsubscribe", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Remove from a mailing list"), // remove from mailing list
SUBSCRIBE("Subscribe", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Subscribe to a mailing list"), // add to mailing list
/*
* From rule reassignment or custom routine
*/
CSR_REPLY("CSR Reply", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only, reply message from CSR
RMA_REQUEST("RMA Request", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "RMA request, internal only"), // internal only
BROADCAST("Broadcast", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only
SEND_MAIL("Send Mail", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only
/*
* Custom rules
*/
UNATTENDED_MAILBOX("Unattended_Mailbox", RuleType.ALL, RuleCategory.PRE_RULE, false, false, "Simply get rid of the messages from the mailbox."),
OUF_OF_OFFICE_AUTO_REPLY("OutOfOffice_AutoReply", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Ouf of the office auto reply"),
CONTACT_US("Contact_Us", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Contact Us Form submitted from web site"),
XHEADER_SPAM_SCORE("XHeader_SpamScore", RuleType.SIMPLE, RuleCategory.MAIN_RULE, false, false, "Examine x-headers for SPAM score."),
EXECUTABLE_ATTACHMENT("Executable_Attachment", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Emails with executable attachment file(s)"),
HARD_BOUNCE_WATCHED_MAILBOX("HardBouce_WatchedMailbox", RuleType.ALL, RuleCategory.POST_RULE, false, false, "Post rule for hard bounced emails."),
HARD_BOUNCE_NO_FINAL_RCPT("HardBounce_NoFinalRcpt", RuleType.ALL, RuleCategory.POST_RULE, false, false, "Post rule for hard bounces without final recipient."),
/*
* Sub rules
*/
HardBounce_Subj_Match("HardBounce_Subj_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for hard bounces from postmaster"),
HardBounce_Body_Match("HardBounce_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for hard bounces from postmaster"),
MailboxFull_Body_Match("MailboxFull_Body_Match", RuleType.ALL, RuleCategory.MAIN_RULE, true, true, "Sub rule for mailbox full"),
SpamBlock_Body_Match("SpamBlock_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for spam block"),
VirusBlock_Body_Match("VirusBlock_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for virus block"),
ChalResp_Body_Match("ChalResp_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for challenge response");
private final String value;
private final RuleType ruleType;
private RuleCategory ruleCategory;
private boolean isBuiltin;
private boolean isSubrule;
private final String description;
private RuleNameEnum(String value, RuleType ruleType,
RuleCategory ruleCategory, boolean isBuiltin, boolean isSubrule,
String description) {
this.value = value;
this.ruleType = ruleType;
this.ruleCategory = ruleCategory;
this.isBuiltin = isBuiltin;
this.isSubrule = isSubrule;
this.description = description;
}
public static RuleNameEnum getByValue(String value) {
for (RuleNameEnum rule : RuleNameEnum.values()) {
if (rule.getValue().equalsIgnoreCase(value)) {
return rule;
}
}
throw new IllegalArgumentException("No enum const found by value (" + value + ")");
}
private static final List<RuleNameEnum> builtinRules = new ArrayList<RuleNameEnum>();
public static List<RuleNameEnum> getBuiltinRules() {
if (builtinRules.isEmpty()) {
synchronized (builtinRules) {
for (RuleNameEnum rn : RuleNameEnum.values()) {
if (rn.isBuiltin && !rn.isSubrule) {
builtinRules.add(rn);
}
}
}
}
return builtinRules;
}
private static final List<RuleNameEnum> customRules = new ArrayList<RuleNameEnum>();
public static List<RuleNameEnum> getCustomRules() {
if (customRules.isEmpty()) {
synchronized (customRules) {
for (RuleNameEnum rn : RuleNameEnum.values()) {
if (!rn.isBuiltin && !rn.isSubrule) {
customRules.add(rn);
}
}
}
}
return customRules;
}
private static final List<RuleNameEnum> subRules = new ArrayList<RuleNameEnum>();
public static List<RuleNameEnum> getSubRules() {
if (subRules.isEmpty()) {
synchronized (subRules) {
for (RuleNameEnum rn : RuleNameEnum.values()) {
if (rn.isBuiltin && rn.isSubrule) {
subRules.add(rn);
}
}
}
}
return subRules;
}
private static final List<RuleNameEnum> preRules = new ArrayList<RuleNameEnum>();
public static List<RuleNameEnum> getPreRules() {
if (preRules.isEmpty()) {
synchronized (preRules) {
for (RuleNameEnum rn : RuleNameEnum.values()) {
if (rn.ruleCategory.equals(RuleCategory.PRE_RULE)) {
preRules.add(rn);
}
}
}
}
return preRules;
}
private static final List<RuleNameEnum> postRules = new ArrayList<RuleNameEnum>();
public static List<RuleNameEnum> getPostRules() {
if (postRules.isEmpty()) {
synchronized (postRules) {
for (RuleNameEnum rn : RuleNameEnum.values()) {
if (rn.ruleCategory.equals(RuleCategory.POST_RULE)) {
postRules.add(rn);
}
}
}
}
return postRules;
}
public String getValue() {
return value;
}
public RuleType getRuleType() {
return ruleType;
}
public RuleCategory getRuleCategory() {
return ruleCategory;
}
public boolean isBuiltin() {
return isBuiltin;
}
public boolean isSubrule() {
return isSubrule;
}
public String getDescription() {
return description;
}
}
|
[
"jackwng@gmail.com"
] |
jackwng@gmail.com
|
8df83a02a29d54c2e1a22dfbf0a9d2105aa2f1f2
|
9d2809ee4669e3701884d334c227c68a24c5787f
|
/distributioncenter/distribution-core/src/test/java/com/mockuai/distributioncenter/core/service/action/fans_gain/FansGainTest.java
|
e85a26930903c00c1eff017d99f0c0c884c127a4
|
[] |
no_license
|
vinfai/hy_project
|
5370367876fe6bcb4109f2af9391b9d817c320b5
|
8fd99f23cf83b1b3f7bec9560fbd2edc46621d0b
|
refs/heads/master
| 2021-01-19T00:58:26.436196
| 2017-03-01T16:47:22
| 2017-03-01T16:49:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,813
|
java
|
package com.mockuai.distributioncenter.core.service.action.fans_gain;
import com.mockuai.common.uils.StarterRunner;
import com.mockuai.distributioncenter.common.api.BaseRequest;
import com.mockuai.distributioncenter.common.api.DistributionService;
import com.mockuai.distributioncenter.common.api.Request;
import com.mockuai.distributioncenter.common.api.Response;
import com.mockuai.distributioncenter.common.constant.ActionEnum;
import com.mockuai.distributioncenter.common.domain.dto.FansDistDTO;
import com.mockuai.distributioncenter.common.domain.dto.GainsSetDTO;
import com.mockuai.distributioncenter.common.domain.qto.FansDistQTO;
import com.mockuai.distributioncenter.core.manager.GainsSetManager;
import com.mockuai.distributioncenter.core.service.action.UnitTestUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
/**
* Created by lizg on 2016/8/29.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class FansGainTest {
private static final String APP_NAME = "distribution";
private static final String LOCAL_PROPERTIES = "e:/hy_workspace_test/haiyn/haiyn_properties/distribution/haiyn.properties";
// E:\hy_workspace_test\haiyn\haiyn_properties
@Autowired
private DistributionService distributionService;
@Autowired
private GainsSetManager gainsSetManager;
private static final String appKey = "27c7bc87733c6d253458fa8908001eef";
static {
try {
StarterRunner.localSystemProperties(APP_NAME,LOCAL_PROPERTIES, new String[]{"local"});
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void FansGainTest111(){
FansDistQTO fansDistQTO = new FansDistQTO();
fansDistQTO.setInviterId(1615260L);
fansDistQTO.setOffset(0L);
fansDistQTO.setCount(100);
// fansDistQTO.setInviterId()
Request request = new BaseRequest();
request.setParam("fansDistQTO",fansDistQTO);
request.setCommand(ActionEnum.QUERY_FANS_AND_DIST.getActionName());
request.setParam("appKey",appKey);
Response<List<FansDistDTO>> fansDistDTOS = (Response<List<FansDistDTO>>) distributionService.execute(request);
if (fansDistDTOS.isSuccess()){
System.out.println("success!!-------------------------------------");
}
List<FansDistDTO> fansDistDTOS1 = fansDistDTOS.getModule();
for (FansDistDTO fansDistDTO : fansDistDTOS1){
System.out.println(fansDistDTO.toString());
}
}
}
|
[
"1147478866@qq.com"
] |
1147478866@qq.com
|
dddabe25931627bde955a0f9fb72fd397b9b9e13
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/16/16_ebb487c6ef0297b959006ee1aa50ce48cb423a6c/LightSensor/16_ebb487c6ef0297b959006ee1aa50ce48cb423a6c_LightSensor_t.java
|
894729c40665917208d377058e9be1162ecdbc13
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 2,461
|
java
|
package net.bible.service.device;
import java.util.List;
import net.bible.android.BibleApplication;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.Log;
/** Light Sensor interface
*
* @author Martin Denham [mjdenham at gmail dot com]
* @see gnu.lgpl.License for license details.<br>
* The copyright to this program is held by it's author.
*/
public class LightSensor {
public final static float NO_READING_YET = -1919;
private float mReading = NO_READING_YET;
private boolean mMonitoring = false;
private static final String TAG = "LightSensor";
/** return reading or null if no light sensor
*/
public int getReading() {
if (!mMonitoring) {
ensureMonitoringLightLevel();
}
Log.d(TAG, "Light Sensor:"+mReading);
return Math.round(mReading);
}
private synchronized void ensureMonitoringLightLevel() {
if (!mMonitoring) {
if (isLightSensor()) {
SensorManager sm = (SensorManager) BibleApplication.getApplication().getSystemService(Context.SENSOR_SERVICE);
Sensor oSensor = sm.getDefaultSensor(Sensor.TYPE_LIGHT);
sm.registerListener(myLightListener, oSensor, SensorManager.SENSOR_DELAY_UI);
// wait for first event
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
Log.e(TAG, "Interrupted getting light signal", ie);
}
}
mMonitoring = true;
}
}
final SensorEventListener myLightListener = new SensorEventListener() {
public void onSensorChanged(SensorEvent sensorEvent) {
if (sensorEvent.sensor.getType() == Sensor.TYPE_LIGHT) {
mReading = sensorEvent.values[0];
}
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
};
/**
* Returns true if at least one Orientation sensor is available
*/
public boolean isLightSensor() {
boolean isLightSensor = false;
SensorManager sm = (SensorManager) BibleApplication.getApplication().getSystemService(Context.SENSOR_SERVICE);
if (sm != null) {
List<Sensor> sensors = sm.getSensorList(Sensor.TYPE_LIGHT);
isLightSensor = (sensors.size() > 0);
}
return isLightSensor;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
5e209e178e1946929e544dfd068576ec93ac5eaa
|
73650c79eaf9d58caa92c6fb8aed0bf95db551f8
|
/src/main/java/org/cg/persistence/NoticeDAOImpl.java
|
9d0ec953087a2d1cd1cb3a0bd147e96451cb3e18
|
[] |
no_license
|
bbako/5am_hy_customer
|
8cafdf160d5e6c5ee32e6a7210aec106d0bafadb
|
c6f2e8385fb749fccd7f3f683b45ef4bfe3812b4
|
refs/heads/master
| 2020-03-22T15:25:15.822798
| 2018-10-19T02:44:18
| 2018-10-19T02:44:18
| 140,251,273
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 771
|
java
|
package org.cg.persistence;
import java.util.List;
import javax.inject.Inject;
import org.cg.domain.NoticeVO;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class NoticeDAOImpl implements NoticeDAO {
String namespace = "org.cg.persistence.NoticeDAO";
@Inject
SqlSessionTemplate sess;
@Override
public void create(NoticeVO vo) {
sess.insert(namespace+".addNotice", vo);
}
@Override
public List<NoticeVO> getList(int page) {
return sess.selectList(namespace+".noticeList",page);
}
@Override
public void update(NoticeVO vo) {
sess.update(namespace+".modiNotice", vo);
}
@Override
public void delete(String tcno) {
sess.delete(namespace+".delNotice", tcno);
}
}
|
[
"Administrator@admin-PC"
] |
Administrator@admin-PC
|
4ca02a5cf622b067897c50b0af00f9fbef56e222
|
de3c2d89f623527b35cc5dd936773f32946025d2
|
/src/main/java/epco/C8004v.java
|
c1d8b4f939d1b833ead99c83e18a4748d33cce9b
|
[] |
no_license
|
ren19890419/lvxing
|
5f89f7b118df59fd1da06aaba43bd9b41b5da1e6
|
239875461cb39e58183ac54e93565ec5f7f28ddb
|
refs/heads/master
| 2023-04-15T08:56:25.048806
| 2020-06-05T10:46:05
| 2020-06-05T10:46:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,847
|
java
|
package epco;
/* renamed from: epco.v */
public class C8004v {
/* renamed from: a */
private long f27210a;
/* renamed from: b */
private short f27211b;
/* renamed from: c */
private short f27212c;
/* renamed from: d */
private String f27213d;
/* renamed from: e */
private String f27214e;
/* renamed from: f */
private short f27215f;
/* renamed from: g */
private short f27216g;
/* renamed from: h */
private int f27217h;
/* renamed from: i */
private short f27218i;
/* renamed from: j */
private short f27219j;
/* renamed from: k */
private short f27220k;
/* renamed from: l */
private short f27221l;
/* renamed from: m */
private int f27222m;
/* renamed from: n */
private int f27223n;
/* renamed from: o */
private int f27224o;
/* renamed from: p */
private int f27225p;
/* renamed from: q */
private short f27226q;
/* renamed from: r */
private short f27227r;
/* renamed from: s */
private short f27228s;
/* renamed from: t */
private short f27229t;
/* renamed from: a */
public String mo38452a() {
return this.f27214e;
}
/* renamed from: a */
public void mo38453a(int i) {
this.f27217h = i;
}
/* renamed from: a */
public void mo38454a(long j) {
this.f27210a = j;
}
/* renamed from: a */
public void mo38455a(String str) {
this.f27214e = str;
}
/* renamed from: a */
public void mo38456a(short s) {
this.f27220k = s;
}
/* renamed from: b */
public int mo38457b() {
return this.f27217h;
}
/* renamed from: b */
public void mo38458b(int i) {
this.f27225p = i;
}
/* renamed from: b */
public void mo38459b(String str) {
this.f27213d = str;
}
/* renamed from: b */
public void mo38460b(short s) {
this.f27221l = s;
}
/* renamed from: c */
public short mo38461c() {
return this.f27220k;
}
/* renamed from: c */
public void mo38462c(int i) {
this.f27223n = i;
}
/* renamed from: c */
public void mo38463c(short s) {
this.f27218i = s;
}
/* renamed from: d */
public short mo38464d() {
return this.f27221l;
}
/* renamed from: d */
public void mo38465d(int i) {
this.f27222m = i;
}
/* renamed from: d */
public void mo38466d(short s) {
this.f27211b = s;
}
/* renamed from: e */
public short mo38467e() {
return this.f27218i;
}
/* renamed from: e */
public void mo38468e(int i) {
this.f27224o = i;
}
/* renamed from: e */
public void mo38469e(short s) {
this.f27212c = s;
}
/* renamed from: f */
public String mo38470f() {
return this.f27213d;
}
/* renamed from: f */
public void mo38471f(short s) {
this.f27219j = s;
}
/* renamed from: g */
public short mo38472g() {
return this.f27211b;
}
/* renamed from: g */
public void mo38473g(short s) {
this.f27215f = s;
}
/* renamed from: h */
public int mo38474h() {
return this.f27225p;
}
/* renamed from: h */
public void mo38475h(short s) {
this.f27228s = s;
}
/* renamed from: i */
public short mo38476i() {
return this.f27212c;
}
/* renamed from: i */
public void mo38477i(short s) {
this.f27229t = s;
}
/* renamed from: j */
public short mo38478j() {
return this.f27219j;
}
/* renamed from: j */
public void mo38479j(short s) {
this.f27226q = s;
}
/* renamed from: k */
public short mo38480k() {
return this.f27215f;
}
/* renamed from: k */
public void mo38481k(short s) {
this.f27216g = s;
}
/* renamed from: l */
public short mo38482l() {
return this.f27228s;
}
/* renamed from: l */
public void mo38483l(short s) {
this.f27227r = s;
}
/* renamed from: m */
public short mo38484m() {
return this.f27229t;
}
/* renamed from: n */
public int mo38485n() {
return this.f27223n;
}
/* renamed from: o */
public short mo38486o() {
return this.f27226q;
}
/* renamed from: p */
public int mo38487p() {
return this.f27222m;
}
/* renamed from: q */
public int mo38488q() {
return this.f27224o;
}
/* renamed from: r */
public long mo38489r() {
return this.f27210a;
}
/* renamed from: s */
public short mo38490s() {
return this.f27216g;
}
/* renamed from: t */
public short mo38491t() {
return this.f27227r;
}
}
|
[
"593746220@qq.com"
] |
593746220@qq.com
|
9957a88e016e8da957af04cd0fbe1cea1bbf3476
|
5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b
|
/com/planet_ink/coffee_mud/Abilities/Spells/Spell_PassDoor.java
|
7616feff90d9a3dde0271cd376d0b020d4fdd9d0
|
[
"Apache-2.0"
] |
permissive
|
bozimmerman/CoffeeMud
|
5da8b5b98c25b70554ec9a2a8c0ef97f177dc041
|
647864922e07572b1f6c863de8f936982f553288
|
refs/heads/master
| 2023-09-04T09:17:12.656291
| 2023-09-02T00:30:19
| 2023-09-02T00:30:19
| 5,267,832
| 179
| 122
|
Apache-2.0
| 2023-04-30T11:09:14
| 2012-08-02T03:22:12
|
Java
|
UTF-8
|
Java
| false
| false
| 6,841
|
java
|
package com.planet_ink.coffee_mud.Abilities.Spells;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2001-2023 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class Spell_PassDoor extends Spell
{
@Override
public String ID()
{
return "Spell_PassDoor";
}
private final static String localizedName = CMLib.lang().L("Pass Door");
@Override
public String name()
{
return localizedName;
}
private final static String localizedStaticDisplay = CMLib.lang().L("(Pass Door)");
@Override
public String displayText()
{
return localizedStaticDisplay;
}
@Override
protected int canTargetCode()
{
return 0;
}
@Override
protected int overrideMana()
{
return Ability.COST_ALL;
}
@Override
public int classificationCode()
{
return Ability.ACODE_SPELL | Ability.DOMAIN_CONJURATION;
}
@Override
public long flags()
{
return Ability.FLAG_TRANSPORTING;
}
@Override
public int abstractQuality()
{
return Ability.QUALITY_INDIFFERENT;
}
@Override
public void affectPhyStats(final Physical affected, final PhyStats affectedStats)
{
super.affectPhyStats(affected,affectedStats);
affectedStats.setDisposition(affectedStats.disposition()|PhyStats.IS_INVISIBLE);
affectedStats.setHeight(-1);
}
@Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
if(canBeUninvoked())
{
if((mob.location()!=null)&&(!mob.amDead()))
mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("<S-NAME> <S-IS-ARE> no longer translucent."));
}
super.unInvoke();
}
protected int highestLevelHere(final MOB mob, final Room R, int highestLevel)
{
for(final Enumeration<MOB> m=R.inhabitants();m.hasMoreElements();)
{
final MOB M=m.nextElement();
if((M!=null)
&& M.isMonster()
&&(M.amFollowing()==null)
&&(M.phyStats().level()>highestLevel))
highestLevel=M.phyStats().level();
}
for(final Enumeration<Item> i=R.items();i.hasMoreElements();)
{
final Item I=i.nextElement();
if((I!=null)
&&(I.phyStats().level()>highestLevel))
highestLevel = I.phyStats().level();
}
final LandTitle T=CMLib.law().getLandTitle(R);
if((T!=null)
&&(!CMLib.law().doesHavePriviledgesHere(mob, R)))
{
final MOB M = CMLib.law().getPropertyOwner(T);
if((M!=null)
&&(M.phyStats().level()>highestLevel))
highestLevel = M.phyStats().level();
}
return highestLevel;
}
@Override
public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel)
{
if((auto||mob.isMonster())&&((commands.size()<1)||((commands.get(0)).equals(mob.name()))))
{
commands.clear();
int theDir=-1;
for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
{
final Exit E=mob.location().getExitInDir(d);
if((E!=null)
&&(!E.isOpen()))
{
theDir=d;
break;
}
}
if(theDir>=0)
commands.add(CMLib.directions().getDirectionName(theDir));
}
final String whatToOpen=CMParms.combine(commands,0);
final int dirCode=CMLib.directions().getGoodDirectionCode(whatToOpen);
int adjustment = 0;
if(!auto)
{
if(dirCode<0)
{
mob.tell(L("Pass which direction?!"));
return false;
}
final Room R=mob.location();
final Exit exit=R.getExitInDir(dirCode);
final Room room=R.getRoomInDir(dirCode);
if((exit==null)||(room==null)||(!CMLib.flags().canBeSeenBy(exit,mob)))
{
mob.tell(L("You can't see anywhere to pass that way."));
return false;
}
//Exit opExit=room.getReverseExit(dirCode);
if(exit.isOpen())
{
mob.tell(L("But it looks free and clear that way!"));
return false;
}
int highestLevel = exit.phyStats().level();
highestLevel = highestLevelHere(mob,R,highestLevel);
highestLevel = highestLevelHere(mob,room,highestLevel);
adjustment = (mob.phyStats().level() - highestLevel) * 5;
if(adjustment > 0)
adjustment = 0;
}
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,adjustment,auto);
if((!success)
||(mob.fetchEffect(ID())!=null))
beneficialVisualFizzle(mob,null,L("<S-NAME> walk(s) @x1, but go(es) no further.",CMLib.directions().getDirectionName(dirCode)));
else
if(auto)
{
final CMMsg msg=CMClass.getMsg(mob,null,null,verbalCastCode(mob,null,auto),L("^S<S-NAME> shimmer(s) and turn(s) translucent.^?"));
if(mob.location().okMessage(mob,msg))
{
mob.location().send(mob,msg);
beneficialAffect(mob,mob,asLevel,5);
mob.recoverPhyStats();
}
}
else
{
final CMMsg msg=CMClass.getMsg(mob,null,null,verbalCastCode(mob,null,auto),L("^S<S-NAME> shimmer(s) and pass(es) @x1.^?",CMLib.directions().getDirectionName(dirCode)));
if(mob.location().okMessage(mob,msg))
{
mob.location().send(mob,msg);
if(mob.fetchEffect(ID())==null)
{
final Ability A=(Ability)this.copyOf();
A.setSavable(false);
try
{
mob.addEffect(A);
mob.recoverPhyStats();
CMLib.tracking().walk(mob,dirCode,false,false);
}
finally
{
mob.delEffect(A);
}
}
else
CMLib.tracking().walk(mob,dirCode,false,false);
mob.recoverPhyStats();
}
}
return success;
}
}
|
[
"bo@zimmers.net"
] |
bo@zimmers.net
|
1ee275f7daef33032d6e7fd6c091b38b04867390
|
b6255f7ca81451ac9377ab9fc0cffa3235250929
|
/test/src/test11/Student.java
|
5ec97c3292c1409c53105c624dfe7a0a44f6f930
|
[] |
no_license
|
seunng/java
|
07e3f1fe2531dd93d52efdbc1ad6e5c6606c6d24
|
3c4556247733a1f414985a4d849ead9397826939
|
refs/heads/master
| 2020-03-22T17:31:16.558723
| 2018-07-10T08:27:00
| 2018-07-10T08:27:00
| 139,947,630
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 428
|
java
|
package test11;
public class Student {
private String clazz;
private String name;
private int grade;
public void setterC(String clazz) {
this.clazz = clazz;
}
public void setterN(String name) {
this.name = name;
}
public void setterG(int grade) {
this.grade = grade;
}
public void println() {
System.out.println(clazz);
System.out.println(name);
System.out.println(grade);
}
}
|
[
"koitt03-A@koitt03-A-PC"
] |
koitt03-A@koitt03-A-PC
|
228c761cfbc93e9b91d20632e891603d860df01b
|
4611ba9c852bcc03b330ca00e98884746082e57f
|
/CommandInterfaces/.svn/pristine/22/228c761cfbc93e9b91d20632e891603d860df01b.svn-base
|
5b0b639503ba04543eb3d1fdcf4fabb7adbf8b23
|
[
"Apache-2.0"
] |
permissive
|
sami-sari/cezmi
|
374ddb4606586282613e0abef04fc70e2550c97d
|
6042b566fb8598b60faef0dcf8671b819d2e4f0a
|
refs/heads/master
| 2021-07-02T12:26:13.707009
| 2020-12-01T02:45:08
| 2020-12-01T02:45:08
| 193,400,687
| 0
| 0
|
Apache-2.0
| 2020-12-01T02:45:09
| 2019-06-23T22:18:44
|
HTML
|
UTF-8
|
Java
| false
| false
| 329
|
package com.samisari.graphics.commands;
import java.awt.Color;
import java.awt.Font;
import java.util.List;
public interface ICmdWindow extends ICmdRectangle {
public Font getTitleFont();
public String getTitleText();
public Color getTitleColor();
public String getWindowListener();
List<ICmdRectangle> getComponents();
}
|
[
"sari@alumni.bilkent.edu.tr"
] |
sari@alumni.bilkent.edu.tr
|
|
9d77be591551712f6e9fab4f490e846f583a69d7
|
ade43c95a131bc9f33b8f99e8b0053b5bc1393e8
|
/src/OWON_VDS_v1.0.24/com/owon/uppersoft/vds/core/aspect/control/VoltageProvider.java
|
2bd41104e9bb4c534bbb8e14a0c33bca175987c9
|
[] |
no_license
|
AbirFaisal/RealScope
|
7ba7532986ea1ee11683b4bd96f746e800ea144a
|
f80ff68a8e9d61d7bec12b464b637decb036a3f0
|
refs/heads/master
| 2020-03-30T04:21:38.344659
| 2018-10-03T17:54:16
| 2018-10-03T17:54:16
| 150,738,973
| 7
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 330
|
java
|
package com.owon.uppersoft.vds.core.aspect.control;
public interface VoltageProvider {
// mV
int getVoltage(int probe, int vbIndex);
int getVoltageNumber();
String getVoltageLabel(int vbIndex);
int getPos0HalfRange(int currentVolt);
int[] getVoltages(int probe);
public Integer[] getProbeMulties();
}
|
[
"administrator@Computer.local"
] |
administrator@Computer.local
|
f0f1049742a1e936913f4b7f8f7e89c464c603d6
|
9255ca07e5a07c1799d9d6b0155c18e978a3ccf8
|
/audit/src/main/java/org/xipki/audit/Audits.java
|
93c8a43e6307cf58b57ced245482a18d675d7fba
|
[
"Apache-2.0"
] |
permissive
|
ygy203/xipki
|
18281a024c24ed6bf55151f1de28f8a7ec608243
|
8ab9e203bb2f41f1dfc7327a67e3e20e1b0f0782
|
refs/heads/master
| 2022-04-28T19:12:09.651753
| 2022-03-29T02:53:38
| 2022-03-29T02:53:38
| 230,175,699
| 0
| 0
|
Apache-2.0
| 2022-01-17T08:59:57
| 2019-12-26T01:46:05
| null |
UTF-8
|
Java
| false
| false
| 3,893
|
java
|
/*
*
* Copyright (c) 2013 - 2020 Lijun Liao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xipki.audit;
import org.xipki.audit.services.EmbedAuditService;
import org.xipki.audit.services.FileMacAuditService;
import org.xipki.audit.services.Slf4jAuditService;
import org.xipki.password.PasswordResolver;
import java.lang.reflect.InvocationTargetException;
/**
* Helper class to configure and initialize the Audit.
*
* @author Lijun Liao
*/
public class Audits {
public static class AuditConf {
/**
* valid values are:
* embed: use the embedded slf4j logging
* java:<name of class that implements org.xipki.audit.AuditService>
*/
private String type;
private String conf;
public static AuditConf DEFAULT = new AuditConf();
public String getType() {
return type == null || type.isEmpty() ? "embed" : type;
}
public void setType(String type) {
this.type = type;
}
public String getConf() {
return conf;
}
public void setConf(String conf) {
this.conf = conf;
}
}
private static AuditService auditService;
private static AuditServiceRuntimeException initializationException;
private Audits() {
}
public static AuditService getAuditService() {
if (auditService != null) {
return auditService;
}
if (initializationException != null) {
throw initializationException;
} else {
throw new IllegalStateException("Please call Audits.init() first.");
}
} // method getAuditService
public static void init(String auditType, String auditConf, PasswordResolver passwordResolver) {
try {
AuditService service;
if ("embed".equalsIgnoreCase(auditType)) {
service = new EmbedAuditService();
} else if ("slf4j".equals(auditType)) {
service = new Slf4jAuditService();
} else if ("file-mac".equals(auditType)) {
service = new FileMacAuditService();
} else {
String className;
if (auditType.startsWith("java:")) {
className = auditType.substring("java:".length());
} else if ("database-mac".equals(auditType)) {
className = "org.xipki.audit.extra.DatabaseMacAuditService";
} else {
throw new AuditServiceRuntimeException("invalid Audit.Type '" + auditType
+ "'. Valid values are 'embed' or java:<name of class that implements "
+ AuditService.class.getName() + ">");
}
try {
Class<?> clazz = Class.forName(className);
service = (AuditService) clazz.getDeclaredConstructor().newInstance();
} catch (ClassCastException | ClassNotFoundException | NoSuchMethodException
| IllegalAccessException | InstantiationException | InvocationTargetException ex) {
throw new AuditServiceRuntimeException(
"error caught while initializing AuditService " + auditType
+ ": " + ex.getClass().getName() + ": " + ex.getMessage(), ex);
}
}
service.init(auditConf, passwordResolver);
auditService = service;
} catch (AuditServiceRuntimeException ex) {
initializationException = ex;
} catch (Exception ex) {
initializationException = new AuditServiceRuntimeException(ex.getMessage(), ex);
}
} // method init
}
|
[
"lijun.liao@gmail.com"
] |
lijun.liao@gmail.com
|
b2bb440feb0326c02ef43d13dad002d2b8732335
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/chart/title/TextTitle_getText_253.java
|
b52967ecabdd5bc8d3b7c22ca447a91bd58e337e
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 1,088
|
java
|
org jfree chart titl
chart titl displai text string automat wrap
requir
text titl texttitl titl
return titl text
text code code
set text settext string
string text gettext
text
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
464cd6f7bf5a8a6ce0cbf1ecae3167b2c2b3dfc5
|
abade586a195bc3349a1608172d81f0df887f870
|
/main/calibration/benchmark/boofcv/abst/calib/BenchmarkCalibrationDetectors.java
|
f7fbf980393e2fd26cb460c4a1c659017713c0d8
|
[
"Apache-2.0"
] |
permissive
|
liuli9203/BoofCV
|
05baef37efaf1e825510ffaec266a87ef92d290a
|
3d0078ecd0b62245430c08e6b53297404ddc3dd1
|
refs/heads/master
| 2021-01-18T12:36:18.067216
| 2015-05-01T15:45:37
| 2015-05-01T15:45:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,549
|
java
|
/*
* Copyright (c) 2011-2014, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boofcv.abst.calib;
import boofcv.factory.calib.FactoryPlanarCalibrationTarget;
import boofcv.io.image.ConvertBufferedImage;
import boofcv.misc.PerformerBase;
import boofcv.misc.ProfileOperation;
import boofcv.struct.image.ImageFloat32;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
/**
* @author Peter Abeles
*/
public class BenchmarkCalibrationDetectors {
public static final int TEST_TIME = 1000;
public static ImageFloat32 imageChess;
public static ImageFloat32 imageSquare;
public static class Chessboard extends PerformerBase {
PlanarCalibrationDetector detector = FactoryPlanarCalibrationTarget.
detectorChessboard(new ConfigChessboard(5,7));
@Override
public void process() {
if( !detector.process(imageChess) )
throw new RuntimeException("Can't find target!");
}
}
public static class Square extends PerformerBase {
PlanarCalibrationDetector detector = FactoryPlanarCalibrationTarget.
detectorSquareGrid(new ConfigSquareGrid(5, 7));
@Override
public void process() {
if( !detector.process(imageSquare) )
throw new RuntimeException("Can't find target!");
}
}
public static ImageFloat32 loadImage(String fileName) {
BufferedImage img;
try {
img = ImageIO.read(new File(fileName));
} catch (IOException e) {
return null;
}
return ConvertBufferedImage.convertFrom(img, (ImageFloat32) null);
}
public static void main(String[] args) {
String chess = "../data/evaluation/calibration/stereo/Bumblebee2_Chess/left01.jpg";
String square = "../data/evaluation/calibration/stereo/Bumblebee2_Square/left01.jpg";
imageChess = loadImage(chess);
imageSquare = loadImage(square);
ProfileOperation.printOpsPerSec(new Chessboard(), TEST_TIME);
ProfileOperation.printOpsPerSec(new Square(), TEST_TIME);
}
}
|
[
"peter.abeles@gmail.com"
] |
peter.abeles@gmail.com
|
48ccf118fa48be70ab42f4e7da5799bb20ecf615
|
4a3560aea0921ebac0cc769ea59d4769700a5aec
|
/src/main/java/com/codegym/controller/CustomerController.java
|
7c238ae6718b8a10c8522372924c6891ca478de0
|
[] |
no_license
|
face13ss/customer-management
|
bbea0c41d7dbdaa29068e2e368c6a4770a94341f
|
d216060a6744f9a66e4c8b7fef9a3fe5ad637b1c
|
refs/heads/master
| 2023-02-21T11:09:43.170452
| 2021-01-23T01:54:06
| 2021-01-23T01:54:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,100
|
java
|
package com.codegym.controller;
import com.codegym.model.Customer;
import com.codegym.services.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@Controller
public class CustomerController {
@Autowired
private CustomerService customerService;
@GetMapping("/customer")
public String index(Model model) {
List customers = customerService.findAll();
model.addAttribute("customers", customers);
return "index";
}
@GetMapping("/customer/create")
public String create(Model model) {
model.addAttribute("customer", new Customer());
return "create";
}
@PostMapping("/customer/save")
public String save(Customer customer) {
customer.setId((int) (Math.random() * 10000));
customerService.save(customer);
return "redirect:/customer";
}
}
|
[
"="
] |
=
|
21bc2c73666d69a41ba64eef9b8d7462f0e7b2e6
|
cb3dc25ee29d09f6a6270564c7d7d54fa7e11ef6
|
/serial-distribute-service/src/main/java/com/gzs/learn/serial/SerialDistributeServer.java
|
0ab9905db125cddf546c38654eb594a5d9090819
|
[
"Apache-2.0"
] |
permissive
|
devsong/serial
|
6944c6dfe21b97a6107ffd599e0531ca921bed8b
|
ef89004e84003c2699c602ee4cad9454fd3c8d8a
|
refs/heads/master
| 2020-04-10T15:26:25.146326
| 2018-12-10T03:12:29
| 2018-12-10T03:13:57
| 161,109,631
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 902
|
java
|
package com.gzs.learn.serial;
import java.util.concurrent.CountDownLatch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import lombok.extern.slf4j.Slf4j;
@Configuration
@EnableAutoConfiguration
@ComponentScan
@ImportResource("classpath:/META-INF/applicationContext.xml")
@Slf4j
public class SerialDistributeServer {
public static void main(String[] args) throws Exception {
SpringApplication.run(SerialDistributeServer.class, args);
log.info("----------->Serial Distribute Server Start Success<----------");
CountDownLatch latch = new CountDownLatch(1);
latch.await();
}
}
|
[
"guanzhisong@gmail.com"
] |
guanzhisong@gmail.com
|
7335680be3ab923e79ed115eaa1cb298e0682398
|
821eea25624740a008311eed3f962f1488684a5a
|
/src/main/java/company/frequence/LC336.java
|
1b6d017b0b253b4cc5dad9ec8dba3111ae8073e5
|
[] |
no_license
|
cchaoqun/Chaoqun_LeetCode
|
0c45598a0ba89cae9c53725b7b70adf767b226f1
|
5b2bf42bca66e46e4751455b81b17198b447bb39
|
refs/heads/master
| 2023-06-30T20:53:49.779110
| 2021-08-02T12:45:16
| 2021-08-02T12:45:16
| 367,815,848
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,553
|
java
|
package company.frequence;
import java.util.*;
/**
* @author Chaoqun Cheng
* @date 2021-07-2021/7/9-13:06
*/
public class LC336 {
public List<List<Integer>> palindromePairs(String[] words) {
List<List<Integer>> res = new ArrayList<>();
for(int i=0;i<words.length; i++){
for(int j=i+1; j<words.length; j++){
if(isPalind(words[i]+words[j])){
res.add(Arrays.asList(i,j));
}
if(isPalind(words[j]+words[i])){
res.add(Arrays.asList(j,i));
}
}
}
return res;
}
private boolean isPalind(String str){
if(str==null || str.length()==0){
return true;
}
int i = 0;
int j = str.length();
while(i<j){
if(str.charAt(i)!=str.charAt(j)){
return false;
}
i++;
j--;
}
return true;
}
}
class LC336_M2{
List<String> wordRev = new ArrayList<>();
Map<String, Integer> map = new HashMap<>();
public List<List<Integer>> palindromePairs(String[] words) {
List<List<Integer>> res = new ArrayList<>();
for(String word : words){
wordRev.add(new StringBuffer(word).reverse().toString());
}
for(int i=0; i<words.length; i++){
map.put(wordRev.get(i), i);
}
int len = words.length;
for(int i=0; i<len; i++){
String word = words[i];
int m = word.length();
if(m==0){
continue;
}
for(int j=0;j<=m; j++){
if(j!=0 && isPalind(word, 0, j-1)){
int right = find(word, j, m-1);
if(right!=-1 && right!=i){
res.add(Arrays.asList(right,i));
}
}
if(isPalind(word, j, m-1)){
int left = find(word, 0, j-1);
if(left!=-1 && left!=i){
res.add(Arrays.asList(i,left));
}
}
}
}
return res;
}
private int find(String str, int left, int right){
return map.getOrDefault(str.substring(left, right+1), -1);
}
private boolean isPalind(String str, int i, int j){
while(i<j){
if(str.charAt(i)!=str.charAt(j)){
return false;
}
i++;
j--;
}
return true;
}
}
|
[
"chengchaoqun@hotmail.com"
] |
chengchaoqun@hotmail.com
|
6403b34fabbe80a9c58b372a9122b7358476caa1
|
49b4cb79c910a17525b59d4b497a09fa28a9e3a8
|
/parserValidCheck/src/main/java/com/ke/css/cimp/fwb/fwb17/Rule_CUSTOMS_ORIGIN_CODE.java
|
c1776bfd836681e934e363ea079127f62d7b6108
|
[] |
no_license
|
ganzijo/koreanair
|
a7d750b62cec2647bfb2bed4ca1bf8648d9a447d
|
e980fb11bc4b8defae62c9d88e5c70a659bef436
|
refs/heads/master
| 2021-04-26T22:04:17.478461
| 2018-03-06T05:59:32
| 2018-03-06T05:59:32
| 124,018,887
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,319
|
java
|
package com.ke.css.cimp.fwb.fwb17;
/* -----------------------------------------------------------------------------
* Rule_CUSTOMS_ORIGIN_CODE.java
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Tue Mar 06 10:25:52 KST 2018
*
* -----------------------------------------------------------------------------
*/
import java.util.ArrayList;
final public class Rule_CUSTOMS_ORIGIN_CODE extends Rule
{
public Rule_CUSTOMS_ORIGIN_CODE(String spelling, ArrayList<Rule> rules)
{
super(spelling, rules);
}
public Object accept(Visitor visitor)
{
return visitor.visit(this);
}
public static Rule_CUSTOMS_ORIGIN_CODE parse(ParserContext context)
{
context.push("CUSTOMS_ORIGIN_CODE");
boolean parsed = true;
int s0 = context.index;
ParserAlternative a0 = new ParserAlternative(s0);
ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s1 = context.index;
ParserAlternative a1 = new ParserAlternative(s1);
parsed = true;
if (parsed)
{
boolean f1 = true;
@SuppressWarnings("unused")
int c1 = 0;
for (int i1 = 0; i1 < 2 && f1; i1++)
{
Rule rule = Rule_Typ_Mixed.parse(context);
if ((f1 = rule != null))
{
a1.add(rule, context.index);
c1++;
}
}
parsed = true;
}
if (parsed)
{
as1.add(a1);
}
context.index = s1;
}
ParserAlternative b = ParserAlternative.getBest(as1);
parsed = b != null;
if (parsed)
{
a0.add(b.rules, b.end);
context.index = b.end;
}
Rule rule = null;
if (parsed)
{
rule = new Rule_CUSTOMS_ORIGIN_CODE(context.text.substring(a0.start, a0.end), a0.rules);
}
else
{
context.index = s0;
}
context.pop("CUSTOMS_ORIGIN_CODE", parsed);
return (Rule_CUSTOMS_ORIGIN_CODE)rule;
}
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
|
[
"wrjo@wrjo-PC"
] |
wrjo@wrjo-PC
|
77320b66b8fd0fb33b0cd25f569568aef80cd2b4
|
d57176af406c4acc60155baa5e141225113e172d
|
/src/java/com/tsp/sct/dao/exceptions/CronometroDaoException.java
|
0e82896902b10f2c84e2eb41791f42efa51840a7
|
[] |
no_license
|
njmube/SGFENS_BAFAR
|
8aa2bcf5312355efa46b84ab8533169df23a8cc9
|
4141ee825294246ca4703f7a4441f5a1b06fe0cb
|
refs/heads/master
| 2021-01-11T11:58:48.354602
| 2016-07-28T02:39:23
| 2016-07-28T02:39:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 662
|
java
|
/*
* This source file was generated by FireStorm/DAO.
*
* If you purchase a full license for FireStorm/DAO you can customize this header file.
*
* For more information please visit http://www.codefutures.com/products/firestorm
*/
package com.tsp.sct.dao.exceptions;
public class CronometroDaoException extends DaoException
{
/**
* Method 'CronometroDaoException'
*
* @param message
*/
public CronometroDaoException(String message)
{
super(message);
}
/**
* Method 'CronometroDaoException'
*
* @param message
* @param cause
*/
public CronometroDaoException(String message, Throwable cause)
{
super(message, cause);
}
}
|
[
"nelly.gonzalez@vincoorbis.com"
] |
nelly.gonzalez@vincoorbis.com
|
57afb0153c727c70519507b5cf9cdac3c2a370a8
|
c92dda5013ad28a090452ab70bfb8e888fa2a300
|
/src/Class348_Sub40_Sub22.java
|
86cf9bee1768143cf13f0daf28e38b287f468f0d
|
[] |
no_license
|
EvelusDevelopment/634-Deob
|
ee7cdd327ba3ef08dbdbbe76372846651d1ade73
|
ef3e1ddbafb06b5f4ac7376e6870384c526d549d
|
refs/heads/master
| 2021-01-19T07:03:39.850614
| 2012-02-21T06:43:11
| 2012-02-21T06:43:11
| 3,501,454
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,531
|
java
|
/* Class348_Sub40_Sub22 - Decompiled by JODE
* Visit http://jode.sourceforge.net/
*/
import java.util.Random;
final class Class348_Sub40_Sub22 extends Class348_Sub40
{
private int anInt9284 = 1024;
static IncomingPacket aClass114_9285 = new IncomingPacket(104, 1);
private int[][] anIntArrayArray9286;
private int[][] anIntArrayArray9287;
private int anInt9288 = 1024;
static int anInt9289;
static int anInt9290;
private int anInt9291;
static int anInt9292;
private int anInt9293 = 0;
private int anInt9294;
static int anInt9295;
static int anInt9296;
private int[] anIntArray9297;
private int anInt9298;
private int anInt9299 = 4;
private int anInt9300;
private int anInt9301;
private int anInt9302;
static Class304 aClass304_9303 = new Class304(1);
static OutgoingPacket aClass351_9304 = new OutgoingPacket(20, -1);
private int anInt9305;
private final void method3109(byte i) {
anInt9289++;
Random random = new Random((long) anInt9301);
anInt9298 = anInt9294 / 2;
anInt9291 = 4096 / anInt9299;
anInt9300 = 4096 / anInt9301;
int i_0_ = anInt9291 / 2;
anIntArray9297 = new int[anInt9301 + 1];
int i_1_ = anInt9300 / 2;
anIntArrayArray9287 = new int[anInt9301][1 + anInt9299];
anIntArrayArray9286 = new int[anInt9301][anInt9299];
anIntArray9297[0] = 0;
if (i >= -111)
method3109((byte) 67);
for (int i_2_ = 0; i_2_ < anInt9301; i_2_++) {
if ((i_2_ ^ 0xffffffff) < -1) {
int i_3_ = anInt9300;
int i_4_ = ((Model.method1097((byte) 90, 4096, random)
- 2048) * anInt9305
>> -1633784916);
i_3_ += i_4_ * i_1_ >> 48155276;
anIntArray9297[i_2_] = i_3_ + anIntArray9297[-1 + i_2_];
}
anIntArrayArray9287[i_2_][0] = 0;
for (int i_5_ = 0; anInt9299 > i_5_; i_5_++) {
if ((i_5_ ^ 0xffffffff) < -1) {
int i_6_ = anInt9291;
int i_7_ = ((Model.method1097((byte) 117, 4096, random)
- 2048) * anInt9302
>> -1511824500);
i_6_ += i_0_ * i_7_ >> -176195412;
anIntArrayArray9287[i_2_][i_5_]
= anIntArrayArray9287[i_2_][i_5_ + -1] + i_6_;
}
anIntArrayArray9286[i_2_][i_5_]
= (anInt9284 <= 0 ? 4096
: (-Model.method1097((byte) 124, anInt9284, random)
+ 4096));
}
anIntArrayArray9287[i_2_][anInt9299] = 4096;
}
anIntArray9297[anInt9301] = 4096;
}
public Class348_Sub40_Sub22() {
super(0, true);
anInt9294 = 81;
anInt9302 = 409;
anInt9305 = 204;
anInt9301 = 8;
}
public static void method3110(int i) {
aClass351_9304 = null;
aClass304_9303 = null;
if (i != -1633784916)
aClass304_9303 = null;
aClass114_9285 = null;
}
final void method3049(ByteBuffer class348_sub49, int i, int i_8_) {
anInt9292++;
if (i_8_ != 31015)
method3111(106, 16);
int i_9_ = i;
while_189_:
do {
while_188_:
do {
while_187_:
do {
while_186_:
do {
while_185_:
do {
while_184_:
do {
do {
if ((i_9_ ^ 0xffffffff) != -1) {
if (i_9_ != 1) {
if ((i_9_ ^ 0xffffffff) != -3) {
if ((i_9_ ^ 0xffffffff)
!= -4) {
if (i_9_ != 4) {
if (i_9_ != 5) {
if ((i_9_
^ 0xffffffff)
!= -7) {
if ((i_9_
^ 0xffffffff)
!= -8)
break while_189_;
} else
break while_187_;
break while_188_;
}
} else
break while_185_;
break while_186_;
}
} else
break;
break while_184_;
}
} else {
anInt9299
= class348_sub49.getUByte();
return;
}
anInt9301 = class348_sub49.getUByte();
return;
} while (false);
anInt9302
= class348_sub49.getShort();
return;
} while (false);
anInt9305 = class348_sub49.getShort();
return;
} while (false);
anInt9288 = class348_sub49.getShort();
return;
} while (false);
anInt9293 = class348_sub49.getShort();
return;
} while (false);
anInt9294 = class348_sub49.getShort();
return;
} while (false);
anInt9284 = class348_sub49.getShort();
} while (false);
}
final int[] method3042(int i, int i_10_) {
anInt9296++;
int[] is = ((Class348_Sub40) this).aClass191_7032.method1433(0, i);
if (((Class191) ((Class348_Sub40) this).aClass191_7032).aBoolean2570) {
int i_11_ = 0;
int i_12_;
for (i_12_ = anInt9293 + Class239_Sub18.anIntArray6035[i];
i_12_ < 0; i_12_ += 4096) {
/* empty */
}
for (/**/; i_12_ > 4096; i_12_ -= 4096) {
/* empty */
}
for (/**/; (anInt9301 ^ 0xffffffff) < (i_11_ ^ 0xffffffff);
i_11_++) {
if (i_12_ < anIntArray9297[i_11_])
break;
}
int i_13_ = -1 + i_11_;
boolean bool = (0x1 & i_11_ ^ 0xffffffff) == -1;
int i_14_ = anIntArray9297[i_11_];
int i_15_ = anIntArray9297[i_11_ - 1];
if (anInt9298 + i_15_ < i_12_
&& (i_14_ - anInt9298 ^ 0xffffffff) < (i_12_ ^ 0xffffffff)) {
for (int i_16_ = 0; Class348_Sub40_Sub6.anInt9139 > i_16_;
i_16_++) {
int i_17_ = 0;
int i_18_ = !bool ? -anInt9288 : anInt9288;
int i_19_;
for (i_19_ = (Class318_Sub6.anIntArray6432[i_16_]
+ (i_18_ * anInt9291 >> -742925460));
(i_19_ ^ 0xffffffff) > -1; i_19_ += 4096) {
/* empty */
}
for (/**/; i_19_ > 4096; i_19_ -= 4096) {
/* empty */
}
for (/**/; (anInt9299 ^ 0xffffffff) < (i_17_ ^ 0xffffffff);
i_17_++) {
if ((i_19_ ^ 0xffffffff)
> (anIntArrayArray9287[i_13_][i_17_] ^ 0xffffffff))
break;
}
int i_20_ = i_17_ - 1;
int i_21_ = anIntArrayArray9287[i_13_][i_20_];
int i_22_ = anIntArrayArray9287[i_13_][i_17_];
if ((i_19_ ^ 0xffffffff) >= (anInt9298 + i_21_
^ 0xffffffff)
|| i_19_ >= -anInt9298 + i_22_)
is[i_16_] = 0;
else
is[i_16_] = anIntArrayArray9286[i_13_][i_20_];
}
} else
Class214.method1579(is, 0, Class348_Sub40_Sub6.anInt9139, 0);
}
if (i_10_ != 255)
method3110(44);
return is;
}
static final void method3111(int i, int i_23_) {
anInt9290++;
if (i_23_ != Class348_Sub15.anInt6769) {
if (i < 18)
aClass304_9303 = null;
Class367_Sub4.anInt7319 = Class348_Sub40_Sub3.anInt9109
= FileArchiveTracker.anIntArray4780[i_23_];
Class290.method2196((byte) -9);
Class62.anIntArrayArrayArray1116
= (new int[4][Class367_Sub4.anInt7319 >> 629360931]
[Class348_Sub40_Sub3.anInt9109 >> -1129488413]);
Class239_Sub8.anIntArrayArray5921
= (new int[Class367_Sub4.anInt7319]
[Class348_Sub40_Sub3.anInt9109]);
Class348_Sub42_Sub17.anIntArrayArray9678
= (new int[Class367_Sub4.anInt7319]
[Class348_Sub40_Sub3.anInt9109]);
for (int i_24_ = 0; i_24_ < 4; i_24_++)
MouseEventNode.aClass361Array7108[i_24_]
= NativeRaster.method988(Class348_Sub40_Sub3.anInt9109, 1,
Class367_Sub4.anInt7319);
Class289.aByteArrayArrayArray3700
= (new byte[4][Class367_Sub4.anInt7319]
[Class348_Sub40_Sub3.anInt9109]);
Class239.method1717(19278, Class348_Sub40_Sub3.anInt9109,
Class367_Sub4.anInt7319, 4);
Class97.method873(Class367_Sub4.anInt7319 >> 1025673859, 21719,
Class348_Sub8.currentToolkit,
Class348_Sub40_Sub3.anInt9109 >> -184361181);
Class348_Sub15.anInt6769 = i_23_;
}
}
final void method3044(int i) {
if (i <= 108)
method3111(-110, -119);
anInt9295++;
method3109((byte) -125);
}
}
|
[
"sinisoul@gmail.com"
] |
sinisoul@gmail.com
|
e87f6ca887b5785f3db00f4ea0ffbd3b1b9dc82a
|
ad64a14fac1f0d740ccf74a59aba8d2b4e85298c
|
/linkwee-supermarket/src/main/java/com/linkwee/api/controller/cfp/CrmCfpLevelRecordTempController.java
|
02dcb3c436c2222ca322c6adeff25fed23086968
|
[] |
no_license
|
zhangjiayin/supermarket
|
f7715aa3fdd2bf202a29c8683bc9322b06429b63
|
6c37c7041b5e1e32152e80564e7ea4aff7128097
|
refs/heads/master
| 2020-06-10T16:57:09.556486
| 2018-10-30T07:03:15
| 2018-10-30T07:03:15
| 193,682,975
| 0
| 1
| null | 2019-06-25T10:03:03
| 2019-06-25T10:03:03
| null |
UTF-8
|
Java
| false
| false
| 6,834
|
java
|
package com.linkwee.api.controller.cfp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.DateConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.linkwee.core.base.api.BaseResponse;
import com.linkwee.core.datatable.DataInfo;
import com.linkwee.core.datatable.DataResult;
import com.linkwee.core.datatable.DataTable;
import com.linkwee.core.datatable.DataTableReturn;
import com.linkwee.core.datatable.ErrorField;
import com.linkwee.core.util.JsonUtils;
import com.linkwee.web.model.CrmCfpLevelRecordTemp;
import com.linkwee.web.response.CfpLevelWarningResp;
import com.linkwee.web.service.CrmCfpLevelRecordTempService;
import com.linkwee.xoss.api.AppRequestHead;
import com.linkwee.xoss.helper.JsonWebTokenHepler;
import com.linkwee.xoss.interceptors.DateConvertEditor;
import com.linkwee.xoss.util.AppResponseUtil;
import com.linkwee.xoss.util.RequestLogging;
/**
*
* @描述: CrmCfpLevelRecordTempController控制器
*
* @创建人: liqimoon
*
* @创建时间:2017年04月10日 13:51:28
*
* Copyright (c) 深圳领会科技有限公司-版权所有
*/
@Controller
@RequestMapping(value = "/api/cim/crmcfplevelrecordtemp")
@RequestLogging("CrmCfpLevelRecordTempController控制器")
public class CrmCfpLevelRecordTempController {
private static final Logger LOGGER = LoggerFactory.getLogger(CrmCfpLevelRecordTempController.class);
@Resource
private CrmCfpLevelRecordTempService crmCfpLevelRecordTempService;
/**
* 转换器
*
* @param binder
*/
@InitBinder
public void initBinder(WebDataBinder binder) {
binder.registerCustomEditor(Date.class, new DateConvertEditor());
binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
/**
* 查看列表
*/
@RequestMapping(value="/list", method=RequestMethod.GET)
@RequestLogging("查看列表页面")
public String crmCfpLevelRecordTemp(Model model) {
return "crmcfplevelrecordtemp/crmcfplevelrecordtemp-list";
}
/**
* datatables<br>
* @return
*/
@RequestMapping(value="/list", method = RequestMethod.POST)
@ResponseBody
@RequestLogging("查看列表")
public DataTableReturn getCrmCfpLevelRecordTemps(@RequestParam String _dt_json) {
LOGGER.debug("CrmCfpLevelRecordTemp list _dt_json={}", _dt_json);
DataTable dataTable = JsonUtils.fromJsonToObject(_dt_json, DataTable.class);
dataTable.initOrders();
DataTableReturn tableReturn = crmCfpLevelRecordTempService.selectByDatatables(dataTable);
return tableReturn;
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
@RequestLogging("CUD操作")
public DataResult save(@RequestParam String rows) {
DataInfo df = JsonUtils.fromJsonToObject(rows, DataInfo.class);
@SuppressWarnings("unchecked")
Map<String,CrmCfpLevelRecordTemp> map = (Map<String, CrmCfpLevelRecordTemp>) df.getData();
DataResult dr = new DataResult();
List<CrmCfpLevelRecordTemp> datas = new ArrayList<CrmCfpLevelRecordTemp>();
List<ErrorField> errors = new ArrayList<ErrorField>();
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
//下面用到bean属性copy,需要对日期进行转换
DateConverter dateConverter = new DateConverter();
dateConverter.setPattern("yyyy-MM-dd HH:mm:ss");
ConvertUtils.register(dateConverter, java.util.Date.class);
try {
if(DataInfo.ACTION_CREATE.equals(df.getAction())){
for (String key : map.keySet()) {
CrmCfpLevelRecordTemp r = new CrmCfpLevelRecordTemp();
BeanUtils.copyProperties(r, map.get(key));
datas.add(r);
Set<ConstraintViolation<CrmCfpLevelRecordTemp>> constraintViolations = validator.validate(r);
for (ConstraintViolation<CrmCfpLevelRecordTemp> constraintViolation : constraintViolations) {
errors.add(new ErrorField(constraintViolation.getPropertyPath().toString(),constraintViolation.getMessage()));
dr.setFieldErrors(errors);
return dr;
}
this.crmCfpLevelRecordTempService.insert(r);
}
}
if(DataInfo.ACTION_EDIT.equals(df.getAction())){
for (String key : map.keySet()) {
CrmCfpLevelRecordTemp r = new CrmCfpLevelRecordTemp();
BeanUtils.copyProperties(r, map.get(key));
datas.add(r);
Set<ConstraintViolation<CrmCfpLevelRecordTemp>> constraintViolations = validator.validate(r);
for (ConstraintViolation<CrmCfpLevelRecordTemp> constraintViolation : constraintViolations) {
errors.add(new ErrorField(constraintViolation.getPropertyPath().toString(),constraintViolation.getMessage()));
dr.setFieldErrors(errors);
return dr;
}
this.crmCfpLevelRecordTempService.update(r);
}
}
if(DataInfo.ACTION_REMOVE.equals(df.getAction())){
for (String key : map.keySet()) {
this.crmCfpLevelRecordTempService.delete(Long.parseLong(key));
}
}
} catch (Exception e) {
dr.setError(e.getMessage());
}
dr.setData(datas);
return dr;
}
/**
* 理财师职级提醒
* @param appRequestHead
* @return
*/
@RequestMapping(value="/cfpLevelWarning")
@ResponseBody
@RequestLogging("理财师职级提醒")
public BaseResponse cfpLevelWarning(AppRequestHead appRequestHead) {
CfpLevelWarningResp cfpLevelWarningResp = new CfpLevelWarningResp();
String userId = JsonWebTokenHepler.getUserIdByToken(appRequestHead.getToken());//查询userId
cfpLevelWarningResp= crmCfpLevelRecordTempService.cfpLevelWarning(userId);
return AppResponseUtil.getSuccessResponse(cfpLevelWarningResp);
}
}
|
[
"liqimoon@qq.com"
] |
liqimoon@qq.com
|
f2d5950cd651dbfaaa2d1db23cfb2e9cc905c21e
|
a3bd3b51694c78649560a40f91241fda62865b18
|
/src/test/java/com/alibaba/druid/bvt/sql/oracle/select/OracleSelectTest64_with_recursive.java
|
0cbadb01a69dd573672a797b31f77ece66aec253
|
[
"Apache-2.0"
] |
permissive
|
kerry8899/druid
|
e96d7ccbd03353e47a97bea8388d46b2fe173f61
|
a7cd07aac11c49d4d7d3e1312c97b6513efd2daa
|
refs/heads/master
| 2021-01-23T02:00:33.500852
| 2019-03-29T10:14:34
| 2019-03-29T10:14:34
| 85,957,671
| 0
| 0
| null | 2017-03-23T14:14:01
| 2017-03-23T14:14:01
| null |
UTF-8
|
Java
| false
| false
| 5,112
|
java
|
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.bvt.sql.oracle.select;
import com.alibaba.druid.sql.OracleTest;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser;
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleSchemaStatVisitor;
import org.junit.Assert;
import java.util.List;
public class OracleSelectTest64_with_recursive extends OracleTest {
public void test_0() throws Exception {
String sql = //
"WITH t1(id, parent_id, lvl) AS (\n" +
" -- Anchor member.\n" +
" SELECT id,\n" +
" parent_id,\n" +
" 1 AS lvl\n" +
" FROM tab1\n" +
" WHERE parent_id IS NULL\n" +
" UNION ALL\n" +
" -- Recursive member.\n" +
" SELECT t2.id,\n" +
" t2.parent_id,\n" +
" lvl+1\n" +
" FROM tab1 t2, t1\n" +
" WHERE t2.parent_id = t1.id\n" +
")\n" +
"SEARCH DEPTH FIRST BY id SET order1\n" +
"SELECT id,\n" +
" parent_id,\n" +
" RPAD('.', (lvl-1)*2, '.') || id AS tree,\n" +
" lvl\n" +
"FROM t1\n" +
"ORDER BY order1;"; //
OracleStatementParser parser = new OracleStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement stmt = statementList.get(0);
print(statementList);
Assert.assertEquals(1, statementList.size());
OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor();
stmt.accept(visitor);
System.out.println("Tables : " + visitor.getTables());
System.out.println("fields : " + visitor.getColumns());
System.out.println("coditions : " + visitor.getConditions());
System.out.println("relationships : " + visitor.getRelationships());
System.out.println("orderBy : " + visitor.getOrderByColumns());
Assert.assertEquals(1, visitor.getTables().size());
Assert.assertEquals(2, visitor.getColumns().size());
{
String text = SQLUtils.toOracleString(stmt);
assertEquals("WITH t1 (id, parent_id, lvl) AS (\n" +
"\t\t-- Anchor member.\n" +
"\t\tSELECT id, parent_id, 1 AS lvl\n" +
"\t\tFROM tab1\n" +
"\t\tWHERE parent_id IS NULL\n" +
"\t\tUNION ALL\n" +
"\t\t-- Recursive member.\n" +
"\t\tSELECT t2.id, t2.parent_id, lvl + 1\n" +
"\t\tFROM tab1 t2, t1\n" +
"\t\tWHERE t2.parent_id = t1.id\n" +
"\t)\n" +
"\tSEARCH DEPTH FIRST BY id SET order1\n" +
"SELECT id, parent_id\n" +
"\t, RPAD('.', (lvl - 1) * 2, '.') || id AS tree\n" +
"\t, lvl\n" +
"FROM t1\n" +
"ORDER BY order1;", text);
}
{
String text = SQLUtils.toOracleString(stmt, SQLUtils.DEFAULT_LCASE_FORMAT_OPTION);
assertEquals("with t1 (id, parent_id, lvl) as (\n" +
"\t\t-- Anchor member.\n" +
"\t\tselect id, parent_id, 1 as lvl\n" +
"\t\tfrom tab1\n" +
"\t\twhere parent_id is null\n" +
"\t\tunion all\n" +
"\t\t-- Recursive member.\n" +
"\t\tselect t2.id, t2.parent_id, lvl + 1\n" +
"\t\tfrom tab1 t2, t1\n" +
"\t\twhere t2.parent_id = t1.id\n" +
"\t)\n" +
"\tsearch DEPTH first by id set order1\n" +
"select id, parent_id\n" +
"\t, RPAD('.', (lvl - 1) * 2, '.') || id as tree\n" +
"\t, lvl\n" +
"from t1\n" +
"order by order1;", text);
}
}
}
|
[
"372822716@qq.com"
] |
372822716@qq.com
|
d0ffbc0d1d592dc6f3e6b0aa6000c4be419d3f30
|
51aaa3596d0399c712074fcf741ab32de44b5bca
|
/java7/concurrency/semaphore/ThreadTestJavaSemaphore.java
|
689722b3c71c47d296c2ba0931953f9b0675035d
|
[
"Apache-2.0"
] |
permissive
|
Alung-0/design-2
|
e1c1c01a3f3d20346aec73865b162a73146993a6
|
bab5f1760c731e8f5e9739b23c14de320ddf56fb
|
refs/heads/master
| 2021-07-11T20:10:49.322068
| 2017-10-15T01:09:28
| 2017-10-15T01:09:28
| 107,242,352
| 1
| 0
| null | 2017-10-17T08:50:32
| 2017-10-17T08:50:31
| null |
UTF-8
|
Java
| false
| false
| 735
|
java
|
public class ThreadTestJavaSemaphore extends Thread
{
private java.util.concurrent.Semaphore sem ;
public ThreadTestJavaSemaphore( String n, java.util.concurrent.Semaphore s )
{
super(n) ;
this.sem = s ;
}
public void run()
{
for ( int i=0; i<5; i++)
{
try {
sem.acquire() ;
System.out.println( Thread.currentThread() + " Running Task # " + i + "..." ) ;
sleep(5000) ; // simulate busy work... (sleep for 5 seconds)
sem.release() ;
}
catch (Exception e) {
System.out.println( e.getMessage() ) ;
}
}
}
}
|
[
"paul.nguyen@sjsu.edu"
] |
paul.nguyen@sjsu.edu
|
9e5204657533243001237edc2411dc35d0fe89a8
|
6d338704ba861bde856e8a527598284eca45d58c
|
/src/main/java/com/java/cube/security/jwt/TokenProvider.java
|
cd750e7bcc1427d6546b48b7b1422155aea86b6f
|
[] |
no_license
|
asdgithub870/jhipster-sample-application
|
1e17c07a042e2e6094d8d10d38d4ec33f607d003
|
413c1ab93c1c5042c09b2b7006fafd9ab8e937a2
|
refs/heads/master
| 2022-12-08T08:10:24.205125
| 2020-08-06T14:51:47
| 2020-08-06T14:51:47
| 285,587,289
| 0
| 0
| null | 2020-08-27T00:01:16
| 2020-08-06T14:06:24
|
Java
|
UTF-8
|
Java
| false
| false
| 4,140
|
java
|
package com.java.cube.security.jwt;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private Key key;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final JHipsterProperties jHipsterProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@PostConstruct
public void init() {
byte[] keyBytes;
String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret();
if (!StringUtils.isEmpty(secret)) {
log.warn(
"Warning: the JWT key used is not Base64-encoded. " +
"We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security."
);
keyBytes = secret.getBytes(StandardCharsets.UTF_8);
} else {
log.debug("Using a Base64-encoded JWT secret key");
keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret());
}
this.key = Keys.hmacShaKeyFor(keyBytes);
this.tokenValidityInMilliseconds = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds();
this.tokenValidityInMillisecondsForRememberMe =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe();
}
public String createToken(Authentication authentication, boolean rememberMe) {
String authorities = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(","));
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts
.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities)
.signWith(key, SignatureAlgorithm.HS512)
.setExpiration(validity)
.compact();
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token).getBody();
Collection<? extends GrantedAuthority> authorities = Arrays
.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
User principal = new User(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}
public boolean validateToken(String authToken) {
try {
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(authToken);
return true;
} catch (JwtException | IllegalArgumentException e) {
log.info("Invalid JWT token.");
log.trace("Invalid JWT token trace.", e);
}
return false;
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
ae13297671c0cb4c4a4adda5ba047287fee391df
|
02fdb306df1ca9b06c4056cc251dd69d02c31628
|
/Websocket with Kafka/src/main/java/com/spring/microservices/kafka/configuration/KafkaConfiguration.java
|
dfc1954b6b46f7234e08ed1446cf9ee611a9c2ca
|
[
"Apache-2.0"
] |
permissive
|
soumyadip007/Distributed-System-Message-Broking-Log-Monitoring-using-Websocket-Netflix-OSS-Kafka-and-Microservice
|
3d0d3cffb9b5609e96decba68850e5ecb59782c6
|
0bebb8c5c6c97ba7f02fcbc6c052328f9713f68c
|
refs/heads/master
| 2022-09-14T10:47:17.991386
| 2020-05-26T05:57:21
| 2020-05-26T05:57:21
| 266,951,685
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,620
|
java
|
package com.spring.microservices.kafka.configuration;
import java.util.HashMap;
import java.util.Map;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
@EnableKafka
@Configuration
public class KafkaConfiguration {
//-----------------------String-String-----------------------
@Bean
public ConsumerFactory<String, String> consumerFactory() {
Map<String, Object> config = new HashMap<>();
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG, "group_id");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
return new DefaultKafkaConsumerFactory<>(config);
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory();
factory.setConsumerFactory(consumerFactory());
return factory;
}
}
|
[
"soumyadip.note@gmail.com"
] |
soumyadip.note@gmail.com
|
10614668e3e64b4199ea39605ac4ed9db8915260
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/validation/io/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java
|
ba7bb58ae0ff6bb4c090b31721c980eb748c88bf
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 3,941
|
java
|
/**
* Copyright 1999-2015 dangdang.com.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
package io.elasticjob.lite.internal.sharding;
import com.google.common.collect.Lists;
import io.elasticjob.lite.config.JobCoreConfiguration;
import io.elasticjob.lite.config.LiteJobConfiguration;
import io.elasticjob.lite.executor.ShardingContexts;
import io.elasticjob.lite.fixture.TestDataflowJob;
import io.elasticjob.lite.internal.config.ConfigurationService;
import io.elasticjob.lite.internal.storage.JobNodeStorage;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import junit.framework.TestCase;
import org.hamcrest.core.Is;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
public final class ExecutionContextServiceTest {
@Mock
private JobNodeStorage jobNodeStorage;
@Mock
private ConfigurationService configService;
private final ExecutionContextService executionContextService = new ExecutionContextService(null, "test_job");
@Test
public void assertGetShardingContextWhenNotAssignShardingItem() {
Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(false).build());
ShardingContexts shardingContexts = executionContextService.getJobShardingContext(Collections.<Integer>emptyList());
TestCase.assertTrue(shardingContexts.getTaskId().startsWith("test_job@-@@-@READY@-@"));
Assert.assertThat(shardingContexts.getShardingTotalCount(), Is.is(3));
}
@Test
public void assertGetShardingContextWhenAssignShardingItems() {
Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).shardingItemParameters("0=A,1=B,2=C").build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(false).build());
Map<Integer, String> map = new HashMap<>(3);
map.put(0, "A");
map.put(1, "B");
ShardingContexts expected = new ShardingContexts("fake_task_id", "test_job", 3, "", map);
assertShardingContext(executionContextService.getJobShardingContext(Arrays.asList(0, 1)), expected);
}
@Test
public void assertGetShardingContextWhenHasRunningItems() {
Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).shardingItemParameters("0=A,1=B,2=C").build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(true).build());
Mockito.when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false);
Mockito.when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true);
Map<Integer, String> map = new HashMap<>(1, 1);
map.put(0, "A");
ShardingContexts expected = new ShardingContexts("fake_task_id", "test_job", 3, "", map);
assertShardingContext(executionContextService.getJobShardingContext(Lists.newArrayList(0, 1)), expected);
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
3cc273b5bd6add57101d914151b41da828435cab
|
7926a7bd472e630ff69443868ec7f6878c9a9ad1
|
/ScreenNavigationDemo/app/src/main/java/com/bipulhstu/screennavigationdemo/NepalFragment.java
|
7dd66a1d0659cb25903301e7b2cc9c26724def90
|
[] |
no_license
|
bipulhstu/Android-Studio-Projects
|
80a409dc0474bfe111ef41b57bba5d3a4a920add
|
a74d80707e2a37dddeeffa20d04dbf9db6be599b
|
refs/heads/master
| 2020-04-05T19:48:53.593202
| 2020-01-01T08:50:29
| 2020-01-01T08:50:29
| 157,151,340
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 665
|
java
|
package com.bipulhstu.screennavigationdemo;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
*/
public class NepalFragment extends Fragment {
public NepalFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_nepal, container, false);
}
}
|
[
"bipulhstu@gmail.com"
] |
bipulhstu@gmail.com
|
a032eafda36f41a63b1761d6630634ec732becd8
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/1/1_e376e1bb7b163fa5d9f9b575a3e0fa80220dc263/ResourceConstants/1_e376e1bb7b163fa5d9f9b575a3e0fa80220dc263_ResourceConstants_t.java
|
1ab5ffb95cfdd72bfa18f685819f34edd6c0fa5b
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,731
|
java
|
/*******************************************************************************
* Copyright (c) 2004 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.birt.report.resource;
public interface ResourceConstants
{
// dialog title
public static final String EXCEPTION_DIALOG_TITLE = "birt.viewer.dialog.exception.title"; //$NON-NLS-1$
public static final String EXPORT_REPORT_DIALOG_TITLE = "birt.viewer.dialog.exportReport.title"; //$NON-NLS-1$
public static final String PARAMETER_DIALOG_TITLE = "birt.viewer.dialog.parameter.title"; //$NON-NLS-1$
public static final String SIMPLE_EXPORT_DATA_DIALOG_TITLE = "birt.viewer.dialog.simpleExportData.title"; //$NON-NLS-1$
/**
* Page title for the "web viewer", "html" preview.
*/
public static final String BIRT_VIEWER_TITLE = "birt.viewer.title"; //$NON-NLS-1$
// general exception
public static final String GENERAL_EXCEPTION_DOCUMENT_FILE_ERROR = "birt.viewer.generalException.DOCUMENT_FILE_ERROR"; //$NON-NLS-1$
public static final String GENERAL_EXCEPTION_DOCUMENT_ACCESS_ERROR = "birt.viewer.generalException.DOCUMENT_ACCESS_ERROR"; //$NON-NLS-1$
public static final String GENERAL_EXCEPTION_REPORT_FILE_ERROR = "birt.viewer.generalException.REPORT_FILE_ERROR"; //$NON-NLS-1$
public static final String GENERAL_EXCEPTION_REPORT_ACCESS_ERROR = "birt.viewer.generalException.REPORT_ACCESS_ERROR"; //$NON-NLS-1$
public static final String GENERAL_EXCEPTION_DOCUMENT_FILE_PROCESSING = "birt.viewer.generalException.DOCUMENT_FILE_PROCESSING"; //$NON-NLS-1$
// report service exception
public static final String REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_DOCUMENT = "birt.viewer.reportServiceException.EXTRACT_DATA_NO_DOCUMENT"; //$NON-NLS-1$
public static final String REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_RESULT_SET = "birt.viewer.reportServiceException.EXTRACT_DATA_NO_RESULT_SET"; //$NON-NLS-1$
public static final String REPORT_SERVICE_EXCEPTION_INVALID_TOC = "birt.viewer.reportServiceException.INVALID_TOC"; //$NON-NLS-1$
public static final String REPORT_SERVICE_EXCEPTION_INVALID_PARAMETER = "birt.viewer.reportServiceException.INVALID_PARAMETER"; //$NON-NLS-1$
// birt action exception
public static final String ACTION_EXCEPTION_NO_REPORT_DOCUMENT = "birt.viewer.actionException.NO_REPORT_DOCUMENT"; //$NON-NLS-1$
public static final String ACTION_EXCEPTION_INVALID_BOOKMARK = "birt.viewer.actionException.INVALID_BOOKMARK"; //$NON-NLS-1$
public static final String ACTION_EXCEPTION_INVALID_PAGE_NUMBER = "birt.viewer.actionException.INVALID_PAGE_NUMBER"; //$NON-NLS-1$
public static final String ACTION_EXCEPTION_INVALID_ID_FORMAT = "birt.viewer.actionException.INVALID_ID_FORMAT"; //$NON-NLS-1$
public static final String ACTION_EXCEPTION_DOCUMENT_FILE_NO_EXIST = "birt.viewer.actionException.DOCUMENT_FILE_NO_EXIST"; //$NON-NLS-1$
// birt soap binding exception
public static final String SOAP_BINDING_EXCEPTION_NO_HANDLER_FOR_TARGET = "birt.viewer.soapBindingException.NO_HANDLER_FOR_TARGET"; //$NON-NLS-1$
// component processor exception
public static final String COMPONENT_PROCESSOR_EXCEPTION_MISSING_OPERATOR = "birt.viewer.componentProcessorException.MISSING_OPERATOR"; //$NON-NLS-1$
// stack trace title
public static final String EXCEPTION_DIALOG_STACK_TRACE = "birt.viewer.exceptionDialog.stackTrace"; //$NON-NLS-1$
public static final String EXCEPTION_DIALOG_SHOW_STACK_TRACE = "birt.viewer.exceptionDialog.showStackTrace"; //$NON-NLS-1$
public static final String EXCEPTION_DIALOG_HIDE_STACK_TRACE = "birt.viewer.exceptionDialog.hideStackTrace"; //$NON-NLS-1$
// viewer taglib excepton
public static final String TAGLIB_NO_VIEWER_ID = "birt.viewer.taglib.NO_VIEWER_ID"; //$NON-NLS-1$
public static final String TAGLIB_INVALID_VIEWER_ID = "birt.viewer.taglib.INVALID_VIEWER_ID"; //$NON-NLS-1$
public static final String TAGLIB_VIEWER_ID_DUPLICATE = "birt.viewer.taglib.VIEWER_ID_DUPLICATE"; //$NON-NLS-1$
public static final String TAGLIB_NO_REPORT_SOURCE = "birt.viewer.taglib.NO_REPORT_SOURCE"; //$NON-NLS-1$
public static final String TAGLIB_NO_REPORT_DOCUMENT = "birt.viewer.taglib.NO_REPORT_DOCUMENT"; //$NON-NLS-1$
public static final String TAGLIB_NO_REQUESTER_NAME = "birt.viewer.taglib.NO_REQUESTER_NAME"; //$NON-NLS-1$
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
6ca01c1240ab18e346deae24f36b9476d921889d
|
43d07af1742e01001c17eba4196f30156b08fbcc
|
/com/sun/tools/doclets/internal/toolkit/util/TaggedMethodFinder.java
|
92706c9a7aabc0f5dcc7604d80385cf34d096c62
|
[] |
no_license
|
kSuroweczka/jdk
|
b408369b4b87ab09a828aa3dbf9132aaf8bb1b71
|
7ec3e8e31fcfb616d4a625191bcba0191ca7c2d4
|
refs/heads/master
| 2021-12-30T00:58:24.029054
| 2018-02-01T10:07:14
| 2018-02-01T10:07:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 650
|
java
|
/* */ package com.sun.tools.doclets.internal.toolkit.util;
/* */
/* */ import com.sun.javadoc.MethodDoc;
/* */
/* */ public class TaggedMethodFinder extends MethodFinder
/* */ {
/* */ public boolean isCorrectMethod(MethodDoc paramMethodDoc)
/* */ {
/* 43 */ return paramMethodDoc.paramTags().length + paramMethodDoc.tags("return").length + paramMethodDoc
/* 43 */ .throwsTags().length + paramMethodDoc.seeTags().length > 0;
/* */ }
/* */ }
/* Location: D:\dt\jdk\tools.jar
* Qualified Name: com.sun.tools.doclets.internal.toolkit.util.TaggedMethodFinder
* JD-Core Version: 0.6.2
*/
|
[
"starlich.1207@gmail.com"
] |
starlich.1207@gmail.com
|
6b9727cedcbe345c9381535fbe50ffdbda1a6900
|
245df73088d126177f823c3f7bcb33a6821e90d5
|
/app/src/main/java/com/skycaster/douban/util/ToastUtil.java
|
154361c6b8cbb8a5106b1c63a0008811f8bb348e
|
[
"Apache-2.0"
] |
permissive
|
leoliao2008/douban
|
cfdcbfd9545a757127ad9b15792a1e7cb5a9e250
|
81fe2302cbd2147068177db5b1c9478187b1a869
|
refs/heads/master
| 2020-03-10T06:09:35.054518
| 2018-04-13T09:52:07
| 2018-04-13T09:52:07
| 129,233,222
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 497
|
java
|
package com.skycaster.douban.util;
import android.widget.Toast;
import com.skycaster.douban.base.BaseApplication;
/**
* Created by 廖华凯 on 2018/4/10.
*/
public class ToastUtil {
private static Toast toast;
private ToastUtil(){};
public static void showToast(String msg){
if(toast==null){
toast=Toast.makeText(BaseApplication.getContext(),msg,Toast.LENGTH_SHORT);
}else {
toast.setText(msg);
}
toast.show();
}
}
|
[
"leoliao2008@163.com"
] |
leoliao2008@163.com
|
e840886b336a55ddb695e518334b675d03cd3644
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/serge-rider--dbeaver/49d1f794c97eefd4b42c097ce60692d7eac291ec/before/IDataSourceConnectionEditorSite.java
|
48aa3de526b45fc212e4726a04a76f435ddb1462
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,596
|
java
|
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.ui;
import org.eclipse.jface.operation.IRunnableContext;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.DBPConnectionInfo;
import org.jkiss.dbeaver.model.DBPDriver;
import org.jkiss.dbeaver.model.runtime.DBRRunnableContext;
import org.jkiss.dbeaver.model.struct.DBSDataSourceContainer;
import org.jkiss.dbeaver.registry.DataSourceDescriptor;
import org.jkiss.dbeaver.registry.DataSourceRegistry;
/**
* IDataSourceConnectionEditorSite
*/
public interface IDataSourceConnectionEditorSite
{
DBRRunnableContext getRunnableContext();
DataSourceRegistry getDataSourceRegistry();
boolean isNew();
DBPDriver getDriver();
@NotNull
DataSourceDescriptor getActiveDataSource();
void updateButtons();
boolean openDriverEditor();
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
9d39c0e414e4185f7cc064774b3f0a0f853d305a
|
bf664a1e3a74874a40d8538984717c99a0dd8110
|
/gulimall-order/src/main/java/com/atguigu/gulimall/order/controller/OrderOperateHistoryController.java
|
541b3dc8b9d997cff390cc00a902192fcb83ed52
|
[] |
no_license
|
suxiuwei0809/gulimall
|
10ae232d7f433754b861ecd4c9fede4c7fc33186
|
5f9b0545e8688a148b3ab3c9df6eeadd3a6b2882
|
refs/heads/master
| 2023-09-02T13:47:57.861220
| 2021-10-30T07:19:58
| 2021-10-30T07:19:58
| 383,183,986
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,493
|
java
|
package com.atguigu.gulimall.order.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.atguigu.gulimall.order.entity.OrderOperateHistoryEntity;
import com.atguigu.gulimall.order.service.OrderOperateHistoryService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.R;
/**
* 订单操作历史记录
*
* @author suxiuwei
* @email suxiuwei0809@outlook.com
* @date 2021-05-10 23:21:25
*/
@RestController
@RequestMapping("order/orderoperatehistory")
public class OrderOperateHistoryController {
@Autowired
private OrderOperateHistoryService orderOperateHistoryService;
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("order:orderoperatehistory:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = orderOperateHistoryService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("order:orderoperatehistory:info")
public R info(@PathVariable("id") Long id){
OrderOperateHistoryEntity orderOperateHistory = orderOperateHistoryService.getById(id);
return R.ok().put("orderOperateHistory", orderOperateHistory);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("order:orderoperatehistory:save")
public R save(@RequestBody OrderOperateHistoryEntity orderOperateHistory){
orderOperateHistoryService.save(orderOperateHistory);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("order:orderoperatehistory:update")
public R update(@RequestBody OrderOperateHistoryEntity orderOperateHistory){
orderOperateHistoryService.updateById(orderOperateHistory);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("order:orderoperatehistory:delete")
public R delete(@RequestBody Long[] ids){
orderOperateHistoryService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
|
[
"suxiuwei0809@outlook.com"
] |
suxiuwei0809@outlook.com
|
f81b3e52194e99046782459a13b789d87bf14947
|
5fa40394963baf973cfd5a3770c1850be51efaae
|
/src/NHSensor/NHSensorSim/test/ReserveAdaptiveGridTraverseRectEventTest.java
|
2d516ed061aee85d8a13001e56eb4d1fc821c6d0
|
[] |
no_license
|
yejuns/wsn_java
|
5c4d97cb6bc41b91ed16eafca5d14128ed45ed44
|
f071cc72411ecc2866bff3dfc356f38b0c817411
|
refs/heads/master
| 2020-05-14T13:54:14.690176
| 2018-01-28T02:51:44
| 2018-01-28T02:51:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,164
|
java
|
package NHSensor.NHSensorSim.test;
import org.apache.log4j.PropertyConfigurator;
import NHSensor.NHSensorSim.algorithm.GPSRAttachmentAlg;
import NHSensor.NHSensorSim.core.Message;
import NHSensor.NHSensorSim.core.NeighborAttachment;
import NHSensor.NHSensorSim.core.SensorSim;
import NHSensor.NHSensorSim.events.DrawShapeEvent;
import NHSensor.NHSensorSim.events.ReserveAdaptiveGridTraverseRectEvent;
import NHSensor.NHSensorSim.shape.Rect;
import NHSensor.NHSensorSim.shapeTraverse.Direction;
import NHSensor.NHSensorSim.ui.Animator;
public class ReserveAdaptiveGridTraverseRectEventTest {
/**
* @param args
*/
public static void main(String[] args) {
PropertyConfigurator.configure("config/log4j.properties");
SensorSim sensorSim = SensorSim.createSensorSim(3, 450, 450, 600);
sensorSim.getSimulator().addHandleAndTraceEventListener();
sensorSim.addAlgorithm(GPSRAttachmentAlg.NAME);
GPSRAttachmentAlg alg = (GPSRAttachmentAlg) sensorSim
.getAlgorithm(GPSRAttachmentAlg.NAME);
alg.setQuery(null);
sensorSim.run();
alg.getParam().setANSWER_SIZE(30);
NeighborAttachment root = (NeighborAttachment) alg.getNetwork()
.get2LRTNode().getAttachment(alg.getName());
double width = 40;
double height = 300;
double minx = alg.getNetwork().getRect().getCentre().getX() - width / 2;
double maxx = alg.getNetwork().getRect().getCentre().getX() + width / 2;
double miny = alg.getNetwork().getRect().getCentre().getY() - height
/ 2;
double maxy = alg.getNetwork().getRect().getCentre().getY() + height
/ 2;
Rect rect = new Rect(minx, maxx, miny, maxy);
DrawShapeEvent drawShapeEvent = new DrawShapeEvent(alg, rect);
alg.run(drawShapeEvent);
Message queryAndPatialAnswerMesage = new Message(alg.getParam()
.getANSWER_SIZE()
+ alg.getParam().getQUERY_MESSAGE_SIZE(), null);
ReserveAdaptiveGridTraverseRectEvent e = new ReserveAdaptiveGridTraverseRectEvent(
root, rect, Direction.DOWN, queryAndPatialAnswerMesage, true,
alg);
alg.run(e);
sensorSim.printStatistic();
Animator animator = new Animator(alg);
animator.start();
}
}
|
[
"lixinlu2000@163.com"
] |
lixinlu2000@163.com
|
83d09c226710bef5f346d23322626d19db0fe106
|
4ed13753f5bc20ec143dc25039280f80c3edddd8
|
/gosu-core-api/src/main/java/gw/lang/ir/builder/expression/IRCompositeExpressionBuilder.java
|
fed62ad83fb5308a269cf3b156df670e170dbb50
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] |
permissive
|
hmsck/gosu-lang
|
180a96aab69ff0184700e70876bb0cf10c8a938f
|
78c5f6c839597a81ac5ec75a46259cbb6ad40545
|
refs/heads/master
| 2021-02-13T06:53:30.208378
| 2019-10-31T23:15:13
| 2019-10-31T23:15:13
| 244,672,021
| 0
| 0
|
Apache-2.0
| 2020-03-03T15:27:47
| 2020-03-03T15:27:46
| null |
UTF-8
|
Java
| false
| false
| 1,141
|
java
|
/*
* Copyright 2014 Guidewire Software, Inc.
*/
package gw.lang.ir.builder.expression;
import gw.lang.ir.builder.IRExpressionBuilder;
import gw.lang.ir.builder.IRBuilderContext;
import gw.lang.ir.builder.IRStatementBuilder;
import gw.lang.ir.IRExpression;
import gw.lang.ir.IRElement;
import gw.lang.ir.expression.IRCompositeExpression;
import gw.lang.UnstableAPI;
import java.util.List;
import java.util.ArrayList;
@UnstableAPI
public class IRCompositeExpressionBuilder extends IRExpressionBuilder {
private List<IRStatementBuilder> _statements;
private IRExpressionBuilder _finalExpression;
public IRCompositeExpressionBuilder(List<IRStatementBuilder> statements, IRExpressionBuilder finalExpression) {
_statements = statements;
_finalExpression = finalExpression;
}
@Override
protected IRExpression buildImpl(IRBuilderContext context) {
List<IRElement> elements = new ArrayList<IRElement>();
for (IRStatementBuilder statement : _statements) {
elements.add(statement.build(context));
}
elements.add(_finalExpression.build(context));
return new IRCompositeExpression(elements);
}
}
|
[
"lboasso@guidewire.com"
] |
lboasso@guidewire.com
|
823228b2ceba72b37ba12ee33d25a0c365e61047
|
025e98285be2fbefa919bde70f3614fdb0f2f6dc
|
/src/main/java/com/smalaca/ebook/domain/BookStorage.java
|
dc6e6d76feb0ea1b9dd955dd314b5db9f4334e0c
|
[] |
no_license
|
smalaca/ebook-library
|
206c01d495f077a6e2bab8fc73bc593e05308c53
|
04cc8d673c64fdb5c17e1955977957ce2736932d
|
refs/heads/master
| 2021-05-05T06:47:29.260180
| 2018-02-11T14:58:30
| 2018-02-11T14:58:30
| 118,826,288
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 194
|
java
|
package com.smalaca.ebook.domain;
public interface BookStorage {
void add(String title, String author);
boolean exists(String title, String author);
Book searchBy(String isbn);
}
|
[
"ab13.krakow@gmail.com"
] |
ab13.krakow@gmail.com
|
003c7a4ce07294cdedea1eb9c86d6a9ed9e4f036
|
4cdc04aad16506fdbf1d997609f9f60647974782
|
/org/telegram/messenger/volley/toolbox/ByteArrayPool.java
|
61b5647d64f744c28ad5e21c85eefc073a54af86
|
[] |
no_license
|
lcastro12/TelegramAnalysis1
|
db9ccb2889758500c5cb9b58db2c55b692e68b74
|
f8c7579db27eeb70d1a2105d1dca59239389b60f
|
refs/heads/master
| 2020-03-15T19:14:56.203309
| 2018-05-07T00:09:46
| 2018-05-07T00:09:46
| 132,303,828
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,031
|
java
|
package org.telegram.messenger.volley.toolbox;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
public class ByteArrayPool {
protected static final Comparator<byte[]> BUF_COMPARATOR = new C06741();
private List<byte[]> mBuffersByLastUse = new LinkedList();
private List<byte[]> mBuffersBySize = new ArrayList(64);
private int mCurrentSize = 0;
private final int mSizeLimit;
static class C06741 implements Comparator<byte[]> {
C06741() {
}
public int compare(byte[] lhs, byte[] rhs) {
return lhs.length - rhs.length;
}
}
public ByteArrayPool(int sizeLimit) {
this.mSizeLimit = sizeLimit;
}
public synchronized byte[] getBuf(int len) {
byte[] buf;
for (int i = 0; i < this.mBuffersBySize.size(); i++) {
buf = (byte[]) this.mBuffersBySize.get(i);
if (buf.length >= len) {
this.mCurrentSize -= buf.length;
this.mBuffersBySize.remove(i);
this.mBuffersByLastUse.remove(buf);
break;
}
}
buf = new byte[len];
return buf;
}
public synchronized void returnBuf(byte[] buf) {
if (buf != null) {
if (buf.length <= this.mSizeLimit) {
this.mBuffersByLastUse.add(buf);
int pos = Collections.binarySearch(this.mBuffersBySize, buf, BUF_COMPARATOR);
if (pos < 0) {
pos = (-pos) - 1;
}
this.mBuffersBySize.add(pos, buf);
this.mCurrentSize += buf.length;
trim();
}
}
}
private synchronized void trim() {
while (this.mCurrentSize > this.mSizeLimit) {
byte[] buf = (byte[]) this.mBuffersByLastUse.remove(0);
this.mBuffersBySize.remove(buf);
this.mCurrentSize -= buf.length;
}
}
}
|
[
"l.castro12@uniandes.edu.co"
] |
l.castro12@uniandes.edu.co
|
10b142547c943f23671e12e2b0dfffc671c56e5d
|
995e655293513d0b9f93d62e28f74b436245ae74
|
/src/com/htc/b/a/m.java
|
21bad5a85ec14283a89e08d6599b52fa53b1c0ac
|
[] |
no_license
|
JALsnipe/HTC-RE-YouTube-Live-Android
|
796e7c97898cac41f0f53120e79cde90d3f2fab1
|
f941b64ad6445c0a0db44318651dc76715291839
|
refs/heads/master
| 2021-01-17T09:46:50.725810
| 2015-01-09T23:32:14
| 2015-01-09T23:32:14
| 29,039,855
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,054
|
java
|
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.htc.b.a;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import com.htc.gc.connectivity.a.a.j;
import com.htc.gc.connectivity.a.a.n;
// Referenced classes of package com.htc.b.a:
// b
class m
implements Runnable
{
final b a;
m(b b1)
{
a = b1;
super();
}
public void run()
{
Message message = Message.obtain();
message.what = 8700;
Bundle bundle = new Bundle();
bundle.putSerializable("result", j.a);
bundle.putSerializable("verify_password_status", n.c);
message.setData(bundle);
try
{
b.a(a).send(message);
return;
}
catch (RemoteException remoteexception)
{
remoteexception.printStackTrace();
}
}
}
|
[
"josh.lieberman92@gmail.com"
] |
josh.lieberman92@gmail.com
|
13eb9b6c9a96271cd29386398a6f6137099c1a22
|
7b73756ba240202ea92f8f0c5c51c8343c0efa5f
|
/classes2/tfq.java
|
c598e3dd5d66d81ed829c9d0bd8d1e35a13868c4
|
[] |
no_license
|
meeidol-luo/qooq
|
588a4ca6d8ad579b28dec66ec8084399fb0991ef
|
e723920ac555e99d5325b1d4024552383713c28d
|
refs/heads/master
| 2020-03-27T03:16:06.616300
| 2016-10-08T07:33:58
| 2016-10-08T07:33:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,596
|
java
|
import android.os.IBinder;
import android.os.Parcel;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.mobileqq.music.IQQPlayerCallback;
public class tfq
implements IQQPlayerCallback
{
private IBinder a;
public tfq(IBinder paramIBinder)
{
boolean bool = NotVerifyClass.DO_VERIFY_CLASS;
this.a = paramIBinder;
}
public String a()
{
return "com.tencent.mobileqq.music.IQQPlayerCallback";
}
public void a(int paramInt)
{
Parcel localParcel = Parcel.obtain();
try
{
localParcel.writeInterfaceToken("com.tencent.mobileqq.music.IQQPlayerCallback");
localParcel.writeInt(paramInt);
this.a.transact(1, localParcel, null, 1);
return;
}
finally
{
localParcel.recycle();
}
}
/* Error */
public void a(com.tencent.mobileqq.music.SongInfo paramSongInfo)
{
// Byte code:
// 0: invokestatic 32 android/os/Parcel:obtain ()Landroid/os/Parcel;
// 3: astore_2
// 4: aload_2
// 5: ldc 25
// 7: invokevirtual 36 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V
// 10: aload_1
// 11: ifnull +33 -> 44
// 14: aload_2
// 15: iconst_1
// 16: invokevirtual 39 android/os/Parcel:writeInt (I)V
// 19: aload_1
// 20: aload_2
// 21: iconst_0
// 22: invokevirtual 55 com/tencent/mobileqq/music/SongInfo:writeToParcel (Landroid/os/Parcel;I)V
// 25: aload_0
// 26: getfield 21 tfq:a Landroid/os/IBinder;
// 29: iconst_2
// 30: aload_2
// 31: aconst_null
// 32: iconst_1
// 33: invokeinterface 45 5 0
// 38: pop
// 39: aload_2
// 40: invokevirtual 48 android/os/Parcel:recycle ()V
// 43: return
// 44: aload_2
// 45: iconst_0
// 46: invokevirtual 39 android/os/Parcel:writeInt (I)V
// 49: goto -24 -> 25
// 52: astore_1
// 53: aload_2
// 54: invokevirtual 48 android/os/Parcel:recycle ()V
// 57: aload_1
// 58: athrow
// Local variable table:
// start length slot name signature
// 0 59 0 this tfq
// 0 59 1 paramSongInfo com.tencent.mobileqq.music.SongInfo
// 3 51 2 localParcel Parcel
// Exception table:
// from to target type
// 4 10 52 finally
// 14 25 52 finally
// 25 39 52 finally
// 44 49 52 finally
}
public IBinder asBinder()
{
return this.a;
}
}
/* Location: E:\apk\QQ_91\classes2-dex2jar.jar!\tfq.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"1776098770@qq.com"
] |
1776098770@qq.com
|
ed88f90d561a10a9c55a9fcc642bb584805b58f7
|
64266ad06b6f7e75981996000bdf1208717b0296
|
/src/com/hewie/leetcode/LeetCode888.java
|
510bba149f0f752ee3945cd0fc92399cce9c2d1c
|
[] |
no_license
|
hewiezhangB/ideaTest
|
127f708098c08803c4f1870670e9a1ba0243ffb3
|
3b67dc5197012fcd0c0278575740c2349a838ea3
|
refs/heads/master
| 2023-07-09T23:47:37.466152
| 2021-08-09T07:08:26
| 2021-08-09T07:08:26
| 394,166,690
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 703
|
java
|
package com.hewie.leetcode;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class LeetCode888 {
public int[] fairCandySwap(int[] A, int[] B) {
int sumA = Arrays.stream(A).sum();
int sumB = Arrays.stream(B).sum();
int delta = (sumA - sumB) / 2;
Set<Integer> rec = new HashSet<Integer>();
for (int num : A) {
rec.add(num);
}
int[] ans = new int[2];
for (int y : B) {
int x = y + delta;
if (rec.contains(x)) {
ans[0] = x;
ans[1] = y;
break;
}
}
return ans;
}
}
|
[
"l"
] |
l
|
189f2edd4f681c3beb06a35235d86411b5471836
|
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
|
/schemaOrgGson/src/org/kyojo/schemaorg/m3n4/gson/core/container/AdditionalNameDeserializer.java
|
022eb6d0500a05a24ad053fdf23a63737141bb26
|
[
"Apache-2.0"
] |
permissive
|
nagaikenshin/schemaOrg
|
3dec1626781913930da5585884e3484e0b525aea
|
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
|
refs/heads/master
| 2021-06-25T04:52:49.995840
| 2019-05-12T06:22:37
| 2019-05-12T06:22:37
| 134,319,974
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,073
|
java
|
package org.kyojo.schemaorg.m3n4.gson.core.container;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.kyojo.gson.JsonDeserializationContext;
import org.kyojo.gson.JsonDeserializer;
import org.kyojo.gson.JsonElement;
import org.kyojo.gson.JsonParseException;
import org.kyojo.schemaorg.m3n4.core.impl.ADDITIONAL_NAME;
import org.kyojo.schemaorg.m3n4.core.Container.AdditionalName;
import org.kyojo.schemaorg.m3n4.gson.DeserializerTemplate;
public class AdditionalNameDeserializer implements JsonDeserializer<AdditionalName> {
public static Map<String, Field> fldMap = new HashMap<>();
@Override
public AdditionalName deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context)
throws JsonParseException {
if(jsonElement.isJsonPrimitive()) {
return new ADDITIONAL_NAME(jsonElement.getAsString());
}
return DeserializerTemplate.deserializeSub(jsonElement, type, context,
new ADDITIONAL_NAME(), AdditionalName.class, ADDITIONAL_NAME.class, fldMap);
}
}
|
[
"nagai@nagaikenshin.com"
] |
nagai@nagaikenshin.com
|
8084d79498772ee88b1fdfb8afa2b4399dc5d2e0
|
aa3af064c819df574114815a4679de0ce043377d
|
/src/com/mindtree/mcse/mobilemall/web/validators/AccountValidator.java
|
12dac133acb522cbd66000f4be5da2d01e3dae95
|
[] |
no_license
|
SiyuanZeng/MobileMall-Store
|
cc52488d70e5cbcb40d6b2fe27e8bc9ce528dd6e
|
c640b4d7b4b83178157b828450da1b7a58f6a741
|
refs/heads/master
| 2020-04-12T01:56:15.175953
| 2015-10-26T04:18:44
| 2015-10-26T04:18:44
| 68,260,837
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,376
|
java
|
package com.mindtree.mcse.mobilemall.web.validators;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import com.mindtree.mcse.mobilemall.domain.Account;
public class AccountValidator implements Validator {
@SuppressWarnings("rawtypes")
public boolean supports(Class clazz) {
return Account.class.isAssignableFrom(clazz);
}
public void validate(Object obj, Errors errors) {
ValidationUtils.rejectIfEmpty(errors, "firstName", "FIRST_NAME_REQUIRED", "First name is required.");
ValidationUtils.rejectIfEmpty(errors, "lastName", "LAST_NAME_REQUIRED", "Last name is required.");
ValidationUtils.rejectIfEmpty(errors, "email", "EMAIL_REQUIRED", "Email address is required.");
ValidationUtils.rejectIfEmpty(errors, "phone", "PHONE_REQUIRED", "Phone number is required.");
ValidationUtils.rejectIfEmpty(errors, "address1", "ADDRESS_REQUIRED", "Address (1) is required.");
ValidationUtils.rejectIfEmpty(errors, "city", "CITY_REQUIRED", "City is required.");
ValidationUtils.rejectIfEmpty(errors, "state", "STATE_REQUIRED", "State is required.");
ValidationUtils.rejectIfEmpty(errors, "zip", "ZIP_REQUIRED", "ZIP is required.");
ValidationUtils.rejectIfEmpty(errors, "country", "COUNTRY_REQUIRED", "Country is required.");
}
}
|
[
"siyuanzeng@gmail.com"
] |
siyuanzeng@gmail.com
|
6df7e5a3362ed450657cf112f7db5cb78672a1f8
|
b7e206810d2365e82fcac0f2b57210f06665e4c2
|
/interlok-core/src/main/java/com/adaptris/core/services/metadata/PayloadFromTemplateService.java
|
8ac0f625ac340b3b7321bae8aa50009b91384bf4
|
[
"Apache-2.0"
] |
permissive
|
adaptris/interlok
|
33b829fb1979f6bbcb230a2f2592c48d0aecf680
|
5eeb78cfa620fb16a9827be862180118e777afc5
|
refs/heads/develop
| 2023-09-01T19:52:09.830345
| 2023-08-28T10:51:49
| 2023-08-28T11:08:15
| 44,253,783
| 28
| 11
|
Apache-2.0
| 2023-09-13T17:15:43
| 2015-10-14T14:37:52
|
Java
|
UTF-8
|
Java
| false
| false
| 8,003
|
java
|
/*
* Copyright 2015 Adaptris Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.adaptris.core.services.metadata;
import java.util.Map;
import java.util.regex.Matcher;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import com.adaptris.annotation.AdapterComponent;
import com.adaptris.annotation.AdvancedConfig;
import com.adaptris.annotation.AutoPopulated;
import com.adaptris.annotation.ComponentProfile;
import com.adaptris.annotation.DisplayOrder;
import com.adaptris.annotation.InputFieldDefault;
import com.adaptris.annotation.InputFieldHint;
import com.adaptris.annotation.MarshallingCDATA;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.CoreException;
import com.adaptris.core.ServiceException;
import com.adaptris.core.ServiceImp;
import com.adaptris.interlok.types.InterlokMessage;
import com.adaptris.interlok.util.Args;
import com.adaptris.util.KeyValuePair;
import com.adaptris.util.KeyValuePairSet;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* Replaces the payload with something built from a template and optional metadata keys.
* <p>
* Takes the template stored in {@link #setTemplate(String)} and replaces parts of the template
* either by resolving the {@code %message} expression language or with values from various metadata
* keys specified in {@link #setMetadataTokens(KeyValuePairSet)} to create a new payload.
* </p>
* <p>
* Since under the covers it uses the JDK regular expression engine, take care when your replacement
* may contain special regular expression characters (such as {@code \} and {@code $}
* </p>
*
* @config payload-from-template
*
*/
@XStreamAlias("payload-from-template")
@AdapterComponent
@ComponentProfile(summary = "Construct a new payload based on metadata and a template", tag = "service,metadata", since = "3.10.0")
@DisplayOrder(order = {"template", "metadataTokens", "multiLineExpression", "quoteReplacement", "quiet"})
public class PayloadFromTemplateService extends ServiceImp {
@NotNull
@AutoPopulated
@Valid
private KeyValuePairSet metadataTokens;
@MarshallingCDATA
@InputFieldDefault(value = "")
@InputFieldHint(expression = true, style="BLANKABLE")
private String template = null;
@AdvancedConfig(rare = true)
@InputFieldDefault(value = "true")
private Boolean quoteReplacement;
@AdvancedConfig(rare = true)
@InputFieldDefault(value = "false")
private Boolean quiet;
@AdvancedConfig
@InputFieldDefault(value = "true")
private Boolean multiLineExpression;
public PayloadFromTemplateService() {
setMetadataTokens(new KeyValuePairSet());
}
@Override
public void doService(AdaptrisMessage msg) throws ServiceException {
String payload = msg.resolve(StringUtils.defaultIfEmpty(template, ""), multiLineExpression());
for (KeyValuePair kvp : getMetadataTokens().getKeyValuePairs()) {
if (msg.getMetadataValue(kvp.getKey()) != null) {
if (!quiet()) {
log.trace("Replacing {} with {}", kvp.getValue(), msg.getMetadataValue(kvp.getKey()));
}
payload = payload.replaceAll(kvp.getValue(), munge(msg.getMetadataValue(kvp.getKey())));
}
else {
if (!quiet()) {
log.trace("{} returns no value; no substitution", kvp.getKey());
}
}
}
msg.setContent(payload, msg.getContentEncoding());
}
private String munge(String s) {
return quoteReplacement() ? Matcher.quoteReplacement(s) : s;
}
@Override
protected void initService() throws CoreException {}
@Override
protected void closeService() {}
@Override
public void prepare() throws CoreException {}
/**
* @return the metadataTokens
*/
public KeyValuePairSet getMetadataTokens() {
return metadataTokens;
}
/**
* Set the metadata tokens that will be used to perform metadata substitution.
* <p>
* For the purposes of this service, the key to the key-value-pair is the
* metadata key, and the value is the token that will be replaced within the
* template
* </p>
*
* @param metadataTokens the metadataTokens to set
*/
public void setMetadataTokens(KeyValuePairSet metadataTokens) {
this.metadataTokens = Args.notNull(metadataTokens, "metadata-tokens");
}
public <T extends PayloadFromTemplateService> T withMetadataTokens(KeyValuePairSet tokens) {
setMetadataTokens(tokens);
return (T) this;
}
public <T extends PayloadFromTemplateService> T withMetadataTokens(Map<String, String> tokens) {
return withMetadataTokens(new KeyValuePairSet(tokens));
}
/**
* @return the template
*/
public String getTemplate() {
return template;
}
/**
* Set the template document that will be used as the template for generating a new document.
*
* @param s the template to set (supports metadata expansion via {@code %message{key}}).
*/
public void setTemplate(String s) {
template = s;
}
public <T extends PayloadFromTemplateService> T withTemplate(String b) {
setTemplate(b);
return (T) this;
}
public Boolean getQuoteReplacement() {
return quoteReplacement;
}
/**
* If any metadata value contains special characters then ensure that they are escaped.
* <p>
* Set this flag to make sure that special characters are treated literally by the regular expression engine.
* <p>
*
* @see Matcher#quoteReplacement(String)
* @param b the value to set, defaults to true if not explicitly configured.
*/
public void setQuoteReplacement(Boolean b) {
quoteReplacement = b;
}
public <T extends PayloadFromTemplateService> T withQuoteReplacement(Boolean b) {
setQuoteReplacement(b);
return (T) this;
}
protected boolean quoteReplacement() {
return BooleanUtils.toBooleanDefaultIfNull(getQuoteReplacement(), true);
}
public Boolean getQuiet() {
return quiet;
}
/**
* Normally this service logs everything that is being replaced with can lead to excessive logging.
*
* @param quiet true or false, default false if not specified.
*/
public void setQuiet(Boolean quiet) {
this.quiet = quiet;
}
public <T extends PayloadFromTemplateService> T withQuietMode(Boolean quiet) {
setQuiet(quiet);
return (T) this;
}
private boolean quiet() {
return BooleanUtils.toBooleanDefaultIfNull(getQuiet(), false);
}
public Boolean getMultiLineExpression() {
return multiLineExpression;
}
/**
* Whether or not to handle expressions using {@code Pattern#DOTALL} mode for matching.
*
* <p>
* The value here is passed to {@link InterlokMessage#resolve(String, boolean)}. True will allow you to do replacements on
* multi-line templates; It defaults to true which means that multi-line templates along the lines of will be supported.
*
* <pre>
* {@code
* {
* "key": "%message{metadataKey}",
* "key2: "%message{anotherMetadatKey}",
* }
* }
* </pre>
* </p>
*
* @param b true/false, default is true if not specified.
*/
public void setMultiLineExpression(Boolean b) {
multiLineExpression = b;
}
public <T extends PayloadFromTemplateService> T withMultiLineExpression(Boolean b) {
setMultiLineExpression(b);
return (T) this;
}
protected boolean multiLineExpression() {
return BooleanUtils.toBooleanDefaultIfNull(getMultiLineExpression(), true);
}
}
|
[
"lewin.chan@adaptris.com"
] |
lewin.chan@adaptris.com
|
f0eb07d10863df07a65811387f31a6894e39c3a5
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Math/87/org/apache/commons/math/optimization/linear/UnboundedSolutionException_UnboundedSolutionException_36.java
|
a8ade293005f166d9a8b5d6cf1c6b3cfb6e6c3a0
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 292
|
java
|
org apach common math optim linear
repres except thrown optim solut
escap infin
version revis date
unbound solut except unboundedsolutionexcept optim except optimizationexcept
simpl constructor messag
unbound solut except unboundedsolutionexcept
unbound solut
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
36e1a830fe81d9e62190d821764a117eb4fbfda1
|
92f10c41bad09bee05acbcb952095c31ba41c57b
|
/app/src/main/java/io/github/alula/ohmygod/MainActivity8433.java
|
6cb105d0ec897c511b2e4637b599aea52ca78a45
|
[] |
no_license
|
alula/10000-activities
|
bb25be9aead3d3d2ea9f9ef8d1da4c8dff1a7c62
|
f7e8de658c3684035e566788693726f250170d98
|
refs/heads/master
| 2022-07-30T05:54:54.783531
| 2022-01-29T19:53:04
| 2022-01-29T19:53:04
| 453,501,018
| 16
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 339
|
java
|
package io.github.alula.ohmygod;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity8433 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
|
[
"6276139+alula@users.noreply.github.com"
] |
6276139+alula@users.noreply.github.com
|
458bbc20ba7ad4ed5f3631a885682c359e53a524
|
4c45fd10460f88c7176a01c450db5b0aa3314b9b
|
/src/com/earthman/app/nim/uikit/session/SessionEventListener.java
|
dc5ff7bd03d66e0e83083ad6677cc9b44df01719
|
[] |
no_license
|
WenJunKing/diqiuren
|
b5c60134ba655bb45014a4a75d9b05313a585fb5
|
b4440085fccc413c1390db2678cd5da893217afc
|
refs/heads/master
| 2021-06-01T07:31:33.432581
| 2016-08-19T07:44:12
| 2016-08-19T07:44:12
| 66,062,997
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 562
|
java
|
package com.earthman.app.nim.uikit.session;
import android.content.Context;
import com.netease.nimlib.sdk.msg.model.IMMessage;
/**
* 会话窗口消息列表一些点击事件的响应处理函数
*/
public interface SessionEventListener {
// 头像点击事件处理,一般用于打开用户资料页面
void onAvatarClicked(Context context, IMMessage message);
// 头像长按事件处理,一般用于群组@功能,或者弹出菜单,做拉黑,加好友等功能
void onAvatarLongClicked(Context context, IMMessage message);
}
|
[
"472759693@qq.com"
] |
472759693@qq.com
|
1c44373e467f28d19f67952ab59a341acbb3842b
|
d2a1f4715a40d840907d7e292954b7a728793743
|
/app/src/main/java/com/bawei/dell/myshoppingapp/util/BaseApis.java
|
45b51e63731a480f66b51067e86464d814c91840
|
[] |
no_license
|
Swallow-Lgy/MyShoppingApp1
|
e902e10ef2fd189dc3319ff6a107846fbc40ee43
|
86d8ab26e4debbe6c85eff2ab3fe7d1934b08544
|
refs/heads/master
| 2020-04-15T12:18:17.833105
| 2019-01-20T05:14:34
| 2019-01-20T05:14:34
| 164,668,548
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,093
|
java
|
package com.bawei.dell.myshoppingapp.util;
import java.util.Map;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;
import rx.Observable;
import rx.Observer;
public interface BaseApis<T> {
@PUT
Observable<ResponseBody> put(@Url String url,@QueryMap Map<String,String>map);
@GET
Observable<ResponseBody> get(@Url String url);
@DELETE
Observable<ResponseBody> delete(@Url String url);
@POST
Observable<ResponseBody> post(@Url String url, @QueryMap Map<String, String> map);
@POST
Observable<ResponseBody> postFile(@Url String url, @Body MultipartBody multipartBody);
@POST
@Multipart
Observable<ResponseBody> postDuoContent(@Url String url ,@QueryMap Map<String, String> map ,@Part MultipartBody.Part[] parts);
}
|
[
"2451528553@qq.com"
] |
2451528553@qq.com
|
5db7e1a5ee27e617849d304277690752dda3382a
|
3ab027aa8fb23af8b912d565b012ef98f38cf5d6
|
/src/com/kaylerrenslow/armaDialogCreator/control/sv/SVInteger.java
|
6627c33a5775f3650be357792f539ef11f804a4d
|
[
"MIT"
] |
permissive
|
ravmustang/arma-dialog-creator
|
8218f3f84a354856b4733128d66c89983bbb8d72
|
e9d510ce93c306f2d756b80773ae3a15ed663b36
|
refs/heads/master
| 2021-01-20T07:15:43.040898
| 2017-08-22T10:06:20
| 2017-08-22T10:06:20
| 101,527,253
| 2
| 0
| null | 2017-08-27T03:24:57
| 2017-08-27T03:24:57
| null |
UTF-8
|
Java
| false
| false
| 1,427
|
java
|
package com.kaylerrenslow.armaDialogCreator.control.sv;
import com.kaylerrenslow.armaDialogCreator.control.PropertyType;
import com.kaylerrenslow.armaDialogCreator.util.DataContext;
import com.kaylerrenslow.armaDialogCreator.util.ValueConverter;
import org.jetbrains.annotations.NotNull;
/** A generic wrapper implementation for an int. */
public class SVInteger extends SerializableValue implements SVNumericValue {
public static final ValueConverter<SVInteger> CONVERTER = new ValueConverter<SVInteger>() {
@Override
public SVInteger convert(DataContext context, @NotNull String... values) throws Exception {
return new SVInteger(Integer.parseInt(values[0]));
}
};
private final int i;
public SVInteger(int i) {
this.i = i;
}
public int getInt() {
return i;
}
@NotNull
public String[] getAsStringArray() {
return new String[]{i + ""};
}
@NotNull
@Override
public SerializableValue deepCopy() {
return new SVInteger(i);
}
@NotNull
@Override
public PropertyType getPropertyType() {
return PropertyType.Int;
}
@Override
public String toString() {
return i + "";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof SVInteger) {
SVInteger other = (SVInteger) o;
return this.i == other.i;
}
return false;
}
@Override
public int toInt() {
return i;
}
@Override
public double toDouble() {
return i;
}
}
|
[
"kaylerrenslow@gmail.com"
] |
kaylerrenslow@gmail.com
|
45fb6033aa524450bf8c76ec0b6c682bf83b1337
|
ce89f5fbd5498961033f6efebb1c57f519d3d72c
|
/src/main/java/com/yorhp/girl/domain/Result.java
|
8a1844c003382e3cdfe611d786ee8f6d374df7f2
|
[] |
no_license
|
tyhjh/Spring-boot
|
643625f9558fa16b394c02a4143cd77d49d85035
|
308d991aa7ea1f5fb5ed2fa925fa74ace64603e8
|
refs/heads/master
| 2021-08-07T00:55:21.414784
| 2017-11-07T07:33:21
| 2017-11-07T07:33:21
| 109,801,883
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 655
|
java
|
package com.yorhp.girl.domain;
public class Result<T> {
private int code;
private String msg;
private T data;
public Result() {
}
public Result(int code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
|
[
"1043315346@qq.com"
] |
1043315346@qq.com
|
b5ba8dc24561a2164e4f7ee4dee0cf77c6c49fec
|
6e9a5bddddfb841999a00bec00b9466d266cd1f0
|
/jun_report/easyreport-web/src/main/java/com/easytoolsoft/easyreport/web/controller/report/DataSourceController.java
|
fa0a488baf828853aa3d961c126c84a3a5e3fa95
|
[
"Apache-2.0"
] |
permissive
|
cuilong1009/jun_bigdata
|
9c36dde7a5fe8fe85abfe43398f797decc7cb1d4
|
1ad4194eaab24735e3864831c9fede787361599a
|
refs/heads/master
| 2023-06-05T05:21:58.095287
| 2020-11-25T16:01:26
| 2020-11-25T16:01:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,242
|
java
|
package com.easytoolsoft.easyreport.web.controller.report;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import com.easytoolsoft.easyreport.meta.domain.DataSource;
import com.easytoolsoft.easyreport.meta.domain.example.DataSourceExample;
import com.easytoolsoft.easyreport.meta.service.DataSourceService;
import com.easytoolsoft.easyreport.mybatis.pager.PageInfo;
import com.easytoolsoft.easyreport.support.annotation.OpLog;
import com.easytoolsoft.easyreport.support.model.ResponseResult;
import com.easytoolsoft.easyreport.web.controller.common.BaseController;
import com.easytoolsoft.easyreport.web.model.DataGridPager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 报表数据源控制器
*
* @author Wujun
* @date 2017-03-25
*/
@RestController
@RequestMapping(value = "/rest/report/ds")
public class DataSourceController
extends BaseController<DataSourceService, DataSource, DataSourceExample, Integer> {
@GetMapping(value = "/listAll")
@OpLog(name = "获取所有数据源")
@RequiresPermissions("report.ds:view")
public List<DataSource> listAll() {
return this.service.getAll().stream()
.map(x -> DataSource.builder()
.id(x.getId())
.uid(x.getUid())
.name(x.getName())
.build())
.collect(Collectors.toList());
}
@GetMapping(value = "/list")
@OpLog(name = "分页获取数据源列表")
@RequiresPermissions("report.ds:view")
public Map<String, Object> list(final DataGridPager pager, final String fieldName, final String keyword) {
final PageInfo pageInfo = pager.toPageInfo();
final List<DataSource> list = this.service.getByPage(pageInfo, fieldName, "%" + keyword + "%");
final Map<String, Object> modelMap = new HashMap<>(2);
modelMap.put("total", pageInfo.getTotals());
modelMap.put("rows", list);
return modelMap;
}
@RequestMapping(value = "/add")
@OpLog(name = "新增数据源")
@RequiresPermissions("report.ds:add")
public ResponseResult add(final DataSource po) {
po.setGmtCreated(new Date());
po.setUid(UUID.randomUUID().toString());
this.service.add(po);
return ResponseResult.success("");
}
@PostMapping(value = "/edit")
@OpLog(name = "编辑数据源")
@RequiresPermissions("report.ds:edit")
public ResponseResult edit(final DataSource po) {
this.service.editById(po);
return ResponseResult.success("");
}
@PostMapping(value = "/remove")
@OpLog(name = "删除数据源")
@RequiresPermissions("report.ds:remove")
public ResponseResult remove(final Integer id) {
this.service.removeById(id);
return ResponseResult.success("");
}
@PostMapping(value = "/testConnection")
@OpLog(name = "测试数据源")
@RequiresPermissions("report.ds:view")
public ResponseResult testConnection(final String driverClass, final String url, final String pass,
final String user) {
if (this.service.testConnection(driverClass, url, user, pass)) {
return ResponseResult.success("");
}
return ResponseResult.failure(20000, "数据源测试失败", "");
}
@PostMapping(value = "/testConnectionById")
@OpLog(name = "测试数据源")
@RequiresPermissions("report.ds:view")
public ResponseResult testConnection(final Integer id) {
final DataSource dsPo = this.service.getById(id);
final boolean testResult = this.service.testConnection(
dsPo.getDriverClass(),
dsPo.getJdbcUrl(),
dsPo.getUser(), dsPo.getPassword());
if (testResult) {
return ResponseResult.success("");
}
return ResponseResult.failure(10005, "数据源测试失败", "");
}
}
|
[
"wujun728@hotmail.com"
] |
wujun728@hotmail.com
|
69906852f2e2b02b0d16936b96155885999a631f
|
799301509a9366c3aa8dd3c07f2f737bff398bc1
|
/app/src/main/java/com/express/subao/adaptera/StoreAdapter.java
|
75a31c62cdacf4212b1bbacdf133ef7f314b5e5e
|
[] |
no_license
|
Mjh910101/Express2.0
|
47e47f98443116db4e584d5421831a2f5eabe7fe
|
7eba69717b018b972734bce9511691db73dd3550
|
refs/heads/master
| 2020-04-06T06:56:25.175673
| 2016-08-29T09:58:21
| 2016-08-29T09:58:21
| 60,254,308
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,885
|
java
|
package com.express.subao.adaptera;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import com.express.subao.activitys.StoreItemListActivity;
import com.express.subao.activitys.StoreItemListActivityV2;
import com.express.subao.box.StoreObj;
import com.express.subao.box.handlers.StoreObjHandler;
import com.express.subao.download.DownloadImageLoader;
import com.express.subao.box.handlers.ShoppingCarHandler;
import com.express.subao.tool.Passageway;
import com.express.subao.tool.WinTool;
import java.util.List;
/**
* *
* * ┏┓ ┏┓
* *┏┛┻━━━━━━┛┻┓
* *┃ ┃
* *┃ ┃
* *┃ ┳┛ ┗┳ ┃
* *┃ ┃
* *┃ ┻ ┃
* *┃ ┃
* *┗━┓ ┏━┛
* * ┃ ┃
* * ┃ ┃
* * ┃ ┗━━━┓
* * ┃ ┣┓
* * ┃ ┏┛
* * ┗┓┓┏━━━┳┓┏┛
* * ┃┫┫ ┃┫┫
* * ┗┻┛ ┗┻┛
* Created by Hua on 15/12/23.
*/
public class StoreAdapter extends BaseAdapter {
private Context context;
private List<StoreObj> itemList;
private LayoutInflater inflater;
public StoreAdapter(Context context, List<StoreObj> itemList) {
initBaseAdapter(context);
this.itemList = itemList;
}
private void initBaseAdapter(Context context) {
this.context = context;
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return itemList.size();
}
@Override
public Object getItem(int position) {
return itemList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final StoreObj obj = itemList.get(position);
int w = WinTool.getWinWidth(context) / 2;
int p = 15;
ImageView view = new ImageView(context);
view.setLayoutParams(new GridView.LayoutParams(w, w));
view.setScaleType(ImageView.ScaleType.FIT_XY);
view.setPadding(p, p, p, p);
DownloadImageLoader.loadImage(view, obj.getImg());
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StoreObjHandler.saveStoreObj(obj);
ShoppingCarHandler.saveStore(context, obj);
// Passageway.jumpActivity(context, ItemListActivity.class);
Passageway.jumpActivity(context, StoreItemListActivityV2.class);
}
});
return view;
}
}
|
[
"408951390@qq.com"
] |
408951390@qq.com
|
1fd4b274347d39dfa89578bf35fc29a4164303fe
|
dc25b23f8132469fd95cee14189672cebc06aa56
|
/vendor/mediatek/proprietary/frameworks/base/tests/widget/src/com/mediatek/common/widget/tests/focus/HorizontalFocusSearch.java
|
1f334fbc8f4c53771b58366acf95f8977062efad
|
[
"Apache-2.0"
] |
permissive
|
nofearnohappy/alps_mm
|
b407d3ab2ea9fa0a36d09333a2af480b42cfe65c
|
9907611f8c2298fe4a45767df91276ec3118dd27
|
refs/heads/master
| 2020-04-23T08:46:58.421689
| 2019-03-28T21:19:33
| 2019-03-28T21:19:33
| 171,048,255
| 1
| 5
| null | 2020-03-08T03:49:37
| 2019-02-16T20:25:00
|
Java
|
UTF-8
|
Java
| false
| false
| 3,873
|
java
|
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mediatek.common.widget.tests.focus;
import android.app.Activity;
import android.widget.LinearLayout;
import android.widget.Button;
import android.widget.TextView;
import android.os.Bundle;
import android.view.ViewGroup;
import android.content.Context;
public class HorizontalFocusSearch extends Activity {
private LinearLayout mLayout;
private Button mLeftTall;
private Button mMidShort1Top;
private Button mMidShort2Bottom;
private Button mRightTall;
public LinearLayout getLayout() {
return mLayout;
}
public Button getLeftTall() {
return mLeftTall;
}
public Button getMidShort1Top() {
return mMidShort1Top;
}
public Button getMidShort2Bottom() {
return mMidShort2Bottom;
}
public Button getRightTall() {
return mRightTall;
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mLayout = new LinearLayout(this);
mLayout.setOrientation(LinearLayout.HORIZONTAL);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mLeftTall = makeTall("left tall");
mLayout.addView(mLeftTall);
mMidShort1Top = addShort(mLayout, "mid(1) top", false);
mMidShort2Bottom = addShort(mLayout, "mid(2) bottom", true);
mRightTall = makeTall("right tall");
mLayout.addView(mRightTall);
setContentView(mLayout);
}
// just to get toString non-sucky
private static class MyButton extends Button {
public MyButton(Context context) {
super(context);
}
@Override
public String toString() {
return getText().toString();
}
}
private Button makeTall(String label) {
Button button = new MyButton(this);
button.setText(label);
button.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
return button;
}
private Button addShort(LinearLayout root, String label, boolean atBottom) {
Button button = new MyButton(this);
button.setText(label);
button.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
0, // height
490));
TextView filler = new TextView(this);
filler.setText("filler");
filler.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
0, // height
510));
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
ll.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
if (atBottom) {
ll.addView(filler);
ll.addView(button);
root.addView(ll);
} else {
ll.addView(button);
ll.addView(filler);
root.addView(ll);
}
return button;
}
}
|
[
"fetpoh@mail.ru"
] |
fetpoh@mail.ru
|
345a4791b69b44f1179e130d3a7dfdc1ca2ca336
|
3e2bc33009e68f06e06a48f9461e52c7e61f5281
|
/BillBook/src/main/java/com/owl/book/base/FragmentEventListener.java
|
dd1764c11e66e9be0f9356f735eb199d7c81ec2e
|
[
"MIT"
] |
permissive
|
Alamusitl/TallyBook
|
8ac743fbf5ef1771a147399c0f21c9a583028ccc
|
f0c7767dce2451705bb1c4abd9ebea4c11e033db
|
refs/heads/master
| 2021-01-19T21:59:36.226233
| 2017-06-13T12:20:27
| 2017-06-13T12:20:27
| 88,736,486
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 307
|
java
|
package com.owl.book.base;
import android.os.Bundle;
/**
* FragmentEventListener for transition data with Fragment
* Created by Imagine Owl on 2017/5/24.
*/
public interface FragmentEventListener {
void dismiss(String target, Bundle extras);
void handleDismiss(String src, Bundle extras);
}
|
[
"alamusitl@163.com"
] |
alamusitl@163.com
|
8309449b285ed27a36e422207f4f609a79b31cef
|
3be9a88787a420e8a32059e4a9cd9e6a8cc840bc
|
/ swingsource --username zeyuphoenix/source/booksource/org/jdesktop/animation/timing/interpolation/LinearInterpolator.java
|
12ef44b5fe0a9830dfe87e546e169c1b16a18a74
|
[] |
no_license
|
youhandcn/swingsource
|
e5543a631c4f85a1c87778b392716f6ad7dc428d
|
4eed1c3b13e7959ba40bc7082c2a8998f660eada
|
refs/heads/master
| 2016-09-05T10:33:31.940367
| 2010-05-03T05:04:15
| 2010-05-03T05:04:15
| 34,960,255
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,097
|
java
|
/**
* Copyright (c) 2005-2006, Sun Microsystems, Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the TimingFramework project nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jdesktop.animation.timing.interpolation;
/**
* This class implements the Interpolator interface by providing a simple
* interpolate function that simply returns the value that it was given. The net
* effect is that callers will end up calculating values linearly during
* intervals.
* <p>
* Because there is no variation to this class, it is a singleton and is
* referenced by using the {@link #getInstance} static method.
*
* @author Chet
*/
public final class LinearInterpolator implements Interpolator {
private static LinearInterpolator instance = null;
private LinearInterpolator() {
}
/**
* Returns the single DiscreteInterpolator object
*/
public static LinearInterpolator getInstance() {
if (instance == null) {
instance = new LinearInterpolator();
}
return instance;
}
/**
* This method always returns the value it was given, which will cause
* callers to calculate a linear interpolation between boundary values.
*
* @param fraction
* a value between 0 and 1, representing the elapsed fraction of
* a time interval (either an entire animation cycle or an
* interval between two KeyTimes, depending on where this
* Interpolator has been set)
* @return the same value passed in as <code>fraction</code>
*/
public float interpolate(float fraction) {
return fraction;
}
}
|
[
"zeyuphoenix@885ba999-350d-7bb5-9ed4-d2348cccda2a"
] |
zeyuphoenix@885ba999-350d-7bb5-9ed4-d2348cccda2a
|
6d0171f0be89adaec66719895a0e56046b081fdb
|
ba3b25d6cf9be46007833ce662d0584dc1246279
|
/droidsafe_modified/modeling/api/org/apache/harmony/javax/security/auth/callback/Callback.java
|
b90fe0094df9e571d89b32e8c7cae0b2b24bcd29
|
[] |
no_license
|
suncongxd/muDep
|
46552d4156191b9dec669e246188080b47183a01
|
b891c09f2c96ff37dcfc00468632bda569fc8b6d
|
refs/heads/main
| 2023-03-20T20:04:41.737805
| 2021-03-01T19:52:08
| 2021-03-01T19:52:08
| 326,209,904
| 8
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,182
|
java
|
/*
* Copyright (C) 2015, Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Please email droidsafe@lists.csail.mit.edu if you need additional
* information or have any questions.
*
*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/***** THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL BY THE DROIDSAFE PROJECT. *****/
package org.apache.harmony.javax.security.auth.callback;
/**
* Defines an empty base interface for all {@code Callback}s used during
* authentication.
*/
import droidsafe.annotations.*;
import droidsafe.runtime.*;
import droidsafe.helpers.*;
public interface Callback {
}
|
[
"suncong@xidian.edu.cn"
] |
suncong@xidian.edu.cn
|
99c10844b7cb95d560bf91031a898b1e3d2bcf1c
|
b008e0596772d04310c9cdd394f06d13bac7e4da
|
/Douyu-0.7.1/douyu-examples/src/main/java/WebSocketExample.java
|
feed43ec05553cf26bbbd8e12eef6206473b7811
|
[
"Apache-2.0"
] |
permissive
|
changshoumeng/Open-Source-Research
|
78d2a4bd2ca34576c4bca750d6afb9c589976e90
|
b9f2aed9d0f060b80be45f713c3d48fe91f247b2
|
refs/heads/master
| 2021-01-19T08:09:51.812371
| 2017-02-07T11:16:45
| 2017-02-07T11:16:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,968
|
java
|
/*
* Copyright 2011 The Apache Software Foundation
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.IOException;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import douyu.http.WebSocket;
import douyu.mvc.Context;
import douyu.mvc.Controller;
@Controller
public class WebSocketExample {
public void index(Context c) {
c.out("WebSocketExample.html");
}
public void join(Context c) {
c.setWebSocket(new MyWebSocket());
}
public static class MyWebSocket implements WebSocket {
private final static Set<MyWebSocket> members = new CopyOnWriteArraySet<MyWebSocket>();
private Outbound outbound;
@Override
public void onConnect(Outbound outbound) {
this.outbound = outbound;
members.add(this);
}
@Override
public void onDisconnect() {
members.remove(this);
}
@Override
public void onMessage(int type, String data) {
if (data.indexOf("disconnect") >= 0)
outbound.close();
else {
for (MyWebSocket member : members) {
try {
member.outbound.send(type, data);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@Override
public void onMessage(int type, byte[] data) {
}
}
}
|
[
"zhh200910@gmail.com"
] |
zhh200910@gmail.com
|
82b6d2adda3b05e424c914f78c9090a1d013f632
|
3cca15d4a6b6149424a8f8c3b3996eacd4d42b07
|
/bookshop-service/src/main/java/org/atanasov/bookshop/services/AuthorService.java
|
7ab22ae5ecdedf1f10a2e197c3553224868c3883
|
[] |
no_license
|
VasAtanasov/bookshop
|
ad28e4239b40ae363814c4cb97ce4885042a3d37
|
6423d893296cfe792349cb52a8131e264214f720
|
refs/heads/main
| 2023-01-10T11:37:16.994754
| 2020-11-13T17:32:12
| 2020-11-13T17:32:12
| 311,255,151
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 488
|
java
|
package org.atanasov.bookshop.services;
import org.atanasov.bookshop.models.AuthorBooksCountServiceModel;
import org.atanasov.bookshop.models.AuthorFullNameServiceModel;
import java.util.List;
public interface AuthorService {
List<AuthorFullNameServiceModel> findAllWithFirstNameEndingOn(String searchString);
List<AuthorBooksCountServiceModel> authorTotalBookCopies();
List<AuthorBooksCountServiceModel> getAuthorBooksCount(String firstName, String lastName);
}
|
[
"vas.atanasov@gmail.com"
] |
vas.atanasov@gmail.com
|
89d8b725146db97a6d2b5f66a8c0eaec6057d997
|
5ab4f8041ac62e19abadf86c976b1a3421474fb4
|
/.svn/pristine/84/84f3fbd9742b5bf83feba54e3877d9f0290e21de.svn-base
|
e727c46f616c7b67b0a8aa7c276d223a02d8bcf2
|
[] |
no_license
|
WJtoy/sfMicroservice
|
9664443d350226b4458d637a6069a1480691525d
|
0013bc24c89d92c807387ecb4a2c87371f987007
|
refs/heads/master
| 2023-06-14T06:26:56.971350
| 2021-07-12T08:30:15
| 2021-07-12T08:30:15
| 385,177,578
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,038
|
package com.kkl.kklplus.b2b.sf.http.config;
import okhttp3.OkHttpClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
@EnableConfigurationProperties({B2BSFProperties.class})
@Configuration
public class OKHttpConfig {
@Bean
public OkHttpClient okHttpClient(B2BSFProperties sfProperties) {
return new OkHttpClient().newBuilder()
.connectTimeout(sfProperties.getOkhttp().getConnectTimeout(), TimeUnit.SECONDS)
.writeTimeout(sfProperties.getOkhttp().getWriteTimeout(), TimeUnit.SECONDS)
.readTimeout(sfProperties.getOkhttp().getReadTimeout(), TimeUnit.SECONDS)
.pingInterval(sfProperties.getOkhttp().getPingInterval(), TimeUnit.SECONDS)
.retryOnConnectionFailure(sfProperties.getOkhttp().getRetryOnConnectionFailure())
.build();
}
}
|
[
"1227679550@qq.com"
] |
1227679550@qq.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.