blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 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 684M ⌀ | 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 132 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 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
737c35910dd2e8c239aa733c64315ace55cce426 | acb970cd1bcb764d702e62ed6a81940c18c99fb2 | /jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysConfig.java | 89d1ab68a89adff106d66f2446593314471b26c0 | [] | no_license | CFH-Steven/foreign-trade | 65742213cadea3da1914f8e1a84ec881004e230b | 63f9bd4c8720fbfc14ebbc5e7f31bd07e9bcba0f | refs/heads/master | 2023-01-01T06:01:20.170878 | 2020-10-26T01:35:56 | 2020-10-26T01:35:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,401 | java | package org.jeecg.modules.system.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Description: 系统配置
* @Author: jeecg-boot
* @Date: 2020-04-24
* @Version: V1.0
*/
@Data
@TableName("sys_config")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="sys_config对象", description="系统配置")
public class SysConfig {
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**配置类型*/
@Excel(name = "配置类型", width = 15)
@ApiModelProperty(value = "配置类型")
private java.lang.String configType;
/**类型值*/
@Excel(name = "类型值", width = 15)
@ApiModelProperty(value = "类型值")
private java.lang.String configValue;
/**创建人*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**修改人*/
@Excel(name = "修改人", width = 15)
@ApiModelProperty(value = "修改人")
private java.lang.String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.util.Date updateTime;
/**删除标识0-正常,1-已删除*/
@Excel(name = "删除标识0-正常,1-已删除", width = 15)
@ApiModelProperty(value = "删除标识0-正常,1-已删除")
private java.lang.Integer delFlag;
}
| [
"294780655@qq.com"
] | 294780655@qq.com |
7668736d948b26312e3a2c243ed611b8965930f0 | 99aebe902606f6e4e97f7bee4e4ad98891b22bfd | /mpos_test_tool/src/main/java/com/samilcts/mpaio/testtool/util/StateHandler.java | 4ec391fc518ea2d88a9042ba720fba3de5b6439b | [] | no_license | ksuh0805/kiosk | d6242ab0a3004c4b32df9c872addfa2c9dc7eb7f | 25e0e6236073da074f82f526a72648228f5067e9 | refs/heads/master | 2022-04-10T02:14:12.689639 | 2020-02-28T02:09:56 | 2020-02-28T02:09:56 | 243,659,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,655 | java | package com.samilcts.mpaio.testtool.util;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
import com.samilcts.media.State;
import com.samilcts.media.ble.BleState;
import com.samilcts.media.usb.UsbState;
import com.samilcts.mpaio.testtool.R;
import com.samilcts.sdk.mpaio.MpaioManager;
import com.samilcts.sdk.mpaio.ext.dialog.RxConnectionDialog;
import com.samilcts.util.android.Logger;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
/**
* Created by mskim on 2016-07-13.
* mskim@31cts.com
*/
public class StateHandler {
private static final String TAG = "StateHandler";
private final TextView mLabel;
private MaterialDialog mProgressDialog;
private RxConnectionDialog mConnectionDialog;
private final MpaioManager mConnectionManager;
private Activity mActivity;
private Subscription mSubscription;
private final Logger logger = AppTool.getLogger();
public StateHandler(Activity activity, MpaioManager connectionManager, TextView label) {
mActivity = activity;
mConnectionManager = connectionManager;
mLabel = label;
}
public void stopHandle() {
if(null != mSubscription ) {
mSubscription.unsubscribe();
mSubscription = null;
}
}
public void startHandle() {
mSubscription = mConnectionManager
.onStateChanged()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<State>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
logger.i(TAG, "onError : " + e.getMessage());
}
@Override
public void onNext(State state) {
boolean isBleState = state instanceof BleState;
String type = isBleState ? "BLE" : (state instanceof UsbState ? "USB" : "UART");
logger.i(TAG, "type : " + type);
switch (state.getValue()) {
case State.CONNECTING:
logger.i(TAG, "STATE_CONNECTING");
mProgressDialog = new MaterialDialog.Builder(mActivity)
.content(setConnectionStateText(type, R.string.connection_state_connecting))
.progress(true, 0)
.cancelable(false)
.show();
break;
case State.CONNECTED:
logger.i(TAG, "STATE_CONNECTED!");
setConnectionStateText(type, R.string.connection_state_connected);
mActivity.invalidateOptionsMenu();
setPacketSetting();
if (mProgressDialog != null) mProgressDialog.dismiss();
getConnectionDialog(mActivity).dismiss();
break;
case State.DISCONNECTED:
logger.i(TAG, "STATE_DISCONNECTED");
setConnectionStateText(type, R.string.connection_state_disconnected);
//ToastUtil.show(mActivity, "disconnected");
mActivity.invalidateOptionsMenu();
if (mProgressDialog != null)
mProgressDialog.dismiss();
if (!mConnectionManager.isConnected() && !mActivity.isFinishing()) {
if (!getConnectionDialog(mActivity).isShowing())
getConnectionDialog(mActivity).show();
}
break;
}
}
});
if ( mConnectionManager.isBleConnected()) {
setConnectionStateText("BLE", R.string.connection_state_connected);
} else if (mConnectionManager.isUsbConnected()) {
setConnectionStateText("USB", R.string.connection_state_connected);
} else if (mConnectionManager.isSerialConnected()) {
setConnectionStateText("UART", R.string.connection_state_connected);
} else {
setConnectionStateText("", R.string.connection_state_none);
}
}
synchronized public RxConnectionDialog getConnectionDialog(Context context) {
if ( null == mConnectionDialog )
mConnectionDialog = new RxConnectionDialog(context, mConnectionManager);
return mConnectionDialog;
}
private String setConnectionStateText(String type, final int resId) {
String msg = mActivity.getString(resId).replace("#1", type);
if (mLabel != null)
mLabel.setText(msg);
return msg;
}
private void setPacketSetting() {
int length = 256;
int interval = 0;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
//length = 100;
interval = 50;
}
mConnectionManager.setMaximumPacketLength(length);
mConnectionManager.setBleWriteInterval(interval);
}
}
| [
"kiltae.kang@tvlet.co.kr"
] | kiltae.kang@tvlet.co.kr |
3df09111251bb70085fb3ee84457fdd83c11113e | 477496d43be8b24a60ac1ccee12b3c887062cebd | /shirochapter16/src/main/java/com/haien/spring/SpringUtils.java | 3a4be49efc42c18635ba39445697908aea1922a9 | [] | no_license | Eliyser/my-shiro-example | e860ba7f5b2bb77a87b2b9ec77c46207a260b985 | 75dba475dc50530820d105da87ff8b031701e564 | refs/heads/master | 2020-05-20T23:45:31.231923 | 2019-05-09T14:06:04 | 2019-05-09T14:06:04 | 185,808,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,859 | java | package com.haien.spring;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
/**
* @Author haien
* @Description 从Spring上下文获取bean信息,被Functions类调用以获取bean注入其属性中
* @Date 2019/3/16
**/
public final class SpringUtils implements BeanFactoryPostProcessor {
private static ConfigurableListableBeanFactory beanFactory; // Spring应用上下文环境
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException {
SpringUtils.beanFactory = beanFactory;
}
/**
* 根据name获取bean实例
* @param name
* @return Object
* @throws org.springframework.beans.BeansException
*
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) throws BeansException {
return (T) beanFactory.getBean(name);
}
/**
* 获取类型为requiredType的bean对象
* @param clz
* @return
* @throws org.springframework.beans.BeansException
*
*/
public static <T> T getBean(Class<T> clz) throws BeansException {
@SuppressWarnings("unchecked")
T result = (T) beanFactory.getBean(clz);
return result;
}
/**
* 判断beanFactory是否包含名为name的bean实例,是则返回true
* @param name
* @return boolean
*/
public static boolean containsBean(String name) {
return beanFactory.containsBean(name);
}
/**
* 判断指定name的bean是一个singleton还是一个prototype(每申请一次重新new一个返回)。
* 若该bean不存在则抛异常(NoSuchBeanDefinitionException)
* @param name
* @return boolean
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*/
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
return beanFactory.isSingleton(name);
}
/**
* 获取指定name的bean的类型
* @param name
* @return Class 注册对象的类型
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*/
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
return beanFactory.getType(name);
}
/**
* 如果指定name的bean有别名,则返回这些别名
* @param name
* @return
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
return beanFactory.getAliases(name);
}
}
| [
"1410343862@qq.com"
] | 1410343862@qq.com |
4041d7b0b84f81a6cc0000e7640250793e60697a | db2ca48fffaf6689c9db439abaf9d98729548e0b | /zraapi/src/main/java/com/zrp/client/ItemDeliveryResource.java | 6921dd9fbe35784339b94f2d7611188b2cbe7e91 | [] | no_license | majinwen/sojourn | 46a950dbd64442e4ef333c512eb956be9faef50d | ab98247790b1951017fc7dd340e1941d5b76dc39 | refs/heads/master | 2020-03-22T07:07:05.299160 | 2018-03-18T13:45:23 | 2018-03-18T13:45:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 36,777 | java | package com.zrp.client;
import com.alibaba.fastjson.JSONObject;
import com.apollo.logproxy.slf4j.LoggerFactoryProxy;
import com.asura.framework.base.entity.DataTransferObject;
import com.asura.framework.base.util.JsonEntityTransform;
import com.asura.framework.base.util.RegExpUtil;
import com.asura.framework.utils.LogUtil;
import com.ziroom.minsu.services.basedata.api.inner.CityTemplateService;
import com.ziroom.minsu.services.basedata.entity.entityenum.ServiceLineEnum;
import com.ziroom.minsu.services.common.utils.DataFormat;
import com.ziroom.minsu.valenum.zrpenum.ContractTradingEnum;
import com.ziroom.zrp.houses.entity.CostStandardEntity;
import com.ziroom.zrp.houses.entity.RoomInfoEntity;
import com.ziroom.zrp.service.houses.api.ProjectService;
import com.ziroom.zrp.service.houses.api.RoomService;
import com.ziroom.zrp.service.houses.valenum.ItemTypeEnum;
import com.ziroom.zrp.service.houses.valenum.MeterTypeEnum;
import com.ziroom.zrp.service.houses.valenum.RoomTypeEnum;
import com.ziroom.zrp.service.trading.api.BindPhoneService;
import com.ziroom.zrp.service.trading.api.CallFinanceService;
import com.ziroom.zrp.service.trading.api.ItemDeliveryService;
import com.ziroom.zrp.service.trading.api.RentContractService;
import com.ziroom.zrp.service.trading.dto.ContractRoomDto;
import com.ziroom.zrp.service.trading.dto.SharerDto;
import com.ziroom.zrp.service.trading.dto.finance.ReceiptBillRequest;
import com.ziroom.zrp.service.trading.dto.finance.ReceiptBillResponse;
import com.ziroom.zrp.service.trading.valenum.CertTypeEnum;
import com.ziroom.zrp.service.trading.valenum.ContractStatusEnum;
import com.ziroom.zrp.service.trading.valenum.base.IsPayEnum;
import com.ziroom.zrp.service.trading.valenum.finance.CostCodeEnum;
import com.ziroom.zrp.service.trading.valenum.finance.DocumentTypeEnum;
import com.ziroom.zrp.service.trading.valenum.finance.VerificateStatusEnum;
import com.ziroom.zrp.trading.entity.*;
import com.zra.common.constant.BillMsgConstant;
import com.zra.common.constant.ContractMsgConstant;
import com.zra.common.enums.ErrorEnum;
import com.zra.common.enums.ItemDeliveryMsgEnum;
import com.zra.common.enums.RentTypeEunm;
import com.zra.common.result.ResponseDto;
import com.zra.common.utils.Check;
import com.zra.common.utils.DateTool;
import com.zra.common.utils.DateUtilFormate;
import com.zra.common.vo.base.*;
import com.zra.common.vo.delivery.CatalogItemVo;
import com.zra.common.vo.delivery.FeeHydropowerVo;
import com.zra.common.vo.delivery.PayFieldVo;
import com.zra.common.vo.perseon.SharerItemPersonVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.type.TypeReference;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>物业交割相关逻辑</p>
* <p>
* <PRE>
* <BR> 修改记录
* <BR>-----------------------------------------------
* <BR> 修改日期 修改人 修改内容
* </PRE>
*
* @author jixd
* @version 1.0
* @Date Created in 2017年09月14日 11:58
* @since 1.0
*/
@Component
@Path("/itemDelivery")
@Api(value = "itemDelivery",description = "物业交割")
public class ItemDeliveryResource {
private static final Logger LOGGER = LoggerFactoryProxy.getLogger(ItemDeliveryResource.class);
@Resource(name = "trading.rentContractService")
private RentContractService rentContractService;
@Resource(name = "basedata.cityTemplateService")
private CityTemplateService cityTemplateService;
@Resource(name = "trading.itemDeliveryService")
private ItemDeliveryService itemDeliveryService;
@Resource(name = "trading.callFinanceService")
private CallFinanceService callFinanceService;
@Resource(name = "houses.projectService")
private ProjectService projectService;
@Resource(name = "houses.roomService")
private RoomService roomService;
@Resource(name = "trading.bindPhoneService")
private BindPhoneService bindPhoneService;
@Value("#{'${PIC_PREFIX_URL}'.trim()}")
private String PIC_PREFIX_URL;
/**
* 物业交割主面板
* @author jixd
* @created 2017年09月14日 12:01:23
* @param
* @return
*/
@POST
@Path("/panle/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "panle",response = ResponseDto.class)
public ResponseDto panle(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【panle】参数contractId={}",contractId);
try {
if (Check.NuNStr(contractId)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
DataTransferObject contractDto = JsonEntityTransform.json2DataTransferObject(rentContractService.findContractBaseByContractId(contractId));
if (contractDto.getCode() == DataTransferObject.ERROR){
return ResponseDto.responseDtoFail(contractDto.getMsg());
}
RentContractEntity rentContractEntity = contractDto.parseData("rentContractEntity", new TypeReference<RentContractEntity>() {});
if (!ContractStatusEnum.YQY.getStatus().equals(rentContractEntity.getConStatusCode())){
return ResponseDto.responseDtoFail("合同状态错误");
}
DataTransferObject timeDto = JsonEntityTransform.json2DataTransferObject(cityTemplateService.getTextValueForCommon(ServiceLineEnum.ZRP.getCode(),ContractTradingEnum.ContractTradingEnum007.getValue()));
if (timeDto.getCode() == DataTransferObject.ERROR){
return ResponseDto.responseDtoFail(timeDto.getMsg());
}
//首次支付时间
Date firstPayTime = rentContractEntity.getFirstPayTime();
if (Check.NuNObj(firstPayTime)){
LogUtil.error(LOGGER,"【panle】支付时间为空");
return ResponseDto.responseDtoFail("支付时间为空");
}
String time = timeDto.parseData("textValue", new TypeReference<String>() {});
String tillTimeStr = DateUtilFormate.formatDateToString(DateTool.getDatePlusHours(firstPayTime, Integer.parseInt(time)), DateUtilFormate.DATEFORMAT_6);
String msg = String.format(ContractMsgConstant.DELIVERY_TIME_MSG, tillTimeStr);
DataTransferObject roomDto = JsonEntityTransform.json2DataTransferObject(roomService.getRoomByFid(rentContractEntity.getRoomId()));
if (roomDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【panle】查询房间信息错误={}",roomDto.toJsonString());
return ResponseDto.responseDtoFail(roomDto.getMsg());
}
RoomInfoEntity roomInfo = roomDto.parseData("roomInfo", new TypeReference<RoomInfoEntity>() {});
//是否支付完成
ReceiptBillRequest receiptBillRequest = new ReceiptBillRequest();
receiptBillRequest.setOutContractCode(rentContractEntity.getConRentCode());
receiptBillRequest.setDocumentType(DocumentTypeEnum.LIFE_FEE.getCode());
DataTransferObject billDto = JsonEntityTransform.json2DataTransferObject(callFinanceService.getReceivableBillInfo(JSONObject.toJSONString(receiptBillRequest)));
LogUtil.info(LOGGER,"【panle】账单查询结果result={}",billDto.toJsonString());
if (billDto.getCode() == DataTransferObject.ERROR){
LogUtil.info(LOGGER,"【panle】查询账单异常,result={}",billDto.toJsonString());
return ResponseDto.responseDtoFail(billDto.getMsg());
}
int isPay = (int)billDto.getData().get("isPay");
//部分付款按照未付款处理
isPay = (isPay == 2 ? 0:isPay);
List<BaseItemDescVo> panList = new ArrayList<>();
for (ItemDeliveryMsgEnum msgEnum : ItemDeliveryMsgEnum.values()){
if (msgEnum.getCode() == ItemDeliveryMsgEnum.SHFW.getCode()){
BaseItemDescColorVo baseItemDescColorVo = new BaseItemDescColorVo();
baseItemDescColorVo.setName(msgEnum.getName());
baseItemDescColorVo.setCode(msgEnum.getCode());
baseItemDescColorVo.setDesc(msgEnum.getDesc(isPay));
baseItemDescColorVo.setColor(msgEnum.getColor(isPay));
panList.add(baseItemDescColorVo);
continue;
}
if (msgEnum.getCode() == ItemDeliveryMsgEnum.HZXX.getCode() && roomInfo.getFtype() == RoomTypeEnum.BED.getCode()){
continue;
}
BaseItemDescVo baseItemVo = new BaseItemDescVo();
baseItemVo.setName(msgEnum.getName());
baseItemVo.setCode(msgEnum.getCode());
baseItemVo.setDesc(msgEnum.getDesc());
panList.add(baseItemVo);
}
//是否有合住人
int hasSharer = 1;
if (roomInfo.getFtype() == RoomTypeEnum.ROOM.getCode()){
DataTransferObject sharListDto = JsonEntityTransform.json2DataTransferObject(itemDeliveryService.listSharerByContractId(contractId));
if (sharListDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"查询合住人错误dto={}",sharListDto.toJsonString());
return ResponseDto.responseDtoFail(sharListDto.getMsg());
}
List<SharerEntity> sharerList = sharListDto.parseData("list", new TypeReference<List<SharerEntity>>() {});
if (Check.NuNCollection(sharerList)){
hasSharer = 0;
}
}else{
hasSharer = 0;
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("list",panList);
resultMap.put("tipMsg",msg);
resultMap.put("isPay",isPay);
resultMap.put("hasSharer",hasSharer);
LogUtil.info(LOGGER,"【panle】result={}",JsonEntityTransform.Object2Json(resultMap));
return ResponseDto.responseOK(resultMap);
}catch (Exception e){
LogUtil.info(LOGGER,"【panle】错误e={}",e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 合住人列表
* @author jixd
* @created 2017年09月21日 10:23:42
* @param
* @return
*/
@POST
@Path("/sharerList/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/sharerList",response = ResponseDto.class)
public ResponseDto sharerList(@FormParam("contractId") String contractId) {
LogUtil.info(LOGGER, "【sharerList】参数contractId={}", contractId);
if (Check.NuNStr(contractId)) {
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
DataTransferObject resultDto = JsonEntityTransform.json2DataTransferObject(itemDeliveryService.listSharerByContractId(contractId));
if (resultDto.getCode() == DataTransferObject.ERROR) {
return ResponseDto.responseDtoFail(resultDto.getMsg());
}
try {
List<SharerEntity> list = resultDto.parseData("list", new TypeReference<List<SharerEntity>>() {
});
List<SharerItemPersonVo> sharerList = new ArrayList<>();
for (SharerEntity sharerEntity : list) {
SharerItemPersonVo sharerItemPersonVo = new SharerItemPersonVo();
sharerItemPersonVo.setFid(sharerEntity.getFid());
sharerItemPersonVo.setName(sharerEntity.getFname());
BaseItemValueVo cardInfo = new BaseItemValueVo();
String fcerttype = sharerEntity.getFcerttype();
if (!Check.NuNStr(fcerttype)) {
cardInfo.setName(CertTypeEnum.getByCode(Integer.parseInt(fcerttype)).getName());
}
cardInfo.setValue(sharerEntity.getFcertnum());
cardInfo.setCode(Integer.parseInt(fcerttype));
sharerItemPersonVo.setCertInfo(cardInfo);
sharerItemPersonVo.setPhone(sharerEntity.getFmobile());
sharerList.add(sharerItemPersonVo);
}
List<BaseItemVo> certTypeList = new ArrayList<>();
for (CertTypeEnum certTypeEnum : CertTypeEnum.getSelectType()) {
BaseItemVo baseItemVo = new BaseItemVo();
baseItemVo.setCode(certTypeEnum.getCode());
baseItemVo.setName(certTypeEnum.getName());
certTypeList.add(baseItemVo);
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("sharerList", sharerList);
paramMap.put("certTypeList", certTypeList);
return ResponseDto.responseOK(paramMap);
} catch (Exception e) {
LogUtil.error(LOGGER, "【sharerList】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 保存或者更新合住人信息
* @author jixd
* @created 2017年09月21日 11:32:38
* @param
* @return
*/
@POST
@Path("/saveOrUpdateSharer/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/saveOrUpdateSharer",response = ResponseDto.class)
public ResponseDto saveOrUpdateSharer(@FormParam("fid") String fid,
@FormParam("contractId") String contractId,
@FormParam("name") String name,
@FormParam("certType") String certType,
@FormParam("certNo") String certNo,
@FormParam("phone") String phone){
SharerDto sharerDto = new SharerDto();
sharerDto.setFid(fid);
sharerDto.setContractId(contractId);
sharerDto.setName(name);
sharerDto.setCertType(certType);
sharerDto.setCertNo(certNo);
sharerDto.setPhone(phone);
LogUtil.info(LOGGER,"【saveOrUpdateSharer】入参param={}",JsonEntityTransform.Object2Json(sharerDto));
try{
if (Check.NuNStr(certNo)){
return ResponseDto.responseDtoFail("证件类型为空");
}
CertTypeEnum certTypeEnum = CertTypeEnum.getByCode(Integer.parseInt(certType));
if (Check.NuNObj(certTypeEnum)){
return ResponseDto.responseDtoFail("证件类型不支持");
}
if (Integer.parseInt(certType) == CertTypeEnum.CERTCARD.getCode()){
if (!RegExpUtil.idIdentifyCardNum(certNo)){
return ResponseDto.responseDtoFail("身份证格式错误");
}
}else{
if (!Check.NuNStr(certNo) && certNo.length() > 40){
return ResponseDto.responseDtoFail(certTypeEnum.getName()+"格式错误");
}
}
String resultJson = itemDeliveryService.saveOrUpdateSharer(JsonEntityTransform.Object2Json(sharerDto));
LogUtil.info(LOGGER,"返回结果={}",resultJson);
DataTransferObject resultDto = JsonEntityTransform.json2DataTransferObject(resultJson);
return ResponseDto.responseDtoForData(resultDto);
}catch (Exception e){
LogUtil.error(LOGGER, "【sharerList】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 删除合住人
* @author jixd
* @created 2017年09月21日 12:03:10
* @param
* @return
*/
@POST
@Path("/deleteSharer/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/deleteSharer",response = ResponseDto.class)
public ResponseDto deleteSharer(@FormParam("contractId") String contractId,@FormParam("fid") String fid){
LogUtil.info(LOGGER,"参数contractId={},fid={}",contractId,fid);
if (Check.NuNStr(contractId) || Check.NuNStr(fid)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
try{
return ResponseDto.responseDtoForData(JsonEntityTransform.json2DataTransferObject(itemDeliveryService.deleteSharerByFid(fid)));
}catch (Exception e){
LogUtil.error(LOGGER, "【deleteSharer】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 配置物品列表接口
* @author jixd
* @created 2017年09月21日 16:20:20
* @param
* @return
*/
@POST
@Path("/catalogItems/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/catalogItems",response = ResponseDto.class)
public ResponseDto catalogItems(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【catalogItems】contractId={}",contractId);
if (Check.NuNStr(contractId)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
try {
DataTransferObject contractDto = JsonEntityTransform.json2DataTransferObject(rentContractService.findContractBaseByContractId(contractId));
if (contractDto.getCode() == DataTransferObject.ERROR){
return ResponseDto.responseDtoFail(contractDto.getMsg());
}
RentContractEntity rentContractEntity = contractDto.parseData("rentContractEntity", new TypeReference<RentContractEntity>() {});
ContractRoomDto contractRoomDto = new ContractRoomDto();
contractRoomDto.setContractId(contractId);
contractRoomDto.setRoomId(rentContractEntity.getRoomId());
DataTransferObject itemDto = JsonEntityTransform.json2DataTransferObject(itemDeliveryService.listValidItemByContractIdAndRoomId(JsonEntityTransform.Object2Json(contractRoomDto)));
if (itemDto.getCode() == DataTransferObject.ERROR){
return ResponseDto.responseDtoFail(itemDto.getMsg());
}
List<RentItemDeliveryEntity> list = itemDto.parseData("list", new TypeReference<List<RentItemDeliveryEntity>>() {});
if (Check.NuNCollection(list)){
LogUtil.info(LOGGER,"【catalogItems】没有物品信息");
return ResponseDto.responseDtoFail("没有物品信息");
}
//分组统计
Map<String, List<RentItemDeliveryEntity>> mapItem = list.stream().collect(Collectors.groupingBy(RentItemDeliveryEntity::getItemType));
List<CatalogItemVo> resultList = new ArrayList<>();
for (Map.Entry<String,List<RentItemDeliveryEntity>> entry : mapItem.entrySet()){
CatalogItemVo catalogItemVo = new CatalogItemVo();
ItemTypeEnum itemTypeEnum = ItemTypeEnum.getByCode(Integer.parseInt(entry.getKey()));
catalogItemVo.setName(itemTypeEnum.getName());
List<RentItemDeliveryEntity> rentList = entry.getValue();
for (RentItemDeliveryEntity itemDeliveryEntity : rentList){
CatalogItemVo.ItemInfo itemInfo = catalogItemVo.new ItemInfo();
itemInfo.setName(itemDeliveryEntity.getItemname());
itemInfo.setPrice(String.format(ContractMsgConstant.DELIVERY_ITEM_MONEY_MSG,itemDeliveryEntity.getPrice()));
itemInfo.setNum(itemDeliveryEntity.getFactualnum());
catalogItemVo.getItems().add(itemInfo);
}
resultList.add(catalogItemVo);
}
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("catalogItems",resultList);
LogUtil.info(LOGGER,"【catalogItems】result={}",JsonEntityTransform.Object2Json(paramMap));
return ResponseDto.responseOK(paramMap);
}catch (Exception e){
LogUtil.error(LOGGER, "【catalogItems】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 生活费用项
* @author jixd
* @created 2017年09月25日 16:34:42
* @param
* @return
*/
@POST
@Path("/lifeFeeItems/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/lifeFeeItems",response = ResponseDto.class)
public ResponseDto lifeFeeItems(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【lifeFeeItems】contractId={}",contractId);
if (Check.NuNStr(contractId)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
try {
DataTransferObject contractDto = JsonEntityTransform.json2DataTransferObject(rentContractService.findContractBaseByContractId(contractId));
if (contractDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【lifeFeeItems】查询合同错误dto={}",contractDto.toJsonString());
return ResponseDto.responseDtoFail(contractDto.getMsg());
}
RentContractEntity rentContractEntity = contractDto.parseData("rentContractEntity", new TypeReference<RentContractEntity>() {});
String projectId = rentContractEntity.getProjectId();
DataTransferObject constDto = JsonEntityTransform.json2DataTransferObject(projectService.findCostStandardByProjectId(projectId));
if (constDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【lifeFeeItems】查询基础基础物品价格错误dto={}",constDto.toJsonString());
return ResponseDto.responseDtoFail(constDto.getMsg());
}
LogUtil.info(LOGGER,"【lifeFeeItems】查询基础基础物品价格={}",constDto.toJsonString());
FeeHydropowerVo waterVo = new FeeHydropowerVo();
waterVo.setName(MeterTypeEnum.WATER.getMachineName());
FeeHydropowerVo electricVo = new FeeHydropowerVo();
electricVo.setName(MeterTypeEnum.ELECTRICITY.getMachineName());
//填充单价数据
List<CostStandardEntity> costList = constDto.parseData("list", new TypeReference<List<CostStandardEntity>>() {});
List<PayFieldVo> feeList = new ArrayList<>();
//设置单价
for (CostStandardEntity costStandardEntity : costList){
if (costStandardEntity.getFmetertype().equals(String.valueOf(MeterTypeEnum.WATER.getCode()))){
String price = String.format(BillMsgConstant.RMB_CHINESE,costStandardEntity.getFprice());
waterVo.setUnit(String.format(ContractMsgConstant.DELIVERY_LIFEFEE_UNIT_MSG,price,MeterTypeEnum.WATER.getUnit()));
}
if (costStandardEntity.getFmetertype().equals(String.valueOf(MeterTypeEnum.ELECTRICITY.getCode()))){
String price = String.format(BillMsgConstant.RMB_CHINESE,costStandardEntity.getFprice());
electricVo.setUnit(String.format(ContractMsgConstant.DELIVERY_LIFEFEE_UNIT_MSG,price,MeterTypeEnum.ELECTRICITY.getUnit()));
}
}
feeList.add(0,waterVo);
feeList.add(1,electricVo);
//填充底表示数
ContractRoomDto contractRoomDto = new ContractRoomDto();
contractRoomDto.setContractId(contractId);
contractRoomDto.setRoomId(rentContractEntity.getRoomId());
DataTransferObject meterDetailDto = JsonEntityTransform.json2DataTransferObject(itemDeliveryService.findMeterDetailById(JsonEntityTransform.Object2Json(contractRoomDto)));
if (meterDetailDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【lifeFeeItems】底表示数获取错误dto={}",meterDetailDto.toJsonString());
return ResponseDto.responseDtoFail(meterDetailDto.getMsg());
}
LogUtil.info(LOGGER,"【lifeFeeItems】底表示数={}",meterDetailDto.toJsonString());
MeterDetailEntity meterDetail = meterDetailDto.parseData("meterDetail", new TypeReference<MeterDetailEntity>() {});
if (Check.NuNObj(meterDetail)){
LogUtil.info(LOGGER,"【lifeFeeItems】水电费未录入");
return ResponseDto.responseDtoFail("水电费未录入");
}
waterVo.setNumber(String.format(ContractMsgConstant.DELIVERY_LIFEFEE_NUMBER_MSG,meterDetail.getFwatermeternumber()));
waterVo.setPicUrl(PIC_PREFIX_URL + meterDetail.getFwatermeterpic());
electricVo.setNumber(String.format(ContractMsgConstant.DELIVERY_LIFEFEE_NUMBER_MSG,meterDetail.getFelectricmeternumber()));
electricVo.setPicUrl(PIC_PREFIX_URL +meterDetail.getFelectricmeterpic());
//填充财务相关支付数据
ReceiptBillRequest receiptBillRequest = new ReceiptBillRequest();
receiptBillRequest.setOutContractCode(rentContractEntity.getConRentCode());
receiptBillRequest.setDocumentType(DocumentTypeEnum.LIFE_FEE.getCode());
DataTransferObject billDto = JsonEntityTransform.json2DataTransferObject(callFinanceService.getReceivableBillInfo(JSONObject.toJSONString(receiptBillRequest)));
LogUtil.info(LOGGER,"【lifeFeeItems】财务生活费用查询结果={}",billDto.toJsonString());
if (billDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【lifeFeeItems】查询账单异常,result={}",billDto.toJsonString());
return ResponseDto.responseDtoFail(billDto.getMsg());
}
int payMoney = 0;
List<ReceiptBillResponse> listBill = billDto.parseData("listStr", new TypeReference<List<ReceiptBillResponse>>() {});
if (!Check.NuNCollection(listBill)){
for (ReceiptBillResponse receiptBillResponse : listBill){
int isPay = VerificateStatusEnum.DONE.getCode() == receiptBillResponse.getVerificateStatus() ? IsPayEnum.YES.getCode():IsPayEnum.NO.getCode();
if (receiptBillResponse.getCostCode().equals(CostCodeEnum.ZRYSF.getCode())){
waterVo.setValue(String.format(BillMsgConstant.RMB_CHINESE,DataFormat.formatHundredPrice(receiptBillResponse.getReceiptBillAmount())));
payMoney += (receiptBillResponse.getReceiptBillAmount() - receiptBillResponse.getReceivedBillAmount());
waterVo.setIsPay(isPay);
continue;
}
if (receiptBillResponse.getCostCode().equals(CostCodeEnum.ZRYDF.getCode())){
electricVo.setValue(String.format(BillMsgConstant.RMB_CHINESE,DataFormat.formatHundredPrice(receiptBillResponse.getReceiptBillAmount())));
payMoney += (receiptBillResponse.getReceiptBillAmount() - receiptBillResponse.getReceivedBillAmount());
electricVo.setIsPay(isPay);
continue;
}
CostCodeEnum costCodeEnum = CostCodeEnum.getByCode(receiptBillResponse.getCostCode());
if (!Check.NuNObj(costCodeEnum)){
PayFieldVo payFieldVo = new PayFieldVo();
payFieldVo.setName(costCodeEnum.getName());
payFieldVo.setValue(String.format(BillMsgConstant.RMB_CHINESE,DataFormat.formatHundredPrice(receiptBillResponse.getReceiptBillAmount())));
payFieldVo.setIsPay(isPay);
feeList.add(payFieldVo);
payMoney += (receiptBillResponse.getReceiptBillAmount() - receiptBillResponse.getReceivedBillAmount());
}
}
}
if (Check.NuNObj(waterVo.getValue())){
waterVo.setValue("0.0");
}
if (Check.NuNObj(electricVo.getValue())){
electricVo.setValue("0.0");
}
int isPay = (int)billDto.getData().get("isPay");
isPay = (isPay == 2 ? 0:isPay);
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("feeList",feeList);
resultMap.put("payMoney",payMoney);
resultMap.put("isPay",isPay);
LogUtil.info(LOGGER,"【lifeFeeItems】返回结果result={}",JsonEntityTransform.Object2Json(resultMap));
return ResponseDto.responseOK(resultMap);
}catch (Exception e){
LogUtil.error(LOGGER, "【lifeFeeItems】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 证件列表
* @author jixd
* @created 2017年10月20日 09:37:34
* @param
* @return
*/
@POST
@Path("/certTypeList/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/certTypeList",response = ResponseDto.class)
public ResponseDto certTypeList(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【certTypeList】contractId={}",contractId);
List<BaseItemVo> certTypeList = new ArrayList<>();
for (CertTypeEnum certTypeEnum : CertTypeEnum.getSelectType()) {
BaseItemVo baseItemVo = new BaseItemVo();
baseItemVo.setCode(certTypeEnum.getCode());
baseItemVo.setName(certTypeEnum.getName());
certTypeList.add(baseItemVo);
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("certTypeList", certTypeList);
return ResponseDto.responseOK(paramMap);
}
/**
* 确认物业交割
* @author jixd
* @created 2017年09月26日 13:47:21
* @param
* @return
*/
@POST
@Path("/confirmDelivery/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/confirmDelivery",response = ResponseDto.class)
public ResponseDto confirmDelivery(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【confirmDelivery】contractId={}",contractId);
if (Check.NuNStr(contractId)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
try {
DataTransferObject contractDto = JsonEntityTransform.json2DataTransferObject(rentContractService.findContractBaseByContractId(contractId));
if (contractDto.getCode() == DataTransferObject.ERROR){
return ResponseDto.responseDtoFail(contractDto.getMsg());
}
RentContractEntity rentContractEntity = contractDto.parseData("rentContractEntity", new TypeReference<RentContractEntity>() {});
//是否支付完成
ReceiptBillRequest receiptBillRequest = new ReceiptBillRequest();
receiptBillRequest.setOutContractCode(rentContractEntity.getConRentCode());
receiptBillRequest.setDocumentType(DocumentTypeEnum.LIFE_FEE.getCode());
DataTransferObject billDto = JsonEntityTransform.json2DataTransferObject(callFinanceService.getReceivableBillInfo(JSONObject.toJSONString(receiptBillRequest)));
LogUtil.info(LOGGER,"【confirmDelivery】账单查询结果result={}",billDto.toJsonString());
if (billDto.getCode() == DataTransferObject.ERROR){
LogUtil.info(LOGGER,"【confirmDelivery】查询账单异常,result={}",billDto.toJsonString());
return ResponseDto.responseDtoFail(billDto.getMsg());
}
int isPay = (int)billDto.getData().get("isPay");
if (isPay == 0){
return ResponseDto.responseDtoFail("您还有生活费用账单未支付完成");
}
String json = itemDeliveryService.confirmDelivery(contractId);
LogUtil.info(LOGGER,"更新结果result={}",json);
DataTransferObject dto = JsonEntityTransform.json2DataTransferObject(json);
return ResponseDto.responseDtoForData(dto);
}catch (Exception e){
LogUtil.error(LOGGER, "【confirmDelivery】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
/**
* 管家是否录入物业交割信息
* @author jixd
* @created 2017年11月05日 14:41:44
* @param
* @return
*/
@POST
@Path("/isEnterDelivery/v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@ApiOperation(value = "/isEnterDelivery",response = ResponseDto.class)
public ResponseDto isEnterDelivery(@FormParam("contractId") String contractId){
LogUtil.info(LOGGER,"【isEnterDelivery】contractId={}",contractId);
if (Check.NuNStr(contractId)){
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_PARAM_NULL);
}
try {
DataTransferObject contractDto = JsonEntityTransform.json2DataTransferObject(rentContractService.findContractBaseByContractId(contractId));
if (contractDto.getCode() == DataTransferObject.ERROR) {
return ResponseDto.responseDtoFail(contractDto.getMsg());
}
RentContractEntity rentContractEntity = contractDto.parseData("rentContractEntity", new TypeReference<RentContractEntity>() {});
String zoCode = rentContractEntity.getFhandlezocode();
ContractRoomDto contractRoomDto = new ContractRoomDto();
contractRoomDto.setContractId(contractId);
contractRoomDto.setRoomId(rentContractEntity.getRoomId());
DataTransferObject meterDetailDto = JsonEntityTransform.json2DataTransferObject(itemDeliveryService.findMeterDetailById(JsonEntityTransform.Object2Json(contractRoomDto)));
if (meterDetailDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【isEnterDelivery】底表示数获取错误dto={}",meterDetailDto.toJsonString());
return ResponseDto.responseDtoFail(meterDetailDto.getMsg());
}
LogUtil.info(LOGGER,"【isEnterDelivery】底表示数={}",meterDetailDto.toJsonString());
MeterDetailEntity meterDetail = meterDetailDto.parseData("meterDetail", new TypeReference<MeterDetailEntity>() {});
int isEnter = 0;
String telephoneNum = "";
if (!Check.NuNObj(meterDetail)){
isEnter = 1;
}
LogUtil.info(LOGGER,"【isEnterDelivery】管家编号={}",zoCode);
if (isEnter == 0){
String bindPhoneJson = bindPhoneService.findBindPhoneByEmployeeCode(rentContractEntity.getProjectId(),zoCode);
LogUtil.info(LOGGER,"查询结果",bindPhoneJson);
DataTransferObject bindPhoneDto = JsonEntityTransform.json2DataTransferObject(bindPhoneJson);
if (bindPhoneDto.getCode() == DataTransferObject.ERROR){
LogUtil.error(LOGGER,"【isEnterDelivery】查询400电话错误={}",bindPhoneDto.toJsonString());
return ResponseDto.responseDtoFail(bindPhoneDto.getMsg());
}
telephoneNum = bindPhoneDto.parseData("data", new TypeReference<String>() {});
if (Check.NuNStr(telephoneNum)){
return ResponseDto.responseDtoFail("未查询到管家联系电话");
}
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("isEnter",isEnter);
resultMap.put("telephoneNum",telephoneNum);
resultMap.put("msg",ContractMsgConstant.DELIVERY_CUSTOMER_TIP_CONTACT);
ResponseDto responseDto = ResponseDto.responseOK(resultMap);
LogUtil.info(LOGGER,"【isEnterDelivery】返回结果={}",JsonEntityTransform.Object2Json(responseDto));
return responseDto;
}catch (Exception e){
LogUtil.error(LOGGER, "【isEnterDelivery】异常e={}", e);
return ResponseDto.responseDtoErrorEnum(ErrorEnum.MSG_FAIL);
}
}
}
| [
"068411Lsp"
] | 068411Lsp |
aae3752132ecddd14b4be468595e65596c22ffe0 | 5b47e5d0e093bd8e4ff7ffd95cff4f3225dece3b | /src/OfficeHours/Practice_04_01_2020/StringMethods2.java | f8ae7a4713de08cca926215208381d72184cf515 | [] | no_license | nedimecalis/Spring2020B18_Java | 27aeb49e8f97d8ba2b9654eff4c07dc76f5791ac | d23ece52ee84406baaf14bf308902851d5277fc4 | refs/heads/master | 2022-05-25T22:53:10.744686 | 2020-04-29T20:33:28 | 2020-04-29T20:33:28 | 258,605,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | package OfficeHours.Practice_04_01_2020;
public class StringMethods2 {
public static void main(String[] args) {
//isEmpty(): checks if the String is empty, returns boolean
String str1 = " ";
boolean r1 = str1.isEmpty(); // false
boolean r2 = !str1.isEmpty(); // true
System.out.println(r1);
System.out.println(r2);
System.out.println("=======================================");
//equals(str): checks if the two strong of texts are equal or not, returns boolean
// equalsIgnoreCase(str): checks if the two strong of texts are equal or not(wihtout case sensitivity), returns boolean
// ==
String s1 = "cat";
String s2 = new String("cat");
String s3 = "Cat";
System.out.println(s1 == s2); // false
System.out.println( s1.equals(s2)); // true
System.out.println( s3.equals(s1) ); // false, case sensiytivity
System.out.println( s3.equalsIgnoreCase(s1) ); // true, ignores the case sensitivty
System.out.println("=======================================");
// contains(str): checks if the str is included in the string, returns boolean
String sentence = "I like to learn Java";
System.out.println( sentence.contains("Java") ); // true
String sentence2 = "Top 3 Viruses are: 1. Corona, 2. Hanta, 3. Ebola";
System.out.println( sentence2.contains("Java") ); // false
System.out.println("=======================================");
// startsWith(str): checks if the string started with given str
// endsWith(str): checks if the string ended with given str
String webAddress = "www.amazon.com";
System.out.println( webAddress.startsWith("www") ); // true
System.out.println( webAddress.startsWith("wwww") ); // false
String gmail ="CybertekSchool@gmail.com";
System.out.println( gmail.endsWith("@gmail.com") ); // true
System.out.println( gmail.endsWith("@hotmail.com") ); // false
System.out.println( gmail.endsWith("@coldmail.com") ); // false
}
} | [
"nedimecalis@gmail.com"
] | nedimecalis@gmail.com |
b11c441a208f0595abcdc6ec20ed33fdb67b3e1e | 78c85e52416b6b913d3af7fa0fa27781021aae6f | /QStarter_2/build/project/src/application/WeatherPage.java | 706a0ebcbf38921b506ca1f7c8297687cf53d93c | [] | no_license | wlee2/Weather-app-client | 3371882f5ffb141d5aa079ccfff9667aec9a35b7 | b92d59c95bc18397925afa3435ca67680e8ec91e | refs/heads/master | 2020-04-30T12:32:56.064126 | 2019-03-20T23:18:57 | 2019-03-20T23:18:57 | 176,829,452 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,487 | java | package application;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.Socket;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Border;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.BorderStroke;
import javafx.scene.layout.BorderStrokeStyle;
import javafx.scene.layout.BorderWidths;
import javafx.scene.layout.CornerRadii;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.util.Duration;
class WeatherPageMaintain extends Task<Object>{
BorderPane bp;
WDataArray wd;
public boolean threadLoop;
Socket socket;
ObjectInputStream is;
ObjectOutputStream os;
int WeatherNumber;
BorderPane infoPane;
public Date updatedTime;
String otherAddress;
WeatherPageMaintain(BorderPane root) {
this.otherAddress = "";
this.bp = root;
this.infoPane = new BorderPane();
this.infoPane.setBorder(new Border(new BorderStroke(Color.GRAY, BorderStrokeStyle.SOLID, new CornerRadii(5), new BorderWidths(1))));
wd = new WDataArray();
threadLoop = true;
this.WeatherNumber = 0;
updatedTime = new Date();
updateTimer();
mainWeather();
buildButton();
}
public int getStatus() {
int returnIndex = 0;
try {
File file = new File("resources/data/setting.txt");
if(file.exists()) {
BufferedReader br = new BufferedReader(new FileReader(file));
String line = "";
line = br.readLine();
int index = line.indexOf("=");
String option = line.substring(index+1);
line = br.readLine();
index = line.indexOf("=");
this.otherAddress = line.substring(index+1);
if(option.equals("0"))
returnIndex = 0;
else if(option.equals("1"))
returnIndex = 1;
else if(option.equals("2"))
returnIndex = 2;
else {
fixOption(0);
}
br.close();
}
} catch (Exception e){
System.out.println(e);
}
return returnIndex;
}
public void fixOption(int index) {
File file = new File("resources/data/setting.txt");
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
bw.write("option=" + index);
bw.newLine();
bw.write("otherAddress=0.0.0.0");
bw.close();
} catch(Exception e) {
System.out.println(e);
}
}
@Override
protected Void call() throws Exception {
// TODO Auto-generated method stub
int option = this.getStatus();
while(true) {
try {
if(option == 0)
socket = new Socket("my.woosenecac.com", 8750);
else if(option == 1)
socket = new Socket("192.168.2.15", 8750);
else
socket = new Socket(this.otherAddress, 8750);
is = new ObjectInputStream(socket.getInputStream());
os = new ObjectOutputStream(socket.getOutputStream());
//String str = "this user is connecting with you";
//os.writeObject(str);
while((wd = (WDataArray) is.readObject()) != null) {
for(WData temp : wd.dataList)
temp.Debug();
Platform.runLater(new Runnable() {
@Override
public void run() {
mainWeather();
updatedTime = new Date();
}
});
}
socket.close();
if(this.threadLoop == false)
break;
} catch (Exception e) {
System.out.println(e);
wd = new WDataArray();
Platform.runLater(new Runnable() {
@Override
public void run() {
mainWeather();
updatedTime = new Date();
}
});
}
try {
Thread.sleep(5 * 1000);
if(option == 0){
option = 1;
this.fixOption(1);
}
else {
option = 0;
this.fixOption(0);
}
} catch(Exception e) {
}
}
return null;
}
public void updateTimer() {
HBox hb = new HBox();
Text time = new Text();
Timeline clock = new Timeline(new KeyFrame(Duration.ZERO, e -> {
LocalDateTime now = LocalDateTime.now();
Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
Date date = Date.from(instant);
long diff = date.getTime() - updatedTime.getTime();
long secondD = 300 - TimeUnit.MILLISECONDS.toSeconds(diff);
time.setText("update: "+ secondD + " seconds left.");
}),
new KeyFrame(Duration.seconds(1))
);
clock.setCycleCount(Animation.INDEFINITE);
clock.play();
hb.getChildren().addAll(time);
time.setId("timer");
hb.setAlignment(Pos.CENTER);
hb.setPadding(new Insets(10, 50, 10, 0));
this.infoPane.setBottom(hb);
}
public void buildButton() {
Image next = new Image("file:resources/right-arrow.png");
Image nextPressed = new Image("file:resources/right-selected.png");
ImageView nextImg = new ImageView(next);
nextImg.setPreserveRatio(true);
nextImg.setFitHeight(35);
nextImg.setFitWidth(35);
nextImg.setOnMousePressed(new EventHandler<MouseEvent>() {
public void handle(MouseEvent evt) {
nextImg.setImage(nextPressed);
if(WeatherNumber < (wd.size() - 1)) {
WeatherNumber++;
mainWeather();
}
}
});
nextImg.setOnMouseReleased(new EventHandler<MouseEvent>() {
public void handle(MouseEvent evt) {
nextImg.setImage(next);
}
});
Image before = new Image(("file:resources/left-arrow.png"));
Image beforePressed = new Image(("file:resources/left-selected.png"));
ImageView beforeImg = new ImageView(before);
beforeImg.setPreserveRatio(true);
beforeImg.setFitHeight(35);
beforeImg.setFitWidth(35);
beforeImg.setOnMousePressed(new EventHandler<MouseEvent>() {
public void handle(MouseEvent evt) {
beforeImg.setImage(beforePressed);
if(WeatherNumber != 0) {
WeatherNumber--;
mainWeather();
}
}
});
beforeImg.setOnMouseReleased(new EventHandler<MouseEvent>() {
public void handle(MouseEvent evt) {
beforeImg.setImage(before);
}
});
VBox b1 = new VBox();
b1.getChildren().add(nextImg);
b1.setAlignment(Pos.TOP_CENTER);
b1.setPadding(new Insets(80, 10, 0, 10));
VBox b2 = new VBox();
b2.getChildren().add(beforeImg);
b2.setAlignment(Pos.TOP_CENTER);
b2.setPadding(new Insets(80, 10, 0, 10));
this.infoPane.setLeft(b2);
this.infoPane.setRight(b1);
}
public void mainWeather() {
try {
if(WeatherNumber >= (wd.size()))
WeatherNumber = wd.size() - 1;
HBox[] hb = new HBox[5];
VBox vb = new VBox(8);
Text city = new Text("Toronto , CA");
city.setId("contents");
Image image = new Image(("file:resources/" + wd.getCondition(WeatherNumber) + ".png"));
ImageView imageView = new ImageView(image);
imageView.setPreserveRatio(true);
imageView.setFitHeight(100);
imageView.setFitWidth(100);
Text condition = new Text("Condition: " + wd.getCondition(WeatherNumber));
condition.setId("contents");
Text description = new Text("Description: " + wd.getDescription(WeatherNumber));
description.setId("contents");
Text temp_max = new Text("Temp Max/Avg/Min: " + wd.getTemp_Max(WeatherNumber));
temp_max.setId("contents");
Text temp_avg = new Text("/ " + wd.getTemp(WeatherNumber));
temp_avg.setId("contents");
Text temp_min = new Text("/ " + wd.getTemp_Min(WeatherNumber));
temp_min.setId("contents");
Text date = new Text("Update date: " + wd.getDate(WeatherNumber));
date.setId("contents");
hb[0] = new HBox();
hb[0].getChildren().addAll(city);
hb[1] = new HBox();
hb[1].setSpacing(10);
if(image.isError()) {
hb[1].getChildren().addAll(condition);
}
else {
hb[1].getChildren().addAll(imageView);
}
hb[2] = new HBox();
hb[2].setSpacing(10);
hb[2].getChildren().addAll(description);
hb[3] = new HBox();
hb[3].setSpacing(10);
hb[3].getChildren().addAll(temp_max, temp_avg, temp_min);
hb[4] = new HBox();
hb[4].setSpacing(10);
hb[4].getChildren().addAll(date);
hb[4].setAlignment(Pos.CENTER);
hb[4].setPadding(new Insets(10, 50, 10, 0));
vb.getChildren().addAll(hb[0], hb[1], hb[2], hb[3]);
vb.setPadding(new Insets(10, 12, 15, 40));
vb.setAlignment(Pos.TOP_CENTER);
this.infoPane.setCenter(vb);
this.infoPane.setTop(hb[4]);
if(wd.getCondition(WeatherNumber) == null)
errControl();
} catch (Exception e) {
System.out.println(e);
}
}
public void errControl() {
HBox errBox = new HBox(10);
Text err = new Text("Error: " + wd.dataList.get(WeatherNumber).err);
err.setId("error");
errBox.getChildren().add(err);
errBox.setAlignment(Pos.CENTER);
errBox.setPadding(new Insets(10, 50, 10, 0));
this.infoPane.setTop(errBox);
}
public BorderPane getWeatherPane() {
return this.infoPane;
}
}
class WDataArray implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public ArrayList<WData> dataList;
WDataArray() {
dataList = new ArrayList<>();
this.dataList.add(new WData());
}
public void add(WData wd) {
this.dataList.add(wd);
}
public void Debug(int i) {
this.dataList.get(i).Debug();
}
public int size() {
return this.dataList.size();
}
public String getCondition(int i) {
return this.dataList.get(i).getCondition();
}
public String getDescription(int i) {
return this.dataList.get(i).getDescription();
}
public String getTemp(int i) {
return this.dataList.get(i).getTemp();
}
public String getTemp_Min(int i) {
return this.dataList.get(i).getTemp_Min();
}
public String getTemp_Max(int i) {
return this.dataList.get(i).getTemp_Max();
}
public String getDate(int i) {
return this.dataList.get(i).getDate();
}
}
class WData implements Serializable {
private static final long serialVersionUID = 1454313033318093811L;
String condition;
String description;
String temp_min;
String temp_normal;
String temp_max;
String date;
String err;
WData() {
this.condition = null;
this.description = null;
this.temp_min = null;
this.temp_normal = null;
this.temp_max = null;
this.date = null;
this.err = "Server is closed: Sorry, it can't be solved!";
}
public void Set(String condition, String description, String temp_max, String temp_min, String temp_normal, String date, String err) {
this.condition = condition;
this.description = description;
this.temp_max = temp_max;
this.temp_min = temp_min;
this.temp_normal = temp_normal;
this.date = date;
this.err = err;
}
public String getCondition() {
return this.condition;
}
public String getDescription() {
return this.description;
}
public String getTemp() {
return this.temp_normal;
}
public String getTemp_Min() {
return this.temp_min;
}
public String getTemp_Max() {
return this.temp_max;
}
public String getDate() {
return this.date;
}
public void Debug() {
System.out.println("Date: " + this.date);
System.out.println("Condition: " + this.condition);
System.out.println("Description: " + this.description);
System.out.println("Temp Max/Avg/Min: " + this.temp_max + " / " + this.temp_normal + " / " + this.temp_min);
}
}
| [
"stoneage95xp@gmail.com"
] | stoneage95xp@gmail.com |
38fa11038a5b543d4571919c50dadf147ad16bd2 | a4ab1627b509e924962667d8fe82aeb511ed0982 | /Offer/src/com/betel/offer/controller/OfferControllerMobile.java | 690e4bc81e013dea7d8e7ce3439f837ac35d2907 | [] | no_license | betels/offer | b134563f22f4fb2653fe1a0806b2a7d32221d27e | 5a930c536341412032e37a597044f23ef2e54922 | refs/heads/master | 2016-08-11T21:19:51.490383 | 2015-05-23T19:51:51 | 2015-05-23T19:51:51 | 36,139,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,702 | java | /**
* OfferControllerMobile.java
* java Servlet class for mobile view to read(select) and write(insert,create) offers
* version:
* date: 22/05/1015
* @author Betel Samson Tadesse
* x14117649
*
*
*/
package com.betel.offer.controller;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
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;
import javax.servlet.http.HttpSession;
import org.codehaus.jackson.map.ObjectMapper;
import com.betel.offer.data.DataManager;
import com.betel.offer.model.Coordinate;
import com.betel.offer.model.Offer;
import com.betel.offer.model.User;
@WebServlet("/publicOffers")
public class OfferControllerMobile extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("application/json; charset=utf-8");
response.setCharacterEncoding("utf-8");
StringBuilder sb = new StringBuilder();
BufferedReader br = request.getReader();
String str;
while ((str = br.readLine()) != null) {
sb.append(str);
}
ObjectMapper mapper = new ObjectMapper();
Coordinate coordinate = mapper.readValue(sb.toString(), Coordinate.class);
DataManager dataManager = new DataManager();
Map<String, Object> map = new HashMap<String, Object>();
List<Offer> offers = dataManager.getNearestOffers(coordinate);
map.put("results", offers);
String json = mapper.writeValueAsString(map);
PrintWriter out = response.getWriter();
out.println(json);
}
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
String mealIdString = request.getParameter("id");
Integer mealId = mealIdString != null ? Integer.parseInt(mealIdString): 0;
DataManager dataManager = new DataManager();
Offer offer = dataManager.getOffer(mealId);
Map<String, Object> map = new HashMap<>();
map.put("result", offer);
ObjectMapper mapper = new ObjectMapper();
//DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm a z");
//mapper.setDateFormat(df);
String json = mapper.writeValueAsString(map);
PrintWriter out = response.getWriter();
out.println(json);
}
/**
*
*/
private static final long serialVersionUID = 1L;
}
| [
"betel_samson@yahoo.com"
] | betel_samson@yahoo.com |
6b421eaaa92249242b40828b5e180caa05a65117 | 9fc727e8ddca46ea326da7d117bdba21af5bfd54 | /src/main/java/br/com/b2w/bit/planets/integration/ResultSW.java | acf9c1192f65f276ab630070bc390bd51b1eaee5 | [
"MIT"
] | permissive | matheosu/Planets | efd8cedccda0354cd6d61790d1581f0dc84372cf | b406d7c3390b8a949870e496064143007544c5e4 | refs/heads/master | 2021-01-24T10:04:53.525005 | 2018-03-01T02:08:07 | 2018-03-01T02:08:07 | 123,035,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 919 | java | package br.com.b2w.bit.planets.integration;
import java.io.Serializable;
import java.util.List;
public class ResultSW<Result> implements Serializable {
private static final long serialVersionUID = 3018206290692462813L;
private Long count;
private String next;
private String previous;
private List<Result> results;
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public String getNext() {
return next;
}
public void setNext(String next) {
this.next = next;
}
public String getPrevious() {
return previous;
}
public void setPrevious(String previous) {
this.previous = previous;
}
public List<Result> getResults() {
return results;
}
public void setResults(List<Result> results) {
this.results = results;
}
}
| [
"mthcastro@me.com"
] | mthcastro@me.com |
255ee62b466412b62de5bb9fdd29ed6724dcd346 | b77bf23ba60db5794445b8204317ed8b7388a2fd | /net/minecraft/client/renderer/entity/RenderPlayer.java | bdb2611fc377666b258e2ac200fbc05c7b721f49 | [] | no_license | SulfurClient/Sulfur | f41abb5335ae9617a629ced0cde4703ef7cc5f2c | e54efe14bb52d09752f9a38d7282f0d1cd81e469 | refs/heads/main | 2022-07-29T03:18:53.078298 | 2022-02-02T15:09:34 | 2022-02-02T15:09:34 | 426,418,356 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,450 | java | package net.minecraft.client.renderer.entity;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.layers.*;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.ResourceLocation;
public class RenderPlayer extends RendererLivingEntity {
private boolean field_177140_a;
// private static final String __OBFID = "CL_00001020";
public RenderPlayer(RenderManager p_i46102_1_) {
this(p_i46102_1_, false);
}
public RenderPlayer(RenderManager p_i46103_1_, boolean p_i46103_2_) {
super(p_i46103_1_, new ModelPlayer(0.0F, p_i46103_2_), 0.5F);
this.field_177140_a = p_i46103_2_;
this.addLayer(new LayerBipedArmor(this));
this.addLayer(new LayerHeldItem(this));
this.addLayer(new LayerArrow(this));
this.addLayer(new LayerDeadmau5Head(this));
this.addLayer(new LayerCape(this));
this.addLayer(new LayerCustomHead(this.func_177136_g().bipedHead));
}
public ModelPlayer func_177136_g() {
return (ModelPlayer) super.getMainModel();
}
public void func_180596_a(AbstractClientPlayer p_180596_1_, double p_180596_2_, double p_180596_4_, double p_180596_6_, float p_180596_8_, float p_180596_9_) {
if (!p_180596_1_.func_175144_cb() || this.renderManager.livingPlayer == p_180596_1_) {
double var10 = p_180596_4_;
if (p_180596_1_.isSneaking() && !(p_180596_1_ instanceof EntityPlayerSP)) {
var10 = p_180596_4_ - 0.125D;
}
this.func_177137_d(p_180596_1_);
super.doRender((EntityLivingBase) p_180596_1_, p_180596_2_, var10, p_180596_6_, p_180596_8_, p_180596_9_);
}
}
private void func_177137_d(AbstractClientPlayer p_177137_1_) {
ModelPlayer var2 = this.func_177136_g();
if (p_177137_1_.func_175149_v()) {
var2.func_178719_a(false);
var2.bipedHead.showModel = true;
var2.bipedHeadwear.showModel = true;
} else {
ItemStack var3 = p_177137_1_.inventory.getCurrentItem();
var2.func_178719_a(true);
var2.bipedHeadwear.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.HAT);
var2.field_178730_v.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.JACKET);
var2.field_178733_c.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.LEFT_PANTS_LEG);
var2.field_178731_d.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.RIGHT_PANTS_LEG);
var2.field_178734_a.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.LEFT_SLEEVE);
var2.field_178732_b.showModel = p_177137_1_.func_175148_a(EnumPlayerModelParts.RIGHT_SLEEVE);
var2.heldItemLeft = 0;
var2.aimedBow = false;
var2.isSneak = p_177137_1_.isSneaking();
if (var3 == null) {
var2.heldItemRight = 0;
} else {
var2.heldItemRight = 1;
if (p_177137_1_.getItemInUseCount() > 0 || (p_177137_1_ instanceof EntityPlayerSP && ((EntityPlayerSP) p_177137_1_).getBlocking())) {
EnumAction var4 = var3.getItemUseAction();
if (var4 == EnumAction.BLOCK) {
var2.heldItemRight = 3;
} else if (var4 == EnumAction.BOW) {
var2.aimedBow = true;
}
}
}
}
}
protected ResourceLocation func_180594_a(AbstractClientPlayer p_180594_1_) {
return p_180594_1_.getLocationSkin();
}
public void func_82422_c() {
GlStateManager.translate(0.0F, 0.1875F, 0.0F);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(AbstractClientPlayer p_77041_1_, float p_77041_2_) {
float var3 = 0.9375F;
GlStateManager.scale(var3, var3, var3);
}
protected void renderOffsetLivingLabel(AbstractClientPlayer p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) {
if (p_96449_10_ < 100.0D) {
Scoreboard var12 = p_96449_1_.getWorldScoreboard();
ScoreObjective var13 = var12.getObjectiveInDisplaySlot(2);
if (var13 != null) {
Score var14 = var12.getValueFromObjective(p_96449_1_.getName(), var13);
this.renderLivingLabel(p_96449_1_, var14.getScorePoints() + " " + var13.getDisplayName(), p_96449_2_, p_96449_4_, p_96449_6_, 64);
p_96449_4_ += (float) this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * p_96449_9_;
}
}
super.func_177069_a(p_96449_1_, p_96449_2_, p_96449_4_, p_96449_6_, p_96449_8_, p_96449_9_, p_96449_10_);
}
public void func_177138_b(AbstractClientPlayer p_177138_1_) {
float var2 = 1.0F;
GlStateManager.color(var2, var2, var2);
ModelPlayer var3 = this.func_177136_g();
this.func_177137_d(p_177138_1_);
var3.swingProgress = 0.0F;
var3.isSneak = false;
var3.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_177138_1_);
var3.func_178725_a();
}
public void func_177139_c(AbstractClientPlayer p_177139_1_) {
float var2 = 1.0F;
GlStateManager.color(var2, var2, var2);
ModelPlayer var3 = this.func_177136_g();
this.func_177137_d(p_177139_1_);
var3.isSneak = false;
var3.swingProgress = 0.0F;
var3.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_177139_1_);
var3.func_178726_b();
}
/**
* Sets a simple glTranslate on a LivingEntity.
*/
protected void renderLivingAt(AbstractClientPlayer p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
if (p_77039_1_.isEntityAlive() && p_77039_1_.isPlayerSleeping()) {
super.renderLivingAt(p_77039_1_, p_77039_2_ + (double) p_77039_1_.field_71079_bU, p_77039_4_ + (double) p_77039_1_.field_71082_cx, p_77039_6_ + (double) p_77039_1_.field_71089_bV);
} else {
super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
}
}
protected void func_180595_a(AbstractClientPlayer p_180595_1_, float p_180595_2_, float p_180595_3_, float p_180595_4_) {
if (p_180595_1_.isEntityAlive() && p_180595_1_.isPlayerSleeping()) {
GlStateManager.rotate(p_180595_1_.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.getDeathMaxRotation(p_180595_1_), 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(270.0F, 0.0F, 1.0F, 0.0F);
} else {
super.rotateCorpse(p_180595_1_, p_180595_2_, p_180595_3_, p_180595_4_);
}
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {
this.preRenderCallback((AbstractClientPlayer) p_77041_1_, p_77041_2_);
}
protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
this.func_180595_a((AbstractClientPlayer) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
}
/**
* Sets a simple glTranslate on a LivingEntity.
*/
protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
this.renderLivingAt((AbstractClientPlayer) p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
this.func_180596_a((AbstractClientPlayer) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
public ModelBase getMainModel() {
return this.func_177136_g();
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return this.func_180594_a((AbstractClientPlayer) p_110775_1_);
}
protected void func_177069_a(Entity p_177069_1_, double p_177069_2_, double p_177069_4_, double p_177069_6_, String p_177069_8_, float p_177069_9_, double p_177069_10_) {
this.renderOffsetLivingLabel((AbstractClientPlayer) p_177069_1_, p_177069_2_, p_177069_4_, p_177069_6_, p_177069_8_, p_177069_9_, p_177069_10_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
this.func_180596_a((AbstractClientPlayer) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}
| [
"45654930+Kansioo@users.noreply.github.com"
] | 45654930+Kansioo@users.noreply.github.com |
33bbe3cadea42f3c0cbd33e1f0535940e643f826 | 9f3112863d975c6cbcc5abeb4b443610f6052d6d | /model/TFonctionsDB.java | deaf374d7ebb66e620cda17f4b633751363142d8 | [] | no_license | Experts-unis/gotimer | ab7e52cff85829efac06aa85ac582e13f3857e7d | b387d4123c5dac868989e55300246e61fd414bda | refs/heads/master | 2021-01-19T23:47:04.233795 | 2017-04-20T11:56:22 | 2017-04-20T16:16:50 | 89,026,389 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 18,508 | java | /**
*
*/
package model;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import org.apache.logging.log4j.LogManager;
import controleur.ExceptionTraitementSQL;
/**
* @author test
*
*/
public class TFonctionsDB extends TableDB {
static org.apache.logging.log4j.Logger log = LogManager . getLogger ( TFonctionsDB.class );
private String queryDeleteProjet;
private PreparedStatement dbPrepDeleteProjet;
private PreparedStatement dbPrepArchive;
private String queryArchive;
private PreparedStatement dbPrepArchiveDuProjet;
private String queryArchiveDuProjet;
private PreparedStatement dbPrepUpdateReport;
private String queryReport;
private PreparedStatement dbPrepUpdateReportProjet;
private String queryReportProjet;
private PreparedStatement dbPrepComplexite;
private String queryComplexite;
private PreparedStatement dbPrepComplexiteSimple;
private String queryComplexiteSimple;
protected String queryUpdateSelection;
protected PreparedStatement dbPrepUpdateSelection;
int index=0;
/**
* @param nameTable
* @param nameID
* @param driver
* @throws ExceptionTraitementSQL
*/
public TFonctionsDB() throws ExceptionTraitementSQL {
super("TFONCTIONS","IDFONC");
log.traceEntry("TFonctionsModel()") ;
prepareDeleteProjet();
prepareArchive();
prepareArchiveDuProjet();
prepareReport() ;
prepareComplexite();
prepareComplexiteSimple();
prepareUpdateSelection();
log.traceExit("TFonctionsModel()") ;
}
public void prepareUpdateSelection() throws ExceptionTraitementSQL {
// Prépare requete modification
queryUpdateSelection="UPDATE TFONCTIONS SET FOCUSED = ? WHERE IDFONC=?";
this.dbPrepUpdateSelection = prepareQuery(queryUpdateSelection);
}
/* (non-Javadoc)
* @see model.TableModel#prepareUpdate()
*/
@Override
public void prepareUpdate() throws ExceptionTraitementSQL {
log.traceEntry("prepareUpdate()");
// Prépare la modification de tprojets.libelle.
// System.out.println("Appel de prepareUpdate dans TFonctionsModel");
queryUpdate="UPDATE TFONCTIONS SET LIBELLE = ?, IDCOMPLEXITE=?, ESTIMATION=?,IDPARETO=?,IDEISENHOWER=?, IDMOTIVATION=? WHERE IDFONC=?";
this.dbPrepUpdate = prepareQuery(queryUpdate);
log.traceExit("prepareUpdate()") ;
}
/**
* @throws ExceptionTraitementSQL
*
*/
private void prepareComplexiteSimple() throws ExceptionTraitementSQL {
log.traceEntry("prepareComplexiteSimple()");
//On crée l'objet avec la requête en paramètre
queryComplexiteSimple ="UPDATE TFONCTIONS SET IDCOMPLEXITE = ?, ESTIMATION= ? WHERE IDFONC=?";
this.dbPrepComplexiteSimple = prepareQuery(queryComplexiteSimple);
log.traceExit("prepareComplexiteSimple()") ;
}
public void prepareComplexite() throws ExceptionTraitementSQL {
log.traceEntry("prepareComplexite()");
// Prépare la modification de tprojets.libelle.
// System.out.println("Appel de prepareUpdate dans TFonctionsModel");
queryComplexite="UPDATE TFONCTIONS SET IDCOMPLEXITE=?, ESTIMATION=?,IDPARETO=?,IDEISENHOWER=?, IDMOTIVATION=? WHERE IDFONC=?";
this.dbPrepComplexite = prepareQuery(queryComplexite);
log.traceExit("prepareComplexite()") ;
}
/** Préparation d'une requete de type delete paramétrée pour suppression des fonctions d'un projet
* @throws ExceptionTraitementSQL
*/
private void prepareDeleteProjet() throws ExceptionTraitementSQL {
log.traceEntry("prepareDeleteProjet()");
//On crée l'objet avec la requête en paramètre
queryDeleteProjet ="DELETE FROM TFONCTIONS WHERE IDPROJET=?";
this.dbPrepDeleteProjet = prepareQuery(queryDeleteProjet);
log.traceExit("prepareDeleteProjet()") ;
}
/**
* @throws ExceptionTraitementSQL
*
*/
private void prepareReport() throws ExceptionTraitementSQL {
log.traceEntry("prepareReport()");
//On crée l'objet avec la requête en paramètre
queryReport ="UPDATE TFONCTIONS SET REPORT=?, FOCUSED=false, ARCHIVE=false WHERE IDFONC=?";
this.dbPrepUpdateReport = prepareQuery(queryReport);
queryReportProjet ="UPDATE TFONCTIONS SET REPORT=?, FOCUSED=false, ARCHIVE=false WHERE IDPROJET=?";
this.dbPrepUpdateReportProjet = prepareQuery(queryReportProjet);
log.traceExit("prepareReport()") ;
}
/**
* @throws ExceptionTraitementSQL
*
*/
private void prepareArchive() throws ExceptionTraitementSQL {
log.traceEntry("prepareArchive()");
//On crée l'objet avec la requête en paramètre
queryArchive ="UPDATE TFONCTIONS SET ARCHIVE=?, FOCUSED=false, REPORT=false WHERE IDFONC=?";
this.dbPrepArchive = prepareQuery(queryArchive);
log.traceExit("prepareArchive()") ;
}
/**
* @throws ExceptionTraitementSQL
*
*/
private void prepareArchiveDuProjet() throws ExceptionTraitementSQL {
log.traceEntry("prepareArchiveDuProjet()");
//On crée l'objet avec la requête en paramètre
queryArchiveDuProjet ="UPDATE TFONCTIONS SET ARCHIVE=?, FOCUSED=false, REPORT=false WHERE IDPROJET=?";
this.dbPrepArchiveDuProjet = prepareQuery(queryArchiveDuProjet);
log.traceExit("prepareArchiveDuProjet()") ;
}
/* (non-Javadoc)
* @see model.TableModel#prepareInsert()
*/
@Override
public void prepareInsert() throws ExceptionTraitementSQL {
log.traceEntry("prepareInsert()");
//On crée l'objet avec la requête en paramètre
// System.out.println("Appel de prepareInsert dans TFonctionModel");
queryInsert ="INSERT INTO TFONCTIONS "
+ "("
+ "IDFONC,LIBELLE,IDPROJET,"
+ "IDPARETO, IDEISENHOWER,IDCOMPLEXITE,"
+ "ESTIMATION,IDMOTIVATION, REPORT,"
+ "FOCUSED,ARCHIVE,IDDELEGUER) "
+ "values (?,?,?,?,?,?,?,?,false,false,false,null)";
this.dbPrepInsert = prepareQuery(queryInsert);
log.traceExit("prepareInsert()") ;
}
/**
* Charge la liste des fonctions avec les données de la base
* @param lesFonctionsDuProjets
* @param idProj
* @throws ExceptionTraitementSQL
*/
// public void getList(ListModelFonction lesFonctionsDuProjets, int idProj) throws ExceptionTraitementSQL {
//
// setQueryList("SELECT IDFONC,LIBELLE,SELECTED FROM TFONCTIONS WHERE ARCHIVE=false AND IDPROJET = " + Integer.toString(idProj) + " ORDER BY LIBELLE");
// lesFonctionsDuProjets.clear();
// setIndex(0);
// setList(lesFonctionsDuProjets);
// int size;
// loadListGenerique();
//
//
// }
//
// /* (non-Javadoc)
// * @see model.DBTable#initListObject()
// */
// @Override
// protected void initListObject() {
// // Rien à faire, déjà fait !
//
// }
/* (non-Javadoc)
* @see model.DBTable#addNewElement(java.sql.ResultSet)
*/
@Override
protected void addNewElementInAVectorList(ResultSet result) {
// index++
// lesFonctionsDuProjets.addElement(new DataInfoFonction(result.getInt("IDFONC"),result.getString("LIBELLE"),idProj,result.getBoolean("SELECTED"),getIndex()));
}
/**
* @return the index
*/
public int getIndex() {
return index;
}
/**
* @param index the index to set
*/
public void setIndex(int index) {
this.index = index;
}
/*
public void getList(ListModelFonction lesFonctionsDuProjets, int idProj) throws ExceptionTraitementSQL {
log.traceEntry("getList(ListModelFonction lesFonctionsDuProjets, int idProj = "+idProj+")") ;
//TODO A GENERALISER
ResultSet result =null;
String query ="SELECT IDFONC,LIBELLE,FOCUSED,IDPARETO,IDEISENHOWER,IDCOMPLEXITE,ESTIMATION FROM TFONCTIONS WHERE ARCHIVE=false AND REPORT=false AND IDDELEGUER IS NULL AND IDPROJET = " + Integer.toString(idProj) + " ORDER BY LIBELLE";
lesFonctionsDuProjets.clear();
int index=0;
int size;
//L'objet ResultSet contient le résultat de la requête SQL
try {
result = DB.dbStatement.executeQuery(query);
while(result.next()){
lesFonctionsDuProjets.addElement(
new DataInfoFonction(
result.getInt("IDFONC"),
result.getString("LIBELLE"),
idProj,
result.getBoolean("FOCUSED"),
result.getInt("IDPARETO"),
result.getInt("IDEISENHOWER"),
result.getInt("IDCOMPLEXITE"),
result.getDouble("ESTIMATION"),
index++));
}
size=lesFonctionsDuProjets.size();
} catch (SQLException e) {
log.fatal("Rq KO "+query);
log.fatal("printStackTrace " , e);
size=-1;
throw new ExceptionTraitementSQL(e,query);
}
log.traceExit("getList - size = " + size) ;
}
*/
protected Vector<DataInfoFonction> getList(int idProj, String query) throws ExceptionTraitementSQL {
log.traceEntry("Vector<DataInfoFonction> getList(int idProj="+idProj+")");
//TODO A GENERALISER AUSSI
Vector<DataInfoFonction> listeFonctions = new Vector<DataInfoFonction>();
ResultSet result =null;
int index=0;
//L'objet ResultSet contient le résultat de la requête SQL
try {
result = DB.dbStatement.executeQuery(query);
log.trace("getList : Rq OK " +query);
while(result.next()){
listeFonctions.add(
new DataInfoFonction(
result.getInt("IDFONC"),
result.getString("LIBELLE"),
idProj,
result.getBoolean("FOCUSED"),
result.getInt("IDPARETO"),
result.getInt("IDEISENHOWER"),
result.getInt("IDCOMPLEXITE"),
result.getDouble("ESTIMATION"),
result.getInt("IDMOTIVATION"),
index++));
}
log.traceExit("getList(int idProj) OK size = "+listeFonctions.size()) ;
return listeFonctions;
} catch (SQLException e) {
log.fatal("Rq KO "+query);
log.fatal("printStackTrace " , e);
log.traceExit("getList(int idProj) KO ") ;
throw new ExceptionTraitementSQL(e,query);
}
}
public Vector<DataInfoFonction> getList(int id) throws ExceptionTraitementSQL {
String query ="SELECT IDFONC,LIBELLE,FOCUSED,IDPARETO,IDEISENHOWER,IDCOMPLEXITE,ESTIMATION,IDMOTIVATION "
+ "FROM TFONCTIONS "
+ "WHERE ARCHIVE=false AND REPORT=false AND IDPROJET = " + Integer.toString(id)
+ " ORDER BY FOCUSED DESC, IDPARETO ASC, IDEISENHOWER ASC, IDMOTIVATION ASC, LIBELLE ASC";
return getList(id,query);
}
/**
* @param id
* @return
* @throws ExceptionTraitementSQL
*/
public Vector<DataInfoFonction> getListArchive(int id) throws ExceptionTraitementSQL {
String query ="SELECT IDFONC,LIBELLE,FOCUSED,IDPARETO,IDEISENHOWER,IDCOMPLEXITE,ESTIMATION,IDMOTIVATION "
+ "FROM TFONCTIONS "
+ "WHERE ARCHIVE=true AND IDPROJET = " + Integer.toString(id)
+ " ORDER BY LIBELLE ASC";
return getList(id,query);
}
/**
* @param id
* @return
* @throws ExceptionTraitementSQL
*/
public Vector<DataInfoFonction> getListReport(int id) throws ExceptionTraitementSQL {
String query ="SELECT IDFONC,LIBELLE,FOCUSED,IDPARETO,IDEISENHOWER,IDCOMPLEXITE,ESTIMATION,IDMOTIVATION "
+ "FROM TFONCTIONS "
+ "WHERE REPORT=true AND IDPROJET = " + Integer.toString(id)
+ " ORDER BY FOCUSED DESC, IDPARETO ASC, IDEISENHOWER ASC, LIBELLE ASC";
return getList(id,query);
}
/** Fonction suppression des fonctions d'un projet
* @param id
* @throws ExceptionTraitementSQL
*/
public void deleteProjet(int id) throws ExceptionTraitementSQL {
log.traceEntry("deleteProjet(int id="+id+")");
super.delete(dbPrepDeleteProjet, id);
log.traceExit("deleteProjet(int id)") ;
}
/**
* @param nameFonc : nom de la fonction
* @param idProj : reference du projet
* @return id de la fonction
* @throws ExceptionTraitementSQL
*/
public int add(String nameFonc,int idProj,int idpareto, int ideisenhower, int idcomplexite, double estimation,int idmotivation) throws ExceptionTraitementSQL {
log.traceEntry("add(String nameFonc="+nameFonc+",int idProj="+idProj+"int idpareto="+idpareto+", int ideisenhower="+ideisenhower+", int idcomplexite="+idcomplexite+", double estimation="+estimation+",int idmotivation="+idmotivation+")");
//TODO A Généraliser
//INSERT INTO TFONCTIONS (IDFONC,LIBELLE,IDPROJET,IDPARETO, IDEISENHOWER,IDCOMPLEXITE,ESTIMATION, REPORT,FOCUSED,ARCHIVE,IDDELEGUER) values (?,?,?,false,false,false,null)";
//Ajouter une référence de fonction dans la table TFONCTIONS
try
{
//On paramètre notre requête préparée
dbPrepInsert.setInt(1, this.getNextID());
dbPrepInsert.setString(2, nameFonc);
dbPrepInsert.setInt(3, idProj);
dbPrepInsert.setInt(4, idpareto);
dbPrepInsert.setInt(5, ideisenhower);
dbPrepInsert.setInt(6, idcomplexite);
dbPrepInsert.setDouble(7, estimation);
dbPrepInsert.setInt(8, idmotivation);
//On exécute
dbPrepInsert.executeUpdate();
int ret = getCurrentID();
log.traceExit("add(String nameFonc,int idProj) OK => id="+ret) ;
return ret;
} catch (SQLException e) {
log.fatal("Rq KO "+dbPrepInsert.toString());
log.fatal("printStackTrace " , e);
log.traceExit("add(String nameFonc,int idProj) KO ") ;
throw new ExceptionTraitementSQL(e,dbPrepInsert.toString());
}
}
/**
* @param id
* @param text
* @throws ExceptionTraitementSQL
*/
public void updateFonction(int id, String nameFonction,int idcomplexite, double estimation, int idpareto, int ideisenhower,int idmotivation) throws ExceptionTraitementSQL {
log.traceEntry("updateFonction(int id="+id+", String nameFonction="+nameFonction+",int idcomplexite="+idcomplexite+", "
+ "double estimation="+estimation+", int idpareto="+idpareto
+ ", int ideisenhower="+ideisenhower+",int idmotivation="+idmotivation+")");
try
{
//queryUpdate="UPDATE TFONCTIONS SET LIBELLE = ?, IDCOMPLEXITE=?, ESTIMATION=?,IDPARETO=?,IDEISENHOWER=? WHERE IDFONC=?";
//On paramètre notre requête préparée
dbPrepUpdate.setString(1, nameFonction);
dbPrepUpdate.setInt(2, idcomplexite);
dbPrepUpdate.setDouble(3, estimation);
dbPrepUpdate.setInt(4, idpareto);
dbPrepUpdate.setInt(5, ideisenhower);
dbPrepUpdate.setInt(6, idmotivation);
dbPrepUpdate.setInt(7, id);
//On exécute
dbPrepUpdate.executeUpdate();
// System.out.println("Rq sur tfonction OK "+dbPrepUpdate.toString() );
} catch (SQLException e) {
// System.out.println("Rq sur tfonction KO "+dbPrepUpdate.toString() );
log.fatal("Rq KO "+dbPrepUpdate.toString());
log.fatal("printStackTrace " , e);
throw new ExceptionTraitementSQL(e,dbPrepUpdate.toString());
}
log.traceExit("updateFonction()") ;
}
/**
* @param id
* @throws ExceptionTraitementSQL
*/
public void archiveFonction(int id,boolean value) throws ExceptionTraitementSQL {
log.traceEntry("archiveFonction(int id="+id+")");
updateBoolean(dbPrepArchive, id, value);
log.traceExit("archiveFonction()") ;
}
/**
* @param id
* @param value
* @throws ExceptionTraitementSQL
*/
public void archiveFonctionDuProjet(int id, boolean value) throws ExceptionTraitementSQL {
log.traceEntry("archiveFonctionDuProjet(int id="+id+")");
updateBoolean(dbPrepArchiveDuProjet, id, value);
log.traceExit("archiveFonctionDuProjet()") ;
}
/**
* @param id
* @param idComplexite
* @param estimation
* @throws ExceptionTraitementSQL
*/
public void updateComplexite(int id, int idComplexite, Double estimation,int idPareto,int idEisenhower,int idmotivation) throws ExceptionTraitementSQL {
log.traceEntry("updateComplexite(int id="+id+", int idComplexite="+idComplexite+", Double estimation="+estimation+", int idmotivation="+idmotivation+") ");
//"UPDATE TFONCTIONS SET IDCOMPLEXITE=?, ESTIMATION=?,IDPARETO=?,IDEISENHOWER=?, IDMOTIVATION=? WHERE IDFONC=?
try
{
//On paramètre notre requête préparée
int n=1;
dbPrepComplexite.setInt(n, idComplexite);
dbPrepComplexite.setDouble(++n, estimation);
dbPrepComplexite.setInt(++n, idPareto);
dbPrepComplexite.setInt(++n, idEisenhower);
dbPrepComplexite.setInt(++n, idmotivation);
dbPrepComplexite.setInt(++n, id);
//On exécute
dbPrepComplexite.executeUpdate();
} catch (SQLException e) {
// System.out.println("Rq sur tfonction KO "+dbPrepDelete.toString() );
log.fatal("Rq KO "+dbPrepComplexite.toString());
log.fatal("printStackTrace " , e);
throw new ExceptionTraitementSQL(e,dbPrepComplexite.toString());
}
log.traceExit("updateComplexite()") ;
}
public void updateComplexiteSimple(int id, int idComplexite, Double estimation) throws ExceptionTraitementSQL {
log.traceEntry("updateComplexiteSimple(int id="+id+", int idComplexite="+idComplexite+", Double estimation="+estimation+") ");
//"UPDATE TFONCTIONS SET COMPLEXITE = ?, ESTIMATION= ? WHERE IDFONC=?"
try
{
//On paramètre notre requête préparée
int n=1;
dbPrepComplexiteSimple.setInt(n, idComplexite);
dbPrepComplexiteSimple.setDouble(++n, estimation);
dbPrepComplexiteSimple.setInt(++n, id);
//On exécute
dbPrepComplexiteSimple.executeUpdate();
} catch (SQLException e) {
// System.out.println("Rq sur tfonction KO "+dbPrepDelete.toString() );
log.fatal("Rq KO "+dbPrepComplexiteSimple.toString());
log.fatal("printStackTrace " , e);
throw new ExceptionTraitementSQL(e,dbPrepComplexiteSimple.toString());
}
log.traceExit("updateComplexiteSimple()") ;
}
/* (non-Javadoc)
* @see model.DBTable#initListObject()
*/
@Override
protected void initListObject() {
// Pas utilisé
}
/**
* @param id
* @param b
* @throws ExceptionTraitementSQL
*/
public void updateSelectionByDefault(int id, boolean value) throws ExceptionTraitementSQL {
log.traceEntry("updateSelectionByDefault(int id="+id+", boolean value="+value+")");
updateBoolean(dbPrepUpdateSelection, id, value);
log.traceExit("updateSelectionByDefault()");
}
/**
* @param id
* @param b
* @throws ExceptionTraitementSQL
*/
public void updateReport(int id, boolean value) throws ExceptionTraitementSQL {
log.traceEntry("updateReport(int id="+id+", boolean value="+value+")");
updateBoolean(dbPrepUpdateReport, id, value);
log.traceExit("updateReport()");
}
/** Reporter toutes les fonctions du projet
* @param id
* @param value
* @throws ExceptionTraitementSQL
*/
public void updateReportProjet(int id, boolean value) throws ExceptionTraitementSQL {
log.traceEntry("updateReportProjet(int id="+id+", boolean value="+value+")");
updateBoolean(dbPrepUpdateReportProjet, id, value);
log.traceExit("updateReportProjet()");
}
}
| [
"agarciadutaitre@gmail.com"
] | agarciadutaitre@gmail.com |
61f72dcbb708bce5daf4113973032a70d75a8dd0 | d2cb1f4f186238ed3075c2748552e9325763a1cb | /methods_all/nonstatic_methods/javax_swing_JTextArea_getBounds.java | ad3ca707157cb1d7f714779fe6583df30cea0101 | [] | no_license | Adabot1/data | 9e5c64021261bf181b51b4141aab2e2877b9054a | 352b77eaebd8efdb4d343b642c71cdbfec35054e | refs/heads/master | 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | class javax_swing_JTextArea_getBounds{ public static void function() {javax.swing.JTextArea obj = new javax.swing.JTextArea();obj.getBounds();}} | [
"peter2008.ok@163.com"
] | peter2008.ok@163.com |
f2a0235e2d4e5eb75a645c07d1fc052bd38901b0 | e264b382461679b58239a8cbff34c3fca9bc5dc1 | /listpopupwindow/src/lecho/sample/listpopupwindow/MainActivity.java | 1d3440c59dd932ab92e9332ae4aca0f2b8b6b51d | [] | no_license | lecho/android_samples | 443fcdb809865bd6aaaedd9a47b1267bc59d694d | f1859a0bfc6a21986127e94e66a685b989a8a0c7 | refs/heads/master | 2021-01-10T09:17:31.434241 | 2015-08-30T19:28:23 | 2015-08-30T19:28:23 | 8,381,590 | 16 | 9 | null | null | null | null | UTF-8 | Java | false | false | 1,979 | java | package lecho.sample.listpopupwindow;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
private static final String[] STRINGS = { "Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option", "Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option","Option1",
"Option2", "Option3", "Option"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPopup(v);
}
});
}
private void showPopup(View anchorView) {
final ListPopupWindow popup = new ListPopupWindow(this);
popup.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, STRINGS));
popup.setAnchorView(anchorView);
popup.setWidth(ListPopupWindow.WRAP_CONTENT);
popup.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(MainActivity.this, "Clicked item " + position,
Toast.LENGTH_SHORT).show();
popup.dismiss();
}
});
popup.show();
}
@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;
}
}
| [
"leszekwach@gmail.com"
] | leszekwach@gmail.com |
e7f8716e2da3f30aca81193186083b256309aee3 | 9be7bd85b859c94ac900345eb4055e577873e891 | /eclipseWorkspace/Classes/src/com/qa/OOP/RockHopper.java | 8217a6a2465ced46863476a7ec2da98a23ae131e | [] | no_license | mltomlins0n/QAC | f4e8f2e2d9b405f1f602d8031cffe0c7a61076ce | 0819e460b3c309c73bd89a804d5e3a3a077914e4 | refs/heads/main | 2023-04-03T20:21:44.176924 | 2021-04-20T18:29:06 | 2021-04-20T18:29:06 | 202,366,868 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.qa.OOP;
public class RockHopper extends Penguin {
public String hopping;
public RockHopper(String fluffiness, String hopping) {
super(fluffiness);
this.hopping = hopping;
}
}
| [
"martin070891@gmail.com"
] | martin070891@gmail.com |
c0ea51a0a58a7da84f4c4532576e07d439898e8a | c442e7a7b53eba1835820b4dbe6cab1361eb6a20 | /src/main/java/com/cqshop/service/ParameterService.java | ed20cce4988089e5aabf9aefd1effd99d3e39ab7 | [] | no_license | gbagony-zyxy/cqshop | 99cca0e823047bbf3a17218cb126973bccd4ff03 | 4d746c70d0ba15467bb3f2faf9a0f1ae57a05fa7 | refs/heads/master | 2021-01-12T11:56:12.100259 | 2016-09-22T11:39:27 | 2016-09-22T11:39:27 | 68,842,768 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 200 | java | /*
*
*
*
*/
package com.cqshop.service;
import com.cqshop.entity.Parameter;
/**
* Service - 参数
*
*
*
*/
public interface ParameterService extends BaseService<Parameter, Long> {
} | [
"ruyinvaq@gmail.com"
] | ruyinvaq@gmail.com |
7319451e723d09d2b17c9cb53e1fe20f8f7d5190 | 63e316e743974fc1f18f0cb87e2023e10df29872 | /app/src/main/java/com/takethecorner/kluz/Article.java | fe5fdd7c2b7a94a2e66c067f821bc63b66a18a6f | [] | no_license | kluz116/takethecornerApp | aee704e7def70527884bad652c28087f1943de71 | ac317fe10efbdfe51a9df229bd199b81db5b0d09 | refs/heads/master | 2020-12-30T15:41:34.152606 | 2017-05-13T08:48:40 | 2017-05-13T08:48:40 | 91,161,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,571 | java | package com.takethecorner.kluz;
import java.io.Serializable;
/**
* Created by com.takethecorner.kluz Musembya on 18/05/16.
*/
public class Article implements Serializable {
private int id;
private String title;
private String author;
private String thumbnail;
private String articles;
private String date_created;
public Article() {
}
public Article(int id, String title, String author, String thumbnail, String articles, String date_created) {
this.id = id;
this.title = title;
this.author = author;
this.thumbnail = thumbnail;
this.articles = articles;
this.date_created = date_created;
}
public int getId(){
return id;
}
public void setId(int id){
this.id = id;
}
public String getTitle() {
return title;
}
public void setSetTitle(String name) {
this.title = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String numOfSongs) {
this.author = numOfSongs;
}
public String getThumbnail() {
return thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public String getArticlel() {
return articles;
}
public void setArtcile(String articles) {
this.articles = articles;
}
public String getDateCreated() {
return date_created;
}
public void setDate_created(String date_created) {
this.date_created = date_created;
}
}
| [
"engallanmusembya.com"
] | engallanmusembya.com |
7d222d9e4d7f8a9b4af29acd53c68b80dea5023c | 517e16473e1319bccfd99689de7ad4442e4ac8c3 | /Survey_3_Public/src/main/java/com/atguigu/survey/e/RemoveAuthFailedException.java | 6e572557a9133005de087f33d947a8fc1bedcd1c | [] | no_license | jing-312/survey | a56f5aa2668e63a977fe9711c32c279d33e4b9a3 | d45acb870799a624afe23f31fb98e9bba0cfcc70 | refs/heads/master | 2021-01-24T07:30:03.058342 | 2017-06-16T01:36:35 | 2017-06-16T01:36:35 | 93,350,401 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.atguigu.survey.e;
public class RemoveAuthFailedException extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = 1L;
public RemoveAuthFailedException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
}
| [
"15104213558@163.com"
] | 15104213558@163.com |
9a5cbc3143e176a3274d394817dbe0b6063e88f0 | a7203451d2082cb0caa85361c32009440267de3c | /Crawler/src/edu/upenn/cis455/client/HttpException.java | d23da17e05420d4a475efa4113263c356dd8c1e4 | [] | no_license | p4nd3mic/MiniGoogle | 4f74270dea5c2b1ebb0f5e41f06b0e1b43c59a04 | b9c423574931085b6531056b9ab7cf924d718d3a | refs/heads/master | 2016-09-16T04:30:26.431088 | 2015-09-16T21:17:48 | 2015-09-16T21:17:48 | 29,609,924 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | package edu.upenn.cis455.client;
/**
* Exception when something wrong with socket conneciton
* @author Ziyi Yang
*
*/
public class HttpException extends Exception {
/**
*
*/
private static final long serialVersionUID = -6528627404400412094L;
public HttpException() {
super();
}
public HttpException(String message) {
super(message);
}
public HttpException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public HttpException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
}
| [
"cis455@vm.(none)"
] | cis455@vm.(none) |
2576bce0f3ca7ed0c64d6200668506605f3940fe | ea498659ab22013e4789b169a2372700e11b9509 | /src/main/java/ar/edu/unlam/tallerweb1/servicios/ServicioUsuarioComicImpl.java | f93cdd18dff1f98c122d01b62f7630b9d56c8772 | [] | no_license | vegitojor/jarvis | 5db394cfc6b64fdf0a6e75afcfe5558e86a6eb5e | 66c42e3546c6f7f0ee5a7216d6c4ddf84a61e6bd | refs/heads/master | 2021-01-20T13:22:51.288804 | 2017-07-14T19:31:51 | 2017-07-14T19:31:51 | 90,483,089 | 1 | 0 | null | 2017-07-05T16:52:41 | 2017-05-06T18:29:13 | Java | UTF-8 | Java | false | false | 1,924 | java | package ar.edu.unlam.tallerweb1.servicios;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ar.edu.unlam.tallerweb1.dao.ComicDao;
import ar.edu.unlam.tallerweb1.dao.UsuarioComicDao;
import ar.edu.unlam.tallerweb1.dao.UsuarioDao;
import ar.edu.unlam.tallerweb1.modelo.UsuarioComic;
@Service("servicioUsuarioComic")
@Transactional
public class ServicioUsuarioComicImpl implements ServicioUsuarioComic {
@Inject
private ComicDao comicDao;
@Inject
private UsuarioDao usuarioDao;
@Inject
private UsuarioComicDao usuarioComicDao;
@Override
public UsuarioComic guardarUsuarioComic(Long idUsuario, Long idComic, Boolean siguiendoActualmente) {
Date fechaRegistroDate = new Date();
UsuarioComic usuarioComic = null;
UsuarioComic usuarioComicExistente = usuarioComicDao.consultarUsuarioComic(idUsuario, idComic);
if ( usuarioComicExistente != null ) {
usuarioComic = usuarioComicExistente;
} else {
usuarioComic = new UsuarioComic();
usuarioComic.setUsuario(usuarioDao.obtenerUsuarioPorId(idUsuario));
usuarioComic.setComic(comicDao.buscarComic(idComic));
}
usuarioComic.setSiguiendoActualmente(siguiendoActualmente);
usuarioComic.setFechaRegistro( new Timestamp(fechaRegistroDate.getTime()) );
if ( usuarioComic.getId()!=null ) {
usuarioComicDao.guardarUsuarioComic(usuarioComic);
} else {
usuarioComicDao.guardarNuevoUsuarioComic(usuarioComic);
}
return usuarioComic;
}
@Override
public List<UsuarioComic> listarUsuarioComics(Long idUsuario) {
return usuarioComicDao.listarUsuarioComicsSiguiendoActualmente(idUsuario);
}
@Override
public UsuarioComic consultarUsuarioComic(Long idUsuario, Long idComic) {
return usuarioComicDao.consultarUsuarioComic(idUsuario, idComic);
}
} | [
"santiagoeleiva@gmail.com"
] | santiagoeleiva@gmail.com |
157c6a747561d69654077c826d36f0de2fc6b92c | 5c86661dfbbd3f03e739bedcaace460c5d7d861f | /src/Games/Random.java | 6b20d2e389980f38320ece5ae94799da14e731af | [] | no_license | bkim82/FreshEndProject | 2266c69cf403b9f58c107c2d5bd668ebf31c7a14 | 83b0c9a8b5e5bced5b6ffca58aa9a727e22c979b | refs/heads/master | 2020-09-27T00:43:40.942270 | 2019-06-13T14:00:44 | 2019-06-13T14:00:44 | 226,380,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java | package Games;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.Group;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;
import javafx.animation.AnimationTimer;
// Animation of Earth rotating around the sun. (Hello, world!)
public class Random extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage theStage) {
theStage.setTitle("AnimationTimer Example");
Group root = new Group();
Scene theScene = new Scene(root);
theStage.setScene(theScene);
Canvas canvas = new Canvas(512, 512);
root.getChildren().add(canvas);
GraphicsContext gc = canvas.getGraphicsContext2D();
Image earth = new Image("earth.jpg");
Image sun = new Image("regular_box.gif");
Image space = new Image("simon2.png");
final long startNanoTime = System.nanoTime();
new AnimationTimer() {
public void handle(long currentNanoTime) {
double t = (currentNanoTime - startNanoTime) / 1000000000.0;
double x = 232 + 128 * Math.cos(t);
double y = 232 + 128 * Math.sin(t);
// Clear the canvas
gc.clearRect(0, 0, 512, 512);
// background image clears canvas
gc.drawImage(space, 0, 0);
gc.drawImage(earth, x, y);
gc.drawImage(sun, 196, 196);
}
}.start();
theStage.show();
}
}
| [
"brandonkim0802@gmail.com"
] | brandonkim0802@gmail.com |
0563f14ba00f6ca9e2c91c98c08445b226e24a0c | 1b8fbbb2fa23e21cc82c52cb3d049217aba4a423 | /app/src/main/java/com/example/webandappdevelopment/LoanFragment.java | 2360afec32d9397cf4197aa0c4e121d2afe16a29 | [] | no_license | efarioli/WebAndAppDevelopment | 266e5a81d7480a7bdafbc6e286d5084a003db220 | f7f67c0cb77b5cdf9ff7b763a079a89771d3b1ba | refs/heads/master | 2022-10-06T00:19:55.906123 | 2020-06-05T16:15:34 | 2020-06-05T16:15:34 | 269,698,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,607 | java | package com.example.webandappdevelopment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.webandappdevelopment.ModelDTO.BookDTO;
import com.example.webandappdevelopment.ModelDTO.LoanDTO;
import com.example.webandappdevelopment.Utils.Myhelper;
import com.example.webandappdevelopment.Utils.RetrofitHelper;
import com.muddzdev.styleabletoast.StyleableToast;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
public class LoanFragment extends Fragment {
private ArrayList<LoanItem> mExampleList;
private RecyclerView mRecyclerView;
private LoanAdapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
List<LoanDTO> mLoans;
TextView mTitle1;
TextView mTitle2;
TextView mTitle3;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_loan, container, false);
mTitle1 = v.findViewById(R.id.view_loans_title1);
mTitle2 = v.findViewById(R.id.view_loans_title2);
mTitle3 = v.findViewById(R.id.view_loans_title3);
mTitle1.setText(R.string.member_area);
mTitle2.setText(SessionObject.getInstance().getMemberDTO().getName());
mTitle3.setText(R.string.current_loans);
buildRecyclerView(v);
createExampleList();
return v;
}
public void renewLoan(int position, String text) {
RestFulWebServiceApi retroApi = RetrofitHelper.getRetrofitSepUP();
Call<List<LoanDTO>> call = retroApi.renewLoan(mLoans.get(position).getId(), mLoans.get(position));
Context context1 = getActivity();
RetrofitHelper.makeCall((loans) -> {
renewLoanAsync(loans, position);
}, call, position, context1
);
}
public void renewLoanAsync(List<LoanDTO> loans, int position) {
mLoans = loans;
LoanDTO loan = mLoans.get(position);
mExampleList.get(position).setmNumberRenewals("" + (loan.getNumberOfRenewals()));
mAdapter.notifyItemChanged(position);
String message = String.format("Book \"%s\" \n(Copy no %s)\nhas been renewed", loan.getCopy().getBook().getTitle(), "" + loan.getCopy().getId());
StyleableToast.makeText(getContext(), message, R.style.toast_success).show();
}
public void returnBook(int position) {
RestFulWebServiceApi retroApi = RetrofitHelper.getRetrofitSepUP();
Call<List<LoanDTO>> call = retroApi.addBookToLoanHistory(mLoans.get(position).getId(), mLoans.get(position));
RetrofitHelper.makeCall((t) -> {
returnBookAsync(t, position);
}, call, position, getActivity()
);
}
private void returnBookAsync(List<LoanDTO> loans, int position) {
mLoans.remove(position);
mExampleList.remove(position);
mAdapter.notifyItemRemoved(position);
}
private void createExampleList() {
RestFulWebServiceApi retroApi = RetrofitHelper.getRetrofitSepUP();
int userId = SessionObject.getInstance().getMemberDTO().getId();
Call<List<LoanDTO>> call = retroApi.getCurrentLoanForMember(userId);
mExampleList = new ArrayList<>();
RetrofitHelper.makeCall((t) -> {
makeAsyncList(t);
}, call, null, getActivity()
);
}
private void makeAsyncList(List<LoanDTO> loans) {
mLoans = loans;
for (LoanDTO loan : mLoans) {
BookDTO book = loan.getCopy().getBook();
LoanItem ex = new LoanItemBuilder().setExId(loan.getId())
.setmBookTitle(book.getTitle())
.setmBookAuthor(book.getAuthor())
.setmBookIsbn(book.getIsbn())
.setmBorrowed(Myhelper.CalendarToStringF(loan.getLoanDate()))
.setmDueDate(Myhelper.CalendarToStringF(loan.getDueDate()))
.setmNumberRenewals("" + loan.getNumberOfRenewals())
.createExampleItem();
mExampleList.add(ex);
}
buildRecyclerView(getView());
}
private void buildRecyclerView(View v) {
mRecyclerView = v.findViewById(R.id.recycler_view_loan);
mLayoutManager = new LinearLayoutManager(getActivity());
((LinearLayoutManager) mLayoutManager).setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new LoanAdapter(mExampleList);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
mAdapter.setOnItemClickListener(new LoanAdapter.OnItemClickListener() {
@Override
public void onRenewBtnClick(int position) {
renewLoan(position, "Clicked! pos " + position);
}
@Override
public void onReturnBtnClick(int position) {
returnBook(position);
}
});
}
}
| [
"efarioli@gmail.com"
] | efarioli@gmail.com |
6d6ee7328fa66284bb693c28c8cb29b95b6b54aa | 4bfb2467e61c5b4491dbef3d50c33cc59e7a2026 | /src/project/MailAuth.java | 4ef06ca02ddd19103c3addfeedb12f2a6225a2b6 | [] | no_license | leedongab/sf_mvc1 | 5249d25ebe283aee1a285f9ed5016f3fb944f62d | 909c8c5472a3394e641c419a5d4cb876192b8034 | refs/heads/master | 2022-07-28T20:06:50.914530 | 2020-05-13T02:06:37 | 2020-05-13T02:06:37 | 262,507,762 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 465 | java | package project;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
public class MailAuth extends Authenticator{
PasswordAuthentication pa;
public MailAuth() {
String mail_id = "dnflskfk1994@gmail.com";
String mail_pw = "!y6593947";
pa = new PasswordAuthentication(mail_id, mail_pw);
}
public PasswordAuthentication getPasswordAuthentication() {
return pa;
}
}
| [
"kadi37@hanmail.net"
] | kadi37@hanmail.net |
bc62eb5966fbe493cf46cbb994521cdc2639bb07 | 96fcd5f4d1eae28d596959b29ff2bc076e1c40d7 | /CSJE_Sprouts/src/com/CSJE/Sprouts/IsoCheckerTest.java | caedc160ba1197a56b8abae05ccf3eca2382df8b | [] | no_license | Jsedwards505/sproutgame | 7d8186efe4082ad8dde7cd8348de16f5cd0d78cb | fe8001dfe259ff30a91e087ae55efdba1ec09789 | refs/heads/master | 2020-06-02T21:04:43.526835 | 2013-12-09T09:24:32 | 2013-12-09T09:24:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | package com.CSJE.Sprouts;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class IsoCheckerTest {
String pos1 = "1,2,3,4;5;7/8,9,5,6;4,2;10,11,8/7";
String pos2 = "7/10,11,8;9,8,5,6;2,4/7;5;1,2,3,4"; //iso to 1
String pos3 = "7/10,11,8;9,8,5,6;2,4/7;5;3,2,1,4"; //iso to 1
String pos4 = "7/10,11,8;9,8,5,6;2,4/7;5;3,2,1,7"; //non-iso
String pos5 = "1,4;2/3";
String pos6 = "1,4;3/2";
@Before
public void setUp() throws Exception {
}
@Test
public void test() {
assertTrue(IsoChecker.check(pos1, pos1));
assertTrue(IsoChecker.check(pos1, pos2));
assertTrue(IsoChecker.check(pos1, pos3));
assertTrue(IsoChecker.check(pos3, pos2));
assertFalse(IsoChecker.check(pos1, pos4));
assertTrue(IsoChecker.check(pos5, pos6));
}
} | [
"symondschristopher@gmail.com"
] | symondschristopher@gmail.com |
2b26a1b656fe945ff226f9c443e0bf3fa67c11af | ade8459db35f299fe254f560de6f2736a6cf19f6 | /SetAndHashSet/src/com/gliga/HeavenlyBody.java | 45a5da35672091ad3b87f31c07c15e24c02213cf | [] | no_license | gliga02/learning-java | f962ed9d17d0fbd5f7491856559ecdc8600a3bff | 639314157f02f8349f9e98f28ff70e682d37d4bc | refs/heads/master | 2022-12-25T11:01:02.657396 | 2020-09-28T11:59:56 | 2020-09-28T11:59:56 | 299,292,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,317 | java | package com.gliga;
import java.util.HashSet;
import java.util.Set;
public final class HeavenlyBody {
private final String name;
private final double orbitalPeriod;
private final Set<HeavenlyBody> satellites;
public HeavenlyBody(String name, double orbitalPeriod) {
this.name = name;
this.orbitalPeriod = orbitalPeriod;
this.satellites = new HashSet<>();
}
public String getName() {
return name;
}
public double getOrbitalPeriod() {
return orbitalPeriod;
}
public boolean addMoon(HeavenlyBody moon) {
return this.satellites.add(moon);
}
public Set<HeavenlyBody> getSatellites() {
return new HashSet<>(this.satellites);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
System.out.println("o.getClass() is " + o.getClass());
System.out.println("this.getClass() is " + this.getClass());
if (o == null || o.getClass() != this.getClass()) {
return false;
}
String oName = ((HeavenlyBody)o).getName();
return this.name.equals(oName);
}
@Override
public int hashCode() {
System.out.println("hashcode called");
return this.name.hashCode() + 57;
}
}
| [
"itdjordjegligorijevic@gmail.com"
] | itdjordjegligorijevic@gmail.com |
7c58da4fde131a989644dabaa24518f5c3af71df | 2f766f9200e0293da0c8ec872894c00cc791bdad | /java/simpleTest/src/main/java/com/xubao/test/simpleTest/java8Test/ITest.java | 599bb43ac387d2b92b745b2f14d682cc36d99db2 | [] | no_license | vvxubaovv/MyTest | 86f9a38057f5bd5609c95c497d8dee0506cfe7cb | 5d21888db1378103dcf589bacf1baca9a89e0974 | refs/heads/master | 2022-12-20T04:25:28.469063 | 2019-09-23T13:07:12 | 2019-09-23T13:07:12 | 125,979,707 | 0 | 0 | null | 2022-12-16T12:00:27 | 2018-03-20T07:46:53 | Java | UTF-8 | Java | false | false | 231 | java | package com.xubao.test.simpleTest.java8Test;
/**
* @author xubao
* @version 1.0
* @since 2018/11/16
*/
@FunctionalInterface//标识的接口只能有一个抽象方法
public interface ITest
{
void test(int a);
}
| [
"a_xubao@163.com"
] | a_xubao@163.com |
0cb950818976f4b9d87d614ec9fbecb68c3f0d40 | f3aed80cc181ad0edd9038afff50974a6455ca6c | /src/main/java/com/eve/service/impl/UserServiceImpl.java | 297a13979bd0c0154f1f586603e3e6bef47e4298 | [] | no_license | hanneys/my-vx-program | 17df1e384a3024ba368d7870d7b556b20d8e82ef | 9d63a6b464ee024f69729905f3525fc54e5663e8 | refs/heads/master | 2023-05-26T15:34:19.241150 | 2023-05-25T07:15:24 | 2023-05-25T07:15:24 | 362,657,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.eve.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.eve.entity.User;
import com.eve.mapper.UserMapper;
import com.eve.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author hanaijun
* @since 2021-04-27
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
@Override
public User getUserByPhone(String phone){
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(User::getPhone,phone);
return getOne(lambdaQueryWrapper);
}
}
| [
"18600256815@163.com"
] | 18600256815@163.com |
18c6929324c74761dab762b542555d0f2e4383ad | 71b21c948fd54796b1e44a8184f5a7109eec3130 | /mytest/src/main/java/com/guinong/shopcart/ShopCartRequest.java | 677d058b5f70416ad8fd29a8768f1dc7db263624 | [] | no_license | yangmbin/NetClient | e357513481a125249f3fc1e0f493faa5343c1cae | 5587501ab97917bc3735e8aeac5634586db85a96 | refs/heads/master | 2021-01-19T18:43:36.529126 | 2017-07-28T08:38:27 | 2017-07-28T08:38:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package com.guinong.shopcart;
import java.io.Serializable;
/**
* @author csn
* @date 2017/7/27 0027 16:38
* @content
*/
public class ShopCartRequest implements Serializable {
}
| [
"chenshuangniu"
] | chenshuangniu |
c09b5c5d9d2210115a36a4bab8f6b65ce2966e28 | 77d45452c0028564935fb85b0fa1cd324665e4c0 | /src/main/java/com/realtimecep/storm/starter/transactional/MyTransactionalWords.java | 6bcc96902409e1b7a897be71975117db1b556636 | [] | no_license | tedwon/real-time-statsS-pilot | 33fe168ea0602da841512f5a90854f6b420a5592 | 5bbb7f2ed8432127de1f5de12e4ea9ea14dc0179 | refs/heads/master | 2021-01-25T07:35:26.540572 | 2013-03-30T04:08:32 | 2013-03-30T04:08:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,583 | java | package com.realtimecep.storm.starter.transactional;
import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.coordination.BatchOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.testing.MemoryTransactionalSpout;
import backtype.storm.topology.BasicOutputCollector;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseBasicBolt;
import backtype.storm.topology.base.BaseTransactionalBolt;
import backtype.storm.transactional.ICommitter;
import backtype.storm.transactional.TransactionAttempt;
import backtype.storm.transactional.TransactionalTopologyBuilder;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
import backtype.storm.utils.Utils;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* This class defines a more involved transactional topology then TransactionalGlobalCount. This topology
* processes a stream of words and produces two outputs:
*
* 1. A count for each word (stored in a database)
* 2. The number of words for every bucket of 10 counts. So it stores in the database how many words have appeared
* 0-9 times, how many have appeared 10-19 times, and so on.
* count 수치 범위에 따라서 담는 버킷을 구분하고 처리 결과 담긴 버킷의 내용으로 데이터 통계를 파악 할 수 있다.
* top N count에 활용 할 수 있다.
*
* A batch of words can cause the bucket counts to decrement for some buckets and increment for others as words move
* between buckets as their counts accumulate.
*
* Debug - tuple object
* source: spout:7, stream: default, id: {}, [1:7101600008655646784, dog]
*
* TxID:AttemptID
* 1:7101600008655646784
*
*/
public class MyTransactionalWords {
public static class CountValue {
Integer prev_count = null;
int count = 0;
//TransactionAttempt id
BigInteger txid = null;
@Override
public String toString() {
return "CountValue{" +
"prev_count=" + prev_count +
", count=" + count +
", txid=" + txid +
'}';
}
}
public static class BucketValue {
int count = 0;
BigInteger txid;
@Override
public String toString() {
return "BucketValue{" +
"count=" + count +
", txid=" + txid +
'}';
}
}
public static final int BUCKET_SIZE = 3;
public static Map<String, CountValue> COUNT_DATABASE = new HashMap<String, CountValue>();
public static Map<Integer, BucketValue> BUCKET_DATABASE = new HashMap<Integer, BucketValue>();
public static final int PARTITION_TAKE_PER_BATCH = 3;
public static final Map<Integer, List<List<Object>>> DATA = new HashMap<Integer, List<List<Object>>>() {{
put(0, new ArrayList<List<Object>>() {{
add(new Values("cat"));
add(new Values("dog"));
add(new Values("chicken"));
add(new Values("tedwon"));
add(new Values("dog"));
add(new Values("apple"));
}});
put(1, new ArrayList<List<Object>>() {{
add(new Values("cat"));
add(new Values("dog"));
add(new Values("apple"));
add(new Values("banana"));
}});
put(2, new ArrayList<List<Object>>() {{
add(new Values("cat"));
add(new Values("cat"));
add(new Values("cat"));
add(new Values("cat"));
add(new Values("cat"));
add(new Values("dog"));
add(new Values("dog"));
add(new Values("dog"));
add(new Values("dog"));
}});
}};
public static class KeyedCountUpdater extends BaseTransactionalBolt implements ICommitter {
Map<String, Integer> _counts = new HashMap<String, Integer>();
BatchOutputCollector _collector;
TransactionAttempt _id;
int _count = 0;
@Override
public void prepare(Map conf, TopologyContext context, BatchOutputCollector collector, TransactionAttempt id) {
_collector = collector;
_id = id;
}
@Override
public void execute(Tuple tuple) {
// System.out.println(tuple);
String key = tuple.getString(1);
Integer curr = _counts.get(key);
if(curr==null) curr = 0;
// word count
_counts.put(key, curr + 1);
// System.out.println(_counts);
// Utils.sleep(1000);
}
@Override
public void finishBatch() {
// finishBatch 메소드는 execute 메소드와 상관없이 연속으로 호출됨
// System.out.println("finishBatch");
// word count 데이터가 들어있는 map을 꺼내서 외부 DATABASE에 넣는다.
for(String key: _counts.keySet()) {
CountValue val = COUNT_DATABASE.get(key);
CountValue newVal;
if(val==null || !val.txid.equals(_id)) {
// 처음이거나 다른 tx인 경우
newVal = new CountValue();
newVal.txid = _id.getTransactionId();
if(val!=null) {
newVal.prev_count = val.count;
newVal.count = val.count;
}
newVal.count = newVal.count + _counts.get(key);
COUNT_DATABASE.put(key, newVal);
// System.out.println(key + " : " + newVal);
} else {
// 두번째 이상이고 같은 tx인경우
newVal = val;
}
_collector.emit(new Values(_id, key, newVal.count, newVal.prev_count));
// System.out.println(COUNT_DATABASE);
}
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
// prev-count: 이전 tx에서 count했던 값
declarer.declare(new Fields("id", "key", "count", "prev-count"));
}
}
public static class Bucketize extends BaseBasicBolt {
@Override
public void execute(Tuple tuple, BasicOutputCollector collector) {
// System.out.println(tuple);
TransactionAttempt attempt = (TransactionAttempt) tuple.getValue(0);
int curr = tuple.getInteger(2);
Integer prev = tuple.getInteger(3);
int currBucket = curr / BUCKET_SIZE;
Integer prevBucket = null;
if(prev!=null) {
prevBucket = prev / BUCKET_SIZE;
}
if(prevBucket==null) {
Values tuple1 = new Values(attempt, currBucket, 1);
collector.emit(tuple1);
// System.out.println("prevBucket==null :" + tuple1);
} else if(currBucket != prevBucket) {
Values tuple1 = new Values(attempt, currBucket, 1);
collector.emit(tuple1);
// System.out.println("currBucket != prevBucket :" + tuple1);
Values tuple2 = new Values(attempt, prevBucket, -1);
collector.emit(tuple2);
// System.out.println("currBucket != prevBucket :" + tuple2);
}
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(new Fields("attempt", "bucket", "delta"));
}
}
public static class BucketCountUpdater extends BaseTransactionalBolt {
Map<Integer, Integer> _accum = new HashMap<Integer, Integer>();
BatchOutputCollector _collector;
TransactionAttempt _attempt;
int _count = 0;
@Override
public void prepare(Map conf, TopologyContext context, BatchOutputCollector collector, TransactionAttempt attempt) {
_collector = collector;
_attempt = attempt;
}
@Override
public void execute(Tuple tuple) {
Integer bucket = tuple.getInteger(1);
Integer delta = tuple.getInteger(2);
Integer curr = _accum.get(bucket);
if(curr==null) curr = 0;
_accum.put(bucket, curr + delta);
}
@Override
public void finishBatch() {
for(Integer bucket: _accum.keySet()) {
BucketValue currVal = BUCKET_DATABASE.get(bucket);
BucketValue newVal;
if(currVal==null || !currVal.txid.equals(_attempt.getTransactionId())) {
newVal = new BucketValue();
newVal.txid = _attempt.getTransactionId();
newVal.count = _accum.get(bucket);
if(currVal!=null) newVal.count += currVal.count;
BUCKET_DATABASE.put(bucket, newVal);
} else {
newVal = currVal;
}
Values tuple = new Values(_attempt, bucket, newVal.count);
_collector.emit(tuple);
// System.out.println(tuple);
System.out.println(BUCKET_DATABASE);
}
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(new Fields("id", "bucket", "count"));
}
}
public static void main(String[] args) throws Exception {
MemoryTransactionalSpout spout = new MemoryTransactionalSpout(DATA, new Fields("word"), PARTITION_TAKE_PER_BATCH);
TransactionalTopologyBuilder builder = new TransactionalTopologyBuilder("top-n-words", "spout", spout, 1);
// 단순 word count
builder.setBolt("count", new KeyedCountUpdater(), 5)
.fieldsGrouping("spout", new Fields("word"));
// ?
builder.setBolt("bucketize", new Bucketize())
.noneGrouping("count");
builder.setBolt("buckets", new BucketCountUpdater(), 5)
.fieldsGrouping("bucketize", new Fields("bucket"));
LocalCluster cluster = new LocalCluster();
Config config = new Config();
config.setDebug(true);
config.setMaxSpoutPending(3);
cluster.submitTopology("top-n-topology", config, builder.buildTopology());
// Thread.sleep(3000);
// cluster.shutdown();
}
}
| [
"iamtedwon@gmail.com"
] | iamtedwon@gmail.com |
d5382ec51fba833c6883c6ed0c3cafb31ea82611 | 1d1c930005835cceb15e02bf6afdff7bf336a2b1 | /Codebase/SourceCode/HRIntegration/src/main/java/sdo/commonj/Type.java | 81bea6360e0e68c9c785728dd3ee426a86efb03f | [] | no_license | schandraninv/HCM-TaleoIntegration | 7d0eac2f10cb85e3e8942441a34e66149782a0b4 | b2b1c54cdbd7a9bb5a873c68e7fad75a40eaef2c | refs/heads/master | 2021-06-16T15:48:33.366609 | 2017-05-11T13:31:54 | 2017-05-11T13:31:54 | 82,793,572 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,431 | java |
package sdo.commonj;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
* <p>Java class for Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Type">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="baseType" type="{commonj.sdo}URI" maxOccurs="unbounded" minOccurs="0"/>
* <element name="property" type="{commonj.sdo}Property" maxOccurs="unbounded" minOccurs="0"/>
* <element name="aliasName" type="{commonj.sdo}String" maxOccurs="unbounded" minOccurs="0"/>
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}ID" />
* <attribute name="uri" type="{commonj.sdo}URI" />
* <attribute name="dataType" type="{commonj.sdo}Boolean" />
* <attribute name="open" type="{commonj.sdo}Boolean" />
* <attribute name="sequenced" type="{commonj.sdo}Boolean" />
* <attribute name="abstract" type="{commonj.sdo}Boolean" />
* <anyAttribute processContents='lax'/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Type", propOrder = {
"baseType",
"property",
"aliasName",
"any"
})
public class Type {
@XmlSchemaType(name = "anyURI")
protected List<String> baseType;
protected List<Property> property;
protected List<String> aliasName;
@XmlAnyElement(lax = true)
protected List<Object> any;
@XmlAttribute(name = "name")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String name;
@XmlAttribute(name = "uri")
protected String uri;
@XmlAttribute(name = "dataType")
protected Boolean dataType;
@XmlAttribute(name = "open")
protected Boolean open;
@XmlAttribute(name = "sequenced")
protected Boolean sequenced;
@XmlAttribute(name = "abstract")
protected Boolean _abstract;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the baseType property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the baseType property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getBaseType().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getBaseType() {
if (baseType == null) {
baseType = new ArrayList<String>();
}
return this.baseType;
}
/**
* Gets the value of the property property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the property property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getProperty().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Property }
*
*
*/
public List<Property> getProperty() {
if (property == null) {
property = new ArrayList<Property>();
}
return this.property;
}
/**
* Gets the value of the aliasName property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the aliasName property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAliasName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getAliasName() {
if (aliasName == null) {
aliasName = new ArrayList<String>();
}
return this.aliasName;
}
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the uri property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUri() {
return uri;
}
/**
* Sets the value of the uri property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUri(String value) {
this.uri = value;
}
/**
* Gets the value of the dataType property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isDataType() {
return dataType;
}
/**
* Sets the value of the dataType property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setDataType(Boolean value) {
this.dataType = value;
}
/**
* Gets the value of the open property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isOpen() {
return open;
}
/**
* Sets the value of the open property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setOpen(Boolean value) {
this.open = value;
}
/**
* Gets the value of the sequenced property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSequenced() {
return sequenced;
}
/**
* Sets the value of the sequenced property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSequenced(Boolean value) {
this.sequenced = value;
}
/**
* Gets the value of the abstract property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isAbstract() {
return _abstract;
}
/**
* Sets the value of the abstract property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setAbstract(Boolean value) {
this._abstract = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
}
| [
"suchandran@shutterfly.com"
] | suchandran@shutterfly.com |
35e1d74fdad96c98139cc6bad08dfecc9e575875 | 034f5cbf180917115dc26a915ad2e3a3bd704d61 | /src/main/java/me/renhai/oj/CombinationSumIII.java | 6bb444a33504f2134f64ea7f25b0be7f273d21c8 | [] | no_license | renhai/demo | f3c2a20e630a22aeedc8913cbedd02c1af5f5b2a | ca71b5a4c82262bc381ff8c90b133f2bfd589509 | refs/heads/master | 2020-07-27T21:38:36.569921 | 2016-12-17T05:43:41 | 2016-12-17T05:43:41 | 73,424,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,115 | java | package me.renhai.oj;
import java.util.ArrayList;
import java.util.List;
/**
* https://leetcode.com/problems/combination-sum-iii/
* @author andy
*
*/
public class CombinationSumIII {
public static void main(String[] args) {
List<List<Integer>> res = new CombinationSumIII().combinationSum3(3, 7);
for (List<Integer> list : res) {
System.out.println(list);
}
}
public List<List<Integer>> combinationSum3(int k, int n) {
int[] candidates = new int[] {1,2,3,4,5,6,7,8,9};
List<List<Integer>> combs = new ArrayList<>();
helper(combs, new ArrayList<Integer>(), candidates, n, 0, k);
return combs;
}
private void helper(List<List<Integer>> combs, List<Integer> comb, int[] candidates, int target, int start, int k) {
if (target == 0 && comb.size() == k) {
combs.add(new ArrayList<>(comb));
return;
}
for (int i = start; i < candidates.length && target >= candidates[i]; i++) {
comb.add(candidates[i]);
helper(combs, comb, candidates, target - candidates[i], i + 1, k);
comb.remove(comb.size() - 1);
}
}
}
| [
"myrenhai@gmail.com"
] | myrenhai@gmail.com |
8895afe3a0f2799cbd6412a6e094b7b921cb09bc | 6b23af68deb8a803cf289c5674033681a266d9bb | /src/main/java/se/kth/service/rest/ApplicationConfig.java | d8119a7f2b24e328dff16be79f1d9e6434be9251 | [] | no_license | amor3/IV1201 | bf7015b65491f9c7311cfa7af333720993ea13e6 | 752bde2555118f8408ee3f39b2c3ec9b272aaae2 | refs/heads/master | 2021-01-21T01:46:44.382412 | 2015-03-16T12:36:13 | 2015-03-16T12:36:13 | 30,202,581 | 0 | 0 | null | 2015-03-16T12:36:13 | 2015-02-02T18:54:49 | JavaScript | UTF-8 | Java | false | false | 782 | java | package se.kth.service.rest;
import java.util.Set;
import javax.ws.rs.core.Application;
/**
*
* @author AMore
*/
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new java.util.HashSet<>();
addRestResourceClasses(resources);
return resources;
}
/**
* Do not modify addRestResourceClasses() method.
* It is automatically populated with
* all resources defined in the project.
* If required, comment out calling this method in getClasses().
*/
private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(se.kth.service.rest.ApplicantResource.class);
}
}
| [
"amore@kth.se"
] | amore@kth.se |
4a9792fcb18c440704cb98569aa541a1376097fa | f3dc035097a90000efcce6f51d5f30a5933889ad | /src/main/java/com/yespaince/yeinio/HomeController.java | 9f974710bcaf52bdce72deb1d71683344160ff95 | [] | no_license | yespaince/yein.io | 24379f274ae1e5f8aef10559f814387f91c90c1b | bffdcc77982b4548208b169cc1257bb92f55ea1c | refs/heads/master | 2020-04-01T20:28:00.599037 | 2018-10-18T11:20:48 | 2018-10-18T11:20:48 | 153,605,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,082 | java | package com.yespaince.yeinio;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* Handles requests for the application home page.
*/
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";
}
}
| [
"dec.yein@gmail.com"
] | dec.yein@gmail.com |
64de045dd50982aaecea50c26b424f91588f54ae | dfa6b1892b1fe8ea54c8a11d2499d27530576d57 | /spring-boot-kafka-consumer-example/src/main/java/com/sreeram/kafka/springbootkafkaconsumerexample/config/KafkaConfiguration.java | a2e1e922933cc3353c5e811170b6e8d3baaf767b | [] | no_license | indysreeram/spring-boot-kafka | 7b170b0763c751749f24ef11d3844b6328ad9ceb | 40dcb61ae8f1189548529f8c1b77f2cd8d307de0 | refs/heads/master | 2022-04-19T19:01:59.400250 | 2020-04-11T16:36:34 | 2020-04-11T16:36:34 | 254,910,024 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,695 | java | package com.sreeram.kafka.springbootkafkaconsumerexample.config;
import com.sreeram.kafka.springbootkafkaconsumerexample.models.User;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.support.serializer.JsonDeserializer;
import org.springframework.kafka.support.serializer.JsonSerializer;
import java.util.HashMap;
import java.util.Map;
@EnableKafka
@Configuration
public class KafkaConfiguration {
@Bean
public ConsumerFactory<String,String> consumerFactory(){
Map<String,Object> config = new HashMap<>();
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"127.0.0.1:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG,"group_id");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringSerializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringSerializer.class);
return new DefaultKafkaConsumerFactory<>(config);
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String,String> concurrentKafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String,String> factory = new ConcurrentKafkaListenerContainerFactory();
factory.setConsumerFactory(consumerFactory());
return factory;
}
@Bean
public ConsumerFactory<String, User> userConsumerFactory() {
Map<String,Object> config = new HashMap<>();
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"127.0.0.1:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG,"group_id");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringSerializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return new DefaultKafkaConsumerFactory<>(config,new StringDeserializer(),new JsonDeserializer<>(User.class));
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String,User> userConcurrentKafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String,User> factory = new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(userConsumerFactory());
return factory;
}
}
| [
"indysreeram@gmail.com"
] | indysreeram@gmail.com |
58dcbc70cbf9262a5f60ddef8de1f94c8b6bf415 | 7c310076e7b951a00e6eed93b33aba4d3ac3ad36 | /Lektion 6/DialPadApplication/src/com/kindborg/mattias/dialpadapplication/ExternalStorage.java | 04c0ba9b34a3b78f6f846a2a8383d9d88f810190 | [] | no_license | FantasticFiasco/course-applikationsutveckling-for-android | 693bdd1aefa0b6414ce7d102fffc9b26092c970f | 13f725dcff5b175ff7acbca386ca23a4bcc5f728 | refs/heads/master | 2021-01-10T17:15:38.074685 | 2016-03-03T22:45:54 | 2016-03-03T22:45:54 | 53,089,111 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,202 | java | package com.kindborg.mattias.dialpadapplication;
import java.io.*;
import java.util.*;
import android.os.*;
/**
* Class responsible for handling the external storage.
*/
public class ExternalStorage {
/**
* Gets a value indicating whether external storage is in a readable state.
*/
public static boolean isExternalStorageReadable() {
String state = Environment.getExternalStorageState();
return state.equals(Environment.MEDIA_MOUNTED) ||
state.equals(Environment.MEDIA_MOUNTED_READ_ONLY);
}
/**
* Gets a value indicating whether external storage is in a writable state.
*/
public static boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState();
return state.equals(Environment.MEDIA_MOUNTED);
}
/**
* Gets a value indicating whether file represented by specified file name
* exists.
*/
public static boolean fileExists(String fileName) {
File file = new File(fileName);
return file.exists() && file.isFile();
}
/**
* Gets a value indicating whether directory represented by directory name
* exists.
*/
public static boolean directoryExists(String directoryName) {
File file = new File(directoryName);
return file.exists() && file.isDirectory();
}
/**
* Ensures that specified directory exists.
*/
public static void ensureDirectoryExists(String path) {
new File(path).mkdirs();
}
/**
* Gets the directories in specified path.
*/
public static String[] getDirectories(String path) {
List<String> directoryList = new ArrayList<String>();
File pathFile = new File(path);
if (pathFile.exists()) {
for (File file : pathFile.listFiles()) {
if (file.isDirectory()) {
directoryList.add(file.getAbsolutePath());
}
}
}
String[] directories = new String[directoryList.size()];
return directoryList.toArray(directories);
}
/**
* Gets the names of specified directories.
*/
public static String[] getDirectoryNames(String[] directoryPaths) {
List<String> directoryNameList = new ArrayList<String>();
for (String directoryPath : directoryPaths) {
directoryNameList.add(new File(directoryPath).getName());
}
String[] directoryNames = new String[directoryNameList.size()];
return directoryNameList.toArray(directoryNames);
}
/**
* Create a path pointing to specified path on the external storage.
*/
public static String createPath(String path) {
File file = new File(
Environment.getExternalStorageDirectory(),
path);
return file.getAbsolutePath();
}
/**
* Combines specified directory name with specified file name.
*/
public static String combine(String directoryName, String fileName) {
return directoryName + File.separator + fileName;
}
} | [
"FantasticFiasco@users.noreply.github.com"
] | FantasticFiasco@users.noreply.github.com |
b6881d9d1862093ede840b0331bf672dbf86face | 5536bee6de6e43523a067a8c264cf71ff17cf1af | /Java/Java Method Overriding/Solution.java | 73f2c8b11edd976e987c991909da7996152b355a | [] | no_license | namonak/HackerRank | 6874955651f2a89c1dbcdf4de95221be77468ca8 | 54a2b9b3ddbe785e15128dd6ab611efd701dccd6 | refs/heads/master | 2022-03-15T19:09:11.479010 | 2022-02-21T14:28:35 | 2022-02-21T14:28:35 | 198,845,554 | 0 | 1 | null | 2021-05-09T13:49:02 | 2019-07-25T14:20:55 | C | UTF-8 | Java | false | false | 817 | java | import java.util.*;
class Sports{
String getName() {
return "Generic Sports";
}
void getNumberOfTeamMembers() {
System.out.println("Each team has n players in " + getName());
}
}
class Soccer extends Sports{
@Override
String getName() {
return "Soccer Class";
}
// Write your overridden getNumberOfTeamMembers method here
@Override
void getNumberOfTeamMembers() {
System.out.println("Each team has 11 players in " + getName());
}
}
public class Solution{
public static void main(String []args) {
Sports c1 = new Sports();
Soccer c2 = new Soccer();
System.out.println(c1.getName());
c1.getNumberOfTeamMembers();
System.out.println(c2.getName());
c2.getNumberOfTeamMembers();
}
}
| [
"namonak@gmail.com"
] | namonak@gmail.com |
1c45520aa63e78d13caae94b832b8f4818b113a8 | 688fd6a72dc86fdfee21063180a6287d1ed3b026 | /AlYou/src/com/imalu/alyou/net/response/AssociationSearchResponse.java | a182c6a55f26c46feada1c8da11eaa17bef45854 | [] | no_license | zzsier/AlYou | 336765683cad29f54cbb372f6b29f59affdaf69b | 9fe5ac53d490f94d50a749102170be0bd3ef0cea | refs/heads/master | 2021-01-22T06:55:08.407651 | 2015-02-10T07:03:12 | 2015-02-10T07:03:12 | 27,323,836 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,095 | java | package com.imalu.alyou.net.response;
import org.json.JSONException;
import com.imalu.alyou.net.NetObject;
public class AssociationSearchResponse extends NetObject{
public int getId() {
try {
return this.getJsonObject().getInt("Id");
} catch (JSONException e) {
// TODO Auto-generated catch block
return 0;
}
}
public int getJifen() {
try {
return this.getJsonObject().getInt("jifen");
} catch (JSONException e) {
// TODO Auto-generated catch block
return 0;
}
}
public String getSocietyName() {
try {
return this.getJsonObject().getString("SocietyName");
} catch (Exception e) {
// TODO Auto-generated catch block
return "";
}
}
public String getSocietySummary() {
try {
return this.getJsonObject().getString("SocietySummary");
} catch (Exception e) {
// TODO Auto-generated catch block
return "";
}
}
public String getKey() {
try {
return this.getJsonObject().getString("Key");
} catch (Exception e) {
// TODO Auto-generated catch block
return "";
}
}
}
| [
"Administrator@XT1-20141107UYY"
] | Administrator@XT1-20141107UYY |
116bcc300c47b735f6689299380f84dfaf6de65e | e4508641606a271dd0bdfb6141ab23a3ff126ae6 | /ru.eclipsetrader.transaq.core/src/ru/eclipsetrader/transaq/core/model/SecurityType.java | 1f921e37fa3e62267c58255736e8351bfe0fd6d1 | [] | no_license | azyuzko/eclipsetransaq | d72b81b3d3db4e15a5999ccb37c93653b82d64d3 | 634bdcce9416f585f29629ef8bf5dcd1786fadd7 | refs/heads/master | 2021-01-10T21:04:12.185739 | 2016-09-20T12:29:48 | 2016-09-20T12:29:48 | 39,255,592 | 1 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 920 | java | package ru.eclipsetrader.transaq.core.model;
public enum SecurityType {
// Торгуемые инструменты:
SHARE, // - акции
BOND, // - облигации корпоративные
FUT, // - фьючерсы FORTS
OPT, // - опционы
GKO, // - гос. бумаги
FOB, // - фьючерсы ММВБ
MCT,
ETS_CURRENCY,
ETS_SWAP,
// Неторгуемые (все кроме IDX приходят только с зарубежных площадок):
IDX, // - индексы
QUOTES, // - котировки (прочие)
CURRENCY, // - валютные пары
ADR, // - АДР
NYSE, // - данные с NYSE
METAL, // - металлы
OIL, // - нефтянка
/*SHA, // это гавно приходит с продуктива!
OP,
SH,
BO,
RE,
T,
BON,
ND,
ARE,
D,
MC,
FU,
SHAR,
E,
ETS_CURRENC,
Y,
ID,
X,
ETS_SW,
ETS_CU,
AP,
ETS_CURR,*/
}
| [
"visnet@mail.ru"
] | visnet@mail.ru |
661d097aed32c3e7a9f777c76f86a71b978b3f7b | 4dd6e1f578e9872ae3cf17f8b79eca21806b8f26 | /foundation/src/main/java/com/dh/foundation/widget/afkimageview/AlphaAnimation.java | 7b252e1c82971cf7e2db95eae8ae9a709d439c4b | [] | no_license | wh2eat/FrameCode | 29932a9f58f4dca9d2e753a64d418543dab5daa9 | fbb0c741feb7a5d4ee86632b312fa8c78a2b0295 | refs/heads/master | 2020-08-26T14:28:31.617958 | 2018-05-08T02:27:00 | 2018-05-08T02:27:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 890 | java | package com.dh.foundation.widget.afkimageview;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
/**
* Created by lee on 2015/9/22.
*/
public class AlphaAnimation extends ToggleAnimation {
private int lastAlpha;
private int alpha;
@Override
public void setImage(Drawable drawable) {
super.setImage(drawable);
lastAlpha = 0;
alpha = 255;
}
@Override
protected void drawLastDrawable(Canvas canvas) {
lastAlpha = (int)(255 * progress);
mLastDrawable.setAlpha(lastAlpha);
mLastDrawable.draw(canvas);
}
@Override
protected void drawDrawable(Canvas canvas) {
alpha = (int)(255 * (1 - progress));
mDrawable.setAlpha(alpha);
mDrawable.draw(canvas);
}
@Override
protected void finish(Canvas canvas) {
mDrawable.draw(canvas);
}
}
| [
"sealkingking@163.com"
] | sealkingking@163.com |
67e7dae56b0bbe0e35aa7dffc9866b3c6832d012 | 8e099d4761f54f4285005a6d44d07d7fea929341 | /src/main/java/be/company/fca/service/impl/TraceServiceImpl.java | 423766ee60db3d57af68f2e2f1178d09870e4fb4 | [] | no_license | tenniscorponamur/championshipEngine | 86524f73dd05e2bd541ce20fd6634762d85295e3 | 3469ab497fdc8834de6f62f3c9da8c88f84545c8 | refs/heads/master | 2022-09-27T18:17:23.654462 | 2020-11-06T07:29:19 | 2020-11-06T07:29:19 | 169,879,560 | 0 | 0 | null | 2022-09-08T00:59:35 | 2019-02-09T15:15:22 | Java | UTF-8 | Java | false | false | 2,057 | java | package be.company.fca.service.impl;
import be.company.fca.model.Membre;
import be.company.fca.model.Trace;
import be.company.fca.model.User;
import be.company.fca.repository.TraceRepository;
import be.company.fca.repository.UserRepository;
import be.company.fca.service.TraceService;
import be.company.fca.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@Service
@Transactional(readOnly = true)
public class TraceServiceImpl implements TraceService {
@Autowired
TraceRepository traceRepository;
@Autowired
private UserService userService;
@Autowired
private UserRepository userRepository;
@Override
@Transactional(readOnly = false)
public Trace addTrace(Authentication authentication, String type, String foreignKey, String message) {
Trace trace = new Trace();
trace.setDateHeure(new Date());
trace.setType(type);
trace.setForeignKey(foreignKey);
trace.setUtilisateur(getUsername(authentication));
trace.setMessage(message);
return traceRepository.save(trace);
}
private String getUsername(Authentication authentication){
// Ajout d'un utilisateur admin qui est present independamment de la table users de la DB
if ("admin".equals(authentication.getName().toLowerCase())){
return "admin";
}
if (userService.isAdmin(authentication)){
User user = userRepository.findByUsername(authentication.getName().toLowerCase());
return user.getPrenom() + " " + user.getNom();
}else{
Membre membreConnecte = userService.getMembreFromAuthentication(authentication);
if (membreConnecte!=null){
return membreConnecte.getPrenom() + " " + membreConnecte.getNom();
}
}
return "UNKNOWN";
}
}
| [
"fabrice.calay@gmail.com"
] | fabrice.calay@gmail.com |
a1fd336146dbe0d6858ec588b462680186b15869 | 4cedfda65a73a2a98bfc49a2ce09bfec901cccc3 | /renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/hippylist/recyclerview/helper/skikcy/StickViewListener.java | bab6a4d6f399dcc370f64fce59929f749cdfe694 | [
"MIT",
"Apache-2.0"
] | permissive | Tencent/Hippy | f71695fb4488ee3df273524593301d7c241e0177 | 8560a25750e40f8fb51a8abfa44aad0392ebb209 | refs/heads/main | 2023-09-03T22:24:38.429469 | 2023-09-01T04:16:16 | 2023-09-01T06:22:14 | 221,822,577 | 8,300 | 1,161 | Apache-2.0 | 2023-09-14T11:22:44 | 2019-11-15T01:55:31 | Java | UTF-8 | Java | false | false | 259 | java | package com.tencent.mtt.hippy.views.hippylist.recyclerview.helper.skikcy;
/**
* Created by on 2021/8/24.
* Description
*/
public interface StickViewListener {
void onStickAttached(int stickyPosition);
void onStickDetached(int stickyPosition);
}
| [
"siguangli@qq.com"
] | siguangli@qq.com |
e5d602bac52b6c422a4613b9c713d87fc1ed0bda | ebfff291a6ee38646c4d4e176f5f2eddf390ace4 | /orange-demo-flowable/orange-demo-flowable-service/common/common-online/src/main/java/com/flow/demo/common/online/object/SqlTable.java | 47c23750b78b77b0906f326b2e42bd6b845b1fc3 | [
"Apache-2.0"
] | permissive | jiazhizhong/orange-admin | a9d6b5b97cbea72e8fcb55c081b7dc6a523847df | bbe737d540fb670fd4ed5514f7faed4f076ef3d4 | refs/heads/master | 2023-08-21T11:31:22.188591 | 2021-10-30T06:06:40 | 2021-10-30T06:06:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | package com.flow.demo.common.online.object;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 数据库中的表对象。
*
* @author Jerry
* @date 2021-06-06
*/
@Data
public class SqlTable {
/**
* 表名称。
*/
private String tableName;
/**
* 表注释。
*/
private String tableComment;
/**
* 创建时间。
*/
private Date createTime;
/**
* 关联的字段列表。
*/
private List<SqlTableColumn> columnList;
/**
* 数据库链接Id。
*/
private Long dblinkId;
}
| [
"707344974@qq.com"
] | 707344974@qq.com |
a7fc2907a52e50b400364abad8c8d4038aae4d83 | e79f9006e70a2839ea7f33d6bb5ab9b9b4ade284 | /src/main/java/com/example/library/studentlibrary/Services/AuthorService.java | ffd9c71b106980f4d9bdab44831d3bcc7a14837d | [] | no_license | shreya2099/LibraryManagementSystem | 7ad357c4dbef523b903508963fa807f3dbd49d36 | a1baa1345be96b8c2f32e338cfcda7fa8ef7a3c1 | refs/heads/master | 2023-04-19T10:20:37.188503 | 2021-05-11T20:24:42 | 2021-05-11T20:24:42 | 360,927,319 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package com.example.library.studentlibrary.Services;
import com.example.library.studentlibrary.Model.Author;
import com.example.library.studentlibrary.Repository.AuthorRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AuthorService {
@Autowired
AuthorRepository authorRepository;
public void create(Author author){
authorRepository.save(author);
}
}
| [
"shreyanigam20@gmail.com"
] | shreyanigam20@gmail.com |
9be2bc8e2c2eab0281d514089c6f6a26eb9faa63 | 9ad4d57b46dbae590c9f228a93ef3f8b98ad2d31 | /takeout/src/main/java/com/hellojava/service/impl/CommodityServiceImpl.java | 282b1386f0a891d45b305724dfc3b7e2e302c8b5 | [] | no_license | 1903-fourth-group/takeout1 | 8a3045d91423b703f1beed5318fd545ad0d2153c | 9631d2e8f7b01b8b4af169b2bffb1ee6d4f58762 | refs/heads/master | 2022-06-02T18:59:47.160837 | 2019-07-20T02:38:17 | 2019-07-20T02:38:17 | 197,775,795 | 0 | 0 | null | 2021-04-26T19:20:59 | 2019-07-19T13:16:27 | Java | UTF-8 | Java | false | false | 1,905 | java | package com.hellojava.service.impl;
import com.hellojava.dao.BusinessDao.CommodityRepository;
import com.hellojava.entity.Commodity;
import com.hellojava.response.CommonCode;
import com.hellojava.response.QueryResponseResult;
import com.hellojava.response.QueryResult;
import com.hellojava.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Service
public class CommodityServiceImpl implements CommodityService {
@Autowired
private CommodityRepository commodityRepository;
@Override
public QueryResponseResult loadById(int comId) {
Optional<Commodity> byId = commodityRepository.findById(comId);
List<Commodity> C = new ArrayList<>();
if (byId.isPresent()){
Commodity commodity = new Commodity();
commodity.setComId(byId.get().getComId());
commodity.setComName(byId.get().getComName());
commodity.setComImg(byId.get().getComImg());
commodity.setComPrice(byId.get().getComPrice());
commodity.setComSalesPerMonth(byId.get().getComSalesPerMonth());
commodity.setComBus(byId.get().getComBus());
C.add(commodity);
}
QueryResult<Commodity> commodityQueryResult = new QueryResult<>();
commodityQueryResult.setList(C);
return new QueryResponseResult<>(CommonCode.SUCCESS,commodityQueryResult);
}
@Override
public QueryResponseResult findAllBycomBus(int comBus) {
List<Commodity> Commoditys = commodityRepository.findAllBycomBus(comBus);
QueryResult<Commodity> commodityQueryResult = new QueryResult<>();
commodityQueryResult.setList(Commoditys);
return new QueryResponseResult<>(CommonCode.SUCCESS,commodityQueryResult);
}
}
| [
"1808758100@qq.com"
] | 1808758100@qq.com |
bfbc0de2a11b4bbeaa08c50a93ae66a0f5d3eeb4 | 1ccbba94f0188d3252a3ab0fe8170abf504171ce | /design_pattern/src/main/java/com/design/demo/creatorPattern/factory/manoeuvre/Product.java | e984af4e8518cf7dfa9478977cc7ee636498bb23 | [] | no_license | cleverwo/codeDemo | 4a1b57d270d43a558db30ff62014a1215abcad37 | bf33a17560fea4f1df8fa99ee9906718f549d8fd | refs/heads/master | 2023-07-04T00:26:04.067698 | 2023-06-16T15:57:24 | 2023-06-16T15:57:24 | 220,234,117 | 1 | 0 | null | 2022-06-29T18:50:05 | 2019-11-07T12:39:36 | Java | UTF-8 | Java | false | false | 353 | java | package com.design.demo.creatorPattern.factory.manoeuvre;
/**
* @Auther: wangzhendong
* @Date: 2019/10/11 19:25
* @Description:
*/
public abstract class Product {
//产品共有逻辑
public void method(){
//公共逻辑
System.out.println("product start");
}
//抽象方法
public abstract void method2();
}
| [
"1041329432@qq.com"
] | 1041329432@qq.com |
dce4db1c989da2c3bb10531b8cc7910eb431cc5e | a7b64f2cf2a780654b09a083ee190067c4918686 | /DesignPattern/src/main/java/observer/Command.java | 541d589f47f39b77961f8dc34e5d05a0a72a34e6 | [] | no_license | Eyecandy/Design-Patterns- | d63d7b9e4c29d0f511b2131c6c9dc9a57a0a9945 | 8e42eee765c8d0af64cbc586935642ee6cb5f55f | refs/heads/master | 2020-03-09T00:45:36.777427 | 2018-07-28T10:50:41 | 2018-07-28T10:50:41 | 128,496,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 109 | java | package observer;
public enum Command {
FORM_POSITIONS,
COMBAT_FORMATION,
FIRE,
CHARGE
}
| [
"joakim.nilfjord@gmail.com"
] | joakim.nilfjord@gmail.com |
73fc2ceee37280a474649bcb598ec085473a255b | 0fdd5270dc26b1635f9249a2f3712b353167e72a | /oauth2-sso/oauth2-sso-server/src/test/java/com/liaozl/demo/oauth2sso/server/Oauth2SsoServerApplicationTests.java | 21fd78b015c7a001742bdfc16c71d9d2ea0a026f | [] | no_license | liaozuliang/liaozl-demo | 30486e881fd271beaad514f76f82fa362f7b3724 | 04797a9768a1eab1c4bb3ad15d9a36badcf212bd | refs/heads/master | 2022-06-29T07:03:53.013221 | 2020-08-14T04:29:15 | 2020-08-14T04:29:15 | 187,561,053 | 0 | 0 | null | 2022-06-21T01:10:08 | 2019-05-20T03:23:08 | Java | UTF-8 | Java | false | false | 242 | java | package com.liaozl.demo.oauth2sso.server;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class Oauth2SsoServerApplicationTests {
@Test
void contextLoads() {
}
}
| [
"liaozuliang@zywamail.com"
] | liaozuliang@zywamail.com |
b3acf659201d4dafe4a3c24b8e954a00040f6dd0 | fe13060de7bac91c9b38f5b4b8c169e4e69ce626 | /common/BlockCS.java | 7f5b16f0378fa4b53e1ab2499a9ff2bb704916e2 | [] | no_license | ADennis87/Dimension-Mod | 6795e40e870719fb55d442ed4779407a46eb1343 | 3f2b99d70a98e25e506bbf49548cc83217edf6d5 | refs/heads/master | 2021-01-01T18:54:09.289800 | 2013-01-03T23:32:18 | 2013-01-03T23:32:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 991 | java | package ninjapancakes87.morestuff.common;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.src.*;
import net.minecraft.world.World;
public class BlockCS extends Block {
public BlockCS(int par1, int par2){
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(15);
this.setResistance(15F);
this.setStepSound(this.soundMetalFootstep);
}
/*public int GetBlockTextureFromSideAndMetadata (int i, int j){
switch(i){
case 1: mod_MoreStuff.CSTop;
defualt: mod_MoreStuff.CSSide;
}
}*/
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer) {
ModLoader.openGUI(entityplayer, new GUIComponetSeperator(null));
}
@Override
public String getTextureFile(){
return "/gfx/MoreStuff/blocks.png";
}
} | [
"inhoppancakes@gmail.com"
] | inhoppancakes@gmail.com |
0b10041a26f8b5139578fa7da61092e265477412 | c01611b15315e4e32b978fe55df53694de7d80dd | /generator/src/main/java/net/matthoyt/database/writer/csharp/ColumnProcessor.java | b470562ddaa59ea20485fb5243e207f37fe62644 | [
"Apache-2.0"
] | permissive | mrh0057/mrh-database | 2ae6fe41f729439d817a49caa7352dba8ab23efe | 7a83b3bf75edea33d67d6ecf3b4e10eb02dcc144 | refs/heads/master | 2020-12-24T15:49:55.649056 | 2016-03-20T01:04:44 | 2016-03-20T01:04:44 | 39,911,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,160 | java | package net.matthoyt.database.writer.csharp;
import net.matthoyt.database.writer.Column;
import net.matthoyt.database.writer.DbGen;
import net.matthoyt.database.writer.Helpers;
import net.matthoyt.database.writer.SqlTranslation;
import java.util.ArrayList;
import java.util.List;
public class ColumnProcessor
{
/**
* Used to process the columns for the dbgen information.
*
* @param dbGen The config generation information.
* @return The columns to generate.
*/
public static CsharpModel processColumns(CsharpModel model, DbGen dbGen)
{
List<CsharpColumn> csharpColumns = new ArrayList<>(dbGen.columns.length);
List<CsharpColumn> insertColumns = new ArrayList<>(dbGen.columns.length);
List<CsharpColumn> updateColumns = new ArrayList<>(dbGen.columns.length);
for (Column column : dbGen.columns)
{
CsharpColumn csharpColumn = new CsharpColumn();
csharpColumns.add(csharpColumn);
csharpColumn.name = NameCleaner.cleanName(column.name);
csharpColumn.rawName = column.name;
csharpColumn.isAutoIncrement = column.isAutoIncrement;
csharpColumn.isReadOnly = column.isReadOnly;
csharpColumn.isPrimaryKey = dbGen.primaryKeys.contains(column.name);
if (dbGen.primaryKeys.contains(column.name))
{
model.primaryKey = csharpColumn;
}
csharpColumn.isNullable = column.isNullable;
SqlTranslation dataType = SqlToCsharpTypes.SqlTypeToDatType(column.type);
SqlTranslation readFunction = SqlToCsharpTypes.SqlTypeToRead(column.type);
if (column.isNullable)
{
csharpColumn.dataType = dataType.nullableType;
csharpColumn.rawDataType = dataType.valueType;
csharpColumn.readFunction = readFunction.nullableType;
} else
{
csharpColumn.dataType = dataType.valueType;
csharpColumn.rawDataType = dataType.valueType;
csharpColumn.readFunction = readFunction.valueType;
}
if (dbGen.enumModels.containsKey(column.name))
{
csharpColumn.dataType = Helpers.concatCbased(dbGen.enumModels.get(column.name));
csharpColumn.castType = true;
if (column.isNullable)
{
csharpColumn.dataType += "?";
}
}
csharpColumn.offset = column.offset;
if (!column.isAutoIncrement && column.isWriteAble)
{
insertColumns.add(csharpColumn);
if (!dbGen.primaryKeys.contains(column.name))
{
updateColumns.add(csharpColumn);
}
}
}
model.columns = csharpColumns.toArray(new CsharpColumn[csharpColumns.size()]);
model.insertColumns = insertColumns.toArray(new CsharpColumn[insertColumns.size()]);
model.updateColumns = updateColumns.toArray(new CsharpColumn[updateColumns.size()]);
return model;
}
}
| [
"mrhoyt@firstcommand.com"
] | mrhoyt@firstcommand.com |
9c9b4a78bf11a0e8de2bf496f19539a2e11d89da | e75567eb17e621a20b537ca060eef437da6f91de | /cooperativa-model/cooperativa-model-api/src/main/java/org/sistcoop/cooperativa/models/DetalleTransaccionClienteModel.java | 81dd411f60b4535130837f8f71a7a5ceb7c605f0 | [] | no_license | sistcoop/cooperativa | 2e9019cb54f8f0ec5fbccfede49b33ffb0691562 | 6b579b89a22725865c1f4fee6aebcd745a7e292e | refs/heads/master | 2016-09-03T06:33:26.543651 | 2015-10-22T22:56:11 | 2015-10-22T22:56:11 | 33,275,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package org.sistcoop.cooperativa.models;
import java.math.BigDecimal;
public interface DetalleTransaccionClienteModel extends Model {
String getId();
BigDecimal getValor();
int getCantidad();
BigDecimal getSubtotal();
TransaccionClienteModel getTransaccionCliente();
}
| [
"carlosthe19916@gmail.com"
] | carlosthe19916@gmail.com |
ee93d3d3eed3d15ecc4f2ef7301af37790830624 | 221007e767048fe39c4a6554d76ffa9d1fa76ce4 | /app/src/androidTest/java/com/ckc/ersin/bebetrack/ApplicationTest.java | 999219d58d166edae9f88f29eb5d911b5c8f21fd | [] | no_license | ersin88888/bebetrack | a2d07e45eeefb6ffef01637bd253f459e8e328ea | bc0b68fe6f2acac582a55490b4bc7bdc88aab91d | refs/heads/master | 2021-01-10T11:50:14.715699 | 2016-02-14T16:54:26 | 2016-02-14T16:54:26 | 51,699,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.ckc.ersin.bebetrack;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"goldendragon8812@gmail.com"
] | goldendragon8812@gmail.com |
c587505c3ebbb686b3ab1b80fbe528cf932c99b7 | ab768051ac546be7075a0d62d46b93bd72b9e77c | /src/main/java/com/javatpoint/SpringBootJpaApplication.java | 3af4d5535b836477001fc3e6261ef9568c043434 | [] | no_license | NasserAAA/integrantTraining | 5a99cf6f1e0b18f1f0d063c775ef2fb05f87e7d6 | e8401507fcdc1716f33c1dd7ded4dfeea6096a76 | refs/heads/master | 2020-07-16T23:29:52.307503 | 2019-09-02T11:58:45 | 2019-09-02T11:58:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,212 | java | package com.javatpoint;
import java.util.Properties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import kafka.javaapi.producer.Producer;
import kafka.producer.ProducerConfig;
@EnableAutoConfiguration(exclude = {SecurityAutoConfiguration.class})
@SpringBootApplication
public class SpringBootJpaApplication {
public static void main(String[] args) throws InterruptedException {
ConfigurableApplicationContext context =SpringApplication.run(SpringBootJpaApplication.class, args);
String api=args[1];
String apiSecret=args[2];
String accessToken=args[3];
String accessTokenSecret=args[4];
Thread myThread=new Thread(new Runnable() {
@Override
public void run() {
TwitterKafkaConsumer tfc=context.getBean(TwitterKafkaConsumer.class);
tfc.initialize();
tfc.consume();
}
});
Thread myThread2=new Thread(new Runnable() {
@Override
public void run() {
TwitterKafkaProducer tfp= context.getBean(TwitterKafkaProducer.class);
Properties props = new Properties();
props.put("metadata.broker.list","localhost:9092");
props.put("serializer.class","kafka.serializer.StringEncoder");
props.put("bootstrap.servers", "localhost:9092");
tfp.initializeSentiment();
ProducerConfig producerConfig = new ProducerConfig(props);
Producer<String, String>producer = new Producer<String, String>(producerConfig);
try {
tfp.PushTwittermessage(producer,api, apiSecret, accessToken, accessTokenSecret);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
myThread.start();
myThread2.start();
}
@Bean
public TwitterKafkaConsumer twitterConsumer() {
return new TwitterKafkaConsumer();
}
} | [
"marwanayman1998@gmail.com"
] | marwanayman1998@gmail.com |
0019dfae7d28130bd4cde3495cd049d539ab868d | 2f035028c4dab2ee905cc7a9463df718ecd81a49 | /src/main/java/com/github/havardh/javaflow/phases/verifier/ClassGetterNamingVerifier.java | a1c5afade28e5808f30943bb7aae898f274ae0aa | [] | no_license | misino/javaflow | bfff41d53a89c10ee2ba2ceac35462d2b544b4dd | 63d9edbb94688903691a33ad0ac3c2b4754f2a0e | refs/heads/master | 2021-01-19T23:41:28.460220 | 2018-08-15T22:13:39 | 2018-08-15T22:13:39 | 89,010,550 | 0 | 0 | null | 2017-04-21T18:02:19 | 2017-04-21T18:02:19 | null | UTF-8 | Java | false | false | 3,278 | java | package com.github.havardh.javaflow.phases.verifier;
import static java.lang.String.format;
import static java.util.Collections.singletonList;
import java.util.ArrayList;
import java.util.List;
import com.github.havardh.javaflow.ast.Class;
import com.github.havardh.javaflow.ast.Field;
import com.github.havardh.javaflow.ast.Method;
import com.github.havardh.javaflow.ast.Type;
import com.github.havardh.javaflow.exceptions.AggregatedException;
import com.github.havardh.javaflow.exceptions.FieldGettersMismatchException;
public class ClassGetterNamingVerifier implements Verifier {
@Override
public void verify(List<Type> types) {
List<Exception> exceptions = new ArrayList<>();
for (Type type : types) {
if (type instanceof Class) {
exceptions.addAll(validate((Class) type));
}
}
if (!exceptions.isEmpty()) {
throw new AggregatedException("Class getter naming validation failed with following errors:\n", exceptions, true);
}
}
private List<Exception> validate(Class classToValidate) {
List<Method> getters = classToValidate.getGetters();
List<Field> fields = classToValidate.getFields();
if (getters.size() != fields.size()) {
return singletonList(new FieldGettersMismatchException(classToValidate.getCanonicalName(), format(
"Number of getters and fields is not the same.\n" +
"Fields in model: %s\n" +
"Getters in model: %s",
fields,
getters
)));
}
List<Exception> exceptions = new ArrayList<>();
for (Method getter : getters) {
try {
Field correspondingField = findFieldByGetter(classToValidate, fields, getter);
if (!correspondingField.getType().equals(getter.getType())) {
throw new FieldGettersMismatchException(
classToValidate.getCanonicalName(),
format(
"Type of getter %s (%s) does not correspond to field %s (%s)",
getter.getName(),
getter.getType(),
correspondingField.getName(),
correspondingField.getType()
)
);
}
} catch (FieldGettersMismatchException e) {
exceptions.add(e);
}
}
return exceptions;
}
private Field findFieldByGetter(Class classToValidate, List<Field> fields, Method getter)
throws FieldGettersMismatchException {
return fields.stream()
.filter(field -> field.getName().equals(convertGetterNameToFieldName(getter.getName())))
.findFirst()
.orElseThrow(() -> new FieldGettersMismatchException(
classToValidate.getCanonicalName(),
format("Name of getter %s does not correspond to any field name.", getter.getName())
));
}
private static String convertGetterNameToFieldName(String getterName) {
if (getterName.startsWith("get") && getterName.length() > 3) {
return Character.toLowerCase(getterName.charAt(3)) + (getterName.length() > 4 ? getterName.substring(4) : "");
}
if (getterName.startsWith("is") && getterName.length() > 2) {
return Character.toLowerCase(getterName.charAt(2)) + (getterName.length() > 4 ? getterName.substring(3) : "");
}
return getterName;
}
}
| [
"havardwhoiby@gmail.com"
] | havardwhoiby@gmail.com |
e12e0c2d75bf9c7d8f5f554d359d64de857f0fcd | 5bf355448f4e5d823e972741ce096b654ef88faf | /EconomyNPC/src/com/resolutiongaming/util/TokenHandler.java | b86876c47a64ecea9444c684c72b85a279dc9120 | [] | no_license | pdelcol/EconomyNPC | ee7f169b75be8d6090fbc0cbe7891a43be452ff6 | 1350f093815dac09df238634a92810b61d4ac65a | refs/heads/master | 2021-05-28T01:22:05.343490 | 2014-05-14T04:38:34 | 2014-05-14T04:38:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,948 | java | package com.resolutiongaming.util;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;
public class TokenHandler {
public Map<String, Integer> tokens = new HashMap<String, Integer>();
//Constructor
public TokenHandler()
{
//We dont need anything here for right now
}
//Load the tokens
public void load()
{
try
{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("plugins/EconomyNPC/Token_List.bin"));
Object result = ois.readObject();
tokens = (Map<String, Integer>)result;
ois.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
//Save the tokens
public void save()
{
try
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("plugins/EconomyNPC/Token_List.bin"));
oos.writeObject(tokens);
oos.flush();
oos.close();
//Handle I/O exceptions
}
catch(Exception e)
{
e.printStackTrace();
}
}
//Check to see if the player is in the token list
public void checkName(String playerName)
{
if(!tokens.containsKey(playerName))
{
tokens.put(playerName, 0);
}
}
//Get the number of tokens for a given player
public int getNumTokens(String playerName)
{
if(tokens.get(playerName) == null)
{
tokens.put(playerName, 0);
}
return tokens.get(playerName);
}
//Add tokens to a given players account
public void addTokens(String playerName, int numTokens)
{
if(tokens.containsKey(playerName))
{
tokens.put(playerName, tokens.get(playerName) + numTokens);
}
}
//Remove tokens from a given players account
public boolean removeTokens(String playerName, int numTokens)
{
if(tokens.containsKey(playerName))
{
if(tokens.get(playerName) >= numTokens){
tokens.put(playerName, tokens.get(playerName) - numTokens);
return true;
}
return false;
}
return false;
}
}
| [
"pete800@optonline.net"
] | pete800@optonline.net |
d10c0c7ecf5eb534350fd8545defc71fbe11f856 | dfafddba00d2ec44be4f17f9352f1b45a818eb9d | /src/com/puwd/behavior/strategy/behavior/color/WhiteColorBehavior.java | b4b7b317a781a203625507363ace36c2b0161ed1 | [] | no_license | puwd-git/design-pattern | abdb6d9ded2815626fe98ebf0eda11a66b9dd562 | 3d8e7f7b543232fcfd1ec03d66e6dd56da7bc573 | refs/heads/master | 2023-03-27T12:19:42.085607 | 2021-03-24T12:18:46 | 2021-03-24T12:18:46 | 350,239,905 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.puwd.behavior.strategy.behavior.color;
import com.puwd.behavior.strategy.behavior.color.ColorBehavior;
/**
* @author Administrator
*/
public class WhiteColorBehavior implements ColorBehavior {
@Override
public void color() {
System.out.println("白色的!");
}
}
| [
"543071857@qq.com"
] | 543071857@qq.com |
bff96979afcff5835285578d8597b1b18dbf084c | 64487c6237d2558ea5910b4132def37627d4557e | /acmesky_source_code/acmesky_java_camunda/src/main/java/it/unibo/soseng/cliente/SendInterestService.java | 4dd3a788b77187ba56aaf1ec5c8e43c70490ad61 | [
"Apache-2.0"
] | permissive | MickPerl/Service-Oriented-Architecture-Project | 35d0878b0d51f026a5ed6dec6f66afdc2509a7c3 | f8cdad7766d3453d2ce13350ca1af3cea0724653 | refs/heads/main | 2023-08-11T09:46:52.364728 | 2021-10-08T22:54:28 | 2021-10-08T22:54:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,382 | java | package it.unibo.soseng.cliente;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
public class SendInterestService {
private static SimpleDateFormat sdt = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
public SendInterestService() {
}
private static String[] airports = {"BLQ",
"BGY",
"CTA",
"MXP",
"VRN",
"FCO",
"LGW",
"FRA",
"BCN",
"LIS",
"AUH",
"SVO",
"ORY"};
public static void service(DelegateExecution execution) {
Transazione t = new Transazione("");
Cliente c = new Cliente("");
c.payment_password = "1234567890";
String username = "";
if (execution.getVariable("customInterest") != null) {
try {
username = execution.getVariable("username").toString();
t.username = username;
c.payment_username = username;
StaticValues.clienti.put(username, c);
StaticValues.transazioni.add(t);
if (execution.getVariable("secondDate") != null && !execution.getVariable("secondDate").toString().isEmpty()) {
execution.getProcessEngine().getRuntimeService().createMessageCorrelation("GetInterests")
.setVariable("departure_airport", execution.getVariable("first_airport"))
.setVariable("arrival_airport", execution.getVariable("second_airport"))
.setVariable("departure_time_min", sdt.format(sdt.parse(execution.getVariable("firstDate").toString())))
.setVariable("departure_time_max", sdt.format(sdt.parse(execution.getVariable("firstDateInterval").toString())))
.setVariable("arrival_time_min", sdt.format(sdt.parse(execution.getVariable("secondDate").toString())))
.setVariable("arrival_time_max", sdt.format(sdt.parse(execution.getVariable("secondDateInterval").toString())))
.setVariable("client_id", execution.getVariable("username"))
.setVariable("clientAddress", execution.getVariable("clientAddress"))
.setVariable("cost", execution.getVariable("max_price"))
.correlate();
} else {
execution.getProcessEngine().getRuntimeService().createMessageCorrelation("GetInterests")
.setVariable("departure_airport", execution.getVariable("first_airport"))
.setVariable("arrival_airport", execution.getVariable("second_airport"))
.setVariable("departure_time_min", sdt.format(sdt.parse(execution.getVariable("firstDate").toString())))
.setVariable("departure_time_max", sdt.format(sdt.parse(execution.getVariable("firstDateInterval").toString())))
.setVariable("client_id", execution.getVariable("username"))
.setVariable("clientAddress", execution.getVariable("clientAddress"))
.setVariable("cost", execution.getVariable("max_price"))
.correlate();
}
execution.removeVariable("customInterest");
} catch(Exception e) {
e.printStackTrace();
}
} else {
t.username = "mariorossi".concat(String.valueOf(StaticValues.contatore_mario_rossi));
username = t.username;
c.payment_username = "mariorossi".concat(String.valueOf(StaticValues.contatore_mario_rossi++));
StaticValues.clienti.put(username, c);
StaticValues.transazioni.add(t);
RuntimeService runtimeService = execution.getProcessEngine().getRuntimeService();
//genera la prima data e un intervallo di tempo casualmente; poi calcola la seconda data
int year = 2021;
int min_month = 0;
int max_month = 11;
int min_day = 1;
int max_day = 31;
int min_period = 1;
int max_period = 60;
int month_range = max_month - min_month + 1;
int day_range = max_day - min_day + 1;
int period_range = max_period - min_period + 1;
// generate random numbers within 1 to 10
Calendar calendar = Calendar.getInstance();
Date firstDate, secondDate;
calendar.setLenient(false);
while(true) {
try {
firstDate = calendar.getTime();
int rand_period = (int)(Math.random() * period_range) + min_period;
calendar.add(Calendar.DATE, rand_period);
secondDate = calendar.getTime();
break;
} catch(Exception e ) {
continue;
}
}
//genera un prezzo massimo
//genera prezzi tra 200 e 1000
int max_price = (int)(Math.random() * 800)+200;
//prendi due aeroporti a caso
int first_airport_index = (int)(Math.random()*airports.length), second_airport_index;
do {
second_airport_index = (int)(Math.random()*airports.length);
} while (second_airport_index == first_airport_index);
String first_airport = airports[first_airport_index];
String second_airport = airports[second_airport_index];
//NOTA: date.getYear() restituisce l'anno, meno 1900. SIa maledetto chiunque sia l'impiegato alla sun che l'ha deciso
calendar.set(firstDate.getYear()+1900, firstDate.getMonth(), firstDate.getDate());
calendar.add(Calendar.DAY_OF_MONTH, 5);
Date firstDateInterval = calendar.getTime();
calendar.set(secondDate.getYear()+1900, secondDate.getMonth(), secondDate.getDate());
calendar.add(Calendar.DAY_OF_MONTH, 5);
Date secondDateInterval = calendar.getTime();
//Scegliamo due date, una di arrivo e una di ripartenza; c'è una tolleranza di 5 giorni su entrambe
//es. possiamo partire tra il 1 gennaio e il 6 gennaio, e ritornare tra il 20 gennaio e il 25 gennaio
runtimeService.createMessageCorrelation("GetInterests")
.setVariable("departure_airport", first_airport)
.setVariable("arrival_airport", second_airport)
.setVariable("departure_time_min", sdt.format(firstDate))
.setVariable("departure_time_max", sdt.format(firstDateInterval))
.setVariable("arrival_time_min", sdt.format(secondDate))
.setVariable("arrival_time_max", sdt.format(secondDateInterval))
.setVariable("client_id", t.username )
.setVariable("clientAddress", "via indipendenza 1, bologna, italia")
.setVariable("cost", max_price)
.correlate();
}
}
}
| [
"micheleperlino@gmail.com"
] | micheleperlino@gmail.com |
0699c15d0e9b79613b2ca6b626e6b406d20f6d91 | ad5b11ce6186ca76bf4098852d34b4a806906b1f | /zhao_sheng/src/main/java/com/yfy/app/album/SingePicShowActivity.java | bbd64b8384c0406bb999e0be574111e68d29fce0 | [] | no_license | Zhaoxianxv/zhao_sheng1 | 700666c2589529aee9a25597f63cc6a07dcfe78c | 9fdd9512bf38fcfe4ccbe197034a006a3d053c66 | refs/heads/master | 2022-12-14T03:07:48.096666 | 2020-09-06T03:36:17 | 2020-09-06T03:36:17 | 291,885,920 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,775 | java | package com.yfy.app.album;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.example.zhao_sheng.R;
import com.yfy.base.activity.BaseActivity;
import com.yfy.final_tag.TagFinal;
import com.yfy.final_tag.glide.GlideTools;
import com.yfy.view.image.PinchImageView;
public class SingePicShowActivity extends BaseActivity {
private String url,title;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.singe_pic_show);
getData();
initSQToolbar();
}
private void initSQToolbar() {
Toolbar toolbar= (Toolbar) findViewById(R.id.show_pic_one_title_bar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (title!=null){
toolbar.setTitle(title);
}else{
toolbar.setTitle("返回");
}
toolbar.setNavigationIcon(R.drawable.ic_left_nav);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
public void getData(){
Bundle b = getIntent().getExtras();
if (b != null) {
if (b.containsKey(TagFinal.ALBUM_SINGE_URI)) {
url = b.getString(TagFinal.ALBUM_SINGE_URI);
}
if (b.containsKey("title")) {
title = b.getString("title");
}
}
initView();
}
public void initView(){
PinchImageView imageView= (PinchImageView) findViewById(R.id.big_url_pic);
GlideTools.loadImage(mActivity,url,imageView);
}
}
| [
"1006584058@qq.com"
] | 1006584058@qq.com |
5cd5c77e51cfa538a4cb1b26913da60b28e87c84 | 0adb936c478c6c7618cbfe0d16850030ab7dde1b | /src/main/java/gov/nih/nlm/ncbi/SplicedSeg.java | 1c83741950d2bdf575b98ecefcb2fbbddffcd2bd | [] | no_license | milton900807/arraybase | f4c613205125a0de0d8bbe2c4f080073c382f247 | 11ac473089877b15aae437f476502b2d65291f75 | refs/heads/master | 2023-06-05T02:09:31.541576 | 2021-07-03T18:02:03 | 2021-07-03T18:02:03 | 382,672,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,850 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.06.18 at 09:24:32 PM PDT
//
package gov.nih.nlm.ncbi;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Spliced-seg_product-id" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Seq-id"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_genomic-id" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Seq-id"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_product-strand" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Na-strand"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_genomic-strand" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Na-strand"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_product-type">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="value" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="transcript"/>
* <enumeration value="protein"/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_exons">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence maxOccurs="unbounded" minOccurs="0">
* <element ref="{http://www.ncbi.nlm.nih.gov}Spliced-exon"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Spliced-seg_poly-a" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
* <element name="Spliced-seg_product-length" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
* <element name="Spliced-seg_modifiers" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence maxOccurs="unbounded" minOccurs="0">
* <element ref="{http://www.ncbi.nlm.nih.gov}Spliced-seg-modifier"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"splicedSegProductId",
"splicedSegGenomicId",
"splicedSegProductStrand",
"splicedSegGenomicStrand",
"splicedSegProductType",
"splicedSegExons",
"splicedSegPolyA",
"splicedSegProductLength",
"splicedSegModifiers"
})
@XmlRootElement(name = "Spliced-seg")
public class SplicedSeg {
@XmlElement(name = "Spliced-seg_product-id")
protected SplicedSeg.SplicedSegProductId splicedSegProductId;
@XmlElement(name = "Spliced-seg_genomic-id")
protected SplicedSeg.SplicedSegGenomicId splicedSegGenomicId;
@XmlElement(name = "Spliced-seg_product-strand")
protected SplicedSeg.SplicedSegProductStrand splicedSegProductStrand;
@XmlElement(name = "Spliced-seg_genomic-strand")
protected SplicedSeg.SplicedSegGenomicStrand splicedSegGenomicStrand;
@XmlElement(name = "Spliced-seg_product-type", required = true)
protected SplicedSeg.SplicedSegProductType splicedSegProductType;
@XmlElement(name = "Spliced-seg_exons", required = true)
protected SplicedSeg.SplicedSegExons splicedSegExons;
@XmlElement(name = "Spliced-seg_poly-a")
protected BigInteger splicedSegPolyA;
@XmlElement(name = "Spliced-seg_product-length")
protected BigInteger splicedSegProductLength;
@XmlElement(name = "Spliced-seg_modifiers")
protected SplicedSeg.SplicedSegModifiers splicedSegModifiers;
/**
* Gets the value of the splicedSegProductId property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegProductId }
*
*/
public SplicedSeg.SplicedSegProductId getSplicedSegProductId() {
return splicedSegProductId;
}
/**
* Sets the value of the splicedSegProductId property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegProductId }
*
*/
public void setSplicedSegProductId(SplicedSeg.SplicedSegProductId value) {
this.splicedSegProductId = value;
}
/**
* Gets the value of the splicedSegGenomicId property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegGenomicId }
*
*/
public SplicedSeg.SplicedSegGenomicId getSplicedSegGenomicId() {
return splicedSegGenomicId;
}
/**
* Sets the value of the splicedSegGenomicId property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegGenomicId }
*
*/
public void setSplicedSegGenomicId(SplicedSeg.SplicedSegGenomicId value) {
this.splicedSegGenomicId = value;
}
/**
* Gets the value of the splicedSegProductStrand property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegProductStrand }
*
*/
public SplicedSeg.SplicedSegProductStrand getSplicedSegProductStrand() {
return splicedSegProductStrand;
}
/**
* Sets the value of the splicedSegProductStrand property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegProductStrand }
*
*/
public void setSplicedSegProductStrand(SplicedSeg.SplicedSegProductStrand value) {
this.splicedSegProductStrand = value;
}
/**
* Gets the value of the splicedSegGenomicStrand property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegGenomicStrand }
*
*/
public SplicedSeg.SplicedSegGenomicStrand getSplicedSegGenomicStrand() {
return splicedSegGenomicStrand;
}
/**
* Sets the value of the splicedSegGenomicStrand property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegGenomicStrand }
*
*/
public void setSplicedSegGenomicStrand(SplicedSeg.SplicedSegGenomicStrand value) {
this.splicedSegGenomicStrand = value;
}
/**
* Gets the value of the splicedSegProductType property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegProductType }
*
*/
public SplicedSeg.SplicedSegProductType getSplicedSegProductType() {
return splicedSegProductType;
}
/**
* Sets the value of the splicedSegProductType property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegProductType }
*
*/
public void setSplicedSegProductType(SplicedSeg.SplicedSegProductType value) {
this.splicedSegProductType = value;
}
/**
* Gets the value of the splicedSegExons property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegExons }
*
*/
public SplicedSeg.SplicedSegExons getSplicedSegExons() {
return splicedSegExons;
}
/**
* Sets the value of the splicedSegExons property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegExons }
*
*/
public void setSplicedSegExons(SplicedSeg.SplicedSegExons value) {
this.splicedSegExons = value;
}
/**
* Gets the value of the splicedSegPolyA property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getSplicedSegPolyA() {
return splicedSegPolyA;
}
/**
* Sets the value of the splicedSegPolyA property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setSplicedSegPolyA(BigInteger value) {
this.splicedSegPolyA = value;
}
/**
* Gets the value of the splicedSegProductLength property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getSplicedSegProductLength() {
return splicedSegProductLength;
}
/**
* Sets the value of the splicedSegProductLength property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setSplicedSegProductLength(BigInteger value) {
this.splicedSegProductLength = value;
}
/**
* Gets the value of the splicedSegModifiers property.
*
* @return
* possible object is
* {@link SplicedSeg.SplicedSegModifiers }
*
*/
public SplicedSeg.SplicedSegModifiers getSplicedSegModifiers() {
return splicedSegModifiers;
}
/**
* Sets the value of the splicedSegModifiers property.
*
* @param value
* allowed object is
* {@link SplicedSeg.SplicedSegModifiers }
*
*/
public void setSplicedSegModifiers(SplicedSeg.SplicedSegModifiers value) {
this.splicedSegModifiers = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence maxOccurs="unbounded" minOccurs="0">
* <element ref="{http://www.ncbi.nlm.nih.gov}Spliced-exon"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"splicedExon"
})
public static class SplicedSegExons {
@XmlElement(name = "Spliced-exon")
protected List<SplicedExon> splicedExon;
/**
* Gets the value of the splicedExon property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the splicedExon property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSplicedExon().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SplicedExon }
*
*
*/
public List<SplicedExon> getSplicedExon() {
if (splicedExon == null) {
splicedExon = new ArrayList<SplicedExon>();
}
return this.splicedExon;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Seq-id"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"seqId"
})
public static class SplicedSegGenomicId {
@XmlElement(name = "Seq-id", required = true)
protected SeqId seqId;
/**
* Gets the value of the seqId property.
*
* @return
* possible object is
* {@link SeqId }
*
*/
public SeqId getSeqId() {
return seqId;
}
/**
* Sets the value of the seqId property.
*
* @param value
* allowed object is
* {@link SeqId }
*
*/
public void setSeqId(SeqId value) {
this.seqId = value;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Na-strand"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"naStrand"
})
public static class SplicedSegGenomicStrand {
@XmlElement(name = "Na-strand", required = true)
protected NaStrand naStrand;
/**
* Gets the value of the naStrand property.
*
* @return
* possible object is
* {@link NaStrand }
*
*/
public NaStrand getNaStrand() {
return naStrand;
}
/**
* Sets the value of the naStrand property.
*
* @param value
* allowed object is
* {@link NaStrand }
*
*/
public void setNaStrand(NaStrand value) {
this.naStrand = value;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence maxOccurs="unbounded" minOccurs="0">
* <element ref="{http://www.ncbi.nlm.nih.gov}Spliced-seg-modifier"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"splicedSegModifier"
})
public static class SplicedSegModifiers {
@XmlElement(name = "Spliced-seg-modifier")
protected List<SplicedSegModifier> splicedSegModifier;
/**
* Gets the value of the splicedSegModifier property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the splicedSegModifier property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSplicedSegModifier().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SplicedSegModifier }
*
*
*/
public List<SplicedSegModifier> getSplicedSegModifier() {
if (splicedSegModifier == null) {
splicedSegModifier = new ArrayList<SplicedSegModifier>();
}
return this.splicedSegModifier;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Seq-id"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"seqId"
})
public static class SplicedSegProductId {
@XmlElement(name = "Seq-id", required = true)
protected SeqId seqId;
/**
* Gets the value of the seqId property.
*
* @return
* possible object is
* {@link SeqId }
*
*/
public SeqId getSeqId() {
return seqId;
}
/**
* Sets the value of the seqId property.
*
* @param value
* allowed object is
* {@link SeqId }
*
*/
public void setSeqId(SeqId value) {
this.seqId = value;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.ncbi.nlm.nih.gov}Na-strand"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"naStrand"
})
public static class SplicedSegProductStrand {
@XmlElement(name = "Na-strand", required = true)
protected NaStrand naStrand;
/**
* Gets the value of the naStrand property.
*
* @return
* possible object is
* {@link NaStrand }
*
*/
public NaStrand getNaStrand() {
return naStrand;
}
/**
* Sets the value of the naStrand property.
*
* @param value
* allowed object is
* {@link NaStrand }
*
*/
public void setNaStrand(NaStrand value) {
this.naStrand = value;
}
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="value" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="transcript"/>
* <enumeration value="protein"/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public static class SplicedSegProductType {
@XmlAttribute(name = "value", required = true)
protected String value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
}
}
| [
"JMilton@ionisph.com"
] | JMilton@ionisph.com |
b528c9b551e2b5cdc9eae3cfa1c37a5f32054c6c | b744465494b27c06e653dd3f409c0ba311326bde | /src/gol/ui/GridEvent.java | dd84da59d404e2018d1d978dac36500e93fecb5b | [] | no_license | Knifa/GameOfLife | 4df6f88834f72f64f6b71306803d74d9ee3cc3e5 | b35cdd90b09b245dddae45176dc2dd234dd9ae23 | refs/heads/master | 2020-06-04T15:57:24.522498 | 2013-02-10T00:18:33 | 2013-02-10T00:18:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package gol.ui;
import java.util.EventObject;
/**
* Event fired when a ColorGrid is clicked on.
*/
public class GridEvent extends EventObject {
private int x;
private int y;
/**
* Constructor.
* @param source Source of this event.
* @param x X-coord where the grid was clicked on.
* @param y Y-coord where the grid was clicked on.
*/
public GridEvent(Object source, int x, int y) {
super(source);
this.x = x;
this.y = y;
}
/**
* Returns the grid X-coord.
* @return Grid X-coord.
*/
public int getX() {
return this.x;
}
/**
* Returns the grid Y-coord.
* @return Grid Y-coord.
*/
public int getY() {
return this.y;
}
} | [
"knifacat@gmail.com"
] | knifacat@gmail.com |
57aab9af03414ce8e562123addc2b00f714ffb25 | 2bc88a24998687d5284334061b0a4e6b0c1f77ba | /app/src/main/java/ffadilaputra/org/bottom_toolbar/fragment/HomeFragment.java | ca7e47a90a4a6844f1b5efed2e43e3fe5330b1db | [
"WTFPL"
] | permissive | ffadilaputra/uhuy | cab94d2298ab2505eb9a9de454ee158223473f50 | ec65ae500aca07142fbd1afc470e2d0eccd19c4d | refs/heads/master | 2020-03-30T09:25:04.096296 | 2018-12-14T00:29:24 | 2018-12-14T00:29:24 | 151,074,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,828 | java | package ffadilaputra.org.bottom_toolbar.fragment;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.PlaceLikelihood;
import com.google.android.gms.location.places.PlaceLikelihoodBuffer;
import com.google.android.gms.location.places.Places;
import com.google.android.gms.location.places.ui.PlaceAutocomplete;
import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment;
import com.google.android.gms.location.places.ui.PlaceSelectionListener;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import java.util.ArrayList;
import ffadilaputra.org.bottom_toolbar.R;
import ffadilaputra.org.bottom_toolbar.adapter.PlacesAdapter;
import static android.app.Activity.RESULT_OK;
public class HomeFragment extends Fragment implements GoogleApiClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks,PlaceSelectionListener {
private RecyclerView recyclerView;
private static final String LOG_TAG = "CardFragment";
protected GoogleApiClient mGoogleApiClient;
private static final int PERMISSION_REQUEST_CODE = 100;
PlacesAdapter adapter = null;
private ArrayList<Place> place = new ArrayList<>();
private static final LatLngBounds ALAMAT = new LatLngBounds(
new LatLng(-7.946529 , 112.615537), new LatLng(37.430610, -121.972090));
private static final int REQUEST_SELECT_PLACE = 1000;
private TextView locationTextView;
private TextView attributionsTextView;
public static HomeFragment newInstance(String param1, String param2) {
HomeFragment fragment = new HomeFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGoogleApiClient = new GoogleApiClient.Builder(getContext())
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.addApi(Places.PLACE_DETECTION_API)
.addApi(Places.GEO_DATA_API)
.build();
mGoogleApiClient.connect();
adapter = new PlacesAdapter(place);
retrievePlaces();
}
private void retrievePlaces() throws SecurityException {
PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi.getCurrentPlace(mGoogleApiClient, null);
result.setResultCallback(new ResultCallback<PlaceLikelihoodBuffer>() {
@Override
public void onResult(@NonNull PlaceLikelihoodBuffer likelyPlaces) {
for (PlaceLikelihood placeLikelihood : likelyPlaces) {
place.add(placeLikelihood.getPlace().freeze());
Log.i("Place = ", placeLikelihood.getPlace().getName().toString());
}
adapter.notifyDataSetChanged();
likelyPlaces.release();
}
});
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_place_list,container,false);
recyclerView = (RecyclerView)view.findViewById(R.id.places_lst);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)getActivity().
getFragmentManager().findFragmentById(R.id.place_fragment);
autocompleteFragment.setOnPlaceSelectedListener(this);
autocompleteFragment.setHint("Search a Location");
autocompleteFragment.setBoundsBias(ALAMAT);
return view;
}
@Override
public void onConnected(@Nullable Bundle bundle) {
int hasPermission = 0;
hasPermission = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);
if (hasPermission != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSION_REQUEST_CODE);
} else {
Log.i("Client Connection", "Connected to GoogleClient");
}
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Log.e(LOG_TAG, "Google Places API connection failed with error code: " + connectionResult.getErrorCode());
Toast.makeText(getActivity(), "Google Places API connection failed with error code:" + connectionResult.getErrorCode(), Toast.LENGTH_LONG).show();
}
@Override
public void onPlaceSelected(Place place) {
Log.i(LOG_TAG, "Place Selected: " + place.getName());
locationTextView.setText(getString(R.string.formatted_place_data, place
.getName(), place.getAddress(), place.getPhoneNumber(), place
.getWebsiteUri(), place.getRating(), place.getId()));
if (!TextUtils.isEmpty(place.getAttributions())){
attributionsTextView.setText(Html.fromHtml(place.getAttributions().toString()));
}
}
@Override
public void onError(Status status) {
Log.e(LOG_TAG, "onError: Status = " + status.toString());
Toast.makeText(getActivity(), "Place selection failed: " + status.getStatusMessage(),
Toast.LENGTH_SHORT).show();
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_SELECT_PLACE) {
if (resultCode == RESULT_OK) {
Place place = PlaceAutocomplete.getPlace(getActivity(), data);
this.onPlaceSelected(place);
} else if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
Status status = PlaceAutocomplete.getStatus(getActivity(), data);
this.onError(status);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}
| [
"i.fadilaputra@gmail.com"
] | i.fadilaputra@gmail.com |
ba6ca9b08eff0d3bb7c968d6c7b87e885e171d91 | 3f5c18e8384da80b72e712e2129f3442a10c3257 | /Java OOP/Working with Abstraction - Exercise/CardsWithPower/Card.java | da90ced5504687a87cc85dde94a7cd20e4ce99f9 | [] | no_license | altnum/Java-Advanced | b356928c88229f9b0aa12544a94e6d7b80bd06ec | 3741bda782048f1b9d1633e10342a7f42cb36ffe | refs/heads/master | 2023-02-04T03:38:15.746179 | 2020-12-14T18:28:44 | 2020-12-14T18:28:44 | 295,775,251 | 0 | 0 | null | 2020-10-06T18:30:44 | 2020-09-15T15:45:42 | Java | UTF-8 | Java | false | false | 549 | java | package CardsWithPower;
public class Card {
private CardRanks number;
private CardsWithPower colour;
private int power;
public Card (CardRanks rank, CardsWithPower colour) {
this.number = rank;
this.colour = colour;
this.power = rank.getPower() + colour.getPower();
}
@Override
public String toString() {
String cardName = this.number + " of " + this.colour;
return String.format("CardsWithPower.Card name: %s; CardsWithPower.Card power: %d", cardName, this.power);
}
}
| [
"altnum16@gmail.com"
] | altnum16@gmail.com |
226d31baa749b341a491bf2c8193aeced6b1bf2e | 46842b9a3acbe06caff27ba20294b61e9f325011 | /src/no/hiof/arcade/settings/SettingsLoader.java | 2c054eacea7b0b76ab15acd499e61f3d6c9d3d6e | [] | no_license | oyvjul/ARCADE | 012a8b26025518ebd3835c35424f64472ff85198 | 32e0d6470ad975bbb577a87cb2aa1de30095b536 | refs/heads/master | 2021-05-12T19:18:51.817820 | 2018-01-11T11:08:50 | 2018-01-11T11:08:50 | 117,089,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,330 | java | package no.hiof.arcade.settings;
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 java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author JonAre
*/
public class SettingsLoader
{
public static Properties getSettingsFromFile(SettingsType settingsType, String pathToFile)
{
File settingsFile = new File(pathToFile);
Properties availableProperties = new Properties();
InputStream inputStream;
try
{
inputStream = new FileInputStream(settingsFile);
availableProperties.load(inputStream);
}
catch(FileNotFoundException ex)
{
System.out.println("Could not find settings file. Trying to create settings file.");
createSettingsFile(settingsType, pathToFile);
return getSettingsFromFile(settingsType, pathToFile);
}
catch(IOException ex)
{
System.out.println("Could not load file. Retrying");
return getSettingsFromFile(settingsType, pathToFile);
}
return availableProperties;
}
public static void createSettingsFile(SettingsType settingsType, String pathToFile)
{
File settingsFile = new File(pathToFile);
Properties newProperties = new Properties();
OutputStream outputStream = null;
try
{
settingsFile.createNewFile();
outputStream = new FileOutputStream(pathToFile);
buildPropertiesForFileCreation(newProperties, settingsType);
newProperties.store(outputStream, null);
}
catch(IOException ex)
{
System.out.println("Could not create settings file.");
}
}
private static void buildPropertiesForFileCreation(Properties properties, SettingsType settingsType)
{
if(settingsType==SettingsType.APPLICATION_SETTINGS)
{
properties.setProperty(SettingKey.DEBUG_MODE_ENABLED, LegalSettingValue.FALSE);
properties.setProperty(SettingKey.WALK_WITHOUT_HEAD, LegalSettingValue.FALSE);
properties.setProperty(SettingKey.BATCH_MODELS_WHEN_LOADING, LegalSettingValue.FALSE);
properties.setProperty(SettingKey.USE_OCULUS_RIFT, LegalSettingValue.TRUE);
}
else if(settingsType==SettingsType.MODEL_PATH_SETTINGS)
{
properties.setProperty("DUMMYMODELPATH", "C:/temp/models/remove_line_before_use");
}
else if(settingsType == SettingsType.DISPLAY_SETTINGS)
{
properties.setProperty(SettingKey.DISPLAY_RESOLUTION_WIDTH, "1280");
properties.setProperty(SettingKey.DISPLAY_RESOLUTION_HEIGHT, "800");
properties.setProperty(SettingKey.DISPLAY_FREQUENCY, "60");
properties.setProperty(SettingKey.DISPLAY_FULL_SCREEN, LegalSettingValue.TRUE);
properties.setProperty(SettingKey.DISPLAY_ANTI_ALIASING_FACTOR, "0");
}
}
}
| [
"oyvindjulsrud@yvinds-MacBook-Pro.local"
] | oyvindjulsrud@yvinds-MacBook-Pro.local |
da0401e76b35fc5502d40ebc0e61d043a16f8d4c | 28cb6caae5fb402b20052a47f2281baafedb9ff8 | /LeetCode_Exercise/base_dp_1/Cow_cross_river_dp.java | 830d130263eb0129e0444c3988d39977232bbfc7 | [] | no_license | FlyingLight/Learn_Algorithm | 5d4b87329bef45cc088aa655d4fe5dd829cea319 | 96e8733aa9801ff44adb5e0505bf42c3d54869ec | refs/heads/master | 2020-05-27T07:36:48.014844 | 2020-03-03T02:31:18 | 2020-03-03T02:31:18 | 188,532,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,310 | java | /**
*
*/
package base_dp_1;
import java.util.Arrays;
/**
* @author qiguangqin
*
*/
public class Cow_cross_river_dp {
/**
Farmer John has N cow
boat without row(to and back from river other side :M)
m_i(from m_i-1 m_i) add time
one cow: M+m_1 two cow together : M+m_1+m_2
5(5 cows) 10(without cow ,single trip)
3 m_1
4 m_2
6 m_3
100 m_4
1 m_5
*/
private int[] cow_time;
private int[]dp;
private int[] weight;
private final int n=5;
private final int m=10;
public Cow_cross_river_dp(int[] cow_time) {
if (cow_time.length>n) throw new IllegalArgumentException(" number of cow is not equal");
this.cow_time=cow_time;
dp= new int[cow_time.length+1];
weight= new int[cow_time.length+1];
dp[0]=m;
weight[0]=m;
for(int i=1;i<=n;i++)
dp[i]=dp[i-1]+cow_time[i-1];
for(int i=1;i<=n;i++)
weight[i]=weight[i-1]+cow_time[i-1];
}
public int get_res_recur() {
return _get_res_recur(cow_time.length);
}
public int get_res_recur_memo() {
int n=cow_time.length;
int []memo=new int[n+1];
Arrays.fill(memo, -1);
return _get_res_recur_memo(n,memo);
}
private int _get_res_recur(int n) {
if(n==0) return -m;
if(n==1) return weight[n];
int res=Integer.MAX_VALUE;
for(int i=n;i>0;i--)
res=Math.min(res, weight[i]+_get_res_recur(n-i)+m);
//System.out.println(res);
return res;
}
private int _get_res_recur_memo(int n,int[]memo) {
if(memo[n]!=-1) return memo[n];
if(n==0) return -m;
if(n==1) return weight[n];
int res=Integer.MAX_VALUE;
for(int i=n;i>0;i--) {
res=Math.min(res, weight[i]+_get_res_recur(n-i)+m);
//System.out.println(res);
}
memo[n]=res;
return res;
}
public int get_res() {
for(int i=1;i<=n;i++) {
for(int j=1;j<i;j++) {
dp[i]=Math.min(dp[i], dp[j]+dp[i-j]+m);
}
}
return dp[n];
}
public static void main(String[] args) {
int[] cow_time= {3,4,6,100,1};
Cow_cross_river_dp ccrd = new Cow_cross_river_dp(cow_time);
//for(int w:ccrd.cow_time)
//System.out.print(w+" ");
int num= ccrd.get_res();
int num2= ccrd.get_res_recur_memo();
System.out.println(num+" "+num2);
}
}
| [
"1301857431@qq.com"
] | 1301857431@qq.com |
80f521fbe553db1fc5fc53d2a939a4cbe155f2e4 | 0b97409901c47b520b33558ae2d3a3f16479c142 | /FiapStore/src/main/java/com/fiap/demo/Model/Pedido.java | 422dfc27eb946e5cae3c3f88a6e4949a4ab53c12 | [] | no_license | paulosthiven25/DBE-DigitalBusinessEnablement- | e57b75a06015fef0a64ba3b90439389c162127d2 | 67d0787d085053b22612f05bce607920feaad0f6 | refs/heads/master | 2022-12-01T04:23:45.858460 | 2019-10-01T15:04:41 | 2019-10-01T15:04:41 | 183,063,887 | 0 | 0 | null | 2022-11-24T08:16:34 | 2019-04-23T17:27:31 | Java | UTF-8 | Java | false | false | 1,793 | java | package com.fiap.demo.Model;
import com.fiap.demo.Model.Cliente;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Future;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
@Entity
@SequenceGenerator(name="pedido", sequenceName = "SQ_T_PEDIDO", allocationSize = 1)
public class Pedido {
@Id
@GeneratedValue(generator = "pedido", strategy = GenerationType.SEQUENCE)
@NotNull
private int codigo;
@NotNull
@DecimalMin(value = "1",message = "O valor não pode ser menor que 0,00")
private double valor;
@NotNull
@Future(message = "A data não pode estar no passado")
private LocalDate data;
@NotNull
@Min(value = 1,message = "A quantidade mínima é 1")
private int quantidade;
private boolean pago;
@NotNull
@ManyToOne
private Cliente cliente;
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public double getValor() {
return valor;
}
public void setValor(double valor) {
this.valor = valor;
}
public LocalDate getData() {
return data;
}
public void setData(LocalDate data) {
this.data = data;
}
public int getQuantidade() {
return quantidade;
}
public void setQuantidade(int quantidade) {
this.quantidade = quantidade;
}
public boolean isPago() {
return pago;
}
public void setPago(boolean pago) {
this.pago = pago;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
}
| [
"logonaluno@local.com"
] | logonaluno@local.com |
7617ccaf65d687e9481d7984bf87a064f6214cb8 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/elastic--elasticsearch/636bfe846648b77dfcaed8d46e2d5963b0bc3348/after/InternalSearchHit.java | 76fbc5d519d58bcedc00d963c72ec1b6bcbf4019 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,953 | java | /*
* Licensed to Elastic Search and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Elastic Search 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.elasticsearch.search.internal;
import org.apache.lucene.search.Explanation;
import org.elasticsearch.ElasticSearchParseException;
import org.elasticsearch.common.collect.ImmutableMap;
import org.elasticsearch.common.trove.TIntObjectHashMap;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.builder.XContentBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHitField;
import org.elasticsearch.search.SearchShardTarget;
import org.elasticsearch.search.highlight.HighlightField;
import org.elasticsearch.util.Unicode;
import org.elasticsearch.util.io.stream.StreamInput;
import org.elasticsearch.util.io.stream.StreamOutput;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import static org.elasticsearch.common.lucene.Lucene.*;
import static org.elasticsearch.search.SearchShardTarget.*;
import static org.elasticsearch.search.highlight.HighlightField.*;
import static org.elasticsearch.search.internal.InternalSearchHitField.*;
/**
* @author kimchy (shay.banon)
*/
public class InternalSearchHit implements SearchHit {
private transient int docId;
private String id;
private String type;
private byte[] source;
private Map<String, SearchHitField> fields = ImmutableMap.of();
private Map<String, HighlightField> highlightFields = ImmutableMap.of();
private Explanation explanation;
@Nullable private SearchShardTarget shard;
private Map<String, Object> sourceAsMap;
private InternalSearchHit() {
}
public InternalSearchHit(int docId, String id, String type, byte[] source, Map<String, SearchHitField> fields) {
this.docId = docId;
this.id = id;
this.type = type;
this.source = source;
this.fields = fields;
}
public int docId() {
return this.docId;
}
@Override public String index() {
return shard.index();
}
@Override public String getIndex() {
return index();
}
@Override public String id() {
return id;
}
@Override public String getId() {
return id();
}
@Override public String type() {
return type;
}
@Override public String getType() {
return type();
}
@Override public byte[] source() {
return source;
}
@Override public Map<String, Object> getSource() {
return sourceAsMap();
}
@Override public String sourceAsString() {
if (source == null) {
return null;
}
return Unicode.fromBytes(source);
}
@SuppressWarnings({"unchecked"})
@Override public Map<String, Object> sourceAsMap() throws ElasticSearchParseException {
if (source == null) {
return null;
}
if (sourceAsMap != null) {
return sourceAsMap;
}
XContentParser parser = null;
try {
parser = XContentFactory.xContent(source).createParser(source);
sourceAsMap = parser.map();
parser.close();
return sourceAsMap;
} catch (Exception e) {
throw new ElasticSearchParseException("Failed to parse source to map", e);
} finally {
if (parser != null) {
parser.close();
}
}
}
@Override public Iterator<SearchHitField> iterator() {
return fields.values().iterator();
}
@Override public Map<String, SearchHitField> fields() {
return fields;
}
@Override public Map<String, SearchHitField> getFields() {
return fields();
}
public void fields(Map<String, SearchHitField> fields) {
this.fields = fields;
}
@Override public Map<String, HighlightField> highlightFields() {
return this.highlightFields;
}
@Override public Map<String, HighlightField> getHighlightFields() {
return highlightFields();
}
public void highlightFields(Map<String, HighlightField> highlightFields) {
this.highlightFields = highlightFields;
}
@Override public Explanation explanation() {
return explanation;
}
@Override public Explanation getExplanation() {
return explanation();
}
public void explanation(Explanation explanation) {
this.explanation = explanation;
}
@Override public SearchShardTarget shard() {
return shard;
}
@Override public SearchShardTarget getShard() {
return shard();
}
public void shard(SearchShardTarget target) {
this.shard = target;
}
@Override public void toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field("_index", shard.index());
// builder.field("_shard", shard.shardId());
// builder.field("_node", shard.nodeId());
builder.field("_type", type());
builder.field("_id", id());
if (source() != null) {
if (XContentFactory.xContentType(source()) == builder.contentType()) {
builder.rawField("_source", source());
} else {
builder.field("_source");
builder.value(source());
}
}
if (fields != null && !fields.isEmpty()) {
builder.startObject("fields");
for (SearchHitField field : fields.values()) {
if (field.values().isEmpty()) {
continue;
}
if (field.values().size() == 1) {
builder.field(field.name(), field.values().get(0));
} else {
builder.field(field.name());
builder.startArray();
for (Object value : field.values()) {
builder.value(value);
}
builder.endArray();
}
}
builder.endObject();
}
if (highlightFields != null && !highlightFields.isEmpty()) {
builder.startObject("highlight");
for (HighlightField field : highlightFields.values()) {
builder.field(field.name());
if (field.fragments() == null) {
builder.nullValue();
} else {
builder.startArray();
for (String fragment : field.fragments()) {
builder.value(fragment);
}
builder.endArray();
}
}
builder.endObject();
}
if (explanation() != null) {
builder.field("_explanation");
buildExplanation(builder, explanation());
}
builder.endObject();
}
private void buildExplanation(XContentBuilder builder, Explanation explanation) throws IOException {
builder.startObject();
builder.field("value", explanation.getValue());
builder.field("description", explanation.getDescription());
Explanation[] innerExps = explanation.getDetails();
if (innerExps != null) {
builder.startArray("details");
for (Explanation exp : innerExps) {
buildExplanation(builder, exp);
}
builder.endArray();
}
builder.endObject();
}
public static InternalSearchHit readSearchHit(StreamInput in) throws IOException {
InternalSearchHit hit = new InternalSearchHit();
hit.readFrom(in);
return hit;
}
public static InternalSearchHit readSearchHit(StreamInput in, @Nullable TIntObjectHashMap<SearchShardTarget> shardLookupMap) throws IOException {
InternalSearchHit hit = new InternalSearchHit();
hit.readFrom(in, shardLookupMap);
return hit;
}
@Override public void readFrom(StreamInput in) throws IOException {
readFrom(in, null);
}
public void readFrom(StreamInput in, @Nullable TIntObjectHashMap<SearchShardTarget> shardLookupMap) throws IOException {
id = in.readUTF();
type = in.readUTF();
int size = in.readVInt();
if (size > 0) {
source = new byte[size];
in.readFully(source);
}
if (in.readBoolean()) {
explanation = readExplanation(in);
}
size = in.readVInt();
if (size == 0) {
fields = ImmutableMap.of();
} else if (size == 1) {
SearchHitField hitField = readSearchHitField(in);
fields = ImmutableMap.of(hitField.name(), hitField);
} else if (size == 2) {
SearchHitField hitField1 = readSearchHitField(in);
SearchHitField hitField2 = readSearchHitField(in);
fields = ImmutableMap.of(hitField1.name(), hitField1, hitField2.name(), hitField2);
} else if (size == 3) {
SearchHitField hitField1 = readSearchHitField(in);
SearchHitField hitField2 = readSearchHitField(in);
SearchHitField hitField3 = readSearchHitField(in);
fields = ImmutableMap.of(hitField1.name(), hitField1, hitField2.name(), hitField2, hitField3.name(), hitField3);
} else if (size == 4) {
SearchHitField hitField1 = readSearchHitField(in);
SearchHitField hitField2 = readSearchHitField(in);
SearchHitField hitField3 = readSearchHitField(in);
SearchHitField hitField4 = readSearchHitField(in);
fields = ImmutableMap.of(hitField1.name(), hitField1, hitField2.name(), hitField2, hitField3.name(), hitField3, hitField4.name(), hitField4);
} else if (size == 5) {
SearchHitField hitField1 = readSearchHitField(in);
SearchHitField hitField2 = readSearchHitField(in);
SearchHitField hitField3 = readSearchHitField(in);
SearchHitField hitField4 = readSearchHitField(in);
SearchHitField hitField5 = readSearchHitField(in);
fields = ImmutableMap.of(hitField1.name(), hitField1, hitField2.name(), hitField2, hitField3.name(), hitField3, hitField4.name(), hitField4, hitField5.name(), hitField5);
} else {
ImmutableMap.Builder<String, SearchHitField> builder = ImmutableMap.builder();
for (int i = 0; i < size; i++) {
SearchHitField hitField = readSearchHitField(in);
builder.put(hitField.name(), hitField);
}
fields = builder.build();
}
size = in.readVInt();
if (size == 0) {
highlightFields = ImmutableMap.of();
} else if (size == 1) {
HighlightField field = readHighlightField(in);
highlightFields = ImmutableMap.of(field.name(), field);
} else if (size == 2) {
HighlightField field1 = readHighlightField(in);
HighlightField field2 = readHighlightField(in);
highlightFields = ImmutableMap.of(field1.name(), field1, field2.name(), field2);
} else if (size == 3) {
HighlightField field1 = readHighlightField(in);
HighlightField field2 = readHighlightField(in);
HighlightField field3 = readHighlightField(in);
highlightFields = ImmutableMap.of(field1.name(), field1, field2.name(), field2, field3.name(), field3);
} else if (size == 4) {
HighlightField field1 = readHighlightField(in);
HighlightField field2 = readHighlightField(in);
HighlightField field3 = readHighlightField(in);
HighlightField field4 = readHighlightField(in);
highlightFields = ImmutableMap.of(field1.name(), field1, field2.name(), field2, field3.name(), field3, field4.name(), field4);
} else {
ImmutableMap.Builder<String, HighlightField> builder = ImmutableMap.builder();
for (int i = 0; i < size; i++) {
HighlightField field = readHighlightField(in);
builder.put(field.name(), field);
}
highlightFields = builder.build();
}
if (shardLookupMap != null) {
int lookupId = in.readVInt();
if (lookupId > 0) {
shard = shardLookupMap.get(lookupId);
}
} else {
if (in.readBoolean()) {
shard = readSearchShardTarget(in);
}
}
}
@Override public void writeTo(StreamOutput out) throws IOException {
writeTo(out, null);
}
public void writeTo(StreamOutput out, @Nullable Map<SearchShardTarget, Integer> shardLookupMap) throws IOException {
out.writeUTF(id);
out.writeUTF(type);
if (source == null) {
out.writeVInt(0);
} else {
out.writeVInt(source.length);
out.writeBytes(source);
}
if (explanation == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
writeExplanation(out, explanation);
}
if (fields == null) {
out.writeVInt(0);
} else {
out.writeVInt(fields.size());
for (SearchHitField hitField : fields().values()) {
hitField.writeTo(out);
}
}
if (highlightFields == null) {
out.writeVInt(0);
} else {
out.writeVInt(highlightFields.size());
for (HighlightField highlightField : highlightFields.values()) {
highlightField.writeTo(out);
}
}
if (shardLookupMap == null) {
if (shard == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
shard.writeTo(out);
}
} else {
if (shard == null) {
out.writeVInt(0);
} else {
out.writeVInt(shardLookupMap.get(shard));
}
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
522ab9b82dffd02fcb037147416a7082f73c0b97 | 3376213e409ceada01732a875fc6951d57df5b50 | /src/entities/Rent.java | 8f49f9494f601f153ebc01b312c8c5dc825bc857 | [] | no_license | Natanfags/javaoo-study | edaca115b1b5e3e24508a1d59e70a37adf5d0d4b | 62f32572eefc4b9eb0bed5aed9309af5f831d571 | refs/heads/master | 2020-04-08T23:12:43.516633 | 2018-12-03T14:08:03 | 2018-12-03T14:08:03 | 159,815,971 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package entities;
public class Rent {
String name;
String email;
public Rent(String name, String email) {
super();
this.name = name;
this.email = email;
}
public Rent() {
}
public String getNome() {
return name;
}
public void setNome(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return name + ", " + email;
}
}
| [
"natan.fags@gmail.com"
] | natan.fags@gmail.com |
fe3e1e1d207b99e723142d06d12f5f225a72718e | 96a1fac3edfd19de36a1fa4f88b8f8cccd624b68 | /app/src/main/java/com/stylehair/nerdsolutions/stylehair/telas/agendamento/horarios/viewHolderServicoAgendaHorarios.java | 385cefeaa0e8ecef8b0e30f2ec5a60b13b61e92b | [] | no_license | driguin10/StyleHairApp | 38c83c757f3f299e4a925b2ebdea6a4dbd541da5 | 3e544a39e6ab8b342f323d19a6edd67fd7921db6 | refs/heads/master | 2021-09-23T14:29:15.143643 | 2018-09-24T14:39:43 | 2018-09-24T14:39:43 | 127,162,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,331 | java | package com.stylehair.nerdsolutions.stylehair.telas.agendamento.horarios;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.stylehair.nerdsolutions.stylehair.R;
import com.stylehair.nerdsolutions.stylehair.telas.agendamento.confirmar.confirma_agendamento;
import org.joda.time.Hours;
import org.joda.time.LocalTime;
import java.util.ArrayList;
public class viewHolderServicoAgendaHorarios extends ViewHolder implements View.OnClickListener {
TextView hora;
CardView card;
Context contexto;
ArrayList<String> ListaHorario;
RecyclerView lista;
String tempo;
String intervalo;
String AlmocoIni;
String AlmocoFim;
LocalTime ultimo;
TextView txtHoraEscolhido;
Button Prosseguir;
String idServicos;
String idFuncionario;
String idSalao;
ArrayList<String> vetAux;
ArrayList<String> ServicosLista;
String Data;
String NomeFuncionario;
String Imagemfuncionario;
public viewHolderServicoAgendaHorarios(View itemView, ArrayList<String> dados,Button prosseguir,ArrayList<String> vet) {
super(itemView);
hora = (TextView) itemView.findViewById(R.id.horario);
card = (CardView) itemView.findViewById(R.id.cardsHorarioEscolhido);
card.setOnClickListener(this);
Prosseguir = prosseguir;
Prosseguir.setOnClickListener(this);
ListaHorario = dados;
contexto = itemView.getContext();
itemView.setOnClickListener(this);
vetAux = vet;
}
@Override
public void onClick(View v) {
final int position = getAdapterPosition();
if(v.getId() == card.getId())
{
vetAux.clear();
ArrayList<String> ListaHorarioAux = ListaHorario;
LocalTime HoraSelect = LocalTime.parse(ListaHorarioAux.get(position));
LocalTime HoraIntervalo = LocalTime.parse(intervalo);
LocalTime HoraTotalServico = LocalTime.parse(tempo);
LocalTime HoraAlmocoIni = new LocalTime();
if(AlmocoIni !=null){
HoraAlmocoIni = LocalTime.parse(AlmocoIni);
}
//LocalTime HoraAlmocoFim = LocalTime.parse(AlmocoFim);
int ver = 0;
for (int x = 0; x < ListaHorarioAux.size(); x++) {
if (ListaHorarioAux.get(x).equals(ultimo.toString()))
ver = 1;
}
if (ver == 0) {
ListaHorarioAux.add(ultimo.toString());
}
LocalTime proximaTempo = HoraSelect.plusHours(HoraTotalServico.getHourOfDay())
.plusMinutes(HoraTotalServico.getMinuteOfHour());
vetAux.add(HoraSelect.toString());
int posAux = 0;
int flag = 0;
for (int x = position + 1; x < ListaHorarioAux.size(); x++) {
LocalTime Hvetor = LocalTime.parse(vetAux.get(posAux));
LocalTime soma = Hvetor.plusHours(HoraIntervalo.getHourOfDay())
.plusMinutes(HoraIntervalo.getMinuteOfHour());
Boolean flagHorarioPertoAlmoco = false;
if(AlmocoIni != null) {
if (proximaTempo.compareTo(HoraAlmocoIni) == -1 || proximaTempo.compareTo(HoraAlmocoIni) == 0 && proximaTempo.equals(HoraAlmocoIni)) {
flagHorarioPertoAlmoco = true;
}
}
if (soma.toString().equals(LocalTime.parse(ListaHorarioAux.get(x)).toString())) {
if (LocalTime.parse(ListaHorarioAux.get(x)).toString().equals(proximaTempo.toString()) || flagHorarioPertoAlmoco) {
vetAux.add(ListaHorarioAux.get(x));
flag = 1;
break;
} else {
vetAux.add(ListaHorarioAux.get(x));
posAux++;
}
} else {
break;
}
}
if (flag == 1) {
Toast.makeText(contexto, "horario disponivel !", Toast.LENGTH_LONG).show();
txtHoraEscolhido.setText(ListaHorarioAux.get(position).substring(0, 5));
Prosseguir.setEnabled(true);
Prosseguir.setAlpha(1f);
} else {
Toast.makeText(contexto, "O serviço não pode ser feito neste horario!", Toast.LENGTH_LONG).show();
txtHoraEscolhido.setText("");
Prosseguir.setEnabled(false);
Prosseguir.setAlpha(.4f);
}
}
else
if(v.getId() == Prosseguir.getId())
{
LocalTime HoraInicioServico = LocalTime.parse(vetAux.get(0));
//somar horarios do servicolista e somar a horainicio para dar o tempo de serviço
LocalTime horaFimAux = HoraInicioServico;
for(int x=0;x<ServicosLista.size();x++)
{
LocalTime Hservico = LocalTime.parse(ServicosLista.get(x).split("#")[3]);
horaFimAux = horaFimAux.plusHours(Hservico.getHourOfDay())
.plusMinutes(Hservico.getMinuteOfHour());
}
Intent intent = new Intent(contexto,confirma_agendamento.class);
intent.putExtra("idSalao",idSalao);
intent.putExtra("idFuncionario",idFuncionario);
intent.putExtra("idServicos",idServicos);
intent.putStringArrayListExtra("listaServicos",ServicosLista);// lista dos serviços que vai ser prestado
intent.putExtra("horaIni",HoraInicioServico.toString().substring(0,5));
intent.putExtra("horaFim",horaFimAux.toString().substring(0,5));
intent.putExtra("data",Data);
intent.putExtra("nomeFuncionario",NomeFuncionario);
intent.putExtra("imagemFuncionario",Imagemfuncionario);
contexto.startActivity(intent);
}
}
}
| [
"driguin_10@hotmail.com"
] | driguin_10@hotmail.com |
421d369f22a8e7e7179cc8ea156e71b6c4fe8e37 | 76aa67783d67d879b795fc8de3bed2746ccf3ee6 | /src/com/codepath/apps/basictwitter/fragments/TopCardFragment.java | 037717467264f95750f79bc8c2c67897d6e70159 | [] | no_license | prachiagrawal/SimpleTwitter-Codepath | eea41db3a27675e6991a8fd5049552184390d49f | f0df485e00a353d35fd386c614a4c7cdb1d9754a | refs/heads/master | 2020-12-24T15:22:36.774712 | 2014-10-09T03:50:36 | 2014-10-09T03:50:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,901 | java | package com.codepath.apps.basictwitter.fragments;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.codepath.apps.basictwitter.R;
import com.codepath.apps.basictwitter.models.User;
import com.nostra13.universalimageloader.core.ImageLoader;
public class TopCardFragment extends Fragment {
private ImageView ivProfileBackgroundImage;
private ImageView ivProfileTopCardImage;
private TextView tvProfileScreenName;
private TextView tvProfileName;
private TextView tvTagline;
private TextView tvFollowersCount;
private TextView tvFriendsCount;
private TextView tvTweetsCount;
private ImageView ivVerified;
public TopCardFragment() {
// Empty constructor
}
public static TopCardFragment newInstance(long userId) {
TopCardFragment frag = new TopCardFragment();
Bundle args = new Bundle();
args.putLong("userId", userId);
frag.setArguments(args);
return frag;
}
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_top_card, container, false);
ivProfileBackgroundImage = (ImageView) v.findViewById(R.id.ivProfileBackgroundImage);
ivProfileTopCardImage = (ImageView) v.findViewById(R.id.ivProfileTopCardImage);
tvProfileScreenName = (TextView) v.findViewById(R.id.tvProfileScreenName);
tvProfileName = (TextView) v.findViewById(R.id.tvProfileName);
tvTagline = (TextView) v.findViewById(R.id.tvTagline);
tvFollowersCount = (TextView) v.findViewById(R.id.tvFollowersCount);
tvFriendsCount = (TextView) v.findViewById(R.id.tvFriendsCount);
tvTweetsCount = (TextView) v.findViewById(R.id.tvTweetsCount);
ivVerified = (ImageView) v.findViewById(R.id.ivVerified);
User user = User.getById(getArguments().getLong("userId"));
if (user != null) {
ivProfileBackgroundImage.setImageResource(0);
ivProfileTopCardImage.setImageResource(0);
ImageLoader imageLoader = ImageLoader.getInstance();
if (user.getUseBackgroundImage()) {
imageLoader.displayImage(user.getProfileBackgroundImageUrl(), ivProfileBackgroundImage);
}
imageLoader.displayImage(user.getProfileImageUrl(), ivProfileTopCardImage);
tvProfileName.setText(user.getName());
tvProfileScreenName.setText("@" + user.getScreenName());
tvTagline.setText(user.getDescription());
tvFollowersCount.setText(Integer.toString(user.getFollowersCount()));
tvFriendsCount.setText(Integer.toString(user.getFriendsCount()));
tvTweetsCount.setText(Integer.toString(user.getStatusesCount()));
if (!user.getIsVerified()) {
ivVerified.setVisibility(View.INVISIBLE);
}
}
return v;
}
}
| [
"prachi.agrawal@gmail.com"
] | prachi.agrawal@gmail.com |
99b805f8afbfb96473616f9966f837d1e0af57fd | 34cd4b755caa858b350689f65151732cd467419f | /chapter1/src/chapter1/ex13.java | f429a5717e80b3d9804b9098ca116581448810b3 | [] | no_license | CindyChow1631560/Java-Programming | 9f02521a0b5434d6fed73330c7e2159514049789 | 5e53a1fc865bc56e23a0d7cbeb10b088adbbd9b0 | refs/heads/master | 2020-03-28T05:05:37.799363 | 2018-09-07T02:01:55 | 2018-09-07T02:01:55 | 147,756,094 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package chapter1;
import java.util.*;
public class ex13 {
/* public static int[][] trance(int a[][])
{
int k=a.length;
int m=a[0].length;
int[][] b=new int[k][m];
for(int j=0;j<a[0].length;j++)
for(int i=0;i<a.length;i++)
{
b[i][j]=a[j][i];
}
return b;
}*/
public static void main(String[] args) {
// TODO Auto-generated method stub
/*int[][] test=new int[5][5];
Random random=new Random();
for(int k=0;k<5;k++)
for(int m=0;m<5;m++)
{
test[k][m]=random.nextInt(10);
}*/
int[][] test={{1,2,3,4,5},{3,6,7,8,3},{6,7,8,9,1},{3,1,5,7,9},{2,4,3,8,0}};
for(int k=0;k<5;k++)
{
for(int m=0;m<5;m++)
{
System.out.print(test[k][m]+" ");
}
System.out.println();
}
//test=trance(test);
System.out.println();
for(int k=0;k<5;k++)
{
for(int m=0;m<5;m++)
{
System.out.print(test[m][k]+" ");
}
System.out.println();
}
}
}
| [
"2481590325@qq.com"
] | 2481590325@qq.com |
1381fb9e9a14f16a6b1d7cb202fc5161d791322d | 543dbeae6ed5e22b41d3bb0fc3f41f5ef7ae7a28 | /core-it-suite/src/test/resources/mng-3703/maven-mng3703-plugin/src/main/java/jar/CheckMojo.java | a81f6f6ec5dd901e05e6dc50e34ca8c194fc9535 | [
"Apache-2.0"
] | permissive | famod/maven-integration-testing | f498e6e436bc09262bbea1314ddfb9deea62ce75 | 7bb6eb02e78c0d9c2a54f1713f5b8e51c11da6d2 | refs/heads/master | 2023-02-19T04:44:37.962142 | 2020-10-24T09:59:41 | 2020-12-15T08:34:03 | 147,579,983 | 0 | 0 | null | 2018-09-05T21:10:55 | 2018-09-05T21:10:55 | null | UTF-8 | Java | false | false | 983 | java | package jar;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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.
*/
import org.apache.maven.project.MavenProject;
/**
* @goal check
* @execute phase="compile"
*/
public class CheckMojo
extends AbstractCheckMojo
{
protected MavenProject getTestProject()
{
return getExecutionProject();
}
protected String getTestProjectLabel()
{
return "forked project";
}
}
| [
"jdcasey@apache.org"
] | jdcasey@apache.org |
ce246ed0cf6f98a53e93e8d5376ff2cc7380a373 | 745e4cc70b21c2c9fad2cc5a20026c29c1d73ea6 | /jte-runtime/src/main/java/gg/jte/support/LocalizationSupport.java | 8d84c097c37763d684e09d8d4e02fb949340e433 | [
"Apache-2.0"
] | permissive | patadams-company/jte | 574cc8469022e1cf34d37b8ebc9d19c4c1cedd8e | a9af62197aff631aa1044ee1a1a64924a4d67419 | refs/heads/master | 2023-03-02T02:06:47.089428 | 2020-11-25T12:29:25 | 2020-11-25T12:29:25 | 316,601,637 | 0 | 0 | Apache-2.0 | 2021-02-03T19:37:32 | 2020-11-27T21:17:04 | null | UTF-8 | Java | false | false | 3,139 | java | package gg.jte.support;
import gg.jte.TemplateOutput;
import gg.jte.Content;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public interface LocalizationSupport {
Pattern pattern = Pattern.compile("\\{(\\d+)}");
String lookup(String key);
@SuppressWarnings("unused") // Called by template code
default Content localize(String key) {
String value = lookup(key);
if (value == null) {
return null;
}
return output -> output.writeContent(value);
}
@SuppressWarnings("unused") // Called by template code
default Content localize(String key, Object ... params) {
String value = lookup(key);
if (value == null) {
return null;
}
return new Content() {
@Override
public void writeTo(TemplateOutput output) {
Matcher matcher = pattern.matcher(value);
if (matcher.find()) {
int startIndex = 0;
do {
output.writeContent(value.substring(startIndex, matcher.start()));
startIndex = matcher.end();
int argumentIndex = Integer.parseInt(matcher.group(1));
if (argumentIndex < params.length) {
Object param = params[argumentIndex];
if (param != null) {
writeParam(output, param);
}
}
} while (matcher.find());
output.writeContent(value.substring(startIndex));
} else {
output.writeContent(value);
}
}
private void writeParam(TemplateOutput output, Object param) {
if (param instanceof String) {
output.writeUserContent((String) param);
} else if (param instanceof Content) {
output.writeUserContent((Content) param);
} else if (param instanceof Enum) {
output.writeUserContent((Enum<?>) param);
} else if (param instanceof Boolean) {
output.writeUserContent((boolean) param);
} else if (param instanceof Byte) {
output.writeUserContent((byte) param);
} else if (param instanceof Short) {
output.writeUserContent((short) param);
} else if (param instanceof Integer) {
output.writeUserContent((int) param);
} else if (param instanceof Long) {
output.writeUserContent((long) param);
} else if (param instanceof Float) {
output.writeUserContent((float) param);
} else if (param instanceof Double) {
output.writeUserContent((double) param);
} else if (param instanceof Character) {
output.writeUserContent((char) param);
}
}
};
}
}
| [
"andy@mazebert.com"
] | andy@mazebert.com |
c1225268b47e5bdc7354ab6a2a4b3fafc84dc908 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.ocms-OCMS/sources/com/facebook/graphql/modelutil/GraphQLModelBuilder.java | e268b7b841aa46a7aec29adc72903c3b49596a02 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 82 | java | package com.facebook.graphql.modelutil;
public interface GraphQLModelBuilder {
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
25a6fb42401ed31bad9a6605b71db3b2af442d1b | bc18b57409111dada3a48f72ac095628936f827a | /src/org/apache/lucene/search/ArticleNamespaceScaling.java | efdc3e786ba9c66d13e0407cd75699bbcac7890e | [] | no_license | sridhar-newsdistill/operations-debs-lucene-search-2 | f895a48ade280a7f62b3bf0ea85594a79543c928 | 5c1d8e45e081f78a0640925629cb6b988850e69b | refs/heads/master | 2021-01-13T07:59:53.773586 | 2014-02-12T10:54:09 | 2014-02-13T23:13:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | package org.apache.lucene.search;
import java.io.Serializable;
import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
public class ArticleNamespaceScaling implements Serializable {
protected float[] nsBoost = null;
public static float talkPageScale = 0.25f;
/** Initialize from ns -> boost map */
public ArticleNamespaceScaling(Map<Integer,Float> map){
int max = map.size()==0? 0 : Collections.max(map.keySet());
nsBoost = new float[max+2];
// default values
for(int i=0;i<nsBoost.length;i++)
nsBoost[i] = defaultValue(i);
// custom
for(Entry<Integer,Float> e : map.entrySet()){
int ns = e.getKey();
nsBoost[ns] = e.getValue();
if(ns % 2 == 0 && !map.containsKey(ns+1)){
// rescale default for talk page
nsBoost[ns+1] = e.getValue() * talkPageScale;
}
}
}
/** Get boost for namespace */
public float scaleNamespace(int ns){
if(ns >= nsBoost.length || ns < 0)
return defaultValue(ns);
else
return nsBoost[ns];
}
/** Produce default boost for namespace */
protected float defaultValue(int ns){
if(ns % 2 == 0) // content ns
return 1f;
else // corresponding talk ns
return talkPageScale;
}
}
| [
"mah@users.mediawiki.org"
] | mah@users.mediawiki.org |
7452ebf2ccde642add2eea9852b2f513571bfd6e | ec2cf9897b29e1c86f0d2b6ba6cb4f657d853cef | /1.1.0/CryptoMax/app/src/main/java/com/maxtechnologies/cryptomax/wallets/misc/EncryptionUtils.java | 9255475d8fc30eaf5399d9ef07a189a96ea65b6e | [] | no_license | Colman/CryptoMaxAndroid | 1f70dc8881fad1e7ecb8a7a1308c0cc8dd257eea | eb8bd630d981acbbeed94ee768f88d6da6d0dffd | refs/heads/master | 2020-03-30T02:57:13.876674 | 2018-11-27T07:21:36 | 2018-11-27T07:21:36 | 150,660,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,661 | java | package com.maxtechnologies.cryptomax.wallets.misc;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Arrays;
import android.util.Base64;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKeyFactory;
import javax.crypto.SecretKey;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.SecretKeySpec;
import java.security.spec.KeySpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.IvParameterSpec;
/**
* Created by Colman on 03/05/2018.
*/
public class EncryptionUtils {
public static String[] encrypt(String input, String password) {
//Generate salt and init vector
SecureRandom secureRandom = new SecureRandom();
byte[] salt = secureRandom.generateSeed(16);
byte[] initBytes = secureRandom.generateSeed(16);
IvParameterSpec initVector = new IvParameterSpec(initBytes);
byte[] encrypted;
try {
//Generate secret key from password
KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 65536, 128);
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
byte[] secret = factory.generateSecret(spec).getEncoded();
//Encrypt input using secret key
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(secret, "AES"), initVector);
encrypted = cipher.doFinal(input.getBytes());
}
catch(NoSuchAlgorithmException e) {
return null;
}
catch(InvalidKeySpecException e) {
return null;
}
catch(NoSuchPaddingException e) {
return null;
}
catch(InvalidAlgorithmParameterException e) {
return null;
}
catch(InvalidKeyException e) {
return null;
}
catch(IllegalBlockSizeException e) {
return null;
}
catch(BadPaddingException e) {
return null;
}
return new String[] {
Base64.encodeToString(encrypted, Base64.DEFAULT),
Base64.encodeToString(salt, Base64.DEFAULT),
Base64.encodeToString(initBytes, Base64.DEFAULT)
};
}
public static String decrypt(String password, String[] encrypted) {
if(encrypted == null || encrypted.length != 3) {
return null;
}
//Convert salt and init vector
byte[] saltBytes = Base64.decode(encrypted[1], Base64.DEFAULT);
byte[] initBytes = Base64.decode(encrypted[2], Base64.DEFAULT);
IvParameterSpec initVec = new IvParameterSpec(initBytes);
byte[] decrypted;
try {
//Generate secret key from password
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
KeySpec spec = new PBEKeySpec(password.toCharArray(), saltBytes, 65536, 128);
byte[] secret = factory.generateSecret(spec).getEncoded();
//Decrypt input using secret key
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(secret, "AES"), initVec);
decrypted = cipher.doFinal(Base64.decode(encrypted[0], Base64.DEFAULT));
}
catch(NoSuchAlgorithmException e) {
return null;
}
catch(InvalidKeySpecException e) {
return null;
}
catch(NoSuchPaddingException e) {
return null;
}
catch(InvalidAlgorithmParameterException e) {
return null;
}
catch(InvalidKeyException e) {
return null;
}
catch(IllegalBlockSizeException e) {
return null;
}
catch(BadPaddingException e) {
return null;
}
return new String(decrypted).trim();
}
}
| [
"colmankoivisto@gmail.com"
] | colmankoivisto@gmail.com |
3a7ebf6d69b6b7edda49796c946710eaaa90c3f6 | e7312ae44ac3ab322c211a85fb655a99e31e7285 | /src/testSiteGetNet/TestConsultarDado.java | 04b9e90693c36e51f8aa733605c2a40a3c5b0b81 | [] | no_license | Betila/getnet | e20e9ad1794fc5c67dede5fabf57c4b1fec007c7 | 3cd06a0cae3c2f6917a823b116dbc9b3a2aeef09 | refs/heads/master | 2022-12-07T08:23:04.125311 | 2020-09-03T15:06:41 | 2020-09-03T15:06:41 | 292,603,506 | 0 | 0 | null | null | null | null | IBM852 | Java | false | false | 2,884 | java | package testSiteGetNet;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class TestConsultarDado {
WebDriver driver;
private String URL = "https://site.getnet.com.br/";
private final String CAMPOPROCURADO = "superget";
@Before
public void inicio() throws Throwable {
System.setProperty("webdriver.chrome.driver", "/Users/beti_/bin/chromedriver.exe");
this.driver = new ChromeDriver();
this.driver.get(URL);
this.driver.manage().window().maximize();
Thread.sleep(4000);
}
@SuppressWarnings("unused")
@Test
public void testPesquisar() throws Throwable {
try {
String TituloTela;
String TituloValidacao1 = "Como fašo a portabilidade da minha maquininha?";
String TituloValidacao2 = "Como acesso a minha conta SuperGet?";
this.driver.findElement(By.id("search-trigger")).click();
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("global-search-input")));
this.driver.findElement(By.id("global-search-input")).sendKeys(CAMPOPROCURADO);
this.driver.findElement(By.xpath("/html/body/section/div/div/div/form/button")).click();
List<WebElement> elements = this.driver.findElements(By.xpath("//h3[contains(.,'como fašo a portabilidade da minha maquininha')]"));
if(!elements.isEmpty()){
this.driver.findElement(By.xpath("//h3[contains(.,'como fašo a portabilidade da minha maquininha')]")).click();
WebDriverWait wait1 = new WebDriverWait(driver, 10);
WebElement element1 = wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("is-modal-open")));
TituloTela = this.driver.findElement(By.className("is-modal-open")).findElement(By.className("o-modal__title")).getText();
Thread.sleep(4000);
assertEquals(TituloValidacao1, TituloTela);
}else {
this.driver.findElement(By.xpath("//h3[contains(.,'Como acesso a minha conta SuperGet?')]")).click();
WebDriverWait wait1 = new WebDriverWait(driver, 10);
WebElement element1 = wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("is-modal-open")));
TituloTela = this.driver.findElement(By.className("is-modal-open")).findElement(By.className("o-modal__title")).getText();
Thread.sleep(4000);
assertEquals(TituloValidacao2, TituloTela);
}
}catch(Exception e) {
System.out.println(e.toString());
}
}
@After
public void fim() {
this.driver.quit();
}
}
| [
"betilasantos@gmail.com"
] | betilasantos@gmail.com |
026f64c3507baec6668ecb38562c547ec953e63c | d4b77d3b6d0743d11c6c7dcd2d8dc39a6a7c7de1 | /WebSwarm/public/Behavior.java | afca2cc934cf43f63e7f6be137064cba305a743f | [] | no_license | rubencodes/GeneticSwarm | 96d00782f6481c15c564ef1a8cf534959b91fef2 | db3a09040216caf1233a5c099ea19f6467dbec90 | refs/heads/master | 2020-05-20T12:52:27.255925 | 2019-02-26T03:14:59 | 2019-02-26T03:14:59 | 21,450,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,726 | java | import java.io.StringReader;
import java.io.IOException;
import java.util.Random;
import java.util.Vector;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonReader;
public class Behavior {
private int comparatorId; //ID of comparator; chooses between >, <, or ==
private int propertyA; //ID of variable used in if()
private int propertyB; //ID of variable/constant compared to
private boolean randomPropertyB; //decides if comparison will be to random prop or constant
public int depthLevel; //current depthLevel
private Vector < Integer > ifPropertyIDs; //IDs of variables to be acted upon, if true
private Vector < Integer > ifActionIDs; //IDs of actions to be taken on variables, if true
private Vector < Integer > elsePropertyIDs; //IDs of variables to be acted upon, if false
private Vector < Integer > elseActionIDs; //IDs of actions to be taken on variables, if false
private Vector < Float > numberBank; //Floats used for setting/incrementing/decrementing actions
private Vector < Float > nullNumberBank; //Floats used for setting/incrementing/decrementing actions
private Vector < Behavior > subBehaviors; //storing any sub-behaviors generated
private Boid boid; //storing our boid for variable value retrieval
private int score; //stores evaluation score
private static final int ALL_VARS_COUNT = 12; //number of variables from boid
private static final int ALL_ACTIONS_COUNT = 3; //number of possible actions
private static final int MAX_BEHAVIOR_DEPTH = 4; //max depth of behavior
private Random r = new Random();
//stores randoms chosen for behavior
private float velocityScale;
private float maxSpeed;
private float normalSpeed;
private float neighborhoodRadius;
private float separationWeight;
private float alignmentWeight;
private float cohesionWeight;
private float pacekeepingWeight;
private float motionProbability;
private float numNeighborsOwnFlock;
private float numNeighborsAllFlocks;
//Auto-Generate Behavior object
public Behavior(String jsonBehavior) {
JsonArray behavior_array = null;
JsonObject behavior = null;
try {
JsonReader rdr = Json.createReader(new StringReader(jsonBehavior));
behavior_array = rdr.readArray();
behavior = behavior_array.getValuesAs(JsonObject.class).get(0);
}
catch (Exception e) {
e.printStackTrace();
}
comparatorId = behavior.getInt("comparator_id");
propertyA = behavior.getInt("property_a_id");
randomPropertyB = behavior.getBoolean("random_property_b");
propertyB = behavior.getInt("property_b_id");
depthLevel = behavior.getInt("depth_level");
//create new vectors for behavior
ifActionIDs = new Vector < Integer > ();
ifPropertyIDs = new Vector < Integer > ();
elseActionIDs = new Vector < Integer > ();
elsePropertyIDs = new Vector < Integer > ();
subBehaviors = new Vector < Behavior > ();
//split array by delimiter, convert to array of integers, and convert array to vector
for (String actionVarID : behavior.getString("if_property_ids", "").split(","))
if (!actionVarID.equals(""))
ifPropertyIDs.add(Integer.parseInt(actionVarID));
for (String actionID : behavior.getString("if_action_ids", "").split(","))
if (!actionID.equals(""))
ifActionIDs.add(Integer.parseInt(actionID));
for (String nullActionVarID : behavior.getString("else_property_ids", "").split(","))
if (!nullActionVarID.equals(""))
elsePropertyIDs.add(Integer.parseInt(nullActionVarID));
for (String nullActionID : behavior.getString("else_action_ids", "").split(","))
if (!nullActionID.equals(""))
elseActionIDs.add(Integer.parseInt(nullActionID));
velocityScale = Float.parseFloat(behavior.getString("velocity_scale", "0"));
maxSpeed = Float.parseFloat(behavior.getString("max_speed", "0"));
normalSpeed = Float.parseFloat(behavior.getString("normal_speed", "0"));
neighborhoodRadius = Float.parseFloat(behavior.getString("neighborhood_radius", "0"));
separationWeight = Float.parseFloat(behavior.getString("separation_weight", "0"));
alignmentWeight = Float.parseFloat(behavior.getString("alignment_weight", "0"));
cohesionWeight = Float.parseFloat(behavior.getString("cohesion_weight", "0"));
pacekeepingWeight = Float.parseFloat(behavior.getString("pacekeeping_weight", "0"));
motionProbability = Float.parseFloat(behavior.getString("rand_motion_probability", "0"));
for (int i = 1; i < behavior_array.getValuesAs(JsonObject.class).size(); i++) {
JsonObject subBehavior = behavior_array.getValuesAs(JsonObject.class).get(i);
subBehaviors.add(new Behavior(subBehavior));
}
}
public Behavior(JsonObject behavior) {
comparatorId = behavior.getInt("comparator_id");
propertyA = behavior.getInt("property_a_id");
randomPropertyB = behavior.getBoolean("random_property_b");
propertyB = behavior.getInt("property_b_id");
depthLevel = behavior.getInt("depth_level");
//create new vectors for behavior
ifActionIDs = new Vector < Integer > ();
ifPropertyIDs = new Vector < Integer > ();
elseActionIDs = new Vector < Integer > ();
elsePropertyIDs = new Vector < Integer > ();
subBehaviors = new Vector < Behavior > ();
//split array by delimiter, convert to array of integers, and convert array to vector
for (String actionVarID : behavior.getString("if_property_ids").split(","))
if (!actionVarID.equals(""))
ifPropertyIDs.add(Integer.parseInt(actionVarID));
for (String actionID : behavior.getString("if_action_ids").split(","))
if (!actionID.equals(""))
ifActionIDs.add(Integer.parseInt(actionID));
for (String nullActionVarID : behavior.getString("else_property_ids").split(","))
if (!nullActionVarID.equals(""))
elsePropertyIDs.add(Integer.parseInt(nullActionVarID));
for (String nullActionID : behavior.getString("else_action_ids").split(","))
if (!nullActionID.equals(""))
elseActionIDs.add(Integer.parseInt(nullActionID));
velocityScale = Float.parseFloat(behavior.getString("velocity_scale"));
maxSpeed = Float.parseFloat(behavior.getString("max_speed"));
normalSpeed = Float.parseFloat(behavior.getString("normal_speed"));
neighborhoodRadius = Float.parseFloat(behavior.getString("neighborhood_radius"));
separationWeight = Float.parseFloat(behavior.getString("separation_weight"));
alignmentWeight = Float.parseFloat(behavior.getString("alignment_weight"));
cohesionWeight = Float.parseFloat(behavior.getString("cohesion_weight"));
pacekeepingWeight = Float.parseFloat(behavior.getString("pacekeeping_weight"));
motionProbability = Float.parseFloat(behavior.getString("rand_motion_probability"));
}
//executes Behavior on a boid
public void execute(Boid boid) {
this.boid = boid; //sets boid to act upon
if (compare()) //make a comparison
for (int i = 0; i < ifActionIDs.size(); i++)
actionBank(ifActionIDs.get(i), ifPropertyIDs.get(i), 1);
else //if comparison is false
for (int i = 0; i < elseActionIDs.size(); i++)
actionBank(elseActionIDs.get(i), elsePropertyIDs.get(i), 1);
//execute any sub-behaviors
for (int i = 0; i < subBehaviors.size(); i++)
subBehaviors.get(i).execute(boid);
}
//makes a comparison between two variables
public boolean compare() {
switch (comparatorId) {
case 0:
if (varBank(propertyA, false) > varBank(propertyB, randomPropertyB)) //if var1 > var2
return true;
else return false;
case 1:
if (varBank(propertyA, false) < varBank(propertyB, randomPropertyB)) //if var1 < var2
return true;
else return false;
case 2:
if (varBank(propertyA, false) == varBank(propertyB, randomPropertyB)) //if var1 == var2
return true;
else return false;
}
return false;
}
//bank containing variables, integers, and randoms
public float varBank(int ID, boolean rand) {
switch (ID) {
case 0:
if (rand) return velocityScale;
return boid.getVelocityScale();
case 1:
if (rand) return maxSpeed;
return boid.getMaxSpeed();
case 2:
if (rand) return normalSpeed;
return boid.getNormalSpeed();
case 3:
if (rand) return neighborhoodRadius;
return boid.getNeighborRadius();
case 4:
if (rand) return separationWeight;
return boid.getSeparationWeight();
case 5:
if (rand) return alignmentWeight;
return boid.getAlignmentWeight();
case 6:
if (rand) return cohesionWeight;
return boid.getCohesionWeight();
case 7:
if (rand) return pacekeepingWeight;
return boid.getPacekeepingWeight();
case 8:
if (rand) return motionProbability;
return boid.getRandomMotionProbability();
case 9:
if (rand) return numNeighborsOwnFlock;
return boid.getNumNeighborsOwnFlock();
case 10:
if (rand) return numNeighborsAllFlocks;
return 1;
default:
return ID;
}
}
//bank containing actions for variables
//int ID: chooses between incrementing a variable by x, decrementing by x, or setting to x
//int propertyA: decides which variable is going to be acted on in any of the 3 cases
//float x: what is added, subtracted, or set to a variable
public void actionBank(int ID, int propertyA, float x) {
boolean rand = false; //allows for randomness when grabbing from var bank; not desired in action bank
switch (ID) {
//add to variable
case 0:
float i = varBank(propertyA, rand) + x;
boid.set(propertyA, i);
break;
//subtract from variable
case 1:
float j = varBank(propertyA, rand) - x;
boid.set(propertyA, j);
break;
//set to value
case 2:
boid.set(propertyA, x);
break;
}
}
//print out behavior pseudocode
public void printBehavior() {
System.out.print("if (");
switch(propertyA) {
case 0:
System.out.print("Velocity Scale ");
break;
case 1:
System.out.print("Max Speed ");
break;
case 2:
System.out.print("Normal Speed ");
break;
case 3:
System.out.print("Neighborhood Radius ");
break;
case 4:
System.out.print("Separation Weight ");
break;
case 5:
System.out.print("Alignment Weight ");
break;
case 6:
System.out.print("Cohesion Weight ");
break;
case 7:
System.out.print("Pacekeeping Weight ");
break;
case 8:
System.out.print("Random Motion Probability ");
break;
case 9:
System.out.print("Num Neighbors Own Flock ");
break;
case 10:
System.out.print("Num Neighbors All Flocks ");
break;
}
switch(comparatorId) {
case 0:
System.out.print("> ");
break;
case 1:
System.out.print("< ");
break;
case 2:
System.out.print("== ");
break;
}
if (randomPropertyB) {
switch(propertyB) {
case 0:
System.out.print(velocityScale+") {");
break;
case 1:
System.out.print(maxSpeed+") {");
break;
case 2:
System.out.print(normalSpeed+") {");
break;
case 3:
System.out.print(neighborhoodRadius+") {");
break;
case 4:
System.out.print(separationWeight+") {");
break;
case 5:
System.out.print(alignmentWeight+") {");
break;
case 6:
System.out.print(cohesionWeight+") {");
break;
case 7:
System.out.print(pacekeepingWeight+") {");
break;
case 8:
System.out.print(motionProbability+") {");
break;
case 9:
System.out.print(numNeighborsOwnFlock+") {");
break;
case 10:
System.out.print(numNeighborsAllFlocks+") {");
break;
}
}
else {
switch(propertyA) {
case 0:
System.out.print("Velocity Scale) {");
break;
case 1:
System.out.print("Max Speed) {");
break;
case 2:
System.out.print("Normal Speed) {");
break;
case 3:
System.out.print("Neighborhood Radius) {");
break;
case 4:
System.out.print("Separation Weight) {");
break;
case 5:
System.out.print("Alignment Weight) {");
break;
case 6:
System.out.print("Cohesion Weight) {");
break;
case 7:
System.out.print("Pacekeeping Weight) {");
break;
case 8:
System.out.print("Random Motion Probability) {");
break;
case 9:
System.out.print("Num Neighbors Own Flock) {");
break;
case 10:
System.out.print("Num Neighbors All Flocks) {");
break;
}
}
for (int i = 0; i < ifActionIDs.size(); i++) {
switch(ifPropertyIDs.get(i)) {
case 0:
System.out.print("\n Velocity Scale ");
break;
case 1:
System.out.print("\n Max Speed ");
break;
case 2:
System.out.print("\n Normal Speed ");
break;
case 3:
System.out.print("\n Neighborhood Radius ");
break;
case 4:
System.out.print("\n Separation Weight ");
break;
case 5:
System.out.print("\n Alignment Weight ");
break;
case 6:
System.out.print("\n Cohesion Weight ");
break;
case 7:
System.out.print("\n Pacekeeping Weight ");
break;
case 8:
System.out.print("\n Random Motion Probability ");
break;
case 9:
System.out.print("\n Num Neighbors Own Flock ");
break;
case 10:
System.out.print("\n Num Neighbors All Flocks ");
break;
}
switch(ifActionIDs.get(i)) {
case 0:
System.out.print("+1 ");
break;
case 1:
System.out.print("-1 ");
break;
case 2:
System.out.print("=1 ");
break;
}
}
System.out.println("}");
System.out.println("else {");
for (int i = 0; i < elseActionIDs.size(); i++) {
switch(elsePropertyIDs.get(i)) {
case 0:
System.out.print("\n Velocity Scale ");
break;
case 1:
System.out.print("\n Max Speed ");
break;
case 2:
System.out.print("\n Normal Speed ");
break;
case 3:
System.out.print("\n Neighborhood Radius ");
break;
case 4:
System.out.print("\n Separation Weight ");
break;
case 5:
System.out.print("\n Alignment Weight ");
break;
case 6:
System.out.print("\n Cohesion Weight ");
break;
case 7:
System.out.print("\n Pacekeeping Weight ");
break;
case 8:
System.out.print("\n Random Motion Probability ");
break;
case 9:
System.out.print("\n Num Neighbors Own Flock ");
break;
case 10:
System.out.print("\n Num Neighbors All Flocks ");
break;
}
switch(elseActionIDs.get(i)) {
case 0:
System.out.print("+1 ");
break;
case 1:
System.out.print("-1 ");
break;
case 2:
System.out.print("=1 ");
break;
}
}
System.out.println("}");
}
//getters and setters
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public int getVariableID() {
return propertyA;
}
public void setVariableID(int propertyA) {
this.propertyA = propertyA;
}
public int getComparatorID() {
return comparatorId;
}
public void setComparatorID(int comparatorId) {
this.comparatorId = comparatorId;
}
public int getNextNumID() {
return propertyB;
}
public void setNextNumID(int propertyB) {
this.propertyB = propertyB;
}
public Vector < Integer > getActionIDs() {
return ifActionIDs;
}
public void setActionIDs(Vector < Integer > ifActionIDs) {
this.ifActionIDs = ifActionIDs;
}
public Vector < Integer > getActionVariableIDs() {
return ifPropertyIDs;
}
public void setActionVariableIDs(Vector < Integer > ifPropertyIDs) {
this.ifPropertyIDs = ifPropertyIDs;
}
public Vector < Integer > getNullActionIDs() {
return elseActionIDs;
}
public void setNullActionIDs(Vector < Integer > elseActionIDs) {
this.elseActionIDs = elseActionIDs;
}
public Vector < Integer > getNullActionVariableIDs() {
return elsePropertyIDs;
}
public void setNullActionVariableIDs(Vector < Integer > elsePropertyIDs) {
this.elsePropertyIDs = elsePropertyIDs;
}
public Vector < Float > getNumberBank() {
return numberBank;
}
public void setNumberBank(Vector < Float > numberBank) {
this.numberBank = numberBank;
}
public Vector < Float > getNullNumberBank() {
return nullNumberBank;
}
public void setNullNumberBank(Vector < Float > nullNumberBank) {
this.nullNumberBank = nullNumberBank;
}
public Vector < Behavior > getSubBehaviors() {
return subBehaviors;
}
public void setSubBehaviors(Vector < Behavior > subBehaviors) {
this.subBehaviors = subBehaviors;
}
}
| [
"rmartin@bowdoin.edu"
] | rmartin@bowdoin.edu |
505bc49ee9c02b4448a6aee0ef45e06e173a32c7 | c30c711726d87d454110f00425bc334312ee0de9 | /src/ventanas/LimaDiamantada.java | 7ad4e68d5e1830b61064ed396a25265aea0eecc3 | [] | no_license | dapuer95/Busqueda_de_productos | d99bdee489d8ecc580ab4b1e6b98e7550b665251 | 0365a92ffe774a7f62bc2ac99f5890715a92e4a2 | refs/heads/main | 2023-07-18T09:26:00.412960 | 2021-08-30T20:19:24 | 2021-08-30T20:19:24 | 378,510,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,712 | java | package ventanas;
import java.awt.Color;
import java.awt.event.ItemEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashSet;
import javax.swing.JTable;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.JOptionPane;
public class LimaDiamantada extends javax.swing.JFrame {
public static int k = 0;
public static LimaDiamantada obj = null;
public String form = "";
public static String cod = "";
public static String tipo = "";
public static String descripcion = new String();
public static String codigo2 = new String();
ArrayList<String> listalon = new ArrayList();
public HashSet hs = new HashSet();
String data[][] = {};
String cabeza[] = {"Codigo", "Descripción", "Info", "Cotizar", "Total", "Me", "Ca", "Bo", "Ma"};
DefaultTableModel model = new DefaultTableModel(data, cabeza) {
//Metodo que permite que no se púeda editar los valores de la tabla
@Override
public Class getColumnClass(int indiceColumna) {
Object k = getValueAt(0, indiceColumna);
if (k == null) {
return Object.class;
} else {
return k.getClass();
}
}
//Metodo que permite que no se púeda editar los valores de la tabla
@Override
public boolean isCellEditable(int filas, int columnas) {
if (columnas == 9) {
return true;
} else {
return false;
}
}
};
public LimaDiamantada() {
initComponents();
setTitle("Lima diamantada");
this.setLocationRelativeTo(null);
this.setResizable(false);
this.getContentPane().setBackground(Color.WHITE);
cargar_tipo();
cargar_imagen();
}
public static LimaDiamantada getObj() {
if (obj == null) {
obj = new LimaDiamantada();
}
return obj;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
tabla_resultados = new javax.swing.JTable();
Espesor = new javax.swing.JLabel();
combo_tipo = new javax.swing.JComboBox<>();
label_dim = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
menu_recargar = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jLabel1.setText("Seleccione las caracteristicas de la lima");
tabla_resultados.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null}
},
new String [] {
"Codigo", "Descripción", "Info", "Cotizar", "Total", "Me", "Ca", "Bo", "Ma"
}
));
jScrollPane1.setViewportView(tabla_resultados);
if (tabla_resultados.getColumnModel().getColumnCount() > 0) {
tabla_resultados.getColumnModel().getColumn(0).setMaxWidth(50);
tabla_resultados.getColumnModel().getColumn(2).setMaxWidth(40);
tabla_resultados.getColumnModel().getColumn(3).setMaxWidth(50);
tabla_resultados.getColumnModel().getColumn(4).setMaxWidth(38);
tabla_resultados.getColumnModel().getColumn(5).setMaxWidth(27);
tabla_resultados.getColumnModel().getColumn(6).setMaxWidth(27);
tabla_resultados.getColumnModel().getColumn(7).setMaxWidth(27);
tabla_resultados.getColumnModel().getColumn(8).setMaxWidth(27);
}
Espesor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forma_icono.png"))); // NOI18N
Espesor.setText("Forma de la lima");
combo_tipo.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
combo_tipoItemStateChanged(evt);
}
});
jMenu1.setText("Opciones");
menu_recargar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_NUMPAD4, java.awt.event.InputEvent.ALT_MASK));
menu_recargar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/limpiar2_icono.png"))); // NOI18N
menu_recargar.setText("Limpiar");
jMenu1.add(menu_recargar);
jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/recargar_icono.png"))); // NOI18N
jMenuItem2.setText("Regargar");
jMenu1.add(jMenuItem2);
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(18, Short.MAX_VALUE)
.addComponent(label_dim, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGap(128, 128, 128)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Espesor)
.addComponent(combo_tipo, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(layout.createSequentialGroup()
.addGap(92, 92, 92)
.addComponent(jLabel1)))
.addGap(30, 30, 30))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(26, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(label_dim, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(Espesor)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(combo_tipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(10, 10, 10))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void PropiedadesTabla() {
tabla_resultados.setRowHeight(26);
TableColumn codigo = tabla_resultados.getColumn("Codigo");
TableColumn desc = tabla_resultados.getColumn("Descripción");
TableColumn info = tabla_resultados.getColumn("Info");
TableColumn cotizar = tabla_resultados.getColumn("Cotizar");
TableColumn total = tabla_resultados.getColumn("Total");
TableColumn me = tabla_resultados.getColumn("Me");
TableColumn ca = tabla_resultados.getColumn("Ca");
TableColumn bo = tabla_resultados.getColumn("Bo");
TableColumn ma = tabla_resultados.getColumn("Ma");
codigo.setMaxWidth(50);
info.setMaxWidth(40);
cotizar.setMaxWidth(50);
total.setMaxWidth(38);
me.setMaxWidth(27);
bo.setMaxWidth(27);
ca.setMaxWidth(27);
ma.setMaxWidth(27);
}
private void combo_tipoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_combo_tipoItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
buscar();
cargar_imagen();
}
}//GEN-LAST:event_combo_tipoItemStateChanged
private void cargar_imagen() {
form = combo_tipo.getSelectedItem().toString();
System.out.println(form);
ImageIcon imagen1 = new ImageIcon("src/images/lima_diamantada" + form + ".png");
Icon icono1 = new ImageIcon(imagen1.getImage());
label_dim.setIcon(icono1);
}
private void cargar_tipo() {
combo_tipo.removeAllItems();
try {
//Conexión con la base de datos
Connection cn = DriverManager.getConnection("jdbc:mysql://localhost/catalogo", "root", "");
//Instrucciones para la busqueda en la base de datos
PreparedStatement pst = cn.prepareStatement("select distinct tipo from lima_diamantada where (total > 0) order by tipo asc");
ResultSet rs = pst.executeQuery();
//Metodo para que busque todos los resultados posible con las condiciones dadas
while (rs.next()) {
String tipo = rs.getString("tipo");
combo_tipo.addItem(tipo);
}
rs.close();
cn.close();
} catch (Exception e) {
System.out.println("Se perdio la conexión en cargar_des");
}
}
private static boolean isNumeric(String cadena) {
try {
Integer.parseInt(cadena);
return true;
} catch (NumberFormatException nfe) {
return false;
}
}
private void buscar() {
try {
//Conexión con la base de datos
Connection cn5 = DriverManager.getConnection("jdbc:mysql://localhost/catalogo", "root", "");
//Instrucciones para la busqueda en la base de datos
PreparedStatement pst5 = cn5.prepareStatement("select * from lima_diamantada where (total > 0) AND (tipo = ?)");
pst5.setString(1, combo_tipo.getSelectedItem().toString());
// Declaración de la variable que alberga el resultado de la busqueda
ResultSet rs5 = pst5.executeQuery();
//Se limpian los componentes de la tabla luego de cada busqueda
model.setRowCount(0);
//Ajuste de la tabla al JScrollPane
tabla_resultados = new JTable(model);
jScrollPane1.setViewportView(tabla_resultados);
PropiedadesTabla();
//Metodo para que busque todos los resultados posible con las condiciones dadas
while (rs5.next()) {
//txt_codigo.setText(rs.getString("codigo"));
String cod = rs5.getString("codigo");
String estado = rs5.getString("descripcion");
String total = rs5.getString("total");
String me = rs5.getString("me");
String ca = rs5.getString("ca");
String bo = rs5.getString("bo");
String ma = rs5.getString("ma");
cargar_imagen();
ImageIcon imagen1 = new ImageIcon("src/images/informacion.png");
Icon icono1 = new ImageIcon(imagen1.getImage());
ImageIcon imagen2 = new ImageIcon("src/images/carrito.png");
Icon icono2 = new ImageIcon(imagen2.getImage());
model.addRow(new Object[]{cod, estado, icono1, icono2, total, me, ca, bo, ma});
}
rs5.close();
cn5.close();
} catch (Exception e) {
System.out.println("no hay conexion en buscar");
}
//Metodo para mostrar la información del elmento que se encuentra en la fila que selecciona y se da click
tabla_resultados.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
//int fila_point = tabla_resultados.rowAtPoint(e.getPoint());
int fila_point = tabla_resultados.rowAtPoint(e.getPoint());
int columna_point = tabla_resultados.columnAtPoint(e.getPoint());
if (fila_point > -1 && columna_point == 2) {
codigo2 = (String) model.getValueAt(fila_point, columna_point = 0);
descripcion = (String) model.getValueAt(fila_point, columna_point = 1);
InformacionLimaDiamantada informacionlimadiamantada = new InformacionLimaDiamantada();
informacionlimadiamantada.setVisible(true);
codigo2 = "";
}
if (fila_point > -1 && columna_point == 3) {
pdf.contar();
if (pdf.limite <= 49) {
codigo2 = (String) model.getValueAt(fila_point, columna_point = 0);
descripcion = (String) model.getValueAt(fila_point, columna_point = 1);
String canti = JOptionPane.showInputDialog(null, "¿Cuantas unidades del codigo " + codigo2 + "\n desea agregar a la cotización?", "Cantidad", JOptionPane.QUESTION_MESSAGE);
if (isNumeric(canti)) {
k = Integer.parseInt(canti);
} else {
System.out.println("no es posible transformar el string" + canti + "a un número entero");
}
boolean n = isNumeric(canti);
if (isNumeric(canti) && n == true && k > 0) {
pdf.AddRowToJTable(new Object[]{"", codigo2, "", "", "", "", canti});
pdf.cargar_nombre();
pdf.calcular_total();
} else {
JOptionPane.showMessageDialog(null, "Debe ingresar un valor numérico mayor a 0", "Advertencia", HEIGHT);
}
} else {
JOptionPane.showMessageDialog(null, "No es posible agregar mas items a la cotización", "Advertencia", HEIGHT);
}
}
}
});
}
/**
* @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(LimaDiamantada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(LimaDiamantada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(LimaDiamantada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LimaDiamantada.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LimaDiamantada().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel Espesor;
private javax.swing.JComboBox<String> combo_tipo;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel label_dim;
private javax.swing.JMenuItem menu_recargar;
private javax.swing.JTable tabla_resultados;
// End of variables declaration//GEN-END:variables
}
| [
"dpuerta1095@gamil.com"
] | dpuerta1095@gamil.com |
59a9c37ac045008709428cc5ce930fc521be0b20 | 3399c010c394c25f1966fcc97ac4fa6ef42ef4bf | /webchatapp/src/main/java/com/eugene/webchatapp/DAO/UserDAO.java | a92775f81a58f8644416938b90ff50d90c06a6eb | [] | no_license | EugeneSayko/webChat | 8d7b72ad07f22b3a6e274b8e6a860d8f35875d90 | 9f3c84a84986efd1777d43e41264dbc47ab4d684 | refs/heads/master | 2021-01-18T22:48:26.074050 | 2016-05-31T02:40:40 | 2016-05-31T02:40:40 | 51,355,143 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,156 | java | package com.eugene.webchatapp.DAO;
import com.eugene.webchatapp.models.User;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by eugene on 26.05.16.
*/
public class UserDAO {
private static final String SQL_INSERT = "INSERT INTO users(id, name, password) VALUES(?, ?, ?)";
private static final String SQL_ALL_SELECT = "SELECT * FROM users";
private static final String SQL_NAME_SELECT = "SELECT name FROM users";
private static final String SQL_UPDATE_NAME = "UPDATE users set name=? WHERE name = ?";
private static final String SQL_NAME_SELECT_BY_ID = "SELECT name FROM users WHERE id = ?";
private static final String SQL_ID_SELECT_BY_NAME = "SELECT id FROM users WHERE name = ?";
private static final String SQL_USER_SELECT_BY_NAME = "SELECT * FROM users WHERE name=?";
public boolean insertUser(User user){
boolean flag = false;
try(
PreparedStatement ps = ConnectorDB.getConnection().prepareStatement(SQL_INSERT);
) {
ps.setString(1, user.getId());
ps.setString(2, user.getName());
ps.setString(3, user.getPassword());
ps.executeUpdate();
flag = true;
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return flag;
}
public List<User> findAll(){
List<User> users = new ArrayList<>();
try(
Statement statement = ConnectorDB.getConnection().createStatement();
) {
ResultSet resultSet = statement.executeQuery(SQL_ALL_SELECT);
while(resultSet.next()){
User user = new User();
user.setId(resultSet.getString("id"));
user.setName(resultSet.getString("name"));
user.setPassword(resultSet.getString("password"));
users.add(user);
}
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return users;
}
public User findUser(String username){
User user = null;
try(
PreparedStatement preparedStatement = ConnectorDB.getConnection().prepareStatement(SQL_USER_SELECT_BY_NAME);
) {
preparedStatement.setString(1, username);
ResultSet resultSet = preparedStatement.executeQuery();
if(resultSet.next()){
user = new User();
user.setId(resultSet.getString("id"));
user.setName(resultSet.getString("name"));
user.setPassword(resultSet.getString("password"));
}
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return user;
}
public List<String> findName(){
List<String> names = new ArrayList<>();
try(
Statement statement = ConnectorDB.getConnection().createStatement();
) {
ResultSet resultSet = statement.executeQuery(SQL_NAME_SELECT);
while(resultSet.next()){
String name = resultSet.getString("name");
names.add(name);
}
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return names;
}
public boolean updateName(String oldName, String newName){
boolean flag = false;
try(
PreparedStatement ps = ConnectorDB.getConnection().prepareStatement(SQL_UPDATE_NAME);
) {
ps.setString(1, newName);
ps.setString(2, oldName);
ps.executeUpdate();
flag = true;
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return flag;
}
public String findById(String id){
String name = null;
try(
PreparedStatement preparedStatement = ConnectorDB.getConnection().prepareStatement(SQL_NAME_SELECT_BY_ID);
) {
preparedStatement.setString(1, id);
ResultSet resultSet = preparedStatement.executeQuery();
if(resultSet.next()){
name = resultSet.getString("name");
}
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return name;
}
public String findByName(String name){
String id = null;
try(
PreparedStatement preparedStatement = ConnectorDB.getConnection().prepareStatement(SQL_ID_SELECT_BY_NAME);
) {
preparedStatement.setString(1, name);
ResultSet resultSet = preparedStatement.executeQuery();
if(resultSet.next()){
id = resultSet.getString("id");
}
ConnectorDB.closeConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return id;
}
}
| [
"eugene.sayko@gmail.com"
] | eugene.sayko@gmail.com |
e5cdf4a733b27353fb7528186b2f2c1d31d424f5 | 77ac5592cbbd0d48a514d088391a197656033df7 | /api/src/main/java/com/lijingyao/coffee/gateway/api/models/UserCenterModel.java | b953cc45300b506468363543ec80595096c24ae6 | [] | no_license | tanbinh123/gateway_coffeeshop | 16b230fdca1463ec697f55b40b6822408ee00a77 | 87f42098bb9731f520b8947aaa2acc7b68741a32 | refs/heads/master | 2023-06-11T16:54:17.301172 | 2021-07-12T07:30:06 | 2021-07-12T07:30:06 | 475,483,798 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 992 | java | package com.lijingyao.coffee.gateway.api.models;
import java.util.List;
/**
* Created by lijingyao on 2018/7/9 16:45.
*/
public class UserCenterModel {
private Long userId;
private Long registeredTime;
private String nickName;
private List<UserSimpleOrderModel> orderModels;
public List<UserSimpleOrderModel> getOrderModels() {
return orderModels;
}
public void setOrderModels(List<UserSimpleOrderModel> orderModels) {
this.orderModels = orderModels;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRegisteredTime() {
return registeredTime;
}
public void setRegisteredTime(Long registeredTime) {
this.registeredTime = registeredTime;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
| [
"weiwen@zb100.com"
] | weiwen@zb100.com |
7eaf79afe59d54125aaed2662394516f4895f84f | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipseswt_cluster/29343/tar_1.java | 35aaa9309494cc8eaa9522dce60f76e2b2542086 | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,451 | java | package org.eclipse.swt.graphics;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved
*/
import org.eclipse.swt.internal.SerializableCompatibility;
import org.eclipse.swt.*;
/**
* Instances of this class represent rectangular areas in an
* (x, y) coordinate system. The top left corner of the rectangle
* is specified by its x and y values, and the extent of the
* rectangle is specified by its width and height.
* <p>
* The coordinate space for rectangles and points is considered
* to have increasing values downward and to the right from its
* origin making this the normal, computer graphics oriented notion
* of (x, y) coordinates rather than the strict mathematical one.
* </p>
* <p>
* Application code does <em>not</em> need to explicitly release the
* resources managed by each instance when those instances are no longer
* required, and thus no <code>dispose()</code> method is provided.
* </p>
*
* @see Point
*/
public final class Rectangle implements SerializableCompatibility {
/**
* the x coordinate of the rectangle
*/
public int x;
/**
* the y coordinate of the rectangle
*/
public int y;
/**
* the width of the rectangle
*/
public int width;
/**
* the height of the rectangle
*/
public int height;
/**
* Construct a new instance of this class given the
* x, y, width and height values.
*
* @param x the x coordinate of the origin of the rectangle
* @param y the y coordinate of the origin of the rectangle
* @param width the width of the rectangle
* @param height the height of the rectangle
*/
public Rectangle (int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
/**
* Destructively replaces the x, y, width and height values
* in the receiver with ones which represent the union of the
* rectangles specified by the receiver and the given rectangle.
* <p>
* The union of two rectangles is the smallest single rectangle
* that completely covers both of the areas covered by the two
* given rectangles.
* </p>
*
* @param rect the rectangle to merge with the receiver
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* </ul>
*/
public void add (Rectangle rect) {
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
int left = x < rect.x ? x : rect.x;
int top = y < rect.y ? y : rect.y;
int lhs = x + width;
int rhs = rect.x + rect.width;
int right = lhs > rhs ? lhs : rhs;
lhs = y + height;
rhs = rect.y + rect.height;
int bottom = lhs > rhs ? lhs : rhs;
x = left; y = top; width = right - left; height = bottom - top;
}
/**
* Returns <code>true</code> if the point specified by the
* arguments is inside the area specified by the receiver,
* and <code>false</code> otherwise.
*
* @param x the x coordinate of the point to test for containment
* @param y the y coordinate of the point to test for containment
* @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
*/
public boolean contains (int x, int y) {
return (x >= this.x) && (y >= this.y) && ((x - this.x) < width) && ((y - this.y) < height);
}
/**
* Returns <code>true</code> if the given point is inside the
* area specified by the receiver, and <code>false</code>
* otherwise.
*
* @param pt the point to test for containment
* @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* </ul>
*/
public boolean contains (Point pt) {
if (pt == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
return contains(pt.x, pt.y);
}
/**
* Compares the argument to the receiver, and returns true
* if they represent the <em>same</em> object using a class
* specific comparison.
*
* @param object the object to compare with this object
* @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
*
* @see #hashCode
*/
public boolean equals (Object object) {
if (object == this) return true;
if (!(object instanceof Rectangle)) return false;
Rectangle r = (Rectangle)object;
return (r.x == this.x) && (r.y == this.y) && (r.width == this.width) && (r.height == this.height);
}
/**
* Returns an integer hash code for the receiver. Any two
* objects which return <code>true</code> when passed to
* <code>equals</code> must return the same value for this
* method.
*
* @return the receiver's hash
*
* @see #equals
*/
public int hashCode () {
return x ^ y ^ width ^ height;
}
/**
* Returns a new rectangle which represents the intersection
* of the receiver and the given rectangle.
* <p>
* The intersection of two rectangles is the rectangle that
* covers the area which is contained within both rectangles.
* </p>
*
* @param rect the rectangle to intersect with the receiver
* @return the intersection of the receiver and the argument
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* </ul>
*/
public Rectangle intersection (Rectangle rect) {
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (this == rect) return new Rectangle (x, y, width, height);
int left = x > rect.x ? x : rect.x;
int top = y > rect.y ? y : rect.y;
int lhs = x + width;
int rhs = rect.x + rect.width;
int right = lhs < rhs ? lhs : rhs;
lhs = y + height;
rhs = rect.y + rect.height;
int bottom = lhs < rhs ? lhs : rhs;
return new Rectangle (
right < left ? 0 : left,
bottom < top ? 0 : top,
right < left ? 0 : right - left,
bottom < top ? 0 : bottom - top);
}
/**
* Returns <code>true</code> if the given rectangle intersects
* with the receiver and <code>false</code> otherwise.
* <p>
* Two rectangles intersect if the area of the rectangle
* representing their intersection is not empty.
* </p>
*
* @param rect the rectangle to test for intersection
* @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* </ul>
*
* @see #intersection
* @see #isEmpty
*/
public boolean intersects (Rectangle rect) {
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
return (rect == this) || (rect.x < x + width) && (rect.y < y + height) &&
(rect.x + rect.width > x) && (rect.y + rect.height > y);
}
/**
* Returns <code>true</code> if the receiver does not cover any
* area in the (x, y) coordinate plane, and <code>false</code> if
* the receiver does cover some area in the plane.
* <p>
* A rectangle is considered to <em>cover area</em> in the
* (x, y) coordinate plane if both its width and height are
* non-zero.
* </p>
*
* @return <code>true</code> if the receiver is empty, and <code>false</code> otherwise
*/
public boolean isEmpty () {
return (width <= 0) || (height <= 0);
}
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the rectangle
*/
public String toString () {
return "Rectangle {" + x + ", " + y + ", " + width + ", " + height + "}";
}
/**
* Returns a new rectangle which represents the union of
* the receiver and the given rectangle.
* <p>
* The union of two rectangles is the smallest single rectangle
* that completely covers both of the areas covered by the two
* given rectangles.
* </p>
*
* @param rect the rectangle to perform union with
* @return the union of the receiver and the argument
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
* </ul>
*
* @see #add
*/
public Rectangle union (Rectangle rect) {
if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
int left = x < rect.x ? x : rect.x;
int top = y < rect.y ? y : rect.y;
int lhs = x + width;
int rhs = rect.x + rect.width;
int right = lhs > rhs ? lhs : rhs;
lhs = y + height;
rhs = rect.y + rect.height;
int bottom = lhs > rhs ? lhs : rhs;
return new Rectangle (left, top, right - left, bottom - top);
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
f026678423261842765eaf01ab23a2cae2669857 | 2c7b377aa88a740c45c92d58c608ecf0af897b91 | /src/main/java/br/com/zup/forum/repository/CursoRepository.java | c91c0e8cc84eb04e41b2a6a5d03d88f8316565cb | [] | no_license | jocimar-dev/api-rest-zup | 1e6dc2841dfe11f9af40d5ce16614379f8274004 | 92b00b908d6b2bd995ef62d72ff8b4e10469bf0c | refs/heads/master | 2023-02-17T20:16:04.223200 | 2021-01-19T13:29:10 | 2021-01-19T13:29:10 | 329,911,561 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package br.com.zup.forum.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import br.com.zup.forum.modelo.Curso;
public interface CursoRepository extends JpaRepository<Curso, Long> {
Curso findByNome(String nome);
}
| [
"jocimarneres@gmail.com"
] | jocimarneres@gmail.com |
0f2aeacb754cfdaa6590fd9a9c52a3a4070607b5 | b21abac50f72e1b9ee188885e796a2d274ec7764 | /src/main/java/com/jianglei/mstransfer/service/UserService.java | 410ed015cb6e5ca594fd78f7b71a36a3e9b83887 | [] | no_license | hanhongyuan/springboot-mybatis-typehandler | 68b15de0af1cd17f3d8cfae0fe5126716369c414 | 6b761243f4bfeca5a9187e685ac1688fdd551dc4 | refs/heads/master | 2021-01-16T18:09:18.790109 | 2017-07-25T14:17:44 | 2017-07-25T14:17:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package com.jianglei.mstransfer.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianglei.mstransfer.dao.CommonDao;
import com.jianglei.mstransfer.datasource.TargetDataSource;
import com.jianglei.mstransfer.model.OtherInfo2;
import com.jianglei.mstransfer.model.User;
@Service
public class UserService {
@Autowired
private CommonDao dao;
@TargetDataSource(name="ds1")
public void test() {
try {
User user = dao.selectOne("user.get", 1);
System.err.println(user);
List<OtherInfo2> list = user.getList();
System.out.println(list);
System.out.println(user.getArray());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"1182624347@qq.com"
] | 1182624347@qq.com |
d95c526ecb0a015885f104182d92bbbd670890ae | 1a87782f4f85436c4ff242eae2566b318fc9dff4 | /LookupMethod_DI/src/beans/CarImpl.java | aa565f4d3f6ef26cdef48ea088b9e97aeb85fa95 | [] | no_license | kishanpanchal91/spring | 5df1b4fbde9361bd1a3adb417031c4da33b38843 | 964e11ef01f430e209b568bea7480d8714de43e8 | refs/heads/master | 2020-03-08T05:14:15.605137 | 2018-04-19T07:02:26 | 2018-04-19T07:02:26 | 127,943,227 | 0 | 0 | null | 2018-04-19T07:02:27 | 2018-04-03T17:21:27 | Java | UTF-8 | Java | false | false | 47 | java | package beans;
public class CarImpl {
}
| [
"kishanpanchal91@gmail.com"
] | kishanpanchal91@gmail.com |
78fb39c4100745d014cb62fc49e0630f5c563c2c | 0144eb8f55aacb99d954ba89f6189dfd68aac581 | /src/main/java/com/algaworks/algafood/domain/repository/UserRepository.java | 55e41cf8a25c993231ed98e9ca3ae899b3cd09eb | [] | no_license | flavioso16/espec-spring-algaworks | 9b7bc891dde4f08c955bf0be6356654a3c83f436 | 2b385236f467343d01b9d255c0e6faac07dd1f42 | refs/heads/master | 2023-05-05T13:18:15.545143 | 2021-05-30T23:52:04 | 2021-05-30T23:52:04 | 302,503,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 468 | java | package com.algaworks.algafood.domain.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.algaworks.algafood.domain.model.User;
@Repository
public interface UserRepository extends CustomJpaRepository<User, Long> {
@Query("SELECT COUNT(u) > 0 FROM User u WHERE u.email = :email and (:id is null or u.id <> :id)")
boolean existsByEmailAndIdNot(final String email, final Long id);
}
| [
"flaoliveira@uolinc.com"
] | flaoliveira@uolinc.com |
067154f9322fd70c6cc3e7d4af0fc036f3e2410c | 5f0f49daae1ad972c9fd0cb0b10594f9ab329d78 | /SRM 671 DIV 2/test/BearPaintsTest.java | 641cbde0f684e30363057e9c5fbb657b03156b72 | [] | no_license | lyveng/topcoder | 68a6c16a0e52efd4047ec7b78b5c7f1a51dd8f24 | a3faed5bf898d6ab7a4cebcca7f567ecea6207e8 | refs/heads/master | 2021-06-12T17:06:56.595248 | 2017-01-15T17:37:54 | 2017-01-15T17:37:54 | 22,494,337 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | import org.junit.Test;
import static org.junit.Assert.*;
public class BearPaintsTest {
@Test(timeout=2000)
public void test0() {
int W = 3;
int H = 5;
long M = 14L;
assertEquals(12L, new BearPaints().maxArea(W, H, M));
}
@Test(timeout=2000)
public void test1() {
int W = 4;
int H = 4;
long M = 10L;
assertEquals(9L, new BearPaints().maxArea(W, H, M));
}
@Test(timeout=2000)
public void test2() {
int W = 1000000;
int H = 12345;
long M = 1000000000000L;
assertEquals(12345000000L, new BearPaints().maxArea(W, H, M));
}
@Test(timeout=2000)
public void test3() {
int W = 1000000;
int H = 1000000;
long M = 720000000007L;
assertEquals(720000000000L, new BearPaints().maxArea(W, H, M));
}
@Test(timeout=2000)
public void test4() {
int W = 1000000;
int H = 1000000;
long M = 999999999999L;
assertEquals(999999000000L, new BearPaints().maxArea(W, H, M));
}
}
| [
"livingstone.s.e@gmail.com"
] | livingstone.s.e@gmail.com |
2d38815672cd25ecda76a93ea9a4e20949c7b4e5 | 0f7d80765671d72f7271a568daa13bacb3c4eff4 | /app/src/main/java/com/example/project/Tab2Fragment.java | df39738f5701b7e6c3a53557eb9ccb9fe98dea4c | [] | no_license | NayanaBannur/OCR-App | 5792cf260cde25c2fd84311925ccb7623af23bb8 | 957734007dd33881b0b761badecb5951ee4015ad | refs/heads/master | 2021-05-18T12:07:00.278541 | 2020-03-30T08:14:33 | 2020-03-30T08:14:33 | 251,237,958 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,418 | java | package com.example.project;
import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class Tab2Fragment extends Fragment {
private String str_textpath;
private int mode;
private Context context;
private View view;
public Tab2Fragment(String str_textpath, int mode, Context context)
{
this.str_textpath = str_textpath;
this.mode = mode;
this.context = context;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
view = inflater.inflate(R.layout.fragment2, container, false);
TextView text = view.findViewById(R.id.display_text);
String t;
if(mode==Constants.LOCAL_MODE)
{
t = readFileLocal(str_textpath);
if(t.equals(""))
text.setText(getText(R.string.file_open_fail));
else
text.setText(t);
}
else
readFileCloud(str_textpath);
return view;
}
private String readFileLocal(String textpath)
{
File root = new File(Environment.getExternalStorageDirectory(), "OCRFiles");
if (!root.exists()) {
return "";
}
File file = new File(root, textpath);
StringBuilder text = new StringBuilder();
try
{
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
text.append(line);
text.append(' ');
}
br.close();
return text.toString();
}
catch (IOException e) {
Log.d("FILE DEBUG", e.getMessage());
return "";
}
}
private void readFileCloud(String textpath)
{
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReferenceFromUrl(str_textpath);
final long ONE_MEGABYTE = 1024 * 1024;
storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>()
{
@Override
public void onSuccess(byte[] bytes)
{
TextView text = view.findViewById(R.id.display_text);
try
{
String ftext = new String(bytes, "UTF-8");
text.setText(ftext);
} catch (IOException e)
{
text.setText(getText(R.string.file_open_fail));
Log.d("FILE READ", "Error: " + e.getMessage());
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
}
});
}
}
| [
"moonlace45@gmail.com"
] | moonlace45@gmail.com |
92aa51a185c253e8c77415ef7908e3ca41270a60 | d620ab67aa540c7d8466325a39f962fcf074bd06 | /modules/petals-messaging/src/main/java/org/ow2/petals/messaging/framework/message/mime/writer/TextPlainWriter.java | 9f0ba925a53d2e860526e741ef94d7880aaebe40 | [] | no_license | chamerling/petals-dsb | fa8439f28bb4077a9324371d7eb691b484a12d24 | 58b355b79f4a4d753a3c762f619ec2b32833549a | refs/heads/master | 2016-09-05T20:44:59.125937 | 2012-03-27T10:28:37 | 2012-03-27T10:28:37 | 3,722,608 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,811 | java | /**
* PETALS: PETALS Services Platform Copyright (C) 2009 EBM WebSourcing
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or any later version.
*
* This library 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* Initial developer(s): EBM WebSourcing
*/
package org.ow2.petals.messaging.framework.message.mime.writer;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.ow2.petals.messaging.framework.message.Constants;
import org.ow2.petals.messaging.framework.message.Message;
import org.ow2.petals.messaging.framework.message.mime.Writer;
/**
* @author chamerling - eBM WebSourcing
*
*/
public class TextPlainWriter implements Writer {
/**
* {@inheritDoc}
*/
public byte[] getBytes(Message message, String encoding) throws WriterException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
// content is is a property...
Object o = message.get(Constants.RAW);
if ((o != null) && (o instanceof String)) {
try {
out.write(((String) o).getBytes());
} catch (IOException e) {
throw new WriterException(e);
}
}
return out.toByteArray();
}
}
| [
"christophe.hamerling@gmail.com"
] | christophe.hamerling@gmail.com |
1ee06d43273f40ce608cfc349bbefe69c00a1888 | 9e5e9c6c91ddfcff96c822fb5e395cc66eebda7a | /src/main/java/multithread/byThread/ThreadStopDemo.java | 584854aeb63efa539557747d620eb2a8cd2c869e | [] | no_license | seventheluck/JavaDemo | 845415693dd198ef79fc70106f90cb7511aa5c8e | 341c96ddb48669e14c2c51cb424c4ce4dae28d54 | refs/heads/master | 2020-04-18T10:20:04.464594 | 2019-01-25T02:40:22 | 2019-01-25T02:40:22 | 167,464,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package multithread.byThread;
public class ThreadStopDemo {
public static void main(String[] args) {
ThreadStop ts1 = new ThreadStop();
ts1.start();
try {
Thread.sleep(3000);
System.out.println(Thread.currentThread().getName());
ts1.interrupt();
} catch (InterruptedException e) {
}
}
}
| [
"seventheluck@gmail.com"
] | seventheluck@gmail.com |
6b35ec6bd64047375cc047da25ee60bd731ce0dc | bc9cc198d05d4641e350ebab9c3ad61415355deb | /src/main/java/com/imooc/mall/controller/CategoryController.java | 1effb290ef42643fb25fa5fdefd1323555b1f8b5 | [] | no_license | lhy717098106/imooc-mall | 8138db8e4dbff3e6b8ec6866e38a625595a785cd | 8e452ffe2e6bdd4155916f17f96e5500248092ad | refs/heads/master | 2023-08-28T15:10:14.888875 | 2021-10-29T22:22:57 | 2021-10-29T22:22:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,185 | java | package com.imooc.mall.controller;
import com.github.pagehelper.PageInfo;
import com.imooc.mall.common.ApiRestResponse;
import com.imooc.mall.common.Constant;
import com.imooc.mall.exception.ImoocMallExceptionEnum;
import com.imooc.mall.model.pojo.Category;
import com.imooc.mall.model.pojo.User;
import com.imooc.mall.model.request.AddCategoryReq;
import com.imooc.mall.model.request.UpdateCategoryReq;
import com.imooc.mall.model.vo.CategoryVO;
import com.imooc.mall.service.CategoryService;
import com.imooc.mall.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import java.util.List;
/**
* 描述:目录Controller
*/
@Controller
public class CategoryController {
@Autowired
UserService userService;
@Autowired
CategoryService categoryService;
/**
* 后台添加目录
* @param session
* @param addCategoryReq
* @return
*/
@ApiOperation("后台添加目录")
@PostMapping("/admin/category/add")
@ResponseBody
public ApiRestResponse addCategory(HttpSession session,@Valid @RequestBody AddCategoryReq addCategoryReq) {
User currentUser = (User) session.getAttribute(Constant.IMOOC_MALL_USER);
if (currentUser == null) {
return ApiRestResponse.error(ImoocMallExceptionEnum.NEED_LOGIN);
}
//校验是否是管理员
boolean adminRole = userService.checkAdminRole(currentUser);
if (adminRole) {
// 是管理员,执行操作
categoryService.add(addCategoryReq);
return ApiRestResponse.success();
} else {
return ApiRestResponse.error(ImoocMallExceptionEnum.NEED_ADMIN);
}
}
@ApiOperation("后台更新目录")
@PostMapping("/admin/category/update")
@ResponseBody //这这两个注解不需要 入参校验 入参格式可以为json
public ApiRestResponse updateCategory(@Valid @RequestBody UpdateCategoryReq updateCategoryReq, HttpSession session ){
User currentUser = (User) session.getAttribute(Constant.IMOOC_MALL_USER);
if (currentUser == null) {
return ApiRestResponse.error(ImoocMallExceptionEnum.NEED_LOGIN);
}
//校验是否是管理员
boolean adminRole = userService.checkAdminRole(currentUser);
if (adminRole) {
// 是管理员,执行操作
Category category = new Category();
BeanUtils.copyProperties(updateCategoryReq, category);
categoryService.update(category);
return ApiRestResponse.success();
} else {
return ApiRestResponse.error(ImoocMallExceptionEnum.NEED_ADMIN);
}
}
@ApiOperation("后台删除目录")
@PostMapping("/admin/category/delete")
@ResponseBody
public ApiRestResponse deleteCategory(@RequestParam Integer id) {
categoryService.delete(id);
return ApiRestResponse.success();
}
@ApiOperation("后台目录列表")
@PostMapping("admin/category/list") //资源前面的斜杠可以不要
@ResponseBody
public ApiRestResponse listCategoryForAdmin(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
PageInfo pageInfo = categoryService.listForAdmin(pageNum, pageSize);
return ApiRestResponse.success(pageInfo);
}
@ApiOperation("前台目录列表")
@PostMapping("category/list") //资源前面的斜杠可以不要
@ResponseBody
public ApiRestResponse listCategoryForCoustomer() {
List<CategoryVO> categoryVOS = categoryService.listCategoryForCustomer(0); // 0 把1 2 3级目录全部查出来 重构
return ApiRestResponse.success(categoryVOS);
}
} | [
"865684885@qq.com"
] | 865684885@qq.com |
8505d2f7ad3bf10d924acf096a40b09c49943515 | d653029a119100465a908e663bf795c4dedfe43a | /src/main/java/com/common/business/planmgr/pre/mkoutline/web/TResearchOutlineController.java | 6e7e06b01d628ead81cd78456371e3080a6ad34a | [] | no_license | MengleiZhao/bg_perfm-main | d59740a42995e3b39c5ddbd0df710d87798f3e80 | 38751d15947984159da0069b54c8db547c55bbb3 | refs/heads/master | 2023-05-01T01:54:00.791997 | 2021-05-08T05:51:39 | 2021-05-08T05:51:39 | 365,401,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package com.common.business.planmgr.pre.mkoutline.web;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
* 拟定调研提纲 前端控制器
* </p>
*
* @author 田鑫艳
* @since 2021-04-21
*/
@Controller
@RequestMapping("/tResearchOutline")
public class TResearchOutlineController {
}
| [
"649387483@qq.com"
] | 649387483@qq.com |
801ad7fcdda01261476143e125ae4988b66df1ed | 5fec6ada5d31676846cb72f9d4d975b546446818 | /wechat-spring/src/main/java/weixin/mp/infrastructure/exceptions/ClientError.java | 93b3d457fac0c32d6e4183de7ff9e0278450d9de | [] | no_license | iMinusMinus/wechat | b73b626e869fcc0ad74df7b557d8725bbaabb1b9 | f18b45dce74d5207031ec0294501db290740cb2e | refs/heads/master | 2023-04-14T17:07:44.902995 | 2023-04-05T07:28:50 | 2023-04-05T07:28:50 | 105,130,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package weixin.mp.infrastructure.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
public class ClientError extends ResponseStatusException {
private final int code;
private final String message;
public ClientError(int code, String message, HttpStatus status) {
super(status, message);
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
@Override
public String getMessage() {
return message;
}
}
| [
"mean.leung@outlook.com"
] | mean.leung@outlook.com |
77d625fd4b1da010db7dd6267ac3c6528360c35e | 44fbb8167cbe88c61113402b855d9fd3fff88d7e | /P5_02_Todoc/app/src/androidTest/java/com/cleanup/todoc/TodocAppTest.java | 041bb9d8a2b2ad76c4b723a9f1cd39e4d62d582d | [] | no_license | DsMikael/Projet_5_Todoc | ade49006ff4aabf70f3e505e236a4e2214b45e58 | fe448ad245161a86931060e172f6b5cd5e29f541 | refs/heads/master | 2023-06-22T04:05:41.891860 | 2021-07-19T09:43:21 | 2021-07-19T09:43:21 | 370,989,496 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package com.cleanup.todoc;
import android.app.Application;
import org.koin.android.java.KoinAndroidApplication;
import org.koin.core.KoinApplication;
import org.koin.core.logger.Level;
import static com.cleanup.todoc.AppModulesKt.getAppDataTestModule;
import static org.koin.core.context.DefaultContextExtKt.startKoin;
public class TodocAppTest extends Application {
@Override public void onCreate() {
super.onCreate();
KoinApplication koinApplication = KoinAndroidApplication
.create(this, Level.INFO)
.modules(getAppDataTestModule());
startKoin(koinApplication);
}
} | [
"mickael.silva@live.com"
] | mickael.silva@live.com |
488d62cde11424498313590c7cca9e29669d4326 | 34b713d69bae7d83bb431b8d9152ae7708109e74 | /admin/broadleaf-contentmanagement-module/src/main/java/org/broadleafcommerce/cms/page/domain/PageTemplateFieldGroupXref.java | 22945d63ace6029463be91545bb48c9457aa3cf6 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sinotopia/BroadleafCommerce | d367a22af589b51cc16e2ad094f98ec612df1577 | 502ff293d2a8d58ba50a640ed03c2847cb6369f6 | refs/heads/BroadleafCommerce-4.0.x | 2021-01-23T14:14:45.029362 | 2019-07-26T14:18:05 | 2019-07-26T14:18:05 | 93,246,635 | 0 | 0 | null | 2017-06-03T12:27:13 | 2017-06-03T12:27:13 | null | UTF-8 | Java | false | false | 1,466 | java | /*
* #%L
* BroadleafCommerce CMS Module
* %%
* Copyright (C) 2009 - 2014 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.cms.page.domain;
import org.broadleafcommerce.cms.field.domain.FieldGroup;
import org.broadleafcommerce.common.copy.MultiTenantCloneable;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*
* @author Kelly Tisdell
*
*/
public interface PageTemplateFieldGroupXref extends Serializable, MultiTenantCloneable<PageTemplateFieldGroupXref> {
public void setId(Long id);
public Long getId();
public void setPageTemplate(PageTemplate pageTemplate);
public PageTemplate getPageTemplate();
public void setFieldGroup(FieldGroup fieldGroup);
public FieldGroup getFieldGroup();
public void setGroupOrder(BigDecimal groupOrder);
public BigDecimal getGroupOrder();
}
| [
"sinosie7en@gmail.com"
] | sinosie7en@gmail.com |
39b87e5990708b1974fb741cfee67a72ee1bf3d6 | c61248a7c3765f919966f64898979ecaab644025 | /src/main/java/com/qdum/llhb/trademana/model/AlipayPlatPayRecord.java | b91f51ea3ded28d97a3d31827f1dc1b4a1f1d6d6 | [] | no_license | zxc0622/llyb | 352a0c9bca05e4ebc3ddf66a832d3a5d57a1a42b | ea0a93c55cbdc1a41fd8c6ef199e264e988fbd6e | refs/heads/master | 2021-01-21T11:03:39.851793 | 2017-03-01T06:58:36 | 2017-03-01T06:58:36 | 83,519,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,480 | java | package com.qdum.llhb.trademana.model;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Model;
import com.qdum.llhb.fund.FundVariationTypeEnum;
import com.qdum.llhb.fund.model.Fund;
import com.qdum.llhb.sys.utils.UserUtils;
import com.qdum.llhb.trademana.enumvalue.RepositStatusEnum;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 平台付款支付宝状态记录表
* Created by chao on 2016/1/15.
*/
public class AlipayPlatPayRecord extends Model<AlipayPlatPayRecord> {
public static AlipayPlatPayRecord dao = new AlipayPlatPayRecord();
public Boolean afterAlipayPlatPay(Map<String, String> map) {
createAlipayPlatPayRecord(map);
String successDetails = map.get("success_details");
RepositRecord repositRecord = RepositRecord.dao.queryRepositRecord(map.get("batch_no"));
Long userID = repositRecord.getLong("user_id");
if (StrKit.notBlank(successDetails)) {
String[] infos = successDetails.split("^");
float money = Float.valueOf(infos[3]);
float charge = repositRecord.getFloat("charge");
float resultMoney = money - charge;
Fund fund = Fund.dao.changeFund(resultMoney, userID.toString(), FundVariationTypeEnum.reduce);
RepositRecord.dao.updateRepositRecord(repositRecord, RepositStatusEnum.success, fund.getFloat("fund"));
} else {
Fund fund = Fund.dao.queryUserFund(userID);
RepositRecord.dao.updateRepositRecord(repositRecord, RepositStatusEnum.fail, fund.getFloat("fund"));
}
return Boolean.TRUE;
}
/**
* 创建平台支付记录
*
* @param map
* @return
*/
public AlipayPlatPayRecord createAlipayPlatPayRecord(Map<String, String> map) {
AlipayPlatPayRecord alipayPlatPayRecord = new AlipayPlatPayRecord();
Map<String, Object> resultMap = new HashMap<String, Object>();
for (Map.Entry<String, String> entry : map.entrySet()) {
resultMap.put(entry.getKey(), entry.getValue());
}
resultMap.put("create_by", UserUtils.getUser().getId());
resultMap.put("create_date", new Date());
resultMap.put("del_flag", false);
alipayPlatPayRecord.setAttrs(resultMap);
boolean isSuccess = alipayPlatPayRecord.save();
if (isSuccess) {
return alipayPlatPayRecord;
} else {
return null;
}
}
}
| [
"1748893247@qq.com"
] | 1748893247@qq.com |
70076f2c9ccbb139b57830d540477efc5d35f2ca | 02f6ba10fe7863bcf15993c65fbdba7a4bd59f90 | /Einsendeaufgabe_I/bib/clockman/Clockman.java | ef963910e770f536f6f11aad55cde39c9f048694 | [] | no_license | ChrM3r/Programmierung_I | f4391bc594d5f4c4d288c5611178463134de3856 | 5f6747ce73beb5570459a25d03de773451c64246 | refs/heads/master | 2021-05-05T18:03:50.768955 | 2018-01-15T06:02:45 | 2018-01-15T06:02:45 | 117,460,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 849 | java | package vfh.Einsendeaufgabe_I.bib.clockman;
import java.applet.*;
/**
* Ueberschrift: Clockman
* Copyright: Copyright (c) A. Schmidt
* Organisation: VFH - BHT Berlin
* @author A. Schmidt
* @version 1.0
*/
public class Clockman extends Applet
{
private Clockman_Frame Clockman1 = null;
//Das Applet konstruieren
public Clockman()
{
}
//Das Applet initialisieren
public void init()
{
Clockman1 = new Clockman_Frame(100,100,300,300);
}
//Das Applet starten
public void start()
{
}
//Das Applet anhalten
public void stop()
{
}
//Das Applet loeschen
public void destroy()
{
Clockman1 = null;
}
//Applet-Information holen
public String getAppletInfo()
{
return "Applet-Information";
}
//Parameter-Infos holen
public String[][] getParameterInfo()
{
return null;
}
} | [
"chris.merscher@beuth-hochschule.de"
] | chris.merscher@beuth-hochschule.de |
10b0f0801bd7d46c1cf33c9f82570a8e3c6066e0 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_13ade46b5320f3c1982e8e9bc39508bb7fc647db/AccountSyncSettings/9_13ade46b5320f3c1982e8e9bc39508bb7fc647db_AccountSyncSettings_t.java | 515e648d9c50536ad89d8f294cdb30e4e7f45407 | [] | 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 | 22,593 | java | /*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.accounts;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SyncAdapterType;
import android.content.SyncInfo;
import android.content.SyncStatusInfo;
import android.content.pm.ProviderInfo;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.settings.R;
import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
public class AccountSyncSettings extends AccountPreferenceBase {
public static final String ACCOUNT_KEY = "account";
protected static final int MENU_REMOVE_ACCOUNT_ID = Menu.FIRST;
private static final int MENU_SYNC_NOW_ID = Menu.FIRST + 1;
private static final int MENU_SYNC_CANCEL_ID = Menu.FIRST + 2;
private static final int REALLY_REMOVE_DIALOG = 100;
private static final int FAILED_REMOVAL_DIALOG = 101;
private static final int CANT_DO_ONETIME_SYNC_DIALOG = 102;
private TextView mUserId;
private TextView mProviderId;
private ImageView mProviderIcon;
private TextView mErrorInfoView;
private java.text.DateFormat mDateFormat;
private java.text.DateFormat mTimeFormat;
private Account mAccount;
// List of all accounts, updated when accounts are added/removed
// We need to re-scan the accounts on sync events, in case sync state changes.
private Account[] mAccounts;
private ArrayList<SyncStateCheckBoxPreference> mCheckBoxes =
new ArrayList<SyncStateCheckBoxPreference>();
private ArrayList<String> mInvisibleAdapters = Lists.newArrayList();
@Override
public Dialog onCreateDialog(final int id) {
Dialog dialog = null;
if (id == REALLY_REMOVE_DIALOG) {
dialog = new AlertDialog.Builder(getActivity())
.setTitle(R.string.really_remove_account_title)
.setMessage(R.string.really_remove_account_message)
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(R.string.remove_account_label,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
AccountManager.get(AccountSyncSettings.this.getActivity())
.removeAccount(mAccount,
new AccountManagerCallback<Boolean>() {
public void run(AccountManagerFuture<Boolean> future) {
boolean failed = true;
try {
if (future.getResult() == true) {
failed = false;
}
} catch (OperationCanceledException e) {
// handled below
} catch (IOException e) {
// handled below
} catch (AuthenticatorException e) {
// handled below
}
if (failed) {
showDialog(FAILED_REMOVAL_DIALOG);
} else {
finish();
}
}
}, null);
}
})
.create();
} else if (id == FAILED_REMOVAL_DIALOG) {
dialog = new AlertDialog.Builder(getActivity())
.setTitle(R.string.really_remove_account_title)
.setPositiveButton(android.R.string.ok, null)
.setMessage(R.string.remove_account_failed)
.create();
} else if (id == CANT_DO_ONETIME_SYNC_DIALOG) {
dialog = new AlertDialog.Builder(getActivity())
.setTitle(R.string.cant_sync_dialog_title)
.setMessage(R.string.cant_sync_dialog_message)
.setPositiveButton(android.R.string.ok, null)
.create();
}
return dialog;
}
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.account_sync_screen, container, false);
initializeUi(view);
return view;
}
protected void initializeUi(final View rootView) {
addPreferencesFromResource(R.xml.account_sync_settings);
mErrorInfoView = (TextView) rootView.findViewById(R.id.sync_settings_error_info);
mErrorInfoView.setVisibility(View.GONE);
mUserId = (TextView) rootView.findViewById(R.id.user_id);
mProviderId = (TextView) rootView.findViewById(R.id.provider_id);
mProviderIcon = (ImageView) rootView.findViewById(R.id.provider_icon);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final Activity activity = getActivity();
mDateFormat = DateFormat.getDateFormat(activity);
mTimeFormat = DateFormat.getTimeFormat(activity);
Bundle arguments = getArguments();
if (arguments == null) {
Log.e(TAG, "No arguments provided when starting intent. ACCOUNT_KEY needed.");
return;
}
mAccount = (Account) arguments.getParcelable(ACCOUNT_KEY);
if (mAccount != null) {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "Got account: " + mAccount);
mUserId.setText(mAccount.name);
mProviderId.setText(mAccount.type);
}
}
@Override
public void onResume() {
final Activity activity = getActivity();
AccountManager.get(activity).addOnAccountsUpdatedListener(this, null, false);
updateAuthDescriptions();
onAccountsUpdated(AccountManager.get(activity).getAccounts());
super.onResume();
}
@Override
public void onPause() {
super.onPause();
AccountManager.get(getActivity()).removeOnAccountsUpdatedListener(this);
}
private void addSyncStateCheckBox(Account account, String authority) {
SyncStateCheckBoxPreference item =
new SyncStateCheckBoxPreference(getActivity(), account, authority);
item.setPersistent(false);
final ProviderInfo providerInfo = getPackageManager().resolveContentProvider(authority, 0);
if (providerInfo == null) {
return;
}
CharSequence providerLabel = providerInfo.loadLabel(getPackageManager());
if (TextUtils.isEmpty(providerLabel)) {
Log.e(TAG, "Provider needs a label for authority '" + authority + "'");
return;
}
String title = getString(R.string.sync_item_title, providerLabel);
item.setTitle(title);
item.setKey(authority);
mCheckBoxes.add(item);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuItem removeAccount = menu.add(0, MENU_REMOVE_ACCOUNT_ID, 0,
getString(R.string.remove_account_label))
.setIcon(R.drawable.ic_menu_delete_holo_dark);
MenuItem syncNow = menu.add(0, MENU_SYNC_NOW_ID, 0,
getString(R.string.sync_menu_sync_now))
.setIcon(R.drawable.ic_menu_refresh_holo_dark);
MenuItem syncCancel = menu.add(0, MENU_SYNC_CANCEL_ID, 0,
getString(R.string.sync_menu_sync_cancel))
.setIcon(com.android.internal.R.drawable.ic_menu_close_clear_cancel);
removeAccount.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER |
MenuItem.SHOW_AS_ACTION_WITH_TEXT);
syncNow.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER |
MenuItem.SHOW_AS_ACTION_WITH_TEXT);
syncCancel.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER |
MenuItem.SHOW_AS_ACTION_WITH_TEXT);
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
boolean syncActive = ContentResolver.getCurrentSync() != null;
menu.findItem(MENU_SYNC_NOW_ID).setVisible(!syncActive);
menu.findItem(MENU_SYNC_CANCEL_ID).setVisible(syncActive);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_SYNC_NOW_ID:
startSyncForEnabledProviders();
return true;
case MENU_SYNC_CANCEL_ID:
cancelSyncForEnabledProviders();
return true;
case MENU_REMOVE_ACCOUNT_ID:
showDialog(REALLY_REMOVE_DIALOG);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
if (preference instanceof SyncStateCheckBoxPreference) {
SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) preference;
String authority = syncPref.getAuthority();
Account account = syncPref.getAccount();
boolean syncAutomatically = ContentResolver.getSyncAutomatically(account, authority);
if (syncPref.isOneTimeSyncMode()) {
requestOrCancelSync(account, authority, true);
} else {
boolean syncOn = syncPref.isChecked();
boolean oldSyncState = syncAutomatically;
if (syncOn != oldSyncState) {
// if we're enabling sync, this will request a sync as well
ContentResolver.setSyncAutomatically(account, authority, syncOn);
// if the master sync switch is off, the request above will
// get dropped. when the user clicks on this toggle,
// we want to force the sync, however.
if (!ContentResolver.getMasterSyncAutomatically() || !syncOn) {
requestOrCancelSync(account, authority, syncOn);
}
}
}
return true;
} else {
return super.onPreferenceTreeClick(preferences, preference);
}
}
private void startSyncForEnabledProviders() {
requestOrCancelSyncForEnabledProviders(true /* start them */);
getActivity().invalidateOptionsMenu();
}
private void cancelSyncForEnabledProviders() {
requestOrCancelSyncForEnabledProviders(false /* cancel them */);
getActivity().invalidateOptionsMenu();
}
private void requestOrCancelSyncForEnabledProviders(boolean startSync) {
// sync everything that the user has enabled
int count = getPreferenceScreen().getPreferenceCount();
for (int i = 0; i < count; i++) {
Preference pref = getPreferenceScreen().getPreference(i);
if (! (pref instanceof SyncStateCheckBoxPreference)) {
continue;
}
SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) pref;
if (!syncPref.isChecked()) {
continue;
}
requestOrCancelSync(syncPref.getAccount(), syncPref.getAuthority(), startSync);
}
// plus whatever the system needs to sync, e.g., invisible sync adapters
if (mAccount != null) {
for (String authority : mInvisibleAdapters) {
requestOrCancelSync(mAccount, authority, startSync);
}
}
}
private void requestOrCancelSync(Account account, String authority, boolean flag) {
if (flag) {
Bundle extras = new Bundle();
extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(account, authority, extras);
} else {
ContentResolver.cancelSync(account, authority);
}
}
private boolean isSyncing(List<SyncInfo> currentSyncs, Account account, String authority) {
for (SyncInfo syncInfo : currentSyncs) {
if (syncInfo.account.equals(account) && syncInfo.authority.equals(authority)) {
return true;
}
}
return false;
}
@Override
protected void onSyncStateUpdated() {
if (!isResumed()) return;
setFeedsState();
}
private void setFeedsState() {
// iterate over all the preferences, setting the state properly for each
Date date = new Date();
List<SyncInfo> currentSyncs = ContentResolver.getCurrentSyncs();
boolean syncIsFailing = false;
// Refresh the sync status checkboxes - some syncs may have become active.
updateAccountCheckboxes(mAccounts);
for (int i = 0, count = getPreferenceScreen().getPreferenceCount(); i < count; i++) {
Preference pref = getPreferenceScreen().getPreference(i);
if (! (pref instanceof SyncStateCheckBoxPreference)) {
continue;
}
SyncStateCheckBoxPreference syncPref = (SyncStateCheckBoxPreference) pref;
String authority = syncPref.getAuthority();
Account account = syncPref.getAccount();
SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority);
boolean authorityIsPending = status == null ? false : status.pending;
boolean initialSync = status == null ? false : status.initialize;
boolean activelySyncing = isSyncing(currentSyncs, account, authority);
boolean lastSyncFailed = status != null
&& status.lastFailureTime != 0
&& status.getLastFailureMesgAsInt(0)
!= ContentResolver.SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS;
if (!syncEnabled) lastSyncFailed = false;
if (lastSyncFailed && !activelySyncing && !authorityIsPending) {
syncIsFailing = true;
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "Update sync status: " + account + " " + authority +
" active = " + activelySyncing + " pend =" + authorityIsPending);
}
final long successEndTime = (status == null) ? 0 : status.lastSuccessTime;
if (successEndTime != 0) {
date.setTime(successEndTime);
final String timeString = mDateFormat.format(date) + " "
+ mTimeFormat.format(date);
syncPref.setSummary(timeString);
} else {
syncPref.setSummary("");
}
int syncState = ContentResolver.getIsSyncable(account, authority);
syncPref.setActive(activelySyncing && (syncState >= 0) &&
!initialSync);
syncPref.setPending(authorityIsPending && (syncState >= 0) &&
!initialSync);
syncPref.setFailed(lastSyncFailed);
ConnectivityManager connManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
}
mErrorInfoView.setVisibility(syncIsFailing ? View.VISIBLE : View.GONE);
getActivity().invalidateOptionsMenu();
}
@Override
public void onAccountsUpdated(Account[] accounts) {
super.onAccountsUpdated(accounts);
mAccounts = accounts;
updateAccountCheckboxes(accounts);
onSyncStateUpdated();
}
private void updateAccountCheckboxes(Account[] accounts) {
mInvisibleAdapters.clear();
SyncAdapterType[] syncAdapters = ContentResolver.getSyncAdapterTypes();
HashMap<String, ArrayList<String>> accountTypeToAuthorities =
Maps.newHashMap();
for (int i = 0, n = syncAdapters.length; i < n; i++) {
final SyncAdapterType sa = syncAdapters[i];
if (sa.isUserVisible()) {
ArrayList<String> authorities = accountTypeToAuthorities.get(sa.accountType);
if (authorities == null) {
authorities = new ArrayList<String>();
accountTypeToAuthorities.put(sa.accountType, authorities);
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "onAccountUpdated: added authority " + sa.authority
+ " to accountType " + sa.accountType);
}
authorities.add(sa.authority);
} else {
// keep track of invisible sync adapters, so sync now forces
// them to sync as well.
mInvisibleAdapters.add(sa.authority);
}
}
for (int i = 0, n = mCheckBoxes.size(); i < n; i++) {
getPreferenceScreen().removePreference(mCheckBoxes.get(i));
}
mCheckBoxes.clear();
for (int i = 0, n = accounts.length; i < n; i++) {
final Account account = accounts[i];
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, "looking for sync adapters that match account " + account);
}
final ArrayList<String> authorities = accountTypeToAuthorities.get(account.type);
if (authorities != null && (mAccount == null || mAccount.equals(account))) {
for (int j = 0, m = authorities.size(); j < m; j++) {
final String authority = authorities.get(j);
// We could check services here....
int syncState = ContentResolver.getIsSyncable(account, authority);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.d(TAG, " found authority " + authority + " " + syncState);
}
if (syncState > 0) {
addSyncStateCheckBox(account, authority);
}
}
}
}
Collections.sort(mCheckBoxes);
for (int i = 0, n = mCheckBoxes.size(); i < n; i++) {
getPreferenceScreen().addPreference(mCheckBoxes.get(i));
}
}
/**
* Updates the titlebar with an icon for the provider type.
*/
@Override
protected void onAuthDescriptionsUpdated() {
super.onAuthDescriptionsUpdated();
getPreferenceScreen().removeAll();
if (mAccount != null) {
mProviderIcon.setImageDrawable(getDrawableForType(mAccount.type));
mProviderId.setText(getLabelForType(mAccount.type));
PreferenceScreen prefs = addPreferencesForType(mAccount.type);
if (prefs != null) {
updatePreferenceIntents(prefs);
}
}
addPreferencesFromResource(R.xml.account_sync_settings);
}
private void updatePreferenceIntents(PreferenceScreen prefs) {
for (int i = 0; i < prefs.getPreferenceCount(); i++) {
Intent intent = prefs.getPreference(i).getIntent();
if (intent != null) {
intent.putExtra(ACCOUNT_KEY, mAccount);
// This is somewhat of a hack. Since the preference screen we're accessing comes
// from another package, we need to modify the intent to launch it with
// FLAG_ACTIVITY_NEW_TASK.
// TODO: Do something smarter if we ever have PreferenceScreens of our own.
intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9f22ba39ff0b5fc0ebf3faf8bbf0d4f2a79fc150 | 7303873dfd8c515337d99bb502a94884cb484f18 | /target/generated/src/main/java/org/cxrus/canonapi/service/DSubCatProductV2.java | f36f27e020e3d439112de1f1e91c8e997e67e0ca | [] | no_license | sidie88/soap | b7b30213f8f8e7e6fa2004c008b29bd573d319b8 | bc81ca7af13063b34c0a07ffcfe38f85e88cec08 | refs/heads/master | 2021-03-12T23:56:03.794313 | 2015-05-11T02:23:22 | 2015-05-11T02:23:22 | 35,397,099 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,240 | java |
package org.cxrus.canonapi.service;
import java.util.ArrayList;
import java.util.List;
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>Java class for dSubCatProductV2 complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="dSubCatProductV2">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="productLongName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="productSystemName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="regions" type="{http://service.canonapi.cxrus.org/}dRegionV2" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "dSubCatProductV2", propOrder = {
"productLongName",
"productSystemName",
"regions"
})
public class DSubCatProductV2 {
protected String productLongName;
protected String productSystemName;
@XmlElement(nillable = true)
protected List<DRegionV2> regions;
/**
* Gets the value of the productLongName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProductLongName() {
return productLongName;
}
/**
* Sets the value of the productLongName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProductLongName(String value) {
this.productLongName = value;
}
/**
* Gets the value of the productSystemName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProductSystemName() {
return productSystemName;
}
/**
* Sets the value of the productSystemName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProductSystemName(String value) {
this.productSystemName = value;
}
/**
* Gets the value of the regions property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the regions property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRegions().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DRegionV2 }
*
*
*/
public List<DRegionV2> getRegions() {
if (regions == null) {
regions = new ArrayList<DRegionV2>();
}
return this.regions;
}
}
| [
"sidie88@gmail.com"
] | sidie88@gmail.com |
741684e8ddba998ef7de6906e87e4147dd712c5a | cc7402a7e4b9d2f446f88a890c9a6aea088623e4 | /commons/src/main/java/com/pamarin/commons/provider/HttpSessionProvider.java | 26689d1fc39a77037a14d6f51ae708f2deef4bb2 | [] | no_license | jittagornp/oauth-old | f113b0abdaf5e2d9ead47efb0a70e7266f782f0a | 1169d31e478c6e7c3aca8148d375a26f661b72e8 | refs/heads/master | 2022-01-08T04:33:02.790869 | 2019-05-07T08:55:31 | 2019-05-07T08:55:31 | 111,669,949 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | /*
* Copyright 2017-2019 Pamarin.com
*/
package com.pamarin.commons.provider;
import javax.servlet.http.HttpSession;
/**
*
* @author jitta
*/
public interface HttpSessionProvider {
HttpSession provide();
}
| [
"jitta@DESKTOP-8QIAGPC"
] | jitta@DESKTOP-8QIAGPC |
178f1c6954a70ed8df5f32d8fd5f86e98133cebe | 541735596191734ecbbdb80e81c91480c1c95b31 | /Kami5-1.7-SRC-main/org/yaml/snakeyaml/constructor/DuplicateKeyException.java | 803e88d3aecfb90dd3eaf4f242016ed346c12554 | [] | no_license | yunusborazan/Kami5-1.7 | 2cdd4f5c2331444f4079dd65614c304695df11be | 60e220d027c5a8298762bb1a9a270984a796a5d9 | refs/heads/main | 2023-08-27T11:40:18.228427 | 2021-11-02T16:57:35 | 2021-11-02T16:57:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | /*
* Decompiled with CFR 0.151.
*/
package org.yaml.snakeyaml.constructor;
import org.yaml.snakeyaml.constructor.ConstructorException;
import org.yaml.snakeyaml.error.Mark;
public class DuplicateKeyException
extends ConstructorException {
protected DuplicateKeyException(Mark contextMark, Object key, Mark problemMark) {
super("while constructing a mapping", contextMark, "found duplicate key " + String.valueOf(key), problemMark);
}
}
| [
"92902311+JustARandomAccount420@users.noreply.github.com"
] | 92902311+JustARandomAccount420@users.noreply.github.com |
5947c2f5804a6cf8cb6f6cb9d1c60a57a99bb3aa | ef5552cdf145475f545ef45ebf8f575b90a04b9a | /src/Fig6_7/RollDice.java | 5442d7acdbe819780ed8b99f13a360ddf114b771 | [] | no_license | tqayyum/javaEx | 992d41ec6686872b0cdf1593c1e67e6accae8997 | aff0c83478be57a8a9b36009e5f3051d25bd5df0 | refs/heads/master | 2020-04-05T22:36:34.747361 | 2018-11-19T20:34:40 | 2018-11-19T20:34:40 | 157,262,237 | 0 | 0 | null | 2018-11-19T20:34:41 | 2018-11-12T19:05:28 | Java | UTF-8 | Java | false | false | 1,191 | java | package Fig6_7;
import java.security.SecureRandom;
public class RollDice {
public static void main(String[] args) {
SecureRandom randomNumbers = new SecureRandom();
int frequency1 = 0, frequency2 = 0, frequency3 = 0, frequency4 = 0, frequency5 = 0, frequency6 = 0 ;
for (int i = 1; i <= 600; i++) {
int face = 1 + randomNumbers.nextInt(6);
switch (face) {
case 1:
++frequency1;
break;
case 2:
++frequency2;
break;
case 3:
++frequency3;
break;
case 4:
++frequency4;
break;
case 5:
++frequency5;
break;
case 6:
++frequency6;
break;
}
}
System.out.println("Face\tFrequency");
System.out.printf("1\t\t%d%n2\t\t%d%n3\t\t%d%n4\t\t%d%n5\t\t%d%n6\t\t%d%n",
frequency1, frequency2, frequency3, frequency4,
frequency5, frequency6);
}
}
| [
"[qayyumtahir00@gmail.com]"
] | [qayyumtahir00@gmail.com] |
64db51d74bab1edd86a2008849bbcba4507280db | 1a8a0ee45dc1f42b1a6d0875c7dfd2569d7ea8a7 | /ea-card-crm/ea-card-crm-admin-facade-stub/src/main/java/com/ea/card/crm/admin/facade/response/GiftMemberCardPageResponse.java | 66d0df695ad368a155ce1af0bafd944134b12cd1 | [] | no_license | kongguzuying/LmtechPlatform | abb78d37a498cb9bb6d6b1d1efd2f9e50400a11a | 7dc34351655444fd657f09b5a2eaae0138a285b4 | refs/heads/master | 2021-09-10T09:29:54.953608 | 2018-03-23T07:41:40 | 2018-03-23T07:41:40 | 111,355,103 | 4 | 2 | null | 2018-03-23T07:41:41 | 2017-11-20T03:02:59 | null | UTF-8 | Java | false | false | 231 | java | package com.ea.card.crm.admin.facade.response;
import com.ea.card.crm.model.GiftMemberCard;
import com.lmtech.facade.response.PageDataResponse;
public class GiftMemberCardPageResponse extends PageDataResponse<GiftMemberCard> {
}
| [
"398609421@qq.com"
] | 398609421@qq.com |
07fa37d43254a6f85e6ce4855b3f3a9f7c3d1581 | 05c2e7304941216e1ac18e6f3786f4014a69fc13 | /Node.java | 1728552b4208be673878c24afa370e588cfba176 | [] | no_license | j-ann-c/softwareTesting | 98725c71e549958f0101be0d268524bfb8b1df62 | 3232321ac6cecbb6bc83b11569f4a14eb9491e3b | refs/heads/master | 2022-10-28T08:57:52.336359 | 2019-02-07T00:03:38 | 2019-02-07T00:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 110 | java | package Linked;
public class Node {
int data;
Node next;
Node(int d)
{
data = d;
next = null;
}
}
| [
"jessica.cruz.dev@gmail.com"
] | jessica.cruz.dev@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.