blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aff4b1e09bc753ae852af26a11b9de3a54540ca7 | f7134386b598f1a9709493f31a630fb07e8c36b8 | /business-logic/src/main/java/codes/mydna/analysis_result/mappers/FoundEnzymeMapper.java | 3d120e89a56ae772067cf18bc3df370597bb5c9f | [] | no_license | mydna-codes/analysis-result-service | 1c23ad0b536fbe251e5cf3482814bd1cc3a9dc3c | ed9d2ba6672c76189fb116a5735e10e1aeccac16 | refs/heads/master | 2023-02-20T05:00:42.840577 | 2021-01-20T22:39:25 | 2021-01-20T22:39:25 | 330,056,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,238 | java | package codes.mydna.analysis_result.mappers;
import codes.mydna.analysis_result.entities.FoundEnzymeEntity;
import codes.mydna.sequence_bank.lib.Enzyme;
import codes.mydna.analysis_result.lib.FoundEnzyme;
import java.util.stream.Collectors;
public class FoundEnzymeMapper {
public static FoundEnzyme fromEntity(FoundEnzymeEntity entity) {
if (entity == null)
return null;
Enzyme enzyme = new Enzyme();
enzyme.setId(entity.getEnzymeId());
FoundEnzyme foundEnzyme = new FoundEnzyme();
foundEnzyme.setEnzyme(enzyme);
foundEnzyme.setCuts(entity.getEnzymeCuts()
.stream()
.map(EnzymeCutMapper::fromEntity)
.collect(Collectors.toList()));
return foundEnzyme;
}
public static FoundEnzymeEntity toEntity(FoundEnzyme foundEnzyme){
if(foundEnzyme == null)
return null;
FoundEnzymeEntity entity = new FoundEnzymeEntity();
entity.setEnzymeId(foundEnzyme.getEnzyme().getId());
entity.setEnzymeCuts(foundEnzyme.getCuts()
.stream()
.map(EnzymeCutMapper::toEntity)
.collect(Collectors.toList()));
return entity;
}
}
| [
"[email protected]"
] | |
6e738cccd978d6b666e44267eeec7ea2b8fad500 | db85262f9c84f35fd3d73f792178c097ba706c9e | /src/main/java/com/jackytest/demo/dao/TestUserMapper.java | b9d6d93cc882dd976954c6b851af4b8a59a8c926 | [] | no_license | jackyroc/jacky-testSpring | 4a1cc21469c165718c6b1b52f10e50041d748682 | f0ca9adab9b09495ef5f0abd43ffa196465c3339 | refs/heads/master | 2022-12-26T23:16:52.289692 | 2020-10-12T12:48:12 | 2020-10-12T12:48:12 | 297,311,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | package com.jackytest.demo.dao;
import com.jackytest.demo.common.MySqlExtensionMapper;
import com.jackytest.demo.entity.TestUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface TestUserMapper extends MySqlExtensionMapper<TestUser> {
List<TestUser> getByName(@Param("userName") String userName, @Param("userId") Integer userId);
} | [
"[email protected]"
] | |
974a82b41fa1a3f61114ec9043ace8733a6af8c4 | 422abdba138dccfbcc93b22cbcf1389e72b5dad3 | /src/main/java/com/sathish/devtools/controller/MessageController.java | ac0fc6c5949cbe35da5ad1d289174d6668aac71f | [] | no_license | sathishkariyanna/spring-boot-devtools | d79218f82d1cea43bc601a94fad0f854212f4204 | f2d53ba48e902021381d764480c94ee72b30d822 | refs/heads/master | 2020-03-23T18:51:51.958758 | 2018-07-23T05:37:06 | 2018-07-23T05:37:06 | 141,936,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,019 | java | package com.sathish.devtools.controller;
import java.util.Date;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import com.sathish.devtools.service.MessageService;
/**
*
* @author Sathish Kariyanna
*/
@Controller
public class MessageController {
@PostConstruct
public void slowRestart() throws InterruptedException {
Thread.sleep(5000);
}
@GetMapping("/")
public ModelAndView get(HttpSession session) {
Object sessionVar = session.getAttribute("messgaeVar");
if (sessionVar == null) {
sessionVar = "This is Devtools demo project";
session.setAttribute("messgaeVar", sessionVar);
}
ModelMap model = new ModelMap("message", MessageService.getMessageService())
.addAttribute("sessionVar", sessionVar);
return new ModelAndView("helloMessage", model);
}
}
| [
"[email protected]"
] | |
26d20c7147841a4397952650eec785ef23c89111 | cc8a871fe8b6bee98e71a011ab5b83163de97994 | /fj-91-anti-samy2/src/br/com/caelum/modelo/Pergunta.java | 2e2ec9a41ec451309a3cf294bd78830ee35dd191 | [
"Apache-2.0"
] | permissive | tiarebalbi/caelum-fj91-projeto | 2dbedc37d9755cb0c08eb66f26a49a88a1da5943 | 8eed41cff7fc308839a470cce353c494dec31d6d | refs/heads/master | 2020-06-09T04:53:48.260053 | 2020-05-19T08:54:46 | 2020-05-19T08:54:46 | 14,064,380 | 1 | 1 | Apache-2.0 | 2020-05-19T08:53:15 | 2013-11-02T10:20:18 | Java | UTF-8 | Java | false | false | 298 | java | package br.com.caelum.modelo;
public class Pergunta {
private Long id;
private String value;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
| [
"[email protected]"
] | |
da77ed2dfe8e1ad38ae530cd779d3678f92069fd | 6ef6213d2fa39d1d0ab7e2373d882b9d263e8c6d | /ti_components/os_tools/bios_6_46_06_00/packages/ti/catalog/msp430/package/ti_catalog_msp430.java | a180d1fe7d171bdb2f00e283fff9c5589def4872 | [] | no_license | Zhangh2018/PROCESSOR_SDK_VISION_03_06_00_00 | 9c380d3167b156a11a8f21814e94ac5550cddc87 | 05c72de5d031006c7565d4234abd53670a926acd | refs/heads/master | 2021-10-16T13:43:05.313842 | 2019-02-11T09:10:44 | 2019-02-11T09:10:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,950 | java | /*
* Do not modify this file; it is automatically
* generated and any modifications will be overwritten.
*
* @(#) xdc-A65
*/
import java.util.*;
import org.mozilla.javascript.*;
import xdc.services.intern.xsr.*;
import xdc.services.spec.Session;
public class ti_catalog_msp430
{
static final String VERS = "@(#) xdc-A65\n";
static final Proto.Elm $$T_Bool = Proto.Elm.newBool();
static final Proto.Elm $$T_Num = Proto.Elm.newNum();
static final Proto.Elm $$T_Str = Proto.Elm.newStr();
static final Proto.Elm $$T_Obj = Proto.Elm.newObj();
static final Proto.Fxn $$T_Met = new Proto.Fxn(null, null, 0, -1, false);
static final Proto.Map $$T_Map = new Proto.Map($$T_Obj);
static final Proto.Arr $$T_Vec = new Proto.Arr($$T_Obj);
static final XScriptO $$DEFAULT = Value.DEFAULT;
static final Object $$UNDEF = Undefined.instance;
static final Proto.Obj $$Package = (Proto.Obj)Global.get("$$Package");
static final Proto.Obj $$Module = (Proto.Obj)Global.get("$$Module");
static final Proto.Obj $$Instance = (Proto.Obj)Global.get("$$Instance");
static final Proto.Obj $$Params = (Proto.Obj)Global.get("$$Params");
static final Object $$objFldGet = Global.get("$$objFldGet");
static final Object $$objFldSet = Global.get("$$objFldSet");
static final Object $$proxyGet = Global.get("$$proxyGet");
static final Object $$proxySet = Global.get("$$proxySet");
static final Object $$delegGet = Global.get("$$delegGet");
static final Object $$delegSet = Global.get("$$delegSet");
Scriptable xdcO;
Session ses;
Value.Obj om;
boolean isROV;
boolean isCFG;
Proto.Obj pkgP;
Value.Obj pkgV;
ArrayList<Object> imports = new ArrayList<Object>();
ArrayList<Object> loggables = new ArrayList<Object>();
ArrayList<Object> mcfgs = new ArrayList<Object>();
ArrayList<Object> icfgs = new ArrayList<Object>();
ArrayList<String> inherits = new ArrayList<String>();
ArrayList<Object> proxies = new ArrayList<Object>();
ArrayList<Object> sizes = new ArrayList<Object>();
ArrayList<Object> tdefs = new ArrayList<Object>();
void $$IMPORTS()
{
Global.callFxn("loadPackage", xdcO, "xdc.platform");
Global.callFxn("loadPackage", xdcO, "ti.catalog");
Global.callFxn("loadPackage", xdcO, "xdc");
Global.callFxn("loadPackage", xdcO, "xdc.corevers");
}
void $$OBJECTS()
{
pkgP = (Proto.Obj)om.bind("ti.catalog.msp430.Package", new Proto.Obj());
pkgV = (Value.Obj)om.bind("ti.catalog.msp430", new Value.Obj("ti.catalog.msp430", pkgP));
}
void IMSP430$$OBJECTS()
{
Proto.Obj po, spo;
Value.Obj vo;
po = (Proto.Obj)om.bind("ti.catalog.msp430.IMSP430.Module", new Proto.Obj());
vo = (Value.Obj)om.bind("ti.catalog.msp430.IMSP430", new Value.Obj("ti.catalog.msp430.IMSP430", po));
pkgV.bind("IMSP430", vo);
// decls
// insts
Object insP = om.bind("ti.catalog.msp430.IMSP430.Instance", new Proto.Obj());
po = (Proto.Obj)om.bind("ti.catalog.msp430.IMSP430$$Object", new Proto.Obj());
om.bind("ti.catalog.msp430.IMSP430.Object", new Proto.Str(po, true));
po = (Proto.Obj)om.bind("ti.catalog.msp430.IMSP430$$Params", new Proto.Obj());
om.bind("ti.catalog.msp430.IMSP430.Params", new Proto.Str(po, true));
}
void MSP430$$OBJECTS()
{
Proto.Obj po, spo;
Value.Obj vo;
po = (Proto.Obj)om.bind("ti.catalog.msp430.MSP430.Module", new Proto.Obj());
vo = (Value.Obj)om.bind("ti.catalog.msp430.MSP430", new Value.Obj("ti.catalog.msp430.MSP430", po));
pkgV.bind("MSP430", vo);
// decls
// insts
Object insP = om.bind("ti.catalog.msp430.MSP430.Instance", new Proto.Obj());
po = (Proto.Obj)om.bind("ti.catalog.msp430.MSP430$$Object", new Proto.Obj());
om.bind("ti.catalog.msp430.MSP430.Object", new Proto.Str(po, true));
po = (Proto.Obj)om.bind("ti.catalog.msp430.MSP430$$Params", new Proto.Obj());
om.bind("ti.catalog.msp430.MSP430.Params", new Proto.Str(po, true));
}
void IMSP430$$CONSTS()
{
// interface IMSP430
}
void MSP430$$CONSTS()
{
// module MSP430
}
void IMSP430$$CREATES()
{
Proto.Fxn fxn;
StringBuilder sb;
}
void MSP430$$CREATES()
{
Proto.Fxn fxn;
StringBuilder sb;
fxn = (Proto.Fxn)om.bind("ti.catalog.msp430.MSP430$$create", new Proto.Fxn(om.findStrict("ti.catalog.msp430.MSP430.Module", "ti.catalog.msp430"), om.findStrict("ti.catalog.msp430.MSP430.Instance", "ti.catalog.msp430"), 2, 1, false));
fxn.addArg(0, "revision", $$T_Str, $$UNDEF);
fxn.addArg(1, "__params", (Proto)om.findStrict("ti.catalog.msp430.MSP430.Params", "ti.catalog.msp430"), Global.newObject());
sb = new StringBuilder();
sb.append("ti$catalog$msp430$MSP430$$create = function( revision, __params ) {\n");
sb.append("var __mod = xdc.om['ti.catalog.msp430.MSP430'];\n");
sb.append("var __inst = xdc.om['ti.catalog.msp430.MSP430.Instance'].$$make();\n");
sb.append("__inst.$$bind('$package', xdc.om['ti.catalog.msp430']);\n");
sb.append("__inst.$$bind('$index', __mod.$instances.length);\n");
sb.append("__inst.$$bind('$category', 'Instance');\n");
sb.append("__inst.$$bind('$args', {revision:revision});\n");
sb.append("__inst.$$bind('$module', __mod);\n");
sb.append("__mod.$instances.$add(__inst);\n");
sb.append("__inst.cpuCore = __mod.PARAMS.cpuCore;\n");
sb.append("__inst.cpuCoreRevision = __mod.PARAMS.cpuCoreRevision;\n");
sb.append("__inst.minProgUnitSize = __mod.PARAMS.minProgUnitSize;\n");
sb.append("__inst.minDataUnitSize = __mod.PARAMS.minDataUnitSize;\n");
sb.append("__inst.dataWordSize = __mod.PARAMS.dataWordSize;\n");
sb.append("__inst.peripherals = __mod.PARAMS.peripherals;\n");
sb.append("__inst.deviceHeader = __mod.PARAMS.deviceHeader;\n");
sb.append("__inst.isa = __mod.PARAMS.isa;\n");
sb.append("for (var __p in __params) __inst[__p] = __params[__p];\n");
sb.append("var save = xdc.om.$curpkg;\n");
sb.append("xdc.om.$$bind('$curpkg', __mod.$package.$name);\n");
sb.append("__mod.instance$meta$init.$fxn.apply(__inst, [revision]);\n");
sb.append("xdc.om.$$bind('$curpkg', save);\n");
sb.append("__inst.$$bless();\n");
sb.append("return __inst;\n");
sb.append("}\n");
Global.eval(sb.toString());
fxn = (Proto.Fxn)om.bind("ti.catalog.msp430.MSP430$$construct", new Proto.Fxn(om.findStrict("ti.catalog.msp430.MSP430.Module", "ti.catalog.msp430"), null, 3, 1, false));
fxn.addArg(0, "__obj", (Proto)om.findStrict("ti.catalog.msp430.MSP430$$Object", "ti.catalog.msp430"), null);
fxn.addArg(1, "revision", $$T_Str, $$UNDEF);
fxn.addArg(2, "__params", (Proto)om.findStrict("ti.catalog.msp430.MSP430.Params", "ti.catalog.msp430"), Global.newObject());
sb = new StringBuilder();
sb.append("ti$catalog$msp430$MSP430$$construct = function( __obj, revision, __params ) {\n");
sb.append("var __mod = xdc.om['ti.catalog.msp430.MSP430'];\n");
sb.append("var __inst = __obj;\n");
sb.append("__inst.$$bind('$args', {revision:revision});\n");
sb.append("__inst.$$bind('$module', __mod);\n");
sb.append("__mod.$objects.$add(__inst);\n");
sb.append("__inst.cpuCore = __mod.PARAMS.cpuCore;\n");
sb.append("__inst.cpuCoreRevision = __mod.PARAMS.cpuCoreRevision;\n");
sb.append("__inst.minProgUnitSize = __mod.PARAMS.minProgUnitSize;\n");
sb.append("__inst.minDataUnitSize = __mod.PARAMS.minDataUnitSize;\n");
sb.append("__inst.dataWordSize = __mod.PARAMS.dataWordSize;\n");
sb.append("__inst.peripherals = __mod.PARAMS.peripherals;\n");
sb.append("__inst.deviceHeader = __mod.PARAMS.deviceHeader;\n");
sb.append("__inst.isa = __mod.PARAMS.isa;\n");
sb.append("for (var __p in __params) __inst[__p] = __params[__p];\n");
sb.append("__inst.$$bless();\n");
sb.append("return null;\n");
sb.append("}\n");
Global.eval(sb.toString());
}
void IMSP430$$FUNCTIONS()
{
Proto.Fxn fxn;
}
void MSP430$$FUNCTIONS()
{
Proto.Fxn fxn;
}
void IMSP430$$SIZES()
{
}
void MSP430$$SIZES()
{
}
void IMSP430$$TYPES()
{
Scriptable cap;
Proto.Obj po;
Proto.Str ps;
Proto.Typedef pt;
Object fxn;
cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "ti/catalog/msp430/IMSP430.xs");
om.bind("ti.catalog.msp430.IMSP430$$capsule", cap);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.IMSP430.Module", "ti.catalog.msp430");
po.init("ti.catalog.msp430.IMSP430.Module", om.findStrict("ti.catalog.ICpuDataSheet.Module", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
fxn = Global.get(cap, "module$use");
if (fxn != null) om.bind("ti.catalog.msp430.IMSP430$$module$use", true);
if (fxn != null) po.addFxn("module$use", $$T_Met, fxn);
fxn = Global.get(cap, "module$meta$init");
if (fxn != null) om.bind("ti.catalog.msp430.IMSP430$$module$meta$init", true);
if (fxn != null) po.addFxn("module$meta$init", $$T_Met, fxn);
fxn = Global.get(cap, "instance$meta$init");
if (fxn != null) om.bind("ti.catalog.msp430.IMSP430$$instance$meta$init", true);
if (fxn != null) po.addFxn("instance$meta$init", $$T_Met, fxn);
fxn = Global.get(cap, "module$validate");
if (fxn != null) om.bind("ti.catalog.msp430.IMSP430$$module$validate", true);
if (fxn != null) po.addFxn("module$validate", $$T_Met, fxn);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.IMSP430.Instance", "ti.catalog.msp430");
po.init("ti.catalog.msp430.IMSP430.Instance", om.findStrict("ti.catalog.ICpuDataSheet.Instance", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
po.addFld("cpuCore", $$T_Str, "MSP430", "wh");
po.addFld("isa", $$T_Str, "430", "wh");
po.addFld("minProgUnitSize", Proto.Elm.newCNum("(xdc_Int)"), 1L, "wh");
po.addFld("minDataUnitSize", Proto.Elm.newCNum("(xdc_Int)"), 1L, "wh");
po.addFld("dataWordSize", Proto.Elm.newCNum("(xdc_Int)"), 2L, "wh");
po.addFld("vcc", Proto.Elm.newCNum("(xdc_Float)"), 0L, "wh");
fxn = Global.get(cap, "getMemoryMap");
if (fxn != null) po.addFxn("getMemoryMap", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getMemoryMap", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "getRegisterSet");
if (fxn != null) po.addFxn("getRegisterSet", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getRegisterSet", "ti.catalog.msp430"), fxn);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.IMSP430$$Params", "ti.catalog.msp430");
po.init("ti.catalog.msp430.IMSP430.Params", om.findStrict("ti.catalog.ICpuDataSheet$$Params", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
po.addFld("cpuCore", $$T_Str, "MSP430", "wh");
po.addFld("isa", $$T_Str, "430", "wh");
po.addFld("minProgUnitSize", Proto.Elm.newCNum("(xdc_Int)"), 1L, "wh");
po.addFld("minDataUnitSize", Proto.Elm.newCNum("(xdc_Int)"), 1L, "wh");
po.addFld("dataWordSize", Proto.Elm.newCNum("(xdc_Int)"), 2L, "wh");
po.addFld("vcc", Proto.Elm.newCNum("(xdc_Float)"), 0L, "wh");
}
void MSP430$$TYPES()
{
Scriptable cap;
Proto.Obj po;
Proto.Str ps;
Proto.Typedef pt;
Object fxn;
cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "ti/catalog/msp430/MSP430.xs");
om.bind("ti.catalog.msp430.MSP430$$capsule", cap);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.MSP430.Module", "ti.catalog.msp430");
po.init("ti.catalog.msp430.MSP430.Module", om.findStrict("ti.catalog.msp430.IMSP430.Module", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
po.addFxn("create", (Proto.Fxn)om.findStrict("ti.catalog.msp430.MSP430$$create", "ti.catalog.msp430"), Global.get("ti$catalog$msp430$MSP430$$create"));
po.addFxn("construct", (Proto.Fxn)om.findStrict("ti.catalog.msp430.MSP430$$construct", "ti.catalog.msp430"), Global.get("ti$catalog$msp430$MSP430$$construct"));
fxn = Global.get(cap, "module$use");
if (fxn != null) om.bind("ti.catalog.msp430.MSP430$$module$use", true);
if (fxn != null) po.addFxn("module$use", $$T_Met, fxn);
fxn = Global.get(cap, "module$meta$init");
if (fxn != null) om.bind("ti.catalog.msp430.MSP430$$module$meta$init", true);
if (fxn != null) po.addFxn("module$meta$init", $$T_Met, fxn);
fxn = Global.get(cap, "instance$meta$init");
if (fxn != null) om.bind("ti.catalog.msp430.MSP430$$instance$meta$init", true);
if (fxn != null) po.addFxn("instance$meta$init", $$T_Met, fxn);
fxn = Global.get(cap, "module$validate");
if (fxn != null) om.bind("ti.catalog.msp430.MSP430$$module$validate", true);
if (fxn != null) po.addFxn("module$validate", $$T_Met, fxn);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.MSP430.Instance", "ti.catalog.msp430");
po.init("ti.catalog.msp430.MSP430.Instance", om.findStrict("ti.catalog.msp430.IMSP430.Instance", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
po.addFld("cpuCore", $$T_Str, "MSP430.*", "wh");
po.addFld("isa", $$T_Str, "430.*", "wh");
po.addFld("vcc", Proto.Elm.newCNum("(xdc_Float)"), 1.8, "wh");
fxn = Global.get(cap, "getMemoryMap");
if (fxn != null) po.addFxn("getMemoryMap", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getMemoryMap", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "getRegisterSet");
if (fxn != null) po.addFxn("getRegisterSet", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getRegisterSet", "ti.catalog.msp430"), fxn);
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.MSP430$$Params", "ti.catalog.msp430");
po.init("ti.catalog.msp430.MSP430.Params", om.findStrict("ti.catalog.msp430.IMSP430$$Params", "ti.catalog.msp430"));
po.addFld("$hostonly", $$T_Num, 1, "r");
po.addFld("cpuCore", $$T_Str, "MSP430.*", "wh");
po.addFld("isa", $$T_Str, "430.*", "wh");
po.addFld("vcc", Proto.Elm.newCNum("(xdc_Float)"), 1.8, "wh");
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.MSP430$$Object", "ti.catalog.msp430");
po.init("ti.catalog.msp430.MSP430.Object", om.findStrict("ti.catalog.msp430.MSP430.Instance", "ti.catalog.msp430"));
fxn = Global.get(cap, "getMemoryMap");
if (fxn != null) po.addFxn("getMemoryMap", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getMemoryMap", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "getRegisterSet");
if (fxn != null) po.addFxn("getRegisterSet", (Proto.Fxn)om.findStrict("xdc.platform.ICpuDataSheet$$getRegisterSet", "ti.catalog.msp430"), fxn);
}
void IMSP430$$ROV()
{
}
void MSP430$$ROV()
{
}
void $$SINGLETONS()
{
pkgP.init("ti.catalog.msp430.Package", (Proto.Obj)om.findStrict("xdc.IPackage.Module", "ti.catalog.msp430"));
Scriptable cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "ti/catalog/msp430/package.xs");
om.bind("xdc.IPackage$$capsule", cap);
Object fxn;
fxn = Global.get(cap, "init");
if (fxn != null) pkgP.addFxn("init", (Proto.Fxn)om.findStrict("xdc.IPackage$$init", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "close");
if (fxn != null) pkgP.addFxn("close", (Proto.Fxn)om.findStrict("xdc.IPackage$$close", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "validate");
if (fxn != null) pkgP.addFxn("validate", (Proto.Fxn)om.findStrict("xdc.IPackage$$validate", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "exit");
if (fxn != null) pkgP.addFxn("exit", (Proto.Fxn)om.findStrict("xdc.IPackage$$exit", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "getLibs");
if (fxn != null) pkgP.addFxn("getLibs", (Proto.Fxn)om.findStrict("xdc.IPackage$$getLibs", "ti.catalog.msp430"), fxn);
fxn = Global.get(cap, "getSects");
if (fxn != null) pkgP.addFxn("getSects", (Proto.Fxn)om.findStrict("xdc.IPackage$$getSects", "ti.catalog.msp430"), fxn);
pkgP.bind("$capsule", cap);
pkgV.init2(pkgP, "ti.catalog.msp430", Value.DEFAULT, false);
pkgV.bind("$name", "ti.catalog.msp430");
pkgV.bind("$category", "Package");
pkgV.bind("$$qn", "ti.catalog.msp430.");
pkgV.bind("$vers", Global.newArray(1, 0, 0));
Value.Map atmap = (Value.Map)pkgV.getv("$attr");
atmap.seal("length");
imports.clear();
imports.add(Global.newArray("xdc.platform", Global.newArray()));
imports.add(Global.newArray("ti.catalog", Global.newArray()));
pkgV.bind("$imports", imports);
StringBuilder sb = new StringBuilder();
sb.append("var pkg = xdc.om['ti.catalog.msp430'];\n");
sb.append("if (pkg.$vers.length >= 3) {\n");
sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
sb.append("}\n");
sb.append("if ('ti.catalog.msp430$$stat$base' in xdc.om) {\n");
sb.append("pkg.packageBase = xdc.om['ti.catalog.msp430$$stat$base'];\n");
sb.append("pkg.packageRepository = xdc.om['ti.catalog.msp430$$stat$root'];\n");
sb.append("}\n");
sb.append("pkg.build.libraries = [\n");
sb.append("];\n");
sb.append("pkg.build.libDesc = [\n");
sb.append("];\n");
Global.eval(sb.toString());
}
void IMSP430$$SINGLETONS()
{
Proto.Obj po;
Value.Obj vo;
vo = (Value.Obj)om.findStrict("ti.catalog.msp430.IMSP430", "ti.catalog.msp430");
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.IMSP430.Module", "ti.catalog.msp430");
vo.init2(po, "ti.catalog.msp430.IMSP430", $$DEFAULT, false);
vo.bind("Module", po);
vo.bind("$category", "Interface");
vo.bind("$capsule", om.findStrict("ti.catalog.msp430.IMSP430$$capsule", "ti.catalog.msp430"));
vo.bind("Instance", om.findStrict("ti.catalog.msp430.IMSP430.Instance", "ti.catalog.msp430"));
vo.bind("Params", om.findStrict("ti.catalog.msp430.IMSP430.Params", "ti.catalog.msp430"));
vo.bind("PARAMS", ((Proto.Str)om.findStrict("ti.catalog.msp430.IMSP430.Params", "ti.catalog.msp430")).newInstance());
vo.bind("$package", om.findStrict("ti.catalog.msp430", "ti.catalog.msp430"));
tdefs.clear();
proxies.clear();
inherits.clear();
vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
vo.bind("$$proxies", Global.newArray(proxies.toArray()));
inherits.add("ti.catalog");
inherits.add("xdc.platform");
vo.bind("$$inherits", Global.newArray(inherits.toArray()));
((Value.Arr)pkgV.getv("$interfaces")).add(vo);
pkgV.bind("IMSP430", vo);
((Value.Arr)pkgV.getv("$unitNames")).add("IMSP430");
vo.seal(null);
}
void MSP430$$SINGLETONS()
{
Proto.Obj po;
Value.Obj vo;
vo = (Value.Obj)om.findStrict("ti.catalog.msp430.MSP430", "ti.catalog.msp430");
po = (Proto.Obj)om.findStrict("ti.catalog.msp430.MSP430.Module", "ti.catalog.msp430");
vo.init2(po, "ti.catalog.msp430.MSP430", $$DEFAULT, false);
vo.bind("Module", po);
vo.bind("$category", "Module");
vo.bind("$capsule", om.findStrict("ti.catalog.msp430.MSP430$$capsule", "ti.catalog.msp430"));
vo.bind("Instance", om.findStrict("ti.catalog.msp430.MSP430.Instance", "ti.catalog.msp430"));
vo.bind("Params", om.findStrict("ti.catalog.msp430.MSP430.Params", "ti.catalog.msp430"));
vo.bind("PARAMS", ((Proto.Str)om.findStrict("ti.catalog.msp430.MSP430.Params", "ti.catalog.msp430")).newInstance());
vo.bind("$package", om.findStrict("ti.catalog.msp430", "ti.catalog.msp430"));
tdefs.clear();
proxies.clear();
mcfgs.clear();
icfgs.clear();
inherits.clear();
vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
vo.bind("$$proxies", Global.newArray(proxies.toArray()));
vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
inherits.add("ti.catalog.msp430");
inherits.add("ti.catalog");
inherits.add("xdc.platform");
vo.bind("$$inherits", Global.newArray(inherits.toArray()));
((Value.Arr)pkgV.getv("$modules")).add(vo);
((Value.Arr)om.findStrict("$modules", "ti.catalog.msp430")).add(vo);
vo.bind("$$instflag", 1);
vo.bind("$$iobjflag", 1);
vo.bind("$$sizeflag", 1);
vo.bind("$$dlgflag", 0);
vo.bind("$$iflag", 1);
vo.bind("$$romcfgs", "|");
vo.bind("$$nortsflag", 0);
Proto.Str ps = (Proto.Str)vo.find("Module_State");
if (ps != null) vo.bind("$object", ps.newInstance());
vo.bind("$$meta_iobj", om.has("ti.catalog.msp430.MSP430$$instance$static$init", null) ? 1 : 0);
vo.bind("$$fxntab", Global.newArray());
vo.bind("$$logEvtCfgs", Global.newArray());
vo.bind("$$errorDescCfgs", Global.newArray());
vo.bind("$$assertDescCfgs", Global.newArray());
Value.Map atmap = (Value.Map)vo.getv("$attr");
atmap.seal("length");
vo.bind("Object", om.findStrict("ti.catalog.msp430.MSP430.Object", "ti.catalog.msp430"));
pkgV.bind("MSP430", vo);
((Value.Arr)pkgV.getv("$unitNames")).add("MSP430");
}
void $$INITIALIZATION()
{
Value.Obj vo;
if (isCFG) {
}//isCFG
Global.callFxn("module$meta$init", (Scriptable)om.findStrict("ti.catalog.msp430.MSP430", "ti.catalog.msp430"));
Global.callFxn("init", pkgV);
((Value.Obj)om.getv("ti.catalog.msp430.IMSP430")).bless();
((Value.Obj)om.getv("ti.catalog.msp430.MSP430")).bless();
((Value.Arr)om.findStrict("$packages", "ti.catalog.msp430")).add(pkgV);
}
public void exec( Scriptable xdcO, Session ses )
{
this.xdcO = xdcO;
this.ses = ses;
om = (Value.Obj)xdcO.get("om", null);
Object o = om.geto("$name");
String s = o instanceof String ? (String)o : null;
isCFG = s != null && s.equals("cfg");
isROV = s != null && s.equals("rov");
$$IMPORTS();
$$OBJECTS();
IMSP430$$OBJECTS();
MSP430$$OBJECTS();
IMSP430$$CONSTS();
MSP430$$CONSTS();
IMSP430$$CREATES();
MSP430$$CREATES();
IMSP430$$FUNCTIONS();
MSP430$$FUNCTIONS();
IMSP430$$SIZES();
MSP430$$SIZES();
IMSP430$$TYPES();
MSP430$$TYPES();
if (isROV) {
IMSP430$$ROV();
MSP430$$ROV();
}//isROV
$$SINGLETONS();
IMSP430$$SINGLETONS();
MSP430$$SINGLETONS();
$$INITIALIZATION();
}
}
| [
"[email protected]"
] | |
1724c46405b6cd49b370aabde557ea60c50aa788 | 7b31eae7671871f338c7d89b70c64a0ab0af97b8 | /java/src/org/sc/celltype/CellTypeOntology.java | 40404e9d534feba82cc4cbcb8ad027532d033d4a | [] | no_license | tdanford/cell-type | c021f51dfeb7de4e8308cce254695e6a125f29ea | 0b4e1abc3cb493c0c300aa81e6f1253a9d9b2bac | refs/heads/master | 2020-06-06T18:10:04.145433 | 2010-12-22T12:53:40 | 2010-12-22T12:53:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,058 | java | package org.sc.celltype;
import java.io.*;
import java.lang.reflect.Proxy;
import java.util.*;
import javassist.CannotCompileException;
import org.sc.obo.OBOOntology;
import org.sc.obo.OBOParser;
import org.sc.obo.OBOStanza;
import org.sc.obo.OBOTerm;
import org.sc.obo.annotations.parsers.JavaExporter;
import org.sc.obo.annotations.parsers.OBOTermCreator;
public class CellTypeOntology {
public static void main(String[] args) throws IOException, CannotCompileException {
File f = new File(args[0]);
CellTypeOntology ct = new CellTypeOntology(f);
DAG isa = ct.getIsaDag();
Set<String> roots = isa.findRootNodes();
isa = isa.flipEdges();
for(String r : roots) {
isa.printNode(r, System.out, ct.terms);
}
}
private File ontologyFile;
private OBOOntology ontology;
private Map<String,OBOTerm> terms;
private Map<String,Class> termClasses;
private Map<String,CellTerm> cellTerms = new TreeMap<String,CellTerm>();
public CellTypeOntology() throws IOException {
this(new CellTypeProperties().getCellTypeOntologyFile());
}
public CellTypeOntology(File f) throws IOException {
ontologyFile = f;
OBOParser parser = new OBOParser();
parser.parse(f);
ontology = parser.getOntology();
terms = new TreeMap<String,OBOTerm>();
for(OBOStanza stanza : ontology.getStanzas()) {
if(stanza instanceof OBOTerm) {
OBOTerm term = (OBOTerm)stanza;
if(!term.isObsolete()) {
terms.put(term.id(), term);
}
}
}
}
public OBOTerm getTerm(String id) {
return terms.get(id);
}
public CellTerm fromTerm(OBOTerm term) {
if(cellTerms.containsKey(term.id())) {
return cellTerms.get(term.id());
} else {
CellTerm newTerm = (CellTerm)Proxy.newProxyInstance(
CellTerm.class.getClassLoader(),
new Class[] { CellTerm.class },
new CellTermStanzaInvocationHandler(this, term));
cellTerms.put(term.id(), newTerm);
return newTerm;
}
}
public DAG getDevelopsFromDag() {
return getRelationshipDag("develops_from");
}
public DAG getRelationshipDag(String typedef) {
DAG d = new DAG();
for(String node : terms.keySet()) {
d.addNode(node);
}
for(String node : terms.keySet()) {
OBOTerm t =terms.get(node);
for(String parent : t.relationship(typedef)) {
OBOTerm p = terms.get(parent);
d.addEdge(node, parent);
}
}
return d;
}
public DAG getIsaDag() {
DAG d = new DAG();
for(String node : terms.keySet()) {
d.addNode(node);
}
for(String node : terms.keySet()) {
OBOTerm t =terms.get(node);
for(String parent : t.isa()) {
OBOTerm p = terms.get(parent);
d.addEdge(node, parent);
//System.out.println(String.format("%s -> %s", t.getName(), p.getName()));
}
for(String parent : t.intersectionOf()) {
OBOTerm p = terms.get(parent);
d.addEdge(node, parent);
}
}
return d;
}
public void createTermClasses() throws IOException, CannotCompileException {
String javaClassName = ontologyFile.getName().split("\\.")[0];
//String javaFileName = Character.toUpperCase(javaClassName.charAt(0)) + javaClassName.substring(1, javaClassName.length()) + ".java";
String javaFileName = "CellType.java";
File outputf = new File(ontologyFile.getParent(), javaFileName);
PrintWriter pw = new PrintWriter(new FileWriter(outputf));
pw.println("package org.sc.celltype;\n");
pw.println("import org.sc.obo.annotations.Relates;");
pw.println("import org.sc.obo.annotations.Term;");
termClasses = new TreeMap<String,Class>();
OBOTermCreator classCreator = new OBOTermCreator();
JavaExporter java = new JavaExporter();
for(String id : terms.keySet()) {
OBOTerm term = terms.get(id);
if(!term.isObsolete()) {
terms.put(term.id(), term);
Class termClass = classCreator.createTerm(ontology, term);
termClasses.put(term.id(), termClass);
pw.println(java.export(termClass));
//System.out.println(java.export(termClass));
}
}
pw.close();
System.out.println("Output: " + outputf);
}
}
| [
"[email protected]"
] | |
dbde35264deecfcd00f2ce72fe6f5a052935dca4 | 2cbfadbe2ac3cd53522b7ba093edcd0bf422a596 | /src/ren/shao/action/ActionEvent.java | 712302cc448c6598ea2d406f5a25168cd1701345 | [] | no_license | renshao/finger-paint | a30cfb86f438624edc184e63a3b2c9467d5917cf | 25313a3ccc8395f98653ff3eb6d53e6e47d0172e | refs/heads/master | 2021-01-19T09:13:33.852251 | 2011-10-14T23:20:47 | 2011-10-14T23:20:47 | 2,579,382 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package ren.shao.action;
public class ActionEvent {
private String actionCommand;
private long when;
public ActionEvent(){
when = System.currentTimeMillis();
}
public ActionEvent(String actionCommand){
this.actionCommand = actionCommand;
}
public String actionCommand(){
return actionCommand;
}
public long getWhen(){
return when;
}
}
| [
"[email protected]"
] | |
25f68c6e604776709396f329317237c187ffed2f | 8e744e6543416a7d757a91f2b584f0e8c0718c3e | /xc-learn/learn-ssh/src/main/java/com/lord/service/IUserService.java | 1b9b6811d2bb91eab9e74b7bb7d700d1d65126bf | [] | no_license | andylan/learning | ef8c1dc3b1fbf04ed0ca5f16743b1944a243a29b | f36738acb4de9c452c48b529910f2fdfef3f73da | refs/heads/master | 2020-04-06T13:03:07.538830 | 2015-03-04T08:13:28 | 2015-03-04T08:13:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package com.lord.service;
import java.util.List;
import com.lord.model.User;
import com.lord.model.dto.UserDTO;
public interface IUserService {
/**
* 判断用户名是否存在
* @param userName
* @return
*/
boolean isExistUser(String userName);
void save(User user);
User loadUser(Long id);
List<User> findAllUser();
List<UserDTO> list();
}
| [
"[email protected]"
] | |
4b4960ae9fe28d8c83e88c7a4d3029e47e599a7b | 245f8e9a0f1c3deb739663923f10de83a2fcaa20 | /src/src/exchanges.java | 38b00dbfbe12eb87534f073600f1e6b802bd8fa2 | [] | no_license | yonghwan-0225/abroad_crawling-server | d53ec21d09c14271d09fd89ef45db4cdbb5d31d0 | f8d4a4134b8978efb9a77eb9684ecce00a4d557c | refs/heads/master | 2021-04-09T10:22:28.265354 | 2018-03-26T05:44:12 | 2018-03-26T05:44:12 | 125,314,479 | 0 | 0 | null | 2018-03-15T05:00:15 | 2018-03-15T05:00:15 | null | UHC | Java | false | false | 5,229 | java | package src;
import src.BankList;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.server.handler.GetAlertText;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Sleeper;
import org.openqa.selenium.support.ui.WebDriverWait;
import com.beust.jcommander.internal.Console;
import com.gargoylesoftware.htmlunit.javascript.host.Iterator;
import com.google.common.base.Converter;
import com.google.common.collect.Multiset.Entry;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.CompareGenerator;
import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;
import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.Woodstox;
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils.Collections;
import java.io.BufferedReader;
public class Exchanges extends HttpServlet {
public static void allBank() throws IOException, InterruptedException {
// 신한, 하나, 우리, NH, IBK, KB 1
// 신한은행
LinkedHashMap<String, ArrayList<String>> map = new LinkedHashMap<>();
try {
map.put("SHINHAN", BankList.shinhanBank());
} catch (Exception e) {
System.out.println("고시 환율을 등록 중입니다.");
}
map.put("HANA", BankList.hanaBank());
map.put("WOORI", BankList.wooriBank());
map.put("NH", BankList.nhBank());
map.put("KB", BankList.kbBank());
System.out.println(map); //map Test
System.out.println(jsonMaker(map));
ArrayList<ArrayList<Double>> merger = new ArrayList<ArrayList<Double>>();
ArrayList<Double> buyD = new ArrayList<Double>();
ArrayList<Double> sellD = new ArrayList<Double>();
ArrayList<Double> buyE = new ArrayList<Double>();
ArrayList<Double> sellE = new ArrayList<Double>();
ArrayList<Double> buyYu = new ArrayList<Double>();
ArrayList<Double> sellYu = new ArrayList<Double>();
ArrayList<Double> buyYe = new ArrayList<Double>();
ArrayList<Double> sellYe = new ArrayList<Double>();
merger.add(buyD);
merger.add(sellD);
merger.add(buyE);
merger.add(sellE);
merger.add(buyYu);
merger.add(sellYu);
merger.add(buyYe);
merger.add(sellYe);
// for (int i = 0; i <8; i++) {
// merger.get(i).add(map.get("SHINHAN").get(i));
// merger.get(i).add(map.get("HANA").get(i));
// merger.get(i).add(map.get("WOORI").get(i));
// merger.get(i).add(map.get("NH").get(i));
// merger.get(i).add(map.get("KB").get(i));
//
// java.util.Collections.sort(merger.get(i));
//
// }
//System.out.println(merger);
// for(String key:map.keySet()) {
// for (int i = 0; i <8; i++) {
// String a=String.valueOf(map.get(key).get(i));
// map.get(key).set(i, a);
// }
// }
//
}
public static String jsonMaker(LinkedHashMap<String, ArrayList<String>> map) {
String[] money = { "$", "€", "元", "¥" };
int i = 0;
String jsonData = "{";
jsonData += "'entry': ['$', '€', '元', '¥'], 'excData':{";
for (String s : money) {
jsonData += "'" + s + "':" + "[";
for (String key : map.keySet()) {
System.out.println(i);
jsonData += "{" + "'bank':" + "'" + key + "'" + ",";
jsonData += "'fromW':" +"'"+map.get(key).get(i % 4)+"'" + ",";
jsonData += "'toW':" +"'" +map.get(key).get(i % 4 + 1)+"'" + "}" + ",";
}
i += 2;
}
return jsonData;
}
/*
* final String address =
* "http://finance.naver.com//sise/entryJongmok.nhn?&page=" + a; Document doc =
* Jsoup.connect(address).get(); LinkedHashMap<String, String> list = new
* LinkedHashMap<String, String>();
*
* Elements i = doc.select(".ctg a"); // 클래스 cta에서 a 태그만 빼왔다. Elements k =
* doc.select(".number_2"); int size = i.size(); for (int b = 0; b < size ; b++)
* { Element object = i.get(b); Element stock = k.get(4*b);
* list.put(object.text(), stock.text()); }
*
* for (String key : list.keySet()) { System.out.println(key + " " +
* list.get(key)); }
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
public static void main(String[] args) throws IOException, InterruptedException {
allBank();
}
}
| [
"[email protected]"
] | |
aadacecc8d6be3f338e91a5c8a22d3346cee0ae8 | 589e49f084da936f6d7169de740cecfe1fe4f2e1 | /app/src/main/java/net/pcswv/garagedooropener/MainActivity.java | 504c874016b65f1ef37113c8a10263164468d4ad | [] | no_license | kujars/GarageDoorOpener2 | 4c8de497ef88033488b3d321c2160d954d98a8d8 | a163ef310f079fb8efe5ae59d7629333b795be6d | refs/heads/master | 2021-01-19T09:32:14.272970 | 2017-02-16T01:26:18 | 2017-02-16T01:26:18 | 82,124,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package net.pcswv.garagedooropener;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import net.pcswv.garagedooropener.fragments.MainFragment;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Fragment mainFragment = new MainFragment();
if (savedInstanceState == null) {
PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.settings, true);
getSupportFragmentManager().beginTransaction().add(R.id.container, mainFragment).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
Intent i = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(i);
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
c4ee4e730fa12602f1a2006b853cd35811849c1c | 865de1d6538a08a06106fe3ffe79dd8435f898db | /src/main/java/dataConnection/MultiDataSource.java | 60ba83ccbf8a48b090592cb949182ea947a7d22f | [] | no_license | coatardbul/maven_project_test | 70bc679b045d01249488062a86363614ad895d6a | b7b5225c0863552bf9f38eb6a0f05205d13fd55c | refs/heads/master | 2022-12-17T11:13:55.955592 | 2021-12-20T08:14:38 | 2021-12-20T08:14:38 | 153,911,829 | 0 | 0 | null | 2022-12-16T06:36:45 | 2018-10-20T14:05:46 | Java | UTF-8 | Java | false | false | 292 | java | package dataConnection;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
public class MultiDataSource extends AbstractRoutingDataSource
{
@Override
protected Object determineCurrentLookupKey()
{
return DbContextHolder.getDbType();
}
} | [
"[email protected]"
] | |
7c2b42d1f040ccd656aafc99d27ddbb357196a3e | 443aa6cb3819c45e15f80068b2a4babfed10402e | /src/main/java/in/co/rays/controller/CollegeListCtl.java | 2d571017aa6bfbce19a87ae24fd93946aad02b54 | [] | no_license | nitesh-patidar/Project_4 | 78fab6205f587db2501340734ea8431c4fe2f5a9 | 2a024073007ac918def457f4069c7eb06d390a35 | refs/heads/main | 2023-03-20T18:42:40.648899 | 2021-03-16T06:30:15 | 2021-03-16T06:30:15 | 348,234,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,021 | java | package in.co.rays.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import in.co.rays.bean.BaseBean;
import in.co.rays.bean.CollegeBean;
import in.co.rays.exception.ApplicationException;
import in.co.rays.model.CollegeModel;
import in.co.rays.util.DataUtility;
import in.co.rays.util.PropertyReader;
import in.co.rays.util.ServletUtility;
// TODO: Auto-generated Javadoc
/**
* College List functionality Controller. Performs operation for list, search
* and delete operations of College
*
* @author Proxy
* @version 1.0
* Copyright (c) SunilOS
*/
@WebServlet(name="CollegeListCtl",urlPatterns={"/ctl/CollegeListCtl"})
public class CollegeListCtl extends BaseCtl
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The log. */
private static Logger log = Logger.getLogger(CollegeListCtl.class);
/* (non-Javadoc)
* @see in.co.rays.controller.BaseCtl#preload(javax.servlet.http.HttpServletRequest)
*/
@Override
protected void preload(HttpServletRequest request)
{
CollegeModel model = new CollegeModel();
try
{
List l = model.list();
request.setAttribute("collegeList", l);
}
catch(ApplicationException e)
{
log.error(e);
}
}
/* (non-Javadoc)
* @see in.co.rays.controller.BaseCtl#populateBean(javax.servlet.http.HttpServletRequest)
*/
@Override
protected BaseBean populateBean(HttpServletRequest request)
{
CollegeBean bean = new CollegeBean();
bean.setId(DataUtility.getLong(request.getParameter("collegeId")));
bean.setCity(DataUtility.getString(request.getParameter("city")));
return bean;
}
/**
* Contains Display logics.
*
* @param request the request
* @param response the response
* @throws IOException Signals that an I/O exception has occurred.
* @throws ServletException the servlet exception
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request ,HttpServletResponse response) throws IOException, ServletException
{
int pageNo = 1 ;
int pageSize =DataUtility.getInt(PropertyReader.getValue("page.size"));
CollegeBean bean = (CollegeBean) populateBean(request);
CollegeModel model = new CollegeModel();
String op = DataUtility.getString(request.getParameter("operation"));
String[] ids = request.getParameterValues("ids");
List list = null;
List nextList = null;
try
{
list = model.search(bean, pageNo, pageSize);
nextList= model.search(bean, pageNo+1, pageSize);
request.setAttribute("nextlist", nextList.size());
if (list==null || list.size()==0)
{
ServletUtility.setErrorMessage("No Record Found", request);
}
ServletUtility.setList(list, request);
ServletUtility.setPageNo(pageNo, request);
ServletUtility.setPageSize(pageSize, request);
ServletUtility.forward(getView(), request, response);
}
catch(ApplicationException e)
{
log.error(e);
ServletUtility.handleException(e, request, response);
return ;
}
}
/**
* Contains Submit logics.
*
* @param request the request
* @param response the response
* @throws IOException Signals that an I/O exception has occurred.
* @throws ServletException the servlet exception
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
log.debug("CollegeListCtl doPost Start");
List list = null;
List nextList=null;
int pageNo = DataUtility.getInt(request.getParameter("pageNo"));
int pageSize = DataUtility.getInt(request.getParameter("pageSize"));
pageNo = (pageNo == 0) ? 1 : pageNo;
pageSize = (pageSize == 0) ? DataUtility.getInt(PropertyReader.getValue("page.size")) : pageSize;
String op = DataUtility.getString(request.getParameter("operation"));
String [] ids = request.getParameterValues("ids");
CollegeModel model = new CollegeModel();
CollegeBean bean = (CollegeBean) populateBean(request);
if (OP_SEARCH.equalsIgnoreCase(op)) {
pageNo = 1;
}
else if (OP_NEXT.equalsIgnoreCase(op)) {
pageNo++;
}
else if (OP_PREVIOUS.equalsIgnoreCase(op) && pageNo > 1) {
pageNo--;
}
else if (OP_NEW.equalsIgnoreCase(op)) {
ServletUtility.redirect(ORSView.COLLEGE_CTL, request, response);
return;
}else if (OP_RESET.equalsIgnoreCase(op)) {
ServletUtility.redirect(ORSView.COLLEGE_LIST_CTL, request, response);
return;
}
else if (OP_DELETE.equalsIgnoreCase(op)) {
pageNo = 1;
if (ids != null && ids.length > 0) {
CollegeBean deletebean = new CollegeBean();
// UserBean deletebean = new UserBean();
for (String id : ids) {
deletebean.setId(DataUtility.getInt(id));
try {
model.delete(deletebean);
} catch (ApplicationException e) {
ServletUtility.handleException(e, request, response);
return;
}ServletUtility.setSuccessMessage("Data Successfully Deleted", request);
}
}
else {
ServletUtility.setErrorMessage(
"Select at least one record", request);
}
}
try {
list = model.search(bean, pageNo, pageSize);
nextList=model.search(bean,pageNo+1,pageSize);
request.setAttribute("nextlist", nextList.size());
} catch (ApplicationException e) {
log.error(e);
ServletUtility.handleException(e, request, response);
return;
}
// ServletUtility.setList(list, request);
if (list == null || list.size() == 0 && !OP_DELETE.equalsIgnoreCase(op)) {
ServletUtility.setErrorMessage("No record found ", request);
}
ServletUtility.setList(list, request);
ServletUtility.setBean(bean, request);
ServletUtility.setPageNo(pageNo, request);
ServletUtility.setPageSize(pageSize, request);
ServletUtility.forward(getView(), request, response);
log.debug("CollegeListCtl doPost End");
}
/* (non-Javadoc)
* @see in.co.rays.controller.BaseCtl#getView()
*/
@Override
protected String getView()
{
return ORSView.COLLEGE_LIST_VIEW;
}
}
| [
"[email protected]"
] | |
e0ec8e63d26c51ad8bfc078d3fee09b48aab15b1 | 49103cb1e27aa8d555cffd5d693b90bd37c764c9 | /NutritionClub/app/src/main/java/com/example/nutritionclub/AccountActivity/EditCommentActivity.java | 14f0fa2374c0545dc8f97f0961977a895e740066 | [] | no_license | ahhbee0127/NutritionClub | d8606c9d7fc61a433c03be4a88dcf9ffdfcde171 | 226a5c8142aa404cf43153d155c634f782434de2 | refs/heads/master | 2020-03-21T12:56:36.540884 | 2018-08-21T02:26:54 | 2018-08-21T02:26:54 | 138,579,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,218 | java | package com.example.nutritionclub.AccountActivity;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.nutritionclub.R;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.HashMap;
import java.util.Map;
public class EditCommentActivity extends AppCompatActivity {
private DatabaseReference mDatabaseBody;
private DatabaseReference mDatabaseUser;
private FirebaseAuth auth;
private TextView commentV;
private EditText commentF;
private Button submitButton;
public static final String TAG = "TAG";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_comment);
commentF = (EditText) findViewById(R.id.commentF);
submitButton = (Button) findViewById(R.id.submitButton);
commentV = (TextView) findViewById(R.id.commentV);
mDatabaseUser = FirebaseDatabase.getInstance().getReference("Users");
auth = FirebaseAuth.getInstance();
String userId = getIntent().getStringExtra(CoachShowBodyDetailActivity.USER_ID1);
String bodyId = getIntent().getStringExtra(CoachShowBodyDetailActivity.BODY_ID1);
mDatabaseBody = FirebaseDatabase.getInstance().getReference("Body Compositions").child(userId);
mDatabaseBody.child(bodyId).addListenerForSingleValueEvent(
new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
String comment = dataSnapshot.child("comment").getValue(String.class);
if (comment != null) {
commentV.setVisibility(View.VISIBLE);
commentV.setText(comment);
} else if (comment == null) {
commentV.setVisibility(View.GONE);
commentF.setVisibility(View.VISIBLE);
submitButton.setVisibility(View.VISIBLE);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
Log.w(TAG, "getUser:onCancelled", databaseError.toException());
}
});
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveComment();
submitButton.setVisibility(View.GONE);
commentV.setVisibility(View.VISIBLE);
commentF.setVisibility(View.GONE);
}
});
}
protected void saveComment() {
final String comment = commentF.getText().toString().trim();
String bodyId = getIntent().getStringExtra(CoachShowBodyDetailActivity.BODY_ID1);
DatabaseReference bodyRef = mDatabaseBody.child(bodyId);
Map<String, Object> bodyUpdates = new HashMap<>();
bodyUpdates.put("comment", comment);
bodyRef.updateChildren(bodyUpdates).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Toast.makeText(EditCommentActivity.this, "Stored..", Toast.LENGTH_LONG).show();
commentV.setText(comment);
} else {
Toast.makeText(EditCommentActivity.this, "Error..", Toast.LENGTH_LONG).show();
}
}
});
}
} | [
"[email protected]"
] | |
87d795c3eb87e528b26d729b34d98d1d956bd9b9 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Chart-6/org.jfree.chart.util.ShapeList/default/14/org/jfree/chart/util/ShapeList_ESTest.java | 223b124e59dbfeed72a44addb71c3c7faad7a5d9 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 3,237 | java | /*
* This file was automatically generated by EvoSuite
* Thu Jul 29 16:08:28 GMT 2021
*/
package org.jfree.chart.util;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.jfree.chart.util.ShapeList;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class ShapeList_ESTest extends ShapeList_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
ShapeList shapeList0 = new ShapeList();
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
Rectangle rectangle0 = rectangle2D_Double0.getBounds();
// Undeclared exception!
// try {
shapeList0.setShape((-387), rectangle0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test1() throws Throwable {
ShapeList shapeList0 = new ShapeList();
shapeList0.set(8, "-l6uYl_");
// Undeclared exception!
// try {
shapeList0.getShape(8);
// fail("Expecting exception: ClassCastException");
// } catch(ClassCastException e) {
// //
// // java.lang.String cannot be cast to java.awt.Shape
// //
// verifyException("org.jfree.chart.util.ShapeList", e);
// }
}
@Test(timeout = 4000)
public void test2() throws Throwable {
ShapeList shapeList0 = new ShapeList();
shapeList0.set(65535, shapeList0);
Object object0 = shapeList0.clone();
// Undeclared exception!
shapeList0.equals(object0);
}
@Test(timeout = 4000)
public void test3() throws Throwable {
ShapeList shapeList0 = new ShapeList();
boolean boolean0 = shapeList0.equals(shapeList0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test4() throws Throwable {
ShapeList shapeList0 = new ShapeList();
Polygon polygon0 = new Polygon();
boolean boolean0 = shapeList0.equals(polygon0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test5() throws Throwable {
ShapeList shapeList0 = new ShapeList();
Line2D.Float line2D_Float0 = new Line2D.Float(0, 193, 8, (-3680));
shapeList0.setShape(0, line2D_Float0);
shapeList0.getShape(0);
assertEquals(1, shapeList0.size());
}
@Test(timeout = 4000)
public void test6() throws Throwable {
ShapeList shapeList0 = new ShapeList();
Shape shape0 = shapeList0.getShape(0);
assertNull(shape0);
}
@Test(timeout = 4000)
public void test7() throws Throwable {
ShapeList shapeList0 = new ShapeList();
shapeList0.hashCode();
}
}
| [
"[email protected]"
] | |
5c42936d56b3b6fe45f36fa68334a2e2d5ebdc3a | 2b624756eb906478ba942ccd5a5e08604f98842f | /src/main/java/com/example/demo/study/design/Hero.java | 7d1b1fe7fb3fb24320073e1efdf7a9eb1b6a48e8 | [] | no_license | gaoyunyun/java-study | 48645ac33a340c3867bfd7920d4e638297dd8f8c | 88a628b5c02662bd268de6721af30f3dc3fe8972 | refs/heads/main | 2023-08-16T14:05:09.792965 | 2021-10-10T01:45:14 | 2021-10-10T01:45:14 | 382,637,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | package com.example.demo.study.design;
public class Hero extends Subject{
void move(){
System.out.println("主角移动");
notifyObserver();
}
public static void main(String[] args){
Hero hero = new Hero();
Monster monster = new Monster();
Trap trap = new Trap();
Treasure treasure = new Treasure();
hero.attachObserver(monster);
hero.attachObserver(trap);
hero.attachObserver(treasure);
hero.move();
}
}
| [
"[email protected]"
] | |
c53f36680fdbd86e55ca10952070d3581ba27b3d | d2b7cdb9d38f5f3ae2a855f73ea5462d00ecab84 | /app/src/androidTest/java/edu/msu/rookscam/team9/connect4/ExampleInstrumentedTest.java | 7922a53af4fc6b1017d37b3b46cdbf7d15731f96 | [] | no_license | binsfel/Connect-Four-Android-Online-Game | 34c1c54d4ecb87b785131cd1a378a4d142a16bff | f8dc282eeb3000baab4793e90f335e8fc3969ea2 | refs/heads/master | 2021-06-21T23:33:39.936638 | 2017-07-10T10:27:59 | 2017-07-10T10:27:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package edu.msu.rookscam.team9.connect4;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("edu.msu.rookscam.team9.connect4", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
7e7fa7686ddabfebd4cf3cc8a190738aa835c185 | 9ce4b58d627ec9add20fbfd8bc8cd300da62c832 | /src/test/java/com/hrms/testcases/MultipleEmployeeTest.java | a87b9bc7af68d873097a104929ecb043707e8830 | [] | no_license | Dinara9786/TestNG-Framework-Batch8 | beb77f7245e67e9de453c4f45a5f1931e000d6f6 | 879b9e28e5ce93a600946d80ef95c24834369c11 | refs/heads/main | 2023-05-08T08:40:29.176956 | 2021-05-21T17:18:41 | 2021-05-21T17:18:41 | 333,522,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,466 | java | package com.hrms.testcases;
import com.hrms.pages.AddEmployeePage;
import com.hrms.pages.DashboardPage;
import com.hrms.pages.EmployeeListPage;
import com.hrms.pages.LoginPage;
import com.hrms.utils.CommonMethods;
import com.hrms.utils.ConfigsReader;
import com.hrms.utils.Constants;
import com.hrms.utils.ExcelReading;
import java.util.List;
import java.util.Map;
public class MultipleEmployeeTest extends CommonMethods {
// @Test(groups = "smoke")
public void addMultipleEmployees() throws InterruptedException {
//creating object of pages
LoginPage login=new LoginPage();
DashboardPage dash=new DashboardPage();
AddEmployeePage newEmployee=new AddEmployeePage();
EmployeeListPage employeeListPage=new EmployeeListPage();
//login in to HRMS
login.login(ConfigsReader.getPropertyValue("username"), ConfigsReader.getPropertyValue("password"));
//open excel file
List<Map<String, String>> employeeData = ExcelReading.excelIntoListMap(Constants.TESTDATA_FILEPATH,"EmployeeData");
for (int i=0;i<employeeData.size(); i++) {
//navigating to add employee page
dash.PIMButton.click();
Thread.sleep(2000);
dash.addEmployeeBtn.click();
//sending values from excel file and adding new employees
sendText(newEmployee.firstNameTextBox,employeeData.get(i).get("FirstName"));
sendText(newEmployee.middleNameTextBox,employeeData.get(i).get("MiddleName"));
sendText(newEmployee.lastNameTextbox,employeeData.get(i).get("LastName"));
Thread.sleep(3000);
System.out.println("employeeData.get(i).get(\"Photograph\")" +employeeData.get(i).get("Photograph"));
sendText(newEmployee.profilePhoto,employeeData.get(i).get("Photograph"));
Thread.sleep(3000);
String employeeIDValue=newEmployee.empIDTextBox.getAttribute("value");
click(newEmployee.createLoginCheckbox);
sendText(newEmployee.usernameTextField,employeeData.get(i).get("Username"));
sendText(newEmployee.password,employeeData.get(i).get("Password"));
sendText(newEmployee.confirmPasswordField,employeeData.get(i).get("Password"));
click(newEmployee.saveButton);
Thread.sleep(2000);
// driver.findElement(By.linkText("Employee List")).click();
//Thread.sleep(2000);
}
}
}
}
| [
"[email protected]"
] | |
a4c349c6ccc8f0e7ddeb406202aa0982b63d833d | 90ca03ff350b89d82991066bd77cfdf0113a9843 | /chapter_008/src/main/java/ru/job4j/srp/ConsoleOutput.java | b5127d7bd37110d55a1e9cd656c83ce2bde47632 | [] | no_license | smorozov30/job4j | 05971d359f035d0e6dcee1bc438be7c90d4c89c8 | 04897f81875782d7541c4596893e3c57bc9a2eba | refs/heads/master | 2022-09-24T18:55:31.262027 | 2021-02-21T17:14:57 | 2021-02-21T17:14:57 | 218,499,680 | 0 | 0 | null | 2022-09-08T01:06:09 | 2019-10-30T10:18:40 | Java | UTF-8 | Java | false | false | 163 | java | package ru.job4j.srp;
public class ConsoleOutput implements Output {
@Override
public void output(String out) {
System.out.println(out);
}
}
| [
"[email protected]"
] | |
0ecd8fff00c2d5adc943647ef7299be8b627dde9 | 4e8d52f594b89fa356e8278265b5c17f22db1210 | /WebServiceArtifacts/CI_CI_PERSONAL_DATA/com/oracle/xmlns/enterprise/tools/schemas/m1080144/PROPPREFPHONEFLAGTypeShape.java | 296fe44d59cd95e8e8e6d14b9538cf83405a8692 | [] | no_license | ouniali/WSantipatterns | dc2e5b653d943199872ea0e34bcc3be6ed74c82e | d406c67efd0baa95990d5ee6a6a9d48ef93c7d32 | refs/heads/master | 2021-01-10T05:22:19.631231 | 2015-05-26T06:27:52 | 2015-05-26T06:27:52 | 36,153,404 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,373 | java |
package com.oracle.xmlns.enterprise.tools.schemas.m1080144;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for PROP_PREF_PHONE_FLAGTypeShape complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="PROP_PREF_PHONE_FLAGTypeShape">
* <simpleContent>
* <extension base="<http://xmlns.oracle.com/Enterprise/Tools/schemas/M1080144.V1>PROP_PREF_PHONE_FLAGTypeDef">
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PROP_PREF_PHONE_FLAGTypeShape", propOrder = {
"value"
})
public class PROPPREFPHONEFLAGTypeShape {
@XmlValue
protected String value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
}
| [
"[email protected]"
] | |
494c1edc905a22beba2d73691a13fb5a3ece2e53 | 033de48e2ca12f39be54d86c2e6e4cd3775a38ab | /app/src/main/java/com/e/android_version/App_About.java | 247d8c75d9c85d63f21e01679647872c77a440dd | [] | no_license | Community-Discuss/Android_Version | 2214e68dfea7cf1b81af1c1d106986b0637e1878 | 2fc9010b083201ae185bc59e1c7c6aeb3d67aaf5 | refs/heads/master | 2023-02-17T06:47:53.303736 | 2021-01-15T05:30:58 | 2021-01-15T05:30:58 | 319,246,287 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.e.android_version;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class App_About extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app__about);
}
} | [
"[email protected]"
] | |
f3b495c8613f79c8573efdd237189f9cf899421f | 696a937b9f8758977e2f5714eed8a5692eea95a0 | /project/server/src/main/java/ru/daniilazarnov/server/database/Authentication.java | af96ca8540c912dba5415fb7ab49eb7fb5f7f5ff | [
"MIT"
] | permissive | NPLM2020/java-net-course | 9347a87a000a78530ad6f1553a99a27e4796543e | 8c9ae3778bf3c3317519da41045a562c437c4aae | refs/heads/main | 2023-03-11T03:58:53.526963 | 2021-02-25T17:02:40 | 2021-02-25T17:02:40 | 332,827,982 | 0 | 0 | MIT | 2021-01-25T17:30:28 | 2021-01-25T17:30:27 | null | UTF-8 | Java | false | false | 153 | java | package ru.daniilazarnov.server.database;
public interface Authentication {
boolean login(String name, String password) throws DatabaseException;
}
| [
"[email protected]"
] | |
1c2210838a2aa2cf0906ddfc253d2374fa3462fd | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /api-vs-impl-small/core/src/main/java/org/gradle/testcore/performancenull_50/Productionnull_4939.java | 47af0b1de63b1afc2c664486bc8d360e992bfb50 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 589 | java | package org.gradle.testcore.performancenull_50;
public class Productionnull_4939 {
private final String property;
public Productionnull_4939(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"[email protected]"
] | |
18d9ab278d45168d4060f01f51db9b98f53e9f17 | 9c7e8ffeac14f451a90bf559383ec5566ea81d1b | /projects/colt/src/main/java/cern/colt/EDU/oswego/cs/dl/util/concurrent/WaitFreeQueue.java | 0da729e147f2d3dca193bff866de7a2512ddb8e6 | [
"MIT"
] | permissive | mc-imperial/jtool-sct | fc2209f2d6c6273e9dae7a37a8209291914a7195 | 80811bb88e1cec0234bc720b5b47ec9e2cdf6364 | refs/heads/master | 2021-01-12T12:46:55.912768 | 2016-10-26T11:07:18 | 2016-10-26T11:07:20 | 69,858,207 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,427 | java | /*
File: WaitFreeQueue.java
Originally written by Doug Lea and released into the public domain.
This may be used for any purposes whatsoever without acknowledgment.
Thanks for the assistance and support of Sun Microsystems Labs,
and everyone contributing, testing, and using this code.
History:
Date Who What
16Jun1998 dl Create public version
5Aug1998 dl replaced int counters with longs
*/
package cern.colt.EDU.oswego.cs.dl.util.concurrent;
/**
* A wait-free linked list based queue implementation,
* adapted from the algorithm described in
* <a
* href="http://www.cs.rochester.edu/u/michael/PODC96.html"> Simple,
* Fast, and Practical Non-Blocking and Blocking Concurrent Queue
* Algorithms</a> by Maged M. Michael and Michael L. Scott.
* This implementation is not strictly wait-free since it
* relies on locking for basic atomicity and visibility requirements.
* Locks can impose unbounded waits, although this should not
* be a major practical concern here since each lock is held
* for the duration of only a few statements. (However, the
* overhead of using so many locks can make it less attractive
* than other Channel implementations on JVMs where locking
* operations are very slow.)
* <p>
* The main advantage of this implementation over
* LinkedQueue
* is that it does not strictly prohibit multiple concurrent
* puts and/or multiple concurrent takes, but instead retries
* these actions upon detection of interference.
* Performance depends in part on the locking and scheduling
* policies of the Java VM.
* On at least some VMs, this implementation tends to perform well in
* producer/consumer applications in which the queue is
* hardly ever empty for long periods, normally because both the producers
* and consumers are constantly active, and especially so on
* multiple-CPU machines. However, it is a poor choice for
* applications in which there is so much activity that
* internal contention-based retries predominate computation, or
* in which take() may be expected to have to wait
* for items to appear. The blocking take() operation performs a busy-wait
* spin loop, which can needlessly eat up CPU time, especially
* on uniprocessors. It would be a better idea in this case to
* use an otherwise similar (and usually at least as efficient)
* LinkedQueue or BoundedLinkedQueue.
* @see BoundedLinkedQueue
* @see LinkedQueue
*
* <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
**/
public class WaitFreeQueue implements Channel {
/**
* Node class for linked list.
* <p>
* This is a faithful translation of Michael/Scott version. But
* there are two accommodations to Java that
* lead to a certain amount of ugliness. (Well,
* a lot of ugliness.)
* <ul>
* <li> Since there is no atomic double-word read, compare,
* or compare-and-swap in java, all of these are
* simulated by synchronized blocks and methods.
*
* <li> Their (ptr, count) `pointer' fields are expanded out
* into the Node class since operations should be synched
* on each Node anyway.
* </ul>
**/
protected final static class Node { // list nodes
protected Object value;
protected Node next = null;
protected long count = 0; // version number of pointer
/** Make a new node with indicated item, and null link **/
protected Node(Object x) { value = x; }
/** atomic equality test of versioned pointer **/
protected final synchronized boolean pointerEquals(Node assumedNext,
long assumedCount) {
return assumedNext == next && assumedCount == count;
}
/** simulated double-compare-and-swap **/
protected final synchronized boolean commit(Node assumedNext,
long assumedCount,
Node newNext,
long newCount) {
boolean success = (next == assumedNext && count == assumedCount);
if (success) { next = newNext; count = newCount; }
return success;
}
}
/**
* head_ and tail_ are used only as counted pointers,
* not as nodes. They intially both point to a dummy empty node.
**/
protected final Node head_;
protected final Node tail_;
public WaitFreeQueue() {
Node dummy = new Node(null);
head_ = new Node(null);
tail_ = new Node(null);
head_.next = dummy;
tail_.next = dummy;
}
protected void insert(Object x) throws InterruptedException {
Node node = new Node(x);
for (;;) {
if (Thread.interrupted()) throw new InterruptedException();
// Atomically read tail
Node tailDotNext;
long tailDotCount;
synchronized(tail_) {
tailDotNext = tail_.next;
tailDotCount = tail_.count;
}
// Atomically read last (tail_.next)
Node lastDotNext;
long lastDotCount;
synchronized(tailDotNext) {
lastDotNext = tailDotNext.next;
lastDotCount = tailDotNext.count;
}
// only proceed if tail unchanged since read last
if (tail_.pointerEquals(tailDotNext, tailDotCount)) {
if (lastDotNext == null) { // a spot is available to insert node
if (tailDotNext.commit(lastDotNext, lastDotCount,
node, lastDotCount+1)) {
tail_.commit(tailDotNext, tailDotCount,
node, tailDotCount+1);
return;
}
}
else { // help out and retry
tail_.commit(tailDotNext, tailDotCount,
lastDotNext, tailDotCount+1);
}
}
}
}
protected Object extract() throws InterruptedException {
for (;;) {
if (Thread.interrupted()) throw new InterruptedException();
// atomically read head, tail
Node headDotNext;
long headDotCount;
synchronized(head_) {
headDotNext = head_.next;
headDotCount = head_.count;
}
Node tailDotNext;
long tailDotCount;
synchronized(tail_) {
tailDotNext = tail_.next;
tailDotCount = tail_.count;
}
Node first = headDotNext.next;
// only proceed if head still same after reading tail
if (head_.pointerEquals(headDotNext, headDotCount)) {
if (headDotNext == tailDotNext) {
if (first == null) { // empty
return null;
}
else { // being updated
tail_.commit(tailDotNext, tailDotCount,
first, tailDotCount+1);
}
}
else { // valid
Object x = first.value;
if (head_.commit(headDotNext, headDotCount,
first, headDotCount+1)) {
first.value = null;
return x;
}
}
}
}
}
/**
* Spin until poll returns a non-null value.
* A Thread.sleep(0) is performed on each iteration
* as a heuristic to reduce contention. If you would
* rather use, for example, an exponential backoff,
* you could manually set this up using poll.
**/
public Object take() throws InterruptedException {
for(;;) {
Object x = extract();
if (x != null)
return x;
else
Thread.sleep(0);
}
}
/**
* Spin until poll returns a non-null value or time elapses.
* if msecs is positive, a Thread.sleep(0) is performed on each iteration
* as a heuristic to reduce contention.
**/
public Object poll(long msecs) throws InterruptedException {
Object x = extract();
if (x != null || msecs <= 0)
return x;
else {
long startTime = System.currentTimeMillis();
Thread.sleep(0);
for(;;) {
x = extract();
if (x != null)
return x;
else if (System.currentTimeMillis() - startTime >= msecs)
return null;
else
Thread.sleep(0);
}
}
}
public void put(Object x) throws InterruptedException {
if (x == null) throw new IllegalArgumentException();
insert(x);
}
public boolean offer(Object x, long msecs) throws InterruptedException {
if (x == null) throw new IllegalArgumentException();
insert(x);
return true;
}
public Object peek() {
// a simplified version of extract; still needs retries in case of updates
for (;;) {
if (Thread.interrupted()) return null;
// atomically read head, tail
Node headDotNext;
long headDotCount;
synchronized(head_) {
headDotNext = head_.next;
headDotCount = head_.count;
}
Node tailDotNext;
long tailDotCount;
synchronized(tail_) {
tailDotNext = tail_.next;
tailDotCount = tail_.count;
}
Node first = headDotNext.next;
// only proceed if head still same after reading tail
if (head_.pointerEquals(headDotNext, headDotCount)) {
if (headDotNext == tailDotNext) {
if (first == null) { // empty
return null;
}
}
else { // valid
return first.value;
}
}
}
}
}
| [
"[email protected]"
] | |
e71447c2327814617a0ceade650f0f713c4d609c | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_1008463.java | 210ef2d6f3442b12105c665a99442491e5d81874 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | @Override protected TokenStream normalize(String fieldName,TokenStream in){
TokenStream result=in;
for ( TokenFilterFactory filter : tokenFilters) {
if (filter instanceof MultiTermAwareComponent) {
filter=(TokenFilterFactory)((MultiTermAwareComponent)filter).getMultiTermComponent();
result=filter.create(result);
}
}
return result;
}
| [
"[email protected]"
] | |
4a1f163af45923697d2b4901a17b7e98f055ba43 | 15a8fba2944e017f2ecb29ffc79ce71822bc579f | /nm-loan/nm-loan-comp/nm-loan-cust/src/main/java/com/hs/loan/cust/entity/AppCustOtherLoan.java | 10d8a8018f73fdcfdaed97885e043b105aa1cdd8 | [] | no_license | cenbow/nm | 875189feac6ab70605e77b6b9240b51ebe5531f3 | f448c103a09ab055e9e50eb6fc77b131cc3f40ff | refs/heads/master | 2021-01-20T03:53:37.880188 | 2017-06-28T07:51:04 | 2017-06-28T07:51:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,506 | java | package com.hs.loan.cust.entity;
import java.util.Date;
import java.io.Serializable;
import com.hs.loan.cust.itface.ICustExtraInfo;
/**
* APP_客户其他分期信息 对象
* @author autocreate
* @create 2015-10-26
*/
public class AppCustOtherLoan implements Serializable,ICustExtraInfo{
private static final long serialVersionUID = 1L;
/*** ID */
private String id ;
/*** 客户编号 */
private String custNo ;
/*** 信贷办理机构 */
private String openOrg ;
/*** 信贷分期金额 */
private String loanAmt ;
/*** 每月还款额 */
private java.math.BigDecimal mthAmt ;
/*** 信贷每月还款日 */
private String loanMthDay ;
/*** 信贷剩余期限(月) */
private String loanMonth ;
/*** 备注 */
private String remark ;
/*** 开始日期 */
private Date beginDate ;
/*** 结束日期 */
private Date endDate ;
private Integer instNum;
//构造函数
public AppCustOtherLoan(){}
//getter和setter方法
/**
* 获取 ID
* @return String
*/
public String getId() {
return id;
}
/**
* 设置 ID
* @param id
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取 客户编号
* @return String
*/
public String getCustNo() {
return custNo;
}
/**
* 设置 客户编号
* @param custNo
*/
public void setCustNo(String custNo) {
this.custNo = custNo;
}
/**
* 获取 信贷办理机构
* @return String
*/
public String getOpenOrg() {
return openOrg;
}
/**
* 设置 信贷办理机构
* @param openOrg
*/
public void setOpenOrg(String openOrg) {
this.openOrg = openOrg;
}
/**
* 获取 信贷分期金额
* @return String
*/
public String getLoanAmt() {
return loanAmt;
}
/**
* 设置 信贷分期金额
* @param loanAmt
*/
public void setLoanAmt(String loanAmt) {
this.loanAmt = loanAmt;
}
/**
* 获取 信贷每月还款日
* @return String
*/
public String getLoanMthDay() {
return loanMthDay;
}
/**
* 设置 信贷每月还款日
* @param loanMthDay
*/
public void setLoanMthDay(String loanMthDay) {
this.loanMthDay = loanMthDay;
}
/**
* 获取 信贷剩余期限(月)
* @return String
*/
public String getLoanMonth() {
return loanMonth;
}
/**
* 设置 信贷剩余期限(月)
* @param loanMonth
*/
public void setLoanMonth(String loanMonth) {
this.loanMonth = loanMonth;
}
/**
* 获取 备注
* @return String
*/
public String getRemark() {
return remark;
}
/**
* 设置 备注
* @param remark
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 获取 开始日期
* @return Date
*/
public Date getBeginDate() {
return beginDate;
}
/**
* 设置 开始日期
* @param beginDate
*/
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
/**
* 获取 结束日期
* @return Date
*/
public Date getEndDate() {
return endDate;
}
/**
* 设置 结束日期
* @param endDate
*/
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public java.math.BigDecimal getMthAmt() {
return mthAmt;
}
public void setMthAmt(java.math.BigDecimal mthAmt) {
this.mthAmt = mthAmt;
}
public Integer getInstNum() {
return instNum;
}
public void setInstNum(Integer instNum) {
this.instNum = instNum;
}
} | [
"[email protected]"
] | |
2c861d3a9cd1ce8397894e4140550c7527670f88 | 15fb494e93dbb1f7aee89e6ca1fb7574b4832d66 | /stock-management-automation/src/test/java/io/github/ydhekim/stock_management_automation/model/TestOrderClass.java | 951e8bf8ec01ecbc5fa8980ed618e40ea92e2c3e | [] | no_license | nirayAslan/stock-management-automation | 88582099927dae3e2bb9a24305619ba39ac2c3f5 | 0b15d02d03d50a8588df9511ea206faf25beac84 | refs/heads/master | 2021-10-08T06:30:28.406111 | 2018-12-09T12:31:01 | 2018-12-09T12:31:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,988 | java | /**
* @author ydhekim
* */
package io.github.ydhekim.stock_management_automation.model;
import static org.junit.Assert.*;
import java.util.Date;
import org.junit.Test;
public class TestOrderClass {
@Test
public void testConstructorEmpty() {
Order order = new Order();
assertNotNull(order);
}
@Test
public void testConstructor() {
Supplier supplier = new Supplier();
Employee employee = new Employee();
Date date = new Date();
Order order = new Order(1, 2, true, date, supplier, employee);
assertNotNull(order);
}
@Test
public void testGetId() {
Order order = new Order();
assertEquals(order.getId(), order.id);
}
@Test
public void testSetId() {
Order order = new Order();
order.setId(5);
assertEquals(order.getId(), order.id);
}
@Test
public void testGetAmount() {
Order order = new Order();
assertEquals(order.getAmount(), order.amount);
}
@Test
public void testSetAmount() {
Order order = new Order();
order.setAmount(5);
assertEquals(order.getAmount(), order.amount);
}
@Test
public void testIsConfirmed() {
Order order = new Order();
assertFalse(order.isConfirmed());
}
@Test
public void testSetConfirmed() {
Order order = new Order();
order.setConfirmed(true);
assertTrue(order.isConfirmed());
}
// TODO: Get/Set for orderDate!
// @Test
// public void testGetOrderDate() {
// Order order = new Order();
// order.getOrderDate().getYear();
// }
@Test
public void testGetSupplier() {
Order order = new Order();
assertEquals(order.getSupplier(), order.supplier);
}
@Test
public void testSetSupplierById() {
Order order = new Order();
Supplier supplier = new Supplier();
supplier.setId(1);
order.setSupplier(supplier);
assertEquals(order.getSupplier().getId(), supplier.getId());
}
@Test
public void testSetSupplierByName() {
Order order = new Order();
Supplier supplier = new Supplier();
supplier.setName("testName");
order.setSupplier(supplier);
assertEquals(order.getSupplier().getName(), supplier.getName());
}
@Test
public void testSetSupplierByProductId() {
Order order = new Order();
Supplier supplier = new Supplier();
Product product = new Product();
product.setId(1);
supplier.setProduct(product);
order.setSupplier(supplier);
assertEquals(order.getSupplier().getProduct().getId(), product.getId());
}
@Test
public void testSetSupplierByProductAmount() {
Order order = new Order();
Supplier supplier = new Supplier();
Product product = new Product();
product.setAmount(100);
supplier.setProduct(product);
order.setSupplier(supplier);
assertEquals(order.getSupplier().getProduct().getAmount(), product.getAmount());
}
@Test
public void testSetSupplierByProductName() {
Order order = new Order();
Supplier supplier = new Supplier();
Product product = new Product();
product.setName("testName");
supplier.setProduct(product);
order.setSupplier(supplier);
assertEquals(order.getSupplier().getProduct().getName(), product.getName());
}
@Test
public void testSetSupplierByProductType() {
Order order = new Order();
Supplier supplier = new Supplier();
Product product = new Product();
product.setType("testType");
supplier.setProduct(product);
order.setSupplier(supplier);
assertEquals(order.getSupplier().getProduct().getType(), product.getType());
}
@Test
public void testGetEmployee() {
Order order = new Order();
assertEquals(order.getEmployee(), order.employee);
}
@Test
public void testSetEmployeeById() {
Order order = new Order();
Employee employee = new Employee();
employee.setId(1);
order.setEmployee(employee);
}
@Test
public void testSetEmployeeByDepartmentId() {
Order order = new Order();
Employee employee = new Employee();
Department department = new Department();
department.setId(1);
employee.setDepartment(department);
order.setEmployee(employee);
assertEquals(order.getEmployee().getDepartment().getId(), department.getId());
}
}
| [
"[email protected]"
] | |
647c0110ed2604bbeda8856f8cd12adbdc957343 | 3641bb7f717c235145879f9ba659468697d57ae0 | /jecp-dubbo-shop-web/src/main/java/com/jecp/sysmanage/service/TawSystemDicttypeService.java | 3c85c05fd5243960f31c76169029d21f14807a4f | [] | no_license | xtakeit/Distributed-Seckill | 62357cb682a4c865a06c9d90b61b4104b4706b8a | 6c66a3a050041fd17965555de2ee4f23c478e798 | refs/heads/master | 2022-11-13T05:33:27.557153 | 2019-06-23T15:03:24 | 2019-06-23T15:03:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 900 | java | package com.jecp.sysmanage.service;
import com.jecp.base.service.BaseService;
import com.jecp.sysmanage.model.TawSystemDicttype;
public interface TawSystemDicttypeService extends BaseService<TawSystemDicttype>{
/**
* 根据父节点ID获得子节点
* @param pid
* @return
*/
public String getDictTree(String pid);
/**
* 删除当前父节点
* @param dictid
*/
public int delDictTree(Integer dictid);
/**
* 查询字典是否重复
* @param tawSystemDicttype
* @return
*/
public int isRepeat(String parentdictid,String dictname,String dictid);
/**
* 根据id查询
* @param dictid
* @return
*/
public String get(Integer dictid);
/**
* 获得字典树
* @return
*/
public String getTree(String parentDictid);
public String getToJson(String parentDictid);
public String getCodeToJson(String parentDictid);
}
| [
"[email protected]"
] | |
b8ac779766859dc9e24da3f56b0cd57e509bb780 | 979e3b5085a943f2e4f316e8aa10b2f959e0d9ce | /src/map/SortedMapApp.java | 63a2eda39bb10fab36e035139135c04b548a2deb | [] | no_license | aripkur/java-struktur-data | 9dc4304b2503b7a0ca9a766e41d58869f7b10608 | 310b17eaa19c9e4b31504da721086000c7bac0c0 | refs/heads/master | 2023-07-10T00:35:20.340411 | 2021-08-10T13:47:10 | 2021-08-10T13:47:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | package map;
import java.util.Comparator;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
public class SortedMapApp {
public static void main(String[] args) {
Comparator<String> stringComparator = new Comparator<String>() {
@Override
public int compare(String s, String t1) {
return t1.compareTo(s);
}
};
SortedMap<String, String> sortedMap = new TreeMap<>(stringComparator);
// SortedMap<String, String> sortedMap = new TreeMap<>();
sortedMap.put("aaa", "AAA");
sortedMap.put("ccc", "CCC");
sortedMap.put("bbb", "BBB");
for (var key : sortedMap.keySet()){
System.out.println(key);
}
}
}
| [
"[email protected]"
] | |
47e0f9f1407db970aae3a512ab8a744778c261cc | 430f0f8194746ff5a07f79708d8e79df5de99091 | /src/me/async/customenchants/effect/armour/NourishingEffect.java | f04cd0a6c86b2b97b53de8634d2a6b1fd5fe92d6 | [
"MIT"
] | permissive | AsyncVoid/CustomEnchants | 684e8c7ee551807ac2c16754768c3cb67fe7f15f | 3cab41efe1ab0c346cf10f3521ad5f64ec37e8df | refs/heads/master | 2022-08-24T07:23:49.842504 | 2020-05-19T21:48:58 | 2020-05-19T21:48:58 | 265,373,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package me.async.customenchants.effect.armour;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import me.async.customenchants.effect.IEffect;
public class NourishingEffect extends IEffect
{
@Override
public void applyToLiving(LivingEntity en, int level)
{
en.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, Integer.MAX_VALUE, 0));
}
@Override
public void removeFromLiving(LivingEntity en, int level)
{
en.removePotionEffect(PotionEffectType.SATURATION);
}
}
| [
"[email protected]"
] | |
19fe0ee5d2ca581c9760b468ff88077346ed3ec2 | d70d1e0bc112c2796a5e554ce387002ad95d89b2 | /goxreader/src/main/java/com/artifex/mupdfdemo/SearchTask.java | 1e85bcc9024e7579cbf9b1d300d5a001f9caface | [] | no_license | tochkov/ggoxy | a527877709ae6054012b3e2f0d7b1aca7931e624 | ff8c815add0b2c7ab1bca3fe16420b1ebe1745ed | refs/heads/master | 2021-01-10T02:43:07.968651 | 2015-11-23T20:38:02 | 2015-11-23T20:38:02 | 44,198,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,474 | java | package com.artifex.mupdfdemo;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.RectF;
import android.os.Handler;
import com.goxapps.goxreader.R;
import java.util.ArrayList;
class ProgressDialogX extends ProgressDialog {
public ProgressDialogX(Context context) {
super(context);
}
private boolean mCancelled = false;
public boolean isCancelled() {
return mCancelled;
}
@Override
public void cancel() {
mCancelled = true;
super.cancel();
}
}
public abstract class SearchTask {
private static final int SEARCH_PROGRESS_DELAY = 200;
private final Context mContext;
private final MuPDFCore mCore;
private final Handler mHandler;
private final AlertDialog.Builder mAlertBuilder;
private AsyncTask<Void,Integer,SearchTaskResult> mSearchTask;
private AsyncTask<Void, Void, ArrayList<SearchTaskResult>> mAllSearchTask;
public SearchTask(Context context, MuPDFCore core) {
mContext = context;
mCore = core;
mHandler = new Handler();
mAlertBuilder = new AlertDialog.Builder(context);
}
protected abstract void onTextFound(SearchTaskResult result);
protected abstract void onTextFounds(ArrayList<SearchTaskResult> result);
public void stop() {
if (mSearchTask != null) {
mSearchTask.cancel(true);
mSearchTask = null;
}
if (mAllSearchTask != null) {
mAllSearchTask.cancel(true);
mAllSearchTask = null;
}
}
public void searchAll(final String text){
if (mCore == null)
return;
stop();
mAllSearchTask = new AsyncTask<Void, Void, ArrayList<SearchTaskResult>>() {
@Override
protected ArrayList<SearchTaskResult> doInBackground(Void... params) {
ArrayList<SearchTaskResult> results = new ArrayList<SearchTaskResult>();
for(int index=0; index<mCore.countSinglePages(); index++){
RectF searchHits[] = mCore.searchPage(index, text);
if (searchHits != null && searchHits.length > 0)
results.add(new SearchTaskResult(text, index, searchHits));
}
return results;
}
@Override
protected void onPostExecute(ArrayList<SearchTaskResult> result) {
onTextFounds(result);
}
};
mAllSearchTask.execute();
}
public void go(final String text, int direction, int displayPage, int searchPage) {
if (mCore == null)
return;
stop();
final int increment = direction;
final int startIndex = searchPage == -1 ? displayPage : searchPage + increment;
final ProgressDialogX progressDialog = new ProgressDialogX(mContext);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(mContext.getString(R.string.searching_));
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
stop();
}
});
progressDialog.setMax(mCore.countDisplayPage());
mSearchTask = new AsyncTask<Void,Integer,SearchTaskResult>() {
@Override
protected SearchTaskResult doInBackground(Void... params) {
int index = startIndex;
while (0 <= index && index < mCore.countDisplayPage() && !isCancelled()) {
publishProgress(index);
RectF searchHits[] = mCore.searchPage(index, text);
if (searchHits != null && searchHits.length > 0)
return new SearchTaskResult(text, index, searchHits);
index += increment;
}
return null;
}
@Override
protected void onPostExecute(SearchTaskResult result) {
progressDialog.cancel();
if (result != null) {
onTextFound(result);
} else {
mAlertBuilder.setTitle(SearchTaskResult.get() == null ? R.string.text_not_found : R.string.no_further_occurrences_found);
AlertDialog alert = mAlertBuilder.create();
alert.setButton(AlertDialog.BUTTON_POSITIVE, mContext.getString(R.string.dismiss),
(DialogInterface.OnClickListener)null);
alert.show();
}
}
@Override
protected void onCancelled() {
progressDialog.cancel();
}
@Override
protected void onProgressUpdate(Integer... values) {
progressDialog.setProgress(values[0].intValue());
}
@Override
protected void onPreExecute() {
super.onPreExecute();
mHandler.postDelayed(new Runnable() {
public void run() {
if (!progressDialog.isCancelled())
{
progressDialog.show();
progressDialog.setProgress(startIndex);
}
}
}, SEARCH_PROGRESS_DELAY);
}
};
mSearchTask.execute();
}
}
| [
"[email protected]"
] | |
77123dfd21ed3d41c8029ba110b0fa92a9020ffa | 3709a919cb851d2dce17f8cad3fe92a149399220 | /lilian-experimental/src/main/java/org/lilian/ifs/LearnIFS.java | 6d84c6666e97f451020d76fd99056c047cd0ff1f | [] | no_license | pbloem/Lilian-experimental | deda469a784f02b8a944863d08e653e91d18b959 | 267a136edd8a679e56f7d097e61c24764c2b6c68 | refs/heads/master | 2021-01-23T18:09:13.098906 | 2020-10-13T12:27:18 | 2020-10-13T12:27:18 | 3,208,311 | 2 | 0 | null | 2020-10-13T12:27:19 | 2012-01-18T12:12:35 | Java | UTF-8 | Java | false | false | 4,992 | java | package org.lilian.ifs;
import static org.lilian.util.Series.series;
import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.imageio.ImageIO;
import org.data2semantics.platform.Global;
import org.data2semantics.platform.annotation.In;
import org.data2semantics.platform.annotation.Main;
import org.lilian.data.real.Draw;
import org.lilian.data.real.MVN;
import org.lilian.data.real.Map;
import org.lilian.data.real.Point;
import org.lilian.data.real.Similitude;
import org.lilian.data.real.fractal.EM;
import org.lilian.data.real.fractal.IFS;
import org.lilian.data.real.fractal.IFSs;
import org.lilian.platform.graphs.Random;
import org.lilian.search.Parametrizable;
import org.lilian.util.Functions;
import org.lilian.util.Series;
import com.itextpdf.text.log.SysoLogger;
public class LearnIFS
{
@In(name="data")
public List<Point> data;
@In(name="high quality")
public boolean highQuality;
@In(name="num components")
public int numComponents;
@In(name="depth")
public int depth;
@In(name="sample size")
public int sampleSize;
@In(name="iterations")
public int iterations;
@In(name="repeats")
public int repeats;
public List<Double> likelihoods = new ArrayList<Double>();
public double bestLikelihood = Double.POSITIVE_INFINITY;
public List<IFS<Similitude>> bestHistory = null;
public List<List<Double>> bestDepths = null;
public List<Similitude> bestPosts = null;
@Main
public void run()
throws IOException
{
org.lilian.Global.random = new java.util.Random();
BufferedImage image = Draw.draw(data, 400, true);
ImageIO.write(image, "PNG", new File(Global.getWorkingDir(), "data.png"));
ExecutorService exec = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
for(int rep : series(repeats))
exec.execute(new Repeat(rep, Global.getWorkingDir()));
exec.shutdown();
while(! exec.isTerminated());
System.out.println("All threads finished");
File dir = new File(Global.getWorkingDir(), "best/");
dir.mkdirs();
Writer out = new BufferedWriter(new FileWriter(new File(Global.getWorkingDir(), "likelihoods.csv")));
for(double ll : likelihoods)
out.write(ll + "\n");
out.close();
for(int i : series(iterations))
write(bestHistory.get(i), bestDepths.get(i), bestPosts.get(i), dir, String.format("iteration.%06d", i));
try
{
org.data2semantics.platform.util.Functions.python(Global.getWorkingDir(), "fractals/histogram.py");
} catch (Exception e) {
System.out.println("Failed to run plot script. " + e);
}
}
public synchronized void done(double likelihood, List<IFS<Similitude>> history, List<List<Double>> depths, List<Similitude> posts)
{
likelihoods.add(likelihood);
if(likelihood < bestLikelihood)
{
bestLikelihood = likelihood;
bestHistory = history;
bestDepths = depths;
bestPosts = posts;
}
}
public <M extends Map & Parametrizable> void write(IFS<Similitude> ifs, List<Double> depths, Similitude post, File dir, String name) throws IOException
{
int div = highQuality ? 1 : 4;
int its = highQuality ? (int) 1000000 : 10000;
BufferedImage image;
image = Draw.draw(ifs, its, 1000/div, true, depths, post);
ImageIO.write(image, "PNG", new File(dir, name+".png"));
image = Draw.draw(ifs.generator(), its, 1000/div, true, post);
ImageIO.write(image, "PNG", new File(dir, name+".deep.png"));
}
private class Repeat extends Thread
{
private int rep;
private File dir;
public Repeat(int rep, File dir)
{
this.rep = rep;
this.dir = dir;
}
@Override
public void run()
{
List<IFS<Similitude>> history = new ArrayList<IFS<Similitude>>(iterations);
List<List<Double>> dHistory = new ArrayList<List<Double>>(iterations);
List<Similitude> pHistory = new ArrayList<Similitude>(iterations);
IFS<Similitude> initial = IFSs.initialSphere(data.get(0).dimensionality(), numComponents, 1.0, 0.5, true);
if(rep == 0)
initial = IFSs.sierpinskiSim();
EM em = new EM(data, sampleSize, initial, depth, true);
history.add(em.model());
dHistory.add(em.depths());
for(int i : series(iterations))
{
try
{
write(em.model(), em.depths(), em.post(), dir, String.format("rep.%04d.%04d", rep, i));
} catch (IOException e) {
throw new RuntimeException(e);
}
em.iterate();
history.add(em.model());
dHistory.add(em.depths());
pHistory.add(em.post());
}
double likelihood = - em.logLikelihood(data);
System.out.println(rep + " " + likelihood);
done(likelihood, history, dHistory, pHistory);
System.out.println("Thread " + rep + " finished");
}
}
}
| [
"[email protected]"
] | |
3784122204eb25911132cda1e66213a6fb70be62 | a7397709e9ff6eca5a8117b4479bcc64a4e41d4b | /components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/swing/SettingsPanel.java | dbb054e54657ae6f9e0347d27e72bd55a3a4a25d | [] | no_license | alhazred/userland | 6fbd28d281c08cf76f59e41e1331fe49fea6bcf2 | 72ea01e9a0ea237c9a960b3533273dc0afe06ff2 | refs/heads/master | 2020-05-17T10:17:16.836583 | 2013-03-04T07:36:23 | 2013-03-04T07:36:23 | 8,550,473 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,823 | java | /*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.util.swing;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import com.oracle.solaris.vp.util.misc.*;
import com.oracle.solaris.vp.util.swing.layout.*;
/**
* The {@code SettingsPanel} class provides a skeleton for many UI panels. Its
* structure follows:
* <p/>
* <pre>
* +-+-----------------------------------------+-+
* | +-----------------------------------------+ |
* | | {@link #getTitlePane Title pane} | |
* | +-----------------------------------------+ |
* | +-----------------------------------------+ |
* | | {@link #getHelpPane Help pane} | |
* | +-----------------------------------------+ |
* | +-----------------------------------------+ |
* | | {@link #getContentPane Content pane} | |
* | +-----------------------------------------+ |
* | +-----------------------------------------+ |
* | | {@link #getButtonBar Button bar} | |
* | +-----------------------------------------+ |
* +-+-----------------------------------------+-+
* </pre>
* <p/>
* Each component is added as part of a {@link ColumnLayout}, so
* ColumnConstraint attributes for each of the components can be changed as
* needed. For example:
* <pre>
* // Remove the spacing between the help and content panes
* ColumnLayoutConstraint constraint =
* getLayout().getConstraint(getContentPane());
* constraint.setGap(0);
* </pre>
*/
@SuppressWarnings({"serial"})
public class SettingsPanel extends JPanel {
//
// Inner classes
//
/**
* AbstractAction that determines its enabledness based on whether its
* button is non-null and it and its descendents are all visible. This is
* necessary so that the "submit" and "cancel" keybindings can be propagated
* up the Component hierarchy if they don't apply.
*/
protected abstract static class ButtonAction extends AbstractAction {
//
// ActionListener methods
//
@Override
public void actionPerformed(ActionEvent e) {
AbstractButton button = getFirstVisibleButton();
if (button != null) {
button.doClick(0);
}
}
//
// Action methods
//
@Override
public boolean isEnabled() {
return super.isEnabled() && getFirstVisibleButton() != null;
}
//
// ButtonAction methods
//
public abstract AbstractButton[] getButtons();
//
// Private methods
//
private AbstractButton getFirstVisibleButton() {
BUTTONS: for (AbstractButton button : getButtons()) {
if (button != null) {
for (Component c = button; c != null; c = c.getParent()) {
if (!c.isVisible()) {
continue BUTTONS;
}
}
return button;
}
}
return null;
}
}
//
// Instance data
//
private ChangeableAggregator aggregator;
private AutoHidePanel titlePane;
private JLabel titleLabel;
private AutoHidePanel helpPane;
private JTextArea helpField;
private AutoHidePanel contentPane;
private SettingsButtonBar buttonBar;
private AbstractButton[] cancelButtons;
private AbstractButton[] submitButtons;
//
// Constructors
//
public SettingsPanel() {
int gap = GUIUtil.getGap();
helpField = new FlowTextArea();
AutoHideTextArea.autoHide(helpField);
helpPane = new AutoHidePanel();
helpPane.setOpaque(false);
helpPane.setLayout(new BorderLayout());
helpPane.add(helpField, BorderLayout.CENTER);
titleLabel = new AutoHideLabel();
decorateTitle(titleLabel);
titlePane = new AutoHidePanel();
titlePane.setOpaque(false);
titlePane.setLayout(new BorderLayout());
titlePane.add(titleLabel, BorderLayout.CENTER);
contentPane = new AutoHidePanel();
contentPane.setLayout(new BorderLayout());
contentPane.setOpaque(false);
buttonBar = new SettingsButtonBar();
ChangeListener listener =
new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
buttonBar.setChanged(aggregator.isChanged());
}
};
aggregator = new ChangeableAggregator(DebugUtil.toBaseName(this));
aggregator.addChangeListener(listener);
// Initialize
listener.stateChanged(null);
setOpaque(false);
ColumnLayoutConstraint c = new ColumnLayoutConstraint(
HorizontalAnchor.FILL, gap);
ColumnLayout layout = new ColumnLayout(VerticalAnchor.FILL);
layout.setDefaultConstraint(c);
setLayout(layout);
add(titlePane, c);
add(helpPane, c);
add(contentPane, c.clone().setWeight(1));
add(buttonBar, c);
// Hitting enter anywhere in panel should submit it
setSubmitButtons(buttonBar.getApplyButton(), buttonBar.getOkayButton(),
buttonBar.getForwardButton(), buttonBar.getCloseButton());
KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
String actName = "submit";
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
enter, actName);
getActionMap().put(actName,
new ButtonAction() {
@Override
public AbstractButton[] getButtons() {
return getSubmitButtons();
}
});
// Hitting escape anywhere in panel should cancel it
setCancelButtons(buttonBar.getCancelButton(),
buttonBar.getCloseButton());
KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
actName = "cancel";
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
escape, actName);
getActionMap().put(actName,
new ButtonAction() {
@Override
public AbstractButton[] getButtons() {
return getCancelButtons();
}
});
}
//
// Container methods
//
@Override
public ColumnLayout getLayout() {
return (ColumnLayout)super.getLayout();
}
//
// SettingsPanel methods
//
/**
* Decorates the given label as a section title.
* <p/>
* This default implementation makes the font bold.
*/
protected void decorateTitle(JLabel label) {
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
/**
* Gets the button bar for this {@code SettingsPanel}. The button bar is
* initialized to be non-opaque.
* <p/>
* The button bar is invisible initially, but is made visible when an {@code
* Action} is added to it. See {@link SettingsButtonBar}.
*/
public SettingsButtonBar getButtonBar() {
return buttonBar;
}
/**
* Gets the buttons to be examined whenever {@code Escape} is pressed
* anywhere inside this {@code SettingsPanel}. The first button that is
* part of a fully-visible component hierarchy will be clicked.
* <p/>
* This value is initialized with the {@link #getButtonBar button bar}'s
* cancel and close buttons.
*
* @return the buttons to be examined
*/
public AbstractButton[] getCancelButtons() {
return cancelButtons;
}
/**
* Gets the content pane for this {@code SettingsPanel}. The content pane
* is initialized to be non-opaque with a {@code BorderLayout}.
*/
public AutoHidePanel getContentPane() {
return contentPane;
}
public ChangeableAggregator getChangeableAggregator() {
return aggregator;
}
/**
* Gets the {@code JTextField} initially contained in the {@link
* #getHelpPane help pane}. Setting the text of this {@code JTextField}
* automatically sets its visibility (visible if non-{@code null}, invisible
* otherwise).
*/
public JTextArea getHelpField() {
return helpField;
}
/**
* Gets the help pane for this {@code SettingsPanel}. The help pane is
* initialized to be non-opaque with a {@code BorderLayout}, containing a
* {@link #getHelpField JTextArea}.
* <p/>
* The help pane is invisible initially since it may not be needed. Setting
* the text in the {@link #getHelpField help field} will make it visible
* automatically.
*/
public AutoHidePanel getHelpPane() {
return helpPane;
}
/**
* Gets the buttons to be examined whenever {@code Escape} is pressed
* anywhere inside this {@code SettingsPanel}. The first button that is
* part of a fully-visible component hierarchy will be clicked.
* <p/>
* This value is initialized with the {@link #getButtonBar button bar}'s
* apply, okay, forward, and close buttons.
*
* @return the buttons to be examined
*/
public AbstractButton[] getSubmitButtons() {
return submitButtons;
}
/**
* Gets the {@code JLabel} initially contained in the {@link #getTitlePane
* title pane}. Setting the icon or text of this {@code JLabel}
* automatically sets its visibility (visible if either is non-{@code null},
* invisible otherwise).
*/
public JLabel getTitleLabel() {
return titleLabel;
}
/**
* Gets the title pane for this {@code SettingsPanel}. The title pane is
* initialized to be non-opaque with a {@code BorderLayout}, containing a
* {@link #getTitleLabel JLabel}.
* <p/>
* The title pane is invisible initially since it may not be needed.
* Setting the text/icon in the {@link #getTitleLabel title label} will make
* it visible automatically.
*/
public AutoHidePanel getTitlePane() {
return titlePane;
}
/**
* Sets the buttons to be examined whenever {@code Escape} is pressed
* anywhere inside this {@code SettingsPanel}. The first button that is
* part of a fully-visible component hierarchy will be clicked.
*
* @param cancelButtons
* the buttons to be examined
*/
public void setCancelButtons(AbstractButton... cancelButtons) {
this.cancelButtons = cancelButtons;
}
public void setContent(Component content) {
setContent(content, true, false);
}
public void setContent(Component content, boolean center, boolean scroll) {
contentPane.removeAll();
if (content != null) {
if (center) {
ColumnLayout layout = new ColumnLayout(VerticalAnchor.CENTER);
JPanel centered = new JPanel(layout);
centered.setOpaque(false);
ColumnLayoutConstraint c =
new ColumnLayoutConstraint(HorizontalAnchor.CENTER);
centered.add(content, c);
content = centered;
}
if (scroll) {
ExtScrollPane scrollPane = new ExtScrollPane(content);
scrollPane.removeBorder();
scrollPane.setOpaque(false);
content = scrollPane;
}
contentPane.setLayout(new BorderLayout());
contentPane.add(content, BorderLayout.CENTER);
}
}
/**
* Sets the buttons to be examined whenever {@code Escape} is pressed
* anywhere inside this {@code SettingsPanel}. The first button that is
* part of a fully-visible component hierarchy will be clicked.
*
* @param submitButtons
* the buttons to be examined
*/
public void setSubmitButtons(AbstractButton... submitButtons) {
this.submitButtons = submitButtons;
}
}
| [
"[email protected]"
] | |
61934035311a1e8a8e3cc9c89246548bb5f87498 | 4fd38a29869a43a8f3a60432ea10e2df64bd0f21 | /dubbo-commons/src/main/java/com/king/service/OrderService.java | fd52c0e8b3ef529bde1f247130747e911116e125 | [] | no_license | kingillusion/freeMarker | 816f84cf91345b2b9a8f4916751e64d39ff76732 | d2c0e6be77a92ee9f25906ef1357c7f1d2e00a5e | refs/heads/master | 2023-01-30T06:34:16.386694 | 2020-09-26T17:57:10 | 2020-09-26T17:57:10 | 289,157,997 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | package com.king.service;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
public interface OrderService {
void initOrder(String userId);
}
| [
"[email protected]"
] | |
6d51b54dd691bc8196f3986c8c47eaf47524f126 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/6/6_8267337de41edac827d5a589d1238a0ba6f2bbad/SolutionDaoTest/6_8267337de41edac827d5a589d1238a0ba6f2bbad_SolutionDaoTest_t.java | 708b8eb51a1c0e3aa6de9d8aa3628f30d9927d30 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,967 | java | /*
* Copyright 2013 JBoss 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 org.optaplanner.examples.common.persistence;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.optaplanner.examples.common.app.LoggingTest;
import org.optaplanner.examples.common.business.ExtensionFileFilter;
import org.optaplanner.examples.common.business.ProblemFileComparator;
@RunWith(Parameterized.class)
public abstract class SolutionDaoTest extends LoggingTest {
protected static Collection<Object[]> getSolutionFilesAsParameters(SolutionDao solutionDao) {
List<File> fileList = new ArrayList<File>(0);
File dataDir = solutionDao.getDataDir();
File unsolvedDataDir = new File(dataDir, "unsolved");
if (!unsolvedDataDir.exists()) {
throw new IllegalStateException("The directory unsolvedDataDir (" + unsolvedDataDir.getAbsolutePath()
+ ") does not exist.");
}
fileList.addAll(
FileUtils.listFiles(unsolvedDataDir, new String[]{solutionDao.getFileExtension()}, true));
File solvedDataDir = new File(dataDir, "solved");
if (solvedDataDir.exists()) {
fileList.addAll(
FileUtils.listFiles(solvedDataDir, new String[]{solutionDao.getFileExtension()}, true));
}
Collections.sort(fileList, new ProblemFileComparator());
List<Object[]> filesAsParameters = new ArrayList<Object[]>();
for (File file : fileList) {
filesAsParameters.add(new Object[]{file});
}
return filesAsParameters;
}
protected SolutionDao solutionDao;
protected File solutionFile;
protected SolutionDaoTest(File solutionFile) {
this.solutionFile = solutionFile;
}
@Before
public void setUp() {
solutionDao = createSolutionDao();
}
protected abstract SolutionDao createSolutionDao();
@Test
public void readSolution() {
solutionDao.readSolution(solutionFile);
}
}
| [
"[email protected]"
] | |
b59d832669fd336f4a868975d63dbbb023aeb3da | 79994fe8679008dc7940479ca77da67df06bb148 | /build/app/generated/not_namespaced_r_class_sources/debug/r/androidx/media/R.java | ea0cd251362ec4247c1b6deb57cbfd58f878d7de | [] | no_license | satriantorobimo/my_music_player | a8b8cedc61c59a709915604dfaf810eb703b39ce | 6087bc643e7d3b0c43c0663283a267e99573b5f3 | refs/heads/main | 2023-06-21T14:57:55.260362 | 2021-08-01T12:31:42 | 2021-08-01T12:31:42 | 391,515,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,548 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.media;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f010002;
public static final int font = 0x7f010009;
public static final int fontProviderAuthority = 0x7f01000a;
public static final int fontProviderCerts = 0x7f01000b;
public static final int fontProviderFetchStrategy = 0x7f01000c;
public static final int fontProviderFetchTimeout = 0x7f01000d;
public static final int fontProviderPackage = 0x7f01000e;
public static final int fontProviderQuery = 0x7f01000f;
public static final int fontStyle = 0x7f010010;
public static final int fontVariationSettings = 0x7f010011;
public static final int fontWeight = 0x7f010012;
public static final int ttcIndex = 0x7f010028;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f020002;
public static final int notification_icon_bg_color = 0x7f020003;
public static final int notification_material_background_media_default_color = 0x7f020004;
public static final int primary_text_default_material_dark = 0x7f020005;
public static final int ripple_material_light = 0x7f020006;
public static final int secondary_text_default_material_dark = 0x7f020007;
public static final int secondary_text_default_material_light = 0x7f020008;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f030000;
public static final int compat_button_inset_vertical_material = 0x7f030001;
public static final int compat_button_padding_horizontal_material = 0x7f030002;
public static final int compat_button_padding_vertical_material = 0x7f030003;
public static final int compat_control_corner_material = 0x7f030004;
public static final int compat_notification_large_icon_max_height = 0x7f030005;
public static final int compat_notification_large_icon_max_width = 0x7f030006;
public static final int notification_action_icon_size = 0x7f030009;
public static final int notification_action_text_size = 0x7f03000a;
public static final int notification_big_circle_margin = 0x7f03000b;
public static final int notification_content_margin_start = 0x7f03000c;
public static final int notification_large_icon_height = 0x7f03000d;
public static final int notification_large_icon_width = 0x7f03000e;
public static final int notification_main_column_padding_top = 0x7f03000f;
public static final int notification_media_narrow_margin = 0x7f030010;
public static final int notification_right_icon_size = 0x7f030011;
public static final int notification_right_side_padding_top = 0x7f030012;
public static final int notification_small_icon_background_padding = 0x7f030013;
public static final int notification_small_icon_size_as_large = 0x7f030014;
public static final int notification_subtext_size = 0x7f030015;
public static final int notification_top_pad = 0x7f030016;
public static final int notification_top_pad_large_text = 0x7f030017;
public static final int subtitle_corner_radius = 0x7f030018;
public static final int subtitle_outline_width = 0x7f030019;
public static final int subtitle_shadow_offset = 0x7f03001a;
public static final int subtitle_shadow_radius = 0x7f03001b;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f040029;
public static final int notification_bg = 0x7f04002a;
public static final int notification_bg_low = 0x7f04002b;
public static final int notification_bg_low_normal = 0x7f04002c;
public static final int notification_bg_low_pressed = 0x7f04002d;
public static final int notification_bg_normal = 0x7f04002e;
public static final int notification_bg_normal_pressed = 0x7f04002f;
public static final int notification_icon_background = 0x7f040030;
public static final int notification_template_icon_bg = 0x7f040031;
public static final int notification_template_icon_low_bg = 0x7f040032;
public static final int notification_tile_bg = 0x7f040033;
public static final int notify_panel_notification_icon_bg = 0x7f040034;
}
public static final class id {
private id() {}
public static final int action0 = 0x7f050021;
public static final int action_container = 0x7f050022;
public static final int action_divider = 0x7f050023;
public static final int action_image = 0x7f050024;
public static final int action_text = 0x7f050025;
public static final int actions = 0x7f050026;
public static final int async = 0x7f050029;
public static final int blocking = 0x7f05002a;
public static final int cancel_action = 0x7f05002b;
public static final int chronometer = 0x7f05002c;
public static final int end_padder = 0x7f05002e;
public static final int forever = 0x7f05004b;
public static final int icon = 0x7f05004c;
public static final int icon_group = 0x7f05004d;
public static final int info = 0x7f05004f;
public static final int italic = 0x7f050050;
public static final int line1 = 0x7f050055;
public static final int line3 = 0x7f050056;
public static final int media_actions = 0x7f050057;
public static final int normal = 0x7f05005a;
public static final int notification_background = 0x7f05005b;
public static final int notification_main_column = 0x7f05005c;
public static final int notification_main_column_container = 0x7f05005d;
public static final int right_icon = 0x7f05005f;
public static final int right_side = 0x7f050060;
public static final int status_bar_latest_event_content = 0x7f050062;
public static final int tag_transition_group = 0x7f050069;
public static final int tag_unhandled_key_event_manager = 0x7f05006a;
public static final int tag_unhandled_key_listeners = 0x7f05006b;
public static final int text = 0x7f05006c;
public static final int text2 = 0x7f05006d;
public static final int time = 0x7f05006f;
public static final int title = 0x7f050070;
}
public static final class integer {
private integer() {}
public static final int cancel_button_image_alpha = 0x7f060000;
public static final int status_bar_notification_info_maxnum = 0x7f060003;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f070008;
public static final int notification_action_tombstone = 0x7f070009;
public static final int notification_media_action = 0x7f07000a;
public static final int notification_media_cancel_action = 0x7f07000b;
public static final int notification_template_big_media = 0x7f07000c;
public static final int notification_template_big_media_custom = 0x7f07000d;
public static final int notification_template_big_media_narrow = 0x7f07000e;
public static final int notification_template_big_media_narrow_custom = 0x7f07000f;
public static final int notification_template_custom_big = 0x7f070010;
public static final int notification_template_icon_group = 0x7f070011;
public static final int notification_template_lines_media = 0x7f070012;
public static final int notification_template_media = 0x7f070013;
public static final int notification_template_media_custom = 0x7f070014;
public static final int notification_template_part_chronometer = 0x7f070015;
public static final int notification_template_part_time = 0x7f070016;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f090029;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0a000a;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0a000b;
public static final int TextAppearance_Compat_Notification_Info_Media = 0x7f0a000c;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0a000d;
public static final int TextAppearance_Compat_Notification_Line2_Media = 0x7f0a000e;
public static final int TextAppearance_Compat_Notification_Media = 0x7f0a000f;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0a0010;
public static final int TextAppearance_Compat_Notification_Time_Media = 0x7f0a0011;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0a0012;
public static final int TextAppearance_Compat_Notification_Title_Media = 0x7f0a0013;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0a0014;
public static final int Widget_Compat_NotificationActionText = 0x7f0a0015;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f010002 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f010009, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010028 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"[email protected]"
] | |
d940240748c7c97a8f26ebbc46e0ef2decec810e | d42dada1ff6c487c17106bb04795b081da185a58 | /app/src/main/java/com/coolweather/anroid/db/County.java | 30421a7588e637f9b3c922d2c605295f010a0e3a | [
"Apache-2.0"
] | permissive | kiwi7775/coolweather | daf44f8f951c86cacc8fc12eecfb243a0cb32106 | 100a645bd6b90c03c81ee11b64501dc71f05a9bc | refs/heads/master | 2021-01-19T22:23:49.977703 | 2017-05-03T11:17:09 | 2017-05-03T11:17:09 | 88,688,405 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 832 | java | package com.coolweather.anroid.db;
import org.litepal.crud.DataSupport;
/**
* Created by Kiwi7 on 2017/4/20.
*/
public class County extends DataSupport {
private int id;
private String countyName;
private String weatherId;
private int cityId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
public String getWeatherId() {
return weatherId;
}
public void setWeatherId(String weatherId) {
this.weatherId = weatherId;
}
public int getCityId() {
return cityId;
}
public void setCityId(int cityId) {
this.cityId = cityId;
}
}
| [
"[email protected]"
] | |
a3c23ea92161dfd24fda85bf3c8f2079e18ae34f | 3ed571fa5e53344e35338542a1b7654707d90264 | /subscription/util/blocking/durable-subscription/src/main/java/org/occurrent/subscription/blocking/durable/DurableSubscriptionModel.java | acead124dccad40f5da9715a357547312dc05d14 | [] | no_license | JanGroot/occurrent | eafa1e27aa376e758a794d38b808893a4cc208d2 | 141302d3462ad3a9079486808188ad577813a569 | refs/heads/master | 2023-08-16T17:45:39.897010 | 2023-07-10T07:48:41 | 2023-07-10T07:48:41 | 294,930,901 | 0 | 0 | null | 2021-04-08T10:09:13 | 2020-09-12T11:33:13 | null | UTF-8 | Java | false | false | 7,506 | java | /*
* Copyright 2021 Johan Haleby
*
* 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.occurrent.subscription.blocking.durable;
import io.cloudevents.CloudEvent;
import org.occurrent.subscription.StartAt;
import org.occurrent.subscription.SubscriptionFilter;
import org.occurrent.subscription.SubscriptionPosition;
import org.occurrent.subscription.api.blocking.*;
import javax.annotation.PreDestroy;
import java.util.Objects;
import java.util.function.Consumer;
import static java.util.Objects.requireNonNull;
import static org.occurrent.subscription.PositionAwareCloudEvent.getSubscriptionPositionOrThrowIAE;
import static org.occurrent.subscription.util.predicate.EveryN.everyEvent;
/**
* Combines a {@link SubscriptionModel} and with a {@link SubscriptionPositionStorage} to automatically persist
* the subscription position after each successful call to the "action" method
* (i.e. when the consumer in this method {@link DurableSubscriptionModel#subscribe(String, Consumer)} has completed successfully),
* thus making the subscription durable.
*
* <p>
* Note that this implementation stores the subscription position after _every_ action. If you have a lot of events and duplication is not
* that much of a deal, consider changing this behavior by supplying an instance of {@link DurableSubscriptionModelConfig}.
*/
public class DurableSubscriptionModel implements PositionAwareSubscriptionModel, DelegatingSubscriptionModel {
private final PositionAwareSubscriptionModel subscriptionModel;
private final SubscriptionPositionStorage storage;
private final DurableSubscriptionModelConfig config;
/**
* Create a subscription that combines a {@link PositionAwareSubscriptionModel} with a {@link SubscriptionPositionStorage} to automatically
* store the subscription after each successful call to <code>action</code> (The "consumer" in {@link #subscribe(String, Consumer)}).
*
* @param subscriptionModel The subscription that will read events from the event store
* @param storage The {@link SubscriptionPositionStorage} that'll be used to persist the stream position
*/
public DurableSubscriptionModel(PositionAwareSubscriptionModel subscriptionModel, SubscriptionPositionStorage storage) {
this(subscriptionModel, storage, new DurableSubscriptionModelConfig(everyEvent()));
}
/**
* Create a subscription that combines a {@link PositionAwareSubscriptionModel} with a {@link SubscriptionPositionStorage} to automatically
* store the subscription when the predicate defined in {@link DurableSubscriptionModelConfig#persistCloudEventPositionPredicate} is fulfilled.
*
* @param subscriptionModel The subscription that will read events from the event store
* @param storage The {@link SubscriptionPositionStorage} that'll be used to persist the stream position
*/
public DurableSubscriptionModel(PositionAwareSubscriptionModel subscriptionModel, SubscriptionPositionStorage storage,
DurableSubscriptionModelConfig config) {
requireNonNull(subscriptionModel, "subscription cannot be null");
requireNonNull(storage, SubscriptionPositionStorage.class.getSimpleName() + " cannot be null");
requireNonNull(config, DurableSubscriptionModelConfig.class.getSimpleName() + " cannot be null");
this.storage = storage;
this.subscriptionModel = subscriptionModel;
this.config = config;
}
@Override
public Subscription subscribe(String subscriptionId, SubscriptionFilter filter, StartAt startAt, Consumer<CloudEvent> action) {
Objects.requireNonNull(startAt, StartAt.class.getSimpleName() + " supplier cannot be null");
final StartAt startAtToUse;
if (startAt.isDefault()) {
startAtToUse = StartAt.dynamic(() -> {
// It's important that we find the document inside the supplier so that we lookup the latest resume token on retry
SubscriptionPosition subscriptionPosition = storage.read(subscriptionId);
if (subscriptionPosition == null) {
SubscriptionPosition globalSubscriptionPosition = subscriptionModel.globalSubscriptionPosition();
if (globalSubscriptionPosition != null) {
subscriptionPosition = storage.save(subscriptionId, globalSubscriptionPosition);
}
}
return subscriptionPosition == null ? StartAt.subscriptionModelDefault() : StartAt.subscriptionPosition(subscriptionPosition);
});
} else {
startAtToUse = startAt;
}
return subscriptionModel.subscribe(subscriptionId, filter, startAtToUse, cloudEvent -> {
action.accept(cloudEvent);
if (config.persistCloudEventPositionPredicate.test(cloudEvent)) {
SubscriptionPosition subscriptionPosition = getSubscriptionPositionOrThrowIAE(cloudEvent);
storage.save(subscriptionId, subscriptionPosition);
}
}
);
}
@Override
public void stop() {
getDelegatedSubscriptionModel().stop();
}
@Override
public void start() {
getDelegatedSubscriptionModel().start();
}
@Override
public boolean isRunning() {
return getDelegatedSubscriptionModel().isRunning();
}
@Override
public boolean isRunning(String subscriptionId) {
return getDelegatedSubscriptionModel().isRunning(subscriptionId);
}
@Override
public boolean isPaused(String subscriptionId) {
return getDelegatedSubscriptionModel().isPaused(subscriptionId);
}
@Override
public Subscription resumeSubscription(String subscriptionId) {
return getDelegatedSubscriptionModel().resumeSubscription(subscriptionId);
}
@Override
public void pauseSubscription(String subscriptionId) {
getDelegatedSubscriptionModel().pauseSubscription(subscriptionId);
}
/**
* Cancel a subscription. This means that it'll no longer receive events as they are persisted to the event store.
* The subscription position that is persisted in the {@link SubscriptionPositionStorage} will also be removed.
*
* @param subscriptionId The subscription id to cancel
*/
@Override
public void cancelSubscription(String subscriptionId) {
subscriptionModel.cancelSubscription(subscriptionId);
storage.delete(subscriptionId);
}
@Override
@PreDestroy
public void shutdown() {
subscriptionModel.shutdown();
}
@Override
public SubscriptionPosition globalSubscriptionPosition() {
return subscriptionModel.globalSubscriptionPosition();
}
@Override
public PositionAwareSubscriptionModel getDelegatedSubscriptionModel() {
return subscriptionModel;
}
} | [
"[email protected]"
] | |
409852c691704b97d56c0f654e5acbfed3a68412 | 9a6ea6087367965359d644665b8d244982d1b8b6 | /src/main/java/X/AnonymousClass24K.java | 194e498516513cb05d0f85dda1a6ede673aceae7 | [] | no_license | technocode/com.wa_2.21.2 | a3dd842758ff54f207f1640531374d3da132b1d2 | 3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9 | refs/heads/master | 2023-02-12T11:20:28.666116 | 2021-01-14T10:22:21 | 2021-01-14T10:22:21 | 329,578,591 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package X;
import java.util.AbstractCollection;
/* renamed from: X.24K reason: invalid class name */
public class AnonymousClass24K extends C30861c4 {
public final /* synthetic */ AnonymousClass05V A00;
public final /* synthetic */ View$OnAttachStateChangeListenerC17260rF A01;
public AnonymousClass24K(View$OnAttachStateChangeListenerC17260rF r1, AnonymousClass05V r2) {
this.A01 = r1;
this.A00 = r2;
}
@Override // X.AbstractC09420cr
public void ALG(AbstractC09350ck r3) {
((AbstractCollection) this.A00.get(this.A01.A00)).remove(r3);
}
}
| [
"[email protected]"
] | |
862d797894e5fab75ed6c249f0a161e20fa974e8 | f040bef97d2ff8515fef797a6e24cc64a086f568 | /src/main/java/com/example/reserve/service/UserServiceImpl.java | 766dc12a989d2ee1cd0e6db9f3a2e872d70d9d8d | [] | no_license | eclipsegst/lodge-search | c51d487b512873b4ecb6167794c0b7f9877725fd | 52678de8fd6201fd92276be9d8f99c2dd73cdca0 | refs/heads/master | 2016-08-07T05:35:59.895632 | 2015-10-13T04:25:38 | 2015-10-13T04:25:38 | 37,948,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,743 | java | package com.example.reserve.service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import com.example.reserve.domain.security.User;
import com.example.reserve.domain.security.UserCreateForm;
import com.example.reserve.repository.UserRepository;
import java.util.Collection;
import java.util.Optional;
@Service
public class UserServiceImpl implements UserService {
private static final Logger LOGGER = LoggerFactory.getLogger(UserServiceImpl.class);
private final UserRepository userRepository;
@Autowired
public UserServiceImpl(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
public Optional<User> getUserById(long id) {
LOGGER.debug("Getting user={}", id);
return Optional.ofNullable(userRepository.findOne(id));
}
@Override
public Optional<User> getUserByEmail(String email) {
LOGGER.debug("Getting user by email={}", email.replaceFirst("@.*", "@***"));
return userRepository.findOneByEmail(email);
}
@Override
public Collection<User> getAllUsers() {
LOGGER.debug("Getting all users");
return userRepository.findAll(new Sort("email"));
}
@Override
public User create(UserCreateForm form) {
User user = new User();
user.setEmail(form.getEmail());
user.setPasswordHash(new BCryptPasswordEncoder().encode(form.getPassword()));
user.setRole(form.getRole());
return userRepository.save(user);
}
}
| [
"[email protected]"
] | |
fc9657c75e8579e8b7b1af02c8950c4df65d7894 | b54abf458c70417ae121acabc77302bc949378f1 | /querydsl-collections/src/test/java/com/querydsl/collections/ECJEvaluatorFactoryTest.java | 35856ee5b0d2680fc3cd7244778a7e5d9e4b4ff0 | [
"Apache-2.0"
] | permissive | kaczynskid/querydsl | e09b0cbf88583936a4f000e3866d24ec5608bfce | ce0a796151640023237999636f5998329a939d36 | refs/heads/master | 2021-01-15T20:58:02.871244 | 2015-12-16T08:47:27 | 2015-12-16T08:47:27 | 46,548,141 | 0 | 0 | null | 2015-11-20T08:03:21 | 2015-11-20T08:03:21 | null | UTF-8 | Java | false | false | 620 | java | package com.querydsl.collections;
import org.junit.Test;
import com.mysema.codegen.ECJEvaluatorFactory;
public class ECJEvaluatorFactoryTest extends AbstractQueryTest {
@Test
public void Evaluator_Factory() {
DefaultEvaluatorFactory evaluatorFactory = new DefaultEvaluatorFactory(
CollQueryTemplates.DEFAULT,
new ECJEvaluatorFactory(getClass().getClassLoader()));
QueryEngine queryEngine = new DefaultQueryEngine(evaluatorFactory);
CollQuery<?> query = new CollQuery<Void>(queryEngine);
query.from(cat, cats).select(cat.name).fetch();
}
}
| [
"[email protected]"
] | |
70f11e7e39aaf086a9c702a4b3fdf3ac7d518682 | d35fb54d57ac3a872709399688963d6621331386 | /src/main/java/com/microservices/currencyconversionservice/resource/CurrencyConversionController.java | ade0bf309a3b056d097baf0a3fed6bfa38bc5757 | [] | no_license | my-currency-demo-organization/currency-conversion-microservice | 2fb0038f2e0d1fa965c2e0f212ae0aa8277ac084 | e2c9bfde73cf10823ad7f516471e75382a85a4dd | refs/heads/master | 2022-09-11T19:25:21.090114 | 2020-06-03T06:59:50 | 2020-06-03T06:59:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package com.microservices.currencyconversionservice.resource;
import java.math.BigDecimal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import com.microservices.currencyconversionservice.util.environment.InstanceInformationService;
@RestController
public class CurrencyConversionController {
private static final Logger LOGGER = LoggerFactory.getLogger(CurrencyConversionController.class);
@Autowired
private InstanceInformationService instanceInformationService;
@Autowired
private CurrencyExchangeServiceProxy proxy;
@GetMapping("/")
public String imHealthy() {
return "{healthy:true}";
}
//http://localhost:8100/currency-conversion/from/USD/to/INR/quantity/10
@GetMapping("/currency-conversion/from/{from}/to/{to}/quantity/{quantity}")
public CurrencyConversionBean convertCurrency(@PathVariable String from, @PathVariable String to,
@PathVariable BigDecimal quantity) {
LOGGER.info("Received Request to convert from {} {} to {}. ", quantity, from, to);
CurrencyConversionBean response = proxy.retrieveExchangeValue(from, to);
BigDecimal convertedValue = quantity.multiply(response.getConversionMultiple());
String conversionEnvironmentInfo = instanceInformationService.retrieveInstanceInfo();
return new CurrencyConversionBean(response.getId(), from, to, response.getConversionMultiple(), quantity,
convertedValue, response.getExchangeEnvironmentInfo(), conversionEnvironmentInfo);
}
} | [
"[email protected]"
] | |
f2cdaa61533f8636e14eb00f3f26acc885512078 | 92615cc07f8b51341641a53fd17ce61e8af0e840 | /src/br/com/copacabana/cb/entities/InvitationState.java | f7fb8bb28f4a8029baeb6a6005d25d6b0d4a1283 | [
"Apache-2.0"
] | permissive | rafaelcoutinho/comendobemdelivery | f4a28cf57b0f9ec4d3661e6d1a8966215759ddd2 | a763fb20280699dfa5c6d6a052d2736a05aa30a3 | refs/heads/master | 2021-01-10T20:59:35.728046 | 2015-08-25T00:13:28 | 2015-08-25T00:13:28 | 41,329,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 119 | java | package br.com.copacabana.cb.entities;
public enum InvitationState {
SENT, CONFIRMED, NEW, VISITED, EXPIRED
}
| [
"[email protected]"
] | |
482e7490d5058f20f935bee565f38251a4cfb3b5 | 0fa3c3aca6564c0e09fb24e9dfc4d4826a6b943e | /cloudalibaba-consumer-nacos-order84/src/main/java/com/atguigu/springcloud/service/PaymentService.java | 6e55369ba9443e9921a619030d9ce3fe1ed8874e | [] | no_license | zqllz/cloud2020 | 2a119b32fcada7ba71ff2c11e2bebb80e2d74939 | 5b858a077c416bf0b46704e38e08566bb8dcf08d | refs/heads/master | 2023-07-05T22:43:39.833038 | 2021-07-18T09:56:46 | 2021-07-18T09:56:46 | 373,224,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.atguigu.springcloud.service;
import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
/**
* @author yuluyang
* @date 2021/7/18 上午11:43
* @since 1.0.0-SNAPSHOT
*/
@FeignClient(value = "nacos-payment-provider", fallback = PaymentFallbackService.class)
public interface PaymentService {
@GetMapping("/paymentSQL/{id}")
public CommonResult<Payment> paymentSQL(@PathVariable("id") Long id);
}
| [
"[email protected]"
] | |
0d7d13e8235f22b9001aa81b34d60342e9234bc6 | 9b6ec14ea81743052e89ba288bfcab87420fc2f3 | /src/main/java/com/avril/project/system/notice/domain/Notice.java | 05183f0b01f8e09c7422ff5adaf83fd9ea4a5ae0 | [
"MIT"
] | permissive | ykyh-arch/Avril-Lavigne | a16f772ad4258cd2c3c4a05a6277719b3f33d1d8 | c1d500011bd022db82f93b3202e11a171dddf412 | refs/heads/master | 2022-12-25T10:19:55.568037 | 2020-09-29T04:35:38 | 2020-09-29T04:35:38 | 295,682,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,389 | java | package com.avril.project.system.notice.domain;
import javax.validation.constraints.*;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.avril.framework.web.domain.BaseEntity;
/**
* 通知公告表 sys_notice
*
* @author ykyh-arch
*/
public class Notice extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 公告ID */
private Long noticeId;
/** 公告标题 */
private String noticeTitle;
/** 公告类型(1通知 2公告) */
private String noticeType;
/** 公告内容 */
private String noticeContent;
/** 公告状态(0正常 1关闭) */
private String status;
public Long getNoticeId()
{
return noticeId;
}
public void setNoticeId(Long noticeId)
{
this.noticeId = noticeId;
}
public void setNoticeTitle(String noticeTitle)
{
this.noticeTitle = noticeTitle;
}
@NotBlank(message = "公告标题不能为空")
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
public String getNoticeTitle()
{
return noticeTitle;
}
public void setNoticeType(String noticeType)
{
this.noticeType = noticeType;
}
public String getNoticeType()
{
return noticeType;
}
public void setNoticeContent(String noticeContent)
{
this.noticeContent = noticeContent;
}
public String getNoticeContent()
{
return noticeContent;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
| [
"[email protected]"
] | |
a2d9b495ed9e3d3fa75e767df775d4842cc404ce | c668a8ee17f2b52296cdfd03bf7ee8ff98e3d37f | /src/main/java/netty/ByteBufTest.java | 44268229c0a9c8fd97b5aea774b730167f59fd1b | [] | no_license | ordercard/IM | c32b9156b0ebb1283f01de24409c5e1fb97c8b96 | 4ac2a69fc3597da72fae31ba661ab5c41b20856e | refs/heads/master | 2022-07-04T08:13:59.413086 | 2019-07-19T18:32:16 | 2019-07-19T18:32:16 | 152,858,708 | 3 | 0 | null | 2020-10-13T10:23:25 | 2018-10-13T10:00:30 | Java | UTF-8 | Java | false | false | 2,645 | java | package netty;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
/**
* @Auther :huiqiang
* @Description :
* @Date: Create in 10:42 2018/10/11 2018
* @Modify:
*/
public class ByteBufTest {
public static void main(String[] args) {
ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer(9, 100);
print("allocate ByteBuf(9, 100)", buffer);
// write 方法改变写指针,写完之后写指针未到 capacity 的时候,buffer 仍然可写
buffer.writeBytes(new byte[]{1, 2, 3, 4});
print("writeBytes(1,2,3,4)", buffer);
// write 方法改变写指针,写完之后写指针未到 capacity 的时候,buffer 仍然可写, 写完 int 类型之后,写指针增加4
buffer.writeInt(12);
print("writeInt(12)", buffer);
// write 方法改变写指针, 写完之后写指针等于 capacity 的时候,buffer 不可写
buffer.writeBytes(new byte[]{5});
print("writeBytes(5)", buffer);
// write 方法改变写指针,写的时候发现 buffer 不可写则开始扩容,扩容之后 capacity 随即改变
buffer.writeBytes(new byte[]{6});
print("writeBytes(6)", buffer);
// get 方法不改变读写指针
System.out.println("getByte(3) return: " + buffer.getByte(3));
System.out.println("getShort(3) return: " + buffer.getShort(3));
System.out.println("getInt(3) return: " + buffer.getInt(3));
print("getByte()", buffer);
// set 方法不改变读写指针
buffer.setByte(buffer.readableBytes() + 1, 0);
print("setByte()", buffer);
// read 方法改变读指针
byte[] dst = new byte[buffer.readableBytes()];
buffer.readBytes(dst);
print("readBytes(" + dst.length + ")", buffer);
}
private static void print(String action, ByteBuf buffer) {
System.out.println("after ===========" + action + "============");
System.out.println("capacity(): " + buffer.capacity());
System.out.println("maxCapacity(): " + buffer.maxCapacity());
System.out.println("readerIndex(): " + buffer.readerIndex());
System.out.println("readableBytes(): " + buffer.readableBytes());
System.out.println("isReadable(): " + buffer.isReadable());
System.out.println("writerIndex(): " + buffer.writerIndex());
System.out.println("writableBytes(): " + buffer.writableBytes());
System.out.println("isWritable(): " + buffer.isWritable());
System.out.println("maxWritableBytes(): " + buffer.maxWritableBytes());
System.out.println();
}
} | [
"[email protected]"
] | |
7fdf25512e630dd13b354a0955353aff51b36eca | ec78679511fbbacf24e640e419abda959ac7d45c | /text2onto/IMPLEMENTATION/src/org/ontoware/text2onto/util/spanishwordnet/SpanishWordNet.java | f5ccf99a3582316c312427f2eef4d27f2d8c5450 | [] | no_license | mangalagb/Machine-Learning | 0242b5dc30a1aa2b50dad43bb09e6ebf40f1972a | b67ee87d86d4982f749e6ef832fa05aeb40ecdce | refs/heads/master | 2020-12-30T11:14:49.524035 | 2015-04-09T18:05:47 | 2015-04-09T18:05:47 | 33,683,855 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 11,438 | java | package org.ontoware.text2onto.util.spanishwordnet;
import net.didion.jwnl.JWNLException;
import net.didion.jwnl.data.IndexWord;
import net.didion.jwnl.data.POS;
import net.didion.jwnl.data.Synset;
import net.didion.jwnl.dictionary.Dictionary;
import org.ontoware.text2onto.util.Settings;
import org.ontoware.text2onto.util.wordnet.WordNet;
import org.ontoware.text2onto.util.wordnet.WordNetException;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseConfig;
import com.sleepycat.je.DatabaseEntry;
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
/**
* @author Sergi
*
*/
public class SpanishWordNet extends WordNet {
Environment m_environment;
EnvironmentConfig m_environmentConfig;
DatabaseConfig m_databaseConfig;
Database m_database;
Database m_databaseNames;
Database m_databaseVerbs;
Database m_databaseAdjectives;
Database m_databaseAdverbs;
String[] m_arrayString;
public SpanishWordNet() {
super();
}
public static SpanishWordNet getWordNet(){
if( m_wordnet == null ){
m_wordnet = new SpanishWordNet();
m_wordnet.init();
}
return (SpanishWordNet) m_wordnet;
}
public void init() {
try {
//System.out.print( "");
super.init();
//reader_CompletWN_to_senses();
m_environmentConfig = new EnvironmentConfig();
m_environmentConfig.setAllowCreate( true );
m_environment = new Environment( new File ( Settings.get( Settings.SPANISH_WORD_NET_DIR ) ), m_environmentConfig );
m_databaseConfig = new DatabaseConfig();
m_databaseConfig.setAllowCreate( true );
List lDatabaseNames = m_environment.getDatabaseNames();
if ( lDatabaseNames.size() == 0 ) {
m_database = m_environment.openDatabase( null,"dataBase",m_databaseConfig );
m_databaseNames = m_environment.openDatabase( null,"dataBaseNames",m_databaseConfig );
m_databaseVerbs = m_environment.openDatabase( null,"databaseVerbs",m_databaseConfig );
m_databaseAdjectives = m_environment.openDatabase( null,"databaseAdjectives",m_databaseConfig );
loadDataBases();
}
else {
m_database = m_environment.openDatabase( null,"dataBase",m_databaseConfig );
m_databaseNames = m_environment.openDatabase( null,"dataBaseNames",m_databaseConfig );
m_databaseVerbs = m_environment.openDatabase( null,"databaseVerbs",m_databaseConfig );
m_databaseAdjectives = m_environment.openDatabase( null,"databaseAdjectives",m_databaseConfig );
}
} catch ( Exception e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void loadDataBases() throws IOException, DatabaseException {
readSpanishWordNetFile();
readMappingVersionFile( "wn16-20.noun", m_databaseNames );
readMappingVersionFile( "wn16-20.verb", m_databaseVerbs );
readMappingVersionFile( "wn16-20.adj", m_databaseAdjectives );
}
public void close() throws DatabaseException {
if ( m_database != null ) {
m_database.close();
}
if ( m_databaseNames != null ) {
m_databaseNames.close();
}
if ( m_databaseVerbs != null ) {
m_databaseVerbs.close();
}
if ( m_databaseAdjectives != null ) {
m_databaseAdjectives.close();
}
if ( m_databaseAdverbs != null ) {
m_databaseAdverbs.close();
}
if ( m_environment != null ) {
m_environment.cleanLog();
m_environment.close();
}
}
private void addEntry( Database dbTarget, String sKey, String sData ) throws UnsupportedEncodingException, DatabaseException {
DatabaseEntry dbentryKey = new DatabaseEntry( sKey.getBytes("UTF-8") );
DatabaseEntry dbentryData = new DatabaseEntry( sData.getBytes("UTF-8") );
OperationStatus osStatus = dbTarget.put( null, dbentryKey, dbentryData );
OperationStatus osStatus2 = dbTarget.get(null, dbentryKey, dbentryData, LockMode.DEFAULT);
}
private String[] getEntry( Database dbTarget, String sWord ) throws DatabaseException, UnsupportedEncodingException {
DatabaseEntry dbentryKey = new DatabaseEntry( sWord.getBytes("UTF-8") );
DatabaseEntry dbentryData = new DatabaseEntry();
OperationStatus oStatus = dbTarget.get( null, dbentryKey, dbentryData, LockMode.DEFAULT );
if (dbTarget.get( null, dbentryKey, dbentryData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
byte[] byteArray = dbentryData.getData();
String sSynsets = new String(byteArray);
return sSynsets.split( " " );
}
else return null;
}
private void readSpanishWordNetFile () throws IOException, DatabaseException {
File fileWordNetSenses = new File( Settings.get( Settings.SPANISH_WORD_NET_DIR ) + "senses.src" );
FileReader fileReader = new FileReader( fileWordNetSenses );
int iCharachter;
StringBuffer sb = new StringBuffer();
while( ( iCharachter = fileReader.read() ) != -1 ) {
sb.append( (char)iCharachter );
}
fileReader.close();
m_arrayString = sb.toString().split( "\n" );
for (int i = 0; i<m_arrayString.length; i++) {
addEntry( m_database, getWordSpanishWordNetFile(i), getSynsetsSpanishWordNetFile(i) );
}
}
private void readMappingVersionFile( String sFile, Database dbTarget ) throws IOException, DatabaseException {
File fileWordNetMaps = new File( Settings.get( Settings.SPANISH_WORD_NET_DIR ) + sFile );
FileReader fileReader = new FileReader( fileWordNetMaps );
int iCharachter;
StringBuffer sb = new StringBuffer();
while( ( iCharachter = fileReader.read() ) != -1 ) {
sb.append( (char)iCharachter );
}
fileReader.close();
m_arrayString = sb.toString().split( "\n" ); //07605416
for ( int i=0; i<m_arrayString.length; i++ ){
addEntry( dbTarget, getSynsetVersion16(i), getSynsetVersion20(i) );
}
}
private String getWordSpanishWordNetFile(int iNumLine) {
String[] arraystringLine = m_arrayString[iNumLine].split( ":" );
return arraystringLine[0];
}
private String getSynsetsSpanishWordNetFile(int iNumLine) {
String[] arraystringLine = m_arrayString[iNumLine].split( ":" );
return arraystringLine[1];
}
private String getSynsetVersion16(int iNumLine) {
String[] arraystringLine = m_arrayString[iNumLine].split( " " );
return arraystringLine[0];
}
private String getSynsetVersion20(int iNumLine) {
String[] arraystringLine = m_arrayString[iNumLine].split( " " );
String sSynsetID = null;
float fProbability = 0;
if ( arraystringLine.length > 3 ) {
for (int i = 2; i < arraystringLine.length; i = i+2 ) {
if ( fProbability < Float.parseFloat( arraystringLine[i] ) ) {
fProbability = Float.parseFloat( arraystringLine[i] );
sSynsetID = arraystringLine[i-1];
}
}
}
else {
sSynsetID = arraystringLine[1];
}
return sSynsetID;
}
public Synset[] getSynsets( String sWord ) throws JWNLException, WordNetException {
String[] arraystringPOSandOffsets = null;
String[] arraystring;
long lOffset;
Synset synset = null;
Synset[] arraySynsets = null;
Database dbTarget;
try {
arraystringPOSandOffsets = getEntry( m_database, sWord );
if ( arraystringPOSandOffsets == null ) {
arraySynsets = new Synset[0];
return arraySynsets;
}
arraySynsets = new Synset[arraystringPOSandOffsets.length-1];
for ( int iCounter = 1; iCounter < arraystringPOSandOffsets.length; iCounter++ ) {
if ( arraystringPOSandOffsets[0].compareTo( "n" ) == 0 ) {
arraystring = getEntry( m_databaseNames, arraystringPOSandOffsets[iCounter] );
if ( arraystring == null ) {
Synset[] arraySynsetsAux = new Synset[iCounter-1];
for ( int i = 0; i< iCounter-1; i++ ) {
arraySynsetsAux[i] = arraySynsets [i];
}
return arraySynsetsAux;
}
else {
lOffset = Integer.parseInt( arraystring[0] );
synset = Dictionary.getInstance().getSynsetAt( POS.NOUN, Integer.parseInt( arraystring[0] ));
}
}
else if ( arraystringPOSandOffsets[0].compareTo( "v" ) == 0 ) {
arraystring = getEntry( m_databaseVerbs, arraystringPOSandOffsets[iCounter] );
if ( arraystring == null ) {
Synset[] arraySynsetsAux = new Synset[iCounter-1];
for ( int i = 0; i< iCounter-1; i++ ) {
arraySynsetsAux[i] = arraySynsets [i];
}
return arraySynsetsAux;
}
else {
lOffset = Long.parseLong( arraystring[0] );
synset = Dictionary.getInstance().getSynsetAt( POS.VERB, lOffset );
}
}
else if ( arraystringPOSandOffsets[0].compareTo( "a" ) == 0 ) {
arraystring = getEntry( m_databaseAdjectives, arraystringPOSandOffsets[iCounter] );
if ( arraystring == null ) {
Synset[] arraySynsetsAux = new Synset[iCounter-1];
for ( int i = 0; i< iCounter-1; i++ ) {
arraySynsetsAux[i] = arraySynsets [i];
}
return arraySynsetsAux;
}
else {
lOffset = Long.parseLong( arraystring[0] );
synset = Dictionary.getInstance().getSynsetAt( POS.ADJECTIVE, lOffset );
}
}
arraySynsets[iCounter-1] = synset;
}
} catch ( Exception e ) {
throw new WordNetException( e );
}
return arraySynsets;
}
public void reader_CompletWN_to_senses() throws Exception {
File fileWordNetSenses = new File( Settings.get( Settings.SPANISH_WORD_NET_DIR ) + "esWN-200509-variant" );
FileReader fileReader = new FileReader( fileWordNetSenses );
HashMap<String,ArrayList> hmSenses = new HashMap ();
int iCharachter;
StringBuffer sb = new StringBuffer();
while( ( iCharachter = fileReader.read() ) != -1 ) {
if ( iCharachter == '|' ) {
iCharachter = ':';
}
sb.append( (char)iCharachter );
}
fileReader.close();
m_arrayString = sb.toString().split( "\n" );
for (int iIndex = 0; iIndex < m_arrayString.length; iIndex++) {
String[] arraystringLine = m_arrayString[iIndex].split( ":");
String sWord = arraystringLine[2];
String sPOS = arraystringLine[0];
String sSynsetNum = arraystringLine[1];
if ( hmSenses.containsKey( sWord ) ){
hmSenses.get( sWord ).add( sSynsetNum );
}
else {
ArrayList alPosSynset = new ArrayList();
alPosSynset.add( sPOS );
alPosSynset.add( sSynsetNum );
hmSenses.put( sWord, alPosSynset );
}
}
File fileSenses = new File ( Settings.get( Settings.SPANISH_WORD_NET_DIR ) + "senses2.src" );
FileWriter fileWriter = new FileWriter( fileSenses );
Iterator iteratorSenses = hmSenses.keySet().iterator();
while ( iteratorSenses.hasNext() ) {
String sActualKey = (String)iteratorSenses.next();
ArrayList alPosSynsets = hmSenses.get( sActualKey );
String sLine = sActualKey + ":" + alPosSynsets.get(0);
for ( int iIndex = 1; iIndex < alPosSynsets.size(); iIndex++ ) {
String synset = (String) alPosSynsets.get( iIndex );
sLine = sLine + " " + synset;
}
sLine = sLine + "\n";
fileWriter.write( sLine );
}
fileWriter.close();
}
} | [
"[email protected]"
] | |
c808cf01d0728d20327e596c52230a50f9aec839 | e1d7147a0f163c4002cf4695d0c6bd567812c3ba | /src/java8/lambdaExpression/lambdaExpressionIntroduction/UsingInterfaces.java | ba4ad577b91cc0c387ebbf6336bd72130d9f59f6 | [] | no_license | AMALTS9645/Java-Programming-Learning | 67e48552fc1a553a14843981ba59288fe7ef57d5 | c03fc5423c137c89a1d0d864a8ce6049d59292f2 | refs/heads/master | 2023-06-02T07:49:01.370561 | 2021-06-23T13:19:45 | 2021-06-23T13:19:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package java8.lambdaExpression.lambdaExpressionIntroduction;
@FunctionalInterface
interface printer {
void print();
}
class LaserJetPrinter implements printer {
@Override
public void print() {
System.out.println("LaserJet Printer");
System.out.println("Started Printing");
System.out.println("Printing........");
System.out.println("Printing Completed");
}
}
class SuperFastPrinter implements printer {
@Override
public void print() {
System.out.println("Super Fast Printer");
System.out.println("Started Printing....Printing....Printing Complete");
}
}
public class UsingInterfaces {
public static void main(String[] args) {
LaserJetPrinter laserJetPrinter = new LaserJetPrinter();
laserJetPrinter.print();
System.out.println();
SuperFastPrinter superFastPrinter = new SuperFastPrinter();
superFastPrinter.print();
}
}
| [
"[email protected]"
] | |
af9ba42210125bd001418c4e2887eca009afae36 | 02e574ac869a5b746c8ee18e84f631174d712dfe | /src/main/java/ua/ukrpost/dto/PhoneDto.java | 312c58f2a11dfa3c0215b1bf2c51c909018a1a58 | [] | no_license | loveforjava/TestSpring | 6d5616d577ca16f94a2fc4e7e04b9dd7d7b6a181 | 02b29c3b98113a5e7dcffc5e797e5a16fa81486e | refs/heads/dev | 2020-05-24T07:31:44.654423 | 2017-04-26T11:25:14 | 2017-04-26T11:25:14 | 84,835,336 | 0 | 1 | null | 2017-04-26T11:25:15 | 2017-03-13T14:22:06 | Java | UTF-8 | Java | false | false | 199 | java | package ua.ukrpost.dto;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
public class PhoneDto {
private long id;
private String phoneNumber;
}
| [
"[email protected]"
] | |
fced571f8972e5460d9349ebe7e5383910a86be6 | bf5422d89c3d517fb234fe2421fe4bbc2ef698a0 | /Day 13/Task 1 (ArrayList)/alist/Test.java | 196e40312966eaaf0887c3e8060ed58927dcbe31 | [] | no_license | aman1108/Core-Java | 0e3da9d2dadded63252a6ab3280c7375aa944633 | e945dbdc91782374b31df5eef04310fa18970bcb | refs/heads/master | 2023-02-06T23:15:11.487996 | 2021-01-03T06:11:05 | 2021-01-03T06:11:05 | 295,395,870 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package alist;
import java.util.*;
public class Test {
public static void main(String args[])
{
List list = new ArrayList();
list.add(5);
list.add(9);
int a = (int)list.get(1);
System.out.println(a);
Iterator itr = list.iterator();
while(itr.hasNext())
{
int x = (int)itr.next();
System.out.println(x);
}
}
}
| [
"[email protected]"
] | |
5930d870dbc42ae6356bf66ef94c6b2836ac16cf | 29b906792e798eda3de806008e61c287b76d95f9 | /photo/src/main/java/com/wiser/photo/weight/PhotoSelectFolderFrameLayout.java | ec292ba6f6aaa532c6ede42ef390846573aa92b5 | [] | no_license | Wiser-Wong/ImagePicker | c6a3e0fac8b7c758673cb18a009fe1be79cf00fc | 9c7a7397da8fb8980adf88913892867a5ab7b050 | refs/heads/master | 2020-08-17T14:55:36.613498 | 2020-06-03T11:00:37 | 2020-06-03T11:00:37 | 215,680,700 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,858 | java | package com.wiser.photo.weight;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import com.wiser.photo.R;
import com.wiser.photo.select.FolderAdapter;
import com.wiser.photo.model.PhotoFolderModel;
import com.wiser.photo.select.PhotoSelectFolderFragment;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
/**
* **************************************
* 项目名称:ImagePicker
*
* @author wangxy
* 邮箱:[email protected]
* 创建时间: 2020/5/29 1:33 PM
* 用途:
* **************************************
*/
public class PhotoSelectFolderFrameLayout extends FrameLayout {
private boolean isRunningAnim;
private boolean isOpen;
private View coverView;
private RecyclerView rlvFolder;
private AnimatorSet animatorSet;
private FolderAdapter folderAdapter;
public PhotoSelectFolderFrameLayout(@NonNull Context context) {
super(context);
init();
}
public PhotoSelectFolderFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init();
}
public PhotoSelectFolderFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init(){
LayoutInflater.from(getContext()).inflate(R.layout.photo_select_folder_layout,this,true);
coverView = findViewById(R.id.cover_view);
rlvFolder = findViewById(R.id.rlv_folder);
rlvFolder.setLayoutManager(new LinearLayoutManager(getContext()));
rlvFolder.setAdapter(folderAdapter = new FolderAdapter(getContext()));
animatorSet = new AnimatorSet();
animatorSet.addListener(new FolderAnimListener(this));
coverView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
handleAnim();
}
});
setVisibility(INVISIBLE);
}
public void setData(ArrayList<PhotoFolderModel> folderModels){
if (folderAdapter != null) folderAdapter.setItems(folderModels);
}
public void setOnFolderClickListener(PhotoSelectFolderFragment.OnFolderClickListener onFolderClickListener){
if (folderAdapter != null) folderAdapter.setOnFolderClickListener(onFolderClickListener);
}
//执行动画
public void handleAnim(){
if (isRunningAnim) return;
ObjectAnimator animator1;
ObjectAnimator animator2;
if (!isOpen){
isOpen = true;
animator1 = ObjectAnimator.ofFloat(rlvFolder, "translationY", -getMeasuredHeight(), 0);
animator2 = ObjectAnimator.ofFloat(coverView, "alpha", 0,1);
}else {
isOpen = false;
animator1 = ObjectAnimator.ofFloat(rlvFolder, "translationY", 0, -getMeasuredHeight());
animator2 = ObjectAnimator.ofFloat(coverView, "alpha", 1,0);
}
animatorSet.setInterpolator(new DecelerateInterpolator());
animatorSet.setDuration(400);
animatorSet.playTogether(animator1,animator2);
animatorSet.start();
}
private static class FolderAnimListener extends AnimatorListenerAdapter {
private WeakReference<PhotoSelectFolderFrameLayout> reference;
public FolderAnimListener(PhotoSelectFolderFrameLayout folderFrameLayout){
reference = new WeakReference<>(folderFrameLayout);
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (reference != null && reference.get() != null) {
reference.get().isRunningAnim = false;
if (!reference.get().isOpen) {
reference.get().setVisibility(INVISIBLE);
reference.get().rlvFolder.setVisibility(INVISIBLE);
reference.get().coverView.setVisibility(INVISIBLE);
}
}
}
@Override
public void onAnimationCancel(Animator animation) {
super.onAnimationCancel(animation);
if (reference != null && reference.get() != null) {
reference.get().isRunningAnim = false;
if (!reference.get().isOpen) {
reference.get().setVisibility(INVISIBLE);
reference.get().rlvFolder.setVisibility(INVISIBLE);
reference.get().coverView.setVisibility(INVISIBLE);
}
}
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
if (reference != null && reference.get() != null) {
reference.get().isRunningAnim = true;
reference.get().setVisibility(VISIBLE);
reference.get().rlvFolder.setVisibility(VISIBLE);
reference.get().coverView.setVisibility(VISIBLE);
}
}
}
public boolean isOpen() {
return isOpen;
}
public boolean isRunningAnim() {
return isRunningAnim;
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
coverView = null;
rlvFolder = null;
animatorSet = null;
folderAdapter = null;
}
}
| [
"[email protected]"
] | |
032cfd674fd6262bf232681c4c470624c0d77c63 | b7bd66025a4f39e47e733b32870fbf41f245b216 | /PersistenceContentProviderSample2/app/src/test/java/com/example/android/contentprovidersample/ExampleUnitTest.java | e650caf54f5043722afd33d2cc87adba65cd8443 | [] | no_license | Infinite-eyes/test-android-architecture-components | ea24278364f3b0dcb8e2f2fc01ea13d5a107caf3 | 30d95269b22ab68665c6c37bef7345cba31cd48b | refs/heads/master | 2020-04-01T20:44:25.219376 | 2019-03-07T10:12:41 | 2019-03-07T10:15:43 | 153,618,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.example.android.contentprovidersample;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
98be87f30a88215c94271913eb02b63916abbb37 | 86e59cb0fa80ccf2731f93ed988e0fb3283339d0 | /semester1/java/Lab/lab04-MonsterGUI-initialize/lab04-MonsterGUI/src/sample/Main.java | 04710e67a83886c6788561e2b39147ef85cdd373 | [] | no_license | sernja/KU-sophomore | ef7028936e1a78678f9884a37a2a110b8cd87a02 | cc1f3d87982966ea92ffc873d92e2824c4d48e6b | refs/heads/master | 2020-07-13T18:07:14.397887 | 2020-04-09T17:58:31 | 2020-04-09T17:58:31 | 205,128,432 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | java | package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Monster");
primaryStage.setScene(new Scene(root, 600, 400));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
| [
"[email protected]"
] | |
c605df8c6be1b64034e91aead7414c4e6ff0ccaf | 1da5cf100fbe2a59f329fc3b7b08d176147df514 | /Lavor2-Web/src/java/lavor/managedBean/ClienteMB.java | 709cd792edd3c72095ecc674d932fea5224f793e | [] | no_license | marcelogomesrp/slpa | c3e822fb5b0bf080c02be62990987bc620078d13 | a2c275da89788d1c5e674665ec6177e84fb05eb5 | refs/heads/master | 2021-01-19T11:16:39.944793 | 2010-11-17T00:27:56 | 2010-11-17T00:27:56 | 32,399,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,044 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package lavor.managedBean;
import java.io.Serializable;
import javax.annotation.Resource;
import javax.faces.model.ListDataModel;
import lavor.entidade.Cliente;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
/**
*
* @author marcelo
*/
@Controller("clienteMB")
@Scope("session")
public class ClienteMB implements Serializable{
private Cliente cliente;
private ListDataModel clientes;
@Resource
private CidadeMB cidadeMB;
public ClienteMB() {
this.cliente = new Cliente();
this.clientes = new ListDataModel();
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public ListDataModel getClientes() {
return clientes;
}
public void setClientes(ListDataModel clientes) {
this.clientes = clientes;
}
}
| [
"marcelogomesrp@f26ce29a-f2e1-11de-82c3-25da7dca7fdf"
] | marcelogomesrp@f26ce29a-f2e1-11de-82c3-25da7dca7fdf |
543a1b10108d67175a312f4c747505bf6459cc5f | 7304084cf4a80339b055b29a01608611aba93f5c | /Integration of Towing Abandoned Vehicles with Number Plate Recognition System/VehicleTowingServer/src/com/java/towing/db/PoliceStationDBWrapper.java | eea22ec226c1d49e9a9f19baf90bf4de95a87829 | [] | no_license | shwetabangad/Shweta | 9f7d952e1581c7eba98c8bfd26e5583a58dbd65b | da72a59096cfec3870787671741c9cb15ddfedde | refs/heads/master | 2021-07-23T18:08:15.305569 | 2017-11-02T01:25:31 | 2017-11-02T01:25:31 | 109,200,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,112 | java | package com.java.towing.db;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import com.java.towing.bean.IncidenteBean;
import com.java.towing.bean.PoliceStationBean;
import com.java.towing.bean.TowingAgentBean;
public class PoliceStationDBWrapper {
Connection connection = null;
PreparedStatement preparestatement = null;
ResultSet rs = null;
public void closeConnection() {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
// INSERT
public int insertPoliceStation(PoliceStationBean policeStationBean) {
DBConnection dBConnection = new DBConnection();
connection = dBConnection.connect();
String query = "insert into police_station_table(police_station_id,police_station_name, police_station_address, police_station_lat, police_station_long) values('"
+ policeStationBean.getPoliceStationId()
+ "','"
+ policeStationBean.getPoliceStationName()
+ "','"
+ policeStationBean.getPoliceStationAddress()
+ "','"
+ policeStationBean.getPoliceStationLat()
+ "','"
+ policeStationBean.getPoliceStationLong()
+ "')";
try {
Statement statement = connection.createStatement();
statement.executeUpdate(query);
return 1;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
// VIEW
public ResultSet fetchAllPoliceStation() {
DBConnection dBConnection = new DBConnection();
connection = dBConnection.connect();
String query = "select * from police_station_table";
ResultSet resultSet = null;
try {
Statement statement = connection.createStatement();
resultSet = statement.executeQuery(query);
} catch (Exception e) {
System.out.println(e);
}
return resultSet;
}
public ArrayList<PoliceStationBean> fetchAllPoliceStationInfo() {
ResultSet resultSet = fetchAllPoliceStation();
ArrayList<PoliceStationBean> policeStationbeanList = new ArrayList<PoliceStationBean>();
if (resultSet != null) {
try {
resultSet.beforeFirst();
while (resultSet.next()) {
policeStationbeanList.add(fetchPoliceStationFromResultSet(resultSet));
}
resultSet.close();
} catch (Exception e) {
System.out.println(e);
}
}
return policeStationbeanList;
}
private PoliceStationBean fetchPoliceStationFromResultSet(
ResultSet resultSet) {
PoliceStationBean policeStationBean = new PoliceStationBean();
try {
policeStationBean.setPoliceStationId(resultSet
.getInt("police_station_id"));
policeStationBean.setPoliceStationName(resultSet
.getString("police_station_name"));
policeStationBean.setPoliceStationAddress(resultSet
.getString("police_station_address"));
policeStationBean.setPoliceStationLat(resultSet
.getDouble("police_station_lat"));
policeStationBean.setPoliceStationLong(resultSet
.getDouble("police_station_long"));
} catch (Exception e) {
System.out.println(e);
}
return policeStationBean;
}
public PoliceStationBean FetchPoliceStationById(
int policeStationId) {
DBConnection dBConnection = new DBConnection();
connection = dBConnection.connect();
try {
preparestatement = connection.prepareStatement("Select * from police_station_table where police_station_id=?");
preparestatement.setInt(1, policeStationId);
ResultSet resultSet = preparestatement.executeQuery();
resultSet.beforeFirst();
if(resultSet.next()) {
System.out.println("1");
return fetchPoliceStationFromResultSet(resultSet);
}
return null;
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
public int deletePoliceStation(String policeStationId) {
DBConnection dBConnection = new DBConnection();
connection = dBConnection.connect();
String query = "DELETE from police_station_table where police_station_id = '"
+ policeStationId + "'";
try {
Statement statement = connection.createStatement();
return statement.executeUpdate(query);
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
}
| [
"[email protected]"
] | |
ea9740e4a277c5b133cc7d0a384d0960b5fa3970 | b74f2c19ea8e730b93e3da8842fc0ca3db9639dd | /aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/ListConfigurationSetsResult.java | 758ef6575098a29688b8a0dece8b22f5ffd10221 | [
"Apache-2.0"
] | permissive | mgivney/aws-sdk-java | 2de4a597beeda68735ba5bb822f45e924de29d14 | 005db50a80c825dc305306a0633cac057b95b054 | refs/heads/master | 2021-05-02T04:51:13.281576 | 2016-12-16T01:48:44 | 2016-12-16T01:48:44 | 76,672,974 | 1 | 0 | null | 2016-12-16T17:36:09 | 2016-12-16T17:36:09 | null | UTF-8 | Java | false | false | 7,694 | java | /*
* Copyright 2011-2016 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.amazonaws.services.simpleemail.model;
import java.io.Serializable;
/**
* <p>
* A list of configuration sets associated with your AWS account. Configuration sets enable you to publish email sending
* events. For information about using configuration sets, see the <a
* href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html">Amazon SES Developer
* Guide</a>.
* </p>
*/
public class ListConfigurationSetsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* A list of configuration sets.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<ConfigurationSet> configurationSets;
/**
* <p>
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
* </p>
*/
private String nextToken;
/**
* <p>
* A list of configuration sets.
* </p>
*
* @return A list of configuration sets.
*/
public java.util.List<ConfigurationSet> getConfigurationSets() {
if (configurationSets == null) {
configurationSets = new com.amazonaws.internal.SdkInternalList<ConfigurationSet>();
}
return configurationSets;
}
/**
* <p>
* A list of configuration sets.
* </p>
*
* @param configurationSets
* A list of configuration sets.
*/
public void setConfigurationSets(java.util.Collection<ConfigurationSet> configurationSets) {
if (configurationSets == null) {
this.configurationSets = null;
return;
}
this.configurationSets = new com.amazonaws.internal.SdkInternalList<ConfigurationSet>(configurationSets);
}
/**
* <p>
* A list of configuration sets.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setConfigurationSets(java.util.Collection)} or {@link #withConfigurationSets(java.util.Collection)} if
* you want to override the existing values.
* </p>
*
* @param configurationSets
* A list of configuration sets.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListConfigurationSetsResult withConfigurationSets(ConfigurationSet... configurationSets) {
if (this.configurationSets == null) {
setConfigurationSets(new com.amazonaws.internal.SdkInternalList<ConfigurationSet>(configurationSets.length));
}
for (ConfigurationSet ele : configurationSets) {
this.configurationSets.add(ele);
}
return this;
}
/**
* <p>
* A list of configuration sets.
* </p>
*
* @param configurationSets
* A list of configuration sets.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListConfigurationSetsResult withConfigurationSets(java.util.Collection<ConfigurationSet> configurationSets) {
setConfigurationSets(configurationSets);
return this;
}
/**
* <p>
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
* </p>
*
* @param nextToken
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
* </p>
*
* @return A token indicating that there are additional configuration sets available to be listed. Pass this token
* to successive calls of <code>ListConfigurationSets</code>.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
* </p>
*
* @param nextToken
* A token indicating that there are additional configuration sets available to be listed. Pass this token to
* successive calls of <code>ListConfigurationSets</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListConfigurationSetsResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getConfigurationSets() != null)
sb.append("ConfigurationSets: " + getConfigurationSets() + ",");
if (getNextToken() != null)
sb.append("NextToken: " + getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListConfigurationSetsResult == false)
return false;
ListConfigurationSetsResult other = (ListConfigurationSetsResult) obj;
if (other.getConfigurationSets() == null ^ this.getConfigurationSets() == null)
return false;
if (other.getConfigurationSets() != null && other.getConfigurationSets().equals(this.getConfigurationSets()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConfigurationSets() == null) ? 0 : getConfigurationSets().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListConfigurationSetsResult clone() {
try {
return (ListConfigurationSetsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
a27826f63f0e212550563bd904d914f71405fcec | 876f9fdb7fc52c049e718402a6834ae296e0fd4e | /src/main/java/eu/hermeneut/service/CriticalLevelService.java | 276a583f84582fdd2f8bf60e5e69ff9d696a0f94 | [
"Apache-2.0"
] | permissive | rating-eu/rating_v1 | aad723983abe2172612fd14de94af9d46cfdc7cc | 8935223a206efd91fbe84af8fcee70a852eccd89 | refs/heads/hermeneut_master | 2022-12-12T22:50:19.768888 | 2019-07-25T12:34:48 | 2019-07-25T12:34:48 | 198,704,595 | 1 | 0 | Apache-2.0 | 2022-12-09T00:01:21 | 2019-07-24T20:21:25 | TypeScript | UTF-8 | Java | false | false | 1,872 | java | /*
* Copyright 2019 HERMENEUT Consortium
*
* 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 eu.hermeneut.service;
import eu.hermeneut.domain.CriticalLevel;
import java.util.List;
/**
* Service Interface for managing CriticalLevel.
*/
public interface CriticalLevelService {
/**
* Save a criticalLevel.
*
* @param criticalLevel the entity to save
* @return the persisted entity
*/
CriticalLevel save(CriticalLevel criticalLevel);
/**
* Get all the criticalLevels.
*
* @return the list of entities
*/
List<CriticalLevel> findAll();
/**
* Get the "id" criticalLevel.
*
* @param id the id of the entity
* @return the entity
*/
CriticalLevel findOne(Long id);
/**
* Delete the "id" criticalLevel.
*
* @param id the id of the entity
*/
void delete(Long id);
/**
* Search for the criticalLevel corresponding to the query.
*
* @param query the query of the search
*
* @return the list of entities
*/
List<CriticalLevel> search(String query);
/**
* Get the "selfAssessmentID" criticalLevel.
*
* @param selfAssessmentID the id of the linked SelfAssessment
* @return the entity
*/
CriticalLevel findOneBySelfAssessment(Long selfAssessmentID);
}
| [
"[email protected]"
] | |
b5466608ea68605c081d4c8feb5461b1e1e1596c | 87f1d5a7a596ab73ef9be349afe60d1d919453e8 | /src/main/java/com/bernardoms/campsitescheduleapi/repository/BookingRepository.java | 39ed02c141a332e3f4802af5c35cecc29dc99df3 | [] | no_license | allanbradl/campsite-schedule-api | a88ceeaf455efd1ad92517839a1ba726a38208f6 | c4a34703b83a5a030bb9f41e35b2c90939c06c93 | refs/heads/master | 2023-02-09T09:54:21.278259 | 2021-01-07T01:44:50 | 2021-01-07T01:44:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package com.bernardoms.campsitescheduleapi.repository;
import com.bernardoms.campsitescheduleapi.model.Booking;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.QueryHints;
import javax.persistence.LockModeType;
import javax.persistence.QueryHint;
import java.time.LocalDate;
import java.util.List;
public interface BookingRepository extends JpaRepository<Booking, Long> {
@Lock(LockModeType.PESSIMISTIC_READ)
@QueryHints({@QueryHint(name = "javax.persistence.lock.timeout", value ="5000")})
@Query("select b from Booking b "
+ "where ((b.startDate < ?1 and ?2 < b.endDate) "
+ "or (?1 < b.endDate and b.endDate <= ?2) "
+ "or (?1 <= b.startDate and b.startDate <=?2)) "
+ "and b.status = 'ACTIVE' "
+ "order by b.startDate asc")
List<Booking> findAllBookingsByDataRange(LocalDate arrivalDate, LocalDate departureDate);
}
| [
"[email protected]"
] | |
91f0e88b966c7d70f761dbd5141d39d24d9530c6 | e28e5a459d14a5fd95f5eb9152c74e4d0dad0e9d | /app/src/main/java/pabs/trackstarter/SoundEditor.java | b437d54cf4580a05a8473ab2658bf7e21458ed20 | [] | no_license | blonsky95/SprintStart | e96fd82e46c06dd0ce6e349fcb5bcb16421343ed | fee5d656f6812d28e2f19adcd5fa801f992fb773 | refs/heads/master | 2023-08-05T10:46:26.034469 | 2023-07-25T20:40:16 | 2023-07-25T20:40:16 | 149,116,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,226 | java | package pabs.trackstarter;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
public class SoundEditor extends AppCompatActivity {
public SoundEditor() {
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sound_editor);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
myToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
String sound1name = prefs.getString("sound1", "1");
String sound2name = prefs.getString("sound2", "2");
String sound3name = prefs.getString("sound3", "3");
TextView sound1TV = findViewById(R.id.sound1tv);
String file1Name=prefToName(sound1name);
sound1TV.setText(file1Name);
TextView sound2TV = findViewById(R.id.sound2tv);
String file2Name=prefToName(sound2name);
sound2TV.setText(file2Name);
TextView sound3TV = findViewById(R.id.sound3tv);
String file3Name=prefToName(sound3name);
sound3TV.setText(file3Name);
TextView homeBtn=findViewById(R.id.home_btn);
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent homeIntent= new Intent(SoundEditor.this, MainActivity.class);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(homeIntent);
finish();
}
});
TextView sound1btn = findViewById(R.id.sound1_btn);
sound1btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent1 = new Intent(getApplicationContext(), SoundSelector.class);
int sound1ID = 1;
intent1.putExtra("soundIdentifier", sound1ID);
startActivity(intent1);
finish();
}
});
TextView sound2btn = findViewById(R.id.sound2_btn);
sound2btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent2 = new Intent(getApplicationContext(), SoundSelector.class);
int sound2ID = 2;
intent2.putExtra("soundIdentifier", sound2ID);
startActivity(intent2);
finish();
}
});
TextView sound3btn = findViewById(R.id.sound3_btn);
sound3btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(SoundEditor.this);
builder.setMessage(getApplicationContext().getResources().getString(R.string.sound3_change));
builder.setPositiveButton(getApplicationContext().getResources().getString(R.string.delete_yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent3 = new Intent(getApplicationContext(), SoundSelector.class);
int sound3ID = 3;
intent3.putExtra("soundIdentifier", sound3ID);
startActivity(intent3);
finish();
}
});
builder.setNegativeButton(getApplicationContext().getResources().getString(R.string.delete_no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
builder.show();
}
});
TextView soundAdd = findViewById(R.id.sound_add);
soundAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), AudioRecorder.class);
startActivity(intent);
finish();
}
});
}
private String prefToName(String soundName) {
String fileName;
if (soundName.matches("1")) {
fileName = "On your marks";
return fileName;
}
if (soundName.matches("2")) {
fileName = "Set";
return fileName;
}
if (soundName.matches("3")) {
fileName = "GO";
return fileName;
}
else {
fileName=soundName.substring(soundName.indexOf("/real")+6,soundName.length()-4);
}
return fileName;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.secondary_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.info:
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.dialogue_layout);
TextView txt1 = (TextView)dialog.findViewById(R.id.text1);
txt1.setText(getString(R.string.dialogue1));
TextView txt2 = (TextView)dialog.findViewById(R.id.text2);
txt2.setText(getString(R.string.dialogue2));
dialog.show();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
9381cae0a4b9c75fc436daa2917d2d16bffa70f5 | a3bacbbadb764aa943a4c3a88a57eabe38d735df | /src/main/java/hello/GreetingController.java | 2a1631c8a6b1a2488da41eccc147f3cf6f6d36b4 | [] | no_license | izaga/hello-java | 4626f69a5c9d0813881b810a59a2dc86adface8a | 19827c2ac89f8d57bba8c308b0d8759ce868aba1 | refs/heads/master | 2021-05-06T06:17:02.124651 | 2018-01-15T09:12:39 | 2018-01-15T09:16:09 | 113,828,388 | 0 | 1 | null | 2017-12-11T07:45:36 | 2017-12-11T07:45:35 | null | UTF-8 | Java | false | false | 519 | java | package hello;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class GreetingController {
@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name,
Model model) {
model.addAttribute("name", name);
return "greeting";
}
} | [
"[email protected]"
] | |
37a060504f78332c2418ed5f2276f1388e76547a | 4a1a0c1f0e83748c1b80a32804076dfac12db25a | /src/main/java/com/penny/leetcode/zhp/algorithm/model/TreeNode.java | 74a65fc83996bc2cfb403da1e674aca01fbaf2df | [] | no_license | 0-Vector/leetcode-ex | ccd1aac138c6817d939b279c2d654be183909b88 | 254d9cebcfeeb47a148041f22eb555c436c982d9 | refs/heads/master | 2021-07-15T05:41:01.618626 | 2020-10-10T09:26:01 | 2020-10-10T09:26:01 | 216,738,656 | 0 | 0 | null | 2020-10-13T17:41:25 | 2019-10-22T06:25:55 | Java | UTF-8 | Java | false | false | 298 | java | package com.penny.leetcode.zhp.algorithm.model;
/**
* Creator:Administrator
* Time:2019-11-22 13:47
* Project: algorithm
* Description:
*/
public class TreeNode {
public int val;
public TreeNode left;
public TreeNode right;
public TreeNode(int x) { val = x; }
}
| [
"[email protected]"
] | |
01d7d2781ee08502087a0d8643a1ee8036d29fa8 | 68043c5f8ee2c1ef526ecb692d1c5c463f82406a | /Compiler/src/my/mini/java/compiler/Exceptions/MethodDoesNotExist.java | 02b01fb1e7221e996615d63eddecd70e7d0e7078 | [] | no_license | akouthoofd/MiniJava_Compiler | 2ade739406fdf9ae2d7173c332bbf753746bf2ed | feb49832c0e5be9e303c2c24d8099de41f8339f8 | refs/heads/master | 2021-09-25T01:37:56.040167 | 2016-12-15T23:31:04 | 2016-12-15T23:31:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package my.mini.java.compiler.Exceptions;
import org.antlr.v4.runtime.Token;
/**
* Created by alex on 12/2/2016.
*/
public class MethodDoesNotExist extends RuntimeException
{
public MethodDoesNotExist (String errorMessage, Token className, String methodName, Token method, String sourceName)
{
super(errorMessage);
setStackTrace(new StackTraceElement[]{
new StackTraceElement(className.getText(), methodName, sourceName, method.getLine()),
new StackTraceElement(className.getText(), "class", sourceName, className.getLine())
});
}
public MethodDoesNotExist (String errorMessage, Token name, String sourceName)
{
super(errorMessage);
setStackTrace(new StackTraceElement[]{
new StackTraceElement(name.getText(), name.getText(), sourceName, name.getLine())
});
}
}
| [
"[email protected]"
] | |
28d6c3ebc55d36e70702d806b69e20d784dbd632 | a0c750f0ec36a4dbca4d7ab7cd3a476008e6f474 | /src/main/java/com/alibaba/dubbo/rpc/filter/ClassLoaderFilter.java | 249624a5ed15ece2c8e7fec2d249bb6d5b6d66e7 | [] | no_license | Fyypumpkin/dubbo-decompile-source | dc7251f6db19e6f8134ed49360add502a71f698b | 2510460f89dec2d7bc11769507cc37882f9b7ba7 | refs/heads/master | 2020-06-10T10:25:00.460681 | 2019-06-25T04:26:55 | 2019-06-25T04:26:55 | 193,633,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 989 | java | /*
* Decompiled with CFR 0.139.
*/
package com.alibaba.dubbo.rpc.filter;
import com.alibaba.dubbo.common.extension.Activate;
import com.alibaba.dubbo.rpc.Filter;
import com.alibaba.dubbo.rpc.Invocation;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.Result;
import com.alibaba.dubbo.rpc.RpcException;
@Activate(group={"provider"}, order=-30000)
public class ClassLoaderFilter
implements Filter {
/*
* WARNING - Removed try catching itself - possible behaviour change.
*/
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
ClassLoader ocl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(invoker.getInterface().getClassLoader());
try {
Result result = invoker.invoke(invocation);
return result;
}
finally {
Thread.currentThread().setContextClassLoader(ocl);
}
}
}
| [
"[email protected]"
] | |
bee31e48d643d6cbd762240211b75601cd730eb6 | 5bb4a4b0364ec05ffb422d8b2e76374e81c8c979 | /sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/implementation/RouteImpl.java | a09c7314a48f0908a25559e7806fcab10a3a80f2 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | FabianMeiswinkel/azure-sdk-for-java | bd14579af2f7bc63e5c27c319e2653db990056f1 | 41d99a9945a527b6d3cc7e1366e1d9696941dbe3 | refs/heads/main | 2023-08-04T20:38:27.012783 | 2020-07-15T21:56:57 | 2020-07-15T21:56:57 | 251,590,939 | 3 | 1 | MIT | 2023-09-02T00:50:23 | 2020-03-31T12:05:12 | Java | UTF-8 | Java | false | false | 4,629 | java | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.network.v2019_07_01.implementation;
import com.microsoft.azure.management.network.v2019_07_01.Route;
import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
import rx.Observable;
import com.microsoft.azure.management.network.v2019_07_01.RouteNextHopType;
import com.microsoft.azure.management.network.v2019_07_01.ProvisioningState;
class RouteImpl extends CreatableUpdatableImpl<Route, RouteInner, RouteImpl> implements Route, Route.Definition, Route.Update {
private final NetworkManager manager;
private String resourceGroupName;
private String routeTableName;
private String routeName;
RouteImpl(String name, NetworkManager manager) {
super(name, new RouteInner());
this.manager = manager;
// Set resource name
this.routeName = name;
//
}
RouteImpl(RouteInner inner, NetworkManager manager) {
super(inner.name(), inner);
this.manager = manager;
// Set resource name
this.routeName = inner.name();
// set resource ancestor and positional variables
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.routeTableName = IdParsingUtils.getValueFromIdByName(inner.id(), "routeTables");
this.routeName = IdParsingUtils.getValueFromIdByName(inner.id(), "routes");
//
}
@Override
public NetworkManager manager() {
return this.manager;
}
@Override
public Observable<Route> createResourceAsync() {
RoutesInner client = this.manager().inner().routes();
return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner())
.map(innerToFluentMap(this));
}
@Override
public Observable<Route> updateResourceAsync() {
RoutesInner client = this.manager().inner().routes();
return client.createOrUpdateAsync(this.resourceGroupName, this.routeTableName, this.routeName, this.inner())
.map(innerToFluentMap(this));
}
@Override
protected Observable<RouteInner> getInnerAsync() {
RoutesInner client = this.manager().inner().routes();
return client.getAsync(this.resourceGroupName, this.routeTableName, this.routeName);
}
@Override
public boolean isInCreateMode() {
return this.inner().id() == null;
}
@Override
public String addressPrefix() {
return this.inner().addressPrefix();
}
@Override
public String etag() {
return this.inner().etag();
}
@Override
public String id() {
return this.inner().id();
}
@Override
public String name() {
return this.inner().name();
}
@Override
public String nextHopIpAddress() {
return this.inner().nextHopIpAddress();
}
@Override
public RouteNextHopType nextHopType() {
return this.inner().nextHopType();
}
@Override
public ProvisioningState provisioningState() {
return this.inner().provisioningState();
}
@Override
public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) {
this.resourceGroupName = resourceGroupName;
this.routeTableName = routeTableName;
return this;
}
@Override
public RouteImpl withNextHopType(RouteNextHopType nextHopType) {
this.inner().withNextHopType(nextHopType);
return this;
}
@Override
public RouteImpl withAddressPrefix(String addressPrefix) {
this.inner().withAddressPrefix(addressPrefix);
return this;
}
@Override
public RouteImpl withEtag(String etag) {
this.inner().withEtag(etag);
return this;
}
@Override
public RouteImpl withId(String id) {
this.inner().withId(id);
return this;
}
@Override
public RouteImpl withName(String name) {
this.inner().withName(name);
return this;
}
@Override
public RouteImpl withNextHopIpAddress(String nextHopIpAddress) {
this.inner().withNextHopIpAddress(nextHopIpAddress);
return this;
}
@Override
public RouteImpl withProvisioningState(ProvisioningState provisioningState) {
this.inner().withProvisioningState(provisioningState);
return this;
}
}
| [
"[email protected]"
] | |
576f63012b58a8db3ce111900611c253c1ac4d50 | 925592339ddf22fbb7e1dc7d21b65e90e1b6d0e2 | /enhanced-data-cache/src/main/java/com/yoloho/enhanced/data/cache/xml/InitCacheParser.java | 92e5389c6bbe5b3799fdc52aabdb551b4b54f214 | [
"Apache-2.0"
] | permissive | yoloho/enhanced-data | 2b9b036f75db4aa05450a36eed2819c46986bf7c | 2c1dd3b012e549d9709448719cf5737ef54de780 | refs/heads/master | 2021-06-27T11:56:19.830617 | 2020-06-09T10:52:00 | 2020-06-09T10:52:00 | 191,540,230 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,422 | java | package com.yoloho.enhanced.data.cache.xml;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.config.AopConfigUtils;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
public class InitCacheParser extends AbstractSimpleBeanDefinitionParser {
private final static Logger logger = LoggerFactory.getLogger(InitCacheParser.class.getSimpleName());
protected final static String LOG_CONSOLE = "log.console";
protected final static String LOG_FILE = "log.file";
public InitCacheParser() {
}
@Override
protected boolean shouldGenerateId() {
return true;
}
@Override
protected Class<?> getBeanClass(Element element) {
return InitCacheParser.class;
}
/**
* init the bean to be injected
*
* @param registry
*/
protected static void initBeans(String namespace, boolean useAspectJ, String redisRef, BeanDefinitionRegistry registry) {
// cache dealing
if (StringUtils.isEmpty(namespace)) {
throw new RuntimeException("Cache namespace can not be empty.");
}
AopConfigUtils.registerAutoProxyCreatorIfNecessary(registry);
String className = "com.yoloho.enhanced.cache.support.CacheAdvisor";
if (useAspectJ) {
// Using AspectJ
className = "com.yoloho.enhanced.cache.support.CacheSimpleInit";
String aspectAnnoName = "org.aspectj.lang.annotation.Aspect";
try {
Class.forName(aspectAnnoName);
} catch (Exception e) {
logger.error("init cache failed, maybe no aspectweaver.jar found");
}
logger.info("cache will use AspectJ");
} else {
// Work on proxy layer
logger.info("cache will work on proxy layer");
}
try {
Class<?> clz = Class.forName(className);
BeanDefinitionBuilder advisorBuilder = BeanDefinitionBuilder.genericBeanDefinition(clz);
advisorBuilder.addConstructorArgValue(namespace);
if (StringUtils.isNotEmpty(redisRef)) {
advisorBuilder.addConstructorArgReference(redisRef);
}
advisorBuilder.setLazyInit(false);
advisorBuilder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(className, advisorBuilder.getBeanDefinition());
} catch (Exception e) {
logger.warn("init caching failed", e);
}
logger.info("init caching support");
}
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
builder.setLazyInit(false);
String namespace = element.getAttribute("namespace");
String redisRef = element.getAttribute("redis-ref");
boolean useAspectJ = StringUtils.equalsIgnoreCase(element.getAttribute("use-aspectj"), "true");
initBeans(namespace, useAspectJ, redisRef, parserContext.getRegistry());
}
}
| [
"[email protected]"
] | |
614d24da42ee9861aa810fc6dcebab3fbeb8ba99 | 3a5ec88b0ee4af0077b32815bd96b6a64cd8a1ff | /src/main/java/fr/tse/fi2/hpp/labs/queries/impl/projet/Areas.java | 7bb20f3afbcc189b2daa52aa3b6f28e2b3f40078 | [] | no_license | zunzunwang/hpp | 6f2ed7f213e4d2d98aed36dfd2963553cd1e7ce2 | c01f14f5b180a4dcad93ca82a395d3609a930907 | refs/heads/master | 2021-01-24T20:58:30.034512 | 2015-06-14T21:55:43 | 2015-06-14T21:55:43 | 34,258,724 | 0 | 0 | null | 2015-04-20T12:21:51 | 2015-04-20T12:21:51 | null | UTF-8 | Java | false | false | 3,782 | java |
package fr.tse.fi2.hpp.labs.queries.impl.projet;
import java.util.ArrayList;
import fr.tse.fi2.hpp.labs.beans.DebsRecord;
public class Areas {
private int nbTaxisEmpty;
private ArrayList<DebsRecord> record;
private float profitability;
private String unit;
protected ListMedian mediane;
public Areas() {
setNbTaxisEmpty(0);
setRec(new ArrayList<DebsRecord>());
mediane = new ListMedian();
}
// Ajouter un revenu.
public void addIncome(DebsRecord recordTest) {
if(recordTest.getFare_amount() + recordTest.getTip_amount() > 0) {
record.add(recordTest);
}
}
// Set le record.
public void setRec(ArrayList<DebsRecord> rec) {
this.record = rec;
}
// @return le record.
public ArrayList<DebsRecord> getRec() {
return record;
}
// Set la normalisation d'une place.
public void setunit(String unit) {
this.unit = unit;
}
// @return la normalization d'une place.
public String getunit() {
return unit;
}
// Set le nombre des taxis vides.
public void setNbTaxisEmpty(int nbTaxisVides) {
this.nbTaxisEmpty = nbTaxisVides;
}
// @return la somme des taxis vides.
public int getNbTaxisEmpty() {
return nbTaxisEmpty;
}
/**
* The profitability of an area is determined by dividing the area profit
* by the number of empty taxis in that area within the last 15 minutes.
*/
public void calculprofitability(){
if(nbTaxisEmpty>0){
profitability = mediane.getMediane()/nbTaxisEmpty;
}
else{
profitability=0;
}
}
// Set la rentabilité.
public void setProfitability(float profitability) {
this.profitability = profitability;
}
// @return la rentabilité.
public float getProfitability() {
return profitability;
}
// Récrire les fonctions des hashCode() and equals()
@Override
public int hashCode() {
final int prime = 233;
int result = 1;
result = prime * result + ((unit == null) ? 0 : unit.hashCode());
result = prime * result + ((mediane == null) ? 0 : mediane.hashCode());
result = prime * result + nbTaxisEmpty;
result = prime * result + Float.floatToIntBits(profitability);
result = prime * result + ((record == null) ? 0 : record.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (getClass() == obj.getClass()){
Areas areas = (Areas) obj;
if (unit == null) {
if (areas.unit != null)
return false;
} else if(unit.equals(areas.unit)){
if (mediane == null) {
if (areas.mediane != null)
return false;
} else if (mediane.equals(areas.mediane)){
if (nbTaxisEmpty == areas.nbTaxisEmpty){
if (profitability == (areas.profitability)){
if (record == null) {
if (areas.record != null)
return false;
} else if (record.equals(areas.record)){
return true;
}
}return false;
}return false;
}return false;
} return false;
}return false;
}
} | [
"[email protected]"
] | |
85ceb94e009ba89b8457471a0a65f50c50bc3497 | 2c22f6d6fd3afcf2c291836534cddabb675349f6 | /core/src/com/fruit/game/logic/objects/effects/onhit/ExplodeOnHit.java | da3b5b9d5f77f58e0b2306c81a2a88f2c866009a | [] | no_license | FruitAddict/Project2k15 | f7ffc7047d145f09f4a01f9efe35b1efebc77127 | 9d144a90ae7b43bf4a8db106221bdffe99ca2d66 | refs/heads/master | 2021-01-19T09:15:42.627709 | 2015-02-07T21:28:57 | 2015-02-07T21:28:57 | 25,644,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | package com.fruit.game.logic.objects.effects.onhit;
import com.fruit.game.logic.Constants;
import com.fruit.game.logic.objects.Value;
import com.fruit.game.logic.objects.effects.OnHitEffect;
import com.fruit.game.logic.objects.entities.Character;
import com.fruit.game.logic.objects.entities.Projectile;
import com.fruit.game.logic.objects.entities.misc.Explosion;
import com.fruit.game.logic.objects.entities.player.Player;
/**
* @Author FruitAddict
*/
public class ExplodeOnHit extends OnHitEffect implements Constants {
private int explosionCount;
private Player player;
public ExplodeOnHit(Player player, int charges){
this.player = player;
explosionCount = charges;
setEffectID(OnHitEffect.EXPLODE_ON_HIT);
}
@Override
public void onHit(Projectile proj, Character enemy, Value damage) {
if(explosionCount >0) {
player.getObjectManager().addObject(new Explosion(player.getObjectManager(),enemy.getBody().getPosition().x,enemy.getBody().getPosition().y,1f,0.5f,2));
explosionCount--;
}else {
player.removeOnHitEffect(this);
}
}
@Override
public void join(OnHitEffect onHitEffect) {
ExplodeOnHit explodeEffectReceived = (ExplodeOnHit)onHitEffect;
explosionCount +=explodeEffectReceived.explosionCount /2;
}
}
| [
"[email protected]"
] | |
cdf354c31f81afc337fa5a4bf16fa4eb7753ab52 | b39d7e1122ebe92759e86421bbcd0ad009eed1db | /sources/android/permission/-$$Lambda$PermissionControllerManager$PendingGetPermissionUsagesRequest$M0RAdfneqBIIFQEhfWzd068mi7g.java | f82a92cdd86d5c11511689f8341f00cd363f756d | [] | no_license | AndSource/miuiframework | ac7185dedbabd5f619a4f8fc39bfe634d101dcef | cd456214274c046663aefce4d282bea0151f1f89 | refs/heads/master | 2022-03-31T11:09:50.399520 | 2020-01-02T09:49:07 | 2020-01-02T09:49:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,242 | java | package android.permission;
import android.os.Bundle;
import android.os.RemoteCallback.OnResultListener;
import android.permission.PermissionControllerManager.OnPermissionUsageResultCallback;
import java.util.concurrent.Executor;
/* compiled from: lambda */
public final /* synthetic */ class -$$Lambda$PermissionControllerManager$PendingGetPermissionUsagesRequest$M0RAdfneqBIIFQEhfWzd068mi7g implements OnResultListener {
private final /* synthetic */ PendingGetPermissionUsagesRequest f$0;
private final /* synthetic */ Executor f$1;
private final /* synthetic */ OnPermissionUsageResultCallback f$2;
public /* synthetic */ -$$Lambda$PermissionControllerManager$PendingGetPermissionUsagesRequest$M0RAdfneqBIIFQEhfWzd068mi7g(PendingGetPermissionUsagesRequest pendingGetPermissionUsagesRequest, Executor executor, OnPermissionUsageResultCallback onPermissionUsageResultCallback) {
this.f$0 = pendingGetPermissionUsagesRequest;
this.f$1 = executor;
this.f$2 = onPermissionUsageResultCallback;
}
public final void onResult(Bundle bundle) {
this.f$0.lambda$new$1$PermissionControllerManager$PendingGetPermissionUsagesRequest(this.f$1, this.f$2, bundle);
}
}
| [
"[email protected]"
] | |
ab078c32fd5181ff07ca2c5068263856d6f22125 | 8b0ef2737f7f3890de62af8ce4d3dd8514202a05 | /app/src/main/java/com/hupo/cigarette/dao/converter/HOrderDetailModelConverter.java | 33057a82a3cd245108c73e089599fd61ad33fbc6 | [] | no_license | PerformerOne/CigaretteMsssanage | 052cffe0107eb73764ae1c911257e9d77467795e | 6d966f324eaaf9ea5d29c7a90a16ee9b0ebb6ab8 | refs/heads/master | 2020-04-06T21:59:50.417969 | 2018-11-16T05:07:14 | 2018-11-16T05:07:14 | 157,821,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package com.hupo.cigarette.dao.converter;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.huposoft.softs.chuanchuan.vmspda.commons.api.model.HOrderDetailModel;
import org.greenrobot.greendao.converter.PropertyConverter;
import java.util.List;
public class HOrderDetailModelConverter implements PropertyConverter<List<HOrderDetailModel>, String> {
@Override
public List<HOrderDetailModel> convertToEntityProperty(String databaseValue) {
if (databaseValue == null) {
return null;
}
List<HOrderDetailModel> list_transport = new Gson().fromJson(databaseValue, new TypeToken<List<HOrderDetailModel>>() {
}.getType());
return list_transport;
}
@Override
public String convertToDatabaseValue(List<HOrderDetailModel> arrays) {
if (arrays == null) {
return null;
} else {
return new Gson().toJson(arrays);
}
}
} | [
"https://github.com/PerformerOne/Secret.git"
] | https://github.com/PerformerOne/Secret.git |
5ec5ccaa21a58fe3560310c2efe510a0366c51cf | 76a2f46aeb34a276609764120e9aa744e61a0e9c | /src/com/Vasiliev_Interfaces/Base.java | c98d032036dfd5f37224101526fe6224f62ae760 | [] | no_license | DemoxieV/OOP | 59ed398f16f5d842b70c98cb5694ed5ffb246a55 | c61995aade9a9d490eb9401f5ee49a2d8209580a | refs/heads/master | 2023-06-11T23:37:59.334246 | 2021-07-05T12:13:14 | 2021-07-05T12:13:14 | 377,110,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.Vasiliev_Interfaces;
//Использование метода по умолчанию
public interface Base {
default void show(String txt){
System.out.println("Интерфейс Base: "+txt);
}
void show2();
void hello();
}
| [
"[email protected]"
] | |
75c920f00740ede1ef35026decf88e9be64f0670 | bca2a520e8d9a9f3d49d250bd0c2f7c3838da7f3 | /src/main/java/com/boundlessgeo/gsr/model/feature/LayerEdits.java | da73389553c446c161447f0f594b2973888e3ac0 | [] | no_license | geosolutions-it/gsr | 1fd64db6b8db0557991b5059c1eb5615f1082b93 | e6c442bc31d1d0cd59a677dc52730c6371c1523f | refs/heads/dynamic-table-test | 2023-06-01T00:12:41.319200 | 2020-02-28T15:12:17 | 2020-02-28T15:12:17 | 196,354,454 | 2 | 6 | null | 2019-12-20T23:07:16 | 2019-07-11T08:38:05 | Java | UTF-8 | Java | false | false | 903 | java | package com.boundlessgeo.gsr.model.feature;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LayerEdits {
private Integer id;
private FeatureArray adds;
private FeatureArray updates;
private List<Integer> deletes;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public FeatureArray getAdds() {
return adds;
}
public void setAdds(FeatureArray adds) {
this.adds = adds;
}
public FeatureArray getUpdates() {
return updates;
}
public void setUpdates(FeatureArray updates) {
this.updates = updates;
}
public List<Integer> getDeletes() {
return deletes;
}
public void setDeletes(List<Integer> deletes) {
this.deletes = deletes;
}
}
| [
"[email protected]"
] | |
edac477bd8f965301a100cee4bd3ce332b180f15 | b4f327673cda5c4eadf4d86e12167ce4da4f68d4 | /src/main/java/com/designpattern/behavioral/state/contents/Content.java | bfe94954fcaf449c5609b8a217fefbc8bbff8fdf | [] | no_license | ZhengHuaJing/designpattern | 85d7271ee15db12bde4bedd56953f339b6a93034 | 2baf3818c8d8813263d9fcac5037da6a5b449358 | refs/heads/master | 2023-01-04T23:58:14.169526 | 2020-11-01T11:10:12 | 2020-11-01T11:10:12 | 309,076,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.designpattern.behavioral.state.contents;
import com.designpattern.behavioral.state.states.State;
/**
* @Auther: ZhengHuaJing
* @Date: 2020/10/14 15:43
* @Description:
*/
public class Content {
private State state;
public Content() {
}
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
}
| [
"[email protected]"
] | |
83985ee765134c052a3c5a6ee080e6f01f1f03fe | 67a44a97c940a28144a73574983591f071192b56 | /src/com/shenghaishxt/dp/回文最少分割.java | 3b3156a5e146b1916db1ad4cca0a1bc2028d0c99 | [] | no_license | codershenghai/JavaLeetcode | 3e501328629ee1411cbb86c35386b7d36cc5bd19 | 2880c4b25d844ad5fc4ddde0a280664918d6f824 | refs/heads/master | 2022-12-10T17:29:39.566256 | 2020-09-09T16:04:49 | 2020-09-09T16:04:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,713 | java | package com.shenghaishxt.dp;
public class 回文最少分割 {
public int palindromeMinCuts(String s) {
if (s == null || s.length() == 0 || isPalindrome(s)) return 0;
int[] dp = new int[s.length() + 1];
// dp数组初始化,dp[i]代表前i个字符组成的字符串的最少分割数
for (int i = 2; i <= s.length(); i++) {
dp[i] = isPalindrome(s.substring(0, i)) ? 0 : i - 1;
}
// dp[i] = min(dp[i], dp[j]+1)
for (int i = 2; i <= s.length(); i++) {
for (int j = i - 1; j >= 1; j--) {
if (isPalindrome(s.substring(j, i))) {
dp[i] = Math.min(dp[i], dp[j] + 1);
}
}
}
return dp[s.length()];
}
private boolean isPalindrome(String s) {
// 将除字母、数字外的字符全部去除,且忽略大小写
String str = s.replaceAll("[^a-z^A-Z^0-9]", "").toLowerCase();
int head = 0, tail = str.length()-1;
if (str.length() == 0)
return true;
while (head < tail) {
if (str.charAt(head) == str.charAt(tail)) {
head++;
tail--;
} else return false;
}
return true;
}
public static void main(String[] args) {
System.out.println(new 回文最少分割().palindromeMinCuts("ABCBAEEE"));
System.out.println(new 回文最少分割().palindromeMinCuts("ABC"));
System.out.println(new 回文最少分割().palindromeMinCuts("ABA"));
System.out.println(new 回文最少分割().palindromeMinCuts("A"));
System.out.println(new 回文最少分割().palindromeMinCuts(""));
}
}
| [
"[email protected]"
] | |
04c335082bf9e0f79731b60bf404947c886bd738 | 891c11bbbbca63ea3ca2ed90e0bc33a735a12053 | /CORE/src/test/java/com/jocata/core/scripts/SimpleSearchJocata3.java | c2eefdca3815f3d0229fca84e1be8fb144c9ee87 | [] | no_license | ChinnaVishnu/CORE | e9336c3d0413eaa22126014b49d9bf789ea8580e | 30960dada77bff922480d4ffc03844e979707bb4 | refs/heads/master | 2021-09-06T06:51:56.730651 | 2018-02-03T12:47:06 | 2018-02-03T12:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,997 | java | package com.jocata.core.scripts;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.Wait;
import org.testng.annotations.Test;
import com.google.common.base.Function;
import com.jocata.core.basescripts.ExtentTestManager;
import com.jocata.core.basescripts.GetScreenshort;
import com.jocata.core.basescripts.mainbaseLatest;
import com.relevantcodes.extentreports.LogStatus;
public class SimpleSearchJocata3 extends mainbaseLatest {
// .............................................simplesearch.....................................................................//
@Test(priority = 5)
public void loginsimple() {
ExtentTestManager.startTest(" TaskBoard : Search ");
clickDashboardsimple();
}
public void clickDashboardsimple() {
fluentWait(By.xpath("//span[text()='Case Files']")).click();
fluentWait(By.xpath("//ul[@id='trans-nav']//a[text()='Task Board']")).click();
/*sleep(8);
// ..................................................clicking the
// activaity period..........................................//
ExtentTestManager.getTest().log(LogStatus.INFO, "Screenshortbelow :" + ExtentTestManager.getTest()
.addScreenCapture(GetScreenshort.capture(driver, "ScreenshortForExtentReport")));
WebElement elementToClick = driver.findElement(By.xpath("//input[@id='activityPeriod']"));
// Scroll the browser to the element's Y position
((JavascriptExecutor) driver).executeScript("window.scrollTo(0," + elementToClick.getLocation().y + ")");
// Click the element
elementToClick.click();
fluentWait(By.xpath("//li[text()='Custom Range']")).click();
sleep(8);
// select the data
driver.findElement(By.xpath(".//*[@id='ext-gen1018']/div[5]/div[2]/table/thead/tr[1]/th[2]/select[2]"))
.click();
sleep(8);
WebElement element = driver
.findElement(By.xpath(".//*[@id='ext-gen1018']/div[5]/div[2]/table/thead/tr[1]/th[2]/select[2]"));
Select select = new Select(element);
select.selectByIndex(44);
sleep(8);
// driver.findElement(By.xpath("//td[text()='11']")).click();
fluentWait(By.xpath("//button[text()='Submit']")).click();
sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " ACTIVITY PERIOD ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocata = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement ele : jocata) {
String text = ele.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, text);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .............................................................................................................................//
// ........................clicking the Last Updated
// Period..................................................................................//
sleep(8);
WebElement elementToLast = driver.findElement(By.xpath("//input[@id='updatedPeriodRange']"));
// Scroll the browser to the element's Y position
((JavascriptExecutor) driver).executeScript("window.scrollTo(0," + elementToLast.getLocation().y + ")");
// Click the element
elementToLast.click();
fluentWait(By.xpath("//div[@class='ranges']//following::ul/li[3]")).click();
sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " LAST UPDATED PERIOD ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatabutton = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecond : jocatabutton) {
String textsecond = elesecond.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecond);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
// sleep(8);
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(8);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .....................................CASE
// ID................................................................................//
fluentWait(By.xpath("//input[@id='caseId']")).sendKeys("2042180");
ExtentTestManager.getTest().log(LogStatus.PASS, " CASE ID ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomer = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustom : jocatacustomer) {
String textsecondcustom = elesecondcustom.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustom);
}
// String textcaseid=driver.findElement(By.xpath("//div[text()='No
// Matching Records']")).getText();
// ExtentTestManager.getTest().log(LogStatus.INFO, textcaseid);
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(8);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
//..................................Rules Count.................................................................................//
fluentWait(By.xpath(".//*[@id='fromRuleCount']")).sendKeys("0");
fluentWait(By.xpath(".//*[@id='fromRuleCount']")).sendKeys("1");
ExtentTestManager.getTest().log(LogStatus.PASS, " CASE ID ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomerrule = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomr : jocatacustomerrule) {
String textsecondcustomrr = elesecondcustomr.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomrr);
}
// String textcaseid=driver.findElement(By.xpath("//div[text()='No
// Matching Records']")).getText();
// ExtentTestManager.getTest().log(LogStatus.INFO, textcaseid);
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(8);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
fluentWait(By.xpath("//img[@id='searchBranchName']")).click();
fluentWait(By.xpath("//div[@id='branchgrid-body']//td/div")).click();
sleep(8);
WebElement elementTobranuch = driver.findElement(By.xpath(
"//a[@class='x-btn x-unselectable x-btn-toolbar x-box-item x-toolbar-item x-btn-default-toolbar-small x-noicon x-btn-noicon x-btn-default-toolbar-small-noicon']/span"));
// Scroll the browser to the element's Y position
((JavascriptExecutor) driver).executeScript("window.scrollTo(0," + elementTobranuch.getLocation().y + ")");
// Click the element
elementTobranuch.click();
// driver.findElement(By.xpath("//span[@id='button-1112-btnIconEl']")).click();
ExtentTestManager.getTest().log(LogStatus.PASS, " BRANCH ");
sleep(8);
try {
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
} catch (org.openqa.selenium.NoSuchElementException e) {
String CustomerNameBranuch = driver.findElement(By.xpath("//div[text()='No Matching Records']"))
.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, CustomerNameBranuch);
}
sleep(5);
List<WebElement> jocatacustomerbranch = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondbranch : jocatacustomerbranch) {
String textsecondbranch = elesecondbranch.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondbranch);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
//....................................Rule Name.........................................................................//
fluentWait(By.xpath(".//*[@id='ruleNameCombo-triggerWrap']")).click();
fluentWait(By.cssSelector(".x-boundlist:not([style*='display: none']) div span ")).click();
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatarulename = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondrule : jocatarulename) {
String textsecondcrule = elesecondrule.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcrule);
}
// String textcaseid=driver.findElement(By.xpath("//div[text()='No
// Matching Records']")).getText();
// ExtentTestManager.getTest().log(LogStatus.INFO, textcaseid);
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(8);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
*/
//..................................................Domain.........................................................//
sleep(8);
fluentWait(By.xpath("//img[@id='searchDomainName']")).click();
sleep(8);
fluentWait(By.xpath("//div[@id='mydomaingrid']//div//span")).click();
sleep(8);
WebElement elementDoim = driver.findElement(By.xpath("//a[6]/span/span/span[2]"));
((JavascriptExecutor) driver).executeScript("window.scrollTo(0," + elementDoim.getLocation().x + ")");
// Click the element
elementDoim.click();
//fluentWait(By.xpath("//span[text()='Update']")).click();
ExtentTestManager.getTest().log(LogStatus.PASS, " Domain ");
sleep(8);
try {
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
} catch (org.openqa.selenium.NoSuchElementException e) {
String CustomerNameBranuch = driver.findElement(By.xpath("//div[text()='No Matching Records']"))
.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, CustomerNameBranuch);
}
sleep(5);
List<WebElement> jocatacustomerDomain = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement eleseconDomain : jocatacustomerDomain) {
String textsecondjocatacustomerDomain = eleseconDomain.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondjocatacustomerDomain);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(5);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
sleep(5);
//...............................................Events Count......................................................//
fluentWait(By.xpath(".//*[@id='fromEventCount']")).sendKeys("1");
fluentWait(By.xpath(".//*[@id='toEventCount']")).sendKeys("2");
ExtentTestManager.getTest().log(LogStatus.PASS, " Events Count ");
sleep(8);
try {
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
} catch (org.openqa.selenium.NoSuchElementException e) {
/* String Count = driver.findElement(By.xpath("//div[text()='No Matching Records']"))
.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, Events);*/
}
sleep(5);
List<WebElement> EventsCount = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement eleseconEventsCount : EventsCount) {
String textsecoeleseconEventsCount = eleseconEventsCount.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecoeleseconEventsCount);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
//.............................................Zone.............................................................//
/*
// .............................clicking the
// CustomerType.................................................................//
fluentWait(By.xpath("//input[@id='customerTypeCombo-inputEl']")).click();
sleep(8);
List<WebElement> elements = driver.findElements(By.xpath("//ul/li/div"));
for (WebElement all : elements) {
//System.out.println(all.getAttribute("data-qtip").toString());
if (all.getAttribute("data-qtip").equals("Associations and Body of Individuals")) {
if (!all.isSelected()) {
all.click();
}
}
if (all.getAttribute("data-qtip").equals("Business Entity")) {
if (!all.isSelected()) {
all.click();
}
}
if (all.getAttribute("data-qtip").equals("Financial Institution")) {
if (!all.isSelected()) {
all.click();
}
}
if (all.getAttribute("data-qtip").equals("Individual")) {
if (!all.isSelected()) {
all.click();
}
}
}
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomercuu = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomzz : jocatacustomercuu) {
String textsecondcustomav = elesecondcustomzz.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomav);
}
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// driver.findElement(By.xpath("//div[@class='x-boundlist
// x-boundlist-floating x-layer x-boundlist-default
// x-border-box']//span")).click();
ExtentTestManager.getTest().log(LogStatus.PASS, " CUSTOMER TYPE ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomertype = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomss : jocatacustomertype) {
String textsecondcustomdd = elesecondcustomss.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomdd);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .........................................clicking the Assign to
// me...........................................................//
fluentWait(By.xpath("//img[@id='searchAsignUsersId']")).click();
sleep(3);
fluentWait(By.xpath("//tbody[contains(@id,'gridview-')]/tr[8]/td/div")).click();
// driver.findElement(By.xpath("//input[@id='userIdText-inputEl']")).sendKeys("l1_user");
sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " ASSIGNED TO ");
WebElement elementToAssign = driver
.findElement(By.xpath("//div[starts-with(@id,'pagingtoolbar-')]//a[6]//span"));
elementToAssign.click();
sleep(8);
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomerassign = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomassign : jocatacustomerassign) {
String textsecondcustomassign = elesecondcustomassign.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomassign);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .....................................CustomerName.....................................................................//
fluentWait(By.xpath("//input[@id='searchCusName']")).sendKeys("ankita aaa");
sleep(3);
ExtentTestManager.getTest().log(LogStatus.PASS, " Customer Name ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomernamezz = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomzz : jocatacustomernamezz) {
String textsecondcustomvvvxx = elesecondcustomzz.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomvvvxx);
}
// String textcaseid=driver.findElement(By.xpath("//div[text()='No
// Matching Records']")).getText();
// ExtentTestManager.getTest().log(LogStatus.INFO, textcaseid);
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// ..........................................Customer
// ID........................................................................//
fluentWait(By.xpath("//input[@id='searchCusId']")).sendKeys("JOCATA937");
sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " CUSTOMER ID ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacustomerwwwww = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondcustomsssq : jocatacustomerwwwww) {
String textsecondcustomaaaz = elesecondcustomsssq.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondcustomaaaz);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
sleep(8);
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// ................................................Branuch.................................................................//
fluentWait(By.xpath("//img[@id='searchBranchName']")).click();
fluentWait(By.xpath("//div[@id='branchgrid-body']//td/div")).click();
sleep(8);
WebElement elementTobranuch = driver.findElement(By.xpath(
"//a[@class='x-btn x-unselectable x-btn-toolbar x-box-item x-toolbar-item x-btn-default-toolbar-small x-noicon x-btn-noicon x-btn-default-toolbar-small-noicon']/span"));
// Scroll the browser to the element's Y position
((JavascriptExecutor) driver).executeScript("window.scrollTo(0," + elementTobranuch.getLocation().y + ")");
// Click the element
elementTobranuch.click();
// driver.findElement(By.xpath("//span[@id='button-1112-btnIconEl']")).click();
ExtentTestManager.getTest().log(LogStatus.PASS, " BRANCH ");
sleep(8);
try {
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
} catch (org.openqa.selenium.NoSuchElementException e) {
String CustomerNameBranuch = driver.findElement(By.xpath("//div[text()='No Matching Records']"))
.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, CustomerNameBranuch);
}
sleep(5);
List<WebElement> jocatacustomerbranch = driver
.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondbranch : jocatacustomerbranch) {
String textsecondbranch = elesecondbranch.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondbranch);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// ...............................................................Score.......................................................//
sleep(8);
fluentWait(By.xpath("//input[@id='fromCaseScore']")).sendKeys("28");
sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " SCORE ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocataScore = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondscore : jocataScore) {
String textsecondscore = elesecondscore.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsecondscore);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .......................................clicking the case
// type.........................................................//
sleep(8);
fluentWait(By.xpath("//input[@id='casesTypesCombo-inputEl']")).click();
sleep(8);
fluentWait(By.xpath("//li[text()='My Current Cases']")).click();
}catch(Exception e){
System.out.println(e.getMessage());
}
//sleep(8);
ExtentTestManager.getTest().log(LogStatus.PASS, " CASE TYPE ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> jocatacasetype = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondscoretype : jocatacasetype) {
String textcasetype = elesecondscoretype.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textcasetype);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
// .................................Workflow
// Sub-Status.................................................................//
sleep(3);
fluentWait(By.xpath("//input[@id='workflowSubStatusCombo-inputEl']")).click();
sleep(8);
WebElement elementWorkflow = driver.findElement(By.xpath(
"//div[@class='x-boundlist x-boundlist-floating x-layer x-boundlist-default x-border-box']//span"));
JavascriptExecutor Workflow = (JavascriptExecutor) driver;
Workflow.executeScript("arguments[0].click();", elementWorkflow);
sleep(3);
ExtentTestManager.getTest().log(LogStatus.PASS, " WORKFLOW SUBSTATUS ");
fluentWait(By.xpath("//div[@id='buttonSearch']/a")).click();
sleep(8);
List<WebElement> Workflowsubstates = driver.findElements(By.xpath("//tbody[contains(@id,'gridview-')]/tr"));
for (WebElement elesecondsubstates : Workflowsubstates) {
String textsubstaes = elesecondsubstates.getText();
ExtentTestManager.getTest().log(LogStatus.INFO, textsubstaes);
}
ExtentTestManager.getTest().log(LogStatus.INFO,
"***************************************************************************************");
fluentWait(By.xpath("//img[@class='x-tool-img x-tool-expand-bottom']")).click();
fluentWait(By.xpath("//div[@class='resetButton']")).click();
*/
ExtentTestManager.getTest().log(LogStatus.INFO, " search with all filters performed successfully");
/*} catch (Exception e) {
sleep(19);
ExtentTestManager.getTest().log(LogStatus.INFO, "Screenshortbelow :" + ExtentTestManager.getTest()
.addScreenCapture(GetScreenshort.capture(driver, "ScreenshortForExtentReport")));
driver.navigate().refresh();
System.out.println("referesh................");
ExtentTestManager.getTest().log(LogStatus.FAIL, "Simple Search Fail");
}*/
}
}
| [
"MadhuRaghu"
] | MadhuRaghu |
95ac41a5b9a10b4d44f9a8ccca3fa7d9d8280c5a | f535d20d72087fce0a64b79675a58ab90276d81f | /OOP_LAB4_part1(1)/src/Cheapway.java | 2c30640cb0c811294e7d488c108cea66af66f665 | [] | no_license | Admiral2303/patternslabs | 4e5e8729f890a0da651058df8e5d2c160388603b | 8e83651d6a632fd56ca1af165294eb6588b14d09 | refs/heads/master | 2020-03-18T13:58:21.471717 | 2018-05-25T07:49:25 | 2018-05-25T07:49:25 | 134,821,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | public class Cheapway extends TeaCeremony {
public Cheapway() {
}
public Cheapway(Client client) {
this.client = client;
}
@Override
public void doTeaceremony() {
tea_class = "very cheap tea";
System.out.println("It's tea is very bad");
}
@Override
public void addClient(){
System.out.println("Client: " + client.name + " " + client.surname + " add to cheap ceromony");
}
@Override
public void getClient(){
System.out.println("Client: " + client.name + " " + client.surname + " drink tea in bags");
}
}
| [
"[email protected]"
] | |
fc52741ecdc6f86d83d86eee3e18934bc5989653 | 9976d3bb01ee33f3370c2f4d615a9a46fe536f7c | /SuperPrueba-ejb/src/main/java/co/com/superintendencia/entidad/Usuario.java | 2dbef8e044374f9aa271498f97a5a363b4479d61 | [] | no_license | danierfresley/superintendencia | 549fd7c74215420e5562bf41654acd82687698b6 | fcce33bf82f17f5636e77ddf540c17f9b50dad25 | refs/heads/master | 2020-10-01T07:49:14.871467 | 2019-12-12T01:35:45 | 2019-12-12T01:35:45 | 227,493,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,181 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package co.com.superintendencia.entidad;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author danier
*/
@Entity
@Table(name = "USUARIO")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u")
, @NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id")
, @NamedQuery(name = "Usuario.findByUsuario", query = "SELECT u FROM Usuario u WHERE u.usuario = :usuario")
, @NamedQuery(name = "Usuario.findByContrasena", query = "SELECT u FROM Usuario u WHERE u.contrasena = :contrasena")})
public class Usuario implements Serializable {
private static final long serialVersionUID = 1L;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Id
@Basic(optional = false)
@NotNull
@Column(name = "ID")
private BigDecimal id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 20)
@Column(name = "USUARIO")
private String usuario;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 20)
@Column(name = "CONTRASENA")
private String contrasena;
public Usuario() {
}
public Usuario(BigDecimal id) {
this.id = id;
}
public Usuario(BigDecimal id, String usuario, String contrasena) {
this.id = id;
this.usuario = usuario;
this.contrasena = contrasena;
}
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getContrasena() {
return contrasena;
}
public void setContrasena(String contrasena) {
this.contrasena = contrasena;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Usuario)) {
return false;
}
Usuario other = (Usuario) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "co.com.superintendencia.entidad.Usuario[ id=" + id + " ]";
}
}
| [
"[email protected]"
] | |
59519524832c159ef0405d2206dcc0ab12e44dc0 | 6d97c6e52a46e38285d861096a90567188a287e1 | /src/test/java/easy/LC219Test.java | 0db60842e0602d91ff4861dda6a740efe24bb560 | [] | no_license | liux0054/LCSolution | 6839fec24515bcb8cb8b304afdd2c7760ec19b90 | c0a8364e5591d635f60d96e91fe318de4b777316 | refs/heads/master | 2021-09-09T13:20:22.585135 | 2021-09-02T14:35:31 | 2021-09-02T14:35:31 | 143,372,519 | 0 | 0 | null | 2021-01-19T12:34:17 | 2018-08-03T03:23:09 | Java | UTF-8 | Java | false | false | 515 | java | package easy;
import org.junit.Assert;
import org.junit.Test;
import easy.LC219;
public class LC219Test {
@Test
public void testCase1(){
Assert.assertTrue(new LC219().containsNearbyDuplicate(new int[]{1,2,3,1}, 3));
}
@Test
public void testCase2(){
Assert.assertTrue(new LC219().containsNearbyDuplicate(new int[]{1,0,1,1}, 1));
}
@Test
public void testCase3(){
Assert.assertFalse(new LC219().containsNearbyDuplicate(new int[]{1,2,3,1,2,3}, 2));
}
}
| [
"[email protected]"
] | |
576f6ca970890b670ecb845ff72fc519f731a7f7 | 29de176e1c4ec490399fca0e1ac1c1c118b097e1 | /src/main/java/edu/ec/istdab/util/MensajeManager.java | ec35a9e9c4c916c895c249ad36317623544068cb | [] | no_license | DanielMialab/MIALAB.github.io | 8706c214778adc7980995b72f117083fdd2fc802 | 6fd11fa852a043a10160b2e8c42c51e51a4a0583 | refs/heads/main | 2023-02-23T16:41:57.918978 | 2021-02-04T17:20:57 | 2021-02-04T17:20:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 973 | java | package edu.ec.istdab.util;
import java.io.Serializable;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
@Named
@ViewScoped
public class MensajeManager implements Serializable{
public void mostrarMensaje(String titulo, String cuerpo, String severidad) {
switch (severidad) {
case "INFO":
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, titulo, cuerpo));
break;
case "WARN":
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, titulo, cuerpo));
break;
case "ERROR":
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, titulo, cuerpo));
break;
case "FATAL":
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, titulo, cuerpo));
break;
}
}
}
| [
"[email protected]"
] | |
90a812cc4c93b8b70960a86e9af2908d982eadc5 | e12504f4e343d11e96f549dda7b9da96cd7fd9a2 | /source/SmallWebService/app/src/main/java/com/sree/lelab/smallwebservice/adapter/adapter.java | f8f9292ab9c34ea611f6021c63dd2094768ec579 | [] | no_license | sreejeshklm-git/A-Small-Android-Webservice- | ae2f2ab54c873f5f43fcabf06599b64641c859c6 | 539d0a326ec9ea70b076517b8c9ce7d08fb9d803 | refs/heads/master | 2020-09-09T06:39:02.666166 | 2019-11-13T05:57:51 | 2019-11-13T05:57:51 | 221,377,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,021 | java | package com.sree.lelab.smallwebservice.adapter;
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.recyclerview.widget.RecyclerView;
import com.sree.lelab.smallwebservice.R;
import com.sree.lelab.smallwebservice.view.UserDetails;
import com.sree.lelab.smallwebservice.models.RetrofitGetResponse;
import java.util.HashMap;
import java.util.List;
//User detail adapter
public class adapter extends RecyclerView.Adapter<adapter.myViewHolder> {
Context context;
List<RetrofitGetResponse> responseList;
HashMap<String, String> UsrDtlHmap ;
public adapter(Context context, List<RetrofitGetResponse> data) {
this.context = context;
this.responseList = data;
}
//inflate Item layout in list
@Override
public adapter.myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.user_info_adapter, parent, false);
return new myViewHolder(view);
}
//Bind values to item views
@Override
public void onBindViewHolder(adapter.myViewHolder holder,final int position) {
holder.name.setText(responseList.get(position).getName());
holder.phNo.setText(responseList.get(position).getuPhoneNo());
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent uDtl= new Intent(context, UserDetails.class);
UsrDtlHmap= new HashMap<String, String>();
addCurrentUsrDetailsToMap(position);
uDtl.putExtra("hashMap", UsrDtlHmap);
context.startActivity(uDtl);
}
});
}
//Total Item count
@Override
public int getItemCount() {
if(responseList != null){
return responseList.size();
}
return 0;
}
//view holder class for getting view elements for each item in the list
public class myViewHolder extends RecyclerView.ViewHolder {
View mView;
TextView name;
TextView phNo;
public myViewHolder(View itemView) {
super(itemView);
mView=itemView;
name = (TextView) itemView.findViewById(R.id.uName);
phNo = (TextView) itemView.findViewById(R.id.uPhone);
}
}
//storing user details to hashmap for user detail activity
private void addCurrentUsrDetailsToMap(int position) {
UsrDtlHmap.clear();
UsrDtlHmap.put("id",responseList.get(position).getId());
UsrDtlHmap.put("name",responseList.get(position).getName());
UsrDtlHmap.put("username",responseList.get(position).getUserName());
UsrDtlHmap.put("email",responseList.get(position).getuEmail());
UsrDtlHmap.put("street",responseList.get(position).getAddressDtl().getStreet());
UsrDtlHmap.put("suite",responseList.get(position).getAddressDtl().getSuite());
UsrDtlHmap.put("city",responseList.get(position).getAddressDtl().getCity());
UsrDtlHmap.put("zipcode",responseList.get(position).getAddressDtl().getZipcode());
UsrDtlHmap.put("lat",responseList.get(position).getAddressDtl().getGeoDtl().getLat());
UsrDtlHmap.put("lng",responseList.get(position).getAddressDtl().getGeoDtl().getLng());
UsrDtlHmap.put("phone",responseList.get(position).getuPhoneNo());
UsrDtlHmap.put("website",responseList.get(position).getuWebsite());
UsrDtlHmap.put("cname",responseList.get(position).getCompanyDtl().getCname());
UsrDtlHmap.put("catchPhrase",responseList.get(position).getCompanyDtl().getcCatchPhrase());
UsrDtlHmap.put("bs",responseList.get(position).getCompanyDtl().getcBs());
}
public void setEmployeeList(List<RetrofitGetResponse> resList) {
this.responseList = resList;
notifyDataSetChanged();
}
}
| [
"[email protected]"
] | |
ce34fcd153ad5a6bff5c5ebf8d351c07e8dbba4c | 86f8997aea4d04cf1a521d336bc55b95d1070154 | /src/main/java/com/gs/demo/controller/UserController.java | 4858c85193aa208ab9507a371b6f1ddd429017fa | [] | no_license | itsgauravsaxena/demoapp | 65aab7e2948112d370a4df06babc6653328c74c6 | c039f3b37bc8d7898ed56f3966512d482e0893e3 | refs/heads/master | 2020-06-02T05:08:45.831043 | 2019-11-12T21:10:01 | 2019-11-12T21:10:01 | 191,047,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.gs.demo.controller;
import com.gs.demo.domain.User;
import com.gs.demo.domain.UserRepository;
import java.util.List;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@CrossOrigin(origins = "http://localhost:4200")
public class UserController {
private final UserRepository userRepository;
public UserController(UserRepository userRepository) {
this.userRepository = userRepository;
}
@GetMapping("/users")
public List<User> getUsers() {
return (List<User>) userRepository.findAll();
}
@PostMapping("/users")
void addUser(@RequestBody User user) {
userRepository.save(user);
}
}
| [
"[email protected]"
] | |
f9c564211f8cfc2be102db305801425939b740e5 | 9d18d1a52051871e86569d7483c39d53d9af27b7 | /src/main/java/leetCode/NumberOfIslands.java | c55588b2724371acb4ba7c94360cac28398f68e3 | [] | no_license | cristiancota/ctci-exercises | 5275d9303ddc39969041b1187801963d4c349bda | 630361f793051d6186d559e00eb3323e8d5931e1 | refs/heads/master | 2023-05-15T11:14:01.023251 | 2021-06-10T01:45:02 | 2021-06-10T01:45:02 | 242,251,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | class NumberOfIslands {
public int numIslands(char[][] grid) {
if (grid == null || grid.length == 0) {
return 0;
}
int numIslands = 0;
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[i].length; j++) {
if (grid[i][j] == '1') {
numIslands += dfs(grid, i, j);
}
}
}
return numIslands;
}
private int dfs(char[][] grid, int i, int j) {
if (i < 0 || j < 0 || i >= grid.length || j >= grid[i].length || grid[i][j] == '0') {
return 0;
}
// marked current as visited
grid[i][j] = '0';
// visit adyacents in top/bottom/left/right
dfs(grid, i, j + 1);
dfs(grid, i, j - 1);
dfs(grid, i + 1, j);
dfs(grid, i - 1, j);
// return 1 when the island is marked as visited
return 1;
}
}
| [
"[email protected]"
] | |
cdd0240cc86f3eada57c72ff39174152569ede56 | 0c2f132a4d2a5a56aca9882323a93f680bab3c76 | /src/ex/ex7/Figure.java | 5d4ebe1aef86aac6e81a59bc1ce0e07bb9c71b4a | [] | no_license | yokotary/basic | 4866622eef2bead6b72eda6835257955ab9bbf34 | 80cd750850dd51664fbcf12b2b83c0ceb3e22d60 | refs/heads/master | 2023-06-03T17:31:34.792120 | 2021-06-17T05:15:55 | 2021-06-17T05:15:55 | 353,919,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package ex.ex7;
//図形の抽象クラス
abstract class Figure {
//長方形、円、三角形のクラスのスーパークラス
public abstract double getArea();
}
//getエリア、戻り値はdouble
//幅高さ
//ラディウス
//底辺高さ
| [
"[email protected]"
] | |
9dcc87d52119645a43dab8639470972c058376ac | e0461c729dd134c853655a9749be9331a3c407e9 | /booking-engine-gateway/outbound-api/src/main/java/com/tl/booking/gateway/outbound/api/hotel/HotelScrappingReportOutboundService.java | e0cf5709e1a02c1ae3f43470e6c937b4aeacdec9 | [] | no_license | dpokuri/microservice | 5942600f546a146e32c8923e784ba6a826e0b31c | bbffacaab70b2d03f0c09eb6f469b5df4d910d05 | refs/heads/master | 2021-04-06T18:08:23.329478 | 2018-12-04T20:06:51 | 2018-12-04T20:06:51 | 125,348,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,087 | java | package com.tl.booking.gateway.outbound.api.hotel;
import com.tl.booking.common.rest.web.model.request.MandatoryRequest;
import com.tl.booking.gateway.entity.outbound.GatewayBaseResponse;
import com.tl.booking.gateway.entity.outbound.RestResponsePage;
import com.tl.booking.gateway.entity.outbound.Hotel.ScrappingReportResponse;
import io.reactivex.Single;
public interface HotelScrappingReportOutboundService {
Single<GatewayBaseResponse<RestResponsePage<ScrappingReportResponse>>> getPriceReportData(MandatoryRequest mandatoryRequest, Integer page,
Integer limit,
String regionId,
String checkInDate,
String scrappingDate,
String q,
String sort,
String method);
Single<GatewayBaseResponse<Boolean>> getEmailReport(MandatoryRequest mandatoryRequest, String regionId,
String q,
String checkInDate,
String scrappingDate,
String email);
Single<GatewayBaseResponse<String>> exportReport(MandatoryRequest mandatoryRequest, String regionId,
String q,
String checkInDate,
String scrappingDate);
}
| [
"[email protected]"
] | |
3a7c4ac0dc79b916512e7be793f374cb250f2d32 | 41ce5edf2e270e321dddd409ffac11ab7f32de86 | /8/com/android/mediaframeworktest/MediaProfileReader.java | 056537df1f627b341ab9d3e625ece161b3f221c0 | [] | no_license | danny-source/SDK_Android_Source_03-14 | 372bb03020203dba71bc165c8370b91c80bc6eaa | 323ad23e16f598d5589485b467bb9fba7403c811 | refs/heads/master | 2020-05-18T11:19:29.171830 | 2014-03-29T12:12:44 | 2014-03-29T12:12:44 | 18,238,039 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,200 | java | /*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.mediaframeworktest;
import android.media.MediaRecorder;
import android.media.EncoderCapabilities;
import android.media.EncoderCapabilities.VideoEncoderCap;
import android.media.EncoderCapabilities.AudioEncoderCap;
import android.media.DecoderCapabilities;
import android.media.DecoderCapabilities.VideoDecoder;
import android.media.DecoderCapabilities.AudioDecoder;
import android.os.SystemProperties;
import java.util.List;
import java.util.HashMap;
public class MediaProfileReader
{
private static final List<VideoDecoder> videoDecoders = DecoderCapabilities.getVideoDecoders();
private static final List<AudioDecoder> audioDecoders = DecoderCapabilities.getAudioDecoders();
private static final List<VideoEncoderCap> videoEncoders = EncoderCapabilities.getVideoEncoders();
private static final List<AudioEncoderCap> audioEncoders = EncoderCapabilities.getAudioEncoders();
private static final HashMap<Integer, String> encoderMap = new HashMap<Integer, String>();
static {
initEncoderMap();
};
public static List<VideoEncoderCap> getVideoEncoders() {
return videoEncoders;
}
public static List<AudioEncoderCap> getAudioEncoders() {
return audioEncoders;
}
public static String getDeviceType() {
// push all the property into one big table
String s;
s = SystemProperties.get("ro.product.name");
return s;
}
public static boolean getWMAEnable() {
for (AudioDecoder decoder: audioDecoders) {
if (decoder == AudioDecoder.AUDIO_DECODER_WMA) {
return true;
}
}
return false;
}
public static boolean getWMVEnable(){
for (VideoDecoder decoder: videoDecoders) {
if (decoder == VideoDecoder.VIDEO_DECODER_WMV) {
return true;
}
}
return false;
}
public static String getVideoCodecName(int videoEncoder) {
if (videoEncoder != MediaRecorder.VideoEncoder.H263 &&
videoEncoder != MediaRecorder.VideoEncoder.H264 &&
videoEncoder != MediaRecorder.VideoEncoder.MPEG_4_SP) {
throw new IllegalArgumentException("Unsupported video encoder " + videoEncoder);
}
return encoderMap.get(videoEncoder);
}
public static String getAudioCodecName(int audioEncoder) {
if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB &&
audioEncoder != MediaRecorder.AudioEncoder.AMR_WB &&
audioEncoder != MediaRecorder.AudioEncoder.AAC &&
audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS &&
audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
throw new IllegalArgumentException("Unsupported audio encodeer " + audioEncoder);
}
return encoderMap.get(audioEncoder);
}
private MediaProfileReader() {} // Don't call me
private static void initEncoderMap() {
// video encoders
encoderMap.put(MediaRecorder.VideoEncoder.H263, "h263");
encoderMap.put(MediaRecorder.VideoEncoder.H264, "h264");
encoderMap.put(MediaRecorder.VideoEncoder.MPEG_4_SP, "m4v");
// audio encoders
encoderMap.put(MediaRecorder.AudioEncoder.AMR_NB, "amrnb");
encoderMap.put(MediaRecorder.AudioEncoder.AMR_WB, "amrwb");
encoderMap.put(MediaRecorder.AudioEncoder.AAC, "aac");
encoderMap.put(MediaRecorder.AudioEncoder.AAC_PLUS, "aacplus");
encoderMap.put(MediaRecorder.AudioEncoder.EAAC_PLUS, "eaacplus");
}
}
| [
"[email protected]"
] | |
87a5d7dad6f06fdb43c145cb44d3506348d9aa42 | ac873295fda07fbca2836bfdfa4a9049e9254b25 | /demo-common/src/test/java/com/sian/titan/common/test/BaseTestClass.java | 15c5d1f97de4d40307698ea6264428f9d302c872 | [] | no_license | seagrape/sun | 957144a9ac2932bc86274eea5953e5bb547290cd | da7f3eef92bee9225e11d433085bd37dd15abf44 | refs/heads/master | 2021-01-22T22:20:39.743680 | 2017-03-21T09:14:12 | 2017-03-21T09:14:12 | 85,532,757 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.sian.titan.common.test;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = CommonTestApplication.class)
@Transactional
public class BaseTestClass {
public static void main(String[] args) {
SpringApplication.run(BaseTestClass.class, args);
}
}
| [
"[email protected]"
] | |
8e098d108101161df2b677cd812f38db006750ec | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2005-11-08/seasar2-2.3.0/s2-framework/src/main/java/org/seasar/framework/mock/servlet/MockServlet.java | fce006a7df60203b4872ef7a940ea30a62c4290a | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,313 | java | /*
* Copyright 2004-2005 the Seasar Foundation and the Others.
*
* 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.seasar.framework.mock.servlet;
import java.io.IOException;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* @author higa
*
*/
public class MockServlet extends GenericServlet {
private static final long serialVersionUID = -2690818043808621124L;
/**
* @see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
*/
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
}
public void log(String msg) {
}
}
| [
"manhole@319488c0-e101-0410-93bc-b5e51f62721a"
] | manhole@319488c0-e101-0410-93bc-b5e51f62721a |
7123e13ba3a976157cc397aa6ede6de662cd2d99 | 8be87987eccae0849a5f32673402b4b2f729cb1b | /src/main/java/com/test/currentandsafe/threadsafe/singleton/SingletonSafe.java | 283e11935ef06e84066e1f49e6b2847047d25106 | [] | no_license | 18364193157/Demo | 58b4934fd465da0de9cdf600613f40855724bccf | 018e77b2c76722db9f15434278641713f7217b16 | refs/heads/master | 2022-07-01T07:04:26.882755 | 2021-04-11T05:44:51 | 2021-04-11T05:44:51 | 164,550,243 | 0 | 0 | null | 2022-06-21T04:16:10 | 2019-01-08T03:22:54 | Java | UTF-8 | Java | false | false | 604 | java | package com.test.currentandsafe.threadsafe.singleton;
/**
* 描述: 饿汉模式单例线程安全
* 缺点:如果这个构造方法中存在过多的逻辑,加载就会比较慢,可能会出现性能问题,如果没有调用,更会造成资源浪费
*
*
* @author langyonghe
* @create 2019-03-12 10:05
*/
public class SingletonSafe {
private SingletonSafe() {
}
private static class SingletonHolder{
private static SingletonSafe instance = new SingletonSafe();
}
public static SingletonSafe getInstance(){
return SingletonHolder.instance;
}
}
| [
"LANGYH,.10086"
] | LANGYH,.10086 |
7fd299fcdc1256e2f4dbba062334ec679837a612 | a4cbec62e29bcefebce8c73e96865b61d1860b3a | /src/main/java/methodoverloading/pub/ListOfGoodPubs.java | 4648f8523dcd1e17f4b19817a4678c6558d5368e | [] | no_license | gergo-kovacs/training-solutions | 6ea75d8bd7866e3f93734fdba3bcc4dfbb40d705 | 2d970fd4bd2f8484167ba1b13634fa302c0f3a01 | refs/heads/master | 2023-03-10T22:00:45.157986 | 2021-02-24T18:36:06 | 2021-02-24T18:36:06 | 308,281,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package methodoverloading.pub;
import methodoverloading.Time;
import java.util.List;
public class ListOfGoodPubs {
public List<Pub> pubList;
public ListOfGoodPubs(List<Pub> pubList) {
if(isEmpty(pubList)){
throw new IllegalArgumentException("Pub list is empty!");
}
this.pubList = pubList;
}
public Pub findTheBest(){
Time earlier = new Time(24,59);
for (int i = 0; i < pubList.size(); i++) {
if(pubList.get(i).getOpenFrom().isEarlier(earlier)){
earlier=pubList.get(i).getOpenFrom();
}
}
int index=0;
for (int i = 0; i < pubList.size(); i++) {
if(pubList.get(i).getOpenFrom().isEqual(earlier)){
index=i;
}
}
return pubList.get(index);
}
private boolean isEmpty(List<Pub> pubs){
return pubs == null || pubs.size()<1;
}
}
| [
"[email protected]"
] | |
281d5eacdebbc59a716b8778e80400879edf3a0e | 00ca60a3d470c3b2e5bb89a8efbfb24e4316375e | /service/src/test/java/com/epam/esm/service/impl/OrderServiceTest.java | 4cc0e711b9aad47959f5e7777466fcbbcfc88545 | [] | no_license | frikki84/MJC_School_Module03 | 6bf59c22874450820f44d5a09f4760ee9555a161 | 640c02a28aa9b5ccbbc5b4bfd5c7060f5e116d96 | refs/heads/master | 2023-06-10T05:09:39.463775 | 2021-07-07T10:54:03 | 2021-07-07T10:54:03 | 338,883,354 | 0 | 0 | null | 2021-07-07T10:54:04 | 2021-02-14T19:22:33 | null | UTF-8 | Java | false | false | 5,910 | java | package com.epam.esm.service.impl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import com.epam.esm.entity.GiftCertificate;
import com.epam.esm.entity.GiftCertificateDto;
import com.epam.esm.entity.Order;
import com.epam.esm.entity.OrderCreationParameter;
import com.epam.esm.entity.OrderDto;
import com.epam.esm.entity.User;
import com.epam.esm.repository.GiftCertificateRepository;
import com.epam.esm.repository.OrderRepository;
import com.epam.esm.repository.UserRepository;
import com.epam.esm.service.OrderService;
import com.epam.esm.service.exception.CustomErrorCode;
import com.epam.esm.service.exception.NoSuchResourceException;
import com.epam.esm.service.mapper.OrderDtoMapper;
import com.epam.esm.service.validation.PageInfoValidation;
@ExtendWith(MockitoExtension.class)
class OrderServiceTest {
@Mock
private OrderRepository orderRepository;
@Mock
private OrderDtoMapper orderMapper;
@Mock
private UserRepository userRepository;
@Mock
private GiftCertificateRepository certificateRepository;
@Mock
private PageInfoValidation pageInfoValidation;
@InjectMocks
private OrderService orderService;
public static final int OFFSET = 10;
public static final int LIMIT = 10;
public static final long ID = 1L;
@Test
void findAll() {
Mockito.when(pageInfoValidation.checkPageInfo(OFFSET, LIMIT, CustomErrorCode.TAG)).thenReturn(true);
}
@Test
void findByIdPositive() {
Order order = new Order();
OrderDto orderDto = new OrderDto();
Mockito.when(orderMapper.chandeOrderToDto(order)).thenReturn(orderDto);
Mockito.when(orderRepository.findById(ID)).thenReturn(order);
assertEquals(orderDto, orderService.findById(ID));
}
@Test
void findByIdNegative() {
Mockito.when(orderRepository.findById(ID)).thenThrow(NoSuchResourceException.class);
assertThrows(NoSuchResourceException.class, () -> orderService.findById(ID));
}
@Test
void create() {
GiftCertificateDto giftCertificateDto = new GiftCertificateDto();
OrderCreationParameter parameter = new OrderCreationParameter();
parameter.setUserId(ID);
parameter.setCertificateDtos(Arrays.asList(1));
Order order = new Order();
OrderDto orderDto = new OrderDto();
User user = new User();
GiftCertificate certificate = new GiftCertificate();
certificate.setPrice(new BigDecimal(1));
Mockito.when(userRepository.findById(ID)).thenReturn(user);
Mockito.when(certificateRepository.findById(ID)).thenReturn(certificate);
Mockito.when(orderMapper.chandeOrderToDto(orderRepository.create(order))).thenReturn(orderDto);
assertEquals(orderDto, orderService.create(parameter));
}
@Test
void createNegativeNoUser() {
GiftCertificateDto giftCertificateDto = new GiftCertificateDto();
OrderCreationParameter parameter = new OrderCreationParameter();
parameter.setUserId(ID);
parameter.setCertificateDtos(Arrays.asList(1));
Order order = new Order();
OrderDto orderDto = new OrderDto();
User user = new User();
GiftCertificate certificate = new GiftCertificate();
certificate.setPrice(new BigDecimal(1));
Mockito.when(userRepository.findById(ID)).thenReturn(null);
assertThrows(NoSuchResourceException.class, () -> orderService.create(parameter));
}
@Test
void createNegativeNoCertificate() {
GiftCertificateDto giftCertificateDto = new GiftCertificateDto();
OrderCreationParameter parameter = new OrderCreationParameter();
parameter.setUserId(ID);
parameter.setCertificateDtos(Arrays.asList(1));
Order order = new Order();
OrderDto orderDto = new OrderDto();
User user = new User();
GiftCertificate certificate = new GiftCertificate();
certificate.setPrice(new BigDecimal(1));
Mockito.when(userRepository.findById(ID)).thenReturn(user);
Mockito.when(certificateRepository.findById(ID)).thenReturn(null);
assertThrows(NoSuchResourceException.class, () -> orderService.create(parameter));
}
@Test
void deletePositive() {
Mockito.when(orderRepository.delete(ID)).thenReturn(ID);
assertEquals(ID, orderService.delete(ID));
}
@Test
void deleteNegative() {
Mockito.when(orderRepository.delete(ID)).thenThrow(RuntimeException.class);
assertThrows(NoSuchResourceException.class, () -> orderService.delete(ID));
}
@Test
void findNumberOfEntities() {
Mockito.when(orderRepository.findNumberOfEntities()).thenReturn(ID);
assertEquals(ID, orderService.findNumberOfEntities());
}
@Test
void readOrdersByUserPositive() {
Order order = new Order();
OrderDto orderDto = new OrderDto();
List<Order> orderList = Arrays.asList(order);
List<OrderDto> dtoList = Arrays.asList(orderDto);
Mockito.when(orderRepository.readOrdersByUser(ID)).thenReturn(orderList);
Mockito.when(orderMapper.chandeOrderToDto(order)).thenReturn(orderDto);
assertEquals(dtoList, orderService.readOrdersByUser(ID));
}
@Test
void readOrdersByUserNegative() {
Mockito.when(orderRepository.readOrdersByUser(ID)).thenReturn(new ArrayList<Order>());
assertThrows(NoSuchResourceException.class, () -> orderService.readOrdersByUser(ID));
}
} | [
"[email protected]"
] | |
0d8852cd72e847e3e25b1f10a426f7119824d993 | 7d0693e354b75c3ff8656f2ff75e5f47baeaeeac | /app/src/main/java/com/bbm/foodservice/dishes/Salads/Coban.java | b3bf72f55e0d91d06cd5f4748a7fca067e370ce4 | [] | no_license | BatuhanHU/FoodService | 669d837f1d92c85c58a3c174fb1234ab8a9086df | e79d5298554fdf0849ec38d8f62d5f0ef0c831bc | refs/heads/master | 2023-04-23T03:35:31.064781 | 2021-05-07T01:30:36 | 2021-05-07T01:30:36 | 360,956,723 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package com.bbm.foodservice.dishes.Salads;
public class Coban extends Salads{
public Coban(){
super.setName("Coban Salad");
}
@Override
public void addIngredients() {
super.setIngredients("Domates");
super.setIngredients("Marul");
super.setIngredients("Salatalık");
super.setIngredients("Sogan");
super.setIngredients("Limon");
}
@Override
public void cookTime() {
super.setTime(10);
}
@Override
public void calculateCost() {
super.setCost(13);
}
@Override
public void prepareToServe() {
super.setPreparing(true);
}
}
| [
"[email protected]"
] | |
b995f9c655331148579b9b1ee68e44aeb50d104d | 5757001c341ecf6242956516f9ee4f4c7f3be3d9 | /controller/springhomework/src/main/java/io/mikaila/springhomework/SpringhomeworkApplication.java | ff30909aab0dfb7811be2e80e78cb48dd7c9701f | [] | no_license | MikailaAkeredolu/CJEmployee | 31e747f534cf165ade60a15aef864e3fa29ad109 | 0d7bc90fc4920123f4c03719d183ca2e7bfea712 | refs/heads/master | 2021-05-08T13:15:08.239725 | 2018-02-17T18:34:59 | 2018-02-17T18:34:59 | 120,004,356 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package io.mikaila.springhomework;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringhomeworkApplication {
public static void main(String[] args) {
SpringApplication.run(SpringhomeworkApplication.class, args);
}
}
| [
"[email protected]"
] | |
7f335a923379d92eb1c2d4bb7872f53ce410f877 | 2cbeb4a68701161ddb78ca0153d9af72c02d5464 | /global/build/generated/source/r/debug/android/support/customview/R.java | 5ec224f4f8361d4528934e4d9b2d45af5d47c71c | [] | no_license | lovewiny7/WeiXiangParking2 | 64a664ae6dd095d34077d9c8cdbf6ab8b45ea5a8 | 08605be0d9945706b2ad9c0e4f9eb290fa3a6566 | refs/heads/master | 2020-09-24T16:27:30.400574 | 2019-12-24T08:14:45 | 2019-12-24T08:14:45 | 225,796,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,385 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.customview;
public final class R {
public static final class attr {
public static int alpha = 0x7f040030;
public static int font = 0x7f040105;
public static int fontProviderAuthority = 0x7f040108;
public static int fontProviderCerts = 0x7f040109;
public static int fontProviderFetchStrategy = 0x7f04010a;
public static int fontProviderFetchTimeout = 0x7f04010b;
public static int fontProviderPackage = 0x7f04010c;
public static int fontProviderQuery = 0x7f04010d;
public static int fontStyle = 0x7f04010e;
public static int fontVariationSettings = 0x7f04010f;
public static int fontWeight = 0x7f040110;
public static int ttcIndex = 0x7f040255;
}
public static final class color {
public static int notification_action_color_filter = 0x7f0600a2;
public static int notification_icon_bg_color = 0x7f0600a3;
public static int ripple_material_light = 0x7f0600c8;
public static int secondary_text_default_material_light = 0x7f0600ca;
}
public static final class dimen {
public static int compat_button_inset_horizontal_material = 0x7f080050;
public static int compat_button_inset_vertical_material = 0x7f080051;
public static int compat_button_padding_horizontal_material = 0x7f080052;
public static int compat_button_padding_vertical_material = 0x7f080053;
public static int compat_control_corner_material = 0x7f080054;
public static int compat_notification_large_icon_max_height = 0x7f080055;
public static int compat_notification_large_icon_max_width = 0x7f080056;
public static int notification_action_icon_size = 0x7f0800d1;
public static int notification_action_text_size = 0x7f0800d2;
public static int notification_big_circle_margin = 0x7f0800d3;
public static int notification_content_margin_start = 0x7f0800d4;
public static int notification_large_icon_height = 0x7f0800d5;
public static int notification_large_icon_width = 0x7f0800d6;
public static int notification_main_column_padding_top = 0x7f0800d7;
public static int notification_media_narrow_margin = 0x7f0800d8;
public static int notification_right_icon_size = 0x7f0800d9;
public static int notification_right_side_padding_top = 0x7f0800da;
public static int notification_small_icon_background_padding = 0x7f0800db;
public static int notification_small_icon_size_as_large = 0x7f0800dc;
public static int notification_subtext_size = 0x7f0800dd;
public static int notification_top_pad = 0x7f0800de;
public static int notification_top_pad_large_text = 0x7f0800df;
}
public static final class drawable {
public static int notification_action_background = 0x7f090071;
public static int notification_bg = 0x7f090072;
public static int notification_bg_low = 0x7f090073;
public static int notification_bg_low_normal = 0x7f090074;
public static int notification_bg_low_pressed = 0x7f090075;
public static int notification_bg_normal = 0x7f090076;
public static int notification_bg_normal_pressed = 0x7f090077;
public static int notification_icon_background = 0x7f090078;
public static int notification_template_icon_bg = 0x7f090079;
public static int notification_template_icon_low_bg = 0x7f09007a;
public static int notification_tile_bg = 0x7f09007b;
public static int notify_panel_notification_icon_bg = 0x7f09007c;
}
public static final class id {
public static int action_container = 0x7f0c000d;
public static int action_divider = 0x7f0c000f;
public static int action_image = 0x7f0c0010;
public static int action_text = 0x7f0c0016;
public static int actions = 0x7f0c0017;
public static int async = 0x7f0c001d;
public static int blocking = 0x7f0c0020;
public static int chronometer = 0x7f0c0034;
public static int forever = 0x7f0c005a;
public static int icon = 0x7f0c0064;
public static int icon_group = 0x7f0c0065;
public static int info = 0x7f0c0068;
public static int italic = 0x7f0c006a;
public static int line1 = 0x7f0c0089;
public static int line3 = 0x7f0c008a;
public static int normal = 0x7f0c00af;
public static int notification_background = 0x7f0c00b0;
public static int notification_main_column = 0x7f0c00b1;
public static int notification_main_column_container = 0x7f0c00b2;
public static int right_icon = 0x7f0c00d5;
public static int right_side = 0x7f0c00d6;
public static int tag_transition_group = 0x7f0c010a;
public static int tag_unhandled_key_event_manager = 0x7f0c010b;
public static int tag_unhandled_key_listeners = 0x7f0c010c;
public static int text = 0x7f0c010d;
public static int text2 = 0x7f0c010e;
public static int time = 0x7f0c0116;
public static int title = 0x7f0c0118;
}
public static final class integer {
public static int status_bar_notification_info_maxnum = 0x7f0d0016;
}
public static final class layout {
public static int notification_action = 0x7f0f0053;
public static int notification_action_tombstone = 0x7f0f0054;
public static int notification_template_custom_big = 0x7f0f005b;
public static int notification_template_icon_group = 0x7f0f005c;
public static int notification_template_part_chronometer = 0x7f0f0060;
public static int notification_template_part_time = 0x7f0f0061;
}
public static final class string {
public static int status_bar_notification_info_overflow = 0x7f1500c0;
}
public static final class style {
public static int TextAppearance_Compat_Notification = 0x7f160147;
public static int TextAppearance_Compat_Notification_Info = 0x7f160148;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f160149;
public static int TextAppearance_Compat_Notification_Time = 0x7f16014a;
public static int TextAppearance_Compat_Notification_Title = 0x7f16014b;
public static int Widget_Compat_NotificationActionContainer = 0x7f1601f9;
public static int Widget_Compat_NotificationActionText = 0x7f1601fa;
}
public static final class styleable {
public static int[] ColorStateListItem = { 0x7f040030, 0x0101031f, 0x010101a5 };
public static int ColorStateListItem_alpha = 0;
public static int ColorStateListItem_android_alpha = 1;
public static int ColorStateListItem_android_color = 2;
public static int[] FontFamily = { 0x7f040108, 0x7f040109, 0x7f04010a, 0x7f04010b, 0x7f04010c, 0x7f04010d };
public static int FontFamily_fontProviderAuthority = 0;
public static int FontFamily_fontProviderCerts = 1;
public static int FontFamily_fontProviderFetchStrategy = 2;
public static int FontFamily_fontProviderFetchTimeout = 3;
public static int FontFamily_fontProviderPackage = 4;
public static int FontFamily_fontProviderQuery = 5;
public static int[] FontFamilyFont = { 0x01010532, 0x0101053f, 0x01010570, 0x01010533, 0x0101056f, 0x7f040105, 0x7f04010e, 0x7f04010f, 0x7f040110, 0x7f040255 };
public static int FontFamilyFont_android_font = 0;
public static int FontFamilyFont_android_fontStyle = 1;
public static int FontFamilyFont_android_fontVariationSettings = 2;
public static int FontFamilyFont_android_fontWeight = 3;
public static int FontFamilyFont_android_ttcIndex = 4;
public static int FontFamilyFont_font = 5;
public static int FontFamilyFont_fontStyle = 6;
public static int FontFamilyFont_fontVariationSettings = 7;
public static int FontFamilyFont_fontWeight = 8;
public static int FontFamilyFont_ttcIndex = 9;
public static int[] GradientColor = { 0x0101020b, 0x010101a2, 0x010101a3, 0x0101019e, 0x01010512, 0x01010513, 0x010101a4, 0x0101019d, 0x01010510, 0x01010511, 0x01010201, 0x010101a1 };
public static int GradientColor_android_centerColor = 0;
public static int GradientColor_android_centerX = 1;
public static int GradientColor_android_centerY = 2;
public static int GradientColor_android_endColor = 3;
public static int GradientColor_android_endX = 4;
public static int GradientColor_android_endY = 5;
public static int GradientColor_android_gradientRadius = 6;
public static int GradientColor_android_startColor = 7;
public static int GradientColor_android_startX = 8;
public static int GradientColor_android_startY = 9;
public static int GradientColor_android_tileMode = 10;
public static int GradientColor_android_type = 11;
public static int[] GradientColorItem = { 0x010101a5, 0x01010514 };
public static int GradientColorItem_android_color = 0;
public static int GradientColorItem_android_offset = 1;
}
}
| [
"[email protected]"
] | |
4482693d2054464f4644c8a5c158e53be63d9ec1 | 55525574e4ebb2b742b83d5faf5cc1977a350996 | /src/main/database/EventTable.java | 774ef2a4a85b8bbb5a9cc0d2106c002d9d24d215 | [] | no_license | Distribuerede-Systemer-2017/STFU | 1050cf07a7b19b79316f102e106b1944101d06de | ab877273fb01b44a8addf2a838f708a32ef5f8b7 | refs/heads/master | 2021-07-15T01:19:43.636314 | 2017-10-17T13:46:15 | 2017-10-17T13:46:15 | 104,979,557 | 1 | 12 | null | 2017-10-17T13:46:18 | 2017-09-27T06:15:24 | Java | UTF-8 | Java | false | false | 52 | java | package main.database;
public class EventTable {
}
| [
"[email protected]"
] | |
d5f0840abb04352141e38736166a5dd6f8a11260 | 4382e8fba417a43f753da3bc4c5a0478dc7dc9a8 | /src/main/java/de/othr/sw/lagerhauskarl/service/KundenService.java | 1626a2110140a49edb93ed2f5b02dfb0958ff52d | [] | no_license | christian1karl/LagerverwaltungOTH | 6acf3c8c38157d6b6271574f8785c89801df2f97 | f6e9caec17d7cbbb971ccd80f41ba2165c0b2c65 | refs/heads/master | 2021-09-04T12:04:37.959767 | 2018-01-18T15:20:00 | 2018-01-18T15:20:00 | 113,575,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,537 | java | package de.othr.sw.lagerhauskarl.service;
import de.othr.sw.lagerhauskarl.entity.Kunde;
import java.util.List;
import java.util.Random;
import javax.enterprise.context.RequestScoped;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
@RequestScoped
public class KundenService {
@PersistenceContext
private EntityManager em;
@Transactional
public Kunde registrieren(Kunde k)
{
k.setKundennummer(new Random().nextInt(9999999));
em.persist(k);
return k;
}
public Kunde einloggen(String benutzername, String passwort)
{
try{
Query query = em.createQuery("SELECT c FROM Kunde c WHERE c.benutzername like:benutzername and c.passwort like:passwort)")
.setParameter("benutzername", benutzername)
.setParameter("passwort", passwort);
Kunde kunde = (Kunde)query.getSingleResult();
return kunde;
}
catch(NoResultException ex)
{
return null;
}
}
public Kunde lesePerson (int personenNummer)
{
Kunde gefunden = em.find(Kunde.class, personenNummer);
return gefunden;
}
public List<Kunde> leseAllePersonen ()
{
Query query = em.createQuery("SELECT t FROM Person ");
return (List<Kunde>) query.getResultList();
}
}
| [
"[email protected]_W_724V_Typ_A_05011603_05_020"
] | [email protected]_W_724V_Typ_A_05011603_05_020 |
de0b26895a372aeeb94a696284da42f18809f74e | 7b862a10aa5f8d734c4faa40eed8a51573d58d4a | /src/main/java/com/paltaie/gttp/model/Thing.java | c3b99004aa0d36d0114225031ee3bb503c616813 | [] | no_license | shilang/gttp | ec15db3dc48a7d93f1a00e81ef4ae14437122453 | 327f0a3a7c2d862f6eabcf97eebdc12a5d0bd8bc | refs/heads/master | 2021-01-15T21:34:21.869336 | 2015-11-01T00:28:46 | 2015-11-01T00:28:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.paltaie.gttp.model;
public class Thing {
private String kind;
private Data data;
public String getKind() {
return kind;
}
public void setKind(String kind) {
this.kind = kind;
}
public Data getData() {
return data;
}
public void setData(Data data) {
this.data = data;
}
}
| [
"[email protected]"
] | |
71e1038676e5c6be58256e5283b4cf72e48663b0 | eed6be5b50e419f1b96b9a4537ea966252bd677a | /cxf-skeleton/src/main/java/com/generated/ws/EmployeeService_Service.java | aa4a37f0a6d74ff993ebc4391316e8d3ee104c44 | [] | no_license | leoadnan/WebServices | 57bb0ef1d1c0af94521da637d6792348c7a8771b | ac3f5469623242268799cd19ca88593ee876c00d | refs/heads/master | 2021-01-10T08:40:00.518635 | 2016-01-23T17:50:55 | 2016-01-23T17:50:55 | 46,727,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,642 | java |
/*
*
*/
package com.generated.ws;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 2.2.3
* Thu Sep 12 11:42:26 PDT 2013
* Generated source version: 2.2.3
*
*/
@WebServiceClient(name = "employeeService",
wsdlLocation = "file:/C:/Users/aahmed.NETPACE/Documents/NetBeansProjects/cxf-skeleton/src/main/webapp/WEB-INF/employee.wsdl",
targetNamespace = "http://ws.generated.com/")
public class EmployeeService_Service extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://ws.generated.com/", "employeeService");
public final static QName EmployeeServiceImplPort = new QName("http://ws.generated.com/", "EmployeeServiceImplPort");
static {
URL url = null;
try {
url = new URL("file:/C:/Users/aahmed.NETPACE/Documents/NetBeansProjects/cxf-skeleton/src/main/webapp/WEB-INF/employee.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from file:/C:/Users/aahmed.NETPACE/Documents/NetBeansProjects/cxf-skeleton/src/main/webapp/WEB-INF/employee.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
}
public EmployeeService_Service(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public EmployeeService_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public EmployeeService_Service() {
super(WSDL_LOCATION, SERVICE);
}
/**
*
* @return
* returns EmployeeService
*/
@WebEndpoint(name = "EmployeeServiceImplPort")
public EmployeeService getEmployeeServiceImplPort() {
return super.getPort(EmployeeServiceImplPort, EmployeeService.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns EmployeeService
*/
@WebEndpoint(name = "EmployeeServiceImplPort")
public EmployeeService getEmployeeServiceImplPort(WebServiceFeature... features) {
return super.getPort(EmployeeServiceImplPort, EmployeeService.class, features);
}
}
| [
"[email protected]"
] | |
55840ed1519a783032123ebc4d1ebe1fb4bd0e28 | b4db3a40fcf43d704c036088d90ade5d0b422aca | /bridge/src/main/java/com/ntlimited/netty/hue/command/CommandVerbs.java | db66b46d022681d7d113804f3d44b8f06b214d69 | [] | no_license | ntlimited/spinput | e0aee84dfefeb9237192f5bc6eb4fabfb7c8a8a3 | 0a3144cbf986c5bf0e096baf9d58b51f793d0f76 | refs/heads/master | 2021-01-21T13:53:05.230377 | 2014-05-22T20:17:42 | 2014-05-22T20:17:42 | 20,075,571 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package com.ntlimited.netty.hue.command;
public enum CommandVerbs
{
GET,
PUT,
POST,
DELETE
};
| [
"[email protected]"
] | |
3b457ca386a9c27fb6000efa962211a78e1d4d7f | 1157f3620008b43fc3423b188efa28105bb54cd8 | /app/src/main/java/com/shivenderkumar/groupchatapp/Message.java | 9cfdfe6a0b5784d5fbe09464394177c7495e76ee | [] | no_license | shivenderkumar/GroupChatAndroid | 9eaf30b86077498a93a96d4c5f44f026680a149e | 08fca1273e591b6bde3f912dba4d618045c4c5b8 | refs/heads/master | 2020-12-20T16:38:13.573800 | 2020-01-26T12:36:41 | 2020-01-26T12:36:41 | 236,139,776 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | package com.shivenderkumar.groupchatapp;
public class Message {
public static final int TYPE_MESSAGE = 0;
public static final int TYPE_LOG = 1;
public static final int TYPE_ACTION = 2;
private int mType;
private String mMessage;
private String mUsername;
private Message() {}
public int getType() {
return mType;
};
public String getMessage() {
return mMessage;
};
public String getUsername() {
return mUsername;
};
public static class Builder {
private final int mType;
private String mUsername;
private String mMessage;
public Builder(int type) {
mType = type;
}
public Builder username(String username) {
mUsername = username;
return this;
}
public Builder message(String message) {
mMessage = message;
return this;
}
public Message build() {
Message message = new Message();
message.mType = mType;
message.mUsername = mUsername;
message.mMessage = mMessage;
return message;
}
}
}
| [
"[email protected]"
] | |
359c0b941074432726fdb79db184b722ee2efb98 | 3b2dfd7cf2b63a89ae2e83e73a2dfbb846909169 | /UserIntefaz.java | 3d2e598ff973a72f2f99b722de5bba2b5fbecfa7 | [] | no_license | felro755/android_arduinoBT | 956f8af2695900a745c79ce84b572588e386ee86 | 2a38aee83d495e20cdcba52a64cb64a9af6f957e | refs/heads/master | 2021-04-28T07:04:25.562104 | 2018-02-20T15:46:19 | 2018-02-20T15:46:19 | 122,216,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,741 | java | //UserIntefaz.java
package com.innovadomotics.controlbt;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
public class UserInterfaz extends AppCompatActivity {
//1)
Button IdEncender, IdApagar,IdDesconectar;
TextView IdBufferIn;
//-------------------------------------------
Handler bluetoothIn;
final int handlerState = 0;
private BluetoothAdapter btAdapter = null;
private BluetoothSocket btSocket = null;
private StringBuilder DataStringIN = new StringBuilder();
private ConnectedThread MyConexionBT;
// Identificador unico de servicio - SPP UUID
private static final UUID BTMODULEUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
// String para la direccion MAC
private static String address = null;
//-------------------------------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_interfaz);
//2)
//Enlaza los controles con sus respectivas vistas
IdEncender = (Button) findViewById(R.id.IdEncender);
IdApagar = (Button) findViewById(R.id.IdApagar);
IdDesconectar = (Button) findViewById(R.id.IdDesconectar);
IdBufferIn = (TextView) findViewById(R.id.IdBufferIn);
bluetoothIn = new Handler() {
public void handleMessage(android.os.Message msg) {
if (msg.what == handlerState) {
String readMessage = (String) msg.obj;
DataStringIN.append(readMessage);
int endOfLineIndex = DataStringIN.indexOf("#");
if (endOfLineIndex > 0) {
String dataInPrint = DataStringIN.substring(0, endOfLineIndex);
IdBufferIn.setText("Dato: " + dataInPrint);//<-<- PARTE A MODIFICAR >->->
DataStringIN.delete(0, DataStringIN.length());
}
}
}
};
btAdapter = BluetoothAdapter.getDefaultAdapter(); // get Bluetooth adapter
VerificarEstadoBT();
// Configuracion onClick listeners para los botones
// para indicar que se realizara cuando se detecte
// el evento de Click
IdEncender.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
MyConexionBT.write("1");
}
});
IdApagar.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
MyConexionBT.write("0");
}
});
IdDesconectar.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (btSocket!=null)
{
try {btSocket.close();}
catch (IOException e)
{ Toast.makeText(getBaseContext(), "Error", Toast.LENGTH_SHORT).show();;}
}
finish();
}
});
}
private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException
{
//crea un conexion de salida segura para el dispositivo
//usando el servicio UUID
return device.createRfcommSocketToServiceRecord(BTMODULEUUID);
}
@Override
public void onResume()
{
super.onResume();
//Consigue la direccion MAC desde DeviceListActivity via intent
Intent intent = getIntent();
//Consigue la direccion MAC desde DeviceListActivity via EXTRA
address = intent.getStringExtra(DispositivosBT.EXTRA_DEVICE_ADDRESS);//<-<- PARTE A MODIFICAR >->->
//Setea la direccion MAC
BluetoothDevice device = btAdapter.getRemoteDevice(address);
try
{
btSocket = createBluetoothSocket(device);
} catch (IOException e) {
Toast.makeText(getBaseContext(), "La creacción del Socket fallo", Toast.LENGTH_LONG).show();
}
// Establece la conexión con el socket Bluetooth.
try
{
btSocket.connect();
} catch (IOException e) {
try {
btSocket.close();
} catch (IOException e2) {}
}
MyConexionBT = new ConnectedThread(btSocket);
MyConexionBT.start();
}
@Override
public void onPause()
{
super.onPause();
try
{ // Cuando se sale de la aplicación esta parte permite
// que no se deje abierto el socket
btSocket.close();
} catch (IOException e2) {}
}
//Comprueba que el dispositivo Bluetooth Bluetooth está disponible y solicita que se active si está desactivado
private void VerificarEstadoBT() {
if(btAdapter==null) {
Toast.makeText(getBaseContext(), "El dispositivo no soporta bluetooth", Toast.LENGTH_LONG).show();
} else {
if (btAdapter.isEnabled()) {
} else {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, 1);
}
}
}
//Crea la clase que permite crear el evento de conexion
private class ConnectedThread extends Thread
{
private final InputStream mmInStream;
private final OutputStream mmOutStream;
public ConnectedThread(BluetoothSocket socket)
{
InputStream tmpIn = null;
OutputStream tmpOut = null;
try
{
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) { }
mmInStream = tmpIn;
mmOutStream = tmpOut;
}
public void run()
{
byte[] buffer = new byte[256];
int bytes;
// Se mantiene en modo escucha para determinar el ingreso de datos
while (true) {
try {
bytes = mmInStream.read(buffer);
String readMessage = new String(buffer, 0, bytes);
// Envia los datos obtenidos hacia el evento via handler
bluetoothIn.obtainMessage(handlerState, bytes, -1, readMessage).sendToTarget();
} catch (IOException e) {
break;
}
}
}
//Envio de trama
public void write(String input)
{
try {
mmOutStream.write(input.getBytes());
}
catch (IOException e)
{
//si no es posible enviar datos se cierra la conexión
Toast.makeText(getBaseContext(), "La Conexión fallo", Toast.LENGTH_LONG).show();
finish();
}
}
}
} | [
"[email protected]"
] | |
b2e376a55a59c6bf21fe04a06f9ee6398822911e | e5e081b65406bcbedb4b88d427bfdd9f4178b7a0 | /src/main/java/com/example/demo/com/demo/Along.java | 1424214ffb0d3636a6a264011c769955a9220e1e | [] | no_license | myalong/mya | 9b016219971354237cc85f6d610fc63dc2e028a2 | e9ccf119b97b88994a61be8367c19fadde9e741d | refs/heads/master | 2020-03-22T21:49:15.429174 | 2019-09-19T07:24:09 | 2019-09-19T07:24:09 | 140,715,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package com.example.demo.com.demo;
public class Along {
public void add(){
System.out.println("demo 3");
}
}
| [
"[email protected]"
] | |
6b5658ea27a8dd5bf9d963f2b5e92c494046b8f1 | a5ee77f4b024bc17d4e6f4ec15f53cd9f5054613 | /src/main/java/com/labMicWiki/dto/ContentDto.java | c6443743af35fba4337b419edd2f1c713ab6f82c | [] | no_license | severVadim/LabMicWiki | 507de2e9571144b0b74f32f26548e61b3d7c0918 | f93df59270bdc6f55ad22e93f6009bcdd0351288 | refs/heads/master | 2021-08-20T07:37:33.174057 | 2017-11-28T15:01:47 | 2017-11-28T15:01:47 | 112,322,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,149 | java | package com.labMicWiki.dto;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class ContentDto {
private Long id;
private String articleName;
private Long catalogId;
private String catalogName;
private String content;
private String datetime;
public String getContent() {
return content;
}
public void setDatetime(Date datetime) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy HH:mm", Locale.US);
this.datetime = dateFormat.format(datetime);;
}
public void setContent(String content) {
this.content = content;
}
public String getDatetime() {
return datetime;
}
public String getArticleName() {
return articleName;
}
public void setArticleName(String articleName) {
this.articleName = articleName;
}
public String getCatalogName() {
return catalogName;
}
public void setCatalogName(String catalogName) {
this.catalogName = catalogName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCatalogId() {
return catalogId;
}
public void setCatalogId(Long catalogId) {
this.catalogId = catalogId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((articleName == null) ? 0 : articleName.hashCode());
result = prime * result
+ ((catalogId == null) ? 0 : catalogId.hashCode());
result = prime * result
+ ((catalogName == null) ? 0 : catalogName.hashCode());
result = prime * result + ((content == null) ? 0 : content.hashCode());
result = prime * result
+ ((datetime == null) ? 0 : datetime.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ContentDto other = (ContentDto) obj;
if (articleName == null) {
if (other.articleName != null)
return false;
} else if (!articleName.equals(other.articleName))
return false;
if (catalogId == null) {
if (other.catalogId != null)
return false;
} else if (!catalogId.equals(other.catalogId))
return false;
if (catalogName == null) {
if (other.catalogName != null)
return false;
} else if (!catalogName.equals(other.catalogName))
return false;
if (content == null) {
if (other.content != null)
return false;
} else if (!content.equals(other.content))
return false;
if (datetime == null) {
if (other.datetime != null)
return false;
} else if (!datetime.equals(other.datetime))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "ContentDto [id=" + id + ", articleName=" + articleName
+ ", catalogId=" + catalogId + ", catalogName=" + catalogName
+ ", content=" + content + ", datetime=" + datetime + "]";
}
} | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.