blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
072684d17530d816c49abdbf79ca28472f96d83a | 35,656,818,507,843 | 95fbfbd5cc62f1c0193a2371c5079bef2dbfe40b | /Project2A.java | 5dec74fee5c9cf6af4f977ed98b0ef286f4e632c | [] | no_license | jsdosanj/Project2A | https://github.com/jsdosanj/Project2A | 6172972f86cca986758c6623ea9bdad5bf7e27a1 | 28b11ff254097f680ee26b3e35c437d11aaefc01 | refs/heads/master | 2021-01-12T12:22:36.793000 | 2019-02-04T18:37:54 | 2019-02-04T18:37:54 | 72,469,734 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import javax.swing.JOptionPane;
public class Project2A
{
public static void main(String[] args)
{
double sqftbrm = 20.0;
double sqftdrm = 40.0;
double sqfthal = 5.0;
double sqftgrm = 60.0;
double sqftstr = 30.0;
double bf = .15;
double df = .10;
double hf = .20;
double gf = 0.25;
double sf = .30;
System.out.println("bedroom: " + sqftbrm + " square feet");
System.out.println("dining room: " + sqftdrm + " square feet");
System.out.println("hall: " + sqfthal + " square feet");
System.out.println("great room: " + sqftgrm + " square feet");
System.out.println("stairs: " + sqftstr + " square feet");
double stndCst = ((sqftbrm + sqftdrm +sqfthal + sqftgrm + sqftstr) / 5.0)*20.00;
System.out.println(stndCst);
double wtAvg = (sqftbrm*bf + sqftdrm*df + sqfthal*hf + sqftgrm*gf + sqftstr*sf)*20.00;
System.out.println(wtAvg);
JOptionPane.showMessageDialog(null,"Standard Carpet Cost: " + stndCst + "\nWeighted Carpet Cost: " + wtAvg);
}
} | UTF-8 | Java | 1,189 | java | Project2A.java | Java | [] | null | [] | import javax.swing.JOptionPane;
public class Project2A
{
public static void main(String[] args)
{
double sqftbrm = 20.0;
double sqftdrm = 40.0;
double sqfthal = 5.0;
double sqftgrm = 60.0;
double sqftstr = 30.0;
double bf = .15;
double df = .10;
double hf = .20;
double gf = 0.25;
double sf = .30;
System.out.println("bedroom: " + sqftbrm + " square feet");
System.out.println("dining room: " + sqftdrm + " square feet");
System.out.println("hall: " + sqfthal + " square feet");
System.out.println("great room: " + sqftgrm + " square feet");
System.out.println("stairs: " + sqftstr + " square feet");
double stndCst = ((sqftbrm + sqftdrm +sqfthal + sqftgrm + sqftstr) / 5.0)*20.00;
System.out.println(stndCst);
double wtAvg = (sqftbrm*bf + sqftdrm*df + sqfthal*hf + sqftgrm*gf + sqftstr*sf)*20.00;
System.out.println(wtAvg);
JOptionPane.showMessageDialog(null,"Standard Carpet Cost: " + stndCst + "\nWeighted Carpet Cost: " + wtAvg);
}
} | 1,189 | 0.544155 | 0.513877 | 34 | 34 | 29.972536 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647059 | false | false | 2 |
ed0af95a7e26069a5ae510fa56872ca1538785be | 34,883,724,402,107 | 92b37539bfaebf454552dd945892ecaaa868f0d5 | /src/HomeWork_26_01_2018/hw6/Pet.java | 628793122d5ac7da9adb880f33924c363ff3b80d | [] | no_license | Serggeybezborodko/26_01_2018 | https://github.com/Serggeybezborodko/26_01_2018 | 03f7589c93662d4ffb6563c2b98a76a112a5cd2f | 9a3653ca96e1b13652f56077d2bb39dc9bb38089 | refs/heads/master | 2021-05-08T19:48:44.848000 | 2018-04-16T20:22:16 | 2018-04-16T20:22:16 | 119,580,974 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package HomeWork_26_01_2018.hw6;
public class Pet {
}
| UTF-8 | Java | 55 | java | Pet.java | Java | [] | null | [] | package HomeWork_26_01_2018.hw6;
public class Pet {
}
| 55 | 0.727273 | 0.563636 | 4 | 12.75 | 13.21694 | 32 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 2 |
b52786f252474f5b899b6d782602ff25e8d6668e | 12,678,743,489,570 | eedd4f13db087452403bb70f05869235aa9a6efc | /openapi-parser/src/main/java/org/openapi4j/parser/model/v3/OpenApi3.java | e29acfe49b60d7baab28e89e7a4580942ef8ba34 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | aravindc26/openapi4j | https://github.com/aravindc26/openapi4j | e120d34b577d1118a0fbf100a0a0f07d08f56878 | e877bc596d51176a826698d351cc41506468ba88 | refs/heads/master | 2022-11-24T12:02:58.589000 | 2020-07-29T16:59:41 | 2020-07-29T16:59:41 | 283,180,890 | 0 | 0 | Apache-2.0 | true | 2020-07-28T10:36:53 | 2020-07-28T10:36:52 | 2020-07-28T04:57:47 | 2020-07-16T11:33:05 | 1,127 | 0 | 0 | 0 | null | false | false | package org.openapi4j.parser.model.v3;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.openapi4j.core.model.OAI;
import org.openapi4j.core.model.OAIContext;
import java.util.List;
import java.util.Map;
@SuppressWarnings("unused")
public class OpenApi3 extends AbsExtendedOpenApiSchema<OpenApi3> implements OAI {
private String openapi;
private Info info;
private List<Server> servers;
private List<Tag> tags;
// paths is required but can be empty (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md?utf8=%E2%9C%93#security-filtering)
@JsonInclude
private Map<String, Path> paths;
private Components components;
private ExternalDocs externalDocs;
@JsonProperty("security")
private List<SecurityRequirement> securityRequirements;
@JsonIgnore
private OAIContext context;
// OpenApi
public String getOpenapi() {
return openapi;
}
public OpenApi3 setOpenapi(String openapi) {
this.openapi = openapi;
return this;
}
// Info
public Info getInfo() {
return info;
}
public OpenApi3 setInfo(Info info) {
this.info = info;
return this;
}
// Server
public List<Server> getServers() {
return servers;
}
public OpenApi3 setServers(List<Server> servers) {
this.servers = servers;
return this;
}
public boolean hasServers() {
return servers != null;
}
public OpenApi3 addServer(Server server) {
servers = listAdd(servers, server);
return this;
}
public OpenApi3 insertServer(int index, Server server) {
servers = listAdd(servers, index, server);
return this;
}
public OpenApi3 removeServer(Server server) {
listRemove(servers, server);
return this;
}
// Path
public Map<String, Path> getPaths() {
return paths;
}
public OpenApi3 setPaths(Map<String, Path> paths) {
this.paths = paths;
return this;
}
public boolean hasPath(String name) {
return mapHas(paths, name);
}
public Path getPath(String name) {
return mapGet(paths, name);
}
public OpenApi3 setPath(String name, Path path) {
paths = mapPut(paths, name, path);
return this;
}
public OpenApi3 removePath(String name) {
mapRemove(paths, name);
return this;
}
// Components
public Components getComponents() {
return components;
}
public OpenApi3 setComponents(Components components) {
this.components = components;
return this;
}
// SecurityRequirement
public List<SecurityRequirement> getSecurityRequirements() {
return securityRequirements;
}
public OpenApi3 setSecurityRequirements(List<SecurityRequirement> securityRequirements) {
this.securityRequirements = securityRequirements;
return this;
}
public boolean hasSecurityRequirements() {
return securityRequirements != null;
}
public OpenApi3 addSecurityRequirement(SecurityRequirement securityRequirement) {
securityRequirements = listAdd(securityRequirements, securityRequirement);
return this;
}
public OpenApi3 insertSecurityRequirement(int index, SecurityRequirement securityRequirement) {
securityRequirements = listAdd(securityRequirements, index, securityRequirement);
return this;
}
public OpenApi3 removeSecurityRequirement(SecurityRequirement securityRequirement) {
listRemove(securityRequirements, securityRequirement);
return this;
}
// Tag
public List<Tag> getTags() {
return tags;
}
public OpenApi3 setTags(List<Tag> tags) {
this.tags = tags;
return this;
}
public boolean hasTags() {
return tags != null;
}
public OpenApi3 addTag(Tag tag) {
tags = listAdd(tags, tag);
return this;
}
public OpenApi3 insertTag(int index, Tag tag) {
tags = listAdd(tags, index, tag);
return this;
}
public OpenApi3 removeTag(Tag tag) {
listRemove(tags, tag);
return this;
}
// ExternalDocs
public ExternalDocs getExternalDocs() {
return externalDocs;
}
public OpenApi3 setExternalDocs(ExternalDocs externalDocs) {
this.externalDocs = externalDocs;
return this;
}
@Override
public OAIContext getContext() {
return context;
}
@Override
public void setContext(OAIContext context) {
this.context = context;
}
//////////////////////////////////////////////////////////////
// UTILITY METHODS
//////////////////////////////////////////////////////////////
/**
* @param operationId the operationId (case sensitive)
* @return Get the corresponding operation with the given ID
*/
public Operation getOperationById(String operationId) {
if (paths == null) return null;
for (Path path : paths.values()) {
if (path.getOperations() == null) {
continue;
}
for (Operation operation : path.getOperations().values()) {
if (operationId.equals(operation.getOperationId())) {
return operation;
}
}
}
return null;
}
public String getPathFrom(Path specPath) {
if (paths == null) return null;
for (Map.Entry<String, Path> path : paths.entrySet()) {
if (path.getValue().equals(specPath)) {
return path.getKey();
}
}
return null;
}
/**
* @param operationId the operationId (case sensitive)
* @return Get the corresponding operation with the given ID
*/
public Path getPathItemByOperationId(String operationId) {
if (paths == null) return null;
for (Path path : paths.values()) {
if (path.getOperations() == null) {
continue;
}
for (Operation operation : path.getOperations().values()) {
if (operationId.equals(operation.getOperationId())) {
return path;
}
}
}
return null;
}
@Override
public OpenApi3 copy() {
OpenApi3 copy = new OpenApi3();
copy.setOpenapi(getOpenapi());
copy.setInfo(copyField(getInfo()));
copy.setServers(copyList(getServers()));
copy.setTags(copyList(getTags()));
copy.setPaths(copyMap(getPaths()));
copy.setComponents(copyField(getComponents()));
copy.setExternalDocs(copyField(getExternalDocs()));
copy.setSecurityRequirements(copyList(getSecurityRequirements()));
copy.setExtensions(copySimpleMap(getExtensions()));
copy.setContext(context);
return copy;
}
}
| UTF-8 | Java | 6,420 | java | OpenApi3.java | Java | [
{
"context": " is required but can be empty (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.",
"end": 605,
"score": 0.548234224319458,
"start": 602,
"tag": "USERNAME",
"value": "OAI"
}
] | null | [] | package org.openapi4j.parser.model.v3;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.openapi4j.core.model.OAI;
import org.openapi4j.core.model.OAIContext;
import java.util.List;
import java.util.Map;
@SuppressWarnings("unused")
public class OpenApi3 extends AbsExtendedOpenApiSchema<OpenApi3> implements OAI {
private String openapi;
private Info info;
private List<Server> servers;
private List<Tag> tags;
// paths is required but can be empty (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md?utf8=%E2%9C%93#security-filtering)
@JsonInclude
private Map<String, Path> paths;
private Components components;
private ExternalDocs externalDocs;
@JsonProperty("security")
private List<SecurityRequirement> securityRequirements;
@JsonIgnore
private OAIContext context;
// OpenApi
public String getOpenapi() {
return openapi;
}
public OpenApi3 setOpenapi(String openapi) {
this.openapi = openapi;
return this;
}
// Info
public Info getInfo() {
return info;
}
public OpenApi3 setInfo(Info info) {
this.info = info;
return this;
}
// Server
public List<Server> getServers() {
return servers;
}
public OpenApi3 setServers(List<Server> servers) {
this.servers = servers;
return this;
}
public boolean hasServers() {
return servers != null;
}
public OpenApi3 addServer(Server server) {
servers = listAdd(servers, server);
return this;
}
public OpenApi3 insertServer(int index, Server server) {
servers = listAdd(servers, index, server);
return this;
}
public OpenApi3 removeServer(Server server) {
listRemove(servers, server);
return this;
}
// Path
public Map<String, Path> getPaths() {
return paths;
}
public OpenApi3 setPaths(Map<String, Path> paths) {
this.paths = paths;
return this;
}
public boolean hasPath(String name) {
return mapHas(paths, name);
}
public Path getPath(String name) {
return mapGet(paths, name);
}
public OpenApi3 setPath(String name, Path path) {
paths = mapPut(paths, name, path);
return this;
}
public OpenApi3 removePath(String name) {
mapRemove(paths, name);
return this;
}
// Components
public Components getComponents() {
return components;
}
public OpenApi3 setComponents(Components components) {
this.components = components;
return this;
}
// SecurityRequirement
public List<SecurityRequirement> getSecurityRequirements() {
return securityRequirements;
}
public OpenApi3 setSecurityRequirements(List<SecurityRequirement> securityRequirements) {
this.securityRequirements = securityRequirements;
return this;
}
public boolean hasSecurityRequirements() {
return securityRequirements != null;
}
public OpenApi3 addSecurityRequirement(SecurityRequirement securityRequirement) {
securityRequirements = listAdd(securityRequirements, securityRequirement);
return this;
}
public OpenApi3 insertSecurityRequirement(int index, SecurityRequirement securityRequirement) {
securityRequirements = listAdd(securityRequirements, index, securityRequirement);
return this;
}
public OpenApi3 removeSecurityRequirement(SecurityRequirement securityRequirement) {
listRemove(securityRequirements, securityRequirement);
return this;
}
// Tag
public List<Tag> getTags() {
return tags;
}
public OpenApi3 setTags(List<Tag> tags) {
this.tags = tags;
return this;
}
public boolean hasTags() {
return tags != null;
}
public OpenApi3 addTag(Tag tag) {
tags = listAdd(tags, tag);
return this;
}
public OpenApi3 insertTag(int index, Tag tag) {
tags = listAdd(tags, index, tag);
return this;
}
public OpenApi3 removeTag(Tag tag) {
listRemove(tags, tag);
return this;
}
// ExternalDocs
public ExternalDocs getExternalDocs() {
return externalDocs;
}
public OpenApi3 setExternalDocs(ExternalDocs externalDocs) {
this.externalDocs = externalDocs;
return this;
}
@Override
public OAIContext getContext() {
return context;
}
@Override
public void setContext(OAIContext context) {
this.context = context;
}
//////////////////////////////////////////////////////////////
// UTILITY METHODS
//////////////////////////////////////////////////////////////
/**
* @param operationId the operationId (case sensitive)
* @return Get the corresponding operation with the given ID
*/
public Operation getOperationById(String operationId) {
if (paths == null) return null;
for (Path path : paths.values()) {
if (path.getOperations() == null) {
continue;
}
for (Operation operation : path.getOperations().values()) {
if (operationId.equals(operation.getOperationId())) {
return operation;
}
}
}
return null;
}
public String getPathFrom(Path specPath) {
if (paths == null) return null;
for (Map.Entry<String, Path> path : paths.entrySet()) {
if (path.getValue().equals(specPath)) {
return path.getKey();
}
}
return null;
}
/**
* @param operationId the operationId (case sensitive)
* @return Get the corresponding operation with the given ID
*/
public Path getPathItemByOperationId(String operationId) {
if (paths == null) return null;
for (Path path : paths.values()) {
if (path.getOperations() == null) {
continue;
}
for (Operation operation : path.getOperations().values()) {
if (operationId.equals(operation.getOperationId())) {
return path;
}
}
}
return null;
}
@Override
public OpenApi3 copy() {
OpenApi3 copy = new OpenApi3();
copy.setOpenapi(getOpenapi());
copy.setInfo(copyField(getInfo()));
copy.setServers(copyList(getServers()));
copy.setTags(copyList(getTags()));
copy.setPaths(copyMap(getPaths()));
copy.setComponents(copyField(getComponents()));
copy.setExternalDocs(copyField(getExternalDocs()));
copy.setSecurityRequirements(copyList(getSecurityRequirements()));
copy.setExtensions(copySimpleMap(getExtensions()));
copy.setContext(context);
return copy;
}
}
| 6,420 | 0.673832 | 0.668224 | 271 | 22.690037 | 23.21184 | 150 | false | false | 0 | 0 | 0 | 0 | 64 | 0.009969 | 0.435424 | false | false | 2 |
2ec523e9a0c45350c3549f2f290b6451e83ba32d | 38,517,266,714,002 | 1591964e727a00c3f02216c04c528762f5adfcd0 | /src/test/java/com/github/ddth/recipes/qnd/apiservice/thrift/QndThriftClientSslMultiThreads.java | 34bbc0ce885499026af18b5a96e481a09d95ffa8 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | DDTH/ddth-recipes | https://github.com/DDTH/ddth-recipes | 9d6d0c832bdf87f6b2812c89876195e3c46d2493 | d81590eb64ea7447fa475eace45ac3ad762f3321 | refs/heads/master | 2022-10-08T18:25:20.919000 | 2019-09-06T12:40:26 | 2019-09-06T12:40:26 | 135,836,993 | 0 | 0 | MIT | false | 2022-10-04T23:44:28 | 2018-06-02T17:09:50 | 2019-09-06T12:40:35 | 2022-10-04T23:44:25 | 177 | 0 | 0 | 6 | Java | false | false | package com.github.ddth.recipes.qnd.apiservice.thrift;
import com.github.ddth.recipes.apiservice.thrift.ThriftApiClient;
import com.github.ddth.recipes.apiservice.thrift.ThriftUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
public class QndThriftClientSslMultiThreads extends BaseQndThriftClient {
public static void main(String[] args) throws Exception {
int numServers = 4;
int baseServerPort = 9443;
String serverHost = "127.0.0.1";
List<String> hostsAndPortsList = new LinkedList<>();
for (int i = 0; i < numServers; i++) {
hostsAndPortsList.add(serverHost + ":" + (baseServerPort + i));
}
String hostsAndPorts = StringUtils.join(hostsAndPortsList, ",");
File truststore = new File("./src/test/resources/keys/client.truststore");
String truststorePass = "s3cr3t";
int numThreads = 16, numCallsPerThreads = 10_000;
try (ThriftApiClient client = ThriftUtils
.createThriftApiClientSsl(hostsAndPorts, true, truststore.getAbsolutePath(), truststorePass)) {
doTestMultiThreads(client, numThreads, numCallsPerThreads);
}
}
}
| UTF-8 | Java | 1,246 | java | QndThriftClientSslMultiThreads.java | Java | [
{
"context": "seServerPort = 9443;\n String serverHost = \"127.0.0.1\";\n List<String> hostsAndPortsList = new Li",
"end": 541,
"score": 0.9976887106895447,
"start": 532,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "nt.truststore\");\n String truststorePass = \"s3cr3t\";\n int numThreads = 16, numCallsPerThreads",
"end": 933,
"score": 0.9993985891342163,
"start": 927,
"tag": "PASSWORD",
"value": "s3cr3t"
}
] | null | [] | package com.github.ddth.recipes.qnd.apiservice.thrift;
import com.github.ddth.recipes.apiservice.thrift.ThriftApiClient;
import com.github.ddth.recipes.apiservice.thrift.ThriftUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
public class QndThriftClientSslMultiThreads extends BaseQndThriftClient {
public static void main(String[] args) throws Exception {
int numServers = 4;
int baseServerPort = 9443;
String serverHost = "127.0.0.1";
List<String> hostsAndPortsList = new LinkedList<>();
for (int i = 0; i < numServers; i++) {
hostsAndPortsList.add(serverHost + ":" + (baseServerPort + i));
}
String hostsAndPorts = StringUtils.join(hostsAndPortsList, ",");
File truststore = new File("./src/test/resources/keys/client.truststore");
String truststorePass = "<PASSWORD>";
int numThreads = 16, numCallsPerThreads = 10_000;
try (ThriftApiClient client = ThriftUtils
.createThriftApiClientSsl(hostsAndPorts, true, truststore.getAbsolutePath(), truststorePass)) {
doTestMultiThreads(client, numThreads, numCallsPerThreads);
}
}
}
| 1,250 | 0.694221 | 0.676565 | 29 | 41.965519 | 28.803116 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.931035 | false | false | 2 |
354ef77f177c23ca34e76bdaa0f202ac834b1a50 | 37,400,575,223,769 | a2020c7058d68ad294cf83a8073ed6e897b3d5b0 | /AndroidNanoDegreeProjectCapstone/Phase2/app/src/main/java/io/github/marcelbraghetto/dailydeviations/features/wallpaper/providers/DefaultWallpaperProvider.java | 1fb5d7bb67cae2e778493d1cc382da34daecdbf2 | [
"Apache-2.0"
] | permissive | jose-ramirez/AndroidNanoDegree2016 | https://github.com/jose-ramirez/AndroidNanoDegree2016 | 737a728df7e9e1ae9068897ee570e07a72d92f87 | 2c41d2ee749bf09403a8b2ac2fd8a30d2ad75c59 | refs/heads/master | 2023-03-16T03:41:58.195000 | 2018-05-05T22:58:36 | 2018-05-05T22:58:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package io.github.marcelbraghetto.dailydeviations.features.wallpaper.providers;
import android.content.Context;
import android.support.annotation.NonNull;
import javax.inject.Inject;
import io.github.marcelbraghetto.dailydeviations.features.wallpaper.providers.contracts.WallpaperProvider;
import io.github.marcelbraghetto.dailydeviations.features.wallpaper.services.SetWallpaperIntentService;
/**
* Created by Marcel Braghetto on 25/05/16.
*
* Wallpaper provider.
*/
public class DefaultWallpaperProvider implements WallpaperProvider {
private final Context mApplicationContext;
@Inject
public DefaultWallpaperProvider(@NonNull Context applicationContext) {
mApplicationContext = applicationContext;
}
@Override
public void setPhoneWallpaper(@NonNull String imageUrl, boolean triggeredFromWidget) {
mApplicationContext.startService(SetWallpaperIntentService.createIntent(mApplicationContext, imageUrl, triggeredFromWidget));
}
}
| UTF-8 | Java | 984 | java | DefaultWallpaperProvider.java | Java | [
{
"context": "ices.SetWallpaperIntentService;\n\n/**\n * Created by Marcel Braghetto on 25/05/16.\n *\n * Wallpaper provider.\n */\npublic",
"end": 432,
"score": 0.9999009966850281,
"start": 416,
"tag": "NAME",
"value": "Marcel Braghetto"
}
] | null | [] | package io.github.marcelbraghetto.dailydeviations.features.wallpaper.providers;
import android.content.Context;
import android.support.annotation.NonNull;
import javax.inject.Inject;
import io.github.marcelbraghetto.dailydeviations.features.wallpaper.providers.contracts.WallpaperProvider;
import io.github.marcelbraghetto.dailydeviations.features.wallpaper.services.SetWallpaperIntentService;
/**
* Created by <NAME> on 25/05/16.
*
* Wallpaper provider.
*/
public class DefaultWallpaperProvider implements WallpaperProvider {
private final Context mApplicationContext;
@Inject
public DefaultWallpaperProvider(@NonNull Context applicationContext) {
mApplicationContext = applicationContext;
}
@Override
public void setPhoneWallpaper(@NonNull String imageUrl, boolean triggeredFromWidget) {
mApplicationContext.startService(SetWallpaperIntentService.createIntent(mApplicationContext, imageUrl, triggeredFromWidget));
}
}
| 974 | 0.810976 | 0.804878 | 28 | 34.142857 | 38.730492 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 2 |
ef3b2971c7654c3665ecebc6b71211e8d5b1e197 | 15,161,234,608,444 | 2aa1f7b28c6c5e3bad81e4b77ec00e6744e133e5 | /src/main/java/com/DasMaxx/TestNG.java | fd8d79603aad24a4716398f5dd8e2ef266dc1524 | [] | no_license | JDDas/HelloMaven2 | https://github.com/JDDas/HelloMaven2 | fd61f8d530b107a5057e5d6b825b748893a33681 | 2772d03b24d05679c07b63b5b3fcae649ba6558a | refs/heads/master | 2023-07-15T01:04:31.125000 | 2021-09-01T03:31:07 | 2021-09-01T03:31:07 | 398,895,529 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.DasMaxx;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.List;
public class TestNG {
static WebDriver driver;
static String email = "JD@gmail.com";
static String expectedRegText = "Don't have an account yet? Sign up for one now to gain access to all our member tools.";
static String firstName = "JD";
static String lastName = "Das";
@Test
public void registerPage() throws InterruptedException {
System.out.println("TestNG Practice");
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
driver.get("https://demo.broadleafcommerce.org/");
WebElement loginBtn = driver.findElement(By.xpath("//a[@href ='/login']"));
loginBtn.click();
WebElement actualTextElement = driver.findElement(By.xpath("//*[@id='register']/p"));
String actualText = actualTextElement.getText();
System.out.println(actualText);
Assert.assertEquals(actualText,expectedRegText);
WebElement registerEmailInput = driver.findElement(By.xpath("//input[@id='customer.emailAddress']"));
registerEmailInput.sendKeys(email);
WebElement firstNameInput = driver.findElement(By.id("customer.firstName"));
firstNameInput.sendKeys(firstName);
WebElement lastNameInput = driver.findElement(By.name("customer.lastName"));
lastNameInput.sendKeys(lastName);
List<WebElement> passList = driver.findElements(By.id("password"));
WebElement passwordInput = passList.get(1);
passwordInput.sendKeys("abcd123");
WebElement conPasswordInput = driver.findElement(By.id("passwordConfirm"));
conPasswordInput.sendKeys("abcd123");
//@Test
// public void registerPageTest() throws InterruptedException{
List<WebElement> submitList = driver.findElements(By.xpath("//button[@type='submit']"));
WebElement registerBtn = submitList.get(2);
Thread.sleep(100);
registerBtn.click();
Thread.sleep(3000);
String uName = driver.findElement(By.xpath("//*[@id='sectionsNav']/div/div[1]/ul[2]/li[1]/a")).getText();
System.out.println(uName);
driver.quit();
System.out.println("Registration Completed!!!");
}
}
| UTF-8 | Java | 2,492 | java | TestNG.java | Java | [
{
"context": "package com.DasMaxx;\n\nimport io.github.bonigarcia.wdm.WebDriverManager;\nimport org.junit.Assert;\nim",
"end": 49,
"score": 0.9981274008750916,
"start": 39,
"tag": "USERNAME",
"value": "bonigarcia"
},
{
"context": "atic WebDriver driver;\n static String email = \"JD@gmail.com\";\n static String expectedRegText = \"Don't have",
"end": 393,
"score": 0.9999176859855652,
"start": 381,
"tag": "EMAIL",
"value": "JD@gmail.com"
},
{
"context": "ur member tools.\";\n static String firstName = \"JD\";\n static String lastName = \"Das\";\n\n\n\n @Tes",
"end": 555,
"score": 0.9988753795623779,
"start": 553,
"tag": "NAME",
"value": "JD"
},
{
"context": "g firstName = \"JD\";\n static String lastName = \"Das\";\n\n\n\n @Test\n public void registerPage() thr",
"end": 591,
"score": 0.9958489537239075,
"start": 588,
"tag": "NAME",
"value": "Das"
},
{
"context": "t registerEmailInput = driver.findElement(By.xpath(\"//input[@id='customer.emailAddress']\"));\n registerEmai",
"end": 1305,
"score": 0.6560262441635132,
"start": 1296,
"tag": "EMAIL",
"value": "input[@id"
},
{
"context": "driver.findElement(By.xpath(\"//input[@id='customer.emailAddress']\"));\n registerEmailInput.sendKeys(email);",
"end": 1328,
"score": 0.9227606654167175,
"start": 1316,
"tag": "EMAIL",
"value": "emailAddress"
},
{
"context": " passList.get(1);\n passwordInput.sendKeys(\"abcd123\");\n\n WebElement conPasswordInput = driver.",
"end": 1806,
"score": 0.9989447593688965,
"start": 1799,
"tag": "PASSWORD",
"value": "abcd123"
},
{
"context": "ordConfirm\"));\n conPasswordInput.sendKeys(\"abcd123\");\n\n //@Test\n // public void registerPageTes",
"end": 1937,
"score": 0.99896240234375,
"start": 1930,
"tag": "PASSWORD",
"value": "abcd123"
}
] | null | [] | package com.DasMaxx;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.List;
public class TestNG {
static WebDriver driver;
static String email = "<EMAIL>";
static String expectedRegText = "Don't have an account yet? Sign up for one now to gain access to all our member tools.";
static String firstName = "JD";
static String lastName = "Das";
@Test
public void registerPage() throws InterruptedException {
System.out.println("TestNG Practice");
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
driver.get("https://demo.broadleafcommerce.org/");
WebElement loginBtn = driver.findElement(By.xpath("//a[@href ='/login']"));
loginBtn.click();
WebElement actualTextElement = driver.findElement(By.xpath("//*[@id='register']/p"));
String actualText = actualTextElement.getText();
System.out.println(actualText);
Assert.assertEquals(actualText,expectedRegText);
WebElement registerEmailInput = driver.findElement(By.xpath("//<EMAIL>='customer.<EMAIL>']"));
registerEmailInput.sendKeys(email);
WebElement firstNameInput = driver.findElement(By.id("customer.firstName"));
firstNameInput.sendKeys(firstName);
WebElement lastNameInput = driver.findElement(By.name("customer.lastName"));
lastNameInput.sendKeys(lastName);
List<WebElement> passList = driver.findElements(By.id("password"));
WebElement passwordInput = passList.get(1);
passwordInput.sendKeys("<PASSWORD>");
WebElement conPasswordInput = driver.findElement(By.id("passwordConfirm"));
conPasswordInput.sendKeys("<PASSWORD>");
//@Test
// public void registerPageTest() throws InterruptedException{
List<WebElement> submitList = driver.findElements(By.xpath("//button[@type='submit']"));
WebElement registerBtn = submitList.get(2);
Thread.sleep(100);
registerBtn.click();
Thread.sleep(3000);
String uName = driver.findElement(By.xpath("//*[@id='sectionsNav']/div/div[1]/ul[2]/li[1]/a")).getText();
System.out.println(uName);
driver.quit();
System.out.println("Registration Completed!!!");
}
}
| 2,486 | 0.684189 | 0.676966 | 70 | 34.599998 | 31.78607 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.642857 | false | false | 2 |
8a1c7e1fd39283fd71548bb39fc100c39c2b3471 | 23,227,183,181,170 | 310d79c21e393a717e9e10afd8f81a3b96029e46 | /P2/DA345AHT17_P2_Forsberg_Linus/java/com/lfo/p2/Fragment/AddGroupDialogFragment.java | 706c08524a6856b0c0a981dc5ca7a38668e3541e | [] | no_license | riomontana/AndroidDevelopment | https://github.com/riomontana/AndroidDevelopment | 4f88718faa6ddaf76ba668a6fc960bdaf93ada27 | 2702765c57e46b6c4a2cf4cb5508f42a8231cd12 | refs/heads/master | 2020-09-12T03:41:31.266000 | 2019-11-17T18:25:34 | 2019-11-17T18:25:34 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lfo.p2.Fragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.lfo.p2.Controller.Controller;
import com.lfo.p2.R;
/**
* A simple {@link Fragment} subclass.
*/
public class AddGroupDialogFragment extends DialogFragment {
private Controller controller;
private EditText inputGroupName;
public AddGroupDialogFragment() {
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.fragment_add_group_dialog, null);
inputGroupName = (EditText) view.findViewById(R.id.inputGroupName);
alertDialogBuilder.setView(view);
alertDialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(inputGroupName.length() < 1) {
Toast.makeText(getActivity(), getString(R.string.input_minimum),
Toast.LENGTH_SHORT).show();
dismiss();
} else {
controller.registerGroup(inputGroupName.getText().toString());
controller.updateGroups();
Toast.makeText(getActivity(), getString(R.string.member_of) + " " +
inputGroupName.getText().toString(),
Toast.LENGTH_SHORT).show();
dismiss();
}
}
});
return alertDialogBuilder.create();
}
public void setController(Controller controller) {
this.controller = controller;
}
}
| UTF-8 | Java | 2,153 | java | AddGroupDialogFragment.java | Java | [] | null | [] | package com.lfo.p2.Fragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.lfo.p2.Controller.Controller;
import com.lfo.p2.R;
/**
* A simple {@link Fragment} subclass.
*/
public class AddGroupDialogFragment extends DialogFragment {
private Controller controller;
private EditText inputGroupName;
public AddGroupDialogFragment() {
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.fragment_add_group_dialog, null);
inputGroupName = (EditText) view.findViewById(R.id.inputGroupName);
alertDialogBuilder.setView(view);
alertDialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(inputGroupName.length() < 1) {
Toast.makeText(getActivity(), getString(R.string.input_minimum),
Toast.LENGTH_SHORT).show();
dismiss();
} else {
controller.registerGroup(inputGroupName.getText().toString());
controller.updateGroups();
Toast.makeText(getActivity(), getString(R.string.member_of) + " " +
inputGroupName.getText().toString(),
Toast.LENGTH_SHORT).show();
dismiss();
}
}
});
return alertDialogBuilder.create();
}
public void setController(Controller controller) {
this.controller = controller;
}
}
| 2,153 | 0.643288 | 0.640502 | 66 | 31.621212 | 26.7903 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.575758 | false | false | 2 |
6db99cc0c87ff86ddf4df346956b440b2a5fc414 | 5,076,651,394,355 | 61257e0c100905febf5990e83cf349ca62f19b18 | /src/model/attribute/LightsAttr.java | 80f30c580a0d6f70b64a539f5714ba85b837deca | [] | no_license | GlennFolker/Models | https://github.com/GlennFolker/Models | a7170633b92bea530cc590deb495a85e4de4b389 | 86baffd1a3dce20126d7393be12028cf1527ce8f | refs/heads/master | 2023-08-28T23:24:56.592000 | 2021-09-30T04:00:59 | 2021-09-30T04:00:59 | 407,851,763 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package model.attribute;
import arc.graphics.*;
import arc.graphics.gl.*;
import arc.math.geom.*;
import arc.struct.*;
import arc.util.*;
import model.attribute.Attribute.*;
import model.attribute.LightsAttr.*;
import model.attribute.LightsAttr.AmbLightsAttr.*;
import model.attribute.LightsAttr.DirLightsAttr.*;
/** An {@link Attribute} specified for lights. This attribute type defines a {@link Seq} of the generic lights. */
public abstract class LightsAttr<T extends Lights<T>, V extends LightsAttr<T, V, A>, A extends AttrAlias<V>> extends Attribute<V, A>{
/** All the lights that this attribute has. */
public final Seq<T> values = new Seq<>();
@SafeVarargs
protected LightsAttr(A alias, T... lights){
super(alias);
values.addAll(lights);
}
protected LightsAttr(A alias, Iterable<T> lights){
super(alias);
values.addAll(lights);
}
@Override
public StringBuilder preprocess(StringBuilder builder){
Object[] items = values.items;
return builder.append("#define num").append(Strings.capitalize(alias.name())).append(' ').append(items.length).append("\n");
}
@Override
public void apply(Shader shader){
shader.setUniformi(alias.uniform() + "Size", values.size);
}
/** The light type to be used in {@link #values}. Always has color; extend this class to implement other behaviors. */
public static abstract class Lights<T extends Lights<T>>{
/** The {@link Color} of this light. */
public final Color color = new Color();
/** @return An exact copy of this light. */
public abstract T copy();
}
/** Defines a {@link LightsAttr} type containing {@link AmbLights}. */
public static class AmbLightsAttr extends LightsAttr<AmbLights, AmbLightsAttr, AmbLightsAlias>{
public AmbLightsAttr(AmbLights... lights){
super(AmbLightsAlias.ambLights, lights);
}
public AmbLightsAttr(Iterable<AmbLights> lights){
super(AmbLightsAlias.ambLights, lights);
}
@Override
public StringBuilder preprocess(StringBuilder builder){
return builder.append("#define ").append(alias.flag()).append('\n');
}
@Override
public void apply(Shader shader){
if(values.isEmpty()) return;
Tmp.c1.set(0f, 0f, 0f, 0f);
for(var l : values){
Tmp.c1.r += l.color.r;
Tmp.c1.g += l.color.g;
Tmp.c1.b += l.color.b;
Tmp.c1.a += l.color.a;
}
Tmp.c1.r /= values.size;
Tmp.c1.g /= values.size;
Tmp.c1.b /= values.size;
Tmp.c1.a /= values.size;
shader.setUniformf(alias.uniform(), Tmp.c1);
}
@Override
public AmbLightsAttr copy(){
return new AmbLightsAttr(values);
}
/** An ambient light. Affects all models globally, no matter what. */
public static class AmbLights extends Lights<AmbLights>{
public AmbLights(){}
public AmbLights(Color color){
set(color.r, color.g, color.b, color.a);
}
public AmbLights(float r, float g, float b, float a){
set(r, g, b, a);
}
public AmbLights set(Color color){
return set(color.r, color.g, color.b, color.a);
}
public AmbLights set(float r, float g, float b, float a){
this.color.set(r, g, b, a);
return this;
}
@Override
public AmbLights copy(){
return new AmbLights(color);
}
}
/** Defines all supported attribute aliases for a {@link DirLightsAlias}. */
public enum AmbLightsAlias implements AttrAlias<AmbLightsAttr>{
ambLights;
public final long id = register(name());
@Override
public long id(){
return id;
}
}
}
/** Defines a {@link LightsAttr} type containing {@link DirLights}. */
public static class DirLightsAttr extends LightsAttr<DirLights, DirLightsAttr, DirLightsAlias>{
public DirLightsAttr(DirLights... lights){
super(DirLightsAlias.dirLights, lights);
}
public DirLightsAttr(Iterable<DirLights> lights){
super(DirLightsAlias.dirLights, lights);
}
@Override
public void apply(Shader shader){
super.apply(shader);
var u = alias.uniform();
for(int i = 0; i < values.size; i++){
var l = values.get(i);
var index = u + "[" + i + "].";
shader.setUniformf(index + "color", l.color);
shader.setUniformf(index + "dir", l.dir);
}
}
@Override
public DirLightsAttr copy(){
return new DirLightsAttr(values.map(DirLights::copy));
}
/** A directional light; has no position, only rotation. Affects all models globally based on the faces' normals. */
public static class DirLights extends Lights<DirLights>{
/** The direction of this light. */
public final Vec3 dir = new Vec3();
public DirLights(){}
public DirLights(Vec3 dir){
this.dir.set(dir);
}
public DirLights(Color color){
this.color.set(color);
}
public DirLights(Color color, Vec3 dir){
set(color, dir);
}
public DirLights set(Color color, Vec3 dir){
this.color.set(color);
this.dir.set(dir).nor();
return this;
}
@Override
public DirLights copy(){
return new DirLights(color, dir);
}
}
/** Defines all supported attribute aliases for a {@link DirLightsAlias}. */
public enum DirLightsAlias implements AttrAlias<DirLightsAttr>{
dirLights;
public final long id = register(name());
@Override
public long id(){
return id;
}
}
}
}
| UTF-8 | Java | 6,310 | java | LightsAttr.java | Java | [] | null | [] | package model.attribute;
import arc.graphics.*;
import arc.graphics.gl.*;
import arc.math.geom.*;
import arc.struct.*;
import arc.util.*;
import model.attribute.Attribute.*;
import model.attribute.LightsAttr.*;
import model.attribute.LightsAttr.AmbLightsAttr.*;
import model.attribute.LightsAttr.DirLightsAttr.*;
/** An {@link Attribute} specified for lights. This attribute type defines a {@link Seq} of the generic lights. */
public abstract class LightsAttr<T extends Lights<T>, V extends LightsAttr<T, V, A>, A extends AttrAlias<V>> extends Attribute<V, A>{
/** All the lights that this attribute has. */
public final Seq<T> values = new Seq<>();
@SafeVarargs
protected LightsAttr(A alias, T... lights){
super(alias);
values.addAll(lights);
}
protected LightsAttr(A alias, Iterable<T> lights){
super(alias);
values.addAll(lights);
}
@Override
public StringBuilder preprocess(StringBuilder builder){
Object[] items = values.items;
return builder.append("#define num").append(Strings.capitalize(alias.name())).append(' ').append(items.length).append("\n");
}
@Override
public void apply(Shader shader){
shader.setUniformi(alias.uniform() + "Size", values.size);
}
/** The light type to be used in {@link #values}. Always has color; extend this class to implement other behaviors. */
public static abstract class Lights<T extends Lights<T>>{
/** The {@link Color} of this light. */
public final Color color = new Color();
/** @return An exact copy of this light. */
public abstract T copy();
}
/** Defines a {@link LightsAttr} type containing {@link AmbLights}. */
public static class AmbLightsAttr extends LightsAttr<AmbLights, AmbLightsAttr, AmbLightsAlias>{
public AmbLightsAttr(AmbLights... lights){
super(AmbLightsAlias.ambLights, lights);
}
public AmbLightsAttr(Iterable<AmbLights> lights){
super(AmbLightsAlias.ambLights, lights);
}
@Override
public StringBuilder preprocess(StringBuilder builder){
return builder.append("#define ").append(alias.flag()).append('\n');
}
@Override
public void apply(Shader shader){
if(values.isEmpty()) return;
Tmp.c1.set(0f, 0f, 0f, 0f);
for(var l : values){
Tmp.c1.r += l.color.r;
Tmp.c1.g += l.color.g;
Tmp.c1.b += l.color.b;
Tmp.c1.a += l.color.a;
}
Tmp.c1.r /= values.size;
Tmp.c1.g /= values.size;
Tmp.c1.b /= values.size;
Tmp.c1.a /= values.size;
shader.setUniformf(alias.uniform(), Tmp.c1);
}
@Override
public AmbLightsAttr copy(){
return new AmbLightsAttr(values);
}
/** An ambient light. Affects all models globally, no matter what. */
public static class AmbLights extends Lights<AmbLights>{
public AmbLights(){}
public AmbLights(Color color){
set(color.r, color.g, color.b, color.a);
}
public AmbLights(float r, float g, float b, float a){
set(r, g, b, a);
}
public AmbLights set(Color color){
return set(color.r, color.g, color.b, color.a);
}
public AmbLights set(float r, float g, float b, float a){
this.color.set(r, g, b, a);
return this;
}
@Override
public AmbLights copy(){
return new AmbLights(color);
}
}
/** Defines all supported attribute aliases for a {@link DirLightsAlias}. */
public enum AmbLightsAlias implements AttrAlias<AmbLightsAttr>{
ambLights;
public final long id = register(name());
@Override
public long id(){
return id;
}
}
}
/** Defines a {@link LightsAttr} type containing {@link DirLights}. */
public static class DirLightsAttr extends LightsAttr<DirLights, DirLightsAttr, DirLightsAlias>{
public DirLightsAttr(DirLights... lights){
super(DirLightsAlias.dirLights, lights);
}
public DirLightsAttr(Iterable<DirLights> lights){
super(DirLightsAlias.dirLights, lights);
}
@Override
public void apply(Shader shader){
super.apply(shader);
var u = alias.uniform();
for(int i = 0; i < values.size; i++){
var l = values.get(i);
var index = u + "[" + i + "].";
shader.setUniformf(index + "color", l.color);
shader.setUniformf(index + "dir", l.dir);
}
}
@Override
public DirLightsAttr copy(){
return new DirLightsAttr(values.map(DirLights::copy));
}
/** A directional light; has no position, only rotation. Affects all models globally based on the faces' normals. */
public static class DirLights extends Lights<DirLights>{
/** The direction of this light. */
public final Vec3 dir = new Vec3();
public DirLights(){}
public DirLights(Vec3 dir){
this.dir.set(dir);
}
public DirLights(Color color){
this.color.set(color);
}
public DirLights(Color color, Vec3 dir){
set(color, dir);
}
public DirLights set(Color color, Vec3 dir){
this.color.set(color);
this.dir.set(dir).nor();
return this;
}
@Override
public DirLights copy(){
return new DirLights(color, dir);
}
}
/** Defines all supported attribute aliases for a {@link DirLightsAlias}. */
public enum DirLightsAlias implements AttrAlias<DirLightsAttr>{
dirLights;
public final long id = register(name());
@Override
public long id(){
return id;
}
}
}
}
| 6,310 | 0.555151 | 0.551981 | 201 | 30.393034 | 27.845339 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.567164 | false | false | 2 |
c4ebd9b33363b0da9fa4ea89d6ea38834998b1be | 5,789,615,962,311 | 4e3ca6b56bed4aefa6a379fa8605423e4033a3aa | /src/com/company/ThisKeyword.java | e7d9c223f23c36be135d55c59b54a543e6f0e1e7 | [] | no_license | mehulumistry/JavaProjects | https://github.com/mehulumistry/JavaProjects | d74dac17b2dc3d69e021aeafe8f85ef355e40acc | f2545e82cf68a46f85ac017906d0a43e954d30a1 | refs/heads/master | 2021-01-23T14:41:21.063000 | 2017-09-07T05:11:18 | 2017-09-07T05:11:18 | 102,693,903 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.company;
/**
* Created by apple on 29/05/17.
* this keyword is used to refer the current class object
* 1.this is used to refer the current class instance variables .
* this() will call default constructor.
*/
class Student
{
int rno;//instance variables
String n;
Student()
{
System.out.println("default ctor");
}
Student(String n)
{
this();
System.out.println(" ctor invoked "+n);
}
Student(int rno,String n)//local variables
{
this("mehul");
this.rno=rno;
this.n=n;
}
void show()
{
System.out.print(rno+" "+n);
}
}
public class ThisKeyword {
public static void main(String[] args) {
Student s=new Student(101,"hally");
s.show();
}
}
| UTF-8 | Java | 799 | java | ThisKeyword.java | Java | [
{
"context": "package com.company;\n\n/**\n * Created by apple on 29/05/17.\n * this keyword is used to refer the",
"end": 45,
"score": 0.547182559967041,
"start": 40,
"tag": "USERNAME",
"value": "apple"
},
{
"context": "ing[] args) {\n\n Student s=new Student(101,\"hally\");\n s.show();\n\n }\n}\n",
"end": 768,
"score": 0.9997191429138184,
"start": 763,
"tag": "NAME",
"value": "hally"
}
] | null | [] | package com.company;
/**
* Created by apple on 29/05/17.
* this keyword is used to refer the current class object
* 1.this is used to refer the current class instance variables .
* this() will call default constructor.
*/
class Student
{
int rno;//instance variables
String n;
Student()
{
System.out.println("default ctor");
}
Student(String n)
{
this();
System.out.println(" ctor invoked "+n);
}
Student(int rno,String n)//local variables
{
this("mehul");
this.rno=rno;
this.n=n;
}
void show()
{
System.out.print(rno+" "+n);
}
}
public class ThisKeyword {
public static void main(String[] args) {
Student s=new Student(101,"hally");
s.show();
}
}
| 799 | 0.56821 | 0.555695 | 45 | 16.755556 | 17.722748 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.311111 | false | false | 2 |
8fc21bca4ae2e278a13fee30b83fd668c27f5b44 | 14,250,701,549,108 | f3a7f02f334558ead0a4cee40311785959811eb2 | /src/leetCode/Math/_168_171_ExcelColumnNumber.java | 577fab7caf55444970856655a67171752e28ec96 | [] | no_license | XiSmartElf/leetCode-CC150-Others | https://github.com/XiSmartElf/leetCode-CC150-Others | ab4e2e4617bed2ca486abcfca58783c4d408d76b | c1834f6c260f13e13a1c253a8ab2699ac67247ff | refs/heads/master | 2016-09-11T11:11:33.924000 | 2015-07-04T23:16:41 | 2015-07-04T23:16:41 | 28,666,306 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package leetCode.Math;
//CharAT-'A' to get distance?! good idea can verify it later and look into char operation
public class _168_171_ExcelColumnNumber {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(convertToTitle(270));
}
public static int titleToNumber(String s) {
int result = 0;
for(int i=0;i < s.length();i++)
{
result = 26*result + s.charAt(i)-'A'+1;
}
return result;
}
public static String convertToTitle(int n) {
String res="";
while(n>0){
Character m = (char) ('A'+(n-1)%26);
res= m+res;
n=(n-1)/26;
}
return res;
}
}
| UTF-8 | Java | 748 | java | _168_171_ExcelColumnNumber.java | Java | [] | null | [] | package leetCode.Math;
//CharAT-'A' to get distance?! good idea can verify it later and look into char operation
public class _168_171_ExcelColumnNumber {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(convertToTitle(270));
}
public static int titleToNumber(String s) {
int result = 0;
for(int i=0;i < s.length();i++)
{
result = 26*result + s.charAt(i)-'A'+1;
}
return result;
}
public static String convertToTitle(int n) {
String res="";
while(n>0){
Character m = (char) ('A'+(n-1)%26);
res= m+res;
n=(n-1)/26;
}
return res;
}
}
| 748 | 0.536096 | 0.508021 | 34 | 21 | 20.798756 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.794118 | false | false | 2 |
f315584cfc7112d88deb3703c3a3e7ed7ed55447 | 38,087,770,001,843 | 1bb54f59e914bbaaf181236ce0b0a2042e8a996c | /client java/UserManagerWebservice/src/test/java/sn/mdk/UserManagerWS/UserManagerWsApplicationTests.java | 29f540449043ed4053a869dacbec2b76d399074e | [] | no_license | keitajunior/webservice-project | https://github.com/keitajunior/webservice-project | 5e259452e2d674c7412e70f35976cadf194cbaf8 | b956fa9d9acade74ff1716a0e1153fc0f12ae52a | refs/heads/main | 2023-09-04T16:51:36.355000 | 2021-11-03T08:54:45 | 2021-11-03T08:54:45 | 420,492,863 | 0 | 0 | null | false | 2021-11-03T08:38:43 | 2021-10-23T18:32:19 | 2021-10-23T18:34:48 | 2021-11-03T08:38:41 | 74 | 0 | 0 | 0 | PHP | false | false | package sn.mdk.UserManagerWS;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UserManagerWsApplicationTests {
@Test
void contextLoads() {
}
}
| UTF-8 | Java | 219 | java | UserManagerWsApplicationTests.java | Java | [] | null | [] | package sn.mdk.UserManagerWS;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UserManagerWsApplicationTests {
@Test
void contextLoads() {
}
}
| 219 | 0.794521 | 0.794521 | 13 | 15.846154 | 18.505077 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false | 2 |
74ec70261648d36c288e55031c4e185e82a875a4 | 38,087,769,999,508 | 5442dcb53eb13c17166826ae292dd0502752be85 | /src/main/java/bloomfilter/TestGuavaBloomFilter.java | 9391f61200218687cc9e2f6c8d5aa05f7ad2e845 | [] | no_license | fanfte/Java-basic-test | https://github.com/fanfte/Java-basic-test | b3edf000ceb48af65006c8cd31891d7e89ffd5ca | b62fa029f558ec171a16009bcbf2a22a94cf0179 | refs/heads/master | 2021-06-19T04:06:51.155000 | 2019-07-17T02:45:57 | 2019-07-17T02:45:57 | 197,300,507 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package bloomfilter;
import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
/**
* Created by tianen on 2019/6/11
*
* @author fanfte
* @date 2019/6/11
**/
public class TestGuavaBloomFilter {
public static void main(String[] args) {
long star = System.currentTimeMillis();
BloomFilter<Integer> filter = BloomFilter.create(
Funnels.integerFunnel(),
10000000,
0.01);
for (int i = 0; i < 10000000; i++) {
filter.put(i);
}
System.out.println(filter.mightContain(1));
System.out.println(filter.mightContain(2));
System.out.println(filter.mightContain(3));
System.out.println(filter.mightContain(10000000));
long end = System.currentTimeMillis();
System.out.println("执行时间:" + (end - star));
}
}
| UTF-8 | Java | 882 | java | TestGuavaBloomFilter.java | Java | [
{
"context": "com.google.common.hash.Funnels;\n\n/**\n * Created by tianen on 2019/6/11\n *\n * @author fanfte\n * @date 2019/6",
"end": 129,
"score": 0.9995288848876953,
"start": 123,
"tag": "USERNAME",
"value": "tianen"
},
{
"context": "**\n * Created by tianen on 2019/6/11\n *\n * @author fanfte\n * @date 2019/6/11\n **/\npublic class TestGuavaBlo",
"end": 163,
"score": 0.9996564984321594,
"start": 157,
"tag": "USERNAME",
"value": "fanfte"
}
] | null | [] | package bloomfilter;
import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
/**
* Created by tianen on 2019/6/11
*
* @author fanfte
* @date 2019/6/11
**/
public class TestGuavaBloomFilter {
public static void main(String[] args) {
long star = System.currentTimeMillis();
BloomFilter<Integer> filter = BloomFilter.create(
Funnels.integerFunnel(),
10000000,
0.01);
for (int i = 0; i < 10000000; i++) {
filter.put(i);
}
System.out.println(filter.mightContain(1));
System.out.println(filter.mightContain(2));
System.out.println(filter.mightContain(3));
System.out.println(filter.mightContain(10000000));
long end = System.currentTimeMillis();
System.out.println("执行时间:" + (end - star));
}
}
| 882 | 0.606651 | 0.555046 | 32 | 26.25 | 20.325476 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 2 |
fdd3223c4a3b39e4dc13dc4fb3bebdf957b2f17b | 36,043,365,583,015 | a4982b176c16b14ae28551b0af3e2759ebe6fc8c | /src/main/java/br/com/avaliacao/service/EnderecoWebService.java | bd9d7909fe8fc0c9f8defd4a7963203cd8e32ca8 | [] | no_license | danilovsantos/avaliacao | https://github.com/danilovsantos/avaliacao | 4015958f56ef4ae03efc2b9ccc42df6c69cee176 | ef11ca8719615e3511d1a2adb52953835006794d | refs/heads/master | 2020-07-02T04:03:51.447000 | 2016-11-21T18:36:18 | 2016-11-21T18:36:18 | 74,314,513 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.avaliacao.service;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import br.com.avaliacao.dao.EnderecoDao;
import br.com.avaliacao.dao.EnderecoDaoImpl;
import br.com.avaliacao.entity.EnderecoEntity;
import br.com.avaliacao.helper.ObjectResponse;
@Path("/endereco")
public class EnderecoWebService {
private ObjectResponse objResponse = new ObjectResponse();
private EnderecoDao dao = new EnderecoDaoImpl();
@POST
@Path("/cadastro")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response cadastrarEndereco(EnderecoEntity endereco){
this.validade(endereco);
if(this.objResponse.hasError()){
this.objResponse.setMessage("Erro ao validar dados de entrada!");
return Response.ok(this.objResponse).build();
}
this.dao.save(endereco);
this.objResponse.setMessage("Endereço cadastrado com sucesso!");
return Response.ok(this.objResponse).build();
}
@POST
@Path("/alteracao")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response alterarEndereco(EnderecoEntity endereco){
this.validade(endereco);
if(this.objResponse.hasError()){
this.objResponse.setMessage("Erro ao validar dados de entrada!");
return Response.ok(this.objResponse).build();
}
this.dao.save(endereco);
return Response.ok("Endereço alterado com sucesso!").build();
}
@GET
@Path("/exclusao/{idEndereco}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response excluirEndereco(@PathParam("idEndereco") Long id){
EnderecoEntity endereco = this.dao.findById(EnderecoEntity.class, id);
this.dao.remove(endereco);
return Response.ok("Endereço deletado com sucesso!").build();
}
private void validade(EnderecoEntity endereco){
if(endereco.getRua() == null || endereco.getRua().trim().equals("")){
this.objResponse.setError("Campo Rua é Obrigatório!");
}
if(endereco.getNumero() == null){
this.objResponse.setError("Campo Número é Obrigatório!");
}
if(endereco.getCep() == null || endereco.getCep().trim().equals("")){
this.objResponse.setError("Campo Cep é Obrigatório!");
}
if(endereco.getCidade() == null || endereco.getCidade().trim().equals("")){
this.objResponse.setError("Campo Cidade é Obrigatório!");
}
if(endereco.getEstado() == null || endereco.getEstado().trim().equals("")){
this.objResponse.setError("Campo Estado é Obrigatório!");
}
}
}
| UTF-8 | Java | 2,680 | java | EnderecoWebService.java | Java | [] | null | [] | package br.com.avaliacao.service;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import br.com.avaliacao.dao.EnderecoDao;
import br.com.avaliacao.dao.EnderecoDaoImpl;
import br.com.avaliacao.entity.EnderecoEntity;
import br.com.avaliacao.helper.ObjectResponse;
@Path("/endereco")
public class EnderecoWebService {
private ObjectResponse objResponse = new ObjectResponse();
private EnderecoDao dao = new EnderecoDaoImpl();
@POST
@Path("/cadastro")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response cadastrarEndereco(EnderecoEntity endereco){
this.validade(endereco);
if(this.objResponse.hasError()){
this.objResponse.setMessage("Erro ao validar dados de entrada!");
return Response.ok(this.objResponse).build();
}
this.dao.save(endereco);
this.objResponse.setMessage("Endereço cadastrado com sucesso!");
return Response.ok(this.objResponse).build();
}
@POST
@Path("/alteracao")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response alterarEndereco(EnderecoEntity endereco){
this.validade(endereco);
if(this.objResponse.hasError()){
this.objResponse.setMessage("Erro ao validar dados de entrada!");
return Response.ok(this.objResponse).build();
}
this.dao.save(endereco);
return Response.ok("Endereço alterado com sucesso!").build();
}
@GET
@Path("/exclusao/{idEndereco}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response excluirEndereco(@PathParam("idEndereco") Long id){
EnderecoEntity endereco = this.dao.findById(EnderecoEntity.class, id);
this.dao.remove(endereco);
return Response.ok("Endereço deletado com sucesso!").build();
}
private void validade(EnderecoEntity endereco){
if(endereco.getRua() == null || endereco.getRua().trim().equals("")){
this.objResponse.setError("Campo Rua é Obrigatório!");
}
if(endereco.getNumero() == null){
this.objResponse.setError("Campo Número é Obrigatório!");
}
if(endereco.getCep() == null || endereco.getCep().trim().equals("")){
this.objResponse.setError("Campo Cep é Obrigatório!");
}
if(endereco.getCidade() == null || endereco.getCidade().trim().equals("")){
this.objResponse.setError("Campo Cidade é Obrigatório!");
}
if(endereco.getEstado() == null || endereco.getEstado().trim().equals("")){
this.objResponse.setError("Campo Estado é Obrigatório!");
}
}
}
| 2,680 | 0.727682 | 0.727682 | 96 | 26.770834 | 24.564745 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.791667 | false | false | 2 |
a4cba300fee9ec9428abf755a974c514a7057af4 | 36,713,380,475,226 | 02fa1832ec120223a6650ffcbf5977f116a8bc5d | /src/main/java/com/example/springlibrary/model/BookDetails.java | 314237c4d7932ca74d93ac7b9a48484bcd9b2692 | [] | no_license | sampurnamondal/SpringBoot-LibraryApp | https://github.com/sampurnamondal/SpringBoot-LibraryApp | 5444c72351aa73387ed68da6b4da95e9e825762e | 4c8f592fb2e912e85396f9c23ac838598d35e784 | refs/heads/main | 2022-12-25T11:05:12.303000 | 2020-10-13T02:05:23 | 2020-10-13T02:05:23 | 303,561,272 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.springlibrary.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "book_details")
public class BookDetails {
@Id
@Column(name = "book_id")
private Integer bookId;
@Column(name = "pages")
private Integer pages;
@Column(name = "country")
private String country;
// @ManyToOne
// @JoinColumn(name = "id")
// private Book book;
public BookDetails() {
}
public BookDetails(Integer bookId, Integer pages, String country) {
this.bookId = bookId;
this.pages = pages;
this.country = country;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public Integer getBookId() {
return bookId;
}
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
public Integer getPages() {
return pages;
}
public void setPages(Integer pages) {
this.pages = pages;
}
}
| UTF-8 | Java | 1,155 | java | BookDetails.java | Java | [] | null | [] | package com.example.springlibrary.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "book_details")
public class BookDetails {
@Id
@Column(name = "book_id")
private Integer bookId;
@Column(name = "pages")
private Integer pages;
@Column(name = "country")
private String country;
// @ManyToOne
// @JoinColumn(name = "id")
// private Book book;
public BookDetails() {
}
public BookDetails(Integer bookId, Integer pages, String country) {
this.bookId = bookId;
this.pages = pages;
this.country = country;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public Integer getBookId() {
return bookId;
}
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
public Integer getPages() {
return pages;
}
public void setPages(Integer pages) {
this.pages = pages;
}
}
| 1,155 | 0.725541 | 0.725541 | 63 | 17.333334 | 15.48681 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.142857 | false | false | 2 |
fb4914209e3ede8ef0d5088242d2561176a272fb | 26,199,300,565,484 | 35078bcc38fd3a96386a36eb0e5142d95150c374 | /impl/custom-app-domain/src/main/java/com/csair/aloysys/app/domain/retro/SkypearlSkyLinkWriterResponseData.java | 6935362b63be8b977eeaa5ba094744b12e0e6729 | [] | no_license | yanpengg/S_A | https://github.com/yanpengg/S_A | f293baf85264c2f2b2e03cccc3271161502e1593 | fea2f84f67e1c423a84b6d4e1370c9a613ea5c50 | refs/heads/master | 2020-03-19T06:06:28.811000 | 2018-06-04T08:22:16 | 2018-06-04T08:22:16 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.csair.aloysys.app.domain.retro;
import java.io.Serializable;
/**
* Created by lunrongda on 2017/08/18.
*/
public class SkypearlSkyLinkWriterResponseData implements Serializable {
private static final long serialVersionUID = 1144625782428480662L;
private String trackID;
private String eligibilityDenialCode;
private String uniqueIdentificationNumber;
public String getTrackID() {
return trackID;
}
public void setTrackID(String trackID) {
this.trackID = trackID;
}
public String getEligibilityDenialCode() {
return eligibilityDenialCode;
}
public void setEligibilityDenialCode(String eligibilityDenialCode) {
this.eligibilityDenialCode = eligibilityDenialCode;
}
public String getUniqueIdentificationNumber() {
return uniqueIdentificationNumber;
}
public void setUniqueIdentificationNumber(String uniqueIdentificationNumber) {
this.uniqueIdentificationNumber = uniqueIdentificationNumber;
}
}
| UTF-8 | Java | 1,029 | java | SkypearlSkyLinkWriterResponseData.java | Java | [
{
"context": ";\n\nimport java.io.Serializable;\n\n/**\n * Created by lunrongda on 2017/08/18.\n */\npublic class SkypearlSkyLinkWr",
"end": 102,
"score": 0.9996588826179504,
"start": 93,
"tag": "USERNAME",
"value": "lunrongda"
}
] | null | [] | package com.csair.aloysys.app.domain.retro;
import java.io.Serializable;
/**
* Created by lunrongda on 2017/08/18.
*/
public class SkypearlSkyLinkWriterResponseData implements Serializable {
private static final long serialVersionUID = 1144625782428480662L;
private String trackID;
private String eligibilityDenialCode;
private String uniqueIdentificationNumber;
public String getTrackID() {
return trackID;
}
public void setTrackID(String trackID) {
this.trackID = trackID;
}
public String getEligibilityDenialCode() {
return eligibilityDenialCode;
}
public void setEligibilityDenialCode(String eligibilityDenialCode) {
this.eligibilityDenialCode = eligibilityDenialCode;
}
public String getUniqueIdentificationNumber() {
return uniqueIdentificationNumber;
}
public void setUniqueIdentificationNumber(String uniqueIdentificationNumber) {
this.uniqueIdentificationNumber = uniqueIdentificationNumber;
}
}
| 1,029 | 0.739553 | 0.713314 | 39 | 25.384615 | 25.906752 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 2 |
848a1ad16858daa7a8bdee252f2360f459418c03 | 38,036,230,390,644 | 873d39b14f0233f37bd28afaf4d29bfa265357c6 | /src/main/java/com/barolab/sync/RemoteFileApi.java | e4f29bba39a2b38703c6fc8c2481a46612ef394f | [] | no_license | aainka/18B07-BaroLabUtil | https://github.com/aainka/18B07-BaroLabUtil | 74f8ef1d1c35563a699335971040726d674bb44d | 9b908ed00660fef934dd2d7fa087be4c254d389b | refs/heads/master | 2020-03-26T03:15:59.679000 | 2019-03-29T14:58:02 | 2019-03-29T14:58:02 | 144,447,382 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.barolab.sync;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.net.URI;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import lombok.extern.java.Log;
@Log
public class RemoteFileApi extends FileScanner {
HttpClient httpclient = new DefaultHttpClient();
Gson gson = new GsonBuilder().setPrettyPrinting().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
private String host;
public RemoteFileApi(String host, String homeDir) {
this.host = host;
this.homeDir = homeDir;
}
public OV_FileInfo scanAll() {
OV_FileInfo top = new OV_FileInfo(null, null );
top.setScanner(this);
top.set_dir(true);
try {
scan(top);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// OV_FileInfo.dumpTree(root);
return top;
}
public void scan(OV_FileInfo node) {
if (node.is_dir()) {
try {
List<OV_FileInfo> list = getDir(node.getPath());
for (OV_FileInfo child : list) {
if (!IgnoreFile.ignore(child.getFullPath(this))) {
node.add(child);
scan(child);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public List<OV_FileInfo> getDir(String path) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir) //
.addParameter("path", path);
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
if (s != null) {
Type listType = new TypeToken<List<OV_FileInfo>>() {
}.getType();
List<OV_FileInfo> list = gson.fromJson(s, new TypeToken<List<OV_FileInfo>>() {
}.getType());
// for (OV_FileInfo fi : list) {
// System.out.println(fi.json());
// }
return list;
}
return null;
}
@Override
public void read(OV_FileInfo fi) {
// System.out.println("Remote: Read");
// String name = getName(fi);
OV_FileInfo a;
try {
a = httpGetRead(fi.getPath());
fi.copyFrom(a);
log.fine(a.json());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public OV_FileInfo httpGetRead(String path) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir) //
.setParameter("readfile", path);
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
log.finer("httpGetRead.body = " + s);
if (s != null) {
OV_FileInfo node = gson.fromJson(s, OV_FileInfo.class);
log.finer(node.json());
// System.out.println(fileinfo.json());
return node;
}
return null;
}
/*
* Remote에 화일생성
*/
public OV_FileInfo write(OV_FileInfo finfo) {
OV_FileInfo a = null;
try {
a = httpWrite(finfo);
} catch (Exception e) {
e.printStackTrace();
}
return a;
}
public OV_FileInfo httpWrite(OV_FileInfo finfo) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir);
URI uri = builder.build();
log.fine(uri.toString());
HttpPost request = new HttpPost(uri);
if (finfo != null) {
String json_string = gson.toJson(finfo);
StringEntity entity = new StringEntity(json_string, "UTF-8");
entity.setContentType("application/json; charset=utf-8");
request.setEntity(entity);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
if (s != null) {
OV_FileInfo fileinfo = gson.fromJson(s, OV_FileInfo.class);
// fileinfo.json();
log.fine("OK=" + s);
return fileinfo;
}
}
// EntityUtils.consumeQuietly(response.getEntity());
return null;
}
private String getEntityString(HttpResponse response) throws Exception {
String sContent = null;
if (response.getStatusLine().getStatusCode() != 200) {
System.out.println(response.getStatusLine());
throw new Exception("HTTP ERROR code=" + response.getStatusLine().getStatusCode());
} else {
HttpEntity entity = response.getEntity();
BufferedReader reader;
reader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
String line = "";
sContent = line;
while ((line = reader.readLine()) != null) {
sContent += line;
}
}
return sContent;
}
}
| UTF-8 | Java | 5,016 | java | RemoteFileApi.java | Java | [] | null | [] | package com.barolab.sync;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.net.URI;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import lombok.extern.java.Log;
@Log
public class RemoteFileApi extends FileScanner {
HttpClient httpclient = new DefaultHttpClient();
Gson gson = new GsonBuilder().setPrettyPrinting().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
private String host;
public RemoteFileApi(String host, String homeDir) {
this.host = host;
this.homeDir = homeDir;
}
public OV_FileInfo scanAll() {
OV_FileInfo top = new OV_FileInfo(null, null );
top.setScanner(this);
top.set_dir(true);
try {
scan(top);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// OV_FileInfo.dumpTree(root);
return top;
}
public void scan(OV_FileInfo node) {
if (node.is_dir()) {
try {
List<OV_FileInfo> list = getDir(node.getPath());
for (OV_FileInfo child : list) {
if (!IgnoreFile.ignore(child.getFullPath(this))) {
node.add(child);
scan(child);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public List<OV_FileInfo> getDir(String path) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir) //
.addParameter("path", path);
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
if (s != null) {
Type listType = new TypeToken<List<OV_FileInfo>>() {
}.getType();
List<OV_FileInfo> list = gson.fromJson(s, new TypeToken<List<OV_FileInfo>>() {
}.getType());
// for (OV_FileInfo fi : list) {
// System.out.println(fi.json());
// }
return list;
}
return null;
}
@Override
public void read(OV_FileInfo fi) {
// System.out.println("Remote: Read");
// String name = getName(fi);
OV_FileInfo a;
try {
a = httpGetRead(fi.getPath());
fi.copyFrom(a);
log.fine(a.json());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public OV_FileInfo httpGetRead(String path) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir) //
.setParameter("readfile", path);
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
log.finer("httpGetRead.body = " + s);
if (s != null) {
OV_FileInfo node = gson.fromJson(s, OV_FileInfo.class);
log.finer(node.json());
// System.out.println(fileinfo.json());
return node;
}
return null;
}
/*
* Remote에 화일생성
*/
public OV_FileInfo write(OV_FileInfo finfo) {
OV_FileInfo a = null;
try {
a = httpWrite(finfo);
} catch (Exception e) {
e.printStackTrace();
}
return a;
}
public OV_FileInfo httpWrite(OV_FileInfo finfo) throws Exception {
URIBuilder builder = new URIBuilder();
builder.setScheme("http").setHost(host).setPath("/api/V1/file") //
.setParameter("home", homeDir);
URI uri = builder.build();
log.fine(uri.toString());
HttpPost request = new HttpPost(uri);
if (finfo != null) {
String json_string = gson.toJson(finfo);
StringEntity entity = new StringEntity(json_string, "UTF-8");
entity.setContentType("application/json; charset=utf-8");
request.setEntity(entity);
HttpResponse response = httpclient.execute(request);
String s = getEntityString(response);
if (s != null) {
OV_FileInfo fileinfo = gson.fromJson(s, OV_FileInfo.class);
// fileinfo.json();
log.fine("OK=" + s);
return fileinfo;
}
}
// EntityUtils.consumeQuietly(response.getEntity());
return null;
}
private String getEntityString(HttpResponse response) throws Exception {
String sContent = null;
if (response.getStatusLine().getStatusCode() != 200) {
System.out.println(response.getStatusLine());
throw new Exception("HTTP ERROR code=" + response.getStatusLine().getStatusCode());
} else {
HttpEntity entity = response.getEntity();
BufferedReader reader;
reader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
String line = "";
sContent = line;
while ((line = reader.readLine()) != null) {
sContent += line;
}
}
return sContent;
}
}
| 5,016 | 0.681782 | 0.679984 | 182 | 26.505495 | 21.058199 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.494505 | false | false | 2 |
6267b4969a7a159321ac34a49038307056e217c7 | 34,883,724,413,819 | 608cfd10d9fe80eaceee1539e93204c5c954a38e | /hadoop/PropertiesMapping.java | 8f2d53bc451990f873efe5ed74d9998d569816ee | [] | no_license | mk23/sandbox | https://github.com/mk23/sandbox | 6221838b69ee931df8eef209881c9f0e1eede76c | b76cdd8179c843a7dd7843c5904991715a656d22 | refs/heads/master | 2021-01-10T06:45:36.939000 | 2020-04-29T19:01:26 | 2020-04-29T19:01:26 | 8,402,511 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.ArrayList;
import java.util.List;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.net.CachedDNSToSwitchMapping;
import static org.apache.hadoop.net.NetworkTopology.DEFAULT_RACK;
public class PropertiesMapping extends CachedDNSToSwitchMapping {
private static final Log LOG = LogFactory.getLog(PropertiesMapping.class);
private static final String NET_TOPOLOGY_PROPERTIES_FILE = "net.topology.properties.file";
private static final String NET_TOPOLOGY_PROPERTIES_DELAY = "net.topology.properties.delay";
private PropertiesConfiguration topology;
public PropertiesMapping() {
super(null);
}
private void loadTopology() {
if (topology != null) {
return;
}
String file = getConf().get(NET_TOPOLOGY_PROPERTIES_FILE, null);
if (StringUtils.isBlank(file)) {
LOG.warn(NET_TOPOLOGY_PROPERTIES_FILE + " not configured.");
return;
}
int delay = getConf().getInt(NET_TOPOLOGY_PROPERTIES_DELAY, 300000); // 5 min
try {
FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
strategy.setRefreshDelay(delay);
PropertiesConfiguration topology = new PropertiesConfiguration(file);
topology.setReloadingStrategy(strategy);
this.topology = topology;
} catch (Exception e) {
LOG.warn(file + ": unable to process", e);
}
}
public synchronized List<String> resolve(List<String> names) {
List<String> results = new ArrayList<String>();
loadTopology();
if (topology == null) {
for (String name : names) {
results.add(DEFAULT_RACK);
}
} else {
for (String name : names) {
results.add(topology.getString(name, DEFAULT_RACK));
}
}
return results;
}
public void reloadCachedMappings() {
// Properties automatically reload on changes, so this is unnecessary
}
public void reloadCachedMappings(List<String> names) {
// Properties automatically reload on changes, so this is unnecessary
}
}
| UTF-8 | Java | 2,454 | java | PropertiesMapping.java | Java | [] | null | [] | import java.util.ArrayList;
import java.util.List;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.net.CachedDNSToSwitchMapping;
import static org.apache.hadoop.net.NetworkTopology.DEFAULT_RACK;
public class PropertiesMapping extends CachedDNSToSwitchMapping {
private static final Log LOG = LogFactory.getLog(PropertiesMapping.class);
private static final String NET_TOPOLOGY_PROPERTIES_FILE = "net.topology.properties.file";
private static final String NET_TOPOLOGY_PROPERTIES_DELAY = "net.topology.properties.delay";
private PropertiesConfiguration topology;
public PropertiesMapping() {
super(null);
}
private void loadTopology() {
if (topology != null) {
return;
}
String file = getConf().get(NET_TOPOLOGY_PROPERTIES_FILE, null);
if (StringUtils.isBlank(file)) {
LOG.warn(NET_TOPOLOGY_PROPERTIES_FILE + " not configured.");
return;
}
int delay = getConf().getInt(NET_TOPOLOGY_PROPERTIES_DELAY, 300000); // 5 min
try {
FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
strategy.setRefreshDelay(delay);
PropertiesConfiguration topology = new PropertiesConfiguration(file);
topology.setReloadingStrategy(strategy);
this.topology = topology;
} catch (Exception e) {
LOG.warn(file + ": unable to process", e);
}
}
public synchronized List<String> resolve(List<String> names) {
List<String> results = new ArrayList<String>();
loadTopology();
if (topology == null) {
for (String name : names) {
results.add(DEFAULT_RACK);
}
} else {
for (String name : names) {
results.add(topology.getString(name, DEFAULT_RACK));
}
}
return results;
}
public void reloadCachedMappings() {
// Properties automatically reload on changes, so this is unnecessary
}
public void reloadCachedMappings(List<String> names) {
// Properties automatically reload on changes, so this is unnecessary
}
}
| 2,454 | 0.660554 | 0.657702 | 78 | 30.461538 | 29.14011 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false | 2 |
e5488d01ecce6c80684f53d80e44d521ef794af1 | 27,273,042,395,421 | 27a9f355bba5ae8a14e528ea8767567139485b07 | /src/ClientSqlRemote/SerializableResultSetMetaData.java | 0fcb2b5524ffc033bebcf7b48e7e10743b616561 | [] | no_license | kocmoc1985/NetProcMonitor | https://github.com/kocmoc1985/NetProcMonitor | a200d84c87d96e5e16daf086d9fd898300fc8618 | 78406b5cc3521843877aa35bb58c3d5e94a9758d | refs/heads/master | 2018-01-05T06:46:34.672000 | 2017-12-04T15:19:25 | 2017-12-04T15:19:25 | 70,724,784 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ClientSqlRemote;
import java.sql.*;
/***
* A ResultSetMetaData capable of being serialized.
* This implements the ResultSetMetaData interface.
* Please send any bug reports or enhancements to mitch[at]fincher[dot]org
* @author mitch fincher
* @see SerializableResultSet
**/
////////////////////////////////////////////////////////////////
public class SerializableResultSetMetaData implements
ResultSetMetaData, java.io.Serializable
////////////////////////////////////////////////////////////////
{
int NumberOfColumns = 0;
String ColumnTypeNamesArray[];
String ColumnNamesArray[];
////////////////////////////////////////////////////////////////
public SerializableResultSetMetaData (int inNumberOfColumns)
////////////////////////////////////////////////////////////////
{
NumberOfColumns = inNumberOfColumns;
ColumnTypeNamesArray = new String[NumberOfColumns+1];
ColumnNamesArray = new String[NumberOfColumns+1];
}
////////////////////////////////////////////////////////////////
public String getColumnTypeName(int column) throws SQLException
////////////////////////////////////////////////////////////////
{
if((column <= NumberOfColumns) && (column > 0))
{
return(ColumnTypeNamesArray[column]);
}
else
{
System.out.println("SerializableResultSetMetaData.getColumnTypeName(): invalid columnnumber, " + column);System.out.flush();
return("");
}
}
////////////////////////////////////////////////////////////////
public int getColumnCount() throws SQLException
////////////////////////////////////////////////////////////////
{
return(NumberOfColumns);
}
////////////////////////////////////////////////////////////////
public String getColumnLabel(int column) throws SQLException
////////////////////////////////////////////////////////////////
{
return(ColumnNamesArray[column]);
}
public String getCatalogName(int column) throws SQLException {return("");}
public String getColumnName(int column) throws SQLException {return("");}
public String getSchemaName(int column) throws SQLException {return("");}
public String getTableName(int column) throws SQLException {return("");}
public boolean isAutoIncrement(int column) throws SQLException {return(false);}
public boolean isCaseSensitive(int column) throws SQLException{return(false);}
public boolean isCurrency(int column) throws SQLException{return(false);}
public boolean isDefinitelyWritable(int column) throws SQLException{return(false);}
public boolean isReadOnly(int column) throws SQLException{return(false);}
public boolean isSearchable(int column) throws SQLException{return(false);}
public boolean isSigned(int column) throws SQLException{return(false);}
public boolean isWritable(int column) throws SQLException{return(false);}
public int getColumnDisplaySize(int column) throws SQLException{return(-1);}
public int getColumnType(int column) throws SQLException{return(-1);}
public int getPrecision(int column) throws SQLException{return(-1);}
public int getScale(int column) throws SQLException{return(-1);}
public int isNullable(int column) throws SQLException{return(-1);}
////////////////////////////////////////////////////////////////
public void setColumnTypeName(int ColumnNumber, String ColumnTypeName)
////////////////////////////////////////////////////////////////
{
ColumnTypeNamesArray[ColumnNumber] = ColumnTypeName;
}
////////////////////////////////////////////////////////////////
public void setColumnName(int ColumnNumber, String ColumnName)
////////////////////////////////////////////////////////////////
{
ColumnNamesArray[ColumnNumber] = ColumnName;
}
////////////////////////////////////////////////////////////////
public String toString()
////////////////////////////////////////////////////////////////
{
String desc="";
desc += "\n***********************************************";
desc += "\nSerializableResultSetMetaData: ";
desc += "\n***********************************************";
desc += "\nNumberOfColumns: " + NumberOfColumns;
desc += "\nColumnTypeNamesArray: ";
try {
for(int i=1;i<=NumberOfColumns;i++)
desc += "\n " + i + ": \"" + getColumnTypeName(i) + "\"";
}
catch(Exception ex){ System.err.println("SerializableResultSet.toString:" + ex);}
return(desc);
}
public String getColumnClassName(int column) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public <T> T unwrap(Class<T> iface) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} // SerializableResultSetMetaData
| UTF-8 | Java | 5,034 | java | SerializableResultSetMetaData.java | Java | [
{
"context": "nhancements to mitch[at]fincher[dot]org\n * @author mitch fincher\n * @see SerializableResultSet\n**/\n\n//////////////",
"end": 259,
"score": 0.9998643398284912,
"start": 246,
"tag": "NAME",
"value": "mitch fincher"
}
] | null | [] | package ClientSqlRemote;
import java.sql.*;
/***
* A ResultSetMetaData capable of being serialized.
* This implements the ResultSetMetaData interface.
* Please send any bug reports or enhancements to mitch[at]fincher[dot]org
* @author <NAME>
* @see SerializableResultSet
**/
////////////////////////////////////////////////////////////////
public class SerializableResultSetMetaData implements
ResultSetMetaData, java.io.Serializable
////////////////////////////////////////////////////////////////
{
int NumberOfColumns = 0;
String ColumnTypeNamesArray[];
String ColumnNamesArray[];
////////////////////////////////////////////////////////////////
public SerializableResultSetMetaData (int inNumberOfColumns)
////////////////////////////////////////////////////////////////
{
NumberOfColumns = inNumberOfColumns;
ColumnTypeNamesArray = new String[NumberOfColumns+1];
ColumnNamesArray = new String[NumberOfColumns+1];
}
////////////////////////////////////////////////////////////////
public String getColumnTypeName(int column) throws SQLException
////////////////////////////////////////////////////////////////
{
if((column <= NumberOfColumns) && (column > 0))
{
return(ColumnTypeNamesArray[column]);
}
else
{
System.out.println("SerializableResultSetMetaData.getColumnTypeName(): invalid columnnumber, " + column);System.out.flush();
return("");
}
}
////////////////////////////////////////////////////////////////
public int getColumnCount() throws SQLException
////////////////////////////////////////////////////////////////
{
return(NumberOfColumns);
}
////////////////////////////////////////////////////////////////
public String getColumnLabel(int column) throws SQLException
////////////////////////////////////////////////////////////////
{
return(ColumnNamesArray[column]);
}
public String getCatalogName(int column) throws SQLException {return("");}
public String getColumnName(int column) throws SQLException {return("");}
public String getSchemaName(int column) throws SQLException {return("");}
public String getTableName(int column) throws SQLException {return("");}
public boolean isAutoIncrement(int column) throws SQLException {return(false);}
public boolean isCaseSensitive(int column) throws SQLException{return(false);}
public boolean isCurrency(int column) throws SQLException{return(false);}
public boolean isDefinitelyWritable(int column) throws SQLException{return(false);}
public boolean isReadOnly(int column) throws SQLException{return(false);}
public boolean isSearchable(int column) throws SQLException{return(false);}
public boolean isSigned(int column) throws SQLException{return(false);}
public boolean isWritable(int column) throws SQLException{return(false);}
public int getColumnDisplaySize(int column) throws SQLException{return(-1);}
public int getColumnType(int column) throws SQLException{return(-1);}
public int getPrecision(int column) throws SQLException{return(-1);}
public int getScale(int column) throws SQLException{return(-1);}
public int isNullable(int column) throws SQLException{return(-1);}
////////////////////////////////////////////////////////////////
public void setColumnTypeName(int ColumnNumber, String ColumnTypeName)
////////////////////////////////////////////////////////////////
{
ColumnTypeNamesArray[ColumnNumber] = ColumnTypeName;
}
////////////////////////////////////////////////////////////////
public void setColumnName(int ColumnNumber, String ColumnName)
////////////////////////////////////////////////////////////////
{
ColumnNamesArray[ColumnNumber] = ColumnName;
}
////////////////////////////////////////////////////////////////
public String toString()
////////////////////////////////////////////////////////////////
{
String desc="";
desc += "\n***********************************************";
desc += "\nSerializableResultSetMetaData: ";
desc += "\n***********************************************";
desc += "\nNumberOfColumns: " + NumberOfColumns;
desc += "\nColumnTypeNamesArray: ";
try {
for(int i=1;i<=NumberOfColumns;i++)
desc += "\n " + i + ": \"" + getColumnTypeName(i) + "\"";
}
catch(Exception ex){ System.err.println("SerializableResultSet.toString:" + ex);}
return(desc);
}
public String getColumnClassName(int column) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public <T> T unwrap(Class<T> iface) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} // SerializableResultSetMetaData
| 5,027 | 0.572706 | 0.570719 | 124 | 39.596775 | 33.671066 | 135 | false | false | 0 | 0 | 0 | 0 | 78 | 0.228248 | 0.483871 | false | false | 2 |
5a9507703caebe75673b974d56153c280890a161 | 17,918,603,616,973 | dd5a223c2490387dabea2e53592cebdd0a67d9aa | /app/src/main/java/cn/tianya/weatherforecast/activity/AddCityActivity.java | 434e831de692a5b903b4dd74659c5691518ade10 | [] | no_license | akileecn/WeatherForecast | https://github.com/akileecn/WeatherForecast | 8960c4815968c793914a7dc927783fa8eaa4fe28 | 502d63690f527d44bec53e66ba8573084a2d2551 | refs/heads/master | 2021-01-22T13:52:21.922000 | 2018-01-03T12:00:30 | 2018-01-03T12:00:30 | 100,696,467 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.tianya.weatherforecast.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;
import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.List;
import cn.tianya.weatherforecast.R;
import cn.tianya.weatherforecast.dao.CityDao;
import cn.tianya.weatherforecast.entity.City;
import cn.tianya.weatherforecast.utils.BaseListAdapter;
/**
* 添加城市查询
*/
public class AddCityActivity extends AppCompatActivity {
private List<City> mCityList;
private BaseListAdapter<City> mCityAdapter;
private CityDao mCityDao;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_city);
initView();
initData();
}
@Override
public void onBackPressed() {
setResult(RESULT_OK);
super.onBackPressed();
}
private void initView() {
SearchView citySv = findViewById(R.id.city_sv);
citySv.setIconified(false); // 是否图标化
citySv.setFocusable(true);
citySv.requestFocusFromTouch(); // 获取焦点
citySv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
loadCity(newText);
return true;
}
});
ListView cityLv = findViewById(R.id.city_lv);
mCityList = new ArrayList<>();
mCityAdapter = new BaseListAdapter<City>(mCityList) {
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
City city = getItem(i);
if (view == null) {
view = LayoutInflater.from(AddCityActivity.this).inflate(R.layout.item_search_city, viewGroup, false);
}
((TextView) view).setText(city.getFullArea());
view.setTag(city);
return view;
}
};
cityLv.setAdapter(mCityAdapter);
cityLv.setOnItemClickListener((parent, view, position, id) -> {
City city = (City) view.getTag();
mCityDao.update(city.getAreaId(), true);
setResult(RESULT_OK);
finish();
});
}
private void initData() {
mCityDao = new CityDao(this);
mCityDao.init();
}
private void loadCity(String keywords) {
mCityList.clear();
if (Strings.isNullOrEmpty(keywords)) {
return;
}
List<City> list = mCityDao.list(keywords.trim());
mCityList.addAll(list);
mCityAdapter.notifyDataSetChanged();
}
}
| UTF-8 | Java | 3,041 | java | AddCityActivity.java | Java | [] | null | [] | package cn.tianya.weatherforecast.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;
import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.List;
import cn.tianya.weatherforecast.R;
import cn.tianya.weatherforecast.dao.CityDao;
import cn.tianya.weatherforecast.entity.City;
import cn.tianya.weatherforecast.utils.BaseListAdapter;
/**
* 添加城市查询
*/
public class AddCityActivity extends AppCompatActivity {
private List<City> mCityList;
private BaseListAdapter<City> mCityAdapter;
private CityDao mCityDao;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_city);
initView();
initData();
}
@Override
public void onBackPressed() {
setResult(RESULT_OK);
super.onBackPressed();
}
private void initView() {
SearchView citySv = findViewById(R.id.city_sv);
citySv.setIconified(false); // 是否图标化
citySv.setFocusable(true);
citySv.requestFocusFromTouch(); // 获取焦点
citySv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
loadCity(newText);
return true;
}
});
ListView cityLv = findViewById(R.id.city_lv);
mCityList = new ArrayList<>();
mCityAdapter = new BaseListAdapter<City>(mCityList) {
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
City city = getItem(i);
if (view == null) {
view = LayoutInflater.from(AddCityActivity.this).inflate(R.layout.item_search_city, viewGroup, false);
}
((TextView) view).setText(city.getFullArea());
view.setTag(city);
return view;
}
};
cityLv.setAdapter(mCityAdapter);
cityLv.setOnItemClickListener((parent, view, position, id) -> {
City city = (City) view.getTag();
mCityDao.update(city.getAreaId(), true);
setResult(RESULT_OK);
finish();
});
}
private void initData() {
mCityDao = new CityDao(this);
mCityDao.init();
}
private void loadCity(String keywords) {
mCityList.clear();
if (Strings.isNullOrEmpty(keywords)) {
return;
}
List<City> list = mCityDao.list(keywords.trim());
mCityList.addAll(list);
mCityAdapter.notifyDataSetChanged();
}
}
| 3,041 | 0.62172 | 0.621056 | 99 | 29.414141 | 21.758087 | 122 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.626263 | false | false | 2 |
21d3d853ea5310e8d878323a968204623329d593 | 17,918,603,615,969 | b9c5a78f35e5e4460d3766b3ea6765109d905e6e | /src/jvm/org/apache/storm/starter/data/HAZARD.java | bb5ddf9a7938c7d8fc73127e35b212d371bf6cf3 | [] | no_license | ozliftoff/TfLStorm | https://github.com/ozliftoff/TfLStorm | 6d88dceb46598351f9c4e2ebe4482fe273539932 | 5180a7b706997687dc6320f3a2b7e36689a86ebe | refs/heads/master | 2021-05-06T15:28:03.495000 | 2017-12-23T23:08:44 | 2017-12-23T23:08:44 | 113,501,482 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.apache.storm.starter.data;
//Enumeration of TfL hazard levels with tuned variables for severity calculations.
public enum HAZARD{
Hazard(2.2),
InfrastructureIssue(1.6),
SpecialandPlannedEvents(1.2),
TrafficIncidents(3.4),
TrafficVolume(3.8),
Works(2.0);
private double numVal;
HAZARD(double numVal){
this.numVal = numVal;
}
public double getNumVal() {
return numVal;
}
} | UTF-8 | Java | 467 | java | HAZARD.java | Java | [] | null | [] | package org.apache.storm.starter.data;
//Enumeration of TfL hazard levels with tuned variables for severity calculations.
public enum HAZARD{
Hazard(2.2),
InfrastructureIssue(1.6),
SpecialandPlannedEvents(1.2),
TrafficIncidents(3.4),
TrafficVolume(3.8),
Works(2.0);
private double numVal;
HAZARD(double numVal){
this.numVal = numVal;
}
public double getNumVal() {
return numVal;
}
} | 467 | 0.635974 | 0.610278 | 23 | 19.347826 | 17.750956 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.434783 | false | false | 2 |
8d07e4bc3d9e46d0ba23935be7ce22cd8fb5cc1b | 38,508,676,795,454 | f6e18c4f0341ed8f66f02a9ce930cf54063fbdf3 | /source/mon/lattice/core/MeasurementException.java | 0413d8a5fe1dae62943a566d9d927fa518719875 | [] | no_license | UCL/lattice-monitoring-framework | https://github.com/UCL/lattice-monitoring-framework | d3c1c6a55f310ecc62d735e9dd6f26836d2cfcc6 | fb58ad12c61a12b1691327ae09244a28501072c6 | refs/heads/master | 2023-05-15T06:33:03.103000 | 2023-05-04T09:11:52 | 2023-05-04T09:11:52 | 169,605,080 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | // MeasurementException.java
// Author: Stuart Clayman
// Email: sclayman@ee.ucl.ac.uk
// Date: Feb 2010
package mon.lattice.core;
/**
* An exception thrown where there is a problem with a Measurement.
*/
public class MeasurementException extends RuntimeException {
/**
* Construct a MeasurementException with a message.
*/
public MeasurementException(String msg) {
super(msg);
}
/**
* Construct a MeasurementException.
*/
public MeasurementException() {
super();
}
} | UTF-8 | Java | 519 | java | MeasurementException.java | Java | [
{
"context": "// MeasurementException.java\n// Author: Stuart Clayman\n// Email: sclayman@ee.ucl.ac.uk\n// Date: Feb 2010",
"end": 54,
"score": 0.9998804330825806,
"start": 40,
"tag": "NAME",
"value": "Stuart Clayman"
},
{
"context": "Exception.java\n// Author: Stuart Clayman\n// Email: sclayman@ee.ucl.ac.uk\n// Date: Feb 2010\n\npackage mon.lattice.core;\n\n/**",
"end": 86,
"score": 0.9999328851699829,
"start": 65,
"tag": "EMAIL",
"value": "sclayman@ee.ucl.ac.uk"
}
] | null | [] | // MeasurementException.java
// Author: <NAME>
// Email: <EMAIL>
// Date: Feb 2010
package mon.lattice.core;
/**
* An exception thrown where there is a problem with a Measurement.
*/
public class MeasurementException extends RuntimeException {
/**
* Construct a MeasurementException with a message.
*/
public MeasurementException(String msg) {
super(msg);
}
/**
* Construct a MeasurementException.
*/
public MeasurementException() {
super();
}
} | 497 | 0.674374 | 0.666667 | 26 | 19 | 19.953793 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.192308 | false | false | 2 |
6228bbac8132dcf2d8cc66273c33a1978482352b | 35,768,487,678,856 | a61ea6cdd360cba1d6ea7a449e0e8ce8d15c9ee8 | /rdm/src/main/java/net/fklj/richanemic/rdm/entity/order/OrderItemEntity.java | 01f1b290077468ebb454e971df8a5dc2e602734d | [] | no_license | fankaidev/rich-anemic | https://github.com/fankaidev/rich-anemic | b6c118c75c2a169d180d3c1fb46dacca2fad534c | 4ad4c7f87dac221ad05d3b34053962f8a525ab9f | refs/heads/master | 2020-04-15T14:25:08.811000 | 2019-01-15T14:04:00 | 2019-01-15T14:04:00 | 164,754,902 | 0 | 0 | null | false | 2019-05-01T12:02:31 | 2019-01-09T00:19:14 | 2019-01-19T00:31:19 | 2019-04-26T06:29:51 | 147 | 1 | 0 | 0 | Java | false | false | package net.fklj.richanemic.rdm.entity.order;
import lombok.NoArgsConstructor;
import lombok.Setter;
import net.fklj.richanemic.data.OrderItem;
import net.fklj.richanemic.data.OrderItemStatus;
import net.fklj.richanemic.rdm.repository.OrderRepository;
@Setter
@NoArgsConstructor
public class OrderItemEntity extends OrderItem {
private OrderRepository orderRepository;
public void cancel() {
this.status = OrderItemStatus.CANCELLED;
save();
}
public void refund() {
this.status = OrderItemStatus.REFUNDED;
save();
}
public void pay() {
this.status = OrderItemStatus.PAID;
save();
}
private void save() {
orderRepository.saveOrderItem(this);
}
}
| UTF-8 | Java | 745 | java | OrderItemEntity.java | Java | [] | null | [] | package net.fklj.richanemic.rdm.entity.order;
import lombok.NoArgsConstructor;
import lombok.Setter;
import net.fklj.richanemic.data.OrderItem;
import net.fklj.richanemic.data.OrderItemStatus;
import net.fklj.richanemic.rdm.repository.OrderRepository;
@Setter
@NoArgsConstructor
public class OrderItemEntity extends OrderItem {
private OrderRepository orderRepository;
public void cancel() {
this.status = OrderItemStatus.CANCELLED;
save();
}
public void refund() {
this.status = OrderItemStatus.REFUNDED;
save();
}
public void pay() {
this.status = OrderItemStatus.PAID;
save();
}
private void save() {
orderRepository.saveOrderItem(this);
}
}
| 745 | 0.692617 | 0.692617 | 34 | 20.911764 | 18.978886 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.411765 | false | false | 2 |
e6a8eda376a9b1e614be9997d14e355fe9d60931 | 35,467,839,972,905 | c2ba038a6fbabddae3bd8aa698c60d433bd2a2b1 | /src/test/java/com/ticket/captain/ticket/TicketCreateDocumentationTests.java | c09e1fef10f7fd8c447498368d5503e6e4cdb427 | [] | no_license | Be-poz/TICKET-EXPEDITIONARY-FORCE | https://github.com/Be-poz/TICKET-EXPEDITIONARY-FORCE | 2a75aed0dd9e32d470f358940b57150232979b43 | 8aafad8623b78756ce8627cb75d9a5cc7e3280e9 | refs/heads/master | 2022-12-27T16:59:14.489000 | 2020-10-13T14:29:32 | 2020-10-13T14:29:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ticket.captain.ticket;
import com.ticket.captain.ApiDocumentationTest;
import com.ticket.captain.ticket.dto.TicketCreateDto;
import com.ticket.captain.ticket.dto.TicketDto;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.restdocs.payload.JsonFieldType;
import org.springframework.test.web.servlet.ResultActions;
import static com.ticket.captain.document.utils.ApiDocumentUtils.getDocumentRequest;
import static com.ticket.captain.document.utils.ApiDocumentUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.payload.PayloadDocumentation.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
public class TicketCreateDocumentationTests extends ApiDocumentationTest {
@Test
public void add() throws Exception {
given(ticketService.add(any(TicketCreateDto.class)))
.willReturn(TicketDto.builder()
.id(1L)
.title("Ticket1")
.amount(10)
.build());
Request request = new Request();
request.title = "Ticket1";
request.amount = "10";
ResultActions result = this.mockMvc.perform(
post("/ticket")
.content(objectMapper.writeValueAsString(request))
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
);
result.andExpect(status().isOk())
.andDo(document("ticket/{method-name}",
getDocumentRequest(),
getDocumentResponse(),
requestFields(
fieldWithPath("title").type(JsonFieldType.STRING).description("티켓명"),
fieldWithPath("amount").type(JsonFieldType.STRING).description("티켓개수").optional()
),
responseFields(beneathPath("data").withSubsectionId("data"),
fieldWithPath("id").type(JsonFieldType.NUMBER).description("아이디"),
fieldWithPath("title").type(JsonFieldType.STRING).description("티켓명"),
fieldWithPath("amount").type(JsonFieldType.NUMBER).description("티켓개수")
)
));
}
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public static class Request {
String title;
String amount;
}
}
| UTF-8 | Java | 2,943 | java | TicketCreateDocumentationTests.java | Java | [] | null | [] | package com.ticket.captain.ticket;
import com.ticket.captain.ApiDocumentationTest;
import com.ticket.captain.ticket.dto.TicketCreateDto;
import com.ticket.captain.ticket.dto.TicketDto;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.restdocs.payload.JsonFieldType;
import org.springframework.test.web.servlet.ResultActions;
import static com.ticket.captain.document.utils.ApiDocumentUtils.getDocumentRequest;
import static com.ticket.captain.document.utils.ApiDocumentUtils.getDocumentResponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.payload.PayloadDocumentation.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
public class TicketCreateDocumentationTests extends ApiDocumentationTest {
@Test
public void add() throws Exception {
given(ticketService.add(any(TicketCreateDto.class)))
.willReturn(TicketDto.builder()
.id(1L)
.title("Ticket1")
.amount(10)
.build());
Request request = new Request();
request.title = "Ticket1";
request.amount = "10";
ResultActions result = this.mockMvc.perform(
post("/ticket")
.content(objectMapper.writeValueAsString(request))
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
);
result.andExpect(status().isOk())
.andDo(document("ticket/{method-name}",
getDocumentRequest(),
getDocumentResponse(),
requestFields(
fieldWithPath("title").type(JsonFieldType.STRING).description("티켓명"),
fieldWithPath("amount").type(JsonFieldType.STRING).description("티켓개수").optional()
),
responseFields(beneathPath("data").withSubsectionId("data"),
fieldWithPath("id").type(JsonFieldType.NUMBER).description("아이디"),
fieldWithPath("title").type(JsonFieldType.STRING).description("티켓명"),
fieldWithPath("amount").type(JsonFieldType.NUMBER).description("티켓개수")
)
));
}
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public static class Request {
String title;
String amount;
}
}
| 2,943 | 0.637332 | 0.634926 | 68 | 41.779411 | 30.322699 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.514706 | false | false | 2 |
90c802035e9be61cba1eb31f20cf74a881a6193c | 38,774,964,791,947 | 43a5269a94494a1e19fa15a517d914546cfbd397 | /app/src/java/AnimationManager.java | 6e916b83ed61385f8eb1b06ff912328506a8f98d | [] | no_license | kailask/average-weather | https://github.com/kailask/average-weather | 801d4b9314dac8e1089aeb678644c7f38ebc1ca9 | 07306d5b587892a8eed2bc70c4462d782eb4fe4d | refs/heads/master | 2023-06-27T01:58:01.935000 | 2021-07-29T19:28:08 | 2021-07-29T19:28:08 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package xyz.eleventhour.averageweather;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.widget.TextView;
/**
* Created by Kailas on 5/19/2016.
*
* Manages common animations
*
*/
public class AnimationManager {
public static void loadText(View textView, String text){
textView.setAlpha(0f);
if(textView instanceof TextView){
((TextView)textView).setText(text);
}
textView.animate().alpha(1f).setDuration(600);
}
//Drop view down, used for toolbar
public static void dropDown(View view){
ObjectAnimator drop = ObjectAnimator.ofFloat(view,"translationY",-200,0);
ObjectAnimator fade = ObjectAnimator.ofFloat(view,"alpha",0f,1f);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(drop).with(fade);
animatorSet.setDuration(400);
animatorSet.start();
}
//Zoom view out, used for listview refresh
public static void zoomOut(View view, Context context, Animator.AnimatorListener listener){
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(context,R.animator.zoom_out);
set.setTarget(view);
set.addListener(listener);
set.start();
}
public static void fade(View view, int toVisibility){
AlphaAnimation animation;
if(toVisibility == View.VISIBLE){
animation = new AlphaAnimation(0,1);
} else {
animation = new AlphaAnimation(1,0);
}
animation.setFillAfter(true);
animation.setDuration(80);
view.startAnimation(animation);
//Make sure view if visible if fading in
if(toVisibility == View.VISIBLE)view.setVisibility(View.VISIBLE);
}
public static void slideFadeDown(View viewToSlide, Context context){
AnimatorSet animatorSet = ((AnimatorSet) AnimatorInflater.loadAnimator(context, R.animator.slide_fade));
animatorSet.setTarget(viewToSlide);
animatorSet.start();
}
}
| UTF-8 | Java | 2,213 | java | AnimationManager.java | Java | [
{
"context": "import android.widget.TextView;\n\n/**\n * Created by Kailas on 5/19/2016.\n *\n * Manages common animations\n *\n",
"end": 359,
"score": 0.9994389414787292,
"start": 353,
"tag": "NAME",
"value": "Kailas"
}
] | null | [] | package xyz.eleventhour.averageweather;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.widget.TextView;
/**
* Created by Kailas on 5/19/2016.
*
* Manages common animations
*
*/
public class AnimationManager {
public static void loadText(View textView, String text){
textView.setAlpha(0f);
if(textView instanceof TextView){
((TextView)textView).setText(text);
}
textView.animate().alpha(1f).setDuration(600);
}
//Drop view down, used for toolbar
public static void dropDown(View view){
ObjectAnimator drop = ObjectAnimator.ofFloat(view,"translationY",-200,0);
ObjectAnimator fade = ObjectAnimator.ofFloat(view,"alpha",0f,1f);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(drop).with(fade);
animatorSet.setDuration(400);
animatorSet.start();
}
//Zoom view out, used for listview refresh
public static void zoomOut(View view, Context context, Animator.AnimatorListener listener){
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(context,R.animator.zoom_out);
set.setTarget(view);
set.addListener(listener);
set.start();
}
public static void fade(View view, int toVisibility){
AlphaAnimation animation;
if(toVisibility == View.VISIBLE){
animation = new AlphaAnimation(0,1);
} else {
animation = new AlphaAnimation(1,0);
}
animation.setFillAfter(true);
animation.setDuration(80);
view.startAnimation(animation);
//Make sure view if visible if fading in
if(toVisibility == View.VISIBLE)view.setVisibility(View.VISIBLE);
}
public static void slideFadeDown(View viewToSlide, Context context){
AnimatorSet animatorSet = ((AnimatorSet) AnimatorInflater.loadAnimator(context, R.animator.slide_fade));
animatorSet.setTarget(viewToSlide);
animatorSet.start();
}
}
| 2,213 | 0.687302 | 0.675102 | 65 | 33.046154 | 25.878075 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.753846 | false | false | 2 |
47366605d068202d304a3f7c09913a67009babec | 38,869,454,065,300 | 138c917e086be5a1eb65d7d8f551c3ac55d56604 | /app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/room/SampleApplication.java | 2af03a6b33cbeae3dc38661fbf141accb2e9daa3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | arttrol/leanback-showcase | https://github.com/arttrol/leanback-showcase | 56b39484bb9de09bacadf930d3679c99e739af8a | bfd17025f83031933748f9c3fb9683efefd6efd2 | refs/heads/master | 2021-06-24T21:15:09.329000 | 2017-09-08T23:06:46 | 2017-09-08T23:06:46 | 103,237,181 | 1 | 0 | null | true | 2017-09-12T07:26:56 | 2017-09-12T07:26:56 | 2017-09-11T08:02:18 | 2017-09-08T23:06:47 | 87,571 | 0 | 0 | 0 | null | null | null | /*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.v17.leanback.supportleanbackshowcase.app.room;
import android.app.Application;
/**
* Customized application class.
*/
public class SampleApplication extends Application {
private static SampleApplication sApp;
// This class will be instantiated once when the application is started, no need to design it
// as a singleton on purpose.
public static SampleApplication getInstance() {
return sApp;
}
@Override
public void onCreate() {
super.onCreate();
sApp = this;
}
}
| UTF-8 | Java | 1,174 | java | SampleApplication.java | Java | [] | null | [] | /*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.v17.leanback.supportleanbackshowcase.app.room;
import android.app.Application;
/**
* Customized application class.
*/
public class SampleApplication extends Application {
private static SampleApplication sApp;
// This class will be instantiated once when the application is started, no need to design it
// as a singleton on purpose.
public static SampleApplication getInstance() {
return sApp;
}
@Override
public void onCreate() {
super.onCreate();
sApp = this;
}
}
| 1,174 | 0.71891 | 0.710392 | 38 | 29.894737 | 28.106741 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.315789 | false | false | 2 |
693f37def474332e1fec8665b07c90ba4e15d8d6 | 34,643,206,254,360 | 0652d188d60973eb5413a54c98e8c4e5dff28206 | /src/main/java/br/com/dit/algafood/domain/exception/IdentificadorVazioRestauranteException.java | f719e13d03af1bf0c0ab837a2dd19a88165d8962 | [] | no_license | cacofute/algafood-api | https://github.com/cacofute/algafood-api | 2063786c31c818b7164804a4f71e2fa8e648e1b8 | ea9ba6c6569cc0450d9faddd2047dc94ef7b6d62 | refs/heads/main | 2023-07-20T08:43:01.482000 | 2021-08-19T01:21:20 | 2021-08-19T01:21:20 | 395,457,056 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.dit.algafood.domain.exception;
public class IdentificadorVazioRestauranteException extends IdentificadorVazioEntidadeException {
private static final long serialVersionUID = 1L;
public IdentificadorVazioRestauranteException() {
super("Identificador do restaurante não pode estar vazio");
}
}
| UTF-8 | Java | 330 | java | IdentificadorVazioRestauranteException.java | Java | [] | null | [] | package br.com.dit.algafood.domain.exception;
public class IdentificadorVazioRestauranteException extends IdentificadorVazioEntidadeException {
private static final long serialVersionUID = 1L;
public IdentificadorVazioRestauranteException() {
super("Identificador do restaurante não pode estar vazio");
}
}
| 330 | 0.793313 | 0.790274 | 11 | 28.90909 | 32.983341 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false | 2 |
e818b5603f3c893762bfd1ed7c7c0810df07589a | 34,600,256,592,181 | 8bc6504afe47e2532805edcc334d85c16c801e1b | /src/test/java/src/codilityTasks/SolutionGenomicRangeQueryTest.java | 9677578b4b32097f250c0be8bc077fb576cff83b | [] | no_license | Niemaly/Codility | https://github.com/Niemaly/Codility | 8995ba2fd3e6e9e6e2ba40a8d965d5eafd5888b1 | d00f533ff596b9afdcba24160185f59e9612d187 | refs/heads/master | 2020-11-27T04:45:11.950000 | 2020-08-08T12:40:22 | 2020-08-08T12:40:22 | 229,308,217 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package src.codilityTasks;
import src.codilityTasks.genomicRangeQuery.SolutionGenomicRangeQuery;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.Arrays;
import java.util.stream.Stream;
public class SolutionGenomicRangeQueryTest {
public SolutionGenomicRangeQueryTest() {
}
private static Stream<Arguments> provideValuesForGenomicRangeQuery() {
return Stream.of(
Arguments.of("CAGCCTA", new int[]{2, 5, 0}, new int[]{4, 5, 6}, new int[]{2, 4, 1})
);
}
@ParameterizedTest
@MethodSource("provideValuesForGenomicRangeQuery")
public void shouldReturnArrayOfMinGenom(String input, int[] P, int[] Q, int[] expected) {
SolutionGenomicRangeQuery solutionGenomicRangeQuery = new SolutionGenomicRangeQuery();
Assertions.assertTrue(Arrays.equals(solutionGenomicRangeQuery.solution(input, P, Q), expected));
}
} | UTF-8 | Java | 1,052 | java | SolutionGenomicRangeQueryTest.java | Java | [] | null | [] | package src.codilityTasks;
import src.codilityTasks.genomicRangeQuery.SolutionGenomicRangeQuery;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.Arrays;
import java.util.stream.Stream;
public class SolutionGenomicRangeQueryTest {
public SolutionGenomicRangeQueryTest() {
}
private static Stream<Arguments> provideValuesForGenomicRangeQuery() {
return Stream.of(
Arguments.of("CAGCCTA", new int[]{2, 5, 0}, new int[]{4, 5, 6}, new int[]{2, 4, 1})
);
}
@ParameterizedTest
@MethodSource("provideValuesForGenomicRangeQuery")
public void shouldReturnArrayOfMinGenom(String input, int[] P, int[] Q, int[] expected) {
SolutionGenomicRangeQuery solutionGenomicRangeQuery = new SolutionGenomicRangeQuery();
Assertions.assertTrue(Arrays.equals(solutionGenomicRangeQuery.solution(input, P, Q), expected));
}
} | 1,052 | 0.745247 | 0.736692 | 29 | 35.310345 | 33.261871 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.896552 | false | false | 2 |
6eafbbbf71f59f36d10cd64ef81d6b67f84790e1 | 38,723,425,162,065 | 3bc0ff70c56354613476ad53445feee1c6ad089c | /theSuperheroSighting/src/main/java/com/mycompany/thesuperherosighting/service/UserServiceLayerDbImpl.java | 9d1984d3386eda1ff42d7d9ee7d451913d310bde | [] | no_license | BSonia3/SuperheroSighting | https://github.com/BSonia3/SuperheroSighting | 1ea95017153bf7669588562616fab53a41e0c4d6 | 17a91ca7cb86c53f6cac8d69cd001b94d1ddea31 | refs/heads/master | 2020-05-03T10:15:07.008000 | 2019-03-30T15:55:00 | 2019-03-30T15:55:00 | 178,574,880 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.thesuperherosighting.service;
import com.mycompany.thesuperherosighting.dao.UserDao;
import com.mycompany.thesuperherosighting.model.User;
import java.util.List;
import javax.inject.Inject;
/**
*
* @author sonia
*/
public class UserServiceLayerDbImpl implements UserServiceLayerDb{
UserDao dao;
@Inject
UserServiceLayerDbImpl(UserDao dao){
this.dao = dao;
}
@Override
public User addUser(User newUser) {
return dao.addUser(newUser);
}
@Override
public void deleteUser(String username) {
dao.deleteUser(username);
}
@Override
public List<User> getAllUsers() {
return dao.getAllUsers();
}
}
| UTF-8 | Java | 897 | java | UserServiceLayerDbImpl.java | Java | [
{
"context": "st;\nimport javax.inject.Inject;\n\n/**\n *\n * @author sonia\n */\npublic class UserServiceLayerDbImpl implement",
"end": 422,
"score": 0.9956451654434204,
"start": 417,
"tag": "USERNAME",
"value": "sonia"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.thesuperherosighting.service;
import com.mycompany.thesuperherosighting.dao.UserDao;
import com.mycompany.thesuperherosighting.model.User;
import java.util.List;
import javax.inject.Inject;
/**
*
* @author sonia
*/
public class UserServiceLayerDbImpl implements UserServiceLayerDb{
UserDao dao;
@Inject
UserServiceLayerDbImpl(UserDao dao){
this.dao = dao;
}
@Override
public User addUser(User newUser) {
return dao.addUser(newUser);
}
@Override
public void deleteUser(String username) {
dao.deleteUser(username);
}
@Override
public List<User> getAllUsers() {
return dao.getAllUsers();
}
}
| 897 | 0.695652 | 0.695652 | 41 | 20.878048 | 21.265104 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.317073 | false | false | 2 |
33c7086ae7b9e101a67eb793e1c97a06ea9f1e99 | 34,548,716,980,631 | 60f667bf18b7df3932fe33f2b7891d5b840363c9 | /src/main/java/com/danchen/biblio/viewmodel/ProcessingViewModel.java | f02c35592364279f91bb9140e7675679269899f7 | [] | no_license | danchen0720/biblio | https://github.com/danchen0720/biblio | cd2ff62439630e9d6bb88cd5353d75d42f2ff820 | 06dbc382c66136a5204b109664c1db506dce45f2 | refs/heads/master | 2021-01-01T15:44:35.149000 | 2013-12-04T10:27:06 | 2013-12-04T10:27:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.danchen.biblio.viewmodel;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Path;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.EventQueue;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zul.Include;
import org.zkoss.zul.Window;
import com.danchen.biblio.hibernate.bean.Article;
import com.danchen.biblio.hibernate.bean.User;
import com.danchen.biblio.service.ArticleService;
public class ProcessingViewModel {
private static final Logger log = LoggerFactory.getLogger(ProcessingViewModel.class);
private User user;
private ArticleService artServ = new ArticleService();
private static ExecutorService service = Executors.newFixedThreadPool(10);
private Include processingIner;
private List<Article> arts;
public ProcessingViewModel() {
user = (User) Executions.getCurrent().getSession().getAttribute("user");
arts = artServ.processingArt(user);
processingIner = (Include) Path.getComponent("/processingInner");
if (processingIner != null)
if (arts.size() <= 0)
processingIner.setVisible(false);
else {
processingIner.setVisible(true);
//processing event
Iterator itr = arts.iterator();
for (int i = 0; itr.hasNext(); i++) {
Article art = (Article)itr.next();
EventQueue<Event> que = EventQueues.lookup("update_"+art.getId(), EventQueues.APPLICATION, true);
que.subscribe(new EventListener<Event>() {
public void onEvent(Event evt) {
//get data and update article state
log.debug("Event:"+evt.getName()+", catched!");
Map data = (Map) evt.getData();
Article art = (Article) data.get("article");
log.debug("get Article:"+art+" by Event:"+evt.getName());
artServ.updateState(art);
log.debug("updateState Article:"+art+" by Event:"+evt.getName());
//server push refresh the web
EventQueues.lookup("artsUpdate", EventQueues.APPLICATION, false).publish(new Event("refresh", null));
log.debug("publish Evnet:refresh");
EventQueues.remove("update_"+art.getId(), EventQueues.APPLICATION);
log.debug("remove Eventqueue");
}
});
service.submit(new Task(que,art));
}
}
}
@Command
public void cancel(@BindingParam("id") int id){
EventQueues.remove("update_"+id, EventQueues.APPLICATION);
//call editor
Map data = new HashMap();
data.put("modifyProcessing", true);
data.put("articleId", id);
Window window = (Window)Executions.createComponents(
"/editor.zul", null, data);
window.doModal();
}
//getter,setter
public List<Article> getArts() {
return arts;
}
public void setArts(List<Article> arts) {
this.arts = arts;
}
}
class Task implements Runnable {
private EventQueue<Event> _qe;
private Article _art;
public Task(EventQueue<Event> eventQueue, Article article) {
_qe = eventQueue;
_art = article;
}
@SuppressWarnings("unchecked")
public void run() {
try {
Thread.currentThread().sleep(8000);
Map data = new HashMap();
data.put("article", _art);
_qe.publish(new Event("update", null,data));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public Article get_art() {
return _art;
}
public void set_art(Article _art) {
this._art = _art;
}
}
| UTF-8 | Java | 3,775 | java | ProcessingViewModel.java | Java | [] | null | [] | package com.danchen.biblio.viewmodel;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Path;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.EventQueue;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zul.Include;
import org.zkoss.zul.Window;
import com.danchen.biblio.hibernate.bean.Article;
import com.danchen.biblio.hibernate.bean.User;
import com.danchen.biblio.service.ArticleService;
public class ProcessingViewModel {
private static final Logger log = LoggerFactory.getLogger(ProcessingViewModel.class);
private User user;
private ArticleService artServ = new ArticleService();
private static ExecutorService service = Executors.newFixedThreadPool(10);
private Include processingIner;
private List<Article> arts;
public ProcessingViewModel() {
user = (User) Executions.getCurrent().getSession().getAttribute("user");
arts = artServ.processingArt(user);
processingIner = (Include) Path.getComponent("/processingInner");
if (processingIner != null)
if (arts.size() <= 0)
processingIner.setVisible(false);
else {
processingIner.setVisible(true);
//processing event
Iterator itr = arts.iterator();
for (int i = 0; itr.hasNext(); i++) {
Article art = (Article)itr.next();
EventQueue<Event> que = EventQueues.lookup("update_"+art.getId(), EventQueues.APPLICATION, true);
que.subscribe(new EventListener<Event>() {
public void onEvent(Event evt) {
//get data and update article state
log.debug("Event:"+evt.getName()+", catched!");
Map data = (Map) evt.getData();
Article art = (Article) data.get("article");
log.debug("get Article:"+art+" by Event:"+evt.getName());
artServ.updateState(art);
log.debug("updateState Article:"+art+" by Event:"+evt.getName());
//server push refresh the web
EventQueues.lookup("artsUpdate", EventQueues.APPLICATION, false).publish(new Event("refresh", null));
log.debug("publish Evnet:refresh");
EventQueues.remove("update_"+art.getId(), EventQueues.APPLICATION);
log.debug("remove Eventqueue");
}
});
service.submit(new Task(que,art));
}
}
}
@Command
public void cancel(@BindingParam("id") int id){
EventQueues.remove("update_"+id, EventQueues.APPLICATION);
//call editor
Map data = new HashMap();
data.put("modifyProcessing", true);
data.put("articleId", id);
Window window = (Window)Executions.createComponents(
"/editor.zul", null, data);
window.doModal();
}
//getter,setter
public List<Article> getArts() {
return arts;
}
public void setArts(List<Article> arts) {
this.arts = arts;
}
}
class Task implements Runnable {
private EventQueue<Event> _qe;
private Article _art;
public Task(EventQueue<Event> eventQueue, Article article) {
_qe = eventQueue;
_art = article;
}
@SuppressWarnings("unchecked")
public void run() {
try {
Thread.currentThread().sleep(8000);
Map data = new HashMap();
data.put("article", _art);
_qe.publish(new Event("update", null,data));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public Article get_art() {
return _art;
}
public void set_art(Article _art) {
this._art = _art;
}
}
| 3,775 | 0.675232 | 0.672583 | 123 | 29.691057 | 22.771801 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.560976 | false | false | 2 |
c2f92bb41e650b2d7ae1a6aad30b0e91ab458a20 | 36,842,229,502,492 | 1d2dbbb9557f5465066afb50bed1bfd4fb1d3f09 | /vmi-video-api-server/vmi-video-interface/src/main/java/com/tigerjoys/shark/miai/inter/contract/impl/IosUserLoginSmsContractImpl.java | 8281f23d4867bade606838891203e8134626e7e1 | [] | no_license | moutainhigh/vmi-openInstall | https://github.com/moutainhigh/vmi-openInstall | 2c407301e97f8aa94f23c083e6ecd2a8e5ba3741 | c265da83ea438b571776da41668735c5cce9e315 | refs/heads/master | 2022-12-29T13:57:51.306000 | 2020-05-09T15:41:49 | 2020-05-09T15:41:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.tigerjoys.shark.miai.inter.contract.impl;
import org.springframework.stereotype.Repository;
import com.tigerjoys.shark.miai.inter.contract.IIosUserLoginSmsContract;
import com.tigerjoys.shark.miai.inter.entity.IosUserLoginSmsEntity;
import com.tigerjoys.nbs.mybatis.core.contract.AbstractBaseContract;
import com.tigerjoys.shark.miai.inter.mapper.IosUserLoginSmsMapper;
/**
* 数据库中 IOS提审账号固定验证码[t_ios_user_login_sms]表 接口实现类
* @author yangjunming
* @Date 2020-02-21 17:51:12
*
*/
@Repository
public class IosUserLoginSmsContractImpl extends AbstractBaseContract<IosUserLoginSmsEntity , IosUserLoginSmsMapper> implements IIosUserLoginSmsContract {
}
| UTF-8 | Java | 708 | java | IosUserLoginSmsContractImpl.java | Java | [
{
"context": "S提审账号固定验证码[t_ios_user_login_sms]表 接口实现类\n * @author yangjunming\n * @Date 2020-02-21 17:51:12\n *\n */\n@Repository\np",
"end": 462,
"score": 0.9994933009147644,
"start": 451,
"tag": "USERNAME",
"value": "yangjunming"
}
] | null | [] | package com.tigerjoys.shark.miai.inter.contract.impl;
import org.springframework.stereotype.Repository;
import com.tigerjoys.shark.miai.inter.contract.IIosUserLoginSmsContract;
import com.tigerjoys.shark.miai.inter.entity.IosUserLoginSmsEntity;
import com.tigerjoys.nbs.mybatis.core.contract.AbstractBaseContract;
import com.tigerjoys.shark.miai.inter.mapper.IosUserLoginSmsMapper;
/**
* 数据库中 IOS提审账号固定验证码[t_ios_user_login_sms]表 接口实现类
* @author yangjunming
* @Date 2020-02-21 17:51:12
*
*/
@Repository
public class IosUserLoginSmsContractImpl extends AbstractBaseContract<IosUserLoginSmsEntity , IosUserLoginSmsMapper> implements IIosUserLoginSmsContract {
}
| 708 | 0.828358 | 0.807463 | 19 | 34.263157 | 39.282837 | 154 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.421053 | false | false | 2 |
9fee21e1a868333b121592273ab64fa58a3e815a | 17,154,099,439,844 | b561c2ff2849083be599f01618affa2a43ca744e | /src/main/java/com/java/oio/demo/OIOTimeClient.java | c5a2b9c9ef9c239bc52ebeb0ffca702bbc869e7d | [] | no_license | XiaoShenOL/netty-demo | https://github.com/XiaoShenOL/netty-demo | 747a6475879a1a485bad43169338054827b4a111 | b4604b9a51a0c113ca385ad577636aacb5dae3e8 | refs/heads/master | 2022-02-21T04:18:38.591000 | 2019-02-25T05:43:39 | 2019-02-25T05:43:39 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.java.oio.demo;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.Socket;
/**
* 时间客户端
*
* @author g5niusx
*/
@Slf4j
public class OIOTimeClient {
public static void main(String[] args) throws IOException {
try (Socket socket = new Socket("127.0.0.1", OIOTimeServer.PORT);
InputStream inputStream = socket.getInputStream();
OutputStream outputStream = socket.getOutputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream));
) {
/*由于服务端读取的时候使用了BufferedReader,默认会忽略LF标志,所以手动增加LF标志*/
bufferedWriter.write("test\r\n");
bufferedWriter.flush();
String readLine = bufferedReader.readLine();
log.info("接收到服务端返回:{}", readLine);
} catch (Exception e) {
log.error("客户端异常", e);
}
}
}
| UTF-8 | Java | 1,096 | java | OIOTimeClient.java | Java | [
{
"context": "mport java.net.Socket;\n\n/**\n * 时间客户端\n *\n * @author g5niusx\n */\n@Slf4j\npublic class OIOTimeClient {\n publi",
"end": 141,
"score": 0.9995630979537964,
"start": 134,
"tag": "USERNAME",
"value": "g5niusx"
},
{
"context": "eption {\n try (Socket socket = new Socket(\"127.0.0.1\", OIOTimeServer.PORT);\n InputStream i",
"end": 296,
"score": 0.9997795820236206,
"start": 287,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
}
] | null | [] | package com.java.oio.demo;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.Socket;
/**
* 时间客户端
*
* @author g5niusx
*/
@Slf4j
public class OIOTimeClient {
public static void main(String[] args) throws IOException {
try (Socket socket = new Socket("127.0.0.1", OIOTimeServer.PORT);
InputStream inputStream = socket.getInputStream();
OutputStream outputStream = socket.getOutputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream));
) {
/*由于服务端读取的时候使用了BufferedReader,默认会忽略LF标志,所以手动增加LF标志*/
bufferedWriter.write("test\r\n");
bufferedWriter.flush();
String readLine = bufferedReader.readLine();
log.info("接收到服务端返回:{}", readLine);
} catch (Exception e) {
log.error("客户端异常", e);
}
}
}
| 1,096 | 0.63745 | 0.62749 | 32 | 30.34375 | 29.218582 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.59375 | false | false | 2 |
299fece49f637ea6a333239d1f6895e591d69e16 | 17,154,099,437,684 | 1df9b2dd4a7db2f1673638a46ecb6f20a3933994 | /Spring-proctice/src/SCenter/ACDC-Checkout-static/src/main/java/com/all/ui/util/ConfigProperties.java | 2a57caf1a07cf3d7794f0eb63acff4a796b9ee8f | [] | no_license | pavanhp001/Spring-boot-proct | https://github.com/pavanhp001/Spring-boot-proct | 71cfb3e86f74aa22951f66a87d55ba4a18b5c6c7 | 238bf76e1b68d46acb3d0e98cb34a53a121643dc | refs/heads/master | 2020-03-20T12:23:10.735000 | 2019-03-18T04:03:40 | 2019-03-18T04:03:40 | 137,428,541 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.AL.ui.util;
import java.util.Properties;
import org.apache.log4j.Logger;
import com.AL.property.management.cache.PropertyManager;
public class ConfigProperties {
private static final Logger logger = Logger.getLogger(ConfigProperties.class);
public static String DIALOGECACHETIME = null;
public static String PROVIDER_LOGO_LOCATION = null;
public static Properties props = null;
static {
props = PropertyManager.getPropertiesFile("CKO-static/static-cko");
if(!props.isEmpty()) {
DIALOGECACHETIME = props.getProperty("dialogeCacheTime");
PROVIDER_LOGO_LOCATION = props.getProperty("provider_logo_location");
}else{
logger.error("Unable to read properties file from the s3 bucket from path CKO-static/static-cko");
}
}
}
| UTF-8 | Java | 782 | java | ConfigProperties.java | Java | [] | null | [] | package com.AL.ui.util;
import java.util.Properties;
import org.apache.log4j.Logger;
import com.AL.property.management.cache.PropertyManager;
public class ConfigProperties {
private static final Logger logger = Logger.getLogger(ConfigProperties.class);
public static String DIALOGECACHETIME = null;
public static String PROVIDER_LOGO_LOCATION = null;
public static Properties props = null;
static {
props = PropertyManager.getPropertiesFile("CKO-static/static-cko");
if(!props.isEmpty()) {
DIALOGECACHETIME = props.getProperty("dialogeCacheTime");
PROVIDER_LOGO_LOCATION = props.getProperty("provider_logo_location");
}else{
logger.error("Unable to read properties file from the s3 bucket from path CKO-static/static-cko");
}
}
}
| 782 | 0.744246 | 0.741688 | 24 | 30.583334 | 29.570419 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.458333 | false | false | 2 |
8fce9451680972e2aaa99b8397c2ae00af16d3fe | 33,870,112,158,805 | 47ab44b46f64080525a1ae93901e10d80db4f72e | /src/main/java/com/contrastsecurity/sarif/GraphTraversal.java | 5633c0044ec8dcee8f604ec2e6bbe001c7a4dc66 | [
"MIT"
] | permissive | Contrast-Security-OSS/java-sarif | https://github.com/Contrast-Security-OSS/java-sarif | 435dfb84e887f612f053288e1c7365ecbb6e1671 | 3128d794154f7e893f066a99d933f454a7f685cd | refs/heads/master | 2023-04-06T15:27:35.806000 | 2021-04-22T13:36:13 | 2021-04-22T13:36:13 | 306,606,237 | 21 | 6 | MIT | false | 2021-04-22T12:29:57 | 2020-10-23T10:43:08 | 2021-04-16T08:23:05 | 2021-04-22T12:29:56 | 184 | 3 | 1 | 0 | Java | false | false |
package com.contrastsecurity.sarif;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Represents a path through a graph.
*
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({
"runGraphIndex",
"resultGraphIndex",
"description",
"initialState",
"immutableState",
"edgeTraversals",
"properties"
})
public class GraphTraversal {
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
@JsonPropertyDescription("The index within the run.graphs to be associated with the result.")
private Integer runGraphIndex = -1;
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
@JsonPropertyDescription("The index within the result.graphs to be associated with the result.")
private Integer resultGraphIndex = -1;
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Encapsulates a message intended to be read by the end user.")
private Message description;
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
@JsonPropertyDescription("Values of relevant expressions at the start of the graph traversal that may change during graph traversal.")
private InitialState__1 initialState;
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
@JsonPropertyDescription("Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.")
private ImmutableState__1 immutableState;
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
@JsonPropertyDescription("The sequences of edges traversed by this graph traversal.")
private List<EdgeTraversal> edgeTraversals = null;
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
@JsonPropertyDescription("Key/value pairs that provide additional information about the object.")
private PropertyBag properties;
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
public Integer getRunGraphIndex() {
return runGraphIndex;
}
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
public void setRunGraphIndex(Integer runGraphIndex) {
this.runGraphIndex = runGraphIndex;
}
public GraphTraversal withRunGraphIndex(Integer runGraphIndex) {
this.runGraphIndex = runGraphIndex;
return this;
}
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
public Integer getResultGraphIndex() {
return resultGraphIndex;
}
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
public void setResultGraphIndex(Integer resultGraphIndex) {
this.resultGraphIndex = resultGraphIndex;
}
public GraphTraversal withResultGraphIndex(Integer resultGraphIndex) {
this.resultGraphIndex = resultGraphIndex;
return this;
}
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public Message getDescription() {
return description;
}
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public void setDescription(Message description) {
this.description = description;
}
public GraphTraversal withDescription(Message description) {
this.description = description;
return this;
}
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
public InitialState__1 getInitialState() {
return initialState;
}
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
public void setInitialState(InitialState__1 initialState) {
this.initialState = initialState;
}
public GraphTraversal withInitialState(InitialState__1 initialState) {
this.initialState = initialState;
return this;
}
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
public ImmutableState__1 getImmutableState() {
return immutableState;
}
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
public void setImmutableState(ImmutableState__1 immutableState) {
this.immutableState = immutableState;
}
public GraphTraversal withImmutableState(ImmutableState__1 immutableState) {
this.immutableState = immutableState;
return this;
}
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
public List<EdgeTraversal> getEdgeTraversals() {
return edgeTraversals;
}
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
public void setEdgeTraversals(List<EdgeTraversal> edgeTraversals) {
this.edgeTraversals = edgeTraversals;
}
public GraphTraversal withEdgeTraversals(List<EdgeTraversal> edgeTraversals) {
this.edgeTraversals = edgeTraversals;
return this;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public PropertyBag getProperties() {
return properties;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public void setProperties(PropertyBag properties) {
this.properties = properties;
}
public GraphTraversal withProperties(PropertyBag properties) {
this.properties = properties;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(GraphTraversal.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("runGraphIndex");
sb.append('=');
sb.append(((this.runGraphIndex == null)?"<null>":this.runGraphIndex));
sb.append(',');
sb.append("resultGraphIndex");
sb.append('=');
sb.append(((this.resultGraphIndex == null)?"<null>":this.resultGraphIndex));
sb.append(',');
sb.append("description");
sb.append('=');
sb.append(((this.description == null)?"<null>":this.description));
sb.append(',');
sb.append("initialState");
sb.append('=');
sb.append(((this.initialState == null)?"<null>":this.initialState));
sb.append(',');
sb.append("immutableState");
sb.append('=');
sb.append(((this.immutableState == null)?"<null>":this.immutableState));
sb.append(',');
sb.append("edgeTraversals");
sb.append('=');
sb.append(((this.edgeTraversals == null)?"<null>":this.edgeTraversals));
sb.append(',');
sb.append("properties");
sb.append('=');
sb.append(((this.properties == null)?"<null>":this.properties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.initialState == null)? 0 :this.initialState.hashCode()));
result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
result = ((result* 31)+((this.immutableState == null)? 0 :this.immutableState.hashCode()));
result = ((result* 31)+((this.runGraphIndex == null)? 0 :this.runGraphIndex.hashCode()));
result = ((result* 31)+((this.resultGraphIndex == null)? 0 :this.resultGraphIndex.hashCode()));
result = ((result* 31)+((this.edgeTraversals == null)? 0 :this.edgeTraversals.hashCode()));
result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof GraphTraversal) == false) {
return false;
}
GraphTraversal rhs = ((GraphTraversal) other);
return ((((((((this.initialState == rhs.initialState)||((this.initialState!= null)&&this.initialState.equals(rhs.initialState)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.immutableState == rhs.immutableState)||((this.immutableState!= null)&&this.immutableState.equals(rhs.immutableState))))&&((this.runGraphIndex == rhs.runGraphIndex)||((this.runGraphIndex!= null)&&this.runGraphIndex.equals(rhs.runGraphIndex))))&&((this.resultGraphIndex == rhs.resultGraphIndex)||((this.resultGraphIndex!= null)&&this.resultGraphIndex.equals(rhs.resultGraphIndex))))&&((this.edgeTraversals == rhs.edgeTraversals)||((this.edgeTraversals!= null)&&this.edgeTraversals.equals(rhs.edgeTraversals))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))));
}
}
| UTF-8 | Java | 10,536 | java | GraphTraversal.java | Java | [] | null | [] |
package com.contrastsecurity.sarif;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Represents a path through a graph.
*
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({
"runGraphIndex",
"resultGraphIndex",
"description",
"initialState",
"immutableState",
"edgeTraversals",
"properties"
})
public class GraphTraversal {
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
@JsonPropertyDescription("The index within the run.graphs to be associated with the result.")
private Integer runGraphIndex = -1;
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
@JsonPropertyDescription("The index within the result.graphs to be associated with the result.")
private Integer resultGraphIndex = -1;
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Encapsulates a message intended to be read by the end user.")
private Message description;
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
@JsonPropertyDescription("Values of relevant expressions at the start of the graph traversal that may change during graph traversal.")
private InitialState__1 initialState;
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
@JsonPropertyDescription("Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.")
private ImmutableState__1 immutableState;
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
@JsonPropertyDescription("The sequences of edges traversed by this graph traversal.")
private List<EdgeTraversal> edgeTraversals = null;
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
@JsonPropertyDescription("Key/value pairs that provide additional information about the object.")
private PropertyBag properties;
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
public Integer getRunGraphIndex() {
return runGraphIndex;
}
/**
* The index within the run.graphs to be associated with the result.
*
*/
@JsonProperty("runGraphIndex")
public void setRunGraphIndex(Integer runGraphIndex) {
this.runGraphIndex = runGraphIndex;
}
public GraphTraversal withRunGraphIndex(Integer runGraphIndex) {
this.runGraphIndex = runGraphIndex;
return this;
}
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
public Integer getResultGraphIndex() {
return resultGraphIndex;
}
/**
* The index within the result.graphs to be associated with the result.
*
*/
@JsonProperty("resultGraphIndex")
public void setResultGraphIndex(Integer resultGraphIndex) {
this.resultGraphIndex = resultGraphIndex;
}
public GraphTraversal withResultGraphIndex(Integer resultGraphIndex) {
this.resultGraphIndex = resultGraphIndex;
return this;
}
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public Message getDescription() {
return description;
}
/**
* Encapsulates a message intended to be read by the end user.
*
*/
@JsonProperty("description")
public void setDescription(Message description) {
this.description = description;
}
public GraphTraversal withDescription(Message description) {
this.description = description;
return this;
}
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
public InitialState__1 getInitialState() {
return initialState;
}
/**
* Values of relevant expressions at the start of the graph traversal that may change during graph traversal.
*
*/
@JsonProperty("initialState")
public void setInitialState(InitialState__1 initialState) {
this.initialState = initialState;
}
public GraphTraversal withInitialState(InitialState__1 initialState) {
this.initialState = initialState;
return this;
}
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
public ImmutableState__1 getImmutableState() {
return immutableState;
}
/**
* Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.
*
*/
@JsonProperty("immutableState")
public void setImmutableState(ImmutableState__1 immutableState) {
this.immutableState = immutableState;
}
public GraphTraversal withImmutableState(ImmutableState__1 immutableState) {
this.immutableState = immutableState;
return this;
}
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
public List<EdgeTraversal> getEdgeTraversals() {
return edgeTraversals;
}
/**
* The sequences of edges traversed by this graph traversal.
*
*/
@JsonProperty("edgeTraversals")
public void setEdgeTraversals(List<EdgeTraversal> edgeTraversals) {
this.edgeTraversals = edgeTraversals;
}
public GraphTraversal withEdgeTraversals(List<EdgeTraversal> edgeTraversals) {
this.edgeTraversals = edgeTraversals;
return this;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public PropertyBag getProperties() {
return properties;
}
/**
* Key/value pairs that provide additional information about the object.
*
*/
@JsonProperty("properties")
public void setProperties(PropertyBag properties) {
this.properties = properties;
}
public GraphTraversal withProperties(PropertyBag properties) {
this.properties = properties;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(GraphTraversal.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("runGraphIndex");
sb.append('=');
sb.append(((this.runGraphIndex == null)?"<null>":this.runGraphIndex));
sb.append(',');
sb.append("resultGraphIndex");
sb.append('=');
sb.append(((this.resultGraphIndex == null)?"<null>":this.resultGraphIndex));
sb.append(',');
sb.append("description");
sb.append('=');
sb.append(((this.description == null)?"<null>":this.description));
sb.append(',');
sb.append("initialState");
sb.append('=');
sb.append(((this.initialState == null)?"<null>":this.initialState));
sb.append(',');
sb.append("immutableState");
sb.append('=');
sb.append(((this.immutableState == null)?"<null>":this.immutableState));
sb.append(',');
sb.append("edgeTraversals");
sb.append('=');
sb.append(((this.edgeTraversals == null)?"<null>":this.edgeTraversals));
sb.append(',');
sb.append("properties");
sb.append('=');
sb.append(((this.properties == null)?"<null>":this.properties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.initialState == null)? 0 :this.initialState.hashCode()));
result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
result = ((result* 31)+((this.immutableState == null)? 0 :this.immutableState.hashCode()));
result = ((result* 31)+((this.runGraphIndex == null)? 0 :this.runGraphIndex.hashCode()));
result = ((result* 31)+((this.resultGraphIndex == null)? 0 :this.resultGraphIndex.hashCode()));
result = ((result* 31)+((this.edgeTraversals == null)? 0 :this.edgeTraversals.hashCode()));
result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof GraphTraversal) == false) {
return false;
}
GraphTraversal rhs = ((GraphTraversal) other);
return ((((((((this.initialState == rhs.initialState)||((this.initialState!= null)&&this.initialState.equals(rhs.initialState)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.immutableState == rhs.immutableState)||((this.immutableState!= null)&&this.immutableState.equals(rhs.immutableState))))&&((this.runGraphIndex == rhs.runGraphIndex)||((this.runGraphIndex!= null)&&this.runGraphIndex.equals(rhs.runGraphIndex))))&&((this.resultGraphIndex == rhs.resultGraphIndex)||((this.resultGraphIndex!= null)&&this.resultGraphIndex.equals(rhs.resultGraphIndex))))&&((this.edgeTraversals == rhs.edgeTraversals)||((this.edgeTraversals!= null)&&this.edgeTraversals.equals(rhs.edgeTraversals))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))));
}
}
| 10,536 | 0.651006 | 0.647779 | 302 | 33.884106 | 57.484722 | 875 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.384106 | false | false | 2 |
eecfd5771e753ecfc40a0069a43d8935f8a22d9b | 22,153,441,314,196 | 469cf151dd84ee2fda37002755ca694065790d17 | /src/com/company/Gnome.java | 035b716fdda325df796113e4510a2155689f2998 | [] | no_license | zubastik127/Task_6.1 | https://github.com/zubastik127/Task_6.1 | 313518125fc70f6f8286d2d9fd0b363d4d0ae079 | 01db0a79cd89df45e9d8d7bfe4b9bf44db183684 | refs/heads/master | 2023-03-13T10:20:47.714000 | 2021-03-06T05:42:13 | 2021-03-06T05:42:13 | 345,015,797 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.company;
public abstract class Gnome {
private String nameGnome;
private String specializationGnome;
public Gnome(String nameGnome, String specializationGnome) {
this.nameGnome = nameGnome;
this.specializationGnome = specializationGnome;
}
public String getNameGnome() {
return nameGnome;
}
public String getSpecializationGnome() {
return specializationGnome;
}
public abstract void run();
public abstract void friend();
public void dead(){
System.out.println("К сожалению, Сквернодрыг умирает");
}
}
| UTF-8 | Java | 638 | java | Gnome.java | Java | [] | null | [] | package com.company;
public abstract class Gnome {
private String nameGnome;
private String specializationGnome;
public Gnome(String nameGnome, String specializationGnome) {
this.nameGnome = nameGnome;
this.specializationGnome = specializationGnome;
}
public String getNameGnome() {
return nameGnome;
}
public String getSpecializationGnome() {
return specializationGnome;
}
public abstract void run();
public abstract void friend();
public void dead(){
System.out.println("К сожалению, Сквернодрыг умирает");
}
}
| 638 | 0.67377 | 0.67377 | 29 | 20.034483 | 20.313887 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.413793 | false | false | 2 |
5ef5961d585b3b2ddcc286a727980087b7f68b18 | 26,852,135,601,271 | 004bdc57b633fb0ae765999b51c8dd97b82a0c44 | /OrdersService/src/main/java/com/appsdeveloperblog/estore/OrdersService/command/commands/RejectOrderCommand.java | 2e7838905ec2d690e48536f302f5822fd153b127 | [] | no_license | jackieung451/CQRS-Ecommerce | https://github.com/jackieung451/CQRS-Ecommerce | 2bdfe7655fe7364aa300895c44abe3b0360ea43b | dbd3f86c779beb19da3bf3de529237599c8a735b | refs/heads/main | 2023-09-01T04:34:42.453000 | 2021-11-02T20:27:29 | 2021-11-02T20:27:29 | 421,242,861 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.appsdeveloperblog.estore.OrdersService.command.commands;
import org.axonframework.modelling.command.TargetAggregateIdentifier;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import lombok.Value;
@Value
@DynamoDBTable(tableName = "orders")
public class RejectOrderCommand {
@DynamoDBHashKey(attributeName = "orderId")
@DynamoDBAutoGeneratedKey
@TargetAggregateIdentifier
private final String orderId;
@DynamoDBAttribute
private final String reason;
}
| UTF-8 | Java | 721 | java | RejectOrderCommand.java | Java | [] | null | [] | package com.appsdeveloperblog.estore.OrdersService.command.commands;
import org.axonframework.modelling.command.TargetAggregateIdentifier;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import lombok.Value;
@Value
@DynamoDBTable(tableName = "orders")
public class RejectOrderCommand {
@DynamoDBHashKey(attributeName = "orderId")
@DynamoDBAutoGeneratedKey
@TargetAggregateIdentifier
private final String orderId;
@DynamoDBAttribute
private final String reason;
}
| 721 | 0.851595 | 0.846047 | 23 | 30.347826 | 27.518545 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.695652 | false | false | 2 |
32ddaa51536b27e30ecac0751e93c5377d83a085 | 13,950,053,802,172 | 92f4bb5d13941e0e8042c67fede9ff0507ef3212 | /src/main/java/com/example/config/BeanLifeCycleConfig.java | 315c8692d32188c17fa768a232e459427e08689e | [] | no_license | allen1213/spring-annotation | https://github.com/allen1213/spring-annotation | 5822a8e6c7d17fd844317c8ca2f0da33d72d5915 | 27a0ee9da88aad82aa433b26b46934b930a60393 | refs/heads/master | 2022-06-24T15:04:05.569000 | 2020-02-28T06:01:49 | 2020-02-28T06:01:49 | 234,053,940 | 0 | 0 | null | false | 2022-06-21T02:38:35 | 2020-01-15T10:17:43 | 2020-02-28T06:02:16 | 2022-06-21T02:38:34 | 18,409 | 0 | 0 | 4 | Java | false | false | package com.example.config;
import com.example.bean.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
@Configuration
@ComponentScan(value = "com.example.condition")
public class BeanLifeCycleConfig {
@Bean
//@Scope(value = "prototype")
//@Bean(initMethod = "init",destroyMethod = "destroy")
public Car car() {
return new Car();
}
}
| UTF-8 | Java | 545 | java | BeanLifeCycleConfig.java | Java | [] | null | [] | package com.example.config;
import com.example.bean.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
@Configuration
@ComponentScan(value = "com.example.condition")
public class BeanLifeCycleConfig {
@Bean
//@Scope(value = "prototype")
//@Bean(initMethod = "init",destroyMethod = "destroy")
public Car car() {
return new Car();
}
}
| 545 | 0.752294 | 0.752294 | 19 | 27.68421 | 21.38138 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.421053 | false | false | 2 |
6ca241017434019ec9f12386df9a096f8c476161 | 13,950,053,803,230 | bcb3e750e703acc65d2fcd2b18228717aebdd1af | /src/main/java/com/zkw/jmx/tutorials/notificationdemo/HelloListener.java | c42c324f9aa8c3941f08a277112b087cd42c77cf | [] | no_license | jameszkw/demo | https://github.com/jameszkw/demo | 095879f15339411d4c02de45d207343c271f8d90 | ace9b39c5498c4476483476e886a05b19104bbde | refs/heads/master | 2020-05-29T20:16:38.762000 | 2018-04-18T01:23:18 | 2018-04-18T01:23:18 | 32,331,158 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zkw.jmx.tutorials.notificationdemo;
import com.zkw.jmx.tutorials.first.Hello;
import javax.management.Notification;
import javax.management.NotificationListener;
/**
* Created by Administrator on 2016/5/24 0024.
*/
public class HelloListener implements NotificationListener {
public void handleNotification(Notification n, Object handback) {
System.out.println("type=" + n.getType());
System.out.println("source=" + n.getSource());
System.out.println("seq=" + n.getSequenceNumber());
System.out.println("send time=" + n.getTimeStamp());
System.out.println("message=" + n.getMessage());
if (handback != null) {
if (handback instanceof Hello) {
Hello hello = (Hello) handback;
hello.printHello(n.getMessage());
}
}
}
}
| UTF-8 | Java | 879 | java | HelloListener.java | Java | [] | null | [] | package com.zkw.jmx.tutorials.notificationdemo;
import com.zkw.jmx.tutorials.first.Hello;
import javax.management.Notification;
import javax.management.NotificationListener;
/**
* Created by Administrator on 2016/5/24 0024.
*/
public class HelloListener implements NotificationListener {
public void handleNotification(Notification n, Object handback) {
System.out.println("type=" + n.getType());
System.out.println("source=" + n.getSource());
System.out.println("seq=" + n.getSequenceNumber());
System.out.println("send time=" + n.getTimeStamp());
System.out.println("message=" + n.getMessage());
if (handback != null) {
if (handback instanceof Hello) {
Hello hello = (Hello) handback;
hello.printHello(n.getMessage());
}
}
}
}
| 879 | 0.624573 | 0.612059 | 25 | 33.16 | 23.413979 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.48 | false | false | 2 |
e7f6daa6af837c48a423b6a2a2b3ca2d781473f8 | 14,525,579,455,812 | aa31642dbfc25850590fdfae0faa2d28e750c26e | /src/org/deri/nettopo/algorithm/dvhop/function/DVHOP_Test.java | 75022819f526d6e92fee728c7dcd2041e1d5dbbc | [] | no_license | Wondy-/Nettopo | https://github.com/Wondy-/Nettopo | 9cb6d1645205b6de2498e4ea4d91bc7de3a6c93e | 155cd3cc5feccd8a9980865065717ae328d1b846 | refs/heads/master | 2020-09-25T23:19:51.756000 | 2016-09-02T13:25:48 | 2016-09-02T13:25:48 | 67,224,729 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.deri.nettopo.algorithm.dvhop.function;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.deri.nettopo.algorithm.AlgorFunc;
import org.deri.nettopo.algorithm.Algorithm;
import org.deri.nettopo.app.NetTopoApp;
import org.deri.nettopo.network.WirelessSensorNetwork;
import org.deri.nettopo.node.VNode;
import org.deri.nettopo.node.localization.DVHopNode;
public class DVHOP_Test implements AlgorFunc {
private Algorithm algorithm;
private NetTopoApp app;
WirelessSensorNetwork wsn;
DVHOP_ConnectNeighbors connectNeighbors;
public DVHOP_Test(Algorithm algorithm) {
this.algorithm = algorithm;
}
public DVHOP_Test(){
this.algorithm = null;
}
/********************************/
@Override
public void run() {
connectNeighbors = new DVHOP_ConnectNeighbors(algorithm);
app = NetTopoApp.getApp();
wsn = app.getNetwork();
connectNeighbors.run();
Collection<VNode> sensorNodes = wsn.getNodes("org.deri.nettopo.node.localization.DVHopNode", true);
Iterator<VNode>itAll=sensorNodes.iterator();
while (itAll.hasNext()) {
DVHopNode node = (DVHopNode) itAll.next();
System.out.println("##For node id:"+node.getID());
ArrayList<Integer> neighbors=node.getNeighbors();
Iterator<Integer> it=neighbors.iterator();
while (it.hasNext()) {
Integer id = (Integer) it.next();
System.out.println("neighbor id is:"+id);
}
}
}
public Algorithm getAlgorithm() {
return algorithm;
}
public void setAlgorithm(Algorithm algorithm) {
this.algorithm = algorithm;
}
}
| UTF-8 | Java | 1,627 | java | DVHOP_Test.java | Java | [] | null | [] | package org.deri.nettopo.algorithm.dvhop.function;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.deri.nettopo.algorithm.AlgorFunc;
import org.deri.nettopo.algorithm.Algorithm;
import org.deri.nettopo.app.NetTopoApp;
import org.deri.nettopo.network.WirelessSensorNetwork;
import org.deri.nettopo.node.VNode;
import org.deri.nettopo.node.localization.DVHopNode;
public class DVHOP_Test implements AlgorFunc {
private Algorithm algorithm;
private NetTopoApp app;
WirelessSensorNetwork wsn;
DVHOP_ConnectNeighbors connectNeighbors;
public DVHOP_Test(Algorithm algorithm) {
this.algorithm = algorithm;
}
public DVHOP_Test(){
this.algorithm = null;
}
/********************************/
@Override
public void run() {
connectNeighbors = new DVHOP_ConnectNeighbors(algorithm);
app = NetTopoApp.getApp();
wsn = app.getNetwork();
connectNeighbors.run();
Collection<VNode> sensorNodes = wsn.getNodes("org.deri.nettopo.node.localization.DVHopNode", true);
Iterator<VNode>itAll=sensorNodes.iterator();
while (itAll.hasNext()) {
DVHopNode node = (DVHopNode) itAll.next();
System.out.println("##For node id:"+node.getID());
ArrayList<Integer> neighbors=node.getNeighbors();
Iterator<Integer> it=neighbors.iterator();
while (it.hasNext()) {
Integer id = (Integer) it.next();
System.out.println("neighbor id is:"+id);
}
}
}
public Algorithm getAlgorithm() {
return algorithm;
}
public void setAlgorithm(Algorithm algorithm) {
this.algorithm = algorithm;
}
}
| 1,627 | 0.70252 | 0.70252 | 57 | 26.543859 | 20.87479 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.807018 | false | false | 2 |
f81e73c5ea1d992593c1943c94f463f917b6dffe | 13,563,506,782,202 | a0e4d578e31621422f601c1fc4916b9d6ec3bc1b | /project_r/src/report/kimsangcheol/r0011/ExceptionExam1.java | dba021682d0c4e419cf4e89815d2dbf3c8c8b737 | [] | no_license | Prekallen/WorkSpace | https://github.com/Prekallen/WorkSpace | fb92c4fb846be2c0f492609642841349344d5384 | a96106b8276cd5825f6436228b418c0e9441bda2 | refs/heads/master | 2021-01-25T08:02:01.651000 | 2017-11-03T07:29:26 | 2017-11-03T07:29:26 | 93,705,401 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package report.kimsangcheol.r0011;
import java.util.Scanner;
public class ExceptionExam1 {
final int NUM=1; //final 선언은 상수값 >> 풀네임 대문자 절대 변하지 않는 값(값을 처음 초기화 안하면 무조건 에러)
int num1;
int num2;
int result;
int calPlus(){
result =num1+num2;
return result;
}
int calMinus(){
result =num1-num2;
return result;
}
int calMultiple(){
result =num1*num2;
return result;
}
int calDivision(){
result =num1/num2;
return result;
}
public static void main(String[]args){
ExceptionExam1 ee1 = new ExceptionExam1();
Scanner scan = new Scanner(System.in);
try{
System.out.println("연산할 수를 입력하세요.>");
ee1.num1 = Integer.parseInt(scan.nextLine());
System.out.println("연산할 수를 입력하세요.>");
ee1.num2 = Integer.parseInt(scan.nextLine());
ee1.calPlus();
System.out.println("더한 값은? : "+ee1.result);
ee1.calMinus();
System.out.println("뺀 값은? : "+ee1.result);
ee1.calMultiple();
System.out.println("곱한 값은? : "+ee1.result);
ee1.calDivision();
System.out.println("나눈 값은? : "+ee1.result);
}catch(Exception e){
System.out.println("정수를 입력해야겠죠??????!!"); //try,catch문의 결과와 상관없이 finally를 무조건 실행
}finally{
System.out.println("에러 나든 안나든 난 무조건~");
}
}
}
| UTF-8 | Java | 1,472 | java | ExceptionExam1.java | Java | [] | null | [] | package report.kimsangcheol.r0011;
import java.util.Scanner;
public class ExceptionExam1 {
final int NUM=1; //final 선언은 상수값 >> 풀네임 대문자 절대 변하지 않는 값(값을 처음 초기화 안하면 무조건 에러)
int num1;
int num2;
int result;
int calPlus(){
result =num1+num2;
return result;
}
int calMinus(){
result =num1-num2;
return result;
}
int calMultiple(){
result =num1*num2;
return result;
}
int calDivision(){
result =num1/num2;
return result;
}
public static void main(String[]args){
ExceptionExam1 ee1 = new ExceptionExam1();
Scanner scan = new Scanner(System.in);
try{
System.out.println("연산할 수를 입력하세요.>");
ee1.num1 = Integer.parseInt(scan.nextLine());
System.out.println("연산할 수를 입력하세요.>");
ee1.num2 = Integer.parseInt(scan.nextLine());
ee1.calPlus();
System.out.println("더한 값은? : "+ee1.result);
ee1.calMinus();
System.out.println("뺀 값은? : "+ee1.result);
ee1.calMultiple();
System.out.println("곱한 값은? : "+ee1.result);
ee1.calDivision();
System.out.println("나눈 값은? : "+ee1.result);
}catch(Exception e){
System.out.println("정수를 입력해야겠죠??????!!"); //try,catch문의 결과와 상관없이 finally를 무조건 실행
}finally{
System.out.println("에러 나든 안나든 난 무조건~");
}
}
}
| 1,472 | 0.624406 | 0.599842 | 54 | 21.370371 | 19.531832 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.277778 | false | false | 2 |
c10d99d82628b2f16555438a77c21b3a6b3b6178 | 3,968,549,837,255 | 6ce12aa1d6b1a174609e9f8ce45d6504349a1df5 | /app/src/main/java/kale/http/example/OkHttpApi.java | 8bb7ee221ac79bddab0f25304e29e88ec4cf59d4 | [] | no_license | tianzhijiexian/HttpAnnotation | https://github.com/tianzhijiexian/HttpAnnotation | be9256d56f19a052d57a33b879f5531a2f8381cb | 87b1ce3ce2a0f3cfbe149d8826c90221b6b2ba91 | refs/heads/master | 2021-01-18T21:40:34.980000 | 2016-07-20T10:06:45 | 2016-07-20T10:06:45 | 41,082,689 | 2 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kale.http.example;
import kale.http.skin.annotation.ApiInterface;
import kale.http.skin.annotation.HttpGet;
import okhttp3.Call;
/**
* @author Kale
* @date 2016/6/11
*/
@ApiInterface
public interface OkHttpApi {
@HttpGet(value = "/random/data/Android/1" )
Call testOkHttpGet(String name);
}
| UTF-8 | Java | 313 | java | OkHttpApi.java | Java | [
{
"context": "tion.HttpGet;\nimport okhttp3.Call;\n\n/**\n * @author Kale\n * @date 2016/6/11\n */\n@ApiInterface\npublic inter",
"end": 158,
"score": 0.9954556226730347,
"start": 154,
"tag": "USERNAME",
"value": "Kale"
}
] | null | [] | package kale.http.example;
import kale.http.skin.annotation.ApiInterface;
import kale.http.skin.annotation.HttpGet;
import okhttp3.Call;
/**
* @author Kale
* @date 2016/6/11
*/
@ApiInterface
public interface OkHttpApi {
@HttpGet(value = "/random/data/Android/1" )
Call testOkHttpGet(String name);
}
| 313 | 0.728435 | 0.699681 | 16 | 18.5625 | 16.556602 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false | 2 |
1b80c2c1203019f6e2dcefbde15a7140b9e1c30c | 6,906,307,464,227 | 0930a0d8867ee4404e54c08b57dab7e6a57d9e14 | /module-order/src/test/java/com/zj/th/order/ExampleUnitTest.java | 114ce4fef59a21842242ed3745c41cc415b8853b | [] | no_license | fangood/mvvm_base | https://github.com/fangood/mvvm_base | 47d1a93d2f8e30baf6f0715958a960f41b6b7255 | 2c86c120c652cffabf353877b908601a8b5dfdb0 | refs/heads/master | 2021-08-19T15:13:04.887000 | 2020-07-03T05:27:53 | 2020-07-03T05:27:53 | 201,020,308 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zj.th.order;
import org.junit.Test;
import io.reactivex.Observable;
import static org.junit.Assert.assertEquals;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
@Test
public void testRxJava() {
Observable.just(1, 2, 3)
.doOnSubscribe(disposable -> System.out.println("doOnSubscribe:before doOnNext"))
.doOnComplete(() -> System.out.println("doOnCompleted"))
.doFinally(() -> System.out.println("doFinally:before doOnNext"))
.doAfterTerminate(() -> System.out.println("doAfterTerminate:before doOnNext"))
.doFinally(() -> System.out.println("doFinally:before doOnNext"))
.doOnNext(num -> System.out.println("doOnNext:" + num))
.doOnNext(num -> {
if (num == 3) {
throw new Exception("error");
}
})
.doOnError(throwable -> System.out.println("doOnError:" + throwable.getMessage()))
.doFinally(() -> System.out.println("doFinally:after doOnNext"))
.doAfterTerminate(() -> System.out.println("doAfterTerminate:after doOnNext"))
.doFinally(() -> System.out.println("doFinally:after doOnNext"))
.doOnSubscribe(disposable -> System.out.println("doOnSubscribe:after doOnNext"))
.subscribe(num -> {
System.out.println("subscribe:" + num);
assertEquals(1, 1);
if (num == 3) {
//throw new Exception("error");
}
},
throwable -> {
System.out.println("subscribe:" + throwable.getMessage());
throw new Exception("error");
});
}
} | UTF-8 | Java | 2,152 | java | ExampleUnitTest.java | Java | [] | null | [] | package com.zj.th.order;
import org.junit.Test;
import io.reactivex.Observable;
import static org.junit.Assert.assertEquals;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
@Test
public void testRxJava() {
Observable.just(1, 2, 3)
.doOnSubscribe(disposable -> System.out.println("doOnSubscribe:before doOnNext"))
.doOnComplete(() -> System.out.println("doOnCompleted"))
.doFinally(() -> System.out.println("doFinally:before doOnNext"))
.doAfterTerminate(() -> System.out.println("doAfterTerminate:before doOnNext"))
.doFinally(() -> System.out.println("doFinally:before doOnNext"))
.doOnNext(num -> System.out.println("doOnNext:" + num))
.doOnNext(num -> {
if (num == 3) {
throw new Exception("error");
}
})
.doOnError(throwable -> System.out.println("doOnError:" + throwable.getMessage()))
.doFinally(() -> System.out.println("doFinally:after doOnNext"))
.doAfterTerminate(() -> System.out.println("doAfterTerminate:after doOnNext"))
.doFinally(() -> System.out.println("doFinally:after doOnNext"))
.doOnSubscribe(disposable -> System.out.println("doOnSubscribe:after doOnNext"))
.subscribe(num -> {
System.out.println("subscribe:" + num);
assertEquals(1, 1);
if (num == 3) {
//throw new Exception("error");
}
},
throwable -> {
System.out.println("subscribe:" + throwable.getMessage());
throw new Exception("error");
});
}
} | 2,152 | 0.518123 | 0.513476 | 51 | 41.215687 | 31.838633 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.352941 | false | false | 2 |
b7c8a7b54dbdc7acc35ddbbc3d57de2e3e399ca6 | 7,000,796,747,636 | e3d3f8031fbc776338fe29054850d970243b8e9c | /src/test/java/idv/kuma/medium/unique_paths/SolutionTest.java | 2c3e114d04e86c43a01ca0ff9842d0f551b9b34f | [] | no_license | bearhsu2/leetcode | https://github.com/bearhsu2/leetcode | 7e4fc7407a6512ce720f688108b37bf7caaf16bf | e3e5c3901b72a3c42d0212a0191a34bfe8732616 | refs/heads/master | 2023-07-09T02:17:26.061000 | 2022-02-24T14:56:59 | 2022-02-24T14:56:59 | 169,732,872 | 0 | 0 | null | false | 2022-02-24T15:14:29 | 2019-02-08T12:37:39 | 2020-11-12T15:23:17 | 2022-02-24T15:14:27 | 531 | 0 | 0 | 0 | Java | false | false | package idv.kuma.medium.unique_paths;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class SolutionTest {
@Test
public void _3_2_is_6() {
Assert.assertEquals(6, new Solution().uniquePaths(3, 3));
}
@Test
public void _7_3_is_28() {
Assert.assertEquals(28, new Solution().uniquePaths(7, 3));
}
} | UTF-8 | Java | 381 | java | SolutionTest.java | Java | [] | null | [] | package idv.kuma.medium.unique_paths;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class SolutionTest {
@Test
public void _3_2_is_6() {
Assert.assertEquals(6, new Solution().uniquePaths(3, 3));
}
@Test
public void _7_3_is_28() {
Assert.assertEquals(28, new Solution().uniquePaths(7, 3));
}
} | 381 | 0.64042 | 0.603675 | 20 | 18.1 | 20.285215 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 2 |
231b6328d0384e6417142997bfb4678811a308b0 | 25,125,558,739,112 | 7c81a060b94ee1b526ec87522efc0fe2afde3477 | /src/main/java/com/cybertek/streamLambdaExercise/model/UserState.java | dc4d8fa44bbb2a03d9eeb64200774eb0799e1ff6 | [] | no_license | letmedevelop-sam/data-structure-and-algorithm | https://github.com/letmedevelop-sam/data-structure-and-algorithm | 483f41f2010ed1b2b62c504375ea48ea09e601ca | ce332bc242920faf1d685bff7aa69528943765fa | refs/heads/main | 2023-06-08T16:03:39.179000 | 2021-06-29T20:21:28 | 2021-06-29T20:21:28 | 381,478,898 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cybertek.streamLambdaExercise.model;
public enum UserState {
CONFIRMED,
PENDING,
SUSPENDED
} | UTF-8 | Java | 117 | java | UserState.java | Java | [] | null | [] | package com.cybertek.streamLambdaExercise.model;
public enum UserState {
CONFIRMED,
PENDING,
SUSPENDED
} | 117 | 0.74359 | 0.74359 | 7 | 15.857142 | 15.037369 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 2 |
822b61cfc3f16de99e8738c7cc5650e50f55ebd7 | 18,305,150,665,503 | 718db762ade393eb00bbe02ea084e15451179c54 | /MitVideoSearch/app/src/main/java/com/example/kareemdasilva/mitvideosearch/UploadActivity.java | 0f0afabc1c537b7a6c6ff4c3ebc500ca2e00ee11 | [] | no_license | DasilvaKareem/HackMit2015 | https://github.com/DasilvaKareem/HackMit2015 | 0c2f95a7b83a5815c93456143942cff3fd968ae0 | 21765ac41a9a9f77c97ee65fb2cde0318559bd8d | refs/heads/master | 2016-09-05T16:37:07.883000 | 2015-09-26T20:23:48 | 2015-09-26T20:23:48 | 42,781,112 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.kareemdasilva.mitvideosearch;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.content.Intent;
import android.view.View;
import android.net.Uri;
import java.util.ArrayList;
import android.widget.ArrayAdapter;
import android.widget.AdapterView;
import android.widget.TextView;
import android.graphics.Bitmap;
import android.graphics.Color;
import java.util.List;
import java.io.InputStream;
import android.graphics.BitmapFactory;
import java.io.IOException;
public class UploadActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload);
}
public void uploadVideo(View view) {
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("video/*");
startActivityForResult(photoPickerIntent, 100);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch(requestCode) {
case 100:
if(resultCode == RESULT_OK){
Uri selectedImage = imageReturnedIntent.getData();
Intent intent = new Intent(UploadActivity.this, VideoSearchActivity.class);
intent.putExtra("videoPath",selectedImage.toString());
startActivity(intent);
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_upload, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| UTF-8 | Java | 2,370 | java | UploadActivity.java | Java | [
{
"context": "package com.example.kareemdasilva.mitvideosearch;\n\nimport android.support.v7.app.Ac",
"end": 33,
"score": 0.9973471164703369,
"start": 20,
"tag": "USERNAME",
"value": "kareemdasilva"
}
] | null | [] | package com.example.kareemdasilva.mitvideosearch;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.content.Intent;
import android.view.View;
import android.net.Uri;
import java.util.ArrayList;
import android.widget.ArrayAdapter;
import android.widget.AdapterView;
import android.widget.TextView;
import android.graphics.Bitmap;
import android.graphics.Color;
import java.util.List;
import java.io.InputStream;
import android.graphics.BitmapFactory;
import java.io.IOException;
public class UploadActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload);
}
public void uploadVideo(View view) {
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("video/*");
startActivityForResult(photoPickerIntent, 100);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch(requestCode) {
case 100:
if(resultCode == RESULT_OK){
Uri selectedImage = imageReturnedIntent.getData();
Intent intent = new Intent(UploadActivity.this, VideoSearchActivity.class);
intent.putExtra("videoPath",selectedImage.toString());
startActivity(intent);
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_upload, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| 2,370 | 0.686076 | 0.683122 | 78 | 29.384615 | 25.618118 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.551282 | false | false | 2 |
fb52bdb047755d23a70fe7a0b5751fa354f54be7 | 31,765,578,187,268 | ed882885b1f9760d85dfb3125477aecc0e63d6a5 | /net/minecraft/entity/EntityList.java | 49a40e81a86f96221e2cbd184d4f17fa8ed9ac67 | [] | no_license | UserNumberOne/Nothing | https://github.com/UserNumberOne/Nothing | 6c43dd3c92e568252c3873859320b40e10d4a920 | 7d9a8a40599353cd6f5199653dbecee93b2df7c9 | refs/heads/master | 2021-01-10T15:25:23.957000 | 2017-09-13T15:55:46 | 2017-09-13T15:55:46 | 46,665,593 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.minecraft.entity;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityEnderEye;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityExpBottle;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartChest;
import net.minecraft.entity.item.EntityMinecartCommandBlock;
import net.minecraft.entity.item.EntityMinecartEmpty;
import net.minecraft.entity.item.EntityMinecartFurnace;
import net.minecraft.entity.item.EntityMinecartHopper;
import net.minecraft.entity.item.EntityMinecartMobSpawner;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityEndermite;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityGiantZombie;
import net.minecraft.entity.monster.EntityGuardian;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityPolarBear;
import net.minecraft.entity.monster.EntityShulker;
import net.minecraft.entity.monster.EntitySilverfish;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityDragonFireball;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.entity.projectile.EntityShulkerBullet;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntitySpectralArrow;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.entity.projectile.EntityWitherSkull;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatList;
import net.minecraft.world.World;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class EntityList {
private static final Logger LOGGER = LogManager.getLogger();
private static final Map NAME_TO_CLASS = Maps.newHashMap();
private static final Map CLASS_TO_NAME = Maps.newHashMap();
private static final Map ID_TO_CLASS = Maps.newHashMap();
private static final Map CLASS_TO_ID = Maps.newHashMap();
private static final Map NAME_TO_ID = Maps.newHashMap();
public static final Map ENTITY_EGGS = Maps.newLinkedHashMap();
private static void addMapping(Class var0, String var1, int var2) {
if (NAME_TO_CLASS.containsKey(var1)) {
throw new IllegalArgumentException("ID is already registered: " + var1);
} else if (ID_TO_CLASS.containsKey(Integer.valueOf(var2))) {
throw new IllegalArgumentException("ID is already registered: " + var2);
} else if (var2 == 0) {
throw new IllegalArgumentException("Cannot register to reserved id: " + var2);
} else if (var0 == null) {
throw new IllegalArgumentException("Cannot register null clazz for id: " + var2);
} else {
NAME_TO_CLASS.put(var1, var0);
CLASS_TO_NAME.put(var0, var1);
ID_TO_CLASS.put(Integer.valueOf(var2), var0);
CLASS_TO_ID.put(var0, Integer.valueOf(var2));
NAME_TO_ID.put(var1, Integer.valueOf(var2));
}
}
private static void addMapping(Class var0, String var1, int var2, int var3, int var4) {
addMapping(var0, var1, var2);
ENTITY_EGGS.put(var1, new EntityList.EntityEggInfo(var1, var3, var4));
}
@Nullable
public static Entity createEntityByName(String var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)NAME_TO_CLASS.get(var0);
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
return var2;
}
@Nullable
public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)NAME_TO_CLASS.get(var0.getString("id"));
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
if (var2 != null) {
var2.readFromNBT(var0);
} else {
LOGGER.warn("Skipping Entity with id {}", new Object[]{var0.getString("id")});
}
return var2;
}
@Nullable
public static Entity createEntityByID(int var0, World var1) {
Entity var2 = null;
try {
Class var3 = getClassFromID(var0);
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
if (var2 == null) {
LOGGER.warn("Skipping Entity with id {}", new Object[]{var0});
}
return var2;
}
@Nullable
public static Entity createEntityByIDFromName(String var0, World var1) {
return createEntityByID(getIDFromString(var0), var1);
}
public static int getEntityID(Entity var0) {
Integer var1 = (Integer)CLASS_TO_ID.get(var0.getClass());
return var1 == null ? 0 : var1.intValue();
}
@Nullable
public static Class getClassFromID(int var0) {
return (Class)ID_TO_CLASS.get(Integer.valueOf(var0));
}
public static String getEntityString(Entity var0) {
return getEntityStringFromClass(var0.getClass());
}
public static String getEntityStringFromClass(Class var0) {
return (String)CLASS_TO_NAME.get(var0);
}
public static int getIDFromString(String var0) {
Integer var1 = (Integer)NAME_TO_ID.get(var0);
return var1 == null ? 90 : var1.intValue();
}
public static void init() {
}
public static List getEntityNameList() {
Set var0 = NAME_TO_CLASS.keySet();
ArrayList var1 = Lists.newArrayList();
for(String var3 : var0) {
Class var4 = (Class)NAME_TO_CLASS.get(var3);
if ((var4.getModifiers() & 1024) != 1024) {
var1.add(var3);
}
}
var1.add("LightningBolt");
return var1;
}
public static boolean isStringEntityName(Entity var0, String var1) {
String var2 = getEntityString(var0);
if (var2 == null) {
if (var0 instanceof EntityPlayer) {
var2 = "Player";
} else {
if (!(var0 instanceof EntityLightningBolt)) {
return false;
}
var2 = "LightningBolt";
}
}
return var1.equals(var2);
}
public static boolean isStringValidEntityName(String var0) {
return "Player".equals(var0) || getEntityNameList().contains(var0);
}
static {
addMapping(EntityItem.class, "Item", 1);
addMapping(EntityXPOrb.class, "XPOrb", 2);
addMapping(EntityAreaEffectCloud.class, "AreaEffectCloud", 3);
addMapping(EntityEgg.class, "ThrownEgg", 7);
addMapping(EntityLeashKnot.class, "LeashKnot", 8);
addMapping(EntityPainting.class, "Painting", 9);
addMapping(EntityTippedArrow.class, "Arrow", 10);
addMapping(EntitySnowball.class, "Snowball", 11);
addMapping(EntityLargeFireball.class, "Fireball", 12);
addMapping(EntitySmallFireball.class, "SmallFireball", 13);
addMapping(EntityEnderPearl.class, "ThrownEnderpearl", 14);
addMapping(EntityEnderEye.class, "EyeOfEnderSignal", 15);
addMapping(EntityPotion.class, "ThrownPotion", 16);
addMapping(EntityExpBottle.class, "ThrownExpBottle", 17);
addMapping(EntityItemFrame.class, "ItemFrame", 18);
addMapping(EntityWitherSkull.class, "WitherSkull", 19);
addMapping(EntityTNTPrimed.class, "PrimedTnt", 20);
addMapping(EntityFallingBlock.class, "FallingSand", 21);
addMapping(EntityFireworkRocket.class, "FireworksRocketEntity", 22);
addMapping(EntitySpectralArrow.class, "SpectralArrow", 24);
addMapping(EntityShulkerBullet.class, "ShulkerBullet", 25);
addMapping(EntityDragonFireball.class, "DragonFireball", 26);
addMapping(EntityArmorStand.class, "ArmorStand", 30);
addMapping(EntityBoat.class, "Boat", 41);
addMapping(EntityMinecartEmpty.class, EntityMinecart.Type.RIDEABLE.getName(), 42);
addMapping(EntityMinecartChest.class, EntityMinecart.Type.CHEST.getName(), 43);
addMapping(EntityMinecartFurnace.class, EntityMinecart.Type.FURNACE.getName(), 44);
addMapping(EntityMinecartTNT.class, EntityMinecart.Type.TNT.getName(), 45);
addMapping(EntityMinecartHopper.class, EntityMinecart.Type.HOPPER.getName(), 46);
addMapping(EntityMinecartMobSpawner.class, EntityMinecart.Type.SPAWNER.getName(), 47);
addMapping(EntityMinecartCommandBlock.class, EntityMinecart.Type.COMMAND_BLOCK.getName(), 40);
addMapping(EntityLiving.class, "Mob", 48);
addMapping(EntityMob.class, "Monster", 49);
addMapping(EntityCreeper.class, "Creeper", 50, 894731, 0);
addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889);
addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646);
addMapping(EntityGiantZombie.class, "Giant", 53);
addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893);
addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542);
addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084);
addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705);
addMapping(EntityEnderman.class, "Enderman", 58, 1447446, 0);
addMapping(EntityCaveSpider.class, "CaveSpider", 59, 803406, 11013646);
addMapping(EntitySilverfish.class, "Silverfish", 60, 7237230, 3158064);
addMapping(EntityBlaze.class, "Blaze", 61, 16167425, 16775294);
addMapping(EntityMagmaCube.class, "LavaSlime", 62, 3407872, 16579584);
addMapping(EntityDragon.class, "EnderDragon", 63);
addMapping(EntityWither.class, "WitherBoss", 64);
addMapping(EntityBat.class, "Bat", 65, 4996656, 986895);
addMapping(EntityWitch.class, "Witch", 66, 3407872, 5349438);
addMapping(EntityEndermite.class, "Endermite", 67, 1447446, 7237230);
addMapping(EntityGuardian.class, "Guardian", 68, 5931634, 15826224);
addMapping(EntityShulker.class, "Shulker", 69, 9725844, 5060690);
addMapping(EntityPig.class, "Pig", 90, 15771042, 14377823);
addMapping(EntitySheep.class, "Sheep", 91, 15198183, 16758197);
addMapping(EntityCow.class, "Cow", 92, 4470310, 10592673);
addMapping(EntityChicken.class, "Chicken", 93, 10592673, 16711680);
addMapping(EntitySquid.class, "Squid", 94, 2243405, 7375001);
addMapping(EntityWolf.class, "Wolf", 95, 14144467, 13545366);
addMapping(EntityMooshroom.class, "MushroomCow", 96, 10489616, 12040119);
addMapping(EntitySnowman.class, "SnowMan", 97);
addMapping(EntityOcelot.class, "Ozelot", 98, 15720061, 5653556);
addMapping(EntityIronGolem.class, "VillagerGolem", 99);
addMapping(EntityHorse.class, "EntityHorse", 100, 12623485, 15656192);
addMapping(EntityRabbit.class, "Rabbit", 101, 10051392, 7555121);
addMapping(EntityPolarBear.class, "PolarBear", 102, 15921906, 9803152);
addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002);
addMapping(EntityEnderCrystal.class, "EnderCrystal", 200);
}
public static class EntityEggInfo {
public final String spawnedID;
public final int primaryColor;
public final int secondaryColor;
public final StatBase killEntityStat;
public final StatBase entityKilledByStat;
public EntityEggInfo(String var1, int var2, int var3) {
this.spawnedID = var1;
this.primaryColor = var2;
this.secondaryColor = var3;
this.killEntityStat = StatList.getStatKillEntity(this);
this.entityKilledByStat = StatList.getStatEntityKilledBy(this);
}
}
}
| UTF-8 | Java | 14,032 | java | EntityList.java | Java | [] | null | [] | package net.minecraft.entity;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityEnderEye;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.item.EntityExpBottle;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartChest;
import net.minecraft.entity.item.EntityMinecartCommandBlock;
import net.minecraft.entity.item.EntityMinecartEmpty;
import net.minecraft.entity.item.EntityMinecartFurnace;
import net.minecraft.entity.item.EntityMinecartHopper;
import net.minecraft.entity.item.EntityMinecartMobSpawner;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.monster.EntityCaveSpider;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityEndermite;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityGiantZombie;
import net.minecraft.entity.monster.EntityGuardian;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityPolarBear;
import net.minecraft.entity.monster.EntityShulker;
import net.minecraft.entity.monster.EntitySilverfish;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityDragonFireball;
import net.minecraft.entity.projectile.EntityEgg;
import net.minecraft.entity.projectile.EntityLargeFireball;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.entity.projectile.EntityShulkerBullet;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.entity.projectile.EntitySpectralArrow;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.entity.projectile.EntityWitherSkull;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatList;
import net.minecraft.world.World;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class EntityList {
private static final Logger LOGGER = LogManager.getLogger();
private static final Map NAME_TO_CLASS = Maps.newHashMap();
private static final Map CLASS_TO_NAME = Maps.newHashMap();
private static final Map ID_TO_CLASS = Maps.newHashMap();
private static final Map CLASS_TO_ID = Maps.newHashMap();
private static final Map NAME_TO_ID = Maps.newHashMap();
public static final Map ENTITY_EGGS = Maps.newLinkedHashMap();
private static void addMapping(Class var0, String var1, int var2) {
if (NAME_TO_CLASS.containsKey(var1)) {
throw new IllegalArgumentException("ID is already registered: " + var1);
} else if (ID_TO_CLASS.containsKey(Integer.valueOf(var2))) {
throw new IllegalArgumentException("ID is already registered: " + var2);
} else if (var2 == 0) {
throw new IllegalArgumentException("Cannot register to reserved id: " + var2);
} else if (var0 == null) {
throw new IllegalArgumentException("Cannot register null clazz for id: " + var2);
} else {
NAME_TO_CLASS.put(var1, var0);
CLASS_TO_NAME.put(var0, var1);
ID_TO_CLASS.put(Integer.valueOf(var2), var0);
CLASS_TO_ID.put(var0, Integer.valueOf(var2));
NAME_TO_ID.put(var1, Integer.valueOf(var2));
}
}
private static void addMapping(Class var0, String var1, int var2, int var3, int var4) {
addMapping(var0, var1, var2);
ENTITY_EGGS.put(var1, new EntityList.EntityEggInfo(var1, var3, var4));
}
@Nullable
public static Entity createEntityByName(String var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)NAME_TO_CLASS.get(var0);
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
return var2;
}
@Nullable
public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)NAME_TO_CLASS.get(var0.getString("id"));
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
if (var2 != null) {
var2.readFromNBT(var0);
} else {
LOGGER.warn("Skipping Entity with id {}", new Object[]{var0.getString("id")});
}
return var2;
}
@Nullable
public static Entity createEntityByID(int var0, World var1) {
Entity var2 = null;
try {
Class var3 = getClassFromID(var0);
if (var3 != null) {
var2 = (Entity)var3.getConstructor(World.class).newInstance(var1);
}
} catch (Exception var4) {
var4.printStackTrace();
}
if (var2 == null) {
LOGGER.warn("Skipping Entity with id {}", new Object[]{var0});
}
return var2;
}
@Nullable
public static Entity createEntityByIDFromName(String var0, World var1) {
return createEntityByID(getIDFromString(var0), var1);
}
public static int getEntityID(Entity var0) {
Integer var1 = (Integer)CLASS_TO_ID.get(var0.getClass());
return var1 == null ? 0 : var1.intValue();
}
@Nullable
public static Class getClassFromID(int var0) {
return (Class)ID_TO_CLASS.get(Integer.valueOf(var0));
}
public static String getEntityString(Entity var0) {
return getEntityStringFromClass(var0.getClass());
}
public static String getEntityStringFromClass(Class var0) {
return (String)CLASS_TO_NAME.get(var0);
}
public static int getIDFromString(String var0) {
Integer var1 = (Integer)NAME_TO_ID.get(var0);
return var1 == null ? 90 : var1.intValue();
}
public static void init() {
}
public static List getEntityNameList() {
Set var0 = NAME_TO_CLASS.keySet();
ArrayList var1 = Lists.newArrayList();
for(String var3 : var0) {
Class var4 = (Class)NAME_TO_CLASS.get(var3);
if ((var4.getModifiers() & 1024) != 1024) {
var1.add(var3);
}
}
var1.add("LightningBolt");
return var1;
}
public static boolean isStringEntityName(Entity var0, String var1) {
String var2 = getEntityString(var0);
if (var2 == null) {
if (var0 instanceof EntityPlayer) {
var2 = "Player";
} else {
if (!(var0 instanceof EntityLightningBolt)) {
return false;
}
var2 = "LightningBolt";
}
}
return var1.equals(var2);
}
public static boolean isStringValidEntityName(String var0) {
return "Player".equals(var0) || getEntityNameList().contains(var0);
}
static {
addMapping(EntityItem.class, "Item", 1);
addMapping(EntityXPOrb.class, "XPOrb", 2);
addMapping(EntityAreaEffectCloud.class, "AreaEffectCloud", 3);
addMapping(EntityEgg.class, "ThrownEgg", 7);
addMapping(EntityLeashKnot.class, "LeashKnot", 8);
addMapping(EntityPainting.class, "Painting", 9);
addMapping(EntityTippedArrow.class, "Arrow", 10);
addMapping(EntitySnowball.class, "Snowball", 11);
addMapping(EntityLargeFireball.class, "Fireball", 12);
addMapping(EntitySmallFireball.class, "SmallFireball", 13);
addMapping(EntityEnderPearl.class, "ThrownEnderpearl", 14);
addMapping(EntityEnderEye.class, "EyeOfEnderSignal", 15);
addMapping(EntityPotion.class, "ThrownPotion", 16);
addMapping(EntityExpBottle.class, "ThrownExpBottle", 17);
addMapping(EntityItemFrame.class, "ItemFrame", 18);
addMapping(EntityWitherSkull.class, "WitherSkull", 19);
addMapping(EntityTNTPrimed.class, "PrimedTnt", 20);
addMapping(EntityFallingBlock.class, "FallingSand", 21);
addMapping(EntityFireworkRocket.class, "FireworksRocketEntity", 22);
addMapping(EntitySpectralArrow.class, "SpectralArrow", 24);
addMapping(EntityShulkerBullet.class, "ShulkerBullet", 25);
addMapping(EntityDragonFireball.class, "DragonFireball", 26);
addMapping(EntityArmorStand.class, "ArmorStand", 30);
addMapping(EntityBoat.class, "Boat", 41);
addMapping(EntityMinecartEmpty.class, EntityMinecart.Type.RIDEABLE.getName(), 42);
addMapping(EntityMinecartChest.class, EntityMinecart.Type.CHEST.getName(), 43);
addMapping(EntityMinecartFurnace.class, EntityMinecart.Type.FURNACE.getName(), 44);
addMapping(EntityMinecartTNT.class, EntityMinecart.Type.TNT.getName(), 45);
addMapping(EntityMinecartHopper.class, EntityMinecart.Type.HOPPER.getName(), 46);
addMapping(EntityMinecartMobSpawner.class, EntityMinecart.Type.SPAWNER.getName(), 47);
addMapping(EntityMinecartCommandBlock.class, EntityMinecart.Type.COMMAND_BLOCK.getName(), 40);
addMapping(EntityLiving.class, "Mob", 48);
addMapping(EntityMob.class, "Monster", 49);
addMapping(EntityCreeper.class, "Creeper", 50, 894731, 0);
addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889);
addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646);
addMapping(EntityGiantZombie.class, "Giant", 53);
addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893);
addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542);
addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084);
addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705);
addMapping(EntityEnderman.class, "Enderman", 58, 1447446, 0);
addMapping(EntityCaveSpider.class, "CaveSpider", 59, 803406, 11013646);
addMapping(EntitySilverfish.class, "Silverfish", 60, 7237230, 3158064);
addMapping(EntityBlaze.class, "Blaze", 61, 16167425, 16775294);
addMapping(EntityMagmaCube.class, "LavaSlime", 62, 3407872, 16579584);
addMapping(EntityDragon.class, "EnderDragon", 63);
addMapping(EntityWither.class, "WitherBoss", 64);
addMapping(EntityBat.class, "Bat", 65, 4996656, 986895);
addMapping(EntityWitch.class, "Witch", 66, 3407872, 5349438);
addMapping(EntityEndermite.class, "Endermite", 67, 1447446, 7237230);
addMapping(EntityGuardian.class, "Guardian", 68, 5931634, 15826224);
addMapping(EntityShulker.class, "Shulker", 69, 9725844, 5060690);
addMapping(EntityPig.class, "Pig", 90, 15771042, 14377823);
addMapping(EntitySheep.class, "Sheep", 91, 15198183, 16758197);
addMapping(EntityCow.class, "Cow", 92, 4470310, 10592673);
addMapping(EntityChicken.class, "Chicken", 93, 10592673, 16711680);
addMapping(EntitySquid.class, "Squid", 94, 2243405, 7375001);
addMapping(EntityWolf.class, "Wolf", 95, 14144467, 13545366);
addMapping(EntityMooshroom.class, "MushroomCow", 96, 10489616, 12040119);
addMapping(EntitySnowman.class, "SnowMan", 97);
addMapping(EntityOcelot.class, "Ozelot", 98, 15720061, 5653556);
addMapping(EntityIronGolem.class, "VillagerGolem", 99);
addMapping(EntityHorse.class, "EntityHorse", 100, 12623485, 15656192);
addMapping(EntityRabbit.class, "Rabbit", 101, 10051392, 7555121);
addMapping(EntityPolarBear.class, "PolarBear", 102, 15921906, 9803152);
addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002);
addMapping(EntityEnderCrystal.class, "EnderCrystal", 200);
}
public static class EntityEggInfo {
public final String spawnedID;
public final int primaryColor;
public final int secondaryColor;
public final StatBase killEntityStat;
public final StatBase entityKilledByStat;
public EntityEggInfo(String var1, int var2, int var3) {
this.spawnedID = var1;
this.primaryColor = var2;
this.secondaryColor = var3;
this.killEntityStat = StatList.getStatKillEntity(this);
this.entityKilledByStat = StatList.getStatEntityKilledBy(this);
}
}
}
| 14,032 | 0.720425 | 0.67118 | 328 | 41.780487 | 25.259398 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.335366 | false | false | 2 |
5a2309e05968c867da6725eb629ded0f541c600d | 31,499,290,211,682 | 24a8e0f7266a16ca23570d048fc5727a8ee3bb65 | /src/main/java/com/valework/yingul/model/Yng_Notification.java | 6a30f74a16cea31c056cf83cfb59fedeebf4e65b | [] | no_license | ComunidadYingul/Yingul | https://github.com/ComunidadYingul/Yingul | 6f5fbedf8278ba1e7868b5badbcbb6ff2b92d3b2 | c2309cee76143be8df257c25d295929e344b4740 | refs/heads/master | 2021-05-10T18:33:18.357000 | 2018-11-16T15:28:52 | 2018-11-16T15:28:52 | 118,127,498 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.valework.yingul.model;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@Entity
public class Yng_Notification {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long notificationId;
private String title;
private String description;
private String url;
private String date;
private String status;
private String desktopStatus;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user_id")
private Yng_User user;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "item_id")
private Yng_Item item;
public Yng_Notification() {
super();
}
public long getNotificationId() {
return notificationId;
}
public void setNotificationId(long notificationId) {
this.notificationId = notificationId;
}
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 getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Yng_User getUser() {
return user;
}
public void setUser(Yng_User user) {
this.user = user;
}
public Yng_Item getItem() {
return item;
}
public void setItem(Yng_Item item) {
this.item = item;
}
public String getDesktopStatus() {
return desktopStatus;
}
public void setDesktopStatus(String desktopStatus) {
this.desktopStatus = desktopStatus;
}
}
| UTF-8 | Java | 2,053 | java | Yng_Notification.java | Java | [] | null | [] | package com.valework.yingul.model;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@Entity
public class Yng_Notification {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long notificationId;
private String title;
private String description;
private String url;
private String date;
private String status;
private String desktopStatus;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user_id")
private Yng_User user;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "item_id")
private Yng_Item item;
public Yng_Notification() {
super();
}
public long getNotificationId() {
return notificationId;
}
public void setNotificationId(long notificationId) {
this.notificationId = notificationId;
}
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 getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Yng_User getUser() {
return user;
}
public void setUser(Yng_User user) {
this.user = user;
}
public Yng_Item getItem() {
return item;
}
public void setItem(Yng_Item item) {
this.item = item;
}
public String getDesktopStatus() {
return desktopStatus;
}
public void setDesktopStatus(String desktopStatus) {
this.desktopStatus = desktopStatus;
}
}
| 2,053 | 0.683877 | 0.683877 | 107 | 17.186916 | 15.737408 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.17757 | false | false | 2 |
44c8b5c8d89f031dc2c741b4f0f121d8d1d54a18 | 33,663,953,724,265 | 33c94088b75f66f497edceba676574ad15c00fcc | /FTT-UASH/src/ftt/uash/dao/OrcamentoDao.java | f18b709bb85604c610956b81611211d873f8c847 | [] | no_license | luizgustavo77/FTT-UASH | https://github.com/luizgustavo77/FTT-UASH | 50997c11153568e63e9e5b15bb4acf8f20e77070 | 521cb3f9be29683c06c5fd5f5046e644f5431132 | refs/heads/main | 2023-01-07T04:34:43.393000 | 2020-11-17T20:53:27 | 2020-11-17T20:53:27 | 310,128,423 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ftt.uash.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import ftt.uash.dao.interfaces.IDao;
import ftt.uash.model.OrcamentoModel;
public class OrcamentoDao implements IDao<OrcamentoModel> {
private Connection connection;
public OrcamentoDao() {
connection = DbUtil.getConnection();
}
@Override
public int insert(OrcamentoModel obj) {
try {
PreparedStatement preparedStatement = connection.prepareStatement(
"insert into FTT.Orcamento (PagamentoId, EquipamentoId, TrabalhoId, Lavagens, FormaPagamento, Pago, Comentario"
+ ") values (?,?,?,?,?,?,?)",
Statement.RETURN_GENERATED_KEYS);
preparedStatement.setInt(1, obj.getPagamentoId());
preparedStatement.setInt(2, obj.getEquipamentoId());
preparedStatement.setInt(3, obj.getTrabalhoId());
preparedStatement.setInt(4, obj.getLavagens());
preparedStatement.setInt(5, obj.getFormaPagamento());
preparedStatement.setBoolean(6, obj.isPago());
preparedStatement.setString(7, obj.getComentario());
preparedStatement.executeUpdate();
ResultSet resultSet = preparedStatement.getGeneratedKeys();
int lastInsertedId = 1;
if (resultSet.next()) {
lastInsertedId = resultSet.getInt(1);
}
return lastInsertedId;
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
@Override
public int update(OrcamentoModel obj) {
try {
PreparedStatement preparedStatement = connection.prepareStatement(
"update FTT.Orcamento set PagamentoId=?, EquipamentoId=?, TrabalhoId=?, Lavagens=?, FormaPagamento=?, Pago=?, Comentario=? where Id=?");
preparedStatement.setInt(1, obj.getPagamentoId());
preparedStatement.setInt(2, obj.getEquipamentoId());
preparedStatement.setInt(3, obj.getTrabalhoId());
preparedStatement.setInt(4, obj.getLavagens());
preparedStatement.setInt(5, obj.getFormaPagamento());
preparedStatement.setBoolean(6, obj.isPago());
preparedStatement.setString(7, obj.getComentario());
preparedStatement.setInt(8, obj.getId());
preparedStatement.executeUpdate();
return obj.getId();
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
@Override
public void delete(int id) {
try {
PreparedStatement preparedStatement = connection.prepareStatement("delete from FTT.Orcamento where Id=?");
preparedStatement.setInt(1, id);
preparedStatement.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public OrcamentoModel find(OrcamentoModel obj) {
OrcamentoModel orcamento = new OrcamentoModel();
try {
PreparedStatement preparedStatement = connection.prepareStatement("select * from FTT.Orcamento where Id=?");
preparedStatement.setLong(1, obj.getId());
ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
orcamento.setId(rs.getInt("Id"));
orcamento.setPagamentoId(rs.getInt("PagamentoId"));
orcamento.setEquipamentoId(rs.getInt("EquipamentoId"));
orcamento.setTrabalhoId(rs.getInt("TrabalhoId"));
orcamento.setLavagens(rs.getInt("Lavagens"));
orcamento.setFormaPagamento(rs.getInt("FormaPagamento"));
orcamento.setPago(rs.getBoolean("Pago"));
orcamento.setComentario(rs.getString("Comentario"));
}
} catch (SQLException e) {
e.printStackTrace();
}
return orcamento;
}
@Override
public ArrayList<OrcamentoModel> findAll() {
ArrayList<OrcamentoModel> orcamentos = new ArrayList<OrcamentoModel>();
try {
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("SELECT * FROM FTT.Orcamento");
while (rs.next()) {
OrcamentoModel orcamento = new OrcamentoModel();
orcamento.setId(rs.getInt("Id"));
orcamento.setPagamentoId(rs.getInt("PagamentoId"));
orcamento.setEquipamentoId(rs.getInt("EquipamentoId"));
orcamento.setTrabalhoId(rs.getInt("TrabalhoId"));
orcamento.setLavagens(rs.getInt("Lavagens"));
orcamento.setFormaPagamento(rs.getInt("FormaPagamento"));
orcamento.setPago(rs.getBoolean("Pago"));
orcamento.setComentario(rs.getString("Comentario"));
orcamentos.add(orcamento);
}
} catch (SQLException e) {
e.printStackTrace();
}
return orcamentos;
}
}
| UTF-8 | Java | 4,329 | java | OrcamentoDao.java | Java | [] | null | [] | package ftt.uash.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import ftt.uash.dao.interfaces.IDao;
import ftt.uash.model.OrcamentoModel;
public class OrcamentoDao implements IDao<OrcamentoModel> {
private Connection connection;
public OrcamentoDao() {
connection = DbUtil.getConnection();
}
@Override
public int insert(OrcamentoModel obj) {
try {
PreparedStatement preparedStatement = connection.prepareStatement(
"insert into FTT.Orcamento (PagamentoId, EquipamentoId, TrabalhoId, Lavagens, FormaPagamento, Pago, Comentario"
+ ") values (?,?,?,?,?,?,?)",
Statement.RETURN_GENERATED_KEYS);
preparedStatement.setInt(1, obj.getPagamentoId());
preparedStatement.setInt(2, obj.getEquipamentoId());
preparedStatement.setInt(3, obj.getTrabalhoId());
preparedStatement.setInt(4, obj.getLavagens());
preparedStatement.setInt(5, obj.getFormaPagamento());
preparedStatement.setBoolean(6, obj.isPago());
preparedStatement.setString(7, obj.getComentario());
preparedStatement.executeUpdate();
ResultSet resultSet = preparedStatement.getGeneratedKeys();
int lastInsertedId = 1;
if (resultSet.next()) {
lastInsertedId = resultSet.getInt(1);
}
return lastInsertedId;
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
@Override
public int update(OrcamentoModel obj) {
try {
PreparedStatement preparedStatement = connection.prepareStatement(
"update FTT.Orcamento set PagamentoId=?, EquipamentoId=?, TrabalhoId=?, Lavagens=?, FormaPagamento=?, Pago=?, Comentario=? where Id=?");
preparedStatement.setInt(1, obj.getPagamentoId());
preparedStatement.setInt(2, obj.getEquipamentoId());
preparedStatement.setInt(3, obj.getTrabalhoId());
preparedStatement.setInt(4, obj.getLavagens());
preparedStatement.setInt(5, obj.getFormaPagamento());
preparedStatement.setBoolean(6, obj.isPago());
preparedStatement.setString(7, obj.getComentario());
preparedStatement.setInt(8, obj.getId());
preparedStatement.executeUpdate();
return obj.getId();
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
@Override
public void delete(int id) {
try {
PreparedStatement preparedStatement = connection.prepareStatement("delete from FTT.Orcamento where Id=?");
preparedStatement.setInt(1, id);
preparedStatement.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public OrcamentoModel find(OrcamentoModel obj) {
OrcamentoModel orcamento = new OrcamentoModel();
try {
PreparedStatement preparedStatement = connection.prepareStatement("select * from FTT.Orcamento where Id=?");
preparedStatement.setLong(1, obj.getId());
ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
orcamento.setId(rs.getInt("Id"));
orcamento.setPagamentoId(rs.getInt("PagamentoId"));
orcamento.setEquipamentoId(rs.getInt("EquipamentoId"));
orcamento.setTrabalhoId(rs.getInt("TrabalhoId"));
orcamento.setLavagens(rs.getInt("Lavagens"));
orcamento.setFormaPagamento(rs.getInt("FormaPagamento"));
orcamento.setPago(rs.getBoolean("Pago"));
orcamento.setComentario(rs.getString("Comentario"));
}
} catch (SQLException e) {
e.printStackTrace();
}
return orcamento;
}
@Override
public ArrayList<OrcamentoModel> findAll() {
ArrayList<OrcamentoModel> orcamentos = new ArrayList<OrcamentoModel>();
try {
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("SELECT * FROM FTT.Orcamento");
while (rs.next()) {
OrcamentoModel orcamento = new OrcamentoModel();
orcamento.setId(rs.getInt("Id"));
orcamento.setPagamentoId(rs.getInt("PagamentoId"));
orcamento.setEquipamentoId(rs.getInt("EquipamentoId"));
orcamento.setTrabalhoId(rs.getInt("TrabalhoId"));
orcamento.setLavagens(rs.getInt("Lavagens"));
orcamento.setFormaPagamento(rs.getInt("FormaPagamento"));
orcamento.setPago(rs.getBoolean("Pago"));
orcamento.setComentario(rs.getString("Comentario"));
orcamentos.add(orcamento);
}
} catch (SQLException e) {
e.printStackTrace();
}
return orcamentos;
}
}
| 4,329 | 0.726034 | 0.721183 | 149 | 28.053692 | 26.823505 | 141 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.657718 | false | false | 2 |
2bb109f951cf27ccdf69c595bf94eafcf2cfba6a | 4,733,054,022,267 | 0a953fb9f951015fdfbd0b293a007ac37c1e56c6 | /Question3/src/main/java/za/ac/cput/Assigment4/LiskovSubstitution/Good/Speed.java | 1d879ed372bd21b25810096844da9ac53507df04 | [] | no_license | Sizwell/assignment4 | https://github.com/Sizwell/assignment4 | eda80de8f789edd4ab2df9671a8f07f8ab50e472 | ac04064e5c5575c99f59fe64c9b2f89cfc95a42f | refs/heads/master | 2020-04-29T04:56:39.761000 | 2019-03-15T17:35:22 | 2019-03-15T17:35:22 | 175,864,486 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package za.ac.cput.Assigment4.LiskovSubstitution.Good;
public class Speed {
public void increaseProcessor(Computer computer)
{
computer.processors += 1;
}
}
| UTF-8 | Java | 180 | java | Speed.java | Java | [] | null | [] | package za.ac.cput.Assigment4.LiskovSubstitution.Good;
public class Speed {
public void increaseProcessor(Computer computer)
{
computer.processors += 1;
}
}
| 180 | 0.694444 | 0.683333 | 10 | 17 | 20.663979 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 2 |
1d771873337c4bdd8eb6d1846431e7126a49a891 | 9,534,827,463,443 | 641fa8341d8c436ad24945bcbf8e7d7d1dd7dbb2 | /chrome/android/java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java | 57bcb15e4434b2d50beeca1f1a27d0ed87c8b648 | [
"BSD-3-Clause"
] | permissive | massnetwork/mass-browser | https://github.com/massnetwork/mass-browser | 7de0dfc541cbac00ffa7308541394bac1e945b76 | 67526da9358734698c067b7775be491423884339 | refs/heads/master | 2022-12-07T09:01:31.027000 | 2017-01-19T14:29:18 | 2017-01-19T14:29:18 | 73,799,690 | 4 | 4 | BSD-3-Clause | false | 2022-11-26T11:53:23 | 2016-11-15T09:49:29 | 2021-11-15T15:19:07 | 2017-01-19T14:30:44 | 832,385 | 4 | 2 | 1 | null | false | false | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.media.router;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.MediaRouteChooserDialogFragment;
import android.support.v7.media.MediaRouteSelector;
import org.chromium.chrome.browser.media.router.cast.MediaSink;
import org.chromium.chrome.browser.media.router.cast.MediaSource;
/**
* Manages the dialog responsible for selecting a {@link MediaSink}.
*/
public class MediaRouteChooserDialogManager extends BaseMediaRouteDialogManager {
private static final String DIALOG_FRAGMENT_TAG =
"android.support.v7.mediarouter:MediaRouteChooserDialogFragment";
public MediaRouteChooserDialogManager(MediaSource source, Context applicationContext,
MediaRouteDialogDelegate delegate) {
super(source, applicationContext, delegate);
}
/**
* Fragment implementation for MediaRouteChooserDialogManager.
*/
public static class Fragment extends MediaRouteChooserDialogFragment {
private final Handler mHandler = new Handler();
private final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver();
private BaseMediaRouteDialogManager mManager = null;
private boolean mCancelled;
public Fragment() {
mHandler.post(new Runnable() {
@Override
public void run() {
Fragment.this.dismiss();
}
});
}
public Fragment(BaseMediaRouteDialogManager manager) {
mManager = manager;
}
@Override
public void onStart() {
mVisibilitySaver.saveSystemVisibility(getActivity());
super.onStart();
}
@Override
public void onStop() {
super.onStop();
mVisibilitySaver.restoreSystemVisibility(getActivity());
}
@Override
public void onCancel(DialogInterface dialog) {
mCancelled = true;
mManager.delegate().onDialogCancelled();
super.onCancel(dialog);
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (mManager == null) return;
mManager.mDialogFragment = null;
if (mCancelled) return;
MediaSink newSink =
MediaSink.fromRoute(mManager.androidMediaRouter().getSelectedRoute());
mManager.delegate().onSinkSelected(newSink);
}
}
@Override
protected DialogFragment openDialogInternal(FragmentManager fm) {
if (fm.findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) return null;
Fragment fragment = new Fragment(this);
MediaRouteSelector selector = mediaSource().buildRouteSelector();
if (selector == null) return null;
fragment.setRouteSelector(selector);
fragment.show(fm, DIALOG_FRAGMENT_TAG);
fm.executePendingTransactions();
return fragment;
}
}
| UTF-8 | Java | 3,329 | java | MediaRouteChooserDialogManager.java | Java | [] | null | [] | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.media.router;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.MediaRouteChooserDialogFragment;
import android.support.v7.media.MediaRouteSelector;
import org.chromium.chrome.browser.media.router.cast.MediaSink;
import org.chromium.chrome.browser.media.router.cast.MediaSource;
/**
* Manages the dialog responsible for selecting a {@link MediaSink}.
*/
public class MediaRouteChooserDialogManager extends BaseMediaRouteDialogManager {
private static final String DIALOG_FRAGMENT_TAG =
"android.support.v7.mediarouter:MediaRouteChooserDialogFragment";
public MediaRouteChooserDialogManager(MediaSource source, Context applicationContext,
MediaRouteDialogDelegate delegate) {
super(source, applicationContext, delegate);
}
/**
* Fragment implementation for MediaRouteChooserDialogManager.
*/
public static class Fragment extends MediaRouteChooserDialogFragment {
private final Handler mHandler = new Handler();
private final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver();
private BaseMediaRouteDialogManager mManager = null;
private boolean mCancelled;
public Fragment() {
mHandler.post(new Runnable() {
@Override
public void run() {
Fragment.this.dismiss();
}
});
}
public Fragment(BaseMediaRouteDialogManager manager) {
mManager = manager;
}
@Override
public void onStart() {
mVisibilitySaver.saveSystemVisibility(getActivity());
super.onStart();
}
@Override
public void onStop() {
super.onStop();
mVisibilitySaver.restoreSystemVisibility(getActivity());
}
@Override
public void onCancel(DialogInterface dialog) {
mCancelled = true;
mManager.delegate().onDialogCancelled();
super.onCancel(dialog);
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (mManager == null) return;
mManager.mDialogFragment = null;
if (mCancelled) return;
MediaSink newSink =
MediaSink.fromRoute(mManager.androidMediaRouter().getSelectedRoute());
mManager.delegate().onSinkSelected(newSink);
}
}
@Override
protected DialogFragment openDialogInternal(FragmentManager fm) {
if (fm.findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) return null;
Fragment fragment = new Fragment(this);
MediaRouteSelector selector = mediaSource().buildRouteSelector();
if (selector == null) return null;
fragment.setRouteSelector(selector);
fragment.show(fm, DIALOG_FRAGMENT_TAG);
fm.executePendingTransactions();
return fragment;
}
}
| 3,329 | 0.665065 | 0.662361 | 103 | 31.320389 | 26.589731 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.436893 | false | false | 2 |
16699058f378fd7fb9e2059e5b803feb70ca8b47 | 9,534,827,463,318 | 19b3253fd4fa697bec57c8f01704c9f56cfaa0fa | /src/Client/Interface/InputReservation.java | ec34c278c217329ad954c9ea10c491bb07c005b3 | [] | no_license | Kaixi26/SD_Trabalho_2019 | https://github.com/Kaixi26/SD_Trabalho_2019 | c467a0b4e93761a5cd269ee9b0ce344f2186c0cd | fd98be8d5b660a56da338af953a9e33c6450f9bd | refs/heads/master | 2022-03-23T15:45:58.859000 | 2020-01-02T17:06:15 | 2020-01-02T17:06:15 | 229,623,870 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Client.Interface;
import java.util.Scanner;
public class InputReservation {
TerminalHandler parent;
Scanner scan = new Scanner(System.in);
InputReservation(TerminalHandler parent){
this.parent = parent;
}
public String readLine(){
String tmp = scan.nextLine();
parent.resetInput();
return tmp;
}
public void free(){
parent.freeInput();
parent = null;
scan = null;
}
}
| UTF-8 | Java | 470 | java | InputReservation.java | Java | [] | null | [] | package Client.Interface;
import java.util.Scanner;
public class InputReservation {
TerminalHandler parent;
Scanner scan = new Scanner(System.in);
InputReservation(TerminalHandler parent){
this.parent = parent;
}
public String readLine(){
String tmp = scan.nextLine();
parent.resetInput();
return tmp;
}
public void free(){
parent.freeInput();
parent = null;
scan = null;
}
}
| 470 | 0.608511 | 0.608511 | 25 | 17.799999 | 14.452682 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.44 | false | false | 2 |
354f074d191fc143b00234e6f73387a9bf4bc5d1 | 25,469,156,104,090 | 82cee60bdb1e2d0fd83b8e488d0ee2feebe542d9 | /src/test/java/com/nevexis/RepositoryTests.java | 7c35ed5b33c0a078935381b251cb7b779547ff38 | [] | no_license | evgdim/SpringGuide | https://github.com/evgdim/SpringGuide | 1fdeac41172683d43dde9aef314ca8e976295661 | 12efb86f89ded29f274ebb5b50fac62478aa074f | refs/heads/master | 2018-11-11T05:57:20.634000 | 2016-08-05T08:23:11 | 2016-08-05T08:23:11 | 62,489,767 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.nevexis;
import com.nevexis.model.Person;
import com.nevexis.repository.PersonRepository;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.AssertTrue;
import java.util.List;
import java.util.Optional;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SpringGuideApplication.class)
@Transactional
public class RepositoryTests {
@Autowired
private PersonRepository personRepository;
@Test
public void personRepoTests() {
long id = personRepository.add(new Person(null, "dimitrov", "evgeni", "addr", "Sofia"));
Assert.assertTrue(id != 0);
List<Person> all = (List<Person>) personRepository.findAll();
long count = all.stream().filter(p -> p.getFirstName().equals("evgeni")).count();
System.out.print(count);
Assert.assertTrue(count > 0);
Optional<Person> byId = personRepository.findById(id);
Assert.assertTrue(byId.isPresent());
}
}
| UTF-8 | Java | 1,294 | java | RepositoryTests.java | Java | [
{
"context": " long id = personRepository.add(new Person(null, \"dimitrov\", \"evgeni\", \"addr\", \"Sofia\"));\n Assert.ass",
"end": 878,
"score": 0.9997679591178894,
"start": 870,
"tag": "NAME",
"value": "dimitrov"
},
{
"context": "ersonRepository.add(new Person(null, \"dimitrov\", \"evgeni\", \"addr\", \"Sofia\"));\n Assert.assertTrue(id",
"end": 888,
"score": 0.9997846484184265,
"start": 882,
"tag": "NAME",
"value": "evgeni"
},
{
"context": "all.stream().filter(p -> p.getFirstName().equals(\"evgeni\")).count();\n System.out.print(count);\n ",
"end": 1093,
"score": 0.9997612833976746,
"start": 1087,
"tag": "NAME",
"value": "evgeni"
}
] | null | [] | package com.nevexis;
import com.nevexis.model.Person;
import com.nevexis.repository.PersonRepository;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.AssertTrue;
import java.util.List;
import java.util.Optional;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SpringGuideApplication.class)
@Transactional
public class RepositoryTests {
@Autowired
private PersonRepository personRepository;
@Test
public void personRepoTests() {
long id = personRepository.add(new Person(null, "dimitrov", "evgeni", "addr", "Sofia"));
Assert.assertTrue(id != 0);
List<Person> all = (List<Person>) personRepository.findAll();
long count = all.stream().filter(p -> p.getFirstName().equals("evgeni")).count();
System.out.print(count);
Assert.assertTrue(count > 0);
Optional<Person> byId = personRepository.findById(id);
Assert.assertTrue(byId.isPresent());
}
}
| 1,294 | 0.758887 | 0.755023 | 35 | 35.971428 | 26.05213 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false | 2 |
ce4e6f673e3eeaa0c9e52076f445ea292de760ef | 15,401,752,770,408 | c30582870d2a734f8ab3d60a48953328a79e0294 | /njy/src/main/java/com/greentech/nj/njy/activity/SDDetailActivity.java | 29ae736ae5a5b82c6d902b85b3a0c621b5fa7a6e | [] | no_license | w4288821/njy | https://github.com/w4288821/njy | 5bdad6ab7be2eddd73d3679c620378eece5aad34 | c5e5ccf46659adbf22361b23db5410cc23d42acd | refs/heads/master | 2017-05-16T23:02:46.272000 | 2017-03-09T01:25:13 | 2017-03-09T01:25:13 | 83,258,521 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.greentech.nj.njy.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.greentech.nj.njy.Constant;
import com.greentech.nj.njy.R;
import com.greentech.nj.njy.model.SupplyDemand;
import com.greentech.nj.njy.util.GsonUtil;
import com.greentech.nj.njy.util.OkHttpUtil;
import java.io.IOException;
import java.text.SimpleDateFormat;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Request;
import okhttp3.Response;
public class SDDetailActivity extends BaseActivity {
private TextView name;
private TextView sdType;
private TextView category;
private TextView province;
private TextView content;
private TextView releaseTime;
private TextView validTime;
private TextView contacter;
private TextView telphone;
private TextView mobile;
private TextView qqMsn;
private TextView address;
private ImageButton back;
private SupplyDemand sd;
private SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
private int sdId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sddetail);
sdId = getIntent().getIntExtra("sdId", 1);
init();
loadData();
}
private void init() {
name = (TextView) this.findViewById(R.id.sd_detail_name);
sdType = (TextView) this.findViewById(R.id.sd_detail_sdType);
category = (TextView) this.findViewById(R.id.sd_detail_category);
province = (TextView) this.findViewById(R.id.sd_detail_province);
content = (TextView) this.findViewById(R.id.sd_detail_content);
releaseTime = (TextView) this.findViewById(R.id.sd_detail_releaseTime);
validTime = (TextView) this.findViewById(R.id.sd_detail_validTime);
contacter = (TextView) this.findViewById(R.id.sd_detail_contacter);
telphone = (TextView) this.findViewById(R.id.sd_detail_telephone);
mobile = (TextView) this.findViewById(R.id.sd_detail_mobile);
qqMsn = (TextView) this.findViewById(R.id.sd_detail_qqMsn);
address = (TextView) this.findViewById(R.id.sd_detail_address);
back = (ImageButton) this.findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SDDetailActivity.this.finish();
}
});
}
public void loadData() {
Request request = new Request.Builder().url(Constant.URL_GQ_CHECK_DETAIL).post(new FormBody.Builder()
.add("id", sdId + "").build()).build();
OkHttpUtil.enqueue(request, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (response.isSuccessful()) {
String str = response.body().string();
JsonObject jsonObject = (JsonObject) GsonUtil.parse(str);
sd = GsonUtil.fromJson(jsonObject, new TypeToken<SupplyDemand>() {
}.getType());
runOnUiThread(new Runnable() {
@Override
public void run() {
name.setText(sd.getName());
sdType.setText(sd.getType());
category.setText(sd.getCategory());
province.setText(sd.getProvince());
content.setText(sd.getContent());
if (sd.getReleaseTime() != null) {
releaseTime.setText(sf.format(sd
.getReleaseTime()));
}
if (sd.getValidTime() != null) {
validTime.setText(sf.format(sd
.getValidTime()));
}
contacter.setText(sd.getContacter());
telphone.setText(sd.getTelephone());
mobile.setText(sd.getMobile());
qqMsn.setText(sd.getQqMsn());
address.setText(sd.getAddress());
}
});
}
}
});
}
}
| UTF-8 | Java | 4,713 | java | SDDetailActivity.java | Java | [] | null | [] | package com.greentech.nj.njy.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.greentech.nj.njy.Constant;
import com.greentech.nj.njy.R;
import com.greentech.nj.njy.model.SupplyDemand;
import com.greentech.nj.njy.util.GsonUtil;
import com.greentech.nj.njy.util.OkHttpUtil;
import java.io.IOException;
import java.text.SimpleDateFormat;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Request;
import okhttp3.Response;
public class SDDetailActivity extends BaseActivity {
private TextView name;
private TextView sdType;
private TextView category;
private TextView province;
private TextView content;
private TextView releaseTime;
private TextView validTime;
private TextView contacter;
private TextView telphone;
private TextView mobile;
private TextView qqMsn;
private TextView address;
private ImageButton back;
private SupplyDemand sd;
private SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
private int sdId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sddetail);
sdId = getIntent().getIntExtra("sdId", 1);
init();
loadData();
}
private void init() {
name = (TextView) this.findViewById(R.id.sd_detail_name);
sdType = (TextView) this.findViewById(R.id.sd_detail_sdType);
category = (TextView) this.findViewById(R.id.sd_detail_category);
province = (TextView) this.findViewById(R.id.sd_detail_province);
content = (TextView) this.findViewById(R.id.sd_detail_content);
releaseTime = (TextView) this.findViewById(R.id.sd_detail_releaseTime);
validTime = (TextView) this.findViewById(R.id.sd_detail_validTime);
contacter = (TextView) this.findViewById(R.id.sd_detail_contacter);
telphone = (TextView) this.findViewById(R.id.sd_detail_telephone);
mobile = (TextView) this.findViewById(R.id.sd_detail_mobile);
qqMsn = (TextView) this.findViewById(R.id.sd_detail_qqMsn);
address = (TextView) this.findViewById(R.id.sd_detail_address);
back = (ImageButton) this.findViewById(R.id.back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SDDetailActivity.this.finish();
}
});
}
public void loadData() {
Request request = new Request.Builder().url(Constant.URL_GQ_CHECK_DETAIL).post(new FormBody.Builder()
.add("id", sdId + "").build()).build();
OkHttpUtil.enqueue(request, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (response.isSuccessful()) {
String str = response.body().string();
JsonObject jsonObject = (JsonObject) GsonUtil.parse(str);
sd = GsonUtil.fromJson(jsonObject, new TypeToken<SupplyDemand>() {
}.getType());
runOnUiThread(new Runnable() {
@Override
public void run() {
name.setText(sd.getName());
sdType.setText(sd.getType());
category.setText(sd.getCategory());
province.setText(sd.getProvince());
content.setText(sd.getContent());
if (sd.getReleaseTime() != null) {
releaseTime.setText(sf.format(sd
.getReleaseTime()));
}
if (sd.getValidTime() != null) {
validTime.setText(sf.format(sd
.getValidTime()));
}
contacter.setText(sd.getContacter());
telphone.setText(sd.getTelephone());
mobile.setText(sd.getMobile());
qqMsn.setText(sd.getQqMsn());
address.setText(sd.getAddress());
}
});
}
}
});
}
}
| 4,713 | 0.580522 | 0.579037 | 121 | 37.950413 | 24.319109 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.661157 | false | false | 2 |
f4f04b3ca38512c0b8d154583fbf47dad3015fbd | 20,856,361,200,110 | a0e5bc9d3da04aa3e4e0918bf45d8ca791ed6b8d | /storage/apk/com.axis.mobile.chapters.trans/com/google/android/gms/internal/fe$a$a.java | 620e8d39c756b2aa59b090cf69d609fc1e4b1530 | [
"MIT"
] | permissive | Yu-Jack/app_detect | https://github.com/Yu-Jack/app_detect | c8dc0096b475739ff3a78ed6390af5bbbdb5a032 | 87f4b329318c33c388dd528ed8ea4cee5c405167 | refs/heads/master | 2020-04-07T15:37:38.582000 | 2015-06-12T15:19:34 | 2015-06-12T15:19:34 | 37,320,571 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | //
// Decompiled by Procyon v0.5.29
//
package com.google.android.gms.internal;
import android.os.Parcel;
import java.util.List;
import java.util.Map;
import android.os.IBinder;
class fe$a$a implements fe
{
private IBinder kq;
fe$a$a(final IBinder kq) {
this.kq = kq;
}
@Override
public void a(final Map map, final long n, final String s, final List list) {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
obtain.writeMap(map);
obtain.writeLong(n);
obtain.writeString(s);
obtain.writeTypedList(list);
this.kq.transact(1, obtain, obtain2, 0);
obtain2.readException();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
public IBinder asBinder() {
return this.kq;
}
@Override
public void cl() {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.kq.transact(2, obtain, obtain2, 0);
obtain2.readException();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
@Override
public String getVersion() {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.kq.transact(3, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readString();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
}
| UTF-8 | Java | 1,969 | java | fe$a$a.java | Java | [] | null | [] | //
// Decompiled by Procyon v0.5.29
//
package com.google.android.gms.internal;
import android.os.Parcel;
import java.util.List;
import java.util.Map;
import android.os.IBinder;
class fe$a$a implements fe
{
private IBinder kq;
fe$a$a(final IBinder kq) {
this.kq = kq;
}
@Override
public void a(final Map map, final long n, final String s, final List list) {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
obtain.writeMap(map);
obtain.writeLong(n);
obtain.writeString(s);
obtain.writeTypedList(list);
this.kq.transact(1, obtain, obtain2, 0);
obtain2.readException();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
public IBinder asBinder() {
return this.kq;
}
@Override
public void cl() {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.kq.transact(2, obtain, obtain2, 0);
obtain2.readException();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
@Override
public String getVersion() {
final Parcel obtain = Parcel.obtain();
final Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.kq.transact(3, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readString();
}
finally {
obtain2.recycle();
obtain.recycle();
}
}
}
| 1,969 | 0.565769 | 0.554088 | 73 | 25.972603 | 22.870075 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.630137 | false | false | 2 |
cb94ed899d34d90141432b7e5ba0cc4e1f126f50 | 29,858,612,683,946 | fe92e331fdf967470c36b2c7e4e3804bee0d48d9 | /toolsrc/org/ujac/ui/editor/action/BackspaceKeyAction.java | 781a3e813d140f819a809fdb3fbd2ba3088a7af9 | [] | no_license | rrmckinley/rhino-canvas | https://github.com/rrmckinley/rhino-canvas | 4d56e3e951b896c57fc6e7c44c20786386a74fe6 | 65adb04c835f06d4cc4a7c426d524733d9cde3b4 | refs/heads/master | 2016-09-11T11:45:21.062000 | 2007-02-06T21:19:43 | 2007-02-06T21:19:43 | 1,787,270 | 3 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Copyright (C) 2003 by Christian Lauer.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* If you didn't download this code from the following link, you should check if
* you aren't using an obsolete version:
* http://sourceforge.net/projects/ujac
*/
package org.ujac.ui.editor.action;
import java.awt.event.ActionEvent;
import javax.swing.text.BadLocationException;
import org.ujac.ui.editor.TextArea;
import org.ujac.ui.editor.TextUtilities;
/**
* Name: BackspaceKeyAction<br>
* Description: A class handling the backspace key action (CTRL+C).
* <br>Log: $Log: BackspaceKeyAction.java,v $
* <br>Log: Revision 1.1 2006/11/05 01:22:38 haustein
* <br>Log: 0.20
* <br>Log:
* <br>Log: Revision 1.2 2004/07/02 23:41:01 lauerc
* <br>Log: Applied performance improvements.
* <br>Log:
* <br>Log: Revision 1.1 2004/01/20 20:29:56 lauerc
* <br>Log: Moved user interface components to sub project UJAC-UI.
* <br>Log:
* @author $Author: haustein $
* @version $Revision: 1.1 $
*/
public class BackspaceKeyAction extends KeyAction {
/**
* Constructs a BackspaceKeyAction instance with specific arguments.
* @param textArea The text area.
*/
public BackspaceKeyAction(TextArea textArea) {
super(textArea);
}
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
if (isCtrlPressed(e)) {
int start = textArea.getSelectionStart();
if (start != textArea.getSelectionEnd()) {
textArea.insertText("");
}
int line = textArea.getCaretLine();
int lineStart = textArea.getLineStartOffset(line);
int caret = start - lineStart;
String lineText = textArea.getLineText(textArea.getCaretLine());
if (caret == 0) {
if (lineStart == 0) {
textArea.getToolkit().beep();
return;
}
caret--;
} else {
String noWordSep = (String) textArea.getDocument().getProperty("noWordSep");
caret = TextUtilities.findWordStart(lineText, caret, noWordSep);
}
try {
textArea.getDocument().remove(caret + lineStart, start - (caret + lineStart), true);
} catch (BadLocationException bl) {
bl.printStackTrace();
}
} else {
if (!textArea.isEditable()) {
textArea.getToolkit().beep();
return;
}
if (textArea.getSelectionStart() != textArea.getSelectionEnd()) {
textArea.insertText("");
} else {
int caret = textArea.getCaretPosition();
if (caret == 0) {
textArea.getToolkit().beep();
return;
}
try {
textArea.getDocument().remove(caret - 1, 1, true);
} catch (BadLocationException bl) {
bl.printStackTrace();
}
}
}
}
}
| UTF-8 | Java | 3,520 | java | BackspaceKeyAction.java | Java | [
{
"context": "/*\n * Copyright (C) 2003 by Christian Lauer.\n *\n * This library is free software; you can red",
"end": 43,
"score": 0.9997896552085876,
"start": 28,
"tag": "NAME",
"value": "Christian Lauer"
},
{
"context": "b project UJAC-UI.\n * <br>Log:\n * @author $Author: haustein $\n * @version $Revision: 1.1 $\n */\npublic class B",
"end": 1652,
"score": 0.9976610541343689,
"start": 1644,
"tag": "USERNAME",
"value": "haustein"
}
] | null | [] | /*
* Copyright (C) 2003 by <NAME>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* If you didn't download this code from the following link, you should check if
* you aren't using an obsolete version:
* http://sourceforge.net/projects/ujac
*/
package org.ujac.ui.editor.action;
import java.awt.event.ActionEvent;
import javax.swing.text.BadLocationException;
import org.ujac.ui.editor.TextArea;
import org.ujac.ui.editor.TextUtilities;
/**
* Name: BackspaceKeyAction<br>
* Description: A class handling the backspace key action (CTRL+C).
* <br>Log: $Log: BackspaceKeyAction.java,v $
* <br>Log: Revision 1.1 2006/11/05 01:22:38 haustein
* <br>Log: 0.20
* <br>Log:
* <br>Log: Revision 1.2 2004/07/02 23:41:01 lauerc
* <br>Log: Applied performance improvements.
* <br>Log:
* <br>Log: Revision 1.1 2004/01/20 20:29:56 lauerc
* <br>Log: Moved user interface components to sub project UJAC-UI.
* <br>Log:
* @author $Author: haustein $
* @version $Revision: 1.1 $
*/
public class BackspaceKeyAction extends KeyAction {
/**
* Constructs a BackspaceKeyAction instance with specific arguments.
* @param textArea The text area.
*/
public BackspaceKeyAction(TextArea textArea) {
super(textArea);
}
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
if (isCtrlPressed(e)) {
int start = textArea.getSelectionStart();
if (start != textArea.getSelectionEnd()) {
textArea.insertText("");
}
int line = textArea.getCaretLine();
int lineStart = textArea.getLineStartOffset(line);
int caret = start - lineStart;
String lineText = textArea.getLineText(textArea.getCaretLine());
if (caret == 0) {
if (lineStart == 0) {
textArea.getToolkit().beep();
return;
}
caret--;
} else {
String noWordSep = (String) textArea.getDocument().getProperty("noWordSep");
caret = TextUtilities.findWordStart(lineText, caret, noWordSep);
}
try {
textArea.getDocument().remove(caret + lineStart, start - (caret + lineStart), true);
} catch (BadLocationException bl) {
bl.printStackTrace();
}
} else {
if (!textArea.isEditable()) {
textArea.getToolkit().beep();
return;
}
if (textArea.getSelectionStart() != textArea.getSelectionEnd()) {
textArea.insertText("");
} else {
int caret = textArea.getCaretPosition();
if (caret == 0) {
textArea.getToolkit().beep();
return;
}
try {
textArea.getDocument().remove(caret - 1, 1, true);
} catch (BadLocationException bl) {
bl.printStackTrace();
}
}
}
}
}
| 3,511 | 0.653693 | 0.631818 | 113 | 30.150442 | 25.386297 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.415929 | false | false | 2 |
1a7c24af1195537dd7125a52fd9a79ada043d400 | 12,953,621,398,048 | 9e97a1c660b9097d185f4fbf31ee1877a8bd6ba7 | /src/AccessModifiers/world/Plant.java | 4bafcdab01d0137919d0f2aa72401e34e9e4e215 | [] | no_license | IshanArya/John-Purcell-Java-Tutorial | https://github.com/IshanArya/John-Purcell-Java-Tutorial | 7af4928548dc084f4ca8c10dec7dadfab4348fee | 2d93ad87287d24b6caeec0c2dd8ad37c1e93adc8 | refs/heads/master | 2021-01-19T06:45:38.578000 | 2016-08-13T22:55:12 | 2016-08-13T22:55:12 | 65,640,253 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package AccessModifiers.world;
/**
* Created by ishan on 2/9/2016.
*/
public class Plant {
public String name;
public final static int ID = 8;
private String type;
protected String size;
int height;
public Plant(){
name = "I'm a plant.";
type = "plant";
System.out.println(ID);
this.height = 8;
this.size = "medium";
Tree tree = new Tree();
}
}
| UTF-8 | Java | 425 | java | Plant.java | Java | [
{
"context": "package AccessModifiers.world;\n\n/**\n * Created by ishan on 2/9/2016.\n */\npublic class Plant {\n public ",
"end": 55,
"score": 0.9990999102592468,
"start": 50,
"tag": "USERNAME",
"value": "ishan"
}
] | null | [] | package AccessModifiers.world;
/**
* Created by ishan on 2/9/2016.
*/
public class Plant {
public String name;
public final static int ID = 8;
private String type;
protected String size;
int height;
public Plant(){
name = "I'm a plant.";
type = "plant";
System.out.println(ID);
this.height = 8;
this.size = "medium";
Tree tree = new Tree();
}
}
| 425 | 0.562353 | 0.543529 | 21 | 19.238094 | 11.86393 | 35 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false | 2 |
67cb2ba966e0d37b69bb1c53392760367c661621 | 27,513,560,504,201 | cb5bfe03ce8782e286e87f1cb154f69e3b7706cd | /Java_Spring/spring_ioc_02/src/main/java/com/xiaohui/config/SpringConfig.java | 9f6aeab016094fc0b32fcc00c9e0cd2686b18ecb | [] | no_license | XiaoHui1998/Java_Review | https://github.com/XiaoHui1998/Java_Review | be71e3b57eeef76e2ee13a43048d52ef56b35ec2 | 6446215ac8ac288a6d6e1b2eb483600e27e215b6 | refs/heads/master | 2023-04-24T16:30:46.460000 | 2021-05-20T06:53:37 | 2021-05-20T06:53:37 | 352,696,140 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.xiaohui.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
/**
* @ClassName SpringConfig
* @Author 何辉
* @Date 2021/5/12 17:27
**/
@ComponentScan(basePackages = "com.xiaohui")
@PropertySource("classpath:aaa.properties")
public class SpringConfig {
}
| UTF-8 | Java | 365 | java | SpringConfig.java | Java | [
{
"context": "e;\r\n\r\n/**\r\n * @ClassName SpringConfig\r\n * @Author 何辉\r\n * @Date 2021/5/12 17:27\r\n **/\r\n@ComponentScan(b",
"end": 204,
"score": 0.999117374420166,
"start": 202,
"tag": "NAME",
"value": "何辉"
}
] | null | [] | package com.xiaohui.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
/**
* @ClassName SpringConfig
* @Author 何辉
* @Date 2021/5/12 17:27
**/
@ComponentScan(basePackages = "com.xiaohui")
@PropertySource("classpath:aaa.properties")
public class SpringConfig {
}
| 365 | 0.747922 | 0.717452 | 14 | 23.785715 | 20.857265 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.214286 | false | false | 2 |
84713ce45672848dbf88b04add8b51a32b0ec6b0 | 20,435,454,462,709 | cac30ca91cb83e5b886f2c10e273d3b8d2bb75c0 | /app/src/main/java/com/davidjeastman/mathmemory/ImageMap.java | eb85a9011c802b662d31cb72e3ac9172a4ed79dd | [] | no_license | djeastm/math_memory | https://github.com/djeastm/math_memory | b7f1933a85b119ad3de7e897915299f899bd090a | 70e6c9dbb19b5667c194983cecaad0a37c14d90f | refs/heads/master | 2020-04-05T14:34:33.521000 | 2017-08-29T01:03:49 | 2017-08-29T01:03:49 | 94,692,735 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.davidjeastman.mathmemory;
/**
* Created by David Eastman on 8/28/2017.
*/
public class ImageMap {
private int key;
private String path;
public ImageMap(int k, String p) {
key = k;
path = p;
}
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
| UTF-8 | Java | 491 | java | ImageMap.java | Java | [
{
"context": "e com.davidjeastman.mathmemory;\n\n/**\n * Created by David Eastman on 8/28/2017.\n */\n\npublic class ImageMap {\n pr",
"end": 70,
"score": 0.9997866749763489,
"start": 57,
"tag": "NAME",
"value": "David Eastman"
}
] | null | [] | package com.davidjeastman.mathmemory;
/**
* Created by <NAME> on 8/28/2017.
*/
public class ImageMap {
private int key;
private String path;
public ImageMap(int k, String p) {
key = k;
path = p;
}
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
| 484 | 0.549898 | 0.535642 | 31 | 14.83871 | 13.650231 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.322581 | false | false | 2 |
04459e69e241a875c8a4f3ea3ff9f295fdd42bda | 10,256,381,927,890 | 4bd3e24dcd0ff433599138e9d14c50c78cb10e1e | /workspace/src/com/godstorm/flappy/graphics/Texture.java | d929fc1270f59bef93f973aafc058a78b94d282d | [] | no_license | Gilgod/FlappyBird | https://github.com/Gilgod/FlappyBird | 59bab8084d4f2524bd8af7e9268ef09960a45b5b | 26d1f1b643793f103736106d69f8487b46987308 | refs/heads/master | 2016-08-03T01:22:56.999000 | 2014-10-25T11:52:46 | 2014-10-25T11:52:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.godstorm.flappy.graphics;
import static org.lwjgl.opengl.GL11.*;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.lwjgl.BufferUtils;
public class Texture {
//load texture from file
private int width, height;
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
private int id;
public Texture( String path ) {
id = load(path);
}
/*
* A R G B
* C8 E0 60 1B
*
* Moving the order of channels to
* R G B A
* E0 60 1B C8
*/
private int load(String path) {
int []pixels = null;
try {
BufferedImage image = ImageIO.read(new FileInputStream(path));
width = image.getWidth();
height = image.getHeight();
pixels = new int[width * height];
image.getRGB(0, 0,width,height,pixels,0,width);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int []data = new int[width * height];
for(int i = 0; i < width * height; i++) {
int a = (pixels[i] & 0xff000000) >> 24;
int r = (pixels[i] & 0xff0000) >> 16;
int g = (pixels[i] & 0xff00) >> 8;
int b = (pixels[i] & 0xff);
data[i] = a<<24 | b<<16 | g<<8 | r;
}
int tex = glGenTextures();
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, BufferUtils.createIntBuffer(data));
glBindTexture(GL_TEXTURE_2D, 0); //deselecting
return tex;
}
}
| UTF-8 | Java | 1,917 | java | Texture.java | Java | [] | null | [] | package com.godstorm.flappy.graphics;
import static org.lwjgl.opengl.GL11.*;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.lwjgl.BufferUtils;
public class Texture {
//load texture from file
private int width, height;
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
private int id;
public Texture( String path ) {
id = load(path);
}
/*
* A R G B
* C8 E0 60 1B
*
* Moving the order of channels to
* R G B A
* E0 60 1B C8
*/
private int load(String path) {
int []pixels = null;
try {
BufferedImage image = ImageIO.read(new FileInputStream(path));
width = image.getWidth();
height = image.getHeight();
pixels = new int[width * height];
image.getRGB(0, 0,width,height,pixels,0,width);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int []data = new int[width * height];
for(int i = 0; i < width * height; i++) {
int a = (pixels[i] & 0xff000000) >> 24;
int r = (pixels[i] & 0xff0000) >> 16;
int g = (pixels[i] & 0xff00) >> 8;
int b = (pixels[i] & 0xff);
data[i] = a<<24 | b<<16 | g<<8 | r;
}
int tex = glGenTextures();
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, BufferUtils.createIntBuffer(data));
glBindTexture(GL_TEXTURE_2D, 0); //deselecting
return tex;
}
}
| 1,917 | 0.648931 | 0.622327 | 90 | 20.299999 | 20.327021 | 122 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.044445 | false | false | 2 |
be4c0e8cfe5d6dd040d1e2316d678fa955dbe656 | 11,123,965,348,533 | 6726e690ce16bd7f9611fd7e2dad9e289e6a8961 | /PERT/src/Entidades/Estados/ResultadoDeCargaDeTablaZeta.java | 52b8b0eec75bd464d99f3cab5a586000ff06d4c7 | [] | no_license | ErlinFlores/modulo-pert-sio | https://github.com/ErlinFlores/modulo-pert-sio | a22534e6e1b5655fedf2b6af62eb351a183c93d2 | f8f84f3752192460bc96f2815df38d145e39f5e4 | refs/heads/master | 2016-08-12T23:40:13.433000 | 2011-11-21T11:53:48 | 2011-11-21T11:53:48 | 36,211,337 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Entidades.Estados;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Manuel Lorenze
*/
public enum ResultadoDeCargaDeTablaZeta {
cargaExitosa,
archivoNoEncontrado,
datosInconsistentes
}
| UTF-8 | Java | 277 | java | ResultadoDeCargaDeTablaZeta.java | Java | [
{
"context": "the template in the editor.\n */\n\n/**\n *\n * @author Manuel Lorenze\n */\npublic enum ResultadoDeCargaDeTablaZeta {\n ",
"end": 161,
"score": 0.9998579025268555,
"start": 147,
"tag": "NAME",
"value": "Manuel Lorenze"
}
] | null | [] | package Entidades.Estados;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author <NAME>
*/
public enum ResultadoDeCargaDeTablaZeta {
cargaExitosa,
archivoNoEncontrado,
datosInconsistentes
}
| 269 | 0.714801 | 0.714801 | 16 | 16.3125 | 16.544331 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false | 2 |
d3d7fd067361d9d085e41a09415e2d5b974c7eb4 | 14,078,902,832,686 | 42d6bfddbd13eabbb8f1d93d5e2f8b25cda4f6af | /chatmodel/src/main/java/com/lens/chatmodel/notification/MessageNotificationCreator.java | e57f51437e558ad68e4a1f877ce11968a5df6688 | [] | no_license | tiebenxin/testcc | https://github.com/tiebenxin/testcc | 7e8d7cf6fc1b5d0ccf58250c6171ebdb95393c85 | 27d4f2451c2b55a9ba985b1eb638d099d4ecd5bb | refs/heads/master | 2021-06-29T16:19:22.259000 | 2020-09-28T09:59:27 | 2020-09-28T09:59:27 | 147,918,184 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lens.chatmodel.notification;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.support.v4.app.NotificationCompat;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.StyleSpan;
import com.fingerchat.proto.message.Muc.MucItem;
import com.lens.chatmodel.ChatEnum.EChatType;
import com.lens.chatmodel.ChatEnum.ESureType;
import com.lens.chatmodel.R;
import com.lens.chatmodel.bean.UserBean;
import com.lens.chatmodel.bean.message.RecentMessage;
import com.lens.chatmodel.db.MucInfo;
import com.lens.chatmodel.db.ProviderChat;
import com.lens.chatmodel.db.ProviderUser;
import com.lens.chatmodel.helper.SettingsManager;
import com.lens.chatmodel.interf.IChatRoomModel;
import com.lens.chatmodel.manager.NotifyManager;
import com.lens.chatmodel.ui.message.ChatActivity;
import com.lensim.fingerchat.commons.helper.ContextHelper;
import com.lensim.fingerchat.commons.router.ActivityPath;
import com.lensim.fingerchat.commons.router.ActivitysRouter;
import com.lensim.fingerchat.commons.utils.StringUtils;
import java.util.List;
public class MessageNotificationCreator {
private static int UNIQUE_REQUEST_CODE = 0;
private final Application application;
private List<MessageNotification> messageNotifications;
public MessageNotificationCreator() {
application = ContextHelper.getApplication();
}
public android.app.Notification notifyMessageNotification(
List<MessageNotification> messageNotifications,
IChatRoomModel messageItem) {
this.messageNotifications = messageNotifications;
if (messageNotifications.isEmpty()) {
return null;
}
int messageCount = 0;
for (MessageNotification messageNotification : messageNotifications) {
messageCount += messageNotification.getCount();
}
MessageNotification message = messageNotifications.get(messageNotifications.size() - 1);
boolean showText = SettingsManager.eventsShowText();
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(
application);
notificationBuilder.setContentTitle(getTitle(message, messageCount, messageItem));
notificationBuilder.setContentText(getText(message, showText, messageItem));
notificationBuilder.setTicker(getText(message, showText, messageItem));
notificationBuilder.setSmallIcon(getSmallIcon());
notificationBuilder
.setLargeIcon(
BitmapFactory.decodeResource(application.getResources(), R.drawable.ic_logo));
notificationBuilder.setWhen(message.getTimestamp().getTime());
notificationBuilder.setColor(Color.BLUE);
notificationBuilder.setStyle(getStyle(message, messageCount, showText, messageItem));
notificationBuilder.setContentIntent(getIntent(message));
notificationBuilder.setCategory(NotificationCompat.CATEGORY_MESSAGE);
notificationBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);
NotifyManager.getInstance().addEffects(notificationBuilder, messageItem);
return notificationBuilder.build();
}
private CharSequence getTitle(MessageNotification message, int messageCount,
IChatRoomModel model) {
if (isFromOneContact()) {
return getSingleContactTitle(message, messageCount, model);
} else {
return getMultiContactTitle(messageCount);
}
}
private CharSequence getSingleContactTitle(MessageNotification message, int messageCount,
IChatRoomModel model) {
if (messageCount > 1) {
return application.getString(R.string.chat_messages_from_contact,
messageCount, getContactName(message, model));
} else {
return getContactName(message, model);
}
}
private String getContactName(MessageNotification message, IChatRoomModel model) {
if (model != null) {
if (model.isGroupChat()) {
String groupName = model.getGroupName();
if (TextUtils.isEmpty(groupName)) {
groupName = model.getTo();
}
return groupName;
} else {
return !TextUtils.isEmpty(model.getNick()) ? model.getNick() : model.getTo();
}
} else {
return message.getUser();
}
}
private CharSequence getMultiContactTitle(int messageCount) {
String messageText = getTextForMessages(messageCount);
String contactText = application.getString(R.string.chat_contact_quantity_1);
return application.getString(R.string.chat_status,
messageCount, messageText, messageNotifications.size(), contactText);
}
private String getTextForMessages(int messageCount) {
//return "联系人";
return StringUtils.getQuantityString(
application.getResources(), R.array.chat_message_quantity, messageCount);
}
private CharSequence getText(MessageNotification message, boolean showText,
IChatRoomModel model) {
if (isFromOneContact()) {
if (showText) {
return message.getText();
} else {
return null;
}
} else {
return getContactNameAndMessage(message, showText, model);
}
}
private int getSmallIcon() {
return R.drawable.ic_stat_chat;
}
// private android.graphics.Bitmap getLargeIcon(MessageNotification message) {
// if (isFromOneContact()) {
// if (MUCManager.getInstance().hasRoom(message.getUserId(), message.getUser())) {
// return AvatarManager.getInstance().getRoomBitmap(message.getUser());
// } else {
// return AvatarManager.getInstance().getUserBitmap(message.getUser());
// }
// }
// return null;
// }
private boolean isFromOneContact() {
if (messageNotifications != null && messageNotifications.size() > 0) {
return messageNotifications.size() == 1;
} else {
return false;
}
}
private NotificationCompat.Style getStyle(MessageNotification message, int messageCount,
boolean showText, IChatRoomModel model) {
String text = "";
if (isFromOneContact()) {
NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle();
bigTextStyle.setBigContentTitle(getSingleContactTitle(message, messageCount, model));
if (showText) {
bigTextStyle.bigText(message.getText());
}
bigTextStyle.setSummaryText(text);
return bigTextStyle;
} else {
return getInboxStyle(messageCount, text, model);
}
}
private NotificationCompat.Style getInboxStyle(int messageCount, String accountName,
IChatRoomModel model) {
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
inboxStyle.setBigContentTitle(getMultiContactTitle(messageCount));
for (int i = 1; i <= messageNotifications.size(); i++) {
MessageNotification messageNotification = messageNotifications
.get(messageNotifications.size() - i);
boolean showTextForThisContact
= SettingsManager.eventsShowText();
inboxStyle
.addLine(
getContactNameAndMessage(messageNotification, showTextForThisContact, model));
}
inboxStyle.setSummaryText(accountName);
return inboxStyle;
}
private Spannable getContactNameAndMessage(MessageNotification messageNotification,
boolean showText, IChatRoomModel model) {
String userName = getContactName(messageNotification, model);
Spannable spannableString;
if (showText) {
String contactAndMessage = application.getString(
R.string.chat_contact_and_message, userName, messageNotification.getText());
spannableString = new SpannableString(contactAndMessage);
} else {
spannableString = new SpannableString(userName);
}
spannableString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, userName.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return spannableString;
}
private PendingIntent getIntent(MessageNotification message) {
Intent backIntent = null;
if (isFromOneContact()) {
UserBean bean = (UserBean) ProviderUser
.selectRosterSingle(ContextHelper.getContext(), message.getUser());
if (bean != null) {//私聊
backIntent = ChatActivity
.createChatIntent(application, bean);
} else {//群聊
MucItem mucItem = MucInfo
.selectMucInfoSingle(ContextHelper.getContext(), message.getUser());
int topFlag = ProviderChat
.getTopFlag(ContextHelper.getContext(), message.getUser());
if (mucItem != null) {
int bgId = 0;
int disturb = 0;
if (mucItem.getPConfig() != null) {
if (!TextUtils.isEmpty(mucItem.getPConfig().getChatBg())) {
bgId = Integer.parseInt(mucItem.getPConfig().getChatBg());
}
if (mucItem.getPConfig().getNoDisturb() > 0) {
disturb = mucItem.getPConfig().getNoDisturb();
}
}
backIntent = ChatActivity
.createChatIntent(application, mucItem.getMucid(), mucItem.getMucname(),
EChatType.GROUP.ordinal(), bgId, disturb, topFlag);
} else {
backIntent = ActivitysRouter.getInstance().invoke(application,
ActivityPath.ACTIVITY_MAIN_PATH);
backIntent.putExtra("page",0);
backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
} else {
backIntent = ActivitysRouter.getInstance().invoke(application,
ActivityPath.ACTIVITY_MAIN_PATH);
backIntent.putExtra("page",0);
backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
return PendingIntent.getActivity(application, UNIQUE_REQUEST_CODE++,
backIntent, PendingIntent.FLAG_ONE_SHOT);
}
}
| UTF-8 | Java | 10,807 | java | MessageNotificationCreator.java | Java | [] | null | [] | package com.lens.chatmodel.notification;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.support.v4.app.NotificationCompat;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.StyleSpan;
import com.fingerchat.proto.message.Muc.MucItem;
import com.lens.chatmodel.ChatEnum.EChatType;
import com.lens.chatmodel.ChatEnum.ESureType;
import com.lens.chatmodel.R;
import com.lens.chatmodel.bean.UserBean;
import com.lens.chatmodel.bean.message.RecentMessage;
import com.lens.chatmodel.db.MucInfo;
import com.lens.chatmodel.db.ProviderChat;
import com.lens.chatmodel.db.ProviderUser;
import com.lens.chatmodel.helper.SettingsManager;
import com.lens.chatmodel.interf.IChatRoomModel;
import com.lens.chatmodel.manager.NotifyManager;
import com.lens.chatmodel.ui.message.ChatActivity;
import com.lensim.fingerchat.commons.helper.ContextHelper;
import com.lensim.fingerchat.commons.router.ActivityPath;
import com.lensim.fingerchat.commons.router.ActivitysRouter;
import com.lensim.fingerchat.commons.utils.StringUtils;
import java.util.List;
public class MessageNotificationCreator {
private static int UNIQUE_REQUEST_CODE = 0;
private final Application application;
private List<MessageNotification> messageNotifications;
public MessageNotificationCreator() {
application = ContextHelper.getApplication();
}
public android.app.Notification notifyMessageNotification(
List<MessageNotification> messageNotifications,
IChatRoomModel messageItem) {
this.messageNotifications = messageNotifications;
if (messageNotifications.isEmpty()) {
return null;
}
int messageCount = 0;
for (MessageNotification messageNotification : messageNotifications) {
messageCount += messageNotification.getCount();
}
MessageNotification message = messageNotifications.get(messageNotifications.size() - 1);
boolean showText = SettingsManager.eventsShowText();
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(
application);
notificationBuilder.setContentTitle(getTitle(message, messageCount, messageItem));
notificationBuilder.setContentText(getText(message, showText, messageItem));
notificationBuilder.setTicker(getText(message, showText, messageItem));
notificationBuilder.setSmallIcon(getSmallIcon());
notificationBuilder
.setLargeIcon(
BitmapFactory.decodeResource(application.getResources(), R.drawable.ic_logo));
notificationBuilder.setWhen(message.getTimestamp().getTime());
notificationBuilder.setColor(Color.BLUE);
notificationBuilder.setStyle(getStyle(message, messageCount, showText, messageItem));
notificationBuilder.setContentIntent(getIntent(message));
notificationBuilder.setCategory(NotificationCompat.CATEGORY_MESSAGE);
notificationBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);
NotifyManager.getInstance().addEffects(notificationBuilder, messageItem);
return notificationBuilder.build();
}
private CharSequence getTitle(MessageNotification message, int messageCount,
IChatRoomModel model) {
if (isFromOneContact()) {
return getSingleContactTitle(message, messageCount, model);
} else {
return getMultiContactTitle(messageCount);
}
}
private CharSequence getSingleContactTitle(MessageNotification message, int messageCount,
IChatRoomModel model) {
if (messageCount > 1) {
return application.getString(R.string.chat_messages_from_contact,
messageCount, getContactName(message, model));
} else {
return getContactName(message, model);
}
}
private String getContactName(MessageNotification message, IChatRoomModel model) {
if (model != null) {
if (model.isGroupChat()) {
String groupName = model.getGroupName();
if (TextUtils.isEmpty(groupName)) {
groupName = model.getTo();
}
return groupName;
} else {
return !TextUtils.isEmpty(model.getNick()) ? model.getNick() : model.getTo();
}
} else {
return message.getUser();
}
}
private CharSequence getMultiContactTitle(int messageCount) {
String messageText = getTextForMessages(messageCount);
String contactText = application.getString(R.string.chat_contact_quantity_1);
return application.getString(R.string.chat_status,
messageCount, messageText, messageNotifications.size(), contactText);
}
private String getTextForMessages(int messageCount) {
//return "联系人";
return StringUtils.getQuantityString(
application.getResources(), R.array.chat_message_quantity, messageCount);
}
private CharSequence getText(MessageNotification message, boolean showText,
IChatRoomModel model) {
if (isFromOneContact()) {
if (showText) {
return message.getText();
} else {
return null;
}
} else {
return getContactNameAndMessage(message, showText, model);
}
}
private int getSmallIcon() {
return R.drawable.ic_stat_chat;
}
// private android.graphics.Bitmap getLargeIcon(MessageNotification message) {
// if (isFromOneContact()) {
// if (MUCManager.getInstance().hasRoom(message.getUserId(), message.getUser())) {
// return AvatarManager.getInstance().getRoomBitmap(message.getUser());
// } else {
// return AvatarManager.getInstance().getUserBitmap(message.getUser());
// }
// }
// return null;
// }
private boolean isFromOneContact() {
if (messageNotifications != null && messageNotifications.size() > 0) {
return messageNotifications.size() == 1;
} else {
return false;
}
}
private NotificationCompat.Style getStyle(MessageNotification message, int messageCount,
boolean showText, IChatRoomModel model) {
String text = "";
if (isFromOneContact()) {
NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle();
bigTextStyle.setBigContentTitle(getSingleContactTitle(message, messageCount, model));
if (showText) {
bigTextStyle.bigText(message.getText());
}
bigTextStyle.setSummaryText(text);
return bigTextStyle;
} else {
return getInboxStyle(messageCount, text, model);
}
}
private NotificationCompat.Style getInboxStyle(int messageCount, String accountName,
IChatRoomModel model) {
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
inboxStyle.setBigContentTitle(getMultiContactTitle(messageCount));
for (int i = 1; i <= messageNotifications.size(); i++) {
MessageNotification messageNotification = messageNotifications
.get(messageNotifications.size() - i);
boolean showTextForThisContact
= SettingsManager.eventsShowText();
inboxStyle
.addLine(
getContactNameAndMessage(messageNotification, showTextForThisContact, model));
}
inboxStyle.setSummaryText(accountName);
return inboxStyle;
}
private Spannable getContactNameAndMessage(MessageNotification messageNotification,
boolean showText, IChatRoomModel model) {
String userName = getContactName(messageNotification, model);
Spannable spannableString;
if (showText) {
String contactAndMessage = application.getString(
R.string.chat_contact_and_message, userName, messageNotification.getText());
spannableString = new SpannableString(contactAndMessage);
} else {
spannableString = new SpannableString(userName);
}
spannableString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, userName.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return spannableString;
}
private PendingIntent getIntent(MessageNotification message) {
Intent backIntent = null;
if (isFromOneContact()) {
UserBean bean = (UserBean) ProviderUser
.selectRosterSingle(ContextHelper.getContext(), message.getUser());
if (bean != null) {//私聊
backIntent = ChatActivity
.createChatIntent(application, bean);
} else {//群聊
MucItem mucItem = MucInfo
.selectMucInfoSingle(ContextHelper.getContext(), message.getUser());
int topFlag = ProviderChat
.getTopFlag(ContextHelper.getContext(), message.getUser());
if (mucItem != null) {
int bgId = 0;
int disturb = 0;
if (mucItem.getPConfig() != null) {
if (!TextUtils.isEmpty(mucItem.getPConfig().getChatBg())) {
bgId = Integer.parseInt(mucItem.getPConfig().getChatBg());
}
if (mucItem.getPConfig().getNoDisturb() > 0) {
disturb = mucItem.getPConfig().getNoDisturb();
}
}
backIntent = ChatActivity
.createChatIntent(application, mucItem.getMucid(), mucItem.getMucname(),
EChatType.GROUP.ordinal(), bgId, disturb, topFlag);
} else {
backIntent = ActivitysRouter.getInstance().invoke(application,
ActivityPath.ACTIVITY_MAIN_PATH);
backIntent.putExtra("page",0);
backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
} else {
backIntent = ActivitysRouter.getInstance().invoke(application,
ActivityPath.ACTIVITY_MAIN_PATH);
backIntent.putExtra("page",0);
backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
return PendingIntent.getActivity(application, UNIQUE_REQUEST_CODE++,
backIntent, PendingIntent.FLAG_ONE_SHOT);
}
}
| 10,807 | 0.644955 | 0.643565 | 277 | 37.963898 | 29.30369 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.67148 | false | false | 2 |
22ed963f6ac209852921c9dcfc7b9ad2615c4d9b | 23,124,103,955,488 | b62f98af14d09c680c5253734d5d73be139f2a75 | /edition/temp/patch_1537235203207_20180918_001_liuqiang5/replacement/modules/jzcm/client/classes/nc/ui/jzcm/jzpr1020/action/AddPayPlanPettiesAction.java | 52dcd4d36b683b42a6687bc8a36ced83ca32397a | [] | no_license | 1229341617/jzcm | https://github.com/1229341617/jzcm | c81775e13b2f38028be8458f87d633053420018b | 432906de31b380ad6b2636639bc823916c011cd3 | refs/heads/master | 2020-06-08T08:35:19.004000 | 2019-06-22T07:37:50 | 2019-06-22T07:37:50 | 193,197,624 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nc.ui.jzcm.jzpr1020.action;
import java.awt.event.ActionEvent;
import org.apache.commons.lang.ArrayUtils;
import nc.ui.jzcm.jzpr1020.dlg.PrPayPlanPettyAddDlg;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pubapp.uif2app.view.ShowUpableBillForm;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.model.AbstractAppModel;
import nc.uif.pub.exception.UifException;
import nc.vo.bd.supplier.SupplierVO;
import nc.vo.jz.jzbd30.BDFeeItemVO;
import nc.vo.jzcm.jzpr1010.PrPayPlanPettyVO;
import nc.vo.jzcm.jzpr_payappfrm.PrPayAppFrmBVO;
import nc.vo.pub.lang.UFDouble;
public class AddPayPlanPettiesAction extends NCAction {
private static final long serialVersionUID = 5828278104195621444L;
private AbstractAppModel model;
private ShowUpableBillForm billFormEditor;
public AddPayPlanPettiesAction() {
super.setBtnName("零星费用");
super.setCode("petty");
}
@Override
public void doAction(ActionEvent e) throws Exception {
PrPayPlanPettyAddDlg dlg = new PrPayPlanPettyAddDlg(null);
dlg.initBillForm(billFormEditor);
String pk_payplan = (String)getBillFormEditor().getBillCardPanel().getHeadItem("vdef1").getValueObject();
if(dlg.hasString(pk_payplan) == false){
MessageDialog.showHintDlg(getBillFormEditor().getBillCardPanel(), "提示", "请先选择付款计划参照!");
return;
}
PrPayPlanPettyVO[] petties = dlg.getPetties(pk_payplan);
// UFDouble afterAppMny = dlg.getAfterAppMny(this.getBillFormEditor());
// UFDouble lastAfterAppMny = new UFDouble(0);
for (int i = 0; i < petties.length; i++) {
PrPayPlanPettyVO p = petties[i];
String pk_supplier = p.getPk_supplier();
String pk_feeitem = p.getPk_feeitem();
if(p.getNorigpaymny() == null){
p.setNorigpaymny(new UFDouble(0));
}
if(p.getNorigreqmny() == null){
p.setNorigreqmny(new UFDouble(0));
}
updateSupplier(dlg, p, pk_supplier);
updateFeeItem(dlg, p, pk_feeitem);
PrPayAppFrmBVO[] pafbs = dlg.getPafbsByPlanBPk(p.getPk_payplan_petty());
UFDouble afterAppMny = dlg.getAfterAppMny(pafbs);//该付款计划子表已申请金额总和
UFDouble remainAppMny = p.getNorigreqmny().sub(afterAppMny);//剩余可付款金额的计算
if(remainAppMny.toDouble() > 0){
p.setVbdef1(remainAppMny.toString());
}else{
petties = (PrPayPlanPettyVO[])ArrayUtils.removeElement(petties, p);
i--;
}
// lastAfterAppMny = p.getNorigreqmny().sub(afterAppMny);
// p.setVbdef1(lastAfterAppMny.toString());
// if(lastAfterAppMny.toDouble() <= 0.0){
// petties = (PrPayPlanPettyVO[])ArrayUtils.removeElement(petties, p);
// i--;
// }
}
//为表体行设置数据
dlg.getListPanel().setBodyValueVO(petties);
//显示弹出框
dlg.show();
}
private void updateSupplier(PrPayPlanPettyAddDlg dlg, PrPayPlanPettyVO p,
String pk_supplier) throws UifException {
if(dlg.hasString(pk_supplier)){
SupplierVO[] suppliers = dlg.getSupplier(pk_supplier);
if(suppliers != null){
p.setPk_supplier(suppliers[0].getName());
}
}
}
private void updateFeeItem(PrPayPlanPettyAddDlg dlg, PrPayPlanPettyVO p,
String pk_feeitem) throws UifException {
if(dlg.hasString(pk_feeitem)){
BDFeeItemVO[] feeitems = dlg.getFeeitem(pk_feeitem);
if(feeitems != null){
p.setPk_feeitem(feeitems[0].getVname());
}
}
}
public AbstractAppModel getModel() {
return model;
}
public void setModel(AbstractAppModel model) {
this.model = model;
}
public ShowUpableBillForm getBillFormEditor() {
return billFormEditor;
}
public void setBillFormEditor(ShowUpableBillForm billFormEditor) {
this.billFormEditor = billFormEditor;
}
}
| GB18030 | Java | 3,726 | java | AddPayPlanPettiesAction.java | Java | [] | null | [] | package nc.ui.jzcm.jzpr1020.action;
import java.awt.event.ActionEvent;
import org.apache.commons.lang.ArrayUtils;
import nc.ui.jzcm.jzpr1020.dlg.PrPayPlanPettyAddDlg;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pubapp.uif2app.view.ShowUpableBillForm;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.model.AbstractAppModel;
import nc.uif.pub.exception.UifException;
import nc.vo.bd.supplier.SupplierVO;
import nc.vo.jz.jzbd30.BDFeeItemVO;
import nc.vo.jzcm.jzpr1010.PrPayPlanPettyVO;
import nc.vo.jzcm.jzpr_payappfrm.PrPayAppFrmBVO;
import nc.vo.pub.lang.UFDouble;
public class AddPayPlanPettiesAction extends NCAction {
private static final long serialVersionUID = 5828278104195621444L;
private AbstractAppModel model;
private ShowUpableBillForm billFormEditor;
public AddPayPlanPettiesAction() {
super.setBtnName("零星费用");
super.setCode("petty");
}
@Override
public void doAction(ActionEvent e) throws Exception {
PrPayPlanPettyAddDlg dlg = new PrPayPlanPettyAddDlg(null);
dlg.initBillForm(billFormEditor);
String pk_payplan = (String)getBillFormEditor().getBillCardPanel().getHeadItem("vdef1").getValueObject();
if(dlg.hasString(pk_payplan) == false){
MessageDialog.showHintDlg(getBillFormEditor().getBillCardPanel(), "提示", "请先选择付款计划参照!");
return;
}
PrPayPlanPettyVO[] petties = dlg.getPetties(pk_payplan);
// UFDouble afterAppMny = dlg.getAfterAppMny(this.getBillFormEditor());
// UFDouble lastAfterAppMny = new UFDouble(0);
for (int i = 0; i < petties.length; i++) {
PrPayPlanPettyVO p = petties[i];
String pk_supplier = p.getPk_supplier();
String pk_feeitem = p.getPk_feeitem();
if(p.getNorigpaymny() == null){
p.setNorigpaymny(new UFDouble(0));
}
if(p.getNorigreqmny() == null){
p.setNorigreqmny(new UFDouble(0));
}
updateSupplier(dlg, p, pk_supplier);
updateFeeItem(dlg, p, pk_feeitem);
PrPayAppFrmBVO[] pafbs = dlg.getPafbsByPlanBPk(p.getPk_payplan_petty());
UFDouble afterAppMny = dlg.getAfterAppMny(pafbs);//该付款计划子表已申请金额总和
UFDouble remainAppMny = p.getNorigreqmny().sub(afterAppMny);//剩余可付款金额的计算
if(remainAppMny.toDouble() > 0){
p.setVbdef1(remainAppMny.toString());
}else{
petties = (PrPayPlanPettyVO[])ArrayUtils.removeElement(petties, p);
i--;
}
// lastAfterAppMny = p.getNorigreqmny().sub(afterAppMny);
// p.setVbdef1(lastAfterAppMny.toString());
// if(lastAfterAppMny.toDouble() <= 0.0){
// petties = (PrPayPlanPettyVO[])ArrayUtils.removeElement(petties, p);
// i--;
// }
}
//为表体行设置数据
dlg.getListPanel().setBodyValueVO(petties);
//显示弹出框
dlg.show();
}
private void updateSupplier(PrPayPlanPettyAddDlg dlg, PrPayPlanPettyVO p,
String pk_supplier) throws UifException {
if(dlg.hasString(pk_supplier)){
SupplierVO[] suppliers = dlg.getSupplier(pk_supplier);
if(suppliers != null){
p.setPk_supplier(suppliers[0].getName());
}
}
}
private void updateFeeItem(PrPayPlanPettyAddDlg dlg, PrPayPlanPettyVO p,
String pk_feeitem) throws UifException {
if(dlg.hasString(pk_feeitem)){
BDFeeItemVO[] feeitems = dlg.getFeeitem(pk_feeitem);
if(feeitems != null){
p.setPk_feeitem(feeitems[0].getVname());
}
}
}
public AbstractAppModel getModel() {
return model;
}
public void setModel(AbstractAppModel model) {
this.model = model;
}
public ShowUpableBillForm getBillFormEditor() {
return billFormEditor;
}
public void setBillFormEditor(ShowUpableBillForm billFormEditor) {
this.billFormEditor = billFormEditor;
}
}
| 3,726 | 0.721946 | 0.708679 | 133 | 26.203007 | 24.906973 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.18797 | false | false | 2 |
dc3e17a8884809223b217610e09b34af8eb31c4c | 31,413,390,840,566 | 15b1e5f149aff943c2761887951dcd52c5645abc | /bedroom/src/main/java/com/bedroom/common/pojo/User.java | 26d905fd4ebc79a9ac3f7e7bcdb614ad74be758a | [] | no_license | air-teng/bedroom_manage | https://github.com/air-teng/bedroom_manage | 695899f88e3f4c5b65cd4650a46c10a9bc21154f | 00f7665cb3a02ff857675eae9397e6b114576679 | refs/heads/master | 2022-07-07T06:58:23.190000 | 2019-06-04T02:29:30 | 2019-06-04T02:29:30 | 187,426,860 | 1 | 0 | null | false | 2022-06-21T01:08:33 | 2019-05-19T02:51:13 | 2019-06-04T02:29:40 | 2022-06-21T01:08:31 | 7,075 | 0 | 0 | 1 | JavaScript | false | false | package com.bedroom.common.pojo;
import java.io.Serializable;
import java.util.Date;
/**
* 用户实体类
user_account varchar
user_name varchar
user_password varchar
user_nickname varchar
user_sex varchar
user_age int
user_phone varchar
user_college_name varchar
grade_level varchar
user_foundtime datetime
bedroom_id int
user_level char
*
*/
public class User implements Serializable{
private static final long serialVersionUID = 1L;
//
private String userAccount;//主键,bu自增长
private String userName;//用户账号
private String userPassword;//用户t密码
private String userNickname;//用户昵称
private String userSex;//用户性别
private Integer userAge;//用户年龄
private String userPhone;//电话
private String userCollegeName;//学院
private String gradeLevel;//年级,哪一届
private Date userFoundtime;//创建时间
private Integer bedroomId;//宿舍id
private String userLevel;//身份('0'-学生,'1'-教师,'2'-管理员)
//set and get
public String getUserAccount() {
return userAccount;
}
public void setUserAccount(String userAccount) {
this.userAccount = userAccount;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
public String getUserNickname() {
return userNickname;
}
public void setUserNickname(String userNickname) {
this.userNickname = userNickname;
}
public String getUserSex() {
return userSex;
}
public void setUserSex(String userSex) {
this.userSex = userSex;
}
public Integer getUserAge() {
return userAge;
}
public void setUserAge(Integer userAge) {
this.userAge = userAge;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public String getUserCollegeName() {
return userCollegeName;
}
public void setUserCollegeName(String userCollegeName) {
this.userCollegeName = userCollegeName;
}
public String getGradeLevel() {
return gradeLevel;
}
public void setGradeLevel(String gradeLevel) {
this.gradeLevel = gradeLevel;
}
public Date getUserFoundtime() {
return userFoundtime;
}
public void setUserFoundtime(Date userFoundtime) {
this.userFoundtime = userFoundtime;
}
public Integer getBedroomId() {
return bedroomId;
}
public void setBedroomId(Integer bedroomId) {
this.bedroomId = bedroomId;
}
public String getUserLevel() {
return userLevel;
}
public void setUserLevel(String userLevel) {
this.userLevel = userLevel;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "User [userAccount=" + userAccount + ", userName=" + userName + ", userPassword=" + userPassword
+ ", userNickname=" + userNickname + ", userSex=" + userSex + ", userAge=" + userAge + ", userPhone="
+ userPhone + ", userCollegeName=" + userCollegeName + ", gradeLevel=" + gradeLevel + ", userFoundtime="
+ userFoundtime + ", bedroomId=" + bedroomId + ", userLevel=" + userLevel + "]";
}
}
| UTF-8 | Java | 3,241 | java | User.java | Java | [
{
"context": " userName;//用户账号\n\tprivate String userPassword;//用户t密码\n\tprivate String userNickname;//用户昵称\n\tprivate Str",
"end": 561,
"score": 0.9937698245048523,
"start": 556,
"tag": "PASSWORD",
"value": "用户t密码"
},
{
"context": "ser [userAccount=\" + userAccount + \", userName=\" + userName + \", userPassword=\" + userPassword\n\t\t\t\t+ \", userN",
"end": 2784,
"score": 0.9857975840568542,
"start": 2776,
"tag": "USERNAME",
"value": "userName"
},
{
"context": "t + \", userName=\" + userName + \", userPassword=\" + userPassword\n\t\t\t\t+ \", userNickname=\" + userNickname + \", userS",
"end": 2819,
"score": 0.9786317348480225,
"start": 2807,
"tag": "PASSWORD",
"value": "userPassword"
}
] | null | [] | package com.bedroom.common.pojo;
import java.io.Serializable;
import java.util.Date;
/**
* 用户实体类
user_account varchar
user_name varchar
user_password varchar
user_nickname varchar
user_sex varchar
user_age int
user_phone varchar
user_college_name varchar
grade_level varchar
user_foundtime datetime
bedroom_id int
user_level char
*
*/
public class User implements Serializable{
private static final long serialVersionUID = 1L;
//
private String userAccount;//主键,bu自增长
private String userName;//用户账号
private String userPassword;//<PASSWORD>
private String userNickname;//用户昵称
private String userSex;//用户性别
private Integer userAge;//用户年龄
private String userPhone;//电话
private String userCollegeName;//学院
private String gradeLevel;//年级,哪一届
private Date userFoundtime;//创建时间
private Integer bedroomId;//宿舍id
private String userLevel;//身份('0'-学生,'1'-教师,'2'-管理员)
//set and get
public String getUserAccount() {
return userAccount;
}
public void setUserAccount(String userAccount) {
this.userAccount = userAccount;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
public String getUserNickname() {
return userNickname;
}
public void setUserNickname(String userNickname) {
this.userNickname = userNickname;
}
public String getUserSex() {
return userSex;
}
public void setUserSex(String userSex) {
this.userSex = userSex;
}
public Integer getUserAge() {
return userAge;
}
public void setUserAge(Integer userAge) {
this.userAge = userAge;
}
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public String getUserCollegeName() {
return userCollegeName;
}
public void setUserCollegeName(String userCollegeName) {
this.userCollegeName = userCollegeName;
}
public String getGradeLevel() {
return gradeLevel;
}
public void setGradeLevel(String gradeLevel) {
this.gradeLevel = gradeLevel;
}
public Date getUserFoundtime() {
return userFoundtime;
}
public void setUserFoundtime(Date userFoundtime) {
this.userFoundtime = userFoundtime;
}
public Integer getBedroomId() {
return bedroomId;
}
public void setBedroomId(Integer bedroomId) {
this.bedroomId = bedroomId;
}
public String getUserLevel() {
return userLevel;
}
public void setUserLevel(String userLevel) {
this.userLevel = userLevel;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "User [userAccount=" + userAccount + ", userName=" + userName + ", userPassword=" + <PASSWORD>
+ ", userNickname=" + userNickname + ", userSex=" + userSex + ", userAge=" + userAge + ", userPhone="
+ userPhone + ", userCollegeName=" + userCollegeName + ", gradeLevel=" + gradeLevel + ", userFoundtime="
+ userFoundtime + ", bedroomId=" + bedroomId + ", userLevel=" + userLevel + "]";
}
}
| 3,236 | 0.730929 | 0.729652 | 125 | 24.063999 | 21.12619 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.736 | false | false | 2 |
c16fda2d03114a9d9f0ff69c687cad1ca96cdac5 | 19,086,834,710,153 | 69dca9038809b61a3516a5ce79f4ef8d8039d9be | /RepDevFingers/tags/unimedjp-fingers-1.0/src/main/java/br/com/unimedjp/fingers/modelo/dao/FingerDAOImpl.java | bf5643db68ab8e73f665b9252edfe812b3ba5b13 | [] | no_license | pamcruz/unimedjp | https://github.com/pamcruz/unimedjp | 2bd71396795730a42ddf8e571220e24e1057ec9b | e1e9a6b941070f98380beab58e9b7c2e75e84848 | refs/heads/master | 2016-08-09T14:36:23.345000 | 2016-04-08T02:22:11 | 2016-04-08T02:22:11 | 51,344,121 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.unimedjp.fingers.modelo.dao;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import br.com.unimedjp.core.exception.SystemException;
import br.com.unimedjp.core.modelo.dao.CrudDAOImpl;
import br.com.unimedjp.fingers.modelo.entity.Finger;
import br.com.unimedjp.fingers.modelo.to.CadastroFingerTO;
import br.com.unimedjp.unicoo.modelo.entity.UnidadeDeAtendimento;
import br.com.unimedjp.unicoo.modelo.to.AtendenteUnicooTO;
@Repository("fingerDAO")
@Transactional
public class FingerDAOImpl extends CrudDAOImpl<Finger> implements FingerDAO {
@Override
protected Class<Finger> getClasseConsulta() {
return Finger.class;
}
@Override
public List<Finger> obterFingersPorUnidadeDeAtendimento(
UnidadeDeAtendimento unidadeDeAtendimento) throws SystemException{
String sql = " select f from Finger f where 1=1 ";
if (unidadeDeAtendimento!=null){
sql += " and f.unidadeDeAtendimento =:unidadeDeAtendimento ";
}
Query query = getSession().createQuery(sql);
if (unidadeDeAtendimento!=null){
query.setParameter("unidadeDeAtendimento", unidadeDeAtendimento);
}
return query.setFetchSize(50).list();
}
@Override
public List<CadastroFingerTO> obterRelatorioCadastroFingerPorUnidadeEUsuario()
throws SystemException {
List<CadastroFingerTO> listaRetorno = new ArrayList<CadastroFingerTO>();
SQLQuery query = getSession().createSQLQuery("select un.descricao as UNIDADE_ATEND, r.usuario as USUARIO, count(*) as QTD "
+" from revinfo r, fg_finger_aud fg, fg_unidade un "
+" where fg.rev = r.id and fg.unidade_id = un.id and fg.revtype = 0 "
+" group by r.usuario, un.descricao "
+" order by un.descricao, r.usuario ");
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List data = query.list();
for(Object object : data){
Map row = (Map) object;
CadastroFingerTO to = new CadastroFingerTO();
to.setQuantidade(((BigDecimal)row.get("QTD")).intValue());
to.setUsuario((String)row.get("USUARIO"));
to.setUnidade((String)row.get("UNIDADE_ATEND"));
listaRetorno.add(to);
}
return listaRetorno;
}
@Override
public List<CadastroFingerTO> obterRelatorioCadastroFingerPorUsuario()
throws SystemException {
List<CadastroFingerTO> listaRetorno = new ArrayList<CadastroFingerTO>();
SQLQuery query = getSession().createSQLQuery("select r.usuario as USUARIO, count(*) as QTD_FINGERS_CADASTRADOS "+
" from revinfo r, fg_finger_aud fg where fg.rev=r.id and fg.revtype=0 "+
" group by r.usuario "+
" order by r.usuario ");
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List data = query.list();
for(Object object : data){
Map row = (Map) object;
CadastroFingerTO to = new CadastroFingerTO();
to.setQuantidade(((BigDecimal)row.get("QTD_FINGERS_CADASTRADOS")).intValue());
to.setUsuario((String)row.get("USUARIO"));
listaRetorno.add(to);
}
return listaRetorno;
}
}
| UTF-8 | Java | 3,211 | java | FingerDAOImpl.java | Java | [] | null | [] | package br.com.unimedjp.fingers.modelo.dao;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import br.com.unimedjp.core.exception.SystemException;
import br.com.unimedjp.core.modelo.dao.CrudDAOImpl;
import br.com.unimedjp.fingers.modelo.entity.Finger;
import br.com.unimedjp.fingers.modelo.to.CadastroFingerTO;
import br.com.unimedjp.unicoo.modelo.entity.UnidadeDeAtendimento;
import br.com.unimedjp.unicoo.modelo.to.AtendenteUnicooTO;
@Repository("fingerDAO")
@Transactional
public class FingerDAOImpl extends CrudDAOImpl<Finger> implements FingerDAO {
@Override
protected Class<Finger> getClasseConsulta() {
return Finger.class;
}
@Override
public List<Finger> obterFingersPorUnidadeDeAtendimento(
UnidadeDeAtendimento unidadeDeAtendimento) throws SystemException{
String sql = " select f from Finger f where 1=1 ";
if (unidadeDeAtendimento!=null){
sql += " and f.unidadeDeAtendimento =:unidadeDeAtendimento ";
}
Query query = getSession().createQuery(sql);
if (unidadeDeAtendimento!=null){
query.setParameter("unidadeDeAtendimento", unidadeDeAtendimento);
}
return query.setFetchSize(50).list();
}
@Override
public List<CadastroFingerTO> obterRelatorioCadastroFingerPorUnidadeEUsuario()
throws SystemException {
List<CadastroFingerTO> listaRetorno = new ArrayList<CadastroFingerTO>();
SQLQuery query = getSession().createSQLQuery("select un.descricao as UNIDADE_ATEND, r.usuario as USUARIO, count(*) as QTD "
+" from revinfo r, fg_finger_aud fg, fg_unidade un "
+" where fg.rev = r.id and fg.unidade_id = un.id and fg.revtype = 0 "
+" group by r.usuario, un.descricao "
+" order by un.descricao, r.usuario ");
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List data = query.list();
for(Object object : data){
Map row = (Map) object;
CadastroFingerTO to = new CadastroFingerTO();
to.setQuantidade(((BigDecimal)row.get("QTD")).intValue());
to.setUsuario((String)row.get("USUARIO"));
to.setUnidade((String)row.get("UNIDADE_ATEND"));
listaRetorno.add(to);
}
return listaRetorno;
}
@Override
public List<CadastroFingerTO> obterRelatorioCadastroFingerPorUsuario()
throws SystemException {
List<CadastroFingerTO> listaRetorno = new ArrayList<CadastroFingerTO>();
SQLQuery query = getSession().createSQLQuery("select r.usuario as USUARIO, count(*) as QTD_FINGERS_CADASTRADOS "+
" from revinfo r, fg_finger_aud fg where fg.rev=r.id and fg.revtype=0 "+
" group by r.usuario "+
" order by r.usuario ");
query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
List data = query.list();
for(Object object : data){
Map row = (Map) object;
CadastroFingerTO to = new CadastroFingerTO();
to.setQuantidade(((BigDecimal)row.get("QTD_FINGERS_CADASTRADOS")).intValue());
to.setUsuario((String)row.get("USUARIO"));
listaRetorno.add(to);
}
return listaRetorno;
}
}
| 3,211 | 0.747119 | 0.745251 | 93 | 33.494625 | 27.678501 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.075269 | false | false | 2 |
08fbfb54d0dad958403c33da9dc9dbd49edd7e7b | 2,791,728,803,902 | 2980c842d13de3994de890fee7a5febb1347b267 | /src/com/hackkrk/workforcafe/network/AbstractWSCommand.java | 717b76598bd7bc19f2e40dda737d8f0f882df638 | [] | no_license | HackKRK/work_from_cafe_android | https://github.com/HackKRK/work_from_cafe_android | edf00aab3411ec9ad748106d0581a3ca90074302 | 81c85af27fdadad48b5351aa43cb54fc0001f8f6 | refs/heads/master | 2020-12-25T19:14:56.201000 | 2012-01-16T09:10:45 | 2012-01-16T09:10:45 | 3,181,160 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hackkrk.workforcafe.network;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import com.google.gson.Gson;
import android.os.AsyncTask;
public abstract class AbstractWSCommand<T> extends AsyncTask<Void, Void, T> {
private static final String WS_URL = "https://raw.github.com/kaaes/work_from_cafe/gh-pages/";
private ResponseHandler<T> responseHandler;
private Gson gson;
private Throwable error;
public AbstractWSCommand(ResponseHandler<T> responseHandler) {
this.responseHandler = responseHandler;
}
@Override
protected T doInBackground(Void... arg) {
try {
HttpGet httpGet = new HttpGet(WS_URL + getMethodName());
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(httpGet);
int responseCode = response.getStatusLine().getStatusCode();
if(responseCode == HttpStatus.SC_OK) {
HttpEntity entity = response.getEntity();
String jsonResult = EntityUtils.toString(entity);
int start = jsonResult.indexOf("[");
// int end = jsonResult.indexOf("]");
String processedResult = jsonResult.substring(start);
T object = getGsonParser().fromJson(processedResult, getTargetParseClass());
return object;
} else {
throw new Exception("Error during downloading data from webservice, status code: " + responseCode);
}
} catch(Throwable e) {
this.error = e;
}
return null;
}
protected void onPostExecute(T result) {
if(error != null) {
responseHandler.onError(error);
} else {
responseHandler.onResult(result);
}
}
private Gson getGsonParser() {
if(gson == null) {
gson = new Gson();
}
return gson;
}
protected abstract Class<T> getTargetParseClass();
protected abstract String getMethodName();
}
| UTF-8 | Java | 2,002 | java | AbstractWSCommand.java | Java | [
{
"context": "tic final String WS_URL = \"https://raw.github.com/kaaes/work_from_cafe/gh-pages/\";\n\tprivate ResponseHandl",
"end": 540,
"score": 0.7419075965881348,
"start": 535,
"tag": "USERNAME",
"value": "kaaes"
}
] | null | [] | package com.hackkrk.workforcafe.network;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import com.google.gson.Gson;
import android.os.AsyncTask;
public abstract class AbstractWSCommand<T> extends AsyncTask<Void, Void, T> {
private static final String WS_URL = "https://raw.github.com/kaaes/work_from_cafe/gh-pages/";
private ResponseHandler<T> responseHandler;
private Gson gson;
private Throwable error;
public AbstractWSCommand(ResponseHandler<T> responseHandler) {
this.responseHandler = responseHandler;
}
@Override
protected T doInBackground(Void... arg) {
try {
HttpGet httpGet = new HttpGet(WS_URL + getMethodName());
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(httpGet);
int responseCode = response.getStatusLine().getStatusCode();
if(responseCode == HttpStatus.SC_OK) {
HttpEntity entity = response.getEntity();
String jsonResult = EntityUtils.toString(entity);
int start = jsonResult.indexOf("[");
// int end = jsonResult.indexOf("]");
String processedResult = jsonResult.substring(start);
T object = getGsonParser().fromJson(processedResult, getTargetParseClass());
return object;
} else {
throw new Exception("Error during downloading data from webservice, status code: " + responseCode);
}
} catch(Throwable e) {
this.error = e;
}
return null;
}
protected void onPostExecute(T result) {
if(error != null) {
responseHandler.onError(error);
} else {
responseHandler.onResult(result);
}
}
private Gson getGsonParser() {
if(gson == null) {
gson = new Gson();
}
return gson;
}
protected abstract Class<T> getTargetParseClass();
protected abstract String getMethodName();
}
| 2,002 | 0.729271 | 0.729271 | 70 | 27.6 | 24.887978 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.1 | false | false | 2 |
c57103846fc059fa275b704fcffe7d15b4f9a87d | 8,589,934,648,304 | ef0c1514e9af6de3ba4a20e0d01de7cc3a915188 | /sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/src/main/java/com/azure/resourcemanager/hybridcontainerservice/implementation/AgentPoolImpl.java | b820690e95a6032ed31af59fa8dbc839e187d624 | [
"LicenseRef-scancode-generic-cla",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"CC0-1.0",
"BSD-3-Clause",
"UPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | Azure/azure-sdk-for-java | https://github.com/Azure/azure-sdk-for-java | 0902d584b42d3654b4ce65b1dad8409f18ddf4bc | 789bdc6c065dc44ce9b8b630e2f2e5896b2a7616 | refs/heads/main | 2023-09-04T09:36:35.821000 | 2023-09-02T01:53:56 | 2023-09-02T01:53:56 | 2,928,948 | 2,027 | 2,084 | MIT | false | 2023-09-14T21:37:15 | 2011-12-06T23:33:56 | 2023-09-14T17:19:10 | 2023-09-14T21:37:14 | 3,043,660 | 1,994 | 1,854 | 1,435 | Java | false | false | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.hybridcontainerservice.implementation;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.hybridcontainerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPool;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolExtendedLocation;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningState;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningStatusStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.CloudProviderProfile;
import com.azure.resourcemanager.hybridcontainerservice.models.Mode;
import com.azure.resourcemanager.hybridcontainerservice.models.OsType;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public final class AgentPoolImpl implements AgentPool, AgentPool.Definition, AgentPool.Update {
private AgentPoolInner innerObject;
private final com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager;
public String id() {
return this.innerModel().id();
}
public String name() {
return this.innerModel().name();
}
public String type() {
return this.innerModel().type();
}
public String location() {
return this.innerModel().location();
}
public Map<String, String> tags() {
Map<String, String> inner = this.innerModel().tags();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public SystemData systemData() {
return this.innerModel().systemData();
}
public AgentPoolExtendedLocation extendedLocation() {
return this.innerModel().extendedLocation();
}
public AgentPoolProvisioningState provisioningState() {
return this.innerModel().provisioningState();
}
public AgentPoolProvisioningStatusStatus status() {
return this.innerModel().status();
}
public Integer count() {
return this.innerModel().count();
}
public List<String> availabilityZones() {
List<String> inner = this.innerModel().availabilityZones();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public Integer maxCount() {
return this.innerModel().maxCount();
}
public Integer maxPods() {
return this.innerModel().maxPods();
}
public Integer minCount() {
return this.innerModel().minCount();
}
public Mode mode() {
return this.innerModel().mode();
}
public Map<String, String> nodeLabels() {
Map<String, String> inner = this.innerModel().nodeLabels();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public List<String> nodeTaints() {
List<String> inner = this.innerModel().nodeTaints();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public OsType osType() {
return this.innerModel().osType();
}
public String nodeImageVersion() {
return this.innerModel().nodeImageVersion();
}
public String vmSize() {
return this.innerModel().vmSize();
}
public CloudProviderProfile cloudProviderProfile() {
return this.innerModel().cloudProviderProfile();
}
public Region region() {
return Region.fromName(this.regionName());
}
public String regionName() {
return this.location();
}
public String resourceGroupName() {
return resourceGroupName;
}
public AgentPoolInner innerModel() {
return this.innerObject;
}
private com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager manager() {
return this.serviceManager;
}
private String resourceGroupName;
private String resourceName;
private String agentPoolName;
public AgentPoolImpl withExistingProvisionedCluster(String resourceGroupName, String resourceName) {
this.resourceGroupName = resourceGroupName;
this.resourceName = resourceName;
return this;
}
public AgentPool create() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE);
return this;
}
public AgentPool create(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context);
return this;
}
AgentPoolImpl(
String name, com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager) {
this.innerObject = new AgentPoolInner();
this.serviceManager = serviceManager;
this.agentPoolName = name;
}
public AgentPoolImpl update() {
return this;
}
public AgentPool apply() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.updateWithResponse(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE)
.getValue();
return this;
}
public AgentPool apply(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.updateWithResponse(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context)
.getValue();
return this;
}
AgentPoolImpl(
AgentPoolInner innerObject,
com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "provisionedClusters");
this.agentPoolName = Utils.getValueFromIdByName(innerObject.id(), "agentPools");
}
public AgentPool refresh() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE)
.getValue();
return this;
}
public AgentPool refresh(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.getWithResponse(resourceGroupName, resourceName, agentPoolName, context)
.getValue();
return this;
}
public AgentPoolImpl withRegion(Region location) {
this.innerModel().withLocation(location.toString());
return this;
}
public AgentPoolImpl withRegion(String location) {
this.innerModel().withLocation(location);
return this;
}
public AgentPoolImpl withTags(Map<String, String> tags) {
this.innerModel().withTags(tags);
return this;
}
public AgentPoolImpl withExtendedLocation(AgentPoolExtendedLocation extendedLocation) {
this.innerModel().withExtendedLocation(extendedLocation);
return this;
}
public AgentPoolImpl withStatus(AgentPoolProvisioningStatusStatus status) {
this.innerModel().withStatus(status);
return this;
}
public AgentPoolImpl withCount(Integer count) {
this.innerModel().withCount(count);
return this;
}
public AgentPoolImpl withAvailabilityZones(List<String> availabilityZones) {
this.innerModel().withAvailabilityZones(availabilityZones);
return this;
}
public AgentPoolImpl withMaxCount(Integer maxCount) {
this.innerModel().withMaxCount(maxCount);
return this;
}
public AgentPoolImpl withMaxPods(Integer maxPods) {
this.innerModel().withMaxPods(maxPods);
return this;
}
public AgentPoolImpl withMinCount(Integer minCount) {
this.innerModel().withMinCount(minCount);
return this;
}
public AgentPoolImpl withMode(Mode mode) {
this.innerModel().withMode(mode);
return this;
}
public AgentPoolImpl withNodeLabels(Map<String, String> nodeLabels) {
this.innerModel().withNodeLabels(nodeLabels);
return this;
}
public AgentPoolImpl withNodeTaints(List<String> nodeTaints) {
this.innerModel().withNodeTaints(nodeTaints);
return this;
}
public AgentPoolImpl withOsType(OsType osType) {
this.innerModel().withOsType(osType);
return this;
}
public AgentPoolImpl withNodeImageVersion(String nodeImageVersion) {
this.innerModel().withNodeImageVersion(nodeImageVersion);
return this;
}
public AgentPoolImpl withVmSize(String vmSize) {
this.innerModel().withVmSize(vmSize);
return this;
}
public AgentPoolImpl withCloudProviderProfile(CloudProviderProfile cloudProviderProfile) {
this.innerModel().withCloudProviderProfile(cloudProviderProfile);
return this;
}
}
| UTF-8 | Java | 9,990 | java | AgentPoolImpl.java | Java | [] | null | [] | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.hybridcontainerservice.implementation;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.hybridcontainerservice.fluent.models.AgentPoolInner;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPool;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolExtendedLocation;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningState;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningStatusStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.CloudProviderProfile;
import com.azure.resourcemanager.hybridcontainerservice.models.Mode;
import com.azure.resourcemanager.hybridcontainerservice.models.OsType;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public final class AgentPoolImpl implements AgentPool, AgentPool.Definition, AgentPool.Update {
private AgentPoolInner innerObject;
private final com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager;
public String id() {
return this.innerModel().id();
}
public String name() {
return this.innerModel().name();
}
public String type() {
return this.innerModel().type();
}
public String location() {
return this.innerModel().location();
}
public Map<String, String> tags() {
Map<String, String> inner = this.innerModel().tags();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public SystemData systemData() {
return this.innerModel().systemData();
}
public AgentPoolExtendedLocation extendedLocation() {
return this.innerModel().extendedLocation();
}
public AgentPoolProvisioningState provisioningState() {
return this.innerModel().provisioningState();
}
public AgentPoolProvisioningStatusStatus status() {
return this.innerModel().status();
}
public Integer count() {
return this.innerModel().count();
}
public List<String> availabilityZones() {
List<String> inner = this.innerModel().availabilityZones();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public Integer maxCount() {
return this.innerModel().maxCount();
}
public Integer maxPods() {
return this.innerModel().maxPods();
}
public Integer minCount() {
return this.innerModel().minCount();
}
public Mode mode() {
return this.innerModel().mode();
}
public Map<String, String> nodeLabels() {
Map<String, String> inner = this.innerModel().nodeLabels();
if (inner != null) {
return Collections.unmodifiableMap(inner);
} else {
return Collections.emptyMap();
}
}
public List<String> nodeTaints() {
List<String> inner = this.innerModel().nodeTaints();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public OsType osType() {
return this.innerModel().osType();
}
public String nodeImageVersion() {
return this.innerModel().nodeImageVersion();
}
public String vmSize() {
return this.innerModel().vmSize();
}
public CloudProviderProfile cloudProviderProfile() {
return this.innerModel().cloudProviderProfile();
}
public Region region() {
return Region.fromName(this.regionName());
}
public String regionName() {
return this.location();
}
public String resourceGroupName() {
return resourceGroupName;
}
public AgentPoolInner innerModel() {
return this.innerObject;
}
private com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager manager() {
return this.serviceManager;
}
private String resourceGroupName;
private String resourceName;
private String agentPoolName;
public AgentPoolImpl withExistingProvisionedCluster(String resourceGroupName, String resourceName) {
this.resourceGroupName = resourceGroupName;
this.resourceName = resourceName;
return this;
}
public AgentPool create() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE);
return this;
}
public AgentPool create(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context);
return this;
}
AgentPoolImpl(
String name, com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager) {
this.innerObject = new AgentPoolInner();
this.serviceManager = serviceManager;
this.agentPoolName = name;
}
public AgentPoolImpl update() {
return this;
}
public AgentPool apply() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.updateWithResponse(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE)
.getValue();
return this;
}
public AgentPool apply(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.updateWithResponse(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context)
.getValue();
return this;
}
AgentPoolImpl(
AgentPoolInner innerObject,
com.azure.resourcemanager.hybridcontainerservice.HybridContainerServiceManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "provisionedClusters");
this.agentPoolName = Utils.getValueFromIdByName(innerObject.id(), "agentPools");
}
public AgentPool refresh() {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE)
.getValue();
return this;
}
public AgentPool refresh(Context context) {
this.innerObject =
serviceManager
.serviceClient()
.getAgentPools()
.getWithResponse(resourceGroupName, resourceName, agentPoolName, context)
.getValue();
return this;
}
public AgentPoolImpl withRegion(Region location) {
this.innerModel().withLocation(location.toString());
return this;
}
public AgentPoolImpl withRegion(String location) {
this.innerModel().withLocation(location);
return this;
}
public AgentPoolImpl withTags(Map<String, String> tags) {
this.innerModel().withTags(tags);
return this;
}
public AgentPoolImpl withExtendedLocation(AgentPoolExtendedLocation extendedLocation) {
this.innerModel().withExtendedLocation(extendedLocation);
return this;
}
public AgentPoolImpl withStatus(AgentPoolProvisioningStatusStatus status) {
this.innerModel().withStatus(status);
return this;
}
public AgentPoolImpl withCount(Integer count) {
this.innerModel().withCount(count);
return this;
}
public AgentPoolImpl withAvailabilityZones(List<String> availabilityZones) {
this.innerModel().withAvailabilityZones(availabilityZones);
return this;
}
public AgentPoolImpl withMaxCount(Integer maxCount) {
this.innerModel().withMaxCount(maxCount);
return this;
}
public AgentPoolImpl withMaxPods(Integer maxPods) {
this.innerModel().withMaxPods(maxPods);
return this;
}
public AgentPoolImpl withMinCount(Integer minCount) {
this.innerModel().withMinCount(minCount);
return this;
}
public AgentPoolImpl withMode(Mode mode) {
this.innerModel().withMode(mode);
return this;
}
public AgentPoolImpl withNodeLabels(Map<String, String> nodeLabels) {
this.innerModel().withNodeLabels(nodeLabels);
return this;
}
public AgentPoolImpl withNodeTaints(List<String> nodeTaints) {
this.innerModel().withNodeTaints(nodeTaints);
return this;
}
public AgentPoolImpl withOsType(OsType osType) {
this.innerModel().withOsType(osType);
return this;
}
public AgentPoolImpl withNodeImageVersion(String nodeImageVersion) {
this.innerModel().withNodeImageVersion(nodeImageVersion);
return this;
}
public AgentPoolImpl withVmSize(String vmSize) {
this.innerModel().withVmSize(vmSize);
return this;
}
public AgentPoolImpl withCloudProviderProfile(CloudProviderProfile cloudProviderProfile) {
this.innerModel().withCloudProviderProfile(cloudProviderProfile);
return this;
}
}
| 9,990 | 0.660661 | 0.660661 | 326 | 29.644173 | 27.867826 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.453988 | false | false | 2 |
fc40acfe951c8e0405890e2a97258998e7fc754c | 20,822,001,451,128 | e0d4bb5e8d8c3ea51dc514f37cb318d91bbf6012 | /bumblebee/src/main/java/br/com/bumblebee/resource/ModeloResource.java | 02192a347ea843c877627879028d009c832a09eb | [] | no_license | GilsonAlmeida/Bumblebee | https://github.com/GilsonAlmeida/Bumblebee | f467153d52a66b440d7884981e36e0e6c4f7dd0a | 7600ff799a9554f08914fb8cc6d96ea19e28d1ca | refs/heads/master | 2021-09-04T07:10:58.238000 | 2018-01-17T00:49:41 | 2018-01-17T00:49:41 | 114,752,087 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.bumblebee.resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import br.com.bumblebee.dto.Marcas;
public class ModeloResource {
@SuppressWarnings("unchecked")
public void getMarcas() throws JsonParseException, JsonMappingException, JsonProcessingException, IOException {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<? extends ArrayList<Marcas>> responseEntity = restTemplate.getForEntity(
"http://fipeapi.appspot.com/api/1/carros/marcas.json",
(Class<? extends ArrayList<Marcas>>) ArrayList.class);
ObjectMapper mapper = new ObjectMapper();
List<Marcas> marcas = mapper.readValue(mapper.writeValueAsString(responseEntity.getBody()),
new TypeReference<List<Marcas>>() {
});
}
}
| UTF-8 | Java | 1,163 | java | ModeloResource.java | Java | [] | null | [] | package br.com.bumblebee.resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import br.com.bumblebee.dto.Marcas;
public class ModeloResource {
@SuppressWarnings("unchecked")
public void getMarcas() throws JsonParseException, JsonMappingException, JsonProcessingException, IOException {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<? extends ArrayList<Marcas>> responseEntity = restTemplate.getForEntity(
"http://fipeapi.appspot.com/api/1/carros/marcas.json",
(Class<? extends ArrayList<Marcas>>) ArrayList.class);
ObjectMapper mapper = new ObjectMapper();
List<Marcas> marcas = mapper.readValue(mapper.writeValueAsString(responseEntity.getBody()),
new TypeReference<List<Marcas>>() {
});
}
}
| 1,163 | 0.798796 | 0.797936 | 35 | 32.228573 | 29.910423 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.371429 | false | false | 2 |
033edd88e04a3e303773c0a9e9db6145d78b1fa8 | 20,813,411,582,616 | e678b768aa5906110141a1d00dd9417f3bba563d | /myexaminer/src/main/java/com/myexaminer/dto/LecturerIndividualExamView.java | f43e1b8e40daef5225ecc73873ca34acfe0c918c | [] | no_license | SzymonSzymonowicz/projekt_zespolowy | https://github.com/SzymonSzymonowicz/projekt_zespolowy | afcf3e5f62450b3576bec10a6bbad6e5476e74cd | a1230aeeccd5917546808a5a70327de8fec9dece | refs/heads/main | 2023-03-20T20:38:52.736000 | 2021-06-18T08:57:10 | 2021-06-18T08:57:10 | 304,036,365 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.myexaminer.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class LecturerIndividualExamView {
private Long individualExamId;
private String name;
private String description;
private LocalDateTime availableFrom;
private Long teachingGroupId;
private String teachingGroupName;
private String studentIndex;
}
| UTF-8 | Java | 518 | java | LecturerIndividualExamView.java | Java | [] | null | [] | package com.myexaminer.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class LecturerIndividualExamView {
private Long individualExamId;
private String name;
private String description;
private LocalDateTime availableFrom;
private Long teachingGroupId;
private String teachingGroupName;
private String studentIndex;
}
| 518 | 0.793436 | 0.793436 | 29 | 16.862068 | 15.176489 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.448276 | false | false | 2 |
a79ca2673a574d7468b91b53e4d6e850b649faa7 | 29,686,814,008,376 | 35a9d8cd21021b79953921d40540a7ce41db432d | /MyVibe/build/generated/src/org/apache/jsp/home_jsp.java | fcbb3bd01c72a13820875c3b0b389085e929c79e | [] | no_license | MyVibe/myvibe | https://github.com/MyVibe/myvibe | abeff747a5cb4e36bf946132a9809b8ce8669e72 | 95f341722337313a3bdcd9e979c435b9a11b670b | refs/heads/master | 2016-09-08T01:29:19.997000 | 2014-03-05T15:06:03 | 2014-03-05T15:06:03 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("<!DOCTYPE html>\n");
out.write("<html lang=\"en\">\n");
out.write(" <head>\n");
out.write(" <meta charset=\"utf-8\">\n");
out.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
out.write(" <meta name=\"description\" content=\"\">\n");
out.write(" <meta name=\"author\" content=\"\">\n");
out.write(" <link rel=\"shortcut icon\" href=\"../../assets/ico/favicon.ico\">\n");
out.write(" <title>Carousel Template for Bootstrap</title>\n");
out.write(" <link href=\"CSS/bootstrap/bootstrap.min.css\" rel=\"stylesheet\">\n");
out.write("\n");
out.write(" \n");
out.write(" <link href=\"CSS/carousel.css\" rel=\"stylesheet\">\n");
out.write(" </head>\n");
out.write("<!-- NAVBAR\n");
out.write("================================================== -->\n");
out.write(" <body>\n");
out.write(" <div class=\"navbar-wrapper\">\n");
out.write(" <div class=\"container\">\n");
out.write("\n");
out.write(" <div class=\"navbar navbar-inverse navbar-static-top\" role=\"navigation\">\n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"navbar-header\">\n");
out.write(" <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n");
out.write(" <span class=\"sr-only\">Toggle navigation</span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" </button>\n");
out.write(" <a class=\"navbar-brand\" href=\"#\">MyVibe</a>\n");
out.write(" </div>\n");
out.write(" <div class=\"navbar-collapse collapse\">\n");
out.write(" <ul class=\"nav navbar-nav\">\n");
out.write(" <li class=\"active\"><a href=\"#\">Home</a></li>\n");
out.write(" <li><a href=\"muziek.jsp\">Zoek muziek</a></li>\n");
out.write(" <li><a href=\"account.jsp\">Mijn account</a></li>\n");
out.write(" \n");
out.write(" <li class=\"dropdown\">\n");
out.write(" <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Dropdown <b class=\"caret\"></b></a>\n");
out.write(" <ul class=\"dropdown-menu\">\n");
out.write(" <li><a href=\"#\">Action</a></li>\n");
out.write(" <li><a href=\"#\">Another action</a></li>\n");
out.write(" <li><a href=\"#\">Something else here</a></li>\n");
out.write(" <li class=\"divider\"></li>\n");
out.write(" <li class=\"dropdown-header\">Nav header</li>\n");
out.write(" <li><a href=\"#\">Separated link</a></li>\n");
out.write(" <li><a href=\"#\">One more separated link</a></li>\n");
out.write(" </ul>\n");
out.write(" </li>\n");
out.write(" </ul>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Carousel\n");
out.write(" ================================================== -->\n");
out.write(" <div id=\"myCarousel\" class=\"carousel slide\" data-ride=\"carousel\">\n");
out.write(" <!-- Indicators -->\n");
out.write(" <ol class=\"carousel-indicators\">\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"0\" class=\"active\"></li>\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"1\"></li>\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"2\"></li>\n");
out.write(" </ol>\n");
out.write(" <div class=\"carousel-inner\">\n");
out.write(" <div class=\"item active\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Welkom op MyVibe!</h1>\n");
out.write(" <img src=\"afbeeldingen/myvibe-logo.png\" height=\"250px\"/>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"item\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Ontdek exclusieve muziek.</h1>\n");
out.write(" <p> Luister als eerste naar de nieuwe hits van uw favoriete artiest! </p>\n");
out.write(" <img src=\"afbeeldingen/exclusive.png\" height=\"150px\"/>\n");
out.write(" <p><a class=\"btn btn-lg btn-primary\" href=\"muziek.jsp\" role=\"button\">Ontdek nu!</a></p>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"item\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Dé nummer 1 voor het allernieuwste!</h1>\n");
out.write(" <p> Onze uitgebreide collectie aan nieuwe en exclusieve muziek maakt van MyVibe dé muziekspecialist.</p>\n");
out.write(" <img src=\"afbeeldingen/website-van-het-jaar.png\" height=\"150px\"/>\n");
out.write(" \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <a class=\"left carousel-control\" href=\"#myCarousel\" data-slide=\"prev\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>\n");
out.write(" <a class=\"right carousel-control\" href=\"#myCarousel\" data-slide=\"next\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n");
out.write(" </div><!-- /.carousel -->\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Marketing messaging and featurettes\n");
out.write(" ================================================== -->\n");
out.write(" <!-- Wrap the rest of the page in another container to center all the content. -->\n");
out.write("\n");
out.write(" <div class=\"container marketing\">\n");
out.write("\n");
out.write(" <!-- Three columns of text below the carousel -->\n");
out.write(" <div class=\"row\">\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" src=\"afbeeldingen/daft-punk.png\" height=\"140px\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Daft punk</h2>\n");
out.write(" <p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" data-src=\"js/holder.js/140x140\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Heading</h2>\n");
out.write(" <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" data-src=\"js/holder.js/140x140\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Heading</h2>\n");
out.write(" <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" </div><!-- /.row -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- START THE FEATURETTES -->\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">First featurette heading. <span class=\"text-muted\">It'll blow your mind.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" src=\"afbeeldingen/nirvana.jpg\" height=\"500px\" width=\"500px\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" data-src=\"js/holder.js/500x500/auto\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">Oh yeah, it's that good. <span class=\"text-muted\">See for yourself.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">And lastly, this one. <span class=\"text-muted\">Checkmate.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" data-src=\"js/holder.js/500x500/auto\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <!-- /END THE FEATURETTES -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- FOOTER -->\n");
out.write(" <footer>\n");
out.write(" <p class=\"pull-right\"><a href=\"#\">Back to top</a></p>\n");
out.write(" <p>© 2014 Company, Inc. · <a href=\"#\">Privacy</a> · <a href=\"#\">Terms</a></p>\n");
out.write(" </footer>\n");
out.write("\n");
out.write(" </div><!-- /.container -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Bootstrap core JavaScript\n");
out.write(" ================================================== -->\n");
out.write(" <!-- Placed at the end of the document so the pages load faster -->\n");
out.write(" <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"></script>\n");
out.write(" <script src=\"js/bootstrap/bootstrap.min.js\"></script>\n");
out.write(" <script src=\"js/bootstrap/docs.min.js\"></script>\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| UTF-8 | Java | 15,483 | java | home_jsp.java | Java | [
{
"context": "ziek.</h1>\\n\");\n out.write(\" <p> Luister als eerste naar de nieuwe hits van uw favoriete a",
"end": 6700,
"score": 0.9970231056213379,
"start": 6693,
"tag": "NAME",
"value": "Luister"
}
] | null | [] | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("<!DOCTYPE html>\n");
out.write("<html lang=\"en\">\n");
out.write(" <head>\n");
out.write(" <meta charset=\"utf-8\">\n");
out.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
out.write(" <meta name=\"description\" content=\"\">\n");
out.write(" <meta name=\"author\" content=\"\">\n");
out.write(" <link rel=\"shortcut icon\" href=\"../../assets/ico/favicon.ico\">\n");
out.write(" <title>Carousel Template for Bootstrap</title>\n");
out.write(" <link href=\"CSS/bootstrap/bootstrap.min.css\" rel=\"stylesheet\">\n");
out.write("\n");
out.write(" \n");
out.write(" <link href=\"CSS/carousel.css\" rel=\"stylesheet\">\n");
out.write(" </head>\n");
out.write("<!-- NAVBAR\n");
out.write("================================================== -->\n");
out.write(" <body>\n");
out.write(" <div class=\"navbar-wrapper\">\n");
out.write(" <div class=\"container\">\n");
out.write("\n");
out.write(" <div class=\"navbar navbar-inverse navbar-static-top\" role=\"navigation\">\n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"navbar-header\">\n");
out.write(" <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n");
out.write(" <span class=\"sr-only\">Toggle navigation</span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" <span class=\"icon-bar\"></span>\n");
out.write(" </button>\n");
out.write(" <a class=\"navbar-brand\" href=\"#\">MyVibe</a>\n");
out.write(" </div>\n");
out.write(" <div class=\"navbar-collapse collapse\">\n");
out.write(" <ul class=\"nav navbar-nav\">\n");
out.write(" <li class=\"active\"><a href=\"#\">Home</a></li>\n");
out.write(" <li><a href=\"muziek.jsp\">Zoek muziek</a></li>\n");
out.write(" <li><a href=\"account.jsp\">Mijn account</a></li>\n");
out.write(" \n");
out.write(" <li class=\"dropdown\">\n");
out.write(" <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Dropdown <b class=\"caret\"></b></a>\n");
out.write(" <ul class=\"dropdown-menu\">\n");
out.write(" <li><a href=\"#\">Action</a></li>\n");
out.write(" <li><a href=\"#\">Another action</a></li>\n");
out.write(" <li><a href=\"#\">Something else here</a></li>\n");
out.write(" <li class=\"divider\"></li>\n");
out.write(" <li class=\"dropdown-header\">Nav header</li>\n");
out.write(" <li><a href=\"#\">Separated link</a></li>\n");
out.write(" <li><a href=\"#\">One more separated link</a></li>\n");
out.write(" </ul>\n");
out.write(" </li>\n");
out.write(" </ul>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Carousel\n");
out.write(" ================================================== -->\n");
out.write(" <div id=\"myCarousel\" class=\"carousel slide\" data-ride=\"carousel\">\n");
out.write(" <!-- Indicators -->\n");
out.write(" <ol class=\"carousel-indicators\">\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"0\" class=\"active\"></li>\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"1\"></li>\n");
out.write(" <li data-target=\"#myCarousel\" data-slide-to=\"2\"></li>\n");
out.write(" </ol>\n");
out.write(" <div class=\"carousel-inner\">\n");
out.write(" <div class=\"item active\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Welkom op MyVibe!</h1>\n");
out.write(" <img src=\"afbeeldingen/myvibe-logo.png\" height=\"250px\"/>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"item\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Ontdek exclusieve muziek.</h1>\n");
out.write(" <p> Luister als eerste naar de nieuwe hits van uw favoriete artiest! </p>\n");
out.write(" <img src=\"afbeeldingen/exclusive.png\" height=\"150px\"/>\n");
out.write(" <p><a class=\"btn btn-lg btn-primary\" href=\"muziek.jsp\" role=\"button\">Ontdek nu!</a></p>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"item\">\n");
out.write(" \n");
out.write(" <div class=\"container\">\n");
out.write(" <div class=\"carousel-caption\">\n");
out.write(" <h1>Dé nummer 1 voor het allernieuwste!</h1>\n");
out.write(" <p> Onze uitgebreide collectie aan nieuwe en exclusieve muziek maakt van MyVibe dé muziekspecialist.</p>\n");
out.write(" <img src=\"afbeeldingen/website-van-het-jaar.png\" height=\"150px\"/>\n");
out.write(" \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <a class=\"left carousel-control\" href=\"#myCarousel\" data-slide=\"prev\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>\n");
out.write(" <a class=\"right carousel-control\" href=\"#myCarousel\" data-slide=\"next\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n");
out.write(" </div><!-- /.carousel -->\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Marketing messaging and featurettes\n");
out.write(" ================================================== -->\n");
out.write(" <!-- Wrap the rest of the page in another container to center all the content. -->\n");
out.write("\n");
out.write(" <div class=\"container marketing\">\n");
out.write("\n");
out.write(" <!-- Three columns of text below the carousel -->\n");
out.write(" <div class=\"row\">\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" src=\"afbeeldingen/daft-punk.png\" height=\"140px\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Daft punk</h2>\n");
out.write(" <p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" data-src=\"js/holder.js/140x140\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Heading</h2>\n");
out.write(" <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" <div class=\"col-lg-4\">\n");
out.write(" <img class=\"img-circle\" data-src=\"js/holder.js/140x140\" alt=\"Generic placeholder image\">\n");
out.write(" <h2>Heading</h2>\n");
out.write(" <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>\n");
out.write(" <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details »</a></p>\n");
out.write(" </div><!-- /.col-lg-4 -->\n");
out.write(" </div><!-- /.row -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- START THE FEATURETTES -->\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">First featurette heading. <span class=\"text-muted\">It'll blow your mind.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" src=\"afbeeldingen/nirvana.jpg\" height=\"500px\" width=\"500px\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" data-src=\"js/holder.js/500x500/auto\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">Oh yeah, it's that good. <span class=\"text-muted\">See for yourself.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <div class=\"row featurette\">\n");
out.write(" <div class=\"col-md-7\">\n");
out.write(" <h2 class=\"featurette-heading\">And lastly, this one. <span class=\"text-muted\">Checkmate.</span></h2>\n");
out.write(" <p class=\"lead\">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>\n");
out.write(" </div>\n");
out.write(" <div class=\"col-md-5\">\n");
out.write(" <img class=\"featurette-image img-responsive\" data-src=\"js/holder.js/500x500/auto\" alt=\"Generic placeholder image\">\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" <hr class=\"featurette-divider\">\n");
out.write("\n");
out.write(" <!-- /END THE FEATURETTES -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- FOOTER -->\n");
out.write(" <footer>\n");
out.write(" <p class=\"pull-right\"><a href=\"#\">Back to top</a></p>\n");
out.write(" <p>© 2014 Company, Inc. · <a href=\"#\">Privacy</a> · <a href=\"#\">Terms</a></p>\n");
out.write(" </footer>\n");
out.write("\n");
out.write(" </div><!-- /.container -->\n");
out.write("\n");
out.write("\n");
out.write(" <!-- Bootstrap core JavaScript\n");
out.write(" ================================================== -->\n");
out.write(" <!-- Placed at the end of the document so the pages load faster -->\n");
out.write(" <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"></script>\n");
out.write(" <script src=\"js/bootstrap/bootstrap.min.js\"></script>\n");
out.write(" <script src=\"js/bootstrap/docs.min.js\"></script>\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| 15,483 | 0.525935 | 0.520057 | 252 | 60.432541 | 47.304897 | 282 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.051587 | false | false | 2 |
86c27f5b9dd75fd74a9ee1fb4b76183e31869d63 | 841,813,620,899 | f327e0933b931f4b80c0239befe96a5ddd808484 | /src/main/java/cn/qtech/mtf/modules/sevice/impl/AnswerServiceImpl.java | 4d9e6d3762847e04b3bfb2cba11eb9087d552b28 | [] | no_license | sleepyted/weAsk | https://github.com/sleepyted/weAsk | 50f8d5859ccccc8957fa606e7ab7bfad56366e53 | a613c460bf177a89488ad0d8934ea4fa8ac38682 | refs/heads/master | 2021-06-17T02:09:27.258000 | 2017-05-30T04:48:16 | 2017-05-30T04:48:16 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.qtech.mtf.modules.sevice.impl;
import cn.qtech.mtf.modules.dao.AnswerMapper;
import cn.qtech.mtf.modules.entity.Answer;
import cn.qtech.mtf.modules.sevice.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by mtf81 on 2017/4/8.
*/
@Service
public class AnswerServiceImpl implements AnswerService{
@Autowired
AnswerMapper answerMapper;
@Override
public int saveAnswer(Answer answer) {
int savedAnswerId = answerMapper.insertSelective(answer);
return savedAnswerId ;
}
@Override
public void delAnswer(Integer id) {
answerMapper.deleteByPrimaryKey(id);
}
@Override
public Answer getAnswerById(Integer id) {
return answerMapper.selectByPrimaryKey(id);
}
@Override
public List<Answer> getAnswerByQuestionId(Integer questionId) {
return answerMapper.getAnswersByQuestionId(questionId);
}
@Override
public List<Answer> getAnswerByUserId(Integer id) {
return null;
}
@Override
public List<Answer> getAllAnswer() {
return null;
}
}
| UTF-8 | Java | 1,091 | java | AnswerServiceImpl.java | Java | [
{
"context": "ervice;\n\nimport java.util.List;\n\n/**\n * Created by mtf81 on 2017/4/8.\n */\n@Service\npublic class AnswerServ",
"end": 340,
"score": 0.9994091391563416,
"start": 335,
"tag": "USERNAME",
"value": "mtf81"
}
] | null | [] | package cn.qtech.mtf.modules.sevice.impl;
import cn.qtech.mtf.modules.dao.AnswerMapper;
import cn.qtech.mtf.modules.entity.Answer;
import cn.qtech.mtf.modules.sevice.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by mtf81 on 2017/4/8.
*/
@Service
public class AnswerServiceImpl implements AnswerService{
@Autowired
AnswerMapper answerMapper;
@Override
public int saveAnswer(Answer answer) {
int savedAnswerId = answerMapper.insertSelective(answer);
return savedAnswerId ;
}
@Override
public void delAnswer(Integer id) {
answerMapper.deleteByPrimaryKey(id);
}
@Override
public Answer getAnswerById(Integer id) {
return answerMapper.selectByPrimaryKey(id);
}
@Override
public List<Answer> getAnswerByQuestionId(Integer questionId) {
return answerMapper.getAnswersByQuestionId(questionId);
}
@Override
public List<Answer> getAnswerByUserId(Integer id) {
return null;
}
@Override
public List<Answer> getAllAnswer() {
return null;
}
}
| 1,091 | 0.778185 | 0.770852 | 50 | 20.82 | 21.107052 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.98 | false | false | 2 |
4f1d7733ae5a229845a9cb2ec369f61a7ab0e3dc | 12,378,095,776,528 | 1c1083212aa4177bd561b0e97ac50df0db170fef | /SICNAP/src/net/cablen/recibos/controlador/Controller_lista_recibos.java | 39a5c6b8127a65371f77126ac95ea0bdc230dd57 | [] | no_license | remolacho/proyectoSicnap | https://github.com/remolacho/proyectoSicnap | d59ab101343d50bac94667fe521907aba1f44034 | 15467b05b5a183dcb78b7294e63d44eead509c69 | refs/heads/master | 2016-09-06T18:36:20.779000 | 2013-12-21T01:15:57 | 2013-12-21T01:15:57 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.cablen.recibos.controlador;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyVetoException;
import java.util.List;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JTable;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
import javax.swing.table.DefaultTableModel;
import net.cablen.caja.conciliaciones.vista.VistaConciliacion;
import net.cablen.helppers.Usuario;
import net.cablen.permisos.modelo.PermisosDao;
import net.cablen.principal.vistas.VisorMDI;
import net.cablen.principal.vistas.VistaMDI;
import net.cablen.promotor.modelo.Promotores;
import net.cablen.promotor.vistas.ListPromotor;
import net.cablen.recibos.modelo.Recibo;
import net.cablen.recibos.modelo.RecibosPromotor;
import net.cablen.recibos.vista.ListaProcRecibos;
import net.cablen.recibos.vista.VistaProcRecibos;
public class Controller_lista_recibos implements ActionListener,CaretListener,InternalFrameListener,MouseListener{
ListaProcRecibos vLista = null;
private VistaMDI vistaMdi;
private JDesktopPane content;
private PermisosDao perDao;
private Promotores promotor;
public Controller_lista_recibos(ListaProcRecibos vista) {
this.vLista = vista;
this.vistaMdi = VisorMDI.getFrmMenu();
this.content = vistaMdi.formMdi;
this.perDao = new PermisosDao();
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == vLista.getrEnte()){
vLista.getBtmEnte().setEnabled(true);
vLista.getBtmRecibo().setEnabled(false);
vLista.getTxtRecibo().setText("");
vLista.getTxtRecibo().setEnabled(false);
}
if (e.getSource() == vLista.getrRecibo()){
vLista.getBtmRecibo().setEnabled(true);
vLista.getBtmEnte().setEnabled(false);
vLista.getTxtRecibo().setEnabled(true);
vLista.getTxtEnte().setText("");
}
if (e.getSource() == vLista.getrTodos()){
vLista.getBtmRecibo().setEnabled(false);
vLista.getBtmEnte().setEnabled(false);
vLista.getTxtRecibo().setEnabled(false);
vLista.getTxtRecibo().setText("");
vLista.getTxtEnte().setText("");
List<RecibosPromotor> lista=null;
Recibo recibo = new Recibo();
lista = recibo.listByEstatus(0);
cargarTabla(lista);
recibo = null;
}
if (e.getSource() == vLista.getBtmRecibo()){
List<RecibosPromotor> recibos;
Recibo modelo = new Recibo();
try {
recibos = modelo.listByRecibo(Long.parseLong(vLista.getTxtRecibo().getText()), 0);
cargarTabla(recibos);
} catch (Exception e2) {
// TODO: handle exception
}
modelo = null;
recibos = null;
}
if (e.getSource() == vLista.getBtmEnte()){
if(perDao.Acceso("ListPromotor") == 1){
ListPromotor listaPro = new ListPromotor("Lista de Entes",vLista);
centrarFrm (listaPro,vistaMdi);
content.add(listaPro);// Agregamos el frame al escritorio
try {
listaPro.setSelected(true);// Decimos que comience Enfocado
}
catch (PropertyVetoException e1) {}
//vPrecintos.dispose();
}
}
}
@Override
public void caretUpdate(CaretEvent e) {
if(e.getSource() == vLista.getTxtEnte()){
List<RecibosPromotor> lista = null;
Recibo recibo = new Recibo();
try {
lista = recibo.listByPromotor(Integer.parseInt(vLista.getTxtEnte().getText()), 0);
cargarTabla(lista);
} catch (Exception e2) {
// TODO: handle exception
}
recibo = null;
lista = null;
}
}
@Override
public void internalFrameActivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameClosed(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameClosing(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameDeactivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameDeiconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameIconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameOpened(InternalFrameEvent e) {
List<RecibosPromotor> lista=null;
Recibo recibo = new Recibo();
try {
lista = recibo.listByEstatus(0);
cargarTabla(lista);
} catch (Exception e2) {
// TODO: handle exception
}
recibo = null;
}
private void cargarTabla(List<RecibosPromotor> lista){
DefaultTableModel modelo = new DefaultTableModel();
JTable tabla = this.vLista.getTable();
Object data [] = new Object[4];
modelo.addColumn("N° Recibo");
modelo.addColumn("Cedula");
modelo.addColumn("Ente");
modelo.addColumn("Estatus");
for (int i=0;i<lista.size();i++){
data[0] = lista.get(i).getCodigoRecibo();
data[1] = lista.get(i).getPromotor().getCedula();
data[2] = lista.get(i).getPromotor().getNombre() + " " + lista.get(i).getPromotor().getApellido();
data[3] = lista.get(i).getEstatus();
modelo.addRow(data);
}
tabla.setModel(modelo);
this.vLista.setTable(tabla);
}
public void centrarFrm (JInternalFrame hijo ,VistaMDI padre){
hijo.setLocation(padre.getWidth()/2 - hijo.getWidth()/2 ,
padre.getHeight()/2 - hijo.getHeight()/2 - 20);
// CENTRA EL FORMULARIO
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2){
if (e.getSource() == vLista.getTable()){
int indice = vLista.getTable().getSelectedRow();
long codigo = (long) vLista.getTable().getValueAt(indice,0);
VistaProcRecibos vProc = new VistaProcRecibos("Procesar Recibo");
vProc.getLblRecibo().setText(Long.toString(codigo));
centrarFrm (vProc, VisorMDI.getFrmMenu());
content.add(vProc);// Agregamos el frame al escritorio
try {
vProc.setSelected(true);// Decimos que comience Enfocado
}
catch (PropertyVetoException e1) {}
}
}
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
}
}
| WINDOWS-1252 | Java | 6,795 | java | Controller_lista_recibos.java | Java | [] | null | [] | package net.cablen.recibos.controlador;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyVetoException;
import java.util.List;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JTable;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
import javax.swing.table.DefaultTableModel;
import net.cablen.caja.conciliaciones.vista.VistaConciliacion;
import net.cablen.helppers.Usuario;
import net.cablen.permisos.modelo.PermisosDao;
import net.cablen.principal.vistas.VisorMDI;
import net.cablen.principal.vistas.VistaMDI;
import net.cablen.promotor.modelo.Promotores;
import net.cablen.promotor.vistas.ListPromotor;
import net.cablen.recibos.modelo.Recibo;
import net.cablen.recibos.modelo.RecibosPromotor;
import net.cablen.recibos.vista.ListaProcRecibos;
import net.cablen.recibos.vista.VistaProcRecibos;
public class Controller_lista_recibos implements ActionListener,CaretListener,InternalFrameListener,MouseListener{
ListaProcRecibos vLista = null;
private VistaMDI vistaMdi;
private JDesktopPane content;
private PermisosDao perDao;
private Promotores promotor;
public Controller_lista_recibos(ListaProcRecibos vista) {
this.vLista = vista;
this.vistaMdi = VisorMDI.getFrmMenu();
this.content = vistaMdi.formMdi;
this.perDao = new PermisosDao();
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == vLista.getrEnte()){
vLista.getBtmEnte().setEnabled(true);
vLista.getBtmRecibo().setEnabled(false);
vLista.getTxtRecibo().setText("");
vLista.getTxtRecibo().setEnabled(false);
}
if (e.getSource() == vLista.getrRecibo()){
vLista.getBtmRecibo().setEnabled(true);
vLista.getBtmEnte().setEnabled(false);
vLista.getTxtRecibo().setEnabled(true);
vLista.getTxtEnte().setText("");
}
if (e.getSource() == vLista.getrTodos()){
vLista.getBtmRecibo().setEnabled(false);
vLista.getBtmEnte().setEnabled(false);
vLista.getTxtRecibo().setEnabled(false);
vLista.getTxtRecibo().setText("");
vLista.getTxtEnte().setText("");
List<RecibosPromotor> lista=null;
Recibo recibo = new Recibo();
lista = recibo.listByEstatus(0);
cargarTabla(lista);
recibo = null;
}
if (e.getSource() == vLista.getBtmRecibo()){
List<RecibosPromotor> recibos;
Recibo modelo = new Recibo();
try {
recibos = modelo.listByRecibo(Long.parseLong(vLista.getTxtRecibo().getText()), 0);
cargarTabla(recibos);
} catch (Exception e2) {
// TODO: handle exception
}
modelo = null;
recibos = null;
}
if (e.getSource() == vLista.getBtmEnte()){
if(perDao.Acceso("ListPromotor") == 1){
ListPromotor listaPro = new ListPromotor("Lista de Entes",vLista);
centrarFrm (listaPro,vistaMdi);
content.add(listaPro);// Agregamos el frame al escritorio
try {
listaPro.setSelected(true);// Decimos que comience Enfocado
}
catch (PropertyVetoException e1) {}
//vPrecintos.dispose();
}
}
}
@Override
public void caretUpdate(CaretEvent e) {
if(e.getSource() == vLista.getTxtEnte()){
List<RecibosPromotor> lista = null;
Recibo recibo = new Recibo();
try {
lista = recibo.listByPromotor(Integer.parseInt(vLista.getTxtEnte().getText()), 0);
cargarTabla(lista);
} catch (Exception e2) {
// TODO: handle exception
}
recibo = null;
lista = null;
}
}
@Override
public void internalFrameActivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameClosed(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameClosing(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameDeactivated(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameDeiconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameIconified(InternalFrameEvent e) {
// TODO Auto-generated method stub
}
@Override
public void internalFrameOpened(InternalFrameEvent e) {
List<RecibosPromotor> lista=null;
Recibo recibo = new Recibo();
try {
lista = recibo.listByEstatus(0);
cargarTabla(lista);
} catch (Exception e2) {
// TODO: handle exception
}
recibo = null;
}
private void cargarTabla(List<RecibosPromotor> lista){
DefaultTableModel modelo = new DefaultTableModel();
JTable tabla = this.vLista.getTable();
Object data [] = new Object[4];
modelo.addColumn("N° Recibo");
modelo.addColumn("Cedula");
modelo.addColumn("Ente");
modelo.addColumn("Estatus");
for (int i=0;i<lista.size();i++){
data[0] = lista.get(i).getCodigoRecibo();
data[1] = lista.get(i).getPromotor().getCedula();
data[2] = lista.get(i).getPromotor().getNombre() + " " + lista.get(i).getPromotor().getApellido();
data[3] = lista.get(i).getEstatus();
modelo.addRow(data);
}
tabla.setModel(modelo);
this.vLista.setTable(tabla);
}
public void centrarFrm (JInternalFrame hijo ,VistaMDI padre){
hijo.setLocation(padre.getWidth()/2 - hijo.getWidth()/2 ,
padre.getHeight()/2 - hijo.getHeight()/2 - 20);
// CENTRA EL FORMULARIO
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2){
if (e.getSource() == vLista.getTable()){
int indice = vLista.getTable().getSelectedRow();
long codigo = (long) vLista.getTable().getValueAt(indice,0);
VistaProcRecibos vProc = new VistaProcRecibos("Procesar Recibo");
vProc.getLblRecibo().setText(Long.toString(codigo));
centrarFrm (vProc, VisorMDI.getFrmMenu());
content.add(vProc);// Agregamos el frame al escritorio
try {
vProc.setSelected(true);// Decimos que comience Enfocado
}
catch (PropertyVetoException e1) {}
}
}
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
}
}
| 6,795 | 0.678393 | 0.67486 | 261 | 24.030651 | 22.125534 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.226054 | false | false | 2 |
e31f3cd6adda4c1be6ee222da125483cc53de2ed | 24,524,263,297,137 | e152c5a3f281b1210eec87eeaab6e505b251a455 | /src/main/java/mxc/sdk/lock/single/SingleLock.java | c0377629afbee53c00f5607012ef284fef97d54b | [] | no_license | mxchong/easylock | https://github.com/mxchong/easylock | e9736a79e62f5df542747a6a46bab1d9ca4c2a10 | f3b978c94831e264fd2a4e5d6e814ae0e1330dcd | refs/heads/master | 2022-06-30T05:41:10.487000 | 2019-07-11T03:13:34 | 2019-07-11T03:13:34 | 195,847,678 | 1 | 0 | null | false | 2022-06-21T01:26:09 | 2019-07-08T16:15:33 | 2020-04-17T09:06:51 | 2022-06-21T01:26:06 | 12 | 1 | 0 | 2 | Java | false | false | package mxc.sdk.lock.single;
/**
* @Description synchronized用法1
* @Author chenkaideng
* @Date 2019/7/3
**/
public class SingleLock implements Runnable{
public static int NUM = 0;
public static synchronized void increaseI() {
NUM ++;
}
public synchronized void increaseII() {
NUM ++;
}
public void run() {
for (int j = 0; j < 100000; j++) {
increaseI();
// increaseII();
}
}
public static void main (String[] args) throws InterruptedException{
SingleLock singleLock = new SingleLock();
Thread thread1 = new Thread(new SingleLock());
Thread thread2 = new Thread(new SingleLock());
thread1.start();
thread2.start();
thread1.join();
thread2.join();
System.out.println(SingleLock.NUM);
}
} | UTF-8 | Java | 853 | java | SingleLock.java | Java | [
{
"context": "e;\n\n/**\n * @Description synchronized用法1\n * @Author chenkaideng\n * @Date 2019/7/3\n **/\npublic class SingleLock im",
"end": 88,
"score": 0.9823217391967773,
"start": 77,
"tag": "USERNAME",
"value": "chenkaideng"
}
] | null | [] | package mxc.sdk.lock.single;
/**
* @Description synchronized用法1
* @Author chenkaideng
* @Date 2019/7/3
**/
public class SingleLock implements Runnable{
public static int NUM = 0;
public static synchronized void increaseI() {
NUM ++;
}
public synchronized void increaseII() {
NUM ++;
}
public void run() {
for (int j = 0; j < 100000; j++) {
increaseI();
// increaseII();
}
}
public static void main (String[] args) throws InterruptedException{
SingleLock singleLock = new SingleLock();
Thread thread1 = new Thread(new SingleLock());
Thread thread2 = new Thread(new SingleLock());
thread1.start();
thread2.start();
thread1.join();
thread2.join();
System.out.println(SingleLock.NUM);
}
} | 853 | 0.578327 | 0.553592 | 37 | 21.972973 | 19.080889 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.432432 | false | false | 2 |
2801a8ee451b556883bdb55c794dd365f7e928e4 | 4,389,456,609,976 | 93b210724d5e1b9a1b2b89c64c12d8582135f2aa | /EliteCSM-new/Applications/nvsmx/src/com/elitecore/nvsmx/pd/controller/guiding/GuidingCTRL.java | 0477be56ed0cc5c71b00307f72efdd90c5782723 | [] | no_license | sunilkumarpvns/newbrs | https://github.com/sunilkumarpvns/newbrs | e6b205a41898b25203f34a902d1334a83baafb09 | 38e8c22ea5deaee2e46938970be405a307918ce7 | refs/heads/master | 2021-06-17T08:45:52.964000 | 2019-08-21T02:58:00 | 2019-08-21T02:58:00 | 203,326,404 | 0 | 0 | null | false | 2021-05-12T00:24:10 | 2019-08-20T07:47:41 | 2019-08-21T03:00:28 | 2021-05-12T00:24:10 | 252,939 | 0 | 0 | 10 | Java | false | false | package com.elitecore.nvsmx.pd.controller.guiding;
import static com.opensymphony.xwork2.Action.SUCCESS;
import java.sql.Timestamp;
import java.util.List;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.validation.SkipValidation;
import com.elitecore.corenetvertex.constants.CommonConstants;
import com.elitecore.corenetvertex.constants.TrafficType;
import com.elitecore.commons.base.Collectionz;
import com.elitecore.corenetvertex.pd.account.AccountData;
import com.elitecore.corenetvertex.pd.guiding.GuidingData;
import com.elitecore.corenetvertex.pd.lob.LobData;
import com.elitecore.corenetvertex.pd.service.ServiceData;
import com.elitecore.corenetvertex.pkg.constants.ACLModules;
import com.elitecore.corenetvertex.util.GsonFactory;
import com.elitecore.nvsmx.sm.controller.RestGenericCTRL;
import com.elitecore.nvsmx.system.hibernate.CRUDOperationUtil;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
/**
* Created by ajay pandey on 23/12/17.
*/
@ParentPackage(value = "pd")
@Namespace("/pd/guiding")
@Results({
@Result(name= SUCCESS, type="redirectAction",params = {"actionName","guiding"}),
})
public class GuidingCTRL extends RestGenericCTRL<GuidingData> {
private static final long serialVersionUID = -6882470730134447721L;
private List<LobData> lobDataList = Collectionz.newArrayList();
private List<ServiceData> serviceDataList = Collectionz.newArrayList();
private List<AccountData> accountDataList = Collectionz.newArrayList();
private List<String> trafficTypeList= Collectionz.newArrayList();
@Override
public ACLModules getModule() {
return ACLModules.GUIDING;
}
@Override
public GuidingData createModel() {
return new GuidingData();
}
@Override
public void validate() {
GuidingData guidingData = (GuidingData) getModel();
boolean isAlreadyExist = isDuplicateEntity("guidingName", guidingData.getResourceName(), getMethodName());
if(isAlreadyExist){
addFieldError("guidingName", getText("guiding.name.duplicate"));
}
else{
LobData lobData = CRUDOperationUtil.get(LobData.class, guidingData.getLobId());
ServiceData serviceData = CRUDOperationUtil.get(ServiceData.class, guidingData.getServiceId());
AccountData accountData = CRUDOperationUtil.get(AccountData.class, guidingData.getAccountId());
if (lobData == null) {
addFieldError("lobId", getText("guiding.lob.invalid"));
}
if(serviceData == null){
addFieldError("serviceId", getText("guiding.service.invalid"));
}
if(accountData == null){
addFieldError("accountId", getText("guiding.account.invalid"));
}
Timestamp endDate = guidingData.getEndDate();
if(endDate!=null){
long startDateTime = guidingData.getStartDate().getTime();
if((endDate.getTime() - startDateTime) < CommonConstants.TEN_MINUTES){
addFieldError("endDate", getText("guiding.enddate.mustbe.greaterthan.startdate"));
}
}
}
}
@SkipValidation
@Override
public void prepareValuesForSubClass() throws Exception {
setLobDataList(CRUDOperationUtil.findAll(LobData.class));
setServiceDataList(CRUDOperationUtil.findAll(ServiceData.class));
setAccountDataList(CRUDOperationUtil.findAll(AccountData.class));
}
public List<LobData> getLobDataList() {
return lobDataList;
}
public void setLobDataList(List<LobData> lobDataList) {
this.lobDataList = lobDataList;
}
public List<ServiceData> getServiceDataList() {
return serviceDataList;
}
public void setServiceDataList(List<ServiceData> serviceDataList) {
this.serviceDataList = serviceDataList;
}
public List<AccountData> getAccountDataList() {
return accountDataList;
}
public void setAccountDataList(List<AccountData> accountDataList) {
this.accountDataList = accountDataList;
}
public List<String> getTrafficTypeList() {
return trafficTypeList;
}
public void setTrafficTypeList(List<String> trafficTypeList) {
this.trafficTypeList = trafficTypeList;
}
public String getTrafficTypeListAsJson() {
Gson gson = GsonFactory.defaultInstance();
TrafficType[] trafficType = TrafficType.values();
for(TrafficType traType: trafficType)
{
trafficTypeList.add(traType.getVal());
}
JsonArray modelJson = gson.toJsonTree(trafficTypeList,new TypeToken<List<String>>() {}.getType()).getAsJsonArray();
return modelJson.toString();
}
}
| UTF-8 | Java | 4,854 | java | GuidingCTRL.java | Java | [
{
"context": ".google.gson.reflect.TypeToken;\n\n/**\n * Created by ajay pandey on 23/12/17.\n */\n\n\n@ParentPackage(value = \"pd\")\n@",
"end": 1223,
"score": 0.9917704463005066,
"start": 1212,
"tag": "NAME",
"value": "ajay pandey"
}
] | null | [] | package com.elitecore.nvsmx.pd.controller.guiding;
import static com.opensymphony.xwork2.Action.SUCCESS;
import java.sql.Timestamp;
import java.util.List;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.validation.SkipValidation;
import com.elitecore.corenetvertex.constants.CommonConstants;
import com.elitecore.corenetvertex.constants.TrafficType;
import com.elitecore.commons.base.Collectionz;
import com.elitecore.corenetvertex.pd.account.AccountData;
import com.elitecore.corenetvertex.pd.guiding.GuidingData;
import com.elitecore.corenetvertex.pd.lob.LobData;
import com.elitecore.corenetvertex.pd.service.ServiceData;
import com.elitecore.corenetvertex.pkg.constants.ACLModules;
import com.elitecore.corenetvertex.util.GsonFactory;
import com.elitecore.nvsmx.sm.controller.RestGenericCTRL;
import com.elitecore.nvsmx.system.hibernate.CRUDOperationUtil;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
/**
* Created by <NAME> on 23/12/17.
*/
@ParentPackage(value = "pd")
@Namespace("/pd/guiding")
@Results({
@Result(name= SUCCESS, type="redirectAction",params = {"actionName","guiding"}),
})
public class GuidingCTRL extends RestGenericCTRL<GuidingData> {
private static final long serialVersionUID = -6882470730134447721L;
private List<LobData> lobDataList = Collectionz.newArrayList();
private List<ServiceData> serviceDataList = Collectionz.newArrayList();
private List<AccountData> accountDataList = Collectionz.newArrayList();
private List<String> trafficTypeList= Collectionz.newArrayList();
@Override
public ACLModules getModule() {
return ACLModules.GUIDING;
}
@Override
public GuidingData createModel() {
return new GuidingData();
}
@Override
public void validate() {
GuidingData guidingData = (GuidingData) getModel();
boolean isAlreadyExist = isDuplicateEntity("guidingName", guidingData.getResourceName(), getMethodName());
if(isAlreadyExist){
addFieldError("guidingName", getText("guiding.name.duplicate"));
}
else{
LobData lobData = CRUDOperationUtil.get(LobData.class, guidingData.getLobId());
ServiceData serviceData = CRUDOperationUtil.get(ServiceData.class, guidingData.getServiceId());
AccountData accountData = CRUDOperationUtil.get(AccountData.class, guidingData.getAccountId());
if (lobData == null) {
addFieldError("lobId", getText("guiding.lob.invalid"));
}
if(serviceData == null){
addFieldError("serviceId", getText("guiding.service.invalid"));
}
if(accountData == null){
addFieldError("accountId", getText("guiding.account.invalid"));
}
Timestamp endDate = guidingData.getEndDate();
if(endDate!=null){
long startDateTime = guidingData.getStartDate().getTime();
if((endDate.getTime() - startDateTime) < CommonConstants.TEN_MINUTES){
addFieldError("endDate", getText("guiding.enddate.mustbe.greaterthan.startdate"));
}
}
}
}
@SkipValidation
@Override
public void prepareValuesForSubClass() throws Exception {
setLobDataList(CRUDOperationUtil.findAll(LobData.class));
setServiceDataList(CRUDOperationUtil.findAll(ServiceData.class));
setAccountDataList(CRUDOperationUtil.findAll(AccountData.class));
}
public List<LobData> getLobDataList() {
return lobDataList;
}
public void setLobDataList(List<LobData> lobDataList) {
this.lobDataList = lobDataList;
}
public List<ServiceData> getServiceDataList() {
return serviceDataList;
}
public void setServiceDataList(List<ServiceData> serviceDataList) {
this.serviceDataList = serviceDataList;
}
public List<AccountData> getAccountDataList() {
return accountDataList;
}
public void setAccountDataList(List<AccountData> accountDataList) {
this.accountDataList = accountDataList;
}
public List<String> getTrafficTypeList() {
return trafficTypeList;
}
public void setTrafficTypeList(List<String> trafficTypeList) {
this.trafficTypeList = trafficTypeList;
}
public String getTrafficTypeListAsJson() {
Gson gson = GsonFactory.defaultInstance();
TrafficType[] trafficType = TrafficType.values();
for(TrafficType traType: trafficType)
{
trafficTypeList.add(traType.getVal());
}
JsonArray modelJson = gson.toJsonTree(trafficTypeList,new TypeToken<List<String>>() {}.getType()).getAsJsonArray();
return modelJson.toString();
}
}
| 4,849 | 0.731562 | 0.725175 | 145 | 32.46207 | 29.272093 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.055172 | false | false | 2 |
d1e2bb96b96fba97adce4f383166ea971d71f10b | 18,872,086,326,367 | 59adfe3b5fb3d7626217c0e93dddb2d27e6dbff3 | /iwkc-api/src/main/java/com/guppy/api/config/rest/RestConfigProperties.java | ece82f8f6a67e943732d4b7965d0b71c242ef2d0 | [] | no_license | wckhg89/iwkc | https://github.com/wckhg89/iwkc | caa15f8df1f5ae51a761dbccf64a03ffb388d41c | 233d72a75d4a4747d7d9c0b8f882cea9ba884637 | refs/heads/master | 2020-03-22T15:16:08.232000 | 2018-07-14T03:34:22 | 2018-07-14T03:34:22 | 140,239,648 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.guppy.api.config.rest;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Created by guppy.kang on 2018. 7. 14.
* email : guppy.kang@kakaocorp.com
*/
@Getter
@Setter
@ConfigurationProperties(prefix = "iwkc.rest.config")
public class RestConfigProperties {
private int readTimeOut = 2000;
private int connectionTimeOut = 2000;
private int maxConnectionPerRoute = 2;
private int maxConnectionPool = 20;
}
| UTF-8 | Java | 516 | java | RestConfigProperties.java | Java | [
{
"context": "erties.ConfigurationProperties;\n\n/**\n * Created by guppy.kang on 2018. 7. 14.\n * email : guppy.kang@kakaocorp.c",
"end": 185,
"score": 0.9985652565956116,
"start": 175,
"tag": "USERNAME",
"value": "guppy.kang"
},
{
"context": "* Created by guppy.kang on 2018. 7. 14.\n * email : guppy.kang@kakaocorp.com\n */\n\n@Getter\n@Setter\n@ConfigurationProperties(pre",
"end": 237,
"score": 0.9999306201934814,
"start": 213,
"tag": "EMAIL",
"value": "guppy.kang@kakaocorp.com"
}
] | null | [] | package com.guppy.api.config.rest;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Created by guppy.kang on 2018. 7. 14.
* email : <EMAIL>
*/
@Getter
@Setter
@ConfigurationProperties(prefix = "iwkc.rest.config")
public class RestConfigProperties {
private int readTimeOut = 2000;
private int connectionTimeOut = 2000;
private int maxConnectionPerRoute = 2;
private int maxConnectionPool = 20;
}
| 499 | 0.751938 | 0.717054 | 24 | 20.5 | 21.158134 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 2 |
fbea96c6ecdcc7144ddc3c10d0e350ef25a25852 | 3,092,376,491,357 | afa88ee5cbf6dcbb83706ea847bbc37d649e8b89 | /pre-dojo/src/main/java/br/agrego/predojo/model/Placar.java | 7908b5dd3b1c792151d8d6cf4f07760a00c075ad | [] | no_license | andreygalassi/pre-dojo | https://github.com/andreygalassi/pre-dojo | cde56734769d057ca34f4a808a4d4f9da03d2e45 | 893c1bec23357dc7d2480f7ca0f320cdaf5d4837 | refs/heads/master | 2020-12-25T16:02:51.129000 | 2016-02-27T15:12:19 | 2016-02-27T15:12:19 | 52,455,774 | 0 | 0 | null | true | 2016-02-24T16:12:20 | 2016-02-24T16:12:20 | 2015-10-14T04:08:57 | 2016-02-07T11:02:15 | 487 | 0 | 0 | 0 | null | null | null | package br.agrego.predojo.model;
/**
* Placar de cada um jogador
* Informa a quantidade de assassinatos e mortes do jogador
* @author Andrey Galassi
*
*/
public class Placar {
private Jogador jogador;
private int mortes;
private int assassinatos;
public Placar(Jogador jogador) {
this.jogador = jogador;
}
public int getMortes() {
return mortes;
}
public void setMortes(int mortes) {
this.mortes = mortes;
}
public int getAssassinatos() {
return assassinatos;
}
public void setAssassinatos(int assassinatos) {
this.assassinatos = assassinatos;
}
public Jogador getJogador() {
return jogador;
}
public void setJogador(Jogador jogador) {
this.jogador = jogador;
}
public void incrementaMorte() {
mortes++;
}
public void incrementaAssassinatos() {
assassinatos++;
}
@Override
public String toString() {
return String.format("Jogador %10s: Assassinatos: %-5s Mortes: %-5s ", jogador.getNome(),assassinatos,mortes);
}
}
| UTF-8 | Java | 974 | java | Placar.java | Java | [
{
"context": "ade de assassinatos e mortes do jogador\n * @author Andrey Galassi\n *\n */\npublic class Placar {\n\n\tprivate Jogador jo",
"end": 152,
"score": 0.9997068643569946,
"start": 138,
"tag": "NAME",
"value": "Andrey Galassi"
}
] | null | [] | package br.agrego.predojo.model;
/**
* Placar de cada um jogador
* Informa a quantidade de assassinatos e mortes do jogador
* @author <NAME>
*
*/
public class Placar {
private Jogador jogador;
private int mortes;
private int assassinatos;
public Placar(Jogador jogador) {
this.jogador = jogador;
}
public int getMortes() {
return mortes;
}
public void setMortes(int mortes) {
this.mortes = mortes;
}
public int getAssassinatos() {
return assassinatos;
}
public void setAssassinatos(int assassinatos) {
this.assassinatos = assassinatos;
}
public Jogador getJogador() {
return jogador;
}
public void setJogador(Jogador jogador) {
this.jogador = jogador;
}
public void incrementaMorte() {
mortes++;
}
public void incrementaAssassinatos() {
assassinatos++;
}
@Override
public String toString() {
return String.format("Jogador %10s: Assassinatos: %-5s Mortes: %-5s ", jogador.getNome(),assassinatos,mortes);
}
}
| 966 | 0.710472 | 0.706366 | 49 | 18.87755 | 20.183477 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.326531 | false | false | 2 |
7ad04c8b7e9bd1e860990b04e19992663285292a | 6,519,760,406,156 | 5040702c3cc0cd57c58e27da92b7f4d61f145d4e | /axon-producer/src/main/java/com/axonkafka/domain/Catalog.java | a8f0eab84ed55da8728e750943722ddb674f370f | [] | no_license | akanzari/sample-axon-kafka | https://github.com/akanzari/sample-axon-kafka | 007781f6b90088a93334f77f372e90e22f3a97c3 | af9191d86291ec72a145fc8a8dc1992d7b2455f3 | refs/heads/master | 2022-12-12T04:30:28.424000 | 2020-09-12T11:28:50 | 2020-09-12T11:28:50 | 293,070,095 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.axonkafka.domain;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.FieldDefaults;
@Entity
@Indexed
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class Catalog implements Serializable {
static final long serialVersionUID = 1L;
@Id
String catalogId;
@Field
String name;
String description;
@ElementCollection
Set<Product> products;
} | UTF-8 | Java | 823 | java | Catalog.java | Java | [] | null | [] | package com.axonkafka.domain;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.FieldDefaults;
@Entity
@Indexed
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class Catalog implements Serializable {
static final long serialVersionUID = 1L;
@Id
String catalogId;
@Field
String name;
String description;
@ElementCollection
Set<Product> products;
} | 823 | 0.81774 | 0.816525 | 44 | 17.727272 | 15.526171 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.636364 | false | false | 2 |
ec0efab632536a65e0b872893a0d063160c5e84c | 26,525,718,043,380 | 2bf1a287c7bf30ab888e0f25fabcd8148d9d4316 | /app/src/main/java/com/groupsix/lang_circle_10/HomeFragment.java | 2105af03a6d65e18705722f3b1d6b5509239d471 | [] | no_license | benny1hk/Lang-Circle-1.0-master | https://github.com/benny1hk/Lang-Circle-1.0-master | 027f5b2316446028273bf8be45c607314713192e | 7abab6bc3af866def386d5670991413c35c2da38 | HEAD | 2016-08-11T21:30:44.756000 | 2016-03-13T18:14:23 | 2016-03-13T18:16:00 | 53,799,076 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.groupsix.lang_circle_10;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
/**
* Created by zhangenjie on 16/3/6.
*/
public class HomeFragment extends Fragment {
public static MainActivity mMainActivity;
private List<String> mDatas = new ArrayList<String>(Arrays.asList("Java", "Javascript", "C++", "Ruby", "Json",
"HTML"));
private List<Map<String, String>> contents;
private Map<String,String> item;
ListviewAdapter mAdapter;
private PullToRefreshListView pullToRefreshListView;
public static HomeFragment newInstance(MainActivity m) {
HomeFragment homeFragment = new HomeFragment();
mMainActivity = m;
return homeFragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.home_fragment, container, false);
item=new HashMap<>();
contents=new ArrayList<>();
item.put("1","This is a Sample question?\n\n\n");
contents.add(item);
contents.add(item);
contents.add(item);
contents.add(item);
contents.add(item);
pullToRefreshListView = (PullToRefreshListView) view.findViewById(R.id.listview_home);
pullToRefreshListView.setMode(PullToRefreshBase.Mode.BOTH);
ListView actualListView = pullToRefreshListView.getRefreshableView();
pullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
//dont update data here
}
});
pullToRefreshListView.setOnPullEventListener(new PullToRefreshBase.OnPullEventListener<ListView>() {
@Override
public void onPullEvent(PullToRefreshBase<ListView> refreshView
, PullToRefreshBase.State state, PullToRefreshBase.Mode direction) {
new GetDataTask().execute();
}
});
mAdapter = new ListviewAdapter(mMainActivity, R.layout.list_view_item_home, contents);
actualListView.setAdapter(mAdapter);
actualListView.setOnItemClickListener(new ListView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(mMainActivity, contents.get(position).get("1"), Toast.LENGTH_SHORT).show();
mMainActivity.getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, NotificationFragment.newInstance(mMainActivity)).commit();
}
});
return view;
}
class GetDataTask extends AsyncTask<Void, Void, String[]> {
@Override
protected String[] doInBackground(Void... params) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
}
return new String[0];
}
@Override
protected void onPostExecute(String[] result) {
contents.add(item);
mAdapter.notifyDataSetChanged();
// Call onRefreshComplete when the list has been refreshed.
pullToRefreshListView.onRefreshComplete();
super.onPostExecute(result);
}
}
class ListviewAdapter extends ArrayAdapter {
private final LayoutInflater mInflater;
private final List<Map<String,String>> mData;
public ListviewAdapter(Context context, int layoutResourceId, List<Map<String,String>> data) {
super(context, layoutResourceId, data); // put data in this object
mData = data;
mInflater = LayoutInflater.from(context);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
class ViewHolder {
ImageView imageView;
TextView textView;
}
ViewHolder viewHolder = new ViewHolder();
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_view_item_home, parent, false);
// viewHolder.imageView=(ImageView)convertView.findViewById(R.id.user_portrait_imageview);
viewHolder.textView = (TextView) convertView.findViewById(R.id.question_content_textview);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
convertView.setTag(viewHolder);
// viewHolder.imageView.setImageResource(R.drawable.ic_ask);
viewHolder.textView.setText(mData.get(position) + "\n\n\n");
// viewHolder.textView.setTextColor(getResources().getColor(R.color.black));
return convertView;
}
}
}
| UTF-8 | Java | 5,509 | java | HomeFragment.java | Java | [
{
"context": ".library.PullToRefreshListView;\n\n/**\n * Created by zhangenjie on 16/3/6.\n */\npublic class HomeFragment extends ",
"end": 737,
"score": 0.9995046854019165,
"start": 727,
"tag": "USERNAME",
"value": "zhangenjie"
}
] | null | [] | package com.groupsix.lang_circle_10;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
/**
* Created by zhangenjie on 16/3/6.
*/
public class HomeFragment extends Fragment {
public static MainActivity mMainActivity;
private List<String> mDatas = new ArrayList<String>(Arrays.asList("Java", "Javascript", "C++", "Ruby", "Json",
"HTML"));
private List<Map<String, String>> contents;
private Map<String,String> item;
ListviewAdapter mAdapter;
private PullToRefreshListView pullToRefreshListView;
public static HomeFragment newInstance(MainActivity m) {
HomeFragment homeFragment = new HomeFragment();
mMainActivity = m;
return homeFragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.home_fragment, container, false);
item=new HashMap<>();
contents=new ArrayList<>();
item.put("1","This is a Sample question?\n\n\n");
contents.add(item);
contents.add(item);
contents.add(item);
contents.add(item);
contents.add(item);
pullToRefreshListView = (PullToRefreshListView) view.findViewById(R.id.listview_home);
pullToRefreshListView.setMode(PullToRefreshBase.Mode.BOTH);
ListView actualListView = pullToRefreshListView.getRefreshableView();
pullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
//dont update data here
}
});
pullToRefreshListView.setOnPullEventListener(new PullToRefreshBase.OnPullEventListener<ListView>() {
@Override
public void onPullEvent(PullToRefreshBase<ListView> refreshView
, PullToRefreshBase.State state, PullToRefreshBase.Mode direction) {
new GetDataTask().execute();
}
});
mAdapter = new ListviewAdapter(mMainActivity, R.layout.list_view_item_home, contents);
actualListView.setAdapter(mAdapter);
actualListView.setOnItemClickListener(new ListView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(mMainActivity, contents.get(position).get("1"), Toast.LENGTH_SHORT).show();
mMainActivity.getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, NotificationFragment.newInstance(mMainActivity)).commit();
}
});
return view;
}
class GetDataTask extends AsyncTask<Void, Void, String[]> {
@Override
protected String[] doInBackground(Void... params) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
}
return new String[0];
}
@Override
protected void onPostExecute(String[] result) {
contents.add(item);
mAdapter.notifyDataSetChanged();
// Call onRefreshComplete when the list has been refreshed.
pullToRefreshListView.onRefreshComplete();
super.onPostExecute(result);
}
}
class ListviewAdapter extends ArrayAdapter {
private final LayoutInflater mInflater;
private final List<Map<String,String>> mData;
public ListviewAdapter(Context context, int layoutResourceId, List<Map<String,String>> data) {
super(context, layoutResourceId, data); // put data in this object
mData = data;
mInflater = LayoutInflater.from(context);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
class ViewHolder {
ImageView imageView;
TextView textView;
}
ViewHolder viewHolder = new ViewHolder();
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_view_item_home, parent, false);
// viewHolder.imageView=(ImageView)convertView.findViewById(R.id.user_portrait_imageview);
viewHolder.textView = (TextView) convertView.findViewById(R.id.question_content_textview);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
convertView.setTag(viewHolder);
// viewHolder.imageView.setImageResource(R.drawable.ic_ask);
viewHolder.textView.setText(mData.get(position) + "\n\n\n");
// viewHolder.textView.setTextColor(getResources().getColor(R.color.black));
return convertView;
}
}
}
| 5,509 | 0.652932 | 0.65039 | 169 | 31.597633 | 31.375624 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.639053 | false | false | 2 |
f48ef7504fa92e3ee4385d0c624d5c7b25ab357f | 22,591,527,988,377 | 91c97f7b54ea3a84676b10ed10d676fbdbd65e9f | /src/main/java/com/school/portal/model/Career.java | 9f3f0d3566626a4ee8a05eaeacbf3972edd0f7fb | [] | no_license | christianLugo5/school | https://github.com/christianLugo5/school | 4e19a6ba8bb42f0636b15d54a490251f3e399443 | 281b492bea76592f491fd1f80bf4f1135dbea03b | refs/heads/main | 2023-06-04T11:09:59.321000 | 2021-06-14T07:51:44 | 2021-06-14T07:51:44 | 336,420,302 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.school.portal.model;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
enum CycleType {
SEMESTER, QUARTER;
}
@Entity
public class Career {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "career_id")
private Integer id;
@NotEmpty
@Size(min = 3, max = 45)
private String career;
@NotEmpty
@Size(min = 3, max = 25)
private String identifier;
@NotNull
@DateTimeFormat(iso = ISO.DATE_TIME)
private LocalDateTime start;
@DateTimeFormat(iso = ISO.DATE_TIME)
private LocalDateTime end;
@NotNull
private Boolean available;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "cycle_type")
private CycleType cycleType;
@Positive
private byte max_duration;
@ManyToMany
@JoinTable(joinColumns = {@JoinColumn(name = "career_id")}, inverseJoinColumns = {@JoinColumn(name = "course_id")})
private Set<Course> course = new HashSet<Course>();
@ManyToMany(mappedBy = "career")
private Set<Student> student = new HashSet<Student>();
public Career() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCareer() {
return career;
}
public void setCareer(String career) {
this.career = career.strip().replaceAll("\\s+", " ");
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier.strip().replaceAll("\\s+", " ");
}
public LocalDateTime getStart() {
return start;
}
public void setStart(LocalDateTime start) {
this.start = start;
}
public LocalDateTime getEnd() {
return end;
}
public void setEnd(LocalDateTime end) {
this.end = end;
}
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean available) {
this.available = available;
}
public CycleType getCycleType() {
return cycleType;
}
public void setCycleType(CycleType cycleType) {
this.cycleType = cycleType;
}
public byte getMax_duration() {
return max_duration;
}
public void setMax_duration(byte max_duration) {
this.max_duration = max_duration;
}
public Set<Course> getCourses() {
return course;
}
public void setCourses(Set<Course> courses) {
this.course = courses;
}
public void addCourse(Course course) {
this.course.add(course);
}
public void removeCourse(int id) {
this.course.removeIf(course -> course.getId() == id);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Career other = (Career) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Career [id=" + id + ", career=" + career + ", identifier=" + identifier + ", start=" + start + ", end="
+ end + ", available=" + available + ", cycleType=" + cycleType + ", max_duration=" + max_duration
+ ", course=" + course + "]";
}
}
| UTF-8 | Java | 3,903 | java | Career.java | Java | [] | null | [] | package com.school.portal.model;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
enum CycleType {
SEMESTER, QUARTER;
}
@Entity
public class Career {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "career_id")
private Integer id;
@NotEmpty
@Size(min = 3, max = 45)
private String career;
@NotEmpty
@Size(min = 3, max = 25)
private String identifier;
@NotNull
@DateTimeFormat(iso = ISO.DATE_TIME)
private LocalDateTime start;
@DateTimeFormat(iso = ISO.DATE_TIME)
private LocalDateTime end;
@NotNull
private Boolean available;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "cycle_type")
private CycleType cycleType;
@Positive
private byte max_duration;
@ManyToMany
@JoinTable(joinColumns = {@JoinColumn(name = "career_id")}, inverseJoinColumns = {@JoinColumn(name = "course_id")})
private Set<Course> course = new HashSet<Course>();
@ManyToMany(mappedBy = "career")
private Set<Student> student = new HashSet<Student>();
public Career() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCareer() {
return career;
}
public void setCareer(String career) {
this.career = career.strip().replaceAll("\\s+", " ");
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier.strip().replaceAll("\\s+", " ");
}
public LocalDateTime getStart() {
return start;
}
public void setStart(LocalDateTime start) {
this.start = start;
}
public LocalDateTime getEnd() {
return end;
}
public void setEnd(LocalDateTime end) {
this.end = end;
}
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean available) {
this.available = available;
}
public CycleType getCycleType() {
return cycleType;
}
public void setCycleType(CycleType cycleType) {
this.cycleType = cycleType;
}
public byte getMax_duration() {
return max_duration;
}
public void setMax_duration(byte max_duration) {
this.max_duration = max_duration;
}
public Set<Course> getCourses() {
return course;
}
public void setCourses(Set<Course> courses) {
this.course = courses;
}
public void addCourse(Course course) {
this.course.add(course);
}
public void removeCourse(int id) {
this.course.removeIf(course -> course.getId() == id);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Career other = (Career) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Career [id=" + id + ", career=" + career + ", identifier=" + identifier + ", start=" + start + ", end="
+ end + ", available=" + available + ", cycleType=" + cycleType + ", max_duration=" + max_duration
+ ", course=" + course + "]";
}
}
| 3,903 | 0.703561 | 0.700999 | 185 | 20.097298 | 20.595755 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.367568 | false | false | 2 |
9724b08b749c96f34f38ee61a0efe31fc53640a8 | 18,064,632,478,573 | e107917c0e504ee265b22e1715a93f60493321f1 | /src/main/java/eu/busi/ACAPizza/dataAccess/entity/PizzaEntity.java | b4354518f352ce42e1f45d4cdf1285bb20b2700f | [] | no_license | styzek/ACAPizza | https://github.com/styzek/ACAPizza | f186838cda6bf5c7c6e03bbfe3db77bb0b41fadc | f1fc482fe1a3783e67425b97e02419212cac2e08 | refs/heads/master | 2020-04-04T23:40:14.877000 | 2018-11-15T14:29:10 | 2018-11-15T14:29:10 | 156,355,870 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package eu.busi.ACAPizza.dataAccess.entity;
import eu.busi.ACAPizza.model.Ingredient;
import javax.persistence.*;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@Entity
@Table(name="pizza")
public class PizzaEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="pizzaId", unique = true, nullable = false)
private int pizzaId;
@Column(name="name")
private String name;
@Column(name="description")
private String description;
private String size;
@Column(name="price")
private float price;
private boolean iscomposed;
@OneToMany(mappedBy ="pizza", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<OrderPizzaEntity>orders;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name="pizza_ingredient",
joinColumns = {@JoinColumn(name = "fk_pizzaId",referencedColumnName = "pizzaId")},
inverseJoinColumns = {@JoinColumn(name = "fk_ingredientId",referencedColumnName = "ingredientId")}
)
private Set<IngredientEntity> ingredients;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name="pizza_category",
joinColumns = {@JoinColumn(name = "fk_pizzaId",referencedColumnName = "pizzaId")},
inverseJoinColumns = {@JoinColumn(name = "fk_categoryId",referencedColumnName = "name")}
)
private List<CategoryEntity> categories;
public PizzaEntity() {}
public int getPizzaId() {
return pizzaId;
}
public void setPizzaId(int pizzaId) {
this.pizzaId = pizzaId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public Set<IngredientEntity> getIngredients() {
return ingredients;
}
public void setIngredients(Set<IngredientEntity> ingredients) {
this.ingredients = ingredients;
}
public List<OrderPizzaEntity> getOrders() {
return orders;
}
public void setOrders(List<OrderPizzaEntity> orders) {
this.orders = orders;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public boolean isIscomposed() {
return iscomposed;
}
public void setIscomposed(boolean iscomposed) {
this.iscomposed = iscomposed;
}
public List<CategoryEntity> getCategories() {
return categories;
}
public void setCategories(List<CategoryEntity> categories) {
this.categories = categories;
}
@Override
public String toString() {
return "PizzaEntity{" +
"pizzaId=" + pizzaId +
", name='" + name + '\'' +
", description='" + description + '\'' +
", size='" + size + '\'' +
", price=" + price +
", iscomposed=" + iscomposed +
", orders=" + orders +
", ingredients=" + ingredients +
", categories=" + categories +
'}';
}
}
| UTF-8 | Java | 3,433 | java | PizzaEntity.java | Java | [
{
"context": "pizzaId=\" + pizzaId +\n \", name='\" + name + '\\'' +\n \", description='\" + desc",
"end": 3075,
"score": 0.8048629760742188,
"start": 3071,
"tag": "NAME",
"value": "name"
}
] | null | [] | package eu.busi.ACAPizza.dataAccess.entity;
import eu.busi.ACAPizza.model.Ingredient;
import javax.persistence.*;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@Entity
@Table(name="pizza")
public class PizzaEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="pizzaId", unique = true, nullable = false)
private int pizzaId;
@Column(name="name")
private String name;
@Column(name="description")
private String description;
private String size;
@Column(name="price")
private float price;
private boolean iscomposed;
@OneToMany(mappedBy ="pizza", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<OrderPizzaEntity>orders;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name="pizza_ingredient",
joinColumns = {@JoinColumn(name = "fk_pizzaId",referencedColumnName = "pizzaId")},
inverseJoinColumns = {@JoinColumn(name = "fk_ingredientId",referencedColumnName = "ingredientId")}
)
private Set<IngredientEntity> ingredients;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name="pizza_category",
joinColumns = {@JoinColumn(name = "fk_pizzaId",referencedColumnName = "pizzaId")},
inverseJoinColumns = {@JoinColumn(name = "fk_categoryId",referencedColumnName = "name")}
)
private List<CategoryEntity> categories;
public PizzaEntity() {}
public int getPizzaId() {
return pizzaId;
}
public void setPizzaId(int pizzaId) {
this.pizzaId = pizzaId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public Set<IngredientEntity> getIngredients() {
return ingredients;
}
public void setIngredients(Set<IngredientEntity> ingredients) {
this.ingredients = ingredients;
}
public List<OrderPizzaEntity> getOrders() {
return orders;
}
public void setOrders(List<OrderPizzaEntity> orders) {
this.orders = orders;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public boolean isIscomposed() {
return iscomposed;
}
public void setIscomposed(boolean iscomposed) {
this.iscomposed = iscomposed;
}
public List<CategoryEntity> getCategories() {
return categories;
}
public void setCategories(List<CategoryEntity> categories) {
this.categories = categories;
}
@Override
public String toString() {
return "PizzaEntity{" +
"pizzaId=" + pizzaId +
", name='" + name + '\'' +
", description='" + description + '\'' +
", size='" + size + '\'' +
", price=" + price +
", iscomposed=" + iscomposed +
", orders=" + orders +
", ingredients=" + ingredients +
", categories=" + categories +
'}';
}
}
| 3,433 | 0.602097 | 0.602097 | 143 | 23.006992 | 22.959221 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.377622 | false | false | 2 |
35ef8c22818eb464e869dc27cebef4ba2fab5057 | 20,298,015,483,906 | 32394d6715bd981b8515339931d638f99c6c34af | /lab07_sets/UniquesDupes.java | e09dc7aaabd4837a0604a616c92f31d733dd8cfe | [] | no_license | phisv/Compsci-3 | https://github.com/phisv/Compsci-3 | 2f9a49c4cf213259cdb1797fb39db8ab9959ba7e | c315f764c6ea1ea59ed0a082604bacf40b69085a | refs/heads/master | 2020-03-28T07:12:44.949000 | 2019-11-21T18:06:24 | 2019-11-21T18:06:24 | 147,887,491 | 9 | 2 | null | false | 2018-09-17T21:58:34 | 2018-09-08T00:37:25 | 2018-09-08T00:42:43 | 2018-09-10T15:31:34 | 2,403 | 0 | 2 | 0 | Java | false | null | //© A+ Computer Science - www.apluscompsci.com
//Name -
//Date -
//Class -
//Lab -
import java.util.Set;
import java.util.TreeSet;
import java.util.Arrays;
import java.util.ArrayList;
import static java.lang.System.*;
public class UniquesDupes
{
public static Set<String> getUniques(String input)
{
Set<String> uniques = new TreeSet<String>();
String[] arr = input.split(" ");
for(String str: arr)
uniques.add(str);
//add code
return uniques;
}
public static Set<String> getDupes(String input)
{
Set<String> uniques = new TreeSet<String>();
Set<String> dupes = new TreeSet<String>();
String[] arr = input.split(" ");
for(String str: arr)
if(uniques.add(str) == false)
dupes.add(str);
return dupes;
}
} | WINDOWS-1252 | Java | 785 | java | UniquesDupes.java | Java | [] | null | [] | //© A+ Computer Science - www.apluscompsci.com
//Name -
//Date -
//Class -
//Lab -
import java.util.Set;
import java.util.TreeSet;
import java.util.Arrays;
import java.util.ArrayList;
import static java.lang.System.*;
public class UniquesDupes
{
public static Set<String> getUniques(String input)
{
Set<String> uniques = new TreeSet<String>();
String[] arr = input.split(" ");
for(String str: arr)
uniques.add(str);
//add code
return uniques;
}
public static Set<String> getDupes(String input)
{
Set<String> uniques = new TreeSet<String>();
Set<String> dupes = new TreeSet<String>();
String[] arr = input.split(" ");
for(String str: arr)
if(uniques.add(str) == false)
dupes.add(str);
return dupes;
}
} | 785 | 0.63648 | 0.63648 | 37 | 19.243244 | 16.391172 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.405405 | false | false | 2 |
870de0ac88e3842d01ee88ca9add4e56b646a4bc | 15,616,501,088,959 | 51fdb9aba4c7fdd4420ee29c5d1a085afe65eeea | /day07/ExtendsDemo.java | 8bea5cc6d9c153b11e78dd4ee58534379a6a8b16 | [] | no_license | huermosy/Java | https://github.com/huermosy/Java | 993465753834c9239e71e4f6d983d79e12c061f6 | ac6974f5c281e59c60e1d15a2a9de7d66df5af42 | refs/heads/main | 2023-02-24T04:11:08.551000 | 2021-01-22T13:37:26 | 2021-01-22T13:37:26 | 308,832,167 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
作者:huermosy
需求:了解extends关键字,学习继承这一个知识点 继承的引入:
我们知道有些情况下,事物与事物之间存在着某个共性,所以我们就需要将这个共性抽取出来, 专门来描述,来提高代码的复用性。
注意:千万不要一昧的为了代码的简化而简化,一定是要注意类与类之间是有互相的联系才可以继承
*/
// 这里的Person找到的是学生类和工人类之间共性的东西 也就是分别的年龄与名字。
class Person
{
int age;
String Name;
}
class Student extends Person
{
/*
int age;
String name;
*/
void study()
{
System.out.println("good study!");
}
}
class Worker extends Person
{
/*
int age;
String name;
*/
void work()
{
System.out.println("good work!");
}
}
class ExtendsDemo
{
public static void main(String[] args)
{
Student s = new Student();
s.study();
Worker w = new Worker();
w.work();
//System.out.println("Hello World!");
}
}
| GB18030 | Java | 1,106 | java | ExtendsDemo.java | Java | [
{
"context": "/*\r\n作者:huermosy\r\n需求:了解extends关键字,学习继承这一个知识点 继承的引入:\r\n我们知道有些情况下",
"end": 15,
"score": 0.9997414350509644,
"start": 7,
"tag": "USERNAME",
"value": "huermosy"
}
] | null | [] | /*
作者:huermosy
需求:了解extends关键字,学习继承这一个知识点 继承的引入:
我们知道有些情况下,事物与事物之间存在着某个共性,所以我们就需要将这个共性抽取出来, 专门来描述,来提高代码的复用性。
注意:千万不要一昧的为了代码的简化而简化,一定是要注意类与类之间是有互相的联系才可以继承
*/
// 这里的Person找到的是学生类和工人类之间共性的东西 也就是分别的年龄与名字。
class Person
{
int age;
String Name;
}
class Student extends Person
{
/*
int age;
String name;
*/
void study()
{
System.out.println("good study!");
}
}
class Worker extends Person
{
/*
int age;
String name;
*/
void work()
{
System.out.println("good work!");
}
}
class ExtendsDemo
{
public static void main(String[] args)
{
Student s = new Student();
s.study();
Worker w = new Worker();
w.work();
//System.out.println("Hello World!");
}
}
| 1,106 | 0.59359 | 0.59359 | 52 | 13 | 15.488209 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.884615 | false | false | 2 |
4836667bef48df8f6b1136c53b1780243c3b7f9e | 9,998,683,899,314 | ef0c1514e9af6de3ba4a20e0d01de7cc3a915188 | /sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/query/FetcherTest.java | 487a959216f790928738ea4bf12280c67893ee3d | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"CC0-1.0",
"BSD-3-Clause",
"UPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | Azure/azure-sdk-for-java | https://github.com/Azure/azure-sdk-for-java | 0902d584b42d3654b4ce65b1dad8409f18ddf4bc | 789bdc6c065dc44ce9b8b630e2f2e5896b2a7616 | refs/heads/main | 2023-09-04T09:36:35.821000 | 2023-09-02T01:53:56 | 2023-09-02T01:53:56 | 2,928,948 | 2,027 | 2,084 | MIT | false | 2023-09-14T21:37:15 | 2011-12-06T23:33:56 | 2023-09-14T17:19:10 | 2023-09-14T21:37:14 | 3,043,660 | 1,994 | 1,854 | 1,435 | Java | false | false | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.query;
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl;
import com.azure.cosmos.models.CosmosChangeFeedRequestOptions;
import com.azure.cosmos.models.CosmosQueryRequestOptions;
import com.azure.cosmos.models.FeedResponse;
import com.azure.cosmos.implementation.Document;
import com.azure.cosmos.implementation.RxDocumentServiceRequest;
import com.azure.cosmos.models.ModelBridgeInternal;
import io.reactivex.subscribers.TestSubscriber;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import reactor.core.publisher.Mono;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiFunction;
import java.util.function.Function;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
public class FetcherTest {
@DataProvider(name = "queryParams")
public static Object[][] queryParamProvider() {
CosmosQueryRequestOptions options1 = new CosmosQueryRequestOptions();
// initial continuation token
ModelBridgeInternal.setQueryRequestOptionsContinuationTokenAndMaxItemCount(options1,"cp-init",100);
int top1 = -1; // no top
// no continuation token
CosmosQueryRequestOptions options2 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options2, 100);
int top2 = -1; // no top
// top more than max item count
CosmosQueryRequestOptions options3 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options3, 100);
int top3 = 200;
// top less than max item count
CosmosQueryRequestOptions options4 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options4, 100);
int top4 = 20;
return new Object[][] {
{ options1, top1 },
{ options2, top2 },
{ options3, top3 },
{ options4, top4 }};
}
@Test(groups = { "unit" }, dataProvider = "queryParams")
public void query(CosmosQueryRequestOptions options, int top) {
FeedResponse<Document> fp1 = FeedResponseBuilder.queryFeedResponseBuilder(Document.class)
.withContinuationToken("cp1")
.withResults(new Document(), new Document(), new Document())
.build();
FeedResponse<Document> fp2 = FeedResponseBuilder.queryFeedResponseBuilder(Document.class)
.withContinuationToken(null)
.withResults(new Document())
.build();
List<FeedResponse<Document>> feedResponseList = Arrays.asList(fp1, fp2);
AtomicInteger totalResultsReceived = new AtomicInteger(0);
AtomicInteger requestIndex = new AtomicInteger(0);
BiFunction<String, Integer, RxDocumentServiceRequest> createRequestFunc = (token, maxItemCount) -> {
assertThat(maxItemCount).describedAs("max item count").isEqualTo(
getExpectedMaxItemCountInRequest(options, top, feedResponseList, requestIndex.get()));
assertThat(token).describedAs("continuation token").isEqualTo(
getExpectedContinuationTokenInRequest(
ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(options), feedResponseList, requestIndex.get()));
requestIndex.getAndIncrement();
return mock(RxDocumentServiceRequest.class);
};
AtomicInteger executeIndex = new AtomicInteger(0);
Function<RxDocumentServiceRequest, Mono<FeedResponse<Document>>> executeFunc = request -> {
FeedResponse<Document> rsp = feedResponseList.get(executeIndex.getAndIncrement());
totalResultsReceived.addAndGet(rsp.getResults().size());
return Mono.just(rsp);
};
ServerSideOnlyContinuationFetcherImpl<Document> fetcher =
new ServerSideOnlyContinuationFetcherImpl<>(createRequestFunc, executeFunc, ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(options), false, top,
ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options),
ImplementationBridgeHelpers
.CosmosQueryRequestOptionsHelper
.getCosmosQueryRequestOptionsAccessor()
.getOperationContext(options),
ImplementationBridgeHelpers
.CosmosQueryRequestOptionsHelper
.getCosmosQueryRequestOptionsAccessor()
.getCancelledRequestDiagnosticsTracker(options));
validateFetcher(fetcher, options, top, feedResponseList);
}
private void validateFetcher(ServerSideOnlyContinuationFetcherImpl<Document> fetcher,
CosmosQueryRequestOptions options,
int top,
List<FeedResponse<Document>> feedResponseList) {
int totalNumberOfDocs = 0;
int index = 0;
while(index < feedResponseList.size()) {
assertThat(fetcher.shouldFetchMore()).describedAs("should fetch more pages").isTrue();
totalNumberOfDocs += validate(fetcher.nextPage()).getResults().size();
if ((top != -1) && (totalNumberOfDocs >= top)) {
break;
}
index++;
}
assertThat(fetcher.shouldFetchMore()).describedAs("should not fetch more pages").isFalse();
}
@Test(groups = { "unit" })
public void changeFeed() {
CosmosChangeFeedRequestOptions options =
CosmosChangeFeedRequestOptions.createForProcessingFromBeginning(
FeedRangeEpkImpl.forFullRange());
options.setMaxItemCount(100);
boolean isChangeFeed = true;
int top = -1;
FeedResponse<Document> fp1 = FeedResponseBuilder.changeFeedResponseBuilder(Document.class)
.withContinuationToken("cp1")
.withResults(new Document())
.build();
FeedResponse<Document> fp2 = FeedResponseBuilder.changeFeedResponseBuilder(Document.class)
.withContinuationToken("cp2")
.lastChangeFeedPage()
.build();
List<FeedResponse<Document>> feedResponseList = Arrays.asList(fp1, fp2);
BiFunction<String, Integer, RxDocumentServiceRequest> createRequestFunc = (token, maxItemCount) -> {
assertThat(maxItemCount).describedAs("max getItem count").isEqualTo(options.getMaxItemCount());
return mock(RxDocumentServiceRequest.class);
};
AtomicInteger executeIndex = new AtomicInteger(0);
Function<RxDocumentServiceRequest, Mono<FeedResponse<Document>>> executeFunc = request -> Mono.just(feedResponseList.get(executeIndex.getAndIncrement()));
ServerSideOnlyContinuationFetcherImpl<Document> fetcher =
new ServerSideOnlyContinuationFetcherImpl<>(createRequestFunc, executeFunc, null, isChangeFeed, top,
options.getMaxItemCount(),
ImplementationBridgeHelpers
.CosmosChangeFeedRequestOptionsHelper
.getCosmosChangeFeedRequestOptionsAccessor()
.getOperationContext(options),
null);
validateFetcher(fetcher, options, feedResponseList);
}
private void validateFetcher(ServerSideOnlyContinuationFetcherImpl<Document> fetcher,
CosmosChangeFeedRequestOptions options,
List<FeedResponse<Document>> feedResponseList) {
for(FeedResponse<Document> change: feedResponseList) {
assertThat(fetcher.shouldFetchMore()).describedAs("should fetch more pages").isTrue();
validate(fetcher.nextPage());
}
assertThat(fetcher.shouldFetchMore()).describedAs("should not fetch more pages").isFalse();
}
private FeedResponse<Document> validate(Mono<FeedResponse<Document>> page) {
TestSubscriber<FeedResponse<Document>> subscriber = new TestSubscriber<>();
page.subscribe(subscriber);
subscriber.awaitTerminalEvent();
subscriber.assertComplete();
subscriber.assertNoErrors();
subscriber.assertValueCount(1);
return subscriber.values().get(0);
}
private String getExpectedContinuationTokenInRequest(String continuationToken,
List<FeedResponse<Document>> feedResponseList,
int requestIndex) {
if (requestIndex == 0) {
return continuationToken;
}
return feedResponseList.get(requestIndex - 1).getContinuationToken();
}
private int getExpectedMaxItemCountInRequest(CosmosQueryRequestOptions options,
int top,
List<FeedResponse<Document>> feedResponseList,
int requestIndex) {
if (top == -1) {
return ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options);
}
int numberOfReceivedItemsSoFar =
feedResponseList.subList(0, requestIndex).stream().mapToInt(rsp -> rsp.getResults().size()).sum();
return Math.min(top - numberOfReceivedItemsSoFar, ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options));
}
}
| UTF-8 | Java | 9,944 | java | FetcherTest.java | Java | [] | null | [] | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.query;
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl;
import com.azure.cosmos.models.CosmosChangeFeedRequestOptions;
import com.azure.cosmos.models.CosmosQueryRequestOptions;
import com.azure.cosmos.models.FeedResponse;
import com.azure.cosmos.implementation.Document;
import com.azure.cosmos.implementation.RxDocumentServiceRequest;
import com.azure.cosmos.models.ModelBridgeInternal;
import io.reactivex.subscribers.TestSubscriber;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import reactor.core.publisher.Mono;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiFunction;
import java.util.function.Function;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
public class FetcherTest {
@DataProvider(name = "queryParams")
public static Object[][] queryParamProvider() {
CosmosQueryRequestOptions options1 = new CosmosQueryRequestOptions();
// initial continuation token
ModelBridgeInternal.setQueryRequestOptionsContinuationTokenAndMaxItemCount(options1,"cp-init",100);
int top1 = -1; // no top
// no continuation token
CosmosQueryRequestOptions options2 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options2, 100);
int top2 = -1; // no top
// top more than max item count
CosmosQueryRequestOptions options3 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options3, 100);
int top3 = 200;
// top less than max item count
CosmosQueryRequestOptions options4 = new CosmosQueryRequestOptions();
ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options4, 100);
int top4 = 20;
return new Object[][] {
{ options1, top1 },
{ options2, top2 },
{ options3, top3 },
{ options4, top4 }};
}
@Test(groups = { "unit" }, dataProvider = "queryParams")
public void query(CosmosQueryRequestOptions options, int top) {
FeedResponse<Document> fp1 = FeedResponseBuilder.queryFeedResponseBuilder(Document.class)
.withContinuationToken("cp1")
.withResults(new Document(), new Document(), new Document())
.build();
FeedResponse<Document> fp2 = FeedResponseBuilder.queryFeedResponseBuilder(Document.class)
.withContinuationToken(null)
.withResults(new Document())
.build();
List<FeedResponse<Document>> feedResponseList = Arrays.asList(fp1, fp2);
AtomicInteger totalResultsReceived = new AtomicInteger(0);
AtomicInteger requestIndex = new AtomicInteger(0);
BiFunction<String, Integer, RxDocumentServiceRequest> createRequestFunc = (token, maxItemCount) -> {
assertThat(maxItemCount).describedAs("max item count").isEqualTo(
getExpectedMaxItemCountInRequest(options, top, feedResponseList, requestIndex.get()));
assertThat(token).describedAs("continuation token").isEqualTo(
getExpectedContinuationTokenInRequest(
ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(options), feedResponseList, requestIndex.get()));
requestIndex.getAndIncrement();
return mock(RxDocumentServiceRequest.class);
};
AtomicInteger executeIndex = new AtomicInteger(0);
Function<RxDocumentServiceRequest, Mono<FeedResponse<Document>>> executeFunc = request -> {
FeedResponse<Document> rsp = feedResponseList.get(executeIndex.getAndIncrement());
totalResultsReceived.addAndGet(rsp.getResults().size());
return Mono.just(rsp);
};
ServerSideOnlyContinuationFetcherImpl<Document> fetcher =
new ServerSideOnlyContinuationFetcherImpl<>(createRequestFunc, executeFunc, ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(options), false, top,
ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options),
ImplementationBridgeHelpers
.CosmosQueryRequestOptionsHelper
.getCosmosQueryRequestOptionsAccessor()
.getOperationContext(options),
ImplementationBridgeHelpers
.CosmosQueryRequestOptionsHelper
.getCosmosQueryRequestOptionsAccessor()
.getCancelledRequestDiagnosticsTracker(options));
validateFetcher(fetcher, options, top, feedResponseList);
}
private void validateFetcher(ServerSideOnlyContinuationFetcherImpl<Document> fetcher,
CosmosQueryRequestOptions options,
int top,
List<FeedResponse<Document>> feedResponseList) {
int totalNumberOfDocs = 0;
int index = 0;
while(index < feedResponseList.size()) {
assertThat(fetcher.shouldFetchMore()).describedAs("should fetch more pages").isTrue();
totalNumberOfDocs += validate(fetcher.nextPage()).getResults().size();
if ((top != -1) && (totalNumberOfDocs >= top)) {
break;
}
index++;
}
assertThat(fetcher.shouldFetchMore()).describedAs("should not fetch more pages").isFalse();
}
@Test(groups = { "unit" })
public void changeFeed() {
CosmosChangeFeedRequestOptions options =
CosmosChangeFeedRequestOptions.createForProcessingFromBeginning(
FeedRangeEpkImpl.forFullRange());
options.setMaxItemCount(100);
boolean isChangeFeed = true;
int top = -1;
FeedResponse<Document> fp1 = FeedResponseBuilder.changeFeedResponseBuilder(Document.class)
.withContinuationToken("cp1")
.withResults(new Document())
.build();
FeedResponse<Document> fp2 = FeedResponseBuilder.changeFeedResponseBuilder(Document.class)
.withContinuationToken("cp2")
.lastChangeFeedPage()
.build();
List<FeedResponse<Document>> feedResponseList = Arrays.asList(fp1, fp2);
BiFunction<String, Integer, RxDocumentServiceRequest> createRequestFunc = (token, maxItemCount) -> {
assertThat(maxItemCount).describedAs("max getItem count").isEqualTo(options.getMaxItemCount());
return mock(RxDocumentServiceRequest.class);
};
AtomicInteger executeIndex = new AtomicInteger(0);
Function<RxDocumentServiceRequest, Mono<FeedResponse<Document>>> executeFunc = request -> Mono.just(feedResponseList.get(executeIndex.getAndIncrement()));
ServerSideOnlyContinuationFetcherImpl<Document> fetcher =
new ServerSideOnlyContinuationFetcherImpl<>(createRequestFunc, executeFunc, null, isChangeFeed, top,
options.getMaxItemCount(),
ImplementationBridgeHelpers
.CosmosChangeFeedRequestOptionsHelper
.getCosmosChangeFeedRequestOptionsAccessor()
.getOperationContext(options),
null);
validateFetcher(fetcher, options, feedResponseList);
}
private void validateFetcher(ServerSideOnlyContinuationFetcherImpl<Document> fetcher,
CosmosChangeFeedRequestOptions options,
List<FeedResponse<Document>> feedResponseList) {
for(FeedResponse<Document> change: feedResponseList) {
assertThat(fetcher.shouldFetchMore()).describedAs("should fetch more pages").isTrue();
validate(fetcher.nextPage());
}
assertThat(fetcher.shouldFetchMore()).describedAs("should not fetch more pages").isFalse();
}
private FeedResponse<Document> validate(Mono<FeedResponse<Document>> page) {
TestSubscriber<FeedResponse<Document>> subscriber = new TestSubscriber<>();
page.subscribe(subscriber);
subscriber.awaitTerminalEvent();
subscriber.assertComplete();
subscriber.assertNoErrors();
subscriber.assertValueCount(1);
return subscriber.values().get(0);
}
private String getExpectedContinuationTokenInRequest(String continuationToken,
List<FeedResponse<Document>> feedResponseList,
int requestIndex) {
if (requestIndex == 0) {
return continuationToken;
}
return feedResponseList.get(requestIndex - 1).getContinuationToken();
}
private int getExpectedMaxItemCountInRequest(CosmosQueryRequestOptions options,
int top,
List<FeedResponse<Document>> feedResponseList,
int requestIndex) {
if (top == -1) {
return ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options);
}
int numberOfReceivedItemsSoFar =
feedResponseList.subList(0, requestIndex).stream().mapToInt(rsp -> rsp.getResults().size()).sum();
return Math.min(top - numberOfReceivedItemsSoFar, ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(options));
}
}
| 9,944 | 0.651146 | 0.644409 | 224 | 43.392857 | 35.962372 | 179 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.660714 | false | false | 2 |
170cd4add962bb0a839a338b9f9da7f33300bc34 | 21,526,376,125,534 | 0f6c9ee49afa52c5dc2394ef91cb6fd660803a38 | /src/main/java/tma/datraining/dto/ProductDTO.java | ed87b0c46df6d091406d6956a31e126ba67a9607 | [] | no_license | anhphh2310/WebSalesTemp | https://github.com/anhphh2310/WebSalesTemp | e46b400e8e810452fbf56b9934648e3f565637d8 | ea97dd3726524d4f7212ca05647fbe45afd8c34c | refs/heads/master | 2020-03-30T12:49:47.242000 | 2018-11-06T06:14:46 | 2018-11-06T06:14:46 | 151,242,955 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package tma.datraining.dto;
import java.sql.Timestamp;
import java.util.UUID;
public class ProductDTO {
private UUID productId;
private int item;
private String classProduct;
private String inventory;
private Timestamp createAt;
private Timestamp modifiedAt;
public ProductDTO() {
super();
}
public UUID getProductId() {
return productId;
}
public void setProductId(UUID productId) {
this.productId = productId;
}
public int getItem() {
return item;
}
public void setItem(int item) {
this.item = item;
}
public String getClassProduct() {
return classProduct;
}
public void setClassProduct(String classProduct) {
this.classProduct = classProduct;
}
public String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public Timestamp getCreateAt() {
return createAt;
}
public void setCreateAt(Timestamp createAt) {
this.createAt = createAt;
}
public Timestamp getModifiedAt() {
return modifiedAt;
}
public void setModifiedAt(Timestamp modifiedAt) {
this.modifiedAt = modifiedAt;
}
@Override
public String toString() {
return "ProductDTO [productId=" + productId + ", item=" + item + ", classProduct=" + classProduct
+ ", inventory=" + inventory + ", createAt=" + createAt + ", modifiedAt=" + modifiedAt + "]";
}
}
| UTF-8 | Java | 1,360 | java | ProductDTO.java | Java | [] | null | [] | package tma.datraining.dto;
import java.sql.Timestamp;
import java.util.UUID;
public class ProductDTO {
private UUID productId;
private int item;
private String classProduct;
private String inventory;
private Timestamp createAt;
private Timestamp modifiedAt;
public ProductDTO() {
super();
}
public UUID getProductId() {
return productId;
}
public void setProductId(UUID productId) {
this.productId = productId;
}
public int getItem() {
return item;
}
public void setItem(int item) {
this.item = item;
}
public String getClassProduct() {
return classProduct;
}
public void setClassProduct(String classProduct) {
this.classProduct = classProduct;
}
public String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public Timestamp getCreateAt() {
return createAt;
}
public void setCreateAt(Timestamp createAt) {
this.createAt = createAt;
}
public Timestamp getModifiedAt() {
return modifiedAt;
}
public void setModifiedAt(Timestamp modifiedAt) {
this.modifiedAt = modifiedAt;
}
@Override
public String toString() {
return "ProductDTO [productId=" + productId + ", item=" + item + ", classProduct=" + classProduct
+ ", inventory=" + inventory + ", createAt=" + createAt + ", modifiedAt=" + modifiedAt + "]";
}
}
| 1,360 | 0.707353 | 0.707353 | 75 | 17.133333 | 20.093338 | 99 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.293333 | false | false | 2 |
0aa78d01507059118ba331f8b9b60526b5d6de5e | 1,288,490,189,002 | 37924b8c17b50ea0b0bcd1aea3b85207146e3552 | /com.yonyou.nc.codevalidator.export.excel/src/com/yonyou/nc/codevalidator/export/excel/utils/DefaultExcelDataSet.java | 16bd244eca74dad931c5c6d294b09cbf368d6442 | [] | no_license | clamaa/rulevalidator-ncrcc | https://github.com/clamaa/rulevalidator-ncrcc | fbe8f5990f984ccf17302e6a7c1569864385a20e | 7c59cff9e687840162c5e8ccdd39e7f196a4de6c | refs/heads/master | 2016-08-05T06:55:51.893000 | 2014-06-16T02:33:41 | 2014-06-16T02:33:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yonyou.nc.codevalidator.export.excel.utils;
public class DefaultExcelDataSet implements ExcelDataSet {
private ExcelColumn[] columns;
private ExcelRow[] rows;
private String identityName;
public void setColumns(ExcelColumn[] columns) {
this.columns = columns;
}
public void setRows(ExcelRow[] rows) {
this.rows = rows;
}
@Override
public ExcelColumn[] getColumns() {
return this.columns;
}
@Override
public int getColumnCount() {
return columns != null ? this.columns.length : 0;
}
@Override
public ExcelRow[] getRows() {
return this.rows;
}
@Override
public int getRowCount() {
return rows != null ? this.rows.length : 0;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (ExcelRow row : this.rows) {
sb.append(", {");
sb.append(row.toString());
sb.append("}");
}
sb.delete(0, 1);
return "[" + sb.toString() + "]";
}
public void setIdentityName(String identityName) {
this.identityName = identityName;
}
@Override
public String getIdentityName() {
return this.identityName;
}
} | UTF-8 | Java | 1,098 | java | DefaultExcelDataSet.java | Java | [] | null | [] | package com.yonyou.nc.codevalidator.export.excel.utils;
public class DefaultExcelDataSet implements ExcelDataSet {
private ExcelColumn[] columns;
private ExcelRow[] rows;
private String identityName;
public void setColumns(ExcelColumn[] columns) {
this.columns = columns;
}
public void setRows(ExcelRow[] rows) {
this.rows = rows;
}
@Override
public ExcelColumn[] getColumns() {
return this.columns;
}
@Override
public int getColumnCount() {
return columns != null ? this.columns.length : 0;
}
@Override
public ExcelRow[] getRows() {
return this.rows;
}
@Override
public int getRowCount() {
return rows != null ? this.rows.length : 0;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (ExcelRow row : this.rows) {
sb.append(", {");
sb.append(row.toString());
sb.append("}");
}
sb.delete(0, 1);
return "[" + sb.toString() + "]";
}
public void setIdentityName(String identityName) {
this.identityName = identityName;
}
@Override
public String getIdentityName() {
return this.identityName;
}
} | 1,098 | 0.685792 | 0.682149 | 59 | 17.627119 | 17.285145 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.38983 | false | false | 2 |
7e821b04073fd17758aa929b7b8039de95c4268a | 21,577,915,721,196 | f12147a6635f3da9dade458d2422c7aca0b65308 | /src/main/java/com/blackfish/java/suanfa/Node.java | 8999c0eb6cfe75d8c00008d0f478570b57d95fc5 | [] | no_license | pcc000/springboot | https://github.com/pcc000/springboot | 9229b7a4c4537fcd68320a84061e4298d4ca3a8a | 2ec21be484b565218f9fca6b5df2e5306bb26ba1 | refs/heads/master | 2023-02-21T01:06:27.885000 | 2023-02-16T06:09:06 | 2023-02-16T06:09:06 | 154,478,487 | 0 | 0 | null | false | 2022-09-01T23:34:23 | 2018-10-24T09:58:47 | 2021-03-06T09:37:29 | 2022-09-01T23:34:20 | 309 | 0 | 0 | 5 | Java | false | false | package com.blackfish.java.suanfa;
import com.blackfish.java.util.common.JsonUtil;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
/**
* @Auther: pcc
* @Date: 2021/12/30 16:35
* @Description:
*/
public class Node {
public String name;
public Integer level;
public List<Node> children;
public Node(String name, Integer level) {
this.name = name;
this.level = level;
}
public static void main(String[] args) {
String[] strs = new String[]{"浙江省/宁波市/海曙区/学校1", "浙江省/宁波市/海曙区/学校2", "浙江省/宁波市/江北区/学校1", "浙江省/宁波市/江北区/学校2", "浙江省/宁波市/鄞州区/学校1", "浙江省/杭州市/上城区/学校1", "浙江省/杭州市/上城区/学校2", "浙江省/杭州市/下城区/学校1", "浙江省/杭州市/西湖区/学校1", "浙江省/杭州市/下沙区/学校1", "江苏省/南京市/鼓楼区/学校1", "江苏省/南京市/浦口区/学校1", "江苏省/无锡市/惠山区/学校1"};
List<Node> resultList = new ArrayList<>();
for(String str : strs){
String[] indexString = str.split("/");
trace(indexString,resultList);
}
System.out.println(JsonUtil.toJson(resultList));
}
public static void trace(String[] nameDetail,List<Node> nodeList){
Node parent = null;
List<Node> nodeListTemp = nodeList;
for(int i=0;i<nameDetail.length; i++){
parent = isInNode(parent,(i+1),nameDetail[i],nodeListTemp);
if(!CollectionUtils.isEmpty(parent.getChildren())){
nodeListTemp = parent.getChildren();
} else{
nodeListTemp = new ArrayList<>();
}
}
}
/**
*
* @param parent
* @param level
* @param name
* @param nodeList
* @return
*/
public static Node isInNode(Node parent,Integer level,String name,List<Node> nodeList){
if(CollectionUtils.isEmpty(nodeList) || !nodeList.stream().filter(entity->entity.getName().equals(name)).findFirst().isPresent()){
Node node = new Node(name,level);
nodeList.add(node);
if(parent != null) parent.setChildren(nodeList);
return node;
}
return nodeList.stream().filter(entity->entity.getName().equals(name)).findFirst().get();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public List<Node> getChildren() {
return children;
}
public void setChildren(List<Node> children) {
this.children = children;
}
}
| UTF-8 | Java | 2,928 | java | Node.java | Java | [
{
"context": ".List;\nimport java.util.Optional;\n\n/**\n * @Auther: pcc\n * @Date: 2021/12/30 16:35\n * @Description:\n */\np",
"end": 257,
"score": 0.9994865655899048,
"start": 254,
"tag": "USERNAME",
"value": "pcc"
}
] | null | [] | package com.blackfish.java.suanfa;
import com.blackfish.java.util.common.JsonUtil;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
/**
* @Auther: pcc
* @Date: 2021/12/30 16:35
* @Description:
*/
public class Node {
public String name;
public Integer level;
public List<Node> children;
public Node(String name, Integer level) {
this.name = name;
this.level = level;
}
public static void main(String[] args) {
String[] strs = new String[]{"浙江省/宁波市/海曙区/学校1", "浙江省/宁波市/海曙区/学校2", "浙江省/宁波市/江北区/学校1", "浙江省/宁波市/江北区/学校2", "浙江省/宁波市/鄞州区/学校1", "浙江省/杭州市/上城区/学校1", "浙江省/杭州市/上城区/学校2", "浙江省/杭州市/下城区/学校1", "浙江省/杭州市/西湖区/学校1", "浙江省/杭州市/下沙区/学校1", "江苏省/南京市/鼓楼区/学校1", "江苏省/南京市/浦口区/学校1", "江苏省/无锡市/惠山区/学校1"};
List<Node> resultList = new ArrayList<>();
for(String str : strs){
String[] indexString = str.split("/");
trace(indexString,resultList);
}
System.out.println(JsonUtil.toJson(resultList));
}
public static void trace(String[] nameDetail,List<Node> nodeList){
Node parent = null;
List<Node> nodeListTemp = nodeList;
for(int i=0;i<nameDetail.length; i++){
parent = isInNode(parent,(i+1),nameDetail[i],nodeListTemp);
if(!CollectionUtils.isEmpty(parent.getChildren())){
nodeListTemp = parent.getChildren();
} else{
nodeListTemp = new ArrayList<>();
}
}
}
/**
*
* @param parent
* @param level
* @param name
* @param nodeList
* @return
*/
public static Node isInNode(Node parent,Integer level,String name,List<Node> nodeList){
if(CollectionUtils.isEmpty(nodeList) || !nodeList.stream().filter(entity->entity.getName().equals(name)).findFirst().isPresent()){
Node node = new Node(name,level);
nodeList.add(node);
if(parent != null) parent.setChildren(nodeList);
return node;
}
return nodeList.stream().filter(entity->entity.getName().equals(name)).findFirst().get();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public List<Node> getChildren() {
return children;
}
public void setChildren(List<Node> children) {
this.children = children;
}
}
| 2,928 | 0.597653 | 0.587434 | 93 | 27.408602 | 36.209736 | 284 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.634409 | false | false | 2 |
54df19efe58d0f8c64e1adb9e580904e2c4b0373 | 28,149,215,707,076 | 6494659d66475e9e5e3bda47574a595280356e98 | /TallerDeJava/src/Punto6/Punt06.java | 277db455a126cbe002d83f89427ac291aee90a2d | [] | no_license | WIlsonFernandez5/TrabajosDeProgramacion | https://github.com/WIlsonFernandez5/TrabajosDeProgramacion | f2d85cc6dadeea4447c14571079944cd8dd04b8d | 0c85cf4460e3fd7b954aca2dec55a2fda86e4994 | refs/heads/main | 2023-07-23T20:03:18.794000 | 2021-08-30T00:53:22 | 2021-08-30T00:53:22 | 401,175,828 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Punto6;
import java.util.Scanner;
public class Punt06 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int peso;
float altura;
float resultadoBMI;
String nombre;
System.out.println("Ingrese el nombre : ") ;
nombre = sc.next();
System.out.println("Ingrese el peso : ");
peso = sc.nextInt();
System.out.println("Ingrese la altura : ");
altura = sc.nextFloat();
resultadoBMI = peso / altura*altura;
//mostrar resultado
System.out.println("La persona " + nombre + " tiene el resultado del BMI en :" + resultadoBMI );
}
}
| UTF-8 | Java | 759 | java | Punt06.java | Java | [] | null | [] |
package Punto6;
import java.util.Scanner;
public class Punt06 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int peso;
float altura;
float resultadoBMI;
String nombre;
System.out.println("Ingrese el nombre : ") ;
nombre = sc.next();
System.out.println("Ingrese el peso : ");
peso = sc.nextInt();
System.out.println("Ingrese la altura : ");
altura = sc.nextFloat();
resultadoBMI = peso / altura*altura;
//mostrar resultado
System.out.println("La persona " + nombre + " tiene el resultado del BMI en :" + resultadoBMI );
}
}
| 759 | 0.525692 | 0.521739 | 33 | 21.969696 | 22.543541 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false | 13 |
5a998167b6471db00726f202d139e837e1d3d010 | 7,722,351,242,477 | 6e3cf20a44fcffad351bbae9b8548c36de4a5e3a | /app/src/main/java/com/finder/filmfinder/Pojo/Film.java | 1a2fd9e40ee65d2fd8ad936713f5524d13508e9c | [] | no_license | Nixon3333/FilmFinder | https://github.com/Nixon3333/FilmFinder | f5c8ba8b9e5e874a7194214260dfca9e24a47217 | cf885fe4126969503618210f88151ce5dbc88d36 | refs/heads/master | 2020-04-23T19:12:12.612000 | 2019-02-20T06:00:59 | 2019-02-20T06:00:59 | 171,394,209 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.finder.filmfinder.Pojo;
import android.support.annotation.NonNull;
import com.google.gson.annotations.SerializedName;
public class Film implements Comparable<Film>{
@SerializedName("id")
private long id;
@SerializedName("localized_name")
private String localizedName;
@SerializedName("name")
private String name;
@SerializedName("year")
private int year;
@SerializedName("rating")
private float rating;
@SerializedName("image_url")
private String imageUrl;
@SerializedName("description")
private String description;
public long getId() {
return id;
}
public String getLocalizedName() {
return localizedName;
}
public String getName() {
return name;
}
public long getYear() {
return year;
}
public float getRating() {
return rating;
}
public String getImageUrl() {
return imageUrl;
}
public String getDescription() {
return description;
}
@Override
public String toString() {
return "Film{" +
"localizedName='" + localizedName + '\'' +
", year=" + year +
", rating=" + rating +
'}';
}
@Override
public int compareTo(@NonNull Film film) {
return Float.compare(film.rating, this.rating);
}
}
| UTF-8 | Java | 1,393 | java | Film.java | Java | [] | null | [] |
package com.finder.filmfinder.Pojo;
import android.support.annotation.NonNull;
import com.google.gson.annotations.SerializedName;
public class Film implements Comparable<Film>{
@SerializedName("id")
private long id;
@SerializedName("localized_name")
private String localizedName;
@SerializedName("name")
private String name;
@SerializedName("year")
private int year;
@SerializedName("rating")
private float rating;
@SerializedName("image_url")
private String imageUrl;
@SerializedName("description")
private String description;
public long getId() {
return id;
}
public String getLocalizedName() {
return localizedName;
}
public String getName() {
return name;
}
public long getYear() {
return year;
}
public float getRating() {
return rating;
}
public String getImageUrl() {
return imageUrl;
}
public String getDescription() {
return description;
}
@Override
public String toString() {
return "Film{" +
"localizedName='" + localizedName + '\'' +
", year=" + year +
", rating=" + rating +
'}';
}
@Override
public int compareTo(@NonNull Film film) {
return Float.compare(film.rating, this.rating);
}
}
| 1,393 | 0.595836 | 0.595836 | 71 | 18.605635 | 16.185091 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.309859 | false | false | 13 |
58d30de4dd3caaa2a39f3bc97fbd9ff647fbdfbd | 27,822,798,187,555 | 1f7a8a0a76e05d096d3bd62735bc14562f4f071a | /NeverPuk/net/c1/l.java | 5ec912ebe5ea11c1218c6620d5c2e4e7938a8735 | [] | no_license | yunusborazan/NeverPuk | https://github.com/yunusborazan/NeverPuk | b6b8910175634523ebd4d21d07a4eb4605477f46 | a0e58597858de2fcad3524daaea656362c20044d | refs/heads/main | 2023-05-10T09:08:02.183000 | 2021-06-13T17:17:50 | 2021-06-13T17:17:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.c1;
import net.xn;
import net.c1.c;
import net.c1.d;
import net.c1.e;
import net.c1.y;
import net.nl.z2;
public class l extends c {
public l(c.u var1, z2... var2) {
super(var1, d.BOW, var2);
this.Q("arrowInfinite");
}
public int O(int var1) {
return 20;
}
public int x(int var1) {
return 50;
}
public int h() {
return 1;
}
public boolean k(c var1) {
String var2 = y.j();
return !(var1 instanceof e) && super.k(var1);
}
private static xn a(xn var0) {
return var0;
}
}
| UTF-8 | Java | 570 | java | l.java | Java | [] | null | [] | package net.c1;
import net.xn;
import net.c1.c;
import net.c1.d;
import net.c1.e;
import net.c1.y;
import net.nl.z2;
public class l extends c {
public l(c.u var1, z2... var2) {
super(var1, d.BOW, var2);
this.Q("arrowInfinite");
}
public int O(int var1) {
return 20;
}
public int x(int var1) {
return 50;
}
public int h() {
return 1;
}
public boolean k(c var1) {
String var2 = y.j();
return !(var1 instanceof e) && super.k(var1);
}
private static xn a(xn var0) {
return var0;
}
}
| 570 | 0.559649 | 0.517544 | 36 | 14.833333 | 12.648012 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 13 |
89efd99f6d0bf05fe074304cb30bdfbc8226c3d6 | 4,097,398,850,148 | 2ec9a5838ee4f035b8f844e7daf3053391fcb5e4 | /Software/src/java/br/udesc/ceavi/produto/model/entidade/CestaProduto.java | 662d4d5eb84751a94cf60f92c1c2c5b1e707c579 | [] | no_license | gabrielnaoto/hapiness-chest | https://github.com/gabrielnaoto/hapiness-chest | 91c2d25d086e2d3f2cf35998f84895bb6dda0c27 | a88c10278a9c82e94bbcd6a06cdb01a341492f76 | refs/heads/master | 2021-06-01T07:44:54.881000 | 2016-06-23T03:34:30 | 2016-06-23T03:34:30 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.udesc.ceavi.produto.model.entidade;
public class CestaProduto {
private int id;
private Cesta cesta;
private Produto produto;
private double valor;
public CestaProduto() {
}
public CestaProduto(Cesta cesta, Produto produto, double valor) {
this.cesta = cesta;
this.produto = produto;
this.valor = valor;
}
public CestaProduto(int id, Cesta cesta, Produto produto, double valor) {
this.id = id;
this.cesta = cesta;
this.produto = produto;
this.valor = valor;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Cesta getCesta() {
return cesta;
}
public void setCesta(Cesta cesta) {
this.cesta = cesta;
}
public Produto getProduto() {
return produto;
}
public void setProduto(Produto produto) {
this.produto = produto;
}
public double getValor() {
return valor;
}
public void setValor(double valor) {
this.valor = valor;
}
}
| UTF-8 | Java | 1,107 | java | CestaProduto.java | Java | [] | null | [] | package br.udesc.ceavi.produto.model.entidade;
public class CestaProduto {
private int id;
private Cesta cesta;
private Produto produto;
private double valor;
public CestaProduto() {
}
public CestaProduto(Cesta cesta, Produto produto, double valor) {
this.cesta = cesta;
this.produto = produto;
this.valor = valor;
}
public CestaProduto(int id, Cesta cesta, Produto produto, double valor) {
this.id = id;
this.cesta = cesta;
this.produto = produto;
this.valor = valor;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Cesta getCesta() {
return cesta;
}
public void setCesta(Cesta cesta) {
this.cesta = cesta;
}
public Produto getProduto() {
return produto;
}
public void setProduto(Produto produto) {
this.produto = produto;
}
public double getValor() {
return valor;
}
public void setValor(double valor) {
this.valor = valor;
}
}
| 1,107 | 0.580849 | 0.580849 | 58 | 18.086206 | 17.270948 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.431034 | false | false | 13 |
5f589acbef576078c22fc7c060b14f88e3a7ea10 | 26,207,890,441,983 | c617d172d1e04fa12ea0c01a25c323d6f8399038 | /Android-tracker/app/src/main/java/ru/jumatiy/tracker/event/TrackerEvent.java | ab26bcc8de3593da0a4c23ba962d24cd296f2143 | [
"MIT"
] | permissive | zhum/AndroidTracker | https://github.com/zhum/AndroidTracker | 51f9a8156b84365b1c2868fc52fb05d96c441868 | 8b89043a4c434ced09667f1e515369d55a47a10e | refs/heads/master | 2021-01-19T13:52:51.013000 | 2015-05-07T08:42:55 | 2015-05-07T08:42:55 | 35,208,446 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ru.jumatiy.tracker.event;
/**
* Created by Sarimsakov Bakhrom Azimovich on 12.04.2015 11:35.
*/
public class TrackerEvent {
public static final int NEW_LOCATION_ADDED = 1001;
}
| UTF-8 | Java | 200 | java | TrackerEvent.java | Java | [
{
"context": "ge ru.jumatiy.tracker.event;\r\n\r\n/**\r\n * Created by Sarimsakov Bakhrom Azimovich on 12.04.2015 11:35.\r\n */\r\npublic class TrackerEv",
"end": 84,
"score": 0.9998421669006348,
"start": 56,
"tag": "NAME",
"value": "Sarimsakov Bakhrom Azimovich"
}
] | null | [] | package ru.jumatiy.tracker.event;
/**
* Created by <NAME> on 12.04.2015 11:35.
*/
public class TrackerEvent {
public static final int NEW_LOCATION_ADDED = 1001;
}
| 178 | 0.7 | 0.62 | 8 | 23 | 23.690716 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 13 |
0815326dab357cdbee56f3dff8d62151da199452 | 26,207,890,440,364 | ca00ce97779e7acac14b5bc54914014d58605ac4 | /kuaihuo-parent/phshopping-api-platform/src/main/java/com/ph/member/api/vo/HeadhuntingPageVO.java | f60d19e0751694b63dcbf95edb329af88c13636e | [] | no_license | sengeiou/project-3 | https://github.com/sengeiou/project-3 | 15d384b4dee2f8c119af120e0971bc63c27208a3 | 4499b73e1bab58e895100ff1f53ad544a2a846a5 | refs/heads/master | 2023-03-15T12:39:44.199000 | 2017-11-16T03:41:51 | 2017-11-16T03:41:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* @Title: HeadhuntingPageVO.java
* @Package com.ph.member.api.vo
* @Description: TODO(用一句话描述该文件做什么)
* @author: 李杰
* @date: 2017年7月12日 上午10:27:10
* @version V1.0
* @Copyright: 2017
*/
package com.ph.member.api.vo;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName: HeadhuntingPageVO
* @Description:TODO(这里用一句话描述这个类的作用)
* @author: 李杰
* @date: 2017年7月12日 上午10:27:10
* @Copyright: 2017
*/
public class HeadhuntingPageVO implements Serializable{
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 8949947367103400944L;
/**
* 总数
*/
private Integer total;
/**
* 列表数据
*/
private List<HeadhuntingVO> data;
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public List<HeadhuntingVO> getData() {
return data;
}
public void setData(List<HeadhuntingVO> data) {
this.data = data;
}
}
| UTF-8 | Java | 1,124 | java | HeadhuntingPageVO.java | Java | [
{
"context": "Description: TODO(用一句话描述该文件做什么) \n * @author: 李杰 \n * @date: 2017年7月12日 上午10:27:10 \n * @vers",
"end": 136,
"score": 0.7751520276069641,
"start": 134,
"tag": "NAME",
"value": "李杰"
},
{
"context": " @Description:TODO(这里用一句话描述这个类的作用) \n * @author: 李杰\n * @date: 2017年7月12日 上午10:27:10 \n * @Copyri",
"end": 404,
"score": 0.952609121799469,
"start": 402,
"tag": "NAME",
"value": "李杰"
}
] | null | [] | /**
* @Title: HeadhuntingPageVO.java
* @Package com.ph.member.api.vo
* @Description: TODO(用一句话描述该文件做什么)
* @author: 李杰
* @date: 2017年7月12日 上午10:27:10
* @version V1.0
* @Copyright: 2017
*/
package com.ph.member.api.vo;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName: HeadhuntingPageVO
* @Description:TODO(这里用一句话描述这个类的作用)
* @author: 李杰
* @date: 2017年7月12日 上午10:27:10
* @Copyright: 2017
*/
public class HeadhuntingPageVO implements Serializable{
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 8949947367103400944L;
/**
* 总数
*/
private Integer total;
/**
* 列表数据
*/
private List<HeadhuntingVO> data;
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public List<HeadhuntingVO> getData() {
return data;
}
public void setData(List<HeadhuntingVO> data) {
this.data = data;
}
}
| 1,124 | 0.656375 | 0.601594 | 52 | 18.307692 | 17.417429 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.730769 | false | false | 13 |
8e647a59b72e00ab434cb4bd2f9e9418e85278e7 | 103,079,264,893 | 26865fa026611ddd2da403175b53bde575fc660d | /src/main/java/jocket/wait/BusyYieldSleep.java | 1b41b1db42e94f48dd401f28cf3a7eba7f7fbca3 | [
"Apache-2.0"
] | permissive | zhiji6/jocket | https://github.com/zhiji6/jocket | ca87aacb222a2b5bd8177ef44da5a8ae5588bb93 | fbbfda244f9a6f2e0d3ff1ad1fb99be04031643d | refs/heads/master | 2020-04-12T07:57:00.476000 | 2018-10-25T07:31:50 | 2018-10-25T07:31:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package jocket.wait;
import java.util.concurrent.locks.LockSupport;
public class BusyYieldSleep implements WaitStrategy {
public static final int SPIN = 1000000;
public static final int YIELD = SPIN + 1;
public static final int SLEEP = YIELD + 1;
private int counter;
@Override
public void pauseWhile(int seq) {
int counter = this.counter++;
if (counter < SPIN)
return;
else if (counter < YIELD)
Thread.yield();
else if (counter < SLEEP)
LockSupport.parkNanos(1);
else {
this.counter = 0;
}
}
@Override
public void reset() {
counter = 0;
}
}
| UTF-8 | Java | 622 | java | BusyYieldSleep.java | Java | [] | null | [] | package jocket.wait;
import java.util.concurrent.locks.LockSupport;
public class BusyYieldSleep implements WaitStrategy {
public static final int SPIN = 1000000;
public static final int YIELD = SPIN + 1;
public static final int SLEEP = YIELD + 1;
private int counter;
@Override
public void pauseWhile(int seq) {
int counter = this.counter++;
if (counter < SPIN)
return;
else if (counter < YIELD)
Thread.yield();
else if (counter < SLEEP)
LockSupport.parkNanos(1);
else {
this.counter = 0;
}
}
@Override
public void reset() {
counter = 0;
}
}
| 622 | 0.646302 | 0.62701 | 33 | 17.848484 | 16.104057 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false | 13 |
8dc9b6ad654280c261b8b9b236763c38f7032889 | 29,137,058,181,286 | 1142b68ea8e727a56e6d7ac0c98b994b530dd533 | /happy_farm/src/main/java/com/city2farmer/HappyfarmDB.java | e187a7effacd42d291cb522b720aab8e4531d212 | [] | no_license | Rexrock3027/happy_farm | https://github.com/Rexrock3027/happy_farm | 3039ac0bb6d8ec8bd3c2f5ed93ca4f89fb19117d | 073ad57161399f0f9e802b3856aff39133d56745 | refs/heads/master | 2023-03-25T17:15:18.603000 | 2021-03-26T07:59:24 | 2021-03-26T07:59:24 | 351,628,816 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.city2farmer;
import android.content.ContentValues;
import android.content.Context;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.StrictMode;
import android.util.Log;
import androidx.annotation.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class HappyfarmDB extends SQLiteOpenHelper {
// =======================7====================
public String sCreateTableCommand;
private static final String COLUMN_ = "VitC";
Context context;
SQLiteDatabase db;
private Resources mResources;
public static final String DB_TABLE07 = "nutrition";
public static final String COLUMN_NAME = "Plant";
public static final String COLUMN_ITEM = "Calories";
public static final String COLUMN_Content = "K";
public static final String COLUMN_Description = "VitA";
private static final String SQL_CREATE_BUGS_TABLE = "CREATE TABLE " + DB_TABLE07 + " (" +
"ID INTEGER PRIMARY KEY AUTOINCREMENT," +
COLUMN_NAME + " TEXT NOT NULL, " +
COLUMN_ITEM + " INTEGER NOT NULL, " +
COLUMN_Content + " INTEGER NOT NULL, " +
COLUMN_Description + " INTEGER NOT NULL, " +
COLUMN_ + " FLOAT NOT NULL " + " );";
// =======================7=========================
// 資料庫名稱=========12================
private static final String TAG = HappyfarmDB.class.getSimpleName();
private static final String DB_File = "happyfarm.db";
private static final String DB_TABLE12 = "HA1200"; // 資料庫物件,固定的欄位變數
public static final int VERSION = 7;
private static final String crTBsql12 = " CREATE TABLE " + DB_TABLE12 + " (l0101 INTEGER PRIMARY KEY, l0102 TEXT NOT NULL, l0103 TEXT, l0104 TEXT, l0105 TEXT, l0106 TEXT, l0107 TEXT, l0108 TEXT); ";
private static SQLiteDatabase database;
private String totle = "全區";
//==================12===========================
//========================5=================================
private static final String DB_TABLE05 = "ha0500"; // 資料庫物件,固定的欄位變數
private static final String crTBsql05 = " CREATE TABLE " + DB_TABLE05 + " (n0101 INTEGER PRIMARY KEY, n0102 TEXT NOT NULL, n0103 TEXT, n0104 TEXT, n0105 TEXT,n0106 TEXT); ";
//=======================5==================================
//=======================6==================================
private static final String DB_TABLE06 = "HA0600"; // 資料表名稱
private static final String crTBsql06 = "CREATE TABLE " + DB_TABLE06 + " ( "
+ "id INTEGER PRIMARY KEY," +"SE001 TEXT NOT NULL , "
+ "CroNam TEXT NOT NULL,"
+ "PN001 TEXT,"
+ "PN002 TEXT,"
+ "PU001 TEXT,"
+ "PU002 TEXT,"
+ "ST001 TEXT,"
+ "ST002 TEXT);";// 資料庫物件,固定的欄位變數
//=======================6==================================
//===========================13===============================
private static final String DB_TABLE13 = "HA1301"; // 資料庫物件,固定的欄位變數
private static final String crTBsql13 = " CREATE TABLE " + DB_TABLE13 + " (r0201 INTEGER PRIMARY KEY, r0202 TEXT , r0203 TEXT, r0204 TEXT,r0205 TEXT); ";
//=========================13====================================
//========================14=================================
private static final String DB_TABLE14 = "HA1400"; // 資料庫物件,固定的欄位變數
private static final String crTBsql14 = "CREATE TABLE " + DB_TABLE14 + " (y0101 INTEGER PRIMARY KEY, y0102 TEXT NOT NULL, y0103 TEXT, y0104 TEXT, y0105 TEXT, y0106 TEXT); ";
//=======================14_===================================
public HappyfarmDB(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
// super(context, name, factory, version);
super(context, DB_File, null, VERSION);
sCreateTableCommand = "";
mResources = context.getResources();
db = this.getWritableDatabase();
}
@Override
public void onCreate(SQLiteDatabase db) {
//================使用別人的APP================================
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
//======================================================
db.execSQL(crTBsql05);
db.execSQL(crTBsql06);
db.execSQL(SQL_CREATE_BUGS_TABLE);
db.execSQL(crTBsql13);
db.execSQL(crTBsql12);
db.execSQL(crTBsql14);
// ===============07==================
// final String SQL_CREATE_BUGS_TABLE = "CREATE TABLE " + DB_TABLE07 + " (" +
// "ID INTEGER PRIMARY KEY AUTOINCREMENT," +
// COLUMN_NAME + " TEXT NOT NULL, " +
// COLUMN_ITEM + " INTEGER NOT NULL, " +
// COLUMN_Content + " INTEGER NOT NULL, " +
// COLUMN_Description + " INTEGER NOT NULL, " +
// COLUMN_ + " FLOAT NOT NULL " + " );";
//db.execSQL(SQL_CREATE_BUGS_TABLE);
Log.d(TAG, "Database Created Successfully");
try {
readDataToDb(db);
} catch (Exception e) {
e.printStackTrace();
}
// ==============07_====================
}
//=====================07==========================
private void readDataToDb(SQLiteDatabase db) {
final String MNU_NAME = "Plant";
final String MNU_ITEM = "Calories";
final String MNU_CONTENT = "K";
final String MNU_DESCRIPTION = "VitA";
final String MNU_ = "VitC";
try {
String jsonDataString = readJsonDataFromFile();
JSONArray menuItemsJsonArray = new JSONArray(jsonDataString);
for (int i = 0; i < menuItemsJsonArray.length(); ++i) {
String name;
String item;
String content;
String description;
String VitC;
JSONObject menuItemObject = menuItemsJsonArray.getJSONObject(i);
name = menuItemObject.getString(MNU_NAME);
item = menuItemObject.getString(MNU_ITEM);
content = menuItemObject.getString(MNU_CONTENT);
description = menuItemObject.getString(MNU_DESCRIPTION);
VitC = menuItemObject.getString(MNU_);
ContentValues menuValues = new ContentValues();
menuValues.put(COLUMN_NAME, name);
menuValues.put(COLUMN_ITEM, item);
menuValues.put(COLUMN_Content, content);
menuValues.put(COLUMN_Description, description);
menuValues.put(COLUMN_, VitC);
db.insert(DB_TABLE07, null, menuValues);
Log.d(TAG, "Inserted Successfully " + menuValues);
}
} catch (JSONException | IOException e) {
Log.e(TAG, e.getMessage(), e);
e.printStackTrace();
}
}
private String readJsonDataFromFile() throws IOException {
InputStream inputStream = null;
StringBuilder builder = new StringBuilder();
try {
String jsonDataString = null;
inputStream = mResources.openRawResource(R.raw.nutrition_0928);
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(inputStream, "UTF-8"));
while ((jsonDataString = bufferedReader.readLine()) != null) {
builder.append(jsonDataString);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
inputStream.close();
}
}
return new String(builder);
}
// public ArrayList<String> getRecSet() {
// SQLiteDatabase db = getReadableDatabase();
// String sql = "SELECT * FROM " + DB_TABLE07;
// Cursor recSet = db.rawQuery(sql, null);
// ArrayList<String> recAry = new ArrayList<String>();
//
// //----------------------------
// Log.d(TAG, "recSet=" + recSet);
// int columnCount = recSet.getColumnCount();
// while (recSet.moveToNext()) {
// String fldSet = "";
// for (int i = 0; i < columnCount; i++)
// fldSet += recSet.getString(i) + "#";
// recAry.add(fldSet);
// }
// //------------------------
// recSet.close();
// //db.close();
//
// Log.d(TAG, "recAry=" + recAry);
// return recAry;
// }
public String[] getOneRec(int position) {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE07 +" WHERE `ID`="+position+";";
Cursor nw = db.rawQuery(sql, null);
int columnCount = nw.getColumnCount();
String[] nwAry =new String[columnCount];
while (nw.moveToNext()) {
for (int i = 0; i < columnCount; i++){
String yy = nw.getString(0);
nwAry[i]=nw.getString(i);
}
}
nw.close();
return nwAry;
};
// =====================07_===========================
@Override
public void onOpen(SQLiteDatabase db) {
super.onOpen(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// ddl 語法
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE05);
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE06);
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE07);
//onCreate(db);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE12);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE13);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE14);
onCreate(db);
}
// 需要資料庫的元件呼叫這個方法,這個方法在一般的應用都不需要修改
// ====================12==============================
public static SQLiteDatabase getDatabase(Context context) {
if (database == null || !database.isOpen()) {
database = new HappyfarmDB(context, DB_File, null, VERSION)
.getWritableDatabase();
}
return database;
}
public int RecCount() {
SQLiteDatabase db = getWritableDatabase();
// 這串語法是記算選擇的table有幾筆資料
String sql = "SELECT * FROM " + DB_TABLE12;
Cursor recSet = db.rawQuery(sql, null);
return recSet.getCount();
}
// 縣市
public List<String> getAll_l0103() {
List<String> labels = new ArrayList<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE12;
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
String s = ""; //跟labels比對用
if (cursor.moveToFirst()) {
do {
// 如果重複就跳出
if (!labels.contains(s)) {
labels.add(cursor.getString(2));
}
s = cursor.getString(2);
} while (cursor.moveToNext());
}
//
// cursor.close();
// db.close();
return labels;
}
// 縣市
public List<String> getAll_l0104(String company) {
List<String> labels = new ArrayList<String>();
// 用HashSet去判斷裡面的所有資料有沒有重複
Set<String> set = new HashSet<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0103 = '" + company + "' ";
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
labels.add(totle);
if (cursor.moveToFirst()) {
do {
//// 用以下的方法不行判斷亂排的資料有沒有重複
// if(!labels.contains(s)){
// labels.add(cursor.getString(3));
// }
// s = cursor.getString(3);
// 要用HashSet去看全部的資料有沒有重複
set.add(cursor.getString(3));
} while (cursor.moveToNext());
}
labels.addAll(set);
// cursor.close();
// db.close();
return labels;
}
// 公司名稱,地址,電話
public ArrayList<Map<String, Object>> getAll_l0105(String counties, String asdt) {
List<String> labels = new ArrayList<String>();
String selectQuery = "";
if(asdt == totle){
selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0103 = '" + counties + "' ";
}else {
selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0104 = '" + asdt + "' AND l0103 = '" + counties + "' ";
}
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
ArrayList<Map<String, Object>> mLsit = new ArrayList<Map<String, Object>>();
// for(int i=0;i<arrayshop.length;i++) {
// Map<String, Object> item = new HashMap<String, Object>();
// item.put("shopname", arrayshop[i][0]);
// item.put("address", arrayshop[i][1]);
// item.put("telphone", arrayshop[i][2]);
// mLsit.add(item);
if (cursor.moveToFirst()) {
do {
Map<String, Object> item = new HashMap<String, Object>();
item.put("shopname", cursor.getString(1));
item.put("address", cursor.getString(4));
item.put("telphone", cursor.getString(5));
mLsit.add(item);
} while (cursor.moveToNext());
}
// cursor.close();
// db.close();
return mLsit;
}
// ==========================12_=============================
// =====================5===============================
public Long insertRec05(String b_n0102, String b_n0103, String b_n0104, String b_n0105) {
SQLiteDatabase db = getWritableDatabase();
ContentValues rec = new ContentValues();
//rec.put("n0101", b_n0101);
rec.put("n0102", b_n0102);
rec.put("n0103", b_n0103);
rec.put("n0104", b_n0104);
rec.put("n0105", b_n0105);
long rowID = db.insert(DB_TABLE05, null, rec);
db.close();
return rowID;
}
public Integer RecCount05() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
//選擇的TABLE有幾筆
Cursor recSet = db.rawQuery(sql, null);
return recSet.getCount();
}
//============測試清空資料庫==================
public int clearRec05() {
SQLiteDatabase db = getWritableDatabase(); //寫入資料庫
String sql = "SELECT * FROM " + DB_TABLE05; //帶入資料表資料
Cursor recSet = db.rawQuery(sql, null); //查詢資料
//------------------------------------------------
if (recSet.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE05, "1", null); //1代表全部
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected; //傳回值
} else {
//db.close();
return -1; //-1傳回空值
}
}
//==============修改筆記=============================
public int updateRec05(String b_n0101, String b_n0102, String b_n0103, String b_n0104, String b_n0105) {
SQLiteDatabase db = getWritableDatabase();
String sql = " SELECT * FROM " + DB_TABLE05;
Cursor recSet = db.rawQuery(sql, null);
if (recSet.getCount() != 0) {
ContentValues rec = new ContentValues();
rec.put("n0102", b_n0102);
rec.put("n0103", b_n0103);
rec.put("n0104", b_n0104);
rec.put("n0105", b_n0105);
String whereClause = " n0101= '" + b_n0101 + "'"; //帶入ID
int rowsAffected05 = db.update(DB_TABLE05, rec, whereClause, null); //whereClause只更改當筆資料
recSet.close();
//db.close();
return rowsAffected05;
} else {
recSet.close();
//db.close();
return -1;
}
}
public ArrayList<String> getRecSet05() {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
Cursor recSet05 = db.rawQuery(sql, null);
ArrayList<String> recAry05 = new ArrayList<String>();
//----------------------------
Log.d(TAG, "recSet05=" + recSet05);
int columnCount = recSet05.getColumnCount();
while (recSet05.moveToNext()) {
String fldSet05 = "";
for (int i = 0; i < columnCount; i++)
fldSet05 += recSet05.getString(i) + "#";
recAry05.add(fldSet05);
}
//------------------------
recSet05.close();
//db.close();
Log.d(TAG, "recAry05=" + recAry05);
return recAry05;
}
//================deleteRec確定刪除===========================
public int deleteRec05(String b_n0101) {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
Cursor recSet05 = db.rawQuery(sql, null);
if (recSet05.getCount() != 0) {
String whereClause = " n0101= '" + b_n0101 + "'";
int rowsAffected = db.delete(DB_TABLE05, whereClause, null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
recSet05.close();
//db.close();
return rowsAffected;
} else {
recSet05.close();
//db.close();
return -1;
}
}
//==============新增================
// ContentValues values
public long insertRec05_m(ContentValues rec) {
SQLiteDatabase db = getWritableDatabase();
long rowID05 = db.insert(DB_TABLE05, null, rec);
db.close();
return rowID05;
}
// ==================5==============================
//====================6===============================
// ContentValues values
public long insertRec_m06 (ContentValues rec){
SQLiteDatabase db = getWritableDatabase();
long rowID06 = db.insert(DB_TABLE06, null, rec);
db.close();
return rowID06;
}
public int RecCount06() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
return recSet06.getCount();
}
public ArrayList<String> getRecSet06() {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
ArrayList<String> recAry06 = new ArrayList<String>();
//----------------------------
Log.d(TAG, "recSet06=" + recSet06);
int columnCount = recSet06.getColumnCount();
while (recSet06.moveToNext()) {
String fldSet = "";
for (int i = 0; i < columnCount; i++)
fldSet += recSet06.getString(i) + "#";
recAry06.add(fldSet);
}
//------------------------
recSet06.close();
db.close();
Log.d(TAG, "recAry06=" + recAry06);
return recAry06;
}
// public void createTB06() {
// // 批次新增
// int maxrec = 40;
// SQLiteDatabase db = getWritableDatabase();
// for (int i = 0; i < maxrec; i++) {
// ContentValues newRow = new ContentValues();
// newRow.put("CroNam", "作物" + u_chinayear(i));
// newRow.put("PN001", "昆蟲" + u_chinano((int) (Math.random() * 4 + 1)) + "號");
// newRow.put("PU001", "https://i.imgur.com/eHpPvXD.jpg ");
// newRow.put("ST001", "處理方法" + (1+ i) );
// newRow.put("PN002", "病害" + u_chinano((int) (Math.random() * 4 + 1)) + "號");
// newRow.put("PU002", "https://i.imgur.com/jfRBzDC.jpg ");
// newRow.put("ST002", "處理方法" + (1+ i));
// db.insert(DB_TABLE06, null, newRow);
// }
// //db.close();
// }
// private String u_chinano(int input_i) {
// String c_number = "";
// String china_no[] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
// c_number = china_no[input_i % 10];
//
// return c_number;
// }
//
// private String u_chinayear(int input_i) {
// String c_number = "";
// String china_no[] = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"};
// c_number = china_no[input_i % 10];
//
// return c_number;
// }
public int clearRec06() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
// //-----------
// Cursor c1=db.execSQL("");
// Cursor c2=db.rawQuery();
// Cursor c3=db.insert();
// Cursor c4=db.update(, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , );
// Cursor c5=db.delete();
// //------------------------------------------------
if (recSet06.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE06, "1", null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected;
} else {
//db.close();
return -1;
}
}
public int updateRec06 (String b_id, String b_crop, String b_pes1, String b_url1, String
b_sol1, String b_pes2, String b_url2, String b_sol2){
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
if (recSet06.getCount() != 0) {
ContentValues rec = new ContentValues();
//rec.put("id", b_id);
rec.put("CroNam", b_crop);
rec.put("PN001", b_pes1);
rec.put("PU001", b_url1);
rec.put("ST001", b_sol1);
rec.put("PN002", b_pes2);
rec.put("PU002", b_url2);
rec.put("ST002", b_sol2);
String whereClause = "id='" + b_id + "'";
int rowsAffected06 = db.update(DB_TABLE06, rec, whereClause, null);
recSet06.close();
db.close();
return rowsAffected06;
} else {
db.close();
return -1;
}
}
public int deleteRec06 (String b_id){
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
if (recSet06.getCount() != 0) {
String whereClause = "id='" + b_id + "'";
int rowsAffected06 = db.delete(DB_TABLE06, whereClause, null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
recSet06.close();
db.close();
return rowsAffected06;
} else {
recSet06.close();
db.close();
return -1;
}
}
public List<String> getCroNam(String b_season) {
SQLiteDatabase db = getReadableDatabase(); //讀
List<String> labels = new ArrayList<String>();
// 用HashSet去判斷裡面的所有資料有沒有重複
Set<String> set = new HashSet<String>();
String sql = "SELECT * FROM " + DB_TABLE06 + " WHERE SE001 = '" + b_season + "' ";
int aa=0;
Cursor cursor = db.rawQuery(sql, null);
int bb=0;
if (cursor.moveToFirst()) {
do {
set.add(cursor.getString(2));
} while (cursor.moveToNext());
}
labels.add("選擇作物");
labels.addAll(set);
cursor.close();
db.close();
return labels;
}
public ArrayList<String> getpest_info(String b_lSeason, String b_lCrop) {
SQLiteDatabase db = getReadableDatabase(); //讀
// 用HashSet去判斷裡面的所有資料有沒有重複
String sql = "SELECT * FROM " + DB_TABLE06 +
" WHERE SE001 = '" +b_lSeason+ "' AND CroNam = '" +b_lCrop+"' ";
Cursor cursor = db.rawQuery(sql, null);
ArrayList<String> labels = new ArrayList<String>();
//-----------------------------------------------
int columnCount = cursor.getColumnCount();
while (cursor.moveToNext()) {
String fldSet = "";
for (int i = 3; i < columnCount; i++)
fldSet += cursor.getString(i) + "#";
labels.add(fldSet);
}
cursor.close();
db.close();
return labels;
}
//====================6================================
//====================13===============================
public int clearRec13() { //清空\
SQLiteDatabase db = getWritableDatabase(); //寫入資料庫
String sql = "SELECT * FROM " + DB_TABLE13; //帶入資料表資料
Cursor recSet = db.rawQuery(sql, null); //查詢資料
//------------------------------------------------
if (recSet.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE13, "1", null); //1代表全部
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected; //傳回值
} else {
//db.close();
return -1; //-1傳回空值
}
}
public Long insertRec13(String b_r0202, String b_r0203, String b_r0204, String b_r0205) {
SQLiteDatabase db = getWritableDatabase();
ContentValues rec = new ContentValues();
rec.put("r0202", b_r0202); //googleId
rec.put("r0203", b_r0203); //state=1
rec.put("r0204", b_r0204); //email
rec.put("r0205", b_r0205); //PhotoUrl
long rowID = db.insert(DB_TABLE13, null, rec);
//db.close();
return rowID;
}
//===============13=======================================
//===================14=====================================
public void db14(int b_y0101, String b_y0102, String b_y0103, String b_y0104) {
SQLiteDatabase db =getWritableDatabase();
String sql = "SELECT * FROM" +DB_TABLE14;
ContentValues r14 = new ContentValues();
r14.put("y0101",b_y0101);
r14.put("y0102",b_y0102);
r14.put("y0103",b_y0103);
r14.put("y0104",b_y0104);
db.insert(DB_TABLE14,null,r14);
}
public List<String> redb(int i, int x) {
List<String> randb14 = new ArrayList<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE14;
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
String a = "";
if (cursor.moveToPosition(i)) {
if(!randb14.contains(a)){
randb14.add(cursor.getString(x));
}
}
cursor.close();
db.close();
return randb14;
}
//=======================14_=================================
//==================登入=================================
public boolean status() {//收尋email
SQLiteDatabase db = getReadableDatabase();
boolean fldSet = false;
String sql = "SELECT r0203 FROM " + DB_TABLE13 ;
Cursor recSet = db.rawQuery(sql, null);
int columnCount = recSet.getColumnCount();
if (recSet.getCount() != 0) {
recSet.moveToFirst();
if(recSet.getString(0).equals("1")){
fldSet=true;
}
}
recSet.close();
db.close();
return fldSet;
}
public String Find(String str) {
SQLiteDatabase db = getReadableDatabase();
String fldSet = null;
String sql = "SELECT "+str+" FROM " + DB_TABLE13 ;
Cursor recSet = db.rawQuery(sql, null);
int columnCount = recSet.getColumnCount();
if (recSet.getCount() != 0) {
recSet.moveToFirst();
fldSet = recSet.getString(0);
}
recSet.close();
db.close();
return fldSet;
}
}
| UTF-8 | Java | 29,553 | java | HappyfarmDB.java | Java | [] | null | [] | package com.city2farmer;
import android.content.ContentValues;
import android.content.Context;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.StrictMode;
import android.util.Log;
import androidx.annotation.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class HappyfarmDB extends SQLiteOpenHelper {
// =======================7====================
public String sCreateTableCommand;
private static final String COLUMN_ = "VitC";
Context context;
SQLiteDatabase db;
private Resources mResources;
public static final String DB_TABLE07 = "nutrition";
public static final String COLUMN_NAME = "Plant";
public static final String COLUMN_ITEM = "Calories";
public static final String COLUMN_Content = "K";
public static final String COLUMN_Description = "VitA";
private static final String SQL_CREATE_BUGS_TABLE = "CREATE TABLE " + DB_TABLE07 + " (" +
"ID INTEGER PRIMARY KEY AUTOINCREMENT," +
COLUMN_NAME + " TEXT NOT NULL, " +
COLUMN_ITEM + " INTEGER NOT NULL, " +
COLUMN_Content + " INTEGER NOT NULL, " +
COLUMN_Description + " INTEGER NOT NULL, " +
COLUMN_ + " FLOAT NOT NULL " + " );";
// =======================7=========================
// 資料庫名稱=========12================
private static final String TAG = HappyfarmDB.class.getSimpleName();
private static final String DB_File = "happyfarm.db";
private static final String DB_TABLE12 = "HA1200"; // 資料庫物件,固定的欄位變數
public static final int VERSION = 7;
private static final String crTBsql12 = " CREATE TABLE " + DB_TABLE12 + " (l0101 INTEGER PRIMARY KEY, l0102 TEXT NOT NULL, l0103 TEXT, l0104 TEXT, l0105 TEXT, l0106 TEXT, l0107 TEXT, l0108 TEXT); ";
private static SQLiteDatabase database;
private String totle = "全區";
//==================12===========================
//========================5=================================
private static final String DB_TABLE05 = "ha0500"; // 資料庫物件,固定的欄位變數
private static final String crTBsql05 = " CREATE TABLE " + DB_TABLE05 + " (n0101 INTEGER PRIMARY KEY, n0102 TEXT NOT NULL, n0103 TEXT, n0104 TEXT, n0105 TEXT,n0106 TEXT); ";
//=======================5==================================
//=======================6==================================
private static final String DB_TABLE06 = "HA0600"; // 資料表名稱
private static final String crTBsql06 = "CREATE TABLE " + DB_TABLE06 + " ( "
+ "id INTEGER PRIMARY KEY," +"SE001 TEXT NOT NULL , "
+ "CroNam TEXT NOT NULL,"
+ "PN001 TEXT,"
+ "PN002 TEXT,"
+ "PU001 TEXT,"
+ "PU002 TEXT,"
+ "ST001 TEXT,"
+ "ST002 TEXT);";// 資料庫物件,固定的欄位變數
//=======================6==================================
//===========================13===============================
private static final String DB_TABLE13 = "HA1301"; // 資料庫物件,固定的欄位變數
private static final String crTBsql13 = " CREATE TABLE " + DB_TABLE13 + " (r0201 INTEGER PRIMARY KEY, r0202 TEXT , r0203 TEXT, r0204 TEXT,r0205 TEXT); ";
//=========================13====================================
//========================14=================================
private static final String DB_TABLE14 = "HA1400"; // 資料庫物件,固定的欄位變數
private static final String crTBsql14 = "CREATE TABLE " + DB_TABLE14 + " (y0101 INTEGER PRIMARY KEY, y0102 TEXT NOT NULL, y0103 TEXT, y0104 TEXT, y0105 TEXT, y0106 TEXT); ";
//=======================14_===================================
public HappyfarmDB(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
// super(context, name, factory, version);
super(context, DB_File, null, VERSION);
sCreateTableCommand = "";
mResources = context.getResources();
db = this.getWritableDatabase();
}
@Override
public void onCreate(SQLiteDatabase db) {
//================使用別人的APP================================
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
//======================================================
db.execSQL(crTBsql05);
db.execSQL(crTBsql06);
db.execSQL(SQL_CREATE_BUGS_TABLE);
db.execSQL(crTBsql13);
db.execSQL(crTBsql12);
db.execSQL(crTBsql14);
// ===============07==================
// final String SQL_CREATE_BUGS_TABLE = "CREATE TABLE " + DB_TABLE07 + " (" +
// "ID INTEGER PRIMARY KEY AUTOINCREMENT," +
// COLUMN_NAME + " TEXT NOT NULL, " +
// COLUMN_ITEM + " INTEGER NOT NULL, " +
// COLUMN_Content + " INTEGER NOT NULL, " +
// COLUMN_Description + " INTEGER NOT NULL, " +
// COLUMN_ + " FLOAT NOT NULL " + " );";
//db.execSQL(SQL_CREATE_BUGS_TABLE);
Log.d(TAG, "Database Created Successfully");
try {
readDataToDb(db);
} catch (Exception e) {
e.printStackTrace();
}
// ==============07_====================
}
//=====================07==========================
private void readDataToDb(SQLiteDatabase db) {
final String MNU_NAME = "Plant";
final String MNU_ITEM = "Calories";
final String MNU_CONTENT = "K";
final String MNU_DESCRIPTION = "VitA";
final String MNU_ = "VitC";
try {
String jsonDataString = readJsonDataFromFile();
JSONArray menuItemsJsonArray = new JSONArray(jsonDataString);
for (int i = 0; i < menuItemsJsonArray.length(); ++i) {
String name;
String item;
String content;
String description;
String VitC;
JSONObject menuItemObject = menuItemsJsonArray.getJSONObject(i);
name = menuItemObject.getString(MNU_NAME);
item = menuItemObject.getString(MNU_ITEM);
content = menuItemObject.getString(MNU_CONTENT);
description = menuItemObject.getString(MNU_DESCRIPTION);
VitC = menuItemObject.getString(MNU_);
ContentValues menuValues = new ContentValues();
menuValues.put(COLUMN_NAME, name);
menuValues.put(COLUMN_ITEM, item);
menuValues.put(COLUMN_Content, content);
menuValues.put(COLUMN_Description, description);
menuValues.put(COLUMN_, VitC);
db.insert(DB_TABLE07, null, menuValues);
Log.d(TAG, "Inserted Successfully " + menuValues);
}
} catch (JSONException | IOException e) {
Log.e(TAG, e.getMessage(), e);
e.printStackTrace();
}
}
private String readJsonDataFromFile() throws IOException {
InputStream inputStream = null;
StringBuilder builder = new StringBuilder();
try {
String jsonDataString = null;
inputStream = mResources.openRawResource(R.raw.nutrition_0928);
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(inputStream, "UTF-8"));
while ((jsonDataString = bufferedReader.readLine()) != null) {
builder.append(jsonDataString);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
inputStream.close();
}
}
return new String(builder);
}
// public ArrayList<String> getRecSet() {
// SQLiteDatabase db = getReadableDatabase();
// String sql = "SELECT * FROM " + DB_TABLE07;
// Cursor recSet = db.rawQuery(sql, null);
// ArrayList<String> recAry = new ArrayList<String>();
//
// //----------------------------
// Log.d(TAG, "recSet=" + recSet);
// int columnCount = recSet.getColumnCount();
// while (recSet.moveToNext()) {
// String fldSet = "";
// for (int i = 0; i < columnCount; i++)
// fldSet += recSet.getString(i) + "#";
// recAry.add(fldSet);
// }
// //------------------------
// recSet.close();
// //db.close();
//
// Log.d(TAG, "recAry=" + recAry);
// return recAry;
// }
public String[] getOneRec(int position) {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE07 +" WHERE `ID`="+position+";";
Cursor nw = db.rawQuery(sql, null);
int columnCount = nw.getColumnCount();
String[] nwAry =new String[columnCount];
while (nw.moveToNext()) {
for (int i = 0; i < columnCount; i++){
String yy = nw.getString(0);
nwAry[i]=nw.getString(i);
}
}
nw.close();
return nwAry;
};
// =====================07_===========================
@Override
public void onOpen(SQLiteDatabase db) {
super.onOpen(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// ddl 語法
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE05);
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE06);
db.execSQL("DROP TABLE IF EXISTS " + DB_TABLE07);
//onCreate(db);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE12);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE13);
db.execSQL(" DROP TABLE IF EXISTS " + DB_TABLE14);
onCreate(db);
}
// 需要資料庫的元件呼叫這個方法,這個方法在一般的應用都不需要修改
// ====================12==============================
public static SQLiteDatabase getDatabase(Context context) {
if (database == null || !database.isOpen()) {
database = new HappyfarmDB(context, DB_File, null, VERSION)
.getWritableDatabase();
}
return database;
}
public int RecCount() {
SQLiteDatabase db = getWritableDatabase();
// 這串語法是記算選擇的table有幾筆資料
String sql = "SELECT * FROM " + DB_TABLE12;
Cursor recSet = db.rawQuery(sql, null);
return recSet.getCount();
}
// 縣市
public List<String> getAll_l0103() {
List<String> labels = new ArrayList<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE12;
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
String s = ""; //跟labels比對用
if (cursor.moveToFirst()) {
do {
// 如果重複就跳出
if (!labels.contains(s)) {
labels.add(cursor.getString(2));
}
s = cursor.getString(2);
} while (cursor.moveToNext());
}
//
// cursor.close();
// db.close();
return labels;
}
// 縣市
public List<String> getAll_l0104(String company) {
List<String> labels = new ArrayList<String>();
// 用HashSet去判斷裡面的所有資料有沒有重複
Set<String> set = new HashSet<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0103 = '" + company + "' ";
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
labels.add(totle);
if (cursor.moveToFirst()) {
do {
//// 用以下的方法不行判斷亂排的資料有沒有重複
// if(!labels.contains(s)){
// labels.add(cursor.getString(3));
// }
// s = cursor.getString(3);
// 要用HashSet去看全部的資料有沒有重複
set.add(cursor.getString(3));
} while (cursor.moveToNext());
}
labels.addAll(set);
// cursor.close();
// db.close();
return labels;
}
// 公司名稱,地址,電話
public ArrayList<Map<String, Object>> getAll_l0105(String counties, String asdt) {
List<String> labels = new ArrayList<String>();
String selectQuery = "";
if(asdt == totle){
selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0103 = '" + counties + "' ";
}else {
selectQuery = "SELECT * FROM " + DB_TABLE12 + " WHERE l0104 = '" + asdt + "' AND l0103 = '" + counties + "' ";
}
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
ArrayList<Map<String, Object>> mLsit = new ArrayList<Map<String, Object>>();
// for(int i=0;i<arrayshop.length;i++) {
// Map<String, Object> item = new HashMap<String, Object>();
// item.put("shopname", arrayshop[i][0]);
// item.put("address", arrayshop[i][1]);
// item.put("telphone", arrayshop[i][2]);
// mLsit.add(item);
if (cursor.moveToFirst()) {
do {
Map<String, Object> item = new HashMap<String, Object>();
item.put("shopname", cursor.getString(1));
item.put("address", cursor.getString(4));
item.put("telphone", cursor.getString(5));
mLsit.add(item);
} while (cursor.moveToNext());
}
// cursor.close();
// db.close();
return mLsit;
}
// ==========================12_=============================
// =====================5===============================
public Long insertRec05(String b_n0102, String b_n0103, String b_n0104, String b_n0105) {
SQLiteDatabase db = getWritableDatabase();
ContentValues rec = new ContentValues();
//rec.put("n0101", b_n0101);
rec.put("n0102", b_n0102);
rec.put("n0103", b_n0103);
rec.put("n0104", b_n0104);
rec.put("n0105", b_n0105);
long rowID = db.insert(DB_TABLE05, null, rec);
db.close();
return rowID;
}
public Integer RecCount05() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
//選擇的TABLE有幾筆
Cursor recSet = db.rawQuery(sql, null);
return recSet.getCount();
}
//============測試清空資料庫==================
public int clearRec05() {
SQLiteDatabase db = getWritableDatabase(); //寫入資料庫
String sql = "SELECT * FROM " + DB_TABLE05; //帶入資料表資料
Cursor recSet = db.rawQuery(sql, null); //查詢資料
//------------------------------------------------
if (recSet.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE05, "1", null); //1代表全部
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected; //傳回值
} else {
//db.close();
return -1; //-1傳回空值
}
}
//==============修改筆記=============================
public int updateRec05(String b_n0101, String b_n0102, String b_n0103, String b_n0104, String b_n0105) {
SQLiteDatabase db = getWritableDatabase();
String sql = " SELECT * FROM " + DB_TABLE05;
Cursor recSet = db.rawQuery(sql, null);
if (recSet.getCount() != 0) {
ContentValues rec = new ContentValues();
rec.put("n0102", b_n0102);
rec.put("n0103", b_n0103);
rec.put("n0104", b_n0104);
rec.put("n0105", b_n0105);
String whereClause = " n0101= '" + b_n0101 + "'"; //帶入ID
int rowsAffected05 = db.update(DB_TABLE05, rec, whereClause, null); //whereClause只更改當筆資料
recSet.close();
//db.close();
return rowsAffected05;
} else {
recSet.close();
//db.close();
return -1;
}
}
public ArrayList<String> getRecSet05() {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
Cursor recSet05 = db.rawQuery(sql, null);
ArrayList<String> recAry05 = new ArrayList<String>();
//----------------------------
Log.d(TAG, "recSet05=" + recSet05);
int columnCount = recSet05.getColumnCount();
while (recSet05.moveToNext()) {
String fldSet05 = "";
for (int i = 0; i < columnCount; i++)
fldSet05 += recSet05.getString(i) + "#";
recAry05.add(fldSet05);
}
//------------------------
recSet05.close();
//db.close();
Log.d(TAG, "recAry05=" + recAry05);
return recAry05;
}
//================deleteRec確定刪除===========================
public int deleteRec05(String b_n0101) {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE05;
Cursor recSet05 = db.rawQuery(sql, null);
if (recSet05.getCount() != 0) {
String whereClause = " n0101= '" + b_n0101 + "'";
int rowsAffected = db.delete(DB_TABLE05, whereClause, null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
recSet05.close();
//db.close();
return rowsAffected;
} else {
recSet05.close();
//db.close();
return -1;
}
}
//==============新增================
// ContentValues values
public long insertRec05_m(ContentValues rec) {
SQLiteDatabase db = getWritableDatabase();
long rowID05 = db.insert(DB_TABLE05, null, rec);
db.close();
return rowID05;
}
// ==================5==============================
//====================6===============================
// ContentValues values
public long insertRec_m06 (ContentValues rec){
SQLiteDatabase db = getWritableDatabase();
long rowID06 = db.insert(DB_TABLE06, null, rec);
db.close();
return rowID06;
}
public int RecCount06() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
return recSet06.getCount();
}
public ArrayList<String> getRecSet06() {
SQLiteDatabase db = getReadableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
ArrayList<String> recAry06 = new ArrayList<String>();
//----------------------------
Log.d(TAG, "recSet06=" + recSet06);
int columnCount = recSet06.getColumnCount();
while (recSet06.moveToNext()) {
String fldSet = "";
for (int i = 0; i < columnCount; i++)
fldSet += recSet06.getString(i) + "#";
recAry06.add(fldSet);
}
//------------------------
recSet06.close();
db.close();
Log.d(TAG, "recAry06=" + recAry06);
return recAry06;
}
// public void createTB06() {
// // 批次新增
// int maxrec = 40;
// SQLiteDatabase db = getWritableDatabase();
// for (int i = 0; i < maxrec; i++) {
// ContentValues newRow = new ContentValues();
// newRow.put("CroNam", "作物" + u_chinayear(i));
// newRow.put("PN001", "昆蟲" + u_chinano((int) (Math.random() * 4 + 1)) + "號");
// newRow.put("PU001", "https://i.imgur.com/eHpPvXD.jpg ");
// newRow.put("ST001", "處理方法" + (1+ i) );
// newRow.put("PN002", "病害" + u_chinano((int) (Math.random() * 4 + 1)) + "號");
// newRow.put("PU002", "https://i.imgur.com/jfRBzDC.jpg ");
// newRow.put("ST002", "處理方法" + (1+ i));
// db.insert(DB_TABLE06, null, newRow);
// }
// //db.close();
// }
// private String u_chinano(int input_i) {
// String c_number = "";
// String china_no[] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
// c_number = china_no[input_i % 10];
//
// return c_number;
// }
//
// private String u_chinayear(int input_i) {
// String c_number = "";
// String china_no[] = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"};
// c_number = china_no[input_i % 10];
//
// return c_number;
// }
public int clearRec06() {
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
// //-----------
// Cursor c1=db.execSQL("");
// Cursor c2=db.rawQuery();
// Cursor c3=db.insert();
// Cursor c4=db.update(, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , );
// Cursor c5=db.delete();
// //------------------------------------------------
if (recSet06.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE06, "1", null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected;
} else {
//db.close();
return -1;
}
}
public int updateRec06 (String b_id, String b_crop, String b_pes1, String b_url1, String
b_sol1, String b_pes2, String b_url2, String b_sol2){
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
if (recSet06.getCount() != 0) {
ContentValues rec = new ContentValues();
//rec.put("id", b_id);
rec.put("CroNam", b_crop);
rec.put("PN001", b_pes1);
rec.put("PU001", b_url1);
rec.put("ST001", b_sol1);
rec.put("PN002", b_pes2);
rec.put("PU002", b_url2);
rec.put("ST002", b_sol2);
String whereClause = "id='" + b_id + "'";
int rowsAffected06 = db.update(DB_TABLE06, rec, whereClause, null);
recSet06.close();
db.close();
return rowsAffected06;
} else {
db.close();
return -1;
}
}
public int deleteRec06 (String b_id){
SQLiteDatabase db = getWritableDatabase();
String sql = "SELECT * FROM " + DB_TABLE06;
Cursor recSet06 = db.rawQuery(sql, null);
if (recSet06.getCount() != 0) {
String whereClause = "id='" + b_id + "'";
int rowsAffected06 = db.delete(DB_TABLE06, whereClause, null); //
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
recSet06.close();
db.close();
return rowsAffected06;
} else {
recSet06.close();
db.close();
return -1;
}
}
public List<String> getCroNam(String b_season) {
SQLiteDatabase db = getReadableDatabase(); //讀
List<String> labels = new ArrayList<String>();
// 用HashSet去判斷裡面的所有資料有沒有重複
Set<String> set = new HashSet<String>();
String sql = "SELECT * FROM " + DB_TABLE06 + " WHERE SE001 = '" + b_season + "' ";
int aa=0;
Cursor cursor = db.rawQuery(sql, null);
int bb=0;
if (cursor.moveToFirst()) {
do {
set.add(cursor.getString(2));
} while (cursor.moveToNext());
}
labels.add("選擇作物");
labels.addAll(set);
cursor.close();
db.close();
return labels;
}
public ArrayList<String> getpest_info(String b_lSeason, String b_lCrop) {
SQLiteDatabase db = getReadableDatabase(); //讀
// 用HashSet去判斷裡面的所有資料有沒有重複
String sql = "SELECT * FROM " + DB_TABLE06 +
" WHERE SE001 = '" +b_lSeason+ "' AND CroNam = '" +b_lCrop+"' ";
Cursor cursor = db.rawQuery(sql, null);
ArrayList<String> labels = new ArrayList<String>();
//-----------------------------------------------
int columnCount = cursor.getColumnCount();
while (cursor.moveToNext()) {
String fldSet = "";
for (int i = 3; i < columnCount; i++)
fldSet += cursor.getString(i) + "#";
labels.add(fldSet);
}
cursor.close();
db.close();
return labels;
}
//====================6================================
//====================13===============================
public int clearRec13() { //清空\
SQLiteDatabase db = getWritableDatabase(); //寫入資料庫
String sql = "SELECT * FROM " + DB_TABLE13; //帶入資料表資料
Cursor recSet = db.rawQuery(sql, null); //查詢資料
//------------------------------------------------
if (recSet.getCount() != 0) {
// String whereClause = "id < 0";
int rowsAffected = db.delete(DB_TABLE13, "1", null); //1代表全部
// From the documentation of SQLiteDatabase delete method:
// To remove all rows and get a count pass "1" as the whereClause.
//db.close();
return rowsAffected; //傳回值
} else {
//db.close();
return -1; //-1傳回空值
}
}
public Long insertRec13(String b_r0202, String b_r0203, String b_r0204, String b_r0205) {
SQLiteDatabase db = getWritableDatabase();
ContentValues rec = new ContentValues();
rec.put("r0202", b_r0202); //googleId
rec.put("r0203", b_r0203); //state=1
rec.put("r0204", b_r0204); //email
rec.put("r0205", b_r0205); //PhotoUrl
long rowID = db.insert(DB_TABLE13, null, rec);
//db.close();
return rowID;
}
//===============13=======================================
//===================14=====================================
public void db14(int b_y0101, String b_y0102, String b_y0103, String b_y0104) {
SQLiteDatabase db =getWritableDatabase();
String sql = "SELECT * FROM" +DB_TABLE14;
ContentValues r14 = new ContentValues();
r14.put("y0101",b_y0101);
r14.put("y0102",b_y0102);
r14.put("y0103",b_y0103);
r14.put("y0104",b_y0104);
db.insert(DB_TABLE14,null,r14);
}
public List<String> redb(int i, int x) {
List<String> randb14 = new ArrayList<String>();
String selectQuery = "SELECT * FROM " + DB_TABLE14;
SQLiteDatabase db = this.getReadableDatabase(); //讀
Cursor cursor = db.rawQuery(selectQuery, null);
String a = "";
if (cursor.moveToPosition(i)) {
if(!randb14.contains(a)){
randb14.add(cursor.getString(x));
}
}
cursor.close();
db.close();
return randb14;
}
//=======================14_=================================
//==================登入=================================
public boolean status() {//收尋email
SQLiteDatabase db = getReadableDatabase();
boolean fldSet = false;
String sql = "SELECT r0203 FROM " + DB_TABLE13 ;
Cursor recSet = db.rawQuery(sql, null);
int columnCount = recSet.getColumnCount();
if (recSet.getCount() != 0) {
recSet.moveToFirst();
if(recSet.getString(0).equals("1")){
fldSet=true;
}
}
recSet.close();
db.close();
return fldSet;
}
public String Find(String str) {
SQLiteDatabase db = getReadableDatabase();
String fldSet = null;
String sql = "SELECT "+str+" FROM " + DB_TABLE13 ;
Cursor recSet = db.rawQuery(sql, null);
int columnCount = recSet.getColumnCount();
if (recSet.getCount() != 0) {
recSet.moveToFirst();
fldSet = recSet.getString(0);
}
recSet.close();
db.close();
return fldSet;
}
}
| 29,553 | 0.50908 | 0.478975 | 792 | 35.362373 | 25.781399 | 202 | false | false | 0 | 0 | 0 | 0 | 130 | 0.017188 | 0.888889 | false | false | 13 |
019983c57596bf784d8bda6add55d95056fcdedb | 31,954,556,743,902 | 578d13559bc40322f0c9f4b71089de952650135b | /src/day22/threadmethod/Demo5_Join.java | 9a44ab3217fc8e14cef6464da7778b605aca6367 | [] | no_license | wang3526/JavaSE | https://github.com/wang3526/JavaSE | f6d6d032f8a3856856ee15fb4701642ca54646fb | f8e35aa16a73103cf75b3cb59b36c3d8f54640a3 | refs/heads/master | 2018-10-24T07:03:41.023000 | 2018-08-20T23:41:52 | 2018-08-20T23:41:52 | 143,666,472 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package day22.threadmethod;
public class Demo5_Join {
/**
* * join(), 当前线程暂停, 等待指定的线程执行结束后, 当前线程再继续
* join(int), 可以等待指定的毫秒之后继续
* */
public static void main(String[] args) {
final Thread t1=new Thread(){
public void run(){
for(int i=0;i<10;i++){
System.out.println(getName()+"....aaaaaaaaa");
}
}
};
Thread t2=new Thread(){
public void run(){
for(int i=0;i<10;i++){
if(i==2){
try {
//t1.join();
t1.join(1);//插队指定的时间,过了指定的时间后,两条线程交替执行
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println(getName()+"....bb");
}
}
};
t1.start();
t2.start();
}
}
| GB18030 | Java | 852 | java | Demo5_Join.java | Java | [] | null | [] | package day22.threadmethod;
public class Demo5_Join {
/**
* * join(), 当前线程暂停, 等待指定的线程执行结束后, 当前线程再继续
* join(int), 可以等待指定的毫秒之后继续
* */
public static void main(String[] args) {
final Thread t1=new Thread(){
public void run(){
for(int i=0;i<10;i++){
System.out.println(getName()+"....aaaaaaaaa");
}
}
};
Thread t2=new Thread(){
public void run(){
for(int i=0;i<10;i++){
if(i==2){
try {
//t1.join();
t1.join(1);//插队指定的时间,过了指定的时间后,两条线程交替执行
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println(getName()+"....bb");
}
}
};
t1.start();
t2.start();
}
}
| 852 | 0.544077 | 0.520661 | 37 | 18.621622 | 15.216192 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.648649 | false | false | 13 |
fecae41f8756a1ab3d119c4275ab80ff09f63dcc | 17,188,459,146,705 | ed381b537343f3b78e8ad48939c563f7cfd06fde | /src/Visao/Principal.java | bbc42803bbc26cbf2ba714fa59b541ca84e76575 | [] | no_license | thalessalazar/Indexador-trabalhos-academicos | https://github.com/thalessalazar/Indexador-trabalhos-academicos | 41bed04e69e5c60c31566b9b4e30e09519272ed1 | 6800b6bf7a116f0d7e2e7f8f8f234a033b6adebe | refs/heads/master | 2020-12-01T16:52:36.317000 | 2019-12-29T05:04:20 | 2019-12-29T05:04:20 | 230,703,567 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Visao;
import java.awt.Toolkit;
import modelo.Usuario;
public class Principal extends javax.swing.JFrame {
private Usuario usuario_logado;
public String nomeCurso;
public Integer id_usuario;
public Principal() {
initComponents();
setIcon();
}
private void setIcon(){
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/home/thales/Downloads/Nova Pasta/Biblio2/src/img/logo-urcamp(1).png")));
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnAdmin = new javax.swing.JButton();
btnAgronomia = new javax.swing.JButton();
btnArqUrb = new javax.swing.JButton();
btnBiologia = new javax.swing.JButton();
btnCienciasContab = new javax.swing.JButton();
btnDireito = new javax.swing.JButton();
btnEducacaoFis = new javax.swing.JButton();
btnEnfermagem = new javax.swing.JButton();
btnEngenhariaCiv = new javax.swing.JButton();
btnFarmacia = new javax.swing.JButton();
btnFisioterapia = new javax.swing.JButton();
btnJornalismo = new javax.swing.JButton();
btnLetras = new javax.swing.JButton();
btnMedicinaVet = new javax.swing.JButton();
btnNutricao = new javax.swing.JButton();
btnPedagogia = new javax.swing.JButton();
btnPsicologia = new javax.swing.JButton();
btnSistemasInfo = new javax.swing.JButton();
btnTecnologiaAgro = new javax.swing.JButton();
btnGastronomia = new javax.swing.JButton();
btnHistoria = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jMenuBar2 = new javax.swing.JMenuBar();
MConf = new javax.swing.JMenu();
MAjuda = new javax.swing.JMenu();
MSair = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setPreferredSize(new java.awt.Dimension(1000, 500));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
btnAdmin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Administração.jpg"))); // NOI18N
btnAdmin.setPreferredSize(new java.awt.Dimension(135, 135));
btnAdmin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAdminActionPerformed(evt);
}
});
jPanel1.add(btnAdmin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 130, -1, -1));
btnAgronomia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Agronomia_1.jpg"))); // NOI18N
btnAgronomia.setPreferredSize(new java.awt.Dimension(135, 135));
btnAgronomia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAgronomiaActionPerformed(evt);
}
});
jPanel1.add(btnAgronomia, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 130, -1, -1));
btnArqUrb.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Arquitetura e Urbanismo.jpg"))); // NOI18N
btnArqUrb.setPreferredSize(new java.awt.Dimension(135, 135));
btnArqUrb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnArqUrbActionPerformed(evt);
}
});
jPanel1.add(btnArqUrb, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 130, -1, -1));
btnBiologia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Biologia.jpg"))); // NOI18N
btnBiologia.setPreferredSize(new java.awt.Dimension(135, 135));
btnBiologia.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnBiologiaMouseClicked(evt);
}
});
btnBiologia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBiologiaActionPerformed(evt);
}
});
jPanel1.add(btnBiologia, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 130, -1, -1));
btnCienciasContab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Ciências Contábeis_1.jpg"))); // NOI18N
btnCienciasContab.setPreferredSize(new java.awt.Dimension(135, 135));
btnCienciasContab.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCienciasContabActionPerformed(evt);
}
});
jPanel1.add(btnCienciasContab, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 130, -1, -1));
btnDireito.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Direito_1.jpg"))); // NOI18N
btnDireito.setPreferredSize(new java.awt.Dimension(135, 135));
btnDireito.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDireitoActionPerformed(evt);
}
});
jPanel1.add(btnDireito, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 130, -1, -1));
btnEducacaoFis.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Educação Física_1.jpg"))); // NOI18N
btnEducacaoFis.setPreferredSize(new java.awt.Dimension(135, 135));
btnEducacaoFis.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEducacaoFisActionPerformed(evt);
}
});
jPanel1.add(btnEducacaoFis, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 130, -1, -1));
btnEnfermagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Enfermagem_1.jpg"))); // NOI18N
btnEnfermagem.setPreferredSize(new java.awt.Dimension(135, 135));
btnEnfermagem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEnfermagemActionPerformed(evt);
}
});
jPanel1.add(btnEnfermagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, -1, -1));
btnEngenhariaCiv.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Engenharia Civil_1.jpg"))); // NOI18N
btnEngenhariaCiv.setPreferredSize(new java.awt.Dimension(135, 135));
btnEngenhariaCiv.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEngenhariaCivActionPerformed(evt);
}
});
jPanel1.add(btnEngenhariaCiv, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 280, -1, -1));
btnFarmacia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Farmácia_1.jpg"))); // NOI18N
btnFarmacia.setPreferredSize(new java.awt.Dimension(135, 135));
btnFarmacia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFarmaciaActionPerformed(evt);
}
});
jPanel1.add(btnFarmacia, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 280, -1, -1));
btnFisioterapia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Fisioterapia_1.jpg"))); // NOI18N
btnFisioterapia.setPreferredSize(new java.awt.Dimension(135, 135));
btnFisioterapia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFisioterapiaActionPerformed(evt);
}
});
jPanel1.add(btnFisioterapia, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 280, -1, -1));
btnJornalismo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Jornalismo_1.jpg"))); // NOI18N
btnJornalismo.setPreferredSize(new java.awt.Dimension(135, 135));
btnJornalismo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnJornalismoActionPerformed(evt);
}
});
jPanel1.add(btnJornalismo, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 280, -1, -1));
btnLetras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Letras_1.jpg"))); // NOI18N
btnLetras.setPreferredSize(new java.awt.Dimension(135, 135));
btnLetras.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLetrasActionPerformed(evt);
}
});
jPanel1.add(btnLetras, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 280, -1, -1));
btnMedicinaVet.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Med. Veterinária.jpg"))); // NOI18N
btnMedicinaVet.setPreferredSize(new java.awt.Dimension(135, 135));
btnMedicinaVet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMedicinaVetActionPerformed(evt);
}
});
jPanel1.add(btnMedicinaVet, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 280, -1, -1));
btnNutricao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Nutrição_1.jpg"))); // NOI18N
btnNutricao.setPreferredSize(new java.awt.Dimension(135, 135));
btnNutricao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNutricaoActionPerformed(evt);
}
});
jPanel1.add(btnNutricao, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 420, -1, -1));
btnPedagogia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Pedagogia_1.jpg"))); // NOI18N
btnPedagogia.setPreferredSize(new java.awt.Dimension(135, 135));
btnPedagogia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPedagogiaActionPerformed(evt);
}
});
jPanel1.add(btnPedagogia, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 420, -1, -1));
btnPsicologia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Psicologia_1.jpg"))); // NOI18N
btnPsicologia.setPreferredSize(new java.awt.Dimension(135, 135));
btnPsicologia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPsicologiaActionPerformed(evt);
}
});
jPanel1.add(btnPsicologia, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 420, -1, -1));
btnSistemasInfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/sistemas de informação_1.jpg"))); // NOI18N
btnSistemasInfo.setPreferredSize(new java.awt.Dimension(135, 135));
btnSistemasInfo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSistemasInfoActionPerformed(evt);
}
});
jPanel1.add(btnSistemasInfo, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 420, -1, -1));
btnTecnologiaAgro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Agronegócio.jpg"))); // NOI18N
btnTecnologiaAgro.setPreferredSize(new java.awt.Dimension(135, 135));
btnTecnologiaAgro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnTecnologiaAgroActionPerformed(evt);
}
});
jPanel1.add(btnTecnologiaAgro, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 420, -1, -1));
btnGastronomia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Gastronomia.jpg"))); // NOI18N
btnGastronomia.setPreferredSize(new java.awt.Dimension(135, 135));
btnGastronomia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGastronomiaActionPerformed(evt);
}
});
jPanel1.add(btnGastronomia, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 420, -1, -1));
btnHistoria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/História.jpg"))); // NOI18N
btnHistoria.setPreferredSize(new java.awt.Dimension(135, 135));
btnHistoria.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnHistoriaActionPerformed(evt);
}
});
jPanel1.add(btnHistoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 420, -1, -1));
jLabel1.setFont(new java.awt.Font("Microsoft New Tai Lue", 0, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(1, 1, 1));
jLabel1.setText("Para pesquisar ou catalogar um TCC, selecione o curso:");
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 50, -1, -1));
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/logo-urcamp(1).png"))); // NOI18N
jLabel3.setMaximumSize(new java.awt.Dimension(100, 100));
jLabel3.setMinimumSize(new java.awt.Dimension(100, 100));
jLabel3.setPreferredSize(new java.awt.Dimension(10, 10));
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 0, 120, 140));
MConf.setText("Configurações");
jMenuBar2.add(MConf);
MAjuda.setText("Ajuda");
jMenuBar2.add(MAjuda);
MSair.setText("Sair");
jMenuBar2.add(MSair);
setJMenuBar(jMenuBar2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(64, 64, 64))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnDireitoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDireitoActionPerformed
AbreCurso abre = new AbreCurso(1);
abre.id_curso = 1;
abre.setVisible(true);
nomeCurso = "Direito";
dispose();
}//GEN-LAST:event_btnDireitoActionPerformed
private void btnBiologiaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnBiologiaMouseClicked
// AbreCurso abre = new AbreCurso();
// abre.setIdCurso(1);
// abre.setVisible(true);
// nomeCurso = "Biologia";
// dispose(); // TODO add your handling code here:
}//GEN-LAST:event_btnBiologiaMouseClicked
private void btnAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdminActionPerformed
AbreCurso abre = new AbreCurso(2);
abre.id_curso = 2;
abre.setVisible(true);
nomeCurso = "Administração";
dispose();
}//GEN-LAST:event_btnAdminActionPerformed
private void btnEnfermagemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEnfermagemActionPerformed
AbreCurso abre = new AbreCurso(3);
abre.id_curso = 3;
abre.setVisible(true);
nomeCurso = "Enfermagem";
dispose();
}//GEN-LAST:event_btnEnfermagemActionPerformed
private void btnAgronomiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgronomiaActionPerformed
AbreCurso abre = new AbreCurso(4);
abre.id_curso = 4;
abre.setVisible(true);
nomeCurso = "Agronomia";
dispose();
}//GEN-LAST:event_btnAgronomiaActionPerformed
private void btnArqUrbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArqUrbActionPerformed
AbreCurso abre = new AbreCurso(5);
abre.id_curso = 5;
abre.setVisible(true);
nomeCurso = "Arquitetura e Urbanismo";
dispose();
}//GEN-LAST:event_btnArqUrbActionPerformed
private void btnBiologiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBiologiaActionPerformed
AbreCurso abre = new AbreCurso(6);
abre.id_curso = 6;
abre.setVisible(true);
nomeCurso = "Biologia";
dispose();
}//GEN-LAST:event_btnBiologiaActionPerformed
private void btnCienciasContabActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCienciasContabActionPerformed
AbreCurso abre = new AbreCurso(7);
abre.id_curso = 7;
abre.setVisible(true);
nomeCurso = "Ciências Contábeis";
dispose();
}//GEN-LAST:event_btnCienciasContabActionPerformed
private void btnEducacaoFisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEducacaoFisActionPerformed
AbreCurso abre = new AbreCurso(8);
abre.id_curso = 8;
abre.setVisible(true);
nomeCurso = "Educação Física";
dispose();
}//GEN-LAST:event_btnEducacaoFisActionPerformed
private void btnEngenhariaCivActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEngenhariaCivActionPerformed
AbreCurso abre = new AbreCurso(9);
abre.id_curso = 9;
abre.setVisible(true);
nomeCurso = "Engenharia Cívil";
dispose();
}//GEN-LAST:event_btnEngenhariaCivActionPerformed
private void btnFarmaciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFarmaciaActionPerformed
AbreCurso abre = new AbreCurso(10);
abre.id_curso = 10;
abre.setVisible(true);
nomeCurso = "Farmácia";
dispose();
}//GEN-LAST:event_btnFarmaciaActionPerformed
private void btnFisioterapiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFisioterapiaActionPerformed
AbreCurso abre = new AbreCurso(11);
abre.id_curso = 11;
abre.setVisible(true);
nomeCurso = "Fisioterapia";
dispose();
}//GEN-LAST:event_btnFisioterapiaActionPerformed
private void btnJornalismoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnJornalismoActionPerformed
AbreCurso abre = new AbreCurso(12);
abre.id_curso = 12;
abre.setVisible(true);
nomeCurso = "Jornalismo";
dispose();
}//GEN-LAST:event_btnJornalismoActionPerformed
private void btnLetrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLetrasActionPerformed
AbreCurso abre = new AbreCurso(13);
abre.id_curso = 13;
System.out.println(abre.getIdCurso());
abre.setVisible(true);
nomeCurso = "Letras";
dispose();
}//GEN-LAST:event_btnLetrasActionPerformed
private void btnMedicinaVetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedicinaVetActionPerformed
AbreCurso abre = new AbreCurso(14);
abre.id_curso = 14;
abre.setVisible(true);
nomeCurso = "Medicina";
dispose();
}//GEN-LAST:event_btnMedicinaVetActionPerformed
private void btnNutricaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNutricaoActionPerformed
AbreCurso abre = new AbreCurso(15);
abre.id_curso = 15;
abre.setVisible(true);
nomeCurso = "Nutrição";
dispose();
}//GEN-LAST:event_btnNutricaoActionPerformed
private void btnPedagogiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPedagogiaActionPerformed
AbreCurso abre = new AbreCurso(16);
abre.id_curso = 16;
abre.setVisible(true);
nomeCurso = "Pedagogia";
dispose();
}//GEN-LAST:event_btnPedagogiaActionPerformed
private void btnPsicologiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPsicologiaActionPerformed
AbreCurso abre = new AbreCurso(17);
abre.id_curso = 17;
abre.setVisible(true);
nomeCurso = "Psicologia";
dispose();
}//GEN-LAST:event_btnPsicologiaActionPerformed
private void btnSistemasInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSistemasInfoActionPerformed
AbreCurso abre = new AbreCurso(18);
abre.id_curso = 18;
abre.setVisible(true);
nomeCurso = "Sistemas de Informação";
dispose();
}//GEN-LAST:event_btnSistemasInfoActionPerformed
private void btnTecnologiaAgroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTecnologiaAgroActionPerformed
AbreCurso abre = new AbreCurso(19);
abre.id_curso = 19;
abre.setVisible(true);
nomeCurso = "Tecnologia em Agronegócio";
dispose();
}//GEN-LAST:event_btnTecnologiaAgroActionPerformed
private void btnGastronomiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGastronomiaActionPerformed
AbreCurso abre = new AbreCurso(20);
abre.id_curso = 20;
abre.setVisible(true);
nomeCurso = "Gastronomia";
dispose();
}//GEN-LAST:event_btnGastronomiaActionPerformed
private void btnHistoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHistoriaActionPerformed
AbreCurso abre = new AbreCurso(21);
abre.id_curso = 21;
abre.setVisible(true);
nomeCurso = "História";
dispose();
}//GEN-LAST:event_btnHistoriaActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenu MAjuda;
private javax.swing.JMenu MConf;
private javax.swing.JMenu MSair;
private javax.swing.JButton btnAdmin;
private javax.swing.JButton btnAgronomia;
private javax.swing.JButton btnArqUrb;
private javax.swing.JButton btnBiologia;
private javax.swing.JButton btnCienciasContab;
private javax.swing.JButton btnDireito;
private javax.swing.JButton btnEducacaoFis;
private javax.swing.JButton btnEnfermagem;
private javax.swing.JButton btnEngenhariaCiv;
private javax.swing.JButton btnFarmacia;
private javax.swing.JButton btnFisioterapia;
private javax.swing.JButton btnGastronomia;
private javax.swing.JButton btnHistoria;
private javax.swing.JButton btnJornalismo;
private javax.swing.JButton btnLetras;
private javax.swing.JButton btnMedicinaVet;
private javax.swing.JButton btnNutricao;
private javax.swing.JButton btnPedagogia;
private javax.swing.JButton btnPsicologia;
private javax.swing.JButton btnSistemasInfo;
private javax.swing.JButton btnTecnologiaAgro;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenuBar jMenuBar2;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
}
| UTF-8 | Java | 25,984 | java | Principal.java | Java | [
{
"context": " extends javax.swing.JFrame {\n\n private Usuario usuario_logado;\n public String nomeCurso;\n public Integer ",
"end": 152,
"score": 0.9250059127807617,
"start": 138,
"tag": "USERNAME",
"value": "usuario_logado"
},
{
"context": "tToolkit().getImage(getClass().getResource(\"/home/thales/Downloads/Nova Pasta/Biblio2/src/img/logo-urcamp(",
"end": 413,
"score": 0.9969085454940796,
"start": 407,
"tag": "USERNAME",
"value": "thales"
}
] | null | [] | package Visao;
import java.awt.Toolkit;
import modelo.Usuario;
public class Principal extends javax.swing.JFrame {
private Usuario usuario_logado;
public String nomeCurso;
public Integer id_usuario;
public Principal() {
initComponents();
setIcon();
}
private void setIcon(){
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/home/thales/Downloads/Nova Pasta/Biblio2/src/img/logo-urcamp(1).png")));
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnAdmin = new javax.swing.JButton();
btnAgronomia = new javax.swing.JButton();
btnArqUrb = new javax.swing.JButton();
btnBiologia = new javax.swing.JButton();
btnCienciasContab = new javax.swing.JButton();
btnDireito = new javax.swing.JButton();
btnEducacaoFis = new javax.swing.JButton();
btnEnfermagem = new javax.swing.JButton();
btnEngenhariaCiv = new javax.swing.JButton();
btnFarmacia = new javax.swing.JButton();
btnFisioterapia = new javax.swing.JButton();
btnJornalismo = new javax.swing.JButton();
btnLetras = new javax.swing.JButton();
btnMedicinaVet = new javax.swing.JButton();
btnNutricao = new javax.swing.JButton();
btnPedagogia = new javax.swing.JButton();
btnPsicologia = new javax.swing.JButton();
btnSistemasInfo = new javax.swing.JButton();
btnTecnologiaAgro = new javax.swing.JButton();
btnGastronomia = new javax.swing.JButton();
btnHistoria = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jMenuBar2 = new javax.swing.JMenuBar();
MConf = new javax.swing.JMenu();
MAjuda = new javax.swing.JMenu();
MSair = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setPreferredSize(new java.awt.Dimension(1000, 500));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
btnAdmin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Administração.jpg"))); // NOI18N
btnAdmin.setPreferredSize(new java.awt.Dimension(135, 135));
btnAdmin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAdminActionPerformed(evt);
}
});
jPanel1.add(btnAdmin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 130, -1, -1));
btnAgronomia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Agronomia_1.jpg"))); // NOI18N
btnAgronomia.setPreferredSize(new java.awt.Dimension(135, 135));
btnAgronomia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAgronomiaActionPerformed(evt);
}
});
jPanel1.add(btnAgronomia, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 130, -1, -1));
btnArqUrb.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Arquitetura e Urbanismo.jpg"))); // NOI18N
btnArqUrb.setPreferredSize(new java.awt.Dimension(135, 135));
btnArqUrb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnArqUrbActionPerformed(evt);
}
});
jPanel1.add(btnArqUrb, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 130, -1, -1));
btnBiologia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Biologia.jpg"))); // NOI18N
btnBiologia.setPreferredSize(new java.awt.Dimension(135, 135));
btnBiologia.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnBiologiaMouseClicked(evt);
}
});
btnBiologia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBiologiaActionPerformed(evt);
}
});
jPanel1.add(btnBiologia, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 130, -1, -1));
btnCienciasContab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Ciências Contábeis_1.jpg"))); // NOI18N
btnCienciasContab.setPreferredSize(new java.awt.Dimension(135, 135));
btnCienciasContab.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCienciasContabActionPerformed(evt);
}
});
jPanel1.add(btnCienciasContab, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 130, -1, -1));
btnDireito.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Direito_1.jpg"))); // NOI18N
btnDireito.setPreferredSize(new java.awt.Dimension(135, 135));
btnDireito.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDireitoActionPerformed(evt);
}
});
jPanel1.add(btnDireito, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 130, -1, -1));
btnEducacaoFis.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Educação Física_1.jpg"))); // NOI18N
btnEducacaoFis.setPreferredSize(new java.awt.Dimension(135, 135));
btnEducacaoFis.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEducacaoFisActionPerformed(evt);
}
});
jPanel1.add(btnEducacaoFis, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 130, -1, -1));
btnEnfermagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Enfermagem_1.jpg"))); // NOI18N
btnEnfermagem.setPreferredSize(new java.awt.Dimension(135, 135));
btnEnfermagem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEnfermagemActionPerformed(evt);
}
});
jPanel1.add(btnEnfermagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, -1, -1));
btnEngenhariaCiv.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Engenharia Civil_1.jpg"))); // NOI18N
btnEngenhariaCiv.setPreferredSize(new java.awt.Dimension(135, 135));
btnEngenhariaCiv.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEngenhariaCivActionPerformed(evt);
}
});
jPanel1.add(btnEngenhariaCiv, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 280, -1, -1));
btnFarmacia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Farmácia_1.jpg"))); // NOI18N
btnFarmacia.setPreferredSize(new java.awt.Dimension(135, 135));
btnFarmacia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFarmaciaActionPerformed(evt);
}
});
jPanel1.add(btnFarmacia, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 280, -1, -1));
btnFisioterapia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Fisioterapia_1.jpg"))); // NOI18N
btnFisioterapia.setPreferredSize(new java.awt.Dimension(135, 135));
btnFisioterapia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFisioterapiaActionPerformed(evt);
}
});
jPanel1.add(btnFisioterapia, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 280, -1, -1));
btnJornalismo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Jornalismo_1.jpg"))); // NOI18N
btnJornalismo.setPreferredSize(new java.awt.Dimension(135, 135));
btnJornalismo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnJornalismoActionPerformed(evt);
}
});
jPanel1.add(btnJornalismo, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 280, -1, -1));
btnLetras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Letras_1.jpg"))); // NOI18N
btnLetras.setPreferredSize(new java.awt.Dimension(135, 135));
btnLetras.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLetrasActionPerformed(evt);
}
});
jPanel1.add(btnLetras, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 280, -1, -1));
btnMedicinaVet.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Med. Veterinária.jpg"))); // NOI18N
btnMedicinaVet.setPreferredSize(new java.awt.Dimension(135, 135));
btnMedicinaVet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMedicinaVetActionPerformed(evt);
}
});
jPanel1.add(btnMedicinaVet, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 280, -1, -1));
btnNutricao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Nutrição_1.jpg"))); // NOI18N
btnNutricao.setPreferredSize(new java.awt.Dimension(135, 135));
btnNutricao.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNutricaoActionPerformed(evt);
}
});
jPanel1.add(btnNutricao, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 420, -1, -1));
btnPedagogia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Pedagogia_1.jpg"))); // NOI18N
btnPedagogia.setPreferredSize(new java.awt.Dimension(135, 135));
btnPedagogia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPedagogiaActionPerformed(evt);
}
});
jPanel1.add(btnPedagogia, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 420, -1, -1));
btnPsicologia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Psicologia_1.jpg"))); // NOI18N
btnPsicologia.setPreferredSize(new java.awt.Dimension(135, 135));
btnPsicologia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPsicologiaActionPerformed(evt);
}
});
jPanel1.add(btnPsicologia, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 420, -1, -1));
btnSistemasInfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/sistemas de informação_1.jpg"))); // NOI18N
btnSistemasInfo.setPreferredSize(new java.awt.Dimension(135, 135));
btnSistemasInfo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSistemasInfoActionPerformed(evt);
}
});
jPanel1.add(btnSistemasInfo, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 420, -1, -1));
btnTecnologiaAgro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Agronegócio.jpg"))); // NOI18N
btnTecnologiaAgro.setPreferredSize(new java.awt.Dimension(135, 135));
btnTecnologiaAgro.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnTecnologiaAgroActionPerformed(evt);
}
});
jPanel1.add(btnTecnologiaAgro, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 420, -1, -1));
btnGastronomia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Gastronomia.jpg"))); // NOI18N
btnGastronomia.setPreferredSize(new java.awt.Dimension(135, 135));
btnGastronomia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGastronomiaActionPerformed(evt);
}
});
jPanel1.add(btnGastronomia, new org.netbeans.lib.awtextra.AbsoluteConstraints(930, 420, -1, -1));
btnHistoria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/História.jpg"))); // NOI18N
btnHistoria.setPreferredSize(new java.awt.Dimension(135, 135));
btnHistoria.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnHistoriaActionPerformed(evt);
}
});
jPanel1.add(btnHistoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(1070, 420, -1, -1));
jLabel1.setFont(new java.awt.Font("Microsoft New Tai Lue", 0, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(1, 1, 1));
jLabel1.setText("Para pesquisar ou catalogar um TCC, selecione o curso:");
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 50, -1, -1));
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/logo-urcamp(1).png"))); // NOI18N
jLabel3.setMaximumSize(new java.awt.Dimension(100, 100));
jLabel3.setMinimumSize(new java.awt.Dimension(100, 100));
jLabel3.setPreferredSize(new java.awt.Dimension(10, 10));
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 0, 120, 140));
MConf.setText("Configurações");
jMenuBar2.add(MConf);
MAjuda.setText("Ajuda");
jMenuBar2.add(MAjuda);
MSair.setText("Sair");
jMenuBar2.add(MSair);
setJMenuBar(jMenuBar2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(64, 64, 64))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnDireitoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDireitoActionPerformed
AbreCurso abre = new AbreCurso(1);
abre.id_curso = 1;
abre.setVisible(true);
nomeCurso = "Direito";
dispose();
}//GEN-LAST:event_btnDireitoActionPerformed
private void btnBiologiaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnBiologiaMouseClicked
// AbreCurso abre = new AbreCurso();
// abre.setIdCurso(1);
// abre.setVisible(true);
// nomeCurso = "Biologia";
// dispose(); // TODO add your handling code here:
}//GEN-LAST:event_btnBiologiaMouseClicked
private void btnAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdminActionPerformed
AbreCurso abre = new AbreCurso(2);
abre.id_curso = 2;
abre.setVisible(true);
nomeCurso = "Administração";
dispose();
}//GEN-LAST:event_btnAdminActionPerformed
private void btnEnfermagemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEnfermagemActionPerformed
AbreCurso abre = new AbreCurso(3);
abre.id_curso = 3;
abre.setVisible(true);
nomeCurso = "Enfermagem";
dispose();
}//GEN-LAST:event_btnEnfermagemActionPerformed
private void btnAgronomiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgronomiaActionPerformed
AbreCurso abre = new AbreCurso(4);
abre.id_curso = 4;
abre.setVisible(true);
nomeCurso = "Agronomia";
dispose();
}//GEN-LAST:event_btnAgronomiaActionPerformed
private void btnArqUrbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArqUrbActionPerformed
AbreCurso abre = new AbreCurso(5);
abre.id_curso = 5;
abre.setVisible(true);
nomeCurso = "Arquitetura e Urbanismo";
dispose();
}//GEN-LAST:event_btnArqUrbActionPerformed
private void btnBiologiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBiologiaActionPerformed
AbreCurso abre = new AbreCurso(6);
abre.id_curso = 6;
abre.setVisible(true);
nomeCurso = "Biologia";
dispose();
}//GEN-LAST:event_btnBiologiaActionPerformed
private void btnCienciasContabActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCienciasContabActionPerformed
AbreCurso abre = new AbreCurso(7);
abre.id_curso = 7;
abre.setVisible(true);
nomeCurso = "Ciências Contábeis";
dispose();
}//GEN-LAST:event_btnCienciasContabActionPerformed
private void btnEducacaoFisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEducacaoFisActionPerformed
AbreCurso abre = new AbreCurso(8);
abre.id_curso = 8;
abre.setVisible(true);
nomeCurso = "Educação Física";
dispose();
}//GEN-LAST:event_btnEducacaoFisActionPerformed
private void btnEngenhariaCivActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEngenhariaCivActionPerformed
AbreCurso abre = new AbreCurso(9);
abre.id_curso = 9;
abre.setVisible(true);
nomeCurso = "Engenharia Cívil";
dispose();
}//GEN-LAST:event_btnEngenhariaCivActionPerformed
private void btnFarmaciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFarmaciaActionPerformed
AbreCurso abre = new AbreCurso(10);
abre.id_curso = 10;
abre.setVisible(true);
nomeCurso = "Farmácia";
dispose();
}//GEN-LAST:event_btnFarmaciaActionPerformed
private void btnFisioterapiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFisioterapiaActionPerformed
AbreCurso abre = new AbreCurso(11);
abre.id_curso = 11;
abre.setVisible(true);
nomeCurso = "Fisioterapia";
dispose();
}//GEN-LAST:event_btnFisioterapiaActionPerformed
private void btnJornalismoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnJornalismoActionPerformed
AbreCurso abre = new AbreCurso(12);
abre.id_curso = 12;
abre.setVisible(true);
nomeCurso = "Jornalismo";
dispose();
}//GEN-LAST:event_btnJornalismoActionPerformed
private void btnLetrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLetrasActionPerformed
AbreCurso abre = new AbreCurso(13);
abre.id_curso = 13;
System.out.println(abre.getIdCurso());
abre.setVisible(true);
nomeCurso = "Letras";
dispose();
}//GEN-LAST:event_btnLetrasActionPerformed
private void btnMedicinaVetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMedicinaVetActionPerformed
AbreCurso abre = new AbreCurso(14);
abre.id_curso = 14;
abre.setVisible(true);
nomeCurso = "Medicina";
dispose();
}//GEN-LAST:event_btnMedicinaVetActionPerformed
private void btnNutricaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNutricaoActionPerformed
AbreCurso abre = new AbreCurso(15);
abre.id_curso = 15;
abre.setVisible(true);
nomeCurso = "Nutrição";
dispose();
}//GEN-LAST:event_btnNutricaoActionPerformed
private void btnPedagogiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPedagogiaActionPerformed
AbreCurso abre = new AbreCurso(16);
abre.id_curso = 16;
abre.setVisible(true);
nomeCurso = "Pedagogia";
dispose();
}//GEN-LAST:event_btnPedagogiaActionPerformed
private void btnPsicologiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPsicologiaActionPerformed
AbreCurso abre = new AbreCurso(17);
abre.id_curso = 17;
abre.setVisible(true);
nomeCurso = "Psicologia";
dispose();
}//GEN-LAST:event_btnPsicologiaActionPerformed
private void btnSistemasInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSistemasInfoActionPerformed
AbreCurso abre = new AbreCurso(18);
abre.id_curso = 18;
abre.setVisible(true);
nomeCurso = "Sistemas de Informação";
dispose();
}//GEN-LAST:event_btnSistemasInfoActionPerformed
private void btnTecnologiaAgroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTecnologiaAgroActionPerformed
AbreCurso abre = new AbreCurso(19);
abre.id_curso = 19;
abre.setVisible(true);
nomeCurso = "Tecnologia em Agronegócio";
dispose();
}//GEN-LAST:event_btnTecnologiaAgroActionPerformed
private void btnGastronomiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGastronomiaActionPerformed
AbreCurso abre = new AbreCurso(20);
abre.id_curso = 20;
abre.setVisible(true);
nomeCurso = "Gastronomia";
dispose();
}//GEN-LAST:event_btnGastronomiaActionPerformed
private void btnHistoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHistoriaActionPerformed
AbreCurso abre = new AbreCurso(21);
abre.id_curso = 21;
abre.setVisible(true);
nomeCurso = "História";
dispose();
}//GEN-LAST:event_btnHistoriaActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenu MAjuda;
private javax.swing.JMenu MConf;
private javax.swing.JMenu MSair;
private javax.swing.JButton btnAdmin;
private javax.swing.JButton btnAgronomia;
private javax.swing.JButton btnArqUrb;
private javax.swing.JButton btnBiologia;
private javax.swing.JButton btnCienciasContab;
private javax.swing.JButton btnDireito;
private javax.swing.JButton btnEducacaoFis;
private javax.swing.JButton btnEnfermagem;
private javax.swing.JButton btnEngenhariaCiv;
private javax.swing.JButton btnFarmacia;
private javax.swing.JButton btnFisioterapia;
private javax.swing.JButton btnGastronomia;
private javax.swing.JButton btnHistoria;
private javax.swing.JButton btnJornalismo;
private javax.swing.JButton btnLetras;
private javax.swing.JButton btnMedicinaVet;
private javax.swing.JButton btnNutricao;
private javax.swing.JButton btnPedagogia;
private javax.swing.JButton btnPsicologia;
private javax.swing.JButton btnSistemasInfo;
private javax.swing.JButton btnTecnologiaAgro;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenuBar jMenuBar2;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
}
| 25,984 | 0.675593 | 0.654516 | 533 | 47.69043 | 36.07996 | 155 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.861163 | false | false | 13 |
8b454d2ac63f05efcd7cc337ff71bd933d0be08b | 21,036,749,837,372 | c7d19375760d1c782519f44e8cce6d395567374b | /Java/Deitel/Chapter_06_Methods/Examples/MethodOverload.java | 0577ed5135b33afec241868af49cfee111b9fa4c | [] | no_license | GregWagner/projects | https://github.com/GregWagner/projects | f309612d838e25ecaef782816907c794d8d83f38 | f5752b599a08a8ba5b88aa6b599719205707903c | refs/heads/master | 2018-02-13T01:36:30.005000 | 2018-02-03T17:08:17 | 2018-02-03T17:08:17 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Fig 6.10: MethodOverload.java
*
* Overloaded method declaration.
*/
public class MethodOverload {
public static void main(String[] args) {
System.out.printf("Square of integer 7 is %d%n", square(7));
System.out.printf("Square of double 7.5 is %f%n", square(7.5));
}
private static int square(int value) {
System.out.printf("%nCalled square with int argument: %d%n", value);
return value * value;
}
private static double square(double value) {
System.out.printf("%nCalled square with double argument: %f%n", value);
return value * value;
}
}
| UTF-8 | Java | 624 | java | MethodOverload.java | Java | [] | null | [] | /*
* Fig 6.10: MethodOverload.java
*
* Overloaded method declaration.
*/
public class MethodOverload {
public static void main(String[] args) {
System.out.printf("Square of integer 7 is %d%n", square(7));
System.out.printf("Square of double 7.5 is %f%n", square(7.5));
}
private static int square(int value) {
System.out.printf("%nCalled square with int argument: %d%n", value);
return value * value;
}
private static double square(double value) {
System.out.printf("%nCalled square with double argument: %f%n", value);
return value * value;
}
}
| 624 | 0.628205 | 0.613782 | 21 | 28.714285 | 26.815317 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.47619 | false | false | 13 |
a8b26c7eb7a40749db6e2cada9ba9026604b6a9f | 3,788,161,181,749 | 4322510a86eef76d950d107ed6619f4b8ed02ab7 | /Hadoop_MapReduce/src/main/java/com/yelp/analysis3/Mapper2.java | 46315f8d3a48d878011542f72371351a9e0e4090 | [] | no_license | pranayg25/YelpReviewDataAnalysis | https://github.com/pranayg25/YelpReviewDataAnalysis | b02e4858b48a887807f63b78443129389833a3fc | c940ef3978789ccdcac393bd34b00108307a11eb | refs/heads/master | 2021-07-12T17:44:02.651000 | 2017-10-15T20:15:38 | 2017-10-15T20:15:38 | 107,045,329 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yelp.analysis3;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.jboss.netty.util.internal.StringUtil;
public class Mapper2 extends Mapper<Object, Text, Text, CompositeValueWritable> {
public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
String[] fields = value.toString().split("\t");
if(fields.length<3 || (fields[0].trim().equals("") || (fields[0]).equals("") || (fields[0]).isEmpty() || (fields[0])=="") ||
(fields[1].trim().equals("") || (fields[1]).equals("")|| (fields[1]).isEmpty() || (fields[1])=="") ||
(fields[2].trim().equals("") || (fields[2]).equals("") || (fields[2]).isEmpty() || (fields[2])=="")) {
System.out.println("gadbad");
}
int val = Integer.parseInt(fields[2]);
context.write(new Text(fields[0]), new CompositeValueWritable(fields[1],fields[2]));
}
}
| UTF-8 | Java | 1,208 | java | Mapper2.java | Java | [] | null | [] | package com.yelp.analysis3;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.jboss.netty.util.internal.StringUtil;
public class Mapper2 extends Mapper<Object, Text, Text, CompositeValueWritable> {
public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
String[] fields = value.toString().split("\t");
if(fields.length<3 || (fields[0].trim().equals("") || (fields[0]).equals("") || (fields[0]).isEmpty() || (fields[0])=="") ||
(fields[1].trim().equals("") || (fields[1]).equals("")|| (fields[1]).isEmpty() || (fields[1])=="") ||
(fields[2].trim().equals("") || (fields[2]).equals("") || (fields[2]).isEmpty() || (fields[2])=="")) {
System.out.println("gadbad");
}
int val = Integer.parseInt(fields[2]);
context.write(new Text(fields[0]), new CompositeValueWritable(fields[1],fields[2]));
}
}
| 1,208 | 0.684603 | 0.668874 | 32 | 36.75 | 36.041641 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.75 | false | false | 13 |
bd0a6ea7fedeab411bbd90de2913f587b813d06d | 15,899,968,952,245 | c1b67b8abdb6b56224075bc42ae2f4df334cf702 | /websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/autobahn/ProgramaticAutobahnEndpoint.java | 74694d76035838f8d09cc40fcc4a9ace1eb49fd5 | [
"Apache-2.0"
] | permissive | bstansberry/undertow | https://github.com/bstansberry/undertow | 595f6177d2a2374c5094240fc635faa00ec06fd0 | 0918479d73d8e2aa13c1c27d66775be8720eb0e2 | refs/heads/master | 2021-10-10T06:15:00.225000 | 2014-02-05T21:06:15 | 2014-02-05T21:06:15 | 16,566,333 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package io.undertow.websockets.jsr.test.autobahn;
import javax.websocket.Endpoint;
import javax.websocket.EndpointConfig;
import javax.websocket.MessageHandler;
import javax.websocket.Session;
import java.nio.ByteBuffer;
/**
* @author Stuart Douglas
*/
public class ProgramaticAutobahnEndpoint extends Endpoint {
@Override
public void onOpen(Session session, EndpointConfig endpointConfig) {
session.addMessageHandler(new BinaryMessageHandler(session));
session.addMessageHandler(new TextMessageHandler(session));
}
private static class BinaryMessageHandler implements MessageHandler.Whole<ByteBuffer> {
private final Session session;
private BinaryMessageHandler(Session session) {
this.session = session;
}
@Override
public void onMessage(ByteBuffer byteBuffer) {
session.getAsyncRemote().sendBinary(byteBuffer);
}
}
private static class TextMessageHandler implements MessageHandler.Whole<String> {
private final Session session;
private TextMessageHandler(Session session) {
this.session = session;
}
@Override
public void onMessage(String byteBuffer) {
session.getAsyncRemote().sendText(byteBuffer);
}
}
}
| UTF-8 | Java | 1,310 | java | ProgramaticAutobahnEndpoint.java | Java | [
{
"context": "ssion;\nimport java.nio.ByteBuffer;\n\n/**\n * @author Stuart Douglas\n */\npublic class ProgramaticAutobahnEndpoint exte",
"end": 252,
"score": 0.9998599886894226,
"start": 238,
"tag": "NAME",
"value": "Stuart Douglas"
}
] | null | [] | package io.undertow.websockets.jsr.test.autobahn;
import javax.websocket.Endpoint;
import javax.websocket.EndpointConfig;
import javax.websocket.MessageHandler;
import javax.websocket.Session;
import java.nio.ByteBuffer;
/**
* @author <NAME>
*/
public class ProgramaticAutobahnEndpoint extends Endpoint {
@Override
public void onOpen(Session session, EndpointConfig endpointConfig) {
session.addMessageHandler(new BinaryMessageHandler(session));
session.addMessageHandler(new TextMessageHandler(session));
}
private static class BinaryMessageHandler implements MessageHandler.Whole<ByteBuffer> {
private final Session session;
private BinaryMessageHandler(Session session) {
this.session = session;
}
@Override
public void onMessage(ByteBuffer byteBuffer) {
session.getAsyncRemote().sendBinary(byteBuffer);
}
}
private static class TextMessageHandler implements MessageHandler.Whole<String> {
private final Session session;
private TextMessageHandler(Session session) {
this.session = session;
}
@Override
public void onMessage(String byteBuffer) {
session.getAsyncRemote().sendText(byteBuffer);
}
}
}
| 1,302 | 0.700763 | 0.700763 | 46 | 27.47826 | 26.389011 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.326087 | false | false | 13 |
bf1804dd940984eb542cb2f1d7df1594a92ab340 | 28,312,424,442,438 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a294/A294572.java | 08977227bb27a608e2a9d9a36733e69cc24fbdb7 | [] | no_license | flywind2/joeis | https://github.com/flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080000 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package irvine.oeis.a294;
// Generated by gen_seq4.pl pfprime 5 8 10 -79 0 at 2019-07-30 14:36
// DO NOT EDIT here!
import irvine.oeis.PowerFactorPrimeSequence;
/**
* A294572 Numbers k such that <code>8*10^k - 79</code> is prime.
* @author Georg Fischer
*/
public class A294572 extends PowerFactorPrimeSequence {
/** Construct the sequence. */
public A294572() {
super(1, 5, 8, 10, -79, 0);
}
}
| UTF-8 | Java | 411 | java | A294572.java | Java | [
{
"context": "that <code>8*10^k - 79</code> is prime.\n * @author Georg Fischer\n */\npublic class A294572 extends PowerFactorPrime",
"end": 257,
"score": 0.9998000264167786,
"start": 244,
"tag": "NAME",
"value": "Georg Fischer"
}
] | null | [] | package irvine.oeis.a294;
// Generated by gen_seq4.pl pfprime 5 8 10 -79 0 at 2019-07-30 14:36
// DO NOT EDIT here!
import irvine.oeis.PowerFactorPrimeSequence;
/**
* A294572 Numbers k such that <code>8*10^k - 79</code> is prime.
* @author <NAME>
*/
public class A294572 extends PowerFactorPrimeSequence {
/** Construct the sequence. */
public A294572() {
super(1, 5, 8, 10, -79, 0);
}
}
| 404 | 0.678832 | 0.547445 | 17 | 23.17647 | 22.612425 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.470588 | false | false | 13 |
f73b4f6995d5c3c8afaf5ce8dbe0bbced3466a48 | 28,312,424,443,489 | f4f6aeb25af05dbecf9dd42af4673b742c15a002 | /CommonObjects/src/main/java/ru/npptmk/guiObjects/GraphicsPnlTlsParams.java | 8a04964c8b87742a7888bec1b5c0920d1cd9a763 | [] | no_license | Andrew-Archer/NojaborskDefectoscope | https://github.com/Andrew-Archer/NojaborskDefectoscope | d45d3f86ccb3f4cb79e0bb8eb8f789682cdf98f9 | 51f542afb92a89eab30045fc820194b5fa490ab4 | refs/heads/master | 2023-07-16T10:08:36.933000 | 2021-08-16T14:21:00 | 2021-08-16T14:21:00 | 330,670,265 | 0 | 0 | null | false | 2021-08-16T14:21:01 | 2021-01-18T13:11:38 | 2021-07-26T12:53:16 | 2021-08-16T14:21:00 | 1,537 | 1 | 0 | 3 | Java | false | false | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.npptmk.guiObjects;
import java.awt.Color;
/**
* Параметры набора графиков толщинометрии.
* @author MalginAS
*/
public class GraphicsPnlTlsParams extends GraphicsPnlParams{
/**
* Идентификаторы источников данных.
*/
public long[] devIds;
/**
* Идентификаторы каналов.
*/
public int[] chanIds;
/**
* Цвета каналов.
*/
public Color[] colors;
/**
* Наименования каналов.
*/
public String[] names;
/**
* Цвета отображения классов толщин.
*/
public Color[] levels;
public GraphicsPnlTlsParams(long[] devIds, int[] chanIds, Color[] colors, String[] names, Color[] levels, String name, int maxY, int maxX, int nHorLines, int nVertLines) {
super(name, maxY, maxX, nHorLines, nVertLines);
this.devIds = devIds;
this.chanIds = chanIds;
this.colors = colors;
this.names = names;
this.levels = levels;
}
}
| UTF-8 | Java | 1,293 | java | GraphicsPnlTlsParams.java | Java | [
{
"context": "араметры набора графиков толщинометрии.\n * @author MalginAS\n */\npublic class GraphicsPnlTlsParams extends Gra",
"end": 307,
"score": 0.9938373565673828,
"start": 299,
"tag": "USERNAME",
"value": "MalginAS"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.npptmk.guiObjects;
import java.awt.Color;
/**
* Параметры набора графиков толщинометрии.
* @author MalginAS
*/
public class GraphicsPnlTlsParams extends GraphicsPnlParams{
/**
* Идентификаторы источников данных.
*/
public long[] devIds;
/**
* Идентификаторы каналов.
*/
public int[] chanIds;
/**
* Цвета каналов.
*/
public Color[] colors;
/**
* Наименования каналов.
*/
public String[] names;
/**
* Цвета отображения классов толщин.
*/
public Color[] levels;
public GraphicsPnlTlsParams(long[] devIds, int[] chanIds, Color[] colors, String[] names, Color[] levels, String name, int maxY, int maxX, int nHorLines, int nVertLines) {
super(name, maxY, maxX, nHorLines, nVertLines);
this.devIds = devIds;
this.chanIds = chanIds;
this.colors = colors;
this.names = names;
this.levels = levels;
}
}
| 1,293 | 0.63089 | 0.63089 | 45 | 24.466667 | 29.149881 | 175 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.644444 | false | false | 13 |
13be537742c7d1e31cb7a09e6adfdb806a844139 | 6,597,069,795,568 | b2370396143a0295db3591ffc50229e52d8ac961 | /src/main/java/com/springsource/petclinic/domain/VetBatchService.java | f4ff5a134c13bf817ccf440b821ce6dd2b2d5711 | [] | no_license | pilarargudo/gvnix-responsive-menu | https://github.com/pilarargudo/gvnix-responsive-menu | 8be1702843d903d0a3c5225ba253d3eeed38827b | 13f4a6c6a1bf71d9a68f44a275187b19adacc283 | refs/heads/master | 2020-12-24T16:25:16.094000 | 2016-05-20T07:54:02 | 2016-05-20T07:54:02 | 42,578,118 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.springsource.petclinic.domain;
import org.gvnix.addon.jpa.annotations.batch.GvNIXJpaBatch;
import org.springframework.stereotype.Service;
@Service
@GvNIXJpaBatch(entity = Vet.class)
public class VetBatchService {
}
| UTF-8 | Java | 228 | java | VetBatchService.java | Java | [] | null | [] | package com.springsource.petclinic.domain;
import org.gvnix.addon.jpa.annotations.batch.GvNIXJpaBatch;
import org.springframework.stereotype.Service;
@Service
@GvNIXJpaBatch(entity = Vet.class)
public class VetBatchService {
}
| 228 | 0.828947 | 0.828947 | 8 | 27.5 | 20.712315 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.