blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
50e84fb007be78a03d8813065a8cf82d978c943b
489cdd80ed8dc667ddc9c979b142b0c05235c2a2
/yaoming-mall-common/src/main/java/com/club/web/common/db/arg/WfDbColumnsArg.java
aa20035d0197a2ba5aa5c1ca5bdd1fd18b008cdb
[]
no_license
569934390/darenbao
4103cd748498ec6f5f2bb9069c97fa29c48535b2
a4d1bee852d1e1f3768d3f4d264a9dff2b4cfc61
refs/heads/master
2020-04-17T07:29:22.914538
2016-09-13T07:32:56
2016-09-13T07:32:56
67,473,893
0
0
null
null
null
null
UTF-8
Java
false
false
36,530
java
package com.club.web.common.db.arg; import java.util.*; import java.math.*; import org.apache.commons.lang.*; public class WfDbColumnsArg { private String pk_name = "table_name"; private String orderByClause; private String groupByClause; private String columns; private String countsql1; private String countsql2; private boolean distinct; private int rowStart = 0; private int rowEnd = 10; private List<WfDbColumnsCriteria> oredCriteria; public WfDbColumnsArg() { oredCriteria = new ArrayList<WfDbColumnsCriteria>(); } public void setPk_name(String pk_name) { this.pk_name = StringEscapeUtils.escapeSql(pk_name); } public String getPk_name() { return pk_name; } public void setOrderByClause(String orderByClause) { this.orderByClause = StringEscapeUtils.escapeSql(orderByClause); } public String getOrderByClause() { return orderByClause; } public void setGroupByClause(String groupByClause) { this.groupByClause = StringEscapeUtils.escapeSql(groupByClause); } public String geGroupByClause() { return groupByClause; } public void setColumns(String columns) { this.columns = StringEscapeUtils.escapeSql(columns); } public String geColumns() { return columns; } public void setCountsql1(String countsql1) { this.countsql1 = StringEscapeUtils.escapeSql(countsql1); } public String geCountsql1() { return countsql1; } public void setCountsql2(String countsql2) { this.countsql2 = StringEscapeUtils.escapeSql(countsql2); } public String geCountsql2() { return countsql2; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public void setRowStart(int rowStart) { this.rowStart = rowStart; } public void setRowEnd(int rowEnd) { this.rowEnd = rowEnd; } public int getRowStart() { return rowStart; } public int getRowEnd() { return rowEnd; } public List<WfDbColumnsCriteria> getOredCriteria() { return oredCriteria; } public void or(WfDbColumnsCriteria criteria) { oredCriteria.add(criteria); } public WfDbColumnsCriteria or() { WfDbColumnsCriteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public WfDbColumnsCriteria createCriteria() { WfDbColumnsCriteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected WfDbColumnsCriteria createCriteriaInternal() { WfDbColumnsCriteria criteria = new WfDbColumnsCriteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; groupByClause = null; columns = null; countsql1 = null; countsql2 = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<WfDbColumnsCriterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<WfDbColumnsCriterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<WfDbColumnsCriterion> getAllCriteria() { return criteria; } public List<WfDbColumnsCriterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new WfDbColumnsCriterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new WfDbColumnsCriterion(condition, value)); } protected void addCriterion(String condition, Object value, String property, int likeType) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new WfDbColumnsCriterion(condition, value, likeType)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new WfDbColumnsCriterion(condition, value1, value2)); } public WfDbColumnsCriteria andCriterionEqualTo(String criterion) { if (StringUtils.isBlank(criterion)) { criterion = "1=1"; } addCriterion(criterion); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameIsNull() { addCriterion("table_name is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameIsNotNull() { addCriterion("table_name is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameEqualTo(String value) { addCriterion("table_name =", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotEqualTo(String value) { addCriterion("table_name <>", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameGreaterThan(String value) { addCriterion("table_name >", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameGreaterThanOrEqualTo(String value) { addCriterion("table_name >=", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameLessThan(String value) { addCriterion("table_name <", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameLessThanOrEqualTo(String value) { addCriterion("table_name <=", value, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameLike(String value) { addCriterion("table_name like ", value, "table_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotLike(String value) { addCriterion("table_name not like ", value, "table_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameLeftLike(String value) { addCriterion("table_name like ", value, "table_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotLeftLike(String value) { addCriterion("table_name not like ", value, "table_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameRightLike(String value) { addCriterion("table_name like ", value, "table_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotRightLike(String value) { addCriterion("table_name not like ", value, "table_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameIn(List<String> values) { addCriterion("table_name in ", values, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotIn(List<String> values) { addCriterion("table_name not in ", values, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameBetween(String value1, String value2) { addCriterion("table_name between ", value1, value2, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTableNameNotBetween(String value1, String value2) { addCriterion("table_name not between ", value1, value2, "table_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameIsNull() { addCriterion("column_name is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameIsNotNull() { addCriterion("column_name is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameEqualTo(String value) { addCriterion("column_name =", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotEqualTo(String value) { addCriterion("column_name <>", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameGreaterThan(String value) { addCriterion("column_name >", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameGreaterThanOrEqualTo(String value) { addCriterion("column_name >=", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameLessThan(String value) { addCriterion("column_name <", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameLessThanOrEqualTo(String value) { addCriterion("column_name <=", value, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameLike(String value) { addCriterion("column_name like ", value, "column_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotLike(String value) { addCriterion("column_name not like ", value, "column_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameLeftLike(String value) { addCriterion("column_name like ", value, "column_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotLeftLike(String value) { addCriterion("column_name not like ", value, "column_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameRightLike(String value) { addCriterion("column_name like ", value, "column_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotRightLike(String value) { addCriterion("column_name not like ", value, "column_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameIn(List<String> values) { addCriterion("column_name in ", values, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotIn(List<String> values) { addCriterion("column_name not in ", values, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameBetween(String value1, String value2) { addCriterion("column_name between ", value1, value2, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andColumnNameNotBetween(String value1, String value2) { addCriterion("column_name not between ", value1, value2, "column_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameIsNull() { addCriterion("display_name is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameIsNotNull() { addCriterion("display_name is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameEqualTo(String value) { addCriterion("display_name =", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotEqualTo(String value) { addCriterion("display_name <>", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameGreaterThan(String value) { addCriterion("display_name >", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameGreaterThanOrEqualTo(String value) { addCriterion("display_name >=", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameLessThan(String value) { addCriterion("display_name <", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameLessThanOrEqualTo(String value) { addCriterion("display_name <=", value, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameLike(String value) { addCriterion("display_name like ", value, "display_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotLike(String value) { addCriterion("display_name not like ", value, "display_name", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameLeftLike(String value) { addCriterion("display_name like ", value, "display_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotLeftLike(String value) { addCriterion("display_name not like ", value, "display_name", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameRightLike(String value) { addCriterion("display_name like ", value, "display_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotRightLike(String value) { addCriterion("display_name not like ", value, "display_name", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameIn(List<String> values) { addCriterion("display_name in ", values, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotIn(List<String> values) { addCriterion("display_name not in ", values, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameBetween(String value1, String value2) { addCriterion("display_name between ", value1, value2, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDisplayNameNotBetween(String value1, String value2) { addCriterion("display_name not between ", value1, value2, "display_name"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeIsNull() { addCriterion("db_type is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeIsNotNull() { addCriterion("db_type is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeEqualTo(String value) { addCriterion("db_type =", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotEqualTo(String value) { addCriterion("db_type <>", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeGreaterThan(String value) { addCriterion("db_type >", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeGreaterThanOrEqualTo(String value) { addCriterion("db_type >=", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeLessThan(String value) { addCriterion("db_type <", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeLessThanOrEqualTo(String value) { addCriterion("db_type <=", value, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeLike(String value) { addCriterion("db_type like ", value, "db_type", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotLike(String value) { addCriterion("db_type not like ", value, "db_type", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeLeftLike(String value) { addCriterion("db_type like ", value, "db_type", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotLeftLike(String value) { addCriterion("db_type not like ", value, "db_type", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeRightLike(String value) { addCriterion("db_type like ", value, "db_type", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotRightLike(String value) { addCriterion("db_type not like ", value, "db_type", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeIn(List<String> values) { addCriterion("db_type in ", values, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotIn(List<String> values) { addCriterion("db_type not in ", values, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeBetween(String value1, String value2) { addCriterion("db_type between ", value1, value2, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDbTypeNotBetween(String value1, String value2) { addCriterion("db_type not between ", value1, value2, "db_type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeIsNull() { addCriterion("type is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeIsNotNull() { addCriterion("type is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeEqualTo(String value) { addCriterion("type =", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotEqualTo(String value) { addCriterion("type <>", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeGreaterThan(String value) { addCriterion("type >", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeGreaterThanOrEqualTo(String value) { addCriterion("type >=", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeLessThan(String value) { addCriterion("type <", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeLessThanOrEqualTo(String value) { addCriterion("type <=", value, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeLike(String value) { addCriterion("type like ", value, "type", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotLike(String value) { addCriterion("type not like ", value, "type", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeLeftLike(String value) { addCriterion("type like ", value, "type", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotLeftLike(String value) { addCriterion("type not like ", value, "type", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeRightLike(String value) { addCriterion("type like ", value, "type", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotRightLike(String value) { addCriterion("type not like ", value, "type", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeIn(List<String> values) { addCriterion("type in ", values, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotIn(List<String> values) { addCriterion("type not in ", values, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeBetween(String value1, String value2) { addCriterion("type between ", value1, value2, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andTypeNotBetween(String value1, String value2) { addCriterion("type not between ", value1, value2, "type"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullIsNull() { addCriterion("is_null is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullIsNotNull() { addCriterion("is_null is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullEqualTo(String value) { addCriterion("is_null =", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotEqualTo(String value) { addCriterion("is_null <>", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullGreaterThan(String value) { addCriterion("is_null >", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullGreaterThanOrEqualTo(String value) { addCriterion("is_null >=", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullLessThan(String value) { addCriterion("is_null <", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullLessThanOrEqualTo(String value) { addCriterion("is_null <=", value, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullLike(String value) { addCriterion("is_null like ", value, "is_null", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotLike(String value) { addCriterion("is_null not like ", value, "is_null", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullLeftLike(String value) { addCriterion("is_null like ", value, "is_null", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotLeftLike(String value) { addCriterion("is_null not like ", value, "is_null", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullRightLike(String value) { addCriterion("is_null like ", value, "is_null", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotRightLike(String value) { addCriterion("is_null not like ", value, "is_null", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullIn(List<String> values) { addCriterion("is_null in ", values, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotIn(List<String> values) { addCriterion("is_null not in ", values, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullBetween(String value1, String value2) { addCriterion("is_null between ", value1, value2, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andIsNullNotBetween(String value1, String value2) { addCriterion("is_null not between ", value1, value2, "is_null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueIsNull() { addCriterion("default_value is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueIsNotNull() { addCriterion("default_value is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueEqualTo(String value) { addCriterion("default_value =", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotEqualTo(String value) { addCriterion("default_value <>", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueGreaterThan(String value) { addCriterion("default_value >", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueGreaterThanOrEqualTo(String value) { addCriterion("default_value >=", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueLessThan(String value) { addCriterion("default_value <", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueLessThanOrEqualTo(String value) { addCriterion("default_value <=", value, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueLike(String value) { addCriterion("default_value like ", value, "default_value", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotLike(String value) { addCriterion("default_value not like ", value, "default_value", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueLeftLike(String value) { addCriterion("default_value like ", value, "default_value", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotLeftLike(String value) { addCriterion("default_value not like ", value, "default_value", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueRightLike(String value) { addCriterion("default_value like ", value, "default_value", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotRightLike(String value) { addCriterion("default_value not like ", value, "default_value", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueIn(List<String> values) { addCriterion("default_value in ", values, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotIn(List<String> values) { addCriterion("default_value not in ", values, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueBetween(String value1, String value2) { addCriterion("default_value between ", value1, value2, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andDefaultValueNotBetween(String value1, String value2) { addCriterion("default_value not between ", value1, value2, "default_value"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthIsNull() { addCriterion("length is null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthIsNotNull() { addCriterion("length is not null"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthEqualTo(Integer value) { addCriterion("length =", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotEqualTo(Integer value) { addCriterion("length <>", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthGreaterThan(Integer value) { addCriterion("length >", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthGreaterThanOrEqualTo(Integer value) { addCriterion("length >=", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthLessThan(Integer value) { addCriterion("length <", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthLessThanOrEqualTo(Integer value) { addCriterion("length <=", value, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthLike(Integer value) { addCriterion("length like ", value, "length", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotLike(Integer value) { addCriterion("length not like ", value, "length", 1); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthLeftLike(Integer value) { addCriterion("length like ", value, "length", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotLeftLike(Integer value) { addCriterion("length not like ", value, "length", 0); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthRightLike(Integer value) { addCriterion("length like ", value, "length", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotRightLike(Integer value) { addCriterion("length not like ", value, "length", 2); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthIn(List<Integer> values) { addCriterion("length in ", values, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotIn(List<Integer> values) { addCriterion("length not in ", values, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthBetween(Integer value1, Integer value2) { addCriterion("length between ", value1, value2, "length"); return (WfDbColumnsCriteria) this; } public WfDbColumnsCriteria andLengthNotBetween(Integer value1, Integer value2) { addCriterion("length not between ", value1, value2, "length"); return (WfDbColumnsCriteria) this; } } public static class WfDbColumnsCriteria extends GeneratedCriteria { protected WfDbColumnsCriteria() { super(); } } public static class WfDbColumnsCriterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected WfDbColumnsCriterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected WfDbColumnsCriterion(String condition, Object value, int likeType) { this.condition = condition; if (likeType == 0) { this.value = "%" + value; } else if (likeType == 1) { this.value = "%" + value + "%"; } else { this.value = value + "%"; } this.typeHandler = null; this.singleValue = true; } protected WfDbColumnsCriterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected WfDbColumnsCriterion(String condition, Object value) { this(condition, value, null); } protected WfDbColumnsCriterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected WfDbColumnsCriterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "569934930@163.com" ]
569934930@163.com
b3614af5fb4b3cf3d49bb4108323c25fb0bdad53
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project80/src/main/java/org/gradle/test/performance80_4/Production80_310.java
fed31f68c593b2844db49d5c045b40e657f73d34
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance80_4; public class Production80_310 extends org.gradle.test.performance16_4.Production16_310 { private final String property; public Production80_310() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3ed7369a0e0f4081959929ff12b1c7fcac37af40
8c6dd77db046e65cca9806efa368a7246fe43a2e
/api/src/main/java/org/basket3/bo/ResourcePermission.java
cd86ee27ec30236a8d00949a486f19e033d0c7c5
[ "Apache-2.0" ]
permissive
cubeinhabitant/basket-stack
0832c7b5c00e5db22ff280765a4c5e25a60d49fb
8a86a1c9f61bae89043d12d6de8abb28ed18f0ea
refs/heads/master
2020-06-04T03:56:09.337137
2013-05-14T08:09:03
2013-05-14T08:09:03
32,111,170
0
0
null
null
null
null
UTF-8
Java
false
false
10,270
java
/* * Copyright 2007 Jesse Peterson * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.basket3.bo; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.security.Permission; import java.security.acl.Group; /** * Implementation of the S3 resource permission. * * @author Jesse Peterson */ public class ResourcePermission extends Permission { // inspired by java.io.FilePermission implementation public static final String ACTION_READ = "READ"; public static final String ACTION_WRITE = "WRITE"; public static final String ACTION_READ_ACP = "READ_ACP"; public static final String ACTION_WRITE_ACP = "WRITE_ACP"; public static final String ACTION_FULL_CONTROL = "FULL_CONTROL"; private static final int READ = 0x1; private static final int WRITE = 0x2; private static final int READ_ACP = 0x4; private static final int WRITE_ACP = 0x8; private static final int FULL_CONTROL = READ | WRITE | READ_ACP | WRITE_ACP; private static final int NONE = 0x0; private Grantee grantee; // lazy init private String actions = null; private transient int mask; /** * Default value. */ private static final long serialVersionUID = 1L; /** * A permission for a resource, where a grantee is granted an action. * * @param grantee * The grantee of the permission. * @param actions * The action being granted to the grantee. */ public ResourcePermission(Grantee grantee, String actions) { super(grantee.toString()); this.grantee = grantee; init(getMask(actions)); } /** * Get the grantee that this permission is for. * * @return The grantee that this permission is for. */ public Grantee getGrantee() { return grantee; } /** * Validates and saves the mask. * * @param mask * The actions mask. */ private void init(int mask) { if ((mask & FULL_CONTROL) != mask) { throw new IllegalArgumentException("invalid actions mask"); } if (mask == NONE) { throw new IllegalArgumentException("invalid actions mask"); } this.mask = mask; } /** * Create a String representation of the actions encoded in the bit mask. * * @param mask * The bit mask of actions. * @return A String representation, in the canonical form. The order is * "READ", "WRITE", "READ_ACP", "WRITE_ACP". If all actions, returns * the shorthand action "FULL_CONTROL". */ private static String getActions(int mask) { StringBuffer buffer = new StringBuffer(); boolean comma = false; if ((mask & FULL_CONTROL) == FULL_CONTROL) { return (ACTION_FULL_CONTROL); } if ((mask & READ) == READ) { comma = true; buffer.append(ACTION_READ); } if ((mask & WRITE) == WRITE) { if (comma) buffer.append(','); else comma = true; buffer.append(ACTION_WRITE); } if ((mask & READ_ACP) == READ_ACP) { if (comma) buffer.append(','); else comma = true; buffer.append(ACTION_READ_ACP); } if ((mask & WRITE_ACP) == WRITE_ACP) { if (comma) buffer.append(','); else comma = true; buffer.append(ACTION_WRITE_ACP); } return buffer.toString(); } @Override public String getActions() { if (actions == null) { actions = getActions(mask); } return actions; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ResourcePermission)) { return false; } ResourcePermission that = (ResourcePermission) obj; return (this.mask == that.mask) && (this.grantee.equals(that.grantee)); } @Override public int hashCode() { int hashCode = 0; if (grantee != null) { hashCode ^= grantee.hashCode(); } hashCode ^= getActions().hashCode(); return hashCode; } @Override public boolean implies(Permission permission) { if (!(permission instanceof ResourcePermission)) { return false; } ResourcePermission that = (ResourcePermission) permission; return ((this.mask & that.mask) == that.mask) && impliesIgnoreMask(that); } /** * Checks if the Permission's actions are a proper subset of the this * object's actions. Returns the effective mask iff the this * ResourcePermission's grantee also imlies that ResourcePermission's * grantee. * * @param that * the ResourcePermission to check against. * @return <code>true</code> if this grantee equals that grantee of if this * grantee is a <code>Group</code> and that grantee is a member of * this group; <code>false</code> otherwise. */ boolean impliesIgnoreMask(ResourcePermission that) { if (this.grantee.equals(that.grantee)) { return true; } if (this.grantee instanceof Group) { Group group = (Group) this.grantee; return group.isMember(that.grantee); } return false; } /** * Parse the actions string into a bit mask. * * @param actions * The actions string. Possible actions are "READ", "WRITE", * "READ_ACP", "WRITE_ACP", "FULL_CONTROL". Multiple actions can * be specified by separating them by a comma (','). * @return */ private static int getMask(String actions) { int mask = NONE; if (actions == null) { return mask; } // process 'backwards' char[] a = actions.toCharArray(); int i = a.length - 1; if (i < 0) { return mask; } while (i != -1) { char c; // skip whitespace while ((i != -1) && ((c = a[i]) == ' ' || c == '\r' || c == '\n' || c == '\f' || c == '\t')) { i--; } // look for the action strings int matchlen; if (i >= 3 && (a[i - 3] == 'r' || a[i - 3] == 'R') && (a[i - 2] == 'e' || a[i - 2] == 'E') && (a[i - 1] == 'a' || a[i - 1] == 'A') && (a[i] == 'd' || a[i] == 'D')) { matchlen = 4; mask |= READ; } else if (i >= 4 && (a[i - 4] == 'w' || a[i - 4] == 'W') && (a[i - 3] == 'r' || a[i - 3] == 'R') && (a[i - 2] == 'i' || a[i - 2] == 'I') && (a[i - 1] == 't' || a[i - 1] == 'T') && (a[i] == 'e' || a[i] == 'E')) { matchlen = 5; mask |= WRITE; } else if (i >= 7 && (a[i - 7] == 'r' || a[i - 7] == 'R') && (a[i - 6] == 'e' || a[i - 6] == 'E') && (a[i - 5] == 'a' || a[i - 5] == 'A') && (a[i - 4] == 'd' || a[i - 4] == 'D') && (a[i - 3] == '_') && (a[i - 2] == 'a' || a[i - 2] == 'A') && (a[i - 1] == 'c' || a[i - 1] == 'C') && (a[i] == 'p' || a[i] == 'P')) { matchlen = 8; mask |= READ_ACP; } else if (i >= 8 && (a[i - 8] == 'w' || a[i - 8] == 'W') && (a[i - 7] == 'r' || a[i - 7] == 'R') && (a[i - 6] == 'i' || a[i - 6] == 'I') && (a[i - 5] == 't' || a[i - 5] == 'T') && (a[i - 4] == 'e' || a[i - 4] == 'E') && (a[i - 3] == '_') && (a[i - 2] == 'a' || a[i - 2] == 'A') && (a[i - 1] == 'c' || a[i - 1] == 'C') && (a[i] == 'p' || a[i] == 'P')) { matchlen = 9; mask |= WRITE_ACP; } else if (i >= 11 && (a[i - 11] == 'f' || a[i - 11] == 'F') && (a[i - 10] == 'u' || a[i - 10] == 'U') && (a[i - 9] == 'l' || a[i - 9] == 'L') && (a[i - 8] == 'l' || a[i - 8] == 'L') && (a[i - 7] == '_') && (a[i - 6] == 'c' || a[i - 6] == 'C') && (a[i - 5] == 'o' || a[i - 5] == 'O') && (a[i - 4] == 'n' || a[i - 4] == 'N') && (a[i - 3] == 't' || a[i - 3] == 'T') && (a[i - 2] == 'r' || a[i - 2] == 'R') && (a[i - 1] == 'o' || a[i - 1] == 'O') && (a[i] == 'l' || a[i] == 'L')) { matchlen = 12; mask |= READ; mask |= WRITE; mask |= READ_ACP; mask |= WRITE_ACP; } else { throw new IllegalArgumentException("invalid actions: " + actions); } // make sure we didn't just match the tail of a word. Also skip to // the comma. boolean seencomma = false; while (i >= matchlen && !seencomma) { switch (a[i - matchlen]) { case ',': seencomma = true; case ' ': case '\r': case '\n': case '\f': case '\t': break; default: throw new IllegalArgumentException("invalid actions: " + actions); } i--; } // point i at the location of the comma minus one (or -1). i -= matchlen; } return mask; } /** * writeObject is called to save the state of the ResourcePermission to a * stream. The actions are serialized, and the superclass takes care of the * name. * * @param s * The ObjectOuptputStream to serialize the object to. * @throws IOException * Unable to write the object. */ private void writeObject(ObjectOutputStream s) throws IOException { // write out the actions. The superclass takes care of the name // call getActions to make sure actions field is initialized if (actions == null) { getActions(); } s.defaultWriteObject(); } /** * readObject is called to restore the state of the ResourcePermission from * a stream. * * @param s * The ObjectInputStream to serialize the object from. * @throws IOException * Unable to read the object. * @throws ClassNotFoundException * Unable to read the object. */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the actions, then restore everything else by calling init. s.defaultReadObject(); init(getMask(actions)); } }
[ "kerbymart@gmail.com" ]
kerbymart@gmail.com
1169052a3a07f6ca1d2989b321110f27503b9aee
bb94b903095fbf178ae5e94d5375693fd142ca6e
/src/test/java/jp/blackawa/example/demo/DemoApplicationTests.java
26814266e9b8837715df4539d618401e866d4fc3
[]
no_license
blackawa/demo
e9db4a9c48475dbc376cbc790db9e16c891506e5
f286deb4dabbfce932e426d198a1a028840aec8a
refs/heads/master
2020-03-10T16:44:08.932810
2018-04-14T04:28:36
2018-04-14T04:28:36
129,481,595
1
0
null
null
null
null
UTF-8
Java
false
false
339
java
package jp.blackawa.example.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class DemoApplicationTests { @Test public void contextLoads() { } }
[ "3104kurokawa@gmail.com" ]
3104kurokawa@gmail.com
69aa46a029cbef5bbbb180ae291d1da2a3ca2777
7e908c2536a5fd8c453ea0f9b267711ccc860e10
/ORM/day4/lab1 - HQL/src/main/java/dao/Product.java
33677965dde47e98a2a878a31ce568d9b241c31a
[]
no_license
Mostafayehya/ITI-Web-Stage
d8e67d07d8925d2da5c746afb989576ecbef0fcb
59435c3fc3686ef2ce4627d493b766674416216d
refs/heads/master
2023-05-03T10:23:22.353752
2021-05-10T11:37:10
2021-05-10T11:37:10
337,519,918
1
0
null
2021-02-15T14:50:30
2021-02-09T19:55:50
null
UTF-8
Java
false
false
4,394
java
package dao; // Generated Mar 21, 2021, 12:48:35 AM by Hibernate Tools 3.2.2.GA import java.util.Date; import java.util.HashSet; import java.util.Set; /** * Product generated by hbm2java */ public class Product implements java.io.Serializable { private Integer id; private Seller seller; private String name; private String description; private String manufacturingName; private Date manufacturingDate; private Date expirationDate; private int quantity; private Date offeredDate; private Date finishDate; private Set<Category> categories = new HashSet<Category>(0); private Set<BuyerBidProduct> buyerBidProducts = new HashSet<BuyerBidProduct>(0); private Set<BuyerBuyProduct> buyerBuyProducts = new HashSet<BuyerBuyProduct>(0); public Product() { } public Product(String name, String manufacturingName, Date manufacturingDate, int quantity, Date offeredDate, Date finishDate) { this.name = name; this.manufacturingName = manufacturingName; this.manufacturingDate = manufacturingDate; this.quantity = quantity; this.offeredDate = offeredDate; this.finishDate = finishDate; } public Product(Seller seller, String name, String description, String manufacturingName, Date manufacturingDate, Date expirationDate, int quantity, Date offeredDate, Date finishDate, Set<Category> categories, Set<BuyerBidProduct> buyerBidProducts, Set<BuyerBuyProduct> buyerBuyProducts) { this.seller = seller; this.name = name; this.description = description; this.manufacturingName = manufacturingName; this.manufacturingDate = manufacturingDate; this.expirationDate = expirationDate; this.quantity = quantity; this.offeredDate = offeredDate; this.finishDate = finishDate; this.categories = categories; this.buyerBidProducts = buyerBidProducts; this.buyerBuyProducts = buyerBuyProducts; } public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public Seller getSeller() { return this.seller; } public void setSeller(Seller seller) { this.seller = seller; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public String getManufacturingName() { return this.manufacturingName; } public void setManufacturingName(String manufacturingName) { this.manufacturingName = manufacturingName; } public Date getManufacturingDate() { return this.manufacturingDate; } public void setManufacturingDate(Date manufacturingDate) { this.manufacturingDate = manufacturingDate; } public Date getExpirationDate() { return this.expirationDate; } public void setExpirationDate(Date expirationDate) { this.expirationDate = expirationDate; } public int getQuantity() { return this.quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public Date getOfferedDate() { return this.offeredDate; } public void setOfferedDate(Date offeredDate) { this.offeredDate = offeredDate; } public Date getFinishDate() { return this.finishDate; } public void setFinishDate(Date finishDate) { this.finishDate = finishDate; } public Set<Category> getCategories() { return this.categories; } public void setCategories(Set<Category> categories) { this.categories = categories; } public Set<BuyerBidProduct> getBuyerBidProducts() { return this.buyerBidProducts; } public void setBuyerBidProducts(Set<BuyerBidProduct> buyerBidProducts) { this.buyerBidProducts = buyerBidProducts; } public Set<BuyerBuyProduct> getBuyerBuyProducts() { return this.buyerBuyProducts; } public void setBuyerBuyProducts(Set<BuyerBuyProduct> buyerBuyProducts) { this.buyerBuyProducts = buyerBuyProducts; } }
[ "mostafayehyax23@gmail.com" ]
mostafayehyax23@gmail.com
15a451f2181228b884aa4f8dbfd2fb11ee267ae4
1cba717a60f6513f233d7af7632057427ff4caa0
/app/src/main/java/com/example/gps_test/MainActivity.java
3ea5412634bc2e81ebe7b82290bb1c73653b7b50
[]
no_license
Dream-By/GPS_test
8ce14e50d1057b272ef892ca81a8db4f32da5a15
3545e376f9684e32ac7215ec11f117b8aa4d0af8
refs/heads/master
2022-12-27T20:07:48.557203
2020-09-14T12:58:38
2020-09-14T12:58:38
295,368,986
0
0
null
null
null
null
UTF-8
Java
false
false
3,844
java
package com.example.gps_test; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.provider.Settings; import android.view.View; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { private LocationManager mLocationManager; private LocationListener mLocationListener; private Location mLocation; private TextView mLatitudeTextView, mLongitudeTextView; private static final long MINIMUM_DISTANCE_FOR_UPDATES = 10; // в метрах private static final long MINIMUM_TIME_BETWEEN_UPDATES = 2000; // в мс public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mLatitudeTextView = (TextView) findViewById(R.id.textViewLatitude); mLongitudeTextView = (TextView) findViewById(R.id.textViewLongitude); mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_COARSE); criteria.setPowerRequirement(Criteria.POWER_LOW); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); String provider = mLocationManager.getBestProvider(criteria, true); mLocation = mLocationManager.getLastKnownLocation(provider); mLocationListener = new MyLocationListener(); showCurrentLocation(mLocation); // Регистрируемся для обновлений mLocationManager.requestLocationUpdates(provider, MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE_FOR_UPDATES, mLocationListener); } @Override public void onPause() { super.onPause(); mLocationManager.removeUpdates(mLocationListener); } public void onClick(View v) { showCurrentLocation(mLocation); } protected void showCurrentLocation(Location location) { if (location != null) { mLatitudeTextView.setText(String.valueOf(location.getLatitude())); mLongitudeTextView.setText(String.valueOf(location.getLongitude())); } } // Прослушиваем изменения private class MyLocationListener implements LocationListener { public void onLocationChanged(Location location) { String message = "Новое местоположение Долгота: " + location.getLongitude() + "Широта: " + location.getLatitude(); Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG) .show(); showCurrentLocation(mLocation); } public void onStatusChanged(String s, int i, Bundle b) { Toast.makeText(MainActivity.this, "Статус провайдера изменился", Toast.LENGTH_LONG).show(); } public void onProviderDisabled(String s) { Toast.makeText(MainActivity.this, "Провайдер заблокирован пользователем. GPS выключен", Toast.LENGTH_LONG).show(); } public void onProviderEnabled(String s) { Toast.makeText(MainActivity.this, "Провайдер включен пользователем. GPS включён", Toast.LENGTH_LONG).show(); } } }
[ "dzmitry.dzianisau@gmail.com" ]
dzmitry.dzianisau@gmail.com
a911d2677fc5c121c99f3dcc76a33e5fd92a5979
3c7427bfd24efd9eda5a6108084723c8ce6a3563
/Toutiao/toutiao3/src/main/java/cn/itcast/model/LoginTikcet.java
32afff3d31e34cb1884373b96a3d15a6ed3b6f3f
[]
no_license
lskylines/Project
3c1760a5e9347005c0d24267c23a3f46ccf77579
8f9062117f2499e45bb7f36acb090bda83a2cbfc
refs/heads/master
2022-07-01T23:52:00.745073
2019-10-07T08:28:23
2019-10-07T08:28:23
197,734,416
0
0
null
2022-06-21T01:30:02
2019-07-19T08:30:08
Java
UTF-8
Java
false
false
917
java
package cn.itcast.model; import java.util.Date; /** * @author * @create 2019-06-22 23:32 */ public class LoginTikcet { private int id; private int userId; private String ticket; private Date expired; private int status; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getTicket() { return ticket; } public void setTicket(String ticket) { this.ticket = ticket; } public Date getExpired() { return expired; } public void setExpired(Date expired) { this.expired = expired; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } }
[ "lclskyline@gmail.com" ]
lclskyline@gmail.com
1cd275ce149a0524ada99a41f131243f190685ae
e6b5b4424e5d0250704378a81517ea75a661fff2
/Enemy.java
c31844c99cb4faa4242abb2e2b882de1297aacf5
[]
no_license
oluthje/HarvastisGUI
d381e83b150d1e3127f218fcb6a85b17fb1b7ec6
2005ba0a898e25a02c3709a659ed416b36ef8f94
refs/heads/master
2020-07-10T17:38:45.365491
2019-09-01T18:25:43
2019-09-01T18:25:43
204,324,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
public class Enemy { private int posUp; private int posAcross; private int num; private int leftMove; private int rightMove; private String movementAxis; Enemy(int posUp, int posAcross, int objNum, int inputLeftMove, int inputRightMove, String movementAxis) { setPosUp(posUp); setPosAcross(posAcross); num = objNum; leftMove = inputLeftMove; rightMove = inputRightMove; this.movementAxis = movementAxis; } public void printEnemy() { } public void moveOnPath() { if (movementAxis.equals("Up")) { if (leftMove > 0) { leftMove--; posUp--; if (rightMove == 0) { rightMove = 1; } } else if (rightMove > 0) { rightMove--; posUp++; if (leftMove == 0) { leftMove = 1; } } } else if (movementAxis.equals("Across")) { if (leftMove > 0) { leftMove--; posAcross--; if (rightMove == 0) { rightMove = 1; } } else if (rightMove > 0) { rightMove--; posAcross++; if (leftMove == 0) { leftMove = 1; } } } } public int getNum() { return num; } public int getPosUp() { return posUp; } public int getPosAcross() { return posAcross; } public void setPosUp(int num) { posUp = posUp + num; } public void setPosAcross(int num) { posAcross = posAcross + num; } }
[ "noreply@github.com" ]
noreply@github.com
3a7fc097b66224347806560f665e160eed4501c5
d6c5dfe2e43909a3ecf905b7f560842f9f490bb6
/src/main/java/proto/StudentServiceGrpc.java
119213dae6d3725c3d4a1c434dc179a128acad17
[]
no_license
xvmingyuan/Netty_net
6f1ef2ca9ba447a8796398058ad7f359ff462d66
0127936a31fd17daf470b51ffaf5c776c6ba7365
refs/heads/master
2020-05-29T14:27:05.806783
2019-05-30T07:25:01
2019-05-30T07:25:01
189,196,325
1
0
null
null
null
null
UTF-8
Java
false
false
19,353
java
package proto; import static io.grpc.MethodDescriptor.generateFullMethodName; import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; import static io.grpc.stub.ClientCalls.asyncUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.21.0)", comments = "Source: Student.proto") public final class StudentServiceGrpc { private StudentServiceGrpc() {} public static final String SERVICE_NAME = "proto.StudentService"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor<proto.MyRequest, proto.MyResponse> getGetRealNameByUsernameMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetRealNameByUsername", requestType = proto.MyRequest.class, responseType = proto.MyResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<proto.MyRequest, proto.MyResponse> getGetRealNameByUsernameMethod() { io.grpc.MethodDescriptor<proto.MyRequest, proto.MyResponse> getGetRealNameByUsernameMethod; if ((getGetRealNameByUsernameMethod = StudentServiceGrpc.getGetRealNameByUsernameMethod) == null) { synchronized (StudentServiceGrpc.class) { if ((getGetRealNameByUsernameMethod = StudentServiceGrpc.getGetRealNameByUsernameMethod) == null) { StudentServiceGrpc.getGetRealNameByUsernameMethod = getGetRealNameByUsernameMethod = io.grpc.MethodDescriptor.<proto.MyRequest, proto.MyResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "proto.StudentService", "GetRealNameByUsername")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.MyRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.MyResponse.getDefaultInstance())) .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetRealNameByUsername")) .build(); } } } return getGetRealNameByUsernameMethod; } private static volatile io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponse> getGetStudentsByAgeMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetStudentsByAge", requestType = proto.StudentRequest.class, responseType = proto.StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) public static io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponse> getGetStudentsByAgeMethod() { io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponse> getGetStudentsByAgeMethod; if ((getGetStudentsByAgeMethod = StudentServiceGrpc.getGetStudentsByAgeMethod) == null) { synchronized (StudentServiceGrpc.class) { if ((getGetStudentsByAgeMethod = StudentServiceGrpc.getGetStudentsByAgeMethod) == null) { StudentServiceGrpc.getGetStudentsByAgeMethod = getGetStudentsByAgeMethod = io.grpc.MethodDescriptor.<proto.StudentRequest, proto.StudentResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) .setFullMethodName(generateFullMethodName( "proto.StudentService", "GetStudentsByAge")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StudentRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StudentResponse.getDefaultInstance())) .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudentsByAge")) .build(); } } } return getGetStudentsByAgeMethod; } private static volatile io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponseList> getGetStudentWrapperByAgesMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetStudentWrapperByAges", requestType = proto.StudentRequest.class, responseType = proto.StudentResponseList.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) public static io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponseList> getGetStudentWrapperByAgesMethod() { io.grpc.MethodDescriptor<proto.StudentRequest, proto.StudentResponseList> getGetStudentWrapperByAgesMethod; if ((getGetStudentWrapperByAgesMethod = StudentServiceGrpc.getGetStudentWrapperByAgesMethod) == null) { synchronized (StudentServiceGrpc.class) { if ((getGetStudentWrapperByAgesMethod = StudentServiceGrpc.getGetStudentWrapperByAgesMethod) == null) { StudentServiceGrpc.getGetStudentWrapperByAgesMethod = getGetStudentWrapperByAgesMethod = io.grpc.MethodDescriptor.<proto.StudentRequest, proto.StudentResponseList>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) .setFullMethodName(generateFullMethodName( "proto.StudentService", "GetStudentWrapperByAges")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StudentRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StudentResponseList.getDefaultInstance())) .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudentWrapperByAges")) .build(); } } } return getGetStudentWrapperByAgesMethod; } private static volatile io.grpc.MethodDescriptor<proto.StreamRequest, proto.StreamResponse> getBiTalkMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "BiTalk", requestType = proto.StreamRequest.class, responseType = proto.StreamResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) public static io.grpc.MethodDescriptor<proto.StreamRequest, proto.StreamResponse> getBiTalkMethod() { io.grpc.MethodDescriptor<proto.StreamRequest, proto.StreamResponse> getBiTalkMethod; if ((getBiTalkMethod = StudentServiceGrpc.getBiTalkMethod) == null) { synchronized (StudentServiceGrpc.class) { if ((getBiTalkMethod = StudentServiceGrpc.getBiTalkMethod) == null) { StudentServiceGrpc.getBiTalkMethod = getBiTalkMethod = io.grpc.MethodDescriptor.<proto.StreamRequest, proto.StreamResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) .setFullMethodName(generateFullMethodName( "proto.StudentService", "BiTalk")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StreamRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( proto.StreamResponse.getDefaultInstance())) .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("BiTalk")) .build(); } } } return getBiTalkMethod; } /** * Creates a new async stub that supports all call types for the service */ public static StudentServiceStub newStub(io.grpc.Channel channel) { return new StudentServiceStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static StudentServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new StudentServiceBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static StudentServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new StudentServiceFutureStub(channel); } /** */ public static abstract class StudentServiceImplBase implements io.grpc.BindableService { /** */ public void getRealNameByUsername(proto.MyRequest request, io.grpc.stub.StreamObserver<proto.MyResponse> responseObserver) { asyncUnimplementedUnaryCall(getGetRealNameByUsernameMethod(), responseObserver); } /** */ public void getStudentsByAge(proto.StudentRequest request, io.grpc.stub.StreamObserver<proto.StudentResponse> responseObserver) { asyncUnimplementedUnaryCall(getGetStudentsByAgeMethod(), responseObserver); } /** */ public io.grpc.stub.StreamObserver<proto.StudentRequest> getStudentWrapperByAges( io.grpc.stub.StreamObserver<proto.StudentResponseList> responseObserver) { return asyncUnimplementedStreamingCall(getGetStudentWrapperByAgesMethod(), responseObserver); } /** */ public io.grpc.stub.StreamObserver<proto.StreamRequest> biTalk( io.grpc.stub.StreamObserver<proto.StreamResponse> responseObserver) { return asyncUnimplementedStreamingCall(getBiTalkMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getGetRealNameByUsernameMethod(), asyncUnaryCall( new MethodHandlers< proto.MyRequest, proto.MyResponse>( this, METHODID_GET_REAL_NAME_BY_USERNAME))) .addMethod( getGetStudentsByAgeMethod(), asyncServerStreamingCall( new MethodHandlers< proto.StudentRequest, proto.StudentResponse>( this, METHODID_GET_STUDENTS_BY_AGE))) .addMethod( getGetStudentWrapperByAgesMethod(), asyncClientStreamingCall( new MethodHandlers< proto.StudentRequest, proto.StudentResponseList>( this, METHODID_GET_STUDENT_WRAPPER_BY_AGES))) .addMethod( getBiTalkMethod(), asyncBidiStreamingCall( new MethodHandlers< proto.StreamRequest, proto.StreamResponse>( this, METHODID_BI_TALK))) .build(); } } /** */ public static final class StudentServiceStub extends io.grpc.stub.AbstractStub<StudentServiceStub> { private StudentServiceStub(io.grpc.Channel channel) { super(channel); } private StudentServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected StudentServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceStub(channel, callOptions); } /** */ public void getRealNameByUsername(proto.MyRequest request, io.grpc.stub.StreamObserver<proto.MyResponse> responseObserver) { asyncUnaryCall( getChannel().newCall(getGetRealNameByUsernameMethod(), getCallOptions()), request, responseObserver); } /** */ public void getStudentsByAge(proto.StudentRequest request, io.grpc.stub.StreamObserver<proto.StudentResponse> responseObserver) { asyncServerStreamingCall( getChannel().newCall(getGetStudentsByAgeMethod(), getCallOptions()), request, responseObserver); } /** */ public io.grpc.stub.StreamObserver<proto.StudentRequest> getStudentWrapperByAges( io.grpc.stub.StreamObserver<proto.StudentResponseList> responseObserver) { return asyncClientStreamingCall( getChannel().newCall(getGetStudentWrapperByAgesMethod(), getCallOptions()), responseObserver); } /** */ public io.grpc.stub.StreamObserver<proto.StreamRequest> biTalk( io.grpc.stub.StreamObserver<proto.StreamResponse> responseObserver) { return asyncBidiStreamingCall( getChannel().newCall(getBiTalkMethod(), getCallOptions()), responseObserver); } } /** */ public static final class StudentServiceBlockingStub extends io.grpc.stub.AbstractStub<StudentServiceBlockingStub> { private StudentServiceBlockingStub(io.grpc.Channel channel) { super(channel); } private StudentServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected StudentServiceBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceBlockingStub(channel, callOptions); } /** */ public proto.MyResponse getRealNameByUsername(proto.MyRequest request) { return blockingUnaryCall( getChannel(), getGetRealNameByUsernameMethod(), getCallOptions(), request); } /** */ public java.util.Iterator<proto.StudentResponse> getStudentsByAge( proto.StudentRequest request) { return blockingServerStreamingCall( getChannel(), getGetStudentsByAgeMethod(), getCallOptions(), request); } } /** */ public static final class StudentServiceFutureStub extends io.grpc.stub.AbstractStub<StudentServiceFutureStub> { private StudentServiceFutureStub(io.grpc.Channel channel) { super(channel); } private StudentServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected StudentServiceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceFutureStub(channel, callOptions); } /** */ public com.google.common.util.concurrent.ListenableFuture<proto.MyResponse> getRealNameByUsername( proto.MyRequest request) { return futureUnaryCall( getChannel().newCall(getGetRealNameByUsernameMethod(), getCallOptions()), request); } } private static final int METHODID_GET_REAL_NAME_BY_USERNAME = 0; private static final int METHODID_GET_STUDENTS_BY_AGE = 1; private static final int METHODID_GET_STUDENT_WRAPPER_BY_AGES = 2; private static final int METHODID_BI_TALK = 3; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final StudentServiceImplBase serviceImpl; private final int methodId; MethodHandlers(StudentServiceImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_GET_REAL_NAME_BY_USERNAME: serviceImpl.getRealNameByUsername((proto.MyRequest) request, (io.grpc.stub.StreamObserver<proto.MyResponse>) responseObserver); break; case METHODID_GET_STUDENTS_BY_AGE: serviceImpl.getStudentsByAge((proto.StudentRequest) request, (io.grpc.stub.StreamObserver<proto.StudentResponse>) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke( io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_GET_STUDENT_WRAPPER_BY_AGES: return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getStudentWrapperByAges( (io.grpc.stub.StreamObserver<proto.StudentResponseList>) responseObserver); case METHODID_BI_TALK: return (io.grpc.stub.StreamObserver<Req>) serviceImpl.biTalk( (io.grpc.stub.StreamObserver<proto.StreamResponse>) responseObserver); default: throw new AssertionError(); } } } private static abstract class StudentServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { StudentServiceBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return proto.StudentProto.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("StudentService"); } } private static final class StudentServiceFileDescriptorSupplier extends StudentServiceBaseDescriptorSupplier { StudentServiceFileDescriptorSupplier() {} } private static final class StudentServiceMethodDescriptorSupplier extends StudentServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; StudentServiceMethodDescriptorSupplier(String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (StudentServiceGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new StudentServiceFileDescriptorSupplier()) .addMethod(getGetRealNameByUsernameMethod()) .addMethod(getGetStudentsByAgeMethod()) .addMethod(getGetStudentWrapperByAgesMethod()) .addMethod(getBiTalkMethod()) .build(); } } } return result; } }
[ "625587553@qq.com" ]
625587553@qq.com
1f0ed07a00f4f9bc215b56d3ff758bde3e81e3a7
6d32f433152f6d9424bcecf1975177f3868af4b0
/src/com/pb/hladkova/hw3/Bingo.java
a5b9b1f8718dc85b9e6e870a38d9f014c943eb50
[]
no_license
HladkovaMariana/JavaHomeWork
7415330a99eae0848c1ab73218518f8542801214
667e1e00c43499d3510c7e81a4d66e649e9fa91a
refs/heads/master
2023-08-24T01:30:46.700402
2021-10-29T19:44:44
2021-10-29T19:44:44
415,263,127
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.pb.hladkova.hw3; import java.util.Scanner; import java.util.Random; public class Bingo { public static void main(String[] args) { System.out.println(" Если тебе это не нужно, пиши - exit "); System.out.println(" Я загадала число от 1 до 100, угадай его "); int attempt1 = 100; int attempt2 = 0; int number = (int)(Math.random()*10+1); Scanner in = new Scanner(System.in); while (attempt2 <= attempt1) { attempt2++; System.out.println(" Попытка " + attempt2 + " : "); String value = in.next(); if (value.equals("exit")) break; int strToNum = Integer.parseInt(value); if (strToNum > number) { System.out.println(" Ваше число больше загаданного, попробуйте еще "); } else if (strToNum < number) { System.out.println(" Ваше число меньше загаданного, попробуйте еще "); } else { System.out.println(" Поздравляем, Вы угадали с " + attempt2 + " попытки! "); break; } } System.out.println("Конец игры!"); } }
[ "dp120994mma@gmail.com" ]
dp120994mma@gmail.com
610084a93db33169fe125dc1f73763e438f4d14c
12035e4de090da776482bb69eb9e13a36ab089d2
/Printing X pattern/Main.java
da885ca0ec5af9568e2b9644e0be7519dc086be7
[]
no_license
ChimbiliSuprajaChowdary/Playground
95818b1f4886421569cc2ccafa4deb6328affb24
786b25abb128bc500e90147f99348f4fc6835e21
refs/heads/master
2023-01-03T19:49:11.548713
2020-11-01T20:12:52
2020-11-01T20:12:52
291,485,302
0
0
null
null
null
null
UTF-8
Java
false
false
376
java
import java.util.Scanner; class Main { public static void main (String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(i+j==n+1 || i==j) System.out.print("*"); else System.out.print(" "); } System.out.print("\n"); } } }
[ "70476090+ChimbiliSuprajaChowdary@users.noreply.github.com" ]
70476090+ChimbiliSuprajaChowdary@users.noreply.github.com
16af4f59b0165c326ba1faeff44a804669f4f102
a2a57271a5ecb2c7aa7cf8f9287197dc0de40db8
/osgi-bundles/bundles/analytics/src/main/java/com/ning/billing/osgi/bundles/analytics/dao/BusinessAnalyticsDaoBase.java
73faf7bd55f5b459f48d38f8b8774393162575c0
[ "Apache-2.0" ]
permissive
pochadri/killbill
7e392e7bae15982431f14b3fc7faa0d112133866
a8665343a48550bf5170283d7d1890041c1d14c8
refs/heads/master
2021-01-16T20:36:53.725112
2013-06-03T21:42:41
2013-06-03T21:42:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,324
java
/* * Copyright 2010-2013 Ning, Inc. * * Ning licenses this file to you under the Apache License, version 2.0 * (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.ning.billing.osgi.bundles.analytics.dao; import org.skife.jdbi.v2.DBI; import com.ning.killbill.osgi.libs.killbill.OSGIKillbillDataSource; import com.ning.killbill.osgi.libs.killbill.OSGIKillbillLogService; public class BusinessAnalyticsDaoBase { protected final OSGIKillbillLogService logService; protected final BusinessAnalyticsSqlDao sqlDao; public BusinessAnalyticsDaoBase(final OSGIKillbillLogService logService, final OSGIKillbillDataSource osgiKillbillDataSource) { final DBI dbi = BusinessDBIProvider.get(osgiKillbillDataSource.getDataSource()); sqlDao = dbi.onDemand(BusinessAnalyticsSqlDao.class); this.logService = logService; } }
[ "pierre@ning.com" ]
pierre@ning.com
ad33128d106a31d571438c9f41dab4549f58f268
5416604462ebf1ecfffa3e2ac1b24afe70028d0f
/src/wall2ban/FileUpdater.java
ac49ce1310767bc78ec2406a0eb7caf838669f15
[]
no_license
bloomingseed/wall2ban
5a0ecc40682449f9f742d828a5b1954a80de714d
5ea65721cba0e7733c16c148bae25206e90354c1
refs/heads/master
2023-02-07T01:22:34.564991
2020-12-24T08:33:19
2020-12-24T08:33:19
301,973,594
0
0
null
null
null
null
UTF-8
Java
false
false
5,969
java
/* * 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 wall2ban; import static utils.Utilities.Utils; import java.io.FileNotFoundException; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; /** * A tool to update a file content. Internally it uses {@link StringUpdater}. * <p> * How to use: * <ol> * <li>Specify the file to update and the mapping between the pattern * for line to be replaced and replacing string content.</li> * <li>Optionally specify the method to find next line after each * replacement. The default is continuous increment.</li> * <li>Invoke {@link update()} method to swap file content to new content.</li> * </ol> * @author xceeded */ public class FileUpdater { private File oldFile; private StringUpdater supdater; public final String PREFIX = ".fileupdater"; public final String SUFFIX = null; /** * Initializes the internal of the tool and leaves {@code oldFile} being {@code null}. */ public FileUpdater(){ supdater = new StringUpdater(); } public FileUpdater(File oldFile, Map<Pattern,String> updateSource, StringUpdater.Callback cb) throws FileNotFoundException{ this(); // basically initializes the tool setOldFile(oldFile); supdater.setUpdateSource(updateSource); supdater.setCallback(cb); } /** * Get the }@code File} in which the old content will be replaced. * @return {@code File} - The file object containing the old content. */ public File getOldFile(){return this.oldFile;} public StringUpdater getStringUpdater(){return this.supdater;} public void setOldFile(File file) throws FileNotFoundException { if(!file.exists() || !file.isFile()) throw new FileNotFoundException(); oldFile = file; } /** * Performs the update process then replace it with the old content in the file. * @throws FileNotFoundException * @throws IOException */ public void update() throws FileNotFoundException, IOException, Exception{ // read all file contents and split into lines String[] oldContent = Files.readString(oldFile.toPath()).split("\n"); supdater.setOldContent(oldContent); // initialize string updater's old content field String newContent = supdater.update(); // updates the old content File tmpDir = Paths.get(oldFile.getParent()).toFile(); // directory to hold temp file File tmpFile = File.createTempFile(PREFIX, SUFFIX, tmpDir); // create temp file // write new content to temp file BufferedWriter bw = new BufferedWriter(new FileWriter(tmpFile)); bw.write(newContent); bw.close(); // close the writer and save changes // delete true file boolean isDeleted = oldFile.delete(); // delete old file if(!isDeleted) // if didn't delete the old file throw new Exception("Failed to delete file"); // rename tmp file to old file tmpFile.renameTo(oldFile); } public static void main(String[] args) throws InterruptedException, IOException, Exception{ test2(); } public static void test1() throws InterruptedException{ try { File srcFile = Paths.get(Utils.getWorkingFoler(),"foo.data").toFile(); File tmpFile = File.createTempFile("."+srcFile.getName(), "tmp", srcFile.getParentFile()); System.out.println(tmpFile.getAbsolutePath()); BufferedWriter bw = new BufferedWriter(new FileWriter(tmpFile)); for(int i = 0; i<10; ++i){ bw.write("Hello "+i+"\n"); } bw.close(); System.out.println("Waiting 10 secs to delete "+srcFile.getAbsolutePath()); Thread.sleep(10000); srcFile.delete(); System.out.println("Deleted "+srcFile.getAbsolutePath()); System.out.println(String.format("Changing %s to %s..",tmpFile.getAbsoluteFile(),srcFile.getAbsoluteFile())); if(tmpFile.renameTo(srcFile)) System.out.println("Changed name"); else System.out.println("Couldn't change name"); } catch (IOException ex) { Logger.getLogger(FileUpdater.class.getName()).log(Level.SEVERE, null, ex); } } public static void test2() throws IOException, Exception{ HashMap<Pattern,String> updatesrc = new HashMap<Pattern,String>(); String newValue = "say xceeded was here\n"; // + "curl dev page\n" // + "start app\n" // + "open landing page"; updatesrc.put(Pattern.compile("(^\\s*actionstart\\s*=(.*)$)"), "actionstart = "+newValue); File srcFile = Paths.get(Utils.getWorkingFoler(),"foo.data").toFile(); StringUpdater.Callback cb = new StringUpdater.Callback(){ public int handle(int index,String[] oldContent){ int j; for(j = index+1; j<oldContent.length;++j){ // until find another '=' if(Pattern.matches("(^[^\\n]*=[^\\n]*$)", oldContent[j])){ break; } } return j; } }; FileUpdater fu = new FileUpdater(srcFile,updatesrc, cb); fu.update(); } }
[ "nhattungnguyen.2kgl@gmail.com" ]
nhattungnguyen.2kgl@gmail.com
8d8565bdfd9e61432d47b831e4b661c27b8bec62
11e991346ac65c1c035d6d6a26dd16d48584224a
/src/main/java/com/ipman/engine/ARPDetector.java
1ae3f353b8c72e3b47ab35daa7517a231a64c14b
[]
no_license
KevinYobe/ipman
a172d1f23f350bdce6a148745048db3c77c9616b
fd27e07354356e46ae53506a96e422e235cb2233
refs/heads/master
2023-05-13T14:56:07.228610
2021-06-05T22:30:44
2021-06-05T22:30:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
package com.ipman.engine; public class ARPDetector extends AbstractDetector { @Override public void detect() { // TODO Auto-generated method stub } }
[ "kev.yobe@gmail.com" ]
kev.yobe@gmail.com
c1018a8630373b15f4a4dc1dc1c039f75cae1302
7398714c498444374047497fe2e9c9ad51239034
/com/google/android/gms/measurement/internal/zzbt.java
7180f048632a622c03c4abfaf32197bb57307c58
[]
no_license
CheatBoss/InnerCore-horizon-sources
b3609694df499ccac5f133d64be03962f9f767ef
84b72431e7cb702b7d929c61c340a8db07d6ece1
refs/heads/main
2023-04-07T07:30:19.725432
2021-04-10T01:23:04
2021-04-10T01:23:04
356,437,521
1
0
null
null
null
null
UTF-8
Java
false
false
17,838
java
package com.google.android.gms.measurement.internal; import com.google.android.gms.measurement.*; import android.content.*; import com.google.android.gms.common.internal.*; import com.google.android.gms.internal.measurement.*; import com.google.android.gms.common.util.*; import android.app.*; import android.text.*; import com.google.android.gms.common.api.internal.*; import com.google.android.gms.common.wrappers.*; import java.util.concurrent.atomic.*; public class zzbt implements zzcq { private static volatile zzbt zzapl; private final boolean zzadv; private final String zzadx; private final long zzagx; private final zzk zzaiq; private final String zzapm; private final String zzapn; private final zzn zzapo; private final zzba zzapp; private final zzap zzapq; private final zzbo zzapr; private final zzeq zzaps; private final AppMeasurement zzapt; private final zzfk zzapu; private final zzan zzapv; private final zzdo zzapw; private final zzcs zzapx; private final zza zzapy; private zzal zzapz; private zzdr zzaqa; private zzx zzaqb; private zzaj zzaqc; private zzbg zzaqd; private Boolean zzaqe; private long zzaqf; private volatile Boolean zzaqg; private int zzaqh; private int zzaqi; private final Context zzri; private final Clock zzrz; private boolean zzvz; private zzbt(final zzcr zzcr) { this.zzvz = false; Preconditions.checkNotNull(zzcr); zzaf.zza(this.zzaiq = new zzk(zzcr.zzri)); this.zzri = zzcr.zzri; this.zzadx = zzcr.zzadx; this.zzapm = zzcr.zzapm; this.zzapn = zzcr.zzapn; this.zzadv = zzcr.zzadv; this.zzaqg = zzcr.zzaqg; zzsl.init(this.zzri); final Clock instance = DefaultClock.getInstance(); this.zzrz = instance; this.zzagx = instance.currentTimeMillis(); this.zzapo = new zzn(this); final zzba zzapp = new zzba(this); zzapp.zzq(); this.zzapp = zzapp; final zzap zzapq = new zzap(this); zzapq.zzq(); this.zzapq = zzapq; final zzfk zzapu = new zzfk(this); zzapu.zzq(); this.zzapu = zzapu; final zzan zzapv = new zzan(this); zzapv.zzq(); this.zzapv = zzapv; this.zzapy = new zza(this); final zzdo zzapw = new zzdo(this); zzapw.zzq(); this.zzapw = zzapw; final zzcs zzapx = new zzcs(this); zzapx.zzq(); this.zzapx = zzapx; this.zzapt = new AppMeasurement(this); final zzeq zzaps = new zzeq(this); zzaps.zzq(); this.zzaps = zzaps; final zzbo zzapr = new zzbo(this); zzapr.zzq(); this.zzapr = zzapr; Label_0397: { zzar zzar; String s; if (this.zzri.getApplicationContext() instanceof Application) { final zzcs zzge = this.zzge(); if (!(zzge.getContext().getApplicationContext() instanceof Application)) { break Label_0397; } final Application application = (Application)zzge.getContext().getApplicationContext(); if (zzge.zzaqv == null) { zzge.zzaqv = new zzdm(zzge, null); } application.unregisterActivityLifecycleCallbacks((Application$ActivityLifecycleCallbacks)zzge.zzaqv); application.registerActivityLifecycleCallbacks((Application$ActivityLifecycleCallbacks)zzge.zzaqv); zzar = zzge.zzgo().zzjl(); s = "Registered activity lifecycle callback"; } else { zzar = this.zzgo().zzjg(); s = "Application context is not an Application"; } zzar.zzbx(s); } this.zzapr.zzc(new zzbu(this, zzcr)); } public static zzbt zza(final Context context, final zzak zzak) { zzak zzak2 = zzak; Label_0052: { if (zzak != null) { if (zzak.origin != null) { zzak2 = zzak; if (zzak.zzadx != null) { break Label_0052; } } zzak2 = new zzak(zzak.zzadt, zzak.zzadu, zzak.zzadv, zzak.zzadw, null, null, zzak.zzady); } } Preconditions.checkNotNull(context); Preconditions.checkNotNull(context.getApplicationContext()); if (zzbt.zzapl == null) { synchronized (zzbt.class) { if (zzbt.zzapl == null) { zzbt.zzapl = new zzbt(new zzcr(context, zzak2)); } return zzbt.zzapl; } } if (zzak2 != null && zzak2.zzady != null && zzak2.zzady.containsKey("dataCollectionDefaultEnabled")) { zzbt.zzapl.zzd(zzak2.zzady.getBoolean("dataCollectionDefaultEnabled")); } return zzbt.zzapl; } private static void zza(final zzco zzco) { if (zzco != null) { return; } throw new IllegalStateException("Component not created"); } private static void zza(final zzcp zzcp) { if (zzcp == null) { throw new IllegalStateException("Component not created"); } if (zzcp.isInitialized()) { return; } final String value = String.valueOf(zzcp.getClass()); final StringBuilder sb = new StringBuilder(String.valueOf(value).length() + 27); sb.append("Component not initialized: "); sb.append(value); throw new IllegalStateException(sb.toString()); } private final void zza(final zzcr zzcr) { this.zzgn().zzaf(); zzn.zzht(); final zzx zzaqb = new zzx(this); zzaqb.zzq(); this.zzaqb = zzaqb; final zzaj zzaqc = new zzaj(this); zzaqc.zzq(); this.zzaqc = zzaqc; final zzal zzapz = new zzal(this); zzapz.zzq(); this.zzapz = zzapz; final zzdr zzaqa = new zzdr(this); zzaqa.zzq(); this.zzaqa = zzaqa; this.zzapu.zzgs(); this.zzapp.zzgs(); this.zzaqd = new zzbg(this); this.zzaqc.zzgs(); this.zzgo().zzjj().zzg("App measurement is starting up, version", this.zzapo.zzhc()); this.zzgo().zzjj().zzbx("To enable debug logging run: adb shell setprop log.tag.FA VERBOSE"); final String zzal = zzaqc.zzal(); if (TextUtils.isEmpty((CharSequence)this.zzadx)) { zzar zzar; String concat; if (this.zzgm().zzcw(zzal)) { zzar = this.zzgo().zzjj(); concat = "Faster debug mode event logging enabled. To disable, run:\n adb shell setprop debug.firebase.analytics.app .none."; } else { zzar = this.zzgo().zzjj(); final String value = String.valueOf(zzal); if (value.length() != 0) { concat = "To enable faster debug mode event logging run:\n adb shell setprop debug.firebase.analytics.app ".concat(value); } else { concat = new String("To enable faster debug mode event logging run:\n adb shell setprop debug.firebase.analytics.app "); } } zzar.zzbx(concat); } this.zzgo().zzjk().zzbx("Debug-level message logging enabled"); if (this.zzaqh != this.zzaqi) { this.zzgo().zzjd().zze("Not all components initialized", this.zzaqh, this.zzaqi); } this.zzvz = true; } private static void zza(final zzf zzf) { if (zzf == null) { throw new IllegalStateException("Component not created"); } if (zzf.isInitialized()) { return; } final String value = String.valueOf(zzf.getClass()); final StringBuilder sb = new StringBuilder(String.valueOf(value).length() + 27); sb.append("Component not initialized: "); sb.append(value); throw new IllegalStateException(sb.toString()); } private final void zzcl() { if (this.zzvz) { return; } throw new IllegalStateException("AppMeasurement is not initialized"); } @Override public final Context getContext() { return this.zzri; } public final boolean isEnabled() { this.zzgn().zzaf(); this.zzcl(); if (this.zzapo.zzhu()) { return false; } Boolean b = this.zzapo.zzhv(); if (b == null) { boolean booleanValue; final boolean b2 = booleanValue = (((GoogleServices.isMeasurementExplicitlyDisabled() ? 1 : 0) ^ 0x1) != 0x0); if (!b2) { return this.zzgp().zzh(booleanValue); } booleanValue = b2; if (this.zzaqg == null) { return this.zzgp().zzh(booleanValue); } booleanValue = b2; if (!zzaf.zzalh.get()) { return this.zzgp().zzh(booleanValue); } b = this.zzaqg; } boolean booleanValue = b; return this.zzgp().zzh(booleanValue); } protected final void start() { this.zzgn().zzaf(); if (this.zzgp().zzane.get() == 0L) { this.zzgp().zzane.set(this.zzrz.currentTimeMillis()); } if (this.zzgp().zzanj.get() == 0L) { this.zzgo().zzjl().zzg("Persisting first open", this.zzagx); this.zzgp().zzanj.set(this.zzagx); } if (!this.zzkr()) { if (this.isEnabled()) { if (!this.zzgm().zzx("android.permission.INTERNET")) { this.zzgo().zzjd().zzbx("App is missing INTERNET permission"); } if (!this.zzgm().zzx("android.permission.ACCESS_NETWORK_STATE")) { this.zzgo().zzjd().zzbx("App is missing ACCESS_NETWORK_STATE permission"); } if (!Wrappers.packageManager(this.zzri).isCallerInstantApp() && !this.zzapo.zzib()) { if (!zzbj.zza(this.zzri)) { this.zzgo().zzjd().zzbx("AppMeasurementReceiver not registered/enabled"); } if (!zzfk.zza(this.zzri, false)) { this.zzgo().zzjd().zzbx("AppMeasurementService not registered/enabled"); } } this.zzgo().zzjd().zzbx("Uploading is not possible. App measurement disabled"); } } else { if (!TextUtils.isEmpty((CharSequence)this.zzgf().getGmpAppId()) || !TextUtils.isEmpty((CharSequence)this.zzgf().zzgw())) { this.zzgm(); if (zzfk.zza(this.zzgf().getGmpAppId(), this.zzgp().zzjs(), this.zzgf().zzgw(), this.zzgp().zzjt())) { this.zzgo().zzjj().zzbx("Rechecking which service to use due to a GMP App Id change"); this.zzgp().zzjv(); if (this.zzapo.zza(zzaf.zzalc)) { this.zzgi().resetAnalyticsData(); } this.zzaqa.disconnect(); this.zzaqa.zzdj(); this.zzgp().zzanj.set(this.zzagx); this.zzgp().zzanl.zzcc(null); } this.zzgp().zzca(this.zzgf().getGmpAppId()); this.zzgp().zzcb(this.zzgf().zzgw()); if (this.zzapo.zzbj(this.zzgf().zzal())) { this.zzaps.zzam(this.zzagx); } } this.zzge().zzcm(this.zzgp().zzanl.zzjz()); if (!TextUtils.isEmpty((CharSequence)this.zzgf().getGmpAppId()) || !TextUtils.isEmpty((CharSequence)this.zzgf().zzgw())) { final boolean enabled = this.isEnabled(); if (!this.zzgp().zzjy() && !this.zzapo.zzhu()) { this.zzgp().zzi(enabled ^ true); } if (this.zzapo.zze(this.zzgf().zzal(), zzaf.zzalj)) { this.zzj(false); } if (!this.zzapo.zzbd(this.zzgf().zzal()) || enabled) { this.zzge().zzkz(); } this.zzgg().zza(new AtomicReference<String>()); } } } final void zzb(final zzcp zzcp) { ++this.zzaqh; } final void zzb(final zzf zzf) { ++this.zzaqh; } @Override public final Clock zzbx() { return this.zzrz; } final void zzd(final boolean b) { this.zzaqg = b; } final void zzga() { throw new IllegalStateException("Unexpected call on client side"); } final void zzgb() { } public final zza zzgd() { final zza zzapy = this.zzapy; if (zzapy != null) { return zzapy; } throw new IllegalStateException("Component not created"); } public final zzcs zzge() { zza(this.zzapx); return this.zzapx; } public final zzaj zzgf() { zza(this.zzaqc); return this.zzaqc; } public final zzdr zzgg() { zza(this.zzaqa); return this.zzaqa; } public final zzdo zzgh() { zza(this.zzapw); return this.zzapw; } public final zzal zzgi() { zza(this.zzapz); return this.zzapz; } public final zzeq zzgj() { zza(this.zzaps); return this.zzaps; } public final zzx zzgk() { zza(this.zzaqb); return this.zzaqb; } public final zzan zzgl() { zza((zzco)this.zzapv); return this.zzapv; } public final zzfk zzgm() { zza((zzco)this.zzapu); return this.zzapu; } @Override public final zzbo zzgn() { zza(this.zzapr); return this.zzapr; } @Override public final zzap zzgo() { zza(this.zzapq); return this.zzapq; } public final zzba zzgp() { zza((zzco)this.zzapp); return this.zzapp; } public final zzn zzgq() { return this.zzapo; } @Override public final zzk zzgr() { return this.zzaiq; } final void zzj(final boolean b) { this.zzgn().zzaf(); final String zzjz = this.zzgp().zzans.zzjz(); boolean b2 = false; Label_0096: { if (!b && zzjz != null) { if (!"unset".equals(zzjz)) { this.zzge().zza("app", "_ap", zzjz, this.zzrz.currentTimeMillis()); b2 = false; break Label_0096; } this.zzge().zza("app", "_ap", null, this.zzrz.currentTimeMillis()); } b2 = true; } if (b2) { final Boolean zzau = this.zzapo.zzau("google_analytics_default_allow_ad_personalization_signals"); if (zzau != null) { final zzcs zzge = this.zzge(); long n; if (zzau) { n = 1L; } else { n = 0L; } zzge.zza("auto", "_ap", (Object)n, this.zzrz.currentTimeMillis()); return; } this.zzge().zza("auto", "_ap", null, this.zzrz.currentTimeMillis()); } } public final zzap zzkf() { final zzap zzapq = this.zzapq; if (zzapq != null && zzapq.isInitialized()) { return this.zzapq; } return null; } public final zzbg zzkg() { return this.zzaqd; } final zzbo zzkh() { return this.zzapr; } public final AppMeasurement zzki() { return this.zzapt; } public final boolean zzkj() { return TextUtils.isEmpty((CharSequence)this.zzadx); } public final String zzkk() { return this.zzadx; } public final String zzkl() { return this.zzapm; } public final String zzkm() { return this.zzapn; } public final boolean zzkn() { return this.zzadv; } public final boolean zzko() { return this.zzaqg != null && this.zzaqg; } final long zzkp() { final Long value = this.zzgp().zzanj.get(); if (value == 0L) { return this.zzagx; } return Math.min(this.zzagx, value); } final void zzkq() { ++this.zzaqi; } protected final boolean zzkr() { this.zzcl(); this.zzgn().zzaf(); final Boolean zzaqe = this.zzaqe; if (zzaqe == null || this.zzaqf == 0L || (zzaqe != null && !zzaqe && Math.abs(this.zzrz.elapsedRealtime() - this.zzaqf) > 1000L)) { this.zzaqf = this.zzrz.elapsedRealtime(); final boolean zzx = this.zzgm().zzx("android.permission.INTERNET"); final boolean b = true; final Boolean value = zzx && this.zzgm().zzx("android.permission.ACCESS_NETWORK_STATE") && (Wrappers.packageManager(this.zzri).isCallerInstantApp() || this.zzapo.zzib() || (zzbj.zza(this.zzri) && zzfk.zza(this.zzri, false))); this.zzaqe = value; if (value) { boolean b2 = b; if (!this.zzgm().zzt(this.zzgf().getGmpAppId(), this.zzgf().zzgw())) { b2 = (!TextUtils.isEmpty((CharSequence)this.zzgf().zzgw()) && b); } this.zzaqe = b2; } } return this.zzaqe; } }
[ "cheat.boss1@gmail.com" ]
cheat.boss1@gmail.com
15014d8b168786619631a22982ece25520b123d2
3b59b50dfd09584764bc37973ba42787f781cdbc
/src/main/java/com/buyalskaya/appliance/main/PrintApplianceInfo.java
602cf021707e052e8bacf64bbc806ddfd7c56001
[]
no_license
Julie717/Task2_1_2
9061fcded5ebed76b1bb4c1332cf89bbbcdcc0e2
24dd3c4ce09139230aee98eb33ccfab914c6504b
refs/heads/master
2022-12-08T00:24:07.883444
2020-09-05T16:53:06
2020-09-05T16:53:06
287,716,613
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
package com.buyalskaya.appliance.main; import com.buyalskaya.appliance.entity.Appliance; import java.util.List; public class PrintApplianceInfo { public static void print(List<Appliance> appliances) { if (appliances == null || appliances.isEmpty()) { System.out.println("Data isn't found"); } else { for (Appliance appliance : appliances) { System.out.println(appliance); } } } }
[ "buyalskaya.yv@gmail.com" ]
buyalskaya.yv@gmail.com
636f25d4e411743efec22356cca7a44111b83274
ff59d94041ab79f96ce000ff70c841f6c904dd08
/TruyenThamSo2ManHinh/app/src/test/java/com/example/nguyendangtinh/truyenthamso2manhinh/ExampleUnitTest.java
00b1886bf350d717d6b42c7dde5d1bb7a777be8e
[]
no_license
nguyendangtinhdx/Android
09bfbe60e12860f67777e2690a74782c9f1b80d4
27756f09ea1d1512be855935c4c1bd166caa4a3b
refs/heads/master
2020-05-09T14:27:25.173493
2019-04-13T16:24:55
2019-04-13T16:24:55
181,192,886
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
package com.example.nguyendangtinh.truyenthamso2manhinh; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "=" ]
=
52a58ca99a1afb8e750b6e546ef8f6c3f9124542
0b65dcfa1323662bec811f34c5b6618322749d14
/src/main/java/com/heitian/ssm/foundation/JavaSE_Foundation/chapter11_Vector/demo2/ApplesAndOrangesWithGenerics.java
4b7bd7e3390b243ca21e34888b0bbbca11743c96
[]
no_license
kevinweiqy/web-ssm
f91c7f471da66aac1a822fff8a1a1edd213dad3e
85070c710e5c8be545490d803b9ee92612850c11
refs/heads/master
2022-12-22T08:21:27.498027
2019-10-05T19:23:22
2019-10-05T19:23:22
98,600,363
0
0
null
2022-12-16T07:34:11
2017-07-28T02:42:05
Java
UTF-8
Java
false
false
1,002
java
package com.heitian.ssm.foundation.JavaSE_Foundation.chapter11_Vector.demo2; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; class Apple { } class GrannySmith extends Apple{} class Gala extends Apple {} class Fuji extends Apple{} class Orange { } public class ApplesAndOrangesWithGenerics { public static void main(String[] args) { /*ArrayList<Apple> apples = new ArrayList<>(); for (int i = 0; i < 3; i++) { apples.add(new Apple()); } for (Apple apple : apples) { System.out.println(apple); }*/ ArrayList<Apple> apples = new ArrayList<>(); apples.add(new GrannySmith()); apples.add(new Gala()); apples.add(new Fuji()); // apples.add() // for (Apple apple : apples) { System.out.println(apple.getClass().getSimpleName()); } List<Apple> apples1 = new LinkedList<>(); } }
[ "kevinweiqy@gmail.com" ]
kevinweiqy@gmail.com
0799481f3d05fe01e4a8dc7452f7f5e939d95ab8
fb75089a73c490d719c620ea2a01cd7129c80558
/mall-pc/src/main/java/com/sxnd/pc/mapper/UserMapper.java
c8ac9d4fe44917468cccfb005e383668249a90c3
[]
no_license
EC-Company/mall
7c275108dfb261512787ef48e209f9ac8abd5714
3a2ccc0fbf517e480898f0d3bc16051b22c3e215
refs/heads/master
2023-03-07T23:55:30.609102
2021-02-26T02:56:58
2021-02-26T02:56:58
342,442,804
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
package com.sxnd.pc.mapper; import com.sxnd.mall.dto.WaterDTO; import com.sxnd.mall.pojo.User; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface UserMapper { //根据用户名查询用户信息 User queryUserInfoByName(@Param("username") String username); //检查用户邮箱是否已被使用 int queryUserEmailExit(@Param("email") String email); //添加用户 int insertUser(User user); //插入流水 int insertWater(WaterDTO waterDTO); //修改用户积分余额 int updateUserBalance(User user); //根据用户id查询用户信息 User queryUserById(@Param("userId") int userId); }
[ "1213465708@qq.com" ]
1213465708@qq.com
bfa30334f156aebe2f23a72a05a05160a9192b36
dcff4ed13c6726eb33753b1d4d50fbfcde7f3297
/StackExchange IS/src/java/com/wbd/rest/Token.java
8bf212312ee5796078bcf5ed6d02f1351db10c67
[]
no_license
LeeMinCha/IF3110-2015-T2
604afb6b44b0779c2f790b00deba44e959096831
412d5c16c5d5d39b11b0e5ca04821ec0b59da1b3
refs/heads/master
2020-05-26T00:38:25.615453
2015-11-27T15:25:10
2015-11-27T15:25:10
45,901,290
0
0
null
2015-11-10T09:24:59
2015-11-10T09:24:58
null
UTF-8
Java
false
false
169
java
package com.wbd.rest; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Token{ public String access_token; public int lifetime; }
[ "chairuni.aulia.nusapati@gmail.com" ]
chairuni.aulia.nusapati@gmail.com
dae2fdfaaf12af12998b1335a2a150be44296628
880c860713978d6e4725e5067e17827495f03b2b
/src/main/java/kata/holdem/collections/Iterables.java
2771b0553fb00a747948c29aa435b204f26b2ea6
[]
no_license
andywhitfield/texas-holdem-kata
089eadb9518d79949dd0e30a783a6386dffa0a3f
c6252ead00c5caf3b8fc691c67c96cb4804a6c47
refs/heads/master
2016-09-05T10:19:02.456285
2010-12-01T21:57:01
2010-12-01T21:57:01
689,940
1
0
null
null
null
null
UTF-8
Java
false
false
2,706
java
package kata.holdem.collections; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; public class Iterables { public static <T, K> Map<K, Collection<T>> groupBy(Iterable<T> items, Action<T, K> keyMapper) { Map<K, Collection<T>> grouped = new HashMap<K, Collection<T>>(); for (T item: items) { K key = keyMapper.action(item); Collection<T> groupedValues = grouped.get(key); if (groupedValues == null) { groupedValues = new ArrayList<T>(); grouped.put(key, groupedValues); } groupedValues.add(item); } return grouped; } public static <T, V> Collection<V> select(Iterable<T> items, Action<T, V> selector) { List<V> selected = new ArrayList<V>(); for (T item : items) selected.add(selector.action(item)); return selected; } public static <T> Collection<T> where(Iterable<T> items, Predicate<T> filterWherePredicate) { List<T> selected = new ArrayList<T>(); for (T item : items) if (filterWherePredicate.evaluate(item)) selected.add(item); return selected; } public static <T> List<T> sort(Iterable<T> collection, Comparator<T> sortBy) { List<T> sorted = new ArrayList<T>(); for (T t : collection) sorted.add(t); Collections.sort(sorted, sortBy); return sorted; } public static <T> Iterable<T> join(final Iterable<T> iterable1, final Iterable<T> iterable2) { return new Iterable<T>() { @Override public Iterator<T> iterator() { return new Iterator<T>() { private boolean usingFirstIterator = true; private Iterator<T> iterator1 = iterable1.iterator(); private Iterator<T> iterator2 = iterable2.iterator(); @Override public boolean hasNext() { if (usingFirstIterator) { boolean hasNext = iterator1.hasNext(); if (hasNext) return true; usingFirstIterator = false; } return iterator2.hasNext(); } @Override public T next() { return usingFirstIterator ? iterator1.next() : iterator2.next(); } @Override public void remove() { if (usingFirstIterator) iterator1.remove(); else iterator2.remove(); } }; } }; } public static <K, V> Iterable<KeyValue<K, V>> keyValues(Map<K, V> map) { return Iterables.select(map.entrySet(), new Action<Map.Entry<K, V>, KeyValue<K, V>>() { @Override public KeyValue<K, V> action(Entry<K, V> entry) { return new KeyValue<K, V>(entry.getKey(), entry.getValue()); }}); } }
[ "andy@andywhitfield.me.uk" ]
andy@andywhitfield.me.uk
8296f4e3d99add8995a275fe154af75231489ba1
a01be1184de6e52cdf14943f6e2c764140b22219
/HashMap/src/LinearProbingMapEntry.java
94edefb59e4806807ff7507fc9a0e190b734138b
[]
no_license
joshrhee/DataStructure-Algorithms
c7e94f1b03d7069543ecc088cdca609c64db0951
6b5a81eaf0c4bb7987cd9b941337d6d632a22d5c
refs/heads/master
2023-03-06T07:20:52.518890
2021-02-25T23:21:38
2021-02-25T23:21:38
323,884,771
1
0
null
null
null
null
UTF-8
Java
false
false
2,100
java
/** * Map entry class used for implementing the LinearProbingHashMap. * * DO NOT MODIFY THIS FILE!! * * @author CS 1332 TAs * @version 1.0 */ public class LinearProbingMapEntry<K, V> { private K key; private V value; private boolean removed; /** * Constructs a new LinearProbingMapEntry with the given key and value. * The removed flag is default set to false. * * @param key the key for this entry * @param value the value for this entry */ LinearProbingMapEntry(K key, V value) { this.key = key; this.value = value; } /** * Gets the key. * * @return the key */ K getKey() { return key; } /** * Gets the value. * * @return the value */ V getValue() { return value; } /** * Gets the removed status. * * @return true if the entry is marked as removed, false otherwise */ boolean isRemoved() { return removed; } /** * Sets the key. * * @param key the new key */ void setKey(K key) { this.key = key; } /** * Sets the value. * * @param value the new value */ void setValue(V value) { this.value = value; } /** * Sets the removed status. * * @param removed the new removed status */ void setRemoved(boolean removed) { this.removed = removed; } @Override public String toString() { return String.format("(%s, %s)", key.toString(), value.toString()); } @Override @SuppressWarnings("unchecked") public boolean equals(Object o) { // DO NOT USE THIS METHOD IN YOUR CODE! This is for testing ONLY! if (!(o instanceof LinearProbingMapEntry)) { return false; } else { LinearProbingMapEntry<K, V> that = (LinearProbingMapEntry<K, V>) o; return that.getKey().equals(key) && that.getValue().equals(value) && that.isRemoved() == removed; } } }
[ "sangjunerhee@isangjun-ui-MacBookPro.local" ]
sangjunerhee@isangjun-ui-MacBookPro.local
4c9b7aac3a6443ed54255e2676b44057d1678d41
dea6f153beed7ac10e12b1565f9b1e8872d634c2
/andengine/org/anddev/andengine/engine/camera/Camera.java
1adbf5c2c786cecf7bb4fec8f044b67abea4a52c
[]
no_license
muhanov/bubbles-arbiter
5f3d7eac825d4009272da0215bfb317eea5f9377
fff85c2076d5585ce7465631b58ba74bb9b5755f
refs/heads/master
2019-01-19T06:52:55.219943
2011-11-09T07:29:40
2011-11-09T07:29:40
2,394,745
1
0
null
null
null
null
UTF-8
Java
false
false
12,550
java
package org.anddev.andengine.engine.camera; import static org.anddev.andengine.util.constants.Constants.VERTEX_INDEX_X; import static org.anddev.andengine.util.constants.Constants.VERTEX_INDEX_Y; import javax.microedition.khronos.opengles.GL10; import org.anddev.andengine.collision.RectangularShapeCollisionChecker; import org.anddev.andengine.engine.camera.hud.HUD; import org.anddev.andengine.engine.handler.IUpdateHandler; import org.anddev.andengine.entity.IEntity; import org.anddev.andengine.entity.primitive.Line; import org.anddev.andengine.entity.shape.RectangularShape; import org.anddev.andengine.input.touch.TouchEvent; import org.anddev.andengine.opengl.util.GLHelper; import org.anddev.andengine.util.MathUtils; /** * (c) 2010 Nicolas Gramlich * (c) 2011 Zynga Inc. * * @author Nicolas Gramlich * @since 10:24:18 - 25.03.2010 */ public class Camera implements IUpdateHandler { // =========================================================== // Constants // =========================================================== protected static final float[] VERTICES_TOUCH_TMP = new float[2]; // =========================================================== // Fields // =========================================================== private float mMinX; private float mMaxX; private float mMinY; private float mMaxY; private float mNearZ = -1.0f; private float mFarZ = 1.0f; private HUD mHUD; private IEntity mChaseEntity; protected float mRotation = 0; protected float mCameraSceneRotation = 0; protected int mSurfaceX; protected int mSurfaceY; protected int mSurfaceWidth; protected int mSurfaceHeight; // =========================================================== // Constructors // =========================================================== public Camera(final float pX, final float pY, final float pWidth, final float pHeight) { this.mMinX = pX; this.mMaxX = pX + pWidth; this.mMinY = pY; this.mMaxY = pY + pHeight; } // =========================================================== // Getter & Setter // =========================================================== public float getMinX() { return this.mMinX; } public float getMaxX() { return this.mMaxX; } public float getMinY() { return this.mMinY; } public float getMaxY() { return this.mMaxY; } public float getNearZClippingPlane() { return this.mNearZ; } public float getFarZClippingPlane() { return this.mFarZ; } public void setNearZClippingPlane(final float pNearZClippingPlane) { this.mNearZ = pNearZClippingPlane; } public void setFarZClippingPlane(final float pFarZClippingPlane) { this.mFarZ = pFarZClippingPlane; } public void setZClippingPlanes(final float pNearZClippingPlane, final float pFarZClippingPlane) { this.mNearZ = pNearZClippingPlane; this.mFarZ = pFarZClippingPlane; } public float getWidth() { return this.mMaxX - this.mMinX; } public float getHeight() { return this.mMaxY - this.mMinY; } public float getWidthRaw() { return this.mMaxX - this.mMinX; } public float getHeightRaw() { return this.mMaxY - this.mMinY; } public float getCenterX() { final float minX = this.mMinX; return minX + (this.mMaxX - minX) * 0.5f; } public float getCenterY() { final float minY = this.mMinY; return minY + (this.mMaxY - minY) * 0.5f; } public void setCenter(final float pCenterX, final float pCenterY) { final float dX = pCenterX - this.getCenterX(); final float dY = pCenterY - this.getCenterY(); this.mMinX += dX; this.mMaxX += dX; this.mMinY += dY; this.mMaxY += dY; } public void offsetCenter(final float pX, final float pY) { this.setCenter(this.getCenterX() + pX, this.getCenterY() + pY); } public HUD getHUD() { return this.mHUD; } public void setHUD(final HUD pHUD) { this.mHUD = pHUD; pHUD.setCamera(this); } public boolean hasHUD() { return this.mHUD != null; } public void setChaseEntity(final IEntity pChaseEntity) { this.mChaseEntity = pChaseEntity; } public float getRotation() { return this.mRotation; } public void setRotation(final float pRotation) { this.mRotation = pRotation; } public float getCameraSceneRotation() { return this.mCameraSceneRotation; } public void setCameraSceneRotation(final float pCameraSceneRotation) { this.mCameraSceneRotation = pCameraSceneRotation; } public int getSurfaceX() { return this.mSurfaceX; } public int getSurfaceY() { return this.mSurfaceY; } public int getSurfaceWidth() { return this.mSurfaceWidth; } public int getSurfaceHeight() { return this.mSurfaceHeight; } public void setSurfaceSize(final int pSurfaceX, final int pSurfaceY, final int pSurfaceWidth, final int pSurfaceHeight) { this.mSurfaceX = pSurfaceX; this.mSurfaceY = pSurfaceY; this.mSurfaceWidth = pSurfaceWidth; this.mSurfaceHeight = pSurfaceHeight; } public boolean isRotated() { return this.mRotation != 0; } // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override public void onUpdate(final float pSecondsElapsed) { if(this.mHUD != null) { this.mHUD.onUpdate(pSecondsElapsed); } this.updateChaseEntity(); } @Override public void reset() { } // =========================================================== // Methods // =========================================================== public void onDrawHUD(final GL10 pGL) { if(this.mHUD != null) { this.mHUD.onDraw(pGL, this); } } public void updateChaseEntity() { if(this.mChaseEntity != null) { final float[] centerCoordinates = this.mChaseEntity.getSceneCenterCoordinates(); this.setCenter(centerCoordinates[VERTEX_INDEX_X], centerCoordinates[VERTEX_INDEX_Y]); } } public boolean isLineVisible(final Line pLine) { return RectangularShapeCollisionChecker.isVisible(this, pLine); } public boolean isRectangularShapeVisible(final RectangularShape pRectangularShape) { return RectangularShapeCollisionChecker.isVisible(this, pRectangularShape); } public void onApplySceneMatrix(final GL10 pGL) { GLHelper.setProjectionIdentityMatrix(pGL); pGL.glOrthof(this.getMinX(), this.getMaxX(), this.getMaxY(), this.getMinY(), this.mNearZ, this.mFarZ); final float rotation = this.mRotation; if(rotation != 0) { this.applyRotation(pGL, this.getCenterX(), this.getCenterY(), rotation); } } public void onApplySceneBackgroundMatrix(final GL10 pGL) { GLHelper.setProjectionIdentityMatrix(pGL); final float widthRaw = this.getWidthRaw(); final float heightRaw = this.getHeightRaw(); pGL.glOrthof(0, widthRaw, heightRaw, 0, this.mNearZ, this.mFarZ); final float rotation = this.mRotation; if(rotation != 0) { this.applyRotation(pGL, widthRaw * 0.5f, heightRaw * 0.5f, rotation); } } public void onApplyCameraSceneMatrix(final GL10 pGL) { GLHelper.setProjectionIdentityMatrix(pGL); final float widthRaw = this.getWidthRaw(); final float heightRaw = this.getHeightRaw(); pGL.glOrthof(0, widthRaw, heightRaw, 0, this.mNearZ, this.mFarZ); final float cameraSceneRotation = this.mCameraSceneRotation; if(cameraSceneRotation != 0) { this.applyRotation(pGL, widthRaw * 0.5f, heightRaw * 0.5f, cameraSceneRotation); } } private void applyRotation(final GL10 pGL, final float pRotationCenterX, final float pRotationCenterY, final float pAngle) { pGL.glTranslatef(pRotationCenterX, pRotationCenterY, 0); pGL.glRotatef(pAngle, 0, 0, 1); pGL.glTranslatef(-pRotationCenterX, -pRotationCenterY, 0); } public void convertSceneToCameraSceneTouchEvent(final TouchEvent pSceneTouchEvent) { this.unapplySceneRotation(pSceneTouchEvent); this.applySceneToCameraSceneOffset(pSceneTouchEvent); this.applyCameraSceneRotation(pSceneTouchEvent); } public void convertCameraSceneToSceneTouchEvent(final TouchEvent pCameraSceneTouchEvent) { this.unapplyCameraSceneRotation(pCameraSceneTouchEvent); this.unapplySceneToCameraSceneOffset(pCameraSceneTouchEvent); this.applySceneRotation(pCameraSceneTouchEvent); } protected void applySceneToCameraSceneOffset(final TouchEvent pSceneTouchEvent) { pSceneTouchEvent.offset(-this.mMinX, -this.mMinY); } protected void unapplySceneToCameraSceneOffset(final TouchEvent pCameraSceneTouchEvent) { pCameraSceneTouchEvent.offset(this.mMinX, this.mMinY); } private void applySceneRotation(final TouchEvent pCameraSceneTouchEvent) { final float rotation = -this.mRotation; if(rotation != 0) { VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pCameraSceneTouchEvent.getX(); VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pCameraSceneTouchEvent.getY(); MathUtils.rotateAroundCenter(VERTICES_TOUCH_TMP, rotation, this.getCenterX(), this.getCenterY()); pCameraSceneTouchEvent.set(VERTICES_TOUCH_TMP[VERTEX_INDEX_X], VERTICES_TOUCH_TMP[VERTEX_INDEX_Y]); } } private void unapplySceneRotation(final TouchEvent pSceneTouchEvent) { final float rotation = this.mRotation; if(rotation != 0) { VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pSceneTouchEvent.getX(); VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pSceneTouchEvent.getY(); MathUtils.revertRotateAroundCenter(VERTICES_TOUCH_TMP, rotation, this.getCenterX(), this.getCenterY()); pSceneTouchEvent.set(VERTICES_TOUCH_TMP[VERTEX_INDEX_X], VERTICES_TOUCH_TMP[VERTEX_INDEX_Y]); } } private void applyCameraSceneRotation(final TouchEvent pSceneTouchEvent) { final float cameraSceneRotation = -this.mCameraSceneRotation; if(cameraSceneRotation != 0) { VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pSceneTouchEvent.getX(); VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pSceneTouchEvent.getY(); MathUtils.rotateAroundCenter(VERTICES_TOUCH_TMP, cameraSceneRotation, (this.mMaxX - this.mMinX) * 0.5f, (this.mMaxY - this.mMinY) * 0.5f); pSceneTouchEvent.set(VERTICES_TOUCH_TMP[VERTEX_INDEX_X], VERTICES_TOUCH_TMP[VERTEX_INDEX_Y]); } } private void unapplyCameraSceneRotation(final TouchEvent pCameraSceneTouchEvent) { final float cameraSceneRotation = -this.mCameraSceneRotation; if(cameraSceneRotation != 0) { VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pCameraSceneTouchEvent.getX(); VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pCameraSceneTouchEvent.getY(); MathUtils.revertRotateAroundCenter(VERTICES_TOUCH_TMP, cameraSceneRotation, (this.mMaxX - this.mMinX) * 0.5f, (this.mMaxY - this.mMinY) * 0.5f); pCameraSceneTouchEvent.set(VERTICES_TOUCH_TMP[VERTEX_INDEX_X], VERTICES_TOUCH_TMP[VERTEX_INDEX_Y]); } } public void convertSurfaceToSceneTouchEvent(final TouchEvent pSurfaceTouchEvent, final int pSurfaceWidth, final int pSurfaceHeight) { final float relativeX; final float relativeY; final float rotation = this.mRotation; if(rotation == 0) { relativeX = pSurfaceTouchEvent.getX() / pSurfaceWidth; relativeY = pSurfaceTouchEvent.getY() / pSurfaceHeight; } else if(rotation == 180) { relativeX = 1 - (pSurfaceTouchEvent.getX() / pSurfaceWidth); relativeY = 1 - (pSurfaceTouchEvent.getY() / pSurfaceHeight); } else { VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pSurfaceTouchEvent.getX(); VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pSurfaceTouchEvent.getY(); MathUtils.rotateAroundCenter(VERTICES_TOUCH_TMP, rotation, pSurfaceWidth / 2, pSurfaceHeight / 2); relativeX = VERTICES_TOUCH_TMP[VERTEX_INDEX_X] / pSurfaceWidth; relativeY = VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] / pSurfaceHeight; } this.convertAxisAlignedSurfaceToSceneTouchEvent(pSurfaceTouchEvent, relativeX, relativeY); } private void convertAxisAlignedSurfaceToSceneTouchEvent(final TouchEvent pSurfaceTouchEvent, final float pRelativeX, final float pRelativeY) { final float minX = this.getMinX(); final float maxX = this.getMaxX(); final float minY = this.getMinY(); final float maxY = this.getMaxY(); final float x = minX + pRelativeX * (maxX - minX); final float y = minY + pRelativeY * (maxY - minY); pSurfaceTouchEvent.set(x, y); } // =========================================================== // Inner and Anonymous Classes // =========================================================== }
[ "maxim.uhanov@gmail.com" ]
maxim.uhanov@gmail.com
9bc81b8707ba1f85243fa59a7fb4791997e913c8
53c2c80c6b53bc1624c77ea8317499d2f28da495
/messenger-server/src/main/java/com/zemrow/messenger/mq/ClusterMessaging.java
726fa3e5030d6b4771b7b1aa0865658af1aa0965
[]
no_license
a-polyakov/com.zemrow.messenger
3016d864e7ad4a13f51fd7b35f898551b440a0f4
dc865d21b45634fb791ad033e0598f495022cb2d
refs/heads/master
2022-11-25T20:48:19.089558
2022-01-05T01:25:07
2022-01-05T02:08:45
129,466,574
0
0
null
2022-11-23T22:18:03
2018-04-14T00:27:24
Java
UTF-8
Java
false
false
1,604
java
package com.zemrow.messenger.mq; import com.zemrow.messenger.enums.ResponseScopeEnum; import java.io.Closeable; import java.io.IOException; /** * Отправка и получение сообщений между узлами кластера. * * @author Alexandr Polyakov on 2019.01.16 */ public class ClusterMessaging implements Closeable { //private static final String TOPIC_NAME = "MESSAGE_TO_SCOPE"; public ClusterMessaging() { } /** * Отправить сообщение в остальные узлы кластера, для трансляции на клиентов подключенных к ним. * * @param scope Уровень рассылки ответа. * @param scopeObjectId Идентификатор объекта к которому привязан ответ (идентификатор пользователя || идентификатор чата). * @param json Сообщение. */ public void publish(ResponseScopeEnum scope, long scopeObjectId, String json) { final ClusterMessagingDto dto = new ClusterMessagingDto(); dto.setScope(scope); dto.setScopeObjectId(scopeObjectId); dto.setJson(json); //TODO send(TOPIC_NAME, dto); } /** * Подписаться на получение сообщений. * * @param listener Слушатель. */ public void subscribe(ClusterMessagingListener listener) { // TODO } @Override public void close() throws IOException { // TODO } }
[ "polyakov.alexandr.alexandrovich@gmail.com" ]
polyakov.alexandr.alexandrovich@gmail.com
9fa265f99c83a97ce64aafb638fbfe37ae7dfd2b
a92de988771d545ae6058cd9641a959bf77fb71d
/Module 11/11.13 Transactions/src/java/Main.java
31fe6308d204de0d137c2d1a4a1e315d9026202f
[]
no_license
Topoy/Skillbox
d74aa7fa45edd74132ba96d3a14cd33dec959734
b0ba304bb053e561abd38f99b37e0411db0e294d
refs/heads/master
2022-09-21T01:35:57.479600
2020-08-03T07:38:22
2020-08-03T07:38:22
213,131,436
0
0
null
2022-09-01T23:27:00
2019-10-06T08:13:58
Java
UTF-8
Java
false
false
951
java
import java.util.ArrayList; public class Main { public static void main(String[] args) throws InterruptedException { /* Bank sberbank = new Bank(); ArrayList<Account> accounts = new ArrayList<>(); ArrayList<Account> accounts1 = new ArrayList<>(); for (int i = 0; i < 2; i++) { accounts.add(sberbank.getAccounts().get(i)); } System.out.println(accounts.size()); accounts.forEach(a -> System.out.println("Номер счета: " + a.getAccNumber() + "; Баланс " + a.getMoney())); for (int i = 0; i < 1; i++) { sberbank.transfer(i, i + 1, 5000); } for (int i = 0; i < 2; i++) { accounts1.add(sberbank.getAccounts().get(i)); } accounts1.forEach(a -> System.out.println("Номер счета: " + a.getAccNumber() + "; Баланс " + a.getMoney())); */ } }
[ "rinz.ler@aiesec.net" ]
rinz.ler@aiesec.net
aa39520d766af90511252c66549dd4958cd6dc37
d514b8e00c12a3dc98092a61cfbebcd4f52515d8
/OOP/basic-app/src/com/teclabs/chapter/EchoTestDrive.java
6c87c7a39cf43e07fa1ccd325221a6ee7de122e1
[]
no_license
2SANAL/Swabhav-Repo
a9674a3c46a7d39e8068e181223a60d2429ee6b7
3db9313727cbee3bc100d56ac6c2f373b03e554b
refs/heads/master
2023-03-10T00:01:47.492727
2019-08-01T14:27:36
2019-08-01T14:27:36
179,927,069
0
0
null
2023-02-22T21:42:07
2019-04-07T06:33:53
C#
UTF-8
Java
false
false
476
java
package com.teclabs.chapter; public class EchoTestDrive { public static void main(String[] args) { Echo e1 = new Echo(); Echo e2 = new Echo(); int x = 0; while (x < 4) { e1.hello(); e1.count = e1.count + 1; if (x == 3) { e2.count = e2.count + 1; } if (x > 0) { e2.count = e2.count + e1.count; } x = x + 1; } System.out.println(e2.count); } } class Echo { int count = 0; void hello() { System.out.println("helloooo... "); } }
[ "sanal.dhamanse2131926@gmail.com" ]
sanal.dhamanse2131926@gmail.com
1cf743d5db87d9da82945f2ba0b629ce42d6d631
60e29c4c6e59c896837f3ec6c491994ee51ddeff
/TestStudent.java
312cc1dab90a2f1dcc43acc602ca9d22b035ab1b
[]
no_license
candreal/Java-Simple-Programs
e3b7bcc9f638b03f52738d9af4d03cfa00026998
f9ceeb2813ba2a7a02feb5b869bf9dddaed6bf04
refs/heads/master
2022-11-23T05:04:40.421493
2020-07-20T03:42:59
2020-07-20T03:42:59
280,794,379
0
0
null
null
null
null
UTF-8
Java
false
false
1,542
java
class TestStudent { public static void main(String[] args) { //class needs to be called TestStudent //creating instance of encapsulated Student class Student s = new Student(); //setting value in studentId member s.setStudentId(123456789); //getting value in studentId member System.out.println("Student ID: " + s.getStudentId()); //setting value in studentName member s.setStudentName("Celena"); //getting value in studentName member System.out.println("Student Name: " + s.getStudentName()); //setting value in collegeName member s.setCollegeName("University of North Texas"); //getting value in collegeName member System.out.println("College: " + s.getCollegeName()); //setting value in address member s.setAddress("1234 Street Rd"); //getting value in address member System.out.println("Student Address: " + s.getAddress()); } } //Student class, fully encapsulated class Student { private int studentId; private String studentName; private String collegeName; private String address; int getStudentId() { return studentId; } void setStudentId(int id) { studentId = id; } String getStudentName() { return studentName; } void setStudentName(String name) { studentName = name; } String getCollegeName() { return collegeName; } void setCollegeName(String college) { collegeName = college; } String getAddress() { return address; } void setAddress(String address) { this.address = address; } }
[ "noreply@github.com" ]
noreply@github.com
4e4b96c0b9e4b4c57392512e4334f678190367b0
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a292/A292439.java
a6d9b623f4302005747fbea862d03753b903a9b9
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,152
java
package irvine.oeis.a292; import irvine.oeis.FiniteSequence; /** * A292439 List of numbers k whose consecutive digits increase or decrease by <code>d-1</code>, where d is the number of digits in k. * @author Georg Fischer */ public class A292439 extends FiniteSequence { /** Construct the sequence. */ public A292439() { super(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 131, 135, 202, 242, 246, 313, 353, 357, 420, 424, 464, 468, 531, 535, 575, 579, 642, 646, 686, 753, 757, 797, 864, 868, 975, 979, 1414, 1474, 2525, 2585, 3030, 3036, 3630, 3636, 3696, 4141, 4147, 4741, 4747, 5252, 5258, 5852, 5858, 6303, 6363, 6369, 6963, 6969, 7414, 7474, 8525, 8585, 9630, 9636, 9696, 15151, 15159, 15951, 15959, 26262, 37373, 40404, 40484, 48404, 48484, 51515, 51595, 59515, 59595, 62626, 73737, 84040, 84048, 84840, 84848, 95151, 95159, 95951, 95959, 161616, 272727, 383838, 494949, 505050, 616161, 727272, 838383, 949494, 1717171, 2828282, 3939393, 6060606, 7171717, 8282828, 9393939, 18181818, 29292929, 70707070, 81818181, 92929292, 191919191L, 808080808L, 919191919L, 9090909090L); } }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
44521dd7d406c35b5030e7b138e538d68e399952
329307375d5308bed2311c178b5c245233ac6ff1
/src/com/tencent/mm/protocal/b/hy.java
e45f2f36542cd29e357f6d9ebecf4cdcd17d22cc
[]
no_license
ZoneMo/com.tencent.mm
6529ac4c31b14efa84c2877824fa3a1f72185c20
dc4f28aadc4afc27be8b099e08a7a06cee1960fe
refs/heads/master
2021-01-18T12:12:12.843406
2015-07-05T03:21:46
2015-07-05T03:21:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,248
java
package com.tencent.mm.protocal.b; import a.a.a.b; import java.util.LinkedList; public final class hy extends com.tencent.mm.al.a { public adu hrQ; protected final int a(int paramInt, Object... paramVarArgs) { if (paramInt == 0) { paramVarArgs = (a.a.a.c.a)paramVarArgs[0]; if (hrQ == null) { throw new b("Not all required fields were included: MemberName"); } if (hrQ != null) { paramVarArgs.bN(1, hrQ.kS()); hrQ.a(paramVarArgs); } return 0; } if (paramInt == 1) { if (hrQ == null) { break label305; } } label305: for (paramInt = a.a.a.a.bJ(1, hrQ.kS()) + 0;; paramInt = 0) { return paramInt; if (paramInt == 2) { paramVarArgs = new a.a.a.a.a((byte[])paramVarArgs[0], hfZ); for (paramInt = com.tencent.mm.al.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.al.a.a(paramVarArgs)) { if (!super.a(paramVarArgs, this, paramInt)) { paramVarArgs.aVo(); } } if (hrQ != null) { break; } throw new b("Not all required fields were included: MemberName"); } if (paramInt == 3) { Object localObject1 = (a.a.a.a.a)paramVarArgs[0]; hy localhy = (hy)paramVarArgs[1]; paramInt = ((Integer)paramVarArgs[2]).intValue(); switch (paramInt) { default: return -1; } paramVarArgs = ((a.a.a.a.a)localObject1).pL(paramInt); int i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { Object localObject2 = (byte[])paramVarArgs.get(paramInt); localObject1 = new adu(); localObject2 = new a.a.a.a.a((byte[])localObject2, hfZ); for (boolean bool = true; bool; bool = ((adu)localObject1).a((a.a.a.a.a)localObject2, (com.tencent.mm.al.a)localObject1, com.tencent.mm.al.a.a((a.a.a.a.a)localObject2))) {} hrQ = ((adu)localObject1); paramInt += 1; } break; } return -1; } } } /* Location: * Qualified Name: com.tencent.mm.protocal.b.hy * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
90c6f02409f316ee505a87f343ab3b8002e564f1
dca9c2444293f4b6ec598d44ff9b70800d81a4b1
/Documents/NetBeansProjects/Exercise2/src/test/java/com/aiden/exercise2/ApplicationTest.java
5c48818a8c22bc05ffc1d8f4200c22b2cab3f5cc
[]
no_license
AidenPage/ComputerStore
89bb8aeeab270b6162c11566d12250f8ca54f27e
b4d193b0ea6a7f76ee599d65fa26cc861ccd6c8b
refs/heads/master
2020-09-16T05:49:00.455085
2016-09-02T19:57:17
2016-09-02T19:57:21
67,256,040
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.aiden.exercise2; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Aidem */ public class ApplicationTest { public ApplicationTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } // TODO add test methods here. // The methods must be annotated with annotation @Test. For example: // // @Test // public void hello() {} }
[ "aidenpage@gmail.com" ]
aidenpage@gmail.com
ab72c101cc57a8bfecda01eaa90d784cd2514a5d
2a2c0a881576c011fc93674c195b5ce4c3352c0b
/app/src/main/java/vv/game/vaibhav/tiles/ContinuousGame.java
28cadb60d8b70c78f75af55a101db5c7d3e8e7f1
[]
no_license
vaibhav012/DOZO
3457ccd63763dd6b4893db00987f4d63f282a15b
85350977d5a5b39d04f71890f039d3a114c3f6eb
refs/heads/master
2021-01-11T16:09:42.008784
2017-01-25T14:51:52
2017-01-25T14:51:52
80,022,934
0
0
null
null
null
null
UTF-8
Java
false
false
9,473
java
package vv.game.vaibhav.tiles; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Intent; import android.os.CountDownTimer; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; import com.example.vaibhav.tiles.R; public class ContinuousGame extends AppCompatActivity implements Fragment5.TalkToActivity, Animation.AnimationListener{ long timePassed = 0, totalPixelScrolled = 0; int pixelScrolledRev = 0, pixelScrolled = 0; ScrollView gameScrollView; int score = 0; int pixel1dp; TextView scoreText; FragmentManager fragmentManager; int fragmentContainer; int topFragTag = 1; int checkFragTag = 2; int bottomFragTag = 0; CountDownTimer countDownTimer, countDownTimer1; VVScreenSize vvScreenSize; int screenWidth, screenHeight, tileDimenPixel; Animation animFadein; TextView textViewScore; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_continuous_game); pixel1dp = getResources().getDimensionPixelSize(R.dimen.pixelConvert); vvScreenSize = new VVScreenSize(); screenHeight = (int)vvScreenSize.vvScreenHeightPixel(ContinuousGame.this); screenWidth = (int)vvScreenSize.vvScreenWidthPixel(ContinuousGame.this); tileDimenPixel = (int)(screenWidth-5*pixel1dp)/5; gameScrollView = (ScrollView) findViewById(R.id.gameScrollView); scoreText = (TextView) findViewById(R.id.Score); textViewScore = (TextView) findViewById(R.id.textViewScore); fragmentContainer = R.id.fragment_container; // animFadein = AnimationUtils.loadAnimation(getApplicationContext(), // R.anim.blink); // animFadein.setAnimationListener(this); fragmentManager = getFragmentManager(); for(int i = 0; i < 15; i++) { addFragment(); } vvScrollViewScroll(); gameScrollView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); } @Override protected void onPause() { super.onPause(); countDownTimer.cancel(); } @Override public void onAnimationEnd(Animation animation) { // Take any action after completing the animation textViewScore.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } public void vvScrollViewScroll(){ final long totalScrollTime = 2147483647; final int scrollPeriod = 20; final int heightToScroll = tileDimenPixel/50; gameScrollView.post(new Runnable() { @Override public void run() { countDownTimer = new MyCountDownTimer(totalScrollTime, scrollPeriod, heightToScroll).start(); } }); } @Override public Boolean sendButton(int fragId, int ButtonId, int flagBoth) { if(flagBoth == 0){ Fragment5 frag = (Fragment5) fragmentManager.findFragmentByTag("row"+(fragId - 1)); if (!frag.fragCheck1(ButtonId)) { return false; } else return true; } else { if (fragId == 1) { Fragment5 frag = (Fragment5) fragmentManager.findFragmentByTag("row" + (fragId + 1)); if (!frag.fragCheck1(ButtonId)) { return false; } else return true; } else { Fragment5 frag = (Fragment5) fragmentManager.findFragmentByTag("row" + (fragId - 1)); Fragment5 frag1 = (Fragment5) fragmentManager.findFragmentByTag("row" + (fragId + 1)); if (frag.fragCheck1(ButtonId) || frag1.fragCheck1(ButtonId)) { return true; } else return false; } } } @Override public void startResult(int resultId) { countDownTimer.cancel(); Intent intent = new Intent(getBaseContext(), ResultContinuous.class); intent.putExtra("level", -1); intent.putExtra("result", resultId); intent.putExtra("levelScore", score); startActivity(intent); } @Override public void addScore() { score++; scoreText.setText("" + score); } public class MyCountDownTimer extends CountDownTimer { long scrollPeriod; int heightToScroll; long flag; public MyCountDownTimer(long startTime, long interval, int h) { super(startTime, interval); scrollPeriod = interval; heightToScroll = h; } @Override public void onFinish() { } @Override public void onTick(long millisUntilFinished) { try { if (timePassed > 2000) { gameScrollView.scrollBy(0, heightToScroll); pixelScrolled += heightToScroll; totalPixelScrolled += heightToScroll; if ((totalPixelScrolled / (5 * (tileDimenPixel + pixel1dp))) > flag) { flag += 2; heightToScroll += tileDimenPixel / 100; textViewScore.setVisibility(View.VISIBLE); textViewScore.setText(score + ""); // start the animation //textViewScore.startAnimation(animFadein); //textViewScore.startAnimation(animFadein); MyCountDownTimerScore myCountDownTimerScore = new MyCountDownTimerScore(2000, 1000); myCountDownTimerScore.start(); } if (pixelScrolled >= (tileDimenPixel + pixel1dp)) { pixelScrolled -= (tileDimenPixel + pixel1dp); Fragment5 frag = (Fragment5) fragmentManager.findFragmentByTag("row" + checkFragTag); for (int i = 0; i < 5; i++) { if (!frag.fragCheck1(i) && !frag.fragCheckLost(i) && !sendButton(checkFragTag, i, 1)) { countDownTimer.cancel(); frag.alertButton(i); for (int j = 1; j <= bottomFragTag; j++) { Fragment5 frag1 = (Fragment5) fragmentManager.findFragmentByTag("row" + j); frag1.disableButtons(); } endGame(); } } addFragment(); checkFragTag++; } } timePassed = timePassed + scrollPeriod; } catch(Exception e){ } } } public class MyCountDownTimerScore extends CountDownTimer { public MyCountDownTimerScore(long startTime, long interval) { super(startTime, interval); } @Override public void onFinish() { textViewScore.setVisibility(View.GONE); } @Override public void onTick(long millisUntilFinished) { } } public void addFragment(){ bottomFragTag++; FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); Fragment5 hello = new Fragment5(); hello.setFragTag(bottomFragTag); fragmentTransaction.add(fragmentContainer, hello, "row" + bottomFragTag); fragmentTransaction.commit(); fragmentManager.executePendingTransactions(); } public void removeFragment(){ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); Fragment5 frag = (Fragment5) fragmentManager.findFragmentByTag("row" + topFragTag++); fragmentTransaction.remove(frag); fragmentTransaction.commit(); fragmentManager.executePendingTransactions(); } public void endGame(){ gameScrollView.post(new Runnable() { @Override public void run() { new CountDownTimer(1200, 1){ @Override public void onFinish() { startResult(2); } @Override public void onTick(long millisUntilFinished) { if(pixelScrolledRev <= (tileDimenPixel+pixel1dp)) { gameScrollView.scrollBy(0, -1); totalPixelScrolled -= 1; pixelScrolledRev += 1; } } }.start(); } }); } }
[ "vaibhavtayal95@gmail.com" ]
vaibhavtayal95@gmail.com
edb474363c588bdf22b0845acaf78923b9246bca
57784fb314e024f0a59e7c962733a37ffe81d681
/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/VMThinLRURegionEntryHeap.java
1424c4a0d3f18e3950b9e4094ca16eea00200cd2
[ "Apache-2.0", "LGPL-2.1-only", "JSON", "Plexus", "LicenseRef-scancode-other-permissive", "MIT", "Apache-1.1", "GPL-2.0-only", "BSD-2-Clause" ]
permissive
TIBCOSoftware/snappy-store
a5ea4df265acf60697a5dad3c74cc1e12e41381b
d6ef57196127f1e87cc902e1aa20055025590b2d
refs/heads/snappy/master
2023-09-03T13:29:24.241765
2022-06-27T21:24:32
2022-06-27T21:24:32
48,800,286
3
4
Apache-2.0
2023-04-16T22:34:56
2015-12-30T12:44:56
Java
UTF-8
Java
false
false
5,503
java
/* * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you * may not use this file except in compliance with the License. You * may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. See accompanying * LICENSE file. */ /** * Do not modify this class. It was generated. * Instead modify LeafRegionEntry.cpp and then run * bin/generateRegionEntryClasses.sh from the directory * that contains your build.xml. */ package com.gemstone.gemfire.internal.cache; import java.util.concurrent.atomic.AtomicLongFieldUpdater; import com.gemstone.gemfire.internal.cache.Token; import com.gemstone.gemfire.internal.concurrent.AtomicUpdaterFactory; import com.gemstone.gemfire.internal.cache.lru.EnableLRU; import com.gemstone.gemfire.internal.cache.lru.LRUClockNode; import com.gemstone.gemfire.internal.concurrent.CustomEntryConcurrentHashMap.HashEntry; @SuppressWarnings("serial") public class VMThinLRURegionEntryHeap extends VMThinLRURegionEntry { public VMThinLRURegionEntryHeap (RegionEntryContext context, Object key, Object value ) { super(context, value ); this.key = key; } protected int hash; private HashEntry<Object, Object> next; @SuppressWarnings("unused") private volatile long lastModified; private static final AtomicLongFieldUpdater<VMThinLRURegionEntryHeap> lastModifiedUpdater = AtomicUpdaterFactory.newLongFieldUpdater(VMThinLRURegionEntryHeap.class, "lastModified"); protected long getlastModifiedField() { return lastModifiedUpdater.get(this); } protected final boolean compareAndSetLastModifiedField(long expectedValue, long newValue) { return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue); } @Override public final int getEntryHash() { return this.hash; } @Override protected final void setEntryHash(int v) { this.hash = v; } @Override public final HashEntry<Object, Object> getNextEntry() { return this.next; } @Override public final void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } @Override public final void setDelayedDiskId(LocalRegion r) { } public final synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); } public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getRawKey(), value); setEntrySize(newSize); int delta = newSize - oldSize; return delta; } private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; public final void setNextLRUNode( LRUClockNode next ) { this.nextLRU = next; } public final LRUClockNode nextLRUNode() { return this.nextLRU; } public final void setPrevLRUNode( LRUClockNode prev ) { this.prevLRU = prev; } public final LRUClockNode prevLRUNode() { return this.prevLRU; } public final int getEntrySize() { return this.size; } protected final void setEntrySize(int size) { this.size = size; } private Object key; @Override public final Object getRawKey() { return this.key; } @Override protected final void _setRawKey(Object key) { this.key = key; } private volatile Object value; @Override public final boolean isRemoved() { final Object o = this.value; return (o == Token.REMOVED_PHASE1) || (o == Token.REMOVED_PHASE2) || (o == Token.TOMBSTONE); } @Override public final boolean isDestroyedOrRemoved() { final Object o = this.value; return o == Token.DESTROYED || o == Token.REMOVED_PHASE1 || o == Token.REMOVED_PHASE2 || o == Token.TOMBSTONE; } @Override public final boolean isDestroyedOrRemovedButNotTombstone() { final Object o = this.value; return o == Token.DESTROYED || o == Token.REMOVED_PHASE1 || o == Token.REMOVED_PHASE2; } @Override protected final Object getValueField() { return this.value; } @Override protected final void setValueField(Object v) { this.value = v; } @Override public final Token getValueAsToken() { Object v = this.value; if (v == null) { return null; } else if (v instanceof Token) { return (Token)v; } else { return Token.NOT_A_TOKEN; } } @Override public final boolean isValueNull() { return this.value == null; } private static RegionEntryFactory factory = new RegionEntryFactory() { public final RegionEntry createEntry(RegionEntryContext context, Object key, Object value) { return new VMThinLRURegionEntryHeap(context, key, value); } public final Class<?> getEntryClass() { return VMThinLRURegionEntryHeap.class; } public RegionEntryFactory makeVersioned() { return VMThinLRURegionEntryHeap.getEntryFactory(); } @Override public RegionEntryFactory makeOnHeap() { return this; } }; public static RegionEntryFactory getEntryFactory() { return factory; } }
[ "swale@snappydata.io" ]
swale@snappydata.io
ce45e9097651b3723eb5c3d375eb7ef953da1070
6bcb1ee47c9a44a7c7381d47ee0c925f60953963
/app/src/main/java/com/example/free/LookUsersActivity.java
92b81797b589004d5a410f49cd3c70237024b3e2
[]
no_license
rohhenry/Spontinate
597d4e35dc465e9a1d0740d2fb3afea411112d3b
040c72320482823b6fa7b7afc8c4a60a5b0ab1ab
refs/heads/master
2022-11-25T11:04:33.358777
2020-08-01T19:45:28
2020-08-01T19:45:28
260,432,378
0
0
null
null
null
null
UTF-8
Java
false
false
2,375
java
package com.example.free; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import java.time.format.DateTimeFormatter; import static android.content.ContentValues.TAG; public class LookUsersActivity extends AppCompatActivity { public class userCallback implements Database.createUserCallback{ @Override public void onCallback(final User u){ for(String friendUserName : u.getFriendListString()){ Database.getUser(friendUserName, new Database.createUserCallback(){ @Override public void onCallback(User friend){ Block intersect = u.freeWith(friend); if(intersect != null){ pushToScreen(friend, intersect); } } }); } } } private void pushToScreen(User friend, Block b){ LinearLayout userLayout = findViewById(R.id.linear_layout); TextView userView = new TextView(this); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm"); String endTime = b.endDT.format(formatter); userView.setText( "\n" + friend.getUserName() + ": \"" + friend.freeTime.getMessage() + "\"\navailable until: " + endTime + " for " + b.freeDuration.toHours() + " hours and " + b.freeDuration.minusHours(b.freeDuration.toHours()).toMinutes() + " minutes \n" ); userLayout.addView(userView); } private void displayFriends(){ FirebaseUser fbUser = FirebaseAuth.getInstance().getCurrentUser(); Database.getUser(fbUser.getDisplayName(), new userCallback()); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_look_users); displayFriends(); } }
[ "henryroh2000@gmail.com" ]
henryroh2000@gmail.com
b70d953349a4550d6558d2e426989599a43c74b8
3677c503d37eb8ffd05ad96d3ae38b6b0c6dfe4d
/src/com/example/yss/ListActivity.java
66b49c74587b4dcde96e75a5d8097acbb9a856af
[]
no_license
aaronyuu/Where
d0c34b6568002ee244db2ca2eb8b41ce2a9254e5
b5c005c7e16bca1764402c5f916f0283e3269d34
refs/heads/master
2021-01-20T01:56:22.306341
2015-06-05T02:31:45
2015-06-05T02:31:45
26,741,710
0
0
null
null
null
null
GB18030
Java
false
false
11,487
java
package com.example.yss; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.app.Activity; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Toast; import com.baidu.location.BDLocation; import com.baidu.location.BDLocationListener; import com.baidu.location.LocationClient; import com.baidu.location.LocationClientOption; //import com.baidu.baidulocationdemo.LocationApplication; public class ListActivity extends Activity { Context mContext; Button btnLocal; Button btnList; Button btnAbout; ListView mList; View mView; Button btnSave; Button btnCancle; Button buttonAdd; Button buttonOK; EditText et; SQLiteDatabase db; List<Map<String, Object>> data; private EditText editTextid; private EditText editTextlo; private EditText editTextla; private EditText editTextaddr; public LocationClient mLocationClient = null; public BDLocationListener myListener = new MyLocationListener(); SimpleAdapter mSimpleAdapter; private Button buttonDel; private static int DATABASE_VERSION = 1; private static String DATABASE_NAME = "YSSGPS.db"; private static String TAB_GPSINFO = "gpsinfo"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); // 获取控件 mContext = this; // mUserInfo = (TextView) findViewById(R.id.userinfo); mList = (ListView) findViewById(R.id.listViewGpslist); btnCancle = (Button) findViewById(R.id.buttoncancle); btnSave = (Button) findViewById(R.id.buttonsave); buttonAdd = (Button) findViewById(R.id.buttonAdd); buttonDel = (Button) findViewById(R.id.buttonDel); buttonOK = (Button) findViewById(R.id.buttonOK); mView = findViewById(R.id.linearlayoutuserinfo); editTextid = (EditText) findViewById(R.id.editTextid); editTextlo = (EditText) findViewById(R.id.editTextlo); editTextla = (EditText) findViewById(R.id.editTextla); editTextaddr = (EditText) findViewById(R.id.editTextaddr); data = new ArrayList<Map<String, Object>>(); titleInit(); /* * 启动定位 */ /** * 打开或创建数据库,注意数据库版本 */ DBOpenHelper helper = new DBOpenHelper(this, DATABASE_NAME, null, DATABASE_VERSION); db = helper.getReadableDatabase(); /** * 创建数据接口 SimpleAdapter 1.context 上下文 data : List<? extends Map<String, * ?>> data 一个Map所组成的List集合 resource: 布局文件的ID,如R.layout.item_gpsinfo */ mSimpleAdapter = new SimpleAdapter(mContext, getData(), R.layout.item_gpsinfo, new String[] { "_id", "lo", "la", "addr" }, new int[] { R.id.tv_item_id, R.id.tv_item_lo, R.id.tv_item_la, R.id.tv_item_addr }); /** * 绑定接口到ViewList控件 */ mList.setAdapter(mSimpleAdapter); /** * 点击列表项显示修改界面 */ mList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // 设置修改界面值 editTextid.setText(String .valueOf(data.get(position).get("_id"))); editTextlo.setText(String.valueOf(data.get(position).get("lo"))); editTextla.setText(String.valueOf(data.get(position).get("la"))); editTextaddr.setText(String.valueOf(data.get(position).get( "addr"))); // 显示出来 mView.setVisibility(View.VISIBLE); } }); /** * 返回按钮事件, 点击后隐藏该页面. */ btnCancle.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { editTextid.setText(""); editTextlo.setText(""); editTextla.setText(""); editTextaddr.setText(""); mView.setVisibility(View.INVISIBLE); } }); /** * 添加按钮 */ buttonAdd.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // 启动GPS定位, startGPS(); // 显示编辑界面出来就行了 mView.setVisibility(View.VISIBLE); } }); /** * 删除按钮 */ buttonDel.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (editTextid.getText().length() > 0) { if (delGPSInfo(Long .valueOf(editTextid.getText().toString())) > 0) { mView.setVisibility(View.INVISIBLE); // 刷新数据 getData(); mSimpleAdapter.notifyDataSetChanged(); Toast.makeText(mContext, "删除成功!!", Toast.LENGTH_SHORT) .show(); } else { Toast.makeText(mContext, "删除失败", Toast.LENGTH_SHORT) .show(); } } } }); /** * 设置前位置 */ buttonOK.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // 保存数据到文件 double lo = Double.valueOf(editTextlo.getText().toString()); double la = Double.valueOf(editTextla.getText().toString()); String addr = editTextaddr.getText().toString(); boolean isSaved = YssGPS.setGPSInfo(lo, la, addr); if (!isSaved) { Toast.makeText(mContext, "保存错误", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(mContext, "成功设置当前位置,现在打开破解版的CRM软件定位一下吧!", Toast.LENGTH_LONG).show(); // 打开当前位置界面 } } }); /** * 保存按钮事件. */ btnSave.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { double lo, la; long id = -1; String addr; if (editTextid.getText().length() > 0) { id = Long.valueOf(editTextid.getText().toString()); } // 检查数据有效性 lo = Double.valueOf(editTextlo.getText().toString()); la = Double.valueOf(editTextla.getText().toString()); addr = editTextaddr.getText().toString(); if (saveOrModifyGPSInfo(id, lo, la, addr) >= 0) { mView.setVisibility(View.INVISIBLE); Toast.makeText(mContext, "保存数据成功!!", Toast.LENGTH_SHORT) .show(); } else { Toast.makeText(mContext, "保存数据失败", Toast.LENGTH_SHORT) .show(); } // 刷新数据 getData(); mSimpleAdapter.notifyDataSetChanged(); } }); } private long saveOrModifyGPSInfo(long id, double lo, double la, String addr) { long rowId = -1; ContentValues cv = new ContentValues(); cv.put("lo", lo); cv.put("la", la); cv.put("addr", addr); if (getCount(id) > 0) { db.update(TAB_GPSINFO, cv, "_id=?", new String[] { id + "" }); rowId = id; } else { rowId = db.insert(TAB_GPSINFO, null, cv); } return rowId; } /** * 删除 */ private int delGPSInfo(long _id) { if (_id >= 0) { return db.delete(TAB_GPSINFO, "_id =?", new String[] { String.valueOf(_id) }); } else { return -1; } } private long getCount(long id) { Cursor cr = db.query(TAB_GPSINFO, new String[] { "count(*) as count" }, "_id=?", new String[] { id + "" }, null, null, "_id"); cr.moveToFirst(); return cr.getLong(cr.getColumnIndex("count")); } // @Override // protected void onDestroy() { // if (db != null) // db.close(); // super.onDestroy(); // }; private void titleInit() { btnLocal = (Button) findViewById(R.id.btnLocal); btnList = (Button) findViewById(R.id.btnList); btnAbout = (Button) findViewById(R.id.btnAbout); // 设置监听事件 btnLocal.setOnClickListener(YUtils.gotoOtherActivity(mContext)); btnList.setOnClickListener(YUtils.gotoOtherActivity(mContext)); btnAbout.setOnClickListener(YUtils.gotoOtherActivity(mContext)); } private void startGPS() { // TODO Auto-generated method stub myListener = new MyLocationListener(); mLocationClient = new LocationClient(getApplicationContext()); // 声明LocationClient类 mLocationClient.registerLocationListener(myListener); // 注册监听函数 LocationClientOption option = new LocationClientOption(); option.setOpenGps(true); // 打开GPS option.setCoorType("bd09ll");// 返回的定位结果是百度经纬度,默认值gcj02 option.setScanSpan(800);// 设置发起定位请求的间隔时间,大于1000,连续定位,小于1000,定位一次 option.setIsNeedAddress(true); // 包含地址信息 mLocationClient.setLocOption(option); mLocationClient.start(); } private List<Map<String, Object>> getData() { data.clear(); Cursor cr = db.query(TAB_GPSINFO, new String[] { "_id", "lo", "la", "addr" }, "status=?", new String[] { "1" }, null, null, "_id"); while (cr.moveToNext()) { Map<String, Object> map = new HashMap<String, Object>(); map.put("_id", cr.getLong(cr.getColumnIndex("_id"))); map.put("lo", cr.getDouble(cr.getColumnIndex("lo"))); map.put("la", cr.getDouble(cr.getColumnIndex("la"))); map.put("addr", cr.getString(cr.getColumnIndex("addr"))); data.add(map); } cr.close(); return data; } /** * 实现实位回调监听 */ public class MyLocationListener implements BDLocationListener { @Override public void onReceiveLocation(BDLocation location) { double lo = -1; double la = -1; String addr = ""; // Receive Location // StringBuffer sb = new StringBuffer(256); // sb.append("time : "); // sb.append(location.getTime()); // sb.append("\nerror code : "); // sb.append(location.getLocType()); // sb.append("\nlatitude : "); la = location.getLatitude(); // sb.append(location.getLatitude()); // sb.append("\nlontitude : "); lo = location.getLongitude(); // sb.append(location.getLongitude()); // sb.append("\nradius : "); // sb.append(location.getRadius()); if (location.getLocType() == BDLocation.TypeGpsLocation) { // sb.append("\nspeed : "); // sb.append(location.getSpeed()); // sb.append("\nsatellite : "); // sb.append(location.getSatelliteNumber()); // sb.append("\ndirection : "); // sb.append("\naddr : "); addr = location.getAddrStr(); // sb.append(location.getAddrStr()); // Toast.makeText(mContext, location.getAddrStr(), // Toast.LENGTH_SHORT).show(); // sb.append(location.getDirection()); } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) { addr = location.getAddrStr(); // sb.append("\naddr : "); // sb.append(location.getAddrStr()); // //运营商信息 // sb.append("\noperationers : "); // sb.append(location.getOperators()); } logMsg(lo, la, addr); // Log.i("BaiduLocationApiDem", sb.toString()); } } /** * 显示请求字符串 * * @param str */ public void logMsg(double lo, double la, String addr) { /* * 将传入的值显示到界面上. */ if (editTextlo != null) editTextlo.setText(lo + ""); if (editTextla != null) editTextla.setText(la + ""); if (editTextaddr != null) editTextaddr.setText(addr + ""); Toast.makeText(mContext, "定位成功!", Toast.LENGTH_LONG).show(); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); // 刷新数据 getData(); mSimpleAdapter.notifyDataSetChanged(); } }
[ "vcvok@qq.com" ]
vcvok@qq.com
90ec2b2c8e8fcd2067e2467606638247943c694d
5ad49a5bf3bb61fb097cf94f3b4b5edc79569309
/Entrega3/servicio/DeployWebApplicaction/src/java/persistencia/UsuarioFacadeLocal.java
77dc3333a616f222527076c5f49b1a351f379555
[]
no_license
Canario0/DBCS
4e09a052b113bfd039ed3640eb619d96a9563e1d
7c217db79d8da58d4336825cd989c37a4ae95a29
refs/heads/master
2022-04-21T13:14:26.846073
2019-12-16T16:41:48
2019-12-16T16:41:48
215,232,183
1
0
null
null
null
null
UTF-8
Java
false
false
701
java
/* * 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 persistencia; import dominio.Usuario; import java.util.List; import javax.ejb.Local; /** * * @author ivan */ @Local public interface UsuarioFacadeLocal { void create(Usuario usuario); void edit(Usuario usuario); void remove(Usuario usuario); Usuario find(Object id); List<Usuario> findAll(); List<Usuario> findRange(int[] range); int count(); Usuario findByUsuarioAndClave(String nombre, String password); String findByUsuario(String nombre); }
[ "ivan.gonzalez.rincon" ]
ivan.gonzalez.rincon
8eccfe95f6d6407fa2737fff90f26723d1c68863
f5c194c932e3696ae6ecdc9fdef95ac783dd0dd6
/core/src/com/github/jotask/rosjam/game/entity/ControlEntity.java
e48f38286efa4e9f3f51a7450b7ea302dec2a303
[ "Apache-2.0" ]
permissive
jotask/Rosjam
8843d8f73c91ab10b95a9b7ae0593e8ad4f1920e
0286c60040fb14bb5afc4ecef613165857a88198
refs/heads/master
2021-01-19T05:34:30.496554
2017-05-07T16:54:13
2017-05-07T16:54:13
78,894,915
0
0
null
null
null
null
UTF-8
Java
false
false
1,639
java
package com.github.jotask.rosjam.game.entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.github.jotask.rosjam.engine.input.Controller; /** * ControlEntity * * @author Jose Vives Iznardo * @since 24/01/2017 */ public abstract class ControlEntity extends HealthEntity{ private final float SPEED = 7f; private final Controller controller; protected ControlEntity(Body body, final Controller controller, int health) { super(body, health); this.controller = controller; } @Override public void update() { final Vector2 dir = this.controller.getDirection(); float speed = SPEED; float acceleration = 10f; float desiredVelocityX = Math.max(body.getLinearVelocity().x - acceleration, Math.min(dir.x * speed, body.getLinearVelocity().x + acceleration) ); float desiredVelocityY = Math.max(body.getLinearVelocity().y - acceleration, Math.min(dir.y * speed, body.getLinearVelocity().y + acceleration) ); final Vector2 momentum = body.getLinearVelocity(); float velocityChangeX = desiredVelocityX - momentum.x; float velocityChangeY = desiredVelocityY - momentum.y; float impulseX = body.getMass() * velocityChangeX; float impulseY = body.getMass() * velocityChangeY; final Vector2 impulse = new Vector2(impulseX, impulseY); final Vector2 center = body.getWorldCenter(); body.applyLinearImpulse(impulse, center, true); } public Controller getController() { return controller; } }
[ "jota_sk@hotmail.com" ]
jota_sk@hotmail.com
f6a291492402aa692b32ee12d84920d5e2ede8dd
0802197676985c539f2620437b7abdca520bf00e
/src/main/java/org/helpdesk/webservice/implementation/MessageServiceImpl.java
58e76cbd1322770c23fe25563704090e749c970d
[]
no_license
zumitSingh/helpdesk
c1b9cd47ac3606b0198ae19424a8ac149720c9f3
b515c488847e3c8d077fa7b6de4841d5212f2efb
refs/heads/master
2020-11-29T15:23:29.875078
2017-05-22T21:15:05
2017-05-22T21:15:05
87,482,916
0
1
null
null
null
null
UTF-8
Java
false
false
2,799
java
package org.helpdesk.webservice.implementation; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import org.helpdesk.commons.exception.ServiceInvocationException; import org.helpdesk.webservice.extension.MessageService; import org.helpdesk.webservice.request.MessageRequest; import org.helpdesk.webservice.response.MessageViewAllResponse; import org.helpdesk.webservice.response.MessageViewResponse; import org.helpdesk.webservice.response.RestResponse; import org.helpdesk.webservice.support.MessageServiceHelper; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; @Component @Path("/MessageService") public class MessageServiceImpl implements MessageService { MessageServiceHelper helper=null; @Override @GET @Consumes({"application/xml", "application/json"}) @Produces({"application/json"}) @Path("/getMessage/{title}") public MessageViewResponse getMessage(@Context HttpHeaders headers, @PathParam("title")String title) throws ServiceInvocationException { MessageViewResponse response=new MessageViewResponse(); response=helper.getMessageById(title); return response; } @Override @GET @Consumes({"application/xml", "application/json"}) @Produces({"application/json"}) @Path("/getAllMessage/") public MessageViewAllResponse getAllMessage(@Context HttpHeaders headers) throws ServiceInvocationException { MessageViewAllResponse response=new MessageViewAllResponse(); response=helper.getAllMessage(); return response; } @Override @POST @Consumes({"application/xml", "application/json"}) @Produces({"application/json"}) @Path("/createMessage/") public RestResponse createMessage(@Context HttpHeaders headers, MessageRequest req) throws ServiceInvocationException { RestResponse response=new RestResponse(); response=helper.createMessage(req); response.setResponseStatus("SUCCESS"); return response; } @Override public void setBeanFactory(BeanFactory arg0) throws BeansException { // TODO Auto-generated method stub } @Override public void setApplicationContext(ApplicationContext arg0) throws BeansException { // TODO Auto-generated method stub } /** * @return the helper */ public MessageServiceHelper getHelper() { return helper; } /** * @param helper the helper to set */ public void setHelper(MessageServiceHelper helper) { this.helper = helper; } }
[ "anujsin@cisco.com" ]
anujsin@cisco.com
7f7b3e6b025561cccce656970c033af96f1d9b1d
f63789a3c5c2b5b4ad875c91fa9e471a00687093
/src/test/java/com/pph/demo/effective/sigleton/Elvis2.java
9629fb2a4247f76d84ed3ad15c95a9332e8e0381
[]
no_license
pph-zhiyi/app-server
c47ac8840dcfa73c236a5f017be54edc5529f72d
e8b3fb49fa244f21df78fc6310a21073f509c0ae
refs/heads/master
2022-12-21T15:14:14.421433
2020-07-27T11:46:02
2020-07-27T11:46:02
188,243,523
0
0
null
2022-12-14T20:43:15
2019-05-23T13:50:06
Java
UTF-8
Java
false
false
294
java
package com.pph.demo.effective.sigleton; /** * @Author: PPH * @date 2019-06-06 17:03 * @Description: */ public class Elvis2 { private static final Elvis2 INSTANCE = new Elvis2(); private Elvis2() { } public static Elvis2 getInstance() { return INSTANCE; } }
[ "1905225472@qq.com" ]
1905225472@qq.com
f5ad75a28ab639af386906993ed031612bcaad3a
b13b580304f6555545029445d8482d74777d00f7
/src/test/java/org/obus/test/AppConfig.java
4d590ddfecfb162fc65b254cfe9c34fff4132c7f
[]
no_license
obushakim/obus-spring-rest
675143320a2c0e8e1fa30b616b33bf921738e8c7
6c24ca07a5ac92dcb5e6c30afe33648936ffb04d
refs/heads/master
2020-03-21T18:52:24.009059
2018-07-03T18:38:36
2018-07-03T18:38:36
138,918,023
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package org.obus.test; import org.obus.test.obus_spring_ws_consumer.service.IKaryawanService; import org.obus.test.obus_spring_ws_consumer.service.KaryawanService; import org.obus.test.obus_spring_ws_consumer.ws_client.KaryawanClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AppConfig { @Bean public IKaryawanService karyawanService() { return new KaryawanService(); } @Bean public KaryawanClient karyawanClient() { return new KaryawanClient(); } }
[ "irfanhakimobuz@gmail.com" ]
irfanhakimobuz@gmail.com
a519d9ad59e95fd87a9818c94cd07263e9a66e59
8aca7672fae113bd02e0dad18b0e522fa00b0267
/src/main/java/com/challenge/longlife/resource/BigTreeResource.java
3a55da676c24409092b92de9b03d80455a938a2f
[]
no_license
AdrianChavezBerrocal/PDespliegue
9d8730a99606a43a15c38dbc79ed76a7cc75ef31
b6efb33fb9e63ea728e1a86df37526e3d925d32d
refs/heads/main
2023-06-05T16:30:40.622980
2021-06-28T04:44:08
2021-06-28T04:44:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,645
java
package com.challenge.longlife.resource; import com.challenge.longlife.domain.model.AuditModel; import java.util.Date; public class BigTreeResource{ private Long id; private String username; private String email; private String firstName; private String lastName; private String gender; private Date bornAt; public Long getId() { return id; } public BigTreeResource setId(Long id) { this.id = id; return this; } public String getUsername() { return username; } public BigTreeResource setUsername(String username) { this.username = username; return this; } public String getFirstName() { return firstName; } public String getEmail() { return email; } public BigTreeResource setEmail(String email) { this.email = email; return this; } public BigTreeResource setFirstName(String firstName) { this.firstName = firstName; return this; } public String getLastName() { return lastName; } public BigTreeResource setLastName(String lastName) { this.lastName = lastName; return this; } public String getGender() { return gender; } public BigTreeResource setGender(String gender) { this.gender = gender; return this; } public Date getBornAt() { return bornAt; } public BigTreeResource setBornAt(Date bornAt) { this.bornAt = bornAt; return this; } }
[ "noreply@github.com" ]
noreply@github.com
487107f65d3bf15a9a9be955c9389fd301f768ec
531a2a7304676f31871b39192d817db41329cd52
/CompositionEncapsulationPolymorphism/src/encapsulation/Printer.java
b74257862a34bb8de415948028360f658e11307a
[]
no_license
TamaraMichaud/java-masterclass-course-output
e88063bd5f20bd390f99739553627d7bee24dcb2
66bdff249a26c9343d12c8b99b6d67c4b60cc81d
refs/heads/master
2020-06-30T14:38:52.198402
2020-03-20T15:36:59
2020-03-20T15:36:59
200,859,297
0
0
null
null
null
null
UTF-8
Java
false
false
2,331
java
package encapsulation; public class Printer { private int tonerLevel; private int pagesPrinted; private boolean isDuplex; public Printer(int tonerLevel, boolean isDuplex) { this.tonerLevel = (tonerLevel < 0 || tonerLevel > 100) ? -1 : tonerLevel; this.pagesPrinted = 0; this.isDuplex = isDuplex; if(tonerLevel == -1) { throw new RuntimeException("WHAT ARE YOU DOING! Printer toner level must be between 0 and 100%... we recommend 100 to start with..."); } String duplexMsg = (isDuplex) ? "duplex" : ""; System.out.println("Welcome to your BRAND NEW " + duplexMsg + " printer!"); System.out.println(" ---------------------------- "); System.out.println("Toner Level: " + tonerLevel + "%"); System.out.println("Print History: " + pagesPrinted + " pages"); System.out.println(" ---------------------------- "); } public void fillToner() { if (tonerLevel >= 90) { System.out.println("Toner is full enough; use some before trying to top up further"); } else { System.out.println("Toner level is at " + this.tonerLevel + "%"); System.out.println("Need to add: " + (100 - this.tonerLevel) + "%"); this.tonerLevel = 100; System.out.println("Toner topped up...."); } } private boolean consumeToner(int pagesOfToner) { double tonerRequired = pagesOfToner * 0.3; if (tonerRequired > this.tonerLevel) { return false; } else { this.tonerLevel -= tonerRequired; return true; } } public void printPages(int numberPages) { if (!consumeToner(numberPages)) { System.out.println("Not enough toner available!"); fillToner(); } System.out.println(String.format("Printing %d pages...", numberPages)); if (isDuplex) { pagesPrinted += (numberPages / 2) + (numberPages % 2); } else { pagesPrinted += numberPages; } System.out.println("Print History Updated: " + pagesPrinted + " pages"); System.out.println("Toner level now at: " + tonerLevel + "%"); } }
[ "Tamara.Michaud@UKL-IA0GRSQ.Emailvision.com" ]
Tamara.Michaud@UKL-IA0GRSQ.Emailvision.com
648e25dc040613d2299e6864a41f347c2b93ef01
f046ed3d3bd1aa96d373ee6d87a3c2ec40746db3
/zlo_search/src/main/java/info/xonix/zlo/search/utils/obscene/NormalizeDirection.java
3320634a217ff811f39ca7572dbe2af93a0beee4
[]
no_license
xonixx/zlo-search
aeef797761e9b1dcb447ec78bb42ef9f7e4bce53
8c2c81cbdf538b228a0398e46691469a2c022776
refs/heads/master
2021-01-17T11:54:03.283164
2016-11-15T20:55:32
2016-11-15T20:55:32
33,077,498
2
4
null
null
null
null
UTF-8
Java
false
false
172
java
package info.xonix.zlo.search.utils.obscene; /** * User: gubarkov * Date: 02.04.12 * Time: 20:06 */ public enum NormalizeDirection { TO_RU, TO_EN }
[ "xonixx@gmail.com@cfdea282-7ff3-25da-2fc2-6cd4b62fd907" ]
xonixx@gmail.com@cfdea282-7ff3-25da-2fc2-6cd4b62fd907
b77ef75bab53e65bf015394f74fba89ab17230ff
ab0ea0ec4499ca5e25dd2fe7dd3a4dab590a5dc9
/JAVA/EE/MessageQueue/JMS/messaging-jms/src/main/java/com/feiyangedu/springcloud/messaging/MessagingApplication.java
25fcddc78d7e943162512449fd8331ca68b9c1fe
[]
no_license
chenwenbiao/Note
2d3978264554d0e1fd6c92a8043851f3ce080559
dc0c84341e6a9e217d9d757ab8e0d7926c06b08a
refs/heads/master
2021-05-23T10:19:16.351718
2020-01-15T23:14:24
2020-01-15T23:14:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,044
java
package com.feiyangedu.springcloud.messaging; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Session; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.jms.annotation.EnableJms; import org.springframework.jms.annotation.JmsListener; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.support.converter.MappingJackson2MessageConverter; import org.springframework.jms.support.converter.MessageConverter; import org.springframework.jms.support.converter.MessageType; import org.springframework.jms.support.destination.DestinationResolver; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * ActiveMQ是JMS规范的具体实现 */ @SpringBootApplication @RestController @EnableJms//开启Jms注解支持 public class MessagingApplication { final Log log = LogFactory.getLog(getClass()); final AtomicLong counter = new AtomicLong(0L); final static String QUEUE_NAME = "notify"; final static String TOPIC_NAME = "topicBroadcast"; @Autowired JmsTemplate jmsTemplate; public static void main(String[] args) throws Exception { SpringApplication.run(MessagingApplication.class, args); } /** * Serialize message content to JSON and using TextMessage */ @Bean public MessageConverter jacksonJmsMessageConverter() { MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter(); converter.setTargetType(MessageType.TEXT); converter.setTypeIdPropertyName("_type"); return converter; } /** * @JmsListener注解在方法上监听消息代理(Message broker)发布的消息 */ @JmsListener(destination = QUEUE_NAME)// 监听目的地的名字 public void processQueueMessage(Notify notify) { long n = counter.incrementAndGet(); log.info("\n[" + n + "] MESSAGE RECEIVED FROM QUEUE:\n" + notify); } @JmsListener(destination = TOPIC_NAME) public void processTopicMessage1(Notify notify) { long n = counter.incrementAndGet(); log.info("\n[" + n + "] topic processor 1:\n" + notify); } @JmsListener(destination = TOPIC_NAME) public void processTopicMessage2(Notify notify) { long n = counter.incrementAndGet(); log.info("\n[" + n + "] topic processor 2:\n" + notify); } @RequestMapping(value = "/send", method = RequestMethod.GET) public String sendMessage(@RequestParam(name = "message", defaultValue = "") String message) { if (message.isEmpty()) { message = UUID.randomUUID().toString(); } // 第一个参数是目的地的名字,上面的JmsListener会监听 jmsTemplate.convertAndSend(QUEUE_NAME, new Notify("System Admin", "Guest", message)); return "Message sent ok!"; } @RequestMapping(value = "/broadcast", method = RequestMethod.GET) public String broadcastMessage(@RequestParam(name = "message", defaultValue = "") String message) { if (message.isEmpty()) { message = UUID.randomUUID().toString(); } jmsTemplate.convertAndSend(TOPIC_NAME, new Notify("System Admin", "Guest", message)); return "Message broadcast ok!"; } @Bean public DestinationResolver namingDestinationResolver() { return new DestinationResolver() { @Override public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException { log.debug("resolve destination name: " + destinationName); if (destinationName.startsWith("topic")) { return session.createTopic(destinationName); } return session.createQueue(destinationName); } }; } }
[ "2233835996@qq.com" ]
2233835996@qq.com
4da7050b227cb2299d2c12ea30747d447c363325
901a7f2107fdec3199b5b40b091d06f0a51ed5ca
/MyPaperlessServer3.0/src/com/foxconn/server/constant/MyConstant.java
29ea080d350589e9fd8b3c5ebe85e2e64c8ce439
[]
no_license
wunianisme/MyPaperless
c52bf017923ff3f944bee1d0ff3a3cd5f34314fd
f06a8fb5cc74050f590a0bdf3a389abc065ed867
refs/heads/master
2020-05-03T19:41:11.472899
2019-04-01T05:04:25
2019-04-01T05:04:25
178,788,514
0
0
null
null
null
null
UTF-8
Java
false
false
176
java
package com.foxconn.server.constant; public final class MyConstant { //以TEST结尾的厂区认为是测试账号 public static String TEST_ACCOUNT="test,admin"; }
[ "1796608443@qq.com" ]
1796608443@qq.com
af9ab550ab75037c713ae5de691f71e6fb0667d5
b64b098b17aacadb336fe2f59bdb44ab4fcd383a
/workspace/ePNK CPN Type/src/org/cpntools/pragma/epnk/pnktypes/cpndefinition/util/CpndefinitionSwitch.java
cdb28771cbd23faa4d690dcb39b85d4836e28211
[]
no_license
kentis/Thesis
2b564789363503a37771b44d846211f9ea293fef
953b1c50a65d8d573480ff77396fe6d1d6bcbc07
refs/heads/master
2021-01-16T19:36:13.983914
2012-05-20T21:39:16
2012-05-20T21:39:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,710
java
/** * <copyright> * </copyright> * * $Id$ */ package org.cpntools.pragma.epnk.pnktypes.cpndefinition.util; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.*; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.Arc; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.ArcInscription; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.CPN; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.CpndefinitionPackage; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.Page; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.Place; import org.cpntools.pragma.epnk.pnktypes.cpndefinition.Transition; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; import org.pnml.tools.epnk.pnmlcoremodel.ID; import org.pnml.tools.epnk.pnmlcoremodel.Label; import org.pnml.tools.epnk.pnmlcoremodel.Node; import org.pnml.tools.epnk.pnmlcoremodel.PetriNetType; import org.pnml.tools.epnk.pnmlcoremodel.PlaceNode; import org.pnml.tools.epnk.pnmlcoremodel.TransitionNode; /** * <!-- begin-user-doc --> * The <b>Switch</b> for the model's inheritance hierarchy. * It supports the call {@link #doSwitch(EObject) doSwitch(object)} * to invoke the <code>caseXXX</code> method for each class of the model, * starting with the actual class of the object * and proceeding up the inheritance hierarchy * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> * @see org.cpntools.pragma.epnk.pnktypes.cpndefinition.CpndefinitionPackage * @generated */ public class CpndefinitionSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static CpndefinitionPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CpndefinitionSwitch() { if (modelPackage == null) { modelPackage = CpndefinitionPackage.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @parameter ePackage the package in question. * @return whether this is a switch for the given package. * @generated */ @Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; } /** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case CpndefinitionPackage.CPN: { CPN cpn = (CPN)theEObject; T result = caseCPN(cpn); if (result == null) result = casePetriNetType(cpn); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.PLACE: { Place place = (Place)theEObject; T result = casePlace(place); if (result == null) result = casePnmlcoremodel_Place(place); if (result == null) result = casePlaceNode(place); if (result == null) result = caseNode(place); if (result == null) result = caseObject(place); if (result == null) result = caseID(place); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.ARC: { Arc arc = (Arc)theEObject; T result = caseArc(arc); if (result == null) result = casePnmlcoremodel_Arc(arc); if (result == null) result = caseObject(arc); if (result == null) result = caseID(arc); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.TRANSITION: { Transition transition = (Transition)theEObject; T result = caseTransition(transition); if (result == null) result = casePnmlcoremodel_Transition(transition); if (result == null) result = caseTransitionNode(transition); if (result == null) result = caseNode(transition); if (result == null) result = caseObject(transition); if (result == null) result = caseID(transition); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.PAGE: { Page page = (Page)theEObject; T result = casePage(page); if (result == null) result = casePnmlcoremodel_Page(page); if (result == null) result = caseNode(page); if (result == null) result = caseObject(page); if (result == null) result = caseID(page); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.ARC_EXPRESSION: { ArcExpression arcExpression = (ArcExpression)theEObject; T result = caseArcExpression(arcExpression); if (result == null) result = caseCPNInscription(arcExpression); if (result == null) result = caseLabel(arcExpression); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.CPN_INSCRIPTION: { CPNInscription cpnInscription = (CPNInscription)theEObject; T result = caseCPNInscription(cpnInscription); if (result == null) result = caseLabel(cpnInscription); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.GUARD: { Guard guard = (Guard)theEObject; T result = caseGuard(guard); if (result == null) result = caseCPNInscription(guard); if (result == null) result = caseLabel(guard); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.INITIAL_MARKING: { InitialMarking initialMarking = (InitialMarking)theEObject; T result = caseInitialMarking(initialMarking); if (result == null) result = caseCPNInscription(initialMarking); if (result == null) result = caseLabel(initialMarking); if (result == null) result = defaultCase(theEObject); return result; } case CpndefinitionPackage.SORT: { Sort sort = (Sort)theEObject; T result = caseSort(sort); if (result == null) result = caseCPNInscription(sort); if (result == null) result = caseLabel(sort); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>CPN</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>CPN</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCPN(CPN object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Place</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Place</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePlace(Place object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Arc</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Arc</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseArc(Arc object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Transition</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Transition</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseTransition(Transition object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Page</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Page</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePage(Page object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Arc Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Arc Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseArcExpression(ArcExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>CPN Inscription</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>CPN Inscription</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCPNInscription(CPNInscription object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Guard</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Guard</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseGuard(Guard object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Initial Marking</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Initial Marking</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseInitialMarking(InitialMarking object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Sort</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Sort</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSort(Sort object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Petri Net Type</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Petri Net Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePetriNetType(PetriNetType object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>ID</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>ID</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseID(ID object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Object</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Object</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseObject(org.pnml.tools.epnk.pnmlcoremodel.Object object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Node</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Node</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNode(Node object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Place Node</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Place Node</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePlaceNode(PlaceNode object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Place</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Place</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePnmlcoremodel_Place(org.pnml.tools.epnk.pnmlcoremodel.Place object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Arc</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Arc</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePnmlcoremodel_Arc(org.pnml.tools.epnk.pnmlcoremodel.Arc object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Transition Node</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Transition Node</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseTransitionNode(TransitionNode object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Transition</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Transition</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePnmlcoremodel_Transition(org.pnml.tools.epnk.pnmlcoremodel.Transition object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Page</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Page</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePnmlcoremodel_Page(org.pnml.tools.epnk.pnmlcoremodel.Page object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Label</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Label</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseLabel(Label object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } } //CpndefinitionSwitch
[ "stylpe@gmail.com" ]
stylpe@gmail.com
d1cc713848cb6676aadacee57104724a915719a2
7d8734fee6d1cf032e7c5bf0c77ead333f0a2cb7
/app/src/main/java/com/bolo1/tweet_app/view/MyToolbar.java
366f5d2ec833bc5fadd330989579b0d57c0bf523
[ "Apache-2.0" ]
permissive
Dbolo1/Tweet
aead8e0e713f5310c45d1b6eb595cdb4da7bcd0f
a5b35af5f2ef48e78634f520c93e49b4099cd1f2
refs/heads/master
2020-04-03T17:08:57.339409
2018-10-30T18:35:44
2018-10-30T18:35:44
155,433,378
0
0
null
null
null
null
UTF-8
Java
false
false
1,179
java
package com.bolo1.tweet_app.view; import android.app.Activity; import android.content.Context; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.util.AttributeSet; /** * Created by 菠萝 on 2018/5/3. */ public abstract class MyToolbar extends Toolbar { private Context context; public MyToolbar(Context context) { this(context,null); } private void init(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { this.context=context; setToolbarTitle(context); } private void setToolbarTitle(Context context) { if(setCustomTitle()==null&&setCustomTitle().equals("")){ this.setTitle("Tweet"); }else{ this.setTitle(setCustomTitle()); } // this.setMenu(); } public MyToolbar(Context context, @Nullable AttributeSet attrs) { this(context, attrs,0); } public MyToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs, defStyleAttr); } public abstract String setCustomTitle(); }
[ "879160616@qq.com" ]
879160616@qq.com
07f19abb29090accfede5a761230980070c4b032
c0cd819132464909cb0d16d118e239b0748cd515
/android/app/src/main/java/com/texcrop/MainActivity.java
8107bc13de1bda2abfc6a50140069ba53b03cddc
[]
no_license
shannon-c/tex-crop-app
aca939fc51e18dbe5fbb7a28f852ed3ef6cd5210
fd4f33e1286156fc47207fcb4db3199bc40e2d45
refs/heads/master
2023-07-09T16:12:02.679313
2021-08-01T01:03:07
2021-08-01T01:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.texcrop; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "TexCrop"; } }
[ "louis.ong.bh@gmail.com" ]
louis.ong.bh@gmail.com
d9a5058c99772b0ae902988409c1321cf0e6a28c
3241e5334ffb82d868a95f1bb38ce950bbd60f0e
/SZUAssistentWorkspace/SZUAssistent/src/org/wechatapps/action/WechatHandler.java
af22e2835c8bab12dd8ce7e3fd780a19f111eb7d
[]
no_license
SZUAssistent/SZUAssistent
9d4778e91005097ed993cba4f31726febc557a3d
5d41243a260e6b4c810cf31b81a454399a5ac496
refs/heads/master
2016-08-04T09:37:51.557360
2014-05-03T04:54:30
2014-05-03T04:54:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,198
java
package org.wechatapps.action; import com.opensymphony.xwork2.ActionSupport; import org.wechatapps.bean.WechatProcessor; import org.wechatapps.po.Message; import org.wechatapps.utils.SHA1; import org.wechatapps.utils.WechatUtils; import org.apache.commons.lang.StringUtils; import org.apache.struts2.ServletActionContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; /* * @Description Interact with Wechat Open Platform * @author Charles Chen * @date 14-2-17 * @version 1.0 */ public class WechatHandler extends ActionSupport { /* Start: Verification parameters */ private String signature; private String timestamp; private String nonce; // Random number private String echostr; private final String TOKEN = "charleschaochen"; /* End: Verification parameters */ private WechatProcessor wechatProcessor; // Wechat processor public void setWechatProcessor(WechatProcessor wechatProcessor) { this.wechatProcessor = wechatProcessor; } /** * Default execute * * @return */ public String execute() throws IOException { HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); Message message; try { message = WechatUtils.retrieveMessage(request); // Read message and build message object if (message == null) { out.write("Can not parse message"); return null; } String output = wechatProcessor.process(message); // Process message if (output != null) out.write(output); // Output the processed result } catch (Exception e) { e.printStackTrace(); } return null; } /** * Verify messages from Wechat */ private void verify(PrintWriter out) throws IOException { String[] params = new String[]{ TOKEN, timestamp, nonce }; Arrays.sort(params); // Dictionary sort String encrypted = new SHA1().getDigestOfString((params[0] + params[1] + params[2]).getBytes()).toLowerCase(); // Encrypt with SHA1 if (StringUtils.equals(signature, encrypted)) { out.print(echostr); } } public String getSignature() { return signature; } public void setSignature(String signature) { this.signature = signature; } public String getTimestamp() { return timestamp; } public void setTimestamp(String timestamp) { this.timestamp = timestamp; } public String getNonce() { return nonce; } public void setNonce(String nonce) { this.nonce = nonce; } public String getEchostr() { return echostr; } public void setEchostr(String echostr) { this.echostr = echostr; } public String getTOKEN() { return TOKEN; } }
[ "399931011@qq.com" ]
399931011@qq.com
6064f517c70aa6c13680f37a2fce68767425c7b1
a4dab59f78b1e4144190e471468524bcb16bd87e
/src/main/java/net/ravendb/client/documents/operations/timeSeries/ConfigureTimeSeriesOperation.java
9c32d7fe15ef2ad60b4176f902a3d7e995457012
[ "MIT" ]
permissive
ravendb/ravendb-jvm-client
eeeacb6c30de43703181d05d8a05624016f7a55e
a515a192b28a9d682d7772c36b76d5a01a2f3115
refs/heads/v5.4
2023-08-25T14:40:57.799715
2023-08-03T13:01:50
2023-08-03T13:01:50
8,926,444
13
11
MIT
2023-08-03T13:01:51
2013-03-21T10:31:56
Java
UTF-8
Java
false
false
3,055
java
package net.ravendb.client.documents.operations.timeSeries; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.node.ObjectNode; import net.ravendb.client.documents.conventions.DocumentConventions; import net.ravendb.client.documents.operations.IMaintenanceOperation; import net.ravendb.client.http.IRaftCommand; import net.ravendb.client.http.RavenCommand; import net.ravendb.client.http.ServerNode; import net.ravendb.client.json.ContentProviderHttpEntity; import net.ravendb.client.primitives.Reference; import net.ravendb.client.util.RaftIdGenerator; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.ContentType; import java.io.IOException; public class ConfigureTimeSeriesOperation implements IMaintenanceOperation<ConfigureTimeSeriesOperationResult> { private final TimeSeriesConfiguration _configuration; public ConfigureTimeSeriesOperation(TimeSeriesConfiguration configuration) { if (configuration == null) { throw new IllegalArgumentException("Configuration cannot be null"); } _configuration = configuration; } @Override public RavenCommand<ConfigureTimeSeriesOperationResult> getCommand(DocumentConventions conventions) { return new ConfigureTimeSeriesCommand(_configuration); } private static class ConfigureTimeSeriesCommand extends RavenCommand<ConfigureTimeSeriesOperationResult> implements IRaftCommand { private final TimeSeriesConfiguration _configuration; public ConfigureTimeSeriesCommand(TimeSeriesConfiguration configuration) { super(ConfigureTimeSeriesOperationResult.class); _configuration = configuration; } @Override public boolean isReadRequest() { return false; } @Override public HttpRequestBase createRequest(ServerNode node, Reference<String> url) { url.value = node.getUrl() + "/databases/" + node.getDatabase() + "/admin/timeseries/config"; HttpPost request = new HttpPost(); request.setEntity(new ContentProviderHttpEntity(outputStream -> { try (JsonGenerator generator = createSafeJsonGenerator(outputStream)) { ObjectNode config = mapper.valueToTree(_configuration); generator.writeTree(config); } catch (IOException e) { throw new RuntimeException(e); } }, ContentType.APPLICATION_JSON)); return request; } @Override public void setResponse(String response, boolean fromCache) throws IOException { if (response == null) { throwInvalidResponse(); } result = mapper.readValue(response, ConfigureTimeSeriesOperationResult.class); } @Override public String getRaftUniqueRequestId() { return RaftIdGenerator.newId(); } } }
[ "marcin@ravendb.net" ]
marcin@ravendb.net
e40b02b99e41642d5a310ac326957f15a590d249
4cc11516cbeb324a16a5fbfcdc9a9477d1b7912f
/src/main/java/br/com/zupacademy/rafael/casadocodigo/validation/VerificaCPFouCNPJ.java
348c012e74d65e55ad37bb6dfc6c232034d934d8
[ "Apache-2.0" ]
permissive
rafaellbs/orange-talents-05-template-casa-do-codigo
59b9b8af5bc354db23fd2e51657020022600ab81
20110ee00dbf5124371ddca0fda9a13211be155e
refs/heads/main
2023-06-21T13:40:36.788336
2021-06-29T02:52:16
2021-06-29T02:52:16
368,623,001
0
0
Apache-2.0
2021-05-18T18:00:04
2021-05-18T18:00:03
null
UTF-8
Java
false
false
927
java
package br.com.zupacademy.rafael.casadocodigo.validation; import org.hibernate.validator.constraints.CompositionType; import org.hibernate.validator.constraints.ConstraintComposition; import org.hibernate.validator.constraints.br.CNPJ; import org.hibernate.validator.constraints.br.CPF; import javax.validation.Constraint; import javax.validation.Payload; import javax.validation.ReportAsSingleViolation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @CPF @CNPJ@ConstraintComposition(CompositionType.OR) @ReportAsSingleViolation @Target(ElementType.FIELD) @Constraint(validatedBy = {}) @Retention(RetentionPolicy.RUNTIME) public @interface VerificaCPFouCNPJ { String message () default "CPF ou CNPJ incorreto"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; }
[ "rafael_lbs@hotmail.com" ]
rafael_lbs@hotmail.com
b952c1c9736aa44dcadc97c4f7c8e93d6283d438
2a4935df62ecd510eb07c97a7c69c8457648cf00
/Array/090. Subsets II/Question090.java
93ca1c1f28022b9aa510960689b2c12b079dce46
[]
no_license
crazydave1004/leetcode
c8ce057bfea4bc24b3a62b546d178ea3a21b9aa1
57d1baf936bf085ba8326cf9b407bbf1a69e31a6
refs/heads/master
2021-01-21T14:09:10.991431
2016-06-29T02:54:06
2016-06-29T02:54:06
56,902,052
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
public class Solution { public List<List<Integer>> subsetsWithDup(int[] nums) { List<List<Integer>> res = new ArrayList<List<Integer>>(); List<Integer> list = new ArrayList<Integer>(); res.add(list); if (nums == null || nums.length == 0) return res; Arrays.sort(nums); helper(res, list, 0, nums); return res; } private void helper(List<List<Integer>> res, List<Integer> list, int start, int[] nums) { for (int i = start; i < nums.length; i++) { if (i != start && nums[i] == nums[i - 1]) continue; list.add(nums[i]); res.add(new ArrayList<Integer>(list)); helper(res, new ArrayList<Integer>(list), i + 1, nums); list.remove(list.size() - 1); } } }
[ "david@Xiaotians-MacBook-Pro.local" ]
david@Xiaotians-MacBook-Pro.local
7dbae0353ac888e1e81d39cb0f5143fd053f209a
37b83e2f2fbbd947f315c416d7243c6a2aa79906
/src/main/java/ludum/dare/levelobject/PowerupLevelObject.java
7621a8ceb44060a2ae8e67b16504a2627eec2cc9
[]
no_license
bitDecayGames/LudumDare34
0a6bcf242cf08db46eb88c6e57ba20749dc91241
0845eb52bf0abd431ebfa6673d6abf8fe39dfbde
refs/heads/master
2021-01-10T14:13:58.317026
2015-12-19T22:48:53
2015-12-19T22:48:53
45,752,426
0
0
null
2015-12-26T00:01:20
2015-11-07T20:04:26
Java
UTF-8
Java
false
false
1,275
java
package ludum.dare.levelobject; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.bitdecay.jump.BitBody; import com.bitdecay.jump.BodyType; import com.bitdecay.jump.gdx.level.RenderableLevelObject; import com.bitdecay.jump.geom.BitRectangle; import com.bytebreakstudios.animagic.texture.AnimagicTextureAtlas; import ludum.dare.RacerGame; /** * Created by Admin on 12/13/2015. */ public class PowerupLevelObject extends RenderableLevelObject { private TextureRegion texture; public PowerupLevelObject() { AnimagicTextureAtlas atlas = RacerGame.assetManager.get("packed/level.atlas", AnimagicTextureAtlas.class); this.texture = atlas.findRegion("collect/chest/closed/1"); rect = new BitRectangle(0, 0, 28, 18); } @Override public TextureRegion texture() { return texture; } @Override public BitBody buildBody() { BitBody body = new BitBody(); body.props.gravitational = false; body.props.collides = false; body.bodyType = BodyType.STATIC; body.aabb.set(new BitRectangle(rect)); return body; } @Override public String name() { return "Powerup"; } }
[ "monday.hopscotch@gmail.com" ]
monday.hopscotch@gmail.com
b635060dc89da38efd90c428a7513d6a022c7513
13f2548cdeeceac8e18d2c61485b0319783904eb
/MailServer/src/main/java/pers/afei/utils/Database.java
409f937f66fe0efa82cd45e920ea5b1df4ef20ab
[]
no_license
AFeiDa/email-system
6af9b676c7c560c888128db2c7680666cc3bbb6c
46d2f12c096636a1cf04de4f285f5676785257c8
refs/heads/master
2022-07-08T14:41:53.813531
2019-06-01T02:41:05
2019-06-01T02:41:05
177,891,171
3
0
null
2022-06-21T01:02:24
2019-03-27T00:45:59
Java
UTF-8
Java
false
false
5,033
java
package pers.afei.utils; import java.sql.*; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; public class Database { private static final String DRIVER = "com.mysql.cj.jdbc.Driver"; private Connection conn; private PreparedStatement stmt = null; private boolean isLinked = false; public Database() { try { Class.forName(DRIVER); } catch (ClassNotFoundException e) { System.err.println("Class not found"); } try { conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mailsystem?&serverTimezone=GMT", "root", ""); isLinked = true; } catch (SQLException se) { System.err.println("Link SQL Failed"); } } public Database(String url, String user, String pwd) { try { Class.forName(DRIVER); } catch (ClassNotFoundException e) { System.err.println("Class not found"); } try { conn = DriverManager.getConnection(url, user, pwd); isLinked = true; } catch (SQLException se) { System.err.println("Link SQL Failed"); } } public void openLink(String url, String user, String pwd) { try { conn = DriverManager.getConnection(url, user, pwd); isLinked = true; } catch (SQLException se) { System.err.println("Open SQL Link Failed"); } } public void closeLink() { try { if (stmt != null) stmt.close(); } catch (SQLException se) { System.err.println("Close Statement Failed"); } try { if (conn != null) conn.close(); isLinked = false; } catch (SQLException se) { System.err.println("Close SQL Failed"); } } public boolean isOpen() { return isLinked; } public int executeUpdate(String sql, String... values){ try { stmt = conn.prepareStatement(sql); int i = 1; for(String str: values) { stmt.setString(i ++, str); } } catch (SQLException e) { e.printStackTrace(); } int ret = -1; try { ret = stmt.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } return ret; } public boolean execute(String sql, String... values) { try { stmt = conn.prepareStatement(sql); int i = 1; for(String str: values) { stmt.setString(i ++, str); } } catch (SQLException e) { e.printStackTrace(); } boolean ret = false; try { ret = stmt.execute(); } catch (SQLException e) { e.printStackTrace(); } return ret; } public ResultSet executeQuery(String sql, String... values) { try { stmt = conn.prepareStatement(sql); int i = 1; for(String str: values) { stmt.setString(i ++, str); } } catch (SQLException e) { e.printStackTrace(); } ResultSet ret = null; try { ret = stmt.executeQuery(); } catch (SQLException e) { e.printStackTrace(); } return ret; } public static int resultCount(ResultSet rs) { int cnt = 0; try { while (rs.next()) { ++cnt; } rs.beforeFirst(); } catch (SQLException e) { e.printStackTrace(); } return cnt; } public static String utilDateToSqlDate(java.util.Date d) { return new Timestamp(d.getTime()).toString(); } public static java.util.Date sqlDateToUtilDate(String d) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date date = null; try { date = format.parse(d); } catch (ParseException e) { e.printStackTrace(); } return date; } public static void main(String[] args) { Database db = new Database(); ResultSet rs = db.executeQuery("SELECT mail_date FROM MAIL where 1 = ?;", "1"); try { System.out.println(resultCount(rs)); System.out.println(resultCount(rs)); while (rs.next()) { String d = rs.getString(1); System.out.println(d); java.util.Date date = Database.sqlDateToUtilDate(d); System.out.println(date.toString()); System.out.println(Database.utilDateToSqlDate(date)); } } catch (SQLException e) { e.printStackTrace(); } } }
[ "super_afei@qq.com" ]
super_afei@qq.com
7b77b6f26426328ef0c0e8d74300a2f829ba41c8
38e632e2780bcd5fb9f80e77213534cb3dbfc776
/src/main/java/com/github/jonathanxd/sptn/function/checked/CheckedFunction22.java
92b66c7311581bb3d77d4c457455df4c80e7eccd
[ "MIT" ]
permissive
JonathanxD/sptn
bc3d749ab2b2429bfa451c21ec44ebd269f28d74
d28aa63a955c93f5176e9beff6a9141481158b94
refs/heads/master
2023-04-21T03:29:16.554805
2021-05-10T04:52:17
2021-05-10T04:52:17
365,921,651
0
0
null
null
null
null
UTF-8
Java
false
false
1,974
java
/** * sptn - Provides utility for multiple data in single container, such as Pair and Triple. * * The MIT License (MIT) * * Copyright (c) 2021 JonathanxD <https://github.com/JonathanxD/sptn> * Copyright (c) contributors * * * 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 com.github.jonathanxd.sptn.function.checked; /** * Interface generated by <a href="https://github.com/JonathanxD/sptn">sptn</a> */ @FunctionalInterface public interface CheckedFunction22<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,R> { public R apply(T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11, T12 data12, T13 data13, T14 data14, T15 data15, T16 data16, T17 data17, T18 data18, T19 data19, T20 data20, T21 data21, T22 data22) throws Throwable; }
[ "joniweb01@gmail.com" ]
joniweb01@gmail.com
5ce96244bd9317e65d1012dfb79fc5c8e1075510
66b27efc888122ba593e4f268a160695a528a47a
/src/test/java/com/example/reqru2/controller/StripeInvoicesControllerTest.java
8155cf4803ca66a62319245fd0461ce7c4e1ec86
[]
no_license
tek93/taski0203
41d8dcd2bf714b02bf9217a06c034ed888477e87
85ffb1e352f48e6d56b98b6449c7baa976c2acfe
refs/heads/main
2023-08-16T05:16:24.530018
2021-09-19T20:47:35
2021-09-19T20:47:35
404,500,115
0
0
null
null
null
null
UTF-8
Java
false
false
3,957
java
package com.example.reqru2.controller; import com.example.reqru2.service.StripleService; import com.fasterxml.jackson.databind.ObjectMapper; import com.stripe.Stripe; import com.stripe.exception.StripeException; import com.stripe.model.*; import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.web.context.WebApplicationContext; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; @SpringBootTest @RunWith(SpringRunner.class) @WithMockUser(username = "test", password = "tom") @AutoConfigureMockMvc public class StripeInvoicesControllerTest { private MockMvc mockMvc; private static final String CREATE_ACCOUNT = "/create_device.sql"; @Autowired private JdbcTemplate jdbc; @Value("${stripe.apikey}") String stripKey; @Autowired WebApplicationContext context; ObjectMapper objectMapper = new ObjectMapper(); @Autowired StripleService stripleService; // @BeforeClass // public void setUpp() throws SQLException { // ScriptUtils.executeSqlScript(jdbc.getDataSource().getConnection(), new ClassPathResource(CREATE_ACCOUNT)); // // } @Before public void setUp() throws StripeException { given_new_invoice(); } @org.junit.Test(expected = NullPointerException.class) public void given_invoice_then_check_Qty() throws Exception { MvcResult result = mockMvc.perform(get("/api/invo/getInvoice")) .andDo(print()).andReturn(); } //przy obecnej implementacji testowanie jednostkowe metod z serwisu wydaje mi się nie wykonalne //z powodu pow=bierania danych urzytkownika z contextu springa public void given_new_invoice() throws StripeException { String productName = "kaszanka"; Integer qty = 1; Integer ua = 10; Stripe.apiKey = stripKey; Map<String, Object> params3 = new HashMap<>(); params3.put("name", productName); params3.put("active", true); Product product = Product.create(params3); Map<String, Object> params1 = new HashMap<>(); params1.put("customer", "cus_KDOoE0kXmiWjY0"); params1.put("quantity", qty); params1.put("unit_amount", ua); params1.put("currency", "pln"); params1.put("description", productName); InvoiceItem invoiceItem = InvoiceItem.create(params1); InvoiceLineItemCollection invoiceLineItemCollection = new InvoiceLineItemCollection(); invoiceLineItemCollection.setObject(invoiceItem.getObject()); Invoice invoice = new Invoice(); invoice.setCustomer("cus_KDOoE0kXmiWjY0"); Map<String, Object> params2 = new HashMap<>(); params2.put("customer", "cus_KDOoE0kXmiWjY0"); Invoice.create(params2); } @org.junit.Test public void give_customerId_then_have_him_invoices() throws StripeException { Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_KDOoE0kXmiWjY0"); InvoiceCollection invoices = Invoice.list(params); String json1 = invoices.toJson(); assertThat(json1.contains("cus_KDOoE0kXmiWjY0")); } }
[ "=" ]
=
c07a900bfd2d8b0ad92e8172bb7074bf907dc5bf
d9909da104465bd4c9e0df772600acc8a64e5658
/springboot-logs/src/main/java/com/lxg/controller/LogsController.java
ecf11f72c4fc4345d3f7a1ea0dc19f9c9865b076
[]
no_license
lixianguo5097/springboot
05126e536eedcdb88256d3a23d79cf1d04b0b24b
625890b5793470d569c56c5f4fb74b7eed7ebe16
refs/heads/master
2023-06-24T18:29:15.939222
2023-02-20T06:06:49
2023-02-20T06:06:49
218,676,516
37
55
null
2023-06-14T22:42:58
2019-10-31T03:24:42
Java
UTF-8
Java
false
false
755
java
package com.lxg.controller; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author LXG * @date 2019-12-10 */ @RestController @Slf4j public class LogsController { @Value("${lxg.msg}") private String msg; @RequestMapping("/log") public void getLog() { try { log.error("错误日志输出"); log.info("信息日志输出"); int i = 10 / 0; } catch (Exception e) { log.error("Exception", e); } } @RequestMapping("/msg") public String getMsg() { return msg; } }
[ "ied_lxg@gdhqx.com" ]
ied_lxg@gdhqx.com
faa563dd5dcd8d4733f8b2313f8df77f79bae0c3
41aaa78675edd4eb1df8bb7035f9afa1557e6d2c
/library/src/main/java/com/compressimage/utils/CachePathUtils.java
a8cf6a93640f409460f75c34847fd963de131a97
[]
no_license
yan-lixin/CompressImage
3281d96cc44be807f44670660d2124a24bdbfe21
a1535ef69396f7c5f17d4d637863e4372092044f
refs/heads/master
2020-04-30T07:46:19.204684
2019-03-20T09:05:03
2019-03-20T09:05:03
176,694,732
0
0
null
null
null
null
UTF-8
Java
false
false
1,190
java
package com.compressimage.utils; import android.os.Environment; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class CachePathUtils { /** * 独立创建拍照路径 * * @param fileName 图片名 * @return 缓存文件夹路径 */ private static File getCameraCacheDir(String fileName) { File cache = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); if (!cache.mkdirs() && (!cache.exists() || !cache.isDirectory())) { return null; } else { return new File(cache, fileName); } } /** * 获取图片文件名 * * @return 图片文件名 */ private static String getBaseFileName() { return new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.ENGLISH).format(new Date()); } /** * 获取拍照缓存文件 * * @return 缓存文件 */ public static File getCameraCacheFile() { String fileName = "camera_" + getBaseFileName() + ".jpg"; return getCameraCacheDir(fileName); } }
[ "lx_1206@163.com" ]
lx_1206@163.com
15be92eafbb9ef5b6467b470213f8cdfe7a11e6b
e1fccc0e83aab7c0a93fe52394be85b7c07df3be
/nutz-plugins-nop/demo/nop-demo/src/main/java/org/nutz/nop/demo/module/PostModule.java
74ab291c0e9eb2961740ba172465d758a51c42b2
[ "Apache-2.0" ]
permissive
nutzam/nutzmore
458f26a74df68bc0ab8b71c11bf08e399652c851
9a0cf3634f3f61a2214ffd915e1bcbabf3ddc5d8
refs/heads/master
2023-08-25T10:22:05.197040
2023-03-21T03:46:27
2023-03-21T03:46:27
1,863,823
368
238
Apache-2.0
2022-12-16T10:32:03
2011-06-08T06:09:07
JavaScript
UTF-8
Java
false
false
1,034
java
package org.nutz.nop.demo.module; import java.util.Date; import org.nutz.lang.util.NutMap; import org.nutz.mvc.adaptor.JsonAdaptor; import org.nutz.mvc.annotation.AdaptBy; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.POST; import org.nutz.nop.demo.module.GetModule.N; import org.nutz.plugins.apidoc.annotation.Api; import org.nutz.plugins.apidoc.annotation.ApiMatchMode; @Api(author = "Kerbores", name = "post请求", match = ApiMatchMode.ALL) @At("post") public class PostModule { @At @POST public NutMap simple() { return NutMap.NEW(); } @At @POST public NutMap args(int i, String s, Date d) { return NutMap.NEW().addv("i", i).addv("s", s).addv("d", d); } @At @POST public NutMap array(int[] ids) { return NutMap.NEW().addv("ids", ids); } @At @POST public NutMap object(N n) { return NutMap.NEW().addv("n", n); } @At @POST @AdaptBy(type = JsonAdaptor.class) public NutMap body(N n) { return NutMap.NEW().addv("n", n); } }
[ "guiyuan.wang-N@msxf.com" ]
guiyuan.wang-N@msxf.com
5bc79df9d33cf67c71fb1323d4e160fca19fed12
af3782864747973e11cfb7e490e69ae8214428c1
/BBVA/src/main/java/com/pruebatecnica/consta/Constantes.java
bda1a9da8301a322d3d53be98c7b4a48fd0e1423
[]
no_license
codechallengebackendDSR/BBVA
eef2b3d1b4d0defe0567c6ff5c7b371c24a1cf4a
50696010d25d2838822fe5b14f9c9181329fb8fd
refs/heads/main
2023-03-11T12:33:02.159985
2021-03-02T20:51:55
2021-03-02T20:51:55
343,908,828
0
0
null
null
null
null
UTF-8
Java
false
false
428
java
package com.pruebatecnica.consta; public final class Constantes { // Errores public static final String ERROR_EXCEPTION = "Error devuelve una exception:"; public static final String ERROR_ESTATUS_REFERENCE_NOT_EXIT = "Referencia no existe"; public static final String ERROR_STATUS_REFERENCE_EMPLY = "La referencia no puede estar vacia"; // OK public static final String OK_TRANS_CREATE = "Operacion correcta"; }
[ "noreply@github.com" ]
noreply@github.com
b1f1f231518926a0257ba7b5a5b2bc50102b328b
e1cc549ddb69e21d1416cefdbd689b483b79a55d
/cloudsdk/src/main/java/org/kaazing/gateway/client/impl/bridge/XoaEvent.java
0ded86d7e401d4d54b5eccdd6b33a1950cb8211e
[ "Apache-2.0" ]
permissive
dlekdls01/particle-android
6976f9451fb8441fd13c6b73e6df8fd1661acfd4
31a7893aa318ec7afd9cdc576fce84a1dc0f054a
refs/heads/master
2020-05-03T10:46:44.274373
2019-03-05T00:45:39
2019-03-05T00:45:39
178,587,181
0
1
Apache-2.0
2019-03-30T17:00:36
2019-03-30T17:00:36
null
UTF-8
Java
false
false
4,071
java
/** * Copyright (c) 2007-2014 Kaazing Corporation. All rights reserved. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.kaazing.gateway.client.impl.bridge; import java.io.Serializable; import java.util.logging.Logger; public class XoaEvent implements Serializable { private static final String CLASS_NAME = XoaEvent.class.getName(); private static final Logger LOG = Logger.getLogger(CLASS_NAME); private static final long serialVersionUID = 1L; public static final String[] EMPTY_ARGS = new String[] {}; private Integer handlerId; private XoaEventKind kind; private Object[] params; public XoaEvent(Integer handlerId, XoaEventKind event, Object[] params) { //LOG.entering(CLASS_NAME, "<init>", new Object[] { handlerId, event, params }); this.handlerId = handlerId; this.kind = event; this.params = params; } public Integer getHandlerId() { LOG.exiting(CLASS_NAME, "getHandlerId", handlerId); return handlerId; } public XoaEventKind getKind() { LOG.exiting(CLASS_NAME, "getEvent", kind); return kind; } public Object[] getParams() { LOG.exiting(CLASS_NAME, "getParams", params); return params; } public String toString() { StringBuilder out = new StringBuilder("EventID:" + getHandlerId() + "," + getKind().name() + "["); for (Object param : params) { out.append(param).append(","); } return out + "]"; } public enum XoaEventKind { // Entries for WebSocket and ByteSocket events OPEN("open"), // handlerid MESSAGE("message"), // handlerid, message (string) CLOSED("closed"), // handlerid REDIRECT("redirect"), // handlerid, location(string) AUTHENTICATE("authenticate"), // handlerid, challenge(string) AUTHORIZE("authorize"), // handlerid, authorizeToken(string) // Entries for StreamingHttpRequest events LOAD("load"), // handlerid PROGRESS("progress"), // handlerid, ??? READYSTATECHANGE("readystatechange"), // handlerid, state ERROR("error"), // handlerid ABORT("abort"), // handlerid // Entries for WebSocket and ByteSocket methods CREATE("create"), // handlerid, type, wsurl, originurl POSTMESSAGE("postMessage"), // handlerid, message (string) DISCONNECT("disconnect"), // handlerid // OPEN("open"), // handlerid //*** Also an event name SEND("send"), // handlerid GETRESPONSEHEADER("getResponseHeader"), // handlerid, header GEALLRESPONSEHEADERS("getAllResponseHeaders"), // handlerid SETREQUESTHEADER("setRequestHeader"), // handlerid, header, value // ABORT("abort"), // handlerid // *** also an event name UNDEFINED(""); String name; XoaEventKind(String in) { name = in; } public static XoaEventKind getName(String in) { final XoaEventKind[] v = values(); for (XoaEventKind aV : v) { if (aV.name.equals(in)) { return aV; } } return UNDEFINED; } public String toString() { return name; } } }
[ "jens.knutson@gmail.com" ]
jens.knutson@gmail.com
69a9c9a2bca19c6df3adc6dfcac4b89f9e1417da
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/arms-20210519/src/main/java/com/aliyun/arms20210519/models/CreateAlertTemplateRequest.java
e2ec1ea1d207484159e1bae94340a91df472e465
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
3,010
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.arms20210519.models; import com.aliyun.tea.*; public class CreateAlertTemplateRequest extends TeaModel { @NameInMap("Name") public String name; @NameInMap("RegionId") public String regionId; @NameInMap("MatchExpressions") public String matchExpressions; @NameInMap("Type") public String type; @NameInMap("TemplateProvider") public String templateProvider; @NameInMap("Labels") public String labels; @NameInMap("Annotations") public String annotations; @NameInMap("Rule") public String rule; @NameInMap("Message") public String message; @NameInMap("ParentId") public String parentId; public static CreateAlertTemplateRequest build(java.util.Map<String, ?> map) throws Exception { CreateAlertTemplateRequest self = new CreateAlertTemplateRequest(); return TeaModel.build(map, self); } public CreateAlertTemplateRequest setName(String name) { this.name = name; return this; } public String getName() { return this.name; } public CreateAlertTemplateRequest setRegionId(String regionId) { this.regionId = regionId; return this; } public String getRegionId() { return this.regionId; } public CreateAlertTemplateRequest setMatchExpressions(String matchExpressions) { this.matchExpressions = matchExpressions; return this; } public String getMatchExpressions() { return this.matchExpressions; } public CreateAlertTemplateRequest setType(String type) { this.type = type; return this; } public String getType() { return this.type; } public CreateAlertTemplateRequest setTemplateProvider(String templateProvider) { this.templateProvider = templateProvider; return this; } public String getTemplateProvider() { return this.templateProvider; } public CreateAlertTemplateRequest setLabels(String labels) { this.labels = labels; return this; } public String getLabels() { return this.labels; } public CreateAlertTemplateRequest setAnnotations(String annotations) { this.annotations = annotations; return this; } public String getAnnotations() { return this.annotations; } public CreateAlertTemplateRequest setRule(String rule) { this.rule = rule; return this; } public String getRule() { return this.rule; } public CreateAlertTemplateRequest setMessage(String message) { this.message = message; return this; } public String getMessage() { return this.message; } public CreateAlertTemplateRequest setParentId(String parentId) { this.parentId = parentId; return this; } public String getParentId() { return this.parentId; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7c4931032839a495c3243c9dafde09e0163d0b3d
9fbc3a85cfa97264559304f3f859299d576e5fc6
/app/biz/service/src/main/java/com/xiaowei/sys/platform/gateway/res/standard/StandardCommonRes.java
d24f034baf045d0e41bd35ee53b5cc14ce3e0013
[]
no_license
kanshunfu123/dubboGateway
b9080e9d9ad3f62cd8c59b32c0deae998ec8298b
a2f905355e6030fc3d05a61039811dfa710e2206
refs/heads/master
2020-05-17T23:09:54.493561
2019-04-29T07:45:43
2019-04-29T07:45:43
184,023,162
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
package com.xiaowei.sys.platform.gateway.res.standard; import java.io.Serializable; /** * @author: qianjin * @CreateDate: 2018/6/8 13:41 */ public class StandardCommonRes implements Serializable { /** * 请求序列号 */ private String requestId; public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } }
[ "995234952@qq.com" ]
995234952@qq.com
a69f3868b228017cbf2f61b755c39b225b51a439
8f3b28cabf2c0552d1db7ce74ac6a786358fa19e
/src/codeForces/codeforces721/upC.java
9d519b2ff0fd0bffff5af71b45014853dcf94709
[]
no_license
karanS1314/FullJavaPractice
896b48bfa5a9b81c776641a852bab5031f7814aa
f6cce995969dd0d106cc5482e7fd4f7ecd1de3af
refs/heads/master
2023-07-01T06:51:19.353007
2021-08-08T18:10:47
2021-08-08T18:10:47
359,021,462
1
0
null
null
null
null
UTF-8
Java
false
false
10,244
java
package codeForces.codeforces721; // * * * the goal is to be worlds best * * * // import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class upC { static class Pair implements Comparable<Pair>{ int a; int b; Pair(int a , int b){ this.a = a; this.b = b; } public int compareTo(Pair o){ return this.a - o.a; } } static boolean isPalindrome(String str) { // Pointers pointing to the beginning // and the end of the string int i = 0, j = str.length() - 1; // While there are characters to compare while (i < j) { // If there is a mismatch if (str.charAt(i) != str.charAt(j)) return false; // Increment first pointer and // decrement the other i++; j--; } // Given string is a palindrome return true; } public static void main(String[] args) { FastScanner sc = new FastScanner(); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); String s = sc.nextLine(); boolean pal = isPalindrome(s); if(pal){ char ca[] = s.toCharArray(); long zeroes = 0; for(int i = 0; i < n; i++){ if(ca[i] == '0'){ zeroes++; } } if(zeroes == 0){ System.out.println("DRAW"); } else if(zeroes % 2 == 0 || zeroes == 1){ System.out.println("BOB"); } else{ System.out.println("ALICE"); } } else{ // in all the cases alice will win // only when there are two zereoes and // by chnging one zeroe u can make plaindrom will b a draw char ca[] = s.toCharArray(); long zeroes = 0; for(int i = 0; i < n; i++){ if(ca[i] == '0'){ zeroes++; } } if(zeroes != 2){ System.out.println("ALICE"); } else{ int min_cost = 0; for(int i = 0; i < n/2; i++){ if(ca[i] == '1'){ if(ca[n - i -1] == '0'){ min_cost++; } } else{ if(ca[n - i - 1] == '1'){ min_cost++; } } } if(min_cost == 1){ System.out.println("DRAW"); } else{ System.out.println("ALICE"); } } } } } // Use this instead of Arrays.sort() on an array of ints. Arrays.sort() is n^2 // worst case since it uses a version of quicksort. Although this would never // actually show up in the real world, in codeforces, people can hack, so // this is needed. static void ruffleSort(int[] a) { //ruffle int n=a.length; Random r=new Random(); for (int i=0; i<a.length; i++) { int oi=r.nextInt(n), temp=a[i]; a[i]=a[oi]; a[oi]=temp; } //then sort Arrays.sort(a); } // Use this to input code since it is faster than a Scanner static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } double nextDouble() { return Double.parseDouble(next()); } String str = ""; String nextLine() { try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } int[] readArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } long[] readLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } long nextLong() { return Long.parseLong(next()); } } // use this to find the index of any element in the array +1 /// // returns an array that corresponds to the index of the i+1th in the array a[] // runs only for array containing different values enclosed btw 0 to n-1 static int[] indexOf(int[] a) { int[] toRet=new int[a.length]; for (int i=0; i<a.length; i++) { toRet[a[i]]=i+1; } return toRet; } static int gcd(int a, int b) { if (b==0) return a; return gcd(b, a%b); } //generates all the prime numbers upto n static void sieveOfEratosthenes(int n , ArrayList<Integer> al) { boolean prime[] = new boolean[n + 1]; for (int i = 0; i <= n; i++) prime[i] = true; for (int p = 2; p * p <= n; p++) { if (prime[p] == true) { for (int i = p * p; i <= n; i += p) prime[i] = false; } } for (int i = 2; i <= n; i++) { if (prime[i] == true) al.get(i); } } static final int mod=100000000 + 7; static final int max_val = 2147483647; static final int min_val = max_val + 1; //fastPow static long fastPow(long base, long exp) { if (exp==0) return 1; long half=fastPow(base, exp/2); if (exp%2==0) return mul(half, half); return mul(half, mul(half, base)); } //multiply two long numbers static long mul(long a, long b) { return a*b%mod; } static int nCr(int n, int r) { return fact(n) / (fact(r) * fact(n - r)); } // Returns factorial of n static int fact(int n) { int res = 1; for (int i = 2; i <= n; i++) res = res * i; return res; } // to generate the lps array // lps means longest preffix that is also a suffix static void generateLPS(int lps[] , String p){ int l = 0; int r = 1; while(l < p.length() && l < r && r < p.length()){ if(p.charAt(l) == p.charAt(r)){ lps[r] = l + 1; l++; r++; } else{ if(l > 0) l = lps[l - 1]; else r++; } } } //count sort --> it runs in O(n) time but compromises in space static ArrayList<Integer> countSort(int a[]){ int max = Integer.MIN_VALUE; for(int i=0;i<a.length;i++){ max = Math.max(max , a[i]); } int posfre[] = new int[max+1]; boolean negPres = false; for(int i=0;i<a.length;i++){ if(a[i]>=0){ posfre[a[i]]++; } else{ negPres = true; } } ArrayList<Integer> res = new ArrayList<>(); if(negPres){ int min = Integer.MAX_VALUE; for(int i=0;i<a.length;i++){ min = Math.min(min , a[i]); } int negfre[] = new int[-1*min+1]; for(int i=0;i<a.length;i++){ if(a[i]<0){ negfre[-1*a[i]]++; } } for(int i=min;i<0;i++){ for(int j=0;j<negfre[-1*i];j++){ res.add(i); } } for(int i=0;i<=max;i++){ for(int j=0;j<posfre[i];j++){ res.add(i); } } return res; } for(int i=0;i<=max;i++){ for(int j=0;j<posfre[i];j++){ res.add(i); } } return res; } // returns the index of the element which is just smaller than or // equal to the tar in the given arraylist static int lowBound(ArrayList<Integer> ll,long tar ,int l,int r){ if(l>r) return l; int mid=l+(r-l)/2; if(ll.get(mid)>=tar){ return lowBound(ll,tar,l,mid-1); } return lowBound(ll,tar,mid+1,r); } // returns the index of the element which is just greater than or // equal to the tar in the given arraylist static int upBound(ArrayList<Integer> ll,long tar,int l ,int r){ if(l>r) return l; int mid=l+(r-l)/2; if(ll.get(mid)<=tar){ return upBound(ll,tar,l,mid-1); } return upBound(ll,tar,mid+1 ,r); } static void swap(int i , int j , int a[]){ int x = a[i]; int y = a[j]; a[j] = x; a[i] = y; } // a -> z == 97 -> 122 // String.format("%.9f", ans) ,--> to get upto 9 decimal places , (ans is double) // write }
[ "gurkaran1314@gmail.com" ]
gurkaran1314@gmail.com
c5f6d23977ede97edd2cde41f0fc5c0f0b5abee5
b4d7b7882f870933fa784808a54c7504b5399fd6
/DP/balancedBTSrec.java
31a24fce6acc8e3688c86ffe24f3fbc9025d4177
[]
no_license
super-sid/CodingNinjas
2b8ee12ed5705152e7d6b88ad60c5ec97af649b5
a62aff049b031d5132f6c292e5361bdf6d7fa83b
refs/heads/master
2021-01-02T10:25:10.905273
2019-10-13T09:36:19
2019-10-13T09:36:19
239,577,299
1
0
null
2020-02-10T17:59:29
2020-02-10T17:59:28
null
UTF-8
Java
false
false
755
java
public class Solution { public static int balancedTreesOfHeightH(int height){ /* Your class should be named Solution * Don't write main(). * Don't read input, it is passed as function argument. * Return output and don't print it. * Taking input and printing output is handled automatically. */ //for not getting into negative we use long int modValue = (int)Math.pow(10, 9) + 7; if(height==0 || height==1) { return 1; } int x = balancedTreesOfHeightH(height-1); int y = balancedTreesOfHeightH(height-2); long ans1 = ((long)x*x)%(modValue); long ans2 = (2*x*(long)y)%(modValue); int res1 = (int) ans1; int res2 = (int) ans2; int ans = (res1 + res2)%(modValue); return ans; } }
[ "noreply@github.com" ]
noreply@github.com
6ef4dc6b46adafecb4082c2bda9c759e41562475
8b2acfbfea560f7a93417fa6dc7f6a39b3d73ca4
/app/src/androidTest/java/com/e/travelbookingapplication/ExampleInstrumentedTest.java
65c190a0292a5f20d6c73b916ea85797c7e0556d
[]
no_license
RohitAwal/TravelBookingApplication
da283a36a27088bc9126ac99e3438f2ef26818b5
76a4c8e8afad7963f9a635d0b40191b1183bf086
refs/heads/master
2020-05-24T08:20:00.306582
2019-05-17T08:54:52
2019-05-17T08:54:52
187,182,114
1
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.e.travelbookingapplication; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.e.travelbookingapplication", appContext.getPackageName()); } }
[ "softwarica@softwarica.com" ]
softwarica@softwarica.com
af48c09232c7ce35637bb510f1ef46bef81157b8
d4814e21dc444ce634ee7ee91bd1ac199e748d73
/app/src/main/java/jp/yokomark/lgtm/app/history/ui/helper/ComposeHistoryViewHelper.java
e684a6650683044479430060a3962f872fc6b3ff
[ "Apache-2.0" ]
permissive
KeithYokoma/LGTMCamera
2bb105505f8c6666cdb5e79d69611c3b33936abe
250643dbb8bc5bddae78d166e73c9c485b6cbde5
refs/heads/master
2021-01-23T02:24:32.125978
2014-04-13T14:11:59
2014-04-13T14:11:59
18,488,185
3
1
null
null
null
null
UTF-8
Java
false
false
1,525
java
package jp.yokomark.lgtm.app.history.ui.helper; import android.app.ActionBar; import android.content.Context; import android.database.Cursor; import android.widget.CursorAdapter; import android.widget.ListView; import com.anprosit.android.dagger.annotation.ForActivity; import javax.inject.Inject; import jp.yokomark.lgtm.R; import jp.yokomark.lgtm.app.history.ui.ComposeHistoryAdapter; import jp.yokomark.lgtm.misc.ui.helper.AbstractActivityHelper; /** * @author yokomakukeishin * @version 1.0.0 * @since 1.0.0 */ public class ComposeHistoryViewHelper extends AbstractActivityHelper { public static final String TAG = ComposeHistoryViewHelper.class.getSimpleName(); @Inject public ComposeHistoryViewHelper(@ForActivity Context context) { super(context); } public void setUpActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); } public void setUpListView() { ListView listView = findViewById(R.id.list_history); ComposeHistoryAdapter adapter = new ComposeHistoryAdapter(getContext(), null); listView.setAdapter(adapter); listView.setOnItemClickListener(adapter); } public void swapCursor(Cursor cursor) { ListView listView = findViewById(R.id.list_history); CursorAdapter adapter = (CursorAdapter) listView.getAdapter(); adapter.swapCursor(cursor); } }
[ "keith.yokoma@gmail.com" ]
keith.yokoma@gmail.com
74848d18b8eaba6ec9a88bba773e21fa0eec237a
32d81b4b9db2b6ea4e5c046688cfa43740500bed
/src/com/netty/io/netty/handler/ssl/OpenSslClientContext.java
ef58bd405bf7ed900fb86fc376069ca6947b105b
[]
no_license
zymap/zytest
f1ce4cf0e6c735d35f68ea8c89df98ae6d035821
b8d9eb6cf46490958d20ebb914d543af50d1b862
refs/heads/master
2021-04-03T01:15:30.946483
2018-03-24T14:10:57
2018-03-24T14:10:57
124,623,152
0
0
null
null
null
null
UTF-8
Java
false
false
11,032
java
/* * Copyright 2014 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.netty.io.netty.handler.ssl; import io.netty.handler.ssl.*; import io.netty.handler.ssl.ClientAuth; import io.netty.handler.ssl.OpenSslContext; import io.netty.handler.ssl.OpenSslSessionContext; import io.netty.handler.ssl.SslContext; import io.netty.internal.tcnative.SSL; import java.io.File; import java.security.PrivateKey; import java.security.cert.X509Certificate; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLException; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import static io.netty.handler.ssl.ReferenceCountedOpenSslClientContext.newSessionContext; /** * A client-side {@link SslContext} which uses OpenSSL's SSL/TLS implementation. * <p>This class will use a finalizer to ensure native resources are automatically cleaned up. To avoid finalizers * and manually release the native memory see {@link ReferenceCountedOpenSslClientContext}. */ public final class OpenSslClientContext extends OpenSslContext { private final OpenSslSessionContext sessionContext; /** * Creates a new instance. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext() throws SSLException { this((File) null, null, null, null, null, null, null, IdentityCipherSuiteFilter.INSTANCE, null, 0, 0); } /** * Creates a new instance. * * @param certChainFile an X.509 certificate chain file in PEM format. * {@code null} to use the system default * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(File certChainFile) throws SSLException { this(certChainFile, null); } /** * Creates a new instance. * * @param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s * that verifies the certificates sent from servers. * {@code null} to use the default. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(TrustManagerFactory trustManagerFactory) throws SSLException { this(null, trustManagerFactory); } /** * Creates a new instance. * * @param certChainFile an X.509 certificate chain file in PEM format. * {@code null} to use the system default * @param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s * that verifies the certificates sent from servers. * {@code null} to use the default. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException { this(certChainFile, trustManagerFactory, null, null, null, null, null, IdentityCipherSuiteFilter.INSTANCE, null, 0, 0); } /** * Creates a new instance. * * @param certChainFile an X.509 certificate chain file in PEM format * @param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s * that verifies the certificates sent from servers. * {@code null} to use the default.. * @param ciphers the cipher suites to enable, in the order of preference. * {@code null} to use the default cipher suites. * @param apn Provides a means to configure parameters related to application protocol negotiation. * @param sessionCacheSize the size of the cache used for storing SSL session objects. * {@code 0} to use the default value. * @param sessionTimeout the timeout for the cached SSL session objects, in seconds. * {@code 0} to use the default value. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(File certChainFile, TrustManagerFactory trustManagerFactory, Iterable<String> ciphers, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout) throws SSLException { this(certChainFile, trustManagerFactory, null, null, null, null, ciphers, IdentityCipherSuiteFilter.INSTANCE, apn, sessionCacheSize, sessionTimeout); } /** * Creates a new instance. * * @param certChainFile an X.509 certificate chain file in PEM format * @param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s * that verifies the certificates sent from servers. * {@code null} to use the default.. * @param ciphers the cipher suites to enable, in the order of preference. * {@code null} to use the default cipher suites. * @param cipherFilter a filter to apply over the supplied list of ciphers * @param apn Provides a means to configure parameters related to application protocol negotiation. * @param sessionCacheSize the size of the cache used for storing SSL session objects. * {@code 0} to use the default value. * @param sessionTimeout the timeout for the cached SSL session objects, in seconds. * {@code 0} to use the default value. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(File certChainFile, TrustManagerFactory trustManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout) throws SSLException { this(certChainFile, trustManagerFactory, null, null, null, null, ciphers, cipherFilter, apn, sessionCacheSize, sessionTimeout); } /** * Creates a new instance. * @param trustCertCollectionFile an X.509 certificate collection file in PEM format. * {@code null} to use the system default * @param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s * that verifies the certificates sent from servers. * {@code null} to use the default or the results of parsing * {@code trustCertCollectionFile} * @param keyCertChainFile an X.509 certificate chain file in PEM format. * This provides the public key for mutual authentication. * {@code null} to use the system default * @param keyFile a PKCS#8 private key file in PEM format. * This provides the private key for mutual authentication. * {@code null} for no mutual authentication. * @param keyPassword the password of the {@code keyFile}. * {@code null} if it's not password-protected. * Ignored if {@code keyFile} is {@code null}. * @param keyManagerFactory the {@link KeyManagerFactory} that provides the {@link javax.net.ssl.KeyManager}s * that is used to encrypt data being sent to servers. * {@code null} to use the default or the results of parsing * {@code keyCertChainFile} and {@code keyFile}. * @param ciphers the cipher suites to enable, in the order of preference. * {@code null} to use the default cipher suites. * @param cipherFilter a filter to apply over the supplied list of ciphers * @param apn Application Protocol Negotiator object. * @param sessionCacheSize the size of the cache used for storing SSL session objects. * {@code 0} to use the default value. * @param sessionTimeout the timeout for the cached SSL session objects, in seconds. * {@code 0} to use the default value. * @deprecated use {@link SslContextBuilder} */ @Deprecated public OpenSslClientContext(File trustCertCollectionFile, TrustManagerFactory trustManagerFactory, File keyCertChainFile, File keyFile, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, long sessionCacheSize, long sessionTimeout) throws SSLException { this(toX509CertificatesInternal(trustCertCollectionFile), trustManagerFactory, toX509CertificatesInternal(keyCertChainFile), toPrivateKeyInternal(keyFile, keyPassword), keyPassword, keyManagerFactory, ciphers, cipherFilter, apn, null, sessionCacheSize, sessionTimeout, false); } OpenSslClientContext(X509Certificate[] trustCertCollection, TrustManagerFactory trustManagerFactory, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword, KeyManagerFactory keyManagerFactory, Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apn, String[] protocols, long sessionCacheSize, long sessionTimeout, boolean enableOcsp) throws SSLException { super(ciphers, cipherFilter, apn, sessionCacheSize, sessionTimeout, SSL.SSL_MODE_CLIENT, keyCertChain, ClientAuth.NONE, protocols, false, enableOcsp); boolean success = false; try { sessionContext = newSessionContext(this, ctx, engineMap, trustCertCollection, trustManagerFactory, keyCertChain, key, keyPassword, keyManagerFactory); success = true; } finally { if (!success) { release(); } } } @Override public OpenSslSessionContext sessionContext() { return sessionContext; } @Override OpenSslKeyMaterialManager keyMaterialManager() { return null; } }
[ "734206637@qq.com" ]
734206637@qq.com
62ff04528057fc0b600ea2e21256342d424e73db
7c56662005e82a13b3d920df3fbe26c6ed609119
/eclipse-workspaceone/CMSWithEMSUsingServletInOptmiseWay/src/service/serviceForCMS/DeleteClient.java
a3df1cb3c22fc36d5f46dc0a8fd9c2083f2f05d6
[]
no_license
varnittyagi120/javaproject2
b7ac6cf87c685662eccfcea20822f17cbf279e84
1f525fdf4f46e5d99f37f7c33ec0fb18f930721e
refs/heads/master
2022-06-27T19:32:10.362918
2019-11-22T16:02:52
2019-11-22T16:02:52
223,436,983
0
0
null
2022-06-21T02:17:42
2019-11-22T15:54:55
JavaScript
UTF-8
Java
false
false
1,337
java
package service.serviceForCMS; 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; import dao.DatabaseQueries; import dto.Client; /** * Servlet implementation class DeleteClient */ @WebServlet("/DeleteClient") public class DeleteClient extends HttpServlet { private static final long serialVersionUID = 1L; public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); Client client = new Client(); @SuppressWarnings("unchecked") DatabaseQueries<Client> databaseQueries = (DatabaseQueries<Client>)DatabaseQueries.getObject(); if (databaseQueries.delete(id, client) > 0) { request.setAttribute("errorInId", null); request.getRequestDispatcher("ReadClients").forward(request, response); }else{ request.setAttribute("errorInId","please enter correct id"); request.getRequestDispatcher("TakeInputForIdOfClient?url=DeleteClient").forward(request, response); } } }
[ "varnittyagi1204@gmail.com" ]
varnittyagi1204@gmail.com
bf6468d293cc42d05cd166f81500c11b8b8a211b
eeca7762180389cf3e6dc5f47680068404f162be
/src/PluggableAuthentication.java
4bb2c32aff412cc681ec04f41b1287c1c8081cce
[ "MIT" ]
permissive
serbestemre/pluggable-authentication-mechanism
b77120da0e9fe3beddc38465289b7f29cea355d4
4c514b6ca243c67233262cdb8c0d837c9be2d034
refs/heads/master
2022-08-15T05:34:56.675134
2020-05-25T05:57:31
2020-05-25T05:57:31
264,676,586
0
0
null
null
null
null
UTF-8
Java
false
false
3,949
java
interface PluggableAuthentication { int authenticate(String name, String password); void getUid(String userName); } class LocalAPI { int local_authenticate(String userName, String password) { System.out.println("Connecting to OS via LOCAL adaptee...."); AuthenticatorMechanism localAuth = new LocalAuthenticator(); return localAuth.authenticateByGivenAccess(userName, password); } void local_getUid(String userName) { UserDatabase db = new UserDatabase(); int uid = db.getUid(userName); System.out.println("Local User ID => " + uid); } } class LdapAPI { int ldap_authenticate(String userName, String password) { System.out.println("Connecting to OS via LDAP adaptee..."); AuthenticatorMechanism ldapAuth = new LdapAuthenticator(); return ldapAuth.authenticateByGivenAccess(userName, password); } void ldap_getUid(String userName) { UserDatabase db = new UserDatabase(); int uid = db.getUid(userName); System.out.println("LDAP User ID => " + uid); } } class KerberosAPI { int kerberos_authenticate(String userName, String password) { System.out.println("Connecting to OS via KERBEROS adaptee"); AuthenticatorMechanism kerberosAut = new KerberosAuthenticator(); return kerberosAut.authenticateByGivenAccess(userName, password); } void kerberos_getUid(String userName) { UserDatabase db = new UserDatabase(); int uid = db.getUid(userName); System.out.println("Kerberos User ID => " + uid); } } class LocalAPIPluggableAuthentication extends LocalAPI implements PluggableAuthentication { private static LocalAPIPluggableAuthentication localAdapterInstance = null; LocalAPI localAPI = new LocalAPI(); private LocalAPIPluggableAuthentication() { } public static LocalAPIPluggableAuthentication getLocalAdapterInstance() { if (localAdapterInstance == null) { return new LocalAPIPluggableAuthentication(); } else { return localAdapterInstance; } } @Override public int authenticate(String name, String password) { return localAPI.local_authenticate(name, password); } @Override public void getUid(String userName) { localAPI.local_getUid(userName); } } class LdapAPIPluggableAuthentication extends LdapAPI implements PluggableAuthentication { private static LdapAPIPluggableAuthentication ldapAdapterInstance = null; LdapAPI ldapAPI = new LdapAPI(); private LdapAPIPluggableAuthentication() { } public static LdapAPIPluggableAuthentication getLdapAdapterInstance() { if (ldapAdapterInstance == null) { return new LdapAPIPluggableAuthentication(); } else { return ldapAdapterInstance; } } @Override public int authenticate(String name, String password) { return ldapAPI.ldap_authenticate(name, password); } @Override public void getUid(String userName) { ldapAPI.ldap_getUid(userName); } } class KerberosAPIPluggableAuthentication extends KerberosAPI implements PluggableAuthentication { private static KerberosAPIPluggableAuthentication kerberosAdapterInstance = null; KerberosAPI kerberosAPI = new KerberosAPI(); private KerberosAPIPluggableAuthentication() { } public static KerberosAPIPluggableAuthentication getKerberosAdapterInstance() { if (kerberosAdapterInstance == null) { return new KerberosAPIPluggableAuthentication(); } else { return kerberosAdapterInstance; } } @Override public int authenticate(String name, String password) { return kerberosAPI.kerberos_authenticate(name, password); } @Override public void getUid(String userName) { kerberosAPI.kerberos_getUid(userName); } }
[ "35980788+sercankavdir@users.noreply.github.com" ]
35980788+sercankavdir@users.noreply.github.com
217a9e4f5bfc46891ce727fa623546b1fe53f0df
d50d78d90566c72a12e850d71ae944cb1dfcdefe
/Anagram.java
c30b84f85805501894c60df8b4347d5c2a820a8c
[]
no_license
BishoyGeorgy/leet-code-problems
ed6e96720b2e0a03d11646dfa0c5ddf31464b148
35a42ff6341bbad180873f5e8826e443ada2187d
refs/heads/main
2023-06-10T20:41:22.933072
2021-07-03T13:22:17
2021-07-03T13:22:17
377,300,076
0
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
class Anagram { // Solution using Maps public boolean isAnagramUsingMaps(String s, String t) { if (s.length() != t.length()) return false; Map<Character, Integer> firstString = new HashMap<>(); Map<Character, Integer> secondString = new HashMap<>(); for (int i = 0; i < s.length(); i++) { firstString.put(s.charAt(i), firstString.get(s.charAt(i)) == null ? 1 : firstString.get(s.charAt(i)) + 1); secondString.put(t.charAt(i), secondString.get(t.charAt(i)) == null ? 1 : secondString.get(t.charAt(i)) + 1); } for (Map.Entry<Character, Integer> entry : firstString.entrySet()) { if (secondString.get(entry.getKey()) == null) return false; if ((int) secondString.get(entry.getKey()) != (int) entry.getValue()) { return false; } } return true; } // Simple Solution Using Sorting public boolean isAnagramUsingSorting(String s, String t) { char[] s1 = s.toCharArray(); char[] t1 = t.toCharArray(); Arrays.sort(s1); Arrays.sort(t1); return Arrays.equals(s1, t1); } }
[ "noreply@github.com" ]
noreply@github.com
b51a806e6eaa8af2f5ae3cfe5509454312da3252
a933618e8b7597189df49d19ebe7846c90b39f37
/算法题/src/多线程/按序打印.java
57c18f13b3f7f2d1022b52f2aa8bdaf91b1b1527
[]
no_license
gokuPeng/Data-structure-and-algorithm
e653b834a7906ead088b53bbed8add2036797300
947d1c4503443b6e3e2c13008a73003e6a0cbc29
refs/heads/master
2023-04-16T15:07:43.292803
2021-04-21T09:50:14
2021-04-21T09:50:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,641
java
package 多线程; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; /** * @author 彭一鸣 1114. 按序打印 https://leetcode-cn.com/problems/print-in-order/ * @since 2021/3/29 9:55 */ public class 按序打印 { private ReentrantLock lock = new ReentrantLock(); private Condition cd1 = lock.newCondition(); private Condition cd2 = lock.newCondition(); volatile boolean a = false; volatile boolean b = false; volatile boolean c = false; public 按序打印() { } public void first(Runnable printFirst) throws InterruptedException { lock.lock(); try { // printFirst.run() outputs "first". Do not change or remove this line. printFirst.run(); a = true; cd1.signal(); } finally { lock.unlock(); } } public void second(Runnable printSecond) throws InterruptedException { lock.lock(); try { // printSecond.run() outputs "second". Do not change or remove this line. if (!a) { cd1.await(); } printSecond.run(); b = true; cd2.signal(); } finally { lock.unlock(); } } public void third(Runnable printThird) throws InterruptedException { lock.lock(); try { if (!b) { cd2.await(); } // printThird.run() outputs "third". Do not change or remove this line. printThird.run(); } finally { lock.unlock(); } } }
[ "1747670277@qq.com" ]
1747670277@qq.com
91fa6ae78641ca830cc2019e56e5efe39714bac3
038d10f2ffd25ab200d9220391d6816d4475bf8d
/ProjectManagement/src/main/java/com/kgc/service/ProjectinfoService.java
4301cc48ba2ec391be2f2df003e244785ba4ca39
[ "Apache-2.0" ]
permissive
jijunshuo/SSM-ProjectManagement
d8c7c0cbcfbd90aed915a41d625c9715e600af2c
74f56199bf4282fec5d3d52a774c89c8711cc673
refs/heads/main
2022-12-28T10:24:43.846388
2020-10-04T12:14:58
2020-10-04T12:14:58
301,105,468
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.kgc.service; import com.kgc.pojo.Projectinfo; import java.util.List; public interface ProjectinfoService { List<Projectinfo> selectBystatus(Integer status,Integer pageNum,Integer pageSize); Projectinfo selectByid(Long id); int upd(Projectinfo projectinfo); }
[ "1274929784@qq.com" ]
1274929784@qq.com
f3fbe0822b99ce021d5df9a7be347fdc83e9b582
476e10978840c9e9f6b7fe84f16c0423c17739bd
/src/main/java/personal/ws/learning/aspect/AspectTest.java
cd17433ea1e7cef0b541607d63e01254dd41e47b
[]
no_license
ws4work/WSService
496d4bb04092da1e1759c7e1d5be88c9a8d3485e
387a8c17d43a0b494dc43a65d6383e47b3a5449c
refs/heads/master
2021-08-31T12:23:49.264560
2017-12-21T08:39:06
2017-12-21T08:39:06
103,512,136
0
0
null
null
null
null
UTF-8
Java
false
false
1,883
java
package personal.ws.learning.aspect; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.stereotype.Component; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Method; import java.util.Map; /** * @Description: * @author: 王上 * @date: 2017/8/10 * @project:WSService */ @Aspect @Component public class AspectTest { // @Pointcut("execution(public * com.hongwei.moddle.*.controller.*.*(..))") // @Pointcut("execution(public * personal.ws.myservice.query.controller.*.*(..))") @Pointcut("execution(* *(..))") public void poin() { } @Before("execution( * *(..))") public void pointBefore(JoinPoint joinPoint){ ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request = attributes.getRequest(); HttpServletResponse response = attributes.getResponse(); Class c = getClass(joinPoint); Method method = getMethod(joinPoint); Map<String, String[]> map = request.getParameterMap(); assert map.size()>0:"参数数组个数小于0"; System.out.println(map.toString()); System.out.println(111); } public Class getClass(JoinPoint joinpoint){ return joinpoint.getSignature().getDeclaringType(); } public Method getMethod(JoinPoint joinpoint){ MethodSignature methodSignature = (MethodSignature)joinpoint.getSignature(); return methodSignature.getMethod(); } }
[ "WS" ]
WS
857231095e9aa24e28036718b93b83d0051f2b3e
ce63b4d2bb5b548a47e7c51ae72472e36688f033
/library/src/main/java/com/ronda/imageloader/ImageCache.java
bc2d9ba6bb79a08e7901b86da77c403d9e21073b
[]
no_license
githubRonda/ImageLoader
e2757f5e44b590f501829dbe7db6f5211ccbe91f
eb4250b32f8936fc54561510a7959e9eed624ba0
refs/heads/master
2021-05-13T16:14:00.441998
2018-01-09T08:22:21
2018-01-09T08:22:21
116,780,559
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.ronda.imageloader; import android.graphics.Bitmap; /** * Created by Ronda on 2018/1/8. */ public interface ImageCache { public Bitmap get(String url); public void put(String url, Bitmap bitmap); }
[ "1575558177@qq.com" ]
1575558177@qq.com
dfc01981bd1e1a94465994284475638d67f60b0e
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/49/390.java
d3caafcfbaba190fe2e6310abe2dad6248850a89
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
import java.util.*; package <missing>; public class GlobalMembers { public static void maxhui(String huichuan, String chuan, int i) { int k; int l = 1; for (k = i ; ; k++) { if (chuan[k].equals(chuan[k - 2 * l + 1])) { huichuan[l - 1] = chuan[k]; l = l + 1; } else { break; } } huichuan[l - 1] = '\0'; } public static int Main() { String chuan = new String(new char[500]); char[][] huichuan = new char[500][500]; int i; int j; int k = 0; int length; int p; chuan = new Scanner(System.in).nextLine(); for (i = 1 ; i < chuan.length() ; i++) { if (chuan.charAt(i) == chuan.charAt(i - 1)) { maxhui(huichuan[k], chuan, i); k++; } } int[] maxlen = new int[500]; int maxlength = 0; for (i = 0 ; i < k ; i++) { if (String.valueOf(huichuan[i]).length() > maxlength) { maxlength = String.valueOf(huichuan[i]).length(); } } for (i = 0 ; i < maxlength ; i++) { for (j = 0 ; j < k ; j++) { if (String.valueOf(huichuan[j]).length() > i) { for (p = i ; p >= 0 ; p--) { System.out.print(huichuan[j][p]); } for (p = 0 ; p <= i ; p++) { System.out.print(huichuan[j][p]); } System.out.print("\n"); } } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
ef4c28eef7bfac096553a4074437119bc7f97537
433281109102fef1c6c99b745cf5200aa1506c60
/src/main/java/com/ivo/sapweb/system/model/Role.java
7fc4976aa1e747dae0979adbf551b601bca18f00
[]
no_license
wangjian93/sapweb
bdec713dc1355234d1111c6d19c4beeea778fed8
8d4544c5b35f7e2afbf72ad1d73e947cb0839af3
refs/heads/master
2022-06-30T14:38:35.837757
2019-05-27T00:58:22
2019-05-27T00:58:22
148,088,711
7
3
null
2022-02-09T22:08:37
2018-09-10T02:35:11
JavaScript
UTF-8
Java
false
false
1,418
java
package com.ivo.sapweb.system.model; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.ivo.sapweb.common.core.Model; /** * 角色表 * @author wangjian * @date 2018/9/1 */ @TableName("sys_role") public class Role extends Model { /** * 角色id */ @TableId private Integer roleId; /** * 角色名称 */ private String roleName; /** * 描述 */ private String comments; /** * 逻辑删除,0未删除,1已删除 */ private Integer isDelete; public Role() { } public Role(Integer roleId) { setRoleId(roleId); } public Role(Integer roleId, String roleName) { setRoleId(roleId); setRoleName(roleName); } public Integer getIsDelete() { return isDelete; } public void setIsDelete(Integer isDelete) { this.isDelete = isDelete; } public Integer getRoleId() { return roleId; } public void setRoleId(Integer roleId) { this.roleId = roleId; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } }
[ "1556879688@qq.com" ]
1556879688@qq.com
b40eec56f9294087a0863c975a152a5bebd89f8f
2163ec38f93f297f997f2705d983619f16171cb4
/app/src/androidTest/java/com/tufusi/permissonaop/ExampleInstrumentedTest.java
c5c956f697d7bcffbca2f302a5d57e9e4524facf
[]
no_license
LeoCheung0221/AOP4Permission
04715c07ef4f4de13d26ac7f7473208e3e61bf98
a8f6d16c31c47a51ac125e9a7d9e2763d62baca3
refs/heads/master
2022-12-07T08:35:59.186463
2020-08-27T03:01:47
2020-08-27T03:01:47
281,267,428
0
0
null
null
null
null
UTF-8
Java
false
false
762
java
package com.tufusi.permissonaop; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.tufusi.permissonaop", appContext.getPackageName()); } }
[ "leocheung4ever@gmail.com" ]
leocheung4ever@gmail.com
ca054ec3a15d0e2ea79a80d286573e2aa87ba083
12b6998355c257007043520f6c66303222a5edb4
/client/ShowMeThePast/app/src/main/java/com/tesis/yudith/showmethepast/view/navigation/NavigationStack.java
71b130e4af5356bfd5bdf9136e3c2772a6d11ceb
[]
no_license
judith-condori/showmethepast
c0e4e2387d36011daa3b0454bdbd43c54c4b947b
bcd0f2b36303c5a33844ad12db3848dded5ae937
refs/heads/master
2021-07-24T01:57:54.109630
2017-11-04T22:10:41
2017-11-04T22:10:41
109,533,715
0
0
null
null
null
null
UTF-8
Java
false
false
822
java
package com.tesis.yudith.showmethepast.view.navigation; import java.util.Stack; public class NavigationStack { private Stack<INavigationChild> stack; public NavigationStack() { this.stack = new Stack<>(); } public void replaceChildren(INavigationChild children) { this.stack.clear(); this.stack.add(children); } public void pushChildren(INavigationChild children) { this.stack.push(children); } public INavigationChild popChildren() { return this.stack.pop(); } public INavigationChild peekChildren() { return this.stack.peek(); } public boolean isEmpty() { return this.stack.isEmpty(); } public boolean isLastOne() { return this.stack.size() == 1; } }
[ "jucp.robin@gmail.com" ]
jucp.robin@gmail.com
e0244ebf47477a54eea6b72b00c2dc5e9ad85088
4c698847bd0e4e558e54264957ce94994da8727f
/Easy/romanToInteger.java
1a8c3dd31c9628517a86922c941f459b2cb7f729
[]
no_license
SHC02/LeetCode
478106c4fafa77edddf1fac8d111bbe0940dceb9
efdf5e406d564867b31e53145dfb1986b46665e3
refs/heads/main
2023-08-29T13:42:22.559516
2021-11-05T22:31:41
2021-11-05T22:31:41
375,197,735
0
0
null
null
null
null
UTF-8
Java
false
false
2,242
java
/* Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II. Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used: I can be placed before V (5) and X (10) to make 4 and 9. X can be placed before L (50) and C (100) to make 40 and 90. C can be placed before D (500) and M (1000) to make 400 and 900. Given a roman numeral, convert it to an integer. Example 1: Input: s = "III" Output: 3 Example 2: Input: s = "IV" Output: 4 Example 3: Input: s = "IX" Output: 9 Example 4: Input: s = "LVIII" Output: 58 Explanation: L = 50, V= 5, III = 3. Example 5: Input: s = "MCMXCIV" Output: 1994 Explanation: M = 1000, CM = 900, XC = 90 and IV = 4. */ import java.util.HashMap; import java.util.Map; public class romanToInteger { public int romanToInt(String s) { int result = 0; int a = getVal(s.charAt(0)); for(int i = 1; i<s.length(); i++) { int b = getVal(s.charAt(i)); if(a < b) { result -= a; } else { result += a; } a=b; } result += a; return result; } private int getVal(char c) { switch(c) { case 'I': return 1; case 'V': return 5; case 'X': return 10; case 'L': return 50; case 'C': return 100; case 'D': return 500; case 'M': return 1000; default: return 0; } } }
[ "noreply@github.com" ]
noreply@github.com
f5685a19619ebda18cc980494f693118d1b282f5
c1f4729ad32f292d9aefc0d527d762ce2bef52b0
/api/src/main/java/com/cognizant/service/LoginImpl.java
e0568f27ca8f0439d3308e5c88ee02fd13560a18
[]
no_license
pankajthayat/metrics-app
f83a369eff20b4196f68baa9994c917caf007042
17785dc8cbb6c39d72bdfa458a36ccc639e33b89
refs/heads/master
2020-04-26T16:32:53.714918
2019-03-04T06:32:49
2019-03-04T06:32:49
173,682,921
0
0
null
null
null
null
UTF-8
Java
false
false
1,734
java
package com.cognizant.service; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import com.cognizant.queryinterface.LoginQueries; import com.cognizant.service.LoginService; import com.cognizant.util.PasswordUtils; import com.cognizant.util.StringConstants; /** * @author 739243 * */ @Service public class LoginImpl extends CommonImpl implements LoginService { private static final Logger LOGGER = LoggerFactory .getLogger(CommonImpl.class); @Override public String testCall() { return StringConstants.SERVER_RUNNING_MSG; } @Override public List<String> getUserDetails(int userId) { List<String> userDet = new ArrayList<>(); try { } catch (Exception ex) { LOGGER.error("Error in getting user details",ex.getMessage()); } return userDet; } @Override public String generateUserPw(String password) { String pwd=null; try { pwd = PasswordUtils.generateSecurePassword(password, StringConstants.ENC_SALT_KEY); } catch (Exception ex) { LOGGER.error("Error in generating encrypted password",ex.getMessage()); } return pwd; } @Override public String loginUser(String userName, String password) { String returnMsg = StringConstants.FAILURE; try { String userDbPw = getSingleResultSet(LoginQueries.GET_USERPW, userName); if (userDbPw.length() > 0) { boolean passwordMatch = PasswordUtils.verifyUserPassword( password, userDbPw, StringConstants.ENC_SALT_KEY); returnMsg = passwordMatch ? StringConstants.SUCCESS : returnMsg; } } catch (Exception ex) { LOGGER.error("Error in user login",ex.getMessage()); } return returnMsg; } }
[ "pankajthayat@gmail.com" ]
pankajthayat@gmail.com
2f4513811e767fa412ea7fb102a7a9cd22a0527c
6c0d4f3828966746d72471b2131f68a05b4036bf
/src/product/cmc/com/topvision/ems/cmc/optical/facade/domain/CmcOpReceiverRfCfg.java
1be4e66fa697ec491a5190754b399a482902cbac
[]
no_license
kevinXiao2016/topvision-server
b5b97de7436edcae94ad2648bce8a34759f7cf0b
b5934149c50f22661162ac2b8903b61a50bc63e9
refs/heads/master
2020-04-12T00:54:33.351152
2018-12-18T02:16:14
2018-12-18T02:16:14
162,215,931
0
1
null
null
null
null
UTF-8
Java
false
false
4,347
java
/*********************************************************************** * $Id: CmcOpReceiverRfCfg.java,v1.0 2013-12-2 下午2:11:49 $ * * @author: dosion * * (c)Copyright 2011 Topvision All rights reserved. ***********************************************************************/ package com.topvision.ems.cmc.optical.facade.domain; import org.apache.ibatis.type.Alias; import com.topvision.framework.annotation.SnmpProperty; import com.topvision.framework.dao.mybatis.AliasesSuperType; /** * 光机RF配置信息,一台CCMTS设备会有一条RF配置信息 * * @author dosion * @created @2013-12-2-下午2:11:49 * */ @Alias("cmcOpReceiverRfCfg") public class CmcOpReceiverRfCfg implements AliasesSuperType { private static final long serialVersionUID = 3784533831663236148L; /** * 数据库主键ID */ private Long id; private Long cmcId; @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.1", index = true) private Integer outputIndex; /** * 控制下行光接收机输出的开关 */ @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.2", writable = true, type = "Integer32") private Byte outputControl; /** * 控制下行光接收机输出增益的类型 */ @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.3", writable = true, type = "Integer32") private Byte outputGainType; /** * 下行光接收机输出RF电平 */ // @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.4") private Integer outputLevel; /** * 下行光接收机光路AGC起始功率设置 */ @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.5", writable = true, type = "Integer32") private Integer outputAGCOrigin; /** * 下行光接收机中RF输出电平衰减量设置 */ @SnmpProperty(oid = "1.3.6.1.4.1.32285.11.1.1.2.21.5.1.6", writable = true, type = "Integer32") private Integer outputRFlevelatt; private Long dt; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getCmcId() { return cmcId; } public void setCmcId(Long cmcId) { this.cmcId = cmcId; } public Integer getOutputIndex() { return outputIndex; } public void setOutputIndex(Integer outputIndex) { this.outputIndex = outputIndex; } public Byte getOutputControl() { return outputControl; } public void setOutputControl(Byte outputControl) { this.outputControl = outputControl; } public Byte getOutputGainType() { return outputGainType; } public void setOutputGainType(Byte outputGainType) { this.outputGainType = outputGainType; } public Integer getOutputLevel() { return outputLevel; } public void setOutputLevel(Integer outputLevel) { this.outputLevel = outputLevel; } public Integer getOutputAGCOrigin() { return outputAGCOrigin; } public void setOutputAGCOrigin(Integer outputAGCOrigin) { this.outputAGCOrigin = outputAGCOrigin; } public Integer getOutputRFlevelatt() { return outputRFlevelatt; } public void setOutputRFlevelatt(Integer outputRFlevelatt) { this.outputRFlevelatt = outputRFlevelatt; } public Long getDt() { return dt; } public void setDt(Long dt) { this.dt = dt; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("CmcOpReceiverRfCfg [id="); builder.append(id); builder.append(", cmcId="); builder.append(cmcId); builder.append(", outputIndex="); builder.append(outputIndex); builder.append(", outputControl="); builder.append(outputControl); builder.append(", outputGainType="); builder.append(outputGainType); builder.append(", outputLevel="); builder.append(outputLevel); builder.append(", outputAGCOrigin="); builder.append(outputAGCOrigin); builder.append(", outputRFlevelatt="); builder.append(outputRFlevelatt); builder.append(", dt="); builder.append(dt); builder.append("]"); return builder.toString(); } }
[ "785554043@qq.com" ]
785554043@qq.com
9004bddfa65bc5807dbd9a77e2bb63100a1e1336
11bc9c2db9961f91c6e916c48d8227265e95a9db
/src/main/java/net/learn/java/concurrency/counter/VolatileCounter.java
3b81d10c7c1d19f5b5720a206c741b6d2e6a6cca
[ "MIT" ]
permissive
guozheng/java-concurrency-counters-benchmark
f1a650dfbcec280d53d4b81049b4d9d34c3efabf
71a56ac3e5f05a4d0caa23b7b36bc7a64ba0e0dc
refs/heads/master
2021-06-08T01:02:11.726516
2016-12-07T17:53:31
2016-12-07T17:53:31
74,194,844
11
0
null
null
null
null
UTF-8
Java
false
false
265
java
package net.learn.java.concurrency.counter; /** * Created by gzge on 11/22/16. */ public class VolatileCounter { private volatile long count = 0; public void increment() { count += 1; } public long get() { return count; } }
[ "guozheng.ge@gmail.com" ]
guozheng.ge@gmail.com
7f5602821c908b378a5710c4db6480d64af1117e
67691ca55f1e46aa90046f5079693e3554b2e5ab
/src/WY/WYTest/WY2_3.java
6a6d4d9865928e04523d374cca0f53c52e13d79b
[]
no_license
lxflxf56/althorithm
513deea2b5eddd5306d5ee96a538e54c7fbdacf1
67e904d8fb35de3f856fb4c92617c953ea5435a6
refs/heads/master
2021-06-11T05:16:22.818875
2020-09-12T09:31:43
2020-09-12T09:31:43
128,507,710
0
0
null
null
null
null
UTF-8
Java
false
false
3,175
java
package WY.WYTest; import java.util.ArrayList; import java.util.Scanner; /* * *小易来到了一条石板路前,每块石板上从1挨着编号为:1、2、3....... 这条石板路要根据特殊的规则才能前进:对于小易当前所在的编号为K的 石板,小易单次只能往前跳K的一个约数(不含1和K)步, 即跳到K+X(X为K的一个非1和本身的约数)的位置。 小易当前处在编号为N的石板,他想跳到编号恰好为M的石板去,小易想知道最少需要跳跃几次可以到达。 例如: N = 4,M = 24: 4->6->8->12->18->24 于是小易最少需要跳跃5次,就可以从4号石板跳到24号石板 动态规划 dp[steps]为可不可达,不可达为max,可达记次数 从第一步开始算是否可达,并记录更新dp,获得最后d[steps-1] 时间复杂度为O(N*logN) * */ public class WY2_3 { boolean end=true; int n,m; public void setM(int n,int m) { this.m = m; this.n = n; compoute(n,0); } // 思想:动态规划 public static int leastJumpTime(int n, int m) { if (m == n) { return 0; } int steps = m - n + 1;// 算上了起点和终点 int[] dp = new int[steps];// 规划的量:到达 每个位置需要的最小步数 dp[0] = 0; // 起点 for (int i = 1; i < steps; i++) { dp[i] = Integer.MAX_VALUE; // 初始化 表示后续位置都不能到达 } for (int i = 0; i < steps; i++) { // 0对应n石板 ;steps - 1 = m-n对应m石板 if (dp[i] == Integer.MAX_VALUE) { // 该位置不能像前走 continue; } ArrayList<Integer> list = getAppNums(i + n); // i+n才是石板号 for (int j = 0; j < list.size(); j++) { int x = list.get(j); if (i + n + x <= m) { dp[i + x] = Math.min(dp[i + x], dp[i] + 1); } } } if (dp[steps - 1] == Integer.MAX_VALUE) { return -1; } else { return dp[steps - 1]; } } // 求因数 时间复杂度较低 public static ArrayList<Integer> getAppNums(int n) { ArrayList<Integer> list = new ArrayList<Integer>(); for (int i = 2; i <= Math.sqrt(n); i++) { if (n % i == 0) { list.add(i); if (n / i != i) { list.add(n / i); } } } return list; } public void compoute(int n, int num){//递归超时 if (n==m){ end=false; System.out.println(num); return; } for (int i=2;i<n&end;i++){ if (n%i==0){ compoute(n+n/i,num+1); } } } public static void main(String[] args) { WY2_3 wy2_3=new WY2_3(); Scanner scanner=new Scanner(System.in); int n=scanner.nextInt(); int m=scanner.nextInt(); //wy2_3.setM(n,m); System.out.println("!!"); int tmp=WY2_3.leastJumpTime(n,m); System.out.println(tmp); } }
[ "501313018@qq.com" ]
501313018@qq.com
357888f0ca0bafd18c12d346a9aaf9cecc272236
5e64aa19ab51de6aa418dd9542c1966a9e8be931
/src/com/smarthome/deskclock/AlarmAlertWakeLock.java
4819dd96331f7ae03358ad63c8921f9bd5d7a311
[ "Apache-2.0" ]
permissive
AndrewChanChina/smartService
712b15b737c73f3bbc6bb7e88cc172056629ef6f
c35558a2d5d1b235575078c8e75b6097717beedb
refs/heads/master
2016-09-06T05:35:39.136162
2012-04-06T03:12:27
2012-04-06T03:12:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,577
java
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.smarthome.deskclock; import android.content.Context; import android.os.PowerManager; import com.smarthome.alarmclock.R; /** * Hold a wakelock that can be acquired in the AlarmReceiver and * released in the AlarmAlert activity */ class AlarmAlertWakeLock { private static PowerManager.WakeLock sCpuWakeLock; static void acquireCpuWakeLock(Context context) { if (sCpuWakeLock != null) { return; } PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); sCpuWakeLock = pm.newWakeLock( PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, Log.LOGTAG); sCpuWakeLock.acquire(); } static void releaseCpuLock() { if (sCpuWakeLock != null) { sCpuWakeLock.release(); sCpuWakeLock = null; } } }
[ "chenyzpower@gmail.com" ]
chenyzpower@gmail.com
e5d7d4c82e4493c70052404affb2cf41a1eb8aac
ff61eb8d054c8636f11193d610ca9507af57c82c
/android/ISO8583/app/src/main/java/demo/org/ichanging/iso8583/socket/SocketManager.java
0b5b56bada1ad50264a66c05193a26ed99747f59
[]
no_license
neil-pan-s/kata
793a2ca7ca70738b8041b14387cf2a933087566e
831ca6ded1daada647f4b2b4a7c60face298cfe0
refs/heads/master
2020-04-16T02:59:41.014746
2019-02-19T10:08:03
2019-02-19T10:08:03
165,216,236
0
0
null
null
null
null
UTF-8
Java
false
false
1,352
java
package demo.org.ichanging.iso8583.socket; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketException; import demo.org.ichanging.iso8583.config.Config; /** 连接管理类 */ public class SocketManager{ public static final int ERR_BASE = -1000; public static final int SOCKET_ERR_TIMEOUT = (ERR_BASE -1); public static final int SOCKET_ERR_CONNECT = (ERR_BASE -2); public static final int SOCKET_ERR_SEND = (ERR_BASE -3); public static final int SOCKET_ERR_RECV = (ERR_BASE -4); private static final SocketManager sINSTANCE = new SocketManager(); public interface SocketCallback { void onConnect(); void onDisconnect(); void onSend(); void onRecvMsg(MsgParam param); void onError(int errCode); } private SocketManager() {}; public static SocketManager getInstance() { return sINSTANCE; } /** * 启动一个异步socket * 全双工通信 异步socket 报文无需一应一答 * * @param key */ public void startAsyncSocket(String key){ new AsyncSocket().start(); } /** * 启动一个同步socket * 同步socket 报文一应一答模式 * * @param key */ public void startSyncSocket(String key){ new SyncSocket().start(); } }
[ "p.changing@qq.com" ]
p.changing@qq.com
80db37354ca95649e61737b580164f632726239a
7dbf974d4b0b79d31458847bfbb1a153c86374c4
/CampChallenge_java/011.メソッド/method3.java
8d7dc2456cfc28f5b315ee92911cb440f0bf58a8
[]
no_license
minorikobayashi/GEEKJOB
b28f0e2c1d5f15a23c4704e3be781ef1e415b5f9
91a71460e898f3e45032862c2d34003013b04a52
refs/heads/master
2020-03-18T20:41:19.567271
2018-08-22T08:45:19
2018-08-22T08:45:19
135,232,043
0
1
null
null
null
null
UTF-8
Java
false
false
3,271
java
/* * 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 method; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author 小林誠典 */ @WebServlet(name = "method3", urlPatterns = {"/method3"}) public class method3 extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ void multiplication(int a,int b,boolean c,PrintWriter pw){ if(c==true){pw.print(a*b*a*b);} else{pw.print(a*b);} } void multiplication(boolean c,PrintWriter pw){ multiplication(4,9,c,pw); } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet method3</title>"); out.println("</head>"); out.println("<body>"); multiplication(3,3,true,out); out.println("<h1>Servlet method3 at " + request.getContextPath() + "</h1>"); out.println("</body>"); out.println("</html>"); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "kminori.5173@gmail.com" ]
kminori.5173@gmail.com
f532950eeadc4038996ab4488123b03b65f3ff53
bccae00a81f2c8a150872a09bb98fa79fd1cfb32
/src/main/java/ru/example/storage/to/Storage.java
d7a6b8dc6b70019e3223d8e39638c07d73f65e17
[]
no_license
DenisovaElena/storage
94324ce9051db2808cb7a90fc8afb36da1e8f01a
01c88c093f695efd34be1fddb2b1efbe31965b11
refs/heads/master
2022-02-26T17:29:40.332310
2020-02-28T14:16:16
2020-02-28T14:16:16
243,769,144
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package ru.example.storage.to; import lombok.Data; import ru.example.storage.model.Box; import ru.example.storage.model.Item; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; // Вспомогательный dto, для того, чтобы десериализовать XML @Data @XmlRootElement(name = "Storage") @XmlAccessorType(XmlAccessType.FIELD) public class Storage { @XmlElement(name = "Item", required = false) private Item[] items; @XmlElement(name = "Box", required = false) private Box[] box; }
[ "dummy.newmailbox@gmail.com" ]
dummy.newmailbox@gmail.com
054d845f8a9b7fee9b6f636723218effebd6b56a
f4999995e75d4a249ef54fcfa5eb2a4a7f384c04
/PerfectDay/src/main/java/com/perfectday/legacy/WalkingActivity.java
7753239aa9645f779777dba8682f5983fae73d8d
[]
no_license
bomendez/bomendez.github.io
29babe6cd6f91c573bb4685cae956b2a520bc971
37c8437631ee6af94964493b3f68c926012985ec
refs/heads/master
2021-11-17T15:45:40.487929
2021-10-04T21:31:06
2021-10-04T21:31:06
159,450,249
0
0
null
null
null
null
UTF-8
Java
false
false
240
java
package com.perfectday.legacy; import org.springframework.stereotype.Component; @Component public final class WalkingActivity extends SteppedActivity implements IWalkingActivity { public WalkingActivity() { super("walking"); } }
[ "mendez.bo@husky.neu.edu" ]
mendez.bo@husky.neu.edu
75337973c7440ec77d87d987fe74a8a1cc274ef2
1be7126e8746baae9d3dd8112a53afbd5890df89
/osdu-r2/os-qa/src/test/java/com/osdu/auth/GoogleToken.java
6df7f2d62128fede5a5f0c4e24fa46d3d8d65635
[ "Apache-2.0" ]
permissive
google/framework-for-osdu
ae94a01943aa3298dd6f0ccda2fc64196bc2e1f4
73870a7dee903d4ec50d16b3f84fce6ca592d71d
refs/heads/master
2023-08-31T00:58:34.236993
2021-12-16T19:43:03
2021-12-16T19:43:03
224,537,036
17
7
Apache-2.0
2023-07-22T22:51:43
2019-11-28T00:00:29
Java
UTF-8
Java
false
false
2,020
java
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.osdu.auth; import com.codeborne.selenide.Configuration; import com.codeborne.selenide.WebDriverRunner; import com.osdu.core.data.provider.DataProviders; import com.osdu.core.pages.GoogleLoginPage; import com.osdu.core.pages.GoogleProviderPage; import io.qameta.allure.Description; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.util.Map; import static com.codeborne.selenide.Condition.visible; import static com.codeborne.selenide.Selenide.open; import static com.osdu.core.utils.helper.EnvironmentVariableReceiver.*; public class GoogleToken { GoogleLoginPage loginPage = new GoogleLoginPage(); GoogleProviderPage providerPage = new GoogleProviderPage(); final String PAGE_URL = getTokenPage(); @BeforeClass public void startBrowser(){ Configuration.browser = "chrome"; open(PAGE_URL); } @Test(dataProvider = "testedData", dataProviderClass = DataProviders.class) @Description("Login to the account and receive token") public void getToken(Map<String,String> data) { providerPage.getGoogleProvider().shouldBe(visible).click(); loginPage.doLogin(getGoogleLogin(), getGooglePassword()); //todo: //get token //save token } @AfterClass public void tearDown() { WebDriverRunner.getWebDriver().close(); } }
[ "bhamz@softserveinc.com" ]
bhamz@softserveinc.com
a4ff024bed63c59df4af89869efd5affe5735768
ec994def85813d5c52445e5c7da691d8e35e371a
/src/rats/SelecaoArquivos.java
c4d024e8fc480242888c2c9ba7af1e9752b9f01a
[]
no_license
MaylonFelix/Rats
2d86c060fba0b3384fe70d32ee9ea149796422c3
6a1e04711db1e1e40ea73458861a74a4935e80d8
refs/heads/master
2021-01-02T08:47:43.708567
2014-02-19T16:36:10
2014-02-19T16:36:10
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,822
java
package rats; import java.awt.BorderLayout; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; public class SelecaoArquivos extends JFrame{ private static final long serialVersionUID = 1L; private JTextArea outputArea; private JScrollPane scrollPane; public SelecaoArquivos(){ super("Seleçao de arquivos"); outputArea = new JTextArea(); scrollPane = new JScrollPane(outputArea); add(scrollPane, BorderLayout.CENTER); setSize(400,400); setVisible(true); analyzePath(); } private void analyzePath() { File[] name = getFileDirectory(); outputArea.setText(String.format("%s\n%s\n",name[0].getName(),name[1].getName())); Arquivo arquivos = new Arquivo(); arquivos.lerArquivos(name[0].getPath(), name[1].getPath()); arquivos.encontrarElementos(); } // /* if(name.exists()){ outputArea.setText(String.format("%s%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", name.getName(), " existe.", (name.isFile()?"É um arquivo.":"Não é um arquivo."), name.getPath(), (name.isDirectory()?"É um diretório":"Não é um diretório"), "AsolutePath: ",name.getAbsolutePath(), (name.isAbsolute()?"É um caminho absoluto.":"Não é um caminho absoluto."), name.lastModified(), "Parent: ", name.getParent()) ); if(name.isDirectory()){ String[] directory = name.list(); outputArea.append("\n\nDirectory contents:\n"); for(String directoryName : directory) outputArea.append(directoryName+"\n"); } //else{ // JOptionPane.showMessageDialog(this, name+" does not exist.", "ERROR", JOptionPane.ERROR_MESSAGE); //} } } */ private File[] getFileDirectory(){ JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); File files[] = new File[2]; int result; result = fileChooser.showOpenDialog(this); if(result == JFileChooser.CANCEL_OPTION) System.exit(1); files[0] = fileChooser.getSelectedFile(); result = fileChooser.showOpenDialog(this); if(result == JFileChooser.CANCEL_OPTION) System.exit(1); files[1] = fileChooser.getSelectedFile(); if((files[0] == null) || (files[0].getName().equals(""))||(files[1] == null) || (files[1].getName().equals(""))){ JOptionPane.showMessageDialog(this, "Nome Inválido", "Nome Inválido", JOptionPane.ERROR_MESSAGE); System.exit(1); } return files; } /*public String getNomeDoArquivo() { return this.getFileDirectory().getAbsolutePath(); } /*public void setNomeDoArquivo(String nomeDoArquivo) { this.nomeDoArquivo = nomeDoArquivo; }*/ }
[ "maylon.brito@DEV14.pix.com.br" ]
maylon.brito@DEV14.pix.com.br
cd7ecf0d62a615b7ef7b3eb55ced75e04942e9a1
762a23363fce76a2d26dd7c3f694b5ab981ff1c5
/src/main/java/com/pactera/common/result/IErrorCode.java
9678dbda292fa44605ddec9a27b760cd45dd2a43
[]
no_license
chenpan19941104/glzh-common
a42a58f716747d4fa5c15ba8506d839a108e4cd0
ab2ee669f23813d6145b98cdd294aed40fe0257b
refs/heads/dev
2023-04-16T20:33:39.679259
2020-05-08T08:34:44
2020-05-08T08:34:44
262,269,980
0
0
null
2021-04-26T20:15:30
2020-05-08T08:35:18
Java
UTF-8
Java
false
false
181
java
package com.pactera.common.result; /** * 封装API的错误码 * Created by macro on 2019/4/19. */ public interface IErrorCode { int getCode(); String getMessage(); }
[ "qimeng@gaolvgo.com" ]
qimeng@gaolvgo.com
8cdd24dcf407924ae2e397db482a2bc83935ad65
eeef7a2d11061cbd2823c3d4191cec229d1bdccb
/src/main/java/com/example/tdd/Base64Tool.java
ceb503fd0c141a84c17596404804dfa0d6876c85
[]
no_license
lanpoyuling/TDD
63c43a0c8a94dd9feddfd66a39bf3296a4bcf1c6
c7277b824bfc3ef500d021bb4cd16df294f99fda
refs/heads/master
2023-07-27T09:07:06.186365
2021-08-16T01:58:59
2021-08-16T01:58:59
381,275,330
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package com.example.tdd; import org.springframework.stereotype.Component; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Base64; /** * @ClassName Base64Tool * @Description Base64工具类 * @Author 10932 * @Date 8/8/2021 9:54 AM **/ @Component public class Base64Tool { public String encryptToBase64(String filePath) throws IOException { if (null == filePath) { return null; } byte[] bytes = Files.readAllBytes(Paths.get(filePath)); return Base64.getEncoder().encodeToString(bytes); } public byte[] decode(String base64) { return Base64.getDecoder().decode(base64); } }
[ "1093221911@qq.com" ]
1093221911@qq.com
8d5b02be11a7c06430102772a7018bd70d3ed614
c0833515312e6471fa8fda1c7fd01791ea018d07
/src/main/java/sai/springpoc/controller/AppController.java
6e33a7f1ca8440371e2bae35237234c5d0cac4d0
[]
no_license
narayan-sambireddy/spring-app-with-vmargs
f1dd27b7a29c2be35cfd1eca36118a4666694c43
5efaf976cf7fb215fc7411cfa33821ab10d8fb54
refs/heads/master
2020-03-26T06:40:54.031209
2018-08-13T18:21:52
2018-08-13T18:21:52
144,616,677
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package sai.springpoc.controller; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class AppController { private static boolean available; public AppController(Environment environment) { // will read the VM arg passed as -Davailabile=true and returns the value, // in case if the VM arg is not passed, then defaults to false available = Boolean.valueOf(environment.getProperty("available", "false")); } @GetMapping("/checkAvailability") public Boolean isAvailable() { return available; } }
[ "narayan-sambireddy@outlook.com" ]
narayan-sambireddy@outlook.com
101c2ca034fa40337b97de931eee8e383108a2d2
6e485e1fb06a2e920c73932819d783a413a1be54
/com.ranial.parent/com.ranial.api/src/main/java/com/ranial/api/usb/UsbDeviceRemovedEvent.java
871ba56203afe319df149ebe65871d9357980301
[]
no_license
ajoyacharyya/iot_ranial_mw
2af11f877d275d645fe306ea9aa3c015aa1e90eb
67633963dc5f1c0774f988095b336a064baf1d03
refs/heads/master
2021-01-10T18:50:02.200961
2016-04-20T08:17:41
2016-04-20T08:17:41
56,657,923
0
0
null
null
null
null
UTF-8
Java
false
false
2,581
java
/******************************************************************************* * Copyright (c) 2011, 2016 Eurotech and/or its affiliates * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eurotech *******************************************************************************/ package com.ranial.api.usb; import java.util.Map; import org.osgi.service.event.Event; /** * An event raised when a USB device has been removed from the system. */ public class UsbDeviceRemovedEvent extends Event implements UsbDeviceEvent { /** Topic of the UsbDeviceRemovedEvent */ public static final String USB_EVENT_DEVICE_REMOVED_TOPIC = "org/eclipse/kura/usb/NetworkEvent/device/REMOVED"; public UsbDeviceRemovedEvent(Map<String, ?> properties) { super(USB_EVENT_DEVICE_REMOVED_TOPIC, properties); } /** * Returns the name of the USB port. * @return */ public String getUsbPort() { return (String) getProperty(USB_EVENT_USB_PORT_PROPERTY); } /** * Returns the name of the USB resource associated with this device. * @return */ public String getUsbResource() { return (String) getProperty(USB_EVENT_RESOURCE_PROPERTY); } /** * Returns the name of the USB vendor ID associated with this device. * @return */ public String getUsbVendorId() { return (String) getProperty(USB_EVENT_VENDOR_ID_PROPERTY); } /** * Returns the name of the USB product ID associated with this device. * @return */ public String getUsbProductId() { return (String) getProperty(USB_EVENT_PRODUCT_ID_PROPERTY); } /** * Returns the name of the USB manufacturer name associated with this device. * @return */ public String getUsbManufacturerName() { return (String) getProperty(USB_EVENT_MANUFACTURER_NAME_PROPERTY); } /** * Returns the name of the USB product name associated with this device. * @return */ public String getUsbProductName() { return (String) getProperty(USB_EVENT_PRODUCT_NAME_PROPERTY); } /** * Returns the name of the USB bus number associated with this device. * @return */ public String getUsbBusNumber() { return (String) getProperty(USB_EVENT_BUS_NUMBER_PROPERTY); } /** * Returns the name of the USB device path associated with this device. * @return */ public String getUsbDevicePath() { return (String) getProperty(USB_EVENT_DEVICE_PATH_PROPERTY); } }
[ "ajoy.acharyya@gmail.com" ]
ajoy.acharyya@gmail.com
dcb9d36708f6465d5be3becb1f4d2d8c2f37a970
f95aca03272aaed5528899cb2325d51adc3688b1
/Verifica/src/ElencoPersona.java
3d4ca36cc2ea118136114142f9afb0ae0e589816
[]
no_license
marziabat/BattaglioMarziaVerifica
917b8f09a0ef465d7aff6770392f0f79ecf32fae
fbf9cf082de9e8d3611ebca70d01fd43a379e822
refs/heads/master
2023-03-12T13:06:02.371119
2021-03-03T08:47:05
2021-03-03T08:47:05
344,031,512
0
0
null
null
null
null
UTF-8
Java
false
false
2,190
java
import java.awt.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; public class ElencoPersona extends ArrayList<Persona> implements Serializable{ public void serializza(JFrame j) throws Exception{ ObjectOutputStream o= null; try { JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("generico", "dat"); chooser.setFileFilter(filter); int i = chooser.showSaveDialog(j); if(i == chooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); f.createNewFile(); o = new ObjectOutputStream(new FileOutputStream(f)); o.writeObject(this); o.flush(); } }catch(Exception e) { throw new Exception(); }finally { try { if(o != null) { o.close(); } }catch (IOException ex) { ex.printStackTrace(); } } } public void deserializza(JFrame j) { ObjectInputStream o = null; try { JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter ("generico", "dat"); chooser.setFileFilter(filter); int i = chooser.showOpenDialog(j); if(i == chooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); if(f.exists()) { o = new ObjectInputStream(new FileInputStream(f)); ElencoPersona ep = (ElencoPersona)o.readObject(); for(i = 0; i<ep.size(); i++) { this.add(ep.get(i)); } } } }catch(Exception e) { JOptionPane.showMessageDialog(null, e.getMessage(), "errore", JOptionPane.ERROR_MESSAGE); }finally { if(o != null) { try { o.close(); }catch(IOException e1) { e1.printStackTrace(); } } } } public ArrayList<String> elencoStringhe(){ ArrayList<String> a = new ArrayList<String>(); for(int i = 0; i<a.size(); i++) { a.add(this.get(i).toString()); } return a; } }
[ "Marzia Battaglio@LAPTOP-GVLRLNQC" ]
Marzia Battaglio@LAPTOP-GVLRLNQC
abb6604d76ca8a68bcc5588592da14b928619c44
86e30c68949400e1841cc7d4fb7f6e0d38cc2c8a
/service-registry/src/main/java/de/evoila/osb/service/registry/web/controller/RegistryController.java
24fddff958efb2ca7314fa4d3860b1e631e1003e
[ "Apache-2.0" ]
permissive
evoila/osb-service-registry
41ff6b488e76840258399756f12647c23564a93e
fee928f890765fa701d1da2dd255c1d76938100c
refs/heads/master
2021-06-29T16:26:12.570898
2020-06-29T11:08:41
2020-06-29T11:08:41
162,724,167
0
1
Apache-2.0
2020-10-13T11:22:59
2018-12-21T14:36:39
Java
UTF-8
Java
false
false
628
java
package de.evoila.osb.service.registry.web.controller; import de.evoila.osb.service.registry.web.bodies.SimpleResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class RegistryController extends BaseController { @GetMapping(value = "/status") public ResponseEntity<?> status() throws Exception { return new ResponseEntity<SimpleResponse>(new SimpleResponse("Service Registry is running."), HttpStatus.OK); } }
[ "mberger@evoila.de" ]
mberger@evoila.de
8704f26716fc83e93650587cfffc38d068ed1e5a
eb2b2ca3273b3cf600ffbdf28df5f5f90cb5bad6
/src/test/java/models/PatientTest.java
c2861c1e11763ae7a1efe79980a550a41a9fc570
[]
no_license
Andrew614/hospital-project
08579cb69cb5cde20a3ab3ed777620df947d4e33
b4c37198cd6af565eb6aad03ed2d3578a30cadc3
refs/heads/master
2020-05-25T07:48:25.280418
2019-06-14T04:00:20
2019-06-14T04:00:20
187,694,061
1
0
null
2019-06-14T04:00:21
2019-05-20T18:33:56
Java
UTF-8
Java
false
false
1,012
java
package models; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import org.junit.Test; import models.Patient; public class PatientTest { Patient patient = new Patient("John"); @Test public void shouldHaveNameOfJohn() { assertThat(patient.getName(), is("John")); } @Test public void shouldHaveBloodAndHealthLevelOf20And10() { assertThat(patient.getBloodLevel(), is(20)); assertThat(patient.getHealthLevel(), is(10)); } @Test public void shouldHaveBloodLevelOf30() { patient.setBloodLevel(51); assertThat(patient.getBloodLevel(), is(30)); } @Test public void shouldHaveBloodLevelOf1() { patient.setBloodLevel(0); assertThat(patient.getBloodLevel(), is(1)); } @Test public void shouldHaveHealthLevelOf51() { patient.setHealthLevel(51); assertThat(patient.getHealthLevel(), is(50)); } @Test public void shouldHaveHealthLevelOf1() { patient.setHealthLevel(0); assertThat(patient.getHealthLevel(), is(1)); } }
[ "azhang213@gmail.com" ]
azhang213@gmail.com
e8dc7d5dc78e4b5a6c1605f29f9a7639225c8ddf
51e3a11de3d3b9a86ed57b5aa11e812a1b9ed465
/src/com/tango/sample/TestSpring.java
90eb2334ce30337ceccea2012a0185edec54241a
[]
no_license
rockycoder/TryMeRepo
3205376855ee69bb7d8b09109dbd790cb88e6ea7
aaf0d9cec08c68f3608a4e0ff6d6d8205811d637
refs/heads/master
2021-01-10T05:16:39.931173
2015-06-16T15:14:56
2015-06-16T15:15:09
35,962,745
0
4
null
2015-05-25T18:37:39
2015-05-20T17:20:25
CSS
UTF-8
Java
false
false
977
java
/*package com.tango.sample; import java.util.Date; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.app.Persistance.AbstractDao; import com.app.pojo.Customers; import com.app.pojo.Sample; public class TestSpring { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); AbstractDao dao = (AbstractDao)context.getBean("dao"); Sample sample = new Sample(); Customers cust=new Customers(); //cust.setCustomersId(1); cust.setCustomersFirstname("gaurav"); cust.setCustomersDefaultAddressId(123); cust.setCustomersDob(new Date()); cust.setCustomersEmailAddress("@gmail"); cust.setCustomersGender('m'); cust.setCustomersLastname("manchanda"); cust.setCustomersPassword("hello"); cust.setCustomersTelephone("12121121"); sample.setName("hello"); dao.save(cust); } }*/
[ "gm.gbpec@gmail.com" ]
gm.gbpec@gmail.com
4d596f8072c3e326e8e14137da5c243052b1faef
44530efba39c197f4e91a76e60899aa7d5c74428
/app/src/main/java/com/example/funsdkdemo/lib/funsdk/support/config/DevCmdGeneral.java
8d4b56447f49bd2c91cce4cfcbf1f3165ea5c00f
[]
no_license
AlisLi/MonitoringDemo
921d34edfae8ed73bab9d08cb094f71b417ef649
0606031037a3bd27259ea197b330ad0dfa723da5
refs/heads/master
2021-07-21T11:58:59.202955
2017-11-01T06:07:40
2017-11-01T06:07:40
103,015,382
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package com.example.funsdkdemo.lib.funsdk.support.config; public abstract class DevCmdGeneral extends BaseConfig { public abstract int getJsonID(); }
[ "396063207@qq.com" ]
396063207@qq.com
2065a22710ba047551c806c4a875c862cc155697
eb372aeaa745e2017fdd77d6366b86013b74fdc7
/src/main/java/com/h3project/server/Hexagon.java
068aef339775230dba09dfc9f77bfcc465ca5995
[]
no_license
oguzcanbudumlu/h3project
d4bf63c71d8d284671741b8cfe02e14395708e11
242f645a6b0631b5896ec3400c1b874d3cf43eca
refs/heads/master
2023-08-07T03:06:33.640149
2021-09-16T09:12:54
2021-09-16T09:12:54
403,929,136
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
package com.h3project.server; public class Hexagon { private String hexId; private double pointCountRatio; public Hexagon(String hexId, double pointCountRatio) { this.hexId = hexId; this.pointCountRatio = pointCountRatio; } public String getHexId() { return hexId; } public double getPointCountRatio() { return pointCountRatio; } }
[ "obudumlu@gmail.com" ]
obudumlu@gmail.com