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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f08ec8bcad70e42cf05a4a9e0999508062825cf | d15058fec18f4cd2c4d869f6a5e2fb5116215eb3 | /src/main/java/com/tranzvision/gd/workflow/engine/TzWflCalendar.java | 92d91c0a62c09d20eadbaeb2e49ddd7cdd5bb6bc | [] | no_license | YujunWu-King/university | 1c08118d753c870f4c3fa410f7127d910a4e3f2d | bac7c919f537153025bec9de2942f0c9890d1b7a | refs/heads/BaseLocal | 2022-12-26T19:51:20.994957 | 2019-12-30T11:38:20 | 2019-12-30T11:38:20 | 231,065,763 | 0 | 0 | null | 2022-12-16T06:34:06 | 2019-12-31T09:43:56 | Java | UTF-8 | Java | false | false | 5,742 | java | package com.tranzvision.gd.workflow.engine;
import com.tranzvision.gd.util.base.GetSpringBeanUtil;
import com.tranzvision.gd.util.base.TzException;
import com.tranzvision.gd.util.sql.SqlQuery;
import com.tranzvision.gd.util.sql.TZGDObject;
import com.tranzvision.gd.util.sql.type.TzRecord;
import org.apache.log4j.Logger;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* 日历本
* @author 张浪
*
*/
public class TzWflCalendar {
private TZGDObject tzGDObject;
private SqlQuery sqlQuery;
private String m_CalendarID;
private TzRecord m_CalendarCfgRecord;
//记录日志
private static final Logger logger = Logger.getLogger("WorkflowEngine");
public String getM_CalendarID() {
return m_CalendarID;
}
public void setM_CalendarID(String m_CalendarID) {
this.m_CalendarID = m_CalendarID;
}
public TzRecord getM_CalendarCfgRecord() {
return m_CalendarCfgRecord;
}
public void setM_CalendarCfgRecord(TzRecord m_CalendarCfgRecord) {
this.m_CalendarCfgRecord = m_CalendarCfgRecord;
}
/**
* 构造函数
* @param m_CalendarID
*/
public TzWflCalendar(String m_CalendarID) {
GetSpringBeanUtil getSpringBeanUtil = new GetSpringBeanUtil();
tzGDObject = (TZGDObject) getSpringBeanUtil.getAutowiredSpringBean("TZGDObject");
sqlQuery = (SqlQuery) getSpringBeanUtil.getAutowiredSpringBean("SqlQuery");
this.m_CalendarID = m_CalendarID;
//获取工作流业务类别配置信息
TzRecord calendar_Record = null;
try {
calendar_Record = tzGDObject.createRecord("tzms_calendar_tBase");
calendar_Record.setColumnValue("tzms_calendar_tid", m_CalendarID, true);
if(calendar_Record.selectByKey() == false){
logger.error("获取日历本定义失败");
throw new TzException("获取日历本定义失败");
}
this.m_CalendarCfgRecord = calendar_Record;
} catch (TzException e) {
e.printStackTrace();
}
}
/**
* 日期天数加减
* @param date 要操作的日期
* @param dats 正数表示“加”,负数表示“减”
* @return
*/
private Date addToDate(Date date, int dats){
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_YEAR, dats);//日期加减
return calendar.getTime();
}
/**
* 是否工作日
* @param date
* @return
*/
private boolean IsWorkDay(Date date){
try{
if(date == null) {
return false;
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date _date = dateFormat.parse(dateFormat.format(date));
//根据日期类型判断是否工作日
String isWordDay = sqlQuery.queryForObject("select 'Y' FROM tzms_interval_days_tBase WHERE tzms_interval_date=? and tzms_spcdttype=2",
new Object[]{ _date }, "String");
if("Y".equals(isWordDay)) {
return true;
}
}catch(Exception e){
e.printStackTrace();
}
return false;
}
/**
* 判断指定日期是否计算
* @param rtnDate
* @return
*/
private boolean isDateCalculate(Date rtnDate) {
String exists = sqlQuery.queryForObject("select top 1 'Y' FROM tzms_interval_days_tBase WHERE tzms_interval_date=?",
new Object[]{ rtnDate }, "String");
if("Y".equals(exists)) {
return true;
}else {
return false;
}
}
/**
* 根据指定的日期时间返回可以开始计时的日期
* @param date
* @return
*/
public Date GetStartTimingDate(Date date){
Date rtnDate = null;
if(date == null){
date = new Date();
}
try{
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
String time = dateFormat.format(date);
SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
Date _date = dateFormat2.parse(dateFormat2.format(date));
//工作日计时结束时间
String wkdttime = m_CalendarCfgRecord.getTzString("tzms_wkdttime").getValue();
if(time.compareTo(wkdttime) <= 0){
rtnDate = _date;
}else{
rtnDate = this.addToDate(_date, 1);
}
while(this.IsWorkDay(rtnDate) == false){
if(this.isDateCalculate(rtnDate)) {
rtnDate = this.addToDate(rtnDate, -1);
}else {
rtnDate = null;
break;
}
}
}catch(Exception e){
e.printStackTrace();
}
return rtnDate;
}
/**
* 根据指定的日期返回截止计算日期, 如果日历本没有计算,直接返回开始日期加上工作日天数后的日期
* @param s_datetime 开始日期
* @param WorkDataNum 工作日天数
* @return
*/
public Date GetEndTimingDate(Date s_datetime, int WorkDataNum){
//获取开始计时日期
Date date = this.GetStartTimingDate(s_datetime);
//开始计时日期算第一天
if(WorkDataNum > 0) WorkDataNum --;
if(date == null) { //指定日期在日历本中没有计算
logger.info("指定日期【"+ s_datetime +"】在日历本中没有计算");
//直接返回指定日期加上工作日天数
return this.addToDate(s_datetime, WorkDataNum);
}else {
Integer days = sqlQuery.queryForObject("select tzms_interval_days from tzms_interval_days_t where tzms_calendar_uniqueid=? and tzms_interval_date=?",
new Object[]{ m_CalendarID, date }, "Integer");
if(days != null && days > 0){
days += WorkDataNum;
Date rtnDate = sqlQuery.queryForObject("select tzms_interval_date from tzms_interval_days_t where tzms_calendar_uniqueid=? and tzms_interval_days=? and tzms_spcdttype=2",
new Object[]{ m_CalendarID, days }, "Date");
if(rtnDate != null) {
return rtnDate;
}else {
//没有计算
return this.addToDate(s_datetime, WorkDataNum);
}
}else{
return this.addToDate(s_datetime, WorkDataNum);
}
}
}
}
| [
"[email protected]"
] | |
685678c00a370e0fd66c99c1ee49dd30f8cf9020 | c6bee9e89f512c7c7271dbbb1cc2aa8699ac0bcb | /MyBazarFrontEnd/src/main/java/com/niit/Controller/SupplierController.java | f9c5d05969ae8b04b1cc6adfe2cc7c7e9dbc541a | [] | no_license | Kratos028/Ecommerce-website | c0d9ddc468b34e72ab588a8732f7ccb45e2f0fc0 | 5602ad49b5d8c75f3fbc7c165cdabe9bb059e34c | refs/heads/master | 2022-12-21T07:17:28.122796 | 2020-05-10T14:25:39 | 2020-05-10T14:25:39 | 176,549,378 | 0 | 1 | null | 2022-12-16T09:42:42 | 2019-03-19T15:59:11 | Java | UTF-8 | Java | false | false | 2,882 | java | package com.niit.Controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.niit.DAO.SupplierDAO;
import com.niit.model.Products;
import com.niit.model.Supplier;
@Controller
public class SupplierController {
@Autowired
SupplierDAO supplierDAO;
boolean f = false;
@RequestMapping(value = "/suppliermanage")
public String showSupplier(Model m) {
f = false;
List<Supplier> listSupplier = supplierDAO.supplierCategories();
m.addAttribute("supplierlist", listSupplier);
m.addAttribute("flag", f);
return "Supplier";
}
@RequestMapping(value = "/insertSupplier", method = RequestMethod.POST)
public String insertSup(@RequestParam("suppliername") String name,
@RequestParam("supplierDesc") String supplierDesc, @RequestParam("supplieraddress") String address,
Model m) {
f = false;
Supplier sup = new Supplier();
sup.setDealer_Name(name);
sup.setDealer_desc(supplierDesc);
sup.setDealer_address(address);
supplierDAO.addSupplier(sup);
List<Supplier> listSupplier = supplierDAO.supplierCategories();
m.addAttribute("supplierlist", listSupplier);
m.addAttribute("flag", f);
return "redirect:/suppliermanage";
}
@RequestMapping("/deleteSupplier/{sup_id}")
public String deleteSup(@PathVariable("sup_id") int sup_id, Model m) {
f = false;
Supplier sup = supplierDAO.getSupplierById(sup_id);
supplierDAO.deleteSupplier(sup);
List<Supplier> listSupplier = supplierDAO.supplierCategories();
m.addAttribute("supplierlist", listSupplier);
m.addAttribute("flag", f);
return "redirect:/suppliermanage";
}
@RequestMapping("/editSupplier/{sup_id}")
public String editSup(@PathVariable("sup_id") int sup_id,Model m)
{
f=true;
Supplier sup=supplierDAO.getSupplierById(sup_id);
m.addAttribute("supplierlist", sup);
m.addAttribute("flag", f);
return "Supplier";
}
@RequestMapping(value="/updateSupplier",method=RequestMethod.POST)
public String updateSup(@RequestParam("sup_id")int sup_id,@RequestParam("suppliername")String name,@RequestParam("supplierDesc") String supplierDesc,@RequestParam("supplieraddress") String address,Model m)
{
f=false;
Supplier sup = supplierDAO.getSupplierById(sup_id);
sup.setDealer_Name(name);
sup.setDealer_desc(supplierDesc);
sup.setDealer_address(address);
supplierDAO.updateSupplier(sup);
List<Supplier> listSupplier = supplierDAO.supplierCategories();
m.addAttribute("supplierlist", listSupplier);
m.addAttribute("flag", f);
return "redirect:/suppliermanage";
}
}
| [
"[email protected]"
] | |
3797c74e351bab9dce0bfb73fbfe340c87e2898e | 87b4313f7e8ea055f074303550ee17c880f3c5c4 | /jdk6src/src/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java | 6df7eed2af0d40e1af8dcaa709cd25a368bb27ef | [] | no_license | my-src/myJdk6Src | 51984f32b3929cf16c38ad4fe49b304503ef4ff1 | 9340ca40ee89d3c764fc89c6c4d047e526f408b6 | refs/heads/master | 2021-01-11T19:57:54.947839 | 2017-05-10T02:57:45 | 2017-05-10T02:57:45 | 79,427,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 793 | java | /*
* @(#)file JDMHostTrap.java
* @(#)author Sun Microsystems, Inc.
* @(#)version 4.8
* @(#)date 06/11/01
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*/
/* Generated By:JJTree: Do not edit this line. JDMHostTrap.java */
package com.sun.jmx.snmp.IPAcl;
/**
* @version 4.8 11/17/05
* @author Sun Microsystems, Inc.
*/
class JDMHostTrap extends SimpleNode {
protected String name= "";
JDMHostTrap(int id) {
super(id);
}
JDMHostTrap(Parser p, int id) {
super(p, id);
}
public static Node jjtCreate(int id) {
return new JDMHostTrap(id);
}
public static Node jjtCreate(Parser p, int id) {
return new JDMHostTrap(p, id);
}
}
| [
"[email protected]"
] | |
b21b21d303da20a0ba54143e3c887f340bfab8d3 | 69e556125578e9ad245c8f23c703971bc3674817 | /protest/src/ex190516/CarMain.java | dacbe55f4033d1b84f2e6eef3d2e2090ae0506eb | [] | no_license | jinminwook/20190516- | c138edcad29f5f10b4224981eaf9876162e326b0 | cf7658451fecba289670c15ee1e78a4fe7bb0723 | refs/heads/master | 2020-05-23T21:58:57.850659 | 2019-05-17T07:42:51 | 2019-05-17T07:42:51 | 186,965,240 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 921 | java | package ex190516;
public class CarMain {
public static void main(String[] args) {
//a.sedan,truck에 대한 객체 각각 생성
Sedan nana = new Sedan(100,"빨간색");
nana.Color="빨간색";
Truck nene = new Truck(60,"은색",5);
nene.Color="검은색";
//b.sedan의 속도를 200,truck의 속도를 100으로 올림.
nana.sp(100);
nene.sp(40);
//c.sedan의 좌석수를 5 truck의 적재량을 5로 설정.
nana.setSeatNum(5);
//d.출력문
//1.빨간색 승용차의 속도는 200이고 좌석수는 5개 입니다.
System.out.println(nana.Color+" 승용차의 속도는 "+nana.speed+" 이고 좌석수는 "+nana.getSeatNum()+"개 입니다.");
//2.검정색 트럭의 속도는 100이고 적재량은 5톤입니다.
System.out.println(nene.Color+" 트럭의 속도는 "+nene.speed+" 이고 적재량은"+nene.getCapacity()+"톤 입니다.");
}
}
| [
"user@user-PC"
] | user@user-PC |
08cf6d0078c6aefb0e401c901d7f06918b30cace | e1908d44fecb92b7208612853183356213d176a4 | /itdr_rlg/rlg_1.0/src/com/itdr/controller/FenLeiController.java | 6cf8cf064478aec15379e1df447a9b0d6cfc3ce4 | [] | no_license | hyomineunjung/javaweb-jy5 | ace6780d8b115b3caaf9ab8d5ce418b7dfa84d18 | 04f0e6c589d19d2aa9feca9f9f83c6591b33d979 | refs/heads/master | 2021-07-11T15:27:03.785254 | 2019-08-12T06:01:28 | 2019-08-12T06:01:28 | 200,215,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,164 | java | package com.itdr.controller;
import com.itdr.common.ResponseCode;
import com.itdr.service.FenLeiService;
import com.itdr.service.ProductService;
import com.itdr.utils.JsonUtils;
import com.itdr.utils.PathUtils;
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.IOException;
import static com.itdr.common.Const.*;
@WebServlet("/manage/category/*")
public class FenLeiController extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//处理乱码
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
ResponseCode rs = null;
//怎么获取请求路径信息
String pathInfo = request.getPathInfo();
String path = PathUtils.getPath(pathInfo);
switch (path) {
//获取所有节点
case "get_category":
rs = getjiedian(request);
break;
//查询子节点
case "get_zjd":
rs = getzjd(request);
break;
//增加节点
case "add_category":
rs = addjiedian(request);
break;
//修改类名
case "set_category_name":
rs = changejiedian(request);
break;
// 获取当前分类id及递归子节点
// case "get_deep_category":
// rs=get(request);
// break;
}
response.setContentType("text/json;charset=utf-8");
response.getWriter().write(JsonUtils.obj2String(rs));
}
private FenLeiService ps = new FenLeiService();
// 获取当前分类id及递归子节点
// private ResponseCode get(HttpServletRequest request) {
// Integer id = Integer.parseInt(request.getParameter("id"));
// ResponseCode rs = ps.get(id);
// return rs;
// }
//修改类名
private ResponseCode changejiedian(HttpServletRequest request) {
Integer id = Integer.parseInt(request.getParameter("id"));
String name = request.getParameter("name");
if (name == null) {
ResponseCode qs = new ResponseCode();
qs.setStatus(FENKUAI_NONE_CODE);
qs.setMag(FENKUAI_NONE_MSG);
return qs;
}
//调用业务层
ResponseCode rs = ps.gengxin(id, name);
return rs;
}
//增加节点
private ResponseCode addjiedian(HttpServletRequest request) {
//获取参数
Integer id = Integer.parseInt(request.getParameter("id"));
String parentId = request.getParameter("parentId");
String name = request.getParameter("name");
String status = request.getParameter("status");
String sortorder = request.getParameter("sortorder");
if (parentId == null || name == null || status == null || sortorder == null) {
ResponseCode qs = new ResponseCode();
qs.setStatus(FENKUAI_NONE_CODE);
qs.setMag(FENKUAI_NONE_MSG);
return qs;
}
//调用业务层
ResponseCode rs = ps.add(id, parentId, name, status, sortorder);
return rs;
}
//获取品类子节点
private ResponseCode getzjd(HttpServletRequest request) {
String id = request.getParameter("id");
if (id == null) {
ResponseCode qs = new ResponseCode();
qs.setStatus(FENKUAI_NO_CODE);
qs.setMag(FENKUAI_DO_MSG);
return qs;
}
ResponseCode rs = ps.ssjd(id);
return rs;
}
//获取节点
private ResponseCode getjiedian(HttpServletRequest request) {
//调用业务层
ResponseCode rs = ps.getAll();
return rs;
}
}
| [
"[email protected]"
] | |
78f58222699d17516b176c4897a47ab1dd981245 | c02c9a8670a545023b2d792cbbb7204f2b148acb | /src/main/java/com/wanying/study/net/ServerSocketTest.java | 198604a2baa39996df5c0d11d53c03c7e6dc9c74 | [] | no_license | wychenlong/java-depth-study | 4db2a2100749c5727331092274575ada2a89379b | 55af11c3a07ad23435d38499b966ff6e1521e834 | refs/heads/master | 2021-04-22T12:27:24.627608 | 2017-01-25T00:14:47 | 2017-01-25T00:14:47 | 46,022,758 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package com.wanying.study.net;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
/**
* Created by wychenlong on 2016/10/19.
*/
public class ServerSocketTest {
public static void main(String args[]){
try {
ServerSocket serverSocket = new ServerSocket();
serverSocket.bind(new InetSocketAddress("0.0.0.0",8888));
ServerSocket serverSocke1t = new ServerSocket();
serverSocke1t.bind(new InetSocketAddress("0.0.0.0",8888));
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
3cd127ff79ad1a2f589c7d44a9caae5fb52b74ff | 528660ebb5796aa9b71968bac27128d40fcdbbda | /addon/de.dc.javafx.xcore.workbench.barcode/de.dc.javafx.xcore.workbench.barcode/src-gen/de/dc/javafx/xcore/workbench/barcode/BarcodeFX.java | da69f6faa00650f741cdedc5ac75e31223974f24 | [
"Apache-2.0"
] | permissive | chqu1012/RichClientFX | e9b8370176e561cb1fb68dd310e26d9ad0900efc | c6e6c8686285c8cb852c057693427b47e3662b84 | refs/heads/master | 2020-04-26T09:05:05.505135 | 2019-07-16T21:39:48 | 2019-07-16T21:39:48 | 173,443,601 | 6 | 0 | Apache-2.0 | 2019-07-13T12:22:37 | 2019-03-02T12:11:36 | Java | UTF-8 | Java | false | false | 1,268 | java | /**
*/
package de.dc.javafx.xcore.workbench.barcode;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>FX</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link de.dc.javafx.xcore.workbench.barcode.BarcodeFX#getName <em>Name</em>}</li>
* </ul>
*
* @see de.dc.javafx.xcore.workbench.barcode.BarcodePackage#getBarcodeFX()
* @model abstract="true"
* @generated
*/
public interface BarcodeFX extends EObject {
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see de.dc.javafx.xcore.workbench.barcode.BarcodePackage#getBarcodeFX_Name()
* @model unique="false"
* @generated
*/
String getName();
/**
* Sets the value of the '{@link de.dc.javafx.xcore.workbench.barcode.BarcodeFX#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
void setName(String value);
} // BarcodeFX
| [
"[email protected]"
] | |
71786e384c2fb72c6fe1183034df6047bf2b5064 | 2dcc440fa85d07e225104f074bcf9f061fe7a7ae | /gameserver/src/main/java/org/mmocore/gameserver/scripts/ai/pts/hellbound/warrior_quarry_guard.java | 1560180224b6fdb7cf1fd0b35b21987a6a6153ad | [] | no_license | VitaliiBashta/L2Jts | a113bc719f2d97e06db3e0b028b2adb62f6e077a | ffb95b5f6e3da313c5298731abc4fcf4aea53fd5 | refs/heads/master | 2020-04-03T15:48:57.786720 | 2018-10-30T17:34:29 | 2018-10-30T17:35:04 | 155,378,710 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 846 | java | package org.mmocore.gameserver.scripts.ai.pts.hellbound;
import org.mmocore.gameserver.ai.CtrlEvent;
import org.mmocore.gameserver.ai.Fighter;
import org.mmocore.gameserver.ai.ScriptEvent;
import org.mmocore.gameserver.model.instances.NpcInstance;
import org.mmocore.gameserver.object.Creature;
/**
* @author KilRoy
*/
public class warrior_quarry_guard extends Fighter {
public warrior_quarry_guard(NpcInstance actor) {
super(actor);
}
@Override
protected void onEvtScriptEvent(ScriptEvent event, Object arg1, Object arg2) {
if (event == ScriptEvent.SCE_QUARRY_SLAVE_SEE) {
final Creature quarry = (Creature) arg1;
if (quarry != null) {
getActor().getAggroList().clear();
notifyEvent(CtrlEvent.EVT_AGGRESSION, quarry, 2);
}
}
}
} | [
"[email protected]"
] | |
b9049edab648bca0a82d068d8f9027cd251b8f06 | be119918dfe047742c01a157cee0f3529552fcb8 | /src/main/java/com/sumit/ds/fremont/meetup/package-info.java | 6921c5ebc4d93c185710237559e303c51acec81b | [] | no_license | chiffchaff/ds-practise | f9f9d184ecb4da9b1a5a285c32c950024739c572 | e078ca88b0ddec951e83aa737587305d13c394ea | refs/heads/master | 2023-04-21T07:33:00.909880 | 2023-04-10T19:44:26 | 2023-04-10T19:44:26 | 68,734,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 82 | java | /**
*
*/
/**
* @author sumijaiswal
*
*/
package com.sumit.ds.fremont.meetup; | [
"[email protected]"
] | |
c3062413c309c89287c3036ac74e402d4e76b09a | 8db9e52b19e5bb21f126a20673506bd39b1f9f56 | /src/com/rams/java/sorting/SelectionSort.java | 64d47f968fe94b94ec307344aef13adfc4b48a2c | [] | no_license | Ramaysh1980/Java1.8 | 1b8429ecaa0052b0de0b1d2a3ed9eb5b371d9cbc | bc64de8a1281d3fda95e0c2a161eae51d9ee941a | refs/heads/master | 2022-11-27T15:03:37.019789 | 2020-07-29T17:20:17 | 2020-07-29T17:20:17 | 283,560,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.rams.java.sorting;
public class SelectionSort {
public void sort(int[] a) {
int n=a.length;
for(int i=0;i<n;i++) {
int min_index=i;
for(int j=i+1;j<n;j++) {
if(a[j]<a[min_index])
min_index=j;
}
int temp=a[min_index];
a[min_index]=a[i];
a[i]=temp;
}
}
void printArray(int[] a) {
for(int aa:a) {
System.out.print(aa+" ");
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] arr= {22,43,11,6,3};
SelectionSort st=new SelectionSort();
st.sort(arr);
st.printArray(arr);
}
}
| [
"[email protected]"
] | |
6238b331c83f590b2dc1705230b2df38ffc9ef7e | 3953a58fdf8bf5c67d924e90aa95dea8c091c1f9 | /src/strategiespack/VaryGameLength.java | fa814213c327f7b43b43e7e543fdcc080fbc3206 | [] | no_license | 11laurenm/IterativePrisonersDilemma | 35510462dfa8f5af7196a00e28a9771c7f2f6c35 | e43ce0d38716851d456d5485054e5603d458c184 | refs/heads/master | 2023-06-14T11:22:08.340096 | 2021-03-26T13:35:56 | 2021-03-26T13:35:56 | 383,283,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,358 | java | package strategiespack;
import java.util.Random;
/**
* Class responsible for deciding the length of each of the three games that
* each pairing plays.
* @author Lauren Moore - zfac043
*
*/
public class VaryGameLength {
/**
* The total number of rounds to be played over the course of
* three games.
*/
int totalRounds;
/**
* Random number generator used during decision making.
*/
Random random = new Random();
/**
* The number of rounds to be played in the first game.
*/
public int first;
/**
* The number of rounds to be played in the second game.
*/
public int second;
/**
* The number of rounds to be played in the third game.
*/
public int third;
/**
* Constructor that sets the value of total to the value passed as a parameter
* and first, second and third to 0.
* @param total The total number of rounds to be played over the course of
* three games.
*/
public VaryGameLength(int total) {
totalRounds = total;
first = 0;
second = 0;
third = 0;
}
/**
* Decides the amount of rounds in the first game using random
* number generation.
* @return first - the amount of rounds in the first game
*/
public int getFirstSet() {
first = random.nextInt(totalRounds) + 1; // +1 so the minimum result is 1 not 0
return first;
}
/**
* Decides the amount of rounds in the second game using random
* number generation.
* @return second - the amount of rounds in the second game
*/
public int getSecondSet() {
if ((totalRounds - first - 1 > 0)) {
second = random.nextInt(totalRounds - first - 1) + 1; //highest possible value is
//the total minus length of first game
return second;
} else {
return 0;
}
}
/**
* Decides the amount of rounds in the third game by
* subtracting the first and second values from the total.
* @return third - the amount of rounds in the third game
*/
public int getThirdSet() {
int roundsPlayed = first + second;
if (roundsPlayed == totalRounds) { //length of third game is
//the total amount minus the amount already played
return 0;
}
return totalRounds - first - second;
}
}
| [
"[email protected]"
] | |
88fdfa09fb24a1000b7cce403beb42db6b25e942 | 25626e22673b8bbc8bf191f4ac630308e9e3aaa7 | /ifirstAid/src/main/java/com/iebm/aid/controller/req/SearchRecordDetailParam.java | d1aab40736f92f9f5daa6581b04216ac7c63a294 | [] | no_license | leohyluo/ifirstaid | 0b9002f593be1b2a2d4b0c1d4c27c1a02d75b25b | cc68d2a5becad39648b9c02ce6672e156d6a9e72 | refs/heads/master | 2021-04-12T10:30:55.572147 | 2017-06-26T11:30:54 | 2017-06-26T11:30:54 | 94,532,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package com.iebm.aid.controller.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel("查询急救记录详情实体")
public class SearchRecordDetailParam {
@ApiModelProperty("记录id")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"[email protected]"
] | |
a6a9ee1fc023409dd560f2e51415aa2b41604c5e | eea22a0819dc64dbf73a2f819eba0c3c35284968 | /src/main/java/org/pdfcreator/util/PdfFilesUtils.java | b640ba7e8eb9d43dd40f663531ea40726d8404b2 | [] | no_license | LearnerOGC/spring-boot-forPDFconver | 36f24de1bee072b9fb7c94ca4566313a2c0204f6 | 374bc3e463cb10a8dd6e04f28f73a5c46adb5142 | refs/heads/master | 2020-04-05T21:38:40.555801 | 2018-11-12T14:41:00 | 2018-11-12T14:41:00 | 157,227,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,111 | java | package org.pdfcreator.util;
import org.apache.commons.lang3.StringUtils;
import org.pdfcreator.context.FileConstants;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PdfFilesUtils {
public static String getFileNameWithOutSuffix(String path){
if(!StringUtils.isBlank(path)){
return path.substring(path.lastIndexOf("\\")+1,path.lastIndexOf("."));
}else {
return null;
}
}
public static String getFileSuffix(String path) {
String ext = null;
int i = path.lastIndexOf('.');
if (i > 0 && i < path.length() - 1) {
ext = path.substring(i + 1).toLowerCase();
}
return ext;
}
public static void createHtmlDir(String path) {
int i = path.lastIndexOf('/');
String dirPath = "";
if (i > 0 && i < path.length() - 1) {
dirPath = path.substring(0, i).toLowerCase();
}
File dir = new File(dirPath);
if (!dir.exists()) {
dir.mkdirs();
}
}
public static File createDir(String dirPath) {
File dir = new File(dirPath);
if (!dir.exists() || (dir.exists() && !dir.isDirectory())) {
dir.mkdirs();
}
return dir;
}
public static File createParentDir(String dirPath) {
File dir = new File(dirPath);
File parent = dir.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
return dir;
}
public static File createFile(String filePath) throws IOException{
File file = new File(filePath);
if(!file.exists()){
file.createNewFile();
return file;
}
return null;
}
public static void transformFontFamily(String sourcePath){
File file = new File(sourcePath);
StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line = null;
while((line = reader.readLine()) != null){
sb.append(line);
}
reader.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException ioe){
ioe.printStackTrace();
}
String htmlFile = sb.toString();
StringBuffer sbu = new StringBuffer();
Pattern p = Pattern.compile("font-family:[^><;\"]*;");
Matcher m = p.matcher(htmlFile);
while(m.find()){
String temp = m.group();
String replaseStr = FileConstants.HTML_FONT_FAMILY;
m.appendReplacement(sbu, replaseStr);
}
m.appendTail(sbu);
writeFile(sbu.toString(), sourcePath);
}
public static void writeFile(String content, String path) {
createHtmlDir(path);
OutputStream os = null;
BufferedWriter bw = null;
try {
File file = new File(path);
File parent = file.getParentFile();
//如果pdf保存路径不存在,则创建路径
if(!parent.exists()){
parent.mkdirs();
}
os = new FileOutputStream(file);
bw = new BufferedWriter(new OutputStreamWriter(os, FileConstants.DEFAULT_ENCODING));
bw.write(content);
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (bw != null)
bw.close();
if (os != null)
os.close();
} catch (IOException ie) {
ie.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
74eb4c7065e1b6d2eedc126cbfcefbfcbcc6e35b | c0e5117594433a38091744947ceecc7f223d58ab | /src/test/java/aula/SeleniumAulaClasseAction/TesteClasseAction.java | f3e76346b999075b71bc002c8ad2bd29e1dc85b1 | [] | no_license | AbnerDvlp/CSWDJActions | 8019cc9faa0c0e8dc593e8aa73d6c2125fa79afc | 9cd061453bdd378bb262ac295e0387db9fcf04b1 | refs/heads/master | 2022-11-28T01:24:54.344928 | 2020-08-10T14:43:08 | 2020-08-10T14:43:08 | 286,500,859 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,749 | java | /*dragAndDrop(source, target): Clica e arrasta um elemento para outro elemento. Utiliza como parâmetro um elemento de origem e o elemento de destino.
dragAndDropBy(source, xOffset, yOffset): Clica e arrasta um elemento para outro elemento. Utiliza como parâmetro coordenadas X e Y.
moveToElement(toElement): Move o cursor para um elemento específico.
release(): Libera o clique do mouse (esquerdo).*/
package aula.SeleniumAulaClasseAction;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class TesteClasseAction {
static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
// testaTeclado();
// testaMouse();
//testaContextClick();
testaClickAndHold();
}
public static void testaTeclado() {
String driverPath = "C:\\Users\\55519\\eclipse-workspace\\SeleniumAulaClasseAction\\drivers\\chrome\\084\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", driverPath);
driver = new ChromeDriver();
driver.get("https://www.facebook.com");
// mapeando os elementos um por um (somente os envolvidos)
//WebElement elementoEmail = driver.findElement(By.id("email"));
//WebElement elementoPass = driver.findElement(By.id("pass"));
WebElement elementoFirstName = driver.findElement(By.id("u_0_m"));
WebElement elementoLastName = driver.findElement(By.id("u_0_o"));
Actions act = new Actions(driver);
// mantem pressionado a tecla shift
act.keyDown(elementoFirstName, Keys.SHIFT).build().perform();
act.sendKeys(elementoFirstName, "abner");
// solta a tecla
act.keyUp(elementoLastName, Keys.SHIFT).build().perform();
act.sendKeys(elementoLastName, "antonio").build().perform();
}
public static void testaMouse() {
String driverPath = "C:\\Users\\55519\\eclipse-workspace\\SeleniumAulaClasseAction\\drivers\\chrome\\084\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", driverPath);
driver = new ChromeDriver();
driver.get("https://the-internet.herokuapp.com/login");
Actions act = new Actions(driver);
WebElement inputUsername = driver.findElement(By.cssSelector("input[name='username']"));
WebElement inputSenha = driver.findElement(By.cssSelector("input[type='password']"));
WebElement butEntrar = driver.findElement(By.cssSelector("button[type='submit']"));
// act.sendKeys(inputUsername, "tomsmith111").build().perform();
// act.sendKeys(inputSenha, "SuperSecretPassword!").build().perform();
// click no elemento
// act.click(butEntrar).build().perform();
act.sendKeys(inputUsername, "tomsmith111").build().perform();
act.doubleClick(inputUsername).build().perform();
act.sendKeys(inputUsername, "tomsmith").build().perform();
act.sendKeys(inputSenha, "SuperSecretPassword!").build().perform();
act.click(butEntrar).build().perform();
}
public static void testaContextClick() throws InterruptedException {
String driverPath = "C:\\Users\\55519\\eclipse-workspace\\SeleniumAulaClasseAction\\drivers\\chrome\\084\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", driverPath);
driver = new ChromeDriver();
driver.get("https://swisnl.github.io/jQuery-contextMenu/demo.html");
Actions act = new Actions(driver);
WebElement botao = driver.findElement(By.cssSelector("span.context-menu-one"));
// declaracao alternativa
// act.contextClick(botao).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();
// clicka com o botao direito do mouse
act.contextClick(botao).build().perform();
Thread.sleep(1500);
act.sendKeys(Keys.ARROW_DOWN).build().perform();
Thread.sleep(1000);
act.sendKeys(Keys.ENTER).build().perform();
}
public static void testaClickAndHold() throws InterruptedException {
String driverPath = "C:\\Users\\55519\\eclipse-workspace\\SeleniumAulaClasseAction\\drivers\\chrome\\084\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", driverPath);
driver = new ChromeDriver();
driver.get("https://the-internet.herokuapp.com/login");
Actions act = new Actions(driver);
WebElement inputUsername = driver.findElement(By.cssSelector("input[name='username']"));
WebElement inputSenha = driver.findElement(By.cssSelector("input[type='password']"));
WebElement butEntrar = driver.findElement(By.cssSelector("button[type='submit']"));
act.sendKeys(inputUsername, "tomsmith").build().perform();
Thread.sleep(1000);
act.sendKeys(inputSenha, "SuperSecretPassword!").build().perform();
Thread.sleep(1000);
act.clickAndHold(butEntrar).build().perform();
}
}
| [
"[email protected]"
] | |
86aae3b8921dd18e9232d77cf9aae5939fe18e7d | 5a8e60d58407ddd13804d926173f708833642efe | /src/main/java/com/avaje/ebeaninternal/server/el/ElFilter.java | 6769a9854f450efafe566d88ddc0da7a0570b325 | [
"Apache-2.0"
] | permissive | hei1233212000/avaje-ebeanorm | dc66510358c42bf165768e60a6cf7b76fb0f02eb | d396f09b3afae8dfc0f5b5c3d166c6f498b96961 | refs/heads/master | 2020-04-03T13:58:41.211683 | 2015-07-24T09:56:11 | 2015-07-24T09:56:11 | 11,807,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,444 | java | package com.avaje.ebeaninternal.server.el;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import com.avaje.ebean.Filter;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
/**
* Default implementation of the Filter interface.
*/
public final class ElFilter<T> implements Filter<T> {
private final BeanDescriptor<T> beanDescriptor;
private ArrayList<ElMatcher<T>> matches = new ArrayList<ElMatcher<T>>();
private int maxRows;
private String sortByClause;
public ElFilter(BeanDescriptor<T> beanDescriptor) {
this.beanDescriptor = beanDescriptor;
}
private Object convertValue(String propertyName, Object value) {
// convert type of value to match expected type
ElPropertyValue elGetValue = beanDescriptor.getElGetValue(propertyName);
return elGetValue.elConvertType(value);
}
private ElComparator<T> getElComparator(String propertyName) {
return beanDescriptor.getElComparator(propertyName);
}
private ElPropertyValue getElGetValue(String propertyName) {
return beanDescriptor.getElGetValue(propertyName);
}
public Filter<T> sort(String sortByClause) {
this.sortByClause = sortByClause;
return this;
}
protected boolean isMatch(T bean) {
for (int i = 0; i < matches.size(); i++) {
ElMatcher<T> matcher = matches.get(i);
if (!matcher.isMatch(bean)){
return false;
}
}
return true;
}
public Filter<T> in(String propertyName, Set<?> matchingValues) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.InSet<T>(matchingValues, elGetValue));
return this;
}
public Filter<T> eq(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Eq<T>(value, comparator));
return this;
}
public Filter<T> ne(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Ne<T>(value, comparator));
return this;
}
public Filter<T> between(String propertyName, Object min, Object max) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
min = elGetValue.elConvertType(min);
max = elGetValue.elConvertType(max);
ElComparator<T> elComparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Between<T>(min, max, elComparator));
return this;
}
public Filter<T> gt(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Gt<T>(value, comparator));
return this;
}
public Filter<T> ge(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Ge<T>(value, comparator));
return this;
}
public Filter<T> ieq(String propertyName, String value) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.Ieq<T>(elGetValue, value));
return this;
}
public Filter<T> isNotNull(String propertyName) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.IsNotNull<T>(elGetValue));
return this;
}
public Filter<T> isNull(String propertyName) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.IsNull<T>(elGetValue));
return this;
}
public Filter<T> le(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Le<T>(value, comparator));
return this;
}
public Filter<T> lt(String propertyName, Object value) {
value = convertValue(propertyName, value);
ElComparator<T> comparator = getElComparator(propertyName);
matches.add(new ElMatchBuilder.Lt<T>(value, comparator));
return this;
}
public Filter<T> regex(String propertyName, String regEx) {
return regex(propertyName, regEx, 0);
}
public Filter<T> regex(String propertyName, String regEx, int options) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.RegularExpr<T>(elGetValue, regEx, options));
return this;
}
public Filter<T> contains(String propertyName, String value) {
String quote = ".*"+Pattern.quote(value)+".*";
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.RegularExpr<T>(elGetValue, quote, 0));
return this;
}
public Filter<T> icontains(String propertyName, String value) {
String quote = ".*"+Pattern.quote(value)+".*";
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.RegularExpr<T>(elGetValue, quote, Pattern.CASE_INSENSITIVE));
return this;
}
public Filter<T> endsWith(String propertyName, String value) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.EndsWith<T>(elGetValue, value));
return this;
}
public Filter<T> startsWith(String propertyName, String value) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.StartsWith<T>(elGetValue, value));
return this;
}
public Filter<T> iendsWith(String propertyName, String value) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.IEndsWith<T>(elGetValue, value));
return this;
}
public Filter<T> istartsWith(String propertyName, String value) {
ElPropertyValue elGetValue = getElGetValue(propertyName);
matches.add(new ElMatchBuilder.IStartsWith<T>(elGetValue, value));
return this;
}
public Filter<T> maxRows(int maxRows) {
this.maxRows = maxRows;
return this;
}
public List<T> filter(List<T> list) {
if (sortByClause != null){
// create shallow copy and sort
list = new ArrayList<T>(list);
beanDescriptor.sort(list, sortByClause);
}
ArrayList<T> filterList = new ArrayList<T>();
for (int i = 0; i < list.size(); i++) {
T t = list.get(i);
if (isMatch(t)) {
filterList.add(t);
if (maxRows > 0 && filterList.size() >= maxRows){
break;
}
}
}
return filterList;
}
}
| [
"[email protected]"
] | |
ec0f27db9bd66a30dd8a7003b2f150d2d1900694 | 7304d5115a547c09b9f83fea68d3e03238b09986 | /PersonalDevelopment/src/personal/development/src/executors/employee/RunnableSalaryCalculator.java | f04931270994bd412a0cd289824373a19750c841 | [] | no_license | bhagyashree010/PersonalDevelopment | fea4c7fa4f5bf4004c0012d48ffd062ed681f3e0 | 68345af7b3e98bb9cd465ef79e293d276c3797d9 | refs/heads/master | 2021-08-23T19:46:23.102523 | 2017-12-06T08:30:51 | 2017-12-06T08:30:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package personal.development.src.executors.employee;
import java.util.List;
public class RunnableSalaryCalculator implements Runnable
{
List<Employee> emps = null;
public RunnableSalaryCalculator(List<Employee> emp) {
this.emps = emp;
}
@Override
public void run() {
emps.stream().forEach(e ->
System.out.println("Emp salary : "+
(e.getBasic() + e.getDA() + e.getHRA()
- (e.getPF())))
);
}
}
| [
"[email protected]"
] | |
fcdd930fad5a2deb0b274e0a34684dd3f23dd511 | 09a667c9150dc8e70d5437155fa866cc79a4704d | /src/main/java/org/mongodb/morphia/query/SessionBoundQuery.java | 185a6517c41eebc8a04a4acc6bc416026042cbfb | [
"MIT"
] | permissive | jayatencompass/morphia-session | 4184d29bc8f02b7f64380d8f389b680ecd783fd8 | ee4f982f23de1ebca20164197732d72b9022135a | refs/heads/master | 2021-06-09T02:12:18.448564 | 2016-11-27T02:25:25 | 2016-11-27T02:25:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,464 | java | package org.mongodb.morphia.query;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import org.mongodb.morphia.Datastore;
import org.mongodb.morphia.logging.Logger;
import org.mongodb.morphia.logging.MorphiaLoggerFactory;
import org.mongodb.morphia.session.Session;
/**
* You should NOT instantiate one of these directly. You should use <code>Session.query()</code> to construct one of
* these bad boys for you. It's easier, and cleaner that way.
*
* This is a query implementation that attempts to utilize the cache of a specific session. Normally if you use the session to get
* a record such as "User[A]" by its id, we'll store that entity in the session's front-side cache so that if something
* else has a reference to that user and you need to lazy-load it, no DB query is required as it will be fetched from
* the cache. If you execute some other standalone query that includes User[A] as one of the results, Morphia will create
* a SECOND COPY of that entity which is returned as port of the search results. This is problematic for a few reasons:
*
* <ul>
* <li>You've performed the work to map the entity the session already knows about.</li>
* <li>Comparing both User[A] instances will fail an == test.</li>
* <li>If you update the "firstName" on one and "lastName" on the other and save both, you'll squash the first modification.</li>
* </ul>
*
* This query implementation is bound to a specific session so that it can interact w/ its front-side cache, allowing
* you to re-use instances of entities that were resolved by previous queries in the same session. Additionally any entities
* that did need to be loaded/mapped from scratch when this query executes will be put into the session's cache to
* receive the same benefits.
*/
public class SessionBoundQuery<T> extends QueryImpl<T>
{
private static final Logger logger = MorphiaLoggerFactory.get(SessionBoundQuery.class);
private Session session;
/**
* Creates a Query for the given type and collection
* @param session The session that this query is bound to
* @param clazz The entity class describing the collection to query
* @param coll The MongoDB collection information to query
* @param ds The datastore instance that's executing this query
*/
public SessionBoundQuery(Session session, Class<T> clazz, final DBCollection coll, final Datastore ds)
{
super(clazz, coll, ds);
this.session = session;
}
/**
* Executes the query, constructing the results iterator so that you can pull entities at will.
* @return The results iterator
*/
@Override
public MorphiaIterator<T, T> fetch()
{
final DBCursor cursor = prepareCursor();
if (logger.isTraceEnabled())
logger.trace("Getting cursor({0}) for query: {1}", getCollection().getName(), cursor.getQuery());
session.getStats().read();
// The iterator is the same as a standard Morphia query. The only difference is that we supply an EntityCache
// that checks the session's front-side cache first before mapping a new instance from scratch.
return new MorphiaIterator<>(
getDatastore(),
cursor,
getDatastore().getMapper(),
getEntityClass(),
getCollection().getName(),
new SessionQueryEntityCache(session, getDatastore().getMapper().createEntityCache()));
}
}
| [
"[email protected]"
] | |
20567ad6926c6a16b952207e7f67f32cd9f6788d | 9ed9b9d6400f21de719953d620da0465621937d5 | /base-service/src/main/java/com/jinyao/exploit/modules/gen/entity/Template.java | 19ab13a5cd2fda317f64bb04989a47d5a82f6f86 | [] | no_license | z68143495/exploit | f33612bffb1796c5571f7678cad699253a353f16 | a827a476126b80dee9c9ac4ebaab6d4751b42e1e | refs/heads/master | 2022-12-01T01:59:10.612406 | 2019-09-07T02:32:36 | 2019-09-07T02:32:36 | 161,329,475 | 1 | 0 | null | 2022-11-16T11:33:46 | 2018-12-11T12:18:52 | Java | UTF-8 | Java | false | false | 1,342 | java | /**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.jinyao.exploit.modules.gen.entity;
import com.google.common.collect.Lists;
import com.jinyao.exploit.common.base.entity.DataEntity;
import com.jinyao.exploit.common.utils.StringUtils;
import lombok.Data;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;
/**
* 生成方案Entity
* @author ThinkGem
* @version 2013-10-15
*/
@XmlRootElement(name="template")
@Data
public class Template extends DataEntity<Template> {
private static final long serialVersionUID = 1L;
private String name; // 名称
private String category; // 分类
private String filePath; // 生成文件路径
private String fileName; // 文件名
private String content; // 内容
public Template() {
super();
}
public Template(long id){
super(id);
}
@XmlTransient
public List<String> getCategoryList() {
if (category == null){
return Lists.newArrayList();
}else{
return Lists.newArrayList(StringUtils.split(category, ","));
}
}
public void setCategoryList(List<String> categoryList) {
if (categoryList == null){
this.category = "";
}else{
this.category = ","+StringUtils.join(categoryList, ",") + ",";
}
}
}
| [
"aa6885757"
] | aa6885757 |
e06e60acdc438f81457648cc1c73e6e44ae99002 | 28021566bfbe54b5e903fd0bcfecf88bb8a37146 | /src/com/ms/silverking/compression/BZip2.java | 086d5826f51693bfddd7d590259919821b4ed60c | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ft655508/SilverKing | 1dce9e28a9f3dcd30648567e610fe40b7ec4b306 | 0bbd76fd69dbb9896e1cfb85a6c3fc3164d181d3 | refs/heads/master | 2020-05-25T05:06:47.932717 | 2019-05-16T20:46:20 | 2019-05-16T20:46:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,721 | java | package com.ms.silverking.compression;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import org.apache.hadoop.io.compress.bzip2.CBZip2InputStream;
import org.apache.hadoop.io.compress.bzip2.CBZip2OutputStream;
import com.ms.silverking.log.Log;
import com.ms.silverking.text.StringUtil;
public class BZip2 implements Compressor, Decompressor {
private static final int bzip2InitFactor = 10;
public BZip2() {
}
public byte[] compress(byte[] rawValue, int offset, int length) throws IOException {
ByteArrayOutputStream baos;
CBZip2OutputStream bzip2os;
byte[] buf;
int compressedLength;
//Log.warning("rawValue.length ", rawValue.length);
baos = new ByteArrayOutputStream(rawValue.length / bzip2InitFactor);
baos.write(0x42);
baos.write(0x5a);
bzip2os = new CBZip2OutputStream(baos);
bzip2os.write(rawValue, offset, length);
bzip2os.flush();
bzip2os.close();
baos.flush();
baos.close();
buf = baos.toByteArray();
//System.out.println(StringUtil.byteArrayToHexString(buf));
compressedLength = buf.length;
//Log.warning("compressedLength ", compressedLength);
if (Log.levelMet(Level.FINE)) {
Log.fine("rawValue.length: "+ rawValue.length);
Log.fine("buf.length: "+ buf.length);
Log.fine("compressedLength: "+ compressedLength);
}
//System.arraycopy(md5, 0, buf, compressedLength, md5.length);
//Log.warning("buf.length ", buf.length);
//System.out.println("\t"+ StringUtil.byteArrayToHexString(buf));
return buf;
}
public byte[] decompress(byte[] value, int offset, int length, int uncompressedLength) throws IOException {
CBZip2InputStream bzip2is;
InputStream inStream;
byte[] uncompressedValue;
//System.out.println(value.length +" "+ offset +" "+ length);
//System.out.println(StringUtil.byteArrayToHexString(value, offset, length));
uncompressedValue = new byte[uncompressedLength];
inStream = new ByteArrayInputStream(value, offset, length);
try {
int b;
b = inStream.read();
if (b != 'B') {
throw new IOException("Invalid bzip2 value");
}
b = inStream.read();
if (b != 'Z') {
throw new IOException("Invalid bzip2 value");
}
bzip2is = new CBZip2InputStream(inStream);
try {
int totalRead;
totalRead = 0;
do {
int numRead;
numRead = bzip2is.read(uncompressedValue, totalRead, uncompressedLength - totalRead);
if (numRead < 0) {
throw new RuntimeException("panic");
}
totalRead += numRead;
} while (totalRead < uncompressedLength);
return uncompressedValue;
} finally {
bzip2is.close();
}
} finally {
inStream.close();
}
}
// for unit testing only
public static void main(String[] args) {
try {
for (String arg : args) {
byte[] original;
byte[] compressed;
byte[] uncompressed;
original = arg.getBytes();
compressed = new BZip2().compress(original, 0, 0);
uncompressed = new BZip2().decompress(compressed, 0, 0, original.length);
System.out.println(arg +"\t"+ original.length +"\t"+ compressed.length +"\t"+ new String(uncompressed));
System.out.println(StringUtil.byteArrayToHexString(original));
System.out.println(StringUtil.byteArrayToHexString(uncompressed));
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
76b4f1ce99faaf72550f1a83e87625a1fde8b8cc | adda53f4f5f43d773247703caef44769d490b198 | /src/NSGA_1/SensorParetto.java | 3218d6e9e1f674c198d99a781a1a0311745b25a9 | [] | no_license | adriller/Multi-Criteria-Decision-Methods | dd7d8d74525e85e0b02f87f6d65e1270a842e447 | 8b82c39250a06843b35fa4ee46086788afb7b3a3 | refs/heads/master | 2020-05-26T13:41:42.783178 | 2017-03-14T22:16:41 | 2017-03-14T22:16:41 | 85,002,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,966 | java | package NSGA_1;
import commom.Attribute;
import java.util.ArrayList;
import java.util.List;
import org.magicwerk.brownies.collections.BigList;
public class SensorParetto {
private int id;
List<Attribute> attributes;
private Double crowdingDistance;
private int np;
// private List<SensorParetto> dominatedSensors;
private BigList<SensorParetto> dominatedSensors;
private int rank;
private int front;
public SensorParetto(int id, List<Attribute> attr, int rank) {
this.id = id;
this.attributes = attr;
this.crowdingDistance = 0.0;
this.np = 0;
this.dominatedSensors = null;
this.rank = rank;
}
public SensorParetto(int id, List<Attribute> attr) {
this.id = id;
this.attributes = attr;
this.crowdingDistance = 0.0;
this.np = 0;
this.dominatedSensors = null;
this.front = 0;
}
public int getRank() {
return rank;
}
public void setRank(int rank) {
this.rank = rank;
}
public Double getCrowdingDistance() {
return crowdingDistance;
}
public void setCrowdingDistance(Double crowdingDistance) {
this.crowdingDistance = crowdingDistance;
}
public int getNp() {
return np;
}
public void setNp(int np) {
this.np = np;
}
public List<SensorParetto> getDominatedSensors() {
return dominatedSensors;
}
public void setDominatedSensors(BigList<SensorParetto> dominatedSensors) {
this.dominatedSensors = dominatedSensors;
}
public void addToDominatedSensors(SensorParetto s) {
if (this.dominatedSensors != null) {
this.dominatedSensors.add(s);
} else {
this.dominatedSensors = new BigList<SensorParetto>();
this.dominatedSensors.add(s);
}
}
// public void setDominatedSensors(List<SensorParetto> dominatedSensors) {
// this.dominatedSensors = dominatedSensors;
// }
//
// public void addToDominatedSensors(SensorParetto s) {
// if (this.dominatedSensors != null) {
// this.dominatedSensors.add(s);
// } else {
// this.dominatedSensors = new ArrayList<SensorParetto>();
// this.dominatedSensors.add(s);
// }
// }
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public List<Attribute> getAttributes() {
return attributes;
}
public void setAttributes(List<Attribute> attributes) {
this.attributes = attributes;
}
public void increaseNp() {
this.np++;
}
public void decreaseNp() {
this.np--;
}
/**
* @return the front
*/
public int getFront() {
return front;
}
/**
* @param front the front to set
*/
public void setFront(int front) {
this.front = front;
}
}
| [
"[email protected]"
] | |
50948bbe5ff40cec891866dfad7344a875a009e5 | 939219c39dbf3c2af504410188c17db9f8a61bf9 | /kodilla-sudoku/src/main/java/com/kodilla/sudoku/SudokuElement.java | 137064786c65cd7f6bbb2216bbd3419f80e23a04 | [] | no_license | LukaszRogacz/Lukasz-Rogacz-kodilla-java | 00b5b57130c6853261eec27ae1eb70ac11b4651a | 991db629d7ee3d7afea2ccff20975f871a4df61a | refs/heads/master | 2020-03-07T04:07:19.648953 | 2018-09-20T19:47:34 | 2018-09-20T19:47:34 | 127,256,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,229 | java | package com.kodilla.sudoku;
import java.util.HashSet;
import java.util.Set;
public class SudokuElement {
public static final int EMPTY = -1;
public static final int GAME_SIZE = 3;
public static final int VALUE_MIN = 1;
public static final int VALUE_MAX = (int) Math.pow(GAME_SIZE, 2);
private int value;
private Set<Integer> possibleValues;
private int blockNumber;
public SudokuElement() {
this(GAME_SIZE);
}
private SudokuElement(int gameSize) {
this.value = EMPTY;
this.possibleValues = new HashSet<>();
for (int i = 1; i <= Math.pow(gameSize, 2); i++) {
this.possibleValues.add(i);
}
}
public int getValue() {
return value;
}
public int getBlockNumber() {
return blockNumber;
}
public void setBlockNumber(int blockNumber) {
this.blockNumber = blockNumber;
}
public void setValue(int value) {
this.value = value;
this.possibleValues.clear();
}
public void setPossibleValues(Set<Integer> possibleValues) {
this.possibleValues = possibleValues;
}
public Set<Integer> getPossibleValues() {
return possibleValues;
}
}
| [
"“[email protected]"
] | |
5b2dc6ae6300f5558d9536f5d173840b500b08ec | dc7f8a5affc388c0c6bbe0a8ab4ed3efe00eb34d | /behavioral/com/designpattern/strategy/CapitalTextFormatter.java | f0583a0a4e81c4b6a00e30c5db1fdb0bb3c6493a | [] | no_license | ayushchoukse1/Design-Patterns | 5c7776935c2f879ac97619858c256f2c902fe2d2 | 693742e5ac62fd726fab8787c24152fba38c64f1 | refs/heads/master | 2021-01-17T17:46:38.970947 | 2020-03-07T18:46:16 | 2020-03-07T18:46:16 | 64,610,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package com.designpattern.strategy;
public class CapitalTextFormatter implements TextFormat {
@Override
public String format(String string) {
return string.toUpperCase();
}
}
| [
"[email protected]"
] | |
53e7d83fde6ca728e19094e065c7e9cc0ff12d58 | b6647a9ad4e72be89c0909b9963f0d8276a771c6 | /app/src/main/java/com/hoarauthomas/go4lunchthp7/ui/restaurant/ListFragment.java | e153f5e271ea88e459c22bcbf183f7593739b29e | [] | no_license | hoaraut35/P7 | 9ca6bf6f98d4346ac72bc10bcfc4f55b42c2119b | 007bf704ec8769918a9aaf7a8367606217e0c613 | refs/heads/main | 2023-08-13T04:59:58.071820 | 2021-10-18T13:36:18 | 2021-10-18T13:36:18 | 373,791,833 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,822 | java | package com.hoarauthomas.go4lunchthp7.ui.restaurant;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.hoarauthomas.go4lunchthp7.R;
import com.hoarauthomas.go4lunchthp7.factory.ViewModelFactory;
import com.hoarauthomas.go4lunchthp7.model.NearbySearch.RestaurantPojo;
import com.hoarauthomas.go4lunchthp7.model.PlaceDetails.ResultPlaceDetail;
import com.hoarauthomas.go4lunchthp7.ui.detail.DetailActivity;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
//public class ListFragment extends Fragment implements RecyclerViewAdapter.RestaurantListener{
public class ListFragment extends Fragment implements ClickListener{
private final ArrayList<RestaurantPojo> allResult = new ArrayList<>();
private final List<ResultPlaceDetail> AutocompleteResult = new ArrayList<>();
private RecyclerView recyclerView;
@Override
public void onClickDetailRestaurant(String restaurantId) {
Intent intent = new Intent(getContext(), DetailActivity.class);
intent.putExtra("TAG_ID", restaurantId);
startActivity(intent);
}
@Override
public void popupSnack(String message) {
Toast toast = Toast.makeText(getContext(), message, Toast.LENGTH_SHORT);
toast.show();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.list_fragment, container, false);
setupRecyclerView(view);
setupViewModel();
return view;
}
public static ListFragment newInstance() {
ListFragment listFragment = new ListFragment();
return listFragment;
}
private void setupViewModel() {
ViewModelRestaurant myViewModelRestaurant = new ViewModelProvider(this, ViewModelFactory.getInstance()).get(ViewModelRestaurant.class);
myViewModelRestaurant.getRestaurantsViewUI().observe(getViewLifecycleOwner(), new Observer<ViewStateRestaurant>() {
@Override
public void onChanged(ViewStateRestaurant viewStateRestaurant) {
List<ResultPlaceDetail> myTest = new ArrayList<>();
if (viewStateRestaurant.getMyAutocompleteList() != null){
myTest.clear();
myTest.addAll(viewStateRestaurant.getMyAutocompleteList());
}
List<RestaurantPojo> myRestaurantPojoList = new ArrayList<>();
if (viewStateRestaurant.getMyRestaurantList() != null){
myRestaurantPojoList.clear();
myRestaurantPojoList.addAll(viewStateRestaurant.getMyRestaurantList());
}
ListFragment.this.showRestaurant(myRestaurantPojoList, myTest);
}
});
}
private void showRestaurant(List<RestaurantPojo> restaurants, List<ResultPlaceDetail> myAutocompleteResult) {
if (myAutocompleteResult != null && myAutocompleteResult.size()>0){
Log.i("[AUTOCOMPLETE]", "view autocomplete" + myAutocompleteResult.size() );
// myAutocompleteResult.clear();
// myAutocompleteResult.addAll(myAutocompleteResult);
recyclerView.setAdapter(new RecyclerViewAdapterAutocomplete(myAutocompleteResult, this));
Objects.requireNonNull(recyclerView.getAdapter()).notifyDataSetChanged();
}else
if (restaurants != null) {
Log.i("[AUTOCOMPLETE]", "view restaurant" + restaurants.size());
allResult.clear();
allResult.addAll(restaurants);
// recyclerView.setAdapter(new RecyclerViewAdapter(allResult, this));
recyclerView.setAdapter(new RecyclerViewAdapter(allResult, this));
Objects.requireNonNull(recyclerView.getAdapter()).notifyDataSetChanged();
}
}
private void setupRecyclerView(View view) {
recyclerView = view.findViewWithTag("recycler_view");
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
recyclerView.setHasFixedSize(false);
recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext()));
recyclerView.addItemDecoration(itemDecoration);
}
} | [
"[email protected]"
] | |
0fd906e46af9674fff2af67f572e9ec12498fddf | 271553c508447b1412cbb65762f72d24912ef196 | /prog5.java | 34b706b3e1ba21fdba8a1f231cf1151e6d9e7b63 | [] | no_license | akshaysabale07/java | c9c35a9ac6b9d6b13520c9568a69bdf13428bf86 | f6c26fe45fde7e66caf914c57a9254e00fab8607 | refs/heads/master | 2022-12-28T17:50:38.628534 | 2020-10-06T15:21:58 | 2020-10-06T15:21:58 | 296,399,619 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | class prog5
{
public static void main(String args[])
{
String s=args[0];
System.out.println("Welcome "+s);
}
} | [
"[email protected]"
] | |
8731ccc87e202f53db40ff1d5a3984afb9c3b69f | f1b878deb1c1821d9f0a8dac6f904f2c9de0641d | /shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-api/src/test/java/org/apache/shardingsphere/data/pipeline/spi/fixture/RuleBasedJobLockFixture.java | 2921ca1dec350b7eb2f0d18f5e899f3b38bd31db | [
"Apache-2.0"
] | permissive | limengcanyu/shardingsphere | e3eedf1dccea26f7e2366fb6173c490eed850662 | 954bebf8dc038b7bbb37a1a53c62b31c293d99a5 | refs/heads/master | 2023-01-13T03:33:21.024525 | 2022-06-14T09:28:32 | 2022-06-14T09:28:32 | 257,579,264 | 0 | 0 | Apache-2.0 | 2020-11-22T12:17:26 | 2020-04-21T11:52:41 | Java | UTF-8 | Java | false | false | 1,212 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.data.pipeline.spi.fixture;
import org.apache.shardingsphere.data.pipeline.spi.lock.RuleBasedJobLock;
public final class RuleBasedJobLockFixture implements RuleBasedJobLock {
@Override
public void lock(final String databaseName, final String jobId) {
}
@Override
public void releaseLock(final String databaseName, final String jobId) {
}
}
| [
"[email protected]"
] | |
ee94a269a3d02f0046c2d2bfa74d299dd50b1f1b | 1ab6cc77157a6dc2d11eb869ddca3c6d12b063a6 | /src/by/it/group873603/svirbut/lesson01/FiboB.java | 22bde64f9ba64d66f315bba3d4a153a34cd8b226 | [] | no_license | Kirill-Ryzhenko/PISL2021-02-01 | 1872a7c3d77098afabe390fd13e2e9b1d92b7152 | 729ea40f0bcca8f15d5c4ace9c96fed0f71adaec | refs/heads/master | 2023-04-19T14:47:09.857217 | 2021-05-03T14:22:59 | 2021-05-03T14:22:59 | 349,974,326 | 0 | 1 | null | 2021-04-16T18:17:55 | 2021-03-21T11:12:17 | Java | UTF-8 | Java | false | false | 1,073 | java | package by.it.group873603.svirbut.lesson01;
import java.math.BigInteger;
/*
* Вам необходимо выполнить способ вычисления чисел Фибоначчи с вспомогательным массивом
* без ограничений на размер результата (BigInteger)
*/
public class FiboB {
private long startTime = System.currentTimeMillis();
private long time() {
return System.currentTimeMillis() - startTime;
}
public static void main(String[] args) {
//вычисление чисел простым быстрым методом
FiboB fibo = new FiboB();
int n = 55555;
System.out.printf("fastB(%d)=%d \n\t time=%d \n\n", n, fibo.fastB(n), fibo.time());
}
BigInteger fastB(Integer n) {
BigInteger[] mass = new BigInteger[n+1];
mass[0] = BigInteger.ZERO;
mass[1] = BigInteger.ONE;
for (int i = 2; i <= n; i++) {
mass[i] = mass[i-1].add(mass[i-2]);
}
return mass[n];
}
}
| [
"[email protected]"
] | |
ab455071851a07dda72df9cbaf2674d914fe0336 | a9963f6e3bb35707279d4bfa9d15b567c910bf6e | /libraryDatabaseImp/src/neu/ccs/cs5200/mbps/ldb/view/librarian/LibrarianHomeScreen.java | 5ca1a4690386fa9b7b7ccc41543d2194df32b054 | [] | no_license | PrathmeshJ/MyRepo | f3c03de10e43c0da6e6aa8fcad7390cdd28ab200 | d247417c02a6f26610ac3278221eabc49967b75e | refs/heads/master | 2016-08-04T10:13:00.595312 | 2014-01-03T18:33:18 | 2014-01-03T18:33:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,443 | 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 neu.ccs.cs5200.mbps.ldb.view.librarian;
import java.awt.CardLayout;
import javax.swing.JFrame;
import neu.ccs.cs5200.mbps.ldb.model.Librarian;
import neu.ccs.cs5200.mbps.ldb.nav.Navigator;
import neu.ccs.cs5200.mbps.ldb.view.util.Registry;
import neu.ccs.cs5200.mbps.ldb.view.util.ViewConstants;
/**
* The home screen for Librarians. Librarians can perform all of the basic
* functions that a Member can, plus manage the library inventory and check out
* books to members.
*
* @author prathmeshjakkanwar
*/
public class LibrarianHomeScreen extends JFrame {
/**
* Creates new form EditBook
*/
public LibrarianHomeScreen() {
initComponents();
// register the librarian navigation options so they can be retrieved later
(Navigator.getInstance()).register(ViewConstants.Librarian.NAVIGATOR, viewPanel);
// display the book search by default
CardLayout cl = (CardLayout) viewPanel.getLayout();
cl.show(viewPanel, ViewConstants.Member.BOOK_SEARCH);
// set the page title
Librarian l = (Librarian) (Registry.getInstance()).get(ViewConstants.SESSION_MEMBER);
this.setTitle(ViewConstants.TITLE + " Librarian: " + l.getName());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
viewPanel = new javax.swing.JPanel();
viewProfile1 = new neu.ccs.cs5200.mbps.ldb.view.member.ViewProfile();
viewWishList1 = new neu.ccs.cs5200.mbps.ldb.view.member.ViewWishList();
viewDues1 = new neu.ccs.cs5200.mbps.ldb.view.member.ViewDues();
memberBookSearch1 = new neu.ccs.cs5200.mbps.ldb.view.member.MemberBookSearch();
manageBooks1 = new neu.ccs.cs5200.mbps.ldb.view.librarian.ManageBooks();
checkOutBooks1 = new neu.ccs.cs5200.mbps.ldb.view.librarian.CheckOutBooks();
viewCheckedOutBooks1 = new neu.ccs.cs5200.mbps.ldb.view.member.ViewCheckedOutBooks();
deleteMembership1 = new neu.ccs.cs5200.mbps.ldb.view.member.DeleteMembership();
returnBooks1 = new neu.ccs.cs5200.mbps.ldb.view.librarian.ReturnBooks();
librarianNavigationPanel1 = new neu.ccs.cs5200.mbps.ldb.view.librarian.LibrarianNavigationPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("MBPS Library Librarian");
viewPanel.setLayout(new java.awt.CardLayout());
viewPanel.add(viewProfile1, "memberViewProfile");
viewPanel.add(viewWishList1, "memberViewWishList");
viewPanel.add(viewDues1, "memberViewDues");
viewPanel.add(memberBookSearch1, "memberBookSearch");
viewPanel.add(manageBooks1, "librarianManageBooks");
viewPanel.add(checkOutBooks1, "librarianCheckOutBooks");
viewPanel.add(viewCheckedOutBooks1, "memberViewCheckedOutBooks");
viewPanel.add(deleteMembership1, "deleteMembership");
viewPanel.add(returnBooks1, "librarianReturnBooks");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(librarianNavigationPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 180, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(viewPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(viewPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)
.add(librarianNavigationPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(LibrarianHomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(LibrarianHomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(LibrarianHomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LibrarianHomeScreen.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LibrarianHomeScreen().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private neu.ccs.cs5200.mbps.ldb.view.librarian.CheckOutBooks checkOutBooks1;
private neu.ccs.cs5200.mbps.ldb.view.member.DeleteMembership deleteMembership1;
private neu.ccs.cs5200.mbps.ldb.view.librarian.LibrarianNavigationPanel librarianNavigationPanel1;
private neu.ccs.cs5200.mbps.ldb.view.librarian.ManageBooks manageBooks1;
private neu.ccs.cs5200.mbps.ldb.view.member.MemberBookSearch memberBookSearch1;
private neu.ccs.cs5200.mbps.ldb.view.librarian.ReturnBooks returnBooks1;
private neu.ccs.cs5200.mbps.ldb.view.member.ViewCheckedOutBooks viewCheckedOutBooks1;
private neu.ccs.cs5200.mbps.ldb.view.member.ViewDues viewDues1;
private javax.swing.JPanel viewPanel;
private neu.ccs.cs5200.mbps.ldb.view.member.ViewProfile viewProfile1;
private neu.ccs.cs5200.mbps.ldb.view.member.ViewWishList viewWishList1;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
ad97e91026ff081d16f5b47e193a8c1f4571eec5 | 585872122287edccd1765174245c7dc754ee771a | /src/poo/lambda/LancableIntensite.java | db2b3d97abd4196fc1697eaf55035036637524c2 | [] | no_license | aKimtsPro/Java | d51fe99bdec1eb358e7d7ba5b4e3479b867d7835 | 09d785749722706fdd997fa7c9d7bc040ef3c38f | refs/heads/master | 2023-07-04T10:11:56.796459 | 2021-08-12T10:42:36 | 2021-08-12T10:42:36 | 381,693,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 92 | java | package poo.lambda;
public interface LancableIntensite {
int lancer(int intensite);
}
| [
"[email protected]"
] | |
3a58c3191a3d5a0903dc5de1622218082b4e45fb | a5e9dbe698a3bb180ff6011868e8af958212f2ab | /src/com/normalexception/app/rx8club/task/PmTask.java | 9f7015e14c37476fd9ef5621512e7369487e9836 | [
"MIT"
] | permissive | paimonsoror/RX8Club.com-Forum-Application | 4de3cdf0898772426953c6900dce5e8da2baa57a | c21c8037f5984ee7ce37ad43c09a796335f0ea01 | refs/heads/master | 2018-12-28T11:18:48.525674 | 2015-01-22T23:33:36 | 2015-01-22T23:33:36 | 6,002,527 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,869 | java | package com.normalexception.app.rx8club.task;
/************************************************************************
* NormalException.net Software, and other contributors
* http://www.normalexception.net
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
************************************************************************/
import java.io.IOException;
import org.apache.http.client.ClientProtocolException;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.normalexception.app.rx8club.Log;
import com.normalexception.app.rx8club.fragment.FragmentUtils;
import com.normalexception.app.rx8club.fragment.pm.PrivateMessageInboxFragment;
import com.normalexception.app.rx8club.html.HtmlFormUtils;
public class PmTask extends AsyncTask<Void,Void,Void>{
private ProgressDialog mProgressDialog;
private Fragment sourceFragment;
private String token, text, doType, recipients, title, pmid;
private Logger TAG = LogManager.getLogger(this.getClass());
/**
* Async Task handler for submitting a Private messages
* @param sourceActivity
* @param securityToken
* @param subject
* @param toPost
* @param recipients
* @param pmid
*/
public PmTask(Fragment sourceActivity, String securityToken, String subject,
String toPost, String recipients, String pmid) {
this.sourceFragment = sourceActivity;
this.token = securityToken;
this.text = toPost;
this.doType = "insertpm";
this.recipients = recipients;
this.title = subject;
this.pmid = pmid;
}
/*
* (non-Javadoc)
* @see android.os.AsyncTask#onPostExecute(java.lang.Object)
*/
@Override
protected void onPostExecute(Void result) {
try {
mProgressDialog.dismiss();
mProgressDialog = null;
} catch (Exception e) {
Log.w(TAG, e.getMessage());
}
Bundle args = new Bundle();
args.putString("link", HtmlFormUtils.getResponseUrl());
FragmentUtils.fragmentTransaction(sourceFragment.getActivity(),
new PrivateMessageInboxFragment(), false, false, args);
}
/*
* (non-Javadoc)
* @see android.os.AsyncTask#onPreExecute()
*/
@Override
protected void onPreExecute() {
mProgressDialog =
ProgressDialog.show(sourceFragment.getActivity(), "Sending...", "Sending PM...");
}
/*
* (non-Javadoc)
* @see android.os.AsyncTask#doInBackground(Params[])
*/
@Override
protected Void doInBackground(Void... params) {
try {
HtmlFormUtils.submitPM(doType, token,
text, title, recipients, pmid);
} catch (ClientProtocolException e) {
Log.e(TAG, e.getMessage(), e);
} catch (IOException e) {
Log.e(TAG, e.getMessage(), e);
}
return null;
}
}
| [
"[email protected]"
] | |
54fff79104a34bc9997a6d01bc62eef81355f046 | 10794c94aae85847f7155585dfc3c6608547ba40 | /src/xyz/fbeye/UI/page/LoginPanel.java | 12fa1890fb2a597474e384af3d01c4ac336b1e1b | [] | no_license | ddoo-ddah/fbeye-desktop_windows | 88562108156be934d4f57e7b60220e1fc87f184a | ca23c71a86cd6e796ba2089c2f2dcebdff065566 | refs/heads/master | 2022-12-22T01:25:35.893444 | 2020-09-10T04:23:51 | 2020-09-10T04:23:51 | 281,558,025 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,502 | java | /*
* LoginPanel.java
* Author : susemeeee
* Created Date : 2020-08-06
*/
package xyz.fbeye.UI.page;
import xyz.fbeye.datatype.LoginInfo;
import xyz.fbeye.datatype.event.Destination;
import xyz.fbeye.datatype.event.Event;
import xyz.fbeye.datatype.event.EventDataType;
import xyz.fbeye.datatype.event.EventList;
import xyz.fbeye.util.ViewDisposer;
import com.mommoo.flat.button.FlatButton;
import com.mommoo.flat.text.textfield.FlatTextField;
import com.mommoo.flat.text.textfield.format.FlatTextFormat;
import com.mommoo.util.FontManager;
import javax.swing.*;
import java.awt.*;
public class LoginPanel extends Page{
private FlatButton loginButton;
private FlatTextField inputExamId;
private FlatTextField inputUserId;
public LoginPanel(EventList list){
super(list);
initPanel();
timer = null;
}
@Override
protected void initPanel() {
layout = new GridBagLayout();
layout.columnWidths = new int[]{0, 0, 0, 0};
layout.columnWeights = new double[]{0.8, 1.0, 0.5, 0.1, Double.MIN_VALUE};
layout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
layout.rowWeights = new double[]{50, 350, 100, 85, 30, 85, 70, 80, 150, Double.MIN_VALUE};
constraints = new GridBagConstraints();
panel = new JPanel();
panel.setBackground(new Color(222, 239, 255));
panel.setSize(Toolkit.getDefaultToolkit().getScreenSize());
panel.setLocation(new Point(0,0));
panel.setLayout(layout);
setView();
panel.setVisible(true);
}
@Override
protected void setView(){
loginButton = new FlatButton(" 인 증 ");
loginButton.setFont(FontManager.getNanumGothicFont(Font.PLAIN, ViewDisposer.getFontSize(50)));
loginButton.addActionListener(e -> onLoginButtonClicked());
loginButton.setForeground(Color.BLACK);
loginButton.setBackground(new Color(255, 109, 112));
loginButton.setVisible(true);
constraints.anchor = GridBagConstraints.LAST_LINE_END;
addComponent(loginButton, 1, 7, 1, 1, GridBagConstraints.VERTICAL);
constraints.anchor = GridBagConstraints.CENTER;
inputExamId = new FlatTextField(false);
inputExamId.setOpaque(false);
inputExamId.setHint("시험 코드");
inputExamId.setFormat(FlatTextFormat.TEXT, FlatTextFormat.NUMBER_DECIMAL);
inputExamId.setHintForeground(new Color(255, 109, 112));
inputExamId.setFocusGainedColor(new Color(255, 109, 112));
inputExamId.setFocusLostColor(Color.BLACK);
inputExamId.setFont(FontManager.getNanumGothicFont(Font.PLAIN, ViewDisposer.getFontSize(50)));
inputExamId.setIconImage(Toolkit.getDefaultToolkit().createImage("files/loginIcon.png"));
inputExamId.setVisible(true);
addComponent(inputExamId, 1, 3, 1, 1, GridBagConstraints.BOTH);
inputUserId = new FlatTextField(false);
inputUserId.setOpaque(false);
inputUserId.setHint("응시자 코드");
inputUserId.setFormat(FlatTextFormat.TEXT, FlatTextFormat.NUMBER_DECIMAL);
inputUserId.setHintForeground(new Color(255, 109, 112));
inputUserId.setFocusGainedColor(new Color(255, 109, 112));
inputUserId.setFocusLostColor(Color.BLACK);
inputUserId.setFont(FontManager.getNanumGothicFont(Font.PLAIN, ViewDisposer.getFontSize(50)));
inputUserId.setIconImage(Toolkit.getDefaultToolkit().createImage("files/loginIcon.png"));
inputUserId.setVisible(true);
addComponent(inputUserId, 1, 5, 1, 1, GridBagConstraints.BOTH);
ImageIcon img = new ImageIcon("files/logo.png");
JLabel logoImageLabel = new JLabel(img);
logoImageLabel.setVisible(true);
addComponent(logoImageLabel, 1, 1, 1, 1, GridBagConstraints.BOTH);
}
@Override
protected void restore(){
for(int i = 0; i < list.size(); i++){
if(list.get(i) == null){
break;
}
if(list.get(i).destination == Destination.LOGIN_PAGE && list.get(i).eventDataType == EventDataType.SIGNAL){
if(list.get(i).data.equals("signOk")){
login();
}
else if(list.get(i).data.equals("signFailed")){
loginButton.setEnabled(true);
list.add(new Event(Destination.MANAGER, EventDataType.DIALOG_REQUEST, "loginError"));
}
list.remove(i);
}
else if(list.get(i).destination == Destination.LOGIN_PAGE && list.get(i).eventDataType == EventDataType.QR_CODE_DATA){
list.add(new Event(Destination.ENV_TEST_1, EventDataType.QR_CODE_DATA, list.get(i).data));
list.remove(i);
}
else if(list.get(i).destination == Destination.LOGIN_PAGE && list.get(i).eventDataType == EventDataType.ENCRYPTED_QUESTION){
list.add(new Event(Destination.ENV_TEST_3, EventDataType.ENCRYPTED_QUESTION, list.get(i).data));
list.remove(i);
}
}
}
private void login(){
list.add(new Event(Destination.EXAM_INFO_PAGE, EventDataType.NAVIGATE, null));
}
private void onLoginButtonClicked(){
loginButton.setEnabled(false);
String loginData = new LoginInfo(inputExamId.getText(), inputUserId.getText()).toString();
list.add(new Event(Destination.SERVER, EventDataType.LOGIN_CODE, loginData));
}
}
| [
"[email protected]"
] | |
3bcb97febede93ece5d97cdabbb57e6bc88ab6a2 | d146b23bc41e3f8196796a44023687da202e3eae | /core/src/com/libgdxopencv/Utilities/Controller.java | cb6e15fb3c5165fe01b76c2b5cbb357a12a430bc | [] | no_license | WinThuLatt/libGDX_OpenCV | 9bd7d760de86ddfb36c54fb33b4e403a17ec12a8 | 3aeb1d0e91964b7df6ffdb73fe48189c3ea05c6c | refs/heads/master | 2021-03-27T09:46:32.477597 | 2017-01-03T17:32:58 | 2017-01-03T17:32:58 | 77,726,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,350 | java | package com.libgdxopencv.Utilities;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.libgdxopencv.libGDXOpenCV_Main;
/**
* Created by my on 10/21/2016.
*/
public class Controller implements Disposable
{
private Viewport viewport;
private Stage stage;
private boolean leftPressed;
private float buttonHeight = 100;
public boolean isLeftPressed()
{
return leftPressed;
}
public boolean isRightPressed()
{
return rightPressed;
}
private boolean rightPressed;
private OrthographicCamera camera;
private libGDXOpenCV_Main app;
public Controller(libGDXOpenCV_Main app)
{
camera = new OrthographicCamera();
camera.setToOrtho(false, libGDXOpenCV_Main.WIDTH, libGDXOpenCV_Main.HEIGHT);
viewport = new FitViewport(libGDXOpenCV_Main.WIDTH, libGDXOpenCV_Main.HEIGHT, camera);
stage = new Stage(viewport, app.getBatch());
this.app = app;
CustomInputListener leftInputListener = new CustomInputListener()
{
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
{
System.out.println("leftPressed");
setPressed(true);
leftPressed = true;
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button)
{
setPressed(false);
leftPressed = false;
}
};
CustomInputListener rightInputListener = new CustomInputListener()
{
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
{
System.out.println("rightPressed");
setPressed(true);
rightPressed = true;
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button)
{
setPressed(false);
rightPressed = false;
}
};
TextureButton left = new TextureButton(app.getAtlas().findRegion("left"),
app.getAtlas().findRegion("leftPressed"), 0, buttonHeight, leftInputListener);
TextureButton right = new TextureButton(app.getAtlas().findRegion("right"),
app.getAtlas().findRegion("rightPressed"),
libGDXOpenCV_Main.WIDTH - app.getAtlas().findRegion("right").getRegionWidth(), buttonHeight,
rightInputListener);
left.addListener(leftInputListener);
right.addListener(rightInputListener);
stage.addActor(left);
stage.addActor(right);
final libGDXOpenCV_Main temp = app;
stage.addListener(new InputListener()
{
@Override
public boolean keyDown(InputEvent event, int keycode)
{
if (keycode == Input.Keys.MENU)
{
System.out.println("MENU");
temp.UI_CALLBACK.ToastMessage("MENU");
}
return true;
}
@Override
public boolean keyUp(InputEvent event, int keycode)
{
return super.keyUp(event, keycode);
}
});
Gdx.input.setCatchBackKey(true);
Gdx.input.setCatchMenuKey(true);
Gdx.input.setInputProcessor(stage);
}
public void draw()
{
stage.draw();
}
@Override
public void dispose()
{
}
}
| [
"[email protected]"
] | |
247b16888dd26f8617f4f60237284d3af32b2a09 | 46cde4ffde5160f4df9bb678293a1cef3a9065b3 | /kfcms/src/main/java/com/kfcms/util/UserStatus.java | 7b89608bcd975e8ae467d9dd2b9bb226270365cb | [] | no_license | rolyer/kfcms | 64b6e41413659bd0c0ffb82648a171ae293c402a | 4d489d77565c0a8144bef7bc9cc02d03484aa3d7 | refs/heads/master | 2021-01-24T06:39:50.892908 | 2014-10-23T15:03:19 | 2014-10-23T15:03:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.kfcms.util;
public enum UserStatus {
UNCKECKED(0), CHECKED(1), LOCKED(2);
private final Integer value;
private UserStatus(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
}
| [
"[email protected]"
] | |
a2bc227ce4283cc0ef876b0dcf747f06b5732d45 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/26/26_bbc79d527829c8bdc4afa9193c4d4b9f030da8e5/MLBuildAndConfigurationTest/26_bbc79d527829c8bdc4afa9193c4d4b9f030da8e5_MLBuildAndConfigurationTest_t.java | e140e1aaff9f74cf61449b14cacb0a23df9c178a | [] | 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 | 5,648 | java | package com.xmlmachines.tests;
import java.io.IOException;
import junit.framework.Assert;
import nu.xom.ParsingException;
import nu.xom.ValidityException;
import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import com.marklogic.xcc.Request;
import com.marklogic.xcc.ResultSequence;
import com.marklogic.xcc.Session;
import com.marklogic.xcc.exceptions.RequestException;
import com.xmlmachines.Consts;
import com.xmlmachines.TestHelper;
import com.xmlmachines.providers.IOUtilsProvider;
import com.xmlmachines.providers.MarkLogicContentSourceProvider;
public class MLBuildAndConfigurationTest {
private static Logger LOG = Logger
.getLogger(MLBuildAndConfigurationTest.class);
@BeforeClass
public static void setUp() throws RequestException {
// LOG.info("creating ML database for tests");
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession();
s.submitRequest(
s.newAdhocQuery(IOUtilsProvider.getInstance().readFileAsString(
"src/main/resources/xqy/basic-test-setup.xqy")))
.close();
// Populate
TestHelper t = new TestHelper();
try {
t.processMedlineXML("xom");
} catch (ValidityException e) {
LOG.error(e);
} catch (ParsingException e) {
LOG.error(e);
} catch (IOException e) {
LOG.error(e);
}
}
@Test
public void wasIngestCompleted() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
Request r = s.newAdhocQuery("xdmp:database()");
ResultSequence rs = s.submitRequest(r);
LOG.info("Database id: " + rs.asString());
r = s.newAdhocQuery("xdmp:estimate(doc())");
rs = s.submitRequest(r);
Assert.assertEquals("156", rs.asString());
s.close();
}
@Test
public void isFirstDocumentElemOfExpectedType() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
Request r = s
.newAdhocQuery("fn:name(doc()[1]/element()) eq 'MedlineCitation'");
ResultSequence rs = s.submitRequest(r);
Assert.assertEquals("true", rs.asString());
s.close();
}
@Test
public void isUriLexiconAvailable() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
Request r = s.newAdhocQuery("cts:uris( '', ('document') )");
ResultSequence rs = s.submitRequest(r);
// LOG.info(rs.asString());
Assert.assertEquals(156, rs.size());
s.close();
}
@Test
public void isCollectionLexiconAvailable() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
// Given I have a doc with no collections
Request r = s.newAdhocQuery("xdmp:document-insert('1.xml', <one/>)");
s.submitRequest(r);
Request r1 = s.newAdhocQuery("count(cts:collections('1.xml'))");
ResultSequence rs = s.submitRequest(r1);
Assert.assertEquals("0", rs.asString());
// When I add a collection to the doc
Request r2 = s.newAdhocQuery("xdmp:document-add-collections('1.xml', 'test')");
s.submitRequest(r2);
// Then the total collections for that doc should be one
ResultSequence rs1 = s.submitRequest(r1);
Assert.assertEquals(1, rs1.size());
Assert.assertEquals("1", rs1.asString());
Request r3 = s.newAdhocQuery("xdmp:document-delete('1.xml')");
ResultSequence rs3 = s.submitRequest(r3);
s.close();
}
@Test
public void addDocsToCollection() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
Request r = s
.newAdhocQuery("for $doc in doc()/MedlineCitation/@Status[. ne 'MEDLINE']\nreturn (xdmp:document-add-collections(xdmp:node-uri($doc), 'not-medline'), <done/>)");
ResultSequence rs = s.submitRequest(r);
LOG.info(rs.asString());
Assert.assertEquals(21, rs.size());
s.close();
}
@Test
public void doesDatabaseContainOneCollection() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession(Consts.UNIT_TEST_DB);
Request r = s.newAdhocQuery("count(cts:collections())");
ResultSequence rs = s.submitRequest(r);
Assert.assertEquals("0", rs.asString());
Request r1 = s.newAdhocQuery("xdmp:document-add-collections(xdmp:node-uri(doc()[1]), 'test')");
ResultSequence rs1 = s.submitRequest(r1);
ResultSequence rs2 = s.submitRequest(r);
Assert.assertEquals(1, rs2.size());
Assert.assertEquals("1", rs2.asString());
Request r2 = s.newAdhocQuery("xdmp:document-remove-collections(xdmp:node-uri(doc()[1]), 'test')");
ResultSequence rs3 = s.submitRequest(r);
s.close();
}
@AfterClass
public static void tearDown() throws RequestException {
Session s = MarkLogicContentSourceProvider.getInstance()
.getProductionContentSource().newSession();
s.submitRequest(
s.newAdhocQuery(IOUtilsProvider.getInstance().readFileAsString(
"src/main/resources/xqy/basic-test-teardown.xqy")))
.close();
}
}
| [
"[email protected]"
] | |
5bc93cb60e71a2ec0daf36f180dad8c8c0688866 | 7d7381a466365b1b9134a49d1ad847e5cc383ffb | /src/main/java/com/books/books/model/Book.java | f74e6fd983412bdb51b09d37ee8fcb88a26a66df | [] | no_license | chaudharisucheta/books | 1e526250777e09519e83d3c91aa20b92fb3f92a0 | 49978b7c2040b151e9ba7100f7f5995cac63dfe1 | refs/heads/master | 2022-12-16T17:59:49.548926 | 2020-09-18T06:58:33 | 2020-09-18T06:58:33 | 296,539,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,619 | java | package com.books.books.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Book {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Integer bookNo;
String bookName;
String author;
String publisher;
public Integer getBookNo() {
return bookNo;
}
public void setBookNo(Integer bookNo) {
this.bookNo = bookNo;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public Integer getNoOfPages() {
return noOfPages;
}
public void setNoOfPages(Integer noOfPages) {
this.noOfPages = noOfPages;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getRating() {
return rating;
}
public void setRating(Integer rating) {
this.rating = rating;
}
Integer noOfPages;
Double price;
String status;
Integer rating;
}
| [
"[email protected]"
] | |
d84ee9eef63cb1b76da9b909f96e86384fcc9e12 | f5ae7bfc4f3bc0094ae15974b53edb58e034ab5c | /src/main/java/org/pp/tomcat/ch02/ServletProcessor1.java | 968527479a70b538d59931cfaf852fc4253f7b28 | [] | no_license | GitJavaProgramming/tomcatweb | d2badad8474a10bbc04ef84d17acfadb3caba2b5 | a070af2cfdc8b5b38838cc3fc2907cf0d7af158f | refs/heads/master | 2020-12-22T23:13:59.009505 | 2020-02-08T02:39:32 | 2020-02-08T02:39:32 | 236,958,337 | 4 | 0 | null | 2020-10-13T19:08:52 | 2020-01-29T10:37:43 | Java | UTF-8 | Java | false | false | 1,740 | java | package org.pp.tomcat.ch02;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandler;
import java.io.File;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class ServletProcessor1 {
public void process(Request request, Response response) {
String uri = request.getUri();
String servletName = uri.substring(uri.lastIndexOf("/") + 1);
URLClassLoader loader = null;
try {
// create a URLClassLoader
URL[] urls = new URL[1];
URLStreamHandler streamHandler = null;
File classPath = new File(Constants.WEB_ROOT);
// the forming of repository is taken from the createClassLoader method in
// org.apache.catalina.startup.ClassLoaderFactory
String repository = (new URL("file", null, classPath.getCanonicalPath() + File.separator)).toString() ;
// the code for forming the URL is taken from the addRepository method in
// org.apache.catalina.loader.StandardClassLoader class.
urls[0] = new URL(null, repository, streamHandler);
loader = new URLClassLoader(urls);
}
catch (IOException e) {
System.out.println(e.toString() );
}
Class myClass = null;
try {
myClass = loader.loadClass(servletName);
}
catch (ClassNotFoundException e) {
System.out.println(e.toString());
}
Servlet servlet = null;
try {
servlet = (Servlet) myClass.newInstance();
servlet.service((ServletRequest) request, (ServletResponse) response);
}
catch (Exception e) {
System.out.println(e.toString());
}
catch (Throwable e) {
System.out.println(e.toString());
}
}
} | [
"[email protected]"
] | |
af5433c0fb4caa666fb538dd05ef1ec1cbad75e6 | c99ef55f2235d72702ff4dc0691e70ef512e7a96 | /src/com/mctlab/ansight/common/network/http/HttpHeadTask.java | 60789c542a5a9fc7f4ebd43543e525f2b5fbe5b6 | [] | no_license | mctlab/salesd | a482a3e6d2171735d25fd7c05fc8399f62dd3601 | 3a77ec7fd63a129bc888b7d33443a66536101520 | refs/heads/master | 2020-04-25T18:07:06.762771 | 2014-07-14T17:03:47 | 2014-07-14T17:03:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.mctlab.ansight.common.network.http;
import com.mctlab.ansight.common.network.api.ExecutorCallback;
import com.mctlab.ansight.common.network.form.IForm;
import com.mctlab.ansight.common.util.HttpUtils;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpUriRequest;
public class HttpHeadTask extends AbsHttpTask<Void> {
public HttpHeadTask(String baseUrl, IForm form, ExecutorCallback<Void> callback) {
super(HttpUtils.generateHeadUrl(baseUrl, form), form, callback);
}
@Override
protected HttpUriRequest onCreateRequest() {
return new HttpHead(getUrl());
}
}
| [
"[email protected]"
] | |
a5ed58cce6a44aff970506cce0cb9ae57078cbb2 | 6da0eddada93a15f102526fcdb1c7f9b5ca4010a | /src/test/java/com/zcm/cate/MapTest.java | fa05135d59ae3ee2cb2ae388bc2d33590ac5708b | [] | no_license | peijiezhang/spring-annotation | 53f0dca2764e6edc124bef990c58a93a8663e49f | 71c5627cf833f9e0d3fd55bc8b5b8ccb4324ebb6 | refs/heads/master | 2020-04-24T03:45:53.276003 | 2019-02-20T13:47:37 | 2019-02-20T13:47:37 | 171,680,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,615 | java | package com.zcm.cate;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* Created by zhangpeijie on 2018/11/15.
*/
public class MapTest {
@Test
public void testKey(){
/**
* key是哪个User,value代表有多钱
*/
Map<User,Long> map = new HashMap<User, Long>();
User user = new User("zcm",1L);
map.put( user , 100L);
System.out.println("user====" + map.get(user) );
User user1 = new User("zcm",1L);
// Map 怎么判断一个 K是同样的key
System.out.println("user1====" + map.get(user1) );
//map是通过key的hashcode和 equal方法来判断是不是一样的
// 当前仅当 hashcode 和equal都相等才是同一个对象
// 并不是通过地址来决定是不是一个对象
System.out.println( user.hashCode() +"==" + user1.hashCode() );
System.out.println( user.equals( user1 ));
String name = new String("zcm");
String name1 = new String("zcm");
System.out.println( name == name1);
System.out.println("===" + name.equals( name1 ));
System.out.println( "====" + (name.hashCode() == name1.hashCode() ));
System.out.println("==========================================");
Map<String,Long> map1 = new HashMap<String, Long>();
map1.put(new String("zcm"),100L);
System.out.println("====" + map1.get("zcm"));
}
static class User{
private String name;
private Long age;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
if (age != null ? !age.equals(user.age) : user.age != null) return false;
if (name != null ? !name.equals(user.name) : user.name != null) return false;
return true;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (age != null ? age.hashCode() : 0);
return result;
}
public User(String name, Long age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getAge() {
return age;
}
public void setAge(Long age) {
this.age = age;
}
}
}
| [
"[email protected]"
] | |
22d6d6afb0e5a1a80b5ba4324f61c454bc943c38 | be49756a1dd83bee2f8a709595f6954b3648fc3b | /Important_JavA_Programs_ISC/IMEI.java | 328c343f36881a713b1b71cfa27b473955b3de72 | [
"Apache-2.0"
] | permissive | CalebJebadurai/12th-Programs | c76e753400c5337bbf4fb5dba127091e10cdae9a | ed80458fbcf73ec98924a80ee20f6c9faf6d09cb | refs/heads/master | 2020-03-19T11:42:56.636772 | 2018-06-07T17:39:24 | 2018-06-07T17:39:24 | 136,472,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,905 | java | package Important_JavA_Programs_ISC;
/**
* The class IMEI inputs a 15 digit number and checks whether it is a valid IMEI or not
* @author : www.javaforschool.com
* @Program Type : BlueJ Program - Java
*/
import java.io.*;
class IMEI
{
int sumDig(int n) // Function for finding and returning sum of digits of a number
{
int a = 0;
while(n>0)
{
a = a + n%10;
n = n/10;
}
return a;
}
public static void main(String args[])throws IOException
{
IMEI ob = new IMEI();
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter a 15 digit IMEI code : ");
long n = Long.parseLong(br.readLine()); // 15 digits cannot be stored in 'int' data type
String s = Long.toString(n); // Converting the number into String for finding length
int l = s.length();
if(l!=15) // If length is not 15 then IMEI is Invalid
System.out.println("Output : Invalid Input");
else
{
int d = 0, sum = 0;
for(int i=15; i>=1; i--)
{
d = (int)(n%10);
if(i%2 == 0)
{
d = 2*d; // Doubling every alternate digit
}
sum = sum + ob.sumDig(d); // Finding sum of the digits
n = n/10;
}
System.out.println("Output : Sum = "+sum);
if(sum%10==0)
System.out.println("Valid IMEI Code");
else
System.out.println("Invalid IMEI Code");
}
}
}
// Source: http://www.javaforschool.com/1528698-java-program-to-check-for-valid-imei-number/#ixzz3R5PIfR5Z
| [
"[email protected]"
] | |
568d01879df659295d2115e1351ea7cfae82cc95 | 45e1a000d745d7ea63f8d69976ce013da948adff | /src/main/parser/grammar/exceptions/InvalidSentenceException.java | 9bef25d1bbd3f887f77c164df5dd268b95d087e0 | [] | no_license | lucas-roman/Trabalho_Formais | cd07505157eb8f9b453ce0f3bd59036cc28c13a6 | 31b7074a1262da7971a004af55ee08b468ab8828 | refs/heads/master | 2021-01-10T07:37:19.888723 | 2015-11-29T21:07:41 | 2015-11-29T21:07:41 | 43,334,691 | 1 | 0 | null | 2015-10-02T02:13:33 | 2015-09-29T00:19:24 | Java | UTF-8 | Java | false | false | 102 | java | package main.parser.grammar.exceptions;
public class InvalidSentenceException extends Exception {
}
| [
"[email protected]"
] | |
8c6a6c198782dd8ae5890ad3a24d9d85a0cabb76 | 3dc8b7e4ecec586a378f849901f21880dc051980 | /PhjfAdmin/src/main/java/com/bankwel/phjf_admin/common/util/RansomCodeUtil.java | 9b44d5be2d0623e41c19df5d511660223f332e8d | [] | no_license | Kissyu/bankwel-puhuijinfu-admin | 2d2fcfb6e6acee0019c3698cffa20f771a2e2542 | cc89d4f1c68dfdefaa3f0cad76d6ef93a67ce209 | refs/heads/master | 2020-03-24T20:31:44.945405 | 2018-07-31T08:29:31 | 2018-07-31T08:32:05 | 142,983,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,973 | java | package com.bankwel.phjf_admin.common.util;
import java.util.Random;
/**
* Created by dingbs on 2016/11/7.
*/
public class RansomCodeUtil {
private static char[] charSequence = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".toCharArray();
private static char[] numSequence = "0123456789".toCharArray();
private static Random random = new Random();
public static String generatorRansomCode(PrefixCodeType codeType){
// 该变量用来保存系统生成的随机字符串
StringBuilder sRand = new StringBuilder(codeType.value);
for (int i = 0; i < 10; i++) {
sRand.append(getRandomChar());
}
for (int i = 0; i < 5; i++) {
sRand.append(getRandomNumChar());
}
return sRand.toString();
}
public enum PrefixCodeType{
NEWS("新闻相关", "NEWS_"), BANK("银行相关", "BANK"),PROMOTE("推广码","PROMOTE_"),MANAGEPOINT("办理点相关","POINT_"),FINANCIAL("理财产品相关","FIN_"),INSURANCE("保险相关","INSURANCE_")
,CMS_BANNER("官网banner","CMSBANNER"),CMS_NAV("导航","CMSNAV"),CMS_CONTENT("内容","CMSCONTENT");
// 成员变量
private String remark;
private String value;
// 构造方法
PrefixCodeType(String remark, String value) {
this.remark = remark;
this.value = value;
}
}
// 随机生成一个字符
private static String getRandomChar() {
int index = random.nextInt(charSequence.length);
return String.valueOf(charSequence[index]);
}
// 随机生成一个字符
private static String getRandomNumChar() {
int index = random.nextInt(numSequence.length);
return String.valueOf(numSequence[index]);
}
public static void main(String[] args){
for(int i=0;i<100;i++){
System.out.println(generatorRansomCode(PrefixCodeType.NEWS));
}
}
}
| [
"[email protected]"
] | |
67851d6376a0427384b62b1b4fb39b591adbe35a | bf788477e93d4f7dd9c623f53e21801cab27a248 | /applications/hbase-sink-with-trigger-on-finish/server/persistence/src/test/java/org/springframework/integration/samples/hbase/test/TestMapRedJobs.java | e90cddd26c292078e8cf8d0656b876b7158a4632 | [] | no_license | fpompermaier/spring-integration-samples | 5ffd3baa172fd0924e15faad1522856a278b0889 | 475dc28d4a8a76d272c22e6f55987311a5b20049 | refs/heads/master | 2021-01-18T13:32:59.486574 | 2013-07-29T21:36:42 | 2013-07-29T21:36:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 960 | java | package org.springframework.integration.samples.hbase.test;
import java.util.Calendar;
import java.util.Date;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.mapreduce.Job;
import org.junit.Test;
import org.springframework.integration.samples.hbase.jobs.SampleJob;
public class TestMapRedJobs {
@Test
public void testMapReduceJob() throws Exception {
Configuration conf = HBaseConfiguration.create();
Date yesterady = getDayBefore(new Date());
Job job = SampleJob.createSampleJob(conf, "mysource", yesterady);
boolean success = job.waitForCompletion(true);
String successStr = success ? "successfully" : "with errors";
System.out.println("Sample mapreduce job completed " + successStr);
}
private static Date getDayBefore(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DAY_OF_MONTH, -1);
return cal.getTime();
}
}
| [
"[email protected]"
] | |
2f7d66cf1004510665f11fc1d00b4f1e66ba4a1c | fedd2af0acbe6688032084989f5ff9d97470e26a | /li2/connection/clientRequests/ChangeInfo.java | 926b63d6f0936b5188f09fa7061eb1b779f47c91 | [] | no_license | a2liu/DSFP-Client | 267f3bdedd5da12e408b69060685045f2b83c6bc | 0e5d2a003b8258ecaa37f3079177fd53f10f6684 | refs/heads/master | 2020-03-18T04:06:42.461979 | 2018-06-04T13:28:34 | 2018-06-04T13:28:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package connection.clientRequests;
import users.User;
public class ChangeInfo extends ClientRequest {
/**
*
*/
private static final long serialVersionUID = 1L;
public ChangeInfo( User user) {
super(19, user);
}
}
| [
"[email protected]"
] | |
fe605faf5049853d838d5f9f9db31c126dcb6ff1 | e277e0b3b208171dd09f731031598fbafbc594d1 | /BaseDatos/src/basedatos/Listado.java | ecc3e06043911caa5bc0ae990ab22c69cfc29958 | [] | no_license | grekodev/clasesjava0 | 1b103af6adf7d5ac52b5d516b405ab2173edeb08 | 55ba096af9e9c32b5b6b88afc841fee001a621b3 | refs/heads/master | 2021-05-27T11:38:54.455207 | 2014-06-06T02:23:06 | 2014-06-06T02:23:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | package basedatos;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Listado {
public static void main(String[] args) throws SQLException {
BaseDatos db = new BaseDatos();
ResultSet rs = db.consulta_sql("select * from country");
rs.first();
do {
System.out.println(rs.getInt("country_id") + " " + rs.getString("country"));
} while (rs.next());
db.cerrar();
}
}
| [
"[email protected]"
] | |
499cf2737e8ed95787957b53dfde51c1b51a888d | 63c78b39658bbab1eba605105a4c99bcf9314a01 | /StreamCompat/src/main/java/com/github/wrdlbrnft/streamcompat/intstream/IntIteratorWrapper.java | 6032c47e3b4d34cc3a262a846ad76c5ccb024975 | [] | no_license | lizhengdao/StreamCompat | abb7e5ec4d38dbfeef6c07216a8a530972a5f968 | b680bb44efd657cec8f9a3d897a63c5cbebbc462 | refs/heads/master | 2021-08-27T18:44:18.466409 | 2017-11-02T02:34:45 | 2017-11-02T02:34:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package com.github.wrdlbrnft.streamcompat.intstream;
import com.github.wrdlbrnft.streamcompat.exceptional.BaseIteratorWrapper;
import com.github.wrdlbrnft.streamcompat.function.ToIntFunction;
import com.github.wrdlbrnft.streamcompat.function.ToLongFunction;
import com.github.wrdlbrnft.streamcompat.iterator.primtive.IntIterator;
import com.github.wrdlbrnft.streamcompat.iterator.primtive.LongIterator;
/**
* Created with Android Studio
* User: Xaver
* Date: 06/11/2016
*/
interface IntIteratorWrapper extends BaseIteratorWrapper<IntIterator> {
<E extends Throwable> void mapException(Class<E> exceptionClass, ToIntFunction<E> mapper);
}
| [
"[email protected]"
] | |
849bb7d5a4ad76b2d8962c3636b295260fb84a9f | e8f8cd59a37322b1903a5a34518ea6d2a38f5eb6 | /WEB-INF/classes/AccessoryList.java | 9b8f6861edfca8055ed383f89bc5b35d8d6e862a | [] | no_license | padmajeetpawar/Best-Deal | 7081f187771ae96502c83f2f95ee8eeceff0f23a | f9d9cec845f25c436249341f7c9027ae57ab00fe | refs/heads/master | 2021-07-06T22:43:45.281047 | 2021-03-30T14:58:51 | 2021-03-30T14:58:51 | 231,001,787 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,122 | java | import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/AccessoryList")
public class AccessoryList extends HttpServlet {
/* Accessory Page Displays all the Accessories and their Information in Game Speed */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
/* Checks the Console maker whether it is microsft or sony or nintendo
Add the respective product value to hashmap */
String CategoryName = request.getParameter("maker");
// String ConsoleName = request.getParameter("console");
HashMap<String,Accessory> allaccessories = new HashMap<String,Accessory> ();
HashMap<String,Console> allconsoles = new HashMap<String,Console> ();
/* Checks the Tablets type whether it is microsft or sony or nintendo */
try{
allconsoles = MySqlDataStoreUtilities.getConsoles();
}
catch(Exception e)
{
}
/* Checks the Tablets type whether it is microsft or sony or nintendo */
try{
allaccessories = MySqlDataStoreUtilities.getAccessories();
}
catch(Exception e)
{
}
HashMap<String, Console> hm = new HashMap<String, Console>();
if(CategoryName.equals("microsoft"))
{
for(Map.Entry<String,Console> entry : allconsoles.entrySet())
{
if(entry.getValue().getRetailer().equals("Microsoft"))
{
hm.put(entry.getValue().getId(),entry.getValue());
}
}
}
else if(CategoryName.equals("sony"))
{
for(Map.Entry<String,Console> entry : allconsoles.entrySet())
{
if(entry.getValue().getRetailer().equals("Sony"))
{
hm.put(entry.getValue().getId(),entry.getValue());
}
}
}
else if(CategoryName.equals("nintendo"))
{
for(Map.Entry<String,Console> entry : allconsoles.entrySet())
{
if(entry.getValue().getRetailer().equals("Nintendo"))
{
hm.put(entry.getValue().getId(),entry.getValue());
}
}
}
// Console console = hm.get(ConsoleName);
/* Header, Left Navigation Bar are Printed.
All the Accessories and Accessories information are dispalyed in the Content Section
and then Footer is Printed*/
Utilities utility = new Utilities(request,pw);
utility.printHtml("Header.html");
utility.printHtml("LeftNavigationBar.html");
pw.print("<div id='content'><div class='post'><h2 class='title meta'>");
pw.print("<a style='font-size: 24px;'>"+ CategoryName +": Accessories</a>");
pw.print("</h2><div class='entry'><table id='bestseller'>");
int i = 1; int size= 2;
for(Map.Entry<String, Console> entry : hm.entrySet())
{
Console console = entry.getValue();
for(Map.Entry<String, String> acc:console.getAccessories().entrySet())
{
Accessory accessory= allaccessories.get(acc.getValue());
if(i%2==1) pw.print("<tr>");
pw.print("<td><div id='shop_item'>");
pw.print("<h3>"+accessory.getName()+"</h3>");
pw.print("<strong>"+accessory.getPrice()+"$</strong><ul>");
pw.print("<li id='item'><img src='images/accessories/"+accessory.getImage()+"' alt='' /></li>");
pw.print("<li><form method='post' action='Cart'>" +
"<input type='hidden' name='name' value='"+acc.getValue()+"'>"+
"<input type='hidden' name='type' value='accessories'>"+
"<input type='hidden' name='maker' value='"+CategoryName+"'>"+
"<input type='hidden' name='access' value='"+console.getName()+"'>"+
"<input type='submit' class='btnbuy' value='Buy Now'></form></li>");
pw.print("<li><form method='post' action='WriteReview'>"+"<input type='hidden' name='name' value='"+accessory.getName()+"'>"+
"<input type='hidden' name='type' value='accessories'>"+
"<input type='hidden' name='maker' value='"+CategoryName+"'>"+
"<input type='hidden' name='access' value='"+console.getName()+"'>"+
"<input type='hidden' name='price' value='"+accessory.getPrice()+"'>"+
"<input type='submit' value='WriteReview' class='btnreview'></form></li>");
pw.print("<li><form method='post' action='ViewReview'>"+"<input type='hidden' name='name' value='"+accessory.getName()+"'>"+
"<input type='hidden' name='type' value='accessories'>"+
"<input type='hidden' name='maker' value='"+CategoryName+"'>"+
"<input type='hidden' name='access' value='"+console.getName()+"'>"+
"<input type='submit' value='ViewReview' class='btnreview'></form></li>");
pw.print("</ul></div></td>");
if(i%2==0 || i == size) pw.print("</tr>");
i++;
}
}
pw.print("</table></div></div></div>");
utility.printHtml("Footer.html");
}
}
| [
"[email protected]"
] | |
e35d5ad50a2768dc31b1a56a38a17ec72b9ae476 | f572e728f6f847c5dc812a900b65fc4934303715 | /GestionePrenotazioni/src/main/java/it/epicode/be/service/abstractions/AbstractEdificioService.java | 8f8940183fba488f8cfd070ce64dfc64c5aad595 | [] | no_license | smn-barbato91/Epicode | a1ed26fdf7c80357dae440ceb54e8e868a11e3fe | bf08a882dbf7b0a882e9b8ab0267b5cd205606e1 | refs/heads/master | 2023-07-24T11:54:26.239516 | 2021-09-01T07:12:15 | 2021-09-01T07:12:15 | 378,600,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package it.epicode.be.service.abstractions;
import java.util.List;
import it.epicode.be.model.Edificio;
public interface AbstractEdificioService {
Edificio salvaEdificio(Edificio e);
List<Edificio> listaEdifici();
}
| [
"[email protected]"
] | |
dc1bcfb99620ba8b6a4a373166faaa017cfdb8bd | 20ef03825126b49ce209d2e4def5d66de9accc34 | /JavaProject/src/com/encore/day03/ArrayTest.java | dc3a696f9dea0d909409246158b7be1d92591e3c | [] | no_license | sooyoungP/Java | 29e4a4a5a8cc54aa6262b2b72a59ef169ce22a44 | 224f146a5f73c6c96511f45951eb95a7578facf1 | refs/heads/master | 2020-04-02T21:25:29.579247 | 2018-11-02T08:46:59 | 2018-11-02T08:46:59 | 154,798,706 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 3,278 | java | package com.encore.day03;
import java.util.Scanner;
public class ArrayTest {
public static void main(String[] args) {
call5();
}
public static void call5() {
//시험 본 과목의 갯수를 입력하세요. 점수입력 총점 평균
Scanner sc = new Scanner(System.in);
System.out.print("시험 본 과목의 갯수를 입력하세요: ");
int count = sc.nextInt();
int[] score =new int[count];
System.out.print("점수를 입력하세요: ");
int total =0;
for(int i=0; i<count; i++) {
score[i] = sc.nextInt();
total += score[i];
}
System.out.println("총점:"+total);
System.out.println("평균:"+total/count);
}
public static void call4() {
// 사용자에게 친구 이름을 입력받자.
Scanner sc = new Scanner(System.in);
String[] friend;
System.out.print("친한 친구 몇명이야?: ");
int bf = sc.nextInt();
friend = new String[bf]; // null로 초기화가 된다.
System.out.print("친구이름을 입력하세요: ");
for (int i = 0; i < bf; bf++) {
friend[i] = sc.next();
System.out.println(friend[i] + "님이랑 친하시군요");
}
for (int i = 0; i < bf; bf++) {
System.out.println(friend[i] + "주소록에 저장되어있음");
}
sc.close();
}
public static void call3() {
// 이름 여러명을 저장한다.
String[] friend = { "임왕기", "박소영", "친구1", "친구2" };
for (int i = 0; i < friend.length; i++) {
System.out.println(friend[i] + "밥먹자");
}
}
public static void call2() {
// 점수 5개를 저장하라
int[] score;
score = new int[] { 80, 90, 85, 98, 100 };
// int[] score = new int[5]; 위의 2줄과 같은 의미
double total = 0;
double avg;
for (int i = 0; i < score.length; i++) {
total = total + score[i];
}
System.out.println("총점은" + total);
avg = total / score.length;
System.out.println("평균은" + avg);
}
public static void call() {
// 배열 : 동일한 이름으로 동일한 타입의 여러개의 값을 연속공간에 저장하기 위한 자료구조.
// 1. 배열 변수 선언
int[] score; // 더 선호한다. int score2[];둘다 사용가능
char[] carr;
// 2. 배열 생성(new)....자동 초기화가 된다. 타입이 int이면 0으로 자동 초기화가 된다.
score = new int[10];
carr = new char[5]; // 자동 초기화 완료. ''공백으로 초기화가 된다.
// 3. 배열 사용
System.out.println(score[0]);
System.out.println(score[9]);
System.out.println("갯수:" + score.length); // 좋은점 : 반복문에서 사용하기 좋다.
for (int i = 0; i < score.length; i++) {
System.out.println(score[i]);
}
for (int i = 0; i < carr.length; i++) {
System.out.println("char타입:" + i + "번쨰" + carr[i] + "*");
}
// 선언과 생성
boolean[] barr = new boolean[5];
for (int z = 0; z < barr.length; z++) {
System.out.println("boolean타입:" + z + "번째" + carr[z] + "*");
}
// 선언 + 생성+ 할당
// String[] str = new string[] {"커피","우유","밥"};
String[] str = { "커피", "우유", "밥" };
for (int k = 0; k < str.length; k++) {
System.out.println(str[k]);
}
}
}
| [
"[email protected]"
] | |
a0738414fcc13a726babe195af53d0ea981d06c1 | ae0c141378a4cd094535831bcb831839b64be49d | /src/main/java/com/asaphdesigns/dungeonmart/web/rest/vm/LoggerVM.java | 6ed584412f0faebafd4ed97d6bda720fec014bc7 | [] | permissive | qanwi1970/dungeonmart | d7f1ede18329400bd3bc80e93226e60ecd42f11c | c49f33a85b0a06c3c01089177cd1b3169fbbe364 | refs/heads/master | 2022-12-26T00:05:38.317429 | 2017-11-15T22:09:56 | 2017-11-15T22:09:56 | 110,890,763 | 0 | 1 | MIT | 2020-09-18T11:01:08 | 2017-11-15T21:52:38 | Java | UTF-8 | Java | false | false | 896 | java | package com.asaphdesigns.dungeonmart.web.rest.vm;
import ch.qos.logback.classic.Logger;
/**
* View Model object for storing a Logback logger.
*/
public class LoggerVM {
private String name;
private String level;
public LoggerVM(Logger logger) {
this.name = logger.getName();
this.level = logger.getEffectiveLevel().toString();
}
public LoggerVM() {
// Empty public constructor used by Jackson.
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
@Override
public String toString() {
return "LoggerVM{" +
"name='" + name + '\'' +
", level='" + level + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
2ff0bd191a9efcc60612a67f70dc2ebb7ca40300 | 18a7e850475c3c34b0def1f10e1c70be780413a0 | /com/epam/task5/parser/stax/StAXMenuParser.java | 7f7060f7e31c7a16e9a8bdc0e199678908f7f79f | [] | no_license | MaryiaChuhunova/TATJAVA01_2017_Task05_Maryia_Chuhunova | 7d83f30473f2752ab15befe82edf010ec097f432 | 49660b828440d2d2e52c26ea058331b14e2f23c8 | refs/heads/master | 2020-05-28T06:43:48.137973 | 2017-02-21T14:22:06 | 2017-02-21T14:22:06 | 82,589,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,267 | java | package parser.stax;
import bean.Food;
import parser.ParseException;
import org.xml.sax.SAXException;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Maria on 19.02.2017.
*/
public class StAXMenuParser {
public static ArrayList<Food> parseMenuWithStAXParser() throws ParseException {
ArrayList<Food> menu;
try {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
InputStream input = new FileInputStream("food.xml");
XMLStreamReader reader = inputFactory.createXMLStreamReader(input);
menu = process(reader);
} catch (FileNotFoundException fnfex) {
throw new ParseException("Couldn't find data source", fnfex);
} catch (XMLStreamException e) {
throw new ParseException("Couldn't read xml file", e);
}
return menu;
}
private static ArrayList<Food> process(XMLStreamReader reader) throws XMLStreamException {
ArrayList<Food> menu = new ArrayList<>();
Food food = null;
MenuTagName elementName = null;
while (reader.hasNext()) {
int type = reader.next();
switch (type) {
case XMLStreamConstants.START_ELEMENT:
elementName = MenuTagName.getElementTagName(reader.getLocalName());
switch (elementName) {
case FOOD:
food = new Food();
Integer id = Integer.parseInt(reader.getAttributeValue(null, "id"));
food.setId(id);
break;
}
break;
case XMLStreamConstants.CHARACTERS:
String text = reader.getText().trim();
if (text.isEmpty()) {
break;
}
switch (elementName) {
case PHOTO:
food.setPhoto(text.toString());
break;
case TITLE:
food.setTitle(text.toString());
break;
case DESCRIPTION:
food.setDescription(text.toString());
break;
case PORTION:
food.setPortion(text.toString());
break;
case PRICE:
food.setPrice(text.toString());
break;
}
break;
case XMLStreamConstants.END_ELEMENT:
elementName = MenuTagName.getElementTagName((reader.getLocalName()));
switch (elementName) {
case FOOD:
menu.add(food);
}
}
}
return menu;
}
}
| [
"[email protected]"
] | |
a3d8ddefc0f75c62231d784d2bdd0cd07b688bb1 | b302ef8c81052f35540a9420c0bc6af73bfba8e9 | /common-core/src/test/java/com/legend/common/model/beps/beps_121_001_01/CustomerCreditTransferInformation1.java | 51f1f810b1170d7e00409fea1637c207e96679a6 | [] | no_license | witnesslq/com.legend.common | 1b1c5806d9deef6292db80bd3eb457093cba4250 | 1c83724e3aaa1ddd6eca13b910441fd3ea1562d9 | refs/heads/master | 2020-12-30T14:44:23.843538 | 2016-06-28T08:28:38 | 2016-06-28T08:28:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,229 | java | //
// ���ļ����� JavaTM Architecture for XML Binding (JAXB) ����ʵ�� v2.2.8-b130911.1802 ���ɵ�
// ����� <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// �����±���Դģʽʱ, �Դ��ļ��������Ķ�����ʧ��
// ����ʱ��: 2016.06.17 ʱ�� 03:58:59 PM CST
//
package com.legend.common.model.beps.beps_121_001_01;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>CustomerCreditTransferInformation1 complex type�� Java �ࡣ
*
* <p>����ģʽƬ��ָ�������ڴ����е�Ԥ�����ݡ�
*
* <pre>
* <complexType name="CustomerCreditTransferInformation1">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="TxId" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}Max16NumericText"/>
* <element name="Dbtr" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}Debtor1"/>
* <element name="DbtrAcct" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}DebtorAccount1"/>
* <element name="DbtrAgt" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}DebtorAgent1"/>
* <element name="CdtrAgt" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}CreditorAgent1"/>
* <element name="Cdtr" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}Creditor1"/>
* <element name="CdtrAcct" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}CreditorAccount1"/>
* <element name="Amt" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}ActiveCurrencyAndAmount"/>
* <element name="PmtTpInf" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}PaymentTypeInformation1"/>
* <element name="Purp" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}Purpose1"/>
* <element name="AddtlInf" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}Max256Text" minOccurs="0"/>
* <element name="CstmrCdtTrfAddtlInf" type="{urn:cnaps:std:beps:2010:tech:xsd:beps.121.001.01}CustomerCreditTransferAdditionalInformation1" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomerCreditTransferInformation1", propOrder = {
"txId",
"dbtr",
"dbtrAcct",
"dbtrAgt",
"cdtrAgt",
"cdtr",
"cdtrAcct",
"amt",
"pmtTpInf",
"purp",
"addtlInf",
"cstmrCdtTrfAddtlInf"
})
public class CustomerCreditTransferInformation1 {
@XmlElement(name = "TxId", required = true)
protected String txId;
@XmlElement(name = "Dbtr", required = true)
protected Debtor1 dbtr;
@XmlElement(name = "DbtrAcct", required = true)
protected DebtorAccount1 dbtrAcct;
@XmlElement(name = "DbtrAgt", required = true)
protected DebtorAgent1 dbtrAgt;
@XmlElement(name = "CdtrAgt", required = true)
protected CreditorAgent1 cdtrAgt;
@XmlElement(name = "Cdtr", required = true)
protected Creditor1 cdtr;
@XmlElement(name = "CdtrAcct", required = true)
protected CreditorAccount1 cdtrAcct;
@XmlElement(name = "Amt", required = true)
protected ActiveCurrencyAndAmount amt;
@XmlElement(name = "PmtTpInf", required = true)
protected PaymentTypeInformation1 pmtTpInf;
@XmlElement(name = "Purp", required = true)
protected Purpose1 purp;
@XmlElement(name = "AddtlInf")
protected String addtlInf;
@XmlElement(name = "CstmrCdtTrfAddtlInf")
protected CustomerCreditTransferAdditionalInformation1 cstmrCdtTrfAddtlInf;
/**
* ��ȡtxId���Ե�ֵ��
*
* @return
* possible object is
* {@link String }
*
*/
public String getTxId() {
return txId;
}
/**
* ����txId���Ե�ֵ��
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTxId(String value) {
this.txId = value;
}
/**
* ��ȡdbtr���Ե�ֵ��
*
* @return
* possible object is
* {@link Debtor1 }
*
*/
public Debtor1 getDbtr() {
return dbtr;
}
/**
* ����dbtr���Ե�ֵ��
*
* @param value
* allowed object is
* {@link Debtor1 }
*
*/
public void setDbtr(Debtor1 value) {
this.dbtr = value;
}
/**
* ��ȡdbtrAcct���Ե�ֵ��
*
* @return
* possible object is
* {@link DebtorAccount1 }
*
*/
public DebtorAccount1 getDbtrAcct() {
return dbtrAcct;
}
/**
* ����dbtrAcct���Ե�ֵ��
*
* @param value
* allowed object is
* {@link DebtorAccount1 }
*
*/
public void setDbtrAcct(DebtorAccount1 value) {
this.dbtrAcct = value;
}
/**
* ��ȡdbtrAgt���Ե�ֵ��
*
* @return
* possible object is
* {@link DebtorAgent1 }
*
*/
public DebtorAgent1 getDbtrAgt() {
return dbtrAgt;
}
/**
* ����dbtrAgt���Ե�ֵ��
*
* @param value
* allowed object is
* {@link DebtorAgent1 }
*
*/
public void setDbtrAgt(DebtorAgent1 value) {
this.dbtrAgt = value;
}
/**
* ��ȡcdtrAgt���Ե�ֵ��
*
* @return
* possible object is
* {@link CreditorAgent1 }
*
*/
public CreditorAgent1 getCdtrAgt() {
return cdtrAgt;
}
/**
* ����cdtrAgt���Ե�ֵ��
*
* @param value
* allowed object is
* {@link CreditorAgent1 }
*
*/
public void setCdtrAgt(CreditorAgent1 value) {
this.cdtrAgt = value;
}
/**
* ��ȡcdtr���Ե�ֵ��
*
* @return
* possible object is
* {@link Creditor1 }
*
*/
public Creditor1 getCdtr() {
return cdtr;
}
/**
* ����cdtr���Ե�ֵ��
*
* @param value
* allowed object is
* {@link Creditor1 }
*
*/
public void setCdtr(Creditor1 value) {
this.cdtr = value;
}
/**
* ��ȡcdtrAcct���Ե�ֵ��
*
* @return
* possible object is
* {@link CreditorAccount1 }
*
*/
public CreditorAccount1 getCdtrAcct() {
return cdtrAcct;
}
/**
* ����cdtrAcct���Ե�ֵ��
*
* @param value
* allowed object is
* {@link CreditorAccount1 }
*
*/
public void setCdtrAcct(CreditorAccount1 value) {
this.cdtrAcct = value;
}
/**
* ��ȡamt���Ե�ֵ��
*
* @return
* possible object is
* {@link ActiveCurrencyAndAmount }
*
*/
public ActiveCurrencyAndAmount getAmt() {
return amt;
}
/**
* ����amt���Ե�ֵ��
*
* @param value
* allowed object is
* {@link ActiveCurrencyAndAmount }
*
*/
public void setAmt(ActiveCurrencyAndAmount value) {
this.amt = value;
}
/**
* ��ȡpmtTpInf���Ե�ֵ��
*
* @return
* possible object is
* {@link PaymentTypeInformation1 }
*
*/
public PaymentTypeInformation1 getPmtTpInf() {
return pmtTpInf;
}
/**
* ����pmtTpInf���Ե�ֵ��
*
* @param value
* allowed object is
* {@link PaymentTypeInformation1 }
*
*/
public void setPmtTpInf(PaymentTypeInformation1 value) {
this.pmtTpInf = value;
}
/**
* ��ȡpurp���Ե�ֵ��
*
* @return
* possible object is
* {@link Purpose1 }
*
*/
public Purpose1 getPurp() {
return purp;
}
/**
* ����purp���Ե�ֵ��
*
* @param value
* allowed object is
* {@link Purpose1 }
*
*/
public void setPurp(Purpose1 value) {
this.purp = value;
}
/**
* ��ȡaddtlInf���Ե�ֵ��
*
* @return
* possible object is
* {@link String }
*
*/
public String getAddtlInf() {
return addtlInf;
}
/**
* ����addtlInf���Ե�ֵ��
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAddtlInf(String value) {
this.addtlInf = value;
}
/**
* ��ȡcstmrCdtTrfAddtlInf���Ե�ֵ��
*
* @return
* possible object is
* {@link CustomerCreditTransferAdditionalInformation1 }
*
*/
public CustomerCreditTransferAdditionalInformation1 getCstmrCdtTrfAddtlInf() {
return cstmrCdtTrfAddtlInf;
}
/**
* ����cstmrCdtTrfAddtlInf���Ե�ֵ��
*
* @param value
* allowed object is
* {@link CustomerCreditTransferAdditionalInformation1 }
*
*/
public void setCstmrCdtTrfAddtlInf(CustomerCreditTransferAdditionalInformation1 value) {
this.cstmrCdtTrfAddtlInf = value;
}
}
| [
"[email protected]"
] | |
01e1b729bd02193dd266c0334f3b7a4a9d8f16b9 | 1aef4669e891333de303db570c7a690c122eb7dd | /src/main/java/com/alipay/api/domain/AlipayMarketingCampaignPrizeSendQueryModel.java | a01c47d512ec3c45325e6e0190958b1ffcbc4919 | [
"Apache-2.0"
] | permissive | fossabot/alipay-sdk-java-all | b5d9698b846fa23665929d23a8c98baf9eb3a3c2 | 3972bc64e041eeef98e95d6fcd62cd7e6bf56964 | refs/heads/master | 2020-09-20T22:08:01.292795 | 2019-11-28T08:12:26 | 2019-11-28T08:12:26 | 224,602,331 | 0 | 0 | Apache-2.0 | 2019-11-28T08:12:26 | 2019-11-28T08:12:25 | null | UTF-8 | Java | false | false | 798 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 中奖信息查询
*
* @author auto create
* @since 1.0, 2018-11-23 10:36:40
*/
public class AlipayMarketingCampaignPrizeSendQueryModel extends AlipayObject {
private static final long serialVersionUID = 2489331534514657739L;
/**
* 活动id
*/
@ApiField("camp_id")
private String campId;
/**
* 蚂蚁统一会员ID
*/
@ApiField("user_id")
private String userId;
public String getCampId() {
return this.campId;
}
public void setCampId(String campId) {
this.campId = campId;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
| [
"[email protected]"
] | |
f6cedba1396e2934210e0f63a10fb85e7db2f5a3 | d05a43e74e959ad6f6e3471a687607e3b60008ba | /imagelode/src/main/java/com/vikas/imageloade/imageutils/MemoryCache.java | 95780152dfc119a7d6ef628b9e2daab35aa4ccc8 | [
"MIT"
] | permissive | Vikas00413/ImageLoader | 2de30fe5534535a9c6842f27e5471eae04951218 | 0b91f196632da6a9786397b81027ccf5f15a8f19 | refs/heads/master | 2020-07-14T19:14:37.419909 | 2019-08-30T12:58:10 | 2019-08-30T12:58:10 | 205,381,306 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package com.vikas.imageloade.imageutils;
import android.graphics.Bitmap;
import android.util.Log;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
public class MemoryCache {
private static final String TAG = "MemoryCache";
private Map<String, Bitmap> cache=Collections.synchronizedMap(
new LinkedHashMap<String, Bitmap>(10,1.5f,true));//Last argument true for LRU ordering
private long size=0;//current allocated size
private long limit=1000000;//max memory in bytes
public MemoryCache(){
//use 25% of available heap size
setLimit(Runtime.getRuntime().maxMemory()/4);
}
public void setLimit(long new_limit){
limit=new_limit;
Log.i(TAG, "MemoryCache will use up to "+limit/1024./1024.+"MB");
}
public Bitmap get(String id){
try{
if(!cache.containsKey(id))
return null;
//NullPointerException sometimes happen here http://code.google.com/p/osmdroid/issues/detail?id=78
return cache.get(id);
}catch(NullPointerException ex){
ex.printStackTrace();
return null;
}
}
public void put(String id, Bitmap bitmap){
try{
if(cache.containsKey(id))
size-=getSizeInBytes(cache.get(id));
cache.put(id, bitmap);
size+=getSizeInBytes(bitmap);
checkSize();
}catch(Throwable th){
th.printStackTrace();
}
}
private void checkSize() {
Log.i(TAG, "cache size="+size+" length="+cache.size());
if(size>limit){
Iterator<Entry<String, Bitmap>> iter=cache.entrySet().iterator();//least recently accessed item will be the first one iterated
while(iter.hasNext()){
Entry<String, Bitmap> entry=iter.next();
size-=getSizeInBytes(entry.getValue());
iter.remove();
if(size<=limit)
break;
}
Log.i(TAG, "Clean cache. New size "+cache.size());
}
}
public void clear() {
try{
//NullPointerException sometimes happen here http://code.google.com/p/osmdroid/issues/detail?id=78
cache.clear();
size=0;
}catch(NullPointerException ex){
ex.printStackTrace();
}
}
long getSizeInBytes(Bitmap bitmap) {
if(bitmap==null)
return 0;
return bitmap.getRowBytes() * bitmap.getHeight();
}
} | [
"[email protected]"
] | |
13ecfe1c4a637cc49e84e23d3f2830d822d17d57 | 260f4ed729dbae9948dab71f49173d038eddfa1e | /TypingHeadFirstDesignPattern/src/headfirst/templatemethod/simplebarista/Tea.java | 6c644590a0e3723b88def945c79442529ec5e9f2 | [] | no_license | zxcv5500/TypingHeadFirstDesignPattern | 4bac3fc993d98b76751ab88c7966cffc4cbbf61a | f190373b103f5ccd4f833b64fa4b0b841937febd | refs/heads/master | 2021-05-09T08:20:37.025194 | 2018-10-28T04:35:30 | 2018-10-28T04:35:30 | 119,387,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | package headfirst.templatemethod.simplebarista;
public class Tea {
void prepareRecipe() {
boilWater();
steepTeaBag();
pourInCup();
addLemon();
}
public void addLemon() {
System.out.println("물 끓이는 중");
}
public void pourInCup() {
System.out.println("차를 우려내는 중");
}
public void steepTeaBag() {
System.out.println("레몬을 추가하는 중");
}
public void boilWater() {
System.out.println("컵을 따르는 중");
}
}
| [
"[email protected]"
] | |
0c79adcc50d45c8060d864d0fd6070a82d262824 | d58bd42e57bb2ac3d804c39f17ad996fa8777151 | /user/src/com/google/gwt/i18n/shared/impl/cldr/DateTimeFormatInfoImpl_ta.java | c86aba2f0f8bf3361202cf64e3ff879b8854236f | [
"Apache-2.0"
] | permissive | scalagwt/scalagwt-gwt | efd81de144b5f1c2a111b7a69dfe873639c2cf31 | f19efe24cd481f0bfee16adfabb939d3ebe75c95 | refs/heads/scalagwt | 2022-12-23T08:00:13.617295 | 2020-09-11T21:16:23 | 2020-09-11T21:16:23 | 2,085,959 | 13 | 5 | null | 2022-12-09T22:15:11 | 2011-07-21T22:02:56 | Java | UTF-8 | Java | false | false | 5,028 | java | /*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.i18n.shared.impl.cldr;
// DO NOT EDIT - GENERATED FROM CLDR AND ICU DATA
/**
* Implementation of DateTimeFormatInfo for the "ta" locale.
*/
public class DateTimeFormatInfoImpl_ta extends DateTimeFormatInfoImpl {
@Override
public String[] ampms() {
return new String[] {
"am",
"pm"
};
}
@Override
public String dateFormatFull() {
return "EEEE, d MMMM, y";
}
@Override
public String dateFormatLong() {
return "d MMMM, y";
}
@Override
public String dateFormatMedium() {
return "d MMM, y";
}
@Override
public String dateFormatShort() {
return "d-M-yy";
}
@Override
public String[] erasFull() {
return new String[] {
"கிறிஸ்துவுக்கு முன்",
"அனோ டோமினி"
};
}
@Override
public String[] erasShort() {
return new String[] {
"கிமு",
"கிபி"
};
}
@Override
public int firstDayOfTheWeek() {
return 0;
}
@Override
public String formatMonthAbbrevDay() {
return "d MMM";
}
@Override
public String formatMonthFullDay() {
return "d MMMM";
}
@Override
public String formatMonthNumDay() {
return "d-M";
}
@Override
public String formatYearMonthAbbrev() {
return "MMM y";
}
@Override
public String formatYearMonthAbbrevDay() {
return "d MMM, y";
}
@Override
public String formatYearMonthFull() {
return "MMMM y";
}
@Override
public String formatYearMonthFullDay() {
return "d MMMM, y";
}
@Override
public String formatYearMonthNum() {
return "M-y";
}
@Override
public String formatYearMonthNumDay() {
return "d-M-y";
}
@Override
public String formatYearMonthWeekdayDay() {
return "EEE, d MMM, y";
}
@Override
public String formatYearQuarterFull() {
return "QQQQ y";
}
@Override
public String formatYearQuarterShort() {
return "Q y";
}
@Override
public String[] monthsFull() {
return new String[] {
"ஜனவரி",
"பிப்ரவரி",
"மார்ச்",
"ஏப்ரல்",
"மே",
"ஜூன்",
"ஜூலை",
"ஆகஸ்ட்",
"செப்டெம்ப்ர்",
"அக்டோபர்",
"நவம்பர்",
"டிசம்பர்"
};
}
@Override
public String[] monthsNarrow() {
return new String[] {
"ஜ",
"பி",
"மா",
"ஏ",
"மே",
"ஜூ",
"ஜூ",
"ஆ",
"செ",
"அ",
"ந",
"டி"
};
}
@Override
public String[] monthsShort() {
return new String[] {
"ஜன.",
"பிப்.",
"மார்.",
"ஏப்.",
"மே",
"ஜூன்",
"ஜூலை",
"ஆக.",
"செப்.",
"அக்.",
"நவ.",
"டிச."
};
}
@Override
public String[] quartersFull() {
return new String[] {
"1ஆம் காலாண்டு",
"2ஆம் காலாண்டு",
"3ஆம் காலாண்டு",
"4ஆம் காலாண்டு"
};
}
@Override
public String timeFormatFull() {
return "h:mm:ss a zzzz";
}
@Override
public String timeFormatLong() {
return "h:mm:ss a z";
}
@Override
public String timeFormatMedium() {
return "h:mm:ss a";
}
@Override
public String timeFormatShort() {
return "h:mm a";
}
@Override
public String[] weekdaysFull() {
return new String[] {
"ஞாயிறு",
"திங்கள்",
"செவ்வாய்",
"புதன்",
"வியாழன்",
"வெள்ளி",
"சனி"
};
}
@Override
public String[] weekdaysNarrow() {
return new String[] {
"ஞா",
"தி",
"செ",
"பு",
"வி",
"வெ",
"ச"
};
}
@Override
public String[] weekdaysShort() {
return new String[] {
"ஞா",
"தி",
"செ",
"பு",
"வி",
"வெ",
"ச"
};
}
@Override
public int weekendStart() {
return 0;
}
}
| [
"[email protected]@8db76d5a-ed1c-0410-87a9-c151d255dfc7"
] | [email protected]@8db76d5a-ed1c-0410-87a9-c151d255dfc7 |
2e9f69f7cb3bbced0af2ebe6d063a63e894db874 | 29434357a51814e5bd7d39ea2b5096c2eaa66f15 | /State/src/PrimaryState.java | c25eff711d1e77c76f6ae91a3233c6bbf8f216cf | [] | no_license | gaojun-12138/Design-Patterns | 4445ee2fec0868f7948231918efe13401b11edfe | ce5f0e0f8346a86bb615a9a7e11625973c737631 | refs/heads/master | 2023-06-03T11:23:50.322362 | 2021-06-22T15:34:37 | 2021-06-22T15:34:37 | 361,366,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 695 | java | public class PrimaryState extends AbstractState{
public PrimaryState(AbstractState state){
this.acc = state.acc;
this.point = state.getPoint();
this.stateName = "新手";
}
public PrimaryState(ForumAccount acc){
this.point = 0;
this.acc = acc;
this.stateName = "新手";
}
public void downloadFile(int score){
System.out.println("对不起,"+acc.getName()+",您没有下载文件的权限!");
}
@Override
public void checkState(int score) {
if(point >= 1000){
acc.setState(new HighState(this));
}
else if(point >= 100){
acc.setState(new MiddleState(this));
}
}
}
| [
"[email protected]"
] | |
8d0a99a0c978d9a3c1cc5a76f4e4d041ed080f7e | be8ae5412847ba656b4c7c72b73ca881064dfc09 | /14Cup/app/src/main/java/com/moufee/a14cup/repository/UserRepository.java | 86da0f87e4eb015102ea0a752a024d1e689d452e | [] | no_license | aberendsen18/408_Team16_Project | 1c7f490abc5289643777f8e1dd83d92f5cb552ad | 1645d467a9a5e80e566f8ef4bd8ea6f669f5db4c | refs/heads/master | 2021-05-11T08:18:03.280330 | 2018-04-23T20:56:53 | 2018-04-23T20:56:53 | 118,047,558 | 0 | 1 | null | 2018-02-19T02:51:44 | 2018-01-18T22:48:04 | Java | UTF-8 | Java | false | false | 1,072 | java | package com.moufee.a14cup.repository;
import android.arch.core.util.Function;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Transformations;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.moufee.a14cup.util.FirebaseAuthLiveData;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* A repository for Users
* Allows the current FirebaseUser to be retrieved
*/
@Singleton
public class UserRepository {
private FirebaseAuth mFirebaseAuth;
@Inject
public UserRepository(FirebaseAuth auth) {
this.mFirebaseAuth = auth;
}
public LiveData<FirebaseUser> getCurrentUser() {
return Transformations.map(new FirebaseAuthLiveData(mFirebaseAuth), new Function<FirebaseAuth, FirebaseUser>() {
@Override
public FirebaseUser apply(FirebaseAuth auth) {
return auth.getCurrentUser();
}
});
}
public FirebaseUser getUserSync() {
return mFirebaseAuth.getCurrentUser();
}
}
| [
"[email protected]"
] | |
e8a0805e8d4e19e0a27054ddcc3e51e1f8b4ce24 | 1b2c6d248c1ad73b7bda03d48d6f0d253c95a62b | /src/Objetos/Tiempo.java | d57b733edfc242c68c8a7fdccbd338d52f7efd61 | [] | no_license | lopdam/RoadGo | 127ef97a1829773790be7c388047f72964b8c757 | 7bca388974922c53641a25c2d6de93b641cff22d | refs/heads/master | 2020-04-18T21:21:59.562321 | 2019-01-27T03:29:07 | 2019-01-27T03:29:07 | 167,763,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,061 | 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 Objetos;
import Ventanas.Perdio;
import javafx.application.Platform;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
/**
*
* @author lopdam
*/
public class Tiempo extends Label implements Runnable {
private Thread HiloTiempo;
private int tiempo;
private Jugador jugador;
private int nivel;
private ImageView avatar;
private Stage s;
private boolean kill;
private boolean pausar;
public Tiempo(Jugador jugador, int nivel, ImageView avatar, Stage s) {
super();
this.jugador = jugador;
this.nivel = nivel;
this.avatar = avatar;
this.s = s;
}
public void startTimeTask() {
Runnable task = () -> run();
HiloTiempo = new Thread(task);
HiloTiempo.setDaemon(true);
HiloTiempo.start();
}
public void PausarTiempo() {
pausar = true;
}
public void ReanudarTiempo() {
pausar = false;
}
public void kill() {
kill = true;
}
@Override
public void run() {
kill=false;
pausar=false;
try {
for (tiempo = 0; tiempo <=60; tiempo++) {
while(pausar){}
String tim = String.valueOf(tiempo);
Platform.runLater(() -> {
super.setText(tim);
if (tiempo == 60) {
Perdio per = new Perdio(jugador, nivel, avatar, s);
per.InicializarTodo();
per.getStagePerdio().show();
}
});
while (kill) {
tiempo = 61;
}
Thread.sleep(1000);
}
} catch (InterruptedException e) {
System.out.println("Hilo time error");
}
}
}
| [
"[email protected]"
] | |
7aac2378dc86e80c35daba123eb6efa8b41532e3 | 53a3112e53e1640fb0457349933f3ad37be81f39 | /src/com/class5/HowMany.java | 93b90b5900f109d09eedc6e78ffbb86934dc6d58 | [] | no_license | ghost2006/SeleniumBasics | aa63c2ca59195fca961e15cbb93670b5b9babc20 | c34411236d4582575cfbb4e408480b236b2efca4 | refs/heads/master | 2020-06-05T00:59:10.873874 | 2019-06-17T02:09:20 | 2019-06-17T02:09:20 | 192,259,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | package com.class5;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class HowMany {
public static void main(String[] args) {
//go to walmart and get# of links and print ONLY links that have text
System.setProperty("webdriver.chrome.driver", "C:\\Users\\mailo\\Selenium\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.ebay.com/");
List <WebElement> links=driver.findElements(By.tagName("a")); //findElementS !
System.out.println("Total number of links "+links.size());
int count=0;
for (WebElement link:links) {
String linkText=link.getText();
if (!linkText.isEmpty()) {
System.out.println(linkText);
count++;
}
}
System.out.println("Total number of links with text "+count);
driver.quit();
}
} | [
"[email protected]"
] | |
db45cfc76d9a7afe59f9356bdee123d3fd5a918e | ec0099d021396a51b0d1fcdb709b9c6e011466b4 | /Training 10 - Design Patterns/ood-principles-and-patterns/src/com/endava/patterns/template/Milk.java | 2174ef8b8c00923e95a645574775253da1712fa3 | [] | no_license | IonutCiuta/Internship-Trainings | cb10d3706fd8260719e2c315600e24988eb21d8b | 9db9327911ed7b0a92c3acb28845112812bf7a10 | refs/heads/master | 2021-06-06T05:18:36.569279 | 2016-08-05T11:15:31 | 2016-08-05T11:15:31 | 62,713,646 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 132 | java | package com.endava.patterns.template;
public class Milk extends Product {
protected int getPrice() {
return 3;
}
}
| [
"[email protected]"
] | |
74fadfe5e2de3da6d2586ddbdde6a2b3902592e2 | 76fa6c057fab73b1e855e087d405e1d0dd7e5885 | /src/main/java/com/tengu/models/User.java | 918a55bfb0ea37908f31804adea31c4789a86dcd | [] | no_license | RedHater1917/Tengu_Portal | 32a394db96a07d32efeec0630fc3e3f9a3ec4663 | 1f61e4871fe219432eba68743b9dd0a1ca2698a1 | refs/heads/master | 2022-11-24T14:57:01.169639 | 2020-07-15T07:00:07 | 2020-07-15T09:44:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,037 | java | package com.tengu.models;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import javax.persistence.*;
import java.time.LocalDate;
import java.util.UUID;
@Entity
@Data
@Table(name="tengu_user", uniqueConstraints = {
@UniqueConstraint(columnNames = {
"nickName"
}),
@UniqueConstraint(columnNames = {
"email"
})
})
@AllArgsConstructor
public class User {
public enum Role{
ADMINISTRATOR, AUTHOR, READER;
public static Role getById(String id){
for(Role e : values()) {
if(e.name().equalsIgnoreCase(id)) return e;
}
return READER;
}
};
@Id
@GeneratedValue
UUID id;
Role role;
String email;
String password;
String nickName;
@JsonFormat(pattern = "MM/dd/yyyy")
LocalDate registrationDate;
@JsonFormat(pattern = "MM/dd/yyyy")
LocalDate lastLoginDate;
int points;
public User(){}
}
| [
"[email protected]"
] | |
983104404af0520b73523697e45da9e13d20593a | 2fffb85920b4088369c410593b689231fd4f1b5d | /src/main/java/dilu/kxq/tools/inst/helper/DebugHelper.java | 97f5aa424cbe8985518d0a1c8b5347c415af95fa | [] | no_license | deelew/toolsbox | 6ca6575efc0117e8bfc4c4ed7794f1eaca4a4183 | af7310c85c76dac7f455cb212a33acc8c9fa4c85 | refs/heads/master | 2020-05-20T03:01:01.942480 | 2014-12-08T13:05:18 | 2014-12-08T13:05:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package dilu.kxq.tools.inst.helper;
/**
* Created with IntelliJ IDEA.
* User: dilu.kxq
* Date: 14-10-21
* Time: 下午3:00
* To change this template use File | Settings | File Templates.
*/
public class DebugHelper {
private static final String osName = System.getProperty("os.name");
public static boolean isDebug() {
if (osName.startsWith("Windows"))
return true;
return false;
}
public static void main(String[] args) {
System.out.println(System.getProperty("os.name"));
System.out.println(isDebug());
}
public static void debug(String... msgs) {
if (isDebug())
info(msgs);
}
public static void info(String... msgs) {
StringBuilder sb = new StringBuilder(msgs.length * 10);
for (String s : msgs)
sb.append(s);
System.out.println(sb);
}
}
| [
"[email protected]"
] | |
c2b032b208005f6d0e7acb2414a74951422ec4d7 | a29146e1e4753d380f72692f2dc38b149eaefdc1 | /src/xml/Nombre.java | 83711b1135234055e0d421f38d5578342e717ea7 | [] | no_license | SandraGraciano/GeneradorXml | 2bf998ca343d495baec6c1d363e8d51c9f9002cd | 1809b6b255d7468d7305cc2c7a7b4b4deab0dea3 | refs/heads/master | 2021-01-10T15:31:17.743053 | 2015-10-09T04:49:48 | 2015-10-09T04:49:48 | 43,914,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 546 | java | package xml;
public class Nombre {
private String genero;
private String nombres;
public Nombre() {
// TODO Auto-generated constructor stub
}
public Nombre(String genero, String nombres) {
super();
this.genero = genero;
this.nombres = nombres;
}
public String getGenero() {
return genero;
}
public void setGenero(String genero) {
this.genero = genero;
}
public String getNombres() {
return nombres;
}
public void setNombres(String nombres) {
this.nombres = nombres;
}
}
| [
"[email protected]"
] | |
92dfdf640924b5a0eb511347545b6a3c6e1fc07a | 8ffd2e7a565276edcbe93bb4dae6fb48db143ba1 | /src/fr/mrcubee/weak/WeakHashSet.java | b65ef90a7a16495732e827fd11df550fd8a64fb3 | [
"Apache-2.0"
] | permissive | MrCubee/Weak-Utilities | 6d7b030f7912e8406c1dd0a809c9621d71bb4b3b | 3e0f2d8af4d9b81f2160683058f5bb47729d996d | refs/heads/master | 2023-02-24T08:11:36.919346 | 2021-01-29T04:15:18 | 2021-01-29T04:15:18 | 334,018,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,784 | java | package fr.mrcubee.weak;
import java.util.*;
public class WeakHashSet<T> extends AbstractSet<T> implements Set<T>, Cloneable
{
private final transient WeakHashMap<T, Object> map;
private static final Object PRESENT = new Object();
private WeakHashSet(int initialCapacity, float loadFactor, boolean dummy) {
this.map = new WeakHashMap<T, Object>(initialCapacity, loadFactor);
}
public WeakHashSet() {
this.map = new WeakHashMap<T, Object>();
}
public WeakHashSet(Collection<? extends T> collection) {
this.map = new WeakHashMap<T, Object>(Math.max((int)((float)collection.size() / 0.75F) + 1, 16));
this.addAll(collection);
}
public WeakHashSet(int initialCapacity, float loadFactor) {
this.map = new WeakHashMap<T, Object>(initialCapacity, loadFactor);
}
public WeakHashSet(int initialCapacity) {
this.map = new WeakHashMap(initialCapacity);
}
public Iterator<T> iterator() {
return this.map.keySet().iterator();
}
public int size() {
return this.map.size();
}
public boolean isEmpty() {
return this.map.isEmpty();
}
public boolean contains(Object object) {
return this.map.containsKey(object);
}
public boolean add(T element) {
return this.map.put(element, PRESENT) == null;
}
public boolean remove(Object object) {
return this.map.remove(object) == PRESENT;
}
public void clear() {
this.map.clear();
}
@Override
public Object clone() {
WeakHashSet<T> result = new WeakHashSet<T>();
result.addAll(this);
return result;
}
public Spliterator<T> spliterator() {
throw new UnsupportedOperationException();
}
}
| [
"[email protected]"
] | |
9fd5ee39a8018abac6e79026e71a194f1d48abfd | 4679024fe07717f224a4aa95d378d8cb9bac2d8d | /cms/src/main/java/de/innovationgate/wgpublisher/modules/RuntimeDatabaseOptionValueProvider.java | 9b51e909af91049b1e7ff662fa2cdd3877579688 | [] | no_license | oweise/WestGate | cb2d42495c60c4fd971578f935f179ed1b435cfd | f665b226fed2259e7aaa418a8874b732ba6552b4 | refs/heads/master | 2020-03-21T10:48:51.255135 | 2018-07-13T16:08:47 | 2018-07-13T16:08:47 | 138,472,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,562 | java | /*******************************************************************************
* Copyright 2009, 2010 Innovation Gate GmbH. All Rights Reserved.
*
* This file is part of the OpenWGA databaseServer platform.
*
* OpenWGA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition, a special exception is granted by the copyright holders
* of OpenWGA called "OpenWGA plugin exception". You should have received
* a copy of this exception along with OpenWGA in file COPYING.
* If not, see <http://www.openwga.com/gpl-plugin-exception>.
*
* OpenWGA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenWGA in file COPYING.
* If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package de.innovationgate.wgpublisher.modules;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import de.innovationgate.utils.WGUtils;
import de.innovationgate.webgate.api.WGDatabase;
import de.innovationgate.wga.common.beans.csconfig.v1.PluginConfig;
import de.innovationgate.wga.common.beans.csconfig.v1.PluginID;
import de.innovationgate.wga.config.ContentDatabase;
import de.innovationgate.wga.config.ContentStore;
import de.innovationgate.wga.config.WGAConfiguration;
import de.innovationgate.wga.modules.LocalisationBundleLoader;
import de.innovationgate.wga.modules.options.OptionValueProvider;
import de.innovationgate.wgpublisher.WGACore;
import de.innovationgate.wgpublisher.plugins.WGAPlugin;
public class RuntimeDatabaseOptionValueProvider implements OptionValueProvider {
private LocalisationBundleLoader _bundleLoader = new LocalisationBundleLoader(WGUtils.getPackagePath(this.getClass()) + "/emptylistmessages", getClass().getClassLoader());
private WGAConfiguration _config;
private int _selection;
private WGACore _core;
public RuntimeDatabaseOptionValueProvider(WGAConfiguration configCopy, WGACore core, int selection) {
_config = configCopy;
_core = core;
_selection = selection;
}
public List<String> getProvidedValues() {
List<String> dbKeys = new ArrayList<String>();
for (WGDatabase db : _core.getContentdbs().values()) {
if (db.getAttribute(WGACore.DBATTRIB_PLUGIN_ID) != null) {
if ((_selection & RuntimeDatabasesOptionType.SELECTION_PLUGIN_DATABASES) != RuntimeDatabasesOptionType.SELECTION_PLUGIN_DATABASES) {
continue;
}
}
else if (!db.hasFeature(WGDatabase.FEATURE_FULLCONTENTFEATURES)) {
if ((_selection & RuntimeDatabasesOptionType.SELECTION_CONTENT_DATABASES) != RuntimeDatabasesOptionType.SELECTION_CONTENT_DATABASES) {
continue;
}
}
else if (db.hasFeature(WGDatabase.FEATURE_FULLCONTENTFEATURES)) {
if ((_selection & RuntimeDatabasesOptionType.SELECTION_CONTENT_STORES) != RuntimeDatabasesOptionType.SELECTION_CONTENT_STORES) {
continue;
}
}
dbKeys.add(db.getDbReference());
}
return dbKeys;
}
public String getValueTitle(String value, Locale locale) {
WGDatabase db = _core.getContentdbs().get(value);
PluginID pid = (PluginID) db.getAttribute(WGACore.DBATTRIB_PLUGIN_ID);
if (pid != null) {
WGAPlugin plugin = _core.getPluginSet().getPluginByID(pid);
if (plugin != null) {
return "Plugin " + db.getTitle() + " (" + (plugin.getInstallationKey() + ")");
}
else {
return "Plugin " + db.getTitle() + "(Installation key not retrievable)";
}
}
else {
return db.getTitle() + " (" + value + ")";
}
}
public String getEmptyListMessage(Locale arg0) {
return _bundleLoader.getBundle(arg0).getString("option.databases.emptylist.message");
}
}
| [
"[email protected]"
] | |
95088609e984667169e653621f8b7c456b6615c0 | c6f3317dc1baa99b08a6d7c5134a503403ecd1a8 | /src/test/java/com/vtiger/stepdefinitions/baba.java | 5ea9efc86e52a2392802a7d059683fb7a7848ff5 | [] | no_license | hemangini92/cucumber | 18a5d668cb27b1ec5ed1c9bfdec8274265586413 | 534118fd79bf496f5cbc4adf16c936eee8bcb855 | refs/heads/master | 2022-07-10T18:49:04.719061 | 2020-02-04T04:44:07 | 2020-02-04T04:44:07 | 238,117,172 | 0 | 0 | null | 2022-06-29T17:56:23 | 2020-02-04T03:45:33 | HTML | UTF-8 | Java | false | false | 136 | java | package com.vtiger.stepdefinitions;
import cucumber.api.java.After;
import cucumber.api.java.Before;
public class baba {
} | [
"Deshmukh's@DESKTOP-5LSOF9P"
] | Deshmukh's@DESKTOP-5LSOF9P |
176246d5ca8220dbb427d3b3ae99beda4b7e9302 | b9c5e71cb9cbb154492944fca8bfcaca2fa7b4b7 | /feature/src/main/java/com/example/tanvirhossain/dcb/feature/Forum.java | 64a83bbd2fe3f9c485b6970caf69d2aa0664e94f | [] | no_license | zubairrafi/App | 16d25e10b1d8ce5ef1ed2f19faa7e57888d49c1c | af50d14a3b7056f33b9c4a261838b8c523e8d33f | refs/heads/master | 2020-04-13T04:01:58.178602 | 2018-12-24T04:17:45 | 2018-12-24T04:17:45 | 162,948,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.example.tanvirhossain.dcb.feature;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Forum extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forum);
}
}
| [
"[email protected]"
] | |
0ea6aa1721060cdc41d13a4bd6c8dd1b994cae52 | 2b07637d5a6bf5b9f8541721c879b5d4658d4cee | /Sample/src/androidTest/java/com/owl/sample/recyclerview/ExampleInstrumentedTest.java | cbbea5fa1e67e99ee8cebb4c9d90ff34471d405b | [] | no_license | Alamusitl/RecyclerView-Sample | 20d036edeaaa1b40e9835c40d8420f91f976eba8 | 98a5198c275391fcc5fb13fc567c1601a3c0b9bb | refs/heads/master | 2020-12-30T16:15:14.653803 | 2017-05-11T11:19:20 | 2017-05-11T11:19:20 | 90,970,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | package com.owl.sample.recyclerview;
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.assertEquals;
/**
* 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("com.owl.sample.recyclerview", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
3c62b35e9371a628f6ea3516752c87318ce37dde | c08819c9810f6d7b751d8d99b9bfca8562a67638 | /src/main/java/com/epb/smartfittingroom/entity/EcbestView.java | 6bd2ac9180aac5b7befc16772f56c295958b803a | [] | no_license | stonezealot/smartfittingroom-ws | bcf73fc2d7fbd756cbed6ed71f46aff08393cd26 | 82326379ae380c9d5e39588893b6526fdfa1438f | refs/heads/master | 2023-05-28T13:41:27.837877 | 2023-05-27T09:14:16 | 2023-05-27T09:14:16 | 276,321,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,474 | java | package com.epb.smartfittingroom.entity;
import java.math.BigDecimal;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class EcbestView {
@Id
private BigDecimal recKey;
private String orgId;
private String ecbestId;
private String ecbestName;
private BigDecimal eccatSortNum;
private BigDecimal ecskuSortNum;
private String eccatId;
private String eccatName;
private String stkId;
private String stkName;
private String model;
private String urlAddr;
private BigDecimal retailListPrice;
private BigDecimal images;
public EcbestView() {
super();
}
public BigDecimal getRecKey() {
return recKey;
}
public void setRecKey(BigDecimal recKey) {
this.recKey = recKey;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getEcbestId() {
return ecbestId;
}
public void setEcbestId(String ecbestId) {
this.ecbestId = ecbestId;
}
public String getEcbestName() {
return ecbestName;
}
public void setEcbestName(String ecbestName) {
this.ecbestName = ecbestName;
}
public BigDecimal getEccatSortNum() {
return eccatSortNum;
}
public void setEccatSortNum(BigDecimal eccatSortNum) {
this.eccatSortNum = eccatSortNum;
}
public BigDecimal getEcskuSortNum() {
return ecskuSortNum;
}
public void setEcskuSortNum(BigDecimal ecskuSortNum) {
this.ecskuSortNum = ecskuSortNum;
}
public String getEccatId() {
return eccatId;
}
public void setEccatId(String eccatId) {
this.eccatId = eccatId;
}
public String getEccatName() {
return eccatName;
}
public void setEccatName(String eccatName) {
this.eccatName = eccatName;
}
public String getStkId() {
return stkId;
}
public void setStkId(String stkId) {
this.stkId = stkId;
}
public String getStkName() {
return stkName;
}
public void setStkName(String stkName) {
this.stkName = stkName;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getUrlAddr() {
return urlAddr;
}
public void setUrlAddr(String urlAddr) {
this.urlAddr = urlAddr;
}
public BigDecimal getRetailListPrice() {
return retailListPrice;
}
public void setRetailListPrice(BigDecimal retailListPrice) {
this.retailListPrice = retailListPrice;
}
public BigDecimal getImages() {
return images;
}
public void setImages(BigDecimal images) {
this.images = images;
}
}
| [
"[email protected]"
] | |
68c82b3b1dd531dca43ec6b4bb1f90fe9f3a441f | cd7390b96661c2e9b729ce35e2b6c4523d20bfcf | /src/com/gioorgi/xml/examples/UltraSmartExample.java | 420be3132f8543277d48d43dc209727d50aec250 | [] | no_license | daitangio/SimpleXMLParser | a40eafad612aab0b1d2b700c1b9162028dba963a | 905efcc20c8461212ab4900dc54651fded3c527a | refs/heads/master | 2020-04-05T23:27:42.152713 | 2016-09-30T14:15:17 | 2016-09-30T14:15:17 | 5,355,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,889 | java | package com.gioorgi.xml.examples;
/*
* Created on 25-mag-2006 by [GG]
*/
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.apache.log4j.BasicConfigurator;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import com.gioorgi.xml.SimpleXMLParser;
public class UltraSmartExample extends SimpleXMLParser {
/**
* @param args
* @throws SAXException
* @throws IOException
*/
public static void main(String[] args) throws SAXException, IOException {
// For your preferred guy System.setProperty("org.xml.sax.driver","org.apache.crimson.parser.XMLReaderImpl");
BasicConfigurator.configure();
test( "<A><bad>Hi spencer!</bad><GOOD><DAY>is</DAY><DAY>is2</DAY></GOOD></A>");
test("<A_GOOD_START>Hi inside tag A_GOOD_START</A_GOOD_START>");
test("<A xmlns:my='http://gioorgi.com'> <my:GOOD_START>Example of ignored my namespace</my:GOOD_START></A>");
test("<A><GOOD><START>Hi inside a simple & nested START TAG </START></GOOD></A>");
test("<_>True Ugly do__ interceptor </_>");
}
public void do__(String ugly) {
getLog().info("do__:" + ugly);
}
public void do_A_GOOD_START(String s) {
getLog().info("do_A_GOOD_START:" + s);
}
private static void test(String str) throws SAXException, IOException {
XMLReader sax2Parser = XMLReaderFactory.createXMLReader();
UltraSmartExample parser = new UltraSmartExample();
sax2Parser.setContentHandler(parser);
ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());
InputSource s = new InputSource(is);
sax2Parser.parse(s);
}
public void do_A(String s) {
getLog().info("A Tag:" + s + ":");
}
public void do_A_GOOD_DAY(String content) {
getLog().info("TAG DAY:" + content);
}
public void do_A_BAD(String content) {
getLog().info("From BAD:" + content);
}
}
| [
"[email protected]"
] | |
f666dd2f20106b07fb8260c5b806285c95e4c8f7 | 0518fd357d5790c88a1df20b2f63886ec241f3e1 | /PPMToolFullStack/src/main/java/io/mbiswas/ppmtool/services/ProjectService.java | 8310a6d0cd66e666d4acb68f6c1cfbd81a5bcf1e | [] | no_license | akechilte/PPMTool | b7ad13bd5cd4cc503f662c19ae238f0735296376 | baa990829f1556dd56847fd20cd5d713df55f1c7 | refs/heads/master | 2023-03-08T11:06:44.589687 | 2021-02-25T20:12:04 | 2021-02-25T20:12:04 | 334,748,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package io.mbiswas.ppmtool.services;
import io.mbiswas.ppmtool.domain.Project;
import io.mbiswas.ppmtool.repositories.ProjectRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by mbiswas on 2/17/21.
*/
@Service
public class ProjectService {
@Autowired
private ProjectRepository projectRepository;
public Project saveOrUpdateProject(Project project){
// Logic
return projectRepository.save(project);
}
}
| [
"[email protected]"
] | |
3fb8e1d45dabbeceb860a4fca7b3ecd859837496 | 7565e247475de49d5f251ef531508bf38a948008 | /demo/spring-boot-demo/src/main/java/com/git/zxxxd/domain/entity/PlanBedResourceLog.java | f6afbf8937e61819f0d294336eb821f0091d1e43 | [] | no_license | zxxxd1001/github-zxxxd | ca5469437e91ca5fb1d3aefcc96412c8ddee03e4 | d6ad589980bdb1b072cefe3e7b48d34d6c283857 | refs/heads/master | 2023-07-05T10:58:17.647592 | 2023-07-04T02:19:53 | 2023-07-04T02:19:53 | 76,958,943 | 0 | 0 | null | 2022-12-16T10:25:30 | 2016-12-20T13:29:24 | HTML | UTF-8 | Java | false | false | 2,571 | java | package com.git.zxxxd.domain.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
@Entity
@Table(name="PLAN_BED_RESOURCE_LOG")
@XmlRootElement
public class PlanBedResourceLog {
@Id
@Column(name = "LOG_ID")
private Long logId;
@Column(name = "BED_NO")
private Integer bedNo;
@Column(name = "PLAN_PATIENT_ID")
private String planPatientId;
@Column(name = "PLAN_ENTER_DATE")
private Date planEnterDate;
@Column(name = "OPERATOR_ID")
private String operatorId;
@Column(name = "OPERATOR_NAME")
private String operatorName;
@Column(name = "OPERATOR_DATE_TIME")
private Date operatorDateTime;
@Column(name = "MEMO")
private String memo;
public Long getLogId() {
return logId;
}
public void setLogId(Long logId) {
this.logId = logId;
}
public Integer getBedNo() {
return bedNo;
}
public void setBedNo(Integer bedNo) {
this.bedNo = bedNo;
}
public String getPlanPatientId() {
return planPatientId;
}
public void setPlanPatientId(String planPatientId) {
this.planPatientId = planPatientId;
}
public Date getPlanEnterDate() {
return planEnterDate;
}
public void setPlanEnterDate(Date planEnterDate) {
this.planEnterDate = planEnterDate;
}
public String getOperatorId() {
return operatorId;
}
public void setOperatorId(String operatorId) {
this.operatorId = operatorId;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public Date getOperatorDateTime() {
return operatorDateTime;
}
public void setOperatorDateTime(Date operatorDateTime) {
this.operatorDateTime = operatorDateTime;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PlanBedResourceLog that = (PlanBedResourceLog) o;
return logId != null ? logId.equals(that.logId) : that.logId == null;
}
@Override
public int hashCode() {
return logId != null ? logId.hashCode() : 0;
}
}
| [
"[email protected]"
] | |
c4820430a67b2cc1b53633d061d5a1e6bcbf574a | 1b90189ba08fc05991896ad36a13b1fa011dde6d | /src/IfElseStatement/MentoringIfElse.java | c87ebdb696ee821f9f2581eefec8dcb70f033fdc | [] | no_license | 0615cholpon/practice | 2f06f659144f9375cc6efa7d238ceb515fcb182c | 21361824f2ab5a65994df8a469bd26909e03dd90 | refs/heads/master | 2020-07-17T22:22:03.111691 | 2019-09-03T16:00:55 | 2019-09-03T16:00:55 | 206,112,017 | 0 | 0 | null | 2019-09-03T16:00:56 | 2019-09-03T15:36:03 | Java | UTF-8 | Java | false | false | 660 | java | package IfElseStatement;
import java.util.Scanner;
public class MentoringIfElse {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int x, y;
// System.out.println("Please enter number:");
// x = input.nextInt();
// y = input.nextInt();
// int remainder = x%y;
//
//
// if (remainder==0) {
// System.out.println("Divisible!");
//
// }
// else {
// System.out.println("Indivisible!");
//
// }
System.out.println("Please enter any number: ");
x = input.nextInt();
if (x > 100 || x >= 50 && x <=75) {
System.out.println("YES!");
}
else {
System.out.println("NO!");
}
}
}
| [
"[email protected]"
] | |
d3dfb4bcd2ee85cd2dedf3a08d3fc015f86eadb9 | 89e7a5ebe3479d30ebbd6f0da5e4d6f0110ed97e | /SuperContactor/src/com/superc/supercontactor/MainActivity.java | 1387d69bfcdc91e59f519fe73ecb385bc15df73d | [] | no_license | hibianfeng/SuperContractor | db716d30d41e47fe242e89bd02b1f45fa5a99427 | f7c930cd6b95b19d5ac182b72716557149fc60f0 | refs/heads/master | 2021-01-20T10:55:28.626476 | 2014-11-20T15:14:59 | 2014-11-20T15:14:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,776 | java | package com.superc.supercontactor;
import java.util.ArrayList;
import java.util.List;
import com.superc.abstractlayer.ALOperateDB;
import com.superc.adapter.ContactorInfoAdapter;
import com.superc.bean.BeanContactorInfo;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.database.Cursor;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.os.Build;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ContactFragment())
.commit();
}
// InitListView();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
354c54f7af61cc396002d1190f93a95a8cfabf75 | b308232b5f9a1acd400fe15b45780e348048fccd | /Billing/src/main/java/com/param/billing/global/transaction/config/dto/VariablePricingDto.java | e9aa79acb02cb9df3524d7f35a1c5fd90247e3fe | [] | no_license | PravatKumarPradhan/his | 2aae12f730b7d652b9590ef976b12443fc2c2afb | afb2b3df65c0bc1b1864afc1f958ca36a2562e3f | refs/heads/master | 2022-12-22T20:43:44.895342 | 2018-07-31T17:04:26 | 2018-07-31T17:04:26 | 143,041,254 | 1 | 0 | null | 2022-12-16T03:59:53 | 2018-07-31T16:43:36 | HTML | UTF-8 | Java | false | false | 3,367 | java | package com.param.billing.global.transaction.config.dto;
import java.util.Date;
import java.util.List;
public class VariablePricingDto {
private int serviceTarrifMasterId;
private Integer serviceMasterId;
private Integer visitTypeId;
private Date fromDate;
private Date toDate;
private Integer unitId;
private Integer organisationId;
private char status;
private Integer createdBy;
private Date createdDate;
private Integer updatedBy;
private Date updatedDate;
private List<TarrifBedCategoryMpprDto> listBedCategoryDto;
private List<TarrifPatientCategoryMpprDto> listPatientCategoryDto;
private List<TarrifPaymentEntitlementMpprDto> listPaymentEntitlementDto;
public int getServiceTarrifMasterId() {
return serviceTarrifMasterId;
}
public void setServiceTarrifMasterId(int serviceTarrifMasterId) {
this.serviceTarrifMasterId = serviceTarrifMasterId;
}
public Integer getServiceMasterId() {
return serviceMasterId;
}
public void setServiceMasterId(Integer serviceMasterId) {
this.serviceMasterId = serviceMasterId;
}
public Integer getVisitTypeId() {
return visitTypeId;
}
public void setVisitTypeId(Integer visitTypeId) {
this.visitTypeId = visitTypeId;
}
public Date getFromDate() {
return fromDate;
}
public void setFromDate(Date fromDate) {
this.fromDate = fromDate;
}
public Date getToDate() {
return toDate;
}
public void setToDate(Date toDate) {
this.toDate = toDate;
}
public Integer getUnitId() {
return unitId;
}
public void setUnitId(Integer unitId) {
this.unitId = unitId;
}
public Integer getOrganisationId() {
return organisationId;
}
public void setOrganisationId(Integer organisationId) {
this.organisationId = organisationId;
}
public char getStatus() {
return status;
}
public void setStatus(char status) {
this.status = status;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public Integer getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Integer updatedBy) {
this.updatedBy = updatedBy;
}
public Date getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
public List<TarrifBedCategoryMpprDto> getListBedCategoryDto() {
return listBedCategoryDto;
}
public void setListBedCategoryDto(
List<TarrifBedCategoryMpprDto> listBedCategoryDto) {
this.listBedCategoryDto = listBedCategoryDto;
}
public List<TarrifPatientCategoryMpprDto> getListPatientCategoryDto() {
return listPatientCategoryDto;
}
public void setListPatientCategoryDto(
List<TarrifPatientCategoryMpprDto> listPatientCategoryDto) {
this.listPatientCategoryDto = listPatientCategoryDto;
}
public List<TarrifPaymentEntitlementMpprDto> getListPaymentEntitlementDto() {
return listPaymentEntitlementDto;
}
public void setListPaymentEntitlementDto(
List<TarrifPaymentEntitlementMpprDto> listPaymentEntitlementDto) {
this.listPaymentEntitlementDto = listPaymentEntitlementDto;
}
}
| [
"[email protected]"
] | |
1a404c78672fc4dcbf79dbbb81b047a61dd55df9 | b9a2aa01a5756a591e423371bb0b6fa5c680b435 | /bundles/org.connectorio.addons.norule/src/main/java/org/connectorio/addons/norule/internal/trigger/ReadyMarkerAddedTrigger.java | 92292fecd69b3f90c88e237008d98e1a1a4ba6c7 | [
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-proprietary-license",
"GPL-1.0-or-later"
] | permissive | ConnectorIO/connectorio-addons | 49dbae8ab38537e3ec18f7860070431612d375c1 | 7757376a6b4535bedabf5fdcb76e4193aa2bbc76 | refs/heads/master | 2023-08-31T20:33:38.295013 | 2023-07-14T23:47:45 | 2023-07-14T23:47:45 | 243,823,699 | 22 | 8 | Apache-2.0 | 2023-07-16T22:28:43 | 2020-02-28T17:58:51 | Java | UTF-8 | Java | false | false | 251 | java | package org.connectorio.addons.norule.internal.trigger;
import org.openhab.core.service.ReadyMarker;
public class ReadyMarkerAddedTrigger extends ReadyMarkerTrigger {
public ReadyMarkerAddedTrigger(ReadyMarker marker) {
super(marker);
}
}
| [
"[email protected]"
] | |
5cb60e69f39ebf3260f5c6ed72febc5c0ce75b9a | f7160c0f0526cc5afc0fe4e6f06d384394059aa1 | /largegraph/lg-framework/src/main/java/com/graphscape/largegraph/core/provider/lucene/document/operations/GetEdgeListOperation.java | 27f0f1c05816ac6144b80501922281e7dd142e54 | [] | no_license | o1711/somecode | e2461c4fb51b3d75421c4827c43be52885df3a56 | a084f71786e886bac8f217255f54f5740fa786de | refs/heads/master | 2021-09-14T14:51:58.704495 | 2018-05-15T07:51:05 | 2018-05-15T07:51:05 | 112,574,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,170 | java | /**
* Dec 31, 2013
*/
package com.graphscape.largegraph.core.provider.lucene.document.operations;
import java.util.List;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.TermQuery;
import com.graphscape.commons.lang.GsException;
import com.graphscape.largegraph.core.Arrow;
import com.graphscape.largegraph.core.EdgeI;
import com.graphscape.largegraph.core.Label;
import com.graphscape.largegraph.core.provider.lucene.LuceneEdge;
import com.graphscape.largegraph.core.provider.lucene.document.DocumentFactory;
import com.graphscape.largegraph.core.provider.lucene.document.DocumentType;
/**
* @author [email protected]
*
*/
public class GetEdgeListOperation extends GetElementListOperation<EdgeI> {
protected Label label;
protected Arrow dir;
protected String vertexId;
public GetEdgeListOperation(DocumentFactory df, Label label, Arrow dir, String vertexId) {
super(df, EdgeI.class, null);
this.label = label;
this.dir = dir;
this.vertexId = vertexId;
}
@Override
protected List<EdgeI> doExecute() {
BooleanQuery bq = this.queryByType(DocumentType.EDGE);
// label
if (label != null) {
TermQuery lTq = new TermQuery(new Term(LuceneEdge.PK_LABEL, label.toString()));
bq.add(lTq, BooleanClause.Occur.MUST);
}
// vid
String vid = this.vertexId;
if (dir == null || dir.BOTH.equals(dir)) {
BooleanQuery bq2 = new BooleanQuery();
bq2.add(new TermQuery(new Term(LuceneEdge.PK_HEADVERTEXID, vid)), BooleanClause.Occur.SHOULD);
bq2.add(new TermQuery(new Term(LuceneEdge.PK_TAILVERTEXID, vid)), BooleanClause.Occur.SHOULD);
bq.add(bq2, BooleanClause.Occur.MUST);
} else if (dir.HEAD.equals(dir)) {
bq.add(new TermQuery(new Term(LuceneEdge.PK_HEADVERTEXID, vid)), BooleanClause.Occur.MUST);
} else if (dir.TAIL.equals(dir)) {
bq.add(new TermQuery(new Term(LuceneEdge.PK_TAILVERTEXID, vid)), BooleanClause.Occur.MUST);
} else {
throw new GsException("bug?");
}
super.query = bq;//
return super.doExecute();
}
}
| [
"[email protected]"
] | |
47d66ed226a85a5f73be30c8cbdf85fc35cb6849 | 697e387ed59e98d5adef4720a39bed758f0dcf29 | /app/src/main/java/com/bwie/week_02_demo/view/apdater/MyViewHoder.java | f813337a292d9bc11124746d1cf8d2796709540c | [] | no_license | ZhouRuiQing/Week_02_Demo | aa7080664ffdd5fa9723832e3ac733294765b07c | 39022d90683a97556488f91637dbcb929237c5de | refs/heads/master | 2020-04-01T06:45:01.897742 | 2018-10-14T10:25:34 | 2018-10-14T10:25:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 544 | java | package com.bwie.week_02_demo.view.apdater;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.bwie.week_02_demo.R;
import com.facebook.drawee.view.SimpleDraweeView;
class MyViewHoder extends RecyclerView.ViewHolder {
public SimpleDraweeView iv_image;
public TextView tv_title;
public MyViewHoder(View itemView) {
super(itemView);
tv_title = itemView.findViewById(R.id.tv_title);
iv_image = itemView.findViewById(R.id.iv_image);
}
}
| [
"[email protected]"
] | |
514cd27d0875496050fdaa0bfdb9068c7af03a70 | ab2ab75c5884b663c7fa28059a460b8adbe07325 | /src/main/java/com/yeyangshu/dp/chainofresponsibility/tank/message/v5/FilterChain.java | 6524f0fcaa1d3cad818eb4a934e4f2be4600f96e | [] | no_license | Yeyangshu/DesignPattern | d484d9024208b1416d3d3a065f26d85b40cb0c16 | 795033d9932e038830aa3c968c680068af5f0c2d | refs/heads/master | 2023-01-30T07:27:20.901919 | 2020-12-05T15:13:01 | 2020-12-05T15:13:01 | 266,571,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | package com.yeyangshu.dp.chainofresponsibility.tank.message.v5;
import java.util.ArrayList;
import java.util.List;
/**
* FilterChain 实现 Filter,实现多个 Filter 互相添加
*
* @author yeyangshu
* @version 1.0
* @date 2020/11/29 19:19
*/
public class FilterChain implements Filter {
/** filter list */
private List<Filter> filters = new ArrayList<>();
/**
* 处理消息
*
* @param message
*/
@Override
public void doFilter(Message message) {
for (Filter filter : filters) {
filter.doFilter(message);
}
}
/**
* 添加 Filter
*
* @param filter
* @return
*/
public FilterChain add(Filter filter) {
filters.add(filter);
return this;
}
/**
* 删除 Filter
* @param filter
*/
public FilterChain delete(Filter filter) {
filters.remove(filter);
return this;
}
}
| [
"[email protected]"
] | |
1b6f9673ee173fba384230378f5947903f98a069 | 15acd1d23f1f0f350b5dc8b9d49816b16310c07d | /JT-ec/JT-manager/JT-manager-service/src/main/java/com/zuql/JT/manage/service/UserServiceImpl.java | fc979e3285b489cd43aee3023ec4d1fd7551623e | [] | no_license | zuql/git | f0c32c19539664c1b3f2e938214d5525661403a4 | d4085a84a2494d09fb3b483f754074a8f662b12d | refs/heads/master | 2020-04-08T18:17:48.233771 | 2019-01-11T09:01:35 | 2019-01-11T09:01:35 | 159,602,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | package com.zuql.jt.manage.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zuql.jt.manage.mapper.UserMapper;
import com.zuql.jt.manage.pojo.User;
@Service
public class UserServiceImpl implements com.zuql.jt.manage.service.UserService {
@Autowired
private UserMapper userMapper;
@Override
public List<User> findAll() {
return userMapper.findAll();
}
}
| [
"[email protected]"
] | |
a9827888817c891a7f7f59397ba35ab187d6c5c5 | 4bd1ed88601c1090c24081b0e761be896b26b5a6 | /src/logic/Array.java | f181230e378cc7a473b0c46de34c13909dc0b1df | [] | no_license | Dariuszx/Kurier.2 | e322b6e34609228e28089f9700fe1ee1c28a1b24 | afe246e03031527256474456527698a4b6e4bbff | refs/heads/master | 2016-09-05T20:04:20.081844 | 2015-01-07T21:49:55 | 2015-01-07T21:49:55 | 28,652,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package logic;
import java.util.ArrayList;
public class Array<T> implements Data<T> {
private ArrayList<T> arrayList = new ArrayList<T>();
public ArrayList<T> getArrayList() {
return arrayList;
}
@Override
public void add(T data) {
arrayList.add(data);
}
@Override
public int size() {
return arrayList.size();
}
@Override
public T get(int index) {
return arrayList.get(index);
}
@Override
public T get(T data) {
for( T obj : arrayList ) {
if( obj.equals(data) ) return obj;
}
return null;
}
@Override
public void set(int index, T data) {
arrayList.set( index, data );
}
}
| [
"[email protected]"
] | |
3884384892e53f68aa25729d98c6b70ec3891710 | 6a495d216208239e610c5596afba8a7c473e3ee9 | /java-reflect/src/main/java/reflect/fieldtest/FieldTestGetAnnotation.java | 9e10800860bbf9c23bb07b6763d4bd397043d4f1 | [] | no_license | wwm0104/java-reflect-knowledge | 1dfcef957752028ba7f17cb4d89ea94e1a2ddfe7 | da8207da1d1e21d1562568cb587e57867afbbe2d | refs/heads/master | 2020-05-02T02:39:11.649458 | 2019-04-01T09:27:35 | 2019-04-01T09:27:35 | 177,708,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,089 | java | package reflect.fieldtest;
import reflect.customize.annotation.BusinessNoAnnotation;
import reflect.po.Book;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedType;
import java.lang.reflect.Field;
/**
* 获取字段上的注解
*
*/
public class FieldTestGetAnnotation {
public static void main(String[] args) {
Field[] declaredFields = Book.class.getDeclaredFields();
for(Field field:declaredFields){
BusinessNoAnnotation annotation = field.getAnnotation(BusinessNoAnnotation.class);
if(annotation != null){
System.out.println(annotation.businessNo()+","+annotation.desc());
}
AnnotatedType annotatedType = field.getAnnotatedType();
if(annotatedType != null){
System.out.println(annotatedType.toString());
}
Annotation[] declaredAnnotations = field.getDeclaredAnnotations();
if(declaredAnnotations != null){
System.out.println(declaredAnnotations.toString());
}
}
}
}
| [
""
] | |
e6c30a0efd42d533a0b4feb3fc0fed70e6593d48 | 05108cce67b393b0ac624e54fca41177db76a842 | /android/app/src/main/java/com/pomotask/MainApplication.java | 364bd879eff5df0939f786eb2746e9d9a8a04e8c | [] | no_license | pahferreira/pomotask-mobile | 9ebae619f8dea0927f0d0cdaa52e2dd29aabd1a9 | f9d95788ff215fc6e90b61ae2ce8ad7d14c5d047 | refs/heads/master | 2023-01-27T11:05:23.277146 | 2020-10-05T19:32:06 | 2020-10-05T19:32:06 | 203,392,314 | 0 | 0 | null | 2023-01-04T07:44:17 | 2019-08-20T14:23:30 | JavaScript | UTF-8 | Java | false | false | 1,361 | java | package com.pomotask;
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"[email protected]"
] | |
8a0666bb2a7e46163612d27d822b35e47cec81ff | 6af2a037fffe2fe8a40b180349f2629625e0003d | /src/abstractFactory/Windows.java | 73ae1b386844cfe3f4572d357da6e4ae56bf906a | [] | no_license | dgonzalez7/JavaDesignPatterns | 5e995cf6a0120ecd6af39c09a5f225d556d25556 | 445bb85c675c7b7bef306bcf173c4046d5261ffb | refs/heads/master | 2020-05-19T11:19:46.862525 | 2015-05-08T02:17:58 | 2015-05-08T02:17:58 | 30,848,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 483 | java | /*
* Java Design Pattern Essentials - Second Edition, by Tony Bevis
* Copyright 2012, Ability First Limited
*
* This source code is provided to accompany the book and is provided AS-IS without warranty of any kind.
* It is intended for educational and illustrative purposes only, and may not be re-published
* without the express written permission of the publisher.
*/
package abstractFactory;
public interface Windows {
public String getWindowParts();
}
| [
"[email protected]"
] | |
9613efa05c0a7cf6722a7844a9be05fde368619a | b5ffa60967454dd90d318b693be7341975f08932 | /JavaStudy/src/clone/TestClone.java | 9ee7f0c4534dcce44e5a95e3cfd78e76a33b0906 | [] | no_license | BucleLiu/Bucle | 8101bd7743b73032e69a9d0b63dcb7eb5b52438d | 4819ff1d78e56f132b465dc68f0c936a2ae76035 | refs/heads/master | 2022-12-22T15:01:15.568527 | 2018-04-18T15:15:19 | 2018-04-18T15:15:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 966 | java | package clone;
public class TestClone {
public static void main(String[] args) throws CloneNotSupportedException {
CloneDemo original = new CloneDemo("原始人",24);
CloneDemo cloneOB = (CloneDemo) original.clone();
cloneOB.setName("克隆人");
System.out.println(original);
System.out.println(cloneOB);
}
}
class CloneDemo implements Cloneable{
String name;
int age;
public CloneDemo(String name,int age){
this.name = name;
this.age = age;
}
public String toString(){
return this.name+","+this.age;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
| [
"[email protected]"
] | |
5c1589d9ecb7a68908e170648de4ce2a968d3288 | 21220ea4f9b9d8f57be23baac1a1409b63244582 | /app/models/v_bill_detail_for_collection.java | a5f283268786e9ad920afb92fc0db830c7443973 | [] | no_license | gzchen008/p2p-finance | 380911914ffcba506e8e693f62a81118abe22a9f | e7826f7cc853ccffbe44ca9ecd160c3a050be1e1 | refs/heads/master | 2021-06-10T06:55:26.131252 | 2016-11-07T10:28:45 | 2016-11-07T10:28:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 907 | java | package models;
import javax.persistence.Entity;
import javax.persistence.Transient;
import constants.Constants;
import play.db.jpa.Model;
import utils.Security;
/**
* 后台催收账单管理-->催收
*/
@Entity
public class v_bill_detail_for_collection extends Model {
public String name;
public long bid_id;
public long user_id;
public int notice_count_message;
public int notice_count_mail;
public int notice_count_telephone;
public String mobile;
public String immediate_family_mobile;
public String email;
public String immediate_family_email;
public double ovdedue_fine;
public double principal_interest_amount;
public int overdue_count;
public double total_pay_amount;
public int overdue_mark;
public String bill_no;
@Transient
public String sign;
/**
* 获取加密ID
*/
public String getSign() {
return Security.addSign(this.id, Constants.BILL_ID_SIGN);
}
}
| [
"[email protected]"
] | |
40857ea426d944d2842fbe30ea364539d16b96b8 | 0a0de066b23a04bbede9c0ee3acc8c3c43d68206 | /bk-tech-test-ciat/src/main/java/org/cgiar/ciat/service/InstitutionsLocationsServiceImpl.java | ef3c1499e6b624c208ec282597b849dd4d5a3a6b | [] | no_license | dpareja1394/tech-test-ciat | 61a62ab0e8347422b18c9d4b6faae532e01b44d1 | 28818a969c4ccbad4a4476d3ad2e126f0a5da814 | refs/heads/master | 2022-12-15T05:07:53.528329 | 2020-09-07T05:46:40 | 2020-09-07T05:46:40 | 293,207,061 | 0 | 0 | null | 2020-09-07T05:46:41 | 2020-09-06T05:02:54 | null | UTF-8 | Java | false | false | 5,488 | java | package org.cgiar.ciat.service;
import org.cgiar.ciat.domain.*;
import org.cgiar.ciat.exception.*;
import org.cgiar.ciat.repository.*;
import org.cgiar.ciat.utility.Utilities;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.*;
import java.util.*;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
/**
* @author Zathura Code Generator http://zathuracode.org
* www.zathuracode.org
*
*/
@Scope("singleton")
@Service
public class InstitutionsLocationsServiceImpl
implements InstitutionsLocationsService {
private static final Logger log = LoggerFactory.getLogger(InstitutionsLocationsServiceImpl.class);
@Autowired
private InstitutionsLocationsRepository institutionsLocationsRepository;
@Autowired
private Validator validator;
@Override
public void validate(InstitutionsLocations institutionsLocations)
throws Exception {
try {
Set<ConstraintViolation<InstitutionsLocations>> constraintViolations =
validator.validate(institutionsLocations);
if (constraintViolations.size() > 0) {
StringBuilder strMessage = new StringBuilder();
for (ConstraintViolation<InstitutionsLocations> constraintViolation : constraintViolations) {
strMessage.append(constraintViolation.getPropertyPath()
.toString());
strMessage.append(" - ");
strMessage.append(constraintViolation.getMessage());
strMessage.append(". \n");
}
throw new Exception(strMessage.toString());
}
} catch (Exception e) {
throw e;
}
}
@Override
@Transactional(readOnly = true)
public Long count() {
return institutionsLocationsRepository.count();
}
@Override
@Transactional(readOnly = true)
public List<InstitutionsLocations> findAll() {
log.debug("finding all InstitutionsLocations instances");
return institutionsLocationsRepository.findAll();
}
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public InstitutionsLocations save(InstitutionsLocations entity)
throws Exception {
log.debug("saving InstitutionsLocations instance");
try {
if (entity == null) {
throw new ZMessManager().new NullEntityExcepcion(
"InstitutionsLocations");
}
validate(entity);
if (institutionsLocationsRepository.findById(entity.getId())
.isPresent()) {
throw new ZMessManager(ZMessManager.ENTITY_WITHSAMEKEY);
}
return institutionsLocationsRepository.save(entity);
} catch (Exception e) {
log.error("save InstitutionsLocations failed", e);
throw e;
}
}
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void delete(InstitutionsLocations entity) throws Exception {
log.debug("deleting InstitutionsLocations instance");
if (entity == null) {
throw new ZMessManager().new NullEntityExcepcion(
"InstitutionsLocations");
}
if (entity.getId() == null) {
throw new ZMessManager().new EmptyFieldException("id");
}
try {
institutionsLocationsRepository.deleteById(entity.getId());
log.debug("delete InstitutionsLocations successful");
} catch (Exception e) {
log.error("delete InstitutionsLocations failed", e);
throw e;
}
}
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void deleteById(Long id) throws Exception {
log.debug("deleting InstitutionsLocations instance");
if (id == null) {
throw new ZMessManager().new EmptyFieldException("id");
}
if (institutionsLocationsRepository.findById(id).isPresent()) {
delete(institutionsLocationsRepository.findById(id).get());
}
}
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public InstitutionsLocations update(InstitutionsLocations entity)
throws Exception {
log.debug("updating InstitutionsLocations instance");
try {
if (entity == null) {
throw new ZMessManager().new NullEntityExcepcion(
"InstitutionsLocations");
}
validate(entity);
return institutionsLocationsRepository.save(entity);
} catch (Exception e) {
log.error("update InstitutionsLocations failed", e);
throw e;
}
}
@Override
@Transactional(readOnly = true)
public Optional<InstitutionsLocations> findById(Long id)
throws Exception {
log.debug("getting InstitutionsLocations instance");
return institutionsLocationsRepository.findById(id);
}
}
| [
"[email protected]"
] | |
2fa77c83045fe596e0189d165c772ddce2729b01 | 3cc53c4d251b70926ef0eca2bfd1878e9d26173d | /Estudos/ExercíciosDeDecisão/equacaoSegundoGrau.java | 540d24dd8de67ea6ff5c1096bf4f9c74bd4419bb | [] | no_license | RobertoLocatelli02/Java-Learning | 9f0654a9acb2355639697baccc4498cce9d33a34 | b3f6796e950ee80f8c4a3f0918c738897c7dd179 | refs/heads/master | 2023-04-30T00:37:05.640114 | 2021-05-20T11:48:56 | 2021-05-20T11:48:56 | 350,850,657 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 851 | java | import java.util.Scanner;
public class equacaoSegundoGrau {
public static void main(String[] args) {
Scanner scanner = new Scanner (System.in);
System.out.println("Informe os valores de a, b & c da equação ax² + bx + c");
System.out.println("a: ");
double a = scanner.nextDouble();
if (a == 0) {
System.out.println("a equação não é do segundo grau");
} else {
System.out.println("b: ");
double b = scanner.nextDouble();
System.out.println("c: ");
double c = scanner.nextDouble();
double delta = (Math.pow(b, 2) - (4 * a * c));
if (delta < 0) {
System.out.println("a equação não possui raizes reais");
} else if (delta == 0) {
System.out.println("a equação possui apenas uma raiz real");
} else {
System.out.println("a equação possui duas raizes reais");
}
}
scanner.close();
}
} | [
"[email protected]"
] | |
be103ba2e3ef4f5ff9d48ff5b7ae0f2bb50672a6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/18/18_ba9e382b70e87565e7ec605ca8d80899c883be95/ResourceManager/18_ba9e382b70e87565e7ec605ca8d80899c883be95_ResourceManager_s.java | 439c07ff70e7d9e694986f833465d88451b835e5 | [] | 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 | 49,316 | java | /*
* Ninja Trials is an old school style Android Game developed for OUYA & using
* AndEngine. It features several minigames with simple gameplay.
* Copyright 2013 Mad Gear Games <[email protected]>
*
* 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.madgear.ninjatrials.managers;
import android.content.Context;
import android.graphics.Typeface;
import android.util.Log;
import java.io.IOException;
import org.andengine.audio.music.Music;
import org.andengine.audio.music.MusicFactory;
import org.andengine.audio.sound.Sound;
import org.andengine.audio.sound.SoundFactory;
import org.andengine.engine.Engine;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.TextureManager;
import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource;
import org.andengine.opengl.texture.atlas.buildable.builder.BlackPawnTextureAtlasBuilder;
import org.andengine.opengl.texture.atlas.buildable.builder.ITextureAtlasBuilder.TextureAtlasBuilderException;
import org.andengine.opengl.texture.bitmap.AssetBitmapTexture;
import org.andengine.opengl.texture.bitmap.BitmapTexture;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.ITiledTextureRegion;
import org.andengine.opengl.texture.region.TextureRegionFactory;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.util.debug.Debug;
import com.madgear.ninjatrials.NinjaTrials;
public class ResourceManager {
private static final TextureOptions mTransparentTextureOption = TextureOptions.BILINEAR;
// ResourceManager Singleton instance
private static ResourceManager INSTANCE;
/* The variables listed should be kept public, allowing us easy access
to them when creating new Sprites, Text objects and to play sound files */
public static NinjaTrials activity;
public static Engine engine;
public static Context context;
public static float cameraWidth;
public static float cameraHeight;
public static TextureManager textureManager;
// MAIN MENU:
public static ITextureRegion mainTitleTR;
public static ITextureRegion mainTitlePattern1TR;
// MAIN OPTIONS MENU:
public static ITextureRegion mainOptionsPatternTR;
public static ITextureRegion mainOptionsSoundBarsActiveTR;
public static ITextureRegion mainOptionsSoundBarsInactiveTR;
// CONTROLLER OPTIONS MENU:
public static ITextureRegion controllerOptionsPatternTR;
public static ITextureRegion controllerOuyaTR;
public static ITextureRegion controllerMarksTR;
// HUD:
public static ITextureRegion hudPowerBarCursorTR;
public static ITextureRegion hudCursorTR;
public static ITextureRegion hudPowerBarPushTR;
public static ITextureRegion hudAngleBarCursorTR;
public static ITextureRegion runLineBar;
public static ITextureRegion runMarkP1;
public static ITextureRegion runMarkP2;
public static ITiledTextureRegion runHead;
// JUMP TRIAL:
public static ITextureRegion jumpStatueTR;
// CUT TRIAL:
public static ITiledTextureRegion cutShoTR;
public static ITextureRegion cutTreeTopTR;
public static ITextureRegion cutTreeBottomTR;
public static ITextureRegion cutCandleTopTR;
public static ITextureRegion cutCandleBottomTR;
public static ITextureRegion cutCandleLightTR;
public static ITextureRegion cutEyesTR;
public static ITextureRegion cutBackgroundTR;
public static ITextureRegion cutSweatDropTR;
public static ITiledTextureRegion cutCharSparkleTR;
public static ITextureRegion cutSwordSparkle1TR;
public static ITiledTextureRegion cutSwordSparkle2TR;
public static ITextureRegion cutHudBarTR;
public static ITextureRegion cutHudCursorTR;
public static ITiledTextureRegion cutHead;
// CUT SCENE SOUNDS:
public static Music cutMusic;
public static Sound cutEyesZoom;
public static Sound cutKatana1;
public static Sound cutKatana2;
public static Sound cutKatana3;
public static Sound cutKatanaWhoosh;
public static Sound cutThud;
// RUN SCENE
public static ITiledTextureRegion runSho;
public static ITiledTextureRegion runRyoko;
public static ITextureRegion runBgFloor;
public static ITextureRegion runBgTreesFront;
public static ITextureRegion runBgTreesBack;
public static ITextureRegion runDushStart;
public static ITextureRegion runDushContinue;
// RESULTS SCENE LOSE
public static ITextureRegion loseCharRyokoTR;
public static ITextureRegion loseCharShoTR;
public static ITextureRegion loseBgTR;
// RESULTS SCENE LOSE SOUNDS
public static Music loseMusic;
public static Sound loseYouLose;
// RESULTS SCENE WIN
public static ITextureRegion winBg;
public static ITextureRegion winScroll;
public static ITiledTextureRegion winDrawings;
public static ITextureRegion winCharSho;
public static ITextureRegion winCharRyoko;
public static ITiledTextureRegion winStampRanking;
public static final int WIN_STAMP_INDEX_THUG = 0;
public static final int WIN_STAMP_INDEX_NINJA = 1;
public static final int WIN_STAMP_INDEX_NINJA_MASTER = 2;
public static final int WIN_STAMP_INDEX_GRAND_MASTER = 3;
// RESULTS SCENE WIN SOUNDS
public static Music winMusic;
public static Sound winPointsSum;
public static Sound winYouWin;
public static Sound winPointsTotal;
// GAME OVER SOUNDS
public static Music gameOverMusic;
public static Sound gameOver;
// FONTS:
public Font fontSmall; // pequeño
public Font fontMedium; // mediano
public Font fontBig; // grande
public Font fontXBig; // Extra grande
//public BuildableBitmapTextureAtlas mBitmapTextureAtlas;
public ITiledTextureRegion mTiledTextureRegion;
//public ITextureRegion mSpriteTextureRegion;
public Music music;
public Sound mSound;
public float cameraScaleFactorX = 1;
public float cameraScaleFactorY = 1;
// Inicializa el manejador:
public static void setup(NinjaTrials pActivity, Engine pEngine, Context pContext,
float pCameraWidth, float pCameraHeight){
getInstance().activity = pActivity;
getInstance().engine = pEngine;
getInstance().context = pContext;
getInstance().cameraWidth = pCameraWidth;
getInstance().cameraHeight = pCameraHeight;
getInstance().textureManager = pActivity.getTextureManager();
}
// Constructor:
ResourceManager(){
// The constructor is of no use to us
}
public synchronized static ResourceManager getInstance(){
if(INSTANCE == null){
INSTANCE = new ResourceManager();
}
return INSTANCE;
}
// Cada escena debe tener sus métodos para cargar y descargar recursos (metodo load y unload).
// tanto en gráficos como música y sonido.
// Deben ser "synchronized".
/**
* Loads the main menu resources.
*/
public synchronized void loadMainMenuResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");
// Main Menu Ninja Trials Logo:
if(mainTitleTR==null) {
BitmapTextureAtlas mainTitleT = new BitmapTextureAtlas(
textureManager, 756, 495, mTransparentTextureOption);
mainTitleTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
mainTitleT, activity, "menu_main_title.png", 0, 0);
mainTitleT.load();
}
// Main Menu Pattern:
if (mainTitlePattern1TR == null) {
BuildableBitmapTextureAtlas mainTitlePattern1T = new BuildableBitmapTextureAtlas(
textureManager, 400, 300, TextureOptions.REPEATING_BILINEAR);
mainTitlePattern1TR = BitmapTextureAtlasTextureRegionFactory
.createFromAsset(mainTitlePattern1T, activity, "menu_main_pattern_1.png");
try {
mainTitlePattern1T.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
mainTitlePattern1T.load();
} catch (TextureAtlasBuilderException e) {
Debug.e(e);
}
}
}
/**
* Unloads the main menu resources.
*/
public synchronized void unloadMainMenuResources() {
if(mainTitleTR!=null) {
if(mainTitleTR.getTexture().isLoadedToHardware()) {
mainTitleTR.getTexture().unload();
mainTitleTR = null;
}
}
if(mainTitlePattern1TR!=null) {
if(mainTitlePattern1TR.getTexture().isLoadedToHardware()) {
mainTitlePattern1TR.getTexture().unload();
mainTitlePattern1TR = null;
}
}
}
/**
* Loads the main option menu resources.
*/
public synchronized void loadOptionResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");
// Sound bars:
BitmapTextureAtlas mainOptionsSoundBarsT = new BitmapTextureAtlas(textureManager, 575, 220,
mTransparentTextureOption);
ITextureRegion mainOptionsSoundBarsTR = BitmapTextureAtlasTextureRegionFactory.
createFromAsset(mainOptionsSoundBarsT, activity, "menu_options_volume.png", 0, 0);
mainOptionsSoundBarsT.load();
mainOptionsSoundBarsActiveTR = TextureRegionFactory.
extractFromTexture(mainOptionsSoundBarsT, 0, 0, 575, 110, false);
mainOptionsSoundBarsInactiveTR = TextureRegionFactory.
extractFromTexture(mainOptionsSoundBarsT, 0, 111, 575, 109, false);
// Option Menu Pattern:
if (mainOptionsPatternTR == null) {
BuildableBitmapTextureAtlas mainOptionsPatternT = new BuildableBitmapTextureAtlas(
textureManager, 390, 361, TextureOptions.REPEATING_BILINEAR);
mainOptionsPatternTR = BitmapTextureAtlasTextureRegionFactory
.createFromAsset(mainOptionsPatternT, activity, "menu_main_pattern_2.png");
try {
mainOptionsPatternT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
mainOptionsPatternT.load();
} catch (TextureAtlasBuilderException e) {
Debug.e(e);
}
}
}
/**
* Unloads the option menu resources.
*/
public synchronized void unloadOptionResources() {
if(mainOptionsSoundBarsActiveTR!=null) {
if(mainOptionsSoundBarsActiveTR.getTexture().isLoadedToHardware()) {
mainOptionsSoundBarsActiveTR.getTexture().unload();
mainOptionsSoundBarsActiveTR = null;
}
}
if(mainOptionsSoundBarsInactiveTR!=null) {
if(mainOptionsSoundBarsInactiveTR.getTexture().isLoadedToHardware()) {
mainOptionsSoundBarsInactiveTR.getTexture().unload();
mainOptionsSoundBarsInactiveTR = null;
}
}
if(mainOptionsPatternTR!=null) {
if(mainOptionsPatternTR.getTexture().isLoadedToHardware()) {
mainOptionsPatternTR.getTexture().unload();
mainOptionsPatternTR = null;
}
}
}
/**
* Loads the main option menu resources.
* public static ITextureRegion controllerOuyaTR;
public static ITextureRegion controllerMarksTR;
*/
public synchronized void loadControllerOptionResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");
// Controller ouya:
if(controllerOuyaTR==null) {
BitmapTextureAtlas controllerOuyaT = new BitmapTextureAtlas(textureManager, 1164, 791,
mTransparentTextureOption);
controllerOuyaTR = BitmapTextureAtlasTextureRegionFactory.
createFromAsset(
controllerOuyaT, activity, "menu_options_controller_ouya.png", 0, 0);
controllerOuyaT.load();
}
// Controller marks:
if(controllerMarksTR==null) {
BitmapTextureAtlas controllerMarksT = new BitmapTextureAtlas(textureManager, 1195, 717,
mTransparentTextureOption);
controllerMarksTR = BitmapTextureAtlasTextureRegionFactory.
createFromAsset(
controllerMarksT, activity, "menu_options_controller_marks.png", 0, 0);
controllerMarksT.load();
}
// Controller Option Pattern:
if (controllerOptionsPatternTR == null) {
BuildableBitmapTextureAtlas controllerOptionsPatternT = new BuildableBitmapTextureAtlas(
textureManager, 319, 319, TextureOptions.REPEATING_BILINEAR);
controllerOptionsPatternTR = BitmapTextureAtlasTextureRegionFactory
.createFromAsset(controllerOptionsPatternT, activity,
"menu_main_pattern_3.png");
try {
controllerOptionsPatternT.build(
new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
controllerOptionsPatternT.load();
} catch (TextureAtlasBuilderException e) {
Debug.e(e);
}
}
}
/**
* Unloads the option menu resources.
*/
public synchronized void unloadControllerOptionResources() {
if(controllerOuyaTR!=null) {
if(controllerOuyaTR.getTexture().isLoadedToHardware()) {
controllerOuyaTR.getTexture().unload();
controllerOuyaTR = null;
}
}
if(controllerMarksTR!=null) {
if(controllerMarksTR.getTexture().isLoadedToHardware()) {
controllerMarksTR.getTexture().unload();
controllerMarksTR = null;
}
}
if(controllerOptionsPatternTR!=null) {
if(controllerOptionsPatternTR.getTexture().isLoadedToHardware()) {
controllerOptionsPatternTR.getTexture().unload();
controllerOptionsPatternTR = null;
}
}
}
public synchronized void loadHUDResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/hud/");
// Barra power cursor:
if(hudPowerBarCursorTR==null) {
BitmapTextureAtlas hudPowerBarCursorT = new BitmapTextureAtlas(
textureManager, 240, 120, mTransparentTextureOption);
hudPowerBarCursorTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
hudPowerBarCursorT, activity, "hud_precision_indicator.png", 0, 0);
hudPowerBarCursorT.load();
}
// Angle Bar:
if (hudAngleBarCursorTR == null) {
BitmapTextureAtlas hudAngleBarCursorT = new BitmapTextureAtlas(
textureManager, 353, 257, mTransparentTextureOption);
hudAngleBarCursorTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
hudAngleBarCursorT, activity, "hud_angle_indicator.png", 0, 0);
hudAngleBarCursorT.load();
}
//TODO: import Cursor angle
// Cursor:
if(hudCursorTR==null) {
BitmapTextureAtlas hudCursorT = new BitmapTextureAtlas(textureManager, 59, 52,
mTransparentTextureOption);
hudCursorTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(hudCursorT,
activity, "hud_precision_cursor.png", 0, 0);
hudCursorT.load();
}
// Barra power push:
if(hudPowerBarPushTR==null) {
BitmapTextureAtlas hudPowerBarPushT = new BitmapTextureAtlas(textureManager, 120, 240,
mTransparentTextureOption);
hudPowerBarPushTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
hudPowerBarPushT, activity, "hud_power_indicator.png", 0, 0);
hudPowerBarPushT.load();
}
// LineBar
if (runLineBar == null) {
BitmapTextureAtlas runLineBarBit = new BitmapTextureAtlas(textureManager, 1012, 80,
mTransparentTextureOption);
runLineBar = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
runLineBarBit, activity, "run_line_bar.png", 0, 0);
runLineBarBit.load();
}
// LineMark
BitmapTextureAtlas runMarkBit = new BitmapTextureAtlas(textureManager, 140, 116,
mTransparentTextureOption);
ITextureRegion runMark = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
runMarkBit, activity, "run_line_mark.png", 0, 0);
runMarkBit.load();
if (runMarkP1 == null)
runMarkP1 = TextureRegionFactory.extractFromTexture(runMarkBit, 0, 0, 70, 116, false);
if (runMarkP2 == null)
runMarkP2 = TextureRegionFactory.extractFromTexture(runMarkBit, 70, 0, 140, 116, false);
// RunHead
if (runHead == null) {
BuildableBitmapTextureAtlas runHeadBit = new BuildableBitmapTextureAtlas(
textureManager, 660, 440, mTransparentTextureOption);
runHead = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
runHeadBit, context, "hud_head_run.png", 3, 2);
try {
runHeadBit.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
}
catch (TextureAtlasBuilderException e) {
e.printStackTrace();
}
runHeadBit.load();
}
// CutHead
if (cutHead == null) {
BuildableBitmapTextureAtlas cutHeadBit = new BuildableBitmapTextureAtlas(
textureManager, 660, 440, mTransparentTextureOption);
cutHead = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
cutHeadBit, context, "hud_head_cut.png", 3, 2);
try {
cutHeadBit.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
}
catch (TextureAtlasBuilderException e) {
e.printStackTrace();
}
cutHeadBit.load();
}
}
public synchronized void unloadHUDResources() {
if(hudPowerBarCursorTR!=null) {
if(hudPowerBarCursorTR.getTexture().isLoadedToHardware()) {
hudPowerBarCursorTR.getTexture().unload();
hudPowerBarCursorTR = null;
}
}
if(hudAngleBarCursorTR!=null) {
if(hudAngleBarCursorTR.getTexture().isLoadedToHardware()) {
hudAngleBarCursorTR.getTexture().unload();
hudAngleBarCursorTR = null;
}
}
if(hudCursorTR!=null) {
if(hudCursorTR.getTexture().isLoadedToHardware()) {
hudCursorTR.getTexture().unload();
hudCursorTR = null;
}
}
if(hudPowerBarPushTR!=null) {
if(hudPowerBarPushTR.getTexture().isLoadedToHardware()) {
hudPowerBarPushTR.getTexture().unload();
hudPowerBarPushTR = null;
}
}
if (runLineBar != null && runLineBar.getTexture().isLoadedToHardware()) {
runLineBar.getTexture().unload();
runLineBar = null;
}
if (runMarkP1 != null && runMarkP1.getTexture().isLoadedToHardware()) {
runMarkP1.getTexture().unload();
runMarkP1 = null;
}
if (runMarkP2 != null && runMarkP2.getTexture().isLoadedToHardware()) {
runMarkP2.getTexture().unload();
runMarkP2 = null;
}
if (runHead != null && runHead.getTexture().isLoadedToHardware()) {
runHead.getTexture().unload();
runHead = null;
}
if (cutHead != null && cutHead.getTexture().isLoadedToHardware()) {
cutHead.getTexture().unload();
cutHead = null;
}
}
public synchronized void loadJumpSceneResources() {
//Texturas:
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/trial_jump/");
//Statue:
BitmapTextureAtlas jumpStatueT = new BitmapTextureAtlas(textureManager, 442, 310,
mTransparentTextureOption);
ITextureRegion jumpStatueAllTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
jumpStatueT, activity, "jump_bg_1_stone_statues.png", 0, 0);
jumpStatueT.load();
// jumpStatueTR = TextureRegionFactory.extractFromTexture(jumpStatueT, 0, 0, 388, 380,
// false);
jumpStatueTR = jumpStatueAllTR;
}
public synchronized void unloadJumpSceneResources() {
if(jumpStatueTR != null){
if(jumpStatueTR.getTexture().isLoadedToHardware()) {
jumpStatueTR.getTexture().unload();
jumpStatueTR = null;
}
}
}
// Recursos para la escena de corte:
public synchronized void loadCutSceneResources() {
// Texturas:
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/trial_cut/");
// Sho:
if(cutShoTR==null) {
BuildableBitmapTextureAtlas cutShoT = new BuildableBitmapTextureAtlas(
textureManager, 1742, 1720, mTransparentTextureOption);
cutShoTR = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
cutShoT, context, "cut_ch_sho_cut_anim.png", 2, 2);
try {
cutShoT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
} catch (TextureAtlasBuilderException e) { e.printStackTrace(); }
cutShoT.load();
}
// Arbol:
BitmapTextureAtlas cutTreeT = new BitmapTextureAtlas(textureManager, 640, 950,
mTransparentTextureOption);
ITextureRegion cutTreeTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutTreeT, activity, "cut_breakable_tree.png", 0, 0);
cutTreeT.load();
cutTreeTopTR = TextureRegionFactory.extractFromTexture(cutTreeT, 0, 0, 640, 403, false);
cutTreeBottomTR = TextureRegionFactory.extractFromTexture(cutTreeT, 0, 404, 640, 546,
false);
// Farol:
BitmapTextureAtlas cutCandleT = new BitmapTextureAtlas(textureManager, 310, 860,
mTransparentTextureOption);
ITextureRegion cutCandleTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutCandleT, activity, "cut_breakable_candle_base.png", 0, 0);
cutCandleT.load();
cutCandleTopTR = TextureRegionFactory.extractFromTexture(cutCandleT, 0, 0, 310, 515, false);
cutCandleBottomTR = TextureRegionFactory.extractFromTexture(cutCandleT, 0, 516, 310, 344,
false);
// Luz del farol:
BitmapTextureAtlas cutCandleLightT = new BitmapTextureAtlas(textureManager, 760, 380,
mTransparentTextureOption);
ITextureRegion cutCandleLightAllTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutCandleLightT, activity, "cut_breakable_candle_light.png", 0, 0);
cutCandleLightT.load();
cutCandleLightTR = TextureRegionFactory.extractFromTexture(cutCandleLightT, 0, 0, 388, 380,
false);
// Espada 2:
if(cutSwordSparkle2TR==null) {
BuildableBitmapTextureAtlas cutSword2T = new BuildableBitmapTextureAtlas(
textureManager, 1358, 1034, mTransparentTextureOption);
cutSwordSparkle2TR = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
cutSword2T, context, "cut_sword_sparkle2.png", 2, 2);
try {
cutSword2T.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
} catch (TextureAtlasBuilderException e) { e.printStackTrace(); }
cutSword2T.load();
}
// Ojos:
if(cutEyesTR==null) {
BitmapTextureAtlas cutEyesT = new BitmapTextureAtlas(textureManager, 1416, 611,
mTransparentTextureOption);
cutEyesTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutEyesT, activity, "cut_ch_sho_eyes.png", 0, 0);
cutEyesT.load();
}
// Fondo:
if(cutBackgroundTR==null) {
BitmapTextureAtlas cutBackgroundT = new BitmapTextureAtlas(textureManager, 1920, 1080,
mTransparentTextureOption);
cutBackgroundTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutBackgroundT, activity, "cut_background.png", 0, 0);
cutBackgroundT.load();
}
// Gota:
if(cutSweatDropTR==null) {
BitmapTextureAtlas cutSweatDropT = new BitmapTextureAtlas(textureManager, 46, 107,
mTransparentTextureOption);
cutSweatDropTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutSweatDropT, activity, "cut_ch_sweatdrop.png", 0, 0);
cutSweatDropT.load();
}
// Character eye sparkle:
if(cutCharSparkleTR==null) {
BuildableBitmapTextureAtlas cutCharSparkleT = new BuildableBitmapTextureAtlas(
textureManager, 300, 100, mTransparentTextureOption);
cutCharSparkleTR = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
cutCharSparkleT, context, "cut_ch_sparkle.png", 3, 1);
try {
cutCharSparkleT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
} catch (TextureAtlasBuilderException e) { e.printStackTrace(); }
cutCharSparkleT.load();
}
// Espada 1:
if(cutSwordSparkle1TR==null) {
BitmapTextureAtlas cutSword1T = new BitmapTextureAtlas(textureManager, 503, 345,
mTransparentTextureOption);
cutSwordSparkle1TR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
cutSword1T, activity, "cut_sword_sparkle1.png", 0, 0);
cutSword1T.load();
}
// Music & Sounds:
SoundFactory.setAssetBasePath("sounds/");
MusicFactory.setAssetBasePath("music/");
try {
cutEyesZoom = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_eyes_zoom.ogg");
cutKatana1 = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_katana_cut1.ogg");
cutKatana2 = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_katana_cut2.ogg");
cutKatana3 = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_katana_cut3.ogg");
cutKatanaWhoosh = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_katana_whoosh1.ogg");
cutThud = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "trial_cut_katana_whoosh2.ogg");
cutMusic = MusicFactory.createMusicFromAsset(
activity.getMusicManager(), context, "trial_cut_music.ogg");
} catch (final IOException e) {
Log.v("Sounds Load","Exception:" + e.getMessage());
}
}
// Liberamos los recursos de la escena de corte:
public synchronized void unloadCutSceneResources() {
if(cutShoTR != null) {
if(cutShoTR.getTexture().isLoadedToHardware()) {
cutShoTR.getTexture().unload();
cutShoTR = null;
}
}
if(cutTreeTopTR!=null) {
if(cutTreeTopTR.getTexture().isLoadedToHardware()) {
cutTreeTopTR.getTexture().unload();
cutTreeTopTR = null;
}
}
if(cutTreeBottomTR!=null) {
if(cutTreeBottomTR.getTexture().isLoadedToHardware()) {
cutTreeBottomTR.getTexture().unload();
cutTreeBottomTR = null;
}
}
if(cutCandleTopTR!=null) {
if(cutCandleTopTR.getTexture().isLoadedToHardware()) {
cutCandleTopTR.getTexture().unload();
cutCandleTopTR = null;
}
}
if(cutCandleBottomTR!=null) {
if(cutCandleBottomTR.getTexture().isLoadedToHardware()) {
cutCandleBottomTR.getTexture().unload();
cutCandleBottomTR = null;
}
}
if(cutCandleLightTR!=null) {
if(cutCandleLightTR.getTexture().isLoadedToHardware()) {
cutCandleLightTR.getTexture().unload();
cutCandleLightTR = null;
}
}
if(cutEyesTR!=null) {
if(cutEyesTR.getTexture().isLoadedToHardware()) {
cutEyesTR.getTexture().unload();
cutEyesTR = null;
}
}
if(cutBackgroundTR!=null) {
if(cutBackgroundTR.getTexture().isLoadedToHardware()) {
cutBackgroundTR.getTexture().unload();
cutBackgroundTR = null;
}
}
if(cutSweatDropTR!=null) {
if(cutSweatDropTR.getTexture().isLoadedToHardware()) {
cutSweatDropTR.getTexture().unload();
cutSweatDropTR = null;
}
}
if(cutCharSparkleTR!=null) {
if(cutCharSparkleTR.getTexture().isLoadedToHardware()) {
cutCharSparkleTR.getTexture().unload();
cutCharSparkleTR = null;
}
}
if(cutSwordSparkle1TR!=null) {
if(cutSwordSparkle1TR.getTexture().isLoadedToHardware()) {
cutSwordSparkle1TR.getTexture().unload();
cutSwordSparkle1TR = null;
}
}
if(cutSwordSparkle2TR!=null) {
if(cutSwordSparkle2TR.getTexture().isLoadedToHardware()) {
cutSwordSparkle2TR.getTexture().unload();
cutSwordSparkle2TR = null;
}
}
// Music & Sounds:
if(!cutEyesZoom.isReleased())
cutEyesZoom.release();
if(!cutKatana1.isReleased())
cutKatana1.release();
if(!cutKatana2.isReleased())
cutKatana2.release();
if(!cutKatana3.isReleased())
cutKatana3.release();
if(!cutKatanaWhoosh.isReleased())
cutKatanaWhoosh.release();
if(!cutEyesZoom.isReleased())
cutThud.release();
if(!cutMusic.isReleased())
cutMusic.release();
// Garbage Collector:
System.gc();
}
public synchronized void loadRunSceneResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/trial_run/");
// Background
if (runBgFloor == null) {
BitmapTextureAtlas RunBg1 = new BitmapTextureAtlas(textureManager, 1024, 326,
mTransparentTextureOption);
runBgFloor = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
RunBg1, activity, "run_background_floor.png", 0, 0);
RunBg1.load();
}
if (runBgTreesBack == null) {
BitmapTextureAtlas RunBg2 = new BitmapTextureAtlas(textureManager, 1021, 510,
mTransparentTextureOption);
runBgTreesBack = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
RunBg2, activity, "run_background_trees_back.png", 0, 0);
RunBg2.load();
}
if (runBgTreesFront == null) {
BitmapTextureAtlas RunBg3 = new BitmapTextureAtlas(textureManager, 1024, 754,
mTransparentTextureOption);
runBgTreesFront = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
RunBg3, activity, "run_background_trees_front.png", 0, 0);
RunBg3.load();
}
// Dush
if (runDushStart == null) {
BitmapTextureAtlas runDush = new BitmapTextureAtlas(textureManager, 1296, 1080,
mTransparentTextureOption);
runDushStart = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
runDush, activity, "run_dust_start.png", 0, 0);
runDush.load();
}
if (runDushContinue == null) {
BitmapTextureAtlas runDush = new BitmapTextureAtlas(textureManager, 600, 600,
mTransparentTextureOption);
runDushContinue = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
runDush, activity, "run_dust_continuous.png", 0, 0);
runDush.load();
}
// Sho
if (runSho == null) {
BuildableBitmapTextureAtlas runShoBit = new BuildableBitmapTextureAtlas(
textureManager, 2115, 2028, mTransparentTextureOption);
runSho = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
runShoBit, context, "run_ch_sho.png", 5, 4);
try {
runShoBit.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
}
catch (TextureAtlasBuilderException e) {
e.printStackTrace();
}
runShoBit.load();
}
// Ryoko
if (runRyoko == null) {
BuildableBitmapTextureAtlas runRyokoBit = new BuildableBitmapTextureAtlas(
textureManager, 2115, 2028, mTransparentTextureOption);
runRyoko = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
runRyokoBit, context, "run_ch_ryoko.png", 5, 4);
try {
runRyokoBit.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
}
catch (TextureAtlasBuilderException e) {
e.printStackTrace();
}
runRyokoBit.load();
}
}
public synchronized void unloadRunSceneResources() {
if (runSho != null && runSho.getTexture().isLoadedToHardware()) {
runSho.getTexture().unload();
runSho = null;
}
if (runRyoko != null && runRyoko.getTexture().isLoadedToHardware()) {
runRyoko.getTexture().unload();
runRyoko = null;
}
if (runBgFloor != null && runBgFloor.getTexture().isLoadedToHardware()) {
runBgFloor.getTexture().unload();
runBgFloor = null;
}
if (runBgTreesFront != null && runBgTreesFront.getTexture().isLoadedToHardware()) {
runBgTreesFront.getTexture().unload();
runBgTreesFront = null;
}
if (runBgTreesBack != null && runBgTreesBack.getTexture().isLoadedToHardware()) {
runBgTreesBack.getTexture().unload();
runBgTreesBack = null;
}
if (runDushStart != null && runDushStart.getTexture().isLoadedToHardware()) {
runDushStart.getTexture().unload();
runDushStart = null;
}
if (runDushContinue != null && runDushContinue.getTexture().isLoadedToHardware()) {
runDushContinue.getTexture().unload();
runDushContinue = null;
}
// Garbage Collector:
System.gc();
}
public synchronized void loadResultLoseSceneResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/results/");
// Bg:
if(loseBgTR==null) {
BitmapTextureAtlas loseBgT = new BitmapTextureAtlas(textureManager, 1920, 1080,
mTransparentTextureOption);
loseBgTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
loseBgT, activity, "results_lose_background.png", 0, 0);
loseBgT.load();
}
// Sho:
if(loseCharShoTR==null) {
BitmapTextureAtlas loseCharShoT = new BitmapTextureAtlas(textureManager, 797, 440,
mTransparentTextureOption);
loseCharShoTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
loseCharShoT, activity, "results_lose_ch_sho.png", 0, 0);
loseCharShoT.load();
}
// Ryoko:
if(loseCharRyokoTR==null) {
BitmapTextureAtlas loseCharRyokoT = new BitmapTextureAtlas(textureManager, 797, 440,
mTransparentTextureOption);
loseCharRyokoTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
loseCharRyokoT, activity, "results_lose_ch_ryoko.png", 0, 0);
loseCharRyokoT.load();
}
// Music & Sounds:
SoundFactory.setAssetBasePath("sounds/");
MusicFactory.setAssetBasePath("music/");
try {
loseYouLose = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "judge_you_lose.ogg");
loseMusic = MusicFactory.createMusicFromAsset(
activity.getMusicManager(), context, "result_lose.ogg");
} catch (final IOException e) {
Log.v("Sounds Load","Exception:" + e.getMessage());
}
}
public synchronized void unloadResultLoseSceneResources() {
if(loseBgTR!=null) {
if(loseBgTR.getTexture().isLoadedToHardware()) {
loseBgTR.getTexture().unload();
loseBgTR = null;
}
}
if(loseCharShoTR!=null) {
if(loseCharShoTR.getTexture().isLoadedToHardware()) {
loseCharShoTR.getTexture().unload();
loseCharShoTR = null;
}
}
if(loseCharRyokoTR!=null) {
if(loseCharRyokoTR.getTexture().isLoadedToHardware()) {
loseCharRyokoTR.getTexture().unload();
loseCharRyokoTR = null;
}
}
// Music & Sounds:
if(!loseYouLose.isReleased())
loseYouLose.release();
if(!loseMusic.isReleased())
loseMusic.release();
// Garbage Collector:
System.gc();
}
public static synchronized void loadResultWinResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/results/");
// Bg:
if(winBg==null) {
BitmapTextureAtlas winBgT = new BitmapTextureAtlas(textureManager, 1920, 1080,
mTransparentTextureOption);
winBg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
winBgT, activity, "results_win_background.png", 0, 0);
winBgT.load();
}
// Scroll:
if(winScroll==null) {
BitmapTextureAtlas winScrollT = new BitmapTextureAtlas(textureManager, 1064, 1029,
mTransparentTextureOption);
winScroll = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
winScrollT, activity, "results_win_scroll.png", 0, 0);
winScrollT.load();
}
// Sho:
if(winCharSho==null) {
BitmapTextureAtlas winCharShoT = new BitmapTextureAtlas(textureManager, 437, 799,
mTransparentTextureOption);
winCharSho = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
winCharShoT, activity, "results_win_ch_sho.png", 0, 0);
winCharShoT.load();
}
// Ryoko:
if(winCharRyoko==null) {
BitmapTextureAtlas winCharRyokoT = new BitmapTextureAtlas(textureManager, 395, 767,
mTransparentTextureOption);
winCharRyoko = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
winCharRyokoT, activity, "results_win_ch_ryoko.png", 0, 0);
winCharRyokoT.load();
}
// Drawings:
if(winDrawings==null) {
BuildableBitmapTextureAtlas winDrawingsT = new BuildableBitmapTextureAtlas(
textureManager, 1106, 962, mTransparentTextureOption);
winDrawings = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
winDrawingsT, context, "results_win_drawings.png", 2, 2);
try {
winDrawingsT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
} catch (TextureAtlasBuilderException e) { e.printStackTrace(); }
winDrawingsT.load();
}
// Stamps:
if(winStampRanking==null) {
BuildableBitmapTextureAtlas winStampRankingT = new BuildableBitmapTextureAtlas(
textureManager, 780, 400, mTransparentTextureOption);
winStampRanking = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
winStampRankingT, context, "results_win_stamp_ranking.png", 2, 2);
try {
winStampRankingT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
BitmapTextureAtlas>(0, 0, 0));
} catch (TextureAtlasBuilderException e) { e.printStackTrace(); }
winStampRankingT.load();
}
// Music & Sounds:
SoundFactory.setAssetBasePath("sounds/");
MusicFactory.setAssetBasePath("music/");
try {
winYouWin = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "judge_you_win.ogg");
winPointsSum = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "menu_points_sum.ogg");
winPointsTotal = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "menu_points_total.ogg");
winMusic = MusicFactory.createMusicFromAsset(
activity.getMusicManager(), context, "result_win.ogg");
} catch (final IOException e) {
Log.v("Sounds Load","Exception:" + e.getMessage());
}
}
public static synchronized void unloadResultWinResources() {
if(winBg!=null) {
if(winBg.getTexture().isLoadedToHardware()) {
winBg.getTexture().unload();
winBg = null;
}
}
if(winScroll!=null) {
if(winScroll.getTexture().isLoadedToHardware()) {
winScroll.getTexture().unload();
winScroll = null;
}
}
if(winCharSho!=null) {
if(winCharSho.getTexture().isLoadedToHardware()) {
winCharSho.getTexture().unload();
winCharSho = null;
}
}
if(winCharRyoko!=null) {
if(winCharRyoko.getTexture().isLoadedToHardware()) {
winCharRyoko.getTexture().unload();
winCharRyoko = null;
}
}
if(winDrawings!=null) {
if(winDrawings.getTexture().isLoadedToHardware()) {
winDrawings.getTexture().unload();
winDrawings = null;
}
}
if(winStampRanking!=null) {
if(winStampRanking.getTexture().isLoadedToHardware()) {
winStampRanking.getTexture().unload();
winStampRanking = null;
}
}
// Music & Sounds:
if(winYouWin != null && !winYouWin.isReleased())
winYouWin.release();
if(winPointsSum != null && !winPointsSum.isReleased())
winPointsSum.release();
if(winPointsTotal != null && !winPointsTotal.isReleased())
winPointsTotal.release();
if(winMusic != null && !winMusic.isReleased())
winMusic.release();
// Garbage Collector:
System.gc();
}
public synchronized void loadGameOverResources() {
// Music & Sounds:
SoundFactory.setAssetBasePath("sounds/");
MusicFactory.setAssetBasePath("music/");
try {
gameOver = SoundFactory.createSoundFromAsset(
activity.getSoundManager(), context, "judge_game_over.ogg");
gameOverMusic = MusicFactory.createMusicFromAsset(
activity.getMusicManager(), context, "game_over.ogg");
} catch (final IOException e) {
Log.v("Sounds Load","Exception:" + e.getMessage());
}
}
public synchronized void unloadGameOverResources() {
// Music & Sounds:
if(!gameOver.isReleased())
gameOver.release();
if(!gameOverMusic.isReleased())
gameOverMusic.release();
}
/* Loads fonts resources
*/
public synchronized void loadFonts(Engine pEngine){
FontFactory.setAssetBasePath("fonts/");
// Small = 64
fontSmall = FontFactory.createStrokeFromAsset(pEngine.getFontManager(),
pEngine.getTextureManager(), 512, 512, activity.getAssets(), "go3v2.ttf",
64f, true, android.graphics.Color.WHITE, 3, android.graphics.Color.RED);
fontSmall.load();
// Medium = 96
fontMedium = FontFactory.createStrokeFromAsset(pEngine.getFontManager(),
pEngine.getTextureManager(), 1024, 1024, activity.getAssets(), "go3v2.ttf",
96f, true, android.graphics.Color.WHITE, 3, android.graphics.Color.RED);
fontMedium.load();
// Big = 128
fontBig = FontFactory.createStrokeFromAsset(pEngine.getFontManager(),
pEngine.getTextureManager(), 1024, 1024, activity.getAssets(), "go3v2.ttf",
128f, true, android.graphics.Color.WHITE, 3, android.graphics.Color.RED);
fontBig.load();
// XBig = 192
fontXBig = FontFactory.createStrokeFromAsset(pEngine.getFontManager(),
pEngine.getTextureManager(), 1024, 1024, activity.getAssets(), "go3v2.ttf",
192f, true, android.graphics.Color.WHITE, 3, android.graphics.Color.RED);
fontXBig.load();
}
/* If an unloadFonts() method is necessary, we can provide one
*/
public synchronized void unloadFonts(){
fontSmall.unload();
fontMedium.unload();
fontBig.unload();
fontXBig.unload();
}
}
| [
"[email protected]"
] | |
a00f4034a3d16380ed529442da8233027c0a2167 | 8f5a44b5c80679bf4c6d581a9c550255efbf050e | /src/main/java/com/dennis/cursomc/repositories/CidadeRepository.java | d78f105bdf4d5b228c054438f9f3398bb8cb761e | [] | no_license | dvaldrez/cursomc | 86cb240934aaee64f2fbe2f001bc347cc93b7fbf | 9576826c36b598ce2123b81c8fda2a59f98c1274 | refs/heads/main | 2023-07-24T05:39:58.999544 | 2021-09-06T22:48:20 | 2021-09-06T22:48:20 | 401,820,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package com.dennis.cursomc.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.dennis.cursomc.domain.Cidade;
@Repository
public interface CidadeRepository extends JpaRepository<Cidade, Integer> {
}
| [
"[email protected]"
] | |
a0efe9b36410b8a489dda3f43f1871582fa09aae | 895f3a4571853e1a8b2f897c83ccee1a7adfb627 | /dscatalog_backend/src/main/java/com/projects/dscatalog/config/WebSecurityConfig.java | 91edfec074fdf8e03c07bbcc5690d22553d42069 | [] | no_license | VanderleiKs/dscatalog | cdb2f12e64f83c2f3f1dc79e1ba8625c7a139270 | a738dd1406ceb670aed3aac4a34f8126709da030 | refs/heads/main | 2023-04-03T15:24:25.751988 | 2021-04-12T02:33:16 | 2021-04-12T02:33:16 | 306,474,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,543 | java | package com.projects.dscatalog.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private BCryptPasswordEncoder passwordEncoder;
@Autowired
private UserDetailsService userDetailsService;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/actuator/**");
}
@Override
@Bean
protected AuthenticationManager authenticationManager() throws Exception {
return super.authenticationManager();
}
}
| [
"[email protected]"
] | |
56ac7a20636e0926013bf13ec350525709929684 | d6bd6a9d5919dd38622ba46c2ae29a4f7da2aca1 | /EDA1/TrabEDA1/src/EDA1/NoArv.java | 9cbffcc622654dabef57aa03efb8243339224595 | [] | no_license | JQueimado/Universidade | 67a9e90e3f5253c7d872a600ac0084c6af506c73 | a8f9d7abf47be12cc34bb76133d197d49dbd92a8 | refs/heads/master | 2021-07-09T17:24:06.073363 | 2020-07-26T02:37:28 | 2020-07-26T02:37:28 | 178,636,859 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package EDA1;
public class NoArv<T> {
T elemento;
NoArv esquerdo;
NoArv direito;
public NoArv(T elemento) { // metodo com 1 argumento
this(elemento, null, null);
}
public NoArv(T o, NoArv<T> esq, NoArv<T> dir) {
elemento = o;
esquerdo = esq;
direito = dir;
}
public String toString(){
return (String) elemento;
}
}
| [
"[email protected]"
] | |
fb72709292b5187ab7fe863224cf8aee40ad7544 | 4cecb447ce17d05a949caf309648fe93508b58f4 | /app/src/main/java/com/example/shoppinglist/SecondActivity.java | a5902f5562cdcdd7015a82eaa9455acd8c882554 | [] | no_license | camdenm01/ShoppingList | c7f6c27f86cf4c1309dfbecb5d32a0ba168b5d91 | 0d1eabd43ae2f4ebd25e59d3fc1b9a52785e8855 | refs/heads/master | 2023-08-25T10:24:09.376695 | 2021-10-31T19:50:20 | 2021-10-31T19:50:20 | 423,246,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,401 | java | package com.example.shoppinglist;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class SecondActivity extends AppCompatActivity {
public static final String EXTRA_ADD = "com.example.android.shoppinglist.extra.ADD";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
public void addCheese(View view){
Intent intent = new Intent();
intent.putExtra(EXTRA_ADD, "Cheese");
setResult(RESULT_OK, intent);
finish();
}
public void addRice(View view){
Intent intent = new Intent();
intent.putExtra(EXTRA_ADD, "Rice");
setResult(RESULT_OK, intent);
finish();
}
public void addApples(View view){
Intent intent = new Intent();
intent.putExtra(EXTRA_ADD, "Apples");
setResult(RESULT_OK, intent);
finish();
}
public void addMilk(View view){
Intent intent = new Intent();
intent.putExtra(EXTRA_ADD, "Milk");
setResult(RESULT_OK, intent);
finish();
}
public void addBread(View view){
Intent intent = new Intent();
intent.putExtra(EXTRA_ADD, "Bread");
setResult(RESULT_OK, intent);
finish();
}
} | [
"[email protected]"
] | |
48e8d72b506f7a4e143fc39abee172d51c7bb1b1 | 1aca0d2d8182e9e1d84a3b4e3971b3090a48ef94 | /est-db/src/main/java/com/xipin/est/db/bean/UserLoginBean.java | 7bf34a7c7720f8009f902f0b18b5e3d4006c4cc1 | [] | no_license | Aiden-Wu/SSM | 797dec451c12962c3c685ba94c00948903b636ca | 0fa1962ef3f151acaac608c21ed3631f9274851a | refs/heads/master | 2021-06-14T23:45:38.694977 | 2017-03-22T09:45:00 | 2017-03-22T09:45:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 430 | java | package com.xipin.est.db.bean;
import com.xipin.est.utils.bean.Bean;
public class UserLoginBean extends Bean {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"[email protected]"
] | |
572377e4a7038a0a90224f06d4c2f91211199870 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/19/19_0d340db93851a869bf26af8ba1bf9bc850c6c36a/Galaxy/19_0d340db93851a869bf26af8ba1bf9bc850c6c36a_Galaxy_s.java | 047545c68a7393f541fd08f4735f712cda93b5a6 | [] | 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 | 13,304 | java | /*
* $Id$
* --------------------------------------------------------------------------------------
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.mule.galaxy.web.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.HistoryListener;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.SourcesTabEvents;
import com.google.gwt.user.client.ui.TabListener;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.Widget;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.mule.galaxy.web.client.activity.ActivityPanel;
import org.mule.galaxy.web.client.admin.AdministrationPanel;
import org.mule.galaxy.web.client.artifact.ArtifactPanel;
import org.mule.galaxy.web.client.registry.ArtifactForm;
import org.mule.galaxy.web.client.registry.BrowsePanel;
import org.mule.galaxy.web.client.registry.SearchPanel;
import org.mule.galaxy.web.client.registry.ViewPanel;
import org.mule.galaxy.web.client.util.ExternalHyperlink;
import org.mule.galaxy.web.client.workspace.ManageWorkspacePanel;
import org.mule.galaxy.web.client.workspace.WorkspaceForm;
import org.mule.galaxy.web.rpc.AbstractCallback;
import org.mule.galaxy.web.rpc.HeartbeatService;
import org.mule.galaxy.web.rpc.HeartbeatServiceAsync;
import org.mule.galaxy.web.rpc.RegistryService;
import org.mule.galaxy.web.rpc.RegistryServiceAsync;
import org.mule.galaxy.web.rpc.SecurityService;
import org.mule.galaxy.web.rpc.SecurityServiceAsync;
import org.mule.galaxy.web.rpc.WUser;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Galaxy implements EntryPoint, HistoryListener {
public static final String WILDCARD = "*";
private static final String DEFAULT_PAGE = "browse";
private SimplePanel registryPanel;
private SimplePanel activityPanel;
private SimplePanel adminPanel;
private RegistryServiceAsync registryService;
private SecurityServiceAsync securityService;
private HeartbeatServiceAsync heartbeatService;
private FlowPanel rightPanel;
private PageInfo curInfo;
private Map history = new HashMap();
protected TabPanel tabPanel;
private WUser user;
protected int oldTab;
private boolean suppressTabHistory;
private Map historyListeners = new HashMap();
private int adminTabIndex;
private BrowsePanel browsePanel;
// Delimiters may be causing GWT issues w/safari
// this makes it easy to swap ones out.
protected FlowPanel base;
/**
* This is the entry point method.
*/
public void onModuleLoad() {
// prefetch the image, so that e.g. SessionKilled dialog can be properly displayed for the first time
// when the server is already down and cannot serve it.
Image.prefetch("images/lightbox.png");
History.addHistoryListener(this);
this.registryService = (RegistryServiceAsync) GWT.create(RegistryService.class);
ServiceDefTarget target = (ServiceDefTarget) registryService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "../handler/registry.rpc");
this.securityService = (SecurityServiceAsync) GWT.create(SecurityService.class);
target = (ServiceDefTarget) securityService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "../handler/securityService.rpc");
this.heartbeatService = (HeartbeatServiceAsync) GWT.create(HeartbeatService.class);
target = (ServiceDefTarget) heartbeatService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "../handler/heartbeat.rpc");
base = new FlowPanel();
base.setStyleName("base");
base.setWidth("100%");
registryPanel = new SimplePanel();
activityPanel = new SimplePanel();
adminPanel = new SimplePanel();
tabPanel = new TabPanel();
rightPanel = new FlowPanel();
rightPanel.setStyleName("header-right");
FlowPanel header = new FlowPanel();
header.setStyleName("header");
header.add(rightPanel);
final Image logo = new Image("images/galaxy_small_logo.png");
logo.setTitle("Home");
logo.addStyleName("gwt-Hyperlink");
logo.addClickListener(new ClickListener()
{
public void onClick(final Widget widget)
{
History.newItem("browse");
}
});
header.add(logo);
base.add(header);
tabPanel.setStyleName("headerTabPanel");
tabPanel.getDeckPanel().setStyleName("headerTabDeckPanel");
tabPanel.addTabListener(new TabListener() {
public boolean onBeforeTabSelected(SourcesTabEvents event, int newTab) {
return true;
}
public void onTabSelected(SourcesTabEvents tabPanel, int tab) {
if (oldTab != tab && !suppressTabHistory) {
if (tab == 0) {
History.newItem("browse");
} else {
History.newItem("tab-" + tab);
}
}
oldTab = tab;
}
});
initializeBody();
browsePanel = new BrowsePanel(this);
createPageInfo(DEFAULT_PAGE, browsePanel, 0);
registryPanel.add(browsePanel);
final Galaxy galaxy = this;
registryService.getUserInfo(new AbstractCallback(browsePanel) {
public void onSuccess(Object o) {
user = (WUser) o;
rightPanel.add(new Label(user.getName()));
ExternalHyperlink logout = new ExternalHyperlink("Logout", GWT.getHostPageBaseURL() + "j_logout");
rightPanel.add(logout);
loadTabs(galaxy);
}
});
Label footer = new Label(getProductName() + ", Copyright 2008 MuleSource, Inc.");
footer.setStyleName("footer");
base.add(footer);
RootPanel.get().add(base);
createPageInfo("artifact_" + WILDCARD, new ArtifactPanel(this), 0);
createPageInfo("add-artifact", new ArtifactForm(this), 0);
createPageInfo("new-artifact-version_" + WILDCARD, new ArtifactForm(this), 0);
createPageInfo("add-workspace", new WorkspaceForm(this), 0);
createPageInfo("manage-workspace", new ManageWorkspacePanel(this), 0);
createPageInfo("search", new SearchPanel(this), 0);
createPageInfo("view", new ViewPanel(this), 0);
new HeartbeatTimer(Galaxy.this);
}
protected void initializeBody() {
base.add(tabPanel);
}
protected String getProductName() {
return "Mule Galaxy";
}
public PageInfo createPageInfo(String token,
final AbstractComposite composite,
int tab) {
PageInfo page = new PageInfo(token, tab) {
public AbstractComposite createInstance() {
return composite;
}
};
addPage(page);
return page;
}
protected void loadTabs(final Galaxy galaxy) {
tabPanel.insert(registryPanel, "Registry", 0);
if (hasPermission("VIEW_ACTIVITY")) {
createPageInfo("tab-1", new ActivityPanel(this), 1);
tabPanel.insert(activityPanel, "Activity", tabPanel.getWidgetCount());
}
if (showAdminTab(user)) {
adminTabIndex = tabPanel.getWidgetCount() ;
createPageInfo("tab-" + adminTabIndex, createAdministrationPanel(), adminTabIndex);
tabPanel.add(adminPanel, "Administration");
}
showFirstPage();
}
protected AdministrationPanel createAdministrationPanel() {
return new AdministrationPanel(this);
}
protected boolean showAdminTab(WUser user) {
for (Iterator itr = user.getPermissions().iterator(); itr.hasNext();) {
String s = (String)itr.next();
if (s.startsWith("MANAGE_")) return true;
}
return false;
}
protected void showFirstPage() {
// Show the initial screen.
String initToken = History.getToken();
if (initToken.length() > 0) {
onHistoryChanged(initToken);
} else {
tabPanel.selectTab(0);
browsePanel.onShow(Collections.EMPTY_LIST);
}
}
public void addPage(PageInfo info) {
history.put(info.getName(), info);
}
private void show(PageInfo page) {
SimplePanel p = (SimplePanel) tabPanel.getWidget(page.getTabIndex());
p.clear();
p.add(page.getInstance());
}
public void onHistoryChanged(String token) {
suppressTabHistory = true;
if ("".equals(token)) {
token = DEFAULT_PAGE;
}
if ("nohistory".equals(token) && curInfo != null)
{
suppressTabHistory = false;
return;
}
PageInfo page = getPageInfo(token);
List params = new ArrayList();
if (page == null) {
String[] split = token.split("_");
// hack to match "foo/*" style tokens
int slashIdx = token.lastIndexOf('_');
if (slashIdx != -1) {
page = getPageInfo(token.substring(0, slashIdx) + "_" + WILDCARD);
}
if (page == null) {
page = getPageInfo(split[0]);
}
if (split.length > 1) {
for (int i = 1; i < split.length; i++) {
params.add(split[i]);
}
}
}
// hide the previous page
if (curInfo != null) {
curInfo.getInstance().onHide();
}
if (page == null) {
// went to a page which isn't in our history anymore. go to the first page
if (curInfo == null) {
onHistoryChanged(DEFAULT_PAGE);
}
} else {
curInfo = page;
int idx = page.getTabIndex();
if (idx >= 0 && idx < tabPanel.getWidgetCount()) {
tabPanel.selectTab(page.getTabIndex());
}
show(page);
page.getInstance().onShow(params);
}
suppressTabHistory = false;
}
public PageInfo getPageInfo(String token) {
PageInfo page = (PageInfo) history.get(token);
return page;
}
public void setMessageAndGoto(String token, String message) {
PageInfo pi = getPageInfo(token);
ErrorPanel ep = (ErrorPanel) pi.getInstance();
History.newItem(token);
ep.setMessage(message);
}
public RegistryServiceAsync getRegistryService() {
return registryService;
}
public SecurityServiceAsync getSecurityService() {
return securityService;
}
public HeartbeatServiceAsync getHeartbeatService()
{
return this.heartbeatService;
}
public TabPanel getTabPanel() {
return tabPanel;
}
public boolean hasPermission(String perm) {
for (Iterator itr = user.getPermissions().iterator(); itr.hasNext();) {
String s = (String)itr.next();
if (s.startsWith(perm)) return true;
}
return false;
}
public int getAdminTab() {
return adminTabIndex;
}
public void addHistoryListener(String token, AbstractComposite composite) {
historyListeners.put(token, composite);
}
}
| [
"[email protected]"
] | |
c5f848971359eb3678fb7c82128aac649fec3a86 | 6e0c56a356ab6e286520224c99805833eb86a754 | /outbox-debezium-commons/src/main/java/com/bellotapps/outbox_debezium/commons/MessageFields.java | 967306567dff59349fbc14217c55925eed788bdf | [
"Apache-2.0"
] | permissive | github112017/outbox-debezium | bb2aa79b31fa5fe9b68f5c6872abebe098eaa9ba | ae19ec2664e060ecca7c99a4f6c3631f24c7993f | refs/heads/master | 2020-12-20T02:22:10.080946 | 2019-04-30T18:32:43 | 2019-04-30T18:32:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,385 | java | /*
* Copyright 2019 BellotApps
*
* 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.bellotapps.outbox_debezium.commons;
/**
* Class defining message's fields as constants.
*/
public class MessageFields {
/**
* The message's id field name.
*/
public static final String MESSAGE_ID = "id";
/**
* The message's sender field name.
*/
public static final String SENDER = "sender";
/**
* The message's recipient field name.
*/
public static final String RECIPIENT = "recipient";
/**
* The message's timestamp field name.
*/
public static final String TIMESTAMP = "timestamp";
/**
* The message's headers field name.
*/
public static final String HEADERS = "headers";
/**
* The message's id payload name.
*/
public static final String PAYLOAD = "payload";
}
| [
"[email protected]"
] | |
0f589300648ad21b6e22683eece61dc7a8d5709f | ae0a72aef69c4b876f8bf7754c18ae4b70511e79 | /arch-example-1/e1-api/src/main/java/org/github/hoorf/api/Common.java | d344b1f5a0d5c743949958eef4076fe2abe80002 | [] | no_license | hoorf/arch | 663f9e26bbd25617e832f26285cc842f49bb4f7e | 228edd27a8d8abd1691089d4d09a6ae68023f231 | refs/heads/master | 2023-06-27T05:36:22.092793 | 2021-07-30T05:43:51 | 2021-07-30T05:44:05 | 388,348,747 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 55 | java | package org.github.hoorf.api;
public class Common {
}
| [
"[email protected]"
] | |
1a0c9f155371a5ff0cd486bb66b0df5c2799280a | 35dffdf1d472344edbc0629ff74709beae5deb76 | /src/com/team7/yourturn/module/checkpoint/CheckpointPointer.java | 98e5e5a525db55a1eb0c6079cb5161a9976d7610 | [] | no_license | Wei-Changsha/java-homework | 9d5dc77d975b9d903f27d56e02da6ea1a2a68e51 | fda1e6867e7786eac8d85fb4558930fd74df55ef | refs/heads/master | 2020-09-29T16:53:17.927275 | 2019-12-10T01:33:11 | 2019-12-10T01:33:11 | 227,077,379 | 0 | 0 | null | 2019-12-10T09:24:05 | 2019-12-10T09:24:04 | null | UTF-8 | Java | false | false | 1,365 | java | package com.team7.yourturn.module.checkpoint;
import com.team7.yourturn.module.base.BaseViewModel;
import com.team7.yourturn.module.base.ItemComponent;
import java.awt.event.KeyEvent;
public class CheckpointPointer extends BaseViewModel {
private int POINT_TO_CHECKPOINT_ONE = 2101;
private int POINT_TO_CHECKPOINT_TWO = 2102;
private int POINT_TO_CHECKPOINT_THREE = 2103;
private int POINT_TO_CHECKPOINT_FOUR = 2104;
private int POINT_TO_CHECKPOINT_FIVE = 2105;
private int pointerState = POINT_TO_CHECKPOINT_ONE;
public CheckpointPointer() {
x = 300;
y = 700;
this.itemComponent = new ItemComponent("test.jpg",60,60);
itemComponent.setLocation(x, y);
}
public int HandleEvent(int eventCode) {
switch (eventCode) {
case KeyEvent.VK_LEFT:
case KeyEvent.VK_RIGHT:
return changePointer(eventCode);
case KeyEvent.VK_ENTER:
return PAGE_END;
default:
return NO_MEANING_EVENT;
}
}
public int changePointer(int eventCode) {
// TODO: 与 ModePointer 里面的 changePointer 一样,改变关卡选择指针状态,更改绘图,返回 EVENT_HANDLE_SUCCESS 消息
return 0;
}
public int getPointerState() {
return pointerState;
}
}
| [
"[email protected]"
] | |
2d568c394db5e167ecdfbf540d50f451318cad60 | c980de385dc091d4b350ffe9f387815895b9cf94 | /src/java/CartManager.java | a9748a8e26951fc2474900d448e888947a463dd8 | [] | no_license | DhananjayGupta300/Online-Shopping-Web-Application | 7891a9360d2e99f28dfaf365c9d52d985793b668 | 2e488900355cf2fc2f7dd20fd4788c5fe162b4ad | refs/heads/master | 2021-05-14T00:09:08.301654 | 2018-03-11T21:20:54 | 2018-03-11T21:20:54 | 116,535,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,105 | java | import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class CartManager extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String id=request.getParameter("id");
HttpSession session=request.getSession();
ArrayList list=(ArrayList)session.getAttribute("cart");
if(list==null){
list=new ArrayList();
}
list.add(id);
session.setAttribute("cart", list);
response.sendRedirect("ShowCategory");
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"[email protected]"
] | |
3207ba1c271fb1ed94912b88d12ae123a26bc9c7 | d49380b773c771eaa67a8bd5b351439877eaf885 | /src/main/java/org/patriques/output/technicalindicators/TRIMA.java | 41b4612de34e1c07b4448dc108ed6212b674b1d5 | [] | no_license | digital-thinking/acep | aa327b039826b2b03b5aee88468d54971e06b5d5 | aa97ec9458171db5a8c971dbaf6efdd4626739b0 | refs/heads/master | 2023-03-30T11:24:17.747490 | 2021-04-02T19:46:44 | 2021-04-02T19:54:14 | 325,895,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,997 | java | package org.patriques.output.technicalindicators;
import org.patriques.input.technicalindicators.Interval;
import org.patriques.output.AlphaVantageException;
import org.patriques.output.JsonParser;
import org.patriques.output.technicalindicators.data.IndicatorData;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Representation of triangular exponential moving average (TRIMA) response from api.
*
* @see TechnicalIndicatorResponse
*/
public class TRIMA extends TechnicalIndicatorResponse<IndicatorData> {
private TRIMA(final Map<String, String> metaData,
final List<IndicatorData> indicatorData) {
super(metaData, indicatorData);
}
/**
* Creates {@code TRIMA} instance from json.
*
* @param interval specifies how to interpret the date key to the data json object
* @param json string to parse
* @return TRIMA instance
*/
public static TRIMA from(Interval interval, String json) {
Parser parser = new Parser(interval);
return parser.parseJson(json);
}
/**
* Helper class for parsing json to {@code TRIMA}.
*
* @see TechnicalIndicatorParser
* @see JsonParser
*/
private static class Parser extends TechnicalIndicatorParser<TRIMA> {
public Parser(Interval interval) {
super(interval);
}
@Override
String getIndicatorKey() {
return "Technical Analysis: TRIMA";
}
@Override
TRIMA resolve(Map<String, String> metaData,
Map<String, Map<String, String>> indicatorData) throws AlphaVantageException {
List<IndicatorData> indicators = new ArrayList<>();
indicatorData.forEach((key, values) -> indicators.add(new IndicatorData(
resolveDate(key),
Double.parseDouble(values.get("TRIMA"))
)));
return new TRIMA(metaData, indicators);
}
}
}
| [
"[email protected]"
] | |
c1474e3b335fe4253f7e0edabbd1268e1480f363 | 8bc49ba05b0e250f80e4c1aa12e4fbb169983fd1 | /learn-note-springboot2-api-ftp/src/main/java/my/master/tool/FtpUtil.java | d13cd00b4cefcd692ac5ece2ef6efa9e0f1b6cb5 | [] | no_license | Steve133/learn-note-springboot2-api | e3a8fb2ccf9651990df09a4714c0e5e8548429c8 | ed5d82148f693f489ae0b055304f732e1585c611 | refs/heads/master | 2022-12-16T10:02:31.186375 | 2019-12-12T14:31:32 | 2019-12-12T14:31:32 | 226,079,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,488 | java | package my.master.tool;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
/**
* ftp上传下载工具类
* <p>Title: FtpUtil</p>
* <p>Description: </p>
* <p>Company: www.itcast.com</p>
* @author 入云龙
* @date 2015年7月29日下午8:11:51
* @version 1.0
*/
public class FtpUtil {
/**
* Description: 向FTP服务器上传文件
* @param host FTP服务器hostname
* @param port FTP服务器端口
* @param username FTP登录账号
* @param password FTP登录密码
* @param basePath FTP服务器基础目录
* @param filePath FTP服务器文件存放路径。例如分日期存放:/2015/01/01。文件的路径为basePath+filePath
* @param filename 上传到FTP服务器上的文件名
* @param input 输入流
* @return 成功返回true,否则返回false
*/
public static boolean uploadFile(String host, int port, String username, String password, String basePath,
String filePath, String filename, InputStream input) {
boolean result = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(host, port);// 连接FTP服务器
// 如果采用默认端口,可以使用ftp.connect(host)的方式直接连接FTP服务器
ftp.login(username, password);// 登录
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return result;
}
//切换到上传目录
if (!ftp.changeWorkingDirectory(basePath+filePath)) {
//如果目录不存在创建目录
String[] dirs = filePath.split("/");
String tempPath = basePath;
for (String dir : dirs) {
if (null == dir || "".equals(dir)) continue;
tempPath += "/" + dir;
if (!ftp.changeWorkingDirectory(tempPath)) {
if (!ftp.makeDirectory(tempPath)) {
return result;
} else {
ftp.changeWorkingDirectory(tempPath);
}
}
}
}
//设置上传文件的类型为二进制类型
ftp.setFileType(FTP.BINARY_FILE_TYPE);
//上传文件
if (!ftp.storeFile(filename, input)) {
return result;
}
input.close();
ftp.logout();
result = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return result;
}
/**
* Description: 从FTP服务器下载文件
* @param host FTP服务器hostname
* @param port FTP服务器端口
* @param username FTP登录账号
* @param password FTP登录密码
* @param remotePath FTP服务器上的相对路径
* @param fileName 要下载的文件名
* @param localPath 下载后保存到本地的路径
* @return
*/
public static boolean downloadFile(String host, int port, String username, String password, String remotePath,
String fileName, String localPath) {
boolean result = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(host, port);
// 如果采用默认端口,可以使用ftp.connect(host)的方式直接连接FTP服务器
ftp.login(username, password);// 登录
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return result;
}
ftp.changeWorkingDirectory(remotePath);// 转移到FTP服务器目录
FTPFile[] fs = ftp.listFiles();
for (FTPFile ff : fs) {
if (ff.getName().equals(fileName)) {
File localFile = new File(localPath + "/" + ff.getName());
OutputStream is = new FileOutputStream(localFile);
ftp.retrieveFile(ff.getName(), is);
is.close();
}
}
ftp.logout();
result = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return result;
}
public static void main(String[] args) {
try {
FileInputStream in=new FileInputStream(new File("D:\\bbb.lua"));
boolean flag = uploadFile("192.168.1.104", 22, "root", "alpine", "/","/", "bbb.lua", in);
System.out.println(flag);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.