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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
270f2ce5e51a66da4f65e0eee08d4187ea98ab51
| 25,168,508,381,901 |
42b98936de0d96f96ef571fc322d9565524111c9
|
/src/main/java/com/github/mrduguo/spring/app/config/SwaggerConfig.java
|
61cbe895908d2fe090611c839ebd6cd460424e7e
|
[] |
no_license
|
mrduguo/spring-app
|
https://github.com/mrduguo/spring-app
|
221b1ea590734f19cd4fa75601fddc4c2a4c21a3
|
6b05b4881499b37ac02ac4a14851d76b85609ebb
|
refs/heads/master
| 2021-04-09T14:12:31.500000 | 2019-07-29T13:29:39 | 2019-07-29T13:29:39 | 125,653,503 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.github.mrduguo.spring.app.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Value("${api.name:}")
String projectName;
@Value("${api.description:}")
String projectDescription;
@Value("${api.version:}")
String projectVersion;
@Value("${api.terms.url:}")
String projectTermsUrl;
@Value("${api.license.name:Apache License 2.0}")
String projectLicenseName;
@Value("${api.license.url:http://www.apache.org/licenses/LICENSE-2.0}")
String projectLicenseUrl;
@Bean
Docket api() {
return createApi("default", "REST", "/(api)/.*");
}
@Bean
@Profile("test")
Docket dependencies() {
return createApi("dependencies", "Dependencies'", "/(mock)/.*");
}
Docket createApi(String groupName, String apiName, String pathRegex) {
return new Docket(DocumentationType.SWAGGER_2)
.ignoredParameterTypes(groovy.lang.MetaClass.class)
.groupName(groupName)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex(pathRegex))
.build()
.apiInfo(apiInfo(apiName));
}
ApiInfo apiInfo(String apiName) {
return new ApiInfo(
projectName + " " + apiName + " API",
projectDescription,
projectVersion,
projectTermsUrl,
null,
projectLicenseName,
projectLicenseUrl,
new ArrayList<VendorExtension>()
);
}
}
|
UTF-8
|
Java
| 2,261 |
java
|
SwaggerConfig.java
|
Java
|
[
{
"context": "package com.github.mrduguo.spring.app.config;\n\nimport org.springframework.be",
"end": 26,
"score": 0.9951958060264587,
"start": 19,
"tag": "USERNAME",
"value": "mrduguo"
}
] | null |
[] |
package com.github.mrduguo.spring.app.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Value("${api.name:}")
String projectName;
@Value("${api.description:}")
String projectDescription;
@Value("${api.version:}")
String projectVersion;
@Value("${api.terms.url:}")
String projectTermsUrl;
@Value("${api.license.name:Apache License 2.0}")
String projectLicenseName;
@Value("${api.license.url:http://www.apache.org/licenses/LICENSE-2.0}")
String projectLicenseUrl;
@Bean
Docket api() {
return createApi("default", "REST", "/(api)/.*");
}
@Bean
@Profile("test")
Docket dependencies() {
return createApi("dependencies", "Dependencies'", "/(mock)/.*");
}
Docket createApi(String groupName, String apiName, String pathRegex) {
return new Docket(DocumentationType.SWAGGER_2)
.ignoredParameterTypes(groovy.lang.MetaClass.class)
.groupName(groupName)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex(pathRegex))
.build()
.apiInfo(apiInfo(apiName));
}
ApiInfo apiInfo(String apiName) {
return new ApiInfo(
projectName + " " + apiName + " API",
projectDescription,
projectVersion,
projectTermsUrl,
null,
projectLicenseName,
projectLicenseUrl,
new ArrayList<VendorExtension>()
);
}
}
| 2,261 | 0.661212 | 0.657674 | 76 | 28.763159 | 22.722507 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.473684 | false | false |
12
|
4ee35d597b89f1ca39180dbe985a17ccf9c28d17
| 137,438,984,074 |
683408cc84f233c6aed81f710b771781a53e38ae
|
/techproedfall2020/src/day07/Question02Tulin.java
|
87c732b24a74564d3598b2c7186e283a379877f8
|
[] |
no_license
|
shnab/eclipse-workspace
|
https://github.com/shnab/eclipse-workspace
|
72c5da716d72fc0019f643d59232a09fc321df1d
|
397a4ced9d7dffc9ba8b985aaafb62dfdcaea0ce
|
refs/heads/master
| 2023-06-26T01:45:28.159000 | 2021-07-26T21:34:47 | 2021-07-26T21:34:47 | 325,132,561 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package day07;
import java.util.Scanner;
public class Question02Tulin {
public static void main(String[] args) {
//Write a program to find the missing char in a serial string
//abdef ===> c kayip burada
Scanner scan = new Scanner (System.in);
System.out.println("Enter your serial string");
String str = scan.nextLine();
System.out.println(missingLetter(str));
}
public static String missingLetter (String str) {
for (int i = 0; i < str.length()-1; i++) {
if (str.charAt(i+1)-str.charAt(i)!=1) {
return(char) (str.charAt(i) +1) + ""; // burada char yazunca harfi verdi. Char cikinca
//
}
}
return "No missing char";
}
}
|
UTF-8
|
Java
| 690 |
java
|
Question02Tulin.java
|
Java
|
[] | null |
[] |
package day07;
import java.util.Scanner;
public class Question02Tulin {
public static void main(String[] args) {
//Write a program to find the missing char in a serial string
//abdef ===> c kayip burada
Scanner scan = new Scanner (System.in);
System.out.println("Enter your serial string");
String str = scan.nextLine();
System.out.println(missingLetter(str));
}
public static String missingLetter (String str) {
for (int i = 0; i < str.length()-1; i++) {
if (str.charAt(i+1)-str.charAt(i)!=1) {
return(char) (str.charAt(i) +1) + ""; // burada char yazunca harfi verdi. Char cikinca
//
}
}
return "No missing char";
}
}
| 690 | 0.630435 | 0.617391 | 31 | 21.258064 | 23.118164 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.129032 | false | false |
12
|
c8518f1304158ff43b7f3285dea8d0441da65e70
| 26,585,847,629,402 |
290ef36bff334835e06adf6e366d5224eb9474c5
|
/News3/app/src/main/java/com/example/news3/Constents.java
|
dba5b2f87225520bf8f293dcd87f6cc3d30dbdde
|
[] |
no_license
|
guanqihuihehe/MyNews
|
https://github.com/guanqihuihehe/MyNews
|
c4c4662ca94a8cb977513b7d4f904bd50f37c878
|
6016ab9de734ea95ef41ccf45d5489ff191ae0a6
|
refs/heads/main
| 2023-03-14T12:05:26.361000 | 2021-03-07T12:49:07 | 2021-03-07T12:49:07 | 345,344,486 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.news3;
public class Constents {
}
|
UTF-8
|
Java
| 56 |
java
|
Constents.java
|
Java
|
[] | null |
[] |
package com.example.news3;
public class Constents {
}
| 56 | 0.75 | 0.732143 | 5 | 10.2 | 12.106196 | 26 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
12
|
972a6bfddee6eabb5b5442705833009b5a927f84
| 26,585,847,628,453 |
a1a67c034e7b014bdd218aea248a20bd7d8de57d
|
/Application/rest/rest-api/src/main/java/eu/jugcologne/foodeys/rest/api/model/AddCookRequest.java
|
695bcd9b4c604d14b9f7201f1159da6b4239b420
|
[
"Apache-2.0"
] |
permissive
|
JUGCologne/Foodeys
|
https://github.com/JUGCologne/Foodeys
|
e53005397ebcd4b07c7eec686faa82e17836e4d1
|
94468e36724a1d13fd1722b0eabd6734dbd1aeae
|
refs/heads/master
| 2016-09-05T17:58:12.742000 | 2013-09-24T20:02:53 | 2013-09-24T20:02:53 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package eu.jugcologne.foodeys.rest.api.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class AddCookRequest extends AbstractCookRequest {
private String email;
public AddCookRequest() {
}
public AddCookRequest(String name, String email) {
setName(name);
this.email = email;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
|
UTF-8
|
Java
| 649 |
java
|
AddCookRequest.java
|
Java
|
[] | null |
[] |
package eu.jugcologne.foodeys.rest.api.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class AddCookRequest extends AbstractCookRequest {
private String email;
public AddCookRequest() {
}
public AddCookRequest(String name, String email) {
setName(name);
this.email = email;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| 649 | 0.714946 | 0.714946 | 28 | 22.214285 | 19.00631 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.392857 | false | false |
12
|
3ba314b00d26246b63bd66ca610a1da09a061597
| 29,798,483,142,199 |
9510a2e2a018d41912822b7f56230ab104a0325b
|
/Atividade3/src/questao3/ChocolateDecorator.java
|
4550409568126e9f0824f4b74584881a1aef3b78
|
[] |
no_license
|
ferrer12lindem/Atividades3POO
|
https://github.com/ferrer12lindem/Atividades3POO
|
f6172c6a82d04f84e001fe403263f99a7f3c31f0
|
775cd5f9722dbcfc08a9b10c2c3e410fe2bbff13
|
refs/heads/master
| 2021-05-16T06:02:23.883000 | 2017-09-14T21:49:31 | 2017-09-14T21:49:31 | 103,338,881 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package questao3;
public class ChocolateDecorator extends CoberturaDecorator{
public ChocolateDecorator(CookingFever cooking) {
super(cooking);
super.cooking = cooking;
super.decoratorDescricao = "Chocolate";
}
public String getSabor() {
return this.cooking.getSabor()+" com "+this.decoratorDescricao;
}
public double getCusto() {
return 1.0+this.cooking.getCusto();
}
}
|
UTF-8
|
Java
| 393 |
java
|
ChocolateDecorator.java
|
Java
|
[] | null |
[] |
package questao3;
public class ChocolateDecorator extends CoberturaDecorator{
public ChocolateDecorator(CookingFever cooking) {
super(cooking);
super.cooking = cooking;
super.decoratorDescricao = "Chocolate";
}
public String getSabor() {
return this.cooking.getSabor()+" com "+this.decoratorDescricao;
}
public double getCusto() {
return 1.0+this.cooking.getCusto();
}
}
| 393 | 0.743003 | 0.735369 | 19 | 19.736841 | 21.252472 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.263158 | false | false |
12
|
c2200b18331b832876d30a579df4486acb686044
| 20,770,461,861,297 |
028d6009f3beceba80316daa84b628496a210f8d
|
/uidesigner/com.nokia.sdt.component.symbian/src/com/nokia/sdt/emf/component/impl/ImportArgumentsTypeImpl.java
|
49e227198426f3611fa5a5701559dce239d44ae5
|
[] |
no_license
|
JamesLinus/oss.FCL.sftools.dev.ide.carbidecpp
|
https://github.com/JamesLinus/oss.FCL.sftools.dev.ide.carbidecpp
|
fa50cafa69d3e317abf0db0f4e3e557150fd88b3
|
4420f338bc4e522c563f8899d81201857236a66a
|
refs/heads/master
| 2020-12-30T16:45:28.474000 | 2010-10-20T16:19:31 | 2010-10-20T16:19:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.nokia.sdt.emf.component.impl;
import com.nokia.sdt.emf.component.ComponentPackage;
import com.nokia.sdt.emf.component.ImportArgumentsType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import java.util.List;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Import Arguments Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getArguments <em>Arguments</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getExceptArguments <em>Except Arguments</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getHelp <em>Help</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getMacroName <em>Macro Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ImportArgumentsTypeImpl extends EObjectImpl implements ImportArgumentsType {
/**
* The default value of the '{@link #getArguments() <em>Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArguments()
* @generated
* @ordered
*/
protected static final List ARGUMENTS_EDEFAULT = null;
/**
* The cached value of the '{@link #getArguments() <em>Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArguments()
* @generated
* @ordered
*/
protected List arguments = ARGUMENTS_EDEFAULT;
/**
* The default value of the '{@link #getExceptArguments() <em>Except Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExceptArguments()
* @generated
* @ordered
*/
protected static final List EXCEPT_ARGUMENTS_EDEFAULT = null;
/**
* The cached value of the '{@link #getExceptArguments() <em>Except Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExceptArguments()
* @generated
* @ordered
*/
protected List exceptArguments = EXCEPT_ARGUMENTS_EDEFAULT;
/**
* The default value of the '{@link #getHelp() <em>Help</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHelp()
* @generated
* @ordered
*/
protected static final String HELP_EDEFAULT = null;
/**
* The cached value of the '{@link #getHelp() <em>Help</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHelp()
* @generated
* @ordered
*/
protected String help = HELP_EDEFAULT;
/**
* The default value of the '{@link #getMacroName() <em>Macro Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroName()
* @generated
* @ordered
*/
protected static final String MACRO_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getMacroName() <em>Macro Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroName()
* @generated
* @ordered
*/
protected String macroName = MACRO_NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImportArgumentsTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return ComponentPackage.Literals.IMPORT_ARGUMENTS_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List getArguments() {
return arguments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setArguments(List newArguments) {
List oldArguments = arguments;
arguments = newArguments;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS, oldArguments, arguments));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List getExceptArguments() {
return exceptArguments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExceptArguments(List newExceptArguments) {
List oldExceptArguments = exceptArguments;
exceptArguments = newExceptArguments;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS, oldExceptArguments, exceptArguments));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getHelp() {
return help;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHelp(String newHelp) {
String oldHelp = help;
help = newHelp;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP, oldHelp, help));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getMacroName() {
return macroName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMacroName(String newMacroName) {
String oldMacroName = macroName;
macroName = newMacroName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME, oldMacroName, macroName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
return getArguments();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
return getExceptArguments();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
return getHelp();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
return getMacroName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
setArguments((List)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
setExceptArguments((List)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
setHelp((String)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
setMacroName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
setArguments(ARGUMENTS_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
setExceptArguments(EXCEPT_ARGUMENTS_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
setHelp(HELP_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
setMacroName(MACRO_NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
return ARGUMENTS_EDEFAULT == null ? arguments != null : !ARGUMENTS_EDEFAULT.equals(arguments);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
return EXCEPT_ARGUMENTS_EDEFAULT == null ? exceptArguments != null : !EXCEPT_ARGUMENTS_EDEFAULT.equals(exceptArguments);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
return HELP_EDEFAULT == null ? help != null : !HELP_EDEFAULT.equals(help);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
return MACRO_NAME_EDEFAULT == null ? macroName != null : !MACRO_NAME_EDEFAULT.equals(macroName);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (arguments: ");
result.append(arguments);
result.append(", exceptArguments: ");
result.append(exceptArguments);
result.append(", help: ");
result.append(help);
result.append(", macroName: ");
result.append(macroName);
result.append(')');
return result.toString();
}
} //ImportArgumentsTypeImpl
|
UTF-8
|
Java
| 9,059 |
java
|
ImportArgumentsTypeImpl.java
|
Java
|
[] | null |
[] |
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.nokia.sdt.emf.component.impl;
import com.nokia.sdt.emf.component.ComponentPackage;
import com.nokia.sdt.emf.component.ImportArgumentsType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import java.util.List;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Import Arguments Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getArguments <em>Arguments</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getExceptArguments <em>Except Arguments</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getHelp <em>Help</em>}</li>
* <li>{@link com.nokia.sdt.emf.component.impl.ImportArgumentsTypeImpl#getMacroName <em>Macro Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ImportArgumentsTypeImpl extends EObjectImpl implements ImportArgumentsType {
/**
* The default value of the '{@link #getArguments() <em>Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArguments()
* @generated
* @ordered
*/
protected static final List ARGUMENTS_EDEFAULT = null;
/**
* The cached value of the '{@link #getArguments() <em>Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getArguments()
* @generated
* @ordered
*/
protected List arguments = ARGUMENTS_EDEFAULT;
/**
* The default value of the '{@link #getExceptArguments() <em>Except Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExceptArguments()
* @generated
* @ordered
*/
protected static final List EXCEPT_ARGUMENTS_EDEFAULT = null;
/**
* The cached value of the '{@link #getExceptArguments() <em>Except Arguments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExceptArguments()
* @generated
* @ordered
*/
protected List exceptArguments = EXCEPT_ARGUMENTS_EDEFAULT;
/**
* The default value of the '{@link #getHelp() <em>Help</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHelp()
* @generated
* @ordered
*/
protected static final String HELP_EDEFAULT = null;
/**
* The cached value of the '{@link #getHelp() <em>Help</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHelp()
* @generated
* @ordered
*/
protected String help = HELP_EDEFAULT;
/**
* The default value of the '{@link #getMacroName() <em>Macro Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroName()
* @generated
* @ordered
*/
protected static final String MACRO_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getMacroName() <em>Macro Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMacroName()
* @generated
* @ordered
*/
protected String macroName = MACRO_NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImportArgumentsTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return ComponentPackage.Literals.IMPORT_ARGUMENTS_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List getArguments() {
return arguments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setArguments(List newArguments) {
List oldArguments = arguments;
arguments = newArguments;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS, oldArguments, arguments));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List getExceptArguments() {
return exceptArguments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExceptArguments(List newExceptArguments) {
List oldExceptArguments = exceptArguments;
exceptArguments = newExceptArguments;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS, oldExceptArguments, exceptArguments));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getHelp() {
return help;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHelp(String newHelp) {
String oldHelp = help;
help = newHelp;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP, oldHelp, help));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getMacroName() {
return macroName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMacroName(String newMacroName) {
String oldMacroName = macroName;
macroName = newMacroName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME, oldMacroName, macroName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
return getArguments();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
return getExceptArguments();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
return getHelp();
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
return getMacroName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
setArguments((List)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
setExceptArguments((List)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
setHelp((String)newValue);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
setMacroName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
setArguments(ARGUMENTS_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
setExceptArguments(EXCEPT_ARGUMENTS_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
setHelp(HELP_EDEFAULT);
return;
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
setMacroName(MACRO_NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__ARGUMENTS:
return ARGUMENTS_EDEFAULT == null ? arguments != null : !ARGUMENTS_EDEFAULT.equals(arguments);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__EXCEPT_ARGUMENTS:
return EXCEPT_ARGUMENTS_EDEFAULT == null ? exceptArguments != null : !EXCEPT_ARGUMENTS_EDEFAULT.equals(exceptArguments);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__HELP:
return HELP_EDEFAULT == null ? help != null : !HELP_EDEFAULT.equals(help);
case ComponentPackage.IMPORT_ARGUMENTS_TYPE__MACRO_NAME:
return MACRO_NAME_EDEFAULT == null ? macroName != null : !MACRO_NAME_EDEFAULT.equals(macroName);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (arguments: ");
result.append(arguments);
result.append(", exceptArguments: ");
result.append(exceptArguments);
result.append(", help: ");
result.append(help);
result.append(", macroName: ");
result.append(macroName);
result.append(')');
return result.toString();
}
} //ImportArgumentsTypeImpl
| 9,059 | 0.637377 | 0.637377 | 323 | 26.04644 | 27.16036 | 153 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.597523 | false | false |
12
|
14d9ee397c7f0ad32a68c90851bbe929c07d7ac1
| 12,893,491,880,311 |
869a62d2062ba7ca58ac444df9adca7f067536f4
|
/src/main/java/org/apiman/client/domain/summary/PolicyDefinitionSummary.java
|
59ca424603008ab1286607a7f8960296b813d7eb
|
[
"Apache-2.0"
] |
permissive
|
ravi-choudhari/apiman-client
|
https://github.com/ravi-choudhari/apiman-client
|
4093a931194f1af1af552dc6824be5b0f2d66cb3
|
a955d73fd4bc3d0b46bebde10f85e66c328db8fc
|
refs/heads/master
| 2021-12-23T13:48:06.267000 | 2020-05-02T11:36:07 | 2020-05-02T11:36:07 | 149,012,095 | 1 | 0 |
Apache-2.0
| false | 2021-12-09T19:55:22 | 2018-09-16T16:05:31 | 2020-05-02T11:36:10 | 2021-12-09T19:55:19 | 233 | 0 | 0 | 3 |
Java
| false | false |
package org.apiman.client.domain.summary;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class PolicyDefinitionSummary implements Serializable {
private String id;
private String policyImpl;
private String name;
private String description;
private String icon;
private PolicyFormType formType;
private Long pluginId;
}
|
UTF-8
|
Java
| 583 |
java
|
PolicyDefinitionSummary.java
|
Java
|
[] | null |
[] |
package org.apiman.client.domain.summary;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class PolicyDefinitionSummary implements Serializable {
private String id;
private String policyImpl;
private String name;
private String description;
private String icon;
private PolicyFormType formType;
private Long pluginId;
}
| 583 | 0.766724 | 0.766724 | 25 | 21.32 | 14.909648 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.56 | false | false |
12
|
35d909882cd66ab03152fab989f5b99ebb66481f
| 32,830,730,043,257 |
d7d58df4d95080b80cab4f5668302563cdee05c9
|
/privately/app/src/main/java/com/zsoe/businesssharing/business/exhibitionhall/CompanyProfilesActivity.java
|
4bb23a0c95c271c02bbdea7d186bbed2a7a1a24d
|
[] |
no_license
|
gaowenjie12/app-and
|
https://github.com/gaowenjie12/app-and
|
6c1a4b92e192c8cf85ce329ef82575428cc5e8b3
|
673b94020adb11100d075e2082fe9f9f30316f61
|
refs/heads/master
| 2020-06-30T22:31:39.678000 | 2019-12-24T09:44:29 | 2019-12-24T09:44:29 | 200,968,166 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zsoe.businesssharing.business.exhibitionhall;
import android.content.Intent;
import android.graphics.Point;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.ToastUtils;
import com.facebook.drawee.view.SimpleDraweeView;
import com.zsoe.businesssharing.R;
import com.zsoe.businesssharing.base.BaseActivity;
import com.zsoe.businesssharing.base.Config;
import com.zsoe.businesssharing.base.DApplication;
import com.zsoe.businesssharing.base.RootResponse;
import com.zsoe.businesssharing.base.baseadapter.BaseQuickAdapter;
import com.zsoe.businesssharing.base.baseadapter.OnionRecycleAdapter;
import com.zsoe.businesssharing.base.presenter.HttpResponseFunc;
import com.zsoe.businesssharing.base.presenter.RequiresPresenter;
import com.zsoe.businesssharing.bean.CompanyInfo;
import com.zsoe.businesssharing.commonview.ExpandableTextView;
import com.zsoe.businesssharing.commonview.recyclerview.BaseViewHolder;
import com.zsoe.businesssharing.utils.DialogManager;
import com.zsoe.businesssharing.utils.FrecoFactory;
import com.zsoe.businesssharing.utils.GlideUtils;
import com.zsoe.businesssharing.utils.PhotoLoader;
import com.zsoe.businesssharing.utils.ScreenUtils;
import com.zsoe.businesssharing.utils.android.schedulers.AndroidSchedulers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cn.jzvd.JZDataSource;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
import indi.liyi.viewer.ImageDrawee;
import indi.liyi.viewer.ImageViewer;
import indi.liyi.viewer.Utils;
import indi.liyi.viewer.ViewData;
import indi.liyi.viewer.ViewerStatus;
import indi.liyi.viewer.listener.OnBrowseStatusListener;
import indi.liyi.viewer.listener.OnItemChangedListener;
import okhttp3.FormBody;
import rx.Subscriber;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
@RequiresPresenter(CompanyInfoPresenter.class)
public class CompanyProfilesActivity extends BaseActivity<CompanyInfoPresenter> implements View.OnClickListener {
private SimpleDraweeView mCompanyImage;
private TextView mTvMasterName;
private TextView mTvMasterZhiwei;
private JzvdStd mJzVideo;
private RecyclerView mRvPic;
/**
* 产品列表
*/
private TextView mTvPrdList;
private ExpandableTextView mTvChenguo;
/**
* 请输入姓名
*/
private EditText mEtName;
/**
* 请输入号码
*/
private EditText mEtPhone;
/**
* 请输入要留言的内容
*/
private EditText mEtContent;
/**
* 提交
*/
private Button mBtnLogin;
int id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_company_profiles);
initView();
initTitleText("企业简介");
id = getIntent().getIntExtra(Config.INTENT_PARAMS1, -1);
DialogManager.getInstance().showNetLoadingView(this);
getPresenter().company_info("" + id);
}
private List<ViewData> mVdList;
private ImageViewer imageViewer;
private void initView() {
mCompanyImage = (SimpleDraweeView) findViewById(R.id.company_image);
mTvMasterName = (TextView) findViewById(R.id.tv_master_name);
mTvMasterZhiwei = (TextView) findViewById(R.id.tv_master_zhiwei);
mJzVideo = (JzvdStd) findViewById(R.id.jz_video);
mRvPic = (RecyclerView) findViewById(R.id.rv_pic);
mTvPrdList = (TextView) findViewById(R.id.tv_prd_list);
mTvPrdList.setOnClickListener(this);
mTvChenguo = (ExpandableTextView) findViewById(R.id.tv_chenguo);
mEtName = (EditText) findViewById(R.id.et_name);
mEtPhone = (EditText) findViewById(R.id.et_phone);
mEtContent = (EditText) findViewById(R.id.et_content);
mBtnLogin = (Button) findViewById(R.id.btn_login);
mBtnLogin.setOnClickListener(this);
imageViewer = findViewById(R.id.imageViewer);
}
CompanyInfo companyInfo;
public void setData(CompanyInfo companyInfo) {
this.companyInfo = companyInfo;
initRightIcon();
// 将列表中的每个视频设置为默认16:9的比例
ViewGroup.LayoutParams params = mJzVideo.getLayoutParams();
// 宽度为屏幕宽度
params.width = getResources().getDisplayMetrics().widthPixels;
// 高度为宽度的9/16
params.height = (int) (params.width * 9f / 16f);
mJzVideo.setLayoutParams(params);
JZDataSource jzDataSource = new JZDataSource(companyInfo.getVideourl());
mJzVideo.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL);
mJzVideo.thumbImageView.setScaleType(ImageView.ScaleType.FIT_XY);
GlideUtils.loadImage(mContext, companyInfo.getVideocoverurl(), mJzVideo.thumbImageView);
FrecoFactory.getInstance().disPlay(mCompanyImage, companyInfo.getAvatar());
mTvMasterName.setText(companyInfo.getName());
mTvMasterZhiwei.setText("主营业务:"+companyInfo.getMaincate());
mTvChenguo.setText(companyInfo.getCompanydes());
List<String> photos = companyInfo.getPhotos();
OnionRecycleAdapter jiazhiAdapter = new OnionRecycleAdapter<String>(R.layout.item_xuanchuanpian_layout, photos) {
@Override
protected void convert(BaseViewHolder holder, final String item) {
super.convert(holder, item);
SimpleDraweeView simpleDraweeView = holder.getView(R.id.image);
FrecoFactory.getInstance().disPlay(simpleDraweeView, item);
}
};
LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(mContext);
linearLayoutManager2.setOrientation(RecyclerView.HORIZONTAL);
mRvPic.setFocusableInTouchMode(false);
mRvPic.setNestedScrollingEnabled(false);
mRvPic.setLayoutManager(linearLayoutManager2);// 布局管理器。
mRvPic.setHasFixedSize(true);// 如果Item够简单,高度是确定的,打开FixSize将提高性能。
mRvPic.setItemAnimator(new DefaultItemAnimator());// 设置Item默认动画,加也行,不加
mRvPic.setAdapter(jiazhiAdapter);
jiazhiAdapter.setOnRecyclerViewItemClickListener(new BaseQuickAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
int[] location = new int[2];
// 获取在整个屏幕内的绝对坐标
view.getLocationOnScreen(location);
ViewData viewData = mVdList.get(position);
viewData.setTargetX(location[0]);
viewData.setTargetY(location[1]);
imageViewer.viewData(mVdList)
.watch(position);
}
});
linearLayoutManager2.scrollToPositionWithOffset(0, 0);
Point mScreenSize = ScreenUtils.getScreenSize(this);
mVdList = new ArrayList<>();
for (int i = 0, len = photos.size(); i < len; i++) {
ViewData viewData = new ViewData();
viewData.setImageSrc(photos.get(i));
viewData.setTargetX(0);
viewData.setTargetY(0);
viewData.setTargetWidth(mScreenSize.x);
viewData.setTargetHeight(Utils.dp2px(this, 200));
mVdList.add(viewData);
}
imageViewer.overlayStatusBar(false)
.imageLoader(new PhotoLoader());
imageViewer
.setOnItemChangedListener(new OnItemChangedListener() {
@Override
public void onItemChanged(int position, ImageDrawee drawee) {
if (imageViewer.getViewStatus() == ViewerStatus.STATUS_WATCHING) {
mVdList.get(imageViewer.getCurrentPosition()).setTargetX(0);
linearLayoutManager2.scrollToPositionWithOffset(imageViewer.getCurrentPosition(), (int) (mVdList.get(imageViewer.getCurrentPosition()).getTargetX() / 2));
}
}
})
.setOnBrowseStatusListener(
new OnBrowseStatusListener() {
@Override
public void onBrowseStatus(int status) {
if (status == ViewerStatus.STATUS_BEGIN_OPEN) {
ScreenUtils.changeStatusBarColor(CompanyProfilesActivity.this, R.color.black);
} else if (status == ViewerStatus.STATUS_SILENCE) {
ScreenUtils.changeStatusBarColor(CompanyProfilesActivity.this, R.color.white);
}
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
default:
break;
case R.id.tv_prd_list:
Intent intent = new Intent(mContext, ProductListActivity.class);
intent.putExtra(Config.INTENT_PARAMS3,companyInfo.getId()+"");
startActivity(intent);
break;
case R.id.btn_login:
String s = mEtName.getText().toString();
if (TextUtils.isEmpty(s)) {
ToastUtils.showShort("请输入姓名");
return;
}
String s2 = mEtPhone.getText().toString();
if (TextUtils.isEmpty(s2)) {
ToastUtils.showShort("请输入手机号");
return;
}
String s3 = mEtContent.getText().toString();
if (TextUtils.isEmpty(s3)) {
ToastUtils.showShort("请输入内容");
return;
}
if (null == companyInfo) {
ToastUtils.showShort("公司数据为空");
return;
}
DialogManager.getInstance().showNetLoadingView(mContext);
getPresenter().save_mailbox_msg(s, s2, companyInfo.getUid() + "", DApplication.getInstance().getLoginUser().getId() + "", s3);
break;
}
}
private void initRightIcon() {
if (companyInfo.getIs_collect() == 1) {
setTitleRigthIcon(R.mipmap.shoucang, new Action1<View>() {
@Override
public void call(View view) {
collect(companyInfo.getId() + "", "2");
}
});
} else {
setTitleRigthIcon(R.mipmap.shoucang_pre, new Action1<View>() {
@Override
public void call(View view) {
collect(companyInfo.getId() + "", "1");
}
});
}
}
public void collect(String valueid, String acttype) {
DialogManager.getInstance().showNetLoadingView(mContext);
HashMap<String, String> params = new HashMap<>();
params.put("uid", DApplication.getInstance().getLoginUser().getId() + "");
params.put("type", "1");
params.put("acttype", acttype);
params.put("valueid", valueid);
FormBody formBody = getPresenter().signForm(params);
DApplication.getInstance().getServerAPI().collect(formBody).map(new HttpResponseFunc())
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber() {
@Override
public void onNext(Object o) {
DialogManager.getInstance().dismissNetLoadingView();
//1收藏 2 取消收藏
if (acttype.equals("1")) {
companyInfo.setIs_collect(1);
} else {
companyInfo.setIs_collect(0);
}
initRightIcon();
}
@Override
public void onCompleted() {
DialogManager.getInstance().dismissNetLoadingView();
}
@Override
public void onError(Throwable e) {
DialogManager.getInstance().dismissNetLoadingView();
}
});
}
@Override
public void onBackPressed() {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
}
public void setMsgSuccess(RootResponse t) {
ToastUtils.showShort(t.getMsg());
}
}
|
UTF-8
|
Java
| 12,996 |
java
|
CompanyProfilesActivity.java
|
Java
|
[] | null |
[] |
package com.zsoe.businesssharing.business.exhibitionhall;
import android.content.Intent;
import android.graphics.Point;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.ToastUtils;
import com.facebook.drawee.view.SimpleDraweeView;
import com.zsoe.businesssharing.R;
import com.zsoe.businesssharing.base.BaseActivity;
import com.zsoe.businesssharing.base.Config;
import com.zsoe.businesssharing.base.DApplication;
import com.zsoe.businesssharing.base.RootResponse;
import com.zsoe.businesssharing.base.baseadapter.BaseQuickAdapter;
import com.zsoe.businesssharing.base.baseadapter.OnionRecycleAdapter;
import com.zsoe.businesssharing.base.presenter.HttpResponseFunc;
import com.zsoe.businesssharing.base.presenter.RequiresPresenter;
import com.zsoe.businesssharing.bean.CompanyInfo;
import com.zsoe.businesssharing.commonview.ExpandableTextView;
import com.zsoe.businesssharing.commonview.recyclerview.BaseViewHolder;
import com.zsoe.businesssharing.utils.DialogManager;
import com.zsoe.businesssharing.utils.FrecoFactory;
import com.zsoe.businesssharing.utils.GlideUtils;
import com.zsoe.businesssharing.utils.PhotoLoader;
import com.zsoe.businesssharing.utils.ScreenUtils;
import com.zsoe.businesssharing.utils.android.schedulers.AndroidSchedulers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cn.jzvd.JZDataSource;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;
import indi.liyi.viewer.ImageDrawee;
import indi.liyi.viewer.ImageViewer;
import indi.liyi.viewer.Utils;
import indi.liyi.viewer.ViewData;
import indi.liyi.viewer.ViewerStatus;
import indi.liyi.viewer.listener.OnBrowseStatusListener;
import indi.liyi.viewer.listener.OnItemChangedListener;
import okhttp3.FormBody;
import rx.Subscriber;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
@RequiresPresenter(CompanyInfoPresenter.class)
public class CompanyProfilesActivity extends BaseActivity<CompanyInfoPresenter> implements View.OnClickListener {
private SimpleDraweeView mCompanyImage;
private TextView mTvMasterName;
private TextView mTvMasterZhiwei;
private JzvdStd mJzVideo;
private RecyclerView mRvPic;
/**
* 产品列表
*/
private TextView mTvPrdList;
private ExpandableTextView mTvChenguo;
/**
* 请输入姓名
*/
private EditText mEtName;
/**
* 请输入号码
*/
private EditText mEtPhone;
/**
* 请输入要留言的内容
*/
private EditText mEtContent;
/**
* 提交
*/
private Button mBtnLogin;
int id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_company_profiles);
initView();
initTitleText("企业简介");
id = getIntent().getIntExtra(Config.INTENT_PARAMS1, -1);
DialogManager.getInstance().showNetLoadingView(this);
getPresenter().company_info("" + id);
}
private List<ViewData> mVdList;
private ImageViewer imageViewer;
private void initView() {
mCompanyImage = (SimpleDraweeView) findViewById(R.id.company_image);
mTvMasterName = (TextView) findViewById(R.id.tv_master_name);
mTvMasterZhiwei = (TextView) findViewById(R.id.tv_master_zhiwei);
mJzVideo = (JzvdStd) findViewById(R.id.jz_video);
mRvPic = (RecyclerView) findViewById(R.id.rv_pic);
mTvPrdList = (TextView) findViewById(R.id.tv_prd_list);
mTvPrdList.setOnClickListener(this);
mTvChenguo = (ExpandableTextView) findViewById(R.id.tv_chenguo);
mEtName = (EditText) findViewById(R.id.et_name);
mEtPhone = (EditText) findViewById(R.id.et_phone);
mEtContent = (EditText) findViewById(R.id.et_content);
mBtnLogin = (Button) findViewById(R.id.btn_login);
mBtnLogin.setOnClickListener(this);
imageViewer = findViewById(R.id.imageViewer);
}
CompanyInfo companyInfo;
public void setData(CompanyInfo companyInfo) {
this.companyInfo = companyInfo;
initRightIcon();
// 将列表中的每个视频设置为默认16:9的比例
ViewGroup.LayoutParams params = mJzVideo.getLayoutParams();
// 宽度为屏幕宽度
params.width = getResources().getDisplayMetrics().widthPixels;
// 高度为宽度的9/16
params.height = (int) (params.width * 9f / 16f);
mJzVideo.setLayoutParams(params);
JZDataSource jzDataSource = new JZDataSource(companyInfo.getVideourl());
mJzVideo.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL);
mJzVideo.thumbImageView.setScaleType(ImageView.ScaleType.FIT_XY);
GlideUtils.loadImage(mContext, companyInfo.getVideocoverurl(), mJzVideo.thumbImageView);
FrecoFactory.getInstance().disPlay(mCompanyImage, companyInfo.getAvatar());
mTvMasterName.setText(companyInfo.getName());
mTvMasterZhiwei.setText("主营业务:"+companyInfo.getMaincate());
mTvChenguo.setText(companyInfo.getCompanydes());
List<String> photos = companyInfo.getPhotos();
OnionRecycleAdapter jiazhiAdapter = new OnionRecycleAdapter<String>(R.layout.item_xuanchuanpian_layout, photos) {
@Override
protected void convert(BaseViewHolder holder, final String item) {
super.convert(holder, item);
SimpleDraweeView simpleDraweeView = holder.getView(R.id.image);
FrecoFactory.getInstance().disPlay(simpleDraweeView, item);
}
};
LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(mContext);
linearLayoutManager2.setOrientation(RecyclerView.HORIZONTAL);
mRvPic.setFocusableInTouchMode(false);
mRvPic.setNestedScrollingEnabled(false);
mRvPic.setLayoutManager(linearLayoutManager2);// 布局管理器。
mRvPic.setHasFixedSize(true);// 如果Item够简单,高度是确定的,打开FixSize将提高性能。
mRvPic.setItemAnimator(new DefaultItemAnimator());// 设置Item默认动画,加也行,不加
mRvPic.setAdapter(jiazhiAdapter);
jiazhiAdapter.setOnRecyclerViewItemClickListener(new BaseQuickAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
int[] location = new int[2];
// 获取在整个屏幕内的绝对坐标
view.getLocationOnScreen(location);
ViewData viewData = mVdList.get(position);
viewData.setTargetX(location[0]);
viewData.setTargetY(location[1]);
imageViewer.viewData(mVdList)
.watch(position);
}
});
linearLayoutManager2.scrollToPositionWithOffset(0, 0);
Point mScreenSize = ScreenUtils.getScreenSize(this);
mVdList = new ArrayList<>();
for (int i = 0, len = photos.size(); i < len; i++) {
ViewData viewData = new ViewData();
viewData.setImageSrc(photos.get(i));
viewData.setTargetX(0);
viewData.setTargetY(0);
viewData.setTargetWidth(mScreenSize.x);
viewData.setTargetHeight(Utils.dp2px(this, 200));
mVdList.add(viewData);
}
imageViewer.overlayStatusBar(false)
.imageLoader(new PhotoLoader());
imageViewer
.setOnItemChangedListener(new OnItemChangedListener() {
@Override
public void onItemChanged(int position, ImageDrawee drawee) {
if (imageViewer.getViewStatus() == ViewerStatus.STATUS_WATCHING) {
mVdList.get(imageViewer.getCurrentPosition()).setTargetX(0);
linearLayoutManager2.scrollToPositionWithOffset(imageViewer.getCurrentPosition(), (int) (mVdList.get(imageViewer.getCurrentPosition()).getTargetX() / 2));
}
}
})
.setOnBrowseStatusListener(
new OnBrowseStatusListener() {
@Override
public void onBrowseStatus(int status) {
if (status == ViewerStatus.STATUS_BEGIN_OPEN) {
ScreenUtils.changeStatusBarColor(CompanyProfilesActivity.this, R.color.black);
} else if (status == ViewerStatus.STATUS_SILENCE) {
ScreenUtils.changeStatusBarColor(CompanyProfilesActivity.this, R.color.white);
}
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
default:
break;
case R.id.tv_prd_list:
Intent intent = new Intent(mContext, ProductListActivity.class);
intent.putExtra(Config.INTENT_PARAMS3,companyInfo.getId()+"");
startActivity(intent);
break;
case R.id.btn_login:
String s = mEtName.getText().toString();
if (TextUtils.isEmpty(s)) {
ToastUtils.showShort("请输入姓名");
return;
}
String s2 = mEtPhone.getText().toString();
if (TextUtils.isEmpty(s2)) {
ToastUtils.showShort("请输入手机号");
return;
}
String s3 = mEtContent.getText().toString();
if (TextUtils.isEmpty(s3)) {
ToastUtils.showShort("请输入内容");
return;
}
if (null == companyInfo) {
ToastUtils.showShort("公司数据为空");
return;
}
DialogManager.getInstance().showNetLoadingView(mContext);
getPresenter().save_mailbox_msg(s, s2, companyInfo.getUid() + "", DApplication.getInstance().getLoginUser().getId() + "", s3);
break;
}
}
private void initRightIcon() {
if (companyInfo.getIs_collect() == 1) {
setTitleRigthIcon(R.mipmap.shoucang, new Action1<View>() {
@Override
public void call(View view) {
collect(companyInfo.getId() + "", "2");
}
});
} else {
setTitleRigthIcon(R.mipmap.shoucang_pre, new Action1<View>() {
@Override
public void call(View view) {
collect(companyInfo.getId() + "", "1");
}
});
}
}
public void collect(String valueid, String acttype) {
DialogManager.getInstance().showNetLoadingView(mContext);
HashMap<String, String> params = new HashMap<>();
params.put("uid", DApplication.getInstance().getLoginUser().getId() + "");
params.put("type", "1");
params.put("acttype", acttype);
params.put("valueid", valueid);
FormBody formBody = getPresenter().signForm(params);
DApplication.getInstance().getServerAPI().collect(formBody).map(new HttpResponseFunc())
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber() {
@Override
public void onNext(Object o) {
DialogManager.getInstance().dismissNetLoadingView();
//1收藏 2 取消收藏
if (acttype.equals("1")) {
companyInfo.setIs_collect(1);
} else {
companyInfo.setIs_collect(0);
}
initRightIcon();
}
@Override
public void onCompleted() {
DialogManager.getInstance().dismissNetLoadingView();
}
@Override
public void onError(Throwable e) {
DialogManager.getInstance().dismissNetLoadingView();
}
});
}
@Override
public void onBackPressed() {
if (Jzvd.backPress()) {
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
Jzvd.releaseAllVideos();
}
public void setMsgSuccess(RootResponse t) {
ToastUtils.showShort(t.getMsg());
}
}
| 12,996 | 0.623721 | 0.619786 | 348 | 35.511494 | 28.263079 | 182 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.614943 | false | false |
12
|
11208b20bccabcb43270aa6e13fb96b0f7181111
| 22,909,355,602,503 |
e6cce9776ea6829ecbbf1f3abb1acf55f74bfc39
|
/src/littlemangame/tutorial/tutoriallittleman/TutorialLittleManData.java
|
d88061e87aa38667776b2c7886feb2298f527897
|
[] |
no_license
|
BrianMoths/LittleManManager
|
https://github.com/BrianMoths/LittleManManager
|
ecab9224e1784191b8db3ac2720e9a9450936d3e
|
30264052a440839828975aac8e8b62b3d6b34025
|
refs/heads/master
| 2021-01-10T19:25:20.495000 | 2014-09-01T01:55:41 | 2014-09-01T01:55:41 | null | 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 littlemangame.tutorial.tutoriallittleman;
import littlemangame.tutorial.tutorialoffice.TutorialOffice;
import littlemangame.littleman.PositionGetterAdapter;
import littlemangame.littleman.littlemanutilities.littlemandata.GenericLittleManData;
/**
*
* @author brian
*/
public class TutorialLittleManData extends GenericLittleManData<TutorialOffice> {
public TutorialLittleManData(TutorialOffice computer, PositionGetterAdapter positionGetterAdapter) {
super(computer, positionGetterAdapter);
}
public void setIsWorksheetArrowShown(boolean isArrowShown) {
getComputer().setIsWorksheetArrowShown(isArrowShown);
}
public void setIsNotebookArrowShown(boolean isArrowShown) {
getComputer().setIsNotebookArrowShown(isArrowShown);
}
public void setIsNotebookPageSheetArrowShown(boolean isArrowShown) {
getComputer().setIsNotebookPageSheetArrowShown(isArrowShown);
}
public void setIsInputPanelArrowShown(boolean isArrowShown) {
getComputer().setIsInputPanelArrowShown(isArrowShown);
}
public void setIsOutputPanelArrowShown(boolean isArrowShown) {
getComputer().setIsOutputPanelArrowShown(isArrowShown);
}
}
|
UTF-8
|
Java
| 1,401 |
java
|
TutorialLittleManData.java
|
Java
|
[
{
"context": "lemandata.GenericLittleManData;\n\n/**\n *\n * @author brian\n */\npublic class TutorialLittleManData extends Ge",
"end": 461,
"score": 0.9853062629699707,
"start": 456,
"tag": "USERNAME",
"value": "brian"
}
] | 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 littlemangame.tutorial.tutoriallittleman;
import littlemangame.tutorial.tutorialoffice.TutorialOffice;
import littlemangame.littleman.PositionGetterAdapter;
import littlemangame.littleman.littlemanutilities.littlemandata.GenericLittleManData;
/**
*
* @author brian
*/
public class TutorialLittleManData extends GenericLittleManData<TutorialOffice> {
public TutorialLittleManData(TutorialOffice computer, PositionGetterAdapter positionGetterAdapter) {
super(computer, positionGetterAdapter);
}
public void setIsWorksheetArrowShown(boolean isArrowShown) {
getComputer().setIsWorksheetArrowShown(isArrowShown);
}
public void setIsNotebookArrowShown(boolean isArrowShown) {
getComputer().setIsNotebookArrowShown(isArrowShown);
}
public void setIsNotebookPageSheetArrowShown(boolean isArrowShown) {
getComputer().setIsNotebookPageSheetArrowShown(isArrowShown);
}
public void setIsInputPanelArrowShown(boolean isArrowShown) {
getComputer().setIsInputPanelArrowShown(isArrowShown);
}
public void setIsOutputPanelArrowShown(boolean isArrowShown) {
getComputer().setIsOutputPanelArrowShown(isArrowShown);
}
}
| 1,401 | 0.780871 | 0.780871 | 42 | 32.357143 | 32.669209 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.357143 | false | false |
12
|
32382c61f009e7e944a97107cc4baae3a67823e2
| 20,306,605,424,270 |
80e04164e383a23929a78dd5bed16c1d4c9525f7
|
/app/src/main/java/com/github/conanchen/gedit/ui/my/myworkinstore/MyWorkStoresViewModel.java
|
41cedc10e3014c3c868d02fce9b646f25506d850
|
[] |
no_license
|
conanchen/gedit-client-android
|
https://github.com/conanchen/gedit-client-android
|
1b9026c00e5d4b9fc0a4ec1fb190422b44eecf69
|
85e5be5d2bf5be8ea07005bdbcd32f9779dcbea5
|
refs/heads/master
| 2021-09-07T22:20:13.167000 | 2018-03-02T01:18:23 | 2018-03-02T01:18:23 | 115,584,566 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.github.conanchen.gedit.ui.my.myworkinstore;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.Transformations;
import android.arch.lifecycle.ViewModel;
import android.arch.paging.PagedList;
import android.support.annotation.VisibleForTesting;
import com.github.conanchen.gedit.common.grpc.Location;
import com.github.conanchen.gedit.repository.StoreProfileRepository;
import com.github.conanchen.gedit.room.store.Store;
import com.github.conanchen.gedit.util.AbsentLiveData;
import javax.inject.Inject;
/**
* Created by Administrator on 2018/1/17.
*/
public class MyWorkStoresViewModel extends ViewModel{
@VisibleForTesting
final MutableLiveData<Location> locationMutableLiveData = new MutableLiveData<>();
private final LiveData<PagedList<Store>> liveStores;
@SuppressWarnings("unchecked")
@Inject
public MyWorkStoresViewModel(StoreProfileRepository storeProfileRepository) {
liveStores = Transformations.switchMap(locationMutableLiveData, location -> {
if (location == null) {
return AbsentLiveData.create();
} else {
return storeProfileRepository.loadStoresNearAt(location);
}
});
}
@VisibleForTesting
public void updateLocation(Location location) {
locationMutableLiveData.setValue(location);
}
@VisibleForTesting
public LiveData<PagedList<Store>> getLiveStores() {
return liveStores;
}
}
|
UTF-8
|
Java
| 1,534 |
java
|
MyWorkStoresViewModel.java
|
Java
|
[
{
"context": ".gedit.common.grpc.Location;\nimport com.github.conanchen.gedit.repository.StoreProfileRepository;\nimport c",
"end": 407,
"score": 0.5150035619735718,
"start": 401,
"tag": "USERNAME",
"value": "anchen"
}
] | null |
[] |
package com.github.conanchen.gedit.ui.my.myworkinstore;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.Transformations;
import android.arch.lifecycle.ViewModel;
import android.arch.paging.PagedList;
import android.support.annotation.VisibleForTesting;
import com.github.conanchen.gedit.common.grpc.Location;
import com.github.conanchen.gedit.repository.StoreProfileRepository;
import com.github.conanchen.gedit.room.store.Store;
import com.github.conanchen.gedit.util.AbsentLiveData;
import javax.inject.Inject;
/**
* Created by Administrator on 2018/1/17.
*/
public class MyWorkStoresViewModel extends ViewModel{
@VisibleForTesting
final MutableLiveData<Location> locationMutableLiveData = new MutableLiveData<>();
private final LiveData<PagedList<Store>> liveStores;
@SuppressWarnings("unchecked")
@Inject
public MyWorkStoresViewModel(StoreProfileRepository storeProfileRepository) {
liveStores = Transformations.switchMap(locationMutableLiveData, location -> {
if (location == null) {
return AbsentLiveData.create();
} else {
return storeProfileRepository.loadStoresNearAt(location);
}
});
}
@VisibleForTesting
public void updateLocation(Location location) {
locationMutableLiveData.setValue(location);
}
@VisibleForTesting
public LiveData<PagedList<Store>> getLiveStores() {
return liveStores;
}
}
| 1,534 | 0.743155 | 0.738592 | 47 | 31.638298 | 25.80073 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.425532 | false | false |
12
|
1c12dea9f34817ec837554f84b431ba640b0056e
| 3,607,772,565,664 |
f2a4f644276ba1967422c7c9f4740ab094af1ca4
|
/PhoneBook/app/src/main/java/com/example/sajib/phonebook/HomeActivity.java
|
b8abac75c850a981ab915c7d782ad10213a74c75
|
[] |
no_license
|
Formanullah/andriod
|
https://github.com/Formanullah/andriod
|
50f40a4316edff8f7f564dc6bd75596ffd943552
|
318d79ef8b4da74c8a37dcf469c961ab03d1dd1c
|
refs/heads/master
| 2020-03-25T13:24:20.868000 | 2019-07-03T14:04:16 | 2019-07-03T14:04:16 | 143,823,171 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.sajib.phonebook;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class HomeActivity extends AppCompatActivity {
Button btnAdd,btnView,btnUpdate,btndelete;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
btnAdd=findViewById(R.id.btn_add);
btndelete=findViewById(R.id.btn_delete);
btnView=findViewById(R.id.btn_view);
btnUpdate=findViewById(R.id.btn_update);
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","insert");
Toast.makeText(HomeActivity.this, "Insert Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btndelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","delete");
Toast.makeText(HomeActivity.this, "Delete Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btnView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","view");
Toast.makeText(HomeActivity.this, "View Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btnUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","update");
Toast.makeText(HomeActivity.this, "Update Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
}
}
|
UTF-8
|
Java
| 2,305 |
java
|
HomeActivity.java
|
Java
|
[
{
"context": "package com.example.sajib.phonebook;\n\nimport android.content.Intent;\nimport",
"end": 25,
"score": 0.6859682202339172,
"start": 20,
"tag": "USERNAME",
"value": "sajib"
}
] | null |
[] |
package com.example.sajib.phonebook;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class HomeActivity extends AppCompatActivity {
Button btnAdd,btnView,btnUpdate,btndelete;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
btnAdd=findViewById(R.id.btn_add);
btndelete=findViewById(R.id.btn_delete);
btnView=findViewById(R.id.btn_view);
btnUpdate=findViewById(R.id.btn_update);
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","insert");
Toast.makeText(HomeActivity.this, "Insert Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btndelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","delete");
Toast.makeText(HomeActivity.this, "Delete Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btnView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","view");
Toast.makeText(HomeActivity.this, "View Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
btnUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i=new Intent(HomeActivity.this,MainActivity.class);
i.putExtra("data","update");
Toast.makeText(HomeActivity.this, "Update Page", Toast.LENGTH_SHORT).show();
startActivity(i);
}
});
}
}
| 2,305 | 0.60564 | 0.605206 | 59 | 38.067795 | 24.958178 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.898305 | false | false |
12
|
687bf8d94d15975e09f21fea85deb71cf3333472
| 17,660,905,579,197 |
f523b5321386b8ac3a94e1ab8ecb25f74657d729
|
/FileSystem/src/filesystem/system/BinaryFile.java
|
92be75a37c081e4640b60d77f47fdfe49b0f082b
|
[] |
no_license
|
lpavezb/cc3002
|
https://github.com/lpavezb/cc3002
|
0f05f68a56dbde1a671d548d9c4ab23740e99d43
|
9f7c2a16c559845d67153b97b987ae651efe4986
|
refs/heads/master
| 2020-03-08T18:38:34.672000 | 2018-05-23T03:14:29 | 2018-05-23T03:14:29 | 128,312,262 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package system;
import visitor.Visitor;
public class BinaryFile extends AbstractFile {
public BinaryFile(String aName, byte[] content) {
super(aName);
size = content.length;
}
@Override
public void accept(Visitor aVisitor) {
aVisitor.visitBinaryFile(this);
}
}
|
UTF-8
|
Java
| 308 |
java
|
BinaryFile.java
|
Java
|
[] | null |
[] |
package system;
import visitor.Visitor;
public class BinaryFile extends AbstractFile {
public BinaryFile(String aName, byte[] content) {
super(aName);
size = content.length;
}
@Override
public void accept(Visitor aVisitor) {
aVisitor.visitBinaryFile(this);
}
}
| 308 | 0.662338 | 0.662338 | 15 | 19.533333 | 17.891773 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
12
|
6aeeee0fe9c1c2de17c17895411c14572169874b
| 8,435,315,802,430 |
fc71b046379ab94d24442d093408b6c8501d3452
|
/lab06/rest-client/src/main/java/webshop/customer/service/dto/AccountDTO.java
|
30261779d2bfd2b1a15f1e746d906ca9ad4eda1f
|
[] |
no_license
|
mohamedgharib0011/sa-assignments
|
https://github.com/mohamedgharib0011/sa-assignments
|
35db4eef2abca4a573cb2daab30929bcab1ffe73
|
bd75925af4742b1892df0ff717257e6fa22deb8a
|
refs/heads/master
| 2020-03-21T20:32:39.168000 | 2018-07-12T21:08:54 | 2018-07-12T21:08:54 | 139,013,768 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package webshop.customer.service.dto;
public class AccountDTO {
private String accountNumber;
private String username;
public AccountDTO() {
super();
}
public AccountDTO(String accountNumber, String username) {
super();
this.accountNumber = accountNumber;
this.username = username;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "AccountDTO [accountNumber=" + accountNumber + ", username=" + username + "]";
}
}
|
UTF-8
|
Java
| 738 |
java
|
AccountDTO.java
|
Java
|
[
{
"context": "s.accountNumber = accountNumber;\n\t\tthis.username = username;\n\t}\n\n\tpublic String getAccountNumber() {\n\t\treturn",
"end": 300,
"score": 0.8825531005859375,
"start": 292,
"tag": "USERNAME",
"value": "username"
},
{
"context": "d setUsername(String username) {\n\t\tthis.username = username;\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\tret",
"end": 590,
"score": 0.9436825513839722,
"start": 582,
"tag": "USERNAME",
"value": "username"
}
] | null |
[] |
package webshop.customer.service.dto;
public class AccountDTO {
private String accountNumber;
private String username;
public AccountDTO() {
super();
}
public AccountDTO(String accountNumber, String username) {
super();
this.accountNumber = accountNumber;
this.username = username;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "AccountDTO [accountNumber=" + accountNumber + ", username=" + username + "]";
}
}
| 738 | 0.711382 | 0.711382 | 44 | 15.772727 | 19.658289 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.272727 | false | false |
12
|
5cdd29bc714b04d04dcc8f3c4fb839ef5c5a182a
| 21,998,822,523,098 |
56a6346de48cc71e6b92ba767fe41620b0a894d4
|
/03_끝말잇기/src/Main.java
|
a1369e0fe0215f3411dddfbdfb4aee9783df0acb
|
[] |
no_license
|
wooyounggggg/2017DataStructure
|
https://github.com/wooyounggggg/2017DataStructure
|
99459eed7e0463338e5575b100d98ef1103b0684
|
d3a9ee0978e99f0acfc569d5b94112b4774c95b5
|
refs/heads/master
| 2018-01-12T20:11:20.825000 | 2017-06-02T13:13:38 | 2017-06-02T13:13:38 | 86,541,093 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
String input;
LinkedList li=new LinkedList();
input = "a";
int i=1;
while(!input.equals("exit"))
{
System.out.println(i+"번째 단어를 입력하세요. (exit 입력 시 게임 종료)");
input=scan.nextLine();
if(i==1)
{
li.addLast(input);
i++;
}
else if(input.charAt(0)==li.getLast().getString().charAt(li.getLast().getString().length()-1))
{
Word temp=li.getFirst();
int repeatcheck=0;
while(temp!=li.trailer)
{
if(input.equals(temp.getString()))
repeatcheck++;
temp=temp.getNext();
}
if(repeatcheck==0)
{
li.addLast(input);
i++;
}
else System.out.println("중복입니다.");
}
else
{
System.out.println("틀렸습니다!!! 게임을 종료합니다.");
System.out.println("입력된 단어 목록");
li.printAllWords();
input="exit";
}
}
}
}
|
UHC
|
Java
| 1,033 |
java
|
Main.java
|
Java
|
[] | null |
[] |
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
String input;
LinkedList li=new LinkedList();
input = "a";
int i=1;
while(!input.equals("exit"))
{
System.out.println(i+"번째 단어를 입력하세요. (exit 입력 시 게임 종료)");
input=scan.nextLine();
if(i==1)
{
li.addLast(input);
i++;
}
else if(input.charAt(0)==li.getLast().getString().charAt(li.getLast().getString().length()-1))
{
Word temp=li.getFirst();
int repeatcheck=0;
while(temp!=li.trailer)
{
if(input.equals(temp.getString()))
repeatcheck++;
temp=temp.getNext();
}
if(repeatcheck==0)
{
li.addLast(input);
i++;
}
else System.out.println("중복입니다.");
}
else
{
System.out.println("틀렸습니다!!! 게임을 종료합니다.");
System.out.println("입력된 단어 목록");
li.printAllWords();
input="exit";
}
}
}
}
| 1,033 | 0.56902 | 0.562698 | 52 | 17.25 | 17.970997 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.346154 | false | false |
12
|
0408027564e8369418dfdfb43e8edde596eae502
| 33,981,781,279,284 |
7e020f23353969d9b1230093bac6b90ea31a8642
|
/setups/ClassicTwist.java
|
7e0d7550f70184f48734656e6dcb48492790449f
|
[] |
no_license
|
vossnarrator/TheNarrator
|
https://github.com/vossnarrator/TheNarrator
|
e81d2ae8332f13f2f8fde3a978b133ddf3a04219
|
3a665aec28bb7f28db621dcd72520dfdc3fe8cf5
|
refs/heads/master
| 2018-10-22T08:24:31.359000 | 2018-08-05T19:52:11 | 2018-08-05T19:52:11 | 46,630,245 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package shared.setups;
import java.util.HashMap;
import shared.logic.Member;
import shared.logic.Narrator;
import shared.logic.Team;
import shared.logic.support.rules.Rules;
import shared.roles.Ability;
import shared.roles.Bomb;
import shared.roles.Citizen;
import shared.roles.Doctor;
import shared.roles.Goon;
import shared.roles.Gunsmith;
import shared.roles.RandomMember;
import shared.roles.Sheriff;
import shared.roles.Snitch;
public class ClassicTwist extends Setup{
public static final String KEY = "classictwist";
public ClassicTwist(Narrator narrator){
Team town = Town(narrator);
Team maf = Mafia(narrator);
Prioritize(maf, town);
town.addSheriffDetectableTeam(maf);
town.setEnemies(maf);
narrator.setRule(Rules.DAY_START, Narrator.NIGHT_START);
narrator.setRule(Rules.DOC_KNOWS_IF_TARGET_ATTACKED, false);
narrator.setRule(Rules.DOC_FEEDBACK, false);
narrator.setRule(Rules.GS_DAY_GUNS, true);
/*
* finished narrator editing
*
* creating string to random role
*/
Object[] powerRoleComponents = new Ability[]{new Bomb(), new Doctor(), new Gunsmith(), new Snitch()};
RandomMember powerRole = addRoles("Power Role", Setup.CUSTOM_NAME, town.getColor(), powerRoleComponents);
HashMap<String, RandomMember> randomSlots = new HashMap<>();
randomSlots.put(powerRole.getName(), powerRole);
/*
* finished setup to role map
*
* creating visible faction
*/
init(narrator, KEY, randomSlots, new HashMap<String, Member>());
Member cit = new Member(new Citizen(), TOWN_C);
Member sheriff = new Member(new Sheriff(), TOWN_C);
RandomMember townRoles = new RandomMember(town.getName(), town.getColor());
townRoles.addMember(cit, new Bomb(), new Snitch(), new Gunsmith(), new Doctor(), sheriff);
factions.add(townRoles);
Member goon = new Member(new Goon(), MAFIA_C);
RandomMember mafRoles = new RandomMember(maf.getName(), maf.getColor());
mafRoles.addMember(goon);
factions.add(mafRoles);
addInitialRole(cit, 3);
addInitialRole(sheriff);
addInitialRole(powerRole);
addInitialRole(goon, 2);
addSetupChange(8, cit);
addSetupChange(9, cit);
addSetupChange(10, goon);
addSetupChange(11, powerRole);
addSetupChange(12, cit);
addSetupChange(13, goon);
addSetupChange(14, cit);
addSetupChange(15, goon, cit, sheriff);
addSetupChange(16, cit);
}
@Override
public String getShortDescription() {
return "Epic Mafia's classic rotational setup";
}
@Override
public String[] getDescription() {
return new String[]{
"Simple Cop and random power role",
"Power Role : Gunsmith, Bomb, Doctor, Snitch"
};
}
@Override
public String getName() {
return "Classic Twist";
}
}
|
UTF-8
|
Java
| 2,746 |
java
|
ClassicTwist.java
|
Java
|
[
{
"context": "tends Setup{\n\n\n\tpublic static final String KEY = \"classictwist\";\n\tpublic ClassicTwist(Narrator narrator){\n\t\tTeam",
"end": 526,
"score": 0.9773029685020447,
"start": 514,
"tag": "KEY",
"value": "classictwist"
},
{
"context": "Roles.addMember(cit, new Bomb(), new Snitch(), new Gunsmith(), new Doctor(), sheriff);\n\t\tfactions.add(townRol",
"end": 1773,
"score": 0.8922738432884216,
"start": 1765,
"tag": "NAME",
"value": "Gunsmith"
}
] | null |
[] |
package shared.setups;
import java.util.HashMap;
import shared.logic.Member;
import shared.logic.Narrator;
import shared.logic.Team;
import shared.logic.support.rules.Rules;
import shared.roles.Ability;
import shared.roles.Bomb;
import shared.roles.Citizen;
import shared.roles.Doctor;
import shared.roles.Goon;
import shared.roles.Gunsmith;
import shared.roles.RandomMember;
import shared.roles.Sheriff;
import shared.roles.Snitch;
public class ClassicTwist extends Setup{
public static final String KEY = "classictwist";
public ClassicTwist(Narrator narrator){
Team town = Town(narrator);
Team maf = Mafia(narrator);
Prioritize(maf, town);
town.addSheriffDetectableTeam(maf);
town.setEnemies(maf);
narrator.setRule(Rules.DAY_START, Narrator.NIGHT_START);
narrator.setRule(Rules.DOC_KNOWS_IF_TARGET_ATTACKED, false);
narrator.setRule(Rules.DOC_FEEDBACK, false);
narrator.setRule(Rules.GS_DAY_GUNS, true);
/*
* finished narrator editing
*
* creating string to random role
*/
Object[] powerRoleComponents = new Ability[]{new Bomb(), new Doctor(), new Gunsmith(), new Snitch()};
RandomMember powerRole = addRoles("Power Role", Setup.CUSTOM_NAME, town.getColor(), powerRoleComponents);
HashMap<String, RandomMember> randomSlots = new HashMap<>();
randomSlots.put(powerRole.getName(), powerRole);
/*
* finished setup to role map
*
* creating visible faction
*/
init(narrator, KEY, randomSlots, new HashMap<String, Member>());
Member cit = new Member(new Citizen(), TOWN_C);
Member sheriff = new Member(new Sheriff(), TOWN_C);
RandomMember townRoles = new RandomMember(town.getName(), town.getColor());
townRoles.addMember(cit, new Bomb(), new Snitch(), new Gunsmith(), new Doctor(), sheriff);
factions.add(townRoles);
Member goon = new Member(new Goon(), MAFIA_C);
RandomMember mafRoles = new RandomMember(maf.getName(), maf.getColor());
mafRoles.addMember(goon);
factions.add(mafRoles);
addInitialRole(cit, 3);
addInitialRole(sheriff);
addInitialRole(powerRole);
addInitialRole(goon, 2);
addSetupChange(8, cit);
addSetupChange(9, cit);
addSetupChange(10, goon);
addSetupChange(11, powerRole);
addSetupChange(12, cit);
addSetupChange(13, goon);
addSetupChange(14, cit);
addSetupChange(15, goon, cit, sheriff);
addSetupChange(16, cit);
}
@Override
public String getShortDescription() {
return "Epic Mafia's classic rotational setup";
}
@Override
public String[] getDescription() {
return new String[]{
"Simple Cop and random power role",
"Power Role : Gunsmith, Bomb, Doctor, Snitch"
};
}
@Override
public String getName() {
return "Classic Twist";
}
}
| 2,746 | 0.711945 | 0.70539 | 106 | 24.905661 | 22.892912 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.367924 | false | false |
12
|
5759868103faf0817f52ddd7ffb84933dd39d1e9
| 11,630,771,504,519 |
a9cf4118e0f032331542d38b7d29c60734a712bf
|
/src/Code_99_LuanShua/Code_0378.java
|
fe42d0da9c0f1bab1b1fd6559116a7d6730e9cfe
|
[] |
no_license
|
jchen-96/leetCode
|
https://github.com/jchen-96/leetCode
|
5531571fb43ffc5023250f1ca21c1ebe5922aa8c
|
4e411c9818d5d3194192b67016edafad36d75b29
|
refs/heads/master
| 2021-07-13T17:54:26.108000 | 2020-09-20T11:54:54 | 2020-09-20T11:54:54 | 176,665,761 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Code_99_LuanShua;
public class Code_0378 {
// public int kthSmallest(int[][] matrix, int k) {
// int row=matrix.length;
// int colums = matrix[0].length;
//
//
// private int find()
}
|
UTF-8
|
Java
| 213 |
java
|
Code_0378.java
|
Java
|
[] | null |
[] |
package Code_99_LuanShua;
public class Code_0378 {
// public int kthSmallest(int[][] matrix, int k) {
// int row=matrix.length;
// int colums = matrix[0].length;
//
//
// private int find()
}
| 213 | 0.596244 | 0.56338 | 10 | 20.299999 | 17.601419 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
12
|
4a9b58ede80da634c6791d55d16c634bf523c573
| 35,150,012,377,343 |
3650ed995c0c1a3835e1905a66bc45d8850d2be0
|
/MallTemplate/src/com/example/goldfoxchina/Adapter/SearchGridviewAdapter.java
|
b6f2a41815ba361413f5cfb9dec4146f514c3a5f
|
[] |
no_license
|
maxdeny/test
|
https://github.com/maxdeny/test
|
7d38f42296822dc4174e25f2e056ef09c2374d9f
|
1408429cbf5cc896cf4dfaeb21c6c6faaa9932c7
|
refs/heads/master
| 2021-01-10T07:25:33.543000 | 2016-04-08T06:00:10 | 2016-04-08T06:00:10 | 55,743,264 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.goldfoxchina.Adapter;
import java.util.ArrayList;
import java.util.HashMap;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.goldfoxMall.R;
public class SearchGridviewAdapter extends BaseAdapter {
private Context context;
private ArrayList<HashMap<String, Object>> data;
private LayoutInflater mInflater;//得到一个LayoutInfalter对象用来导入布局
public SearchGridviewAdapter(Context context,ArrayList<HashMap<String, Object>> data) {
this.context=context;
this.data=data;
this.mInflater=LayoutInflater.from(context);
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
viewGroup viewgroup;
if(convertView==null){
viewgroup=new viewGroup();
convertView=mInflater.inflate(R.layout.search_gridview_item,null);
// viewgroup.layout_gridview_item_img=(ImageView) convertView.findViewById(R.id.layout_gridview_item_img);
viewgroup.layout_gridview_item_text=(TextView) convertView.findViewById(R.id.layout_gridview_item_text);
/**
* 使用tag来存储数据
*/
convertView.setTag(viewgroup);
}else{
viewgroup = (viewGroup) convertView.getTag();
}
/**
* 获取数据显示
*/
viewgroup.layout_gridview_item_text.setText((String)data.get(position).get("name"));
// viewgroup.layout_gridview_item_img.setImageBitmap((Bitmap)data.get(position).get("image"));
return convertView;
}
/**
* 控件存放
* @author kysl
*
*/
public final class viewGroup{
TextView layout_gridview_item_text;
// ImageView layout_gridview_item_img;
}
}
|
UTF-8
|
Java
| 2,055 |
java
|
SearchGridviewAdapter.java
|
Java
|
[
{
"context": "n convertView;\r\n\t}\r\n\t\r\n\t/**\r\n\t * 控件存放\r\n\t * @author kysl\r\n\t *\r\n\t */\r\n\tpublic final class viewGroup{\r\n\t\tTe",
"end": 1864,
"score": 0.9996629357337952,
"start": 1860,
"tag": "USERNAME",
"value": "kysl"
}
] | null |
[] |
package com.example.goldfoxchina.Adapter;
import java.util.ArrayList;
import java.util.HashMap;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.goldfoxMall.R;
public class SearchGridviewAdapter extends BaseAdapter {
private Context context;
private ArrayList<HashMap<String, Object>> data;
private LayoutInflater mInflater;//得到一个LayoutInfalter对象用来导入布局
public SearchGridviewAdapter(Context context,ArrayList<HashMap<String, Object>> data) {
this.context=context;
this.data=data;
this.mInflater=LayoutInflater.from(context);
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
viewGroup viewgroup;
if(convertView==null){
viewgroup=new viewGroup();
convertView=mInflater.inflate(R.layout.search_gridview_item,null);
// viewgroup.layout_gridview_item_img=(ImageView) convertView.findViewById(R.id.layout_gridview_item_img);
viewgroup.layout_gridview_item_text=(TextView) convertView.findViewById(R.id.layout_gridview_item_text);
/**
* 使用tag来存储数据
*/
convertView.setTag(viewgroup);
}else{
viewgroup = (viewGroup) convertView.getTag();
}
/**
* 获取数据显示
*/
viewgroup.layout_gridview_item_text.setText((String)data.get(position).get("name"));
// viewgroup.layout_gridview_item_img.setImageBitmap((Bitmap)data.get(position).get("image"));
return convertView;
}
/**
* 控件存放
* @author kysl
*
*/
public final class viewGroup{
TextView layout_gridview_item_text;
// ImageView layout_gridview_item_img;
}
}
| 2,055 | 0.704557 | 0.704557 | 84 | 21.773809 | 25.805292 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.761905 | false | false |
12
|
67daaf9730f5966ed155cf714ab01657211597c1
| 38,405,597,572,453 |
1c5a441dafbb8e0d8ef90822d2bb084661ae0cf2
|
/unused/ReligionTest.java
|
46dfb094119514f8aedecf3987d2be6601ea0165
|
[
"MIT"
] |
permissive
|
AY1920S1-CS2103T-T13-2/main
|
https://github.com/AY1920S1-CS2103T-T13-2/main
|
4913dd8e5241bc4cdb9065b8b06d896528220de4
|
bb33e72517ab4ad2581a3b34284618ca5013d500
|
refs/heads/master
| 2023-07-05T22:21:21.296000 | 2023-05-22T06:19:33 | 2023-05-22T06:19:33 | 209,222,140 | 0 | 7 |
NOASSERTION
| true | 2019-11-11T16:00:20 | 2019-09-18T05:06:45 | 2019-11-11T15:55:48 | 2019-11-11T15:59:58 | 43,406 | 0 | 5 | 0 |
Java
| false | false |
package seedu.address.model.entity.body;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import org.junit.jupiter.api.Test;
import seedu.address.logic.parser.ParserUtil;
import seedu.address.logic.parser.exceptions.ParseException;
//@@author ambervoong-unused
class ReligionTest {
@Test
void enumerateReligion_indexOne_correct() {
assertEquals(Religion.ISLAM.toString(), "ISLAM");
}
@Test
void enumerateReligion_indexOne_wrong() {
assertNotEquals(Religion.ISLAM.toString(), "12345");
}
@Test
void enumerateReligion_parseReligion_success() throws ParseException {
assertEquals(ParserUtil.parseStringFields(""), Religion.ISLAM);
}
}
//@@author
|
UTF-8
|
Java
| 788 |
java
|
ReligionTest.java
|
Java
|
[
{
"context": "ogic.parser.exceptions.ParseException;\n\n//@@author ambervoong-unused\nclass ReligionTest {\n\n @Test\n void enumerat",
"end": 340,
"score": 0.9983535408973694,
"start": 323,
"tag": "USERNAME",
"value": "ambervoong-unused"
}
] | null |
[] |
package seedu.address.model.entity.body;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import org.junit.jupiter.api.Test;
import seedu.address.logic.parser.ParserUtil;
import seedu.address.logic.parser.exceptions.ParseException;
//@@author ambervoong-unused
class ReligionTest {
@Test
void enumerateReligion_indexOne_correct() {
assertEquals(Religion.ISLAM.toString(), "ISLAM");
}
@Test
void enumerateReligion_indexOne_wrong() {
assertNotEquals(Religion.ISLAM.toString(), "12345");
}
@Test
void enumerateReligion_parseReligion_success() throws ParseException {
assertEquals(ParserUtil.parseStringFields(""), Religion.ISLAM);
}
}
//@@author
| 788 | 0.736041 | 0.729695 | 31 | 24.419355 | 25.82044 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.387097 | false | false |
12
|
628cf65ae1ca683b8bb254528fa39b6055f6eb8a
| 24,988,119,788,683 |
8e936d20a6bedc54d867260ded73a5f8f620c856
|
/src/LeetCode/Easy/ValidAnagram.java
|
c10ee6cbd7332c66357455598d5ac4a741071acb
|
[] |
no_license
|
cisphon/ELIAndLeetCode
|
https://github.com/cisphon/ELIAndLeetCode
|
999be271019d69033ab8ceb024e7e9fa5ab0df0e
|
031d2f6b6c3a0b3b4626ab0b543e5695608f6e0d
|
refs/heads/master
| 2020-07-04T19:49:16.915000 | 2019-11-24T18:48:20 | 2019-11-24T18:48:20 | 202,394,568 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package LeetCode.Easy;
import java.util.HashMap;
import java.util.Map;
public class ValidAnagram {
public static void main(String[] args) {
String s = "ra";
String t = "car";
System.out.println(isAnagram(s, t));
}
public static boolean isAnagram(String s, String t) {
if (s.length() == t.length()) {
Map<Character, Integer> map1 = new HashMap<>();
Map<Character, Integer> map2 = new HashMap<>();
for (int i = 0; i < s.length(); ++i) {
char a = s.charAt(i);
if (map1.containsKey(a)) {
map1.replace(a, map1.get(a) + 1);
} else {
map1.put(a, 1);
}
char b = t.charAt(i);
if (map2.containsKey(b)) {
map2.replace(b, map2.get(b) + 1);
} else {
map2.put(b, 1);
}
}
boolean map1ContainsMap2 = map1.entrySet().containsAll(map2.entrySet());
boolean map2ContainsMap1 = map2.entrySet().containsAll(map1.entrySet());
return map1ContainsMap2 && map2ContainsMap1;
} else {
return false;
}
}
// It increments the bucket value with String s and decrement with string t.
// So if they are anagrams, all buckets should remain with initial value which is zero.
public static boolean bucket(String s, String t) {
int[] alphabet = new int[26]; // 26 because there are 26 letters in english
for (int i = 0; i < s.length(); i++)
alphabet[s.charAt(i) - 'a']++;
for (int i = 0; i < t.length(); i++) {
alphabet[t.charAt(i) - 'a']--;
if(alphabet[t.charAt(i) - 'a'] < 0) return false;
}
for (int i : alphabet)
if (i != 0) return false;
return true;
}
}
|
UTF-8
|
Java
| 1,908 |
java
|
ValidAnagram.java
|
Java
|
[] | null |
[] |
package LeetCode.Easy;
import java.util.HashMap;
import java.util.Map;
public class ValidAnagram {
public static void main(String[] args) {
String s = "ra";
String t = "car";
System.out.println(isAnagram(s, t));
}
public static boolean isAnagram(String s, String t) {
if (s.length() == t.length()) {
Map<Character, Integer> map1 = new HashMap<>();
Map<Character, Integer> map2 = new HashMap<>();
for (int i = 0; i < s.length(); ++i) {
char a = s.charAt(i);
if (map1.containsKey(a)) {
map1.replace(a, map1.get(a) + 1);
} else {
map1.put(a, 1);
}
char b = t.charAt(i);
if (map2.containsKey(b)) {
map2.replace(b, map2.get(b) + 1);
} else {
map2.put(b, 1);
}
}
boolean map1ContainsMap2 = map1.entrySet().containsAll(map2.entrySet());
boolean map2ContainsMap1 = map2.entrySet().containsAll(map1.entrySet());
return map1ContainsMap2 && map2ContainsMap1;
} else {
return false;
}
}
// It increments the bucket value with String s and decrement with string t.
// So if they are anagrams, all buckets should remain with initial value which is zero.
public static boolean bucket(String s, String t) {
int[] alphabet = new int[26]; // 26 because there are 26 letters in english
for (int i = 0; i < s.length(); i++)
alphabet[s.charAt(i) - 'a']++;
for (int i = 0; i < t.length(); i++) {
alphabet[t.charAt(i) - 'a']--;
if(alphabet[t.charAt(i) - 'a'] < 0) return false;
}
for (int i : alphabet)
if (i != 0) return false;
return true;
}
}
| 1,908 | 0.501048 | 0.481656 | 54 | 34.333332 | 23.954432 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.740741 | false | false |
12
|
24b5439cfb3a05885fd9782f17fda4359c249587
| 26,087,631,413,949 |
a7a9e7b8f68f52b1b356d7665da8d81c82e69881
|
/cloud-consumer/src/main/java/com/fmh/springcloud/controller/OrderController.java
|
e7c887db9b8b65f7fa51b65f7d28af2b99f434a5
|
[] |
no_license
|
null1019/mcroservice
|
https://github.com/null1019/mcroservice
|
cdfc1acd1ed2a1b6089e1e64168b2c20295ecd6d
|
1b239761916005588e80a5712ac9c8b961f36fd4
|
refs/heads/master
| 2023-06-08T12:31:24.911000 | 2021-06-29T10:51:05 | 2021-06-29T10:51:05 | 381,278,472 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.fmh.springcloud.controller;
import com.fmh.springcloud.pojo.Payment;
import com.fmh.springcloud.pojo.Result;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.cache.annotation.CacheResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
@RestController
@RequestMapping("/pay")
@Slf4j
public class OrderController {
@Resource
private RestTemplate restTemplate;
@Value("${service-url.provide-service}")
private String provideUrl;
@PostMapping("/create")
public Result<Integer> create(Payment payment) {
return restTemplate.postForObject(provideUrl + "/create/", payment, Result.class);
}
@GetMapping("/get/{id}")
@CacheResult(cacheKeyMethod = "getCacheKey")
@HystrixCommand(fallbackMethod = "getPaymentFallback", commandKey = "getPayment")
public Result<Payment> getPayment(@PathVariable("id") Long id) {
return restTemplate.getForObject(provideUrl + "/get/" + id, Result.class);
}
public Result<Payment> getPaymentFallback(@PathVariable("id") Long id) {
return new Result<>(400,"失败");
}
public String getCacheKey(Long id){
return String.valueOf(id);
}
}
|
UTF-8
|
Java
| 1,448 |
java
|
OrderController.java
|
Java
|
[] | null |
[] |
package com.fmh.springcloud.controller;
import com.fmh.springcloud.pojo.Payment;
import com.fmh.springcloud.pojo.Result;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.cache.annotation.CacheResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
@RestController
@RequestMapping("/pay")
@Slf4j
public class OrderController {
@Resource
private RestTemplate restTemplate;
@Value("${service-url.provide-service}")
private String provideUrl;
@PostMapping("/create")
public Result<Integer> create(Payment payment) {
return restTemplate.postForObject(provideUrl + "/create/", payment, Result.class);
}
@GetMapping("/get/{id}")
@CacheResult(cacheKeyMethod = "getCacheKey")
@HystrixCommand(fallbackMethod = "getPaymentFallback", commandKey = "getPayment")
public Result<Payment> getPayment(@PathVariable("id") Long id) {
return restTemplate.getForObject(provideUrl + "/get/" + id, Result.class);
}
public Result<Payment> getPaymentFallback(@PathVariable("id") Long id) {
return new Result<>(400,"失败");
}
public String getCacheKey(Long id){
return String.valueOf(id);
}
}
| 1,448 | 0.73892 | 0.734765 | 45 | 31.088888 | 26.659018 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.488889 | false | false |
12
|
73a964b5bd77b1c69540326dd9a58a9f2832a362
| 38,302,518,351,758 |
bda8c7208f1aa5d6d511dad92de8bae75b9574b1
|
/baekjoon/bruteforcing (브루트포스 알고리즘)/silver/5/BOJ7568.java
|
b7039011a81c26e3427b2052fcb8e2d1a806a0ae
|
[] |
no_license
|
ehdals9412/Algorithm_JAVA
|
https://github.com/ehdals9412/Algorithm_JAVA
|
4565f4de8b00e8e8e72cb1a1c35f68ec3df5004b
|
a473534972820d7af35d2c23c69da4e016df3f84
|
refs/heads/main
| 2023-07-14T05:18:10.240000 | 2023-07-11T04:32:49 | 2023-07-11T04:32:49 | 354,019,763 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package baekjoon.bruteforcing;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
// 덩치
public class BOJ7568 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int n = Integer.parseInt(br.readLine());
int[][] person = new int[n][2];
for (int i = 0; i < n; i++) {
st = new StringTokenizer(br.readLine());
int weight = Integer.parseInt(st.nextToken());
int height = Integer.parseInt(st.nextToken());
person[i][0] = weight;
person[i][1] = height;
}
List<Integer> rank = new ArrayList<>();
for (int i = 0; i < person.length; i++) {
int count = 0; // 덩치 등수를 구하기 위한 카운팅 변수
for (int j = 0; j < person.length; j++) {
if(i == j) continue; // 자기 자신과는 비교하지 않음
if (person[i][0] < person[j][0] && person[i][1] < person[j][1]) {
count++;
}
}
rank.add(count + 1);
}
for (Integer r : rank) {
System.out.print(r + " ");
}
}
}
|
UTF-8
|
Java
| 1,323 |
java
|
BOJ7568.java
|
Java
|
[] | null |
[] |
package baekjoon.bruteforcing;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
// 덩치
public class BOJ7568 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int n = Integer.parseInt(br.readLine());
int[][] person = new int[n][2];
for (int i = 0; i < n; i++) {
st = new StringTokenizer(br.readLine());
int weight = Integer.parseInt(st.nextToken());
int height = Integer.parseInt(st.nextToken());
person[i][0] = weight;
person[i][1] = height;
}
List<Integer> rank = new ArrayList<>();
for (int i = 0; i < person.length; i++) {
int count = 0; // 덩치 등수를 구하기 위한 카운팅 변수
for (int j = 0; j < person.length; j++) {
if(i == j) continue; // 자기 자신과는 비교하지 않음
if (person[i][0] < person[j][0] && person[i][1] < person[j][1]) {
count++;
}
}
rank.add(count + 1);
}
for (Integer r : rank) {
System.out.print(r + " ");
}
}
}
| 1,323 | 0.513834 | 0.501186 | 40 | 30.625 | 22.179594 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.65 | false | false |
12
|
08c37e4874ae6716fdc7581e827c3cb119199256
| 37,091,337,585,756 |
dfdf5213c2c2e3265f0d7175d59542feb403457f
|
/testes-automatizados/TestesSelenium/src/test/java/br/com/mv/PageFactory/cadastro/TipoComissao.java
|
29ce99bcf8334d9bd415056e5341c3050925d51f
|
[] |
no_license
|
pedrofbr0/SoftBoxEstagio
|
https://github.com/pedrofbr0/SoftBoxEstagio
|
c4f0be9e0bb90a7bbd43647943a07cc28cd804f3
|
d70051e2c5c17edb6743c4744b2a18ca3a1f14e3
|
refs/heads/master
| 2020-03-17T18:51:13.415000 | 2018-08-24T17:50:00 | 2018-08-24T17:50:00 | 133,836,037 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.com.mv.PageFactory.cadastro;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;
public class TipoComissao {
WebDriver driver;
@FindBy(css = "#comboStatusTipoComissao")
private WebElement comboStatusTipoComissao;
@FindBy(css = "#comboFlagTipoComissao")
private WebElement comboFlagTipoComissao;
@FindBy(css = "#descTipoComissao")
private WebElement descTipoComissao;
@FindBy(css = "#descAbreviadoTipoComissao")
private WebElement descAbreviadoTipoComissao;
public TipoComissao(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
public TipoComissao setStatusTipoComissao(String statusTipoComissao) {
new Select(this.comboStatusTipoComissao).selectByVisibleText(statusTipoComissao);
return this;
}
public TipoComissao setFlagTipoComissao(String flagTipoComissao) {
new Select(this.comboFlagTipoComissao).selectByVisibleText(flagTipoComissao);
return this;
}
public TipoComissao setDescTipoComissao(String descTipoComissao) {
this.descTipoComissao.clear();
this.descTipoComissao.sendKeys(descTipoComissao);
return this;
}
public TipoComissao setDescAbreviadoTipoComissao(String descAbreviadoTipoComissao) {
this.descAbreviadoTipoComissao.clear();
this.descAbreviadoTipoComissao.sendKeys(descAbreviadoTipoComissao);
return this;
}
}
|
UTF-8
|
Java
| 1,498 |
java
|
TipoComissao.java
|
Java
|
[] | null |
[] |
package br.com.mv.PageFactory.cadastro;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;
public class TipoComissao {
WebDriver driver;
@FindBy(css = "#comboStatusTipoComissao")
private WebElement comboStatusTipoComissao;
@FindBy(css = "#comboFlagTipoComissao")
private WebElement comboFlagTipoComissao;
@FindBy(css = "#descTipoComissao")
private WebElement descTipoComissao;
@FindBy(css = "#descAbreviadoTipoComissao")
private WebElement descAbreviadoTipoComissao;
public TipoComissao(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
public TipoComissao setStatusTipoComissao(String statusTipoComissao) {
new Select(this.comboStatusTipoComissao).selectByVisibleText(statusTipoComissao);
return this;
}
public TipoComissao setFlagTipoComissao(String flagTipoComissao) {
new Select(this.comboFlagTipoComissao).selectByVisibleText(flagTipoComissao);
return this;
}
public TipoComissao setDescTipoComissao(String descTipoComissao) {
this.descTipoComissao.clear();
this.descTipoComissao.sendKeys(descTipoComissao);
return this;
}
public TipoComissao setDescAbreviadoTipoComissao(String descAbreviadoTipoComissao) {
this.descAbreviadoTipoComissao.clear();
this.descAbreviadoTipoComissao.sendKeys(descAbreviadoTipoComissao);
return this;
}
}
| 1,498 | 0.809079 | 0.809079 | 51 | 28.392157 | 25.455904 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.490196 | false | false |
12
|
2009d1e5c24e5a885f71f2f5dccffdd3d51d178e
| 23,261,542,932,163 |
915c8c7df55cd4db7ffa1a73e6cf53a3f8e90ce8
|
/src/ru/mirea/lab1/TestDog.java
|
3f1d0d5dcf3df7779c242c23cfd04b5da0db1d61
|
[] |
no_license
|
GymenyukAnastatis/Lab.1
|
https://github.com/GymenyukAnastatis/Lab.1
|
6b90de59afe5f7e3d1e7e20ebe7af3c155bc16b8
|
446de05e224edc3dfcbab9f75540d1af0af3e414
|
refs/heads/master
| 2023-03-30T23:40:57.601000 | 2021-04-01T21:39:22 | 2021-04-01T21:39:22 | 293,574,680 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ru.mirea.lab1;
public class TestDog
{
public static void main (String [] args)
{
Dog d1 = new Dog("Bobik", 2);
Dog d2 = new Dog("Sharik",7);
Dog d3 = new Dog("Max");
d3.setAge(2);
System.out.println(d1);
d1.intoHumanAge();
d2.intoHumanAge();
d3.intoHumanAge();
}
}
|
UTF-8
|
Java
| 351 |
java
|
TestDog.java
|
Java
|
[
{
"context": " (String [] args)\n {\n Dog d1 = new Dog(\"Bobik\", 2);\n Dog d2 = new Dog(\"Sharik\",7);\n ",
"end": 129,
"score": 0.9996880292892456,
"start": 124,
"tag": "NAME",
"value": "Bobik"
},
{
"context": " = new Dog(\"Bobik\", 2);\n Dog d2 = new Dog(\"Sharik\",7);\n Dog d3 = new Dog(\"Max\");\n d3.",
"end": 168,
"score": 0.9996599555015564,
"start": 162,
"tag": "NAME",
"value": "Sharik"
},
{
"context": " = new Dog(\"Sharik\",7);\n Dog d3 = new Dog(\"Max\");\n d3.setAge(2);\n System.out.print",
"end": 203,
"score": 0.9997723698616028,
"start": 200,
"tag": "NAME",
"value": "Max"
}
] | null |
[] |
package ru.mirea.lab1;
public class TestDog
{
public static void main (String [] args)
{
Dog d1 = new Dog("Bobik", 2);
Dog d2 = new Dog("Sharik",7);
Dog d3 = new Dog("Max");
d3.setAge(2);
System.out.println(d1);
d1.intoHumanAge();
d2.intoHumanAge();
d3.intoHumanAge();
}
}
| 351 | 0.524217 | 0.490029 | 16 | 20.875 | 13.900877 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6875 | false | false |
12
|
6c6e758dd6d74583338372f508e07d96db5657e7
| 34,883,724,409,275 |
bb142c1c1d409ef8354c9907269e4bb564e12984
|
/app/src/main/java/bubok/just/hu/bubokbookshelf/list/applogic/interactors/interfaces/ListInteractorInterface.java
|
6fe57984d8c7869cd2ebdb9d0cd4b0259e1297df
|
[] |
no_license
|
TuraiFerenc/bookshelf
|
https://github.com/TuraiFerenc/bookshelf
|
2d9aeb5937cc28b301d1244d3238613734242372
|
05df0db437a7b4a5c6766ddac3c2c8afe5643b22
|
refs/heads/master
| 2019-12-17T22:26:40.481000 | 2017-04-16T21:42:05 | 2017-04-16T21:42:05 | 88,351,024 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package bubok.just.hu.bubokbookshelf.list.applogic.interactors.interfaces;
import java.util.ArrayList;
import bubok.just.hu.bubokbookshelf.list.applogic.entities.ListViewModel;
import io.reactivex.observers.DisposableMaybeObserver;
/**
* Created by T.Ferenc on 2017. 04. 16..
*/
public interface ListInteractorInterface {
void requestListQuery(String query, DisposableMaybeObserver<ArrayList<ListViewModel>> observer);
}
|
UTF-8
|
Java
| 431 |
java
|
ListInteractorInterface.java
|
Java
|
[
{
"context": "ervers.DisposableMaybeObserver;\n\n/**\n * Created by T.Ferenc on 2017. 04. 16..\n */\n\npublic interface ListInter",
"end": 261,
"score": 0.9978066682815552,
"start": 253,
"tag": "NAME",
"value": "T.Ferenc"
}
] | null |
[] |
package bubok.just.hu.bubokbookshelf.list.applogic.interactors.interfaces;
import java.util.ArrayList;
import bubok.just.hu.bubokbookshelf.list.applogic.entities.ListViewModel;
import io.reactivex.observers.DisposableMaybeObserver;
/**
* Created by T.Ferenc on 2017. 04. 16..
*/
public interface ListInteractorInterface {
void requestListQuery(String query, DisposableMaybeObserver<ArrayList<ListViewModel>> observer);
}
| 431 | 0.809745 | 0.791183 | 14 | 29.785715 | 33.17955 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
12
|
31de425a666670d06315bd42f9e247dc1b4bb8c6
| 33,930,241,683,720 |
738170293092fb6647286f38efd37de4e732eb42
|
/src/week6/shortestpath/lowcostflights/LowCostFlights.java
|
2bc043c8394f92522404a3c9d3bd0b64963dc55b
|
[] |
no_license
|
didizlatkova/Algo-1
|
https://github.com/didizlatkova/Algo-1
|
1f2456a0e096274c8dda4637eb4339be9fe45d71
|
cd94b57bad129f342a4434a2602fef47fce33f93
|
refs/heads/master
| 2021-01-21T03:25:39.503000 | 2015-08-05T14:47:55 | 2015-08-05T14:47:55 | 37,077,979 | 0 | 1 | null | true | 2015-06-08T16:12:50 | 2015-06-08T16:12:50 | 2015-06-08T15:32:34 | 2015-06-08T13:04:30 | 269 | 0 | 0 | 0 | null | null | null |
package week6.shortestpath.lowcostflights;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class LowCostFlights {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
int n = Integer.parseInt(reader.readLine());
int[][] weight = new int[n][n];
String[] input;
int number;
for (int i = 0; i < n; i++) {
input = reader.readLine().split(" ");
for (int j = 0; j < input.length; j++) {
number = Integer.parseInt(input[j]);
if (number == 0 && i != j) {
weight[i][j] = Integer.MAX_VALUE / 2;
} else {
weight[i][j] = number;
}
}
}
int[][] dist = getDistances(weight);
n = Integer.parseInt(reader.readLine());
String[] command;
int result;
for (int i = 0; i < n; i++) {
command = reader.readLine().split(" ");
result = dist[Integer.parseInt(command[0])][Integer
.parseInt(command[1])];
if (result < Integer.MAX_VALUE / 2) {
System.out.println(result);
} else {
System.out.println("NO WAY");
}
}
}
private static int[][] getDistances(int[][] weight) {
for (int k = 0; k < weight.length; k++) {
for (int u = 0; u < weight.length; u++) {
for (int v = 0; v < weight[u].length; v++) {
if (u != v) {
weight[u][v] = Math.min(weight[u][v], weight[u][k]
+ weight[k][v]);
}
}
}
}
return weight;
}
}
|
UTF-8
|
Java
| 1,495 |
java
|
LowCostFlights.java
|
Java
|
[] | null |
[] |
package week6.shortestpath.lowcostflights;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class LowCostFlights {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
int n = Integer.parseInt(reader.readLine());
int[][] weight = new int[n][n];
String[] input;
int number;
for (int i = 0; i < n; i++) {
input = reader.readLine().split(" ");
for (int j = 0; j < input.length; j++) {
number = Integer.parseInt(input[j]);
if (number == 0 && i != j) {
weight[i][j] = Integer.MAX_VALUE / 2;
} else {
weight[i][j] = number;
}
}
}
int[][] dist = getDistances(weight);
n = Integer.parseInt(reader.readLine());
String[] command;
int result;
for (int i = 0; i < n; i++) {
command = reader.readLine().split(" ");
result = dist[Integer.parseInt(command[0])][Integer
.parseInt(command[1])];
if (result < Integer.MAX_VALUE / 2) {
System.out.println(result);
} else {
System.out.println("NO WAY");
}
}
}
private static int[][] getDistances(int[][] weight) {
for (int k = 0; k < weight.length; k++) {
for (int u = 0; u < weight.length; u++) {
for (int v = 0; v < weight[u].length; v++) {
if (u != v) {
weight[u][v] = Math.min(weight[u][v], weight[u][k]
+ weight[k][v]);
}
}
}
}
return weight;
}
}
| 1,495 | 0.588629 | 0.580602 | 63 | 22.730158 | 19.219044 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.873016 | false | false |
12
|
bcfc387030e2118d51c283c87a070b3d1c66c705
| 20,280,835,630,145 |
372fa985328ad30e227e7346f73bed4f1350c518
|
/src/com/neusoft/planewar/core/Drawable.java
|
92656c00551885373e024022af8278b86fd44e7f
|
[] |
no_license
|
bllli/JavaPlaneWar
|
https://github.com/bllli/JavaPlaneWar
|
3532f546db3a2c4997513b452428defa98b9c714
|
2063c880227ab8f23d554f2456b6b8e5c14d20d7
|
refs/heads/master
| 2017-12-04T22:26:44.440000 | 2017-07-04T01:46:38 | 2017-07-04T01:46:38 | 95,286,676 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.neusoft.planewar.core;
import java.awt.*;
/**
* 画图片的接口
* Created by bllli on 17-6-24.
*/
public interface Drawable {
void draw(Graphics g);
}
|
UTF-8
|
Java
| 175 |
java
|
Drawable.java
|
Java
|
[
{
"context": ";\n\nimport java.awt.*;\n\n/**\n * 画图片的接口\n * Created by bllli on 17-6-24.\n */\npublic interface Drawable {\n v",
"end": 89,
"score": 0.9996111989021301,
"start": 84,
"tag": "USERNAME",
"value": "bllli"
}
] | null |
[] |
package com.neusoft.planewar.core;
import java.awt.*;
/**
* 画图片的接口
* Created by bllli on 17-6-24.
*/
public interface Drawable {
void draw(Graphics g);
}
| 175 | 0.668712 | 0.638037 | 11 | 13.818182 | 12.95319 | 34 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | false | false |
12
|
1ade6a507eec621194b4b3145fddf9c2bd9b925d
| 13,322,988,576,320 |
c7e4c2ca386404a080685879abc7a37df5ec098a
|
/src/test/java/com/techproed/utilities/TestBase.java
|
0d55804f0548b53194c2899f3dc3974c2e4750e7
|
[] |
no_license
|
Bendenizz/Batch11_TestNG
|
https://github.com/Bendenizz/Batch11_TestNG
|
bbfee4b12c831d6432b7b6fbeff96accc2c36f22
|
c2d38d8c139ac0486abb7a138e0dd38e8b055c6c
|
refs/heads/master
| 2023-02-04T07:16:01.951000 | 2020-12-21T19:10:16 | 2020-12-21T19:10:16 | 319,016,071 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.techproed.utilities;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import java.util.concurrent.TimeUnit;
// abstrack yapmamızın sebebi obje oluşturulmasın diye yapıyoruz
public abstract class TestBase {
// default: package private: aynı package dekiler ılaşabilir.
// private: sadece o class dan ulaşılabilir
// protected: aynı package ve childlar
// public: herkes ulaşabilir
protected WebDriver driver;
@BeforeClass
public void setUp(){
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
}
@AfterClass
public void tearDown(){
driver.quit();
}
}
|
UTF-8
|
Java
| 959 |
java
|
TestBase.java
|
Java
|
[
{
"context": "ackage com.techproed.utilities;\n\nimport io.github.bonigarcia.wdm.WebDriverManager;\nimport org.openqa.selenium.",
"end": 61,
"score": 0.9995588064193726,
"start": 51,
"tag": "USERNAME",
"value": "bonigarcia"
}
] | null |
[] |
package com.techproed.utilities;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import java.util.concurrent.TimeUnit;
// abstrack yapmamızın sebebi obje oluşturulmasın diye yapıyoruz
public abstract class TestBase {
// default: package private: aynı package dekiler ılaşabilir.
// private: sadece o class dan ulaşılabilir
// protected: aynı package ve childlar
// public: herkes ulaşabilir
protected WebDriver driver;
@BeforeClass
public void setUp(){
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
}
@AfterClass
public void tearDown(){
driver.quit();
}
}
| 959 | 0.723337 | 0.721225 | 32 | 28.5625 | 21.005859 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4375 | false | false |
12
|
1f3a297e930988539f593fcb5113e571f91cedb8
| 18,897,856,126,742 |
5ed9c4a7317e88574c0974841decf1d288ee02a5
|
/src/main/java/za/co/kss/app/domain/Role.java
|
89171c8ded9ee9eab822a88fc1fbd2298937e247
|
[] |
no_license
|
Kgotla-Society-Scheme/KSSApp
|
https://github.com/Kgotla-Society-Scheme/KSSApp
|
dba349a2ebb62b80dc40c9b5885c058abbe6555f
|
e2dbcf79e26a4688ca7fa35a078af72ae2501dbd
|
refs/heads/master
| 2020-12-03T17:27:50.392000 | 2020-01-02T20:54:39 | 2020-01-02T20:54:39 | 231,408,583 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package za.co.kss.app.domain;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "Role")
public class Role {
@Id
@GeneratedValue
@Column(name = "roleID")
private long roleID;
@Column(name = "roleName")
private String roleName;
@Column(name ="roleType")
private String roleType;
@OneToMany(mappedBy="role",cascade = CascadeType.ALL,fetch = FetchType.LAZY)
private Set<Role> role;
}
|
UTF-8
|
Java
| 447 |
java
|
Role.java
|
Java
|
[] | null |
[] |
package za.co.kss.app.domain;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "Role")
public class Role {
@Id
@GeneratedValue
@Column(name = "roleID")
private long roleID;
@Column(name = "roleName")
private String roleName;
@Column(name ="roleType")
private String roleType;
@OneToMany(mappedBy="role",cascade = CascadeType.ALL,fetch = FetchType.LAZY)
private Set<Role> role;
}
| 447 | 0.673378 | 0.673378 | 22 | 19.318182 | 17.659369 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.409091 | false | false |
12
|
88ed0404d3ca318dcbc754a36b5735915b411387
| 13,726,715,513,777 |
a6ee74d63c6ee97fcb95afe8b31ee34e3f57c63c
|
/workspace/Project1/src/ProductRecord.java
|
69e4a88c2caa3706f18f645619544c42a05620c7
|
[] |
no_license
|
eunjilee1203/Capstone_serviceApp
|
https://github.com/eunjilee1203/Capstone_serviceApp
|
f516335b8bed5ee989fb5777f11c3bc714564a1e
|
0c2e9b8d38fae32409bc73fec76368f8be33d1a4
|
refs/heads/master
| 2021-01-22T10:46:21.360000 | 2017-05-28T10:44:46 | 2017-05-28T10:44:46 | 92,654,536 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class ProductRecord {
public ProductRecord(){
}
String Name;
String ID;
String Category;
String Price;
String CurrentStock;
String MinStock;
String Memo;
String[] tokens;
public void Reading(String line){
if((!line.startsWith("//")) && (!line.startsWith(" "))){
tokens = line.split("[:]");
if(tokens.length == 6){
Name = tokens[0].trim();
ID = tokens[1].trim();
category();
Price = tokens[2].trim();
CurrentStock = tokens[3].trim();
MinStock = tokens[4].trim();
Memo = tokens[5].trim();
}
else if (tokens.length == 5){
Name = tokens[0].trim();
ID = tokens[1].trim();
category();
Price = tokens[2].trim();
CurrentStock = tokens[3].trim();
MinStock = tokens[4].trim();
Memo = "";
}
else{
}
}
}
public void category(){
String[] tokens2 = ID.split("[-]");
switch(Integer.parseInt(tokens2[0])){
case 1:
Category = "Food";
break;
case 2:
Category = "Office";
break;
case 3:
Category = "Misc";
break;
case 4:
Category = "Health";
break;
case 5:
Category = "Clothing";
break;
}
}
public void print(){
System.out.println(String.format("%-15s %-13s %-10s %-7s %-16s %-12s %-10s",Name,ID,Category,Price,CurrentStock,MinStock,Memo));
}
}
|
UTF-8
|
Java
| 1,303 |
java
|
ProductRecord.java
|
Java
|
[] | null |
[] |
public class ProductRecord {
public ProductRecord(){
}
String Name;
String ID;
String Category;
String Price;
String CurrentStock;
String MinStock;
String Memo;
String[] tokens;
public void Reading(String line){
if((!line.startsWith("//")) && (!line.startsWith(" "))){
tokens = line.split("[:]");
if(tokens.length == 6){
Name = tokens[0].trim();
ID = tokens[1].trim();
category();
Price = tokens[2].trim();
CurrentStock = tokens[3].trim();
MinStock = tokens[4].trim();
Memo = tokens[5].trim();
}
else if (tokens.length == 5){
Name = tokens[0].trim();
ID = tokens[1].trim();
category();
Price = tokens[2].trim();
CurrentStock = tokens[3].trim();
MinStock = tokens[4].trim();
Memo = "";
}
else{
}
}
}
public void category(){
String[] tokens2 = ID.split("[-]");
switch(Integer.parseInt(tokens2[0])){
case 1:
Category = "Food";
break;
case 2:
Category = "Office";
break;
case 3:
Category = "Misc";
break;
case 4:
Category = "Health";
break;
case 5:
Category = "Clothing";
break;
}
}
public void print(){
System.out.println(String.format("%-15s %-13s %-10s %-7s %-16s %-12s %-10s",Name,ID,Category,Price,CurrentStock,MinStock,Memo));
}
}
| 1,303 | 0.57406 | 0.547966 | 67 | 18.447762 | 18.440128 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.059701 | false | false |
12
|
8a8e0588c15021e5a25ae62bea9b4eaab0194f9e
| 6,708,738,946,779 |
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/plugin/exdevice/ui/ExdeviceBindDeviceUI$4.java
|
c9c33ee53ed3c39a5d6119237d252158c4817c64
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
https://github.com/0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580000 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.tencent.mm.plugin.exdevice.ui;
import com.tencent.mm.plugin.exdevice.model.j.a;
final class ExdeviceBindDeviceUI$4
implements j.a
{
ExdeviceBindDeviceUI$4(ExdeviceBindDeviceUI paramExdeviceBindDeviceUI)
{
}
public final void g(int paramInt, Object[] paramArrayOfObject)
{
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.exdevice.ui.ExdeviceBindDeviceUI.4
* JD-Core Version: 0.6.2
*/
|
UTF-8
|
Java
| 550 |
java
|
ExdeviceBindDeviceUI$4.java
|
Java
|
[] | null |
[] |
package com.tencent.mm.plugin.exdevice.ui;
import com.tencent.mm.plugin.exdevice.model.j.a;
final class ExdeviceBindDeviceUI$4
implements j.a
{
ExdeviceBindDeviceUI$4(ExdeviceBindDeviceUI paramExdeviceBindDeviceUI)
{
}
public final void g(int paramInt, Object[] paramArrayOfObject)
{
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.exdevice.ui.ExdeviceBindDeviceUI.4
* JD-Core Version: 0.6.2
*/
| 550 | 0.712727 | 0.690909 | 20 | 25.6 | 32.610428 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | false | false |
12
|
9a5fd391abb18d45f452871329d4ae3d8d00eab7
| 17,901,423,739,615 |
e9954008f2b333a92498a60c3f4486efe48dd637
|
/src/com/funsoft/happyaudio/MainActivity.java
|
a539dcd6168d006e71e19471bb1d8751227cf60a
|
[] |
no_license
|
xff1874/HappyAudio
|
https://github.com/xff1874/HappyAudio
|
85f0b1fe0016a541fe43d23bd6e9c2fe7c8e6199
|
b9224da9452520a49293d670508caa3c840b7059
|
refs/heads/master
| 2016-03-28T13:03:16.165000 | 2013-03-25T13:22:19 | 2013-03-25T13:22:19 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.funsoft.happyaudio;
import android.annotation.TargetApi;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.funsoft.happyaudio.adapter.MainAdapter;
import com.funsoft.happyaudio.data.DatabaseHelper;
import com.funsoft.happyaudio.data.RSSItemProvider.RSSItemProviderConstant;
import com.funsoft.happyaudio.dialogs.MainActivityRssItemDialogFragment;
import com.funsoft.happyaudio.model.RSSItem;
import com.funsoft.happyaudio.utils.RSSConstant;
import com.funsoft.happyaudio.utils.images.RSSFileOperate;
import com.j256.ormlite.android.apptools.OrmLiteBaseListActivity;
@TargetApi(11)
public class MainActivity extends OrmLiteBaseListActivity<DatabaseHelper> implements
LoaderManager.LoaderCallbacks<Cursor> {
private ListView listView;
private MainAdapter adapter;
private int loaderId = 0;
private String sortOrder = "_id";
private int requestCode = 1;
// private final String imageURL =
// "http://a3.twimg.com/profile_images/511790713/AG_normal.png";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main_layout);
adapter = new MainAdapter(this, null, 0);
setListAdapter(adapter);
getLoaderManager().initLoader(loaderId, null, this);
bindEvents();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
//
// return super.onCreateOptionsMenu(menu);
// }
public boolean onPrepareOptionsMenu(Menu menu) {
Intent settingIntent = new Intent(this, SettingsActivity.class);
startActivityForResult(settingIntent, requestCode);
return super.onPrepareOptionsMenu(menu);
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
CursorLoader cursorLoader = new CursorLoader(this,
RSSItemProviderConstant.BOOK_CONTENT_URI, null, null, null, sortOrder);
return cursorLoader;
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
adapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
adapter.swapCursor(null);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1) {
if (resultCode == RESULT_OK) {
String result = data.getStringExtra("sortOrder");
if (result.equals("category"))
sortOrder = "title";
else
sortOrder = "_id";
getLoaderManager().restartLoader(loaderId, null, MainActivity.this);
}
if (resultCode == RESULT_CANCELED) {
}
}
}
private void bindEvents() {
ImageView addBook = (ImageView)findViewById(R.id.add_book);
ImageView mainFresh = (ImageView)findViewById(R.id.main_refresh);
addBook.setOnClickListener(mainListener);
mainFresh.setOnClickListener(mainListener);
listView = getListView();
listView.setOnItemClickListener(itemClickListener);
listView.setOnItemLongClickListener(listViewOnItemLongClickListener);
}
private OnClickListener mainListener = new OnClickListener() {
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.add_book:
Intent intent = new Intent(RSSConstant.RSS_LIST_ACTIVITY_SHOW);
startActivity(intent);
break;
case R.id.main_refresh:
getLoaderManager().restartLoader(loaderId, null, MainActivity.this);
break;
default:
Log.e("can't find the view ", v.toString());
}
}
};
private OnItemClickListener itemClickListener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent playIntent = new Intent(RSSConstant.PLAY_AUDIO_SHOW);
playIntent.putExtra(RSSConstant.ARG_PLAY_POSITION, position);
playIntent.putExtra(RSSConstant.ARG_PLAY_LIST,
adapter.getPlayList().toArray(new String[adapter.getPlayList().size()]));
startActivity(playIntent);
}
};
private OnItemLongClickListener listViewOnItemLongClickListener = new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
TextView textView = (TextView)view.findViewById(R.id.txtTitle);
RSSItem item = (RSSItem)textView.getTag();
MainActivityRssItemDialogFragment rssItemOptionDialog = new MainActivityRssItemDialogFragment(
MainActivity.this, item);
rssItemOptionDialog.show(MainActivity.this.getFragmentManager(),
"rssitemdialogfragment");
return true;
}
};
public void deleteRSSItem(RSSItem item) {
try {
getHelper().deleteRssItem(item);
getLoaderManager().restartLoader(loaderId, null, this);
RSSFileOperate.getFileOperate().deleteFileFromDisk(this,
RSSConstant.getAudioDirectory(), item.getLink());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
UTF-8
|
Java
| 6,184 |
java
|
MainActivity.java
|
Java
|
[] | null |
[] |
package com.funsoft.happyaudio;
import android.annotation.TargetApi;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.funsoft.happyaudio.adapter.MainAdapter;
import com.funsoft.happyaudio.data.DatabaseHelper;
import com.funsoft.happyaudio.data.RSSItemProvider.RSSItemProviderConstant;
import com.funsoft.happyaudio.dialogs.MainActivityRssItemDialogFragment;
import com.funsoft.happyaudio.model.RSSItem;
import com.funsoft.happyaudio.utils.RSSConstant;
import com.funsoft.happyaudio.utils.images.RSSFileOperate;
import com.j256.ormlite.android.apptools.OrmLiteBaseListActivity;
@TargetApi(11)
public class MainActivity extends OrmLiteBaseListActivity<DatabaseHelper> implements
LoaderManager.LoaderCallbacks<Cursor> {
private ListView listView;
private MainAdapter adapter;
private int loaderId = 0;
private String sortOrder = "_id";
private int requestCode = 1;
// private final String imageURL =
// "http://a3.twimg.com/profile_images/511790713/AG_normal.png";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main_layout);
adapter = new MainAdapter(this, null, 0);
setListAdapter(adapter);
getLoaderManager().initLoader(loaderId, null, this);
bindEvents();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
//
// return super.onCreateOptionsMenu(menu);
// }
public boolean onPrepareOptionsMenu(Menu menu) {
Intent settingIntent = new Intent(this, SettingsActivity.class);
startActivityForResult(settingIntent, requestCode);
return super.onPrepareOptionsMenu(menu);
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
CursorLoader cursorLoader = new CursorLoader(this,
RSSItemProviderConstant.BOOK_CONTENT_URI, null, null, null, sortOrder);
return cursorLoader;
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
adapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
adapter.swapCursor(null);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1) {
if (resultCode == RESULT_OK) {
String result = data.getStringExtra("sortOrder");
if (result.equals("category"))
sortOrder = "title";
else
sortOrder = "_id";
getLoaderManager().restartLoader(loaderId, null, MainActivity.this);
}
if (resultCode == RESULT_CANCELED) {
}
}
}
private void bindEvents() {
ImageView addBook = (ImageView)findViewById(R.id.add_book);
ImageView mainFresh = (ImageView)findViewById(R.id.main_refresh);
addBook.setOnClickListener(mainListener);
mainFresh.setOnClickListener(mainListener);
listView = getListView();
listView.setOnItemClickListener(itemClickListener);
listView.setOnItemLongClickListener(listViewOnItemLongClickListener);
}
private OnClickListener mainListener = new OnClickListener() {
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.add_book:
Intent intent = new Intent(RSSConstant.RSS_LIST_ACTIVITY_SHOW);
startActivity(intent);
break;
case R.id.main_refresh:
getLoaderManager().restartLoader(loaderId, null, MainActivity.this);
break;
default:
Log.e("can't find the view ", v.toString());
}
}
};
private OnItemClickListener itemClickListener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent playIntent = new Intent(RSSConstant.PLAY_AUDIO_SHOW);
playIntent.putExtra(RSSConstant.ARG_PLAY_POSITION, position);
playIntent.putExtra(RSSConstant.ARG_PLAY_LIST,
adapter.getPlayList().toArray(new String[adapter.getPlayList().size()]));
startActivity(playIntent);
}
};
private OnItemLongClickListener listViewOnItemLongClickListener = new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
TextView textView = (TextView)view.findViewById(R.id.txtTitle);
RSSItem item = (RSSItem)textView.getTag();
MainActivityRssItemDialogFragment rssItemOptionDialog = new MainActivityRssItemDialogFragment(
MainActivity.this, item);
rssItemOptionDialog.show(MainActivity.this.getFragmentManager(),
"rssitemdialogfragment");
return true;
}
};
public void deleteRSSItem(RSSItem item) {
try {
getHelper().deleteRssItem(item);
getLoaderManager().restartLoader(loaderId, null, this);
RSSFileOperate.getFileOperate().deleteFileFromDisk(this,
RSSConstant.getAudioDirectory(), item.getLink());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 6,184 | 0.66284 | 0.659767 | 179 | 33.541901 | 27.195181 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.653631 | false | false |
12
|
60b36216baa391ccbd2b264b0033f70268136480
| 609,885,419,413 |
a6e67dc8fff9f559dbac33ea56973b121772ee85
|
/src/main/java/easyjob/CoverletterProcessor.java
|
59de0c1e21f6ea29f9ef9027149a57154aec3dec
|
[] |
no_license
|
Xingyuj/EasyJob
|
https://github.com/Xingyuj/EasyJob
|
ad6135209b28e3cee7eef5ab02cb4deceb8776d1
|
516bf0bb44787fc750692ad9f51188f88db288fb
|
refs/heads/master
| 2020-06-18T21:45:10.683000 | 2016-11-30T15:50:37 | 2016-11-30T15:50:37 | 74,939,181 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package easyjob;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.poi.xwpf.converter.pdf.PdfConverter;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFNumbering;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
public class CoverletterProcessor {
private String name = "Ethan (Xingyu Ji)";
private String email = "Email: xingyuj@student.unimelb.edu.au";
private String mobile = "Mobile: (+61) 452340717";
private String companyName = "<com name>";
private String companyAddress = "com address";
private String jobURL;
private String jobTitle = "<jobtitle>";
private String recruiterName = "To Whom it May Concern,";
private String webName = "<web name>";
private String position = "<position name>";
private String fontFamily = "Times New Roman";
private String requiredType = "";
private MSExcelManager excelManager;
private int size = 14;
private int personalInfoSize = 12;
private int companyInfoSize = 12;
private List<String> requiredSkills = new ArrayList<String>();
private static Logger logger = Logger.getLogger(CoverletterProcessor.class);
public CoverletterProcessor() {
this.excelManager = new MSExcelManager();
// TODO Auto-generated constructor stub
}
public void writeCoverletter(String filename) throws Exception {
logger.info("generating cover letter for company [" + companyName
+ "] ...");
XWPFDocument document = new XWPFDocument(new FileInputStream(
"/Users/xingyuji/easyjob/template.docx"));
XWPFNumbering numbering = document.createNumbering();
// BigInteger abstractNumId = numbering.addAbstractNum(null);
BigInteger numId = numbering.addNum(BigInteger.ZERO);
processPersonalInfo(document);
processCompanyInfo(document);
processTitle(document);
processBody(document);
processBodySkills(document, numId);
processConclusion(document);
XWPFParagraph inscribe = document.createParagraph();
inscribe.setAlignment(ParagraphAlignment.LEFT);
// inscribe.setStyle("Normal");
XWPFRun _inscribe = inscribe.createRun();
_inscribe.setText("Yours sincerely");
_inscribe.addBreak();
_inscribe.setText("Ethan Ji");
_inscribe.setFontFamily(fontFamily);
_inscribe.setFontSize(size);
FileOutputStream fos = new FileOutputStream(
new File(filename + ".docx"));
document.write(fos);
fos.close();
XWPFDocument reloadDocx = new XWPFDocument(new FileInputStream(filename
+ ".docx"));
OutputStream out = new FileOutputStream(new File(filename + ".pdf"));
PdfConverter.getInstance().convert(reloadDocx, out, null);
logger.info("Company [" + companyName + "]'s cover letter generated");
}
public void processConclusion(XWPFDocument document) {
XWPFParagraph conclusion = document.createParagraph();
conclusion.setAlignment(ParagraphAlignment.BOTH);
XWPFRun body = conclusion.createRun();
// TODO: add name of the recruiter
body.addCarriageReturn();
body.setText("I look forward to hearing from you and would appreciate that you could provide me with an interview to discuss my application further. I have also attached my resume with this cover letter for your consideration. Thank you very much in advance for your time.");
body.addCarriageReturn();
body.addCarriageReturn();
body.setFontFamily(fontFamily);
body.setFontSize(size);
}
private void processBodySkills(XWPFDocument document, BigInteger numId)
throws IOException {
HashMap<String, String> results = retrieveSkillsToBeWritten();
Iterator<Entry<String, String>> it = results.entrySet().iterator();
while (it.hasNext()) {
XWPFParagraph skillParagraph = document.createParagraph();
skillParagraph.setIndentationFirstLine(0);
skillParagraph.setIndentationHanging(0);
skillParagraph.setIndentationLeft(0);
skillParagraph.setIndentationRight(0);
skillParagraph.setAlignment(ParagraphAlignment.BOTH);
@SuppressWarnings("rawtypes")
Map.Entry pair = (Map.Entry) it.next();
XWPFRun stressed = skillParagraph.createRun();
stressed.setText(pair.getKey().toString());
stressed.setBold(true);
stressed.setFontFamily(fontFamily);
stressed.setFontSize(size);
// System.out.println(pair.getValue());
XWPFRun content = skillParagraph.createRun();
content.setText(pair.getValue().toString());
content.addCarriageReturn();
content.setFontFamily(fontFamily);
content.setFontSize(size);
// numbering
// skillParagraph.setNumID(numId);
}
}
private void processPersonalInfo(XWPFDocument document) {
XWPFParagraph personalInfoParagraph = document.createParagraph();
personalInfoParagraph.setAlignment(ParagraphAlignment.RIGHT);
XWPFRun personalInfo = personalInfoParagraph.createRun();
personalInfo.setText(name);
personalInfo.addCarriageReturn();
personalInfo.setText(email);
personalInfo.addCarriageReturn();
personalInfo.setText(mobile);
personalInfo.setFontFamily(fontFamily);
personalInfo.setFontSize(personalInfoSize);
}
private void processCompanyInfo(XWPFDocument document) {
XWPFParagraph companyInfoParagraph = document.createParagraph();
companyInfoParagraph.setAlignment(ParagraphAlignment.LEFT);
XWPFRun companyInfo = companyInfoParagraph.createRun();
// TODO: add company
companyInfo.setText(companyName);
companyInfo.addCarriageReturn();
companyInfo.setText(companyAddress);
companyInfo.setFontFamily(fontFamily);
companyInfo.setFontSize(companyInfoSize);
}
private void processTitle(XWPFDocument document) {
XWPFParagraph titleParagraph = document.createParagraph();
titleParagraph.setAlignment(ParagraphAlignment.LEFT);
XWPFRun title = titleParagraph.createRun();
title.addCarriageReturn();
title.setText("RE: Application ");
// TODO: add job title
title.setText(jobTitle);
title.addCarriageReturn();
title.setFontSize(14);
title.setBold(true);
title.setFontFamily(fontFamily);
title.setFontSize(size);
}
private void processBody(XWPFDocument document) {
XWPFParagraph bodyParagraph = document.createParagraph();
bodyParagraph.setAlignment(ParagraphAlignment.BOTH);
XWPFRun body = bodyParagraph.createRun();
// TODO: add name of the recruiter
body.setText(recruiterName);
body.addCarriageReturn();
body.addCarriageReturn();
// TODO: add position name and website name
body.setText("I am writing to apply for "
+ jobTitle
+ ", as advertised on "
+ webName
+ ". I recently graduated from the University of Melbourne with a degree of Master of Engineering (Software) in 2016, possessing one-year Java development work experience from 2012 to 2013. ");
body.addCarriageReturn();
body.addCarriageReturn();
body.setText("I am keen to apply my knowledge and essential skills gained through both projects experience and university study. This position appeals to me a lot as I believe to work at "
+ companyName
+ " is an ideal opportunity for me to contribute to real commercial software projects and collaborate with experienced developers, and to have access to new technologies which is always my favourite. ");
body.addCarriageReturn();
body.addCarriageReturn();
body.setText("Concerning my skills to meet the essential requirements of this position:");
body.setFontFamily(fontFamily);
body.setFontSize(size);
}
/**
*
* @param requiredType
* @return
* @throws IOException
*/
public HashMap<String, String> retrieveSkillsToBeWritten() throws IOException {
HashMap<String, String> results = new HashMap<String, String>();
HashMap<String, String> bakupResults = new HashMap<String, String>();
// modify this to extract non-default excel file -> excelManager.setFilename("");
List<List<String>> skillsYouGot = excelManager.extractXLSX();
for (List<String> _got : skillsYouGot) {
String[] keywords = _got.get(0).split(",");
for (String _demand : requiredSkills) {
for (int i = 0; i < keywords.length; i++) {
if (Pattern.matches(".*\\b" + keywords[i] + "\\b.*",
_demand.toLowerCase())) {
results.put(_got.get(1), _got.get(2));
break;
} else if (bakupResults.size() < 4) {
// does not match, but store it up to 4 skills to
// fill out cover letter if there is less than 2
// matched skills
bakupResults.put(_got.get(1), _got.get(2));
break;
}
}
}
}
if (results.size() == 0) {
logger.error("no skills match position: [" + jobTitle
+ "] at company: [" + companyName + "], URL: [" + jobURL
+ "] do check manually, or are you just a dead dog?!");
results = bakupResults;
} else if (results.size() <= 2) {
logger.warn("your skills match position: [" + jobTitle
+ "] at company: [" + companyName + "], URL: [" + jobURL
+ "] less than 2, automaticaly added another two");
results.putAll(bakupResults);
}
return results;
}
public List<String> getRequiredSkills() {
return requiredSkills;
}
public void setRequiredSkills(List<String> requiredSkills) {
this.requiredSkills = requiredSkills;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCompanyAddress() {
return companyAddress;
}
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress;
}
public String getJobTitle() {
return jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
public String getRecruiterName() {
return recruiterName;
}
public void setRecruiterName(String recruiterName) {
this.recruiterName = recruiterName;
}
public String getWebName() {
return webName;
}
public void setWebName(String webName) {
this.webName = webName;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getFontFamily() {
return fontFamily;
}
public void setFontFamily(String fontFamily) {
this.fontFamily = fontFamily;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getPersonalInfoSize() {
return personalInfoSize;
}
public void setPersonalInfoSize(int personalInfoSize) {
this.personalInfoSize = personalInfoSize;
}
public int getCompanyInfoSize() {
return companyInfoSize;
}
public void setCompanyInfoSize(int companyInfoSize) {
this.companyInfoSize = companyInfoSize;
}
public String getJobURL() {
return jobURL;
}
public void setJobURL(String jobURL) {
this.jobURL = jobURL;
}
public String getRequiredType() {
return requiredType;
}
public void setRequiredType(String requiredType) {
this.requiredType = requiredType;
}
public static void main(String[] args) throws Exception {
CoverletterProcessor app = new CoverletterProcessor();
ArrayList<String> skills = new ArrayList<String>();
skills.add("qualification");
skills.add("commercial environment");
app.setRequiredSkills(skills);
app.writeCoverletter("/Users/xingyuji/Desktop/cl/testfile.docx");
}
}
|
UTF-8
|
Java
| 11,827 |
java
|
CoverletterProcessor.java
|
Java
|
[
{
"context": "s CoverletterProcessor {\n\n\tprivate String name = \"Ethan (Xingyu Ji)\";\n\tprivate String email = \"Email: xingy",
"end": 789,
"score": 0.9642837643623352,
"start": 784,
"tag": "NAME",
"value": "Ethan"
},
{
"context": "letterProcessor {\n\n\tprivate String name = \"Ethan (Xingyu Ji)\";\n\tprivate String email = \"Email: xingyuj@studen",
"end": 800,
"score": 0.9153034090995789,
"start": 791,
"tag": "NAME",
"value": "Xingyu Ji"
},
{
"context": "than (Xingyu Ji)\";\n\tprivate String email = \"Email: xingyuj@student.unimelb.edu.au\";\n\tprivate String mobile = \"Mobile: (+61) 4523407",
"end": 866,
"score": 0.9999308586120605,
"start": 836,
"tag": "EMAIL",
"value": "xingyuj@student.unimelb.edu.au"
},
{
"context": "y\");\n\t\t_inscribe.addBreak();\n\t\t_inscribe.setText(\"Ethan Ji\");\n\t\t_inscribe.setFontFamily(fontFamily);\n\t\t_insc",
"end": 2606,
"score": 0.9998263120651245,
"start": 2598,
"tag": "NAME",
"value": "Ethan Ji"
},
{
"context": "redSkills(skills);\n\t\tapp.writeCoverletter(\"/Users/xingyuji/Desktop/cl/testfile.docx\");\n\t}\n}\n",
"end": 11793,
"score": 0.9892231822013855,
"start": 11785,
"tag": "USERNAME",
"value": "xingyuji"
}
] | null |
[] |
package easyjob;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.poi.xwpf.converter.pdf.PdfConverter;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFNumbering;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
public class CoverletterProcessor {
private String name = "Ethan (<NAME>)";
private String email = "Email: <EMAIL>";
private String mobile = "Mobile: (+61) 452340717";
private String companyName = "<com name>";
private String companyAddress = "com address";
private String jobURL;
private String jobTitle = "<jobtitle>";
private String recruiterName = "To Whom it May Concern,";
private String webName = "<web name>";
private String position = "<position name>";
private String fontFamily = "Times New Roman";
private String requiredType = "";
private MSExcelManager excelManager;
private int size = 14;
private int personalInfoSize = 12;
private int companyInfoSize = 12;
private List<String> requiredSkills = new ArrayList<String>();
private static Logger logger = Logger.getLogger(CoverletterProcessor.class);
public CoverletterProcessor() {
this.excelManager = new MSExcelManager();
// TODO Auto-generated constructor stub
}
public void writeCoverletter(String filename) throws Exception {
logger.info("generating cover letter for company [" + companyName
+ "] ...");
XWPFDocument document = new XWPFDocument(new FileInputStream(
"/Users/xingyuji/easyjob/template.docx"));
XWPFNumbering numbering = document.createNumbering();
// BigInteger abstractNumId = numbering.addAbstractNum(null);
BigInteger numId = numbering.addNum(BigInteger.ZERO);
processPersonalInfo(document);
processCompanyInfo(document);
processTitle(document);
processBody(document);
processBodySkills(document, numId);
processConclusion(document);
XWPFParagraph inscribe = document.createParagraph();
inscribe.setAlignment(ParagraphAlignment.LEFT);
// inscribe.setStyle("Normal");
XWPFRun _inscribe = inscribe.createRun();
_inscribe.setText("Yours sincerely");
_inscribe.addBreak();
_inscribe.setText("<NAME>");
_inscribe.setFontFamily(fontFamily);
_inscribe.setFontSize(size);
FileOutputStream fos = new FileOutputStream(
new File(filename + ".docx"));
document.write(fos);
fos.close();
XWPFDocument reloadDocx = new XWPFDocument(new FileInputStream(filename
+ ".docx"));
OutputStream out = new FileOutputStream(new File(filename + ".pdf"));
PdfConverter.getInstance().convert(reloadDocx, out, null);
logger.info("Company [" + companyName + "]'s cover letter generated");
}
public void processConclusion(XWPFDocument document) {
XWPFParagraph conclusion = document.createParagraph();
conclusion.setAlignment(ParagraphAlignment.BOTH);
XWPFRun body = conclusion.createRun();
// TODO: add name of the recruiter
body.addCarriageReturn();
body.setText("I look forward to hearing from you and would appreciate that you could provide me with an interview to discuss my application further. I have also attached my resume with this cover letter for your consideration. Thank you very much in advance for your time.");
body.addCarriageReturn();
body.addCarriageReturn();
body.setFontFamily(fontFamily);
body.setFontSize(size);
}
private void processBodySkills(XWPFDocument document, BigInteger numId)
throws IOException {
HashMap<String, String> results = retrieveSkillsToBeWritten();
Iterator<Entry<String, String>> it = results.entrySet().iterator();
while (it.hasNext()) {
XWPFParagraph skillParagraph = document.createParagraph();
skillParagraph.setIndentationFirstLine(0);
skillParagraph.setIndentationHanging(0);
skillParagraph.setIndentationLeft(0);
skillParagraph.setIndentationRight(0);
skillParagraph.setAlignment(ParagraphAlignment.BOTH);
@SuppressWarnings("rawtypes")
Map.Entry pair = (Map.Entry) it.next();
XWPFRun stressed = skillParagraph.createRun();
stressed.setText(pair.getKey().toString());
stressed.setBold(true);
stressed.setFontFamily(fontFamily);
stressed.setFontSize(size);
// System.out.println(pair.getValue());
XWPFRun content = skillParagraph.createRun();
content.setText(pair.getValue().toString());
content.addCarriageReturn();
content.setFontFamily(fontFamily);
content.setFontSize(size);
// numbering
// skillParagraph.setNumID(numId);
}
}
private void processPersonalInfo(XWPFDocument document) {
XWPFParagraph personalInfoParagraph = document.createParagraph();
personalInfoParagraph.setAlignment(ParagraphAlignment.RIGHT);
XWPFRun personalInfo = personalInfoParagraph.createRun();
personalInfo.setText(name);
personalInfo.addCarriageReturn();
personalInfo.setText(email);
personalInfo.addCarriageReturn();
personalInfo.setText(mobile);
personalInfo.setFontFamily(fontFamily);
personalInfo.setFontSize(personalInfoSize);
}
private void processCompanyInfo(XWPFDocument document) {
XWPFParagraph companyInfoParagraph = document.createParagraph();
companyInfoParagraph.setAlignment(ParagraphAlignment.LEFT);
XWPFRun companyInfo = companyInfoParagraph.createRun();
// TODO: add company
companyInfo.setText(companyName);
companyInfo.addCarriageReturn();
companyInfo.setText(companyAddress);
companyInfo.setFontFamily(fontFamily);
companyInfo.setFontSize(companyInfoSize);
}
private void processTitle(XWPFDocument document) {
XWPFParagraph titleParagraph = document.createParagraph();
titleParagraph.setAlignment(ParagraphAlignment.LEFT);
XWPFRun title = titleParagraph.createRun();
title.addCarriageReturn();
title.setText("RE: Application ");
// TODO: add job title
title.setText(jobTitle);
title.addCarriageReturn();
title.setFontSize(14);
title.setBold(true);
title.setFontFamily(fontFamily);
title.setFontSize(size);
}
private void processBody(XWPFDocument document) {
XWPFParagraph bodyParagraph = document.createParagraph();
bodyParagraph.setAlignment(ParagraphAlignment.BOTH);
XWPFRun body = bodyParagraph.createRun();
// TODO: add name of the recruiter
body.setText(recruiterName);
body.addCarriageReturn();
body.addCarriageReturn();
// TODO: add position name and website name
body.setText("I am writing to apply for "
+ jobTitle
+ ", as advertised on "
+ webName
+ ". I recently graduated from the University of Melbourne with a degree of Master of Engineering (Software) in 2016, possessing one-year Java development work experience from 2012 to 2013. ");
body.addCarriageReturn();
body.addCarriageReturn();
body.setText("I am keen to apply my knowledge and essential skills gained through both projects experience and university study. This position appeals to me a lot as I believe to work at "
+ companyName
+ " is an ideal opportunity for me to contribute to real commercial software projects and collaborate with experienced developers, and to have access to new technologies which is always my favourite. ");
body.addCarriageReturn();
body.addCarriageReturn();
body.setText("Concerning my skills to meet the essential requirements of this position:");
body.setFontFamily(fontFamily);
body.setFontSize(size);
}
/**
*
* @param requiredType
* @return
* @throws IOException
*/
public HashMap<String, String> retrieveSkillsToBeWritten() throws IOException {
HashMap<String, String> results = new HashMap<String, String>();
HashMap<String, String> bakupResults = new HashMap<String, String>();
// modify this to extract non-default excel file -> excelManager.setFilename("");
List<List<String>> skillsYouGot = excelManager.extractXLSX();
for (List<String> _got : skillsYouGot) {
String[] keywords = _got.get(0).split(",");
for (String _demand : requiredSkills) {
for (int i = 0; i < keywords.length; i++) {
if (Pattern.matches(".*\\b" + keywords[i] + "\\b.*",
_demand.toLowerCase())) {
results.put(_got.get(1), _got.get(2));
break;
} else if (bakupResults.size() < 4) {
// does not match, but store it up to 4 skills to
// fill out cover letter if there is less than 2
// matched skills
bakupResults.put(_got.get(1), _got.get(2));
break;
}
}
}
}
if (results.size() == 0) {
logger.error("no skills match position: [" + jobTitle
+ "] at company: [" + companyName + "], URL: [" + jobURL
+ "] do check manually, or are you just a dead dog?!");
results = bakupResults;
} else if (results.size() <= 2) {
logger.warn("your skills match position: [" + jobTitle
+ "] at company: [" + companyName + "], URL: [" + jobURL
+ "] less than 2, automaticaly added another two");
results.putAll(bakupResults);
}
return results;
}
public List<String> getRequiredSkills() {
return requiredSkills;
}
public void setRequiredSkills(List<String> requiredSkills) {
this.requiredSkills = requiredSkills;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCompanyAddress() {
return companyAddress;
}
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress;
}
public String getJobTitle() {
return jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
public String getRecruiterName() {
return recruiterName;
}
public void setRecruiterName(String recruiterName) {
this.recruiterName = recruiterName;
}
public String getWebName() {
return webName;
}
public void setWebName(String webName) {
this.webName = webName;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getFontFamily() {
return fontFamily;
}
public void setFontFamily(String fontFamily) {
this.fontFamily = fontFamily;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getPersonalInfoSize() {
return personalInfoSize;
}
public void setPersonalInfoSize(int personalInfoSize) {
this.personalInfoSize = personalInfoSize;
}
public int getCompanyInfoSize() {
return companyInfoSize;
}
public void setCompanyInfoSize(int companyInfoSize) {
this.companyInfoSize = companyInfoSize;
}
public String getJobURL() {
return jobURL;
}
public void setJobURL(String jobURL) {
this.jobURL = jobURL;
}
public String getRequiredType() {
return requiredType;
}
public void setRequiredType(String requiredType) {
this.requiredType = requiredType;
}
public static void main(String[] args) throws Exception {
CoverletterProcessor app = new CoverletterProcessor();
ArrayList<String> skills = new ArrayList<String>();
skills.add("qualification");
skills.add("commercial environment");
app.setRequiredSkills(skills);
app.writeCoverletter("/Users/xingyuji/Desktop/cl/testfile.docx");
}
}
| 11,799 | 0.73848 | 0.734421 | 380 | 30.123684 | 29.011848 | 277 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.168421 | false | false |
12
|
3858d09eb9f35db0e6eb36b3e0b76703463a8cd0
| 2,851,858,322,378 |
40d69b94b749071a2902859433a21f75844e0511
|
/tweets-api/src/main/java/edu/colorado/cs/epic/tweetsapi/resource/TweetResource.java
|
020e9bf5487f076aec4ee2e88547d7049257a90e
|
[] |
no_license
|
Project-EPIC/epic-infra
|
https://github.com/Project-EPIC/epic-infra
|
1ac5c8339f908094fbf65be093b6126c4cc55a1d
|
c22a79928022a43a5e02119e555cf85e82a0aa5f
|
refs/heads/master
| 2022-09-10T11:54:23.116000 | 2021-10-23T21:46:14 | 2021-10-23T21:46:14 | 173,019,727 | 5 | 3 | null | false | 2022-09-08T01:13:32 | 2019-02-28T01:39:25 | 2021-10-23T21:52:54 | 2022-09-08T01:13:32 | 6,746 | 3 | 2 | 13 |
Java
| false | false |
package edu.colorado.cs.epic.tweetsapi.resource;
import edu.colorado.cs.epic.tweetsapi.api.StorageIndex;
import edu.colorado.cs.epic.tweetsapi.core.EventDateCount;
import io.dropwizard.jersey.params.LongParam;
import org.apache.log4j.Logger;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import java.util.*;
import javax.annotation.security.RolesAllowed;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
@Path("/tweets/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@RolesAllowed("ADMIN")
public class TweetResource {
private final Logger logger;
private final StorageIndex storageIndex;
public TweetResource(StorageIndex storageIndex) {
this.logger = Logger.getLogger(TweetResource.class.getName());
this.storageIndex = storageIndex;
}
@GET
@Path("/{eventName}/")
public String getTweets(@PathParam("eventName") String eventName,
@QueryParam("page") @DefaultValue("1") @Min(1) LongParam page,
@QueryParam("count") @DefaultValue("100") @Min(1) @Max(1000) LongParam pageCount) {
long pageNumber = page.get();
long pageSize = pageCount.get();
long startIndex = (pageNumber - 1) * pageSize;
long endIndex = startIndex + pageSize;
// Load in 'new' tweets for this event into the event's index
storageIndex.updateEventIndex(eventName);
// Check if we have tweets on event
long totalCount = storageIndex.getEventTweetTotal(eventName);
if (totalCount == -1) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
} else if (totalCount < startIndex) {
throw new WebApplicationException(Response.Status.BAD_REQUEST);
}
StringBuilder tweets = new StringBuilder();
tweets.append("{\"tweets\":[");
long numTweets = pageSize;
try {
tweets.append(storageIndex.getPaginatedTweets(eventName, startIndex, endIndex));
} catch (ParseException | IOException e) {
logger.error("Issue parsing JSON", e);
throw new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE);
}
tweets.append("],");
JSONObject metaObject = new JSONObject();
metaObject.put("count", pageSize);
metaObject.put("total_count", totalCount);
metaObject.put("num_pages", (long) Math.ceil((double) totalCount / pageSize));
metaObject.put("page", pageNumber);
metaObject.put("event_name", eventName);
metaObject.put("tweet_count", numTweets);
tweets.append("\"meta\":");
tweets.append(metaObject.toJSONString());
tweets.append("}");
return tweets.toString();
}
protected enum AggregationBucket {
hour,
day,
month
}
@GET
@Path("{eventName}/counts")
public JSONObject eventCount(@PathParam("eventName") String eventName, @DefaultValue("hour") @QueryParam("bucket") AggregationBucket bucket) {
// Load in 'new' tweets for this event into the event's index
storageIndex.updateEventIndex(eventName);
// Check if we have tweets on event
long totalCount = storageIndex.getEventTweetTotal(eventName);
if (totalCount == -1) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
String dateFormat = "yyyy-MM-dd HH24:00:00";
switch (bucket) {
case day:
dateFormat = "yyyy-MM-dd 00:00:00";
break;
case month:
dateFormat = "yyyy-MM-00 00:00:00";
break;
default:
break;
}
List<EventDateCount> counts = storageIndex.getEventCounts(eventName, dateFormat);
List<JSONObject> countObjects = new ArrayList<>();
for (EventDateCount item : counts) {
JSONObject object = new JSONObject();
object.put("time", item.getDateStr());
object.put("count", item.getCount());
countObjects.add(object);
}
JSONObject meta = new JSONObject();
meta.put("event_name", eventName);
meta.put("bucket", bucket);
JSONObject result = new JSONObject();
result.put("tweets", countObjects);
result.put("meta", meta);
return result;
}
}
|
UTF-8
|
Java
| 4,588 |
java
|
TweetResource.java
|
Java
|
[] | null |
[] |
package edu.colorado.cs.epic.tweetsapi.resource;
import edu.colorado.cs.epic.tweetsapi.api.StorageIndex;
import edu.colorado.cs.epic.tweetsapi.core.EventDateCount;
import io.dropwizard.jersey.params.LongParam;
import org.apache.log4j.Logger;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import java.util.*;
import javax.annotation.security.RolesAllowed;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
@Path("/tweets/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@RolesAllowed("ADMIN")
public class TweetResource {
private final Logger logger;
private final StorageIndex storageIndex;
public TweetResource(StorageIndex storageIndex) {
this.logger = Logger.getLogger(TweetResource.class.getName());
this.storageIndex = storageIndex;
}
@GET
@Path("/{eventName}/")
public String getTweets(@PathParam("eventName") String eventName,
@QueryParam("page") @DefaultValue("1") @Min(1) LongParam page,
@QueryParam("count") @DefaultValue("100") @Min(1) @Max(1000) LongParam pageCount) {
long pageNumber = page.get();
long pageSize = pageCount.get();
long startIndex = (pageNumber - 1) * pageSize;
long endIndex = startIndex + pageSize;
// Load in 'new' tweets for this event into the event's index
storageIndex.updateEventIndex(eventName);
// Check if we have tweets on event
long totalCount = storageIndex.getEventTweetTotal(eventName);
if (totalCount == -1) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
} else if (totalCount < startIndex) {
throw new WebApplicationException(Response.Status.BAD_REQUEST);
}
StringBuilder tweets = new StringBuilder();
tweets.append("{\"tweets\":[");
long numTweets = pageSize;
try {
tweets.append(storageIndex.getPaginatedTweets(eventName, startIndex, endIndex));
} catch (ParseException | IOException e) {
logger.error("Issue parsing JSON", e);
throw new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE);
}
tweets.append("],");
JSONObject metaObject = new JSONObject();
metaObject.put("count", pageSize);
metaObject.put("total_count", totalCount);
metaObject.put("num_pages", (long) Math.ceil((double) totalCount / pageSize));
metaObject.put("page", pageNumber);
metaObject.put("event_name", eventName);
metaObject.put("tweet_count", numTweets);
tweets.append("\"meta\":");
tweets.append(metaObject.toJSONString());
tweets.append("}");
return tweets.toString();
}
protected enum AggregationBucket {
hour,
day,
month
}
@GET
@Path("{eventName}/counts")
public JSONObject eventCount(@PathParam("eventName") String eventName, @DefaultValue("hour") @QueryParam("bucket") AggregationBucket bucket) {
// Load in 'new' tweets for this event into the event's index
storageIndex.updateEventIndex(eventName);
// Check if we have tweets on event
long totalCount = storageIndex.getEventTweetTotal(eventName);
if (totalCount == -1) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
String dateFormat = "yyyy-MM-dd HH24:00:00";
switch (bucket) {
case day:
dateFormat = "yyyy-MM-dd 00:00:00";
break;
case month:
dateFormat = "yyyy-MM-00 00:00:00";
break;
default:
break;
}
List<EventDateCount> counts = storageIndex.getEventCounts(eventName, dateFormat);
List<JSONObject> countObjects = new ArrayList<>();
for (EventDateCount item : counts) {
JSONObject object = new JSONObject();
object.put("time", item.getDateStr());
object.put("count", item.getCount());
countObjects.add(object);
}
JSONObject meta = new JSONObject();
meta.put("event_name", eventName);
meta.put("bucket", bucket);
JSONObject result = new JSONObject();
result.put("tweets", countObjects);
result.put("meta", meta);
return result;
}
}
| 4,588 | 0.632738 | 0.625327 | 136 | 32.735294 | 26.775547 | 146 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.661765 | false | false |
12
|
dd07ee82acdd5ac7f216c912d23624c1e84ef652
| 2,851,858,325,392 |
b4a514f83446e1231784fc2ccb50909425ad6629
|
/src/main/java/com/ta/model/DebtPaymentInfo.java
|
5d9cc5b20194895da57366625034a8f5c136c61c
|
[] |
no_license
|
krishnaadavi/TADebtAnalyzer
|
https://github.com/krishnaadavi/TADebtAnalyzer
|
ae366f6cd3cd1ee16d54ed510aafa328445a68d5
|
857d714ce413f64fce6256ee4ebd2ee4e5cb337c
|
refs/heads/main
| 2023-04-24T11:26:58.360000 | 2021-05-01T05:10:36 | 2021-05-01T05:10:36 | 363,296,459 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ta.model;
import java.util.Date;
/*
Represents the payment related information of debt. This is the output of processing
debt, payment plan and payment information by the TADebtAnalyzerApp.
*/
public class DebtPaymentInfo {
private int id;
private float remainingAmount;
private Date nextPaymentDate;
private boolean isInPaymentPlan;
private float amount;
public DebtPaymentInfo(int id, float amount, float remainingAmount, Date nextPaymentDate, boolean isInPaymentPlan){
this.id = id;
this.amount = amount;
this.remainingAmount = remainingAmount;
this.nextPaymentDate = nextPaymentDate;
this.isInPaymentPlan = isInPaymentPlan;
}
public int getId(){
return this.id;
}
public float getAmount(){
return this.amount;
}
public float getRemainingAmount(){
return this.remainingAmount;
}
public boolean getIsInPaymentPlan() {
return this.isInPaymentPlan;
}
public Date getNextPaymentDate() {
return this.nextPaymentDate;
}
}
|
UTF-8
|
Java
| 1,086 |
java
|
DebtPaymentInfo.java
|
Java
|
[] | null |
[] |
package com.ta.model;
import java.util.Date;
/*
Represents the payment related information of debt. This is the output of processing
debt, payment plan and payment information by the TADebtAnalyzerApp.
*/
public class DebtPaymentInfo {
private int id;
private float remainingAmount;
private Date nextPaymentDate;
private boolean isInPaymentPlan;
private float amount;
public DebtPaymentInfo(int id, float amount, float remainingAmount, Date nextPaymentDate, boolean isInPaymentPlan){
this.id = id;
this.amount = amount;
this.remainingAmount = remainingAmount;
this.nextPaymentDate = nextPaymentDate;
this.isInPaymentPlan = isInPaymentPlan;
}
public int getId(){
return this.id;
}
public float getAmount(){
return this.amount;
}
public float getRemainingAmount(){
return this.remainingAmount;
}
public boolean getIsInPaymentPlan() {
return this.isInPaymentPlan;
}
public Date getNextPaymentDate() {
return this.nextPaymentDate;
}
}
| 1,086 | 0.691529 | 0.691529 | 41 | 25.487804 | 24.552702 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.536585 | false | false |
12
|
e4e77752dd872382dc8d0ba3657d8d33e4f52655
| 24,867,860,682,274 |
76d1045f6f24bbd79b2d791716f8229e5ae6cdf8
|
/common-platform-support/common-platform-sys/src/main/java/com/common/platform/sys/modular/system/model/params/PositionParam.java
|
3fd0a15a8d29c561a3328f56318972b21c23f2bf
|
[
"Apache-2.0"
] |
permissive
|
xiaozhounandu/study
|
https://github.com/xiaozhounandu/study
|
2ee35bbc50ec443cd2b0cc51f425814bee968ed6
|
15c758d1bf02b231cc39b08796b03c91d1922635
|
refs/heads/main
| 2023-04-09T14:46:25.228000 | 2020-12-03T03:30:25 | 2020-12-03T03:30:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.common.platform.sys.modular.system.model.params;
import com.common.platform.sys.base.pojo.BaseValidatingParam;
import lombok.Data;
import java.io.Serializable;
@Data
public class PositionParam implements Serializable, BaseValidatingParam {
/**
* 主键id
*/
private Long positionId;
/**
* 职位名称
*/
private String name;
/**
* 职位编码
*/
private String code;
/**
* 顺序
*/
private Integer sort;
/**
* 状态(字典)
*/
private String status;
/**
* 备注
*/
private String remark;
@Override
public String checkParam() {
return null;
}
}
|
UTF-8
|
Java
| 699 |
java
|
PositionParam.java
|
Java
|
[] | null |
[] |
package com.common.platform.sys.modular.system.model.params;
import com.common.platform.sys.base.pojo.BaseValidatingParam;
import lombok.Data;
import java.io.Serializable;
@Data
public class PositionParam implements Serializable, BaseValidatingParam {
/**
* 主键id
*/
private Long positionId;
/**
* 职位名称
*/
private String name;
/**
* 职位编码
*/
private String code;
/**
* 顺序
*/
private Integer sort;
/**
* 状态(字典)
*/
private String status;
/**
* 备注
*/
private String remark;
@Override
public String checkParam() {
return null;
}
}
| 699 | 0.579186 | 0.579186 | 45 | 13.733334 | 16.429512 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.266667 | false | false |
12
|
831a7b16a72e7b68d13c5b29bf20da2d83aea2ed
| 11,613,591,631,844 |
8bc2dd6fb6b70c755a7d13152a0cba168a18d9a6
|
/myweb3/src/model/vo/Province.java
|
4260adc254ff129d3380924bf282b3249ee783ff
|
[] |
no_license
|
Keleeyu/Colaeyu
|
https://github.com/Keleeyu/Colaeyu
|
6e618d8b3838991f8b7537f7d9b521889d9139af
|
548f436447deb126ebd16e22c9579aeee98c4958
|
refs/heads/master
| 2021-07-06T10:09:23.704000 | 2020-11-01T13:52:29 | 2020-11-01T13:52:29 | 202,832,727 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package model.vo;
public class Province {
private int provinceCode;
private String provinceName;
/**
* @return the provinceCode
*/
public int getProvinceCode() {
return provinceCode;
}
/**
* @param provinceCode the provinceCode to set
*/
public void setProvinceCode(int provinceCode) {
this.provinceCode = provinceCode;
}
/**
* @return the provinceName
*/
public String getProvinceName() {
return provinceName;
}
/**
* @param provinceName the provinceName to set
*/
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public Province(int provinceCode, String provinceName) {
super();
this.provinceCode = provinceCode;
this.provinceName = provinceName;
}
public Province() {
super();
// TODO Auto-generated constructor stub
}
}
|
UTF-8
|
Java
| 821 |
java
|
Province.java
|
Java
|
[] | null |
[] |
package model.vo;
public class Province {
private int provinceCode;
private String provinceName;
/**
* @return the provinceCode
*/
public int getProvinceCode() {
return provinceCode;
}
/**
* @param provinceCode the provinceCode to set
*/
public void setProvinceCode(int provinceCode) {
this.provinceCode = provinceCode;
}
/**
* @return the provinceName
*/
public String getProvinceName() {
return provinceName;
}
/**
* @param provinceName the provinceName to set
*/
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public Province(int provinceCode, String provinceName) {
super();
this.provinceCode = provinceCode;
this.provinceName = provinceName;
}
public Province() {
super();
// TODO Auto-generated constructor stub
}
}
| 821 | 0.707674 | 0.707674 | 42 | 18.547619 | 17.215998 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.404762 | false | false |
12
|
35c3ba2c70a2f9c48b22d817ed760520db793610
| 21,809,843,986,659 |
c37005dd05bb3533431177e3f12ab7e1d49e7f70
|
/src/com/nt/exception/Test5.java
|
4ff0061e6c23276e27ae1ff947361c3b5d641bf1
|
[] |
no_license
|
raghubirsingh1/Github-learning
|
https://github.com/raghubirsingh1/Github-learning
|
9b3eb1a47211ab156a842b192a099f37a784b3e8
|
aefbad4f5870876462c56ca177338ac892dbe1a0
|
refs/heads/master
| 2020-05-15T04:17:09.722000 | 2019-04-19T06:44:23 | 2019-04-19T06:44:23 | 182,083,553 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.nt.exception;
import java.util.LinkedHashMap;
import java.util.Map;
public class Test5 {
public static void main(String[] args) {
String str="raghubir";
char[] ch=str.toCharArray();
Map<Character,Integer> map=new LinkedHashMap<>();
for(int i=0;i<ch.length;i++){
if(!map.containsKey(ch[i])){
map.put(ch[i], 1);
}else{
int j=map.get(ch[i]);
map.put(ch[i], ++j);
}
}
System.out.println(map);
}
}
|
UTF-8
|
Java
| 443 |
java
|
Test5.java
|
Java
|
[
{
"context": "tatic void main(String[] args) {\n\t\tString str=\"raghubir\";\n\t\tchar[] ch=str.toCharArray();\n\t\tMap<Character,",
"end": 167,
"score": 0.8531999588012695,
"start": 162,
"tag": "NAME",
"value": "hubir"
}
] | null |
[] |
package com.nt.exception;
import java.util.LinkedHashMap;
import java.util.Map;
public class Test5 {
public static void main(String[] args) {
String str="raghubir";
char[] ch=str.toCharArray();
Map<Character,Integer> map=new LinkedHashMap<>();
for(int i=0;i<ch.length;i++){
if(!map.containsKey(ch[i])){
map.put(ch[i], 1);
}else{
int j=map.get(ch[i]);
map.put(ch[i], ++j);
}
}
System.out.println(map);
}
}
| 443 | 0.629797 | 0.623025 | 24 | 17.458334 | 14.505686 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false |
12
|
26b601227b1c3daa5d5ed18a4c866d9a00b39c22
| 11,682,311,061,301 |
ee5604df64bb03e2bca818132f58ce7c2a085307
|
/src/dao/jdbc/ClientDaoImpl.java
|
04cb1aad287a41731007ca012793d99c822347d6
|
[] |
no_license
|
petitlaye/Projet_BDD
|
https://github.com/petitlaye/Projet_BDD
|
6534791c5d6b7fe6a784a6de9c6bd83fbbbeddf3
|
34c252ae05335d0e952eff37e0edad84eb02f3ef
|
refs/heads/master
| 2023-08-31T07:53:24.902000 | 2021-10-22T13:24:25 | 2021-10-22T13:24:25 | 318,530,231 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package dao.jdbc;
import dao.Dao;
import dao.exception.DaoException;
import model.Client;
import model.Entity;
import model.Ville;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
public class ClientDaoImpl extends JdbcDao {
public ClientDaoImpl(Connection connection) {
super(connection);
}
@Override
public Collection<Entity> findAll() throws DaoException {
Collection<Entity> clients = new ArrayList<>();
VilleDaoImpl villeDao = new VilleDaoImpl(connection);
try {
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT * FROM client");
while (resultSet.next()){
Client client = new Client();
client.setNomClient(resultSet.getString("nomclient"));
client.setIdClient(resultSet.getInt("idclient"));
client.setAdresseClient(resultSet.getString("adresseclient"));
client.setCodePostalClient(resultSet.getString("codepostalclient"));
Ville ville = (Ville) villeDao.findById(resultSet.getInt("idville"));
client.setIdVille(ville.getIdVille());
clients.add(client);
}
}catch (SQLException e) {
throw new DaoException(e);
}
return clients;
}
@Override
public Entity findById(int id) throws DaoException {
Client client = null;
VilleDaoImpl villeDao = new VilleDaoImpl(connection);
String rqSql = "SELECT * FROM client WHERE idclient =?";
PreparedStatement statement = null;
try {
statement=connection.prepareStatement(rqSql);
statement.setInt(1,id);
ResultSet resultSet = statement.executeQuery();
while (resultSet.next()){
client = new Client();
client.setIdVille(resultSet.getInt("idville"));
client.setNomClient(resultSet.getString("nomclient"));
client.setAdresseClient(resultSet.getString("adresseclient"));
client.setCodePostalClient(resultSet.getString("codepostalclient"));
Ville ville = (Ville) villeDao.findById(resultSet.getInt("idville"));
client.setIdVille(ville.getIdVille());
}
}catch (SQLException e) {
throw new DaoException(e);
}
return client;
}
@Override
public void create(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "INSERT INTO client(idclient,nomclient,adresseclient,codepostaclient,idville) VALUES(?,?,?,?,)?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
statement.setString(2,client.getNomClient());
statement.setString(3,client.getAdresseClient());
statement.setString(4,client.getCodePostalClient());
statement.setInt(5,client.getIdVille());
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public void update(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "UPDATE client SET idclient = ?, nomclient = ?, adresseclient = ?, codepostalclient = ?, idville = ?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
statement.setString(2,client.getNomClient());
statement.setString(3,client.getAdresseClient());
statement.setString(4,client.getCodePostalClient());
statement.setInt(5,client.getIdVille());
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public void delete(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "DELETE FROM client WHERE idclient = ?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
int res = statement.executeUpdate();
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public Collection<Entity> faireUneLocation() throws DaoException {
return null;
}
@Override
public Collection<Entity> retourdeVehicule() throws DaoException {
return null;
}
@Override
public Collection<Entity> FaireUneFacture() throws DaoException {
return null;
}
@Override
public Collection<Entity> nbVehiculesParMarque() throws DaoException {
return null;
}
@Override
public int chiffredaffaire() throws DaoException {
return 0;
}
}
|
UTF-8
|
Java
| 5,012 |
java
|
ClientDaoImpl.java
|
Java
|
[] | null |
[] |
package dao.jdbc;
import dao.Dao;
import dao.exception.DaoException;
import model.Client;
import model.Entity;
import model.Ville;
import java.sql.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
public class ClientDaoImpl extends JdbcDao {
public ClientDaoImpl(Connection connection) {
super(connection);
}
@Override
public Collection<Entity> findAll() throws DaoException {
Collection<Entity> clients = new ArrayList<>();
VilleDaoImpl villeDao = new VilleDaoImpl(connection);
try {
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT * FROM client");
while (resultSet.next()){
Client client = new Client();
client.setNomClient(resultSet.getString("nomclient"));
client.setIdClient(resultSet.getInt("idclient"));
client.setAdresseClient(resultSet.getString("adresseclient"));
client.setCodePostalClient(resultSet.getString("codepostalclient"));
Ville ville = (Ville) villeDao.findById(resultSet.getInt("idville"));
client.setIdVille(ville.getIdVille());
clients.add(client);
}
}catch (SQLException e) {
throw new DaoException(e);
}
return clients;
}
@Override
public Entity findById(int id) throws DaoException {
Client client = null;
VilleDaoImpl villeDao = new VilleDaoImpl(connection);
String rqSql = "SELECT * FROM client WHERE idclient =?";
PreparedStatement statement = null;
try {
statement=connection.prepareStatement(rqSql);
statement.setInt(1,id);
ResultSet resultSet = statement.executeQuery();
while (resultSet.next()){
client = new Client();
client.setIdVille(resultSet.getInt("idville"));
client.setNomClient(resultSet.getString("nomclient"));
client.setAdresseClient(resultSet.getString("adresseclient"));
client.setCodePostalClient(resultSet.getString("codepostalclient"));
Ville ville = (Ville) villeDao.findById(resultSet.getInt("idville"));
client.setIdVille(ville.getIdVille());
}
}catch (SQLException e) {
throw new DaoException(e);
}
return client;
}
@Override
public void create(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "INSERT INTO client(idclient,nomclient,adresseclient,codepostaclient,idville) VALUES(?,?,?,?,)?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
statement.setString(2,client.getNomClient());
statement.setString(3,client.getAdresseClient());
statement.setString(4,client.getCodePostalClient());
statement.setInt(5,client.getIdVille());
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public void update(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "UPDATE client SET idclient = ?, nomclient = ?, adresseclient = ?, codepostalclient = ?, idville = ?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
statement.setString(2,client.getNomClient());
statement.setString(3,client.getAdresseClient());
statement.setString(4,client.getCodePostalClient());
statement.setInt(5,client.getIdVille());
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public void delete(Entity entity) throws DaoException {
Client client = (Client) entity;
PreparedStatement statement = null;
String rqSql = "DELETE FROM client WHERE idclient = ?";
try {
statement = connection.prepareStatement(rqSql);
statement.setInt(1,client.getIdClient());
int res = statement.executeUpdate();
}catch (SQLException e) {
throw new DaoException(e);
}
}
@Override
public Collection<Entity> faireUneLocation() throws DaoException {
return null;
}
@Override
public Collection<Entity> retourdeVehicule() throws DaoException {
return null;
}
@Override
public Collection<Entity> FaireUneFacture() throws DaoException {
return null;
}
@Override
public Collection<Entity> nbVehiculesParMarque() throws DaoException {
return null;
}
@Override
public int chiffredaffaire() throws DaoException {
return 0;
}
}
| 5,012 | 0.620511 | 0.617917 | 143 | 34.04895 | 27.046535 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.678322 | false | false |
12
|
376a35796912672cc0615edcc56cd38e6d38b644
| 9,732,395,907,940 |
031061bfced7678c0af9838480ddb6031f54b65d
|
/springcloud-eureka-client/src/main/java/com/jk/controller/settlement/SettlementController.java
|
72a53cb7760e017e3f97b451d3af8f4670e872e0
|
[] |
no_license
|
beijingjk/demo
|
https://github.com/beijingjk/demo
|
dbf243baed6e80fb6aba4c09ea8435f28c457ba2
|
225770a1b87e73171edf026a1344f01b434dd8de
|
refs/heads/master
| 2020-04-04T18:59:45.590000 | 2018-11-03T01:41:58 | 2018-11-03T01:42:02 | 155,939,755 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.jk.controller.settlement;
import com.jk.model.Area;
import com.jk.model.OrderInfo;
import com.jk.service.settlement.SetelementServiceApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("element")
public class SettlementController {
@Autowired
private SetelementServiceApi elementService;
/*
* 薛长欢
*
* 查询省
*/
@RequestMapping("queryArea")
@ResponseBody
public List<Area> queryArea(){
List<Area> areas = elementService.queryArea();
return areas;
}
/*
* 薛长欢
*
* 查询市/区
*/
@RequestMapping("queryAreaByPid")
@ResponseBody
public List<Area> queryAreaByPid(Integer pid){
return elementService.queryAreaByPid(pid);
}
/*
* 薛长欢
*
* 添加地址
*/
@RequestMapping("addAddress")
public void addAddress(@RequestBody Area area){
elementService.addAddress(area);
}
@RequestMapping("queryAreaByUserId")
public List<Area> queryAreaByUserId(String loginId){
return elementService.queryAreaByUserId(loginId);
}
@RequestMapping("createOrder")
public Map<String,Object> createOrder(@RequestBody OrderInfo orderInfo){
return elementService.createOrder(orderInfo);
}
}
|
UTF-8
|
Java
| 1,690 |
java
|
SettlementController.java
|
Java
|
[
{
"context": "elementServiceApi elementService;\n\n /*\n * 薛长欢\n *\n * 查询省\n */\n @RequestMapping(",
"end": 719,
"score": 0.6127513647079468,
"start": 718,
"tag": "NAME",
"value": "薛"
},
{
"context": "ea();\n return areas;\n }\n\n /*\n * 薛长欢\n *\n * 查询市/区\n */\n @RequestMappin",
"end": 935,
"score": 0.5899321436882019,
"start": 934,
"tag": "NAME",
"value": "薛"
},
{
"context": "ervice.queryAreaByPid(pid);\n }\n\n /*\n * 薛长欢\n *\n * 添加地址\n */\n @RequestMapping",
"end": 1148,
"score": 0.6486308574676514,
"start": 1147,
"tag": "NAME",
"value": "薛"
},
{
"context": "vice.queryAreaByPid(pid);\n }\n\n /*\n * 薛长欢\n *\n * 添加地址\n */\n @RequestMapping(\"",
"end": 1150,
"score": 0.6102455854415894,
"start": 1149,
"tag": "NAME",
"value": "欢"
}
] | null |
[] |
package com.jk.controller.settlement;
import com.jk.model.Area;
import com.jk.model.OrderInfo;
import com.jk.service.settlement.SetelementServiceApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("element")
public class SettlementController {
@Autowired
private SetelementServiceApi elementService;
/*
* 薛长欢
*
* 查询省
*/
@RequestMapping("queryArea")
@ResponseBody
public List<Area> queryArea(){
List<Area> areas = elementService.queryArea();
return areas;
}
/*
* 薛长欢
*
* 查询市/区
*/
@RequestMapping("queryAreaByPid")
@ResponseBody
public List<Area> queryAreaByPid(Integer pid){
return elementService.queryAreaByPid(pid);
}
/*
* 薛长欢
*
* 添加地址
*/
@RequestMapping("addAddress")
public void addAddress(@RequestBody Area area){
elementService.addAddress(area);
}
@RequestMapping("queryAreaByUserId")
public List<Area> queryAreaByUserId(String loginId){
return elementService.queryAreaByUserId(loginId);
}
@RequestMapping("createOrder")
public Map<String,Object> createOrder(@RequestBody OrderInfo orderInfo){
return elementService.createOrder(orderInfo);
}
}
| 1,690 | 0.706667 | 0.706667 | 65 | 24.384615 | 21.665777 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false |
12
|
a479c9598d7dfc105b5df62b8bae8985bce8e37a
| 14,800,457,333,756 |
431b168459b6d1151203d06c946251a97ce2bca0
|
/src/main/java/com/xiaoweiyunchuang/orderfood/domain/PartnerInfo.java
|
92f501f4428587a14833d2cf2d427b0fbba3f2fe
|
[] |
no_license
|
zhongyibiao/orderfood
|
https://github.com/zhongyibiao/orderfood
|
39e87c660bf58640411d65f77c45d38b71386e81
|
494985d45d1ba257d8f6fa52deed737606c6fe20
|
refs/heads/master
| 2021-01-23T14:32:04.032000 | 2017-06-07T12:39:16 | 2017-06-07T12:40:36 | 93,255,529 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.xiaoweiyunchuang.orderfood.domain;
import java.io.Serializable;
import java.util.List;
public class PartnerInfo implements Serializable {
private String partnerId;
private String partnerName;
private String businessLicenceNo;
private String operatorName;
private String operatorIdNum;
private String partnerTel;
private String partnerMobile;
private String partnerAddr;
private String partnerRegion;
private String createBy;
private String createDate;
private String updateBy;
private String updateDate;
private String delFlag;
private List<DinnerRoom> dinnerRooms;
private static final long serialVersionUID = 1L;
public String getPartnerId() {
return partnerId;
}
public void setPartnerId(String partnerId) {
this.partnerId = partnerId == null ? null : partnerId.trim();
}
public String getPartnerName() {
return partnerName;
}
public void setPartnerName(String partnerName) {
this.partnerName = partnerName == null ? null : partnerName.trim();
}
public String getBusinessLicenceNo() {
return businessLicenceNo;
}
public void setBusinessLicenceNo(String businessLicenceNo) {
this.businessLicenceNo = businessLicenceNo == null ? null : businessLicenceNo.trim();
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName == null ? null : operatorName.trim();
}
public String getOperatorIdNum() {
return operatorIdNum;
}
public void setOperatorIdNum(String operatorIdNum) {
this.operatorIdNum = operatorIdNum == null ? null : operatorIdNum.trim();
}
public String getPartnerTel() {
return partnerTel;
}
public void setPartnerTel(String partnerTel) {
this.partnerTel = partnerTel == null ? null : partnerTel.trim();
}
public String getPartnerMobile() {
return partnerMobile;
}
public void setPartnerMobile(String partnerMobile) {
this.partnerMobile = partnerMobile == null ? null : partnerMobile.trim();
}
public String getPartnerAddr() {
return partnerAddr;
}
public void setPartnerAddr(String partnerAddr) {
this.partnerAddr = partnerAddr == null ? null : partnerAddr.trim();
}
public String getPartnerRegion() {
return partnerRegion;
}
public void setPartnerRegion(String partnerRegion) {
this.partnerRegion = partnerRegion;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public String getUpdateDate() {
return updateDate;
}
public void setUpdateDate(String updateDate) {
this.updateDate = updateDate;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag == null ? null : delFlag.trim();
}
public List<DinnerRoom> getDinnerRooms() {
return dinnerRooms;
}
public void setDinnerRooms(List<DinnerRoom> dinnerRooms) {
this.dinnerRooms = dinnerRooms;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", partnerId=").append(partnerId);
sb.append(", partnerName=").append(partnerName);
sb.append(", businessLicenceNo=").append(businessLicenceNo);
sb.append(", operatorName=").append(operatorName);
sb.append(", operatorIdNum=").append(operatorIdNum);
sb.append(", partnerTel=").append(partnerTel);
sb.append(", partnerMobile=").append(partnerMobile);
sb.append(", partnerAddr=").append(partnerAddr);
sb.append(", createBy=").append(createBy);
sb.append(", createDate=").append(createDate);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateDate=").append(updateDate);
sb.append(", delFlag=").append(delFlag);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
|
UTF-8
|
Java
| 4,421 |
java
|
PartnerInfo.java
|
Java
|
[] | null |
[] |
package com.xiaoweiyunchuang.orderfood.domain;
import java.io.Serializable;
import java.util.List;
public class PartnerInfo implements Serializable {
private String partnerId;
private String partnerName;
private String businessLicenceNo;
private String operatorName;
private String operatorIdNum;
private String partnerTel;
private String partnerMobile;
private String partnerAddr;
private String partnerRegion;
private String createBy;
private String createDate;
private String updateBy;
private String updateDate;
private String delFlag;
private List<DinnerRoom> dinnerRooms;
private static final long serialVersionUID = 1L;
public String getPartnerId() {
return partnerId;
}
public void setPartnerId(String partnerId) {
this.partnerId = partnerId == null ? null : partnerId.trim();
}
public String getPartnerName() {
return partnerName;
}
public void setPartnerName(String partnerName) {
this.partnerName = partnerName == null ? null : partnerName.trim();
}
public String getBusinessLicenceNo() {
return businessLicenceNo;
}
public void setBusinessLicenceNo(String businessLicenceNo) {
this.businessLicenceNo = businessLicenceNo == null ? null : businessLicenceNo.trim();
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName == null ? null : operatorName.trim();
}
public String getOperatorIdNum() {
return operatorIdNum;
}
public void setOperatorIdNum(String operatorIdNum) {
this.operatorIdNum = operatorIdNum == null ? null : operatorIdNum.trim();
}
public String getPartnerTel() {
return partnerTel;
}
public void setPartnerTel(String partnerTel) {
this.partnerTel = partnerTel == null ? null : partnerTel.trim();
}
public String getPartnerMobile() {
return partnerMobile;
}
public void setPartnerMobile(String partnerMobile) {
this.partnerMobile = partnerMobile == null ? null : partnerMobile.trim();
}
public String getPartnerAddr() {
return partnerAddr;
}
public void setPartnerAddr(String partnerAddr) {
this.partnerAddr = partnerAddr == null ? null : partnerAddr.trim();
}
public String getPartnerRegion() {
return partnerRegion;
}
public void setPartnerRegion(String partnerRegion) {
this.partnerRegion = partnerRegion;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public String getUpdateDate() {
return updateDate;
}
public void setUpdateDate(String updateDate) {
this.updateDate = updateDate;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag == null ? null : delFlag.trim();
}
public List<DinnerRoom> getDinnerRooms() {
return dinnerRooms;
}
public void setDinnerRooms(List<DinnerRoom> dinnerRooms) {
this.dinnerRooms = dinnerRooms;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", partnerId=").append(partnerId);
sb.append(", partnerName=").append(partnerName);
sb.append(", businessLicenceNo=").append(businessLicenceNo);
sb.append(", operatorName=").append(operatorName);
sb.append(", operatorIdNum=").append(operatorIdNum);
sb.append(", partnerTel=").append(partnerTel);
sb.append(", partnerMobile=").append(partnerMobile);
sb.append(", partnerAddr=").append(partnerAddr);
sb.append(", createBy=").append(createBy);
sb.append(", createDate=").append(createDate);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateDate=").append(updateDate);
sb.append(", delFlag=").append(delFlag);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
| 4,421 | 0.698937 | 0.698711 | 185 | 21.908108 | 22.311728 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.443243 | false | false |
12
|
eec8ce375c419f9ac3a1c49be9959b4924b83ea4
| 10,428,180,663,633 |
5ca4c2314e07fad22abc8dfba834280d9248e295
|
/app/src/main/java/co/fitcom/downloader/MainActivity.java
|
d5d5c164d7f63324a18be826ae23d45eb88c716e
|
[
"Apache-2.0"
] |
permissive
|
triniwiz/fancydownloader
|
https://github.com/triniwiz/fancydownloader
|
69e7da5780830c651c1f3d6eab9b7312bc0d0b0f
|
e0521d657d548597f5829d61717f97fc95af6c3f
|
refs/heads/master
| 2021-10-22T14:46:12.784000 | 2018-11-12T22:20:23 | 2018-11-12T22:20:23 | 114,298,734 | 4 | 3 |
Apache-2.0
| false | 2019-03-11T12:46:38 | 2017-12-14T21:38:12 | 2018-12-24T02:55:48 | 2018-11-12T22:20:28 | 609 | 4 | 3 | 2 |
Java
| false | null |
package co.fitcom.downloader;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.File;
import java.sql.Timestamp;
import java.time.Instant;
import co.fitcom.fancydownloader.DownloadListener;
import co.fitcom.fancydownloader.DownloadListenerUI;
import co.fitcom.fancydownloader.Manager;
import co.fitcom.fancydownloader.Request;
public class MainActivity extends AppCompatActivity {
String imageDownloadId;
String fileDownloadId;
Manager downloadManager;
String SMALL_IMAGE = "https://wallpaperscraft.com/image/hulk_wolverine_x_men_marvel_comics_art_99032_3840x2400.jpg";
String LARGE_IMAGE = "https://images.unsplash.com/photo-1513025186107-2688cad44a98?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&dl=sean-pierce-477569.jpg&s=17dbae12dc69dc9be30404a13f85b5da";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Manager.init(this);
}
public void generateDownloads(android.view.View view) {
downloadManager = Manager.getInstance();
final ImageView imageView = (ImageView) findViewById(R.id.image);
final ProgressBar imageProgressBar = (ProgressBar) findViewById(R.id.imageProgress);
imageProgressBar.setMax(100);
final TextView imageTextView = (TextView) findViewById(R.id.imageTextProgress);
final ProgressBar fileProgressBar = (ProgressBar) findViewById(R.id.fileProgress);
fileProgressBar.setMax(100);
final TextView fileTextView = (TextView) findViewById(R.id.fileTextProgress);
final Request request = new Request(LARGE_IMAGE);
request.setListener(new DownloadListener() {
@Override
public void onComplete(String task) {
String path = request.getFilePath().concat("/");
final String imagePath = path.concat(request.getFileName());
final Bitmap bitmap = decodeSampledBitmapFromFile(imagePath,200,200);
runOnUiThread(new Runnable() {
@Override
public void run() {
imageView.setImageBitmap(bitmap);
}
});
}
@Override
public void onError(String task, Exception exception) {
}
@Override
public void onProgress(String task, final long currentBytes, final long totalBytes,long speed) {
runOnUiThread(new Runnable() {
@Override
public void run() {
int progress = (int) ((currentBytes * 100L) / totalBytes);
imageProgressBar.setProgress(progress);
String percent = "".concat(Integer.toString(progress) + "%");
imageTextView.setText(percent);
}
});
}
});
Request fileRequest = new Request("http://ipv4.download.thinkbroadband.com/20MB.zip");
fileRequest.setListener(new DownloadListener() {
@Override
public void onComplete(String task) {
}
@Override
public void onError(String task, Exception exception) {
}
@Override
public void onProgress(String task, final long currentBytes, final long totalBytes,long speed) {
runOnUiThread(new Runnable() {
@Override
public void run() {
int progress = (int) ((currentBytes * 100L) / totalBytes);
fileProgressBar.setProgress(progress);
String percent = "".concat(Integer.toString(progress) + "%");
fileTextView.setText(percent);
}
});
}
});
imageDownloadId = downloadManager.create(request);
fileDownloadId = downloadManager.create(fileRequest);
}
public static int calculateInSampleSize(
BitmapFactory.Options options, int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
final int halfHeight = height / 2;
final int halfWidth = width / 2;
// Calculate the largest inSampleSize value that is a power of 2 and keeps both
// height and width larger than the requested height and width.
while ((halfHeight / inSampleSize) >= reqHeight
&& (halfWidth / inSampleSize) >= reqWidth) {
inSampleSize *= 2;
}
}
return inSampleSize;
}
public static Bitmap decodeSampledBitmapFromFile(String file,int reqWidth, int reqHeight) {
// First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(file,options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(file,options);
}
public void downloadImage(android.view.View view) {
downloadManager.start(imageDownloadId);
}
public void downloadFile(android.view.View view) {
downloadManager.start(fileDownloadId);
}
public void pauseImageDownload(android.view.View view){
downloadManager.pause(imageDownloadId);
}
public void pauseFileDownload(android.view.View view){
downloadManager.pause(fileDownloadId);
}
public void resumeImageDownload(android.view.View view){
downloadManager.resume(imageDownloadId);
}
public void resumeFileDownload(android.view.View view){
downloadManager.resume(fileDownloadId);
}
/*
public void retryImageDownload(android.view.View view){
downloadManager.retry(imageDownloadId);
}
public void retryFileDownload(android.view.View view){
downloadManager.retry(fileDownloadId);
}
*/
public void cancelImageDownload(android.view.View view){
downloadManager.cancel(imageDownloadId);
}
public void cancelFileDownload(android.view.View view){
downloadManager.cancel(fileDownloadId);
}
}
|
UTF-8
|
Java
| 6,891 |
java
|
MainActivity.java
|
Java
|
[] | null |
[] |
package co.fitcom.downloader;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.File;
import java.sql.Timestamp;
import java.time.Instant;
import co.fitcom.fancydownloader.DownloadListener;
import co.fitcom.fancydownloader.DownloadListenerUI;
import co.fitcom.fancydownloader.Manager;
import co.fitcom.fancydownloader.Request;
public class MainActivity extends AppCompatActivity {
String imageDownloadId;
String fileDownloadId;
Manager downloadManager;
String SMALL_IMAGE = "https://wallpaperscraft.com/image/hulk_wolverine_x_men_marvel_comics_art_99032_3840x2400.jpg";
String LARGE_IMAGE = "https://images.unsplash.com/photo-1513025186107-2688cad44a98?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&dl=sean-pierce-477569.jpg&s=17dbae12dc69dc9be30404a13f85b5da";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Manager.init(this);
}
public void generateDownloads(android.view.View view) {
downloadManager = Manager.getInstance();
final ImageView imageView = (ImageView) findViewById(R.id.image);
final ProgressBar imageProgressBar = (ProgressBar) findViewById(R.id.imageProgress);
imageProgressBar.setMax(100);
final TextView imageTextView = (TextView) findViewById(R.id.imageTextProgress);
final ProgressBar fileProgressBar = (ProgressBar) findViewById(R.id.fileProgress);
fileProgressBar.setMax(100);
final TextView fileTextView = (TextView) findViewById(R.id.fileTextProgress);
final Request request = new Request(LARGE_IMAGE);
request.setListener(new DownloadListener() {
@Override
public void onComplete(String task) {
String path = request.getFilePath().concat("/");
final String imagePath = path.concat(request.getFileName());
final Bitmap bitmap = decodeSampledBitmapFromFile(imagePath,200,200);
runOnUiThread(new Runnable() {
@Override
public void run() {
imageView.setImageBitmap(bitmap);
}
});
}
@Override
public void onError(String task, Exception exception) {
}
@Override
public void onProgress(String task, final long currentBytes, final long totalBytes,long speed) {
runOnUiThread(new Runnable() {
@Override
public void run() {
int progress = (int) ((currentBytes * 100L) / totalBytes);
imageProgressBar.setProgress(progress);
String percent = "".concat(Integer.toString(progress) + "%");
imageTextView.setText(percent);
}
});
}
});
Request fileRequest = new Request("http://ipv4.download.thinkbroadband.com/20MB.zip");
fileRequest.setListener(new DownloadListener() {
@Override
public void onComplete(String task) {
}
@Override
public void onError(String task, Exception exception) {
}
@Override
public void onProgress(String task, final long currentBytes, final long totalBytes,long speed) {
runOnUiThread(new Runnable() {
@Override
public void run() {
int progress = (int) ((currentBytes * 100L) / totalBytes);
fileProgressBar.setProgress(progress);
String percent = "".concat(Integer.toString(progress) + "%");
fileTextView.setText(percent);
}
});
}
});
imageDownloadId = downloadManager.create(request);
fileDownloadId = downloadManager.create(fileRequest);
}
public static int calculateInSampleSize(
BitmapFactory.Options options, int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
final int halfHeight = height / 2;
final int halfWidth = width / 2;
// Calculate the largest inSampleSize value that is a power of 2 and keeps both
// height and width larger than the requested height and width.
while ((halfHeight / inSampleSize) >= reqHeight
&& (halfWidth / inSampleSize) >= reqWidth) {
inSampleSize *= 2;
}
}
return inSampleSize;
}
public static Bitmap decodeSampledBitmapFromFile(String file,int reqWidth, int reqHeight) {
// First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(file,options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(file,options);
}
public void downloadImage(android.view.View view) {
downloadManager.start(imageDownloadId);
}
public void downloadFile(android.view.View view) {
downloadManager.start(fileDownloadId);
}
public void pauseImageDownload(android.view.View view){
downloadManager.pause(imageDownloadId);
}
public void pauseFileDownload(android.view.View view){
downloadManager.pause(fileDownloadId);
}
public void resumeImageDownload(android.view.View view){
downloadManager.resume(imageDownloadId);
}
public void resumeFileDownload(android.view.View view){
downloadManager.resume(fileDownloadId);
}
/*
public void retryImageDownload(android.view.View view){
downloadManager.retry(imageDownloadId);
}
public void retryFileDownload(android.view.View view){
downloadManager.retry(fileDownloadId);
}
*/
public void cancelImageDownload(android.view.View view){
downloadManager.cancel(imageDownloadId);
}
public void cancelFileDownload(android.view.View view){
downloadManager.cancel(fileDownloadId);
}
}
| 6,891 | 0.637208 | 0.624293 | 182 | 36.862637 | 30.461611 | 197 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.532967 | false | false |
12
|
e90ee23fba068a4db887fc135eaee6a19113ab07
| 27,754,078,670,866 |
ff88a7eb621dfd80f2f0a90271d44b46ec9725ae
|
/app/src/main/java/com/sobesmart/batteryissufficientlycharged/TTSService.java
|
aea518205ee68e807ea01ebed0389ab52c41180f
|
[] |
no_license
|
SoBeSmart123/BatteryIsSufficientlyCharged
|
https://github.com/SoBeSmart123/BatteryIsSufficientlyCharged
|
86f4d634b899c0d21ffaa3cb023f56a0d3ea7204
|
cd1010b3028bf115e8fbef081771599bae7b5387
|
refs/heads/master
| 2021-03-10T20:45:15.175000 | 2020-03-19T08:14:22 | 2020-03-19T08:14:22 | 246,484,382 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.sobesmart.batteryissufficientlycharged;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.widget.Toast;
public class TTSService extends Service {
private TextToSpeech ttobj = null;
public TTSService() {
}
@Override
public void onCreate(){
super.onCreate();
ttobj=new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
}
});
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Toast.makeText(getApplicationContext(), intent.getStringExtra(this.getString(R.string.READ_TEXT)), Toast.LENGTH_SHORT).show();
ttobj.speak(intent.getStringExtra(this.getString(R.string.READ_TEXT)), TextToSpeech.QUEUE_ADD, null);
return Service.START_NOT_STICKY;
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public void onDestroy() {
super.onDestroy();
if (ttobj != null) {
ttobj.stop();
ttobj.shutdown();
}
}
}
|
UTF-8
|
Java
| 1,342 |
java
|
TTSService.java
|
Java
|
[] | null |
[] |
package com.sobesmart.batteryissufficientlycharged;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.widget.Toast;
public class TTSService extends Service {
private TextToSpeech ttobj = null;
public TTSService() {
}
@Override
public void onCreate(){
super.onCreate();
ttobj=new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
}
});
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Toast.makeText(getApplicationContext(), intent.getStringExtra(this.getString(R.string.READ_TEXT)), Toast.LENGTH_SHORT).show();
ttobj.speak(intent.getStringExtra(this.getString(R.string.READ_TEXT)), TextToSpeech.QUEUE_ADD, null);
return Service.START_NOT_STICKY;
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public void onDestroy() {
super.onDestroy();
if (ttobj != null) {
ttobj.stop();
ttobj.shutdown();
}
}
}
| 1,342 | 0.656483 | 0.656483 | 50 | 25.84 | 29.226946 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.46 | false | false |
12
|
a61de55eb6c8f4953f50bb5da02a8229ecf2570b
| 4,346,506,953,953 |
b9aeea6d46aaab270aafb583c5d86b981e3b4bcd
|
/src/main/java/com/example/ex03/movie/controller/ReviewController.java
|
812c652490d87e444071d89e080a7eb2f18628b2
|
[] |
no_license
|
82iirriiss/springBoot_example
|
https://github.com/82iirriiss/springBoot_example
|
1c65336bebe4040a9dcb5f044286ee54f32ba2d4
|
e07739f81a67108ce9278bc2d57e77ae5b3bb2e4
|
refs/heads/main
| 2023-08-25T10:07:00.866000 | 2021-10-09T15:25:27 | 2021-10-09T15:25:27 | 345,997,489 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.ex03.movie.controller;
import com.example.ex03.movie.dto.ReviewDTO;
import com.example.ex03.movie.service.ReviewService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/reviews")
@Log4j2
@RequiredArgsConstructor
public class ReviewController {
private final ReviewService reviewService;
@GetMapping("/{mno}/all")
public ResponseEntity<List<ReviewDTO>> getList(@PathVariable("mno") Long mno){
List<ReviewDTO> result = reviewService.getListOfMovie(mno);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/{mno}")
public ResponseEntity<Long> register(@PathVariable("mno") Long mno, @RequestBody ReviewDTO reviewDTO){
Long reviewnum = reviewService.register(reviewDTO);
return new ResponseEntity<>(reviewnum, HttpStatus.OK);
}
@DeleteMapping("/{mno}/{reviewnum}")
public ResponseEntity<Long> remove(@PathVariable("reviewnum") Long reviewnum){
reviewService.remove(reviewnum);
return new ResponseEntity<>(HttpStatus.OK);
}
@PutMapping("/{mno}/{reviewnum}")
public ResponseEntity<Long> modify(@PathVariable("reviewnum") Long reviewnum, @RequestBody ReviewDTO reviewDTO){
reviewService.modify(reviewDTO);
return new ResponseEntity<>(reviewnum, HttpStatus.OK);
}
}
|
UTF-8
|
Java
| 1,548 |
java
|
ReviewController.java
|
Java
|
[] | null |
[] |
package com.example.ex03.movie.controller;
import com.example.ex03.movie.dto.ReviewDTO;
import com.example.ex03.movie.service.ReviewService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/reviews")
@Log4j2
@RequiredArgsConstructor
public class ReviewController {
private final ReviewService reviewService;
@GetMapping("/{mno}/all")
public ResponseEntity<List<ReviewDTO>> getList(@PathVariable("mno") Long mno){
List<ReviewDTO> result = reviewService.getListOfMovie(mno);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@PostMapping("/{mno}")
public ResponseEntity<Long> register(@PathVariable("mno") Long mno, @RequestBody ReviewDTO reviewDTO){
Long reviewnum = reviewService.register(reviewDTO);
return new ResponseEntity<>(reviewnum, HttpStatus.OK);
}
@DeleteMapping("/{mno}/{reviewnum}")
public ResponseEntity<Long> remove(@PathVariable("reviewnum") Long reviewnum){
reviewService.remove(reviewnum);
return new ResponseEntity<>(HttpStatus.OK);
}
@PutMapping("/{mno}/{reviewnum}")
public ResponseEntity<Long> modify(@PathVariable("reviewnum") Long reviewnum, @RequestBody ReviewDTO reviewDTO){
reviewService.modify(reviewDTO);
return new ResponseEntity<>(reviewnum, HttpStatus.OK);
}
}
| 1,548 | 0.73708 | 0.729974 | 48 | 31.25 | 29.366577 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.479167 | false | false |
12
|
91880d750ed8013acb3d4109c8b026714a5a9253
| 4,346,506,953,541 |
2be4762693ed4fa7d07ca6aa9b7e2b4dfe31d330
|
/src/sample/Main.java
|
efbea0235b128b2a9ebf28e842d912bd497a5059
|
[] |
no_license
|
terselich/Espresso
|
https://github.com/terselich/Espresso
|
9fcba69c94671d071d7f60d366496aaa8b01928c
|
4298035eb47e132ef55129cefcac1a61d81e2a3a
|
refs/heads/master
| 2021-02-26T23:00:32.709000 | 2020-03-07T01:54:36 | 2020-03-07T01:54:36 | 245,557,879 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import sample.controller.LoginController;
import sample.controller.MainController;
import sample.view.ViewFactory;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
ViewFactory view = new ViewFactory(new EmailManager());
view.showLoginFrame();
//view.showMainFrame();
}
public static void main(String[] args) {
launch(args);
}
}
|
UTF-8
|
Java
| 612 |
java
|
Main.java
|
Java
|
[] | null |
[] |
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import sample.controller.LoginController;
import sample.controller.MainController;
import sample.view.ViewFactory;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
ViewFactory view = new ViewFactory(new EmailManager());
view.showLoginFrame();
//view.showMainFrame();
}
public static void main(String[] args) {
launch(args);
}
}
| 612 | 0.730392 | 0.730392 | 27 | 21.666666 | 18.901302 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.481481 | false | false |
12
|
5a74e78b4c8343cb55b30e157fb17acd516d6af6
| 11,381,663,344,140 |
2e075a6532cc90b905d340f83173c887aafcc45b
|
/src/main/java/texas/bean/UserInfo.java
|
9db906f8af99b947b838256127116e2de5c5e4aa
|
[] |
no_license
|
raynwang-xender/MyIDEA
|
https://github.com/raynwang-xender/MyIDEA
|
f615c2a7b54ce17d29275767ed1ce376772aca69
|
0ed9d26ef6de02c5b648cbd8f5f7518dbce60b3a
|
refs/heads/master
| 2022-07-02T10:05:02.211000 | 2019-09-23T10:31:05 | 2019-09-23T10:31:05 | 206,499,358 | 0 | 0 | null | false | 2022-06-17T02:25:47 | 2019-09-05T07:14:20 | 2019-09-23T10:31:13 | 2022-06-17T02:25:47 | 63 | 0 | 0 | 2 |
Java
| false | false |
package texas.bean;
import lombok.Data;
import org.springframework.stereotype.Service;
@Data
@Service
public class UserInfo {
private String openid;
private String nickname;
private String gender;
private String avatarurl;
private String country;
private String city;
private String province;
private String language;
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("{");
sb.append("\"openid\":\"")
.append(openid).append('\"');
sb.append(",\"nickname\":\"")
.append(nickname).append('\"');
sb.append(",\"gender\":\"")
.append(gender).append('\"');
sb.append(",\"avatarurl\":\"")
.append(avatarurl).append('\"');
sb.append(",\"country\":\"")
.append(country).append('\"');
sb.append(",\"city\":\"")
.append(city).append('\"');
sb.append(",\"province\":\"")
.append(province).append('\"');
sb.append(",\"language\":\"")
.append(language).append('\"');
sb.append('}');
return sb.toString();
}
}
|
UTF-8
|
Java
| 1,188 |
java
|
UserInfo.java
|
Java
|
[] | null |
[] |
package texas.bean;
import lombok.Data;
import org.springframework.stereotype.Service;
@Data
@Service
public class UserInfo {
private String openid;
private String nickname;
private String gender;
private String avatarurl;
private String country;
private String city;
private String province;
private String language;
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("{");
sb.append("\"openid\":\"")
.append(openid).append('\"');
sb.append(",\"nickname\":\"")
.append(nickname).append('\"');
sb.append(",\"gender\":\"")
.append(gender).append('\"');
sb.append(",\"avatarurl\":\"")
.append(avatarurl).append('\"');
sb.append(",\"country\":\"")
.append(country).append('\"');
sb.append(",\"city\":\"")
.append(city).append('\"');
sb.append(",\"province\":\"")
.append(province).append('\"');
sb.append(",\"language\":\"")
.append(language).append('\"');
sb.append('}');
return sb.toString();
}
}
| 1,188 | 0.524411 | 0.524411 | 40 | 28.700001 | 15.184202 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.725 | false | false |
12
|
c968d6a75cfd08d8634c69c63416667caadd4cb4
| 30,348,238,954,782 |
8f3c741f353a9573bc804f4ded6017fd7ccac5d2
|
/src/main/java/org/ehrbase/fhirbridge/ehr/converter/specific/patientenaufenthalt/KontaktebeneDefiningCode.java
|
a87ef91ed038f84cb4333f8c3a8ba3958f6f4f2b
|
[] |
no_license
|
ehrbase/fhir-bridge
|
https://github.com/ehrbase/fhir-bridge
|
bbf44b14693b7d5f683bdc652ce5341b3c0ca2f6
|
60e370ecc5657f002f5155f67e7e99f26e03aae5
|
refs/heads/develop
| 2023-04-03T07:47:27.012000 | 2022-09-09T08:58:51 | 2022-09-09T08:58:51 | 305,756,851 | 27 | 17 | null | false | 2023-03-21T13:14:21 | 2020-10-20T15:44:11 | 2023-03-09T16:19:09 | 2023-03-21T13:14:21 | 16,252 | 23 | 13 | 23 |
Java
| false | false |
package org.ehrbase.fhirbridge.ehr.converter.specific.patientenaufenthalt;
import org.ehrbase.client.classgenerator.EnumValueSet;
public enum KontaktebeneDefiningCode implements EnumValueSet {
EINRICHTUNGS_KONTAKT("Einrichtungskontakt", "Beschreibt den Kontakt zur Einrichtung.", "", "einrichtungskontakt"),
ABTEILUNGS_KONTAKT("Abteilungskontakt", "Beschreibt den Kontakt zur Abteilung.", "", "abteilungskontakt"),
VERSORGUNGS_STELLEN_KONTAKT("Versorgungsstellenkontakt", "Beschreibt den Kontakt zur Versorgungsstelle.", "", "versorgungsstellenkontakt");
private String value;
private String description;
private String terminologyId;
private String code;
KontaktebeneDefiningCode(String value, String description, String terminologyId, String code) {
this.value = value;
this.description = description;
this.terminologyId = terminologyId;
this.code = code;
}
public String getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
public String getTerminologyId() {
return this.terminologyId;
}
public String getCode() {
return this.code;
}
}
|
UTF-8
|
Java
| 1,226 |
java
|
KontaktebeneDefiningCode.java
|
Java
|
[] | null |
[] |
package org.ehrbase.fhirbridge.ehr.converter.specific.patientenaufenthalt;
import org.ehrbase.client.classgenerator.EnumValueSet;
public enum KontaktebeneDefiningCode implements EnumValueSet {
EINRICHTUNGS_KONTAKT("Einrichtungskontakt", "Beschreibt den Kontakt zur Einrichtung.", "", "einrichtungskontakt"),
ABTEILUNGS_KONTAKT("Abteilungskontakt", "Beschreibt den Kontakt zur Abteilung.", "", "abteilungskontakt"),
VERSORGUNGS_STELLEN_KONTAKT("Versorgungsstellenkontakt", "Beschreibt den Kontakt zur Versorgungsstelle.", "", "versorgungsstellenkontakt");
private String value;
private String description;
private String terminologyId;
private String code;
KontaktebeneDefiningCode(String value, String description, String terminologyId, String code) {
this.value = value;
this.description = description;
this.terminologyId = terminologyId;
this.code = code;
}
public String getValue() {
return this.value;
}
public String getDescription() {
return this.description;
}
public String getTerminologyId() {
return this.terminologyId;
}
public String getCode() {
return this.code;
}
}
| 1,226 | 0.712072 | 0.712072 | 43 | 27.511627 | 34.783966 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.674419 | false | false |
12
|
32edb2cbae8241c6cb992ecd86d1c5d531629765
| 6,055,903,951,944 |
325cf065b168efc6b00f90fb04e0f45e6a349928
|
/src/main/java/id/web/ard/springbootwebfluxmongodbreactive/SpringBootWebfluxMongodbReactiveApplication.java
|
715e644fe8b5a230e9dc3a03c1974737bffb3d8f
|
[
"Apache-2.0"
] |
permissive
|
ard333/spring-boot-webflux-mongodb-reactive
|
https://github.com/ard333/spring-boot-webflux-mongodb-reactive
|
3807b0a05421e390c671cdb9fe0f326641b2dc08
|
d979714f1d867c385b6b9c6eaad0365f80efdb95
|
refs/heads/master
| 2021-04-28T04:45:32.680000 | 2018-03-06T07:04:13 | 2018-03-06T07:04:13 | 122,167,079 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package id.web.ard.springbootwebfluxmongodbreactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootWebfluxMongodbReactiveApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootWebfluxMongodbReactiveApplication.class, args);
}
}
|
UTF-8
|
Java
| 387 |
java
|
SpringBootWebfluxMongodbReactiveApplication.java
|
Java
|
[] | null |
[] |
package id.web.ard.springbootwebfluxmongodbreactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootWebfluxMongodbReactiveApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootWebfluxMongodbReactiveApplication.class, args);
}
}
| 387 | 0.855297 | 0.855297 | 12 | 31.25 | 29.160833 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | false | false |
12
|
3a991ff68f598083fe8fdf67c722231eda5c5649
| 6,055,903,952,043 |
3a549caec9f93a1f6e2398e238bae5302a63ed2b
|
/src/test/java/_JDBC/Gun2/_01_SQLEx.java
|
9fc887954380529c14dac9c5537d87b077ad2307
|
[] |
no_license
|
AbdullahDmrl/Cucumber_Kurs
|
https://github.com/AbdullahDmrl/Cucumber_Kurs
|
642983b337053469db06c4766a2864bce7aee3c8
|
7beeaf1c232fd4e795b0d2bf57fd1478415b783b
|
refs/heads/master
| 2023-08-23T18:52:11.955000 | 2021-09-26T13:47:55 | 2021-09-26T13:47:55 | 408,074,463 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package _JDBC.Gun2;
import _JDBC._JDBCParent;
import org.testng.annotations.Test;
import java.sql.ResultSet;
import java.sql.SQLException;
// // address tablosundaki teki disrict alanını önce 10.satırdakini sonra, 22.satırdaki,
// // sonra en son satırdaki bilgisini yazdırınız.
public class _01_SQLEx extends _JDBCParent {
@Test
private void test1() throws SQLException {
ResultSet rs = statement.executeQuery("select * from address");
rs.absolute(10);
String district= rs.getString("district");
System.out.println("district 10 = "+district);
rs.absolute(22); // rs.relative(12);
district= rs.getString("district");
System.out.println("district 22 = "+district);
rs.last();
district= rs.getString("district");
System.out.println("district last = "+district);
}
}
|
UTF-8
|
Java
| 888 |
java
|
_01_SQLEx.java
|
Java
|
[] | null |
[] |
package _JDBC.Gun2;
import _JDBC._JDBCParent;
import org.testng.annotations.Test;
import java.sql.ResultSet;
import java.sql.SQLException;
// // address tablosundaki teki disrict alanını önce 10.satırdakini sonra, 22.satırdaki,
// // sonra en son satırdaki bilgisini yazdırınız.
public class _01_SQLEx extends _JDBCParent {
@Test
private void test1() throws SQLException {
ResultSet rs = statement.executeQuery("select * from address");
rs.absolute(10);
String district= rs.getString("district");
System.out.println("district 10 = "+district);
rs.absolute(22); // rs.relative(12);
district= rs.getString("district");
System.out.println("district 22 = "+district);
rs.last();
district= rs.getString("district");
System.out.println("district last = "+district);
}
}
| 888 | 0.654152 | 0.633675 | 32 | 26.46875 | 25.195467 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5625 | false | false |
12
|
9780c3bf5a15e65606c9de993ba79da57eec12f3
| 8,572,754,744,850 |
2e414f8beaaa9e7529b24a710899c99da1876a62
|
/app/src/main/java/com/example/qkx/myshare/choose/RecyclerAdapter.java
|
00dd05266be1e8582102dde187b83fa30e93a22a
|
[
"Apache-2.0"
] |
permissive
|
quekx/MyShare
|
https://github.com/quekx/MyShare
|
5eb3dff66467f16ba9b0239edae25b280e167297
|
a5fffc43f51504519b826b233cf17d43afbb3ab7
|
refs/heads/master
| 2021-01-20T18:02:00.047000 | 2016-06-16T10:34:42 | 2016-06-16T10:34:42 | 61,284,346 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.qkx.myshare.choose;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import com.example.qkx.myshare.R;
import com.example.qkx.myshare.utils.NativeImageLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by qkx on 16/6/3.
*/
public class RecyclerAdapter extends RecyclerView.Adapter {
private static final String TAG = "RecyclerAdapter";
private Context mContext;
private List<String> mData;
private LayoutInflater mInflater;
private RecyclerView parent;
private Map<Integer, Boolean> selectedMap;
public RecyclerAdapter(Context context, List<String> data, RecyclerView recyclerView) {
this.mContext = context;
this.mData = data;
this.mInflater = LayoutInflater.from(context);
this.parent = recyclerView;
this.selectedMap = new HashMap<>();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = mInflater.inflate(R.layout.view_item_choose, parent, false);
ItemViewHolder itemViewHolder = new ItemViewHolder(v);
return itemViewHolder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
String path = mData.get(position);
Log.d("path:", path);
final ItemViewHolder viewHolder = (ItemViewHolder) holder;
viewHolder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
selectedMap.put(position, isChecked);
}
});
viewHolder.imageView.setTag(path);
viewHolder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
viewHolder.checkBox.setChecked(!viewHolder.checkBox.isChecked());
}
});
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
// int width = wm.getDefaultDisplay().getWidth();
DisplayMetrics outMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(outMetrics);
int width = outMetrics.widthPixels / 3;
// Bitmap mBitmap = NativeImageLoader.getInstance().loadNativeImage(path, new NativeImageLoader.MyPoint(100, 100),
Bitmap mBitmap = NativeImageLoader.getInstance().loadNativeImage(path, new NativeImageLoader.MyPoint(width, width),
new NativeImageLoader.NativeImageCallback() {
@Override
public void onImageLoad(Bitmap bitmap, String path) {
ImageView imageView = (ImageView) parent.findViewWithTag(path);
if (bitmap != null && imageView != null) {
imageView.setImageBitmap(bitmap);
}
}
});
if (mBitmap != null) {
viewHolder.imageView.setImageBitmap(mBitmap);
} else {
viewHolder.imageView.setImageResource(R.drawable.loading);
}
}
@Override
public int getItemCount() {
return mData.size();
}
public List<String> getSelectedPaths() {
List<String> list = new ArrayList<>();
for (Map.Entry<Integer, Boolean> entry : selectedMap.entrySet()) {
if (entry.getValue()) {
list.add(mData.get(entry.getKey()));
}
}
return list;
}
class ItemViewHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public CheckBox checkBox;
public ItemViewHolder(View itemView) {
super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.iv_photo);
checkBox = (CheckBox) itemView.findViewById(R.id.chk_choose);
}
}
}
|
UTF-8
|
Java
| 4,345 |
java
|
RecyclerAdapter.java
|
Java
|
[
{
"context": "til.List;\nimport java.util.Map;\n\n/**\n * Created by qkx on 16/6/3.\n */\npublic class RecyclerAdapter exten",
"end": 657,
"score": 0.9996662139892578,
"start": 654,
"tag": "USERNAME",
"value": "qkx"
}
] | null |
[] |
package com.example.qkx.myshare.choose;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import com.example.qkx.myshare.R;
import com.example.qkx.myshare.utils.NativeImageLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by qkx on 16/6/3.
*/
public class RecyclerAdapter extends RecyclerView.Adapter {
private static final String TAG = "RecyclerAdapter";
private Context mContext;
private List<String> mData;
private LayoutInflater mInflater;
private RecyclerView parent;
private Map<Integer, Boolean> selectedMap;
public RecyclerAdapter(Context context, List<String> data, RecyclerView recyclerView) {
this.mContext = context;
this.mData = data;
this.mInflater = LayoutInflater.from(context);
this.parent = recyclerView;
this.selectedMap = new HashMap<>();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = mInflater.inflate(R.layout.view_item_choose, parent, false);
ItemViewHolder itemViewHolder = new ItemViewHolder(v);
return itemViewHolder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
String path = mData.get(position);
Log.d("path:", path);
final ItemViewHolder viewHolder = (ItemViewHolder) holder;
viewHolder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
selectedMap.put(position, isChecked);
}
});
viewHolder.imageView.setTag(path);
viewHolder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
viewHolder.checkBox.setChecked(!viewHolder.checkBox.isChecked());
}
});
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
// int width = wm.getDefaultDisplay().getWidth();
DisplayMetrics outMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(outMetrics);
int width = outMetrics.widthPixels / 3;
// Bitmap mBitmap = NativeImageLoader.getInstance().loadNativeImage(path, new NativeImageLoader.MyPoint(100, 100),
Bitmap mBitmap = NativeImageLoader.getInstance().loadNativeImage(path, new NativeImageLoader.MyPoint(width, width),
new NativeImageLoader.NativeImageCallback() {
@Override
public void onImageLoad(Bitmap bitmap, String path) {
ImageView imageView = (ImageView) parent.findViewWithTag(path);
if (bitmap != null && imageView != null) {
imageView.setImageBitmap(bitmap);
}
}
});
if (mBitmap != null) {
viewHolder.imageView.setImageBitmap(mBitmap);
} else {
viewHolder.imageView.setImageResource(R.drawable.loading);
}
}
@Override
public int getItemCount() {
return mData.size();
}
public List<String> getSelectedPaths() {
List<String> list = new ArrayList<>();
for (Map.Entry<Integer, Boolean> entry : selectedMap.entrySet()) {
if (entry.getValue()) {
list.add(mData.get(entry.getKey()));
}
}
return list;
}
class ItemViewHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public CheckBox checkBox;
public ItemViewHolder(View itemView) {
super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.iv_photo);
checkBox = (CheckBox) itemView.findViewById(R.id.chk_choose);
}
}
}
| 4,345 | 0.653165 | 0.650403 | 124 | 34.040321 | 28.360126 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.629032 | false | false |
12
|
531b59bdaeed3e109aaae82be7e7f2cefff63d3b
| 18,700,287,623,644 |
eeee719c94f720072698f13a457c50837f580d8a
|
/bms-seller-product-api/src/main/java/com/bms/slpd/bean/param/field/SLPD0613IGnqStdParam.java
|
a7a920f6b0e6a1ee133c313701f0e571e7fdaa4c
|
[] |
no_license
|
moutainhigh/xcdv2
|
https://github.com/moutainhigh/xcdv2
|
c4f21ce874b2c415eb8bc20997e9f0bf31e9b14d
|
23b6c33d45ff86d6bc8dcf014798f70c70b46f24
|
refs/heads/master
| 2021-06-28T05:06:58.529000 | 2017-08-15T11:28:33 | 2017-08-15T11:29:05 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* 2017/02/09 自动生成 新规作成
*
* (c) 江苏润和
*/
package com.bms.slpd.bean.param.field;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
/**
*通用指标标准指标标准档案卡
* @version 1.0.0
*/
public class SLPD0613IGnqStdParam implements Serializable {
/** 序列号 */
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "通用指标ID")
private Long gnqStdId;
@ApiModelProperty(value = "通用指标类型")
private String gnqStdType;
@ApiModelProperty(value = "品种ID")
private Long breedId;
@ApiModelProperty(value = "合格值")
private String gnqOkVal;
@ApiModelProperty(value = "不合格值")
private String gnqNgVal;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标识")
private boolean delFlg;
@ApiModelProperty(value = "版本号")
private Integer version;
public Long getGnqStdId() {
return gnqStdId;
}
public void setGnqStdId(Long gnqStdId) {
this.gnqStdId = gnqStdId;
}
public String getGnqStdType() {
return gnqStdType;
}
public void setGnqStdType(String gnqStdType) {
this.gnqStdType = gnqStdType;
}
public Long getBreedId() {
return breedId;
}
public void setBreedId(Long breedId) {
this.breedId = breedId;
}
public String getGnqOkVal() {
return gnqOkVal;
}
public void setGnqOkVal(String gnqOkVal) {
this.gnqOkVal = gnqOkVal;
}
public String getGnqNgVal() {
return gnqNgVal;
}
public void setGnqNgVal(String gnqNgVal) {
this.gnqNgVal = gnqNgVal;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public boolean isDelFlg() {
return delFlg;
}
public void setDelFlg(boolean delFlg) {
this.delFlg = delFlg;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
|
UTF-8
|
Java
| 2,206 |
java
|
SLPD0613IGnqStdParam.java
|
Java
|
[
{
"context": "/*\n * 2017/02/09 自动生成 新规作成\n *\n * (c) 江苏润和\n */\npackage com.bms.slpd.bean.param.field;\n\nimpor",
"end": 41,
"score": 0.9998320937156677,
"start": 37,
"tag": "NAME",
"value": "江苏润和"
}
] | null |
[] |
/*
* 2017/02/09 自动生成 新规作成
*
* (c) 江苏润和
*/
package com.bms.slpd.bean.param.field;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
/**
*通用指标标准指标标准档案卡
* @version 1.0.0
*/
public class SLPD0613IGnqStdParam implements Serializable {
/** 序列号 */
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "通用指标ID")
private Long gnqStdId;
@ApiModelProperty(value = "通用指标类型")
private String gnqStdType;
@ApiModelProperty(value = "品种ID")
private Long breedId;
@ApiModelProperty(value = "合格值")
private String gnqOkVal;
@ApiModelProperty(value = "不合格值")
private String gnqNgVal;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标识")
private boolean delFlg;
@ApiModelProperty(value = "版本号")
private Integer version;
public Long getGnqStdId() {
return gnqStdId;
}
public void setGnqStdId(Long gnqStdId) {
this.gnqStdId = gnqStdId;
}
public String getGnqStdType() {
return gnqStdType;
}
public void setGnqStdType(String gnqStdType) {
this.gnqStdType = gnqStdType;
}
public Long getBreedId() {
return breedId;
}
public void setBreedId(Long breedId) {
this.breedId = breedId;
}
public String getGnqOkVal() {
return gnqOkVal;
}
public void setGnqOkVal(String gnqOkVal) {
this.gnqOkVal = gnqOkVal;
}
public String getGnqNgVal() {
return gnqNgVal;
}
public void setGnqNgVal(String gnqNgVal) {
this.gnqNgVal = gnqNgVal;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public boolean isDelFlg() {
return delFlg;
}
public void setDelFlg(boolean delFlg) {
this.delFlg = delFlg;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
| 2,206 | 0.632283 | 0.624642 | 101 | 19.732674 | 16.504959 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.287129 | false | false |
12
|
2d24a2a1a2a5970e3c3e7426a784a3a073305f98
| 18,700,287,622,930 |
1adcd4faf4ec8e93937d36caa4a2ce02300789a7
|
/src/Exercitiul13.java
|
725e10af937cd660c9a1f8a6d97de87b36408dc5
|
[] |
no_license
|
TREQA/ConstantinMocanu
|
https://github.com/TREQA/ConstantinMocanu
|
4e0a377b345df2540dd91105bc91d4e3cc73aa90
|
617749b959462561fb9e5439d91c3f7a4714796f
|
refs/heads/master
| 2021-06-25T01:10:44.487000 | 2017-08-24T11:58:01 | 2017-08-24T11:58:01 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*Este dat următorul şir de numere:
int[] arr = {1,2,3,4,5,6,7,8,9,10};
Trebuie să listăm şirul dat folosind
bucla do-while
*/
public class Exercitiul13
{
public static void main (String[]args)
{
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int x = 0;
do {
System.out.println(arr[x]);
x++;
} while (x<arr.length);
}
}
|
UTF-8
|
Java
| 394 |
java
|
Exercitiul13.java
|
Java
|
[] | null |
[] |
/*Este dat următorul şir de numere:
int[] arr = {1,2,3,4,5,6,7,8,9,10};
Trebuie să listăm şirul dat folosind
bucla do-while
*/
public class Exercitiul13
{
public static void main (String[]args)
{
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int x = 0;
do {
System.out.println(arr[x]);
x++;
} while (x<arr.length);
}
}
| 394 | 0.514139 | 0.449871 | 19 | 19.473684 | 16.378319 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.263158 | false | false |
12
|
7bace58916a1187eb9d1f5f6a47535dff05fd481
| 8,306,466,782,658 |
7e549df46c1d0cf4a5f4be0fbc412af6a9a732cc
|
/src/main/java/net/mybluemix/asmilk/web/WechatController.java
|
bcbd1b311e93f4288b7291bc660747040d299a23
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
asmilk/asmilk
|
https://github.com/asmilk/asmilk
|
666b75639922a552b10b67e582f779a5f7e6f192
|
6d79cbf7654b49e9ab483128fed618e50dbc9fe9
|
refs/heads/master
| 2020-05-21T13:49:24.673000 | 2017-06-08T02:38:23 | 2017-06-08T02:38:23 | 63,148,422 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package net.mybluemix.asmilk.web;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import java.io.IOException;
import javax.xml.xpath.XPathExpressionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.xml.sax.SAXException;
import net.mybluemix.asmilk.service.WechatService;
@Controller
@RequestMapping("/wechat")
public class WechatController {
private static final Logger LOG = LoggerFactory.getLogger(WechatController.class);
@Autowired
private WechatService wechatService;
// @RequestMapping(path = "/login", method = GET, headers =
// "Accept=application/json")
// public Account login() {
// Account account = new Account();
// account.setId(123456L);
// account.setName("cnjcndjs");
// return account;
// }
//
// @RequestMapping(path = "/save", method = PUT, consumes =
// "application/json")
// public void save(@RequestBody Account account) {
// LOG.info("account: {}", account);
// }
@RequestMapping(path = "/", method = GET)
public String jsLogin(Model model) throws IOException, SAXException, XPathExpressionException {
String uuid = this.wechatService.jsLogin();
LOG.info("uuid: {}", uuid);
model.addAttribute("uuid", uuid);
return "wechat";
}
}
|
UTF-8
|
Java
| 1,512 |
java
|
WechatController.java
|
Java
|
[
{
"context": "\t// account.setId(123456L);\r\n\t// account.setName(\"cnjcndjs\");\r\n\t// return account;\r\n\t// }\r\n\t//\r\n\t// @Request",
"end": 999,
"score": 0.7761616706848145,
"start": 991,
"tag": "USERNAME",
"value": "cnjcndjs"
}
] | null |
[] |
package net.mybluemix.asmilk.web;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import java.io.IOException;
import javax.xml.xpath.XPathExpressionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.xml.sax.SAXException;
import net.mybluemix.asmilk.service.WechatService;
@Controller
@RequestMapping("/wechat")
public class WechatController {
private static final Logger LOG = LoggerFactory.getLogger(WechatController.class);
@Autowired
private WechatService wechatService;
// @RequestMapping(path = "/login", method = GET, headers =
// "Accept=application/json")
// public Account login() {
// Account account = new Account();
// account.setId(123456L);
// account.setName("cnjcndjs");
// return account;
// }
//
// @RequestMapping(path = "/save", method = PUT, consumes =
// "application/json")
// public void save(@RequestBody Account account) {
// LOG.info("account: {}", account);
// }
@RequestMapping(path = "/", method = GET)
public String jsLogin(Model model) throws IOException, SAXException, XPathExpressionException {
String uuid = this.wechatService.jsLogin();
LOG.info("uuid: {}", uuid);
model.addAttribute("uuid", uuid);
return "wechat";
}
}
| 1,512 | 0.723545 | 0.718254 | 51 | 27.647058 | 23.953241 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.196078 | false | false |
12
|
6eb4730f1b9aa3e0fd336a5c5c86791aba2489cd
| 30,760,555,794,419 |
49bcb86ce2b87a4d81203d1acbb07ba34b07d420
|
/account-biz/src/main/java/com/tongbanjie/account/antitrash/sensitive/SensitivewordFilter.java
|
b05b9195cc88cb209ac49d57dd307e30f8197b40
|
[] |
no_license
|
xuneng/acc
|
https://github.com/xuneng/acc
|
39345e6d03dc1135423590aa44e167675181687b
|
6cce1f340e05953b8bb1fe462d0eb226fbc94c24
|
refs/heads/master
| 2016-09-19T10:24:07.859000 | 2016-09-10T02:29:09 | 2016-09-10T02:29:09 | 67,845,613 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.tongbanjie.account.antitrash.sensitive;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import com.tongbanjie.account.service.impl.AntiTrashDiamondConfigLoader;
/**
*
* @author dingxiu
*
*/
@Service
public class SensitivewordFilter implements ApplicationListener<ContextRefreshedEvent> {
@SuppressWarnings("rawtypes")
private Map sensitiveWordMap;
// 自动刷新敏感词缓存的版本号,diamond配置中的版本号比默认版本号大。会自动刷新缓存
private volatile int updateCacheVersion = 0;
// 缓存刷新次数
private int updateCacheTimes = 0;
// 缓存最大刷新次数
private static int UPDATE_MAX_TIMES = 50;
// 最小匹配规则
public static int MIN_MATCH_TYPE = 1;
// 最大匹配规则
public static int MAX_MATCH_TYPE = 2;
@Autowired
private SensitiveWordInit sensitiveWordInit;
public boolean isContainSensitiveWord(String txt,int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return false;
}
// 检查是否有必要刷新缓存
checkCache();
boolean flag = false;
for(int i = 0 ; i < txt.length() ; i++){
int matchFlag = this.CheckSensitiveWord(txt, i, matchType);
if(matchFlag > 0){
flag = true;
}
}
return flag;
}
public Set<String> getSensitiveWord(String txt , int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return null;
}
// 检查是否有必要刷新缓存
checkCache();
Set<String> sensitiveWordList = new HashSet<String>();
for(int i = 0 ; i < txt.length() ; i++){
int length = CheckSensitiveWord(txt, i, matchType);
if(length > 0){
sensitiveWordList.add(txt.substring(i, i+length));
i = i + length - 1;
}
}
return sensitiveWordList;
}
public String replaceSensitiveWord(String txt,int matchType,String replaceChar){
String resultTxt = txt;
Set<String> set = getSensitiveWord(txt, matchType);
Iterator<String> iterator = set.iterator();
String word = null;
String replaceString = null;
while (iterator.hasNext()) {
word = iterator.next();
replaceString = getReplaceChars(replaceChar, word.length());
resultTxt = resultTxt.replaceAll(word, replaceString);
}
return resultTxt;
}
private String getReplaceChars(String replaceChar,int length){
String resultReplace = replaceChar;
for(int i = 1 ; i < length ; i++){
resultReplace += replaceChar;
}
return resultReplace;
}
@SuppressWarnings({ "rawtypes"})
public int CheckSensitiveWord(String txt,int beginIndex,int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return 0;
}
// 检查是否有必要刷新缓存
checkCache();
boolean flag = false;
int matchFlag = 0;
char word = 0;
Map nowMap = sensitiveWordMap;
for(int i = beginIndex; i < txt.length() ; i++){
word = txt.charAt(i);
if (word >= 'A' && word <= 'Z') {
word += 32;
}
nowMap = (Map) nowMap.get(word);
if(nowMap != null){
matchFlag++;
if("1".equals(nowMap.get("isEnd"))){
flag = true;
if(SensitivewordFilter.MIN_MATCH_TYPE == matchType){
break;
}
}
}
else{
break;
}
}
if(matchFlag < 2 || !flag){
matchFlag = 0;
}
return matchFlag;
}
/**
* 检测更新版本号是否发生变化来确定刷新缓存
* @return
*/
private void checkCache() {
int newVersion = AntiTrashDiamondConfigLoader.getUpdateSensitiveWordsCacheVersion();
if (newVersion > updateCacheVersion) {
initKeyWord();
}
return;
}
private synchronized void initKeyWord() {
int newVersion = AntiTrashDiamondConfigLoader.getUpdateSensitiveWordsCacheVersion();
if (newVersion > updateCacheVersion) {
// 防止异常情况, 刷新次数太多
if (updateCacheTimes > UPDATE_MAX_TIMES) {
return;
}
updateCacheTimes++;
sensitiveWordMap = sensitiveWordInit.initKeyWord();
updateCacheVersion = newVersion;
}
}
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
sensitiveWordMap = sensitiveWordInit.initKeyWord();
}
}
|
UTF-8
|
Java
| 4,505 |
java
|
SensitivewordFilter.java
|
Java
|
[
{
"context": ".AntiTrashDiamondConfigLoader;\n\n/**\n * \n * @author dingxiu\n *\n */\n@Service\npublic class SensitivewordFilter ",
"end": 482,
"score": 0.9994913935661316,
"start": 475,
"tag": "USERNAME",
"value": "dingxiu"
}
] | null |
[] |
package com.tongbanjie.account.antitrash.sensitive;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import com.tongbanjie.account.service.impl.AntiTrashDiamondConfigLoader;
/**
*
* @author dingxiu
*
*/
@Service
public class SensitivewordFilter implements ApplicationListener<ContextRefreshedEvent> {
@SuppressWarnings("rawtypes")
private Map sensitiveWordMap;
// 自动刷新敏感词缓存的版本号,diamond配置中的版本号比默认版本号大。会自动刷新缓存
private volatile int updateCacheVersion = 0;
// 缓存刷新次数
private int updateCacheTimes = 0;
// 缓存最大刷新次数
private static int UPDATE_MAX_TIMES = 50;
// 最小匹配规则
public static int MIN_MATCH_TYPE = 1;
// 最大匹配规则
public static int MAX_MATCH_TYPE = 2;
@Autowired
private SensitiveWordInit sensitiveWordInit;
public boolean isContainSensitiveWord(String txt,int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return false;
}
// 检查是否有必要刷新缓存
checkCache();
boolean flag = false;
for(int i = 0 ; i < txt.length() ; i++){
int matchFlag = this.CheckSensitiveWord(txt, i, matchType);
if(matchFlag > 0){
flag = true;
}
}
return flag;
}
public Set<String> getSensitiveWord(String txt , int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return null;
}
// 检查是否有必要刷新缓存
checkCache();
Set<String> sensitiveWordList = new HashSet<String>();
for(int i = 0 ; i < txt.length() ; i++){
int length = CheckSensitiveWord(txt, i, matchType);
if(length > 0){
sensitiveWordList.add(txt.substring(i, i+length));
i = i + length - 1;
}
}
return sensitiveWordList;
}
public String replaceSensitiveWord(String txt,int matchType,String replaceChar){
String resultTxt = txt;
Set<String> set = getSensitiveWord(txt, matchType);
Iterator<String> iterator = set.iterator();
String word = null;
String replaceString = null;
while (iterator.hasNext()) {
word = iterator.next();
replaceString = getReplaceChars(replaceChar, word.length());
resultTxt = resultTxt.replaceAll(word, replaceString);
}
return resultTxt;
}
private String getReplaceChars(String replaceChar,int length){
String resultReplace = replaceChar;
for(int i = 1 ; i < length ; i++){
resultReplace += replaceChar;
}
return resultReplace;
}
@SuppressWarnings({ "rawtypes"})
public int CheckSensitiveWord(String txt,int beginIndex,int matchType){
// 敏感词过滤开关是否打开
if (!AntiTrashDiamondConfigLoader.isInvokeSensitiveWordsFilter()) {
return 0;
}
// 检查是否有必要刷新缓存
checkCache();
boolean flag = false;
int matchFlag = 0;
char word = 0;
Map nowMap = sensitiveWordMap;
for(int i = beginIndex; i < txt.length() ; i++){
word = txt.charAt(i);
if (word >= 'A' && word <= 'Z') {
word += 32;
}
nowMap = (Map) nowMap.get(word);
if(nowMap != null){
matchFlag++;
if("1".equals(nowMap.get("isEnd"))){
flag = true;
if(SensitivewordFilter.MIN_MATCH_TYPE == matchType){
break;
}
}
}
else{
break;
}
}
if(matchFlag < 2 || !flag){
matchFlag = 0;
}
return matchFlag;
}
/**
* 检测更新版本号是否发生变化来确定刷新缓存
* @return
*/
private void checkCache() {
int newVersion = AntiTrashDiamondConfigLoader.getUpdateSensitiveWordsCacheVersion();
if (newVersion > updateCacheVersion) {
initKeyWord();
}
return;
}
private synchronized void initKeyWord() {
int newVersion = AntiTrashDiamondConfigLoader.getUpdateSensitiveWordsCacheVersion();
if (newVersion > updateCacheVersion) {
// 防止异常情况, 刷新次数太多
if (updateCacheTimes > UPDATE_MAX_TIMES) {
return;
}
updateCacheTimes++;
sensitiveWordMap = sensitiveWordInit.initKeyWord();
updateCacheVersion = newVersion;
}
}
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
sensitiveWordMap = sensitiveWordInit.initKeyWord();
}
}
| 4,505 | 0.699976 | 0.695195 | 175 | 22.902857 | 22.367239 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.28 | false | false |
12
|
b1bc7fe2974f715af59b70099bda5dddcb04625f
| 30,760,555,795,626 |
6898f95c803a8db2c18e34c63c2068b924f5101d
|
/src/main/java/com/idcq/appserver/dto/activity/BusinessAreaShopDto.java
|
98f3b9f94f1f3d7ab74b6a074b7c2eb6eb10c3e5
|
[] |
no_license
|
moutainhigh/appserver
|
https://github.com/moutainhigh/appserver
|
e3fee89b627e47f40bfd155f4f8dff071049e2d1
|
bb0786c4cb6a7fbbe7f21d06ba6e7e6e3a5015bd
|
refs/heads/master
| 2023-06-27T06:31:27.657000 | 2019-06-12T02:18:34 | 2019-06-12T02:18:34 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.idcq.appserver.dto.activity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class BusinessAreaShopDto extends BusinessAreaShopKeyDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = 4998517226120168426L;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.shop_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer shopType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.status
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.member_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer memberNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_order_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer redpacketOrderNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_used_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer redpacketUsedNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_used_money
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Double redpacketUsedMoney;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.join_time
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Date joinTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.join_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer joinType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.client_system_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer clientSystemType;
private List<Long>activityIdList;
private Long cityId;
private Integer activityStatus;
public BusinessAreaShopDto() {
super();
// TODO Auto-generated constructor stub
}
public Integer getShopType() {
return shopType;
}
public void setShopType(Integer shopType) {
this.shopType = shopType;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getMemberNum() {
return memberNum;
}
public void setMemberNum(Integer memberNum) {
this.memberNum = memberNum;
}
public Integer getRedpacketOrderNum() {
return redpacketOrderNum;
}
public void setRedpacketOrderNum(Integer redpacketOrderNum) {
this.redpacketOrderNum = redpacketOrderNum;
}
public Integer getRedpacketUsedNum() {
return redpacketUsedNum;
}
public void setRedpacketUsedNum(Integer redpacketUsedNum) {
this.redpacketUsedNum = redpacketUsedNum;
}
public Double getRedpacketUsedMoney() {
return redpacketUsedMoney;
}
public void setRedpacketUsedMoney(Double redpacketUsedMoney) {
this.redpacketUsedMoney = redpacketUsedMoney;
}
public Date getJoinTime() {
return joinTime;
}
public void setJoinTime(Date joinTime) {
this.joinTime = joinTime;
}
public Integer getJoinType() {
return joinType;
}
public void setJoinType(Integer joinType) {
this.joinType = joinType;
}
public Integer getClientSystemType() {
return clientSystemType;
}
public void setClientSystemType(Integer clientSystemType) {
this.clientSystemType = clientSystemType;
}
@Override
public String toString() {
return "BusinessAreaShopDto [shopType=" + shopType + ", status="
+ status + ", memberNum=" + memberNum + ", redpacketOrderNum="
+ redpacketOrderNum + ", redpacketUsedNum=" + redpacketUsedNum
+ ", redpacketUsedMoney=" + redpacketUsedMoney + ", joinTime="
+ joinTime + ", joinType=" + joinType + ", clientSystemType="
+ clientSystemType + "]";
}
public List<Long> getActivityIdList() {
return activityIdList;
}
public void setActivityIdList(List<Long> activityIdList) {
this.activityIdList = activityIdList;
}
public Long getCityId() {
return cityId;
}
public void setCityId(Long cityId) {
this.cityId = cityId;
}
public Integer getActivityStatus() {
return activityStatus;
}
public void setActivityStatus(Integer activityStatus) {
this.activityStatus = activityStatus;
}
}
|
UTF-8
|
Java
| 5,019 |
java
|
BusinessAreaShopDto.java
|
Java
|
[] | null |
[] |
package com.idcq.appserver.dto.activity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class BusinessAreaShopDto extends BusinessAreaShopKeyDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = 4998517226120168426L;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.shop_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer shopType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.status
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.member_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer memberNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_order_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer redpacketOrderNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_used_num
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer redpacketUsedNum;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.redpacket_used_money
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Double redpacketUsedMoney;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.join_time
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Date joinTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.join_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer joinType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column 1dcq_business_area_shop.client_system_type
*
* @mbggenerated Sat Mar 12 12:05:17 CST 2016
*/
private Integer clientSystemType;
private List<Long>activityIdList;
private Long cityId;
private Integer activityStatus;
public BusinessAreaShopDto() {
super();
// TODO Auto-generated constructor stub
}
public Integer getShopType() {
return shopType;
}
public void setShopType(Integer shopType) {
this.shopType = shopType;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getMemberNum() {
return memberNum;
}
public void setMemberNum(Integer memberNum) {
this.memberNum = memberNum;
}
public Integer getRedpacketOrderNum() {
return redpacketOrderNum;
}
public void setRedpacketOrderNum(Integer redpacketOrderNum) {
this.redpacketOrderNum = redpacketOrderNum;
}
public Integer getRedpacketUsedNum() {
return redpacketUsedNum;
}
public void setRedpacketUsedNum(Integer redpacketUsedNum) {
this.redpacketUsedNum = redpacketUsedNum;
}
public Double getRedpacketUsedMoney() {
return redpacketUsedMoney;
}
public void setRedpacketUsedMoney(Double redpacketUsedMoney) {
this.redpacketUsedMoney = redpacketUsedMoney;
}
public Date getJoinTime() {
return joinTime;
}
public void setJoinTime(Date joinTime) {
this.joinTime = joinTime;
}
public Integer getJoinType() {
return joinType;
}
public void setJoinType(Integer joinType) {
this.joinType = joinType;
}
public Integer getClientSystemType() {
return clientSystemType;
}
public void setClientSystemType(Integer clientSystemType) {
this.clientSystemType = clientSystemType;
}
@Override
public String toString() {
return "BusinessAreaShopDto [shopType=" + shopType + ", status="
+ status + ", memberNum=" + memberNum + ", redpacketOrderNum="
+ redpacketOrderNum + ", redpacketUsedNum=" + redpacketUsedNum
+ ", redpacketUsedMoney=" + redpacketUsedMoney + ", joinTime="
+ joinTime + ", joinType=" + joinType + ", clientSystemType="
+ clientSystemType + "]";
}
public List<Long> getActivityIdList() {
return activityIdList;
}
public void setActivityIdList(List<Long> activityIdList) {
this.activityIdList = activityIdList;
}
public Long getCityId() {
return cityId;
}
public void setCityId(Long cityId) {
this.cityId = cityId;
}
public Integer getActivityStatus() {
return activityStatus;
}
public void setActivityStatus(Integer activityStatus) {
this.activityStatus = activityStatus;
}
}
| 5,019 | 0.70273 | 0.675633 | 203 | 23.729065 | 25.248333 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.896552 | false | false |
12
|
5bed2453a05cb2320b4e731f0b93c3144ebfebf7
| 8,358,006,379,048 |
a12fc825c52a922ea9a25911fad49938f42adb95
|
/src/fr/protogen/help/backoffice/model/HelpMenu.java
|
8ad4d3c24040d1bafccd8393630a354346c86686
|
[] |
no_license
|
tamerbak/prometheus
|
https://github.com/tamerbak/prometheus
|
f1715834aff934f8080f71a8d8367decb0bc9b42
|
fbabf258fc5219be722af20019bbdbc25aea7b2e
|
refs/heads/master
| 2021-03-27T08:48:01.943000 | 2016-10-11T08:20:50 | 2016-10-11T08:20:50 | 70,465,978 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package fr.protogen.help.backoffice.model;
import java.io.Serializable;
import java.util.List;
public class HelpMenu implements Serializable{
/**
*
*/
private static final long serialVersionUID = -3391558884852900600L;
private long menuId;
private String title;
private boolean leaf=true;
private HelpMenu parent;
private HelpArticle article;
private List<HelpMenu> childs;
public HelpMenu() {
super();
// TODO Auto-generated constructor stub
}
public HelpMenu(long menuId, String title, boolean leaf, HelpMenu parent,
HelpArticle article) {
this();
this.menuId = menuId;
this.title = title;
this.leaf = leaf;
this.parent = parent;
this.article = article;
}
public List<HelpMenu> getChilds() {
return childs;
}
public void setChilds(List<HelpMenu> childs) {
this.childs = childs;
}
public long getMenuId() {
return menuId;
}
public void setMenuId(long menuId) {
this.menuId = menuId;
}
public String getTitle() {
if(title!=null)
return title.substring(0,1).toUpperCase()+title.substring(1);
return title;
}
public void setTitle(String title) {
this.title = title;
}
public boolean isLeaf() {
return leaf;
}
public void setLeaf(boolean leaf) {
this.leaf = leaf;
}
public HelpMenu getParent() {
return parent;
}
public void setParent(HelpMenu parent) {
this.parent = parent;
}
public HelpArticle getArticle() {
return article;
}
public void setArticle(HelpArticle article) {
this.article = article;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return title;
}
}
|
UTF-8
|
Java
| 1,615 |
java
|
HelpMenu.java
|
Java
|
[] | null |
[] |
package fr.protogen.help.backoffice.model;
import java.io.Serializable;
import java.util.List;
public class HelpMenu implements Serializable{
/**
*
*/
private static final long serialVersionUID = -3391558884852900600L;
private long menuId;
private String title;
private boolean leaf=true;
private HelpMenu parent;
private HelpArticle article;
private List<HelpMenu> childs;
public HelpMenu() {
super();
// TODO Auto-generated constructor stub
}
public HelpMenu(long menuId, String title, boolean leaf, HelpMenu parent,
HelpArticle article) {
this();
this.menuId = menuId;
this.title = title;
this.leaf = leaf;
this.parent = parent;
this.article = article;
}
public List<HelpMenu> getChilds() {
return childs;
}
public void setChilds(List<HelpMenu> childs) {
this.childs = childs;
}
public long getMenuId() {
return menuId;
}
public void setMenuId(long menuId) {
this.menuId = menuId;
}
public String getTitle() {
if(title!=null)
return title.substring(0,1).toUpperCase()+title.substring(1);
return title;
}
public void setTitle(String title) {
this.title = title;
}
public boolean isLeaf() {
return leaf;
}
public void setLeaf(boolean leaf) {
this.leaf = leaf;
}
public HelpMenu getParent() {
return parent;
}
public void setParent(HelpMenu parent) {
this.parent = parent;
}
public HelpArticle getArticle() {
return article;
}
public void setArticle(HelpArticle article) {
this.article = article;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return title;
}
}
| 1,615 | 0.69969 | 0.686068 | 93 | 16.365591 | 16.915848 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.473118 | false | false |
12
|
709f88af7a433d674f59d9d19a8ba36aa0b436ce
| 4,552,665,349,256 |
84737c6fefd149db7cf71e2750c489f0afe9dd96
|
/src/main/java/pl/volli/uj/psi/psi/repository/OrderRepository.java
|
855cefab861d0525db78f31c33b5beb2ea9d024c
|
[] |
no_license
|
VolliUJ/MyShop
|
https://github.com/VolliUJ/MyShop
|
59ff06da0a1d290a571b1e0eedc05b0b8c048e85
|
62b3fd0e04e49638f380565cad225ab6fdb788f4
|
refs/heads/master
| 2021-01-10T14:31:30.916000 | 2016-04-02T19:53:07 | 2016-04-02T19:53:07 | 55,320,259 | 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 pl.volli.uj.psi.psi.repository;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Repository;
import pl.volli.uj.psi.psi.model.Customer;
import pl.volli.uj.psi.psi.model.Order;
/**
*
* @author Volli
*/
@Repository
public class OrderRepository implements OrderRepositoryInterface{
private List<Order> listOfOrders;
public OrderRepository(){
listOfOrders = new ArrayList<Order>();
}
public List<Order>getComplitedOrder(){
List<Order> list = new ArrayList<Order>();
for (Order o : listOfOrders){
if (o.getStatus() == Order.Status.CONFIRMED) list.add(o);
}
return list;
}
public List<Order> getOrdersById(String customer){
List<Order> orders = new ArrayList<Order>();
for (Order o: listOfOrders){
if (customer.equals(o.getOwner())) orders.add(o);
}
return orders;
}
public Order getOpenOrder(Customer customer){
try{
List <Order> listOrder = getOrdersById(customer.getLogin());
for (Order order : listOrder){
if (order.getStatus() == Order.Status.OPEN) return order;
}
}catch (NullPointerException e){
Order o = new Order(customer.getLogin());
o.setAddres(customer.getAddress());
listOfOrders.add(o);
return o;
}
Order o = new Order(customer.getLogin());
o.setAddres(customer.getAddress());
listOfOrders.add(o);
return o;
}
public void addOrder(Order order){
listOfOrders.add(order);
}
public List<Order> getAllOrders() {
return listOfOrders;
}
public Order getOrderId(String id){
for (Order o : listOfOrders){
if (o.getId().equalsIgnoreCase(id)) return o;
}
return null;
}
}
|
UTF-8
|
Java
| 2,129 |
java
|
OrderRepository.java
|
Java
|
[
{
"context": "l.volli.uj.psi.psi.model.Order;\n\n/**\n *\n * @author Volli\n */\n@Repository\npublic class OrderRepository impl",
"end": 434,
"score": 0.9996776580810547,
"start": 429,
"tag": "NAME",
"value": "Volli"
}
] | 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 pl.volli.uj.psi.psi.repository;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Repository;
import pl.volli.uj.psi.psi.model.Customer;
import pl.volli.uj.psi.psi.model.Order;
/**
*
* @author Volli
*/
@Repository
public class OrderRepository implements OrderRepositoryInterface{
private List<Order> listOfOrders;
public OrderRepository(){
listOfOrders = new ArrayList<Order>();
}
public List<Order>getComplitedOrder(){
List<Order> list = new ArrayList<Order>();
for (Order o : listOfOrders){
if (o.getStatus() == Order.Status.CONFIRMED) list.add(o);
}
return list;
}
public List<Order> getOrdersById(String customer){
List<Order> orders = new ArrayList<Order>();
for (Order o: listOfOrders){
if (customer.equals(o.getOwner())) orders.add(o);
}
return orders;
}
public Order getOpenOrder(Customer customer){
try{
List <Order> listOrder = getOrdersById(customer.getLogin());
for (Order order : listOrder){
if (order.getStatus() == Order.Status.OPEN) return order;
}
}catch (NullPointerException e){
Order o = new Order(customer.getLogin());
o.setAddres(customer.getAddress());
listOfOrders.add(o);
return o;
}
Order o = new Order(customer.getLogin());
o.setAddres(customer.getAddress());
listOfOrders.add(o);
return o;
}
public void addOrder(Order order){
listOfOrders.add(order);
}
public List<Order> getAllOrders() {
return listOfOrders;
}
public Order getOrderId(String id){
for (Order o : listOfOrders){
if (o.getId().equalsIgnoreCase(id)) return o;
}
return null;
}
}
| 2,129 | 0.601221 | 0.601221 | 76 | 27.013159 | 21.840628 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.407895 | false | false |
12
|
bcca461fe108806b9bdf2c7acea2d2ed50652b91
| 30,494,267,819,078 |
9b0407b55d41e6f166ea1e9b7930271a91b8d15a
|
/explicitIntent/src/org/techbooster/sample/Intent/SubActivity.java
|
54719e84c94feb939cb2a296585232763c8a87f6
|
[] |
no_license
|
erdiergene/techbooster
|
https://github.com/erdiergene/techbooster
|
66a246bc13ee8dc46d435d45bdc9c1e5a42dae7c
|
8239dd3bb23ab3a0c1c178a5be3915d3a14bb572
|
refs/heads/master
| 2016-09-05T14:33:42.445000 | 2012-03-30T15:40:35 | 2012-03-30T15:40:35 | 32,379,804 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.techbooster.sample.Intent;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
public class SubActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sub);
Intent intent = getIntent();
if(intent != null){
String str = intent.getStringExtra("org.techbooster.sample.Intent.testString");
Toast.makeText(this, str, Toast.LENGTH_LONG).show();
}
}
}
|
UTF-8
|
Java
| 655 |
java
|
SubActivity.java
|
Java
|
[] | null |
[] |
package org.techbooster.sample.Intent;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
public class SubActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sub);
Intent intent = getIntent();
if(intent != null){
String str = intent.getStringExtra("org.techbooster.sample.Intent.testString");
Toast.makeText(this, str, Toast.LENGTH_LONG).show();
}
}
}
| 655 | 0.674809 | 0.674809 | 21 | 30.190475 | 22.813152 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false |
12
|
c600235ddb89464f98568f31bc15eafbb42f4c43
| 21,071,109,624,417 |
3bb5908564cf7f3bfed0f0b31001ff123515ca06
|
/demo/src/com/manasa/Extend.java
|
31405a9f45e84ec9ab6a728d5eb3f2cd9ba304ee
|
[
"MIT"
] |
permissive
|
meturi/demo
|
https://github.com/meturi/demo
|
eb84ad8df2fa8bb1cf142a007fd0f5011be24956
|
045cd3115dc678865b482119a30eb3ba79370014
|
refs/heads/master
| 2020-04-06T11:07:34.174000 | 2019-02-24T07:54:03 | 2019-02-24T07:54:03 | 157,404,666 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.manasa;
public class Extend extends module2 {
void display(int eid[],String name[])
{
System.out.println("ID " + " Name " );
for(int i=0;i<5;i++)
{
System.out.println(+ eid[i] + " " +name[i]);
}
}
/*public static void main(String args[])
{
int eid[] = new int[5];
String name[] = new String[5];
double salary[] = new double[5];
Scanner s = new Scanner(System.in);
module2 m = new module2();
Extend e = new Extend();
for(int i=0;i<5;i++)
{
eid[i]= s.nextInt();
name[i]=s.next();
salary[i]= s.nextDouble();
}
m.display(eid, name, salary);
e.display(eid, name);
}*/
}
|
UTF-8
|
Java
| 684 |
java
|
Extend.java
|
Java
|
[] | null |
[] |
package com.manasa;
public class Extend extends module2 {
void display(int eid[],String name[])
{
System.out.println("ID " + " Name " );
for(int i=0;i<5;i++)
{
System.out.println(+ eid[i] + " " +name[i]);
}
}
/*public static void main(String args[])
{
int eid[] = new int[5];
String name[] = new String[5];
double salary[] = new double[5];
Scanner s = new Scanner(System.in);
module2 m = new module2();
Extend e = new Extend();
for(int i=0;i<5;i++)
{
eid[i]= s.nextInt();
name[i]=s.next();
salary[i]= s.nextDouble();
}
m.display(eid, name, salary);
e.display(eid, name);
}*/
}
| 684 | 0.532164 | 0.517544 | 34 | 18.117647 | 15.59933 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.352941 | false | false |
12
|
aa50cc868db3736c871cecd3e781581842dd4810
| 4,956,392,284,282 |
3e0d77eedc400f6925ee8c75bf32f30486f70b50
|
/CoreJava/src/com/techchefs/javaapps/assignment/three/TestEmployee.java
|
235ee5d710339f204295bf3d98101f3b06286fc1
|
[] |
no_license
|
sanghante/ELF-06June19-TechChefs-SantoshG
|
https://github.com/sanghante/ELF-06June19-TechChefs-SantoshG
|
1c1349a1e4dcea33923dda73cdc7e7dbc54f48e6
|
a13c01aa22e057dad1e39546a50af1be6ab78786
|
refs/heads/master
| 2023-01-10T05:58:52.183000 | 2019-08-14T13:26:12 | 2019-08-14T13:26:12 | 192,526,998 | 0 | 0 | null | false | 2023-01-04T07:13:13 | 2019-06-18T11:30:13 | 2019-08-14T13:26:34 | 2023-01-04T07:13:13 | 12,180 | 0 | 0 | 72 |
Rich Text Format
| false | false |
package com.techchefs.javaapps.assignment.three;
public class TestEmployee {
public static void main(String[] args) {
Employee employee = new Employee("Ramesha", 24, "M",500000,true);
System.out.println(employee.getName());
System.out.println(employee.getAge());
System.out.println(employee.getGender());
System.out.println(employee.getSalary());
System.out.println(employee.isActive());
}
}
|
UTF-8
|
Java
| 416 |
java
|
TestEmployee.java
|
Java
|
[
{
"context": "[] args) {\n\t\t\n\t\tEmployee employee = new Employee(\"Ramesha\", 24, \"M\",500000,true);\n\t\t\n\t\tSystem.out.println(e",
"end": 168,
"score": 0.9998624920845032,
"start": 161,
"tag": "NAME",
"value": "Ramesha"
},
{
"context": "\tEmployee employee = new Employee(\"Ramesha\", 24, \"M\",500000,true);\n\t\t\n\t\tSystem.out.println(employee.g",
"end": 177,
"score": 0.9779077172279358,
"start": 176,
"tag": "NAME",
"value": "M"
}
] | null |
[] |
package com.techchefs.javaapps.assignment.three;
public class TestEmployee {
public static void main(String[] args) {
Employee employee = new Employee("Ramesha", 24, "M",500000,true);
System.out.println(employee.getName());
System.out.println(employee.getAge());
System.out.println(employee.getGender());
System.out.println(employee.getSalary());
System.out.println(employee.isActive());
}
}
| 416 | 0.723558 | 0.704327 | 16 | 25 | 22.304708 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.875 | false | false |
12
|
1901766e34c9aabe71cf43bc09fceb4f59b30454
| 10,187,662,426,526 |
2c8a406e4f8c1c7b60f59382a647d309228dab50
|
/TopSorter/src/sorter/algorythms/JavaSort.java
|
d50c83483565c9cbcce8f00a846bcb25214ae938
|
[] |
no_license
|
disgraceful/java-SortingAlgorythms
|
https://github.com/disgraceful/java-SortingAlgorythms
|
fb24dd58a616685ece1726fc9260c6244e10927f
|
e33c593cb15250d73d9961f1c72c2ae6b072ffc3
|
refs/heads/master
| 2021-01-10T22:34:04.170000 | 2016-10-12T19:26:56 | 2016-10-12T19:26:56 | 69,579,232 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sorter.algorythms;
import java.util.Arrays;
import sorter.strategy.SortingAlgorythm;
public class JavaSort implements SortingAlgorythm {
@Override
public void sort(int[] arrayToSort) {
Arrays.sort(arrayToSort);
}
}
|
UTF-8
|
Java
| 251 |
java
|
JavaSort.java
|
Java
|
[] | null |
[] |
package sorter.algorythms;
import java.util.Arrays;
import sorter.strategy.SortingAlgorythm;
public class JavaSort implements SortingAlgorythm {
@Override
public void sort(int[] arrayToSort) {
Arrays.sort(arrayToSort);
}
}
| 251 | 0.721116 | 0.721116 | 13 | 18.307692 | 17.708689 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false |
12
|
bd7eb61084f8d29e320f361eee9469317c1ed439
| 8,065,948,598,784 |
8dd49a00b188a6422bb82fe5e4c44de092caef3a
|
/lists/arrayLists/Pair.java
|
f65d91f759e9ded81f18699e97d085715fcd7881
|
[
"Apache-2.0"
] |
permissive
|
siddharthkt45/Java-Eclipse
|
https://github.com/siddharthkt45/Java-Eclipse
|
9ebcc6309fee1889906cb02909e469a7394e949d
|
17c59c20775084deaab4da2895cdbff934777c6b
|
refs/heads/master
| 2022-11-25T10:24:29.022000 | 2020-07-31T06:12:01 | 2020-07-31T06:12:01 | 283,955,741 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package lists.arrayLists;
public class Pair<X, Y> { //We have defined a Generic class here
X x; //User-defined datatypes
Y y; //User-defined datatypes
public Pair(X x, Y y) { //This is a bloody Constructor
this.x = x;
this.y = y;
}
public void getDescription() {
System.out.println(x + " " + y);
}
}
|
UTF-8
|
Java
| 318 |
java
|
Pair.java
|
Java
|
[] | null |
[] |
package lists.arrayLists;
public class Pair<X, Y> { //We have defined a Generic class here
X x; //User-defined datatypes
Y y; //User-defined datatypes
public Pair(X x, Y y) { //This is a bloody Constructor
this.x = x;
this.y = y;
}
public void getDescription() {
System.out.println(x + " " + y);
}
}
| 318 | 0.644654 | 0.644654 | 16 | 18.875 | 19.861631 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5625 | false | false |
12
|
9a47f20a264b920ad9014505a291838414cff86c
| 8,040,178,786,813 |
de9e5cf00cc69e1505b08c5082d666d834249853
|
/src/main/java/com/mereder/repository/RoleRepository.java
|
6b8b572c2da57999bb5604f9b0cea0d3bac26570
|
[] |
no_license
|
MerenovaAnastasiya/DL
|
https://github.com/MerenovaAnastasiya/DL
|
65390a7b6253b9068eb70b42b69e5e5a327a6795
|
9bb528123a91d0f63356df4967897ba9b777429f
|
refs/heads/master
| 2021-10-26T09:38:56.960000 | 2019-08-15T13:53:47 | 2019-08-15T13:53:47 | 192,561,386 | 0 | 1 | null | false | 2021-10-05T23:06:56 | 2019-06-18T14:54:29 | 2019-08-15T13:54:01 | 2021-10-05T23:06:54 | 9,678 | 0 | 0 | 18 |
JavaScript
| false | false |
package com.mereder.repository;
import com.mereder.pojo.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RoleRepository extends JpaRepository<UserRole, Long> {
UserRole findByName(String name);
}
|
UTF-8
|
Java
| 304 |
java
|
RoleRepository.java
|
Java
|
[] | null |
[] |
package com.mereder.repository;
import com.mereder.pojo.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RoleRepository extends JpaRepository<UserRole, Long> {
UserRole findByName(String name);
}
| 304 | 0.828947 | 0.828947 | 10 | 29.4 | 24.61788 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
12
|
9eee3fe88aefe51ff17e5fa5cdc9ae77dccfbdb8
| 20,701,742,389,351 |
7a47249d319a64cdd4f6540feebe95ffb3dbe491
|
/jsms-channel/src/main/java/com/jsmsframework/channel/entity/JsmsChannelAttributeWeightConfig.java
|
9afacdb14d0d5fac61545e4af0afa15d68d03661
|
[] |
no_license
|
moutainhigh/framework
|
https://github.com/moutainhigh/framework
|
1be0f1ad11a8356b13938f6cb98cc6482f5921bd
|
5fb9cc4e4ff260de10bf214a35dca20251819ac5
|
refs/heads/master
| 2021-01-01T00:24:50.482000 | 2018-03-03T03:59:14 | 2018-03-03T03:59:14 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.jsmsframework.channel.entity;
import java.math.BigDecimal;
import java.util.Date;
/**
* @description 通道属性区间权重配置表
* @author huangwenjie
* @date 2017-09-28
*/
public class JsmsChannelAttributeWeightConfig {
// 序号,自增长
private Integer id;
// 类型,0:通道成功率区间,1:通道价格区间
private Integer type;
// 属性,0:短信类型-验证码;1:短信类型-通知;2:短信类型-营销;3:短信类型-告警;4:发送号码所属运营商-移动;5:发送号码所属运营商-联通;6:发送号码所属运营商-电信 type=0时,ex_value=0、1、2、3,type=1时,ex_value=4、5、6
private Integer exValue;
// 起始区间(包含),如:T>=0 type = 1时,保留小数后后2位,取值范围[0,101) type = 2时,单位:元,保留小数点后4位
private BigDecimal startLine;
// 结束区间(不包含),如:T<101 type = 1时,保留小数后后2位,取值范围[0,101) type = 2时,单位:元,保留小数点后4位, 取值范围:[0,1]
private BigDecimal endLine;
// 区间权重,取值范围[0,100]
private BigDecimal weight;
// 更新者,对应t_sms_user表中id字段
private Long updator;
// 更新时间
private Date updateDate;
// 备注
private String remark;
private String region;
private String allWeight;
public String getAllWeight() {
return allWeight;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public void setAllWeight(String allWeight) {
this.allWeight = allWeight;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id ;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type ;
}
public Integer getExValue() {
return exValue;
}
public void setExValue(Integer exValue) {
this.exValue = exValue ;
}
public BigDecimal getStartLine() {
return startLine;
}
public void setStartLine(BigDecimal startLine) {
this.startLine = startLine ;
}
public BigDecimal getEndLine() {
return endLine;
}
public void setEndLine(BigDecimal endLine) {
this.endLine = endLine ;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight ;
}
public Long getUpdator() {
return updator;
}
public void setUpdator(Long updator) {
this.updator = updator ;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate ;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark ;
}
}
|
UTF-8
|
Java
| 3,170 |
java
|
JsmsChannelAttributeWeightConfig.java
|
Java
|
[
{
"context": ".Date;\n\n/**\n * @description 通道属性区间权重配置表\n * @author huangwenjie\n * @date 2017-09-28\n */\npublic class JsmsChannelA",
"end": 150,
"score": 0.9991792440414429,
"start": 139,
"tag": "USERNAME",
"value": "huangwenjie"
}
] | null |
[] |
package com.jsmsframework.channel.entity;
import java.math.BigDecimal;
import java.util.Date;
/**
* @description 通道属性区间权重配置表
* @author huangwenjie
* @date 2017-09-28
*/
public class JsmsChannelAttributeWeightConfig {
// 序号,自增长
private Integer id;
// 类型,0:通道成功率区间,1:通道价格区间
private Integer type;
// 属性,0:短信类型-验证码;1:短信类型-通知;2:短信类型-营销;3:短信类型-告警;4:发送号码所属运营商-移动;5:发送号码所属运营商-联通;6:发送号码所属运营商-电信 type=0时,ex_value=0、1、2、3,type=1时,ex_value=4、5、6
private Integer exValue;
// 起始区间(包含),如:T>=0 type = 1时,保留小数后后2位,取值范围[0,101) type = 2时,单位:元,保留小数点后4位
private BigDecimal startLine;
// 结束区间(不包含),如:T<101 type = 1时,保留小数后后2位,取值范围[0,101) type = 2时,单位:元,保留小数点后4位, 取值范围:[0,1]
private BigDecimal endLine;
// 区间权重,取值范围[0,100]
private BigDecimal weight;
// 更新者,对应t_sms_user表中id字段
private Long updator;
// 更新时间
private Date updateDate;
// 备注
private String remark;
private String region;
private String allWeight;
public String getAllWeight() {
return allWeight;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public void setAllWeight(String allWeight) {
this.allWeight = allWeight;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id ;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type ;
}
public Integer getExValue() {
return exValue;
}
public void setExValue(Integer exValue) {
this.exValue = exValue ;
}
public BigDecimal getStartLine() {
return startLine;
}
public void setStartLine(BigDecimal startLine) {
this.startLine = startLine ;
}
public BigDecimal getEndLine() {
return endLine;
}
public void setEndLine(BigDecimal endLine) {
this.endLine = endLine ;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight ;
}
public Long getUpdator() {
return updator;
}
public void setUpdator(Long updator) {
this.updator = updator ;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate ;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark ;
}
}
| 3,170 | 0.597398 | 0.578067 | 124 | 20.701612 | 20.192614 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.298387 | false | false |
12
|
86624a12de82ac2a5bfe9bcacbdfc1d9e792dfe5
| 12,421,045,455,852 |
ca53b4c80130be393ba4d2d5e2a04b33b55da96b
|
/target/test-classes/Selenium/workingWithElements/TakeScreenshoot.java
|
d2bf7043d9291bf0a384d6b8d55353581091027b
|
[] |
no_license
|
alaamhmd/Selenium
|
https://github.com/alaamhmd/Selenium
|
7959795c10816bda994f02c17755734e1850ae9a
|
76eba2d32dd94961bbd41c3fc730f24a2fcd8e1b
|
refs/heads/master
| 2021-07-09T16:16:19.328000 | 2020-06-17T10:21:12 | 2020-06-17T10:21:12 | 245,281,887 | 0 | 0 | null | false | 2021-06-04T02:42:13 | 2020-03-05T22:38:30 | 2020-06-17T10:21:15 | 2021-06-04T02:42:12 | 5,871 | 0 | 0 | 2 |
Java
| false | false |
package Selenium.workingWithElements;
import static org.testng.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class TakeScreenshoot {
ChromeDriver driver;
@BeforeTest
public void openURL() {
String chromePath = System.getProperty("user.dir")+"\\resources\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", chromePath);
driver = new ChromeDriver();
driver.navigate().to("http://www.google.com");
}
@Test
public void testTakeScreenshoot() {
WebElement textBox = driver.findElement(By.name("Q"));
textBox.sendKeys("Covid-19");
textBox.submit();
assertTrue(driver.getTitle().contains("Covid"));
}
@AfterMethod
public void takeScreenshootOfFailure(ITestResult result) throws IOException {
if (ITestResult.FAILURE==result.getStatus()) {
TakesScreenshot ts =(TakesScreenshot) driver;
File source = ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("./screenshots/" +result.getName()+".png"));
}
}
@AfterTest
public void close () {
driver.quit();
}
}
|
UTF-8
|
Java
| 1,575 |
java
|
TakeScreenshoot.java
|
Java
|
[
{
"context": "r.findElement(By.name(\"Q\"));\r\n\t\ttextBox.sendKeys(\"Covid-19\");\r\n\t\ttextBox.submit();\r\n\t\tassertTrue(driver",
"end": 1055,
"score": 0.7615212798118591,
"start": 1052,
"tag": "NAME",
"value": "Cov"
}
] | null |
[] |
package Selenium.workingWithElements;
import static org.testng.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class TakeScreenshoot {
ChromeDriver driver;
@BeforeTest
public void openURL() {
String chromePath = System.getProperty("user.dir")+"\\resources\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", chromePath);
driver = new ChromeDriver();
driver.navigate().to("http://www.google.com");
}
@Test
public void testTakeScreenshoot() {
WebElement textBox = driver.findElement(By.name("Q"));
textBox.sendKeys("Covid-19");
textBox.submit();
assertTrue(driver.getTitle().contains("Covid"));
}
@AfterMethod
public void takeScreenshootOfFailure(ITestResult result) throws IOException {
if (ITestResult.FAILURE==result.getStatus()) {
TakesScreenshot ts =(TakesScreenshot) driver;
File source = ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("./screenshots/" +result.getName()+".png"));
}
}
@AfterTest
public void close () {
driver.quit();
}
}
| 1,575 | 0.725714 | 0.724444 | 58 | 25.155172 | 22.787476 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.534483 | false | false |
12
|
a2cd896b8b275199fcc8eb2592556ef0c1a43235
| 33,234,456,972,375 |
42667b91a52113967121c0d02bc4167cdbed1681
|
/prototype/TestCP1/jp/co/internous/actionS/GetAddressActionS.java
|
6390b1f3383233ac86805e6081e7b7a21f269e2d
|
[] |
no_license
|
internousdev/java
|
https://github.com/internousdev/java
|
6dfc5353e6796439e8db3f90afba56407b3a9a46
|
85aeec0991f754b652c8806a26fb5ec8bc6f501d
|
refs/heads/master
| 2015-08-22T19:11:28.854000 | 2015-07-24T02:46:20 | 2015-07-24T02:46:20 | 38,656,359 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package co.internous.actionS;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import jp.co.internous.dto.GetAddressDTO;
public class GetAddressActionS extends ActionSupport{
private List<GetAddressDTO> siteInfoList = new ArrayList<GetAddressDTO>();
public String exercute(){
String result=ERROR;
}
GetAddressDAO dao=new GetAddressDAO();
try{
siteInfoList.addAll(dao.select());
result=SUCCESS;
}
}
|
UTF-8
|
Java
| 476 |
java
|
GetAddressActionS.java
|
Java
|
[] | null |
[] |
package co.internous.actionS;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import jp.co.internous.dto.GetAddressDTO;
public class GetAddressActionS extends ActionSupport{
private List<GetAddressDTO> siteInfoList = new ArrayList<GetAddressDTO>();
public String exercute(){
String result=ERROR;
}
GetAddressDAO dao=new GetAddressDAO();
try{
siteInfoList.addAll(dao.select());
result=SUCCESS;
}
}
| 476 | 0.773109 | 0.773109 | 24 | 18.833334 | 19.926252 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.958333 | false | false |
12
|
bcc4c86dab9677cf8671d23a39869d5d67d6bf2a
| 9,921,374,499,310 |
fdd4cc6f8b5a473c0081af5302cb19c34433a0cf
|
/src/modules/agrega/gestorflujo/src/main/java/es/pode/catalogacion/soporte/UtilidadesOrdenarCombos.java
|
a9771832223ed10a209331c517e25a57e92226ff
|
[] |
no_license
|
nwlg/Colony
|
https://github.com/nwlg/Colony
|
0170b0990c1f592500d4869ec8583a1c6eccb786
|
07c908706991fc0979e4b6c41d30812d861776fb
|
refs/heads/master
| 2021-01-22T05:24:40.082000 | 2010-12-23T14:49:00 | 2010-12-23T14:49:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/* Agrega es una federación de repositorios de objetos digitales educativos formada por todas las Comunidades Autónomas propiedad de Red.es. Este código ha sido desarrollado por la Entidad Pública Empresarial red.es adscrita al Ministerio de Industria,Turismo y Comercio a través de la Secretaría de Estado de Telecomunicaciones y para la Sociedad de la Información, dentro del Programa Internet en el Aula, que se encuadra dentro de las actuaciones previstas en el Plan Avanza (Plan 2006-2010 para el desarrollo de la Sociedad de la Información y de Convergencia con Europa y entre Comunidades Autónomas y Ciudades Autónomas) y ha sido cofinanciado con fondos FEDER del Programa Operativo FEDER 2000-2006 “Sociedad de la Información”
This program is free software: you can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the European Union Public Licence (EUPL v.1.0). You should have received a copy of the EUPL licence along with this program. If not, see http://ec.europa.eu/idabc/en/document/7330.
*/
package es.pode.catalogacion.soporte;
import es.pode.fuentestaxonomicas.negocio.servicio.TerminoVO;
import es.pode.fuentestaxonomicas.negocio.servicio.VocabularioVO;
public class UtilidadesOrdenarCombos {
//Metodo que ordena los combos con terminosvo
public TerminoVO[] ordenarTerminosVO(TerminoVO[] terminos, String idioma)
{
///////////////////////////////////////
TerminoVO[] terminosSinTildes = new TerminoVO[terminos.length];
//eliminamos las tildes para poder hacer la comparación correctamente
for (int k=0;k<terminos.length;k++){
TerminoVO terminoSinTildes = new TerminoVO();
String valorTer = terminos[k].getNomTermino();
valorTer = valorTer.replace('á', 'a');
valorTer = valorTer.replace('é', 'e');
valorTer = valorTer.replace('í', 'i');
valorTer = valorTer.replace('ó', 'o');
valorTer = valorTer.replace('ú', 'u');
valorTer = valorTer.replace('Á', 'A');
valorTer = valorTer.replace('É', 'E');
valorTer = valorTer.replace('Í', 'I');
valorTer = valorTer.replace('Ó', 'O');
valorTer = valorTer.replace('Ú', 'U');
terminoSinTildes.setNomTermino(valorTer);
terminoSinTildes.setIdTermino(terminos[k].getIdTermino());
terminoSinTildes.setIdiomaTermino(terminos[k].getIdiomaTermino());
terminosSinTildes[k]= terminoSinTildes;
}
for( int i=0;i<terminos.length-1;i++){
for (int j=i+1;j<terminos.length;j++){
String aux=null;
String auxId=null;
String aux2=null;
String auxId2=null;
String auxIdioma=null;
String auxIdioma2=null;
String valorTaxI = terminosSinTildes[i].getNomTermino();
String valorTaxJ = terminosSinTildes[j].getNomTermino();
//comparamos los texto sin tildes y ordenamos a la vez tanto el array con los taxones sin tildes
//como el array con los taxones originales que sera el que vamos devolver
if(valorTaxI.compareToIgnoreCase(valorTaxJ)>0){
aux=terminosSinTildes[j].getNomTermino();
terminosSinTildes[j].setNomTermino(terminosSinTildes[i].getNomTermino());
terminosSinTildes[i].setNomTermino(aux);
auxId=terminosSinTildes[j].getIdTermino();
terminosSinTildes[j].setIdTermino(terminosSinTildes[i].getIdTermino());
terminosSinTildes[i].setIdTermino(auxId);
auxIdioma=terminosSinTildes[j].getIdiomaTermino();
terminosSinTildes[j].setIdiomaTermino(terminosSinTildes[i].getIdiomaTermino());
terminosSinTildes[i].setIdiomaTermino(auxIdioma);
aux2=terminos[j].getNomTermino();
terminos[j].setNomTermino(terminos[i].getNomTermino());
terminos[i].setNomTermino(aux2);
auxId2=terminos[j].getIdTermino();
terminos[j].setIdTermino(terminos[i].getIdTermino());
terminos[i].setIdTermino(auxId2);
auxIdioma2=terminos[j].getIdiomaTermino();
terminos[j].setIdiomaTermino(terminos[i].getIdiomaTermino());
terminos[i].setIdiomaTermino(auxIdioma2);
}
}
}
return terminos;
}
//Metodo que ordena los combos con vocabulariosvo
public VocabularioVO[] ordenarVocabulariosVO(VocabularioVO[]vocabulario)
{
String idioma="";
if(vocabulario.length>0)
idioma=vocabulario[0].getIdioma();
for(int i=0; i < vocabulario.length; i++)
{
for (int j= 0; j<vocabulario[i].getTerminos().length -1; j++){
for (int k= j+1; k<vocabulario[i].getTerminos().length; k++){
if (vocabulario[i].getTerminos()[j].getNomTermino().compareTo(vocabulario[i].getTerminos()[k].getNomTermino())>0 ){
TerminoVO auxTerm=new TerminoVO();
String aux= vocabulario[i].getTerminos()[k].getNomTermino();
String auxId=vocabulario[i].getTerminos()[k].getIdTermino();
auxTerm.setIdiomaTermino(idioma);
auxTerm.setIdTermino(auxId);
auxTerm.setNomTermino(aux);
vocabulario[i].getTerminos()[k]=vocabulario[i].getTerminos()[j];
vocabulario[i].getTerminos()[j]=auxTerm;
}
}
}
}
return vocabulario;
}
}
|
WINDOWS-1252
|
Java
| 5,721 |
java
|
UtilidadesOrdenarCombos.java
|
Java
|
[] | null |
[] |
/* Agrega es una federación de repositorios de objetos digitales educativos formada por todas las Comunidades Autónomas propiedad de Red.es. Este código ha sido desarrollado por la Entidad Pública Empresarial red.es adscrita al Ministerio de Industria,Turismo y Comercio a través de la Secretaría de Estado de Telecomunicaciones y para la Sociedad de la Información, dentro del Programa Internet en el Aula, que se encuadra dentro de las actuaciones previstas en el Plan Avanza (Plan 2006-2010 para el desarrollo de la Sociedad de la Información y de Convergencia con Europa y entre Comunidades Autónomas y Ciudades Autónomas) y ha sido cofinanciado con fondos FEDER del Programa Operativo FEDER 2000-2006 “Sociedad de la Información”
This program is free software: you can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the European Union Public Licence (EUPL v.1.0). You should have received a copy of the EUPL licence along with this program. If not, see http://ec.europa.eu/idabc/en/document/7330.
*/
package es.pode.catalogacion.soporte;
import es.pode.fuentestaxonomicas.negocio.servicio.TerminoVO;
import es.pode.fuentestaxonomicas.negocio.servicio.VocabularioVO;
public class UtilidadesOrdenarCombos {
//Metodo que ordena los combos con terminosvo
public TerminoVO[] ordenarTerminosVO(TerminoVO[] terminos, String idioma)
{
///////////////////////////////////////
TerminoVO[] terminosSinTildes = new TerminoVO[terminos.length];
//eliminamos las tildes para poder hacer la comparación correctamente
for (int k=0;k<terminos.length;k++){
TerminoVO terminoSinTildes = new TerminoVO();
String valorTer = terminos[k].getNomTermino();
valorTer = valorTer.replace('á', 'a');
valorTer = valorTer.replace('é', 'e');
valorTer = valorTer.replace('í', 'i');
valorTer = valorTer.replace('ó', 'o');
valorTer = valorTer.replace('ú', 'u');
valorTer = valorTer.replace('Á', 'A');
valorTer = valorTer.replace('É', 'E');
valorTer = valorTer.replace('Í', 'I');
valorTer = valorTer.replace('Ó', 'O');
valorTer = valorTer.replace('Ú', 'U');
terminoSinTildes.setNomTermino(valorTer);
terminoSinTildes.setIdTermino(terminos[k].getIdTermino());
terminoSinTildes.setIdiomaTermino(terminos[k].getIdiomaTermino());
terminosSinTildes[k]= terminoSinTildes;
}
for( int i=0;i<terminos.length-1;i++){
for (int j=i+1;j<terminos.length;j++){
String aux=null;
String auxId=null;
String aux2=null;
String auxId2=null;
String auxIdioma=null;
String auxIdioma2=null;
String valorTaxI = terminosSinTildes[i].getNomTermino();
String valorTaxJ = terminosSinTildes[j].getNomTermino();
//comparamos los texto sin tildes y ordenamos a la vez tanto el array con los taxones sin tildes
//como el array con los taxones originales que sera el que vamos devolver
if(valorTaxI.compareToIgnoreCase(valorTaxJ)>0){
aux=terminosSinTildes[j].getNomTermino();
terminosSinTildes[j].setNomTermino(terminosSinTildes[i].getNomTermino());
terminosSinTildes[i].setNomTermino(aux);
auxId=terminosSinTildes[j].getIdTermino();
terminosSinTildes[j].setIdTermino(terminosSinTildes[i].getIdTermino());
terminosSinTildes[i].setIdTermino(auxId);
auxIdioma=terminosSinTildes[j].getIdiomaTermino();
terminosSinTildes[j].setIdiomaTermino(terminosSinTildes[i].getIdiomaTermino());
terminosSinTildes[i].setIdiomaTermino(auxIdioma);
aux2=terminos[j].getNomTermino();
terminos[j].setNomTermino(terminos[i].getNomTermino());
terminos[i].setNomTermino(aux2);
auxId2=terminos[j].getIdTermino();
terminos[j].setIdTermino(terminos[i].getIdTermino());
terminos[i].setIdTermino(auxId2);
auxIdioma2=terminos[j].getIdiomaTermino();
terminos[j].setIdiomaTermino(terminos[i].getIdiomaTermino());
terminos[i].setIdiomaTermino(auxIdioma2);
}
}
}
return terminos;
}
//Metodo que ordena los combos con vocabulariosvo
public VocabularioVO[] ordenarVocabulariosVO(VocabularioVO[]vocabulario)
{
String idioma="";
if(vocabulario.length>0)
idioma=vocabulario[0].getIdioma();
for(int i=0; i < vocabulario.length; i++)
{
for (int j= 0; j<vocabulario[i].getTerminos().length -1; j++){
for (int k= j+1; k<vocabulario[i].getTerminos().length; k++){
if (vocabulario[i].getTerminos()[j].getNomTermino().compareTo(vocabulario[i].getTerminos()[k].getNomTermino())>0 ){
TerminoVO auxTerm=new TerminoVO();
String aux= vocabulario[i].getTerminos()[k].getNomTermino();
String auxId=vocabulario[i].getTerminos()[k].getIdTermino();
auxTerm.setIdiomaTermino(idioma);
auxTerm.setIdTermino(auxId);
auxTerm.setNomTermino(aux);
vocabulario[i].getTerminos()[k]=vocabulario[i].getTerminos()[j];
vocabulario[i].getTerminos()[j]=auxTerm;
}
}
}
}
return vocabulario;
}
}
| 5,721 | 0.653907 | 0.646005 | 118 | 47.245762 | 81.615356 | 734 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.677966 | false | false |
12
|
34b462ba3833d033ff18fbb8b006f6092080b14d
| 14,886,356,687,751 |
1b2d581b0491de126ce485379d4c29f03b140fe8
|
/Stitt, Christopher/Chapter 7 Source/r7_10/ArrayDebug.java
|
d8bac15b34b47a7f6300b3759f8cf23e93307417
|
[] |
no_license
|
cstitt1/APCSStitt
|
https://github.com/cstitt1/APCSStitt
|
694abcbdb5a93cb54a7a0322b6389f2cd8050dbe
|
5dcc2d9f2817f103790c71ea7065b543363d4f64
|
refs/heads/master
| 2020-09-15T16:21:18.176000 | 2019-11-22T23:19:39 | 2019-11-22T23:19:39 | 223,501,903 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package r7_10;
public class ArrayDebug {
public static void main(String[] args) {
int[] res = new int[20];
res[0] = 1;
res[1] = 4;
res[2] = 9;
for (int i=4; i<=20; i++) {
res[i-1] = i*i;
}
System.out.println("Finished");
//The other values are set to 0.
}
}
|
UTF-8
|
Java
| 280 |
java
|
ArrayDebug.java
|
Java
|
[] | null |
[] |
package r7_10;
public class ArrayDebug {
public static void main(String[] args) {
int[] res = new int[20];
res[0] = 1;
res[1] = 4;
res[2] = 9;
for (int i=4; i<=20; i++) {
res[i-1] = i*i;
}
System.out.println("Finished");
//The other values are set to 0.
}
}
| 280 | 0.560714 | 0.503571 | 15 | 17.666666 | 12.720937 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false |
12
|
06565fe3df57687cce0a39853cb1e2274f88c1b0
| 15,719,580,355,492 |
9b8b12be6ec54587b621d3feb5d4b597cccdfb01
|
/src/me/davidsosa/imagecompressor/MainWindow.java
|
ef6a900062bb221251e051a7d975b50047bfc877
|
[
"MIT"
] |
permissive
|
DsosaV/Image-Compressor
|
https://github.com/DsosaV/Image-Compressor
|
90a93344e1129374f45db145e9f3944112b57c02
|
f06da6a4badb9b4561dde8d2953ecebeee5de7ad
|
refs/heads/master
| 2016-08-13T00:23:38.497000 | 2016-02-10T22:44:48 | 2016-02-10T22:44:48 | 51,412,696 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 David Sosa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.davidsosa.imagecompressor;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
/**
* Main window for the Image compressor software.
*
* @author David Sosa
*/
public class MainWindow extends JFrame {
private final JFileChooser fileChooser;
private final JLabel pathLabel;
private final JLabel errorLabel;
private final JSpinner qualitySpinner;
private final JCheckBox replaceOriginalsCheckBox;
private HelpWindow helpWindow;
private final ImageCompressor imageCompressor;
private final JButton compressButton;
public MainWindow() throws HeadlessException {
super("Image Compressor");
assert false;
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setSize(400, 200);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenSize.width / 2) - (getWidth() / 2), (screenSize.height / 2) - (getHeight() / 2));
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenuItem openMenuItem = new JMenuItem("Open...");
JMenuItem helpItem = new JMenuItem("Help");
helpItem.addActionListener(new HelpListener());
openMenuItem.addActionListener(new OpenListener(this));
fileMenu.add(openMenuItem);
menuBar.add(fileMenu);
menuBar.add(helpItem);
SpinnerNumberModel spinnerModel = new SpinnerNumberModel(0.5, 0.0, 1.0, 0.05);
qualitySpinner = new JSpinner(spinnerModel);
menuBar.add(qualitySpinner);
fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Select a folder");
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
pathLabel = new JLabel("Selected folder: " + fileChooser.getCurrentDirectory());
errorLabel = new JLabel();
replaceOriginalsCheckBox = new JCheckBox("Replace original images");
JProgressBar progressBar = new JProgressBar();
compressButton = new JButton("Compress");
compressButton.addActionListener(new CompressButtonListener());
JPanel centerPanel = new JPanel();
((FlowLayout) centerPanel.getLayout()).setAlignment(FlowLayout.CENTER);
centerPanel.add(pathLabel);
centerPanel.add(replaceOriginalsCheckBox);
centerPanel.add(progressBar);
centerPanel.add(errorLabel);
getContentPane().add(centerPanel, BorderLayout.CENTER);
getContentPane().add(menuBar, BorderLayout.NORTH);
getContentPane().add(compressButton, BorderLayout.SOUTH);
imageCompressor = new ImageCompressor();
imageCompressor.setProgressBar(progressBar);
}
public static void main(String[] args) {
new MainWindow().setVisible(true);
}
/**
* Listener for the button that compresses the images. The compression of
* the images takes place in a second thread.
*
* @author David Sosa
*/
private class CompressButtonListener implements ActionListener, Runnable {
@Override
public void actionPerformed(ActionEvent e) {
Thread compressThread = new Thread(this, "ImageCompressingThread");
compressThread.start();
}
@Override
public void run() {
try {
compressButton.setEnabled(false);
errorLabel.setText("Compressing images...");
String directoryPath;
if (fileChooser.getSelectedFile() != null) {
directoryPath = fileChooser.getSelectedFile().getAbsolutePath();
} else {
directoryPath = fileChooser.getCurrentDirectory().getAbsolutePath();
}
imageCompressor.compressImagesInDirectory(directoryPath, ((Double) qualitySpinner.getValue()).floatValue(), replaceOriginalsCheckBox.isSelected());
errorLabel.setText("Image compression complete.");
} catch (IOException | UnsupportedOperationException ex) {
errorLabel.setText("Error: " + ex.getMessage());
} finally {
compressButton.setEnabled(true);
}
}
}
/**
* Listener for a button that opens the help window.
*
* @author David Sosa
*/
private class HelpListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
if (helpWindow == null) {
helpWindow = new HelpWindow();
}
helpWindow.setVisible(true);
}
}
/**
* Listener for a button that opens a JDialog to choose a directory where
* the images to be compressed are stored.
*
* @author David Sosa
*/
private class OpenListener implements ActionListener {
private final Component parent;
private OpenListener(Component parent) {
this.parent = parent;
}
@Override
public void actionPerformed(ActionEvent e) {
int returnVal = fileChooser.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File directory = fileChooser.getSelectedFile();
pathLabel.setText("Selected folder: " + directory.getAbsolutePath());
System.out.println("Selected folder: " + directory.getAbsolutePath());
}
}
}
}
|
UTF-8
|
Java
| 6,681 |
java
|
MainWindow.java
|
Java
|
[
{
"context": "\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 David Sosa\n *\n * Permission is hereby granted, free of charg",
"end": 63,
"score": 0.9998087286949158,
"start": 53,
"tag": "NAME",
"value": "David Sosa"
},
{
"context": "w for the Image compressor software.\n *\n * @author David Sosa\n */\npublic class MainWindow extends JFrame {\n\n ",
"end": 1424,
"score": 0.9998373985290527,
"start": 1414,
"tag": "NAME",
"value": "David Sosa"
},
{
"context": "es place in a second thread.\n *\n * @author David Sosa\n */\n private class CompressButtonListener ",
"end": 4205,
"score": 0.9998720288276672,
"start": 4195,
"tag": "NAME",
"value": "David Sosa"
},
{
"context": " that opens the help window.\n *\n * @author David Sosa\n */\n private class HelpListener implements",
"end": 5551,
"score": 0.9998259544372559,
"start": 5541,
"tag": "NAME",
"value": "David Sosa"
},
{
"context": "to be compressed are stored.\n *\n * @author David Sosa\n */\n private class OpenListener implements",
"end": 6013,
"score": 0.9997105598449707,
"start": 6003,
"tag": "NAME",
"value": "David Sosa"
}
] | null |
[] |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.davidsosa.imagecompressor;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
/**
* Main window for the Image compressor software.
*
* @author <NAME>
*/
public class MainWindow extends JFrame {
private final JFileChooser fileChooser;
private final JLabel pathLabel;
private final JLabel errorLabel;
private final JSpinner qualitySpinner;
private final JCheckBox replaceOriginalsCheckBox;
private HelpWindow helpWindow;
private final ImageCompressor imageCompressor;
private final JButton compressButton;
public MainWindow() throws HeadlessException {
super("Image Compressor");
assert false;
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setSize(400, 200);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenSize.width / 2) - (getWidth() / 2), (screenSize.height / 2) - (getHeight() / 2));
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenuItem openMenuItem = new JMenuItem("Open...");
JMenuItem helpItem = new JMenuItem("Help");
helpItem.addActionListener(new HelpListener());
openMenuItem.addActionListener(new OpenListener(this));
fileMenu.add(openMenuItem);
menuBar.add(fileMenu);
menuBar.add(helpItem);
SpinnerNumberModel spinnerModel = new SpinnerNumberModel(0.5, 0.0, 1.0, 0.05);
qualitySpinner = new JSpinner(spinnerModel);
menuBar.add(qualitySpinner);
fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Select a folder");
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
pathLabel = new JLabel("Selected folder: " + fileChooser.getCurrentDirectory());
errorLabel = new JLabel();
replaceOriginalsCheckBox = new JCheckBox("Replace original images");
JProgressBar progressBar = new JProgressBar();
compressButton = new JButton("Compress");
compressButton.addActionListener(new CompressButtonListener());
JPanel centerPanel = new JPanel();
((FlowLayout) centerPanel.getLayout()).setAlignment(FlowLayout.CENTER);
centerPanel.add(pathLabel);
centerPanel.add(replaceOriginalsCheckBox);
centerPanel.add(progressBar);
centerPanel.add(errorLabel);
getContentPane().add(centerPanel, BorderLayout.CENTER);
getContentPane().add(menuBar, BorderLayout.NORTH);
getContentPane().add(compressButton, BorderLayout.SOUTH);
imageCompressor = new ImageCompressor();
imageCompressor.setProgressBar(progressBar);
}
public static void main(String[] args) {
new MainWindow().setVisible(true);
}
/**
* Listener for the button that compresses the images. The compression of
* the images takes place in a second thread.
*
* @author <NAME>
*/
private class CompressButtonListener implements ActionListener, Runnable {
@Override
public void actionPerformed(ActionEvent e) {
Thread compressThread = new Thread(this, "ImageCompressingThread");
compressThread.start();
}
@Override
public void run() {
try {
compressButton.setEnabled(false);
errorLabel.setText("Compressing images...");
String directoryPath;
if (fileChooser.getSelectedFile() != null) {
directoryPath = fileChooser.getSelectedFile().getAbsolutePath();
} else {
directoryPath = fileChooser.getCurrentDirectory().getAbsolutePath();
}
imageCompressor.compressImagesInDirectory(directoryPath, ((Double) qualitySpinner.getValue()).floatValue(), replaceOriginalsCheckBox.isSelected());
errorLabel.setText("Image compression complete.");
} catch (IOException | UnsupportedOperationException ex) {
errorLabel.setText("Error: " + ex.getMessage());
} finally {
compressButton.setEnabled(true);
}
}
}
/**
* Listener for a button that opens the help window.
*
* @author <NAME>
*/
private class HelpListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
if (helpWindow == null) {
helpWindow = new HelpWindow();
}
helpWindow.setVisible(true);
}
}
/**
* Listener for a button that opens a JDialog to choose a directory where
* the images to be compressed are stored.
*
* @author <NAME>
*/
private class OpenListener implements ActionListener {
private final Component parent;
private OpenListener(Component parent) {
this.parent = parent;
}
@Override
public void actionPerformed(ActionEvent e) {
int returnVal = fileChooser.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File directory = fileChooser.getSelectedFile();
pathLabel.setText("Selected folder: " + directory.getAbsolutePath());
System.out.println("Selected folder: " + directory.getAbsolutePath());
}
}
}
}
| 6,661 | 0.66053 | 0.657087 | 180 | 36.116665 | 29.360834 | 163 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
12
|
b8fb69a72a1af8168548eea9c4cebebf9e437b09
| 15,719,580,358,812 |
8fc267cfa964f6675a04086204af588f08bfd642
|
/JPL/src/ch02/ex02_13/Vehicle.java
|
d44d09c569e5383fef6f191844bad21e867cf5fd
|
[] |
no_license
|
ShinjirohHara/Training
|
https://github.com/ShinjirohHara/Training
|
2b42d0065f179ec1b1ab6205539cd35ab6fbae89
|
dbba4f497ff0d4f64673c760b698a1d32205a6a6
|
refs/heads/master
| 2021-01-10T19:09:06.910000 | 2013-01-08T12:40:24 | 2013-01-08T12:40:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ch02.ex02_13;
public class Vehicle {
private int speed = 0;
private int angle = 0;
private String owner = null;
private final int id;
private static int nextId = 0;
public Vehicle () {
id = nextId++;
}
public Vehicle (String owner) {
id = nextId++;
this.owner = owner;
}
public Vehicle (int speed, int angle, String owner) {
id = nextId++;
this.speed = speed;
this.angle = angle;
this.owner = owner;
}
public void setSpeed(int speed) {
this.speed = speed;
}
public void setAngle(int angle) {
this.angle = angle;
}
public int getSpeed() {
return speed;
}
public int getAngle() {
return angle;
}
public String getOwner() {
return owner;
}
public int getId() {
return id;
}
public static int getCurrentId() {
return nextId;
}
public String toString() {
return "ID:"+id+",Speed:"+speed+", Angle:"+angle+", Owner:"+owner;
}
public static void main(String args[]) {
Vehicle atenza = new Vehicle(200, 10, "hara");
atenza.setSpeed(200);
atenza.setAngle(10);
Vehicle rx8 = new Vehicle("yamashita");
rx8.setSpeed(250);
rx8.setAngle(30);
Vehicle mpv = new Vehicle(120, 60, "kidogu");
mpv.setSpeed(120);
mpv.setAngle(60);
Vehicle crz = new Vehicle(230, 90, "uchida");
crz.setSpeed(230);
crz.setAngle(90);
Vehicle fit = new Vehicle(80, 120, "hayashi");
fit.setSpeed(80);
fit.setAngle(120);
System.out.println(atenza);
System.out.println(rx8);
System.out.println(mpv);
System.out.println(crz);
System.out.println(fit);
System.out.println("ID:"+Vehicle.getCurrentId());
}
}
|
UTF-8
|
Java
| 1,719 |
java
|
Vehicle.java
|
Java
|
[
{
"context": "gs[]) {\r\n\t\tVehicle atenza = new Vehicle(200, 10, \"hara\");\r\n\t\tatenza.setSpeed(200);\r\n\t\tatenza.setAngle(10",
"end": 1072,
"score": 0.5887576937675476,
"start": 1068,
"tag": "NAME",
"value": "hara"
},
{
"context": "e(90);\r\n\t\t\r\n\t\tVehicle fit = new Vehicle(80, 120, \"hayashi\");\r\n\t\tfit.setSpeed(80);\r\n\t\tfit.setAngle(120);",
"end": 1453,
"score": 0.5984960794448853,
"start": 1450,
"tag": "NAME",
"value": "hay"
}
] | null |
[] |
package ch02.ex02_13;
public class Vehicle {
private int speed = 0;
private int angle = 0;
private String owner = null;
private final int id;
private static int nextId = 0;
public Vehicle () {
id = nextId++;
}
public Vehicle (String owner) {
id = nextId++;
this.owner = owner;
}
public Vehicle (int speed, int angle, String owner) {
id = nextId++;
this.speed = speed;
this.angle = angle;
this.owner = owner;
}
public void setSpeed(int speed) {
this.speed = speed;
}
public void setAngle(int angle) {
this.angle = angle;
}
public int getSpeed() {
return speed;
}
public int getAngle() {
return angle;
}
public String getOwner() {
return owner;
}
public int getId() {
return id;
}
public static int getCurrentId() {
return nextId;
}
public String toString() {
return "ID:"+id+",Speed:"+speed+", Angle:"+angle+", Owner:"+owner;
}
public static void main(String args[]) {
Vehicle atenza = new Vehicle(200, 10, "hara");
atenza.setSpeed(200);
atenza.setAngle(10);
Vehicle rx8 = new Vehicle("yamashita");
rx8.setSpeed(250);
rx8.setAngle(30);
Vehicle mpv = new Vehicle(120, 60, "kidogu");
mpv.setSpeed(120);
mpv.setAngle(60);
Vehicle crz = new Vehicle(230, 90, "uchida");
crz.setSpeed(230);
crz.setAngle(90);
Vehicle fit = new Vehicle(80, 120, "hayashi");
fit.setSpeed(80);
fit.setAngle(120);
System.out.println(atenza);
System.out.println(rx8);
System.out.println(mpv);
System.out.println(crz);
System.out.println(fit);
System.out.println("ID:"+Vehicle.getCurrentId());
}
}
| 1,719 | 0.602094 | 0.568354 | 93 | 16.483871 | 15.394883 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.032258 | false | false |
12
|
f43e94bf90cc558d25e27fb0d441c601213ee735
| 28,741,921,160,924 |
5a474257353b9bbf88c30688fab17a618b154c22
|
/snHose-Server/src/main/java/net/minecraft/server/CommandTestFor.java
|
aba81e14912c08ff608d32aa8c2614a4ced66dcb
|
[] |
no_license
|
RealKezuk/snHose
|
https://github.com/RealKezuk/snHose
|
7e5424cd3edbf99bb6a586b9592943b11cd9d549
|
8c89453218621426f394fae44625f97b2a57840c
|
refs/heads/master
| 2020-07-22T14:24:17.936000 | 2019-09-09T03:39:21 | 2019-09-09T03:39:21 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package net.minecraft.server.v1_7_R4;
public class CommandTestFor extends CommandAbstract
{
@Override
public String getCommand() {
return "testfor";
}
@Override
public int a() {
return 2;
}
@Override
public String c(final ICommandListener commandListener) {
return "commands.testfor.usage";
}
@Override
public void execute(final ICommandListener commandListener, final String[] array) {
if (array.length != 1) {
throw new ExceptionUsage("commands.testfor.usage", new Object[0]);
}
if (!(commandListener instanceof CommandBlockListenerAbstract)) {
throw new CommandException("commands.testfor.failed", new Object[0]);
}
CommandAbstract.d(commandListener, array[0]);
}
@Override
public boolean isListStart(final String[] array, final int n) {
return n == 0;
}
}
|
UTF-8
|
Java
| 937 |
java
|
CommandTestFor.java
|
Java
|
[] | null |
[] |
package net.minecraft.server.v1_7_R4;
public class CommandTestFor extends CommandAbstract
{
@Override
public String getCommand() {
return "testfor";
}
@Override
public int a() {
return 2;
}
@Override
public String c(final ICommandListener commandListener) {
return "commands.testfor.usage";
}
@Override
public void execute(final ICommandListener commandListener, final String[] array) {
if (array.length != 1) {
throw new ExceptionUsage("commands.testfor.usage", new Object[0]);
}
if (!(commandListener instanceof CommandBlockListenerAbstract)) {
throw new CommandException("commands.testfor.failed", new Object[0]);
}
CommandAbstract.d(commandListener, array[0]);
}
@Override
public boolean isListStart(final String[] array, final int n) {
return n == 0;
}
}
| 937 | 0.622199 | 0.612593 | 35 | 25.771429 | 26.148024 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.371429 | false | false |
12
|
4646f098f68e36bdeb4b4045b9b54627533673e5
| 28,741,921,157,782 |
03b6db4180eecbe684200324f47052833f59e110
|
/Mensajeria/src/Envios/Estandar.java
|
200a434bc9ad2198fa3abbfcfe153441e2b458eb
|
[] |
no_license
|
AlejandroQR23/POO_P8
|
https://github.com/AlejandroQR23/POO_P8
|
1f80be16715241e202f788130760d01a80ce9409
|
a4083bec81a25fc8ecc0fd6851b71088d0bf735e
|
refs/heads/master
| 2020-08-12T03:04:40.432000 | 2019-10-13T06:38:55 | 2019-10-13T06:38:55 | 214,676,355 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Envios;
import Paquetes.*;
import java.util.Calendar;
public class Estandar extends Envio {
public Estandar( Paquete p ) {
super( p );
}
@Override
public void enviar() {
System.out.println("\n El paquete ha sido enviado ");
Calendar calendario = Calendar.getInstance();
calendario.setTime( this.fecha_envio );
calendario.add( Calendar.DAY_OF_YEAR, 5 );
this.fecha_entrega = calendario.getTime();
System.out.println(" La fecha de entrega es: " + this.fecha_entrega );
}
}
|
UTF-8
|
Java
| 587 |
java
|
Estandar.java
|
Java
|
[] | null |
[] |
package Envios;
import Paquetes.*;
import java.util.Calendar;
public class Estandar extends Envio {
public Estandar( Paquete p ) {
super( p );
}
@Override
public void enviar() {
System.out.println("\n El paquete ha sido enviado ");
Calendar calendario = Calendar.getInstance();
calendario.setTime( this.fecha_envio );
calendario.add( Calendar.DAY_OF_YEAR, 5 );
this.fecha_entrega = calendario.getTime();
System.out.println(" La fecha de entrega es: " + this.fecha_entrega );
}
}
| 587 | 0.601363 | 0.599659 | 24 | 23.416666 | 22.201571 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.458333 | false | false |
12
|
bbd2bb8645683a8008af774e877c4064b3590faa
| 29,111,288,388,280 |
c94c6d45fec144955191878128fea17b55314564
|
/src/main/java/by/yurusova/entranceExam/dao/interfaces/GradeDAO.java
|
36082f89c7a4a742cffee9ed8032b652aa7e0207
|
[] |
no_license
|
kukuzura/EntranceExam
|
https://github.com/kukuzura/EntranceExam
|
1fbdd2980c3933d8b46cc3e12464ed9c4b5c6158
|
65f4368ed2c9c43848f45b74c94e822f6675cc78
|
refs/heads/master
| 2022-12-22T02:11:23.757000 | 2020-03-09T15:00:56 | 2020-03-09T15:00:56 | 187,046,403 | 1 | 0 | null | false | 2022-12-16T09:57:00 | 2019-05-16T14:41:20 | 2020-03-09T15:01:00 | 2022-12-16T09:56:59 | 42,673 | 1 | 0 | 13 |
Java
| false | false |
package by.yurusova.entranceExam.dao.interfaces;
import by.yurusova.entranceExam.entities.Grade;
import java.util.List;
/**
* Interface defines base operations that can be performed with grade objects.
*
* @author Yuliya Yurusava <y.yurusava@sam-solurions.com>
* @package by.yurusova.entranceExam.dao
* @link http ://sam-solutions.com/
* @copyright 2019 SaM
*/
public interface GradeDAO {
/**
* Method gets all grades with given student id.
*
* @param studentId the given studentID.
* @return list of grades.
*/
List<Grade> findGradesByStudentId(long studentId);
/**
* Method saves grade to db.
*
* @param grade grade to be save.
* @return
*/
Long saveGrade(Grade grade);
/**
* Method updates grade in db.
*
* @param grade grade to be update.
*/
void update(Grade grade);
/**
* Method gets all grades.
*
* @return list of grades.
*/
List<Grade> getAll();
/**
* Method gets grade of student with given id for exam with given id.
*
* @param studentID student id.
* @param examID exam id.
* @return grade.
*/
Grade getByStudentAndExam(long studentID, long examID);
}
|
UTF-8
|
Java
| 1,242 |
java
|
GradeDAO.java
|
Java
|
[
{
"context": "can be performed with grade objects.\n *\n * @author Yuliya Yurusava <y.yurusava@sam-solurions.com>\n * @package by.yur",
"end": 235,
"score": 0.9998829960823059,
"start": 220,
"tag": "NAME",
"value": "Yuliya Yurusava"
},
{
"context": "ith grade objects.\n *\n * @author Yuliya Yurusava <y.yurusava@sam-solurions.com>\n * @package by.yurusova.entranceExam.dao\n * @lin",
"end": 265,
"score": 0.9999334812164307,
"start": 237,
"tag": "EMAIL",
"value": "y.yurusava@sam-solurions.com"
}
] | null |
[] |
package by.yurusova.entranceExam.dao.interfaces;
import by.yurusova.entranceExam.entities.Grade;
import java.util.List;
/**
* Interface defines base operations that can be performed with grade objects.
*
* @author <NAME> <<EMAIL>>
* @package by.yurusova.entranceExam.dao
* @link http ://sam-solutions.com/
* @copyright 2019 SaM
*/
public interface GradeDAO {
/**
* Method gets all grades with given student id.
*
* @param studentId the given studentID.
* @return list of grades.
*/
List<Grade> findGradesByStudentId(long studentId);
/**
* Method saves grade to db.
*
* @param grade grade to be save.
* @return
*/
Long saveGrade(Grade grade);
/**
* Method updates grade in db.
*
* @param grade grade to be update.
*/
void update(Grade grade);
/**
* Method gets all grades.
*
* @return list of grades.
*/
List<Grade> getAll();
/**
* Method gets grade of student with given id for exam with given id.
*
* @param studentID student id.
* @param examID exam id.
* @return grade.
*/
Grade getByStudentAndExam(long studentID, long examID);
}
| 1,212 | 0.623188 | 0.619968 | 55 | 21.581818 | 20.429649 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.163636 | false | false |
12
|
ebdb6340642f2bfd89d521efcf349c89b05e602f
| 29,145,648,100,866 |
100e5eff514d3226caf198f1280413c191ef7216
|
/JavaEdu/src/javaapp1005/First.java
|
ddc45f4cbfaf707fce700c4db4ebed4e527beea0
|
[] |
no_license
|
rizzkim/JavaEdu
|
https://github.com/rizzkim/JavaEdu
|
d3980d3e8428aece4cee26e5d040194a54a14b66
|
5f8ae7ab53025419bc85af28d0e015ed780303d2
|
refs/heads/main
| 2023-01-05T21:38:56.143000 | 2020-11-03T09:18:21 | 2020-11-03T09:18:21 | 304,578,596 | 0 | 0 | null | false | 2020-10-28T07:23:56 | 2020-10-16T09:20:45 | 2020-10-28T02:43:01 | 2020-10-28T07:23:56 | 71 | 0 | 0 | 0 |
Java
| false | false |
package javaapp1005;
public class First {
public static void main(String[] args) {
System.out.println("첫번째 자바 프로그램");
System.out.println("실행");
}
}
|
UTF-8
|
Java
| 198 |
java
|
First.java
|
Java
|
[] | null |
[] |
package javaapp1005;
public class First {
public static void main(String[] args) {
System.out.println("첫번째 자바 프로그램");
System.out.println("실행");
}
}
| 198 | 0.607955 | 0.585227 | 12 | 12.666667 | 15.062831 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.916667 | false | false |
12
|
9c2e1992625a1c83114aa168d26875630de9d73b
| 1,984,274,949,230 |
e97973f673c48cc5527d7bc7c36eb0bd22cb2960
|
/app/src/main/java/com/bawei/gaochenkai/ui/activity/HomeActivity.java
|
62e1ff32fe9904ee705ef963191b800dd05b34da
|
[] |
no_license
|
Gaoxiaokai123/Gaochenkai20190703
|
https://github.com/Gaoxiaokai123/Gaochenkai20190703
|
63b1ab36b32a78e70f329e9b0a98fc2b908accc6
|
aaf2be267e5b022a32dabb05c099c6e45a435ab2
|
refs/heads/master
| 2020-06-15T22:08:05.796000 | 2019-07-06T04:59:04 | 2019-07-06T04:59:04 | 195,404,899 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.bawei.gaochenkai.ui.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.bawei.gaochenkai.R;
import com.bawei.gaochenkai.data.frag.HomeFragment;
import com.bawei.gaochenkai.data.frag.MeFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class HomeActivity extends AppCompatActivity {
@BindView(R.id.radio1)
RadioButton radio1;
@BindView(R.id.radio2)
RadioButton radio2;
@BindView(R.id.radioGaoup)
RadioGroup radioGaoup;
@BindView(R.id.vp)
ViewPager vp;
private Fragment homeFragment;
private Fragment meFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
ButterKnife.bind(this);
HomeFragment homeFragment = new HomeFragment();
MeFragment meFragment = new MeFragment();
//创建事务管理器
FragmentManager supportFragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.add(R.id.vp,homeFragment).hide(homeFragment);
fragmentTransaction.add(R.id.vp,meFragment).show(meFragment);
fragmentTransaction.commit();//提交事务
}
@OnClick({R.id.radio1, R.id.radio2})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.radio1:
// FragmentManager supportFragmentManager1 = getSupportFragmentManager();
// FragmentTransaction fragmentTransaction1 = supportFragmentManager1.beginTransaction();
// fragmentTransaction1.hide(homeFragment);
// fragmentTransaction1.show(meFragment);
// fragmentTransaction1.commit();
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction fragment = manager.beginTransaction();
fragment.show(homeFragment);
fragment.hide(meFragment);
fragment.commit();
break;
case R.id.radio2:
FragmentManager supportFragmentManager2 = getSupportFragmentManager();
FragmentTransaction fragmentTransaction2 = supportFragmentManager2.beginTransaction();
fragmentTransaction2.hide(meFragment);
fragmentTransaction2.show(homeFragment);
fragmentTransaction2.commit();
break;
}
}
@OnClick(R.id.vp)
public void onViewClicked() {
}
}
|
UTF-8
|
Java
| 2,940 |
java
|
HomeActivity.java
|
Java
|
[] | null |
[] |
package com.bawei.gaochenkai.ui.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.bawei.gaochenkai.R;
import com.bawei.gaochenkai.data.frag.HomeFragment;
import com.bawei.gaochenkai.data.frag.MeFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class HomeActivity extends AppCompatActivity {
@BindView(R.id.radio1)
RadioButton radio1;
@BindView(R.id.radio2)
RadioButton radio2;
@BindView(R.id.radioGaoup)
RadioGroup radioGaoup;
@BindView(R.id.vp)
ViewPager vp;
private Fragment homeFragment;
private Fragment meFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
ButterKnife.bind(this);
HomeFragment homeFragment = new HomeFragment();
MeFragment meFragment = new MeFragment();
//创建事务管理器
FragmentManager supportFragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.add(R.id.vp,homeFragment).hide(homeFragment);
fragmentTransaction.add(R.id.vp,meFragment).show(meFragment);
fragmentTransaction.commit();//提交事务
}
@OnClick({R.id.radio1, R.id.radio2})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.radio1:
// FragmentManager supportFragmentManager1 = getSupportFragmentManager();
// FragmentTransaction fragmentTransaction1 = supportFragmentManager1.beginTransaction();
// fragmentTransaction1.hide(homeFragment);
// fragmentTransaction1.show(meFragment);
// fragmentTransaction1.commit();
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction fragment = manager.beginTransaction();
fragment.show(homeFragment);
fragment.hide(meFragment);
fragment.commit();
break;
case R.id.radio2:
FragmentManager supportFragmentManager2 = getSupportFragmentManager();
FragmentTransaction fragmentTransaction2 = supportFragmentManager2.beginTransaction();
fragmentTransaction2.hide(meFragment);
fragmentTransaction2.show(homeFragment);
fragmentTransaction2.commit();
break;
}
}
@OnClick(R.id.vp)
public void onViewClicked() {
}
}
| 2,940 | 0.689171 | 0.680603 | 85 | 33.329411 | 25.851789 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.611765 | false | false |
12
|
258ecea81725db94da9a37c6863ade6fcb356634
| 2,284,922,636,951 |
75f44b446e87aff76c5242eae72116f5094f19ae
|
/WEB-INF/src/org/cloud4All/ontology/WebServicesForTerms.java
|
c965734b8acee44420b6ab818bcdd7a3a00b8202
|
[] |
no_license
|
AggelikiKonstadinidou/SemanticAlignmentTool
|
https://github.com/AggelikiKonstadinidou/SemanticAlignmentTool
|
2b2df58bf711a96eb5ccc8d23dce3bbabe2db270
|
8878fdfd6c4cca94d8c789d916d9bf60c9f3f0f0
|
refs/heads/master
| 2021-01-13T00:45:33.623000 | 2015-11-23T13:14:36 | 2015-11-23T13:14:36 | 46,719,953 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.cloud4All.ontology;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.net.ssl.HostnameVerifier;
import javax.servlet.ServletContext;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.cloud4All.Setting;
import org.cloud4All.Utilities;
import org.cloud4All.ontology.MapTerm.Record;
import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class WebServicesForTerms {
public static String ALL_TERMS_WITH_CHILDREN_URL = "https://terms.raisingthefloor.org/api/terms";
private static String COMMON_URL = "https://terms.raisingthefloor.org/api/record";
public static String ALIAS_URL = "https://terms.raisingthefloor.org/api/aliases?limit=-1";
public static String signInForDictionaryTermsApi = "https://terms.raisingthefloor.org/api/user/signin";
private static String cURLin183 = "C:\\Program Files\\Git\\bin\\";
private static String mycURL = "C:\\Program Files\\cURL\\bin\\";
private static String usingCURL = cURLin183;
public static HashMap<String, RegistryTerm> getWebServiceRegistryTerms(
String url,String cookies) throws ClientProtocolException, IOException, InterruptedException {
// list with terms with status = deleted
ArrayList<RegistryTerm> deletedTerms = new ArrayList<RegistryTerm>();
//String result = Utilities.getResultOfHTTPget(url);
String result = WebServicesForTerms.getRequestWithCurl(url, cookies);
Gson gson = new Gson();
Type type = new TypeToken<RegistryTermForJSONNew.AllRecords>() {
}.getType();
System.out.println(result);
RegistryTermForJSONNew.AllRecords allRecords = (RegistryTermForJSONNew.AllRecords) gson
.fromJson(result.toString(), type);
// create registry term objects for ontology
HashMap<String, RegistryTerm> ws_terms = new HashMap<String, RegistryTerm>();
RegistryTerm rterm = null;
for (RegistryTermForJSONNew.Record temp : allRecords.getRecords()) {
// convert RegistryTermJSON to Registry term
rterm = temp.convertJSONTermToOntologyTerm();
// add registry term in the hashMap
if (!rterm.getId().isEmpty() && rterm.getId() != null
&& !rterm.getStatus().equals("deleted"))
ws_terms.put(rterm.getId(), rterm);
else if (rterm.getStatus().equals("deleted"))
deletedTerms.add(rterm);
}
System.out.println(ws_terms.size());
return ws_terms;
}
public static HashMap<String, Setting> getWebServiceAliases(String url,String cookies)
throws ClientProtocolException, IOException, InterruptedException {
// list with terms with status = deleted
ArrayList<Setting> deletedTerms = new ArrayList<Setting>();
// String result = Utilities.getResultOfHTTPget(url);
String result = WebServicesForTerms.getRequestWithCurl(url, cookies);
Gson gson = new Gson();
Type type = new TypeToken<RegistryTermForJSONNew.AllAliases>() {
}.getType();
// System.out.println(result);
RegistryTermForJSONNew.AllAliases allRecords = (RegistryTermForJSONNew.AllAliases) gson
.fromJson(result.toString(), type);
// create registry term objects for ontology
HashMap<String, Setting> ws_terms = new HashMap<String, Setting>();
Setting sett = null;
for (RegistryTermForJSONNew.Record.Alias temp : allRecords.getRecords()) {
// System.out.println(temp.toString());
sett = temp.convertJSONAlias();
if (sett.getId() != null && sett.getSolutionId() != null)
if (!sett.getId().isEmpty() && !sett.getSolutionId().isEmpty())
ws_terms.put(sett.getId(), sett);
}
// System.out.println(ws_terms.size());
return ws_terms;
}
public static void updateRegistryTernHTTP(RegistryTerm term) {
try {
String cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPut put = new HttpPut(COMMON_URL);
put.addHeader("cookie", cookies);
String status = "";
ArrayList<String> aliasesArray = new ArrayList<String>();
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
if (temp.getStatus().equals("accepted"))
status = "active";
else
status = "unreviewed";
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes()
+ "\",\"status\":\"" + status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
if (term.getStatus().equals("accepted"))
status = "active";
else
status = "unreviewed";
put.setEntity(new StringEntity("{\"uniqueId\":\"" + term.getId()
+ "\",\"type\":\"" + "term" + "\",\"termLabel\":\""
+ term.getName() + "\", \"definition\":\""
+ term.getDescription() + "\",\"notes\":\""
+ term.getNotes() + "\", \"aliases\":[" + jsonTerm
+ "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(put);
System.out
.println("\nSending 'PUT' request to URL : " + COMMON_URL);
System.out.println("Put parameters : " + put.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
} catch (Exception e) {
}
}
public static void insertRegistryTerm(RegistryTerm term, String cookies) {
try {
if (cookies.isEmpty())
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPost post = new HttpPost(COMMON_URL);
post.addHeader("cookie", cookies);
ArrayList<String> aliasesArray = new ArrayList<String>();
String status = "unreviewed";
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes()
+ "\",\"status\":\"" + status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
post.setEntity(new StringEntity("{\"uniqueId\":\"" + term.getId()
+ "\",\"type\":\"" + "term" + "\",\"defaultvalue\":\""
+ term.getDefaultValue() + "\",\"termLabel\":\""
+ term.getName() + "\", \"definition\":\""
+ term.getDescription() + "\",\"notes\":\""
+ term.getNotes() + "\", \"aliases\":[" + jsonTerm
+ "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(post);
System.out.println("\nSending 'POST' request to URL : "
+ COMMON_URL);
// System.out.println("Post parameters : " + post.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
public static void insertSetting(Setting setting, String ulUri,
String cookies, String solID) {
try {
if (cookies.isEmpty())
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPost post = new HttpPost(COMMON_URL);
String notes = "";
post.addHeader("cookie", cookies);
post.setEntity(new StringEntity("{\"uniqueId\":\"" + solID + "_"
+ setting.getId() + "\",\"type\":\"" + "alias"
+ "\",\"termLabel\":\"" + setting.getName()
+ "\",\"notes\":\"" + notes + "\", \"ulUri\":\"" + ulUri
+ "\",\"status\":\"" + "unreviewed" + "\", \"aliasOf\": \""
+ setting.getMappingId() + "\"}", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(post);
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
e.printStackTrace();
}
}
//TODO
public static void main(String args[]) throws IOException, InterruptedException{
String cookies = loginAndGetCookiesWithCurl(WebServicesForTerms.signInForDictionaryTermsApi);
getRequestWithCurl(WebServicesForTerms.ALL_TERMS_WITH_CHILDREN_URL,
cookies);
// String cookies2 = loginAndGetCookiesWithCurl(WebServicesForSolutions.signInForUnifiedListingApi);
// getRequestWithCurl(WebServicesForSolutions.PRODUCTS_URL, cookies2);
}
public static String loginAndGetCookies(String url) {
String cookies = "";
try {
DefaultHttpClient httpClient = Utilities.getClient();
// log in
HttpPost post = new HttpPost(url);
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
urlParameters.add(new BasicNameValuePair("name", "aggeliki"));
urlParameters.add(new BasicNameValuePair("password", "1234"));
post.setEntity(new UrlEncodedFormEntity(urlParameters));
HttpResponse response = httpClient.execute(post);
// System.out.println("Sending 'POST' request to URL : "
// + " https://terms.raisingthefloor.org/api/user/signin");
// System.out.println("Post parameters : " + post.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
post.releaseConnection();
Header[] headers = response.getAllHeaders();
// get cookies from headers of response
for (Header header : headers) {
// System.out.println(" --> " + header.getName() + ":"
// + header.getValue());
if (header.getName().equalsIgnoreCase("Set-Cookie"))
cookies = header.getValue();
}
System.out.println(cookies);
} catch (Exception e) {
e.printStackTrace();
}
return cookies;
}
public static String loginAndGetCookiesWithCurl(String url) throws IOException {
String cookies = "";
ProcessBuilder p = null;
if (url.contains("ul.gpii.net"))
p = new ProcessBuilder(usingCURL + "curl.exe", "-v", "-X", "POST",
"--data", "username=aggeliki", "--data", "password=1234",
url);
else
p = new ProcessBuilder(usingCURL + "curl.exe", "-v", "-X", "POST",
"--data", "name=aggeliki", "--data", "password=1234", url);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
// read error Stream
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// split cookies from response
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains("Set-Cookie") ||
splitted[i].contains("set-cookie")) {
cookies = splitted[i];
break;
}
}
// System.out.println(sb);
// read Shell in
Reader r2 = new InputStreamReader(shellIn);
StringBuilder sb2 = new StringBuilder();
char[] chars2 = new char[4 * 1024];
int len2;
while ((len2 = r2.read(chars2)) >= 0) {
sb2.append(chars2, 0, len2);
}
System.out.println(sb2);
cookies = cookies.replace("Set-Cookie: ", "").trim();
cookies = cookies.replace("set-cookie: ", "").trim();
System.out.println("Cookies: " + cookies);
return cookies;
}
public static void postSettingWithCurl(String cookies, Setting setting,
String ulUri, String solID) throws IOException {
String notes = "";
String json = "{\"uniqueId\":\"" + solID + "_" + setting.getId()
+ "\",\"type\":\"" + "alias" + "\",\"termLabel\":\""
+ setting.getName() + "\",\"notes\":\"" + notes
+ "\", \"ulUri\":\"" + ulUri + "\",\"status\":\""
+ "unreviewed" + "\", \"aliasOf\": \"" + setting.getMappingId()
+ "\"}";
File file = new File(usingCURL + "recordSAT.json");
FileUtils.writeStringToFile(file, json);
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "POST", "-b", cookies.trim(), "--data", "@" + usingCURL
+ "recordSAT.json", "-H",
"Content-Type: application/json",
"https://terms.raisingthefloor.org/api/record/");
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static String getRequestWithCurl(String url, String cookies)
throws IOException, InterruptedException {
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-X",
"GET", "-b", cookies.trim(), "-H",
"Content-Type: application/json", url);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream inputStream = shell.getInputStream();
Reader r = new InputStreamReader(inputStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
System.out.println(sb.toString());
String result = sb.toString();
if(result.contains("\"ok\":true")||result.contains("\"ok\":\"true\""))
System.out.println("Response result: ok:true");
else
System.out.println("error occured in request");
return result;
}
public static void postRegistryTermWithCurl(String cookies,
RegistryTerm term) throws IOException {
ArrayList<String> aliasesArray = new ArrayList<String>();
String status = "unreviewed";
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes() + "\",\"status\":\""
+ status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
String json = "{\"uniqueId\":\"" + term.getId() + "\",\"type\":\""
+ "term" + "\",\"defaultvalue\":\"" + term.getDefaultValue()
+ "\",\"termLabel\":\"" + term.getName()
+ "\", \"definition\":\"" + term.getDescription()
+ "\",\"notes\":\"" + term.getNotes() + "\", \"aliases\":["
+ jsonTerm + "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }";
File file = new File(usingCURL + "recordSAT.json");
FileUtils.writeStringToFile(file, json);
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "POST", "-b", cookies.trim(), "--data", "@" + usingCURL
+ "recordSAT.json", "-H",
"Content-Type: application/json",
"https://terms.raisingthefloor.org/api/record/");
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static void deleteRecordWithCurl(String cookies, String id)
throws IOException {
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "DELETE", "-b", cookies.trim(),
"https://terms.raisingthefloor.org/api/record/" + id);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static void httpDeleteRequestForTerm(String id, String cookies) {
try {
if (cookies.isEmpty()) {
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
}
DefaultHttpClient httpClient = Utilities.getClient();
HttpDelete delete = new HttpDelete(
"https://terms.raisingthefloor.org/api/record/" + id);
delete.addHeader("cookie", cookies);
HttpResponse response = httpClient.execute(delete);
System.out.println("\nSending 'DELETE' request to URL : "
+ COMMON_URL);
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
} catch (Exception e) {
}
}
}
|
UTF-8
|
Java
| 20,584 |
java
|
WebServicesForTerms.java
|
Java
|
[
{
"context": "arameters.add(new BasicNameValuePair(\"password\", \"1234\"));\n\n\t\t\tpost.setEntity(new UrlEncodedFormEntity(u",
"end": 11619,
"score": 0.9992291927337646,
"start": 11615,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "xe\", \"-v\", \"-X\", \"POST\",\n\t\t\t\t\t\"--data\", \"username=aggeliki\", \"--data\", \"password=1234\",\n\t\t\t\t\turl);\n\t\telse\n\t\t",
"end": 12748,
"score": 0.9992984533309937,
"start": 12740,
"tag": "USERNAME",
"value": "aggeliki"
},
{
"context": "--data\", \"username=aggeliki\", \"--data\", \"password=1234\",\n\t\t\t\t\turl);\n\t\telse\n\t\t\tp = new ProcessBuilder(usi",
"end": 12775,
"score": 0.9992974996566772,
"start": 12771,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\t\t\t\"--data\", \"name=aggeliki\", \"--data\", \"password=1234\", url);\n\t\t\n\t\t\n\t\tfinal Process shell = p.start();\n",
"end": 12922,
"score": 0.9993342757225037,
"start": 12918,
"tag": "PASSWORD",
"value": "1234"
}
] | null |
[] |
package org.cloud4All.ontology;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.net.ssl.HostnameVerifier;
import javax.servlet.ServletContext;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.cloud4All.Setting;
import org.cloud4All.Utilities;
import org.cloud4All.ontology.MapTerm.Record;
import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class WebServicesForTerms {
public static String ALL_TERMS_WITH_CHILDREN_URL = "https://terms.raisingthefloor.org/api/terms";
private static String COMMON_URL = "https://terms.raisingthefloor.org/api/record";
public static String ALIAS_URL = "https://terms.raisingthefloor.org/api/aliases?limit=-1";
public static String signInForDictionaryTermsApi = "https://terms.raisingthefloor.org/api/user/signin";
private static String cURLin183 = "C:\\Program Files\\Git\\bin\\";
private static String mycURL = "C:\\Program Files\\cURL\\bin\\";
private static String usingCURL = cURLin183;
public static HashMap<String, RegistryTerm> getWebServiceRegistryTerms(
String url,String cookies) throws ClientProtocolException, IOException, InterruptedException {
// list with terms with status = deleted
ArrayList<RegistryTerm> deletedTerms = new ArrayList<RegistryTerm>();
//String result = Utilities.getResultOfHTTPget(url);
String result = WebServicesForTerms.getRequestWithCurl(url, cookies);
Gson gson = new Gson();
Type type = new TypeToken<RegistryTermForJSONNew.AllRecords>() {
}.getType();
System.out.println(result);
RegistryTermForJSONNew.AllRecords allRecords = (RegistryTermForJSONNew.AllRecords) gson
.fromJson(result.toString(), type);
// create registry term objects for ontology
HashMap<String, RegistryTerm> ws_terms = new HashMap<String, RegistryTerm>();
RegistryTerm rterm = null;
for (RegistryTermForJSONNew.Record temp : allRecords.getRecords()) {
// convert RegistryTermJSON to Registry term
rterm = temp.convertJSONTermToOntologyTerm();
// add registry term in the hashMap
if (!rterm.getId().isEmpty() && rterm.getId() != null
&& !rterm.getStatus().equals("deleted"))
ws_terms.put(rterm.getId(), rterm);
else if (rterm.getStatus().equals("deleted"))
deletedTerms.add(rterm);
}
System.out.println(ws_terms.size());
return ws_terms;
}
public static HashMap<String, Setting> getWebServiceAliases(String url,String cookies)
throws ClientProtocolException, IOException, InterruptedException {
// list with terms with status = deleted
ArrayList<Setting> deletedTerms = new ArrayList<Setting>();
// String result = Utilities.getResultOfHTTPget(url);
String result = WebServicesForTerms.getRequestWithCurl(url, cookies);
Gson gson = new Gson();
Type type = new TypeToken<RegistryTermForJSONNew.AllAliases>() {
}.getType();
// System.out.println(result);
RegistryTermForJSONNew.AllAliases allRecords = (RegistryTermForJSONNew.AllAliases) gson
.fromJson(result.toString(), type);
// create registry term objects for ontology
HashMap<String, Setting> ws_terms = new HashMap<String, Setting>();
Setting sett = null;
for (RegistryTermForJSONNew.Record.Alias temp : allRecords.getRecords()) {
// System.out.println(temp.toString());
sett = temp.convertJSONAlias();
if (sett.getId() != null && sett.getSolutionId() != null)
if (!sett.getId().isEmpty() && !sett.getSolutionId().isEmpty())
ws_terms.put(sett.getId(), sett);
}
// System.out.println(ws_terms.size());
return ws_terms;
}
public static void updateRegistryTernHTTP(RegistryTerm term) {
try {
String cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPut put = new HttpPut(COMMON_URL);
put.addHeader("cookie", cookies);
String status = "";
ArrayList<String> aliasesArray = new ArrayList<String>();
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
if (temp.getStatus().equals("accepted"))
status = "active";
else
status = "unreviewed";
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes()
+ "\",\"status\":\"" + status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
if (term.getStatus().equals("accepted"))
status = "active";
else
status = "unreviewed";
put.setEntity(new StringEntity("{\"uniqueId\":\"" + term.getId()
+ "\",\"type\":\"" + "term" + "\",\"termLabel\":\""
+ term.getName() + "\", \"definition\":\""
+ term.getDescription() + "\",\"notes\":\""
+ term.getNotes() + "\", \"aliases\":[" + jsonTerm
+ "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(put);
System.out
.println("\nSending 'PUT' request to URL : " + COMMON_URL);
System.out.println("Put parameters : " + put.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
} catch (Exception e) {
}
}
public static void insertRegistryTerm(RegistryTerm term, String cookies) {
try {
if (cookies.isEmpty())
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPost post = new HttpPost(COMMON_URL);
post.addHeader("cookie", cookies);
ArrayList<String> aliasesArray = new ArrayList<String>();
String status = "unreviewed";
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes()
+ "\",\"status\":\"" + status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
post.setEntity(new StringEntity("{\"uniqueId\":\"" + term.getId()
+ "\",\"type\":\"" + "term" + "\",\"defaultvalue\":\""
+ term.getDefaultValue() + "\",\"termLabel\":\""
+ term.getName() + "\", \"definition\":\""
+ term.getDescription() + "\",\"notes\":\""
+ term.getNotes() + "\", \"aliases\":[" + jsonTerm
+ "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(post);
System.out.println("\nSending 'POST' request to URL : "
+ COMMON_URL);
// System.out.println("Post parameters : " + post.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
public static void insertSetting(Setting setting, String ulUri,
String cookies, String solID) {
try {
if (cookies.isEmpty())
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
DefaultHttpClient httpClient = Utilities.getClient();
HttpPost post = new HttpPost(COMMON_URL);
String notes = "";
post.addHeader("cookie", cookies);
post.setEntity(new StringEntity("{\"uniqueId\":\"" + solID + "_"
+ setting.getId() + "\",\"type\":\"" + "alias"
+ "\",\"termLabel\":\"" + setting.getName()
+ "\",\"notes\":\"" + notes + "\", \"ulUri\":\"" + ulUri
+ "\",\"status\":\"" + "unreviewed" + "\", \"aliasOf\": \""
+ setting.getMappingId() + "\"}", ContentType
.create("application/json")));
HttpResponse response = httpClient.execute(post);
BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
e.printStackTrace();
}
}
//TODO
public static void main(String args[]) throws IOException, InterruptedException{
String cookies = loginAndGetCookiesWithCurl(WebServicesForTerms.signInForDictionaryTermsApi);
getRequestWithCurl(WebServicesForTerms.ALL_TERMS_WITH_CHILDREN_URL,
cookies);
// String cookies2 = loginAndGetCookiesWithCurl(WebServicesForSolutions.signInForUnifiedListingApi);
// getRequestWithCurl(WebServicesForSolutions.PRODUCTS_URL, cookies2);
}
public static String loginAndGetCookies(String url) {
String cookies = "";
try {
DefaultHttpClient httpClient = Utilities.getClient();
// log in
HttpPost post = new HttpPost(url);
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
urlParameters.add(new BasicNameValuePair("name", "aggeliki"));
urlParameters.add(new BasicNameValuePair("password", "<PASSWORD>"));
post.setEntity(new UrlEncodedFormEntity(urlParameters));
HttpResponse response = httpClient.execute(post);
// System.out.println("Sending 'POST' request to URL : "
// + " https://terms.raisingthefloor.org/api/user/signin");
// System.out.println("Post parameters : " + post.getEntity());
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
post.releaseConnection();
Header[] headers = response.getAllHeaders();
// get cookies from headers of response
for (Header header : headers) {
// System.out.println(" --> " + header.getName() + ":"
// + header.getValue());
if (header.getName().equalsIgnoreCase("Set-Cookie"))
cookies = header.getValue();
}
System.out.println(cookies);
} catch (Exception e) {
e.printStackTrace();
}
return cookies;
}
public static String loginAndGetCookiesWithCurl(String url) throws IOException {
String cookies = "";
ProcessBuilder p = null;
if (url.contains("ul.gpii.net"))
p = new ProcessBuilder(usingCURL + "curl.exe", "-v", "-X", "POST",
"--data", "username=aggeliki", "--data", "password=<PASSWORD>",
url);
else
p = new ProcessBuilder(usingCURL + "curl.exe", "-v", "-X", "POST",
"--data", "name=aggeliki", "--data", "password=<PASSWORD>", url);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
// read error Stream
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// split cookies from response
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains("Set-Cookie") ||
splitted[i].contains("set-cookie")) {
cookies = splitted[i];
break;
}
}
// System.out.println(sb);
// read Shell in
Reader r2 = new InputStreamReader(shellIn);
StringBuilder sb2 = new StringBuilder();
char[] chars2 = new char[4 * 1024];
int len2;
while ((len2 = r2.read(chars2)) >= 0) {
sb2.append(chars2, 0, len2);
}
System.out.println(sb2);
cookies = cookies.replace("Set-Cookie: ", "").trim();
cookies = cookies.replace("set-cookie: ", "").trim();
System.out.println("Cookies: " + cookies);
return cookies;
}
public static void postSettingWithCurl(String cookies, Setting setting,
String ulUri, String solID) throws IOException {
String notes = "";
String json = "{\"uniqueId\":\"" + solID + "_" + setting.getId()
+ "\",\"type\":\"" + "alias" + "\",\"termLabel\":\""
+ setting.getName() + "\",\"notes\":\"" + notes
+ "\", \"ulUri\":\"" + ulUri + "\",\"status\":\""
+ "unreviewed" + "\", \"aliasOf\": \"" + setting.getMappingId()
+ "\"}";
File file = new File(usingCURL + "recordSAT.json");
FileUtils.writeStringToFile(file, json);
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "POST", "-b", cookies.trim(), "--data", "@" + usingCURL
+ "recordSAT.json", "-H",
"Content-Type: application/json",
"https://terms.raisingthefloor.org/api/record/");
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static String getRequestWithCurl(String url, String cookies)
throws IOException, InterruptedException {
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-X",
"GET", "-b", cookies.trim(), "-H",
"Content-Type: application/json", url);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream inputStream = shell.getInputStream();
Reader r = new InputStreamReader(inputStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
System.out.println(sb.toString());
String result = sb.toString();
if(result.contains("\"ok\":true")||result.contains("\"ok\":\"true\""))
System.out.println("Response result: ok:true");
else
System.out.println("error occured in request");
return result;
}
public static void postRegistryTermWithCurl(String cookies,
RegistryTerm term) throws IOException {
ArrayList<String> aliasesArray = new ArrayList<String>();
String status = "unreviewed";
String jsonTerm = "";
for (RegistryTerm temp : term.getAliasesTerms()) {
jsonTerm = "{\"uniqueId\":\"" + temp.getId() + "\",\"type\":\""
+ "alias" + "\",\"aliasOf\":\"" + term.getId()
+ "\",\"termLabel\":\"" + temp.getName()
+ "\",\"notes\":\"" + temp.getNotes() + "\",\"status\":\""
+ status + "\" }";
aliasesArray.add(jsonTerm);
}
jsonTerm = "";
for (String s : aliasesArray) {
jsonTerm = jsonTerm.concat(s + ",");
}
if (!jsonTerm.isEmpty())
jsonTerm = jsonTerm.substring(0, jsonTerm.lastIndexOf(",")); // -1
String json = "{\"uniqueId\":\"" + term.getId() + "\",\"type\":\""
+ "term" + "\",\"defaultvalue\":\"" + term.getDefaultValue()
+ "\",\"termLabel\":\"" + term.getName()
+ "\", \"definition\":\"" + term.getDescription()
+ "\",\"notes\":\"" + term.getNotes() + "\", \"aliases\":["
+ jsonTerm + "], \"valueSpace\":\"" + term.getValueSpace()
+ "\",\"status\":\"" + status + "\" }";
File file = new File(usingCURL + "recordSAT.json");
FileUtils.writeStringToFile(file, json);
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "POST", "-b", cookies.trim(), "--data", "@" + usingCURL
+ "recordSAT.json", "-H",
"Content-Type: application/json",
"https://terms.raisingthefloor.org/api/record/");
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static void deleteRecordWithCurl(String cookies, String id)
throws IOException {
ProcessBuilder p = new ProcessBuilder(usingCURL + "curl.exe", "-v",
"-X", "DELETE", "-b", cookies.trim(),
"https://terms.raisingthefloor.org/api/record/" + id);
final Process shell = p.start();
InputStream errorStream = shell.getErrorStream();
InputStream shellIn = shell.getInputStream();
Reader r = new InputStreamReader(errorStream);
StringBuilder sb = new StringBuilder();
char[] chars = new char[4 * 1024];
int len;
while ((len = r.read(chars)) >= 0) {
sb.append(chars, 0, len);
}
// System.out.println(sb);
// split cookies from response
String responseResult = "";
String[] splitted = sb.toString().split("<");
for (int i = 0; i < splitted.length; i++) {
if (splitted[i].contains(" HTTP/1.1 200 OK")) {
responseResult = splitted[i];
break;
}
}
if (!responseResult.contains("200 OK"))
System.out.println("error in POST");
else
System.out.println("Response result: " + responseResult);
}
public static void httpDeleteRequestForTerm(String id, String cookies) {
try {
if (cookies.isEmpty()) {
cookies = loginAndGetCookies(signInForDictionaryTermsApi);
}
DefaultHttpClient httpClient = Utilities.getClient();
HttpDelete delete = new HttpDelete(
"https://terms.raisingthefloor.org/api/record/" + id);
delete.addHeader("cookie", cookies);
HttpResponse response = httpClient.execute(delete);
System.out.println("\nSending 'DELETE' request to URL : "
+ COMMON_URL);
System.out.println("Response Code : "
+ response.getStatusLine().getStatusCode());
} catch (Exception e) {
}
}
}
| 20,602 | 0.662748 | 0.657064 | 659 | 30.235205 | 24.653118 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.672231 | false | false |
12
|
7c7efaf66a9e7a074f1f2a1bad71f9883e2ba502
| 506,806,144,399 |
30e3c91f23aaa6127ee3e520becc443701e18faa
|
/sources/com/p683ss/android/ugc/aweme/sticker/types/unlock/C46605c.java
|
3df7efa813a7e35399d53199f5dd1b2167ab5e6f
|
[] |
no_license
|
jakesyl/tishtosh_source
|
https://github.com/jakesyl/tishtosh_source
|
521d4ab2bc28325519cf84422cce9c5709339b1f
|
c88d8f6fc6147fc08dfda6bd6d8540156278fa5d
|
refs/heads/master
| 2022-09-10T17:19:16.637000 | 2020-05-25T06:06:31 | 2020-05-25T06:06:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.p683ss.android.ugc.aweme.sticker.types.unlock;
/* renamed from: com.ss.android.ugc.aweme.sticker.types.unlock.c */
public final class C46605c {
}
|
UTF-8
|
Java
| 159 |
java
|
C46605c.java
|
Java
|
[] | null |
[] |
package com.p683ss.android.ugc.aweme.sticker.types.unlock;
/* renamed from: com.ss.android.ugc.aweme.sticker.types.unlock.c */
public final class C46605c {
}
| 159 | 0.767296 | 0.716981 | 5 | 30.799999 | 27.909855 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
12
|
b5638a8ef470c06b954493bb14b9d9994ed16005
| 13,374,528,180,112 |
9fd911d62409bb57605d64f87be93d1d0e04e585
|
/src/test/OptimisationRun1.java
|
a53b0e23dfc7c9cc80338710e39caf008427efc7
|
[] |
no_license
|
mscstephen/DemoProject
|
https://github.com/mscstephen/DemoProject
|
d1769dcee2a6bae4d88c3707ac08c785ec866261
|
467febe60008c4e24ad37d0135b1570399837020
|
refs/heads/master
| 2020-05-17T16:48:00.429000 | 2012-03-21T13:52:43 | 2012-03-21T13:52:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import module.Run;
/**
*
* @author kac4
*/
public class OptimisationRun1 extends Thread {
String[] arg = new String[10];
@Override
public void run(){
Run r = new Run();
r.main(arg);
}
}
|
UTF-8
|
Java
| 342 |
java
|
OptimisationRun1.java
|
Java
|
[
{
"context": "ckage test;\n\nimport module.Run;\n\n/**\n *\n * @author kac4\n */\npublic class OptimisationRun1 extends Thread ",
"end": 158,
"score": 0.9995889663696289,
"start": 154,
"tag": "USERNAME",
"value": "kac4"
}
] | null |
[] |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import module.Run;
/**
*
* @author kac4
*/
public class OptimisationRun1 extends Thread {
String[] arg = new String[10];
@Override
public void run(){
Run r = new Run();
r.main(arg);
}
}
| 342 | 0.596491 | 0.584795 | 25 | 12.68 | 15.473125 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.28 | false | false |
12
|
38c54395b860775d15ad45a0eeb09cbd3a56771f
| 20,581,483,301,680 |
c93320955f27f59da7cf8ab7b3668331fd05b7da
|
/roth-lang/src/main/java/roth/lang/code/DoWhile.java
|
e8e2deee1d7349cb8a151e25ea76a64754761ffb
|
[] |
no_license
|
roth-source/roth-lang
|
https://github.com/roth-source/roth-lang
|
01f918a1ff3c6636857685949dbd049c98a1ec4f
|
c282f9a7f17c689d04a6c85876f7aa766a98cec2
|
refs/heads/master
| 2021-06-20T14:18:43.951000 | 2017-05-11T20:52:12 | 2017-05-11T20:52:12 | 56,353,651 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package roth.lang.code;
public class DoWhile
{
}
|
UTF-8
|
Java
| 58 |
java
|
DoWhile.java
|
Java
|
[] | null |
[] |
package roth.lang.code;
public class DoWhile
{
}
| 58 | 0.637931 | 0.637931 | 6 | 7.666667 | 9.826268 | 23 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
12
|
74c76a3a9f624d476163a5daf799183d18d2ca0b
| 9,972,914,067,987 |
581d07ac2e89e00933017ede4e8c96182f6a491f
|
/common-orm/src/main/java/jef/database/datasource/SpringBeansDataSourceLookup.java
|
7d854ce26b122c2bf4d4bf54d638242f4de59765
|
[
"Apache-2.0"
] |
permissive
|
GeeQuery/ef-orm
|
https://github.com/GeeQuery/ef-orm
|
9d8c92b5e4de7fca128464329ac3f0c0d674d7e8
|
7d7a3a8f1951133e8786738bfdb2b9d17e2938b7
|
refs/heads/master
| 2018-12-29T12:03:49.987000 | 2018-12-26T07:57:18 | 2018-12-26T07:57:18 | 22,404,941 | 42 | 32 |
Apache-2.0
| false | 2018-12-26T07:57:19 | 2014-07-30T02:30:04 | 2018-12-26T07:41:11 | 2018-12-26T07:57:19 | 32,217 | 34 | 44 | 5 |
Java
| false | null |
package jef.database.datasource;
import java.util.Collection;
import java.util.Collections;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
/**
* 在Spring的配置中找寻Bean的DataSoruceLookup
* @author jiyi
*
*/
public class SpringBeansDataSourceLookup extends AbstractSpringBeanLookup<DataSource> implements DataSourceLookup{
public DataSource getDataSource(String dataSourceName) {
if(isIgnorCase())dataSourceName=StringUtils.lowerCase(dataSourceName);//忽略大小写
if(cache!=null){
DataSource datasource=cache.get(dataSourceName);
if(datasource!=null)return datasource;
}
cache=getCache();
DataSource datasource=cache.get(dataSourceName);
return datasource;
}
public String getDefaultKey() {
if(cache==null){
cache=getCache();
}
if(cache.size()==1){
return cache.keySet().iterator().next();
}
return defaultBeanName;
}
public Collection<String> getAvailableKeys() {
if (cache == null) {
cache=getCache();
}
return Collections.unmodifiableCollection(cache.keySet());
}
}
|
UTF-8
|
Java
| 1,066 |
java
|
SpringBeansDataSourceLookup.java
|
Java
|
[
{
"context": "*\n * 在Spring的配置中找寻Bean的DataSoruceLookup\n * @author jiyi\n *\n */\npublic class SpringBeansDataSourceLookup e",
"end": 226,
"score": 0.9994438886642456,
"start": 222,
"tag": "USERNAME",
"value": "jiyi"
}
] | null |
[] |
package jef.database.datasource;
import java.util.Collection;
import java.util.Collections;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
/**
* 在Spring的配置中找寻Bean的DataSoruceLookup
* @author jiyi
*
*/
public class SpringBeansDataSourceLookup extends AbstractSpringBeanLookup<DataSource> implements DataSourceLookup{
public DataSource getDataSource(String dataSourceName) {
if(isIgnorCase())dataSourceName=StringUtils.lowerCase(dataSourceName);//忽略大小写
if(cache!=null){
DataSource datasource=cache.get(dataSourceName);
if(datasource!=null)return datasource;
}
cache=getCache();
DataSource datasource=cache.get(dataSourceName);
return datasource;
}
public String getDefaultKey() {
if(cache==null){
cache=getCache();
}
if(cache.size()==1){
return cache.keySet().iterator().next();
}
return defaultBeanName;
}
public Collection<String> getAvailableKeys() {
if (cache == null) {
cache=getCache();
}
return Collections.unmodifiableCollection(cache.keySet());
}
}
| 1,066 | 0.750962 | 0.75 | 43 | 23.186047 | 24.391436 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.511628 | false | false |
12
|
81d0560b571d392e55ed2f833b15025ec7be29c9
| 7,017,976,562,084 |
df2fb942ea2d998661e349d19656a4661bfe5eb0
|
/src/test/java/starter/stepdefinitions/LoginSteps.java
|
f00f82a4de7e432ad567e8486198c54e51cc23a2
|
[] |
no_license
|
tejaldud/serenity-browserstack-integration
|
https://github.com/tejaldud/serenity-browserstack-integration
|
aaed860fb7f59f5f22515d9acd4e3bb781504a91
|
75c2d2dc3f7f6604198dc0fa076c269e0b0d4c5a
|
refs/heads/master
| 2020-04-21T23:04:30.670000 | 2019-02-11T14:42:03 | 2019-02-11T14:42:03 | 169,934,111 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package starter.stepdefinitions;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import starter.login.LoginPage;
public class LoginSteps {
LoginPage loginPage;
@Given("^I navigate to (?:login|Registration) page by clicking on (.+) link$")
public void iNavigateToLoginPageByClickingOnSignInLink(String link) throws Throwable {
if (link.equalsIgnoreCase("signIn")) {
loginPage.clickOnSignInLink();
} else {
loginPage.clickOnCreateAccountLink();
}
}
@And("^I click on Sign In$")
public void iCkickOnSignIn() {
loginPage.clickOnSignIn();
}
@Given("^I enter (.+) and (.+) after clicking signIn option$")
public void iEnterAndAfterClickingSignInOption(String User, String Pswd) throws Throwable {
loginPage.clickOnSignInOpt();
loginPage.submitLoginDetails(User, Pswd);
}
@When("^I click on Login Button$")
public void iClickOnLoginButton() throws Throwable {
loginPage.clickOnsignInButton();
}
@Then("^I should be logged in$")
public void iShouldBeLoggedIn() throws Throwable {
loginPage.verifyAccountName();
}
}
|
UTF-8
|
Java
| 1,253 |
java
|
LoginSteps.java
|
Java
|
[] | null |
[] |
package starter.stepdefinitions;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import starter.login.LoginPage;
public class LoginSteps {
LoginPage loginPage;
@Given("^I navigate to (?:login|Registration) page by clicking on (.+) link$")
public void iNavigateToLoginPageByClickingOnSignInLink(String link) throws Throwable {
if (link.equalsIgnoreCase("signIn")) {
loginPage.clickOnSignInLink();
} else {
loginPage.clickOnCreateAccountLink();
}
}
@And("^I click on Sign In$")
public void iCkickOnSignIn() {
loginPage.clickOnSignIn();
}
@Given("^I enter (.+) and (.+) after clicking signIn option$")
public void iEnterAndAfterClickingSignInOption(String User, String Pswd) throws Throwable {
loginPage.clickOnSignInOpt();
loginPage.submitLoginDetails(User, Pswd);
}
@When("^I click on Login Button$")
public void iClickOnLoginButton() throws Throwable {
loginPage.clickOnsignInButton();
}
@Then("^I should be logged in$")
public void iShouldBeLoggedIn() throws Throwable {
loginPage.verifyAccountName();
}
}
| 1,253 | 0.677574 | 0.677574 | 41 | 29.585365 | 24.962387 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.414634 | false | false |
12
|
c5f1cb55202fe2d4238291de4b6f9b1952bcfe15
| 12,953,621,424,623 |
28d725e29306caade458a70a6446e2410eab0184
|
/Chapter 1/PercolationStats.java
|
501175c31ede2b8d4e4e653279098df7f408f474
|
[] |
no_license
|
Xzlgzx/Princeton-Coursera-Algorithm
|
https://github.com/Xzlgzx/Princeton-Coursera-Algorithm
|
c60028a3c24713ae6bad81d01877de569f824f3b
|
912c5f53b03b62a07ceb386d7bc260d7db610d72
|
refs/heads/master
| 2020-07-06T05:28:32.240000 | 2019-08-17T17:26:48 | 2019-08-17T17:26:48 | 202,906,761 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdRandom;
import edu.princeton.cs.algs4.StdStats;
/**
* Stats API needed for checking
*/
public class PercolationStats {
private double[] trialSummary; // sums up the percolation threshold
// perform independent trials on an n-by-n grid
public PercolationStats(int n, int trials){
if(n <= 0 || trials <= 0){ throw new IllegalArgumentException(); }
trialSummary = new double [trials];
int counter = 0;
int row, column;
while(counter < trials){
Percolation trial = new Percolation(n);
int siteToCheck; // random number
while(!trial.percolates()){
while(true){
siteToCheck = StdRandom.uniform(1, n * n + 1);
row = (siteToCheck % n == 0)? (siteToCheck / n) : (siteToCheck / n) + 1;
column = (siteToCheck % n == 0)? n : (siteToCheck % n);
if(!trial.isOpen(row, column)){
trial.open(row, column);
break;
}
}
}
trialSummary[counter] = trial.numberOfOpenSites() / (double)(n * n);
counter++;
}
}
// sample mean of percolation threshold
public double mean(){ return StdStats.mean(trialSummary); }
// sample standard deviation of percolation threshold
public double stddev(){ return StdStats.stddev(trialSummary); }
// low endpoint of 95% confidence interval
public double confidenceLo(){ return mean() - (1.96 * stddev() / Math.sqrt(trialSummary.length)); }
// high endpoint of 95% confidence interval
public double confidenceHi(){ return mean() + (1.96 * stddev() / Math.sqrt(trialSummary.length)); }
// test client (see below)
public static void main(String[] args){
int n = StdIn.readInt();
int trials = StdIn.readInt();
PercolationStats trial1 = new PercolationStats(n, trials);
StdOut.println("mean = " + trial1.mean());
StdOut.println("stddev = " + trial1.stddev());
StdOut.println("95% confidence interval = [" + trial1.confidenceLo() + ", " + trial1.confidenceHi() + "]");
}
}
|
UTF-8
|
Java
| 2,372 |
java
|
PercolationStats.java
|
Java
|
[] | null |
[] |
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdRandom;
import edu.princeton.cs.algs4.StdStats;
/**
* Stats API needed for checking
*/
public class PercolationStats {
private double[] trialSummary; // sums up the percolation threshold
// perform independent trials on an n-by-n grid
public PercolationStats(int n, int trials){
if(n <= 0 || trials <= 0){ throw new IllegalArgumentException(); }
trialSummary = new double [trials];
int counter = 0;
int row, column;
while(counter < trials){
Percolation trial = new Percolation(n);
int siteToCheck; // random number
while(!trial.percolates()){
while(true){
siteToCheck = StdRandom.uniform(1, n * n + 1);
row = (siteToCheck % n == 0)? (siteToCheck / n) : (siteToCheck / n) + 1;
column = (siteToCheck % n == 0)? n : (siteToCheck % n);
if(!trial.isOpen(row, column)){
trial.open(row, column);
break;
}
}
}
trialSummary[counter] = trial.numberOfOpenSites() / (double)(n * n);
counter++;
}
}
// sample mean of percolation threshold
public double mean(){ return StdStats.mean(trialSummary); }
// sample standard deviation of percolation threshold
public double stddev(){ return StdStats.stddev(trialSummary); }
// low endpoint of 95% confidence interval
public double confidenceLo(){ return mean() - (1.96 * stddev() / Math.sqrt(trialSummary.length)); }
// high endpoint of 95% confidence interval
public double confidenceHi(){ return mean() + (1.96 * stddev() / Math.sqrt(trialSummary.length)); }
// test client (see below)
public static void main(String[] args){
int n = StdIn.readInt();
int trials = StdIn.readInt();
PercolationStats trial1 = new PercolationStats(n, trials);
StdOut.println("mean = " + trial1.mean());
StdOut.println("stddev = " + trial1.stddev());
StdOut.println("95% confidence interval = [" + trial1.confidenceLo() + ", " + trial1.confidenceHi() + "]");
}
}
| 2,372 | 0.567032 | 0.554806 | 60 | 38.549999 | 29.513514 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.616667 | false | false |
12
|
3223b2865a27a5a54d7fe3003a794346a5fc0f65
| 5,875,515,317,656 |
7188d975d01cc26710408ec1cba1aeacbde250cd
|
/src/hongkun/tank/TankMessage.java
|
d2f76b447f83e784ce30b576506ffb2d63e2f1d7
|
[] |
no_license
|
HongkunGe/TankWar
|
https://github.com/HongkunGe/TankWar
|
2718c0edc69e9164815aeb9c117cefd611222bec
|
a81dddc11b41d765d4e4be7e69fc36af8f97203f
|
refs/heads/master
| 2021-01-01T03:33:18.115000 | 2018-07-22T22:50:47 | 2018-07-22T22:50:47 | 57,604,102 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package hongkun.tank;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
//import hongkun.tank.TankServer.MessageInfo;
public abstract class TankMessage {
public static final int TANK_MESSAGE_DECODE = 0;
public static final int TANK_NEWMESSAGE = 1;
public static final int TANK_ALREADYMESSAGE = 2;
public static final int TANK_KEYPRESSEDMESSAGE = 3;
public static final int TANK_KEYRELEASEDMESSAGE = 4;
public static final int TANK_QUITMESSAGE = 5;
TankByHuman tank;
int messageType;
public void send(DatagramSocket datagramSocket, String IP, int port) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
// encode the sending data of a new tank.
try {
encode(dos);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
}
byte[] sentTankData = baos.toByteArray();
DatagramPacket dp = null;
try {
dp = new DatagramPacket(sentTankData, sentTankData.length,
new InetSocketAddress(IP, TankServer.UDP_PORT));
datagramSocket.send(dp);
System.out.println("Client#" + + tank.id + " :From Port " + TankClientNetAgent.getUDP_PORT() + ", A packet sent to server");
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public abstract void encode(DataOutputStream dos) throws IOException;
public abstract void decode(DataInputStream dis) throws IOException;
/**
* @param tank
* @param messageType
*/
public TankMessage(TankByHuman tank, int messageType){
this.tank = new TankByHuman(tank);
this.messageType = messageType;
}
public static MessageInfo decodeMessageTop(byte[] buf) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
DataInputStream dis = new DataInputStream(bais);
int idReceived = dis.readInt();
int messageType = dis.readInt();
dis.close();
bais.close();
return new MessageInfo(idReceived, messageType);
}
public static String printMessageType(int mt) {
String printtedType = "";
switch(mt) {
case TANK_MESSAGE_DECODE:
printtedType = "TANK_MESSAGE_DECODE";
break;
case TANK_NEWMESSAGE:
printtedType = "TANK_NEWMESSAGE";
break;
case TANK_ALREADYMESSAGE:
printtedType = "TANK_ALREADYMESSAGE";
break;
case TANK_KEYPRESSEDMESSAGE:
printtedType = "TANK_KEYPRESSEDMESSAGE";
break;
case TANK_KEYRELEASEDMESSAGE:
printtedType = "TANK_KEYRELEASEDDMESSAGE";
break;
case TANK_QUITMESSAGE:
printtedType = "TANK_QUITMESSAGE";
break;
}
return printtedType.toLowerCase();
}
}
class MessageInfo {
public int idReceived;
public int messageType;
public MessageInfo(int idReceived, int messageType) {
this.idReceived = idReceived;
this.messageType = messageType;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "MessageInfo [idReceived=" + idReceived + ", messageType=" + messageType + "]";
}
}
|
UTF-8
|
Java
| 3,458 |
java
|
TankMessage.java
|
Java
|
[] | null |
[] |
package hongkun.tank;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
//import hongkun.tank.TankServer.MessageInfo;
public abstract class TankMessage {
public static final int TANK_MESSAGE_DECODE = 0;
public static final int TANK_NEWMESSAGE = 1;
public static final int TANK_ALREADYMESSAGE = 2;
public static final int TANK_KEYPRESSEDMESSAGE = 3;
public static final int TANK_KEYRELEASEDMESSAGE = 4;
public static final int TANK_QUITMESSAGE = 5;
TankByHuman tank;
int messageType;
public void send(DatagramSocket datagramSocket, String IP, int port) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
// encode the sending data of a new tank.
try {
encode(dos);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
}
byte[] sentTankData = baos.toByteArray();
DatagramPacket dp = null;
try {
dp = new DatagramPacket(sentTankData, sentTankData.length,
new InetSocketAddress(IP, TankServer.UDP_PORT));
datagramSocket.send(dp);
System.out.println("Client#" + + tank.id + " :From Port " + TankClientNetAgent.getUDP_PORT() + ", A packet sent to server");
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public abstract void encode(DataOutputStream dos) throws IOException;
public abstract void decode(DataInputStream dis) throws IOException;
/**
* @param tank
* @param messageType
*/
public TankMessage(TankByHuman tank, int messageType){
this.tank = new TankByHuman(tank);
this.messageType = messageType;
}
public static MessageInfo decodeMessageTop(byte[] buf) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
DataInputStream dis = new DataInputStream(bais);
int idReceived = dis.readInt();
int messageType = dis.readInt();
dis.close();
bais.close();
return new MessageInfo(idReceived, messageType);
}
public static String printMessageType(int mt) {
String printtedType = "";
switch(mt) {
case TANK_MESSAGE_DECODE:
printtedType = "TANK_MESSAGE_DECODE";
break;
case TANK_NEWMESSAGE:
printtedType = "TANK_NEWMESSAGE";
break;
case TANK_ALREADYMESSAGE:
printtedType = "TANK_ALREADYMESSAGE";
break;
case TANK_KEYPRESSEDMESSAGE:
printtedType = "TANK_KEYPRESSEDMESSAGE";
break;
case TANK_KEYRELEASEDMESSAGE:
printtedType = "TANK_KEYRELEASEDDMESSAGE";
break;
case TANK_QUITMESSAGE:
printtedType = "TANK_QUITMESSAGE";
break;
}
return printtedType.toLowerCase();
}
}
class MessageInfo {
public int idReceived;
public int messageType;
public MessageInfo(int idReceived, int messageType) {
this.idReceived = idReceived;
this.messageType = messageType;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "MessageInfo [idReceived=" + idReceived + ", messageType=" + messageType + "]";
}
}
| 3,458 | 0.703586 | 0.701562 | 121 | 26.595041 | 22.072973 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.090909 | false | false |
12
|
8a8844e10aafd55595088ab2b48944f023365d7f
| 4,561,255,279,261 |
e4d44dc3c869ee44a746f21bc8862eb0047173eb
|
/src/test/java/arrays/InPlaceDuplicateRemoval.java
|
f38b65285f500f7d071e709ccb6ea0cf9e0714ff
|
[] |
no_license
|
agapeteo/java-data-algo
|
https://github.com/agapeteo/java-data-algo
|
7dffa6e3ece50c4913de1c1a04d19c82613861fa
|
2e8dde115109989dffba70ffefcc9b3553296a50
|
refs/heads/master
| 2021-05-26T00:46:55.077000 | 2020-04-08T04:38:23 | 2020-04-08T04:38:23 | 253,987,113 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package arrays;
import java.util.Arrays;
public class InPlaceDuplicateRemoval {
public static int remove(Object[] arr) {
Arrays.sort(arr);
int i = 0;
for (int j = 1; j < arr.length; j++) {
if (!arr[j].equals(arr[i])) {
arr[i + 1] = arr[j];
i++;
}
}
return i;
}
}
|
UTF-8
|
Java
| 370 |
java
|
InPlaceDuplicateRemoval.java
|
Java
|
[] | null |
[] |
package arrays;
import java.util.Arrays;
public class InPlaceDuplicateRemoval {
public static int remove(Object[] arr) {
Arrays.sort(arr);
int i = 0;
for (int j = 1; j < arr.length; j++) {
if (!arr[j].equals(arr[i])) {
arr[i + 1] = arr[j];
i++;
}
}
return i;
}
}
| 370 | 0.451351 | 0.443243 | 18 | 19.555555 | 15.464016 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
11c597cf7b5104eba2189cc5bb9ef112b1084bdd
| 23,356,032,180,103 |
139d0dd628631cdcb241e76b861be00443192d34
|
/health_interface/src/main/java/com/itheima/health/service/OrderSettingService.java
|
dcf5e34647b29be7fefbb962b6bc59b586d1c8d2
|
[] |
no_license
|
seek-geek/health_parent
|
https://github.com/seek-geek/health_parent
|
9e603fe2443ad03c207ee8938ce9350381512353
|
2aad683886db3da06226b721100fb7d7f9856f68
|
refs/heads/master
| 2023-01-06T11:05:31.534000 | 2020-11-02T14:25:07 | 2020-11-02T14:25:07 | 306,845,652 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.itheima.health.service;
import com.itheima.health.pojo.OrderSetting;
import java.util.List;
import java.util.Map;
public interface OrderSettingService {
void add(List<OrderSetting> orderSetting);
List<Map<String, Integer>> getOrderSettingByMonth(String month);
}
|
UTF-8
|
Java
| 288 |
java
|
OrderSettingService.java
|
Java
|
[] | null |
[] |
package com.itheima.health.service;
import com.itheima.health.pojo.OrderSetting;
import java.util.List;
import java.util.Map;
public interface OrderSettingService {
void add(List<OrderSetting> orderSetting);
List<Map<String, Integer>> getOrderSettingByMonth(String month);
}
| 288 | 0.78125 | 0.78125 | 13 | 21.153847 | 22.280886 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.538462 | false | false |
12
|
768c63da9093345634a3f70ca35804c5c2e0c30c
| 25,220,048,022,265 |
9dba3cdbebb7d643fc96e1e35910510327c26408
|
/src/main/java/com/example/starterboot/ServiceTwo.java
|
3c2df33fd210d0c713210c7efc3271d630f8c5ed
|
[] |
no_license
|
dmallick/springboot-dev
|
https://github.com/dmallick/springboot-dev
|
18540c63a91c25591352ecdc17e82b1b91b8adb8
|
6feec4e87ce6c0281984b4996e6fc2f33ba345d0
|
refs/heads/master
| 2021-03-01T21:11:58.980000 | 2020-03-08T14:46:28 | 2020-03-08T14:46:28 | 245,814,163 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.starterboot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
@RequestMapping("/platform")
public class ServiceTwo {
@Autowired
RestTemplate restTemplate;
@RequestMapping("/id")
private String printMsg() {
//String response = restTemplate.getForObject("http://service1/movies1/id1", String.class);
return "Hello Platform ....";
}
}
|
UTF-8
|
Java
| 580 |
java
|
ServiceTwo.java
|
Java
|
[] | null |
[] |
package com.example.starterboot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
@RequestMapping("/platform")
public class ServiceTwo {
@Autowired
RestTemplate restTemplate;
@RequestMapping("/id")
private String printMsg() {
//String response = restTemplate.getForObject("http://service1/movies1/id1", String.class);
return "Hello Platform ....";
}
}
| 580 | 0.784483 | 0.77931 | 22 | 25.363636 | 25.606365 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.045455 | false | false |
12
|
0cede5e38fa57ba33ef7bf349a6272635a73b75d
| 25,220,048,020,300 |
265a142790dc622cb4d497a9e9ea58683fdf0d95
|
/javaweb/WEB22/src/com/_520it/ajax/AjaxServlet2.java
|
f199fc2d5c857adcfb25022a7b8d8003fa5a83b7
|
[] |
no_license
|
MrUnparalleled/JAVAWEB
|
https://github.com/MrUnparalleled/JAVAWEB
|
f32f092883a3e6546d50cc8fd9744d07c7a46de5
|
ee27c702904a4aa6d6f7c73fd3f01d67883590a3
|
refs/heads/master
| 2020-04-29T14:24:55.823000 | 2019-08-24T08:34:03 | 2019-08-24T08:34:03 | 176,195,677 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com._520it.ajax;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/ajaxServlet2")
public class AjaxServlet2 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String name = request.getParameter("name");
String age = request.getParameter("age");
System.out.println(name+"-----"+age);
//response.getWriter().write("success.....");
//json¸ñʽ
response.getWriter().write("{\"name\":\"zhangsan\",\"age\":18}");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
|
WINDOWS-1252
|
Java
| 884 |
java
|
AjaxServlet2.java
|
Java
|
[
{
"context": "son¸ñʽ\n\t\tresponse.getWriter().write(\"{\\\"name\\\":\\\"zhangsan\\\",\\\"age\\\":18}\");\n\t}\n\n\tpublic void doPost(HttpServ",
"end": 709,
"score": 0.9989757537841797,
"start": 701,
"tag": "NAME",
"value": "zhangsan"
}
] | null |
[] |
package com._520it.ajax;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/ajaxServlet2")
public class AjaxServlet2 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String name = request.getParameter("name");
String age = request.getParameter("age");
System.out.println(name+"-----"+age);
//response.getWriter().write("success.....");
//json¸ñʽ
response.getWriter().write("{\"name\":\"zhangsan\",\"age\":18}");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| 884 | 0.765909 | 0.756818 | 27 | 31.629629 | 30.926613 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.444444 | false | false |
12
|
19010bf3060412b1e5f15cead804d041c166984b
| 37,761,352,495,163 |
f7b876a91545952f58d19b62ba71a57926cbe477
|
/library/src/main/java/com/cafe/demo/library/adapter/ViewHolder.java
|
0fe0a5161db53aaa66a3b02d99a91f03e53daaa2
|
[] |
no_license
|
TangerineOrange/MyWeather
|
https://github.com/TangerineOrange/MyWeather
|
359b67fe8477df01730ba7ce0b8b4422432dc5dc
|
b8477e396e8dd90944867f9af7cb0974ab6a3201
|
refs/heads/master
| 2020-12-30T11:52:28.362000 | 2017-05-16T08:27:17 | 2017-05-16T08:27:17 | 91,433,602 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.cafe.demo.library.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
/**
* Created by WangKun on 2016/11/13.
* Time : 2016/11/13,15:05.
*/
public class ViewHolder extends RecyclerView.ViewHolder {
private SparseArray<View> mViewArray;
private int mViewType;
/**
* 初始化ViewHolder
*
* @param itemView item的view
* @param mViewType view 类型
*/
public ViewHolder(View itemView, int mViewType) {
super(itemView);
mViewArray = new SparseArray<>();
this.mViewType = mViewType;
}
public ViewHolder(View itemView) {
super(itemView);
mViewArray = new SparseArray<>();
}
public void setItemOnClickListener(View.OnClickListener listener) {
itemView.setTag(getLayoutPosition());
itemView.setOnClickListener(listener);
}
/**
* 创建viewholder
*
* @return
*/
public static ViewHolder getHeader(View header) {
return new ViewHolder(header);
}
/**
* 创建viewholder
*
* @param context
* @param parent
* @param layoutId
* @return
*/
public static ViewHolder get(Context context, ViewGroup parent, int layoutId, int mViewType) {
View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
false);
return new ViewHolder(itemView, mViewType);
}
public int getviewType() {
return mViewType;
}
/**
* 通过viewId获取控件
*
* @param viewId
* @return
*/
@SuppressWarnings("unchecked")
public <T extends View> T getView(int viewId) {
View view = mViewArray.get(viewId);
if (view == null) {
view = itemView.findViewById(viewId);
mViewArray.put(viewId, view);
}
return (T) view;
}
public ViewHolder setText(int viewId, String text) {
TextView view = getView(viewId);
if (view != null)
view.setText(text);
return this;
}
public ViewHolder setImageResource(int viewId, int resId) {
ImageView view = getView(viewId);
if (view != null)
view.setImageResource(resId);
return this;
}
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
View view = getView(viewId);
if (view != null)
view.setOnClickListener(listener);
return this;
}
}
|
UTF-8
|
Java
| 2,699 |
java
|
ViewHolder.java
|
Java
|
[
{
"context": "import android.widget.TextView;\n\n/**\n * Created by WangKun on 2016/11/13.\n * Time : 2016/11/13,15:05.\n */\n\np",
"end": 336,
"score": 0.9275996685028076,
"start": 329,
"tag": "USERNAME",
"value": "WangKun"
}
] | null |
[] |
package com.cafe.demo.library.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
/**
* Created by WangKun on 2016/11/13.
* Time : 2016/11/13,15:05.
*/
public class ViewHolder extends RecyclerView.ViewHolder {
private SparseArray<View> mViewArray;
private int mViewType;
/**
* 初始化ViewHolder
*
* @param itemView item的view
* @param mViewType view 类型
*/
public ViewHolder(View itemView, int mViewType) {
super(itemView);
mViewArray = new SparseArray<>();
this.mViewType = mViewType;
}
public ViewHolder(View itemView) {
super(itemView);
mViewArray = new SparseArray<>();
}
public void setItemOnClickListener(View.OnClickListener listener) {
itemView.setTag(getLayoutPosition());
itemView.setOnClickListener(listener);
}
/**
* 创建viewholder
*
* @return
*/
public static ViewHolder getHeader(View header) {
return new ViewHolder(header);
}
/**
* 创建viewholder
*
* @param context
* @param parent
* @param layoutId
* @return
*/
public static ViewHolder get(Context context, ViewGroup parent, int layoutId, int mViewType) {
View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
false);
return new ViewHolder(itemView, mViewType);
}
public int getviewType() {
return mViewType;
}
/**
* 通过viewId获取控件
*
* @param viewId
* @return
*/
@SuppressWarnings("unchecked")
public <T extends View> T getView(int viewId) {
View view = mViewArray.get(viewId);
if (view == null) {
view = itemView.findViewById(viewId);
mViewArray.put(viewId, view);
}
return (T) view;
}
public ViewHolder setText(int viewId, String text) {
TextView view = getView(viewId);
if (view != null)
view.setText(text);
return this;
}
public ViewHolder setImageResource(int viewId, int resId) {
ImageView view = getView(viewId);
if (view != null)
view.setImageResource(resId);
return this;
}
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
View view = getView(viewId);
if (view != null)
view.setOnClickListener(listener);
return this;
}
}
| 2,699 | 0.617923 | 0.610049 | 111 | 23.027027 | 20.640404 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.423423 | false | false |
12
|
2ecd7aac9cf5b4fa54d0d8370276d67ce56df2d0
| 60,129,600,986 |
24c81ba2f9cf6f254f93d06a16d19e20cf624321
|
/Java8Features/src/Java8_CoreChanges.java
|
092c8c0bd7bf0b8ec5894f588fb1de6903c3bcf4
|
[] |
no_license
|
shubhamjadhav-git/Java8
|
https://github.com/shubhamjadhav-git/Java8
|
9a48a43f7e0f74055d096a1d99eb8efb3f8efb30
|
7cfc7f6df598d15a3b94a3205c547beab714402e
|
refs/heads/main
| 2023-04-11T12:12:35.934000 | 2021-04-24T19:08:55 | 2021-04-24T19:08:55 | 361,180,118 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* ThreadLocal static method withInitial(Supplier supplier) to create instance easily.
*
* Comparator interface has been extended with a lot of default and static methods for natural ordering, reverse order etc.
*
* min(), max() and sum() methods in Integer, Long and Double wrapper classes.
*
* logicalAnd(), logicalOr() and logicalXor() methods in Boolean class.
*
* ZipFile.stream() method to get an ordered Stream over the ZIP file entries. Entries appear in the Stream in the order they appear in the central directory of the ZIP file.
*
* Several utility methods in Math class
*
* jjs command is added to invoke Nashorn Engine.
*
* jdeps command is added to analyze class files
*
* JDBC-ODBC Bridge has been removed.
*
* PermGen memory space has been removed
* */
public class Java8_CoreChanges {
}
|
UTF-8
|
Java
| 838 |
java
|
Java8_CoreChanges.java
|
Java
|
[] | null |
[] |
/*
* ThreadLocal static method withInitial(Supplier supplier) to create instance easily.
*
* Comparator interface has been extended with a lot of default and static methods for natural ordering, reverse order etc.
*
* min(), max() and sum() methods in Integer, Long and Double wrapper classes.
*
* logicalAnd(), logicalOr() and logicalXor() methods in Boolean class.
*
* ZipFile.stream() method to get an ordered Stream over the ZIP file entries. Entries appear in the Stream in the order they appear in the central directory of the ZIP file.
*
* Several utility methods in Math class
*
* jjs command is added to invoke Nashorn Engine.
*
* jdeps command is added to analyze class files
*
* JDBC-ODBC Bridge has been removed.
*
* PermGen memory space has been removed
* */
public class Java8_CoreChanges {
}
| 838 | 0.73031 | 0.729117 | 24 | 33.875 | 44.156269 | 174 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | false | false |
12
|
3e7621753a949123daf3e73ea52e869b2ba5d464
| 36,378,373,035,182 |
707faf9498b106f93305321b2f1ee9c31784506f
|
/university-work/uu/networked objects/interceptor/src/src/client/interceptors/LoginInterceptor.java
|
917e5b0fcde5d18b10e5ad7bdae4561822bd9eb0
|
[] |
no_license
|
bdumitriu/playground
|
https://github.com/bdumitriu/playground
|
489479996fd3c8a83f456d08c01de5e09acb18d8
|
22a67f59832f0367806e50c84f2aec1ebba18150
|
refs/heads/master
| 2023-07-31T13:53:37.833000 | 2023-07-18T23:06:28 | 2023-07-18T23:07:24 | 2,675,737 | 1 | 0 | null | false | 2022-11-24T03:00:56 | 2011-10-30T15:39:47 | 2022-11-03T11:09:40 | 2022-11-24T03:00:53 | 17,467 | 2 | 0 | 13 |
Java
| false | false |
package client.interceptors;
import client.contexts.LoginContext;
/**
* @author Bogdan Dumitriu
* @author bdumitriu@bdumitiru.ro
* @version 0.1
* @date Sep 19, 2005
*/
public interface LoginInterceptor
{
public void preLogin(LoginContext ctx);
public void postLogin(LoginContext ctx);
public void preLogout(LoginContext ctx);
public void postLogout(LoginContext ctx);
}
|
UTF-8
|
Java
| 404 |
java
|
LoginInterceptor.java
|
Java
|
[
{
"context": "t client.contexts.LoginContext;\r\n\r\n/**\r\n * @author Bogdan Dumitriu\r\n * @author bdumitriu@bdumitiru.ro\r\n * @version 0",
"end": 103,
"score": 0.9998800754547119,
"start": 88,
"tag": "NAME",
"value": "Bogdan Dumitriu"
},
{
"context": "xt;\r\n\r\n/**\r\n * @author Bogdan Dumitriu\r\n * @author bdumitriu@bdumitiru.ro\r\n * @version 0.1\r\n * @date Sep 19, 2005\r\n */\r\npub",
"end": 138,
"score": 0.9999306797981262,
"start": 116,
"tag": "EMAIL",
"value": "bdumitriu@bdumitiru.ro"
}
] | null |
[] |
package client.interceptors;
import client.contexts.LoginContext;
/**
* @author <NAME>
* @author <EMAIL>
* @version 0.1
* @date Sep 19, 2005
*/
public interface LoginInterceptor
{
public void preLogin(LoginContext ctx);
public void postLogin(LoginContext ctx);
public void preLogout(LoginContext ctx);
public void postLogout(LoginContext ctx);
}
| 380 | 0.722772 | 0.70297 | 20 | 18.200001 | 16.913309 | 42 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.55 | false | false |
12
|
d282adb416b167aa30178a3391c78d56b6c24685
| 38,654,705,690,430 |
bf6cf363464f3e69cee811fd68c83f6cc0da95aa
|
/org/newdawn/slick/openal/NullAudio.java
|
f7275bb201da01382c7796124a334692dbdffa31
|
[] |
no_license
|
Gopro336/Xulu_Deobf_By336
|
https://github.com/Gopro336/Xulu_Deobf_By336
|
ad6e71b0e8ef581e652500bc0419b78eed562f47
|
ce281b07058223a3ebfb08eb76311a5e38d4fad6
|
refs/heads/main
| 2023-01-08T16:08:30.018000 | 2020-11-01T20:45:00 | 2020-11-01T20:45:00 | 306,436,235 | 4 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.newdawn.slick.openal;
public class NullAudio implements Audio {
public float getPosition() {
return 0.0F;
}
public int playAsSoundEffect(float var1, float var2, boolean var3, float var4, float var5, float var6) {
return 0;
}
public int playAsSoundEffect(float var1, float var2, boolean var3) {
return 0;
}
public int playAsMusic(float var1, float var2, boolean var3) {
return 0;
}
public int getBufferID() {
return 0;
}
public boolean isPlaying() {
return false;
}
public void stop() {
}
public boolean setPosition(float var1) {
return false;
}
}
|
UTF-8
|
Java
| 657 |
java
|
NullAudio.java
|
Java
|
[] | null |
[] |
package org.newdawn.slick.openal;
public class NullAudio implements Audio {
public float getPosition() {
return 0.0F;
}
public int playAsSoundEffect(float var1, float var2, boolean var3, float var4, float var5, float var6) {
return 0;
}
public int playAsSoundEffect(float var1, float var2, boolean var3) {
return 0;
}
public int playAsMusic(float var1, float var2, boolean var3) {
return 0;
}
public int getBufferID() {
return 0;
}
public boolean isPlaying() {
return false;
}
public void stop() {
}
public boolean setPosition(float var1) {
return false;
}
}
| 657 | 0.637747 | 0.608828 | 34 | 18.32353 | 23.816357 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
249a629b72cff25df088f4ec8e4e455cc452a7a5
| 35,424,890,258,381 |
7aba5e567bf8fcdf5d5f83a6bf2274ee3f1b45c0
|
/src/main/java/com/ankerdiao/practice/security/Base64Example.java
|
ce2a3425bd96ec2245d0f90a88ad55feb477eaad
|
[
"Apache-2.0"
] |
permissive
|
ankerdiao/com_ankerdiao_practice
|
https://github.com/ankerdiao/com_ankerdiao_practice
|
0f87d83da91f0c92ef860aea7d91719587ea5ae8
|
54d9fcd19a55fad883e35c8dd35c122f9e74e5c0
|
refs/heads/master
| 2018-02-10T14:02:40.458000 | 2017-07-11T02:07:49 | 2017-07-11T02:07:49 | 32,979,122 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ankerdiao.practice.security;
import java.io.IOException;
import org.apache.commons.codec.binary.Base64;
public class Base64Example {
/**
* 编码
*
* @param bstr
* @return String
*/
public static String encode(byte[] bstr) {
return new sun.misc.BASE64Encoder().encode(bstr);
}
/**
* 解码
*
* @param str
* @return string
*/
public static byte[] decode(String str) {
byte[] bt = null;
try {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
} catch (IOException e) {
e.printStackTrace();
}
return bt;
}
public static String Base64_encodeBase64(byte[] binaryData){
byte[] encodeBase64 = Base64.encodeBase64(binaryData);
String string = new String(encodeBase64);
return string;
}
public static byte[] Base64_decodeBase64(String binaryData){
byte[] base64 = Base64.decodeBase64(binaryData.getBytes());
return base64;
}
}
|
UTF-8
|
Java
| 1,013 |
java
|
Base64Example.java
|
Java
|
[] | null |
[] |
package com.ankerdiao.practice.security;
import java.io.IOException;
import org.apache.commons.codec.binary.Base64;
public class Base64Example {
/**
* 编码
*
* @param bstr
* @return String
*/
public static String encode(byte[] bstr) {
return new sun.misc.BASE64Encoder().encode(bstr);
}
/**
* 解码
*
* @param str
* @return string
*/
public static byte[] decode(String str) {
byte[] bt = null;
try {
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
bt = decoder.decodeBuffer(str);
} catch (IOException e) {
e.printStackTrace();
}
return bt;
}
public static String Base64_encodeBase64(byte[] binaryData){
byte[] encodeBase64 = Base64.encodeBase64(binaryData);
String string = new String(encodeBase64);
return string;
}
public static byte[] Base64_decodeBase64(String binaryData){
byte[] base64 = Base64.decodeBase64(binaryData.getBytes());
return base64;
}
}
| 1,013 | 0.639801 | 0.60597 | 53 | 16.962265 | 20.055548 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.377358 | false | false |
12
|
37c0bcf72cb663fbe9840737202590ea3e54723c
| 429,496,787,756 |
3e09730be2d17eea407d65318cbb15450cacd29f
|
/codes/java_datastructure_luozhaoyong/src/demo5/BinaryTree.java
|
39fc877d60ec2765f7e6d5d494af5ddab90fc674
|
[] |
no_license
|
bigablecat/algorithm
|
https://github.com/bigablecat/algorithm
|
f23cc0fb3b57e95fd3e4f99ebe3a187a7dd41c5a
|
a6e9161c89fb37e9f4398beff0aed6bf307f489b
|
refs/heads/master
| 2023-03-21T11:14:19.104000 | 2021-03-15T15:39:36 | 2021-03-15T15:39:36 | 165,678,033 | 1 | 0 | null | true | 2019-01-14T14:44:01 | 2019-01-14T14:44:00 | 2019-01-14T14:43:15 | 2019-01-14T14:43:06 | 1 | 0 | 0 | 0 | null | false | null |
package demo5;
/**
* 二叉树
* @author admin
*/
public class BinaryTree {
/**
* 根结点
*/
TreeNode root;
/**
* 设置根结点
*
* @param node 节点参数
*/
public void setRoot(TreeNode node) {
root = node;
}
/**
* 前序遍历
*/
public void frontShow() {
if (root == null) {
System.out.println("树为空");
return;
}
// 调用根结点的前序遍历方法
root.frontShow();
// 打印一个空行,与主逻辑无关
System.out.println();
}
/**
* 中序遍历
*/
public void midShow() {
if (root == null) {
return;
}
root.midShow();
System.out.println();
}
/**
* 后序遍历
*/
public void afterShow() {
if (root == null) {
return;
}
root.afterShow();
System.out.println();
}
/**
* 前序查找
*
* @param i
* @return
*/
public TreeNode frontSearch(int i) {
return root.frontSearch(i);
}
/**
* 删除方法
*
* @param i
*/
public void delete(int i) {
if (root.value == i) {
root = null;
return;
}
root.delete(i);
}
}
|
UTF-8
|
Java
| 1,349 |
java
|
BinaryTree.java
|
Java
|
[
{
"context": "package demo5;\n\n/**\n * 二叉树\n * @author admin\n */\npublic class BinaryTree {\n /**\n * 根结点\n",
"end": 43,
"score": 0.986162006855011,
"start": 38,
"tag": "USERNAME",
"value": "admin"
}
] | null |
[] |
package demo5;
/**
* 二叉树
* @author admin
*/
public class BinaryTree {
/**
* 根结点
*/
TreeNode root;
/**
* 设置根结点
*
* @param node 节点参数
*/
public void setRoot(TreeNode node) {
root = node;
}
/**
* 前序遍历
*/
public void frontShow() {
if (root == null) {
System.out.println("树为空");
return;
}
// 调用根结点的前序遍历方法
root.frontShow();
// 打印一个空行,与主逻辑无关
System.out.println();
}
/**
* 中序遍历
*/
public void midShow() {
if (root == null) {
return;
}
root.midShow();
System.out.println();
}
/**
* 后序遍历
*/
public void afterShow() {
if (root == null) {
return;
}
root.afterShow();
System.out.println();
}
/**
* 前序查找
*
* @param i
* @return
*/
public TreeNode frontSearch(int i) {
return root.frontSearch(i);
}
/**
* 删除方法
*
* @param i
*/
public void delete(int i) {
if (root.value == i) {
root = null;
return;
}
root.delete(i);
}
}
| 1,349 | 0.403925 | 0.403107 | 81 | 14.098765 | 10.733132 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.209877 | false | false |
12
|
b5051bd022eba179eb3fbd04402271e4cb0606bd
| 25,451,976,225,312 |
5d3d9098df3cf4d62e2885642758345bb5893ed7
|
/src/main/java/com/example/designpatterns/rules/Customer.java
|
67e893a201b9c57221093c5ecd76d6ad653573c7
|
[] |
no_license
|
eight9080/test
|
https://github.com/eight9080/test
|
75e682795412d17a0edcfad9aa73106b79b9cf70
|
ebe6d50bf50a837f3857957cddef323c96dc8128
|
refs/heads/master
| 2021-07-08T13:12:55.294000 | 2021-04-23T19:53:24 | 2021-04-23T19:53:24 | 78,650,101 | 0 | 0 | null | false | 2021-03-31T19:35:24 | 2017-01-11T15:06:16 | 2020-11-22T20:44:51 | 2021-03-31T19:35:21 | 820 | 0 | 0 | 2 |
Java
| false | false |
package com.example.designpatterns.rules;
import java.time.LocalDate;
public class Customer {
public LocalDate dateOfFirstPurchase;
public LocalDate dateOfBirth;
public boolean veteran;
public Customer() {
}
public Customer(LocalDate dateOfFirstPurchase, LocalDate dateOfBirth, boolean veteran) {
this.dateOfFirstPurchase = dateOfFirstPurchase;
this.dateOfBirth = dateOfBirth;
this.veteran = veteran;
}
public LocalDate getDateOfFirstPurchase() {
return dateOfFirstPurchase;
}
public LocalDate getDateOfBirth() {
return dateOfBirth;
}
public boolean isVeteran() {
return veteran;
}
}
|
UTF-8
|
Java
| 692 |
java
|
Customer.java
|
Java
|
[] | null |
[] |
package com.example.designpatterns.rules;
import java.time.LocalDate;
public class Customer {
public LocalDate dateOfFirstPurchase;
public LocalDate dateOfBirth;
public boolean veteran;
public Customer() {
}
public Customer(LocalDate dateOfFirstPurchase, LocalDate dateOfBirth, boolean veteran) {
this.dateOfFirstPurchase = dateOfFirstPurchase;
this.dateOfBirth = dateOfBirth;
this.veteran = veteran;
}
public LocalDate getDateOfFirstPurchase() {
return dateOfFirstPurchase;
}
public LocalDate getDateOfBirth() {
return dateOfBirth;
}
public boolean isVeteran() {
return veteran;
}
}
| 692 | 0.689306 | 0.689306 | 31 | 21.32258 | 21.407547 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.419355 | false | false |
12
|
1d161886469985c3aee4652b929e10054f31f418
| 29,978,871,752,767 |
90d61a7a9496111124fb2d6ccc81d69d0afa99f3
|
/src/main/java/com/blog/dao/NavigationDaoImpl.java
|
13143e383be3a12666bf9979bcd70c9b8be4b094
|
[] |
no_license
|
714303584/zblog
|
https://github.com/714303584/zblog
|
54b0a2e566e6739926a9057fb2e8253eb19b043a
|
f6c3ae1cb6dbfcc3e912501826d1cae35144a63f
|
refs/heads/master
| 2020-04-06T07:04:13.518000 | 2017-06-30T02:57:21 | 2017-06-30T02:57:21 | 53,911,560 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.blog.dao;
import java.util.List;
import java.util.Map;
import com.blog.entity.Navigation;
public interface NavigationDaoImpl {
public Navigation getById(long id);
public void save(Navigation entity);
public List<Navigation> findListBy(Map<String, Object> map);
public List<Navigation> findPageBy(Map<String, Object> map);
public void deleteByIds(long[] ids);
public void update(Navigation entity);
public int getCountBy(Map<String, Object> map);
}
|
UTF-8
|
Java
| 510 |
java
|
NavigationDaoImpl.java
|
Java
|
[] | null |
[] |
package com.blog.dao;
import java.util.List;
import java.util.Map;
import com.blog.entity.Navigation;
public interface NavigationDaoImpl {
public Navigation getById(long id);
public void save(Navigation entity);
public List<Navigation> findListBy(Map<String, Object> map);
public List<Navigation> findPageBy(Map<String, Object> map);
public void deleteByIds(long[] ids);
public void update(Navigation entity);
public int getCountBy(Map<String, Object> map);
}
| 510 | 0.715686 | 0.715686 | 23 | 20.043478 | 20.73325 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.217391 | false | false |
12
|
5e3a5fe9a091ab96847dea37169b10b950c89b9f
| 35,055,523,083,312 |
772a5b4189dfe971619955eac678e97ad7f6f600
|
/app/src/main/java/com/hobarb/costtler/Activities/History.java
|
c8b6064a0d97c6f7aac00f7bf5baa3581da6b59d
|
[] |
no_license
|
dikamjit-borah/Costtler
|
https://github.com/dikamjit-borah/Costtler
|
46ac84e164d0278d6bcd3a8d54846141b62692f5
|
ad34730e7babfb3581f1f4ff0343452f62f67727
|
refs/heads/master
| 2023-02-08T15:00:42.853000 | 2021-01-04T18:20:08 | 2021-01-04T18:20:08 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hobarb.costtler.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.hobarb.costtler.Adapters.HistoryAdapter;
import com.hobarb.costtler.Models.HistoryModel;
import com.hobarb.costtler.R;
import com.hobarb.costtler.Utilities.Constants;
import java.util.ArrayList;
public class History extends AppCompatActivity {
Toolbar toolbar;
TextView toolbarText;
RecyclerView recyclerView;
DatabaseReference databaseReference;
ArrayList<HistoryModel> historyModels;
HistoryAdapter historyAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
toolbar = findViewById(R.id.tB_custom_ct1);
setSupportActionBar(toolbar);
toolbarText = toolbar.findViewById(R.id.tV_activity_ct);
toolbarText.setText("History");
//toolbar.setTitleTextAppearance(this, R.style.setFont_white);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
String username = getSharedPreferences(Constants.SHARED_PREFS, MODE_PRIVATE).getString(Constants.USER_NAME, "");
String phone = getSharedPreferences(Constants.SHARED_PREFS, MODE_PRIVATE).getString(Constants.USER_PHONE, "");
recyclerView = findViewById(R.id.rV_history);
historyModels = new ArrayList<>();
/* databaseReference = FirebaseDatabase.getInstance().getReference().child(Constants.USER_PHONE+"/").child(Constants.CURRENT_DATE+"/");*/
databaseReference = FirebaseDatabase.getInstance().getReference();
databaseReference.child(phone).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
for(DataSnapshot dataSnapshot: snapshot.getChildren())
{
try{
HistoryModel model = new HistoryModel(dataSnapshot.child(Constants.TOTAL_AMOUNT_TODAY).getValue().toString(), dataSnapshot.getKey().toString());
historyModels.add(model);
}
catch (Exception exception)
{
Toast.makeText(History.this, "History" + exception.getMessage(), Toast.LENGTH_SHORT).show();
return;
}
}
// Toast.makeText(TransactionsToday.this, "Going" , Toast.LENGTH_SHORT).show();
historyAdapter = new HistoryAdapter(History.this, historyModels);
recyclerView.setLayoutManager(new LinearLayoutManager(History.this));
recyclerView.setAdapter(historyAdapter);
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(History.this, "" + error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
|
UTF-8
|
Java
| 3,800 |
java
|
History.java
|
Java
|
[] | null |
[] |
package com.hobarb.costtler.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.hobarb.costtler.Adapters.HistoryAdapter;
import com.hobarb.costtler.Models.HistoryModel;
import com.hobarb.costtler.R;
import com.hobarb.costtler.Utilities.Constants;
import java.util.ArrayList;
public class History extends AppCompatActivity {
Toolbar toolbar;
TextView toolbarText;
RecyclerView recyclerView;
DatabaseReference databaseReference;
ArrayList<HistoryModel> historyModels;
HistoryAdapter historyAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
toolbar = findViewById(R.id.tB_custom_ct1);
setSupportActionBar(toolbar);
toolbarText = toolbar.findViewById(R.id.tV_activity_ct);
toolbarText.setText("History");
//toolbar.setTitleTextAppearance(this, R.style.setFont_white);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
String username = getSharedPreferences(Constants.SHARED_PREFS, MODE_PRIVATE).getString(Constants.USER_NAME, "");
String phone = getSharedPreferences(Constants.SHARED_PREFS, MODE_PRIVATE).getString(Constants.USER_PHONE, "");
recyclerView = findViewById(R.id.rV_history);
historyModels = new ArrayList<>();
/* databaseReference = FirebaseDatabase.getInstance().getReference().child(Constants.USER_PHONE+"/").child(Constants.CURRENT_DATE+"/");*/
databaseReference = FirebaseDatabase.getInstance().getReference();
databaseReference.child(phone).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
for(DataSnapshot dataSnapshot: snapshot.getChildren())
{
try{
HistoryModel model = new HistoryModel(dataSnapshot.child(Constants.TOTAL_AMOUNT_TODAY).getValue().toString(), dataSnapshot.getKey().toString());
historyModels.add(model);
}
catch (Exception exception)
{
Toast.makeText(History.this, "History" + exception.getMessage(), Toast.LENGTH_SHORT).show();
return;
}
}
// Toast.makeText(TransactionsToday.this, "Going" , Toast.LENGTH_SHORT).show();
historyAdapter = new HistoryAdapter(History.this, historyModels);
recyclerView.setLayoutManager(new LinearLayoutManager(History.this));
recyclerView.setAdapter(historyAdapter);
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(History.this, "" + error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
| 3,800 | 0.674737 | 0.674474 | 107 | 34.523365 | 34.222294 | 168 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.616822 | false | false |
12
|
758c0bf83d878db2c51df1a841339889fd94554d
| 35,064,113,017,300 |
111d7120f5f23a41192668c47d95da607a13e6b7
|
/bh-tsne/src/main/java/de/javagl/tsne/EuclideanDistance.java
|
79a540ef6ffdb925aaad0b86daab8f51a371ca36
|
[
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
javagl/bh-tsne
|
https://github.com/javagl/bh-tsne
|
05ff36dacc3d979e8297c032be19be8d0f3de857
|
d1ad1529279f65e272df316f3f29927be97dff12
|
refs/heads/master
| 2022-12-24T16:28:21.261000 | 2020-09-23T20:55:41 | 2020-09-23T20:55:41 | 260,459,557 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* See BHTSne.java for copyright and license information!
*/
package de.javagl.tsne;
import static java.lang.Math.sqrt;
class EuclideanDistance implements Distance
{
public EuclideanDistance()
{
}
@Override
public double distance(DataPoint d1, DataPoint d2)
{
double dd = .0;
DoubleArray x1 = d1._x;
DoubleArray x2 = d2._x;
double diff;
for (int d = 0; d < d1._D; d++)
{
diff = (x1.get(d) - x2.get(d));
dd += diff * diff;
}
return sqrt(dd);
}
}
|
UTF-8
|
Java
| 573 |
java
|
EuclideanDistance.java
|
Java
|
[] | null |
[] |
/*
* See BHTSne.java for copyright and license information!
*/
package de.javagl.tsne;
import static java.lang.Math.sqrt;
class EuclideanDistance implements Distance
{
public EuclideanDistance()
{
}
@Override
public double distance(DataPoint d1, DataPoint d2)
{
double dd = .0;
DoubleArray x1 = d1._x;
DoubleArray x2 = d2._x;
double diff;
for (int d = 0; d < d1._D; d++)
{
diff = (x1.get(d) - x2.get(d));
dd += diff * diff;
}
return sqrt(dd);
}
}
| 573 | 0.537522 | 0.518325 | 31 | 17.483871 | 17.503679 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.387097 | false | false |
12
|
cefadd988420a751493997f2b4cc57457a0f597d
| 9,028,021,280,431 |
55b3651d0cb62c91816dbfb9c14324c01bd64b65
|
/Fianl Project/151220172-郑运辉/final/src/main/java/nju/java/creature/Animal.java
|
4ca43f1122a2de1c4f3a2dbd5ceca2c0b68b0616
|
[] |
no_license
|
irishaha/java-2017f-homework
|
https://github.com/irishaha/java-2017f-homework
|
e942688ccc49213ae53c6cee01552cf15c7345f5
|
af9b2071de4896eebbb27da43d23e4d8a84c8b5d
|
refs/heads/master
| 2021-09-04T07:54:46.721000 | 2018-01-17T06:51:12 | 2018-01-17T06:51:12 | 103,260,952 | 2 | 0 | null | true | 2017-10-18T14:50:25 | 2017-09-12T11:17:27 | 2017-10-18T14:05:23 | 2017-10-18T14:50:24 | 208 | 1 | 0 | 0 |
Java
| null | null |
package nju.java.creature;
import nju.java.common.GLOBAL;
import nju.java.common.cell;
import nju.java.field.*;
import javax.swing.*;
import java.awt.*;
import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
public class Animal extends Thing2D implements Solider,BadAnimal,Serializable {
public Animal(cell postion, BAD bad, Field field, ArrayList HuluwaList){
super(postion);
this.bad=bad;
this.field=field;
this.c=postion;
this.HuluwaList=HuluwaList;
AnimalSetImage();
AnimalSetDieImage();
setPow(GLOBAL.ANIMAL_POWER[bad.ordinal()]);
setID(0);
setRole(Role.BAD);
}
public synchronized void moveTo(cell c) {
this.c=c;
position.setX(c.getX());
position.setY(c.getY());
}
private ArrayList<Huluwa> HuluwaList;
private int getHuluwa(){
int min=10000;
int rst=-1;
for(int i=0;i<HuluwaList.size();i++){
if(!HuluwaList.get(i).isExit()){
int temp=Math.abs(this.getC().cellX-HuluwaList.get(i).getC().cellX)
+Math.abs(this.getC().cellY-HuluwaList.get(i).getC().cellY);
if(temp < min){
rst=i;
min=temp;
}
}
}
return rst;
}
private int getXDirection(int i){
if(Math.abs(this.x()-HuluwaList.get(i).x())==0)
return 0;
return -(this.x()-HuluwaList.get(i).x())/Math.abs(this.x()-HuluwaList.get(i).x());
}
private int getYDirection(int i){
if(Math.abs(this.y()-HuluwaList.get(i).y())==0)
return 0;
return -(this.y()-HuluwaList.get(i).y())/Math.abs(this.y()-HuluwaList.get(i).y());
}
public synchronized void run() {
while (!exit) {
try {
int xdis=0,ydis=0;
int tryTime=1000;
while (tryTime--!=0) {
int i=getHuluwa();
if(i==-1){ return; }
xdis = getXDirection(i);
ydis = getYDirection(i);
if (field.getFieldGround(c.cellX + xdis, c.cellY + ydis) == BattleAttr.SPACE
&&c.cellX + xdis >= 0 && c.cellX + xdis < field.getXcount()
&& c.cellY + ydis >= 0 && c.cellY + ydis < field.getYcount()) {
field.setFieldGround(c, new cell(c.cellX + xdis, c.cellY + ydis), BattleAttr.BAD);
moveTo(new cell(c.cellX + xdis,c.cellY + ydis));
break;
}
xdis=0;
ydis=0;
}
Thread.sleep(GLOBAL.FREQUENT*(bad.ordinal()+1));
this.field.repaint();
}catch (Exception e) {
e.printStackTrace();
}
}
}
public cell getC(){
return c;
}
private void AnimalSetImage() {
String fileName=bad.toString()+".png";
URL loc = this.getClass().getClassLoader().getResource(fileName);
ImageIcon iia = new ImageIcon(loc);
Image image = iia.getImage();
this.setImage(image);
}
private void AnimalSetDieImage(){
String fileName="die.png";
URL loc = this.getClass().getClassLoader().getResource(fileName);
ImageIcon iia = new ImageIcon(loc);
Image image = iia.getImage();
this.setDieImage(image);
}
private BAD bad;
private transient Field field;
private cell c;
}
|
UTF-8
|
Java
| 3,627 |
java
|
Animal.java
|
Java
|
[] | null |
[] |
package nju.java.creature;
import nju.java.common.GLOBAL;
import nju.java.common.cell;
import nju.java.field.*;
import javax.swing.*;
import java.awt.*;
import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
public class Animal extends Thing2D implements Solider,BadAnimal,Serializable {
public Animal(cell postion, BAD bad, Field field, ArrayList HuluwaList){
super(postion);
this.bad=bad;
this.field=field;
this.c=postion;
this.HuluwaList=HuluwaList;
AnimalSetImage();
AnimalSetDieImage();
setPow(GLOBAL.ANIMAL_POWER[bad.ordinal()]);
setID(0);
setRole(Role.BAD);
}
public synchronized void moveTo(cell c) {
this.c=c;
position.setX(c.getX());
position.setY(c.getY());
}
private ArrayList<Huluwa> HuluwaList;
private int getHuluwa(){
int min=10000;
int rst=-1;
for(int i=0;i<HuluwaList.size();i++){
if(!HuluwaList.get(i).isExit()){
int temp=Math.abs(this.getC().cellX-HuluwaList.get(i).getC().cellX)
+Math.abs(this.getC().cellY-HuluwaList.get(i).getC().cellY);
if(temp < min){
rst=i;
min=temp;
}
}
}
return rst;
}
private int getXDirection(int i){
if(Math.abs(this.x()-HuluwaList.get(i).x())==0)
return 0;
return -(this.x()-HuluwaList.get(i).x())/Math.abs(this.x()-HuluwaList.get(i).x());
}
private int getYDirection(int i){
if(Math.abs(this.y()-HuluwaList.get(i).y())==0)
return 0;
return -(this.y()-HuluwaList.get(i).y())/Math.abs(this.y()-HuluwaList.get(i).y());
}
public synchronized void run() {
while (!exit) {
try {
int xdis=0,ydis=0;
int tryTime=1000;
while (tryTime--!=0) {
int i=getHuluwa();
if(i==-1){ return; }
xdis = getXDirection(i);
ydis = getYDirection(i);
if (field.getFieldGround(c.cellX + xdis, c.cellY + ydis) == BattleAttr.SPACE
&&c.cellX + xdis >= 0 && c.cellX + xdis < field.getXcount()
&& c.cellY + ydis >= 0 && c.cellY + ydis < field.getYcount()) {
field.setFieldGround(c, new cell(c.cellX + xdis, c.cellY + ydis), BattleAttr.BAD);
moveTo(new cell(c.cellX + xdis,c.cellY + ydis));
break;
}
xdis=0;
ydis=0;
}
Thread.sleep(GLOBAL.FREQUENT*(bad.ordinal()+1));
this.field.repaint();
}catch (Exception e) {
e.printStackTrace();
}
}
}
public cell getC(){
return c;
}
private void AnimalSetImage() {
String fileName=bad.toString()+".png";
URL loc = this.getClass().getClassLoader().getResource(fileName);
ImageIcon iia = new ImageIcon(loc);
Image image = iia.getImage();
this.setImage(image);
}
private void AnimalSetDieImage(){
String fileName="die.png";
URL loc = this.getClass().getClassLoader().getResource(fileName);
ImageIcon iia = new ImageIcon(loc);
Image image = iia.getImage();
this.setDieImage(image);
}
private BAD bad;
private transient Field field;
private cell c;
}
| 3,627 | 0.515026 | 0.507858 | 110 | 31.972727 | 24.407696 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.672727 | false | false |
12
|
a7149440513bca47c2624d22eaecb22d99129490
| 23,708,219,528,903 |
6fd896684e3aebfb77498e61fb9e53e92e6e893b
|
/app/src/main/java/com/jiangkang/ktools/SecurityActivity.java
|
2b9327d3c071bed5c4ea943553760dc4157cee09
|
[
"MIT"
] |
permissive
|
chenqingtan/KTools
|
https://github.com/chenqingtan/KTools
|
e557515a90e1b7c17a2cac2e09fecda2991e5a7d
|
cba558ed4fb8d1cf30294ae25505e1afdffc4220
|
refs/heads/master
| 2021-05-11T21:15:45.179000 | 2017-12-29T14:05:44 | 2017-12-29T14:05:44 | 117,466,015 | 2 | 0 | null | true | 2018-01-14T20:55:37 | 2018-01-14T20:55:37 | 2018-01-14T20:55:25 | 2017-12-29T14:05:53 | 97,943 | 0 | 0 | 0 | null | false | null |
package com.jiangkang.ktools;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Base64;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class SecurityActivity extends AppCompatActivity {
@BindView(R.id.et_original)
EditText etOriginal;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.et_result)
EditText tvResult;
@BindView(R.id.btn_base64_encode)
Button btnBase64Encode;
@BindView(R.id.btn_base64_decode)
Button btnBase64Decode;
@BindView(R.id.layout_key)
LinearLayout layoutKey;
public static void launch(Context context, Bundle bundle) {
Intent intent = new Intent(context, SecurityActivity.class);
if (bundle != null) {
intent.putExtras(bundle);
}
context.startActivity(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_security);
setTitle("Security");
ButterKnife.bind(this);
}
@OnClick(R.id.btn_base64_encode)
public void onBtnBase64EncodeClicked() {
String inputString = etOriginal.getText().toString();
String result = Base64.encodeToString(inputString.getBytes(),Base64.DEFAULT);
tvResult.setText(result);
}
@OnClick(R.id.btn_base64_decode)
public void onBtnBase64DecodeClicked() {
String inputString = etOriginal.getText().toString();
byte[] resultByte = Base64.decode(inputString,Base64.DEFAULT);
String result = new String(resultByte);
tvResult.setText(result);
}
}
|
UTF-8
|
Java
| 1,906 |
java
|
SecurityActivity.java
|
Java
|
[] | null |
[] |
package com.jiangkang.ktools;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Base64;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class SecurityActivity extends AppCompatActivity {
@BindView(R.id.et_original)
EditText etOriginal;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.et_result)
EditText tvResult;
@BindView(R.id.btn_base64_encode)
Button btnBase64Encode;
@BindView(R.id.btn_base64_decode)
Button btnBase64Decode;
@BindView(R.id.layout_key)
LinearLayout layoutKey;
public static void launch(Context context, Bundle bundle) {
Intent intent = new Intent(context, SecurityActivity.class);
if (bundle != null) {
intent.putExtras(bundle);
}
context.startActivity(intent);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_security);
setTitle("Security");
ButterKnife.bind(this);
}
@OnClick(R.id.btn_base64_encode)
public void onBtnBase64EncodeClicked() {
String inputString = etOriginal.getText().toString();
String result = Base64.encodeToString(inputString.getBytes(),Base64.DEFAULT);
tvResult.setText(result);
}
@OnClick(R.id.btn_base64_decode)
public void onBtnBase64DecodeClicked() {
String inputString = etOriginal.getText().toString();
byte[] resultByte = Base64.decode(inputString,Base64.DEFAULT);
String result = new String(resultByte);
tvResult.setText(result);
}
}
| 1,906 | 0.703568 | 0.689402 | 73 | 25.109589 | 20.993517 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.506849 | false | false |
12
|
8d271a2bc13cd0dc97f81ea4c38622132a5df530
| 27,221,502,751,931 |
e8dd2e7ced6dac859fd7121dda9e71712b72fa55
|
/src/main/java/app/utils/SessionUtil.java
|
d97749219e9e54f2699e6ef6ed1099f9add9c566
|
[] |
no_license
|
badapinguino/car-rental
|
https://github.com/badapinguino/car-rental
|
6255b4cce482b094173a842a882f017c17ab29d3
|
ab0e7b481830db15c1a95c409f0dfcbe5e1e8b99
|
refs/heads/master
| 2022-07-13T12:48:58.620000 | 2019-10-10T07:43:20 | 2019-10-10T07:43:20 | 214,116,449 | 0 | 0 | null | false | 2022-02-10T00:11:36 | 2019-10-10T07:31:09 | 2019-10-10T07:45:05 | 2022-02-10T00:11:35 | 16,978 | 0 | 0 | 1 |
JavaScript
| false | false |
package app.utils;
import app.model.entities.*;
import org.hibernate.Session;
//serve per abbreviare in UtentiDAO le operazioni che non ritornano nulla, come save or update
public class SessionUtil {
private static SessionUtil istanza = null;
//Il costruttore private impedisce l'istanza di oggetti da parte di classi esterne
private SessionUtil() {}
// Metodo della classe impiegato per accedere al singleton
public static synchronized SessionUtil getSessionUtil() {
if (istanza == null) {
istanza = new SessionUtil();
}
return istanza;
}
public void saveOrUpdateUtente(Utente utente){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
/*int id = (Integer)*/ session.saveOrUpdate(utente); //va bene saveOrUpdate, o era meglio solo save? RICONTROLLARE dopo implementazione web
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateMulta(Multa multa){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(multa);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateVeicolo(Veicolo veicolo){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
/*int id = (Integer)*/ session.saveOrUpdate(veicolo);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateBuonoSconto(BuonoSconto buonoSconto){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(buonoSconto);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdatePrenotazione(Prenotazione prenotazione){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(prenotazione);
session.getTransaction().commit();
session.close();
}
}
|
UTF-8
|
Java
| 2,159 |
java
|
SessionUtil.java
|
Java
|
[] | null |
[] |
package app.utils;
import app.model.entities.*;
import org.hibernate.Session;
//serve per abbreviare in UtentiDAO le operazioni che non ritornano nulla, come save or update
public class SessionUtil {
private static SessionUtil istanza = null;
//Il costruttore private impedisce l'istanza di oggetti da parte di classi esterne
private SessionUtil() {}
// Metodo della classe impiegato per accedere al singleton
public static synchronized SessionUtil getSessionUtil() {
if (istanza == null) {
istanza = new SessionUtil();
}
return istanza;
}
public void saveOrUpdateUtente(Utente utente){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
/*int id = (Integer)*/ session.saveOrUpdate(utente); //va bene saveOrUpdate, o era meglio solo save? RICONTROLLARE dopo implementazione web
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateMulta(Multa multa){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(multa);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateVeicolo(Veicolo veicolo){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
/*int id = (Integer)*/ session.saveOrUpdate(veicolo);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdateBuonoSconto(BuonoSconto buonoSconto){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(buonoSconto);
session.getTransaction().commit();
session.close();
}
public void saveOrUpdatePrenotazione(Prenotazione prenotazione){
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.saveOrUpdate(prenotazione);
session.getTransaction().commit();
session.close();
}
}
| 2,159 | 0.683187 | 0.683187 | 61 | 34.393444 | 29.263237 | 147 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.540984 | false | false |
12
|
16bcf060d18c4d9a77d506617e2c5e5528fc32fb
| 16,758,962,409,297 |
e2b1ef47de7c8697ce132fd33cd8cc9f93b5892f
|
/src/cl/populus/api/entities/Boletin.java
|
f173d37f101a1b9672c7ead33769b4dfab9c5d06
|
[
"MIT"
] |
permissive
|
Populus/api
|
https://github.com/Populus/api
|
50637b5e961616c93647004e685f0ade5c4b8ece
|
e3dfa9f6a27ad5cc6b917f0f930d6f97137467e0
|
refs/heads/master
| 2021-01-23T07:34:05.116000 | 2014-01-09T01:14:39 | 2014-01-09T01:14:39 | 15,186,507 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cl.populus.api.entities;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Boletin {
private String numero;
private String titulo;
private String origen;
private List<Representante> autores;
private String urgencia;
private String etapa;
private String leyNro;
//cgajardo: TODO definir tipo de refundidos
private List<Long> refundidos;
private String leyModificada;
private Date fechaIngreso;
private List<Tramitacion> tramitaciones;
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public Date getFechaIngreso() {
return fechaIngreso;
}
public void setFechaIngreso(Date fechaIngreso) {
this.fechaIngreso = fechaIngreso;
}
public String getOrigen() {
return origen;
}
public void setOrigen(String origen) {
this.origen = origen;
}
public List<Representante> getAutores() {
return autores;
}
public void setAutores(List<Representante> autores) {
this.autores = autores;
}
public String getUrgencia() {
return urgencia;
}
public void setUrgencia(String urgencia) {
this.urgencia = urgencia;
}
public String getEtapa() {
return etapa;
}
public void setEtapa(String etapa) {
this.etapa = etapa;
}
public String getLeyNro() {
return leyNro;
}
public void setLeyNro(String leyNro) {
this.leyNro = leyNro;
}
public List<Long> getRefundidos() {
return refundidos;
}
public void setRefundidos(List<Long> refundidos) {
this.refundidos = refundidos;
}
public String getLeyModificada() {
return leyModificada;
}
public void setLeyModificada(String leyModificada) {
this.leyModificada = leyModificada;
}
public List<Tramitacion> getTramitaciones() {
return tramitaciones;
}
public void setTramitaciones(List<Tramitacion> tramitaciones) {
this.tramitaciones = tramitaciones;
}
}
|
UTF-8
|
Java
| 2,025 |
java
|
Boletin.java
|
Java
|
[
{
"context": "\tprivate String etapa;\n\tprivate String leyNro;\n\t//cgajardo: TODO definir tipo de refundidos\n\tprivate List<Lo",
"end": 366,
"score": 0.9792582392692566,
"start": 358,
"tag": "USERNAME",
"value": "cgajardo"
}
] | null |
[] |
package cl.populus.api.entities;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Boletin {
private String numero;
private String titulo;
private String origen;
private List<Representante> autores;
private String urgencia;
private String etapa;
private String leyNro;
//cgajardo: TODO definir tipo de refundidos
private List<Long> refundidos;
private String leyModificada;
private Date fechaIngreso;
private List<Tramitacion> tramitaciones;
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public Date getFechaIngreso() {
return fechaIngreso;
}
public void setFechaIngreso(Date fechaIngreso) {
this.fechaIngreso = fechaIngreso;
}
public String getOrigen() {
return origen;
}
public void setOrigen(String origen) {
this.origen = origen;
}
public List<Representante> getAutores() {
return autores;
}
public void setAutores(List<Representante> autores) {
this.autores = autores;
}
public String getUrgencia() {
return urgencia;
}
public void setUrgencia(String urgencia) {
this.urgencia = urgencia;
}
public String getEtapa() {
return etapa;
}
public void setEtapa(String etapa) {
this.etapa = etapa;
}
public String getLeyNro() {
return leyNro;
}
public void setLeyNro(String leyNro) {
this.leyNro = leyNro;
}
public List<Long> getRefundidos() {
return refundidos;
}
public void setRefundidos(List<Long> refundidos) {
this.refundidos = refundidos;
}
public String getLeyModificada() {
return leyModificada;
}
public void setLeyModificada(String leyModificada) {
this.leyModificada = leyModificada;
}
public List<Tramitacion> getTramitaciones() {
return tramitaciones;
}
public void setTramitaciones(List<Tramitacion> tramitaciones) {
this.tramitaciones = tramitaciones;
}
}
| 2,025 | 0.742222 | 0.742222 | 92 | 21.01087 | 16.251753 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.532609 | false | false |
12
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.