blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
bab30899f6b2f26a369eea722e987f015b7e430f
8013e7cce645d7b81367ecaa60205868669197ac
/bloom-core/src/main/java/model/HandlerRequest.java
82bbd5fcc2892fe0099d5d3817a7649cbbb075d2
[ "MIT" ]
permissive
swardeo/bloom-services
f833dca39b87f6317b84370ce1face76ecfcb8e6
40e07b32b7595ba29e6b7af04c28b43963f9f9b7
refs/heads/master
2023-08-27T04:06:18.046766
2021-10-31T18:32:12
2021-10-31T18:35:38
320,226,074
0
0
MIT
2021-10-31T18:35:39
2020-12-10T09:44:01
Java
UTF-8
Java
false
false
4,167
java
package model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import java.util.Map; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonDeserialize(builder = HandlerRequest.Builder.class) @JsonIgnoreProperties(ignoreUnknown = true) public class HandlerRequest { private final String httpMethod; private final String path; private final Map<String, String> queryStringParameters; private final Map<String, String> pathParameters; private final Map<String, String> headers; private final String body; private final ProxyRequestContext requestContext; private HandlerRequest(Builder builder) { httpMethod = builder.httpMethod; path = builder.path; queryStringParameters = builder.queryStringParameters; pathParameters = builder.pathParameters; headers = builder.headers; body = builder.body; requestContext = null != builder.requestContext ? builder.requestContext : new ProxyRequestContext(Map.of("claims", Map.of())); } public String getHttpMethod() { return httpMethod; } public String getPath() { return path; } public Map<String, String> getQueryStringParameters() { return queryStringParameters; } public Map<String, String> getPathParameters() { return pathParameters; } public Map<String, String> getHeaders() { return headers; } public String getBody() { return body; } public Subject getSubject() { return requestContext.getSubject(); } public static Builder newBuilder() { return new Builder(); } @JsonIgnoreProperties(ignoreUnknown = true) static class ProxyRequestContext { private Map<String, Object> authorizer; public ProxyRequestContext(@JsonProperty("authorizer") Map<String, Object> authorizer) { this.authorizer = authorizer; } public Subject getSubject() { if (null == authorizer) { return new Subject("empty subject"); } Map<String, String> claims = (Map<String, String>) authorizer.getOrDefault("claims", Map.of()); return new Subject(claims.getOrDefault("sub", "empty subject")); } } @JsonPOJOBuilder @JsonIgnoreProperties(ignoreUnknown = true) static final class Builder { private String httpMethod; private String path; private Map<String, String> queryStringParameters; private Map<String, String> pathParameters; private Map<String, String> headers; private String body; private ProxyRequestContext requestContext; private Builder() {} public Builder withHttpMethod(String httpMethod) { this.httpMethod = httpMethod; return this; } public Builder withPath(String path) { this.path = path; return this; } public Builder withQueryStringParameters(Map<String, String> queryStringParameters) { this.queryStringParameters = queryStringParameters; return this; } public Builder withPathParameters(Map<String, String> pathParameters) { this.pathParameters = pathParameters; return this; } public Builder withHeaders(Map<String, String> headers) { this.headers = headers; return this; } public Builder withBody(String body) { this.body = body; return this; } public Builder withRequestContext(ProxyRequestContext requestContext) { this.requestContext = requestContext; return this; } public HandlerRequest build() { return new HandlerRequest(this); } } }
[ "43907088+swardeo@users.noreply.github.com" ]
43907088+swardeo@users.noreply.github.com
83df0999ca2afb10409f60e4b5b6cd8d3ed52235
a6db31c3f9264c7b0ad5c3307dee4afd7ce689c1
/JavaDemo/relationship/src/com/mode/abfactory/tablefactory/TablePage.java
50fed1b9a168c18882f0716f566f8a521ad57d2f
[]
no_license
aJanefish/Work
2933fa5437b3c216ff1d76aa641af26226e5295c
96e585d6208e9d6bab5576a25853c0fdb54fbcd8
refs/heads/master
2021-06-29T15:53:28.458468
2020-02-23T08:23:44
2020-02-23T08:23:44
141,233,308
0
0
null
2020-10-13T10:42:43
2018-07-17T04:58:08
Python
UTF-8
Java
false
false
999
java
package com.mode.abfactory.tablefactory; import com.mode.abfactory.factory.Item; import com.mode.abfactory.factory.Page; import java.util.Iterator; public class TablePage extends Page { public TablePage(String title, String author) { super(title, author); } @Override protected String makeHTML() { StringBuffer buffer = new StringBuffer(); buffer.append("<html>\n<head><title>" + title + "</title></head>\n"); buffer.append("<body>\n"); buffer.append("<h1>" + title + "</h1>\n"); buffer.append("<table width=\"80%\" border=\"2\">\n"); Iterator<Item> itemIterator = content.iterator(); while (itemIterator.hasNext()) { Item item = itemIterator.next(); buffer.append("<tr>"+item.makeHTML()+"</tr>"); } buffer.append("</table>\n"); buffer.append("<hr><address>"+author+"</address>"); buffer.append("</body></html>\n"); return buffer.toString(); } }
[ "yu.zhang@singou.mo" ]
yu.zhang@singou.mo
578d1276b74c5f2e7f802fcecf97d343cf69f632
be57f63aa618cfebf3b17ec8cbb67ce0c478638d
/src/main/java/com/moptra/go4wealth/prs/model/FileDetailsDTO.java
0433b53ab76b9c1e08e510d9d7240acddf9236c6
[]
no_license
gauravkatiyar6891/wealth_back_end
b67abe2d94fad555e9b5282020329bb1bd52bfc4
857ad22a994a13f5892d2e3023e555480ef6c2c2
refs/heads/master
2022-09-17T23:10:20.420394
2019-07-26T15:12:16
2019-07-26T15:12:16
199,013,982
0
0
null
2022-09-01T23:10:23
2019-07-26T12:37:29
Java
UTF-8
Java
false
false
1,503
java
package com.moptra.go4wealth.prs.model; public class FileDetailsDTO { String signatureString; String fileName; String frontAdharCardString; String backAdharCardString; String addressProof; String docNumber; String imageType; boolean isFatca; public String getImageType() { return imageType; } public void setImageType(String imageType) { this.imageType = imageType; } public String getSignatureString() { return signatureString; } public void setSignatureString(String signatureString) { this.signatureString = signatureString; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getFrontAdharCardString() { return frontAdharCardString; } public void setFrontAdharCardString(String frontAdharCardString) { this.frontAdharCardString = frontAdharCardString; } public String getBackAdharCardString() { return backAdharCardString; } public void setBackAdharCardString(String backAdharCardString) { this.backAdharCardString = backAdharCardString; } public String getAddressProof() { return addressProof; } public void setAddressProof(String addressProof) { this.addressProof = addressProof; } public String getDocNumber() { return docNumber; } public void setDocNumber(String docNumber) { this.docNumber = docNumber; } public boolean isFatca() { return isFatca; } public void setFatca(boolean isFatca) { this.isFatca = isFatca; } }
[ "vinod.shukla@moptra.com" ]
vinod.shukla@moptra.com
fd1a4a1ab27946efe1fc5918751af65abbc90ca2
3fdbb519ac27000809816061ff57dabcc598b507
/spring-boot/spring-boot-11-custom-starter/test-spring-boot-starter/src/main/java/com/soulballad/usage/springboot/controller/HelloController.java
d914391d64926c6cfa1692d23e455b8241ec4355
[]
no_license
mengni0710/spring-usage-examples
412cf7c6604b9dbb0cea98480d0e106e558384ec
e90011d08219a90831e2abc68e689247d371daa7
refs/heads/master
2023-05-09T08:16:28.524308
2020-09-22T11:57:24
2020-09-22T11:57:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package com.soulballad.usage.springboot.controller; import com.soulballad.usage.springboot.template.HelloTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author :soulballad * @version : v1.0 * @apiNote : * @since :2020/5/28 22:35 */ @RestController public class HelloController { @Autowired private HelloTemplate helloTemplate; @GetMapping(value = "/hello") public String hello() { return helloTemplate.hello(); } }
[ "soda931vzr@163.com" ]
soda931vzr@163.com
0adafac207758c8d2a6d42e38a9dcb068cffc5a6
6022d062a18e8bd4f136c25bf637504ef0fb5a57
/src/main/java/nl/sogyo/boilerplate/dao/SavingsAccountDAO.java
152c6dd9a3e6be89c36e52d37c5d89db9638b2ed
[]
no_license
harshil123456/git-java-batch
b78ba76ba4b90ab2f27674d191984dc78b6728ed
68bcee38805a7aaba777563008ad3d42564836c6
refs/heads/master
2020-04-04T00:12:05.108459
2018-11-01T04:53:38
2018-11-01T04:53:38
155,643,805
0
13
null
2018-11-01T04:53:38
2018-11-01T01:17:01
Java
UTF-8
Java
false
false
420
java
package nl.sogyo.boilerplate.dao; import java.util.List; import nl.sogyo.boilerplate.domain.SavingsAccount; import org.springframework.transaction.annotation.Transactional; @Transactional public interface SavingsAccountDAO { public void saveSavingsAccount(SavingsAccount savingsAccount); public List<SavingsAccount> loadSavingsAccounts(); public SavingsAccount getSavingsAccount(int accountId); }
[ "hrpatel.263@gmail.com" ]
hrpatel.263@gmail.com
5b2bfd730f2b7f6b3f494fcaab8fb4cf9b36cb21
5eb61dc67145c1b1d5a908b803520ba9da83f82d
/SSM项目/src/main/java/com/nys/cost/domain/PageBean.java
38da6098ba8ba0fe5f8ed11a817c8923f607297d
[]
no_license
OnTheRightWay/workspace
27549e5344a8d56575a5b5798bdabf9fe661872d
f6767929db06f66defdee50dcf87fb7441207e87
refs/heads/master
2021-09-09T15:06:33.482564
2018-03-17T06:07:57
2018-03-17T06:07:57
113,117,366
0
0
null
null
null
null
UTF-8
Java
false
false
2,007
java
package com.nys.cost.domain; import org.springframework.stereotype.Component; import java.util.List; import java.util.Map; @Component public class PageBean { //当前页 private int currentPage; //对象集合 private List lists; //总页数 private int totalPage; //每页大小 private int pageSize = 5; //get拼接参数 private String param; //参数集合,表单拼接参数 private Map<String,String> params; public Map<String, String> getParams() { return params; } public void setParams(Map<String, String> params) { this.params = params; } public PageBean() { } public PageBean(int currentPage, List lists, int totalPage, int pageSize, int pageCount, String param) { this.currentPage = currentPage; this.lists = lists; this.totalPage = totalPage; this.pageSize = pageSize; this.param = param; } @Override public String toString() { return "PageBean{" + "currentPage=" + currentPage + ", lists=" + lists + ", totalPage=" + totalPage + ", pageSize=" + pageSize + ", param='" + param + '\'' + '}'; } public int getCurrentPage() { return currentPage; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage; } public List getLists() { return lists; } public void setLists(List lists) { this.lists = lists; } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public String getParam() { return param; } public void setParam(String param) { this.param = param; } }
[ "34029301+OnTheRightWay@users.noreply.github.com" ]
34029301+OnTheRightWay@users.noreply.github.com
5cfd315b28cdb57ad0041813c3b651e13c3b15a6
cd0a40252d2ed05a1cd0666a57fb5b4bd14dd011
/allstack/src/main/java/com/allstack/services/CourseService.java
9530faf513724acb482f100ec8278ca1fda883dc
[]
no_license
indicoder/allstack
013ca7e575fcaca3aa32f2246595a33e84f989aa
dcaf2a46804f207b4b72388220e86584d4378095
refs/heads/master
2021-01-02T09:37:03.057241
2018-07-16T11:25:01
2018-07-16T11:25:01
99,262,776
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package com.allstack.services; import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import com.allstack.dao.CourseDao; import com.allstack.pojo.Course; public class CourseService { @Autowired CourseDao courseDao; public List<Course> getAllCourses(){ return courseDao.getAllCourses(); } public Course getCourseById(int courseId){ return courseDao.getCourseById(courseId); } }
[ "manas.k.panda@gmail.com" ]
manas.k.panda@gmail.com
ce66ce6a95ff52dc4debe90c7c2799e15e9fa0aa
0975309b5c98e2ec25c72e4a90ef62b725c2ecea
/src/main/java/hello/demo/demo.java
ba91ff22cad9b96001e9ef7c38e4fbb16a5885bf
[]
no_license
ssung0810/class-SpringBoot
93ff4278eac95267d0ac1e499e9f77884124bf55
940280b838c1c38e1708ce594f71f62affceb095
refs/heads/master
2023-09-05T15:54:04.610648
2021-11-26T13:49:54
2021-11-26T13:49:54
431,879,201
0
0
null
null
null
null
UTF-8
Java
false
false
44
java
package hello.demo; public class demo { }
[ "qkrtjdcjf124@gmail.com" ]
qkrtjdcjf124@gmail.com
1e30b91f7205c0f7c43af97e12d393b00b5704cf
9b537c88e78b82f58e04171d6d68ace7a2b66ab7
/usage-collection/src/main/java/com/sequenceiq/cloudbreak/usage/strategy/CloudwatchUsageProcessingStrategy.java
50b69ebdaf6df4ce6f382a18abb911cdf4079e57
[ "LicenseRef-scancode-warranty-disclaimer", "ANTLR-PD", "CDDL-1.0", "bzip2-1.0.6", "Zlib", "BSD-3-Clause", "MIT", "EPL-1.0", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-jdbm-1.00", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
stoty/cloudbreak
10d9eea4961e43533088467f9ff58221abaf0f1b
a8afecf96a02d2ccdb8abf9c329f8269c7b4264d
refs/heads/master
2022-03-12T03:39:52.991951
2022-01-26T15:23:41
2022-01-26T15:23:41
224,849,359
0
0
Apache-2.0
2019-11-29T12:23:00
2019-11-29T12:23:00
null
UTF-8
Java
false
false
2,723
java
package com.sequenceiq.cloudbreak.usage.strategy; import java.time.Instant; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import com.cloudera.thunderhead.service.common.usage.UsageProto; import com.google.common.io.BaseEncoding; import com.sequenceiq.cloudbreak.cloudwatch.model.CloudwatchRecordRequest; import com.sequenceiq.cloudbreak.common.json.JsonUtil; import com.sequenceiq.cloudbreak.usage.processor.EdhCloudwatchConfiguration; import com.sequenceiq.cloudbreak.usage.processor.EdhCloudwatchField; import com.sequenceiq.cloudbreak.usage.processor.EdhCloudwatchProcessor; /** * Cloudwatch usage reporter strategy class that transfer events to cloudwatch log streams for specific log group. */ @Service public class CloudwatchUsageProcessingStrategy implements UsageProcessingStrategy { private final EdhCloudwatchProcessor edhKuduProcessor; private final EdhCloudwatchConfiguration edhCloudwatchConfiguration; private final Map<String, Object> additionalFields; public CloudwatchUsageProcessingStrategy(EdhCloudwatchProcessor edhKuduProcessor, EdhCloudwatchConfiguration edhCloudwatchConfiguration) { this.edhKuduProcessor = edhKuduProcessor; this.edhCloudwatchConfiguration = edhCloudwatchConfiguration; this.additionalFields = toMap(edhCloudwatchConfiguration.getAdditionalFields()); } @Override public void processUsage(UsageProto.Event event) { Map<String, Object> fields = new HashMap<>(); long timestamp = event.getTimestamp(); String binaryUsageEvent = BaseEncoding.base64().encode(event.toByteArray()); fields.put("@message", String.format("CDP_BINARY_USAGE_EVENT - %s", binaryUsageEvent)); fields.put("@timestamp", Instant.now().toEpochMilli()); if (MapUtils.isNotEmpty(additionalFields)) { fields.putAll(additionalFields); } String jsonMessageInput = JsonUtil.createJsonTree(fields).toString(); CloudwatchRecordRequest recordRequest = CloudwatchRecordRequest.Builder.newBuilder() .withTimestamp(timestamp) .withRawBody(jsonMessageInput) .build(); edhKuduProcessor.processRecord(recordRequest); } public boolean isEnabled() { return edhCloudwatchConfiguration.isEnabled(); } private Map<String, Object> toMap(List<EdhCloudwatchField> additionalFields) { Map<String, Object> map = new HashMap<>(); for (EdhCloudwatchField field : additionalFields) { map.put(field.getKey(), field.getValue()); } return map; } }
[ "oleewere@gmail.com" ]
oleewere@gmail.com
0cc55c3b797a460911301dfb2883eebcd6c498d6
245de98419e42be7e6bb62884297da3fa3897f53
/xwing/xwing/xwing-jpa/src/main/java/com/raf/xwing/jpa/domain/package-info.java
29d4218204c558ad305dbd06849f616220002308
[]
no_license
rtourneur/webwing
64dfe317b8bf0bded0a962cf60aa6d243fe52071
81041f21f4c3b0bc24d7f7469232b72d410dcaa8
refs/heads/master
2021-06-10T15:54:13.797772
2017-04-03T07:46:31
2017-04-03T07:46:31
38,232,599
0
0
null
null
null
null
UTF-8
Java
false
false
90
java
/** * Package for domain entities. * @author RAF */ package com.raf.xwing.jpa.domain;
[ "rtourneur.rt@gmail.com" ]
rtourneur.rt@gmail.com
5c1ca1db3dcf5b55d88e810484c66f259e6d7633
c44e8efb15c6f5edc8810aaad63a4f5f4f8d208d
/SmsMms/app/src/androidTest/java/com/example/floura/smsmms/ExampleInstrumentedTest.java
85d6e2b63f734d881087157703a2f8b9d94d4c9b
[]
no_license
floura-angel/C-Java-and-ASP-.Net-Projects
a12d37aad627d0dcbdfe9f485567ab201411503a
d83a961ad166f1d538a2493ee9deb3c18b13f964
refs/heads/master
2021-07-24T12:50:05.695254
2017-11-05T17:33:11
2017-11-05T17:33:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package com.example.floura.smsmms; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.floura.smsmms", appContext.getPackageName()); } }
[ "floura71196@gmail.com" ]
floura71196@gmail.com
26f551b6ef85cef87a596b93ce6b6bc7a9c176d3
4da542f90c3fa937887010b675d4e3aa7b338e2e
/chapter3/src/pk3/IntegerVariable.java
e2ddcb63302e2344a8f83a373d25aa526caa2d0c
[]
no_license
seseyoung/JAVA1-210624-
bc290d5272c5613bbcde925484cfab094b314d26
3de353de78d4be8f6fdacb90eadfe2928db0d811
refs/heads/master
2023-06-03T04:04:05.432765
2021-06-24T08:38:22
2021-06-24T08:38:22
379,836,080
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package pk3; public class IntegerVariable { public static void main(String[] args) { short sVal=10; byte bVal=20; int result= sVal+bVal; System.out.println("두수의 합은 : " + (sVal+bVal)); //() 표시가 있어야 계산한다 System.out.println("두수의 합은 : " + result); //섞어서 계산 가능 } }
[ "zzang@LAPTOP-IKSQTVE2" ]
zzang@LAPTOP-IKSQTVE2
c7b6f0df9378e6cbaa6b6363e07ce952392ef6b3
1930d97ebfc352f45b8c25ef715af406783aabe2
/src/main/java/com/alipay/api/domain/ShopQueueStatus.java
ba092cb1fc712c2a1680f9fb1073833c1ae38250
[ "Apache-2.0" ]
permissive
WQmmm/alipay-sdk-java-all
57974d199ee83518523e8d354dcdec0a9ce40a0c
66af9219e5ca802cff963ab86b99aadc59cc09dd
refs/heads/master
2023-06-28T03:54:17.577332
2021-08-02T10:05:10
2021-08-02T10:05:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,421
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 排队队列状态 * * @author auto create * @since 1.0, 2019-05-16 10:38:29 */ public class ShopQueueStatus extends AlipayObject { private static final long serialVersionUID = 3248849813318463273L; /** * 队列ID */ @ApiField("queue_id") private String queueId; /** * 队列状态。如enable表示可取号;disable表示不可取号。 */ @ApiField("queue_status") private String queueStatus; /** * 当前等待人数 */ @ApiField("queue_wait") private Long queueWait; /** * 当前等待时间(单位:分钟)。如无法预估传-1即可。 */ @ApiField("queue_wait_time") private Long queueWaitTime; public String getQueueId() { return this.queueId; } public void setQueueId(String queueId) { this.queueId = queueId; } public String getQueueStatus() { return this.queueStatus; } public void setQueueStatus(String queueStatus) { this.queueStatus = queueStatus; } public Long getQueueWait() { return this.queueWait; } public void setQueueWait(Long queueWait) { this.queueWait = queueWait; } public Long getQueueWaitTime() { return this.queueWaitTime; } public void setQueueWaitTime(Long queueWaitTime) { this.queueWaitTime = queueWaitTime; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
19a9fc550f9e8e9a7d7ebab9e33c19bf79ab35c1
20528da5ced2edb1e58d4b244dc5f957b568ca08
/storage/src/main/java/com/example/storage/database/RecordFileDao.java
ed03c8ff31dfb5c558b81dc71aacbe24f2bdb9b5
[]
no_license
esaman1/VoiceChange
8af010348f54f683f2984ca39044a007573cbd0b
59b18bd9498d332cb338bc72d8068a722d65e6d3
refs/heads/main
2023-09-05T21:42:39.120297
2021-11-10T04:08:12
2021-11-10T04:08:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package com.example.storage.database; import androidx.lifecycle.LiveData; import androidx.room.Dao; import androidx.room.Insert; import androidx.room.OnConflictStrategy; import androidx.room.Query; import com.example.storage.data.RecordFile; import java.util.List; @Dao public interface RecordFileDao { @Insert(onConflict = OnConflictStrategy.IGNORE) void insert(RecordFile recordFile); @Query("DELETE FROM RecordFile WHERE path = :path") void deleteFile(String path); @Query("SELECT * FROM RecordFile ORDER BY name ASC") LiveData<List<RecordFile>> getAllFile(); }
[ "duong.hoang.182000@gmail.com" ]
duong.hoang.182000@gmail.com
2227d1b8859f62913cecdce7e0c424bf67485fae
939187081afaa8ff20227fa6dc8502f5745a99a7
/JavaBasic/src/main/java/LeetCode.java
e8fd38e5ea34a5164a99247ad584dab667bbfe58
[]
no_license
Sean-Xiao-Liu/SQS-Message-Consumer
a5ee3e897c8057eb6039c8edfe1e7c08ac36b652
d2afd91c445ec02de9219474dfb07fe1727203f9
refs/heads/master
2021-07-12T20:49:40.409127
2019-10-07T18:59:51
2019-10-07T18:59:51
213,461,678
0
0
null
null
null
null
UTF-8
Java
false
false
49
java
package PACKAGE_NAME; public class LeetCode { }
[ "glxiaoliu@gmail.com" ]
glxiaoliu@gmail.com
9f6129151dd60fd4d5e64dad0f7b49c8cd5c18ac
53c333f53754c85038d3903d80b6134bfed82c29
/app/controllers/Account.java
122217f662ea0ce3501d4393060447715c3024ce
[]
no_license
davidwen/Paysplit
ab65f4f08a5e9ff1a71bc7568cf916b8a8abde80
52ce3353ce6f70ceb2648968f1b7cf725d2d4659
refs/heads/master
2016-09-05T12:21:36.116329
2013-09-29T07:21:39
2013-09-29T07:21:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,936
java
package controllers; import models.User; import play.libs.Crypto; import play.mvc.Controller; import play.mvc.With; @With(UserLogin.class) public class Account extends Controller { public static void showSettings() { User user = UserLogin.getUser(); if (User.isTour(user)) { Dashboard.dashboard(); } render(user); } public static void changePassword( String oldPassword, String newPassword) { User user = UserLogin.getUser(); if (user.hashedPassword.equals(Crypto.passwordHash(oldPassword))) { user.hashedPassword = Crypto.passwordHash(newPassword); } else { validation.addError("password", "Incorrect Password"); } if (validation.hasErrors()) { validation.keep(); } else { user.save(); flash.put("passwordConfirmation", "true"); } showSettings(); } public static void changeEmail(String newEmail) { User user = UserLogin.getUser(); validation.email("email", newEmail); if (!user.emailAddress.equals(newEmail)) { user.emailAddress = newEmail; } else { validation.addError("email", "E-mail address same as original"); } if (validation.hasErrors()) { validation.keep(); } else { user.save(); flash.put("emailConfirmation", "true"); } showSettings(); } public static void setReceiveEmail(Boolean receiveEmail) { User user = UserLogin.getUser(); if (Boolean.TRUE.equals(receiveEmail)) { user.receiveEmail = true; } else { user.receiveEmail = false; } user.save(); flash.put("receiveEmailConfirmation", "true"); showSettings(); } }
[ "david@dwen.me" ]
david@dwen.me
897a8cd7384c3868efe80e49a52b710ab5bd2611
6c0d4f3828966746d72471b2131f68a05b4036bf
/src/product/cmc/com/topvision/ems/cmc/qos/service/impl/CmcQosServiceImpl.java
fb5e615adb662b0f7410d9efff315153ca251dfb
[]
no_license
kevinXiao2016/topvision-server
b5b97de7436edcae94ad2648bce8a34759f7cf0b
b5934149c50f22661162ac2b8903b61a50bc63e9
refs/heads/master
2020-04-12T00:54:33.351152
2018-12-18T02:16:14
2018-12-18T02:16:14
162,215,931
0
1
null
null
null
null
UTF-8
Java
false
false
25,077
java
/*********************************************************************** * $Id: QosServiceImpl.java,v1.0 2011-12-8 上午10:58:37 $ * * @author: loyal * * (c)Copyright 2011 Topvision All rights reserved. ***********************************************************************/ package com.topvision.ems.cmc.qos.service.impl; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.topvision.ems.cmc.ccmts.facade.domain.CmcAttribute; import com.topvision.ems.cmc.exception.SetValueFailException; import com.topvision.ems.cmc.facade.domain.CmAttribute; import com.topvision.ems.cmc.qos.dao.CmcQosDao; import com.topvision.ems.cmc.qos.domain.CmcQosServiceClassInfo; import com.topvision.ems.cmc.qos.domain.CmcQosServiceFlowInfo; import com.topvision.ems.cmc.qos.domain.CmcQosServiceFlowStats; import com.topvision.ems.cmc.qos.facade.domain.CmMacToServiceFlow; import com.topvision.ems.cmc.qos.facade.domain.CmcQosDynamicServiceStats; import com.topvision.ems.cmc.qos.facade.domain.CmcQosParamSetInfo; import com.topvision.ems.cmc.qos.facade.domain.CmcQosPktClassInfo; import com.topvision.ems.cmc.qos.facade.domain.CmcQosServiceClass; import com.topvision.ems.cmc.qos.facade.domain.CmcQosServiceFlowAttribute; import com.topvision.ems.cmc.qos.facade.domain.CmcQosServiceFlowStatus; import com.topvision.ems.cmc.qos.service.CmcQosService; import com.topvision.ems.cmc.service.impl.CmcBaseCommonService; import com.topvision.ems.template.service.EntityTypeService; /** * 服务流功能实现 * * @author loyal * @created @2011-12-8-上午10:58:37 * */ @Service("cmcQosService") public class CmcQosServiceImpl extends CmcBaseCommonService implements CmcQosService { @Resource(name = "cmcQosDao") private CmcQosDao cmcQosDao; @Autowired private EntityTypeService entityTypeService; /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#getQosUpDynamicServiceStatsInfo(java.lang.Long) */ @Override public CmcQosDynamicServiceStats getQosUpDynamicServiceStatsInfo(Long cmcId) { // 获取指定CMC上的上 行动态服务流统计信息 return cmcQosDao.getQosUpDynamicServiceStatsInfo(cmcId); } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#getQosDownDynamicServiceStatsInfo(java.lang.Long) */ @Override public CmcQosDynamicServiceStats getQosDownDynamicServiceStatsInfo(Long cmcId) { // 获取指定CMC上的下行动态服务流统计信息 return cmcQosDao.getQosDownDynamicServiceStatsInfo(cmcId); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#getUpQosServiceFlowStatsInfo(java.util.Map) */ @Override public CmcQosServiceFlowStats getUpQosServiceFlowStatsInfo(Map<String, Object> map) { // 获取指定CMC上的服务流数量统计 return cmcQosDao.getUpQosServiceFlowStatsInfo(map); } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#getDownQosServiceFlowStatsInfo(java.util.Map) */ public CmcQosServiceFlowStats getDownQosServiceFlowStatsInfo(Map<String, Object> map) { // 获取指定CMC上的服务流数量统计 return cmcQosDao.getDownQosServiceFlowStatsInfo(map); } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#getCmcQosServiceFlowListInfoWithCondition(java * .util.Map, java.lang.Integer, java.lang.Integer) */ @Override public List<CmcQosServiceFlowInfo> getCmcQosServiceFlowListInfoWithCondition(Map<String, String> map, Integer start, Integer limit) { return cmcQosDao.getCmcQosServiceFlowListInfoWithCondition(map, start, limit); } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#getCmcQosServiceFlowListNumWithCondition(java * .util.Map) */ @Override public Integer getCmcQosServiceFlowListNumWithCondition(Map<String, String> map) { // 调用Dao中方法获得过滤的服务流信息 return cmcQosDao.getCmcQosServiceFlowListNumWithCondition(map); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#getQosParamSetInfo(java.lang.Long) */ @Override public List<CmcQosParamSetInfo> getQosParamSetInfo(Long sId) { // 从数据库中取cmcId和sId指定的服务流参数集信息 return cmcQosDao.getQosParamSetInfo(sId); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#getQosPktClassInfo(java.lang.Long) */ @Override public List<CmcQosPktClassInfo> getQosPktClassInfo(Long sId) { // 从数据库中取cmcId和sId指定包分类器信息 return cmcQosDao.getQosPktClassInfo(sId); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#getServiceFlowConnectedCm(java.lang.Long) */ @Override public CmAttribute getServiceFlowConnectedCm(Long sId) { return cmcQosDao.getServiceFlowConnectedCm(sId); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcService#getQosServiceClassList(java.lang.Long) */ @Override public List<CmcQosServiceClassInfo> getQosServiceClassList(Long cmcId) { // 调用Dao层方法 Long entityId = getEntityIdByCmcId(cmcId); return cmcQosDao.getQosServiceClassList(entityId); } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcService#getQosServiceClassInfo(java.util.Map) */ @Override public CmcQosServiceClass getQosServiceClassInfo(Long scId) { // 调用Dao层方法 return cmcQosDao.getQosServiceClassInfo(scId); } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcService#createOrModifyServiceClassInfo(com.topvision.ems * .cmc.facade.domain.CmcQosServiceClass) */ @Override public Boolean createOrModifyServiceClassInfo(CmcQosServiceClass serviceClass, Long cmcId) { // 1.根据cmcId查询出entityId,根据entityId查询snmpParam Long entityId = getEntityIdByCmcId(cmcId); serviceClass.setEntityId(entityId); snmpParam = getSnmpParamByEntityId(entityId); // 2.调用cmcFacade 中方法 createOrModifyServiceClassInfo修改相应信息 CmcQosServiceClass cmcQosServiceClassAfterModify = getCmcFacade(snmpParam.getIpAddress()) .createOrModifyServiceClassInfo(snmpParam, serviceClass); // 3.与返回值比较,如果不相等,抛出异常 boolean isSuccess = true; if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassName().equals(serviceClass.getClassName())) { isSuccess = false; logger.error("cmc.message.cmc.setClassName"); } /* * if (cmcQosServiceClassAfterModify != null && * !cmcQosServiceClassAfterModify.getClassStatus().equals( serviceClass.getClassStatus())) { * sBuilder.append(getString("cmc.message.cmc.setClassStatus")); } */ if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassPriority().equals(serviceClass.getClassPriority())) { isSuccess = false; logger.error("cmc.message.cmc.setClassPriority"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMaxTrafficRate() .equals(serviceClass.getClassMaxTrafficRate())) { isSuccess = false; logger.error("cmc.message.cmc.setClassMaxTrafficRate"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMaxTrafficBurst().equals( serviceClass.getClassMaxTrafficBurst())) { isSuccess = false; logger.error("cmc.message.cmc.setClassMaxTrafficBurst"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMinReservedRate().equals( serviceClass.getClassMinReservedRate())) { isSuccess = false; logger.error("cmc.message.cmc.setClassMinReservedRate"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMinReservedPkt() .equals(serviceClass.getClassMinReservedPkt())) { isSuccess = false; logger.error("cmc.message.cmc.setClassMinReservedPkt"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMaxConcatBurst() .equals(serviceClass.getClassMaxConcatBurst())) { isSuccess = false; logger.error("cmc.message.cmc.setClassName"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassNomPollInterval().equals( serviceClass.getClassNomPollInterval())) { isSuccess = false; logger.error("cmc.message.cmc.setClassNomPollInterval"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassTolPollJitter().equals(serviceClass.getClassTolPollJitter())) { isSuccess = false; logger.error("cmc.message.cmc.setClassTolPollJitter"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassUnsolicitGrantSize().equals( serviceClass.getClassUnsolicitGrantSize())) { isSuccess = false; logger.error("cmc.message.cmc.setClassName"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassNomGrantInterval().equals( serviceClass.getClassNomGrantInterval())) { isSuccess = false; logger.error("cmc.message.cmc.setClassNomGrantInterval"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassTolGrantJitter() .equals(serviceClass.getClassTolGrantJitter())) { isSuccess = false; logger.error("cmc.message.cmc.setClassTolGrantJitter"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassGrantsPerInterval().equals( serviceClass.getClassGrantsPerInterval())) { isSuccess = false; logger.error("cmc.message.cmc.setClassGrantsPerInterval"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassMaxLatency().equals(serviceClass.getClassMaxLatency())) { isSuccess = false; logger.error("cmc.message.cmc.setClassMaxLatency"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassActiveTimeout().equals(serviceClass.getClassActiveTimeout())) { isSuccess = false; logger.error("cmc.message.cmc.setClassActiveTimeout"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassAdmittedTimeout().equals( serviceClass.getClassAdmittedTimeout())) { isSuccess = false; logger.error("cmc.message.cmc.setClassAdmittedTimeout"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassSchedulingType() .equals(serviceClass.getClassSchedulingType())) { isSuccess = false; logger.error("cmc.message.cmc.setClassSchedulingType"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassRequestPolicy().equals(serviceClass.getClassRequestPolicy())) { isSuccess = false; logger.error("cmc.message.cmc.setClassRequestPolicy"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassTosAndMask().equals(serviceClass.getClassTosAndMask())) { isSuccess = false; logger.error("cmc.message.cmc.setClassName"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassTosOrMask().equals(serviceClass.getClassTosOrMask())) { isSuccess = false; logger.error("cmc.message.cmc.setClassTosOrMask"); } if (cmcQosServiceClassAfterModify != null && !cmcQosServiceClassAfterModify.getClassDirection().equals(serviceClass.getClassDirection())) { isSuccess = false; logger.error("cmc.message.cmc.setClassDirection"); } if (!isSuccess) { throw new SetValueFailException("set failure"); } // 4.更新数据库 cmcQosDao.insertOrUpdateServiceClass(serviceClass); return null; } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcService#deleteServiceClassInfo(java.lang.Long) */ @Override public Boolean deleteServiceClassInfo(Long scId, Long cmcId) { // 1.根据cmcId查询出entityId,根据entityId查询snmpParam Long entityId = getEntityIdByCmcId(cmcId); snmpParam = getSnmpParamByEntityId(entityId); // 2.根据scId查找出所要删除的Service class CmcQosServiceClass cmcQosServiceClass = cmcQosDao.getQosServiceClassInfo(scId); cmcQosServiceClass.setClassStatus(6); // 3.调用cmcFacade 中方法 ??? 删除相应信息 CmcQosServiceClass cmcQosServiceClassAfterDelete = getCmcFacade(snmpParam.getIpAddress()) .deleteServiceClassInfo(snmpParam, cmcQosServiceClass); // 4.与返回值比较,如果不相等,抛出异常 if (cmcQosServiceClassAfterDelete != null) { } // 5.更新数据库 cmcQosDao.deleteServiceClass(scId); return null; } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#getEntityIdByCmcId(java.lang.Long) */ @Override public Long getEntityIdByCmcId(Long cmcId) { return cmcQosDao.getEntityIdByCmcId(cmcId); } public CmcQosDao getCmcQosDao() { return cmcQosDao; } public void setCmcQosDao(CmcQosDao cmcQosDao) { this.cmcQosDao = cmcQosDao; } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#refreshServiceFlowBaseInfo(java.lang.Long) */ @Override public List<CmcQosServiceFlowAttribute> refreshServiceFlowBaseInfo(Long cmcId) { // 1.根据cmcId查询出entityId,根据entityId查询snmpParam CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmcQosServiceFlowAttribute> cmcQosServiceFlowAttributeList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); cmcQosServiceFlowAttributeList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowBaseInfo( snmpParam); for (CmcQosServiceFlowAttribute csa : cmcQosServiceFlowAttributeList) { //临时设置,在更新数据库时会修改 csa.setCmcId(cmcId); } if (cmcQosServiceFlowAttributeList.size() != 0) { cmcQosDao.batchInsertCmcQosServiceFlowAttribute(cmcQosServiceFlowAttributeList, entityId); } else { List<Long> cmcIdList = cmcQosDao.getCmcIdByOlt(entityId); for (Long cmcIdTemp : cmcIdList) { cmcQosDao.deleteCmcQosServiceFlowRelation(cmcIdTemp); } } } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmcQosServiceFlowAttributeList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowBaseInfo( snmpParam); for (CmcQosServiceFlowAttribute csa : cmcQosServiceFlowAttributeList) { csa.setCmcId(cmcId); } if (cmcQosServiceFlowAttributeList.size() != 0) { cmcQosDao.batchInsertCmcQosServiceFlowAttribute8800B(cmcQosServiceFlowAttributeList, cmcId); } else { cmcQosDao.deleteCmcQosServiceFlowRelation(cmcId); } } return cmcQosServiceFlowAttributeList; } @Override public List<CmcQosServiceFlowAttribute> refreshServiceFlowBaseInfoOnCC(Long cmcId, Long cmcIndex) { CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmcQosServiceFlowAttribute> cmcQosServiceFlowAttributeList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); cmcQosServiceFlowAttributeList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowBaseInfoOnCC( snmpParam, cmcIndex); List<Long> dbSid = cmcQosDao.getDBSIdListByCmcId(cmcId); if (cmcQosServiceFlowAttributeList.size() != 0) { cmcQosDao.batchInsertOrUpdateQosServiceFlowAttrOnCC(cmcQosServiceFlowAttributeList, cmcId, dbSid); } else { //cmcDiscoveryDao.deleteCmcQosServiceFlowRelation(cmcId); } } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmcQosServiceFlowAttributeList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowBaseInfo( snmpParam); for (CmcQosServiceFlowAttribute csa : cmcQosServiceFlowAttributeList) { csa.setCmcId(cmcId); } if (cmcQosServiceFlowAttributeList.size() != 0) { cmcQosDao.batchInsertCmcQosServiceFlowAttribute8800B(cmcQosServiceFlowAttributeList, cmcId); } else { cmcQosDao.deleteCmcQosServiceFlowRelation(cmcId); } } return cmcQosServiceFlowAttributeList; } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#refreshServiceFlowStatus(java.lang.Long) */ @Override public List<CmcQosServiceFlowStatus> refreshServiceFlowStatus(Long cmcId) { // 1.根据cmcId查询出entityId,根据entityId查询snmpParam Long entityId = getEntityIdByCmcId(cmcId); snmpParam = getSnmpParamByEntityId(entityId); // 2.调用cmcFacade 中方法 refreshServiceFlowStatusInfo刷新相应信息 List<CmcQosServiceFlowStatus> cmcQosServiceFlowStatusList = getCmcFacade(snmpParam.getIpAddress()) .refreshServiceFlowStatusInfo(snmpParam); cmcQosDao.batchInsertCmcQosServiceFlowStatus(cmcQosServiceFlowStatusList, cmcId); return cmcQosServiceFlowStatusList; } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#refreshServiceFlowPktClassInfos(java.lang.Long) */ @Override public List<CmcQosPktClassInfo> refreshServiceFlowPktClassInfos(Long cmcId) { CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmcQosPktClassInfo> cmcQosPktClassInfoList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); // 2.调用cmcFacade 中方法 refreshServiceFlowPktClassInfos刷新相应信息 cmcQosPktClassInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowPktClassInfos(snmpParam); cmcQosDao.batchInsertCmcQosPktClassInfo(cmcQosPktClassInfoList, entityId); } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmcQosPktClassInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowPktClassInfos(snmpParam); cmcQosDao.batchInsertCmcQosPktClassInfo8800B(cmcQosPktClassInfoList, cmcId); } return cmcQosPktClassInfoList; } /* * (non-Javadoc) * * @see * com.topvision.ems.cmc.service.CmcQosService#refreshServiceFlowParamSetInfos(java.lang.Long) */ @Override public List<CmcQosParamSetInfo> refreshServiceFlowParamSetInfos(Long cmcId) { CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmcQosParamSetInfo> cmcQosParamSetInfoList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); // 2.调用cmcFacade 中方法 refreshServiceFlowPktClassInfos刷新相应信息 cmcQosParamSetInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowParamSetInfos(snmpParam); cmcQosDao.batchInsertCmcQosParamSetInfo(cmcQosParamSetInfoList, entityId); } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmcQosParamSetInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowParamSetInfos(snmpParam); cmcQosDao.batchInsertCmcQosParamSetInfo8800B(cmcQosParamSetInfoList, cmcId); } return cmcQosParamSetInfoList; } @Override public List<CmcQosParamSetInfo> refreshServiceFlowParamSetOnCC(Long cmcId, Long cmcIndex) { CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmcQosParamSetInfo> cmcQosParamSetInfoList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); List<Long> serviceFlowIdListInDb = cmcQosDao.getServiceFlowIdListByCmcId(cmcId); List<Long> sIdListInDb = cmcQosDao.getDBSIdListByCmcId(cmcId); cmcQosParamSetInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowParamSetOnCC(snmpParam, cmcIndex, serviceFlowIdListInDb); if (cmcQosParamSetInfoList.size() > 0) { cmcQosDao.batchInsertOrUpdateCmcQosParamSetInfoOnCC(cmcQosParamSetInfoList, cmcId, sIdListInDb); } else { cmcQosDao.deleteServiceFlowParmsetRelationByCmcId(cmcId); } } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmcQosParamSetInfoList = getCmcFacade(snmpParam.getIpAddress()).refreshServiceFlowParamSetInfos(snmpParam); cmcQosDao.batchInsertCmcQosParamSetInfo8800B(cmcQosParamSetInfoList, cmcId); } return cmcQosParamSetInfoList; } /* * (non-Javadoc) * * @see com.topvision.ems.cmc.service.CmcQosService#refreshCmMacToServiceFlows(java.lang.Long) */ @Override public List<CmMacToServiceFlow> refreshCmMacToServiceFlows(Long cmcId) { CmcAttribute cmcAttribute = cmcQosDao.getCmcAttributeByCmcId(cmcId); long entityId = getEntityIdByCmcId(cmcId); List<CmMacToServiceFlow> cmMacToServiceFlowList = null; if (entityTypeService.isCcmtsWithoutAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByEntityId(entityId); // 2.调用cmcFacade 中方法 refreshServiceFlowPktClassInfos刷新相应信息 cmMacToServiceFlowList = getCmcFacade(snmpParam.getIpAddress()).refreshCmMacToServiceFlows(snmpParam); cmcQosDao.batchInsertCmMacToServiceFlow(cmMacToServiceFlowList, entityId); } else if (entityTypeService.isCcmtsWithAgent(cmcAttribute.getCmcDeviceStyle())) { snmpParam = getSnmpParamByCmcId(cmcId); cmMacToServiceFlowList = getCmcFacade(snmpParam.getIpAddress()).refreshCmMacToServiceFlows(snmpParam); cmcQosDao.batchInsertCC8800BCmMacToServiceFlow(cmMacToServiceFlowList, cmcId, entityId); } return cmMacToServiceFlowList; } }
[ "785554043@qq.com" ]
785554043@qq.com
27130d0d81ea927f4ed77c1a12fe78e5088d8dc7
473fc28d466ddbe9758ca49c7d4fb42e7d82586e
/app/src/main/java/com/syd/source/aosp/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/modes/GCMBlockCipher.java
1ba5ebb18cc06c93cf985ecf7abe8cdd63bdfcba
[ "MIT" ]
permissive
lz-purple/Source
a7788070623f2965a8caa3264778f48d17372bab
e2745b756317aac3c7a27a4c10bdfe0921a82a1c
refs/heads/master
2020-12-23T17:03:12.412572
2020-01-31T01:54:37
2020-01-31T01:54:37
237,205,127
4
2
null
null
null
null
UTF-8
Java
false
false
18,327
java
package org.bouncycastle.crypto.modes; import org.bouncycastle.crypto.BlockCipher; import org.bouncycastle.crypto.CipherParameters; import org.bouncycastle.crypto.DataLengthException; import org.bouncycastle.crypto.InvalidCipherTextException; import org.bouncycastle.crypto.OutputLengthException; import org.bouncycastle.crypto.modes.gcm.GCMExponentiator; import org.bouncycastle.crypto.modes.gcm.GCMMultiplier; import org.bouncycastle.crypto.modes.gcm.GCMUtil; import org.bouncycastle.crypto.modes.gcm.Tables1kGCMExponentiator; import org.bouncycastle.crypto.modes.gcm.Tables8kGCMMultiplier; import org.bouncycastle.crypto.params.AEADParameters; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.crypto.params.ParametersWithIV; import org.bouncycastle.util.Arrays; import org.bouncycastle.util.Pack; /** * Implements the Galois/Counter mode (GCM) detailed in * NIST Special Publication 800-38D. */ public class GCMBlockCipher implements AEADBlockCipher { private static final int BLOCK_SIZE = 16; // BEGIN android-added // 2^36-32 : limitation imposed by NIST GCM as otherwise the counter is wrapped and it can leak // plaintext and authentication key private static final long MAX_INPUT_SIZE = 68719476704L; // END android-added // not final due to a compiler bug private BlockCipher cipher; private GCMMultiplier multiplier; private GCMExponentiator exp; // These fields are set by init and not modified by processing private boolean forEncryption; private boolean initialised; private int macSize; private byte[] lastKey; private byte[] nonce; private byte[] initialAssociatedText; private byte[] H; private byte[] J0; // These fields are modified during processing private byte[] bufBlock; private byte[] macBlock; private byte[] S, S_at, S_atPre; private byte[] counter; private int blocksRemaining; private int bufOff; private long totalLength; private byte[] atBlock; private int atBlockPos; private long atLength; private long atLengthPre; public GCMBlockCipher(BlockCipher c) { this(c, null); } public GCMBlockCipher(BlockCipher c, GCMMultiplier m) { if (c.getBlockSize() != BLOCK_SIZE) { throw new IllegalArgumentException( "cipher required with a block size of " + BLOCK_SIZE + "."); } if (m == null) { // TODO Consider a static property specifying default multiplier m = new Tables8kGCMMultiplier(); } this.cipher = c; this.multiplier = m; } public BlockCipher getUnderlyingCipher() { return cipher; } public String getAlgorithmName() { return cipher.getAlgorithmName() + "/GCM"; } /** * NOTE: MAC sizes from 32 bits to 128 bits (must be a multiple of 8) are supported. The default is 128 bits. * Sizes less than 96 are not recommended, but are supported for specialized applications. */ public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException { this.forEncryption = forEncryption; this.macBlock = null; this.initialised = true; KeyParameter keyParam; byte[] newNonce = null; if (params instanceof AEADParameters) { AEADParameters param = (AEADParameters)params; newNonce = param.getNonce(); initialAssociatedText = param.getAssociatedText(); int macSizeBits = param.getMacSize(); if (macSizeBits < 32 || macSizeBits > 128 || macSizeBits % 8 != 0) { throw new IllegalArgumentException("Invalid value for MAC size: " + macSizeBits); } macSize = macSizeBits / 8; keyParam = param.getKey(); } else if (params instanceof ParametersWithIV) { ParametersWithIV param = (ParametersWithIV)params; newNonce = param.getIV(); initialAssociatedText = null; macSize = 16; keyParam = (KeyParameter)param.getParameters(); } else { throw new IllegalArgumentException("invalid parameters passed to GCM"); } int bufLength = forEncryption ? BLOCK_SIZE : (BLOCK_SIZE + macSize); this.bufBlock = new byte[bufLength]; if (newNonce == null || newNonce.length < 1) { throw new IllegalArgumentException("IV must be at least 1 byte"); } if (forEncryption) { if (nonce != null && Arrays.areEqual(nonce, newNonce)) { if (keyParam == null) { throw new IllegalArgumentException("cannot reuse nonce for GCM encryption"); } if (lastKey != null && Arrays.areEqual(lastKey, keyParam.getKey())) { throw new IllegalArgumentException("cannot reuse nonce for GCM encryption"); } } } nonce = newNonce; if (keyParam != null) { lastKey = keyParam.getKey(); } // TODO Restrict macSize to 16 if nonce length not 12? // Cipher always used in forward mode // if keyParam is null we're reusing the last key. if (keyParam != null) { cipher.init(true, keyParam); this.H = new byte[BLOCK_SIZE]; cipher.processBlock(H, 0, H, 0); // GCMMultiplier tables don't change unless the key changes (and are expensive to init) multiplier.init(H); exp = null; } else if (this.H == null) { throw new IllegalArgumentException("Key must be specified in initial init"); } this.J0 = new byte[BLOCK_SIZE]; if (nonce.length == 12) { System.arraycopy(nonce, 0, J0, 0, nonce.length); this.J0[BLOCK_SIZE - 1] = 0x01; } else { gHASH(J0, nonce, nonce.length); byte[] X = new byte[BLOCK_SIZE]; Pack.longToBigEndian((long)nonce.length * 8, X, 8); gHASHBlock(J0, X); } this.S = new byte[BLOCK_SIZE]; this.S_at = new byte[BLOCK_SIZE]; this.S_atPre = new byte[BLOCK_SIZE]; this.atBlock = new byte[BLOCK_SIZE]; this.atBlockPos = 0; this.atLength = 0; this.atLengthPre = 0; this.counter = Arrays.clone(J0); this.blocksRemaining = -2; // page 8, len(P) <= 2^39 - 256, 1 block used by tag but done on J0 this.bufOff = 0; this.totalLength = 0; if (initialAssociatedText != null) { processAADBytes(initialAssociatedText, 0, initialAssociatedText.length); } } public byte[] getMac() { if (macBlock == null) { return new byte[macSize]; } return Arrays.clone(macBlock); } public int getOutputSize(int len) { int totalData = len + bufOff; if (forEncryption) { return totalData + macSize; } return totalData < macSize ? 0 : totalData - macSize; } // BEGIN android-added /** Helper used to ensure that {@link #MAX_INPUT_SIZE} is not exceeded. */ private long getTotalInputSizeAfterNewInput(int newInputLen) { return totalLength + newInputLen + bufOff; } // END android-added public int getUpdateOutputSize(int len) { int totalData = len + bufOff; if (!forEncryption) { if (totalData < macSize) { return 0; } totalData -= macSize; } return totalData - totalData % BLOCK_SIZE; } public void processAADByte(byte in) { checkStatus(); // BEGIN android-added if (getTotalInputSizeAfterNewInput(1) > MAX_INPUT_SIZE) { throw new DataLengthException("Input exceeded " + MAX_INPUT_SIZE + " bytes"); } // END android-added atBlock[atBlockPos] = in; if (++atBlockPos == BLOCK_SIZE) { // Hash each block as it fills gHASHBlock(S_at, atBlock); atBlockPos = 0; atLength += BLOCK_SIZE; } } public void processAADBytes(byte[] in, int inOff, int len) { // BEGIN android-added if (getTotalInputSizeAfterNewInput(len) > MAX_INPUT_SIZE) { throw new DataLengthException("Input exceeded " + MAX_INPUT_SIZE + " bytes"); } // END android-added for (int i = 0; i < len; ++i) { atBlock[atBlockPos] = in[inOff + i]; if (++atBlockPos == BLOCK_SIZE) { // Hash each block as it fills gHASHBlock(S_at, atBlock); atBlockPos = 0; atLength += BLOCK_SIZE; } } } private void initCipher() { if (atLength > 0) { System.arraycopy(S_at, 0, S_atPre, 0, BLOCK_SIZE); atLengthPre = atLength; } // Finish hash for partial AAD block if (atBlockPos > 0) { gHASHPartial(S_atPre, atBlock, 0, atBlockPos); atLengthPre += atBlockPos; } if (atLengthPre > 0) { System.arraycopy(S_atPre, 0, S, 0, BLOCK_SIZE); } } public int processByte(byte in, byte[] out, int outOff) throws DataLengthException { checkStatus(); // BEGIN android-added if (getTotalInputSizeAfterNewInput(1) > MAX_INPUT_SIZE) { throw new DataLengthException("Input exceeded " + MAX_INPUT_SIZE + " bytes"); } // END android-added bufBlock[bufOff] = in; if (++bufOff == bufBlock.length) { outputBlock(out, outOff); return BLOCK_SIZE; } return 0; } public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException { checkStatus(); // BEGIN android-added if (getTotalInputSizeAfterNewInput(len) > MAX_INPUT_SIZE) { throw new DataLengthException("Input exceeded " + MAX_INPUT_SIZE + " bytes"); } // END android-added if (in.length < (inOff + len)) { throw new DataLengthException("Input buffer too short"); } int resultLen = 0; for (int i = 0; i < len; ++i) { bufBlock[bufOff] = in[inOff + i]; if (++bufOff == bufBlock.length) { outputBlock(out, outOff + resultLen); resultLen += BLOCK_SIZE; } } return resultLen; } private void outputBlock(byte[] output, int offset) { if (output.length < (offset + BLOCK_SIZE)) { throw new OutputLengthException("Output buffer too short"); } if (totalLength == 0) { initCipher(); } gCTRBlock(bufBlock, output, offset); if (forEncryption) { bufOff = 0; } else { System.arraycopy(bufBlock, BLOCK_SIZE, bufBlock, 0, macSize); bufOff = macSize; } } public int doFinal(byte[] out, int outOff) throws IllegalStateException, InvalidCipherTextException { checkStatus(); if (totalLength == 0) { initCipher(); } int extra = bufOff; if (forEncryption) { if (out.length < (outOff + extra + macSize)) { throw new OutputLengthException("Output buffer too short"); } } else { if (extra < macSize) { throw new InvalidCipherTextException("data too short"); } extra -= macSize; if (out.length < (outOff + extra)) { throw new OutputLengthException("Output buffer too short"); } } if (extra > 0) { gCTRPartial(bufBlock, 0, extra, out, outOff); } atLength += atBlockPos; if (atLength > atLengthPre) { /* * Some AAD was sent after the cipher started. We determine the difference b/w the hash value * we actually used when the cipher started (S_atPre) and the final hash value calculated (S_at). * Then we carry this difference forward by multiplying by H^c, where c is the number of (full or * partial) cipher-text blocks produced, and adjust the current hash. */ // Finish hash for partial AAD block if (atBlockPos > 0) { gHASHPartial(S_at, atBlock, 0, atBlockPos); } // Find the difference between the AAD hashes if (atLengthPre > 0) { GCMUtil.xor(S_at, S_atPre); } // Number of cipher-text blocks produced long c = ((totalLength * 8) + 127) >>> 7; // Calculate the adjustment factor byte[] H_c = new byte[16]; if (exp == null) { exp = new Tables1kGCMExponentiator(); exp.init(H); } exp.exponentiateX(c, H_c); // Carry the difference forward GCMUtil.multiply(S_at, H_c); // Adjust the current hash GCMUtil.xor(S, S_at); } // Final gHASH byte[] X = new byte[BLOCK_SIZE]; Pack.longToBigEndian(atLength * 8, X, 0); Pack.longToBigEndian(totalLength * 8, X, 8); gHASHBlock(S, X); // T = MSBt(GCTRk(J0,S)) byte[] tag = new byte[BLOCK_SIZE]; cipher.processBlock(J0, 0, tag, 0); GCMUtil.xor(tag, S); int resultLen = extra; // We place into macBlock our calculated value for T this.macBlock = new byte[macSize]; System.arraycopy(tag, 0, macBlock, 0, macSize); if (forEncryption) { // Append T to the message System.arraycopy(macBlock, 0, out, outOff + bufOff, macSize); resultLen += macSize; } else { // Retrieve the T value from the message and compare to calculated one byte[] msgMac = new byte[macSize]; System.arraycopy(bufBlock, extra, msgMac, 0, macSize); if (!Arrays.constantTimeAreEqual(this.macBlock, msgMac)) { throw new InvalidCipherTextException("mac check in GCM failed"); } } reset(false); return resultLen; } public void reset() { reset(true); } private void reset( boolean clearMac) { cipher.reset(); // note: we do not reset the nonce. S = new byte[BLOCK_SIZE]; S_at = new byte[BLOCK_SIZE]; S_atPre = new byte[BLOCK_SIZE]; atBlock = new byte[BLOCK_SIZE]; atBlockPos = 0; atLength = 0; atLengthPre = 0; counter = Arrays.clone(J0); blocksRemaining = -2; bufOff = 0; totalLength = 0; if (bufBlock != null) { Arrays.fill(bufBlock, (byte)0); } if (clearMac) { macBlock = null; } if (forEncryption) { initialised = false; } else { if (initialAssociatedText != null) { processAADBytes(initialAssociatedText, 0, initialAssociatedText.length); } } } private void gCTRBlock(byte[] block, byte[] out, int outOff) { byte[] tmp = getNextCounterBlock(); GCMUtil.xor(tmp, block); System.arraycopy(tmp, 0, out, outOff, BLOCK_SIZE); gHASHBlock(S, forEncryption ? tmp : block); totalLength += BLOCK_SIZE; } private void gCTRPartial(byte[] buf, int off, int len, byte[] out, int outOff) { byte[] tmp = getNextCounterBlock(); GCMUtil.xor(tmp, buf, off, len); System.arraycopy(tmp, 0, out, outOff, len); gHASHPartial(S, forEncryption ? tmp : buf, 0, len); totalLength += len; } private void gHASH(byte[] Y, byte[] b, int len) { for (int pos = 0; pos < len; pos += BLOCK_SIZE) { int num = Math.min(len - pos, BLOCK_SIZE); gHASHPartial(Y, b, pos, num); } } private void gHASHBlock(byte[] Y, byte[] b) { GCMUtil.xor(Y, b); multiplier.multiplyH(Y); } private void gHASHPartial(byte[] Y, byte[] b, int off, int len) { GCMUtil.xor(Y, b, off, len); multiplier.multiplyH(Y); } private byte[] getNextCounterBlock() { if (blocksRemaining == 0) { throw new IllegalStateException("Attempt to process too many blocks"); } blocksRemaining--; int c = 1; c += counter[15] & 0xFF; counter[15] = (byte)c; c >>>= 8; c += counter[14] & 0xFF; counter[14] = (byte)c; c >>>= 8; c += counter[13] & 0xFF; counter[13] = (byte)c; c >>>= 8; c += counter[12] & 0xFF; counter[12] = (byte)c; byte[] tmp = new byte[BLOCK_SIZE]; // TODO Sure would be nice if ciphers could operate on int[] cipher.processBlock(counter, 0, tmp, 0); return tmp; } private void checkStatus() { if (!initialised) { if (forEncryption) { throw new IllegalStateException("GCM cipher cannot be reused for encryption"); } throw new IllegalStateException("GCM cipher needs to be initialised"); } } }
[ "997530783@qq.com" ]
997530783@qq.com
58ec4629cab87da24be210c40c1061a43ad41c90
cf6ddc694a5817b0ecec9cba99f8231776cc7f25
/src/main/java/com/example/task/mapper/TaskMapper.java
91ef84f3beba1a76d4f3366df7c4f75b3f5affd4
[]
no_license
zorikzaqaryan/task-management-2019
f85ab491ef3ddd72e9c821cd889de95ed82b70d2
1a9554cedd5b7a9f93d0a847aa7ad243c3c4b4f3
refs/heads/master
2020-05-30T17:55:54.731392
2019-06-03T14:33:18
2019-06-03T14:33:18
189,886,099
0
0
null
null
null
null
UTF-8
Java
false
false
993
java
package com.example.task.mapper; import com.example.task.model.TaskDto; import com.example.task.model.TaskUploadCmd; import com.example.task.repository.entity.Task; import org.mapstruct.Mapper; import org.mapstruct.Named; import org.mapstruct.factory.Mappers; import java.io.IOException; import java.util.List; @Mapper(componentModel = "spring") public interface TaskMapper { TaskMapper INSTANCE = Mappers.getMapper(TaskMapper.class); TaskDto taskToTaskDto(Task entity); Task taskDtoToTask(TaskDto dto); List<TaskDto> taskListToDtos(List<Task> entity); @Named("customTaskMapper") default TaskDto taskCmdToDto(TaskUploadCmd in) throws IOException { TaskDto out = new TaskDto(); out.setContent(in.getContent()); out.setEmail(in.getEmail()); if (in.getFile() != null) { out.setImage(in.getFile().getBytes()); } out.setId(in.getId()); out.setUsername(in.getUsername()); return out; } }
[ "zak.zorik20@gmail.com" ]
zak.zorik20@gmail.com
6a81cff0b2edf519b4b67715a1988361867acccc
a50ec59d09d66a6cea4f64b6db125fd10fa23896
/src/main/java/com/ice/bshop/dao/BaseDAO.java
3a7b169676f156d4b7d609711d33945a12364487
[]
no_license
BingShao001/bShop
502383df781e065532635c050785e03212e9074f
030675c65dca5dfcf125c014e36373a4da56d395
refs/heads/master
2022-07-19T07:47:37.352541
2021-06-24T08:29:26
2021-06-24T08:29:26
157,683,484
0
0
null
2022-06-21T00:52:24
2018-11-15T09:12:54
Java
UTF-8
Java
false
false
74
java
package com.ice.bshop.dao; public interface BaseDAO { void test(); }
[ "zhangbing@tuya.com" ]
zhangbing@tuya.com
3f50e6ac03aa9292e9f0e390c516e3133906df0e
a84b013cd995870071589cefe0ab060ff3105f35
/selenium-rc/branches/documenthierarchy/clients/java/src/test/java/com/thoughtworks/selenium/ApacheMyFacesSuggestTest.java
4b04ebf6310e462ece8df0abffe7ccb960fbc14b
[]
no_license
vdt/selenium
137bcad58b7184690b8785859d77da0cd9f745a0
30e5e122b068aadf31bcd010d00a58afd8075217
refs/heads/master
2020-12-27T21:35:06.461381
2009-08-18T15:56:32
2009-08-18T15:56:32
13,650,409
1
0
null
null
null
null
UTF-8
Java
false
false
3,653
java
package com.thoughtworks.selenium; import org.openqa.selenium.server.browser.BrowserType; import org.openqa.selenium.server.browser.launchers.WindowsUtils; /** * A test of the Apache MyFaces JSF AJAX auto-suggest sandbox application at www.irian.at. * * * @author danielf * */ public class ApacheMyFacesSuggestTest extends SeleneseTestCase { boolean isProxyInjectionMode; private static final String updateId = "ac4update"; private static final String inputId = "ac4"; public void setUp() throws Exception { isProxyInjectionMode = System.getProperty("selenium.proxyInjectionMode")!=null && System.getProperty("selenium.proxyInjectionMode").equals("true"); } private boolean shouldSkip() { String browserOverride = System.getProperty("selenium.forcedBrowserMode"); if (browserOverride == null) return false; String name = getName(); if (name == null) throw new NullPointerException("Test name is null!"); String browserName; if (name.endsWith("Firefox")) { browserName = "firefox"; } else if (name.endsWith("IExplore")) { browserName = "iexplore"; } else { throw new RuntimeException("Test name unexpected: " + getName()); } if (isProxyInjectionMode) { browserName = "*pi" + browserName; } else { browserName = "*" + browserName; } if (!browserName.equals(browserOverride)) { System.err.println("WARNING!!! Skipping " + getName()); return true; } return false; } public void testAJAXFirefox() throws Throwable { if (shouldSkip()) return; setUp("http://www.irian.at", "*firefox"); selenium.open("http://www.irian.at/selenium-server/tests/html/ajax/ajax_autocompleter2_test.html"); selenium.keyPress(inputId, "\\74"); Thread.sleep(500); selenium.keyPress(inputId, "\\97"); selenium.keyPress(inputId, "\\110"); new Wait() { public boolean until() { String text = selenium.getText(updateId); return "Jane Agnews".equals(text); } }.wait("Didn't find 'Jane Agnews' in updateId"); selenium.keyPress(inputId, "\\9"); new Wait() { public boolean until() { return "Jane Agnews".equals(selenium.getValue(inputId)); } }.wait("Didn't find 'Jane Agnews' in inputId"); } public void testAJAXIExplore() throws Throwable { if (!WindowsUtils.thisIsWindows()) return; if (shouldSkip()) return; setUp("http://www.irian.at", BrowserType.Browser.IEXPLORE.toString()); selenium.open("http://www.irian.at/selenium-server/tests/html/ajax/ajax_autocompleter2_test.html"); selenium.type(inputId, "J"); selenium.keyDown(inputId, "\\74"); Thread.sleep(500); selenium.type(inputId, "Jan"); selenium.keyDown(inputId, "\\110"); new Wait() { public boolean until() { return "Jane Agnews".equals(selenium.getText(updateId)); } }.wait("Didn't find 'Jane Agnews' in updateId"); selenium.keyDown(inputId, "\\13"); new Wait() { public boolean until() { return "Jane Agnews".equals(selenium.getValue(inputId)); } }.wait("Didn't find 'Jane Agnews' in inputId"); } }
[ "mpurland@07704840-8298-11de-bf8c-fd130f914ac9" ]
mpurland@07704840-8298-11de-bf8c-fd130f914ac9
8d3d09a4fa0e7cf869db9f21b33007ecde97cfb0
b40af6f83452f63bd6b0cef00b632153a28a4aa9
/app/src/main/java/comv/example/zyrmj/precious_time01/ViewModel/HabitViewModel.java
dd5ccac002abebe8ec390f746478a08e9002824b
[]
no_license
nku-debugers/precious_time_login
0bf9972e4aa5a6f819e4b90b3e00283dc1e28316
0649dfe1640b06699451ac584cbbcc6d5a0033e7
refs/heads/master
2020-07-28T17:54:53.907039
2020-03-01T06:14:17
2020-03-01T06:14:17
209,483,762
4
0
null
2020-03-01T06:14:18
2019-09-19T06:55:44
Java
UTF-8
Java
false
false
743
java
package comv.example.zyrmj.precious_time01.ViewModel; import android.app.Application; import java.util.List; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import comv.example.zyrmj.precious_time01.entity.Habit; import comv.example.zyrmj.precious_time01.repository.HabitRepository; public class HabitViewModel extends AndroidViewModel { private HabitRepository habitRepository; public HabitViewModel(@NonNull Application application) { super(application); this.habitRepository=new HabitRepository(application); } public LiveData<List<Habit>> getAllHabits(String userId) { return habitRepository.getAllHabits(userId); } }
[ "13516173041@163.com" ]
13516173041@163.com
4072b1f524621b4e80cf088fb0eb869320b94077
2e486eb44a578134128bef0d6cc493eb1695f261
/src/main/java/com/painting/web/entity/Article.java
fb671d53e58bc9f2be7d67c9a16818c8230073de
[]
no_license
cutesunny/web
877ab4efadf854ebd589138f5eefda34c33d8259
6015fb38e285fd6a1bfc8a6f183777ddfff198e2
refs/heads/master
2020-03-09T10:21:19.750854
2018-06-01T14:04:17
2018-06-01T14:04:17
128,735,097
0
0
null
null
null
null
UTF-8
Java
false
false
1,398
java
package com.painting.web.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity(name = "article") public class Article extends AbstractEntity{ public static final int RECENTLY_EXHIBITION = 1;//近期展会 public static final int GALLERY = 2;//画廊 public static final int ONLINE = 3;//在线展览 public static final int INDEX_DATA = 4;//首页数据 private String title; private String thumb; private String description; private String content; private Integer type; public String getThumb() { return thumb; } public void setThumb(String thumb) { this.thumb = thumb; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } }
[ "xx20510@163.com" ]
xx20510@163.com
7ead4dcf28f9373952ae2d5c73fd32c044c95bc6
495f0092afeac9c5d81afca53f18b66829d65021
/e-commerce-framework/src/main/java/com/ecommerce/framework/shiro/session/OnlineSessionDAO.java
69be1ef4a08b342580141503f3706af35d561199
[]
no_license
PayneYu/e-commerce
89bd5b8425e835f96093bd06abcc22fcc9b87388
bedabe0dfc8e727faf57c2448c2e7c1063ddfb08
refs/heads/master
2022-10-01T02:41:48.569898
2019-06-23T15:01:19
2019-06-23T15:01:19
191,366,674
1
0
null
2022-09-01T23:08:15
2019-06-11T12:25:29
JavaScript
UTF-8
Java
false
false
3,200
java
package com.ecommerce.framework.shiro.session; import java.io.Serializable; import java.util.Date; import org.apache.shiro.session.Session; import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import com.ecommerce.common.enums.OnlineStatus; import com.ecommerce.framework.manager.AsyncManager; import com.ecommerce.framework.manager.factory.AsyncFactory; import com.ecommerce.framework.shiro.service.SysShiroService; /** * 针对自定义的ShiroSession的db操作 * * @author huizhe yu */ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO { /** * 上次同步数据库的时间戳 */ private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP"; /** * 同步session到数据库的周期 单位为毫秒(默认1分钟) */ @Value("${shiro.session.dbSyncPeriod}") private int dbSyncPeriod; @Autowired private SysShiroService sysShiroService; public OnlineSessionDAO() { super(); } public OnlineSessionDAO(long expireTime) { super(); } /** * 根据会话ID获取会话 * * @param sessionId * 会话ID * @return ShiroSession */ @Override protected Session doReadSession(Serializable sessionId) { return sysShiroService.getSession(sessionId); } /** * 更新会话;如更新会话最后访问时间/停止会话/设置超时时间/设置移除属性等会调用 */ public void syncToDb(OnlineSession onlineSession) { Date lastSyncTimestamp = (Date)onlineSession.getAttribute(LAST_SYNC_DB_TIMESTAMP); if (lastSyncTimestamp != null) { boolean needSync = true; long deltaTime = onlineSession.getLastAccessTime().getTime() - lastSyncTimestamp.getTime(); if (deltaTime < dbSyncPeriod * 60 * 1000) { // 时间差不足 无需同步 needSync = false; } boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L; // session 数据变更了 同步 if (isGuest == false && onlineSession.isAttributeChanged()) { needSync = true; } if (needSync == false) { return; } } onlineSession.setAttribute(LAST_SYNC_DB_TIMESTAMP, onlineSession.getLastAccessTime()); // 更新完后 重置标识 if (onlineSession.isAttributeChanged()) { onlineSession.resetAttributeChanged(); } AsyncManager.me().execute(AsyncFactory.syncSessionToDb(onlineSession)); } /** * 当会话过期/停止(如用户退出时)属性等会调用 */ @Override protected void doDelete(Session session) { OnlineSession onlineSession = (OnlineSession)session; if (null == onlineSession) { return; } onlineSession.setStatus(OnlineStatus.off_line); sysShiroService.deleteSession(onlineSession); } }
[ "huizhe.yu@thermofisher.com" ]
huizhe.yu@thermofisher.com
92aa04f3c6054d75ce03773536e4e8b88429d448
119e44f0e767bf831b8006ceea6cbf2a02c5f6d6
/transactional/src/main/java/com/trans/actional/exception/MyException.java
6df16fc2e000b847032540efdbddc9a84974882b
[]
no_license
flower1521/flower
7fcab3c903f911109a07aff96788c045426ed5c8
8d3acc0430de66d08e4e2894e054a57df223f330
refs/heads/master
2022-05-22T05:53:47.743208
2020-07-06T07:41:53
2020-07-06T07:41:53
41,311,441
0
0
null
2022-03-31T19:10:48
2015-08-24T15:35:00
Java
UTF-8
Java
false
false
422
java
package com.trans.actional.exception; import lombok.Data; /** * create by lcl on 2020/6/17 15:47 */ @Data public class MyException extends RuntimeException { private long code; private String msg; public MyException(Long code, String msg){ super(msg); this.code = code; this.msg = msg; } public MyException(String msg){ super(msg); this.msg = msg; } }
[ "1029112105@qq.com" ]
1029112105@qq.com
c4383c179a01c6122b0438e6e6b3bae7944d2b1f
3fc95dc07b0fad7164596651c5ef194a1eeceff8
/HjSystem/src/main/java/com/sl/ue/entity/jl/vo/JlTtsVO.java
7f41d16619c0b3c7a579de0c25d39904b85c17d5
[]
no_license
li912583940/hjxt
2c44c667e88f71727ede051dd86955e93751b00a
551f9f1140ce00602c7f59530b3ac267ea1c85f7
refs/heads/master
2020-03-07T05:26:57.169822
2019-05-20T13:20:26
2019-05-20T13:20:26
127,296,158
0
2
null
null
null
null
UTF-8
Java
false
false
978
java
package com.sl.ue.entity.jl.vo; import com.sl.ue.entity.jl.JlTts; public class JlTtsVO extends JlTts{ /** 序列化 */ private static final long serialVersionUID = 1L; /*--------------------------- 处理关联表 -----------------------------*/ private String leftJoinField; // 关联表字段 private String leftJoinTable; // 关联表 private String leftJoinWhere; // 关联表条件 public String getLeftJoinField() { return leftJoinField; } public void setLeftJoinField(String leftJoinField) { this.leftJoinField = leftJoinField; } public String getLeftJoinTable() { return leftJoinTable; } public void setLeftJoinTable(String leftJoinTable) { this.leftJoinTable = leftJoinTable; } public String getLeftJoinWhere() { return leftJoinWhere; } public void setLeftJoinWhere(String leftJoinWhere) { this.leftJoinWhere = leftJoinWhere; } }
[ "912583940@qq.com" ]
912583940@qq.com
e7f1b661f6009802ab06329bb7e496e349013ee1
e2e19d11c60cde5ef4d05c5e26e2b46b0595cee9
/insertionsortlist.java
b4519b6ef2fd0bcaafcb08d2f42ff45039f02888
[]
no_license
Ramonywangziyao/Algo_DS_codes
07d2b68132086a510c9250f641b7492d3188f6df
b3c01a9b68c457bb2fb60e9567e0b9de1803ec64
refs/heads/master
2020-03-14T18:26:15.495791
2018-08-08T22:28:03
2018-08-08T22:28:03
131,741,089
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
class Solution { public ListNode insertionSortList(ListNode head) { ListNode dummy = new ListNode(0), temp = null, prev = null; dummy.next = head; while(head != null && head.next != null) { if(head.val <= head.next.val) { head = head.next; } else { temp = head.next; head.next = temp.next; prev = dummy; while(prev.next.val <= temp.val) prev = prev.next; temp.next = prev.next; prev.next = temp; } } return dummy.next; } }
[ "tonywangziyao@gmail.com" ]
tonywangziyao@gmail.com
4ca2bd4cf153c02fe244142b25f704ecf08ee23c
26262e8f00ce927074a1fb105f7981111ce29b19
/FinalExpress/src/com/express/adapter/MsgAdapter.java
9c6378d102c73ccba0e7bd6bbd88e8187ce7062e
[]
no_license
AhiGan/Android-App-Campus-Package-Agent-Platform
fa6fd87e9cdddda665a0322ea2a35dd5155b72a0
7b2e493a788d8f1cb78bc9114596bdf8875d7c52
refs/heads/master
2020-03-11T17:45:00.197060
2018-03-07T06:45:10
2018-03-07T06:45:10
130,156,131
1
0
null
2018-04-19T03:51:19
2018-04-19T03:51:18
null
GB18030
Java
false
false
4,291
java
package com.express.adapter; import java.util.ArrayList; import java.util.List; import com.example.finalexpress.R; import com.express.activity.LoginActivity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import entity.CMessage; import entity.MessageType; public class MsgAdapter extends BaseAdapter{ private LayoutInflater mInflater; private List<CMessage> msgs = new ArrayList<CMessage>();; private Context context; //private int resourceId; public MsgAdapter(Context context,List<CMessage> msg) { this.context = context; mInflater = LayoutInflater.from(this.context); this.msgs = msg; } public void addMessage(CMessage msg){ msgs.add(msg); notifyDataSetChanged(); } public void addMessages(List<CMessage> msgList){ msgs.addAll(msgList); notifyDataSetChanged(); } @Override public CMessage getItem(int position) { return msgs.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { CMessage msg = getItem(position); View view; ViewHolder viewHolder; if (convertView == null) { view = mInflater.inflate(R.layout.msg_item, null); viewHolder = new ViewHolder(view); view.setTag(viewHolder); } else { view = convertView; viewHolder = (ViewHolder) view.getTag(); } if (msg.getReceiver().getStudentid().equals(LoginActivity.getUser().getStudentid())) { // 如果是收到的消息,则显示左边的消息布局,将右边的消息布局隐藏 viewHolder.leftLayout.setVisibility(View.VISIBLE); viewHolder.rightLayout.setVisibility(View.GONE); byte[] temp = msg.getSender().getAvatar(); Bitmap bitmap = null; if(temp != null) { bitmap = BitmapFactory.decodeByteArray(temp, 0, temp.length); viewHolder.lefticon.setImageBitmap(bitmap); } else { viewHolder.lefticon.setBackgroundResource(R.drawable.default_avatar); } //viewHolder.leftMsg.setText( msg.getSender()+" to " +msg.getReceiver()+" time: "+msg.getTime()+" content: "+(String) msg.getObj()); viewHolder.leftMsg.setText((String) msg.getObj()); }else{ // 如果是发出的消息,则显示右边的消息布局,将左边的消息布局隐藏 viewHolder.rightLayout.setVisibility(View.VISIBLE); viewHolder.leftLayout.setVisibility(View.GONE); byte[] temp1 = msg.getSender().getAvatar(); Bitmap bitmap1 = null; if(temp1 != null) { bitmap1 = BitmapFactory.decodeByteArray(temp1, 0, temp1.length); viewHolder.righticon.setImageBitmap(bitmap1); } else { viewHolder.righticon.setBackgroundResource(R.drawable.default_avatar); } viewHolder.rightMsg.setText((String) msg.getObj()); //viewHolder.rightMsg.setText(viewHolder.setData(msg)); //viewHolder.rightMsg.setText(msg.getSender()+" from " +msg.getReceiver()+" time: "+msg.getTime()+" content: "+(String) msg.getObj()); } return view; } @Override public int getCount() { // TODO Auto-generated method stub return msgs.size(); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return 0; } class ViewHolder { RelativeLayout leftLayout; RelativeLayout rightLayout; TextView leftMsg; TextView rightMsg; ImageView lefticon; ImageView righticon; public ViewHolder(View view){ leftLayout = (RelativeLayout) view.findViewById(R.id.left_layout); rightLayout = (RelativeLayout) view.findViewById(R.id.right_layout); leftMsg = (TextView) view.findViewById(R.id.left_msg); rightMsg = (TextView) view.findViewById(R.id.right_msg); lefticon = (ImageView) view.findViewById(R.id.left_headicon); righticon = (ImageView) view.findViewById(R.id.right_headicon); } /* public CharSequence setData(CMessage msg) { // TODO Auto-generated method stub return null; }*/ } }
[ "yyuan@cs.duke.edu" ]
yyuan@cs.duke.edu
6fcc579c8bd8e3ec2ffd9455e885f8cf70e5687b
3856fc9a75ec77eac662027da02646dfa09c330b
/open-metadata-implementation/governance-servers/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/properties/VoidResponse.java
05cfab1b0320775e3ef21437ead0975d269a3e52
[ "Apache-2.0" ]
permissive
sethvi/egeria
8f3125f8b9bfa819d761e80e21445f65c5b4a116
9d67c7073730d8f88b9c9c03e979963ad2882937
refs/heads/master
2020-03-23T15:35:47.845371
2018-09-18T14:18:00
2018-09-18T14:18:00
141,760,300
0
0
Apache-2.0
2018-07-20T21:39:26
2018-07-20T21:39:26
null
UTF-8
Java
false
false
1,710
java
/* SPDX-License-Identifier: Apache-2.0 */ package org.odpi.openmetadata.adminservices.properties; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** * VoidResponse defines the response structure for the OMAG REST API calls that returns a * void as a response. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) public class VoidResponse extends OMAGAPIResponse { /** * Default constructor */ public VoidResponse() { super(); } /** * Copy/clone constructor * * @param template object to copy */ public VoidResponse(VoidResponse template) { super(template); } /** * Standard toString method. * * @return print out of variables in a JSON-style */ @Override public String toString() { return "VoidResponse{" + "relatedHTTPCode=" + relatedHTTPCode + ", exceptionClassName='" + exceptionClassName + '\'' + ", exceptionErrorMessage='" + exceptionErrorMessage + '\'' + ", exceptionSystemAction='" + exceptionSystemAction + '\'' + ", exceptionUserAction='" + exceptionUserAction + '\'' + ", exceptionProperties=" + exceptionProperties + '}'; } }
[ "mandy_chessell@uk.ibm.com" ]
mandy_chessell@uk.ibm.com
82669409a351e47bb918c92a041ef8cdd6061c91
115244b185356f4472a9b369813ed749710bb6a0
/jni_plugin/src/main/java/tech/yunjing/biconlife/jniplugin/im/voip/group/MeetingGroupActivity.java
fb0f2f0770bb9f3de7c7d5597c8cc276543fe3c7
[]
no_license
yinianzhijian0425/CitySelectTest
4edf1da483648b24d7a4f4da2716f58e8485e5d6
615b004ec61b8e0f43ebe4c9d71b68e107bf434e
refs/heads/master
2021-08-19T19:45:05.189973
2017-11-27T08:40:15
2017-11-27T08:40:15
112,169,856
0
0
null
null
null
null
UTF-8
Java
false
false
33,333
java
package tech.yunjing.biconlife.jniplugin.im.voip.group; import android.app.KeyguardManager; import android.content.Context; import android.content.Intent; import android.os.Message; import android.os.PowerManager; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.widget.Chronometer; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import java.util.ArrayList; import tech.yunjing.biconlife.jniplugin.R; import tech.yunjing.biconlife.jniplugin.im.bean.GroupMenberListdata; import tech.yunjing.biconlife.jniplugin.im.bean.IMObj; import tech.yunjing.biconlife.jniplugin.im.voip.AgoraManager; import tech.yunjing.biconlife.jniplugin.im.voip.HxTestKey; import tech.yunjing.biconlife.jniplugin.im.voip.IMNotifier; import tech.yunjing.biconlife.jniplugin.im.voip.frame.CenterHolder; import tech.yunjing.biconlife.jniplugin.im.voip.frame.CenterService; import tech.yunjing.biconlife.jniplugin.im.voip.frame.VoIPHelper; import tech.yunjing.biconlife.jniplugin.im.voip.frame.meeting.CenterMeetingController; import tech.yunjing.biconlife.jniplugin.im.voip.frame.meeting.CenterMeetingWindowInter; import tech.yunjing.biconlife.jniplugin.im.voip.server.MeetingGroupActivityServer; import tech.yunjing.biconlife.jniplugin.im.voip.util.PlayerTelephoneReceiver; import tech.yunjing.biconlife.jniplugin.im.voip.view.MeetingIncomeAddPic; import tech.yunjing.biconlife.jniplugin.im.voip.view.MeetingLayoutAddPic; import tech.yunjing.biconlife.jniplugin.util.UserInfoManageUtil; import tech.yunjing.biconlife.liblkclass.common.util.LKAppUtil; import tech.yunjing.biconlife.liblkclass.common.util.LKJsonUtil; import tech.yunjing.biconlife.liblkclass.common.util.LKLogUtil; import tech.yunjing.biconlife.liblkclass.common.util.LKPermissionUtil; import tech.yunjing.biconlife.liblkclass.common.util.LKToastUtil; import tech.yunjing.biconlife.liblkclass.global.LKApplication; import tech.yunjing.biconlife.liblkclass.global.config.LKImageOptions; import tech.yunjing.biconlife.liblkclass.lkbase.LK; import tech.yunjing.biconlife.liblkclass.lkbase.uibase.activity.LKBaseActivity; /** * 音视频群聊 * Created by Chen.qi on 2017/8/29 0029. */ public class MeetingGroupActivity extends LKBaseActivity implements CenterMeetingWindowInter, View.OnClickListener { /** * 最小化按钮 */ private ImageView iv_meeting_min; /** * 所有成员的总布局 */ private MeetingLayoutAddPic ll_meeting_allMember; /** * 接听方的显示头像邀请的总布局 */ private LinearLayout ll_meeting_head; /** * 接收人收到邀请,显示邀请人的头像 */ private ImageView iv_meeting_avatar; /** * 邀请人的昵称 */ private TextView tv_meeting_nickUser; /** * 邀请人的提示语(邀请你视频聊天) */ private TextView tv_meeting_callMsg; /** * 其他成员的总布局 */ private MeetingIncomeAddPic ll_meeting_otherImg; /** * 总时间 */ private Chronometer ct_meeting_timer; /** * 禁言、免提、摄像头转换总布局 */ private LinearLayout ll_meeting_optionAll; /** * 禁言整个大布局 */ private RelativeLayout rl_meeting_mute; /** * 禁言图标 */ private ImageView iv_meeting_mute; /** * 免提整个大布局 */ private RelativeLayout rl_meeting_mt; /** * 免提的图标按钮 */ private ImageView iv_meeting_mt; /** * 摄像头转换 */ private RelativeLayout rl_meeting_camera; /** * 打开或者关闭摄像头 */ private TextView tv_meeting_openOrCloseCream; /** * 摄像头的图标按钮 */ private ImageView iv_meeting_camera; /** * 所有人都拥有额挂断按钮(接听以后显示,发起方拨打后就显示) */ private ImageView iv_meeting_outEnd; /** * 接受方来电的总布局 */ private LinearLayout ll_meeting_income; /** * 接听方的挂断按钮 */ private ImageView iv_meeting_incomeEnd; /** * 接听方的接听按钮 */ private ImageView iv_meeting_incomeAccept; /** * 锁屏,屏幕相关所用 */ private PowerManager.WakeLock mWakeLock; private KeyguardManager.KeyguardLock mKeyguardLock = null; protected KeyguardManager mKeyguardManager; /** * 中央控制器 */ protected CenterMeetingController mController; @Override protected void initView() { setContentView(R.layout.activity_social_meeting); initAllView(); } /** * 初始化View控件 */ private void initAllView() { ll_meeting_allMember = (MeetingLayoutAddPic) findViewById(R.id.ll_meeting_allMember); iv_meeting_min = (ImageView) findViewById(R.id.iv_meeting_min); ll_meeting_head = (LinearLayout) findViewById(R.id.ll_meeting_head); iv_meeting_avatar = (ImageView) findViewById(R.id.iv_meeting_avatar); tv_meeting_nickUser = (TextView) findViewById(R.id.tv_meeting_nickUser); tv_meeting_callMsg = (TextView) findViewById(R.id.tv_meeting_callMsg); ll_meeting_otherImg = (MeetingIncomeAddPic) findViewById(R.id.ll_meeting_otherImg); ct_meeting_timer = (Chronometer) findViewById(R.id.ct_meeting_timer); ll_meeting_optionAll = (LinearLayout) findViewById(R.id.ll_meeting_optionAll); rl_meeting_mute = (RelativeLayout) findViewById(R.id.rl_meeting_mute); iv_meeting_mute = (ImageView) findViewById(R.id.iv_meeting_mute); rl_meeting_mt = (RelativeLayout) findViewById(R.id.rl_meeting_mt); iv_meeting_mt = (ImageView) findViewById(R.id.iv_meeting_mt); rl_meeting_camera = (RelativeLayout) findViewById(R.id.rl_meeting_camera); tv_meeting_openOrCloseCream = (TextView) findViewById(R.id.tv_meeting_openOrCloseCream); iv_meeting_camera = (ImageView) findViewById(R.id.iv_meeting_camera); iv_meeting_outEnd = (ImageView) findViewById(R.id.iv_meeting_outEnd); ll_meeting_income = (LinearLayout) findViewById(R.id.ll_meeting_income); iv_meeting_incomeEnd = (ImageView) findViewById(R.id.iv_meeting_incomeEnd); iv_meeting_incomeAccept = (ImageView) findViewById(R.id.iv_meeting_incomeAccept); } @Override protected void initData() { mController = CenterHolder.getInstance().getMeetingController(); if (mController == null) { this.finish(); return; } initManagers();//初始化manager们 mController.addChangeDataListener(this); } @Override protected void initViewEvent() { initAllEvent(); initViewCall();//根据来还是去,控制view们 if (mController.mIsOutCall) { mHandler.sendEmptyMessage(7150); } else { mHandler.sendEmptyMessage(7151); } } /** * 来电还是呼出电话 */ private void initViewCall() { if (mController.isFirstOpenActivity) { AgoraManager.getInstance().setMuteVideo(true); CenterMeetingController.MeetingCallState callLayout = mController.mIsOutCall ? CenterMeetingController.MeetingCallState.OUTGOING : CenterMeetingController.MeetingCallState.INCOMING; if (mController.mMeetCallState == null) { //没有初始化过,才进行初始化赋值。 boolean isPermission = LKPermissionUtil.getInstance().requestMorePermission(MeetingGroupActivity.this); setCallState(callLayout); } } mController.isFirstOpenActivity = false; } /** * 根据来、去电,振铃等,做一些操作 * * @param callDirect */ protected void setCallState(CenterMeetingController.MeetingCallState callDirect) { mController.mMeetCallState = callDirect; iv_meeting_mute.setSelected(mController.isVoiceMute); iv_meeting_mt.setSelected(mController.isVoiceMt); if (callDirect == CenterMeetingController.MeetingCallState.INCOMING) {//来电 PlayerTelephoneReceiver.getInstance().startMp3(this, "phonering.mp3", false); ll_meeting_allMember.setVisibility(View.GONE); iv_meeting_min.setVisibility(View.GONE); ll_meeting_head.setVisibility(View.VISIBLE); ll_meeting_income.setVisibility(View.VISIBLE); iv_meeting_outEnd.setVisibility(View.GONE); ct_meeting_timer.setVisibility(View.GONE); ll_meeting_optionAll.setVisibility(View.INVISIBLE); } else if (callDirect == CenterMeetingController.MeetingCallState.OUTGOING) { PlayerTelephoneReceiver.getInstance().startMp3(this, "phonering.mp3", true); iv_meeting_min.setVisibility(View.GONE); ll_meeting_allMember.setVisibility(View.VISIBLE); ll_meeting_head.setVisibility(View.INVISIBLE); ll_meeting_otherImg.setVisibility(View.GONE); ct_meeting_timer.setVisibility(View.VISIBLE); ll_meeting_optionAll.setVisibility(View.VISIBLE); iv_meeting_outEnd.setVisibility(View.VISIBLE); ll_meeting_income.setVisibility(View.GONE); } else if (callDirect == CenterMeetingController.MeetingCallState.INCALL) { iv_meeting_min.setVisibility(View.VISIBLE); ll_meeting_allMember.setVisibility(View.VISIBLE); ll_meeting_head.setVisibility(View.GONE); ct_meeting_timer.setVisibility(View.VISIBLE); ll_meeting_optionAll.setVisibility(View.VISIBLE); iv_meeting_outEnd.setVisibility(View.VISIBLE); ll_meeting_income.setVisibility(View.GONE); mHandler.sendEmptyMessage(7150); } } /** * 初始化控件点击事件 */ private void initAllEvent() { iv_meeting_min.setOnClickListener(this); iv_meeting_mute.setOnClickListener(this); iv_meeting_mt.setOnClickListener(this); iv_meeting_camera.setOnClickListener(this); iv_meeting_outEnd.setOnClickListener(this); iv_meeting_incomeAccept.setOnClickListener(this); iv_meeting_incomeEnd.setOnClickListener(this); } /** * 初始化需要的serviceManager 们 * 屏幕亮屏相关 */ private void initManagers() { mWakeLock = ((PowerManager) this.getSystemService(Context.POWER_SERVICE)).newWakeLock( PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "CALL_ACTIVITY#" + super.getClass().getName()); mKeyguardManager = ((KeyguardManager) this.getSystemService(Context.KEYGUARD_SERVICE)); } @Override public void finish() { mHandler.postDelayed(OnCallFinish, 500); } /** * 延时关闭界面 */ final Runnable OnCallFinish = new Runnable() { @Override public void run() { CenterService service = CenterHolder.getInstance().getService(); if (service != null) { service.stopServiceAndClear(); } MeetingGroupActivity.super.finish(); } }; /** * 唤醒屏幕资源 */ protected void wakeUpScreenMode() { if (!(mWakeLock.isHeld())) { mWakeLock.setReferenceCounted(false); mWakeLock.acquire(); } mKeyguardLock = this.mKeyguardManager.newKeyguardLock(""); mKeyguardLock.disableKeyguard(); } @Override public void onResume() { super.onResume(); if (!VoIPHelper.serviceIsRunning(this)) { super.finish(); return; } setCallState(mController.mMeetCallState); wakeUpScreenMode(); //唤醒屏幕 IMNotifier.getInstance(LKApplication.getContext()).cancelCCPNotification(IMNotifier.CCP_NOTIFICATOIN_ID_CALLING); if (mController != null) { mController.hideSmallWindow(); } } @Override protected void onStart() { super.onStart(); if (mController != null) { mController.hideSmallWindow(); } } @Override protected void onStop() { super.onStop(); if (mController != null && !ll_meeting_allMember.addOtherMember) { //打开内部界面,不显示小窗口 mController.showSmallWindow(); } PlayerTelephoneReceiver.getInstance().stop(); } @Override public void onPause() { super.onPause(); releaseWakeLock(); } @Override protected void onDestroy() { super.onDestroy(); mController.removeChangeDataListener(this); } /** * 开启锁屏,停止屏幕常亮 */ private void releaseWakeLock() { try { if (this.mWakeLock.isHeld()) { if (this.mKeyguardLock != null) { this.mKeyguardLock.reenableKeyguard(); this.mKeyguardLock = null; } this.mWakeLock.release(); } return; } catch (Exception e) { } finally { try { this.mWakeLock.release(); } catch (Exception e) { e.printStackTrace(); } } } @Override public void onTimerTick(String time) { this.ct_meeting_timer.setText(time); } @Override public void onServiceDestroy() { super.finish(); } /** * 有人接通 * <p> * 注:由于与ios规定的字段是mobile 所有音视频先关判断全部都是mobile获取发送方手机号 * * @param callImObj */ @Override public void onCallAnswered(IMObj callImObj) { LKLogUtil.e("result==" + "有人接通了" + callImObj.toString()); if (mController.mIsOutCall) { PlayerTelephoneReceiver.getInstance().stop(); mController.mMeetCallState = CenterMeetingController.MeetingCallState.INCALL; } for (int i = 0; i < mController.allMembers.size(); i++) { if (callImObj.fromMobile.equals(mController.allMembers.get(i).mobile)) { mController.allMembers.get(i).isAccept = true; break; } } String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7103); } /** * 接听后挂断电话 * <p> * 注:由于与ios规定的字段是mobile 所有音视频先关判断全部都是mobile获取发送方手机号 * * @param callImObj */ @Override public void onCallReleased(IMObj callImObj) { LKLogUtil.e("result==" + "有人接听后挂断" + callImObj.toString()); Intent intent = new Intent(); intent.setAction(HxTestKey.JOIN_REFUSE_OR_CANCEL); intent.putExtra(HxTestKey.JOIN_CANCEL_IMOBJ, callImObj); sendBroadcast(intent); for (int i = 0; i < mController.allMembers.size(); i++) { if (callImObj.fromMobile.equals(mController.allMembers.get(i).mobile)) { mController.allMembers.remove(i); break; } } String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7102); } /** * 有人拒绝 * <p> * 注:由于与ios规定的字段是mobile 所有音视频先关判断全部都是mobile获取发送方手机号 * * @param callImObj */ @Override public void onRefuseToAnswer(IMObj callImObj) { LKLogUtil.e("result==" + "有人拒绝" + callImObj.toString()); LKLogUtil.e("result有人拒绝数量==" + mController.allMembers.size()); Intent intent = new Intent(); intent.setAction(HxTestKey.JOIN_REFUSE_OR_CANCEL); intent.putExtra(HxTestKey.JOIN_CANCEL_IMOBJ, callImObj); sendBroadcast(intent); for (int i = 0; i < mController.allMembers.size(); i++) { if (callImObj.fromMobile.equals(mController.allMembers.get(i).mobile)) { mController.allMembers.remove(i); break; } } String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7102); LKLogUtil.e("result有人拒绝数量删除以后的--------------==" + mController.allMembers.size()); } /** * 销毁整个会话 * * @param callImObj */ @Override public void onCreatorCancel(IMObj callImObj) { LKLogUtil.e("onCreatorCancelonCreatorCanceloooooooooooooooooooo==" + "销毁房间的回调,收到此回到表示需要销毁整个房间"); LKToastUtil.showToastLong("通话结束"); if (mController != null) { mController.stopTimer(); } PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); sendBroadcast(new Intent(HxTestKey.DESTORY_MEETING_ROOMS)); } /** * 销毁整个房间 * * @param imObjDes */ @Override public void onDestoryRoom(IMObj imObjDes) { LKLogUtil.e("onDestoryRoom-----------==" + "销毁房间的回调,收到此回到表示需要销毁整个房间"); LKToastUtil.showToastLong("通话结束"); if (mController != null) { mController.stopTimer(); } PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); sendBroadcast(new Intent(HxTestKey.DESTORY_MEETING_ROOMS)); } @Override public void onLeaveChannelSuccess() { LKLogUtil.e("result==" + "其他人员已离线,通话结束"); } /** * 有新成员加入 * * @param imObj */ @Override public void onJoinNewMembers(IMObj imObj) { ArrayList<GroupMenberListdata> joinListdata = LKJsonUtil.jsonToArrayList(imObj.members, GroupMenberListdata.class); LKLogUtil.e("result==新家的与会人员" + joinListdata.size()); if (joinListdata != null && joinListdata.size() > 0) { mController.allMembers.addAll(joinListdata); } //新加的与会人员进行去重,因为最小化的回调中也重复加入了 for (int i = 0; i < mController.allMembers.size() - 1; i++) { for (int j = i + 1; j < mController.allMembers.size(); j++) { if (mController.allMembers.get(i).mobile.equals(mController.allMembers.get(j).mobile)) { mController.allMembers.remove(j); j--; } } } String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7106); } /** * 加入频道成功 * * @param channel * @param uid */ @Override public void onJoinChannelSuccess(String channel, int uid) { LKLogUtil.e("result==" + "我自己加入频道成功"); if (mController != null) { MeetingGroupActivityServer.getInstance().joinChannelSuccess(mController); } mHandler.sendEmptyMessage(7100); } @Override protected void dataUpdating(Message msg) { super.dataUpdating(msg); switch (msg.what) { //关闭页面退出频道 case 11: mController.mMeetCallState = CenterMeetingController.MeetingCallState.END; if (mController != null && mController.isCremaSwitch) { mController.isCremaSwitch = false; AgoraManager.getInstance().onSwitchCamera(); } PlayerTelephoneReceiver.getInstance().stop(); AgoraManager.getInstance().leaveChannel(); finish(); break; //进入页面显示头像数据 case 7100://自己接听 mController.startTimer(); iv_meeting_min.setVisibility(View.VISIBLE); setCallState(mController.mMeetCallState); for (int i = 0; i < mController.allMembers.size(); i++) { if (UserInfoManageUtil.getUserInfo().getPhone().equals(mController.allMembers.get(i).mobile)) { mController.allMembers.get(i).isAccept = true; break; } } ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); break; //有人拒绝或者接听后挂断 case 7102: //接收方显示 ll_meeting_otherImg.clearnMeetingIncomeMemberViews(); ll_meeting_otherImg.addMeetingIncomeMemberView(mController); ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); if (mController.allMembers.size() <= 1) { mController.stopTimer(); mHandler.sendEmptyMessageDelayed(11, 2000); LKToastUtil.showToastShort("聊天结束"); } break; //有人接通 case 7103: if (mController.mIsOutCall) { mController.startTimer(); } if (mController.imObj.creatorMobile.equals(UserInfoManageUtil.getUserInfo().getPhone())) { iv_meeting_min.setVisibility(View.VISIBLE); } ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); break; //创建者取消 case 7105: ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); if (mController.allMembers.size() < 2) { mController.stopTimer(); mHandler.sendEmptyMessageDelayed(11, 2000); LKToastUtil.showToastShort("群聊人数少于2人,将结束群聊视频通话"); } break; //加入新人以后 case 7106: LKLogUtil.e("result==" + "显示的总数" + mController.allMembers.size()); if (ll_meeting_allMember.getVisibility() != View.VISIBLE) { //其他人员显示 ll_meeting_otherImg.clearnMeetingIncomeMemberViews(); ll_meeting_otherImg.addMeetingIncomeMemberView(mController); } else { //顶部显示所有与会人员 ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); } break; //自己点击了摄像头的开关 //打开关闭摄像头逻辑 //发起方进入 //接通电话后,最小化后再次进入 //刷新成员列表数据 case 7150: if (!ll_meeting_allMember.addOtherMember) { iv_meeting_min.setVisibility(View.VISIBLE); } ll_meeting_allMember.clearnMeetingMemberViews(); ll_meeting_allMember.addmeetingMemberView(mController.allMembers, this, mController); break; //接收方收到来电 case 7151: ll_meeting_otherImg.clearnMeetingIncomeMemberViews(); LK.image().bind(iv_meeting_avatar, mController.imObj.fromAvatar, LKImageOptions.getFITXYOptions(R.mipmap.icon_choose_group_default, 8)); tv_meeting_nickUser.setText(mController.imObj.fromNick); ll_meeting_otherImg.addMeetingIncomeMemberView(mController); break; default: break; } } /** * 用户离线 * * @param uid * @param reason */ @Override public void onUserOffline(int uid, int reason) { LKLogUtil.e("result==" + "聊天室有其他人员离线了==" + reason + "----uid----" + uid); String UID = uid + ""; for (int i = 0; i < mController.allMembers.size(); i++) { if (UID.equals(mController.allMembers.get(i).UID)) { mController.allMembers.remove(i); break; } } String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7102); } /** * 打开关闭远端视频的回调 * * @param uid * @param enabled */ @Override public void onUserMuteVideo(int uid, boolean enabled) { LKLogUtil.e("result==" + "打开关闭远端视频的回调 " + uid + "----------" + enabled); for (int i = 0; i < mController.allMembers.size(); i++) { String uidSelf = mController.allMembers.get(i).UID.trim(); if (LKAppUtil.getInstance().isIntegerNum(uidSelf)) { int newUid = Integer.parseInt(uidSelf); if (newUid == uid) { mController.allMembers.get(i).isAccept = true; mController.allMembers.get(i).isMuteVideo = !enabled; break; } } } mHandler.sendEmptyMessage(7150); } /** * 超时未接听 */ @Override public void timeOutNoAnswer() { if (mController.mMeetCallState == CenterMeetingController.MeetingCallState.OUTGOING) { //发起方,没有任何一个人接听 //????????未写完逻辑 //挂断逻辑 int isAcceptCount = 0; for (int i = 0; i < mController.allMembers.size(); i++) { if (mController.allMembers.get(i).isAccept) { isAcceptCount++; } } if (isAcceptCount <= 1) { if (mController != null) { MeetingGroupActivityServer.getInstance().cancelAndEnd(mController, this); } LKToastUtil.showToastLong("无人接听,聊天结束"); PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); } } else if (mController.mMeetCallState == CenterMeetingController.MeetingCallState.INCOMING) { //接收方接收到来电后,不接听45秒后自动管段 if (mController != null) { mController.stopTimer(); MeetingGroupActivityServer.getInstance().timeOutCancel(mController); } LKToastUtil.showToastLong("聊天已取消"); PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); } } /** * 返回键,缩小窗口等结束界面 */ public void dismissFinish() { showNotification(); MeetingGroupActivity.super.finish(); } protected void showNotification() { Intent intent = new Intent(LKApplication.getContext(), MeetingGroupActivity.class); IMNotifier.getInstance(LKApplication.getContext()).showCallingNotification(intent, "群聊通话中..."); } /** * 点击事件 * * @param v */ @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.iv_meeting_min) { //最小化 ll_meeting_allMember.addOtherMember = false; dismissFinish(); } else if (id == R.id.iv_meeting_mute) {//禁言 if (iv_meeting_mute.isSelected()) { mController.isVoiceMute = false; } else { mController.isVoiceMute = true; } iv_meeting_mute.setSelected(mController.isVoiceMute); AgoraManager.getInstance().onMuteclick(iv_meeting_mute.isSelected()); } else if (id == R.id.iv_meeting_mt) {//免提 if (iv_meeting_mt.isSelected()) { mController.isVoiceMt = false; } else { mController.isVoiceMt = true; } iv_meeting_mt.setSelected(mController.isVoiceMt); AgoraManager.getInstance().onSpeakerphone(iv_meeting_mt.isSelected()); } else if (id == R.id.iv_meeting_camera) {//摄像头打开或者关闭 if (iv_meeting_camera.isSelected()) { mController.isOpenOrCloseCrema = false; tv_meeting_openOrCloseCream.setText("摄像头"); } else { mController.isOpenOrCloseCrema = true; tv_meeting_openOrCloseCream.setText("关闭摄像头"); } iv_meeting_camera.setSelected(mController.isOpenOrCloseCrema); AgoraManager.getInstance().setMuteVideo(!mController.isOpenOrCloseCrema); mHandler.sendEmptyMessage(7150); } else if (id == R.id.iv_meeting_outEnd) {//挂断按钮 mController.stopTimer(); mController.mMeetCallState = CenterMeetingController.MeetingCallState.END; int isAcceptCount = 0; for (int i = 0; i < mController.allMembers.size(); i++) { if (mController.allMembers.get(i).isAccept) { isAcceptCount++; } } LKLogUtil.e("result==" + "看看整个销毁数量==" + isAcceptCount); if (isAcceptCount <= 2) { MeetingGroupActivityServer.getInstance().acceptAfterEnd(mController, this); } else { MeetingGroupActivityServer.getInstance().guaDuan(mController); } LKToastUtil.showToastLong("聊天已取消"); PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); } else if (id == R.id.iv_meeting_incomeAccept) {//来电接听按钮 mController.mMeetCallState = CenterMeetingController.MeetingCallState.INCALL; PlayerTelephoneReceiver.getInstance().stop(); //点击接通按钮,加入频道 //设置前置摄像头预览并开启 String uid = UserInfoManageUtil.getUserInfo().getPhone().substring(3, UserInfoManageUtil.getUserInfo().getPhone().length()); AgoraManager.getInstance() .setupLocalVideo(getApplicationContext()) .joinChannel(mController.imObj.roomNum, Integer.parseInt(uid)); } else if (id == R.id.iv_meeting_incomeEnd) {//来电挂断按钮 拒绝 mController.mMeetCallState = CenterMeetingController.MeetingCallState.RUFUSH; mController.stopTimer(); MeetingGroupActivityServer.getInstance().reJuctPhone(mController); if (mController.allMembers.size() <= 2) { //发送101消除整个会话 MeetingGroupActivityServer.getInstance().reJuceEndAll(mController); } LKToastUtil.showToastLong("聊天已取消"); PlayerTelephoneReceiver.getInstance().endMp3(MeetingGroupActivity.this, "playend.mp3", true); mHandler.sendEmptyMessageDelayed(11, 2000); } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { return true;//不执行父类点击事件 } return super.onKeyDown(keyCode, event);//继续执行父类其他点击事件 } /** * 邀请其他人员 * * @param requestCode * @param resultCode * @param data */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == 100 && data != null) { ArrayList<GroupMenberListdata> membersList = data.getParcelableArrayListExtra("resultMembers"); LKLogUtil.e("result返回的数据---==" + membersList.size()); mController.allMembers.addAll(membersList); String members = LKJsonUtil.arrayListToJsonString(mController.allMembers); mController.imObj.members = members; mHandler.sendEmptyMessage(7150); } } }
[ "dongxining@vv.cc" ]
dongxining@vv.cc
d13c6ef0e535af889dc8c6c735fb9bf71d9b8eab
358629d228cc402a3201fac5b63de2b7acd47dd0
/app/src/androidTest/java/com/soulsour/dicee/ExampleInstrumentedTest.java
568359bf1748b92ebbc502f8cd1cd917de76b403
[]
no_license
soulsour/Dicee
82f7cdd69aa6f2a02faf45f96e7b2131b5e9b0ea
2b2f7a0c05902dcc7e99d0636e1edf189dfc7e6e
refs/heads/master
2020-03-25T01:45:32.575686
2018-08-02T16:34:22
2018-08-02T16:34:22
143,254,912
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.soulsour.dicee; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.soulsour.dicee", appContext.getPackageName()); } }
[ "soulsour@me.com" ]
soulsour@me.com
07af1ce8a33a88262670063bf4be8c99cba6076e
7694b30c07e2aeb4947af01b37fc39d913217971
/src/main/java/permafrost/tundra/lang/BaseRuntimeException.java
6358951d414f1886038dd98b78e57eccf1784809
[ "MIT" ]
permissive
Permafrost/Tundra.java
5d450a7bdc3f619d0b292aa8d90cd17b07e0df35
61447bb1a3d72dbca61e4ef4b2d8fc2f17817817
refs/heads/master
2023-09-03T08:34:45.630349
2023-08-22T18:57:33
2023-08-22T18:57:33
33,476,420
13
5
null
null
null
null
UTF-8
Java
false
false
5,573
java
/* * The MIT License (MIT) * * Copyright (c) 2020 Lachlan Dowding * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package permafrost.tundra.lang; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Unchecked exception superclass inherited by all other Tundra checked exceptions. */ public class BaseRuntimeException extends RuntimeException implements ExceptionSuppression, Properties<String, Object> { /** * Constructs a new BaseRuntimeException. */ public BaseRuntimeException() { this((String)null); } /** * Constructs a new BaseRuntimeException with the given message. * * @param message A message describing why the BaseRuntimeException was thrown. */ public BaseRuntimeException(String message) { super(message); } /** * Constructs a new BaseRuntimeException with the given cause. * * @param cause The cause of this BaseRuntimeException. */ public BaseRuntimeException(Throwable cause) { this(null, cause); } /** * Constructs a new BaseRuntimeException with the given message and cause. * * @param message A message describing why the BaseRuntimeException was thrown. * @param cause Optional cause of this Exception. */ public BaseRuntimeException(String message, Throwable cause) { this(message, cause, (Iterable<? extends Throwable>)null); } /** * Constructs a new BaseRuntimeException. * * @param message A message describing why the BaseRuntimeException was thrown. * @param cause Optional cause of this Exception. * @param suppressed Optional list of suppressed exceptions. */ public BaseRuntimeException(String message, Throwable cause, Throwable... suppressed) { this(message, cause, suppressed == null ? null : Arrays.asList(suppressed)); } /** * Constructs a new BaseRuntimeException. * * @param message A message describing why the BaseRuntimeException was thrown. * @param cause Optional cause of this Exception. * @param suppressed Optional list of suppressed exceptions. */ public BaseRuntimeException(String message, Throwable cause, Iterable<? extends Throwable> suppressed) { super(ExceptionHelper.normalizeMessage(message, cause, suppressed)); if (cause != null) initCause(cause); suppress(suppressed); } /** * List of suppressed exceptions. */ private List<Throwable> suppressedExceptions = Collections.emptyList(); /** * Suppresses the given exception. * * @param exception The exception to suppress. */ private synchronized void suppress(Throwable exception) { if (exception == null || exception == this) return; if (suppressedExceptions.isEmpty()) { suppressedExceptions = new ArrayList<Throwable>(1); } suppressedExceptions.add(exception); } /** * Suppresses the given exceptions. * * @param exceptions The exceptions to suppress. */ @Override public synchronized void suppress(Iterable<? extends Throwable> exceptions) { if (exceptions != null) { for (Throwable exception : exceptions) { suppress(exception); } } } /** * Suppresses the given exceptions. * * @param exceptions The exceptions to suppress. */ @Override public synchronized void suppress(Throwable ...exceptions) { if (exceptions != null) { for (Throwable exception : exceptions) { suppress(exception); } } } /** * Returns the list of suppressed exceptions. * * @return the list of suppressed exceptions. */ @Override public synchronized Throwable[] suppressed() { return suppressedExceptions.toArray(new Throwable[0]); } /** * Returns the properties of this object. * * @return the properties of this object. */ @Override public Map<String, Object> getProperties() { Map<String, Object> properties = new LinkedHashMap<String, Object>(); properties.put("$exception?", "true"); properties.put("$exception.class", getClass().getName()); properties.put("$exception.message", getMessage()); return properties; } }
[ "lachlan@permafrost.space" ]
lachlan@permafrost.space
ddf9bd98387f8f46deb4e932e40bf99847e4caf0
6d3546258d329dfcb37a74403b4167be804a36c3
/src/main/java/top/lovelily/designpattern/template/JdbcTemplate.java
c3ebf578c5d2f06b1c973e3737da7c53371366e6
[]
no_license
XuHe1/Test
7de145f1bc5f313f9caad1e548aeef12209ba0c3
86f15614a5c30eeaec665d2fa0dc7402f72b7ba9
refs/heads/master
2023-08-18T23:31:14.243635
2023-08-15T06:37:18
2023-08-15T06:37:18
136,135,657
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package top.lovelily.designpattern.template; /** * Desc: template * Author: Xu He * created: 2022/3/18 9:57 */ public abstract class JdbcTemplate { // 父类定义操作(骨架) public final void save() { Session session = getSession(); session.open(); session.save(); session.close(); } // 子类定义具体实现 public abstract Session getSession(); }
[ "1090624761@qq.com" ]
1090624761@qq.com
a9133247d4f8755042174b20f0969f9747f5b7c8
5f14a75cb6b80e5c663daa6f7a36001c9c9b778c
/src/bu.java
ca029028954fba0ba43d878199e7f3124b1793f8
[]
no_license
MaTriXy/com.ubercab
37b6f6d3844e6a63dc4c94f8b6ba6bb4eb0118fb
ccd296d27e0ecf5ccb46147e8ec8fb70d2024b2c
refs/heads/master
2021-01-22T11:16:39.511861
2016-03-19T20:58:25
2016-03-19T20:58:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,045
java
public final class bu { public static final int action0 = 2131624072; public static final int action_bar = 2131624056; public static final int action_bar_activity_content = 2131623936; public static final int action_bar_container = 2131624055; public static final int action_bar_root = 2131624051; public static final int action_bar_spinner = 2131623937; public static final int action_bar_subtitle = 2131624025; public static final int action_bar_title = 2131624024; public static final int action_context_bar = 2131624057; public static final int action_divider = 2131624076; public static final int action_menu_divider = 2131623938; public static final int action_menu_presenter = 2131623939; public static final int action_mode_bar = 2131624053; public static final int action_mode_bar_stub = 2131624052; public static final int action_mode_close_button = 2131624026; public static final int activity_chooser_view_content = 2131624027; public static final int alertTitle = 2131624039; public static final int always = 2131623982; public static final int beginning = 2131623974; public static final int buttonPanel = 2131624034; public static final int cancel_action = 2131624073; public static final int checkbox = 2131624048; public static final int chronometer = 2131624079; public static final int collapseActionView = 2131623983; public static final int contentPanel = 2131624040; public static final int custom = 2131624046; public static final int customPanel = 2131624045; public static final int decor_content_parent = 2131624054; public static final int default_activity_button = 2131624030; public static final int disableHome = 2131623953; public static final int edit_query = 2131624058; public static final int end = 2131623975; public static final int end_padder = 2131624084; public static final int expand_activities_button = 2131624028; public static final int expanded_menu = 2131624047; public static final int home = 2131623941; public static final int homeAsUp = 2131623954; public static final int icon = 2131624032; public static final int ifRoom = 2131623984; public static final int image = 2131624029; public static final int info = 2131624083; public static final int line1 = 2131624077; public static final int line3 = 2131624081; public static final int listMode = 2131623950; public static final int list_item = 2131624031; public static final int media_actions = 2131624075; public static final int middle = 2131623976; public static final int multiply = 2131623961; public static final int never = 2131623985; public static final int none = 2131623955; public static final int normal = 2131623951; public static final int parentPanel = 2131624036; public static final int progress_circular = 2131623943; public static final int progress_horizontal = 2131623944; public static final int radio = 2131624050; public static final int screen = 2131623962; public static final int scrollIndicatorDown = 2131624044; public static final int scrollIndicatorUp = 2131624041; public static final int scrollView = 2131624042; public static final int search_badge = 2131624060; public static final int search_bar = 2131624059; public static final int search_button = 2131624061; public static final int search_close_btn = 2131624066; public static final int search_edit_frame = 2131624062; public static final int search_go_btn = 2131624068; public static final int search_mag_icon = 2131624063; public static final int search_plate = 2131624064; public static final int search_src_text = 2131624065; public static final int search_voice_btn = 2131624069; public static final int select_dialog_listview = 2131624070; public static final int shortcut = 2131624049; public static final int showCustom = 2131623956; public static final int showHome = 2131623957; public static final int showTitle = 2131623958; public static final int spacer = 2131624035; public static final int split_action_bar = 2131623945; public static final int src_atop = 2131623963; public static final int src_in = 2131623964; public static final int src_over = 2131623965; public static final int status_bar_latest_event_content = 2131624074; public static final int submit_area = 2131624067; public static final int tabMode = 2131623952; public static final int text = 2131624082; public static final int text2 = 2131624080; public static final int textSpacerNoButtons = 2131624043; public static final int time = 2131624078; public static final int title = 2131624033; public static final int title_template = 2131624038; public static final int topPanel = 2131624037; public static final int up = 2131623949; public static final int useLogo = 2131623959; public static final int withText = 2131623986; public static final int wrap_content = 2131623997; } /* Location: * Qualified Name: bu * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
d4b50e43f3786a2e65bfb0b8581eb3d0ddef9dac
a0489ebe0f5f5bfa2a1466770a420ce6736d31cf
/src/main/java/com/example/oxagile/sprynchan/H2demoApplication.java
f845fe687976b657dca33a9d03d4b7a5c0a6aa9b
[]
no_license
kirillspr/h2demo
dc4dfa307227c8617e9adddbc21ce4160efb2624
e3928017e907beb7c710f1eeb776384512797c57
refs/heads/master
2021-04-27T16:20:00.302764
2018-02-22T14:44:04
2018-02-22T14:44:04
122,487,653
1
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.example.oxagile.sprynchan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class H2demoApplication { public static void main(String[] args) { SpringApplication.run(H2demoApplication.class, args); } }
[ "kirill.sprinchan@oxagile.com" ]
kirill.sprinchan@oxagile.com
0a168d7e17a6f54e3ea717f669b6a1c4b6288e59
9089f83d59aa92827c994e8902f763735eb9672f
/model2-board/src/service/BoardDao.java
dd7df4ab5b45fc1dff0bd51a856b2aeb7d8352f0
[]
no_license
Jinnam/Jinnam
f8cf54218045b1fab4b257337f887728630a537c
c2cdfc7464f8ef79b45657a0c58e5462f3f898c2
refs/heads/master
2020-01-23T21:56:45.883363
2016-12-04T15:08:36
2016-12-04T15:08:36
74,727,053
0
0
null
null
null
null
UHC
Java
false
false
7,542
java
package service; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; public class BoardDao { private final String driverClassName = "com.mysql.jdbc.Driver"; private final String url = "jdbc:mysql://127.0.0.1:3306/dev22db?useUnicode=true&characterEncoding=euckr"; private final String username = "root"; private final String password = "java0000"; // 테이블 : board , 기능 : 데이터 수정 public int updateBoard(Board board) { int rowCount = 0; Connection connection = null; PreparedStatement statement = null; String sql = "UPDATE board SET board_title=?, board_content=? WHERE board_no=? AND board_pw=?"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); statement.setString(1,board.getBoardTitle()); statement.setString(2,board.getBoardContent()); statement.setInt(3,board.getBoardNo()); statement.setString(4,board.getBoardPw()); rowCount = statement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, null); } return rowCount; } // 테이블 : board , 기능 : 데이터 삭제 public int deleteBoard(Board board) { int rowCount = 0; Connection connection = null; PreparedStatement statement = null; String sql = "DELETE FROM board WHERE board_no=? AND board_pw=?"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); statement.setInt(1,board.getBoardNo()); statement.setString(2,board.getBoardPw()); rowCount = statement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, null); } return rowCount; } // 테이블 : board , 기능 : 하나의 데이터 가져오기 public Board selectBoardByKey(int boardNo) { Board board = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultset = null; String sql = "SELECT board_title, board_content, board_user, board_date FROM board WHERE board_no=?"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); statement.setInt(1, boardNo); resultset = statement.executeQuery(); if(resultset.next()) { board = new Board(); board.setBoardNo(boardNo); board.setBoardTitle(resultset.getString("board_title")); board.setBoardContent(resultset.getString("board_content")); board.setBoardUser(resultset.getString("board_user")); board.setBoardDate(resultset.getString("board_date")); } } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, resultset); } return board; } // 테이블 : board , 기능 : 한 페이지의 데이터 가져오기 public List<Board> selectBoardListPerPage(int beginRow, int pagePerRow) { List<Board> list = new ArrayList<Board>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultset = null; String sql = "SELECT board_no, board_title, board_user, board_date FROM board ORDER BY board_date DESC LIMIT ?, ?"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); statement.setInt(1, beginRow); statement.setInt(2, pagePerRow); resultset = statement.executeQuery(); while(resultset.next()) { Board board = new Board(); board.setBoardNo(resultset.getInt("board_no")); board.setBoardTitle(resultset.getString("board_title")); board.setBoardUser(resultset.getString("board_user")); board.setBoardDate(resultset.getString("board_date")); list.add(board); } } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, resultset); } return list; } // 테이블 : board , 기능 : 전체 로우 카운터 가져오기 public int selectTotalBoardCount() { int rowCount = 0; Connection connection = null; PreparedStatement statement = null; ResultSet resultset = null; String sql = "SELECT COUNT(*) FROM board"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); resultset = statement.executeQuery(); if(resultset.next()) { rowCount = resultset.getInt(1); } } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, resultset); } return rowCount; } // 테이블 : board , 기능 : 데이터 입력하기 public int insertBoard(Board board) { int rowCount = 0; Connection connection = null; PreparedStatement statement = null; String sql = "INSERT INTO board(board_pw, board_title, board_content, board_user, board_date) values(?,?,?,?,now())"; try { connection = this.getConnection(); statement = connection.prepareStatement(sql); statement.setString(1,board.getBoardPw()); statement.setString(2,board.getBoardTitle()); statement.setString(3,board.getBoardContent()); statement.setString(4,board.getBoardUser()); rowCount = statement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { this.close(connection, statement, null); } return rowCount; } private Connection getConnection() { Connection connection = null; try { Class.forName(this.driverClassName); connection = DriverManager.getConnection(this.url, this.username, this.password); } catch(Exception e) { e.printStackTrace(); } return connection; } private void close(Connection connection, Statement statement, ResultSet resultset) { if(resultset != null) { try { resultset.close(); } catch (SQLException e) { e.printStackTrace(); } } if(statement != null) { try { statement.close(); } catch (SQLException e) { e.printStackTrace(); } } if(connection != null) { try { connection.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
[ "Jinnam@DESKTOP-U96P9GV" ]
Jinnam@DESKTOP-U96P9GV
6d0abbc5867f23a34783a9b693c234d22b1e787d
30a2f29d29bdd670c382a5db66ede1a1c83df5ce
/src/main/java/encyclopediaofphilosophy/handlers/EncyclopediaOfPhilosophyQuoteIntentHandler.java
452f66f640dba3c4379e10416e3d582338c31edd
[]
no_license
karlnicholas/EncyclopediaOfPhilosophy
12588e473239ad57813346c2d4ac1507cc69899f
69c07068d978336f056858b1312e57a1d0917ce4
refs/heads/master
2020-04-06T04:52:55.550665
2018-10-31T18:49:17
2018-10-31T18:49:17
73,627,403
1
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
/* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying this file. This file 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 encyclopediaofphilosophy.handlers; import com.amazon.ask.dispatcher.request.handler.HandlerInput; import com.amazon.ask.dispatcher.request.handler.RequestHandler; import com.amazon.ask.model.Response; import iep.lucene.SearchResult; import quote.GetQuote; import java.io.IOException; import java.util.Optional; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.queryparser.classic.ParseException; import static com.amazon.ask.request.Predicates.intentName; public class EncyclopediaOfPhilosophyQuoteIntentHandler implements RequestHandler { private static final Logger logger = LogManager.getLogger(EncyclopediaOfPhilosophyQuoteIntentHandler.class); private GetQuote getQuote = new GetQuote(); @Override public boolean canHandle(HandlerInput input) { return input.matches(intentName("GetQuote")); } @Override public Optional<Response> handle(HandlerInput input) { String speechText; SearchResult searchResult = null ; try { searchResult = getQuote.getRandomQuote(); } catch (IOException | ParseException e) { logger.error(e); } if ( searchResult == null || searchResult.preamble.isEmpty()) { speechText = "There is a problem connecting to the Encyclopedia of Philosophy at this time." + "Please try again later."; logger.error("There is a problem connecting to the Encyclopedia of Philosophy at this time."); return input.getResponseBuilder() .withSpeech(speechText) .build(); } else { speechText = "Random entry for "+searchResult.subject+". " + searchResult.preamble; logger.info("Random entry for "+searchResult.subject + "=" + searchResult.url); } return input.getResponseBuilder() .withSpeech(speechText + "<p>You can ask for another quote or do a search.</p>") .withSimpleCard("Entry for " + searchResult.subject, "https://www.iep.utm.edu/" + searchResult.url + "\n" + speechText) .withReprompt("You can search for an entry, ask for a quote, or stop.") .withShouldEndSession(false) .build(); } }
[ "karl.nicholas@outlook.com" ]
karl.nicholas@outlook.com
f47a8b40e62740e20b97d79ed208d981ca7a3ecb
02db1343f5d5cbf365c4b00534dc4b40d6993571
/04.Semestr/00.Semestrovka(FakeInstagram)/src/main/java/ru/itis/javalab/FakeInstagram/repository/Implementations/SubscriptionsRepositoryImpl.java
d7032c63f9f31fe69332389840fc7f60becdeda4
[]
no_license
ttr843/JavaLab
2d3e80099a8cb7df436184f5f12d2b704a6ae42d
b54eadd2db0869cdffc43ed3e64703f9a55bdd82
refs/heads/master
2021-05-17T04:03:15.527146
2021-01-16T18:15:30
2021-01-16T18:15:30
250,612,163
0
0
null
2020-10-25T22:18:19
2020-03-27T18:21:13
Java
UTF-8
Java
false
false
2,272
java
package ru.itis.javalab.FakeInstagram.repository.Implementations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Repository; import ru.itis.javalab.FakeInstagram.model.Sub; import ru.itis.javalab.FakeInstagram.repository.interfaces.SubscriptionsRepository; import java.sql.PreparedStatement; import java.util.List; @Repository public class SubscriptionsRepositoryImpl implements SubscriptionsRepository { private static final String SQL_ADD_SUBSCRIBE = "INSERT INTO subs(idtowho,idwho) VALUES (?,?)"; private static final String SQL_FIND_BY_USER_ID = "SELECT * from subs where idwho = ?"; private static final String SQL_DELETE_SUB = "DELETE FROM subs where idwho = ? and idtowho = ?"; @Autowired private JdbcTemplate jdbcTemplate; private RowMapper<Sub> subRowMapper = (row, rowNumber) -> Sub.builder() .idWho(row.getLong("idwho")) .idToWho(row.getLong("idtowho")) .build(); @Override public void save(Sub entity) { } @Override public void subscribe(long idToWho, long idWho) { jdbcTemplate.update(connection -> { PreparedStatement preparedStatement = connection.prepareStatement(SQL_ADD_SUBSCRIBE); preparedStatement.setLong(1, idToWho); preparedStatement.setLong(2, idWho); return preparedStatement; }); } @Override public void deleteSub(long idToWho, long idWho) { jdbcTemplate.update(connection -> { PreparedStatement preparedStatement = connection.prepareStatement(SQL_DELETE_SUB); preparedStatement.setLong(1,idWho ); preparedStatement.setLong(2, idToWho); return preparedStatement; }); } @Override public List<Sub> findAllSubs(long id) { try { return jdbcTemplate.query(SQL_FIND_BY_USER_ID,new Object[]{id},subRowMapper); } catch (EmptyResultDataAccessException e) { throw new EmptyResultDataAccessException(0); } } }
[ "empty-15@mail.ru" ]
empty-15@mail.ru
a8196d08a868e0f3b69bdfdd3784889509701d51
1eee7ad73ef0fe57929c41384bd9b23139a9c45c
/java-base/src/main/java/com/enhao/learning/in/java/string/StringTokenizerTest.java
2f0dd42465d219e60f8f97c86a5aa0931c3bc805
[]
no_license
liangenhao/learning-in-java
03b409cd2baa2ffe97d0daa4092020134564b16b
59bc17cd902abcb18151ffdd529322f134e6fda3
refs/heads/master
2021-06-30T02:15:36.136248
2020-05-04T12:49:47
2020-05-04T12:49:47
176,668,109
4
0
null
2020-10-13T12:35:36
2019-03-20T06:20:51
Java
UTF-8
Java
false
false
600
java
package com.enhao.learning.in.java.string; import java.util.StringTokenizer; /** * StringTokenizer 是一个用来分割字符串的工具类 * 构造参数: * - str:需要分割的字符串 * - delim:分割符,默认\t\n\r\f, * - returnDelims: 是否返回分割符,默认false * * @author enhao * @see StringTokenizer */ public class StringTokenizerTest { public static void main(String[] args) { StringTokenizer st = new StringTokenizer("Hello World"); while (st.hasMoreTokens()) { System.out.println(st.nextToken()); } } }
[ "liangenhao@hotmail.com" ]
liangenhao@hotmail.com
f3de71ae271da225f4e0cc7171b1778543f9e17a
61c6164c22142c4369d525a0997b695875865e29
/middleware/src/main/java/com/spirit/compras/entity/CompraDetalleGastoData.java
31664bdd727f9a22e887e1784ee86aa9cb9a7c26
[]
no_license
xruiz81/spirit-creacional
e5a6398df65ac8afa42be65886b283007d190eae
382ee7b1a6f63924b8eb895d4781576627dbb3e5
refs/heads/master
2016-09-05T14:19:24.440871
2014-11-10T17:12:34
2014-11-10T17:12:34
26,328,756
1
0
null
null
null
null
UTF-8
Java
false
false
1,859
java
package com.spirit.compras.entity; import java.io.Serializable; import com.spirit.comun.util.ToStringer; /** * * @author www.versality.com.ec * */ public class CompraDetalleGastoData implements CompraDetalleGastoIf, Serializable { private java.lang.Long id; public java.lang.Long getId() { return id; } public void setId(java.lang.Long id) { this.id = id; } private java.lang.Long compraGastoId; public java.lang.Long getCompraGastoId() { return compraGastoId; } public void setCompraGastoId(java.lang.Long compraGastoId) { this.compraGastoId = compraGastoId; } private java.lang.Long compraDetalleId; public java.lang.Long getCompraDetalleId() { return compraDetalleId; } public void setCompraDetalleId(java.lang.Long compraDetalleId) { this.compraDetalleId = compraDetalleId; } private java.math.BigDecimal valor; public java.math.BigDecimal getValor() { return valor; } public void setValor(java.math.BigDecimal valor) { this.valor = valor; } public CompraDetalleGastoData() { } public CompraDetalleGastoData(com.spirit.compras.entity.CompraDetalleGastoIf value) { setId(value.getId()); setCompraGastoId(value.getCompraGastoId()); setCompraDetalleId(value.getCompraDetalleId()); setValor(value.getValor()); } public java.lang.Long getPrimaryKey() { return getId(); } public void setPrimaryKey(java.lang.Long pk) { setId(pk); } public String getPrimaryKeyParameters() { String parameters = ""; parameters += "&id=" + getId(); return parameters; } public String toString() { return ToStringer.toString((CompraDetalleGastoIf)this); } }
[ "xruiz@creacional.com" ]
xruiz@creacional.com
40bb4e743a0daa03edb3e6a0f63fd7fae679e4fb
1e212405cd1e48667657045ad91fb4dc05596559
/lib/openflowj-3.3.0-SNAPSHOT-sources (copy)/org/projectfloodlight/openflow/protocol/ver10/OFBsnBwEnableSetReplyVer10.java
f4528c97fe97881218999005e4f53958ec6773a1
[ "Apache-2.0" ]
permissive
aamorim/floodlight
60d4ef0b6d7fe68b8b4688f0aa610eb23dd790db
1b7d494117f3b6b9adbdbcf23e6cb3cc3c6187c9
refs/heads/master
2022-07-10T21:50:11.130010
2019-09-03T19:02:41
2019-09-03T19:02:41
203,223,614
1
0
Apache-2.0
2022-07-06T20:07:15
2019-08-19T18:00:01
Java
UTF-8
Java
false
false
13,042
java
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University // Copyright (c) 2011, 2012 Open Networking Foundation // Copyright (c) 2012, 2013 Big Switch Networks, Inc. // This library was generated by the LoxiGen Compiler. // See the file LICENSE.txt which should have been included in the source distribution // Automatically generated by LOXI from template of_class.java // Do not modify package org.projectfloodlight.openflow.protocol.ver10; import org.projectfloodlight.openflow.protocol.*; import org.projectfloodlight.openflow.protocol.action.*; import org.projectfloodlight.openflow.protocol.actionid.*; import org.projectfloodlight.openflow.protocol.bsntlv.*; import org.projectfloodlight.openflow.protocol.errormsg.*; import org.projectfloodlight.openflow.protocol.meterband.*; import org.projectfloodlight.openflow.protocol.instruction.*; import org.projectfloodlight.openflow.protocol.instructionid.*; import org.projectfloodlight.openflow.protocol.match.*; import org.projectfloodlight.openflow.protocol.stat.*; import org.projectfloodlight.openflow.protocol.oxm.*; import org.projectfloodlight.openflow.protocol.oxs.*; import org.projectfloodlight.openflow.protocol.queueprop.*; import org.projectfloodlight.openflow.types.*; import org.projectfloodlight.openflow.util.*; import org.projectfloodlight.openflow.exceptions.*; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.buffer.ByteBuf; import com.google.common.hash.PrimitiveSink; import com.google.common.hash.Funnel; class OFBsnBwEnableSetReplyVer10 implements OFBsnBwEnableSetReply { private static final Logger logger = LoggerFactory.getLogger(OFBsnBwEnableSetReplyVer10.class); // version: 1.0 final static byte WIRE_VERSION = 1; final static int LENGTH = 24; private final static long DEFAULT_XID = 0x0L; private final static long DEFAULT_ENABLE = 0x0L; private final static long DEFAULT_STATUS = 0x0L; // OF message fields private final long xid; private final long enable; private final long status; // // Immutable default instance final static OFBsnBwEnableSetReplyVer10 DEFAULT = new OFBsnBwEnableSetReplyVer10( DEFAULT_XID, DEFAULT_ENABLE, DEFAULT_STATUS ); // package private constructor - used by readers, builders, and factory OFBsnBwEnableSetReplyVer10(long xid, long enable, long status) { this.xid = xid; this.enable = enable; this.status = status; } // Accessors for OF message fields @Override public OFVersion getVersion() { return OFVersion.OF_10; } @Override public OFType getType() { return OFType.EXPERIMENTER; } @Override public long getXid() { return xid; } @Override public long getExperimenter() { return 0x5c16c7L; } @Override public long getSubtype() { return 0x17L; } @Override public long getEnable() { return enable; } @Override public long getStatus() { return status; } public OFBsnBwEnableSetReply.Builder createBuilder() { return new BuilderWithParent(this); } static class BuilderWithParent implements OFBsnBwEnableSetReply.Builder { final OFBsnBwEnableSetReplyVer10 parentMessage; // OF message fields private boolean xidSet; private long xid; private boolean enableSet; private long enable; private boolean statusSet; private long status; BuilderWithParent(OFBsnBwEnableSetReplyVer10 parentMessage) { this.parentMessage = parentMessage; } @Override public OFVersion getVersion() { return OFVersion.OF_10; } @Override public OFType getType() { return OFType.EXPERIMENTER; } @Override public long getXid() { return xid; } @Override public OFBsnBwEnableSetReply.Builder setXid(long xid) { this.xid = xid; this.xidSet = true; return this; } @Override public long getExperimenter() { return 0x5c16c7L; } @Override public long getSubtype() { return 0x17L; } @Override public long getEnable() { return enable; } @Override public OFBsnBwEnableSetReply.Builder setEnable(long enable) { this.enable = enable; this.enableSet = true; return this; } @Override public long getStatus() { return status; } @Override public OFBsnBwEnableSetReply.Builder setStatus(long status) { this.status = status; this.statusSet = true; return this; } @Override public OFBsnBwEnableSetReply build() { long xid = this.xidSet ? this.xid : parentMessage.xid; long enable = this.enableSet ? this.enable : parentMessage.enable; long status = this.statusSet ? this.status : parentMessage.status; // return new OFBsnBwEnableSetReplyVer10( xid, enable, status ); } } static class Builder implements OFBsnBwEnableSetReply.Builder { // OF message fields private boolean xidSet; private long xid; private boolean enableSet; private long enable; private boolean statusSet; private long status; @Override public OFVersion getVersion() { return OFVersion.OF_10; } @Override public OFType getType() { return OFType.EXPERIMENTER; } @Override public long getXid() { return xid; } @Override public OFBsnBwEnableSetReply.Builder setXid(long xid) { this.xid = xid; this.xidSet = true; return this; } @Override public long getExperimenter() { return 0x5c16c7L; } @Override public long getSubtype() { return 0x17L; } @Override public long getEnable() { return enable; } @Override public OFBsnBwEnableSetReply.Builder setEnable(long enable) { this.enable = enable; this.enableSet = true; return this; } @Override public long getStatus() { return status; } @Override public OFBsnBwEnableSetReply.Builder setStatus(long status) { this.status = status; this.statusSet = true; return this; } // @Override public OFBsnBwEnableSetReply build() { long xid = this.xidSet ? this.xid : DEFAULT_XID; long enable = this.enableSet ? this.enable : DEFAULT_ENABLE; long status = this.statusSet ? this.status : DEFAULT_STATUS; return new OFBsnBwEnableSetReplyVer10( xid, enable, status ); } } final static Reader READER = new Reader(); static class Reader implements OFMessageReader<OFBsnBwEnableSetReply> { @Override public OFBsnBwEnableSetReply readFrom(ByteBuf bb) throws OFParseError { int start = bb.readerIndex(); // fixed value property version == 1 byte version = bb.readByte(); if(version != (byte) 0x1) throw new OFParseError("Wrong version: Expected=OFVersion.OF_10(1), got="+version); // fixed value property type == 4 byte type = bb.readByte(); if(type != (byte) 0x4) throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got="+type); int length = U16.f(bb.readShort()); if(length != 24) throw new OFParseError("Wrong length: Expected=24(24), got="+length); if(bb.readableBytes() + (bb.readerIndex() - start) < length) { // Buffer does not have all data yet bb.readerIndex(start); return null; } if(logger.isTraceEnabled()) logger.trace("readFrom - length={}", length); long xid = U32.f(bb.readInt()); // fixed value property experimenter == 0x5c16c7L int experimenter = bb.readInt(); if(experimenter != 0x5c16c7) throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter); // fixed value property subtype == 0x17L int subtype = bb.readInt(); if(subtype != 0x17) throw new OFParseError("Wrong subtype: Expected=0x17L(0x17L), got="+subtype); long enable = U32.f(bb.readInt()); long status = U32.f(bb.readInt()); OFBsnBwEnableSetReplyVer10 bsnBwEnableSetReplyVer10 = new OFBsnBwEnableSetReplyVer10( xid, enable, status ); if(logger.isTraceEnabled()) logger.trace("readFrom - read={}", bsnBwEnableSetReplyVer10); return bsnBwEnableSetReplyVer10; } } public void putTo(PrimitiveSink sink) { FUNNEL.funnel(this, sink); } final static OFBsnBwEnableSetReplyVer10Funnel FUNNEL = new OFBsnBwEnableSetReplyVer10Funnel(); static class OFBsnBwEnableSetReplyVer10Funnel implements Funnel<OFBsnBwEnableSetReplyVer10> { private static final long serialVersionUID = 1L; @Override public void funnel(OFBsnBwEnableSetReplyVer10 message, PrimitiveSink sink) { // fixed value property version = 1 sink.putByte((byte) 0x1); // fixed value property type = 4 sink.putByte((byte) 0x4); // fixed value property length = 24 sink.putShort((short) 0x18); sink.putLong(message.xid); // fixed value property experimenter = 0x5c16c7L sink.putInt(0x5c16c7); // fixed value property subtype = 0x17L sink.putInt(0x17); sink.putLong(message.enable); sink.putLong(message.status); } } public void writeTo(ByteBuf bb) { WRITER.write(bb, this); } final static Writer WRITER = new Writer(); static class Writer implements OFMessageWriter<OFBsnBwEnableSetReplyVer10> { @Override public void write(ByteBuf bb, OFBsnBwEnableSetReplyVer10 message) { // fixed value property version = 1 bb.writeByte((byte) 0x1); // fixed value property type = 4 bb.writeByte((byte) 0x4); // fixed value property length = 24 bb.writeShort((short) 0x18); bb.writeInt(U32.t(message.xid)); // fixed value property experimenter = 0x5c16c7L bb.writeInt(0x5c16c7); // fixed value property subtype = 0x17L bb.writeInt(0x17); bb.writeInt(U32.t(message.enable)); bb.writeInt(U32.t(message.status)); } } @Override public String toString() { StringBuilder b = new StringBuilder("OFBsnBwEnableSetReplyVer10("); b.append("xid=").append(xid); b.append(", "); b.append("enable=").append(enable); b.append(", "); b.append("status=").append(status); b.append(")"); return b.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OFBsnBwEnableSetReplyVer10 other = (OFBsnBwEnableSetReplyVer10) obj; if( xid != other.xid) return false; if( enable != other.enable) return false; if( status != other.status) return false; return true; } @Override public boolean equalsIgnoreXid(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OFBsnBwEnableSetReplyVer10 other = (OFBsnBwEnableSetReplyVer10) obj; // ignore XID if( enable != other.enable) return false; if( status != other.status) return false; return true; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * (int) (xid ^ (xid >>> 32)); result = prime * (int) (enable ^ (enable >>> 32)); result = prime * (int) (status ^ (status >>> 32)); return result; } @Override public int hashCodeIgnoreXid() { final int prime = 31; int result = 1; // ignore XID result = prime * (int) (enable ^ (enable >>> 32)); result = prime * (int) (status ^ (status >>> 32)); return result; } }
[ "alex@VM-UFS-001" ]
alex@VM-UFS-001
0fe5c2717604bf28ccf43428459e2c2587d18826
7206a1617b4f9f313158ed3c7120111f72b65c61
/app/src/main/java/com/b/dentes3/emergencias.java
c657eec3a7d7879741af5197897b62b7e57e94af
[]
no_license
BJSoto14/dentes3
d0a928d3063c3b019bfa51591c034c01e64c7bd5
087b2db0d46b3ca00e40b949bd030e34cedd4723
refs/heads/master
2020-05-01T13:26:05.640217
2019-03-25T01:41:30
2019-03-25T01:41:30
177,491,593
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package com.b.dentes3; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class emergencias extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_emergencias); } }
[ "brandonsotoxd@gmail.com" ]
brandonsotoxd@gmail.com
4bc81fe204c0e02593914665776accebe384421f
31508edbaeb4ab2219ea9f4cd4f40c8419b380a9
/src/test/java/org/springframework/social/geeklist/api/impl/UserTemplateTest.java
31bbbc2cbc8992e1f59233498e2af52c0da6acc0
[]
no_license
VRDate/spring-social-geeklist
a2cca342840231c4e1499978f963b9b2deb4ddcb
2c1c3fc1f9d28b9681ba32c3af3708d08f31d964
refs/heads/master
2020-12-11T07:18:12.738482
2012-06-17T20:47:18
2012-06-17T20:47:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,870
java
package org.springframework.social.geeklist.api.impl; import static org.junit.Assert.assertEquals; import static org.springframework.http.HttpMethod.GET; import static org.springframework.test.web.client.RequestMatchers.method; import static org.springframework.test.web.client.RequestMatchers.requestTo; import static org.springframework.test.web.client.ResponseCreators.withResponse; import org.junit.Before; import org.junit.Test; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.social.geeklist.api.GeekListUser; import org.springframework.test.web.client.MockRestServiceServer; public class UserTemplateTest { private final String userString = "{\"status\": \"ok\",\"data\": {\"id\": \"a271659310088dc1a09fe0af9ddf6dd2d1987ddb99d2ca23af50a7fae55256d9\",\"name\": \"Jacob Chapel\",\"screen_name\": \"chapel\",\"avatar\": {\"small\": \"http://a1.twimg.com/profile_images/1340947562/me_badass_ava_normal.png\",\"large\": \"http://a1.twimg.com/profile_images/1340947562/me_badass_ava.png\"},\"blog_link\": \"http://lepahc.com\",\"company\": {\"title\": \"\",\"name\": \"Freelancer\"},\"location\": \"Spokane, WA\",\"bio\": \"Javascript and Node.js Evangelist\",\"social_links\": [\"http://twitter.com/jacobchapel\",\"http://lepahc.com\"],\"social\": {\"twitter_screen_name\": \"jacobchapel\",\"twitter_friends_count\": 82,\"twitter_followers_count\": 164},\"criteria\": {\"looking_for\": [\"interesting ideas\",\"fun times\"],\"available_for\": [\"node.js development\",\"front-end javascript\",\"unique ideas\",\"constructive critique\"]},\"stats\": {\"number_of_contributions\": 6,\"number_of_highfives\": 29,\"number_of_mentions\": 0,\"number_of_cards\": 3},\"is_beta\": true,\"created_at\": \"2011-09-14T02:08:42.978Z\",\"updated_at\": \"2011-12-17T00:45:37.833Z\",\"active_at\": \"2011-10-27T05:48:36.409Z\",\"trending_at\": \"2011-12-17T00:51:14.468Z\",\"trending_hist\": []}}"; private final String cardString = "{\"status\": \"ok\",\"data\": {\"total_cards\": 1,\"cards\": [{author_id: \"a271659310088dc1a09fe0af9ddf6dd2d1987ddb99d2ca23af50a7fae55256d9\",created_at: \"2011-09-14T04:46:30.384Z\",happened_at: \"2011-09-06T00:00:00.000Z\",happened_at_type: \"custom\",headline: \"I placed 23rd out of >180 at Nodeknockout 2011\",is_active: true,permalink: \"/chapel/i-placed-23rd-out-of-180-at-nodeknockout-2011\",slug: \"i-placed-23rd-out-of-180-at-nodeknockout-2011\",tasks: [ ],updated_at: \"2011-11-28T23:05:42.180Z\",stats: {number_of_views: 55,views: 64,highfives: 3},short_code: {gklst_url: \"http://gkl.st/XuQdJ\",id: \"32002d0dea77d1e55dcdb17b93456b789f0726b659e2d605bd6047db6c046865\"},id: \"32002d0dea77d1e55dcdb17b93456b7807b3c1b0695e177228f4fa12f227119b\"}]}}"; private GeekListTemplate geekList; private MockRestServiceServer mockServer; private HttpHeaders responseHeaders; @Before public void setup() { geekList = new GeekListTemplate("consumerKey", "consumerSecret", "accessToken", "accessTokenSecret"); mockServer = MockRestServiceServer.createServer(geekList.getRestTemplate()); responseHeaders = new HttpHeaders(); responseHeaders.setContentType(MediaType.APPLICATION_JSON); } @Test public void testGetUser() throws Exception { mockServer.expect(requestTo("http://sandbox-api.geekli.st/v1/users/chapel")).andExpect(method(GET)).andRespond(withResponse(userString, responseHeaders)); GeekListUser geek = geekList.userOperations().getUser("chapel"); assertEquals("chapel", geek.getUserName()); assertEquals("Javascript and Node.js Evangelist", geek.getBio()); assertEquals("Jacob Chapel", geek.getDisplayName()); assertEquals("Spokane, WA", geek.getLocation()); assertEquals("a271659310088dc1a09fe0af9ddf6dd2d1987ddb99d2ca23af50a7fae55256d9", geek.getUserId()); assertEquals("http://geekli.st/chapel", geek.getUserProfileUrl()); } }
[ "robhinds@gmail.com" ]
robhinds@gmail.com
3dd867fe28960364d2cf3fef2741533ed50ee7be
0c115e2c58d8bd9b0072c643d975f8280d4b6440
/t-pc/PCTMCITProject/src/tmcit/hokekyo1210/SolverUI/Util/HttpUtil.java
e6400a1dd98c97ab6272356296537aa1eb085344
[]
no_license
jubeatLHQ/PCProjectT
ced2b76daeef021175072b8d10857d6a0f47da4a
49e002442607b19a04b39ea82de05f95919d4a29
refs/heads/master
2020-06-26T05:01:06.671700
2014-12-09T02:04:07
2014-12-09T02:04:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,620
java
package tmcit.hokekyo1210.SolverUI.Util; import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.apache.http.client.fluent.Content; import org.apache.http.client.fluent.Form; import org.apache.http.client.fluent.Request; import tmcit.hokekyo1210.SolverUI.Main; public class HttpUtil { private String teamToken; private String problemID; private String answer; public HttpUtil(String teamToken,String problemID,String answer){ this.teamToken = teamToken; this.problemID = problemID; this.answer = answer; } public void sendAnswer() throws Exception{ Content content = Request.Post(Main.TARGET_HOST_POST).addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8") .bodyForm(Form.form().add("playerid", teamToken).add("problemid", problemID).add("answer",answer).build()) .execute().returnContent(); System.out.println(content.asString()); } public static Path getProblemFile(String problemName) throws Exception{ File dir = new File(Main.tmpDir); if(!dir.exists()){ dir.mkdirs(); } Content content = Request.Get(Main.TARGET_HOST_GET+"/"+problemName) .execute().returnContent(); Path tmpPath = Paths.get(Main.tmpDir, problemName); Files.copy(content.asStream(), tmpPath, StandardCopyOption.REPLACE_EXISTING); return tmpPath; } /*public static void sendAnswer(String teamToken,String problemID,String answer) throws Exception { DefaultHttpClient httpclient = null; HttpPost post = null; HttpEntity entity = null; try { httpclient = new DefaultHttpClient(); HttpParams httpParams = httpclient.getParams(); //接続確立のタイムアウトを設定(単位:ms) HttpConnectionParams.setConnectionTimeout(httpParams, 500*1000); //接続後のタイムアウトを設定(単位:ms) HttpConnectionParams.setSoTimeout(httpParams, 500*1000); post = new HttpPost(TARGET_HOST); post.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("playerid", teamToken)); params.add(new BasicNameValuePair("problemid", problemID)); params.add(new BasicNameValuePair("answer", answer)); post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8)); final HttpResponse response = httpclient.execute(post); // レスポンスヘッダーの取得(ファイルが無かった場合などは404) System.out.println("StatusCode=" + response.getStatusLine().getStatusCode()); if(response.getStatusLine().getStatusCode() != 200 ){ System.out.println("StatusCode:" + response.getStatusLine().getStatusCode()); return; } entity = response.getEntity(); // entityが取れなかった場合は、Connectionのことは心配しないでもOK if (entity != null) { System.out.println(EntityUtils.toString(entity)); System.out.println("length: " + entity.getContentLength()); EntityUtils.consume(entity); //depriciated entity.consumeContent(); post.abort(); } System.out.println("結果を取得しました。"); }catch (Exception e) { e.printStackTrace(); }finally { httpclient.getConnectionManager().shutdown(); } }*/ }
[ "jubeatlhp@gmail.com" ]
jubeatlhp@gmail.com
fcc38696aa1177f56c67cd610e460fbcfa2c530e
9c00c20ce5e09509018e0daedbc4af2abc3f18e5
/app/src/main/java/com/adi/learning/android/data/DataItemAdapterListView.java
b0d376c49539682f0db48d968ef527f66b17def3
[]
no_license
thinkadi/learn-android-data
81f2a5acbc4a7f7b4c186435ea9f9fe443d9daf5
cfa800b504ba6eacdd8d08755b44bc4ed3de6952
refs/heads/master
2021-07-24T19:52:13.866909
2017-11-02T23:57:16
2017-11-02T23:57:16
109,298,313
0
0
null
null
null
null
UTF-8
Java
false
false
2,085
java
package com.adi.learning.android.data; import android.content.Context; import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import com.adi.learning.android.data.model.DataItem; import java.io.IOException; import java.io.InputStream; import java.util.List; public class DataItemAdapterListView extends ArrayAdapter<DataItem> { private List<DataItem> mDataItems; private LayoutInflater mInflater; DataItemAdapterListView(@NonNull Context context, @NonNull List<DataItem> objects) { super(context, R.layout.list_item, objects); mDataItems = objects; mInflater = LayoutInflater.from(context); } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, parent, false); } TextView tvName = convertView.findViewById(R.id.itemNameText); ImageView imageView = convertView.findViewById(R.id.imageView); DataItem item = mDataItems.get(position); tvName.setText(item.getItemName()); // imageView.setImageResource(R.drawable.apple_pie); InputStream inputStream = null; try { String imageFile = item.getImage(); inputStream = getContext().getAssets().open(imageFile); Drawable d = Drawable.createFromStream(inputStream, null); imageView.setImageDrawable(d); } catch (IOException e) { e.printStackTrace(); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { e.printStackTrace(); } } return convertView; } }
[ "thinkadi@outlook.com" ]
thinkadi@outlook.com
944e67121ca32791b5d8e04f0801e6ccc4e2e573
a3a39ae872d7db70e6a941fb1c8d4a85ea7e2516
/src/main/java/cn/java/personal/service/AwardService.java
d5b59be3ec25022ad779c4e734e45be92c186e74
[]
no_license
fcser/person
f12d5d5e115bc1ca3c4fc61b0336cbb95a687a1c
077d901bcccda25aadd88f1c83701de7aefc6367
refs/heads/master
2020-04-12T04:37:10.424438
2018-12-18T14:47:26
2018-12-18T14:47:26
162,300,879
1
0
null
null
null
null
UTF-8
Java
false
false
425
java
package cn.java.personal.service; import java.util.ArrayList; import cn.java.personal.pojo.Award; /** *@author:zym *@version: *@time:2018年6月7日下午11:58:31 */ public interface AwardService { public int insertAward(Award award); public int updateAward(Award award); public ArrayList<Award> queryAward(int userId); public int deleteAwards(int userId); public int deleteAward(int Id); }
[ "zym@DESKTOP-R1N00C5" ]
zym@DESKTOP-R1N00C5
125b61b2d7376763eb154d886201e146b3b18b80
81da442fc7d9e406f5a2ea37749976e982995a70
/src/main/java/edu/cumt/semantic/security/SecurityUtils.java
6a48a8cdff8617c99e61fcd84178148d1e08b86c
[]
no_license
feiyucq/cumt-semantic-demo
48124486e1e2510414ba1703579b8a79c37d8835
468e2416cf6e6483336d849762b40f254c505523
refs/heads/master
2022-12-11T06:55:50.634015
2019-12-17T07:38:16
2019-12-17T07:38:49
180,744,105
0
0
null
2022-12-08T17:29:22
2019-04-11T08:03:10
Java
UTF-8
Java
false
false
2,977
java
package edu.cumt.semantic.security; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import java.util.Optional; /** * Utility class for Spring Security. */ public final class SecurityUtils { private SecurityUtils() { } /** * Get the login of the current user. * * @return the login of the current user */ public static Optional<String> getCurrentUserLogin() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> { if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } else if (authentication.getPrincipal() instanceof String) { return (String) authentication.getPrincipal(); } return null; }); } /** * Get the JWT of the current user. * * @return the JWT of the current user */ public static Optional<String> getCurrentUserJWT() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .filter(authentication -> authentication.getCredentials() instanceof String) .map(authentication -> (String) authentication.getCredentials()); } /** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise */ public static boolean isAuthenticated() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> authentication.getAuthorities().stream() .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS))) .orElse(false); } /** * If the current user has a specific authority (security role). * <p> * The name of this method comes from the isUserInRole() method in the Servlet API * * @param authority the authority to check * @return true if the current user has the authority, false otherwise */ public static boolean isCurrentUserInRole(String authority) { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> authentication.getAuthorities().stream() .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority))) .orElse(false); } }
[ "qing.chen@chemcyber.com" ]
qing.chen@chemcyber.com
7544125512ed7b4cfa28087281cec1632644531d
d9609c24a77e3075032fb5aad07d0ff42f2c79d9
/app/src/main/java/com/example/c1/ui/slideshow/SlideshowViewModel.java
a693f3a564852f487f1ddde40e34664308eb6bb7
[]
no_license
aadeshpandiri/HospitalAppointmentApp
5001231c494682c8d2d158140b31c4eee3b3fea5
c1d764355b24f6f74a6bc957ff177f3e2c0bd576
refs/heads/master
2022-12-16T02:40:52.669371
2020-09-14T03:26:45
2020-09-14T03:26:45
295,293,464
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.example.c1.ui.slideshow; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class SlideshowViewModel extends ViewModel { private MutableLiveData<String> mText; public SlideshowViewModel() { mText = new MutableLiveData<>(); mText.setValue("This is slideshow fragment"); } public LiveData<String> getText() { return mText; } }
[ "aadeshpandiri@gmail.com" ]
aadeshpandiri@gmail.com
17de4c665f63267ac396205148d1e67665d26242
da2b3591126a0df7ed04dacfe57c71e2584cd265
/jar-service/src/main/java/com/sixsq/slipstream/module/ModuleFormProcessor.java
ce3d7e02c05a309282026b8ec5271cb208b43c2e
[ "Apache-2.0" ]
permissive
loverdos/SlipStreamServer
f017dae60c17a73e560a697912c70cf8b0ac5626
62d56e0697d2af1f44ec46a52174c30d5745d652
refs/heads/master
2021-01-24T00:08:38.664267
2014-05-19T07:55:28
2014-05-19T07:55:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,556
java
package com.sixsq.slipstream.module; /* * +=================================================================+ * SlipStream Server (WAR) * ===== * Copyright (C) 2013 SixSq Sarl (sixsq.com) * ===== * 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. * -=================================================================- */ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.restlet.data.Form; import com.sixsq.slipstream.exceptions.NotFoundException; import com.sixsq.slipstream.exceptions.SlipStreamClientException; import com.sixsq.slipstream.exceptions.ValidationException; import com.sixsq.slipstream.persistence.Authz; import com.sixsq.slipstream.persistence.Commit; import com.sixsq.slipstream.persistence.Module; import com.sixsq.slipstream.persistence.ModuleCategory; import com.sixsq.slipstream.persistence.ModuleParameter; import com.sixsq.slipstream.persistence.User; import com.sixsq.slipstream.user.FormProcessor; public abstract class ModuleFormProcessor extends FormProcessor<Module, ModuleParameter> { private List<String> illegalNames = new ArrayList<String>( (Arrays.asList(("new")))); public ModuleFormProcessor(User user) { super(user); } static public ModuleFormProcessor createFormProcessorInstance( ModuleCategory category, User user) { ModuleFormProcessor processor = null; switch (category) { case Project: processor = new ProjectFormProcessor(user); break; case Image: processor = new ImageFormProcessor(user); break; case BlockStore: break; case Deployment: processor = new DeploymentFormProcessor(user); break; default: String msg = "Unknown category: " + category.toString(); throw new IllegalArgumentException(msg); } return processor; } @Override protected void parseForm() throws ValidationException, NotFoundException { super.parseForm(); String name = parseName(); setParametrized(getOrCreateParameterized(name)); getParametrized().setDescription(parseDescription()); getParametrized().setCommit(parseCommit()); getParametrized().setLogoLink(parseLogoLink()); } private String parseName() throws ValidationException { String parent = getForm().getFirstValue("parentmodulename", ""); String name = getForm().getFirstValue("name"); validateName(name); return ("".equals(parent)) ? name : parent + "/" + name; } private String parseDescription() throws ValidationException { return getForm().getFirstValue("description"); } private Commit parseCommit() throws ValidationException { return new Commit(getUser().getName(), getForm().getFirstValue( "comment"), getParametrized()); } private String parseLogoLink() throws ValidationException { return getForm().getFirstValue("logoLink"); } private void validateName(String name) throws ValidationException { for (String illegal : illegalNames) { if (illegal.equals(name)) { throw (new ValidationException("Illegal name: " + name)); } } return; } protected void parseAuthz() { // Save authz section Module module = getParametrized(); Authz authz = new Authz(getUser().getName(), module); authz.clear(); Form form = getForm(); // ownerGet: can't be changed because owner would lose access authz.setOwnerPost(getBooleanValue(form, "ownerPost")); authz.setOwnerDelete(getBooleanValue(form, "ownerDelete")); authz.setGroupGet(getBooleanValue(form, "groupGet")); authz.setGroupPut(getBooleanValue(form, "groupPut")); authz.setGroupPost(getBooleanValue(form, "groupPost")); authz.setGroupDelete(getBooleanValue(form, "groupDelete")); authz.setPublicGet(getBooleanValue(form, "publicGet")); authz.setPublicPut(getBooleanValue(form, "publicPut")); authz.setPublicPost(getBooleanValue(form, "publicPost")); authz.setPublicDelete(getBooleanValue(form, "publicDelete")); authz.setGroupMembers(form.getFirstValue("groupmembers", "")); authz.setInheritedGroupMembers(getBooleanValue(form, "inheritedGroupMembers")); if (module.getCategory() == ModuleCategory.Project) { authz.setOwnerCreateChildren(getBooleanValue(form, "ownerCreateChildren")); authz.setGroupCreateChildren(getBooleanValue(form, "groupCreateChildren")); authz.setPublicCreateChildren(getBooleanValue(form, "publicCreateChildren")); } getParametrized().setAuthz(authz); } protected boolean getBooleanValue(Form form, String parameter) { Object value = form.getFirstValue(parameter); if (value != null && "on".equals(value.toString())) { return true; } else { return false; } } @Override protected ModuleParameter createParameter(String name, String value, String description) throws SlipStreamClientException { return new ModuleParameter(name, value, description); } public void adjustModule(Module older) throws ValidationException { getParametrized().setCreation(older.getCreation()); getParametrized().getAuthz().setUser(older.getOwner()); } protected Module load(String name) { return Module.loadByName(name); } }
[ "meb@sixsq.com" ]
meb@sixsq.com
73e4d28d98aeb60d12549d96cf2c53109af89c94
bb1fbde6f8c28e4b4bdf3b2f9bfd4564833f1747
/src/test/java/MotorcycleTest.java
b9e703ff7b4f920c1bb054b15b4c7e0bcb4de230
[]
no_license
tdwny/WeekTwo
d61b82263163ca9579c69215f87a29432f958b3d
4a2a7c4fa7bc6c5c58197564782b40690836fb83
refs/heads/AddingFilesToMaster
2022-12-22T01:30:30.962197
2020-09-22T01:55:54
2020-09-22T01:55:54
297,220,589
0
0
null
2020-09-22T02:02:30
2020-09-21T03:40:12
Java
UTF-8
Java
false
false
1,793
java
import hondaProducts.impl.Car; import hondaProducts.impl.Motorcycle; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertTrue; public class MotorcycleTest { //LocalVariables Motorcycle motorcycle; @Before public void initialize(){ //Object motorcycle = new Motorcycle(3, 1, "red"); } @Test public void testMotorcycle(){ //Expected Variables boolean hasEngine = true; int numberOfWheels = 3; int numberOfSeats = 1; String color = "red"; //Asset assertTrue("Expected Value was " + hasEngine + " but was " + motorcycle.isHasEngine(), motorcycle.isHasEngine() == true); assertTrue("Expected Value was " + numberOfWheels + " but was " + motorcycle.getNumberOfWheels(), motorcycle.getNumberOfWheels() == 3); assertTrue("Expected Value was " + numberOfSeats + " but was " + motorcycle.getNumberOfSeats(), motorcycle.getNumberOfSeats() == 1); assertTrue("Expected Value was " + color + " but was " + motorcycle.getColor(), motorcycle.getColor() == "red"); } @Test public void testRide(){ //Expected Variables String expectedOutput = "This motorcycle is being ridden"; //Expected Variables assertTrue("Expected Value was " + "This motorcycle is being ridden" + " but was " + motorcycle.ride(), motorcycle.ride() == "This motorcycle is being ridden"); } @Test public void testWeelie(){ //Expected Variables String expectedOutput = "Rider is popping a wheelie"; //Expected Variables assertTrue("Expected Value was " + "Rider is popping a wheelie" + " but was " + motorcycle.wheelie(), motorcycle.wheelie() == "Rider is popping a wheelie"); } }
[ "timothy.downey@c02cg3z3md6p.camelot.local" ]
timothy.downey@c02cg3z3md6p.camelot.local
01b33a17cc92b56490b0bd3916719e00283c15eb
47c5177fc6667ce608d39e0c061d872d174288b2
/src/at/easydiet/teamc/model/GenderBo.java
814467c4683903cdffb159de6c888320bd50bcf3
[]
no_license
manuelTscholl/easydiet-team-c
3819ea56a703c90e23f928865a234e75643a60fb
4a65467e4022511cd9c0df040651faae65d6426c
refs/heads/master
2021-01-10T00:52:58.080446
2011-06-11T12:58:20
2011-06-11T12:58:20
32,137,119
0
0
null
null
null
null
UTF-8
Java
false
false
999
java
package at.easydiet.teamc.model; // Generated 02.04.2011 00:41:04 by Hibernate Tools 3.4.0.CR1 import at.easydiet.model.Gender; /** * GenderBo generated by hbm2java */ public class GenderBo implements java.io.Serializable, Saveable { private Gender _Gender; private GenderBo() { } public GenderBo(Gender gender) { this._Gender = gender; } public GenderBo(String name) { this(new Gender(name)); } public String getName() { return this.getGender().getName(); } public void setName(String name) { this.getGender().setName(name); } /** * @return the _Gender */ protected Gender getGender() { return _Gender; } /** * @param Gender the _Gender to set */ public void setGender(Gender Gender) { this._Gender = Gender; } @Override public boolean save() { throw new UnsupportedOperationException("Not supported yet."); } }
[ "manuel.tscholl@gmail.com@4feab3de-de25-87cd-0e07-2f1f9e466e77" ]
manuel.tscholl@gmail.com@4feab3de-de25-87cd-0e07-2f1f9e466e77
fbef21f819fd0035c1058f393cd606f47482fcfb
4893d0fb8af5aae3263b554db7cb0168bf5848c8
/src/main/java/basic/dataStructure/set/BSTSet.java
fb8ca4484b4a7c3b53d95a70e4bc7138b9d48585
[]
no_license
NaishengZhang/java_notes
ad85e1733081db2bc0d516eaaa43780e95360a08
e7949b353a54fae80ade7767f84d15317929d591
refs/heads/master
2022-11-08T21:12:09.358596
2020-07-02T03:56:06
2020-07-02T03:56:06
267,479,100
1
0
null
null
null
null
UTF-8
Java
false
false
1,592
java
package basic.dataStructure.set; import java.util.ArrayList; public class BSTSet<E extends Comparable<E>> implements Set<E> { private BST<E> bst; public BSTSet() { bst = new BST<>(); } @Override public void add(E e) { bst.add(e); } @Override public void remove(E e) { bst.remove(e); } @Override public boolean contains(E e) { return bst.contains(e); } @Override public int getSize() { return bst.size(); } @Override public boolean isEmpty() { return bst.isEmpty(); } public static void main(String[] args) { System.out.println("Pride and Prejudice"); ArrayList<String> words1 = new ArrayList<>(); if(FileOperation.readFile("src/pride-and-prejudice.txt", words1)) { System.out.println("Total words: " + words1.size()); BSTSet<String> set1 = new BSTSet<>(); for (String word : words1) set1.add(word); System.out.println("Total different words: " + set1.getSize()); } System.out.println(); System.out.println("A Tale of Two Cities"); ArrayList<String> words2 = new ArrayList<>(); if(FileOperation.readFile("src/a-tale-of-two-cities.txt", words2)){ System.out.println("Total words: " + words2.size()); BSTSet<String> set2 = new BSTSet<>(); for(String word: words2) set2.add(word); System.out.println("Total different words: " + set2.getSize()); } } }
[ "jonathan.n.zhang@gmail.com" ]
jonathan.n.zhang@gmail.com
74bb7fb079cf5db711da95a07035fcd5678aa047
966a6c4d2cffb33ffc5c8efd8b54140df54f956b
/EjercicioBancoXXX/src/org/deiv/CuentaAhorro.java
eb3183812193a976e0ac193d6012b87d2eca701c
[]
no_license
David-divad/Damm
f6bf80df409bfcf2900d286c43d2125ab7a8e1f9
073aeffae617d4cf9352019d493c4464cc59fa61
refs/heads/master
2016-09-11T12:02:26.679134
2012-04-17T16:13:30
2012-04-17T16:13:30
3,171,894
0
0
null
null
null
null
UTF-8
Java
false
false
1,998
java
package org.deiv; /* * **************************************************************************** – Desarrollar una clase llamada CuentaAhorro que es igual que la CuentaCorriente pero que produce intereses: ?? Dispondrá además de los atributos de CuentaCorriente otros de tipo privado llamado interes de tipo double ?? Constructor – Crear un constructor donde se pasarán los siguientes parámetros: Titular de la cuenta, el número de la cuenta, el saldo y el interés – Crear un constructor con los siguientes titular de la cuenta, numero de cuenta. El saldo se asignará con 0 € y el interés a 2,5% ?? Otros métodos – Un método llamado setInteres que pasado un parámetro permita asignarlo como interés – Un método llamado getInteres que devuelva el interes aplicado – Un método llamado calcular los Intereses e ingresarlos en la cuenta.( Saldo+ saldo*interes/100). Tener en cuenta el modificador asignado al atributo saldo – Sobrescribir el método toString para visualizar todos los datos Analizar el tipo de dato que podríamos asignarle a los atributos de la clase padre para evitar tener que acceder mediante los métodos getter y setter */ public class CuentaAhorro extends CuentaCorriente { private double interes; public double getInteres() { return interes; } public void setInteres(double interes) { this.interes = interes; } public CuentaAhorro(Titular titular, String numeroCuenta) throws CloneNotSupportedException { this(titular, numeroCuenta, 0, 2.5d); } public CuentaAhorro(Titular titular, String numeroCuenta, double saldo, double interes) throws CloneNotSupportedException { super(titular, numeroCuenta, saldo); this.interes = interes; } public void calcularIngresarIntereses() { // setSaldo( getSaldo() * interes / 100 ); saldo += (saldo * interes) / 100; } public String toString() { return super.toString() + ", interes: " + interes; } }
[ "david.modulo.dam@gmail.com" ]
david.modulo.dam@gmail.com
5fb52884c7f564884876456f994f8aa01dac20de
e53397a3c2c85be9e8d6e7d8f374fe2c35417f8a
/libraryMongoDB_hw08/src/test/java/ru/avalieva/otus/libraryMongoDB_hw08/repository/CommentRepositoryTest.java
5b307ae4c60b00c872df3a3e8955a23120dc20b9
[]
no_license
alfiyashka/otus_spring
79f096cc832e75702e2f67a9186f6a05b3eef209
31a43c785ad94604a8a4b9b816f99f1f5b81a019
refs/heads/master
2022-07-17T21:02:44.004314
2020-05-29T19:57:07
2020-05-29T19:57:07
224,483,926
0
0
null
2022-06-21T03:11:49
2019-11-27T17:31:30
Java
UTF-8
Java
false
false
2,575
java
package ru.avalieva.otus.libraryMongoDB_hw08.repository; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Import; import ru.avalieva.otus.libraryMongoDB_hw08.configuration.MongoSettings; import ru.avalieva.otus.libraryMongoDB_hw08.configuration.MongockConfiguration; import ru.avalieva.otus.libraryMongoDB_hw08.domain.Book; import ru.avalieva.otus.libraryMongoDB_hw08.domain.Comment; import ru.avalieva.otus.libraryMongoDB_hw08.events.MongoEventsException; import ru.avalieva.otus.libraryMongoDB_hw08.service.MessageService; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @DataMongoTest @EnableConfigurationProperties @ComponentScan({"ru.avalieva.otus.libraryMongoDB_hw08.repository", "ru.avalieva.otus.libraryMongoDB_hw08.events"}) @Import({MongoSettings.class, MongockConfiguration.class}) public class CommentRepositoryTest { @MockBean MessageService messageService; @Autowired private CommentRepository commentRepository; @Autowired private BookRepository bookRepository; @DisplayName("try add comment with null book test") @Test public void addCommentTestFailedNullBook() { Comment comment = new Comment("", "Commment", null); Assertions.assertThrows(MongoEventsException.class, () -> { commentRepository.save(comment); }); } @DisplayName("try add book with null author test") @Test public void addBookAuthorTestFailedUnknownAuthor() { Book book = new Book("ffffffffffffffffffffffff", "NEW BOOK", 1990, null, null); Comment comment = new Comment("", "Commment", book); Assertions.assertThrows(MongoEventsException.class, () -> { commentRepository.save(comment); }); } @DisplayName("try get comments of book test") @Test public void getCommentsOfBookTest() { List<Book> books = bookRepository.findAll(); Book book = books.get(0); List<Comment> comments = commentRepository.getCommentsOfBook(book.getIsbn()); final int EXPECTED_COMMENT_COUNT = 2; assertThat(comments).isNotNull().hasSize(EXPECTED_COMMENT_COUNT); } }
[ "v-alfiya@mail.ru" ]
v-alfiya@mail.ru
cbc62580aab939019b92754f2962aa73f19e3bcc
10c40b847b9a2f827acef75c62e3623bb04ecc6d
/WEB-INF/classes/ProductRecommenderUtility.java
a59eff09b4301066af1642e579870bcfced7129c
[]
no_license
AK1694/SmartPortables
af8baea27bf56ee22d7237e2203044b3b062ac5b
6801280efda3e32386426386ef8a743c8fcebe84
refs/heads/master
2020-07-09T08:38:31.402848
2019-08-23T05:29:12
2019-08-23T05:29:12
203,929,871
0
0
null
null
null
null
UTF-8
Java
false
false
2,455
java
import java.io.*; import java.sql.*; import java.io.IOException; import java.util.*; public class ProductRecommenderUtility{ static Connection conn = null; static String message; public static String getConnection() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/exampledatabase","root","ashu8901"); message="Successfull"; return message; } catch(SQLException e) { message="unsuccessful"; return message; } catch(Exception e) { message="unsuccessful"; return message; } } public HashMap<String,String> readOutputFile(){ String TOMCAT_HOME = System.getProperty("catalina.home"); BufferedReader br = null; String line = ""; String cvsSplitBy = ","; HashMap<String,String> prodRecmMap = new HashMap<String,String>(); try { br = new BufferedReader(new FileReader(new File(TOMCAT_HOME+"\\webapps\\SmartPortablesHW44\\output.csv"))); while ((line = br.readLine()) != null) { // use comma as separator String[] prod_recm = line.split(cvsSplitBy,2); prodRecmMap.put(prod_recm[0],prod_recm[1]); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } return prodRecmMap; } public static Product getProduct(String product){ Product prodObj = new Product(); try { String msg = getConnection(); String selectProd="select * from Productdetails where Id=?"; PreparedStatement pst = conn.prepareStatement(selectProd); pst.setString(1,product); ResultSet rs = pst.executeQuery(); while(rs.next()) { prodObj = new Product(rs.getString("Id"),rs.getString("productName"),rs.getDouble("productPrice"),rs.getString("productImage"),rs.getString("productManufacturer"),rs.getString("productCondition"),rs.getString("ProductType"),rs.getDouble("productDiscount")); } rs.close(); pst.close(); conn.close(); } catch(Exception e) { } return prodObj; } }
[ "fashish@hawk.iit.edu" ]
fashish@hawk.iit.edu
a03e33806e645328879f11c4d2727c05c796ef2e
79ba0742e55f330e3b522a47f8ff7b88a6b5d1cc
/app/src/main/java/tasty/frenchdonuts/pavlov/data/Goal.java
865b224950f504a52a92fce7211f36ff6fd537e0
[]
no_license
immranderson/pavlov
2a3bbc098e303fe6a877a3fd29c02073d1d2c9c5
327b40aed3d4ce7a9934e16263ccc44bb0d879c7
refs/heads/master
2020-12-25T11:57:38.162096
2015-08-01T08:40:30
2015-08-01T08:40:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,422
java
package tasty.frenchdonuts.pavlov.data; import android.util.Log; import io.realm.Realm; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; /** * Created by frenchdonuts on 1/6/15. */ public class Goal extends RealmObject { private int priority; private long startDate; private long endDate; private long millisInOneLv; private String title; public static int calcNewPriority(Goal goal) { long millisToEnd = goal.getEndDate() - System.currentTimeMillis(); if (millisToEnd < 0) return 8; int decs = (int) (millisToEnd / goal.getMillisInOneLv()); return 8 - decs - 1; } public int getPriority() { return priority; } public void setPriority(int priority) { this.priority = priority; } public long getStartDate() { return startDate; } public void setStartDate(long startDate) { this.startDate = startDate; } public long getEndDate() { return endDate; } public void setEndDate(long endDate) { this.endDate = endDate; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public long getMillisInOneLv() { return millisInOneLv; } public void setMillisInOneLv(long millisInOneLv) { this.millisInOneLv = millisInOneLv; } }
[ "jonathantan1991@gmail.com" ]
jonathantan1991@gmail.com
731874f708e817dacc8ef75ccf680807e8a4c0ec
c093a8763b37881e6200f2d40f1cf085d2c16b53
/src/test/java/com/tinklabs/handy/logs/listener/KafkaTest.java
423f881b6c53774022cbf5c07e0eae4e9de1c307
[]
no_license
hanjingyang/handy-logging-api
28b17dd5736a9210a8a72862ee44b6812e3b6819
725ba78f662825fd69ed2ba2630a4d1e103f1f0a
refs/heads/master
2020-06-22T00:47:30.968774
2019-06-11T08:21:27
2019-06-11T08:21:27
197,591,844
0
0
null
2019-07-18T13:24:53
2019-07-18T13:24:53
null
UTF-8
Java
false
false
531
java
package com.tinklabs.handy.logs.listener; import org.junit.Test; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; public class KafkaTest { @Test public void testRest(){ HttpResponse result = HttpUtil.createPost("http://ec2-13-250-5-192.ap-southeast-1.compute.amazonaws.com:8082/topics/backend2-hangpan-test"). header("Content-Type", "application/vnd.kafka.v2+json").body("{\"records\":[{\"value\":\"{\\\"name\\\": \\\"hangpan-offset-4\\\"}\"}]}").execute(); System.out.println(result.body()); } }
[ "tony_pengtao@163.com" ]
tony_pengtao@163.com
3b8218fd7b0264928ceebebf727ece0ea0223a34
453ad6a89d9acac966d7febb0f595ba171f4b036
/src/com/print/demo/util/PrintUtil.java
bf89e26cfa250f7a6387522f98ec7a60fac7d962
[]
no_license
yuexingxing/ScanDemo
349d236abdb1c1c525f3c22668bcb900dd56783c
05d71bd04fb556b10d685a8531081afa24b16aae
refs/heads/master
2020-03-09T04:37:47.888766
2018-06-08T15:12:47
2018-06-08T15:12:47
128,591,947
0
0
null
null
null
null
GB18030
Java
false
false
5,062
java
package com.print.demo.util; import com.print.demo.ApplicationContext; import com.print.demo.data.PrintInfo; import utils.preDefiniation.AlignType; import utils.preDefiniation.BarcodeType; /** * 打印类 * * @author yxx * * @date 2018-3-12 下午5:52:03 * */ public class PrintUtil { public static ApplicationContext context = ApplicationContext.getInstance(); public static void printLabelTest(PrintInfo info){ // context.getObject().CON_PageStart(context.getState(),false, 0, 0);//0,0 context.getObject().ASCII_CtrlAlignType(context.getState(), AlignType.AT_CENTER.getValue()); context.getObject().ASCII_CtrlFeedLines(context.getState(), 0); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 1, 0, 0, "1\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "2\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "3\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "4\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "5\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "6\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "7\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "8\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "9\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "10\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "11\r\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "12\r\n", "gb2312"); context.getObject().ASCII_CtrlFeedLines(context.getState(), 1); // context.getObject().ASCII_CtrlReset(context.getState()); // context.getObject().ASCII_Print1DBarcode(context.getState(),BarcodeType.BT_CODE39.getValue(), 2, 32, // utils.preDefiniation.Barcode1DHRI.BH_BLEW.getValue(), info.getBillcode()); context.getObject().CON_PageEnd(context.getState(), context.getPrintway()); } /** * 行数一定要对应 * @param info */ public static void printLabel2(PrintInfo info){ String spaceStr = " ";//首行缩进距离 context.getObject().CON_PageStart(context.getState(),false, 0, 0);//0,0 context.getObject().ASCII_CtrlAlignType(context.getState(), AlignType.AT_LEFT.getValue()); context.getObject().ASCII_PrintString(context.getState(), 1, 1, 1, 0, 0, "12345678", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_CtrlFeedLines(context.getState(), 1); context.getObject().CON_PageEnd(context.getState(), context.getPrintway()); } /** * 行数一定要对应 * @param info */ public static void printLabel(PrintInfo info){ String spaceStr = " ";//首行缩进距离 context.getObject().CON_PageStart(context.getState(),false, 0, 0);//0,0 context.getObject().ASCII_CtrlAlignType(context.getState(), AlignType.AT_LEFT.getValue()); context.getObject().ASCII_CtrlSetFont(context.getState(), 15, 10, 10); context.getObject().ASCII_CtrlFeedLines(context.getState(), 0); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_CtrlAlignType(context.getState(), 0); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 1, 0, 0, spaceStr + "打印日期: " + info.getTime() + "\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_CtrlReset(context.getState()); context.getObject().ASCII_CtrlAlignType(context.getState(), AlignType.AT_CENTER.getValue());//条码居中显示 context.getObject().ASCII_Print1DBarcode( context.getState(), BarcodeType.BT_CODE39.getValue(), 3, 140, 0, info.getBillcode()); context.getObject().ASCII_CtrlReset(context.getState()); context.getObject().ASCII_CtrlAlignType(context.getState(), AlignType.AT_CENTER.getValue());//条码居中显示 context.getObject().ASCII_PrintString(context.getState(), 1, 1, 1, 0, 0, info.getBillcode(), "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); // context.getObject().ASCII_PrintString(context.getState(), 0, 0, 0, 0, 0, "\n", "gb2312"); context.getObject().ASCII_CtrlFeedLines(context.getState(), 1); context.getObject().ASCII_CtrlFeedLines(context.getState(), 1); context.getObject().CON_PageEnd(context.getState(), context.getPrintway()); } }
[ "670176656@qq.com" ]
670176656@qq.com
517afa184edb2a29bd79815fdeccfaa30e9d78d5
42120c89935b207ac8cad147843d4be4ec87e886
/flowField/src/JORTS/uiComponents/textFields/ResourceLabel.java
0a0ea7fed5934ea833b3ea30a9816f86eac742c1
[]
no_license
theoutsider24/JORTS
394ab0e3d31917463549ab821cf8e949ad45a17e
f8169a892ef83ff2eb3cf40f7c1eac8bb9288905
refs/heads/master
2021-01-10T02:35:17.463643
2016-04-04T12:01:29
2016-04-04T12:01:29
47,194,442
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package JORTS.uiComponents.textFields; import JORTS.core.GameWindow; public class ResourceLabel extends UpdatableTextField{ GameWindow window; String resource=""; public ResourceLabel(GameWindow window,String resource) { super(); this.window=window; this.resource=resource; text.setCharacterSize(15); } @Override public void update() { String s = resource+": "+window.activePlayer.resources.get(resource); if(!text.getString().equals(s)) { setText(s); setCentered(true); } } }
[ "Matthew@MATTHEW-PC" ]
Matthew@MATTHEW-PC
99d1fdb73dc8a428022b101fe6fe98716d99d80f
1db33c1ff594468fb58f4ad892a102b04421eb67
/app/src/main/java/com/kpsoftwaresolutions/khealth/utils/QBEntityCallbackImpl.java
947a82ce3e85b16399ab4d359894494b3b22a9ed
[]
no_license
nobeldhar/k-Health
a238e264cce0406ad851c0e1a590472489b44a40
e5dd49195b225a42da287350e3ea3942e9d94c5a
refs/heads/master
2022-12-21T05:45:29.008237
2020-08-26T08:54:51
2020-08-26T08:54:51
290,445,743
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.kpsoftwaresolutions.khealth.utils; import android.os.Bundle; import com.quickblox.core.QBEntityCallback; import com.quickblox.core.exception.QBResponseException; public class QBEntityCallbackImpl<T> implements QBEntityCallback<T> { @Override public void onSuccess(T result, Bundle params) { } @Override public void onError(QBResponseException responseException) { } }
[ "nobeldhar807@gmail.com" ]
nobeldhar807@gmail.com
9735db2c5cbd483617ec1c94c77111de0a846ab2
e31ce8381655a40e1a1c0e217f85be546f6ddc63
/diadiaCommerceWeb/src/java/web/action/inserisciProdotto/SActionInserisciProdotto.java
1d9519363fbb47d82b2fa19aa9751ccc6ddfce99
[]
no_license
pamput/university-diadiacommerceweb
b43a382d3b5251c8c9e71f064e20592d3c662d6a
b0282527e565a01d9803cd80aa8824fe48590547
refs/heads/master
2020-04-09T17:32:16.167353
2009-06-23T15:29:34
2009-06-23T15:29:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,950
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package web.action.inserisciProdotto; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; import modello.*; import persistenza.*; import persistenza.postgresql.*; import web.form.InserisciProdottoForm; /** * * @author Kimo */ public class SActionInserisciProdotto extends org.apache.struts.action.Action { /* forward name="success" path="" */ private final static String SUCCESS = "inserisciProdotto"; private final static String FAIL = "erroreInserisciProdotto"; /** * This is the action called from the Struts framework. * @param mapping The ActionMapping used to select this instance. * @param form The optional ActionForm bean for this request. * @param request The HTTP Request we are processing. * @param response The HTTP Response we are processing. * @throws java.lang.Exception * @return */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception { InserisciProdottoForm formProdotto = (InserisciProdottoForm) form; Prodotto prodotto = new Prodotto(); prodotto.setNome(formProdotto.getNome()); prodotto.setDescrizione(formProdotto.getDescrizione()); prodotto.setPrezzo(formProdotto.getPrezzo()); prodotto.setQuantita(formProdotto.getQuantita()); prodotto.setCodice(formProdotto.getCodice()); Facade facade = new Facadepostgresql(); try { facade.salvaProdotto(prodotto); }catch (Exception ex){ return mapping.findForward(FAIL); } return mapping.findForward(SUCCESS); } }
[ "pamput@3494e902-56a1-11de-8d7d-01d876f1962d" ]
pamput@3494e902-56a1-11de-8d7d-01d876f1962d
1eef923f3eb066f22e07cdc86defb67499018041
fb2cdbfcbb4d99f6cea88d58c6e6d91682009ad2
/weixin-web/src/main/java/com/cheng/weixin/web/security/SystemAuthorizingRealm.java
b57051f1b23cc99056bd55fd73ae214d78cdae82
[]
no_license
chengzhx76/Weixin0.1
f4e3c93542965e8e13396eddd0ee64e1d822932a
7b68d1f45fb234cc4472485061985f032e85f031
refs/heads/master
2021-01-10T13:36:45.450526
2016-03-28T10:19:39
2016-03-28T10:19:39
49,940,558
1
1
null
null
null
null
UTF-8
Java
false
false
4,253
java
package com.cheng.weixin.web.security; import com.cheng.weixin.core.entity.Admin; import com.cheng.weixin.core.entity.enums.Status; import com.cheng.weixin.core.service.IAdminService; import com.cheng.weixin.core.utils.Encodes; import com.cheng.weixin.web.utils.Captcha; import com.cheng.weixin.web.utils.UserUtils; import org.apache.shiro.authc.*; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.util.ByteSource; import org.springframework.beans.factory.annotation.Autowired; import java.io.Serializable; /** * Desc: 登录认证与授权 * Author: Cheng * Date: 2016/1/26 0026 */ public class SystemAuthorizingRealm extends AuthorizingRealm { @Autowired private IAdminService adminService; // 返回一个唯一的Realm名字 @Override public String getName() { return super.getName(); } // 判断此Realm是否支持此Token @Override public boolean supports(AuthenticationToken token) { return token instanceof WxUsernamePasswordToken ; } // 认证 @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException { WxUsernamePasswordToken token = (WxUsernamePasswordToken) authenticationToken; // 判断验证码是否正确 if (Captcha.isValidateCodeLogin(token.getUsername(), false, false)) { String captcha = (String) UserUtils.getSession().getAttribute(Captcha.CAPTCHA); if (null == token.getCaptcha() || !token.getCaptcha().equalsIgnoreCase(captcha)) { throw new AuthenticationException("msg:验证码错误,请重试."); } } // 校验用户名 Admin admin = adminService.getUserByUsername(token.getUsername()); if(admin != null) { if(admin.getStatus().equals(Status.LOCKED)) { throw new LockedAccountException("msg:该帐号已禁止登录."); } byte[] salt = Encodes.decodeHex(admin.getPassword().substring(0, 16)); return new SimpleAuthenticationInfo(new Principal(admin, token.isMobilelogin()), admin.getPassword().substring(16), ByteSource.Util.bytes(salt), getName()); } return null; } // 授权 @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { System.out.println("=======AuthorizationInfo======="); return null; } /** * 授权信息 */ public static class Principal implements Serializable { private static final long serialVersionUID = 2866069566032650619L; /** 编号 **/ private String id; /** 登录名 **/ private String username; /** 是否是手机登录 **/ private boolean mobileLogin; public Principal(Admin admin, boolean mobileLogin) { this.id = admin.getId(); this.username = admin.getUsername(); this.mobileLogin = mobileLogin; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public boolean isMobileLogin() { return mobileLogin; } public void setMobileLogin(boolean mobileLogin) { this.mobileLogin = mobileLogin; } } /** * 设定密码校验的Hash算法与迭代次数 * !这里已在xml配置了 id=hashMatcher */ /*@PostConstruct public void initCredentialsMatcher() { HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(); // 设置加密方式 matcher.setHashAlgorithmName(SystemUtils.HASH_ALGORITHM); // 设置迭代次数 matcher.setHashIterations(SystemUtils.HASH_INTERATIONS); // 注入到Shrio里自定义的加密方式 setCredentialsMatcher(matcher); }*/ }
[ "chengzhx76@qq.com" ]
chengzhx76@qq.com
cdc9a741a30700db86f88dc10c90bd3fd3de32cd
5374163c451cf19b023c4cdf84397a1b29285dc0
/AndroidStudy/app/src/main/java/com/example/liuyang05_sx/androidstudy/bean/knowledge/Datum.java
c97bee139713ace25b51fda84c4699d2ab548210
[]
no_license
1048785685/WanAndroid_study
c71e21daef98b98c0c45fd4c151a43cf0fb9c847
ff870c06479d69c17197e4455298436c7fc07c20
refs/heads/master
2020-04-24T09:34:40.650994
2019-04-26T09:38:57
2019-04-26T09:38:57
171,866,749
0
0
null
null
null
null
UTF-8
Java
false
false
1,838
java
package com.example.liuyang05_sx.androidstudy.bean.knowledge; import android.os.Parcelable; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Datum implements Serializable { @SerializedName("children") @Expose private List<Child> children = null; @SerializedName("courseId") @Expose private Integer courseId; @SerializedName("id") @Expose private Integer id; @SerializedName("name") @Expose private String name; @SerializedName("order") @Expose private Integer order; @SerializedName("parentChapterId") @Expose private Integer parentChapterId; @SerializedName("userControlSetTop") @Expose private Boolean userControlSetTop; @SerializedName("visible") @Expose private Integer visible; public List<Child> getChildren() { return children; } public void setChildren(List<Child> children) { this.children = children; } public Integer getCourseId() { return courseId; } public void setCourseId(Integer courseId) { this.courseId = courseId; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getOrder() { return order; } public void setOrder(Integer order) { this.order = order; } public Integer getParentChapterId() { return parentChapterId; } public void setParentChapterId(Integer parentChapterId) { this.parentChapterId = parentChapterId; } public Boolean getUserControlSetTop() { return userControlSetTop; } public void setUserControlSetTop(Boolean userControlSetTop) { this.userControlSetTop = userControlSetTop; } public Integer getVisible() { return visible; } public void setVisible(Integer visible) { this.visible = visible; } }
[ "1048785685@qq.com" ]
1048785685@qq.com
a9852bebd1e45d3bc167e70f81afbb68c57a1556
b7a3e340d8ff0e7702c43a9e8c21518e5c30942b
/Design/src/main/java/com/webdesign/model/Category.java
1de127efc0daf5f15f0059b285ed49e80fa6ee65
[]
no_license
dubeydhananjay/MyProject
f0d3f3691055f2a99f0358bb8b9e29fcb601f8be
5129b6092be2f04fbe7902d09b89306aa1b83d3a
refs/heads/master
2020-05-23T08:19:00.070974
2017-01-16T18:38:17
2017-01-16T18:38:39
70,221,967
1
1
null
null
null
null
UTF-8
Java
false
false
1,588
java
package com.webdesign.model; import java.io.Serializable; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import org.hibernate.validator.constraints.NotEmpty; import com.google.gson.annotations.Expose; @SuppressWarnings("serial") @Entity public class Category implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.AUTO) @Expose private int categoryId; @NotEmpty(message="Category Name is Required") @Expose private String categoryName; @NotEmpty(message="Category Description is Required") @Expose private String categoryDescription; @OneToMany(fetch = FetchType.EAGER,mappedBy="category", cascade=CascadeType.ALL) private Set<SubCategoryModel> subCategory; public Set<SubCategoryModel> getSubCategory() { return subCategory; } public void setSubCategory(Set<SubCategoryModel> subCategory) { this.subCategory = subCategory; } public int getCategoryId() { return categoryId; } public void setCategoryId(int categoryId) { this.categoryId = categoryId; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public String getCategoryDescription() { return categoryDescription; } public void setCategoryDescription(String categoryDescription) { this.categoryDescription = categoryDescription; } }
[ "dubeydhananjay9@gmail.com" ]
dubeydhananjay9@gmail.com
3548a31432111943ffd42480045e33d1f09d5439
554fda3637134f18cb9b750cc4fe3a8d76cd3752
/app/src/main/java/com/sample/sydneyzamoranos/ItemListActivity.java
f27a7f71ec195b1476a94c5c53adf07fd2dcaf1e
[]
no_license
sydney691/AppetiserApps
57c562db98bffbed326cd6f605be6bbd9e46742d
3cf0ac385c0572c7eb061238e88e7cbd01858d8d
refs/heads/master
2021-01-02T17:08:40.610430
2020-02-11T09:09:29
2020-02-11T09:09:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,963
java
package com.sample.sydneyzamoranos; import android.app.ActivityManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.RecyclerView; import androidx.appcompat.widget.Toolbar; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import android.util.Log; import android.util.LruCache; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.google.gson.Gson; import com.google.gson.internal.LinkedTreeMap; import com.google.gson.reflect.TypeToken; import com.sample.sydneyzamoranos.dummy.DummyContent; import com.sample.sydneyzamoranos.pojo.Results; import com.sample.sydneyzamoranos.pojo.SongInfo; import com.sample.sydneyzamoranos.presenter.CallBackResponse; import com.sample.sydneyzamoranos.presenter.GetSongInfoImpl; import com.sample.sydneyzamoranos.view.ItunesSongsView; import com.squareup.picasso.Picasso; import java.lang.reflect.Array; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.stream.Collectors; import butterknife.BindView; import butterknife.ButterKnife; /** * An activity representing a list of Items. This activity * has different presentations for handset and tablet-size devices. On * handsets, the activity presents a list of items, which when touched, * lead to a {@link ItemDetailActivity} representing * item details. On tablets, the activity presents the list of items and * item details side-by-side using two vertical panes. */ public class ItemListActivity extends AppCompatActivity implements ItunesSongsView { /** * Whether or not the activity is in two-pane mode, i.e. running on a tablet * device. */ private boolean mTwoPane; @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.fab) FloatingActionButton fab; @BindView(R.id.item_list) View recyclerView; private static LruCache cache = new LruCache(5000); SharedPreferences pref; SharedPreferences.Editor editor; private SimpleItemRecyclerViewAdapter adapter; private List<Results> results; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); ActivityManager am = (ActivityManager) this.getSystemService( Context.ACTIVITY_SERVICE); pref = getApplicationContext().getSharedPreferences("preference", 0); // 0 - for private mode editor = pref.edit(); if (pref.getString("data", "") == null || pref.getString("data", "").equals("")) { results = new ArrayList<>(); } else { String json = pref.getString("data", ""); Gson gson = new Gson(); Type type = new TypeToken<List<Results>>() { }.getType(); List<Results> obj = gson.fromJson(json, type); results = obj; } ButterKnife.bind(this); setSupportActionBar(toolbar); GetSongInfoImpl getSongInfoImpl = new GetSongInfoImpl(this); adapter = new SimpleItemRecyclerViewAdapter(this, results, mTwoPane); toolbar.setTitle(getTitle()); if (results.size() <= 1) { Results results1 = new Results(); results1.setArtistId("1"); results1.setArtistName("sydney"); results.add(results1); getSongInfoImpl.getAllSongs(results, new CallBackResponse() { public void completed(boolean done) { if (done) { ItemListActivity.this.runOnUiThread(new Runnable() { @Override public void run() { Gson gson = new Gson(); String json = gson.toJson(results); editor.putString("data", json); editor.commit(); adapter.notifyDataSetChanged(); } }); } } }); } else { setupRecyclerView((RecyclerView) recyclerView); } fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); if (findViewById(R.id.item_detail_container) != null) { // The detail container view will be present only in the // large-screen layouts (res/values-w900dp). // If this view is present, then the // activity should be in two-pane mode. mTwoPane = true; } getSongInfoImpl.processUi(); } public static class SimpleItemRecyclerViewAdapter extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> { private final ItemListActivity mParentActivity; private final List<Results> mValues; private final boolean mTwoPane; private final View.OnClickListener mOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Results item = (Results) view.getTag(); if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, item.getArtistId()); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); mParentActivity.getSupportFragmentManager().beginTransaction() .replace(R.id.item_detail_container, fragment) .commit(); } else { Context context = view.getContext(); Intent intent = new Intent(context, ItemDetailActivity.class); intent.putExtra("trackName", item.getTrackName()); intent.putExtra("artWork", item.getArtworkUrl100()); intent.putExtra("price", item.getTrackPrice()); intent.putExtra("description", item.getLongDescription()); intent.putExtra("genre", item.getPrimaryGenreName()); context.startActivity(intent); } } }; SimpleItemRecyclerViewAdapter(ItemListActivity parent, List<Results> results, boolean twoPane) { mValues = results; mParentActivity = parent; mTwoPane = twoPane; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_list_content, parent, false); return new ViewHolder(view); } @Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mIdView.setText(mValues.get(position).getArtistName()); holder.mContentView.setText("₱" + mValues.get(position).getTrackPrice()); Picasso.get().load(mValues.get(position).getArtworkUrl100()).resize(500,500).placeholder(R.drawable.images).into(holder.imageView); holder.itemView.setTag(mValues.get(position)); holder.itemView.setOnClickListener(mOnClickListener); } @Override public int getItemCount() { return mValues.size(); } class ViewHolder extends RecyclerView.ViewHolder { final TextView mIdView; final TextView mContentView; final ImageView imageView; ViewHolder(View view) { super(view); mIdView = (TextView) view.findViewById(R.id.id_text); mContentView = (TextView) view.findViewById(R.id.content); imageView = (ImageView) view.findViewById(R.id.imageView); } } } @Override public void processSong(boolean done, CallBackResponse callBackResponse) { setupRecyclerView((RecyclerView) recyclerView); } @Override public void setSongsToUI(SongInfo songInfo) { } private void setupRecyclerView(@NonNull RecyclerView recyclerView) { recyclerView.setAdapter(adapter); } }
[ "zamoranossydney@gmail.com" ]
zamoranossydney@gmail.com
593b744bcfd85716e134f95ff266d4e61de34fea
6ae4bad5c5a8ebd57701d1ac3f666267c17d4d63
/src/main/java/api/objects/Product.java
649358c3332fa59f16fabbda2bb7db8ea837c1fa
[]
no_license
0868307/ReceptApi
846c505d491bda6ed58900d9ac42aa3bf9eab01f
ada1f350248ac34fffd957f9ba3bd7c6647f9a86
refs/heads/master
2021-01-13T13:00:38.217346
2015-12-13T00:30:53
2015-12-13T00:30:53
47,900,131
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package api.objects; /** * Created by Wouter on 12/12/2015. */ public class Product extends Neo4jObject { private String unit; // unit( kg,L) neccesary for grocery list public Product(Long id, String name) { super(id, name); } public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } }
[ "0868307@hr.nl" ]
0868307@hr.nl
af6e015d771efad30280be562608f814597c5a58
dd4b50b6407479d4745317c04940f28380445165
/pac4j-oauth/src/test/java/org/pac4j/oauth/run/RunPaypalClient.java
5a0564c4fd1433f853cb35f4dfe9b0a9f487d3be
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
qmwu2000/pac4j
f3344b8204ac44a7ded0b53d03c45e1dab370dbb
7ec522cc7179c63014edfe1c0af3b2db1f006a3a
refs/heads/master
2021-01-17T06:36:52.321221
2016-03-05T08:41:13
2016-03-05T08:41:13
53,256,748
0
1
null
2016-03-06T13:41:42
2016-03-06T13:41:41
null
UTF-8
Java
false
false
2,696
java
package org.pac4j.oauth.run; import com.esotericsoftware.kryo.Kryo; import org.pac4j.core.client.IndirectClient; import org.pac4j.core.run.RunClient; import org.pac4j.core.profile.Gender; import org.pac4j.core.profile.ProfileHelper; import org.pac4j.core.profile.UserProfile; import org.pac4j.core.util.CommonHelper; import org.pac4j.oauth.client.PayPalClient; import org.pac4j.oauth.profile.paypal.PayPalAddress; import org.pac4j.oauth.profile.paypal.PayPalProfile; import java.util.Locale; import static org.junit.Assert.*; /** * Run manually a test for the {@link PayPalClient}. * * @author Jerome Leleu * @since 1.9.0 */ public final class RunPaypalClient extends RunClient { public static void main(String[] args) throws Exception { new RunPaypalClient().run(); } @Override protected String getLogin() { return "testscribeup@gmail.com"; } @Override protected String getPassword() { return "a1z2e3r4!$"; } @Override protected IndirectClient getClient() { final PayPalClient payPalClient = new PayPalClient( "ARQFlBAOdRsb1NhZlutHT_PORP2F-TQpU-Laz-osaBwAHUIBIdg-C8DEsTWY", "EAMZPBBfYJGeCBHYkm30xqC-VZ1kePnWZzPLdXyzY43rh-q0OQUH5eucXI6R"); payPalClient.setCallbackUrl(PAC4J_BASE_URL); return payPalClient; } @Override protected void registerForKryo(final Kryo kryo) { kryo.register(PayPalProfile.class); kryo.register(PayPalAddress.class); } @Override protected void verifyProfile(UserProfile userProfile) { final PayPalProfile profile = (PayPalProfile) userProfile; assertEquals("YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw", profile.getId()); assertEquals(PayPalProfile.class.getName() + UserProfile.SEPARATOR + "YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw", profile.getTypedId()); assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), PayPalProfile.class)); assertTrue(CommonHelper.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, "testscribeup@gmail.com", "Test", "ScribeUP", "Test ScribeUP", null, Gender.UNSPECIFIED, Locale.FRANCE, null, null, "Europe/Berlin"); final PayPalAddress address = profile.getAddress(); assertEquals("FR", address.getCountry()); assertEquals("Paris", address.getLocality()); assertEquals("75001", address.getPostalCode()); assertEquals("Adr1", address.getStreetAddress()); final Locale language = profile.getLanguage(); assertEquals(Locale.FRANCE, language); assertEquals(9, profile.getAttributes().size()); } }
[ "leleuj@gmail.com" ]
leleuj@gmail.com
35e79051d377bcf315401850578375be406e3131
bf67e54c2d5d9654ffc19b41fe7b4393060da272
/src/test/java/com/trycloud/tests/Mini/InitialTest.java
07383bee5ad438a0d0323c1c77ea94acdf64c82a
[]
no_license
SabryneRjeb/TryCloud_G5
ab4b9370a2902605e8031b4b092cc1e813808922
b3e56ad62bf66f116c8f87373c04f60ac69418b6
refs/heads/master
2023-03-08T20:46:58.531264
2021-02-04T19:52:13
2021-02-04T19:52:13
334,788,123
0
0
null
2021-02-08T06:43:12
2021-02-01T00:29:43
Java
UTF-8
Java
false
false
183
java
package com.trycloud.tests.Mini; public class InitialTest { public static void main(String[] args) { System.out.println("first commit"); //another commit } }
[ "74155239+minicandoit@users.noreply.github.com" ]
74155239+minicandoit@users.noreply.github.com
d132e68c3b11dbb15a2f5950fcc545cbc5b664a8
571fe02c6ead58dc8b7c3e57b9aab74c2d8ff5cd
/src/RiverCrossing/Story3.java
3739edb719f7e1f38761fe1600ef15275b9f68bb
[]
no_license
zixa5824/RiverCrossing-Project
9c867920dff8ef831408c3a1af597fa8f0e188fa
1216eefcc7e7ea3c1704bcb94ea8f834876b88a6
refs/heads/master
2022-01-10T23:15:00.998880
2019-05-04T19:59:55
2019-05-04T19:59:55
181,748,268
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package RiverCrossing; import java.util.List; public class Story3 implements ICrossingStrategy{ @Override public boolean isValid(List<ICrosser> rightBankCrossers, List<ICrosser> leftBankCrossers, List<ICrosser> boatRiders) { // TODO Auto-generated method stub return false; } @Override public List<ICrosser> getInitialCrossers() { // TODO Auto-generated method stub return null; } @Override public String[] getInstructions() { // TODO Auto-generated method stub return null; } }
[ "toti5824@gmail.com" ]
toti5824@gmail.com
6a8759cae8109aa8379afb372d3c89161960db6d
5137db576fe470e4dfb88181b4d7294b71373600
/src/test/java/IT/NewsControllerTest.java
bd7fed6d437514a0a1a0262c099e662656a81977
[]
no_license
Alexei-Fill/ProjectOne
0c5b97f4950dcfc23041c25f5e392d6bece1a652
48089a8fb001a37a2286b01e31cce9e369cdf675
refs/heads/master
2022-12-21T23:07:22.314236
2019-04-08T08:10:37
2019-04-08T08:10:37
166,208,744
0
0
null
2022-12-15T23:30:31
2019-01-17T10:40:50
Java
UTF-8
Java
false
false
5,907
java
package IT; import com.SpEx7.config.AppConfig; import com.SpEx7.config.WebMvcConfig; import com.SpEx7.config.WebSecurityConfig; import com.SpEx7.controller.NewsController; import com.SpEx7.entity.News; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mock.web.MockServletContext; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.util.NestedServletException; import javax.servlet.ServletContext; import java.time.LocalDate; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @RunWith(SpringJUnit4ClassRunner.class) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @ContextConfiguration(classes = {AppConfig.class, WebSecurityConfig.class, WebMvcConfig.class}) @WebAppConfiguration public class NewsControllerTest { @Autowired private WebApplicationContext wac; private MockMvc mockMvc; @Autowired NewsController newsController; News testNews = new News(190, "Test title", "Test brief", "Test content", LocalDate.now()); @Before public void setUp() throws Exception { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } @After public void tearDown() throws Exception { } @Test public void givenWac_whenServletContext_thenItProvidesNewsController() { ServletContext servletContext = wac.getServletContext(); Assert.assertNotNull(servletContext); Assert.assertTrue(servletContext instanceof MockServletContext); Assert.assertNotNull(wac.getBean("newsController")); } @Test public void NewsList_newsListExist_returnNewsList() throws Exception { mockMvc.perform(get("/newsList")) .andDo(print()) .andExpect(status().isOk()) .andExpect(view().name("newsList")); } @Test public void ShowAddNews_returnViewAndNewNews() throws Exception { mockMvc.perform(get("/showAddNews")) .andExpect(status().isOk()) .andExpect(view().name("editNews")) .andExpect(model().attributeExists("news")); } @Test public void ShowEditNews_returnViewAndNews() throws Exception { mockMvc.perform(get("/showEditNews/{id}", 179)) .andDo(print()) .andExpect(status().isOk()) .andExpect(view().name("editNews")); } @Test public void AddNews_allParametersFilled_addNewsAndRedirectToMain() throws Exception { mockMvc.perform(post("/editAddNews") .param("id", String.valueOf(testNews.getId())) .param("title","testtesttesttesttesttesttesttesttst") .param("content", "testtesttesttesttesttesttesttesttesttesttesttesttesttest") .param("brief", "testtesttesttesttesttesttesttest") .param("date", String.valueOf(LocalDate.now()))) .andDo(print()) .andExpect(status().isFound()) .andExpect(redirectedUrl(" /newsList")); } @Test public void EditNews_allParametersFilled_addNewsAndRedirectToMain() throws Exception { mockMvc.perform(post("/editAddNews") .param("id", String.valueOf(testNews.getId())) .param("title",testNews.getTitle()) .param("content", testNews.getContent()) .param("brief", testNews.getBrief()) .param("date", String.valueOf(testNews.getDate()))) .andDo(print()) .andExpect(status().isFound()) .andExpect(redirectedUrl(" /newsList")); } @Test public void DeleteNews_removedNewsIdsExist_deleteNewsAndRedirectToMain() throws Exception { mockMvc.perform(post("/deleteNews") .param("removedNews", "179")) .andDo(print()) .andExpect(status().isFound()) .andExpect(redirectedUrl(" /newsList")); } @Test public void DeleteNews_removedNewsDoesNotExist_RedirectToMain() throws Exception { mockMvc.perform(post("/deleteNews")) .andDo(print()) .andExpect(status().isFound()) .andExpect(redirectedUrl(" /newsList")); } @Test public void ShowNews_NewsByIdExist_returnViewNewsAndNews() throws Exception { mockMvc.perform(get("/news/{id}", 190)) .andDo(print()) .andExpect(status().isOk()) .andExpect(view().name("news")) .andExpect(model().attribute("news", testNews)); } @Test(expected = NestedServletException.class) public void ShowNews_NewsDoesNotExist_returnViewNewsAndNews() throws Exception { News testNews = new News(1, "Test title", "Test brief", "Test content", LocalDate.now()); mockMvc.perform(get("/news/{id}", 2)) .andDo(print()) .andExpect(status().isOk()) .andExpect(view().name("news")) .andExpect(model().attributeDoesNotExist("news")); } }
[ "alex.fill.27@gmail.com" ]
alex.fill.27@gmail.com
10f525383e1b46f6e2d4f0802a4f039a779ce8b1
bb993db072724f50ed9c7ba596a14bd50b726771
/core/src/com/pocketbeach/game/Genotype.java
6cb9be60e9ae4dbd5c3f222bf2286291dd505976
[]
no_license
PhilipGarnero/PocketBeach
1230e3881ec1870fbdbb356d59d064bda3c56407
ac08697c287d9d2865e6b2cf40db4f8dbc09e3e2
refs/heads/master
2021-05-31T04:08:20.825314
2016-05-06T10:20:29
2016-05-06T10:22:09
57,350,336
0
0
null
null
null
null
UTF-8
Java
false
false
6,511
java
package com.pocketbeach.game; import com.pocketbeach.game.phenotypes.Brain; import com.pocketbeach.game.phenotypes.Features; import com.pocketbeach.game.phenotypes.PhysicalBody; import com.pocketbeach.game.phenotypes.Vitals; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; public class Genotype { public final static float GENE_MUTATION_PROB = 0.40f; private final static float GENE_CROSSOVER_PROB = 0.70f; private final static float GENE_IF_CROSSOVER_DOUBLE_PROB = 0.50f; private final static float GENE_IF_CROSSOVER_AND_DOUBLE_UNBALANCED_PROB = 0.30f; public final static String GENE_CHAR_POOL = "0123456789ABCDEF"; public final static int GENE_BASE = GENE_CHAR_POOL.length(); private final static String GENE_SEP = "Z"; private final HashMap<String, String> GENE_PHENOTYPES_IDS = new HashMap<String, String>(); public String dna; private HashMap<String, ArrayList<String>> genes = new HashMap<String, ArrayList<String>>(); public Actor individual = null; public Genotype(String dna) { this.GENE_PHENOTYPES_IDS.put("body", "1"); this.GENE_PHENOTYPES_IDS.put("brain", "2"); this.GENE_PHENOTYPES_IDS.put("vitals", "3"); this.GENE_PHENOTYPES_IDS.put("features", "4"); this.dna = dna; if (this.dna == null) this.dna = this.generateDna(); this.genes = this.extractGenes(this.dna); } private String generateDna() { String dna = ""; // dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("body") + PhysicalBody.GeneCoder.generateRandomDNA() + GENE_SEP; dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("brain") + Brain.GeneCoder.generateRandomDNA() + GENE_SEP; dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("vitals") + Vitals.GeneCoder.generateRandomDNA() + GENE_SEP; dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("features") + Features.GeneCoder.generateRandomDNA() + GENE_SEP; return dna; } private HashMap<String, ArrayList<String>> extractGenes(String dna) { HashMap<String, ArrayList<String>> genes = new HashMap<String, ArrayList<String>>(); ArrayList<String> dnaSeq = new ArrayList<String>(Arrays.asList(dna.split(""))); dnaSeq.remove(0); String gene = ""; String geneId = ""; boolean inGeneSequence = false; while (!dnaSeq.isEmpty()) { String code = dnaSeq.get(0); dnaSeq.remove(0); if (code.equals(GENE_SEP) && !inGeneSequence) { inGeneSequence = true; geneId = ""; gene = ""; } else if (code.equals(GENE_SEP) && inGeneSequence) { if (!geneId.isEmpty() && !gene.isEmpty()) genes.get(geneId).add(gene); inGeneSequence = false; } else if (inGeneSequence && geneId.isEmpty()) { geneId = code; if (!genes.containsKey(geneId)) genes.put(geneId, new ArrayList<String>()); } else if (inGeneSequence) { gene = gene + code; } } return genes; } private ArrayList<String> getGenesForPhenotype(String name) { ArrayList<String> pGenes = this.genes.get(this.GENE_PHENOTYPES_IDS.get(name)); if (pGenes == null) pGenes = new ArrayList<String>(); return pGenes; } public Object getPhenotype(String name, Actor actor) { if (name.equals("brain")) { return new Brain(this.getGenesForPhenotype("brain"), actor); } else if (name.equals("body")) { return new PhysicalBody(this.getGenesForPhenotype("body"), actor); } else if (name.equals("vitals")) { return new Vitals(this.getGenesForPhenotype("vitals"), actor); } else if (name.equals("features")) { return new Features(this.getGenesForPhenotype("features"), actor); } return null; } private void mutate() { if (this.individual != null) { this.dna = ""; // this.dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("body") + this.individual.body.mutateDNAFromPhenotype() + GENE_SEP; this.dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("brain") + this.individual.brain.mutateDNAFromPhenotype() + GENE_SEP; this.dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("vitals") + this.individual.vitals.mutateDNAFromPhenotype() + GENE_SEP; this.dna += GENE_SEP + this.GENE_PHENOTYPES_IDS.get("features") + this.individual.features.mutateDNAFromPhenotype() + GENE_SEP; this.genes = this.extractGenes(this.dna); } } private static String crossover(String fatherDna, String motherDna) { String childDna; int max_cut = Math.min(fatherDna.length(), motherDna.length()) - 1; int cut1, cut2, cut3; if (com.pocketbeach.game.Rand.rNorm() > GENE_CROSSOVER_PROB) { cut1 = com.pocketbeach.game.Rand.rInt(0, max_cut); if (com.pocketbeach.game.Rand.rNorm() > GENE_IF_CROSSOVER_DOUBLE_PROB) { cut2 = com.pocketbeach.game.Rand.rInt(0, max_cut); if (cut2 < cut1) { cut1 = cut1 + cut2; cut2 = cut1 - cut2; cut1 = cut1 - cut2; } if (com.pocketbeach.game.Rand.rNorm() > GENE_IF_CROSSOVER_AND_DOUBLE_UNBALANCED_PROB) { cut3 = com.pocketbeach.game.Rand.rInt(0, max_cut); if (cut3 < cut1) { cut1 = cut1 + cut3; cut3 = cut1 - cut3; cut1 = cut1 - cut3; } childDna = fatherDna.substring(0, cut1) + motherDna.substring(cut1, cut2) + fatherDna.substring(cut3); } else childDna = fatherDna.substring(0, cut1) + motherDna.substring(cut1, cut2) + fatherDna.substring(cut2); } else childDna = fatherDna.substring(0, cut1) + motherDna.substring(cut1); } else { String[] ch = {fatherDna, motherDna}; childDna = com.pocketbeach.game.Rand.rChoice(Arrays.asList(ch)); } return childDna; } public static Genotype reproduce(Genotype father, Genotype mother) { father.mutate(); mother.mutate(); return new Genotype(crossover(father.dna, mother.dna)); } }
[ "philip.garnero@gmail.com" ]
philip.garnero@gmail.com
0c7dd0f82eed6b47eec254079dcf40dcb95ac1c5
b9d8c9dfd6c17ea40c1eac9bb3c085a922721035
/SmartFramework/src/main/java/com/rwt/smartframework/util/PropsUtil.java
80a4ef29536c292709226fbba724690396b985f2
[]
no_license
rwtgithub/smart_framework
d97d98ddda7b8efdc0a9061bbf3f659f34b68e50
f89f111049e51606abadd8500e05851599d55cb0
refs/heads/master
2020-03-31T13:24:27.184111
2018-10-10T13:10:37
2018-10-10T13:10:37
152,254,322
0
0
null
null
null
null
UTF-8
Java
false
false
1,818
java
package com.rwt.smartframework.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /* 属性文件工具类 */ public class PropsUtil { private static final Logger logger = LoggerFactory.getLogger(PropsUtil.class); /* 加载属性文件 */ public static Properties loadProps(String filename) { Properties properties = null; InputStream is = null; try { is = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename); if (is == null) { throw new FileNotFoundException(filename + "file is not found"); } properties = new Properties(); properties.load(is); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { logger.error("load properties file failure", e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { logger.error("close inputstream failure ", e); } } } return properties; } /* *获取字符型属性(默认值为空) * */ public static String getString(Properties properties, String key) { return getString(properties, key, ""); } /* * 获取字符属性(可指定默认值) * */ public static String getString(Properties properties, String key, String defaultValue) { String value = defaultValue; if (properties.containsKey(key)) { value = properties.getProperty(key); } return value; } }
[ "1019908255@qq.com" ]
1019908255@qq.com
de762c7bb781b36caf0ce74c6936ddcd92fbc5f5
ed3240a7cbf90ec71bb2c3e4c0d0c7dfe50b308d
/Swing14-WorkingWithListData/src/main/java/com/jin/MainFrame.java
c38144da1e71df5c661eb1fbb6b69318aa3196cb
[]
no_license
cicadasworld/java-swing-demo
85ae5ab1586cf75ba55d0520ae7d93458ef79ec2
f2f374942a237ab20a9ce733e820eacccdb4afd4
refs/heads/master
2022-11-11T22:03:54.867406
2020-06-26T10:20:54
2020-06-26T10:20:54
275,127,960
0
0
null
null
null
null
UTF-8
Java
false
false
1,087
java
package com.jin; import java.awt.*; import javax.swing.*; public class MainFrame extends JFrame { private final TextPanel textPanel; private final Toolbar toolbar; private final FormPanel formPanel; public MainFrame() { super("Hello World"); this.setLayout(new BorderLayout()); toolbar = new Toolbar(); textPanel = new TextPanel(); formPanel = new FormPanel(); toolbar.setTextListener(textPanel::appendText); formPanel.setFormListener(e -> { String name = e.getName(); String occupation = e.getOccupation(); int ageCat = e.getAgeCategory(); textPanel.appendText(name + ": " + occupation + ": " + ageCat + "\n"); }); this.add(formPanel, BorderLayout.WEST); this.add(toolbar, BorderLayout.NORTH); this.add(textPanel, BorderLayout.CENTER); this.setSize(600, 500); this.setLocationRelativeTo(null); // To center this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } }
[ "flyterren@163.com" ]
flyterren@163.com
ac1b63676c8fdb02a26aae99930134199534c20b
c576f2b0663b7bad90d148e422cdb307d1f8d43a
/src/main/java/javax/measure/quantity/ElectricCharge.java
66e189ab4a81896796c63f61789989ee91f64b1f
[ "BSD-2-Clause" ]
permissive
chrisdennis/unit-api
03dc61a960f046e77c4c57bbbd2a9bbf06253050
21c64b06eaa09cc0e141d91429c19c0d0d65f7a7
refs/heads/master
2021-01-17T08:21:35.438165
2015-11-10T21:00:21
2015-11-10T21:00:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,967
java
/* * Units of Measurement API * Copyright (c) 2014-2015, Jean-Marie Dautelle, Werner Keil, V2COM. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. 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. * * 3. Neither the name of JSR-363 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 HOLDER 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 javax.measure.quantity; import javax.measure.Quantity; /** * Electric charge. * The metric system unit for this quantity is "C" (Coulomb). * * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a> * @version 1.0 * * @see ElectricCurrent */ public interface ElectricCharge extends Quantity<ElectricCharge> { }
[ "werner.keil@gmx.net" ]
werner.keil@gmx.net
b4be311794c30cd9b5833e6c518837bdeca5db1c
53de8abfd7e9b6118cdd0594efac42506442c114
/semantic-annotation-pipeline/src/clus/jeans/resource/SoundList.java
2ab5e2130c27da2f1263e238568ed896f7d60c52
[]
no_license
KostovskaAna/MLC-data-catalog
b1bd6975880c99064852d5658a96946816c38ece
e272a679a5cf37df2bdb4d74a5dbe97df5a3089d
refs/heads/master
2023-08-28T00:25:14.488153
2021-10-28T13:13:20
2021-10-28T13:13:20
418,416,615
0
0
null
null
null
null
UTF-8
Java
false
false
2,890
java
/************************************************************************* * Clus - Software for Predictive Clustering * * Copyright (C) 2007 * * Katholieke Universiteit Leuven, Leuven, Belgium * * Jozef Stefan Institute, Ljubljana, Slovenia * * * * 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 3 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, see <http://www.gnu.org/licenses/>. * * * * Contact information: <http://www.cs.kuleuven.be/~dtai/clus/>. * *************************************************************************/ package clus.jeans.resource; import java.applet.Applet; import java.applet.AudioClip; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.Hashtable; /** * Loads and holds a bunch of audio files whose locations are specified * relative to a fixed base URL. */ public class SoundList { Applet applet; URL baseURL; Hashtable table = new Hashtable(); private static SoundList instance = null; public static SoundList getInstance() { if (instance == null) instance = new SoundList(); return instance; } private SoundList() { } public void setApplet(Applet applet) { this.applet = applet; } public void setDirectory(URL codeBase, String dir) { try { baseURL = new URL(codeBase, dir); } catch (MalformedURLException e) {} } public void getDirectory(String dir) { try { URL crDir = new File(".").toURL(); baseURL = new URL(crDir, dir); } catch (MalformedURLException e) {} } public void startLoading(String relativeURL) throws MalformedURLException { AudioClip audioClip = null; if (applet == null) { audioClip = Applet.newAudioClip(new URL(baseURL, relativeURL)); } else { audioClip = applet.getAudioClip(baseURL, relativeURL); } if (audioClip == null) { System.out.println("Error loading audio clip: " + relativeURL); } putClip(audioClip, relativeURL); } public AudioClip getClip(String relativeURL) { return (AudioClip) table.get(relativeURL); } private void putClip(AudioClip clip, String relativeURL) { table.put(relativeURL, clip); } }
[ "anakostovska2@gmail.com" ]
anakostovska2@gmail.com
3319b65ed971124ca03d93936fa7b39203f24266
dfd7e70936b123ee98e8a2d34ef41e4260ec3ade
/analysis/reverse-engineering/decompile-fitts-20191031-2200/sources/com/google/android/gms/internal/clearcut/zzaw.java
b796b6ede82816697b8f99576cbaad1c1f44d7a0
[ "Apache-2.0" ]
permissive
skkuse-adv/2019Fall_team2
2d4f75bc793368faac4ca8a2916b081ad49b7283
3ea84c6be39855f54634a7f9b1093e80893886eb
refs/heads/master
2020-08-07T03:41:11.447376
2019-12-21T04:06:34
2019-12-21T04:06:34
213,271,174
5
5
Apache-2.0
2019-12-12T09:15:32
2019-10-07T01:18:59
Java
UTF-8
Java
false
false
557
java
package com.google.android.gms.internal.clearcut; final class zzaw { private static final Class<?> zzfb = zze("libcore.io.Memory"); private static final boolean zzfc = (zze("org.robolectric.Robolectric") != null); private static <T> Class<T> zze(String str) { try { return Class.forName(str); } catch (Throwable unused) { return null; } } static boolean zzx() { return zzfb != null && !zzfc; } static Class<?> zzy() { return zzfb; } }
[ "33246398+ajid951125@users.noreply.github.com" ]
33246398+ajid951125@users.noreply.github.com
0897c782530f698905e80c24b05725e1a5664ef5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_d8ae23220bf8ce9762ecacab5d4f52ed26863824/WebApplication/4_d8ae23220bf8ce9762ecacab5d4f52ed26863824_WebApplication_t.java
ec5c83442b747c7fcb40983e44078ad385837b74
[]
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
37,574
java
package org.ruhlendavis.mc.communitybridge; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.sql.ResultSet; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import net.netmanagers.api.SQL; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.ruhlendavis.mc.utility.Log; import org.ruhlendavis.utility.StringUtilities; /** * Class representing the interface to the web application. * * @author Feaelin (Iain E. Davis) <iain@ruhlendavis.org> */ public class WebApplication { private CommunityBridge plugin; private Configuration config; private Log log; private SQL sql; private int maxPlayers; private Map<String, String> playerUserIDs = new HashMap(); public WebApplication(CommunityBridge plugin, Configuration config, Log log, SQL sql) { this.config = config; this.plugin = plugin; this.log = log; setSQL(sql); this.maxPlayers = Bukkit.getMaxPlayers(); } /** * Returns a given player's web application user ID. * * @param String containing the player's name. * @return String containing the player's web application user ID. */ public String getUserID(String playerName) { if (playerUserIDs.containsKey(playerName)) {} else { loadUserIDfromDatabase(playerName); } return playerUserIDs.get(playerName); } /** * Returns true if the user's avatar column contains data. * * @param String The player's name. * @return boolean True if the user has an avatar. */ public boolean playerHasAvatar(String playerName) { final String errorBase = "Error during WebApplication.playerHasAvatar(): "; String query; query = "SELECT `" + config.requireAvatarTableName + "`.`" + config.requireAvatarAvatarColumn + "` " + "FROM `" + config.requireAvatarTableName + "` " + "WHERE `" + config.requireAvatarUserIDColumn + "` = '" + getUserID(playerName) + "'"; log.finest(query); try { String avatar = null; ResultSet result = sql.sqlQuery(query); if (result.next()) { avatar = result.getString(config.requireAvatarAvatarColumn); } if (avatar == null || avatar.isEmpty()) { return false; } else { return true; } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return false; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return false; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return false; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return false; } } /** * Fetches the user's post count from the web application. * * @param String The player's name. * @return int Number of posts. */ public int getUserPostCount(String playerName) { final String errorBase = "Error during WebApplication.getUserPostCount(): "; String query; query = "SELECT `" + config.requirePostsTableName + "`.`" + config.requirePostsPostCountColumn + "` " + "FROM `" + config.requirePostsTableName + "` " + "WHERE `" + config.requirePostsUserIDColumn + "` = '" + getUserID(playerName) + "'"; log.finest(query); try { ResultSet result = sql.sqlQuery(query); if (result.next()) { return result.getInt(config.requirePostsPostCountColumn); } else { return 0; } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return 0; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return 0; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return 0; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return 0; } } /** * Retrieves a player's primary group ID from the web application database. * * @param String player name to retrieve. * @return String containing the group ID or null if there was an error or it doesn't exist. */ public String getUserPrimaryGroupID(String playerName) { if (config.webappPrimaryGroupEnabled) {} else { return ""; } final String errorBase = "Error during WebApplication.getUserPrimaryGroupID(): "; String query; if (config.webappPrimaryGroupUsesKey) { query = "SELECT `" + config.webappPrimaryGroupGroupIDColumn + "` " + "FROM `" + config.webappPrimaryGroupTable + "` " + "WHERE `" + config.webappPrimaryGroupUserIDColumn + "` = '" + getUserID(playerName) + "' " + "AND `" + config.webappPrimaryGroupKeyColumn + "` = '" + config.webappPrimaryGroupKeyName + "' "; } else { query = "SELECT `" + config.webappPrimaryGroupGroupIDColumn + "` " + "FROM `" + config.webappPrimaryGroupTable + "` " + "WHERE `" + config.webappPrimaryGroupUserIDColumn + "` = '" + getUserID(playerName) + "'"; } log.finest(query); try { ResultSet result = sql.sqlQuery(query); if (result.next()) { return result.getString(config.webappPrimaryGroupGroupIDColumn); } else { return ""; } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return ""; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return ""; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return ""; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return ""; } } public List getUserGroupIDs(String playerName) { if (config.webappSecondaryGroupEnabled) {} else { return null; } if (config.webappSecondaryGroupStorageMethod.startsWith("sin")) { return getUserGroupIDsSingleColumn(playerName); } else if (config.webappSecondaryGroupStorageMethod.startsWith("jun")) { return getUserGroupIDsJunction(playerName); } else if (config.webappSecondaryGroupStorageMethod.startsWith("mul")) { return getUserGroupIDsKeyValue(playerName); } log.severe("Invalid storage method for secondary groups."); return null; } private List getUserGroupIDsSingleColumn(String playerName) { final String errorBase = "Error during WebApplication.getUserGroupIDsSingleColumn(): "; String query; query = "SELECT `" + config.webappSecondaryGroupGroupIDColumn + "` " + "FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + getUserID(playerName) + "' "; log.finest(query); try { ResultSet result = sql.sqlQuery(query); if (result.next()) { return new ArrayList(Arrays.asList(result.getString(config.webappSecondaryGroupGroupIDColumn).split(config.webappSecondaryGroupGroupIDDelimiter))); } else { return null; } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return null; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return null; } } private List getUserGroupIDsJunction(String playerName) { final String errorBase = "Error during WebApplication.getUserGroupIDsJunction(): "; String query; query = "SELECT `" + config.webappSecondaryGroupGroupIDColumn + "` " + "FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + getUserID(playerName) + "' "; log.finest(query); try { ResultSet result = sql.sqlQuery(query); List groupIDs = new ArrayList(); while (result.next()) { groupIDs.add(result.getString(config.webappSecondaryGroupGroupIDColumn)); } return groupIDs; } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return null; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return null; } } private List getUserGroupIDsKeyValue(String playerName) { final String errorBase = "Error during WebApplication.getUserGroupIDsKeyValue(): "; String query; query = "SELECT `" + config.webappSecondaryGroupGroupIDColumn + "` " + "FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + getUserID(playerName) + "' " + "AND `" + config.webappSecondaryGroupKeyColumn + "` = '" + config.webappSecondaryGroupKeyName + "' "; log.finest(query); try { ResultSet result = sql.sqlQuery(query); List groupIDs = new ArrayList(); while (result.next()) { groupIDs.add(result.getString(config.webappSecondaryGroupGroupIDColumn)); } return groupIDs; } catch (SQLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); return null; } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); return null; } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); return null; } } /** * Returns true if the player is registered on the web application. * @param String The name of the player. * @return boolean True if the player is registered. */ public boolean isPlayerRegistered(String playerName) { return !(getUserID(playerName) == null || getUserID(playerName).isEmpty()); } /** * Retrieves user IDs for all connected players, required after a cache * cleanup and after cb reload. */ public synchronized void loadOnlineUserIDsFromDatabase() { Player [] players = Bukkit.getOnlinePlayers(); for (Player player : players) { loadUserIDfromDatabase(player.getName()); } } /** * Performs the database query that should be done when a player connects. * * @param String containing the player's name. */ public synchronized void loadUserIDfromDatabase(String playerName) { if (playerUserIDs.size() >= (maxPlayers * 4)) { playerUserIDs.clear(); loadOnlineUserIDsFromDatabase(); } final String errorBase = "Error during WebApplication.onPreLogin(): "; String query = "SELECT `" + config.linkingTableName + "`.`" + config.linkingUserIDColumn + "` " + "FROM `" + config.linkingTableName + "` "; if (config.linkingUsesKey) { query = query + "WHERE `" + config.linkingKeyColumn + "` = '" + config.linkingKeyName + "' " + "AND `" + config.linkingValueColumn + "` = '" + playerName + "' "; } else { query = query + "WHERE LOWER(`" + config.linkingPlayerNameColumn + "`) = LOWER('" + playerName + "') "; } query = query + "ORDER BY `" + config.linkingUserIDColumn + "` DESC"; log.finest(query); try { String userID = null; ResultSet result = sql.sqlQuery(query); if (result.next()) { userID = result.getString(config.linkingUserIDColumn); } if (userID == null) { log.finest("User ID for " + playerName + " not found."); } else { log.finest("User ID '" + userID + "' associated with " + playerName + "."); playerUserIDs.put(playerName, userID); } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } // loadUserIDfromDatabase() /** * Performs operations when a player joins * * @param String The player who joined. */ public void onJoin(final Player player) { runGroupSynchronizationTask(player); runUpdateStatisticsTask(player, true); } /** * Performs operations when a player quits. * * @param String containing the player's name. */ public void onQuit(Player player) { runUpdateStatisticsTask(player, false); } /** * If statistics is enabled, this method sets up an update statistics task * for the given player. * * @param String The player's name. */ private void runGroupSynchronizationTask(final Player player) { if (config.webappPrimaryGroupEnabled || config.webappSecondaryGroupEnabled) { Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @Override public void run() { synchronizeGroups(player); } }); } } /** * If statistics is enabled, this method sets up an update statistics task * for the given player. * * @param String The player's name. */ private void runUpdateStatisticsTask(final Player player, final boolean online) { if (config.statisticsEnabled) { Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @Override public void run() { updateStatistics(player, online); } }); } } /** * Sets the SQL object. Typically used during a reload. * * @param SQL SQL object to set. */ public final void setSQL(SQL sql) { this.sql = sql; } private void setPrimaryGroup(String userID, String groupID) { String errorBase = "Error during setPrimaryGroup(): "; try { if (config.webappPrimaryGroupUsesKey) { String query = "UPDATE `" + config.webappPrimaryGroupTable + "` " + "SET `" + config.webappPrimaryGroupGroupIDColumn + "` = '" + groupID + "' " + "WHERE `" + config.webappPrimaryGroupKeyColumn + "` = '" + config.webappPrimaryGroupKeyName + "' " + "AND `" + config.webappPrimaryGroupUserIDColumn + "` = '" + userID + "'"; log.finest(query); sql.updateQuery(query); } else { String query = "UPDATE `" + config.webappPrimaryGroupTable + "` " + "SET `" + config.webappPrimaryGroupGroupIDColumn + "` = '" + groupID + "' " + "WHERE `" + config.webappPrimaryGroupUserIDColumn + "` = '" + userID + "' "; log.finest(query); sql.updateQuery(query); } } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } private void synchronizeGroups(Player player) { String playerName = player.getName(); String userID = getUserID(playerName); File playerFolder = new File(plugin.getDataFolder(), "Players"); // 1. Retrieve previous group state for forum groups and permissions groups. PlayerGroupState previousState = new PlayerGroupState(playerName, playerFolder); previousState.load(); // 2. Capture current group state PlayerGroupState currentState = new PlayerGroupState(playerName, playerFolder); currentState.generate(); // 3. Synchronize primary group state if (config.webappPrimaryGroupEnabled) { if (previousState.webappPrimaryGroupID.equals(currentState.webappPrimaryGroupID)) {} else { String formerGroupName = config.getGroupNameByGroupID(previousState.webappPrimaryGroupID); String newGroupName = config.getGroupNameByGroupID(currentState.webappPrimaryGroupID); if (formerGroupName == null) { log.warning("Not changing permissions group due to permissions system group name lookup failure for web application group ID: " + previousState.webappPrimaryGroupID); } else if (newGroupName == null) { log.warning("Not changing permissions group due to permissions system group name lookup failure for web application group ID: " + currentState.webappPrimaryGroupID); } else { CommunityBridge.permissionHandler.setPrimaryGroup(playerName, newGroupName, formerGroupName); log.fine("Moved player '" + playerName + "' from permissions group '" + formerGroupName + "' to permissions group '" + newGroupName + "'."); if (config.simpleSynchronizationPrimaryGroupNotify) { String message = ChatColor.YELLOW + CommunityBridge.config.messages.get("group-synchronization-primary-notify-player"); message = message.replace("~FORMERGROUPNAME~", formerGroupName); message = message.replace("~GROUPNAME~", newGroupName); player.sendMessage(message); } } } if (previousState.permissionsSystemPrimaryGroupName.equals(currentState.permissionsSystemPrimaryGroupName)) {} else { String groupID = config.getWebappGroupIDbyGroupName(currentState.permissionsSystemPrimaryGroupName); if (groupID == null) { log.warning("Not changing web application group due to web application group ID lookup failure for: " + currentState.permissionsSystemPrimaryGroupName); } else { setPrimaryGroup(userID, groupID); log.fine("Moved player '" + playerName + "' to web application group ID '" + groupID + "'."); } } } // 4. Synchronize secondary group state if (config.webappSecondaryGroupEnabled) { for(String groupName : previousState.permissionsSystemGroupNames) { if (currentState.permissionsSystemGroupNames.contains(groupName)) {} else { removeGroup(userID, groupName); } } for (String groupName : currentState.permissionsSystemGroupNames) { if (previousState.permissionsSystemGroupNames.contains(groupName)) {} else { addGroup(userID, groupName, currentState.webappGroupIDs.size()); } } for(String groupID : previousState.webappGroupIDs) { if (currentState.webappGroupIDs.contains(groupID)) {} else { String groupName = config.getGroupNameByGroupID(groupID); CommunityBridge.permissionHandler.removeFromGroup(playerName, groupName); } } for(String groupID : currentState.webappGroupIDs) { if (previousState.webappGroupIDs.contains(groupID)) {} else { String groupName = config.getGroupNameByGroupID(groupID); CommunityBridge.permissionHandler.addToGroup(playerName, groupName); } } } // 5. Save newly created state currentState.generate(); try { currentState.save(); } catch (IOException error) { log.severe("Error when saving group state for player " + playerName + ": " + error.getMessage()); } } /** * Handles adding a group to the user's group list on the web application. * * @param String Name from permissions system of group added. */ private void addGroup(String userID, String groupName, int currentGroupCount) { String groupID = config.getWebappGroupIDbyGroupName(groupName); String errorBase = "Error during addGroup(): "; try { if (config.webappSecondaryGroupStorageMethod.startsWith("sin")) { if (currentGroupCount > 0) { groupID = config.webappSecondaryGroupGroupIDDelimiter + groupID; } String query = "UPDATE `" + config.webappSecondaryGroupTable + "` " + "SET `" + config.webappSecondaryGroupGroupIDColumn + "` = CONCAT(`" + config.webappSecondaryGroupGroupIDColumn + "`, '" + groupID + "') " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + userID + "'"; log.finest(query); sql.updateQuery(query); } else if (config.webappSecondaryGroupStorageMethod.startsWith("jun")) { String query = "INSERT INTO `" + config.webappSecondaryGroupTable + "` " + "(`" + config.webappSecondaryGroupUserIDColumn + "`, `" + config.webappSecondaryGroupGroupIDColumn + "`) " + "VALUES ('" + userID + "', '" + groupID +"')"; log.finest(query); sql.insertQuery(query); } else if (config.webappSecondaryGroupStorageMethod.startsWith("mul")) { String query = "INSERT INTO `" + config.webappSecondaryGroupTable + "` " + "(`" + config.webappSecondaryGroupUserIDColumn + "`, `" + config.webappPrimaryGroupKeyColumn + "`, `" + config.webappSecondaryGroupGroupIDColumn + "`) " + "VALUES ('" + userID + "', '" + config.webappSecondaryGroupKeyName + "', '" + groupID + "')"; log.finest(query); sql.insertQuery(query); } } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } /** * Handles removing a group from the user's group list on the web application. * * @param String Name from permissions system of group to remove. */ private void removeGroup(String userID, String groupName) { String groupID = config.getWebappGroupIDbyGroupName(groupName); String errorBase = "Error during addGroup(): "; try { if (config.webappSecondaryGroupStorageMethod.startsWith("sin")) { String groupIDs; String query = "SELECT `" + config.webappSecondaryGroupGroupIDColumn + "` " + "FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + userID + "'"; log.finest(query); ResultSet result = sql.sqlQuery(query); if (result.next()) { groupIDs = result.getString(config.webappSecondaryGroupGroupIDColumn); List<String> groupIDsAsList = new ArrayList(Arrays.asList(groupIDs.split(config.webappSecondaryGroupGroupIDDelimiter))); groupIDsAsList.remove(groupID); groupIDs = StringUtilities.joinStrings(groupIDsAsList, config.webappSecondaryGroupGroupIDDelimiter); query = "UPDATE `" + config.webappSecondaryGroupTable + "` " + " SET `" + config.webappSecondaryGroupGroupIDColumn + "` = '" + groupIDs + "'"; log.finest(query); sql.updateQuery(query); } } else if (config.webappSecondaryGroupStorageMethod.startsWith("jun")) { String query = "DELETE FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupUserIDColumn + "` = '" + userID + "' " + "AND `" + config.webappSecondaryGroupGroupIDColumn + "` = '" + groupID + "' "; log.finest(query); sql.deleteQuery(query); } else if (config.webappSecondaryGroupStorageMethod.startsWith("mul")) { String query = "DELETE FROM `" + config.webappSecondaryGroupTable + "` " + "WHERE `" + config.webappSecondaryGroupKeyColumn + "` = '" + config.webappSecondaryGroupKeyName + "' " + "AND `" + config.webappSecondaryGroupGroupIDColumn + "` = '" + groupID + "' "; log.finest(query); sql.deleteQuery(query); } } catch (SQLException error) { log.severe(errorBase + error.getMessage()); } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } /** * Update the player's statistical information on the forum. * * @param String Name of player to update * @param boolean Set to true if the player is currently online */ private void updateStatistics(Player player, boolean online) { String query; ResultSet result; String playerName = player.getName(); String userID = getUserID(playerName); int previousLastOnline = 0; int previousGameTime = 0; // If gametime is enabled, it depends on lastonline. Also, we need to // retrieve previously recorded lastonline time and the previously // recorded gametime to compute the new gametime. if (config.gametimeEnabled) { if (config.statisticsUsesKey) { query = "SELECT `" + config.statisticsKeyColumn + "`, `" + config.statisticsValueColumn + " FROM `" + config.statisticsTableName + "`" + " WHERE `" + config.statisticsUserIDColumn + "` = '" + userID + "'"; try { result = sql.sqlQuery(query); while (result.next()) { String key = result.getString(config.statisticsKeyColumn); if (key.equalsIgnoreCase(config.lastonlineColumnOrKey)) { previousLastOnline = result.getInt(config.statisticsValueColumn); } else if (key.equalsIgnoreCase(config.gametimeColumnOrKey)) { previousGameTime = result.getInt(config.statisticsValueColumn); } } } catch (SQLException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (MalformedURLException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (InstantiationException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (IllegalAccessException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } } else { query = "SELECT `" + config.lastonlineColumnOrKey + "`, `" + config.gametimeColumnOrKey + "`" + " FROM `" + config.statisticsTableName + "`" + " WHERE `" + config.statisticsUserIDColumn + "` = '" + userID + "'"; try { result = sql.sqlQuery(query); if (result.next()) { previousLastOnline = result.getInt(config.lastonlineColumnOrKey); previousGameTime = result.getInt(config.gametimeColumnOrKey); } } catch (SQLException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (MalformedURLException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (InstantiationException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } catch (IllegalAccessException error) { log.severe("Error in UpdateStatistics() during retrieval: " + error.getMessage()); } } } SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss a"); String onlineStatus; if (online) { onlineStatus = config.onlineStatusValueOnline; } else { onlineStatus = config.onlineStatusValueOffline; } // last online int lastonlineTime = (int) (System.currentTimeMillis() / 1000L); String lastonlineTimeFormatted = dateFormat.format(new Date()); // game time (time played) int gametime = 0; if (previousLastOnline > 0) { gametime = previousGameTime + (lastonlineTime - previousLastOnline); } String gametimeFormatted = StringUtilities.timeElapsedtoString (gametime); int level = player.getLevel(); int totalxp = player.getTotalExperience(); float currentxp = player.getExp(); String currentxpFormatted = ((int)(currentxp * 100)) + "%"; int health = player.getHealth(); int lifeticks = player.getTicksLived(); String lifeticksFormatted = StringUtilities.timeElapsedtoString((int)(lifeticks / 20)); double wallet = 0.0; if (config.walletEnabled) { wallet = CommunityBridge.economy.getBalance(playerName); } if (config.statisticsUsesKey) { updateStatisticsKeyStyle(userID, onlineStatus, lastonlineTime, lastonlineTimeFormatted, gametime, gametimeFormatted, level, totalxp, currentxp, currentxpFormatted, health, lifeticks, lifeticksFormatted, wallet); } else { updateStatisticsKeylessStyle(userID, onlineStatus, lastonlineTime, lastonlineTimeFormatted, gametime, gametimeFormatted, level, totalxp, currentxp, currentxpFormatted, health, lifeticks, lifeticksFormatted, wallet); } } /** * Called by updateStatistics() to update a statistics table that uses Key-Value Pairs. * * @param String Player's forum user ID. * @param String Set to the appropriate value representing player's online status. * @param int systime value for the last time the player was last online * @param String A formatted version of the systime value of when the player was last online. * @param int Amount of time the player has played in seconds. * @param String Amount of time the player has played formatted nicely. * @param int Level of the player * @param int Total amount of XP the player currently has. * @param float Amount of progress the player has towards the next level as a percentage. * @param String Readable version of the percentage the player has towards the next level. * @param int Player's current health level. * @param int Amount of time played since last death, in ticks. * @param String Formatted amount of time played since last death. * @param double Current balance of the player. */ private void updateStatisticsKeyStyle(String userID, String onlineStatus, int lastonlineTime, String lastonlineFormattedTime, int gameTime, String gameTimeFormatted, int level, int totalxp, float currentxp, String currentxpFormatted, int health, int lifeticks, String lifeticksFormatted, double wallet) { List<String> fields = new ArrayList(); String query = "UPDATE `" + config.statisticsTableName + "` " + "SET "; /* To collapse multiple MySQL queries into one query, we're using the * MySQL CASE operator. Recommended reading: * http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/ * Prototype: * UPDATE tablename * SET valueColumn = CASE keycolumn * WHEN keyname THEN keyvalue * WHEN keyname THEN keyvalue * END * WHERE useridcolumn = userid; */ query = query + "`" + config.statisticsValueColumn + "` = CASE " + "`" + config.statisticsKeyColumn + "` "; if (config.onlineStatusEnabled) { fields.add("WHEN '" + config.onlineStatusColumnOrKey + "' THEN '" + onlineStatus + "' "); } if (config.lastonlineEnabled) { fields.add("WHEN '" + config.lastonlineColumnOrKey + "' THEN '" + lastonlineTime + "' "); if (config.lastonlineFormattedColumnOrKey.isEmpty()) {} else { fields.add("WHEN '" + config.lastonlineFormattedColumnOrKey + "' THEN '" + lastonlineFormattedTime + "' "); } } // Gametime actually relies on the prior lastonlineTime... if (config.gametimeEnabled && config.lastonlineEnabled) { fields.add("WHEN '" + config.gametimeColumnOrKey + "' THEN '" + gameTime + "' "); if (config.gametimeFormattedColumnOrKey.isEmpty()) {} else { fields.add("WHEN '" + config.gametimeFormattedColumnOrKey + "' THEN '" + gameTimeFormatted + "' "); } } if (config.levelEnabled) { fields.add("WHEN '" + config.levelColumnOrKey + "' THEN '" + level + "' "); } if (config.totalxpEnabled) { fields.add("WHEN '" + config.levelColumnOrKey + "' THEN '" + totalxp + "' "); } if (config.currentxpEnabled) { fields.add("WHEN '" + config.levelColumnOrKey + "' THEN '" + currentxp + "' "); if (config.currentxpFormattedColumnOrKey.isEmpty()) {} else { fields.add("WHEN '" + config.currentxpFormattedColumnOrKey + "' THEN '" + currentxpFormatted + "' "); } } if (config.healthEnabled) { fields.add("WHEN '" + config.healthColumnOrKey + "' THEN '" + health + "' "); } if (config.lifeticksEnabled) { fields.add("WHEN '" + config.lifeticksColumnOrKey + "' THEN '" + lifeticks + "' "); if (config.lifeticksFormattedColumnOrKey.isEmpty()) {} else { fields.add("WHEN '" + config.lifeticksFormattedColumnOrKey + "' THEN '" + lifeticksFormatted + "' "); } } if (config.walletEnabled) { fields.add("WHEN '" + config.walletColumnOrKey + "' THEN '" + wallet + "' "); } query = query + StringUtilities.joinStrings(fields, " "); query = query + "END"; query = query + " WHERE `" + config.statisticsUserIDColumn + "` = '" + userID + "'"; String errorBase = "Error during updateStatisticsKeyStyle(): "; log.finest(query); try { sql.updateQuery(query); } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } /** * Called by updateStatistics when updating a table that columns (instead of keyvalue pairs). * * @param String Player's forum user ID. * @param String Set to the appropriate value representing player's online status. * @param int systime value for the last time the player was last online * @param String A formatted version of the systime value of when the player was last online. * @param int Amount of time the player has played in seconds. * @param String Amount of time the player has played formatted nicely. * @param int Level of the player * @param int Total amount of XP the player currently has. * @param float Amount of progress the player has towards the next level as a percentage. * @param String Readable version of the percentage the player has towards the next level. * @param int Player's current health level. * @param int Amount of time played since last death, in ticks. * @param String Formatted amount of time played since last death. * @param double Current balance of the player. */ private void updateStatisticsKeylessStyle(String userID, String onlineStatus, int lastonlineTime, String lastonlineTimeFormatted, int gametime, String gametimeFormatted, int level, int totalxp, float currentxp, String currentxpFormatted, int health, int lifeticks, String lifeticksFormatted, double wallet) { String query; List<String> fields = new ArrayList(); query = "UPDATE `" + config.statisticsTableName + "` " + "SET "; if (config.onlineStatusEnabled) { fields.add("`" + config.onlineStatusColumnOrKey + "` = '" + onlineStatus + "'"); } if (config.lastonlineEnabled) { fields.add("`" + config.lastonlineColumnOrKey + "` = '" + lastonlineTime + "'"); if (config.lastonlineFormattedColumnOrKey.isEmpty()) {} else { fields.add("`" + config.lastonlineFormattedColumnOrKey + "` = '" + lastonlineTimeFormatted + "'"); } } if (config.gametimeEnabled) { fields.add("`" + config.gametimeColumnOrKey + "` = '" + gametime + "'"); if (config.gametimeFormattedColumnOrKey.isEmpty()) {} else { fields.add("`" + config.gametimeFormattedColumnOrKey + "` = '" + gametimeFormatted + "'"); } } if (config.levelEnabled) { fields.add("`" + config.levelColumnOrKey + "` = '" + level + "'"); } if (config.totalxpEnabled) { fields.add("`" + config.totalxpColumnOrKey + "` = '" + totalxp + "'"); } if (config.currentxpEnabled) { fields.add("`" + config.currentxpColumnOrKey + "` = '" + currentxp + "'"); if (config.currentxpFormattedColumnOrKey.isEmpty()) {} else { fields.add("`" + config.currentxpFormattedColumnOrKey + "` = '" + currentxpFormatted + "'"); } } if (config.healthEnabled) { fields.add("`" + config.healthColumnOrKey + "` = '" + health + "'"); } if (config.lifeticksEnabled) { fields.add("`" + config.lifeticksColumnOrKey + "` = '" + lifeticks + "'"); if (config.lifeticksFormattedColumnOrKey.isEmpty()) {} else { fields.add("`" + config.lifeticksFormattedColumnOrKey + "` = '" + lifeticksFormatted + "'"); } } if (config.walletEnabled) { fields.add("`" + config.walletColumnOrKey + "` = '" + wallet + "'"); } query = query + StringUtilities.joinStrings(fields, ", ") + " WHERE `" + config.statisticsUserIDColumn + "` = '" + userID + "'"; String errorBase = "Error during updateStatisticsKeylessStyle(): "; log.finest(query); try { sql.updateQuery(query); } catch (MalformedURLException error) { log.severe(errorBase + error.getMessage()); } catch (InstantiationException error) { log.severe(errorBase + error.getMessage()); } catch (IllegalAccessException error) { log.severe(errorBase + error.getMessage()); } } } // WebApplication class
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7541560729a6733601bb12aa18ee7dbc797fee56
8021b3edcf849428f4c5f036a37edf5dd8754b30
/src/main/java/com/utils/ReflectHelper.java
b86bc72ad93084f44c80bbb20cc7fe7ecd617d85
[]
no_license
pdmall/MallWXMS
e6f5a82737506ac8e420780768335d5926a33505
9bbc4e81b86e0915baef74bedca623bce19f2c97
refs/heads/master
2020-03-21T01:59:23.085867
2018-06-19T07:36:54
2018-06-19T07:36:54
137,973,326
0
0
null
null
null
null
UTF-8
Java
false
false
1,955
java
package com.utils; import java.lang.reflect.Field; /** * 说明:反射工具 * 创建人:FH Q728971035 * 修改时间:2014年9月20日 * @version */ public class ReflectHelper { /** * 获取obj对象fieldName的Field * @param obj * @param fieldName * @return */ public static Field getFieldByFieldName(Object obj, String fieldName) { for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass .getSuperclass()) { try { return superClass.getDeclaredField(fieldName); } catch (NoSuchFieldException e) { } } return null; } /** * 获取obj对象fieldName的属性值 * @param obj * @param fieldName * @return * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalArgumentException * @throws IllegalAccessException */ public static Object getValueByFieldName(Object obj, String fieldName) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field field = getFieldByFieldName(obj, fieldName); Object value = null; if(field!=null){ if (field.isAccessible()) { value = field.get(obj); } else { field.setAccessible(true); value = field.get(obj); field.setAccessible(false); } } return value; } /** * 设置obj对象fieldName的属性值 * @param obj * @param fieldName * @param value * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalArgumentException * @throws IllegalAccessException */ public static void setValueByFieldName(Object obj, String fieldName, Object value) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field field = obj.getClass().getDeclaredField(fieldName); if (field.isAccessible()) { field.set(obj, value); } else { field.setAccessible(true); field.set(obj, value); field.setAccessible(false); } } }
[ "40382179+pdmall@users.noreply.github.com" ]
40382179+pdmall@users.noreply.github.com
4712e07046ab260aed93441a09a54a46a16d95b4
ebe42289f7fad9b77b2c38edb658987cdd821bc4
/src/main/java/af/hu/cs/se/hospitalmanagementsystem2/service/ReceptionistService.java
47af4ce5bc9f7dd1f6e970ff81d9a87cb5ce4343
[]
no_license
ShaqayeqNegin/hms
1cb0118ca9b12d698ea1f65b254187c13fd3ffac
f3b215640aad56674eafd9405ded404adb02870e
refs/heads/master
2020-08-05T12:32:09.430903
2019-10-04T06:32:58
2019-10-04T06:32:58
212,506,763
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package af.hu.cs.se.hospitalmanagementsystem2.service; import af.hu.cs.se.hospitalmanagementsystem2.model.Receptionist; public interface ReceptionistService { void saveReceptionist(Receptionist receptionist); Object findAll(); Receptionist findReceptionistById(Long id); void deleteReceptionistById(Long id); }
[ "negin.sh1376@gmail.com" ]
negin.sh1376@gmail.com
b267c8b3ceb6febb651a337335fd7e3a4af17bbf
74b241d469947512452cf1210588ce9c0c1a8b96
/src/main/java/id/ac/unpar/siamodels/matakuliah/AIF380.java
6573cdefe1a391f56da97acdf25d4b34c4183bdb
[ "MIT" ]
permissive
johanes97/SIAModels
3c20ce1670f99383e4e41f2fd180d3ee4461899f
1a179305c4d135d3eecb13b9a797a3c11003beef
refs/heads/master
2020-04-21T11:22:14.579132
2019-05-02T06:11:05
2019-05-02T06:11:05
167,295,079
1
0
MIT
2019-01-31T07:40:05
2019-01-24T03:17:33
Java
UTF-8
Java
false
false
232
java
package id.ac.unpar.siamodels.matakuliah; import id.ac.unpar.siamodels.InfoMataKuliah; import id.ac.unpar.siamodels.MataKuliah; @InfoMataKuliah(nama = "Teori Bahasa & Otomata", sks = 3) public class AIF380 extends MataKuliah { }
[ "pascalalfadian@live.com" ]
pascalalfadian@live.com
d879696f2da6d0524d9022153e21b4921f36a427
56eacc988a3d43282651c7ea6000d02f58d4fff8
/app/src/main/java/com/hxjf/dubei/adapter/BookListItemListAdapter.java
5639782ff4497249851629f7fa9e7364aba361ae
[]
no_license
RollCretin/2iebud
502182477c9fdc09df7bc4f1f88e8a7e1b6c5804
a9977ed367d057002a4b8638b4a73bf5c2bdc15f
refs/heads/master
2020-03-22T09:17:31.832630
2018-07-10T08:24:47
2018-07-10T08:24:47
139,827,423
1
0
null
null
null
null
UTF-8
Java
false
false
2,995
java
package com.hxjf.dubei.adapter; import android.content.Context; import android.text.Html; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.hxjf.dubei.R; import com.hxjf.dubei.bean.BookListbean; import com.hxjf.dubei.network.ReaderRetroift; import java.util.List; import de.hdodenhof.circleimageview.CircleImageView; /** * Created by Chen_Zhang on 2017/7/15. */ public class BookListItemListAdapter extends BaseAdapter { Context mContext; List<BookListbean.ResponseDataBean.ContentBean> mList; public BookListItemListAdapter(Context context, List<BookListbean.ResponseDataBean.ContentBean> list) { mContext = context; mList = list; } @Override public int getCount() { return mList.size(); } @Override public Object getItem(int position) { return mList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null){ holder = new ViewHolder(); convertView = View.inflate(mContext,R.layout.item_preferred_booklist,null); holder.ivImage = (ImageView) convertView.findViewById(R.id.item_prefferred_booklist_iamge); holder.tvTitle = (TextView) convertView.findViewById(R.id.item_prefferred_booklist_title); holder.tvDes = (TextView) convertView.findViewById(R.id.item_prefferred_booklist_des); holder.tvNum = (TextView) convertView.findViewById(R.id.item_prefferred_booklist_num); holder.ivPratroit = (CircleImageView) convertView.findViewById(R.id.item_prefferred_booklist_pratroit); holder.tvName = (TextView) convertView.findViewById(R.id.item_prefferred_booklist_name); convertView.setTag(holder); }else{ holder = (ViewHolder) convertView.getTag(); } BookListbean.ResponseDataBean.ContentBean contentBean = mList.get(position); Glide.with(mContext).load(ReaderRetroift.IMAGE_URL +contentBean.getCover()).into(holder.ivImage); Glide.with(mContext).load(ReaderRetroift.IMAGE_URL +contentBean.getOwnerHeadPath()).into(holder.ivPratroit); holder.tvName.setText(contentBean.getOwnerName()); holder.tvTitle.setText(contentBean.getTitle()); String des = Html.fromHtml(contentBean.getSummary()).toString(); holder.tvDes.setText(des); holder.tvNum.setText(contentBean.getBookCount()+"本书籍"); return convertView; } public class ViewHolder{ public ImageView ivImage; public TextView tvTitle; public TextView tvDes; public TextView tvNum; public CircleImageView ivPratroit; public TextView tvName; } }
[ "chen15302689824@163.com" ]
chen15302689824@163.com
ed0a1b3ba5706bff44d196bb7776028abd576b22
7c2bce462d9599d9be53e843019f3bf54e16d36e
/Rest Camping Web/campling/src/main/java/com/smu/camping/controller/reservation/ReservationManageController.java
7d2c622cf80928f4b6d7fed11a161ce206027218
[]
no_license
hyou55/software-engineering-team-project
54b039dd62e654bf3e7ff03b471d4fd4d92d2b5c
e8049375d61d068d11fd306626b73b9c0021e5ae
refs/heads/main
2023-07-29T14:55:49.304474
2021-06-21T15:13:29
2021-06-21T15:13:29
354,011,196
0
0
null
2021-04-02T12:21:52
2021-04-02T12:21:51
null
UTF-8
Java
false
false
1,283
java
package com.smu.camping.controller.reservation; import com.smu.camping.dto.ApiResponse; import com.smu.camping.service.campsite.RoomService; import com.smu.camping.service.reservation.ReservationManageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class ReservationManageController { @Autowired private ReservationManageService reservationManageService; @Autowired private RoomService roomService; @PutMapping("/reservation/approve") public ApiResponse approveReservation(@RequestParam("reservationId") int reservationId){ int result = reservationManageService.approveReservation(reservationId); return (result > 0)? new ApiResponse(false, "") : new ApiResponse(true, "예약 승인에 실패하였습니다."); } @PutMapping("/reservation/reject") public ApiResponse rejectReservation(@RequestParam("reservationId") int reservationId){ int result = reservationManageService.rejectReservation(reservationId); return (result > 0)? new ApiResponse(false, "") : new ApiResponse(true, "예약 거부에 실패하였습니다."); } }
[ "rlfalsgh95@naver.com" ]
rlfalsgh95@naver.com
b3901add44c9510a10d92fdaece69c87e02728b3
6d4a93a534eb5340e8cefb5c03c2aca07dcf2cbc
/Web-Services/JAX-RS_4/ejb/src/main/java/ru/javacourse/model/Region.java
8b198f5147f436a66eebdb8def6e7b9888227a1f
[]
no_license
MaxGradus/JavaCourse
d46f025e21318e8382e893be7fd48edaffc7ed3c
d190bc57f8dadac82d3e173a8b5ab92a18e661c9
refs/heads/master
2020-04-05T22:45:51.235854
2016-01-19T08:13:09
2016-01-19T08:13:09
32,000,480
0
0
null
null
null
null
UTF-8
Java
false
false
1,075
java
package ru.javacourse.model; import javax.persistence.*; import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; @XmlRootElement @Entity @Table(name = "jc_region") @NamedQueries({ @NamedQuery(name = "Region.GetAll", query = "select r from Region r") }) public class Region implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "region_id") private Integer regionId; @Column(name = "region_name", nullable = true) private String regionName; public Region() { } public Region(String regionName) { this.regionName = regionName; } public Integer getRegionId() { return regionId; } public void setRegionId(Integer regionId) { this.regionId = regionId; } public String getRegionName() { return regionName; } public void setRegionName(String regionName) { this.regionName = regionName; } @Override public String toString() { return regionId + ":" + regionName; } }
[ "gradus182@gmail.com" ]
gradus182@gmail.com
7219fda06641fbcda90cc0ff5d82c84e7f96ad58
a1e6c9be76d8f57e1e4dff320999f836717b7080
/src/main/java/com/dbs/mcare/service/batch/PnuhBatchJobManager.java
8c637dadad8b82691ab6b5965ac800f827717a12
[]
no_license
LEESOOMIN911/soominlee
2ef7c0d8cd5ca6b5151a501efbd5710245fe817f
d9e107a796f8d091d96445daa322457c6fe257ae
refs/heads/master
2021-01-25T01:07:41.739126
2017-06-09T02:18:31
2017-06-09T02:18:31
94,728,155
0
0
null
null
null
null
UTF-8
Java
false
false
7,018
java
package com.dbs.mcare.service.batch; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import com.dbs.mcare.framework.FrameworkConstants; import com.dbs.mcare.framework.service.batch.BatchJob; import com.dbs.mcare.framework.service.batch.job.AccessByDateBatchJob; import com.dbs.mcare.framework.service.batch.job.AccessByHourBatchJob; import com.dbs.mcare.framework.service.batch.job.AccessByMenuBatchJob; import com.dbs.mcare.framework.service.batch.job.AccessByPlatformBatchJob; import com.dbs.mcare.framework.service.batch.job.EventByDateBatchJob; import com.dbs.mcare.framework.service.batch.job.MsgLogByDateBatchJob; import com.dbs.mcare.framework.service.batch.job.UserRegisterByDateBatchJob; import com.dbs.mcare.framework.util.DateUtil; import com.dbs.mcare.service.PnuhConfigureService; import com.dbs.mcare.service.batch.job.HelperDeleteByDateBatchJob; import com.dbs.mcare.service.batch.job.UserInfoBatchJob; import com.dbs.mcare.service.batch.job.WithdrawalNotifyByDateBatchJob; @Component @EnableScheduling public class PnuhBatchJobManager { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private PnuhConfigureService configureService; // 프레임워크에 정의된 작업 ------ @Autowired private AccessByDateBatchJob accessByDateBatchJob; // 일별접근 @Autowired private AccessByHourBatchJob accessByHourBatchJob; // 시간별접근 @Autowired private AccessByMenuBatchJob accessByMenuBatchJob; // 메뉴별접근 @Autowired private AccessByPlatformBatchJob accessByPlatformBatchJob; // 플랫폼별접근 @Autowired private EventByDateBatchJob eventByDateBatchJob; // 비콘이벤트 @Autowired private MsgLogByDateBatchJob msgLogByDateBatchJob; // 메시지전송건수 @Autowired private UserRegisterByDateBatchJob userRegisterByDateBatchJob; // 사용자등록 // 서비스에 정의된 작업 ------ @Autowired private HelperDeleteByDateBatchJob helperDeleteByDateBatchJob; // 도우미 메시지 삭제 @Autowired private UserInfoBatchJob userInfoBatchJob; // 사용자정보통계 (지역별, 연령별) @Autowired private WithdrawalNotifyByDateBatchJob withdrawalNotifyByDateBatchJob; // 사용자탈퇴 // 접근통계 관련 작업 private List<BatchJob> accessJobList; // 사용자통계관련 private List<BatchJob> userJobList; @PostConstruct public void init() { // 접근통계 this.accessJobList = new ArrayList<BatchJob>(); this.accessJobList.add(this.accessByDateBatchJob); this.accessJobList.add(this.accessByHourBatchJob); this.accessJobList.add(this.accessByMenuBatchJob); this.accessJobList.add(this.accessByPlatformBatchJob); this.accessJobList.add(this.eventByDateBatchJob); // 성격이 조금 다르지만 묶어서 같이 처리 this.accessJobList.add(this.msgLogByDateBatchJob); // 성격이 조금 다르지만 묶어서 같이 처리 this.accessJobList.add(this.helperDeleteByDateBatchJob); // 성격이 많이 다르지만 묶어서 같이 처리 // 사용자통계 this.userJobList = new ArrayList<BatchJob>(); this.userJobList.add(this.userRegisterByDateBatchJob); this.userJobList.add(this.userInfoBatchJob); } @Scheduled(cron="${access.batch.cron}") // 접근통계 public void workAggAccess() { final String batchName = "접근통계배치"; // 활성화 여부 if(!this.configureService.isAccessBatchWork()) { if(logger.isInfoEnabled()) { logger.info(batchName + " : 비활성화"); } return; } // 생성할 통계 데이터가 양이 많은것도 아니고 복잡도가 높은 것도 아니고 시급한것도 아니고, 하나씩 차례대로 처리한다. // 작업용 어제날짜 final Date aggDt = DateUtil.getStartDate(1); if(logger.isInfoEnabled()) { logger.info(this.getLogStr(batchName, aggDt, this.accessJobList.toString())); } // 작업실행 for(BatchJob job : this.accessJobList) { this.executeBatchJob(aggDt, job); } } @Scheduled(cron="${agg.user.info.batch.cron}") // 사용자 통계 public void workUserInfo() { final String batchName = "사용자배치"; // 활성화 여부 if(!this.configureService.isAggUserInfoWork()) { if(logger.isInfoEnabled()) { logger.info(batchName + " : 비활성화"); } return; } // 기준날자 구하고 final Date aggDt = DateUtil.getStartDate(1); if(logger.isInfoEnabled()) { logger.info(this.getLogStr(batchName, aggDt, this.userJobList.toString())); } // 사용자정보통계 돌리기 for(BatchJob job : this.userJobList) { this.executeBatchJob(aggDt, job); } } @Scheduled(cron="${withdrawal.batch.cron}") // 회원탈퇴안내. 낮시간에 안내를 해줘야 해서 별도 시간설정이 있는것임 public void workWithdrawal() { final String batchName = "탈퇴배치"; // 회원탈퇴배치 활성화 여부 if(!this.configureService.isWithdrawalBatchWork()) { logger.info(batchName + " : 비활성화"); return; } // 생성할 통계 데이터가 양이 많은것도 아니고 복잡도가 높은 것도 아니고 시급한것도 아니고, 하나씩 차례대로 처리한다. // 작업용 어제날짜 final Date aggDt = DateUtil.getStartDate(1); if(logger.isInfoEnabled()) { logger.info(batchName, aggDt, this.withdrawalNotifyByDateBatchJob.toString()); } // 작업실행 this.executeBatchJob(aggDt, this.withdrawalNotifyByDateBatchJob); } /** * 하나의 배치작업 실행 * @param aggDt * @param job */ private void executeBatchJob(Date aggDt, BatchJob job) { // 실행 try { job.execute(aggDt); if(logger.isInfoEnabled()) { logger.info(job.getBatchName() + " : 작업완료. (" + aggDt + ")"); } } catch(final Exception ex) { logger.info(job.getBatchName() + " : 작업실패. (" + aggDt + ")", ex); // 예외 발생 시 로그만 찍는것은 정상적인 흐름임. 의도적으로 잡은 예외임. } } /** * 로그용 문자 만들기 * @param batchName * @param aggDt * @param target * @return */ private String getLogStr(String batchName, Date aggDt, String target) { StringBuilder builder = new StringBuilder(FrameworkConstants.NEW_LINE); builder.append(batchName).append("시작 ==========").append(FrameworkConstants.NEW_LINE); builder.append("- 기준시간 : ").append(aggDt).append(FrameworkConstants.NEW_LINE); builder.append("- 대상작업 : ").append(target).append(FrameworkConstants.NEW_LINE); return builder.toString(); } }
[ "hyeeunkwon@idatabank.com" ]
hyeeunkwon@idatabank.com
5b0e07dc5b1ee6eebfdd8a0caa31a3fbb4d3327b
3351329dd0a7ef00f7c760061cd4dd318b183c44
/javatests/util/MehDeciderTest.java
8c956b40e479a10ad11bcd6d64548f7e3511cd0e
[]
no_license
ogiekako/polycover
0e20ee41e070d51a9b9a66d0b3657ec0177533fd
ef624017b1cf2473f48514784906fc04bd925f70
refs/heads/master
2021-01-01T17:43:53.222829
2017-02-05T20:49:12
2017-02-05T20:49:12
31,585,284
2
1
null
null
null
null
UTF-8
Java
false
false
914
java
package util; import org.junit.Test; import java.io.File; import java.util.ArrayList; import java.util.List; public class MehDeciderTest { @Test public void testIsMeh() throws Exception { List<String> problems = FileUtil.allFilesUnder(new File("problem")); List<String> badPaths = new ArrayList<String>(); for (String p : problems) { MehDecider.Type type = MehDecider.decide(p, "problem"); if (p.endsWith(".meh")) { if (type != MehDecider.Type.Meh) { badPaths.add(p); } } else if (p.endsWith(".yes")) { if (type != MehDecider.Type.Yes) { badPaths.add(p); } } else if (p.endsWith(".no")) { if (type != MehDecider.Type.No) { badPaths.add(p); } } else { throw new AssertionError(); } } if (!badPaths.isEmpty()) { throw new AssertionError(badPaths); } } }
[ "ogiekako@gmail.com" ]
ogiekako@gmail.com
16b4c51db9d4bfb16b4f9c251a6857ca28d88cc7
6a9fe0b2d5e74e6b3724f036f43fd45ee794607e
/src/main/java/com/mmg/LeetCode/CountAndSay.java
8aa2ec4f66ff76855cdade4ea91814b3da99ad3c
[]
no_license
Moremoregreen/OnlineProgramming
bdf7bd35440579103a5654919d925d0346e95cc6
ed1b820b0db3196c71e7d774b0ab55a1adf61d00
refs/heads/master
2020-05-05T07:47:16.402903
2019-04-06T13:41:50
2019-04-06T13:41:50
179,838,069
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
package com.mmg.LeetCode; /* 難度:EASY n=1時輸出字符串1;n=2時,數上次字符串中的數值個數,因為上次字符串有1個1,所以輸出11; n=3時,由於上次字符是11,有2個1,所以輸出21;n=4時,由於上次字符串是21,有1個2和1個1, 所以輸出1211。依次類推,寫個countAndSay(n)函數返回字符串。 1. 1 2. 11 3. 21 4. 1211 5. 111221 */ public class CountAndSay { public static void main(String[] args) { System.out.println(countAndSay(4)); } public static String countAndSay(int n) { StringBuilder sb = new StringBuilder(); int counter = 0; if (n == 1) { return "1"; } else if (n == 2) { return "11"; } else { String temp = countAndSay(n - 1); //21 for (int i = 0; i < temp.length(); i++) { // 0 12 // temp有兩個一樣的數字 while (i < temp.length() - 1 && temp.charAt(i) == temp.charAt(i + 1)) { counter++; i++; } System.out.println(sb); System.out.println(i+" " + n); sb = sb.append(++counter).append(temp.charAt(i)); counter = 0; } } return sb.toString(); } }
[ "zzz2009j@gmail.com" ]
zzz2009j@gmail.com
a59e7797f5e7d2da58c0e3a231191687ca8ed1f0
2fac9d26f9b3e51bfc110ca3a1a4e5eba10b715a
/JAVA_Homework/homework_7/TestStartStop.java
3db42927a48d6f29ef7c2dec275e515ab8f73eac
[]
no_license
wl-cp/JAVA
2207a7b14e99e60ab431a08ab4aa49d182e1b7aa
2406d0ae6bdadd20dd94f12da28691a385bc55e8
refs/heads/main
2023-07-08T00:49:54.781160
2021-08-24T14:09:12
2021-08-24T14:09:12
399,488,504
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
interface StartStop { // 接口的方法声明 void start(); void stop(); } class Elevator implements StartStop{ public void start(){ System.out.println("Elevator start"); } public void stop(){ System.out.println("Elevator stop"); } } class Conference implements StartStop{ public void start(){ System.out.println("Conference start"); } public void stop(){ System.out.println("Conference stop"); } } public class TestStartStop { public static void main(String[] args) { StartStop[] ss = { new Elevator(), new Conference() }; for (int i = 0; i < ss.length; i++) { ss[i].start(); ss[i].stop(); } System.out.println("programe over"); } }
[ "1602671219@qq.com" ]
1602671219@qq.com
37b7d4795d774ea3c6759269dc48a33e51adadc8
ad0ceb1b8f41d8ae2728e0554af80e00e6aeb738
/src/com/portal/service/ModuleService.java
a647756dd02739ad8ef2301e21f722ecf8af7f27
[]
no_license
HydraStudio/PortalSite
397da0bc016d1dc90e36f754a944af05dc8278a2
bf1bde2bb0fd3dd2fb62c69623c9175bc4247701
refs/heads/master
2020-06-01T07:42:52.243711
2014-06-18T14:36:13
2014-06-18T14:36:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
459
java
package com.portal.service; import java.util.List; import com.portal.model.Module; import com.portal.model.PageBean; import com.portal.util.QueryHelper; public interface ModuleService { List<Module> findAllModules(); void deleteModule(Long id); void saveModule(Module module); Module getById(Long id); void modifyModule(Module module); PageBean searchPagination(int pageNum, int pageSize, QueryHelper queryHelper); }
[ "liujun3471@163.com" ]
liujun3471@163.com
ec60737beab08cc5881b3daee544973c642ac38b
481701961e44fc128ab7a46c5fb6d2b9642608b8
/src/cn/itcast/core/bean/Dingdan.java
a00146e01df230693bfc443c0c2a6cd6739ef0bc
[]
no_license
Liangkaiyuan/renshi
041afda861629de0ee025a2b3edf48e29bcfe323
4ed4afc204b22a99b81c95eef678c8cca1f8fd66
refs/heads/master
2022-09-26T08:59:25.786923
2020-06-06T16:18:31
2020-06-06T16:18:31
270,034,852
0
0
null
null
null
null
UTF-8
Java
false
false
2,707
java
package cn.itcast.core.bean; public class Dingdan { private Integer d_id ;//主键 private String d_name ; private String d_cfname; private String d_phone ; private String province10 ;//省份 private String city10 ; //城市 private String district10 ; //区 private String d_jdxxdz ; private String d_yy ; private String d_fw ; private String d_djh ; private String d_create_time; private String d_status ; private String d_a ; private String d_b ; private String d_c ; private String d_e ; private String d_f ; public Integer getD_id() { return d_id; } public void setD_id(Integer d_id) { this.d_id = d_id; } public String getD_name() { return d_name; } public void setD_name(String d_name) { this.d_name = d_name; } public String getD_cfname() { return d_cfname; } public void setD_cfname(String d_cfname) { this.d_cfname = d_cfname; } public String getD_phone() { return d_phone; } public void setD_phone(String d_phone) { this.d_phone = d_phone; } public String getProvince10() { return province10; } public void setProvince10(String province10) { this.province10 = province10; } public String getCity10() { return city10; } public void setCity10(String city10) { this.city10 = city10; } public String getDistrict10() { return district10; } public void setDistrict10(String district10) { this.district10 = district10; } public String getD_jdxxdz() { return d_jdxxdz; } public void setD_jdxxdz(String d_jdxxdz) { this.d_jdxxdz = d_jdxxdz; } public String getD_yy() { return d_yy; } public void setD_yy(String d_yy) { this.d_yy = d_yy; } public String getD_fw() { return d_fw; } public void setD_fw(String d_fw) { this.d_fw = d_fw; } public String getD_djh() { return d_djh; } public void setD_djh(String d_djh) { this.d_djh = d_djh; } public String getD_create_time() { return d_create_time; } public void setD_create_time(String d_create_time) { this.d_create_time = d_create_time; } public String getD_status() { return d_status; } public void setD_status(String d_status) { this.d_status = d_status; } public String getD_a() { return d_a; } public void setD_a(String d_a) { this.d_a = d_a; } public String getD_b() { return d_b; } public void setD_b(String d_b) { this.d_b = d_b; } public String getD_c() { return d_c; } public void setD_c(String d_c) { this.d_c = d_c; } public String getD_e() { return d_e; } public void setD_e(String d_e) { this.d_e = d_e; } public String getD_f() { return d_f; } public void setD_f(String d_f) { this.d_f = d_f; } }
[ "1093595726@qq.com" ]
1093595726@qq.com
1cbeeaaee3befc7c9856ffcb9f681743aaee9d8d
c9639a0787130219fc12faa091c7b1c5507d7687
/src/com/flipchase/android/cache/BitmapMemoryLruCache.java
d079878952c1d8bc201edcd63492ab4581eff2d4
[]
no_license
mohdfarhanakram/Flipchase
1b9b66efd8d289f4e3a3d2acda1d18471d93fdd5
d81635b62fd2f46e17deecca19b6f15223e596e6
refs/heads/master
2021-01-15T11:13:42.121511
2014-10-11T22:49:40
2014-10-11T22:49:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,813
java
/******************************************************************************* * Copyright (c) 2013 Chris Banes. * * 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.flipchase.android.cache; import java.lang.ref.SoftReference; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; import java.util.Set; import android.graphics.Bitmap; import android.util.LruCache; final class BitmapMemoryLruCache extends LruCache<String, CacheableBitmapDrawable> { private final Set<SoftReference<CacheableBitmapDrawable>> mRemovedEntries; private final BitmapLruCache.RecyclePolicy mRecyclePolicy; BitmapMemoryLruCache(int maxSize, BitmapLruCache.RecyclePolicy policy) { super(maxSize); mRecyclePolicy = policy; mRemovedEntries = policy.canInBitmap() ? Collections.synchronizedSet(new HashSet<SoftReference<CacheableBitmapDrawable>>()) : null; } CacheableBitmapDrawable put(CacheableBitmapDrawable value) { if (null != value) { value.setCached(true); return put(value.getUrl(), value); } return null; } BitmapLruCache.RecyclePolicy getRecyclePolicy() { return mRecyclePolicy; } @Override protected int sizeOf(String key, CacheableBitmapDrawable value) { return value.getMemorySize(); } @Override protected void entryRemoved(boolean evicted, String key, CacheableBitmapDrawable oldValue, CacheableBitmapDrawable newValue) { // Notify the wrapper that it's no longer being cached oldValue.setCached(false); if (mRemovedEntries != null && oldValue.isBitmapValid() && oldValue.isBitmapMutable()) { synchronized (mRemovedEntries) { mRemovedEntries.add(new SoftReference<CacheableBitmapDrawable>(oldValue)); } } } Bitmap getBitmapFromRemoved(final int width, final int height) { if (mRemovedEntries == null) { return null; } Bitmap result = null; synchronized (mRemovedEntries) { final Iterator<SoftReference<CacheableBitmapDrawable>> it = mRemovedEntries.iterator(); while (it.hasNext()) { CacheableBitmapDrawable value = it.next().get(); if (value != null && value.isBitmapValid() && value.isBitmapMutable()) { if (value.getIntrinsicWidth() == width && value.getIntrinsicHeight() == height) { it.remove(); result = value.getBitmap(); break; } } else { it.remove(); } } } return result; } void trimMemory() { final Set<Entry<String, CacheableBitmapDrawable>> values = snapshot().entrySet(); for (Entry<String, CacheableBitmapDrawable> entry : values) { CacheableBitmapDrawable value = entry.getValue(); if (null == value || !value.isBeingDisplayed()) { remove(entry.getKey()); } } } }
[ "mohdfarhanakram@gmail.com" ]
mohdfarhanakram@gmail.com
81862c0d4e3ffe168e07e2369403e0914af7e7fb
026a4b18ed724059b6166e52a7943432c2f8aa4f
/src/main/java/Servlet/CityAllSrv.java
cbdb4071ead48253c29179810a9b1a36a9a26513
[]
no_license
egalli64/red420
4aad22be6b23fa6e74ef50e68d4f7454e120495b
277ccc384a43bc9fa1bdaae262c27caa8968b272
refs/heads/master
2023-06-04T16:20:31.134490
2021-06-18T14:03:08
2021-06-18T14:03:08
376,021,781
0
1
null
null
null
null
UTF-8
Java
false
false
1,050
java
package Servlet; import java.io.IOException; import javax.annotation.Resource; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import Dao.CityDao; @SuppressWarnings("serial") @WebServlet("/cities") public class CityAllSrv extends HttpServlet { private static final Logger log = LoggerFactory.getLogger(CityAllSrv.class); @Resource(name = "jdbc/red") private DataSource ds; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.trace("called"); String param = request.getParameter("cityId"); try (CityDao dao = new CityDao(ds)) { request.setAttribute("cities", dao.getAll()); request.getRequestDispatcher("page4.jsp").forward(request, response); } } }
[ "Marzia@DESKTOP-VGEKPQ4.homenet.telecomitalia.it" ]
Marzia@DESKTOP-VGEKPQ4.homenet.telecomitalia.it
32937e6b0d8da12a19a666ce2de457df9ea4f8b3
2b2d2183695e92e4a5fbd6d3edb4fae3678b428c
/tool/src/main/java/com/yph/entity/UserEntity.java
91d3c8959f7cbdcc1fe6e6879080a22110ebc007
[]
no_license
513667225/resourceCenter
7639e2c1c3fd4f25b7826dd27490d70897d26556
7c8a2ad25f953f4653ba28963566e77a55451359
refs/heads/master
2023-05-12T04:08:24.853959
2021-06-01T08:26:37
2021-06-01T08:26:37
372,721,263
0
0
null
null
null
null
UTF-8
Java
false
false
13,139
java
package com.yph.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.util.Date; import java.util.Objects; /** * <p> * 用户表 * </p> * * @author * @since 2020-11-12 */ @TableName("user") public class UserEntity implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "user_id", type = IdType.AUTO) private Integer userId; /** * 用户密码 */ private String userPassword; /** * 最近一次登录时间 */ private Date userLastLoginTime; /** * V0 - V6 */ private Integer userLevel; /** * 用户角色(0 普通用户;1 VIP;2 经理;3 总裁) */ private Integer role; /** * 用户昵称 */ private String userNickname; /** * 用户手机号码 */ private String userMobile; /** * 用户头像图片 */ private String userAvatar; /** * 0 可用;1 禁用;2 注销 */ private Integer userStatus; /** * 用户推荐人ID */ private Integer userReferrer; /** * 创建时间 */ private Date addTime; /** * 更新时间 */ private Date updateTime; /** * 邀请团队人数 */ private Integer goupSize; /** * 直邀人数 */ private Integer underlingSize; /** * 团队VIP人数 */ private Integer groupVipSize; /** * 直邀VIP人数 */ private Integer underlingVipSize; /** * 团队经理人数 */ private Integer groupManagerSize; /** * 直邀经理人数 */ private Integer underlingManagerSize; /** * 团队总裁人数 */ private Integer groupCeoSize; /** * 直邀总裁人数 */ private Integer underlingCeoSize; /** * 顶层推荐人id */ private Integer topRefereeId; /** * 生命源 */ private Long lifeSource; /** * 不可提现消费能量源 */ private Long energySource; /** * 可提现能量源 */ private Long activateEnergySource; /** * 当日需结算能量源 */ private Long clearingEnergySource; /** * 币 */ private Long bean; /** * 可提现币 */ private Long tranBean; /** * 关系 */ private String relation; /** * 银行卡 */ private String bankCard; /** * 冻结生命源 */ private Long freezeLifeSource; /** * 冻结能量源 */ private Long freezeEnergySource; /** * 冻结币 */ private Long freezeBean; /** * 个人总业绩 */ private Long sumEnergySource; /** *团队总业绩 */ private Long sumTeamEnergySource; /** * 是否是省市区代理 */ private Integer isAdmin; /** * 省市区 级别 */ @TableField("`rank`") private Integer rank; /** * 城市三级联动表ID */ private Integer zoneCode; /** * 城市三级联动表名称 */ private String zoneName; /** * 是否为冻结奖励 0:未冻结 1:已冻结 */ private Integer isFreezeAward; /** * 是否冻结提现 0未冻结 1已冻结 */ private Integer isFreezeWithdrawDeposit; /** * 是否冻结释放 0未冻结 1已冻结 */ private Integer isFreezeRelease; /** * 是否锁定用户 0未锁定 1已锁定 */ private Integer isLockTheUser; private String address; private Integer passwordTow; /** * 生命源价值 */ private Long lifeSourceAssets; /** * 中奖次数 * @return */ private int bingoCount; public Long getTranBean() { return tranBean; } public void setTranBean(Long tranBean) { this.tranBean = tranBean; } public Integer getPasswordTow() { return passwordTow; } public void setPasswordTow(Integer passwordTow) { this.passwordTow = passwordTow; } public Integer getRole() { return role; } public void setRole(Integer role) { this.role = role; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public Integer getIsFreezeAward() { return isFreezeAward; } public void setIsFreezeAward(Integer isFreezeAward) { this.isFreezeAward = isFreezeAward; } public Integer getIsFreezeWithdrawDeposit() { return isFreezeWithdrawDeposit; } public void setIsFreezeWithdrawDeposit(Integer isFreezeWithdrawDeposit) { this.isFreezeWithdrawDeposit = isFreezeWithdrawDeposit; } public Long getActivateEnergySource() { return activateEnergySource; } public void setActivateEnergySource(Long activateEnergySource) { this.activateEnergySource = activateEnergySource; } public Long getClearingEnergySource() { return clearingEnergySource; } public void setClearingEnergySource(Long clearingEnergySource) { this.clearingEnergySource = clearingEnergySource; } public Integer getUnderlingVipSize() { return underlingVipSize; } public void setUnderlingVipSize(Integer underlingVipSize) { this.underlingVipSize = underlingVipSize; } public Integer getGroupManagerSize() { return groupManagerSize; } public void setGroupManagerSize(Integer groupManagerSize) { this.groupManagerSize = groupManagerSize; } public Integer getUnderlingManagerSize() { return underlingManagerSize; } public void setUnderlingManagerSize(Integer underlingManagerSize) { this.underlingManagerSize = underlingManagerSize; } public Integer getGroupCeoSize() { return groupCeoSize; } public void setGroupCeoSize(Integer groupCeoSize) { this.groupCeoSize = groupCeoSize; } public Integer getUnderlingCeoSize() { return underlingCeoSize; } public void setUnderlingCeoSize(Integer underlingCeoSize) { this.underlingCeoSize = underlingCeoSize; } public Integer getIsFreezeRelease() { return isFreezeRelease; } public void setIsFreezeRelease(Integer isFreezeRelease) { this.isFreezeRelease = isFreezeRelease; } public Integer getIsLockTheUser() { return isLockTheUser; } public void setIsLockTheUser(Integer isLockTheUser) { this.isLockTheUser = isLockTheUser; } public Integer getIsAdmin() { return isAdmin; } public void setIsAdmin(Integer isAdmin) { this.isAdmin = isAdmin; } public Integer getRank() { return rank; } public void setRank(Integer rank) { this.rank = rank; } public Integer getZoneCode() { return zoneCode; } public void setZoneCode(Integer zoneCode) { this.zoneCode = zoneCode; } public String getZoneName() { return zoneName; } public void setZoneName(String zoneName) { this.zoneName = zoneName; } public UserEntity() { } public UserEntity(Integer userId, Integer userLevel,Integer rank) { this.userId = userId; this.userLevel = userLevel; this.rank = rank; } public Long getSumEnergySource() { return sumEnergySource; } public void setSumEnergySource(Long sumEnergySource) { this.sumEnergySource = sumEnergySource; } public Long getSumTeamEnergySource() { return sumTeamEnergySource; } public void setSumTeamEnergySource(Long sumTeamEnergySource) { this.sumTeamEnergySource = sumTeamEnergySource; } public Integer getUserId() { return userId; } public UserEntity setUserId(Integer userId) { this.userId = userId; return this; } public String getUserPassword() { return userPassword; } public UserEntity setUserPassword(String userPassword) { this.userPassword = userPassword; return this; } public Date getUserLastLoginTime() { return userLastLoginTime; } public UserEntity setUserLastLoginTime(Date userLastLoginTime) { this.userLastLoginTime = userLastLoginTime; return this; } public Integer getUserLevel() { return userLevel; } public UserEntity setUserLevel(Integer userLevel) { this.userLevel = userLevel; return this; } public String getUserNickname() { return userNickname; } public UserEntity setUserNickname(String userNickname) { this.userNickname = userNickname; return this; } public String getUserMobile() { return userMobile; } public UserEntity setUserMobile(String userMobile) { this.userMobile = userMobile; return this; } public String getUserAvatar() { return userAvatar; } public UserEntity setUserAvatar(String userAvatar) { this.userAvatar = userAvatar; return this; } public Integer getUserStatus() { return userStatus; } public UserEntity setUserStatus(Integer userStatus) { this.userStatus = userStatus; return this; } public Integer getUserReferrer() { return userReferrer; } public UserEntity setUserReferrer(Integer userReferrer) { this.userReferrer = userReferrer; return this; } public Date getAddTime() { return addTime; } public UserEntity setAddTime(Date addTime) { this.addTime = addTime; return this; } public Date getUpdateTime() { return updateTime; } public UserEntity setUpdateTime(Date updateTime) { this.updateTime = updateTime; return this; } public Integer getGoupSize() { return goupSize; } public UserEntity setGoupSize(Integer goupSize) { this.goupSize = goupSize; return this; } public Integer getUnderlingSize() { return underlingSize; } public UserEntity setUnderlingSize(Integer underlingSize) { this.underlingSize = underlingSize; return this; } public Integer getGroupVipSize() { return groupVipSize; } public UserEntity setGroupVipSize(Integer groupVipSize) { this.groupVipSize = groupVipSize; return this; } public Integer getTopRefereeId() { return topRefereeId; } public UserEntity setTopRefereeId(Integer topRefereeId) { this.topRefereeId = topRefereeId; return this; } public Long getLifeSource() { return lifeSource; } public void setLifeSource(Long lifeSource) { this.lifeSource = lifeSource; } public Long getEnergySource() { return energySource; } public void setEnergySource(Long energySource) { this.energySource = energySource; } public Long getBean() { return bean; } public void setBean(Long bean) { this.bean = bean; } public String getRelation() { return relation; } public UserEntity setRelation(String relation) { this.relation = relation; return this; } public String getBankCard() { return bankCard; } public UserEntity setBankCard(String bankCard) { this.bankCard = bankCard; return this; } public Long getFreezeLifeSource() { return freezeLifeSource; } public void setFreezeLifeSource(Long freezeLifeSource) { this.freezeLifeSource = freezeLifeSource; } public Long getFreezeEnergySource() { return freezeEnergySource; } public void setFreezeEnergySource(Long freezeEnergySource) { this.freezeEnergySource = freezeEnergySource; } public Long getFreezeBean() { return freezeBean; } public void setFreezeBean(Long freezeBean) { this.freezeBean = freezeBean; } public Long getLifeSourceAssets() { return lifeSourceAssets; } public void setLifeSourceAssets(Long lifeSourceAssets) { this.lifeSourceAssets = lifeSourceAssets; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserEntity that = (UserEntity) o; return userId.equals(that.userId); } @Override public int hashCode() { return Objects.hash(userId); } public int getBingoCount() { return bingoCount; } public void setBingoCount(int bingoCount) { this.bingoCount = bingoCount; } }
[ "513667225@qq.com" ]
513667225@qq.com
48c3950f01f7a27196058887baaa8a2f958db103
aaf9e0840829aa6d310a3c2ca2d6a034d5a92994
/android/app/src/debug/java/com/tfltubestatusapp/ReactNativeFlipper.java
bd9c20756e948135898b3bcf0a66e71804ec5983
[]
no_license
timiles/tfl-tube-status-app
4e013fc0b48de868bb545a88380e3524c13e3fd0
cb5fd2683e3ccb2cf7d1097ced68ef0d5e912309
refs/heads/main
2023-05-03T19:39:42.264511
2021-05-23T19:42:30
2021-05-23T19:42:30
370,114,325
0
0
null
null
null
null
UTF-8
Java
false
false
3,267
java
/** * Copyright (c) Facebook, Inc. and its affiliates. * * <p>This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. */ package com.tfltubestatusapp; import android.content.Context; import com.facebook.flipper.android.AndroidFlipperClient; import com.facebook.flipper.android.utils.FlipperUtils; import com.facebook.flipper.core.FlipperClient; import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; import com.facebook.flipper.plugins.inspector.DescriptorMapping; import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; import okhttp3.OkHttpClient; public class ReactNativeFlipper { public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { if (FlipperUtils.shouldEnableFlipper(context)) { final FlipperClient client = AndroidFlipperClient.getInstance(context); client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); client.addPlugin(new ReactFlipperPlugin()); client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); NetworkingModule.setCustomClientBuilder( new NetworkingModule.CustomClientBuilder() { @Override public void apply(OkHttpClient.Builder builder) { builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); } }); client.addPlugin(networkFlipperPlugin); client.start(); // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized // Hence we run if after all native modules have been initialized ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); reactContext.runOnNativeModulesQueueThread( new Runnable() { @Override public void run() { client.addPlugin(new FrescoFlipperPlugin()); } }); } }); } else { client.addPlugin(new FrescoFlipperPlugin()); } } } }
[ "tim@timiles.com" ]
tim@timiles.com
906856ab46414243401530a35da3634afbe30587
a9903f3ff6b282e2712b887d4ee8fd79866cfade
/src/main/java/org/byron4j/cookbook/netty/message/MessageResponsePacket.java
5a2e54cd316d1f5f253a5014e2beb87d2296c0d7
[ "MIT" ]
permissive
Byron4j/CookBook
2a40fac245b6a61447a26d31db7fd28386e81951
1979653ec7eeee95c8422494e5af732e11b30efb
refs/heads/master
2023-03-04T13:10:27.544573
2023-01-30T03:42:27
2023-01-30T03:42:27
153,215,823
799
281
MIT
2022-12-16T13:43:01
2018-10-16T03:16:19
Java
UTF-8
Java
false
false
608
java
package org.byron4j.cookbook.netty.message; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.byron4j.cookbook.netty.apidemo.command.Command; import org.byron4j.cookbook.netty.apidemo.packet.Packet; @Data @NoArgsConstructor @AllArgsConstructor @Builder public class MessageResponsePacket extends Packet { /**消息内容*/ private String message; /** * 消息请求命令 * @return */ @Override public Byte getCommand() { return Command.MESSAGE_RESPONSE; } }
[ "byron@LAPTOP-JFJ7CR82" ]
byron@LAPTOP-JFJ7CR82
cfad2757392894373726e50f7f918ec06f756813
0d18b69be9b92defaaa97f31c98b965dd91819e4
/guns-admin/src/main/java/com/guo/guns/modular/system/service/IDictService.java
471e533d4497ff32e7ba568d3d79ba3273b91771
[ "Apache-2.0" ]
permissive
tuyugg123/guo-projects
bc9cda10847bed9d1b69479acdb5a533c96e154e
596acd3f0adda5b23f9e8f693884aa03abc20828
refs/heads/master
2020-03-07T04:38:13.505116
2018-03-05T17:32:07
2018-03-05T17:32:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package com.guo.guns.modular.system.service; /** * 字典服务 * * @author fengshuonan * @date 2017-04-27 17:00 */ public interface IDictService { /** * 添加字典 * * @author fengshuonan * @Date 2017/4/27 17:01 */ void addDict(String dictName, String dictValues); /** * 编辑字典 * * @author fengshuonan * @Date 2017/4/28 11:01 */ void editDict(Integer dictId, String dictName, String dicts); /** * 删除字典 * * @author fengshuonan * @Date 2017/4/28 11:39 */ void delteDict(Integer dictId); }
[ "gxx632364@gmail.com" ]
gxx632364@gmail.com
b719195b2837d9f5a75ce1b1b9124befdf3ebd1f
4d1db9e6a87fbd5fa8dc70da3d7c2e7e6d681493
/src/main/java/com/kandagar/rls/model/EducationModel.java
5730ca1a7ec8e2f0d360074b2bf0e53c5278a0df
[]
no_license
Kopylova/kandagar
d38e41e01ad876e5d9c1e156fe2c694407bd5945
1953a83f048099329eb6009a7880b8c11e4b2303
refs/heads/master
2016-09-05T09:28:26.145267
2015-02-16T23:11:44
2015-02-16T23:11:44
30,892,356
0
0
null
null
null
null
UTF-8
Java
false
false
88
java
package com.kandagar.rls.model; public class EducationModel extends BaseTitleModel{ }
[ "kopylovaanastas@gmail.com" ]
kopylovaanastas@gmail.com
e8e07ba6dc1a9d7b0149865f42ee00261cad7a22
35029f02d7573415d6fc558cfeeb19c7bfa1e3cc
/gs-accessing-data-jpa-complete/src/main/java/hello/service/CustomerService2528.java
e2bbc4bda3e546deca86170673dfbe9a2b5a7e03
[]
no_license
MirekSz/spring-boot-slow-startup
e06fe9d4f3831ee1e79cf3735f6ceb8c50340cbe
3b1e9e4ebd4a95218b142b7eb397d0eaa309e771
refs/heads/master
2021-06-25T22:50:21.329236
2017-02-19T19:08:24
2017-02-19T19:08:24
59,591,530
0
2
null
null
null
null
UTF-8
Java
false
false
119
java
package hello.service; import org.springframework.stereotype.Service; @Service public class CustomerService2528 { }
[ "miro1994" ]
miro1994
a4395f35251fae11c23c4e462ba20bf3b37e816a
6a3f05af9e1f224ea52b2d912935697714652079
/app/src/main/java/com/marko/teletrader/model/news/NewsResult.java
2d8dca77ce7c47cf99d69c36065828025bd22636
[]
no_license
marko-mihajlovic/InterviewApp-TeleTrader
ca43966c749a5c33cf9ad5938886c206b3b19f10
49ffd4c0d5b1ced00ed65446f36a173c37ff0400
refs/heads/master
2023-07-10T22:07:25.647021
2021-08-23T20:08:39
2021-08-23T20:08:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
560
java
package com.marko.teletrader.model.news; import androidx.annotation.NonNull; import com.tickaroo.tikxml.annotation.Element; import com.tickaroo.tikxml.annotation.Path; import com.tickaroo.tikxml.annotation.Xml; import java.util.ArrayList; import java.util.List; @Xml(name = "Result") public class NewsResult{ @Path("NewsList") @Element public List<News> newsList; public NewsResult(){ } @NonNull public List<News> getNewsList(){ if(newsList==null) return new ArrayList<>(); return newsList; } }
[ "mmaker.biz@gmail.com" ]
mmaker.biz@gmail.com
bfd6d7ea1731e7c903f1715568da7ddc4fd513ee
4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d
/src/main/java/com/alipay/api/domain/AlipayMarketingCardTemplateCreateModel.java
c1bdc6d687ecd74cdef3fc81506243ebc1cd7b06
[ "Apache-2.0" ]
permissive
weizai118/payment-alipay
042898e172ce7f1162a69c1dc445e69e53a1899c
e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1
refs/heads/master
2020-04-05T06:29:57.113650
2018-11-06T11:03:05
2018-11-06T11:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,146
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 会员卡模板创建 * * @author auto create * @since 1.0, 2018-03-14 10:42:35 */ public class AlipayMarketingCardTemplateCreateModel extends AlipayObject { private static final long serialVersionUID = 2495433996399317387L; /** * 业务卡号前缀,由商户指定 支付宝业务卡号生成规则:biz_no_prefix(商户指定)卡号前缀 + biz_no_suffix(实时生成)卡号后缀 */ @ApiField("biz_no_prefix") private String bizNoPrefix; /** * 业务卡号后缀的长度,取值范围为[8,32] 支付宝业务卡号生成规则:biz_no_prefix(商户指定)卡号前缀 + biz_no_suffix(实时生成)卡号后缀 由于业务卡号最长不超过32位,所以biz_no_suffix_len <= 32 - biz_no_prefix的位数 */ @ApiField("biz_no_suffix_len") private String bizNoSuffixLen; /** * 卡行动点配置; 行动点,即用户可点击跳转的区块,类似按钮控件的交互; 单张卡最多定制4个行动点。 */ @ApiListField("card_action_list") @ApiField("template_action_info_d_t_o") private List<TemplateActionInfoDTO> cardActionList; /** * 卡级别配置 */ @ApiListField("card_level_conf") @ApiField("template_card_level_conf_d_t_o") private List<TemplateCardLevelConfDTO> cardLevelConf; /** * 卡特定标签,只供特定业务使用,通常接入无需关注 */ @ApiField("card_spec_tag") private String cardSpecTag; /** * 卡类型为固定枚举类型,可选类型如下: OUT_MEMBER_CARD:外部权益卡 */ @ApiField("card_type") private String cardType; /** * 栏位信息 */ @ApiListField("column_info_list") @ApiField("template_column_info_d_t_o") private List<TemplateColumnInfoDTO> columnInfoList; /** * 字段规则列表,会员卡开卡过程中,会员卡信息的生成规则, 例如:卡有效期为开卡后两年内有效,则设置为:DATE_IN_FUTURE */ @ApiListField("field_rule_list") @ApiField("template_field_rule_d_t_o") private List<TemplateFieldRuleDTO> fieldRuleList; /** * 商户动态码通知参数配置: 当write_off_type指定为商户动态码mdbarcode或mdqrcode时必填; 在此字段配置用户打开会员卡时支付宝通知商户生成动态码(发码)的通知参数,如接收通知地址等。 */ @ApiField("mdcode_notify_conf") private TemplateMdcodeNotifyConfDTO mdcodeNotifyConf; /** * 会员卡用户领卡配置,在门店等渠道露出领卡入口时,需要部署的商户领卡H5页面地址 */ @ApiField("open_card_conf") private TemplateOpenCardConfDTO openCardConf; /** * 卡模板投放渠道 */ @ApiListField("pub_channels") @ApiField("pub_channel_d_t_o") private List<PubChannelDTO> pubChannels; /** * 请求ID,由开发者生成并保证唯一性 */ @ApiField("request_id") private String requestId; /** * 服务Code HUABEI_FUWU:花呗服务(只有需要花呗服务时,才需要加入该标识) */ @ApiListField("service_label_list") @ApiField("string") private List<String> serviceLabelList; /** * 会员卡上架门店id(支付宝门店id),既发放会员卡的商家门店id */ @ApiListField("shop_ids") @ApiField("string") private List<String> shopIds; /** * 权益信息, 1、在卡包的卡详情页面会自动添加权益栏位,展现会员卡特权, 2、如果添加门店渠道,则可在门店页展现会员卡的权益 */ @ApiListField("template_benefit_info") @ApiField("template_benefit_info_d_t_o") private List<TemplateBenefitInfoDTO> templateBenefitInfo; /** * 模板样式信息 */ @ApiField("template_style_info") private TemplateStyleInfoDTO templateStyleInfo; /** * 卡包详情页面中展现出的卡码(可用于扫码核销) (1) 静态码 qrcode: 二维码,扫码得商户开卡传入的external_card_no barcode: 条形码,扫码得商户开卡传入的external_card_no text: 当前不再推荐使用,text的展示效果目前等价于barcode+qrcode,同时出现条形码和二维码 (2) 动态码-支付宝生成码值(动态码会在2分钟左右后过期) dqrcode: 动态二维码,扫码得到的码值可配合会员卡查询接口使用 dbarcode: 动态条形码,扫码得到的码值可配合会员卡查询接口使用 (3) 动态码-商家自主生成码值(码值、时效性都由商户控制) mdqrcode: 商户动态二维码,扫码得商户自主传入的码值 mdbarcode: 商户动态条码,扫码得商户自主传入的码值 */ @ApiField("write_off_type") private String writeOffType; /** * Gets biz no prefix. * * @return the biz no prefix */ public String getBizNoPrefix() { return this.bizNoPrefix; } /** * Sets biz no prefix. * * @param bizNoPrefix the biz no prefix */ public void setBizNoPrefix(String bizNoPrefix) { this.bizNoPrefix = bizNoPrefix; } /** * Gets biz no suffix len. * * @return the biz no suffix len */ public String getBizNoSuffixLen() { return this.bizNoSuffixLen; } /** * Sets biz no suffix len. * * @param bizNoSuffixLen the biz no suffix len */ public void setBizNoSuffixLen(String bizNoSuffixLen) { this.bizNoSuffixLen = bizNoSuffixLen; } /** * Gets card action list. * * @return the card action list */ public List<TemplateActionInfoDTO> getCardActionList() { return this.cardActionList; } /** * Sets card action list. * * @param cardActionList the card action list */ public void setCardActionList(List<TemplateActionInfoDTO> cardActionList) { this.cardActionList = cardActionList; } /** * Gets card level conf. * * @return the card level conf */ public List<TemplateCardLevelConfDTO> getCardLevelConf() { return this.cardLevelConf; } /** * Sets card level conf. * * @param cardLevelConf the card level conf */ public void setCardLevelConf(List<TemplateCardLevelConfDTO> cardLevelConf) { this.cardLevelConf = cardLevelConf; } /** * Gets card spec tag. * * @return the card spec tag */ public String getCardSpecTag() { return this.cardSpecTag; } /** * Sets card spec tag. * * @param cardSpecTag the card spec tag */ public void setCardSpecTag(String cardSpecTag) { this.cardSpecTag = cardSpecTag; } /** * Gets card type. * * @return the card type */ public String getCardType() { return this.cardType; } /** * Sets card type. * * @param cardType the card type */ public void setCardType(String cardType) { this.cardType = cardType; } /** * Gets column info list. * * @return the column info list */ public List<TemplateColumnInfoDTO> getColumnInfoList() { return this.columnInfoList; } /** * Sets column info list. * * @param columnInfoList the column info list */ public void setColumnInfoList(List<TemplateColumnInfoDTO> columnInfoList) { this.columnInfoList = columnInfoList; } /** * Gets field rule list. * * @return the field rule list */ public List<TemplateFieldRuleDTO> getFieldRuleList() { return this.fieldRuleList; } /** * Sets field rule list. * * @param fieldRuleList the field rule list */ public void setFieldRuleList(List<TemplateFieldRuleDTO> fieldRuleList) { this.fieldRuleList = fieldRuleList; } /** * Gets mdcode notify conf. * * @return the mdcode notify conf */ public TemplateMdcodeNotifyConfDTO getMdcodeNotifyConf() { return this.mdcodeNotifyConf; } /** * Sets mdcode notify conf. * * @param mdcodeNotifyConf the mdcode notify conf */ public void setMdcodeNotifyConf(TemplateMdcodeNotifyConfDTO mdcodeNotifyConf) { this.mdcodeNotifyConf = mdcodeNotifyConf; } /** * Gets open card conf. * * @return the open card conf */ public TemplateOpenCardConfDTO getOpenCardConf() { return this.openCardConf; } /** * Sets open card conf. * * @param openCardConf the open card conf */ public void setOpenCardConf(TemplateOpenCardConfDTO openCardConf) { this.openCardConf = openCardConf; } /** * Gets pub channels. * * @return the pub channels */ public List<PubChannelDTO> getPubChannels() { return this.pubChannels; } /** * Sets pub channels. * * @param pubChannels the pub channels */ public void setPubChannels(List<PubChannelDTO> pubChannels) { this.pubChannels = pubChannels; } /** * Gets request id. * * @return the request id */ public String getRequestId() { return this.requestId; } /** * Sets request id. * * @param requestId the request id */ public void setRequestId(String requestId) { this.requestId = requestId; } /** * Gets service label list. * * @return the service label list */ public List<String> getServiceLabelList() { return this.serviceLabelList; } /** * Sets service label list. * * @param serviceLabelList the service label list */ public void setServiceLabelList(List<String> serviceLabelList) { this.serviceLabelList = serviceLabelList; } /** * Gets shop ids. * * @return the shop ids */ public List<String> getShopIds() { return this.shopIds; } /** * Sets shop ids. * * @param shopIds the shop ids */ public void setShopIds(List<String> shopIds) { this.shopIds = shopIds; } /** * Gets template benefit info. * * @return the template benefit info */ public List<TemplateBenefitInfoDTO> getTemplateBenefitInfo() { return this.templateBenefitInfo; } /** * Sets template benefit info. * * @param templateBenefitInfo the template benefit info */ public void setTemplateBenefitInfo(List<TemplateBenefitInfoDTO> templateBenefitInfo) { this.templateBenefitInfo = templateBenefitInfo; } /** * Gets template style info. * * @return the template style info */ public TemplateStyleInfoDTO getTemplateStyleInfo() { return this.templateStyleInfo; } /** * Sets template style info. * * @param templateStyleInfo the template style info */ public void setTemplateStyleInfo(TemplateStyleInfoDTO templateStyleInfo) { this.templateStyleInfo = templateStyleInfo; } /** * Gets write off type. * * @return the write off type */ public String getWriteOffType() { return this.writeOffType; } /** * Sets write off type. * * @param writeOffType the write off type */ public void setWriteOffType(String writeOffType) { this.writeOffType = writeOffType; } }
[ "hanley@thlws.com" ]
hanley@thlws.com
9d9de18fc68190317206df5371b218cdcbb8c087
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-aliyuncvc/src/main/java/com/aliyuncs/aliyuncvc/model/v20190919/CheckMeetingCodeResponse.java
9e3ee8412dc640c299899af4865c77ba154ea12f
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
4,336
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.aliyuncvc.model.v20190919; import com.aliyuncs.AcsResponse; import com.aliyuncs.aliyuncvc.transform.v20190919.CheckMeetingCodeResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CheckMeetingCodeResponse extends AcsResponse { private Integer errorCode; private Boolean success; private String requestId; private String message; private MeetingInfo meetingInfo; public Integer getErrorCode() { return this.errorCode; } public void setErrorCode(Integer errorCode) { this.errorCode = errorCode; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public MeetingInfo getMeetingInfo() { return this.meetingInfo; } public void setMeetingInfo(MeetingInfo meetingInfo) { this.meetingInfo = meetingInfo; } public static class MeetingInfo { private String meetingDomain; private String meetingToken; private String meetingCode; private String memberUUID; private String clientAppId; private String meetingUUID; private String meetingAppId; private SlsInfo slsInfo; public String getMeetingDomain() { return this.meetingDomain; } public void setMeetingDomain(String meetingDomain) { this.meetingDomain = meetingDomain; } public String getMeetingToken() { return this.meetingToken; } public void setMeetingToken(String meetingToken) { this.meetingToken = meetingToken; } public String getMeetingCode() { return this.meetingCode; } public void setMeetingCode(String meetingCode) { this.meetingCode = meetingCode; } public String getMemberUUID() { return this.memberUUID; } public void setMemberUUID(String memberUUID) { this.memberUUID = memberUUID; } public String getClientAppId() { return this.clientAppId; } public void setClientAppId(String clientAppId) { this.clientAppId = clientAppId; } public String getMeetingUUID() { return this.meetingUUID; } public void setMeetingUUID(String meetingUUID) { this.meetingUUID = meetingUUID; } public String getMeetingAppId() { return this.meetingAppId; } public void setMeetingAppId(String meetingAppId) { this.meetingAppId = meetingAppId; } public SlsInfo getSlsInfo() { return this.slsInfo; } public void setSlsInfo(SlsInfo slsInfo) { this.slsInfo = slsInfo; } public static class SlsInfo { private String logServiceEndpoint; private String logstore; private String project; public String getLogServiceEndpoint() { return this.logServiceEndpoint; } public void setLogServiceEndpoint(String logServiceEndpoint) { this.logServiceEndpoint = logServiceEndpoint; } public String getLogstore() { return this.logstore; } public void setLogstore(String logstore) { this.logstore = logstore; } public String getProject() { return this.project; } public void setProject(String project) { this.project = project; } } } @Override public CheckMeetingCodeResponse getInstance(UnmarshallerContext context) { return CheckMeetingCodeResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com