blob_id stringlengths 40 40 | __id__ int64 225 39,780B | directory_id stringlengths 40 40 | path stringlengths 6 313 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_name stringlengths 6 132 | repo_url stringlengths 25 151 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 70 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 7.28k 689M ⌀ | star_events_count int64 0 131k | fork_events_count int64 0 48k | gha_license_id stringclasses 23
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 40.4M ⌀ | gha_stargazers_count int32 0 112k ⌀ | gha_forks_count int32 0 39.4k ⌀ | gha_open_issues_count int32 0 11k ⌀ | gha_language stringlengths 1 21 ⌀ | gha_archived bool 2
classes | gha_disabled bool 1
class | content stringlengths 7 4.37M | src_encoding stringlengths 3 16 | language stringclasses 1
value | length_bytes int64 7 4.37M | extension stringclasses 24
values | filename stringlengths 4 174 | language_id stringclasses 1
value | entities list | contaminating_dataset stringclasses 0
values | malware_signatures list | redacted_content stringlengths 7 4.37M | redacted_length_bytes int64 7 4.37M | alphanum_fraction float32 0.25 0.94 | alpha_fraction float32 0.25 0.94 | num_lines int32 1 84k | avg_line_length float32 0.76 99.9 | std_line_length float32 0 220 | max_line_length int32 5 998 | is_vendor bool 2
classes | is_generated bool 1
class | max_hex_length int32 0 319 | hex_fraction float32 0 0.38 | max_unicode_length int32 0 408 | unicode_fraction float32 0 0.36 | max_base64_length int32 0 506 | base64_fraction float32 0 0.5 | avg_csv_sep_count float32 0 4 | is_autogen_header bool 1
class | is_empty_html bool 1
class | shard stringclasses 16
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
86e7730b76ba621e08cb29fbaa447621cdd85f51 | 36,919,538,897,280 | c00b2a05ca5d4aa83f47fb71cc30ed940d03b48c | /src/main/java/com/singer/vo/CommVo.java | 29ca64c5f1c0b02a44e8c6878567dda80500181f | [] | no_license | choiis/SpringPrivate | https://github.com/choiis/SpringPrivate | d99cb2840fed2ac9a904f42b21934094efe3f94d | 8b53cf0e2c70f7a0b3ee4090df4ecf67effd68b5 | refs/heads/master | 2018-12-19T16:02:09.004000 | 2018-11-01T11:32:05 | 2018-11-01T11:32:05 | 145,229,736 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.singer.vo;
import java.util.List;
public class CommVo extends SuperVo {
private String codecd;
private String codenm;
private String codegrp;
private String username;
private String regdate;
private String reguser;
private String menucd;
private String menunm;
private String menuurl;
private String authlevel;
private String moduser;
private String moddate;
private String codegrpnm;
private String password;
private String errorCode;
private String errorMsg;
private List<CommVo> commList;
public CommVo() {
super();
}
public CommVo(String codecd, String codenm, String codegrp, String username, String regdate, String reguser,
String menucd, String menunm, String menuurl, String authlevel, String moduser, String moddate,
String codegrpnm, String password, String errorCode, String errorMsg, List<CommVo> commList) {
super();
this.codecd = codecd;
this.codenm = codenm;
this.codegrp = codegrp;
this.username = username;
this.regdate = regdate;
this.reguser = reguser;
this.menucd = menucd;
this.menunm = menunm;
this.menuurl = menuurl;
this.authlevel = authlevel;
this.moduser = moduser;
this.moddate = moddate;
this.codegrpnm = codegrpnm;
this.password = password;
this.errorCode = errorCode;
this.errorMsg = errorMsg;
this.commList = commList;
}
public String getCodecd() {
return codecd;
}
public void setCodecd(String codecd) {
this.codecd = codecd;
}
public String getCodenm() {
return codenm;
}
public void setCodenm(String codenm) {
this.codenm = codenm;
}
public String getCodegrp() {
return codegrp;
}
public void setCodegrp(String codegrp) {
this.codegrp = codegrp;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getRegdate() {
return regdate;
}
public void setRegdate(String regdate) {
this.regdate = regdate;
}
public String getReguser() {
return reguser;
}
public void setReguser(String reguser) {
this.reguser = reguser;
}
public String getMenucd() {
return menucd;
}
public void setMenucd(String menucd) {
this.menucd = menucd;
}
public String getMenunm() {
return menunm;
}
public void setMenunm(String menunm) {
this.menunm = menunm;
}
public String getMenuurl() {
return menuurl;
}
public void setMenuurl(String menuurl) {
this.menuurl = menuurl;
}
public String getAuthlevel() {
return authlevel;
}
public void setAuthlevel(String authlevel) {
this.authlevel = authlevel;
}
public String getModuser() {
return moduser;
}
public void setModuser(String moduser) {
this.moduser = moduser;
}
public String getModdate() {
return moddate;
}
public void setModdate(String moddate) {
this.moddate = moddate;
}
public String getCodegrpnm() {
return codegrpnm;
}
public void setCodegrpnm(String codegrpnm) {
this.codegrpnm = codegrpnm;
}
public List<CommVo> getCommList() {
return commList;
}
public void setCommList(List<CommVo> commList) {
this.commList = commList;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
@Override
public String toString() {
return "CommVo [codecd=" + codecd + ", codenm=" + codenm + ", codegrp=" + codegrp + ", username=" + username
+ ", regdate=" + regdate + ", reguser=" + reguser + ", menucd=" + menucd + ", menunm=" + menunm
+ ", menuurl=" + menuurl + ", authlevel=" + authlevel + ", moduser=" + moduser + ", moddate=" + moddate
+ ", codegrpnm=" + codegrpnm + ", password=" + password + ", errorCode=" + errorCode + ", errorMsg="
+ errorMsg + ", commList=" + commList + "]";
}
} | UTF-8 | Java | 4,024 | java | CommVo.java | Java | [
{
"context": "odenm;\n\t\tthis.codegrp = codegrp;\n\t\tthis.username = username;\n\t\tthis.regdate = regdate;\n\t\tthis.reguser = regus",
"end": 993,
"score": 0.9993433356285095,
"start": 985,
"tag": "USERNAME",
"value": "username"
},
{
"context": "e;\n\t\tthis.codegrpnm = codegrpnm;... | null | [] | package com.singer.vo;
import java.util.List;
public class CommVo extends SuperVo {
private String codecd;
private String codenm;
private String codegrp;
private String username;
private String regdate;
private String reguser;
private String menucd;
private String menunm;
private String menuurl;
private String authlevel;
private String moduser;
private String moddate;
private String codegrpnm;
private String password;
private String errorCode;
private String errorMsg;
private List<CommVo> commList;
public CommVo() {
super();
}
public CommVo(String codecd, String codenm, String codegrp, String username, String regdate, String reguser,
String menucd, String menunm, String menuurl, String authlevel, String moduser, String moddate,
String codegrpnm, String password, String errorCode, String errorMsg, List<CommVo> commList) {
super();
this.codecd = codecd;
this.codenm = codenm;
this.codegrp = codegrp;
this.username = username;
this.regdate = regdate;
this.reguser = reguser;
this.menucd = menucd;
this.menunm = menunm;
this.menuurl = menuurl;
this.authlevel = authlevel;
this.moduser = moduser;
this.moddate = moddate;
this.codegrpnm = codegrpnm;
this.password = <PASSWORD>;
this.errorCode = errorCode;
this.errorMsg = errorMsg;
this.commList = commList;
}
public String getCodecd() {
return codecd;
}
public void setCodecd(String codecd) {
this.codecd = codecd;
}
public String getCodenm() {
return codenm;
}
public void setCodenm(String codenm) {
this.codenm = codenm;
}
public String getCodegrp() {
return codegrp;
}
public void setCodegrp(String codegrp) {
this.codegrp = codegrp;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getRegdate() {
return regdate;
}
public void setRegdate(String regdate) {
this.regdate = regdate;
}
public String getReguser() {
return reguser;
}
public void setReguser(String reguser) {
this.reguser = reguser;
}
public String getMenucd() {
return menucd;
}
public void setMenucd(String menucd) {
this.menucd = menucd;
}
public String getMenunm() {
return menunm;
}
public void setMenunm(String menunm) {
this.menunm = menunm;
}
public String getMenuurl() {
return menuurl;
}
public void setMenuurl(String menuurl) {
this.menuurl = menuurl;
}
public String getAuthlevel() {
return authlevel;
}
public void setAuthlevel(String authlevel) {
this.authlevel = authlevel;
}
public String getModuser() {
return moduser;
}
public void setModuser(String moduser) {
this.moduser = moduser;
}
public String getModdate() {
return moddate;
}
public void setModdate(String moddate) {
this.moddate = moddate;
}
public String getCodegrpnm() {
return codegrpnm;
}
public void setCodegrpnm(String codegrpnm) {
this.codegrpnm = codegrpnm;
}
public List<CommVo> getCommList() {
return commList;
}
public void setCommList(List<CommVo> commList) {
this.commList = commList;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
@Override
public String toString() {
return "CommVo [codecd=" + codecd + ", codenm=" + codenm + ", codegrp=" + codegrp + ", username=" + username
+ ", regdate=" + regdate + ", reguser=" + reguser + ", menucd=" + menucd + ", menunm=" + menunm
+ ", menuurl=" + menuurl + ", authlevel=" + authlevel + ", moduser=" + moduser + ", moddate=" + moddate
+ ", codegrpnm=" + codegrpnm + ", password=" + <PASSWORD> + ", errorCode=" + errorCode + ", errorMsg="
+ errorMsg + ", commList=" + commList + "]";
}
} | 4,028 | 0.694831 | 0.694831 | 213 | 17.896713 | 21.275934 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.535211 | false | false | 6 |
506ca7051592e0b7148679cbc26bc8010479a78b | 36,043,365,579,832 | 02a1c706c1971a1ea6d1bf4913463b62ecde6b18 | /persistence/src/main/java/com/digdes/rst/orgstructure/persistance/model/DivisionPerson.java | f87db3e5cd8e32ae5c19841839da19058f667779 | [] | no_license | finno777/AppOrgStructure | https://github.com/finno777/AppOrgStructure | bac9545fc4953bcdb9b8af01dd1245aafb0bfaab | cfb9d0035c8f854c9e87d5a3235ad3b4329161cb | refs/heads/master | 2021-04-29T22:27:23.628000 | 2018-02-15T14:28:17 | 2018-02-15T14:28:17 | 121,638,995 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.digdes.rst.orgstructure.persistance.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.persistence.*;
@ApiModel(value="DivisionPerson", description="Сотрудник отдела")
@Data
@NoArgsConstructor
@Entity
public class DivisionPerson {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("Участник")
@ManyToOne
private Person person;
@ApiModelProperty("Отдел")
@ManyToOne
@JsonIgnoreProperties(value = { "personList" })
private Division division;
@ApiModelProperty("Должность")
private String position;
@Override
public String toString() {
return "DivisionPerson{" +
"id=" + id +
", person=" + person +
", division={id=" + division.getId() + "}" +
", position='" + position + '\'' +
'}';
}
}
| UTF-8 | Java | 1,206 | java | DivisionPerson.java | Java | [] | null | [] | package com.digdes.rst.orgstructure.persistance.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.persistence.*;
@ApiModel(value="DivisionPerson", description="Сотрудник отдела")
@Data
@NoArgsConstructor
@Entity
public class DivisionPerson {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("Участник")
@ManyToOne
private Person person;
@ApiModelProperty("Отдел")
@ManyToOne
@JsonIgnoreProperties(value = { "personList" })
private Division division;
@ApiModelProperty("Должность")
private String position;
@Override
public String toString() {
return "DivisionPerson{" +
"id=" + id +
", person=" + person +
", division={id=" + division.getId() + "}" +
", position='" + position + '\'' +
'}';
}
}
| 1,206 | 0.668092 | 0.668092 | 44 | 25.568182 | 19.063766 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.409091 | false | false | 6 |
9c0f05f1c54402dcdccd9ddf3d59a8a272721f93 | 26,809,185,924,313 | 8776746bad43123c1876222f98e13bdb850ace67 | /src/main/java/cn/admin/getData/service/GetDataService.java | 11f7841ce6c8d4d59982c2ce3529caca29493b12 | [] | no_license | wangyuelei521/E-zine | https://github.com/wangyuelei521/E-zine | 0ccf78c673fb7aac314f26813eae0d95f6cee984 | 16b05ea87205753152b91db63dc93f5ccaeda4b7 | refs/heads/master | 2020-04-01T01:47:51.219000 | 2018-10-12T13:16:31 | 2018-10-12T13:16:31 | 152,598,495 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.admin.getData.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.util.DataConvert;
import cn.util.HttpUtils;
import cn.util.Tools;
@Service
public class GetDataService {
@Autowired
SqlSessionFactory sqlSessionFactory;
@Autowired
SqlSession sqlSession;
/**
* 获取刊物列表
*/
@Transactional
public void GetData() {
//获取刊物信息
getPublicationList();
//获取刊物下的期次信息
getIssueList();
//获取板块信息
getCategoryList();
//获取版面信息
getColumnsList();
}
//获取刊物信息
@Transactional
public void getPublicationList() {
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetPublicationList";
String data = HttpUtils.httpPostSend(url);
List<Map<String,Object>> list = Tools.JsonTolist(data);
List<Map<String,Object>> datalist = new ArrayList<Map<String,Object>>();
for (Map<String, Object> map : list) {
Map<String, Object> dataMap = new HashMap<String,Object>();
if(DataConvert.ToString(map.get("PublicationName")).contains("四川教育")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 1);
}else if(DataConvert.ToString(map.get("PublicationName")).contains("教育导报")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 2);
datalist.add(dataMap);
}else if(DataConvert.ToString(map.get("PublicationName")).contains("少年百科知识报")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 3);
datalist.add(dataMap);
}
}
//循环插入数据
for (Map<String, Object> map : datalist) {
//先查询是否有该数据,如果没有则插入到库中
Map maps = sqlSession.selectOne("getdataDao.selData", map);
if(maps==null||maps.isEmpty()) {
//获取刊物详情
String publicationDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetPublicationByID&PublicationID="+map.get("PublicationID"));
Map<String, Object> jsonToMap = Tools.JsonToMap(publicationDetail);
map.put("ProcessID", DataConvert.ToString(jsonToMap.get("ProcessID")));
map.put("OrderNo", DataConvert.ToString(jsonToMap.get("OrderNo")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 1);
}else {
map.put("IsDeleted", 0);
}
sqlSession.insert("getdataDao.insertPublication", map);
System.out.println("Ok");
}
}
}
//获取期次信息
@Transactional
public void getIssueList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueList&PublicationID=";
//四川教育期次
String sichuanissue = HttpUtils.httpPostSend(url+"21");
List<Map<String,Object>> sichuanlist = Tools.JsonTolist(sichuanissue);
//循环插入四川教育期次
for (Map<String, Object> map : sichuanlist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
//教育导报
String educationissue = HttpUtils.httpPostSend(url+"29");
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(educationissue);
//循环插入
for (Map<String, Object> map : jsonTolist) {
if(map!=null){
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
if(jsonToMap!=null){
map.put("PublicationID", DataConvert.ToInteger(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
}else{
System.out.println(issueDetail);
}
System.out.println(map);
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
if(doclist!=null){
List<Map<String,Object>> jsonTolist2 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist2) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = "";
if(map2!=null){
docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
}
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
if(jsonToMap!=null){
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
}
System.out.println(jsonToMap);
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
}
}
//少年知识百科报高年级版
String Seniorgrade = HttpUtils.httpPostSend(url+"24");
List<Map<String,Object>> Seniorgradelist = Tools.JsonTolist(Seniorgrade);
//循环插入
for (Map<String, Object> map : Seniorgradelist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist3 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist3) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
//少年知识百科报童心乐园版
String juvenile = HttpUtils.httpPostSend(url+"25");
List<Map<String,Object>> juvenilelist = Tools.JsonTolist(juvenile);
//循环插入
for (Map<String, Object> map : juvenilelist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist4 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist4) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
}
//获取板块信息
@Transactional
public void getCategoryList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetCategoryList&PublicationID=";
//教育导报
String daobao = HttpUtils.httpPostSend(url+"29");
List<Map<String,Object>> daobaolist = Tools.JsonTolist(daobao);
for (Map<String, Object> map : daobaolist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 29);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
//少年知识百科报 高年级
String grade = HttpUtils.httpPostSend(url+"24");
List<Map<String,Object>> gradelist = Tools.JsonTolist(grade);
for (Map<String, Object> map : gradelist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 24);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
//少年知识百科报 童心乐园版
String juvenile = HttpUtils.httpPostSend(url+"25");
List<Map<String,Object>> juvenilelist = Tools.JsonTolist(juvenile);
for (Map<String, Object> map : juvenilelist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 25);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
}
//获取版面信息
@Transactional
public void getColumnsList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetColumnList&CategoryID=";
//查询所有版块
List<Map> list = sqlSession.selectList("getdataDao.selectCategoryList");
for (Map map : list) {
//获取版面信息columns
String columns = HttpUtils.httpPostSend(url+DataConvert.ToString(map.get("CategoryID")));
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(columns);
//循环获取的版面
for (Map<String, Object> map2 : jsonTolist) {
//查询是否存在
Map maps = sqlSession.selectOne("getdataDao.selColumns", map2);
if(maps==null||maps.isEmpty()) {
//获取版面的详细信息
String columnsDeatil = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetColumnByID&ColumnID="+DataConvert.ToString(map2.get("ColumnID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(columnsDeatil);
map2.put("CategoryID", DataConvert.ToInteger(jsonToMap.get("CategoryID")));
map2.put("PublicationID", DataConvert.ToInteger(jsonToMap.get("PublicationID")));
map2.put("OrderNo", DataConvert.ToInteger(jsonToMap.get("OrderNo")));
map2.put("Remark", DataConvert.ToString(jsonToMap.get("Remark")));
map2.put("Years", DataConvert.ToString(jsonToMap.get("Years")));
sqlSession.insert("getdataDao.insertColumns", map2);
}
}
}
}
public void getImg(){
String columnsDeatil = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID=290");
Map<String, Object> jsonToMap = Tools.JsonToMap(columnsDeatil);
System.out.println(jsonToMap);
}
}
| UTF-8 | Java | 14,534 | java | GetDataService.java | Java | [] | null | [] | package cn.admin.getData.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.util.DataConvert;
import cn.util.HttpUtils;
import cn.util.Tools;
@Service
public class GetDataService {
@Autowired
SqlSessionFactory sqlSessionFactory;
@Autowired
SqlSession sqlSession;
/**
* 获取刊物列表
*/
@Transactional
public void GetData() {
//获取刊物信息
getPublicationList();
//获取刊物下的期次信息
getIssueList();
//获取板块信息
getCategoryList();
//获取版面信息
getColumnsList();
}
//获取刊物信息
@Transactional
public void getPublicationList() {
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetPublicationList";
String data = HttpUtils.httpPostSend(url);
List<Map<String,Object>> list = Tools.JsonTolist(data);
List<Map<String,Object>> datalist = new ArrayList<Map<String,Object>>();
for (Map<String, Object> map : list) {
Map<String, Object> dataMap = new HashMap<String,Object>();
if(DataConvert.ToString(map.get("PublicationName")).contains("四川教育")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 1);
}else if(DataConvert.ToString(map.get("PublicationName")).contains("教育导报")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 2);
datalist.add(dataMap);
}else if(DataConvert.ToString(map.get("PublicationName")).contains("少年百科知识报")) {
dataMap.put("PublicationID",DataConvert.ToDouble(map.get("PublicationID")).intValue());
dataMap.put("PublicationName", DataConvert.ToString(map.get("PublicationName")));
dataMap.put("publicationType", 3);
datalist.add(dataMap);
}
}
//循环插入数据
for (Map<String, Object> map : datalist) {
//先查询是否有该数据,如果没有则插入到库中
Map maps = sqlSession.selectOne("getdataDao.selData", map);
if(maps==null||maps.isEmpty()) {
//获取刊物详情
String publicationDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetPublicationByID&PublicationID="+map.get("PublicationID"));
Map<String, Object> jsonToMap = Tools.JsonToMap(publicationDetail);
map.put("ProcessID", DataConvert.ToString(jsonToMap.get("ProcessID")));
map.put("OrderNo", DataConvert.ToString(jsonToMap.get("OrderNo")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 1);
}else {
map.put("IsDeleted", 0);
}
sqlSession.insert("getdataDao.insertPublication", map);
System.out.println("Ok");
}
}
}
//获取期次信息
@Transactional
public void getIssueList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueList&PublicationID=";
//四川教育期次
String sichuanissue = HttpUtils.httpPostSend(url+"21");
List<Map<String,Object>> sichuanlist = Tools.JsonTolist(sichuanissue);
//循环插入四川教育期次
for (Map<String, Object> map : sichuanlist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
//教育导报
String educationissue = HttpUtils.httpPostSend(url+"29");
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(educationissue);
//循环插入
for (Map<String, Object> map : jsonTolist) {
if(map!=null){
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
if(jsonToMap!=null){
map.put("PublicationID", DataConvert.ToInteger(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
}else{
System.out.println(issueDetail);
}
System.out.println(map);
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
if(doclist!=null){
List<Map<String,Object>> jsonTolist2 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist2) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = "";
if(map2!=null){
docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
}
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
if(jsonToMap!=null){
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
}
System.out.println(jsonToMap);
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
}
}
//少年知识百科报高年级版
String Seniorgrade = HttpUtils.httpPostSend(url+"24");
List<Map<String,Object>> Seniorgradelist = Tools.JsonTolist(Seniorgrade);
//循环插入
for (Map<String, Object> map : Seniorgradelist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist3 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist3) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
//少年知识百科报童心乐园版
String juvenile = HttpUtils.httpPostSend(url+"25");
List<Map<String,Object>> juvenilelist = Tools.JsonTolist(juvenile);
//循环插入
for (Map<String, Object> map : juvenilelist) {
//先查询数据是否存在,如果不存在则插入
Map maps = sqlSession.selectOne("getdataDao.getIssueData", map);
if(maps==null||maps.isEmpty()) {
String issueDetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetIssueByID&IssueID="+DataConvert.ToString(map.get("IssueID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(issueDetail);
map.put("PublicationID", DataConvert.ToString(jsonToMap.get("PublicationID")));
if(DataConvert.ToBoolean(jsonToMap.get("IsDeleted"))) {
map.put("IsDeleted", 0);
}else {
map.put("IsDeleted", 1);
}
sqlSession.insert("getdataDao.insertIssue", map);
}
//获取对应期次下的文章列表
String doclist = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentListByIssue2&IssueID="+DataConvert.ToString(map.get("IssueID")));
List<Map<String,Object>> jsonTolist4 = Tools.JsonTolist(doclist);
//循环文章列表
for (Map<String, Object> map2 : jsonTolist4) {
//查询文章是否存在
Map ma = sqlSession.selectOne("getdataDao.selDoc", map2);
if(ma==null||ma.isEmpty()) {//不存在,添加
//获取文章详情
String docdetail = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID="+DataConvert.ToString(map2.get("DocID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(docdetail);
map2.put("MainText", DataConvert.ToString(jsonToMap.get("MainText")));
//添加文章
sqlSession.insert("getdataDao.insertDoc", map2);
}
}
}
}
//获取板块信息
@Transactional
public void getCategoryList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetCategoryList&PublicationID=";
//教育导报
String daobao = HttpUtils.httpPostSend(url+"29");
List<Map<String,Object>> daobaolist = Tools.JsonTolist(daobao);
for (Map<String, Object> map : daobaolist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 29);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
//少年知识百科报 高年级
String grade = HttpUtils.httpPostSend(url+"24");
List<Map<String,Object>> gradelist = Tools.JsonTolist(grade);
for (Map<String, Object> map : gradelist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 24);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
//少年知识百科报 童心乐园版
String juvenile = HttpUtils.httpPostSend(url+"25");
List<Map<String,Object>> juvenilelist = Tools.JsonTolist(juvenile);
for (Map<String, Object> map : juvenilelist) {
//查询板块是否存在
Map maps = sqlSession.selectOne("getdataDao.selCategory", map);
if(maps==null||maps.isEmpty()) {
map.put("PublicationID", 25);
sqlSession.insert("getdataDao.insertCategory", map);
}
}
}
//获取版面信息
@Transactional
public void getColumnsList() {
//请求地址
String url = "http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetColumnList&CategoryID=";
//查询所有版块
List<Map> list = sqlSession.selectList("getdataDao.selectCategoryList");
for (Map map : list) {
//获取版面信息columns
String columns = HttpUtils.httpPostSend(url+DataConvert.ToString(map.get("CategoryID")));
List<Map<String,Object>> jsonTolist = Tools.JsonTolist(columns);
//循环获取的版面
for (Map<String, Object> map2 : jsonTolist) {
//查询是否存在
Map maps = sqlSession.selectOne("getdataDao.selColumns", map2);
if(maps==null||maps.isEmpty()) {
//获取版面的详细信息
String columnsDeatil = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetColumnByID&ColumnID="+DataConvert.ToString(map2.get("ColumnID")));
Map<String, Object> jsonToMap = Tools.JsonToMap(columnsDeatil);
map2.put("CategoryID", DataConvert.ToInteger(jsonToMap.get("CategoryID")));
map2.put("PublicationID", DataConvert.ToInteger(jsonToMap.get("PublicationID")));
map2.put("OrderNo", DataConvert.ToInteger(jsonToMap.get("OrderNo")));
map2.put("Remark", DataConvert.ToString(jsonToMap.get("Remark")));
map2.put("Years", DataConvert.ToString(jsonToMap.get("Years")));
sqlSession.insert("getdataDao.insertColumns", map2);
}
}
}
}
public void getImg(){
String columnsDeatil = HttpUtils.httpPostSend("http://jydb.scedumedia.com/DocumentElectronic/api.aspx?action=GetDoucumentByID&DocID=290");
Map<String, Object> jsonToMap = Tools.JsonToMap(columnsDeatil);
System.out.println(jsonToMap);
}
}
| 14,534 | 0.708087 | 0.702479 | 333 | 39.696697 | 39.860733 | 184 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.972973 | false | false | 6 |
56ba96212fdedf53b61fe5e20ba941786b910ad4 | 34,883,724,413,594 | ea175d8d30a3c8566ce62fdd66ac4e7fb7935c37 | /server/src/test/java/com/orientechnologies/orient/server/tx/RemoteTransactionSupportTest.java | 1615a8b1c75e3b32fce6b4d857740ee78519924f | [
"BSD-3-Clause",
"CDDL-1.0",
"Apache-2.0"
] | permissive | orientechnologies/orientdb | https://github.com/orientechnologies/orientdb | a9aa2708e927cfbd8ba479ed1ceabb1979ba9f65 | 7df5ffa9f691ae752a0abdb45ccf93bc8ae8b9a4 | refs/heads/develop | 2023-08-31T12:42:55.842000 | 2023-08-30T13:56:50 | 2023-08-30T13:56:50 | 7,083,240 | 3,932 | 979 | Apache-2.0 | false | 2023-09-11T12:49:58 | 2012-12-09T20:33:47 | 2023-09-10T16:23:29 | 2023-09-11T12:49:56 | 253,324 | 4,633 | 880 | 276 | Java | false | false | package com.orientechnologies.orient.server.tx;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.orientechnologies.common.io.OFileUtils;
import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.OrientDB;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ridbag.ORidBag;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.OEdge;
import com.orientechnologies.orient.core.record.OElement;
import com.orientechnologies.orient.core.record.ORecord;
import com.orientechnologies.orient.core.record.OVertex;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultSet;
import com.orientechnologies.orient.core.storage.ORecordDuplicatedException;
import com.orientechnologies.orient.core.tx.OTransaction;
import com.orientechnologies.orient.server.OClientConnection;
import com.orientechnologies.orient.server.OServer;
import java.io.File;
import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/** Created by tglman on 03/01/17. */
public class RemoteTransactionSupportTest {
private static final String CLASS_1 = "SomeClass";
private static final String CLASS_2 = "AnotherClass";
private static final String EDGE = "SomeEdge";
private static final String FIELD_VALUE = "VALUE";
private static final String SERVER_DIRECTORY = "./target/transaction";
private OServer server;
private OrientDB orientDB;
private ODatabaseDocument database;
@Before
public void before() throws Exception {
OGlobalConfiguration.CLASS_MINIMUM_CLUSTERS.setValue(1);
server = new OServer(false);
server.setServerRootDirectory(SERVER_DIRECTORY);
server.startup(getClass().getResourceAsStream("orientdb-server-config.xml"));
server.activate();
orientDB = new OrientDB("remote:localhost", "root", "root", OrientDBConfig.defaultConfig());
orientDB.execute(
"create database ? memory users (admin identified by 'admin' role admin)",
RemoteTransactionSupportTest.class.getSimpleName());
database = orientDB.open(RemoteTransactionSupportTest.class.getSimpleName(), "admin", "admin");
database.createClass("SomeTx");
database.createClass("SomeTx2");
OClass klass = database.createClass("IndexedTx");
klass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
OClass uniqueClass = database.createClass("UniqueIndexedTx");
uniqueClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);
}
@Test
public void testQueryUpdateUpdatedInTxTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Joe");
OIdentifiable id = database.save(doc);
database.begin();
ODocument doc2 = database.load(id.getIdentity());
doc2.setProperty("name", "Jane");
database.save(doc2);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertEquals((long) result.next().getProperty("count"), 1L);
ODocument doc3 = database.load(id.getIdentity());
assertEquals(doc3.getProperty("name"), "July");
}
@Test
public void testResetUpdatedInTxTransaction() {
database.begin();
ODocument doc1 = new ODocument();
doc1.setProperty("name", "Jane");
database.save(doc1);
ODocument doc2 = new ODocument("SomeTx");
doc2.setProperty("name", "Jane");
database.save(doc2);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertEquals((long) result.next().getProperty("count"), 1L);
assertEquals(doc2.getProperty("name"), "July");
result.close();
}
@Test
public void testQueryUpdateCreatedInTxTransaction() throws InterruptedException {
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
OIdentifiable id = database.save(doc1);
ODocument docx = new ODocument("SomeTx2");
docx.setProperty("name", "Jane");
database.save(docx);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 1L);
ODocument doc2 = database.load(id.getIdentity());
assertEquals(doc2.getProperty("name"), "July");
assertFalse(result.hasNext());
result.close();
}
@Test
public void testRollbackTxTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
database.save(doc1);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 2L);
result.close();
database.rollback();
OResultSet result1 = database.command("select count(*) from SomeTx where name='Jane'");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 1L);
result1.close();
}
@Test
public void testRollbackTxCheckStatusTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
database.save(doc1);
OResultSet result = database.command("select count(*) from SomeTx where name='Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count(*)"), 2L);
assertTrue(database.getTransaction().isActive());
result.close();
database.rollback();
OResultSet result1 = database.command("select count(*) from SomeTx where name='Jane'");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 1L);
assertFalse(database.getTransaction().isActive());
result1.close();
}
@Test
public void testDownloadTransactionAtStart() {
database.begin();
database.command("insert into SomeTx set name ='Jane' ").close();
;
assertEquals(database.getTransaction().getEntryCount(), 1);
}
@Test
public void testQueryUpdateCreatedInTxSQLTransaction() {
database.begin();
database.command("insert into SomeTx set name ='Jane' ").close();
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 1L);
result.close();
OResultSet result1 = database.query("select from SomeTx where name='July'");
assertTrue(result1.hasNext());
assertEquals(result1.next().getProperty("name"), "July");
assertFalse(result.hasNext());
result1.close();
}
@Test
public void testQueryDeleteTxSQLTransaction() {
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
someTx.save();
database.begin();
database.command("delete from SomeTx");
database.commit();
OResultSet result = database.command("select from SomeTx");
assertFalse(result.hasNext());
result.close();
}
@Test
public void testDoubleSaveTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
database.save(someTx);
assertEquals(database.getTransaction().getEntryCount(), 1);
assertEquals(database.countClass("SomeTx"), 1);
database.commit();
assertEquals(database.countClass("SomeTx"), 1);
}
@Test
public void testDoubleSaveDoubleFlushTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
database.save(someTx);
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
database.save(someTx);
database.save(someTx);
result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
assertEquals(database.getTransaction().getEntryCount(), 1);
assertEquals(database.countClass("SomeTx"), 1);
database.commit();
assertEquals(database.countClass("SomeTx"), 1);
}
@Test
public void testRefFlushedInTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
OElement oneMore = database.newElement("SomeTx");
oneMore.setProperty("name", "bar");
oneMore.setProperty("ref", someTx);
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
database.save(oneMore);
database.commit();
OResultSet result1 = database.query("select ref from SomeTx where name='bar'");
assertTrue(result1.hasNext());
assertEquals(someTx.getIdentity(), result1.next().getProperty("ref"));
result1.close();
}
@Test
public void testDoubleRefFlushedInTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
OElement oneMore = database.newElement("SomeTx");
oneMore.setProperty("name", "bar");
oneMore.setProperty("ref", someTx.getIdentity());
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
OElement ref2 = database.newElement("SomeTx");
ref2.setProperty("name", "other");
database.save(ref2);
oneMore.setProperty("ref2", ref2.getIdentity());
result = database.query("select from SomeTx");
assertEquals(2, result.stream().count());
result.close();
database.save(oneMore);
OResultSet result1 = database.query("select ref,ref2 from SomeTx where name='bar'");
assertTrue(result1.hasNext());
OResult next = result1.next();
assertEquals(someTx.getIdentity(), next.getProperty("ref"));
assertEquals(ref2.getIdentity(), next.getProperty("ref2"));
result1.close();
database.commit();
result1 = database.query("select ref,ref2 from SomeTx where name='bar'");
assertTrue(result1.hasNext());
next = result1.next();
assertEquals(someTx.getIdentity(), next.getProperty("ref"));
assertEquals(ref2.getIdentity(), next.getProperty("ref2"));
result1.close();
}
@Test
public void testGenerateIdCounterTransaction() {
database.begin();
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.command("insert into SomeTx set name ='Jane1' ").close();
database.command("insert into SomeTx set name ='Jane2' ").close();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane3");
database.save(doc1);
doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane4");
database.save(doc1);
database.command("insert into SomeTx set name ='Jane2' ").close();
OResultSet result = database.command("select count(*) from SomeTx");
System.out.println(result.getExecutionPlan().toString());
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count(*)"), 6L);
result.close();
assertTrue(database.getTransaction().isActive());
database.commit();
OResultSet result1 = database.command("select count(*) from SomeTx ");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 6L);
result1.close();
assertFalse(database.getTransaction().isActive());
}
@Test
public void testGraphInTx() {
database.createVertexClass("MyV");
database.createEdgeClass("MyE");
database.begin();
OVertex v1 = database.newVertex("MyV");
OVertex v2 = database.newVertex("MyV");
OEdge edge = v1.addEdge(v2, "MyE");
edge.setProperty("some", "value");
database.save(v1);
OResultSet result1 = database.query("select out_MyE from MyV where out_MyE is not null");
assertTrue(result1.hasNext());
ArrayList<Object> val = new ArrayList<>();
val.add(edge.getIdentity());
assertEquals(result1.next().getProperty("out_MyE"), val);
result1.close();
}
@Test
public void testRidbagsTx() {
database.begin();
OElement v1 = database.newElement("SomeTx");
OElement v2 = database.newElement("SomeTx");
database.save(v2);
ORidBag ridbag = new ORidBag();
ridbag.add(v2.getIdentity());
v1.setProperty("rids", ridbag);
database.save(v1);
OResultSet result1 = database.query("select rids from SomeTx where rids is not null");
assertTrue(result1.hasNext());
OElement v3 = database.newElement("SomeTx");
database.save(v3);
ArrayList<Object> val = new ArrayList<>();
val.add(v2.getIdentity());
assertEquals(result1.next().getProperty("rids"), val);
result1.close();
result1 = database.query("select rids from SomeTx where rids is not null");
assertTrue(result1.hasNext());
assertEquals(result1.next().getProperty("rids"), val);
result1.close();
}
@Test
public void testProperIndexingOnDoubleInternalBegin() {
database.begin(OTransaction.TXTYPE.OPTIMISTIC);
OElement idx = database.newElement("IndexedTx");
idx.setProperty("name", FIELD_VALUE);
database.save(idx);
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
ORecord id = database.save(someTx);
try (OResultSet rs = database.query("select from ?", id)) {}
database.commit();
// nothing is found (unexpected behaviour)
try (OResultSet rs = database.query("select * from IndexedTx where name = ?", FIELD_VALUE)) {
assertEquals(rs.stream().count(), 1);
}
}
@Test(expected = ORecordDuplicatedException.class)
public void testDuplicateIndexTx() {
database.begin();
OElement v1 = database.newElement("UniqueIndexedTx");
v1.setProperty("name", "a");
database.save(v1);
OElement v2 = database.newElement("UniqueIndexedTx");
v2.setProperty("name", "a");
database.save(v2);
database.commit();
}
@Test
public void testKilledSession() {
database.begin();
OElement v2 = database.newElement("SomeTx");
v2.setProperty("name", "a");
database.save(v2);
OResultSet result1 = database.query("select rids from SomeTx ");
assertTrue(result1.hasNext());
result1.close();
for (OClientConnection conn : server.getClientConnectionManager().getConnections()) {
conn.close();
}
database.activateOnCurrentThread();
database.commit();
result1 = database.query("select rids from SomeTx ");
assertTrue(result1.hasNext());
result1.close();
}
@After
public void after() {
database.close();
orientDB.close();
server.shutdown();
Orient.instance().shutdown();
OFileUtils.deleteRecursively(new File(SERVER_DIRECTORY));
Orient.instance().startup();
}
}
| UTF-8 | Java | 15,667 | java | RemoteTransactionSupportTest.java | Java | [
{
"context": "nit.Before;\nimport org.junit.Test;\n\n/** Created by tglman on 03/01/17. */\npublic class RemoteTransactionSup",
"end": 1612,
"score": 0.9996475577354431,
"start": 1606,
"tag": "USERNAME",
"value": "tglman"
},
{
"context": "ODocument(\"SomeTx\");\n doc.setProperty(\... | null | [] | package com.orientechnologies.orient.server.tx;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.orientechnologies.common.io.OFileUtils;
import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.OrientDB;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.db.record.ridbag.ORidBag;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.OEdge;
import com.orientechnologies.orient.core.record.OElement;
import com.orientechnologies.orient.core.record.ORecord;
import com.orientechnologies.orient.core.record.OVertex;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultSet;
import com.orientechnologies.orient.core.storage.ORecordDuplicatedException;
import com.orientechnologies.orient.core.tx.OTransaction;
import com.orientechnologies.orient.server.OClientConnection;
import com.orientechnologies.orient.server.OServer;
import java.io.File;
import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/** Created by tglman on 03/01/17. */
public class RemoteTransactionSupportTest {
private static final String CLASS_1 = "SomeClass";
private static final String CLASS_2 = "AnotherClass";
private static final String EDGE = "SomeEdge";
private static final String FIELD_VALUE = "VALUE";
private static final String SERVER_DIRECTORY = "./target/transaction";
private OServer server;
private OrientDB orientDB;
private ODatabaseDocument database;
@Before
public void before() throws Exception {
OGlobalConfiguration.CLASS_MINIMUM_CLUSTERS.setValue(1);
server = new OServer(false);
server.setServerRootDirectory(SERVER_DIRECTORY);
server.startup(getClass().getResourceAsStream("orientdb-server-config.xml"));
server.activate();
orientDB = new OrientDB("remote:localhost", "root", "root", OrientDBConfig.defaultConfig());
orientDB.execute(
"create database ? memory users (admin identified by 'admin' role admin)",
RemoteTransactionSupportTest.class.getSimpleName());
database = orientDB.open(RemoteTransactionSupportTest.class.getSimpleName(), "admin", "admin");
database.createClass("SomeTx");
database.createClass("SomeTx2");
OClass klass = database.createClass("IndexedTx");
klass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
OClass uniqueClass = database.createClass("UniqueIndexedTx");
uniqueClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);
}
@Test
public void testQueryUpdateUpdatedInTxTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Joe");
OIdentifiable id = database.save(doc);
database.begin();
ODocument doc2 = database.load(id.getIdentity());
doc2.setProperty("name", "Jane");
database.save(doc2);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertEquals((long) result.next().getProperty("count"), 1L);
ODocument doc3 = database.load(id.getIdentity());
assertEquals(doc3.getProperty("name"), "July");
}
@Test
public void testResetUpdatedInTxTransaction() {
database.begin();
ODocument doc1 = new ODocument();
doc1.setProperty("name", "Jane");
database.save(doc1);
ODocument doc2 = new ODocument("SomeTx");
doc2.setProperty("name", "Jane");
database.save(doc2);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertEquals((long) result.next().getProperty("count"), 1L);
assertEquals(doc2.getProperty("name"), "July");
result.close();
}
@Test
public void testQueryUpdateCreatedInTxTransaction() throws InterruptedException {
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
OIdentifiable id = database.save(doc1);
ODocument docx = new ODocument("SomeTx2");
docx.setProperty("name", "Jane");
database.save(docx);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 1L);
ODocument doc2 = database.load(id.getIdentity());
assertEquals(doc2.getProperty("name"), "July");
assertFalse(result.hasNext());
result.close();
}
@Test
public void testRollbackTxTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
database.save(doc1);
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 2L);
result.close();
database.rollback();
OResultSet result1 = database.command("select count(*) from SomeTx where name='Jane'");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 1L);
result1.close();
}
@Test
public void testRollbackTxCheckStatusTransaction() {
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.begin();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane");
database.save(doc1);
OResultSet result = database.command("select count(*) from SomeTx where name='Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count(*)"), 2L);
assertTrue(database.getTransaction().isActive());
result.close();
database.rollback();
OResultSet result1 = database.command("select count(*) from SomeTx where name='Jane'");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 1L);
assertFalse(database.getTransaction().isActive());
result1.close();
}
@Test
public void testDownloadTransactionAtStart() {
database.begin();
database.command("insert into SomeTx set name ='Jane' ").close();
;
assertEquals(database.getTransaction().getEntryCount(), 1);
}
@Test
public void testQueryUpdateCreatedInTxSQLTransaction() {
database.begin();
database.command("insert into SomeTx set name ='Jane' ").close();
OResultSet result = database.command("update SomeTx set name='July' where name = 'Jane' ");
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count"), 1L);
result.close();
OResultSet result1 = database.query("select from SomeTx where name='July'");
assertTrue(result1.hasNext());
assertEquals(result1.next().getProperty("name"), "July");
assertFalse(result.hasNext());
result1.close();
}
@Test
public void testQueryDeleteTxSQLTransaction() {
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
someTx.save();
database.begin();
database.command("delete from SomeTx");
database.commit();
OResultSet result = database.command("select from SomeTx");
assertFalse(result.hasNext());
result.close();
}
@Test
public void testDoubleSaveTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
database.save(someTx);
assertEquals(database.getTransaction().getEntryCount(), 1);
assertEquals(database.countClass("SomeTx"), 1);
database.commit();
assertEquals(database.countClass("SomeTx"), 1);
}
@Test
public void testDoubleSaveDoubleFlushTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
database.save(someTx);
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
database.save(someTx);
database.save(someTx);
result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
assertEquals(database.getTransaction().getEntryCount(), 1);
assertEquals(database.countClass("SomeTx"), 1);
database.commit();
assertEquals(database.countClass("SomeTx"), 1);
}
@Test
public void testRefFlushedInTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
OElement oneMore = database.newElement("SomeTx");
oneMore.setProperty("name", "bar");
oneMore.setProperty("ref", someTx);
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
database.save(oneMore);
database.commit();
OResultSet result1 = database.query("select ref from SomeTx where name='bar'");
assertTrue(result1.hasNext());
assertEquals(someTx.getIdentity(), result1.next().getProperty("ref"));
result1.close();
}
@Test
public void testDoubleRefFlushedInTransaction() {
database.begin();
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
database.save(someTx);
OElement oneMore = database.newElement("SomeTx");
oneMore.setProperty("name", "bar");
oneMore.setProperty("ref", someTx.getIdentity());
OResultSet result = database.query("select from SomeTx");
assertEquals(1, result.stream().count());
result.close();
OElement ref2 = database.newElement("SomeTx");
ref2.setProperty("name", "other");
database.save(ref2);
oneMore.setProperty("ref2", ref2.getIdentity());
result = database.query("select from SomeTx");
assertEquals(2, result.stream().count());
result.close();
database.save(oneMore);
OResultSet result1 = database.query("select ref,ref2 from SomeTx where name='bar'");
assertTrue(result1.hasNext());
OResult next = result1.next();
assertEquals(someTx.getIdentity(), next.getProperty("ref"));
assertEquals(ref2.getIdentity(), next.getProperty("ref2"));
result1.close();
database.commit();
result1 = database.query("select ref,ref2 from SomeTx where name='bar'");
assertTrue(result1.hasNext());
next = result1.next();
assertEquals(someTx.getIdentity(), next.getProperty("ref"));
assertEquals(ref2.getIdentity(), next.getProperty("ref2"));
result1.close();
}
@Test
public void testGenerateIdCounterTransaction() {
database.begin();
ODocument doc = new ODocument("SomeTx");
doc.setProperty("name", "Jane");
database.save(doc);
database.command("insert into SomeTx set name ='Jane1' ").close();
database.command("insert into SomeTx set name ='Jane2' ").close();
ODocument doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane3");
database.save(doc1);
doc1 = new ODocument("SomeTx");
doc1.setProperty("name", "Jane4");
database.save(doc1);
database.command("insert into SomeTx set name ='Jane2' ").close();
OResultSet result = database.command("select count(*) from SomeTx");
System.out.println(result.getExecutionPlan().toString());
assertTrue(result.hasNext());
assertEquals((long) result.next().getProperty("count(*)"), 6L);
result.close();
assertTrue(database.getTransaction().isActive());
database.commit();
OResultSet result1 = database.command("select count(*) from SomeTx ");
assertTrue(result1.hasNext());
assertEquals((long) result1.next().getProperty("count(*)"), 6L);
result1.close();
assertFalse(database.getTransaction().isActive());
}
@Test
public void testGraphInTx() {
database.createVertexClass("MyV");
database.createEdgeClass("MyE");
database.begin();
OVertex v1 = database.newVertex("MyV");
OVertex v2 = database.newVertex("MyV");
OEdge edge = v1.addEdge(v2, "MyE");
edge.setProperty("some", "value");
database.save(v1);
OResultSet result1 = database.query("select out_MyE from MyV where out_MyE is not null");
assertTrue(result1.hasNext());
ArrayList<Object> val = new ArrayList<>();
val.add(edge.getIdentity());
assertEquals(result1.next().getProperty("out_MyE"), val);
result1.close();
}
@Test
public void testRidbagsTx() {
database.begin();
OElement v1 = database.newElement("SomeTx");
OElement v2 = database.newElement("SomeTx");
database.save(v2);
ORidBag ridbag = new ORidBag();
ridbag.add(v2.getIdentity());
v1.setProperty("rids", ridbag);
database.save(v1);
OResultSet result1 = database.query("select rids from SomeTx where rids is not null");
assertTrue(result1.hasNext());
OElement v3 = database.newElement("SomeTx");
database.save(v3);
ArrayList<Object> val = new ArrayList<>();
val.add(v2.getIdentity());
assertEquals(result1.next().getProperty("rids"), val);
result1.close();
result1 = database.query("select rids from SomeTx where rids is not null");
assertTrue(result1.hasNext());
assertEquals(result1.next().getProperty("rids"), val);
result1.close();
}
@Test
public void testProperIndexingOnDoubleInternalBegin() {
database.begin(OTransaction.TXTYPE.OPTIMISTIC);
OElement idx = database.newElement("IndexedTx");
idx.setProperty("name", FIELD_VALUE);
database.save(idx);
OElement someTx = database.newElement("SomeTx");
someTx.setProperty("name", "foo");
ORecord id = database.save(someTx);
try (OResultSet rs = database.query("select from ?", id)) {}
database.commit();
// nothing is found (unexpected behaviour)
try (OResultSet rs = database.query("select * from IndexedTx where name = ?", FIELD_VALUE)) {
assertEquals(rs.stream().count(), 1);
}
}
@Test(expected = ORecordDuplicatedException.class)
public void testDuplicateIndexTx() {
database.begin();
OElement v1 = database.newElement("UniqueIndexedTx");
v1.setProperty("name", "a");
database.save(v1);
OElement v2 = database.newElement("UniqueIndexedTx");
v2.setProperty("name", "a");
database.save(v2);
database.commit();
}
@Test
public void testKilledSession() {
database.begin();
OElement v2 = database.newElement("SomeTx");
v2.setProperty("name", "a");
database.save(v2);
OResultSet result1 = database.query("select rids from SomeTx ");
assertTrue(result1.hasNext());
result1.close();
for (OClientConnection conn : server.getClientConnectionManager().getConnections()) {
conn.close();
}
database.activateOnCurrentThread();
database.commit();
result1 = database.query("select rids from SomeTx ");
assertTrue(result1.hasNext());
result1.close();
}
@After
public void after() {
database.close();
orientDB.close();
server.shutdown();
Orient.instance().shutdown();
OFileUtils.deleteRecursively(new File(SERVER_DIRECTORY));
Orient.instance().startup();
}
}
| 15,667 | 0.69707 | 0.687624 | 457 | 33.282276 | 25.011183 | 99 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.859956 | false | false | 6 |
4c33dd0c88ee08c2855e9f322b0bab999f97be8d | 36,524,401,919,931 | a998e1cfc7a0274830d0d2d3ee985e14300cafed | /app/src/main/java/com/example/xzhoumo02/model/Xiangqing.java | 07039cd8cfd043f5b3124f13030aeb424a301978 | [] | no_license | Domineering/XZhouMo02123 | https://github.com/Domineering/XZhouMo02123 | 5fd06de3f7b75de63765f4988f9316acd134b37c | 8f30f742a808a538752c8e64131f2b0f18090c59 | refs/heads/master | 2021-08-27T21:28:06.712000 | 2017-12-10T11:28:43 | 2017-12-10T11:28:43 | 113,745,360 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.xzhoumo02.model;
import com.example.xzhoumo02.bean.GoodsBean;
import com.example.xzhoumo02.newWork.OnNetLinter;
import com.example.xzhoumo02.newWork.RetrofitHodel;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* Created by 绅丶士 on 2017/12/9.
*/
public class Xiangqing {
public void getXiangQing(String goods_id, final OnNetLinter<GoodsBean> onNetLinter){
RetrofitHodel.getApi().goodstags(goods_id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<GoodsBean>() {
@Override
public void accept(GoodsBean goodsBean) throws Exception {
onNetLinter.onSucc(goodsBean);
}
});
}
}
| UTF-8 | Java | 915 | java | Xiangqing.java | Java | [
{
"context": "activex.schedulers.Schedulers;\n\n/**\n * Created by 绅丶士 on 2017/12/9.\n */\n\npublic class Xiangqing {\n p",
"end": 349,
"score": 0.9974015355110168,
"start": 346,
"tag": "NAME",
"value": "绅丶士"
}
] | null | [] | package com.example.xzhoumo02.model;
import com.example.xzhoumo02.bean.GoodsBean;
import com.example.xzhoumo02.newWork.OnNetLinter;
import com.example.xzhoumo02.newWork.RetrofitHodel;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* Created by 绅丶士 on 2017/12/9.
*/
public class Xiangqing {
public void getXiangQing(String goods_id, final OnNetLinter<GoodsBean> onNetLinter){
RetrofitHodel.getApi().goodstags(goods_id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<GoodsBean>() {
@Override
public void accept(GoodsBean goodsBean) throws Exception {
onNetLinter.onSucc(goodsBean);
}
});
}
}
| 915 | 0.656766 | 0.640264 | 28 | 31.464285 | 25.228218 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.357143 | false | false | 6 |
a8b7e9a47b4fbe996ece7e42889b8b8dea942943 | 36,026,185,711,065 | ddd4f67aa49d378ae4a5cc6603c72a07c8f9e18b | /INEKRA3/src/menuThings/Menü.java | e24489ef3fc347d2d7b4a1d68507303131d30aa2 | [] | no_license | Zamundaaa/INEKRA | https://github.com/Zamundaaa/INEKRA | 7c21ae0df10b7c15a798af570b471d874aaabb4b | 44583eb3ef192a6a8f390880bb99a6080e3637b1 | refs/heads/master | 2021-01-23T12:32:32.116000 | 2017-06-22T20:19:43 | 2017-06-22T20:19:43 | 93,165,583 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package menuThings;
import java.util.ArrayList;
import java.util.List;
public class Menü {
private List<MenuThing> inputs;
// private List<Button> buttons = new ArrayList<Button>();
// private List<TextField> tfs = new ArrayList<TextField>();
// private List<GuiTexture> texs = new ArrayList<GuiTexture>();
private ArrayList<MenuThing> ka = new ArrayList<MenuThing>();
public Menü(List<MenuThing> inps) {
this.inputs = inps;
// for (int i = 0; i < inputs.size(); i++) {
// if (inputs.get(i).getClass() == Button.class) {
// buttons.add((Button) inputs.get(i));
// } else if (inputs.get(i).getClass() == TextField.class) {
// tfs.add((TextField) inputs.get(i));
// }
// }
// for (int i = 0; i < inputs.size(); i++) {
// texs.add(inputs.get(i).getGuiTex());
// }
}
public void add(MenuThing m){
inputs.add(m);
}
public void remove(MenuThing m){
inputs.remove(m);
}
public void update() {
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).update();
}
for(int i = 0; i < inputs.size(); i++){
inputs.get(i).putClickable(ka);
}
sortList(ka, 0, ka.size()-1);
MenuThing.clickUsed = false;
// System.out.println("______________________________________________________");
for(int i = ka.size()-1; i >= 0 && !MenuThing.clickUsed; i--){
ka.get(i).updateClicks();//check for consistency!!!
// System.out.println(ka.get(i).displayLevel);
}
ka.clear();
}
// public void cleanUp(){
// for(int i = 0; i < inputs.size(); i++)
// inputs.get(i).cleanUp();
// }
private boolean hidden = false;
public void hide() {
if(!hidden){
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).hide();
}
hidden = true;
}
}
public void show() {
if(hidden){
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).show();
}
hidden = false;
}
}
// public List<Button> getButtons() {
// return buttons;
// }
private void sortList(List<MenuThing> ka, int start, int end){
if(start >= end)
return;
int i = start;
int k = end - 1;
MenuThing pivot = ka.get(end);
do{
while(ka.get(i).displayLevel <= pivot.displayLevel && i < end)
i++;
while(ka.get(k).displayLevel >= pivot.displayLevel && k > start)
k--;
if(i<k){
MenuThing temp = ka.get(i);
ka.set(i, ka.get(k));
ka.set(k, temp);
}
}while(i < k);
if(ka.get(i).displayLevel > pivot.displayLevel){
MenuThing temp = ka.get(i);
ka.set(i, ka.get(end));
ka.set(end, temp);
}
sortList(ka, start, i-1);
sortList(ka, i+1, end);
}
public void cleanUpAndClear() {
for(int i = 0; i < inputs.size(); i++)
inputs.get(i).cleanUp();
inputs.clear();
}
public boolean visible() {
return !hidden;
}
}
| UTF-8 | Java | 2,750 | java | Menü.java | Java | [] | null | [] | package menuThings;
import java.util.ArrayList;
import java.util.List;
public class Menü {
private List<MenuThing> inputs;
// private List<Button> buttons = new ArrayList<Button>();
// private List<TextField> tfs = new ArrayList<TextField>();
// private List<GuiTexture> texs = new ArrayList<GuiTexture>();
private ArrayList<MenuThing> ka = new ArrayList<MenuThing>();
public Menü(List<MenuThing> inps) {
this.inputs = inps;
// for (int i = 0; i < inputs.size(); i++) {
// if (inputs.get(i).getClass() == Button.class) {
// buttons.add((Button) inputs.get(i));
// } else if (inputs.get(i).getClass() == TextField.class) {
// tfs.add((TextField) inputs.get(i));
// }
// }
// for (int i = 0; i < inputs.size(); i++) {
// texs.add(inputs.get(i).getGuiTex());
// }
}
public void add(MenuThing m){
inputs.add(m);
}
public void remove(MenuThing m){
inputs.remove(m);
}
public void update() {
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).update();
}
for(int i = 0; i < inputs.size(); i++){
inputs.get(i).putClickable(ka);
}
sortList(ka, 0, ka.size()-1);
MenuThing.clickUsed = false;
// System.out.println("______________________________________________________");
for(int i = ka.size()-1; i >= 0 && !MenuThing.clickUsed; i--){
ka.get(i).updateClicks();//check for consistency!!!
// System.out.println(ka.get(i).displayLevel);
}
ka.clear();
}
// public void cleanUp(){
// for(int i = 0; i < inputs.size(); i++)
// inputs.get(i).cleanUp();
// }
private boolean hidden = false;
public void hide() {
if(!hidden){
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).hide();
}
hidden = true;
}
}
public void show() {
if(hidden){
for (int i = 0; i < inputs.size(); i++) {
inputs.get(i).show();
}
hidden = false;
}
}
// public List<Button> getButtons() {
// return buttons;
// }
private void sortList(List<MenuThing> ka, int start, int end){
if(start >= end)
return;
int i = start;
int k = end - 1;
MenuThing pivot = ka.get(end);
do{
while(ka.get(i).displayLevel <= pivot.displayLevel && i < end)
i++;
while(ka.get(k).displayLevel >= pivot.displayLevel && k > start)
k--;
if(i<k){
MenuThing temp = ka.get(i);
ka.set(i, ka.get(k));
ka.set(k, temp);
}
}while(i < k);
if(ka.get(i).displayLevel > pivot.displayLevel){
MenuThing temp = ka.get(i);
ka.set(i, ka.get(end));
ka.set(end, temp);
}
sortList(ka, start, i-1);
sortList(ka, i+1, end);
}
public void cleanUpAndClear() {
for(int i = 0; i < inputs.size(); i++)
inputs.get(i).cleanUp();
inputs.clear();
}
public boolean visible() {
return !hidden;
}
}
| 2,750 | 0.569141 | 0.563683 | 130 | 20.138462 | 19.660484 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.415385 | false | false | 6 |
672845428d6b556438ecbfd1939128b234457335 | 17,918,603,617,198 | 49d1cb6b08c676d93ed8bd052bc13513bcdf9fdf | /src/test/com/learning/selenium/LoginTrello.java | 857e4b442b6d902c82ff2b51adebefb8321c0d56 | [
"Apache-2.0"
] | permissive | etarnovskaya/Trello_G2 | https://github.com/etarnovskaya/Trello_G2 | a43784dfb592eb30cb14578f6cfc3b8d6bc2702a | 8c0d84276a188387d21ee4ba74790d437386d0a3 | refs/heads/main | 2023-02-16T00:24:50.001000 | 2021-01-08T13:11:08 | 2021-01-08T13:11:08 | 327,906,592 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package test.com.learning.selenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
public class LoginTrello extends TestBase{
@Test
public void logInAtlassianAcc() throws InterruptedException {
initLogin();
fillAtlassianLoginForm("rochman.elena@gmail.com", "12345.com");
submitLogin();
}
}
| UTF-8 | Java | 519 | java | LoginTrello.java | Java | [
{
"context": " initLogin();\n fillAtlassianLoginForm(\"rochman.elena@gmail.com\", \"12345.com\");\n submitLogin();\n }\n\n\n}\n",
"end": 469,
"score": 0.999891459941864,
"start": 446,
"tag": "EMAIL",
"value": "rochman.elena@gmail.com"
}
] | null | [] | package test.com.learning.selenium;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
public class LoginTrello extends TestBase{
@Test
public void logInAtlassianAcc() throws InterruptedException {
initLogin();
fillAtlassianLoginForm("<EMAIL>", "12345.com");
submitLogin();
}
}
| 503 | 0.753372 | 0.743738 | 21 | 23.714285 | 22.116882 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52381 | false | false | 6 |
3b7cc05fd32238f8cb7bf165ce0e9db990e9aebe | 35,759,897,743,560 | abe991d4f081cd5c9c6f53735b3f7b3dac8dd322 | /Sentry/src/main/java/com/sentry/Sentry/dao/DeviceDAOImpl.java | 2bb4f558ef84a0e8210ec95289771f0c029a7b92 | [] | no_license | Resminos/Sentry_SpringBoot | https://github.com/Resminos/Sentry_SpringBoot | 8a427b9cd33ce939d9d1cdc1fb3501a6268a5a85 | ed5b496ff3cedbea85c7943a8a0110dffd465706 | refs/heads/main | 2023-05-08T04:06:50.713000 | 2021-06-01T19:55:00 | 2021-06-01T19:55:00 | 368,352,157 | 1 | 0 | null | true | 2021-05-18T00:02:47 | 2021-05-18T00:02:46 | 2021-05-17T21:10:40 | 2021-05-17T21:10:36 | 924 | 0 | 0 | 0 | null | false | false | //package com.sentry.Sentry.dao;
//
//import java.util.List;
//
//import javax.persistence.EntityManager;
//
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import com.sentry.Sentry.entity.Device;
//
//@Repository
//public class DeviceDAOImpl implements DeviceDAO{
//
// //define field for entity manager
// private EntityManager entityManager;
//
// //set up constructor injection
// @Autowired
// public DeviceDAOImpl(EntityManager theEntityManager){
// entityManager = theEntityManager;
// }
// @Override
// public List<Device> findAll() {
// //get hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //create query
// Query<Device> theQuery =
// currentSession.createQuery("from Device", Device.class);
// //execute query and get result
// List<Device> devices = theQuery.getResultList();
//
// //return result
// return devices;
// }
//
// @Override
// public Device findById(int theId) {
// //get hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //get device
// Device theDevice =
// currentSession.get(Device.class, theId);
//
// //return device
// return theDevice;
// }
//
// @Override
// public void save(Device theDevice) {
//
// //get current session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //save device
// currentSession.saveOrUpdate(theDevice);
// }
//
//}
| UTF-8 | Java | 1,679 | java | DeviceDAOImpl.java | Java | [] | null | [] | //package com.sentry.Sentry.dao;
//
//import java.util.List;
//
//import javax.persistence.EntityManager;
//
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import com.sentry.Sentry.entity.Device;
//
//@Repository
//public class DeviceDAOImpl implements DeviceDAO{
//
// //define field for entity manager
// private EntityManager entityManager;
//
// //set up constructor injection
// @Autowired
// public DeviceDAOImpl(EntityManager theEntityManager){
// entityManager = theEntityManager;
// }
// @Override
// public List<Device> findAll() {
// //get hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //create query
// Query<Device> theQuery =
// currentSession.createQuery("from Device", Device.class);
// //execute query and get result
// List<Device> devices = theQuery.getResultList();
//
// //return result
// return devices;
// }
//
// @Override
// public Device findById(int theId) {
// //get hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //get device
// Device theDevice =
// currentSession.get(Device.class, theId);
//
// //return device
// return theDevice;
// }
//
// @Override
// public void save(Device theDevice) {
//
// //get current session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //save device
// currentSession.saveOrUpdate(theDevice);
// }
//
//}
| 1,679 | 0.651578 | 0.651578 | 63 | 25.650793 | 21.540775 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.603175 | false | false | 6 |
25cd7bab44183edd22b4b5f146766103266a58ab | 35,536,559,446,037 | 527c67b1b20eb8cf70e4e19c6c8e128f0f5447c1 | /src/main/java/com/example/aggregator/presentation/FrontController.java | 3eb7229195e2b9954fb0a6d76889c82dc825e2ac | [] | no_license | ailie/Aggregation-Service | https://github.com/ailie/Aggregation-Service | 9ae881a43c39a89a7037d6343dbe26156e2fb8a9 | 30020898f29b126010c5709a1e4ef96d75191556 | refs/heads/master | 2022-12-01T07:07:56.942000 | 2020-08-11T04:53:04 | 2020-08-11T04:53:04 | 286,647,339 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.aggregator.presentation;
import static org.springframework.util.StringUtils.isEmpty;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.example.aggregator.domain.Account;
import com.example.aggregator.domain.Transaction;
import com.example.aggregator.domain.User;
import com.example.aggregator.domain_logic.DataHandler;
@RestController
public class FrontController {
private final DataHandler dataHandler;
private FrontController(DataHandler dataHandler) {
this.dataHandler = dataHandler;
}
@GetMapping("/users")
private Iterable<User> listUsers() {
return dataHandler.listUsers();
}
@GetMapping("/accounts")
private Iterable<Account> listAccountsByUser(
@RequestParam(value = "user", required = false) String user) {
if (isEmpty(user)) {
throw new UnsupportedOperationException("Please specify an username, eg: /accounts?user=FOO");
} else {
return dataHandler.listAccountsByUser(user);
}
}
@GetMapping("/transactions")
private Iterable<Transaction> listTransactionByAccount(
@RequestParam(value = "account", required = false) String account) {
if (isEmpty(account)) {
throw new UnsupportedOperationException("Please specify an account, eg: /transactions?account=BAR");
} else {
return dataHandler.listTransactionByAccount(account);
}
}
@ExceptionHandler(UnsupportedOperationException.class)
private String showError(Throwable throwable) {
return throwable.getMessage();
}
}
| UTF-8 | Java | 1,814 | java | FrontController.java | Java | [] | null | [] | package com.example.aggregator.presentation;
import static org.springframework.util.StringUtils.isEmpty;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.example.aggregator.domain.Account;
import com.example.aggregator.domain.Transaction;
import com.example.aggregator.domain.User;
import com.example.aggregator.domain_logic.DataHandler;
@RestController
public class FrontController {
private final DataHandler dataHandler;
private FrontController(DataHandler dataHandler) {
this.dataHandler = dataHandler;
}
@GetMapping("/users")
private Iterable<User> listUsers() {
return dataHandler.listUsers();
}
@GetMapping("/accounts")
private Iterable<Account> listAccountsByUser(
@RequestParam(value = "user", required = false) String user) {
if (isEmpty(user)) {
throw new UnsupportedOperationException("Please specify an username, eg: /accounts?user=FOO");
} else {
return dataHandler.listAccountsByUser(user);
}
}
@GetMapping("/transactions")
private Iterable<Transaction> listTransactionByAccount(
@RequestParam(value = "account", required = false) String account) {
if (isEmpty(account)) {
throw new UnsupportedOperationException("Please specify an account, eg: /transactions?account=BAR");
} else {
return dataHandler.listTransactionByAccount(account);
}
}
@ExceptionHandler(UnsupportedOperationException.class)
private String showError(Throwable throwable) {
return throwable.getMessage();
}
}
| 1,814 | 0.72161 | 0.72161 | 53 | 33.226414 | 28.195169 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.415094 | false | false | 6 |
b4fd1f844cc4fdceeca96d5c6dc281045271dbff | 35,768,487,680,380 | 6af6ecec4ffcd91169a71af0ea83bf17e0faa180 | /src/com/emailapp/Email.java | 2dfcb82eb3a309d3be505fa1a30ca9321a389809 | [] | no_license | cjdunteman/email-app | https://github.com/cjdunteman/email-app | c53bb1e6533a7fad25819e139a602490d27aed0b | 99fd59f3a74984cb81ad64dc5f63803a82538e87 | refs/heads/master | 2021-07-09T11:01:42.502000 | 2020-11-20T05:59:52 | 2020-11-20T05:59:52 | 213,828,402 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.emailapp;
import java.util.Scanner;
public class Email {
// Initialize Public Variables
public Scanner in = new Scanner(System.in);
// Initialize Private Variables
public String firstName;
private String lastName;
private String password;
private String department;
private String email;
private int mailboxCapacity = 500;
private int defaultPasswordLength = 10;
private String alternateEmail;
private String companySuffix = "company.com";
// Constructor to receive first and last name
public Email(String firstName, String lastName) {
System.out.println("What is your first name?");
this.firstName = in.nextLine();
System.out.println("What is your last name?");
this.lastName = in.nextLine();
// Call a method asking for department - return the department
this.department = setDepartment();
// Call a method to return a random password
this.password = randomPassword(defaultPasswordLength);
// Combine elements to generate email
email = this.firstName.toLowerCase() + "." + this.lastName.toLowerCase() + "@" + department + "." + companySuffix;
}
// Ask for the department
private String setDepartment() {
System.out.print("New worker: " + firstName + ".\nDepartment Codes:\n1 for Sales\n2 for Development\n3 for Accounting\n0 for none\nEnter department code: \n");
int depChoice = in.nextInt();
if (depChoice == 1) {
return "sales";
}
else if (depChoice ==2) {
return "dev";
}
else if (depChoice == 3) {
return "acct";
}
else {
return "";
}
}
// Generate a random password
private String randomPassword(int length) {
String passwordSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyxz1234567890!@#$%";
char[] password = new char[length];
for (int i = 0; i < length; i++) {
int rand = (int) (Math.random() * passwordSet.length());
password[i] = passwordSet.charAt(rand);
}
return new String(password);
}
// Set the mailbox capacity
public void setMailboxCapacity(int capacity) {
this.mailboxCapacity = capacity;
}
// Set the alternate email
public void setAlternateEmail(String altEmail) {
this.alternateEmail = altEmail;
}
// Change password
public void changePassword(String password) {
this.password = password;
}
public int getMailboxCapacity() {
return mailboxCapacity;
}
public String getAlternateEmail() {
return alternateEmail;
}
public String getPassword() {
return password;
}
public String showInfo() {
return "DISPLAY NAME: " + firstName + " " + lastName +
"\nCOMPANY EMAIL: " + email +
"\nMAILBOX CAPACITY: " + mailboxCapacity + "mb\n" +
"PASSWORD: " + password + "\n";
}
public static String getNewPassword() {
Scanner in = new Scanner(System.in);
System.out.println("Enter a new password: ");
String password = in.nextLine();
return password;
}
public boolean logIn(Email em1) {
Scanner in = new Scanner(System.in);
System.out.println(showInfo());
System.out.println("Enter email:");
String em = in.nextLine();
System.out.println("Enter password:");
String pw = in.nextLine();
if (em.equals(email) && pw.equals(password)) {
return true;
}
else {
return false;
}
}
}
| UTF-8 | Java | 3,703 | java | Email.java | Java | [
{
"context": "o return a random password\n this.password = randomPassword(defaultPasswordLength);\n\n // Combi",
"end": 998,
"score": 0.6899771690368652,
"start": 992,
"tag": "PASSWORD",
"value": "random"
},
{
"context": "sword(int length) {\n String passwordSet ... | null | [] | package com.emailapp;
import java.util.Scanner;
public class Email {
// Initialize Public Variables
public Scanner in = new Scanner(System.in);
// Initialize Private Variables
public String firstName;
private String lastName;
private String password;
private String department;
private String email;
private int mailboxCapacity = 500;
private int defaultPasswordLength = 10;
private String alternateEmail;
private String companySuffix = "company.com";
// Constructor to receive first and last name
public Email(String firstName, String lastName) {
System.out.println("What is your first name?");
this.firstName = in.nextLine();
System.out.println("What is your last name?");
this.lastName = in.nextLine();
// Call a method asking for department - return the department
this.department = setDepartment();
// Call a method to return a random password
this.password = <PASSWORD>Password(defaultPasswordLength);
// Combine elements to generate email
email = this.firstName.toLowerCase() + "." + this.lastName.toLowerCase() + "@" + department + "." + companySuffix;
}
// Ask for the department
private String setDepartment() {
System.out.print("New worker: " + firstName + ".\nDepartment Codes:\n1 for Sales\n2 for Development\n3 for Accounting\n0 for none\nEnter department code: \n");
int depChoice = in.nextInt();
if (depChoice == 1) {
return "sales";
}
else if (depChoice ==2) {
return "dev";
}
else if (depChoice == 3) {
return "acct";
}
else {
return "";
}
}
// Generate a random password
private String randomPassword(int length) {
String passwordSet = "<KEY>";
char[] password = new char[length];
for (int i = 0; i < length; i++) {
int rand = (int) (Math.random() * passwordSet.length());
password[i] = passwordSet.charAt(rand);
}
return new String(password);
}
// Set the mailbox capacity
public void setMailboxCapacity(int capacity) {
this.mailboxCapacity = capacity;
}
// Set the alternate email
public void setAlternateEmail(String altEmail) {
this.alternateEmail = altEmail;
}
// Change password
public void changePassword(String password) {
this.password = password;
}
public int getMailboxCapacity() {
return mailboxCapacity;
}
public String getAlternateEmail() {
return alternateEmail;
}
public String getPassword() {
return password;
}
public String showInfo() {
return "DISPLAY NAME: " + firstName + " " + lastName +
"\nCOMPANY EMAIL: " + email +
"\nMAILBOX CAPACITY: " + mailboxCapacity + "mb\n" +
"PASSWORD: " + <PASSWORD> + "\n";
}
public static String getNewPassword() {
Scanner in = new Scanner(System.in);
System.out.println("Enter a new password: ");
String password = in.nextLine();
return password;
}
public boolean logIn(Email em1) {
Scanner in = new Scanner(System.in);
System.out.println(showInfo());
System.out.println("Enter email:");
String em = in.nextLine();
System.out.println("Enter password:");
String pw = in.nextLine();
if (em.equals(email) && pw.equals(password)) {
return true;
}
else {
return false;
}
}
}
| 3,647 | 0.597894 | 0.591412 | 126 | 28.388889 | 25.35368 | 167 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.412698 | false | false | 6 |
8a6b18491d77605fd00d33a5ff6cd2083ada02d7 | 36,103,495,125,975 | 492f29db69ca599aaf2d606166864892622be124 | /src/day29_nestedloop_arrays/StarsNestedLoop.java | fd91da7a0c5461f470a50e1ab3c3a15f64ea0579 | [] | no_license | asglazunova/day46 | https://github.com/asglazunova/day46 | a8475b785746d670651393599d25296532c17a52 | d7c4e2d5c333dc7adcf9de3d7cea321c6a7f8383 | refs/heads/master | 2023-06-16T22:19:41.688000 | 2021-07-11T20:55:16 | 2021-07-11T20:55:16 | 371,528,223 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package day29_nestedloop_arrays;
public class StarsNestedLoop {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) { // 5 rows
for (int j = 1; j <= 10; j++) { // 10 arrays
System.out.print("*");
}
System.out.println(); // go to the next line
}
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* "); // 1 rount ->1 star ->2 round ->2star
}
System.out.println(); // go to the next line
}
for (int i = 1; i <= 10; i++) {
for (int j = 10; j >= i; j--) {
System.out.print("* "); // 1 rount ->1 star ->2 round ->2star
}
System.out.println();
}
}
}
| UTF-8 | Java | 808 | java | StarsNestedLoop.java | Java | [] | null | [] | package day29_nestedloop_arrays;
public class StarsNestedLoop {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) { // 5 rows
for (int j = 1; j <= 10; j++) { // 10 arrays
System.out.print("*");
}
System.out.println(); // go to the next line
}
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("* "); // 1 rount ->1 star ->2 round ->2star
}
System.out.println(); // go to the next line
}
for (int i = 1; i <= 10; i++) {
for (int j = 10; j >= i; j--) {
System.out.print("* "); // 1 rount ->1 star ->2 round ->2star
}
System.out.println();
}
}
}
| 808 | 0.409653 | 0.376238 | 25 | 31.32 | 22.78898 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.76 | false | false | 6 |
40bd829ffd925085f26d6357e0bcca132dd7ca32 | 38,774,964,790,468 | b4374d0a8eae89ca79928cdc798907e63d17622e | /test/no/ntnu/imt3281/sudoku/RowIteratorTest.java | 09a77737834c6a402718bc1c1c6a5b0646e58662 | [] | no_license | newtpuandre/Prosjekt1-IMT3281-h2019 | https://github.com/newtpuandre/Prosjekt1-IMT3281-h2019 | 9821b3e08ce175cde4199fd17a71556552aced31 | 7223b7097884b7a83431182d98c75b9dbfad6a31 | refs/heads/master | 2020-08-29T15:27:34.736000 | 2019-10-04T13:30:09 | 2019-10-04T13:30:09 | 218,074,493 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package no.ntnu.imt3281.sudoku;
import org.junit.Before;
import org.junit.Test;
import java.util.Iterator;
import java.util.NoSuchElementException;
import static org.junit.Assert.*;
public class RowIteratorTest {
int[] testBoardNums;
@Before
public void init(){
testBoardNums = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9};
}
@Test
public void testRowIterator_Success() {
// checking if creation of class passes without errors
Iterator testIterator = new RowIterator(testBoardNums, 2).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoard() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid board length
Iterator testIterator = new RowIterator(testBoardNumsWrong, 2).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoardPosition1() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid boardPosition < 0
Iterator testIterator = new RowIterator(testBoardNums, -1).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoardPosition2() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid boardPosition > 80
Iterator testIterator = new RowIterator(testBoardNums, 81).iterator();
}
@Test
public void testHasNext(){
Iterator testIterator = new RowIterator(testBoardNums, 4).iterator();
// iterator has next until end of array
for(int i = 0; i < 9; i++){
assertTrue(testIterator.hasNext());
testIterator.next();
}
// iterator does not have next anymore
assertFalse(testIterator.hasNext());
}
@Test
public void testNext_Success(){
// boardPosition 55 is row index 6
Iterator<Integer> testIterator = new RowIterator(testBoardNums, 55).iterator();
int itValue;
int[] row6 = new int[]{-1, 6, -1, -1, -1, -1, 2, 8, -1};
// check if values from next() matches from row in actual board
for(int i = 0; i < 9; i++){
itValue = testIterator.next();
assertEquals(row6[i], itValue);
}
}
@Test(expected = NoSuchElementException.class)
public void testNext_NoSuchElement(){
Iterator<Integer> testIterator = new RowIterator(testBoardNums, 55).iterator();
// loop 1 too many
for(int i = 0; i < 10; i++){
testIterator.next();
}
}
} | UTF-8 | Java | 4,076 | java | RowIteratorTest.java | Java | [] | null | [] | package no.ntnu.imt3281.sudoku;
import org.junit.Before;
import org.junit.Test;
import java.util.Iterator;
import java.util.NoSuchElementException;
import static org.junit.Assert.*;
public class RowIteratorTest {
int[] testBoardNums;
@Before
public void init(){
testBoardNums = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9};
}
@Test
public void testRowIterator_Success() {
// checking if creation of class passes without errors
Iterator testIterator = new RowIterator(testBoardNums, 2).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoard() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid board length
Iterator testIterator = new RowIterator(testBoardNumsWrong, 2).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoardPosition1() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid boardPosition < 0
Iterator testIterator = new RowIterator(testBoardNums, -1).iterator();
}
@Test(expected = ArrayIndexOutOfBoundsException.class)
public void testRowIterator_InvalidBoardPosition2() {
// has length of 82, instead of 81
int[] testBoardNumsWrong = new int[]{5, 3, -1, -1, 7, -1, -1, -1, -1, 6, -1, -1, 1, 9, 5, -1,
-1, -1, -1, 9, 8, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 6, -1, -1, -1, 3, 4, -1,
-1, 8, -1, 3, -1, -1, 1, 7, -1, -1, -1, 2, -1, -1, -1, 6, -1, 6, -1, -1, -1, -1,
2, 8, -1, -1, -1, -1, 4, 1, 9, -1, -1, 5, -1, -1, -1, -1, 8, -1, -1, 7, 9, 1};
// test for invalid boardPosition > 80
Iterator testIterator = new RowIterator(testBoardNums, 81).iterator();
}
@Test
public void testHasNext(){
Iterator testIterator = new RowIterator(testBoardNums, 4).iterator();
// iterator has next until end of array
for(int i = 0; i < 9; i++){
assertTrue(testIterator.hasNext());
testIterator.next();
}
// iterator does not have next anymore
assertFalse(testIterator.hasNext());
}
@Test
public void testNext_Success(){
// boardPosition 55 is row index 6
Iterator<Integer> testIterator = new RowIterator(testBoardNums, 55).iterator();
int itValue;
int[] row6 = new int[]{-1, 6, -1, -1, -1, -1, 2, 8, -1};
// check if values from next() matches from row in actual board
for(int i = 0; i < 9; i++){
itValue = testIterator.next();
assertEquals(row6[i], itValue);
}
}
@Test(expected = NoSuchElementException.class)
public void testNext_NoSuchElement(){
Iterator<Integer> testIterator = new RowIterator(testBoardNums, 55).iterator();
// loop 1 too many
for(int i = 0; i < 10; i++){
testIterator.next();
}
}
} | 4,076 | 0.497792 | 0.404563 | 101 | 39.366337 | 33.993221 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.70297 | false | false | 6 |
b9fc72708b91ef2a727a8c9f98abe2a7cff09b3d | 6,983,616,840,205 | 097588f67bdcc6f1e845927a49ad3eb7cc29a288 | /FleetingDreamRecorder/src/net/lapasa/fleetingdreamrecorder/playback/AudioPlaybackService.java | cef70510701ee44195e1b644aae917f9d4c6c3d7 | [
"Apache-2.0"
] | permissive | marklapasa/fleetingdreamrecorder | https://github.com/marklapasa/fleetingdreamrecorder | ba33b980418e7c6e0e7050519325f57d080b0ac0 | 5d4de149a975e4e582f01ecc536fcb941d3621a8 | refs/heads/master | 2021-01-02T22:37:55.048000 | 2013-10-17T02:16:00 | 2013-10-17T02:16:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.lapasa.fleetingdreamrecorder.playback;
import java.io.IOException;
import java.util.Observable;
import net.lapasa.fleetingdreamrecorder.models.DreamRecordingsModel;
import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Handler;
import android.widget.Toast;
public class AudioPlaybackService extends Observable implements OnCompletionListener
{
private static int REFRESH_INTERVAL = 1000;
private static AudioPlaybackService _instance;
public static final String PLAYBACK_ELAPSED = "Playback Elapsed";
private Context context;
private MediaPlayer mediaPlayer;
private DreamRecordingsModel model;
private boolean paused;
private Handler handler;
private Runnable onPlaybackElapsed;
private int duration = -1;
private AudioPlaybackService(Context context)
{
this.context = context;
this.model = DreamRecordingsModel.getInstance(context);
this.handler = new Handler();
this.onPlaybackElapsed = getPlayBackElapsedRunnable();
}
private Runnable getPlayBackElapsedRunnable()
{
return new Runnable()
{
@Override
public void run()
{
setChanged();
notifyObservers(PLAYBACK_ELAPSED);
handler.postDelayed(this, REFRESH_INTERVAL);
}
};
}
public static AudioPlaybackService getInstance(Context context)
{
if (_instance == null)
{
_instance = new AudioPlaybackService(context);
}
return _instance;
}
public void play()
{
String targetFileName = model.getSelectedRecording().fileLocation;
killMediaPlayer();
mediaPlayer = new MediaPlayer();
try
{
mediaPlayer.setDataSource(targetFileName);
mediaPlayer.prepare();
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (SecurityException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (IllegalStateException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (IOException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
mediaPlayer.start();
mediaPlayer.setOnCompletionListener(this);
paused = false;
duration = mediaPlayer.getDuration();
handler.postDelayed(onPlaybackElapsed, REFRESH_INTERVAL);
}
public void pause()
{
if (mediaPlayer == null)
{
play();
return;
}
mediaPlayer.pause();
paused = true;
handler.removeCallbacks(onPlaybackElapsed);
setChanged();
notifyObservers(isPlaying());
}
public void resume()
{
paused = false;
mediaPlayer.start();
handler.postDelayed(onPlaybackElapsed, REFRESH_INTERVAL);
}
private void onPlaybackFailure(Exception e)
{
Toast.makeText(context, "Could not play file; Reason = " + e.getMessage(), Toast.LENGTH_LONG).show();
}
private void killMediaPlayer()
{
if (mediaPlayer != null)
{
try
{
mediaPlayer.release();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
public void stopPlayback()
{
if (mediaPlayer != null)
{
mediaPlayer.stop();
}
handler.removeCallbacks(onPlaybackElapsed);
duration = -1;
}
public boolean isPlaying()
{
if (mediaPlayer == null)
{
return false;
}
return mediaPlayer.isPlaying();
}
public boolean isPaused()
{
return paused;
}
@Override
public void onCompletion(MediaPlayer mp)
{
handler.removeCallbacks(onPlaybackElapsed);
setChanged();
notifyObservers(DreamRecordingsModel.PLAYBACK_COMPLETE);
}
/**
*
* @param position integer between 0..100
*/
public void seek(int position)
{
if (mediaPlayer != null)
{
// Get total seconds
int durationInMillis = mediaPlayer.getDuration();
/*
userPosition seekTo?
============== x =========
100 duration
*/
mediaPlayer.seekTo((position * durationInMillis)/100);
if (paused)
{
// Don't do anything
}
else
{
// Play at this new position
mediaPlayer.start();
}
}
}
public int getCurrentPosition()
{
if (mediaPlayer != null)
{
return mediaPlayer.getCurrentPosition();
}
else
{
return -1;
}
}
public int getDuration()
{
return duration;
}
}
| UTF-8 | Java | 4,171 | java | AudioPlaybackService.java | Java | [] | null | [] | package net.lapasa.fleetingdreamrecorder.playback;
import java.io.IOException;
import java.util.Observable;
import net.lapasa.fleetingdreamrecorder.models.DreamRecordingsModel;
import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Handler;
import android.widget.Toast;
public class AudioPlaybackService extends Observable implements OnCompletionListener
{
private static int REFRESH_INTERVAL = 1000;
private static AudioPlaybackService _instance;
public static final String PLAYBACK_ELAPSED = "Playback Elapsed";
private Context context;
private MediaPlayer mediaPlayer;
private DreamRecordingsModel model;
private boolean paused;
private Handler handler;
private Runnable onPlaybackElapsed;
private int duration = -1;
private AudioPlaybackService(Context context)
{
this.context = context;
this.model = DreamRecordingsModel.getInstance(context);
this.handler = new Handler();
this.onPlaybackElapsed = getPlayBackElapsedRunnable();
}
private Runnable getPlayBackElapsedRunnable()
{
return new Runnable()
{
@Override
public void run()
{
setChanged();
notifyObservers(PLAYBACK_ELAPSED);
handler.postDelayed(this, REFRESH_INTERVAL);
}
};
}
public static AudioPlaybackService getInstance(Context context)
{
if (_instance == null)
{
_instance = new AudioPlaybackService(context);
}
return _instance;
}
public void play()
{
String targetFileName = model.getSelectedRecording().fileLocation;
killMediaPlayer();
mediaPlayer = new MediaPlayer();
try
{
mediaPlayer.setDataSource(targetFileName);
mediaPlayer.prepare();
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (SecurityException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (IllegalStateException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
catch (IOException e)
{
e.printStackTrace();
onPlaybackFailure(e);
}
mediaPlayer.start();
mediaPlayer.setOnCompletionListener(this);
paused = false;
duration = mediaPlayer.getDuration();
handler.postDelayed(onPlaybackElapsed, REFRESH_INTERVAL);
}
public void pause()
{
if (mediaPlayer == null)
{
play();
return;
}
mediaPlayer.pause();
paused = true;
handler.removeCallbacks(onPlaybackElapsed);
setChanged();
notifyObservers(isPlaying());
}
public void resume()
{
paused = false;
mediaPlayer.start();
handler.postDelayed(onPlaybackElapsed, REFRESH_INTERVAL);
}
private void onPlaybackFailure(Exception e)
{
Toast.makeText(context, "Could not play file; Reason = " + e.getMessage(), Toast.LENGTH_LONG).show();
}
private void killMediaPlayer()
{
if (mediaPlayer != null)
{
try
{
mediaPlayer.release();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
public void stopPlayback()
{
if (mediaPlayer != null)
{
mediaPlayer.stop();
}
handler.removeCallbacks(onPlaybackElapsed);
duration = -1;
}
public boolean isPlaying()
{
if (mediaPlayer == null)
{
return false;
}
return mediaPlayer.isPlaying();
}
public boolean isPaused()
{
return paused;
}
@Override
public void onCompletion(MediaPlayer mp)
{
handler.removeCallbacks(onPlaybackElapsed);
setChanged();
notifyObservers(DreamRecordingsModel.PLAYBACK_COMPLETE);
}
/**
*
* @param position integer between 0..100
*/
public void seek(int position)
{
if (mediaPlayer != null)
{
// Get total seconds
int durationInMillis = mediaPlayer.getDuration();
/*
userPosition seekTo?
============== x =========
100 duration
*/
mediaPlayer.seekTo((position * durationInMillis)/100);
if (paused)
{
// Don't do anything
}
else
{
// Play at this new position
mediaPlayer.start();
}
}
}
public int getCurrentPosition()
{
if (mediaPlayer != null)
{
return mediaPlayer.getCurrentPosition();
}
else
{
return -1;
}
}
public int getDuration()
{
return duration;
}
}
| 4,171 | 0.688084 | 0.684009 | 228 | 17.293859 | 18.735382 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.096491 | false | false | 6 |
8b29d2e7498edec8acdc3616a477747a9e6bd986 | 30,889,404,795,675 | 985d23c28fc7398f466aac7f2af0d33736418902 | /src/com/yfzx/lwpai/fragment/NewestAnnounceFragment.java | ff6dd745dc8f71cc04fe871777f764548527fad7 | [] | no_license | TeddyYoung/LWPai | https://github.com/TeddyYoung/LWPai | fb94b8f4fa0608d9068aee5099faea5a09990e84 | 008cdb47281dacee6099432d14bd7445156e4b1b | refs/heads/master | 2020-12-30T14:12:25.546000 | 2017-05-15T02:12:59 | 2017-05-15T02:12:59 | 91,285,414 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yfzx.lwpai.fragment;
import java.util.ArrayList;
import java.util.List;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.TextView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnItemClick;
import com.yfzx.library.core.BaseFragment;
import com.yfzx.library.data.message.CacheManage;
import com.yfzx.library.http.JsonUtil;
import com.yfzx.library.http.xHttpClient;
import com.yfzx.library.http.xResopnse;
import com.yfzx.library.tools.ToolToast;
import com.yfzx.library.widget.pulltorefresh.ILoadingLayout;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase.Mode;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase.OnRefreshListener2;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshGridView;
import com.yfzx.lwpai.CommonGlobal;
import com.yfzx.lwpai.R;
import com.yfzx.lwpai.activity.GoodsLuckDetailActivity;
import com.yfzx.lwpai.adapter.NewestAnnounceAdapter;
import com.yfzx.lwpai.entity.LastOpen;
import com.yfzx.lwpai.entity.LastOpen.SSQReusltEntity;
import com.yfzx.lwpai.entity.NewestResult;
import com.yfzx.lwpai.util.Helper;
import com.yfzx.lwpai.view.ProgressHelper;
/**
* 最新揭晓幸运拍界面
*
* @author: yizhong.xu
* @version Revision: 0.0.1
* @Date: 2015年6月29日
*/
public class NewestAnnounceFragment extends BaseFragment {
// 自定义gridview
@ViewInject(R.id.pullToRefreshGridView1)
private PullToRefreshGridView pullToRefreshGridView1;
// 幸运吗
@ViewInject(R.id.tvWinningCode)
private TextView tvWinningCode;
// 时间
@ViewInject(R.id.tvTime)
private TextView tvTime;
private boolean firstLoad = true;
private int currPage = 1;
private int flag = 55;
// 适配器
private NewestAnnounceAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_luck_auction, container,
false);
// 获得索引值
Bundle bundle = getArguments();
if (bundle != null) {
flag = bundle.getInt("flag");
}
// 绑定界面UI
ViewUtils.inject(this, view);
initWidget();
initDate();
return view;
}
/**
* 初始化页面
*
* @author: yizhong.xu
*/
private void initWidget() {
adapter = new NewestAnnounceAdapter(act, new ArrayList<NewestResult>());
pullToRefreshGridView1.setAdapter(adapter);
pullToRefreshGridView1
.setOnRefreshListener(new OnRefreshListener2<GridView>() {
@Override
public void onPullDownToRefresh(
PullToRefreshBase<GridView> refreshView) {
String label = DateUtils.formatDateTime(
act.getApplicationContext(),
System.currentTimeMillis(),
DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_ABBREV_ALL);
// Update the LastUpdatedLabel
refreshView.getLoadingLayoutProxy()
.setLastUpdatedLabel(label);
currPage = 1;
firstLoad = true;
lastOpen();
}
@Override
public void onPullUpToRefresh(
PullToRefreshBase<GridView> refreshView) {
currPage++;
lastOpen();
}
});
ILoadingLayout startLabels = pullToRefreshGridView1
.getLoadingLayoutProxy();
startLabels.setPullLabel("下拉刷新");// 刚下拉时,显示的提示
startLabels.setRefreshingLabel("正在加载...");// 刷新时
startLabels.setReleaseLabel("松开刷新数据");// 下来达到一定距离时,显示的提示
}
/**
* 初始化数据
*
* @author: yizhong.xu
*/
private void initDate() {
lazyLoad();
}
/**
* 加载缓存中的数据
*
* @author: bangwei.yang
*/
private void lazyLoad() {
adapter.addAll(CacheManage.get("newest", NewestResult.class));
adapter.notifyDataSetChanged();
lastOpen();
}
/**
* 幸运拍
*
* @author: yizhong.xu
*/
private void lastOpen() {
xHttpClient httpClient = new xHttpClient(act, false);
httpClient.url.append("api/LastOpen/GetProductList");// 方法
httpClient.url.append("/" + 55);// 結束公佈的中拍者
httpClient.url.append("/" + CommonGlobal.PAGESIZE);// 每页条数
httpClient.url.append("/" + currPage);// 第几页
httpClient.post(new xResopnse() {
@Override
public void onSuccess(ResponseInfo<String> responseInfo) {
ProgressHelper.getInstance().cancel();
LastOpen response = JsonUtil.parseObject(act,
responseInfo.result, LastOpen.class);
if (response != null) {
SSQReusltEntity reuslts = response.getSSQReuslt();
List<NewestResult> tmpList = response.getResult();
tvWinningCode.setText(reuslts.getSSQ());// 幸运吗
tvTime.setText(response.getSSQReuslt().getOpenDate());// 时间
// 第一次加载
if (firstLoad) {
// 如果缓存为空,存入缓存。不为空,清除,添加新的数据
CacheManage.remove("newest");
// 最新10条数据,存入缓存
CacheManage.put("newest", tmpList);
// 清空已加载的缓存数据
adapter.getList().clear();
firstLoad = false;
}
adapter.addAll(tmpList);
adapter.notifyDataSetChanged();
if (currPage < Helper.paging(response.getTotal())) {// 不足10条数据,说明没有下一页
pullToRefreshGridView1.setMode(Mode.BOTH);
} else {
pullToRefreshGridView1.setMode(Mode.PULL_FROM_START);
}
pullToRefreshGridView1.onRefreshComplete();
} else {
ToolToast.showShort("已经没有数据可以刷新");
pullToRefreshGridView1.setMode(Mode.DISABLED);
}
}
});
}
/**
* 点击跳转
*
* @author: yizhong.xu
* @param parent
* @param view
* @param position
* @param id
*/
@OnItemClick(R.id.pullToRefreshGridView1)
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
// Intent intent = new Intent();
// Bundle bundle = new Bundle();
// intent.setClass(getActivity(), AuctionBeginActivity.class);//
// NewsDetailsActivity
// bundle.putInt("category", flag); // 1为从商场的入口
// bundle.putSerializable("goodDetailType", adapter.getList()
// .get(position));
// intent.putExtras(bundle);
// act.startActivityForResult(intent, 0);
Intent intent = new Intent();
Bundle bundle = new Bundle();
intent.setClass(act, GoodsLuckDetailActivity.class);
bundle.putInt("category", 2);// 传结束
// bundle.putInt("lucky", 1); // 显示TOP3000
bundle.putInt("type", 55);// 幸运拍
bundle.putString("goodsId", adapter.getList().get(position).getId());
intent.putExtras(bundle);
act.startActivityForResult(intent, 0);
}
}
| UTF-8 | Java | 6,983 | java | NewestAnnounceFragment.java | Java | [
{
"context": ".ProgressHelper;\n\n/**\n * 最新揭晓幸运拍界面\n * \n * @author: yizhong.xu\n * @version Revision: 0.0.1\n * @Date: 2015年6月29日\n",
"end": 1600,
"score": 0.9996823668479919,
"start": 1590,
"tag": "NAME",
"value": "yizhong.xu"
},
{
"context": "\treturn view;\n\t}\n\n\t/**\n\t * 初始... | null | [] | package com.yfzx.lwpai.fragment;
import java.util.ArrayList;
import java.util.List;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.TextView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnItemClick;
import com.yfzx.library.core.BaseFragment;
import com.yfzx.library.data.message.CacheManage;
import com.yfzx.library.http.JsonUtil;
import com.yfzx.library.http.xHttpClient;
import com.yfzx.library.http.xResopnse;
import com.yfzx.library.tools.ToolToast;
import com.yfzx.library.widget.pulltorefresh.ILoadingLayout;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase.Mode;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshBase.OnRefreshListener2;
import com.yfzx.library.widget.pulltorefresh.PullToRefreshGridView;
import com.yfzx.lwpai.CommonGlobal;
import com.yfzx.lwpai.R;
import com.yfzx.lwpai.activity.GoodsLuckDetailActivity;
import com.yfzx.lwpai.adapter.NewestAnnounceAdapter;
import com.yfzx.lwpai.entity.LastOpen;
import com.yfzx.lwpai.entity.LastOpen.SSQReusltEntity;
import com.yfzx.lwpai.entity.NewestResult;
import com.yfzx.lwpai.util.Helper;
import com.yfzx.lwpai.view.ProgressHelper;
/**
* 最新揭晓幸运拍界面
*
* @author: yizhong.xu
* @version Revision: 0.0.1
* @Date: 2015年6月29日
*/
public class NewestAnnounceFragment extends BaseFragment {
// 自定义gridview
@ViewInject(R.id.pullToRefreshGridView1)
private PullToRefreshGridView pullToRefreshGridView1;
// 幸运吗
@ViewInject(R.id.tvWinningCode)
private TextView tvWinningCode;
// 时间
@ViewInject(R.id.tvTime)
private TextView tvTime;
private boolean firstLoad = true;
private int currPage = 1;
private int flag = 55;
// 适配器
private NewestAnnounceAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_luck_auction, container,
false);
// 获得索引值
Bundle bundle = getArguments();
if (bundle != null) {
flag = bundle.getInt("flag");
}
// 绑定界面UI
ViewUtils.inject(this, view);
initWidget();
initDate();
return view;
}
/**
* 初始化页面
*
* @author: yizhong.xu
*/
private void initWidget() {
adapter = new NewestAnnounceAdapter(act, new ArrayList<NewestResult>());
pullToRefreshGridView1.setAdapter(adapter);
pullToRefreshGridView1
.setOnRefreshListener(new OnRefreshListener2<GridView>() {
@Override
public void onPullDownToRefresh(
PullToRefreshBase<GridView> refreshView) {
String label = DateUtils.formatDateTime(
act.getApplicationContext(),
System.currentTimeMillis(),
DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_ABBREV_ALL);
// Update the LastUpdatedLabel
refreshView.getLoadingLayoutProxy()
.setLastUpdatedLabel(label);
currPage = 1;
firstLoad = true;
lastOpen();
}
@Override
public void onPullUpToRefresh(
PullToRefreshBase<GridView> refreshView) {
currPage++;
lastOpen();
}
});
ILoadingLayout startLabels = pullToRefreshGridView1
.getLoadingLayoutProxy();
startLabels.setPullLabel("下拉刷新");// 刚下拉时,显示的提示
startLabels.setRefreshingLabel("正在加载...");// 刷新时
startLabels.setReleaseLabel("松开刷新数据");// 下来达到一定距离时,显示的提示
}
/**
* 初始化数据
*
* @author: yizhong.xu
*/
private void initDate() {
lazyLoad();
}
/**
* 加载缓存中的数据
*
* @author: bangwei.yang
*/
private void lazyLoad() {
adapter.addAll(CacheManage.get("newest", NewestResult.class));
adapter.notifyDataSetChanged();
lastOpen();
}
/**
* 幸运拍
*
* @author: yizhong.xu
*/
private void lastOpen() {
xHttpClient httpClient = new xHttpClient(act, false);
httpClient.url.append("api/LastOpen/GetProductList");// 方法
httpClient.url.append("/" + 55);// 結束公佈的中拍者
httpClient.url.append("/" + CommonGlobal.PAGESIZE);// 每页条数
httpClient.url.append("/" + currPage);// 第几页
httpClient.post(new xResopnse() {
@Override
public void onSuccess(ResponseInfo<String> responseInfo) {
ProgressHelper.getInstance().cancel();
LastOpen response = JsonUtil.parseObject(act,
responseInfo.result, LastOpen.class);
if (response != null) {
SSQReusltEntity reuslts = response.getSSQReuslt();
List<NewestResult> tmpList = response.getResult();
tvWinningCode.setText(reuslts.getSSQ());// 幸运吗
tvTime.setText(response.getSSQReuslt().getOpenDate());// 时间
// 第一次加载
if (firstLoad) {
// 如果缓存为空,存入缓存。不为空,清除,添加新的数据
CacheManage.remove("newest");
// 最新10条数据,存入缓存
CacheManage.put("newest", tmpList);
// 清空已加载的缓存数据
adapter.getList().clear();
firstLoad = false;
}
adapter.addAll(tmpList);
adapter.notifyDataSetChanged();
if (currPage < Helper.paging(response.getTotal())) {// 不足10条数据,说明没有下一页
pullToRefreshGridView1.setMode(Mode.BOTH);
} else {
pullToRefreshGridView1.setMode(Mode.PULL_FROM_START);
}
pullToRefreshGridView1.onRefreshComplete();
} else {
ToolToast.showShort("已经没有数据可以刷新");
pullToRefreshGridView1.setMode(Mode.DISABLED);
}
}
});
}
/**
* 点击跳转
*
* @author: yizhong.xu
* @param parent
* @param view
* @param position
* @param id
*/
@OnItemClick(R.id.pullToRefreshGridView1)
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
// Intent intent = new Intent();
// Bundle bundle = new Bundle();
// intent.setClass(getActivity(), AuctionBeginActivity.class);//
// NewsDetailsActivity
// bundle.putInt("category", flag); // 1为从商场的入口
// bundle.putSerializable("goodDetailType", adapter.getList()
// .get(position));
// intent.putExtras(bundle);
// act.startActivityForResult(intent, 0);
Intent intent = new Intent();
Bundle bundle = new Bundle();
intent.setClass(act, GoodsLuckDetailActivity.class);
bundle.putInt("category", 2);// 传结束
// bundle.putInt("lucky", 1); // 显示TOP3000
bundle.putInt("type", 55);// 幸运拍
bundle.putString("goodsId", adapter.getList().get(position).getId());
intent.putExtras(bundle);
act.startActivityForResult(intent, 0);
}
}
| 6,983 | 0.714547 | 0.707997 | 233 | 27.175966 | 20.571844 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.648069 | false | false | 6 |
6403852dcc3664493580e8b8d9b8a01285988c58 | 10,763,188,055,068 | dfa939e9e665c3750b1b07a9c59effd2d38163d1 | /core/src/main/java/com/amplifyframework/predictions/operation/IdentifyOperation.java | 786789a4909f7067432df95c0e3df82b7eae4a27 | [
"Apache-2.0"
] | permissive | aws-amplify/amplify-android | https://github.com/aws-amplify/amplify-android | 83a29818ad7b6db426e61103243a861982ae3a8e | 0ef9fb2a4338139a7a172adc8b11e41d00acad65 | refs/heads/main | 2023-08-31T16:13:43.810000 | 2023-08-30T00:34:40 | 2023-08-30T00:34:40 | 177,009,933 | 225 | 139 | Apache-2.0 | false | 2023-09-13T19:44:47 | 2019-03-21T19:19:24 | 2023-08-18T12:30:12 | 2023-09-13T19:44:46 | 63,300 | 201 | 103 | 89 | Java | false | false | /*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amplifyframework.predictions.operation;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amplifyframework.core.async.AmplifyOperation;
import com.amplifyframework.core.category.CategoryType;
import com.amplifyframework.predictions.models.IdentifyAction;
import java.util.Objects;
/**
* Abstract representation of an operation that identifies elements within an image.
*
* @param <R> type of the request object
*/
public abstract class IdentifyOperation<R> extends AmplifyOperation<R> {
private final IdentifyAction identifyAction;
/**
* Constructs a new {@link IdentifyOperation}.
* @param identifyAction The type of identification to perform on an image
* @param amplifyOperationRequest The request object of the operation
*/
public IdentifyOperation(
@NonNull IdentifyAction identifyAction,
@Nullable R amplifyOperationRequest
) {
super(CategoryType.PREDICTIONS, amplifyOperationRequest);
this.identifyAction = Objects.requireNonNull(identifyAction);
}
/**
* Gets the type of identification to be performed by this operation.
* @return the identification action type
*/
@NonNull
public IdentifyAction getIdentifyAction() {
return identifyAction;
}
}
| UTF-8 | Java | 1,909 | java | IdentifyOperation.java | Java | [] | null | [] | /*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amplifyframework.predictions.operation;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amplifyframework.core.async.AmplifyOperation;
import com.amplifyframework.core.category.CategoryType;
import com.amplifyframework.predictions.models.IdentifyAction;
import java.util.Objects;
/**
* Abstract representation of an operation that identifies elements within an image.
*
* @param <R> type of the request object
*/
public abstract class IdentifyOperation<R> extends AmplifyOperation<R> {
private final IdentifyAction identifyAction;
/**
* Constructs a new {@link IdentifyOperation}.
* @param identifyAction The type of identification to perform on an image
* @param amplifyOperationRequest The request object of the operation
*/
public IdentifyOperation(
@NonNull IdentifyAction identifyAction,
@Nullable R amplifyOperationRequest
) {
super(CategoryType.PREDICTIONS, amplifyOperationRequest);
this.identifyAction = Objects.requireNonNull(identifyAction);
}
/**
* Gets the type of identification to be performed by this operation.
* @return the identification action type
*/
@NonNull
public IdentifyAction getIdentifyAction() {
return identifyAction;
}
}
| 1,909 | 0.737559 | 0.733368 | 56 | 33.089287 | 28.81609 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.303571 | false | false | 6 |
eb256078f560aabbfe34650ac2e8a47cf12399d4 | 26,903,675,203,953 | ddf9430e6cefeb96d5142ece6893729a20aa3fc8 | /Moxomo/src/za/co/moxomo/client/ui/VacancyView.java | 2f69c3e4f2d96373ad056af6dcff5df940a47d13 | [] | no_license | PaballoDitshego/Moxomo | https://github.com/PaballoDitshego/Moxomo | 0961cf6fecf2403fd0e9ae63ac3434b8562b1a15 | bbe756014c95f2ff11366a8848715412b4cc8dad | refs/heads/master | 2019-01-24T05:04:22.988000 | 2015-10-22T13:44:35 | 2015-10-22T13:44:35 | 33,406,618 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package za.co.moxomo.client.ui;
import za.co.moxomo.client.manager.ManagerRegistry;
import za.co.moxomo.client.model.ApplicationDataSource;
import za.co.moxomo.client.model.PageApplicationDataSource;
import za.co.moxomo.client.model.PagedVacancyDataSource;
import za.co.moxomo.client.model.VacancyDataSource;
import za.co.moxomo.client.support.event.ApplicationEvent;
import za.co.moxomo.client.support.event.ApplicationEventListener;
import za.co.moxomo.client.support.event.ApplicationEventListenerCollection;
import za.co.moxomo.client.support.event.ApplicationEventSource;
import za.co.moxomo.client.ui.event.LoginEvent;
import za.co.moxomo.client.ui.event.ShowApplicantsButtonEvent;
import za.co.moxomo.client.ui.event.ShowApplicantsGridEvent;
import za.co.moxomo.client.ui.event.VacancyExpiredEvent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.AutoFitWidthApproach;
import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.SelectionType;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.events.CloseClickEvent;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.SectionStack;
import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
//import com.smartgwt.client.widgets.grid.events.SelectionEvent;
public class VacancyView extends VLayout implements ApplicationEventSource {
private final ApplicationEventListenerCollection listeners;
private static final String DESCRIPTION = "VacancyView";
private ListGrid grid;
private SectionStack sectionStack;
private ManagerRegistry managerRegistry;
public VacancyView(final ManagerRegistry managerRegistry) {
this.managerRegistry = managerRegistry;
listeners = new ApplicationEventListenerCollection();
GWT.log("init VacancyView()...", null);
// initialise the Account View layout container
this.setStyleName("crm-ContextArea");
this.setWidth("*");
sectionStack = new SectionStack();
sectionStack.setWidth100();
sectionStack.setHeight(25);
String title = "My Ads";
SectionStackSection section = new SectionStackSection(title);
section.setCanCollapse(true);
section.setExpanded(false);
grid = new ListGrid();
//VacancyDataSource ds = new VacancyDataSource(managerRegistry);
// ds.getRequestProperties().setAttribute("search_param", "param");
//grid.setDataSource(new VacancyDataSource(managerRegistry));
grid.setDataSource(new PagedVacancyDataSource(managerRegistry));
//grid.
managerRegistry.getDataManager().setCursor(null);
grid.setAutoFetchData(true);
grid.setDataPageSize(250);
grid.setEmptyMessage("No Ads to show");
//grid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
//grid.setSelectionType(SelectionStyle.MULTIPLE);
//grid.setAlign(Alignment.LEFT);
//grid.setMembersMargin(2);
//grid.setAutoFitData(Autofit.BOTH);
//grid.setWrapCells(true);
//grid.setCanResizeFields(true);
grid.setWidth100();
grid.setHeight100();
//grid.setTop(75);
// grid.s
//grid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
//final VacancyViewer viewer = new VacancyViewer(managerRegistry);
/*grid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent event) {
viewer.setTitle(event.getRecord().getAttributeAsString("job_title"));
viewer.show();
}
});*/
grid.addRecordClickHandler(new RecordClickHandler(){
public void onRecordClick(RecordClickEvent event){
ListGridRecord record = (ListGridRecord) event.getRecord();
VacancyViewer viewer = new VacancyViewer(record,grid , managerRegistry);
viewer.addListener(new InternalListener());
//System.out.println(record.getAttribute("job_title"));
//viewer.setAdTitle(record.getAttribute("job_title"));
viewer.show();
}
});
//grid.setAutoWidth();
//grid.setOverflow(Overflow.AUTO);
// add the List Grid to the Account View layout container
//this.addMember(new VacancyListGrid(managerRegistry));
//section.setItems(grid);
sectionStack.setSections(section);
this.addMember(sectionStack);
this.addMember(grid);
History.newItem(DESCRIPTION);
}
public void addListener(ApplicationEventListener listener) {
listeners.add(listener);
}
/**
* {@inheritDoc}
*/
public void removeListener(ApplicationEventListener listener) {
listeners.remove(listener);
}
/**
* {@inheritDoc}
*/
public void clearListeners() {
listeners.clear();
}
/**
* Fires the given event to all the registerred listener.
*
* @param event
* The event to fire.
*/
protected void fireEvent(ApplicationEvent event) {
listeners.fireEvent(event);
}
public static class Factory implements ContextAreaFactory {
private String id;
public Canvas create(ManagerRegistry managerRegistry) {
VacancyView view = new VacancyView(managerRegistry);
id = view.getID();
GWT.log("VacancyView.Factory.create()->view.getID() - " + id, null);
return view;
}
public Canvas create(ManagerRegistry managerRegistry, ClickHandler clickHandler){
return null;
}
public String getID() {
return id;
}
public String getDescription() {
return DESCRIPTION;
}
}
class VacancyRecord extends ListGridRecord {
public VacancyRecord(){
}
public long getID(){
return getAttributeAsInt("id");
}
}
protected class InternalListener implements ApplicationEventListener {
@Override
public void handle(ApplicationEvent event) {
if (event instanceof VacancyExpiredEvent) {
System.out.println("I am listening");
grid.removeData( ((VacancyExpiredEvent) event).getRecord());
}
if(event instanceof ShowApplicantsButtonEvent){
long id = ((ShowApplicantsButtonEvent) event).getId();
SectionStack sectionStack2 = new SectionStack();
sectionStack2.setWidth100();
sectionStack2.setHeight(25);
String title = ((ShowApplicantsButtonEvent) event).getRef() + "- " +((ShowApplicantsButtonEvent) event).getJob_title();
SectionStackSection section = new SectionStackSection(title);
section.setCanCollapse(false);
section.setExpanded(false);
ListGrid grid2 = new ListGrid();
managerRegistry.getDataManager().setCursor(null);
// grid2.setDataSource(new ApplicationDataSource(managerRegistry, id));
grid2.setDataSource(new PageApplicationDataSource(managerRegistry, id));
grid2.setAutoFetchData(true);
//grid2.setDataPageSize(250);
grid2.addRecordClickHandler(new RecordClickHandler(){
public void onRecordClick(RecordClickEvent event){
ListGridRecord record = (ListGridRecord) event.getRecord();
ApplicantWindow viewer = new ApplicantWindow(managerRegistry, record);
//viewer.addListener(new InternalListener());
//System.out.println(record.getAttribute("job_title"));
//viewer.setAdTitle(record.getAttribute("job_title"));
viewer.show();
}
});
// section.addItem(grid);
sectionStack2.addSection(section);
VacancyView.this.removeMember(sectionStack);
VacancyView.this.removeMember(grid);
VacancyView.this.addMember(sectionStack2);
VacancyView.this.addMember(grid2);
}
}
}
} | UTF-8 | Java | 8,612 | java | VacancyView.java | Java | [] | null | [] | package za.co.moxomo.client.ui;
import za.co.moxomo.client.manager.ManagerRegistry;
import za.co.moxomo.client.model.ApplicationDataSource;
import za.co.moxomo.client.model.PageApplicationDataSource;
import za.co.moxomo.client.model.PagedVacancyDataSource;
import za.co.moxomo.client.model.VacancyDataSource;
import za.co.moxomo.client.support.event.ApplicationEvent;
import za.co.moxomo.client.support.event.ApplicationEventListener;
import za.co.moxomo.client.support.event.ApplicationEventListenerCollection;
import za.co.moxomo.client.support.event.ApplicationEventSource;
import za.co.moxomo.client.ui.event.LoginEvent;
import za.co.moxomo.client.ui.event.ShowApplicantsButtonEvent;
import za.co.moxomo.client.ui.event.ShowApplicantsGridEvent;
import za.co.moxomo.client.ui.event.VacancyExpiredEvent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.AutoFitWidthApproach;
import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.SelectionAppearance;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.SelectionType;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.events.CloseClickEvent;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.grid.events.SelectionEvent;
import com.smartgwt.client.widgets.layout.SectionStack;
import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;
//import com.smartgwt.client.widgets.grid.events.SelectionEvent;
public class VacancyView extends VLayout implements ApplicationEventSource {
private final ApplicationEventListenerCollection listeners;
private static final String DESCRIPTION = "VacancyView";
private ListGrid grid;
private SectionStack sectionStack;
private ManagerRegistry managerRegistry;
public VacancyView(final ManagerRegistry managerRegistry) {
this.managerRegistry = managerRegistry;
listeners = new ApplicationEventListenerCollection();
GWT.log("init VacancyView()...", null);
// initialise the Account View layout container
this.setStyleName("crm-ContextArea");
this.setWidth("*");
sectionStack = new SectionStack();
sectionStack.setWidth100();
sectionStack.setHeight(25);
String title = "My Ads";
SectionStackSection section = new SectionStackSection(title);
section.setCanCollapse(true);
section.setExpanded(false);
grid = new ListGrid();
//VacancyDataSource ds = new VacancyDataSource(managerRegistry);
// ds.getRequestProperties().setAttribute("search_param", "param");
//grid.setDataSource(new VacancyDataSource(managerRegistry));
grid.setDataSource(new PagedVacancyDataSource(managerRegistry));
//grid.
managerRegistry.getDataManager().setCursor(null);
grid.setAutoFetchData(true);
grid.setDataPageSize(250);
grid.setEmptyMessage("No Ads to show");
//grid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
//grid.setSelectionType(SelectionStyle.MULTIPLE);
//grid.setAlign(Alignment.LEFT);
//grid.setMembersMargin(2);
//grid.setAutoFitData(Autofit.BOTH);
//grid.setWrapCells(true);
//grid.setCanResizeFields(true);
grid.setWidth100();
grid.setHeight100();
//grid.setTop(75);
// grid.s
//grid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
//final VacancyViewer viewer = new VacancyViewer(managerRegistry);
/*grid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent event) {
viewer.setTitle(event.getRecord().getAttributeAsString("job_title"));
viewer.show();
}
});*/
grid.addRecordClickHandler(new RecordClickHandler(){
public void onRecordClick(RecordClickEvent event){
ListGridRecord record = (ListGridRecord) event.getRecord();
VacancyViewer viewer = new VacancyViewer(record,grid , managerRegistry);
viewer.addListener(new InternalListener());
//System.out.println(record.getAttribute("job_title"));
//viewer.setAdTitle(record.getAttribute("job_title"));
viewer.show();
}
});
//grid.setAutoWidth();
//grid.setOverflow(Overflow.AUTO);
// add the List Grid to the Account View layout container
//this.addMember(new VacancyListGrid(managerRegistry));
//section.setItems(grid);
sectionStack.setSections(section);
this.addMember(sectionStack);
this.addMember(grid);
History.newItem(DESCRIPTION);
}
public void addListener(ApplicationEventListener listener) {
listeners.add(listener);
}
/**
* {@inheritDoc}
*/
public void removeListener(ApplicationEventListener listener) {
listeners.remove(listener);
}
/**
* {@inheritDoc}
*/
public void clearListeners() {
listeners.clear();
}
/**
* Fires the given event to all the registerred listener.
*
* @param event
* The event to fire.
*/
protected void fireEvent(ApplicationEvent event) {
listeners.fireEvent(event);
}
public static class Factory implements ContextAreaFactory {
private String id;
public Canvas create(ManagerRegistry managerRegistry) {
VacancyView view = new VacancyView(managerRegistry);
id = view.getID();
GWT.log("VacancyView.Factory.create()->view.getID() - " + id, null);
return view;
}
public Canvas create(ManagerRegistry managerRegistry, ClickHandler clickHandler){
return null;
}
public String getID() {
return id;
}
public String getDescription() {
return DESCRIPTION;
}
}
class VacancyRecord extends ListGridRecord {
public VacancyRecord(){
}
public long getID(){
return getAttributeAsInt("id");
}
}
protected class InternalListener implements ApplicationEventListener {
@Override
public void handle(ApplicationEvent event) {
if (event instanceof VacancyExpiredEvent) {
System.out.println("I am listening");
grid.removeData( ((VacancyExpiredEvent) event).getRecord());
}
if(event instanceof ShowApplicantsButtonEvent){
long id = ((ShowApplicantsButtonEvent) event).getId();
SectionStack sectionStack2 = new SectionStack();
sectionStack2.setWidth100();
sectionStack2.setHeight(25);
String title = ((ShowApplicantsButtonEvent) event).getRef() + "- " +((ShowApplicantsButtonEvent) event).getJob_title();
SectionStackSection section = new SectionStackSection(title);
section.setCanCollapse(false);
section.setExpanded(false);
ListGrid grid2 = new ListGrid();
managerRegistry.getDataManager().setCursor(null);
// grid2.setDataSource(new ApplicationDataSource(managerRegistry, id));
grid2.setDataSource(new PageApplicationDataSource(managerRegistry, id));
grid2.setAutoFetchData(true);
//grid2.setDataPageSize(250);
grid2.addRecordClickHandler(new RecordClickHandler(){
public void onRecordClick(RecordClickEvent event){
ListGridRecord record = (ListGridRecord) event.getRecord();
ApplicantWindow viewer = new ApplicantWindow(managerRegistry, record);
//viewer.addListener(new InternalListener());
//System.out.println(record.getAttribute("job_title"));
//viewer.setAdTitle(record.getAttribute("job_title"));
viewer.show();
}
});
// section.addItem(grid);
sectionStack2.addSection(section);
VacancyView.this.removeMember(sectionStack);
VacancyView.this.removeMember(grid);
VacancyView.this.addMember(sectionStack2);
VacancyView.this.addMember(grid2);
}
}
}
} | 8,612 | 0.707385 | 0.703089 | 256 | 31.648438 | 25.89389 | 129 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.996094 | false | false | 6 |
64449ac4dfe63a866ffa01d7112bc068e129604c | 4,990,752,060,628 | f03573c79e4b018c858ccd7b31e9ed9be6c010ff | /BankBalanceDispensingSystem/src/main/java/com/banking/system/domain/Client.java | 982a1b4b8acd3f8d551ce6ca807fda28e98ca6af | [] | no_license | JimmyRZA/spring-boot-project | https://github.com/JimmyRZA/spring-boot-project | eb20a49a6f676cbdfce0bc2b2bb5169200ad2387 | 5c18439d7b968a1e9cf7d4b0f7cd40fce3e8ff98 | refs/heads/main | 2023-04-06T16:44:36.111000 | 2021-03-31T17:58:55 | 2021-03-31T17:58:55 | 353,439,201 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.banking.system.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Client {
@Id
private int clientId;
private String title;
private String name;
private String surname;
private String dob;
private String clientSubTypeCode;
public Client() {
}
public Client(int clientId, String title, String name, String surname, String dob, String clientSubTypeCode) {
super();
this.clientId = clientId;
this.title = title;
this.name = name;
this.surname = surname;
this.dob = dob;
this.clientSubTypeCode = clientSubTypeCode;
}
public int getClientId() {
return clientId;
}
public void setClientId(int clientId) {
this.clientId = clientId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getClientSubTypeCode() {
return clientSubTypeCode;
}
public void setClientSubTypeCode(String clientSubTypeCode) {
this.clientSubTypeCode = clientSubTypeCode;
}
}
| UTF-8 | Java | 1,348 | java | Client.java | Java | [
{
"context": "Id = clientId;\n\t\tthis.title = title;\n\t\tthis.name = name;\n\t\tthis.surname = surname;\n\t\tthis.dob = dob;\n\t\tth",
"end": 504,
"score": 0.8108228445053101,
"start": 500,
"tag": "NAME",
"value": "name"
}
] | null | [] | package com.banking.system.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Client {
@Id
private int clientId;
private String title;
private String name;
private String surname;
private String dob;
private String clientSubTypeCode;
public Client() {
}
public Client(int clientId, String title, String name, String surname, String dob, String clientSubTypeCode) {
super();
this.clientId = clientId;
this.title = title;
this.name = name;
this.surname = surname;
this.dob = dob;
this.clientSubTypeCode = clientSubTypeCode;
}
public int getClientId() {
return clientId;
}
public void setClientId(int clientId) {
this.clientId = clientId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getClientSubTypeCode() {
return clientSubTypeCode;
}
public void setClientSubTypeCode(String clientSubTypeCode) {
this.clientSubTypeCode = clientSubTypeCode;
}
}
| 1,348 | 0.715875 | 0.715875 | 71 | 17.985916 | 18.205782 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.605634 | false | false | 6 |
029c84519d5be5561461e74ac332c52791b89fb6 | 7,507,602,858,505 | 0f326b71735c7c9f1a441d02d7813dd007b60bdd | /errai-bus/src/main/java/org/jboss/errai/bus/server/service/bootstrap/DefaultServices.java | 84d7d501f167f0003c404e709e34d906169a9af0 | [] | no_license | errai/errai | https://github.com/errai/errai | 9e389a494c374f42ea1d42d2b4d9bd6b3b6259b6 | d2edc4632373096f8d81c93f18cd874fa5501b90 | refs/heads/main | 2023-08-29T05:58:04.637000 | 2022-09-29T13:18:10 | 2022-09-29T13:18:10 | 899,555 | 190 | 157 | null | false | 2022-12-12T21:43:18 | 2010-09-09T19:28:54 | 2022-09-24T11:33:27 | 2022-12-12T21:43:17 | 222,508 | 274 | 189 | 9 | Java | false | false | /*
* Copyright (C) 2012 Red Hat, Inc. and/or its affiliates.
*
* 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.jboss.errai.bus.server.service.bootstrap;
import org.jboss.errai.bus.client.api.base.MessageBuilder;
import org.jboss.errai.bus.client.api.messaging.Message;
import org.jboss.errai.bus.client.api.messaging.MessageCallback;
import org.jboss.errai.bus.server.api.ServerMessageBus;
import org.jboss.errai.bus.server.service.ErraiService;
/**
* Setup the default services.
*
* @author: Heiko Braun <hbraun@redhat.com>
* @date: May 3, 2010
*/
class DefaultServices implements BootstrapExecution {
public void execute(final BootstrapContext context) {
final ServerMessageBus bus = context.getBus();
/**
* The standard ServerEchoService.
*/
bus.subscribe(ErraiService.SERVER_ECHO_SERVICE, new MessageCallback() {
public void callback(Message c) {
MessageBuilder.createConversation(c)
.subjectProvided().noErrorHandling()
.sendNowWith(bus);
}
});
}
}
| UTF-8 | Java | 1,566 | java | DefaultServices.java | Java | [
{
"context": "\n/**\n * Setup the default services.\n *\n * @author: Heiko Braun <hbraun@redhat.com>\n * @date: May 3, 2010\n */\ncla",
"end": 1037,
"score": 0.9998472929000854,
"start": 1026,
"tag": "NAME",
"value": "Heiko Braun"
},
{
"context": "the default services.\n *\n * @autho... | null | [] | /*
* Copyright (C) 2012 Red Hat, Inc. and/or its affiliates.
*
* 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.jboss.errai.bus.server.service.bootstrap;
import org.jboss.errai.bus.client.api.base.MessageBuilder;
import org.jboss.errai.bus.client.api.messaging.Message;
import org.jboss.errai.bus.client.api.messaging.MessageCallback;
import org.jboss.errai.bus.server.api.ServerMessageBus;
import org.jboss.errai.bus.server.service.ErraiService;
/**
* Setup the default services.
*
* @author: <NAME> <<EMAIL>>
* @date: May 3, 2010
*/
class DefaultServices implements BootstrapExecution {
public void execute(final BootstrapContext context) {
final ServerMessageBus bus = context.getBus();
/**
* The standard ServerEchoService.
*/
bus.subscribe(ErraiService.SERVER_ECHO_SERVICE, new MessageCallback() {
public void callback(Message c) {
MessageBuilder.createConversation(c)
.subjectProvided().noErrorHandling()
.sendNowWith(bus);
}
});
}
}
| 1,551 | 0.723499 | 0.715198 | 48 | 31.625 | 26.874418 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.354167 | false | false | 6 |
1594e96b62b5d76eaeec34c6cf7271d5fd620ef0 | 22,308,060,201,937 | 2dc55280583e54cd3745fad4145eb7a0712eb503 | /stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/LargeStringHolderBigDataHandler.java | ccc4352e97bc3958e1cc5aceb6d8eb49004be5f9 | [] | no_license | markus512/stardust.engine | https://github.com/markus512/stardust.engine | 9d5f4fd7016a38c5b3a1fe09cc7a445c00a31b57 | 76e0b326446e440468b4ab54cfb8e26a6403f7d8 | refs/heads/master | 2022-02-06T23:03:21.305000 | 2016-03-09T14:56:01 | 2016-03-09T14:56:01 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*******************************************************************************
* Copyright (c) 2011, 2012 SunGard CSA LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SunGard CSA LLC - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.stardust.engine.core.runtime.beans;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.eclipse.stardust.common.Base64;
import org.eclipse.stardust.common.Money;
import org.eclipse.stardust.common.Pair;
import org.eclipse.stardust.common.Period;
import org.eclipse.stardust.common.Serialization;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.common.Unknown;
import org.eclipse.stardust.common.error.InternalException;
import org.eclipse.stardust.common.error.PublicException;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
import org.eclipse.stardust.engine.api.model.IData;
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.engine.api.runtime.BpmRuntimeError;
import org.eclipse.stardust.engine.core.persistence.Persistent;
import org.eclipse.stardust.engine.core.pojo.data.Type;
import org.eclipse.stardust.engine.core.struct.DataXPathMap;
import org.eclipse.stardust.engine.core.struct.IXPathMap;
import org.eclipse.stardust.engine.core.struct.StructuredTypeRtUtils;
import org.eclipse.stardust.engine.core.struct.TypedXPath;
import org.eclipse.stardust.engine.core.struct.beans.IStructuredDataValue;
import org.eclipse.stardust.engine.core.struct.beans.StructuredDataValueBean;
/**
* @author ubirkemeyer
* @version $Revision$
*/
public class LargeStringHolderBigDataHandler implements BigDataHandler
{
public static final Logger trace = LogManager.getLogger(
LargeStringHolderBigDataHandler.class);
private static Object UNKNOWN_OBJECT = new Object();
private BigData data;
private Class persistentType;
private Object value = UNKNOWN_OBJECT;
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyType(IData data)
{
if (data.getType().getId().equals(PredefinedConstants.PRIMITIVE_DATA))
{
Type type = (Type) data.getAttribute(PredefinedConstants.TYPE_ATT);
if (type.equals(Type.Boolean)
|| type.equals(Type.Byte)
|| type.equals(Type.Short)
|| type.equals(Type.Integer)
|| type.equals(Type.Long)
|| type.equals(Type.Timestamp))
{
return BigData.NUMERIC_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
else
{
return BigData.UNKNOWN_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @param attributeName The name of the data attribute to search for (XPath, etc.)
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyType(IData data, String attributeName)
{
if ( !(StructuredTypeRtUtils.isDmsType(data.getType().getId()) || StructuredTypeRtUtils.isStructuredType(data.getType().getId())))
{
// not a structured data
return classifyType(data);
}
// and now special treatment for structured data
if (attributeName == null)
{
// whole value of structured data is returned, neither NUMERIC_VALUE, nor STRING_VALUE
return BigData.UNKNOWN_VALUE;
}
IXPathMap xPathMap = DataXPathMap.getXPathMap(data);
int dataType = xPathMap.getXPath(attributeName).getType();
if (dataType == BigData.BOOLEAN || dataType == BigData.BYTE
|| dataType == BigData.SHORT || dataType == BigData.INTEGER
|| dataType == BigData.LONG || dataType == BigData.DATE)
{
return BigData.NUMERIC_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyTypeForSorting(IData data)
{
if (data.getType().getId().equals(PredefinedConstants.PRIMITIVE_DATA))
{
Type type = (Type) data.getAttribute(PredefinedConstants.TYPE_ATT);
if (type.equals(Type.Boolean)
|| type.equals(Type.Byte)
|| type.equals(Type.Short)
|| type.equals(Type.Integer)
|| type.equals(Type.Long)
|| type.equals(Type.Timestamp))
{
return BigData.NUMERIC_VALUE;
}
else if (type.equals(Type.Float)
|| type.equals(Type.Double)
|| type.equals(Type.Money))
{
return BigData.DOUBLE_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
else
{
return BigData.UNKNOWN_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @param attributeName The name of the data attribute to search for (XPath, etc.)
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyTypeForSorting(IData data, String attributeName)
{
if ( !(StructuredTypeRtUtils.isDmsType(data.getType().getId()) || StructuredTypeRtUtils.isStructuredType(data.getType().getId())))
{
// not a structured data
return classifyTypeForSorting(data);
}
// and now special treatment for structured data
if (attributeName == null)
{
// whole value of structured data is returned, neither NUMERIC_VALUE, nor STRING_VALUE
return BigData.UNKNOWN_VALUE;
}
IXPathMap xPathMap = DataXPathMap.getXPathMap(data);
int dataType = xPathMap.getXPath(attributeName).getType();
String xsdTypeName = xPathMap.getXPath(attributeName).getXsdTypeName();
if (dataType == BigData.BOOLEAN || dataType == BigData.BYTE
|| dataType == BigData.SHORT || dataType == BigData.INTEGER
|| dataType == BigData.LONG || dataType == BigData.DATE)
{
return BigData.NUMERIC_VALUE;
}
else if (dataType == BigData.FLOAT || dataType == BigData.DOUBLE
|| dataType == BigData.MONEY ||
"decimal".equals(xsdTypeName))
{
return BigData.DOUBLE_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
/**
* Evaluates the canonical representation of the given data value.
*
* @param dataValue
* @return <code>null</code>, a <code>Long</code> or a <code>String</code> representing
* the given data value.
*/
public static Representation canonicalizeDataValue(int shortStringDataSize,
Object dataValue)
{
Representation canonicalValue;
if (dataValue instanceof Pair)
{
Pair pair = (Pair) dataValue;
final Representation firstCanonicalValue = canonicalizeAtomicDataValue(
shortStringDataSize, pair.getFirst());
final Representation secondCanonicalValue = canonicalizeAtomicDataValue(
shortStringDataSize, pair.getSecond());
if (firstCanonicalValue.getSizeNeutralTypeKey()
!= secondCanonicalValue.getSizeNeutralTypeKey())
{
throw new PublicException(
BpmRuntimeError.BPMRT_INCONSISTENT_PAIR_VALUES.raise(pair.getFirst(),
pair.getSecond()));
}
final Representation representationTemplate = firstCanonicalValue.isLarge()
? firstCanonicalValue : secondCanonicalValue;
canonicalValue = new Representation(representationTemplate.getClassificationKey(),
representationTemplate.getTypeKey(),
new Pair(firstCanonicalValue.getRepresentation(),
secondCanonicalValue.getRepresentation()));
}
else if (dataValue instanceof Collection)
{
Representation template = null;
List values = new ArrayList(((Collection) dataValue).size());
for (Iterator i = ((Collection) dataValue).iterator(); i.hasNext();)
{
Representation representation = canonicalizeAtomicDataValue(
shortStringDataSize, i.next());
if ((null != template)
&& (template.getSizeNeutralTypeKey()
!= representation.getSizeNeutralTypeKey()))
{
throw new PublicException(
BpmRuntimeError.BPMRT_INCONSISTENT_COLLECTION_VALUES.raise(
template.getRepresentation(),
representation.getRepresentation()));
}
values.add(representation.getRepresentation());
template = ((null == template) || representation.isLarge())
? representation : template;
}
canonicalValue = new Representation(template.getClassificationKey(),
template.getTypeKey(), values);
}
else
{
canonicalValue = canonicalizeAtomicDataValue(shortStringDataSize, dataValue);
}
return canonicalValue;
}
public static Representation canonicalizeAtomicDataValue(int shortStringDataSize,
Object dataValue)
{
if (dataValue == null)
{
return new Representation(BigData.NULL_VALUE, BigData.NULL, null);
}
else if (dataValue instanceof Short)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.SHORT,
new Long(((Short) dataValue).longValue()));
}
else if (dataValue instanceof Integer)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.INTEGER,
new Long(((Integer) dataValue).longValue()));
}
else if (dataValue instanceof Long)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.LONG, dataValue);
}
else if (dataValue instanceof Byte)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.BYTE,
new Long(((Byte) dataValue).longValue()));
}
else if (dataValue instanceof Boolean)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.BOOLEAN,
new Long(((Boolean) dataValue).booleanValue() ? 1 : 0));
}
else if (dataValue instanceof Date)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.DATE,
new Long(((Date) dataValue).getTime()));
}
else if (dataValue instanceof Float)
{
return new Representation(BigData.DOUBLE_VALUE, BigData.FLOAT,
((Float) dataValue).doubleValue());
}
else if (dataValue instanceof Double)
{
return new Representation(BigData.DOUBLE_VALUE, BigData.DOUBLE,
((Double) dataValue).doubleValue());
}
else if (dataValue instanceof Character)
{
return new Representation(BigData.STRING_VALUE, BigData.CHAR,
dataValue.toString());
}
else if (dataValue instanceof Money)
{
return new Representation(BigData.STRING_VALUE, BigData.MONEY,
dataValue.toString());
}
else if (dataValue instanceof BigDecimal)
{
return new Representation(BigData.STRING_VALUE, BigData.STRING,
dataValue.toString());
}
else if (dataValue instanceof String)
{
String stringValue = dataValue.toString();
if (stringValue.length() <= shortStringDataSize)
{
return new Representation(BigData.STRING_VALUE, BigData.STRING, stringValue);
}
else
{
return new Representation(BigData.STRING_VALUE, BigData.BIG_STRING,
stringValue);
}
}
else if (dataValue instanceof Serializable)
{
try
{
String stringifiedObject = new String(Base64.encode(Serialization
.serializeObject((Serializable) dataValue)));
if (stringifiedObject.length() <= shortStringDataSize)
{
return new Representation(BigData.STRING_VALUE, BigData.SERIALIZABLE,
stringifiedObject);
}
else
{
return new Representation(BigData.STRING_VALUE, BigData.BIG_SERIALIZABLE,
stringifiedObject);
}
}
catch (IOException e)
{
throw new InternalException("Cannot serialize value for data.", e);
}
}
else
{
throw new InternalException("Type '" + dataValue.getClass().getName()
+ "' not supported (check if the type is serializable).");
}
}
/**
* public static ClosableIterator getObjects(Class type, Object value)
* {
* // @todo 2.0.2
* Class valueType = value.getClass();
* if (valueType == String.class)
* {
* if (((String) value).length() < 1000)
* {
* DatabaseDriver databasedriver = (DatabaseDriver) AuditTrailTxContextHelper.
* getCurrentConnection();
* return databasedriver.getIterator(type,
* "type_value = " + BigData.STRING + " and string_value = " + value);
* }
* }
* }
*/
public LargeStringHolderBigDataHandler(BigData data)
{
this.data = data;
persistentType = data.getClass();
}
private long getOID()
{
return data.getOID();
}
private boolean considerDisk()
{
return (data instanceof Persistent)
&& (null != ((Persistent) data).getPersistenceController())
&& !((Persistent) data).getPersistenceController().isCreated();
}
public Object read()
{
if (value != UNKNOWN_OBJECT)
{
return value;
}
else if (data.getType() == BigData.NULL)
{
value = null;
}
else if (data.getType() == BigData.SHORT)
{
value = new Short((short) data.getLongValue());
}
else if (data.getType() == BigData.INTEGER)
{
value = new Integer((int) data.getLongValue());
}
else if (data.getType() == BigData.LONG)
{
value = new Long(data.getLongValue());
}
else if (data.getType() == BigData.BYTE)
{
value = new Byte((byte) data.getLongValue());
}
else if (data.getType() == BigData.BOOLEAN)
{
value = data.getLongValue() == 1 ? Boolean.TRUE : Boolean.FALSE;
}
else if (data.getType() == BigData.DATE)
{
value = new Date(data.getLongValue());
}
else if (data.getType() == BigData.FLOAT)
{
value = new Float(data.getShortStringValue());
}
else if (data.getType() == BigData.DOUBLE)
{
value = new Double(data.getShortStringValue());
}
else if (data.getType() == BigData.CHAR)
{
value = new Character(StringUtils.isEmpty(data.getShortStringValue())
? (char) 0
: data.getShortStringValue().charAt(0));
}
else if (data.getType() == BigData.MONEY)
{
value = new Money(data.getShortStringValue());
}
else if (data.getType() == BigData.PERIOD)
{
value = new Period(data.getShortStringValue());
}
else if (data.getType() == BigData.DECIMAL)
{
value = new BigDecimal(data.getShortStringValue());
}
else if (data.getType() == BigData.STRING)
{
value = data.getShortStringValue();
}
else if (data.getType() == BigData.BIG_STRING)
{
value = LargeStringHolder.getLargeString(getOID(), persistentType, considerDisk());
}
else if (data.getType() == BigData.SERIALIZABLE)
{
try
{
value = Serialization.deserializeObject(
Base64.decode(data.getShortStringValue().getBytes()));
}
catch (IOException e)
{
throw new InternalException("Cannot deserialize value of data.", e);
}
catch (ClassNotFoundException e)
{
throw new InternalException("Cannot deserialize value of data.", e);
}
}
else if (data.getType() == BigData.BIG_SERIALIZABLE)
{
final int maxTries = 2;
int triesLeft = maxTries;
while (triesLeft > 0)
{
--triesLeft;
String stringifiedValue = LargeStringHolder.getLargeString(getOID(),
persistentType, considerDisk());
if ( !StringUtils.isEmpty(stringifiedValue))
{
try
{
value = Serialization.deserializeObject(Base64.decode(stringifiedValue
.getBytes()));
break;
}
catch (IOException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
catch (ClassNotFoundException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
catch(InternalException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
trace.warn("Problems while deserializing data of type BIG_SERIALIZABLE. Try again.");
}
else
{
value = null;
break;
}
}
}
else
{
throw new InternalException("Type '" + data.getType() + "' not known.");
}
return value;
}
public void refresh()
{
if (data.getType() == BigData.BIG_SERIALIZABLE || data.getType() == BigData.BIG_STRING)
{
LargeStringHolder.deleteAllForOID(getOID(), persistentType, considerDisk());
}
if (value == null)
{
data.setLongValue(0);
data.setShortStringValue(null);
data.setDoubleValue(Unknown.DOUBLE);
data.setType(BigData.NULL);
return;
}
if (value instanceof Short)
{
data.setLongValue(((Short) value).shortValue());
data.setType(BigData.SHORT);
}
else if (value instanceof Integer)
{
data.setLongValue(((Integer) value).intValue());
data.setType(BigData.INTEGER);
}
else if (value instanceof Long)
{
data.setLongValue(((Long) value).longValue());
data.setType(BigData.LONG);
}
else if (value instanceof Byte)
{
data.setLongValue(((Byte) value).byteValue());
data.setType(BigData.BYTE);
}
else if (value instanceof Boolean)
{
data.setLongValue(((Boolean) value).booleanValue() ? 1 : 0);
data.setType(BigData.BOOLEAN);
}
else if (value instanceof Date)
{
data.setLongValue(((Date) value).getTime());
data.setType(BigData.DATE);
}
else if (value instanceof Float)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((Float) value).doubleValue());
data.setType(BigData.FLOAT);
}
else if (value instanceof Double)
{
data.setShortStringValue(value.toString());
data.setDoubleValue((Double) value);
data.setType(BigData.DOUBLE);
}
else if (value instanceof Character)
{
data.setShortStringValue((((char) 0) == ((Character) value).charValue())
? null
: value.toString());
data.setType(BigData.CHAR);
}
else if (value instanceof Money)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((Money) value).doubleValue());
data.setType(BigData.MONEY);
}
else if (value instanceof Period)
{
data.setShortStringValue(value.toString());
data.setType(BigData.PERIOD);
}
else if (value instanceof BigDecimal)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((BigDecimal) value).doubleValue());
data.setType(BigData.STRING);
}
else if (value instanceof String)
{
if (data instanceof IStructuredDataValue)
{
boolean tryParseDouble = true;
StructuredDataValueBean sdv = (StructuredDataValueBean) data;
ModelManager modelManager = ModelManagerFactory.getCurrent();
long modelOid = sdv.getProcessInstance().getModelOID();
IData theData = modelManager.findDataForStructuredData(modelOid,
sdv.getXPathOID());
if (theData != null)
{
IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
TypedXPath typedXPath = xPathMap.getXPath(sdv.getXPathOID());
if (typedXPath == null)
{
StringBuffer errorMsg = new StringBuffer();
errorMsg.append("Could not find XPath for structured data: ");
errorMsg.append(theData.getId());
errorMsg.append(" for xpath oid ");
errorMsg.append(sdv.getXPathOID());
trace.warn(errorMsg);
tryParseDouble = false;
}
else
{
String xsdTypeName = typedXPath.getXsdTypeName();
tryParseDouble = "decimal".equals(xsdTypeName);
}
}
else
{
tryParseDouble = true;
}
if (tryParseDouble)
{
try
{
// As xsd:decimal is stored as string it is tried to convert to
// double
double parsedDouble = Double.parseDouble((String) value);
if (!Double.isNaN(parsedDouble))
{
data.setDoubleValue(parsedDouble);
}
}
catch (NumberFormatException x)
{
trace.debug("Cannot parse as a double: " + value, x);
data.setDoubleValue(Unknown.DOUBLE);
}
}
}
writeStringValue((String) value, BigData.STRING, BigData.BIG_STRING,
considerDisk());
}
else
{
String stringifiedValue;
try
{
if (value instanceof Serializable)
{
stringifiedValue = new String(Base64.encode(Serialization
.serializeObject((Serializable) value)));
}
else
{
throw new NotSerializableException(value.getClass().getName());
}
}
catch (NotSerializableException e)
{
throw new PublicException(
BpmRuntimeError.BPMRT_INPUT_NOT_SERIALIZABLE.raise(), e);
}
catch (IOException e)
{
throw new InternalException("Cannot serialize value for data.", e);
}
writeStringValue(stringifiedValue, BigData.SERIALIZABLE,
BigData.BIG_SERIALIZABLE, considerDisk());
}
}
public void write(Object value, boolean forceRefresh)
{
if ( !forceRefresh)
{
if (((null == value) && (null == this.value))
|| ((null != value) && (null != this.value) && value.equals(this.value)))
{
return;
}
}
this.value = value;
refresh();
}
private void writeStringValue(String value, int smalltype, int bigtype,
boolean considerDisk)
{
if (value.length() <= data.getShortStringColumnLength())
{
data.setShortStringValue(value);
data.setType(smalltype);
}
else
{
data.setShortStringValue(value.substring(0, data.getShortStringColumnLength()));
data.setType(bigtype);
LargeStringHolder.setLargeString(getOID(), persistentType, value, considerDisk);
}
}
public static class Representation
{
private final int classificationKey;
private final int typeKey;
private final Object representation;
private Representation(int classificationKey, int typeKey, Object representation)
{
this.classificationKey = classificationKey;
this.typeKey = typeKey;
this.representation = representation;
}
public int getClassificationKey()
{
return classificationKey;
}
public int getTypeKey()
{
return typeKey;
}
public int getSizeNeutralTypeKey()
{
int sizeNeutralTypeKey;
switch (typeKey)
{
case BigData.BIG_STRING:
sizeNeutralTypeKey = BigData.STRING;
break;
case BigData.BIG_SERIALIZABLE:
sizeNeutralTypeKey = BigData.SERIALIZABLE;
break;
default:
sizeNeutralTypeKey = typeKey;
}
return sizeNeutralTypeKey;
}
public Object getRepresentation()
{
return representation;
}
public boolean isLarge()
{
return (typeKey == BigData.BIG_STRING)
|| (typeKey == BigData.BIG_SERIALIZABLE);
}
}
} | UTF-8 | Java | 28,344 | java | LargeStringHolderBigDataHandler.java | Java | [
{
"context": "ct.beans.StructuredDataValueBean;\n\n\n/**\n * @author ubirkemeyer\n * @version $Revision$\n */\npublic class LargeStri",
"end": 2142,
"score": 0.9980338215827942,
"start": 2131,
"tag": "USERNAME",
"value": "ubirkemeyer"
}
] | null | [] | /*******************************************************************************
* Copyright (c) 2011, 2012 SunGard CSA LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SunGard CSA LLC - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.stardust.engine.core.runtime.beans;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.eclipse.stardust.common.Base64;
import org.eclipse.stardust.common.Money;
import org.eclipse.stardust.common.Pair;
import org.eclipse.stardust.common.Period;
import org.eclipse.stardust.common.Serialization;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.common.Unknown;
import org.eclipse.stardust.common.error.InternalException;
import org.eclipse.stardust.common.error.PublicException;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
import org.eclipse.stardust.engine.api.model.IData;
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.engine.api.runtime.BpmRuntimeError;
import org.eclipse.stardust.engine.core.persistence.Persistent;
import org.eclipse.stardust.engine.core.pojo.data.Type;
import org.eclipse.stardust.engine.core.struct.DataXPathMap;
import org.eclipse.stardust.engine.core.struct.IXPathMap;
import org.eclipse.stardust.engine.core.struct.StructuredTypeRtUtils;
import org.eclipse.stardust.engine.core.struct.TypedXPath;
import org.eclipse.stardust.engine.core.struct.beans.IStructuredDataValue;
import org.eclipse.stardust.engine.core.struct.beans.StructuredDataValueBean;
/**
* @author ubirkemeyer
* @version $Revision$
*/
public class LargeStringHolderBigDataHandler implements BigDataHandler
{
public static final Logger trace = LogManager.getLogger(
LargeStringHolderBigDataHandler.class);
private static Object UNKNOWN_OBJECT = new Object();
private BigData data;
private Class persistentType;
private Object value = UNKNOWN_OBJECT;
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyType(IData data)
{
if (data.getType().getId().equals(PredefinedConstants.PRIMITIVE_DATA))
{
Type type = (Type) data.getAttribute(PredefinedConstants.TYPE_ATT);
if (type.equals(Type.Boolean)
|| type.equals(Type.Byte)
|| type.equals(Type.Short)
|| type.equals(Type.Integer)
|| type.equals(Type.Long)
|| type.equals(Type.Timestamp))
{
return BigData.NUMERIC_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
else
{
return BigData.UNKNOWN_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @param attributeName The name of the data attribute to search for (XPath, etc.)
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyType(IData data, String attributeName)
{
if ( !(StructuredTypeRtUtils.isDmsType(data.getType().getId()) || StructuredTypeRtUtils.isStructuredType(data.getType().getId())))
{
// not a structured data
return classifyType(data);
}
// and now special treatment for structured data
if (attributeName == null)
{
// whole value of structured data is returned, neither NUMERIC_VALUE, nor STRING_VALUE
return BigData.UNKNOWN_VALUE;
}
IXPathMap xPathMap = DataXPathMap.getXPathMap(data);
int dataType = xPathMap.getXPath(attributeName).getType();
if (dataType == BigData.BOOLEAN || dataType == BigData.BYTE
|| dataType == BigData.SHORT || dataType == BigData.INTEGER
|| dataType == BigData.LONG || dataType == BigData.DATE)
{
return BigData.NUMERIC_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyTypeForSorting(IData data)
{
if (data.getType().getId().equals(PredefinedConstants.PRIMITIVE_DATA))
{
Type type = (Type) data.getAttribute(PredefinedConstants.TYPE_ATT);
if (type.equals(Type.Boolean)
|| type.equals(Type.Byte)
|| type.equals(Type.Short)
|| type.equals(Type.Integer)
|| type.equals(Type.Long)
|| type.equals(Type.Timestamp))
{
return BigData.NUMERIC_VALUE;
}
else if (type.equals(Type.Float)
|| type.equals(Type.Double)
|| type.equals(Type.Money))
{
return BigData.DOUBLE_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
else
{
return BigData.UNKNOWN_VALUE;
}
}
/**
* Classifies workflow data type representation into {@link BigData#NUMERIC_VALUE}s,
* {@link org.eclipse.stardust.engine.core.runtime.beans.BigData#STRING_VALUE}s, {@link BigData#NULL_VALUE}s and
* {@link BigData#UNKNOWN_VALUE}s. This classification gives a hint which
* {@link BigData} representation will be used for the actual value.
*
* @param data The workflow data to be classified.
* @param attributeName The name of the data attribute to search for (XPath, etc.)
* @return Either {@link BigData#NUMERIC_VALUE}, {@link BigData#STRING_VALUE},
* {@link BigData#NULL_VALUE} or {@link BigData#UNKNOWN_VALUE}.
*/
public static int classifyTypeForSorting(IData data, String attributeName)
{
if ( !(StructuredTypeRtUtils.isDmsType(data.getType().getId()) || StructuredTypeRtUtils.isStructuredType(data.getType().getId())))
{
// not a structured data
return classifyTypeForSorting(data);
}
// and now special treatment for structured data
if (attributeName == null)
{
// whole value of structured data is returned, neither NUMERIC_VALUE, nor STRING_VALUE
return BigData.UNKNOWN_VALUE;
}
IXPathMap xPathMap = DataXPathMap.getXPathMap(data);
int dataType = xPathMap.getXPath(attributeName).getType();
String xsdTypeName = xPathMap.getXPath(attributeName).getXsdTypeName();
if (dataType == BigData.BOOLEAN || dataType == BigData.BYTE
|| dataType == BigData.SHORT || dataType == BigData.INTEGER
|| dataType == BigData.LONG || dataType == BigData.DATE)
{
return BigData.NUMERIC_VALUE;
}
else if (dataType == BigData.FLOAT || dataType == BigData.DOUBLE
|| dataType == BigData.MONEY ||
"decimal".equals(xsdTypeName))
{
return BigData.DOUBLE_VALUE;
}
else
{
return BigData.STRING_VALUE;
}
}
/**
* Evaluates the canonical representation of the given data value.
*
* @param dataValue
* @return <code>null</code>, a <code>Long</code> or a <code>String</code> representing
* the given data value.
*/
public static Representation canonicalizeDataValue(int shortStringDataSize,
Object dataValue)
{
Representation canonicalValue;
if (dataValue instanceof Pair)
{
Pair pair = (Pair) dataValue;
final Representation firstCanonicalValue = canonicalizeAtomicDataValue(
shortStringDataSize, pair.getFirst());
final Representation secondCanonicalValue = canonicalizeAtomicDataValue(
shortStringDataSize, pair.getSecond());
if (firstCanonicalValue.getSizeNeutralTypeKey()
!= secondCanonicalValue.getSizeNeutralTypeKey())
{
throw new PublicException(
BpmRuntimeError.BPMRT_INCONSISTENT_PAIR_VALUES.raise(pair.getFirst(),
pair.getSecond()));
}
final Representation representationTemplate = firstCanonicalValue.isLarge()
? firstCanonicalValue : secondCanonicalValue;
canonicalValue = new Representation(representationTemplate.getClassificationKey(),
representationTemplate.getTypeKey(),
new Pair(firstCanonicalValue.getRepresentation(),
secondCanonicalValue.getRepresentation()));
}
else if (dataValue instanceof Collection)
{
Representation template = null;
List values = new ArrayList(((Collection) dataValue).size());
for (Iterator i = ((Collection) dataValue).iterator(); i.hasNext();)
{
Representation representation = canonicalizeAtomicDataValue(
shortStringDataSize, i.next());
if ((null != template)
&& (template.getSizeNeutralTypeKey()
!= representation.getSizeNeutralTypeKey()))
{
throw new PublicException(
BpmRuntimeError.BPMRT_INCONSISTENT_COLLECTION_VALUES.raise(
template.getRepresentation(),
representation.getRepresentation()));
}
values.add(representation.getRepresentation());
template = ((null == template) || representation.isLarge())
? representation : template;
}
canonicalValue = new Representation(template.getClassificationKey(),
template.getTypeKey(), values);
}
else
{
canonicalValue = canonicalizeAtomicDataValue(shortStringDataSize, dataValue);
}
return canonicalValue;
}
public static Representation canonicalizeAtomicDataValue(int shortStringDataSize,
Object dataValue)
{
if (dataValue == null)
{
return new Representation(BigData.NULL_VALUE, BigData.NULL, null);
}
else if (dataValue instanceof Short)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.SHORT,
new Long(((Short) dataValue).longValue()));
}
else if (dataValue instanceof Integer)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.INTEGER,
new Long(((Integer) dataValue).longValue()));
}
else if (dataValue instanceof Long)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.LONG, dataValue);
}
else if (dataValue instanceof Byte)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.BYTE,
new Long(((Byte) dataValue).longValue()));
}
else if (dataValue instanceof Boolean)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.BOOLEAN,
new Long(((Boolean) dataValue).booleanValue() ? 1 : 0));
}
else if (dataValue instanceof Date)
{
return new Representation(BigData.NUMERIC_VALUE, BigData.DATE,
new Long(((Date) dataValue).getTime()));
}
else if (dataValue instanceof Float)
{
return new Representation(BigData.DOUBLE_VALUE, BigData.FLOAT,
((Float) dataValue).doubleValue());
}
else if (dataValue instanceof Double)
{
return new Representation(BigData.DOUBLE_VALUE, BigData.DOUBLE,
((Double) dataValue).doubleValue());
}
else if (dataValue instanceof Character)
{
return new Representation(BigData.STRING_VALUE, BigData.CHAR,
dataValue.toString());
}
else if (dataValue instanceof Money)
{
return new Representation(BigData.STRING_VALUE, BigData.MONEY,
dataValue.toString());
}
else if (dataValue instanceof BigDecimal)
{
return new Representation(BigData.STRING_VALUE, BigData.STRING,
dataValue.toString());
}
else if (dataValue instanceof String)
{
String stringValue = dataValue.toString();
if (stringValue.length() <= shortStringDataSize)
{
return new Representation(BigData.STRING_VALUE, BigData.STRING, stringValue);
}
else
{
return new Representation(BigData.STRING_VALUE, BigData.BIG_STRING,
stringValue);
}
}
else if (dataValue instanceof Serializable)
{
try
{
String stringifiedObject = new String(Base64.encode(Serialization
.serializeObject((Serializable) dataValue)));
if (stringifiedObject.length() <= shortStringDataSize)
{
return new Representation(BigData.STRING_VALUE, BigData.SERIALIZABLE,
stringifiedObject);
}
else
{
return new Representation(BigData.STRING_VALUE, BigData.BIG_SERIALIZABLE,
stringifiedObject);
}
}
catch (IOException e)
{
throw new InternalException("Cannot serialize value for data.", e);
}
}
else
{
throw new InternalException("Type '" + dataValue.getClass().getName()
+ "' not supported (check if the type is serializable).");
}
}
/**
* public static ClosableIterator getObjects(Class type, Object value)
* {
* // @todo 2.0.2
* Class valueType = value.getClass();
* if (valueType == String.class)
* {
* if (((String) value).length() < 1000)
* {
* DatabaseDriver databasedriver = (DatabaseDriver) AuditTrailTxContextHelper.
* getCurrentConnection();
* return databasedriver.getIterator(type,
* "type_value = " + BigData.STRING + " and string_value = " + value);
* }
* }
* }
*/
public LargeStringHolderBigDataHandler(BigData data)
{
this.data = data;
persistentType = data.getClass();
}
private long getOID()
{
return data.getOID();
}
private boolean considerDisk()
{
return (data instanceof Persistent)
&& (null != ((Persistent) data).getPersistenceController())
&& !((Persistent) data).getPersistenceController().isCreated();
}
public Object read()
{
if (value != UNKNOWN_OBJECT)
{
return value;
}
else if (data.getType() == BigData.NULL)
{
value = null;
}
else if (data.getType() == BigData.SHORT)
{
value = new Short((short) data.getLongValue());
}
else if (data.getType() == BigData.INTEGER)
{
value = new Integer((int) data.getLongValue());
}
else if (data.getType() == BigData.LONG)
{
value = new Long(data.getLongValue());
}
else if (data.getType() == BigData.BYTE)
{
value = new Byte((byte) data.getLongValue());
}
else if (data.getType() == BigData.BOOLEAN)
{
value = data.getLongValue() == 1 ? Boolean.TRUE : Boolean.FALSE;
}
else if (data.getType() == BigData.DATE)
{
value = new Date(data.getLongValue());
}
else if (data.getType() == BigData.FLOAT)
{
value = new Float(data.getShortStringValue());
}
else if (data.getType() == BigData.DOUBLE)
{
value = new Double(data.getShortStringValue());
}
else if (data.getType() == BigData.CHAR)
{
value = new Character(StringUtils.isEmpty(data.getShortStringValue())
? (char) 0
: data.getShortStringValue().charAt(0));
}
else if (data.getType() == BigData.MONEY)
{
value = new Money(data.getShortStringValue());
}
else if (data.getType() == BigData.PERIOD)
{
value = new Period(data.getShortStringValue());
}
else if (data.getType() == BigData.DECIMAL)
{
value = new BigDecimal(data.getShortStringValue());
}
else if (data.getType() == BigData.STRING)
{
value = data.getShortStringValue();
}
else if (data.getType() == BigData.BIG_STRING)
{
value = LargeStringHolder.getLargeString(getOID(), persistentType, considerDisk());
}
else if (data.getType() == BigData.SERIALIZABLE)
{
try
{
value = Serialization.deserializeObject(
Base64.decode(data.getShortStringValue().getBytes()));
}
catch (IOException e)
{
throw new InternalException("Cannot deserialize value of data.", e);
}
catch (ClassNotFoundException e)
{
throw new InternalException("Cannot deserialize value of data.", e);
}
}
else if (data.getType() == BigData.BIG_SERIALIZABLE)
{
final int maxTries = 2;
int triesLeft = maxTries;
while (triesLeft > 0)
{
--triesLeft;
String stringifiedValue = LargeStringHolder.getLargeString(getOID(),
persistentType, considerDisk());
if ( !StringUtils.isEmpty(stringifiedValue))
{
try
{
value = Serialization.deserializeObject(Base64.decode(stringifiedValue
.getBytes()));
break;
}
catch (IOException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
catch (ClassNotFoundException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
catch(InternalException e)
{
if (0 == triesLeft)
{
throw new InternalException("Cannot deserialize value of data in " + maxTries + " tries.", e);
}
}
trace.warn("Problems while deserializing data of type BIG_SERIALIZABLE. Try again.");
}
else
{
value = null;
break;
}
}
}
else
{
throw new InternalException("Type '" + data.getType() + "' not known.");
}
return value;
}
public void refresh()
{
if (data.getType() == BigData.BIG_SERIALIZABLE || data.getType() == BigData.BIG_STRING)
{
LargeStringHolder.deleteAllForOID(getOID(), persistentType, considerDisk());
}
if (value == null)
{
data.setLongValue(0);
data.setShortStringValue(null);
data.setDoubleValue(Unknown.DOUBLE);
data.setType(BigData.NULL);
return;
}
if (value instanceof Short)
{
data.setLongValue(((Short) value).shortValue());
data.setType(BigData.SHORT);
}
else if (value instanceof Integer)
{
data.setLongValue(((Integer) value).intValue());
data.setType(BigData.INTEGER);
}
else if (value instanceof Long)
{
data.setLongValue(((Long) value).longValue());
data.setType(BigData.LONG);
}
else if (value instanceof Byte)
{
data.setLongValue(((Byte) value).byteValue());
data.setType(BigData.BYTE);
}
else if (value instanceof Boolean)
{
data.setLongValue(((Boolean) value).booleanValue() ? 1 : 0);
data.setType(BigData.BOOLEAN);
}
else if (value instanceof Date)
{
data.setLongValue(((Date) value).getTime());
data.setType(BigData.DATE);
}
else if (value instanceof Float)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((Float) value).doubleValue());
data.setType(BigData.FLOAT);
}
else if (value instanceof Double)
{
data.setShortStringValue(value.toString());
data.setDoubleValue((Double) value);
data.setType(BigData.DOUBLE);
}
else if (value instanceof Character)
{
data.setShortStringValue((((char) 0) == ((Character) value).charValue())
? null
: value.toString());
data.setType(BigData.CHAR);
}
else if (value instanceof Money)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((Money) value).doubleValue());
data.setType(BigData.MONEY);
}
else if (value instanceof Period)
{
data.setShortStringValue(value.toString());
data.setType(BigData.PERIOD);
}
else if (value instanceof BigDecimal)
{
data.setShortStringValue(value.toString());
data.setDoubleValue(((BigDecimal) value).doubleValue());
data.setType(BigData.STRING);
}
else if (value instanceof String)
{
if (data instanceof IStructuredDataValue)
{
boolean tryParseDouble = true;
StructuredDataValueBean sdv = (StructuredDataValueBean) data;
ModelManager modelManager = ModelManagerFactory.getCurrent();
long modelOid = sdv.getProcessInstance().getModelOID();
IData theData = modelManager.findDataForStructuredData(modelOid,
sdv.getXPathOID());
if (theData != null)
{
IXPathMap xPathMap = DataXPathMap.getXPathMap(theData);
TypedXPath typedXPath = xPathMap.getXPath(sdv.getXPathOID());
if (typedXPath == null)
{
StringBuffer errorMsg = new StringBuffer();
errorMsg.append("Could not find XPath for structured data: ");
errorMsg.append(theData.getId());
errorMsg.append(" for xpath oid ");
errorMsg.append(sdv.getXPathOID());
trace.warn(errorMsg);
tryParseDouble = false;
}
else
{
String xsdTypeName = typedXPath.getXsdTypeName();
tryParseDouble = "decimal".equals(xsdTypeName);
}
}
else
{
tryParseDouble = true;
}
if (tryParseDouble)
{
try
{
// As xsd:decimal is stored as string it is tried to convert to
// double
double parsedDouble = Double.parseDouble((String) value);
if (!Double.isNaN(parsedDouble))
{
data.setDoubleValue(parsedDouble);
}
}
catch (NumberFormatException x)
{
trace.debug("Cannot parse as a double: " + value, x);
data.setDoubleValue(Unknown.DOUBLE);
}
}
}
writeStringValue((String) value, BigData.STRING, BigData.BIG_STRING,
considerDisk());
}
else
{
String stringifiedValue;
try
{
if (value instanceof Serializable)
{
stringifiedValue = new String(Base64.encode(Serialization
.serializeObject((Serializable) value)));
}
else
{
throw new NotSerializableException(value.getClass().getName());
}
}
catch (NotSerializableException e)
{
throw new PublicException(
BpmRuntimeError.BPMRT_INPUT_NOT_SERIALIZABLE.raise(), e);
}
catch (IOException e)
{
throw new InternalException("Cannot serialize value for data.", e);
}
writeStringValue(stringifiedValue, BigData.SERIALIZABLE,
BigData.BIG_SERIALIZABLE, considerDisk());
}
}
public void write(Object value, boolean forceRefresh)
{
if ( !forceRefresh)
{
if (((null == value) && (null == this.value))
|| ((null != value) && (null != this.value) && value.equals(this.value)))
{
return;
}
}
this.value = value;
refresh();
}
private void writeStringValue(String value, int smalltype, int bigtype,
boolean considerDisk)
{
if (value.length() <= data.getShortStringColumnLength())
{
data.setShortStringValue(value);
data.setType(smalltype);
}
else
{
data.setShortStringValue(value.substring(0, data.getShortStringColumnLength()));
data.setType(bigtype);
LargeStringHolder.setLargeString(getOID(), persistentType, value, considerDisk);
}
}
public static class Representation
{
private final int classificationKey;
private final int typeKey;
private final Object representation;
private Representation(int classificationKey, int typeKey, Object representation)
{
this.classificationKey = classificationKey;
this.typeKey = typeKey;
this.representation = representation;
}
public int getClassificationKey()
{
return classificationKey;
}
public int getTypeKey()
{
return typeKey;
}
public int getSizeNeutralTypeKey()
{
int sizeNeutralTypeKey;
switch (typeKey)
{
case BigData.BIG_STRING:
sizeNeutralTypeKey = BigData.STRING;
break;
case BigData.BIG_SERIALIZABLE:
sizeNeutralTypeKey = BigData.SERIALIZABLE;
break;
default:
sizeNeutralTypeKey = typeKey;
}
return sizeNeutralTypeKey;
}
public Object getRepresentation()
{
return representation;
}
public boolean isLarge()
{
return (typeKey == BigData.BIG_STRING)
|| (typeKey == BigData.BIG_SERIALIZABLE);
}
}
} | 28,344 | 0.583474 | 0.581922 | 836 | 32.905502 | 27.816847 | 136 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.477273 | false | false | 6 |
17011ccee0de12dc67e7e449c41b58218e474a1b | 4,174,708,222,031 | afeb235a220f48b61f0b69cfb1901e8dd9244f46 | /mybatisall/mybatis_005_multi-table queries/src/test/java/com/qdyinfukeji/test/Test01.java | 57f2bcd434bd01df9defd1dc6eac2ef587b1351f | [] | no_license | YFKJQD79/projectForGit | https://github.com/YFKJQD79/projectForGit | c566a1991081f4b91144596bc7f714a04a44a701 | 72fff1d8aae07386072303582eb8643427703ab1 | refs/heads/master | 2023-08-11T07:08:47.762000 | 2021-09-23T08:46:38 | 2021-09-23T08:46:38 | 409,455,195 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.qdyinfukeji.test;
import com.qdyinfukeji.mapper.CustomerMapper;
import com.qdyinfukeji.mapper.OrdersMapper;
import com.qdyinfukeji.pojo.Customer;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 音符科技
* 2021/5/17
*/
public class Test01 {
// UsersMapper mapper;
SqlSession sqlSession;
// BookMapper bookMapper;
CustomerMapper customerMapper;
//OrdersMapper ordersMapper;
@Before //在所有@test执行之前,先执行@before里的代码
public void openSqlSession() throws Exception {
InputStream inputStream = Resources.getResourceAsStream("SqlMapConfig.xml");
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(inputStream);
sqlSession = factory.openSession();
//得到动态代理的对象
// mapper = sqlSession.getMapper(UsersMapper.class);
// bookMapper=sqlSession.getMapper(BookMapper.class);
customerMapper=sqlSession.getMapper(CustomerMapper.class);
// ordersMapper=sqlSession.getMapper(OrdersMapper.class);
//System.out.println(mapper.getClass());
System.out.println(customerMapper.getClass());
// System.out.println(ordersMapper.getClass());
}
@Test
public void testGetById(){
Customer customer=customerMapper.getById(3);
System.out.println(customer);
}
@After
public void closeSqlSession() {
sqlSession.close();
}
}
| UTF-8 | Java | 1,776 | java | Test01.java | Java | [] | null | [] | package com.qdyinfukeji.test;
import com.qdyinfukeji.mapper.CustomerMapper;
import com.qdyinfukeji.mapper.OrdersMapper;
import com.qdyinfukeji.pojo.Customer;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 音符科技
* 2021/5/17
*/
public class Test01 {
// UsersMapper mapper;
SqlSession sqlSession;
// BookMapper bookMapper;
CustomerMapper customerMapper;
//OrdersMapper ordersMapper;
@Before //在所有@test执行之前,先执行@before里的代码
public void openSqlSession() throws Exception {
InputStream inputStream = Resources.getResourceAsStream("SqlMapConfig.xml");
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(inputStream);
sqlSession = factory.openSession();
//得到动态代理的对象
// mapper = sqlSession.getMapper(UsersMapper.class);
// bookMapper=sqlSession.getMapper(BookMapper.class);
customerMapper=sqlSession.getMapper(CustomerMapper.class);
// ordersMapper=sqlSession.getMapper(OrdersMapper.class);
//System.out.println(mapper.getClass());
System.out.println(customerMapper.getClass());
// System.out.println(ordersMapper.getClass());
}
@Test
public void testGetById(){
Customer customer=customerMapper.getById(3);
System.out.println(customer);
}
@After
public void closeSqlSession() {
sqlSession.close();
}
}
| 1,776 | 0.726744 | 0.72093 | 58 | 28.655172 | 22.505594 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.568965 | false | false | 6 |
317fc88a2adfb821d2e590a0ad7d8072824866ea | 25,477,746,053,284 | 999b07c9fde0adb612fd36888547c4c802b0ec0a | /src/test/java/com/cukes/stepdefs/itemsearchStepdefs.java | 8b05cde0733bd54c0eac1ec7515f360a0a373886 | [] | no_license | ralphherrera/ecomautomation | https://github.com/ralphherrera/ecomautomation | 09c4de8ddaeb98761f634863999106af7d20b25d | c11a5426de61409340351ea581a354ee7587b697 | refs/heads/master | 2020-04-11T01:27:34.001000 | 2017-12-18T07:01:49 | 2017-12-18T07:01:49 | 161,416,244 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cukes.stepdefs;
import com.cukes.controller.TestScenarioController;
import com.cukes.utils.CommonMgmtUtil;
import com.cukes.utils.PerformAction;
import cucumber.api.java8.En;
public class itemsearchStepdefs implements En {
public itemsearchStepdefs(ScenarioHooks hooks, PerformAction performAction,
TestScenarioController testScenarioController) {
When("^I searched for an item$", () -> {
String gherkinStep = "When I searched for an item";
CommonMgmtUtil.executeSteps(gherkinStep, testScenarioController, performAction);
});
Then("^I should see relevant items displayed$", () -> {
String gherkinStep = "Then I should see relevant items displayed";
CommonMgmtUtil.executeSteps(gherkinStep, testScenarioController, performAction);
});
}
}
| UTF-8 | Java | 806 | java | itemsearchStepdefs.java | Java | [] | null | [] | package com.cukes.stepdefs;
import com.cukes.controller.TestScenarioController;
import com.cukes.utils.CommonMgmtUtil;
import com.cukes.utils.PerformAction;
import cucumber.api.java8.En;
public class itemsearchStepdefs implements En {
public itemsearchStepdefs(ScenarioHooks hooks, PerformAction performAction,
TestScenarioController testScenarioController) {
When("^I searched for an item$", () -> {
String gherkinStep = "When I searched for an item";
CommonMgmtUtil.executeSteps(gherkinStep, testScenarioController, performAction);
});
Then("^I should see relevant items displayed$", () -> {
String gherkinStep = "Then I should see relevant items displayed";
CommonMgmtUtil.executeSteps(gherkinStep, testScenarioController, performAction);
});
}
}
| 806 | 0.75062 | 0.74938 | 24 | 31.583334 | 28.978321 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.875 | false | false | 6 |
ca958c03194736d9cb2472b0424ba19170031b4a | 11,759,620,475,270 | ec54b6fe413c6991d8eef5378fc1e5654d1699cc | /bperan/src/main/java/es/project/bperan/pojo/Bajalaboral.java | 31a6d30a7cd8df1954da6952fda87b6d18fe7205 | [] | no_license | fredofm/bperan | https://github.com/fredofm/bperan | 74216eda07f81eeca3ea60ede91035ec659a36e5 | 054bc45cb3dbad2295bc0f72f967a236bd703126 | refs/heads/master | 2021-01-21T15:21:53.932000 | 2018-03-02T09:54:35 | 2018-03-02T09:54:35 | 56,164,991 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package es.project.bperan.pojo;
// Generated 28-abr-2016 22:22:17 by Hibernate Tools 5.1.0.Alpha1
import java.util.Date;
/**
* Bajalaboral generated by hbm2java
*/
public class Bajalaboral implements java.io.Serializable {
private Integer idbajalaboral;
private Empleado empleado;
private Date fechaInicio;
private Date fechaFin;
private String tipo;
public Bajalaboral() {
}
public Bajalaboral(Empleado empleado, Date fechaInicio, Date fechaFin, String tipo) {
this.empleado = empleado;
this.fechaInicio = fechaInicio;
this.fechaFin = fechaFin;
this.tipo = tipo;
}
public Integer getIdbajalaboral() {
return this.idbajalaboral;
}
public void setIdbajalaboral(Integer idbajalaboral) {
this.idbajalaboral = idbajalaboral;
}
public Empleado getEmpleado() {
return this.empleado;
}
public void setEmpleado(Empleado empleado) {
this.empleado = empleado;
}
public Date getFechaInicio() {
return this.fechaInicio;
}
public void setFechaInicio(Date fechaInicio) {
this.fechaInicio = fechaInicio;
}
public Date getFechaFin() {
return this.fechaFin;
}
public void setFechaFin(Date fechaFin) {
this.fechaFin = fechaFin;
}
public String getTipo() {
return this.tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
}
| UTF-8 | Java | 1,357 | java | Bajalaboral.java | Java | [] | null | [] | package es.project.bperan.pojo;
// Generated 28-abr-2016 22:22:17 by Hibernate Tools 5.1.0.Alpha1
import java.util.Date;
/**
* Bajalaboral generated by hbm2java
*/
public class Bajalaboral implements java.io.Serializable {
private Integer idbajalaboral;
private Empleado empleado;
private Date fechaInicio;
private Date fechaFin;
private String tipo;
public Bajalaboral() {
}
public Bajalaboral(Empleado empleado, Date fechaInicio, Date fechaFin, String tipo) {
this.empleado = empleado;
this.fechaInicio = fechaInicio;
this.fechaFin = fechaFin;
this.tipo = tipo;
}
public Integer getIdbajalaboral() {
return this.idbajalaboral;
}
public void setIdbajalaboral(Integer idbajalaboral) {
this.idbajalaboral = idbajalaboral;
}
public Empleado getEmpleado() {
return this.empleado;
}
public void setEmpleado(Empleado empleado) {
this.empleado = empleado;
}
public Date getFechaInicio() {
return this.fechaInicio;
}
public void setFechaInicio(Date fechaInicio) {
this.fechaInicio = fechaInicio;
}
public Date getFechaFin() {
return this.fechaFin;
}
public void setFechaFin(Date fechaFin) {
this.fechaFin = fechaFin;
}
public String getTipo() {
return this.tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
}
| 1,357 | 0.6986 | 0.686072 | 67 | 18.253731 | 19.003019 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.208955 | false | false | 6 |
2314fe65bd51b8d46b4448b7efb540b087eed93f | 146,028,950,032 | 37c3c81e0a745592784d31b0a27d45ad8e68cab0 | /app/src/main/java/com/example/senseHat/View/GraphAngleView.java | 59dd8d9c98fef9107e90b7e0b4c0f47182dd626f | [] | no_license | Milosz161199/SenseHat_AndroidApp | https://github.com/Milosz161199/SenseHat_AndroidApp | bb3dc3c8a041de9f0057b6a027b829b87d8e24c6 | fd9400d6126d7105a7f93b1fa82beff41c247adb | refs/heads/master | 2023-06-16T23:38:32.056000 | 2021-07-08T20:01:24 | 2021-07-08T20:01:24 | 371,768,627 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* *****************************************************************************
*
* @file Sense Hat/GraphActivityAngle.java
* @author Milosz Plutowski
* @version V1.0
* @date 15-06-2021
* @brief Sense Hat: Angles measurements activity with data charts
* *****************************************************************************
*/
package com.example.senseHat.View;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.senseHat.Model.Common;
import com.example.senseHat.Model.MeasurementModel;
import com.example.senseHat.R;
import com.example.senseHat.Model.TestableClass;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.LegendRenderer;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
import java.util.Timer;
import java.util.TimerTask;
import static java.lang.Double.isNaN;
public class GraphAngleView<mList> extends AppCompatActivity {
/* BEGIN config data */
private String ipAddress = Common.DEFAULT_IP_ADDRESS;
private int sampleTime = Common.DEFAULT_SAMPLE_TIME;
private int dataGraphMaxDataPointsNumber = Common.DEFAULT_MAX_NUMBER_OF_SAMPLES;
/* END config data */
/* BEGIN widgets */
private Switch swRoll;
private Switch swPitch;
private Switch swYaw;
/* BEGIN booleans */
private boolean angleRollBoolean = true;
private boolean anglePitchBoolean = true;
private boolean angleYawBoolean = true;
/* END booleans */
private TextView textViewIP;
private TextView textViewSampleTime;
private TextView textViewError;
private GraphView dataGraph;
private GraphView dataGraphRoll;
private GraphView dataGraphYaw;
private GraphView dataGraphPitch;
private LineGraphSeries<DataPoint> dataSeriesRoll;
private LineGraphSeries<DataPoint> dataSeriesPitch;
private LineGraphSeries<DataPoint> dataSeriesYaw;
//private final int dataGraphMaxDataPointsNumber = 1000;
private final double dataGraphMaxX = 10.0d;
private final double dataGraphMinX = 0.0d;
private final double dataGraphMaxY = 360.0d;
private final double dataGraphMinY = 0.0d;
private AlertDialog.Builder configAlterDialog;
/* END widgets */
/* BEGIN request timer */
private RequestQueue queue;
private Timer requestTimer;
private long requestTimerTimeStamp = 0;
private long requestTimerPreviousTime = -1;
private boolean requestTimerFirstRequest = true;
private boolean requestTimerFirstRequestAfterStop;
private TimerTask requestTimerTask;
private final Handler handler = new Handler();
/* END request timer */
/* Testable module */
private TestableClass responseHandling = new TestableClass();
public GraphAngleView() {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_graph_angle);
/* BEGIN initialize widgets */
/* BEGIN initialize Switches */
swRoll = (Switch) findViewById(R.id.swRoll);
swPitch = (Switch) findViewById(R.id.swPitch);
swYaw = (Switch) findViewById(R.id.swYaw);
/* BEGIN initialize TextViews */
textViewIP = findViewById(R.id.textViewIP);
textViewIP.setText(getIpAddressDisplayText(ipAddress));
textViewSampleTime = findViewById(R.id.textViewSampleTime);
textViewSampleTime.setText(getSampleTimeDisplayText(Integer.toString(sampleTime)));
textViewError = findViewById(R.id.textViewErrorMsg);
textViewError.setText("");
/* END initialize TextViews */
/* BEGIN initialize GraphView */
InitGraphView();
/* END initialize GraphView */
/* BEGIN config alter dialog */
configAlterDialog = new AlertDialog.Builder(GraphAngleView.this);
configAlterDialog.setTitle("This will STOP data acquisition. Proceed?");
configAlterDialog.setIcon(android.R.drawable.ic_dialog_alert);
configAlterDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
stopRequestTimerTask();
openConfig();
}
});
configAlterDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
/* END config alter dialog */
/* END initialize widgets */
// Initialize Volley request queue
queue = Volley.newRequestQueue(GraphAngleView.this);
/**
* @brief switch to true and enable 'roll' data to graph
*/
swRoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Roll...", Toast.LENGTH_SHORT).show();
angleRollBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Roll...", Toast.LENGTH_SHORT).show();
angleRollBoolean = false;
}
}
});
/**
* @brief switch to true and enable 'pitch' data to graph
*/
swPitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Pitch...", Toast.LENGTH_SHORT).show();
anglePitchBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Pitch...", Toast.LENGTH_SHORT).show();
anglePitchBoolean = false;
}
}
});
/**
* @brief switch to true and enable 'yaw' data to graph
*/
swYaw.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Yaw...", Toast.LENGTH_SHORT).show();
angleYawBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Yaw...", Toast.LENGTH_SHORT).show();
angleYawBoolean = false;
}
}
});
}
/**
* @brief Init GraphViews.
*/
private void InitGraphView() {
// https://github.com/jjoe64/GraphView/wiki
dataGraphRoll = (GraphView) findViewById(R.id.dataGraphRoll);
dataGraphPitch = (GraphView) findViewById(R.id.dataGraphPitch);
dataGraphYaw = (GraphView) findViewById(R.id.dataGraphYaw);
dataSeriesRoll = new LineGraphSeries<>(new DataPoint[]{});
dataSeriesPitch = new LineGraphSeries<>(new DataPoint[]{});
dataSeriesYaw = new LineGraphSeries<>(new DataPoint[]{});
dataGraphRoll.addSeries(dataSeriesRoll);
dataGraphPitch.addSeries(dataSeriesPitch);
dataGraphYaw.addSeries(dataSeriesYaw);
dataGraphRoll.getViewport().setXAxisBoundsManual(true);
dataGraphRoll.getViewport().setYAxisBoundsManual(true);
dataGraphRoll.getViewport().setMinX(dataGraphMinX);
dataGraphRoll.getViewport().setMaxX(dataGraphMaxX);
dataGraphRoll.getViewport().setMinY(dataGraphMinY);
dataGraphRoll.getViewport().setMaxY(dataGraphMaxY);
dataGraphRoll.getViewport().setScalable(true);
dataGraphRoll.getViewport().setScrollable(true);
dataGraphPitch.getViewport().setXAxisBoundsManual(true);
dataGraphPitch.getViewport().setYAxisBoundsManual(true);
dataGraphPitch.getViewport().setMinX(dataGraphMinX);
dataGraphPitch.getViewport().setMaxX(dataGraphMaxX);
dataGraphPitch.getViewport().setMinY(dataGraphMinY);
dataGraphPitch.getViewport().setMaxY(dataGraphMaxY);
dataGraphPitch.getViewport().setScalable(true);
dataGraphPitch.getViewport().setScrollable(true);
dataGraphYaw.getViewport().setXAxisBoundsManual(true);
dataGraphYaw.getViewport().setYAxisBoundsManual(true);
dataGraphYaw.getViewport().setMinX(dataGraphMinX);
dataGraphYaw.getViewport().setMaxX(dataGraphMaxX);
dataGraphYaw.getViewport().setMinY(dataGraphMinY);
dataGraphYaw.getViewport().setMaxY(dataGraphMaxY);
dataGraphYaw.getViewport().setScalable(true);
dataGraphYaw.getViewport().setScrollable(true);
// refresh chart
dataGraphRoll.onDataChanged(true, true);
dataGraphRoll.getLegendRenderer().setVisible(true);
dataGraphRoll.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphRoll.getLegendRenderer().setTextSize(20);
dataGraphRoll.getGridLabelRenderer().setTextSize(14);
dataGraphRoll.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Roll [deg]");
dataGraphRoll.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphRoll.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphRoll.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphRoll.getGridLabelRenderer().setPadding(35);
dataGraphPitch.onDataChanged(true, true);
dataGraphPitch.getLegendRenderer().setVisible(true);
dataGraphPitch.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphPitch.getLegendRenderer().setTextSize(20);
dataGraphPitch.getGridLabelRenderer().setTextSize(14);
dataGraphPitch.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Pitch [deg]");
dataGraphPitch.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphPitch.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphPitch.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphPitch.getGridLabelRenderer().setPadding(35);
dataGraphYaw.onDataChanged(true, true);
dataGraphYaw.getLegendRenderer().setVisible(true);
dataGraphYaw.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphYaw.getLegendRenderer().setTextSize(20);
dataGraphYaw.getGridLabelRenderer().setTextSize(14);
dataGraphYaw.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Yaw [deg]");
dataGraphYaw.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphYaw.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphYaw.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphYaw.getGridLabelRenderer().setPadding(35);
}
/**
* @brief request for roll and pitch data
*/
private void madeRequestRollPitch() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
}
/**
* @brief request for roll and yaw data
*/
private void madeRequestRollYaw() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_YAW_DEG);
}
/**
* @brief request for yaw and pitch data
*/
private void madeRequestYawPitch() {
sendGetRequest(Common.REQ_YAW_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
}
/**
* @brief request for roll, pitch and yaw data
*/
private void madeRequestRollYawPitch() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
sendGetRequest(Common.REQ_YAW_DEG);
}
/**
* @brief creating request for angles data
*/
private void madeRequest() {
if (angleRollBoolean && !anglePitchBoolean && !angleYawBoolean) {
sendGetRequest(Common.REQ_ROLL_DEG);
}
if (!angleRollBoolean && anglePitchBoolean && !angleYawBoolean) {
sendGetRequest(Common.REQ_PITCH_DEG);
}
if (!angleRollBoolean && !anglePitchBoolean && angleYawBoolean) {
sendGetRequest(Common.REQ_YAW_DEG);
}
if (angleRollBoolean && anglePitchBoolean && !angleYawBoolean) {
madeRequestRollPitch();
}
if (angleRollBoolean && !anglePitchBoolean && angleYawBoolean) {
madeRequestRollYaw();
}
if (!angleRollBoolean && anglePitchBoolean && angleYawBoolean) {
madeRequestYawPitch();
}
if (angleRollBoolean && anglePitchBoolean && angleYawBoolean) {
madeRequestRollYawPitch();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent dataIntent) {
super.onActivityResult(requestCode, resultCode, dataIntent);
if ((requestCode == Common.REQUEST_CODE_CONFIG) && (resultCode == RESULT_OK)) {
// IoT server IP address
ipAddress = dataIntent.getStringExtra(Common.CONFIG_IP_ADDRESS);
textViewIP.setText(getIpAddressDisplayText(ipAddress));
Common.DEFAULT_IP_ADDRESS = ipAddress;
// Sample time (ms)
String sampleTimeText = dataIntent.getStringExtra(Common.CONFIG_SAMPLE_TIME);
sampleTime = Integer.parseInt(sampleTimeText);
textViewSampleTime.setText(getSampleTimeDisplayText(sampleTimeText));
Common.DEFAULT_SAMPLE_TIME = sampleTime;
// Max number of samples
String samplesText = dataIntent.getStringExtra(Common.CONFIG_MAX_NUMBER_OF_SAMPLES);
dataGraphMaxDataPointsNumber = Integer.parseInt(samplesText);
Common.DEFAULT_MAX_NUMBER_OF_SAMPLES = dataGraphMaxDataPointsNumber;
}
}
/**
* @param v the View (Button) that was clicked
* @brief Main activity button onClick procedure - common for all upper menu buttons
*/
public void btns_onClick(View v) {
switch (v.getId()) {
case R.id.configBtn: {
if (requestTimer != null)
configAlterDialog.show();
else
openConfig();
break;
}
case R.id.startBtn: {
startRequestTimer();
break;
}
case R.id.stopBtn: {
stopRequestTimerTask();
break;
}
default: {
// do nothing
}
}
}
/**
* @param ip IP address (string)
* @brief Create display text for IoT server IP address
* @retval Display text for textViewIP widget
*/
private String getIpAddressDisplayText(String ip) {
return ("IP: " + ip);
}
/**
* @param st Sample time in ms (string)
* @brief Create display text for requests sample time
* @retval Display text for textViewSampleTime widget
*/
private String getSampleTimeDisplayText(String st) {
return ("Sample time: " + st + " ms");
}
/**
* @param ip IP address (string)
* @param req added part of request (string)
* @brief Create JSON file URL from IoT server IP.
* @retval GET request URL
*/
private String getURL(String ip, String req) {
return ("http://" + ip + "/" + req);
}
/**
* @param n Number of spaces.
* @retval String with 'n' spaces.
*/
private String Space(int n) {
return new String(new char[n]).replace('\0', ' ');
}
/**
* @param errorCode local error codes, see: COMMON
* @brief Handles application errors. Logs an error and passes error code to GUI.
*/
private void errorHandling(int errorCode) {
switch (errorCode) {
case Common.ERROR_TIME_STAMP:
textViewError.setText("ERR #1");
Log.d("errorHandling", "Request time stamp error.");
break;
case Common.ERROR_NAN_DATA:
textViewError.setText("ERR #2");
Log.d("errorHandling", "Invalid JSON data.");
break;
case Common.ERROR_RESPONSE:
textViewError.setText("ERR #3");
Log.d("errorHandling", "GET request VolleyError.");
break;
default:
textViewError.setText("ERR ??");
Log.d("errorHandling", "Unknown error.");
break;
}
}
/**
* @brief Called when the user taps the 'Config' button.
*/
private void openConfig() {
Intent openConfigIntent = new Intent(this, ConfigView.class);
Bundle configBundle = new Bundle();
configBundle.putString(Common.CONFIG_IP_ADDRESS, ipAddress);
configBundle.putInt(Common.CONFIG_SAMPLE_TIME, sampleTime);
configBundle.putInt(Common.CONFIG_MAX_NUMBER_OF_SAMPLES, dataGraphMaxDataPointsNumber);
openConfigIntent.putExtras(configBundle);
startActivityForResult(openConfigIntent, Common.REQUEST_CODE_CONFIG);
}
/**
* @brief Starts new 'Timer' (if currently not exist) and schedules periodic task.
*/
private void startRequestTimer() {
if (requestTimer == null) {
// set a new Timer
requestTimer = new Timer();
// initialize the TimerTask's job
initializeRequestTimerTask();
requestTimer.schedule(requestTimerTask, 0, sampleTime);
// clear error message
textViewError.setText("");
}
}
/**
* @brief Stops request timer (if currently exist)
* and sets 'requestTimerFirstRequestAfterStop' flag.
*/
private void stopRequestTimerTask() {
// stop the timer, if it's not already null
if (requestTimer != null) {
requestTimer.cancel();
requestTimer = null;
requestTimerFirstRequestAfterStop = true;
}
}
/**
* @brief Initialize request timer period task with 'Handler' post method as 'sendGetRequest'.
*/
private void initializeRequestTimerTask() {
requestTimerTask = new TimerTask() {
public void run() {
handler.post(new Runnable() {
public void run() {
madeRequest();
}
});
}
};
}
/**
* @brief Sending GET request to IoT server using 'Volley'.
*/
private void sendGetRequest(String u) {
// Instantiate the RequestQueue with Volley
// https://javadoc.io/doc/com.android.volley/volley/1.1.0-rc2/index.html
String url = getURL(ipAddress, u);
// Request a string response from the provided URL
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
responseHandling(response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
errorHandling(Common.ERROR_RESPONSE);
}
});
// Add the request to the RequestQueue.
queue.add(stringRequest);
}
/**
* @brief Validation of client-side time stamp based on 'SystemClock'.
*/
private long getValidTimeStampIncrease(long currentTime) {
// Right after start remember current time and return 0
if (requestTimerFirstRequest) {
requestTimerPreviousTime = currentTime;
requestTimerFirstRequest = false;
return 0;
}
// After each stop return value not greater than sample time
// to avoid "holes" in the plot
if (requestTimerFirstRequestAfterStop) {
if ((currentTime - requestTimerPreviousTime) > sampleTime)
requestTimerPreviousTime = currentTime - sampleTime;
requestTimerFirstRequestAfterStop = false;
}
// If time difference is equal zero after start
// return sample time
if ((currentTime - requestTimerPreviousTime) == 0)
return sampleTime;
// Return time difference between current and previous request
return (currentTime - requestTimerPreviousTime);
}
/**
* @brief GET response handling - chart data series updated with IoT server data.
*/
private void responseHandling(String response) {
if (requestTimer != null) {
// get time stamp with SystemClock
long requestTimerCurrentTime = SystemClock.uptimeMillis(); // current time
requestTimerTimeStamp += getValidTimeStampIncrease(requestTimerCurrentTime);
// get raw data from JSON response
MeasurementModel m = new MeasurementModel("-", 0, "-", "-");
m = responseHandling.getRawDataFromResponseToDynamicTable(response);
// update chart
if (isNaN(m.mValue)) {
errorHandling(Common.ERROR_NAN_DATA);
} else {
// update plot series
double timeStamp = requestTimerTimeStamp / 1000.0; // [sec]
boolean scrollGraph = (timeStamp > dataGraphMaxX);
if (m.mName.equals("roll")) {
dataSeriesRoll.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesRoll.setTitle("Roll");
dataSeriesRoll.setColor(Color.BLUE);
}
if (m.mName.equals("pitch")) {
dataSeriesPitch.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesPitch.setTitle("Pitch");
dataSeriesPitch.setColor(Color.MAGENTA);
}
if (m.mName.equals("yaw")) {
dataSeriesYaw.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesYaw.setTitle("Yaw");
dataSeriesYaw.setColor(Color.GRAY);
}
// refresh chart
dataGraphRoll.onDataChanged(true, true);
dataGraphRoll.getLegendRenderer().setVisible(true);
dataGraphRoll.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphRoll.getLegendRenderer().setTextSize(30);
dataGraphRoll.getGridLabelRenderer().setTextSize(20);
dataGraphRoll.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Roll [deg]");
dataGraphRoll.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphRoll.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphRoll.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphRoll.getGridLabelRenderer().setPadding(35);
dataGraphPitch.onDataChanged(true, true);
dataGraphPitch.getLegendRenderer().setVisible(true);
dataGraphPitch.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphPitch.getLegendRenderer().setTextSize(30);
dataGraphPitch.getGridLabelRenderer().setTextSize(20);
dataGraphPitch.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Pitch [deg]");
dataGraphPitch.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphPitch.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphPitch.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphPitch.getGridLabelRenderer().setPadding(35);
dataGraphYaw.onDataChanged(true, true);
dataGraphYaw.getLegendRenderer().setVisible(true);
dataGraphYaw.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphYaw.getLegendRenderer().setTextSize(30);
dataGraphYaw.getGridLabelRenderer().setTextSize(20);
dataGraphYaw.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Yaw [deg]");
dataGraphYaw.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphYaw.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphYaw.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphYaw.getGridLabelRenderer().setPadding(35);
}
// remember previous time stamp
requestTimerPreviousTime = requestTimerCurrentTime;
}
}
}
| UTF-8 | Java | 25,692 | java | GraphAngleView.java | Java | [
{
"context": "@file Sense Hat/GraphActivityAngle.java\n * @author Milosz Plutowski\n * @version V1.0\n * @date 15-06-2021\n * @brief Se",
"end": 158,
"score": 0.9993433356285095,
"start": 142,
"tag": "NAME",
"value": "Milosz Plutowski"
},
{
"context": "d InitGraphView() {\n //... | null | [] | /**
* *****************************************************************************
*
* @file Sense Hat/GraphActivityAngle.java
* @author <NAME>
* @version V1.0
* @date 15-06-2021
* @brief Sense Hat: Angles measurements activity with data charts
* *****************************************************************************
*/
package com.example.senseHat.View;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.senseHat.Model.Common;
import com.example.senseHat.Model.MeasurementModel;
import com.example.senseHat.R;
import com.example.senseHat.Model.TestableClass;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.LegendRenderer;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
import java.util.Timer;
import java.util.TimerTask;
import static java.lang.Double.isNaN;
public class GraphAngleView<mList> extends AppCompatActivity {
/* BEGIN config data */
private String ipAddress = Common.DEFAULT_IP_ADDRESS;
private int sampleTime = Common.DEFAULT_SAMPLE_TIME;
private int dataGraphMaxDataPointsNumber = Common.DEFAULT_MAX_NUMBER_OF_SAMPLES;
/* END config data */
/* BEGIN widgets */
private Switch swRoll;
private Switch swPitch;
private Switch swYaw;
/* BEGIN booleans */
private boolean angleRollBoolean = true;
private boolean anglePitchBoolean = true;
private boolean angleYawBoolean = true;
/* END booleans */
private TextView textViewIP;
private TextView textViewSampleTime;
private TextView textViewError;
private GraphView dataGraph;
private GraphView dataGraphRoll;
private GraphView dataGraphYaw;
private GraphView dataGraphPitch;
private LineGraphSeries<DataPoint> dataSeriesRoll;
private LineGraphSeries<DataPoint> dataSeriesPitch;
private LineGraphSeries<DataPoint> dataSeriesYaw;
//private final int dataGraphMaxDataPointsNumber = 1000;
private final double dataGraphMaxX = 10.0d;
private final double dataGraphMinX = 0.0d;
private final double dataGraphMaxY = 360.0d;
private final double dataGraphMinY = 0.0d;
private AlertDialog.Builder configAlterDialog;
/* END widgets */
/* BEGIN request timer */
private RequestQueue queue;
private Timer requestTimer;
private long requestTimerTimeStamp = 0;
private long requestTimerPreviousTime = -1;
private boolean requestTimerFirstRequest = true;
private boolean requestTimerFirstRequestAfterStop;
private TimerTask requestTimerTask;
private final Handler handler = new Handler();
/* END request timer */
/* Testable module */
private TestableClass responseHandling = new TestableClass();
public GraphAngleView() {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_graph_angle);
/* BEGIN initialize widgets */
/* BEGIN initialize Switches */
swRoll = (Switch) findViewById(R.id.swRoll);
swPitch = (Switch) findViewById(R.id.swPitch);
swYaw = (Switch) findViewById(R.id.swYaw);
/* BEGIN initialize TextViews */
textViewIP = findViewById(R.id.textViewIP);
textViewIP.setText(getIpAddressDisplayText(ipAddress));
textViewSampleTime = findViewById(R.id.textViewSampleTime);
textViewSampleTime.setText(getSampleTimeDisplayText(Integer.toString(sampleTime)));
textViewError = findViewById(R.id.textViewErrorMsg);
textViewError.setText("");
/* END initialize TextViews */
/* BEGIN initialize GraphView */
InitGraphView();
/* END initialize GraphView */
/* BEGIN config alter dialog */
configAlterDialog = new AlertDialog.Builder(GraphAngleView.this);
configAlterDialog.setTitle("This will STOP data acquisition. Proceed?");
configAlterDialog.setIcon(android.R.drawable.ic_dialog_alert);
configAlterDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
stopRequestTimerTask();
openConfig();
}
});
configAlterDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
/* END config alter dialog */
/* END initialize widgets */
// Initialize Volley request queue
queue = Volley.newRequestQueue(GraphAngleView.this);
/**
* @brief switch to true and enable 'roll' data to graph
*/
swRoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Roll...", Toast.LENGTH_SHORT).show();
angleRollBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Roll...", Toast.LENGTH_SHORT).show();
angleRollBoolean = false;
}
}
});
/**
* @brief switch to true and enable 'pitch' data to graph
*/
swPitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Pitch...", Toast.LENGTH_SHORT).show();
anglePitchBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Pitch...", Toast.LENGTH_SHORT).show();
anglePitchBoolean = false;
}
}
});
/**
* @brief switch to true and enable 'yaw' data to graph
*/
swYaw.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Toast.makeText(getApplicationContext(), "+Yaw...", Toast.LENGTH_SHORT).show();
angleYawBoolean = true;
} else {
Toast.makeText(getApplicationContext(), "-Yaw...", Toast.LENGTH_SHORT).show();
angleYawBoolean = false;
}
}
});
}
/**
* @brief Init GraphViews.
*/
private void InitGraphView() {
// https://github.com/jjoe64/GraphView/wiki
dataGraphRoll = (GraphView) findViewById(R.id.dataGraphRoll);
dataGraphPitch = (GraphView) findViewById(R.id.dataGraphPitch);
dataGraphYaw = (GraphView) findViewById(R.id.dataGraphYaw);
dataSeriesRoll = new LineGraphSeries<>(new DataPoint[]{});
dataSeriesPitch = new LineGraphSeries<>(new DataPoint[]{});
dataSeriesYaw = new LineGraphSeries<>(new DataPoint[]{});
dataGraphRoll.addSeries(dataSeriesRoll);
dataGraphPitch.addSeries(dataSeriesPitch);
dataGraphYaw.addSeries(dataSeriesYaw);
dataGraphRoll.getViewport().setXAxisBoundsManual(true);
dataGraphRoll.getViewport().setYAxisBoundsManual(true);
dataGraphRoll.getViewport().setMinX(dataGraphMinX);
dataGraphRoll.getViewport().setMaxX(dataGraphMaxX);
dataGraphRoll.getViewport().setMinY(dataGraphMinY);
dataGraphRoll.getViewport().setMaxY(dataGraphMaxY);
dataGraphRoll.getViewport().setScalable(true);
dataGraphRoll.getViewport().setScrollable(true);
dataGraphPitch.getViewport().setXAxisBoundsManual(true);
dataGraphPitch.getViewport().setYAxisBoundsManual(true);
dataGraphPitch.getViewport().setMinX(dataGraphMinX);
dataGraphPitch.getViewport().setMaxX(dataGraphMaxX);
dataGraphPitch.getViewport().setMinY(dataGraphMinY);
dataGraphPitch.getViewport().setMaxY(dataGraphMaxY);
dataGraphPitch.getViewport().setScalable(true);
dataGraphPitch.getViewport().setScrollable(true);
dataGraphYaw.getViewport().setXAxisBoundsManual(true);
dataGraphYaw.getViewport().setYAxisBoundsManual(true);
dataGraphYaw.getViewport().setMinX(dataGraphMinX);
dataGraphYaw.getViewport().setMaxX(dataGraphMaxX);
dataGraphYaw.getViewport().setMinY(dataGraphMinY);
dataGraphYaw.getViewport().setMaxY(dataGraphMaxY);
dataGraphYaw.getViewport().setScalable(true);
dataGraphYaw.getViewport().setScrollable(true);
// refresh chart
dataGraphRoll.onDataChanged(true, true);
dataGraphRoll.getLegendRenderer().setVisible(true);
dataGraphRoll.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphRoll.getLegendRenderer().setTextSize(20);
dataGraphRoll.getGridLabelRenderer().setTextSize(14);
dataGraphRoll.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Roll [deg]");
dataGraphRoll.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphRoll.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphRoll.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphRoll.getGridLabelRenderer().setPadding(35);
dataGraphPitch.onDataChanged(true, true);
dataGraphPitch.getLegendRenderer().setVisible(true);
dataGraphPitch.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphPitch.getLegendRenderer().setTextSize(20);
dataGraphPitch.getGridLabelRenderer().setTextSize(14);
dataGraphPitch.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Pitch [deg]");
dataGraphPitch.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphPitch.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphPitch.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphPitch.getGridLabelRenderer().setPadding(35);
dataGraphYaw.onDataChanged(true, true);
dataGraphYaw.getLegendRenderer().setVisible(true);
dataGraphYaw.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphYaw.getLegendRenderer().setTextSize(20);
dataGraphYaw.getGridLabelRenderer().setTextSize(14);
dataGraphYaw.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Yaw [deg]");
dataGraphYaw.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphYaw.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphYaw.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphYaw.getGridLabelRenderer().setPadding(35);
}
/**
* @brief request for roll and pitch data
*/
private void madeRequestRollPitch() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
}
/**
* @brief request for roll and yaw data
*/
private void madeRequestRollYaw() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_YAW_DEG);
}
/**
* @brief request for yaw and pitch data
*/
private void madeRequestYawPitch() {
sendGetRequest(Common.REQ_YAW_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
}
/**
* @brief request for roll, pitch and yaw data
*/
private void madeRequestRollYawPitch() {
sendGetRequest(Common.REQ_ROLL_DEG);
sendGetRequest(Common.REQ_PITCH_DEG);
sendGetRequest(Common.REQ_YAW_DEG);
}
/**
* @brief creating request for angles data
*/
private void madeRequest() {
if (angleRollBoolean && !anglePitchBoolean && !angleYawBoolean) {
sendGetRequest(Common.REQ_ROLL_DEG);
}
if (!angleRollBoolean && anglePitchBoolean && !angleYawBoolean) {
sendGetRequest(Common.REQ_PITCH_DEG);
}
if (!angleRollBoolean && !anglePitchBoolean && angleYawBoolean) {
sendGetRequest(Common.REQ_YAW_DEG);
}
if (angleRollBoolean && anglePitchBoolean && !angleYawBoolean) {
madeRequestRollPitch();
}
if (angleRollBoolean && !anglePitchBoolean && angleYawBoolean) {
madeRequestRollYaw();
}
if (!angleRollBoolean && anglePitchBoolean && angleYawBoolean) {
madeRequestYawPitch();
}
if (angleRollBoolean && anglePitchBoolean && angleYawBoolean) {
madeRequestRollYawPitch();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent dataIntent) {
super.onActivityResult(requestCode, resultCode, dataIntent);
if ((requestCode == Common.REQUEST_CODE_CONFIG) && (resultCode == RESULT_OK)) {
// IoT server IP address
ipAddress = dataIntent.getStringExtra(Common.CONFIG_IP_ADDRESS);
textViewIP.setText(getIpAddressDisplayText(ipAddress));
Common.DEFAULT_IP_ADDRESS = ipAddress;
// Sample time (ms)
String sampleTimeText = dataIntent.getStringExtra(Common.CONFIG_SAMPLE_TIME);
sampleTime = Integer.parseInt(sampleTimeText);
textViewSampleTime.setText(getSampleTimeDisplayText(sampleTimeText));
Common.DEFAULT_SAMPLE_TIME = sampleTime;
// Max number of samples
String samplesText = dataIntent.getStringExtra(Common.CONFIG_MAX_NUMBER_OF_SAMPLES);
dataGraphMaxDataPointsNumber = Integer.parseInt(samplesText);
Common.DEFAULT_MAX_NUMBER_OF_SAMPLES = dataGraphMaxDataPointsNumber;
}
}
/**
* @param v the View (Button) that was clicked
* @brief Main activity button onClick procedure - common for all upper menu buttons
*/
public void btns_onClick(View v) {
switch (v.getId()) {
case R.id.configBtn: {
if (requestTimer != null)
configAlterDialog.show();
else
openConfig();
break;
}
case R.id.startBtn: {
startRequestTimer();
break;
}
case R.id.stopBtn: {
stopRequestTimerTask();
break;
}
default: {
// do nothing
}
}
}
/**
* @param ip IP address (string)
* @brief Create display text for IoT server IP address
* @retval Display text for textViewIP widget
*/
private String getIpAddressDisplayText(String ip) {
return ("IP: " + ip);
}
/**
* @param st Sample time in ms (string)
* @brief Create display text for requests sample time
* @retval Display text for textViewSampleTime widget
*/
private String getSampleTimeDisplayText(String st) {
return ("Sample time: " + st + " ms");
}
/**
* @param ip IP address (string)
* @param req added part of request (string)
* @brief Create JSON file URL from IoT server IP.
* @retval GET request URL
*/
private String getURL(String ip, String req) {
return ("http://" + ip + "/" + req);
}
/**
* @param n Number of spaces.
* @retval String with 'n' spaces.
*/
private String Space(int n) {
return new String(new char[n]).replace('\0', ' ');
}
/**
* @param errorCode local error codes, see: COMMON
* @brief Handles application errors. Logs an error and passes error code to GUI.
*/
private void errorHandling(int errorCode) {
switch (errorCode) {
case Common.ERROR_TIME_STAMP:
textViewError.setText("ERR #1");
Log.d("errorHandling", "Request time stamp error.");
break;
case Common.ERROR_NAN_DATA:
textViewError.setText("ERR #2");
Log.d("errorHandling", "Invalid JSON data.");
break;
case Common.ERROR_RESPONSE:
textViewError.setText("ERR #3");
Log.d("errorHandling", "GET request VolleyError.");
break;
default:
textViewError.setText("ERR ??");
Log.d("errorHandling", "Unknown error.");
break;
}
}
/**
* @brief Called when the user taps the 'Config' button.
*/
private void openConfig() {
Intent openConfigIntent = new Intent(this, ConfigView.class);
Bundle configBundle = new Bundle();
configBundle.putString(Common.CONFIG_IP_ADDRESS, ipAddress);
configBundle.putInt(Common.CONFIG_SAMPLE_TIME, sampleTime);
configBundle.putInt(Common.CONFIG_MAX_NUMBER_OF_SAMPLES, dataGraphMaxDataPointsNumber);
openConfigIntent.putExtras(configBundle);
startActivityForResult(openConfigIntent, Common.REQUEST_CODE_CONFIG);
}
/**
* @brief Starts new 'Timer' (if currently not exist) and schedules periodic task.
*/
private void startRequestTimer() {
if (requestTimer == null) {
// set a new Timer
requestTimer = new Timer();
// initialize the TimerTask's job
initializeRequestTimerTask();
requestTimer.schedule(requestTimerTask, 0, sampleTime);
// clear error message
textViewError.setText("");
}
}
/**
* @brief Stops request timer (if currently exist)
* and sets 'requestTimerFirstRequestAfterStop' flag.
*/
private void stopRequestTimerTask() {
// stop the timer, if it's not already null
if (requestTimer != null) {
requestTimer.cancel();
requestTimer = null;
requestTimerFirstRequestAfterStop = true;
}
}
/**
* @brief Initialize request timer period task with 'Handler' post method as 'sendGetRequest'.
*/
private void initializeRequestTimerTask() {
requestTimerTask = new TimerTask() {
public void run() {
handler.post(new Runnable() {
public void run() {
madeRequest();
}
});
}
};
}
/**
* @brief Sending GET request to IoT server using 'Volley'.
*/
private void sendGetRequest(String u) {
// Instantiate the RequestQueue with Volley
// https://javadoc.io/doc/com.android.volley/volley/1.1.0-rc2/index.html
String url = getURL(ipAddress, u);
// Request a string response from the provided URL
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
responseHandling(response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
errorHandling(Common.ERROR_RESPONSE);
}
});
// Add the request to the RequestQueue.
queue.add(stringRequest);
}
/**
* @brief Validation of client-side time stamp based on 'SystemClock'.
*/
private long getValidTimeStampIncrease(long currentTime) {
// Right after start remember current time and return 0
if (requestTimerFirstRequest) {
requestTimerPreviousTime = currentTime;
requestTimerFirstRequest = false;
return 0;
}
// After each stop return value not greater than sample time
// to avoid "holes" in the plot
if (requestTimerFirstRequestAfterStop) {
if ((currentTime - requestTimerPreviousTime) > sampleTime)
requestTimerPreviousTime = currentTime - sampleTime;
requestTimerFirstRequestAfterStop = false;
}
// If time difference is equal zero after start
// return sample time
if ((currentTime - requestTimerPreviousTime) == 0)
return sampleTime;
// Return time difference between current and previous request
return (currentTime - requestTimerPreviousTime);
}
/**
* @brief GET response handling - chart data series updated with IoT server data.
*/
private void responseHandling(String response) {
if (requestTimer != null) {
// get time stamp with SystemClock
long requestTimerCurrentTime = SystemClock.uptimeMillis(); // current time
requestTimerTimeStamp += getValidTimeStampIncrease(requestTimerCurrentTime);
// get raw data from JSON response
MeasurementModel m = new MeasurementModel("-", 0, "-", "-");
m = responseHandling.getRawDataFromResponseToDynamicTable(response);
// update chart
if (isNaN(m.mValue)) {
errorHandling(Common.ERROR_NAN_DATA);
} else {
// update plot series
double timeStamp = requestTimerTimeStamp / 1000.0; // [sec]
boolean scrollGraph = (timeStamp > dataGraphMaxX);
if (m.mName.equals("roll")) {
dataSeriesRoll.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesRoll.setTitle("Roll");
dataSeriesRoll.setColor(Color.BLUE);
}
if (m.mName.equals("pitch")) {
dataSeriesPitch.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesPitch.setTitle("Pitch");
dataSeriesPitch.setColor(Color.MAGENTA);
}
if (m.mName.equals("yaw")) {
dataSeriesYaw.appendData(new DataPoint(timeStamp, m.mValue), scrollGraph, dataGraphMaxDataPointsNumber);
dataSeriesYaw.setTitle("Yaw");
dataSeriesYaw.setColor(Color.GRAY);
}
// refresh chart
dataGraphRoll.onDataChanged(true, true);
dataGraphRoll.getLegendRenderer().setVisible(true);
dataGraphRoll.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphRoll.getLegendRenderer().setTextSize(30);
dataGraphRoll.getGridLabelRenderer().setTextSize(20);
dataGraphRoll.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Roll [deg]");
dataGraphRoll.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphRoll.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphRoll.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphRoll.getGridLabelRenderer().setPadding(35);
dataGraphPitch.onDataChanged(true, true);
dataGraphPitch.getLegendRenderer().setVisible(true);
dataGraphPitch.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphPitch.getLegendRenderer().setTextSize(30);
dataGraphPitch.getGridLabelRenderer().setTextSize(20);
dataGraphPitch.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Pitch [deg]");
dataGraphPitch.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphPitch.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphPitch.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphPitch.getGridLabelRenderer().setPadding(35);
dataGraphYaw.onDataChanged(true, true);
dataGraphYaw.getLegendRenderer().setVisible(true);
dataGraphYaw.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
dataGraphYaw.getLegendRenderer().setTextSize(30);
dataGraphYaw.getGridLabelRenderer().setTextSize(20);
dataGraphYaw.getGridLabelRenderer().setVerticalAxisTitle(Space(7) + "Yaw [deg]");
dataGraphYaw.getGridLabelRenderer().setHorizontalAxisTitle(Space(11) + "Time [s]");
dataGraphYaw.getGridLabelRenderer().setNumHorizontalLabels(9);
dataGraphYaw.getGridLabelRenderer().setNumVerticalLabels(7);
dataGraphYaw.getGridLabelRenderer().setPadding(35);
}
// remember previous time stamp
requestTimerPreviousTime = requestTimerCurrentTime;
}
}
}
| 25,682 | 0.629457 | 0.624747 | 667 | 37.518742 | 28.341263 | 126 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.527736 | false | false | 6 |
c2f5ce40481a406e81b1078dba5ea4bf0608ac30 | 18,098,992,240,654 | 6cb92e3f4e4e01b45144b77f25b0735ad5dad7af | /com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/ZclField.java | eb4b85f3cfe8eb6cddca10a5b5d6dc6710a434d0 | [
"Apache-2.0"
] | permissive | codacy-badger/com.zsmartsystems.zigbee | https://github.com/codacy-badger/com.zsmartsystems.zigbee | 5c970212c009c7e829f76e4f424f0e24ad00edbb | 86711eb96f065464143c209acc15fd92b4811bf0 | refs/heads/master | 2017-12-05T15:45:06.663000 | 2017-01-27T20:17:54 | 2017-01-27T20:17:54 | 80,242,790 | 0 | 0 | null | true | 2017-01-27T20:20:19 | 2017-01-27T20:20:19 | 2017-01-25T18:56:10 | 2017-01-27T20:18:03 | 439 | 0 | 0 | 0 | null | null | null | package com.zsmartsystems.zigbee.zcl;
import com.zsmartsystems.zigbee.zcl.protocol.ZclDataType;
/**
* This class holds the definition, and current value, of a field in a {@link ZclCommand}
*
* @author Chris Jackson
*
*/
public class ZclField {
int sequence;
String label;
ZclDataType type;
Object value;
public ZclField(int sequence, String label, ZclDataType type) {
this.sequence = sequence;
this.label = label;
this.type = type;
}
public int getSequence() {
return sequence;
}
public void setSequence(int sequence) {
this.sequence = sequence;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public ZclDataType getDataType() {
return type;
}
public void setDataType(ZclDataType type) {
this.type = type;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "ZclField [label=" + label + ", value=" + value + "]";
}
}
| UTF-8 | Java | 1,183 | java | ZclField.java | Java | [
{
"context": ", of a field in a {@link ZclCommand}\n *\n * @author Chris Jackson\n *\n */\npublic class ZclField {\n int sequence;\n",
"end": 219,
"score": 0.9990426898002625,
"start": 206,
"tag": "NAME",
"value": "Chris Jackson"
}
] | null | [] | package com.zsmartsystems.zigbee.zcl;
import com.zsmartsystems.zigbee.zcl.protocol.ZclDataType;
/**
* This class holds the definition, and current value, of a field in a {@link ZclCommand}
*
* @author <NAME>
*
*/
public class ZclField {
int sequence;
String label;
ZclDataType type;
Object value;
public ZclField(int sequence, String label, ZclDataType type) {
this.sequence = sequence;
this.label = label;
this.type = type;
}
public int getSequence() {
return sequence;
}
public void setSequence(int sequence) {
this.sequence = sequence;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public ZclDataType getDataType() {
return type;
}
public void setDataType(ZclDataType type) {
this.type = type;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "ZclField [label=" + label + ", value=" + value + "]";
}
}
| 1,176 | 0.602705 | 0.602705 | 60 | 18.716667 | 19.750183 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.383333 | false | false | 6 |
05e56538ea62abbb063fd2320768fc7c79b7c1ca | 20,564,303,436,816 | 1e13cd3c2efbf08e0a6ed29be6b17be2b7395618 | /corejava8vol1/src/ch06/lambda/expressions/SimpleExample.java | 7bad36688b5ce03a6c6d1290b70354fdd1c7b989 | [] | no_license | barcvilla/javasecore | https://github.com/barcvilla/javasecore | f3c2526200b91f8c2c09ecc889912450cf854910 | 7e7979363391a2e80cf40c1525500b503f905005 | refs/heads/master | 2018-09-09T02:47:47.240000 | 2018-08-27T19:18:47 | 2018-08-27T19:18:47 | 107,985,518 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ch06.lambda.expressions;
/**
*
* @author barcvilla
*/
public class SimpleExample
{
public static void printHeader( String header)
{
System.out.println("\n" + "====================================");
System.out.println(header);
System.out.println("\n" + "====================================");
}
public void simplePrinting(String something)
{
System.out.println(something );
}
public void printSomething(String something, Printer printer)
{
printer.print(something);
}
/**
* Estilo OOP clasico de ocultar la implementacion del metodo al llamador. El llamador simplemente pasa una
* variable al metodo el cual hace algo con ese valor de la variable y retorna otro valor
*/
public static void demoPrint()
{
String header = "Estilo clasico de OOP";
printHeader("1 " + header);
SimpleExample demo = new SimpleExample();
String message = "I am learning Lambda";
demo.simplePrinting(message);
}
public static void demoPrint1()
{
String header = "Aplicando implementacion de Printer";
printHeader("2 " + header);
SimpleExample demo = new SimpleExample();
String something = "I am using a functional interface";
Printer printer = new Printer()
{
@Override
public void print(String val)
{
System.out.println(val);
}
};
demo.printSomething(something, printer);
}
public static void main(String[] args) {
demoPrint();
demoPrint1();
}
}
| UTF-8 | Java | 1,881 | java | SimpleExample.java | Java | [
{
"context": "ackage ch06.lambda.expressions;\n\n/**\n *\n * @author barcvilla\n */\npublic class SimpleExample \n{\n public stat",
"end": 246,
"score": 0.9988848567008972,
"start": 237,
"tag": "USERNAME",
"value": "barcvilla"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ch06.lambda.expressions;
/**
*
* @author barcvilla
*/
public class SimpleExample
{
public static void printHeader( String header)
{
System.out.println("\n" + "====================================");
System.out.println(header);
System.out.println("\n" + "====================================");
}
public void simplePrinting(String something)
{
System.out.println(something );
}
public void printSomething(String something, Printer printer)
{
printer.print(something);
}
/**
* Estilo OOP clasico de ocultar la implementacion del metodo al llamador. El llamador simplemente pasa una
* variable al metodo el cual hace algo con ese valor de la variable y retorna otro valor
*/
public static void demoPrint()
{
String header = "Estilo clasico de OOP";
printHeader("1 " + header);
SimpleExample demo = new SimpleExample();
String message = "I am learning Lambda";
demo.simplePrinting(message);
}
public static void demoPrint1()
{
String header = "Aplicando implementacion de Printer";
printHeader("2 " + header);
SimpleExample demo = new SimpleExample();
String something = "I am using a functional interface";
Printer printer = new Printer()
{
@Override
public void print(String val)
{
System.out.println(val);
}
};
demo.printSomething(something, printer);
}
public static void main(String[] args) {
demoPrint();
demoPrint1();
}
}
| 1,881 | 0.573099 | 0.56991 | 67 | 27.074627 | 25.575941 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.373134 | false | false | 6 |
f48720aad69d7ecd7e662341d3755dce00c9a227 | 29,635,274,346,827 | 3ded2599a7c75621d1462d440603a3f4856da900 | /src/com/tobee/image/proc/incubator/filters/Filter.java | 792c696e8302028bab9bc013118fd216d4b29ecd | [] | no_license | tommybee-dev/image_processing | https://github.com/tommybee-dev/image_processing | c7f93de953ad09bddb7d71dc39c8f15cd4c75caa | bdb6f55a1a4d72b8442909dd70cdd5bd3d37199b | refs/heads/master | 2021-01-22T03:01:22.248000 | 2017-03-13T09:12:28 | 2017-03-13T09:12:28 | 81,091,418 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.tobee.image.proc.incubator.filters;
import java.awt.image.Kernel;
import com.tobee.image.proc.incubator.PPMImage;
import com.tobee.image.proc.incubator.Pixel;
public abstract class Filter {
public static int ZERO_EDGES = 0;
public static int CLAMP_EDGES = 1;
public static int WRAP_EDGES = 2;
protected Kernel kernel = null;
public boolean alpha = true;
private int edgeAction = CLAMP_EDGES;
public abstract void filter( final PPMImage src, final PPMImage dst );
public abstract void filter( final PPMImage src, final PPMImage dst, final int iterCnt );
/*
public int[] getRGB( final PPMImage image, int[] pixels ) {
int height = image.getHeight();
Pixel[] raw_pixels = image.getPixel();
int wpix[] = null;
int offset = 0;
for(int i =0; i< height; i++)
{
wpix = raw_pixels[i].getRGBValue();
System.arraycopy(wpix, 0, pixels, offset, wpix.length);
offset += wpix.length;
}
return pixels;
}
public void setRGB( PPMImage image, int[] pixels ) {
int height = image.getHeight();
int width = image.getWidth();
Pixel[] raw_pixels = new Pixel[height];
int wpix[] = new int[width];
int offset = 0;
for(int i =0; i< height; i++)
{
raw_pixels[i] = new Pixel(width);
System.arraycopy(pixels, offset, wpix, 0, wpix.length);
offset += wpix.length;
raw_pixels[i].setRGBValue(wpix);
}
image.setPixel(raw_pixels);
}
*/
}
| UTF-8 | Java | 1,484 | java | Filter.java | Java | [] | null | [] | package com.tobee.image.proc.incubator.filters;
import java.awt.image.Kernel;
import com.tobee.image.proc.incubator.PPMImage;
import com.tobee.image.proc.incubator.Pixel;
public abstract class Filter {
public static int ZERO_EDGES = 0;
public static int CLAMP_EDGES = 1;
public static int WRAP_EDGES = 2;
protected Kernel kernel = null;
public boolean alpha = true;
private int edgeAction = CLAMP_EDGES;
public abstract void filter( final PPMImage src, final PPMImage dst );
public abstract void filter( final PPMImage src, final PPMImage dst, final int iterCnt );
/*
public int[] getRGB( final PPMImage image, int[] pixels ) {
int height = image.getHeight();
Pixel[] raw_pixels = image.getPixel();
int wpix[] = null;
int offset = 0;
for(int i =0; i< height; i++)
{
wpix = raw_pixels[i].getRGBValue();
System.arraycopy(wpix, 0, pixels, offset, wpix.length);
offset += wpix.length;
}
return pixels;
}
public void setRGB( PPMImage image, int[] pixels ) {
int height = image.getHeight();
int width = image.getWidth();
Pixel[] raw_pixels = new Pixel[height];
int wpix[] = new int[width];
int offset = 0;
for(int i =0; i< height; i++)
{
raw_pixels[i] = new Pixel(width);
System.arraycopy(pixels, offset, wpix, 0, wpix.length);
offset += wpix.length;
raw_pixels[i].setRGBValue(wpix);
}
image.setPixel(raw_pixels);
}
*/
}
| 1,484 | 0.641509 | 0.635445 | 58 | 23.586206 | 21.032024 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.275862 | false | false | 6 |
720948fa46d2d1559c9f645e7db144c666b90f92 | 19,868,518,741,835 | d4eae27cbd3bbed26f2d278e86e68dc7da070835 | /ally-video/mybatis-generatorConfig/src/main/java/com/imooc/pojo/Users.java | afcb9cc0ba4002c7cd7b1a974dd2a2b38e1bdbb5 | [] | no_license | Ally441/ally-video | https://github.com/Ally441/ally-video | b7f1f6b90f9e219db649750274393e274ffde2e3 | db3f5f6a69540cdd537d23e5f9ce8db94debd71f | refs/heads/main | 2023-02-03T07:17:25.042000 | 2020-12-11T13:29:52 | 2020-12-11T13:29:52 | 320,561,946 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.imooc.pojo;
import javax.persistence.*;
public class Users {
/**
* 用户编号
*/
private Integer id;
/**
* 登录账号
*/
private String username;
/**
* 登录密码
*/
private String userpass;
/**
* 用户昵称
*/
private String nickname;
/**
* 获取用户编号
*
* @return id - 用户编号
*/
public Integer getId() {
return id;
}
/**
* 设置用户编号
*
* @param id 用户编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取登录账号
*
* @return username - 登录账号
*/
public String getUsername() {
return username;
}
/**
* 设置登录账号
*
* @param username 登录账号
*/
public void setUsername(String username) {
this.username = username;
}
/**
* 获取登录密码
*
* @return userpass - 登录密码
*/
public String getUserpass() {
return userpass;
}
/**
* 设置登录密码
*
* @param userpass 登录密码
*/
public void setUserpass(String userpass) {
this.userpass = userpass;
}
/**
* 获取用户昵称
*
* @return nickname - 用户昵称
*/
public String getNickname() {
return nickname;
}
/**
* 设置用户昵称
*
* @param nickname 用户昵称
*/
public void setNickname(String nickname) {
this.nickname = nickname;
}
} | UTF-8 | Java | 1,596 | java | Users.java | Java | [] | null | [] | package com.imooc.pojo;
import javax.persistence.*;
public class Users {
/**
* 用户编号
*/
private Integer id;
/**
* 登录账号
*/
private String username;
/**
* 登录密码
*/
private String userpass;
/**
* 用户昵称
*/
private String nickname;
/**
* 获取用户编号
*
* @return id - 用户编号
*/
public Integer getId() {
return id;
}
/**
* 设置用户编号
*
* @param id 用户编号
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取登录账号
*
* @return username - 登录账号
*/
public String getUsername() {
return username;
}
/**
* 设置登录账号
*
* @param username 登录账号
*/
public void setUsername(String username) {
this.username = username;
}
/**
* 获取登录密码
*
* @return userpass - 登录密码
*/
public String getUserpass() {
return userpass;
}
/**
* 设置登录密码
*
* @param userpass 登录密码
*/
public void setUserpass(String userpass) {
this.userpass = userpass;
}
/**
* 获取用户昵称
*
* @return nickname - 用户昵称
*/
public String getNickname() {
return nickname;
}
/**
* 设置用户昵称
*
* @param nickname 用户昵称
*/
public void setNickname(String nickname) {
this.nickname = nickname;
}
} | 1,596 | 0.47151 | 0.47151 | 97 | 13.484536 | 11.880082 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.14433 | false | false | 6 |
1e1f3bd5a646634cf06b10a72d72b5ed0e7e71b9 | 14,783,277,433,417 | 65ce2e7cb6d7838a6220097e228f7d77ee811b2c | /default/src/main/java/com/github/vbarhatov/easybackup/params/PropertiesReader.java | c362d04cb25e5667811c81c55a50cec07a4ba9ac | [] | no_license | vbarhatov/easy-backup | https://github.com/vbarhatov/easy-backup | 71de826ba490d75dd17f167fe398de35071ebd38 | 0ca0d796bafa8f9ea13ee8b9bad2630a1cde9d9d | refs/heads/master | 2016-12-13T08:04:41.574000 | 2016-03-23T22:47:57 | 2016-03-23T22:47:57 | 54,417,429 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.github.vbarhatov.easybackup.params;
import lombok.SneakyThrows;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
/**
* Created by Vitaly on 23.03.2016.
*/
public class PropertiesReader implements IParams {
private Properties properties;
@SneakyThrows
public PropertiesReader(String path) {
properties = new Properties();
try(FileInputStream input = new FileInputStream(path)) {
properties.load(input);
}
}
@Override
public String get(String key) {
return properties.getProperty(key);
}
@Override
public boolean exists(String key) {
return properties.containsKey(key);
}
}
| UTF-8 | Java | 724 | java | PropertiesReader.java | Java | [
{
"context": "package com.github.vbarhatov.easybackup.params;\n\nimport lombok.SneakyThrows;\n\n",
"end": 28,
"score": 0.9992694854736328,
"start": 19,
"tag": "USERNAME",
"value": "vbarhatov"
},
{
"context": "m;\nimport java.util.Properties;\n\n/**\n * Created by Vitaly on 23.03.2016... | null | [] | package com.github.vbarhatov.easybackup.params;
import lombok.SneakyThrows;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
/**
* Created by Vitaly on 23.03.2016.
*/
public class PropertiesReader implements IParams {
private Properties properties;
@SneakyThrows
public PropertiesReader(String path) {
properties = new Properties();
try(FileInputStream input = new FileInputStream(path)) {
properties.load(input);
}
}
@Override
public String get(String key) {
return properties.getProperty(key);
}
@Override
public boolean exists(String key) {
return properties.containsKey(key);
}
}
| 724 | 0.68232 | 0.671271 | 32 | 21.625 | 18.627516 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false | 6 |
8fae75e104a74f55dbef862fcaa442282942ee5b | 8,315,056,687,717 | 23e197799d98d3bff12f76963676a2c0564a8496 | /mmps-alert-app/src/main/java/com/zzvc/mmps/alert/task/impl/ScheduleServicePlayerFaultAlertImpl.java | feebd531139fe33971faab2939c6ad659f416043 | [] | no_license | cuihbin/mmps-alert | https://github.com/cuihbin/mmps-alert | 3e961f596707f7f65da5b8d16c6e86ba4501d70c | 1a8104cdb1135ce1793bb08e96ab6b912f48bed0 | refs/heads/master | 2021-01-01T19:16:27.596000 | 2013-01-30T04:04:00 | 2013-01-30T04:04:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zzvc.mmps.alert.task.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import com.zzvc.mmps.alert.model.AlertBaseEntity;
import com.zzvc.mmps.alert.model.PlayerAlert;
import com.zzvc.mmps.alert.service.AlertConfigManager;
import com.zzvc.mmps.alert.service.PlayerAlertManager;
import com.zzvc.mmps.alert.service.PlayerManager;
import com.zzvc.mmps.alert.util.AlertConstants;
import com.zzvc.mmps.model.Player;
public class ScheduleServicePlayerFaultAlertImpl extends ScheduleServiceMultiItemsAlertSupport {
@Resource
private AlertConfigManager alertConfigManager;
@Resource
private PlayerManager playerManager;
@Resource
private PlayerAlertManager playerAlertManager;
private int minutesBeforePlayerFault;
@Override
public void init() {
try {
minutesBeforePlayerFault = Integer.parseInt(alertConfigManager.getConfig(AlertConstants.CFG_MINUTES_BEFORE_PLAYER_FAULT));
} catch (Exception e) {
minutesBeforePlayerFault = AlertConstants.DEFAULT_MINUTES_BEFORE_SERVER_FAULT;
}
infoMessage("alert.config.parameter", "CFG_MINUTES_BEFORE_PLAYER_FAULT", minutesBeforePlayerFault);
}
@Override
protected List getEfectiveSavedAlerts() {
return playerAlertManager.findActiveAlert();
}
@Override
protected String getAlertKeyString(AlertBaseEntity alert) {
return ((PlayerAlert) alert).getAddress();
}
@Override
protected Comparable getAlertComparableProperty(AlertBaseEntity alert) {
return ((PlayerAlert) alert).getLastHeartbeat();
}
@Override
protected List getEfectiveLiveFaultEntities() {
return playerManager.findByFaultLasting(minutesBeforePlayerFault);
}
@Override
protected String getFaultEntityKeyString(Object faultEntity) {
return ((Player) faultEntity).getAddress();
}
@Override
protected AlertBaseEntity convertFaultEntityToAlert(Object faultEntity) {
PlayerAlert ariseAlert = new PlayerAlert();
Player server = (Player) faultEntity;
ariseAlert.setAddress(server.getAddress());
ariseAlert.setLastHeartbeat(server.getLastHeartbeat());
return ariseAlert;
}
@Override
protected String getAlertAriseMessage(Object faultEntity) {
return null;
}
@Override
protected String getAlertRecoverMessage(Object recoveredEntity, Date alertAriseTime) {
return null;
}
@Override
protected Object getEntityFromAlert(AlertBaseEntity alert) {
return playerManager.findByAddress(((PlayerAlert) alert).getAddress());
}
}
| UTF-8 | Java | 2,454 | java | ScheduleServicePlayerFaultAlertImpl.java | Java | [] | null | [] | package com.zzvc.mmps.alert.task.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import com.zzvc.mmps.alert.model.AlertBaseEntity;
import com.zzvc.mmps.alert.model.PlayerAlert;
import com.zzvc.mmps.alert.service.AlertConfigManager;
import com.zzvc.mmps.alert.service.PlayerAlertManager;
import com.zzvc.mmps.alert.service.PlayerManager;
import com.zzvc.mmps.alert.util.AlertConstants;
import com.zzvc.mmps.model.Player;
public class ScheduleServicePlayerFaultAlertImpl extends ScheduleServiceMultiItemsAlertSupport {
@Resource
private AlertConfigManager alertConfigManager;
@Resource
private PlayerManager playerManager;
@Resource
private PlayerAlertManager playerAlertManager;
private int minutesBeforePlayerFault;
@Override
public void init() {
try {
minutesBeforePlayerFault = Integer.parseInt(alertConfigManager.getConfig(AlertConstants.CFG_MINUTES_BEFORE_PLAYER_FAULT));
} catch (Exception e) {
minutesBeforePlayerFault = AlertConstants.DEFAULT_MINUTES_BEFORE_SERVER_FAULT;
}
infoMessage("alert.config.parameter", "CFG_MINUTES_BEFORE_PLAYER_FAULT", minutesBeforePlayerFault);
}
@Override
protected List getEfectiveSavedAlerts() {
return playerAlertManager.findActiveAlert();
}
@Override
protected String getAlertKeyString(AlertBaseEntity alert) {
return ((PlayerAlert) alert).getAddress();
}
@Override
protected Comparable getAlertComparableProperty(AlertBaseEntity alert) {
return ((PlayerAlert) alert).getLastHeartbeat();
}
@Override
protected List getEfectiveLiveFaultEntities() {
return playerManager.findByFaultLasting(minutesBeforePlayerFault);
}
@Override
protected String getFaultEntityKeyString(Object faultEntity) {
return ((Player) faultEntity).getAddress();
}
@Override
protected AlertBaseEntity convertFaultEntityToAlert(Object faultEntity) {
PlayerAlert ariseAlert = new PlayerAlert();
Player server = (Player) faultEntity;
ariseAlert.setAddress(server.getAddress());
ariseAlert.setLastHeartbeat(server.getLastHeartbeat());
return ariseAlert;
}
@Override
protected String getAlertAriseMessage(Object faultEntity) {
return null;
}
@Override
protected String getAlertRecoverMessage(Object recoveredEntity, Date alertAriseTime) {
return null;
}
@Override
protected Object getEntityFromAlert(AlertBaseEntity alert) {
return playerManager.findByAddress(((PlayerAlert) alert).getAddress());
}
}
| 2,454 | 0.797473 | 0.797473 | 87 | 27.206896 | 28.750267 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.425287 | false | false | 6 |
62172afa7b3c17e2938fe0b583f4591a8e90e6a6 | 21,217,138,467,658 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project97/src/test/java/org/gradle/test/performance97_4/Test97_362.java | c85e632c8d946b719926f2f8a5bc6945ffe450b3 | [] | no_license | gradle/performance-comparisons | https://github.com/gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164000 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | false | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | 2022-09-09T14:38:38 | 2022-09-30T08:04:34 | 19,731 | 14 | 13 | 103 | null | false | false | package org.gradle.test.performance97_4;
import static org.junit.Assert.*;
public class Test97_362 {
private final Production97_362 production = new Production97_362("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | UTF-8 | Java | 292 | java | Test97_362.java | Java | [] | null | [] | package org.gradle.test.performance97_4;
import static org.junit.Assert.*;
public class Test97_362 {
private final Production97_362 production = new Production97_362("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | 292 | 0.69863 | 0.636986 | 12 | 23.416666 | 24.008533 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.416667 | false | false | 6 |
4d5f7a24411081f0de4cc53197cf7bf82a7cf371 | 2,869,038,178,961 | 497bffc396849fdf57e64d59cdfece02f3762def | /src/main/java/com/googlecode/rockit/test/BenchmarkTests.java | 833eb52f789686a6f3d608cf95db09dd8444ba40 | [
"MIT"
] | permissive | PhDP/rockit | https://github.com/PhDP/rockit | 2ca7572a342bb92faa6aa0278d94895b71ac7e52 | 11434b4db491ce545b0e358c2e2f409a5eaa15f6 | refs/heads/master | 2016-09-10T16:19:19.091000 | 2015-06-04T06:17:24 | 2015-06-04T06:17:24 | 36,851,956 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.googlecode.rockit.test;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import org.antlr.runtime.RecognitionException;
import com.googlecode.rockit.app.Parameters;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.exception.ReadOrWriteToFileException;
import com.googlecode.rockit.exception.SolveException;
import com.googlecode.rockit.file.MyFileWriter;
public class BenchmarkTests {
public static void main(String[] args) throws ReadOrWriteToFileException, ParseException, IOException, RecognitionException, SolveException, SQLException {
/*
try {
Thread.sleep(10000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}*/
Parameters.USE_CUTTING_PLANE_INFERENCE=false;
Parameters.USE_CUTTING_PLANE_AGGREGATION=false;
// Has to be disabled for runtime comparisons!!!
Parameters.DEBUG_OUTPUT=false;
int cores = Runtime.getRuntime().availableProcessors();
//Parameters.THREAD_NUMBER=cores+cores;
Parameters.THREAD_NUMBER=cores;
System.out.println("Parameters.THREAD_NUMBER " + Parameters.THREAD_NUMBER);
ArrayList<String> results = new ArrayList<String>();
MyFileWriter writer = new MyFileWriter("TUFFYatVLDB2011Results.txt");
String s=null;
long runtime = 0;
//protein IO
String modelFile = "data/pr/prog.mln";
String evidenceFile = "data/pr/evidence.db";
String queryFile = "data/pr/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.0000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//lp IO
modelFile = "data/lp/prog.mln";
evidenceFile = "data/lp/evidence.db";
queryFile = "data/lp/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.01, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//rc IO
modelFile = "data/rc/prog.mln";
evidenceFile = "data/rc/evidence.db";
queryFile = "data/rc/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//ie IO
modelFile = "data/ie/prog.mln";
evidenceFile = "data/ie/evidence.db";
queryFile = "data/ie/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//er IO
modelFile = "data/er/prog.mln";
evidenceFile = "data/er/evidence.db";
queryFile = "data/er/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
// conference
// CONFERENCE
/* String[] onts = new String[]{
"cmt", "confOf", "iasted"
};
for(int i = 0; i<onts.length; i++){
for(int j = i+1; j<onts.length;j++){
//String modelFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_prog.mln";
//String evidenceFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_evidence.db";
modelFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_prog.mln";
evidenceFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_evidence.db";
queryFile = "data/CODIatOAEI2011/query.db";
try {
s = StandardSolverTest.test(modelFile, evidenceFile, -1, true, true);
results.add(s);writer.writeln(s);writer.flush();
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception;"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}catch (Error e){
s = modelFile+";"+evidenceFile+";Error;"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
}
}*/
results.add("duration:"+runtime);writer.writeln("duration:"+runtime);
writer.closeFile();
// print results
System.out.println("==========================");
System.out.println();
for(String r : results){
System.out.println(r);
}
}
}
| UTF-8 | Java | 5,794 | java | BenchmarkTests.java | Java | [] | null | [] | package com.googlecode.rockit.test;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import org.antlr.runtime.RecognitionException;
import com.googlecode.rockit.app.Parameters;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.exception.ReadOrWriteToFileException;
import com.googlecode.rockit.exception.SolveException;
import com.googlecode.rockit.file.MyFileWriter;
public class BenchmarkTests {
public static void main(String[] args) throws ReadOrWriteToFileException, ParseException, IOException, RecognitionException, SolveException, SQLException {
/*
try {
Thread.sleep(10000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}*/
Parameters.USE_CUTTING_PLANE_INFERENCE=false;
Parameters.USE_CUTTING_PLANE_AGGREGATION=false;
// Has to be disabled for runtime comparisons!!!
Parameters.DEBUG_OUTPUT=false;
int cores = Runtime.getRuntime().availableProcessors();
//Parameters.THREAD_NUMBER=cores+cores;
Parameters.THREAD_NUMBER=cores;
System.out.println("Parameters.THREAD_NUMBER " + Parameters.THREAD_NUMBER);
ArrayList<String> results = new ArrayList<String>();
MyFileWriter writer = new MyFileWriter("TUFFYatVLDB2011Results.txt");
String s=null;
long runtime = 0;
//protein IO
String modelFile = "data/pr/prog.mln";
String evidenceFile = "data/pr/evidence.db";
String queryFile = "data/pr/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.0000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//lp IO
modelFile = "data/lp/prog.mln";
evidenceFile = "data/lp/evidence.db";
queryFile = "data/lp/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.01, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//rc IO
modelFile = "data/rc/prog.mln";
evidenceFile = "data/rc/evidence.db";
queryFile = "data/rc/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//ie IO
modelFile = "data/ie/prog.mln";
evidenceFile = "data/ie/evidence.db";
queryFile = "data/ie/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
//er IO
modelFile = "data/er/prog.mln";
evidenceFile = "data/er/evidence.db";
queryFile = "data/er/query.db";
try{
s=StandardSolverTest.test(modelFile, evidenceFile, 0.000001, Parameters.USE_CUTTING_PLANE_INFERENCE, Parameters.USE_CUTTING_PLANE_AGGREGATION);
results.add(s);writer.writeln(s);writer.flush();
runtime = StandardSolverTest.runtime + runtime;
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
// conference
// CONFERENCE
/* String[] onts = new String[]{
"cmt", "confOf", "iasted"
};
for(int i = 0; i<onts.length; i++){
for(int j = i+1; j<onts.length;j++){
//String modelFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_prog.mln";
//String evidenceFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_evidence.db";
modelFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_prog.mln";
evidenceFile = "data/CODIatOAEI2011/conference/"+onts[i]+"-"+onts[j]+"_evidence.db";
queryFile = "data/CODIatOAEI2011/query.db";
try {
s = StandardSolverTest.test(modelFile, evidenceFile, -1, true, true);
results.add(s);writer.writeln(s);writer.flush();
} catch (Exception e) {
s = modelFile+";"+evidenceFile+";Exception;"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}catch (Error e){
s = modelFile+";"+evidenceFile+";Error;"+e.getMessage();// TODO Auto-generated catch block
results.add(s);writer.writeln(s);writer.flush();
}
}
}*/
results.add("duration:"+runtime);writer.writeln("duration:"+runtime);
writer.closeFile();
// print results
System.out.println("==========================");
System.out.println();
for(String r : results){
System.out.println(r);
}
}
}
| 5,794 | 0.670521 | 0.658958 | 156 | 35.141026 | 34.890572 | 156 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.615385 | false | false | 6 |
c04fb7611daca689e96fcd6ef487111cc51914f2 | 10,204,842,327,122 | 280bdf9f873a6f8a3a839bd680eec0d902276302 | /src/net/aseom/mc/wgregioninfo/RgInfoCommand.java | 7620ef08c3083b6e4ff1aaf5a92acffe8d9c1639 | [] | no_license | ASeomHan/WG_RegionInfo | https://github.com/ASeomHan/WG_RegionInfo | 26df60b694aafec16d8ad52a979f6757dc7fe2e6 | 772ef4989fb893c0da9867c089eb0bbda9354719 | refs/heads/master | 2021-01-21T04:19:48.143000 | 2016-07-28T07:10:24 | 2016-07-28T07:10:24 | 47,623,529 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.aseom.mc.wgregioninfo;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import net.aseom.mc.wgregioninfo.config.PluginConfig;
import net.aseom.mc.wgregioninfo.config.RegionConfig;
public class RgInfoCommand implements CommandExecutor {
private RegionConfig regionConfig;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
this.regionConfig = WGRegionInfo.plugin.getRegionConfigClass();
if (command.getName().equalsIgnoreCase("regionhud")) {
if (sender instanceof Player) {
try {
toggleRegionHUD((Player) sender);
} catch (IOException e) {
sender.sendMessage(Lang.ERR_CANT_SAVE_CONFIG.get());
e.printStackTrace();
}
} else {
sender.sendMessage(Lang.CANT_USE_CONSOLE.get());
}
} else if (command.getName().equalsIgnoreCase("regioninfo")) {
if (args.length == 0) return false;
try {
if (Arrays.asList(regionConfig.getAvailableRgConfs()).contains(args[0])) {
runRgConfCmd(sender, args);
} else {
regionInfoCmdHandling(command, sender, args);
}
} catch (IOException e) {
sender.sendMessage(Lang.ERR_CANT_SAVE_CONFIG.get());
e.printStackTrace();
}
}
return true;
}
public void toggleRegionHUD(Player player) throws IOException {
if (!player.hasPermission("rginfo.togglehud")) {
player.sendMessage(Lang.NO_PERMISSION.get());
return;
}
PluginConfig pluginConfig = WGRegionInfo.plugin.getPluginConfigClass();
List<String> hudOffUsers = pluginConfig.getPluginConfig().getStringList("hud-off-users");
if (hudOffUsers.contains(player.getName())) {
// On
hudOffUsers.remove(player.getName());
pluginConfig.getPluginConfig().set("hud-off-users", hudOffUsers);
pluginConfig.savaPluginConfig();
player.sendMessage("Region HUD On!");
WGRegionInfo.plugin.reloadHudBoard(player);
} else {
// Off
hudOffUsers.add(player.getName());
pluginConfig.getPluginConfig().set("hud-off-users", hudOffUsers);
pluginConfig.savaPluginConfig();
player.sendMessage("Region HUD Off!");
WGRegionInfo.plugin.reloadHudBoard(player);
}
}
/* Begin region config commands handling */
private void runRgConfCmd(CommandSender sender, String[] args) throws IOException {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length < 2) {
sender.sendMessage(MessageFormat.format(Lang.USAGE_REGIONCONF.get(), args[0]));
return;
}
String rgOrGrpName = args[1].toLowerCase();
String confId = args[0];
String value = combineStrArr(Arrays.copyOfRange(args, 2, args.length));
if (rgOrGrpName.startsWith("g:")) {
// Group specific config
String grpName = rgOrGrpName.substring(2);
setGrpSpeciConf(grpName, confId, value, sender);
} else {
// Region specific config
String rgId = rgOrGrpName;
setRgSpeciConf(rgId, confId, value, sender);
}
}
private void setGrpSpeciConf(String grpName, String confId, String value, CommandSender sender) throws IOException {
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(grpName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), grpName));
return;
}
if (!value.equals("")) {
// Add
regionConfig.getRgYmlConf().set("groups." + grpName + "." + confId, value);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_GROUPCONF.get());
} else {
// Remove
regionConfig.getRgYmlConf().set("groups." + grpName + "." + confId, null);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_GROUPCONF_REM.get());
}
}
private void setRgSpeciConf(String rgId, String confId, String value, CommandSender sender) throws IOException {
if (!value.equals("")) {
// Add
// The region exists in group rule, move to region rule
String group = regionConfig.getGroup(rgId);
if (group != null) {
regionConfig.moveGroupConfToRg(rgId, group);
sender.sendMessage(MessageFormat.format(Lang.RG_SPECI_CONF_MOVED.get(), rgId, group));
}
regionConfig.getRgYmlConf().set("regions." + rgId + "." + confId, value);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_REGIONCONF.get());
} else {
// Remove
regionConfig.getRgYmlConf().set("regions." + rgId + "." + confId, null);
regionConfig.cleanupRgSpeciConf(rgId);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_REGIONCONF_REM.get());
}
}
/* End region config commands handling */
/**
* Command handling (except '/rghud' & region config commands)
* @throws IOException Config save fail
*/
private void regionInfoCmdHandling(Command command, CommandSender sender, String[] args) throws IOException {
if (args[0].equalsIgnoreCase("newgroup")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 1) {
runNewGroupCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_NEWGROUP.get());
}
} else if (args[0].equalsIgnoreCase("delgroup")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 1) {
runDelGroupCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_DELGROUP.get());
}
} else if (args[0].equalsIgnoreCase("addregion")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 2) {
runAddRegionCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_ADDREGION.get());
}
} else if (args[0].equalsIgnoreCase("delregion")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 2) {
runDelRegionCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_DELREGION.get());
}
} else if (args[0].equalsIgnoreCase("reload")) {
if (!sender.hasPermission("rginfo.reload")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
try {
WGRegionInfo.plugin.reloadPlugin();
sender.sendMessage(Lang.PLUGIN_RELOADED.get());
} catch (Exception e) {
sender.sendMessage(MessageFormat.format(Lang.ERROR_WHILE_RELOAD.get(), e.toString()));
e.printStackTrace();
}
} else {
sender.sendMessage(command.getUsage());
}
}
private void runNewGroupCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase();
if (args.length > 2) {
sender.sendMessage(Lang.GROUPNAME_CANT_SPACE.get());
return;
}
regionConfig.getRgYmlConf().getConfigurationSection("groups").createSection(groupName).set("region-ids", new ArrayList<String>());
regionConfig.savaRgConf();
sender.sendMessage(MessageFormat.format(Lang.SUCCESS_NEWGROUP.get(), groupName));
}
private void runDelGroupCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase();
if (args.length > 2) {
sender.sendMessage(Lang.GROUPNAME_CANT_SPACE.get());
return;
}
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
regionConfig.getRgYmlConf().set("groups." + groupName, null);
regionConfig.savaRgConf();
sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELGROUP.get(), groupName));
}
private void runAddRegionCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase(); // 기존에 있던것들
String[] regionIDsToAdd = Arrays.copyOfRange(args, 2, args.length); // 입력받은 것들
List<String> addedRegionIDs = new ArrayList<String>(); // 실제 추가된 것들
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
List<String> regionIDs = regionConfig.getRgYmlConf().getStringList("groups." + groupName + ".region-ids");
for (String eRgID : regionIDsToAdd) {
// 그룹에 추가하려는 each region이 region specific rule을 갖고있으면 remove
ConfigurationSection rgSpecificCfg = regionConfig.getRgYmlConf().getConfigurationSection("regions." + eRgID);
if (rgSpecificCfg != null) {
regionConfig.getRgYmlConf().set("regions." + eRgID, null);
sender.sendMessage(MessageFormat.format(Lang.RG_SPECI_CONF_REMOVED.get(), eRgID));
}
// 중복확인 and add each region
if (!regionIDs.contains(eRgID)) {
regionIDs.add(eRgID);
addedRegionIDs.add(eRgID);
}
}
regionConfig.getRgYmlConf().set("groups." + groupName + ".region-ids", regionIDs);
regionConfig.savaRgConf();
if (addedRegionIDs.size() == 0) sender.sendMessage(Lang.NOTHING_TO_ADD.get());
else if (addedRegionIDs.size() < 2) sender.sendMessage(MessageFormat.format(Lang.SUCCESS_ADDREGION.get(), addedRegionIDs.get(0), groupName));
else sender.sendMessage(MessageFormat.format(Lang.SUCCESS_ADDREGION_MULTI.get(), addedRegionIDs.get(0), (addedRegionIDs.size() - 1), groupName));
}
private void runDelRegionCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase(); // 기존에 있던것들
String[] regionIDsToDel = Arrays.copyOfRange(args, 2, args.length); // 입력받은 것들
List<String> deletedRegionIDs = new ArrayList<String>(); // 실제 삭제된 것들
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
List<String> regionIDs = regionConfig.getRgYmlConf().getStringList("groups." + groupName + ".region-ids");
for (String eRgID : regionIDsToDel) {
// 존재확인 and delete each region
if (regionIDs.contains(eRgID)) {
regionIDs.remove(eRgID);
deletedRegionIDs.add(eRgID);
}
}
regionConfig.getRgYmlConf().set("groups." + groupName + ".region-ids", regionIDs);
regionConfig.savaRgConf();
if (deletedRegionIDs.size() == 0) sender.sendMessage(Lang.NOTHING_TO_DEL.get());
else if (deletedRegionIDs.size() < 2) sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELREGION.get(), deletedRegionIDs.get(0), groupName));
else sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELREGION_MULTI.get(), deletedRegionIDs.get(0), (deletedRegionIDs.size() - 1), groupName));
}
/**
* 띄어쓰기 포함 텍스트가 배열로 쪼개진 것 다시 합침
* + Escape characters
* @return Combined text
*/
public String combineStrArr(String[] splitedTexts) {
String combinedText = "";
for (String eSplText : splitedTexts) {
combinedText += eSplText + " ";
}
return combinedText.trim();
}
}
| UTF-8 | Java | 11,227 | java | RgInfoCommand.java | Java | [] | null | [] | package net.aseom.mc.wgregioninfo;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import net.aseom.mc.wgregioninfo.config.PluginConfig;
import net.aseom.mc.wgregioninfo.config.RegionConfig;
public class RgInfoCommand implements CommandExecutor {
private RegionConfig regionConfig;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
this.regionConfig = WGRegionInfo.plugin.getRegionConfigClass();
if (command.getName().equalsIgnoreCase("regionhud")) {
if (sender instanceof Player) {
try {
toggleRegionHUD((Player) sender);
} catch (IOException e) {
sender.sendMessage(Lang.ERR_CANT_SAVE_CONFIG.get());
e.printStackTrace();
}
} else {
sender.sendMessage(Lang.CANT_USE_CONSOLE.get());
}
} else if (command.getName().equalsIgnoreCase("regioninfo")) {
if (args.length == 0) return false;
try {
if (Arrays.asList(regionConfig.getAvailableRgConfs()).contains(args[0])) {
runRgConfCmd(sender, args);
} else {
regionInfoCmdHandling(command, sender, args);
}
} catch (IOException e) {
sender.sendMessage(Lang.ERR_CANT_SAVE_CONFIG.get());
e.printStackTrace();
}
}
return true;
}
public void toggleRegionHUD(Player player) throws IOException {
if (!player.hasPermission("rginfo.togglehud")) {
player.sendMessage(Lang.NO_PERMISSION.get());
return;
}
PluginConfig pluginConfig = WGRegionInfo.plugin.getPluginConfigClass();
List<String> hudOffUsers = pluginConfig.getPluginConfig().getStringList("hud-off-users");
if (hudOffUsers.contains(player.getName())) {
// On
hudOffUsers.remove(player.getName());
pluginConfig.getPluginConfig().set("hud-off-users", hudOffUsers);
pluginConfig.savaPluginConfig();
player.sendMessage("Region HUD On!");
WGRegionInfo.plugin.reloadHudBoard(player);
} else {
// Off
hudOffUsers.add(player.getName());
pluginConfig.getPluginConfig().set("hud-off-users", hudOffUsers);
pluginConfig.savaPluginConfig();
player.sendMessage("Region HUD Off!");
WGRegionInfo.plugin.reloadHudBoard(player);
}
}
/* Begin region config commands handling */
private void runRgConfCmd(CommandSender sender, String[] args) throws IOException {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length < 2) {
sender.sendMessage(MessageFormat.format(Lang.USAGE_REGIONCONF.get(), args[0]));
return;
}
String rgOrGrpName = args[1].toLowerCase();
String confId = args[0];
String value = combineStrArr(Arrays.copyOfRange(args, 2, args.length));
if (rgOrGrpName.startsWith("g:")) {
// Group specific config
String grpName = rgOrGrpName.substring(2);
setGrpSpeciConf(grpName, confId, value, sender);
} else {
// Region specific config
String rgId = rgOrGrpName;
setRgSpeciConf(rgId, confId, value, sender);
}
}
private void setGrpSpeciConf(String grpName, String confId, String value, CommandSender sender) throws IOException {
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(grpName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), grpName));
return;
}
if (!value.equals("")) {
// Add
regionConfig.getRgYmlConf().set("groups." + grpName + "." + confId, value);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_GROUPCONF.get());
} else {
// Remove
regionConfig.getRgYmlConf().set("groups." + grpName + "." + confId, null);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_GROUPCONF_REM.get());
}
}
private void setRgSpeciConf(String rgId, String confId, String value, CommandSender sender) throws IOException {
if (!value.equals("")) {
// Add
// The region exists in group rule, move to region rule
String group = regionConfig.getGroup(rgId);
if (group != null) {
regionConfig.moveGroupConfToRg(rgId, group);
sender.sendMessage(MessageFormat.format(Lang.RG_SPECI_CONF_MOVED.get(), rgId, group));
}
regionConfig.getRgYmlConf().set("regions." + rgId + "." + confId, value);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_REGIONCONF.get());
} else {
// Remove
regionConfig.getRgYmlConf().set("regions." + rgId + "." + confId, null);
regionConfig.cleanupRgSpeciConf(rgId);
regionConfig.savaRgConf();
sender.sendMessage(Lang.SUCCESS_REGIONCONF_REM.get());
}
}
/* End region config commands handling */
/**
* Command handling (except '/rghud' & region config commands)
* @throws IOException Config save fail
*/
private void regionInfoCmdHandling(Command command, CommandSender sender, String[] args) throws IOException {
if (args[0].equalsIgnoreCase("newgroup")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 1) {
runNewGroupCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_NEWGROUP.get());
}
} else if (args[0].equalsIgnoreCase("delgroup")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 1) {
runDelGroupCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_DELGROUP.get());
}
} else if (args[0].equalsIgnoreCase("addregion")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 2) {
runAddRegionCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_ADDREGION.get());
}
} else if (args[0].equalsIgnoreCase("delregion")) {
if (!sender.hasPermission("rginfo.modify")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
if (args.length > 2) {
runDelRegionCmd(sender, args);
} else {
sender.sendMessage(Lang.USAGE_DELREGION.get());
}
} else if (args[0].equalsIgnoreCase("reload")) {
if (!sender.hasPermission("rginfo.reload")) {
sender.sendMessage(Lang.NO_PERMISSION.get());
return;
}
try {
WGRegionInfo.plugin.reloadPlugin();
sender.sendMessage(Lang.PLUGIN_RELOADED.get());
} catch (Exception e) {
sender.sendMessage(MessageFormat.format(Lang.ERROR_WHILE_RELOAD.get(), e.toString()));
e.printStackTrace();
}
} else {
sender.sendMessage(command.getUsage());
}
}
private void runNewGroupCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase();
if (args.length > 2) {
sender.sendMessage(Lang.GROUPNAME_CANT_SPACE.get());
return;
}
regionConfig.getRgYmlConf().getConfigurationSection("groups").createSection(groupName).set("region-ids", new ArrayList<String>());
regionConfig.savaRgConf();
sender.sendMessage(MessageFormat.format(Lang.SUCCESS_NEWGROUP.get(), groupName));
}
private void runDelGroupCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase();
if (args.length > 2) {
sender.sendMessage(Lang.GROUPNAME_CANT_SPACE.get());
return;
}
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
regionConfig.getRgYmlConf().set("groups." + groupName, null);
regionConfig.savaRgConf();
sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELGROUP.get(), groupName));
}
private void runAddRegionCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase(); // 기존에 있던것들
String[] regionIDsToAdd = Arrays.copyOfRange(args, 2, args.length); // 입력받은 것들
List<String> addedRegionIDs = new ArrayList<String>(); // 실제 추가된 것들
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
List<String> regionIDs = regionConfig.getRgYmlConf().getStringList("groups." + groupName + ".region-ids");
for (String eRgID : regionIDsToAdd) {
// 그룹에 추가하려는 each region이 region specific rule을 갖고있으면 remove
ConfigurationSection rgSpecificCfg = regionConfig.getRgYmlConf().getConfigurationSection("regions." + eRgID);
if (rgSpecificCfg != null) {
regionConfig.getRgYmlConf().set("regions." + eRgID, null);
sender.sendMessage(MessageFormat.format(Lang.RG_SPECI_CONF_REMOVED.get(), eRgID));
}
// 중복확인 and add each region
if (!regionIDs.contains(eRgID)) {
regionIDs.add(eRgID);
addedRegionIDs.add(eRgID);
}
}
regionConfig.getRgYmlConf().set("groups." + groupName + ".region-ids", regionIDs);
regionConfig.savaRgConf();
if (addedRegionIDs.size() == 0) sender.sendMessage(Lang.NOTHING_TO_ADD.get());
else if (addedRegionIDs.size() < 2) sender.sendMessage(MessageFormat.format(Lang.SUCCESS_ADDREGION.get(), addedRegionIDs.get(0), groupName));
else sender.sendMessage(MessageFormat.format(Lang.SUCCESS_ADDREGION_MULTI.get(), addedRegionIDs.get(0), (addedRegionIDs.size() - 1), groupName));
}
private void runDelRegionCmd(CommandSender sender, String[] args) throws IOException {
String groupName = args[1].toLowerCase(); // 기존에 있던것들
String[] regionIDsToDel = Arrays.copyOfRange(args, 2, args.length); // 입력받은 것들
List<String> deletedRegionIDs = new ArrayList<String>(); // 실제 삭제된 것들
if (!regionConfig.getRgYmlConf().getConfigurationSection("groups").getKeys(false).contains(groupName)) {
sender.sendMessage(MessageFormat.format(Lang.GROUP_NOT_FOUND.get(), groupName));
return;
}
List<String> regionIDs = regionConfig.getRgYmlConf().getStringList("groups." + groupName + ".region-ids");
for (String eRgID : regionIDsToDel) {
// 존재확인 and delete each region
if (regionIDs.contains(eRgID)) {
regionIDs.remove(eRgID);
deletedRegionIDs.add(eRgID);
}
}
regionConfig.getRgYmlConf().set("groups." + groupName + ".region-ids", regionIDs);
regionConfig.savaRgConf();
if (deletedRegionIDs.size() == 0) sender.sendMessage(Lang.NOTHING_TO_DEL.get());
else if (deletedRegionIDs.size() < 2) sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELREGION.get(), deletedRegionIDs.get(0), groupName));
else sender.sendMessage(MessageFormat.format(Lang.SUCCESS_DELREGION_MULTI.get(), deletedRegionIDs.get(0), (deletedRegionIDs.size() - 1), groupName));
}
/**
* 띄어쓰기 포함 텍스트가 배열로 쪼개진 것 다시 합침
* + Escape characters
* @return Combined text
*/
public String combineStrArr(String[] splitedTexts) {
String combinedText = "";
for (String eSplText : splitedTexts) {
combinedText += eSplText + " ";
}
return combinedText.trim();
}
}
| 11,227 | 0.707207 | 0.704042 | 306 | 35.140522 | 32.344398 | 151 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.013072 | false | false | 6 |
cd0d7a36e4761e729e35ba6896eaa968dcf93f8d | 12,317,966,241,517 | 6edad6aff0aedda5ab5db71fd1054718306b74f4 | /netcai/netcai-buyer/src/main/java/com/netcai/buyer/entity/GoodsMethod.java | 6e9e3847693608718d96449cc938723618e4cafa | [
"Apache-2.0"
] | permissive | w312033591/netcai | https://github.com/w312033591/netcai | 0fa8e4406443e3dc386f2776464d250f045d0dfe | 3d2630a5ae26d8411c2bdaabbbf9943cf626440d | refs/heads/master | 2020-03-19T01:30:58.964000 | 2018-05-31T07:17:02 | 2018-05-31T07:17:02 | 135,551,200 | 2 | 4 | Apache-2.0 | true | 2018-05-31T07:53:04 | 2018-05-31T07:53:04 | 2018-05-31T07:52:15 | 2018-05-31T07:44:41 | 6 | 0 | 0 | 0 | null | false | null | package com.netcai.buyer.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 商品加工方式实体类
* @author administrator
*/
public class GoodsMethod implements Serializable{
private static final long serialVersionUID = 1L;
private Long gmId;
/**
* 商品ID
*/
private Long goodsId;
/**
* 加工方式ID
*/
private Integer methodId;
/**
* 创建时间
*/
private Date createTime;
public Long getGmId() {
return gmId;
}
public void setGmId(Long gmId) {
this.gmId = gmId;
}
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public Integer getMethodId() {
return methodId;
}
public void setMethodId(Integer methodId) {
this.methodId = methodId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
| UTF-8 | Java | 920 | java | GoodsMethod.java | Java | [
{
"context": "mport java.util.Date;\n\n/**\n * 商品加工方式实体类\n * @author administrator\n */\npublic class GoodsMethod implements Serializa",
"end": 128,
"score": 0.9882660508155823,
"start": 115,
"tag": "USERNAME",
"value": "administrator"
}
] | null | [] | package com.netcai.buyer.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 商品加工方式实体类
* @author administrator
*/
public class GoodsMethod implements Serializable{
private static final long serialVersionUID = 1L;
private Long gmId;
/**
* 商品ID
*/
private Long goodsId;
/**
* 加工方式ID
*/
private Integer methodId;
/**
* 创建时间
*/
private Date createTime;
public Long getGmId() {
return gmId;
}
public void setGmId(Long gmId) {
this.gmId = gmId;
}
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public Integer getMethodId() {
return methodId;
}
public void setMethodId(Integer methodId) {
this.methodId = methodId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
| 920 | 0.692744 | 0.69161 | 52 | 15.961538 | 14.553563 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.211538 | false | false | 6 |
1bdd4da13d34a8b3fe42a1622cbe28de6dc5d9bb | 11,519,102,291,819 | 6c466d86b1e13f640b11b553d7139d3f037deae5 | /fstcomp/examples/Modification/AJHotDraw/modAlignCommandUndo/_mod/AuxClass.java | 52763b43ffdead06984ffa941b1244ee04b4edee | [] | no_license | seanhoots/formol-featurehouse | https://github.com/seanhoots/formol-featurehouse | a30af2f517fdff6a95c0f4a6b4fd9902aeb46f96 | 0cddc85e061398d6d653e4a4607d7e0f4c28fcc4 | refs/heads/master | 2021-01-17T06:35:11.489000 | 2012-03-08T13:51:46 | 2012-03-08T13:51:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | public static class UndoActivity extends UndoableAdapter {
private Hashtable myOriginalPoints;
private Alignment myAppliedAlignment;
public UndoActivity(DrawingView newView, Alignment newAlignment) {
super(newView);
myOriginalPoints = new Hashtable();
setAppliedAlignment(newAlignment);
setUndoable(true);
setRedoable(true);
}
public boolean undo() {
if (!super.undo()) {
return false;
}
FigureEnumeration fe = getAffectedFigures();
while (fe.hasNextFigure()) {
Figure f = fe.nextFigure();
Point originalPoint = getOriginalPoint(f);
Point currentPoint = f.displayBox().getLocation();
// substract current lcoation to get to 0,0 and then move to original location
f.moveBy(-currentPoint.x + originalPoint.x,
-currentPoint.y + originalPoint.y);
}
return true;
}
public boolean redo() {
if (!isRedoable()) {
return false;
}
alignAffectedFigures(getAppliedAlignment());
return true;
}
protected void setAppliedAlignment(Alignment newAlignment) {
myAppliedAlignment = newAlignment;
}
public Alignment getAppliedAlignment() {
return myAppliedAlignment;
}
protected void addOriginalPoint(Figure f) {
myOriginalPoints.put(f, f.displayBox().getLocation());
}
public Point getOriginalPoint(Figure f) {
return (Point)myOriginalPoints.get(f);
}
public void alignAffectedFigures(Alignment applyAlignment) {
FigureEnumeration fe = getAffectedFigures();
Figure anchorFigure = fe.nextFigure();
Rectangle r = anchorFigure.displayBox();
while (fe.hasNextFigure()) {
Figure f = fe.nextFigure();
applyAlignment.moveBy(f, r);
}
}
public void setAffectedFigures(FigureEnumeration fe) {
// first make copy of FigureEnumeration in superclass
super.setAffectedFigures(fe);
// then get new FigureEnumeration of copy to save aligment
FigureEnumeration copyFe = getAffectedFigures();
while (copyFe.hasNextFigure()) {
addOriginalPoint(copyFe.nextFigure());
}
}
}
| UTF-8 | Java | 2,026 | java | AuxClass.java | Java | [] | null | [] | public static class UndoActivity extends UndoableAdapter {
private Hashtable myOriginalPoints;
private Alignment myAppliedAlignment;
public UndoActivity(DrawingView newView, Alignment newAlignment) {
super(newView);
myOriginalPoints = new Hashtable();
setAppliedAlignment(newAlignment);
setUndoable(true);
setRedoable(true);
}
public boolean undo() {
if (!super.undo()) {
return false;
}
FigureEnumeration fe = getAffectedFigures();
while (fe.hasNextFigure()) {
Figure f = fe.nextFigure();
Point originalPoint = getOriginalPoint(f);
Point currentPoint = f.displayBox().getLocation();
// substract current lcoation to get to 0,0 and then move to original location
f.moveBy(-currentPoint.x + originalPoint.x,
-currentPoint.y + originalPoint.y);
}
return true;
}
public boolean redo() {
if (!isRedoable()) {
return false;
}
alignAffectedFigures(getAppliedAlignment());
return true;
}
protected void setAppliedAlignment(Alignment newAlignment) {
myAppliedAlignment = newAlignment;
}
public Alignment getAppliedAlignment() {
return myAppliedAlignment;
}
protected void addOriginalPoint(Figure f) {
myOriginalPoints.put(f, f.displayBox().getLocation());
}
public Point getOriginalPoint(Figure f) {
return (Point)myOriginalPoints.get(f);
}
public void alignAffectedFigures(Alignment applyAlignment) {
FigureEnumeration fe = getAffectedFigures();
Figure anchorFigure = fe.nextFigure();
Rectangle r = anchorFigure.displayBox();
while (fe.hasNextFigure()) {
Figure f = fe.nextFigure();
applyAlignment.moveBy(f, r);
}
}
public void setAffectedFigures(FigureEnumeration fe) {
// first make copy of FigureEnumeration in superclass
super.setAffectedFigures(fe);
// then get new FigureEnumeration of copy to save aligment
FigureEnumeration copyFe = getAffectedFigures();
while (copyFe.hasNextFigure()) {
addOriginalPoint(copyFe.nextFigure());
}
}
}
| 2,026 | 0.712241 | 0.711254 | 75 | 25.986666 | 21.779802 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.813333 | false | false | 6 |
11f3736e30ae1c7bbb446d35e656eb243369f9be | 6,055,903,913,877 | 6dda5824b7d61a8e5b055bd424043d51b86e970c | /planner/app/src/main/java/com/alvaro/tfg/CrearPlan.java | ad311c8c3698acca9236a10b9c0208aa947f30fd | [] | no_license | alvaroMartinez14/AndroidStudio-Java | https://github.com/alvaroMartinez14/AndroidStudio-Java | 62d06a49c7d05af9cd26c715cc2f278bff661e6e | b617c91b361a596a78b7a315096d2e6e8635725e | refs/heads/master | 2023-06-02T01:48:25.040000 | 2021-06-18T23:39:05 | 2021-06-18T23:39:05 | 378,286,208 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.alvaro.tfg;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import com.alvaro.tfg.db.crud;
import com.alvaro.tfg.entidades.Planes;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
public class CrearPlan extends AppCompatActivity {
//variables
EditText nombre, desc, lugar, fecha, personas;
DatePickerDialog dpd;
Calendar c;
Date date;
long miliseg;
boolean validado;
ArrayList<String> lista;
//creamos un objeto con conexion a la bd
crud objCRUD = new crud(CrearPlan.this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crear_plan);
//ids
nombre = findViewById(R.id.nombre);
desc = findViewById(R.id.desc);
lugar = findViewById(R.id.lugar);
personas = findViewById(R.id.personas);
//abrir el calendario
fecha = findViewById(R.id.fecha);
fecha.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
c = Calendar.getInstance();
dpd = new DatePickerDialog(CrearPlan.this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int day) {
if (year < c.get(Calendar.YEAR) || month < c.get(Calendar.MONTH)) {
fecha.setText("ERROR. Fecha pasada");
} else if (year == c.get(Calendar.YEAR) && month == c.get(Calendar.MONTH) && day < c.get(Calendar.DAY_OF_MONTH)) {
fecha.setText("ERROR. Fecha pasada");
} else {
month = month+1;
fecha.setText(day + " / " + month + " / " + year);
date = new Date(year-1900, month-1, day);
miliseg = date.getTime();
}
}
},
c.get(Calendar.YEAR),
c.get(Calendar.MONTH),
c.get(Calendar.DAY_OF_MONTH)
);
dpd.show();
}
});
}
public void agregar_plan(View v) {
if (validar()) {
long id = objCRUD.insert_plan(nombre.getText().toString(), desc.getText().toString(), lugar.getText().toString(), fecha.getText().toString(), personas.getText().toString());
//si el id es mayor a 0 significa que se ha insertado bien el plan
if (id > 0) {
Toast.makeText(this, "Redirecting...", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Redirecting error", Toast.LENGTH_SHORT).show();
}
//guardar el plan creado para compartirlo posteriormente
Planes plan = new Planes();
String datosCompartir = objCRUD.compartirPlan(plan, nombre.getText().toString());
String title = nombre.getText().toString();
String descr = desc.getText().toString();
String loc = lugar.getText().toString();
//agregar al calendario
Intent calendario = new Intent(Intent.ACTION_INSERT);
calendario.setData(CalendarContract.Events.CONTENT_URI);
calendario.putExtra(CalendarContract.Events.TITLE, title);
calendario.putExtra(CalendarContract.Events.DESCRIPTION, descr);
calendario.putExtra(CalendarContract.Events.EVENT_LOCATION, loc);
calendario.putExtra(CalendarContract.Events.ALL_DAY, true);
calendario.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, miliseg);
calendario.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, miliseg+86400000);
Intent intent = new Intent(v.getContext(), com.alvaro.tfg.compartir.class);
intent.putExtra("datosCompartir", datosCompartir); //pasar un dato de un activity a otro
startActivityForResult(intent, 0);
startActivity(calendario);
}
}
public void share_plan(View v) {
if (validar()) {
long id = objCRUD.insert_plan(nombre.getText().toString(), desc.getText().toString(), lugar.getText().toString(), fecha.getText().toString(), personas.getText().toString());
if (id > 0) {
Toast.makeText(this, "Saved plan", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Error saving plan", Toast.LENGTH_SHORT).show();
}
//guardar el plan creado para compartirlo posteriormente
Planes plan = new Planes();
String datosCompartir = objCRUD.compartirPlan(plan, nombre.getText().toString());
Intent intent = new Intent(v.getContext(), com.alvaro.tfg.compartir.class);
intent.putExtra("datosCompartir", datosCompartir); //pasar un dato de un activity a otro
startActivityForResult(intent, 0);
}
}
//metodo validar campos
public boolean validar() {
if (nombre.getText().toString().isEmpty()) {
Toast.makeText(this, "Name field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (desc.getText().toString().isEmpty()) {
Toast.makeText(this, "Description field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (lugar.getText().toString().isEmpty()) {
Toast.makeText(this, "Empty place field", Toast.LENGTH_SHORT).show();
validado = false;
} else if (fecha.getText().toString().equals("Date")) {
Toast.makeText(this, "Date field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (fecha.getText().toString().equals("ERROR. Date not valid")) {
Toast.makeText(this, "Invalid date field", Toast.LENGTH_SHORT).show();
validado = false;
} else if (personas.getText().toString().equals("ERROR. People not valid")) {
Toast.makeText(this, "Invalid people fieldo", Toast.LENGTH_SHORT).show();
validado = false;
} else {
validado = true;
}
return validado;
}
}
| UTF-8 | Java | 6,612 | java | CrearPlan.java | Java | [] | null | [] | package com.alvaro.tfg;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import com.alvaro.tfg.db.crud;
import com.alvaro.tfg.entidades.Planes;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
public class CrearPlan extends AppCompatActivity {
//variables
EditText nombre, desc, lugar, fecha, personas;
DatePickerDialog dpd;
Calendar c;
Date date;
long miliseg;
boolean validado;
ArrayList<String> lista;
//creamos un objeto con conexion a la bd
crud objCRUD = new crud(CrearPlan.this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crear_plan);
//ids
nombre = findViewById(R.id.nombre);
desc = findViewById(R.id.desc);
lugar = findViewById(R.id.lugar);
personas = findViewById(R.id.personas);
//abrir el calendario
fecha = findViewById(R.id.fecha);
fecha.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
c = Calendar.getInstance();
dpd = new DatePickerDialog(CrearPlan.this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int day) {
if (year < c.get(Calendar.YEAR) || month < c.get(Calendar.MONTH)) {
fecha.setText("ERROR. Fecha pasada");
} else if (year == c.get(Calendar.YEAR) && month == c.get(Calendar.MONTH) && day < c.get(Calendar.DAY_OF_MONTH)) {
fecha.setText("ERROR. Fecha pasada");
} else {
month = month+1;
fecha.setText(day + " / " + month + " / " + year);
date = new Date(year-1900, month-1, day);
miliseg = date.getTime();
}
}
},
c.get(Calendar.YEAR),
c.get(Calendar.MONTH),
c.get(Calendar.DAY_OF_MONTH)
);
dpd.show();
}
});
}
public void agregar_plan(View v) {
if (validar()) {
long id = objCRUD.insert_plan(nombre.getText().toString(), desc.getText().toString(), lugar.getText().toString(), fecha.getText().toString(), personas.getText().toString());
//si el id es mayor a 0 significa que se ha insertado bien el plan
if (id > 0) {
Toast.makeText(this, "Redirecting...", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Redirecting error", Toast.LENGTH_SHORT).show();
}
//guardar el plan creado para compartirlo posteriormente
Planes plan = new Planes();
String datosCompartir = objCRUD.compartirPlan(plan, nombre.getText().toString());
String title = nombre.getText().toString();
String descr = desc.getText().toString();
String loc = lugar.getText().toString();
//agregar al calendario
Intent calendario = new Intent(Intent.ACTION_INSERT);
calendario.setData(CalendarContract.Events.CONTENT_URI);
calendario.putExtra(CalendarContract.Events.TITLE, title);
calendario.putExtra(CalendarContract.Events.DESCRIPTION, descr);
calendario.putExtra(CalendarContract.Events.EVENT_LOCATION, loc);
calendario.putExtra(CalendarContract.Events.ALL_DAY, true);
calendario.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, miliseg);
calendario.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, miliseg+86400000);
Intent intent = new Intent(v.getContext(), com.alvaro.tfg.compartir.class);
intent.putExtra("datosCompartir", datosCompartir); //pasar un dato de un activity a otro
startActivityForResult(intent, 0);
startActivity(calendario);
}
}
public void share_plan(View v) {
if (validar()) {
long id = objCRUD.insert_plan(nombre.getText().toString(), desc.getText().toString(), lugar.getText().toString(), fecha.getText().toString(), personas.getText().toString());
if (id > 0) {
Toast.makeText(this, "Saved plan", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Error saving plan", Toast.LENGTH_SHORT).show();
}
//guardar el plan creado para compartirlo posteriormente
Planes plan = new Planes();
String datosCompartir = objCRUD.compartirPlan(plan, nombre.getText().toString());
Intent intent = new Intent(v.getContext(), com.alvaro.tfg.compartir.class);
intent.putExtra("datosCompartir", datosCompartir); //pasar un dato de un activity a otro
startActivityForResult(intent, 0);
}
}
//metodo validar campos
public boolean validar() {
if (nombre.getText().toString().isEmpty()) {
Toast.makeText(this, "Name field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (desc.getText().toString().isEmpty()) {
Toast.makeText(this, "Description field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (lugar.getText().toString().isEmpty()) {
Toast.makeText(this, "Empty place field", Toast.LENGTH_SHORT).show();
validado = false;
} else if (fecha.getText().toString().equals("Date")) {
Toast.makeText(this, "Date field empty", Toast.LENGTH_SHORT).show();
validado = false;
} else if (fecha.getText().toString().equals("ERROR. Date not valid")) {
Toast.makeText(this, "Invalid date field", Toast.LENGTH_SHORT).show();
validado = false;
} else if (personas.getText().toString().equals("ERROR. People not valid")) {
Toast.makeText(this, "Invalid people fieldo", Toast.LENGTH_SHORT).show();
validado = false;
} else {
validado = true;
}
return validado;
}
}
| 6,612 | 0.587266 | 0.584392 | 169 | 38.12426 | 34.146774 | 185 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.822485 | false | false | 7 |
8b155a188fbf240e0f623149ce395b3154ee1db6 | 13,881,334,364,735 | 435b1b5483f53cc1fda838db438c8c88dfdadf31 | /src/main/java/com/eot/domain/services/MgurushService.java | 045d005c0e191573299cf9eff75eba0a9896bad7 | [] | no_license | emodatt08/EOT | https://github.com/emodatt08/EOT | 6f6b0b449412232665906c6e487f2512e1bd6f8c | 7bad6df06a9968921b86e7d8e41470e659c25f8f | refs/heads/master | 2022-04-16T04:49:37.041000 | 2018-08-31T08:25:53 | 2018-08-31T08:25:53 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.eot.domain.services;
import java.util.List;
import com.eot.domain.model.MGurush;
import com.eot.domain.model.SuperAdmin;
import com.eot.util.EotException;
public interface MgurushService {
public void saveOrUpadte(MGurush mgurush) throws EotException;
public void deleteMgurush(String userId) throws EotException ;
public void updateMgurush(MGurush mgurush)throws EotException;
public List<MGurush> findAll();
MGurush findMgurushByUserId(String userId)throws EotException;
}
| UTF-8 | Java | 510 | java | MgurushService.java | Java | [] | null | [] | package com.eot.domain.services;
import java.util.List;
import com.eot.domain.model.MGurush;
import com.eot.domain.model.SuperAdmin;
import com.eot.util.EotException;
public interface MgurushService {
public void saveOrUpadte(MGurush mgurush) throws EotException;
public void deleteMgurush(String userId) throws EotException ;
public void updateMgurush(MGurush mgurush)throws EotException;
public List<MGurush> findAll();
MGurush findMgurushByUserId(String userId)throws EotException;
}
| 510 | 0.798039 | 0.798039 | 24 | 20.25 | 23.777178 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.875 | false | false | 7 |
2573a33ff1e3f512a42474fa3374abd29acae734 | 16,776,142,260,948 | f1d20d6c7e6ec5ed491274fcc11e74bb010c57d3 | /company-central-client/src/main/java/com/ihappy/role/domain/dto/request/sys/SysCompanyRoleConfigRoleListQueryReqDTO.java | 2c6e9c44b17c409f9314509b6fc1414e3b031c70 | [] | no_license | P79N6A/company-central | https://github.com/P79N6A/company-central | 79273c8e90732cf73f2f8b08c006654809e08736 | f1a83f62a5cf41f8bfcf79c708a54d736fb1a46b | refs/heads/master | 2020-04-12T02:41:38.769000 | 2018-12-18T07:45:31 | 2018-12-18T07:45:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ihappy.role.domain.dto.request.sys;
import com.ihappy.gateway.dto.ICallRequestBaseQuery;
public class SysCompanyRoleConfigRoleListQueryReqDTO extends ICallRequestBaseQuery {
/**
* 限制条数
*/
private Integer limit;
/**
* 起始位置
*/
private Integer offset;
/**
* 关键词,角色名称模糊查询
*/
private String keyWords;
@Override
public Integer getLimit() {
return limit;
}
@Override
public void setLimit(Integer limit) {
this.limit = limit;
}
@Override
public Integer getOffset() {
return offset;
}
@Override
public void setOffset(Integer offset) {
this.offset = offset;
}
public String getKeyWords() {
return keyWords;
}
public void setKeyWords(String keyWords) {
this.keyWords = keyWords;
}
}
| UTF-8 | Java | 898 | java | SysCompanyRoleConfigRoleListQueryReqDTO.java | Java | [] | null | [] | package com.ihappy.role.domain.dto.request.sys;
import com.ihappy.gateway.dto.ICallRequestBaseQuery;
public class SysCompanyRoleConfigRoleListQueryReqDTO extends ICallRequestBaseQuery {
/**
* 限制条数
*/
private Integer limit;
/**
* 起始位置
*/
private Integer offset;
/**
* 关键词,角色名称模糊查询
*/
private String keyWords;
@Override
public Integer getLimit() {
return limit;
}
@Override
public void setLimit(Integer limit) {
this.limit = limit;
}
@Override
public Integer getOffset() {
return offset;
}
@Override
public void setOffset(Integer offset) {
this.offset = offset;
}
public String getKeyWords() {
return keyWords;
}
public void setKeyWords(String keyWords) {
this.keyWords = keyWords;
}
}
| 898 | 0.610723 | 0.610723 | 46 | 17.652174 | 17.710495 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.23913 | false | false | 7 |
f373fa279a2c604804a88aa2ace834553bd329f9 | 14,422,500,215,127 | bc3000bb936be6822d7461f4fbb830713548c2f7 | /app/src/main/java/com/example/fix/books/MainActivity.java | 8751323cf5826751963995dc7b426ecb1c32e17f | [] | no_license | Alinamurmur/SomeOnet-books | https://github.com/Alinamurmur/SomeOnet-books | 4980908d363ec47f7ccc05c8a2bd6caad7e61cd8 | 514cbda325f281b7f53358ef8fda2dd6a799bc8b | refs/heads/master | 2020-06-23T15:46:20.652000 | 2017-07-11T15:05:58 | 2017-07-11T15:05:58 | 96,906,307 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.fix.books;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.example.fix.books.Tutorial.PrefConstants;
import com.example.fix.books.Tutorial.ProductTourActivity;
import com.example.fix.books.Tutorial.SAppUtil;
import com.example.fix.books.activity.Settings_;
import com.example.fix.books.adapter.ViewPagerAdapter;
import com.example.fix.books.fragment.BaseDialogFragmentMessage_;
import com.example.fix.books.preference.Preferences_;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.view.SimpleDraweeView;
import com.vstechlab.easyfonts.EasyFonts;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.sharedpreferences.Pref;
import io.realm.Realm;
//Принцип работы AA довольно прост:
// Annotation Processor создает дочерний класс для каждого проаннотированного класса,
// в который помещает весь необходимый код, т.е.
// все наши setContentView никуда не деваются, а просто переносятся из основного кода в сгенерированный.
// Благодаря такому подходу использование AA никак не влияет на производительность готового приложения,
// в тоже время все аннотированные элементы должны иметь область видимости не ниже package-private,
// чтобы дочерний класс мог к ним обратиться.
//Находим макет и подключаем андроид анотации
@EActivity(R.layout.activity_main)
public class MainActivity extends AppCompatActivity {
//виджеты,тулбар,листалка,табы,меню
@ViewById(R.id.toolbar)
Toolbar toolbar;
@ViewById(R.id.container)
ViewPager viewPager;
//преференс,хранение
@Pref
Preferences_ preferences;
@ViewById(R.id.tabs)
TabLayout tabLayout;
@ViewById(R.id.drawer_layout)
DrawerLayout drawer;
@ViewById(R.id.nav_view)
NavigationView nvDrawer;
ActionBarDrawerToggle toggle;
//бд
Realm realm;
MenuItem selectItem = null;
//Здесь важно заметить, что внедрение ViewById произойдет уже после завершения метода OnCreate,
// чтобы выполнить какие-то действия сразу после внедрения ViewById нужно использовать аннотацию @AfterViews
@AfterViews
public void afterViews() {
//фреско-для изображений из сети
Fresco.initialize(this);
checkShowTutorial();
//настройки орм
realm = Realm.getDefaultInstance();
setToolbar();
DrawerContent();
Tabs();
drawer.setDrawerListener(toggle);
nvDrawer.setNavigationItemSelectedListener((menuItem) -> {
if (selectItem != menuItem) {
selectItem = menuItem;
switch (menuItem.getItemId()) {
case R.id.tutorial:
//явный интент
startActivity(new Intent(this, ProductTourActivity.class));
break;
case R.id.feedback:
DialogFragment dialogFragment = new BaseDialogFragmentMessage_();
dialogFragment.show(getSupportFragmentManager(), "developer");
break;
case R.id.nav_settings:
Settings_.intent(this).start();
break;
default:
break;
}
setTitle(menuItem.getTitle());
drawer.closeDrawers();
}
return true;
});
//получаем данные из гугл +
String getName = getIntent().getStringExtra("id");
String getMail = getIntent().getStringExtra("xz");
String getPhoto = getIntent().getStringExtra("img");
//находим виджеты из макета меню
View headerView = nvDrawer.inflateHeaderView(R.layout.nav_header_main);
TextView tv = (TextView) headerView.findViewById(R.id.account_email);
TextView ml = (TextView) headerView.findViewById(R.id.profile_mail);
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) headerView.findViewById(R.id.profile_img);
String path = "res:/" + R.drawable.mortarboard;
tv.setTypeface(EasyFonts.caviarDreams(this));
ml.setTypeface(EasyFonts.droidSerifRegular(this));
try {
//пытаемся грузить данные из гугль +
simpleDraweeView.setImageURI(Uri.parse(getPhoto));
ml.setText(getMail);
tv.setText(getName);
//если человек не из гугль + зашел то др данные из сервера
} catch (NullPointerException e) {
e.printStackTrace();
simpleDraweeView.setImageURI(Uri.parse(path));
tv.setText(preferences.name().get());
ml.setText(preferences.mail().get());
}
}
private void Tabs() {
//листалка
ViewPagerAdapter adapter = new ViewPagerAdapter(this, getSupportFragmentManager());
viewPager.setAdapter(adapter);
//табы
tabLayout.addTab(tabLayout.newTab().setText(R.string.books).setIcon(R.drawable.tab_select1));
tabLayout.addTab(tabLayout.newTab().setText(R.string.magazine).setIcon(R.drawable.tab_select2));
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
//по нажатию шлем опредленный фрагмент
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
@SuppressWarnings("ConstantConditions")
private void setToolbar() {
if (toolbar != null) {
setSupportActionBar(toolbar);
//название
getSupportActionBar().setTitle(R.string.dear_evening);
//кнопка назад
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
private void DrawerContent() {
toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.app_name, R.string.app_name);
}
//чтобы стрелка крутилась)
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
if (drawer != null)
toggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (drawer != null)
toggle.onConfigurationChanged(newConfig);
}
private void checkShowTutorial() {
int oldVersionCode = PrefConstants.getAppPrefInt(this, "version_code");
int currentVersionCode = SAppUtil.getAppVersionCode(this);
if (currentVersionCode > oldVersionCode) {
startActivity(new Intent(MainActivity.this, ProductTourActivity.class));
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
PrefConstants.putAppPrefInt(this, "version_code", currentVersionCode);
}
}
@Override
protected void onDestroy() {
//чтобы небыло Out Of Memory закрываем бд
realm.close();
super.onDestroy();
}
}
| UTF-8 | Java | 8,849 | java | MainActivity.java | Java | [] | null | [] | package com.example.fix.books;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.example.fix.books.Tutorial.PrefConstants;
import com.example.fix.books.Tutorial.ProductTourActivity;
import com.example.fix.books.Tutorial.SAppUtil;
import com.example.fix.books.activity.Settings_;
import com.example.fix.books.adapter.ViewPagerAdapter;
import com.example.fix.books.fragment.BaseDialogFragmentMessage_;
import com.example.fix.books.preference.Preferences_;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.view.SimpleDraweeView;
import com.vstechlab.easyfonts.EasyFonts;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.sharedpreferences.Pref;
import io.realm.Realm;
//Принцип работы AA довольно прост:
// Annotation Processor создает дочерний класс для каждого проаннотированного класса,
// в который помещает весь необходимый код, т.е.
// все наши setContentView никуда не деваются, а просто переносятся из основного кода в сгенерированный.
// Благодаря такому подходу использование AA никак не влияет на производительность готового приложения,
// в тоже время все аннотированные элементы должны иметь область видимости не ниже package-private,
// чтобы дочерний класс мог к ним обратиться.
//Находим макет и подключаем андроид анотации
@EActivity(R.layout.activity_main)
public class MainActivity extends AppCompatActivity {
//виджеты,тулбар,листалка,табы,меню
@ViewById(R.id.toolbar)
Toolbar toolbar;
@ViewById(R.id.container)
ViewPager viewPager;
//преференс,хранение
@Pref
Preferences_ preferences;
@ViewById(R.id.tabs)
TabLayout tabLayout;
@ViewById(R.id.drawer_layout)
DrawerLayout drawer;
@ViewById(R.id.nav_view)
NavigationView nvDrawer;
ActionBarDrawerToggle toggle;
//бд
Realm realm;
MenuItem selectItem = null;
//Здесь важно заметить, что внедрение ViewById произойдет уже после завершения метода OnCreate,
// чтобы выполнить какие-то действия сразу после внедрения ViewById нужно использовать аннотацию @AfterViews
@AfterViews
public void afterViews() {
//фреско-для изображений из сети
Fresco.initialize(this);
checkShowTutorial();
//настройки орм
realm = Realm.getDefaultInstance();
setToolbar();
DrawerContent();
Tabs();
drawer.setDrawerListener(toggle);
nvDrawer.setNavigationItemSelectedListener((menuItem) -> {
if (selectItem != menuItem) {
selectItem = menuItem;
switch (menuItem.getItemId()) {
case R.id.tutorial:
//явный интент
startActivity(new Intent(this, ProductTourActivity.class));
break;
case R.id.feedback:
DialogFragment dialogFragment = new BaseDialogFragmentMessage_();
dialogFragment.show(getSupportFragmentManager(), "developer");
break;
case R.id.nav_settings:
Settings_.intent(this).start();
break;
default:
break;
}
setTitle(menuItem.getTitle());
drawer.closeDrawers();
}
return true;
});
//получаем данные из гугл +
String getName = getIntent().getStringExtra("id");
String getMail = getIntent().getStringExtra("xz");
String getPhoto = getIntent().getStringExtra("img");
//находим виджеты из макета меню
View headerView = nvDrawer.inflateHeaderView(R.layout.nav_header_main);
TextView tv = (TextView) headerView.findViewById(R.id.account_email);
TextView ml = (TextView) headerView.findViewById(R.id.profile_mail);
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) headerView.findViewById(R.id.profile_img);
String path = "res:/" + R.drawable.mortarboard;
tv.setTypeface(EasyFonts.caviarDreams(this));
ml.setTypeface(EasyFonts.droidSerifRegular(this));
try {
//пытаемся грузить данные из гугль +
simpleDraweeView.setImageURI(Uri.parse(getPhoto));
ml.setText(getMail);
tv.setText(getName);
//если человек не из гугль + зашел то др данные из сервера
} catch (NullPointerException e) {
e.printStackTrace();
simpleDraweeView.setImageURI(Uri.parse(path));
tv.setText(preferences.name().get());
ml.setText(preferences.mail().get());
}
}
private void Tabs() {
//листалка
ViewPagerAdapter adapter = new ViewPagerAdapter(this, getSupportFragmentManager());
viewPager.setAdapter(adapter);
//табы
tabLayout.addTab(tabLayout.newTab().setText(R.string.books).setIcon(R.drawable.tab_select1));
tabLayout.addTab(tabLayout.newTab().setText(R.string.magazine).setIcon(R.drawable.tab_select2));
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
//по нажатию шлем опредленный фрагмент
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
@SuppressWarnings("ConstantConditions")
private void setToolbar() {
if (toolbar != null) {
setSupportActionBar(toolbar);
//название
getSupportActionBar().setTitle(R.string.dear_evening);
//кнопка назад
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
private void DrawerContent() {
toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.app_name, R.string.app_name);
}
//чтобы стрелка крутилась)
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
if (drawer != null)
toggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (drawer != null)
toggle.onConfigurationChanged(newConfig);
}
private void checkShowTutorial() {
int oldVersionCode = PrefConstants.getAppPrefInt(this, "version_code");
int currentVersionCode = SAppUtil.getAppVersionCode(this);
if (currentVersionCode > oldVersionCode) {
startActivity(new Intent(MainActivity.this, ProductTourActivity.class));
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
PrefConstants.putAppPrefInt(this, "version_code", currentVersionCode);
}
}
@Override
protected void onDestroy() {
//чтобы небыло Out Of Memory закрываем бд
realm.close();
super.onDestroy();
}
}
| 8,849 | 0.666959 | 0.665956 | 219 | 35.415524 | 27.15247 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.561644 | false | false | 7 |
1f952094c087abbcb676672cf142404e2fcab691 | 1,073,741,832,974 | 1881f664a31b049de8e54b828ebfd79c99b3af89 | /app/src/main/java/com/kitapp/repetitor/adapters/FavoritesAdapter.java | c88b00b620f941d929dd81670b6470118d1f6781 | [] | no_license | lex3m/repetitors | https://github.com/lex3m/repetitors | 8304b8a80d455512675058386b881c8fb3b6750c | 0257d2b471ee726a293f60a8905b688ca6c4c77f | refs/heads/master | 2021-07-03T20:43:02.582000 | 2017-09-26T12:48:46 | 2017-09-26T12:48:46 | 103,932,900 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.kitapp.repetitor.adapters;
import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.kitapp.repetitor.App;
import com.kitapp.repetitor.R;
import com.kitapp.repetitor.entities.Repetitor;
import java.util.ArrayList;
/**
* Created by denis on 9/21/17.
*/
public class FavoritesAdapter extends RecyclerView.Adapter<FavoritesAdapter.ViewHolder> implements ItemTouchHelperAdapter {
private Context context;
private ArrayList<Repetitor> repetitors;
private FavoritesItemClickListener itemClickListener;
public FavoritesAdapter(Context context) {
this.context = context;
this.repetitors = new ArrayList<>();
}
public void add(ArrayList<Repetitor> list) {
for (Repetitor r : list) {
repetitors.add(r);
this.notifyItemInserted(getItemCount() - 1);
}
}
@Override
public void onItemMove(int fromPosition, int toPosition) {
//
}
public void onItemDismiss(int position) {
App.getInstance().getApi().setFavorite(repetitors.get(position).getId(), false);
repetitors.remove(position);
notifyItemRemoved(position);
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View v = inflater.inflate(R.layout.i_favorite, parent, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final Repetitor r = repetitors.get(position);
holder.tvName.setText(r.getFio());
holder.tvSubject.setText(r.getDiscipline());
holder.card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (itemClickListener != null) {
itemClickListener.onFavoriteItemClick(r.getId());
}
}
});
}
@Override
public int getItemCount() {
return repetitors.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
TextView tvName;
TextView tvSubject;
CardView card;
public ViewHolder(View itemView) {
super(itemView);
tvName = (TextView) itemView.findViewById(R.id.tvFavName);
tvSubject = (TextView) itemView.findViewById(R.id.tvFavSubject);
card = (CardView) itemView.findViewById(R.id.cvFavCard);
}
}
public interface FavoritesItemClickListener {
void onFavoriteItemClick(int id);
}
public void setItemClickListener(FavoritesItemClickListener itemClickListener) {
this.itemClickListener = itemClickListener;
}
}
| UTF-8 | Java | 2,939 | java | FavoritesAdapter.java | Java | [
{
"context": "r;\n\nimport java.util.ArrayList;\n\n/**\n * Created by denis on 9/21/17.\n */\n\npublic class FavoritesAdapter ex",
"end": 453,
"score": 0.9976376295089722,
"start": 448,
"tag": "USERNAME",
"value": "denis"
}
] | null | [] | package com.kitapp.repetitor.adapters;
import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.kitapp.repetitor.App;
import com.kitapp.repetitor.R;
import com.kitapp.repetitor.entities.Repetitor;
import java.util.ArrayList;
/**
* Created by denis on 9/21/17.
*/
public class FavoritesAdapter extends RecyclerView.Adapter<FavoritesAdapter.ViewHolder> implements ItemTouchHelperAdapter {
private Context context;
private ArrayList<Repetitor> repetitors;
private FavoritesItemClickListener itemClickListener;
public FavoritesAdapter(Context context) {
this.context = context;
this.repetitors = new ArrayList<>();
}
public void add(ArrayList<Repetitor> list) {
for (Repetitor r : list) {
repetitors.add(r);
this.notifyItemInserted(getItemCount() - 1);
}
}
@Override
public void onItemMove(int fromPosition, int toPosition) {
//
}
public void onItemDismiss(int position) {
App.getInstance().getApi().setFavorite(repetitors.get(position).getId(), false);
repetitors.remove(position);
notifyItemRemoved(position);
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View v = inflater.inflate(R.layout.i_favorite, parent, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final Repetitor r = repetitors.get(position);
holder.tvName.setText(r.getFio());
holder.tvSubject.setText(r.getDiscipline());
holder.card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (itemClickListener != null) {
itemClickListener.onFavoriteItemClick(r.getId());
}
}
});
}
@Override
public int getItemCount() {
return repetitors.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
TextView tvName;
TextView tvSubject;
CardView card;
public ViewHolder(View itemView) {
super(itemView);
tvName = (TextView) itemView.findViewById(R.id.tvFavName);
tvSubject = (TextView) itemView.findViewById(R.id.tvFavSubject);
card = (CardView) itemView.findViewById(R.id.cvFavCard);
}
}
public interface FavoritesItemClickListener {
void onFavoriteItemClick(int id);
}
public void setItemClickListener(FavoritesItemClickListener itemClickListener) {
this.itemClickListener = itemClickListener;
}
}
| 2,939 | 0.670636 | 0.667914 | 98 | 28.989796 | 25.820217 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.469388 | false | false | 7 |
f109523caa18913bc7dbce5eed653dd09ffb96e2 | 19,292,993,152,460 | 96268c402007e42f706b363afe952ebf54984918 | /cutting-api/src/main/java/etu/polytech/optim/api/lang/CuttingConfiguration.java | f62c07e8334b6effef2bb75052149a32ae2359e0 | [] | no_license | lance2088/2DCuttingProblem | https://github.com/lance2088/2DCuttingProblem | cad82fd915a60dc4c03ee4a79d573d96877e0ac8 | f90ca10002952f6d9797370659a8aedd8b853db0 | refs/heads/master | 2021-01-09T05:40:52.173000 | 2015-05-13T15:22:12 | 2015-05-13T15:22:12 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package etu.polytech.optim.api.lang;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* Created by Morgan on 14/03/2015.
*/
public class CuttingConfiguration {
private final CuttingSheet sheet;
private final Collection<CuttingElement> elements;
public CuttingConfiguration(@NotNull final CuttingSheet sheet, @NotNull final Collection<CuttingElement> elements) {
this.sheet = sheet;
this.elements = Collections.unmodifiableCollection(elements);
}
/**
* Sheet configuration
* @return
*/
public CuttingSheet sheet(){
return sheet;
}
/**
* Pieces to layout, with the number of each of them
* @return
*/
public Collection<CuttingElement> elements(){
return elements;
}
public static class Builder {
private final AtomicInteger ID_GENERATOR = new AtomicInteger(0);
private final Collection<CuttingElement> elements;
private CuttingSheet sheet;
public Builder() {
elements = new ArrayList<>();
}
public void addElement(float width, float height, int asking){
final Collection<CuttingElement> alreadyDefined =
elements.parallelStream()
.filter(e -> (e.width() == width && e.height() == height) || (e.width() == height && e.height() == width))
.collect(Collectors.toList());
if(alreadyDefined.size() != 0) {
asking += alreadyDefined.parallelStream().mapToInt(CuttingElement::asking).sum();
elements.removeAll(alreadyDefined);
}
elements.add(new CuttingElement(ID_GENERATOR.getAndIncrement(), width, height, asking));
}
public void setSheet(int width, int height, int price){
sheet = new CuttingSheet(width, height, price);
}
public CuttingConfiguration build() {
if(Objects.isNull(sheet))
throw new IllegalArgumentException("No sheet defined");
if(elements.size() == 0)
throw new IllegalArgumentException("No pieces are set");
return new CuttingConfiguration(sheet, elements);
}
}
}
| UTF-8 | Java | 2,435 | java | CuttingConfiguration.java | Java | [
{
"context": "rt java.util.stream.Collectors;\n\n/**\n * Created by Morgan on 14/03/2015.\n */\npublic class CuttingConfigurat",
"end": 305,
"score": 0.9982687830924988,
"start": 299,
"tag": "NAME",
"value": "Morgan"
}
] | null | [] | package etu.polytech.optim.api.lang;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* Created by Morgan on 14/03/2015.
*/
public class CuttingConfiguration {
private final CuttingSheet sheet;
private final Collection<CuttingElement> elements;
public CuttingConfiguration(@NotNull final CuttingSheet sheet, @NotNull final Collection<CuttingElement> elements) {
this.sheet = sheet;
this.elements = Collections.unmodifiableCollection(elements);
}
/**
* Sheet configuration
* @return
*/
public CuttingSheet sheet(){
return sheet;
}
/**
* Pieces to layout, with the number of each of them
* @return
*/
public Collection<CuttingElement> elements(){
return elements;
}
public static class Builder {
private final AtomicInteger ID_GENERATOR = new AtomicInteger(0);
private final Collection<CuttingElement> elements;
private CuttingSheet sheet;
public Builder() {
elements = new ArrayList<>();
}
public void addElement(float width, float height, int asking){
final Collection<CuttingElement> alreadyDefined =
elements.parallelStream()
.filter(e -> (e.width() == width && e.height() == height) || (e.width() == height && e.height() == width))
.collect(Collectors.toList());
if(alreadyDefined.size() != 0) {
asking += alreadyDefined.parallelStream().mapToInt(CuttingElement::asking).sum();
elements.removeAll(alreadyDefined);
}
elements.add(new CuttingElement(ID_GENERATOR.getAndIncrement(), width, height, asking));
}
public void setSheet(int width, int height, int price){
sheet = new CuttingSheet(width, height, price);
}
public CuttingConfiguration build() {
if(Objects.isNull(sheet))
throw new IllegalArgumentException("No sheet defined");
if(elements.size() == 0)
throw new IllegalArgumentException("No pieces are set");
return new CuttingConfiguration(sheet, elements);
}
}
}
| 2,435 | 0.62423 | 0.619713 | 79 | 29.822784 | 29.897614 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.506329 | false | false | 7 |
f40b195a0efbd5d29812e8c3c4d08e085376e776 | 6,055,903,922,677 | 696936991c30e8e226e73274064af03c0d5f9291 | /app/src/main/java/com/lollipopstudio/www/safe/activity/QueryAddressActivity.java | 30ca8f7dc68b20730cacc17cf3edfbb9f0243b61 | [] | no_license | SMILEORIGIN/safe | https://github.com/SMILEORIGIN/safe | bd93247c170b92bb85e7bbc4bb1033f60d237d70 | 4d2dd24ca5a7476a01151dd96ba4490d3987ec7b | refs/heads/master | 2018-02-18T17:26:27.777000 | 2016-09-30T13:23:53 | 2016-09-30T13:23:53 | 64,379,438 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lollipopstudio.www.safe.activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.TextView;
import com.lollipopstudio.www.safe.R;
import com.lollipopstudio.www.safe.engine.AddressDao;
public class QueryAddressActivity extends AppCompatActivity {
private EditText input_phoneNumber;
private TextView result_tv;
private String mAddress;
private Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
//控件使用查询结果
result_tv.setText(mAddress);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_query_address);
initUI();
}
private void initUI() {
input_phoneNumber = (EditText)findViewById(R.id.ed_query_address);
result_tv = (TextView)findViewById(R.id.tv_query_address);
//实时查询监听输入框文本的变换
input_phoneNumber.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
String phone = input_phoneNumber.getText().toString();
//查询是耗时操作
query(phone);
}
});
}
public void bt_query_address(View view) {
String phone = input_phoneNumber.getText().toString();
if (!TextUtils.isEmpty(phone)){
//查询是耗时操作
query(phone);
}else {
//抖动窗口
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
findViewById(R.id.ed_query_address).startAnimation(shake);
//手机震动效果
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
vibrator.vibrate(500);
}
}
/**
* 获取电话号码归属地--耗时操作
* @param phone 要查询的电话号码
*/
private void query(final String phone) {
new Thread(){
@Override
public void run() {
mAddress = AddressDao.getAddres(phone);
//如果在在此操作UI(不能再子线程操作UI)将会报错
//消息机制,告知主线程查询结束,可使用结果
mHandler.sendEmptyMessage(0);
}
}.start();
}
}
| UTF-8 | Java | 3,054 | java | QueryAddressActivity.java | Java | [] | null | [] | package com.lollipopstudio.www.safe.activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.TextView;
import com.lollipopstudio.www.safe.R;
import com.lollipopstudio.www.safe.engine.AddressDao;
public class QueryAddressActivity extends AppCompatActivity {
private EditText input_phoneNumber;
private TextView result_tv;
private String mAddress;
private Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
//控件使用查询结果
result_tv.setText(mAddress);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_query_address);
initUI();
}
private void initUI() {
input_phoneNumber = (EditText)findViewById(R.id.ed_query_address);
result_tv = (TextView)findViewById(R.id.tv_query_address);
//实时查询监听输入框文本的变换
input_phoneNumber.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
String phone = input_phoneNumber.getText().toString();
//查询是耗时操作
query(phone);
}
});
}
public void bt_query_address(View view) {
String phone = input_phoneNumber.getText().toString();
if (!TextUtils.isEmpty(phone)){
//查询是耗时操作
query(phone);
}else {
//抖动窗口
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
findViewById(R.id.ed_query_address).startAnimation(shake);
//手机震动效果
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
vibrator.vibrate(500);
}
}
/**
* 获取电话号码归属地--耗时操作
* @param phone 要查询的电话号码
*/
private void query(final String phone) {
new Thread(){
@Override
public void run() {
mAddress = AddressDao.getAddres(phone);
//如果在在此操作UI(不能再子线程操作UI)将会报错
//消息机制,告知主线程查询结束,可使用结果
mHandler.sendEmptyMessage(0);
}
}.start();
}
}
| 3,054 | 0.621127 | 0.619366 | 99 | 27.686869 | 22.912502 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.464646 | false | false | 7 |
652e74f19bb1b8cbdb640654a277e99293dca8af | 11,312,943,901,591 | 20eb03455a83dec5a1bcabf5eb6ed1a6cbc8c46e | /src/automenta/netention/value/real/RealVar.java | 5fa7f1d878d872bda1d98137cd41261f9128ef7d | [] | no_license | automenta/old-netention2 | https://github.com/automenta/old-netention2 | e7a5871ad45e06d29ceeb3fedc5fd74735607096 | 9f7639e9f95ae354e8b2d8eddd65557c2c56daef | refs/heads/master | 2020-05-18T16:22:51.618000 | 2010-02-13T13:48:11 | 2010-02-13T13:48:11 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
*/
package automenta.netention.value.real;
import automenta.netention.value.Property;
import automenta.netention.value.PropertyValue;
import automenta.netention.value.Unit;
public class RealVar extends Property {
private Unit unit;
public RealVar() {
super();
}
public RealVar(String id, String name) {
this(id, name, Unit.Number);
}
public RealVar(String id, String name, Unit unit) {
super(id, name);
this.unit = unit;
}
public Unit getUnit() {
return unit;
}
public boolean isInteger() { return false; }
@Override public PropertyValue newDefaultValue() {
RealIs r = new RealIs(0.0);
r.setProperty(getID());
return r;
}
public static Unit getUnit(String s) {
if (s == null)
return null;
if (s.equalsIgnoreCase("mass")) return Unit.Mass;
if (s.equalsIgnoreCase("volume")) return Unit.Volume;
if (s.equalsIgnoreCase("area")) return Unit.Area;
if (s.equalsIgnoreCase("distance")) return Unit.Distance;
if (s.equalsIgnoreCase("currency")) return Unit.Currency;
if (s.equalsIgnoreCase("number")) return Unit.Number;
if (s.equalsIgnoreCase("speed")) return Unit.Speed;
if (s.equalsIgnoreCase("timeduration")) return Unit.TimeDuration;
if (s.equalsIgnoreCase("timepoint")) return Unit.TimePoint;
return null;
}
} | UTF-8 | Java | 1,295 | java | RealVar.java | Java | [] | null | [] | /**
*
*/
package automenta.netention.value.real;
import automenta.netention.value.Property;
import automenta.netention.value.PropertyValue;
import automenta.netention.value.Unit;
public class RealVar extends Property {
private Unit unit;
public RealVar() {
super();
}
public RealVar(String id, String name) {
this(id, name, Unit.Number);
}
public RealVar(String id, String name, Unit unit) {
super(id, name);
this.unit = unit;
}
public Unit getUnit() {
return unit;
}
public boolean isInteger() { return false; }
@Override public PropertyValue newDefaultValue() {
RealIs r = new RealIs(0.0);
r.setProperty(getID());
return r;
}
public static Unit getUnit(String s) {
if (s == null)
return null;
if (s.equalsIgnoreCase("mass")) return Unit.Mass;
if (s.equalsIgnoreCase("volume")) return Unit.Volume;
if (s.equalsIgnoreCase("area")) return Unit.Area;
if (s.equalsIgnoreCase("distance")) return Unit.Distance;
if (s.equalsIgnoreCase("currency")) return Unit.Currency;
if (s.equalsIgnoreCase("number")) return Unit.Number;
if (s.equalsIgnoreCase("speed")) return Unit.Speed;
if (s.equalsIgnoreCase("timeduration")) return Unit.TimeDuration;
if (s.equalsIgnoreCase("timepoint")) return Unit.TimePoint;
return null;
}
} | 1,295 | 0.703475 | 0.701931 | 56 | 22.142857 | 21.715225 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.714286 | false | false | 7 |
77576c9c42d17fd6fc73d76ee1e5715ab4d4ad1b | 32,375,463,540,307 | a30a48aca35d28801670be5fae53433c0576cf7b | /src/main/java/proyecto/persistencia/PControladorEmpleados.java | db30520628904c0e396084c349c08f3e8ed3cb43 | [] | no_license | ProyectoBios/proyecto-final | https://github.com/ProyectoBios/proyecto-final | 718c59f087cd22a1262b5800cf76ddbbddc5269a | cca2f73bea96d270f5407b5dbdcbcec8acd28a3e | refs/heads/master | 2021-07-18T09:24:00.966000 | 2018-10-12T05:33:13 | 2018-10-12T05:33:13 | 98,738,547 | 1 | 0 | null | false | 2017-08-21T18:14:18 | 2017-07-29T14:43:32 | 2017-07-29T14:43:32 | 2017-08-21T18:14:18 | 55 | 0 | 0 | 0 | null | null | null | package proyecto.persistencia;
import proyecto.entidades.Empleado;
import proyecto.entidades.ExcepcionFrigorifico;
import proyecto.entidades.Repartidor;
import proyecto.entidades.Vehiculo;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
class PControladorEmpleados implements IPEmpleados{
private static PControladorEmpleados instancia = null;
public static PControladorEmpleados getInstancia(){
if(instancia == null){
instancia = new PControladorEmpleados();
}
return instancia;
}
private PControladorEmpleados(){}
@Override
public Empleado buscarEmpleado(String ci, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Empleado WHERE ci = ?")){
consulta.setString(1, ci);
ResultSet resultado = consulta.executeQuery();
Empleado empleado = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
empleado = new Empleado(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"));
}
}
return empleado;
}catch (Exception ex){
throw ex;
}
}
@Override
public Repartidor buscarRepartidor(String ci, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT Empleado.*, Repartidor.vencLibreta FROM Empleado INNER JOIN Repartidor ON Empleado.ci = Repartidor.ci WHERE Empleado.ci = ?")){
consulta.setString(1, ci);
ResultSet resultado = consulta.executeQuery();
Repartidor repartidor = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
repartidor = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
}
}
return repartidor;
}catch (Exception ex){
throw ex;
}
}
@Override
public ArrayList<Empleado> listarEmpleadosXRol(String rol, boolean soloActivos) throws Exception {
if(rol.equals("repartidor")){
return listarRepartidores();
}else {
try (Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Empleado WHERE rol = ?")) {
consulta.setString(1, rol);
ResultSet resultado = consulta.executeQuery();
ArrayList<Empleado> empleados = new ArrayList<>();
Empleado empleado = null;
while (resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
if (resultado.getString("rol").equals("repartidor")) {
empleado = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
} else {
empleado = new Empleado(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"));
}
empleados.add(empleado);
}
}
return empleados;
} catch (Exception ex) {
throw ex;
}
}
}
public ArrayList<Empleado> listarRepartidores() throws Exception{
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT Empleado.*, Repartidor.vencLibreta FROM Empleado INNER JOIN Repartidor ON Empleado.ci = Repartidor.ci")){
ResultSet resultado = consulta.executeQuery();
Empleado repartidor = null;
ArrayList<Empleado> repartidores = new ArrayList<>();
while(resultado.next()) {
repartidor = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
repartidores.add(repartidor);
}
return repartidores;
}catch (Exception ex){
throw ex;
}
}
public void altaEmpleado(Empleado e) throws Exception{
try(Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL AltaEmpleado(?, ?, ?, ?, ?, ?, ?)}")){
if(e instanceof Repartidor){
altaRepartidor((Repartidor)e, con);
}else{
statement.setString(1, e.getCi());
statement.setString(2, e.getNombre());
statement.setString(3, e.getContrasenia());
statement.setDate(4, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setString(6, e.getTelefono());
statement.setString(7, e.getRol());
int filasAfectadas = statement.executeUpdate();
}
}catch (Exception ex){
throw ex;
}
}
private void altaRepartidor(Repartidor r, Connection con) throws Exception{
try(CallableStatement statement = con.prepareCall("{CALL AltaRepartidor(?, ?, ?, ?, ?, ?, ?)}")){
statement.setString(1, r.getCi());
statement.setString(2, r.getNombre());
statement.setString(3, r.getContrasenia());
statement.setDate(4, new java.sql.Date(r.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(r.getFechaContratacion().getTime()));
statement.setDate(6, new java.sql.Date(r.getVencLibreta().getTime()));
statement.setString(7, r.getTelefono());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public void bajaEmpleado(Empleado e) throws Exception {
try(Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL BajaEmpleado(?)}")){
statement.setString(1, e.getCi());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public void modificarEmpleado(Empleado e) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement statement = con.prepareStatement("UPDATE Empleado SET nombre = ?, contrasenia=?, fechaNac = ?, fechaContratacion=?, telefono = ? WHERE ci = ?")){
if(e instanceof Repartidor){
modificarRepartidor((Repartidor)e, con);
}else{
statement.setString(1, e.getNombre());
statement.setString(2, e.getContrasenia());
statement.setDate(3, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(4, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setString(5, e.getTelefono());
statement.setString(6, e.getCi());
statement.executeUpdate();
}
}catch (Exception ex){
throw ex;
}
}
private void modificarRepartidor(Repartidor e, Connection con) throws Exception{
try(CallableStatement statement = con.prepareCall("{CALL ModificarRepartidor(?, ?, ?, ?, ?, ?, ?)}")){
statement.setString(2, e.getNombre());
statement.setString(3, e.getContrasenia());
statement.setDate(4, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setDate(6, new java.sql.Date(e.getVencLibreta().getTime()));
statement.setString(7, e.getTelefono());
statement.setString(1, e.getCi());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public Vehiculo buscarVehiculo(String matricula, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Vehiculo WHERE matricula = ?")){
consulta.setString(1, matricula);
ResultSet resultado = consulta.executeQuery();
Vehiculo v = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
v = new Vehiculo(matricula, resultado.getString("marca"), resultado.getString("modelo"), resultado.getInt("cargaMax"));
}
}
return v;
}catch (Exception ex){
throw ex;
}
}
@Override
public void altaVehiculo(Vehiculo v) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement statement = con.prepareStatement("INSERT INTO Vehiculo VALUES (?, ?, ?, ?, 0)")) {
statement.setString(1, v.getMatricula());
statement.setString(2, v.getMarca());
statement.setString(3, v.getModelo());
statement.setInt(4, v.getCargaMax());
int filasAfectadas = statement.executeUpdate();
if (filasAfectadas != 1){
throw new ExcepcionFrigorifico("Hubo un error al agregar el vehículo.");
}
}catch (Exception ex){
throw ex;
}
}
@Override
public void bajaVehiculo(Vehiculo v) throws Exception {
try (Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL BajaVehiculo(?)}")){
statement.setString(1, v.getMatricula());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public ArrayList<Vehiculo> listarVehiculos(boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Vehiculo")){
ResultSet resultado = consulta.executeQuery();
Vehiculo v = null;
ArrayList<Vehiculo> vehiculos = new ArrayList<>();
while(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
v = new Vehiculo(resultado.getString("matricula"), resultado.getString("marca"), resultado.getString("modelo"), resultado.getInt("cargaMax"));
vehiculos.add(v);
}
}
return vehiculos;
}catch (Exception ex){
throw ex;
}
}
}
| UTF-8 | Java | 11,847 | java | PControladorEmpleados.java | Java | [] | null | [] | package proyecto.persistencia;
import proyecto.entidades.Empleado;
import proyecto.entidades.ExcepcionFrigorifico;
import proyecto.entidades.Repartidor;
import proyecto.entidades.Vehiculo;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
class PControladorEmpleados implements IPEmpleados{
private static PControladorEmpleados instancia = null;
public static PControladorEmpleados getInstancia(){
if(instancia == null){
instancia = new PControladorEmpleados();
}
return instancia;
}
private PControladorEmpleados(){}
@Override
public Empleado buscarEmpleado(String ci, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Empleado WHERE ci = ?")){
consulta.setString(1, ci);
ResultSet resultado = consulta.executeQuery();
Empleado empleado = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
empleado = new Empleado(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"));
}
}
return empleado;
}catch (Exception ex){
throw ex;
}
}
@Override
public Repartidor buscarRepartidor(String ci, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT Empleado.*, Repartidor.vencLibreta FROM Empleado INNER JOIN Repartidor ON Empleado.ci = Repartidor.ci WHERE Empleado.ci = ?")){
consulta.setString(1, ci);
ResultSet resultado = consulta.executeQuery();
Repartidor repartidor = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
repartidor = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
}
}
return repartidor;
}catch (Exception ex){
throw ex;
}
}
@Override
public ArrayList<Empleado> listarEmpleadosXRol(String rol, boolean soloActivos) throws Exception {
if(rol.equals("repartidor")){
return listarRepartidores();
}else {
try (Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Empleado WHERE rol = ?")) {
consulta.setString(1, rol);
ResultSet resultado = consulta.executeQuery();
ArrayList<Empleado> empleados = new ArrayList<>();
Empleado empleado = null;
while (resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
if (resultado.getString("rol").equals("repartidor")) {
empleado = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
} else {
empleado = new Empleado(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"));
}
empleados.add(empleado);
}
}
return empleados;
} catch (Exception ex) {
throw ex;
}
}
}
public ArrayList<Empleado> listarRepartidores() throws Exception{
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT Empleado.*, Repartidor.vencLibreta FROM Empleado INNER JOIN Repartidor ON Empleado.ci = Repartidor.ci")){
ResultSet resultado = consulta.executeQuery();
Empleado repartidor = null;
ArrayList<Empleado> repartidores = new ArrayList<>();
while(resultado.next()) {
repartidor = new Repartidor(resultado.getString("ci"), resultado.getString("nombre"), resultado.getString("contrasenia"), resultado.getDate("fechaNac"), resultado.getDate("fechaContratacion"), resultado.getString("telefono"), resultado.getString("rol"), resultado.getDate("vencLibreta"));
repartidores.add(repartidor);
}
return repartidores;
}catch (Exception ex){
throw ex;
}
}
public void altaEmpleado(Empleado e) throws Exception{
try(Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL AltaEmpleado(?, ?, ?, ?, ?, ?, ?)}")){
if(e instanceof Repartidor){
altaRepartidor((Repartidor)e, con);
}else{
statement.setString(1, e.getCi());
statement.setString(2, e.getNombre());
statement.setString(3, e.getContrasenia());
statement.setDate(4, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setString(6, e.getTelefono());
statement.setString(7, e.getRol());
int filasAfectadas = statement.executeUpdate();
}
}catch (Exception ex){
throw ex;
}
}
private void altaRepartidor(Repartidor r, Connection con) throws Exception{
try(CallableStatement statement = con.prepareCall("{CALL AltaRepartidor(?, ?, ?, ?, ?, ?, ?)}")){
statement.setString(1, r.getCi());
statement.setString(2, r.getNombre());
statement.setString(3, r.getContrasenia());
statement.setDate(4, new java.sql.Date(r.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(r.getFechaContratacion().getTime()));
statement.setDate(6, new java.sql.Date(r.getVencLibreta().getTime()));
statement.setString(7, r.getTelefono());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public void bajaEmpleado(Empleado e) throws Exception {
try(Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL BajaEmpleado(?)}")){
statement.setString(1, e.getCi());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public void modificarEmpleado(Empleado e) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement statement = con.prepareStatement("UPDATE Empleado SET nombre = ?, contrasenia=?, fechaNac = ?, fechaContratacion=?, telefono = ? WHERE ci = ?")){
if(e instanceof Repartidor){
modificarRepartidor((Repartidor)e, con);
}else{
statement.setString(1, e.getNombre());
statement.setString(2, e.getContrasenia());
statement.setDate(3, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(4, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setString(5, e.getTelefono());
statement.setString(6, e.getCi());
statement.executeUpdate();
}
}catch (Exception ex){
throw ex;
}
}
private void modificarRepartidor(Repartidor e, Connection con) throws Exception{
try(CallableStatement statement = con.prepareCall("{CALL ModificarRepartidor(?, ?, ?, ?, ?, ?, ?)}")){
statement.setString(2, e.getNombre());
statement.setString(3, e.getContrasenia());
statement.setDate(4, new java.sql.Date(e.getFechaDeNacimiento().getTime()));
statement.setDate(5, new java.sql.Date(e.getFechaContratacion().getTime()));
statement.setDate(6, new java.sql.Date(e.getVencLibreta().getTime()));
statement.setString(7, e.getTelefono());
statement.setString(1, e.getCi());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public Vehiculo buscarVehiculo(String matricula, boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Vehiculo WHERE matricula = ?")){
consulta.setString(1, matricula);
ResultSet resultado = consulta.executeQuery();
Vehiculo v = null;
if(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
v = new Vehiculo(matricula, resultado.getString("marca"), resultado.getString("modelo"), resultado.getInt("cargaMax"));
}
}
return v;
}catch (Exception ex){
throw ex;
}
}
@Override
public void altaVehiculo(Vehiculo v) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement statement = con.prepareStatement("INSERT INTO Vehiculo VALUES (?, ?, ?, ?, 0)")) {
statement.setString(1, v.getMatricula());
statement.setString(2, v.getMarca());
statement.setString(3, v.getModelo());
statement.setInt(4, v.getCargaMax());
int filasAfectadas = statement.executeUpdate();
if (filasAfectadas != 1){
throw new ExcepcionFrigorifico("Hubo un error al agregar el vehículo.");
}
}catch (Exception ex){
throw ex;
}
}
@Override
public void bajaVehiculo(Vehiculo v) throws Exception {
try (Connection con = Conexion.AbrirConexion();
CallableStatement statement = con.prepareCall("{CALL BajaVehiculo(?)}")){
statement.setString(1, v.getMatricula());
statement.executeUpdate();
}catch (Exception ex){
throw ex;
}
}
@Override
public ArrayList<Vehiculo> listarVehiculos(boolean soloActivos) throws Exception {
try(Connection con = Conexion.AbrirConexion();
PreparedStatement consulta = con.prepareStatement("SELECT * FROM Vehiculo")){
ResultSet resultado = consulta.executeQuery();
Vehiculo v = null;
ArrayList<Vehiculo> vehiculos = new ArrayList<>();
while(resultado.next()) {
if(!(resultado.getBoolean("eliminado") && soloActivos)) {
v = new Vehiculo(resultado.getString("matricula"), resultado.getString("marca"), resultado.getString("modelo"), resultado.getInt("cargaMax"));
vehiculos.add(v);
}
}
return vehiculos;
}catch (Exception ex){
throw ex;
}
}
}
| 11,847 | 0.601807 | 0.598514 | 288 | 40.131943 | 47.88662 | 314 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.791667 | false | false | 7 |
93ac1a319b8a7697733727f26342f241ffcb2267 | 31,791,347,953,130 | 57f8e22dd146903a40f29be73e1e80ddf6d149d7 | /app/src/main/java/nyc/c4q/rosmaryfc/focus_app/BlockSessionAlertDialogFragment.java | b4ebd3e74df545f819d38425092712ea29e32e35 | [] | no_license | RosmaryFC/Focus-App | https://github.com/RosmaryFC/Focus-App | 1bc81fe80b27be9162775c9fa26c33b5bd100d1a | 8dcd3b955f051929aa136778b0f2df5d832ed56c | refs/heads/master | 2020-05-24T15:48:57.074000 | 2016-02-03T22:25:56 | 2016-02-03T22:25:56 | 40,445,713 | 1 | 4 | null | false | 2015-09-30T00:25:46 | 2015-08-09T18:11:51 | 2015-08-09T19:37:13 | 2015-09-30T00:25:46 | 2,270 | 1 | 3 | 12 | Java | null | null | package nyc.c4q.rosmaryfc.focus_app;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.text.InputType;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import nyc.c4q.rosmaryfc.focus_app.db.BlockSessionContract;
import nyc.c4q.rosmaryfc.focus_app.db.BlockSessionDBHelper;
/**
* Created by c4q-rosmary on 9/12/15.
*/
public class BlockSessionAlertDialogFragment extends DialogFragment implements View.OnClickListener{
View rootView;
String blockType;
int blockId;
String blockName;
String blockStartTime;
String blockEndTime;
String blockDate;
EditText nameET;
EditText startTimeET;
EditText endTimeET;
EditText dateET;
Button saveBtn;
Button cancelBtn;
private BlockSessionDBHelper helper;
static BlockSessionAlertDialogFragment newInstance(BlockSession blockSession) {
BlockSessionAlertDialogFragment f = new BlockSessionAlertDialogFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
args.putInt("id", blockSession.getId());
args.putString("name", blockSession.getName());
args.putString("startTime", blockSession.getStartTime());
args.putString("endTime", blockSession.getEndTime());
args.putString("date",blockSession.getDate());
f.setArguments(args);
return f;
}
public static interface DialogButtons
{
public void save();
public void cancel();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
blockId = getArguments().getInt("id");
blockName = getArguments().getString("name");
blockStartTime = getArguments().getString("startTime");
blockEndTime = getArguments().getString("endTime");
blockDate = getArguments().getString("date");
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.block_session_future_dialog, container,
false);
initializeViews();
nameET.setText(blockName);
startTimeET.setText(blockStartTime);
endTimeET.setText(blockEndTime);
dateET.setText(blockDate);
startTimeET.setInputType(InputType.TYPE_NULL);
startTimeET.setOnClickListener(startTimeListener);
endTimeET.setInputType(InputType.TYPE_NULL);
endTimeET.setOnClickListener(endTimeListener);
dateET.setInputType(InputType.TYPE_NULL);
dateET.setOnClickListener(dateListener);
saveBtn.setOnClickListener(this);
return rootView;
}
public void initializeViews () {
nameET = (EditText) rootView.findViewById(R.id.name_et);
startTimeET = (EditText) rootView.findViewById(R.id.start_time_et);
endTimeET = (EditText) rootView.findViewById(R.id.end_time_et);
dateET = (EditText) rootView.findViewById(R.id.date_et);
saveBtn = (Button) rootView.findViewById(R.id.save_btn);
}
public View.OnClickListener startTimeListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
Calendar dateTime = Calendar.getInstance();
dateTime.set(Calendar.HOUR_OF_DAY, selectedHour);
dateTime.set(Calendar.MINUTE, selectedMinute);
String format = "h:mm a";
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
String formattedTime = sdf.format(dateTime.getTime());
startTimeET.setText(formattedTime);
}
}, hour, minute, false);
mTimePicker.setTitle("Select Start Time");
mTimePicker.show();
}
};
public View.OnClickListener endTimeListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
Calendar dateTime = Calendar.getInstance();
dateTime.set(Calendar.HOUR_OF_DAY, selectedHour);
dateTime.set(Calendar.MINUTE, selectedMinute);
String format = "h:mm a";
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
String formattedTime = sdf.format(dateTime.getTime());
endTimeET.setText(formattedTime);
}
}, hour, minute, false);
mTimePicker.setTitle("Select Time");
mTimePicker.show();
}
};
public View.OnClickListener dateListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
//To show current date in the datepicker
Calendar mcurrentDate = Calendar.getInstance();
int mYear = mcurrentDate.get(Calendar.YEAR);
int mMonth = mcurrentDate.get(Calendar.MONTH);
int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);
DatePickerDialog mDatePicker;
mDatePicker = new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int selectedYear, int selectedMonth, int selectedDay) {
// TODO Auto-generated method stub
/* get date and time */
selectedMonth = selectedMonth + 1;
dateET.setText(selectedMonth + "/" + selectedDay +"/" + selectedYear);
}
}, mYear, mMonth, mDay);
mDatePicker.setTitle("Select Date");
mDatePicker.show();
}
};
public void getData(){
String selectQuery = "SELECT * FROM " + BlockSessionContract.TABLE_BLOCK_SESSIONS;
SQLiteDatabase db = helper.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
//looping through all rows and adding to the list
if(cursor.moveToFirst()){
do{
BlockSession blockSession = new BlockSession();
blockSession.setName(cursor.getString(1));
blockSession.setDate(cursor.getString(2));
blockSession.setStartTime(cursor.getString(3));
blockSession.setEndTime(cursor.getString(4));
blockSession.setNotes(cursor.getString(5));
String log = "ID: " + blockSession.getId() + " , Name: " + blockSession.getName() + ", Date: " + blockSession.getDate()
+ ", StartTime: " + blockSession.getStartTime() + " , EndTime: " + blockSession.getEndTime()
+ ", Notes: " + blockSession.getNotes();
Log.d("FOCUS SESSION result: ", log);
}while(cursor.moveToNext());
}
db.close();
}
@Override
public void onClick(View view) {
if (view == saveBtn)
{
String name = nameET.getText().toString();
String date = dateET.getText().toString();
String startTime = startTimeET.getText().toString();
String endTime = endTimeET.getText().toString();
//
// helper = new BlockSessionDBHelper(getActivity());
// helper.updateBlockSession()
//helper.addBlockSession(new BlockSession(name, date, startTime, endTime, "N/A"));
getData();
this.dismiss();
}
else if (view == cancelBtn)
{
//buttons.cancel();
this.dismiss();
}
}
}
// @Override
// public Dialog onCreateDialog(Bundle savedInstanceState) {
//
// blockType = "Future";
//
// return new AlertDialog.Builder(getActivity())
// // Set Dialog Icon
// .setIcon(R.drawable.icon_1)
// // Set Dialog Title
// .setTitle("Create " + blockType + " Block Session")
// // Set Dialog Message
// .setMessage("Please fill out all fields below")
//
// // Positive button
// .setPositiveButton("OK", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// // Do something else
// }
// })
//
// // Negative Button
// .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// // Do something else
// }
// }).create();
//
//
// } | UTF-8 | Java | 10,356 | java | BlockSessionAlertDialogFragment.java | Java | [
{
"context": "us_app.db.BlockSessionDBHelper;\n\n/**\n * Created by c4q-rosmary on 9/12/15.\n */\npublic class BlockSessionAlertDia",
"end": 825,
"score": 0.9997053742408752,
"start": 814,
"tag": "USERNAME",
"value": "c4q-rosmary"
}
] | null | [] | package nyc.c4q.rosmaryfc.focus_app;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.text.InputType;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import nyc.c4q.rosmaryfc.focus_app.db.BlockSessionContract;
import nyc.c4q.rosmaryfc.focus_app.db.BlockSessionDBHelper;
/**
* Created by c4q-rosmary on 9/12/15.
*/
public class BlockSessionAlertDialogFragment extends DialogFragment implements View.OnClickListener{
View rootView;
String blockType;
int blockId;
String blockName;
String blockStartTime;
String blockEndTime;
String blockDate;
EditText nameET;
EditText startTimeET;
EditText endTimeET;
EditText dateET;
Button saveBtn;
Button cancelBtn;
private BlockSessionDBHelper helper;
static BlockSessionAlertDialogFragment newInstance(BlockSession blockSession) {
BlockSessionAlertDialogFragment f = new BlockSessionAlertDialogFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
args.putInt("id", blockSession.getId());
args.putString("name", blockSession.getName());
args.putString("startTime", blockSession.getStartTime());
args.putString("endTime", blockSession.getEndTime());
args.putString("date",blockSession.getDate());
f.setArguments(args);
return f;
}
public static interface DialogButtons
{
public void save();
public void cancel();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
blockId = getArguments().getInt("id");
blockName = getArguments().getString("name");
blockStartTime = getArguments().getString("startTime");
blockEndTime = getArguments().getString("endTime");
blockDate = getArguments().getString("date");
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.block_session_future_dialog, container,
false);
initializeViews();
nameET.setText(blockName);
startTimeET.setText(blockStartTime);
endTimeET.setText(blockEndTime);
dateET.setText(blockDate);
startTimeET.setInputType(InputType.TYPE_NULL);
startTimeET.setOnClickListener(startTimeListener);
endTimeET.setInputType(InputType.TYPE_NULL);
endTimeET.setOnClickListener(endTimeListener);
dateET.setInputType(InputType.TYPE_NULL);
dateET.setOnClickListener(dateListener);
saveBtn.setOnClickListener(this);
return rootView;
}
public void initializeViews () {
nameET = (EditText) rootView.findViewById(R.id.name_et);
startTimeET = (EditText) rootView.findViewById(R.id.start_time_et);
endTimeET = (EditText) rootView.findViewById(R.id.end_time_et);
dateET = (EditText) rootView.findViewById(R.id.date_et);
saveBtn = (Button) rootView.findViewById(R.id.save_btn);
}
public View.OnClickListener startTimeListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
Calendar dateTime = Calendar.getInstance();
dateTime.set(Calendar.HOUR_OF_DAY, selectedHour);
dateTime.set(Calendar.MINUTE, selectedMinute);
String format = "h:mm a";
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
String formattedTime = sdf.format(dateTime.getTime());
startTimeET.setText(formattedTime);
}
}, hour, minute, false);
mTimePicker.setTitle("Select Start Time");
mTimePicker.show();
}
};
public View.OnClickListener endTimeListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
Calendar dateTime = Calendar.getInstance();
dateTime.set(Calendar.HOUR_OF_DAY, selectedHour);
dateTime.set(Calendar.MINUTE, selectedMinute);
String format = "h:mm a";
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
String formattedTime = sdf.format(dateTime.getTime());
endTimeET.setText(formattedTime);
}
}, hour, minute, false);
mTimePicker.setTitle("Select Time");
mTimePicker.show();
}
};
public View.OnClickListener dateListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
//To show current date in the datepicker
Calendar mcurrentDate = Calendar.getInstance();
int mYear = mcurrentDate.get(Calendar.YEAR);
int mMonth = mcurrentDate.get(Calendar.MONTH);
int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);
DatePickerDialog mDatePicker;
mDatePicker = new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int selectedYear, int selectedMonth, int selectedDay) {
// TODO Auto-generated method stub
/* get date and time */
selectedMonth = selectedMonth + 1;
dateET.setText(selectedMonth + "/" + selectedDay +"/" + selectedYear);
}
}, mYear, mMonth, mDay);
mDatePicker.setTitle("Select Date");
mDatePicker.show();
}
};
public void getData(){
String selectQuery = "SELECT * FROM " + BlockSessionContract.TABLE_BLOCK_SESSIONS;
SQLiteDatabase db = helper.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
//looping through all rows and adding to the list
if(cursor.moveToFirst()){
do{
BlockSession blockSession = new BlockSession();
blockSession.setName(cursor.getString(1));
blockSession.setDate(cursor.getString(2));
blockSession.setStartTime(cursor.getString(3));
blockSession.setEndTime(cursor.getString(4));
blockSession.setNotes(cursor.getString(5));
String log = "ID: " + blockSession.getId() + " , Name: " + blockSession.getName() + ", Date: " + blockSession.getDate()
+ ", StartTime: " + blockSession.getStartTime() + " , EndTime: " + blockSession.getEndTime()
+ ", Notes: " + blockSession.getNotes();
Log.d("FOCUS SESSION result: ", log);
}while(cursor.moveToNext());
}
db.close();
}
@Override
public void onClick(View view) {
if (view == saveBtn)
{
String name = nameET.getText().toString();
String date = dateET.getText().toString();
String startTime = startTimeET.getText().toString();
String endTime = endTimeET.getText().toString();
//
// helper = new BlockSessionDBHelper(getActivity());
// helper.updateBlockSession()
//helper.addBlockSession(new BlockSession(name, date, startTime, endTime, "N/A"));
getData();
this.dismiss();
}
else if (view == cancelBtn)
{
//buttons.cancel();
this.dismiss();
}
}
}
// @Override
// public Dialog onCreateDialog(Bundle savedInstanceState) {
//
// blockType = "Future";
//
// return new AlertDialog.Builder(getActivity())
// // Set Dialog Icon
// .setIcon(R.drawable.icon_1)
// // Set Dialog Title
// .setTitle("Create " + blockType + " Block Session")
// // Set Dialog Message
// .setMessage("Please fill out all fields below")
//
// // Positive button
// .setPositiveButton("OK", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// // Do something else
// }
// })
//
// // Negative Button
// .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// // Do something else
// }
// }).create();
//
//
// } | 10,356 | 0.604577 | 0.602935 | 293 | 34.348122 | 28.878023 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.638225 | false | false | 7 |
a2f9fb1902329796a792564d32027be15bbd1a6f | 833,223,686,561 | 68687273d62e813b90a48ecfea708d6db2d2f34b | /src/main/java/com/demo/entities/Product.java | 14adb41170348b895b4b932473808b3d395d37ef | [] | no_license | BlackWolf2303/project4 | https://github.com/BlackWolf2303/project4 | 07f11ba9edc0857f117ce296ca53f20fa4c8947a | 96c2c7e51559737542c22891f99c2ddf58a362ad | refs/heads/master | 2020-05-25T05:48:34.356000 | 2019-08-05T13:30:38 | 2019-08-05T13:30:38 | 187,654,720 | 0 | 0 | null | false | 2019-07-21T23:37:47 | 2019-05-20T14:18:31 | 2019-07-19T16:54:03 | 2019-07-21T23:37:46 | 36,165 | 0 | 0 | 0 | CSS | false | false | package com.demo.entities;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "product")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@NotNull
private String name;
@NotNull
private double price;
private int quantity;
@Column(name = "free_size")
private boolean freeSize;
private boolean status;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "product_color",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "colorid") })
private List<Color> colors;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "product_size",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "sizeid") })
private List<Size> sizes;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "category_product",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "categoryid") })
private List<Category> categories;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
private List<Image> images;
public Product() {
super();
// TODO Auto-generated constructor stub
}
public List<Image> getImages() {
return images;
}
public void setImages(List<Image> images) {
this.images = images;
}
public List<Color> getColors() {
return colors;
}
public void setColors(List<Color> colors) {
this.colors = colors;
}
public boolean isFreeSize() {
return freeSize;
}
public void setFreeSize(boolean freeSize) {
this.freeSize = freeSize;
}
public List<Size> getSizes() {
return sizes;
}
public void setSizes(List<Size> sizes) {
this.sizes = sizes;
}
public List<Category> getCategories() {
return categories;
}
public void setCategories(List<Category> categories) {
this.categories = categories;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
} | UTF-8 | Java | 2,817 | java | Product.java | Java | [] | null | [] | package com.demo.entities;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "product")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@NotNull
private String name;
@NotNull
private double price;
private int quantity;
@Column(name = "free_size")
private boolean freeSize;
private boolean status;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "product_color",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "colorid") })
private List<Color> colors;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "product_size",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "sizeid") })
private List<Size> sizes;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "category_product",
joinColumns = { @JoinColumn(name = "productid") },
inverseJoinColumns = { @JoinColumn(name = "categoryid") })
private List<Category> categories;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
private List<Image> images;
public Product() {
super();
// TODO Auto-generated constructor stub
}
public List<Image> getImages() {
return images;
}
public void setImages(List<Image> images) {
this.images = images;
}
public List<Color> getColors() {
return colors;
}
public void setColors(List<Color> colors) {
this.colors = colors;
}
public boolean isFreeSize() {
return freeSize;
}
public void setFreeSize(boolean freeSize) {
this.freeSize = freeSize;
}
public List<Size> getSizes() {
return sizes;
}
public void setSizes(List<Size> sizes) {
this.sizes = sizes;
}
public List<Category> getCategories() {
return categories;
}
public void setCategories(List<Category> categories) {
this.categories = categories;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
} | 2,817 | 0.651047 | 0.651047 | 132 | 20.348484 | 20.254063 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.931818 | false | false | 7 |
dc5a3ea18892d95a5f49a0418003fcf59247e1e5 | 5,720,896,443,205 | 07c2ca14dbff576f3adf2c7573a2a8629242c669 | /src/test/java/DelfiTest.java | 13282fce3ca6739591de9d93e8197f5c4c304511 | [] | no_license | dmitrijsbraslis/qa2SpringLv | https://github.com/dmitrijsbraslis/qa2SpringLv | 6d2e38e967ee4e81455f4a465221bdd0213eb4a1 | 3ac9176b5fa57d8199fba65f41deedb33fcd5d95 | refs/heads/master | 2020-04-25T12:24:24.708000 | 2019-04-03T17:56:35 | 2019-04-03T17:56:35 | 172,776,369 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class DelfiTest {
private String titleToCompare = "KHL spēle: Rīgas 'Dinamo' - 'Severstaļ'. Teksta tiešraide ";
private final By TITLE = By.xpath(".//h1[contains(@class, 'headline__title')]");
@Test
public void newDelfiTest() {
System.setProperty("webdriver.gecko.driver", "c:/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://delfi.lv");
WebElement firstTitle = driver.findElement(TITLE);
String titleText = firstTitle.getText();
Assertions.assertEquals(titleToCompare, titleText, "Titles are not equal!");
}
}
| UTF-8 | Java | 903 | java | DelfiTest.java | Java | [] | null | [] | import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class DelfiTest {
private String titleToCompare = "KHL spēle: Rīgas 'Dinamo' - 'Severstaļ'. Teksta tiešraide ";
private final By TITLE = By.xpath(".//h1[contains(@class, 'headline__title')]");
@Test
public void newDelfiTest() {
System.setProperty("webdriver.gecko.driver", "c:/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://delfi.lv");
WebElement firstTitle = driver.findElement(TITLE);
String titleText = firstTitle.getText();
Assertions.assertEquals(titleToCompare, titleText, "Titles are not equal!");
}
}
| 903 | 0.700779 | 0.699666 | 24 | 36.458332 | 28.338694 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.791667 | false | false | 7 |
494fbc47fefccb39960e4a4f5ddb8b8f9470ca8d | 5,720,896,440,382 | 420a4529b4c53b07fe98bb1ed109fc8f8995a694 | /microservice-utils/src/main/java/com/melink/microservice/json/JsonSerializer.java | 77f118743aff26f6083bfc96b3599f8931f14e05 | [
"MIT"
] | permissive | callmejacksong/microservice_java_fenci | https://github.com/callmejacksong/microservice_java_fenci | dea1023da138c1ea260f9ea4e0884591a03181ca | 09679966d562f07aa4853f0d86af57ff156836da | refs/heads/master | 2022-11-22T02:32:28.840000 | 2019-08-07T09:08:46 | 2019-08-07T09:08:46 | 195,196,749 | 0 | 0 | MIT | false | 2022-11-16T10:33:44 | 2019-07-04T08:03:18 | 2019-08-07T09:09:01 | 2022-11-16T10:33:40 | 895 | 0 | 0 | 6 | Java | false | false | package com.melink.microservice.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.melink.microservice.exception.PlatformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
public class JsonSerializer {
private static Logger logger = LoggerFactory.getLogger(JsonSerializer.class);
private static final ObjectMapper objectMapper;
static {
objectMapper = new ObjectMapper();
//去掉默认的时间戳格式
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
//设置为中国上海时区
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
objectMapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
//空值不序列化
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//反序列化时,属性不存在的兼容处理
objectMapper.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
//序列化时,日期的统一格式
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//单引号处理
objectMapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
}
private JsonSerializer() {
}
public ObjectMapper getMapper() {
return objectMapper;
}
public static JsonSerializer newInstance() {
JsonSerializer js = new JsonSerializer();
return js;
}
public static enum Feature {
WRAP_ROOT_NODE
}
public static <T> T toObject(String json, Class<T> clazz) {
try {
return objectMapper.readValue(json, clazz);
} catch (JsonParseException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
public static <T> String toJson(T entity) {
try {
return objectMapper.writeValueAsString(entity);
} catch (JsonGenerationException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
public static <T> T toCollection(String json, TypeReference<T> typeReference) {
try {
return objectMapper.readValue(json, typeReference);
} catch (JsonParseException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
/**
* json string convert to map
*/
public static <T> Map<String, Object> json2map(String jsonStr)
throws Exception {
return objectMapper.readValue(jsonStr, Map.class);
}
/**
* json string convert to map with javaBean
*/
// public static <T> Map<String, T> fromJson(String jsonStr, Class<T> clazz){
// Map<String, Map<String, Object>> map = null;
// try {
// map = objectMapper.readValue(jsonStr,
// new TypeReference<Map<String, T>>() {
// });
// } catch (IOException e) {
// e.printStackTrace();
// }
// Map<String, T> result = new HashMap<String, T>();
// for (Map.Entry<String, Map<String, Object>> entry : map.entrySet()) {
// result.put(entry.getKey(), map2pojo(entry.getValue(), clazz));
// }
// return result;
// }
public <T> T fromJson(String toUnMarshall, Class<T> clazz) {
try {
return objectMapper.readValue(toUnMarshall, clazz);
} catch (JsonParseException e1) {
logger.error("An error occurred parsing the json received.", e1);
logger.error("json {}", toUnMarshall);
throw PlatformException.asRuntimeException(e1);
} catch (JsonMappingException e1) {
logger.error("An error occurred mapping the json received.", e1);
logger.error("json {}", toUnMarshall);
throw PlatformException.asRuntimeException(e1);
} catch (IOException e1) {
throw PlatformException.asRuntimeException(e1);
}
}
public <T> T fromJson(String toUnMarshall, JavaType type) {
try {
return objectMapper.readValue(toUnMarshall, type);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* json array string convert to list with javaBean
*/
public static <T> List<T> json2list(String jsonArrayStr, Class<T> clazz) {
List<Map<String, Object>> list = null;
try {
list = objectMapper.readValue(jsonArrayStr,
new TypeReference<List<T>>() {
});
} catch (IOException e) {
e.printStackTrace();
}
List<T> result = new ArrayList<T>();
for (Map<String, Object> map : list) {
result.add(map2pojo(map, clazz));
}
return result;
}
/**
* map convert to javaBean
*/
public static <T> T map2pojo(Map map, Class<T> clazz) {
return objectMapper.convertValue(map, clazz);
}
}
| UTF-8 | Java | 5,304 | java | JsonSerializer.java | Java | [] | null | [] | package com.melink.microservice.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.melink.microservice.exception.PlatformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
public class JsonSerializer {
private static Logger logger = LoggerFactory.getLogger(JsonSerializer.class);
private static final ObjectMapper objectMapper;
static {
objectMapper = new ObjectMapper();
//去掉默认的时间戳格式
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
//设置为中国上海时区
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
objectMapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
//空值不序列化
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//反序列化时,属性不存在的兼容处理
objectMapper.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
//序列化时,日期的统一格式
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//单引号处理
objectMapper.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
}
private JsonSerializer() {
}
public ObjectMapper getMapper() {
return objectMapper;
}
public static JsonSerializer newInstance() {
JsonSerializer js = new JsonSerializer();
return js;
}
public static enum Feature {
WRAP_ROOT_NODE
}
public static <T> T toObject(String json, Class<T> clazz) {
try {
return objectMapper.readValue(json, clazz);
} catch (JsonParseException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
public static <T> String toJson(T entity) {
try {
return objectMapper.writeValueAsString(entity);
} catch (JsonGenerationException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
public static <T> T toCollection(String json, TypeReference<T> typeReference) {
try {
return objectMapper.readValue(json, typeReference);
} catch (JsonParseException e) {
logger.error(e.getMessage(), e);
} catch (JsonMappingException e) {
logger.error(e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return null;
}
/**
* json string convert to map
*/
public static <T> Map<String, Object> json2map(String jsonStr)
throws Exception {
return objectMapper.readValue(jsonStr, Map.class);
}
/**
* json string convert to map with javaBean
*/
// public static <T> Map<String, T> fromJson(String jsonStr, Class<T> clazz){
// Map<String, Map<String, Object>> map = null;
// try {
// map = objectMapper.readValue(jsonStr,
// new TypeReference<Map<String, T>>() {
// });
// } catch (IOException e) {
// e.printStackTrace();
// }
// Map<String, T> result = new HashMap<String, T>();
// for (Map.Entry<String, Map<String, Object>> entry : map.entrySet()) {
// result.put(entry.getKey(), map2pojo(entry.getValue(), clazz));
// }
// return result;
// }
public <T> T fromJson(String toUnMarshall, Class<T> clazz) {
try {
return objectMapper.readValue(toUnMarshall, clazz);
} catch (JsonParseException e1) {
logger.error("An error occurred parsing the json received.", e1);
logger.error("json {}", toUnMarshall);
throw PlatformException.asRuntimeException(e1);
} catch (JsonMappingException e1) {
logger.error("An error occurred mapping the json received.", e1);
logger.error("json {}", toUnMarshall);
throw PlatformException.asRuntimeException(e1);
} catch (IOException e1) {
throw PlatformException.asRuntimeException(e1);
}
}
public <T> T fromJson(String toUnMarshall, JavaType type) {
try {
return objectMapper.readValue(toUnMarshall, type);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* json array string convert to list with javaBean
*/
public static <T> List<T> json2list(String jsonArrayStr, Class<T> clazz) {
List<Map<String, Object>> list = null;
try {
list = objectMapper.readValue(jsonArrayStr,
new TypeReference<List<T>>() {
});
} catch (IOException e) {
e.printStackTrace();
}
List<T> result = new ArrayList<T>();
for (Map<String, Object> map : list) {
result.add(map2pojo(map, clazz));
}
return result;
}
/**
* map convert to javaBean
*/
public static <T> T map2pojo(Map map, Class<T> clazz) {
return objectMapper.convertValue(map, clazz);
}
}
| 5,304 | 0.707016 | 0.703932 | 178 | 28.146067 | 24.529987 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.11236 | false | false | 7 |
042df111dd9f8e80b1d728c85bafcf8cfda4aeaa | 27,144,193,358,519 | 3bf778d4e6b840e3563df99e9052d02c4cdc7aea | /Phase2/GameCentre/app/src/test/java/fall2018/csc2017/GameCentre/MineSweeper/SweeperTilesBoardTest.java | e428b8081f98b8110833fd1b01cbf481d7ad5771 | [] | no_license | SoniaZaldana/GameCentre | https://github.com/SoniaZaldana/GameCentre | c57821ce44a4cd375e30af95523e63529da6c919 | 062454318425fd009014ac5ca61e77656ad3bff4 | refs/heads/master | 2020-04-10T11:17:47.429000 | 2019-07-22T13:48:02 | 2019-07-22T13:48:02 | 160,989,098 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package fall2018.csc2017.GameCentre.MineSweeper;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
public class SweeperTilesBoardTest {
private List<SweeperTile> sweeperTileList;
private SweeperTilesBoard sweeperTilesBoard;
@Before
public void setUp(){
createValidTileList();
}
@Test
public void getTime() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
assertEquals(0, sweeperTilesBoard.getTime());
}
/**
* Creates a valid list of sweeper tiles where half the tiles have a bomb and have do not
*/
private void createValidTileList() {
sweeperTileList = new ArrayList<>();
SweeperTile tile1 = new SweeperTile(true);
SweeperTile tile2 = new SweeperTile(true);
SweeperTile tile3 = new SweeperTile(false);
SweeperTile tile4 = new SweeperTile(false);
sweeperTileList.add(tile1);
sweeperTileList.add(tile2);
sweeperTileList.add(tile3);
sweeperTileList.add(tile4);
}
@Test
public void timeIncrement() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.timeIncrement();
assertEquals(1, sweeperTilesBoard.getTime());
}
@Test
public void takeDamage() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.takeDamage();
assertEquals(2, sweeperTilesBoard.getHitPoints());
}
@Test
public void getHitPoints() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
assertEquals(3, sweeperTilesBoard.getHitPoints());
}
@Test
public void getBombTime(){
sweeperTilesBoard = new SweeperTilesBoard(5, 15);
assertEquals(10,sweeperTilesBoard.getBombTime());
}
@Test
public void setBombToExploded(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setBombToExploded(0,0);
assertTrue(sweeperTilesBoard.getTile(0,0).isBombExploded());
}
@Test
public void setTileToFlagged(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setTileToFlagged(0,0, true);
assertTrue(sweeperTilesBoard.getTile(0,0).isFlagged());
}
@Test
public void setBombsAround(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setBombsAround(0,0,5);
assertEquals(5, sweeperTilesBoard.getTile(0,0).getBombsAround());
}
@Test
public void lowerBombTime(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.lowerBombTime();
assertEquals(9, sweeperTilesBoard.getBombTime());
}
@Test
public void swapTiles(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.swapTiles(0,0, 1,1);
assertTrue(sweeperTileList.get(0) == sweeperTilesBoard.getTile(1,1));
assertTrue(sweeperTileList.get(3) == sweeperTilesBoard.getTile(0,0));
}
@Test
public void swapWithSafeTile(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.swapWithSafeTile(0,0);
assertTrue(sweeperTileList.get(0) == sweeperTilesBoard.getTile(1,0));
assertTrue(sweeperTileList.get(2) == sweeperTilesBoard.getTile(0,0));
}
@Test
public void findFirstSafeTile(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
ArrayList testArray = sweeperTilesBoard.findFirstSafeTile();
assertTrue((int) testArray.get(0) == 1);
assertTrue((int) testArray.get(1) == 0);
sweeperTileList.get(2).setBomb(true);
sweeperTileList.get(3).setBomb(true);
testArray = sweeperTilesBoard.findFirstSafeTile();
assertTrue(testArray.isEmpty());
}
} | UTF-8 | Java | 3,990 | java | SweeperTilesBoardTest.java | Java | [] | null | [] | package fall2018.csc2017.GameCentre.MineSweeper;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
public class SweeperTilesBoardTest {
private List<SweeperTile> sweeperTileList;
private SweeperTilesBoard sweeperTilesBoard;
@Before
public void setUp(){
createValidTileList();
}
@Test
public void getTime() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
assertEquals(0, sweeperTilesBoard.getTime());
}
/**
* Creates a valid list of sweeper tiles where half the tiles have a bomb and have do not
*/
private void createValidTileList() {
sweeperTileList = new ArrayList<>();
SweeperTile tile1 = new SweeperTile(true);
SweeperTile tile2 = new SweeperTile(true);
SweeperTile tile3 = new SweeperTile(false);
SweeperTile tile4 = new SweeperTile(false);
sweeperTileList.add(tile1);
sweeperTileList.add(tile2);
sweeperTileList.add(tile3);
sweeperTileList.add(tile4);
}
@Test
public void timeIncrement() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.timeIncrement();
assertEquals(1, sweeperTilesBoard.getTime());
}
@Test
public void takeDamage() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.takeDamage();
assertEquals(2, sweeperTilesBoard.getHitPoints());
}
@Test
public void getHitPoints() {
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
assertEquals(3, sweeperTilesBoard.getHitPoints());
}
@Test
public void getBombTime(){
sweeperTilesBoard = new SweeperTilesBoard(5, 15);
assertEquals(10,sweeperTilesBoard.getBombTime());
}
@Test
public void setBombToExploded(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setBombToExploded(0,0);
assertTrue(sweeperTilesBoard.getTile(0,0).isBombExploded());
}
@Test
public void setTileToFlagged(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setTileToFlagged(0,0, true);
assertTrue(sweeperTilesBoard.getTile(0,0).isFlagged());
}
@Test
public void setBombsAround(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.setBombsAround(0,0,5);
assertEquals(5, sweeperTilesBoard.getTile(0,0).getBombsAround());
}
@Test
public void lowerBombTime(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.lowerBombTime();
assertEquals(9, sweeperTilesBoard.getBombTime());
}
@Test
public void swapTiles(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.swapTiles(0,0, 1,1);
assertTrue(sweeperTileList.get(0) == sweeperTilesBoard.getTile(1,1));
assertTrue(sweeperTileList.get(3) == sweeperTilesBoard.getTile(0,0));
}
@Test
public void swapWithSafeTile(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
sweeperTilesBoard.swapWithSafeTile(0,0);
assertTrue(sweeperTileList.get(0) == sweeperTilesBoard.getTile(1,0));
assertTrue(sweeperTileList.get(2) == sweeperTilesBoard.getTile(0,0));
}
@Test
public void findFirstSafeTile(){
sweeperTilesBoard = new SweeperTilesBoard(2, sweeperTileList);
ArrayList testArray = sweeperTilesBoard.findFirstSafeTile();
assertTrue((int) testArray.get(0) == 1);
assertTrue((int) testArray.get(1) == 0);
sweeperTileList.get(2).setBomb(true);
sweeperTileList.get(3).setBomb(true);
testArray = sweeperTilesBoard.findFirstSafeTile();
assertTrue(testArray.isEmpty());
}
} | 3,990 | 0.677945 | 0.659148 | 126 | 30.674603 | 25.923828 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.738095 | false | false | 7 |
533e92ddd7e1ec0dfbb34398b06272f7c27e894d | 5,377,299,113,144 | 1158b24b2730b549512fe3d300796f6b7e56b992 | /src/main/java/mygroup/DeleteNodeinaLinkedList237.java | 216e60c4c336d00f31208aae584759c5bfe552d7 | [] | no_license | lnsdlszsqxxx/javabasic | https://github.com/lnsdlszsqxxx/javabasic | a287ef9e77f4bb918ad6d6d575becb799fd660aa | d2b54adbb434d3d2241724690932cf8fbf838949 | refs/heads/master | 2021-07-08T23:55:48.246000 | 2019-12-04T00:42:22 | 2019-12-04T00:42:22 | 201,381,124 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mygroup;
public class DeleteNodeinaLinkedList237 {
public static void main(String[] args) {
LinkedListNode head = new LinkedListNode();
LinkedListNode node1 = new LinkedListNode();
LinkedListNode node2 = new LinkedListNode();
LinkedListNode node3 = new LinkedListNode();
LinkedListNode node4 = new LinkedListNode();
LinkedListNode node5 = new LinkedListNode();
head.setValue(0);
head.setNext(node1);
node1.setValue(1);
node1.setNext(node2);
node2.setValue(2);
node2.setNext(node3);
node3.setValue(3);
node3.setNext(node4);
node4.setValue(4);
node4.setNext(node5);
node5.setValue(5);
node5.setNext(null);
printLinkedList(head);
deleteNode(node3);
printLinkedList(head);
//for practice purpose
// LinkedListNode result = reverse(head);
// printLinkedList(result);
}
public static void deleteNode(LinkedListNode node) {
node.value=node.next.value;
node.next =node.next.next;
}
public static void printLinkedList(LinkedListNode head){
while(head.next!=null){
System.out.println(head.value);
head = head.next;
}
System.out.println(head.value);
}
public static LinkedListNode reverse(LinkedListNode head){
if(head==null || head.next==null) return head;
LinkedListNode currentNode=head;
LinkedListNode nextNode=currentNode.next;
LinkedListNode tempNode=new LinkedListNode();
while (nextNode != null) {
copyNode(tempNode,nextNode);
nextNode.next=currentNode;
currentNode=nextNode;
nextNode=tempNode.next;
}
head.next=null;
return currentNode;
}
public static void copyNode(LinkedListNode to, LinkedListNode from){
to.value=from.value;
to.next=from.next;
}
}
| UTF-8 | Java | 1,996 | java | DeleteNodeinaLinkedList237.java | Java | [] | null | [] | package mygroup;
public class DeleteNodeinaLinkedList237 {
public static void main(String[] args) {
LinkedListNode head = new LinkedListNode();
LinkedListNode node1 = new LinkedListNode();
LinkedListNode node2 = new LinkedListNode();
LinkedListNode node3 = new LinkedListNode();
LinkedListNode node4 = new LinkedListNode();
LinkedListNode node5 = new LinkedListNode();
head.setValue(0);
head.setNext(node1);
node1.setValue(1);
node1.setNext(node2);
node2.setValue(2);
node2.setNext(node3);
node3.setValue(3);
node3.setNext(node4);
node4.setValue(4);
node4.setNext(node5);
node5.setValue(5);
node5.setNext(null);
printLinkedList(head);
deleteNode(node3);
printLinkedList(head);
//for practice purpose
// LinkedListNode result = reverse(head);
// printLinkedList(result);
}
public static void deleteNode(LinkedListNode node) {
node.value=node.next.value;
node.next =node.next.next;
}
public static void printLinkedList(LinkedListNode head){
while(head.next!=null){
System.out.println(head.value);
head = head.next;
}
System.out.println(head.value);
}
public static LinkedListNode reverse(LinkedListNode head){
if(head==null || head.next==null) return head;
LinkedListNode currentNode=head;
LinkedListNode nextNode=currentNode.next;
LinkedListNode tempNode=new LinkedListNode();
while (nextNode != null) {
copyNode(tempNode,nextNode);
nextNode.next=currentNode;
currentNode=nextNode;
nextNode=tempNode.next;
}
head.next=null;
return currentNode;
}
public static void copyNode(LinkedListNode to, LinkedListNode from){
to.value=from.value;
to.next=from.next;
}
}
| 1,996 | 0.613226 | 0.598196 | 73 | 26.342466 | 19.506388 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.616438 | false | false | 7 |
138a99d4ce5e7b0895a48238d6b6859c2a4efe5d | 32,152,125,242,016 | b1d964c80f75ee216dd726818644976348695059 | /EPS/Source/Common/EpsDal/com/pdxinc/eps/util/EpsUtil.java | 7693976770d1ee4a93be326833d705e023991b03 | [] | no_license | ajithkattil/pdx | https://github.com/ajithkattil/pdx | 35b22a408116e1a948fda932c98c7e7f43fe0f9c | ee5bbbeaeb00c800400908b834a1152653849aab | refs/heads/master | 2018-10-05T08:01:50.484000 | 2018-06-08T21:17:47 | 2018-06-08T21:17:47 | 136,537,540 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | // Copyright (c) 2009-2015 PDX Inc. All Rights Reserved
// This software contains trade secrets and proprietary information of National Health Systems, Inc.,
// and its subsidiaries and affiliates, and use of this software is governed by the terms and conditions
// of the respective licenses, service agreements, and other applicable agreements. All other uses of
// this software are expressly prohibited.
package com.pdxinc.eps.util;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.comm.CommPortIdentifier;
import org.apache.log4j.Logger;
import com.pdxinc.dig.enums.AbstractIntEnum;
import com.pdxinc.dig.enums.AbstractStringEnum;
import com.pdxinc.dig.exception.EpsException;
import com.pdxinc.dig.util.EmptyTester;
import com.pdxinc.eps.config.ClientConfigFactory;
import com.pdxinc.eps.config.ClientConfigKey;
import com.pdxinc.eps.config.ClientConfiguration;
import com.pdxinc.eps.config.ConfigurationException;
import com.pdxinc.eps.config.ServerConfigFactory;
import com.pdxinc.eps.config.ServerConfigKey;
import com.pdxinc.eps.configuration.vo.TerminalIDVO;
import com.pdxinc.eps.signaturecapture.vo.COMPortVO;
import com.pdxinc.eps.signaturecapture.vo.SignatureCaptureDeviceVO;
public class EpsUtil {
private static final Logger logger = Logger.getLogger(EpsUtil.class);
private static final Double D_MIN_VALUE_THRESHOLD = Double.valueOf(0.0000001d);
private static final Double D_ZERO = Double.valueOf(0.0d);
private static final Double D_NEGATIVE_ZERO = Double.valueOf(-0.0d);
private static final Float F_MIN_VALUE_THRESHOLD = Float.valueOf(0.0000001f);
private static final Float F_ZERO = Float.valueOf(0.0f);
private static final Float F_NEGATIVE_ZERO = Float.valueOf(-0.0f);
/**
* If a non-null Double value is less than our predetermined threshold, convert the Double value
* to zero. This is used when receiving Double values into our EPS system, which would cause
* an underflow exception when the less-than-threshold Double would be attempted to be stored
* in a database cell.
* @param toCheck - Double to check, null is allowed.
* @return toCheck or its replacement Double of 0.0d.
*/
public static Double parseDoubleForUnderflow(Double toCheck) {
if (toCheck == null || toCheck == D_ZERO || toCheck == D_NEGATIVE_ZERO || toCheck > D_MIN_VALUE_THRESHOLD) {
return toCheck;
}
else {
return Double.valueOf(D_ZERO);
}
}
/**
* Overload of parseDoubleForUnderflow(Double), but for Float.
* @param toCheck
* @return
*/
public static Float parseFloatForUnderflow(Float toCheck) {
if (toCheck == null || toCheck == F_ZERO || toCheck == F_NEGATIVE_ZERO || toCheck > F_MIN_VALUE_THRESHOLD) {
return toCheck;
}
else {
return Float.valueOf(F_ZERO);
}
}
public static String[] splitStringByIntervals(String str, int[] intervals) {
String[] result = new String[0];
if (EmptyTester.isEmpty(str) || (intervals == null) || (intervals.length == 0)) {
result = new String[0];
return (result);
}
String line = str;
int startIndex = 0;
ArrayList items = new ArrayList();
for (int length : intervals) {
if (length <= 0) {
continue;
}
int endIndex = startIndex + length;
if (line.length() >= endIndex) {
String value = line.substring(startIndex, endIndex);
items.add(value.trim());
startIndex = endIndex;
}
else {
break;
}
}
if (items.size() > 0) {
result = new String[items.size()];
result = (String[])items.toArray(result);
}
return (result);
}
public static String wrap(String s, int width) {
StringBuilder sb = new StringBuilder();
int lineStart = 0;
int lineEnd = width;
boolean done = false;
do {
if (lineStart > 0) { // Skip new line for first line.
sb.append("\n");
}
if (s.length() > lineEnd) { // Check if line needs to wrap.
lineEnd = s.lastIndexOf(" ", lineEnd);
}
// Check for entire string with no spaces, current line with no spaces, or 1 remaining character.
if (lineEnd <= 0 || s.length() - lineEnd <= 1 || lineEnd <= lineStart) {
lineEnd = s.length();
done = true;
}
sb.append(s.substring(lineStart, lineEnd));
lineStart = lineEnd + 1;
while (!done && " ".equals(s.substring(lineStart, lineStart + 1))) {
lineStart++;
}
lineEnd = lineStart + width;
}
while (lineStart < s.length() && !done);
return sb.toString();
}
public static BigDecimal roundCurrency(Double amount) {
return roundHalfUp(amount, 2);
}
public static BigDecimal roundHalfUp(Double amount, int scale) {
if (amount == null) {
amount = 0d;
}
return new BigDecimal(amount).setScale(scale, BigDecimal.ROUND_HALF_UP);
}
public static SignatureCaptureDeviceVO[] getSigCapDevies() {
SignatureCaptureDeviceVO[] deviceNameList = new SignatureCaptureDeviceVO[0];
List<ClientConfiguration> deviceList;
try {
deviceList = ClientConfigFactory.getConfigurationList(ClientConfigKey.SIGCAP_DEVICES);
if (deviceList != null) {
int i = 0;
deviceNameList = new SignatureCaptureDeviceVO[deviceList.size()];
for (ClientConfiguration clientConfiguration : deviceList) {
String vendorName = clientConfiguration.getStringProperty(ClientConfigKey.SIGCAP_DEVICE_NAME);
deviceNameList[i++] = new SignatureCaptureDeviceVO(vendorName);
}
}
}
catch (ConfigurationException e) {
logger.error("Problem retrieving signature capture devices", e);
}
return deviceNameList;
}
public static TerminalIDVO[] getTerminalID() {
String terminalIDString = ClientConfigFactory.getStringProperty(ServerConfigKey.SIGCAP_TERMINAL_ID);
List<TerminalIDVO> terminalIDList = new ArrayList<TerminalIDVO>();
if (terminalIDString != null) {
while (terminalIDString.length() != 0) {
int changelength = terminalIDString.length();
int index = terminalIDString.indexOf(",");
String newTerminalID;
if (index == -1) {
newTerminalID = terminalIDString;
TerminalIDVO terminalIDVO = new TerminalIDVO();
terminalIDVO.setTerminalID(newTerminalID);
terminalIDList.add(terminalIDVO);
break;
}
else {
newTerminalID = terminalIDString.substring(0, index);
}
TerminalIDVO terminalIDVO = new TerminalIDVO();
terminalIDVO.setTerminalID(newTerminalID);
terminalIDList.add(terminalIDVO);
if (index != 0) {
terminalIDString = terminalIDString.substring(index + 1, changelength);
}
}
}
TerminalIDVO[] terminalIDArray = new TerminalIDVO[terminalIDList.size()];
for (int i = 0; i < terminalIDList.size(); i++) {
terminalIDArray[i] = terminalIDList.get(i);
}
return terminalIDArray;
}
public static COMPortVO[] getComPortList() {
List<String> portList = new ArrayList<String>();
try {
Enumeration portListEnum = CommPortIdentifier.getPortIdentifiers();
while (portListEnum.hasMoreElements()) {
CommPortIdentifier portId = (CommPortIdentifier)portListEnum.nextElement();
portList.add(portId.getName());
}
}
catch (Exception e) {
logger.error("", e);
}
COMPortVO portArray[] = new COMPortVO[portList.size()];
for (int i = 0; i < portList.size(); i++) {
portArray[i] = new COMPortVO(new Long(i), portList.get(i));
}
return portArray;
}
public static Map<String, Object> getConfigsForDispenseAppl() throws EpsException {
Map<String, Object> map = new HashMap<String, Object>();
try {
String s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_DEFAULT_MAIL_ORDER_DOC);
map.put("mail-order-default-document", s);
//fill station label stuff
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_MAIL_LABELCODE);
map.put("labels/mail/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_MANUAL_LABELCODE);
map.put("labels/manual/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_ROBOTIC_LABELCODE);
map.put("labels/robotic/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_ACSVIAL_LABEL);
map.put("labels/acsvial/labelcode", s); //bug 154177
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_CF_LABELCODE);
map.put("labels/store-delivery/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PROD_VERIFICATION_MAIL_LABEL);
map.put("labels/pv_mail/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.RF_NONFILLABLE_LABEL);
map.put("labels/rapidfill/nonfillable", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.RF_NONFILLABLE_ACS_LABEL);
map.put("labels/rapidfill/ACSlabel", s); //bug 41859
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PRINTING_CFG_LABEL_PRINTERNAME);
map.put("pv/printer/name", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PRINTING_CFG_LABEL_SOURCE);
map.put("pv/tray/name", s);
Boolean b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_DRUGEXPREQUIRED);
map.put("drug-expiration-required", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_LOTREQUIRED);
map.put("lot-required", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_COMPOUND_VERIFICATION);
map.put("compound-verification", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.PROD_VERIFICATION_PRINT);
b = ServerConfigFactory.getBoolean(ServerConfigKey.PROD_VERIFICATION_PRINT);
map.put("pv/print-enabled", b);
}
catch (Exception e) {
logger.error("Error getting Config for Dispense Application", e);
throw new EpsException(e);
}
return (map);
}
public static boolean luhnCheckForNPI(String npi) {
int digits = npi.length();
if (digits != 10 && digits != 15) {
return false;
}
int oddOrEven = digits & 1;
long sum = 0L;
for (int count = 0; count < digits; count++) {
int digit;
try {
digit = Integer.parseInt(npi.charAt(count) + "");
}
catch (NumberFormatException e) {
return false;
}
if ((count & 1 ^ oddOrEven) == 0) {
digit *= 2;
if (digit > 9) {
digit -= 9;
}
}
sum += digit;
}
if (digits == 10) {
sum += 24; //NPI without prefix 80840
}
return sum != 0L && sum % 10L == 0L;
}
/**
* Converts a null String to an empty String and trims it.
*/
public static String nullToEmptyAndTrim(String s) {
return s == null ? "" : s.trim();
}
//Issue#59442- Converts a Object to a String and null to an empty String.
public static String nullToEmpty(Object number) {
return number == null ? "" : number.toString();
}
// Strips leading / if it exists.
public static String[] removeRootDirs(String[] unprocessed) {
String[] processed = new String[unprocessed.length];
for (int i = 0; i < unprocessed.length; i++) {
if (unprocessed[i].startsWith("/", 0)) {
processed[i] = unprocessed[i].substring(1);
}
else {
processed[i] = unprocessed[i];
}
}
return processed;
}
//48842
public static boolean isLetterOrDigit(String s) {
for (int i = 0; i < s.length(); i++) {
if (!Character.isLetterOrDigit(s.charAt(i)))
return false;
}
return true;
}
/**
* Checks if an array of objects contains a search object, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T> boolean isPresent(T value, T... checkList) {
boolean checkCond = false;
if (checkList != null && value != null) {
if (Arrays.asList(checkList).contains(value)) {
checkCond = true;
}
}
return checkCond;
}
/**
*
* Checks if an array of enums contains a search string, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T extends AbstractStringEnum> boolean isPresent(String value, T... checkList) {
if (!EmptyTester.isEmpty(checkList) && value != null) {
for (T stringEnum : checkList) {
if (stringEnum.getCode().equals(value)) {
return true;
}
}
}
return false;
}
/**
*
* Checks if an array of enums contains a search integer, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T extends AbstractIntEnum> boolean isPresent(Integer value, T... checkList) {
if (!EmptyTester.isEmpty(checkList) && value != null) {
for (T stringEnum : checkList) {
if (stringEnum.getCode() == value) {
return true;
}
}
}
return false;
}
/**
* compares two values by using equals method also handles if any of the values are null.
* @param <T>
* @param value1
* @param value2
* @return
*/
public static <T> boolean compare(T value1, T value2) {
if (value1 == null && value2 == null) {
return true;
}
else if (value1 == null) {
return false;
}
else if (value2 == null) {
return false;
}
else {
return value1.equals(value2);
}
}
/**
* Checks the given value is in the given the valueList or not
* by using the equals.
* @param value
* @param valueList
* @return true if the value exists in the list otherwise return false
*
* @author Mohan Rao
*/
public static <T> boolean isValueIn(T value,T... valueList){
for(T valueInList : valueList){
if(valueInList.equals(value)){
return true;
}
}
return false;
}
private static final Logger rowLockLogger = Logger.getLogger("RLCLogger");
/**
* 175059 - DE2572 - enq- row lock contention
* @deprecated
* @param oldValue
* @param newValue
*/
public static void printStackTraceIfNewValueIsEmpty(String columnName, String oldValue, String newValue) {
if (oldValue == null && newValue != null && newValue.trim().length() == 0) {
rowLockLogger.error("DE2572 columnName [" + columnName + "]; value [" + newValue + "]", new SanitizedException());
}
}
}
| UTF-8 | Java | 13,951 | java | EpsUtil.java | Java | [
{
"context": "in the list otherwise return false\n\t *\n\t * @author Mohan Rao\n\t */\n\tpublic static <T> boolean isValueIn(T value",
"end": 13266,
"score": 0.9998763799667358,
"start": 13257,
"tag": "NAME",
"value": "Mohan Rao"
}
] | null | [] | // Copyright (c) 2009-2015 PDX Inc. All Rights Reserved
// This software contains trade secrets and proprietary information of National Health Systems, Inc.,
// and its subsidiaries and affiliates, and use of this software is governed by the terms and conditions
// of the respective licenses, service agreements, and other applicable agreements. All other uses of
// this software are expressly prohibited.
package com.pdxinc.eps.util;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.comm.CommPortIdentifier;
import org.apache.log4j.Logger;
import com.pdxinc.dig.enums.AbstractIntEnum;
import com.pdxinc.dig.enums.AbstractStringEnum;
import com.pdxinc.dig.exception.EpsException;
import com.pdxinc.dig.util.EmptyTester;
import com.pdxinc.eps.config.ClientConfigFactory;
import com.pdxinc.eps.config.ClientConfigKey;
import com.pdxinc.eps.config.ClientConfiguration;
import com.pdxinc.eps.config.ConfigurationException;
import com.pdxinc.eps.config.ServerConfigFactory;
import com.pdxinc.eps.config.ServerConfigKey;
import com.pdxinc.eps.configuration.vo.TerminalIDVO;
import com.pdxinc.eps.signaturecapture.vo.COMPortVO;
import com.pdxinc.eps.signaturecapture.vo.SignatureCaptureDeviceVO;
public class EpsUtil {
private static final Logger logger = Logger.getLogger(EpsUtil.class);
private static final Double D_MIN_VALUE_THRESHOLD = Double.valueOf(0.0000001d);
private static final Double D_ZERO = Double.valueOf(0.0d);
private static final Double D_NEGATIVE_ZERO = Double.valueOf(-0.0d);
private static final Float F_MIN_VALUE_THRESHOLD = Float.valueOf(0.0000001f);
private static final Float F_ZERO = Float.valueOf(0.0f);
private static final Float F_NEGATIVE_ZERO = Float.valueOf(-0.0f);
/**
* If a non-null Double value is less than our predetermined threshold, convert the Double value
* to zero. This is used when receiving Double values into our EPS system, which would cause
* an underflow exception when the less-than-threshold Double would be attempted to be stored
* in a database cell.
* @param toCheck - Double to check, null is allowed.
* @return toCheck or its replacement Double of 0.0d.
*/
public static Double parseDoubleForUnderflow(Double toCheck) {
if (toCheck == null || toCheck == D_ZERO || toCheck == D_NEGATIVE_ZERO || toCheck > D_MIN_VALUE_THRESHOLD) {
return toCheck;
}
else {
return Double.valueOf(D_ZERO);
}
}
/**
* Overload of parseDoubleForUnderflow(Double), but for Float.
* @param toCheck
* @return
*/
public static Float parseFloatForUnderflow(Float toCheck) {
if (toCheck == null || toCheck == F_ZERO || toCheck == F_NEGATIVE_ZERO || toCheck > F_MIN_VALUE_THRESHOLD) {
return toCheck;
}
else {
return Float.valueOf(F_ZERO);
}
}
public static String[] splitStringByIntervals(String str, int[] intervals) {
String[] result = new String[0];
if (EmptyTester.isEmpty(str) || (intervals == null) || (intervals.length == 0)) {
result = new String[0];
return (result);
}
String line = str;
int startIndex = 0;
ArrayList items = new ArrayList();
for (int length : intervals) {
if (length <= 0) {
continue;
}
int endIndex = startIndex + length;
if (line.length() >= endIndex) {
String value = line.substring(startIndex, endIndex);
items.add(value.trim());
startIndex = endIndex;
}
else {
break;
}
}
if (items.size() > 0) {
result = new String[items.size()];
result = (String[])items.toArray(result);
}
return (result);
}
public static String wrap(String s, int width) {
StringBuilder sb = new StringBuilder();
int lineStart = 0;
int lineEnd = width;
boolean done = false;
do {
if (lineStart > 0) { // Skip new line for first line.
sb.append("\n");
}
if (s.length() > lineEnd) { // Check if line needs to wrap.
lineEnd = s.lastIndexOf(" ", lineEnd);
}
// Check for entire string with no spaces, current line with no spaces, or 1 remaining character.
if (lineEnd <= 0 || s.length() - lineEnd <= 1 || lineEnd <= lineStart) {
lineEnd = s.length();
done = true;
}
sb.append(s.substring(lineStart, lineEnd));
lineStart = lineEnd + 1;
while (!done && " ".equals(s.substring(lineStart, lineStart + 1))) {
lineStart++;
}
lineEnd = lineStart + width;
}
while (lineStart < s.length() && !done);
return sb.toString();
}
public static BigDecimal roundCurrency(Double amount) {
return roundHalfUp(amount, 2);
}
public static BigDecimal roundHalfUp(Double amount, int scale) {
if (amount == null) {
amount = 0d;
}
return new BigDecimal(amount).setScale(scale, BigDecimal.ROUND_HALF_UP);
}
public static SignatureCaptureDeviceVO[] getSigCapDevies() {
SignatureCaptureDeviceVO[] deviceNameList = new SignatureCaptureDeviceVO[0];
List<ClientConfiguration> deviceList;
try {
deviceList = ClientConfigFactory.getConfigurationList(ClientConfigKey.SIGCAP_DEVICES);
if (deviceList != null) {
int i = 0;
deviceNameList = new SignatureCaptureDeviceVO[deviceList.size()];
for (ClientConfiguration clientConfiguration : deviceList) {
String vendorName = clientConfiguration.getStringProperty(ClientConfigKey.SIGCAP_DEVICE_NAME);
deviceNameList[i++] = new SignatureCaptureDeviceVO(vendorName);
}
}
}
catch (ConfigurationException e) {
logger.error("Problem retrieving signature capture devices", e);
}
return deviceNameList;
}
public static TerminalIDVO[] getTerminalID() {
String terminalIDString = ClientConfigFactory.getStringProperty(ServerConfigKey.SIGCAP_TERMINAL_ID);
List<TerminalIDVO> terminalIDList = new ArrayList<TerminalIDVO>();
if (terminalIDString != null) {
while (terminalIDString.length() != 0) {
int changelength = terminalIDString.length();
int index = terminalIDString.indexOf(",");
String newTerminalID;
if (index == -1) {
newTerminalID = terminalIDString;
TerminalIDVO terminalIDVO = new TerminalIDVO();
terminalIDVO.setTerminalID(newTerminalID);
terminalIDList.add(terminalIDVO);
break;
}
else {
newTerminalID = terminalIDString.substring(0, index);
}
TerminalIDVO terminalIDVO = new TerminalIDVO();
terminalIDVO.setTerminalID(newTerminalID);
terminalIDList.add(terminalIDVO);
if (index != 0) {
terminalIDString = terminalIDString.substring(index + 1, changelength);
}
}
}
TerminalIDVO[] terminalIDArray = new TerminalIDVO[terminalIDList.size()];
for (int i = 0; i < terminalIDList.size(); i++) {
terminalIDArray[i] = terminalIDList.get(i);
}
return terminalIDArray;
}
public static COMPortVO[] getComPortList() {
List<String> portList = new ArrayList<String>();
try {
Enumeration portListEnum = CommPortIdentifier.getPortIdentifiers();
while (portListEnum.hasMoreElements()) {
CommPortIdentifier portId = (CommPortIdentifier)portListEnum.nextElement();
portList.add(portId.getName());
}
}
catch (Exception e) {
logger.error("", e);
}
COMPortVO portArray[] = new COMPortVO[portList.size()];
for (int i = 0; i < portList.size(); i++) {
portArray[i] = new COMPortVO(new Long(i), portList.get(i));
}
return portArray;
}
public static Map<String, Object> getConfigsForDispenseAppl() throws EpsException {
Map<String, Object> map = new HashMap<String, Object>();
try {
String s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_DEFAULT_MAIL_ORDER_DOC);
map.put("mail-order-default-document", s);
//fill station label stuff
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_MAIL_LABELCODE);
map.put("labels/mail/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_MANUAL_LABELCODE);
map.put("labels/manual/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_ROBOTIC_LABELCODE);
map.put("labels/robotic/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_ACSVIAL_LABEL);
map.put("labels/acsvial/labelcode", s); //bug 154177
s = ServerConfigFactory.getStringProperty(ServerConfigKey.FILLSTATION_LABELS_CF_LABELCODE);
map.put("labels/store-delivery/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PROD_VERIFICATION_MAIL_LABEL);
map.put("labels/pv_mail/labelcode", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.RF_NONFILLABLE_LABEL);
map.put("labels/rapidfill/nonfillable", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.RF_NONFILLABLE_ACS_LABEL);
map.put("labels/rapidfill/ACSlabel", s); //bug 41859
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PRINTING_CFG_LABEL_PRINTERNAME);
map.put("pv/printer/name", s);
s = ServerConfigFactory.getStringProperty(ServerConfigKey.PRINTING_CFG_LABEL_SOURCE);
map.put("pv/tray/name", s);
Boolean b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_DRUGEXPREQUIRED);
map.put("drug-expiration-required", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_LOTREQUIRED);
map.put("lot-required", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.FILLSTATION_COMPOUND_VERIFICATION);
map.put("compound-verification", b);
b = ServerConfigFactory.getBoolean(ServerConfigKey.PROD_VERIFICATION_PRINT);
b = ServerConfigFactory.getBoolean(ServerConfigKey.PROD_VERIFICATION_PRINT);
map.put("pv/print-enabled", b);
}
catch (Exception e) {
logger.error("Error getting Config for Dispense Application", e);
throw new EpsException(e);
}
return (map);
}
public static boolean luhnCheckForNPI(String npi) {
int digits = npi.length();
if (digits != 10 && digits != 15) {
return false;
}
int oddOrEven = digits & 1;
long sum = 0L;
for (int count = 0; count < digits; count++) {
int digit;
try {
digit = Integer.parseInt(npi.charAt(count) + "");
}
catch (NumberFormatException e) {
return false;
}
if ((count & 1 ^ oddOrEven) == 0) {
digit *= 2;
if (digit > 9) {
digit -= 9;
}
}
sum += digit;
}
if (digits == 10) {
sum += 24; //NPI without prefix 80840
}
return sum != 0L && sum % 10L == 0L;
}
/**
* Converts a null String to an empty String and trims it.
*/
public static String nullToEmptyAndTrim(String s) {
return s == null ? "" : s.trim();
}
//Issue#59442- Converts a Object to a String and null to an empty String.
public static String nullToEmpty(Object number) {
return number == null ? "" : number.toString();
}
// Strips leading / if it exists.
public static String[] removeRootDirs(String[] unprocessed) {
String[] processed = new String[unprocessed.length];
for (int i = 0; i < unprocessed.length; i++) {
if (unprocessed[i].startsWith("/", 0)) {
processed[i] = unprocessed[i].substring(1);
}
else {
processed[i] = unprocessed[i];
}
}
return processed;
}
//48842
public static boolean isLetterOrDigit(String s) {
for (int i = 0; i < s.length(); i++) {
if (!Character.isLetterOrDigit(s.charAt(i)))
return false;
}
return true;
}
/**
* Checks if an array of objects contains a search object, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T> boolean isPresent(T value, T... checkList) {
boolean checkCond = false;
if (checkList != null && value != null) {
if (Arrays.asList(checkList).contains(value)) {
checkCond = true;
}
}
return checkCond;
}
/**
*
* Checks if an array of enums contains a search string, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T extends AbstractStringEnum> boolean isPresent(String value, T... checkList) {
if (!EmptyTester.isEmpty(checkList) && value != null) {
for (T stringEnum : checkList) {
if (stringEnum.getCode().equals(value)) {
return true;
}
}
}
return false;
}
/**
*
* Checks if an array of enums contains a search integer, handling null.
* @param <T>
* @param value
* @param checkList
* @return
*/
public static <T extends AbstractIntEnum> boolean isPresent(Integer value, T... checkList) {
if (!EmptyTester.isEmpty(checkList) && value != null) {
for (T stringEnum : checkList) {
if (stringEnum.getCode() == value) {
return true;
}
}
}
return false;
}
/**
* compares two values by using equals method also handles if any of the values are null.
* @param <T>
* @param value1
* @param value2
* @return
*/
public static <T> boolean compare(T value1, T value2) {
if (value1 == null && value2 == null) {
return true;
}
else if (value1 == null) {
return false;
}
else if (value2 == null) {
return false;
}
else {
return value1.equals(value2);
}
}
/**
* Checks the given value is in the given the valueList or not
* by using the equals.
* @param value
* @param valueList
* @return true if the value exists in the list otherwise return false
*
* @author <NAME>
*/
public static <T> boolean isValueIn(T value,T... valueList){
for(T valueInList : valueList){
if(valueInList.equals(value)){
return true;
}
}
return false;
}
private static final Logger rowLockLogger = Logger.getLogger("RLCLogger");
/**
* 175059 - DE2572 - enq- row lock contention
* @deprecated
* @param oldValue
* @param newValue
*/
public static void printStackTraceIfNewValueIsEmpty(String columnName, String oldValue, String newValue) {
if (oldValue == null && newValue != null && newValue.trim().length() == 0) {
rowLockLogger.error("DE2572 columnName [" + columnName + "]; value [" + newValue + "]", new SanitizedException());
}
}
}
| 13,948 | 0.694717 | 0.685112 | 462 | 29.19697 | 28.938923 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.409091 | false | false | 7 |
8be01da720b646a2ffd80e6b8f7e31196948b0d9 | 2,052,994,401,824 | 0146ea52d905461a1717072f14ff058e5e0f448a | /src/com/trevorcow/mjnecraft/util/Lang.java | a5c377d9e7a79221928cdee6442e4f3688c56169 | [
"MIT"
] | permissive | TrevorCow/Mjnecraft | https://github.com/TrevorCow/Mjnecraft | efdd32908eb65398d684ad3d72b146047d2af42e | aa68e6cf4273417d97d23c47c11a097a172279af | refs/heads/master | 2021-05-13T12:02:59.668000 | 2018-01-14T09:45:29 | 2018-01-14T09:45:29 | 116,993,494 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.trevorcow.mjnecraft.util;
import java.util.HashMap;
import java.util.Map;
public class Lang {
public static final Map<String, String> LANG_US = new HashMap<>();
static {
LANG_US.put("language.name", "English");
LANG_US.put("language.region", "United States");
LANG_US.put("language.code", "en_us");
LANG_US.put("gui.done", "Done");
LANG_US.put("gui.cancel", "Cancel");
LANG_US.put("gui.back", "Back");
LANG_US.put("gui.toTitle", "Back to title screen");
LANG_US.put("gui.toMenu", "Back to server list");
LANG_US.put("gui.up", "Up");
LANG_US.put("gui.down", "Down");
LANG_US.put("gui.yes", "Yes");
LANG_US.put("gui.no", "No");
LANG_US.put("gui.none", "None");
LANG_US.put("gui.all", "All");
LANG_US.put("gui.recipebook.moreRecipes", "Right Click for more");
LANG_US.put("gui.recipebook.toggleRecipes.all", "Showing all");
LANG_US.put("gui.recipebook.toggleRecipes.craftable", "Showing craftable");
LANG_US.put("translation.test.none", "Hello, world!");
LANG_US.put("translation.test.complex", "Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again!");
LANG_US.put("translation.test.escape", "%%s %%%s %%%%s %%%%%s");
LANG_US.put("translation.test.invalid", "hi %");
LANG_US.put("translation.test.invalid2", "hi % s");
LANG_US.put("translation.test.args", "%s %s");
LANG_US.put("translation.test.world", "world");
LANG_US.put("menu.game", "Game Menu");
LANG_US.put("menu.singleplayer", "Singleplayer");
LANG_US.put("menu.multiplayer", "Multiplayer");
LANG_US.put("menu.online", "Minecraft Realms");
LANG_US.put("menu.options", "Options...");
LANG_US.put("menu.quit", "Quit Game");
LANG_US.put("menu.returnToMenu", "Save and Quit to Title");
LANG_US.put("menu.disconnect", "Disconnect");
LANG_US.put("menu.returnToGame", "Back to Game");
LANG_US.put("menu.generatingLevel", "Generating world");
LANG_US.put("menu.loadingLevel", "Loading world");
LANG_US.put("menu.generatingTerrain", "Building terrain");
LANG_US.put("menu.convertingLevel", "Converting world");
LANG_US.put("menu.respawning", "Respawning");
LANG_US.put("menu.shareToLan", "Open to LAN");
LANG_US.put("selectWorld.title", "Select World");
LANG_US.put("selectWorld.empty", "empty");
LANG_US.put("selectWorld.world", "World");
LANG_US.put("selectWorld.select", "Play Selected World");
LANG_US.put("selectWorld.create", "Create New World");
LANG_US.put("selectWorld.recreate", "Re-Create");
LANG_US.put("selectWorld.createDemo", "Play New Demo World");
LANG_US.put("selectWorld.delete", "Delete");
LANG_US.put("selectWorld.edit", "Edit");
LANG_US.put("selectWorld.edit.title", "Edit World");
LANG_US.put("selectWorld.edit.resetIcon", "Reset Icon");
LANG_US.put("selectWorld.edit.openFolder", "Open Folder");
LANG_US.put("selectWorld.edit.save", "Save World");
LANG_US.put("selectWorld.deleteQuestion", "Are you sure you want to delete this world?");
LANG_US.put("selectWorld.deleteWarning", "will be lost forever! (A long time!)");
LANG_US.put("selectWorld.deleteButton", "Delete");
LANG_US.put("selectWorld.conversion", "Must be converted!");
LANG_US.put("selectWorld.newWorld", "New World");
LANG_US.put("selectWorld.newWorld.copyOf", "Copy of %s");
LANG_US.put("selectWorld.enterName", "World Name");
LANG_US.put("selectWorld.resultFolder", "Will be saved in:");
LANG_US.put("selectWorld.enterSeed", "Seed for the world generator");
LANG_US.put("selectWorld.seedInfo", "Leave blank for a random seed");
LANG_US.put("selectWorld.cheats", "Cheats");
LANG_US.put("selectWorld.customizeType", "Customize");
LANG_US.put("selectWorld.version", "Version:");
LANG_US.put("selectWorld.versionUnknown", "unknown");
LANG_US.put("selectWorld.versionQuestion", "Do you really want to load this world?");
LANG_US.put("selectWorld.versionWarning", "This world was saved in version '%s' and loading it in this version could cause corruption!");
LANG_US.put("selectWorld.versionJoinButton", "Use Anyway");
LANG_US.put("selectWorld.tooltip.fromNewerVersion1", "World was saved in a newer version,");
LANG_US.put("selectWorld.tooltip.fromNewerVersion2", "loading this world could cause problems!");
LANG_US.put("selectWorld.tooltip.snapshot1", "Don't forget to backup this world");
LANG_US.put("selectWorld.tooltip.snapshot2", "before you load it in this snapshot.");
LANG_US.put("selectWorld.unable_to_load", "Unable to load worlds");
LANG_US.put("selectWorld.load_folder_access", "Unable to read or access folder where game worlds are saved!");
LANG_US.put("createWorld.customize.presets", "Presets");
LANG_US.put("createWorld.customize.presets.title", "Select a Preset");
LANG_US.put("createWorld.customize.presets.select", "Use Preset");
LANG_US.put("createWorld.customize.presets.share", "Want to share your preset with someone? Use the below box!");
LANG_US.put("createWorld.customize.presets.list", "Alternatively, here's some we made earlier!");
LANG_US.put("createWorld.customize.flat.title", "Superflat Customization");
LANG_US.put("createWorld.customize.flat.tile", "Layer Material");
LANG_US.put("createWorld.customize.flat.height", "Height");
LANG_US.put("createWorld.customize.flat.addLayer", "Add Layer");
LANG_US.put("createWorld.customize.flat.editLayer", "Edit Layer");
LANG_US.put("createWorld.customize.flat.removeLayer", "Remove Layer");
LANG_US.put("createWorld.customize.flat.layer.top", "Top - %s");
LANG_US.put("createWorld.customize.flat.layer", "%s");
LANG_US.put("createWorld.customize.flat.layer.bottom", "Bottom - %s");
LANG_US.put("createWorld.customize.preset.classic_flat", "Classic Flat");
LANG_US.put("createWorld.customize.preset.tunnelers_dream", "Tunnelers' Dream");
LANG_US.put("createWorld.customize.preset.water_world", "Water World");
LANG_US.put("createWorld.customize.preset.overworld", "Overworld");
LANG_US.put("createWorld.customize.preset.snowy_kingdom", "Snowy Kingdom");
LANG_US.put("createWorld.customize.preset.bottomless_pit", "Bottomless Pit");
LANG_US.put("createWorld.customize.preset.desert", "Desert");
LANG_US.put("createWorld.customize.preset.redstone_ready", "Redstone Ready");
LANG_US.put("createWorld.customize.preset.the_void", "The Void");
LANG_US.put("createWorld.customize.custom.page0", "Basic Settings");
LANG_US.put("createWorld.customize.custom.page1", "Ore Settings");
LANG_US.put("createWorld.customize.custom.page2", "Advanced Settings (Expert Users Only!)");
LANG_US.put("createWorld.customize.custom.page3", "Extra Advanced Settings (Expert Users Only!)");
LANG_US.put("createWorld.customize.custom.randomize", "Randomize");
LANG_US.put("createWorld.customize.custom.prev", "Previous Page");
LANG_US.put("createWorld.customize.custom.next", "Next Page");
LANG_US.put("createWorld.customize.custom.defaults", "Defaults");
LANG_US.put("createWorld.customize.custom.confirm1", "This will overwrite your current");
LANG_US.put("createWorld.customize.custom.confirm2", "settings and cannot be undone.");
LANG_US.put("createWorld.customize.custom.confirmTitle", "Warning!");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleX", "Main Noise Scale X");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleY", "Main Noise Scale Y");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleZ", "Main Noise Scale Z");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleX", "Depth Noise Scale X");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleZ", "Depth Noise Scale Z");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleExponent", "Depth Noise Exponent");
LANG_US.put("createWorld.customize.custom.baseSize", "Depth Base Size");
LANG_US.put("createWorld.customize.custom.coordinateScale", "Coordinate Scale");
LANG_US.put("createWorld.customize.custom.heightScale", "Height Scale");
LANG_US.put("createWorld.customize.custom.stretchY", "Height Stretch");
LANG_US.put("createWorld.customize.custom.upperLimitScale", "Upper Limit Scale");
LANG_US.put("createWorld.customize.custom.lowerLimitScale", "Lower Limit Scale");
LANG_US.put("createWorld.customize.custom.biomeDepthWeight", "Biome Depth Weight");
LANG_US.put("createWorld.customize.custom.biomeDepthOffset", "Biome Depth Offset");
LANG_US.put("createWorld.customize.custom.biomeScaleWeight", "Biome Scale Weight");
LANG_US.put("createWorld.customize.custom.biomeScaleOffset", "Biome Scale Offset");
LANG_US.put("createWorld.customize.custom.seaLevel", "Sea Level");
LANG_US.put("createWorld.customize.custom.useCaves", "Caves");
LANG_US.put("createWorld.customize.custom.useStrongholds", "Strongholds");
LANG_US.put("createWorld.customize.custom.useVillages", "Villages");
LANG_US.put("createWorld.customize.custom.useMineShafts", "Mineshafts");
LANG_US.put("createWorld.customize.custom.useTemples", "Temples");
LANG_US.put("createWorld.customize.custom.useMonuments", "Ocean Monuments");
LANG_US.put("createWorld.customize.custom.useMansions", "Woodland Mansions");
LANG_US.put("createWorld.customize.custom.useRavines", "Ravines");
LANG_US.put("createWorld.customize.custom.useDungeons", "Dungeons");
LANG_US.put("createWorld.customize.custom.dungeonChance", "Dungeon Count");
LANG_US.put("createWorld.customize.custom.useWaterLakes", "Water Lakes");
LANG_US.put("createWorld.customize.custom.waterLakeChance", "Water Lake Rarity");
LANG_US.put("createWorld.customize.custom.useLavaLakes", "Lava Lakes");
LANG_US.put("createWorld.customize.custom.lavaLakeChance", "Lava Lake Rarity");
LANG_US.put("createWorld.customize.custom.useLavaOceans", "Lava Oceans");
LANG_US.put("createWorld.customize.custom.fixedBiome", "Biome");
LANG_US.put("createWorld.customize.custom.biomeSize", "Biome Size");
LANG_US.put("createWorld.customize.custom.riverSize", "River Size");
LANG_US.put("createWorld.customize.custom.size", "Spawn Size");
LANG_US.put("createWorld.customize.custom.count", "Spawn Tries");
LANG_US.put("createWorld.customize.custom.minHeight", "Min. Height");
LANG_US.put("createWorld.customize.custom.maxHeight", "Max. Height");
LANG_US.put("createWorld.customize.custom.center", "Center Height");
LANG_US.put("createWorld.customize.custom.spread", "Spread Height");
LANG_US.put("createWorld.customize.custom.presets.title", "Customize World Presets");
LANG_US.put("createWorld.customize.custom.presets", "Presets");
LANG_US.put("createWorld.customize.custom.preset.waterWorld", "Water World");
LANG_US.put("createWorld.customize.custom.preset.isleLand", "Isle Land");
LANG_US.put("createWorld.customize.custom.preset.caveDelight", "Caver's Delight");
LANG_US.put("createWorld.customize.custom.preset.mountains", "Mountain Madness");
LANG_US.put("createWorld.customize.custom.preset.drought", "Drought");
LANG_US.put("createWorld.customize.custom.preset.caveChaos", "Caves of Chaos");
LANG_US.put("createWorld.customize.custom.preset.goodLuck", "Good Luck");
LANG_US.put("gameMode.survival", "Survival Mode");
LANG_US.put("gameMode.creative", "Creative Mode");
LANG_US.put("gameMode.adventure", "Adventure Mode");
LANG_US.put("gameMode.spectator", "Spectator Mode");
LANG_US.put("gameMode.hardcore", "Hardcore Mode!");
LANG_US.put("gameMode.changed", "Your game mode has been updated to %s");
LANG_US.put("spectatorMenu.previous_page", "Previous Page");
LANG_US.put("spectatorMenu.next_page", "Next Page");
LANG_US.put("spectatorMenu.close", "Close Menu");
LANG_US.put("spectatorMenu.teleport", "Teleport to Player");
LANG_US.put("spectatorMenu.teleport.prompt", "Select a player to teleport to");
LANG_US.put("spectatorMenu.team_teleport", "Teleport to Team Member");
LANG_US.put("spectatorMenu.team_teleport.prompt", "Select a team to teleport to");
LANG_US.put("spectatorMenu.root.prompt", "Press a key to select a command, and again to use it.");
LANG_US.put("selectWorld.gameMode", "Game Mode");
LANG_US.put("selectWorld.gameMode.survival", "Survival");
LANG_US.put("selectWorld.gameMode.survival.line1", "Search for resources, crafting, gain");
LANG_US.put("selectWorld.gameMode.survival.line2", "levels, health and hunger");
LANG_US.put("selectWorld.gameMode.creative", "Creative");
LANG_US.put("selectWorld.gameMode.creative.line1", "Unlimited resources, free flying and");
LANG_US.put("selectWorld.gameMode.creative.line2", "destroy blocks instantly");
LANG_US.put("selectWorld.gameMode.spectator", "Spectator");
LANG_US.put("selectWorld.gameMode.spectator.line1", "You can look but don't touch");
LANG_US.put("selectWorld.gameMode.spectator.line2", "");
LANG_US.put("selectWorld.gameMode.hardcore", "Hardcore");
LANG_US.put("selectWorld.gameMode.hardcore.line1", "Same as survival mode, locked at hardest");
LANG_US.put("selectWorld.gameMode.hardcore.line2", "difficulty, and one life only");
LANG_US.put("selectWorld.gameMode.adventure", "Adventure");
LANG_US.put("selectWorld.gameMode.adventure.line1", "Same as survival mode, but blocks can't");
LANG_US.put("selectWorld.gameMode.adventure.line2", "be added or removed");
LANG_US.put("selectWorld.moreWorldOptions", "More World Options...");
LANG_US.put("selectWorld.mapFeatures", "Generate Structures:");
LANG_US.put("selectWorld.mapFeatures.info", "Villages, dungeons etc");
LANG_US.put("selectWorld.mapType", "World Type:");
LANG_US.put("selectWorld.mapType.normal", "Normal");
LANG_US.put("selectWorld.allowCommands", "Allow Cheats:");
LANG_US.put("selectWorld.allowCommands.info", "Commands like /gamemode, /xp");
LANG_US.put("selectWorld.hardcoreMode", "Hardcore:");
LANG_US.put("selectWorld.hardcoreMode.info", "World is deleted upon death");
LANG_US.put("selectWorld.bonusItems", "Bonus Chest:");
LANG_US.put("generator.default", "Default");
LANG_US.put("generator.flat", "Superflat");
LANG_US.put("generator.largeBiomes", "Large Biomes");
LANG_US.put("generator.amplified", "AMPLIFIED");
LANG_US.put("generator.customized", "Customized");
LANG_US.put("generator.debug_all_block_states", "Debug Mode");
LANG_US.put("generator.amplified.info", "Notice: Just for fun, requires beefy computer");
LANG_US.put("selectServer.title", "Select Server");
LANG_US.put("selectServer.empty", "empty");
LANG_US.put("selectServer.select", "Join Server");
LANG_US.put("selectServer.direct", "Direct Connect");
LANG_US.put("selectServer.edit", "Edit");
LANG_US.put("selectServer.delete", "Delete");
LANG_US.put("selectServer.add", "Add Server");
LANG_US.put("selectServer.defaultName", "Minecraft Server");
LANG_US.put("selectServer.deleteQuestion", "Are you sure you want to remove this server?");
LANG_US.put("selectServer.deleteWarning", "will be lost forever! (A long time!)");
LANG_US.put("selectServer.deleteButton", "Delete");
LANG_US.put("selectServer.refresh", "Refresh");
LANG_US.put("selectServer.hiddenAddress", "(Hidden)");
LANG_US.put("addServer.title", "Edit Server Info");
LANG_US.put("addServer.enterName", "Server Name");
LANG_US.put("addServer.enterIp", "Server Address");
LANG_US.put("addServer.add", "Done");
LANG_US.put("addServer.hideAddress", "Hide Address");
LANG_US.put("addServer.resourcePack", "Server Resource Packs");
LANG_US.put("addServer.resourcePack.enabled", "Enabled");
LANG_US.put("addServer.resourcePack.disabled", "Disabled");
LANG_US.put("addServer.resourcePack.prompt", "Prompt");
LANG_US.put("lanServer.title", "LAN World");
LANG_US.put("lanServer.scanning", "Scanning for games on your local network");
LANG_US.put("lanServer.start", "Start LAN World");
LANG_US.put("lanServer.otherPlayers", "Settings for Other Players");
LANG_US.put("mcoServer.title", "Minecraft Online World");
LANG_US.put("multiplayer.title", "Play Multiplayer");
LANG_US.put("multiplayer.connect", "Connect");
LANG_US.put("multiplayer.ipinfo", "Enter the IP of a server to connect to it:");
LANG_US.put("multiplayer.texturePrompt.line1", "This server recommends the use of a custom resource pack.");
LANG_US.put("multiplayer.texturePrompt.line2", "Would you like to download and install it automagically?");
LANG_US.put("multiplayer.downloadingTerrain", "Loading terrain");
LANG_US.put("multiplayer.downloadingStats", "Downloading statistics...");
LANG_US.put("multiplayer.stopSleeping", "Leave Bed");
LANG_US.put("multiplayer.player.joined", "%s joined the game");
LANG_US.put("multiplayer.player.joined.renamed", "%s (formerly known as %s) joined the game");
LANG_US.put("multiplayer.player.left", "%s left the game");
LANG_US.put("multiplayer.status.and_more", "... and %s more ...");
LANG_US.put("multiplayer.status.cancelled", "Cancelled");
LANG_US.put("multiplayer.status.cannot_connect", "Can't connect to server");
LANG_US.put("multiplayer.status.cannot_resolve", "Can't resolve hostname");
LANG_US.put("multiplayer.status.client_out_of_date", "Client out of date!");
LANG_US.put("multiplayer.status.no_connection", "(no connection)");
LANG_US.put("multiplayer.status.old", "Old");
LANG_US.put("multiplayer.status.pinging", "Pinging...");
LANG_US.put("multiplayer.status.server_out_of_date", "Server out of date!");
LANG_US.put("multiplayer.status.unknown", "???");
LANG_US.put("multiplayer.status.unrequested", "Received unrequested status");
LANG_US.put("multiplayer.disconnect.authservers_down", "Authentication servers are down. Please try again later, sorry!");
LANG_US.put("multiplayer.disconnect.banned", "You are banned from this server.");
LANG_US.put("multiplayer.disconnect.duplicate_login", "You logged in from another location");
LANG_US.put("multiplayer.disconnect.flying", "Flying is not enabled on this server");
LANG_US.put("multiplayer.disconnect.generic", "Disconnected");
LANG_US.put("multiplayer.disconnect.idling", "You have been idle for too long!");
LANG_US.put("multiplayer.disconnect.illegal_characters", "Illegal characters in chat");
LANG_US.put("multiplayer.disconnect.invalid_entity_attacked", "Attempting to attack an invalid entity");
LANG_US.put("multiplayer.disconnect.invalid_player_movement", "Invalid move player packet received");
LANG_US.put("multiplayer.disconnect.invalid_vehicle_movement", "Invalid move vehicle packet received");
LANG_US.put("multiplayer.disconnect.ip_banned", "You have been IP banned.");
LANG_US.put("multiplayer.disconnect.kicked", "Kicked by an operator.");
LANG_US.put("multiplayer.disconnect.outdated_client", "Outdated client! Please use %s");
LANG_US.put("multiplayer.disconnect.outdated_server", "Outdated server! I'm still on %s");
LANG_US.put("multiplayer.disconnect.server_shutdown", "Server closed");
LANG_US.put("multiplayer.disconnect.slow_login", "Took too long to log in");
LANG_US.put("multiplayer.disconnect.unverified_username", "Failed to verify username!");
LANG_US.put("chat.cannotSend", "Cannot send chat message");
LANG_US.put("chat.type.text", "<%s> %s");
LANG_US.put("chat.type.text.narrate", "%s says %s");
LANG_US.put("chat.type.emote", "* %s %s");
LANG_US.put("chat.type.announcement", "[%s] %s");
LANG_US.put("chat.type.admin", "[%s: %s]");
LANG_US.put("chat.type.advancement.task", "%s has made the advancement %s");
LANG_US.put("chat.type.advancement.challenge", "%s has completed the challenge %s");
LANG_US.put("chat.type.advancement.goal", "%s has reached the goal %s");
LANG_US.put("chat.link.confirm", "Are you sure you want to open the following website?");
LANG_US.put("chat.link.warning", "Never open links from people that you don't trust!");
LANG_US.put("chat.copy", "Copy to Clipboard");
LANG_US.put("chat.link.confirmTrusted", "Do you want to open this link or copy it to your clipboard?");
LANG_US.put("chat.link.open", "Open in browser");
LANG_US.put("menu.playdemo", "Play Demo World");
LANG_US.put("menu.resetdemo", "Reset Demo World");
LANG_US.put("demo.day.1", "This demo will last five game days, do your best!");
LANG_US.put("demo.day.2", "Day Two");
LANG_US.put("demo.day.3", "Day Three");
LANG_US.put("demo.day.4", "Day Four");
LANG_US.put("demo.day.5", "This is your last day!");
LANG_US.put("demo.day.warning", "Your time is almost up!");
LANG_US.put("demo.day.6", "You have passed your fifth day, use F2 to save a screenshot of your creation");
LANG_US.put("demo.reminder", "The demo time has expired, buy the game to continue or start a new world!");
LANG_US.put("demo.remainingTime", "Remaining time: %s");
LANG_US.put("demo.demoExpired", "Demo time's up!");
LANG_US.put("demo.help.movement", "Use the %1$s, %2$s, %3$s, %4$s keys and the mouse to move around");
LANG_US.put("demo.help.movementShort", "Move by pressing the %1$s, %2$s, %3$s, %4$s keys");
LANG_US.put("demo.help.movementMouse", "Look around using the mouse");
LANG_US.put("demo.help.jump", "Jump by pressing the %1$s key");
LANG_US.put("demo.help.inventory", "Use the %1$s key to open your inventory");
LANG_US.put("demo.help.title", "Minecraft Demo Mode");
LANG_US.put("demo.help.fullWrapped", "This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the advancements for hints! Have fun!");
LANG_US.put("demo.help.buy", "Purchase Now!");
LANG_US.put("demo.help.later", "Continue Playing!");
LANG_US.put("connect.connecting", "Connecting to the server...");
LANG_US.put("connect.authorizing", "Logging in...");
LANG_US.put("connect.failed", "Failed to connect to the server");
LANG_US.put("disconnect.genericReason", "%s");
LANG_US.put("disconnect.disconnected", "Disconnected by Server");
LANG_US.put("disconnect.lost", "Connection Lost");
LANG_US.put("disconnect.kicked", "Was kicked from the game");
LANG_US.put("disconnect.timeout", "Timed out");
LANG_US.put("disconnect.closed", "Connection closed");
LANG_US.put("disconnect.loginFailed", "Failed to login");
LANG_US.put("disconnect.loginFailedInfo", "Failed to login: %s");
LANG_US.put("disconnect.loginFailedInfo.serversUnavailable", "The authentication servers are currently down for maintenance.");
LANG_US.put("disconnect.loginFailedInfo.invalidSession", "Invalid session (Try restarting your game and the launcher)");
LANG_US.put("disconnect.quitting", "Quitting");
LANG_US.put("disconnect.endOfStream", "End of stream");
LANG_US.put("disconnect.overflow", "Buffer overflow");
LANG_US.put("disconnect.spam", "Kicked for spamming");
LANG_US.put("soundCategory.master", "Master Volume");
LANG_US.put("soundCategory.music", "Music");
LANG_US.put("soundCategory.record", "Jukebox/Note Blocks");
LANG_US.put("soundCategory.weather", "Weather");
LANG_US.put("soundCategory.hostile", "Hostile Creatures");
LANG_US.put("soundCategory.neutral", "Friendly Creatures");
LANG_US.put("soundCategory.player", "Players");
LANG_US.put("soundCategory.block", "Blocks");
LANG_US.put("soundCategory.ambient", "Ambient/Environment");
LANG_US.put("soundCategory.voice", "Voice/Speech");
LANG_US.put("record.nowPlaying", "Now playing: %s");
LANG_US.put("options.off", "OFF");
LANG_US.put("options.on", "ON");
LANG_US.put("options.visible", "Shown");
LANG_US.put("options.hidden", "Hidden");
LANG_US.put("options.title", "Options");
LANG_US.put("options.controls", "Controls...");
LANG_US.put("options.video", "Video Settings...");
LANG_US.put("options.language", "Language...");
LANG_US.put("options.sounds", "Music & Sounds...");
LANG_US.put("options.sounds.title", "Music & Sound Options");
LANG_US.put("options.languageWarning", "Language translations may not be 100%% accurate");
LANG_US.put("options.videoTitle", "Video Settings");
LANG_US.put("options.customizeTitle", "Customize World Settings");
LANG_US.put("options.music", "Music");
LANG_US.put("options.sound", "Sound");
LANG_US.put("options.invertMouse", "Invert Mouse");
LANG_US.put("options.fov", "FOV");
LANG_US.put("options.fov.min", "Normal");
LANG_US.put("options.fov.max", "Quake Pro");
LANG_US.put("options.saturation", "Saturation");
LANG_US.put("options.gamma", "Brightness");
LANG_US.put("options.gamma.min", "Moody");
LANG_US.put("options.gamma.max", "Bright");
LANG_US.put("options.sensitivity", "Sensitivity");
LANG_US.put("options.sensitivity.min", "*yawn*");
LANG_US.put("options.sensitivity.max", "HYPERSPEED!!!");
LANG_US.put("options.renderDistance", "Render Distance");
LANG_US.put("options.viewBobbing", "View Bobbing");
LANG_US.put("options.ao", "Smooth Lighting");
LANG_US.put("options.ao.off", "OFF");
LANG_US.put("options.ao.min", "Minimum");
LANG_US.put("options.ao.max", "Maximum");
LANG_US.put("options.anaglyph", "3D Anaglyph");
LANG_US.put("options.chunks", "%s chunks");
LANG_US.put("options.framerate", "%s fps");
LANG_US.put("options.framerateLimit", "Max Framerate");
LANG_US.put("options.framerateLimit.max", "Unlimited");
LANG_US.put("options.difficulty", "Difficulty");
LANG_US.put("options.difficulty.peaceful", "Peaceful");
LANG_US.put("options.difficulty.easy", "Easy");
LANG_US.put("options.difficulty.normal", "Normal");
LANG_US.put("options.difficulty.hard", "Hard");
LANG_US.put("options.difficulty.hardcore", "Hardcore");
LANG_US.put("options.graphics", "Graphics");
LANG_US.put("options.graphics.fancy", "Fancy");
LANG_US.put("options.graphics.fast", "Fast");
LANG_US.put("options.clouds.fancy", "Fancy");
LANG_US.put("options.clouds.fast", "Fast");
LANG_US.put("options.guiScale", "GUI Scale");
LANG_US.put("options.guiScale.auto", "Auto");
LANG_US.put("options.guiScale.small", "Small");
LANG_US.put("options.guiScale.normal", "Normal");
LANG_US.put("options.guiScale.large", "Large");
LANG_US.put("options.renderClouds", "Clouds");
LANG_US.put("options.particles", "Particles");
LANG_US.put("options.particles.all", "All");
LANG_US.put("options.particles.decreased", "Decreased");
LANG_US.put("options.particles.minimal", "Minimal");
LANG_US.put("options.multiplayer.title", "Multiplayer Settings...");
LANG_US.put("options.chat.title", "Chat Settings...");
LANG_US.put("options.chat.visibility", "Chat");
LANG_US.put("options.chat.visibility.full", "Shown");
LANG_US.put("options.chat.visibility.system", "Commands Only");
LANG_US.put("options.chat.visibility.hidden", "Hidden");
LANG_US.put("options.chat.color", "Colors");
LANG_US.put("options.chat.opacity", "Opacity");
LANG_US.put("options.chat.links", "Web Links");
LANG_US.put("options.chat.links.prompt", "Prompt on Links");
LANG_US.put("options.chat.scale", "Scale");
LANG_US.put("options.chat.width", "Width");
LANG_US.put("options.chat.height.focused", "Focused Height");
LANG_US.put("options.chat.height.unfocused", "Unfocused Height");
LANG_US.put("options.skinCustomisation", "Skin Customization...");
LANG_US.put("options.skinCustomisation.title", "Skin Customization");
LANG_US.put("options.modelPart.cape", "Cape");
LANG_US.put("options.modelPart.hat", "Hat");
LANG_US.put("options.modelPart.jacket", "Jacket");
LANG_US.put("options.modelPart.left_sleeve", "Left Sleeve");
LANG_US.put("options.modelPart.right_sleeve", "Right Sleeve");
LANG_US.put("options.modelPart.left_pants_leg", "Left Pants Leg");
LANG_US.put("options.modelPart.right_pants_leg", "Right Pants Leg");
LANG_US.put("options.snooper", "Allow Snooper");
LANG_US.put("options.snooper.view", "Snooper Settings...");
LANG_US.put("options.snooper.title", "Feed us data!");
LANG_US.put("options.snooper.desc", "We always want to improve Minecraft and, to help us do that, we'd like to collect some information. This lets us know what hardware to support and where the big problems are. It also gives us a sense of the size of our active player base, so we know if we're doing a good job. You can view all the information we collect below. If you want to opt out then you can simply toggle it off!");
LANG_US.put("options.resourcepack", "Resource Packs...");
LANG_US.put("options.fullscreen", "Fullscreen");
LANG_US.put("options.vsync", "Use VSync");
LANG_US.put("options.vbo", "Use VBOs");
LANG_US.put("options.touchscreen", "Touchscreen Mode");
LANG_US.put("options.reducedDebugInfo", "Reduced Debug Info");
LANG_US.put("options.entityShadows", "Entity Shadows");
LANG_US.put("options.mainHand", "Main Hand");
LANG_US.put("options.mainHand.left", "Left");
LANG_US.put("options.mainHand.right", "Right");
LANG_US.put("options.attackIndicator", "Attack Indicator");
LANG_US.put("options.attack.crosshair", "Crosshair");
LANG_US.put("options.attack.hotbar", "Hotbar");
LANG_US.put("options.showSubtitles", "Show Subtitles");
LANG_US.put("options.realmsNotifications", "Realms Notifications");
LANG_US.put("options.autoJump", "Auto-Jump");
LANG_US.put("options.narrator", "Narrator");
LANG_US.put("options.narrator.off", "Off");
LANG_US.put("options.narrator.all", "Narrates all");
LANG_US.put("options.narrator.chat", "Narrates chat");
LANG_US.put("options.narrator.system", "Narrates system");
LANG_US.put("options.narrator.notavailable", "Not available");
LANG_US.put("options.mipmapLevels", "Mipmap Levels");
LANG_US.put("options.forceUnicodeFont", "Force Unicode Font");
LANG_US.put("narrator.toast.disabled", "Narrator Disabled");
LANG_US.put("narrator.toast.enabled", "Narrator Enabled");
LANG_US.put("difficulty.lock.title", "Lock World Difficulty");
LANG_US.put("difficulty.lock.question", "Are you sure you want to lock the difficulty of this world? This will set this world to always be %1$s, and you will never be able to change that again.");
LANG_US.put("title.oldgl1", "Old graphics card detected; this may prevent you from");
LANG_US.put("title.oldgl2", "playing in the future as OpenGL 2.0 will be required.");
LANG_US.put("controls.title", "Controls");
LANG_US.put("controls.reset", "Reset");
LANG_US.put("controls.resetAll", "Reset Keys");
LANG_US.put("key.sprint", "Sprint");
LANG_US.put("key.forward", "Walk Forwards");
LANG_US.put("key.left", "Strafe Left");
LANG_US.put("key.back", "Walk Backwards");
LANG_US.put("key.right", "Strafe Right");
LANG_US.put("key.jump", "Jump");
LANG_US.put("key.inventory", "Open/Close Inventory");
LANG_US.put("key.drop", "Drop Selected Item");
LANG_US.put("key.swapHands", "Swap Item In Hands");
LANG_US.put("key.chat", "Open Chat");
LANG_US.put("key.sneak", "Sneak");
LANG_US.put("key.playerlist", "List Players");
LANG_US.put("key.attack", "Attack/Destroy");
LANG_US.put("key.use", "Use Item/Place Block");
LANG_US.put("key.pickItem", "Pick Block");
LANG_US.put("key.mouseButton", "Button %1$s");
LANG_US.put("key.mouse.left", "Left Click");
LANG_US.put("key.mouse.middle", "Middle Click");
LANG_US.put("key.mouse.right", "Right Click");
LANG_US.put("key.command", "Open Command");
LANG_US.put("key.screenshot", "Take Screenshot");
LANG_US.put("key.togglePerspective", "Toggle Perspective");
LANG_US.put("key.smoothCamera", "Toggle Cinematic Camera");
LANG_US.put("key.fullscreen", "Toggle Fullscreen");
LANG_US.put("key.spectatorOutlines", "Highlight Players (Spectators)");
LANG_US.put("key.hotbar.1", "Hotbar Slot 1");
LANG_US.put("key.hotbar.2", "Hotbar Slot 2");
LANG_US.put("key.hotbar.3", "Hotbar Slot 3");
LANG_US.put("key.hotbar.4", "Hotbar Slot 4");
LANG_US.put("key.hotbar.5", "Hotbar Slot 5");
LANG_US.put("key.hotbar.6", "Hotbar Slot 6");
LANG_US.put("key.hotbar.7", "Hotbar Slot 7");
LANG_US.put("key.hotbar.8", "Hotbar Slot 8");
LANG_US.put("key.hotbar.9", "Hotbar Slot 9");
LANG_US.put("key.saveToolbarActivator", "Save Toolbar Activator");
LANG_US.put("key.loadToolbarActivator", "Load Toolbar Activator");
LANG_US.put("key.advancements", "Advancements");
LANG_US.put("key.categories.movement", "Movement");
LANG_US.put("key.categories.misc", "Miscellaneous");
LANG_US.put("key.categories.multiplayer", "Multiplayer");
LANG_US.put("key.categories.gameplay", "Gameplay");
LANG_US.put("key.categories.ui", "Game Interface");
LANG_US.put("key.categories.inventory", "Inventory");
LANG_US.put("key.categories.creative", "Creative Mode");
LANG_US.put("resourcePack.openFolder", "Open Resource Pack Folder");
LANG_US.put("resourcePack.title", "Select Resource Packs");
LANG_US.put("resourcePack.available.title", "Available Resource Packs");
LANG_US.put("resourcePack.selected.title", "Selected Resource Packs");
LANG_US.put("resourcePack.folderInfo", "(Place resource pack files here)");
LANG_US.put("resourcePack.incompatible", "Incompatible");
LANG_US.put("resourcePack.incompatible.old", "(Made for an older version of Minecraft)");
LANG_US.put("resourcePack.incompatible.new", "(Made for a newer version of Minecraft)");
LANG_US.put("resourcePack.incompatible.confirm.title", "Are you sure you want to load this resource pack?");
LANG_US.put("resourcePack.incompatible.confirm.old", "This resource pack was made for an older version of Minecraft and may no longer work correctly.");
LANG_US.put("resourcePack.incompatible.confirm.new", "This resource pack was made for a newer version of Minecraft and may no longer work correctly.");
LANG_US.put("sign.edit", "Edit sign message");
LANG_US.put("book.pageIndicator", "Page %1$s of %2$s");
LANG_US.put("book.byAuthor", "by %1$s");
LANG_US.put("book.signButton", "Sign");
LANG_US.put("book.editTitle", "Enter Book Title:");
LANG_US.put("book.finalizeButton", "Sign and Close");
LANG_US.put("book.finalizeWarning", "Note! When you sign the book, it will no longer be editable.");
LANG_US.put("book.generation.0", "Original");
LANG_US.put("book.generation.1", "Copy of original");
LANG_US.put("book.generation.2", "Copy of a copy");
LANG_US.put("book.generation.3", "Tattered");
LANG_US.put("merchant.deprecated", "Trade something else to unlock!");
LANG_US.put("tile.air.name", "Air");
LANG_US.put("tile.barrier.name", "Barrier");
LANG_US.put("tile.stone.stone.name", "Stone");
LANG_US.put("tile.stone.granite.name", "Granite");
LANG_US.put("tile.stone.graniteSmooth.name", "Polished Granite");
LANG_US.put("tile.stone.diorite.name", "Diorite");
LANG_US.put("tile.stone.dioriteSmooth.name", "Polished Diorite");
LANG_US.put("tile.stone.andesite.name", "Andesite");
LANG_US.put("tile.stone.andesiteSmooth.name", "Polished Andesite");
LANG_US.put("tile.hayBlock.name", "Hay Bale");
LANG_US.put("tile.grass.name", "Grass Block");
LANG_US.put("tile.dirt.name", "Dirt");
LANG_US.put("tile.dirt.default.name", "Dirt");
LANG_US.put("tile.dirt.coarse.name", "Coarse Dirt");
LANG_US.put("tile.dirt.podzol.name", "Podzol");
LANG_US.put("tile.stonebrick.name", "Cobblestone");
LANG_US.put("tile.wood.name", "Wooden Planks");
LANG_US.put("tile.wood.oak.name", "Oak Wood Planks");
LANG_US.put("tile.wood.spruce.name", "Spruce Wood Planks");
LANG_US.put("tile.wood.birch.name", "Birch Wood Planks");
LANG_US.put("tile.wood.jungle.name", "Jungle Wood Planks");
LANG_US.put("tile.wood.acacia.name", "Acacia Wood Planks");
LANG_US.put("tile.wood.big_oak.name", "Dark Oak Wood Planks");
LANG_US.put("tile.sapling.oak.name", "Oak Sapling");
LANG_US.put("tile.sapling.spruce.name", "Spruce Sapling");
LANG_US.put("tile.sapling.birch.name", "Birch Sapling");
LANG_US.put("tile.sapling.jungle.name", "Jungle Sapling");
LANG_US.put("tile.sapling.acacia.name", "Acacia Sapling");
LANG_US.put("tile.sapling.big_oak.name", "Dark Oak Sapling");
LANG_US.put("tile.deadbush.name", "Dead Bush");
LANG_US.put("tile.bedrock.name", "Bedrock");
LANG_US.put("tile.water.name", "Water");
LANG_US.put("tile.lava.name", "Lava");
LANG_US.put("tile.sand.name", "Sand");
LANG_US.put("tile.sand.default.name", "Sand");
LANG_US.put("tile.sand.red.name", "Red Sand");
LANG_US.put("tile.sandStone.name", "Sandstone");
LANG_US.put("tile.sandStone.default.name", "Sandstone");
LANG_US.put("tile.sandStone.chiseled.name", "Chiseled Sandstone");
LANG_US.put("tile.sandStone.smooth.name", "Smooth Sandstone");
LANG_US.put("tile.redSandStone.name", "Red Sandstone");
LANG_US.put("tile.redSandStone.default.name", "Red Sandstone");
LANG_US.put("tile.redSandStone.chiseled.name", "Chiseled Red Sandstone");
LANG_US.put("tile.redSandStone.smooth.name", "Smooth Red Sandstone");
LANG_US.put("tile.gravel.name", "Gravel");
LANG_US.put("tile.oreGold.name", "Gold Ore");
LANG_US.put("tile.oreIron.name", "Iron Ore");
LANG_US.put("tile.oreCoal.name", "Coal Ore");
LANG_US.put("tile.log.name", "Wood");
LANG_US.put("tile.log.oak.name", "Oak Wood");
LANG_US.put("tile.log.spruce.name", "Spruce Wood");
LANG_US.put("tile.log.birch.name", "Birch Wood");
LANG_US.put("tile.log.jungle.name", "Jungle Wood");
LANG_US.put("tile.log.acacia.name", "Acacia Wood");
LANG_US.put("tile.log.big_oak.name", "Dark Oak Wood");
LANG_US.put("tile.leaves.name", "Leaves");
LANG_US.put("tile.leaves.oak.name", "Oak Leaves");
LANG_US.put("tile.leaves.spruce.name", "Spruce Leaves");
LANG_US.put("tile.leaves.birch.name", "Birch Leaves");
LANG_US.put("tile.leaves.jungle.name", "Jungle Leaves");
LANG_US.put("tile.leaves.acacia.name", "Acacia Leaves");
LANG_US.put("tile.leaves.big_oak.name", "Dark Oak Leaves");
LANG_US.put("tile.tallgrass.name", "Grass");
LANG_US.put("tile.tallgrass.shrub.name", "Shrub");
LANG_US.put("tile.tallgrass.grass.name", "Grass");
LANG_US.put("tile.tallgrass.fern.name", "Fern");
LANG_US.put("tile.sponge.dry.name", "Sponge");
LANG_US.put("tile.sponge.wet.name", "Wet Sponge");
LANG_US.put("tile.glass.name", "Glass");
LANG_US.put("tile.stainedGlass.name", "Stained Glass");
LANG_US.put("tile.stainedGlass.black.name", "Black Stained Glass");
LANG_US.put("tile.stainedGlass.red.name", "Red Stained Glass");
LANG_US.put("tile.stainedGlass.green.name", "Green Stained Glass");
LANG_US.put("tile.stainedGlass.brown.name", "Brown Stained Glass");
LANG_US.put("tile.stainedGlass.blue.name", "Blue Stained Glass");
LANG_US.put("tile.stainedGlass.purple.name", "Purple Stained Glass");
LANG_US.put("tile.stainedGlass.cyan.name", "Cyan Stained Glass");
LANG_US.put("tile.stainedGlass.silver.name", "Light Gray Stained Glass");
LANG_US.put("tile.stainedGlass.gray.name", "Gray Stained Glass");
LANG_US.put("tile.stainedGlass.pink.name", "Pink Stained Glass");
LANG_US.put("tile.stainedGlass.lime.name", "Lime Stained Glass");
LANG_US.put("tile.stainedGlass.yellow.name", "Yellow Stained Glass");
LANG_US.put("tile.stainedGlass.lightBlue.name", "Light Blue Stained Glass");
LANG_US.put("tile.stainedGlass.magenta.name", "Magenta Stained Glass");
LANG_US.put("tile.stainedGlass.orange.name", "Orange Stained Glass");
LANG_US.put("tile.stainedGlass.white.name", "White Stained Glass");
LANG_US.put("tile.thinStainedGlass.name", "Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.black.name", "Black Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.red.name", "Red Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.green.name", "Green Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.brown.name", "Brown Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.blue.name", "Blue Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.purple.name", "Purple Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.cyan.name", "Cyan Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.silver.name", "Light Gray Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.gray.name", "Gray Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.pink.name", "Pink Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.lime.name", "Lime Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.yellow.name", "Yellow Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.lightBlue.name", "Light Blue Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.magenta.name", "Magenta Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.orange.name", "Orange Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.white.name", "White Stained Glass Pane");
LANG_US.put("tile.thinGlass.name", "Glass Pane");
LANG_US.put("tile.cloth.name", "Wool");
LANG_US.put("tile.flower1.name", "Flower");
LANG_US.put("tile.flower1.dandelion.name", "Dandelion");
LANG_US.put("tile.flower2.name", "Flower");
LANG_US.put("tile.flower2.poppy.name", "Poppy");
LANG_US.put("tile.flower2.blueOrchid.name", "Blue Orchid");
LANG_US.put("tile.flower2.allium.name", "Allium");
LANG_US.put("tile.flower2.houstonia.name", "Azure Bluet");
LANG_US.put("tile.flower2.tulipRed.name", "Red Tulip");
LANG_US.put("tile.flower2.tulipOrange.name", "Orange Tulip");
LANG_US.put("tile.flower2.tulipWhite.name", "White Tulip");
LANG_US.put("tile.flower2.tulipPink.name", "Pink Tulip");
LANG_US.put("tile.flower2.oxeyeDaisy.name", "Oxeye Daisy");
LANG_US.put("tile.doublePlant.name", "Plant");
LANG_US.put("tile.doublePlant.sunflower.name", "Sunflower");
LANG_US.put("tile.doublePlant.syringa.name", "Lilac");
LANG_US.put("tile.doublePlant.grass.name", "Double Tallgrass");
LANG_US.put("tile.doublePlant.fern.name", "Large Fern");
LANG_US.put("tile.doublePlant.rose.name", "Rose Bush");
LANG_US.put("tile.doublePlant.paeonia.name", "Peony");
LANG_US.put("tile.mushroom.name", "Mushroom");
LANG_US.put("tile.blockGold.name", "Block of Gold");
LANG_US.put("tile.blockIron.name", "Block of Iron");
LANG_US.put("tile.stoneSlab.name", "Stone Slab");
LANG_US.put("tile.stoneSlab.stone.name", "Stone Slab");
LANG_US.put("tile.stoneSlab.sand.name", "Sandstone Slab");
LANG_US.put("tile.stoneSlab.wood.name", "Wooden Slab");
LANG_US.put("tile.stoneSlab.cobble.name", "Cobblestone Slab");
LANG_US.put("tile.stoneSlab.brick.name", "Bricks Slab");
LANG_US.put("tile.stoneSlab.smoothStoneBrick.name", "Stone Bricks Slab");
LANG_US.put("tile.stoneSlab.netherBrick.name", "Nether Brick Slab");
LANG_US.put("tile.stoneSlab.quartz.name", "Quartz Slab");
LANG_US.put("tile.stoneSlab2.red_sandstone.name", "Red Sandstone Slab");
LANG_US.put("tile.woodSlab.name", "Wood Slab");
LANG_US.put("tile.woodSlab.oak.name", "Oak Wood Slab");
LANG_US.put("tile.woodSlab.spruce.name", "Spruce Wood Slab");
LANG_US.put("tile.woodSlab.birch.name", "Birch Wood Slab");
LANG_US.put("tile.woodSlab.jungle.name", "Jungle Wood Slab");
LANG_US.put("tile.woodSlab.acacia.name", "Acacia Wood Slab");
LANG_US.put("tile.woodSlab.big_oak.name", "Dark Oak Wood Slab");
LANG_US.put("tile.brick.name", "Bricks");
LANG_US.put("tile.tnt.name", "TNT");
LANG_US.put("tile.bookshelf.name", "Bookshelf");
LANG_US.put("tile.stoneMoss.name", "Moss Stone");
LANG_US.put("tile.obsidian.name", "Obsidian");
LANG_US.put("tile.torch.name", "Torch");
LANG_US.put("tile.fire.name", "Fire");
LANG_US.put("tile.mobSpawner.name", "Monster Spawner");
LANG_US.put("tile.stairsWood.name", "Oak Wood Stairs");
LANG_US.put("tile.stairsWoodSpruce.name", "Spruce Wood Stairs");
LANG_US.put("tile.stairsWoodBirch.name", "Birch Wood Stairs");
LANG_US.put("tile.stairsWoodJungle.name", "Jungle Wood Stairs");
LANG_US.put("tile.stairsWoodAcacia.name", "Acacia Wood Stairs");
LANG_US.put("tile.stairsWoodDarkOak.name", "Dark Oak Wood Stairs");
LANG_US.put("tile.chest.name", "Chest");
LANG_US.put("tile.chestTrap.name", "Trapped Chest");
LANG_US.put("tile.redstoneDust.name", "Redstone Dust");
LANG_US.put("tile.oreDiamond.name", "Diamond Ore");
LANG_US.put("tile.blockCoal.name", "Block of Coal");
LANG_US.put("tile.blockDiamond.name", "Block of Diamond");
LANG_US.put("tile.workbench.name", "Crafting Table");
LANG_US.put("tile.crops.name", "Crops");
LANG_US.put("tile.farmland.name", "Farmland");
LANG_US.put("tile.furnace.name", "Furnace");
LANG_US.put("tile.sign.name", "Sign");
LANG_US.put("tile.doorWood.name", "Wooden Door");
LANG_US.put("tile.ladder.name", "Ladder");
LANG_US.put("tile.rail.name", "Rail");
LANG_US.put("tile.goldenRail.name", "Powered Rail");
LANG_US.put("tile.activatorRail.name", "Activator Rail");
LANG_US.put("tile.detectorRail.name", "Detector Rail");
LANG_US.put("tile.stairsStone.name", "Cobblestone Stairs");
LANG_US.put("tile.stairsSandStone.name", "Sandstone Stairs");
LANG_US.put("tile.stairsRedSandStone.name", "Red Sandstone Stairs");
LANG_US.put("tile.lever.name", "Lever");
LANG_US.put("tile.pressurePlateStone.name", "Stone Pressure Plate");
LANG_US.put("tile.pressurePlateWood.name", "Wooden Pressure Plate");
LANG_US.put("tile.weightedPlate_light.name", "Weighted Pressure Plate (Light)");
LANG_US.put("tile.weightedPlate_heavy.name", "Weighted Pressure Plate (Heavy)");
LANG_US.put("tile.doorIron.name", "Iron Door");
LANG_US.put("tile.oreRedstone.name", "Redstone Ore");
LANG_US.put("tile.notGate.name", "Redstone Torch");
LANG_US.put("tile.button.name", "Button");
LANG_US.put("tile.snow.name", "Snow");
LANG_US.put("tile.woolCarpet.name", "Carpet");
LANG_US.put("tile.woolCarpet.black.name", "Black Carpet");
LANG_US.put("tile.woolCarpet.red.name", "Red Carpet");
LANG_US.put("tile.woolCarpet.green.name", "Green Carpet");
LANG_US.put("tile.woolCarpet.brown.name", "Brown Carpet");
LANG_US.put("tile.woolCarpet.blue.name", "Blue Carpet");
LANG_US.put("tile.woolCarpet.purple.name", "Purple Carpet");
LANG_US.put("tile.woolCarpet.cyan.name", "Cyan Carpet");
LANG_US.put("tile.woolCarpet.silver.name", "Light Gray Carpet");
LANG_US.put("tile.woolCarpet.gray.name", "Gray Carpet");
LANG_US.put("tile.woolCarpet.pink.name", "Pink Carpet");
LANG_US.put("tile.woolCarpet.lime.name", "Lime Carpet");
LANG_US.put("tile.woolCarpet.yellow.name", "Yellow Carpet");
LANG_US.put("tile.woolCarpet.lightBlue.name", "Light Blue Carpet");
LANG_US.put("tile.woolCarpet.magenta.name", "Magenta Carpet");
LANG_US.put("tile.woolCarpet.orange.name", "Orange Carpet");
LANG_US.put("tile.woolCarpet.white.name", "White Carpet");
LANG_US.put("tile.ice.name", "Ice");
LANG_US.put("tile.frostedIce.name", "Frosted Ice");
LANG_US.put("tile.icePacked.name", "Packed Ice");
LANG_US.put("tile.cactus.name", "Cactus");
LANG_US.put("tile.clay.name", "Clay");
LANG_US.put("tile.clayHardenedStained.name", "Stained Terracotta");
LANG_US.put("tile.clayHardenedStained.black.name", "Black Terracotta");
LANG_US.put("tile.clayHardenedStained.red.name", "Red Terracotta");
LANG_US.put("tile.clayHardenedStained.green.name", "Green Terracotta");
LANG_US.put("tile.clayHardenedStained.brown.name", "Brown Terracotta");
LANG_US.put("tile.clayHardenedStained.blue.name", "Blue Terracotta");
LANG_US.put("tile.clayHardenedStained.purple.name", "Purple Terracotta");
LANG_US.put("tile.clayHardenedStained.cyan.name", "Cyan Terracotta");
LANG_US.put("tile.clayHardenedStained.silver.name", "Light Gray Terracotta");
LANG_US.put("tile.clayHardenedStained.gray.name", "Gray Terracotta");
LANG_US.put("tile.clayHardenedStained.pink.name", "Pink Terracotta");
LANG_US.put("tile.clayHardenedStained.lime.name", "Lime Terracotta");
LANG_US.put("tile.clayHardenedStained.yellow.name", "Yellow Terracotta");
LANG_US.put("tile.clayHardenedStained.lightBlue.name", "Light Blue Terracotta");
LANG_US.put("tile.clayHardenedStained.magenta.name", "Magenta Terracotta");
LANG_US.put("tile.clayHardenedStained.orange.name", "Orange Terracotta");
LANG_US.put("tile.clayHardenedStained.white.name", "White Terracotta");
LANG_US.put("tile.clayHardened.name", "Terracotta");
LANG_US.put("tile.reeds.name", "Sugar cane");
LANG_US.put("tile.jukebox.name", "Jukebox");
LANG_US.put("tile.fence.name", "Oak Fence");
LANG_US.put("tile.spruceFence.name", "Spruce Fence");
LANG_US.put("tile.birchFence.name", "Birch Fence");
LANG_US.put("tile.jungleFence.name", "Jungle Fence");
LANG_US.put("tile.darkOakFence.name", "Dark Oak Fence");
LANG_US.put("tile.acaciaFence.name", "Acacia Fence");
LANG_US.put("tile.fenceGate.name", "Oak Fence Gate");
LANG_US.put("tile.spruceFenceGate.name", "Spruce Fence Gate");
LANG_US.put("tile.birchFenceGate.name", "Birch Fence Gate");
LANG_US.put("tile.jungleFenceGate.name", "Jungle Fence Gate");
LANG_US.put("tile.darkOakFenceGate.name", "Dark Oak Fence Gate");
LANG_US.put("tile.acaciaFenceGate.name", "Acacia Fence Gate");
LANG_US.put("tile.pumpkinStem.name", "Pumpkin Stem");
LANG_US.put("tile.pumpkin.name", "Pumpkin");
LANG_US.put("tile.litpumpkin.name", "Jack o'Lantern");
LANG_US.put("tile.hellrock.name", "Netherrack");
LANG_US.put("tile.hellsand.name", "Soul Sand");
LANG_US.put("tile.lightgem.name", "Glowstone");
LANG_US.put("tile.portal.name", "Portal");
LANG_US.put("tile.cloth.black.name", "Black Wool");
LANG_US.put("tile.cloth.red.name", "Red Wool");
LANG_US.put("tile.cloth.green.name", "Green Wool");
LANG_US.put("tile.cloth.brown.name", "Brown Wool");
LANG_US.put("tile.cloth.blue.name", "Blue Wool");
LANG_US.put("tile.cloth.purple.name", "Purple Wool");
LANG_US.put("tile.cloth.cyan.name", "Cyan Wool");
LANG_US.put("tile.cloth.silver.name", "Light Gray Wool");
LANG_US.put("tile.cloth.gray.name", "Gray Wool");
LANG_US.put("tile.cloth.pink.name", "Pink Wool");
LANG_US.put("tile.cloth.lime.name", "Lime Wool");
LANG_US.put("tile.cloth.yellow.name", "Yellow Wool");
LANG_US.put("tile.cloth.lightBlue.name", "Light Blue Wool");
LANG_US.put("tile.cloth.magenta.name", "Magenta Wool");
LANG_US.put("tile.cloth.orange.name", "Orange Wool");
LANG_US.put("tile.cloth.white.name", "White Wool");
LANG_US.put("tile.oreLapis.name", "Lapis Lazuli Ore");
LANG_US.put("tile.blockLapis.name", "Lapis Lazuli Block");
LANG_US.put("tile.dispenser.name", "Dispenser");
LANG_US.put("tile.dropper.name", "Dropper");
LANG_US.put("tile.musicBlock.name", "Note Block");
LANG_US.put("tile.cake.name", "Cake");
LANG_US.put("tile.bed.occupied", "This bed is occupied");
LANG_US.put("tile.bed.noSleep", "You can only sleep at night");
LANG_US.put("tile.bed.tooFarAway", "You may not rest now, the bed is too far away");
LANG_US.put("tile.bed.notSafe", "You may not rest now, there are monsters nearby");
LANG_US.put("tile.bed.notValid", "Your home bed was missing or obstructed");
LANG_US.put("tile.lockedchest.name", "Locked chest");
LANG_US.put("tile.trapdoor.name", "Wooden Trapdoor");
LANG_US.put("tile.ironTrapdoor.name", "Iron Trapdoor");
LANG_US.put("tile.web.name", "Cobweb");
LANG_US.put("tile.stonebricksmooth.name", "Stone Bricks");
LANG_US.put("tile.stonebricksmooth.default.name", "Stone Bricks");
LANG_US.put("tile.stonebricksmooth.mossy.name", "Mossy Stone Bricks");
LANG_US.put("tile.stonebricksmooth.cracked.name", "Cracked Stone Bricks");
LANG_US.put("tile.stonebricksmooth.chiseled.name", "Chiseled Stone Bricks");
LANG_US.put("tile.monsterStoneEgg.name", "Stone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.stone.name", "Stone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.cobble.name", "Cobblestone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.brick.name", "Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.mossybrick.name", "Mossy Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.crackedbrick.name", "Cracked Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.chiseledbrick.name", "Chiseled Stone Brick Monster Egg");
LANG_US.put("tile.pistonBase.name", "Piston");
LANG_US.put("tile.pistonStickyBase.name", "Sticky Piston");
LANG_US.put("tile.fenceIron.name", "Iron Bars");
LANG_US.put("tile.melon.name", "Melon");
LANG_US.put("tile.stairsBrick.name", "Brick Stairs");
LANG_US.put("tile.stairsStoneBrickSmooth.name", "Stone Brick Stairs");
LANG_US.put("tile.vine.name", "Vines");
LANG_US.put("tile.netherBrick.name", "Nether Brick");
LANG_US.put("tile.netherFence.name", "Nether Brick Fence");
LANG_US.put("tile.stairsNetherBrick.name", "Nether Brick Stairs");
LANG_US.put("tile.netherStalk.name", "Nether Wart");
LANG_US.put("tile.cauldron.name", "Cauldron");
LANG_US.put("tile.enchantmentTable.name", "Enchantment Table");
LANG_US.put("tile.anvil.name", "Anvil");
LANG_US.put("tile.anvil.intact.name", "Anvil");
LANG_US.put("tile.anvil.slightlyDamaged.name", "Slightly Damaged Anvil");
LANG_US.put("tile.anvil.veryDamaged.name", "Very Damaged Anvil");
LANG_US.put("tile.whiteStone.name", "End Stone");
LANG_US.put("tile.endPortalFrame.name", "End Portal");
LANG_US.put("tile.mycel.name", "Mycelium");
LANG_US.put("tile.waterlily.name", "Lily Pad");
LANG_US.put("tile.dragonEgg.name", "Dragon Egg");
LANG_US.put("tile.redstoneLight.name", "Redstone Lamp");
LANG_US.put("tile.cocoa.name", "Cocoa");
LANG_US.put("tile.enderChest.name", "Ender Chest");
LANG_US.put("tile.oreEmerald.name", "Emerald Ore");
LANG_US.put("tile.blockEmerald.name", "Block of Emerald");
LANG_US.put("tile.blockRedstone.name", "Block of Redstone");
LANG_US.put("tile.tripWire.name", "Tripwire");
LANG_US.put("tile.tripWireSource.name", "Tripwire Hook");
LANG_US.put("tile.commandBlock.name", "Command Block");
LANG_US.put("tile.repeatingCommandBlock.name", "Repeating Command Block");
LANG_US.put("tile.chainCommandBlock.name", "Chain Command Block");
LANG_US.put("tile.beacon.name", "Beacon");
LANG_US.put("tile.beacon.primary", "Primary Power");
LANG_US.put("tile.beacon.secondary", "Secondary Power");
LANG_US.put("tile.cobbleWall.normal.name", "Cobblestone Wall");
LANG_US.put("tile.cobbleWall.mossy.name", "Mossy Cobblestone Wall");
LANG_US.put("tile.carrots.name", "Carrots");
LANG_US.put("tile.potatoes.name", "Potatoes");
LANG_US.put("tile.daylightDetector.name", "Daylight Sensor");
LANG_US.put("tile.netherquartz.name", "Nether Quartz Ore");
LANG_US.put("tile.hopper.name", "Hopper");
LANG_US.put("tile.quartzBlock.name", "Block of Quartz");
LANG_US.put("tile.quartzBlock.default.name", "Block of Quartz");
LANG_US.put("tile.quartzBlock.chiseled.name", "Chiseled Quartz Block");
LANG_US.put("tile.quartzBlock.lines.name", "Pillar Quartz Block");
LANG_US.put("tile.stairsQuartz.name", "Quartz Stairs");
LANG_US.put("tile.slime.name", "Slime Block");
LANG_US.put("tile.prismarine.rough.name", "Prismarine");
LANG_US.put("tile.prismarine.bricks.name", "Prismarine Bricks");
LANG_US.put("tile.prismarine.dark.name", "Dark Prismarine");
LANG_US.put("tile.seaLantern.name", "Sea Lantern");
LANG_US.put("tile.endRod.name", "End Rod");
LANG_US.put("tile.chorusPlant.name", "Chorus Plant");
LANG_US.put("tile.chorusFlower.name", "Chorus Flower");
LANG_US.put("tile.purpurBlock.name", "Purpur Block");
LANG_US.put("tile.purpurPillar.name", "Purpur Pillar");
LANG_US.put("tile.stairsPurpur.name", "Purpur Stairs");
LANG_US.put("tile.purpurSlab.name", "Purpur Slab");
LANG_US.put("tile.endBricks.name", "End Stone Bricks");
LANG_US.put("tile.beetroots.name", "Beetroots");
LANG_US.put("tile.grassPath.name", "Grass Path");
LANG_US.put("tile.magma.name", "Magma Block");
LANG_US.put("tile.netherWartBlock.name", "Nether Wart Block");
LANG_US.put("tile.redNetherBrick.name", "Red Nether Brick");
LANG_US.put("tile.boneBlock.name", "Bone Block");
LANG_US.put("tile.observer.name", "Observer");
LANG_US.put("tile.shulkerBoxWhite.name", "White Shulker Box");
LANG_US.put("tile.shulkerBoxOrange.name", "Orange Shulker Box");
LANG_US.put("tile.shulkerBoxMagenta.name", "Magenta Shulker Box");
LANG_US.put("tile.shulkerBoxLightBlue.name", "Light Blue Shulker Box");
LANG_US.put("tile.shulkerBoxYellow.name", "Yellow Shulker Box");
LANG_US.put("tile.shulkerBoxLime.name", "Lime Shulker Box");
LANG_US.put("tile.shulkerBoxPink.name", "Pink Shulker Box");
LANG_US.put("tile.shulkerBoxGray.name", "Gray Shulker Box");
LANG_US.put("tile.shulkerBoxSilver.name", "Light Gray Shulker Box");
LANG_US.put("tile.shulkerBoxCyan.name", "Cyan Shulker Box");
LANG_US.put("tile.shulkerBoxPurple.name", "Purple Shulker Box");
LANG_US.put("tile.shulkerBoxBlue.name", "Blue Shulker Box");
LANG_US.put("tile.shulkerBoxBrown.name", "Brown Shulker Box");
LANG_US.put("tile.shulkerBoxGreen.name", "Green Shulker Box");
LANG_US.put("tile.shulkerBoxRed.name", "Red Shulker Box");
LANG_US.put("tile.shulkerBoxBlack.name", "Black Shulker Box");
LANG_US.put("tile.glazedTerracottaWhite.name", "White Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaOrange.name", "Orange Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaMagenta.name", "Magenta Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaLightBlue.name", "Light Blue Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaYellow.name", "Yellow Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaLime.name", "Lime Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaPink.name", "Pink Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaGray.name", "Gray Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaSilver.name", "Light Gray Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaCyan.name", "Cyan Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaPurple.name", "Purple Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBlue.name", "Blue Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBrown.name", "Brown Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaGreen.name", "Green Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaRed.name", "Red Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBlack.name", "Black Glazed Terracotta");
LANG_US.put("tile.concrete.black.name", "Black Concrete");
LANG_US.put("tile.concrete.red.name", "Red Concrete");
LANG_US.put("tile.concrete.green.name", "Green Concrete");
LANG_US.put("tile.concrete.brown.name", "Brown Concrete");
LANG_US.put("tile.concrete.blue.name", "Blue Concrete");
LANG_US.put("tile.concrete.purple.name", "Purple Concrete");
LANG_US.put("tile.concrete.cyan.name", "Cyan Concrete");
LANG_US.put("tile.concrete.silver.name", "Light Gray Concrete");
LANG_US.put("tile.concrete.gray.name", "Gray Concrete");
LANG_US.put("tile.concrete.pink.name", "Pink Concrete");
LANG_US.put("tile.concrete.lime.name", "Lime Concrete");
LANG_US.put("tile.concrete.yellow.name", "Yellow Concrete");
LANG_US.put("tile.concrete.lightBlue.name", "Light Blue Concrete");
LANG_US.put("tile.concrete.magenta.name", "Magenta Concrete");
LANG_US.put("tile.concrete.orange.name", "Orange Concrete");
LANG_US.put("tile.concrete.white.name", "White Concrete");
LANG_US.put("tile.concretePowder.black.name", "Black Concrete Powder");
LANG_US.put("tile.concretePowder.red.name", "Red Concrete Powder");
LANG_US.put("tile.concretePowder.green.name", "Green Concrete Powder");
LANG_US.put("tile.concretePowder.brown.name", "Brown Concrete Powder");
LANG_US.put("tile.concretePowder.blue.name", "Blue Concrete Powder");
LANG_US.put("tile.concretePowder.purple.name", "Purple Concrete Powder");
LANG_US.put("tile.concretePowder.cyan.name", "Cyan Concrete Powder");
LANG_US.put("tile.concretePowder.silver.name", "Light Gray Concrete Powder");
LANG_US.put("tile.concretePowder.gray.name", "Gray Concrete Powder");
LANG_US.put("tile.concretePowder.pink.name", "Pink Concrete Powder");
LANG_US.put("tile.concretePowder.lime.name", "Lime Concrete Powder");
LANG_US.put("tile.concretePowder.yellow.name", "Yellow Concrete Powder");
LANG_US.put("tile.concretePowder.lightBlue.name", "Light Blue Concrete Powder");
LANG_US.put("tile.concretePowder.magenta.name", "Magenta Concrete Powder");
LANG_US.put("tile.concretePowder.orange.name", "Orange Concrete Powder");
LANG_US.put("tile.concretePowder.white.name", "White Concrete Powder");
LANG_US.put("tile.structureVoid.name", "Structure Void");
LANG_US.put("tile.structureBlock.name", "Structure Block");
LANG_US.put("item.nameTag.name", "Name Tag");
LANG_US.put("item.leash.name", "Lead");
LANG_US.put("item.shovelIron.name", "Iron Shovel");
LANG_US.put("item.pickaxeIron.name", "Iron Pickaxe");
LANG_US.put("item.hatchetIron.name", "Iron Axe");
LANG_US.put("item.flintAndSteel.name", "Flint and Steel");
LANG_US.put("item.apple.name", "Apple");
LANG_US.put("item.cookie.name", "Cookie");
LANG_US.put("item.bow.name", "Bow");
LANG_US.put("item.arrow.name", "Arrow");
LANG_US.put("item.spectral_arrow.name", "Spectral Arrow");
LANG_US.put("item.tipped_arrow.name", "Tipped Arrow");
LANG_US.put("item.coal.name", "Coal");
LANG_US.put("item.charcoal.name", "Charcoal");
LANG_US.put("item.diamond.name", "Diamond");
LANG_US.put("item.emerald.name", "Emerald");
LANG_US.put("item.ingotIron.name", "Iron Ingot");
LANG_US.put("item.ingotGold.name", "Gold Ingot");
LANG_US.put("item.swordIron.name", "Iron Sword");
LANG_US.put("item.swordWood.name", "Wooden Sword");
LANG_US.put("item.shovelWood.name", "Wooden Shovel");
LANG_US.put("item.pickaxeWood.name", "Wooden Pickaxe");
LANG_US.put("item.hatchetWood.name", "Wooden Axe");
LANG_US.put("item.swordStone.name", "Stone Sword");
LANG_US.put("item.shovelStone.name", "Stone Shovel");
LANG_US.put("item.pickaxeStone.name", "Stone Pickaxe");
LANG_US.put("item.hatchetStone.name", "Stone Axe");
LANG_US.put("item.swordDiamond.name", "Diamond Sword");
LANG_US.put("item.shovelDiamond.name", "Diamond Shovel");
LANG_US.put("item.pickaxeDiamond.name", "Diamond Pickaxe");
LANG_US.put("item.hatchetDiamond.name", "Diamond Axe");
LANG_US.put("item.stick.name", "Stick");
LANG_US.put("item.bowl.name", "Bowl");
LANG_US.put("item.mushroomStew.name", "Mushroom Stew");
LANG_US.put("item.swordGold.name", "Golden Sword");
LANG_US.put("item.shovelGold.name", "Golden Shovel");
LANG_US.put("item.pickaxeGold.name", "Golden Pickaxe");
LANG_US.put("item.hatchetGold.name", "Golden Axe");
LANG_US.put("item.string.name", "String");
LANG_US.put("item.feather.name", "Feather");
LANG_US.put("item.sulphur.name", "Gunpowder");
LANG_US.put("item.hoeWood.name", "Wooden Hoe");
LANG_US.put("item.hoeStone.name", "Stone Hoe");
LANG_US.put("item.hoeIron.name", "Iron Hoe");
LANG_US.put("item.hoeDiamond.name", "Diamond Hoe");
LANG_US.put("item.hoeGold.name", "Golden Hoe");
LANG_US.put("item.seeds.name", "Seeds");
LANG_US.put("item.seeds_pumpkin.name", "Pumpkin Seeds");
LANG_US.put("item.seeds_melon.name", "Melon Seeds");
LANG_US.put("item.melon.name", "Melon");
LANG_US.put("item.wheat.name", "Wheat");
LANG_US.put("item.bread.name", "Bread");
LANG_US.put("item.helmetCloth.name", "Leather Cap");
LANG_US.put("item.chestplateCloth.name", "Leather Tunic");
LANG_US.put("item.leggingsCloth.name", "Leather Pants");
LANG_US.put("item.bootsCloth.name", "Leather Boots");
LANG_US.put("item.helmetChain.name", "Chain Helmet");
LANG_US.put("item.chestplateChain.name", "Chain Chestplate");
LANG_US.put("item.leggingsChain.name", "Chain Leggings");
LANG_US.put("item.bootsChain.name", "Chain Boots");
LANG_US.put("item.helmetIron.name", "Iron Helmet");
LANG_US.put("item.chestplateIron.name", "Iron Chestplate");
LANG_US.put("item.leggingsIron.name", "Iron Leggings");
LANG_US.put("item.bootsIron.name", "Iron Boots");
LANG_US.put("item.helmetDiamond.name", "Diamond Helmet");
LANG_US.put("item.chestplateDiamond.name", "Diamond Chestplate");
LANG_US.put("item.leggingsDiamond.name", "Diamond Leggings");
LANG_US.put("item.bootsDiamond.name", "Diamond Boots");
LANG_US.put("item.helmetGold.name", "Golden Helmet");
LANG_US.put("item.chestplateGold.name", "Golden Chestplate");
LANG_US.put("item.leggingsGold.name", "Golden Leggings");
LANG_US.put("item.bootsGold.name", "Golden Boots");
LANG_US.put("item.flint.name", "Flint");
LANG_US.put("item.porkchopRaw.name", "Raw Porkchop");
LANG_US.put("item.porkchopCooked.name", "Cooked Porkchop");
LANG_US.put("item.chickenRaw.name", "Raw Chicken");
LANG_US.put("item.chickenCooked.name", "Cooked Chicken");
LANG_US.put("item.muttonRaw.name", "Raw Mutton");
LANG_US.put("item.muttonCooked.name", "Cooked Mutton");
LANG_US.put("item.rabbitRaw.name", "Raw Rabbit");
LANG_US.put("item.rabbitCooked.name", "Cooked Rabbit");
LANG_US.put("item.rabbitStew.name", "Rabbit Stew");
LANG_US.put("item.rabbitFoot.name", "Rabbit's Foot");
LANG_US.put("item.rabbitHide.name", "Rabbit Hide");
LANG_US.put("item.beefRaw.name", "Raw Beef");
LANG_US.put("item.beefCooked.name", "Steak");
LANG_US.put("item.painting.name", "Painting");
LANG_US.put("item.frame.name", "Item Frame");
LANG_US.put("item.appleGold.name", "Golden Apple");
LANG_US.put("item.sign.name", "Sign");
LANG_US.put("item.doorOak.name", "Oak Door");
LANG_US.put("item.doorSpruce.name", "Spruce Door");
LANG_US.put("item.doorBirch.name", "Birch Door");
LANG_US.put("item.doorJungle.name", "Jungle Door");
LANG_US.put("item.doorAcacia.name", "Acacia Door");
LANG_US.put("item.doorDarkOak.name", "Dark Oak Door");
LANG_US.put("item.bucket.name", "Bucket");
LANG_US.put("item.bucketWater.name", "Water Bucket");
LANG_US.put("item.bucketLava.name", "Lava Bucket");
LANG_US.put("item.minecart.name", "Minecart");
LANG_US.put("item.saddle.name", "Saddle");
LANG_US.put("item.doorIron.name", "Iron Door");
LANG_US.put("item.redstone.name", "Redstone");
LANG_US.put("item.snowball.name", "Snowball");
LANG_US.put("item.boat.oak.name", "Oak Boat");
LANG_US.put("item.boat.spruce.name", "Spruce Boat");
LANG_US.put("item.boat.birch.name", "Birch Boat");
LANG_US.put("item.boat.jungle.name", "Jungle Boat");
LANG_US.put("item.boat.acacia.name", "Acacia Boat");
LANG_US.put("item.boat.dark_oak.name", "Dark Oak Boat");
LANG_US.put("item.leather.name", "Leather");
LANG_US.put("item.milk.name", "Milk");
LANG_US.put("item.brick.name", "Brick");
LANG_US.put("item.clay.name", "Clay");
LANG_US.put("item.reeds.name", "Sugar Canes");
LANG_US.put("item.paper.name", "Paper");
LANG_US.put("item.book.name", "Book");
LANG_US.put("item.slimeball.name", "Slimeball");
LANG_US.put("item.minecartChest.name", "Minecart with Chest");
LANG_US.put("item.minecartFurnace.name", "Minecart with Furnace");
LANG_US.put("item.minecartTnt.name", "Minecart with TNT");
LANG_US.put("item.minecartHopper.name", "Minecart with Hopper");
LANG_US.put("item.minecartCommandBlock.name", "Minecart with Command Block");
LANG_US.put("item.egg.name", "Egg");
LANG_US.put("item.compass.name", "Compass");
LANG_US.put("item.fishingRod.name", "Fishing Rod");
LANG_US.put("item.clock.name", "Clock");
LANG_US.put("item.yellowDust.name", "Glowstone Dust");
LANG_US.put("item.fish.cod.raw.name", "Raw Fish");
LANG_US.put("item.fish.salmon.raw.name", "Raw Salmon");
LANG_US.put("item.fish.pufferfish.raw.name", "Pufferfish");
LANG_US.put("item.fish.clownfish.raw.name", "Clownfish");
LANG_US.put("item.fish.cod.cooked.name", "Cooked Fish");
LANG_US.put("item.fish.salmon.cooked.name", "Cooked Salmon");
LANG_US.put("item.record.name", "Music Disc");
LANG_US.put("item.record.13.desc", "C418 - 13");
LANG_US.put("item.record.cat.desc", "C418 - cat");
LANG_US.put("item.record.blocks.desc", "C418 - blocks");
LANG_US.put("item.record.chirp.desc", "C418 - chirp");
LANG_US.put("item.record.far.desc", "C418 - far");
LANG_US.put("item.record.mall.desc", "C418 - mall");
LANG_US.put("item.record.mellohi.desc", "C418 - mellohi");
LANG_US.put("item.record.stal.desc", "C418 - stal");
LANG_US.put("item.record.strad.desc", "C418 - strad");
LANG_US.put("item.record.ward.desc", "C418 - ward");
LANG_US.put("item.record.11.desc", "C418 - 11");
LANG_US.put("item.record.wait.desc", "C418 - wait");
LANG_US.put("item.bone.name", "Bone");
LANG_US.put("item.dyePowder.black.name", "Ink Sac");
LANG_US.put("item.dyePowder.red.name", "Rose Red");
LANG_US.put("item.dyePowder.green.name", "Cactus Green");
LANG_US.put("item.dyePowder.brown.name", "Cocoa Beans");
LANG_US.put("item.dyePowder.blue.name", "Lapis Lazuli");
LANG_US.put("item.dyePowder.purple.name", "Purple Dye");
LANG_US.put("item.dyePowder.cyan.name", "Cyan Dye");
LANG_US.put("item.dyePowder.silver.name", "Light Gray Dye");
LANG_US.put("item.dyePowder.gray.name", "Gray Dye");
LANG_US.put("item.dyePowder.pink.name", "Pink Dye");
LANG_US.put("item.dyePowder.lime.name", "Lime Dye");
LANG_US.put("item.dyePowder.yellow.name", "Dandelion Yellow");
LANG_US.put("item.dyePowder.lightBlue.name", "Light Blue Dye");
LANG_US.put("item.dyePowder.magenta.name", "Magenta Dye");
LANG_US.put("item.dyePowder.orange.name", "Orange Dye");
LANG_US.put("item.dyePowder.white.name", "Bone Meal");
LANG_US.put("item.sugar.name", "Sugar");
LANG_US.put("item.cake.name", "Cake");
LANG_US.put("item.bed.black.name", "Black Bed");
LANG_US.put("item.bed.red.name", "Red Bed");
LANG_US.put("item.bed.green.name", "Green Bed");
LANG_US.put("item.bed.brown.name", "Brown Bed");
LANG_US.put("item.bed.blue.name", "Blue Bed");
LANG_US.put("item.bed.purple.name", "Purple Bed");
LANG_US.put("item.bed.cyan.name", "Cyan Bed");
LANG_US.put("item.bed.silver.name", "Light Gray Bed");
LANG_US.put("item.bed.gray.name", "Gray Bed");
LANG_US.put("item.bed.pink.name", "Pink Bed");
LANG_US.put("item.bed.lime.name", "Lime Bed");
LANG_US.put("item.bed.yellow.name", "Yellow Bed");
LANG_US.put("item.bed.lightBlue.name", "Light Blue Bed");
LANG_US.put("item.bed.magenta.name", "Magenta Bed");
LANG_US.put("item.bed.orange.name", "Orange Bed");
LANG_US.put("item.bed.white.name", "White Bed");
LANG_US.put("item.diode.name", "Redstone Repeater");
LANG_US.put("item.comparator.name", "Redstone Comparator");
LANG_US.put("item.map.name", "Map");
LANG_US.put("item.leaves.name", "Leaves");
LANG_US.put("item.shears.name", "Shears");
LANG_US.put("item.rottenFlesh.name", "Rotten Flesh");
LANG_US.put("item.enderPearl.name", "Ender Pearl");
LANG_US.put("item.blazeRod.name", "Blaze Rod");
LANG_US.put("item.ghastTear.name", "Ghast Tear");
LANG_US.put("item.netherStalkSeeds.name", "Nether Wart");
LANG_US.put("item.potion.name", "Potion");
LANG_US.put("item.splash_potion.name", "Splash Potion");
LANG_US.put("item.lingering_potion.name", "Lingering Potion");
LANG_US.put("item.end_crystal.name", "End Crystal");
LANG_US.put("item.goldNugget.name", "Gold Nugget");
LANG_US.put("item.glassBottle.name", "Glass Bottle");
LANG_US.put("item.spiderEye.name", "Spider Eye");
LANG_US.put("item.fermentedSpiderEye.name", "Fermented Spider Eye");
LANG_US.put("item.blazePowder.name", "Blaze Powder");
LANG_US.put("item.magmaCream.name", "Magma Cream");
LANG_US.put("item.cauldron.name", "Cauldron");
LANG_US.put("item.brewingStand.name", "Brewing Stand");
LANG_US.put("item.eyeOfEnder.name", "Eye of Ender");
LANG_US.put("item.speckledMelon.name", "Glistering Melon");
LANG_US.put("item.monsterPlacer.name", "Spawn");
LANG_US.put("item.expBottle.name", "Bottle o' Enchanting");
LANG_US.put("item.fireball.name", "Fire Charge");
LANG_US.put("item.writingBook.name", "Book and Quill");
LANG_US.put("item.writtenBook.name", "Written Book");
LANG_US.put("item.flowerPot.name", "Flower Pot");
LANG_US.put("item.emptyMap.name", "Empty Map");
LANG_US.put("item.carrots.name", "Carrot");
LANG_US.put("item.carrotGolden.name", "Golden Carrot");
LANG_US.put("item.potato.name", "Potato");
LANG_US.put("item.potatoBaked.name", "Baked Potato");
LANG_US.put("item.potatoPoisonous.name", "Poisonous Potato");
LANG_US.put("item.skull.skeleton.name", "Skeleton Skull");
LANG_US.put("item.skull.wither.name", "Wither Skeleton Skull");
LANG_US.put("item.skull.zombie.name", "Zombie Head");
LANG_US.put("item.skull.char.name", "Head");
LANG_US.put("item.skull.player.name", "%s's Head");
LANG_US.put("item.skull.creeper.name", "Creeper Head");
LANG_US.put("item.skull.dragon.name", "Dragon Head");
LANG_US.put("item.carrotOnAStick.name", "Carrot on a Stick");
LANG_US.put("item.netherStar.name", "Nether Star");
LANG_US.put("item.pumpkinPie.name", "Pumpkin Pie");
LANG_US.put("item.enchantedBook.name", "Enchanted Book");
LANG_US.put("item.fireworks.name", "Firework Rocket");
LANG_US.put("item.fireworks.flight", "Flight Duration:");
LANG_US.put("item.fireworksCharge.name", "Firework Star");
LANG_US.put("item.fireworksCharge.black", "Black");
LANG_US.put("item.fireworksCharge.red", "Red");
LANG_US.put("item.fireworksCharge.green", "Green");
LANG_US.put("item.fireworksCharge.brown", "Brown");
LANG_US.put("item.fireworksCharge.blue", "Blue");
LANG_US.put("item.fireworksCharge.purple", "Purple");
LANG_US.put("item.fireworksCharge.cyan", "Cyan");
LANG_US.put("item.fireworksCharge.silver", "Light Gray");
LANG_US.put("item.fireworksCharge.gray", "Gray");
LANG_US.put("item.fireworksCharge.pink", "Pink");
LANG_US.put("item.fireworksCharge.lime", "Lime");
LANG_US.put("item.fireworksCharge.yellow", "Yellow");
LANG_US.put("item.fireworksCharge.lightBlue", "Light Blue");
LANG_US.put("item.fireworksCharge.magenta", "Magenta");
LANG_US.put("item.fireworksCharge.orange", "Orange");
LANG_US.put("item.fireworksCharge.white", "White");
LANG_US.put("item.fireworksCharge.customColor", "Custom");
LANG_US.put("item.fireworksCharge.fadeTo", "Fade to");
LANG_US.put("item.fireworksCharge.flicker", "Twinkle");
LANG_US.put("item.fireworksCharge.trail", "Trail");
LANG_US.put("item.fireworksCharge.type.0", "Small Ball");
LANG_US.put("item.fireworksCharge.type.1", "Large Ball");
LANG_US.put("item.fireworksCharge.type.2", "Star-shaped");
LANG_US.put("item.fireworksCharge.type.3", "Creeper-shaped");
LANG_US.put("item.fireworksCharge.type.4", "Burst");
LANG_US.put("item.fireworksCharge.type", "Unknown Shape");
LANG_US.put("item.netherbrick.name", "Nether Brick");
LANG_US.put("item.netherquartz.name", "Nether Quartz");
LANG_US.put("item.armorStand.name", "Armor Stand");
LANG_US.put("item.horsearmormetal.name", "Iron Horse Armor");
LANG_US.put("item.horsearmorgold.name", "Gold Horse Armor");
LANG_US.put("item.horsearmordiamond.name", "Diamond Horse Armor");
LANG_US.put("item.prismarineShard.name", "Prismarine Shard");
LANG_US.put("item.prismarineCrystals.name", "Prismarine Crystals");
LANG_US.put("item.chorusFruit.name", "Chorus Fruit");
LANG_US.put("item.chorusFruitPopped.name", "Popped Chorus Fruit");
LANG_US.put("item.beetroot.name", "Beetroot");
LANG_US.put("item.beetroot_seeds.name", "Beetroot Seeds");
LANG_US.put("item.beetroot_soup.name", "Beetroot Soup");
LANG_US.put("item.dragon_breath.name", "Dragon's Breath");
LANG_US.put("item.elytra.name", "Elytra");
LANG_US.put("item.totem.name", "Totem of Undying");
LANG_US.put("item.shulkerShell.name", "Shulker Shell");
LANG_US.put("item.ironNugget.name", "Iron Nugget");
LANG_US.put("item.knowledgeBook.name", "Knowledge Book");
LANG_US.put("container.inventory", "Inventory");
LANG_US.put("container.hopper", "Item Hopper");
LANG_US.put("container.crafting", "Crafting");
LANG_US.put("container.dispenser", "Dispenser");
LANG_US.put("container.dropper", "Dropper");
LANG_US.put("container.furnace", "Furnace");
LANG_US.put("container.enchant", "Enchant");
LANG_US.put("container.enchant.lapis.one", "1 Lapis Lazuli");
LANG_US.put("container.enchant.lapis.many", "%s Lapis Lazuli");
LANG_US.put("container.enchant.level.one", "1 Enchantment Level");
LANG_US.put("container.enchant.level.many", "%s Enchantment Levels");
LANG_US.put("container.enchant.level.requirement", "Level requirement: %s");
LANG_US.put("container.enchant.clue", "%s . . . ?");
LANG_US.put("container.repair", "Repair & Name");
LANG_US.put("container.repair.cost", "Enchantment Cost: %1$s");
LANG_US.put("container.repair.expensive", "Too Expensive!");
LANG_US.put("container.creative", "Item Selection");
LANG_US.put("container.brewing", "Brewing Stand");
LANG_US.put("container.chest", "Chest");
LANG_US.put("container.chestDouble", "Large Chest");
LANG_US.put("container.enderchest", "Ender Chest");
LANG_US.put("container.beacon", "Beacon");
LANG_US.put("container.shulkerBox", "Shulker Box");
LANG_US.put("container.shulkerBox.more", "and %s more...");
LANG_US.put("container.spectatorCantOpen", "Unable to open. Loot not generated yet.");
LANG_US.put("container.isLocked", "%s is locked!");
LANG_US.put("structure_block.save_success", "Structure saved as '%s'");
LANG_US.put("structure_block.save_failure", "Unable to save structure '%s'");
LANG_US.put("structure_block.load_success", "Structure loaded from '%s'");
LANG_US.put("structure_block.load_prepare", "Structure '%s' position prepared");
LANG_US.put("structure_block.load_not_found", "Structure '%s' is not available");
LANG_US.put("structure_block.size_success", "Size successfully detected for '%s'");
LANG_US.put("structure_block.size_failure", "Unable to detect structure size, add corners with matching structure names");
LANG_US.put("structure_block.mode.save", "Save");
LANG_US.put("structure_block.mode.load", "Load");
LANG_US.put("structure_block.mode.data", "Data");
LANG_US.put("structure_block.mode.corner", "Corner");
LANG_US.put("structure_block.hover.save", "Save: %s");
LANG_US.put("structure_block.hover.load", "Load: %s");
LANG_US.put("structure_block.hover.data", "Data: %s");
LANG_US.put("structure_block.hover.corner", "Corner: %s");
LANG_US.put("structure_block.mode_info.save", "Save mode - write to file");
LANG_US.put("structure_block.mode_info.load", "Load mode - load from file");
LANG_US.put("structure_block.mode_info.data", "Data mode - game logic marker");
LANG_US.put("structure_block.mode_info.corner", "Corner mode - placement and size marker");
LANG_US.put("structure_block.structure_name", "Structure Name");
LANG_US.put("structure_block.custom_data", "Custom Data Tag Name");
LANG_US.put("structure_block.position", "Relative Position");
LANG_US.put("structure_block.size", "Structure Size");
LANG_US.put("structure_block.integrity", "Structure Integrity and Seed");
LANG_US.put("structure_block.include_entities", "Include entities:");
LANG_US.put("structure_block.detect_size", "Detect structure size and position:");
LANG_US.put("structure_block.button.detect_size", "DETECT");
LANG_US.put("structure_block.button.save", "SAVE");
LANG_US.put("structure_block.button.load", "LOAD");
LANG_US.put("structure_block.show_air", "Show invisible blocks:");
LANG_US.put("structure_block.show_boundingbox", "Show bounding box:");
LANG_US.put("item.dyed", "Dyed");
LANG_US.put("item.unbreakable", "Unbreakable");
LANG_US.put("item.canBreak", "Can break:");
LANG_US.put("item.canPlace", "Can be placed on:");
LANG_US.put("item.color", "Color: %s");
LANG_US.put("item.nbt_tags", "NBT: %s tag(s)");
LANG_US.put("item.durability", "Durability: %s / %s");
LANG_US.put("filled_map.mansion", "Woodland Explorer Map");
LANG_US.put("filled_map.monument", "Ocean Explorer Map");
LANG_US.put("filled_map.unknown", "Unknown Map");
LANG_US.put("filled_map.level", "(Level %s/%s)");
LANG_US.put("filled_map.scale", "Scaling at 1:%s");
LANG_US.put("entity.Item.name", "Item");
LANG_US.put("entity.XPOrb.name", "Experience Orb");
LANG_US.put("entity.SmallFireball.name", "Small Fireball");
LANG_US.put("entity.Fireball.name", "Fireball");
LANG_US.put("entity.DragonFireball.name", "Dragon Fireball");
LANG_US.put("entity.ThrownPotion.name", "Potion");
LANG_US.put("entity.Arrow.name", "Arrow");
LANG_US.put("entity.Snowball.name", "Snowball");
LANG_US.put("entity.Painting.name", "Painting");
LANG_US.put("entity.ArmorStand.name", "Armor Stand");
LANG_US.put("entity.Mob.name", "Mob");
LANG_US.put("entity.Monster.name", "Monster");
LANG_US.put("entity.Creeper.name", "Creeper");
LANG_US.put("entity.Skeleton.name", "Skeleton");
LANG_US.put("entity.WitherSkeleton.name", "Wither Skeleton");
LANG_US.put("entity.Stray.name", "Stray");
LANG_US.put("entity.Spider.name", "Spider");
LANG_US.put("entity.Giant.name", "Giant");
LANG_US.put("entity.Zombie.name", "Zombie");
LANG_US.put("entity.Husk.name", "Husk");
LANG_US.put("entity.Slime.name", "Slime");
LANG_US.put("entity.Ghast.name", "Ghast");
LANG_US.put("entity.PigZombie.name", "Zombie Pigman");
LANG_US.put("entity.Enderman.name", "Enderman");
LANG_US.put("entity.Endermite.name", "Endermite");
LANG_US.put("entity.Silverfish.name", "Silverfish");
LANG_US.put("entity.CaveSpider.name", "Cave Spider");
LANG_US.put("entity.Blaze.name", "Blaze");
LANG_US.put("entity.LavaSlime.name", "Magma Cube");
LANG_US.put("entity.MushroomCow.name", "Mooshroom");
LANG_US.put("entity.Villager.name", "Villager");
LANG_US.put("entity.ZombieVillager.name", "Zombie Villager");
LANG_US.put("entity.VillagerGolem.name", "Iron Golem");
LANG_US.put("entity.SnowMan.name", "Snow Golem");
LANG_US.put("entity.EnderDragon.name", "Ender Dragon");
LANG_US.put("entity.WitherBoss.name", "Wither");
LANG_US.put("entity.Witch.name", "Witch");
LANG_US.put("entity.Guardian.name", "Guardian");
LANG_US.put("entity.ElderGuardian.name", "Elder Guardian");
LANG_US.put("entity.Shulker.name", "Shulker");
LANG_US.put("entity.PolarBear.name", "Polar Bear");
LANG_US.put("entity.EvocationIllager.name", "Evoker");
LANG_US.put("entity.Vex.name", "Vex");
LANG_US.put("entity.VindicationIllager.name", "Vindicator");
LANG_US.put("entity.Parrot.name", "Parrot");
LANG_US.put("entity.IllusionIllager.name", "Illusioner");
LANG_US.put("entity.Villager.farmer", "Farmer");
LANG_US.put("entity.Villager.fisherman", "Fisherman");
LANG_US.put("entity.Villager.shepherd", "Shepherd");
LANG_US.put("entity.Villager.fletcher", "Fletcher");
LANG_US.put("entity.Villager.librarian", "Librarian");
LANG_US.put("entity.Villager.cleric", "Cleric");
LANG_US.put("entity.Villager.armor", "Armorer");
LANG_US.put("entity.Villager.weapon", "Weapon Smith");
LANG_US.put("entity.Villager.tool", "Tool Smith");
LANG_US.put("entity.Villager.butcher", "Butcher");
LANG_US.put("entity.Villager.leather", "Leatherworker");
LANG_US.put("entity.Villager.nitwit", "Nitwit");
LANG_US.put("entity.Villager.cartographer", "Cartographer");
LANG_US.put("entity.Pig.name", "Pig");
LANG_US.put("entity.Sheep.name", "Sheep");
LANG_US.put("entity.Cow.name", "Cow");
LANG_US.put("entity.Chicken.name", "Chicken");
LANG_US.put("entity.Squid.name", "Squid");
LANG_US.put("entity.Wolf.name", "Wolf");
LANG_US.put("entity.Ozelot.name", "Ocelot");
LANG_US.put("entity.Cat.name", "Cat");
LANG_US.put("entity.Bat.name", "Bat");
LANG_US.put("entity.Horse.name", "Horse");
LANG_US.put("entity.Donkey.name", "Donkey");
LANG_US.put("entity.Mule.name", "Mule");
LANG_US.put("entity.SkeletonHorse.name", "Skeleton Horse");
LANG_US.put("entity.ZombieHorse.name", "Zombie Horse");
LANG_US.put("entity.Rabbit.name", "Rabbit");
LANG_US.put("entity.KillerBunny.name", "The Killer Bunny");
LANG_US.put("entity.Llama.name", "Llama");
LANG_US.put("entity.PrimedTnt.name", "Block of TNT");
LANG_US.put("entity.FallingSand.name", "Falling Block");
LANG_US.put("entity.Minecart.name", "Minecart");
LANG_US.put("entity.MinecartHopper.name", "Minecart with Hopper");
LANG_US.put("entity.MinecartChest.name", "Minecart with Chest");
LANG_US.put("entity.Boat.name", "Boat");
LANG_US.put("entity.generic.name", "unknown");
LANG_US.put("death.fell.accident.ladder", "%1$s fell off a ladder");
LANG_US.put("death.fell.accident.vines", "%1$s fell off some vines");
LANG_US.put("death.fell.accident.water", "%1$s fell out of the water");
LANG_US.put("death.fell.accident.generic", "%1$s fell from a high place");
LANG_US.put("death.fell.killer", "%1$s was doomed to fall");
LANG_US.put("death.fell.assist", "%1$s was doomed to fall by %2$s");
LANG_US.put("death.fell.assist.item", "%1$s was doomed to fall by %2$s using %3$s");
LANG_US.put("death.fell.finish", "%1$s fell too far and was finished by %2$s");
LANG_US.put("death.fell.finish.item", "%1$s fell too far and was finished by %2$s using %3$s");
LANG_US.put("death.attack.lightningBolt", "%1$s was struck by lightning");
LANG_US.put("death.attack.inFire", "%1$s went up in flames");
LANG_US.put("death.attack.inFire.player", "%1$s walked into fire whilst fighting %2$s");
LANG_US.put("death.attack.onFire", "%1$s burned to death");
LANG_US.put("death.attack.onFire.player", "%1$s was burnt to a crisp whilst fighting %2$s");
LANG_US.put("death.attack.lava", "%1$s tried to swim in lava");
LANG_US.put("death.attack.lava.player", "%1$s tried to swim in lava to escape %2$s");
LANG_US.put("death.attack.hotFloor", "%1$s discovered floor was lava");
LANG_US.put("death.attack.hotFloor.player", "%1$s walked into danger zone due to %2$s");
LANG_US.put("death.attack.inWall", "%1$s suffocated in a wall");
LANG_US.put("death.attack.cramming", "%1$s was squished too much");
LANG_US.put("death.attack.drown", "%1$s drowned");
LANG_US.put("death.attack.drown.player", "%1$s drowned whilst trying to escape %2$s");
LANG_US.put("death.attack.starve", "%1$s starved to death");
LANG_US.put("death.attack.cactus", "%1$s was pricked to death");
LANG_US.put("death.attack.cactus.player", "%1$s walked into a cactus whilst trying to escape %2$s");
LANG_US.put("death.attack.generic", "%1$s died");
LANG_US.put("death.attack.explosion", "%1$s blew up");
LANG_US.put("death.attack.explosion.player", "%1$s was blown up by %2$s");
LANG_US.put("death.attack.magic", "%1$s was killed by magic");
LANG_US.put("death.attack.wither", "%1$s withered away");
LANG_US.put("death.attack.anvil", "%1$s was squashed by a falling anvil");
LANG_US.put("death.attack.fallingBlock", "%1$s was squashed by a falling block");
LANG_US.put("death.attack.mob", "%1$s was slain by %2$s");
LANG_US.put("death.attack.player", "%1$s was slain by %2$s");
LANG_US.put("death.attack.player.item", "%1$s was slain by %2$s using %3$s");
LANG_US.put("death.attack.arrow", "%1$s was shot by %2$s");
LANG_US.put("death.attack.arrow.item", "%1$s was shot by %2$s using %3$s");
LANG_US.put("death.attack.fireball", "%1$s was fireballed by %2$s");
LANG_US.put("death.attack.fireball.item", "%1$s was fireballed by %2$s using %3$s");
LANG_US.put("death.attack.thrown", "%1$s was pummeled by %2$s");
LANG_US.put("death.attack.thrown.item", "%1$s was pummeled by %2$s using %3$s");
LANG_US.put("death.attack.indirectMagic", "%1$s was killed by %2$s using magic");
LANG_US.put("death.attack.indirectMagic.item", "%1$s was killed by %2$s using %3$s");
LANG_US.put("death.attack.thorns", "%1$s was killed trying to hurt %2$s");
LANG_US.put("death.attack.fall", "%1$s hit the ground too hard");
LANG_US.put("death.attack.outOfWorld", "%1$s fell out of the world");
LANG_US.put("death.attack.dragonBreath", "%1$s was roasted in dragon breath");
LANG_US.put("death.attack.flyIntoWall", "%1$s experienced kinetic energy");
LANG_US.put("death.attack.fireworks", "%1$s went off with a bang");
LANG_US.put("deathScreen.respawn", "Respawn");
LANG_US.put("deathScreen.spectate", "Spectate world");
LANG_US.put("deathScreen.deleteWorld", "Delete world");
LANG_US.put("deathScreen.titleScreen", "Title screen");
LANG_US.put("deathScreen.score", "Score");
LANG_US.put("deathScreen.title.hardcore", "Game over!");
LANG_US.put("deathScreen.title", "You died!");
LANG_US.put("deathScreen.leaveServer", "Leave server");
LANG_US.put("deathScreen.quit.confirm", "Are you sure you want to quit?");
LANG_US.put("effect.none", "No Effects");
LANG_US.put("effect.moveSpeed", "Speed");
LANG_US.put("effect.moveSlowdown", "Slowness");
LANG_US.put("effect.digSpeed", "Haste");
LANG_US.put("effect.digSlowDown", "Mining Fatigue");
LANG_US.put("effect.damageBoost", "Strength");
LANG_US.put("effect.heal", "Instant Health");
LANG_US.put("effect.harm", "Instant Damage");
LANG_US.put("effect.jump", "Jump Boost");
LANG_US.put("effect.confusion", "Nausea");
LANG_US.put("effect.regeneration", "Regeneration");
LANG_US.put("effect.resistance", "Resistance");
LANG_US.put("effect.fireResistance", "Fire Resistance");
LANG_US.put("effect.waterBreathing", "Water Breathing");
LANG_US.put("effect.invisibility", "Invisibility");
LANG_US.put("effect.blindness", "Blindness");
LANG_US.put("effect.nightVision", "Night Vision");
LANG_US.put("effect.hunger", "Hunger");
LANG_US.put("effect.weakness", "Weakness");
LANG_US.put("effect.poison", "Poison");
LANG_US.put("effect.wither", "Wither");
LANG_US.put("effect.healthBoost", "Health Boost");
LANG_US.put("effect.absorption", "Absorption");
LANG_US.put("effect.saturation", "Saturation");
LANG_US.put("effect.glowing", "Glowing");
LANG_US.put("effect.luck", "Luck");
LANG_US.put("effect.unluck", "Bad Luck");
LANG_US.put("effect.levitation", "Levitation");
LANG_US.put("tipped_arrow.effect.empty", "Uncraftable Tipped Arrow");
LANG_US.put("tipped_arrow.effect.water", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.mundane", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.thick", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.awkward", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.night_vision", "Arrow of Night Vision");
LANG_US.put("tipped_arrow.effect.invisibility", "Arrow of Invisibility");
LANG_US.put("tipped_arrow.effect.leaping", "Arrow of Leaping");
LANG_US.put("tipped_arrow.effect.fire_resistance", "Arrow of Fire Resistance");
LANG_US.put("tipped_arrow.effect.swiftness", "Arrow of Swiftness");
LANG_US.put("tipped_arrow.effect.slowness", "Arrow of Slowness");
LANG_US.put("tipped_arrow.effect.water", "Arrow of Splashing");
LANG_US.put("tipped_arrow.effect.water_breathing", "Arrow of Water Breathing");
LANG_US.put("tipped_arrow.effect.healing", "Arrow of Healing");
LANG_US.put("tipped_arrow.effect.harming", "Arrow of Harming");
LANG_US.put("tipped_arrow.effect.poison", "Arrow of Poison");
LANG_US.put("tipped_arrow.effect.regeneration", "Arrow of Regeneration");
LANG_US.put("tipped_arrow.effect.strength", "Arrow of Strength");
LANG_US.put("tipped_arrow.effect.weakness", "Arrow of Weakness");
LANG_US.put("tipped_arrow.effect.levitation", "Arrow of Levitation");
LANG_US.put("tipped_arrow.effect.luck", "Arrow of Luck");
LANG_US.put("potion.whenDrank", "When Applied:");
LANG_US.put("potion.effect.empty", "Uncraftable Potion");
LANG_US.put("potion.effect.water", "Water Bottle");
LANG_US.put("potion.effect.mundane", "Mundane Potion");
LANG_US.put("potion.effect.thick", "Thick Potion");
LANG_US.put("potion.effect.awkward", "Awkward Potion");
LANG_US.put("potion.effect.night_vision", "Potion of Night Vision");
LANG_US.put("potion.effect.invisibility", "Potion of Invisibility");
LANG_US.put("potion.effect.leaping", "Potion of Leaping");
LANG_US.put("potion.effect.fire_resistance", "Potion of Fire Resistance");
LANG_US.put("potion.effect.swiftness", "Potion of Swiftness");
LANG_US.put("potion.effect.slowness", "Potion of Slowness");
LANG_US.put("potion.effect.water_breathing", "Potion of Water Breathing");
LANG_US.put("potion.effect.healing", "Potion of Healing");
LANG_US.put("potion.effect.harming", "Potion of Harming");
LANG_US.put("potion.effect.poison", "Potion of Poison");
LANG_US.put("potion.effect.regeneration", "Potion of Regeneration");
LANG_US.put("potion.effect.strength", "Potion of Strength");
LANG_US.put("potion.effect.weakness", "Potion of Weakness");
LANG_US.put("potion.effect.levitation", "Potion of Levitation");
LANG_US.put("potion.effect.luck", "Potion of Luck");
LANG_US.put("splash_potion.effect.empty", "Splash Uncraftable Potion");
LANG_US.put("splash_potion.effect.water", "Splash Water Bottle");
LANG_US.put("splash_potion.effect.mundane", "Mundane Splash Potion");
LANG_US.put("splash_potion.effect.thick", "Thick Splash Potion");
LANG_US.put("splash_potion.effect.awkward", "Awkward Splash Potion");
LANG_US.put("splash_potion.effect.night_vision", "Splash Potion of Night Vision");
LANG_US.put("splash_potion.effect.invisibility", "Splash Potion of Invisibility");
LANG_US.put("splash_potion.effect.leaping", "Splash Potion of Leaping");
LANG_US.put("splash_potion.effect.fire_resistance", "Splash Potion of Fire Resistance");
LANG_US.put("splash_potion.effect.swiftness", "Splash Potion of Swiftness");
LANG_US.put("splash_potion.effect.slowness", "Splash Potion of Slowness");
LANG_US.put("splash_potion.effect.water_breathing", "Splash Potion of Water Breathing");
LANG_US.put("splash_potion.effect.healing", "Splash Potion of Healing");
LANG_US.put("splash_potion.effect.harming", "Splash Potion of Harming");
LANG_US.put("splash_potion.effect.poison", "Splash Potion of Poison");
LANG_US.put("splash_potion.effect.regeneration", "Splash Potion of Regeneration");
LANG_US.put("splash_potion.effect.strength", "Splash Potion of Strength");
LANG_US.put("splash_potion.effect.weakness", "Splash Potion of Weakness");
LANG_US.put("splash_potion.effect.levitation", "Splash Potion of Levitation");
LANG_US.put("splash_potion.effect.luck", "Splash Potion of Luck");
LANG_US.put("lingering_potion.effect.empty", "Lingering Uncraftable Potion");
LANG_US.put("lingering_potion.effect.water", "Lingering Water Bottle");
LANG_US.put("lingering_potion.effect.mundane", "Mundane Lingering Potion");
LANG_US.put("lingering_potion.effect.thick", "Thick Lingering Potion");
LANG_US.put("lingering_potion.effect.awkward", "Awkward Lingering Potion");
LANG_US.put("lingering_potion.effect.night_vision", "Lingering Potion of Night Vision");
LANG_US.put("lingering_potion.effect.invisibility", "Lingering Potion of Invisibility");
LANG_US.put("lingering_potion.effect.leaping", "Lingering Potion of Leaping");
LANG_US.put("lingering_potion.effect.fire_resistance", "Lingering Potion of Fire Resistance");
LANG_US.put("lingering_potion.effect.swiftness", "Lingering Potion of Swiftness");
LANG_US.put("lingering_potion.effect.slowness", "Lingering Potion of Slowness");
LANG_US.put("lingering_potion.effect.water_breathing", "Lingering Potion of Water Breathing");
LANG_US.put("lingering_potion.effect.healing", "Lingering Potion of Healing");
LANG_US.put("lingering_potion.effect.harming", "Lingering Potion of Harming");
LANG_US.put("lingering_potion.effect.poison", "Lingering Potion of Poison");
LANG_US.put("lingering_potion.effect.regeneration", "Lingering Potion of Regeneration");
LANG_US.put("lingering_potion.effect.strength", "Lingering Potion of Strength");
LANG_US.put("lingering_potion.effect.weakness", "Lingering Potion of Weakness");
LANG_US.put("lingering_potion.effect.levitation", "Lingering Potion of Levitation");
LANG_US.put("lingering_potion.effect.luck", "Lingering Potion of Luck");
LANG_US.put("potion.potency.0=", "");
LANG_US.put("potion.potency.1", "II");
LANG_US.put("potion.potency.2", "III");
LANG_US.put("enchantment.damage.all", "Sharpness");
LANG_US.put("enchantment.damage.undead", "Smite");
LANG_US.put("enchantment.damage.arthropods", "Bane of Arthropods");
LANG_US.put("enchantment.knockback", "Knockback");
LANG_US.put("enchantment.fire", "Fire Aspect");
LANG_US.put("enchantment.sweeping", "Sweeping Edge");
LANG_US.put("enchantment.protect.all", "Protection");
LANG_US.put("enchantment.protect.fire", "Fire Protection");
LANG_US.put("enchantment.protect.fall", "Feather Falling");
LANG_US.put("enchantment.protect.explosion", "Blast Protection");
LANG_US.put("enchantment.protect.projectile", "Projectile Protection");
LANG_US.put("enchantment.oxygen", "Respiration");
LANG_US.put("enchantment.waterWorker", "Aqua Affinity");
LANG_US.put("enchantment.waterWalker", "Depth Strider");
LANG_US.put("enchantment.frostWalker", "Frost Walker");
LANG_US.put("enchantment.digging", "Efficiency");
LANG_US.put("enchantment.untouching", "Silk Touch");
LANG_US.put("enchantment.durability", "Unbreaking");
LANG_US.put("enchantment.lootBonus", "Looting");
LANG_US.put("enchantment.lootBonusDigger", "Fortune");
LANG_US.put("enchantment.lootBonusFishing", "Luck of the Sea");
LANG_US.put("enchantment.fishingSpeed", "Lure");
LANG_US.put("enchantment.arrowDamage", "Power");
LANG_US.put("enchantment.arrowFire", "Flame");
LANG_US.put("enchantment.arrowKnockback", "Punch");
LANG_US.put("enchantment.arrowInfinite", "Infinity");
LANG_US.put("enchantment.thorns", "Thorns");
LANG_US.put("enchantment.mending", "Mending");
LANG_US.put("enchantment.binding_curse", "Curse of Binding");
LANG_US.put("enchantment.vanishing_curse", "Curse of Vanishing");
LANG_US.put("enchantment.level.1", "I");
LANG_US.put("enchantment.level.2", "II");
LANG_US.put("enchantment.level.3", "III");
LANG_US.put("enchantment.level.4", "IV");
LANG_US.put("enchantment.level.5", "V");
LANG_US.put("enchantment.level.6", "VI");
LANG_US.put("enchantment.level.7", "VII");
LANG_US.put("enchantment.level.8", "VIII");
LANG_US.put("enchantment.level.9", "IX");
LANG_US.put("enchantment.level.10", "X");
LANG_US.put("gui.advancements", "Advancements");
LANG_US.put("gui.stats", "Statistics");
LANG_US.put("advancements.empty", "There doesn't seem to be anything here...");
LANG_US.put("advancements.toast.task", "Advancement Made!");
LANG_US.put("advancements.toast.challenge", "Challenge Complete!");
LANG_US.put("advancements.toast.goal", "Goal Reached!");
LANG_US.put("stats.tooltip.type.statistic", "Statistic");
LANG_US.put("stat.generalButton", "General");
LANG_US.put("stat.blocksButton", "Blocks");
LANG_US.put("stat.itemsButton", "Items");
LANG_US.put("stat.mobsButton", "Mobs");
LANG_US.put("stat.used", "Times Used");
LANG_US.put("stat.mined", "Times Mined");
LANG_US.put("stat.depleted", "Times Depleted");
LANG_US.put("stat.crafted", "Times Crafted");
LANG_US.put("stat.entityKills", "You killed %s %s");
LANG_US.put("stat.entityKilledBy", "%s killed you %s time(s)");
LANG_US.put("stat.entityKills.none", "You have never killed %s");
LANG_US.put("stat.entityKilledBy.none", "You have never been killed by %s");
LANG_US.put("stat.startGame", "Times Played");
LANG_US.put("stat.createWorld", "Worlds Created");
LANG_US.put("stat.loadWorld", "Saves Loaded");
LANG_US.put("stat.joinMultiplayer", "Multiplayer Joins");
LANG_US.put("stat.leaveGame", "Games Quit");
LANG_US.put("stat.playOneMinute", "Time Played");
LANG_US.put("stat.timeSinceDeath", "Since Last Death");
LANG_US.put("stat.sneakTime", "Sneak Time");
LANG_US.put("stat.walkOneCm", "Distance Walked");
LANG_US.put("stat.crouchOneCm", "Distance Crouched");
LANG_US.put("stat.sprintOneCm", "Distance Sprinted");
LANG_US.put("stat.fallOneCm", "Distance Fallen");
LANG_US.put("stat.swimOneCm", "Distance Swum");
LANG_US.put("stat.flyOneCm", "Distance Flown");
LANG_US.put("stat.climbOneCm", "Distance Climbed");
LANG_US.put("stat.diveOneCm", "Distance Dove");
LANG_US.put("stat.minecartOneCm", "Distance by Minecart");
LANG_US.put("stat.boatOneCm", "Distance by Boat");
LANG_US.put("stat.pigOneCm", "Distance by Pig");
LANG_US.put("stat.horseOneCm", "Distance by Horse");
LANG_US.put("stat.aviateOneCm", "Distance by Elytra");
LANG_US.put("stat.jump", "Jumps");
LANG_US.put("stat.drop", "Items Dropped");
LANG_US.put("stat.dropped", "Dropped");
LANG_US.put("stat.pickup", "Picked Up");
LANG_US.put("stat.damageDealt", "Damage Dealt");
LANG_US.put("stat.damageTaken", "Damage Taken");
LANG_US.put("stat.deaths", "Number of Deaths");
LANG_US.put("stat.mobKills", "Mob Kills");
LANG_US.put("stat.animalsBred", "Animals Bred");
LANG_US.put("stat.playerKills", "Player Kills");
LANG_US.put("stat.fishCaught", "Fish Caught");
LANG_US.put("stat.treasureFished", "Treasure Fished");
LANG_US.put("stat.junkFished", "Junk Fished");
LANG_US.put("stat.talkedToVillager", "Talked to Villagers");
LANG_US.put("stat.tradedWithVillager", "Traded with Villagers");
LANG_US.put("stat.cakeSlicesEaten", "Cake Slices Eaten");
LANG_US.put("stat.cauldronFilled", "Cauldrons Filled");
LANG_US.put("stat.cauldronUsed", "Water Taken from Cauldron");
LANG_US.put("stat.armorCleaned", "Armor Pieces Cleaned");
LANG_US.put("stat.bannerCleaned", "Banners Cleaned");
LANG_US.put("stat.brewingstandInteraction", "Interactions with Brewing Stand");
LANG_US.put("stat.beaconInteraction", "Interactions with Beacon");
LANG_US.put("stat.dropperInspected", "Droppers Searched");
LANG_US.put("stat.hopperInspected", "Hoppers Searched");
LANG_US.put("stat.dispenserInspected", "Dispensers Searched");
LANG_US.put("stat.noteblockPlayed", "Note Blocks Played");
LANG_US.put("stat.noteblockTuned", "Note Blocks Tuned");
LANG_US.put("stat.flowerPotted", "Plants Potted");
LANG_US.put("stat.trappedChestTriggered", "Trapped Chests Triggered");
LANG_US.put("stat.enderchestOpened", "Ender Chests Opened");
LANG_US.put("stat.itemEnchanted", "Items Enchanted");
LANG_US.put("stat.recordPlayed", "Records Played");
LANG_US.put("stat.furnaceInteraction", "Interactions with Furnace");
LANG_US.put("stat.workbenchInteraction", "Interactions with Crafting Table");
LANG_US.put("stat.chestOpened", "Chests Opened");
LANG_US.put("stat.shulkerBoxOpened", "Shulker Boxes Opened");
LANG_US.put("stat.sleepInBed", "Times Slept in a Bed");
LANG_US.put("stat.mineBlock", "%1$s Mined");
LANG_US.put("stat.craftItem", "%1$s Crafted");
LANG_US.put("stat.useItem", "%1$s Used");
LANG_US.put("stat.breakItem", "%1$s Depleted");
LANG_US.put("recipe.toast.title", "New Recipes Unlocked!");
LANG_US.put("recipe.toast.description", "Check your recipe book");
LANG_US.put("commands.generic.exception", "An unknown error occurred while attempting to perform this command");
LANG_US.put("commands.generic.permission", "You do not have permission to use this command");
LANG_US.put("commands.generic.syntax", "Invalid command syntax");
LANG_US.put("commands.generic.player.notFound", "Player '%s' cannot be found");
LANG_US.put("commands.generic.entity.notFound", "Entity '%s' cannot be found");
LANG_US.put("commands.generic.selector.notFound", "Selector '%s' found nothing");
LANG_US.put("commands.generic.entity.invalidUuid", "The entity UUID '%s' is in an invalid format");
LANG_US.put("commands.generic.entity.invalidType", "Entity type '%s' is invalid");
LANG_US.put("commands.generic.notFound", "Unknown command. Try /help for a list of commands");
LANG_US.put("commands.generic.parameter.invalid", "'%s' is not a valid parameter");
LANG_US.put("commands.generic.num.invalid", "'%s' is not a valid number");
LANG_US.put("commands.generic.boolean.invalid", "'%s' is not true or false");
LANG_US.put("commands.generic.num.tooSmall", "The number you have entered (%s) is too small, it must be at least %s");
LANG_US.put("commands.generic.num.tooBig", "The number you have entered (%s) is too big, it must be at most %s");
LANG_US.put("commands.generic.blockstate.invalid", "'%s' is not a state for block %s");
LANG_US.put("commands.generic.usage", "Usage: %s");
LANG_US.put("commands.generic.selector_argument", "Invalid selector argument: '%s'");
LANG_US.put("commands.generic.player.unspecified", "You must specify which player you wish to perform this action on.");
LANG_US.put("commands.setidletimeout.usage", "/setidletimeout <minutes>");
LANG_US.put("commands.setidletimeout.success", "Successfully set the idle timeout to %s minutes.");
LANG_US.put("commands.xp.failure.widthdrawXp", "Cannot give player negative experience points");
LANG_US.put("commands.xp.success", "Given %s experience to %s");
LANG_US.put("commands.xp.success.levels", "Given %s levels to %s");
LANG_US.put("commands.xp.success.negative.levels", "Taken %s levels from %s");
LANG_US.put("commands.xp.usage", "/xp <amount> [player] OR /xp <amount>L [player]");
LANG_US.put("commands.playsound.usage", "/playsound <sound> <source> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]");
LANG_US.put("commands.playsound.success", "Played sound '%s' to %s");
LANG_US.put("commands.playsound.playerTooFar", "Player %s is too far away to hear the sound");
LANG_US.put("commands.playsound.unknownSoundSource", "Source %s is unknown");
LANG_US.put("commands.give.usage", "/give <player> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.give.item.notFound", "There is no such item with name %s");
LANG_US.put("commands.give.block.notFound", "There is no such block with name %s");
LANG_US.put("commands.give.success", "Given %s * %s to %s");
LANG_US.put("commands.give.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.replaceitem.usage", "/replaceitem <entity|block> ...");
LANG_US.put("commands.replaceitem.entity.usage", "/replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.replaceitem.block.usage", "/replaceitem block <x> <y> <z> <slot> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.replaceitem.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.replaceitem.noContainer", "Block at %s, %s, %s is not a container");
LANG_US.put("commands.replaceitem.failed", "Could not replace slot %s with %s * %s");
LANG_US.put("commands.replaceitem.success", "Replaced slot %s with %s * %s");
LANG_US.put("commands.stats.usage", "/stats <entity|block> ...");
LANG_US.put("commands.stats.entity.usage", "/stats entity <selector> <mode> ...");
LANG_US.put("commands.stats.entity.set.usage", "/stats entity <selector> set <stat> <selector> <objective>");
LANG_US.put("commands.stats.entity.clear.usage", "/stats entity <selector> clear <stat>");
LANG_US.put("commands.stats.block.usage", "/stats block <x> <y> <z> <mode> ...");
LANG_US.put("commands.stats.block.set.usage", "/stats block <x> <y> <z> set <stat> <selector> <objective>");
LANG_US.put("commands.stats.block.clear.usage", "/stats block <x> <y> <z> clear <stat>");
LANG_US.put("commands.stats.noCompatibleBlock", "Block at %s, %s, %s can not track stats");
LANG_US.put("commands.stats.failed", "Invalid parameters");
LANG_US.put("commands.stats.cleared", "Cleared %s stats");
LANG_US.put("commands.stats.success", "Storing %s stats in %s on %s");
LANG_US.put("commands.summon.usage", "/summon <entityname> [x] [y] [z] [dataTag]");
LANG_US.put("commands.summon.success", "Object successfully summoned");
LANG_US.put("commands.summon.failed", "Unable to summon object");
LANG_US.put("commands.summon.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.summon.outOfWorld", "Cannot summon the object out of the world");
LANG_US.put("commands.testforblock.usage", "/testforblock <x> <y> <z> <block> [dataValue|-1|state|*] [dataTag]");
LANG_US.put("commands.testforblock.failed.tile", "The block at %s, %s, %s is %s (expected: %s)");
LANG_US.put("commands.testforblock.failed.data", "The block at %s, %s, %s had the data value of %s (expected: %s)");
LANG_US.put("commands.testforblock.failed.nbt", "The block at %s, %s, %s did not have the required NBT keys");
LANG_US.put("commands.testforblock.failed.tileEntity", "The block at %s, %s, %s is not a block entity and cannot support tag matching");
LANG_US.put("commands.testforblock.success", "Successfully found the block at %s, %s, %s");
LANG_US.put("commands.testforblock.outOfWorld", "Cannot test for block outside of the world");
LANG_US.put("commands.setblock.usage", "/setblock <x> <y> <z> <block> [dataValue|state] [oldBlockHandling] [dataTag]");
LANG_US.put("commands.setblock.success", "Block placed");
LANG_US.put("commands.setblock.failed", "Unable to place block");
LANG_US.put("commands.setblock.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.setblock.outOfWorld", "Cannot place block outside of the world");
LANG_US.put("commands.setblock.notFound", "There is no such block with ID/name %s");
LANG_US.put("commands.setblock.noChange", "The block couldn't be placed");
LANG_US.put("commands.fill.usage", "/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [dataValue|state] [oldBlockHandling] [dataTag]");
LANG_US.put("commands.fill.outOfWorld", "Cannot place blocks outside of the world");
LANG_US.put("commands.fill.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.fill.success", "%s blocks filled");
LANG_US.put("commands.fill.failed", "No blocks filled");
LANG_US.put("commands.fill.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.clone.usage", "/clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [maskMode] [cloneMode]");
LANG_US.put("commands.clone.outOfWorld", "Cannot access blocks outside of the world");
LANG_US.put("commands.clone.noOverlap", "Source and destination can not overlap");
LANG_US.put("commands.clone.success", "%s blocks cloned");
LANG_US.put("commands.clone.failed", "No blocks cloned");
LANG_US.put("commands.clone.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.compare.usage", "/testforblocks <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]");
LANG_US.put("commands.compare.outOfWorld", "Cannot access blocks outside of the world");
LANG_US.put("commands.compare.failed", "Source and destination are not identical");
LANG_US.put("commands.compare.success", "%s blocks compared");
LANG_US.put("commands.compare.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.blockdata.usage", "/blockdata <x> <y> <z> <dataTag>");
LANG_US.put("commands.blockdata.success", "Block data updated to: %s");
LANG_US.put("commands.blockdata.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.blockdata.outOfWorld", "Cannot change block outside of the world");
LANG_US.put("commands.blockdata.notValid", "The target block is not a data holder block");
LANG_US.put("commands.blockdata.failed", "The data tag did not change: %s");
LANG_US.put("commands.entitydata.usage", "/entitydata <entity> <dataTag>");
LANG_US.put("commands.entitydata.success", "Entity data updated to: %s");
LANG_US.put("commands.entitydata.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.entitydata.noPlayers", "%s is a player and cannot be changed");
LANG_US.put("commands.entitydata.failed", "The data tag did not change: %s");
LANG_US.put("commands.effect.usage", "/effect <player> <effect> [seconds] [amplifier] [hideParticles] OR /effect <player> clear");
LANG_US.put("commands.effect.notFound", "There is no such mob effect with ID %s");
LANG_US.put("commands.effect.success", "Given %1$s (ID %2$s) * %3$s to %4$s for %5$s seconds");
LANG_US.put("commands.effect.success.removed", "Took %1$s from %2$s");
LANG_US.put("commands.effect.success.removed.all", "Took all effects from %s");
LANG_US.put("commands.effect.failure.notActive", "Couldn't take %1$s from %2$s as they do not have the effect");
LANG_US.put("commands.effect.failure.notActive.all", "Couldn't take any effects from %s as they do not have any");
LANG_US.put("commands.enchant.usage", "/enchant <player> <enchantment ID> [level]");
LANG_US.put("commands.enchant.notFound", "There is no such enchantment with ID %s");
LANG_US.put("commands.enchant.noItem", "The target doesn't hold an item");
LANG_US.put("commands.enchant.cantEnchant", "The selected enchantment can't be added to the target item");
LANG_US.put("commands.enchant.cantCombine", "%1$s can't be combined with %2$s");
LANG_US.put("commands.enchant.success", "Enchanting succeeded");
LANG_US.put("commands.particle.usage", "/particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [mode] [player] [params]");
LANG_US.put("commands.particle.success", "Playing effect %s for %s times");
LANG_US.put("commands.particle.notFound", "Unknown effect name (%s)");
LANG_US.put("commands.particle.invalidParam", "Invalid param given (%s)");
LANG_US.put("commands.clear.usage", "/clear [player] [item] [data] [maxCount] [dataTag]");
LANG_US.put("commands.clear.success", "Cleared the inventory of %s, removing %s items");
LANG_US.put("commands.clear.testing", "%s has %s items that match the criteria");
LANG_US.put("commands.clear.failure", "Could not clear the inventory of %s, no items to remove");
LANG_US.put("commands.clear.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.downfall.usage", "/toggledownfall");
LANG_US.put("commands.downfall.success", "Toggled downfall");
LANG_US.put("commands.time.usage", "/time <set|add|query> <value>");
LANG_US.put("commands.time.added", "Added %s to the time");
LANG_US.put("commands.time.set", "Set the time to %s");
LANG_US.put("commands.time.query", "Time is %s");
LANG_US.put("commands.players.usage", "/list");
LANG_US.put("commands.players.list", "There are %s/%s players online:");
LANG_US.put("commands.banlist.ips", "There are %s total banned IP addresses:");
LANG_US.put("commands.banlist.players", "There are %s total banned players:");
LANG_US.put("commands.banlist.usage", "/banlist [ips|players]");
LANG_US.put("commands.kill.usage", "/kill [player|entity]");
LANG_US.put("commands.kill.successful", "Killed %s");
LANG_US.put("commands.kick.success", "Kicked %s from the game");
LANG_US.put("commands.kick.success.reason", "Kicked %s from the game: '%s'");
LANG_US.put("commands.kick.usage", "/kick <player> [reason ...]");
LANG_US.put("commands.op.success", "Opped %s");
LANG_US.put("commands.op.failed", "Could not op %s");
LANG_US.put("commands.op.usage", "/op <player>");
LANG_US.put("commands.deop.success", "De-opped %s");
LANG_US.put("commands.deop.failed", "Could not de-op %s");
LANG_US.put("commands.deop.usage", "/deop <player>");
LANG_US.put("commands.say.usage", "/say <message ...>");
LANG_US.put("commands.ban.success", "Banned player %s");
LANG_US.put("commands.ban.failed", "Could not ban player %s");
LANG_US.put("commands.ban.usage", "/ban <name> [reason ...]");
LANG_US.put("commands.unban.success", "Unbanned player %s");
LANG_US.put("commands.unban.failed", "Could not unban player %s");
LANG_US.put("commands.unban.usage", "/pardon <name>");
LANG_US.put("commands.banip.invalid", "You have entered an invalid IP address or a player that is not online");
LANG_US.put("commands.banip.success", "Banned IP address %s");
LANG_US.put("commands.banip.success.players", "Banned IP address %s belonging to %s");
LANG_US.put("commands.banip.usage", "/ban-ip <address|name> [reason ...]");
LANG_US.put("commands.unbanip.invalid", "You have entered an invalid IP address");
LANG_US.put("commands.unbanip.success", "Unbanned IP address %s");
LANG_US.put("commands.unbanip.usage", "/pardon-ip <address>");
LANG_US.put("commands.save.usage", "/save-all [flush]");
LANG_US.put("commands.save-on.alreadyOn", "Saving is already turned on");
LANG_US.put("commands.save-on.usage", "/save-on");
LANG_US.put("commands.save-off.alreadyOff", "Saving is already turned off");
LANG_US.put("commands.save-off.usage", "/save-off");
LANG_US.put("commands.save.enabled", "Turned on world auto-saving");
LANG_US.put("commands.save.disabled", "Turned off world auto-saving");
LANG_US.put("commands.save.start", "Saving...");
LANG_US.put("commands.save.success", "Saved the world");
LANG_US.put("commands.save.failed", "Saving failed: %s");
LANG_US.put("commands.save.flushStart", "Flushing all saves...");
LANG_US.put("commands.save.flushEnd", "Flushing completed");
LANG_US.put("commands.stop.usage", "/stop");
LANG_US.put("commands.stop.start", "Stopping the server");
LANG_US.put("commands.tp.usage", "/tp [target player] <destination player> OR /tp [target player] <x> <y> <z> [<yaw> <pitch>]");
LANG_US.put("commands.tp.success", "Teleported %s to %s");
LANG_US.put("commands.tp.success.coordinates", "Teleported %s to %s, %s, %s");
LANG_US.put("commands.tp.notSameDimension", "Unable to teleport because players are not in the same dimension");
LANG_US.put("commands.teleport.usage", "/teleport <entity> <x> <y> <z> [<y-rot> <x-rot>]");
LANG_US.put("commands.teleport.success.coordinates", "Teleported %s to %s, %s, %s");
LANG_US.put("commands.whitelist.list", "There are %s (out of %s seen) whitelisted players:");
LANG_US.put("commands.whitelist.enabled", "Turned on the whitelist");
LANG_US.put("commands.whitelist.disabled", "Turned off the whitelist");
LANG_US.put("commands.whitelist.reloaded", "Reloaded the whitelist");
LANG_US.put("commands.whitelist.add.success", "Added %s to the whitelist");
LANG_US.put("commands.whitelist.add.failed", "Could not add %s to the whitelist");
LANG_US.put("commands.whitelist.add.usage", "/whitelist add <player>");
LANG_US.put("commands.whitelist.remove.success", "Removed %s from the whitelist");
LANG_US.put("commands.whitelist.remove.failed", "Could not remove %s from the whitelist");
LANG_US.put("commands.whitelist.remove.usage", "/whitelist remove <player>");
LANG_US.put("commands.whitelist.usage", "/whitelist <on|off|list|add|remove|reload>");
LANG_US.put("commands.advancement.usage", "/advancement <grant|revoke|test> <player>");
LANG_US.put("commands.advancement.advancementNotFound", "No advancement was found by the name '%1$s'");
LANG_US.put("commands.advancement.criterionNotFound", "The advancement '%1$s' does not contain the criterion '%2$s'");
LANG_US.put("commands.reload.usage", "/reload");
LANG_US.put("commands.reload.success", "Successfully reloaded loot tables, advancements and functions");
LANG_US.put("commands.function.usage", "/function <name> [if <selector>|unless <selector>]");
LANG_US.put("commands.function.unknown", "Unknown function '%s'");
LANG_US.put("commands.function.success", "Executed %2$s command(s) from function '%1$s'");
LANG_US.put("commands.function.skipped", "Skipped execution of function '%1$s'");
LANG_US.put("commands.advancement.grant.usage", "/advancement grant <player> <only|until|from|through|everything>");
LANG_US.put("commands.advancement.grant.only.usage", "/advancement grant <player> only <advancement> [criterion]");
LANG_US.put("commands.advancement.grant.only.failed", "Couldn't grant the advancement '%1$s' to %2$s because they already have it");
LANG_US.put("commands.advancement.grant.only.success", "Granted the entire advancement '%1$s' to %2$s");
LANG_US.put("commands.advancement.grant.criterion.failed", "Couldn't grant the criterion '%3$s' of advancement '%1$s' to %2$s because they already have it");
LANG_US.put("commands.advancement.grant.criterion.success", "Granted the criterion '%3$s' of advancement '%1$s' to %2$s");
LANG_US.put("commands.advancement.grant.until.usage", "/advancement grant <player> until <advancement>");
LANG_US.put("commands.advancement.grant.until.failed", "Couldn't grant the advancement '%1$s' or its ancestors to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.until.success", "Granted '%1$s' and all ancestors (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.from.usage", "/advancement grant <player> from <advancement>");
LANG_US.put("commands.advancement.grant.from.failed", "Couldn't grant the advancement '%1$s' or its descendants to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.from.success", "Granted '%1$s' and all descendants (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.through.usage", "/advancement grant <player> through <advancement>");
LANG_US.put("commands.advancement.grant.through.failed", "Couldn't grant the advancement '%1$s', its ancestors or its descendants to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.through.success", "Granted '%1$s', all ancestors and all descendants (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.everything.usage", "/advancement grant <player> everything");
LANG_US.put("commands.advancement.grant.everything.failed", "Couldn't grant any advancements to %1$s because they already have them all");
LANG_US.put("commands.advancement.grant.everything.success", "Granted every advancement (%2$s total granted) to %1$s");
LANG_US.put("commands.advancement.revoke.usage", "/advancement revoke <player> <only|until|from|through|everything>");
LANG_US.put("commands.advancement.revoke.only.usage", "/advancement revoke <player> only <advancement> [criterion]");
LANG_US.put("commands.advancement.revoke.only.failed", "Couldn't revoke the advancement '%1$s' from %2$s because they haven't started it");
LANG_US.put("commands.advancement.revoke.only.success", "Revoked the entire advancement '%1$s' from %2$s");
LANG_US.put("commands.advancement.revoke.criterion.failed", "Couldn't revoke the criterion '%3$s' of advancement '%1$s' from %2$s because they haven't started it");
LANG_US.put("commands.advancement.revoke.criterion.success", "Revoked the criterion '%3$s' of advancement '%1$s' from %2$s");
LANG_US.put("commands.advancement.revoke.until.usage", "/advancement revoke <player> until <advancement>");
LANG_US.put("commands.advancement.revoke.until.failed", "Couldn't revoke the advancement '%1$s' or its ancestors from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.until.success", "Revoked '%1$s' and all ancestors (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.from.usage", "/advancement revoke <player> from <advancement>");
LANG_US.put("commands.advancement.revoke.from.failed", "Couldn't revoke the advancement '%1$s' or its descendants from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.from.success", "Revoked '%1$s' and all descendants (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.through.usage", "/advancement revoke <player> through <advancement>");
LANG_US.put("commands.advancement.revoke.through.failed", "Couldn't revoke the advancement '%1$s', its ancestors or its descendants from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.through.success", "Revoked '%1$s', all ancestors and all descendants (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.everything.usage", "/advancement revoke <player> everything");
LANG_US.put("commands.advancement.revoke.everything.failed", "Couldn't revoke any advancements to %1$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.everything.success", "Revoked every advancement (%2$s total revoked) from %1$s");
LANG_US.put("commands.advancement.test.usage", "/advancement test <player> <advancement> [criterion]");
LANG_US.put("commands.advancement.test.criterion.success", "Player %1$s has completed criterion '%3$s' of advancement '%2$s'");
LANG_US.put("commands.advancement.test.criterion.notDone", "Player %1$s has not completed criterion '%3$s' of advancement '%2$s'");
LANG_US.put("commands.advancement.test.advancement.success", "Player %1$s has completed advancement '%2$s'");
LANG_US.put("commands.advancement.test.advancement.notDone", "Player %1$s has not completed advancement '%2$s'");
LANG_US.put("commands.scoreboard.usage", "/scoreboard <objectives|players|teams> ...");
LANG_US.put("commands.scoreboard.noMultiWildcard", "Only one user wildcard allowed");
LANG_US.put("commands.scoreboard.allMatchesFailed", "All matches failed");
LANG_US.put("commands.scoreboard.teamNotFound", "No team was found by the name '%s'");
LANG_US.put("commands.scoreboard.objectiveNotFound", "No objective was found by the name '%s'");
LANG_US.put("commands.scoreboard.objectiveReadOnly", "The objective '%s' is read-only and cannot be set");
LANG_US.put("commands.scoreboard.objectives.usage", "/scoreboard objectives <list|add|remove|setdisplay> ...");
LANG_US.put("commands.scoreboard.objectives.setdisplay.usage", "/scoreboard objectives setdisplay <slot> [objective]");
LANG_US.put("commands.scoreboard.objectives.setdisplay.invalidSlot", "No such display slot '%s'");
LANG_US.put("commands.scoreboard.objectives.setdisplay.successCleared", "Cleared objective display slot '%s'");
LANG_US.put("commands.scoreboard.objectives.setdisplay.successSet", "Set the display objective in slot '%s' to '%s'");
LANG_US.put("commands.scoreboard.objectives.add.usage", "/scoreboard objectives add <name> <criteriaType> [display name ...]");
LANG_US.put("commands.scoreboard.objectives.add.wrongType", "Invalid objective criteria type '%s'");
LANG_US.put("commands.scoreboard.objectives.add.alreadyExists", "An objective with the name '%s' already exists");
LANG_US.put("commands.scoreboard.objectives.add.tooLong", "The name '%s' is too long for an objective, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.objectives.add.displayTooLong", "The display name '%s' is too long for an objective, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.objectives.add.success", "Added new objective '%s' successfully");
LANG_US.put("commands.scoreboard.objectives.remove.usage", "/scoreboard objectives remove <name>");
LANG_US.put("commands.scoreboard.objectives.remove.success", "Removed objective '%s' successfully");
LANG_US.put("commands.scoreboard.objectives.list.count", "Showing %s objective(s) on scoreboard:");
LANG_US.put("commands.scoreboard.objectives.list.entry", "- %s: displays as '%s' and is type '%s'");
LANG_US.put("commands.scoreboard.objectives.list.empty", "There are no objectives on the scoreboard");
LANG_US.put("commands.scoreboard.players.usage", "/scoreboard players <set|add|remove|reset|list|enable|test|operation|tag> ...");
LANG_US.put("commands.scoreboard.players.name.tooLong", "The name '%s' is too long for a player, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.players.set.success", "Set score of %s for player %s to %s");
LANG_US.put("commands.scoreboard.players.set.tagMismatch", "The dataTag does not match for %s");
LANG_US.put("commands.scoreboard.players.set.tagError", "Could not parse dataTag, reason: %s");
LANG_US.put("commands.scoreboard.players.set.usage", "/scoreboard players set <player> <objective> <score> [dataTag]");
LANG_US.put("commands.scoreboard.players.add.usage", "/scoreboard players add <player> <objective> <count> [dataTag]");
LANG_US.put("commands.scoreboard.players.remove.usage", "/scoreboard players remove <player> <objective> <count> [dataTag]");
LANG_US.put("commands.scoreboard.players.reset.usage", "/scoreboard players reset <player> [objective]");
LANG_US.put("commands.scoreboard.players.reset.success", "Reset scores of player %s");
LANG_US.put("commands.scoreboard.players.resetscore.success", "Reset score %s of player %s");
LANG_US.put("commands.scoreboard.players.list.usage", "/scoreboard players list [name]");
LANG_US.put("commands.scoreboard.players.list.count", "Showing %s tracked players on the scoreboard:");
LANG_US.put("commands.scoreboard.players.list.empty", "There are no tracked players on the scoreboard");
LANG_US.put("commands.scoreboard.players.list.player.count", "Showing %s tracked objective(s) for %s:");
LANG_US.put("commands.scoreboard.players.list.player.entry", "- %2$s: %1$s (%3$s)");
LANG_US.put("commands.scoreboard.players.list.player.empty", "Player %s has no scores recorded");
LANG_US.put("commands.scoreboard.players.enable.usage", "/scoreboard players enable <player> <trigger>");
LANG_US.put("commands.scoreboard.players.enable.success", "Enabled trigger %s for %s");
LANG_US.put("commands.scoreboard.players.enable.noTrigger", "Objective %s is not a trigger");
LANG_US.put("commands.scoreboard.players.test.usage", "/scoreboard players test <player> <objective> <min> [max]");
LANG_US.put("commands.scoreboard.players.test.notFound", "No %s score for %s found");
LANG_US.put("commands.scoreboard.players.test.failed", "Score %s is NOT in range %s to %s");
LANG_US.put("commands.scoreboard.players.test.success", "Score %s is in range %s to %s");
LANG_US.put("commands.scoreboard.players.operation.usage", "/scoreboard players operation <targetName> <targetObjective> <operation> <selector> <objective>");
LANG_US.put("commands.scoreboard.players.operation.notFound", "No %s score for %s found");
LANG_US.put("commands.scoreboard.players.operation.invalidOperation", "Invalid operation %s");
LANG_US.put("commands.scoreboard.players.operation.success", "Operation applied successfully");
LANG_US.put("commands.scoreboard.players.tag.usage", "/scoreboard players tag <player> <add|remove|list> <tagName> [dataTag]");
LANG_US.put("commands.scoreboard.players.tag.tagMismatch", "The dataTag does not match for %s");
LANG_US.put("commands.scoreboard.players.tag.tooMany", "Can't add more than %s tags to an entity");
LANG_US.put("commands.scoreboard.players.tag.notFound", "Entity didn't have the %s tag");
LANG_US.put("commands.scoreboard.players.tag.success.add", "Tag %s added");
LANG_US.put("commands.scoreboard.players.tag.success.remove", "Tag %s removed");
LANG_US.put("commands.scoreboard.players.tag.list", "Tags on entity %s are:");
LANG_US.put("commands.scoreboard.players.tag.tagError", "Players tag command failed, reason: %s");
LANG_US.put("commands.scoreboard.teams.usage", "/scoreboard teams <list|add|remove|empty|join|leave|option> ...");
LANG_US.put("commands.scoreboard.teams.add.usage", "/scoreboard teams add <name> [display name ...]");
LANG_US.put("commands.scoreboard.teams.add.alreadyExists", "A team with the name '%s' already exists");
LANG_US.put("commands.scoreboard.teams.add.tooLong", "The name '%s' is too long for a team, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.teams.add.displayTooLong", "The display name '%s' is too long for a team, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.teams.add.success", "Added new team '%s' successfully");
LANG_US.put("commands.scoreboard.teams.list.usage", "/scoreboard teams list [name]");
LANG_US.put("commands.scoreboard.teams.list.count", "Showing %s teams on the scoreboard:");
LANG_US.put("commands.scoreboard.teams.list.entry", "- %1$s: '%2$s' has %3$s players");
LANG_US.put("commands.scoreboard.teams.list.empty", "There are no teams registered on the scoreboard");
LANG_US.put("commands.scoreboard.teams.list.player.count", "Showing %s player(s) in team %s:");
LANG_US.put("commands.scoreboard.teams.list.player.entry", "- %2$s: %1$s (%3$s)");
LANG_US.put("commands.scoreboard.teams.list.player.empty", "Team %s has no players");
LANG_US.put("commands.scoreboard.teams.empty.usage", "/scoreboard teams empty <team>");
LANG_US.put("commands.scoreboard.teams.empty.alreadyEmpty", "Team %s is already empty, cannot remove nonexistant players");
LANG_US.put("commands.scoreboard.teams.empty.success", "Removed all %s player(s) from team %s");
LANG_US.put("commands.scoreboard.teams.remove.usage", "/scoreboard teams remove <name>");
LANG_US.put("commands.scoreboard.teams.remove.success", "Removed team %s");
LANG_US.put("commands.scoreboard.teams.join.usage", "/scoreboard teams join <team> [player]");
LANG_US.put("commands.scoreboard.teams.join.success", "Added %s player(s) to team %s: %s");
LANG_US.put("commands.scoreboard.teams.join.failure", "Could not add %s player(s) to team %s: %s");
LANG_US.put("commands.scoreboard.teams.leave.usage", "/scoreboard teams leave [player]");
LANG_US.put("commands.scoreboard.teams.leave.success", "Removed %s player(s) from their teams: %s");
LANG_US.put("commands.scoreboard.teams.leave.failure", "Could not remove %s player(s) from their teams: %s");
LANG_US.put("commands.scoreboard.teams.leave.noTeam", "You are not in a team");
LANG_US.put("commands.scoreboard.teams.option.usage", "/scoreboard teams option <team> <friendlyfire|color|seeFriendlyInvisibles|nametagVisibility|deathMessageVisibility|collisionRule> <value>");
LANG_US.put("commands.scoreboard.teams.option.noValue", "Valid values for option %s are: %s");
LANG_US.put("commands.scoreboard.teams.option.success", "Set option %s for team %s to %s");
LANG_US.put("commands.execute.usage", "/execute <entity> <x> <y> <z> <command> OR /execute <entity> <x> <y> <z> detect <x> <y> <z> <block> <dataValue|-1|state|*> <command>");
LANG_US.put("commands.execute.allInvocationsFailed", "All invocations failed: '%s'");
LANG_US.put("commands.execute.failed", "Failed to execute '%s' as %s");
LANG_US.put("commands.gamemode.success.self", "Set own game mode to %s");
LANG_US.put("commands.gamemode.success.other", "Set %s's game mode to %s");
LANG_US.put("commands.gamemode.usage", "/gamemode <mode> [player]");
LANG_US.put("commands.defaultgamemode.usage", "/defaultgamemode <mode>");
LANG_US.put("commands.defaultgamemode.success", "The world's default game mode is now %s");
LANG_US.put("commands.me.usage", "/me <action ...>");
LANG_US.put("commands.help.header", "--- Showing help page %s of %s (/help <page>) ---");
LANG_US.put("commands.help.footer", "Tip: Use the <tab> key while typing a command to auto-complete the command or its arguments");
LANG_US.put("commands.help.usage", "/help [page|command name]");
LANG_US.put("commands.trigger.usage", "/trigger <objective> <add|set> <value>");
LANG_US.put("commands.trigger.invalidObjective", "Invalid trigger name %s");
LANG_US.put("commands.trigger.invalidMode", "Invalid trigger mode %s");
LANG_US.put("commands.trigger.disabled", "Trigger %s is not enabled");
LANG_US.put("commands.trigger.invalidPlayer", "Only players can use the /trigger command");
LANG_US.put("commands.trigger.success", "Trigger %s changed with %s %s");
LANG_US.put("commands.publish.usage", "/publish");
LANG_US.put("commands.publish.started", "Local game hosted on port %s");
LANG_US.put("commands.publish.failed", "Unable to host local game");
LANG_US.put("commands.debug.start", "Started debug profiling");
LANG_US.put("commands.debug.stop", "Stopped debug profiling after %s seconds (%s ticks)");
LANG_US.put("commands.debug.notStarted", "Can't stop profiling when we haven't started yet!");
LANG_US.put("commands.debug.usage", "/debug <start|stop>");
LANG_US.put("commands.chunkinfo.usage", "/chunkinfo [<x> <y> <z>]");
LANG_US.put("commands.chunkinfo.location", "Chunk location: (%s, %s, %s)");
LANG_US.put("commands.chunkinfo.noChunk", "No chunk found at chunk position %s, %s, %s");
LANG_US.put("commands.chunkinfo.notEmpty", "Chunk is not empty.");
LANG_US.put("commands.chunkinfo.empty", "Chunk is empty.");
LANG_US.put("commands.chunkinfo.notCompiled", "Chunk is not compiled.");
LANG_US.put("commands.chunkinfo.compiled", "Chunk is compiled.");
LANG_US.put("commands.chunkinfo.hasNoRenderableLayers", "Chunk has no renderable layers.");
LANG_US.put("commands.chunkinfo.hasLayers", "Chunk has layers: %s");
LANG_US.put("commands.chunkinfo.isEmpty", "Chunk has empty layers: %s");
LANG_US.put("commands.chunkinfo.vertices", "%s layer's buffer contains %s vertices");
LANG_US.put("commands.chunkinfo.data", "First 64 vertices are: %s");
LANG_US.put("commands.tellraw.usage", "/tellraw <player> <raw json message>");
LANG_US.put("commands.tellraw.jsonException", "Invalid json: %s");
LANG_US.put("commands.message.usage", "/tell <player> <private message ...>");
LANG_US.put("commands.message.sameTarget", "You can't send a private message to yourself!");
LANG_US.put("commands.message.display.outgoing", "You whisper to %s: %s");
LANG_US.put("commands.message.display.incoming", "%s whispers to you: %s");
LANG_US.put("commands.difficulty.usage", "/difficulty <new difficulty>");
LANG_US.put("commands.difficulty.success", "Set game difficulty to %s");
LANG_US.put("commands.spawnpoint.usage", "/spawnpoint [player] [<x> <y> <z>]");
LANG_US.put("commands.spawnpoint.success", "Set %s's spawn point to (%s, %s, %s)");
LANG_US.put("commands.setworldspawn.usage", "/setworldspawn [<x> <y> <z>]");
LANG_US.put("commands.setworldspawn.success", "Set the world spawn point to (%s, %s, %s)");
LANG_US.put("commands.gamerule.usage", "/gamerule <rule name> [value]");
LANG_US.put("commands.gamerule.success", "Game rule %s has been updated to %s");
LANG_US.put("commands.gamerule.norule", "No game rule called '%s' is available");
LANG_US.put("commands.gamerule.nopermission", "Only server owners can change '%s'");
LANG_US.put("commands.weather.usage", "/weather <clear|rain|thunder> [duration in seconds]");
LANG_US.put("commands.weather.clear", "Changing to clear weather");
LANG_US.put("commands.weather.rain", "Changing to rainy weather");
LANG_US.put("commands.weather.thunder", "Changing to rain and thunder");
LANG_US.put("commands.testfor.usage", "/testfor <player> [dataTag]");
LANG_US.put("commands.testfor.failure", "%s did not match the required data structure");
LANG_US.put("commands.testfor.success", "Found %s");
LANG_US.put("commands.testfor.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.seed.usage", "/seed");
LANG_US.put("commands.seed.success", "Seed: %s");
LANG_US.put("commands.spreadplayers.noop", "No players found to spread");
LANG_US.put("commands.spreadplayers.usage", "/spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams true|false> <player ...>");
LANG_US.put("commands.spreadplayers.spreading.teams", "Spreading %s team(s) %s blocks around %s, %s (min %s blocks apart)");
LANG_US.put("commands.spreadplayers.spreading.players", "Spreading %s player(s) %s blocks around %s, %s (min %s blocks apart)");
LANG_US.put("commands.spreadplayers.success.teams", "Successfully spread %s team(s) around %s, %s");
LANG_US.put("commands.spreadplayers.success.players", "Successfully spread %s player(s) around %s, %s");
LANG_US.put("commands.spreadplayers.info.teams", "(Average distance between teams is %s blocks apart after %s iterations)");
LANG_US.put("commands.spreadplayers.info.players", "(Average distance between players is %s blocks apart after %s iterations)");
LANG_US.put("commands.spreadplayers.failure.teams", "Could not spread %s team(s) around %s, %s (too many players for space - try using spread of at most %s)");
LANG_US.put("commands.spreadplayers.failure.players", "Could not spread %s player(s) around %s, %s (too many players for space - try using spread of at most %s)");
LANG_US.put("commands.recipe.usage", "/recipe <give|take> [player] <name|*>");
LANG_US.put("commands.recipe.alreadyHave", "Player %s already has a recipe for %s");
LANG_US.put("commands.recipe.dontHave", "Player %s doesn't have the recipe for %s");
LANG_US.put("commands.recipe.give.success.all", "Successfully given all recipes to %s");
LANG_US.put("commands.recipe.give.success.one", "Successfully given %s the recipe for %s");
LANG_US.put("commands.recipe.take.success.all", "Successfully taken all recipes from %s");
LANG_US.put("commands.recipe.take.success.one", "Successfully removed the recipe for %s from %s");
LANG_US.put("commands.recipe.unknownrecipe", "%s is an unknown recipe");
LANG_US.put("commands.recipe.unsupported", "%s is an unsupported recipe");
LANG_US.put("commands.worldborder.usage", "/worldborder <set|center|damage|warning|get|add> ...");
LANG_US.put("commands.worldborder.add.usage", "/worldborder add <sizeInBlocks> [timeInSeconds]");
LANG_US.put("commands.worldborder.set.usage", "/worldborder set <sizeInBlocks> [timeInSeconds]");
LANG_US.put("commands.worldborder.set.success", "Set world border to %s blocks wide (from %s blocks)");
LANG_US.put("commands.worldborder.get.success", "World border is currently %s blocks wide");
LANG_US.put("commands.worldborder.setSlowly.shrink.success", "Shrinking world border to %s blocks wide (down from %s blocks) over %s seconds");
LANG_US.put("commands.worldborder.setSlowly.grow.success", "Growing world border to %s blocks wide (up from %s blocks) over %s seconds");
LANG_US.put("commands.worldborder.center.usage", "/worldborder center <x> <z>");
LANG_US.put("commands.worldborder.center.success", "Set world border center to %s, %s");
LANG_US.put("commands.worldborder.damage.usage", "/worldborder damage <buffer|amount> ...");
LANG_US.put("commands.worldborder.damage.buffer.usage", "/worldborder damage buffer <sizeInBlocks>");
LANG_US.put("commands.worldborder.damage.buffer.success", "Set world border damage buffer to %s blocks (from %s blocks)");
LANG_US.put("commands.worldborder.damage.amount.usage", "/worldborder damage amount <damagePerBlock>");
LANG_US.put("commands.worldborder.damage.amount.success", "Set world border damage amount to %s per block (from %s per block)");
LANG_US.put("commands.worldborder.warning.usage", "/worldborder warning <time|distance> ...");
LANG_US.put("commands.worldborder.warning.time.usage", "/worldborder warning time <seconds>");
LANG_US.put("commands.worldborder.warning.time.success", "Set world border warning to %s seconds away (from %s seconds)");
LANG_US.put("commands.worldborder.warning.distance.usage", "/worldborder warning distance <distance>");
LANG_US.put("commands.worldborder.warning.distance.success", "Set world border warning to %s blocks away (from %s blocks)");
LANG_US.put("commands.title.usage", "/title <player> title|subtitle|actionbar|clear|reset|times ...");
LANG_US.put("commands.title.usage.title", "/title <player> title|subtitle|actionbar <raw json title>");
LANG_US.put("commands.title.usage.clear", "/title <player> clear|reset");
LANG_US.put("commands.title.usage.times", "/title <player> times <fadeIn> <stay> <fadeOut>");
LANG_US.put("commands.title.success", "Title command successfully executed");
LANG_US.put("commands.stopsound.usage", "/stopsound <player> [source] [sound]");
LANG_US.put("commands.stopsound.unknownSoundSource", "Source %s is unknown");
LANG_US.put("commands.stopsound.success.individualSound", "Stopped sound '%s' with source '%s' for %s");
LANG_US.put("commands.stopsound.success.soundSource", "Stopped source '%s' for %s");
LANG_US.put("commands.stopsound.success.all", "Stopped all sounds for %s");
LANG_US.put("commands.locate.usage", "/locate <feature>");
LANG_US.put("commands.locate.success", "Located %s at %s (y?) %s");
LANG_US.put("commands.locate.failure", "Unable to locate any %s feature");
LANG_US.put("itemGroup.buildingBlocks", "Building Blocks");
LANG_US.put("itemGroup.decorations", "Decoration Blocks");
LANG_US.put("itemGroup.redstone", "Redstone");
LANG_US.put("itemGroup.transportation", "Transportation");
LANG_US.put("itemGroup.misc", "Miscellaneous");
LANG_US.put("itemGroup.search", "Search Items");
LANG_US.put("itemGroup.food", "Foodstuffs");
LANG_US.put("itemGroup.tools", "Tools");
LANG_US.put("itemGroup.combat", "Combat");
LANG_US.put("itemGroup.brewing", "Brewing");
LANG_US.put("itemGroup.materials", "Materials");
LANG_US.put("itemGroup.inventory", "Survival Inventory");
LANG_US.put("itemGroup.hotbar", "Saved Toolbars");
LANG_US.put("inventory.binSlot", "Destroy Item");
LANG_US.put("inventory.hotbarSaved", "Item toolbar saved (restore with %1$s+%2$s)");
LANG_US.put("inventory.hotbarInfo", "Save toolbar with %1$s+%2$s");
LANG_US.put("advMode.setCommand", "Set Console Command for Block");
LANG_US.put("advMode.setCommand.success", "Command set: %s");
LANG_US.put("advMode.command", "Console Command");
LANG_US.put("advMode.nearestPlayer", "Use \"@p\" to target nearest player");
LANG_US.put("advMode.randomPlayer", "Use \"@r\" to target random player");
LANG_US.put("advMode.allPlayers", "Use \"@a\" to target all players");
LANG_US.put("advMode.allEntities", "Use \"@e\" to target all entities");
LANG_US.put("advMode.self", "Use \"@s\" to target the executing entity");
LANG_US.put("advMode.previousOutput", "Previous Output");
LANG_US.put("advMode.mode.sequence", "Chain");
LANG_US.put("advMode.mode.auto", "Repeat");
LANG_US.put("advMode.mode.redstone", "Impulse");
LANG_US.put("advMode.mode.conditional", "Conditional");
LANG_US.put("advMode.mode.unconditional", "Unconditional");
LANG_US.put("advMode.mode.redstoneTriggered", "Needs Redstone");
LANG_US.put("advMode.mode.autoexec.bat", "Always Active");
LANG_US.put("advMode.notEnabled", "Command blocks are not enabled on this server");
LANG_US.put("advMode.notAllowed", "Must be an opped player in creative mode");
LANG_US.put("mount.onboard", "Press %1$s to dismount");
LANG_US.put("build.tooHigh", "Height limit for building is %s blocks");
LANG_US.put("item.modifiers.mainhand", "When in main hand:");
LANG_US.put("item.modifiers.offhand", "When in off hand:");
LANG_US.put("item.modifiers.feet", "When on feet:");
LANG_US.put("item.modifiers.legs", "When on legs:");
LANG_US.put("item.modifiers.chest", "When on body:");
LANG_US.put("item.modifiers.head", "When on head:");
LANG_US.put("attribute.modifier.plus.0", "+%s %s");
LANG_US.put("attribute.modifier.plus.1", "+%s%% %s");
LANG_US.put("attribute.modifier.plus.2", "+%s%% %s");
LANG_US.put("attribute.modifier.take.0", "-%s %s");
LANG_US.put("attribute.modifier.take.1", "-%s%% %s");
LANG_US.put("attribute.modifier.take.2", "-%s%% %s");
LANG_US.put("attribute.modifier.equals.0", "%s %s");
LANG_US.put("attribute.modifier.equals.1", "%s%% %s");
LANG_US.put("attribute.modifier.equals.2", "%s%% %s");
LANG_US.put("attribute.name.horse.jumpStrength", "Horse Jump Strength");
LANG_US.put("attribute.name.zombie.spawnReinforcements", "Zombie Reinforcements");
LANG_US.put("attribute.name.generic.maxHealth", "Max Health");
LANG_US.put("attribute.name.generic.followRange", "Mob Follow Range");
LANG_US.put("attribute.name.generic.knockbackResistance", "Knockback Resistance");
LANG_US.put("attribute.name.generic.movementSpeed", "Speed");
LANG_US.put("attribute.name.generic.attackDamage", "Attack Damage");
LANG_US.put("attribute.name.generic.attackSpeed", "Attack Speed");
LANG_US.put("attribute.name.generic.luck", "Luck");
LANG_US.put("attribute.name.generic.armor", "Armor");
LANG_US.put("attribute.name.generic.armorToughness", "Armor Toughness");
LANG_US.put("screenshot.success", "Saved screenshot as %s");
LANG_US.put("screenshot.failure", "Couldn't save screenshot: %s");
LANG_US.put("item.banner.black.name", "Black Banner");
LANG_US.put("item.banner.red.name", "Red Banner");
LANG_US.put("item.banner.green.name", "Green Banner");
LANG_US.put("item.banner.brown.name", "Brown Banner");
LANG_US.put("item.banner.blue.name", "Blue Banner");
LANG_US.put("item.banner.purple.name", "Purple Banner");
LANG_US.put("item.banner.cyan.name", "Cyan Banner");
LANG_US.put("item.banner.silver.name", "Light Gray Banner");
LANG_US.put("item.banner.gray.name", "Gray Banner");
LANG_US.put("item.banner.pink.name", "Pink Banner");
LANG_US.put("item.banner.lime.name", "Lime Banner");
LANG_US.put("item.banner.yellow.name", "Yellow Banner");
LANG_US.put("item.banner.lightBlue.name", "Light Blue Banner");
LANG_US.put("item.banner.magenta.name", "Magenta Banner");
LANG_US.put("item.banner.orange.name", "Orange Banner");
LANG_US.put("item.banner.white.name", "White Banner");
LANG_US.put("item.shield.name", "Shield");
LANG_US.put("item.shield.black.name", "Black Shield");
LANG_US.put("item.shield.red.name", "Red Shield");
LANG_US.put("item.shield.green.name", "Green Shield");
LANG_US.put("item.shield.brown.name", "Brown Shield");
LANG_US.put("item.shield.blue.name", "Blue Shield");
LANG_US.put("item.shield.purple.name", "Purple Shield");
LANG_US.put("item.shield.cyan.name", "Cyan Shield");
LANG_US.put("item.shield.silver.name", "Light Gray Shield");
LANG_US.put("item.shield.gray.name", "Gray Shield");
LANG_US.put("item.shield.pink.name", "Pink Shield");
LANG_US.put("item.shield.lime.name", "Lime Shield");
LANG_US.put("item.shield.yellow.name", "Yellow Shield");
LANG_US.put("item.shield.lightBlue.name", "Light Blue Shield");
LANG_US.put("item.shield.magenta.name", "Magenta Shield");
LANG_US.put("item.shield.orange.name", "Orange Shield");
LANG_US.put("item.shield.white.name", "White Shield");
LANG_US.put("item.banner.square_bottom_left.black", "Black Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.red", "Red Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.green", "Green Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.brown", "Brown Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.blue", "Blue Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.purple", "Purple Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.cyan", "Cyan Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.silver", "Light Gray Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.gray", "Gray Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.pink", "Pink Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.lime", "Lime Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.yellow", "Yellow Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.lightBlue", "Light Blue Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.magenta", "Magenta Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.orange", "Orange Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.white", "White Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_right.black", "Black Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.red", "Red Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.green", "Green Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.brown", "Brown Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.blue", "Blue Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.purple", "Purple Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.cyan", "Cyan Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.silver", "Light Gray Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.gray", "Gray Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.pink", "Pink Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.lime", "Lime Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.yellow", "Yellow Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.lightBlue", "Light Blue Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.magenta", "Magenta Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.orange", "Orange Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.white", "White Base Sinister Canton");
LANG_US.put("item.banner.square_top_left.black", "Black Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.red", "Red Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.green", "Green Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.brown", "Brown Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.blue", "Blue Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.purple", "Purple Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.cyan", "Cyan Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.silver", "Light Gray Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.gray", "Gray Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.pink", "Pink Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.lime", "Lime Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.yellow", "Yellow Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.lightBlue", "Light Blue Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.magenta", "Magenta Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.orange", "Orange Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.white", "White Chief Dexter Canton");
LANG_US.put("item.banner.square_top_right.black", "Black Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.red", "Red Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.green", "Green Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.brown", "Brown Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.blue", "Blue Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.purple", "Purple Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.cyan", "Cyan Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.silver", "Light Gray Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.gray", "Gray Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.pink", "Pink Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.lime", "Lime Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.yellow", "Yellow Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.lightBlue", "Light Blue Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.magenta", "Magenta Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.orange", "Orange Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.white", "White Chief Sinister Canton");
LANG_US.put("item.banner.stripe_bottom.black", "Black Base");
LANG_US.put("item.banner.stripe_bottom.red", "Red Base");
LANG_US.put("item.banner.stripe_bottom.green", "Green Base");
LANG_US.put("item.banner.stripe_bottom.brown", "Brown Base");
LANG_US.put("item.banner.stripe_bottom.blue", "Blue Base");
LANG_US.put("item.banner.stripe_bottom.purple", "Purple Base");
LANG_US.put("item.banner.stripe_bottom.cyan", "Cyan Base");
LANG_US.put("item.banner.stripe_bottom.silver", "Light Gray Base");
LANG_US.put("item.banner.stripe_bottom.gray", "Gray Base");
LANG_US.put("item.banner.stripe_bottom.pink", "Pink Base");
LANG_US.put("item.banner.stripe_bottom.lime", "Lime Base");
LANG_US.put("item.banner.stripe_bottom.yellow", "Yellow Base");
LANG_US.put("item.banner.stripe_bottom.lightBlue", "Light Blue Base");
LANG_US.put("item.banner.stripe_bottom.magenta", "Magenta Base");
LANG_US.put("item.banner.stripe_bottom.orange", "Orange Base");
LANG_US.put("item.banner.stripe_bottom.white", "White Base");
LANG_US.put("item.banner.stripe_top.black", "Black Chief");
LANG_US.put("item.banner.stripe_top.red", "Red Chief");
LANG_US.put("item.banner.stripe_top.green", "Green Chief");
LANG_US.put("item.banner.stripe_top.brown", "Brown Chief");
LANG_US.put("item.banner.stripe_top.blue", "Blue Chief");
LANG_US.put("item.banner.stripe_top.purple", "Purple Chief");
LANG_US.put("item.banner.stripe_top.cyan", "Cyan Chief");
LANG_US.put("item.banner.stripe_top.silver", "Light Gray Chief");
LANG_US.put("item.banner.stripe_top.gray", "Gray Chief");
LANG_US.put("item.banner.stripe_top.pink", "Pink Chief");
LANG_US.put("item.banner.stripe_top.lime", "Lime Chief");
LANG_US.put("item.banner.stripe_top.yellow", "Yellow Chief");
LANG_US.put("item.banner.stripe_top.lightBlue", "Light Blue Chief");
LANG_US.put("item.banner.stripe_top.magenta", "Magenta Chief");
LANG_US.put("item.banner.stripe_top.orange", "Orange Chief");
LANG_US.put("item.banner.stripe_top.white", "White Chief");
LANG_US.put("item.banner.stripe_left.black", "Black Pale Dexter");
LANG_US.put("item.banner.stripe_left.red", "Red Pale Dexter");
LANG_US.put("item.banner.stripe_left.green", "Green Pale Dexter");
LANG_US.put("item.banner.stripe_left.brown", "Brown Pale Dexter");
LANG_US.put("item.banner.stripe_left.blue", "Blue Pale Dexter");
LANG_US.put("item.banner.stripe_left.purple", "Purple Pale Dexter");
LANG_US.put("item.banner.stripe_left.cyan", "Cyan Pale Dexter");
LANG_US.put("item.banner.stripe_left.silver", "Light Gray Pale Dexter");
LANG_US.put("item.banner.stripe_left.gray", "Gray Pale Dexter");
LANG_US.put("item.banner.stripe_left.pink", "Pink Pale Dexter");
LANG_US.put("item.banner.stripe_left.lime", "Lime Pale Dexter");
LANG_US.put("item.banner.stripe_left.yellow", "Yellow Pale Dexter");
LANG_US.put("item.banner.stripe_left.lightBlue", "Light Blue Pale Dexter");
LANG_US.put("item.banner.stripe_left.magenta", "Magenta Pale Dexter");
LANG_US.put("item.banner.stripe_left.orange", "Orange Pale Dexter");
LANG_US.put("item.banner.stripe_left.white", "White Pale Dexter");
LANG_US.put("item.banner.stripe_right.black", "Black Pale Sinister");
LANG_US.put("item.banner.stripe_right.red", "Red Pale Sinister");
LANG_US.put("item.banner.stripe_right.green", "Green Pale Sinister");
LANG_US.put("item.banner.stripe_right.brown", "Brown Pale Sinister");
LANG_US.put("item.banner.stripe_right.blue", "Blue Pale Sinister");
LANG_US.put("item.banner.stripe_right.purple", "Purple Pale Sinister");
LANG_US.put("item.banner.stripe_right.cyan", "Cyan Pale Sinister");
LANG_US.put("item.banner.stripe_right.silver", "Light Gray Pale Sinister");
LANG_US.put("item.banner.stripe_right.gray", "Gray Pale Sinister");
LANG_US.put("item.banner.stripe_right.pink", "Pink Pale Sinister");
LANG_US.put("item.banner.stripe_right.lime", "Lime Pale Sinister");
LANG_US.put("item.banner.stripe_right.yellow", "Yellow Pale Sinister");
LANG_US.put("item.banner.stripe_right.lightBlue", "Light Blue Pale Sinister");
LANG_US.put("item.banner.stripe_right.magenta", "Magenta Pale Sinister");
LANG_US.put("item.banner.stripe_right.orange", "Orange Pale Sinister");
LANG_US.put("item.banner.stripe_right.white", "White Pale Sinister");
LANG_US.put("item.banner.stripe_center.black", "Black Pale");
LANG_US.put("item.banner.stripe_center.red", "Red Pale");
LANG_US.put("item.banner.stripe_center.green", "Green Pale");
LANG_US.put("item.banner.stripe_center.brown", "Brown Pale");
LANG_US.put("item.banner.stripe_center.blue", "Blue Pale");
LANG_US.put("item.banner.stripe_center.purple", "Purple Pale");
LANG_US.put("item.banner.stripe_center.cyan", "Cyan Pale");
LANG_US.put("item.banner.stripe_center.silver", "Light Gray Pale");
LANG_US.put("item.banner.stripe_center.gray", "Gray Pale");
LANG_US.put("item.banner.stripe_center.pink", "Pink Pale");
LANG_US.put("item.banner.stripe_center.lime", "Lime Pale");
LANG_US.put("item.banner.stripe_center.yellow", "Yellow Pale");
LANG_US.put("item.banner.stripe_center.lightBlue", "Light Blue Pale");
LANG_US.put("item.banner.stripe_center.magenta", "Magenta Pale");
LANG_US.put("item.banner.stripe_center.orange", "Orange Pale");
LANG_US.put("item.banner.stripe_center.white", "White Pale");
LANG_US.put("item.banner.stripe_middle.black", "Black Fess");
LANG_US.put("item.banner.stripe_middle.red", "Red Fess");
LANG_US.put("item.banner.stripe_middle.green", "Green Fess");
LANG_US.put("item.banner.stripe_middle.brown", "Brown Fess");
LANG_US.put("item.banner.stripe_middle.blue", "Blue Fess");
LANG_US.put("item.banner.stripe_middle.purple", "Purple Fess");
LANG_US.put("item.banner.stripe_middle.cyan", "Cyan Fess");
LANG_US.put("item.banner.stripe_middle.silver", "Light Gray Fess");
LANG_US.put("item.banner.stripe_middle.gray", "Gray Fess");
LANG_US.put("item.banner.stripe_middle.pink", "Pink Fess");
LANG_US.put("item.banner.stripe_middle.lime", "Lime Fess");
LANG_US.put("item.banner.stripe_middle.yellow", "Yellow Fess");
LANG_US.put("item.banner.stripe_middle.lightBlue", "Light Blue Fess");
LANG_US.put("item.banner.stripe_middle.magenta", "Magenta Fess");
LANG_US.put("item.banner.stripe_middle.orange", "Orange Fess");
LANG_US.put("item.banner.stripe_middle.white", "White Fess");
LANG_US.put("item.banner.stripe_downright.black", "Black Bend");
LANG_US.put("item.banner.stripe_downright.red", "Red Bend");
LANG_US.put("item.banner.stripe_downright.green", "Green Bend");
LANG_US.put("item.banner.stripe_downright.brown", "Brown Bend");
LANG_US.put("item.banner.stripe_downright.blue", "Blue Bend");
LANG_US.put("item.banner.stripe_downright.purple", "Purple Bend");
LANG_US.put("item.banner.stripe_downright.cyan", "Cyan Bend");
LANG_US.put("item.banner.stripe_downright.silver", "Light Gray Bend");
LANG_US.put("item.banner.stripe_downright.gray", "Gray Bend");
LANG_US.put("item.banner.stripe_downright.pink", "Pink Bend");
LANG_US.put("item.banner.stripe_downright.lime", "Lime Bend");
LANG_US.put("item.banner.stripe_downright.yellow", "Yellow Bend");
LANG_US.put("item.banner.stripe_downright.lightBlue", "Light Blue Bend");
LANG_US.put("item.banner.stripe_downright.magenta", "Magenta Bend");
LANG_US.put("item.banner.stripe_downright.orange", "Orange Bend");
LANG_US.put("item.banner.stripe_downright.white", "White Bend");
LANG_US.put("item.banner.stripe_downleft.black", "Black Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.red", "Red Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.green", "Green Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.brown", "Brown Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.blue", "Blue Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.purple", "Purple Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.cyan", "Cyan Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.silver", "Light Gray Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.gray", "Gray Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.pink", "Pink Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.lime", "Lime Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.yellow", "Yellow Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.lightBlue", "Light Blue Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.magenta", "Magenta Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.orange", "Orange Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.white", "White Bend Sinister");
LANG_US.put("item.banner.small_stripes.black", "Black Paly");
LANG_US.put("item.banner.small_stripes.red", "Red Paly");
LANG_US.put("item.banner.small_stripes.green", "Green Paly");
LANG_US.put("item.banner.small_stripes.brown", "Brown Paly");
LANG_US.put("item.banner.small_stripes.blue", "Blue Paly");
LANG_US.put("item.banner.small_stripes.purple", "Purple Paly");
LANG_US.put("item.banner.small_stripes.cyan", "Cyan Paly");
LANG_US.put("item.banner.small_stripes.silver", "Light Gray Paly");
LANG_US.put("item.banner.small_stripes.gray", "Gray Paly");
LANG_US.put("item.banner.small_stripes.pink", "Pink Paly");
LANG_US.put("item.banner.small_stripes.lime", "Lime Paly");
LANG_US.put("item.banner.small_stripes.yellow", "Yellow Paly");
LANG_US.put("item.banner.small_stripes.lightBlue", "Light Blue Paly");
LANG_US.put("item.banner.small_stripes.magenta", "Magenta Paly");
LANG_US.put("item.banner.small_stripes.orange", "Orange Paly");
LANG_US.put("item.banner.small_stripes.white", "White Paly");
LANG_US.put("item.banner.cross.black", "Black Saltire");
LANG_US.put("item.banner.cross.red", "Red Saltire");
LANG_US.put("item.banner.cross.green", "Green Saltire");
LANG_US.put("item.banner.cross.brown", "Brown Saltire");
LANG_US.put("item.banner.cross.blue", "Blue Saltire");
LANG_US.put("item.banner.cross.purple", "Purple Saltire");
LANG_US.put("item.banner.cross.cyan", "Cyan Saltire");
LANG_US.put("item.banner.cross.silver", "Light Gray Saltire");
LANG_US.put("item.banner.cross.gray", "Gray Saltire");
LANG_US.put("item.banner.cross.pink", "Pink Saltire");
LANG_US.put("item.banner.cross.lime", "Lime Saltire");
LANG_US.put("item.banner.cross.yellow", "Yellow Saltire");
LANG_US.put("item.banner.cross.lightBlue", "Light Blue Saltire");
LANG_US.put("item.banner.cross.magenta", "Magenta Saltire");
LANG_US.put("item.banner.cross.orange", "Orange Saltire");
LANG_US.put("item.banner.cross.white", "White Saltire");
LANG_US.put("item.banner.triangle_bottom.black", "Black Chevron");
LANG_US.put("item.banner.triangle_bottom.red", "Red Chevron");
LANG_US.put("item.banner.triangle_bottom.green", "Green Chevron");
LANG_US.put("item.banner.triangle_bottom.brown", "Brown Chevron");
LANG_US.put("item.banner.triangle_bottom.blue", "Blue Chevron");
LANG_US.put("item.banner.triangle_bottom.purple", "Purple Chevron");
LANG_US.put("item.banner.triangle_bottom.cyan", "Cyan Chevron");
LANG_US.put("item.banner.triangle_bottom.silver", "Light Gray Chevron");
LANG_US.put("item.banner.triangle_bottom.gray", "Gray Chevron");
LANG_US.put("item.banner.triangle_bottom.pink", "Pink Chevron");
LANG_US.put("item.banner.triangle_bottom.lime", "Lime Chevron");
LANG_US.put("item.banner.triangle_bottom.yellow", "Yellow Chevron");
LANG_US.put("item.banner.triangle_bottom.lightBlue", "Light Blue Chevron");
LANG_US.put("item.banner.triangle_bottom.magenta", "Magenta Chevron");
LANG_US.put("item.banner.triangle_bottom.orange", "Orange Chevron");
LANG_US.put("item.banner.triangle_bottom.white", "White Chevron");
LANG_US.put("item.banner.triangle_top.black", "Black Inverted Chevron");
LANG_US.put("item.banner.triangle_top.red", "Red Inverted Chevron");
LANG_US.put("item.banner.triangle_top.green", "Green Inverted Chevron");
LANG_US.put("item.banner.triangle_top.brown", "Brown Inverted Chevron");
LANG_US.put("item.banner.triangle_top.blue", "Blue Inverted Chevron");
LANG_US.put("item.banner.triangle_top.purple", "Purple Inverted Chevron");
LANG_US.put("item.banner.triangle_top.cyan", "Cyan Inverted Chevron");
LANG_US.put("item.banner.triangle_top.silver", "Light Gray Inverted Chevron");
LANG_US.put("item.banner.triangle_top.gray", "Gray Inverted Chevron");
LANG_US.put("item.banner.triangle_top.pink", "Pink Inverted Chevron");
LANG_US.put("item.banner.triangle_top.lime", "Lime Inverted Chevron");
LANG_US.put("item.banner.triangle_top.yellow", "Yellow Inverted Chevron");
LANG_US.put("item.banner.triangle_top.lightBlue", "Light Blue Inverted Chevron");
LANG_US.put("item.banner.triangle_top.magenta", "Magenta Inverted Chevron");
LANG_US.put("item.banner.triangle_top.orange", "Orange Inverted Chevron");
LANG_US.put("item.banner.triangle_top.white", "White Inverted Chevron");
LANG_US.put("item.banner.triangles_bottom.black", "Black Base Indented");
LANG_US.put("item.banner.triangles_bottom.red", "Red Base Indented");
LANG_US.put("item.banner.triangles_bottom.green", "Green Base Indented");
LANG_US.put("item.banner.triangles_bottom.brown", "Brown Base Indented");
LANG_US.put("item.banner.triangles_bottom.blue", "Blue Base Indented");
LANG_US.put("item.banner.triangles_bottom.purple", "Purple Base Indented");
LANG_US.put("item.banner.triangles_bottom.cyan", "Cyan Base Indented");
LANG_US.put("item.banner.triangles_bottom.silver", "Light Gray Base Indented");
LANG_US.put("item.banner.triangles_bottom.gray", "Gray Base Indented");
LANG_US.put("item.banner.triangles_bottom.pink", "Pink Base Indented");
LANG_US.put("item.banner.triangles_bottom.lime", "Lime Base Indented");
LANG_US.put("item.banner.triangles_bottom.yellow", "Yellow Base Indented");
LANG_US.put("item.banner.triangles_bottom.lightBlue", "Light Blue Base Indented");
LANG_US.put("item.banner.triangles_bottom.magenta", "Magenta Base Indented");
LANG_US.put("item.banner.triangles_bottom.orange", "Orange Base Indented");
LANG_US.put("item.banner.triangles_bottom.white", "White Base Indented");
LANG_US.put("item.banner.triangles_top.black", "Black Chief Indented");
LANG_US.put("item.banner.triangles_top.red", "Red Chief Indented");
LANG_US.put("item.banner.triangles_top.green", "Green Chief Indented");
LANG_US.put("item.banner.triangles_top.brown", "Brown Chief Indented");
LANG_US.put("item.banner.triangles_top.blue", "Blue Chief Indented");
LANG_US.put("item.banner.triangles_top.purple", "Purple Chief Indented");
LANG_US.put("item.banner.triangles_top.cyan", "Cyan Chief Indented");
LANG_US.put("item.banner.triangles_top.silver", "Light Gray Chief Indented");
LANG_US.put("item.banner.triangles_top.gray", "Gray Chief Indented");
LANG_US.put("item.banner.triangles_top.pink", "Pink Chief Indented");
LANG_US.put("item.banner.triangles_top.lime", "Lime Chief Indented");
LANG_US.put("item.banner.triangles_top.yellow", "Yellow Chief Indented");
LANG_US.put("item.banner.triangles_top.lightBlue", "Light Blue Chief Indented");
LANG_US.put("item.banner.triangles_top.magenta", "Magenta Chief Indented");
LANG_US.put("item.banner.triangles_top.orange", "Orange Chief Indented");
LANG_US.put("item.banner.triangles_top.white", "White Chief Indented");
LANG_US.put("item.banner.diagonal_left.black", "Black Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.red", "Red Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.green", "Green Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.brown", "Brown Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.blue", "Blue Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.purple", "Purple Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.cyan", "Cyan Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.silver", "Light Gray Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.gray", "Gray Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.pink", "Pink Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.lime", "Lime Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.yellow", "Yellow Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.lightBlue", "Light Blue Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.magenta", "Magenta Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.orange", "Orange Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.white", "White Per Bend Sinister");
LANG_US.put("item.banner.diagonal_right.black", "Black Per Bend");
LANG_US.put("item.banner.diagonal_right.red", "Red Per Bend");
LANG_US.put("item.banner.diagonal_right.green", "Green Per Bend");
LANG_US.put("item.banner.diagonal_right.brown", "Brown Per Bend");
LANG_US.put("item.banner.diagonal_right.blue", "Blue Per Bend");
LANG_US.put("item.banner.diagonal_right.purple", "Purple Per Bend");
LANG_US.put("item.banner.diagonal_right.cyan", "Cyan Per Bend");
LANG_US.put("item.banner.diagonal_right.silver", "Light Gray Per Bend");
LANG_US.put("item.banner.diagonal_right.gray", "Gray Per Bend");
LANG_US.put("item.banner.diagonal_right.pink", "Pink Per Bend");
LANG_US.put("item.banner.diagonal_right.lime", "Lime Per Bend");
LANG_US.put("item.banner.diagonal_right.yellow", "Yellow Per Bend");
LANG_US.put("item.banner.diagonal_right.lightBlue", "Light Blue Per Bend");
LANG_US.put("item.banner.diagonal_right.magenta", "Magenta Per Bend");
LANG_US.put("item.banner.diagonal_right.orange", "Orange Per Bend");
LANG_US.put("item.banner.diagonal_right.white", "White Per Bend");
LANG_US.put("item.banner.diagonal_up_left.black", "Black Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.red", "Red Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.green", "Green Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.brown", "Brown Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.blue", "Blue Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.purple", "Purple Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.cyan", "Cyan Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.silver", "Light Gray Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.gray", "Gray Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.pink", "Pink Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.lime", "Lime Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.yellow", "Yellow Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.lightBlue", "Light Blue Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.magenta", "Magenta Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.orange", "Orange Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.white", "White Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_right.black", "Black Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.red", "Red Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.green", "Green Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.brown", "Brown Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.blue", "Blue Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.purple", "Purple Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.cyan", "Cyan Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.silver", "Light Gray Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.gray", "Gray Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.pink", "Pink Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.lime", "Lime Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.yellow", "Yellow Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.lightBlue", "Light Blue Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.magenta", "Magenta Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.orange", "Orange Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.white", "White Per Bend Sinister Inverted");
LANG_US.put("item.banner.circle.black", "Black Roundel");
LANG_US.put("item.banner.circle.red", "Red Roundel");
LANG_US.put("item.banner.circle.green", "Green Roundel");
LANG_US.put("item.banner.circle.brown", "Brown Roundel");
LANG_US.put("item.banner.circle.blue", "Blue Roundel");
LANG_US.put("item.banner.circle.purple", "Purple Roundel");
LANG_US.put("item.banner.circle.cyan", "Cyan Roundel");
LANG_US.put("item.banner.circle.silver", "Light Gray Roundel");
LANG_US.put("item.banner.circle.gray", "Gray Roundel");
LANG_US.put("item.banner.circle.pink", "Pink Roundel");
LANG_US.put("item.banner.circle.lime", "Lime Roundel");
LANG_US.put("item.banner.circle.yellow", "Yellow Roundel");
LANG_US.put("item.banner.circle.lightBlue", "Light Blue Roundel");
LANG_US.put("item.banner.circle.magenta", "Magenta Roundel");
LANG_US.put("item.banner.circle.orange", "Orange Roundel");
LANG_US.put("item.banner.circle.white", "White Roundel");
LANG_US.put("item.banner.rhombus.black", "Black Lozenge");
LANG_US.put("item.banner.rhombus.red", "Red Lozenge");
LANG_US.put("item.banner.rhombus.green", "Green Lozenge");
LANG_US.put("item.banner.rhombus.brown", "Brown Lozenge");
LANG_US.put("item.banner.rhombus.blue", "Blue Lozenge");
LANG_US.put("item.banner.rhombus.purple", "Purple Lozenge");
LANG_US.put("item.banner.rhombus.cyan", "Cyan Lozenge");
LANG_US.put("item.banner.rhombus.silver", "Light Gray Lozenge");
LANG_US.put("item.banner.rhombus.gray", "Gray Lozenge");
LANG_US.put("item.banner.rhombus.pink", "Pink Lozenge");
LANG_US.put("item.banner.rhombus.lime", "Lime Lozenge");
LANG_US.put("item.banner.rhombus.yellow", "Yellow Lozenge");
LANG_US.put("item.banner.rhombus.lightBlue", "Light Blue Lozenge");
LANG_US.put("item.banner.rhombus.magenta", "Magenta Lozenge");
LANG_US.put("item.banner.rhombus.orange", "Orange Lozenge");
LANG_US.put("item.banner.rhombus.white", "White Lozenge");
LANG_US.put("item.banner.half_vertical.black", "Black Per Pale");
LANG_US.put("item.banner.half_vertical.red", "Red Per Pale");
LANG_US.put("item.banner.half_vertical.green", "Green Per Pale");
LANG_US.put("item.banner.half_vertical.brown", "Brown Per Pale");
LANG_US.put("item.banner.half_vertical.blue", "Blue Per Pale");
LANG_US.put("item.banner.half_vertical.purple", "Purple Per Pale");
LANG_US.put("item.banner.half_vertical.cyan", "Cyan Per Pale");
LANG_US.put("item.banner.half_vertical.silver", "Light Gray Per Pale");
LANG_US.put("item.banner.half_vertical.gray", "Gray Per Pale");
LANG_US.put("item.banner.half_vertical.pink", "Pink Per Pale");
LANG_US.put("item.banner.half_vertical.lime", "Lime Per Pale");
LANG_US.put("item.banner.half_vertical.yellow", "Yellow Per Pale");
LANG_US.put("item.banner.half_vertical.lightBlue", "Light Blue Per Pale");
LANG_US.put("item.banner.half_vertical.magenta", "Magenta Per Pale");
LANG_US.put("item.banner.half_vertical.orange", "Orange Per Pale");
LANG_US.put("item.banner.half_vertical.white", "White Per Pale");
LANG_US.put("item.banner.half_horizontal.black", "Black Per Fess");
LANG_US.put("item.banner.half_horizontal.red", "Red Per Fess");
LANG_US.put("item.banner.half_horizontal.green", "Green Per Fess");
LANG_US.put("item.banner.half_horizontal.brown", "Brown Per Fess");
LANG_US.put("item.banner.half_horizontal.blue", "Blue Per Fess");
LANG_US.put("item.banner.half_horizontal.purple", "Purple Per Fess");
LANG_US.put("item.banner.half_horizontal.cyan", "Cyan Per Fess");
LANG_US.put("item.banner.half_horizontal.silver", "Light Gray Per Fess");
LANG_US.put("item.banner.half_horizontal.gray", "Gray Per Fess");
LANG_US.put("item.banner.half_horizontal.pink", "Pink Per Fess");
LANG_US.put("item.banner.half_horizontal.lime", "Lime Per Fess");
LANG_US.put("item.banner.half_horizontal.yellow", "Yellow Per Fess");
LANG_US.put("item.banner.half_horizontal.lightBlue", "Light Blue Per Fess");
LANG_US.put("item.banner.half_horizontal.magenta", "Magenta Per Fess");
LANG_US.put("item.banner.half_horizontal.orange", "Orange Per Fess");
LANG_US.put("item.banner.half_horizontal.white", "White Per Fess");
LANG_US.put("item.banner.half_vertical_right.black", "Black Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.red", "Red Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.green", "Green Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.brown", "Brown Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.blue", "Blue Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.purple", "Purple Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.cyan", "Cyan Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.silver", "Light Gray Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.gray", "Gray Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.pink", "Pink Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.lime", "Lime Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.yellow", "Yellow Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.lightBlue", "Light Blue Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.magenta", "Magenta Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.orange", "Orange Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.white", "White Per Pale Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.black", "Black Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.red", "Red Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.green", "Green Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.brown", "Brown Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.blue", "Blue Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.purple", "Purple Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.cyan", "Cyan Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.silver", "Light Gray Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.gray", "Gray Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.pink", "Pink Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.lime", "Lime Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.yellow", "Yellow Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.lightBlue", "Light Blue Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.magenta", "Magenta Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.orange", "Orange Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.white", "White Per Fess Inverted");
LANG_US.put("item.banner.creeper.black", "Black Creeper Charge");
LANG_US.put("item.banner.creeper.red", "Red Creeper Charge");
LANG_US.put("item.banner.creeper.green", "Green Creeper Charge");
LANG_US.put("item.banner.creeper.brown", "Brown Creeper Charge");
LANG_US.put("item.banner.creeper.blue", "Blue Creeper Charge");
LANG_US.put("item.banner.creeper.purple", "Purple Creeper Charge");
LANG_US.put("item.banner.creeper.cyan", "Cyan Creeper Charge");
LANG_US.put("item.banner.creeper.silver", "Light Gray Creeper Charge");
LANG_US.put("item.banner.creeper.gray", "Gray Creeper Charge");
LANG_US.put("item.banner.creeper.pink", "Pink Creeper Charge");
LANG_US.put("item.banner.creeper.lime", "Lime Creeper Charge");
LANG_US.put("item.banner.creeper.yellow", "Yellow Creeper Charge");
LANG_US.put("item.banner.creeper.lightBlue", "Light Blue Creeper Charge");
LANG_US.put("item.banner.creeper.magenta", "Magenta Creeper Charge");
LANG_US.put("item.banner.creeper.orange", "Orange Creeper Charge");
LANG_US.put("item.banner.creeper.white", "White Creeper Charge");
LANG_US.put("item.banner.bricks.black", "Black Field Masoned");
LANG_US.put("item.banner.bricks.red", "Red Field Masoned");
LANG_US.put("item.banner.bricks.green", "Green Field Masoned");
LANG_US.put("item.banner.bricks.brown", "Brown Field Masoned");
LANG_US.put("item.banner.bricks.blue", "Blue Field Masoned");
LANG_US.put("item.banner.bricks.purple", "Purple Field Masoned");
LANG_US.put("item.banner.bricks.cyan", "Cyan Field Masoned");
LANG_US.put("item.banner.bricks.silver", "Light Gray Field Masoned");
LANG_US.put("item.banner.bricks.gray", "Gray Field Masoned");
LANG_US.put("item.banner.bricks.pink", "Pink Field Masoned");
LANG_US.put("item.banner.bricks.lime", "Lime Field Masoned");
LANG_US.put("item.banner.bricks.yellow", "Yellow Field Masoned");
LANG_US.put("item.banner.bricks.lightBlue", "Light Blue Field Masoned");
LANG_US.put("item.banner.bricks.magenta", "Magenta Field Masoned");
LANG_US.put("item.banner.bricks.orange", "Orange Field Masoned");
LANG_US.put("item.banner.bricks.white", "White Field Masoned");
LANG_US.put("item.banner.gradient.black", "Black Gradient");
LANG_US.put("item.banner.gradient.red", "Red Gradient");
LANG_US.put("item.banner.gradient.green", "Green Gradient");
LANG_US.put("item.banner.gradient.brown", "Brown Gradient");
LANG_US.put("item.banner.gradient.blue", "Blue Gradient");
LANG_US.put("item.banner.gradient.purple", "Purple Gradient");
LANG_US.put("item.banner.gradient.cyan", "Cyan Gradient");
LANG_US.put("item.banner.gradient.silver", "Light Gray Gradient");
LANG_US.put("item.banner.gradient.gray", "Gray Gradient");
LANG_US.put("item.banner.gradient.pink", "Pink Gradient");
LANG_US.put("item.banner.gradient.lime", "Lime Gradient");
LANG_US.put("item.banner.gradient.yellow", "Yellow Gradient");
LANG_US.put("item.banner.gradient.lightBlue", "Light Blue Gradient");
LANG_US.put("item.banner.gradient.magenta", "Magenta Gradient");
LANG_US.put("item.banner.gradient.orange", "Orange Gradient");
LANG_US.put("item.banner.gradient.white", "White Gradient");
LANG_US.put("item.banner.gradient_up.black", "Black Base Gradient");
LANG_US.put("item.banner.gradient_up.red", "Red Base Gradient");
LANG_US.put("item.banner.gradient_up.green", "Green Base Gradient");
LANG_US.put("item.banner.gradient_up.brown", "Brown Base Gradient");
LANG_US.put("item.banner.gradient_up.blue", "Blue Base Gradient");
LANG_US.put("item.banner.gradient_up.purple", "Purple Base Gradient");
LANG_US.put("item.banner.gradient_up.cyan", "Cyan Base Gradient");
LANG_US.put("item.banner.gradient_up.silver", "Light Gray Base Gradient");
LANG_US.put("item.banner.gradient_up.gray", "Gray Base Gradient");
LANG_US.put("item.banner.gradient_up.pink", "Pink Base Gradient");
LANG_US.put("item.banner.gradient_up.lime", "Lime Base Gradient");
LANG_US.put("item.banner.gradient_up.yellow", "Yellow Base Gradient");
LANG_US.put("item.banner.gradient_up.lightBlue", "Light Blue Base Gradient");
LANG_US.put("item.banner.gradient_up.magenta", "Magenta Base Gradient");
LANG_US.put("item.banner.gradient_up.orange", "Orange Base Gradient");
LANG_US.put("item.banner.gradient_up.white", "White Base Gradient");
LANG_US.put("item.banner.skull.black", "Black Skull Charge");
LANG_US.put("item.banner.skull.red", "Red Skull Charge");
LANG_US.put("item.banner.skull.green", "Green Skull Charge");
LANG_US.put("item.banner.skull.brown", "Brown Skull Charge");
LANG_US.put("item.banner.skull.blue", "Blue Skull Charge");
LANG_US.put("item.banner.skull.purple", "Purple Skull Charge");
LANG_US.put("item.banner.skull.cyan", "Cyan Skull Charge");
LANG_US.put("item.banner.skull.silver", "Light Gray Skull Charge");
LANG_US.put("item.banner.skull.gray", "Gray Skull Charge");
LANG_US.put("item.banner.skull.pink", "Pink Skull Charge");
LANG_US.put("item.banner.skull.lime", "Lime Skull Charge");
LANG_US.put("item.banner.skull.yellow", "Yellow Skull Charge");
LANG_US.put("item.banner.skull.lightBlue", "Light Blue Skull Charge");
LANG_US.put("item.banner.skull.magenta", "Magenta Skull Charge");
LANG_US.put("item.banner.skull.orange", "Orange Skull Charge");
LANG_US.put("item.banner.skull.white", "White Skull Charge");
LANG_US.put("item.banner.flower.black", "Black Flower Charge");
LANG_US.put("item.banner.flower.red", "Red Flower Charge");
LANG_US.put("item.banner.flower.green", "Green Flower Charge");
LANG_US.put("item.banner.flower.brown", "Brown Flower Charge");
LANG_US.put("item.banner.flower.blue", "Blue Flower Charge");
LANG_US.put("item.banner.flower.purple", "Purple Flower Charge");
LANG_US.put("item.banner.flower.cyan", "Cyan Flower Charge");
LANG_US.put("item.banner.flower.silver", "Light Gray Flower Charge");
LANG_US.put("item.banner.flower.gray", "Gray Flower Charge");
LANG_US.put("item.banner.flower.pink", "Pink Flower Charge");
LANG_US.put("item.banner.flower.lime", "Lime Flower Charge");
LANG_US.put("item.banner.flower.yellow", "Yellow Flower Charge");
LANG_US.put("item.banner.flower.lightBlue", "Light Blue Flower Charge");
LANG_US.put("item.banner.flower.magenta", "Magenta Flower Charge");
LANG_US.put("item.banner.flower.orange", "Orange Flower Charge");
LANG_US.put("item.banner.flower.white", "White Flower Charge");
LANG_US.put("item.banner.border.black", "Black Bordure");
LANG_US.put("item.banner.border.red", "Red Bordure");
LANG_US.put("item.banner.border.green", "Green Bordure");
LANG_US.put("item.banner.border.brown", "Brown Bordure");
LANG_US.put("item.banner.border.blue", "Blue Bordure");
LANG_US.put("item.banner.border.purple", "Purple Bordure");
LANG_US.put("item.banner.border.cyan", "Cyan Bordure");
LANG_US.put("item.banner.border.silver", "Light Gray Bordure");
LANG_US.put("item.banner.border.gray", "Gray Bordure");
LANG_US.put("item.banner.border.pink", "Pink Bordure");
LANG_US.put("item.banner.border.lime", "Lime Bordure");
LANG_US.put("item.banner.border.yellow", "Yellow Bordure");
LANG_US.put("item.banner.border.lightBlue", "Light Blue Bordure");
LANG_US.put("item.banner.border.magenta", "Magenta Bordure");
LANG_US.put("item.banner.border.orange", "Orange Bordure");
LANG_US.put("item.banner.border.white", "White Bordure");
LANG_US.put("item.banner.curly_border.black", "Black Bordure Indented");
LANG_US.put("item.banner.curly_border.red", "Red Bordure Indented");
LANG_US.put("item.banner.curly_border.green", "Green Bordure Indented");
LANG_US.put("item.banner.curly_border.brown", "Brown Bordure Indented");
LANG_US.put("item.banner.curly_border.blue", "Blue Bordure Indented");
LANG_US.put("item.banner.curly_border.purple", "Purple Bordure Indented");
LANG_US.put("item.banner.curly_border.cyan", "Cyan Bordure Indented");
LANG_US.put("item.banner.curly_border.silver", "Light Gray Bordure Indented");
LANG_US.put("item.banner.curly_border.gray", "Gray Bordure Indented");
LANG_US.put("item.banner.curly_border.pink", "Pink Bordure Indented");
LANG_US.put("item.banner.curly_border.lime", "Lime Bordure Indented");
LANG_US.put("item.banner.curly_border.yellow", "Yellow Bordure Indented");
LANG_US.put("item.banner.curly_border.lightBlue", "Light Blue Bordure Indented");
LANG_US.put("item.banner.curly_border.magenta", "Magenta Bordure Indented");
LANG_US.put("item.banner.curly_border.orange", "Orange Bordure Indented");
LANG_US.put("item.banner.curly_border.white", "White Bordure Indented");
LANG_US.put("item.banner.mojang.black", "Black Thing");
LANG_US.put("item.banner.mojang.red", "Red Thing");
LANG_US.put("item.banner.mojang.green", "Green Thing");
LANG_US.put("item.banner.mojang.brown", "Brown Thing");
LANG_US.put("item.banner.mojang.blue", "Blue Thing");
LANG_US.put("item.banner.mojang.purple", "Purple Thing");
LANG_US.put("item.banner.mojang.cyan", "Cyan Thing");
LANG_US.put("item.banner.mojang.silver", "Light Gray Thing");
LANG_US.put("item.banner.mojang.gray", "Gray Thing");
LANG_US.put("item.banner.mojang.pink", "Pink Thing");
LANG_US.put("item.banner.mojang.lime", "Lime Thing");
LANG_US.put("item.banner.mojang.yellow", "Yellow Thing");
LANG_US.put("item.banner.mojang.lightBlue", "Light Blue Thing");
LANG_US.put("item.banner.mojang.magenta", "Magenta Thing");
LANG_US.put("item.banner.mojang.orange", "Orange Thing");
LANG_US.put("item.banner.mojang.white", "White Thing");
LANG_US.put("item.banner.straight_cross.black", "Black Cross");
LANG_US.put("item.banner.straight_cross.red", "Red Cross");
LANG_US.put("item.banner.straight_cross.green", "Green Cross");
LANG_US.put("item.banner.straight_cross.brown", "Brown Cross");
LANG_US.put("item.banner.straight_cross.blue", "Blue Cross");
LANG_US.put("item.banner.straight_cross.purple", "Purple Cross");
LANG_US.put("item.banner.straight_cross.cyan", "Cyan Cross");
LANG_US.put("item.banner.straight_cross.silver", "Light Gray Cross");
LANG_US.put("item.banner.straight_cross.gray", "Gray Cross");
LANG_US.put("item.banner.straight_cross.pink", "Pink Cross");
LANG_US.put("item.banner.straight_cross.lime", "Lime Cross");
LANG_US.put("item.banner.straight_cross.yellow", "Yellow Cross");
LANG_US.put("item.banner.straight_cross.lightBlue", "Light Blue Cross");
LANG_US.put("item.banner.straight_cross.magenta", "Magenta Cross");
LANG_US.put("item.banner.straight_cross.orange", "Orange Cross");
LANG_US.put("item.banner.straight_cross.white", "White Cross");
LANG_US.put("subtitles.ambient.cave", "Eerie noise");
LANG_US.put("subtitles.block.anvil.destroy", "Anvil destroyed");
LANG_US.put("subtitles.block.anvil.land", "Anvil landed");
LANG_US.put("subtitles.block.anvil.use", "Anvil used");
LANG_US.put("subtitles.block.brewing_stand.brew", "Brewing Stand bubbles");
LANG_US.put("subtitles.block.button.click", "Button clicks");
LANG_US.put("subtitles.block.chest.close", "Chest closes");
LANG_US.put("subtitles.block.chest.locked", "Chest locked");
LANG_US.put("subtitles.block.chest.open", "Chest opens");
LANG_US.put("subtitles.block.chorus_flower.death", "Chorus Flower withers");
LANG_US.put("subtitles.block.chorus_flower.grow", "Chorus Flower grows");
LANG_US.put("subtitles.block.comparator.click", "Comparator clicks");
LANG_US.put("subtitles.block.dispenser.dispense", "Dispensed item");
LANG_US.put("subtitles.block.dispenser.fail", "Dispenser failed");
LANG_US.put("subtitles.block.door.toggle", "Door creaks");
LANG_US.put("subtitles.block.fence_gate.toggle", "Fence Gate creaks");
LANG_US.put("subtitles.block.fire.ambient", "Fire crackles");
LANG_US.put("subtitles.block.fire.extinguish", "Fire extinguished");
LANG_US.put("subtitles.block.furnace.fire_crackle", "Furnace crackles");
LANG_US.put("subtitles.block.generic.break", "Block broken");
LANG_US.put("subtitles.block.generic.footsteps", "Footsteps");
LANG_US.put("subtitles.block.generic.hit", "Block breaking");
LANG_US.put("subtitles.block.generic.place", "Block placed");
LANG_US.put("subtitles.block.iron_trapdoor.close", "Trapdoor opens");
LANG_US.put("subtitles.block.iron_trapdoor.open", "Trapdoor closes");
LANG_US.put("subtitles.block.lava.ambient", "Lava pops");
LANG_US.put("subtitles.block.lava.extinguish", "Lava hisses");
LANG_US.put("subtitles.block.lever.click", "Lever clicks");
LANG_US.put("subtitles.block.note.note", "Note Block plays");
LANG_US.put("subtitles.block.piston.move", "Piston moves");
LANG_US.put("subtitles.block.portal.ambient", "Portal whooshes");
LANG_US.put("subtitles.block.pressure_plate.click", "Pressure Plate clicks");
LANG_US.put("subtitles.block.redstone_torch.burnout", "Torch fizzes");
LANG_US.put("subtitles.block.shulker_box.close", "Shulker closes");
LANG_US.put("subtitles.block.shulker_box.open", "Shulker opens");
LANG_US.put("subtitles.block.trapdoor.toggle", "Trapdoor creaks");
LANG_US.put("subtitles.block.tripwire.attach", "Tripwire attaches");
LANG_US.put("subtitles.block.tripwire.click", "Tripwire clicks");
LANG_US.put("subtitles.block.tripwire.detach", "Tripwire detaches");
LANG_US.put("subtitles.block.water.ambient", "Water flows");
LANG_US.put("subtitles.enchant.thorns.hit", "Thorns prick");
LANG_US.put("subtitles.entity.armorstand.fall", "Something fell");
LANG_US.put("subtitles.entity.arrow.hit", "Arrow hits");
LANG_US.put("subtitles.entity.arrow.hit_player", "Player hit");
LANG_US.put("subtitles.entity.arrow.shoot", "Arrow fired");
LANG_US.put("subtitles.entity.bat.ambient", "Bat screeches");
LANG_US.put("subtitles.entity.bat.death", "Bat dies");
LANG_US.put("subtitles.entity.bat.hurt", "Bat hurts");
LANG_US.put("subtitles.entity.bat.takeoff", "Bat takes off");
LANG_US.put("subtitles.entity.blaze.ambient", "Blaze breathes");
LANG_US.put("subtitles.entity.blaze.burn", "Blaze crackles");
LANG_US.put("subtitles.entity.blaze.death", "Blaze dies");
LANG_US.put("subtitles.entity.blaze.hurt", "Blaze hurts");
LANG_US.put("subtitles.entity.blaze.shoot", "Blaze shoots");
LANG_US.put("subtitles.entity.bobber.splash", "Fishing hook splashes");
LANG_US.put("subtitles.entity.bobber.throw", "Bobber thrown");
LANG_US.put("subtitles.entity.cat.ambient", "Cat meows");
LANG_US.put("subtitles.entity.cat.death", "Cat dies");
LANG_US.put("subtitles.entity.cat.hurt", "Cat hurts");
LANG_US.put("subtitles.entity.chicken.ambient", "Chicken clucks");
LANG_US.put("subtitles.entity.chicken.death", "Chicken dies");
LANG_US.put("subtitles.entity.chicken.egg", "Chicken plops");
LANG_US.put("subtitles.entity.chicken.hurt", "Chicken hurts");
LANG_US.put("subtitles.entity.parrot.ambient", "Parrot talks");
LANG_US.put("subtitles.entity.parrot.death", "Parrot dies");
LANG_US.put("subtitles.entity.parrot.eats", "Parrot eats");
LANG_US.put("subtitles.entity.parrot.hurts", "Parrot hurts");
LANG_US.put("subtitles.entity.parrot.imitate.blaze", "Parrot breathes");
LANG_US.put("subtitles.entity.parrot.imitate.cave_spider", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.creeper", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.elder_guardian", "Parrot flaps");
LANG_US.put("subtitles.entity.parrot.imitate.enderdragon", "Parrot roars");
LANG_US.put("subtitles.entity.parrot.imitate.enderman", "Parrot vwoops");
LANG_US.put("subtitles.entity.parrot.imitate.endermite", "Parrot scuttles");
LANG_US.put("subtitles.entity.parrot.imitate.evocation_illager", "Parrot murmurs");
LANG_US.put("subtitles.entity.parrot.imitate.ghast", "Parrot cries");
LANG_US.put("subtitles.entity.parrot.imitate.husk", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.illusion_illager", "Parrot murmurs");
LANG_US.put("subtitles.entity.parrot.imitate.magmacube", "Parrot squishes");
LANG_US.put("subtitles.entity.parrot.imitate.polar_bear", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.shulker", "Parrot lurks");
LANG_US.put("subtitles.entity.parrot.imitate.silverfish", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.skeleton", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.slime", "Parrot squishes");
LANG_US.put("subtitles.entity.parrot.imitate.spider", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.stray", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.vex", "Parrot vexes");
LANG_US.put("subtitles.entity.parrot.imitate.vindication_illager", "Parrot mutters");
LANG_US.put("subtitles.entity.parrot.imitate.witch", "Parrot giggles");
LANG_US.put("subtitles.entity.parrot.imitate.wither", "Parrot angers");
LANG_US.put("subtitles.entity.parrot.imitate.wither_skeleton", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.wolf", "Parrot pants");
LANG_US.put("subtitles.entity.parrot.imitate.zombie", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.zombie_pigman", "Parrot grunts");
LANG_US.put("subtitles.entity.parrot.imitate.zombie_villager", "Parrot groans");
LANG_US.put("subtitles.entity.cow.ambient", "Cow moos");
LANG_US.put("subtitles.entity.cow.death", "Cow dies");
LANG_US.put("subtitles.entity.cow.hurt", "Cow hurts");
LANG_US.put("subtitles.entity.cow.milk", "Cow gets milked");
LANG_US.put("subtitles.entity.creeper.death", "Creeper dies");
LANG_US.put("subtitles.entity.creeper.hurt", "Creeper hurts");
LANG_US.put("subtitles.entity.creeper.primed", "Creeper hisses");
LANG_US.put("subtitles.entity.donkey.ambient", "Donkey hee-haws");
LANG_US.put("subtitles.entity.donkey.angry", "Donkey neighs");
LANG_US.put("subtitles.entity.donkey.chest", "Donkey Chest equips");
LANG_US.put("subtitles.entity.donkey.death", "Donkey dies");
LANG_US.put("subtitles.entity.donkey.hurt", "Donkey hurts");
LANG_US.put("subtitles.entity.egg.throw", "Egg flies");
LANG_US.put("subtitles.entity.elder_guardian.ambient.land", "Elder Guardian flaps");
LANG_US.put("subtitles.entity.elder_guardian.ambient", "Elder Guardian moans");
LANG_US.put("subtitles.entity.elder_guardian.attack", "Elder Guardian shoots");
LANG_US.put("subtitles.entity.elder_guardian.curse", "Elder Guardian curses");
LANG_US.put("subtitles.entity.elder_guardian.death", "Elder Guardian dies");
LANG_US.put("subtitles.entity.elder_guardian.flop", "Elder Guardian flops");
LANG_US.put("subtitles.entity.elder_guardian.hurt", "Elder Guardian hurts");
LANG_US.put("subtitles.entity.enderdragon.ambient", "Dragon roars");
LANG_US.put("subtitles.entity.enderdragon.death", "Dragon dies");
LANG_US.put("subtitles.entity.enderdragon.flap", "Dragon flaps");
LANG_US.put("subtitles.entity.enderdragon.growl", "Dragon growls");
LANG_US.put("subtitles.entity.enderdragon.hurt", "Dragon hurts");
LANG_US.put("subtitles.entity.enderdragon.shoot", "Dragon shoots");
LANG_US.put("subtitles.entity.endereye.launch", "Eye of Ender shoots");
LANG_US.put("subtitles.entity.enderman.ambient", "Enderman vwoops");
LANG_US.put("subtitles.entity.enderman.death", "Enderman dies");
LANG_US.put("subtitles.entity.enderman.hurt", "Enderman hurts");
LANG_US.put("subtitles.entity.enderman.stare", "Enderman cries out");
LANG_US.put("subtitles.entity.enderman.teleport", "Enderman teleports");
LANG_US.put("subtitles.entity.endermite.ambient", "Endermite scuttles");
LANG_US.put("subtitles.entity.endermite.death", "Endermite dies");
LANG_US.put("subtitles.entity.endermite.hurt", "Endermite hurts");
LANG_US.put("subtitles.entity.enderpearl.throw", "Ender Pearl flies");
LANG_US.put("subtitles.entity.evocation_fangs.attack", "Fangs snap");
LANG_US.put("subtitles.entity.evocation_illager.ambient", "Evoker murmurs");
LANG_US.put("subtitles.entity.evocation_illager.cast_spell", "Evoker casts spell");
LANG_US.put("subtitles.entity.evocation_illager.death", "Evoker dies");
LANG_US.put("subtitles.entity.evocation_illager.hurt", "Evoker hurts");
LANG_US.put("subtitles.entity.evocation_illager.prepare_attack", "Evoker prepares attack");
LANG_US.put("subtitles.entity.evocation_illager.prepare_summon", "Evoker prepares summoning");
LANG_US.put("subtitles.entity.evocation_illager.prepare_wololo", "Evoker prepares charming");
LANG_US.put("subtitles.entity.experience_orb.pickup", "Experience gained");
LANG_US.put("subtitles.entity.firework.blast", "Firework blasts");
LANG_US.put("subtitles.entity.firework.launch", "Firework launches");
LANG_US.put("subtitles.entity.firework.twinkle", "Firework twinkles");
LANG_US.put("subtitles.entity.generic.big_fall", "Something fell");
LANG_US.put("subtitles.entity.generic.burn", "Burning");
LANG_US.put("subtitles.entity.generic.death", "Dying");
LANG_US.put("subtitles.entity.generic.drink", "Sipping");
LANG_US.put("subtitles.entity.generic.eat", "Eating");
LANG_US.put("subtitles.entity.generic.explode", "Explosion");
LANG_US.put("subtitles.entity.generic.extinguish_fire", "Fire extinguishes");
LANG_US.put("subtitles.entity.generic.hurt", "Something hurts");
LANG_US.put("subtitles.entity.generic.small_fall", "Something tripped");
LANG_US.put("subtitles.entity.generic.splash", "Splashing");
LANG_US.put("subtitles.entity.generic.swim", "Swimming");
LANG_US.put("subtitles.entity.ghast.ambient", "Ghast cries");
LANG_US.put("subtitles.entity.ghast.death", "Ghast dies");
LANG_US.put("subtitles.entity.ghast.hurt", "Ghast hurts");
LANG_US.put("subtitles.entity.ghast.shoot", "Ghast shoots");
LANG_US.put("subtitles.entity.guardian.ambient.land", "Guardian flaps");
LANG_US.put("subtitles.entity.guardian.ambient", "Guardian moans");
LANG_US.put("subtitles.entity.guardian.attack", "Guardian shoots");
LANG_US.put("subtitles.entity.guardian.curse", "Guardian curses");
LANG_US.put("subtitles.entity.guardian.death", "Guardian dies");
LANG_US.put("subtitles.entity.guardian.flop", "Guardian flops");
LANG_US.put("subtitles.entity.guardian.hurt", "Guardian hurts");
LANG_US.put("subtitles.entity.horse.ambient", "Horse neighs");
LANG_US.put("subtitles.entity.horse.angry", "Horse neighs");
LANG_US.put("subtitles.entity.horse.armor", "Horse armor equips");
LANG_US.put("subtitles.entity.horse.breathe", "Horse breathes");
LANG_US.put("subtitles.entity.horse.death", "Horse dies");
LANG_US.put("subtitles.entity.horse.eat", "Horse eats");
LANG_US.put("subtitles.entity.horse.gallop", "Horse gallops");
LANG_US.put("subtitles.entity.horse.hurt", "Horse hurts");
LANG_US.put("subtitles.entity.horse.jump", "Horse jumps");
LANG_US.put("subtitles.entity.horse.saddle", "Saddle equips");
LANG_US.put("subtitles.entity.husk.ambient", "Husk groans");
LANG_US.put("subtitles.entity.husk.death", "Husk dies");
LANG_US.put("subtitles.entity.husk.hurt", "Husk hurts");
LANG_US.put("subtitles.entity.illusion_illager.ambient", "Illusioner murmurs");
LANG_US.put("subtitles.entity.illusion_illager.cast_spell", "Illusioner casts spell");
LANG_US.put("subtitles.entity.illusion_illager.death", "Illusioner dies");
LANG_US.put("subtitles.entity.illusion_illager.hurt", "Illusioner hurts");
LANG_US.put("subtitles.entity.illusion_illager.mirror_move", "Illusioner displaces");
LANG_US.put("subtitles.entity.illusion_illager.prepare_blindness", "Illusioner prepares blindness");
LANG_US.put("subtitles.entity.illusion_illager.prepare_mirror", "Illusioner prepares mirror image");
LANG_US.put("subtitles.entity.iron_golem.attack", "Iron Golem attacks");
LANG_US.put("subtitles.entity.iron_golem.death", "Iron Golem dies");
LANG_US.put("subtitles.entity.iron_golem.hurt", "Iron Golem hurts");
LANG_US.put("subtitles.entity.item.break", "Item breaks");
LANG_US.put("subtitles.entity.item.pickup", "Item plops");
LANG_US.put("subtitles.entity.itemframe.add_item", "Item Frame fills");
LANG_US.put("subtitles.entity.itemframe.break", "Item Frame breaks");
LANG_US.put("subtitles.entity.itemframe.place", "Item Frame placed");
LANG_US.put("subtitles.entity.itemframe.remove_item", "Item Frame empties");
LANG_US.put("subtitles.entity.itemframe.rotate_item", "Item Frame clicks");
LANG_US.put("subtitles.entity.leashknot.break", "Leash knot breaks");
LANG_US.put("subtitles.entity.leashknot.place", "Leash knot tied");
LANG_US.put("subtitles.entity.lightning.impact", "Lightning strikes");
LANG_US.put("subtitles.entity.lightning.thunder", "Thunder roars");
LANG_US.put("subtitles.entity.llama.ambient", "Llama bleats");
LANG_US.put("subtitles.entity.llama.angry", "Llama bleats angry");
LANG_US.put("subtitles.entity.llama.chest", "Llama Chest equips");
LANG_US.put("subtitles.entity.llama.death", "Llama dies");
LANG_US.put("subtitles.entity.llama.eat", "Llama eats");
LANG_US.put("subtitles.entity.llama.hurt", "Llama hurts");
LANG_US.put("subtitles.entity.llama.spit", "Llama spits");
LANG_US.put("subtitles.entity.llama.step", "Llama steps");
LANG_US.put("subtitles.entity.llama.swag", "Llama is decorated");
LANG_US.put("subtitles.entity.magmacube.death", "Magma Cube dies");
LANG_US.put("subtitles.entity.magmacube.hurt", "Magma Cube hurts");
LANG_US.put("subtitles.entity.magmacube.squish", "Magma Cube squishes");
LANG_US.put("subtitles.entity.minecart.riding", "Minecart rolls");
LANG_US.put("subtitles.entity.mule.ambient", "Mule hee-haws");
LANG_US.put("subtitles.entity.mule.chest", "Mule Chest equips");
LANG_US.put("subtitles.entity.mule.death", "Mule dies");
LANG_US.put("subtitles.entity.mule.hurt", "Mule hurts");
LANG_US.put("subtitles.entity.painting.break", "Painting breaks");
LANG_US.put("subtitles.entity.painting.place", "Painting placed");
LANG_US.put("subtitles.entity.pig.ambient", "Pig oinks");
LANG_US.put("subtitles.entity.pig.death", "Pig dies");
LANG_US.put("subtitles.entity.pig.hurt", "Pig hurts");
LANG_US.put("subtitles.entity.pig.saddle", "Saddle equips");
LANG_US.put("subtitles.entity.player.burp", "Burp");
LANG_US.put("subtitles.entity.player.death", "Player dies");
LANG_US.put("subtitles.entity.player.hurt", "Player hurts");
LANG_US.put("subtitles.entity.player.levelup", "Player dings");
LANG_US.put("subtitles.entity.polar_bear.ambient", "Polar Bear groans");
LANG_US.put("subtitles.entity.polar_bear.baby_ambient", "Polar Bear hums");
LANG_US.put("subtitles.entity.polar_bear.death", "Polar Bear dies");
LANG_US.put("subtitles.entity.polar_bear.hurt", "Polar Bear hurts");
LANG_US.put("subtitles.entity.polar_bear.warning", "Polar Bear roars");
LANG_US.put("subtitles.entity.potion.splash", "Bottle smashes");
LANG_US.put("subtitles.entity.potion.throw", "Bottle thrown");
LANG_US.put("subtitles.entity.rabbit.ambient", "Rabbit squeaks");
LANG_US.put("subtitles.entity.rabbit.attack", "Rabbit attacks");
LANG_US.put("subtitles.entity.rabbit.death", "Rabbit dies");
LANG_US.put("subtitles.entity.rabbit.hurt", "Rabbit hurts");
LANG_US.put("subtitles.entity.rabbit.jump", "Rabbit hops");
LANG_US.put("subtitles.entity.sheep.ambient", "Sheep baahs");
LANG_US.put("subtitles.entity.sheep.death", "Sheep dies");
LANG_US.put("subtitles.entity.sheep.hurt", "Sheep hurts");
LANG_US.put("subtitles.entity.shulker.ambient", "Shulker lurks");
LANG_US.put("subtitles.entity.shulker.close", "Shulker closes");
LANG_US.put("subtitles.entity.shulker.death", "Shulker dies");
LANG_US.put("subtitles.entity.shulker.hurt", "Shulker hurts");
LANG_US.put("subtitles.entity.shulker.open", "Shulker opens");
LANG_US.put("subtitles.entity.shulker.shoot", "Shulker shoots");
LANG_US.put("subtitles.entity.shulker.teleport", "Shulker teleports");
LANG_US.put("subtitles.entity.shulker_bullet.hit", "Shulker bullet explodes");
LANG_US.put("subtitles.entity.shulker_bullet.hurt", "Shulker bullet breaks");
LANG_US.put("subtitles.entity.silverfish.ambient", "Silverfish hisses");
LANG_US.put("subtitles.entity.silverfish.death", "Silverfish dies");
LANG_US.put("subtitles.entity.silverfish.hurt", "Silverfish hurts");
LANG_US.put("subtitles.entity.skeleton.ambient", "Skeleton rattles");
LANG_US.put("subtitles.entity.skeleton.death", "Skeleton dies");
LANG_US.put("subtitles.entity.skeleton.hurt", "Skeleton hurts");
LANG_US.put("subtitles.entity.skeleton.shoot", "Skeleton shoots");
LANG_US.put("subtitles.entity.skeleton_horse.ambient", "Skeleton Horse cries");
LANG_US.put("subtitles.entity.skeleton_horse.death", "Skeleton Horse dies");
LANG_US.put("subtitles.entity.skeleton_horse.hurt", "Skeleton Horse hurts");
LANG_US.put("subtitles.entity.slime.attack", "Slime attacks");
LANG_US.put("subtitles.entity.slime.death", "Slime dies");
LANG_US.put("subtitles.entity.slime.hurt", "Slime hurts");
LANG_US.put("subtitles.entity.slime.squish", "Slime squishes");
LANG_US.put("subtitles.entity.snowball.throw", "Snowball flies");
LANG_US.put("subtitles.entity.snowman.death", "Snow Golem dies");
LANG_US.put("subtitles.entity.snowman.hurt", "Snow Golem hurts");
LANG_US.put("subtitles.entity.spider.ambient", "Spider hisses");
LANG_US.put("subtitles.entity.spider.death", "Spider dies");
LANG_US.put("subtitles.entity.spider.hurt", "Spider hurts");
LANG_US.put("subtitles.entity.squid.ambient", "Squid swims");
LANG_US.put("subtitles.entity.squid.death", "Squid dies");
LANG_US.put("subtitles.entity.squid.hurt", "Squid hurts");
LANG_US.put("subtitles.entity.stray.ambient", "Stray rattles");
LANG_US.put("subtitles.entity.stray.death", "Stray dies");
LANG_US.put("subtitles.entity.stray.hurt", "Stray hurts");
LANG_US.put("subtitles.entity.tnt.primed", "TNT fizzes");
LANG_US.put("subtitles.entity.vex.ambient", "Vex vexes");
LANG_US.put("subtitles.entity.vex.charge", "Vex shrieks");
LANG_US.put("subtitles.entity.vex.death", "Vex dies");
LANG_US.put("subtitles.entity.vex.hurt", "Vex hurts");
LANG_US.put("subtitles.entity.villager.ambient", "Villager mumbles");
LANG_US.put("subtitles.entity.villager.death", "Villager dies");
LANG_US.put("subtitles.entity.villager.hurt", "Villager hurts");
LANG_US.put("subtitles.entity.villager.no", "Villager disagrees");
LANG_US.put("subtitles.entity.villager.trading", "Villager trades");
LANG_US.put("subtitles.entity.villager.yes", "Villager agrees");
LANG_US.put("subtitles.entity.vindication_illager.ambient", "Vindicator mutters");
LANG_US.put("subtitles.entity.vindication_illager.death", "Vindicator dies");
LANG_US.put("subtitles.entity.vindication_illager.hurt", "Vindicator hurts");
LANG_US.put("subtitles.entity.witch.ambient", "Witch giggles");
LANG_US.put("subtitles.entity.witch.death", "Witch dies");
LANG_US.put("subtitles.entity.witch.drink", "Witch drinks");
LANG_US.put("subtitles.entity.witch.hurt", "Witch hurts");
LANG_US.put("subtitles.entity.witch.throw", "Witch throws");
LANG_US.put("subtitles.entity.wither.ambient", "Wither angers");
LANG_US.put("subtitles.entity.wither.death", "Wither dies");
LANG_US.put("subtitles.entity.wither.hurt", "Wither hurts");
LANG_US.put("subtitles.entity.wither.shoot", "Wither attacks");
LANG_US.put("subtitles.entity.wither.spawn", "Wither released");
LANG_US.put("subtitles.entity.wither_skeleton.ambient", "Wither Skeleton rattles");
LANG_US.put("subtitles.entity.wither_skeleton.death", "Wither Skeleton dies");
LANG_US.put("subtitles.entity.wither_skeleton.hurt", "Wither Skeleton hurts");
LANG_US.put("subtitles.entity.wolf.ambient", "Wolf pants");
LANG_US.put("subtitles.entity.wolf.death", "Wolf dies");
LANG_US.put("subtitles.entity.wolf.growl", "Wolf growls");
LANG_US.put("subtitles.entity.wolf.hurt", "Wolf hurts");
LANG_US.put("subtitles.entity.wolf.shake", "Wolf shakes");
LANG_US.put("subtitles.entity.zombie.ambient", "Zombie groans");
LANG_US.put("subtitles.entity.zombie.death", "Zombie dies");
LANG_US.put("subtitles.entity.zombie.hurt", "Zombie hurts");
LANG_US.put("subtitles.entity.zombie.infect", "Zombie infects");
LANG_US.put("subtitles.entity.zombie_horse.ambient", "Zombie Horse cries");
LANG_US.put("subtitles.entity.zombie_horse.death", "Zombie Horse dies");
LANG_US.put("subtitles.entity.zombie_horse.hurt", "Zombie Horse hurts");
LANG_US.put("subtitles.entity.zombie_pigman.ambient", "Zombie Pigman grunts");
LANG_US.put("subtitles.entity.zombie_pigman.angry", "Zombie Pigman angers");
LANG_US.put("subtitles.entity.zombie_pigman.death", "Zombie Pigman dies");
LANG_US.put("subtitles.entity.zombie_pigman.hurt", "Zombie Pigman hurts");
LANG_US.put("subtitles.entity.zombie_villager.ambient", "Zombie Villager groans");
LANG_US.put("subtitles.entity.zombie_villager.converted", "Zombie vociferates");
LANG_US.put("subtitles.entity.zombie_villager.cure", "Zombie snuffles");
LANG_US.put("subtitles.entity.zombie_villager.death", "Zombie Villager dies");
LANG_US.put("subtitles.entity.zombie_villager.hurt", "Zombie Villager hurts");
LANG_US.put("subtitles.item.armor.equip", "Gear equipped");
LANG_US.put("subtitles.item.armor.equip_chain", "Chain armor jingles");
LANG_US.put("subtitles.item.armor.equip_diamond", "Diamond armor clangs");
LANG_US.put("subtitles.item.armor.equip_elytra", "Elytra rustles");
LANG_US.put("subtitles.item.armor.equip_gold", "Gold armor clinks");
LANG_US.put("subtitles.item.armor.equip_iron", "Iron armor clanks");
LANG_US.put("subtitles.item.armor.equip_leather", "Leather armor rustles");
LANG_US.put("subtitles.item.bottle.fill", "Bottle fills");
LANG_US.put("subtitles.item.bucket.empty", "Bucket empties");
LANG_US.put("subtitles.item.bucket.fill", "Bucket fills");
LANG_US.put("subtitles.item.chorus_fruit.teleport", "Player teleports");
LANG_US.put("subtitles.item.firecharge.use", "Fireball whooshes");
LANG_US.put("subtitles.item.flintandsteel.use", "Flint and Steel click");
LANG_US.put("subtitles.item.hoe.till", "Hoe tills");
LANG_US.put("subtitles.item.shear", "Shears click");
LANG_US.put("subtitles.item.shield.block", "Shield blocks");
LANG_US.put("subtitles.item.shovel.flatten", "Shovel flattens");
LANG_US.put("subtitles.item.totem.use", "Totem activates");
LANG_US.put("subtitles.weather.rain", "Rain falls");
LANG_US.put("debug.prefix", "[Debug]:");
LANG_US.put("debug.reload_chunks.help=F3 + A ", " Reload chunks");
LANG_US.put("debug.show_hitboxes.help=F3 + B ", " Show hitboxes");
LANG_US.put("debug.clear_chat.help=F3 + D ", " Clear chat");
LANG_US.put("debug.cycle_renderdistance.help=F3 + F ", " Cycle render distance (Shift to invert)");
LANG_US.put("debug.chunk_boundaries.help=F3 + G ", " Show chunk boundaries");
LANG_US.put("debug.advanced_tooltips.help=F3 + H ", " Advanced tooltips");
LANG_US.put("debug.creative_spectator.help=F3 + N ", " Cycle creative <-> spectator");
LANG_US.put("debug.pause_focus.help=F3 + P ", " Pause on lost focus");
LANG_US.put("debug.help.help=F3 + Q ", " Show this list");
LANG_US.put("debug.reload_resourcepacks.help=F3 + T ", " Reload resource packs");
LANG_US.put("debug.reload_chunks.message", "Reloading all chunks");
LANG_US.put("debug.show_hitboxes.on", "Hitboxes: shown");
LANG_US.put("debug.show_hitboxes.off", "Hitboxes: hidden");
LANG_US.put("debug.cycle_renderdistance.message", "Render Distance: %s");
LANG_US.put("debug.chunk_boundaries.on", "Chunk borders: shown");
LANG_US.put("debug.chunk_boundaries.off", "Chunk borders: hidden");
LANG_US.put("debug.advanced_tooltips.on", "Advanced tooltips: shown");
LANG_US.put("debug.advanced_tooltips.off", "Advanced tooltips: hidden");
LANG_US.put("debug.creative_spectator.error", "Unable to switch gamemode, no permission");
LANG_US.put("debug.pause_focus.on", "Pause on lost focus: enabled");
LANG_US.put("debug.pause_focus.off", "Pause on lost focus: disabled");
LANG_US.put("debug.help.message", "Key bindings:");
LANG_US.put("debug.reload_resourcepacks.message", "Reloaded resource packs");
LANG_US.put("resourcepack.downloading", "Downloading Resource Pack");
LANG_US.put("resourcepack.requesting", "Making Request...");
LANG_US.put("resourcepack.progress", "Downloading file (%s MB)...");
LANG_US.put("tutorial.move.title", "Move with %s, %s, %s and %s");
LANG_US.put("tutorial.move.description", "Jump with %s");
LANG_US.put("tutorial.look.title", "Look around");
LANG_US.put("tutorial.look.description", "Use your mouse to turn");
LANG_US.put("tutorial.find_tree.title", "Find a tree");
LANG_US.put("tutorial.find_tree.description", "Punch it to collect wood");
LANG_US.put("tutorial.punch_tree.title", "Destroy the tree");
LANG_US.put("tutorial.punch_tree.description", "Hold down %s");
LANG_US.put("tutorial.open_inventory.title", "Open your inventory");
LANG_US.put("tutorial.open_inventory.description", "Press %s");
LANG_US.put("tutorial.craft_planks.title", "Craft wooden planks");
LANG_US.put("tutorial.craft_planks.description", "The recipe book can help");
LANG_US.put("advancements.adventure.adventuring_time.title", "Adventuring Time");
LANG_US.put("advancements.adventure.adventuring_time.description", "Discover every biome");
LANG_US.put("advancements.adventure.kill_all_mobs.title", "Monsters Hunted");
LANG_US.put("advancements.adventure.kill_all_mobs.description", "Kill one of every hostile monster");
LANG_US.put("advancements.adventure.kill_a_mob.title", "Monster Hunter");
LANG_US.put("advancements.adventure.kill_a_mob.description", "Kill any hostile monster");
LANG_US.put("advancements.adventure.root.title", "Adventure");
LANG_US.put("advancements.adventure.root.description", "Adventure, exploration and combat");
LANG_US.put("advancements.adventure.shoot_arrow.title", "Take Aim");
LANG_US.put("advancements.adventure.shoot_arrow.description", "Shoot something with a bow and arrow");
LANG_US.put("advancements.adventure.sleep_in_bed.title", "Sweet dreams");
LANG_US.put("advancements.adventure.sleep_in_bed.description", "Change your respawn point");
LANG_US.put("advancements.adventure.sniper_duel.title", "Sniper duel");
LANG_US.put("advancements.adventure.sniper_duel.description", "Kill a skeleton with an arrow from more than 50 meters");
LANG_US.put("advancements.adventure.trade.title", "What a Deal!");
LANG_US.put("advancements.adventure.trade.description", "Successfully trade with a Villager");
LANG_US.put("advancements.adventure.summon_iron_golem.title", "Hired Help");
LANG_US.put("advancements.adventure.summon_iron_golem.description", "Summon an Iron Golem to help defend a village");
LANG_US.put("advancements.adventure.totem_of_undying.title", "Postmortal");
LANG_US.put("advancements.adventure.totem_of_undying.description", "Use a Totem of Undying to cheat death");
LANG_US.put("advancements.husbandry.root.title", "Husbandry");
LANG_US.put("advancements.husbandry.root.description", "The world is full of friends and food");
LANG_US.put("advancements.husbandry.breed_an_animal.title", "The Parrots and the Bats");
LANG_US.put("advancements.husbandry.breed_an_animal.description", "Breed two animals together");
LANG_US.put("advancements.husbandry.breed_all_animals.title", "Two by Two");
LANG_US.put("advancements.husbandry.breed_all_animals.description", "Breed all the animals!");
LANG_US.put("advancements.husbandry.tame_an_animal.title", "Best Friends Forever");
LANG_US.put("advancements.husbandry.tame_an_animal.description", "Tame an animal");
LANG_US.put("advancements.husbandry.plant_seed.title", "A Seedy Place");
LANG_US.put("advancements.husbandry.plant_seed.description", "Plant a seed and watch it grow");
LANG_US.put("advancements.husbandry.break_diamond_hoe.title", "Serious Dedication");
LANG_US.put("advancements.husbandry.break_diamond_hoe.description", "Completely use up a diamond hoe, and then reevaluate your life choices");
LANG_US.put("advancements.husbandry.balanced_diet.title", "A Balanced Diet");
LANG_US.put("advancements.husbandry.balanced_diet.description", "Eat everything that is edible, even if it's not good for you");
LANG_US.put("advancements.end.dragon_breath.title", "You Need a Mint");
LANG_US.put("advancements.end.dragon_breath.description", "Collect dragon's breath in a glass bottle");
LANG_US.put("advancements.end.dragon_egg.title", "The Next Generation");
LANG_US.put("advancements.end.dragon_egg.description", "Hold the Dragon Egg");
LANG_US.put("advancements.end.elytra.title", "Sky's the Limit");
LANG_US.put("advancements.end.elytra.description", "Find an Elytra");
LANG_US.put("advancements.end.enter_end_gateway.title", "Remote Getaway");
LANG_US.put("advancements.end.enter_end_gateway.description", "Escape the island");
LANG_US.put("advancements.end.find_end_city.title", "The City at the End of the Game");
LANG_US.put("advancements.end.find_end_city.description", "Go on in, what could happen?");
LANG_US.put("advancements.end.kill_dragon.title", "Free the End");
LANG_US.put("advancements.end.kill_dragon.description", "Good luck");
LANG_US.put("advancements.end.levitate.title", "Great View From Up Here");
LANG_US.put("advancements.end.levitate.description", "Levitate up 50 blocks from the attacks of a Shulker");
LANG_US.put("advancements.end.respawn_dragon.title", "The End... Again...");
LANG_US.put("advancements.end.respawn_dragon.description", "Respawn the ender dragon");
LANG_US.put("advancements.end.root.title", "The End");
LANG_US.put("advancements.end.root.description", "Or the beginning?");
LANG_US.put("advancements.nether.brew_potion.title", "Local Brewery");
LANG_US.put("advancements.nether.brew_potion.description", "Brew a potion");
LANG_US.put("advancements.nether.all_potions.title", "A Furious Cocktail");
LANG_US.put("advancements.nether.all_potions.description", "Have every potion effect applied at the same time");
LANG_US.put("advancements.nether.all_effects.title", "How Did We Get Here?");
LANG_US.put("advancements.nether.all_effects.description", "Have every effect applied at the same time");
LANG_US.put("advancements.nether.create_beacon.title", "Bring Home the Beacon");
LANG_US.put("advancements.nether.create_beacon.description", "Construct and place a Beacon");
LANG_US.put("advancements.nether.create_full_beacon.title", "Beaconator");
LANG_US.put("advancements.nether.create_full_beacon.description", "Bring a beacon to full power");
LANG_US.put("advancements.nether.find_fortress.title", "A Terrible Fortress");
LANG_US.put("advancements.nether.find_fortress.description", "Break your way into a Nether Fortress");
LANG_US.put("advancements.nether.get_wither_skull.title", "Spooky Scary Skeleton");
LANG_US.put("advancements.nether.get_wither_skull.description", "Obtain a wither skeleton's skull");
LANG_US.put("advancements.nether.obtain_blaze_rod.title", "Into Fire");
LANG_US.put("advancements.nether.obtain_blaze_rod.description", "Relieve a Blaze of its rod");
LANG_US.put("advancements.nether.return_to_sender.title", "Return to Sender");
LANG_US.put("advancements.nether.return_to_sender.description", "Destroy a Ghast with a fireball");
LANG_US.put("advancements.nether.root.title", "Nether");
LANG_US.put("advancements.nether.root.description", "Bring summer clothes");
LANG_US.put("advancements.nether.summon_wither.title", "Withering Heights");
LANG_US.put("advancements.nether.summon_wither.description", "Summon the Wither");
LANG_US.put("advancements.nether.fast_travel.title", "Subspace Bubble");
LANG_US.put("advancements.nether.fast_travel.description", "Use the Nether to travel 7km in the Overworld");
LANG_US.put("advancements.nether.uneasy_alliance.title", "Uneasy Alliance");
LANG_US.put("advancements.nether.uneasy_alliance.description", "Rescue a Ghast from the Nether, bring it safely home to the Overworld... and then kill it.");
LANG_US.put("advancements.story.cure_zombie_villager.title", "Zombie Doctor");
LANG_US.put("advancements.story.cure_zombie_villager.description", "Weaken and then cure a zombie villager");
LANG_US.put("advancements.story.deflect_arrow.title", "Not Today, Thank You");
LANG_US.put("advancements.story.deflect_arrow.description", "Deflect an arrow with a shield");
LANG_US.put("advancements.story.enchant_item.title", "Enchanter");
LANG_US.put("advancements.story.enchant_item.description", "Enchant an item at an Enchanting Table");
LANG_US.put("advancements.story.enter_the_end.title", "The End?");
LANG_US.put("advancements.story.enter_the_end.description", "Enter the End Portal");
LANG_US.put("advancements.story.enter_the_nether.title", "We Need to Go Deeper");
LANG_US.put("advancements.story.enter_the_nether.description", "Build, light and enter a Nether Portal");
LANG_US.put("advancements.story.follow_ender_eye.title", "Eye Spy");
LANG_US.put("advancements.story.follow_ender_eye.description", "Follow an Ender Eye");
LANG_US.put("advancements.story.form_obsidian.title", "Ice Bucket Challenge");
LANG_US.put("advancements.story.form_obsidian.description", "Form and mine a block of Obsidian");
LANG_US.put("advancements.story.iron_tools.title", "Isn't It Iron Pick");
LANG_US.put("advancements.story.iron_tools.description", "Upgrade your pickaxe");
LANG_US.put("advancements.story.lava_bucket.title", "Hot Stuff");
LANG_US.put("advancements.story.lava_bucket.description", "Fill a bucket with lava");
LANG_US.put("advancements.story.mine_diamond.title", "Diamonds!");
LANG_US.put("advancements.story.mine_diamond.description", "Acquire diamonds");
LANG_US.put("advancements.story.mine_stone.title", "Stone Age");
LANG_US.put("advancements.story.mine_stone.description", "Mine stone with your new pickaxe");
LANG_US.put("advancements.story.obtain_armor.title", "Suit Up");
LANG_US.put("advancements.story.obtain_armor.description", "Protect yourself with a piece of iron armor");
LANG_US.put("advancements.story.root.title", "Minecraft");
LANG_US.put("advancements.story.root.description", "The heart and story of the game");
LANG_US.put("advancements.story.shiny_gear.title", "Cover Me With Diamonds");
LANG_US.put("advancements.story.shiny_gear.description", "Diamond armor saves lives");
LANG_US.put("advancements.story.smelt_iron.title", "Acquire Hardware");
LANG_US.put("advancements.story.smelt_iron.description", "Smelt an iron ingot");
LANG_US.put("advancements.story.upgrade_tools.title", "Getting an Upgrade");
LANG_US.put("advancements.story.upgrade_tools.description", "Construct a better pickaxe");
}
}
| UTF-8 | Java | 231,846 | java | Lang.java | Java | [] | null | [] | package com.trevorcow.mjnecraft.util;
import java.util.HashMap;
import java.util.Map;
public class Lang {
public static final Map<String, String> LANG_US = new HashMap<>();
static {
LANG_US.put("language.name", "English");
LANG_US.put("language.region", "United States");
LANG_US.put("language.code", "en_us");
LANG_US.put("gui.done", "Done");
LANG_US.put("gui.cancel", "Cancel");
LANG_US.put("gui.back", "Back");
LANG_US.put("gui.toTitle", "Back to title screen");
LANG_US.put("gui.toMenu", "Back to server list");
LANG_US.put("gui.up", "Up");
LANG_US.put("gui.down", "Down");
LANG_US.put("gui.yes", "Yes");
LANG_US.put("gui.no", "No");
LANG_US.put("gui.none", "None");
LANG_US.put("gui.all", "All");
LANG_US.put("gui.recipebook.moreRecipes", "Right Click for more");
LANG_US.put("gui.recipebook.toggleRecipes.all", "Showing all");
LANG_US.put("gui.recipebook.toggleRecipes.craftable", "Showing craftable");
LANG_US.put("translation.test.none", "Hello, world!");
LANG_US.put("translation.test.complex", "Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again!");
LANG_US.put("translation.test.escape", "%%s %%%s %%%%s %%%%%s");
LANG_US.put("translation.test.invalid", "hi %");
LANG_US.put("translation.test.invalid2", "hi % s");
LANG_US.put("translation.test.args", "%s %s");
LANG_US.put("translation.test.world", "world");
LANG_US.put("menu.game", "Game Menu");
LANG_US.put("menu.singleplayer", "Singleplayer");
LANG_US.put("menu.multiplayer", "Multiplayer");
LANG_US.put("menu.online", "Minecraft Realms");
LANG_US.put("menu.options", "Options...");
LANG_US.put("menu.quit", "Quit Game");
LANG_US.put("menu.returnToMenu", "Save and Quit to Title");
LANG_US.put("menu.disconnect", "Disconnect");
LANG_US.put("menu.returnToGame", "Back to Game");
LANG_US.put("menu.generatingLevel", "Generating world");
LANG_US.put("menu.loadingLevel", "Loading world");
LANG_US.put("menu.generatingTerrain", "Building terrain");
LANG_US.put("menu.convertingLevel", "Converting world");
LANG_US.put("menu.respawning", "Respawning");
LANG_US.put("menu.shareToLan", "Open to LAN");
LANG_US.put("selectWorld.title", "Select World");
LANG_US.put("selectWorld.empty", "empty");
LANG_US.put("selectWorld.world", "World");
LANG_US.put("selectWorld.select", "Play Selected World");
LANG_US.put("selectWorld.create", "Create New World");
LANG_US.put("selectWorld.recreate", "Re-Create");
LANG_US.put("selectWorld.createDemo", "Play New Demo World");
LANG_US.put("selectWorld.delete", "Delete");
LANG_US.put("selectWorld.edit", "Edit");
LANG_US.put("selectWorld.edit.title", "Edit World");
LANG_US.put("selectWorld.edit.resetIcon", "Reset Icon");
LANG_US.put("selectWorld.edit.openFolder", "Open Folder");
LANG_US.put("selectWorld.edit.save", "Save World");
LANG_US.put("selectWorld.deleteQuestion", "Are you sure you want to delete this world?");
LANG_US.put("selectWorld.deleteWarning", "will be lost forever! (A long time!)");
LANG_US.put("selectWorld.deleteButton", "Delete");
LANG_US.put("selectWorld.conversion", "Must be converted!");
LANG_US.put("selectWorld.newWorld", "New World");
LANG_US.put("selectWorld.newWorld.copyOf", "Copy of %s");
LANG_US.put("selectWorld.enterName", "World Name");
LANG_US.put("selectWorld.resultFolder", "Will be saved in:");
LANG_US.put("selectWorld.enterSeed", "Seed for the world generator");
LANG_US.put("selectWorld.seedInfo", "Leave blank for a random seed");
LANG_US.put("selectWorld.cheats", "Cheats");
LANG_US.put("selectWorld.customizeType", "Customize");
LANG_US.put("selectWorld.version", "Version:");
LANG_US.put("selectWorld.versionUnknown", "unknown");
LANG_US.put("selectWorld.versionQuestion", "Do you really want to load this world?");
LANG_US.put("selectWorld.versionWarning", "This world was saved in version '%s' and loading it in this version could cause corruption!");
LANG_US.put("selectWorld.versionJoinButton", "Use Anyway");
LANG_US.put("selectWorld.tooltip.fromNewerVersion1", "World was saved in a newer version,");
LANG_US.put("selectWorld.tooltip.fromNewerVersion2", "loading this world could cause problems!");
LANG_US.put("selectWorld.tooltip.snapshot1", "Don't forget to backup this world");
LANG_US.put("selectWorld.tooltip.snapshot2", "before you load it in this snapshot.");
LANG_US.put("selectWorld.unable_to_load", "Unable to load worlds");
LANG_US.put("selectWorld.load_folder_access", "Unable to read or access folder where game worlds are saved!");
LANG_US.put("createWorld.customize.presets", "Presets");
LANG_US.put("createWorld.customize.presets.title", "Select a Preset");
LANG_US.put("createWorld.customize.presets.select", "Use Preset");
LANG_US.put("createWorld.customize.presets.share", "Want to share your preset with someone? Use the below box!");
LANG_US.put("createWorld.customize.presets.list", "Alternatively, here's some we made earlier!");
LANG_US.put("createWorld.customize.flat.title", "Superflat Customization");
LANG_US.put("createWorld.customize.flat.tile", "Layer Material");
LANG_US.put("createWorld.customize.flat.height", "Height");
LANG_US.put("createWorld.customize.flat.addLayer", "Add Layer");
LANG_US.put("createWorld.customize.flat.editLayer", "Edit Layer");
LANG_US.put("createWorld.customize.flat.removeLayer", "Remove Layer");
LANG_US.put("createWorld.customize.flat.layer.top", "Top - %s");
LANG_US.put("createWorld.customize.flat.layer", "%s");
LANG_US.put("createWorld.customize.flat.layer.bottom", "Bottom - %s");
LANG_US.put("createWorld.customize.preset.classic_flat", "Classic Flat");
LANG_US.put("createWorld.customize.preset.tunnelers_dream", "Tunnelers' Dream");
LANG_US.put("createWorld.customize.preset.water_world", "Water World");
LANG_US.put("createWorld.customize.preset.overworld", "Overworld");
LANG_US.put("createWorld.customize.preset.snowy_kingdom", "Snowy Kingdom");
LANG_US.put("createWorld.customize.preset.bottomless_pit", "Bottomless Pit");
LANG_US.put("createWorld.customize.preset.desert", "Desert");
LANG_US.put("createWorld.customize.preset.redstone_ready", "Redstone Ready");
LANG_US.put("createWorld.customize.preset.the_void", "The Void");
LANG_US.put("createWorld.customize.custom.page0", "Basic Settings");
LANG_US.put("createWorld.customize.custom.page1", "Ore Settings");
LANG_US.put("createWorld.customize.custom.page2", "Advanced Settings (Expert Users Only!)");
LANG_US.put("createWorld.customize.custom.page3", "Extra Advanced Settings (Expert Users Only!)");
LANG_US.put("createWorld.customize.custom.randomize", "Randomize");
LANG_US.put("createWorld.customize.custom.prev", "Previous Page");
LANG_US.put("createWorld.customize.custom.next", "Next Page");
LANG_US.put("createWorld.customize.custom.defaults", "Defaults");
LANG_US.put("createWorld.customize.custom.confirm1", "This will overwrite your current");
LANG_US.put("createWorld.customize.custom.confirm2", "settings and cannot be undone.");
LANG_US.put("createWorld.customize.custom.confirmTitle", "Warning!");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleX", "Main Noise Scale X");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleY", "Main Noise Scale Y");
LANG_US.put("createWorld.customize.custom.mainNoiseScaleZ", "Main Noise Scale Z");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleX", "Depth Noise Scale X");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleZ", "Depth Noise Scale Z");
LANG_US.put("createWorld.customize.custom.depthNoiseScaleExponent", "Depth Noise Exponent");
LANG_US.put("createWorld.customize.custom.baseSize", "Depth Base Size");
LANG_US.put("createWorld.customize.custom.coordinateScale", "Coordinate Scale");
LANG_US.put("createWorld.customize.custom.heightScale", "Height Scale");
LANG_US.put("createWorld.customize.custom.stretchY", "Height Stretch");
LANG_US.put("createWorld.customize.custom.upperLimitScale", "Upper Limit Scale");
LANG_US.put("createWorld.customize.custom.lowerLimitScale", "Lower Limit Scale");
LANG_US.put("createWorld.customize.custom.biomeDepthWeight", "Biome Depth Weight");
LANG_US.put("createWorld.customize.custom.biomeDepthOffset", "Biome Depth Offset");
LANG_US.put("createWorld.customize.custom.biomeScaleWeight", "Biome Scale Weight");
LANG_US.put("createWorld.customize.custom.biomeScaleOffset", "Biome Scale Offset");
LANG_US.put("createWorld.customize.custom.seaLevel", "Sea Level");
LANG_US.put("createWorld.customize.custom.useCaves", "Caves");
LANG_US.put("createWorld.customize.custom.useStrongholds", "Strongholds");
LANG_US.put("createWorld.customize.custom.useVillages", "Villages");
LANG_US.put("createWorld.customize.custom.useMineShafts", "Mineshafts");
LANG_US.put("createWorld.customize.custom.useTemples", "Temples");
LANG_US.put("createWorld.customize.custom.useMonuments", "Ocean Monuments");
LANG_US.put("createWorld.customize.custom.useMansions", "Woodland Mansions");
LANG_US.put("createWorld.customize.custom.useRavines", "Ravines");
LANG_US.put("createWorld.customize.custom.useDungeons", "Dungeons");
LANG_US.put("createWorld.customize.custom.dungeonChance", "Dungeon Count");
LANG_US.put("createWorld.customize.custom.useWaterLakes", "Water Lakes");
LANG_US.put("createWorld.customize.custom.waterLakeChance", "Water Lake Rarity");
LANG_US.put("createWorld.customize.custom.useLavaLakes", "Lava Lakes");
LANG_US.put("createWorld.customize.custom.lavaLakeChance", "Lava Lake Rarity");
LANG_US.put("createWorld.customize.custom.useLavaOceans", "Lava Oceans");
LANG_US.put("createWorld.customize.custom.fixedBiome", "Biome");
LANG_US.put("createWorld.customize.custom.biomeSize", "Biome Size");
LANG_US.put("createWorld.customize.custom.riverSize", "River Size");
LANG_US.put("createWorld.customize.custom.size", "Spawn Size");
LANG_US.put("createWorld.customize.custom.count", "Spawn Tries");
LANG_US.put("createWorld.customize.custom.minHeight", "Min. Height");
LANG_US.put("createWorld.customize.custom.maxHeight", "Max. Height");
LANG_US.put("createWorld.customize.custom.center", "Center Height");
LANG_US.put("createWorld.customize.custom.spread", "Spread Height");
LANG_US.put("createWorld.customize.custom.presets.title", "Customize World Presets");
LANG_US.put("createWorld.customize.custom.presets", "Presets");
LANG_US.put("createWorld.customize.custom.preset.waterWorld", "Water World");
LANG_US.put("createWorld.customize.custom.preset.isleLand", "Isle Land");
LANG_US.put("createWorld.customize.custom.preset.caveDelight", "Caver's Delight");
LANG_US.put("createWorld.customize.custom.preset.mountains", "Mountain Madness");
LANG_US.put("createWorld.customize.custom.preset.drought", "Drought");
LANG_US.put("createWorld.customize.custom.preset.caveChaos", "Caves of Chaos");
LANG_US.put("createWorld.customize.custom.preset.goodLuck", "Good Luck");
LANG_US.put("gameMode.survival", "Survival Mode");
LANG_US.put("gameMode.creative", "Creative Mode");
LANG_US.put("gameMode.adventure", "Adventure Mode");
LANG_US.put("gameMode.spectator", "Spectator Mode");
LANG_US.put("gameMode.hardcore", "Hardcore Mode!");
LANG_US.put("gameMode.changed", "Your game mode has been updated to %s");
LANG_US.put("spectatorMenu.previous_page", "Previous Page");
LANG_US.put("spectatorMenu.next_page", "Next Page");
LANG_US.put("spectatorMenu.close", "Close Menu");
LANG_US.put("spectatorMenu.teleport", "Teleport to Player");
LANG_US.put("spectatorMenu.teleport.prompt", "Select a player to teleport to");
LANG_US.put("spectatorMenu.team_teleport", "Teleport to Team Member");
LANG_US.put("spectatorMenu.team_teleport.prompt", "Select a team to teleport to");
LANG_US.put("spectatorMenu.root.prompt", "Press a key to select a command, and again to use it.");
LANG_US.put("selectWorld.gameMode", "Game Mode");
LANG_US.put("selectWorld.gameMode.survival", "Survival");
LANG_US.put("selectWorld.gameMode.survival.line1", "Search for resources, crafting, gain");
LANG_US.put("selectWorld.gameMode.survival.line2", "levels, health and hunger");
LANG_US.put("selectWorld.gameMode.creative", "Creative");
LANG_US.put("selectWorld.gameMode.creative.line1", "Unlimited resources, free flying and");
LANG_US.put("selectWorld.gameMode.creative.line2", "destroy blocks instantly");
LANG_US.put("selectWorld.gameMode.spectator", "Spectator");
LANG_US.put("selectWorld.gameMode.spectator.line1", "You can look but don't touch");
LANG_US.put("selectWorld.gameMode.spectator.line2", "");
LANG_US.put("selectWorld.gameMode.hardcore", "Hardcore");
LANG_US.put("selectWorld.gameMode.hardcore.line1", "Same as survival mode, locked at hardest");
LANG_US.put("selectWorld.gameMode.hardcore.line2", "difficulty, and one life only");
LANG_US.put("selectWorld.gameMode.adventure", "Adventure");
LANG_US.put("selectWorld.gameMode.adventure.line1", "Same as survival mode, but blocks can't");
LANG_US.put("selectWorld.gameMode.adventure.line2", "be added or removed");
LANG_US.put("selectWorld.moreWorldOptions", "More World Options...");
LANG_US.put("selectWorld.mapFeatures", "Generate Structures:");
LANG_US.put("selectWorld.mapFeatures.info", "Villages, dungeons etc");
LANG_US.put("selectWorld.mapType", "World Type:");
LANG_US.put("selectWorld.mapType.normal", "Normal");
LANG_US.put("selectWorld.allowCommands", "Allow Cheats:");
LANG_US.put("selectWorld.allowCommands.info", "Commands like /gamemode, /xp");
LANG_US.put("selectWorld.hardcoreMode", "Hardcore:");
LANG_US.put("selectWorld.hardcoreMode.info", "World is deleted upon death");
LANG_US.put("selectWorld.bonusItems", "Bonus Chest:");
LANG_US.put("generator.default", "Default");
LANG_US.put("generator.flat", "Superflat");
LANG_US.put("generator.largeBiomes", "Large Biomes");
LANG_US.put("generator.amplified", "AMPLIFIED");
LANG_US.put("generator.customized", "Customized");
LANG_US.put("generator.debug_all_block_states", "Debug Mode");
LANG_US.put("generator.amplified.info", "Notice: Just for fun, requires beefy computer");
LANG_US.put("selectServer.title", "Select Server");
LANG_US.put("selectServer.empty", "empty");
LANG_US.put("selectServer.select", "Join Server");
LANG_US.put("selectServer.direct", "Direct Connect");
LANG_US.put("selectServer.edit", "Edit");
LANG_US.put("selectServer.delete", "Delete");
LANG_US.put("selectServer.add", "Add Server");
LANG_US.put("selectServer.defaultName", "Minecraft Server");
LANG_US.put("selectServer.deleteQuestion", "Are you sure you want to remove this server?");
LANG_US.put("selectServer.deleteWarning", "will be lost forever! (A long time!)");
LANG_US.put("selectServer.deleteButton", "Delete");
LANG_US.put("selectServer.refresh", "Refresh");
LANG_US.put("selectServer.hiddenAddress", "(Hidden)");
LANG_US.put("addServer.title", "Edit Server Info");
LANG_US.put("addServer.enterName", "Server Name");
LANG_US.put("addServer.enterIp", "Server Address");
LANG_US.put("addServer.add", "Done");
LANG_US.put("addServer.hideAddress", "Hide Address");
LANG_US.put("addServer.resourcePack", "Server Resource Packs");
LANG_US.put("addServer.resourcePack.enabled", "Enabled");
LANG_US.put("addServer.resourcePack.disabled", "Disabled");
LANG_US.put("addServer.resourcePack.prompt", "Prompt");
LANG_US.put("lanServer.title", "LAN World");
LANG_US.put("lanServer.scanning", "Scanning for games on your local network");
LANG_US.put("lanServer.start", "Start LAN World");
LANG_US.put("lanServer.otherPlayers", "Settings for Other Players");
LANG_US.put("mcoServer.title", "Minecraft Online World");
LANG_US.put("multiplayer.title", "Play Multiplayer");
LANG_US.put("multiplayer.connect", "Connect");
LANG_US.put("multiplayer.ipinfo", "Enter the IP of a server to connect to it:");
LANG_US.put("multiplayer.texturePrompt.line1", "This server recommends the use of a custom resource pack.");
LANG_US.put("multiplayer.texturePrompt.line2", "Would you like to download and install it automagically?");
LANG_US.put("multiplayer.downloadingTerrain", "Loading terrain");
LANG_US.put("multiplayer.downloadingStats", "Downloading statistics...");
LANG_US.put("multiplayer.stopSleeping", "Leave Bed");
LANG_US.put("multiplayer.player.joined", "%s joined the game");
LANG_US.put("multiplayer.player.joined.renamed", "%s (formerly known as %s) joined the game");
LANG_US.put("multiplayer.player.left", "%s left the game");
LANG_US.put("multiplayer.status.and_more", "... and %s more ...");
LANG_US.put("multiplayer.status.cancelled", "Cancelled");
LANG_US.put("multiplayer.status.cannot_connect", "Can't connect to server");
LANG_US.put("multiplayer.status.cannot_resolve", "Can't resolve hostname");
LANG_US.put("multiplayer.status.client_out_of_date", "Client out of date!");
LANG_US.put("multiplayer.status.no_connection", "(no connection)");
LANG_US.put("multiplayer.status.old", "Old");
LANG_US.put("multiplayer.status.pinging", "Pinging...");
LANG_US.put("multiplayer.status.server_out_of_date", "Server out of date!");
LANG_US.put("multiplayer.status.unknown", "???");
LANG_US.put("multiplayer.status.unrequested", "Received unrequested status");
LANG_US.put("multiplayer.disconnect.authservers_down", "Authentication servers are down. Please try again later, sorry!");
LANG_US.put("multiplayer.disconnect.banned", "You are banned from this server.");
LANG_US.put("multiplayer.disconnect.duplicate_login", "You logged in from another location");
LANG_US.put("multiplayer.disconnect.flying", "Flying is not enabled on this server");
LANG_US.put("multiplayer.disconnect.generic", "Disconnected");
LANG_US.put("multiplayer.disconnect.idling", "You have been idle for too long!");
LANG_US.put("multiplayer.disconnect.illegal_characters", "Illegal characters in chat");
LANG_US.put("multiplayer.disconnect.invalid_entity_attacked", "Attempting to attack an invalid entity");
LANG_US.put("multiplayer.disconnect.invalid_player_movement", "Invalid move player packet received");
LANG_US.put("multiplayer.disconnect.invalid_vehicle_movement", "Invalid move vehicle packet received");
LANG_US.put("multiplayer.disconnect.ip_banned", "You have been IP banned.");
LANG_US.put("multiplayer.disconnect.kicked", "Kicked by an operator.");
LANG_US.put("multiplayer.disconnect.outdated_client", "Outdated client! Please use %s");
LANG_US.put("multiplayer.disconnect.outdated_server", "Outdated server! I'm still on %s");
LANG_US.put("multiplayer.disconnect.server_shutdown", "Server closed");
LANG_US.put("multiplayer.disconnect.slow_login", "Took too long to log in");
LANG_US.put("multiplayer.disconnect.unverified_username", "Failed to verify username!");
LANG_US.put("chat.cannotSend", "Cannot send chat message");
LANG_US.put("chat.type.text", "<%s> %s");
LANG_US.put("chat.type.text.narrate", "%s says %s");
LANG_US.put("chat.type.emote", "* %s %s");
LANG_US.put("chat.type.announcement", "[%s] %s");
LANG_US.put("chat.type.admin", "[%s: %s]");
LANG_US.put("chat.type.advancement.task", "%s has made the advancement %s");
LANG_US.put("chat.type.advancement.challenge", "%s has completed the challenge %s");
LANG_US.put("chat.type.advancement.goal", "%s has reached the goal %s");
LANG_US.put("chat.link.confirm", "Are you sure you want to open the following website?");
LANG_US.put("chat.link.warning", "Never open links from people that you don't trust!");
LANG_US.put("chat.copy", "Copy to Clipboard");
LANG_US.put("chat.link.confirmTrusted", "Do you want to open this link or copy it to your clipboard?");
LANG_US.put("chat.link.open", "Open in browser");
LANG_US.put("menu.playdemo", "Play Demo World");
LANG_US.put("menu.resetdemo", "Reset Demo World");
LANG_US.put("demo.day.1", "This demo will last five game days, do your best!");
LANG_US.put("demo.day.2", "Day Two");
LANG_US.put("demo.day.3", "Day Three");
LANG_US.put("demo.day.4", "Day Four");
LANG_US.put("demo.day.5", "This is your last day!");
LANG_US.put("demo.day.warning", "Your time is almost up!");
LANG_US.put("demo.day.6", "You have passed your fifth day, use F2 to save a screenshot of your creation");
LANG_US.put("demo.reminder", "The demo time has expired, buy the game to continue or start a new world!");
LANG_US.put("demo.remainingTime", "Remaining time: %s");
LANG_US.put("demo.demoExpired", "Demo time's up!");
LANG_US.put("demo.help.movement", "Use the %1$s, %2$s, %3$s, %4$s keys and the mouse to move around");
LANG_US.put("demo.help.movementShort", "Move by pressing the %1$s, %2$s, %3$s, %4$s keys");
LANG_US.put("demo.help.movementMouse", "Look around using the mouse");
LANG_US.put("demo.help.jump", "Jump by pressing the %1$s key");
LANG_US.put("demo.help.inventory", "Use the %1$s key to open your inventory");
LANG_US.put("demo.help.title", "Minecraft Demo Mode");
LANG_US.put("demo.help.fullWrapped", "This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the advancements for hints! Have fun!");
LANG_US.put("demo.help.buy", "Purchase Now!");
LANG_US.put("demo.help.later", "Continue Playing!");
LANG_US.put("connect.connecting", "Connecting to the server...");
LANG_US.put("connect.authorizing", "Logging in...");
LANG_US.put("connect.failed", "Failed to connect to the server");
LANG_US.put("disconnect.genericReason", "%s");
LANG_US.put("disconnect.disconnected", "Disconnected by Server");
LANG_US.put("disconnect.lost", "Connection Lost");
LANG_US.put("disconnect.kicked", "Was kicked from the game");
LANG_US.put("disconnect.timeout", "Timed out");
LANG_US.put("disconnect.closed", "Connection closed");
LANG_US.put("disconnect.loginFailed", "Failed to login");
LANG_US.put("disconnect.loginFailedInfo", "Failed to login: %s");
LANG_US.put("disconnect.loginFailedInfo.serversUnavailable", "The authentication servers are currently down for maintenance.");
LANG_US.put("disconnect.loginFailedInfo.invalidSession", "Invalid session (Try restarting your game and the launcher)");
LANG_US.put("disconnect.quitting", "Quitting");
LANG_US.put("disconnect.endOfStream", "End of stream");
LANG_US.put("disconnect.overflow", "Buffer overflow");
LANG_US.put("disconnect.spam", "Kicked for spamming");
LANG_US.put("soundCategory.master", "Master Volume");
LANG_US.put("soundCategory.music", "Music");
LANG_US.put("soundCategory.record", "Jukebox/Note Blocks");
LANG_US.put("soundCategory.weather", "Weather");
LANG_US.put("soundCategory.hostile", "Hostile Creatures");
LANG_US.put("soundCategory.neutral", "Friendly Creatures");
LANG_US.put("soundCategory.player", "Players");
LANG_US.put("soundCategory.block", "Blocks");
LANG_US.put("soundCategory.ambient", "Ambient/Environment");
LANG_US.put("soundCategory.voice", "Voice/Speech");
LANG_US.put("record.nowPlaying", "Now playing: %s");
LANG_US.put("options.off", "OFF");
LANG_US.put("options.on", "ON");
LANG_US.put("options.visible", "Shown");
LANG_US.put("options.hidden", "Hidden");
LANG_US.put("options.title", "Options");
LANG_US.put("options.controls", "Controls...");
LANG_US.put("options.video", "Video Settings...");
LANG_US.put("options.language", "Language...");
LANG_US.put("options.sounds", "Music & Sounds...");
LANG_US.put("options.sounds.title", "Music & Sound Options");
LANG_US.put("options.languageWarning", "Language translations may not be 100%% accurate");
LANG_US.put("options.videoTitle", "Video Settings");
LANG_US.put("options.customizeTitle", "Customize World Settings");
LANG_US.put("options.music", "Music");
LANG_US.put("options.sound", "Sound");
LANG_US.put("options.invertMouse", "Invert Mouse");
LANG_US.put("options.fov", "FOV");
LANG_US.put("options.fov.min", "Normal");
LANG_US.put("options.fov.max", "Quake Pro");
LANG_US.put("options.saturation", "Saturation");
LANG_US.put("options.gamma", "Brightness");
LANG_US.put("options.gamma.min", "Moody");
LANG_US.put("options.gamma.max", "Bright");
LANG_US.put("options.sensitivity", "Sensitivity");
LANG_US.put("options.sensitivity.min", "*yawn*");
LANG_US.put("options.sensitivity.max", "HYPERSPEED!!!");
LANG_US.put("options.renderDistance", "Render Distance");
LANG_US.put("options.viewBobbing", "View Bobbing");
LANG_US.put("options.ao", "Smooth Lighting");
LANG_US.put("options.ao.off", "OFF");
LANG_US.put("options.ao.min", "Minimum");
LANG_US.put("options.ao.max", "Maximum");
LANG_US.put("options.anaglyph", "3D Anaglyph");
LANG_US.put("options.chunks", "%s chunks");
LANG_US.put("options.framerate", "%s fps");
LANG_US.put("options.framerateLimit", "Max Framerate");
LANG_US.put("options.framerateLimit.max", "Unlimited");
LANG_US.put("options.difficulty", "Difficulty");
LANG_US.put("options.difficulty.peaceful", "Peaceful");
LANG_US.put("options.difficulty.easy", "Easy");
LANG_US.put("options.difficulty.normal", "Normal");
LANG_US.put("options.difficulty.hard", "Hard");
LANG_US.put("options.difficulty.hardcore", "Hardcore");
LANG_US.put("options.graphics", "Graphics");
LANG_US.put("options.graphics.fancy", "Fancy");
LANG_US.put("options.graphics.fast", "Fast");
LANG_US.put("options.clouds.fancy", "Fancy");
LANG_US.put("options.clouds.fast", "Fast");
LANG_US.put("options.guiScale", "GUI Scale");
LANG_US.put("options.guiScale.auto", "Auto");
LANG_US.put("options.guiScale.small", "Small");
LANG_US.put("options.guiScale.normal", "Normal");
LANG_US.put("options.guiScale.large", "Large");
LANG_US.put("options.renderClouds", "Clouds");
LANG_US.put("options.particles", "Particles");
LANG_US.put("options.particles.all", "All");
LANG_US.put("options.particles.decreased", "Decreased");
LANG_US.put("options.particles.minimal", "Minimal");
LANG_US.put("options.multiplayer.title", "Multiplayer Settings...");
LANG_US.put("options.chat.title", "Chat Settings...");
LANG_US.put("options.chat.visibility", "Chat");
LANG_US.put("options.chat.visibility.full", "Shown");
LANG_US.put("options.chat.visibility.system", "Commands Only");
LANG_US.put("options.chat.visibility.hidden", "Hidden");
LANG_US.put("options.chat.color", "Colors");
LANG_US.put("options.chat.opacity", "Opacity");
LANG_US.put("options.chat.links", "Web Links");
LANG_US.put("options.chat.links.prompt", "Prompt on Links");
LANG_US.put("options.chat.scale", "Scale");
LANG_US.put("options.chat.width", "Width");
LANG_US.put("options.chat.height.focused", "Focused Height");
LANG_US.put("options.chat.height.unfocused", "Unfocused Height");
LANG_US.put("options.skinCustomisation", "Skin Customization...");
LANG_US.put("options.skinCustomisation.title", "Skin Customization");
LANG_US.put("options.modelPart.cape", "Cape");
LANG_US.put("options.modelPart.hat", "Hat");
LANG_US.put("options.modelPart.jacket", "Jacket");
LANG_US.put("options.modelPart.left_sleeve", "Left Sleeve");
LANG_US.put("options.modelPart.right_sleeve", "Right Sleeve");
LANG_US.put("options.modelPart.left_pants_leg", "Left Pants Leg");
LANG_US.put("options.modelPart.right_pants_leg", "Right Pants Leg");
LANG_US.put("options.snooper", "Allow Snooper");
LANG_US.put("options.snooper.view", "Snooper Settings...");
LANG_US.put("options.snooper.title", "Feed us data!");
LANG_US.put("options.snooper.desc", "We always want to improve Minecraft and, to help us do that, we'd like to collect some information. This lets us know what hardware to support and where the big problems are. It also gives us a sense of the size of our active player base, so we know if we're doing a good job. You can view all the information we collect below. If you want to opt out then you can simply toggle it off!");
LANG_US.put("options.resourcepack", "Resource Packs...");
LANG_US.put("options.fullscreen", "Fullscreen");
LANG_US.put("options.vsync", "Use VSync");
LANG_US.put("options.vbo", "Use VBOs");
LANG_US.put("options.touchscreen", "Touchscreen Mode");
LANG_US.put("options.reducedDebugInfo", "Reduced Debug Info");
LANG_US.put("options.entityShadows", "Entity Shadows");
LANG_US.put("options.mainHand", "Main Hand");
LANG_US.put("options.mainHand.left", "Left");
LANG_US.put("options.mainHand.right", "Right");
LANG_US.put("options.attackIndicator", "Attack Indicator");
LANG_US.put("options.attack.crosshair", "Crosshair");
LANG_US.put("options.attack.hotbar", "Hotbar");
LANG_US.put("options.showSubtitles", "Show Subtitles");
LANG_US.put("options.realmsNotifications", "Realms Notifications");
LANG_US.put("options.autoJump", "Auto-Jump");
LANG_US.put("options.narrator", "Narrator");
LANG_US.put("options.narrator.off", "Off");
LANG_US.put("options.narrator.all", "Narrates all");
LANG_US.put("options.narrator.chat", "Narrates chat");
LANG_US.put("options.narrator.system", "Narrates system");
LANG_US.put("options.narrator.notavailable", "Not available");
LANG_US.put("options.mipmapLevels", "Mipmap Levels");
LANG_US.put("options.forceUnicodeFont", "Force Unicode Font");
LANG_US.put("narrator.toast.disabled", "Narrator Disabled");
LANG_US.put("narrator.toast.enabled", "Narrator Enabled");
LANG_US.put("difficulty.lock.title", "Lock World Difficulty");
LANG_US.put("difficulty.lock.question", "Are you sure you want to lock the difficulty of this world? This will set this world to always be %1$s, and you will never be able to change that again.");
LANG_US.put("title.oldgl1", "Old graphics card detected; this may prevent you from");
LANG_US.put("title.oldgl2", "playing in the future as OpenGL 2.0 will be required.");
LANG_US.put("controls.title", "Controls");
LANG_US.put("controls.reset", "Reset");
LANG_US.put("controls.resetAll", "Reset Keys");
LANG_US.put("key.sprint", "Sprint");
LANG_US.put("key.forward", "Walk Forwards");
LANG_US.put("key.left", "Strafe Left");
LANG_US.put("key.back", "Walk Backwards");
LANG_US.put("key.right", "Strafe Right");
LANG_US.put("key.jump", "Jump");
LANG_US.put("key.inventory", "Open/Close Inventory");
LANG_US.put("key.drop", "Drop Selected Item");
LANG_US.put("key.swapHands", "Swap Item In Hands");
LANG_US.put("key.chat", "Open Chat");
LANG_US.put("key.sneak", "Sneak");
LANG_US.put("key.playerlist", "List Players");
LANG_US.put("key.attack", "Attack/Destroy");
LANG_US.put("key.use", "Use Item/Place Block");
LANG_US.put("key.pickItem", "Pick Block");
LANG_US.put("key.mouseButton", "Button %1$s");
LANG_US.put("key.mouse.left", "Left Click");
LANG_US.put("key.mouse.middle", "Middle Click");
LANG_US.put("key.mouse.right", "Right Click");
LANG_US.put("key.command", "Open Command");
LANG_US.put("key.screenshot", "Take Screenshot");
LANG_US.put("key.togglePerspective", "Toggle Perspective");
LANG_US.put("key.smoothCamera", "Toggle Cinematic Camera");
LANG_US.put("key.fullscreen", "Toggle Fullscreen");
LANG_US.put("key.spectatorOutlines", "Highlight Players (Spectators)");
LANG_US.put("key.hotbar.1", "Hotbar Slot 1");
LANG_US.put("key.hotbar.2", "Hotbar Slot 2");
LANG_US.put("key.hotbar.3", "Hotbar Slot 3");
LANG_US.put("key.hotbar.4", "Hotbar Slot 4");
LANG_US.put("key.hotbar.5", "Hotbar Slot 5");
LANG_US.put("key.hotbar.6", "Hotbar Slot 6");
LANG_US.put("key.hotbar.7", "Hotbar Slot 7");
LANG_US.put("key.hotbar.8", "Hotbar Slot 8");
LANG_US.put("key.hotbar.9", "Hotbar Slot 9");
LANG_US.put("key.saveToolbarActivator", "Save Toolbar Activator");
LANG_US.put("key.loadToolbarActivator", "Load Toolbar Activator");
LANG_US.put("key.advancements", "Advancements");
LANG_US.put("key.categories.movement", "Movement");
LANG_US.put("key.categories.misc", "Miscellaneous");
LANG_US.put("key.categories.multiplayer", "Multiplayer");
LANG_US.put("key.categories.gameplay", "Gameplay");
LANG_US.put("key.categories.ui", "Game Interface");
LANG_US.put("key.categories.inventory", "Inventory");
LANG_US.put("key.categories.creative", "Creative Mode");
LANG_US.put("resourcePack.openFolder", "Open Resource Pack Folder");
LANG_US.put("resourcePack.title", "Select Resource Packs");
LANG_US.put("resourcePack.available.title", "Available Resource Packs");
LANG_US.put("resourcePack.selected.title", "Selected Resource Packs");
LANG_US.put("resourcePack.folderInfo", "(Place resource pack files here)");
LANG_US.put("resourcePack.incompatible", "Incompatible");
LANG_US.put("resourcePack.incompatible.old", "(Made for an older version of Minecraft)");
LANG_US.put("resourcePack.incompatible.new", "(Made for a newer version of Minecraft)");
LANG_US.put("resourcePack.incompatible.confirm.title", "Are you sure you want to load this resource pack?");
LANG_US.put("resourcePack.incompatible.confirm.old", "This resource pack was made for an older version of Minecraft and may no longer work correctly.");
LANG_US.put("resourcePack.incompatible.confirm.new", "This resource pack was made for a newer version of Minecraft and may no longer work correctly.");
LANG_US.put("sign.edit", "Edit sign message");
LANG_US.put("book.pageIndicator", "Page %1$s of %2$s");
LANG_US.put("book.byAuthor", "by %1$s");
LANG_US.put("book.signButton", "Sign");
LANG_US.put("book.editTitle", "Enter Book Title:");
LANG_US.put("book.finalizeButton", "Sign and Close");
LANG_US.put("book.finalizeWarning", "Note! When you sign the book, it will no longer be editable.");
LANG_US.put("book.generation.0", "Original");
LANG_US.put("book.generation.1", "Copy of original");
LANG_US.put("book.generation.2", "Copy of a copy");
LANG_US.put("book.generation.3", "Tattered");
LANG_US.put("merchant.deprecated", "Trade something else to unlock!");
LANG_US.put("tile.air.name", "Air");
LANG_US.put("tile.barrier.name", "Barrier");
LANG_US.put("tile.stone.stone.name", "Stone");
LANG_US.put("tile.stone.granite.name", "Granite");
LANG_US.put("tile.stone.graniteSmooth.name", "Polished Granite");
LANG_US.put("tile.stone.diorite.name", "Diorite");
LANG_US.put("tile.stone.dioriteSmooth.name", "Polished Diorite");
LANG_US.put("tile.stone.andesite.name", "Andesite");
LANG_US.put("tile.stone.andesiteSmooth.name", "Polished Andesite");
LANG_US.put("tile.hayBlock.name", "Hay Bale");
LANG_US.put("tile.grass.name", "Grass Block");
LANG_US.put("tile.dirt.name", "Dirt");
LANG_US.put("tile.dirt.default.name", "Dirt");
LANG_US.put("tile.dirt.coarse.name", "Coarse Dirt");
LANG_US.put("tile.dirt.podzol.name", "Podzol");
LANG_US.put("tile.stonebrick.name", "Cobblestone");
LANG_US.put("tile.wood.name", "Wooden Planks");
LANG_US.put("tile.wood.oak.name", "Oak Wood Planks");
LANG_US.put("tile.wood.spruce.name", "Spruce Wood Planks");
LANG_US.put("tile.wood.birch.name", "Birch Wood Planks");
LANG_US.put("tile.wood.jungle.name", "Jungle Wood Planks");
LANG_US.put("tile.wood.acacia.name", "Acacia Wood Planks");
LANG_US.put("tile.wood.big_oak.name", "Dark Oak Wood Planks");
LANG_US.put("tile.sapling.oak.name", "Oak Sapling");
LANG_US.put("tile.sapling.spruce.name", "Spruce Sapling");
LANG_US.put("tile.sapling.birch.name", "Birch Sapling");
LANG_US.put("tile.sapling.jungle.name", "Jungle Sapling");
LANG_US.put("tile.sapling.acacia.name", "Acacia Sapling");
LANG_US.put("tile.sapling.big_oak.name", "Dark Oak Sapling");
LANG_US.put("tile.deadbush.name", "Dead Bush");
LANG_US.put("tile.bedrock.name", "Bedrock");
LANG_US.put("tile.water.name", "Water");
LANG_US.put("tile.lava.name", "Lava");
LANG_US.put("tile.sand.name", "Sand");
LANG_US.put("tile.sand.default.name", "Sand");
LANG_US.put("tile.sand.red.name", "Red Sand");
LANG_US.put("tile.sandStone.name", "Sandstone");
LANG_US.put("tile.sandStone.default.name", "Sandstone");
LANG_US.put("tile.sandStone.chiseled.name", "Chiseled Sandstone");
LANG_US.put("tile.sandStone.smooth.name", "Smooth Sandstone");
LANG_US.put("tile.redSandStone.name", "Red Sandstone");
LANG_US.put("tile.redSandStone.default.name", "Red Sandstone");
LANG_US.put("tile.redSandStone.chiseled.name", "Chiseled Red Sandstone");
LANG_US.put("tile.redSandStone.smooth.name", "Smooth Red Sandstone");
LANG_US.put("tile.gravel.name", "Gravel");
LANG_US.put("tile.oreGold.name", "Gold Ore");
LANG_US.put("tile.oreIron.name", "Iron Ore");
LANG_US.put("tile.oreCoal.name", "Coal Ore");
LANG_US.put("tile.log.name", "Wood");
LANG_US.put("tile.log.oak.name", "Oak Wood");
LANG_US.put("tile.log.spruce.name", "Spruce Wood");
LANG_US.put("tile.log.birch.name", "Birch Wood");
LANG_US.put("tile.log.jungle.name", "Jungle Wood");
LANG_US.put("tile.log.acacia.name", "Acacia Wood");
LANG_US.put("tile.log.big_oak.name", "Dark Oak Wood");
LANG_US.put("tile.leaves.name", "Leaves");
LANG_US.put("tile.leaves.oak.name", "Oak Leaves");
LANG_US.put("tile.leaves.spruce.name", "Spruce Leaves");
LANG_US.put("tile.leaves.birch.name", "Birch Leaves");
LANG_US.put("tile.leaves.jungle.name", "Jungle Leaves");
LANG_US.put("tile.leaves.acacia.name", "Acacia Leaves");
LANG_US.put("tile.leaves.big_oak.name", "Dark Oak Leaves");
LANG_US.put("tile.tallgrass.name", "Grass");
LANG_US.put("tile.tallgrass.shrub.name", "Shrub");
LANG_US.put("tile.tallgrass.grass.name", "Grass");
LANG_US.put("tile.tallgrass.fern.name", "Fern");
LANG_US.put("tile.sponge.dry.name", "Sponge");
LANG_US.put("tile.sponge.wet.name", "Wet Sponge");
LANG_US.put("tile.glass.name", "Glass");
LANG_US.put("tile.stainedGlass.name", "Stained Glass");
LANG_US.put("tile.stainedGlass.black.name", "Black Stained Glass");
LANG_US.put("tile.stainedGlass.red.name", "Red Stained Glass");
LANG_US.put("tile.stainedGlass.green.name", "Green Stained Glass");
LANG_US.put("tile.stainedGlass.brown.name", "Brown Stained Glass");
LANG_US.put("tile.stainedGlass.blue.name", "Blue Stained Glass");
LANG_US.put("tile.stainedGlass.purple.name", "Purple Stained Glass");
LANG_US.put("tile.stainedGlass.cyan.name", "Cyan Stained Glass");
LANG_US.put("tile.stainedGlass.silver.name", "Light Gray Stained Glass");
LANG_US.put("tile.stainedGlass.gray.name", "Gray Stained Glass");
LANG_US.put("tile.stainedGlass.pink.name", "Pink Stained Glass");
LANG_US.put("tile.stainedGlass.lime.name", "Lime Stained Glass");
LANG_US.put("tile.stainedGlass.yellow.name", "Yellow Stained Glass");
LANG_US.put("tile.stainedGlass.lightBlue.name", "Light Blue Stained Glass");
LANG_US.put("tile.stainedGlass.magenta.name", "Magenta Stained Glass");
LANG_US.put("tile.stainedGlass.orange.name", "Orange Stained Glass");
LANG_US.put("tile.stainedGlass.white.name", "White Stained Glass");
LANG_US.put("tile.thinStainedGlass.name", "Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.black.name", "Black Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.red.name", "Red Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.green.name", "Green Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.brown.name", "Brown Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.blue.name", "Blue Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.purple.name", "Purple Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.cyan.name", "Cyan Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.silver.name", "Light Gray Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.gray.name", "Gray Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.pink.name", "Pink Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.lime.name", "Lime Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.yellow.name", "Yellow Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.lightBlue.name", "Light Blue Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.magenta.name", "Magenta Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.orange.name", "Orange Stained Glass Pane");
LANG_US.put("tile.thinStainedGlass.white.name", "White Stained Glass Pane");
LANG_US.put("tile.thinGlass.name", "Glass Pane");
LANG_US.put("tile.cloth.name", "Wool");
LANG_US.put("tile.flower1.name", "Flower");
LANG_US.put("tile.flower1.dandelion.name", "Dandelion");
LANG_US.put("tile.flower2.name", "Flower");
LANG_US.put("tile.flower2.poppy.name", "Poppy");
LANG_US.put("tile.flower2.blueOrchid.name", "Blue Orchid");
LANG_US.put("tile.flower2.allium.name", "Allium");
LANG_US.put("tile.flower2.houstonia.name", "Azure Bluet");
LANG_US.put("tile.flower2.tulipRed.name", "Red Tulip");
LANG_US.put("tile.flower2.tulipOrange.name", "Orange Tulip");
LANG_US.put("tile.flower2.tulipWhite.name", "White Tulip");
LANG_US.put("tile.flower2.tulipPink.name", "Pink Tulip");
LANG_US.put("tile.flower2.oxeyeDaisy.name", "Oxeye Daisy");
LANG_US.put("tile.doublePlant.name", "Plant");
LANG_US.put("tile.doublePlant.sunflower.name", "Sunflower");
LANG_US.put("tile.doublePlant.syringa.name", "Lilac");
LANG_US.put("tile.doublePlant.grass.name", "Double Tallgrass");
LANG_US.put("tile.doublePlant.fern.name", "Large Fern");
LANG_US.put("tile.doublePlant.rose.name", "Rose Bush");
LANG_US.put("tile.doublePlant.paeonia.name", "Peony");
LANG_US.put("tile.mushroom.name", "Mushroom");
LANG_US.put("tile.blockGold.name", "Block of Gold");
LANG_US.put("tile.blockIron.name", "Block of Iron");
LANG_US.put("tile.stoneSlab.name", "Stone Slab");
LANG_US.put("tile.stoneSlab.stone.name", "Stone Slab");
LANG_US.put("tile.stoneSlab.sand.name", "Sandstone Slab");
LANG_US.put("tile.stoneSlab.wood.name", "Wooden Slab");
LANG_US.put("tile.stoneSlab.cobble.name", "Cobblestone Slab");
LANG_US.put("tile.stoneSlab.brick.name", "Bricks Slab");
LANG_US.put("tile.stoneSlab.smoothStoneBrick.name", "Stone Bricks Slab");
LANG_US.put("tile.stoneSlab.netherBrick.name", "Nether Brick Slab");
LANG_US.put("tile.stoneSlab.quartz.name", "Quartz Slab");
LANG_US.put("tile.stoneSlab2.red_sandstone.name", "Red Sandstone Slab");
LANG_US.put("tile.woodSlab.name", "Wood Slab");
LANG_US.put("tile.woodSlab.oak.name", "Oak Wood Slab");
LANG_US.put("tile.woodSlab.spruce.name", "Spruce Wood Slab");
LANG_US.put("tile.woodSlab.birch.name", "Birch Wood Slab");
LANG_US.put("tile.woodSlab.jungle.name", "Jungle Wood Slab");
LANG_US.put("tile.woodSlab.acacia.name", "Acacia Wood Slab");
LANG_US.put("tile.woodSlab.big_oak.name", "Dark Oak Wood Slab");
LANG_US.put("tile.brick.name", "Bricks");
LANG_US.put("tile.tnt.name", "TNT");
LANG_US.put("tile.bookshelf.name", "Bookshelf");
LANG_US.put("tile.stoneMoss.name", "Moss Stone");
LANG_US.put("tile.obsidian.name", "Obsidian");
LANG_US.put("tile.torch.name", "Torch");
LANG_US.put("tile.fire.name", "Fire");
LANG_US.put("tile.mobSpawner.name", "Monster Spawner");
LANG_US.put("tile.stairsWood.name", "Oak Wood Stairs");
LANG_US.put("tile.stairsWoodSpruce.name", "Spruce Wood Stairs");
LANG_US.put("tile.stairsWoodBirch.name", "Birch Wood Stairs");
LANG_US.put("tile.stairsWoodJungle.name", "Jungle Wood Stairs");
LANG_US.put("tile.stairsWoodAcacia.name", "Acacia Wood Stairs");
LANG_US.put("tile.stairsWoodDarkOak.name", "Dark Oak Wood Stairs");
LANG_US.put("tile.chest.name", "Chest");
LANG_US.put("tile.chestTrap.name", "Trapped Chest");
LANG_US.put("tile.redstoneDust.name", "Redstone Dust");
LANG_US.put("tile.oreDiamond.name", "Diamond Ore");
LANG_US.put("tile.blockCoal.name", "Block of Coal");
LANG_US.put("tile.blockDiamond.name", "Block of Diamond");
LANG_US.put("tile.workbench.name", "Crafting Table");
LANG_US.put("tile.crops.name", "Crops");
LANG_US.put("tile.farmland.name", "Farmland");
LANG_US.put("tile.furnace.name", "Furnace");
LANG_US.put("tile.sign.name", "Sign");
LANG_US.put("tile.doorWood.name", "Wooden Door");
LANG_US.put("tile.ladder.name", "Ladder");
LANG_US.put("tile.rail.name", "Rail");
LANG_US.put("tile.goldenRail.name", "Powered Rail");
LANG_US.put("tile.activatorRail.name", "Activator Rail");
LANG_US.put("tile.detectorRail.name", "Detector Rail");
LANG_US.put("tile.stairsStone.name", "Cobblestone Stairs");
LANG_US.put("tile.stairsSandStone.name", "Sandstone Stairs");
LANG_US.put("tile.stairsRedSandStone.name", "Red Sandstone Stairs");
LANG_US.put("tile.lever.name", "Lever");
LANG_US.put("tile.pressurePlateStone.name", "Stone Pressure Plate");
LANG_US.put("tile.pressurePlateWood.name", "Wooden Pressure Plate");
LANG_US.put("tile.weightedPlate_light.name", "Weighted Pressure Plate (Light)");
LANG_US.put("tile.weightedPlate_heavy.name", "Weighted Pressure Plate (Heavy)");
LANG_US.put("tile.doorIron.name", "Iron Door");
LANG_US.put("tile.oreRedstone.name", "Redstone Ore");
LANG_US.put("tile.notGate.name", "Redstone Torch");
LANG_US.put("tile.button.name", "Button");
LANG_US.put("tile.snow.name", "Snow");
LANG_US.put("tile.woolCarpet.name", "Carpet");
LANG_US.put("tile.woolCarpet.black.name", "Black Carpet");
LANG_US.put("tile.woolCarpet.red.name", "Red Carpet");
LANG_US.put("tile.woolCarpet.green.name", "Green Carpet");
LANG_US.put("tile.woolCarpet.brown.name", "Brown Carpet");
LANG_US.put("tile.woolCarpet.blue.name", "Blue Carpet");
LANG_US.put("tile.woolCarpet.purple.name", "Purple Carpet");
LANG_US.put("tile.woolCarpet.cyan.name", "Cyan Carpet");
LANG_US.put("tile.woolCarpet.silver.name", "Light Gray Carpet");
LANG_US.put("tile.woolCarpet.gray.name", "Gray Carpet");
LANG_US.put("tile.woolCarpet.pink.name", "Pink Carpet");
LANG_US.put("tile.woolCarpet.lime.name", "Lime Carpet");
LANG_US.put("tile.woolCarpet.yellow.name", "Yellow Carpet");
LANG_US.put("tile.woolCarpet.lightBlue.name", "Light Blue Carpet");
LANG_US.put("tile.woolCarpet.magenta.name", "Magenta Carpet");
LANG_US.put("tile.woolCarpet.orange.name", "Orange Carpet");
LANG_US.put("tile.woolCarpet.white.name", "White Carpet");
LANG_US.put("tile.ice.name", "Ice");
LANG_US.put("tile.frostedIce.name", "Frosted Ice");
LANG_US.put("tile.icePacked.name", "Packed Ice");
LANG_US.put("tile.cactus.name", "Cactus");
LANG_US.put("tile.clay.name", "Clay");
LANG_US.put("tile.clayHardenedStained.name", "Stained Terracotta");
LANG_US.put("tile.clayHardenedStained.black.name", "Black Terracotta");
LANG_US.put("tile.clayHardenedStained.red.name", "Red Terracotta");
LANG_US.put("tile.clayHardenedStained.green.name", "Green Terracotta");
LANG_US.put("tile.clayHardenedStained.brown.name", "Brown Terracotta");
LANG_US.put("tile.clayHardenedStained.blue.name", "Blue Terracotta");
LANG_US.put("tile.clayHardenedStained.purple.name", "Purple Terracotta");
LANG_US.put("tile.clayHardenedStained.cyan.name", "Cyan Terracotta");
LANG_US.put("tile.clayHardenedStained.silver.name", "Light Gray Terracotta");
LANG_US.put("tile.clayHardenedStained.gray.name", "Gray Terracotta");
LANG_US.put("tile.clayHardenedStained.pink.name", "Pink Terracotta");
LANG_US.put("tile.clayHardenedStained.lime.name", "Lime Terracotta");
LANG_US.put("tile.clayHardenedStained.yellow.name", "Yellow Terracotta");
LANG_US.put("tile.clayHardenedStained.lightBlue.name", "Light Blue Terracotta");
LANG_US.put("tile.clayHardenedStained.magenta.name", "Magenta Terracotta");
LANG_US.put("tile.clayHardenedStained.orange.name", "Orange Terracotta");
LANG_US.put("tile.clayHardenedStained.white.name", "White Terracotta");
LANG_US.put("tile.clayHardened.name", "Terracotta");
LANG_US.put("tile.reeds.name", "Sugar cane");
LANG_US.put("tile.jukebox.name", "Jukebox");
LANG_US.put("tile.fence.name", "Oak Fence");
LANG_US.put("tile.spruceFence.name", "Spruce Fence");
LANG_US.put("tile.birchFence.name", "Birch Fence");
LANG_US.put("tile.jungleFence.name", "Jungle Fence");
LANG_US.put("tile.darkOakFence.name", "Dark Oak Fence");
LANG_US.put("tile.acaciaFence.name", "Acacia Fence");
LANG_US.put("tile.fenceGate.name", "Oak Fence Gate");
LANG_US.put("tile.spruceFenceGate.name", "Spruce Fence Gate");
LANG_US.put("tile.birchFenceGate.name", "Birch Fence Gate");
LANG_US.put("tile.jungleFenceGate.name", "Jungle Fence Gate");
LANG_US.put("tile.darkOakFenceGate.name", "Dark Oak Fence Gate");
LANG_US.put("tile.acaciaFenceGate.name", "Acacia Fence Gate");
LANG_US.put("tile.pumpkinStem.name", "Pumpkin Stem");
LANG_US.put("tile.pumpkin.name", "Pumpkin");
LANG_US.put("tile.litpumpkin.name", "Jack o'Lantern");
LANG_US.put("tile.hellrock.name", "Netherrack");
LANG_US.put("tile.hellsand.name", "Soul Sand");
LANG_US.put("tile.lightgem.name", "Glowstone");
LANG_US.put("tile.portal.name", "Portal");
LANG_US.put("tile.cloth.black.name", "Black Wool");
LANG_US.put("tile.cloth.red.name", "Red Wool");
LANG_US.put("tile.cloth.green.name", "Green Wool");
LANG_US.put("tile.cloth.brown.name", "Brown Wool");
LANG_US.put("tile.cloth.blue.name", "Blue Wool");
LANG_US.put("tile.cloth.purple.name", "Purple Wool");
LANG_US.put("tile.cloth.cyan.name", "Cyan Wool");
LANG_US.put("tile.cloth.silver.name", "Light Gray Wool");
LANG_US.put("tile.cloth.gray.name", "Gray Wool");
LANG_US.put("tile.cloth.pink.name", "Pink Wool");
LANG_US.put("tile.cloth.lime.name", "Lime Wool");
LANG_US.put("tile.cloth.yellow.name", "Yellow Wool");
LANG_US.put("tile.cloth.lightBlue.name", "Light Blue Wool");
LANG_US.put("tile.cloth.magenta.name", "Magenta Wool");
LANG_US.put("tile.cloth.orange.name", "Orange Wool");
LANG_US.put("tile.cloth.white.name", "White Wool");
LANG_US.put("tile.oreLapis.name", "Lapis Lazuli Ore");
LANG_US.put("tile.blockLapis.name", "Lapis Lazuli Block");
LANG_US.put("tile.dispenser.name", "Dispenser");
LANG_US.put("tile.dropper.name", "Dropper");
LANG_US.put("tile.musicBlock.name", "Note Block");
LANG_US.put("tile.cake.name", "Cake");
LANG_US.put("tile.bed.occupied", "This bed is occupied");
LANG_US.put("tile.bed.noSleep", "You can only sleep at night");
LANG_US.put("tile.bed.tooFarAway", "You may not rest now, the bed is too far away");
LANG_US.put("tile.bed.notSafe", "You may not rest now, there are monsters nearby");
LANG_US.put("tile.bed.notValid", "Your home bed was missing or obstructed");
LANG_US.put("tile.lockedchest.name", "Locked chest");
LANG_US.put("tile.trapdoor.name", "Wooden Trapdoor");
LANG_US.put("tile.ironTrapdoor.name", "Iron Trapdoor");
LANG_US.put("tile.web.name", "Cobweb");
LANG_US.put("tile.stonebricksmooth.name", "Stone Bricks");
LANG_US.put("tile.stonebricksmooth.default.name", "Stone Bricks");
LANG_US.put("tile.stonebricksmooth.mossy.name", "Mossy Stone Bricks");
LANG_US.put("tile.stonebricksmooth.cracked.name", "Cracked Stone Bricks");
LANG_US.put("tile.stonebricksmooth.chiseled.name", "Chiseled Stone Bricks");
LANG_US.put("tile.monsterStoneEgg.name", "Stone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.stone.name", "Stone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.cobble.name", "Cobblestone Monster Egg");
LANG_US.put("tile.monsterStoneEgg.brick.name", "Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.mossybrick.name", "Mossy Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.crackedbrick.name", "Cracked Stone Brick Monster Egg");
LANG_US.put("tile.monsterStoneEgg.chiseledbrick.name", "Chiseled Stone Brick Monster Egg");
LANG_US.put("tile.pistonBase.name", "Piston");
LANG_US.put("tile.pistonStickyBase.name", "Sticky Piston");
LANG_US.put("tile.fenceIron.name", "Iron Bars");
LANG_US.put("tile.melon.name", "Melon");
LANG_US.put("tile.stairsBrick.name", "Brick Stairs");
LANG_US.put("tile.stairsStoneBrickSmooth.name", "Stone Brick Stairs");
LANG_US.put("tile.vine.name", "Vines");
LANG_US.put("tile.netherBrick.name", "Nether Brick");
LANG_US.put("tile.netherFence.name", "Nether Brick Fence");
LANG_US.put("tile.stairsNetherBrick.name", "Nether Brick Stairs");
LANG_US.put("tile.netherStalk.name", "Nether Wart");
LANG_US.put("tile.cauldron.name", "Cauldron");
LANG_US.put("tile.enchantmentTable.name", "Enchantment Table");
LANG_US.put("tile.anvil.name", "Anvil");
LANG_US.put("tile.anvil.intact.name", "Anvil");
LANG_US.put("tile.anvil.slightlyDamaged.name", "Slightly Damaged Anvil");
LANG_US.put("tile.anvil.veryDamaged.name", "Very Damaged Anvil");
LANG_US.put("tile.whiteStone.name", "End Stone");
LANG_US.put("tile.endPortalFrame.name", "End Portal");
LANG_US.put("tile.mycel.name", "Mycelium");
LANG_US.put("tile.waterlily.name", "Lily Pad");
LANG_US.put("tile.dragonEgg.name", "Dragon Egg");
LANG_US.put("tile.redstoneLight.name", "Redstone Lamp");
LANG_US.put("tile.cocoa.name", "Cocoa");
LANG_US.put("tile.enderChest.name", "Ender Chest");
LANG_US.put("tile.oreEmerald.name", "Emerald Ore");
LANG_US.put("tile.blockEmerald.name", "Block of Emerald");
LANG_US.put("tile.blockRedstone.name", "Block of Redstone");
LANG_US.put("tile.tripWire.name", "Tripwire");
LANG_US.put("tile.tripWireSource.name", "Tripwire Hook");
LANG_US.put("tile.commandBlock.name", "Command Block");
LANG_US.put("tile.repeatingCommandBlock.name", "Repeating Command Block");
LANG_US.put("tile.chainCommandBlock.name", "Chain Command Block");
LANG_US.put("tile.beacon.name", "Beacon");
LANG_US.put("tile.beacon.primary", "Primary Power");
LANG_US.put("tile.beacon.secondary", "Secondary Power");
LANG_US.put("tile.cobbleWall.normal.name", "Cobblestone Wall");
LANG_US.put("tile.cobbleWall.mossy.name", "Mossy Cobblestone Wall");
LANG_US.put("tile.carrots.name", "Carrots");
LANG_US.put("tile.potatoes.name", "Potatoes");
LANG_US.put("tile.daylightDetector.name", "Daylight Sensor");
LANG_US.put("tile.netherquartz.name", "Nether Quartz Ore");
LANG_US.put("tile.hopper.name", "Hopper");
LANG_US.put("tile.quartzBlock.name", "Block of Quartz");
LANG_US.put("tile.quartzBlock.default.name", "Block of Quartz");
LANG_US.put("tile.quartzBlock.chiseled.name", "Chiseled Quartz Block");
LANG_US.put("tile.quartzBlock.lines.name", "Pillar Quartz Block");
LANG_US.put("tile.stairsQuartz.name", "Quartz Stairs");
LANG_US.put("tile.slime.name", "Slime Block");
LANG_US.put("tile.prismarine.rough.name", "Prismarine");
LANG_US.put("tile.prismarine.bricks.name", "Prismarine Bricks");
LANG_US.put("tile.prismarine.dark.name", "Dark Prismarine");
LANG_US.put("tile.seaLantern.name", "Sea Lantern");
LANG_US.put("tile.endRod.name", "End Rod");
LANG_US.put("tile.chorusPlant.name", "Chorus Plant");
LANG_US.put("tile.chorusFlower.name", "Chorus Flower");
LANG_US.put("tile.purpurBlock.name", "Purpur Block");
LANG_US.put("tile.purpurPillar.name", "Purpur Pillar");
LANG_US.put("tile.stairsPurpur.name", "Purpur Stairs");
LANG_US.put("tile.purpurSlab.name", "Purpur Slab");
LANG_US.put("tile.endBricks.name", "End Stone Bricks");
LANG_US.put("tile.beetroots.name", "Beetroots");
LANG_US.put("tile.grassPath.name", "Grass Path");
LANG_US.put("tile.magma.name", "Magma Block");
LANG_US.put("tile.netherWartBlock.name", "Nether Wart Block");
LANG_US.put("tile.redNetherBrick.name", "Red Nether Brick");
LANG_US.put("tile.boneBlock.name", "Bone Block");
LANG_US.put("tile.observer.name", "Observer");
LANG_US.put("tile.shulkerBoxWhite.name", "White Shulker Box");
LANG_US.put("tile.shulkerBoxOrange.name", "Orange Shulker Box");
LANG_US.put("tile.shulkerBoxMagenta.name", "Magenta Shulker Box");
LANG_US.put("tile.shulkerBoxLightBlue.name", "Light Blue Shulker Box");
LANG_US.put("tile.shulkerBoxYellow.name", "Yellow Shulker Box");
LANG_US.put("tile.shulkerBoxLime.name", "Lime Shulker Box");
LANG_US.put("tile.shulkerBoxPink.name", "Pink Shulker Box");
LANG_US.put("tile.shulkerBoxGray.name", "Gray Shulker Box");
LANG_US.put("tile.shulkerBoxSilver.name", "Light Gray Shulker Box");
LANG_US.put("tile.shulkerBoxCyan.name", "Cyan Shulker Box");
LANG_US.put("tile.shulkerBoxPurple.name", "Purple Shulker Box");
LANG_US.put("tile.shulkerBoxBlue.name", "Blue Shulker Box");
LANG_US.put("tile.shulkerBoxBrown.name", "Brown Shulker Box");
LANG_US.put("tile.shulkerBoxGreen.name", "Green Shulker Box");
LANG_US.put("tile.shulkerBoxRed.name", "Red Shulker Box");
LANG_US.put("tile.shulkerBoxBlack.name", "Black Shulker Box");
LANG_US.put("tile.glazedTerracottaWhite.name", "White Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaOrange.name", "Orange Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaMagenta.name", "Magenta Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaLightBlue.name", "Light Blue Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaYellow.name", "Yellow Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaLime.name", "Lime Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaPink.name", "Pink Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaGray.name", "Gray Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaSilver.name", "Light Gray Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaCyan.name", "Cyan Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaPurple.name", "Purple Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBlue.name", "Blue Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBrown.name", "Brown Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaGreen.name", "Green Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaRed.name", "Red Glazed Terracotta");
LANG_US.put("tile.glazedTerracottaBlack.name", "Black Glazed Terracotta");
LANG_US.put("tile.concrete.black.name", "Black Concrete");
LANG_US.put("tile.concrete.red.name", "Red Concrete");
LANG_US.put("tile.concrete.green.name", "Green Concrete");
LANG_US.put("tile.concrete.brown.name", "Brown Concrete");
LANG_US.put("tile.concrete.blue.name", "Blue Concrete");
LANG_US.put("tile.concrete.purple.name", "Purple Concrete");
LANG_US.put("tile.concrete.cyan.name", "Cyan Concrete");
LANG_US.put("tile.concrete.silver.name", "Light Gray Concrete");
LANG_US.put("tile.concrete.gray.name", "Gray Concrete");
LANG_US.put("tile.concrete.pink.name", "Pink Concrete");
LANG_US.put("tile.concrete.lime.name", "Lime Concrete");
LANG_US.put("tile.concrete.yellow.name", "Yellow Concrete");
LANG_US.put("tile.concrete.lightBlue.name", "Light Blue Concrete");
LANG_US.put("tile.concrete.magenta.name", "Magenta Concrete");
LANG_US.put("tile.concrete.orange.name", "Orange Concrete");
LANG_US.put("tile.concrete.white.name", "White Concrete");
LANG_US.put("tile.concretePowder.black.name", "Black Concrete Powder");
LANG_US.put("tile.concretePowder.red.name", "Red Concrete Powder");
LANG_US.put("tile.concretePowder.green.name", "Green Concrete Powder");
LANG_US.put("tile.concretePowder.brown.name", "Brown Concrete Powder");
LANG_US.put("tile.concretePowder.blue.name", "Blue Concrete Powder");
LANG_US.put("tile.concretePowder.purple.name", "Purple Concrete Powder");
LANG_US.put("tile.concretePowder.cyan.name", "Cyan Concrete Powder");
LANG_US.put("tile.concretePowder.silver.name", "Light Gray Concrete Powder");
LANG_US.put("tile.concretePowder.gray.name", "Gray Concrete Powder");
LANG_US.put("tile.concretePowder.pink.name", "Pink Concrete Powder");
LANG_US.put("tile.concretePowder.lime.name", "Lime Concrete Powder");
LANG_US.put("tile.concretePowder.yellow.name", "Yellow Concrete Powder");
LANG_US.put("tile.concretePowder.lightBlue.name", "Light Blue Concrete Powder");
LANG_US.put("tile.concretePowder.magenta.name", "Magenta Concrete Powder");
LANG_US.put("tile.concretePowder.orange.name", "Orange Concrete Powder");
LANG_US.put("tile.concretePowder.white.name", "White Concrete Powder");
LANG_US.put("tile.structureVoid.name", "Structure Void");
LANG_US.put("tile.structureBlock.name", "Structure Block");
LANG_US.put("item.nameTag.name", "Name Tag");
LANG_US.put("item.leash.name", "Lead");
LANG_US.put("item.shovelIron.name", "Iron Shovel");
LANG_US.put("item.pickaxeIron.name", "Iron Pickaxe");
LANG_US.put("item.hatchetIron.name", "Iron Axe");
LANG_US.put("item.flintAndSteel.name", "Flint and Steel");
LANG_US.put("item.apple.name", "Apple");
LANG_US.put("item.cookie.name", "Cookie");
LANG_US.put("item.bow.name", "Bow");
LANG_US.put("item.arrow.name", "Arrow");
LANG_US.put("item.spectral_arrow.name", "Spectral Arrow");
LANG_US.put("item.tipped_arrow.name", "Tipped Arrow");
LANG_US.put("item.coal.name", "Coal");
LANG_US.put("item.charcoal.name", "Charcoal");
LANG_US.put("item.diamond.name", "Diamond");
LANG_US.put("item.emerald.name", "Emerald");
LANG_US.put("item.ingotIron.name", "Iron Ingot");
LANG_US.put("item.ingotGold.name", "Gold Ingot");
LANG_US.put("item.swordIron.name", "Iron Sword");
LANG_US.put("item.swordWood.name", "Wooden Sword");
LANG_US.put("item.shovelWood.name", "Wooden Shovel");
LANG_US.put("item.pickaxeWood.name", "Wooden Pickaxe");
LANG_US.put("item.hatchetWood.name", "Wooden Axe");
LANG_US.put("item.swordStone.name", "Stone Sword");
LANG_US.put("item.shovelStone.name", "Stone Shovel");
LANG_US.put("item.pickaxeStone.name", "Stone Pickaxe");
LANG_US.put("item.hatchetStone.name", "Stone Axe");
LANG_US.put("item.swordDiamond.name", "Diamond Sword");
LANG_US.put("item.shovelDiamond.name", "Diamond Shovel");
LANG_US.put("item.pickaxeDiamond.name", "Diamond Pickaxe");
LANG_US.put("item.hatchetDiamond.name", "Diamond Axe");
LANG_US.put("item.stick.name", "Stick");
LANG_US.put("item.bowl.name", "Bowl");
LANG_US.put("item.mushroomStew.name", "Mushroom Stew");
LANG_US.put("item.swordGold.name", "Golden Sword");
LANG_US.put("item.shovelGold.name", "Golden Shovel");
LANG_US.put("item.pickaxeGold.name", "Golden Pickaxe");
LANG_US.put("item.hatchetGold.name", "Golden Axe");
LANG_US.put("item.string.name", "String");
LANG_US.put("item.feather.name", "Feather");
LANG_US.put("item.sulphur.name", "Gunpowder");
LANG_US.put("item.hoeWood.name", "Wooden Hoe");
LANG_US.put("item.hoeStone.name", "Stone Hoe");
LANG_US.put("item.hoeIron.name", "Iron Hoe");
LANG_US.put("item.hoeDiamond.name", "Diamond Hoe");
LANG_US.put("item.hoeGold.name", "Golden Hoe");
LANG_US.put("item.seeds.name", "Seeds");
LANG_US.put("item.seeds_pumpkin.name", "Pumpkin Seeds");
LANG_US.put("item.seeds_melon.name", "Melon Seeds");
LANG_US.put("item.melon.name", "Melon");
LANG_US.put("item.wheat.name", "Wheat");
LANG_US.put("item.bread.name", "Bread");
LANG_US.put("item.helmetCloth.name", "Leather Cap");
LANG_US.put("item.chestplateCloth.name", "Leather Tunic");
LANG_US.put("item.leggingsCloth.name", "Leather Pants");
LANG_US.put("item.bootsCloth.name", "Leather Boots");
LANG_US.put("item.helmetChain.name", "Chain Helmet");
LANG_US.put("item.chestplateChain.name", "Chain Chestplate");
LANG_US.put("item.leggingsChain.name", "Chain Leggings");
LANG_US.put("item.bootsChain.name", "Chain Boots");
LANG_US.put("item.helmetIron.name", "Iron Helmet");
LANG_US.put("item.chestplateIron.name", "Iron Chestplate");
LANG_US.put("item.leggingsIron.name", "Iron Leggings");
LANG_US.put("item.bootsIron.name", "Iron Boots");
LANG_US.put("item.helmetDiamond.name", "Diamond Helmet");
LANG_US.put("item.chestplateDiamond.name", "Diamond Chestplate");
LANG_US.put("item.leggingsDiamond.name", "Diamond Leggings");
LANG_US.put("item.bootsDiamond.name", "Diamond Boots");
LANG_US.put("item.helmetGold.name", "Golden Helmet");
LANG_US.put("item.chestplateGold.name", "Golden Chestplate");
LANG_US.put("item.leggingsGold.name", "Golden Leggings");
LANG_US.put("item.bootsGold.name", "Golden Boots");
LANG_US.put("item.flint.name", "Flint");
LANG_US.put("item.porkchopRaw.name", "Raw Porkchop");
LANG_US.put("item.porkchopCooked.name", "Cooked Porkchop");
LANG_US.put("item.chickenRaw.name", "Raw Chicken");
LANG_US.put("item.chickenCooked.name", "Cooked Chicken");
LANG_US.put("item.muttonRaw.name", "Raw Mutton");
LANG_US.put("item.muttonCooked.name", "Cooked Mutton");
LANG_US.put("item.rabbitRaw.name", "Raw Rabbit");
LANG_US.put("item.rabbitCooked.name", "Cooked Rabbit");
LANG_US.put("item.rabbitStew.name", "Rabbit Stew");
LANG_US.put("item.rabbitFoot.name", "Rabbit's Foot");
LANG_US.put("item.rabbitHide.name", "Rabbit Hide");
LANG_US.put("item.beefRaw.name", "Raw Beef");
LANG_US.put("item.beefCooked.name", "Steak");
LANG_US.put("item.painting.name", "Painting");
LANG_US.put("item.frame.name", "Item Frame");
LANG_US.put("item.appleGold.name", "Golden Apple");
LANG_US.put("item.sign.name", "Sign");
LANG_US.put("item.doorOak.name", "Oak Door");
LANG_US.put("item.doorSpruce.name", "Spruce Door");
LANG_US.put("item.doorBirch.name", "Birch Door");
LANG_US.put("item.doorJungle.name", "Jungle Door");
LANG_US.put("item.doorAcacia.name", "Acacia Door");
LANG_US.put("item.doorDarkOak.name", "Dark Oak Door");
LANG_US.put("item.bucket.name", "Bucket");
LANG_US.put("item.bucketWater.name", "Water Bucket");
LANG_US.put("item.bucketLava.name", "Lava Bucket");
LANG_US.put("item.minecart.name", "Minecart");
LANG_US.put("item.saddle.name", "Saddle");
LANG_US.put("item.doorIron.name", "Iron Door");
LANG_US.put("item.redstone.name", "Redstone");
LANG_US.put("item.snowball.name", "Snowball");
LANG_US.put("item.boat.oak.name", "Oak Boat");
LANG_US.put("item.boat.spruce.name", "Spruce Boat");
LANG_US.put("item.boat.birch.name", "Birch Boat");
LANG_US.put("item.boat.jungle.name", "Jungle Boat");
LANG_US.put("item.boat.acacia.name", "Acacia Boat");
LANG_US.put("item.boat.dark_oak.name", "Dark Oak Boat");
LANG_US.put("item.leather.name", "Leather");
LANG_US.put("item.milk.name", "Milk");
LANG_US.put("item.brick.name", "Brick");
LANG_US.put("item.clay.name", "Clay");
LANG_US.put("item.reeds.name", "Sugar Canes");
LANG_US.put("item.paper.name", "Paper");
LANG_US.put("item.book.name", "Book");
LANG_US.put("item.slimeball.name", "Slimeball");
LANG_US.put("item.minecartChest.name", "Minecart with Chest");
LANG_US.put("item.minecartFurnace.name", "Minecart with Furnace");
LANG_US.put("item.minecartTnt.name", "Minecart with TNT");
LANG_US.put("item.minecartHopper.name", "Minecart with Hopper");
LANG_US.put("item.minecartCommandBlock.name", "Minecart with Command Block");
LANG_US.put("item.egg.name", "Egg");
LANG_US.put("item.compass.name", "Compass");
LANG_US.put("item.fishingRod.name", "Fishing Rod");
LANG_US.put("item.clock.name", "Clock");
LANG_US.put("item.yellowDust.name", "Glowstone Dust");
LANG_US.put("item.fish.cod.raw.name", "Raw Fish");
LANG_US.put("item.fish.salmon.raw.name", "Raw Salmon");
LANG_US.put("item.fish.pufferfish.raw.name", "Pufferfish");
LANG_US.put("item.fish.clownfish.raw.name", "Clownfish");
LANG_US.put("item.fish.cod.cooked.name", "Cooked Fish");
LANG_US.put("item.fish.salmon.cooked.name", "Cooked Salmon");
LANG_US.put("item.record.name", "Music Disc");
LANG_US.put("item.record.13.desc", "C418 - 13");
LANG_US.put("item.record.cat.desc", "C418 - cat");
LANG_US.put("item.record.blocks.desc", "C418 - blocks");
LANG_US.put("item.record.chirp.desc", "C418 - chirp");
LANG_US.put("item.record.far.desc", "C418 - far");
LANG_US.put("item.record.mall.desc", "C418 - mall");
LANG_US.put("item.record.mellohi.desc", "C418 - mellohi");
LANG_US.put("item.record.stal.desc", "C418 - stal");
LANG_US.put("item.record.strad.desc", "C418 - strad");
LANG_US.put("item.record.ward.desc", "C418 - ward");
LANG_US.put("item.record.11.desc", "C418 - 11");
LANG_US.put("item.record.wait.desc", "C418 - wait");
LANG_US.put("item.bone.name", "Bone");
LANG_US.put("item.dyePowder.black.name", "Ink Sac");
LANG_US.put("item.dyePowder.red.name", "Rose Red");
LANG_US.put("item.dyePowder.green.name", "Cactus Green");
LANG_US.put("item.dyePowder.brown.name", "Cocoa Beans");
LANG_US.put("item.dyePowder.blue.name", "Lapis Lazuli");
LANG_US.put("item.dyePowder.purple.name", "Purple Dye");
LANG_US.put("item.dyePowder.cyan.name", "Cyan Dye");
LANG_US.put("item.dyePowder.silver.name", "Light Gray Dye");
LANG_US.put("item.dyePowder.gray.name", "Gray Dye");
LANG_US.put("item.dyePowder.pink.name", "Pink Dye");
LANG_US.put("item.dyePowder.lime.name", "Lime Dye");
LANG_US.put("item.dyePowder.yellow.name", "Dandelion Yellow");
LANG_US.put("item.dyePowder.lightBlue.name", "Light Blue Dye");
LANG_US.put("item.dyePowder.magenta.name", "Magenta Dye");
LANG_US.put("item.dyePowder.orange.name", "Orange Dye");
LANG_US.put("item.dyePowder.white.name", "Bone Meal");
LANG_US.put("item.sugar.name", "Sugar");
LANG_US.put("item.cake.name", "Cake");
LANG_US.put("item.bed.black.name", "Black Bed");
LANG_US.put("item.bed.red.name", "Red Bed");
LANG_US.put("item.bed.green.name", "Green Bed");
LANG_US.put("item.bed.brown.name", "Brown Bed");
LANG_US.put("item.bed.blue.name", "Blue Bed");
LANG_US.put("item.bed.purple.name", "Purple Bed");
LANG_US.put("item.bed.cyan.name", "Cyan Bed");
LANG_US.put("item.bed.silver.name", "Light Gray Bed");
LANG_US.put("item.bed.gray.name", "Gray Bed");
LANG_US.put("item.bed.pink.name", "Pink Bed");
LANG_US.put("item.bed.lime.name", "Lime Bed");
LANG_US.put("item.bed.yellow.name", "Yellow Bed");
LANG_US.put("item.bed.lightBlue.name", "Light Blue Bed");
LANG_US.put("item.bed.magenta.name", "Magenta Bed");
LANG_US.put("item.bed.orange.name", "Orange Bed");
LANG_US.put("item.bed.white.name", "White Bed");
LANG_US.put("item.diode.name", "Redstone Repeater");
LANG_US.put("item.comparator.name", "Redstone Comparator");
LANG_US.put("item.map.name", "Map");
LANG_US.put("item.leaves.name", "Leaves");
LANG_US.put("item.shears.name", "Shears");
LANG_US.put("item.rottenFlesh.name", "Rotten Flesh");
LANG_US.put("item.enderPearl.name", "Ender Pearl");
LANG_US.put("item.blazeRod.name", "Blaze Rod");
LANG_US.put("item.ghastTear.name", "Ghast Tear");
LANG_US.put("item.netherStalkSeeds.name", "Nether Wart");
LANG_US.put("item.potion.name", "Potion");
LANG_US.put("item.splash_potion.name", "Splash Potion");
LANG_US.put("item.lingering_potion.name", "Lingering Potion");
LANG_US.put("item.end_crystal.name", "End Crystal");
LANG_US.put("item.goldNugget.name", "Gold Nugget");
LANG_US.put("item.glassBottle.name", "Glass Bottle");
LANG_US.put("item.spiderEye.name", "Spider Eye");
LANG_US.put("item.fermentedSpiderEye.name", "Fermented Spider Eye");
LANG_US.put("item.blazePowder.name", "Blaze Powder");
LANG_US.put("item.magmaCream.name", "Magma Cream");
LANG_US.put("item.cauldron.name", "Cauldron");
LANG_US.put("item.brewingStand.name", "Brewing Stand");
LANG_US.put("item.eyeOfEnder.name", "Eye of Ender");
LANG_US.put("item.speckledMelon.name", "Glistering Melon");
LANG_US.put("item.monsterPlacer.name", "Spawn");
LANG_US.put("item.expBottle.name", "Bottle o' Enchanting");
LANG_US.put("item.fireball.name", "Fire Charge");
LANG_US.put("item.writingBook.name", "Book and Quill");
LANG_US.put("item.writtenBook.name", "Written Book");
LANG_US.put("item.flowerPot.name", "Flower Pot");
LANG_US.put("item.emptyMap.name", "Empty Map");
LANG_US.put("item.carrots.name", "Carrot");
LANG_US.put("item.carrotGolden.name", "Golden Carrot");
LANG_US.put("item.potato.name", "Potato");
LANG_US.put("item.potatoBaked.name", "Baked Potato");
LANG_US.put("item.potatoPoisonous.name", "Poisonous Potato");
LANG_US.put("item.skull.skeleton.name", "Skeleton Skull");
LANG_US.put("item.skull.wither.name", "Wither Skeleton Skull");
LANG_US.put("item.skull.zombie.name", "Zombie Head");
LANG_US.put("item.skull.char.name", "Head");
LANG_US.put("item.skull.player.name", "%s's Head");
LANG_US.put("item.skull.creeper.name", "Creeper Head");
LANG_US.put("item.skull.dragon.name", "Dragon Head");
LANG_US.put("item.carrotOnAStick.name", "Carrot on a Stick");
LANG_US.put("item.netherStar.name", "Nether Star");
LANG_US.put("item.pumpkinPie.name", "Pumpkin Pie");
LANG_US.put("item.enchantedBook.name", "Enchanted Book");
LANG_US.put("item.fireworks.name", "Firework Rocket");
LANG_US.put("item.fireworks.flight", "Flight Duration:");
LANG_US.put("item.fireworksCharge.name", "Firework Star");
LANG_US.put("item.fireworksCharge.black", "Black");
LANG_US.put("item.fireworksCharge.red", "Red");
LANG_US.put("item.fireworksCharge.green", "Green");
LANG_US.put("item.fireworksCharge.brown", "Brown");
LANG_US.put("item.fireworksCharge.blue", "Blue");
LANG_US.put("item.fireworksCharge.purple", "Purple");
LANG_US.put("item.fireworksCharge.cyan", "Cyan");
LANG_US.put("item.fireworksCharge.silver", "Light Gray");
LANG_US.put("item.fireworksCharge.gray", "Gray");
LANG_US.put("item.fireworksCharge.pink", "Pink");
LANG_US.put("item.fireworksCharge.lime", "Lime");
LANG_US.put("item.fireworksCharge.yellow", "Yellow");
LANG_US.put("item.fireworksCharge.lightBlue", "Light Blue");
LANG_US.put("item.fireworksCharge.magenta", "Magenta");
LANG_US.put("item.fireworksCharge.orange", "Orange");
LANG_US.put("item.fireworksCharge.white", "White");
LANG_US.put("item.fireworksCharge.customColor", "Custom");
LANG_US.put("item.fireworksCharge.fadeTo", "Fade to");
LANG_US.put("item.fireworksCharge.flicker", "Twinkle");
LANG_US.put("item.fireworksCharge.trail", "Trail");
LANG_US.put("item.fireworksCharge.type.0", "Small Ball");
LANG_US.put("item.fireworksCharge.type.1", "Large Ball");
LANG_US.put("item.fireworksCharge.type.2", "Star-shaped");
LANG_US.put("item.fireworksCharge.type.3", "Creeper-shaped");
LANG_US.put("item.fireworksCharge.type.4", "Burst");
LANG_US.put("item.fireworksCharge.type", "Unknown Shape");
LANG_US.put("item.netherbrick.name", "Nether Brick");
LANG_US.put("item.netherquartz.name", "Nether Quartz");
LANG_US.put("item.armorStand.name", "Armor Stand");
LANG_US.put("item.horsearmormetal.name", "Iron Horse Armor");
LANG_US.put("item.horsearmorgold.name", "Gold Horse Armor");
LANG_US.put("item.horsearmordiamond.name", "Diamond Horse Armor");
LANG_US.put("item.prismarineShard.name", "Prismarine Shard");
LANG_US.put("item.prismarineCrystals.name", "Prismarine Crystals");
LANG_US.put("item.chorusFruit.name", "Chorus Fruit");
LANG_US.put("item.chorusFruitPopped.name", "Popped Chorus Fruit");
LANG_US.put("item.beetroot.name", "Beetroot");
LANG_US.put("item.beetroot_seeds.name", "Beetroot Seeds");
LANG_US.put("item.beetroot_soup.name", "Beetroot Soup");
LANG_US.put("item.dragon_breath.name", "Dragon's Breath");
LANG_US.put("item.elytra.name", "Elytra");
LANG_US.put("item.totem.name", "Totem of Undying");
LANG_US.put("item.shulkerShell.name", "Shulker Shell");
LANG_US.put("item.ironNugget.name", "Iron Nugget");
LANG_US.put("item.knowledgeBook.name", "Knowledge Book");
LANG_US.put("container.inventory", "Inventory");
LANG_US.put("container.hopper", "Item Hopper");
LANG_US.put("container.crafting", "Crafting");
LANG_US.put("container.dispenser", "Dispenser");
LANG_US.put("container.dropper", "Dropper");
LANG_US.put("container.furnace", "Furnace");
LANG_US.put("container.enchant", "Enchant");
LANG_US.put("container.enchant.lapis.one", "1 Lapis Lazuli");
LANG_US.put("container.enchant.lapis.many", "%s Lapis Lazuli");
LANG_US.put("container.enchant.level.one", "1 Enchantment Level");
LANG_US.put("container.enchant.level.many", "%s Enchantment Levels");
LANG_US.put("container.enchant.level.requirement", "Level requirement: %s");
LANG_US.put("container.enchant.clue", "%s . . . ?");
LANG_US.put("container.repair", "Repair & Name");
LANG_US.put("container.repair.cost", "Enchantment Cost: %1$s");
LANG_US.put("container.repair.expensive", "Too Expensive!");
LANG_US.put("container.creative", "Item Selection");
LANG_US.put("container.brewing", "Brewing Stand");
LANG_US.put("container.chest", "Chest");
LANG_US.put("container.chestDouble", "Large Chest");
LANG_US.put("container.enderchest", "Ender Chest");
LANG_US.put("container.beacon", "Beacon");
LANG_US.put("container.shulkerBox", "Shulker Box");
LANG_US.put("container.shulkerBox.more", "and %s more...");
LANG_US.put("container.spectatorCantOpen", "Unable to open. Loot not generated yet.");
LANG_US.put("container.isLocked", "%s is locked!");
LANG_US.put("structure_block.save_success", "Structure saved as '%s'");
LANG_US.put("structure_block.save_failure", "Unable to save structure '%s'");
LANG_US.put("structure_block.load_success", "Structure loaded from '%s'");
LANG_US.put("structure_block.load_prepare", "Structure '%s' position prepared");
LANG_US.put("structure_block.load_not_found", "Structure '%s' is not available");
LANG_US.put("structure_block.size_success", "Size successfully detected for '%s'");
LANG_US.put("structure_block.size_failure", "Unable to detect structure size, add corners with matching structure names");
LANG_US.put("structure_block.mode.save", "Save");
LANG_US.put("structure_block.mode.load", "Load");
LANG_US.put("structure_block.mode.data", "Data");
LANG_US.put("structure_block.mode.corner", "Corner");
LANG_US.put("structure_block.hover.save", "Save: %s");
LANG_US.put("structure_block.hover.load", "Load: %s");
LANG_US.put("structure_block.hover.data", "Data: %s");
LANG_US.put("structure_block.hover.corner", "Corner: %s");
LANG_US.put("structure_block.mode_info.save", "Save mode - write to file");
LANG_US.put("structure_block.mode_info.load", "Load mode - load from file");
LANG_US.put("structure_block.mode_info.data", "Data mode - game logic marker");
LANG_US.put("structure_block.mode_info.corner", "Corner mode - placement and size marker");
LANG_US.put("structure_block.structure_name", "Structure Name");
LANG_US.put("structure_block.custom_data", "Custom Data Tag Name");
LANG_US.put("structure_block.position", "Relative Position");
LANG_US.put("structure_block.size", "Structure Size");
LANG_US.put("structure_block.integrity", "Structure Integrity and Seed");
LANG_US.put("structure_block.include_entities", "Include entities:");
LANG_US.put("structure_block.detect_size", "Detect structure size and position:");
LANG_US.put("structure_block.button.detect_size", "DETECT");
LANG_US.put("structure_block.button.save", "SAVE");
LANG_US.put("structure_block.button.load", "LOAD");
LANG_US.put("structure_block.show_air", "Show invisible blocks:");
LANG_US.put("structure_block.show_boundingbox", "Show bounding box:");
LANG_US.put("item.dyed", "Dyed");
LANG_US.put("item.unbreakable", "Unbreakable");
LANG_US.put("item.canBreak", "Can break:");
LANG_US.put("item.canPlace", "Can be placed on:");
LANG_US.put("item.color", "Color: %s");
LANG_US.put("item.nbt_tags", "NBT: %s tag(s)");
LANG_US.put("item.durability", "Durability: %s / %s");
LANG_US.put("filled_map.mansion", "Woodland Explorer Map");
LANG_US.put("filled_map.monument", "Ocean Explorer Map");
LANG_US.put("filled_map.unknown", "Unknown Map");
LANG_US.put("filled_map.level", "(Level %s/%s)");
LANG_US.put("filled_map.scale", "Scaling at 1:%s");
LANG_US.put("entity.Item.name", "Item");
LANG_US.put("entity.XPOrb.name", "Experience Orb");
LANG_US.put("entity.SmallFireball.name", "Small Fireball");
LANG_US.put("entity.Fireball.name", "Fireball");
LANG_US.put("entity.DragonFireball.name", "Dragon Fireball");
LANG_US.put("entity.ThrownPotion.name", "Potion");
LANG_US.put("entity.Arrow.name", "Arrow");
LANG_US.put("entity.Snowball.name", "Snowball");
LANG_US.put("entity.Painting.name", "Painting");
LANG_US.put("entity.ArmorStand.name", "Armor Stand");
LANG_US.put("entity.Mob.name", "Mob");
LANG_US.put("entity.Monster.name", "Monster");
LANG_US.put("entity.Creeper.name", "Creeper");
LANG_US.put("entity.Skeleton.name", "Skeleton");
LANG_US.put("entity.WitherSkeleton.name", "Wither Skeleton");
LANG_US.put("entity.Stray.name", "Stray");
LANG_US.put("entity.Spider.name", "Spider");
LANG_US.put("entity.Giant.name", "Giant");
LANG_US.put("entity.Zombie.name", "Zombie");
LANG_US.put("entity.Husk.name", "Husk");
LANG_US.put("entity.Slime.name", "Slime");
LANG_US.put("entity.Ghast.name", "Ghast");
LANG_US.put("entity.PigZombie.name", "Zombie Pigman");
LANG_US.put("entity.Enderman.name", "Enderman");
LANG_US.put("entity.Endermite.name", "Endermite");
LANG_US.put("entity.Silverfish.name", "Silverfish");
LANG_US.put("entity.CaveSpider.name", "Cave Spider");
LANG_US.put("entity.Blaze.name", "Blaze");
LANG_US.put("entity.LavaSlime.name", "Magma Cube");
LANG_US.put("entity.MushroomCow.name", "Mooshroom");
LANG_US.put("entity.Villager.name", "Villager");
LANG_US.put("entity.ZombieVillager.name", "Zombie Villager");
LANG_US.put("entity.VillagerGolem.name", "Iron Golem");
LANG_US.put("entity.SnowMan.name", "Snow Golem");
LANG_US.put("entity.EnderDragon.name", "Ender Dragon");
LANG_US.put("entity.WitherBoss.name", "Wither");
LANG_US.put("entity.Witch.name", "Witch");
LANG_US.put("entity.Guardian.name", "Guardian");
LANG_US.put("entity.ElderGuardian.name", "Elder Guardian");
LANG_US.put("entity.Shulker.name", "Shulker");
LANG_US.put("entity.PolarBear.name", "Polar Bear");
LANG_US.put("entity.EvocationIllager.name", "Evoker");
LANG_US.put("entity.Vex.name", "Vex");
LANG_US.put("entity.VindicationIllager.name", "Vindicator");
LANG_US.put("entity.Parrot.name", "Parrot");
LANG_US.put("entity.IllusionIllager.name", "Illusioner");
LANG_US.put("entity.Villager.farmer", "Farmer");
LANG_US.put("entity.Villager.fisherman", "Fisherman");
LANG_US.put("entity.Villager.shepherd", "Shepherd");
LANG_US.put("entity.Villager.fletcher", "Fletcher");
LANG_US.put("entity.Villager.librarian", "Librarian");
LANG_US.put("entity.Villager.cleric", "Cleric");
LANG_US.put("entity.Villager.armor", "Armorer");
LANG_US.put("entity.Villager.weapon", "Weapon Smith");
LANG_US.put("entity.Villager.tool", "Tool Smith");
LANG_US.put("entity.Villager.butcher", "Butcher");
LANG_US.put("entity.Villager.leather", "Leatherworker");
LANG_US.put("entity.Villager.nitwit", "Nitwit");
LANG_US.put("entity.Villager.cartographer", "Cartographer");
LANG_US.put("entity.Pig.name", "Pig");
LANG_US.put("entity.Sheep.name", "Sheep");
LANG_US.put("entity.Cow.name", "Cow");
LANG_US.put("entity.Chicken.name", "Chicken");
LANG_US.put("entity.Squid.name", "Squid");
LANG_US.put("entity.Wolf.name", "Wolf");
LANG_US.put("entity.Ozelot.name", "Ocelot");
LANG_US.put("entity.Cat.name", "Cat");
LANG_US.put("entity.Bat.name", "Bat");
LANG_US.put("entity.Horse.name", "Horse");
LANG_US.put("entity.Donkey.name", "Donkey");
LANG_US.put("entity.Mule.name", "Mule");
LANG_US.put("entity.SkeletonHorse.name", "Skeleton Horse");
LANG_US.put("entity.ZombieHorse.name", "Zombie Horse");
LANG_US.put("entity.Rabbit.name", "Rabbit");
LANG_US.put("entity.KillerBunny.name", "The Killer Bunny");
LANG_US.put("entity.Llama.name", "Llama");
LANG_US.put("entity.PrimedTnt.name", "Block of TNT");
LANG_US.put("entity.FallingSand.name", "Falling Block");
LANG_US.put("entity.Minecart.name", "Minecart");
LANG_US.put("entity.MinecartHopper.name", "Minecart with Hopper");
LANG_US.put("entity.MinecartChest.name", "Minecart with Chest");
LANG_US.put("entity.Boat.name", "Boat");
LANG_US.put("entity.generic.name", "unknown");
LANG_US.put("death.fell.accident.ladder", "%1$s fell off a ladder");
LANG_US.put("death.fell.accident.vines", "%1$s fell off some vines");
LANG_US.put("death.fell.accident.water", "%1$s fell out of the water");
LANG_US.put("death.fell.accident.generic", "%1$s fell from a high place");
LANG_US.put("death.fell.killer", "%1$s was doomed to fall");
LANG_US.put("death.fell.assist", "%1$s was doomed to fall by %2$s");
LANG_US.put("death.fell.assist.item", "%1$s was doomed to fall by %2$s using %3$s");
LANG_US.put("death.fell.finish", "%1$s fell too far and was finished by %2$s");
LANG_US.put("death.fell.finish.item", "%1$s fell too far and was finished by %2$s using %3$s");
LANG_US.put("death.attack.lightningBolt", "%1$s was struck by lightning");
LANG_US.put("death.attack.inFire", "%1$s went up in flames");
LANG_US.put("death.attack.inFire.player", "%1$s walked into fire whilst fighting %2$s");
LANG_US.put("death.attack.onFire", "%1$s burned to death");
LANG_US.put("death.attack.onFire.player", "%1$s was burnt to a crisp whilst fighting %2$s");
LANG_US.put("death.attack.lava", "%1$s tried to swim in lava");
LANG_US.put("death.attack.lava.player", "%1$s tried to swim in lava to escape %2$s");
LANG_US.put("death.attack.hotFloor", "%1$s discovered floor was lava");
LANG_US.put("death.attack.hotFloor.player", "%1$s walked into danger zone due to %2$s");
LANG_US.put("death.attack.inWall", "%1$s suffocated in a wall");
LANG_US.put("death.attack.cramming", "%1$s was squished too much");
LANG_US.put("death.attack.drown", "%1$s drowned");
LANG_US.put("death.attack.drown.player", "%1$s drowned whilst trying to escape %2$s");
LANG_US.put("death.attack.starve", "%1$s starved to death");
LANG_US.put("death.attack.cactus", "%1$s was pricked to death");
LANG_US.put("death.attack.cactus.player", "%1$s walked into a cactus whilst trying to escape %2$s");
LANG_US.put("death.attack.generic", "%1$s died");
LANG_US.put("death.attack.explosion", "%1$s blew up");
LANG_US.put("death.attack.explosion.player", "%1$s was blown up by %2$s");
LANG_US.put("death.attack.magic", "%1$s was killed by magic");
LANG_US.put("death.attack.wither", "%1$s withered away");
LANG_US.put("death.attack.anvil", "%1$s was squashed by a falling anvil");
LANG_US.put("death.attack.fallingBlock", "%1$s was squashed by a falling block");
LANG_US.put("death.attack.mob", "%1$s was slain by %2$s");
LANG_US.put("death.attack.player", "%1$s was slain by %2$s");
LANG_US.put("death.attack.player.item", "%1$s was slain by %2$s using %3$s");
LANG_US.put("death.attack.arrow", "%1$s was shot by %2$s");
LANG_US.put("death.attack.arrow.item", "%1$s was shot by %2$s using %3$s");
LANG_US.put("death.attack.fireball", "%1$s was fireballed by %2$s");
LANG_US.put("death.attack.fireball.item", "%1$s was fireballed by %2$s using %3$s");
LANG_US.put("death.attack.thrown", "%1$s was pummeled by %2$s");
LANG_US.put("death.attack.thrown.item", "%1$s was pummeled by %2$s using %3$s");
LANG_US.put("death.attack.indirectMagic", "%1$s was killed by %2$s using magic");
LANG_US.put("death.attack.indirectMagic.item", "%1$s was killed by %2$s using %3$s");
LANG_US.put("death.attack.thorns", "%1$s was killed trying to hurt %2$s");
LANG_US.put("death.attack.fall", "%1$s hit the ground too hard");
LANG_US.put("death.attack.outOfWorld", "%1$s fell out of the world");
LANG_US.put("death.attack.dragonBreath", "%1$s was roasted in dragon breath");
LANG_US.put("death.attack.flyIntoWall", "%1$s experienced kinetic energy");
LANG_US.put("death.attack.fireworks", "%1$s went off with a bang");
LANG_US.put("deathScreen.respawn", "Respawn");
LANG_US.put("deathScreen.spectate", "Spectate world");
LANG_US.put("deathScreen.deleteWorld", "Delete world");
LANG_US.put("deathScreen.titleScreen", "Title screen");
LANG_US.put("deathScreen.score", "Score");
LANG_US.put("deathScreen.title.hardcore", "Game over!");
LANG_US.put("deathScreen.title", "You died!");
LANG_US.put("deathScreen.leaveServer", "Leave server");
LANG_US.put("deathScreen.quit.confirm", "Are you sure you want to quit?");
LANG_US.put("effect.none", "No Effects");
LANG_US.put("effect.moveSpeed", "Speed");
LANG_US.put("effect.moveSlowdown", "Slowness");
LANG_US.put("effect.digSpeed", "Haste");
LANG_US.put("effect.digSlowDown", "Mining Fatigue");
LANG_US.put("effect.damageBoost", "Strength");
LANG_US.put("effect.heal", "Instant Health");
LANG_US.put("effect.harm", "Instant Damage");
LANG_US.put("effect.jump", "Jump Boost");
LANG_US.put("effect.confusion", "Nausea");
LANG_US.put("effect.regeneration", "Regeneration");
LANG_US.put("effect.resistance", "Resistance");
LANG_US.put("effect.fireResistance", "Fire Resistance");
LANG_US.put("effect.waterBreathing", "Water Breathing");
LANG_US.put("effect.invisibility", "Invisibility");
LANG_US.put("effect.blindness", "Blindness");
LANG_US.put("effect.nightVision", "Night Vision");
LANG_US.put("effect.hunger", "Hunger");
LANG_US.put("effect.weakness", "Weakness");
LANG_US.put("effect.poison", "Poison");
LANG_US.put("effect.wither", "Wither");
LANG_US.put("effect.healthBoost", "Health Boost");
LANG_US.put("effect.absorption", "Absorption");
LANG_US.put("effect.saturation", "Saturation");
LANG_US.put("effect.glowing", "Glowing");
LANG_US.put("effect.luck", "Luck");
LANG_US.put("effect.unluck", "Bad Luck");
LANG_US.put("effect.levitation", "Levitation");
LANG_US.put("tipped_arrow.effect.empty", "Uncraftable Tipped Arrow");
LANG_US.put("tipped_arrow.effect.water", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.mundane", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.thick", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.awkward", "Tipped Arrow");
LANG_US.put("tipped_arrow.effect.night_vision", "Arrow of Night Vision");
LANG_US.put("tipped_arrow.effect.invisibility", "Arrow of Invisibility");
LANG_US.put("tipped_arrow.effect.leaping", "Arrow of Leaping");
LANG_US.put("tipped_arrow.effect.fire_resistance", "Arrow of Fire Resistance");
LANG_US.put("tipped_arrow.effect.swiftness", "Arrow of Swiftness");
LANG_US.put("tipped_arrow.effect.slowness", "Arrow of Slowness");
LANG_US.put("tipped_arrow.effect.water", "Arrow of Splashing");
LANG_US.put("tipped_arrow.effect.water_breathing", "Arrow of Water Breathing");
LANG_US.put("tipped_arrow.effect.healing", "Arrow of Healing");
LANG_US.put("tipped_arrow.effect.harming", "Arrow of Harming");
LANG_US.put("tipped_arrow.effect.poison", "Arrow of Poison");
LANG_US.put("tipped_arrow.effect.regeneration", "Arrow of Regeneration");
LANG_US.put("tipped_arrow.effect.strength", "Arrow of Strength");
LANG_US.put("tipped_arrow.effect.weakness", "Arrow of Weakness");
LANG_US.put("tipped_arrow.effect.levitation", "Arrow of Levitation");
LANG_US.put("tipped_arrow.effect.luck", "Arrow of Luck");
LANG_US.put("potion.whenDrank", "When Applied:");
LANG_US.put("potion.effect.empty", "Uncraftable Potion");
LANG_US.put("potion.effect.water", "Water Bottle");
LANG_US.put("potion.effect.mundane", "Mundane Potion");
LANG_US.put("potion.effect.thick", "Thick Potion");
LANG_US.put("potion.effect.awkward", "Awkward Potion");
LANG_US.put("potion.effect.night_vision", "Potion of Night Vision");
LANG_US.put("potion.effect.invisibility", "Potion of Invisibility");
LANG_US.put("potion.effect.leaping", "Potion of Leaping");
LANG_US.put("potion.effect.fire_resistance", "Potion of Fire Resistance");
LANG_US.put("potion.effect.swiftness", "Potion of Swiftness");
LANG_US.put("potion.effect.slowness", "Potion of Slowness");
LANG_US.put("potion.effect.water_breathing", "Potion of Water Breathing");
LANG_US.put("potion.effect.healing", "Potion of Healing");
LANG_US.put("potion.effect.harming", "Potion of Harming");
LANG_US.put("potion.effect.poison", "Potion of Poison");
LANG_US.put("potion.effect.regeneration", "Potion of Regeneration");
LANG_US.put("potion.effect.strength", "Potion of Strength");
LANG_US.put("potion.effect.weakness", "Potion of Weakness");
LANG_US.put("potion.effect.levitation", "Potion of Levitation");
LANG_US.put("potion.effect.luck", "Potion of Luck");
LANG_US.put("splash_potion.effect.empty", "Splash Uncraftable Potion");
LANG_US.put("splash_potion.effect.water", "Splash Water Bottle");
LANG_US.put("splash_potion.effect.mundane", "Mundane Splash Potion");
LANG_US.put("splash_potion.effect.thick", "Thick Splash Potion");
LANG_US.put("splash_potion.effect.awkward", "Awkward Splash Potion");
LANG_US.put("splash_potion.effect.night_vision", "Splash Potion of Night Vision");
LANG_US.put("splash_potion.effect.invisibility", "Splash Potion of Invisibility");
LANG_US.put("splash_potion.effect.leaping", "Splash Potion of Leaping");
LANG_US.put("splash_potion.effect.fire_resistance", "Splash Potion of Fire Resistance");
LANG_US.put("splash_potion.effect.swiftness", "Splash Potion of Swiftness");
LANG_US.put("splash_potion.effect.slowness", "Splash Potion of Slowness");
LANG_US.put("splash_potion.effect.water_breathing", "Splash Potion of Water Breathing");
LANG_US.put("splash_potion.effect.healing", "Splash Potion of Healing");
LANG_US.put("splash_potion.effect.harming", "Splash Potion of Harming");
LANG_US.put("splash_potion.effect.poison", "Splash Potion of Poison");
LANG_US.put("splash_potion.effect.regeneration", "Splash Potion of Regeneration");
LANG_US.put("splash_potion.effect.strength", "Splash Potion of Strength");
LANG_US.put("splash_potion.effect.weakness", "Splash Potion of Weakness");
LANG_US.put("splash_potion.effect.levitation", "Splash Potion of Levitation");
LANG_US.put("splash_potion.effect.luck", "Splash Potion of Luck");
LANG_US.put("lingering_potion.effect.empty", "Lingering Uncraftable Potion");
LANG_US.put("lingering_potion.effect.water", "Lingering Water Bottle");
LANG_US.put("lingering_potion.effect.mundane", "Mundane Lingering Potion");
LANG_US.put("lingering_potion.effect.thick", "Thick Lingering Potion");
LANG_US.put("lingering_potion.effect.awkward", "Awkward Lingering Potion");
LANG_US.put("lingering_potion.effect.night_vision", "Lingering Potion of Night Vision");
LANG_US.put("lingering_potion.effect.invisibility", "Lingering Potion of Invisibility");
LANG_US.put("lingering_potion.effect.leaping", "Lingering Potion of Leaping");
LANG_US.put("lingering_potion.effect.fire_resistance", "Lingering Potion of Fire Resistance");
LANG_US.put("lingering_potion.effect.swiftness", "Lingering Potion of Swiftness");
LANG_US.put("lingering_potion.effect.slowness", "Lingering Potion of Slowness");
LANG_US.put("lingering_potion.effect.water_breathing", "Lingering Potion of Water Breathing");
LANG_US.put("lingering_potion.effect.healing", "Lingering Potion of Healing");
LANG_US.put("lingering_potion.effect.harming", "Lingering Potion of Harming");
LANG_US.put("lingering_potion.effect.poison", "Lingering Potion of Poison");
LANG_US.put("lingering_potion.effect.regeneration", "Lingering Potion of Regeneration");
LANG_US.put("lingering_potion.effect.strength", "Lingering Potion of Strength");
LANG_US.put("lingering_potion.effect.weakness", "Lingering Potion of Weakness");
LANG_US.put("lingering_potion.effect.levitation", "Lingering Potion of Levitation");
LANG_US.put("lingering_potion.effect.luck", "Lingering Potion of Luck");
LANG_US.put("potion.potency.0=", "");
LANG_US.put("potion.potency.1", "II");
LANG_US.put("potion.potency.2", "III");
LANG_US.put("enchantment.damage.all", "Sharpness");
LANG_US.put("enchantment.damage.undead", "Smite");
LANG_US.put("enchantment.damage.arthropods", "Bane of Arthropods");
LANG_US.put("enchantment.knockback", "Knockback");
LANG_US.put("enchantment.fire", "Fire Aspect");
LANG_US.put("enchantment.sweeping", "Sweeping Edge");
LANG_US.put("enchantment.protect.all", "Protection");
LANG_US.put("enchantment.protect.fire", "Fire Protection");
LANG_US.put("enchantment.protect.fall", "Feather Falling");
LANG_US.put("enchantment.protect.explosion", "Blast Protection");
LANG_US.put("enchantment.protect.projectile", "Projectile Protection");
LANG_US.put("enchantment.oxygen", "Respiration");
LANG_US.put("enchantment.waterWorker", "Aqua Affinity");
LANG_US.put("enchantment.waterWalker", "Depth Strider");
LANG_US.put("enchantment.frostWalker", "Frost Walker");
LANG_US.put("enchantment.digging", "Efficiency");
LANG_US.put("enchantment.untouching", "Silk Touch");
LANG_US.put("enchantment.durability", "Unbreaking");
LANG_US.put("enchantment.lootBonus", "Looting");
LANG_US.put("enchantment.lootBonusDigger", "Fortune");
LANG_US.put("enchantment.lootBonusFishing", "Luck of the Sea");
LANG_US.put("enchantment.fishingSpeed", "Lure");
LANG_US.put("enchantment.arrowDamage", "Power");
LANG_US.put("enchantment.arrowFire", "Flame");
LANG_US.put("enchantment.arrowKnockback", "Punch");
LANG_US.put("enchantment.arrowInfinite", "Infinity");
LANG_US.put("enchantment.thorns", "Thorns");
LANG_US.put("enchantment.mending", "Mending");
LANG_US.put("enchantment.binding_curse", "Curse of Binding");
LANG_US.put("enchantment.vanishing_curse", "Curse of Vanishing");
LANG_US.put("enchantment.level.1", "I");
LANG_US.put("enchantment.level.2", "II");
LANG_US.put("enchantment.level.3", "III");
LANG_US.put("enchantment.level.4", "IV");
LANG_US.put("enchantment.level.5", "V");
LANG_US.put("enchantment.level.6", "VI");
LANG_US.put("enchantment.level.7", "VII");
LANG_US.put("enchantment.level.8", "VIII");
LANG_US.put("enchantment.level.9", "IX");
LANG_US.put("enchantment.level.10", "X");
LANG_US.put("gui.advancements", "Advancements");
LANG_US.put("gui.stats", "Statistics");
LANG_US.put("advancements.empty", "There doesn't seem to be anything here...");
LANG_US.put("advancements.toast.task", "Advancement Made!");
LANG_US.put("advancements.toast.challenge", "Challenge Complete!");
LANG_US.put("advancements.toast.goal", "Goal Reached!");
LANG_US.put("stats.tooltip.type.statistic", "Statistic");
LANG_US.put("stat.generalButton", "General");
LANG_US.put("stat.blocksButton", "Blocks");
LANG_US.put("stat.itemsButton", "Items");
LANG_US.put("stat.mobsButton", "Mobs");
LANG_US.put("stat.used", "Times Used");
LANG_US.put("stat.mined", "Times Mined");
LANG_US.put("stat.depleted", "Times Depleted");
LANG_US.put("stat.crafted", "Times Crafted");
LANG_US.put("stat.entityKills", "You killed %s %s");
LANG_US.put("stat.entityKilledBy", "%s killed you %s time(s)");
LANG_US.put("stat.entityKills.none", "You have never killed %s");
LANG_US.put("stat.entityKilledBy.none", "You have never been killed by %s");
LANG_US.put("stat.startGame", "Times Played");
LANG_US.put("stat.createWorld", "Worlds Created");
LANG_US.put("stat.loadWorld", "Saves Loaded");
LANG_US.put("stat.joinMultiplayer", "Multiplayer Joins");
LANG_US.put("stat.leaveGame", "Games Quit");
LANG_US.put("stat.playOneMinute", "Time Played");
LANG_US.put("stat.timeSinceDeath", "Since Last Death");
LANG_US.put("stat.sneakTime", "Sneak Time");
LANG_US.put("stat.walkOneCm", "Distance Walked");
LANG_US.put("stat.crouchOneCm", "Distance Crouched");
LANG_US.put("stat.sprintOneCm", "Distance Sprinted");
LANG_US.put("stat.fallOneCm", "Distance Fallen");
LANG_US.put("stat.swimOneCm", "Distance Swum");
LANG_US.put("stat.flyOneCm", "Distance Flown");
LANG_US.put("stat.climbOneCm", "Distance Climbed");
LANG_US.put("stat.diveOneCm", "Distance Dove");
LANG_US.put("stat.minecartOneCm", "Distance by Minecart");
LANG_US.put("stat.boatOneCm", "Distance by Boat");
LANG_US.put("stat.pigOneCm", "Distance by Pig");
LANG_US.put("stat.horseOneCm", "Distance by Horse");
LANG_US.put("stat.aviateOneCm", "Distance by Elytra");
LANG_US.put("stat.jump", "Jumps");
LANG_US.put("stat.drop", "Items Dropped");
LANG_US.put("stat.dropped", "Dropped");
LANG_US.put("stat.pickup", "Picked Up");
LANG_US.put("stat.damageDealt", "Damage Dealt");
LANG_US.put("stat.damageTaken", "Damage Taken");
LANG_US.put("stat.deaths", "Number of Deaths");
LANG_US.put("stat.mobKills", "Mob Kills");
LANG_US.put("stat.animalsBred", "Animals Bred");
LANG_US.put("stat.playerKills", "Player Kills");
LANG_US.put("stat.fishCaught", "Fish Caught");
LANG_US.put("stat.treasureFished", "Treasure Fished");
LANG_US.put("stat.junkFished", "Junk Fished");
LANG_US.put("stat.talkedToVillager", "Talked to Villagers");
LANG_US.put("stat.tradedWithVillager", "Traded with Villagers");
LANG_US.put("stat.cakeSlicesEaten", "Cake Slices Eaten");
LANG_US.put("stat.cauldronFilled", "Cauldrons Filled");
LANG_US.put("stat.cauldronUsed", "Water Taken from Cauldron");
LANG_US.put("stat.armorCleaned", "Armor Pieces Cleaned");
LANG_US.put("stat.bannerCleaned", "Banners Cleaned");
LANG_US.put("stat.brewingstandInteraction", "Interactions with Brewing Stand");
LANG_US.put("stat.beaconInteraction", "Interactions with Beacon");
LANG_US.put("stat.dropperInspected", "Droppers Searched");
LANG_US.put("stat.hopperInspected", "Hoppers Searched");
LANG_US.put("stat.dispenserInspected", "Dispensers Searched");
LANG_US.put("stat.noteblockPlayed", "Note Blocks Played");
LANG_US.put("stat.noteblockTuned", "Note Blocks Tuned");
LANG_US.put("stat.flowerPotted", "Plants Potted");
LANG_US.put("stat.trappedChestTriggered", "Trapped Chests Triggered");
LANG_US.put("stat.enderchestOpened", "Ender Chests Opened");
LANG_US.put("stat.itemEnchanted", "Items Enchanted");
LANG_US.put("stat.recordPlayed", "Records Played");
LANG_US.put("stat.furnaceInteraction", "Interactions with Furnace");
LANG_US.put("stat.workbenchInteraction", "Interactions with Crafting Table");
LANG_US.put("stat.chestOpened", "Chests Opened");
LANG_US.put("stat.shulkerBoxOpened", "Shulker Boxes Opened");
LANG_US.put("stat.sleepInBed", "Times Slept in a Bed");
LANG_US.put("stat.mineBlock", "%1$s Mined");
LANG_US.put("stat.craftItem", "%1$s Crafted");
LANG_US.put("stat.useItem", "%1$s Used");
LANG_US.put("stat.breakItem", "%1$s Depleted");
LANG_US.put("recipe.toast.title", "New Recipes Unlocked!");
LANG_US.put("recipe.toast.description", "Check your recipe book");
LANG_US.put("commands.generic.exception", "An unknown error occurred while attempting to perform this command");
LANG_US.put("commands.generic.permission", "You do not have permission to use this command");
LANG_US.put("commands.generic.syntax", "Invalid command syntax");
LANG_US.put("commands.generic.player.notFound", "Player '%s' cannot be found");
LANG_US.put("commands.generic.entity.notFound", "Entity '%s' cannot be found");
LANG_US.put("commands.generic.selector.notFound", "Selector '%s' found nothing");
LANG_US.put("commands.generic.entity.invalidUuid", "The entity UUID '%s' is in an invalid format");
LANG_US.put("commands.generic.entity.invalidType", "Entity type '%s' is invalid");
LANG_US.put("commands.generic.notFound", "Unknown command. Try /help for a list of commands");
LANG_US.put("commands.generic.parameter.invalid", "'%s' is not a valid parameter");
LANG_US.put("commands.generic.num.invalid", "'%s' is not a valid number");
LANG_US.put("commands.generic.boolean.invalid", "'%s' is not true or false");
LANG_US.put("commands.generic.num.tooSmall", "The number you have entered (%s) is too small, it must be at least %s");
LANG_US.put("commands.generic.num.tooBig", "The number you have entered (%s) is too big, it must be at most %s");
LANG_US.put("commands.generic.blockstate.invalid", "'%s' is not a state for block %s");
LANG_US.put("commands.generic.usage", "Usage: %s");
LANG_US.put("commands.generic.selector_argument", "Invalid selector argument: '%s'");
LANG_US.put("commands.generic.player.unspecified", "You must specify which player you wish to perform this action on.");
LANG_US.put("commands.setidletimeout.usage", "/setidletimeout <minutes>");
LANG_US.put("commands.setidletimeout.success", "Successfully set the idle timeout to %s minutes.");
LANG_US.put("commands.xp.failure.widthdrawXp", "Cannot give player negative experience points");
LANG_US.put("commands.xp.success", "Given %s experience to %s");
LANG_US.put("commands.xp.success.levels", "Given %s levels to %s");
LANG_US.put("commands.xp.success.negative.levels", "Taken %s levels from %s");
LANG_US.put("commands.xp.usage", "/xp <amount> [player] OR /xp <amount>L [player]");
LANG_US.put("commands.playsound.usage", "/playsound <sound> <source> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]");
LANG_US.put("commands.playsound.success", "Played sound '%s' to %s");
LANG_US.put("commands.playsound.playerTooFar", "Player %s is too far away to hear the sound");
LANG_US.put("commands.playsound.unknownSoundSource", "Source %s is unknown");
LANG_US.put("commands.give.usage", "/give <player> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.give.item.notFound", "There is no such item with name %s");
LANG_US.put("commands.give.block.notFound", "There is no such block with name %s");
LANG_US.put("commands.give.success", "Given %s * %s to %s");
LANG_US.put("commands.give.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.replaceitem.usage", "/replaceitem <entity|block> ...");
LANG_US.put("commands.replaceitem.entity.usage", "/replaceitem entity <selector> <slot> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.replaceitem.block.usage", "/replaceitem block <x> <y> <z> <slot> <item> [amount] [data] [dataTag]");
LANG_US.put("commands.replaceitem.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.replaceitem.noContainer", "Block at %s, %s, %s is not a container");
LANG_US.put("commands.replaceitem.failed", "Could not replace slot %s with %s * %s");
LANG_US.put("commands.replaceitem.success", "Replaced slot %s with %s * %s");
LANG_US.put("commands.stats.usage", "/stats <entity|block> ...");
LANG_US.put("commands.stats.entity.usage", "/stats entity <selector> <mode> ...");
LANG_US.put("commands.stats.entity.set.usage", "/stats entity <selector> set <stat> <selector> <objective>");
LANG_US.put("commands.stats.entity.clear.usage", "/stats entity <selector> clear <stat>");
LANG_US.put("commands.stats.block.usage", "/stats block <x> <y> <z> <mode> ...");
LANG_US.put("commands.stats.block.set.usage", "/stats block <x> <y> <z> set <stat> <selector> <objective>");
LANG_US.put("commands.stats.block.clear.usage", "/stats block <x> <y> <z> clear <stat>");
LANG_US.put("commands.stats.noCompatibleBlock", "Block at %s, %s, %s can not track stats");
LANG_US.put("commands.stats.failed", "Invalid parameters");
LANG_US.put("commands.stats.cleared", "Cleared %s stats");
LANG_US.put("commands.stats.success", "Storing %s stats in %s on %s");
LANG_US.put("commands.summon.usage", "/summon <entityname> [x] [y] [z] [dataTag]");
LANG_US.put("commands.summon.success", "Object successfully summoned");
LANG_US.put("commands.summon.failed", "Unable to summon object");
LANG_US.put("commands.summon.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.summon.outOfWorld", "Cannot summon the object out of the world");
LANG_US.put("commands.testforblock.usage", "/testforblock <x> <y> <z> <block> [dataValue|-1|state|*] [dataTag]");
LANG_US.put("commands.testforblock.failed.tile", "The block at %s, %s, %s is %s (expected: %s)");
LANG_US.put("commands.testforblock.failed.data", "The block at %s, %s, %s had the data value of %s (expected: %s)");
LANG_US.put("commands.testforblock.failed.nbt", "The block at %s, %s, %s did not have the required NBT keys");
LANG_US.put("commands.testforblock.failed.tileEntity", "The block at %s, %s, %s is not a block entity and cannot support tag matching");
LANG_US.put("commands.testforblock.success", "Successfully found the block at %s, %s, %s");
LANG_US.put("commands.testforblock.outOfWorld", "Cannot test for block outside of the world");
LANG_US.put("commands.setblock.usage", "/setblock <x> <y> <z> <block> [dataValue|state] [oldBlockHandling] [dataTag]");
LANG_US.put("commands.setblock.success", "Block placed");
LANG_US.put("commands.setblock.failed", "Unable to place block");
LANG_US.put("commands.setblock.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.setblock.outOfWorld", "Cannot place block outside of the world");
LANG_US.put("commands.setblock.notFound", "There is no such block with ID/name %s");
LANG_US.put("commands.setblock.noChange", "The block couldn't be placed");
LANG_US.put("commands.fill.usage", "/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [dataValue|state] [oldBlockHandling] [dataTag]");
LANG_US.put("commands.fill.outOfWorld", "Cannot place blocks outside of the world");
LANG_US.put("commands.fill.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.fill.success", "%s blocks filled");
LANG_US.put("commands.fill.failed", "No blocks filled");
LANG_US.put("commands.fill.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.clone.usage", "/clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [maskMode] [cloneMode]");
LANG_US.put("commands.clone.outOfWorld", "Cannot access blocks outside of the world");
LANG_US.put("commands.clone.noOverlap", "Source and destination can not overlap");
LANG_US.put("commands.clone.success", "%s blocks cloned");
LANG_US.put("commands.clone.failed", "No blocks cloned");
LANG_US.put("commands.clone.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.compare.usage", "/testforblocks <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]");
LANG_US.put("commands.compare.outOfWorld", "Cannot access blocks outside of the world");
LANG_US.put("commands.compare.failed", "Source and destination are not identical");
LANG_US.put("commands.compare.success", "%s blocks compared");
LANG_US.put("commands.compare.tooManyBlocks", "Too many blocks in the specified area (%s > %s)");
LANG_US.put("commands.blockdata.usage", "/blockdata <x> <y> <z> <dataTag>");
LANG_US.put("commands.blockdata.success", "Block data updated to: %s");
LANG_US.put("commands.blockdata.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.blockdata.outOfWorld", "Cannot change block outside of the world");
LANG_US.put("commands.blockdata.notValid", "The target block is not a data holder block");
LANG_US.put("commands.blockdata.failed", "The data tag did not change: %s");
LANG_US.put("commands.entitydata.usage", "/entitydata <entity> <dataTag>");
LANG_US.put("commands.entitydata.success", "Entity data updated to: %s");
LANG_US.put("commands.entitydata.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.entitydata.noPlayers", "%s is a player and cannot be changed");
LANG_US.put("commands.entitydata.failed", "The data tag did not change: %s");
LANG_US.put("commands.effect.usage", "/effect <player> <effect> [seconds] [amplifier] [hideParticles] OR /effect <player> clear");
LANG_US.put("commands.effect.notFound", "There is no such mob effect with ID %s");
LANG_US.put("commands.effect.success", "Given %1$s (ID %2$s) * %3$s to %4$s for %5$s seconds");
LANG_US.put("commands.effect.success.removed", "Took %1$s from %2$s");
LANG_US.put("commands.effect.success.removed.all", "Took all effects from %s");
LANG_US.put("commands.effect.failure.notActive", "Couldn't take %1$s from %2$s as they do not have the effect");
LANG_US.put("commands.effect.failure.notActive.all", "Couldn't take any effects from %s as they do not have any");
LANG_US.put("commands.enchant.usage", "/enchant <player> <enchantment ID> [level]");
LANG_US.put("commands.enchant.notFound", "There is no such enchantment with ID %s");
LANG_US.put("commands.enchant.noItem", "The target doesn't hold an item");
LANG_US.put("commands.enchant.cantEnchant", "The selected enchantment can't be added to the target item");
LANG_US.put("commands.enchant.cantCombine", "%1$s can't be combined with %2$s");
LANG_US.put("commands.enchant.success", "Enchanting succeeded");
LANG_US.put("commands.particle.usage", "/particle <name> <x> <y> <z> <xd> <yd> <zd> <speed> [count] [mode] [player] [params]");
LANG_US.put("commands.particle.success", "Playing effect %s for %s times");
LANG_US.put("commands.particle.notFound", "Unknown effect name (%s)");
LANG_US.put("commands.particle.invalidParam", "Invalid param given (%s)");
LANG_US.put("commands.clear.usage", "/clear [player] [item] [data] [maxCount] [dataTag]");
LANG_US.put("commands.clear.success", "Cleared the inventory of %s, removing %s items");
LANG_US.put("commands.clear.testing", "%s has %s items that match the criteria");
LANG_US.put("commands.clear.failure", "Could not clear the inventory of %s, no items to remove");
LANG_US.put("commands.clear.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.downfall.usage", "/toggledownfall");
LANG_US.put("commands.downfall.success", "Toggled downfall");
LANG_US.put("commands.time.usage", "/time <set|add|query> <value>");
LANG_US.put("commands.time.added", "Added %s to the time");
LANG_US.put("commands.time.set", "Set the time to %s");
LANG_US.put("commands.time.query", "Time is %s");
LANG_US.put("commands.players.usage", "/list");
LANG_US.put("commands.players.list", "There are %s/%s players online:");
LANG_US.put("commands.banlist.ips", "There are %s total banned IP addresses:");
LANG_US.put("commands.banlist.players", "There are %s total banned players:");
LANG_US.put("commands.banlist.usage", "/banlist [ips|players]");
LANG_US.put("commands.kill.usage", "/kill [player|entity]");
LANG_US.put("commands.kill.successful", "Killed %s");
LANG_US.put("commands.kick.success", "Kicked %s from the game");
LANG_US.put("commands.kick.success.reason", "Kicked %s from the game: '%s'");
LANG_US.put("commands.kick.usage", "/kick <player> [reason ...]");
LANG_US.put("commands.op.success", "Opped %s");
LANG_US.put("commands.op.failed", "Could not op %s");
LANG_US.put("commands.op.usage", "/op <player>");
LANG_US.put("commands.deop.success", "De-opped %s");
LANG_US.put("commands.deop.failed", "Could not de-op %s");
LANG_US.put("commands.deop.usage", "/deop <player>");
LANG_US.put("commands.say.usage", "/say <message ...>");
LANG_US.put("commands.ban.success", "Banned player %s");
LANG_US.put("commands.ban.failed", "Could not ban player %s");
LANG_US.put("commands.ban.usage", "/ban <name> [reason ...]");
LANG_US.put("commands.unban.success", "Unbanned player %s");
LANG_US.put("commands.unban.failed", "Could not unban player %s");
LANG_US.put("commands.unban.usage", "/pardon <name>");
LANG_US.put("commands.banip.invalid", "You have entered an invalid IP address or a player that is not online");
LANG_US.put("commands.banip.success", "Banned IP address %s");
LANG_US.put("commands.banip.success.players", "Banned IP address %s belonging to %s");
LANG_US.put("commands.banip.usage", "/ban-ip <address|name> [reason ...]");
LANG_US.put("commands.unbanip.invalid", "You have entered an invalid IP address");
LANG_US.put("commands.unbanip.success", "Unbanned IP address %s");
LANG_US.put("commands.unbanip.usage", "/pardon-ip <address>");
LANG_US.put("commands.save.usage", "/save-all [flush]");
LANG_US.put("commands.save-on.alreadyOn", "Saving is already turned on");
LANG_US.put("commands.save-on.usage", "/save-on");
LANG_US.put("commands.save-off.alreadyOff", "Saving is already turned off");
LANG_US.put("commands.save-off.usage", "/save-off");
LANG_US.put("commands.save.enabled", "Turned on world auto-saving");
LANG_US.put("commands.save.disabled", "Turned off world auto-saving");
LANG_US.put("commands.save.start", "Saving...");
LANG_US.put("commands.save.success", "Saved the world");
LANG_US.put("commands.save.failed", "Saving failed: %s");
LANG_US.put("commands.save.flushStart", "Flushing all saves...");
LANG_US.put("commands.save.flushEnd", "Flushing completed");
LANG_US.put("commands.stop.usage", "/stop");
LANG_US.put("commands.stop.start", "Stopping the server");
LANG_US.put("commands.tp.usage", "/tp [target player] <destination player> OR /tp [target player] <x> <y> <z> [<yaw> <pitch>]");
LANG_US.put("commands.tp.success", "Teleported %s to %s");
LANG_US.put("commands.tp.success.coordinates", "Teleported %s to %s, %s, %s");
LANG_US.put("commands.tp.notSameDimension", "Unable to teleport because players are not in the same dimension");
LANG_US.put("commands.teleport.usage", "/teleport <entity> <x> <y> <z> [<y-rot> <x-rot>]");
LANG_US.put("commands.teleport.success.coordinates", "Teleported %s to %s, %s, %s");
LANG_US.put("commands.whitelist.list", "There are %s (out of %s seen) whitelisted players:");
LANG_US.put("commands.whitelist.enabled", "Turned on the whitelist");
LANG_US.put("commands.whitelist.disabled", "Turned off the whitelist");
LANG_US.put("commands.whitelist.reloaded", "Reloaded the whitelist");
LANG_US.put("commands.whitelist.add.success", "Added %s to the whitelist");
LANG_US.put("commands.whitelist.add.failed", "Could not add %s to the whitelist");
LANG_US.put("commands.whitelist.add.usage", "/whitelist add <player>");
LANG_US.put("commands.whitelist.remove.success", "Removed %s from the whitelist");
LANG_US.put("commands.whitelist.remove.failed", "Could not remove %s from the whitelist");
LANG_US.put("commands.whitelist.remove.usage", "/whitelist remove <player>");
LANG_US.put("commands.whitelist.usage", "/whitelist <on|off|list|add|remove|reload>");
LANG_US.put("commands.advancement.usage", "/advancement <grant|revoke|test> <player>");
LANG_US.put("commands.advancement.advancementNotFound", "No advancement was found by the name '%1$s'");
LANG_US.put("commands.advancement.criterionNotFound", "The advancement '%1$s' does not contain the criterion '%2$s'");
LANG_US.put("commands.reload.usage", "/reload");
LANG_US.put("commands.reload.success", "Successfully reloaded loot tables, advancements and functions");
LANG_US.put("commands.function.usage", "/function <name> [if <selector>|unless <selector>]");
LANG_US.put("commands.function.unknown", "Unknown function '%s'");
LANG_US.put("commands.function.success", "Executed %2$s command(s) from function '%1$s'");
LANG_US.put("commands.function.skipped", "Skipped execution of function '%1$s'");
LANG_US.put("commands.advancement.grant.usage", "/advancement grant <player> <only|until|from|through|everything>");
LANG_US.put("commands.advancement.grant.only.usage", "/advancement grant <player> only <advancement> [criterion]");
LANG_US.put("commands.advancement.grant.only.failed", "Couldn't grant the advancement '%1$s' to %2$s because they already have it");
LANG_US.put("commands.advancement.grant.only.success", "Granted the entire advancement '%1$s' to %2$s");
LANG_US.put("commands.advancement.grant.criterion.failed", "Couldn't grant the criterion '%3$s' of advancement '%1$s' to %2$s because they already have it");
LANG_US.put("commands.advancement.grant.criterion.success", "Granted the criterion '%3$s' of advancement '%1$s' to %2$s");
LANG_US.put("commands.advancement.grant.until.usage", "/advancement grant <player> until <advancement>");
LANG_US.put("commands.advancement.grant.until.failed", "Couldn't grant the advancement '%1$s' or its ancestors to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.until.success", "Granted '%1$s' and all ancestors (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.from.usage", "/advancement grant <player> from <advancement>");
LANG_US.put("commands.advancement.grant.from.failed", "Couldn't grant the advancement '%1$s' or its descendants to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.from.success", "Granted '%1$s' and all descendants (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.through.usage", "/advancement grant <player> through <advancement>");
LANG_US.put("commands.advancement.grant.through.failed", "Couldn't grant the advancement '%1$s', its ancestors or its descendants to %2$s because they already have them all");
LANG_US.put("commands.advancement.grant.through.success", "Granted '%1$s', all ancestors and all descendants (%3$s total granted) to %2$s");
LANG_US.put("commands.advancement.grant.everything.usage", "/advancement grant <player> everything");
LANG_US.put("commands.advancement.grant.everything.failed", "Couldn't grant any advancements to %1$s because they already have them all");
LANG_US.put("commands.advancement.grant.everything.success", "Granted every advancement (%2$s total granted) to %1$s");
LANG_US.put("commands.advancement.revoke.usage", "/advancement revoke <player> <only|until|from|through|everything>");
LANG_US.put("commands.advancement.revoke.only.usage", "/advancement revoke <player> only <advancement> [criterion]");
LANG_US.put("commands.advancement.revoke.only.failed", "Couldn't revoke the advancement '%1$s' from %2$s because they haven't started it");
LANG_US.put("commands.advancement.revoke.only.success", "Revoked the entire advancement '%1$s' from %2$s");
LANG_US.put("commands.advancement.revoke.criterion.failed", "Couldn't revoke the criterion '%3$s' of advancement '%1$s' from %2$s because they haven't started it");
LANG_US.put("commands.advancement.revoke.criterion.success", "Revoked the criterion '%3$s' of advancement '%1$s' from %2$s");
LANG_US.put("commands.advancement.revoke.until.usage", "/advancement revoke <player> until <advancement>");
LANG_US.put("commands.advancement.revoke.until.failed", "Couldn't revoke the advancement '%1$s' or its ancestors from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.until.success", "Revoked '%1$s' and all ancestors (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.from.usage", "/advancement revoke <player> from <advancement>");
LANG_US.put("commands.advancement.revoke.from.failed", "Couldn't revoke the advancement '%1$s' or its descendants from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.from.success", "Revoked '%1$s' and all descendants (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.through.usage", "/advancement revoke <player> through <advancement>");
LANG_US.put("commands.advancement.revoke.through.failed", "Couldn't revoke the advancement '%1$s', its ancestors or its descendants from %2$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.through.success", "Revoked '%1$s', all ancestors and all descendants (%3$s total revoked) from %2$s");
LANG_US.put("commands.advancement.revoke.everything.usage", "/advancement revoke <player> everything");
LANG_US.put("commands.advancement.revoke.everything.failed", "Couldn't revoke any advancements to %1$s because they haven't started any");
LANG_US.put("commands.advancement.revoke.everything.success", "Revoked every advancement (%2$s total revoked) from %1$s");
LANG_US.put("commands.advancement.test.usage", "/advancement test <player> <advancement> [criterion]");
LANG_US.put("commands.advancement.test.criterion.success", "Player %1$s has completed criterion '%3$s' of advancement '%2$s'");
LANG_US.put("commands.advancement.test.criterion.notDone", "Player %1$s has not completed criterion '%3$s' of advancement '%2$s'");
LANG_US.put("commands.advancement.test.advancement.success", "Player %1$s has completed advancement '%2$s'");
LANG_US.put("commands.advancement.test.advancement.notDone", "Player %1$s has not completed advancement '%2$s'");
LANG_US.put("commands.scoreboard.usage", "/scoreboard <objectives|players|teams> ...");
LANG_US.put("commands.scoreboard.noMultiWildcard", "Only one user wildcard allowed");
LANG_US.put("commands.scoreboard.allMatchesFailed", "All matches failed");
LANG_US.put("commands.scoreboard.teamNotFound", "No team was found by the name '%s'");
LANG_US.put("commands.scoreboard.objectiveNotFound", "No objective was found by the name '%s'");
LANG_US.put("commands.scoreboard.objectiveReadOnly", "The objective '%s' is read-only and cannot be set");
LANG_US.put("commands.scoreboard.objectives.usage", "/scoreboard objectives <list|add|remove|setdisplay> ...");
LANG_US.put("commands.scoreboard.objectives.setdisplay.usage", "/scoreboard objectives setdisplay <slot> [objective]");
LANG_US.put("commands.scoreboard.objectives.setdisplay.invalidSlot", "No such display slot '%s'");
LANG_US.put("commands.scoreboard.objectives.setdisplay.successCleared", "Cleared objective display slot '%s'");
LANG_US.put("commands.scoreboard.objectives.setdisplay.successSet", "Set the display objective in slot '%s' to '%s'");
LANG_US.put("commands.scoreboard.objectives.add.usage", "/scoreboard objectives add <name> <criteriaType> [display name ...]");
LANG_US.put("commands.scoreboard.objectives.add.wrongType", "Invalid objective criteria type '%s'");
LANG_US.put("commands.scoreboard.objectives.add.alreadyExists", "An objective with the name '%s' already exists");
LANG_US.put("commands.scoreboard.objectives.add.tooLong", "The name '%s' is too long for an objective, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.objectives.add.displayTooLong", "The display name '%s' is too long for an objective, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.objectives.add.success", "Added new objective '%s' successfully");
LANG_US.put("commands.scoreboard.objectives.remove.usage", "/scoreboard objectives remove <name>");
LANG_US.put("commands.scoreboard.objectives.remove.success", "Removed objective '%s' successfully");
LANG_US.put("commands.scoreboard.objectives.list.count", "Showing %s objective(s) on scoreboard:");
LANG_US.put("commands.scoreboard.objectives.list.entry", "- %s: displays as '%s' and is type '%s'");
LANG_US.put("commands.scoreboard.objectives.list.empty", "There are no objectives on the scoreboard");
LANG_US.put("commands.scoreboard.players.usage", "/scoreboard players <set|add|remove|reset|list|enable|test|operation|tag> ...");
LANG_US.put("commands.scoreboard.players.name.tooLong", "The name '%s' is too long for a player, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.players.set.success", "Set score of %s for player %s to %s");
LANG_US.put("commands.scoreboard.players.set.tagMismatch", "The dataTag does not match for %s");
LANG_US.put("commands.scoreboard.players.set.tagError", "Could not parse dataTag, reason: %s");
LANG_US.put("commands.scoreboard.players.set.usage", "/scoreboard players set <player> <objective> <score> [dataTag]");
LANG_US.put("commands.scoreboard.players.add.usage", "/scoreboard players add <player> <objective> <count> [dataTag]");
LANG_US.put("commands.scoreboard.players.remove.usage", "/scoreboard players remove <player> <objective> <count> [dataTag]");
LANG_US.put("commands.scoreboard.players.reset.usage", "/scoreboard players reset <player> [objective]");
LANG_US.put("commands.scoreboard.players.reset.success", "Reset scores of player %s");
LANG_US.put("commands.scoreboard.players.resetscore.success", "Reset score %s of player %s");
LANG_US.put("commands.scoreboard.players.list.usage", "/scoreboard players list [name]");
LANG_US.put("commands.scoreboard.players.list.count", "Showing %s tracked players on the scoreboard:");
LANG_US.put("commands.scoreboard.players.list.empty", "There are no tracked players on the scoreboard");
LANG_US.put("commands.scoreboard.players.list.player.count", "Showing %s tracked objective(s) for %s:");
LANG_US.put("commands.scoreboard.players.list.player.entry", "- %2$s: %1$s (%3$s)");
LANG_US.put("commands.scoreboard.players.list.player.empty", "Player %s has no scores recorded");
LANG_US.put("commands.scoreboard.players.enable.usage", "/scoreboard players enable <player> <trigger>");
LANG_US.put("commands.scoreboard.players.enable.success", "Enabled trigger %s for %s");
LANG_US.put("commands.scoreboard.players.enable.noTrigger", "Objective %s is not a trigger");
LANG_US.put("commands.scoreboard.players.test.usage", "/scoreboard players test <player> <objective> <min> [max]");
LANG_US.put("commands.scoreboard.players.test.notFound", "No %s score for %s found");
LANG_US.put("commands.scoreboard.players.test.failed", "Score %s is NOT in range %s to %s");
LANG_US.put("commands.scoreboard.players.test.success", "Score %s is in range %s to %s");
LANG_US.put("commands.scoreboard.players.operation.usage", "/scoreboard players operation <targetName> <targetObjective> <operation> <selector> <objective>");
LANG_US.put("commands.scoreboard.players.operation.notFound", "No %s score for %s found");
LANG_US.put("commands.scoreboard.players.operation.invalidOperation", "Invalid operation %s");
LANG_US.put("commands.scoreboard.players.operation.success", "Operation applied successfully");
LANG_US.put("commands.scoreboard.players.tag.usage", "/scoreboard players tag <player> <add|remove|list> <tagName> [dataTag]");
LANG_US.put("commands.scoreboard.players.tag.tagMismatch", "The dataTag does not match for %s");
LANG_US.put("commands.scoreboard.players.tag.tooMany", "Can't add more than %s tags to an entity");
LANG_US.put("commands.scoreboard.players.tag.notFound", "Entity didn't have the %s tag");
LANG_US.put("commands.scoreboard.players.tag.success.add", "Tag %s added");
LANG_US.put("commands.scoreboard.players.tag.success.remove", "Tag %s removed");
LANG_US.put("commands.scoreboard.players.tag.list", "Tags on entity %s are:");
LANG_US.put("commands.scoreboard.players.tag.tagError", "Players tag command failed, reason: %s");
LANG_US.put("commands.scoreboard.teams.usage", "/scoreboard teams <list|add|remove|empty|join|leave|option> ...");
LANG_US.put("commands.scoreboard.teams.add.usage", "/scoreboard teams add <name> [display name ...]");
LANG_US.put("commands.scoreboard.teams.add.alreadyExists", "A team with the name '%s' already exists");
LANG_US.put("commands.scoreboard.teams.add.tooLong", "The name '%s' is too long for a team, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.teams.add.displayTooLong", "The display name '%s' is too long for a team, it can be at most %s characters long");
LANG_US.put("commands.scoreboard.teams.add.success", "Added new team '%s' successfully");
LANG_US.put("commands.scoreboard.teams.list.usage", "/scoreboard teams list [name]");
LANG_US.put("commands.scoreboard.teams.list.count", "Showing %s teams on the scoreboard:");
LANG_US.put("commands.scoreboard.teams.list.entry", "- %1$s: '%2$s' has %3$s players");
LANG_US.put("commands.scoreboard.teams.list.empty", "There are no teams registered on the scoreboard");
LANG_US.put("commands.scoreboard.teams.list.player.count", "Showing %s player(s) in team %s:");
LANG_US.put("commands.scoreboard.teams.list.player.entry", "- %2$s: %1$s (%3$s)");
LANG_US.put("commands.scoreboard.teams.list.player.empty", "Team %s has no players");
LANG_US.put("commands.scoreboard.teams.empty.usage", "/scoreboard teams empty <team>");
LANG_US.put("commands.scoreboard.teams.empty.alreadyEmpty", "Team %s is already empty, cannot remove nonexistant players");
LANG_US.put("commands.scoreboard.teams.empty.success", "Removed all %s player(s) from team %s");
LANG_US.put("commands.scoreboard.teams.remove.usage", "/scoreboard teams remove <name>");
LANG_US.put("commands.scoreboard.teams.remove.success", "Removed team %s");
LANG_US.put("commands.scoreboard.teams.join.usage", "/scoreboard teams join <team> [player]");
LANG_US.put("commands.scoreboard.teams.join.success", "Added %s player(s) to team %s: %s");
LANG_US.put("commands.scoreboard.teams.join.failure", "Could not add %s player(s) to team %s: %s");
LANG_US.put("commands.scoreboard.teams.leave.usage", "/scoreboard teams leave [player]");
LANG_US.put("commands.scoreboard.teams.leave.success", "Removed %s player(s) from their teams: %s");
LANG_US.put("commands.scoreboard.teams.leave.failure", "Could not remove %s player(s) from their teams: %s");
LANG_US.put("commands.scoreboard.teams.leave.noTeam", "You are not in a team");
LANG_US.put("commands.scoreboard.teams.option.usage", "/scoreboard teams option <team> <friendlyfire|color|seeFriendlyInvisibles|nametagVisibility|deathMessageVisibility|collisionRule> <value>");
LANG_US.put("commands.scoreboard.teams.option.noValue", "Valid values for option %s are: %s");
LANG_US.put("commands.scoreboard.teams.option.success", "Set option %s for team %s to %s");
LANG_US.put("commands.execute.usage", "/execute <entity> <x> <y> <z> <command> OR /execute <entity> <x> <y> <z> detect <x> <y> <z> <block> <dataValue|-1|state|*> <command>");
LANG_US.put("commands.execute.allInvocationsFailed", "All invocations failed: '%s'");
LANG_US.put("commands.execute.failed", "Failed to execute '%s' as %s");
LANG_US.put("commands.gamemode.success.self", "Set own game mode to %s");
LANG_US.put("commands.gamemode.success.other", "Set %s's game mode to %s");
LANG_US.put("commands.gamemode.usage", "/gamemode <mode> [player]");
LANG_US.put("commands.defaultgamemode.usage", "/defaultgamemode <mode>");
LANG_US.put("commands.defaultgamemode.success", "The world's default game mode is now %s");
LANG_US.put("commands.me.usage", "/me <action ...>");
LANG_US.put("commands.help.header", "--- Showing help page %s of %s (/help <page>) ---");
LANG_US.put("commands.help.footer", "Tip: Use the <tab> key while typing a command to auto-complete the command or its arguments");
LANG_US.put("commands.help.usage", "/help [page|command name]");
LANG_US.put("commands.trigger.usage", "/trigger <objective> <add|set> <value>");
LANG_US.put("commands.trigger.invalidObjective", "Invalid trigger name %s");
LANG_US.put("commands.trigger.invalidMode", "Invalid trigger mode %s");
LANG_US.put("commands.trigger.disabled", "Trigger %s is not enabled");
LANG_US.put("commands.trigger.invalidPlayer", "Only players can use the /trigger command");
LANG_US.put("commands.trigger.success", "Trigger %s changed with %s %s");
LANG_US.put("commands.publish.usage", "/publish");
LANG_US.put("commands.publish.started", "Local game hosted on port %s");
LANG_US.put("commands.publish.failed", "Unable to host local game");
LANG_US.put("commands.debug.start", "Started debug profiling");
LANG_US.put("commands.debug.stop", "Stopped debug profiling after %s seconds (%s ticks)");
LANG_US.put("commands.debug.notStarted", "Can't stop profiling when we haven't started yet!");
LANG_US.put("commands.debug.usage", "/debug <start|stop>");
LANG_US.put("commands.chunkinfo.usage", "/chunkinfo [<x> <y> <z>]");
LANG_US.put("commands.chunkinfo.location", "Chunk location: (%s, %s, %s)");
LANG_US.put("commands.chunkinfo.noChunk", "No chunk found at chunk position %s, %s, %s");
LANG_US.put("commands.chunkinfo.notEmpty", "Chunk is not empty.");
LANG_US.put("commands.chunkinfo.empty", "Chunk is empty.");
LANG_US.put("commands.chunkinfo.notCompiled", "Chunk is not compiled.");
LANG_US.put("commands.chunkinfo.compiled", "Chunk is compiled.");
LANG_US.put("commands.chunkinfo.hasNoRenderableLayers", "Chunk has no renderable layers.");
LANG_US.put("commands.chunkinfo.hasLayers", "Chunk has layers: %s");
LANG_US.put("commands.chunkinfo.isEmpty", "Chunk has empty layers: %s");
LANG_US.put("commands.chunkinfo.vertices", "%s layer's buffer contains %s vertices");
LANG_US.put("commands.chunkinfo.data", "First 64 vertices are: %s");
LANG_US.put("commands.tellraw.usage", "/tellraw <player> <raw json message>");
LANG_US.put("commands.tellraw.jsonException", "Invalid json: %s");
LANG_US.put("commands.message.usage", "/tell <player> <private message ...>");
LANG_US.put("commands.message.sameTarget", "You can't send a private message to yourself!");
LANG_US.put("commands.message.display.outgoing", "You whisper to %s: %s");
LANG_US.put("commands.message.display.incoming", "%s whispers to you: %s");
LANG_US.put("commands.difficulty.usage", "/difficulty <new difficulty>");
LANG_US.put("commands.difficulty.success", "Set game difficulty to %s");
LANG_US.put("commands.spawnpoint.usage", "/spawnpoint [player] [<x> <y> <z>]");
LANG_US.put("commands.spawnpoint.success", "Set %s's spawn point to (%s, %s, %s)");
LANG_US.put("commands.setworldspawn.usage", "/setworldspawn [<x> <y> <z>]");
LANG_US.put("commands.setworldspawn.success", "Set the world spawn point to (%s, %s, %s)");
LANG_US.put("commands.gamerule.usage", "/gamerule <rule name> [value]");
LANG_US.put("commands.gamerule.success", "Game rule %s has been updated to %s");
LANG_US.put("commands.gamerule.norule", "No game rule called '%s' is available");
LANG_US.put("commands.gamerule.nopermission", "Only server owners can change '%s'");
LANG_US.put("commands.weather.usage", "/weather <clear|rain|thunder> [duration in seconds]");
LANG_US.put("commands.weather.clear", "Changing to clear weather");
LANG_US.put("commands.weather.rain", "Changing to rainy weather");
LANG_US.put("commands.weather.thunder", "Changing to rain and thunder");
LANG_US.put("commands.testfor.usage", "/testfor <player> [dataTag]");
LANG_US.put("commands.testfor.failure", "%s did not match the required data structure");
LANG_US.put("commands.testfor.success", "Found %s");
LANG_US.put("commands.testfor.tagError", "Data tag parsing failed: %s");
LANG_US.put("commands.seed.usage", "/seed");
LANG_US.put("commands.seed.success", "Seed: %s");
LANG_US.put("commands.spreadplayers.noop", "No players found to spread");
LANG_US.put("commands.spreadplayers.usage", "/spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams true|false> <player ...>");
LANG_US.put("commands.spreadplayers.spreading.teams", "Spreading %s team(s) %s blocks around %s, %s (min %s blocks apart)");
LANG_US.put("commands.spreadplayers.spreading.players", "Spreading %s player(s) %s blocks around %s, %s (min %s blocks apart)");
LANG_US.put("commands.spreadplayers.success.teams", "Successfully spread %s team(s) around %s, %s");
LANG_US.put("commands.spreadplayers.success.players", "Successfully spread %s player(s) around %s, %s");
LANG_US.put("commands.spreadplayers.info.teams", "(Average distance between teams is %s blocks apart after %s iterations)");
LANG_US.put("commands.spreadplayers.info.players", "(Average distance between players is %s blocks apart after %s iterations)");
LANG_US.put("commands.spreadplayers.failure.teams", "Could not spread %s team(s) around %s, %s (too many players for space - try using spread of at most %s)");
LANG_US.put("commands.spreadplayers.failure.players", "Could not spread %s player(s) around %s, %s (too many players for space - try using spread of at most %s)");
LANG_US.put("commands.recipe.usage", "/recipe <give|take> [player] <name|*>");
LANG_US.put("commands.recipe.alreadyHave", "Player %s already has a recipe for %s");
LANG_US.put("commands.recipe.dontHave", "Player %s doesn't have the recipe for %s");
LANG_US.put("commands.recipe.give.success.all", "Successfully given all recipes to %s");
LANG_US.put("commands.recipe.give.success.one", "Successfully given %s the recipe for %s");
LANG_US.put("commands.recipe.take.success.all", "Successfully taken all recipes from %s");
LANG_US.put("commands.recipe.take.success.one", "Successfully removed the recipe for %s from %s");
LANG_US.put("commands.recipe.unknownrecipe", "%s is an unknown recipe");
LANG_US.put("commands.recipe.unsupported", "%s is an unsupported recipe");
LANG_US.put("commands.worldborder.usage", "/worldborder <set|center|damage|warning|get|add> ...");
LANG_US.put("commands.worldborder.add.usage", "/worldborder add <sizeInBlocks> [timeInSeconds]");
LANG_US.put("commands.worldborder.set.usage", "/worldborder set <sizeInBlocks> [timeInSeconds]");
LANG_US.put("commands.worldborder.set.success", "Set world border to %s blocks wide (from %s blocks)");
LANG_US.put("commands.worldborder.get.success", "World border is currently %s blocks wide");
LANG_US.put("commands.worldborder.setSlowly.shrink.success", "Shrinking world border to %s blocks wide (down from %s blocks) over %s seconds");
LANG_US.put("commands.worldborder.setSlowly.grow.success", "Growing world border to %s blocks wide (up from %s blocks) over %s seconds");
LANG_US.put("commands.worldborder.center.usage", "/worldborder center <x> <z>");
LANG_US.put("commands.worldborder.center.success", "Set world border center to %s, %s");
LANG_US.put("commands.worldborder.damage.usage", "/worldborder damage <buffer|amount> ...");
LANG_US.put("commands.worldborder.damage.buffer.usage", "/worldborder damage buffer <sizeInBlocks>");
LANG_US.put("commands.worldborder.damage.buffer.success", "Set world border damage buffer to %s blocks (from %s blocks)");
LANG_US.put("commands.worldborder.damage.amount.usage", "/worldborder damage amount <damagePerBlock>");
LANG_US.put("commands.worldborder.damage.amount.success", "Set world border damage amount to %s per block (from %s per block)");
LANG_US.put("commands.worldborder.warning.usage", "/worldborder warning <time|distance> ...");
LANG_US.put("commands.worldborder.warning.time.usage", "/worldborder warning time <seconds>");
LANG_US.put("commands.worldborder.warning.time.success", "Set world border warning to %s seconds away (from %s seconds)");
LANG_US.put("commands.worldborder.warning.distance.usage", "/worldborder warning distance <distance>");
LANG_US.put("commands.worldborder.warning.distance.success", "Set world border warning to %s blocks away (from %s blocks)");
LANG_US.put("commands.title.usage", "/title <player> title|subtitle|actionbar|clear|reset|times ...");
LANG_US.put("commands.title.usage.title", "/title <player> title|subtitle|actionbar <raw json title>");
LANG_US.put("commands.title.usage.clear", "/title <player> clear|reset");
LANG_US.put("commands.title.usage.times", "/title <player> times <fadeIn> <stay> <fadeOut>");
LANG_US.put("commands.title.success", "Title command successfully executed");
LANG_US.put("commands.stopsound.usage", "/stopsound <player> [source] [sound]");
LANG_US.put("commands.stopsound.unknownSoundSource", "Source %s is unknown");
LANG_US.put("commands.stopsound.success.individualSound", "Stopped sound '%s' with source '%s' for %s");
LANG_US.put("commands.stopsound.success.soundSource", "Stopped source '%s' for %s");
LANG_US.put("commands.stopsound.success.all", "Stopped all sounds for %s");
LANG_US.put("commands.locate.usage", "/locate <feature>");
LANG_US.put("commands.locate.success", "Located %s at %s (y?) %s");
LANG_US.put("commands.locate.failure", "Unable to locate any %s feature");
LANG_US.put("itemGroup.buildingBlocks", "Building Blocks");
LANG_US.put("itemGroup.decorations", "Decoration Blocks");
LANG_US.put("itemGroup.redstone", "Redstone");
LANG_US.put("itemGroup.transportation", "Transportation");
LANG_US.put("itemGroup.misc", "Miscellaneous");
LANG_US.put("itemGroup.search", "Search Items");
LANG_US.put("itemGroup.food", "Foodstuffs");
LANG_US.put("itemGroup.tools", "Tools");
LANG_US.put("itemGroup.combat", "Combat");
LANG_US.put("itemGroup.brewing", "Brewing");
LANG_US.put("itemGroup.materials", "Materials");
LANG_US.put("itemGroup.inventory", "Survival Inventory");
LANG_US.put("itemGroup.hotbar", "Saved Toolbars");
LANG_US.put("inventory.binSlot", "Destroy Item");
LANG_US.put("inventory.hotbarSaved", "Item toolbar saved (restore with %1$s+%2$s)");
LANG_US.put("inventory.hotbarInfo", "Save toolbar with %1$s+%2$s");
LANG_US.put("advMode.setCommand", "Set Console Command for Block");
LANG_US.put("advMode.setCommand.success", "Command set: %s");
LANG_US.put("advMode.command", "Console Command");
LANG_US.put("advMode.nearestPlayer", "Use \"@p\" to target nearest player");
LANG_US.put("advMode.randomPlayer", "Use \"@r\" to target random player");
LANG_US.put("advMode.allPlayers", "Use \"@a\" to target all players");
LANG_US.put("advMode.allEntities", "Use \"@e\" to target all entities");
LANG_US.put("advMode.self", "Use \"@s\" to target the executing entity");
LANG_US.put("advMode.previousOutput", "Previous Output");
LANG_US.put("advMode.mode.sequence", "Chain");
LANG_US.put("advMode.mode.auto", "Repeat");
LANG_US.put("advMode.mode.redstone", "Impulse");
LANG_US.put("advMode.mode.conditional", "Conditional");
LANG_US.put("advMode.mode.unconditional", "Unconditional");
LANG_US.put("advMode.mode.redstoneTriggered", "Needs Redstone");
LANG_US.put("advMode.mode.autoexec.bat", "Always Active");
LANG_US.put("advMode.notEnabled", "Command blocks are not enabled on this server");
LANG_US.put("advMode.notAllowed", "Must be an opped player in creative mode");
LANG_US.put("mount.onboard", "Press %1$s to dismount");
LANG_US.put("build.tooHigh", "Height limit for building is %s blocks");
LANG_US.put("item.modifiers.mainhand", "When in main hand:");
LANG_US.put("item.modifiers.offhand", "When in off hand:");
LANG_US.put("item.modifiers.feet", "When on feet:");
LANG_US.put("item.modifiers.legs", "When on legs:");
LANG_US.put("item.modifiers.chest", "When on body:");
LANG_US.put("item.modifiers.head", "When on head:");
LANG_US.put("attribute.modifier.plus.0", "+%s %s");
LANG_US.put("attribute.modifier.plus.1", "+%s%% %s");
LANG_US.put("attribute.modifier.plus.2", "+%s%% %s");
LANG_US.put("attribute.modifier.take.0", "-%s %s");
LANG_US.put("attribute.modifier.take.1", "-%s%% %s");
LANG_US.put("attribute.modifier.take.2", "-%s%% %s");
LANG_US.put("attribute.modifier.equals.0", "%s %s");
LANG_US.put("attribute.modifier.equals.1", "%s%% %s");
LANG_US.put("attribute.modifier.equals.2", "%s%% %s");
LANG_US.put("attribute.name.horse.jumpStrength", "Horse Jump Strength");
LANG_US.put("attribute.name.zombie.spawnReinforcements", "Zombie Reinforcements");
LANG_US.put("attribute.name.generic.maxHealth", "Max Health");
LANG_US.put("attribute.name.generic.followRange", "Mob Follow Range");
LANG_US.put("attribute.name.generic.knockbackResistance", "Knockback Resistance");
LANG_US.put("attribute.name.generic.movementSpeed", "Speed");
LANG_US.put("attribute.name.generic.attackDamage", "Attack Damage");
LANG_US.put("attribute.name.generic.attackSpeed", "Attack Speed");
LANG_US.put("attribute.name.generic.luck", "Luck");
LANG_US.put("attribute.name.generic.armor", "Armor");
LANG_US.put("attribute.name.generic.armorToughness", "Armor Toughness");
LANG_US.put("screenshot.success", "Saved screenshot as %s");
LANG_US.put("screenshot.failure", "Couldn't save screenshot: %s");
LANG_US.put("item.banner.black.name", "Black Banner");
LANG_US.put("item.banner.red.name", "Red Banner");
LANG_US.put("item.banner.green.name", "Green Banner");
LANG_US.put("item.banner.brown.name", "Brown Banner");
LANG_US.put("item.banner.blue.name", "Blue Banner");
LANG_US.put("item.banner.purple.name", "Purple Banner");
LANG_US.put("item.banner.cyan.name", "Cyan Banner");
LANG_US.put("item.banner.silver.name", "Light Gray Banner");
LANG_US.put("item.banner.gray.name", "Gray Banner");
LANG_US.put("item.banner.pink.name", "Pink Banner");
LANG_US.put("item.banner.lime.name", "Lime Banner");
LANG_US.put("item.banner.yellow.name", "Yellow Banner");
LANG_US.put("item.banner.lightBlue.name", "Light Blue Banner");
LANG_US.put("item.banner.magenta.name", "Magenta Banner");
LANG_US.put("item.banner.orange.name", "Orange Banner");
LANG_US.put("item.banner.white.name", "White Banner");
LANG_US.put("item.shield.name", "Shield");
LANG_US.put("item.shield.black.name", "Black Shield");
LANG_US.put("item.shield.red.name", "Red Shield");
LANG_US.put("item.shield.green.name", "Green Shield");
LANG_US.put("item.shield.brown.name", "Brown Shield");
LANG_US.put("item.shield.blue.name", "Blue Shield");
LANG_US.put("item.shield.purple.name", "Purple Shield");
LANG_US.put("item.shield.cyan.name", "Cyan Shield");
LANG_US.put("item.shield.silver.name", "Light Gray Shield");
LANG_US.put("item.shield.gray.name", "Gray Shield");
LANG_US.put("item.shield.pink.name", "Pink Shield");
LANG_US.put("item.shield.lime.name", "Lime Shield");
LANG_US.put("item.shield.yellow.name", "Yellow Shield");
LANG_US.put("item.shield.lightBlue.name", "Light Blue Shield");
LANG_US.put("item.shield.magenta.name", "Magenta Shield");
LANG_US.put("item.shield.orange.name", "Orange Shield");
LANG_US.put("item.shield.white.name", "White Shield");
LANG_US.put("item.banner.square_bottom_left.black", "Black Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.red", "Red Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.green", "Green Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.brown", "Brown Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.blue", "Blue Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.purple", "Purple Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.cyan", "Cyan Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.silver", "Light Gray Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.gray", "Gray Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.pink", "Pink Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.lime", "Lime Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.yellow", "Yellow Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.lightBlue", "Light Blue Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.magenta", "Magenta Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.orange", "Orange Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_left.white", "White Base Dexter Canton");
LANG_US.put("item.banner.square_bottom_right.black", "Black Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.red", "Red Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.green", "Green Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.brown", "Brown Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.blue", "Blue Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.purple", "Purple Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.cyan", "Cyan Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.silver", "Light Gray Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.gray", "Gray Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.pink", "Pink Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.lime", "Lime Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.yellow", "Yellow Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.lightBlue", "Light Blue Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.magenta", "Magenta Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.orange", "Orange Base Sinister Canton");
LANG_US.put("item.banner.square_bottom_right.white", "White Base Sinister Canton");
LANG_US.put("item.banner.square_top_left.black", "Black Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.red", "Red Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.green", "Green Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.brown", "Brown Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.blue", "Blue Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.purple", "Purple Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.cyan", "Cyan Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.silver", "Light Gray Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.gray", "Gray Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.pink", "Pink Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.lime", "Lime Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.yellow", "Yellow Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.lightBlue", "Light Blue Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.magenta", "Magenta Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.orange", "Orange Chief Dexter Canton");
LANG_US.put("item.banner.square_top_left.white", "White Chief Dexter Canton");
LANG_US.put("item.banner.square_top_right.black", "Black Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.red", "Red Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.green", "Green Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.brown", "Brown Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.blue", "Blue Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.purple", "Purple Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.cyan", "Cyan Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.silver", "Light Gray Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.gray", "Gray Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.pink", "Pink Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.lime", "Lime Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.yellow", "Yellow Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.lightBlue", "Light Blue Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.magenta", "Magenta Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.orange", "Orange Chief Sinister Canton");
LANG_US.put("item.banner.square_top_right.white", "White Chief Sinister Canton");
LANG_US.put("item.banner.stripe_bottom.black", "Black Base");
LANG_US.put("item.banner.stripe_bottom.red", "Red Base");
LANG_US.put("item.banner.stripe_bottom.green", "Green Base");
LANG_US.put("item.banner.stripe_bottom.brown", "Brown Base");
LANG_US.put("item.banner.stripe_bottom.blue", "Blue Base");
LANG_US.put("item.banner.stripe_bottom.purple", "Purple Base");
LANG_US.put("item.banner.stripe_bottom.cyan", "Cyan Base");
LANG_US.put("item.banner.stripe_bottom.silver", "Light Gray Base");
LANG_US.put("item.banner.stripe_bottom.gray", "Gray Base");
LANG_US.put("item.banner.stripe_bottom.pink", "Pink Base");
LANG_US.put("item.banner.stripe_bottom.lime", "Lime Base");
LANG_US.put("item.banner.stripe_bottom.yellow", "Yellow Base");
LANG_US.put("item.banner.stripe_bottom.lightBlue", "Light Blue Base");
LANG_US.put("item.banner.stripe_bottom.magenta", "Magenta Base");
LANG_US.put("item.banner.stripe_bottom.orange", "Orange Base");
LANG_US.put("item.banner.stripe_bottom.white", "White Base");
LANG_US.put("item.banner.stripe_top.black", "Black Chief");
LANG_US.put("item.banner.stripe_top.red", "Red Chief");
LANG_US.put("item.banner.stripe_top.green", "Green Chief");
LANG_US.put("item.banner.stripe_top.brown", "Brown Chief");
LANG_US.put("item.banner.stripe_top.blue", "Blue Chief");
LANG_US.put("item.banner.stripe_top.purple", "Purple Chief");
LANG_US.put("item.banner.stripe_top.cyan", "Cyan Chief");
LANG_US.put("item.banner.stripe_top.silver", "Light Gray Chief");
LANG_US.put("item.banner.stripe_top.gray", "Gray Chief");
LANG_US.put("item.banner.stripe_top.pink", "Pink Chief");
LANG_US.put("item.banner.stripe_top.lime", "Lime Chief");
LANG_US.put("item.banner.stripe_top.yellow", "Yellow Chief");
LANG_US.put("item.banner.stripe_top.lightBlue", "Light Blue Chief");
LANG_US.put("item.banner.stripe_top.magenta", "Magenta Chief");
LANG_US.put("item.banner.stripe_top.orange", "Orange Chief");
LANG_US.put("item.banner.stripe_top.white", "White Chief");
LANG_US.put("item.banner.stripe_left.black", "Black Pale Dexter");
LANG_US.put("item.banner.stripe_left.red", "Red Pale Dexter");
LANG_US.put("item.banner.stripe_left.green", "Green Pale Dexter");
LANG_US.put("item.banner.stripe_left.brown", "Brown Pale Dexter");
LANG_US.put("item.banner.stripe_left.blue", "Blue Pale Dexter");
LANG_US.put("item.banner.stripe_left.purple", "Purple Pale Dexter");
LANG_US.put("item.banner.stripe_left.cyan", "Cyan Pale Dexter");
LANG_US.put("item.banner.stripe_left.silver", "Light Gray Pale Dexter");
LANG_US.put("item.banner.stripe_left.gray", "Gray Pale Dexter");
LANG_US.put("item.banner.stripe_left.pink", "Pink Pale Dexter");
LANG_US.put("item.banner.stripe_left.lime", "Lime Pale Dexter");
LANG_US.put("item.banner.stripe_left.yellow", "Yellow Pale Dexter");
LANG_US.put("item.banner.stripe_left.lightBlue", "Light Blue Pale Dexter");
LANG_US.put("item.banner.stripe_left.magenta", "Magenta Pale Dexter");
LANG_US.put("item.banner.stripe_left.orange", "Orange Pale Dexter");
LANG_US.put("item.banner.stripe_left.white", "White Pale Dexter");
LANG_US.put("item.banner.stripe_right.black", "Black Pale Sinister");
LANG_US.put("item.banner.stripe_right.red", "Red Pale Sinister");
LANG_US.put("item.banner.stripe_right.green", "Green Pale Sinister");
LANG_US.put("item.banner.stripe_right.brown", "Brown Pale Sinister");
LANG_US.put("item.banner.stripe_right.blue", "Blue Pale Sinister");
LANG_US.put("item.banner.stripe_right.purple", "Purple Pale Sinister");
LANG_US.put("item.banner.stripe_right.cyan", "Cyan Pale Sinister");
LANG_US.put("item.banner.stripe_right.silver", "Light Gray Pale Sinister");
LANG_US.put("item.banner.stripe_right.gray", "Gray Pale Sinister");
LANG_US.put("item.banner.stripe_right.pink", "Pink Pale Sinister");
LANG_US.put("item.banner.stripe_right.lime", "Lime Pale Sinister");
LANG_US.put("item.banner.stripe_right.yellow", "Yellow Pale Sinister");
LANG_US.put("item.banner.stripe_right.lightBlue", "Light Blue Pale Sinister");
LANG_US.put("item.banner.stripe_right.magenta", "Magenta Pale Sinister");
LANG_US.put("item.banner.stripe_right.orange", "Orange Pale Sinister");
LANG_US.put("item.banner.stripe_right.white", "White Pale Sinister");
LANG_US.put("item.banner.stripe_center.black", "Black Pale");
LANG_US.put("item.banner.stripe_center.red", "Red Pale");
LANG_US.put("item.banner.stripe_center.green", "Green Pale");
LANG_US.put("item.banner.stripe_center.brown", "Brown Pale");
LANG_US.put("item.banner.stripe_center.blue", "Blue Pale");
LANG_US.put("item.banner.stripe_center.purple", "Purple Pale");
LANG_US.put("item.banner.stripe_center.cyan", "Cyan Pale");
LANG_US.put("item.banner.stripe_center.silver", "Light Gray Pale");
LANG_US.put("item.banner.stripe_center.gray", "Gray Pale");
LANG_US.put("item.banner.stripe_center.pink", "Pink Pale");
LANG_US.put("item.banner.stripe_center.lime", "Lime Pale");
LANG_US.put("item.banner.stripe_center.yellow", "Yellow Pale");
LANG_US.put("item.banner.stripe_center.lightBlue", "Light Blue Pale");
LANG_US.put("item.banner.stripe_center.magenta", "Magenta Pale");
LANG_US.put("item.banner.stripe_center.orange", "Orange Pale");
LANG_US.put("item.banner.stripe_center.white", "White Pale");
LANG_US.put("item.banner.stripe_middle.black", "Black Fess");
LANG_US.put("item.banner.stripe_middle.red", "Red Fess");
LANG_US.put("item.banner.stripe_middle.green", "Green Fess");
LANG_US.put("item.banner.stripe_middle.brown", "Brown Fess");
LANG_US.put("item.banner.stripe_middle.blue", "Blue Fess");
LANG_US.put("item.banner.stripe_middle.purple", "Purple Fess");
LANG_US.put("item.banner.stripe_middle.cyan", "Cyan Fess");
LANG_US.put("item.banner.stripe_middle.silver", "Light Gray Fess");
LANG_US.put("item.banner.stripe_middle.gray", "Gray Fess");
LANG_US.put("item.banner.stripe_middle.pink", "Pink Fess");
LANG_US.put("item.banner.stripe_middle.lime", "Lime Fess");
LANG_US.put("item.banner.stripe_middle.yellow", "Yellow Fess");
LANG_US.put("item.banner.stripe_middle.lightBlue", "Light Blue Fess");
LANG_US.put("item.banner.stripe_middle.magenta", "Magenta Fess");
LANG_US.put("item.banner.stripe_middle.orange", "Orange Fess");
LANG_US.put("item.banner.stripe_middle.white", "White Fess");
LANG_US.put("item.banner.stripe_downright.black", "Black Bend");
LANG_US.put("item.banner.stripe_downright.red", "Red Bend");
LANG_US.put("item.banner.stripe_downright.green", "Green Bend");
LANG_US.put("item.banner.stripe_downright.brown", "Brown Bend");
LANG_US.put("item.banner.stripe_downright.blue", "Blue Bend");
LANG_US.put("item.banner.stripe_downright.purple", "Purple Bend");
LANG_US.put("item.banner.stripe_downright.cyan", "Cyan Bend");
LANG_US.put("item.banner.stripe_downright.silver", "Light Gray Bend");
LANG_US.put("item.banner.stripe_downright.gray", "Gray Bend");
LANG_US.put("item.banner.stripe_downright.pink", "Pink Bend");
LANG_US.put("item.banner.stripe_downright.lime", "Lime Bend");
LANG_US.put("item.banner.stripe_downright.yellow", "Yellow Bend");
LANG_US.put("item.banner.stripe_downright.lightBlue", "Light Blue Bend");
LANG_US.put("item.banner.stripe_downright.magenta", "Magenta Bend");
LANG_US.put("item.banner.stripe_downright.orange", "Orange Bend");
LANG_US.put("item.banner.stripe_downright.white", "White Bend");
LANG_US.put("item.banner.stripe_downleft.black", "Black Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.red", "Red Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.green", "Green Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.brown", "Brown Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.blue", "Blue Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.purple", "Purple Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.cyan", "Cyan Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.silver", "Light Gray Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.gray", "Gray Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.pink", "Pink Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.lime", "Lime Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.yellow", "Yellow Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.lightBlue", "Light Blue Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.magenta", "Magenta Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.orange", "Orange Bend Sinister");
LANG_US.put("item.banner.stripe_downleft.white", "White Bend Sinister");
LANG_US.put("item.banner.small_stripes.black", "Black Paly");
LANG_US.put("item.banner.small_stripes.red", "Red Paly");
LANG_US.put("item.banner.small_stripes.green", "Green Paly");
LANG_US.put("item.banner.small_stripes.brown", "Brown Paly");
LANG_US.put("item.banner.small_stripes.blue", "Blue Paly");
LANG_US.put("item.banner.small_stripes.purple", "Purple Paly");
LANG_US.put("item.banner.small_stripes.cyan", "Cyan Paly");
LANG_US.put("item.banner.small_stripes.silver", "Light Gray Paly");
LANG_US.put("item.banner.small_stripes.gray", "Gray Paly");
LANG_US.put("item.banner.small_stripes.pink", "Pink Paly");
LANG_US.put("item.banner.small_stripes.lime", "Lime Paly");
LANG_US.put("item.banner.small_stripes.yellow", "Yellow Paly");
LANG_US.put("item.banner.small_stripes.lightBlue", "Light Blue Paly");
LANG_US.put("item.banner.small_stripes.magenta", "Magenta Paly");
LANG_US.put("item.banner.small_stripes.orange", "Orange Paly");
LANG_US.put("item.banner.small_stripes.white", "White Paly");
LANG_US.put("item.banner.cross.black", "Black Saltire");
LANG_US.put("item.banner.cross.red", "Red Saltire");
LANG_US.put("item.banner.cross.green", "Green Saltire");
LANG_US.put("item.banner.cross.brown", "Brown Saltire");
LANG_US.put("item.banner.cross.blue", "Blue Saltire");
LANG_US.put("item.banner.cross.purple", "Purple Saltire");
LANG_US.put("item.banner.cross.cyan", "Cyan Saltire");
LANG_US.put("item.banner.cross.silver", "Light Gray Saltire");
LANG_US.put("item.banner.cross.gray", "Gray Saltire");
LANG_US.put("item.banner.cross.pink", "Pink Saltire");
LANG_US.put("item.banner.cross.lime", "Lime Saltire");
LANG_US.put("item.banner.cross.yellow", "Yellow Saltire");
LANG_US.put("item.banner.cross.lightBlue", "Light Blue Saltire");
LANG_US.put("item.banner.cross.magenta", "Magenta Saltire");
LANG_US.put("item.banner.cross.orange", "Orange Saltire");
LANG_US.put("item.banner.cross.white", "White Saltire");
LANG_US.put("item.banner.triangle_bottom.black", "Black Chevron");
LANG_US.put("item.banner.triangle_bottom.red", "Red Chevron");
LANG_US.put("item.banner.triangle_bottom.green", "Green Chevron");
LANG_US.put("item.banner.triangle_bottom.brown", "Brown Chevron");
LANG_US.put("item.banner.triangle_bottom.blue", "Blue Chevron");
LANG_US.put("item.banner.triangle_bottom.purple", "Purple Chevron");
LANG_US.put("item.banner.triangle_bottom.cyan", "Cyan Chevron");
LANG_US.put("item.banner.triangle_bottom.silver", "Light Gray Chevron");
LANG_US.put("item.banner.triangle_bottom.gray", "Gray Chevron");
LANG_US.put("item.banner.triangle_bottom.pink", "Pink Chevron");
LANG_US.put("item.banner.triangle_bottom.lime", "Lime Chevron");
LANG_US.put("item.banner.triangle_bottom.yellow", "Yellow Chevron");
LANG_US.put("item.banner.triangle_bottom.lightBlue", "Light Blue Chevron");
LANG_US.put("item.banner.triangle_bottom.magenta", "Magenta Chevron");
LANG_US.put("item.banner.triangle_bottom.orange", "Orange Chevron");
LANG_US.put("item.banner.triangle_bottom.white", "White Chevron");
LANG_US.put("item.banner.triangle_top.black", "Black Inverted Chevron");
LANG_US.put("item.banner.triangle_top.red", "Red Inverted Chevron");
LANG_US.put("item.banner.triangle_top.green", "Green Inverted Chevron");
LANG_US.put("item.banner.triangle_top.brown", "Brown Inverted Chevron");
LANG_US.put("item.banner.triangle_top.blue", "Blue Inverted Chevron");
LANG_US.put("item.banner.triangle_top.purple", "Purple Inverted Chevron");
LANG_US.put("item.banner.triangle_top.cyan", "Cyan Inverted Chevron");
LANG_US.put("item.banner.triangle_top.silver", "Light Gray Inverted Chevron");
LANG_US.put("item.banner.triangle_top.gray", "Gray Inverted Chevron");
LANG_US.put("item.banner.triangle_top.pink", "Pink Inverted Chevron");
LANG_US.put("item.banner.triangle_top.lime", "Lime Inverted Chevron");
LANG_US.put("item.banner.triangle_top.yellow", "Yellow Inverted Chevron");
LANG_US.put("item.banner.triangle_top.lightBlue", "Light Blue Inverted Chevron");
LANG_US.put("item.banner.triangle_top.magenta", "Magenta Inverted Chevron");
LANG_US.put("item.banner.triangle_top.orange", "Orange Inverted Chevron");
LANG_US.put("item.banner.triangle_top.white", "White Inverted Chevron");
LANG_US.put("item.banner.triangles_bottom.black", "Black Base Indented");
LANG_US.put("item.banner.triangles_bottom.red", "Red Base Indented");
LANG_US.put("item.banner.triangles_bottom.green", "Green Base Indented");
LANG_US.put("item.banner.triangles_bottom.brown", "Brown Base Indented");
LANG_US.put("item.banner.triangles_bottom.blue", "Blue Base Indented");
LANG_US.put("item.banner.triangles_bottom.purple", "Purple Base Indented");
LANG_US.put("item.banner.triangles_bottom.cyan", "Cyan Base Indented");
LANG_US.put("item.banner.triangles_bottom.silver", "Light Gray Base Indented");
LANG_US.put("item.banner.triangles_bottom.gray", "Gray Base Indented");
LANG_US.put("item.banner.triangles_bottom.pink", "Pink Base Indented");
LANG_US.put("item.banner.triangles_bottom.lime", "Lime Base Indented");
LANG_US.put("item.banner.triangles_bottom.yellow", "Yellow Base Indented");
LANG_US.put("item.banner.triangles_bottom.lightBlue", "Light Blue Base Indented");
LANG_US.put("item.banner.triangles_bottom.magenta", "Magenta Base Indented");
LANG_US.put("item.banner.triangles_bottom.orange", "Orange Base Indented");
LANG_US.put("item.banner.triangles_bottom.white", "White Base Indented");
LANG_US.put("item.banner.triangles_top.black", "Black Chief Indented");
LANG_US.put("item.banner.triangles_top.red", "Red Chief Indented");
LANG_US.put("item.banner.triangles_top.green", "Green Chief Indented");
LANG_US.put("item.banner.triangles_top.brown", "Brown Chief Indented");
LANG_US.put("item.banner.triangles_top.blue", "Blue Chief Indented");
LANG_US.put("item.banner.triangles_top.purple", "Purple Chief Indented");
LANG_US.put("item.banner.triangles_top.cyan", "Cyan Chief Indented");
LANG_US.put("item.banner.triangles_top.silver", "Light Gray Chief Indented");
LANG_US.put("item.banner.triangles_top.gray", "Gray Chief Indented");
LANG_US.put("item.banner.triangles_top.pink", "Pink Chief Indented");
LANG_US.put("item.banner.triangles_top.lime", "Lime Chief Indented");
LANG_US.put("item.banner.triangles_top.yellow", "Yellow Chief Indented");
LANG_US.put("item.banner.triangles_top.lightBlue", "Light Blue Chief Indented");
LANG_US.put("item.banner.triangles_top.magenta", "Magenta Chief Indented");
LANG_US.put("item.banner.triangles_top.orange", "Orange Chief Indented");
LANG_US.put("item.banner.triangles_top.white", "White Chief Indented");
LANG_US.put("item.banner.diagonal_left.black", "Black Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.red", "Red Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.green", "Green Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.brown", "Brown Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.blue", "Blue Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.purple", "Purple Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.cyan", "Cyan Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.silver", "Light Gray Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.gray", "Gray Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.pink", "Pink Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.lime", "Lime Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.yellow", "Yellow Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.lightBlue", "Light Blue Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.magenta", "Magenta Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.orange", "Orange Per Bend Sinister");
LANG_US.put("item.banner.diagonal_left.white", "White Per Bend Sinister");
LANG_US.put("item.banner.diagonal_right.black", "Black Per Bend");
LANG_US.put("item.banner.diagonal_right.red", "Red Per Bend");
LANG_US.put("item.banner.diagonal_right.green", "Green Per Bend");
LANG_US.put("item.banner.diagonal_right.brown", "Brown Per Bend");
LANG_US.put("item.banner.diagonal_right.blue", "Blue Per Bend");
LANG_US.put("item.banner.diagonal_right.purple", "Purple Per Bend");
LANG_US.put("item.banner.diagonal_right.cyan", "Cyan Per Bend");
LANG_US.put("item.banner.diagonal_right.silver", "Light Gray Per Bend");
LANG_US.put("item.banner.diagonal_right.gray", "Gray Per Bend");
LANG_US.put("item.banner.diagonal_right.pink", "Pink Per Bend");
LANG_US.put("item.banner.diagonal_right.lime", "Lime Per Bend");
LANG_US.put("item.banner.diagonal_right.yellow", "Yellow Per Bend");
LANG_US.put("item.banner.diagonal_right.lightBlue", "Light Blue Per Bend");
LANG_US.put("item.banner.diagonal_right.magenta", "Magenta Per Bend");
LANG_US.put("item.banner.diagonal_right.orange", "Orange Per Bend");
LANG_US.put("item.banner.diagonal_right.white", "White Per Bend");
LANG_US.put("item.banner.diagonal_up_left.black", "Black Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.red", "Red Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.green", "Green Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.brown", "Brown Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.blue", "Blue Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.purple", "Purple Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.cyan", "Cyan Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.silver", "Light Gray Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.gray", "Gray Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.pink", "Pink Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.lime", "Lime Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.yellow", "Yellow Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.lightBlue", "Light Blue Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.magenta", "Magenta Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.orange", "Orange Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_left.white", "White Per Bend Inverted");
LANG_US.put("item.banner.diagonal_up_right.black", "Black Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.red", "Red Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.green", "Green Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.brown", "Brown Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.blue", "Blue Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.purple", "Purple Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.cyan", "Cyan Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.silver", "Light Gray Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.gray", "Gray Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.pink", "Pink Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.lime", "Lime Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.yellow", "Yellow Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.lightBlue", "Light Blue Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.magenta", "Magenta Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.orange", "Orange Per Bend Sinister Inverted");
LANG_US.put("item.banner.diagonal_up_right.white", "White Per Bend Sinister Inverted");
LANG_US.put("item.banner.circle.black", "Black Roundel");
LANG_US.put("item.banner.circle.red", "Red Roundel");
LANG_US.put("item.banner.circle.green", "Green Roundel");
LANG_US.put("item.banner.circle.brown", "Brown Roundel");
LANG_US.put("item.banner.circle.blue", "Blue Roundel");
LANG_US.put("item.banner.circle.purple", "Purple Roundel");
LANG_US.put("item.banner.circle.cyan", "Cyan Roundel");
LANG_US.put("item.banner.circle.silver", "Light Gray Roundel");
LANG_US.put("item.banner.circle.gray", "Gray Roundel");
LANG_US.put("item.banner.circle.pink", "Pink Roundel");
LANG_US.put("item.banner.circle.lime", "Lime Roundel");
LANG_US.put("item.banner.circle.yellow", "Yellow Roundel");
LANG_US.put("item.banner.circle.lightBlue", "Light Blue Roundel");
LANG_US.put("item.banner.circle.magenta", "Magenta Roundel");
LANG_US.put("item.banner.circle.orange", "Orange Roundel");
LANG_US.put("item.banner.circle.white", "White Roundel");
LANG_US.put("item.banner.rhombus.black", "Black Lozenge");
LANG_US.put("item.banner.rhombus.red", "Red Lozenge");
LANG_US.put("item.banner.rhombus.green", "Green Lozenge");
LANG_US.put("item.banner.rhombus.brown", "Brown Lozenge");
LANG_US.put("item.banner.rhombus.blue", "Blue Lozenge");
LANG_US.put("item.banner.rhombus.purple", "Purple Lozenge");
LANG_US.put("item.banner.rhombus.cyan", "Cyan Lozenge");
LANG_US.put("item.banner.rhombus.silver", "Light Gray Lozenge");
LANG_US.put("item.banner.rhombus.gray", "Gray Lozenge");
LANG_US.put("item.banner.rhombus.pink", "Pink Lozenge");
LANG_US.put("item.banner.rhombus.lime", "Lime Lozenge");
LANG_US.put("item.banner.rhombus.yellow", "Yellow Lozenge");
LANG_US.put("item.banner.rhombus.lightBlue", "Light Blue Lozenge");
LANG_US.put("item.banner.rhombus.magenta", "Magenta Lozenge");
LANG_US.put("item.banner.rhombus.orange", "Orange Lozenge");
LANG_US.put("item.banner.rhombus.white", "White Lozenge");
LANG_US.put("item.banner.half_vertical.black", "Black Per Pale");
LANG_US.put("item.banner.half_vertical.red", "Red Per Pale");
LANG_US.put("item.banner.half_vertical.green", "Green Per Pale");
LANG_US.put("item.banner.half_vertical.brown", "Brown Per Pale");
LANG_US.put("item.banner.half_vertical.blue", "Blue Per Pale");
LANG_US.put("item.banner.half_vertical.purple", "Purple Per Pale");
LANG_US.put("item.banner.half_vertical.cyan", "Cyan Per Pale");
LANG_US.put("item.banner.half_vertical.silver", "Light Gray Per Pale");
LANG_US.put("item.banner.half_vertical.gray", "Gray Per Pale");
LANG_US.put("item.banner.half_vertical.pink", "Pink Per Pale");
LANG_US.put("item.banner.half_vertical.lime", "Lime Per Pale");
LANG_US.put("item.banner.half_vertical.yellow", "Yellow Per Pale");
LANG_US.put("item.banner.half_vertical.lightBlue", "Light Blue Per Pale");
LANG_US.put("item.banner.half_vertical.magenta", "Magenta Per Pale");
LANG_US.put("item.banner.half_vertical.orange", "Orange Per Pale");
LANG_US.put("item.banner.half_vertical.white", "White Per Pale");
LANG_US.put("item.banner.half_horizontal.black", "Black Per Fess");
LANG_US.put("item.banner.half_horizontal.red", "Red Per Fess");
LANG_US.put("item.banner.half_horizontal.green", "Green Per Fess");
LANG_US.put("item.banner.half_horizontal.brown", "Brown Per Fess");
LANG_US.put("item.banner.half_horizontal.blue", "Blue Per Fess");
LANG_US.put("item.banner.half_horizontal.purple", "Purple Per Fess");
LANG_US.put("item.banner.half_horizontal.cyan", "Cyan Per Fess");
LANG_US.put("item.banner.half_horizontal.silver", "Light Gray Per Fess");
LANG_US.put("item.banner.half_horizontal.gray", "Gray Per Fess");
LANG_US.put("item.banner.half_horizontal.pink", "Pink Per Fess");
LANG_US.put("item.banner.half_horizontal.lime", "Lime Per Fess");
LANG_US.put("item.banner.half_horizontal.yellow", "Yellow Per Fess");
LANG_US.put("item.banner.half_horizontal.lightBlue", "Light Blue Per Fess");
LANG_US.put("item.banner.half_horizontal.magenta", "Magenta Per Fess");
LANG_US.put("item.banner.half_horizontal.orange", "Orange Per Fess");
LANG_US.put("item.banner.half_horizontal.white", "White Per Fess");
LANG_US.put("item.banner.half_vertical_right.black", "Black Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.red", "Red Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.green", "Green Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.brown", "Brown Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.blue", "Blue Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.purple", "Purple Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.cyan", "Cyan Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.silver", "Light Gray Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.gray", "Gray Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.pink", "Pink Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.lime", "Lime Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.yellow", "Yellow Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.lightBlue", "Light Blue Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.magenta", "Magenta Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.orange", "Orange Per Pale Inverted");
LANG_US.put("item.banner.half_vertical_right.white", "White Per Pale Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.black", "Black Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.red", "Red Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.green", "Green Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.brown", "Brown Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.blue", "Blue Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.purple", "Purple Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.cyan", "Cyan Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.silver", "Light Gray Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.gray", "Gray Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.pink", "Pink Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.lime", "Lime Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.yellow", "Yellow Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.lightBlue", "Light Blue Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.magenta", "Magenta Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.orange", "Orange Per Fess Inverted");
LANG_US.put("item.banner.half_horizontal_bottom.white", "White Per Fess Inverted");
LANG_US.put("item.banner.creeper.black", "Black Creeper Charge");
LANG_US.put("item.banner.creeper.red", "Red Creeper Charge");
LANG_US.put("item.banner.creeper.green", "Green Creeper Charge");
LANG_US.put("item.banner.creeper.brown", "Brown Creeper Charge");
LANG_US.put("item.banner.creeper.blue", "Blue Creeper Charge");
LANG_US.put("item.banner.creeper.purple", "Purple Creeper Charge");
LANG_US.put("item.banner.creeper.cyan", "Cyan Creeper Charge");
LANG_US.put("item.banner.creeper.silver", "Light Gray Creeper Charge");
LANG_US.put("item.banner.creeper.gray", "Gray Creeper Charge");
LANG_US.put("item.banner.creeper.pink", "Pink Creeper Charge");
LANG_US.put("item.banner.creeper.lime", "Lime Creeper Charge");
LANG_US.put("item.banner.creeper.yellow", "Yellow Creeper Charge");
LANG_US.put("item.banner.creeper.lightBlue", "Light Blue Creeper Charge");
LANG_US.put("item.banner.creeper.magenta", "Magenta Creeper Charge");
LANG_US.put("item.banner.creeper.orange", "Orange Creeper Charge");
LANG_US.put("item.banner.creeper.white", "White Creeper Charge");
LANG_US.put("item.banner.bricks.black", "Black Field Masoned");
LANG_US.put("item.banner.bricks.red", "Red Field Masoned");
LANG_US.put("item.banner.bricks.green", "Green Field Masoned");
LANG_US.put("item.banner.bricks.brown", "Brown Field Masoned");
LANG_US.put("item.banner.bricks.blue", "Blue Field Masoned");
LANG_US.put("item.banner.bricks.purple", "Purple Field Masoned");
LANG_US.put("item.banner.bricks.cyan", "Cyan Field Masoned");
LANG_US.put("item.banner.bricks.silver", "Light Gray Field Masoned");
LANG_US.put("item.banner.bricks.gray", "Gray Field Masoned");
LANG_US.put("item.banner.bricks.pink", "Pink Field Masoned");
LANG_US.put("item.banner.bricks.lime", "Lime Field Masoned");
LANG_US.put("item.banner.bricks.yellow", "Yellow Field Masoned");
LANG_US.put("item.banner.bricks.lightBlue", "Light Blue Field Masoned");
LANG_US.put("item.banner.bricks.magenta", "Magenta Field Masoned");
LANG_US.put("item.banner.bricks.orange", "Orange Field Masoned");
LANG_US.put("item.banner.bricks.white", "White Field Masoned");
LANG_US.put("item.banner.gradient.black", "Black Gradient");
LANG_US.put("item.banner.gradient.red", "Red Gradient");
LANG_US.put("item.banner.gradient.green", "Green Gradient");
LANG_US.put("item.banner.gradient.brown", "Brown Gradient");
LANG_US.put("item.banner.gradient.blue", "Blue Gradient");
LANG_US.put("item.banner.gradient.purple", "Purple Gradient");
LANG_US.put("item.banner.gradient.cyan", "Cyan Gradient");
LANG_US.put("item.banner.gradient.silver", "Light Gray Gradient");
LANG_US.put("item.banner.gradient.gray", "Gray Gradient");
LANG_US.put("item.banner.gradient.pink", "Pink Gradient");
LANG_US.put("item.banner.gradient.lime", "Lime Gradient");
LANG_US.put("item.banner.gradient.yellow", "Yellow Gradient");
LANG_US.put("item.banner.gradient.lightBlue", "Light Blue Gradient");
LANG_US.put("item.banner.gradient.magenta", "Magenta Gradient");
LANG_US.put("item.banner.gradient.orange", "Orange Gradient");
LANG_US.put("item.banner.gradient.white", "White Gradient");
LANG_US.put("item.banner.gradient_up.black", "Black Base Gradient");
LANG_US.put("item.banner.gradient_up.red", "Red Base Gradient");
LANG_US.put("item.banner.gradient_up.green", "Green Base Gradient");
LANG_US.put("item.banner.gradient_up.brown", "Brown Base Gradient");
LANG_US.put("item.banner.gradient_up.blue", "Blue Base Gradient");
LANG_US.put("item.banner.gradient_up.purple", "Purple Base Gradient");
LANG_US.put("item.banner.gradient_up.cyan", "Cyan Base Gradient");
LANG_US.put("item.banner.gradient_up.silver", "Light Gray Base Gradient");
LANG_US.put("item.banner.gradient_up.gray", "Gray Base Gradient");
LANG_US.put("item.banner.gradient_up.pink", "Pink Base Gradient");
LANG_US.put("item.banner.gradient_up.lime", "Lime Base Gradient");
LANG_US.put("item.banner.gradient_up.yellow", "Yellow Base Gradient");
LANG_US.put("item.banner.gradient_up.lightBlue", "Light Blue Base Gradient");
LANG_US.put("item.banner.gradient_up.magenta", "Magenta Base Gradient");
LANG_US.put("item.banner.gradient_up.orange", "Orange Base Gradient");
LANG_US.put("item.banner.gradient_up.white", "White Base Gradient");
LANG_US.put("item.banner.skull.black", "Black Skull Charge");
LANG_US.put("item.banner.skull.red", "Red Skull Charge");
LANG_US.put("item.banner.skull.green", "Green Skull Charge");
LANG_US.put("item.banner.skull.brown", "Brown Skull Charge");
LANG_US.put("item.banner.skull.blue", "Blue Skull Charge");
LANG_US.put("item.banner.skull.purple", "Purple Skull Charge");
LANG_US.put("item.banner.skull.cyan", "Cyan Skull Charge");
LANG_US.put("item.banner.skull.silver", "Light Gray Skull Charge");
LANG_US.put("item.banner.skull.gray", "Gray Skull Charge");
LANG_US.put("item.banner.skull.pink", "Pink Skull Charge");
LANG_US.put("item.banner.skull.lime", "Lime Skull Charge");
LANG_US.put("item.banner.skull.yellow", "Yellow Skull Charge");
LANG_US.put("item.banner.skull.lightBlue", "Light Blue Skull Charge");
LANG_US.put("item.banner.skull.magenta", "Magenta Skull Charge");
LANG_US.put("item.banner.skull.orange", "Orange Skull Charge");
LANG_US.put("item.banner.skull.white", "White Skull Charge");
LANG_US.put("item.banner.flower.black", "Black Flower Charge");
LANG_US.put("item.banner.flower.red", "Red Flower Charge");
LANG_US.put("item.banner.flower.green", "Green Flower Charge");
LANG_US.put("item.banner.flower.brown", "Brown Flower Charge");
LANG_US.put("item.banner.flower.blue", "Blue Flower Charge");
LANG_US.put("item.banner.flower.purple", "Purple Flower Charge");
LANG_US.put("item.banner.flower.cyan", "Cyan Flower Charge");
LANG_US.put("item.banner.flower.silver", "Light Gray Flower Charge");
LANG_US.put("item.banner.flower.gray", "Gray Flower Charge");
LANG_US.put("item.banner.flower.pink", "Pink Flower Charge");
LANG_US.put("item.banner.flower.lime", "Lime Flower Charge");
LANG_US.put("item.banner.flower.yellow", "Yellow Flower Charge");
LANG_US.put("item.banner.flower.lightBlue", "Light Blue Flower Charge");
LANG_US.put("item.banner.flower.magenta", "Magenta Flower Charge");
LANG_US.put("item.banner.flower.orange", "Orange Flower Charge");
LANG_US.put("item.banner.flower.white", "White Flower Charge");
LANG_US.put("item.banner.border.black", "Black Bordure");
LANG_US.put("item.banner.border.red", "Red Bordure");
LANG_US.put("item.banner.border.green", "Green Bordure");
LANG_US.put("item.banner.border.brown", "Brown Bordure");
LANG_US.put("item.banner.border.blue", "Blue Bordure");
LANG_US.put("item.banner.border.purple", "Purple Bordure");
LANG_US.put("item.banner.border.cyan", "Cyan Bordure");
LANG_US.put("item.banner.border.silver", "Light Gray Bordure");
LANG_US.put("item.banner.border.gray", "Gray Bordure");
LANG_US.put("item.banner.border.pink", "Pink Bordure");
LANG_US.put("item.banner.border.lime", "Lime Bordure");
LANG_US.put("item.banner.border.yellow", "Yellow Bordure");
LANG_US.put("item.banner.border.lightBlue", "Light Blue Bordure");
LANG_US.put("item.banner.border.magenta", "Magenta Bordure");
LANG_US.put("item.banner.border.orange", "Orange Bordure");
LANG_US.put("item.banner.border.white", "White Bordure");
LANG_US.put("item.banner.curly_border.black", "Black Bordure Indented");
LANG_US.put("item.banner.curly_border.red", "Red Bordure Indented");
LANG_US.put("item.banner.curly_border.green", "Green Bordure Indented");
LANG_US.put("item.banner.curly_border.brown", "Brown Bordure Indented");
LANG_US.put("item.banner.curly_border.blue", "Blue Bordure Indented");
LANG_US.put("item.banner.curly_border.purple", "Purple Bordure Indented");
LANG_US.put("item.banner.curly_border.cyan", "Cyan Bordure Indented");
LANG_US.put("item.banner.curly_border.silver", "Light Gray Bordure Indented");
LANG_US.put("item.banner.curly_border.gray", "Gray Bordure Indented");
LANG_US.put("item.banner.curly_border.pink", "Pink Bordure Indented");
LANG_US.put("item.banner.curly_border.lime", "Lime Bordure Indented");
LANG_US.put("item.banner.curly_border.yellow", "Yellow Bordure Indented");
LANG_US.put("item.banner.curly_border.lightBlue", "Light Blue Bordure Indented");
LANG_US.put("item.banner.curly_border.magenta", "Magenta Bordure Indented");
LANG_US.put("item.banner.curly_border.orange", "Orange Bordure Indented");
LANG_US.put("item.banner.curly_border.white", "White Bordure Indented");
LANG_US.put("item.banner.mojang.black", "Black Thing");
LANG_US.put("item.banner.mojang.red", "Red Thing");
LANG_US.put("item.banner.mojang.green", "Green Thing");
LANG_US.put("item.banner.mojang.brown", "Brown Thing");
LANG_US.put("item.banner.mojang.blue", "Blue Thing");
LANG_US.put("item.banner.mojang.purple", "Purple Thing");
LANG_US.put("item.banner.mojang.cyan", "Cyan Thing");
LANG_US.put("item.banner.mojang.silver", "Light Gray Thing");
LANG_US.put("item.banner.mojang.gray", "Gray Thing");
LANG_US.put("item.banner.mojang.pink", "Pink Thing");
LANG_US.put("item.banner.mojang.lime", "Lime Thing");
LANG_US.put("item.banner.mojang.yellow", "Yellow Thing");
LANG_US.put("item.banner.mojang.lightBlue", "Light Blue Thing");
LANG_US.put("item.banner.mojang.magenta", "Magenta Thing");
LANG_US.put("item.banner.mojang.orange", "Orange Thing");
LANG_US.put("item.banner.mojang.white", "White Thing");
LANG_US.put("item.banner.straight_cross.black", "Black Cross");
LANG_US.put("item.banner.straight_cross.red", "Red Cross");
LANG_US.put("item.banner.straight_cross.green", "Green Cross");
LANG_US.put("item.banner.straight_cross.brown", "Brown Cross");
LANG_US.put("item.banner.straight_cross.blue", "Blue Cross");
LANG_US.put("item.banner.straight_cross.purple", "Purple Cross");
LANG_US.put("item.banner.straight_cross.cyan", "Cyan Cross");
LANG_US.put("item.banner.straight_cross.silver", "Light Gray Cross");
LANG_US.put("item.banner.straight_cross.gray", "Gray Cross");
LANG_US.put("item.banner.straight_cross.pink", "Pink Cross");
LANG_US.put("item.banner.straight_cross.lime", "Lime Cross");
LANG_US.put("item.banner.straight_cross.yellow", "Yellow Cross");
LANG_US.put("item.banner.straight_cross.lightBlue", "Light Blue Cross");
LANG_US.put("item.banner.straight_cross.magenta", "Magenta Cross");
LANG_US.put("item.banner.straight_cross.orange", "Orange Cross");
LANG_US.put("item.banner.straight_cross.white", "White Cross");
LANG_US.put("subtitles.ambient.cave", "Eerie noise");
LANG_US.put("subtitles.block.anvil.destroy", "Anvil destroyed");
LANG_US.put("subtitles.block.anvil.land", "Anvil landed");
LANG_US.put("subtitles.block.anvil.use", "Anvil used");
LANG_US.put("subtitles.block.brewing_stand.brew", "Brewing Stand bubbles");
LANG_US.put("subtitles.block.button.click", "Button clicks");
LANG_US.put("subtitles.block.chest.close", "Chest closes");
LANG_US.put("subtitles.block.chest.locked", "Chest locked");
LANG_US.put("subtitles.block.chest.open", "Chest opens");
LANG_US.put("subtitles.block.chorus_flower.death", "Chorus Flower withers");
LANG_US.put("subtitles.block.chorus_flower.grow", "Chorus Flower grows");
LANG_US.put("subtitles.block.comparator.click", "Comparator clicks");
LANG_US.put("subtitles.block.dispenser.dispense", "Dispensed item");
LANG_US.put("subtitles.block.dispenser.fail", "Dispenser failed");
LANG_US.put("subtitles.block.door.toggle", "Door creaks");
LANG_US.put("subtitles.block.fence_gate.toggle", "Fence Gate creaks");
LANG_US.put("subtitles.block.fire.ambient", "Fire crackles");
LANG_US.put("subtitles.block.fire.extinguish", "Fire extinguished");
LANG_US.put("subtitles.block.furnace.fire_crackle", "Furnace crackles");
LANG_US.put("subtitles.block.generic.break", "Block broken");
LANG_US.put("subtitles.block.generic.footsteps", "Footsteps");
LANG_US.put("subtitles.block.generic.hit", "Block breaking");
LANG_US.put("subtitles.block.generic.place", "Block placed");
LANG_US.put("subtitles.block.iron_trapdoor.close", "Trapdoor opens");
LANG_US.put("subtitles.block.iron_trapdoor.open", "Trapdoor closes");
LANG_US.put("subtitles.block.lava.ambient", "Lava pops");
LANG_US.put("subtitles.block.lava.extinguish", "Lava hisses");
LANG_US.put("subtitles.block.lever.click", "Lever clicks");
LANG_US.put("subtitles.block.note.note", "Note Block plays");
LANG_US.put("subtitles.block.piston.move", "Piston moves");
LANG_US.put("subtitles.block.portal.ambient", "Portal whooshes");
LANG_US.put("subtitles.block.pressure_plate.click", "Pressure Plate clicks");
LANG_US.put("subtitles.block.redstone_torch.burnout", "Torch fizzes");
LANG_US.put("subtitles.block.shulker_box.close", "Shulker closes");
LANG_US.put("subtitles.block.shulker_box.open", "Shulker opens");
LANG_US.put("subtitles.block.trapdoor.toggle", "Trapdoor creaks");
LANG_US.put("subtitles.block.tripwire.attach", "Tripwire attaches");
LANG_US.put("subtitles.block.tripwire.click", "Tripwire clicks");
LANG_US.put("subtitles.block.tripwire.detach", "Tripwire detaches");
LANG_US.put("subtitles.block.water.ambient", "Water flows");
LANG_US.put("subtitles.enchant.thorns.hit", "Thorns prick");
LANG_US.put("subtitles.entity.armorstand.fall", "Something fell");
LANG_US.put("subtitles.entity.arrow.hit", "Arrow hits");
LANG_US.put("subtitles.entity.arrow.hit_player", "Player hit");
LANG_US.put("subtitles.entity.arrow.shoot", "Arrow fired");
LANG_US.put("subtitles.entity.bat.ambient", "Bat screeches");
LANG_US.put("subtitles.entity.bat.death", "Bat dies");
LANG_US.put("subtitles.entity.bat.hurt", "Bat hurts");
LANG_US.put("subtitles.entity.bat.takeoff", "Bat takes off");
LANG_US.put("subtitles.entity.blaze.ambient", "Blaze breathes");
LANG_US.put("subtitles.entity.blaze.burn", "Blaze crackles");
LANG_US.put("subtitles.entity.blaze.death", "Blaze dies");
LANG_US.put("subtitles.entity.blaze.hurt", "Blaze hurts");
LANG_US.put("subtitles.entity.blaze.shoot", "Blaze shoots");
LANG_US.put("subtitles.entity.bobber.splash", "Fishing hook splashes");
LANG_US.put("subtitles.entity.bobber.throw", "Bobber thrown");
LANG_US.put("subtitles.entity.cat.ambient", "Cat meows");
LANG_US.put("subtitles.entity.cat.death", "Cat dies");
LANG_US.put("subtitles.entity.cat.hurt", "Cat hurts");
LANG_US.put("subtitles.entity.chicken.ambient", "Chicken clucks");
LANG_US.put("subtitles.entity.chicken.death", "Chicken dies");
LANG_US.put("subtitles.entity.chicken.egg", "Chicken plops");
LANG_US.put("subtitles.entity.chicken.hurt", "Chicken hurts");
LANG_US.put("subtitles.entity.parrot.ambient", "Parrot talks");
LANG_US.put("subtitles.entity.parrot.death", "Parrot dies");
LANG_US.put("subtitles.entity.parrot.eats", "Parrot eats");
LANG_US.put("subtitles.entity.parrot.hurts", "Parrot hurts");
LANG_US.put("subtitles.entity.parrot.imitate.blaze", "Parrot breathes");
LANG_US.put("subtitles.entity.parrot.imitate.cave_spider", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.creeper", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.elder_guardian", "Parrot flaps");
LANG_US.put("subtitles.entity.parrot.imitate.enderdragon", "Parrot roars");
LANG_US.put("subtitles.entity.parrot.imitate.enderman", "Parrot vwoops");
LANG_US.put("subtitles.entity.parrot.imitate.endermite", "Parrot scuttles");
LANG_US.put("subtitles.entity.parrot.imitate.evocation_illager", "Parrot murmurs");
LANG_US.put("subtitles.entity.parrot.imitate.ghast", "Parrot cries");
LANG_US.put("subtitles.entity.parrot.imitate.husk", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.illusion_illager", "Parrot murmurs");
LANG_US.put("subtitles.entity.parrot.imitate.magmacube", "Parrot squishes");
LANG_US.put("subtitles.entity.parrot.imitate.polar_bear", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.shulker", "Parrot lurks");
LANG_US.put("subtitles.entity.parrot.imitate.silverfish", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.skeleton", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.slime", "Parrot squishes");
LANG_US.put("subtitles.entity.parrot.imitate.spider", "Parrot hisses");
LANG_US.put("subtitles.entity.parrot.imitate.stray", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.vex", "Parrot vexes");
LANG_US.put("subtitles.entity.parrot.imitate.vindication_illager", "Parrot mutters");
LANG_US.put("subtitles.entity.parrot.imitate.witch", "Parrot giggles");
LANG_US.put("subtitles.entity.parrot.imitate.wither", "Parrot angers");
LANG_US.put("subtitles.entity.parrot.imitate.wither_skeleton", "Parrot rattles");
LANG_US.put("subtitles.entity.parrot.imitate.wolf", "Parrot pants");
LANG_US.put("subtitles.entity.parrot.imitate.zombie", "Parrot groans");
LANG_US.put("subtitles.entity.parrot.imitate.zombie_pigman", "Parrot grunts");
LANG_US.put("subtitles.entity.parrot.imitate.zombie_villager", "Parrot groans");
LANG_US.put("subtitles.entity.cow.ambient", "Cow moos");
LANG_US.put("subtitles.entity.cow.death", "Cow dies");
LANG_US.put("subtitles.entity.cow.hurt", "Cow hurts");
LANG_US.put("subtitles.entity.cow.milk", "Cow gets milked");
LANG_US.put("subtitles.entity.creeper.death", "Creeper dies");
LANG_US.put("subtitles.entity.creeper.hurt", "Creeper hurts");
LANG_US.put("subtitles.entity.creeper.primed", "Creeper hisses");
LANG_US.put("subtitles.entity.donkey.ambient", "Donkey hee-haws");
LANG_US.put("subtitles.entity.donkey.angry", "Donkey neighs");
LANG_US.put("subtitles.entity.donkey.chest", "Donkey Chest equips");
LANG_US.put("subtitles.entity.donkey.death", "Donkey dies");
LANG_US.put("subtitles.entity.donkey.hurt", "Donkey hurts");
LANG_US.put("subtitles.entity.egg.throw", "Egg flies");
LANG_US.put("subtitles.entity.elder_guardian.ambient.land", "Elder Guardian flaps");
LANG_US.put("subtitles.entity.elder_guardian.ambient", "Elder Guardian moans");
LANG_US.put("subtitles.entity.elder_guardian.attack", "Elder Guardian shoots");
LANG_US.put("subtitles.entity.elder_guardian.curse", "Elder Guardian curses");
LANG_US.put("subtitles.entity.elder_guardian.death", "Elder Guardian dies");
LANG_US.put("subtitles.entity.elder_guardian.flop", "Elder Guardian flops");
LANG_US.put("subtitles.entity.elder_guardian.hurt", "Elder Guardian hurts");
LANG_US.put("subtitles.entity.enderdragon.ambient", "Dragon roars");
LANG_US.put("subtitles.entity.enderdragon.death", "Dragon dies");
LANG_US.put("subtitles.entity.enderdragon.flap", "Dragon flaps");
LANG_US.put("subtitles.entity.enderdragon.growl", "Dragon growls");
LANG_US.put("subtitles.entity.enderdragon.hurt", "Dragon hurts");
LANG_US.put("subtitles.entity.enderdragon.shoot", "Dragon shoots");
LANG_US.put("subtitles.entity.endereye.launch", "Eye of Ender shoots");
LANG_US.put("subtitles.entity.enderman.ambient", "Enderman vwoops");
LANG_US.put("subtitles.entity.enderman.death", "Enderman dies");
LANG_US.put("subtitles.entity.enderman.hurt", "Enderman hurts");
LANG_US.put("subtitles.entity.enderman.stare", "Enderman cries out");
LANG_US.put("subtitles.entity.enderman.teleport", "Enderman teleports");
LANG_US.put("subtitles.entity.endermite.ambient", "Endermite scuttles");
LANG_US.put("subtitles.entity.endermite.death", "Endermite dies");
LANG_US.put("subtitles.entity.endermite.hurt", "Endermite hurts");
LANG_US.put("subtitles.entity.enderpearl.throw", "Ender Pearl flies");
LANG_US.put("subtitles.entity.evocation_fangs.attack", "Fangs snap");
LANG_US.put("subtitles.entity.evocation_illager.ambient", "Evoker murmurs");
LANG_US.put("subtitles.entity.evocation_illager.cast_spell", "Evoker casts spell");
LANG_US.put("subtitles.entity.evocation_illager.death", "Evoker dies");
LANG_US.put("subtitles.entity.evocation_illager.hurt", "Evoker hurts");
LANG_US.put("subtitles.entity.evocation_illager.prepare_attack", "Evoker prepares attack");
LANG_US.put("subtitles.entity.evocation_illager.prepare_summon", "Evoker prepares summoning");
LANG_US.put("subtitles.entity.evocation_illager.prepare_wololo", "Evoker prepares charming");
LANG_US.put("subtitles.entity.experience_orb.pickup", "Experience gained");
LANG_US.put("subtitles.entity.firework.blast", "Firework blasts");
LANG_US.put("subtitles.entity.firework.launch", "Firework launches");
LANG_US.put("subtitles.entity.firework.twinkle", "Firework twinkles");
LANG_US.put("subtitles.entity.generic.big_fall", "Something fell");
LANG_US.put("subtitles.entity.generic.burn", "Burning");
LANG_US.put("subtitles.entity.generic.death", "Dying");
LANG_US.put("subtitles.entity.generic.drink", "Sipping");
LANG_US.put("subtitles.entity.generic.eat", "Eating");
LANG_US.put("subtitles.entity.generic.explode", "Explosion");
LANG_US.put("subtitles.entity.generic.extinguish_fire", "Fire extinguishes");
LANG_US.put("subtitles.entity.generic.hurt", "Something hurts");
LANG_US.put("subtitles.entity.generic.small_fall", "Something tripped");
LANG_US.put("subtitles.entity.generic.splash", "Splashing");
LANG_US.put("subtitles.entity.generic.swim", "Swimming");
LANG_US.put("subtitles.entity.ghast.ambient", "Ghast cries");
LANG_US.put("subtitles.entity.ghast.death", "Ghast dies");
LANG_US.put("subtitles.entity.ghast.hurt", "Ghast hurts");
LANG_US.put("subtitles.entity.ghast.shoot", "Ghast shoots");
LANG_US.put("subtitles.entity.guardian.ambient.land", "Guardian flaps");
LANG_US.put("subtitles.entity.guardian.ambient", "Guardian moans");
LANG_US.put("subtitles.entity.guardian.attack", "Guardian shoots");
LANG_US.put("subtitles.entity.guardian.curse", "Guardian curses");
LANG_US.put("subtitles.entity.guardian.death", "Guardian dies");
LANG_US.put("subtitles.entity.guardian.flop", "Guardian flops");
LANG_US.put("subtitles.entity.guardian.hurt", "Guardian hurts");
LANG_US.put("subtitles.entity.horse.ambient", "Horse neighs");
LANG_US.put("subtitles.entity.horse.angry", "Horse neighs");
LANG_US.put("subtitles.entity.horse.armor", "Horse armor equips");
LANG_US.put("subtitles.entity.horse.breathe", "Horse breathes");
LANG_US.put("subtitles.entity.horse.death", "Horse dies");
LANG_US.put("subtitles.entity.horse.eat", "Horse eats");
LANG_US.put("subtitles.entity.horse.gallop", "Horse gallops");
LANG_US.put("subtitles.entity.horse.hurt", "Horse hurts");
LANG_US.put("subtitles.entity.horse.jump", "Horse jumps");
LANG_US.put("subtitles.entity.horse.saddle", "Saddle equips");
LANG_US.put("subtitles.entity.husk.ambient", "Husk groans");
LANG_US.put("subtitles.entity.husk.death", "Husk dies");
LANG_US.put("subtitles.entity.husk.hurt", "Husk hurts");
LANG_US.put("subtitles.entity.illusion_illager.ambient", "Illusioner murmurs");
LANG_US.put("subtitles.entity.illusion_illager.cast_spell", "Illusioner casts spell");
LANG_US.put("subtitles.entity.illusion_illager.death", "Illusioner dies");
LANG_US.put("subtitles.entity.illusion_illager.hurt", "Illusioner hurts");
LANG_US.put("subtitles.entity.illusion_illager.mirror_move", "Illusioner displaces");
LANG_US.put("subtitles.entity.illusion_illager.prepare_blindness", "Illusioner prepares blindness");
LANG_US.put("subtitles.entity.illusion_illager.prepare_mirror", "Illusioner prepares mirror image");
LANG_US.put("subtitles.entity.iron_golem.attack", "Iron Golem attacks");
LANG_US.put("subtitles.entity.iron_golem.death", "Iron Golem dies");
LANG_US.put("subtitles.entity.iron_golem.hurt", "Iron Golem hurts");
LANG_US.put("subtitles.entity.item.break", "Item breaks");
LANG_US.put("subtitles.entity.item.pickup", "Item plops");
LANG_US.put("subtitles.entity.itemframe.add_item", "Item Frame fills");
LANG_US.put("subtitles.entity.itemframe.break", "Item Frame breaks");
LANG_US.put("subtitles.entity.itemframe.place", "Item Frame placed");
LANG_US.put("subtitles.entity.itemframe.remove_item", "Item Frame empties");
LANG_US.put("subtitles.entity.itemframe.rotate_item", "Item Frame clicks");
LANG_US.put("subtitles.entity.leashknot.break", "Leash knot breaks");
LANG_US.put("subtitles.entity.leashknot.place", "Leash knot tied");
LANG_US.put("subtitles.entity.lightning.impact", "Lightning strikes");
LANG_US.put("subtitles.entity.lightning.thunder", "Thunder roars");
LANG_US.put("subtitles.entity.llama.ambient", "Llama bleats");
LANG_US.put("subtitles.entity.llama.angry", "Llama bleats angry");
LANG_US.put("subtitles.entity.llama.chest", "Llama Chest equips");
LANG_US.put("subtitles.entity.llama.death", "Llama dies");
LANG_US.put("subtitles.entity.llama.eat", "Llama eats");
LANG_US.put("subtitles.entity.llama.hurt", "Llama hurts");
LANG_US.put("subtitles.entity.llama.spit", "Llama spits");
LANG_US.put("subtitles.entity.llama.step", "Llama steps");
LANG_US.put("subtitles.entity.llama.swag", "Llama is decorated");
LANG_US.put("subtitles.entity.magmacube.death", "Magma Cube dies");
LANG_US.put("subtitles.entity.magmacube.hurt", "Magma Cube hurts");
LANG_US.put("subtitles.entity.magmacube.squish", "Magma Cube squishes");
LANG_US.put("subtitles.entity.minecart.riding", "Minecart rolls");
LANG_US.put("subtitles.entity.mule.ambient", "Mule hee-haws");
LANG_US.put("subtitles.entity.mule.chest", "Mule Chest equips");
LANG_US.put("subtitles.entity.mule.death", "Mule dies");
LANG_US.put("subtitles.entity.mule.hurt", "Mule hurts");
LANG_US.put("subtitles.entity.painting.break", "Painting breaks");
LANG_US.put("subtitles.entity.painting.place", "Painting placed");
LANG_US.put("subtitles.entity.pig.ambient", "Pig oinks");
LANG_US.put("subtitles.entity.pig.death", "Pig dies");
LANG_US.put("subtitles.entity.pig.hurt", "Pig hurts");
LANG_US.put("subtitles.entity.pig.saddle", "Saddle equips");
LANG_US.put("subtitles.entity.player.burp", "Burp");
LANG_US.put("subtitles.entity.player.death", "Player dies");
LANG_US.put("subtitles.entity.player.hurt", "Player hurts");
LANG_US.put("subtitles.entity.player.levelup", "Player dings");
LANG_US.put("subtitles.entity.polar_bear.ambient", "Polar Bear groans");
LANG_US.put("subtitles.entity.polar_bear.baby_ambient", "Polar Bear hums");
LANG_US.put("subtitles.entity.polar_bear.death", "Polar Bear dies");
LANG_US.put("subtitles.entity.polar_bear.hurt", "Polar Bear hurts");
LANG_US.put("subtitles.entity.polar_bear.warning", "Polar Bear roars");
LANG_US.put("subtitles.entity.potion.splash", "Bottle smashes");
LANG_US.put("subtitles.entity.potion.throw", "Bottle thrown");
LANG_US.put("subtitles.entity.rabbit.ambient", "Rabbit squeaks");
LANG_US.put("subtitles.entity.rabbit.attack", "Rabbit attacks");
LANG_US.put("subtitles.entity.rabbit.death", "Rabbit dies");
LANG_US.put("subtitles.entity.rabbit.hurt", "Rabbit hurts");
LANG_US.put("subtitles.entity.rabbit.jump", "Rabbit hops");
LANG_US.put("subtitles.entity.sheep.ambient", "Sheep baahs");
LANG_US.put("subtitles.entity.sheep.death", "Sheep dies");
LANG_US.put("subtitles.entity.sheep.hurt", "Sheep hurts");
LANG_US.put("subtitles.entity.shulker.ambient", "Shulker lurks");
LANG_US.put("subtitles.entity.shulker.close", "Shulker closes");
LANG_US.put("subtitles.entity.shulker.death", "Shulker dies");
LANG_US.put("subtitles.entity.shulker.hurt", "Shulker hurts");
LANG_US.put("subtitles.entity.shulker.open", "Shulker opens");
LANG_US.put("subtitles.entity.shulker.shoot", "Shulker shoots");
LANG_US.put("subtitles.entity.shulker.teleport", "Shulker teleports");
LANG_US.put("subtitles.entity.shulker_bullet.hit", "Shulker bullet explodes");
LANG_US.put("subtitles.entity.shulker_bullet.hurt", "Shulker bullet breaks");
LANG_US.put("subtitles.entity.silverfish.ambient", "Silverfish hisses");
LANG_US.put("subtitles.entity.silverfish.death", "Silverfish dies");
LANG_US.put("subtitles.entity.silverfish.hurt", "Silverfish hurts");
LANG_US.put("subtitles.entity.skeleton.ambient", "Skeleton rattles");
LANG_US.put("subtitles.entity.skeleton.death", "Skeleton dies");
LANG_US.put("subtitles.entity.skeleton.hurt", "Skeleton hurts");
LANG_US.put("subtitles.entity.skeleton.shoot", "Skeleton shoots");
LANG_US.put("subtitles.entity.skeleton_horse.ambient", "Skeleton Horse cries");
LANG_US.put("subtitles.entity.skeleton_horse.death", "Skeleton Horse dies");
LANG_US.put("subtitles.entity.skeleton_horse.hurt", "Skeleton Horse hurts");
LANG_US.put("subtitles.entity.slime.attack", "Slime attacks");
LANG_US.put("subtitles.entity.slime.death", "Slime dies");
LANG_US.put("subtitles.entity.slime.hurt", "Slime hurts");
LANG_US.put("subtitles.entity.slime.squish", "Slime squishes");
LANG_US.put("subtitles.entity.snowball.throw", "Snowball flies");
LANG_US.put("subtitles.entity.snowman.death", "Snow Golem dies");
LANG_US.put("subtitles.entity.snowman.hurt", "Snow Golem hurts");
LANG_US.put("subtitles.entity.spider.ambient", "Spider hisses");
LANG_US.put("subtitles.entity.spider.death", "Spider dies");
LANG_US.put("subtitles.entity.spider.hurt", "Spider hurts");
LANG_US.put("subtitles.entity.squid.ambient", "Squid swims");
LANG_US.put("subtitles.entity.squid.death", "Squid dies");
LANG_US.put("subtitles.entity.squid.hurt", "Squid hurts");
LANG_US.put("subtitles.entity.stray.ambient", "Stray rattles");
LANG_US.put("subtitles.entity.stray.death", "Stray dies");
LANG_US.put("subtitles.entity.stray.hurt", "Stray hurts");
LANG_US.put("subtitles.entity.tnt.primed", "TNT fizzes");
LANG_US.put("subtitles.entity.vex.ambient", "Vex vexes");
LANG_US.put("subtitles.entity.vex.charge", "Vex shrieks");
LANG_US.put("subtitles.entity.vex.death", "Vex dies");
LANG_US.put("subtitles.entity.vex.hurt", "Vex hurts");
LANG_US.put("subtitles.entity.villager.ambient", "Villager mumbles");
LANG_US.put("subtitles.entity.villager.death", "Villager dies");
LANG_US.put("subtitles.entity.villager.hurt", "Villager hurts");
LANG_US.put("subtitles.entity.villager.no", "Villager disagrees");
LANG_US.put("subtitles.entity.villager.trading", "Villager trades");
LANG_US.put("subtitles.entity.villager.yes", "Villager agrees");
LANG_US.put("subtitles.entity.vindication_illager.ambient", "Vindicator mutters");
LANG_US.put("subtitles.entity.vindication_illager.death", "Vindicator dies");
LANG_US.put("subtitles.entity.vindication_illager.hurt", "Vindicator hurts");
LANG_US.put("subtitles.entity.witch.ambient", "Witch giggles");
LANG_US.put("subtitles.entity.witch.death", "Witch dies");
LANG_US.put("subtitles.entity.witch.drink", "Witch drinks");
LANG_US.put("subtitles.entity.witch.hurt", "Witch hurts");
LANG_US.put("subtitles.entity.witch.throw", "Witch throws");
LANG_US.put("subtitles.entity.wither.ambient", "Wither angers");
LANG_US.put("subtitles.entity.wither.death", "Wither dies");
LANG_US.put("subtitles.entity.wither.hurt", "Wither hurts");
LANG_US.put("subtitles.entity.wither.shoot", "Wither attacks");
LANG_US.put("subtitles.entity.wither.spawn", "Wither released");
LANG_US.put("subtitles.entity.wither_skeleton.ambient", "Wither Skeleton rattles");
LANG_US.put("subtitles.entity.wither_skeleton.death", "Wither Skeleton dies");
LANG_US.put("subtitles.entity.wither_skeleton.hurt", "Wither Skeleton hurts");
LANG_US.put("subtitles.entity.wolf.ambient", "Wolf pants");
LANG_US.put("subtitles.entity.wolf.death", "Wolf dies");
LANG_US.put("subtitles.entity.wolf.growl", "Wolf growls");
LANG_US.put("subtitles.entity.wolf.hurt", "Wolf hurts");
LANG_US.put("subtitles.entity.wolf.shake", "Wolf shakes");
LANG_US.put("subtitles.entity.zombie.ambient", "Zombie groans");
LANG_US.put("subtitles.entity.zombie.death", "Zombie dies");
LANG_US.put("subtitles.entity.zombie.hurt", "Zombie hurts");
LANG_US.put("subtitles.entity.zombie.infect", "Zombie infects");
LANG_US.put("subtitles.entity.zombie_horse.ambient", "Zombie Horse cries");
LANG_US.put("subtitles.entity.zombie_horse.death", "Zombie Horse dies");
LANG_US.put("subtitles.entity.zombie_horse.hurt", "Zombie Horse hurts");
LANG_US.put("subtitles.entity.zombie_pigman.ambient", "Zombie Pigman grunts");
LANG_US.put("subtitles.entity.zombie_pigman.angry", "Zombie Pigman angers");
LANG_US.put("subtitles.entity.zombie_pigman.death", "Zombie Pigman dies");
LANG_US.put("subtitles.entity.zombie_pigman.hurt", "Zombie Pigman hurts");
LANG_US.put("subtitles.entity.zombie_villager.ambient", "Zombie Villager groans");
LANG_US.put("subtitles.entity.zombie_villager.converted", "Zombie vociferates");
LANG_US.put("subtitles.entity.zombie_villager.cure", "Zombie snuffles");
LANG_US.put("subtitles.entity.zombie_villager.death", "Zombie Villager dies");
LANG_US.put("subtitles.entity.zombie_villager.hurt", "Zombie Villager hurts");
LANG_US.put("subtitles.item.armor.equip", "Gear equipped");
LANG_US.put("subtitles.item.armor.equip_chain", "Chain armor jingles");
LANG_US.put("subtitles.item.armor.equip_diamond", "Diamond armor clangs");
LANG_US.put("subtitles.item.armor.equip_elytra", "Elytra rustles");
LANG_US.put("subtitles.item.armor.equip_gold", "Gold armor clinks");
LANG_US.put("subtitles.item.armor.equip_iron", "Iron armor clanks");
LANG_US.put("subtitles.item.armor.equip_leather", "Leather armor rustles");
LANG_US.put("subtitles.item.bottle.fill", "Bottle fills");
LANG_US.put("subtitles.item.bucket.empty", "Bucket empties");
LANG_US.put("subtitles.item.bucket.fill", "Bucket fills");
LANG_US.put("subtitles.item.chorus_fruit.teleport", "Player teleports");
LANG_US.put("subtitles.item.firecharge.use", "Fireball whooshes");
LANG_US.put("subtitles.item.flintandsteel.use", "Flint and Steel click");
LANG_US.put("subtitles.item.hoe.till", "Hoe tills");
LANG_US.put("subtitles.item.shear", "Shears click");
LANG_US.put("subtitles.item.shield.block", "Shield blocks");
LANG_US.put("subtitles.item.shovel.flatten", "Shovel flattens");
LANG_US.put("subtitles.item.totem.use", "Totem activates");
LANG_US.put("subtitles.weather.rain", "Rain falls");
LANG_US.put("debug.prefix", "[Debug]:");
LANG_US.put("debug.reload_chunks.help=F3 + A ", " Reload chunks");
LANG_US.put("debug.show_hitboxes.help=F3 + B ", " Show hitboxes");
LANG_US.put("debug.clear_chat.help=F3 + D ", " Clear chat");
LANG_US.put("debug.cycle_renderdistance.help=F3 + F ", " Cycle render distance (Shift to invert)");
LANG_US.put("debug.chunk_boundaries.help=F3 + G ", " Show chunk boundaries");
LANG_US.put("debug.advanced_tooltips.help=F3 + H ", " Advanced tooltips");
LANG_US.put("debug.creative_spectator.help=F3 + N ", " Cycle creative <-> spectator");
LANG_US.put("debug.pause_focus.help=F3 + P ", " Pause on lost focus");
LANG_US.put("debug.help.help=F3 + Q ", " Show this list");
LANG_US.put("debug.reload_resourcepacks.help=F3 + T ", " Reload resource packs");
LANG_US.put("debug.reload_chunks.message", "Reloading all chunks");
LANG_US.put("debug.show_hitboxes.on", "Hitboxes: shown");
LANG_US.put("debug.show_hitboxes.off", "Hitboxes: hidden");
LANG_US.put("debug.cycle_renderdistance.message", "Render Distance: %s");
LANG_US.put("debug.chunk_boundaries.on", "Chunk borders: shown");
LANG_US.put("debug.chunk_boundaries.off", "Chunk borders: hidden");
LANG_US.put("debug.advanced_tooltips.on", "Advanced tooltips: shown");
LANG_US.put("debug.advanced_tooltips.off", "Advanced tooltips: hidden");
LANG_US.put("debug.creative_spectator.error", "Unable to switch gamemode, no permission");
LANG_US.put("debug.pause_focus.on", "Pause on lost focus: enabled");
LANG_US.put("debug.pause_focus.off", "Pause on lost focus: disabled");
LANG_US.put("debug.help.message", "Key bindings:");
LANG_US.put("debug.reload_resourcepacks.message", "Reloaded resource packs");
LANG_US.put("resourcepack.downloading", "Downloading Resource Pack");
LANG_US.put("resourcepack.requesting", "Making Request...");
LANG_US.put("resourcepack.progress", "Downloading file (%s MB)...");
LANG_US.put("tutorial.move.title", "Move with %s, %s, %s and %s");
LANG_US.put("tutorial.move.description", "Jump with %s");
LANG_US.put("tutorial.look.title", "Look around");
LANG_US.put("tutorial.look.description", "Use your mouse to turn");
LANG_US.put("tutorial.find_tree.title", "Find a tree");
LANG_US.put("tutorial.find_tree.description", "Punch it to collect wood");
LANG_US.put("tutorial.punch_tree.title", "Destroy the tree");
LANG_US.put("tutorial.punch_tree.description", "Hold down %s");
LANG_US.put("tutorial.open_inventory.title", "Open your inventory");
LANG_US.put("tutorial.open_inventory.description", "Press %s");
LANG_US.put("tutorial.craft_planks.title", "Craft wooden planks");
LANG_US.put("tutorial.craft_planks.description", "The recipe book can help");
LANG_US.put("advancements.adventure.adventuring_time.title", "Adventuring Time");
LANG_US.put("advancements.adventure.adventuring_time.description", "Discover every biome");
LANG_US.put("advancements.adventure.kill_all_mobs.title", "Monsters Hunted");
LANG_US.put("advancements.adventure.kill_all_mobs.description", "Kill one of every hostile monster");
LANG_US.put("advancements.adventure.kill_a_mob.title", "Monster Hunter");
LANG_US.put("advancements.adventure.kill_a_mob.description", "Kill any hostile monster");
LANG_US.put("advancements.adventure.root.title", "Adventure");
LANG_US.put("advancements.adventure.root.description", "Adventure, exploration and combat");
LANG_US.put("advancements.adventure.shoot_arrow.title", "Take Aim");
LANG_US.put("advancements.adventure.shoot_arrow.description", "Shoot something with a bow and arrow");
LANG_US.put("advancements.adventure.sleep_in_bed.title", "Sweet dreams");
LANG_US.put("advancements.adventure.sleep_in_bed.description", "Change your respawn point");
LANG_US.put("advancements.adventure.sniper_duel.title", "Sniper duel");
LANG_US.put("advancements.adventure.sniper_duel.description", "Kill a skeleton with an arrow from more than 50 meters");
LANG_US.put("advancements.adventure.trade.title", "What a Deal!");
LANG_US.put("advancements.adventure.trade.description", "Successfully trade with a Villager");
LANG_US.put("advancements.adventure.summon_iron_golem.title", "Hired Help");
LANG_US.put("advancements.adventure.summon_iron_golem.description", "Summon an Iron Golem to help defend a village");
LANG_US.put("advancements.adventure.totem_of_undying.title", "Postmortal");
LANG_US.put("advancements.adventure.totem_of_undying.description", "Use a Totem of Undying to cheat death");
LANG_US.put("advancements.husbandry.root.title", "Husbandry");
LANG_US.put("advancements.husbandry.root.description", "The world is full of friends and food");
LANG_US.put("advancements.husbandry.breed_an_animal.title", "The Parrots and the Bats");
LANG_US.put("advancements.husbandry.breed_an_animal.description", "Breed two animals together");
LANG_US.put("advancements.husbandry.breed_all_animals.title", "Two by Two");
LANG_US.put("advancements.husbandry.breed_all_animals.description", "Breed all the animals!");
LANG_US.put("advancements.husbandry.tame_an_animal.title", "Best Friends Forever");
LANG_US.put("advancements.husbandry.tame_an_animal.description", "Tame an animal");
LANG_US.put("advancements.husbandry.plant_seed.title", "A Seedy Place");
LANG_US.put("advancements.husbandry.plant_seed.description", "Plant a seed and watch it grow");
LANG_US.put("advancements.husbandry.break_diamond_hoe.title", "Serious Dedication");
LANG_US.put("advancements.husbandry.break_diamond_hoe.description", "Completely use up a diamond hoe, and then reevaluate your life choices");
LANG_US.put("advancements.husbandry.balanced_diet.title", "A Balanced Diet");
LANG_US.put("advancements.husbandry.balanced_diet.description", "Eat everything that is edible, even if it's not good for you");
LANG_US.put("advancements.end.dragon_breath.title", "You Need a Mint");
LANG_US.put("advancements.end.dragon_breath.description", "Collect dragon's breath in a glass bottle");
LANG_US.put("advancements.end.dragon_egg.title", "The Next Generation");
LANG_US.put("advancements.end.dragon_egg.description", "Hold the Dragon Egg");
LANG_US.put("advancements.end.elytra.title", "Sky's the Limit");
LANG_US.put("advancements.end.elytra.description", "Find an Elytra");
LANG_US.put("advancements.end.enter_end_gateway.title", "Remote Getaway");
LANG_US.put("advancements.end.enter_end_gateway.description", "Escape the island");
LANG_US.put("advancements.end.find_end_city.title", "The City at the End of the Game");
LANG_US.put("advancements.end.find_end_city.description", "Go on in, what could happen?");
LANG_US.put("advancements.end.kill_dragon.title", "Free the End");
LANG_US.put("advancements.end.kill_dragon.description", "Good luck");
LANG_US.put("advancements.end.levitate.title", "Great View From Up Here");
LANG_US.put("advancements.end.levitate.description", "Levitate up 50 blocks from the attacks of a Shulker");
LANG_US.put("advancements.end.respawn_dragon.title", "The End... Again...");
LANG_US.put("advancements.end.respawn_dragon.description", "Respawn the ender dragon");
LANG_US.put("advancements.end.root.title", "The End");
LANG_US.put("advancements.end.root.description", "Or the beginning?");
LANG_US.put("advancements.nether.brew_potion.title", "Local Brewery");
LANG_US.put("advancements.nether.brew_potion.description", "Brew a potion");
LANG_US.put("advancements.nether.all_potions.title", "A Furious Cocktail");
LANG_US.put("advancements.nether.all_potions.description", "Have every potion effect applied at the same time");
LANG_US.put("advancements.nether.all_effects.title", "How Did We Get Here?");
LANG_US.put("advancements.nether.all_effects.description", "Have every effect applied at the same time");
LANG_US.put("advancements.nether.create_beacon.title", "Bring Home the Beacon");
LANG_US.put("advancements.nether.create_beacon.description", "Construct and place a Beacon");
LANG_US.put("advancements.nether.create_full_beacon.title", "Beaconator");
LANG_US.put("advancements.nether.create_full_beacon.description", "Bring a beacon to full power");
LANG_US.put("advancements.nether.find_fortress.title", "A Terrible Fortress");
LANG_US.put("advancements.nether.find_fortress.description", "Break your way into a Nether Fortress");
LANG_US.put("advancements.nether.get_wither_skull.title", "Spooky Scary Skeleton");
LANG_US.put("advancements.nether.get_wither_skull.description", "Obtain a wither skeleton's skull");
LANG_US.put("advancements.nether.obtain_blaze_rod.title", "Into Fire");
LANG_US.put("advancements.nether.obtain_blaze_rod.description", "Relieve a Blaze of its rod");
LANG_US.put("advancements.nether.return_to_sender.title", "Return to Sender");
LANG_US.put("advancements.nether.return_to_sender.description", "Destroy a Ghast with a fireball");
LANG_US.put("advancements.nether.root.title", "Nether");
LANG_US.put("advancements.nether.root.description", "Bring summer clothes");
LANG_US.put("advancements.nether.summon_wither.title", "Withering Heights");
LANG_US.put("advancements.nether.summon_wither.description", "Summon the Wither");
LANG_US.put("advancements.nether.fast_travel.title", "Subspace Bubble");
LANG_US.put("advancements.nether.fast_travel.description", "Use the Nether to travel 7km in the Overworld");
LANG_US.put("advancements.nether.uneasy_alliance.title", "Uneasy Alliance");
LANG_US.put("advancements.nether.uneasy_alliance.description", "Rescue a Ghast from the Nether, bring it safely home to the Overworld... and then kill it.");
LANG_US.put("advancements.story.cure_zombie_villager.title", "Zombie Doctor");
LANG_US.put("advancements.story.cure_zombie_villager.description", "Weaken and then cure a zombie villager");
LANG_US.put("advancements.story.deflect_arrow.title", "Not Today, Thank You");
LANG_US.put("advancements.story.deflect_arrow.description", "Deflect an arrow with a shield");
LANG_US.put("advancements.story.enchant_item.title", "Enchanter");
LANG_US.put("advancements.story.enchant_item.description", "Enchant an item at an Enchanting Table");
LANG_US.put("advancements.story.enter_the_end.title", "The End?");
LANG_US.put("advancements.story.enter_the_end.description", "Enter the End Portal");
LANG_US.put("advancements.story.enter_the_nether.title", "We Need to Go Deeper");
LANG_US.put("advancements.story.enter_the_nether.description", "Build, light and enter a Nether Portal");
LANG_US.put("advancements.story.follow_ender_eye.title", "Eye Spy");
LANG_US.put("advancements.story.follow_ender_eye.description", "Follow an Ender Eye");
LANG_US.put("advancements.story.form_obsidian.title", "Ice Bucket Challenge");
LANG_US.put("advancements.story.form_obsidian.description", "Form and mine a block of Obsidian");
LANG_US.put("advancements.story.iron_tools.title", "Isn't It Iron Pick");
LANG_US.put("advancements.story.iron_tools.description", "Upgrade your pickaxe");
LANG_US.put("advancements.story.lava_bucket.title", "Hot Stuff");
LANG_US.put("advancements.story.lava_bucket.description", "Fill a bucket with lava");
LANG_US.put("advancements.story.mine_diamond.title", "Diamonds!");
LANG_US.put("advancements.story.mine_diamond.description", "Acquire diamonds");
LANG_US.put("advancements.story.mine_stone.title", "Stone Age");
LANG_US.put("advancements.story.mine_stone.description", "Mine stone with your new pickaxe");
LANG_US.put("advancements.story.obtain_armor.title", "Suit Up");
LANG_US.put("advancements.story.obtain_armor.description", "Protect yourself with a piece of iron armor");
LANG_US.put("advancements.story.root.title", "Minecraft");
LANG_US.put("advancements.story.root.description", "The heart and story of the game");
LANG_US.put("advancements.story.shiny_gear.title", "Cover Me With Diamonds");
LANG_US.put("advancements.story.shiny_gear.description", "Diamond armor saves lives");
LANG_US.put("advancements.story.smelt_iron.title", "Acquire Hardware");
LANG_US.put("advancements.story.smelt_iron.description", "Smelt an iron ingot");
LANG_US.put("advancements.story.upgrade_tools.title", "Getting an Upgrade");
LANG_US.put("advancements.story.upgrade_tools.description", "Construct a better pickaxe");
}
}
| 231,846 | 0.701901 | 0.700228 | 3,464 | 64.930138 | 24.11561 | 427 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.867783 | false | false | 7 |
ca9c85c604b4c989a3ece3851a16320dd80640fd | 37,185,826,863,008 | 0b1ce1b4b75af68e3b67dbac8d31e71dbcec8c86 | /src/com/xinzhe/categories/solutions/dp/knapsack/knapsack01/Leetcode1049.java | 8c6fa4cea4db052f865500fcfbd4fb154fd6ab09 | [] | no_license | JasonZ2z/LeetCode | https://github.com/JasonZ2z/LeetCode | cc37bb8715cb52ab3069d2270fd9903958065149 | 20adb4583633c68491a1baa194985af56e8ab62d | refs/heads/master | 2023-02-17T22:07:38.351000 | 2023-02-14T03:21:08 | 2023-02-14T03:21:08 | 237,776,424 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.xinzhe.categories.solutions.dp.knapsack.knapsack01;
import java.util.Arrays;
/**
* @author Xin
* @date 2020/3/20 19:13
* Title : 1049. 最后一块石头的重量 II
* Description : 有一堆石头,每块石头的重量都是正整数。
*
* 每一回合,从中选出两块最重的石头,然后将它们一起粉碎。假设石头的重量分别为 x 和 y,且 x <= y。那么粉碎的可能结果如下:
*
* 如果 x == y,那么两块石头都会被完全粉碎;
* 如果 x != y,那么重量为 x 的石头将会完全粉碎,而重量为 y 的石头新重量为 y-x。
* 最后,最多只会剩下一块石头。返回此石头最小的可能重量。如果没有石头剩下,就返回 0。
* link : https://leetcode-cn.com/problems/last-stone-weight-ii/
* Level : Medium
*/
//todo need to review
public class Leetcode1049 {
public int lastStoneWeight(int[] stones) {
if (stones.length == 0) return 0;
int all = Arrays.stream(stones).sum();
int sum = all / 2;
int[] dp = new int[sum + 1];
for (int stone : stones) {
for (int i = sum; i >= stone; i--) {
dp[i] = Math.max(dp[i], dp[i - stone] + stone);
}
}
return all - 2 * dp[sum];
}
public int lastStoneWeightII(int[] stones) {
int sum = 0;
for(int i: stones) sum += i;
int target = sum / 2;
boolean[] dp = new boolean[target + 1];
dp[0] = true;
int min = sum;
for(int s : stones) {
for(int i = target; i >= s; i--) {
if(dp[i-s]) {
dp[i] = true;
}
}
}
for(int i=target; i >= 0; i--) {
if(dp[i]) min = Math.min(min, sum - i * 2);
}
return min;
}
} | UTF-8 | Java | 1,835 | java | Leetcode1049.java | Java | [
{
"context": "psack01;\n\nimport java.util.Arrays;\n\n/**\n * @author Xin\n * @date 2020/3/20 19:13\n * Title : 1049. 最后一块石头的",
"end": 109,
"score": 0.9974825382232666,
"start": 106,
"tag": "NAME",
"value": "Xin"
}
] | null | [] | package com.xinzhe.categories.solutions.dp.knapsack.knapsack01;
import java.util.Arrays;
/**
* @author Xin
* @date 2020/3/20 19:13
* Title : 1049. 最后一块石头的重量 II
* Description : 有一堆石头,每块石头的重量都是正整数。
*
* 每一回合,从中选出两块最重的石头,然后将它们一起粉碎。假设石头的重量分别为 x 和 y,且 x <= y。那么粉碎的可能结果如下:
*
* 如果 x == y,那么两块石头都会被完全粉碎;
* 如果 x != y,那么重量为 x 的石头将会完全粉碎,而重量为 y 的石头新重量为 y-x。
* 最后,最多只会剩下一块石头。返回此石头最小的可能重量。如果没有石头剩下,就返回 0。
* link : https://leetcode-cn.com/problems/last-stone-weight-ii/
* Level : Medium
*/
//todo need to review
public class Leetcode1049 {
public int lastStoneWeight(int[] stones) {
if (stones.length == 0) return 0;
int all = Arrays.stream(stones).sum();
int sum = all / 2;
int[] dp = new int[sum + 1];
for (int stone : stones) {
for (int i = sum; i >= stone; i--) {
dp[i] = Math.max(dp[i], dp[i - stone] + stone);
}
}
return all - 2 * dp[sum];
}
public int lastStoneWeightII(int[] stones) {
int sum = 0;
for(int i: stones) sum += i;
int target = sum / 2;
boolean[] dp = new boolean[target + 1];
dp[0] = true;
int min = sum;
for(int s : stones) {
for(int i = target; i >= s; i--) {
if(dp[i-s]) {
dp[i] = true;
}
}
}
for(int i=target; i >= 0; i--) {
if(dp[i]) min = Math.min(min, sum - i * 2);
}
return min;
}
} | 1,835 | 0.511674 | 0.48966 | 53 | 27.301888 | 18.72299 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.471698 | false | false | 7 |
9e91e8144006feb826fdec3fb5bfa7c4a3f87030 | 14,869,176,824,946 | 4e0134240a6f13d294596dfdfeac72c51e2e09bd | /src/JavaTest/src/main/java/com/java/serializable/AbstractFoo.java | 0d2470bc8694d5b275e867574c272a1413260cf5 | [] | no_license | liuzhengqiu1127/QStudyPlan | https://github.com/liuzhengqiu1127/QStudyPlan | 186e89656f9922024df20ba0cc4cbf8389ad5c13 | d09cde66f384ebf69b494bdf730a5c2be7914e3d | refs/heads/master | 2019-09-24T10:30:26.731000 | 2019-09-24T09:23:22 | 2019-09-24T09:23:22 | 99,175,047 | 8 | 0 | null | false | 2017-08-03T02:01:06 | 2017-08-03T01:05:45 | 2017-08-03T01:05:45 | 2017-08-03T02:01:06 | 0 | 0 | 0 | 0 | null | null | null | package com.java.serializable;
import java.util.concurrent.atomic.AtomicReference;
public abstract class AbstractFoo {
private int x,y;
private enum State {NEW, INITIALIZING, INITIALIZED};
private final AtomicReference<State> init =
new AtomicReference<State>(State.NEW);
public AbstractFoo(int x, int y){initialize(x,y);}
protected AbstractFoo(){}
protected final void initialize(int x,int y){
if(!init.compareAndSet(State.NEW,State.INITIALIZING)){
throw new IllegalStateException("Already initialized.");
}
this.x = x;
this.y = y;
init.set(State.INITIALIZED);
}
protected final int getX(){checkInit();return this.x;}
protected final int getY(){checkInit();return this.y;}
private void checkInit(){
if(init.get() != State.INITIALIZED)
throw new IllegalStateException("Uninitialized");
}
}
| UTF-8 | Java | 920 | java | AbstractFoo.java | Java | [] | null | [] | package com.java.serializable;
import java.util.concurrent.atomic.AtomicReference;
public abstract class AbstractFoo {
private int x,y;
private enum State {NEW, INITIALIZING, INITIALIZED};
private final AtomicReference<State> init =
new AtomicReference<State>(State.NEW);
public AbstractFoo(int x, int y){initialize(x,y);}
protected AbstractFoo(){}
protected final void initialize(int x,int y){
if(!init.compareAndSet(State.NEW,State.INITIALIZING)){
throw new IllegalStateException("Already initialized.");
}
this.x = x;
this.y = y;
init.set(State.INITIALIZED);
}
protected final int getX(){checkInit();return this.x;}
protected final int getY(){checkInit();return this.y;}
private void checkInit(){
if(init.get() != State.INITIALIZED)
throw new IllegalStateException("Uninitialized");
}
}
| 920 | 0.663043 | 0.663043 | 26 | 34.384617 | 21.613878 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.846154 | false | false | 7 |
ffae2b8d8fe543e46516c1d4dc50ceea13754773 | 13,426,067,826,354 | eac9cc32a4e8e152d4db0d4e10631e11101f5273 | /src/main/java/ru/smith/ch03/annotated/name/AnnotatedBeanNaming.java | 6973f12eacfc6a1215b78ee0eac1d961964444ce | [] | no_license | smith1984/learning_spring5 | https://github.com/smith1984/learning_spring5 | 1abfd9160f12e191631672d1dbc0ccd1fcfbaa28 | fce32921285c38de97f993b1aebfb9e30f3b40d4 | refs/heads/master | 2020-05-01T10:54:08.396000 | 2020-03-22T08:51:57 | 2020-03-22T08:51:57 | 177,430,178 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ru.smith.ch03.annotated.name;
import org.springframework.context.support.GenericXmlApplicationContext;
import java.util.Map;
public class AnnotatedBeanNaming {
public static void main(String[] args) {
GenericXmlApplicationContext context = new GenericXmlApplicationContext();
context.load("classpath:spring/ch03/app-context-annotation_non_singleton.xml");
context.refresh();
Map<String, Singer> beans = context.getBeansOfType(Singer.class);
beans.forEach((k,v) -> System.out.println("id: " + k));
}
}
| UTF-8 | Java | 560 | java | AnnotatedBeanNaming.java | Java | [] | null | [] | package ru.smith.ch03.annotated.name;
import org.springframework.context.support.GenericXmlApplicationContext;
import java.util.Map;
public class AnnotatedBeanNaming {
public static void main(String[] args) {
GenericXmlApplicationContext context = new GenericXmlApplicationContext();
context.load("classpath:spring/ch03/app-context-annotation_non_singleton.xml");
context.refresh();
Map<String, Singer> beans = context.getBeansOfType(Singer.class);
beans.forEach((k,v) -> System.out.println("id: " + k));
}
}
| 560 | 0.721429 | 0.714286 | 15 | 36.333332 | 31.174063 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 7 |
da880730fbb0c61e1751839ec5e9872e61f403ee | 37,838,661,898,701 | bc36183096118934d501d859b7eca7cf6ed7732c | /src/com/distribuido/Conexion/Nodo/Zombie.java | f1225749edb4e3fb32669284722271aeba18283b | [] | no_license | AgenteAlfa/Zomberman | https://github.com/AgenteAlfa/Zomberman | 28250981e7857ca6b6dd5a0f6ab1e23d051896bd | 30ae766909a365c275657a32ec6a5094d83b5170 | refs/heads/master | 2023-03-19T06:39:58.002000 | 2021-03-01T09:02:00 | 2021-03-01T09:02:00 | 342,809,240 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.distribuido.Conexion.Nodo;
import com.distribuido.Ventana.ControladorZombie;
import com.distribuido.Ventana.Mapa;
import com.distribuido.Ventana.Ventana;
import java.io.IOException;
public class Zombie extends Nodo implements ControladorZombie.Acciones{
ControladorZombie mControlador;
public Zombie(int n) throws IOException, ClassNotFoundException {
super(n);
System.out.println("EJECUTANDO CODIGO ZOMIBIE");
System.out.println("Debo enfocar : " + (mComunicacion.Posicion + 1));
mControlador = new ControladorZombie((Mapa) getOISJuego().readObject() , mComunicacion.Posicion + 1, this);
System.out.println("CONTROLADOR ZOMBIECREADO");
mListener = mControlador;
System.out.println("Se recibio mapa");
Empezar();
System.out.println("TERMINANDO CODIGO ZOMIBIE");
}
@Override
protected Mapa GetMapa() {
return mControlador.getmMapa();
}
@Override
public void BuscarCerebros(int direccion) {
//Se envia la tecla al escenario
System.out.println("Tecla " + direccion);
setData((char) direccion);
}
}
| UTF-8 | Java | 1,156 | java | Zombie.java | Java | [] | null | [] | package com.distribuido.Conexion.Nodo;
import com.distribuido.Ventana.ControladorZombie;
import com.distribuido.Ventana.Mapa;
import com.distribuido.Ventana.Ventana;
import java.io.IOException;
public class Zombie extends Nodo implements ControladorZombie.Acciones{
ControladorZombie mControlador;
public Zombie(int n) throws IOException, ClassNotFoundException {
super(n);
System.out.println("EJECUTANDO CODIGO ZOMIBIE");
System.out.println("Debo enfocar : " + (mComunicacion.Posicion + 1));
mControlador = new ControladorZombie((Mapa) getOISJuego().readObject() , mComunicacion.Posicion + 1, this);
System.out.println("CONTROLADOR ZOMBIECREADO");
mListener = mControlador;
System.out.println("Se recibio mapa");
Empezar();
System.out.println("TERMINANDO CODIGO ZOMIBIE");
}
@Override
protected Mapa GetMapa() {
return mControlador.getmMapa();
}
@Override
public void BuscarCerebros(int direccion) {
//Se envia la tecla al escenario
System.out.println("Tecla " + direccion);
setData((char) direccion);
}
}
| 1,156 | 0.689446 | 0.687716 | 37 | 30.243244 | 27.113779 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.567568 | false | false | 7 |
e638beccb86f548240e969001e9e4b2c731975b2 | 21,543,556,017,950 | 0986005fcc72a332e787ed24f7adcd119eda21e0 | /meidianyi-common/src/main/java/com/meidianyi/shop/service/pojo/shop/summary/visit/AccessRetain.java | 35b4a2eda4ae637fa6b2f022981125bc21fb08ad | [] | no_license | moutainhigh/meidianyishop | https://github.com/moutainhigh/meidianyishop | 73ae414649175f7277d60b385a53987d904b1f1c | bd82267d824d4dfe2333622393fde45ac0a78911 | refs/heads/main | 2023-03-04T11:25:50.640000 | 2021-02-17T04:59:37 | 2021-02-17T04:59:37 | 342,996,236 | 0 | 1 | null | true | 2021-02-28T01:31:23 | 2021-02-28T01:31:23 | 2021-02-17T05:00:17 | 2021-02-17T05:00:03 | 10,179 | 0 | 0 | 0 | null | false | false | package com.meidianyi.shop.service.pojo.shop.summary.visit;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 留存统计
*
* @author 郑保乐
*/
@Data
public class AccessRetain {
private String refDate;
private Integer sum;
private Map<Integer,Integer> data;
}
| UTF-8 | Java | 305 | java | AccessRetain.java | Java | [
{
"context": "\nimport java.util.Map;\n\n/**\n * 留存统计\n *\n * @author 郑保乐\n */\n@Data\npublic class AccessRetain {\n\n privat",
"end": 157,
"score": 0.9997592568397522,
"start": 154,
"tag": "NAME",
"value": "郑保乐"
}
] | null | [] | package com.meidianyi.shop.service.pojo.shop.summary.visit;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 留存统计
*
* @author 郑保乐
*/
@Data
public class AccessRetain {
private String refDate;
private Integer sum;
private Map<Integer,Integer> data;
}
| 305 | 0.707904 | 0.707904 | 19 | 14.315789 | 15.634149 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.421053 | false | false | 7 |
6f577ac0cf2178226afd0de777a67df5c9b97472 | 37,563,783,986,414 | f8606dd0895c289504df9ac6a6def19c3dab637e | /app/src/main/java/app/waynechen/stylish/MainActivity.java | b75eb06f0b40df377704d1b4fce88450f9379e04 | [] | no_license | cmFodWx5YWRhdjEyMTA5/Stylish2.0 | https://github.com/cmFodWx5YWRhdjEyMTA5/Stylish2.0 | 57ba886091e73f3ed6278e87df4a251460c23cfb | 31baf4efef5774374fe8f8c99e3a085d667eef5a | refs/heads/master | 2020-05-14T14:43:57.561000 | 2019-03-15T08:13:31 | 2019-03-15T08:13:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package app.waynechen.stylish;
import static com.google.common.base.Preconditions.checkNotNull;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.internal.BottomNavigationItemView;
import android.support.design.internal.BottomNavigationMenuView;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import app.waynechen.stylish.catalog.item.CatalogItemFragment;
import app.waynechen.stylish.component.ProfileAvatarOutlineProvider;
import app.waynechen.stylish.data.Product;
import app.waynechen.stylish.dialog.LoginDialog;
import app.waynechen.stylish.dialog.MessageDialog;
import app.waynechen.stylish.util.Constants;
import app.waynechen.stylish.util.ImageManager;
import app.waynechen.stylish.util.UserManager;
/**
* Created by Wayne Chen on Feb. 2019.
*/
public class MainActivity extends BaseActivivty implements MainContract.View,
NavigationView.OnNavigationItemSelectedListener {
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mActionBarDrawerToggle;
private BottomNavigationView mBottomNavigation;
private Toolbar mToolbar;
private TextView mToolbarTitle;
private ImageView mToolbarLogo;
private LoginDialog mLoginDialog;
private MessageDialog mMessageDialog;
private View mBadge;
private ImageView mDrawerUserImage;
private TextView mDrawerUserName;
private TextView mDrawerUserInfo;
private MainMvpController mMainMvpController;
private MainContract.Presenter mPresenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(this, LogoActivity.class));
init();
}
private void init() {
setContentView(R.layout.activity_main);
mMainMvpController = MainMvpController.create(this);
mPresenter.openHots();
setToolbar();
setBottomNavigation();
setDrawerLayout();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
UserManager.getInstance().getFbCallbackManager().onActivityResult(requestCode, resultCode, data);
}
/**
* Let toolbar to extend to status bar.
*
* @notice this method have to be used after setContentView.
*/
private void setToolbar() {
// Retrieve the AppCompact Toolbar
mToolbar = findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle("");
// Set the padding to match the Status Bar height
mToolbar.setPadding(0, getStatusBarHeight(), 0, 0);
mToolbarTitle = mToolbar.findViewById(R.id.text_toolbar_title);
mToolbarLogo = mToolbar.findViewById(R.id.image_toolbar_logo);
}
/**
* Set the title of toolbar.
*
* @param title:
*/
@Override
public void setToolbarTitleUi(String title) {
if ("".equals(title)) {
mToolbarTitle.setVisibility(View.GONE);
mToolbarLogo.setVisibility(View.VISIBLE);
} else {
if (title.equals(getString(R.string.payment))) {
mActionBarDrawerToggle.setDrawerIndicatorEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationIcon(R.drawable.toolbar_back);
mActionBarDrawerToggle.setToolbarNavigationClickListener(v -> onBackPressed());
} else {
mActionBarDrawerToggle.setDrawerIndicatorEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
mToolbar.setNavigationIcon(R.drawable.toolbar_menu);
mActionBarDrawerToggle.setToolbarNavigationClickListener(null);
}
mToolbarLogo.setVisibility(View.GONE);
mToolbarTitle.setVisibility(View.VISIBLE);
mToolbarTitle.setText(title);
}
}
@Override
public void closeDrawerUi() {
mDrawerLayout.closeDrawers();
}
@Override
public void showDrawerUserUi() {
ImageManager.getInstance().setImageByUrl(mDrawerUserImage,
UserManager.getInstance().getUser().getPicture());
mDrawerUserName.setText(UserManager.getInstance().getUser().getName());
mDrawerUserInfo.setText(UserManager.getInstance().getUserInfo());
}
/**
* plugin: BottomNavigationViewEx.
*/
private void setBottomNavigation() {
mBottomNavigation = findViewById(R.id.bottom_navigation_main);
mBottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
BottomNavigationMenuView menuView =
(BottomNavigationMenuView) mBottomNavigation.getChildAt(0);
for (int i = 0; i < menuView.getChildCount(); i++) {
final View iconView = menuView.getChildAt(i).findViewById(android.support.design.R.id.icon);
final ViewGroup.LayoutParams layoutParams = iconView.getLayoutParams();
layoutParams.height = (int) getResources().getDimension(R.dimen.size_bottom_nav_icon);
layoutParams.width = (int) getResources().getDimension(R.dimen.size_bottom_nav_icon);
iconView.setLayoutParams(layoutParams);
}
BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(2);
mBadge = LayoutInflater.from(this)
.inflate(R.layout.badge_main_bottom, itemView, true);
mPresenter.updateCartBadge();
}
/**
* Set Drawer
*/
private void setDrawerLayout() {
mDrawerLayout = (DrawerLayout) findViewById(R.id.layout_main);
mDrawerLayout.setFitsSystemWindows(true);
mDrawerLayout.setClipToPadding(false);
mActionBarDrawerToggle = new ActionBarDrawerToggle(
this, mDrawerLayout, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
mPresenter.onDrawerOpened();
}
};
mDrawerLayout.addDrawerListener(mActionBarDrawerToggle);
mActionBarDrawerToggle.syncState();
NavigationView navigationView = findViewById(R.id.navigation_drawer);
navigationView.setNavigationItemSelectedListener(this);
// nav view header
mDrawerUserImage = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_avatar);
mDrawerUserImage.setOutlineProvider(new ProfileAvatarOutlineProvider());
mDrawerUserImage.setOnClickListener(v -> mPresenter.onClickDrawerAvatar());
mDrawerUserName = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_name);
mDrawerUserInfo = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_info);
}
/**
* @return height of status bar
*/
public int getStatusBarHeight() {
int result = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
return result;
}
/**
* It's the item selected listener of bottom navigation.
*/
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener = item -> {
switch (item.getItemId()) {
case R.id.navigation_home:
mPresenter.updateToolbar("");
mPresenter.openHots();
return true;
case R.id.navigation_catalog:
mPresenter.updateToolbar(getResources().getString(R.string.catalog));
mPresenter.openCatalog();
return true;
case R.id.navigation_cart:
mPresenter.updateToolbar(getResources().getString(R.string.cart));
mPresenter.openCart();
return true;
case R.id.navigation_profile:
if (mPresenter.openProfile()) {
mPresenter.updateToolbar(getResources().getString(R.string.profile));
return true;
}
return false;
default:
return false;
}
};
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
public void onBackPressed() {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
// Handle navigation view item clicks here.
String string = "";
switch (item.getItemId()) {
case R.id.nav_awaiting_payment:
string = getString(R.string.awaiting_payment);
break;
case R.id.nav_awaiting_shipment:
string = getString(R.string.awaiting_shipment);
break;
case R.id.nav_shipped:
string = getString(R.string.shipped);
break;
case R.id.nav_awaiting_review:
string = getString(R.string.awaiting_review);
break;
case R.id.nav_exchange:
string = getString(R.string.exchange);
break;
default:
}
Toast.makeText(this, getString(R.string._coming_soon, string), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public void setPresenter(MainContract.Presenter presenter) {
mPresenter = checkNotNull(presenter);
}
@Override
public void openHotsUi() {
mMainMvpController.findOrCreateHotsView();
}
@Override
public void openCatalogUi() {
mMainMvpController.findOrCreateCatalogView();
}
@Override
public void openProfileUi() {
mMainMvpController.findOrCreateProfileView();
}
@Override
public void openCartUi() {
mMainMvpController.findOrCreateCartView();
}
@Override
public void openPaymentUi() {
mPresenter.updateToolbar(getResources().getString(R.string.payment));
mMainMvpController.findOrCreatePaymentView();
}
@Override
public void openAdd2CartUi(Product product) {
mMainMvpController.findOrCreateAdd2CartView(product);
}
@Override
public void openCheckOutSuccessUi() {
mMainMvpController.findOrCreateCheckOutSuccessView();
}
@Override
public void openDetailUi(Product product) {
mMainMvpController.findOrCreateDetailView(product);
}
@Override
public void finishDetailUi() {
getSupportFragmentManager().popBackStack();
}
@Override
public void finishPaymentUi() {
getSupportFragmentManager().popBackStack();
}
@Override
public CatalogItemFragment findWomenView() {
return mMainMvpController.findOrCreateWomenView();
}
@Override
public CatalogItemFragment findMenView() {
return mMainMvpController.findOrCreateMenView();
}
@Override
public CatalogItemFragment findAccessoriesView() {
return mMainMvpController.findOrCreateAccessoriesView();
}
@Override
public void switchProfileUiInitiative() {
mBottomNavigation.setSelectedItemId(R.id.navigation_profile);
}
@Override
public void switchHotsUiInitiative() {
mBottomNavigation.setSelectedItemId(R.id.navigation_home);
}
@Override
public void openLoginUi(int loginFrom) {
if (mLoginDialog == null) {
mLoginDialog = new LoginDialog();
mLoginDialog.setMainPresenter(mPresenter);
mLoginDialog.setLoginFrom(loginFrom);
mLoginDialog.show(getSupportFragmentManager(), Constants.LOGIN);
} else if (!mLoginDialog.isAdded()) {
mLoginDialog.setLoginFrom(loginFrom);
mLoginDialog.show(getSupportFragmentManager(), Constants.LOGIN);
}
}
@Override
public void showMessageDialogUi(@MessageDialog.MessageType int type) {
if (mMessageDialog == null) {
mMessageDialog = new MessageDialog();
mMessageDialog.setMessage(type);
mMessageDialog.show(getSupportFragmentManager(), "");
} else if (!mMessageDialog.isAdded()) {
mMessageDialog.setMessage(type);
mMessageDialog.show(getSupportFragmentManager(), "");
}
}
@Override
public void showToastUi(String message) {
Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
@Override
public void hideToolbarUi() {
mToolbar.setVisibility(View.GONE);
}
@Override
public void showToolbarUi() {
mToolbar.setVisibility(View.VISIBLE);
}
@Override
public void hideBottomNavigationUi() {
mBottomNavigation.setVisibility(View.GONE);
}
@Override
public void showBottomNavigationUi() {
mBottomNavigation.setVisibility(View.VISIBLE);
}
@Override
public void updateCartBadgeUi(int amount) {
if (amount > 0) {
mBadge.findViewById(R.id.text_badge_main).setVisibility(View.VISIBLE);
((TextView) mBadge.findViewById(R.id.text_badge_main)).setText(String.valueOf(amount));
} else {
mBadge.findViewById(R.id.text_badge_main).setVisibility(View.GONE);
}
}
}
| UTF-8 | Java | 14,288 | java | MainActivity.java | Java | [
{
"context": "echen.stylish.util.UserManager;\n\n/**\n * Created by Wayne Chen on Feb. 2019.\n */\npublic class MainActivity exten",
"end": 1319,
"score": 0.9998427033424377,
"start": 1309,
"tag": "NAME",
"value": "Wayne Chen"
}
] | null | [] | package app.waynechen.stylish;
import static com.google.common.base.Preconditions.checkNotNull;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.internal.BottomNavigationItemView;
import android.support.design.internal.BottomNavigationMenuView;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import app.waynechen.stylish.catalog.item.CatalogItemFragment;
import app.waynechen.stylish.component.ProfileAvatarOutlineProvider;
import app.waynechen.stylish.data.Product;
import app.waynechen.stylish.dialog.LoginDialog;
import app.waynechen.stylish.dialog.MessageDialog;
import app.waynechen.stylish.util.Constants;
import app.waynechen.stylish.util.ImageManager;
import app.waynechen.stylish.util.UserManager;
/**
* Created by <NAME> on Feb. 2019.
*/
public class MainActivity extends BaseActivivty implements MainContract.View,
NavigationView.OnNavigationItemSelectedListener {
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mActionBarDrawerToggle;
private BottomNavigationView mBottomNavigation;
private Toolbar mToolbar;
private TextView mToolbarTitle;
private ImageView mToolbarLogo;
private LoginDialog mLoginDialog;
private MessageDialog mMessageDialog;
private View mBadge;
private ImageView mDrawerUserImage;
private TextView mDrawerUserName;
private TextView mDrawerUserInfo;
private MainMvpController mMainMvpController;
private MainContract.Presenter mPresenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(this, LogoActivity.class));
init();
}
private void init() {
setContentView(R.layout.activity_main);
mMainMvpController = MainMvpController.create(this);
mPresenter.openHots();
setToolbar();
setBottomNavigation();
setDrawerLayout();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
UserManager.getInstance().getFbCallbackManager().onActivityResult(requestCode, resultCode, data);
}
/**
* Let toolbar to extend to status bar.
*
* @notice this method have to be used after setContentView.
*/
private void setToolbar() {
// Retrieve the AppCompact Toolbar
mToolbar = findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle("");
// Set the padding to match the Status Bar height
mToolbar.setPadding(0, getStatusBarHeight(), 0, 0);
mToolbarTitle = mToolbar.findViewById(R.id.text_toolbar_title);
mToolbarLogo = mToolbar.findViewById(R.id.image_toolbar_logo);
}
/**
* Set the title of toolbar.
*
* @param title:
*/
@Override
public void setToolbarTitleUi(String title) {
if ("".equals(title)) {
mToolbarTitle.setVisibility(View.GONE);
mToolbarLogo.setVisibility(View.VISIBLE);
} else {
if (title.equals(getString(R.string.payment))) {
mActionBarDrawerToggle.setDrawerIndicatorEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationIcon(R.drawable.toolbar_back);
mActionBarDrawerToggle.setToolbarNavigationClickListener(v -> onBackPressed());
} else {
mActionBarDrawerToggle.setDrawerIndicatorEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
mToolbar.setNavigationIcon(R.drawable.toolbar_menu);
mActionBarDrawerToggle.setToolbarNavigationClickListener(null);
}
mToolbarLogo.setVisibility(View.GONE);
mToolbarTitle.setVisibility(View.VISIBLE);
mToolbarTitle.setText(title);
}
}
@Override
public void closeDrawerUi() {
mDrawerLayout.closeDrawers();
}
@Override
public void showDrawerUserUi() {
ImageManager.getInstance().setImageByUrl(mDrawerUserImage,
UserManager.getInstance().getUser().getPicture());
mDrawerUserName.setText(UserManager.getInstance().getUser().getName());
mDrawerUserInfo.setText(UserManager.getInstance().getUserInfo());
}
/**
* plugin: BottomNavigationViewEx.
*/
private void setBottomNavigation() {
mBottomNavigation = findViewById(R.id.bottom_navigation_main);
mBottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
BottomNavigationMenuView menuView =
(BottomNavigationMenuView) mBottomNavigation.getChildAt(0);
for (int i = 0; i < menuView.getChildCount(); i++) {
final View iconView = menuView.getChildAt(i).findViewById(android.support.design.R.id.icon);
final ViewGroup.LayoutParams layoutParams = iconView.getLayoutParams();
layoutParams.height = (int) getResources().getDimension(R.dimen.size_bottom_nav_icon);
layoutParams.width = (int) getResources().getDimension(R.dimen.size_bottom_nav_icon);
iconView.setLayoutParams(layoutParams);
}
BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(2);
mBadge = LayoutInflater.from(this)
.inflate(R.layout.badge_main_bottom, itemView, true);
mPresenter.updateCartBadge();
}
/**
* Set Drawer
*/
private void setDrawerLayout() {
mDrawerLayout = (DrawerLayout) findViewById(R.id.layout_main);
mDrawerLayout.setFitsSystemWindows(true);
mDrawerLayout.setClipToPadding(false);
mActionBarDrawerToggle = new ActionBarDrawerToggle(
this, mDrawerLayout, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
mPresenter.onDrawerOpened();
}
};
mDrawerLayout.addDrawerListener(mActionBarDrawerToggle);
mActionBarDrawerToggle.syncState();
NavigationView navigationView = findViewById(R.id.navigation_drawer);
navigationView.setNavigationItemSelectedListener(this);
// nav view header
mDrawerUserImage = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_avatar);
mDrawerUserImage.setOutlineProvider(new ProfileAvatarOutlineProvider());
mDrawerUserImage.setOnClickListener(v -> mPresenter.onClickDrawerAvatar());
mDrawerUserName = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_name);
mDrawerUserInfo = navigationView.getHeaderView(0).findViewById(R.id.image_drawer_info);
}
/**
* @return height of status bar
*/
public int getStatusBarHeight() {
int result = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
return result;
}
/**
* It's the item selected listener of bottom navigation.
*/
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener = item -> {
switch (item.getItemId()) {
case R.id.navigation_home:
mPresenter.updateToolbar("");
mPresenter.openHots();
return true;
case R.id.navigation_catalog:
mPresenter.updateToolbar(getResources().getString(R.string.catalog));
mPresenter.openCatalog();
return true;
case R.id.navigation_cart:
mPresenter.updateToolbar(getResources().getString(R.string.cart));
mPresenter.openCart();
return true;
case R.id.navigation_profile:
if (mPresenter.openProfile()) {
mPresenter.updateToolbar(getResources().getString(R.string.profile));
return true;
}
return false;
default:
return false;
}
};
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
public void onBackPressed() {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
// Handle navigation view item clicks here.
String string = "";
switch (item.getItemId()) {
case R.id.nav_awaiting_payment:
string = getString(R.string.awaiting_payment);
break;
case R.id.nav_awaiting_shipment:
string = getString(R.string.awaiting_shipment);
break;
case R.id.nav_shipped:
string = getString(R.string.shipped);
break;
case R.id.nav_awaiting_review:
string = getString(R.string.awaiting_review);
break;
case R.id.nav_exchange:
string = getString(R.string.exchange);
break;
default:
}
Toast.makeText(this, getString(R.string._coming_soon, string), Toast.LENGTH_SHORT).show();
return true;
}
@Override
public void setPresenter(MainContract.Presenter presenter) {
mPresenter = checkNotNull(presenter);
}
@Override
public void openHotsUi() {
mMainMvpController.findOrCreateHotsView();
}
@Override
public void openCatalogUi() {
mMainMvpController.findOrCreateCatalogView();
}
@Override
public void openProfileUi() {
mMainMvpController.findOrCreateProfileView();
}
@Override
public void openCartUi() {
mMainMvpController.findOrCreateCartView();
}
@Override
public void openPaymentUi() {
mPresenter.updateToolbar(getResources().getString(R.string.payment));
mMainMvpController.findOrCreatePaymentView();
}
@Override
public void openAdd2CartUi(Product product) {
mMainMvpController.findOrCreateAdd2CartView(product);
}
@Override
public void openCheckOutSuccessUi() {
mMainMvpController.findOrCreateCheckOutSuccessView();
}
@Override
public void openDetailUi(Product product) {
mMainMvpController.findOrCreateDetailView(product);
}
@Override
public void finishDetailUi() {
getSupportFragmentManager().popBackStack();
}
@Override
public void finishPaymentUi() {
getSupportFragmentManager().popBackStack();
}
@Override
public CatalogItemFragment findWomenView() {
return mMainMvpController.findOrCreateWomenView();
}
@Override
public CatalogItemFragment findMenView() {
return mMainMvpController.findOrCreateMenView();
}
@Override
public CatalogItemFragment findAccessoriesView() {
return mMainMvpController.findOrCreateAccessoriesView();
}
@Override
public void switchProfileUiInitiative() {
mBottomNavigation.setSelectedItemId(R.id.navigation_profile);
}
@Override
public void switchHotsUiInitiative() {
mBottomNavigation.setSelectedItemId(R.id.navigation_home);
}
@Override
public void openLoginUi(int loginFrom) {
if (mLoginDialog == null) {
mLoginDialog = new LoginDialog();
mLoginDialog.setMainPresenter(mPresenter);
mLoginDialog.setLoginFrom(loginFrom);
mLoginDialog.show(getSupportFragmentManager(), Constants.LOGIN);
} else if (!mLoginDialog.isAdded()) {
mLoginDialog.setLoginFrom(loginFrom);
mLoginDialog.show(getSupportFragmentManager(), Constants.LOGIN);
}
}
@Override
public void showMessageDialogUi(@MessageDialog.MessageType int type) {
if (mMessageDialog == null) {
mMessageDialog = new MessageDialog();
mMessageDialog.setMessage(type);
mMessageDialog.show(getSupportFragmentManager(), "");
} else if (!mMessageDialog.isAdded()) {
mMessageDialog.setMessage(type);
mMessageDialog.show(getSupportFragmentManager(), "");
}
}
@Override
public void showToastUi(String message) {
Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
@Override
public void hideToolbarUi() {
mToolbar.setVisibility(View.GONE);
}
@Override
public void showToolbarUi() {
mToolbar.setVisibility(View.VISIBLE);
}
@Override
public void hideBottomNavigationUi() {
mBottomNavigation.setVisibility(View.GONE);
}
@Override
public void showBottomNavigationUi() {
mBottomNavigation.setVisibility(View.VISIBLE);
}
@Override
public void updateCartBadgeUi(int amount) {
if (amount > 0) {
mBadge.findViewById(R.id.text_badge_main).setVisibility(View.VISIBLE);
((TextView) mBadge.findViewById(R.id.text_badge_main)).setText(String.valueOf(amount));
} else {
mBadge.findViewById(R.id.text_badge_main).setVisibility(View.GONE);
}
}
}
| 14,284 | 0.661394 | 0.659714 | 454 | 30.471365 | 27.473942 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.45815 | false | false | 7 |
303c9c32dc27ca6eef437dcc36983107e7111558 | 33,818,572,531,085 | 24fd369e7131599fd5cf61f07fa566803382f61f | /07. Spring data Auto mapping/lab-auto-mapping/src/main/java/app/Terminal.java | f0376ff1539671778d08894570571b4fcc46b3b9 | [
"MIT"
] | permissive | bborisov11/Java-Frameworks-Hibernate-Spring | https://github.com/bborisov11/Java-Frameworks-Hibernate-Spring | 0a8f6c1d7c7c10f3ebb9d1f407e4130eb923bfc4 | 60fb1c380566efb904a550ae0aac26e0979b095b | refs/heads/master | 2020-04-08T07:40:11.767000 | 2018-12-04T19:59:40 | 2018-12-04T19:59:40 | 159,147,210 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package app;
import app.dtos.EmployeeDto;
import app.dtos.ManagerDto;
import app.entities.Address;
import app.entities.Employee;
import app.repositories.AddressRepository;
import app.repositories.EmployeeRepository;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@Component
public class Terminal implements CommandLineRunner {
//field interface service
//@autowired constructor
//run method
private AddressRepository addressRepository;
private EmployeeRepository employeeRepository;
@Autowired
public Terminal(AddressRepository addressRepository, EmployeeRepository employeeRepository) {
this.addressRepository = addressRepository;
this.employeeRepository = employeeRepository;
}
@Override
public void run(String... args) throws Exception {
Address address = new Address();
// Employee employee = new Employee();
//Employee employee = this.employeeRepository.findById(1);
Optional<Employee> employee = this.employeeRepository.findById(1);
List<Employee> managers = this.employeeRepository.findByManagerIsNotNull();
//for (Employee manager : managers) {
// System.out.println(manager.getFirstName());
// for (Employee employee1 : manager.getEmployees()) {
// System.out.println(employee1.getFirstName());
// }
//}
Employee first = new Employee();
if(employee.isPresent()) {
first = employee.get();
}
ModelMapper mapper = new ModelMapper();
EmployeeDto dto = mapper.map(first, EmployeeDto.class);
//System.out.println(dto.getFirstName()+" "+dto.getLastName());
ManagerDto managerDto = mapper.map(first, ManagerDto.class);
// for (EmployeeDto emp : managerDto.getEmployees()) {
// System.out.print(emp.getFirstName()+" "+emp.getLastName()+" | Employees: ");
// }
List<Employee> emp = this.employeeRepository.findByBirthdateAfter(LocalDate.parse("1990-01-01"));
for (Employee employee1 : emp) {
System.out.println(employee1.getFirstName());
}
//addressRepository.save(address);
//employeeRepository.save(employee);
}
}
| UTF-8 | Java | 2,492 | java | Terminal.java | Java | [] | null | [] | package app;
import app.dtos.EmployeeDto;
import app.dtos.ManagerDto;
import app.entities.Address;
import app.entities.Employee;
import app.repositories.AddressRepository;
import app.repositories.EmployeeRepository;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@Component
public class Terminal implements CommandLineRunner {
//field interface service
//@autowired constructor
//run method
private AddressRepository addressRepository;
private EmployeeRepository employeeRepository;
@Autowired
public Terminal(AddressRepository addressRepository, EmployeeRepository employeeRepository) {
this.addressRepository = addressRepository;
this.employeeRepository = employeeRepository;
}
@Override
public void run(String... args) throws Exception {
Address address = new Address();
// Employee employee = new Employee();
//Employee employee = this.employeeRepository.findById(1);
Optional<Employee> employee = this.employeeRepository.findById(1);
List<Employee> managers = this.employeeRepository.findByManagerIsNotNull();
//for (Employee manager : managers) {
// System.out.println(manager.getFirstName());
// for (Employee employee1 : manager.getEmployees()) {
// System.out.println(employee1.getFirstName());
// }
//}
Employee first = new Employee();
if(employee.isPresent()) {
first = employee.get();
}
ModelMapper mapper = new ModelMapper();
EmployeeDto dto = mapper.map(first, EmployeeDto.class);
//System.out.println(dto.getFirstName()+" "+dto.getLastName());
ManagerDto managerDto = mapper.map(first, ManagerDto.class);
// for (EmployeeDto emp : managerDto.getEmployees()) {
// System.out.print(emp.getFirstName()+" "+emp.getLastName()+" | Employees: ");
// }
List<Employee> emp = this.employeeRepository.findByBirthdateAfter(LocalDate.parse("1990-01-01"));
for (Employee employee1 : emp) {
System.out.println(employee1.getFirstName());
}
//addressRepository.save(address);
//employeeRepository.save(employee);
}
}
| 2,492 | 0.6874 | 0.681782 | 74 | 32.662163 | 26.899853 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.554054 | false | false | 7 |
86f6002c6e9ea41f4b004b4223974c390d26b291 | 37,933,151,170,285 | 5f40bb7cc22755f81a209b46569056b913c5c16c | /Day5/src/demo/B.java | e38afa6b4e5d4adba10b8f19d202f7ad40deb379 | [] | no_license | HughNiu/NewJavaSE | https://github.com/HughNiu/NewJavaSE | d17dd805b2439aaf13e30da056e59e0e67872bac | e900548388dab23416704468841cac56b9d6bcdb | refs/heads/master | 2016-08-05T22:21:23.770000 | 2013-07-31T09:02:46 | 2013-07-31T09:02:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package demo;
/**
* Created by Administrator on 13-7-25.
*/
public interface B {
double THREE = 3.0;
double FOUR = 4.0;
void m3();
}
| UTF-8 | Java | 148 | java | B.java | Java | [] | null | [] | package demo;
/**
* Created by Administrator on 13-7-25.
*/
public interface B {
double THREE = 3.0;
double FOUR = 4.0;
void m3();
}
| 148 | 0.587838 | 0.52027 | 10 | 13.8 | 11.889491 | 39 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 7 |
e2d1c135ba435e3383318d51c8f0ef9811f85d6e | 94,489,344,675 | c5159298809ed14b8a6be14a727705089493c1dd | /src/main/java/com/google/enterprise/secmgr/ssl/SslContextFactory.java | dda7784b260484e5b07855cc347cd6f54b0c959a | [
"Apache-2.0"
] | permissive | googlegsa/secmgr | https://github.com/googlegsa/secmgr | 42966000b1558a54fdeade28ec4d54f1e1700536 | 2bddd2a8564973a4bf14e99e950d58a692159765 | refs/heads/master | 2023-09-03T19:42:47.389000 | 2019-07-26T01:24:52 | 2019-07-26T01:24:52 | 133,093,317 | 2 | 3 | Apache-2.0 | false | 2023-08-18T17:08:31 | 2018-05-11T22:13:05 | 2023-05-21T15:42:29 | 2023-08-18T17:08:27 | 1,813 | 2 | 7 | 10 | Java | false | false | /*
* Copyright 2011 Google Inc.
*
* 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.google.enterprise.secmgr.ssl;
import com.google.enterprise.secmgr.config.ConfigSingleton;
import com.google.enterprise.secmgr.config.SecurityManagerConfig;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import java.util.Observable;
import java.util.Observer;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.Immutable;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
/**
* A factory that generates {@link SSLContext} instances for the GSA's credentials.
*/
@Immutable
@ParametersAreNonnullByDefault
public final class SslContextFactory {
public static final Logger logger = Logger.getLogger(SslContextFactory.class.getName());
@GuardedBy("SslContextFactory.class") private static SslContextFactory instance = null;
static {
ConfigSingleton.addObserver(
new Observer() {
@Override
public void update(Observable observable, Object argument) {
synchronized (SslContextFactory.class) {
instance = null;
}
}
});
}
@Nullable private final KeyStore serverKeyStore;
@Nullable private final String serverKeyStorePassword;
@Nullable private final KeyStore cacertsTrustStore;
private final boolean checkServerCertificate;
private SslContextFactory(@Nullable KeyStore serverKeyStore,
@Nullable String serverKeyStorePassword, @Nullable KeyStore cacertsTrustStore,
boolean checkServerCertificate) {
this.serverKeyStore = serverKeyStore;
this.serverKeyStorePassword = serverKeyStorePassword;
this.cacertsTrustStore = cacertsTrustStore;
this.checkServerCertificate = checkServerCertificate;
}
private static synchronized SslContextFactory getInstance() {
if (instance == null) {
try {
instance = make(ConfigSingleton.getConfig());
} catch (IOException e) {
throw new IllegalStateException("Unable to load config: ", e);
}
}
return instance;
}
private static SslContextFactory make(SecurityManagerConfig config) {
KeyStore serverKeyStore;
try {
serverKeyStore = config.getServerKeyStore();
} catch (IOException e) {
logger.warning("Unable to get server key: " + e.getMessage());
serverKeyStore = null;
} catch (GeneralSecurityException e) {
logger.warning("Unable to get server key: " + e.getMessage());
serverKeyStore = null;
}
KeyStore cacertsTrustStore;
try {
cacertsTrustStore = config.getCacertsTrustStore();
} catch (IOException e) {
logger.warning("Unable to get CA certificates: " + e.getMessage());
cacertsTrustStore = null;
} catch (GeneralSecurityException e) {
logger.warning("Unable to get CA certificates: " + e.getMessage());
cacertsTrustStore = null;
}
return new SslContextFactory(
serverKeyStore,
config.getServerKeyStorePassword(),
cacertsTrustStore,
config.getCheckServerCertificate());
}
/**
* Gets an SSL context instance.
*/
@Nonnull
public static SSLContext createContext() {
return getInstance().createContextInternal();
}
/**
* Gets an SSL socket factory.
*/
@Nonnull
public static SSLSocketFactory getSocketFactory() {
return createContext().getSocketFactory();
}
private SSLContext createContextInternal() {
try {
SSLContext sslcontext = SSLContext.getInstance("SSL");
sslcontext.init(createKeyManagers(), createTrustManagers(), null);
return sslcontext;
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
}
private KeyManager[] createKeyManagers() {
if (serverKeyStore == null) {
logger.fine("No server key store available");
return null;
}
try {
Enumeration<String> aliases = serverKeyStore.aliases();
for (int i = 1; aliases.hasMoreElements(); i += 1) {
String alias = aliases.nextElement();
Certificate[] certificates = serverKeyStore.getCertificateChain(alias);
if (certificates != null) {
logger.fine("Certificate chain '" + alias + "':");
for (Certificate certificate : certificates) {
if (certificate instanceof X509Certificate) {
X509Certificate cert = (X509Certificate) certificate;
logger.fine(" Certificate " + i + ":");
logger.fine(" Subject DN: " + cert.getSubjectDN());
logger.fine(" Signature Algorithm: " + cert.getSigAlgName());
logger.fine(" Valid from: " + cert.getNotBefore());
logger.fine(" Valid until: " + cert.getNotAfter());
logger.fine(" Issuer: " + cert.getIssuerDN());
}
}
}
}
logger.fine("Initializing key manager");
KeyManagerFactory factory
= KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
factory.init(serverKeyStore,
(serverKeyStorePassword != null) ? serverKeyStorePassword.toCharArray() : null);
return factory.getKeyManagers();
} catch (GeneralSecurityException e) {
logger.warning("Error generating key managers: " + e.getMessage());
return null;
}
}
private TrustManager[] createTrustManagers() {
if (cacertsTrustStore == null) {
logger.fine("No CA certs available");
return null;
}
if (!checkServerCertificate) {
logger.fine("Using dummy trust manager: accept any server certificate.");
return new TrustManager[] { new DummyTrustManager() };
}
try {
Enumeration<String> aliases = cacertsTrustStore.aliases();
while (aliases.hasMoreElements()) {
String alias = aliases.nextElement();
logger.fine("Trusted certificate '" + alias + "':");
Certificate trustedcert = cacertsTrustStore.getCertificate(alias);
if (trustedcert != null && trustedcert instanceof X509Certificate) {
X509Certificate cert = (X509Certificate) trustedcert;
logger.fine(" Subject DN: " + cert.getSubjectDN());
logger.fine(" Signature Algorithm: " + cert.getSigAlgName());
logger.fine(" Valid from: " + cert.getNotBefore());
logger.fine(" Valid until: " + cert.getNotAfter());
logger.fine(" Issuer: " + cert.getIssuerDN());
}
}
logger.fine("Initializing trust manager");
TrustManagerFactory factory
= TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
factory.init(cacertsTrustStore);
return factory.getTrustManagers();
} catch (GeneralSecurityException e) {
logger.warning("Error generating trust managers: " + e.getMessage());
return null;
}
}
private static final class DummyTrustManager implements X509TrustManager {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
}
| UTF-8 | Java | 8,231 | java | SslContextFactory.java | Java | [
{
"context": " serverKeyStore;\n this.serverKeyStorePassword = serverKeyStorePassword;\n this.cacertsTrustStore = cac",
"end": 2668,
"score": 0.9475350975990295,
"start": 2662,
"tag": "PASSWORD",
"value": "server"
},
{
"context": ";\n this.serverKeyStorePassword = serverKeyS... | null | [] | /*
* Copyright 2011 Google Inc.
*
* 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.google.enterprise.secmgr.ssl;
import com.google.enterprise.secmgr.config.ConfigSingleton;
import com.google.enterprise.secmgr.config.SecurityManagerConfig;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
import java.util.Observable;
import java.util.Observer;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.Immutable;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
/**
* A factory that generates {@link SSLContext} instances for the GSA's credentials.
*/
@Immutable
@ParametersAreNonnullByDefault
public final class SslContextFactory {
public static final Logger logger = Logger.getLogger(SslContextFactory.class.getName());
@GuardedBy("SslContextFactory.class") private static SslContextFactory instance = null;
static {
ConfigSingleton.addObserver(
new Observer() {
@Override
public void update(Observable observable, Object argument) {
synchronized (SslContextFactory.class) {
instance = null;
}
}
});
}
@Nullable private final KeyStore serverKeyStore;
@Nullable private final String serverKeyStorePassword;
@Nullable private final KeyStore cacertsTrustStore;
private final boolean checkServerCertificate;
private SslContextFactory(@Nullable KeyStore serverKeyStore,
@Nullable String serverKeyStorePassword, @Nullable KeyStore cacertsTrustStore,
boolean checkServerCertificate) {
this.serverKeyStore = serverKeyStore;
this.serverKeyStorePassword = <PASSWORD>KeyStore<PASSWORD>;
this.cacertsTrustStore = cacertsTrustStore;
this.checkServerCertificate = checkServerCertificate;
}
private static synchronized SslContextFactory getInstance() {
if (instance == null) {
try {
instance = make(ConfigSingleton.getConfig());
} catch (IOException e) {
throw new IllegalStateException("Unable to load config: ", e);
}
}
return instance;
}
private static SslContextFactory make(SecurityManagerConfig config) {
KeyStore serverKeyStore;
try {
serverKeyStore = config.getServerKeyStore();
} catch (IOException e) {
logger.warning("Unable to get server key: " + e.getMessage());
serverKeyStore = null;
} catch (GeneralSecurityException e) {
logger.warning("Unable to get server key: " + e.getMessage());
serverKeyStore = null;
}
KeyStore cacertsTrustStore;
try {
cacertsTrustStore = config.getCacertsTrustStore();
} catch (IOException e) {
logger.warning("Unable to get CA certificates: " + e.getMessage());
cacertsTrustStore = null;
} catch (GeneralSecurityException e) {
logger.warning("Unable to get CA certificates: " + e.getMessage());
cacertsTrustStore = null;
}
return new SslContextFactory(
serverKeyStore,
config.getServerKeyStorePassword(),
cacertsTrustStore,
config.getCheckServerCertificate());
}
/**
* Gets an SSL context instance.
*/
@Nonnull
public static SSLContext createContext() {
return getInstance().createContextInternal();
}
/**
* Gets an SSL socket factory.
*/
@Nonnull
public static SSLSocketFactory getSocketFactory() {
return createContext().getSocketFactory();
}
private SSLContext createContextInternal() {
try {
SSLContext sslcontext = SSLContext.getInstance("SSL");
sslcontext.init(createKeyManagers(), createTrustManagers(), null);
return sslcontext;
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
}
private KeyManager[] createKeyManagers() {
if (serverKeyStore == null) {
logger.fine("No server key store available");
return null;
}
try {
Enumeration<String> aliases = serverKeyStore.aliases();
for (int i = 1; aliases.hasMoreElements(); i += 1) {
String alias = aliases.nextElement();
Certificate[] certificates = serverKeyStore.getCertificateChain(alias);
if (certificates != null) {
logger.fine("Certificate chain '" + alias + "':");
for (Certificate certificate : certificates) {
if (certificate instanceof X509Certificate) {
X509Certificate cert = (X509Certificate) certificate;
logger.fine(" Certificate " + i + ":");
logger.fine(" Subject DN: " + cert.getSubjectDN());
logger.fine(" Signature Algorithm: " + cert.getSigAlgName());
logger.fine(" Valid from: " + cert.getNotBefore());
logger.fine(" Valid until: " + cert.getNotAfter());
logger.fine(" Issuer: " + cert.getIssuerDN());
}
}
}
}
logger.fine("Initializing key manager");
KeyManagerFactory factory
= KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
factory.init(serverKeyStore,
(serverKeyStorePassword != null) ? serverKeyStorePassword.toCharArray() : null);
return factory.getKeyManagers();
} catch (GeneralSecurityException e) {
logger.warning("Error generating key managers: " + e.getMessage());
return null;
}
}
private TrustManager[] createTrustManagers() {
if (cacertsTrustStore == null) {
logger.fine("No CA certs available");
return null;
}
if (!checkServerCertificate) {
logger.fine("Using dummy trust manager: accept any server certificate.");
return new TrustManager[] { new DummyTrustManager() };
}
try {
Enumeration<String> aliases = cacertsTrustStore.aliases();
while (aliases.hasMoreElements()) {
String alias = aliases.nextElement();
logger.fine("Trusted certificate '" + alias + "':");
Certificate trustedcert = cacertsTrustStore.getCertificate(alias);
if (trustedcert != null && trustedcert instanceof X509Certificate) {
X509Certificate cert = (X509Certificate) trustedcert;
logger.fine(" Subject DN: " + cert.getSubjectDN());
logger.fine(" Signature Algorithm: " + cert.getSigAlgName());
logger.fine(" Valid from: " + cert.getNotBefore());
logger.fine(" Valid until: " + cert.getNotAfter());
logger.fine(" Issuer: " + cert.getIssuerDN());
}
}
logger.fine("Initializing trust manager");
TrustManagerFactory factory
= TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
factory.init(cacertsTrustStore);
return factory.getTrustManagers();
} catch (GeneralSecurityException e) {
logger.warning("Error generating trust managers: " + e.getMessage());
return null;
}
}
private static final class DummyTrustManager implements X509TrustManager {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
}
| 8,237 | 0.687523 | 0.681934 | 230 | 34.786957 | 25.547956 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.513043 | false | false | 7 |
a07c36046b40f39567e42eaaa6e86979459b2366 | 23,003,844,879,384 | 5dae77c761abaeb53c8da4bc8789a007124914d9 | /netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AuthenticationFailedException.java | 71509a1003452e3568fd37da87d5dbe1faf330c3 | [] | no_license | MollyHuang/netconf | https://github.com/MollyHuang/netconf | fcc2660aa82f190733605dec06a09d0a6e9ccd8a | cbd2ef8234d775215cd406c875d3828ad5a3ec04 | refs/heads/master | 2023-08-25T12:53:52.438000 | 2021-10-25T19:25:52 | 2021-10-25T19:26:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netconf.nettyutil.handler.ssh.client;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import org.opendaylight.netconf.shaded.sshd.common.SshException;
/**
* Exception reported when endpoint authentication fails.
*/
@Beta
public class AuthenticationFailedException extends SshException {
private static final long serialVersionUID = 1L;
public AuthenticationFailedException(final String message) {
super(requireNonNull(message));
}
public AuthenticationFailedException(final String message, final Throwable cause) {
super(requireNonNull(message), cause);
}
}
| UTF-8 | Java | 979 | java | AuthenticationFailedException.java | Java | [
{
"context": "/*\n * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.\n *",
"end": 33,
"score": 0.6671664118766785,
"start": 25,
"tag": "NAME",
"value": "PANTHEON"
},
{
"context": "/*\n * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reser... | null | [] | /*
* Copyright (c) 2020 PANTHEON.<EMAIL>, s.r.o. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netconf.nettyutil.handler.ssh.client;
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import org.opendaylight.netconf.shaded.sshd.common.SshException;
/**
* Exception reported when endpoint authentication fails.
*/
@Beta
public class AuthenticationFailedException extends SshException {
private static final long serialVersionUID = 1L;
public AuthenticationFailedException(final String message) {
super(requireNonNull(message));
}
public AuthenticationFailedException(final String message, final Throwable cause) {
super(requireNonNull(message), cause);
}
}
| 982 | 0.766088 | 0.756895 | 29 | 32.758621 | 31.312281 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37931 | false | false | 7 |
a449fac1a1dd2b31f7d4b737c7bada0c1ea87ff9 | 35,399,120,491,535 | eed406a6277fa1e93c45e20d4aff4a6a5d42b124 | /Android/Dremboard/src/com/drem/dremboard/ui/ActivityComment.java | 98a3e984e9910bdc5faa35c69317a34e00580435 | [] | no_license | mingji/dremboard | https://github.com/mingji/dremboard | 1e87559b91134c5896e6d70d51b2421c3d1a0431 | ec7cce2e4433f85202d020cb0b76784b5bd4981c | refs/heads/master | 2021-01-10T20:28:39.615000 | 2016-02-15T11:22:59 | 2016-02-15T11:22:59 | 35,685,402 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.drem.dremboard.ui;
import java.util.ArrayList;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.drem.dremboard.R;
import com.drem.dremboard.entity.Beans.DeleteActivityDremData;
import com.drem.dremboard.entity.Beans.DeleteActivityDremResult;
import com.drem.dremboard.entity.Beans.EditCommentParam;
import com.drem.dremboard.entity.Beans.EditCommentResult;
import com.drem.dremboard.entity.Beans.SetCommentParam;
import com.drem.dremboard.entity.Beans.SetCommentResult;
import com.drem.dremboard.entity.CommentInfo;
import com.drem.dremboard.entity.DremerInfo;
import com.drem.dremboard.entity.GlobalValue;
import com.drem.dremboard.utils.AppPreferences;
import com.drem.dremboard.utils.ImageLoader;
import com.drem.dremboard.utils.MyDialog;
import com.drem.dremboard.utils.StringUtil;
import com.drem.dremboard.utils.Utility;
import com.drem.dremboard.view.CustomToast;
import com.drem.dremboard.view.WaitDialog;
import com.drem.dremboard.view.WebCircularImgView;
import com.drem.dremboard.view.WebImgView;
import com.drem.dremboard.webservice.Constants;
import com.drem.dremboard.webservice.WebApiCallback;
import com.drem.dremboard.webservice.WebApiInstance;
import com.drem.dremboard.webservice.WebApiInstance.Type;
public class ActivityComment extends Activity implements WebApiCallback {
int activity_id;
ImageView mImgPost;
Button mBtnClose, btnPost;
EditText txtComment;
AppPreferences mPrefs;
WaitDialog waitDialog;
public static ActivityComment instance = null;
public static OnCommentResultCallback mResultCallback;
public static OnDelCommentResultCallback mDelCommentCallback;
public static OnEditCommentResultCallback mEditCommentCallback;
public static ArrayList<CommentInfo> mCommentList;
int itemIndex;
int mDeleteIndex, mEditIndex;
CommentAdapter mAdapterComment;
ListView mListviewComment;
CommentInfo mEdtCommentItem;
ArrayList<CommentInfo> mArrayComment = null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_comment);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE |
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
instance = this;
mPrefs = new AppPreferences(this);
waitDialog = new WaitDialog(this);
mArrayComment = new ArrayList<CommentInfo>();
mArrayComment.addAll(mCommentList);
activity_id = getIntent().getExtras().getInt("activity_id");
itemIndex = getIntent().getExtras().getInt("index");
btnPost = (Button) findViewById(R.id.btnPost);
btnPost.setText("Post");
mBtnClose = (Button) findViewById(R.id.btnClose);
mBtnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
txtComment = (EditText) findViewById(R.id.txtComment);
mImgPost = (ImageView) findViewById(R.id.imgPost);
mImgPost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
txtComment.setText("");
btnPost.setText("Post");
}
});
mAdapterComment = new CommentAdapter(this, R.layout.item_diag_comment, mArrayComment);
mListviewComment = (ListView) findViewById(R.id.lstComment);
mListviewComment.setAdapter(mAdapterComment);
setListViewHeightBasedOnChildren(mListviewComment);
btnPost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String comment = txtComment.getText().toString();
if (btnPost.getText().equals("Post"))
setComment(comment);
else if (btnPost.getText().equals("Edit"))
{
if (mEdtCommentItem.author_id != Integer.parseInt(mPrefs.getUserId()))
{
CustomToast.makeCustomToastShort(ActivityComment.this, "You can't edit the comment.");
}
else
{
mEdtCommentItem.description = comment;
editComment(comment, mEdtCommentItem.activity_id);
}
}
}
});
}
public void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
return;
}
int totalHeight = 0;
for (int i = 0, len = listAdapter.getCount(); i < len; i++) {
View listItem;
listItem = ((CommentAdapter)listAdapter).getViewForSize(i, null, listView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
// params.height = totalHeight
// + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
//
// int height = this.activity.getWindowManager().getDefaultDisplay().getHeight();
//
// if (params.height > height / 7 * 4)
// params.height = height / 7 * 4;
// if(params.height > 800)
// params.height = 800;
listView.setLayoutParams(params);
}
private void setComment(String comment) {
waitDialog.show();
SetCommentParam param = new SetCommentParam();
param.user_id = mPrefs.getUserId();
param.activity_id = this.activity_id;
param.comment = comment;
param.photo = "tmp.png";
WebApiInstance.getInstance().executeAPI(Type.SET_COMMENT, param, this);
}
private void editComment(String comment, int activity_id) {
waitDialog.show();
EditCommentParam param = new EditCommentParam();
param.user_id = mPrefs.getUserId();
param.activity_id = activity_id;
param.comment = comment;
param.photo = "tmp.png";
WebApiInstance.getInstance().executeAPI(Type.EDIT_COMMENT, param, this);
}
private void deleteComment(CommentInfo comment) {
DeleteActivityDremData param = new DeleteActivityDremData();
param.user_id = mPrefs.getUserId();
param.activity_id = comment.activity_id;
WebApiInstance.getInstance().executeAPI(Type.DELETE_ACTIVITY, param, this);
waitDialog.show();
}
private void setCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
SetCommentResult resultBean = (SetCommentResult)obj;
if (resultBean.status.equals("ok")) {
if (this.mResultCallback != null){
DremerInfo currentDremer = GlobalValue.getInstance().getCurrentDremer();
resultBean.data.comment.author_name = currentDremer.display_name;
mResultCallback.OnCommentResult(resultBean.data.comment, itemIndex);
mArrayComment.add(resultBean.data.comment);
mAdapterComment = new CommentAdapter(this, R.layout.item_diag_comment, mArrayComment);
mListviewComment = (ListView) findViewById(R.id.lstComment);
mListviewComment.setAdapter(mAdapterComment);
setListViewHeightBasedOnChildren(mListviewComment);
mAdapterComment.notifyDataSetChanged();
}
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
txtComment.setText("");
}
private void deleteCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
DeleteActivityDremResult resultBean = (DeleteActivityDremResult)obj;
if (resultBean.status.equals("ok"))
{
mArrayComment.remove(mDeleteIndex);
mAdapterComment.notifyDataSetChanged();
if (this.mDelCommentCallback != null){
mDelCommentCallback.OnDelCommentResult(itemIndex, mDeleteIndex);
}
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
}
private void editCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
EditCommentResult resultBean = (EditCommentResult)obj;
if (resultBean.status.equals("ok"))
{
mAdapterComment.notifyDataSetChanged();
if (this.mEditCommentCallback != null){
mEditCommentCallback.OnEditCommentResult(itemIndex, mEdtCommentItem, mEditIndex);
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
}
}
@Override
public void onPreProcessing(Type type, Object parameter) {
// TODO Auto-generated method stub
}
@Override
public void onResultProcessing(Type type, Object parameter, Object result) {
// TODO Auto-generated method stub
switch (type)
{
case SET_COMMENT:
setCommentResult(result);
break;
case DELETE_ACTIVITY:
deleteCommentResult(result);
case EDIT_COMMENT:
editCommentResult(result);
default:
break;
}
}
public interface OnCommentResultCallback {
void OnCommentResult(CommentInfo commentData, int index);
}
public interface OnDelCommentResultCallback {
void OnDelCommentResult(int activity_index, int index);
}
public interface OnEditCommentResultCallback {
void OnEditCommentResult(int activity_index, CommentInfo commentData, int index);
}
public class CommentAdapter extends ArrayAdapter<CommentInfo> {
Activity activity;
int layoutResourceId;
ArrayList<CommentInfo> item = new ArrayList<CommentInfo>();
public CommentAdapter(Activity activity, int layoutId, ArrayList<CommentInfo> items) {
// TODO Auto-generated constructor stub
super(activity, layoutId, items);
this.activity = activity;
item = items;
this.layoutResourceId = layoutId;
}
public View getViewForSize(final int position, View convertView, ViewGroup parent) {
CommentHolder holder = null;
CommentInfo comment = getItem(position);
// inflate the view
if (convertView == null) {
LayoutInflater inflater = ((Activity) activity).getLayoutInflater();
convertView = inflater.inflate(R.layout.item_diag_comment, null);
holder = new CommentHolder();
holder.imgUser = (WebCircularImgView) convertView.findViewById(R.id.imgCommentAuthor);
holder.txtName = (TextView) convertView.findViewById(R.id.txtCommentAuthor);
holder.txtComment = (TextView) convertView.findViewById(R.id.txtComment);
holder.txtComment.setMovementMethod(LinkMovementMethod.getInstance());
holder.txtTime = (TextView) convertView.findViewById(R.id.txtTime);
holder.imgComment = (WebImgView) convertView.findViewById(R.id.imgCommentPic);
holder.btn_edit = convertView.findViewById(R.id.btn_delete);
holder.btn_delete = convertView.findViewById(R.id.btn_delete);
convertView.setTag(holder);
}
else
holder = (CommentHolder) convertView.getTag();
holder.txtName.setTag(position);
holder.txtName.setText(comment.author_name);
// Spanned spanned = Html.fromHtml(comment.description);
// SpannableString spannableString = SpannableString.valueOf(spanned);
// holder.txtComment.setText(escapeJavaString(comment.description));
holder.txtComment.setText(comment.description);
holder.txtTime.setTag(position);
holder.txtTime.setText(Utility.getRelativeDateStrFromTime(comment.last_modified));
if (comment.author_avatar != null && !comment.author_avatar.isEmpty())
ImageLoader.getInstance().displayImage(comment.author_avatar, holder.imgUser, 0, 0);
else
holder.imgUser.imageView.setImageResource(R.drawable.empty_man);
holder.imgUser.setTag(position);
if (comment.media_guid != null && !comment.media_guid.isEmpty()) {
if (!comment.media_guid.contains("dremboard.com")) {
comment.media_guid= "http://dremboard.com" + comment.media_guid;
}
ImageLoader.getInstance().displayImage(comment.media_guid, holder.imgComment, 0, 0);
} else
holder.imgComment.setVisibility(View.GONE);
holder.btn_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final MyDialog dialog = new MyDialog(getContext());
dialog.setContentView(R.layout.dialog_delete);
dialog.show();
dialog.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
mDeleteIndex = position;
deleteComment(getItem(position));
}
});
}
});
return convertView;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
CommentHolder holder = null;
CommentInfo comment = getItem(position);
// inflate the view
if (convertView == null) {
LayoutInflater inflater = ((Activity) activity).getLayoutInflater();
convertView = inflater.inflate(R.layout.item_diag_comment, null);
holder = new CommentHolder();
holder.imgUser = (WebCircularImgView) convertView.findViewById(R.id.imgCommentAuthor);
holder.txtName = (TextView) convertView.findViewById(R.id.txtCommentAuthor);
holder.txtComment = (TextView) convertView.findViewById(R.id.txtComment);
holder.txtTime = (TextView) convertView.findViewById(R.id.txtTime);
holder.imgComment = (WebImgView) convertView.findViewById(R.id.imgCommentPic);
holder.btn_edit = convertView.findViewById(R.id.btn_edit);
holder.btn_delete = convertView.findViewById(R.id.btn_delete);
convertView.setTag(holder);
}
else
holder = (CommentHolder) convertView.getTag();
holder.txtName.setTag(position);
holder.txtName.setText(comment.author_name);
// holder.txtComment.setText(escapeJavaString(comment.description));
holder.txtComment.setText(comment.description);
holder.txtComment.setMovementMethod(LinkMovementMethod.getInstance());
holder.txtTime.setTag(position);
holder.txtTime.setText(Utility.getRelativeDateStrFromTime(comment.last_modified));
if (comment.author_avatar != null && !comment.author_avatar.isEmpty())
ImageLoader.getInstance().displayImage(comment.author_avatar, holder.imgUser, 0, 0);
else
holder.imgUser.imageView.setImageResource(R.drawable.empty_man);
holder.imgUser.setTag(position);
if (comment.media_guid != null && !comment.media_guid.isEmpty()) {
if (!comment.media_guid.contains("dremboard.com")) {
comment.media_guid= "http://dremboard.com" + comment.media_guid;
}
ImageLoader.getInstance().displayImage(comment.media_guid, holder.imgComment, 0, 0);
} else
holder.imgComment.setVisibility(View.GONE);
holder.btn_edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
mEdtCommentItem = new CommentInfo();
mEdtCommentItem = mArrayComment.get(position);
txtComment.setText(mEdtCommentItem.description);
mEditIndex = position;
btnPost.setText("Edit");
}
});
holder.btn_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final MyDialog dialog = new MyDialog(getContext());
dialog.setContentView(R.layout.dialog_delete);
dialog.show();
dialog.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mDeleteIndex = position;
deleteComment(getItem(position));
dialog.dismiss();
}
});
}
});
return convertView;
}
public class CommentHolder {
WebCircularImgView imgUser;
TextView txtName;
TextView txtComment;
TextView txtTime;
WebImgView imgComment;
View btn_delete;
View btn_edit;
}
public String escapeJavaString(String st){
StringBuilder builder = new StringBuilder();
try {
for (int i = 0; i < st.length(); i++) {
char c = st.charAt(i);
if(!Character.isLetterOrDigit(c) && !Character.isSpaceChar(c)&& !Character.isWhitespace(c) ){
String unicode = String.valueOf(c);
int code = (int)c;
if(!(code >= 0 && code <= 255)){
unicode = "\\\\u"+Integer.toHexString(c);
}
builder.append(unicode);
}
else{
builder.append(c);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return builder.toString();
}
public String getUnicodeValue(String line) {
String hexCodeWithLeadingZeros = "";
try {
for (int index = 0; index < line.length(); index++) {
String hexCode = Integer.toHexString(line.codePointAt(index)).toUpperCase();
String hexCodeWithAllLeadingZeros = "0000" + hexCode;
String temp = hexCodeWithAllLeadingZeros.substring(hexCodeWithAllLeadingZeros.length() - 4);
hexCodeWithLeadingZeros += ("\\u" + temp);
}
return hexCodeWithLeadingZeros;
} catch (NullPointerException nlpException) {
return hexCodeWithLeadingZeros;
}
}
}
}
| UTF-8 | Java | 18,259 | java | ActivityComment.java | Java | [] | null | [] | package com.drem.dremboard.ui;
import java.util.ArrayList;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.drem.dremboard.R;
import com.drem.dremboard.entity.Beans.DeleteActivityDremData;
import com.drem.dremboard.entity.Beans.DeleteActivityDremResult;
import com.drem.dremboard.entity.Beans.EditCommentParam;
import com.drem.dremboard.entity.Beans.EditCommentResult;
import com.drem.dremboard.entity.Beans.SetCommentParam;
import com.drem.dremboard.entity.Beans.SetCommentResult;
import com.drem.dremboard.entity.CommentInfo;
import com.drem.dremboard.entity.DremerInfo;
import com.drem.dremboard.entity.GlobalValue;
import com.drem.dremboard.utils.AppPreferences;
import com.drem.dremboard.utils.ImageLoader;
import com.drem.dremboard.utils.MyDialog;
import com.drem.dremboard.utils.StringUtil;
import com.drem.dremboard.utils.Utility;
import com.drem.dremboard.view.CustomToast;
import com.drem.dremboard.view.WaitDialog;
import com.drem.dremboard.view.WebCircularImgView;
import com.drem.dremboard.view.WebImgView;
import com.drem.dremboard.webservice.Constants;
import com.drem.dremboard.webservice.WebApiCallback;
import com.drem.dremboard.webservice.WebApiInstance;
import com.drem.dremboard.webservice.WebApiInstance.Type;
public class ActivityComment extends Activity implements WebApiCallback {
int activity_id;
ImageView mImgPost;
Button mBtnClose, btnPost;
EditText txtComment;
AppPreferences mPrefs;
WaitDialog waitDialog;
public static ActivityComment instance = null;
public static OnCommentResultCallback mResultCallback;
public static OnDelCommentResultCallback mDelCommentCallback;
public static OnEditCommentResultCallback mEditCommentCallback;
public static ArrayList<CommentInfo> mCommentList;
int itemIndex;
int mDeleteIndex, mEditIndex;
CommentAdapter mAdapterComment;
ListView mListviewComment;
CommentInfo mEdtCommentItem;
ArrayList<CommentInfo> mArrayComment = null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_comment);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE |
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
instance = this;
mPrefs = new AppPreferences(this);
waitDialog = new WaitDialog(this);
mArrayComment = new ArrayList<CommentInfo>();
mArrayComment.addAll(mCommentList);
activity_id = getIntent().getExtras().getInt("activity_id");
itemIndex = getIntent().getExtras().getInt("index");
btnPost = (Button) findViewById(R.id.btnPost);
btnPost.setText("Post");
mBtnClose = (Button) findViewById(R.id.btnClose);
mBtnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
txtComment = (EditText) findViewById(R.id.txtComment);
mImgPost = (ImageView) findViewById(R.id.imgPost);
mImgPost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
txtComment.setText("");
btnPost.setText("Post");
}
});
mAdapterComment = new CommentAdapter(this, R.layout.item_diag_comment, mArrayComment);
mListviewComment = (ListView) findViewById(R.id.lstComment);
mListviewComment.setAdapter(mAdapterComment);
setListViewHeightBasedOnChildren(mListviewComment);
btnPost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String comment = txtComment.getText().toString();
if (btnPost.getText().equals("Post"))
setComment(comment);
else if (btnPost.getText().equals("Edit"))
{
if (mEdtCommentItem.author_id != Integer.parseInt(mPrefs.getUserId()))
{
CustomToast.makeCustomToastShort(ActivityComment.this, "You can't edit the comment.");
}
else
{
mEdtCommentItem.description = comment;
editComment(comment, mEdtCommentItem.activity_id);
}
}
}
});
}
public void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
return;
}
int totalHeight = 0;
for (int i = 0, len = listAdapter.getCount(); i < len; i++) {
View listItem;
listItem = ((CommentAdapter)listAdapter).getViewForSize(i, null, listView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
// params.height = totalHeight
// + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
//
// int height = this.activity.getWindowManager().getDefaultDisplay().getHeight();
//
// if (params.height > height / 7 * 4)
// params.height = height / 7 * 4;
// if(params.height > 800)
// params.height = 800;
listView.setLayoutParams(params);
}
private void setComment(String comment) {
waitDialog.show();
SetCommentParam param = new SetCommentParam();
param.user_id = mPrefs.getUserId();
param.activity_id = this.activity_id;
param.comment = comment;
param.photo = "tmp.png";
WebApiInstance.getInstance().executeAPI(Type.SET_COMMENT, param, this);
}
private void editComment(String comment, int activity_id) {
waitDialog.show();
EditCommentParam param = new EditCommentParam();
param.user_id = mPrefs.getUserId();
param.activity_id = activity_id;
param.comment = comment;
param.photo = "tmp.png";
WebApiInstance.getInstance().executeAPI(Type.EDIT_COMMENT, param, this);
}
private void deleteComment(CommentInfo comment) {
DeleteActivityDremData param = new DeleteActivityDremData();
param.user_id = mPrefs.getUserId();
param.activity_id = comment.activity_id;
WebApiInstance.getInstance().executeAPI(Type.DELETE_ACTIVITY, param, this);
waitDialog.show();
}
private void setCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
SetCommentResult resultBean = (SetCommentResult)obj;
if (resultBean.status.equals("ok")) {
if (this.mResultCallback != null){
DremerInfo currentDremer = GlobalValue.getInstance().getCurrentDremer();
resultBean.data.comment.author_name = currentDremer.display_name;
mResultCallback.OnCommentResult(resultBean.data.comment, itemIndex);
mArrayComment.add(resultBean.data.comment);
mAdapterComment = new CommentAdapter(this, R.layout.item_diag_comment, mArrayComment);
mListviewComment = (ListView) findViewById(R.id.lstComment);
mListviewComment.setAdapter(mAdapterComment);
setListViewHeightBasedOnChildren(mListviewComment);
mAdapterComment.notifyDataSetChanged();
}
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
txtComment.setText("");
}
private void deleteCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
DeleteActivityDremResult resultBean = (DeleteActivityDremResult)obj;
if (resultBean.status.equals("ok"))
{
mArrayComment.remove(mDeleteIndex);
mAdapterComment.notifyDataSetChanged();
if (this.mDelCommentCallback != null){
mDelCommentCallback.OnDelCommentResult(itemIndex, mDeleteIndex);
}
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
}
private void editCommentResult(Object obj) {
waitDialog.dismiss();
if (obj == null) {
CustomToast.makeCustomToastShort(this, Constants.NETWORK_ERR);
}
if (obj != null){
EditCommentResult resultBean = (EditCommentResult)obj;
if (resultBean.status.equals("ok"))
{
mAdapterComment.notifyDataSetChanged();
if (this.mEditCommentCallback != null){
mEditCommentCallback.OnEditCommentResult(itemIndex, mEdtCommentItem, mEditIndex);
} else {
CustomToast.makeCustomToastShort(this, resultBean.msg);
}
}
}
}
@Override
public void onPreProcessing(Type type, Object parameter) {
// TODO Auto-generated method stub
}
@Override
public void onResultProcessing(Type type, Object parameter, Object result) {
// TODO Auto-generated method stub
switch (type)
{
case SET_COMMENT:
setCommentResult(result);
break;
case DELETE_ACTIVITY:
deleteCommentResult(result);
case EDIT_COMMENT:
editCommentResult(result);
default:
break;
}
}
public interface OnCommentResultCallback {
void OnCommentResult(CommentInfo commentData, int index);
}
public interface OnDelCommentResultCallback {
void OnDelCommentResult(int activity_index, int index);
}
public interface OnEditCommentResultCallback {
void OnEditCommentResult(int activity_index, CommentInfo commentData, int index);
}
public class CommentAdapter extends ArrayAdapter<CommentInfo> {
Activity activity;
int layoutResourceId;
ArrayList<CommentInfo> item = new ArrayList<CommentInfo>();
public CommentAdapter(Activity activity, int layoutId, ArrayList<CommentInfo> items) {
// TODO Auto-generated constructor stub
super(activity, layoutId, items);
this.activity = activity;
item = items;
this.layoutResourceId = layoutId;
}
public View getViewForSize(final int position, View convertView, ViewGroup parent) {
CommentHolder holder = null;
CommentInfo comment = getItem(position);
// inflate the view
if (convertView == null) {
LayoutInflater inflater = ((Activity) activity).getLayoutInflater();
convertView = inflater.inflate(R.layout.item_diag_comment, null);
holder = new CommentHolder();
holder.imgUser = (WebCircularImgView) convertView.findViewById(R.id.imgCommentAuthor);
holder.txtName = (TextView) convertView.findViewById(R.id.txtCommentAuthor);
holder.txtComment = (TextView) convertView.findViewById(R.id.txtComment);
holder.txtComment.setMovementMethod(LinkMovementMethod.getInstance());
holder.txtTime = (TextView) convertView.findViewById(R.id.txtTime);
holder.imgComment = (WebImgView) convertView.findViewById(R.id.imgCommentPic);
holder.btn_edit = convertView.findViewById(R.id.btn_delete);
holder.btn_delete = convertView.findViewById(R.id.btn_delete);
convertView.setTag(holder);
}
else
holder = (CommentHolder) convertView.getTag();
holder.txtName.setTag(position);
holder.txtName.setText(comment.author_name);
// Spanned spanned = Html.fromHtml(comment.description);
// SpannableString spannableString = SpannableString.valueOf(spanned);
// holder.txtComment.setText(escapeJavaString(comment.description));
holder.txtComment.setText(comment.description);
holder.txtTime.setTag(position);
holder.txtTime.setText(Utility.getRelativeDateStrFromTime(comment.last_modified));
if (comment.author_avatar != null && !comment.author_avatar.isEmpty())
ImageLoader.getInstance().displayImage(comment.author_avatar, holder.imgUser, 0, 0);
else
holder.imgUser.imageView.setImageResource(R.drawable.empty_man);
holder.imgUser.setTag(position);
if (comment.media_guid != null && !comment.media_guid.isEmpty()) {
if (!comment.media_guid.contains("dremboard.com")) {
comment.media_guid= "http://dremboard.com" + comment.media_guid;
}
ImageLoader.getInstance().displayImage(comment.media_guid, holder.imgComment, 0, 0);
} else
holder.imgComment.setVisibility(View.GONE);
holder.btn_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final MyDialog dialog = new MyDialog(getContext());
dialog.setContentView(R.layout.dialog_delete);
dialog.show();
dialog.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
mDeleteIndex = position;
deleteComment(getItem(position));
}
});
}
});
return convertView;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
CommentHolder holder = null;
CommentInfo comment = getItem(position);
// inflate the view
if (convertView == null) {
LayoutInflater inflater = ((Activity) activity).getLayoutInflater();
convertView = inflater.inflate(R.layout.item_diag_comment, null);
holder = new CommentHolder();
holder.imgUser = (WebCircularImgView) convertView.findViewById(R.id.imgCommentAuthor);
holder.txtName = (TextView) convertView.findViewById(R.id.txtCommentAuthor);
holder.txtComment = (TextView) convertView.findViewById(R.id.txtComment);
holder.txtTime = (TextView) convertView.findViewById(R.id.txtTime);
holder.imgComment = (WebImgView) convertView.findViewById(R.id.imgCommentPic);
holder.btn_edit = convertView.findViewById(R.id.btn_edit);
holder.btn_delete = convertView.findViewById(R.id.btn_delete);
convertView.setTag(holder);
}
else
holder = (CommentHolder) convertView.getTag();
holder.txtName.setTag(position);
holder.txtName.setText(comment.author_name);
// holder.txtComment.setText(escapeJavaString(comment.description));
holder.txtComment.setText(comment.description);
holder.txtComment.setMovementMethod(LinkMovementMethod.getInstance());
holder.txtTime.setTag(position);
holder.txtTime.setText(Utility.getRelativeDateStrFromTime(comment.last_modified));
if (comment.author_avatar != null && !comment.author_avatar.isEmpty())
ImageLoader.getInstance().displayImage(comment.author_avatar, holder.imgUser, 0, 0);
else
holder.imgUser.imageView.setImageResource(R.drawable.empty_man);
holder.imgUser.setTag(position);
if (comment.media_guid != null && !comment.media_guid.isEmpty()) {
if (!comment.media_guid.contains("dremboard.com")) {
comment.media_guid= "http://dremboard.com" + comment.media_guid;
}
ImageLoader.getInstance().displayImage(comment.media_guid, holder.imgComment, 0, 0);
} else
holder.imgComment.setVisibility(View.GONE);
holder.btn_edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
mEdtCommentItem = new CommentInfo();
mEdtCommentItem = mArrayComment.get(position);
txtComment.setText(mEdtCommentItem.description);
mEditIndex = position;
btnPost.setText("Edit");
}
});
holder.btn_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final MyDialog dialog = new MyDialog(getContext());
dialog.setContentView(R.layout.dialog_delete);
dialog.show();
dialog.findViewById(R.id.btn_no).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_yes).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mDeleteIndex = position;
deleteComment(getItem(position));
dialog.dismiss();
}
});
}
});
return convertView;
}
public class CommentHolder {
WebCircularImgView imgUser;
TextView txtName;
TextView txtComment;
TextView txtTime;
WebImgView imgComment;
View btn_delete;
View btn_edit;
}
public String escapeJavaString(String st){
StringBuilder builder = new StringBuilder();
try {
for (int i = 0; i < st.length(); i++) {
char c = st.charAt(i);
if(!Character.isLetterOrDigit(c) && !Character.isSpaceChar(c)&& !Character.isWhitespace(c) ){
String unicode = String.valueOf(c);
int code = (int)c;
if(!(code >= 0 && code <= 255)){
unicode = "\\\\u"+Integer.toHexString(c);
}
builder.append(unicode);
}
else{
builder.append(c);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return builder.toString();
}
public String getUnicodeValue(String line) {
String hexCodeWithLeadingZeros = "";
try {
for (int index = 0; index < line.length(); index++) {
String hexCode = Integer.toHexString(line.codePointAt(index)).toUpperCase();
String hexCodeWithAllLeadingZeros = "0000" + hexCode;
String temp = hexCodeWithAllLeadingZeros.substring(hexCodeWithAllLeadingZeros.length() - 4);
hexCodeWithLeadingZeros += ("\\u" + temp);
}
return hexCodeWithLeadingZeros;
} catch (NullPointerException nlpException) {
return hexCodeWithLeadingZeros;
}
}
}
}
| 18,259 | 0.710882 | 0.708965 | 585 | 30.210257 | 26.40659 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.871795 | false | false | 7 |
54b934cbafeae39e85a7932fb2f77f72b36b3221 | 34,136,400,113,224 | f510887133c619c621a413c196db6ecd81cb1472 | /app/src/main/java/com/example/werk/RecyclerAdapterJobDetail.java | 84d82fec31d44b3af4bb5af69d5faaa41912c890 | [] | no_license | aryailham/Werk | https://github.com/aryailham/Werk | 30956ef47c9e0966b699c20e7b40bdc05566468b | 5f7f12b180e3465b70bd52cc89e0b6e8f6479e19 | refs/heads/master | 2022-12-24T15:14:54.775000 | 2020-10-01T08:10:04 | 2020-10-01T08:10:04 | 298,766,849 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.werk;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.example.werk.model.AvailableJobs;
import java.text.NumberFormat;
import java.util.ArrayList;
public class RecyclerAdapterJobDetail extends RecyclerView.Adapter<RecyclerAdapterJobDetail.RecyclerViewHolder> {
public ArrayList<AvailableJobs> arrayList = new ArrayList<AvailableJobs>();
public Fragment fragment;
public RecyclerAdapterJobDetail(Fragment fragment, ArrayList<AvailableJobs> arrayList)
{
this.fragment = fragment;
this.arrayList = arrayList;
}
@Override
public RecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_available_jobs, parent, false);
RecyclerViewHolder holder = new RecyclerViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) {
final AvailableJobs availableJobs = arrayList.get(position);
NumberFormat format = NumberFormat.getInstance();
String salaryLower = String.valueOf(format.format(availableJobs.getSalaryLower())).replaceAll(",", ".");
String salaryUpper = String.valueOf(format.format(availableJobs.getSalaryUpper())).replaceAll(",",".");
holder.tvJobTitle.setText(availableJobs.getJobTitle());
holder.tvCompanyName.setText(availableJobs.getCompanyName());
holder.tvCompanyAddress.setText(availableJobs.getCompanyAddress());
holder.tvJobSalary.setText("Rp. " + salaryLower + " - " + salaryUpper);
// String jobTitle = holder.tvJobTitle.getText().toString();
// String companyName = holder.tvJobTitle.getText().toString();
// String companyAddress = holder.tvJobTitle.getText().toString();
// String jobSalary = holder.tvJobTitle.getText().toString();
holder.tvContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("jobTitle", availableJobs.getJobTitle());
bundle.putString("companyName", availableJobs.getCompanyName());
bundle.putString("category", availableJobs.getJobCategory());
JobDetailFragment frag = new JobDetailFragment();
FragmentTransaction ft = fragment.getActivity().getSupportFragmentManager().beginTransaction();
ft.replace(R.id.frame_layout, frag);
ft.commit();
}
});
}
@Override
public int getItemCount() {
return arrayList.size();
}
public static class RecyclerViewHolder extends RecyclerView.ViewHolder
{
TextView tvJobTitle, tvCompanyAddress, tvCompanyName, tvJobSalary, tvCategory;
GridLayout tvContainer;
RecyclerViewHolder(View view)
{
super(view);
tvJobTitle = (TextView)view.findViewById(R.id.job_title);
tvJobSalary = (TextView)view.findViewById(R.id.job_salary);
tvCompanyName = (TextView)view.findViewById(R.id.company_name);
tvCompanyAddress = (TextView)view.findViewById(R.id.company_address);
tvCategory = (TextView)view.findViewById(R.id.job_category);
tvContainer = (GridLayout)view.findViewById(R.id.rv_container);
// view.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// int pos = getAdapterPosition();
//
// if(pos != RecyclerView.NO_POSITION){
// AvailableJobs clickedJob = arrayList.get(pos);
// }
// }
// });
}
}
}
| UTF-8 | Java | 4,170 | java | RecyclerAdapterJobDetail.java | Java | [] | null | [] | package com.example.werk;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.example.werk.model.AvailableJobs;
import java.text.NumberFormat;
import java.util.ArrayList;
public class RecyclerAdapterJobDetail extends RecyclerView.Adapter<RecyclerAdapterJobDetail.RecyclerViewHolder> {
public ArrayList<AvailableJobs> arrayList = new ArrayList<AvailableJobs>();
public Fragment fragment;
public RecyclerAdapterJobDetail(Fragment fragment, ArrayList<AvailableJobs> arrayList)
{
this.fragment = fragment;
this.arrayList = arrayList;
}
@Override
public RecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_available_jobs, parent, false);
RecyclerViewHolder holder = new RecyclerViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) {
final AvailableJobs availableJobs = arrayList.get(position);
NumberFormat format = NumberFormat.getInstance();
String salaryLower = String.valueOf(format.format(availableJobs.getSalaryLower())).replaceAll(",", ".");
String salaryUpper = String.valueOf(format.format(availableJobs.getSalaryUpper())).replaceAll(",",".");
holder.tvJobTitle.setText(availableJobs.getJobTitle());
holder.tvCompanyName.setText(availableJobs.getCompanyName());
holder.tvCompanyAddress.setText(availableJobs.getCompanyAddress());
holder.tvJobSalary.setText("Rp. " + salaryLower + " - " + salaryUpper);
// String jobTitle = holder.tvJobTitle.getText().toString();
// String companyName = holder.tvJobTitle.getText().toString();
// String companyAddress = holder.tvJobTitle.getText().toString();
// String jobSalary = holder.tvJobTitle.getText().toString();
holder.tvContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("jobTitle", availableJobs.getJobTitle());
bundle.putString("companyName", availableJobs.getCompanyName());
bundle.putString("category", availableJobs.getJobCategory());
JobDetailFragment frag = new JobDetailFragment();
FragmentTransaction ft = fragment.getActivity().getSupportFragmentManager().beginTransaction();
ft.replace(R.id.frame_layout, frag);
ft.commit();
}
});
}
@Override
public int getItemCount() {
return arrayList.size();
}
public static class RecyclerViewHolder extends RecyclerView.ViewHolder
{
TextView tvJobTitle, tvCompanyAddress, tvCompanyName, tvJobSalary, tvCategory;
GridLayout tvContainer;
RecyclerViewHolder(View view)
{
super(view);
tvJobTitle = (TextView)view.findViewById(R.id.job_title);
tvJobSalary = (TextView)view.findViewById(R.id.job_salary);
tvCompanyName = (TextView)view.findViewById(R.id.company_name);
tvCompanyAddress = (TextView)view.findViewById(R.id.company_address);
tvCategory = (TextView)view.findViewById(R.id.job_category);
tvContainer = (GridLayout)view.findViewById(R.id.rv_container);
// view.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// int pos = getAdapterPosition();
//
// if(pos != RecyclerView.NO_POSITION){
// AvailableJobs clickedJob = arrayList.get(pos);
// }
// }
// });
}
}
}
| 4,170 | 0.667866 | 0.667866 | 100 | 40.700001 | 32.620701 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.72 | false | false | 7 |
79fb4f0e16e6de4b1936c8d42fb893789780ddf8 | 15,985,868,292,175 | bdeba254f40cf6bf6fdde5c24178bad27a01b9dc | /src/com/wtu/demo/service/DishCategoryService.java | ef7f142feb60966960eac531fef02ed664fa84aa | [] | no_license | xiaoxiaotudou/demo | https://github.com/xiaoxiaotudou/demo | caf4d13582294414d29b97e9da95a3fd955d4a0e | 88f74de0e82f872c79fa73b0a1f6382fa93fc43b | refs/heads/develop | 2023-01-23T17:07:59.517000 | 2023-01-07T04:00:17 | 2023-01-07T04:00:17 | 132,156,425 | 0 | 0 | null | false | 2023-01-06T07:03:52 | 2018-05-04T15:17:27 | 2023-01-06T07:03:27 | 2023-01-06T07:03:51 | 39,313 | 0 | 0 | 0 | JavaScript | false | false | package com.wtu.demo.service;
import java.util.List;
import com.wtu.demo.model.DishCategory;
public interface DishCategoryService {
public List<DishCategory> getAllDishCategoryByRestaurantId(String restaurantId);
public List<DishCategory> getAllDishCategoryByPagination(String index, String pageSize, String restaurantId);
public long getDishCategoryCount();
public DishCategory getDishCategoryById(String id);
public boolean deleteDishCategoryById(String id);
public boolean editDishCategory(String categoryId, String categoryName);
public boolean createDishCategory(String restaurantId, String categoryName);
} | UTF-8 | Java | 622 | java | DishCategoryService.java | Java | [] | null | [] | package com.wtu.demo.service;
import java.util.List;
import com.wtu.demo.model.DishCategory;
public interface DishCategoryService {
public List<DishCategory> getAllDishCategoryByRestaurantId(String restaurantId);
public List<DishCategory> getAllDishCategoryByPagination(String index, String pageSize, String restaurantId);
public long getDishCategoryCount();
public DishCategory getDishCategoryById(String id);
public boolean deleteDishCategoryById(String id);
public boolean editDishCategory(String categoryId, String categoryName);
public boolean createDishCategory(String restaurantId, String categoryName);
} | 622 | 0.842444 | 0.842444 | 15 | 40.533333 | 32.726883 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.4 | false | false | 7 |
cc7a78af789185c3ac3c9e5eae723caca4d72b09 | 23,871,428,249,063 | a47d9e822d7bc69fa88545a5e4c5a1dcac0d2f94 | /src/com/vege/view/CustomerView.java | a5cec9a7ace1c7281f49857fb7d16c50eaf87939 | [] | no_license | choi9818/firstProject | https://github.com/choi9818/firstProject | b46ca07cb826eea8d806d82e96baa10890c850e4 | 7dec53e6280f4c92409c5dbafd70981433ae25c7 | refs/heads/master | 2023-08-14T16:44:05.252000 | 2021-10-03T17:17:24 | 2021-10-03T17:17:24 | 413,066,273 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.vege.view;
import java.util.List;
import com.vege.model.CustomerDTO;
public class CustomerView {
public static void display(List<CustomerDTO> customerlist) {
for(CustomerDTO customer:customerlist) {
System.out.println(customer);
}
}
}
| UTF-8 | Java | 259 | java | CustomerView.java | Java | [] | null | [] | package com.vege.view;
import java.util.List;
import com.vege.model.CustomerDTO;
public class CustomerView {
public static void display(List<CustomerDTO> customerlist) {
for(CustomerDTO customer:customerlist) {
System.out.println(customer);
}
}
}
| 259 | 0.756757 | 0.756757 | 13 | 18.923077 | 19.05644 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 7 |
21ec6c40a177c3e47927e7f2d5129c7510abad87 | 16,475,494,601,523 | 384260f1f184cc7db3c34b34424bd7fb5d4e9826 | /Simple Banking System/task/src/db/AccountsData.java | 6af1523eff676a91f34b8ffd94a4ab360fc125e8 | [] | no_license | SerzhHunt/Simple-Banking-System | https://github.com/SerzhHunt/Simple-Banking-System | 82cd0744f9d13f3cd7dc1436d9d91a3b70bb2af6 | 9ce63635dad6075f7a99c7d99ab1f010c755c624 | refs/heads/master | 2022-12-22T10:15:55.653000 | 2020-10-01T19:20:55 | 2020-10-01T19:20:55 | 297,389,953 | 0 | 0 | null | false | 2020-10-01T19:20:56 | 2020-09-21T15:58:35 | 2020-09-24T07:37:39 | 2020-10-01T19:20:56 | 12 | 0 | 0 | 0 | Java | false | false | package db;
import card.CardData;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AccountsData {
private static final String URL_TO_DB = "jdbc:sqlite:C:/Users/rakov/git/Simple Banking System/accounts_data.db";
public void addCardToDatabase(CardData newCard) {
createNewCardToDatabase(
newCard.getCardNumber(),
newCard.getPassword(),
newCard.getBalance());
}
private void createNewCardToDatabase(String number, String pin, int balance) {
String sql = "INSERT INTO card (number,pin,balance) " +
"VALUES (?,?,?);";
try (Connection connection = this.connect()) {
try (PreparedStatement statement = connection.prepareStatement(sql)) {
statement.setString(1, number);
statement.setString(2, pin);
statement.setInt(3, balance);
statement.executeUpdate();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
private Connection connect() {
Connection connection = null;
try {
connection = DriverManager.getConnection(URL_TO_DB);
} catch (SQLException e) {
e.printStackTrace();
}
return connection;
}
}
| UTF-8 | Java | 1,387 | java | AccountsData.java | Java | [
{
"context": "ic final String URL_TO_DB = \"jdbc:sqlite:C:/Users/rakov/git/Simple Banking System/accounts_data.db\";\n\n ",
"end": 260,
"score": 0.977746307849884,
"start": 255,
"tag": "USERNAME",
"value": "rakov"
}
] | null | [] | package db;
import card.CardData;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AccountsData {
private static final String URL_TO_DB = "jdbc:sqlite:C:/Users/rakov/git/Simple Banking System/accounts_data.db";
public void addCardToDatabase(CardData newCard) {
createNewCardToDatabase(
newCard.getCardNumber(),
newCard.getPassword(),
newCard.getBalance());
}
private void createNewCardToDatabase(String number, String pin, int balance) {
String sql = "INSERT INTO card (number,pin,balance) " +
"VALUES (?,?,?);";
try (Connection connection = this.connect()) {
try (PreparedStatement statement = connection.prepareStatement(sql)) {
statement.setString(1, number);
statement.setString(2, pin);
statement.setInt(3, balance);
statement.executeUpdate();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
private Connection connect() {
Connection connection = null;
try {
connection = DriverManager.getConnection(URL_TO_DB);
} catch (SQLException e) {
e.printStackTrace();
}
return connection;
}
}
| 1,387 | 0.601298 | 0.599135 | 45 | 29.822222 | 25.090317 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 7 |
968c41bd6498fa155d417192c0483cf0f4299ac1 | 37,142,877,181,371 | 5ccf28cec123481ef77a3a6a865266dab5552f2a | /facesys-data/src/main/java/com/ss/facesys/data/baseinfo/mapper/AuthorityMapper.java | c6b56faff04dfae404bffb45b533cf156bf1c353 | [] | no_license | liangmuxue/facesys | https://github.com/liangmuxue/facesys | dde7199a62fdc1b5727faf14e5c4fd40a068a2b8 | ffa838a10216cecf2aea4b54c180f3c5443742ea | refs/heads/master | 2022-12-21T15:54:59.846000 | 2021-04-07T09:17:34 | 2021-04-07T09:17:34 | 224,800,426 | 2 | 5 | null | false | 2022-12-16T10:56:21 | 2019-11-29T07:30:22 | 2021-04-07T09:17:46 | 2022-12-16T10:56:17 | 2,011 | 1 | 4 | 31 | Java | false | false | package com.ss.facesys.data.baseinfo.mapper;
import com.ss.facesys.data.baseinfo.common.model.UserAuthority;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface AuthorityMapper {
String findAuthority(@Param("url") String paramString1, @Param("userId") String paramString2);
List<UserAuthority> findUserAuthority();
}
| UTF-8 | Java | 411 | java | AuthorityMapper.java | Java | [] | null | [] | package com.ss.facesys.data.baseinfo.mapper;
import com.ss.facesys.data.baseinfo.common.model.UserAuthority;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface AuthorityMapper {
String findAuthority(@Param("url") String paramString1, @Param("userId") String paramString2);
List<UserAuthority> findUserAuthority();
}
| 411 | 0.798054 | 0.793187 | 13 | 30.615385 | 27.982243 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.615385 | false | false | 7 |
d97442bda5d7a204a8d679391cbac67b8e2b9108 | 25,280,177,564,824 | ef4720dcc53aed4256dfd91903366995b82c9497 | /CarRace/src/controleur/ControlMapComboBox.java | 3a050ced2d992a56d7e7964390d5270ae9f5104e | [] | no_license | XiangJohnny/JAVA | https://github.com/XiangJohnny/JAVA | dc87142e13de59c20969a3242513a0ca1cd2699e | 19eb034e9655b9595ccd188e3099195490ae2e98 | refs/heads/master | 2020-04-08T23:54:31.436000 | 2018-11-30T16:03:43 | 2018-11-30T16:03:43 | 159,844,835 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package controleur;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import algorithmeOutil.Simulation;
import circuit.Circuit;
import circuit.CircuitFactoryFromFile;
public class ControlMapComboBox implements ActionListener {
private Simulation sim;
private JButton start;
private JButton reset;
private JButton resume;
private JButton pause;
private JButton save;
private JButton quit;
public ControlMapComboBox(){
}
public ControlMapComboBox(Simulation sim, JButton start, JButton reset, JButton resume, JButton pause, JButton save, JButton quit) {
this.sim = sim;
this.start = start;
this.reset = reset;
this.resume = resume;
this.pause = pause;
this.save = save;
this.quit = quit;
}
public void setModel(Simulation sim){
this.sim = sim;
}
public void setButton(JButton start, JButton reset, JButton resume, JButton pause, JButton save, JButton quit){
this.start = start;
this.reset = reset;
this.resume = resume;
this.pause = pause;
this.save = save;
this.quit = quit;
}
@Override
public void actionPerformed(ActionEvent arg0) {
JComboBox cb = (JComboBox)arg0.getSource();
String s = (String)cb.getSelectedItem();
s = s+".trk";
Circuit circuit = CircuitFactoryFromFile.CircuitFormFile(s);
sim.setCircuit(circuit);;
start.setEnabled(true);
reset.setEnabled(false);
resume.setEnabled(false);
pause.setEnabled(false);
save.setEnabled(true);
quit.setEnabled(true);
sim.reset();
}
}
| UTF-8 | Java | 1,558 | java | ControlMapComboBox.java | Java | [] | null | [] | package controleur;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import algorithmeOutil.Simulation;
import circuit.Circuit;
import circuit.CircuitFactoryFromFile;
public class ControlMapComboBox implements ActionListener {
private Simulation sim;
private JButton start;
private JButton reset;
private JButton resume;
private JButton pause;
private JButton save;
private JButton quit;
public ControlMapComboBox(){
}
public ControlMapComboBox(Simulation sim, JButton start, JButton reset, JButton resume, JButton pause, JButton save, JButton quit) {
this.sim = sim;
this.start = start;
this.reset = reset;
this.resume = resume;
this.pause = pause;
this.save = save;
this.quit = quit;
}
public void setModel(Simulation sim){
this.sim = sim;
}
public void setButton(JButton start, JButton reset, JButton resume, JButton pause, JButton save, JButton quit){
this.start = start;
this.reset = reset;
this.resume = resume;
this.pause = pause;
this.save = save;
this.quit = quit;
}
@Override
public void actionPerformed(ActionEvent arg0) {
JComboBox cb = (JComboBox)arg0.getSource();
String s = (String)cb.getSelectedItem();
s = s+".trk";
Circuit circuit = CircuitFactoryFromFile.CircuitFormFile(s);
sim.setCircuit(circuit);;
start.setEnabled(true);
reset.setEnabled(false);
resume.setEnabled(false);
pause.setEnabled(false);
save.setEnabled(true);
quit.setEnabled(true);
sim.reset();
}
}
| 1,558 | 0.7362 | 0.734917 | 69 | 21.57971 | 22.829174 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.898551 | false | false | 7 |
7ddc6787ff73fa679986c8f6958959040e74feb3 | 37,847,251,824,444 | ba1a5f3233f220895d7b8edec751a52c6b7a5c4f | /app/src/main/java/com/unitedcreation/visha/tastytreat/adapter/IngredientAdapter.java | b025e2ac85f9f4afcdd2c48602e8c89f2dc80988 | [
"ISC"
] | permissive | vishalrao8/TastyTreat | https://github.com/vishalrao8/TastyTreat | a496dfd9edb415b60d5dc0c8c3e588cd2905cdcc | b4130f99ad53d2ae8a1d8178d9e5976206c0dc5d | refs/heads/master | 2020-03-29T22:08:47.779000 | 2019-02-10T09:17:16 | 2019-02-10T09:17:16 | 150,405,349 | 3 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.unitedcreation.visha.tastytreat.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.unitedcreation.visha.tastytreat.R;
import com.unitedcreation.visha.tastytreat.model.Ingredients;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class IngredientAdapter extends RecyclerView.Adapter<IngredientAdapter.IngredientViewHolder> {
private List<Ingredients> ingredientsList;
public IngredientAdapter (List<Ingredients> ingredientsList) {
this.ingredientsList = ingredientsList;
}
@NonNull
@Override
public IngredientViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_recipe_ingredients, parent, false);
return new IngredientViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull IngredientViewHolder holder, int position) {
holder.ingredientTv.setText(ingredientsList.get(position).getIngredient());
holder.quantityTv.setText(ingredientsList.get(position).getQuantity());
holder.measureTv.setText(ingredientsList.get(position).getMeasure());
}
@Override
public int getItemCount() {
return ingredientsList.size();
}
public class IngredientViewHolder extends RecyclerView.ViewHolder{
TextView ingredientTv;
TextView quantityTv;
TextView measureTv;
public IngredientViewHolder(View itemView) {
super(itemView);
ingredientTv = itemView.findViewById(R.id.ingredient);
quantityTv = itemView.findViewById(R.id.quantity);
measureTv = itemView.findViewById(R.id.measure);
}
}
}
| UTF-8 | Java | 1,869 | java | IngredientAdapter.java | Java | [] | null | [] | package com.unitedcreation.visha.tastytreat.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.unitedcreation.visha.tastytreat.R;
import com.unitedcreation.visha.tastytreat.model.Ingredients;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class IngredientAdapter extends RecyclerView.Adapter<IngredientAdapter.IngredientViewHolder> {
private List<Ingredients> ingredientsList;
public IngredientAdapter (List<Ingredients> ingredientsList) {
this.ingredientsList = ingredientsList;
}
@NonNull
@Override
public IngredientViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_recipe_ingredients, parent, false);
return new IngredientViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull IngredientViewHolder holder, int position) {
holder.ingredientTv.setText(ingredientsList.get(position).getIngredient());
holder.quantityTv.setText(ingredientsList.get(position).getQuantity());
holder.measureTv.setText(ingredientsList.get(position).getMeasure());
}
@Override
public int getItemCount() {
return ingredientsList.size();
}
public class IngredientViewHolder extends RecyclerView.ViewHolder{
TextView ingredientTv;
TextView quantityTv;
TextView measureTv;
public IngredientViewHolder(View itemView) {
super(itemView);
ingredientTv = itemView.findViewById(R.id.ingredient);
quantityTv = itemView.findViewById(R.id.quantity);
measureTv = itemView.findViewById(R.id.measure);
}
}
}
| 1,869 | 0.733012 | 0.733012 | 64 | 28.203125 | 30.937023 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.453125 | false | false | 7 |
0601e963bdef3895e9a62f21734871edd982e714 | 37,847,251,822,177 | 947ce851d30a844954a35e852bd88e9576947635 | /CategoryController.java | 513d18ce469d6432f4c3edc2ab2c9c09d15dc867 | [] | no_license | HarikaPenukonda/Front-End | https://github.com/HarikaPenukonda/Front-End | 404d2735a2e90793d18564497a15cbd4df5e3234 | 937f74f790896fa602d132ff6ce46d4c45905091 | refs/heads/master | 2021-06-07T01:06:34.307000 | 2016-09-28T08:44:21 | 2016-09-28T08:44:21 | 66,014,233 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.niit.Controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.niit.shoppingcart.dao.CategoryDAO;
import com.niit.shoppingcart.model.Category;
@Controller
public class CategoryController {
private static Logger Log = LoggerFactory.getLogger(CategoryController.class);
@Autowired
private CategoryDAO categoryDAO;
@Autowired
private Category category;
@RequestMapping(value = "/categories", method = RequestMethod.GET)
public String listCategories(Model model) {
Log.debug("starting of the method listCategories");
model.addAttribute("category", category);
model.addAttribute("categoryList", this.categoryDAO.list());
Log.debug("End of the method listCategories");
return "category";
}
@RequestMapping(value = "/category/add", method = RequestMethod.POST)
public ModelAndView addCategory(Model model) {
Log.debug("starting of the method addCategory");
ModelAndView mv = new ModelAndView();
if(categoryDAO.get(category.getId()) != null)
{
categoryDAO.save(category);
}
else
{
mv.addObject("error message,if exists with this id" + category.getId());
}
Log.debug("ending of the method addcategories");
return mv;
}
@RequestMapping("category/remove/{id}")
public ModelAndView deleteCategory(@PathVariable("id") int id) throws Exception {
category = categoryDAO.get(id);
ModelAndView mv = new ModelAndView("category");
if (category == null) {
mv.addObject("errorMessage", "could not delete the category");
} else {
categoryDAO.delete(category);
}
return mv;
}
@RequestMapping(value = "category/edit/{id}", method = RequestMethod.GET)
public ModelAndView editCategory(@ModelAttribute("category") Category category) {
ModelAndView mv = new ModelAndView();
if (categoryDAO.get(category.getId()) != null) {
categoryDAO.update(category);
mv.addObject("message", "Successfully updated");
} else {
mv.addObject("errorMessage", "could update the record");
}
return mv;
}
}
| UTF-8 | Java | 2,543 | java | CategoryController.java | Java | [] | null | [] | package com.niit.Controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.niit.shoppingcart.dao.CategoryDAO;
import com.niit.shoppingcart.model.Category;
@Controller
public class CategoryController {
private static Logger Log = LoggerFactory.getLogger(CategoryController.class);
@Autowired
private CategoryDAO categoryDAO;
@Autowired
private Category category;
@RequestMapping(value = "/categories", method = RequestMethod.GET)
public String listCategories(Model model) {
Log.debug("starting of the method listCategories");
model.addAttribute("category", category);
model.addAttribute("categoryList", this.categoryDAO.list());
Log.debug("End of the method listCategories");
return "category";
}
@RequestMapping(value = "/category/add", method = RequestMethod.POST)
public ModelAndView addCategory(Model model) {
Log.debug("starting of the method addCategory");
ModelAndView mv = new ModelAndView();
if(categoryDAO.get(category.getId()) != null)
{
categoryDAO.save(category);
}
else
{
mv.addObject("error message,if exists with this id" + category.getId());
}
Log.debug("ending of the method addcategories");
return mv;
}
@RequestMapping("category/remove/{id}")
public ModelAndView deleteCategory(@PathVariable("id") int id) throws Exception {
category = categoryDAO.get(id);
ModelAndView mv = new ModelAndView("category");
if (category == null) {
mv.addObject("errorMessage", "could not delete the category");
} else {
categoryDAO.delete(category);
}
return mv;
}
@RequestMapping(value = "category/edit/{id}", method = RequestMethod.GET)
public ModelAndView editCategory(@ModelAttribute("category") Category category) {
ModelAndView mv = new ModelAndView();
if (categoryDAO.get(category.getId()) != null) {
categoryDAO.update(category);
mv.addObject("message", "Successfully updated");
} else {
mv.addObject("errorMessage", "could update the record");
}
return mv;
}
}
| 2,543 | 0.728667 | 0.72788 | 85 | 27.917646 | 25.799322 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.635294 | false | false | 7 |
5e5b588fdb0c353c881aafe3f72f4aa2e629df2a | 37,125,697,310,665 | 35e5e84a3797776f00df6f66b31e0b01fdd86337 | /JSP/IDEA/TabProject/src/com/yanqun/tag/MyIteration.java | 9682e8bb4faad5e891a1eed429e0459ba3e8fee5 | [] | no_license | mumulx/Project-source-code | https://github.com/mumulx/Project-source-code | 079b8656306d436adc37a58d1ab6e9591a384e6a | dbc42847ad3a7de73b24a588cd3bc9623128ff06 | refs/heads/master | 2022-12-21T00:16:37.302000 | 2020-05-31T12:11:26 | 2020-05-31T12:11:26 | 228,007,716 | 2 | 1 | null | false | 2022-12-16T09:43:20 | 2019-12-14T10:56:18 | 2022-12-16T04:32:00 | 2022-12-16T09:43:16 | 93,267 | 2 | 1 | 46 | Java | false | false | package com.yanqun.tag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
public class MyIteration extends TagSupport {
private int num ;//执行次数 3
public void setNum(int num){
this.num = num ;
}
//执行标签
@Override
public int doStartTag() throws JspException {
return EVAL_BODY_INCLUDE ;//先执行一次
}
//执行完毕后
@Override
public int doAfterBody() throws JspException {
num-- ;
return num>0 ? EVAL_BODY_AGAIN :SKIP_BODY; //重复执行
}
}
| UTF-8 | Java | 584 | java | MyIteration.java | Java | [] | null | [] | package com.yanqun.tag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
public class MyIteration extends TagSupport {
private int num ;//执行次数 3
public void setNum(int num){
this.num = num ;
}
//执行标签
@Override
public int doStartTag() throws JspException {
return EVAL_BODY_INCLUDE ;//先执行一次
}
//执行完毕后
@Override
public int doAfterBody() throws JspException {
num-- ;
return num>0 ? EVAL_BODY_AGAIN :SKIP_BODY; //重复执行
}
}
| 584 | 0.633333 | 0.62963 | 24 | 21.5 | 18.445868 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 7 |
64a5ce733e4e1cea769947c1530ce92ca7c0faf7 | 35,897,336,684,518 | bcaae992b74ca13805b59e738497345e160a93b3 | /app/src/main/java/edu/wgu/c196_coursetracker_mwilliams/UI/Adapters/TermAdapter.java | 5d543ef870b691042e786d9fec5fba43051cd6e9 | [] | no_license | mwilliams705/C196_CourseTracker_MWilliams | https://github.com/mwilliams705/C196_CourseTracker_MWilliams | 2ddd4e89f021b35fee415417e71a62ab7a93d0ae | 08bc8db4b886ec6657cc5725bfcaf0c2284313bd | refs/heads/master | 2023-04-04T18:32:17.439000 | 2021-04-28T04:43:54 | 2021-04-28T04:43:54 | 356,942,161 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package edu.wgu.c196_coursetracker_mwilliams.UI.Adapters;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import edu.wgu.c196_coursetracker_mwilliams.Database.Term.TermEntity;
import edu.wgu.c196_coursetracker_mwilliams.R;
import edu.wgu.c196_coursetracker_mwilliams.UI.TermActivities.TermDetailActivity;
public class TermAdapter extends RecyclerView.Adapter<TermAdapter.TermViewHolder> {
private final LayoutInflater inflater;
private final Context context;
private List<TermEntity> terms = new ArrayList<>();
public TermAdapter(Context context) {
inflater = LayoutInflater.from(context);
this.context = context;
}
@NonNull
@Override
public TermViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = inflater.inflate(R.layout.term_list_item,parent,false);
return new TermViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull TermViewHolder holder, int position) {
if (terms != null){
final TermEntity current = terms.get(position);
holder.termTitle.setText(current.getTerm_title());
holder.termStart.setText(current.getTerm_start());
holder.termEnd.setText(current.getTerm_end());
}
}
@Override
public int getItemCount() {
if (terms != null){
return terms.size();
}
else return 0;
}
public void setTerms(List<TermEntity> terms){
this.terms = terms;
notifyDataSetChanged();
}
public TermEntity getTermAtPosition(int position){
return terms.get(position);
}
class TermViewHolder extends RecyclerView.ViewHolder{
private final TextView termTitle;
private final TextView termStart;
private final TextView termEnd;
public TermViewHolder(@NonNull View itemView) {
super(itemView);
termTitle = itemView.findViewById(R.id.instructorName);
termStart = itemView.findViewById(R.id.instructorPhoneListItemTextView);
termEnd = itemView.findViewById(R.id.instructorEmailListItemTextView);
itemView.setOnClickListener( v -> {
int position = getAdapterPosition();
final TermEntity current = terms.get(position);
Intent intent = new Intent(context, TermDetailActivity.class);
intent.putExtra("termTitle",current.getTerm_title());
intent.putExtra("termStart",current.getTerm_start());
intent.putExtra("termEnd",current.getTerm_end());
intent.putExtra("termID",current.getTerm_id());
context.startActivity(intent);
});
}
}
}
| UTF-8 | Java | 3,044 | java | TermAdapter.java | Java | [] | null | [] | package edu.wgu.c196_coursetracker_mwilliams.UI.Adapters;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import edu.wgu.c196_coursetracker_mwilliams.Database.Term.TermEntity;
import edu.wgu.c196_coursetracker_mwilliams.R;
import edu.wgu.c196_coursetracker_mwilliams.UI.TermActivities.TermDetailActivity;
public class TermAdapter extends RecyclerView.Adapter<TermAdapter.TermViewHolder> {
private final LayoutInflater inflater;
private final Context context;
private List<TermEntity> terms = new ArrayList<>();
public TermAdapter(Context context) {
inflater = LayoutInflater.from(context);
this.context = context;
}
@NonNull
@Override
public TermViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = inflater.inflate(R.layout.term_list_item,parent,false);
return new TermViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull TermViewHolder holder, int position) {
if (terms != null){
final TermEntity current = terms.get(position);
holder.termTitle.setText(current.getTerm_title());
holder.termStart.setText(current.getTerm_start());
holder.termEnd.setText(current.getTerm_end());
}
}
@Override
public int getItemCount() {
if (terms != null){
return terms.size();
}
else return 0;
}
public void setTerms(List<TermEntity> terms){
this.terms = terms;
notifyDataSetChanged();
}
public TermEntity getTermAtPosition(int position){
return terms.get(position);
}
class TermViewHolder extends RecyclerView.ViewHolder{
private final TextView termTitle;
private final TextView termStart;
private final TextView termEnd;
public TermViewHolder(@NonNull View itemView) {
super(itemView);
termTitle = itemView.findViewById(R.id.instructorName);
termStart = itemView.findViewById(R.id.instructorPhoneListItemTextView);
termEnd = itemView.findViewById(R.id.instructorEmailListItemTextView);
itemView.setOnClickListener( v -> {
int position = getAdapterPosition();
final TermEntity current = terms.get(position);
Intent intent = new Intent(context, TermDetailActivity.class);
intent.putExtra("termTitle",current.getTerm_title());
intent.putExtra("termStart",current.getTerm_start());
intent.putExtra("termEnd",current.getTerm_end());
intent.putExtra("termID",current.getTerm_id());
context.startActivity(intent);
});
}
}
}
| 3,044 | 0.672799 | 0.668528 | 98 | 30.061224 | 27.078802 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.561224 | false | false | 7 |
db4720aa0e16fa289387817f1986378c15bc96a4 | 25,761,213,884,307 | a2e6605b95fcf9eec63f19a76e697c5ead1275fe | /Week_09/home-work/dubbo-hmily-tcc/Server-A/src/main/java/pers/cocoade/learning/dubbo/a/mapper/TransactionBillMapper.java | 201d8d4d1e6bed37e61890cbbe30c93fedd02724 | [] | no_license | cocoZwwang/JAVA-000 | https://github.com/cocoZwwang/JAVA-000 | d13f8c9f81d363c6f5b29aa23baf099076630c37 | a8017eb33628dec1069965c8ae4e9c6e8796910f | refs/heads/main | 2023-03-05T01:52:42.771000 | 2021-02-20T12:13:47 | 2021-02-20T12:13:47 | 305,645,082 | 1 | 0 | null | true | 2020-10-20T08:45:09 | 2020-10-20T08:45:08 | 2020-10-20T03:18:24 | 2020-10-19T14:30:42 | 2 | 0 | 0 | 0 | null | false | false | package pers.cocoade.learning.dubbo.a.mapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import pers.cocoade.learning.dubbo.api.domain.TransactionBill;
import java.util.Date;
@Mapper
public interface TransactionBillMapper {
@Insert("insert into transaction_bill (id,buy_account,buy_amount,buy_currency," +
"seller_account,seller_amount,seller_currency,state,create_time,update_time) " +
"values (#{id},#{buyAccount},#{buyAmount},#{buyCurrency},#{sellerAccount},#{sellerAmount}," +
"#{sellerCurrency},#{state},#{createTime},#{updateTime})")
int add(TransactionBill bill);
@Update("update transaction_bill set state = #{state},update_time = now() where id = #{id}")
int updateSate(@Param("id") Long id, @Param("state") Integer state);
@Delete("delete from transaction_bill where id = #{id}")
int deleteById(@Param("id") Long id);
@Select("select * from transaction_bill where id = #{id}")
@Results(id = "transactionBillMap",value = {
@Result(column = "id",property = "id",id = true,javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_account",property = "buyAccount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_amount",property = "buyAmount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_currency",property = "buyCurrency",javaType = String.class,jdbcType = JdbcType.VARCHAR),
@Result(column = "seller_account",property = "sellerAccount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "seller_amount",property = "sellerAmount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "seller_currency",property = "sellerCurrency",javaType = String.class,jdbcType = JdbcType.VARCHAR),
@Result(column = "state",property = "state",javaType = Integer.class,jdbcType = JdbcType.SMALLINT),
@Result(column = "create_time",property = "createTime",javaType = Date.class,jdbcType = JdbcType.TIMESTAMP),
@Result(column = "update_time",property = "updateTime",javaType = Date.class,jdbcType = JdbcType.TIMESTAMP)
})
TransactionBill selectOne(@Param("id") Long id);
}
| UTF-8 | Java | 2,302 | java | TransactionBillMapper.java | Java | [] | null | [] | package pers.cocoade.learning.dubbo.a.mapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import pers.cocoade.learning.dubbo.api.domain.TransactionBill;
import java.util.Date;
@Mapper
public interface TransactionBillMapper {
@Insert("insert into transaction_bill (id,buy_account,buy_amount,buy_currency," +
"seller_account,seller_amount,seller_currency,state,create_time,update_time) " +
"values (#{id},#{buyAccount},#{buyAmount},#{buyCurrency},#{sellerAccount},#{sellerAmount}," +
"#{sellerCurrency},#{state},#{createTime},#{updateTime})")
int add(TransactionBill bill);
@Update("update transaction_bill set state = #{state},update_time = now() where id = #{id}")
int updateSate(@Param("id") Long id, @Param("state") Integer state);
@Delete("delete from transaction_bill where id = #{id}")
int deleteById(@Param("id") Long id);
@Select("select * from transaction_bill where id = #{id}")
@Results(id = "transactionBillMap",value = {
@Result(column = "id",property = "id",id = true,javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_account",property = "buyAccount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_amount",property = "buyAmount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "buy_currency",property = "buyCurrency",javaType = String.class,jdbcType = JdbcType.VARCHAR),
@Result(column = "seller_account",property = "sellerAccount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "seller_amount",property = "sellerAmount",javaType = Long.class,jdbcType = JdbcType.BIGINT),
@Result(column = "seller_currency",property = "sellerCurrency",javaType = String.class,jdbcType = JdbcType.VARCHAR),
@Result(column = "state",property = "state",javaType = Integer.class,jdbcType = JdbcType.SMALLINT),
@Result(column = "create_time",property = "createTime",javaType = Date.class,jdbcType = JdbcType.TIMESTAMP),
@Result(column = "update_time",property = "updateTime",javaType = Date.class,jdbcType = JdbcType.TIMESTAMP)
})
TransactionBill selectOne(@Param("id") Long id);
}
| 2,302 | 0.678106 | 0.678106 | 38 | 59.578949 | 45.431053 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.842105 | false | false | 7 |
6ea821ed0b6f42e5e5e5dd897a9c890ecdfd1600 | 37,306,085,938,677 | 661875f131a56f36f867dfc1c48b3f44199fc605 | /eureka-bussniss-service-user/src/main/java/com/example/eurekabussnissserviceuser/EurekaBussnissServiceUserApplication.java | d1a89874c55ef94c7b1f425410c6cdd5d9a63b2e | [] | no_license | ChinPangLung/eureka-common-service | https://github.com/ChinPangLung/eureka-common-service | 41f1b6123f4c3ae74b38766a1cc89bac06df7442 | 2fdce0e7cb283e21d3eea543e0c23c89b0743f25 | refs/heads/master | 2020-03-23T04:58:55.826000 | 2018-09-21T05:33:25 | 2018-09-21T05:33:25 | 141,117,392 | 6 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.eurekabussnissserviceuser;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class EurekaBussnissServiceUserApplication {
public static void main(String[] args) {
// System.out.println("===========================================");
/**
* Springboot整合Elasticsearch 在项目启动前设置一下的属性,防止报错
* 解决netty冲突后初始化client时还会抛出异常
* java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
*/
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(EurekaBussnissServiceUserApplication.class, args);
}
}
| UTF-8 | Java | 915 | java | EurekaBussnissServiceUserApplication.java | Java | [] | null | [] | package com.example.eurekabussnissserviceuser;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class EurekaBussnissServiceUserApplication {
public static void main(String[] args) {
// System.out.println("===========================================");
/**
* Springboot整合Elasticsearch 在项目启动前设置一下的属性,防止报错
* 解决netty冲突后初始化client时还会抛出异常
* java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
*/
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(EurekaBussnissServiceUserApplication.class, args);
}
}
| 915 | 0.715976 | 0.713609 | 21 | 39.238094 | 30.997549 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.47619 | false | false | 7 |
b7c4ee122e6de55805bc4144154a49322b014eb5 | 25,005,299,662,416 | 7c92a146db07a5ed6fa81612bb37d76408f5617c | /visualCuesBETA/src/main/java/com/visualcues/AudioPlayer.java | 8f16c331312fce721190db6de32ee6e03f11bdc2 | [] | no_license | GraceHuntley/VisualCues | https://github.com/GraceHuntley/VisualCues | 631f8e513054bd6cdf5694bcce6fa468edbb3d42 | b1210ae33a6d65b626e5b482b78c31d9414eba53 | refs/heads/master | 2021-05-27T19:06:37.205000 | 2014-08-28T21:10:43 | 2014-08-28T21:10:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.visualcues;
import java.io.IOException;
import android.content.Context;
import android.media.MediaPlayer;
/**
* @author cmac
*
*/
public class AudioPlayer extends MediaPlayer {
MediaPlayer player = new MediaPlayer();
private String filePath;
public AudioPlayer(String cueName, Context context) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
this.filePath = dbHelper.getAudio(cueName);
}
public void play() {
try {
player.setDataSource(filePath);
player.prepare();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
player.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
player.start();
}
});
player.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer arg0) {
player.stop();
player.release();
// player.reset();
}
});
}
}
| UTF-8 | Java | 1,146 | java | AudioPlayer.java | Java | [
{
"context": "\nimport android.media.MediaPlayer;\n\n/**\n * @author cmac\n * \n */\npublic class AudioPlayer extends MediaPla",
"end": 140,
"score": 0.9996131658554077,
"start": 136,
"tag": "USERNAME",
"value": "cmac"
}
] | null | [] | package com.visualcues;
import java.io.IOException;
import android.content.Context;
import android.media.MediaPlayer;
/**
* @author cmac
*
*/
public class AudioPlayer extends MediaPlayer {
MediaPlayer player = new MediaPlayer();
private String filePath;
public AudioPlayer(String cueName, Context context) {
DatabaseHelper dbHelper = new DatabaseHelper(context);
this.filePath = dbHelper.getAudio(cueName);
}
public void play() {
try {
player.setDataSource(filePath);
player.prepare();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
player.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
player.start();
}
});
player.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer arg0) {
player.stop();
player.release();
// player.reset();
}
});
}
}
| 1,146 | 0.676265 | 0.675393 | 63 | 17.190475 | 18.283358 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.936508 | false | false | 10 |
b6af04e50f505ec2555b35d0236949aabaa0469f | 6,442,451,014,055 | 471a1d9598d792c18392ca1485bbb3b29d1165c5 | /jadx-MFP/src/main/java/com/google/android/gms/internal/ads/zzsy.java | 5851f3cf4f202b9df1e6840c99087a66885b4e84 | [] | no_license | reed07/MyPreferencePal | https://github.com/reed07/MyPreferencePal | 84db3a93c114868dd3691217cc175a8675e5544f | 365b42fcc5670844187ae61b8cbc02c542aa348e | refs/heads/master | 2020-03-10T23:10:43.112000 | 2019-07-08T00:39:32 | 2019-07-08T00:39:32 | 129,635,379 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.google.android.gms.internal.ads;
import android.view.View;
final class zzsy implements Runnable {
private final /* synthetic */ View zzbyj;
private final /* synthetic */ zzsx zzbyk;
zzsy(zzsx zzsx, View view) {
this.zzbyk = zzsx;
this.zzbyj = view;
}
public final void run() {
this.zzbyk.zzk(this.zzbyj);
}
}
| UTF-8 | Java | 373 | java | zzsy.java | Java | [] | null | [] | package com.google.android.gms.internal.ads;
import android.view.View;
final class zzsy implements Runnable {
private final /* synthetic */ View zzbyj;
private final /* synthetic */ zzsx zzbyk;
zzsy(zzsx zzsx, View view) {
this.zzbyk = zzsx;
this.zzbyj = view;
}
public final void run() {
this.zzbyk.zzk(this.zzbyj);
}
}
| 373 | 0.630027 | 0.630027 | 17 | 20.941177 | 17.308517 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.470588 | false | false | 10 |
9080756b96a52d76374b1668321189b1c0d6e215 | 25,555,055,475,857 | d6df9fbef3742dcc36a6b53af0c116b1fbb7ad29 | /Hadoop_Share/ProjectsLocal/TestHadoop/src/cdw/hadoop/utils/FileLevelMD5.java | abc1fe636517caf6874faf6ddbb525df00a3c739 | [] | no_license | prashanth-r/DevWork | https://github.com/prashanth-r/DevWork | 5032f26a07e9da7886dffad5aaac058db4831256 | 52f4fe25be2131433771c71a3c919137a522ea70 | refs/heads/master | 2021-01-01T05:51:25.118000 | 2014-03-30T22:37:28 | 2014-03-30T22:37:28 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
*/
package cdw.hadoop.utils;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.MD5Hash;
/**
* @author k228680
*
* Given a file on HDFS, compute the MD5 for it.
* Streaming using md5sum command maybe another alternative. Has to be tested if default or standard InputFormats will work.
*
* Currently this is not a map reduce job, but can be turned into one by implementing a "Whole file" InputFormat
*
*/
public class FileLevelMD5 {
/**
* @param args
*/
private static final Log LOG = LogFactory.getLog(FileLevelMD5.class);
public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.err.println("Invalid arguments. Usage "+FileLevelMD5.class.getName()+" <HDFS File Name>");
}
Path inpHDFSFilePath = new Path(args[0]);
Configuration conf = new Configuration(); /* Default or Site */
FileSystem fs = FileSystem.get(conf);
if (!fs.exists(inpHDFSFilePath) || !fs.getFileStatus(inpHDFSFilePath).isFile()) {
throw new IOException("Input file name " + inpHDFSFilePath.toString()+ " does not exist or is not a directory.");
}
FSDataInputStream inputStream = fs.open(inpHDFSFilePath);
MD5Hash md5Hash = MD5Hash.digest(inputStream);
String md5Value = md5Hash.toString();
LOG.info(String.format("File = \"%s\", MD5 value = \"%s\"%n",inpHDFSFilePath.toString(),md5Value));
}
}
| UTF-8 | Java | 1,625 | java | FileLevelMD5.java | Java | [
{
"context": "port org.apache.hadoop.io.MD5Hash;\n\n/**\n * @author k228680\n *\n * Given a file on HDFS, compute the MD5 for i",
"end": 379,
"score": 0.9995121955871582,
"start": 372,
"tag": "USERNAME",
"value": "k228680"
}
] | null | [] | /**
*
*/
package cdw.hadoop.utils;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.MD5Hash;
/**
* @author k228680
*
* Given a file on HDFS, compute the MD5 for it.
* Streaming using md5sum command maybe another alternative. Has to be tested if default or standard InputFormats will work.
*
* Currently this is not a map reduce job, but can be turned into one by implementing a "Whole file" InputFormat
*
*/
public class FileLevelMD5 {
/**
* @param args
*/
private static final Log LOG = LogFactory.getLog(FileLevelMD5.class);
public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.err.println("Invalid arguments. Usage "+FileLevelMD5.class.getName()+" <HDFS File Name>");
}
Path inpHDFSFilePath = new Path(args[0]);
Configuration conf = new Configuration(); /* Default or Site */
FileSystem fs = FileSystem.get(conf);
if (!fs.exists(inpHDFSFilePath) || !fs.getFileStatus(inpHDFSFilePath).isFile()) {
throw new IOException("Input file name " + inpHDFSFilePath.toString()+ " does not exist or is not a directory.");
}
FSDataInputStream inputStream = fs.open(inpHDFSFilePath);
MD5Hash md5Hash = MD5Hash.digest(inputStream);
String md5Value = md5Hash.toString();
LOG.info(String.format("File = \"%s\", MD5 value = \"%s\"%n",inpHDFSFilePath.toString(),md5Value));
}
}
| 1,625 | 0.721846 | 0.708923 | 54 | 29.092592 | 34.354507 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.203704 | false | false | 10 |
9ee54c4547fff518bd95b85ac980536ffb9bcc20 | 5,806,795,847,801 | 8caf487866a143cb8f67a9e8049ece69f764d18d | /app/src/main/java/com/example/guillaume/onglets/findMapParcelle.java | 840a5d1bf74ab141366f06013a20cf1252bde6ce | [] | no_license | Gtortellier/applicationJE | https://github.com/Gtortellier/applicationJE | 6df3fdf43117a55ff785941a9cf89dcc61d35e11 | d19eb86d4534a4ccf5d77006f0a8a66979a845b5 | refs/heads/master | 2020-03-18T07:51:13.892000 | 2018-05-22T21:18:22 | 2018-05-22T21:18:22 | 134,476,393 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.guillaume.onglets;
import com.example.guillaume.onglets.geopoint;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by Guillaume on 11/12/2017.
*/
public class findMapParcelle {
private List<Map<String,String>> adresses;
private geopoint p;
public findMapParcelle(List<Map<String,String>> adresses, geopoint p){
this.p=p;
this.adresses=adresses;
}
public Map<String, String> getParcelle() {
Map<String,String> parcelle = null;
double lat=0;
double lon=0;
double distance=10;//arbitraire mais ça devrait être suffisant
double distanceMin=5;
for (Map<String,String> map : this.adresses){
lat= Double.valueOf(map.get("Y_WGS84"));
lon= Double.valueOf(map.get("X_WGS84"));
geopoint pbis = new geopoint(lat, lon);
distance=this.p.distance(pbis);
// dans le fichier d'adresses, plusieurs parcelles d'ident différents ont exactement les mêmes coordonnées
// mais les autres infos qu'on récupère sont les mêmes (PARCELLE;MOTCLA;ADRESSE;X_WGS84;Y_WGS84)
//on récupèrera donc uniquement la première parcelle.
//autre possibilité : supprimer les lignes doublons
if (distance<distanceMin){
distanceMin=distance;
parcelle=map;
}
}
return parcelle;
}
public void setP(geopoint p) {
this.p = p;
}
public geopoint getP() {
return p;
}
}
| UTF-8 | Java | 1,589 | java | findMapParcelle.java | Java | [
{
"context": "til.List;\nimport java.util.Map;\n\n/**\n * Created by Guillaume on 11/12/2017.\n */\n\npublic class findMapParcelle ",
"end": 189,
"score": 0.9996784329414368,
"start": 180,
"tag": "NAME",
"value": "Guillaume"
}
] | null | [] | package com.example.guillaume.onglets;
import com.example.guillaume.onglets.geopoint;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by Guillaume on 11/12/2017.
*/
public class findMapParcelle {
private List<Map<String,String>> adresses;
private geopoint p;
public findMapParcelle(List<Map<String,String>> adresses, geopoint p){
this.p=p;
this.adresses=adresses;
}
public Map<String, String> getParcelle() {
Map<String,String> parcelle = null;
double lat=0;
double lon=0;
double distance=10;//arbitraire mais ça devrait être suffisant
double distanceMin=5;
for (Map<String,String> map : this.adresses){
lat= Double.valueOf(map.get("Y_WGS84"));
lon= Double.valueOf(map.get("X_WGS84"));
geopoint pbis = new geopoint(lat, lon);
distance=this.p.distance(pbis);
// dans le fichier d'adresses, plusieurs parcelles d'ident différents ont exactement les mêmes coordonnées
// mais les autres infos qu'on récupère sont les mêmes (PARCELLE;MOTCLA;ADRESSE;X_WGS84;Y_WGS84)
//on récupèrera donc uniquement la première parcelle.
//autre possibilité : supprimer les lignes doublons
if (distance<distanceMin){
distanceMin=distance;
parcelle=map;
}
}
return parcelle;
}
public void setP(geopoint p) {
this.p = p;
}
public geopoint getP() {
return p;
}
}
| 1,589 | 0.620165 | 0.606848 | 54 | 28.203703 | 26.597395 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.648148 | false | false | 10 |
b11f1ebd321437027079ae19a70225c185d70bbe | 35,012,573,410,349 | 5f8109fa4637634b458c196967e0a8d9a0bb2c3c | /workspace_08_13/project/src/org/mindrot/jbcrypt/test.java | c0e48b038bfe650b89d5cc04d0bc6c974e7f6b57 | [] | no_license | mini222333/mini | https://github.com/mini222333/mini | 72e7a9f2126dfdd0b5dde551cfaa4d375c0256d2 | 787b02e0d4db27a208a3e2cac652711898ed2cbe | refs/heads/master | 2020-07-29T09:31:16.776000 | 2019-09-20T08:54:40 | 2019-09-20T08:54:40 | 209,746,612 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.mindrot.jbcrypt;
public class test {
public static void main(String[] args) {
String password="mini01"; //회원가입 프로젝트7 리퀘스트 입력받는식으로 반반 나눠서. 입력받는파일 참고
// Hash a password for the first time
String hashed = BCrypt.hashpw(password, BCrypt.gensalt(10));
// gensalt's log_rounds parameter determines the complexity
// the work factor is 2**log_rounds, and the default is 10
//String hashed = BCrypt.hashpw(password, BCrypt.gensalt(12));
String candidate="mini00"; //로그인할때 비번 입력
// Check that an unencrypted password matches one that has
// previously been hashed
System.out.println(candidate);
if (BCrypt.checkpw(candidate, hashed))
System.out.println("It matches");
else
System.out.println("It does not match");
String candidate2="mini01"; //로그인할때 비번 입력
// Check that an unencrypted password matches one that has
// previously been hashed
System.out.println(candidate2);
if (BCrypt.checkpw(candidate2, hashed))
System.out.println("It matches");
else
System.out.println("It does not match");
}
}
| UTF-8 | Java | 1,192 | java | test.java | Java | [
{
"context": "ic void main(String[] args) {\r\n\t\tString password=\"mini01\"; //회원가입 프로젝트7 리퀘스트 입력받는식으로 반반 나눠서. 입력받는파일 참고\r\n\t\t",
"end": 121,
"score": 0.9983432292938232,
"start": 115,
"tag": "PASSWORD",
"value": "mini01"
},
{
"context": "ssword, BCrypt.gensalt(12));\r\n\t\tString... | null | [] | package org.mindrot.jbcrypt;
public class test {
public static void main(String[] args) {
String password="<PASSWORD>"; //회원가입 프로젝트7 리퀘스트 입력받는식으로 반반 나눠서. 입력받는파일 참고
// Hash a password for the first time
String hashed = BCrypt.hashpw(password, BCrypt.gensalt(10));
// gensalt's log_rounds parameter determines the complexity
// the work factor is 2**log_rounds, and the default is 10
//String hashed = BCrypt.hashpw(password, BCrypt.gensalt(12));
String candidate="mini00"; //로그인할때 비번 입력
// Check that an unencrypted password matches one that has
// previously been hashed
System.out.println(candidate);
if (BCrypt.checkpw(candidate, hashed))
System.out.println("It matches");
else
System.out.println("It does not match");
String candidate2="mini01"; //로그인할때 비번 입력
// Check that an unencrypted password matches one that has
// previously been hashed
System.out.println(candidate2);
if (BCrypt.checkpw(candidate2, hashed))
System.out.println("It matches");
else
System.out.println("It does not match");
}
}
| 1,196 | 0.695971 | 0.680403 | 32 | 32.125 | 22.125706 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.25 | false | false | 10 |
e615d56dd10d25649304c90a5739839000f045a3 | 7,215,545,074,031 | 73a963084831a1b0874b3781d3bd79abb2f0cae6 | /app/src/main/java/com/example/myapplicationopencv/DetectColourActivity.java | 30296e8d459ba50f931a8d891f95312357ac5d93 | [] | no_license | edwinsaavedra99/MyApplicationOpenCV | https://github.com/edwinsaavedra99/MyApplicationOpenCV | 164c6f2fbb8739495836e0fa6feaa094c79d756e | 519159c7b9763d6299246ac2c724eafbd602f4ae | refs/heads/master | 2020-12-21T10:43:46.228000 | 2020-01-31T19:52:39 | 2020-01-31T19:52:39 | 236,407,787 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.myapplicationopencv;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.JavaCamera2View;
import org.opencv.android.JavaCameraView;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
public class DetectColourActivity extends AppCompatActivity implements CameraBridgeViewBase.CvCameraViewListener2{
static {
if(!OpenCVLoader.initDebug()){
Log.d("TAG","OpenCV not loaded");
}else{
Log.d("TAG","OpenCV loaded");
}
}
int iLowH=45;
int iHighH=75;
int iLowS = 20;
int iHighS =255;
int iLowV = 10;
int iHighV = 255;
Mat imgHSV, imgThresholded;
Scalar sc1,sc2;
JavaCameraView cameraView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_detect_colour);
sc1 = new Scalar(iLowH,iLowS,iLowV);
sc2 = new Scalar(iHighH,iHighS,iHighV);
cameraView = (JavaCameraView) findViewById(R.id.cameraview1);
cameraView.setCameraIndex(0);
cameraView.setCvCameraViewListener(this);
cameraView.enableView();
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.main_menu,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem){
switch (menuItem.getItemId()){
case R.id.detectBordes:
onPause();
Intent intent0 = new Intent(this,MainActivity.class);
startActivity(intent0);
return true;
case R.id.detectColour:
onPause();
Intent intent = new Intent(this, DetectColourActivity.class);
startActivity(intent);
return true;
case R.id.detectBlod:
onPause();
Intent intent2 = new Intent(this, BaseColourDetectionActivity.class);
startActivity(intent2);
return true;
case R.id.detectFase:
onPause();
Intent intent3 = new Intent(this, FdActivity.class);
startActivity(intent3);
return true;
case R.id.FindFeatures:
onPause();
Intent intent5 = new Intent(this, FindFeaturesActivity.class);
startActivity(intent5);
return true;
case R.id.Posterize:
onPause();
Intent intent4 = new Intent(this, PosterizeActivity.class);
startActivity(intent4);
return true;
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onPause() {
super.onPause();
cameraView.disableView();
}
@Override
public void onCameraViewStarted(int width, int height) {
imgHSV = new Mat(width,height, CvType.CV_16UC4);
imgThresholded = new Mat(width,height, CvType.CV_16UC4);
}
@Override
public void onCameraViewStopped() {
}
@Override
public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
Imgproc.cvtColor(inputFrame.rgba(),imgHSV,Imgproc.COLOR_BGR2HSV);
Core.inRange(imgHSV,sc1,sc2,imgThresholded);
return imgThresholded;
}
}
| UTF-8 | Java | 4,080 | java | DetectColourActivity.java | Java | [] | null | [] | package com.example.myapplicationopencv;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.JavaCamera2View;
import org.opencv.android.JavaCameraView;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
public class DetectColourActivity extends AppCompatActivity implements CameraBridgeViewBase.CvCameraViewListener2{
static {
if(!OpenCVLoader.initDebug()){
Log.d("TAG","OpenCV not loaded");
}else{
Log.d("TAG","OpenCV loaded");
}
}
int iLowH=45;
int iHighH=75;
int iLowS = 20;
int iHighS =255;
int iLowV = 10;
int iHighV = 255;
Mat imgHSV, imgThresholded;
Scalar sc1,sc2;
JavaCameraView cameraView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_detect_colour);
sc1 = new Scalar(iLowH,iLowS,iLowV);
sc2 = new Scalar(iHighH,iHighS,iHighV);
cameraView = (JavaCameraView) findViewById(R.id.cameraview1);
cameraView.setCameraIndex(0);
cameraView.setCvCameraViewListener(this);
cameraView.enableView();
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.main_menu,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem){
switch (menuItem.getItemId()){
case R.id.detectBordes:
onPause();
Intent intent0 = new Intent(this,MainActivity.class);
startActivity(intent0);
return true;
case R.id.detectColour:
onPause();
Intent intent = new Intent(this, DetectColourActivity.class);
startActivity(intent);
return true;
case R.id.detectBlod:
onPause();
Intent intent2 = new Intent(this, BaseColourDetectionActivity.class);
startActivity(intent2);
return true;
case R.id.detectFase:
onPause();
Intent intent3 = new Intent(this, FdActivity.class);
startActivity(intent3);
return true;
case R.id.FindFeatures:
onPause();
Intent intent5 = new Intent(this, FindFeaturesActivity.class);
startActivity(intent5);
return true;
case R.id.Posterize:
onPause();
Intent intent4 = new Intent(this, PosterizeActivity.class);
startActivity(intent4);
return true;
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onPause() {
super.onPause();
cameraView.disableView();
}
@Override
public void onCameraViewStarted(int width, int height) {
imgHSV = new Mat(width,height, CvType.CV_16UC4);
imgThresholded = new Mat(width,height, CvType.CV_16UC4);
}
@Override
public void onCameraViewStopped() {
}
@Override
public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
Imgproc.cvtColor(inputFrame.rgba(),imgHSV,Imgproc.COLOR_BGR2HSV);
Core.inRange(imgHSV,sc1,sc2,imgThresholded);
return imgThresholded;
}
}
| 4,080 | 0.642157 | 0.632108 | 126 | 31.380953 | 23.547607 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.801587 | false | false | 10 |
bda40a0fa9633262a94fd1fe2c974a1a1a4e7528 | 14,388,140,511,561 | 10c277a7a149a3121ce3d3e88df8291e4ccc2a5f | /src/ch/st/datacollector/server/Server.java | 49f185d9b8675415111ab3c29bc1cd0e2fc585c2 | [] | no_license | Phong6698/ST-DataCollector-Server | https://github.com/Phong6698/ST-DataCollector-Server | 7d35eae76fa4fa4f5171b072edb43a9d05ecb6cf | 00e387534be62f19e8a135807a2dff6fb62da860 | refs/heads/master | 2020-12-31T06:24:13.602000 | 2016-09-16T12:57:31 | 2016-09-16T12:57:31 | 58,833,226 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ch.st.datacollector.server;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
*
* Created by Phong6698 on 16.05.2016.
*
* @author Phong6698
*/
public class Server {
GameCheckerTask gameCheckerTask;
public Server(){
gameCheckerTask = new GameCheckerTask(0, 20);
}
public void start(){
System.out.println("Start Server");
gameCheckerTask.start();
}
public void shutdown(){
System.out.println("Shutdown Server");
gameCheckerTask.shutdown();
}
public void restart(){
System.out.println("Restart Server");
gameCheckerTask.restart();
}
}
| UTF-8 | Java | 804 | java | Server.java | Java | [
{
"context": "va.util.concurrent.TimeUnit;\n\n/**\n *\n * Created by Phong6698 on 16.05.2016.\n *\n * @author Phong6698\n */\npublic",
"end": 274,
"score": 0.9995883107185364,
"start": 265,
"tag": "USERNAME",
"value": "Phong6698"
},
{
"context": " Created by Phong6698 on 16.05.2016.\... | null | [] | package ch.st.datacollector.server;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
*
* Created by Phong6698 on 16.05.2016.
*
* @author Phong6698
*/
public class Server {
GameCheckerTask gameCheckerTask;
public Server(){
gameCheckerTask = new GameCheckerTask(0, 20);
}
public void start(){
System.out.println("Start Server");
gameCheckerTask.start();
}
public void shutdown(){
System.out.println("Shutdown Server");
gameCheckerTask.shutdown();
}
public void restart(){
System.out.println("Restart Server");
gameCheckerTask.restart();
}
}
| 804 | 0.674129 | 0.650497 | 38 | 20.157894 | 17.351667 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.421053 | false | false | 10 |
2bdaf03fd8e22b11b35cd6d20d3ba32a8de8ca54 | 24,979,529,804,379 | 0affa1abd80290053b27c30e76122dc3624447a3 | /common/src/main/java/com/njwd/entity/ledger/dto/QueryVoucherEntryDto.java | 72e2c8489086d65ef278f51b30c709f86fb63485 | [] | no_license | moutainhigh/fiancee-center | https://github.com/moutainhigh/fiancee-center | 868ead6921822ef5c9f0b94b0f8588b8679f3cf9 | 54a9608bac28a09e5e401ae4881769e8fdf8b558 | refs/heads/master | 2022-11-11T17:48:46.286000 | 2020-07-07T14:32:26 | 2020-07-07T14:32:26 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.njwd.entity.ledger.dto;
import com.njwd.entity.base.query.BaseLedgerQueryDto;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author xyyxhcj@qq.com
* @since 2019/07/24
*/
@Getter
@Setter
public class QueryVoucherEntryDto extends BaseLedgerQueryDto {
private static final long serialVersionUID = -1603424478695763559L;
/**
* 分录是否修改 1是 0否
*/
private byte isModify;
/**
* 制单日期
*/
private List<String> voucherDate;
/**
* 制单日期查询类型
*/
private byte voucherDateOperator;
/**
* 现金流量查询类型
*/
private byte cashFlowItemOperator;
/**
* 现金流量Id集合
*/
private List<Long> cashFlowItemIds;
/**
* 是否展示科目全名(0:不展示, 1:展示 默认0)
*/
private Byte isShowFullName;
}
| UTF-8 | Java | 832 | java | QueryVoucherEntryDto.java | Java | [
{
"context": "ok.Setter;\n\nimport java.util.List;\n\n/**\n * @author xyyxhcj@qq.com\n * @since 2019/07/24\n */\n@Getter\n@Setter\npublic c",
"end": 189,
"score": 0.9999219179153442,
"start": 175,
"tag": "EMAIL",
"value": "xyyxhcj@qq.com"
}
] | null | [] | package com.njwd.entity.ledger.dto;
import com.njwd.entity.base.query.BaseLedgerQueryDto;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author <EMAIL>
* @since 2019/07/24
*/
@Getter
@Setter
public class QueryVoucherEntryDto extends BaseLedgerQueryDto {
private static final long serialVersionUID = -1603424478695763559L;
/**
* 分录是否修改 1是 0否
*/
private byte isModify;
/**
* 制单日期
*/
private List<String> voucherDate;
/**
* 制单日期查询类型
*/
private byte voucherDateOperator;
/**
* 现金流量查询类型
*/
private byte cashFlowItemOperator;
/**
* 现金流量Id集合
*/
private List<Long> cashFlowItemIds;
/**
* 是否展示科目全名(0:不展示, 1:展示 默认0)
*/
private Byte isShowFullName;
}
| 825 | 0.693681 | 0.649725 | 51 | 13.274509 | 16.609798 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.72549 | false | false | 10 |
25c608ac64d67c82117fdc06a662a96d949737ea | 7,086,696,042,394 | 3822c1f1b2b96643d537923a049354121f61d06e | /src/main/java/com/enhide/configuration/AuthorizationServerConfiguration.java | 58e3d73224a1285914e8849705cdafcc5c314f6f | [
"MIT"
] | permissive | edwinhere/Boilerplate | https://github.com/edwinhere/Boilerplate | ac774e378771c41a1dc08896213bb663d81be748 | 5f24ae3ee6fdbfa8135c3b7d92a2cdb92c6af001 | refs/heads/master | 2016-05-31T21:40:24.191000 | 2015-07-12T15:41:40 | 2015-07-12T15:41:40 | 36,715,808 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.enhide.configuration;
import com.enhide.services.CustomUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
/**
*
* @author edwinhere@gmail.com
*/
@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfiguration extends
AuthorizationServerConfigurerAdapter {
private static final String RESOURCE_ID = "restservice";
private TokenStore tokenStore = new InMemoryTokenStore();
@Autowired
@Qualifier("authenticationManagerBean")
private AuthenticationManager authenticationManager;
@Autowired
private CustomUserDetailsService userDetailsService;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints)
throws Exception {
// @formatter:off
endpoints
.tokenStore(this.tokenStore)
.authenticationManager(this.authenticationManager)
.userDetailsService(userDetailsService);
// @formatter:on
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
// @formatter:off
clients
.inMemory()
.withClient("clientapp")
.authorizedGrantTypes("password", "refresh_token")
.authorities("GUEST")
.scopes("read", "write")
.resourceIds(RESOURCE_ID)
.secret("123456");
// @formatter:on
}
@Bean
@Primary
public DefaultTokenServices tokenServices() {
DefaultTokenServices tokenServices = new DefaultTokenServices();
tokenServices.setSupportRefreshToken(true);
tokenServices.setTokenStore(this.tokenStore);
return tokenServices;
}
}
| UTF-8 | Java | 2,571 | java | AuthorizationServerConfiguration.java | Java | [
{
"context": "n.store.InMemoryTokenStore;\r\n\r\n/**\r\n *\r\n * @author edwinhere@gmail.com\r\n */\r\n@Configuration\r\n@EnableAuthorizationServer\r",
"end": 1192,
"score": 0.9999250173568726,
"start": 1173,
"tag": "EMAIL",
"value": "edwinhere@gmail.com"
},
{
"context": "rite\")\r\n... | null | [] | package com.enhide.configuration;
import com.enhide.services.CustomUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
/**
*
* @author <EMAIL>
*/
@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfiguration extends
AuthorizationServerConfigurerAdapter {
private static final String RESOURCE_ID = "restservice";
private TokenStore tokenStore = new InMemoryTokenStore();
@Autowired
@Qualifier("authenticationManagerBean")
private AuthenticationManager authenticationManager;
@Autowired
private CustomUserDetailsService userDetailsService;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints)
throws Exception {
// @formatter:off
endpoints
.tokenStore(this.tokenStore)
.authenticationManager(this.authenticationManager)
.userDetailsService(userDetailsService);
// @formatter:on
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
// @formatter:off
clients
.inMemory()
.withClient("clientapp")
.authorizedGrantTypes("password", "refresh_token")
.authorities("GUEST")
.scopes("read", "write")
.resourceIds(RESOURCE_ID)
.secret("123456");
// @formatter:on
}
@Bean
@Primary
public DefaultTokenServices tokenServices() {
DefaultTokenServices tokenServices = new DefaultTokenServices();
tokenServices.setSupportRefreshToken(true);
tokenServices.setTokenStore(this.tokenStore);
return tokenServices;
}
}
| 2,559 | 0.804745 | 0.799689 | 71 | 34.211269 | 30.680964 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.366197 | false | false | 10 |
8bf285345778fd3418adb5b244253d062c25de14 | 32,418,413,158,233 | 4a421ed29cb0ec5dae4b6328cbf322ee958289df | /dt-gmcc-hdp-sample/dt-gmcc-hdp-demo/src/main/java/com/gmcc/hdp/demo/hive/HiveKrbDemo.java | 89ecef62fc4d473745a49cb52e67ad1eb771f37f | [] | no_license | lky1991/gmcc-hdp | https://github.com/lky1991/gmcc-hdp | caa6feda413a81ad1575566ba5ddec77bf38644f | 37bc0731ab5a94533b7b7a3429d62e867ddafe2e | refs/heads/master | 2021-01-11T10:17:02.115000 | 2016-11-02T02:06:09 | 2016-11-02T02:06:09 | 72,536,341 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.gmcc.hdp.demo.hive;
import com.gmcc.hdp.demo.util.HDPSampleConfiguration;
import org.apache.hadoop.conf.Configuration;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
/**
* 基于kerberos进行hive的开发,在开发过程中留意在代码注释中提示的不同之处
* Created by makun on 16/7/15.
*/
public class HiveKrbDemo {
private Connection con = null;
private ArrayList<String> hiveServerList = null;
private String dataBaseName = null;
private Statement statement = null;
private Configuration conf = null;
public HiveKrbDemo(String dataBaseName) {
this.dataBaseName = dataBaseName;//数据库名称
String hiveServerName = HDPSampleConfiguration.HIVE_SERVER_NAME;//加载hive server的配置文件
hiveServerList = new ArrayList<String>();
if (hiveServerName != null) {
hiveServerList.addAll(Arrays.asList(hiveServerName.split(",")));
}
}
/**
* 建立数据库连接,kerberos场景下的主要不同处
*
* @param server
* @return
*/
public boolean connection(String server) {
boolean flag = false;
try {
Class.forName(HDPSampleConfiguration.HIVE_DRIVER_NAME);
/**
* 对于使用kerberos连接时,与非kerberos不同地方:
* 非kerberos连接:jdbc:hive2://hive2_host:10000/database;user=User;password=userPassword
* kerberos连接:jdbc:hive2://hive2_host:10000/database;principal=hive/hive2_host@YOUR-REALM.COM
* 详情可参考:http://www.cloudera.com/documentation/archive/cdh/4-x/4-2-0/CDH4-Security-Guide/cdh4sg_topic_9_1.html
*/
String url = "jdbc:hive2://" + server + ":10000/" + dataBaseName + ";principal=" + HDPSampleConfiguration.HIVE_KERBEROS_PRINCIPAL;
con = DriverManager.getConnection(url, "", "");
if (null != con) {
flag = true;
}
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
/**
* 连接Hive数据库
*
* @return
*/
public boolean connHive() {
boolean flag = false;
for (String server : hiveServerList) {
if (connection(server)) {
flag = true;
break;
}
}
return flag;
}
/**
* 关闭Hive数据库
*/
public void closeResource() {
try {
if (null != statement) {
statement.close();
}
if (null != con) {
con.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 创建表
*
* @param table
*/
public boolean createHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
boolean flag = false;
try {
if (statement == null) {
statement = con.createStatement();
}
flag = statement.execute("create table if not exists " + table + "(LA_CODE String,BSCAD00 String,PROVINCE_NAME_CH String,CITY_NAME_CH String,TOWN_NAME_CH String,CELL_NAME_CN String) row format delimited fields terminated by ',' STORED AS TEXTFILE");
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
/**
* 查看数据库中的所有表
*/
public void showDatabaseTables() {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
ResultSet resultSet = null;
String sql = "show tables ";
resultSet = statement.executeQuery(sql);
if (null != resultSet) {
while (resultSet.next()) {
System.out.println(resultSet.getString(1));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 查看表中所有数据
*
* @param table
*/
public void searchHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
ResultSet resultSet = null;
String sql = "select * from " + table + " where CITY_NAME_CH like '%广州市%'";
resultSet = statement.executeQuery(sql);
if (null != resultSet) {
while (resultSet.next()) {
System.out.println(resultSet.getString(1) + " " + resultSet.getString(2) + " " + resultSet.getString(3) + " " + resultSet.getString(4) + " " + resultSet.getString(5) + " " + resultSet.getString(6));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 向表中加载数据
*
* @param table
*/
public void insertHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
statement.execute("LOAD DATA INPATH '/tmp/2G_user_location_data.csv' OVERWRITE INTO TABLE " + table);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除表
*
* @param table
*/
public boolean deleteHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
boolean flag = false;
try {
if (statement == null) {
statement = con.createStatement();
}
flag = statement.execute("drop table if exists " + table);
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
}
| UTF-8 | Java | 6,606 | java | HiveKrbDemo.java | Java | [
{
"context": "beros进行hive的开发,在开发过程中留意在代码注释中提示的不同之处\n * Created by makun on 16/7/15.\n */\npublic class HiveKrbDemo {\n\n p",
"end": 368,
"score": 0.9995311498641968,
"start": 363,
"tag": "USERNAME",
"value": "makun"
},
{
"context": "e2://hive2_host:10000/database;user=User;passwor... | null | [] | package com.gmcc.hdp.demo.hive;
import com.gmcc.hdp.demo.util.HDPSampleConfiguration;
import org.apache.hadoop.conf.Configuration;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
/**
* 基于kerberos进行hive的开发,在开发过程中留意在代码注释中提示的不同之处
* Created by makun on 16/7/15.
*/
public class HiveKrbDemo {
private Connection con = null;
private ArrayList<String> hiveServerList = null;
private String dataBaseName = null;
private Statement statement = null;
private Configuration conf = null;
public HiveKrbDemo(String dataBaseName) {
this.dataBaseName = dataBaseName;//数据库名称
String hiveServerName = HDPSampleConfiguration.HIVE_SERVER_NAME;//加载hive server的配置文件
hiveServerList = new ArrayList<String>();
if (hiveServerName != null) {
hiveServerList.addAll(Arrays.asList(hiveServerName.split(",")));
}
}
/**
* 建立数据库连接,kerberos场景下的主要不同处
*
* @param server
* @return
*/
public boolean connection(String server) {
boolean flag = false;
try {
Class.forName(HDPSampleConfiguration.HIVE_DRIVER_NAME);
/**
* 对于使用kerberos连接时,与非kerberos不同地方:
* 非kerberos连接:jdbc:hive2://hive2_host:10000/database;user=User;password=<PASSWORD>
* kerberos连接:jdbc:hive2://hive2_host:10000/database;principal=hive/hive2_host@YOUR-REALM.COM
* 详情可参考:http://www.cloudera.com/documentation/archive/cdh/4-x/4-2-0/CDH4-Security-Guide/cdh4sg_topic_9_1.html
*/
String url = "jdbc:hive2://" + server + ":10000/" + dataBaseName + ";principal=" + HDPSampleConfiguration.HIVE_KERBEROS_PRINCIPAL;
con = DriverManager.getConnection(url, "", "");
if (null != con) {
flag = true;
}
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
/**
* 连接Hive数据库
*
* @return
*/
public boolean connHive() {
boolean flag = false;
for (String server : hiveServerList) {
if (connection(server)) {
flag = true;
break;
}
}
return flag;
}
/**
* 关闭Hive数据库
*/
public void closeResource() {
try {
if (null != statement) {
statement.close();
}
if (null != con) {
con.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 创建表
*
* @param table
*/
public boolean createHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
boolean flag = false;
try {
if (statement == null) {
statement = con.createStatement();
}
flag = statement.execute("create table if not exists " + table + "(LA_CODE String,BSCAD00 String,PROVINCE_NAME_CH String,CITY_NAME_CH String,TOWN_NAME_CH String,CELL_NAME_CN String) row format delimited fields terminated by ',' STORED AS TEXTFILE");
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
/**
* 查看数据库中的所有表
*/
public void showDatabaseTables() {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
ResultSet resultSet = null;
String sql = "show tables ";
resultSet = statement.executeQuery(sql);
if (null != resultSet) {
while (resultSet.next()) {
System.out.println(resultSet.getString(1));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 查看表中所有数据
*
* @param table
*/
public void searchHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
ResultSet resultSet = null;
String sql = "select * from " + table + " where CITY_NAME_CH like '%广州市%'";
resultSet = statement.executeQuery(sql);
if (null != resultSet) {
while (resultSet.next()) {
System.out.println(resultSet.getString(1) + " " + resultSet.getString(2) + " " + resultSet.getString(3) + " " + resultSet.getString(4) + " " + resultSet.getString(5) + " " + resultSet.getString(6));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 向表中加载数据
*
* @param table
*/
public void insertHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
try {
if (statement == null) {
statement = con.createStatement();
}
statement.execute("LOAD DATA INPATH '/tmp/2G_user_location_data.csv' OVERWRITE INTO TABLE " + table);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除表
*
* @param table
*/
public boolean deleteHiveTable(String table) {
if (null == con) {
if (!connHive()) {
System.out.println("Hive 数据库连接错误");
}
}
boolean flag = false;
try {
if (statement == null) {
statement = con.createStatement();
}
flag = statement.execute("drop table if exists " + table);
return flag;
} catch (Exception e) {
e.printStackTrace();
return flag;
}
}
}
| 6,604 | 0.508585 | 0.50159 | 233 | 25.995708 | 30.196993 | 262 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.347639 | false | false | 10 |
755973b710d0507c830100b8e737b7e4dd53cd90 | 34,840,774,732,515 | 1601acef38b2e2b98e49c6beb270b879773f6a77 | /src/main/java/com/elephant/algorithm/exercise1_1/Exercise11.java | 7ba104eb78cb30fa5891ae65d74a26b80a2d98ed | [] | no_license | newbeess/AlgorithmsForthEdition | https://github.com/newbeess/AlgorithmsForthEdition | bbc2eb1f839f09739a6a40dbbc39a01f3850b7f8 | 846f24055231287540f74a22fd010dbb5e3e66d3 | refs/heads/master | 2016-09-13T06:04:18.765000 | 2016-05-30T02:25:55 | 2016-05-30T02:25:55 | 56,974,701 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.elephant.algorithm.exercise1_1;
import static com.elephant.util.Print.*;
import java.util.Random;
/**
* Created by elephant on 16/4/25.
*/
public class Exercise11 {
public static void main(String[] args) {
Random random = new Random(47);
boolean[][] array = new boolean[5][5];
for (int i = 0; i < array.length; i++)
for (int j = 0; j < array[i].length; j++) {
if (random.nextInt(i * j + 10) % 2 == 0)
array[i][j] = true;
else
array[i][j] = false;
}
printnb("\t");
for (int x = 0; x < array[0].length; x++)
printnb(x + "\t");
for (int i = 0; i < array.length; i++) {
print();
printnb(i + ": " + "\t");
for (int j = 0; j < array[i].length; j++) {
if (array[i][j] == true)
printnb("*" + "\t");
else
printnb(" " + "\t");
}
}
}
}
| UTF-8 | Java | 817 | java | Exercise11.java | Java | [
{
"context": "nt.*;\n\nimport java.util.Random;\n\n/**\n * Created by elephant on 16/4/25.\n */\npublic class Exercise11 {\n\tpublic",
"end": 139,
"score": 0.999690592288971,
"start": 131,
"tag": "USERNAME",
"value": "elephant"
}
] | null | [] | package com.elephant.algorithm.exercise1_1;
import static com.elephant.util.Print.*;
import java.util.Random;
/**
* Created by elephant on 16/4/25.
*/
public class Exercise11 {
public static void main(String[] args) {
Random random = new Random(47);
boolean[][] array = new boolean[5][5];
for (int i = 0; i < array.length; i++)
for (int j = 0; j < array[i].length; j++) {
if (random.nextInt(i * j + 10) % 2 == 0)
array[i][j] = true;
else
array[i][j] = false;
}
printnb("\t");
for (int x = 0; x < array[0].length; x++)
printnb(x + "\t");
for (int i = 0; i < array.length; i++) {
print();
printnb(i + ": " + "\t");
for (int j = 0; j < array[i].length; j++) {
if (array[i][j] == true)
printnb("*" + "\t");
else
printnb(" " + "\t");
}
}
}
}
| 817 | 0.52754 | 0.499388 | 37 | 21.081081 | 16.556828 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.594594 | false | false | 10 |
2f68e0dcc30202ef913e1f214ba1e18f786740e8 | 23,450,521,502,596 | 6a02dbfaf31cee2cccd085b011f8ea8597a3f09f | /src/main/java/com/hm/hm/codec/KryoPoolImpl.java | 117ebd1509de41f8b2c9427a9292bf442cd8f5c1 | [] | no_license | AntShakeTree/huimeitimes_cdss_cache | https://github.com/AntShakeTree/huimeitimes_cdss_cache | 8c493058d2a286bb4904d54b0117e378b820b584 | ea035b0f26e70b5332e6bd078ec7280fced5dcfb | refs/heads/master | 2021-01-13T00:53:09.402000 | 2016-01-20T08:33:11 | 2016-01-20T08:33:11 | 50,014,350 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hm.hm.codec;
import com.esotericsoftware.kryo.Kryo;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* Created by ant_shake_tree on 16/1/15.
*/
public class KryoPoolImpl implements KryoPool {
private final Queue<Kryo> objects = new ConcurrentLinkedQueue();
private final List<Class<?>> classes;
public KryoPoolImpl(List<Class<?>> classes) {
this.classes = classes;
}
public Kryo get() {
Kryo kryo;
if((kryo = (Kryo)this.objects.poll()) == null) {
kryo = this.createInstance();
}
return kryo;
}
public void yield(Kryo kryo) {
this.objects.offer(kryo);
}
protected Kryo createInstance() {
Kryo kryo = new Kryo();
kryo.setReferences(false);
Iterator it = this.classes.iterator();
while(it.hasNext()) {
Class clazz = (Class)it.next();
kryo.register(clazz);
}
return kryo;
}
}
| UTF-8 | Java | 1,047 | java | KryoPoolImpl.java | Java | [
{
"context": "ncurrent.ConcurrentLinkedQueue;\n\n/**\n * Created by ant_shake_tree on 16/1/15.\n */\npublic class KryoPoolImpl impleme",
"end": 224,
"score": 0.9996711611747742,
"start": 210,
"tag": "USERNAME",
"value": "ant_shake_tree"
}
] | null | [] | package com.hm.hm.codec;
import com.esotericsoftware.kryo.Kryo;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* Created by ant_shake_tree on 16/1/15.
*/
public class KryoPoolImpl implements KryoPool {
private final Queue<Kryo> objects = new ConcurrentLinkedQueue();
private final List<Class<?>> classes;
public KryoPoolImpl(List<Class<?>> classes) {
this.classes = classes;
}
public Kryo get() {
Kryo kryo;
if((kryo = (Kryo)this.objects.poll()) == null) {
kryo = this.createInstance();
}
return kryo;
}
public void yield(Kryo kryo) {
this.objects.offer(kryo);
}
protected Kryo createInstance() {
Kryo kryo = new Kryo();
kryo.setReferences(false);
Iterator it = this.classes.iterator();
while(it.hasNext()) {
Class clazz = (Class)it.next();
kryo.register(clazz);
}
return kryo;
}
}
| 1,047 | 0.608405 | 0.603629 | 45 | 22.266666 | 18.708761 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.422222 | false | false | 10 |
9642ba5cd0bc19c2c979b084c7ffd562c37db0fb | 17,729,625,005,293 | d1df685f917dfa705a94de05631d0986dac331c2 | /aynl.net/aynl-entity/src/main/java/aynl/net/entity/enums/AdvChannel.java | cd1826ee153249700d8cb6bb59553aa960da3ae1 | [] | no_license | lishaoy/dubbo-demo | https://github.com/lishaoy/dubbo-demo | 78fc34830bf9d643ad55272b482db626416d7ece | fc483bee07d4105321e48039e19f6a099b34648f | refs/heads/master | 2021-05-12T13:10:29.488000 | 2018-01-10T08:50:49 | 2018-01-10T08:50:49 | 116,927,952 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package aynl.net.entity.enums;
/**
* Created by lishaoyong on 10/7/17.
* 广告类型
*/
public enum AdvChannel {
//广告类型:0:轮播图,1:单图
/**
* 轮播
*/
CAROUSEL(0),
/**
* 图片
*/
IMG(1),
/**
* 文字
*/
TEXT(2),
/**
* 链接
*/
LINK(3),;
private final int value;
private AdvChannel(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
*
* @return null if the value is not found.
*/
public static AdvChannel findByValue(int value) {
switch (value) {
case 0:
return CAROUSEL;
case 1:
return IMG;
case 2:
return TEXT;
case 3:
return LINK;
default:
return null;
}
}
}
| UTF-8 | Java | 1,090 | java | AdvChannel.java | Java | [
{
"context": "package aynl.net.entity.enums;\n\n/**\n * Created by lishaoyong on 10/7/17.\n * 广告类型\n */\npublic enum AdvChannel {\n",
"end": 60,
"score": 0.9992690086364746,
"start": 50,
"tag": "USERNAME",
"value": "lishaoyong"
}
] | null | [] | package aynl.net.entity.enums;
/**
* Created by lishaoyong on 10/7/17.
* 广告类型
*/
public enum AdvChannel {
//广告类型:0:轮播图,1:单图
/**
* 轮播
*/
CAROUSEL(0),
/**
* 图片
*/
IMG(1),
/**
* 文字
*/
TEXT(2),
/**
* 链接
*/
LINK(3),;
private final int value;
private AdvChannel(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
*
* @return null if the value is not found.
*/
public static AdvChannel findByValue(int value) {
switch (value) {
case 0:
return CAROUSEL;
case 1:
return IMG;
case 2:
return TEXT;
case 3:
return LINK;
default:
return null;
}
}
}
| 1,090 | 0.456107 | 0.441794 | 64 | 15.375 | 16.596781 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.265625 | false | false | 10 |
2a10dd9f93f6ea202f735d9a81c9eeb9f9ea858e | 19,481,971,655,401 | 73b0455759b35cc73ebe4f08079a1bef1ebd889f | /src/migration/M009_CreatingServiceAssociationsTable.java | 17de093fb7284d98f1a333a889972152a01f2292 | [] | no_license | HugoPDF5/qualidade-SW | https://github.com/HugoPDF5/qualidade-SW | 57d35f343b794452ef6bf2689dd0f5c46cf9e48e | 4c589a3b69a9d333d1bfc2d7c344d44697e6b35b | refs/heads/master | 2023-07-13T16:33:40.727000 | 2021-09-02T03:44:36 | 2021-09-02T03:44:36 | 396,818,059 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package migration;
import java.sql.SQLException;
public class M009_CreatingServiceAssociationsTable extends Migration {
private static final int MIGRATION_VERSION = 9;
public M009_CreatingServiceAssociationsTable(){}
public void up() throws SQLException{
setVersion(MIGRATION_VERSION);
String queryForCourse = "";
queryForCourse+= "CREATE TABLE IF NOT EXISTS ServiceCourse (";
queryForCourse+= "id_service int NOT NULL,";
queryForCourse+= "id_course int NOT NULL,";
queryForCourse+= "FOREIGN KEY(id_service) REFERENCES Service (id_service),";
queryForCourse+= "FOREIGN KEY(id_course) REFERENCES Course (id_course)";
queryForCourse+= ")";
String queryForPackage = "";
queryForPackage+= "CREATE TABLE IF NOT EXISTS ServicePackage (";
queryForPackage+= "id_service int NOT NULL,";
queryForPackage+= "id_package int NOT NULL,";
queryForPackage+= "FOREIGN KEY(id_service) REFERENCES Service (id_service),";
queryForPackage+= "FOREIGN KEY(id_package) REFERENCES Package (id_package)";
queryForPackage+= ")";
setQuery(queryForCourse);
run();
setQuery(queryForPackage);
run();
}
}
| UTF-8 | Java | 1,136 | java | M009_CreatingServiceAssociationsTable.java | Java | [] | null | [] | package migration;
import java.sql.SQLException;
public class M009_CreatingServiceAssociationsTable extends Migration {
private static final int MIGRATION_VERSION = 9;
public M009_CreatingServiceAssociationsTable(){}
public void up() throws SQLException{
setVersion(MIGRATION_VERSION);
String queryForCourse = "";
queryForCourse+= "CREATE TABLE IF NOT EXISTS ServiceCourse (";
queryForCourse+= "id_service int NOT NULL,";
queryForCourse+= "id_course int NOT NULL,";
queryForCourse+= "FOREIGN KEY(id_service) REFERENCES Service (id_service),";
queryForCourse+= "FOREIGN KEY(id_course) REFERENCES Course (id_course)";
queryForCourse+= ")";
String queryForPackage = "";
queryForPackage+= "CREATE TABLE IF NOT EXISTS ServicePackage (";
queryForPackage+= "id_service int NOT NULL,";
queryForPackage+= "id_package int NOT NULL,";
queryForPackage+= "FOREIGN KEY(id_service) REFERENCES Service (id_service),";
queryForPackage+= "FOREIGN KEY(id_package) REFERENCES Package (id_package)";
queryForPackage+= ")";
setQuery(queryForCourse);
run();
setQuery(queryForPackage);
run();
}
}
| 1,136 | 0.729753 | 0.723592 | 37 | 29.702703 | 26.511461 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.189189 | false | false | 10 |
df3e43b13475a10afec3442055b565d8572642d2 | 3,049,426,800,554 | 545cdcd2ec107cab4bb3dc3af26cad276e8c8503 | /src/PaperLessPost1.java | ceee2e46bfbf1053ac23f0a379ee9ef46714c725 | [] | no_license | BinalCodes/Interviews | https://github.com/BinalCodes/Interviews | d978ef673b1a699f44a138a35b8d8413df1bcfed | 7b4aafddd7791c9c7044226ca363bdaf8afba47a | refs/heads/master | 2020-04-13T21:14:29.223000 | 2019-01-22T04:39:38 | 2019-01-22T04:39:38 | 163,450,820 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Implement min stack with O(1) as the time
*
*/
public class PaperLessPost1 {
static class Node{
Node next;
int val;
int min;
Node(int val, int min){
this.val = val;
this.min = min;
}
}
Node top;
public void push(int v) {
if(top == null) {
Node n = new Node(v,v);
top = n;
}
else {
Node n = new Node(v, Math.min(v, top.min));
n.next = top;
top =n;
}
System.out.println("Pushed "+v +" to the top of stack with min "+top.min);
}
public int pop() {
if(top ==null)
return -1;
Node tmp = top;
top = tmp.next;
tmp.next = null;
return tmp.val;
}
public int getMin() {
if(top ==null)
return -1;
return top.min;
}
public static void main(String[] args) {
PaperLessPost1 stack = new PaperLessPost1();
stack.push(12);
stack.push(31);
stack.push(10);
stack.push(1);
stack.push(5);
stack.push(14);
System.out.println("Popped "+stack.pop());
System.out.println("Popped "+stack.pop());
System.out.println("Popped "+stack.pop());
stack.push(4);
System.out.println("Popped "+stack.pop());
System.out.println("Minimum element is "+stack.getMin());
stack.push(1);
stack.push(114);
}
}
| UTF-8 | Java | 1,178 | java | PaperLessPost1.java | Java | [] | null | [] | /*
* Implement min stack with O(1) as the time
*
*/
public class PaperLessPost1 {
static class Node{
Node next;
int val;
int min;
Node(int val, int min){
this.val = val;
this.min = min;
}
}
Node top;
public void push(int v) {
if(top == null) {
Node n = new Node(v,v);
top = n;
}
else {
Node n = new Node(v, Math.min(v, top.min));
n.next = top;
top =n;
}
System.out.println("Pushed "+v +" to the top of stack with min "+top.min);
}
public int pop() {
if(top ==null)
return -1;
Node tmp = top;
top = tmp.next;
tmp.next = null;
return tmp.val;
}
public int getMin() {
if(top ==null)
return -1;
return top.min;
}
public static void main(String[] args) {
PaperLessPost1 stack = new PaperLessPost1();
stack.push(12);
stack.push(31);
stack.push(10);
stack.push(1);
stack.push(5);
stack.push(14);
System.out.println("Popped "+stack.pop());
System.out.println("Popped "+stack.pop());
System.out.println("Popped "+stack.pop());
stack.push(4);
System.out.println("Popped "+stack.pop());
System.out.println("Minimum element is "+stack.getMin());
stack.push(1);
stack.push(114);
}
}
| 1,178 | 0.605263 | 0.587436 | 60 | 18.633333 | 15.779698 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.333333 | false | false | 10 |
2e7746b8b62ed8b9e3d961ea4ab9f2eb3a6ed1a1 | 15,977,278,346,089 | 97f442e1fa067746cb125ef35946fdc8f5925787 | /com/google/inject/OutOfScopeException.java | d55f8747d04034ee0ad95a52d657df0cae729532 | [
"MIT"
] | permissive | CoOwner/VisualPvP | https://github.com/CoOwner/VisualPvP | 1667e61c303a1f654fe4ed3e599ba6e74a1c115a | c92d1dcf40a812787e32e8a21d6462b57e755b99 | refs/heads/master | 2020-07-02T14:05:14.310000 | 2019-08-09T22:23:52 | 2019-08-09T22:23:52 | 201,546,751 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.google.inject;
public final class OutOfScopeException
extends RuntimeException
{
public OutOfScopeException(String message)
{
super(message);
}
public OutOfScopeException(String message, Throwable cause) {
super(message, cause);
}
public OutOfScopeException(Throwable cause) {
super(cause);
}
}
| UTF-8 | Java | 363 | java | OutOfScopeException.java | Java | [] | null | [] | package com.google.inject;
public final class OutOfScopeException
extends RuntimeException
{
public OutOfScopeException(String message)
{
super(message);
}
public OutOfScopeException(String message, Throwable cause) {
super(message, cause);
}
public OutOfScopeException(Throwable cause) {
super(cause);
}
}
| 363 | 0.683196 | 0.683196 | 39 | 8.307693 | 15.681369 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | false | false | 10 |
f477254051000e22469e546b8a55f70c67b7f794 | 19,215,683,696,389 | 4030875040bbc5ee13ad00a52191d677c20ff08c | /02 - serviceCalculator/src/main/java/LD/model/Enums/EntryPeriodCreation.java | 0e9199a273fcfe972ac200d67f5dfafb960a0f10 | [] | no_license | MaratFayz/LD | https://github.com/MaratFayz/LD | 7b497480367e28342de423a53b09014959483ef1 | 00718daba1fe8ac7b02a9dc8dcfe6e3ca4a672b9 | refs/heads/master | 2021-04-19T23:46:42.795000 | 2021-01-30T10:33:49 | 2021-01-30T10:33:49 | 249,641,721 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package LD.model.Enums;
public enum EntryPeriodCreation {
CURRENT_PERIOD,
AFTER_CLOSING_PERIOD
}
| UTF-8 | Java | 106 | java | EntryPeriodCreation.java | Java | [] | null | [] | package LD.model.Enums;
public enum EntryPeriodCreation {
CURRENT_PERIOD,
AFTER_CLOSING_PERIOD
}
| 106 | 0.745283 | 0.745283 | 6 | 16.666666 | 12.174655 | 33 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 10 |
c2b9c7ca5ce61f47d16c209001a3aaf9a1e1c03e | 37,684,043,058,427 | 94475242b2383228febb1c0fd6db672ab92e846f | /app/src/main/java/com/yadong/takeout/presenter/fragment/GoodsPresenter.java | 1f45f5f9987899ddb4e74bb188a0029d86660164 | [] | no_license | zhangsifan66/TakeOut-1 | https://github.com/zhangsifan66/TakeOut-1 | e7a048b3bc8e3892bde8a3622951e9c92c2cbbef | 4f8bd06289943a58674911342b314e48612e165e | refs/heads/master | 2020-03-08T03:26:12.089000 | 2017-07-31T06:12:33 | 2017-07-31T06:12:33 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yadong.takeout.presenter.fragment;
import com.yadong.takeout.data.model.GoodsModel;
import com.yadong.takeout.data.net.bean.StoreMealInfo;
import com.yadong.takeout.presenter.contract.GoodsContract;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
*
*/
public class GoodsPresenter implements GoodsContract.Presenter {
private GoodsModel mModel;
private GoodsContract.View mView;
public GoodsPresenter(GoodsContract.View view, GoodsModel model) {
this.mView = view;
this.mModel = model;
}
@Override
public void getGoodsData() {
mModel
.getHomeData()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<StoreMealInfo>() {
@Override
public void accept(@NonNull StoreMealInfo storeMealInfo) throws Exception {
mView.showGroupData(storeMealInfo.data,null);
}
}, new Consumer<Throwable>() {
@Override
public void accept(@NonNull Throwable throwable) throws Exception {
mView.showGroupData(null,throwable.getMessage());
}
});
}
}
| UTF-8 | Java | 1,445 | java | GoodsPresenter.java | Java | [] | null | [] | package com.yadong.takeout.presenter.fragment;
import com.yadong.takeout.data.model.GoodsModel;
import com.yadong.takeout.data.net.bean.StoreMealInfo;
import com.yadong.takeout.presenter.contract.GoodsContract;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
*
*/
public class GoodsPresenter implements GoodsContract.Presenter {
private GoodsModel mModel;
private GoodsContract.View mView;
public GoodsPresenter(GoodsContract.View view, GoodsModel model) {
this.mView = view;
this.mModel = model;
}
@Override
public void getGoodsData() {
mModel
.getHomeData()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<StoreMealInfo>() {
@Override
public void accept(@NonNull StoreMealInfo storeMealInfo) throws Exception {
mView.showGroupData(storeMealInfo.data,null);
}
}, new Consumer<Throwable>() {
@Override
public void accept(@NonNull Throwable throwable) throws Exception {
mView.showGroupData(null,throwable.getMessage());
}
});
}
}
| 1,445 | 0.625606 | 0.625606 | 47 | 29.74468 | 26.470753 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.404255 | false | false | 10 |
319a7d7810405dec1deba2342048673a8ab0dca6 | 8,263,517,113,114 | 2aa53d457c911384e72ef37149f686cd5d4e44f7 | /BeautyProject/src/Project/PerfumeDisplay.java | 66689fac5729b2eba5b50639fe6f4ef4e76ebd2f | [] | no_license | NellisaAina/Beauty-Project | https://github.com/NellisaAina/Beauty-Project | 7e06a66b070637518248f8835f71e25574d07078 | 20ae95c172157fe019d79c18230e4bfe19f9b256 | refs/heads/master | 2023-02-22T12:46:14.577000 | 2021-01-27T08:54:59 | 2021-01-27T08:54:59 | 333,346,683 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Project;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.Color;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class PerfumeDisplay {
private JFrame frame;
private JTextArea textArea;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(
new Runnable() {
public void run() {
try {
PerfumeDisplay window = new PerfumeDisplay();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public PerfumeDisplay() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.getContentPane().setBackground(new Color(250, 128, 114));
frame.setBounds(10, 10, 951, 682);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel.setBackground(new Color(255, 228, 225));
panel.setBounds(10, 11, 474, 209);
frame.getContentPane().add(panel);
panel.setLayout(null);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\80945-200.png"));
lblNewLabel.setBounds(10, 35, 192, 145);
panel.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Perfume");
lblNewLabel_1.setFont(new Font("Script MT Bold", Font.PLAIN, 55));
lblNewLabel_1.setBounds(221, 53, 243, 116);
panel.add(lblNewLabel_1);
JPanel panel_1 = new JPanel();
panel_1.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_1.setBackground(new Color(255, 228, 225));
panel_1.setBounds(10, 231, 335, 401);
frame.getContentPane().add(panel_1);
panel_1.setLayout(null);
JPanel panel_3 = new JPanel();
panel_3.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_3.setBackground(new Color(255, 228, 225));
panel_3.setBounds(355, 231, 575, 401);
frame.getContentPane().add(panel_3);
panel_3.setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(10, 11, 555, 379);
panel_3.add(scrollPane);
JTextArea textArea = new JTextArea();
textArea.setFont(new Font("Comic Sans MS", Font.PLAIN, 20));
textArea.setEditable(false);
scrollPane.setViewportView(textArea);
JButton btnNewButton_1 = new JButton("FOR HER ");
btnNewButton_1.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Office-Customer-Female-Light-icon.png"));
btnNewButton_1.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
textArea.setText("-------FOR HER-------"
+ "\nBrand: \n1) DKNY \n2) CK \n3) Victoria Secret \n4) Givenchy \n5)Bulgari \n"
+ "\n---------------------------"
+ "\nPrice of Perfume: \n1) DKNY : RM 89 \n2) CK : RM 90 \n3) Victoria Secret : RM 120 \n4) Givenchy : RM 80"
+ " \n5)Bulgari : RM 130 \n"
+ "\n--------------------------"
+ "\nOnline Shop: \n1) Shopee \n");
}
});
btnNewButton_1.setBackground(new Color(255, 192, 203));
btnNewButton_1.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_1.setBounds(30, 82, 272, 85);
panel_1.add(btnNewButton_1);
JButton btnNewButton_2_1 = new JButton("FOR HIM");
btnNewButton_2_1.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Office-Client-Male-Light-icon.png"));
btnNewButton_2_1.setBackground(new Color(255, 192, 203));
btnNewButton_2_1.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
textArea.setText("-------FOR HIM-------"
+ "\nBrand: \n1) DKNY \n2) Bulgari \n3) Hugo Boss"
+ "\n---------------------------"
+ "\nPrice of Perfume: \n1) DKNY : RM 89 \n2) Bulgari : RM 130 \n3) Hugo Boss : RM 85 \n"
+ "\n--------------------------"
+ "\nOnline Shop: \n1) Shopee \n");
}
});
btnNewButton_2_1.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_2_1.setBounds(30, 233, 272, 85);
panel_1.add(btnNewButton_2_1);
JPanel panel_2 = new JPanel();
panel_2.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_2.setBackground(new Color(255, 228, 225));
panel_2.setBounds(494, 11, 436, 209);
frame.getContentPane().add(panel_2);
panel_2.setLayout(null);
JButton btnNewButton_3 = new JButton("BUY NOW");
btnNewButton_3.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
BuyNowPerfume.main(null);
}
});
btnNewButton_3.setBackground(new Color(255, 192, 203));
btnNewButton_3.setBounds(43, 11, 360, 85);
panel_2.add(btnNewButton_3);
btnNewButton_3.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_3.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\shopping-icon.png"));
JButton btnNewButton = new JButton("RETURN TO MENU");
btnNewButton.setBounds(43, 107, 360, 91);
panel_2.add(btnNewButton);
btnNewButton.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Menu.main(null);
}
});
btnNewButton.setBackground(new Color(255, 192, 203));
btnNewButton.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Back-2-2-icon (1).png"));
}
}
| UTF-8 | Java | 6,927 | java | PerfumeDisplay.java | Java | [
{
"context": " + \"\\nBrand: \\n1) DKNY \\n2) Bulgari \\n3) Hugo Boss\"\r\n + \"\\n------------------------",
"end": 4910,
"score": 0.8662039637565613,
"start": 4901,
"tag": "NAME",
"value": "Hugo Boss"
},
{
"context": "fume: \\n1) DKNY : RM 89 \\n2) Bulgar... | null | [] | package Project;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.Color;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class PerfumeDisplay {
private JFrame frame;
private JTextArea textArea;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(
new Runnable() {
public void run() {
try {
PerfumeDisplay window = new PerfumeDisplay();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public PerfumeDisplay() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.getContentPane().setBackground(new Color(250, 128, 114));
frame.setBounds(10, 10, 951, 682);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel.setBackground(new Color(255, 228, 225));
panel.setBounds(10, 11, 474, 209);
frame.getContentPane().add(panel);
panel.setLayout(null);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\80945-200.png"));
lblNewLabel.setBounds(10, 35, 192, 145);
panel.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Perfume");
lblNewLabel_1.setFont(new Font("Script MT Bold", Font.PLAIN, 55));
lblNewLabel_1.setBounds(221, 53, 243, 116);
panel.add(lblNewLabel_1);
JPanel panel_1 = new JPanel();
panel_1.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_1.setBackground(new Color(255, 228, 225));
panel_1.setBounds(10, 231, 335, 401);
frame.getContentPane().add(panel_1);
panel_1.setLayout(null);
JPanel panel_3 = new JPanel();
panel_3.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_3.setBackground(new Color(255, 228, 225));
panel_3.setBounds(355, 231, 575, 401);
frame.getContentPane().add(panel_3);
panel_3.setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(10, 11, 555, 379);
panel_3.add(scrollPane);
JTextArea textArea = new JTextArea();
textArea.setFont(new Font("Comic Sans MS", Font.PLAIN, 20));
textArea.setEditable(false);
scrollPane.setViewportView(textArea);
JButton btnNewButton_1 = new JButton("FOR HER ");
btnNewButton_1.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Office-Customer-Female-Light-icon.png"));
btnNewButton_1.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
textArea.setText("-------FOR HER-------"
+ "\nBrand: \n1) DKNY \n2) CK \n3) Victoria Secret \n4) Givenchy \n5)Bulgari \n"
+ "\n---------------------------"
+ "\nPrice of Perfume: \n1) DKNY : RM 89 \n2) CK : RM 90 \n3) Victoria Secret : RM 120 \n4) Givenchy : RM 80"
+ " \n5)Bulgari : RM 130 \n"
+ "\n--------------------------"
+ "\nOnline Shop: \n1) Shopee \n");
}
});
btnNewButton_1.setBackground(new Color(255, 192, 203));
btnNewButton_1.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_1.setBounds(30, 82, 272, 85);
panel_1.add(btnNewButton_1);
JButton btnNewButton_2_1 = new JButton("FOR HIM");
btnNewButton_2_1.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Office-Client-Male-Light-icon.png"));
btnNewButton_2_1.setBackground(new Color(255, 192, 203));
btnNewButton_2_1.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
textArea.setText("-------FOR HIM-------"
+ "\nBrand: \n1) DKNY \n2) Bulgari \n3) <NAME>"
+ "\n---------------------------"
+ "\nPrice of Perfume: \n1) DKNY : RM 89 \n2) Bulgari : RM 130 \n3) <NAME> : RM 85 \n"
+ "\n--------------------------"
+ "\nOnline Shop: \n1) Shopee \n");
}
});
btnNewButton_2_1.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_2_1.setBounds(30, 233, 272, 85);
panel_1.add(btnNewButton_2_1);
JPanel panel_2 = new JPanel();
panel_2.setBorder(new LineBorder(new Color(128, 0, 0), 2, true));
panel_2.setBackground(new Color(255, 228, 225));
panel_2.setBounds(494, 11, 436, 209);
frame.getContentPane().add(panel_2);
panel_2.setLayout(null);
JButton btnNewButton_3 = new JButton("BUY NOW");
btnNewButton_3.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
BuyNowPerfume.main(null);
}
});
btnNewButton_3.setBackground(new Color(255, 192, 203));
btnNewButton_3.setBounds(43, 11, 360, 85);
panel_2.add(btnNewButton_3);
btnNewButton_3.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton_3.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\shopping-icon.png"));
JButton btnNewButton = new JButton("RETURN TO MENU");
btnNewButton.setBounds(43, 107, 360, 91);
panel_2.add(btnNewButton);
btnNewButton.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Menu.main(null);
}
});
btnNewButton.setBackground(new Color(255, 192, 203));
btnNewButton.setFont(new Font("Comic Sans MS", Font.PLAIN, 25));
btnNewButton.setIcon(new ImageIcon("C:\\Users\\user\\eclipse-workspace\\Workspace\\BeautyProject\\img\\Back-2-2-icon (1).png"));
}
}
| 6,921 | 0.584957 | 0.535441 | 176 | 37.357956 | 28.565361 | 152 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.176136 | false | false | 10 |
ff2f1ce2db927d44b7b9ee0e6623757248e4c07d | 1,168,231,119,685 | ff2c741d9d74656c38f589badef8ebdd9c1b17bf | /lib/src/main/java/com/touchableheroes/rxspace/values/IHasValuesListener.java | e9b8985cc3bd90fbd510c6f88737484ade97904f | [
"Apache-2.0"
] | permissive | drdrej/android-rxspace | https://github.com/drdrej/android-rxspace | a22068394036fa04ee2c283658f63b9dfefb56af | 163e6f385f24ff3869ee0b2ccdfc5d88a137213a | refs/heads/master | 2021-01-01T05:24:33.054000 | 2016-11-13T22:40:09 | 2016-11-13T22:40:09 | 57,460,118 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.touchableheroes.rxspace.values;
import com.touchableheroes.rxspace.IHasScope;
/**
* Created by asiebert on 13.04.16.
*/
public interface IHasValuesListener<T> extends IHasScope {
public void exists(final Object... values);
}
| UTF-8 | Java | 247 | java | IHasValuesListener.java | Java | [
{
"context": "chableheroes.rxspace.IHasScope;\n\n/**\n * Created by asiebert on 13.04.16.\n */\npublic interface IHasValuesListe",
"end": 118,
"score": 0.9961467385292053,
"start": 110,
"tag": "USERNAME",
"value": "asiebert"
}
] | null | [] | package com.touchableheroes.rxspace.values;
import com.touchableheroes.rxspace.IHasScope;
/**
* Created by asiebert on 13.04.16.
*/
public interface IHasValuesListener<T> extends IHasScope {
public void exists(final Object... values);
}
| 247 | 0.753036 | 0.728745 | 12 | 19.583334 | 22.525757 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 10 |
afb9f8e51c35d5d400eb31657517a9c715dee311 | 5,540,507,868,567 | 8bfcff2b30960af4dc20e1431261c1fc96bea421 | /src/main/java/com/weekpro/mall/service/goodsService.java | fef45f68343e12d6972b7fe691f25079995b6959 | [] | no_license | wxl2/mall | https://github.com/wxl2/mall | bc77002ae9751aee418200d59ec86b13ffab8bb9 | d342cf9471bf7a1819b6ca8aadc239d752ab3e15 | refs/heads/main | 2023-06-10T15:07:39.121000 | 2021-07-08T01:43:20 | 2021-07-08T01:43:20 | 379,816,433 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.weekpro.mall.service;
import com.weekpro.mall.dao.GoodsMapper;
import com.weekpro.mall.entity.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* TODO
* @ClassName goodsService
* @Author asuna
* @Date 2021/7/2 - 10:02
*/
@Service("goodsService")
public class goodsService {
@Autowired
private GoodsMapper goodsMapper;
// 添加商品
public int addGoods(Goods goods){
try {
// 生成商品编号,得到用户名字,获取类型Id
goodsMapper.addGoods(goods);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
//删除商品
public int deleteGoods(int goodsId){
try{
goodsMapper.deleteGoods(goodsId);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
//查询全部商品
public List<Map<String,Object>> getGoods(){
try{
List<Map<String,Object>> list = goodsMapper.getGoods();
return list;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
//查询user商品
public List<Map<String,Object>> getGoodsUser(String username){
try{
List<Map<String,Object>> list = goodsMapper.getGoodsUser(username);
return list;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
public int updateGoods(String goodsname, float price, int typeid,
String imgurl, int goodsid){
try {
goodsMapper.updateGoods(goodsname,price,typeid,imgurl,goodsid);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
// 根据商品id查询商品信息
public Map<String,Object> idGetGoods(int goodsid){
try{
Map<String,Object> map= goodsMapper.idGetGoods(goodsid);
return map;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
| UTF-8 | Java | 1,912 | java | goodsService.java | Java | [
{
"context": " 1.0\n * TODO\n * @ClassName goodsService\n * @Author asuna\n * @Date 2021/7/2 - 10:02\n */\n@Service(\"goodsServ",
"end": 386,
"score": 0.9924806356430054,
"start": 381,
"tag": "USERNAME",
"value": "asuna"
}
] | null | [] | package com.weekpro.mall.service;
import com.weekpro.mall.dao.GoodsMapper;
import com.weekpro.mall.entity.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* TODO
* @ClassName goodsService
* @Author asuna
* @Date 2021/7/2 - 10:02
*/
@Service("goodsService")
public class goodsService {
@Autowired
private GoodsMapper goodsMapper;
// 添加商品
public int addGoods(Goods goods){
try {
// 生成商品编号,得到用户名字,获取类型Id
goodsMapper.addGoods(goods);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
//删除商品
public int deleteGoods(int goodsId){
try{
goodsMapper.deleteGoods(goodsId);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
//查询全部商品
public List<Map<String,Object>> getGoods(){
try{
List<Map<String,Object>> list = goodsMapper.getGoods();
return list;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
//查询user商品
public List<Map<String,Object>> getGoodsUser(String username){
try{
List<Map<String,Object>> list = goodsMapper.getGoodsUser(username);
return list;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
public int updateGoods(String goodsname, float price, int typeid,
String imgurl, int goodsid){
try {
goodsMapper.updateGoods(goodsname,price,typeid,imgurl,goodsid);
}catch (Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
// 根据商品id查询商品信息
public Map<String,Object> idGetGoods(int goodsid){
try{
Map<String,Object> map= goodsMapper.idGetGoods(goodsid);
return map;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
| 1,912 | 0.694292 | 0.684413 | 89 | 19.47191 | 18.007545 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.044944 | false | false | 10 |
677a0551a086bd41176f03a81b88b4622a8faed6 | 33,741,263,103,128 | e380e3353a5e367b6e02af30c3f9e03dc050634e | /src/game/players/Wizard.java | 6f6ee70eb1139d6d4624877bc5580f47cf418aa5 | [] | no_license | Miruna21/Tema2_POO | https://github.com/Miruna21/Tema2_POO | b8fc68776bd782b7c84f4be7a88e3c3470ae2b60 | 45710b6685f9c61dda87ea4223b39f25a0441d04 | refs/heads/master | 2022-03-30T15:42:07.369000 | 2020-01-07T16:52:58 | 2020-01-07T16:52:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package game.players;
import game.abilities.Drain;
import game.abilities.Deflect;
import game.abilities.Ability;
import game.abilities.DefenceFightBehavior;
import game.abilities.AtackFightBehavior;
import game.angels.Angel;
import game.ground.Ground;
public final class Wizard extends Player {
private static final int INITIAL_HP = 400;
private static final int PLUS_HP_PER_LEVEL = 30;
private static final float MAX_HP_LIMIT = 1 / 2f;
private static final float MIN_HP_LIMIT = 1 / 4f;
private Ability drain = new Drain();
private Ability deflect = new Deflect();
public Wizard(final int id, final int xPos, final int yPos) {
super(id, xPos, yPos);
this.setHp(INITIAL_HP);
}
public Ability getFirstAbility() {
return drain;
}
public Ability getSecondAbility() {
return deflect;
}
public Character getRace() {
return 'W';
}
public String getName() {
return "Wizard";
}
@Override
public void choosePlayerFightStrategy() {
int currentHp = this.getHp();
int maxLevelHp = this.getInitialHp() + this.getLevel() * this.getPlusHpPerLevel();
float a = MIN_HP_LIMIT * maxLevelHp;
float b = MAX_HP_LIMIT * maxLevelHp;
if (currentHp < a) {
this.setFightBehavior(new DefenceFightBehavior());
this.performFightBehavior();
} else if ((currentHp > a) && (currentHp < b)) {
this.setFightBehavior(new AtackFightBehavior());
this.performFightBehavior();
}
}
@Override
public void performFightBehavior() {
this.getFightBehavior().changeFightPowers(this);
}
@Override
public boolean startFirst() {
return false;
}
public int getInitialHp() {
return INITIAL_HP;
}
public int getPlusHpPerLevel() {
return PLUS_HP_PER_LEVEL;
}
@Override
public void isHitBy(final Player attacker, final Ground ground) {
attacker.fight(this, ground, attacker);
}
@Override
public float acceptLandModifier(final Ground g) {
return g.transferGroundModifier(this);
}
@Override
public void fight(final Rogue rogue, final Ground ground, final Player attacker) {
drain.attack(rogue, ground, attacker);
deflect.attack(rogue, ground, attacker);
}
@Override
public void fight(final Wizard wizard, final Ground ground, final Player attacker) {
drain.attack(wizard, ground, attacker);
deflect.attack(wizard, ground, attacker);
}
@Override
public void fight(final Knight knight, final Ground ground, final Player attacker) {
drain.attack(knight, ground, attacker);
deflect.attack(knight, ground, attacker);
}
@Override
public void fight(final Pyromancer pyromancer, final Ground ground, final Player attacker) {
drain.attack(pyromancer, ground, attacker);
deflect.attack(pyromancer, ground, attacker);
}
@Override
public void accept(final Angel angel) {
angel.visit(this);
}
}
| UTF-8 | Java | 3,115 | java | Wizard.java | Java | [
{
"context": " }\n\n public String getName() {\n return \"Wizard\";\n }\n\n @Override\n public void choosePlay",
"end": 979,
"score": 0.6503018736839294,
"start": 973,
"tag": "NAME",
"value": "Wizard"
}
] | null | [] | package game.players;
import game.abilities.Drain;
import game.abilities.Deflect;
import game.abilities.Ability;
import game.abilities.DefenceFightBehavior;
import game.abilities.AtackFightBehavior;
import game.angels.Angel;
import game.ground.Ground;
public final class Wizard extends Player {
private static final int INITIAL_HP = 400;
private static final int PLUS_HP_PER_LEVEL = 30;
private static final float MAX_HP_LIMIT = 1 / 2f;
private static final float MIN_HP_LIMIT = 1 / 4f;
private Ability drain = new Drain();
private Ability deflect = new Deflect();
public Wizard(final int id, final int xPos, final int yPos) {
super(id, xPos, yPos);
this.setHp(INITIAL_HP);
}
public Ability getFirstAbility() {
return drain;
}
public Ability getSecondAbility() {
return deflect;
}
public Character getRace() {
return 'W';
}
public String getName() {
return "Wizard";
}
@Override
public void choosePlayerFightStrategy() {
int currentHp = this.getHp();
int maxLevelHp = this.getInitialHp() + this.getLevel() * this.getPlusHpPerLevel();
float a = MIN_HP_LIMIT * maxLevelHp;
float b = MAX_HP_LIMIT * maxLevelHp;
if (currentHp < a) {
this.setFightBehavior(new DefenceFightBehavior());
this.performFightBehavior();
} else if ((currentHp > a) && (currentHp < b)) {
this.setFightBehavior(new AtackFightBehavior());
this.performFightBehavior();
}
}
@Override
public void performFightBehavior() {
this.getFightBehavior().changeFightPowers(this);
}
@Override
public boolean startFirst() {
return false;
}
public int getInitialHp() {
return INITIAL_HP;
}
public int getPlusHpPerLevel() {
return PLUS_HP_PER_LEVEL;
}
@Override
public void isHitBy(final Player attacker, final Ground ground) {
attacker.fight(this, ground, attacker);
}
@Override
public float acceptLandModifier(final Ground g) {
return g.transferGroundModifier(this);
}
@Override
public void fight(final Rogue rogue, final Ground ground, final Player attacker) {
drain.attack(rogue, ground, attacker);
deflect.attack(rogue, ground, attacker);
}
@Override
public void fight(final Wizard wizard, final Ground ground, final Player attacker) {
drain.attack(wizard, ground, attacker);
deflect.attack(wizard, ground, attacker);
}
@Override
public void fight(final Knight knight, final Ground ground, final Player attacker) {
drain.attack(knight, ground, attacker);
deflect.attack(knight, ground, attacker);
}
@Override
public void fight(final Pyromancer pyromancer, final Ground ground, final Player attacker) {
drain.attack(pyromancer, ground, attacker);
deflect.attack(pyromancer, ground, attacker);
}
@Override
public void accept(final Angel angel) {
angel.visit(this);
}
}
| 3,115 | 0.647833 | 0.644944 | 111 | 27.063063 | 23.843437 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 10 |
5bc20131ec3563341a681d653d5f1de74fb436aa | 29,867,202,599,513 | 9f27a53a8b86aab324b04378352f4da9bd69ecd5 | /src/Cycle_Exception.java | dace46d65703ef92eed3ff4de664f96db80d6e45 | [] | no_license | coleschon/Package-Installer | https://github.com/coleschon/Package-Installer | ea2a41e400691604b5f077b759ec0b80189ad4f8 | 953b415a0ae6081568b6f79ad98a5c526b0a2df8 | refs/heads/master | 2017-04-24T04:01:02.178000 | 2017-02-16T22:28:43 | 2017-02-16T22:28:43 | 81,413,944 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Class to describe an exception due to an unwanted cycle within
* dependent packages.
*/
/**
* @author coleschon
*/
public class Cycle_Exception extends Exception
{
/**
* Version 1
*/
private static final long serialVersionUID = 1L;
private String message;
/**
* Constructor.
*
* @param message
* - Desired message to display.
*/
public Cycle_Exception(String message)
{
this.message = message;
}
/**
* Changes the message to display the message inputed from the constructor.
*/
@Override
public String getMessage()
{
return message;
}
}
| UTF-8 | Java | 607 | java | Cycle_Exception.java | Java | [
{
"context": " within\n * dependent packages.\n */\n\n/**\n * @author coleschon\n */\npublic class Cycle_Exception extends Exceptio",
"end": 122,
"score": 0.9991545081138611,
"start": 113,
"tag": "USERNAME",
"value": "coleschon"
}
] | null | [] | /**
* Class to describe an exception due to an unwanted cycle within
* dependent packages.
*/
/**
* @author coleschon
*/
public class Cycle_Exception extends Exception
{
/**
* Version 1
*/
private static final long serialVersionUID = 1L;
private String message;
/**
* Constructor.
*
* @param message
* - Desired message to display.
*/
public Cycle_Exception(String message)
{
this.message = message;
}
/**
* Changes the message to display the message inputed from the constructor.
*/
@Override
public String getMessage()
{
return message;
}
}
| 607 | 0.649094 | 0.645799 | 41 | 13.804878 | 18.811283 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.756098 | false | false | 10 |
a9355e2b0071d99284c7280037c64b05f289c81c | 7,481,833,038,090 | c28571a9d5ad6ca52c6b2411841568a43136226a | /src/Cat.java | 53d98470160041586f3d1353468e08983f50c605 | [] | no_license | ow1380/class-cat | https://github.com/ow1380/class-cat | 84b105f0cd7e5c55bd1b752838f8a69552da10c5 | cf6788a137c95574676d00abebd0719ab71819db | refs/heads/master | 2020-03-27T20:49:54.456000 | 2018-09-02T15:37:41 | 2018-09-02T15:37:41 | 147,096,298 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package src;
public class Cat {
//поля
private String name;
private int height;
private int age;
// Конструктор по умолчанию
public Cat() {}
public Cat(int age, int height, String name) {
this.height = height;
this.age = age;
this.name = name;
}
//методы
public void sleep () {
System.out.println("котик спит");
}
public void eat () {
System.out.println("кушает");
}
public String getName() {
return name;
}
public int getHeight() {
return height;
}
public int getAge() {
return age;
}
}
| UTF-8 | Java | 685 | java | Cat.java | Java | [] | null | [] | package src;
public class Cat {
//поля
private String name;
private int height;
private int age;
// Конструктор по умолчанию
public Cat() {}
public Cat(int age, int height, String name) {
this.height = height;
this.age = age;
this.name = name;
}
//методы
public void sleep () {
System.out.println("котик спит");
}
public void eat () {
System.out.println("кушает");
}
public String getName() {
return name;
}
public int getHeight() {
return height;
}
public int getAge() {
return age;
}
}
| 685 | 0.534483 | 0.534483 | 36 | 16.722221 | 13.026919 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.388889 | false | false | 10 |
69c591dba47cfe379e4ef88b189ccf1903c41fcb | 5,214,090,330,585 | d8aa34a8661961460da21012a2ab9678497e71da | /Exercise/src/main/java/com/example/demo/entity/ENTITY_Account_Policy.java | 4f4b4bc41c0accfdbe1e3783615b67c4fabdcfcb | [] | no_license | trandacky/Exercise | https://github.com/trandacky/Exercise | 32ff5ecf388491ec7c44c56d839cfd60e272d2a4 | 75622fd7a72d11ad8b1e23740d8be7f587442850 | refs/heads/main | 2023-01-02T02:37:25.525000 | 2020-10-27T11:03:54 | 2020-10-27T11:03:54 | 307,671,605 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.demo.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "accountpolicytable")
public class ENTITY_Account_Policy {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long accountpolicy_id;
@Column(name = "name")
private String name;
@Column(name = "createday")
private Date createDay;
public long getAccountpolicy_id() {
return accountpolicy_id;
}
public void setAccountpolicy_id(long accountpolicy_id) {
this.accountpolicy_id = accountpolicy_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getCreateDay() {
return createDay;
}
public void setCreateDay(Date createDay) {
this.createDay = createDay;
}
}
| UTF-8 | Java | 954 | java | ENTITY_Account_Policy.java | Java | [] | null | [] | package com.example.demo.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "accountpolicytable")
public class ENTITY_Account_Policy {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long accountpolicy_id;
@Column(name = "name")
private String name;
@Column(name = "createday")
private Date createDay;
public long getAccountpolicy_id() {
return accountpolicy_id;
}
public void setAccountpolicy_id(long accountpolicy_id) {
this.accountpolicy_id = accountpolicy_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getCreateDay() {
return createDay;
}
public void setCreateDay(Date createDay) {
this.createDay = createDay;
}
}
| 954 | 0.755765 | 0.755765 | 44 | 20.681818 | 16.31337 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.159091 | false | false | 10 |
2cf1fc797f3a693851aed4032356b4cbd44ffc36 | 24,713,241,850,966 | be968e0270ed7afae6a62a6d31b3c901852bf37a | /src/test/java/pages/DressesCategoryPage.java | 4f81e33f182725e337185745ea5becd8b05c396d | [] | no_license | emreaycicek/CucumberTestProject | https://github.com/emreaycicek/CucumberTestProject | 7a2e23b7e2756fa94e09f37355130d10e815e9a6 | 6247f4edc4d378828d487ec1c428ba7501f91b4e | refs/heads/main | 2023-03-28T23:42:08.117000 | 2021-03-22T18:57:51 | 2021-03-22T18:57:51 | 347,746,918 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class DressesCategoryPage {
private WebDriver driver;
By summerDressesCategory = By.cssSelector("#categories_block_left > div > ul > li.last > a");
public DressesCategoryPage(WebDriver driver){
this.driver = driver;
}
public void goSummerDressesCategory(){
driver.findElement(summerDressesCategory).click();
}
}
| UTF-8 | Java | 449 | java | DressesCategoryPage.java | Java | [] | null | [] | package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class DressesCategoryPage {
private WebDriver driver;
By summerDressesCategory = By.cssSelector("#categories_block_left > div > ul > li.last > a");
public DressesCategoryPage(WebDriver driver){
this.driver = driver;
}
public void goSummerDressesCategory(){
driver.findElement(summerDressesCategory).click();
}
}
| 449 | 0.712695 | 0.712695 | 19 | 22.631578 | 25.711374 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368421 | false | false | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.