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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3138aabd4d6ea40f384e299cce11631c5c64066c | 532eb052e9c245ed2656092843b49dffdaaafeb2 | /app/src/main/java/com/udacoding/belajarfragment/ui/gallery/GalleryFragment.java | 93a8c985759792f1419e5c90e13dcf064e746af3 | [] | no_license | nandot12/Belajar_Fragment | ee1059baee3620dc1ca764003fbf2e268f703288 | 69b1c4d54cd9e4ea45f1e53c1964e1b4eeffa352 | refs/heads/master | 2022-12-20T21:43:13.342355 | 2020-09-30T11:30:28 | 2020-09-30T11:30:28 | 299,897,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | package com.udacoding.belajarfragment.ui.gallery;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.udacoding.belajarfragment.R;
public class GalleryFragment extends Fragment {
private GalleryViewModel galleryViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
galleryViewModel =
ViewModelProviders.of(this).get(GalleryViewModel.class);
View root = inflater.inflate(R.layout.fragment_gallery, container, false);
final TextView textView = root.findViewById(R.id.text_gallery);
galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
} | [
"nandohusni93@gmail.com"
] | nandohusni93@gmail.com |
9ffecc9aa898c180e832407823aa180c502131e8 | f34602b407107a11ce0f3e7438779a4aa0b1833e | /professor/dvl/roadnet-client/src/main/java/com/roadnet/apex/IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage.java | bc54468f6d4f17c3bb90bbcab40c2002cfbf150e | [] | no_license | ggmoura/treinar_11836 | a447887dc65c78d4bd87a70aab2ec9b72afd5d87 | 0a91f3539ccac703d9f59b3d6208bf31632ddf1c | refs/heads/master | 2022-06-14T13:01:27.958568 | 2020-04-04T01:41:57 | 2020-04-04T01:41:57 | 237,103,996 | 0 | 2 | null | 2022-05-20T21:24:49 | 2020-01-29T23:36:21 | Java | UTF-8 | Java | false | false | 1,668 | java |
package com.roadnet.apex;
import javax.xml.ws.WebFault;
/**
* This class was generated by Apache CXF 3.2.4
* 2020-03-15T13:07:01.817-03:00
* Generated source version: 3.2.4
*/
@WebFault(name = "TransferErrorCode", targetNamespace = "http://roadnet.com/apex/DataContracts/")
public class IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage extends Exception {
private com.roadnet.apex.datacontracts.TransferErrorCode transferErrorCode;
public IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage() {
super();
}
public IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage(String message) {
super(message);
}
public IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage(String message, java.lang.Throwable cause) {
super(message, cause);
}
public IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage(String message, com.roadnet.apex.datacontracts.TransferErrorCode transferErrorCode) {
super(message);
this.transferErrorCode = transferErrorCode;
}
public IAdministrationServiceRetrieveCustomersWithXrsServiceUrlTransferErrorCodeFaultMessage(String message, com.roadnet.apex.datacontracts.TransferErrorCode transferErrorCode, java.lang.Throwable cause) {
super(message, cause);
this.transferErrorCode = transferErrorCode;
}
public com.roadnet.apex.datacontracts.TransferErrorCode getFaultInfo() {
return this.transferErrorCode;
}
}
| [
"gleidson.gmoura@gmail.com"
] | gleidson.gmoura@gmail.com |
53f5bd26be80d91c57426745fd17b65783dc2aa0 | 3bed8b09ac4cf243e06fe1c70b272ed189debfa3 | /src/main/java/com/realmcloud/admin/util/QiniuFileUtil.java | 1a9bfef10e159565f08f854e2601b597a03714d9 | [] | no_license | RealmKing/realm-pro | a0c6e8c6b487d9a3dc1b7c042e28ea067a50741a | 433be6617657893efb2f44b6e13c9bd7e40bfd5a | refs/heads/master | 2020-03-26T05:31:53.075435 | 2019-02-18T06:04:53 | 2019-02-18T06:04:53 | 144,561,140 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,569 | java | package com.realmcloud.admin.util;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.realmcloud.admin.controller.system.LogController;
import com.realmcloud.admin.entity.Rescource;
import com.realmcloud.admin.exception.MyException;
import com.realmcloud.admin.service.RescourceService;
import com.qiniu.common.QiniuException;
import com.qiniu.common.Zone;
import com.qiniu.http.Response;
import com.qiniu.storage.BucketManager;
import com.qiniu.storage.Configuration;
import com.qiniu.storage.UploadManager;
import com.qiniu.storage.model.FetchRet;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlSafeBase64;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Decoder;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.util.UUID;
public class QiniuFileUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(QiniuFileUtil.class);
private static String path = "https://static.realmcloud.com/";
private static String qiniuAccess = "PXj2yRJGbfyhiUid_qeateOg-kiLaF9ZkteYuQQL";
private static String qiniuKey = "0h9ICCVUgtrLAspsANW-5IW3mG-45SoYDIF1DTDe";
private static String bucketName = "wanggg";
/***
* 普通上传图片
* @param file
* @return
* @throws QiniuException
* @throws IOException
*/
public static String upload(MultipartFile file) throws IOException, NoSuchAlgorithmException {
Zone z = Zone.zone0();
Configuration config = new Configuration(z);
String fileName = "", extName = "", filePath = "";
if (null != file && !file.isEmpty()) {
extName = file.getOriginalFilename().substring(
file.getOriginalFilename().lastIndexOf("."));
fileName = UUID.randomUUID() + extName;
UploadManager uploadManager = new UploadManager(config);
Auth auth = Auth.create(qiniuAccess, qiniuKey);
String token = auth.uploadToken(bucketName);
byte[] data = file.getBytes();
QETag tag = new QETag();
String hash = tag.calcETag(file);
Rescource rescource = new Rescource();
EntityWrapper<RestResponse> wrapper = new EntityWrapper<>();
wrapper.eq("hash",hash);
rescource = rescource.selectOne(wrapper);
if( rescource!= null){
return rescource.getWebUrl();
}
Response r = uploadManager.put(data, fileName, token);
if (r.isOK()) {
filePath = path + fileName;
rescource = new Rescource();
rescource.setFileName(fileName);
rescource.setFileSize(new java.text.DecimalFormat("#.##").format(file.getSize()/1024)+"kb");
rescource.setHash(hash);
rescource.setFileType(StringUtils.isBlank(extName)?"unknown":extName);
rescource.setWebUrl(filePath);
rescource.setSource("qiniu");
rescource.insert();
}
}
return filePath;
}
/***
* 删除已经上传的图片
* @param imgPath
*/
public static void deleteQiniuP(String imgPath) {
Zone z = Zone.zone0();
Configuration config = new Configuration(z);
Auth auth = Auth.create(qiniuAccess, qiniuKey);
BucketManager bucketManager = new BucketManager(auth,config);
imgPath = imgPath.replace(path, "");
try {
bucketManager.delete(bucketName, imgPath);
} catch (QiniuException e) {
e.printStackTrace();
}
}
/***
* 上传网络图片
* @param src
* @return
*/
public static String uploadImageSrc(String src){
Zone z = Zone.zone0();
Configuration config = new Configuration(z);
Auth auth = Auth.create(qiniuAccess, qiniuKey);
BucketManager bucketManager = new BucketManager(auth, config);
String fileName = UUID.randomUUID().toString(),filePath="";
try {
FetchRet fetchRet = bucketManager.fetch(src, bucketName);
filePath = path + fetchRet.key;
Rescource rescource = new Rescource();
rescource.setFileName(fetchRet.key);
rescource.setFileSize(new java.text.DecimalFormat("#.##").format(fetchRet.fsize/1024)+"kb");
rescource.setHash(fetchRet.hash);
rescource.setFileType(fetchRet.mimeType);
rescource.setWebUrl(filePath);
rescource.setSource("qiniu");
rescource.insert();
} catch (QiniuException e) {
filePath = src;
e.printStackTrace();
}
return filePath;
}
/***
* 上传本地图片
* @param src
* @return
*/
public static String uploadLocalImg(String src) throws IOException, NoSuchAlgorithmException{
Zone z = Zone.zone0();
Configuration config = new Configuration(z);
UploadManager uploadManager = new UploadManager(config);
Auth auth = Auth.create(qiniuAccess, qiniuKey);
String token = auth.uploadToken(bucketName);
File file = new File(src);
if(!file.exists()){
throw new MyException("本地文件不存在");
}
QETag tag = new QETag();
String hash = tag.calcETag(file);
Rescource rescource = new Rescource();
EntityWrapper<RestResponse> wrapper = new EntityWrapper<>();
wrapper.eq("hash",hash);
rescource = rescource.selectOne(wrapper);
if( rescource!= null){
return rescource.getWebUrl();
}
String filePath="",
extName = "",
name = UUID.randomUUID().toString();
extName = file.getName().substring(
file.getName().lastIndexOf("."));
Response response = uploadManager.put(file,name,token);
if(response.isOK()){
filePath = path + name;
rescource = new Rescource();
rescource.setFileName(name);
rescource.setFileSize(new java.text.DecimalFormat("#.##").format(file.length()/1024)+"kb");
rescource.setHash(hash);
rescource.setFileType(StringUtils.isBlank(extName)?"unknown":extName);
rescource.setWebUrl(filePath);
rescource.setSource("qiniu");
rescource.insert();
}
return filePath;
}
/**
* 上传base64位的图片
* @param base64
* @return
*/
public static String uploadBase64(String base64,String name) {
Zone z = Zone.zone0();
Configuration config = new Configuration(z);
UploadManager uploadManager = new UploadManager(config);
Auth auth = Auth.create(qiniuAccess, qiniuKey);
String token = auth.uploadToken(bucketName),filePath;
byte[] data = Base64.decodeBase64(base64);
try {
uploadManager.put(data,name,token);
} catch (IOException e) {
e.printStackTrace();
}
filePath = path+name;
return filePath;
}
}
| [
"1191440053@qq.com"
] | 1191440053@qq.com |
bbdc86149e62970ed1d23811e4e1f23f35c6c12d | 8e0b4f580eb269b7d3c9061ed7f811ae56e1913f | /src/main/java/com/tomkasp/domain/util/CustomDateTimeSerializer.java | bae23551ffd1c8a46eb3d569e5b91c74342a7313 | [
"MIT"
] | permissive | vrudikov/quartz-hipster-ui | e56fb6f88fa10225c2e69f2677fb6af36952916b | 39ea20156d748e9f4679f5196c557b1f101acdb0 | refs/heads/master | 2021-01-17T11:25:04.254935 | 2015-06-18T20:01:24 | 2015-06-18T20:01:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | package com.tomkasp.domain.util;
import java.io.IOException;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
/**
* Custom Jackson serializer for displaying Joda DateTime objects.
*/
public class CustomDateTimeSerializer extends JsonSerializer<DateTime> {
private static DateTimeFormatter formatter = DateTimeFormat
.forPattern("yyyy-MM-dd'T'HH:mm:ss'Z'");
@Override
public void serialize(DateTime value, JsonGenerator generator,
SerializerProvider serializerProvider)
throws IOException {
generator.writeString(formatter.print(value.toDateTime(DateTimeZone.UTC)));
}
}
| [
"tomkasp@gmail.com"
] | tomkasp@gmail.com |
6097294c602aa30f1e432929c357ccbdc726fd43 | a9c67e8f817747d2be587c1152614fccb18a5911 | /02-springboot-redis/src/main/java/com/qxf/RedisApp.java | 925cc3c7d23ba66c83a2b724d6306314242457a9 | [] | no_license | qiuxinfa/redis-study | b1caa024c5f41641f947228523b0de00ee7c2c5c | 943f84ccc688416ce0ae81b1833c4dd81471ffd3 | refs/heads/master | 2022-04-23T12:41:27.413686 | 2020-04-20T12:50:45 | 2020-04-20T12:50:45 | 256,994,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.qxf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.redis.core.RedisTemplate;
/**
* @Auther: qiuxinfa
* @Date: 2020/4/19
* @Description: com.qxf
*/
@SpringBootApplication
@EnableCaching
public class RedisApp {
public static void main(String[] args) {
SpringApplication.run(RedisApp.class,args);
}
}
| [
"1816522516@qq.com"
] | 1816522516@qq.com |
cb7ba58fb2a62f499f19c7605679b7195b0226f6 | 4f8fafc348710a165d85423eda79d150622e7448 | /src/main/java/kr/co/wincom/imcs/api/getFXFavorList/GetFXFavorListServiceImpl.java | 90fc68f1163c70b6fe9f0c950606e8b1712564f5 | [] | no_license | yyj7952/wincom | 79162632b3b4da95e9c9ffbdf14d54a58e8460cc | a443dec8aca0238f62f1bb3bbf4feeeae6129796 | refs/heads/master | 2023-06-24T20:15:36.839737 | 2021-07-26T06:59:50 | 2021-07-26T06:59:50 | 377,038,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,560 | java | package kr.co.wincom.imcs.api.getFXFavorList;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import kr.co.wincom.imcs.common.ImcsConstants;
import kr.co.wincom.imcs.common.CommonService;
import kr.co.wincom.imcs.common.util.IMCSLog;
import kr.co.wincom.imcs.common.util.StringUtil;
import kr.co.wincom.imcs.common.vo.AlbumInfoVO;
import kr.co.wincom.imcs.common.vo.CateInfoVO;
import kr.co.wincom.imcs.common.vo.StillImageVO;
import kr.co.wincom.imcs.handler.ImcsException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import kr.co.wincom.imcs.common.NosqlCacheType;
@Service
public class GetFXFavorListServiceImpl implements GetFXFavorListService {
private Log imcsLogger = LogFactory.getLog("API_getFXFavorList");
@Autowired
private GetFXFavorListDao getFXFavorListDao;
@Autowired
private CommonService commonService;
// public void getFXFavorList(String szSaId, String szStbMac, String szPid){
// this.imcsLog = new IMCSLog(imcsLogger, szSaId, szStbMac, szPid);
// }
//
// private IMCSLog imcsLog = null;
/**
* @author HONG
* @since 2016-07-12
* 찜목록 리스트 가져오기 (lgvod339.pc)
*/
@Override
public GetFXFavorListResultVO getFXFavorList(GetFXFavorListRequestVO paramVO) {
// this.getFXFavorList(paramVO.getSaId(), paramVO.getStbMac(), paramVO.getPid());
IMCSLog imcsLog = new IMCSLog(imcsLogger, paramVO.getSaId(), paramVO.getStbMac(), paramVO.getPid());
String isLastProcess = ImcsConstants.RCV_MSG5;
StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[1];
String methodLine = String.valueOf(stackTraceElement.getLineNumber() - 5);
String methodName = stackTraceElement.getMethodName();
imcsLog.debugLog(methodName + " service call");
// NoSQL Db별 쿼리 카운터
paramVO.setNosqlCacheTypeCnt(new int[NosqlCacheType.values().length]);
List<GetFXFavorListResponseVO> resultVO = new ArrayList<GetFXFavorListResponseVO>();
List<GetFXFavorListResponseVO> returnVO = new ArrayList<GetFXFavorListResponseVO>();
GetFXFavorListResponseVO tempVO = new GetFXFavorListResponseVO();
GetFXFavorListResultVO resultListVO = new GetFXFavorListResultVO();
int nMainCnt = 0;
int nSetCnt = 0;
int nTotCnt = 0;
int nStartNo = 0;
int nEndNo = 0;
int nPageNo = 0;
int nPageCnt = 0;
long tp1 = 0; // timePoint 1
long tp2 = 0; // timePoint 2
String szImgSvrUrl = ""; // 이미지 서버 URL
String msg = "";
try {
if(paramVO.getPageNo().equals("0")){
paramVO.setPageNo("A");
}
if(paramVO.getPageCnt().equals("0")){
paramVO.setPageCnt("A");
}
if(paramVO.getPageNo().equals("") || paramVO.getPageNo()== null){
paramVO.setPageNo("1");
}
if(paramVO.getPageCnt().equals("") || paramVO.getPageCnt()== null){
paramVO.setPageCnt("1");
}
if("A".equals(paramVO.getPageNo()) || "A".equals(paramVO.getPageCnt())) {
nStartNo = 1;
nEndNo = 1000;
} else {
nPageNo = Integer.parseInt(StringUtil.nullToZero(paramVO.getPageNo()));
nPageCnt = Integer.parseInt(StringUtil.nullToZero(paramVO.getPageCnt()));
nStartNo = nPageNo * nPageCnt - nPageCnt;
nEndNo = nPageNo * nPageCnt;
}
tp1 = System.currentTimeMillis();
try {
szImgSvrUrl = commonService.getIpInfo("img_server", ImcsConstants.FXAPI_PRO_ID060.split("/")[1]); // 이미지서버 URL 조회
} catch(Exception e) {
// imcsLog.failLog(ImcsConstants.FXAPI_PRO_ID060, "", null, "svr_ip:" + ImcsConstants.RCV_MSG1, methodName, methodLine);
throw new ImcsException();
}
tp2 = System.currentTimeMillis();
imcsLog.timeLog("init...", String.valueOf(tp2 - tp1), methodName, methodLine);
resultVO = this.getFavorList(paramVO);
tp1 = System.currentTimeMillis();
imcsLog.timeLog("찜목록 조회", String.valueOf(tp1 - tp2), methodName, methodLine);
if(resultVO != null) nMainCnt = resultVO.size();
for(int i = 0; i < nMainCnt; i++) {
tempVO = resultVO.get(i);
// 카테고리 정보 조회
paramVO.setContsId(tempVO.getContsId());
paramVO.setAlbumId(tempVO.getAlbumId());
if("X".equals(tempVO.getAlbumId())) continue;
CateInfoVO cateInfoVO = new CateInfoVO();
cateInfoVO = this.getCateInfo(paramVO);
int nSubCnt = 0;
if(cateInfoVO != null) {
nSubCnt = Integer.parseInt(StringUtil.nullToZero(cateInfoVO.getCount()));
tempVO.setParentCatId(cateInfoVO.getCategoryId());
tempVO.setIsUpdate(cateInfoVO.getIsUpdate());
tempVO.setCatLevel(cateInfoVO.getContsLevel());
tempVO.setChaNum(cateInfoVO.getChaNum());
tempVO.setAuthYn(cateInfoVO.getAuthYn());
tempVO.setBelongingName(cateInfoVO.getBelongingName());
String szSerInfo = cateInfoVO.getCateInfo();
tempVO.setSerCatId(szSerInfo.substring(0, szSerInfo.indexOf("|")));
tempVO.setSeriesNo(szSerInfo.substring(szSerInfo.indexOf("|") + 1, szSerInfo.length()));
}
if(cateInfoVO == null || nSubCnt == 0) continue;
try {
if("X".equals(tempVO.getParentCatId().substring(0,1))) paramVO.setCatId1("X");
else paramVO.setCatId1("A");
} catch (Exception e) {
paramVO.setCatId1("A");
}
// 앨범정보 조회
String szGenreGb = "";
//AlbumInfoVO albumInfoVO = new AlbumInfoVO();
AlbumInfoVO albumInfoVO = null;
albumInfoVO = this.getAlbumInfo(paramVO);
if(albumInfoVO == null) continue;
else {
tempVO.setOnairDate(albumInfoVO.getOnairDate());
tempVO.setReleaseDate(albumInfoVO.getReleaseDate());
tempVO.setSeriesDesc(albumInfoVO.getSeriesDesc());
tempVO.setRealHd(albumInfoVO.getRealHd());
tempVO.setPoint(albumInfoVO.getPoint());
tempVO.setPrInfo(albumInfoVO.getPrInfo());
tempVO.setRunTime(albumInfoVO.getRunTime());
tempVO.setPrice(albumInfoVO.getPrice());
tempVO.setOverseerName(albumInfoVO.getOverseerName());
tempVO.setActor(albumInfoVO.getActor());
tempVO.setLicensingWindowEnd(albumInfoVO.getLicensingEnd());
tempVO.setFilterGb(albumInfoVO.getFilterGb());
tempVO.setIsNew(albumInfoVO.getIsNew());
tempVO.setIs51Ch(albumInfoVO.getIs51ch());
tempVO.setIsHd(albumInfoVO.getIsHd());
tempVO.setIs3D(albumInfoVO.getIs3D());
tempVO.setIsCaption(albumInfoVO.getCaptionYn());
tempVO.setServiceGb(albumInfoVO.getServiceIcon());
tempVO.setImgFileName(albumInfoVO.getImgFileName());
tempVO.setTerrCh(albumInfoVO.getTerrCh());
tempVO.setIsHot("");
tempVO.setSubCnt("");
szGenreGb = albumInfoVO.getGenreGb();
}
nTotCnt++;
if(!"A".equals(paramVO.getPageNo()) && !"A".equals(paramVO.getPageCnt())) {
if ( nTotCnt <= nStartNo || nTotCnt > nEndNo) continue;
}
// 상품정보 조회
String szProdType = "";
szProdType = this.getProdType(paramVO);
if("X".equals(szProdType)) szProdType = "";
// FVOD가 아니고 가격이 0원이 아니면 유료 그 외 무료
int tempPrice = Integer.parseInt(StringUtil.nullToZero(tempVO.getPrice()));
if(!"0".equals(szProdType) && tempPrice > 0) tempVO.setPrice("Y");
else tempVO.setPrice("N");
// 5.1채널 여부
if("DOLBY 5.1".equals(tempVO.getIs51Ch()))
tempVO.setIs51Ch("Y");
else tempVO.setIs51Ch("N");
// HD여부
if("Y".equals(tempVO.getIsHd()) || "S".equals(tempVO.getIsHd()))
tempVO.setIsHd("Y");
else if("N".equals(tempVO.getIsHd()))
tempVO.setIsHd("N");
// i_sub_cnt를 가져오는 로직 미존재 함
tempVO.setSubCnt("0");
// 썸네일 파일명 조회
String szStillFileName = "";
if("T".equals(szGenreGb))
szStillFileName = this.getImageFileName(paramVO);
else
szStillFileName = this.getStillFileName(paramVO);
tempVO.setThumbnailFileName(StringUtil.nullToSpace(szStillFileName));
tempVO.setImgUrl(szImgSvrUrl);
//nSetCnt++;
returnVO.add(tempVO);
}
tp2 = System.currentTimeMillis();
imcsLog.timeLog("찜목록 정보 Fetch", String.valueOf(tp2 - tp1), methodName, methodLine);
resultListVO.setTotalCnt(String.valueOf(nTotCnt));
resultListVO.setList(returnVO);
} catch(ImcsException ie) {
isLastProcess = ImcsConstants.RCV_MSG6;
imcsLog.errorLog(methodName + "-E",ie.getClass().getName()+":"+ie.getMessage());
throw ie;
} catch(Exception e) {
isLastProcess = ImcsConstants.RCV_MSG6;
imcsLog.errorLog(methodName + "-E",e.getClass().getName()+":"+e.getMessage());
throw new ImcsException();
} finally{
int nUserDB = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()];
msg = " svc[" + String.format("%-20s", ImcsConstants.FXAPI_PRO_ID060) + "] sts[" + ImcsConstants.LOG_MSG3 + "] msg[" + isLastProcess + "]"
+ " [DB:" + nUserDB + "]";
imcsLog.serviceLog(msg, methodName, methodLine);
}
return resultListVO;
}
/**
* 스틸이미지 파일명 조회
* @param GetFXFavorListRequestVO paramVO
* @return String
**/
public String getStillFileName(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_005_20171214_001";
List<String> list = new ArrayList<String>();
String szImgFileName = "";
int querySize = 0;
try {
try {
list = getFXFavorListDao.getStillFileName(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list != null && !list.isEmpty()) {
szImgFileName = StringUtil.nullToSpace(list.get(0));
} else {
querySize = list.size();
}
// C에서 주석 처리된 로그
try{
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
IMCSLog imcsLog = new IMCSLog(imcsLogger, paramVO.getSaId(), paramVO.getStbMac(), paramVO.getPid());
imcsLog.errorLog(methodName + "-E", e.getClass().getName() + ":" + e.getMessage());
}
return szImgFileName;
}
/**
* 이미지 파일명 조회
* @param GetFXFavorListRequestVO paramVO
* @return String
**/
public String getImageFileName(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_004_20171214_001";
List<StillImageVO> list = new ArrayList<StillImageVO>();
StillImageVO resultVO = null;
int querySize = 0;
String szImgFileName = "";
try {
try {
list = getFXFavorListDao.getImageFileName(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list != null && !list.isEmpty()) {
resultVO = list.get(0);
szImgFileName = resultVO.getImgFileName();
} else {
querySize = list.size();
}
// C에서 주석 처리된 로그
try{
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
// imcsLog.failLog(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, "svr_ip:" + ImcsConstants.RCV_MSG6, methodName, methodLine);
}
return szImgFileName;
}
/**
* 상품타입 정보 조회
* @param GetFXFavorListRequestVO paramVO
* @return String
**/
public String getProdType(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_p01_20171214_001";
String szProductType = "";
if(paramVO.getAlbumId().equals(paramVO.getContsId()))
sqlId = "fxvod060_p01_20171214_001";
else sqlId = "fxvod060_p02_20171214_001";
List<String> list = new ArrayList<String>();
int querySize = 0;
try {
String szContsId = paramVO.getAlbumId();
if(!"NSC".equals(paramVO.getCatGb()))
szContsId = szContsId + "_IPTV";
if(!paramVO.getAlbumId().equals(paramVO.getContsId()))
szContsId = paramVO.getContsId();
try {
if(paramVO.getAlbumId().equals(paramVO.getContsId()))
list = getFXFavorListDao.getProdType1(paramVO);
else
list = getFXFavorListDao.getProdType2(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list != null && !list.isEmpty()) {
szProductType = StringUtil.nullToSpace(list.get(0));
} else {
querySize = list.size();
}
// C에서 주석 처리된 로그
try{
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
IMCSLog imcsLog = new IMCSLog(imcsLogger, paramVO.getSaId(), paramVO.getStbMac(), paramVO.getPid());
imcsLog.errorLog(methodName + "-E", e.getClass().getName() + ":" + e.getMessage());
}
return szProductType;
}
/**
* 앨범 정보 조회
* @param GetFXFavorListRequestVO paramVO
* @return List<GetNSPurchasedResultVO>
**/
public AlbumInfoVO getAlbumInfo(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_s01_20171214_001";
if("M".equals(paramVO.getFxType()) || "H".equals(paramVO.getFxType()))
sqlId = "fxvod060_s01_20171214_001";
else sqlId = "fxvod060_s02_20171214_001";
List<AlbumInfoVO> list = new ArrayList<AlbumInfoVO>();
//AlbumInfoVO resultVO = new AlbumInfoVO();
AlbumInfoVO resultVO = null;
int querySize = 0;
try {
String szAlbumId = paramVO.getAlbumId();
if(!"M".equals(paramVO.getFxType()) && !"H".equals(paramVO.getFxType()))
szAlbumId = szAlbumId + "_IPTV";
try {
list = getFXFavorListDao.getAlbumInfo(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list != null && !list.isEmpty()) {
resultVO = list.get(0);
} else {
querySize = list.size();
}
// C에서 주석 처리된 로그
try{
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
IMCSLog imcsLog = new IMCSLog(imcsLogger, paramVO.getSaId(), paramVO.getStbMac(), paramVO.getPid());
imcsLog.errorLog(methodName + "-E", e.getClass().getName() + ":" + e.getMessage());
}
return resultVO;
}
/**
* 카테고리 정보 조회
* @param GetFXFavorListRequestVO paramVO
* @return GetNSCateInfoVO
**/
public CateInfoVO getCateInfo(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_002_20171214_001";
List<CateInfoVO> list = new ArrayList<CateInfoVO>();
CateInfoVO resultVO = new CateInfoVO();
int querySize = 0;
try {
String szContsId = paramVO.getAlbumId();
if(!"NSC".equals(paramVO.getCatGb())) szContsId = szContsId + "_IPTV";
try {
list = getFXFavorListDao.getCateInfo(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list != null && !list.isEmpty()) {
resultVO = list.get(0);
} else {
querySize = list.size();
}
try{// C에서 주석 처리된 로그
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
// imcsLog.failLog(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, "cate_info:" + ImcsConstants.RCV_MSG6, methodName, methodLine);
}
return resultVO;
}
/**
* 찜목록 정보 조회
* @param GetFXFavorListRequestVO paramVO
* @return List<GetFXFavorListResultVO>
**/
public List<GetFXFavorListResponseVO> getFavorList(GetFXFavorListRequestVO paramVO) throws Exception {
StackTraceElement oStackTrace = Thread.currentThread().getStackTrace()[1];
String methodName = oStackTrace.getMethodName();
String methodLine = String.valueOf(oStackTrace.getLineNumber() - 3);
String sqlId = "fxvod060_001_20171214_001";
int querySize = 0;
List<GetFXFavorListResponseVO> list = new ArrayList<GetFXFavorListResponseVO>();
try {
try {
list = getFXFavorListDao.getFavorList(paramVO);
paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] = paramVO.getNosqlCacheTypeCnt()[NosqlCacheType.USERDB.ordinal()] +1;
} catch (DataAccessException e) {
// DB관련 Exception발생 시 getLastException을 받기위해 SQLException으로 셋팅
throw new SQLException(e.getClass().getName() + ":" + e.getMessage());
}
if (list == null || list.isEmpty()) {
// imcsLog.failLog(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, "favor_info:" + ImcsConstants.RCV_MSG3, methodName, methodLine);
} else {
querySize = list.size();
}
try{// C에서 주석 처리된 로그
// imcsLog.dbLog2(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, querySize, methodName, methodLine);
}catch(Exception e){}
} catch (Exception e) {
// imcsLog.failLog(ImcsConstants.FXAPI_PRO_ID060, sqlId, cache, "favor_info:" + ImcsConstants.RCV_MSG2, methodName, methodLine);
throw new ImcsException();
}
return list;
}
}
| [
"yyj7952@gmail.com"
] | yyj7952@gmail.com |
b90b3be8f366da7ec1c90dd7daffb3097db679ae | 08abf384fb85e337ecfc39b424f547ddf0992e94 | /app/src/main/java/com/rovervan/ijkplayerincludedemo/MainActivity.java | 77a4f03ba7d031eb269dcde8212ac1f9e358b5c7 | [] | no_license | cybernhl/IjkplayerIncludeDemo | a0a7f54a291bd290e2726d9381f3678117785b15 | 3cc6869aad7f1479945a47f63adf779b66401b63 | refs/heads/master | 2022-11-09T19:33:58.180279 | 2017-08-21T09:10:39 | 2017-08-21T09:10:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | package com.rovervan.ijkplayerincludedemo;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import tv.danmaku.ijk.media.player.widget.IjkVideoView;
public class MainActivity extends AppCompatActivity {
IjkVideoView mVideoView;
private Uri mVideoUri;
private String VideoPath = "http://www.modrails.com/videos/passenger_nginx.mov" ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IjkMediaPlayer.loadLibrariesOnce(null);
IjkMediaPlayer.native_profileBegin("libijkplayer.so");
mVideoView = (IjkVideoView) findViewById(R.id.video_view);
mVideoUri = Uri.parse(VideoPath);
mVideoView.setVideoURI(mVideoUri);
mVideoView.start();
}
}
| [
"atrovervan@gmail.com"
] | atrovervan@gmail.com |
cd74cf5c49c9b4674ca699366c499fc9889d054c | 77fc49f6a26480793e745ddb5c955b7e15dd4480 | /api/direct/src/main/java/org/ulf/api/direct/M.java | 352a7bb4f95116854c93a655b0699c310c7dbee2 | [
"MIT"
] | permissive | jbytecoder/ulf | 9092e28bc90357967ae3aaec69e7037ba0b3d71b | 175f5acbef8105a1e66a6d7aa8b3bec3eb663d5c | refs/heads/master | 2020-03-26T03:39:01.916268 | 2019-09-07T21:17:53 | 2019-09-07T21:17:53 | 144,464,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,472 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ulf.api.direct;
import org.ulf.api.IMessage;
/**
*
* @author jbytecoder
*/
public class M {
public static IMessage me( Class c, String method ) {
return L.m().at(L.LEVEL_ERROR).from(c.getName(), method);
}
public static IMessage me( Throwable th ) {
return L.m().at(L.LEVEL_ERROR).about(th);
}
public static IMessage mw( Class c, String method ) {
return L.m().at(L.LEVEL_WARNING).from(c.getName(), method);
}
public static IMessage mw( Throwable th ) {
return L.m().at(L.LEVEL_WARNING).about(th);
}
public static IMessage mi( Class c, String method ) {
return L.m().at(L.LEVEL_INFO).from(c.getName(), method);
}
public static IMessage mi( Throwable th ) {
return L.m().at(L.LEVEL_INFO).about(th);
}
public static IMessage md( Class c, String method ) {
return L.m().at(L.LEVEL_DEBUG).from(c.getName(), method);
}
public static IMessage md( Throwable th ) {
return L.m().at(L.LEVEL_DEBUG).about(th);
}
public static IMessage mv( Class c, String method ) {
return L.m().at(L.LEVEL_VERBOSE).from(c.getName(), method);
}
public static IMessage mv( Throwable th ) {
return L.m().at(L.LEVEL_VERBOSE).about(th);
}
}
| [
"hudziak@cogisoft.pl"
] | hudziak@cogisoft.pl |
394ffa7e2d75e1c300a82b58b8b22c99212903d3 | 2c5aaa79e3cb6ece11087f3da581079370a02320 | /src/main/java/com/wangsc/service/ProductInfoService.java | 2c17e44c357775f549687cfa544d2db65078f600 | [] | no_license | wangshichao9527/sell | 955e4ff86e3da8f4d68e3d82525e3c55d9fd566f | 0215e6917a432459d99dca44111b9b3e258a7d40 | refs/heads/master | 2020-07-25T07:56:07.003135 | 2019-09-22T14:37:09 | 2019-09-22T14:37:09 | 208,221,928 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 628 | java | package com.wangsc.service;
import com.wangsc.dataobject.ProductInfo;
import com.wangsc.dto.CartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* @author wangsc
* @date 2019-9-13 15:25
*/
public interface ProductInfoService {
ProductInfo findById(String productId);
List<ProductInfo> findUpAll();
Page<ProductInfo> findAll(Pageable pageable);
ProductInfo save(ProductInfo productInfo);
//加库存
void increaseStock(List<CartDTO> cartDTOList);
//减库存
void decreaseStock(List<CartDTO> cartDTOList);
}
| [
"1414585969@qq.com"
] | 1414585969@qq.com |
95781c52bb4e0638aaa6fe037fbfe869b4c70c13 | a7d25d6f8a2965e4ba18029f0c63dabe1d753d91 | /src/ua/artemenko/student/goit/company/module_11/module_04/Point.java | c2523e189d950c36a931e2356c4998cf27fe9941 | [] | no_license | ArtemenkoJenia/GoJavaOnline3 | 4f3bdff468456072e146e9adcd3016ca38c6991a | 8bb895cbcd21d6d6f362e2fb1b47d05803b541d9 | refs/heads/master | 2020-04-05T20:50:15.725415 | 2016-07-03T21:34:35 | 2016-07-03T21:34:35 | 60,007,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,053 | java | package ua.artemenko.student.goit.company.module_11.module_04;
public class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Point point = (Point) o;
if (Double.compare(point.x, x) != 0) return false;
return Double.compare(point.y, y) == 0;
}
@Override
public int hashCode() {
int result;
long temp;
temp = Double.doubleToLongBits(x);
result = (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(y);
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}
}
| [
"artemenkojenia.ea@gmail.com"
] | artemenkojenia.ea@gmail.com |
a38716a8b25104774814804aaf5439c3c2c11407 | 4bae1049efb50f21f5a2d2c56890626679190e8c | /app/src/main/java/com/jude/automobile/domain/Dir.java | 755fa76acf6ad969d960f4477d93f86a30373939 | [] | no_license | Jude95/Automobile | 5a93a6592035d3fda79d46b87db6ced1e73cbba6 | ce64df4ea18fdf6f7015c68acc1c6811243b382a | refs/heads/master | 2021-01-21T04:32:16.861311 | 2016-07-01T09:44:23 | 2016-07-01T09:44:23 | 49,881,682 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 118 | java | package com.jude.automobile.domain;
/**
* Created by Mr.Jude on 2015/9/11.
*/
public enum Dir {
Image,Object
}
| [
"973829691@qq.com"
] | 973829691@qq.com |
a3fd309af3817679e4d924b8a943f03c510278d5 | 4144f2a748ad4de1428ccba899fa7908361eb096 | /src/main/java/com/cursomc/domain/Endereco.java | 813044b8eabf28c13d829cbbd519525f6ed61c57 | [] | no_license | ims86/cursomc | 54a5a9c0364adcb03cf3385b7a4ac266397b0e6b | f223a40f31ffa24630784334f237317956ef8e08 | refs/heads/master | 2020-04-18T13:56:09.518299 | 2019-02-26T21:15:31 | 2019-02-26T21:15:31 | 167,575,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,665 | java | package com.cursomc.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class Endereco implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer id;
private String logradouro;
private String numero;
private String complemento;
private String bairro;
private String cep;
@JsonIgnore
@ManyToOne
@JoinColumn(name="cliente_id")
private Cliente cliente;
@ManyToOne
@JoinColumn(name="cidade_id")
private Cidade cidade;
public Endereco() {
}
public Endereco(Integer id, String logradouro, String numero, String complemento, String bairro, String cep,
Cliente cliente, Cidade cidade) {
super();
this.id = id;
this.logradouro = logradouro;
this.numero = numero;
this.complemento = complemento;
this.bairro = bairro;
this.cep = cep;
this.cliente = cliente;
this.setCidade(cidade);
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLogradouro() {
return logradouro;
}
public void setLogradouro(String logradouro) {
this.logradouro = logradouro;
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getComplemento() {
return complemento;
}
public void setComplemento(String complemento) {
this.complemento = complemento;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public Cidade getCidade() {
return cidade;
}
public void setCidade(Cidade cidade) {
this.cidade = cidade;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Endereco other = (Endereco) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"ims.86@hotmail.com"
] | ims.86@hotmail.com |
c76ddc842596c78005a75de20ac5e114524ab7a2 | faa49d643ab0e8ebc3e2d2c9b1840f6c963ef9d8 | /cloud-ms/JCatascopia-Server/src/main/java/eu/celarcloud/celar_ms/ServerPack/SubProcessor.java | 9a9022c9b7aeeef7f65ac71c90ec2490ec26d0a8 | [] | no_license | demiscy/jj | b9ea33b0b2e71f6670db685917a1ff2ad1984c06 | 8bfa6b3d5e4b256e6a0cd4786c137ad8e81961f2 | refs/heads/master | 2021-01-22T09:20:31.153632 | 2013-09-26T12:25:34 | 2013-09-26T12:26:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,182 | java | package eu.celarcloud.celar_ms.ServerPack;
import java.util.ArrayList;
import java.util.logging.Level;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import eu.celarcloud.celar_ms.Exceptions.CatascopiaException;
import eu.celarcloud.celar_ms.ServerPack.Beans.MetricObj;
import eu.celarcloud.celar_ms.ServerPack.Beans.SubMapDAO;
import eu.celarcloud.celar_ms.ServerPack.Beans.SubObj;
import eu.celarcloud.celar_ms.ServerPack.Beans.SubObj.GroupingFunction;
import eu.celarcloud.celar_ms.ServerPack.Database.SubscriptionDAO;
import eu.celarcloud.celar_ms.ServerPack.subsciptionPack.SubTask;
import eu.celarcloud.celar_ms.SocketPack.ISocket;
/*
* {
* "subID" : "067e61623b6f4ae2a1712470b63dff00",
* "metric" : {
* "name" : "clusterCPUTotal",
* "type" : "DOUBLE",
* "units" : "%",
* "group" : "CPU",
* "val" : "AVG(cpuTotal)",
* "period" : "20",
* "agents" : ["10.16.21.2","10.16.21.5"]
* }
* "storeInDB" : "YES",
"action" : "NOTIFY >70%,<15%"
* }
*/
public class SubProcessor implements Runnable{
public enum Status {OK,ERROR,SYNTAX_ERROR,NOT_FOUND,WARNING,CONFLICT};
private String[] msg;
private ISocket router;
private MonitoringServer server;
//msg[0] address
//msg[1] message type
//msg[2] content
public SubProcessor(String[] msg, ISocket router, MonitoringServer server){
this.msg = msg;
this.router = router;
this.server = server;
}
public void run(){
if (this.server.inDebugMode())
System.out.println("\nSubProcessor>> processing the following message...\n"+msg[0]+" "+msg[1]+"\n"+msg[2]);
try{
JSONParser parser = new JSONParser();
JSONObject json;
json = (JSONObject) parser.parse(msg[2]); //parse content
if (msg[1].equals("SUBSCRIPTION.ADD"))
this.addSubscription(json);
else if (msg[1].equals("SUBSCRIPTION.ADDAGENT"))
this.addAgentToSub(json);
else if (msg[1].equals("SUBSCRIPTION.REMOVEAGENT"))
this.removeAgentFromSub(json);
else if (msg[1].equals("SUBSCRIPTION.DELETE"))
this.deleteSubscription(json);
else
this.response(Status.ERROR, msg[1]+" request does not exist");
}
catch(NullPointerException e){
this.server.writeToLog(Level.SEVERE, e);
this.response(Status.SYNTAX_ERROR, msg[1]+" Subscription is not valid");
}
catch(IllegalArgumentException e){
this.server.writeToLog(Level.SEVERE, e);
this.response(Status.SYNTAX_ERROR,"Grouping function either does not exist or is not currently supported");
}
catch (Exception e){
this.server.writeToLog(Level.SEVERE, e);
this.response(Status.ERROR, msg[1]+" an error msg");
}
}
private void addSubscription(JSONObject json){
String subID = (String) json.get("subID");
JSONObject metric = (JSONObject) json.get("metric");
String subName = (String) metric.get("name");
//String[] val = metric.get("val").toString().split("(");
String[] val = metric.get("val").toString().split(":");
GroupingFunction func = SubObj.GroupingFunction.valueOf(val[0]); //if not a valid function exception thrown
//String originMetric = val[1].replace(")", "");
String originMetric = val[1];
int period = Integer.parseInt(metric.get("period").toString());
String metricID = subID+":"+subName;
MetricObj metricobj = new MetricObj(metricID,null,subID,subName,(String)metric.get("units"),
(String)metric.get("type"),(String)metric.get("group"));
JSONArray agents = (JSONArray) metric.get("agents");
ArrayList<String> agentlist = new ArrayList<String>();
for(Object a : agents){
if (server.agentMap.containsKey(a.toString()))
agentlist.add(a.toString());
else{
this.response(Status.NOT_FOUND, "Agent with ID "+a.toString()+" does not exist");
return;
}
}
SubObj subobj = new SubObj(subID,subName,metricID,originMetric,agentlist,func,period);
if (this.server.inDebugMode()){
System.out.println("SubProcessor>> MetricObj...\n"+metricobj.toString());
System.out.println("SubProcessor>> SubObj...\n"+subobj.toString());
}
//add to subMap and metricMap
SubMapDAO.createSubcription(server.subMap, server.metricMap, subobj, metricobj);
this.server.writeToLog(Level.INFO, "SubProcessor>> created a new subscription...\n"+subobj.toString());
//add to DB
if (this.server.getDatabaseFlag())
SubscriptionDAO.createSubscription(this.server.dbHandler.getConnection(), subobj, metricobj);
this.response(Status.OK,"");
this.server.subscheduler.scheduleTask(new SubTask(server,subID), period*1000);
}
private void addAgentToSub(JSONObject json){
String subID = (String) json.get("subID");
String agentID = (String) json.get("agentID");
//edit Map
SubMapDAO.addAgent(server.subMap, server.agentMap, subID, agentID);
//edit to DB
if (this.server.getDatabaseFlag())
SubscriptionDAO.addAgent(this.server.dbHandler.getConnection(), subID, agentID);
this.response(Status.OK, "");
}
private void removeAgentFromSub(JSONObject json){
String subID = (String) json.get("subID");
String agentID = (String) json.get("agentID");
//edit Map
SubMapDAO.removeAgent(server.subMap, server.agentMap, subID, agentID);
//edit to DB
if (this.server.getDatabaseFlag())
SubscriptionDAO.removeAgent(this.server.dbHandler.getConnection(), subID, agentID);
this.response(Status.OK, "");
}
private void deleteSubscription(JSONObject json){
String subID = (String) json.get("subID");
//edit Map
SubMapDAO.removeSubscription(server.subMap, server.metricMap, subID);
//edit to DB
if (this.server.getDatabaseFlag())
SubscriptionDAO.deleteSubscription(this.server.dbHandler.getConnection(), subID);
this.response(Status.OK, "");
}
private void response(Status status,String body){
try{
String obj = ((body.equals("")) ? status.toString() : (status+"|"+body));
this.router.send(msg[0], msg[1], obj);
}
catch (CatascopiaException e){
this.server.writeToLog(Level.SEVERE, e);
}
}
}
| [
"dtrihinas@hotmail.com"
] | dtrihinas@hotmail.com |
aaecaf84847be3f88eb7cd9088a12aa6a6bf5c58 | 1cf008cb24753757601e4ca72bf7bfbe75f1f073 | /src/com/jsjf/service/activity/impl/DrMemberFavourableServiceImpl.java | b33aa7883a961970d2e22529f2ec9455cf6418df | [] | no_license | lslnx0307/system | 22c8d919cf3be1ed40512d297b760663ec45d9cb | 85907d6662d405912ca48678dc4c13447120cd21 | refs/heads/master | 2020-04-08T21:30:18.323733 | 2018-11-30T00:56:11 | 2018-11-30T00:56:11 | 159,746,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,850 | java | package com.jsjf.service.activity.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jsjf.common.BaseResult;
import com.jsjf.common.PageInfo;
import com.jsjf.common.Utils;
import com.jsjf.dao.activity.DrActivityParameterDAO;
import com.jsjf.dao.activity.DrMemberFavourableDAO;
import com.jsjf.model.activity.DrActivityParameter;
import com.jsjf.model.activity.DrMemberFavourable;
import com.jsjf.model.system.SysUsersVo;
import com.jsjf.service.activity.DrMemberFavourableService;
@Service
@Transactional
public class DrMemberFavourableServiceImpl implements DrMemberFavourableService {
@Autowired
DrActivityParameterDAO drActivityParameterDAO;
@Autowired
DrMemberFavourableDAO drMemberFavourableDAO;
@Override
public void selectActivity(Integer uid,
DrActivityParameter dap, SysUsersVo usersVo) throws Exception
{
dap.setSurplusQty(dap.getSurplusQty()-1);//修改剩余数量
//修改活动
drActivityParameterDAO.updateActivityParameter(dap);
//插入发放的表dr_member_favourable
DrMemberFavourable dmf = new DrMemberFavourable(dap.getId(), uid, dap.getType(), dap.getCode(), dap.getName(), dap.getAmount(), dap.getRaisedRates(),
dap.getEnableAmount(), 0,Utils.getDayNumOfDate(1-dap.getDeadline()), null,"客服发放",usersVo.getUserKy().intValue(),1,dap.getProductDeadline(),dap.getMultiple());
drMemberFavourableDAO.insertIntoInfo(dmf);
}
@Override
public BaseResult selectFavourableByParam(Map<String, Object> map,
PageInfo pi) {
map.put("offset",pi.getPageInfo().getOffset());
map.put("limit",pi.getPageInfo().getLimit());
List<DrMemberFavourable> list = drMemberFavourableDAO.getMemberFavourable(map);
Integer total = drMemberFavourableDAO.getMemberFavourableTotal(map);
map.clear();
pi.setTotal(total);
pi.setRows(list);
map.put("page", pi);
BaseResult br = new BaseResult();
br.setMap(map);
return br;
}
/**
* 批量发放加息劵操作
*/
@Override
public void batchSelectActivity(Integer[] uids, DrActivityParameter dap, SysUsersVo usersVo) throws Exception{
for(Integer uid :uids){
dap.setSurplusQty(dap.getSurplusQty()-1);//修改剩余数量
//修改活动
drActivityParameterDAO.updateActivityParameter(dap);
//插入发放的表dr_member_favourable
DrMemberFavourable dmf = new DrMemberFavourable(dap.getId(), uid, dap.getType(), dap.getCode(), dap.getName(), dap.getAmount(), dap.getRaisedRates(),
dap.getEnableAmount(), 0,Utils.getDayNumOfDate(1-dap.getDeadline()), null,"客服发放",usersVo.getUserKy().intValue(),1,dap.getProductDeadline(),dap.getMultiple());
drMemberFavourableDAO.insertIntoInfo(dmf);
}
}
}
| [
"184576454@qq.com"
] | 184576454@qq.com |
6f5a754c2619514bdce8d2dbc347fe577f83b9ab | 4779b7d8e6e34523fdedc79ecda432f8a0387ea0 | /src/main/java/com/kingdee/exam/voj/messenger/MessageReceiver.java | 6e6e17421adc71e68b6a030615133d34c4b49aac | [] | no_license | Joysing/KingdeeExam | 8434986ffb96dedf2eb0984b01aa57ef5a2d12c1 | 1115e8863e0794b287254d9f46c62a8295500b3a | refs/heads/master | 2022-09-29T20:39:54.467101 | 2019-09-19T08:20:40 | 2019-09-19T08:20:40 | 165,614,468 | 1 | 3 | null | 2022-09-01T23:13:12 | 2019-01-14T07:20:30 | CSS | UTF-8 | Java | false | false | 5,976 | java | package com.kingdee.exam.voj.messenger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
import java.util.Calendar;
import java.util.Date;
/**
* 消息接收服务.
* 用于接收来自评测机的实时评测结果.
*/
@Component
public class MessageReceiver implements MessageListener {
private final ApplicationEventPublisher eventPublisher;
private static final Logger LOGGER = LogManager.getLogger(MessageReceiver.class);
@Autowired
public MessageReceiver(ApplicationEventPublisher eventPublisher) {
this.eventPublisher = eventPublisher;
}
public void onMessage(Message message) {
if ( message instanceof MapMessage ) {
final MapMessage mapMessage = (MapMessage) message;
try {
String event = mapMessage.getString("event");
if ( "ErrorOccurred".equals(event) ) {
errorHandler(mapMessage);
} else if ( "CompileFinished".equals(event) ) {
compileFinishedHandler(mapMessage);
} else if ( "TestPointFinished".equals(event) ) {
testPointFinishedHandler(mapMessage);
} else if ( "AllTestPointsFinished".equals(event) ) {
allTestPointsFinishedHandler(mapMessage);
} else if ( "KeepAlive".equals(event) ) {
receiveFromAliveJudgersHandler(mapMessage);
} else {
LOGGER.warn(String.format("接收到未知事件. [Event = %s]",
event));
}
} catch (JMSException ex) {
LOGGER.catching(ex);
}
}
}
/**
* 处理评测机发生内部错误的消息.
* @param mapMessage - 消息队列中收到的MapMessage对象
*/
private void errorHandler(MapMessage mapMessage) throws JMSException {
long submissionId = mapMessage.getLong("submissionId");
eventPublisher.publishEvent(new SubmissionEvent(this, submissionId, "System Error", "System Error.", true));
LOGGER.info(String.format("Submission #%d 返回结果 [System Error].", submissionId));
}
/**
* 处理评测机编译完成时的消息.
* @param mapMessage - 消息队列中收到的MapMessage对象
*/
private void compileFinishedHandler(MapMessage mapMessage) throws JMSException {
long submissionId = mapMessage.getLong("submissionId");
boolean isSuccessful = mapMessage.getBoolean("isSuccessful");
String log = mapMessage.getString("log");
if ( isSuccessful ) {
String message = "代码编译成功。开始测试数据。\n\n";
eventPublisher.publishEvent(new SubmissionEvent(this, submissionId, "Running", message, false));
LOGGER.info(String.format("Submission #%d 返回结果 [Compile Successfully].", submissionId));
} else {
eventPublisher.publishEvent(new SubmissionEvent(this, submissionId, "Compiler Error", log, true));
LOGGER.info(String.format("Submission #%d 返回结果 [Compile Error].\n\tError Message:%s",
submissionId, log));
}
}
/**
* 处理评测机完成单个测试点的消息.
* @param mapMessage - 消息队列中收到的MapMessage对象
*/
private void testPointFinishedHandler(MapMessage mapMessage) throws JMSException {
long submissionId = mapMessage.getLong("submissionId");
int checkpointId = mapMessage.getInt("checkpointId");
String runtimeResult = mapMessage.getString("runtimeResult");
int usedTime = mapMessage.getInt("usedTime");
int usedMemory = mapMessage.getInt("usedMemory");
int score = mapMessage.getInt("score");
String message = String.format("\n- 样例 #%d: %s, 时间 = %d ms, 内存 = %d KB, 分数 = %d\n",
checkpointId, runtimeResult, usedTime, usedMemory, score);
eventPublisher.publishEvent(new SubmissionEvent(this, submissionId, "Running", message, false));
LOGGER.info(String.format("Submission #%d/ 测试用例#%d 返回结果 [%s] (所用时间 = %dms, 所用内存 = %d KB, 分数 = %d).",
submissionId, checkpointId, runtimeResult, usedTime, usedMemory, score));
}
/**
* 处理评测机完成全部测试点的消息.
* @param mapMessage - 消息队列中收到的MapMessage对象
*/
private void allTestPointsFinishedHandler(MapMessage mapMessage) throws JMSException {
long submissionId = mapMessage.getLong("submissionId");
String runtimeResult = mapMessage.getString("runtimeResult");
int usedTime = mapMessage.getInt("totalTime");
int usedMemory = mapMessage.getInt("maxMemory");
int score = mapMessage.getInt("totalScore");
String message = String.format("\n%s, 时间 = %d ms, 内存 = %d KB, 通过率 %d%s\n",
runtimeResult, usedTime, usedMemory, score,"%");
eventPublisher.publishEvent(new SubmissionEvent(this, submissionId, runtimeResult, message, true));
LOGGER.info(String.format("Submission #%d 判题完成,返回结果为 [%s] (所用时间 = %d ms, 所用内存 = %d KB, 分数 = %d).",
submissionId, runtimeResult, usedTime, usedMemory, score));
}
/**
* 处理来自评测机的Keep-Alive消息.
* 用于在Web端获取后端评测机的信息.
* @param mapMessage - 消息队列中收到的MapMessage对象
*/
private void receiveFromAliveJudgersHandler(MapMessage mapMessage) throws JMSException {
String judgerUsername = mapMessage.getString("username");
String judgerDescription = mapMessage.getString("description");
long heartbeatTimeInMillis = mapMessage.getLong("heartbeatTime");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(heartbeatTimeInMillis);
Date heartbeatTime = calendar.getTime();
eventPublisher.publishEvent(new KeepAliveEvent(this, judgerUsername, judgerDescription, heartbeatTime));
LOGGER.info(String.format("接收到来自编译机[%s]的心跳", judgerUsername));
}
}
| [
"1027577022@qq.com"
] | 1027577022@qq.com |
7e0e71589febf21cde3b8d23879ca9d11e02217f | f1f9e138e575dc11513ba3e979e111df705b0680 | /MyPDF/app/src/main/java/com/fumei/pdfread/utils/MyKeyChain.java | 3763fbb4c03c141a339c7e8d71efe737178186f0 | [] | no_license | wcb1207/test | 50e6e2be143197f7d4d1280fec1554fd43158cc6 | 649c505f8f6e4ce942073cfe5bfe2d9ba1284e0a | refs/heads/master | 2021-01-17T17:08:49.613849 | 2016-08-03T09:03:42 | 2016-08-03T09:03:42 | 64,827,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,080 | java | /*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
package com.fumei.pdfread.utils;
import android.content.Context;
import android.util.Base64;
import com.facebook.crypto.cipher.NativeGCMCipher;
import com.facebook.crypto.exception.KeyChainException;
import com.facebook.crypto.keychain.KeyChain;
import java.security.SecureRandom;
import java.util.Arrays;
/**
* Use user's defined publicBase64Key, that would not be saved into preference
* @param context
* @param publicBase64Key Can encode from any support site, ex.http://www.motobit.com/util/base64-decoder-encoder.asp
*/
public class MyKeyChain implements KeyChain {
private final SecureRandom mSecureRandom;
protected byte[] mCipherKey;
protected boolean mSetCipherKey;
private String publicKey;
private static final SecureRandomFix sSecureRandomFix = new SecureRandomFix();
public MyKeyChain(Context context, String publicBase64Key) {
mSecureRandom = new SecureRandom();
this.publicKey=publicBase64Key;
}
@Override
public synchronized byte[] getCipherKey() throws KeyChainException {
if (!mSetCipherKey) {
mCipherKey = decodeKey(publicKey);
}
mSetCipherKey = true;
return mCipherKey;
}
@Override
public byte[] getMacKey() throws KeyChainException {
return null;
}
@Override
public byte[] getNewIV() throws KeyChainException {
sSecureRandomFix.tryApplyFixes();
byte[] iv = new byte[NativeGCMCipher.IV_LENGTH];
mSecureRandom.nextBytes(iv);
return iv;
}
@Override
public synchronized void destroyKeys() {
mSetCipherKey = false;
Arrays.fill(mCipherKey, (byte) 0);
mCipherKey = null;
}
private byte[] decodeKey(String keyString) {
if (keyString == null) {
return null;
}
return Base64.decode(keyString, Base64.DEFAULT);
}
}
| [
"wcb1207@sina.com"
] | wcb1207@sina.com |
0ec655746e6c5c35dddddb57810c0378923a1fde | 2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17 | /material/apks/banco/sources/com/google/android/gms/location/internal/zzh.java | 639dcc9033ac75c7ffb114820838cc69483fa4c2 | [] | no_license | lcrcastor/curso-mobile-2019 | 3088a196139b3e980ed6e09797a0bbf5efb6440b | 7585fccb6437a17c841772c1d9fb0701d6c68042 | refs/heads/master | 2023-04-06T21:46:32.333236 | 2020-10-30T19:47:54 | 2020-10-30T19:47:54 | 308,680,747 | 0 | 1 | null | 2023-03-26T06:57:57 | 2020-10-30T16:08:31 | Java | UTF-8 | Java | false | false | 4,397 | java | package com.google.android.gms.location.internal;
import android.app.PendingIntent;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
public interface zzh extends IInterface {
public static abstract class zza extends Binder implements zzh {
/* renamed from: com.google.android.gms.location.internal.zzh$zza$zza reason: collision with other inner class name */
static class C0035zza implements zzh {
private IBinder a;
C0035zza(IBinder iBinder) {
this.a = iBinder;
}
public IBinder asBinder() {
return this.a;
}
public void zza(int i, PendingIntent pendingIntent) {
Parcel obtain = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.location.internal.IGeofencerCallbacks");
obtain.writeInt(i);
if (pendingIntent != null) {
obtain.writeInt(1);
pendingIntent.writeToParcel(obtain, 0);
} else {
obtain.writeInt(0);
}
this.a.transact(3, obtain, null, 1);
} finally {
obtain.recycle();
}
}
public void zza(int i, String[] strArr) {
Parcel obtain = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.location.internal.IGeofencerCallbacks");
obtain.writeInt(i);
obtain.writeStringArray(strArr);
this.a.transact(1, obtain, null, 1);
} finally {
obtain.recycle();
}
}
public void zzb(int i, String[] strArr) {
Parcel obtain = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.location.internal.IGeofencerCallbacks");
obtain.writeInt(i);
obtain.writeStringArray(strArr);
this.a.transact(2, obtain, null, 1);
} finally {
obtain.recycle();
}
}
}
public zza() {
attachInterface(this, "com.google.android.gms.location.internal.IGeofencerCallbacks");
}
public static zzh zzhb(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.location.internal.IGeofencerCallbacks");
return (queryLocalInterface == null || !(queryLocalInterface instanceof zzh)) ? new C0035zza(iBinder) : (zzh) queryLocalInterface;
}
public IBinder asBinder() {
return this;
}
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) {
if (i != 1598968902) {
switch (i) {
case 1:
parcel.enforceInterface("com.google.android.gms.location.internal.IGeofencerCallbacks");
zza(parcel.readInt(), parcel.createStringArray());
return true;
case 2:
parcel.enforceInterface("com.google.android.gms.location.internal.IGeofencerCallbacks");
zzb(parcel.readInt(), parcel.createStringArray());
return true;
case 3:
parcel.enforceInterface("com.google.android.gms.location.internal.IGeofencerCallbacks");
zza(parcel.readInt(), parcel.readInt() != 0 ? (PendingIntent) PendingIntent.CREATOR.createFromParcel(parcel) : null);
return true;
default:
return super.onTransact(i, parcel, parcel2, i2);
}
} else {
parcel2.writeString("com.google.android.gms.location.internal.IGeofencerCallbacks");
return true;
}
}
}
void zza(int i, PendingIntent pendingIntent);
void zza(int i, String[] strArr);
void zzb(int i, String[] strArr);
}
| [
"luis@MARK-2.local"
] | luis@MARK-2.local |
01a2b57388a918b0c3966c0de84b45deecf85b7f | a604c3ca1ec349296b63f33353a5dc182ecc7d87 | /src/main/java/ast/operators/Equal.java | b5ed777e1eda6c2dde7287ac4a44597caf7578ef | [] | no_license | nullartist/glsl-on-cpu | b331364cd7cb41cc119aa69df7ac26689bf587bb | 29f2ae365d58c32dcc80f0d6341ff492d8cacb16 | refs/heads/master | 2023-03-18T08:09:33.535107 | 2019-06-03T02:51:36 | 2019-06-03T02:51:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package ast.operators;
import ast.exceptions.*;
import ast.types.*;
import ast.values.*;
public class Equal extends Operator implements BinaryOperator {
public static Equal OP = new Equal();
public Value apply(Value x, Value y) throws OperatorCannotBeAppliedException {
apply(x.getType(), y.getType());
return new BoolValue(x.equals(y));
}
public BoolType apply(Type x, Type y) throws OperatorCannotBeAppliedException {
if (!x.equals(y) || x instanceof ArrayType || x instanceof StructType)
throw new OperatorCannotBeAppliedException(this, x, y);
return BoolType.TYPE;
}
@Override
public String toString() {
return "==";
}
}
| [
"491506913@qq.com"
] | 491506913@qq.com |
30cc17a5c5fd10aece67e2c08aab152ac2f1c1fd | e57b8ff56f512fd79ac22eb6007227a74d7c258e | /src/com/test/SimpleClient.java | 2ec12ff0128582ddcb2af13cee93ccb9adf9a752 | [
"Apache-2.0"
] | permissive | sarathrami/Chain-Replication | 45905068d5cdaadbb50af874c4e2518a86686cf6 | c652503bdef7de4dc4685f3f52f5cb6f4c304d69 | refs/heads/master | 2016-09-10T20:14:46.787126 | 2014-12-18T01:05:56 | 2014-12-18T01:05:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 695 | java | /*
*
*/
package com.test;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
// TODO: Auto-generated Javadoc
/**
* The Class SimpleClient.
*/
public class SimpleClient {
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String args[]) {
try {
while (true) {
Socket s = new Socket("localhost", 2002);
OutputStream os = s.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(os);
testobject to = new testobject(1, "object from client");
oos.writeObject(to);
oos.close();
os.close();
s.close();
}
} catch (Exception e) {
System.out.println(e);
}
}
}
| [
"g2.t2.101@gmail.com"
] | g2.t2.101@gmail.com |
05d1267ab16b42388707ca4e229d3d757c02789f | 58eff331c92f329678334f8b54a0aeb16ef46fce | /src/main/java/com/example/customerservice/Exception/CustomerNotFoundException.java | 88d1db38f23939b4b419114b48543aa97b9651e0 | [] | no_license | suyogdeshmukh90/customer-service-docker-aws | 95c340ae750fe2124e0c45e3045f459ebb1ce2d2 | 90a4773d347434123b909e4c71cdf4659f24bfa7 | refs/heads/master | 2023-06-19T15:27:43.061980 | 2021-07-22T10:17:45 | 2021-07-22T10:17:45 | 388,355,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.example.customerservice.Exception;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class CustomerNotFoundException extends RuntimeException {
private long serialID = 1L;
private String message;
public CustomerNotFoundException(String message) {
this.message = message;
}
}
| [
"suyogdeshmukh90@gmail.com"
] | suyogdeshmukh90@gmail.com |
7653012fac991dd6bf06fb1a2f0d8682c2e833e9 | 5a22d64628701186ee3af5791d707d219008b19f | /servo-core/src/main/java/com/netflix/servo/monitor/Pollers.java | fb8ff7e0f2643ca99dd915509a08ed7f0e6dafcd | [
"Apache-2.0"
] | permissive | qichenftw/servo | 66f165fb2e8db559bfa2933807967ea192b709a5 | 5956a11ad106cb2346825fd22abca5df5ee9f593 | refs/heads/master | 2020-12-11T09:30:22.945353 | 2014-10-29T16:40:14 | 2014-10-29T16:40:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,900 | java | /**
* Copyright 2013 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.netflix.servo.monitor;
import com.google.common.collect.ImmutableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* Poller configuration. This class provides the mechanism
* to know how many pollers will be used, and at their estimated polling intervals.
*/
public final class Pollers {
private Pollers() {
}
/**
* A comma separated list of longs indicating the frequency of the pollers. For example: <br/>
* {@code 60000, 10000 }<br/>
* indicates that the main poller runs every 60s and a secondary
* poller will run every 10 seconds.
* This is used to deal with monitors that need to get reset after they're polled.
* For example a MinGauge or a MaxGauge.
*/
public static final String POLLERS = System.getProperty("servo.pollers", "60000,10000");
static final long[] DEFAULT_PERIODS = new long[]{60000L, 10000L};
/**
* Polling intervals in milliseconds.
*/
static final long[] POLLING_INTERVALS = parse(POLLERS);
private static final ImmutableList<Long> POLLING_INTERVALS_AS_LIST;
/**
* Get list of polling intervals in milliseconds.
*/
public static List<Long> getPollingIntervals() {
return POLLING_INTERVALS_AS_LIST;
}
/**
* Number of pollers that will run.
*/
public static final int NUM_POLLERS = POLLING_INTERVALS.length;
/**
* For debugging. Simple toString for non-empty arrays
*/
private static String join(long[] a) {
assert (a.length > 0);
StringBuilder builder = new StringBuilder();
builder.append(a[0]);
for (int i = 1; i < a.length; ++i) {
builder.append(',');
builder.append(a[i]);
}
return builder.toString();
}
/**
* Parse the content of the system property that describes the polling intervals,
* and in case of errors
* use the default of one poller running every minute.
*/
static long[] parse(String pollers) {
String[] periods = pollers.split(",\\s*");
long[] result = new long[periods.length];
boolean errors = false;
Logger logger = LoggerFactory.getLogger(Pollers.class);
for (int i = 0; i < periods.length; ++i) {
String period = periods[i];
try {
result[i] = Long.parseLong(period);
if (result[i] <= 0) {
logger.error("Invalid polling interval: {} must be positive.", period);
errors = true;
}
} catch (NumberFormatException e) {
logger.error("Cannot parse '{}' as a long: {}", period, e.getMessage());
errors = true;
}
}
if (errors || periods.length == 0) {
logger.info("Using a default configuration for poller intervals: {}",
join(DEFAULT_PERIODS));
return DEFAULT_PERIODS;
} else {
return result;
}
}
static {
ImmutableList.Builder<Long> builder = ImmutableList.builder();
for (long pollingInterval : POLLING_INTERVALS) {
builder.add(pollingInterval);
}
POLLING_INTERVALS_AS_LIST = builder.build();
}
}
| [
"dmuino@netflix.com"
] | dmuino@netflix.com |
dd768be6259902d101124e80a9aa0d7db66f1d0f | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Cli-31/org.apache.commons.cli.OptionBuilder/BBC-F0-opt-100/tests/3/org/apache/commons/cli/OptionBuilder_ESTest.java | a16bd5eeb7adccf99ad76327178b75d15b621d7b | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 8,402 | java | /*
* This file was automatically generated by EvoSuite
* Wed Oct 13 15:35:02 GMT 2021
*/
package org.apache.commons.cli;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class OptionBuilder_ESTest extends OptionBuilder_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
OptionBuilder.isRequired(true);
Option option0 = OptionBuilder.create("arg");
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test01() throws Throwable {
OptionBuilder.withValueSeparator('K');
Option option0 = OptionBuilder.create("arg");
assertEquals('K', option0.getValueSeparator());
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test02() throws Throwable {
OptionBuilder.withLongOpt("");
Option option0 = OptionBuilder.create("");
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test03() throws Throwable {
OptionBuilder.hasOptionalArgs();
Option option0 = OptionBuilder.create("");
assertTrue(option0.hasOptionalArg());
assertEquals((-2), option0.getArgs());
}
@Test(timeout = 4000)
public void test04() throws Throwable {
OptionBuilder.withArgName("");
Option option0 = OptionBuilder.create("arg");
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test05() throws Throwable {
OptionBuilder.hasOptionalArgs(0);
Option option0 = OptionBuilder.create("arg");
assertTrue(option0.hasOptionalArg());
assertEquals(0, option0.getArgs());
}
@Test(timeout = 4000)
public void test06() throws Throwable {
OptionBuilder.hasArg();
Option option0 = OptionBuilder.create("arg");
assertEquals(1, option0.getArgs());
}
@Test(timeout = 4000)
public void test07() throws Throwable {
OptionBuilder.withLongOpt("");
Option option0 = OptionBuilder.create('8');
assertEquals((-1), option0.getArgs());
assertEquals("8", option0.getOpt());
}
@Test(timeout = 4000)
public void test08() throws Throwable {
OptionBuilder.withArgName("");
Option option0 = OptionBuilder.create('V');
assertEquals((-1), option0.getArgs());
assertEquals(86, option0.getId());
}
@Test(timeout = 4000)
public void test09() throws Throwable {
Option option0 = OptionBuilder.create('\u0000');
assertEquals((-1), option0.getArgs());
assertEquals("\u0000", option0.getOpt());
}
@Test(timeout = 4000)
public void test10() throws Throwable {
OptionBuilder.hasOptionalArgs(0);
Option option0 = OptionBuilder.create('K');
assertEquals(0, option0.getArgs());
assertTrue(option0.hasOptionalArg());
assertEquals("K", option0.getOpt());
}
@Test(timeout = 4000)
public void test11() throws Throwable {
OptionBuilder.withLongOpt("org.apache.commons.cli.OptionBuilder");
OptionBuilder.isRequired(true);
Option option0 = OptionBuilder.create();
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test12() throws Throwable {
OptionBuilder.withLongOpt("org.apache.commons.cli.OptionBuilder");
OptionBuilder.withValueSeparator('K');
Option option0 = OptionBuilder.create();
assertEquals('K', option0.getValueSeparator());
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test13() throws Throwable {
OptionBuilder.withLongOpt("org.apache.commons.cli.OptionBuilder");
OptionBuilder.hasOptionalArgs();
Option option0 = OptionBuilder.create();
assertTrue(option0.hasOptionalArg());
assertEquals((-2), option0.getArgs());
}
@Test(timeout = 4000)
public void test14() throws Throwable {
OptionBuilder.withArgName("");
OptionBuilder.withLongOpt("");
Option option0 = OptionBuilder.create();
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test15() throws Throwable {
OptionBuilder.withLongOpt("");
OptionBuilder.hasArgs(0);
Option option0 = OptionBuilder.create();
assertEquals(0, option0.getArgs());
}
@Test(timeout = 4000)
public void test16() throws Throwable {
try {
OptionBuilder.create("org.apache.commons.cli.OptionBuilder");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The option 'org.apache.commons.cli.OptionBuilder' contains an illegal character : '.'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
try {
OptionBuilder.create('#');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal option name '#'
//
verifyException("org.apache.commons.cli.OptionValidator", e);
}
}
@Test(timeout = 4000)
public void test18() throws Throwable {
try {
OptionBuilder.create();
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// must specify longopt
//
verifyException("org.apache.commons.cli.OptionBuilder", e);
}
}
@Test(timeout = 4000)
public void test19() throws Throwable {
OptionBuilder optionBuilder0 = OptionBuilder.hasArg(true);
assertNotNull(optionBuilder0);
}
@Test(timeout = 4000)
public void test20() throws Throwable {
OptionBuilder optionBuilder0 = OptionBuilder.hasArg(false);
assertNotNull(optionBuilder0);
}
@Test(timeout = 4000)
public void test21() throws Throwable {
OptionBuilder optionBuilder0 = OptionBuilder.withDescription((String) null);
assertNotNull(optionBuilder0);
}
@Test(timeout = 4000)
public void test22() throws Throwable {
OptionBuilder.hasOptionalArgs();
Option option0 = OptionBuilder.create('V');
assertTrue(option0.hasOptionalArg());
assertEquals("V", option0.getOpt());
assertEquals((-2), option0.getArgs());
}
@Test(timeout = 4000)
public void test23() throws Throwable {
OptionBuilder optionBuilder0 = OptionBuilder.hasArgs();
assertNotNull(optionBuilder0);
}
@Test(timeout = 4000)
public void test24() throws Throwable {
OptionBuilder optionBuilder0 = OptionBuilder.hasOptionalArg();
assertNotNull(optionBuilder0);
}
@Test(timeout = 4000)
public void test25() throws Throwable {
OptionBuilder.withValueSeparator();
Option option0 = OptionBuilder.create('K');
assertEquals((-1), option0.getArgs());
assertEquals(75, option0.getId());
assertEquals('=', option0.getValueSeparator());
}
@Test(timeout = 4000)
public void test26() throws Throwable {
OptionBuilder.withLongOpt("");
OptionBuilder.hasOptionalArg();
Option option0 = OptionBuilder.create();
assertTrue(option0.hasOptionalArg());
assertEquals(1, option0.getArgs());
}
@Test(timeout = 4000)
public void test27() throws Throwable {
OptionBuilder.hasArg();
Option option0 = OptionBuilder.create('a');
assertEquals(1, option0.getArgs());
assertEquals("a", option0.getOpt());
}
@Test(timeout = 4000)
public void test28() throws Throwable {
OptionBuilder.isRequired();
Option option0 = OptionBuilder.create('8');
assertTrue(option0.isRequired());
assertEquals(56, option0.getId());
assertEquals((-1), option0.getArgs());
}
@Test(timeout = 4000)
public void test29() throws Throwable {
Object object0 = new Object();
OptionBuilder optionBuilder0 = OptionBuilder.withType(object0);
assertNotNull(optionBuilder0);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
cb7104a5db6818ff22396553e50fc91ac4aa0f00 | 9e19fcdc40a1c4b501a7a8034eaa41a7051ab323 | /src/algorithmsStudy2/BeautifulDaysAtTheMovies.java | 4fcebd73078682964401a71fe86482885864c6a7 | [] | no_license | BinSin/algorithmsStudy | 90947a4ddbbd47f02d0696efe2f858afcc39e45b | e0c487e1c8cfd6c225b9e5ab8d8912c93616cf42 | refs/heads/master | 2021-03-27T18:56:33.261343 | 2019-06-03T12:15:40 | 2019-06-03T12:15:40 | 103,233,807 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,650 | java | /*
* A : BinSin
* https://www.hackerrank.com/challenges/beautiful-days-at-the-movies
*/
package algorithmsStudy2;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class BeautifulDaysAtTheMovies {
/*
public static int getLength(int num) {
int count = 1;
while((num/=10)>0) {
count++;
}
return count;
}
public static int reverseString(int num) {
int length = getLength(num);
int reverseNum = 0;
int n = num;
int l = length;
for(int i=0; i<length; i++) {
reverseNum += (n % 10) * Math.pow(10, --l);
n /= 10;
}
return reverseNum;
}
public static int countBeautifulNum(int start, int end, int div) {
int count = 0;
for(int i=start; i<=end; i++) {
int reverseNum = reverseString(i);
if((i-reverseNum)%div == 0) {
count++;
}
}
return count;
}
*/
public static int countBeautifulNum(String start, String end, int div) {
int startNum = Integer.parseInt(start);
int endNum = Integer.parseInt(end);
int count = 0;
for(int i=startNum; i<=endNum; i++) {
StringBuilder temp = new StringBuilder();
temp.append(i);
temp = temp.reverse();
int reverseI = Integer.parseInt(temp.toString());
if((i-reverseI)%div == 0) {
count++;
}
}
return count;
}
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
String[] s = str.split("\\s+");
String start = s[0];
String end = s[1];
int div = Integer.parseInt(s[2]);
System.out.println(countBeautifulNum(start, end, div));
}
}
| [
"binyong318@gmail.com"
] | binyong318@gmail.com |
6f7d458e543813ed0738c83aca98d977d5e7efc9 | a88404e860f9e81f175d80c51b8e735fa499c93c | /hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/metamodel/JsonParser.java | 95c585530475583e31f23890d345d4d06a062a01 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | sabri0/hapi-fhir | 4a53409d31b7f40afe088aa0ee8b946860b8372d | c7798fee4880ee8ffc9ed2e42c29c3b8f6753a1c | refs/heads/master | 2020-06-07T20:02:33.258075 | 2019-06-18T09:40:00 | 2019-06-18T09:40:00 | 193,081,738 | 2 | 0 | Apache-2.0 | 2019-06-21T10:46:17 | 2019-06-21T10:46:17 | null | UTF-8 | Java | false | false | 16,071 | java | package org.hl7.fhir.dstu2016may.metamodel;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle;
import org.hl7.fhir.dstu2016may.formats.JsonCreator;
import org.hl7.fhir.dstu2016may.formats.JsonCreatorCanonical;
import org.hl7.fhir.dstu2016may.formats.JsonCreatorGson;
import org.hl7.fhir.dstu2016may.metamodel.Element.SpecialElement;
import org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.dstu2016may.model.StructureDefinition;
import org.hl7.fhir.dstu2016may.utils.IWorkerContext;
import org.hl7.fhir.dstu2016may.utils.JsonTrackingParser;
import org.hl7.fhir.dstu2016may.utils.JsonTrackingParser.LocationData;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
import org.hl7.fhir.utilities.xhtml.XhtmlParser;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
public class JsonParser extends ParserBase {
private JsonCreator json;
private Map<JsonElement, LocationData> map;
public JsonParser(IWorkerContext context) {
super(context);
}
@Override
public Element parse(InputStream stream) throws Exception {
// if we're parsing at this point, then we're going to use the custom parser
map = new HashMap<JsonElement, LocationData>();
String source = TextFile.streamToString(stream);
if (policy == ValidationPolicy.EVERYTHING) {
JsonObject obj = null;
try {
obj = JsonTrackingParser.parse(source, map);
} catch (Exception e) {
logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing JSON: "+e.getMessage(), IssueSeverity.FATAL);
return null;
}
assert (map.containsKey(obj));
return parse(obj);
} else {
JsonObject obj = (JsonObject) new com.google.gson.JsonParser().parse(source);
assert (map.containsKey(obj));
return parse(obj);
}
}
public Element parse(JsonObject object, Map<JsonElement, LocationData> map) throws Exception {
this.map = map;
return parse(object);
}
public Element parse(JsonObject object) throws Exception {
JsonElement rt = object.get("resourceType");
if (rt == null) {
logError(line(object), col(object), "$", IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL);
return null;
} else {
String name = rt.getAsString();
String path = "/"+name;
StructureDefinition sd = getDefinition(line(object), col(object), name);
if (sd == null)
return null;
Element result = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd));
checkObject(object, path);
result.markLocation(line(object), col(object));
result.setType(name);
parseChildren(path, object, result, true);
result.numberChildren();
return result;
}
}
private void checkObject(JsonObject object, String path) throws FHIRFormatError {
if (policy == ValidationPolicy.EVERYTHING) {
boolean found = false;
for (Entry<String, JsonElement> e : object.entrySet()) {
// if (!e.getKey().equals("fhir_comments")) {
found = true;
break;
// }
}
if (!found)
logError(line(object), col(object), path, IssueType.INVALID, "Object must have some content", IssueSeverity.ERROR);
}
}
private void parseChildren(String path, JsonObject object, Element context, boolean hasResourceType) throws DefinitionException, FHIRFormatError {
reapComments(object, context);
List<Property> properties = getChildProperties(context.getProperty(), context.getName(), null);
Set<String> processed = new HashSet<String>();
if (hasResourceType)
processed.add("resourceType");
processed.add("fhir_comments");
// note that we do not trouble ourselves to maintain the wire format order here - we don't even know what it was anyway
// first pass: process the properties
for (Property property : properties) {
if (property.isChoice()) {
for (TypeRefComponent type : property.getDefinition().getType()) {
String eName = property.getName().substring(0, property.getName().length()-3) + Utilities.capitalize(type.getCode());
if (!ParserBase.isPrimitive(type.getCode()) && object.has(eName)) {
parseChildComplex(path, object, context, processed, property, eName);
break;
} else if (ParserBase.isPrimitive(type.getCode()) && (object.has(eName) || object.has("_"+eName))) {
parseChildPrimitive(object, context, processed, property, path, eName);
break;
}
}
} else if (property.isPrimitive(null)) {
parseChildPrimitive(object, context, processed, property, path, property.getName());
} else if (object.has(property.getName())) {
parseChildComplex(path, object, context, processed, property, property.getName());
}
}
// second pass: check for things not processed
if (policy != ValidationPolicy.NONE) {
for (Entry<String, JsonElement> e : object.entrySet()) {
if (!processed.contains(e.getKey())) {
logError(line(e.getValue()), col(e.getValue()), path, IssueType.STRUCTURE, "Unrecognised property '@"+e.getKey()+"'", IssueSeverity.ERROR);
}
}
}
}
private void parseChildComplex(String path, JsonObject object, Element context, Set<String> processed, Property property, String name) throws FHIRFormatError, DefinitionException {
processed.add(name);
String npath = path+"/"+property.getName();
JsonElement e = object.get(name);
if (property.isList() && (e instanceof JsonArray)) {
JsonArray arr = (JsonArray) e;
for (JsonElement am : arr) {
parseChildComplexInstance(npath, object, context, property, name, am);
}
} else {
parseChildComplexInstance(npath, object, context, property, name, e);
}
}
private void parseChildComplexInstance(String npath, JsonObject object, Element context, Property property, String name, JsonElement e) throws FHIRFormatError, DefinitionException {
if (e instanceof JsonObject) {
JsonObject child = (JsonObject) e;
Element n = new Element(name, property).markLocation(line(child), col(child));
checkObject(child, npath);
context.getChildren().add(n);
if (property.isResource())
parseResource(npath, child, n);
else
parseChildren(npath, child, n, false);
} else
logError(line(e), col(e), npath, IssueType.INVALID, "This property must be "+(property.isList() ? "an Array" : "an Object")+", not a "+e.getClass().getName(), IssueSeverity.ERROR);
}
private void parseChildPrimitive(JsonObject object, Element context, Set<String> processed, Property property, String path, String name) throws FHIRFormatError, DefinitionException {
String npath = path+"/"+property.getName();
processed.add(name);
processed.add("_"+name);
JsonElement main = object.has(name) ? object.get(name) : null;
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
if (main != null || fork != null) {
if (property.isList() && ((main == null) || (main instanceof JsonArray)) &&((fork == null) || (fork instanceof JsonArray)) ) {
JsonArray arr1 = (JsonArray) main;
JsonArray arr2 = (JsonArray) fork;
for (int i = 0; i < Math.max(arrC(arr1), arrC(arr2)); i++) {
JsonElement m = arrI(arr1, i);
JsonElement f = arrI(arr2, i);
parseChildPrimitiveInstance(context, property, name, npath, m, f);
}
} else
parseChildPrimitiveInstance(context, property, name, npath, main, fork);
}
}
private JsonElement arrI(JsonArray arr, int i) {
return arr == null || i >= arr.size() || arr.get(i) instanceof JsonNull ? null : arr.get(i);
}
private int arrC(JsonArray arr) {
return arr == null ? 0 : arr.size();
}
private void parseChildPrimitiveInstance(Element context, Property property, String name, String npath,
JsonElement main, JsonElement fork) throws FHIRFormatError, DefinitionException {
if (main != null && !(main instanceof JsonPrimitive))
logError(line(main), col(main), npath, IssueType.INVALID, "This property must be an simple value, not a "+main.getClass().getName(), IssueSeverity.ERROR);
else if (fork != null && !(fork instanceof JsonObject))
logError(line(fork), col(fork), npath, IssueType.INVALID, "This property must be an object, not a "+fork.getClass().getName(), IssueSeverity.ERROR);
else {
Element n = new Element(name, property).markLocation(line(main != null ? main : fork), col(main != null ? main : fork));
context.getChildren().add(n);
if (main != null) {
JsonPrimitive p = (JsonPrimitive) main;
n.setValue(p.getAsString());
if (!n.getProperty().isChoice() && n.getType().equals("xhtml")) {
try {
n.setXhtml(new XhtmlParser().setValidatorMode(policy == ValidationPolicy.EVERYTHING).parse(n.getValue(), null).getDocumentElement());
} catch (Exception e) {
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing XHTML: "+e.getMessage(), IssueSeverity.ERROR);
}
}
if (policy == ValidationPolicy.EVERYTHING) {
// now we cross-check the primitive format against the stated type
if (Utilities.existsInList(n.getType(), "boolean")) {
if (!p.isBoolean())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a boolean", IssueSeverity.ERROR);
} else if (Utilities.existsInList(n.getType(), "integer", "unsignedInt", "positiveInt", "decimal")) {
if (!p.isNumber())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a number", IssueSeverity.ERROR);
} else if (!p.isString())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a string", IssueSeverity.ERROR);
}
}
if (fork != null) {
JsonObject child = (JsonObject) fork;
checkObject(child, npath);
parseChildren(npath, child, n, false);
}
}
}
private void parseResource(String npath, JsonObject res, Element parent) throws DefinitionException, FHIRFormatError {
JsonElement rt = res.get("resourceType");
if (rt == null) {
logError(line(res), col(res), npath, IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL);
} else {
String name = rt.getAsString();
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+name);
if (sd == null)
throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+name+"')");
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), parent.getProperty().getName().equals("contained") ? SpecialElement.CONTAINED : SpecialElement.BUNDLE_ENTRY);
parent.setType(name);
parseChildren(npath, res, parent, true);
}
}
private void reapComments(JsonObject object, Element context) {
if (object.has("fhir_comments")) {
JsonArray arr = object.getAsJsonArray("fhir_comments");
for (JsonElement e : arr) {
context.getComments().add(e.getAsString());
}
}
}
private int line(JsonElement e) {
if (map == null|| !map.containsKey(e))
return -1;
else
return map.get(e).getLine();
}
private int col(JsonElement e) {
if (map == null|| !map.containsKey(e))
return -1;
else
return map.get(e).getCol();
}
protected void prop(String name, String value) throws IOException {
if (name != null)
json.name(name);
json.value(value);
}
protected void open(String name) throws IOException {
if (name != null)
json.name(name);
json.beginObject();
}
protected void close() throws IOException {
json.endObject();
}
protected void openArray(String name) throws IOException {
if (name != null)
json.name(name);
json.beginArray();
}
protected void closeArray() throws IOException {
json.endArray();
}
@Override
public void compose(Element e, OutputStream stream, OutputStyle style, String identity) throws Exception {
OutputStreamWriter osw = new OutputStreamWriter(stream, "UTF-8");
if (style == OutputStyle.CANONICAL)
json = new JsonCreatorCanonical(osw);
else
json = new JsonCreatorGson(osw);
json.setIndent(style == OutputStyle.PRETTY ? " " : "");
json.beginObject();
prop("resourceType", e.getType());
Set<String> done = new HashSet<String>();
for (Element child : e.getChildren()) {
compose(e.getName(), e, done, child);
}
json.endObject();
json.finish();
osw.flush();
}
private void compose(String path, Element e, Set<String> done, Element child) throws IOException {
if (child.getSpecial() == SpecialElement.BUNDLE_ENTRY || !child.getProperty().isList()) {// for specials, ignore the cardinality of the stated type
compose(path, child);
} else if (!done.contains(child.getName())) {
done.add(child.getName());
List<Element> list = e.getChildrenByName(child.getName());
composeList(path, list);
}
}
private void composeList(String path, List<Element> list) throws IOException {
// there will be at least one element
String name = list.get(0).getName();
boolean complex = true;
if (list.get(0).isPrimitive()) {
boolean prim = false;
complex = false;
for (Element item : list) {
if (item.hasValue())
prim = true;
if (item.hasChildren())
complex = true;
}
if (prim) {
openArray(name);
for (Element item : list) {
if (item.hasValue())
primitiveValue(null, item);
else
json.nullValue();
}
closeArray();
}
name = "_"+name;
}
if (complex) {
openArray(name);
for (Element item : list) {
if (item.hasChildren()) {
open(null);
if (item.getProperty().isResource()) {
prop("resourceType", item.getType());
}
Set<String> done = new HashSet<String>();
for (Element child : item.getChildren()) {
compose(path+"."+name+"[]", item, done, child);
}
close();
} else
json.nullValue();
}
closeArray();
}
}
private void primitiveValue(String name, Element item) throws IOException {
if (name != null)
json.name(name);
String type = item.getType();
if (Utilities.existsInList(type, "boolean"))
json.value(item.getValue().trim().equals("true") ? new Boolean(true) : new Boolean(false));
else if (Utilities.existsInList(type, "integer", "unsignedInt", "positiveInt"))
json.value(new Integer(item.getValue()));
else if (Utilities.existsInList(type, "decimal"))
json.value(new BigDecimal(item.getValue()));
else
json.value(item.getValue());
}
private void compose(String path, Element element) throws IOException {
String name = element.getName();
if (element.isPrimitive() || ParserBase.isPrimitive(element.getType())) {
if (element.hasValue())
primitiveValue(name, element);
name = "_"+name;
}
if (element.hasChildren()) {
open(name);
if (element.getProperty().isResource()) {
prop("resourceType", element.getType());
}
Set<String> done = new HashSet<String>();
for (Element child : element.getChildren()) {
compose(path+"."+element.getName(), element, done, child);
}
close();
}
}
}
| [
"jamesagnew@gmail.com"
] | jamesagnew@gmail.com |
7b1a027ebb60dc8f2d91eb3ca5878a7c8727794f | c4a41e51562998a624e5858235d18ab942593141 | /Project BigPharma/src/bigpharma/composite/Lista.java | 6dac552a540b5244539ba498a7e5d25e3bc9a1f4 | [] | no_license | joyceambrosio/BigPharma | 89e0b090bcf300c2f5ee69d3e91390de1853383c | 6998e78f759eeeb0541349b061d57bbe253b169b | refs/heads/master | 2021-01-10T09:21:58.390379 | 2015-11-28T23:40:56 | 2015-11-28T23:40:56 | 43,008,175 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,642 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bigpharma.composite;
import bigpharma.model.AbsModel;
import java.util.ArrayList;
/**
*
* @author Joyce
*/
public class Lista extends AbsModel {
public ArrayList<AbsModel> lista = null;
public Lista() {
if (this.lista == null) {
lista = new ArrayList();
}
}
public void add(AbsModel obl) throws Exception {
if (this.lista == null) {
this.lista = new ArrayList<>();
}
obl.setId(nextId());
this.lista.add(obl);
}
private int nextId() {
int ID = 0;
// if (lista != null) {
// AbsModel item = lista.get((lista.size()+1));
// ID = item.getId() + 1;
// } else {
// ID = 1;
// }
if (lista != null) {
for (AbsModel item : lista) {
if (item.getId() > ID) {
ID = (item.getId()+1);
}
}
}
return ID;
}
public void remove(AbsModel obl) throws Exception {
this.lista.remove(obl);
}
public AbsModel get(int index) {
return lista.get(index);
}
public int size() {
return lista.size();
}
public boolean isEmpty() {
return lista.isEmpty();
}
public ArrayList<AbsModel> getAll() {
return this.lista;
}
}
| [
"adelinesharla@gmail.com"
] | adelinesharla@gmail.com |
d7116d67cf18155a70e7c7f0d110e9b1c5ba2bb9 | ccfcf55742cb36660d10f5954eb568cf016b8c95 | /src/main/java/com/jiangbo/ssm/controller/UserController.java | 362a751f0ffb108133689da5f9f31afc5e27debe | [] | no_license | jiang890910bo/ssm | a33f1e3c24f22cb6bc0bfbcfaa5f812c706c3385 | 15d76c714a0f43a5dd2e7e19b7553191213fa03c | refs/heads/master | 2021-03-30T20:22:38.710991 | 2019-01-16T09:11:07 | 2019-01-16T09:11:07 | 60,249,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 569 | java | package com.jiangbo.ssm.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jiangbo.ssm.service.UserService;
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("/showUser")
public String getAllUser(Model model){
model.addAttribute("user", userService.getUserById(1));
return "showUser";
}
}
| [
"chengjiangbo@j1.com"
] | chengjiangbo@j1.com |
523a2fd047d51ca50e15b4b6e5528e6b48bbd59b | d7405d3bddf0d199b0b697957b053537eb9bea26 | /JspProject2/src/main/java/com/java/review/service/Service.java | 8bcb13dafd95240dcaebeb0f750bd2b9aef3bfa6 | [] | no_license | minseunghwang/KITRI_Spring | b141aced4ef935cc7c27542e26c25344412aea67 | ce4622cb69ee5b4b4305908d9b6809f301944a99 | refs/heads/master | 2022-12-30T12:28:27.443523 | 2020-10-15T08:12:39 | 2020-10-15T08:12:39 | 296,552,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package com.java.review.service;
import java.util.ArrayList;
import java.util.List;
import com.java.review.dto.ReviewDto;
public interface Service {
void add(ReviewDto notice);
ReviewDto getReview(int num);
List<ReviewDto> getReviewByProductNum(int p_num);
ArrayList<ReviewDto> getReviewInProductByPageNum(int p_num, int page);
void editReview(ReviewDto notice);
void delReview(int num);
ArrayList<ReviewDto> getReviewAll();
int makeNum();
int getSelectedP_num(int r_num);
ArrayList<ReviewDto> getMyReviewAll(String m_id, int page);
int getcountMine(String m_id);
int getcountByP_Num(int p_num);
}
| [
"mins941011@gmail.com"
] | mins941011@gmail.com |
1c7996c14c3cde0118f6a590e6b405f7a955c162 | 410df2b595462cec0dc095dcb2262c49ef6ddc3e | /app/src/main/java/org/chromium/blink/mojom/ObservedFeature.java | 68bf49a23e9b5e8846fcdbf9896fa4fbb2ff1af4 | [] | no_license | ipxbro/JokerChromium | e32d6e15b61aeb986687befe5d2ea6a50391391f | 89931e2e5e356f58c33a3e160c53d347e3779fc4 | refs/heads/master | 2023-04-24T12:58:28.647237 | 2021-04-30T05:47:31 | 2021-04-30T05:47:31 | 567,083,021 | 0 | 0 | null | 2022-11-17T02:58:50 | 2022-11-17T02:58:47 | null | UTF-8 | Java | false | false | 762 | java | // ObservedFeature.java is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is autogenerated by:
// mojo/public/tools/bindings/mojom_bindings_generator.py
// For:
// third_party/blink/public/mojom/feature_observer/feature_observer.mojom
//
package org.chromium.blink.mojom;
public interface ObservedFeature extends org.chromium.mojo.bindings.Interface {
public interface Proxy extends ObservedFeature, org.chromium.mojo.bindings.Interface.Proxy {
}
Manager<ObservedFeature, ObservedFeature.Proxy> MANAGER = ObservedFeature_Internal.MANAGER;
}
| [
"joker@cerbook.com"
] | joker@cerbook.com |
a44cbe0eb9599c5027f72b5afb1ac7926429d960 | 273fac9883a64e1891575fdca8c9e5639348174f | /Final Project Bike rental Application/WebStore/WEB-INF/classes/Smartwatch.java | 933f8631e73b4a6becd2a79635b3e6fd34645708 | [] | no_license | Naythan893/CSP584-Enterprise-web-application | 6337e9e799e8909d66f81dd96556d84180506e4e | f13a767d7d78c321550f4659b1af5b47336a2707 | refs/heads/master | 2020-04-04T15:18:49.459685 | 2018-12-07T21:37:49 | 2018-12-07T21:37:49 | 156,032,872 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,852 | java | import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Smartwatch")
/*
Game class contains class variables name,price,image,retailer,condition,discount.
Game class has a constructor with Arguments name,price,image,retailer,condition,discount.
Game class contains getters and setters for name,price,image,retailer,condition,discount.
*/
public class Smartwatch extends HttpServlet{
private String id;
private String name;
private double price;
private String image;
//private String retailer;
private String condition;
private double discount;
public Smartwatch(String name, double price, String image, String condition,double discount){
// this.id=id;
this.name=name;
this.price=price;
this.image=image;
this.condition=condition;
this.discount = discount;
// this.retailer = retailer;
}
public Smartwatch(){
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
// public String getRetailer() {
// return retailer;
// }
// public void setRetailer(String retailer) {
// this.retailer = retailer;
// }
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
}
| [
"naythan893@gmail.com"
] | naythan893@gmail.com |
9034e0af59f13d23edf272dafe111f0428d1cf8c | 84a8dc0bf03eeb99ae21a5e2be41377e9ee03747 | /.idea/파일/src/파일/day10/Day10_ex26_1_check.java | 95a3976bab290b0d493bac744eceb343a68ae61f | [] | no_license | DoYoonJung/Java_Cram_School_Studying | 1658b5d7cd46add59d81747e45c3eb7b0f032b86 | b01f378af05a17b3f2fae5538b2ac1acaf497b62 | refs/heads/master | 2023-08-15T22:02:29.945572 | 2021-10-21T12:00:49 | 2021-10-21T12:00:49 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,014 | java | package 파일.day10;
//경마게임
import java.util.Random;
import java.util.Scanner;
public class Day10_ex26_1_check {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int horse[][] = new int[5][20];
Random ran = new Random();
int max = 20;
int rank[] = new int[5];
int total[] = new int[5];
int count = 1;
for (int i = 0; i < 20; i++) {
int check = 0;
for (int j = 0; j < 5; j++) {
int r = ran.nextInt(4) + 1;
horse[j][i] = r;
total[j] = total[j] + horse[j][i];
if (total[j] >= 19) {
check++;
if (check >= 2) {
j--;
total[j] = total[j] - horse[j][i];
} else {
rank[j] = count;
count++;
}
}
}
}
for (int i = 0; i < 5; i++) {
// System.out.println(total[i]);
System.out.println(rank[i]);
}
for (int i = 0; i < 5; i++) {
for (int n = 0; n < 20; n++) {
System.out.print(horse[i][n]);
}
System.out.println();
}
}
}
| [
"jungdo8016@gmail.com"
] | jungdo8016@gmail.com |
d860e96777a4629a2f55ed8da0c5438694a24893 | f61a16bd96566073b446a254fff8ad3ec1201f5a | /advertising/src/main/java/org/im97mori/ble/advertising/ShortenedLocalNameAndroid.java | 8cf72144ad3368665ff959c1bf11fb7db5a706cb | [
"MIT"
] | permissive | im97mori-github/AndroidBLEUtil | d7f768480c655120261c546a0d6cff40eca03b0a | 9ceb62ada303f046e4f5721f525208b5a18ee421 | refs/heads/master | 2023-08-18T21:27:06.479576 | 2023-08-03T07:53:41 | 2023-08-03T07:53:41 | 195,750,369 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,833 | java | package org.im97mori.ble.advertising;
import android.bluetooth.le.ScanRecord;
import android.os.Parcel;
import androidx.annotation.NonNull;
import org.im97mori.ble.ByteArrayCreator;
import java.util.Objects;
/**
* <p>
* Shortened Local Name
* <p>
* <a href="https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/">generic-access-profile</a>
* </p>
*/
public class ShortenedLocalNameAndroid extends ShortenedLocalName implements AdvertisingDataInterfaceAndroid {
/**
* @see ByteArrayCreator
*/
public static final ByteArrayCreator<ShortenedLocalNameAndroid> CREATOR = new ByteArrayCreator<ShortenedLocalNameAndroid>() {
/**
* {@inheritDoc}
*/
@Override
@NonNull
public ShortenedLocalNameAndroid createFromParcel(@NonNull Parcel in) {
return new ShortenedLocalNameAndroid(in);
}
/**
* {@inheritDoc}
*/
@Override
@NonNull
public ShortenedLocalNameAndroid[] newArray(int size) {
return new ShortenedLocalNameAndroid[size];
}
/**
* {@inheritDoc}
*/
@NonNull
@Override
public ShortenedLocalNameAndroid createFromByteArray(@NonNull byte[] values) {
return new ShortenedLocalNameAndroid(values, 0, values.length - 1);
}
};
/**
* @param data byte array from {@link ScanRecord#getBytes()}
* @param offset data offset
* @see #ShortenedLocalNameAndroid(byte[], int, int)
*/
public ShortenedLocalNameAndroid(@NonNull byte[] data, int offset) {
this(data, offset, data[offset]);
}
/**
* Constructor for Shortened Local Name
*
* @param data byte array from {@link ScanRecord#getBytes()}
* @param offset data offset
* @param length 1st octet of Advertising Data
*/
public ShortenedLocalNameAndroid(@NonNull byte[] data
, int offset
, int length) {
super(data, offset, length);
}
/**
* Constructor from parameters
*
* @param shortenedLocalName Shortened Local Name
*/
public ShortenedLocalNameAndroid(@NonNull String shortenedLocalName) {
super(shortenedLocalName);
}
/**
* Constructor from {@link Parcel}
*
* @param in Parcel
*/
private ShortenedLocalNameAndroid(@NonNull Parcel in) {
super(Objects.requireNonNull(in.createByteArray()), 0, in.readInt());
}
/**
* {@inheritDoc}
*/
@Override
public int describeContents() {
return 0;
}
/**
* {@inheritDoc}
*/
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeByteArray(getBytes());
dest.writeInt(getLength());
}
}
| [
"github@im97mori.org"
] | github@im97mori.org |
200b143ca9c62cf5a523d2c3cd094cacb1b314c0 | 8944f48f01a959c2d8f35c9c7123efdec98ba984 | /gank/src/main/java/ws/dyt/gank/net/BaseRestApi.java | 24652548b39000816d08feae064f43338a0e47ef | [] | no_license | yangxiaoweihn/Gank | 35e9c7572f3f39ceee169c71d8a0360197ad771c | 2c93798b9e01c0ce770a801cf4b6e2f6d05fe326 | refs/heads/master | 2020-04-17T14:19:53.772875 | 2017-01-18T10:04:39 | 2017-01-18T10:04:39 | 67,333,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,307 | java | package ws.dyt.gank.net;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Response;
import java.io.IOException;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
/**
* Created by yangxiaowei on 16/9/2.
*/
public class BaseRestApi {
protected Retrofit mRetrofit;
protected IRestApi mRestApi;
public BaseRestApi() {
mRetrofit = new Retrofit.Builder()
.baseUrl(NetConfig.ApiGank)
.addConverterFactory(GsonConverterFactory.create())
.client(getOkHttpClient())
.build();
mRestApi = mRetrofit.create(IRestApi.class);
}
public OkHttpClient getOkHttpClient() {
OkHttpClient client = new OkHttpClient();
client.interceptors().add(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
String url = chain.request().url().toString();
//以下的header信息是让github授权时返回json数据
Response response = chain.proceed(chain.request().newBuilder().addHeader("Accept", "application/json").url(url).build());
return response;
}
});
return client;
}
}
| [
"hn_yangxiaowei@163.com"
] | hn_yangxiaowei@163.com |
155bfbde4b70e5f985ed636b29f8085a1c9d1499 | 8d61102db096b198e0751d2785773f57da120254 | /src/main/java/by/kohanova/controller/FriendsController.java | c66145dda431768e75a16009a0bb65409f235336 | [] | no_license | Aliot26/SocialNetwork | b8237cec5061b4bedd5045b66793f21ddbe58e30 | ae7b09ed2d4035b2aaaf08f128556ac6a7fcec6c | refs/heads/master | 2021-01-23T03:34:47.097131 | 2017-05-01T06:48:23 | 2017-05-01T06:48:23 | 86,099,688 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,958 | java | package by.kohanova.controller;
import by.kohanova.model.Friends;
import by.kohanova.model.FriendsIds;
import by.kohanova.model.User;
import by.kohanova.service.FriendsService;
import by.kohanova.service.UserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
/**
* Controller for the {@link FriendsService}
*/
@RestController
@RequestMapping("/friends")
public class FriendsController {
private final FriendsService friendsService;
private final UserService userService;
final static Logger LOGGER = Logger.getLogger(FriendsController.class);
@Autowired
public FriendsController(FriendsService friendsService, UserService userService) {
this.friendsService = friendsService;
this.userService = userService;
}
/**
* Create {@link Friends} in database
* @return http response with http status code
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
public ResponseEntity<?> createFriends(@RequestBody FriendsIds friendsIds) {
try {
LOGGER.info("Start createFriends method");
Integer currentId = friendsIds.current_id;
Integer friendId = friendsIds.friend_id;
User currentUser = userService.findById(currentId);
User friendUser = userService.findById(friendId);
Friends friends = new Friends();
friends.userAlfa = currentUser;
friends.userBeta = friendUser;
friends.status = false;
friendsService.create(friends);
return new ResponseEntity<>(new Friends(), HttpStatus.CREATED);
} catch (Exception e) {
LOGGER.info("CreateFriends method failed " + HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
/**
* Load requested friends by current user id
* @return http response with http status code
*/
@RequestMapping(value = "/requested/{id}", method = RequestMethod.GET)
public ResponseEntity<?> loadRequestedFriendsById(@PathVariable("id") Integer id) {
try {
LOGGER.info("Start loadRequestedFriendsById method");
List<Friends> requestedFriends = friendsService.findByFriendId(id);
for (Iterator<Friends> iter = requestedFriends.listIterator(); iter.hasNext(); ) {
Friends friends = iter.next();
if (friends.status) {
iter.remove();
}
}
return new ResponseEntity<>(requestedFriends, HttpStatus.OK);
} catch (NullPointerException e) {
LOGGER.error("LoadRequestedFriendsById method failed " + HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
/**
* Confirmation adding user to friends list
* @return http response with http status code
*/
@RequestMapping(value = "/confirm", method = RequestMethod.PUT)
public ResponseEntity<?> updateFriends(@RequestBody FriendsIds friendsIds) {
try {
LOGGER.info("Start updateFriends method");
Integer id1 = friendsIds.current_id;
Integer id2 = friendsIds.friend_id;
Friends friends = friendsService.findFriendByFriendId(id1, id2);
friends.status = true;
return new ResponseEntity<>(friendsService.update(friends), HttpStatus.OK);
} catch (Exception e) {
LOGGER.error("UpdateFriends method failed " + HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
/**
* Return list of all friends from database
*/
@RequestMapping("/all")
public List<Friends> loadAllFriends() {
try {
LOGGER.info("Start loadAllFriends method");
return friendsService.findAll();
} catch (NullPointerException e) {
LOGGER.error("LoadAllFriends method failed " + HttpStatus.BAD_REQUEST);
return null;
}
}
/**
* Find list of confirmed {@link Friends} by current user id
*/
@RequestMapping(value = "/all/{id}", method = RequestMethod.GET)
public ResponseEntity<?> loadFriendsById(@PathVariable("id") Integer id) {
try {
LOGGER.info("Start loadFriendsById method");
List<Friends> confirmedFriends = friendsService.findById(id);
for (Iterator<Friends> iter = confirmedFriends.listIterator(); iter.hasNext(); ) {
Friends friends = iter.next();
if (!friends.status) {
iter.remove();
}
}
List<Friends> friendss = friendsService.findByFriendId(id);
for (Iterator<Friends> iter = friendss.listIterator(); iter.hasNext(); ) {
Friends friends = iter.next();
if (!friends.status) {
iter.remove();
}
}
for (Friends friends : friendss) {
confirmedFriends.add(friends);
}
User tempUser;
for (Friends friends : confirmedFriends) {
if (Objects.equals(friends.userBeta.id, id)) {
tempUser = friends.userAlfa;
friends.userAlfa = friends.userBeta;
friends.userBeta = tempUser;
}
}
return new ResponseEntity<>(confirmedFriends, HttpStatus.OK);
} catch (NullPointerException e) {
LOGGER.error("loadFriendsById method failed " + HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
}
| [
"aliot@tut.by"
] | aliot@tut.by |
ad6cbb53c4fdbd407d88b4703106a4ed98011f07 | e2656d8e4f63b433b3b83c013aac4e0dc7378038 | /src/main/java/com/umber/world/housing/config/ResponseBodyEmitterSuscriber.java | ae9eaf5b45017d2a855661f69814ba58469da77c | [] | no_license | sandeshdanwale/umber | 7dd34d617370e04debf862db731a555e395bd8df | 728843a727ae346740a0e76752a21fdace80b358 | refs/heads/master | 2020-07-29T12:18:21.703726 | 2017-11-14T03:32:42 | 2017-11-14T03:32:42 | 73,553,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,546 | java | package com.umber.world.housing.config;
import org.springframework.http.MediaType;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import java.io.IOException;
class ResponseBodyEmitterSubscriber<T> extends Subscriber<T> implements Runnable {
private final MediaType mediaType;
private final Subscription subscription;
private final ResponseBodyEmitter responseBodyEmitter;
private boolean completed;
public ResponseBodyEmitterSubscriber(MediaType mediaType, Observable<T> observable, ResponseBodyEmitter responseBodyEmitter) {
this.mediaType = mediaType;
this.responseBodyEmitter = responseBodyEmitter;
this.responseBodyEmitter.onTimeout(this);
this.responseBodyEmitter.onCompletion(this);
this.subscription = observable.subscribe(this);
}
@Override
public void onNext(T value) {
try {
if(!completed) {
responseBodyEmitter.send(value, mediaType);
}
} catch (IOException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
@Override
public void onError(Throwable e) {
responseBodyEmitter.completeWithError(e);
}
@Override
public void onCompleted() {
if(!completed) {
completed = true;
responseBodyEmitter.complete();
}
}
@Override
public void run() {
subscription.unsubscribe();
}
}
| [
"sandesh.danwale@yahoo.com"
] | sandesh.danwale@yahoo.com |
dfe58208978269bf286551144e1ad413fe4f013c | 4a9773992ba968d4ad7c2e0f2c1c960b0943ee6d | /src/main/java/coreservlets/EmbeddedDbCreator.java | d15397a8460102d88b7a9ecbb6f0644391def20a | [] | no_license | xsb1999/2021NeuWeb | 364ef5a9bbb528b9daa9d98eeb7ce3138ea0dcfc | cf86ada60c07ce564a2807820edcb049d52315c0 | refs/heads/main | 2023-06-08T13:06:18.890790 | 2021-06-25T22:45:04 | 2021-06-25T22:45:04 | 376,431,529 | 0 | 0 | null | 2021-06-25T22:45:05 | 2021-06-13T03:45:41 | HTML | UTF-8 | Java | false | false | 6,087 | java | package coreservlets;
import managedbeans.Projects;
import java.io.File;
import java.sql.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
// sir, I only create one table "projects" in this class, I create the other table "user" with the database GUI in IDEA
// Thus, please don't run this class and use the database directly
public class EmbeddedDbCreator {
private String driver = "org.apache.derby.jdbc.EmbeddedDriver";
private String protocol = "jdbc:derby:";
private String username = "someuser";
private String password = "somepassword";
private String dbName = "myDatabase_Andy";
private String tableName = "projects";
private Properties userInfo;
public EmbeddedDbCreator() {
userInfo = new Properties();
userInfo.put("user", username);
userInfo.put("password", password);
}
public void createDatabase() throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Projects[] projects = {
new Projects(1, "RRT", "Three types of RRT algorithm", "RRT is a path planning method using in autonomous driving based on sampling.It can quickly search the entire state space (the real world) and is biased towards the unexplored space. It is very similar to trees with lots of limbs stretching out at each time.The main working flow is that we start from the start position and protrude some limbs randomly, once the limb of the tree reaches the destination, the path is found successfully.",
"algorithm","Python",100.2,simpleDateFormat.parse("2020-1-1"),simpleDateFormat.parse("2020-8-12")),
new Projects(2, "HIS", "The online hospital system of NEU", "It is an online hospital system of NEU, including six functions (registration, return, visit, prescription, delivery, payment).",
"development","Java",80.5,simpleDateFormat.parse("2020-7-1"),simpleDateFormat.parse("2020-3-1")),
new Projects(3, "APDP", "The data processing of the environment data", "The mechine detecting the concentration of CO2 in the air will generate lots of raw data, I need to process them, deleting those bad data, calculating many values like the average.",
"data processing","Python",24.8,simpleDateFormat.parse("2020-11-11"),simpleDateFormat.parse("2020-12-20")),
new Projects(4, "PSO", "My improvement of PSO algorithm", "I changed some parameters of the function in the original PSO algorithm, like the weight, the number of particles. By the way, the speed of the algorithm is slightly improved after my modification.",
"algorithm","Python",325.5,simpleDateFormat.parse("2021-3-20"),simpleDateFormat.parse("2021-5-9")),
};
try {
Class.forName(driver);
String dbUrl = protocol + dbName + ";create=true";
Connection connection =
DriverManager.getConnection(dbUrl, userInfo);
Statement statement = connection.createStatement();
String format = "VARCHAR(2000)";
String tableDescription =
String.format
("CREATE TABLE %s" +
"(id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)primary key," +
" title %s, summary %s, " + "description %s, type %s, language %s, cost DOUBLE, StartDate %s, FinishDate %s)",
tableName, format, format, format, format, format, format, format);
statement.execute(tableDescription);
String template =
String.format("INSERT INTO %s (title, summary, description, type, language, cost, startDate, FinishDate) VALUES(?, ?, ?, ?, ?, ?, ?, ?)",
tableName);
PreparedStatement inserter =
connection.prepareStatement(template);
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
for(Projects p: projects) {
inserter.setString(1, p.getTitle());
inserter.setString(2, p.getSummary());
inserter.setString(3, p.getDescription());
inserter.setString(4, p.getType());
inserter.setString(5, p.getLanguage());
inserter.setDouble(6, p.getCost());
inserter.setString(7, simpleDateFormat1.format(p.getStartDate()));
inserter.setString(8, simpleDateFormat1.format(p.getFinishDate()));
inserter.executeUpdate();
}
inserter.close();
connection.close();
System.out.println("Done!");
} catch (SQLException sqle) {
System.out.println(sqle);
// If table already exists, then skip everything else
} catch (ClassNotFoundException e) {
System.out.println("Driver class not found.");
}
}
public void showTable() {
try {
String dbUrl = protocol + dbName;
Connection connection;
connection = DriverManager.getConnection(dbUrl, userInfo);
Statement statement = connection.createStatement();
String query = String.format("SELECT * FROM %s", tableName);
ResultSet resultSet = statement.executeQuery(query);
while(resultSet.next()) {
int id = resultSet.getInt("id");
String title = resultSet.getString("title");
String summary = resultSet.getString("summary");
String description = resultSet.getString("description");
String type = resultSet.getString("type");
String language = resultSet.getString("language");
Double cost = resultSet.getDouble("cost");
String startDate = resultSet.getString("startDate");
String finishDate = resultSet.getString("finishDate");
System.out.printf("%s %s %s %s %s %s %s %s %s",
id, title, summary, description, type, language, cost, startDate, finishDate);
System.out.println();
}
connection.close();
} catch (SQLException sqle) {
sqle.printStackTrace();
}
}
public static void main(String[] args) throws ParseException {
EmbeddedDbCreator tester = new EmbeddedDbCreator();
tester.createDatabase();
System.out.println("===================Show Table===================");
tester.showTable();
}
}
| [
"18810235625@163.com"
] | 18810235625@163.com |
3139b8454a1974ac9ebf720693fb1cd8192589d2 | 7bebf7ba9b6a8f5c36b514619c23910c231aa7d4 | /app/src/main/java/com/telemedicine/maulaji/adapter/DocumentLitsAdapterDoctor.java | effda7213995e396a3d70df1a59fdecf47e55924 | [] | no_license | mukul2/maulaj | 63bbe45bfaba9091b8ce81edf6ce350e0b6a7095 | dc54ad217d5995239168e2cca111f37d7b5979e8 | refs/heads/main | 2023-06-09T15:30:34.842761 | 2021-06-26T16:02:36 | 2021-06-26T16:02:36 | 332,291,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,443 | java | package com.telemedicine.maulaji.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.telemedicine.maulaji.Activity.ImageFullScreenActivity;
import com.telemedicine.maulaji.R;
import com.telemedicine.maulaji.model.DocumentModel;
import java.util.ArrayList;
import java.util.List;
import static com.telemedicine.maulaji.Data.Data.PHOTO_BASE;
/**
* Created by mukul on 3/10/2019.
*/
public class DocumentLitsAdapterDoctor extends RecyclerView.Adapter<DocumentLitsAdapterDoctor.MyViewHolder> {
List<DocumentModel> list = new ArrayList<>();
Context context;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView tv_title;
RelativeLayout relative_container;
ImageView imageView;
public MyViewHolder(View view) {
super(view);
tv_title = (TextView) view.findViewById(R.id.tv_title);
imageView = (ImageView) view.findViewById(R.id.image);
}
}
public DocumentLitsAdapterDoctor(List<DocumentModel> lists) {
this.list = lists;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.doctor_document_item, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(MyViewHolder holder, final int position) {
final DocumentModel movie = list.get(position);
context = holder.tv_title.getContext();
holder.tv_title.setText(movie.getTitle());
Glide.with(context).load(PHOTO_BASE + movie.getPhoto()).into(holder.imageView);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(context, ImageFullScreenActivity.class);
intent.putExtra("link",PHOTO_BASE+movie.getPhoto());
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return list.size();
}
} | [
"01620645499mkl"
] | 01620645499mkl |
3628133b8c98660c73b390a94ab1cb7fa47c107e | 282ac1db767ec2b4eb5d0829fc3478eb909f348e | /framework/modules/idempotent-starter/src/main/java/ms/dew/idempotent/interceptor/IdempotentWebMvcConfigurer.java | 061618eb4db613183d5d11e56857349386abef82 | [
"Apache-2.0"
] | permissive | LiuHongcheng/dew | 653166a21fdc96b0abda669592ed2959b4af2f18 | 6ad2d9db5b6e758331e1afc1cdf75bc618adf0c5 | refs/heads/master | 2020-05-19T17:27:14.741921 | 2019-10-30T07:01:39 | 2019-10-30T07:01:39 | 185,134,486 | 0 | 0 | Apache-2.0 | 2019-05-06T06:13:41 | 2019-05-06T06:13:41 | null | UTF-8 | Java | false | false | 2,225 | java | /*
* Copyright 2019. the original author or authors.
*
* 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 ms.dew.idempotent.interceptor;
import ms.dew.idempotent.DewIdempotentConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* Idempotent web mvc configurer.
*
* @author gudaoxuri
*/
@Configuration
@ConditionalOnWebApplication
@EnableConfigurationProperties(DewIdempotentConfig.class)
@Order(10000)
public class IdempotentWebMvcConfigurer extends WebMvcConfigurerAdapter {
private static final Logger logger = LoggerFactory.getLogger(IdempotentWebMvcConfigurer.class);
private DewIdempotentConfig dewIdempotentConfig;
/**
* Instantiates a new Idempotent web mvc configurer.
*
* @param dewIdempotentConfig the dew idempotent config
*/
public IdempotentWebMvcConfigurer(DewIdempotentConfig dewIdempotentConfig) {
logger.info("Load Auto Configuration : {}", this.getClass().getName());
this.dewIdempotentConfig = dewIdempotentConfig;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new IdempotentHandlerInterceptor(dewIdempotentConfig)).excludePathPatterns("/error/**");
super.addInterceptors(registry);
}
}
| [
"i@sunisle.org"
] | i@sunisle.org |
44138e3f23c1205f77a66346244c89aec282a415 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Cli-34/org.apache.commons.cli.OptionBuilder/BBC-F0-opt-20/tests/20/org/apache/commons/cli/OptionBuilder_ESTest_scaffolding.java | 1937feee9a8da3562281eb97624c54fcb005aa5e | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 3,373 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 21 03:14:15 GMT 2021
*/
package org.apache.commons.cli;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class OptionBuilder_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.cli.OptionBuilder";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(OptionBuilder_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.cli.OptionBuilder",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.Option"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(OptionBuilder_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.cli.OptionBuilder",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.OptionValidator"
);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
e99972a7a63b022b7799156b8954a38474a5a1c6 | 7abab15f4ff726141acadee9eb26c75dda41bdc1 | /src/xx/tream/chengxin/ms/service/TrainServiceImpl.java | 8ded1a0a056907813a505cabafb9e1cbb60c3cd6 | [] | no_license | Wymon/chengxin | 6c7ad71861f7bcef4943744f621b4e10e406d032 | 67615f723d3ddb80390a61ed7ad3eb7b9a3256b0 | refs/heads/master | 2020-05-31T02:23:02.836789 | 2015-04-10T14:40:32 | 2015-04-10T14:40:32 | 28,484,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,599 | java | package xx.tream.chengxin.ms.service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xx.tream.basepaltform.dao.DaoUtil;
import xx.tream.basepaltform.model.PageList;
import xx.tream.chengxin.ms.model.Train;
@Service
public class TrainServiceImpl implements TrainService {
@Autowired
private DaoUtil dao;
public long save(Train train) {
return ((Long) this.dao.save(train)).longValue();
}
public void update(Train train) {
this.dao.update(train);
}
public void delete(long id) {
this.dao.delete(Train.class, Long.valueOf(id));
}
public Map<String, Object> find(long id) {
StringBuffer sql = new StringBuffer(100);
sql.append(
"select t.*,u.realName,a.autumnNumber, case when i.allincome is null then 0 else i.allincome end allincome ,")
.append("case when p.allpaying is null then 0 else p.allpaying end allpaying ,a.id autumnNumberId ")
.append("from tb_train t ")
.append("left join tb_user u on t.createUser = u.id ")
.append("left join tb_autumnNumber a on t.id = a.trainId ")
.append("left join trainpayingview p on p.trainId = t.id ")
.append("left join trainincomeview i on i.trainId = t.id ")
.append("where t.id = ? ");
return this.dao.queryForMap(sql.toString(),id);
}
public PageList queryByMap(Map<String, Object> map, Integer index,
Integer side) {
StringBuffer sql = new StringBuffer(100);
sql.append("select t.*,a.autumnNumber,ip.allincome ")
.append(",ip.allpaying,h.hasAudit,ab.createUser abcreateUser,ab.id abId,case when u.id is not null then 1 else 0 end canUpdateAudit from tb_train t ")
.append("left join tb_autumnNumber a on t.id = a.trainId ")
.append("left join trainincomepayingview ip on ip.trainId = t.id ")
.append("left join hasAuditView h on t.id = h.trainId ")
.append(" left join tb_autumnNumber_back ab on ab.backId = a.id and ab.updatestatus = 0 ")
.append("left join updateview u on t.id = u.id ")
.append("where 1=1 ");
if ((map.get("name") != null)
&& (!map.get("name").toString().equals(""))) {
sql.append(" and t.name like '%").append(map.get("name"))
.append("%' ");
}
if ((map.get("id") != null)
&& (!map.get("id").toString().equals(""))) {
sql.append(" and t.id = ").append(map.get("id"));
}
if ((map.get("note") != null)
&& (!map.get("note").toString().equals(""))) {
sql.append(" and t.note like '%").append(map.get("note"))
.append("%' ");
}
if ((map.get("autumnNumber") != null)
&& (!map.get("autumnNumber").toString().equals(""))) {
sql.append(" and a.autumnNumber like '%")
.append(map.get("autumnNumber")).append("%' ");
}
if ((map.get("beginTime") != null)
&& (!map.get("beginTime").toString().equals(""))) {
sql.append(" and t.createTime >= '").append(map.get("beginTime"))
.append("' ");
}
if ((map.get("endTime") != null)
&& (!map.get("endTime").toString().equals(""))) {
sql.append(" and t.createTime <= '").append(map.get("endTime"))
.append("' ");
}
if ((map.get("canPayingTo") != null)
&& (!map.get("canPayingTo").toString().equals(""))) {
sql.append(" and (t.payable-ip.allpaying) >= ")
.append(map.get("canPayingTo")).append(" ");
}
if ((map.get("canPayingForm") != null)
&& (!map.get("canPayingForm").toString().equals(""))) {
sql.append(" and (t.payable-ip.allpaying) <= ")
.append(map.get("canPayingForm")).append(" ");
}
if ((map.get("newOrOld") != null)
&& (!map.get("newOrOld").toString().equals(""))) {
sql.append(" and t.newOrOld = '").append(map.get("newOrOld"))
.append("' ");
}
if ((map.get("type") != null)
&& (!map.get("type").toString().equals(""))) {
sql.append(" and t.type = '").append(map.get("type"))
.append("' ");
}
if ((map.get("licenseTag") != null)
&& (!map.get("licenseTag").toString().equals(""))) {
sql.append(" and t.licenseTag = '").append(map.get("licenseTag"))
.append("' ");
}
if ((map.get("createUserName") != null)
&& (!map.get("createUserName").toString().equals(""))) {
sql.append(" and t.createUserName like '%").append(map.get("createUserName")+"%")
.append("' ");
}
sql.append(" order by h.hasAudit desc ,t.id desc ");
return this.dao.findObjectByPageList(sql.toString(), index, side);
}
public Map<String, Object> findByIdcard(String idcard) {
String sql = "select * from tb_train where idcard = ?";
return this.dao.queryForMap(sql, new Object[] { idcard });
}
public boolean checkByIdcard(String idcard) {
String sql = "select count(id) num from tb_train where idcard = ?";
List<Map<String, Object>> list = this.dao.queryForList(sql,
new Object[] { idcard });
if ((list != null) && (list.size() > 0)) {
Map<String, Object> numMap = (Map<String, Object>) list.get(0);
Long num = (Long) numMap.get("num");
if (num.longValue() > 0L) {
return true;
}
}
return false;
}
public List<Map<String, Object>> queryForParam(Map<String, Object> map) {
StringBuffer sql = new StringBuffer(1000);
sql.append(
"SELECT t.payable+ip.allincome count_all,ip.allincome+ip.allpaying allip,ip.allincome,ip.allpaying allpaying,t.id,a.autumnNumber,t.name,t.idcard,t.payable pay,t.payable-ip.allpaying canpay,t.newOrOld,t.type,t.licenseTag,t.createTime,t.note,t.createUserName FROM tb_train t ")
.append("LEFT JOIN tb_autumnNumber a ON t.id = a.trainId ")
.append("LEFT JOIN trainincomepayingview ip ON ip.trainId = t.id where 1=1");
if ((map.get("name") != null)
&& (!map.get("name").toString().equals(""))) {
sql.append(" and t.name like '%").append(map.get("name"))
.append("%' ");
}
if ((map.get("autumnNumber") != null)
&& (!map.get("autumnNumber").toString().equals(""))) {
sql.append(" and a.autumnNumber like '%")
.append(map.get("autumnNumber")).append("%' ");
}
if ((map.get("beginTime") != null)
&& (!map.get("beginTime").toString().equals(""))) {
sql.append(" and t.createTime >= '").append(map.get("beginTime"))
.append("' ");
}
if ((map.get("endTime") != null)
&& (!map.get("endTime").toString().equals(""))) {
sql.append(" and t.createTime <= '").append(map.get("endTime"))
.append("' ");
}
if ((map.get("canPayingTo") != null)
&& (!map.get("canPayingTo").toString().equals(""))) {
sql.append(" and (ip.allincome+t.payable-ip.allpaying) >= ")
.append(map.get("canPayingTo")).append(" ");
}
if ((map.get("canPayingForm") != null)
&& (!map.get("canPayingForm").toString().equals(""))) {
sql.append(" and (ip.allincome+t.payable-ip.allpaying) <= ")
.append(map.get("canPayingForm")).append(" ");
}
if ((map.get("newOrOld") != null)
&& (!map.get("newOrOld").toString().equals(""))) {
sql.append(" and t.newOrOld = '").append(map.get("newOrOld"))
.append("' ");
}
if ((map.get("type") != null)
&& (!map.get("type").toString().equals(""))) {
sql.append(" and t.type = '").append(map.get("type"))
.append("' ");
}
if ((map.get("licenseTag") != null)
&& (!map.get("licenseTag").toString().equals(""))) {
sql.append(" and t.licenseTag = '").append(map.get("licenseTag"))
.append("' ");
}
if ((map.get("createUserName") != null)
&& (!map.get("createUserName").toString().equals(""))) {
sql.append(" and t.createUserName like '%").append(map.get("createUserName")+"%")
.append("' ");
}
sql.append(" order by t.id ");
return this.dao.queryForList(sql.toString());
}
public List<Map<String, Object>> queryPaying(Map<String, Object> map) {
StringBuffer sql = new StringBuffer(100);
sql.append("SELECT p.* FROM tb_paying p ")
.append("WHERE p.status = 1 AND p.trainId IN ( ")
.append("SELECT t.id FROM tb_train t ")
.append("LEFT JOIN tb_autumnNumber a ON t.id = a.trainId ")
.append("LEFT JOIN trainincomepayingview ip ON ip.trainId = t.id where 1=1 ");
if ((map.get("name") != null)
&& (!map.get("name").toString().equals(""))) {
sql.append(" and t.name like '%").append(map.get("name"))
.append("%' ");
}
if ((map.get("autumnNumber") != null)
&& (!map.get("autumnNumber").toString().equals(""))) {
sql.append(" and a.autumnNumber like '%")
.append(map.get("autumnNumber")).append("%' ");
}
if ((map.get("beginTime") != null)
&& (!map.get("beginTime").toString().equals(""))) {
sql.append(" and t.createTime >= '").append(map.get("beginTime"))
.append("' ");
}
if ((map.get("endTime") != null)
&& (!map.get("endTime").toString().equals(""))) {
sql.append(" and t.createTime <= '").append(map.get("endTime"))
.append("' ");
}
if ((map.get("canPayingTo") != null)
&& (!map.get("canPayingTo").toString().equals(""))) {
sql.append(" and (ip.allincome+t.payable-ip.allpaying) >= ")
.append(map.get("canPayingTo")).append(" ");
}
if ((map.get("canPayingForm") != null)
&& (!map.get("canPayingForm").toString().equals(""))) {
sql.append(" and (ip.allincome+t.payable-ip.allpaying) <= ")
.append(map.get("canPayingForm")).append(" ");
}
if ((map.get("newOrOld") != null)
&& (!map.get("newOrOld").toString().equals(""))) {
sql.append(" and t.newOrOld = '").append(map.get("newOrOld"))
.append("' ");
}
if ((map.get("type") != null)
&& (!map.get("type").toString().equals(""))) {
sql.append(" and t.type = '").append(map.get("type"))
.append("' ");
}
if ((map.get("licenseTag") != null)
&& (!map.get("licenseTag").toString().equals(""))) {
sql.append(" and t.licenseTag = '").append(map.get("licenseTag"))
.append("' ");
}
if ((map.get("createUserName") != null)
&& (!map.get("createUserName").toString().equals(""))) {
sql.append(" and t.createUserName like '%").append(map.get("createUserName")+"%")
.append("' ");
}
sql.append(") ");
sql.append(" order by p.trainId desc ");
return this.dao.queryForList(sql.toString());
}
public Map<String, Object> statistics(Map<String, Object> map) {
StringBuffer sql = new StringBuffer(1000);
sql.append(
"SELECT sum(t.payable) payable,sum(v.allpaying) paying,SUM(t.payable+v.allincome) allpay ,sum(v.allincome) allincome,SUM(v.allpaying+v.allincome) allpaying,sum(p.allpayout) allpayout FROM tb_train t ")
.append("LEFT JOIN tb_autumnNumber a ON t.id = a.trainId ")
.append("LEFT JOIN trainpayoutview p ON t.id = p.trainId ")
.append("LEFT JOIN trainincomepayingview v ON t.id = v.trainId where 1=1 ");
if ((map.get("name") != null)
&& (!map.get("name").toString().equals(""))) {
sql.append(" and t.name like '%").append(map.get("name"))
.append("%' ");
}
if ((map.get("id") != null)
&& (!map.get("id").toString().equals(""))) {
sql.append(" and t.id = ").append(map.get("id"));
}
if ((map.get("note") != null)
&& (!map.get("note").toString().equals(""))) {
sql.append(" and t.note like '%").append(map.get("note"))
.append("%' ");
}
if ((map.get("autumnNumber") != null)
&& (!map.get("autumnNumber").toString().equals(""))) {
sql.append(" and a.autumnNumber like '%")
.append(map.get("autumnNumber")).append("%' ");
}
if ((map.get("beginTime") != null)
&& (!map.get("beginTime").toString().equals(""))) {
sql.append(" and t.createTime >= '").append(map.get("beginTime"))
.append("' ");
}
if ((map.get("endTime") != null)
&& (!map.get("endTime").toString().equals(""))) {
sql.append(" and t.createTime <= '").append(map.get("endTime"))
.append("' ");
}
if ((map.get("canPayingTo") != null)
&& (!map.get("canPayingTo").toString().equals(""))) {
sql.append(" and (v.allincome+t.payable-v.allpaying) >= ")
.append(map.get("canPayingTo")).append(" ");
}
if ((map.get("canPayingForm") != null)
&& (!map.get("canPayingForm").toString().equals(""))) {
sql.append(" and (v.allincome+t.payable-v.allpaying) <= ")
.append(map.get("canPayingForm")).append(" ");
}
if ((map.get("newOrOld") != null)
&& (!map.get("newOrOld").toString().equals(""))) {
sql.append(" and t.newOrOld = '").append(map.get("newOrOld"))
.append("' ");
}
if ((map.get("type") != null)
&& (!map.get("type").toString().equals(""))) {
sql.append(" and t.type = '").append(map.get("type"))
.append("' ");
}
if ((map.get("licenseTag") != null)
&& (!map.get("licenseTag").toString().equals(""))) {
sql.append(" and t.licenseTag = '").append(map.get("licenseTag"))
.append("' ");
}
if ((map.get("createUserName") != null)
&& (!map.get("createUserName").toString().equals(""))) {
sql.append(" and t.createUserName like '%").append(map.get("createUserName")+"%")
.append("' ");
}
List<Map<String, Object>> list = this.dao.queryForList(sql.toString());
if ((list != null) && (list.size() > 0)) {
return (Map<String, Object>) list.get(0);
}
return new HashMap<String, Object>();
}
public List<Map<String, Object>> dayStatistics(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(5, 1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String startDate = sdf.format(date);
String endDate = sdf.format(cal.getTime());
StringBuffer sql = new StringBuffer(100);
sql.append(
"SELECT t.name,t.idcard,pay.allpaying,payout.allpayout,income.allincome FROM tb_train t ")
.append("LEFT JOIN (")
.append("SELECT p.trainId,SUM(p.paying) allpaying FROM tb_paying p WHERE p.createTime > '"
+ startDate
+ "' AND p.createTime <'"
+ endDate
+ "' GROUP BY p.status = 1 ")
.append(") pay ON t.id = pay.trainId ")
.append("LEFT JOIN (")
.append("SELECT p.trainId,SUM(p.payout) allpayout FROM tb_payout p WHERE p.createTime > '"
+ startDate
+ "' AND p.createTime <'"
+ endDate
+ "' GROUP BY p.status = 1 ")
.append(") payout ON t.id = payout.trainId ")
.append("LEFT JOIN (")
.append("SELECT i.trainId,SUM(i.income) allincome FROM tb_income i WHERE i.createTime > '"
+ startDate
+ "' AND i.createTime <'"
+ endDate
+ "' GROUP BY i.status = 1 ")
.append(") income ON income.trainId = t.id ")
.append("WHERE pay.allpaying IS NOT NULL OR payout.allpayout IS NOT NULL AND income.allincome IS NOT NULL");
List<Map<String, Object>> list = this.dao.queryForList(sql.toString());
return list;
}
public boolean hasPayoutCommonAudti() {
String sql = "select count(*) num from tb_payoutcommon where status = 0 ";
List<Map<String, Object>> list = this.dao.queryForList(sql.toString());
if(list!=null&&list.size()>0){
Long num = (Long)list.get(0).get("num");
if(num>0){
return true;
}
}
sql = "select count(*) num from tb_incomecommon where status = 0 ";
list = this.dao.queryForList(sql.toString());
if(list!=null&&list.size()>0){
Long num = (Long)list.get(0).get("num");
if(num>0){
return true;
}
}
return false;
}
public Map<String, Object> findBackByBTrainId(long trainId) {
String sql = "select t.*,n.autumnNumber,b.id backId,b.updateStatus,b.createUser bcreateUser from tb_train t left join tb_autumnNumber n on t.id = n.trainId left join tb_train_back b on t.id = b.trainId and b.updateStatus = 0 where t.id = ? ";
List<Map<String,Object>> list = dao.queryForList(sql,trainId);
if(list!=null&&list.size()>0){
return list.get(0);
}
return null;
}
} | [
"qizhuzoushatan@163.com"
] | qizhuzoushatan@163.com |
4a04297821421172a5b702a33be220e337d1ff9d | 7f180dae0160e5d0d0327706a7113ee53930c8b3 | /JRaceScene.java | 0d315baf3fd78d6add6c619b245b16e0a868fce5 | [] | no_license | theck01/JRace | a10a7e955d7adcd8e2e26f3ab088bed99c661e7f | 5e37617b01f1883d9d4588e9809af6b178e119e8 | refs/heads/master | 2021-01-22T05:15:32.509985 | 2012-12-02T16:15:47 | 2012-12-02T16:15:47 | 2,930,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
public class JRaceScene extends BranchGroup {
public JRaceScene (JRaceCar car) {
DirectionalLight sun = new DirectionalLight(new Color3f (1.f, 1.f, 1.f), new Vector3f (-1.f, -0.5f, -1.f));
sun.setInfluencingBounds (new BoundingSphere (new Point3d(), Float.MAX_VALUE));
this.addChild(sun);
DirectionalLight filler = new DirectionalLight (new Color3f (.5f, .5f, .5f), new Vector3f (1.f, 0.5f, 1.0f));
filler.setInfluencingBounds (new BoundingSphere (new Point3d(), Float.MAX_VALUE));
this.addChild(filler);
AmbientLight ambient = new AmbientLight ();
ambient.setInfluencingBounds (new BoundingSphere (new Point3d(), Float.MAX_VALUE));
this.addChild(ambient);
JRaceTrack track = new JRaceTrack();
car.setTrack(track);
this.addChild(new JRaceTrack());
}
} | [
"tyler.heck@gmail.com"
] | tyler.heck@gmail.com |
f06e568917e90d0388016057a77df7771d6f14ec | 7aa4b99ac0c3d98fd0ded52e2bf208e4590c528a | /src/get_the_value_of_the_node_at_a_specific_position_from_the_tail/Solution.java | a9ac7a621f4186fbe3335b2d49167687a1d25640 | [] | no_license | jakubowiczish/hackerrank-solutions | 6639ee9ee7fb3e73837b6d3d6fd4079af7f1bf1f | 00d6c04ec082f8379eb2a4e52b23f8031297f5a0 | refs/heads/master | 2022-04-10T11:12:07.373397 | 2020-03-16T10:55:06 | 2020-03-16T10:55:06 | 241,699,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,278 | java | package get_the_value_of_the_node_at_a_specific_position_from_the_tail;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
static class SinglyLinkedListNode {
public int data;
public SinglyLinkedListNode next;
public SinglyLinkedListNode(int nodeData) {
this.data = nodeData;
this.next = null;
}
}
static class SinglyLinkedList {
public SinglyLinkedListNode head;
public SinglyLinkedListNode tail;
public SinglyLinkedList() {
this.head = null;
this.tail = null;
}
public void insertNode(int nodeData) {
SinglyLinkedListNode node = new SinglyLinkedListNode(nodeData);
if (this.head == null) {
this.head = node;
} else {
this.tail.next = node;
}
this.tail = node;
}
}
public static void printSinglyLinkedList(SinglyLinkedListNode node, String sep, BufferedWriter bufferedWriter) throws IOException {
while (node != null) {
bufferedWriter.write(String.valueOf(node.data));
node = node.next;
if (node != null) {
bufferedWriter.write(sep);
}
}
}
// Complete the getNode function below.
/*
* For your reference:
*
* SinglyLinkedListNode {
* int data;
* SinglyLinkedListNode next;
* }
*
*/
static int getNode(SinglyLinkedListNode head, int positionFromTail) {
int size = 0;
SinglyLinkedListNode node = head;
while (node != null) {
size += 1;
node = node.next;
}
int elemIndex = size - positionFromTail;
size = 0;
node = head;
while (node != null) {
size += 1;
if (size == elemIndex) {
return node.data;
}
node = node.next;
}
return -1;
}
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) throws IOException {
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
int tests = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int testsItr = 0; testsItr < tests; testsItr++) {
SinglyLinkedList llist = new SinglyLinkedList();
int llistCount = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int i = 0; i < llistCount; i++) {
int llistItem = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
llist.insertNode(llistItem);
}
int position = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
int result = getNode(llist.head, position);
bufferedWriter.write(String.valueOf(result));
bufferedWriter.newLine();
}
bufferedWriter.close();
scanner.close();
}
}
| [
"jakub77plotnikowski@gmail.com"
] | jakub77plotnikowski@gmail.com |
39605eca4777b19c42fc56bd042af125560d4bf2 | 85eba1d69af471276022f05d944cfc83437ad28e | /src/main/java/embedded/com/android/dx/dex/file/AnnotationSetItem.java | 98c51293c2ee25cb3796cd23bb87725afe6af59d | [] | no_license | jsdelivrbot/RHazOS-Android | a64f23c0e09ff5af2827477398427d7c197e3101 | 1a1b10ce611025743429b109f9eda59f9b53abf1 | refs/heads/master | 2020-04-10T02:01:41.439048 | 2018-12-07T15:11:51 | 2018-12-07T15:11:51 | 160,732,341 | 1 | 0 | null | 2018-12-06T21:09:42 | 2018-12-06T21:09:41 | null | UTF-8 | Java | false | false | 2,876 | java | package embedded.com.android.dx.dex.file;
import embedded.com.android.dx.rop.annotation.*;
import java.util.*;
import embedded.com.android.dx.util.*;
public final class AnnotationSetItem extends OffsettedItem
{
private static final int ALIGNMENT = 4;
private static final int ENTRY_WRITE_SIZE = 4;
private final Annotations annotations;
private final AnnotationItem[] items;
public AnnotationSetItem(final Annotations annotations, final DexFile dexFile) {
super(4, writeSize(annotations));
this.annotations = annotations;
this.items = new AnnotationItem[annotations.size()];
int at = 0;
for (final Annotation a : annotations.getAnnotations()) {
this.items[at] = new AnnotationItem(a, dexFile);
++at;
}
}
private static int writeSize(final Annotations annotations) {
try {
return annotations.size() * 4 + 4;
}
catch (NullPointerException ex) {
throw new NullPointerException("list == null");
}
}
public Annotations getAnnotations() {
return this.annotations;
}
@Override
public int hashCode() {
return this.annotations.hashCode();
}
@Override
protected int compareTo0(final OffsettedItem other) {
final AnnotationSetItem otherSet = (AnnotationSetItem)other;
return this.annotations.compareTo(otherSet.annotations);
}
@Override
public ItemType itemType() {
return ItemType.TYPE_ANNOTATION_SET_ITEM;
}
@Override
public String toHuman() {
return this.annotations.toString();
}
@Override
public void addContents(final DexFile file) {
final MixedItemSection byteData = file.getByteData();
for (int size = this.items.length, i = 0; i < size; ++i) {
this.items[i] = byteData.intern(this.items[i]);
}
}
@Override
protected void place0(final Section addedTo, final int offset) {
AnnotationItem.sortByTypeIdIndex(this.items);
}
@Override
protected void writeTo0(final DexFile file, final AnnotatedOutput out) {
final boolean annotates = out.annotates();
final int size = this.items.length;
if (annotates) {
out.annotate(0, this.offsetString() + " annotation set");
out.annotate(4, " size: " + Hex.u4(size));
}
out.writeInt(size);
for (int i = 0; i < size; ++i) {
final AnnotationItem item = this.items[i];
final int offset = item.getAbsoluteOffset();
if (annotates) {
out.annotate(4, " entries[" + Integer.toHexString(i) + "]: " + Hex.u4(offset));
this.items[i].annotateTo(out, " ");
}
out.writeInt(offset);
}
}
}
| [
"hazae41@gmail.com"
] | hazae41@gmail.com |
298e554118c7da0a1bc86aa5e72ba26fc354e232 | 24dc243e49e4fd82f03bffd763c835ec97539add | /src/Projectile.java | 654549d76d137e033a0ba15a5cfe6fc637f9718f | [] | no_license | Bokanovskii/SaveThePrincessVideoGame | b4fb373701d028472f31e9f67af89b2dfdeb9ae4 | 2b03b73f3ee4846d9d962ce87282b966ef887269 | refs/heads/main | 2023-04-27T11:25:17.908698 | 2021-05-18T16:55:29 | 2021-05-18T16:55:29 | 368,593,154 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,346 | java | import processing.core.PImage;
import java.util.List;
public class Projectile extends MoveTo{
private enum direction {
up, rightUp, right, downRight, down, downLeft, left, leftUp
}
private direction currentDirection;
private ActionableEntity owner;
private int distanceShot = 0;
private List<Point> projPath;
private int index;
public Projectile(String id, Point position, List<PImage> images, int actionPeriod,
ActionableEntity owner, List<Point> projPath) {
super(id, position, images, actionPeriod);
this.projPath = projPath;
this.owner = owner;
index = 1;
}
public void executeActivity(WorldModel world, ImageStore imageStore, EventScheduler scheduler) {
if (moveTo(world, world.getMainCharacter(), scheduler) || distanceShot >= 5) {
world.removeEntity(this);
scheduler.unscheduleAllEvents(this);
if (owner instanceof DarkElf)
((DarkElf) owner).setShootingProjectile(false);
if (!world.getLost())
scheduler.scheduleEvent(owner, Create.createActivityAction(world, imageStore, owner), 1);
else {
scheduler.unscheduleAllEvents((owner));
}
} else {
scheduler.scheduleEvent(this, Create.createActivityAction(world, imageStore, this), getActionPeriod());
distanceShot++;
}
}
public boolean moveTo(WorldModel world, Entity target, EventScheduler scheduler)
{
// have an index for where I am at in the path and increment
Point nextPos;
if (index < projPath.size()) {
nextPos = projPath.get(index);
index++;
} else {
switch (currentDirection) {
case up:
nextPos = new Point(getPosition().x, getPosition().y + 1);
break;
case right:
nextPos = new Point(getPosition().x + 1, getPosition().y);
break;
case left:
nextPos = new Point(getPosition().x - 1, getPosition().y);
break;
case down:
nextPos = new Point(getPosition().x, getPosition().y - 1);
break;
case leftUp:
nextPos = new Point(getPosition().x - 1, getPosition().y + 1);
break;
case rightUp:
nextPos = new Point(getPosition().x + 1, getPosition().y + 1);
break;
case downLeft:
nextPos = new Point(getPosition().x - 1, getPosition().y - 1);
break;
case downRight:
nextPos = new Point(getPosition().x + 1, getPosition().y - 1);
break;
default:
nextPos = getPosition();
}
}
if (index >= projPath.size() - 1)
currentDirection = comparePos(nextPos);
if(!world.withinBounds(nextPos) || world.isOccupied(nextPos)) {
if (world.withinBounds(nextPos) &&
world.getOccupancyCell(nextPos).getClass().equals(MainCharacter.class))
{
world.removeEntity(target);
scheduler.unscheduleAllEvents(target);
world.setLost(true);
world.moveEntity(this, nextPos);
}
return true;
}
world.moveEntity(this, nextPos);
return false;
}
private direction comparePos(Point nextPos)
{
int dx = nextPos.x - getPosition().x;
int dy = nextPos.y - getPosition().y;
if (dy == -1 && dx == -1)
return direction.downLeft;
if (dy == -1 && dx == 1)
return direction.downRight;
if (dy == -1 && dx == 0)
return direction.down;
if (dy == 1 && dx == 1)
return direction.rightUp;
if (dy == 1 && dx == -1)
return direction.leftUp;
if (dy == 1 && dx ==0)
return direction.up;
if (dy == 0 && dx == 1)
return direction.right;
if (dy == 0 && dx == -1)
return direction.left;
return currentDirection;
}
}
| [
"charles.a.ward00@gmail.com"
] | charles.a.ward00@gmail.com |
c1ae30e63aeb9de7e48ee2544a6cf53038fbd95c | 0ef0c852fc2c820b30726288ecd41dd65b4fd0f2 | /Homework/Solutions to homework/java/exercises/exercise2/fuels/Dilithium.java | e58a9f2381eafdb44827c6ec4e331831c25e0479 | [
"MIT"
] | permissive | hogeschool/INFDEV02-3 | 54246f355c1c47c23b780b84d6e197dc4d328043 | 8593840ddb7f89e60d541ac4e936393ebf8adf05 | refs/heads/master | 2021-01-17T14:52:28.763738 | 2018-05-08T10:28:28 | 2018-05-08T10:28:28 | 49,422,077 | 24 | 24 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | package exercises.exercise2.fuels;
public class Dilithium extends Fuel {
public Dilithium(int amount) {
setAmount(amount);
}
}
| [
"mail@tjang.nl"
] | mail@tjang.nl |
72f28421aa73a77c3012583592557fec40246e25 | 7a47b8f86175108b106b00bcef24dbbc124f473f | /crawler/HtmlCrawler.java | 2be553a87fe7b22a9d30a6941e884580dfb50345 | [] | no_license | jpzeng/jpzeng | 480f09823d910e27d67e9cf2decee8be690888c6 | a649e162371cf59cfcde2c9c8eafed0b2e08e94d | refs/heads/master | 2021-01-10T18:44:05.057880 | 2016-10-22T12:41:37 | 2016-10-22T12:41:37 | 71,465,080 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package crawler;
public class HtmlCrawler {
public static void main(String[] args) {
NewsHtmlParser p = new NewsHtmlParser();
p.getHtmlUrl("http://news.sina.com.cn/");
p.HtmlStoreOss();
// p.test();
//System.out.print("hello world");
}
}
| [
"zeng_jian_ping@hotmail.com"
] | zeng_jian_ping@hotmail.com |
c2c523d20199086dbf27b7e5dd823222633fb65e | fff3302fe8193d13360f12e5b13d376ef76cf4d6 | /AppLock/com/google/android/gms/internal/zzbau.java | a4b4072ba3193eaa39adb090f2e6f7e77669eb2d | [] | no_license | shaolin-example-com-my-shopify-com/KidWatcher | 2912950b7ca4773c3d29005b9d231ad6035b4912 | f67a81b757043159ea358b7f9e4b16fd6be0e0c0 | refs/heads/master | 2022-04-25T17:19:28.800922 | 2020-04-30T02:53:20 | 2020-04-30T02:53:20 | 260,098,439 | 0 | 0 | null | 2020-04-30T02:51:49 | 2020-04-30T02:51:48 | null | UTF-8 | Java | false | false | 832 | java | package com.google.android.gms.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.zza;
import com.google.android.gms.common.internal.zzad;
public class zzbau extends zza {
public static final Creator<zzbau> CREATOR = new ev();
final int f11861a;
final zzad f11862b;
zzbau(int i, zzad com_google_android_gms_common_internal_zzad) {
this.f11861a = i;
this.f11862b = com_google_android_gms_common_internal_zzad;
}
public zzbau(zzad com_google_android_gms_common_internal_zzad) {
this(1, com_google_android_gms_common_internal_zzad);
}
public zzad m15370a() {
return this.f11862b;
}
public void writeToParcel(Parcel parcel, int i) {
ev.m10691a(this, parcel, i);
}
}
| [
"Nist@netcompany.com"
] | Nist@netcompany.com |
184eaf6e35f5e03ea986f3c3b2e823d6a187f40c | c237f198b317cea50a73e45335d94f5f85226d81 | /src/main/java/com/Study/controller/GradeController.java | d38c179c9c9aa5461bf8598b05e2e8e2fd7f27c9 | [] | no_license | Zxiang-929/SSMprojects | 806483fd8f58ebb132db26f55f20cd333319b1a3 | 3d16f213cd6ceb31fbf5542db2a98d9a24588e8e | refs/heads/master | 2022-04-25T03:07:34.307247 | 2020-04-26T15:09:53 | 2020-04-26T15:09:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,863 | java | package com.Study.controller;
import com.Study.bean.Grade;
import com.Study.service.GradeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description:
* @Author: Mutong
* @Date: 2019.10.11 17:44
*/
@Controller
@RequestMapping("/grade")
public class GradeController {
// 注入业务对象
@Autowired
private GradeService gradeService;
// 存储预返回页面的结果对象
private Map<String, Object> result = new HashMap<>();
@GetMapping("/goGradeListView")
public String goGradeListPage() {
return "grade/gradeList";
}
@PostMapping("/getGradeList")
@ResponseBody
public Map<String, Object> getGradeList(Integer page, Integer rows, String gradename) {
//注意:使用Java Bean传递gradename,防止以下异常 !
//org.springframework.web.util.NestedServletException: Request processing failed;
// nested exception is org.mybatis.spring.MyBatisSystemException:
// nested exception is org.apache.ibatis.reflection.ReflectionException:
// There is no getter for property named 'name' in 'class java.lang.String'
Grade grade = new Grade();
grade.setName(gradename);
//设置每页的记录数
PageHelper.startPage(page, rows);
//根据年级名称获取指定或全部年级信息列表
List<Grade> list = gradeService.selectList(grade);
//封装信息列表
PageInfo<Grade> pageInfo = new PageInfo<>(list);
//获取总记录数
long total = pageInfo.getTotal();
//获取当前页数据列表
List<Grade> gradeList = pageInfo.getList();
//存储数据对象
result.put("total", total);
result.put("rows", gradeList);
return result;
}
@PostMapping("/addGrade")
@ResponseBody
public Map<String, Object> addGrade(Grade grade) {
//判断年级名是否已存在
Grade name = gradeService.findByName(grade.getName());
if (name == null) {
if (gradeService.insert(grade) > 0) {
result.put("success", true);
} else {
result.put("success", false);
result.put("msg", "添加失败! (ಥ_ಥ)服务器端发生异常!");
}
} else {
result.put("success", false);
result.put("msg", "该年级名称已存在! 请修改后重试!");
}
return result;
}
@PostMapping("/editGrade")
@ResponseBody
public Map<String, Object> editGrade(Grade grade) {
//需排除用户只修改年级名以外的信息
Grade g = gradeService.findByName(grade.getName());
if (g != null) {
if (!(grade.getId().equals(g.getId()))) {
result.put("success", false);
result.put("msg", "该年级名称已存在! 请修改后重试!");
return result;
}
}
//添加操作
if (gradeService.update(grade) > 0) {
result.put("success", true);
} else {
result.put("success", false);
result.put("msg", "添加失败! (ಥ_ಥ)服务器端发生异常!");
}
return result;
}
@PostMapping("/deleteGrade")
@ResponseBody
public Map<String, Object> deleteGrade(@RequestParam(value = "ids[]", required = true) Integer[] ids) {
if (gradeService.deleteById(ids) > 0) {
result.put("success", true);
} else {
result.put("success", false);
}
return result;
}
}
| [
"GitHub 1530201142@qq.com"
] | GitHub 1530201142@qq.com |
da809afcd29105841201308e2c7dae2256b0a680 | 94aadb5e7191aeb797f9ee8d9f1e9035ae293d85 | /src/test/java/com/example/demo/DashboardZuulApplicationTests.java | 12c06e7f03ad7bb7d453293800f3b76d19929d30 | [] | no_license | ashwatthamaa/DashboardZuul | 287a5329e0e3c95b7441cc6fb8df338a063b7ce6 | 9bf7d36fde765a90c0a7ec11bdf0abcb4a8a0c5a | refs/heads/master | 2022-10-09T07:04:16.492557 | 2020-05-29T13:10:32 | 2020-05-29T13:10:32 | 267,781,590 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package com.example.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DashboardZuulApplicationTests {
@Test
void contextLoads() {
}
}
| [
"P10504526@capita.co.uk"
] | P10504526@capita.co.uk |
ce959620d7ddb4fe7452f32daae46f2e8440a7ad | fc8b7fddbb62de6a63768f95f157358f3c1e6fc9 | /dx-boot-wxjava/src/main/java/com/dx/wx/config/WxMpProperties.java | 69b49f1b43e40afc8973fa3db35492c9485f70f9 | [] | no_license | rockstarsteve/dx-boot | c4ceffe22d2580253078dc543e8d97feae5337ba | 0a414fc3f3b0fa3f5da8ed9a072a4bebd76d1fe6 | refs/heads/master | 2021-02-27T11:09:56.672122 | 2020-03-14T06:00:43 | 2020-03-14T06:00:43 | 142,303,790 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package com.dx.wx.config;
import com.dx.wx.utils.JsonUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.List;
/**
* wechat mp properties
*
* @author Binary Wang(https://github.com/binarywang)
*/
@Data
@ConfigurationProperties(prefix = "wx.mp")
public class WxMpProperties {
private List<MpConfig> configs;
@Data
public static class MpConfig {
/**
* 设置微信公众号的appid
*/
private String appId;
/**
* 设置微信公众号的app secret
*/
private String secret;
/**
* 设置微信公众号的token
*/
private String token;
/**
* 设置微信公众号的EncodingAESKey
*/
private String aesKey;
}
@Override
public String toString() {
return JsonUtils.toJson(this);
}
}
| [
"670139644@qq.com"
] | 670139644@qq.com |
ca204ea3e5d6432821cf53145213a0b715714509 | d11b9e2ef77eb430a4b062cc51e1046c89ee7e54 | /src/main/java/com/vptmanager/service/ServerServiceImpl.java | d4abd10822e39efe9bca39331b22a0862339d786 | [] | no_license | codialog/vpt | 8acc178f47cbaacedbdf99b39c12ec4c5555231d | 9ee156b7c01dcbd79f69293d81458450e8803621 | refs/heads/master | 2021-06-22T19:07:41.443703 | 2017-08-28T15:26:43 | 2017-08-28T15:26:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package com.vptmanager.service;
import com.vptmanager.dao.ServerDao;
import com.vptmanager.model.Server;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class ServerServiceImpl implements ServerService {
private ServerDao serverDao;
public void setServerDao(ServerDao serverDao) {
this.serverDao = serverDao;
}
@Override
@Transactional
public void addServer(Server server) {
this.serverDao.addServer(server);
}
@Override
@Transactional
public void updateServer(Server server) {
this.serverDao.updateServer(server);
}
@Override
@Transactional
public void removeServer(int idServer) {
this.serverDao.removeServer(idServer);
}
@Override
@Transactional
public Server getServerById(int idServer) {
return this.serverDao.getServerById(idServer);
}
@Override
@Transactional
public List<Server> listServers() {
return this.serverDao.listServers();
}
}
| [
"dialog.txt@gmail.com"
] | dialog.txt@gmail.com |
95188825e04a9dd8701568f1bf6d33678ed3c618 | d37add3f4b57380e62a5259c0a412fb3a70ef029 | /src/GameObjects/ExitButton.java | 246d3a61f8f4b24ac2b30817bd7b7cef09531087 | [
"Apache-2.0"
] | permissive | dpburke/Zombinator | 51f75fe0d9c135fb129b3942b6ff43b05f93189d | ce91b8e67067eb3efe792749da6288a8695e289d | refs/heads/master | 2016-09-12T14:43:31.841469 | 2016-05-10T19:17:21 | 2016-05-10T19:17:21 | 58,486,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | package GameObjects;
import Display.Grid;
/**
* Created by dburke0731 on 4/21/2016.
*/
public class ExitButton extends MappableObject
{
private ExitButton(int x, int y, Grid grid, Grid hoverGrid)
{
super(x,y,grid,hoverGrid);
}
public static ExitButton createExitButton(int x, int y, Grid grid, Grid hoverGrid)
{
ExitButton out = new ExitButton(x,y,grid,hoverGrid);
return out;
}
@Override
public void interact() {
}
}
| [
"d.p.burkee@gmail.com"
] | d.p.burkee@gmail.com |
16d9c45b29f2915e51a15d314a34f1533df85e65 | 6a02ef935242839223042af78257f35192ebd4db | /hrms/src/main/java/kodlama/io/hrms/dataAccess/abstracts/ImageDao.java | 7e042873c7acac36c67cfef80571da54beac6721 | [] | no_license | ayselmehmetzade/JavaHrmsProject | 5d1e135372628ea3b72446e312989426239958fc | 97bbfb58ce57274919694284f205c9a4e4643a0e | refs/heads/master | 2023-05-28T17:01:24.719849 | 2021-06-13T16:47:22 | 2021-06-13T16:47:22 | 367,723,842 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package kodlama.io.hrms.dataAccess.abstracts;
import org.springframework.data.jpa.repository.JpaRepository;
import kodlama.io.hrms.entities.concretes.Image;
public interface ImageDao extends JpaRepository<Image, Integer> {
Image getById(int id);
Image getByJobSeeker_id(int id);
}
| [
"ayselmehmetzade@hotmail.com"
] | ayselmehmetzade@hotmail.com |
ddefe2dba6eaeafc360627848bc4c0a4b2580ee3 | b0f99357a66a0286a44685b050a5eea0967a8371 | /src/Menu.java | e8a979e5e5bb1f613edc8159ff3051e8eae189e5 | [] | no_license | al-shafi/Railway-Ticketing-System | 253e983531f5a0491d5f75b7a3ab5e28d5e159c5 | 6fdd780fd0de5a2722b9076bd7a2fa6aa981e0d3 | refs/heads/master | 2022-12-29T22:52:45.507105 | 2020-10-20T09:54:51 | 2020-10-20T09:54:51 | 305,659,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,716 | java |
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextField;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class Menu implements ActionListener{
//WINDOW FRAME
private JFrame frame;
private JFrame frame2;
private JFrame frame3;
private JFrame frame4;
private JFrame frame5;
private JFrame frame6;
private JFrame frame7;
//SET MENUBAR.....
private JMenuBar menubar;
private JMenu file;
private JMenu edit;
private JMenu source;
private JMenu refactor;
private JMenu navigate;
private JMenu window;
private JMenu help;
//file item
private JMenuItem n;
private JMenuItem open;
private JMenuItem save;
private JMenuItem saveas;
private JMenuItem rename;
private JMenuItem exit;
//edit item
private JMenuItem undo;
private JMenuItem copy;
private JMenuItem cut;
private JMenuItem paste;
private JMenuItem delete;
private JButton reservation;
private JButton counter;
private JButton traininfo;
private JButton fare;
private JButton cancel;
private JButton term;
private JButton home;
private JButton submit;
private JButton clear;
private JButton previous;
//RESERVATION'S INTERFACE
//LABELS
private JLabel strain;
private JLabel destination;
private JLabel stpoint;
private JLabel sclass;
private JLabel fareL;
private JLabel name;
private JLabel phn;
private JLabel age;
//RESERVATION'S JTEXTFIELDS
private JTextField fareT;
private JTextField nseat;
private JTextField nameT;
private JTextField phnT;
private JTextField ageT;
//RESERVATION'S JCOMBOBOX
private JComboBox strainC;
private JComboBox destinationC;
private JComboBox stpointC;
private JComboBox sclassC;
//COUNTER CHECK INTERFACE
//LEBELS
private JLabel tseat;
private JLabel sold;
private JLabel aseat;
//TEXTFIELDS
private JTextField tseatT;
private JTextField soldT;
private JTextField aseatT;
//TRAIN INFORMATION INTERFACE
//Cancel reservation interface
private JTextField srchT;
private JButton srch;
private Person[] persons;
public Menu(){
frame = new JFrame();
reservation = new JButton("RESERVATION");
counter= new JButton("COUNTER CHECK");
traininfo = new JButton("TRAIN INFORMATION");
fare = new JButton("FARE");
cancel = new JButton("CANCEL RESERVATION");
term = new JButton("TERM & POLICY");
menubar = new JMenuBar();
file = new JMenu("File");
n = new JMenuItem("New");
n.addActionListener(this);
open = new JMenuItem("Open");
open.addActionListener(this);
save = new JMenuItem("Save");
save.addActionListener(this);
saveas = new JMenuItem("Save as");
saveas.addActionListener(this);
rename = new JMenuItem("Rename");
rename.addActionListener(this);
exit = new JMenuItem("Exit");
exit.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
});
edit= new JMenu("Edit");
edit.addActionListener(this);
undo = new JMenuItem("Undo Typing");
undo.addActionListener(this);
copy = new JMenuItem("Copy");
copy.addActionListener(this);
cut= new JMenuItem("Cut");
cut.addActionListener(this);
paste= new JMenuItem("Paste");
paste.addActionListener(this);
delete= new JMenuItem("Delete");
delete.addActionListener(this);
source= new JMenu("Source");
refactor= new JMenu("Refactor");
navigate= new JMenu("Navigate");
window = new JMenu("Window");
help = new JMenu("Help");
reservation.addActionListener(this);
counter.addActionListener(this);
traininfo.addActionListener(this);
fare.addActionListener(this);
cancel.addActionListener(this);
term.addActionListener(this);
GridLayout g = new GridLayout(3,2);
frame.setLayout(g);
frame.add(reservation);
frame.add(counter);
frame.add(traininfo);
frame.add(fare);
frame.add(cancel);
frame.add(term);
frame.setJMenuBar(menubar);
menubar.add(file);
menubar.add(edit);
menubar.add(source);
menubar.add(refactor);
menubar.add(navigate);
menubar.add(window);
menubar.add(help);
file.add(n);
file.add(open);
file.add(save);
file.add(saveas);
file.add(rename);
file.add(exit);
edit.add(undo);
edit.add(copy);
edit.add(cut);
edit.add(paste);
edit.add(delete);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 260);
frame.setLocation(200, 100);
frame.setTitle("বাংলাদেশ রেলওয়ে");
}
public void writeToFile(){ // write the student records from array to file
try {
File f = new File("E:\\Study\\Course\\CSE215L\\Project\\src\\Railway.txt");
FileWriter fw = new FileWriter(f);
for(int i = 0; i < persons.length; i++){
if(persons[i] != null){
fw.write("Name :" +persons[i].getName()); // write id in one line
fw.write("\n");
fw.write("Phone Number :"+persons[i].getPhn()); // write name in another line
fw.write("\n");
fw.write("Age :"+persons[i].getAge());
fw.write("\n");
fw.write("Train Name :"+persons[i].getStrain());
fw.write("\n");
fw.write("Destination :"+persons[i].getDestination());
fw.write("\n");
fw.write("Starting Point :"+persons[i].getStpoint());
fw.write("\n");
fw.write("Seat Class :"+persons[i].getSclass());
fw.write("\n");
fw.write("Fare :"+persons[i].getFare());
fw.write("\n");
}
}
fw.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void readFromFile(){ // read the students records from file and store in an array
try {
File f = new File("E:\\Study\\Course\\CSE215L\\Project\\src\\Railway.txt");
Scanner s = new Scanner(f);
persons = new Person [50]; // since we don't know the exact number of records, initialize the array to a reasonably sized one
int i = 0;
while(s.hasNextLine()){
String a = s.nextLine(); // read id;
String b = s.nextLine();
String c = s.nextLine();
String d = s.nextLine();
String e = s.nextLine();
String g = s.nextLine();
String h = s.nextLine();
String j = s.nextLine();
Person temp = new Person (a,b,c,d,e,g,h,j); // create Student object
persons[i] = temp; // store in array
i++;
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void addPerson(Person p){ // adds the student object into array
// find an available index first
int index = 0;
persons = new Person[50];
for(int i = 0; i < persons.length; i++){
if(persons[i] == null){ // location available
index = i;
break;
}
}
if(index < persons.length){
persons[index] = p;
}
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == reservation){
frame2 = new JFrame();
menubar = new JMenuBar();
file = new JMenu("File");
n = new JMenuItem("New");
n.addActionListener(this);
open = new JMenuItem("Open");
open.addActionListener(this);
save = new JMenuItem("Save");
save.addActionListener(this);
saveas = new JMenuItem("Save as");
saveas.addActionListener(this);
rename = new JMenuItem("Rename");
rename.addActionListener(this);
exit = new JMenuItem("Exit");
exit.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
});
edit= new JMenu("Edit");
edit.addActionListener(this);
undo = new JMenuItem("Undo Typing");
undo.addActionListener(this);
copy = new JMenuItem("Copy");
copy.addActionListener(this);
cut= new JMenuItem("Cut");
cut.addActionListener(this);
paste= new JMenuItem("Paste");
paste.addActionListener(this);
delete= new JMenuItem("Delete");
delete.addActionListener(this);
source= new JMenu("Source");
refactor= new JMenu("Refactor");
navigate= new JMenu("Navigate");
window = new JMenu("Window");
help = new JMenu("Help");
strain = new JLabel("SELECT TRAIN");
destination = new JLabel("DESTINATION");
stpoint = new JLabel("START TRAVELING ");
sclass = new JLabel("Class");
fareL = new JLabel("FARE");
name= new JLabel("NAME");
phn = new JLabel("CONTRACT NUMBER");
age = new JLabel("AGE");
String [] option1 = new String[]{"NONE","Subarna Express","Parabat Express","Turna Express","Lalmoni Express","Nill Shagor","Silkcity Express","DHUMKETU","CHITRA","Padma Express","Chittra Express",
"SHUNDARBAN","MOHANAGAR","Ekota Express","Rangpur Express","Agnibina Express"};
strainC = new JComboBox(option1);
String[] option2 = new String[]{"NONE","RAJSHAHI","NATORE","TANGAIL","DHAKA","ISHWARDI","CHATMOHOR","RANGPUR","KHULNA","NILPHAMARY"};
destinationC = new JComboBox(option2);
String[] option3 = new String[]{"NONE","RAJSHAHI","DHAKA","RANGPUR","KHULNA","NILPHAMARY","NATOR"};
stpointC = new JComboBox(option3);
String[] option4 = new String[]{"NONE","FIRST","SECOND","THIRD"};
sclassC = new JComboBox(option4);
fareT= new JTextField();
nseat = new JTextField();
nameT = new JTextField();
phnT = new JTextField();
ageT = new JTextField();
home= new JButton("Home");
home.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame2.setVisible(false);
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
submit = new JButton("SUBMIT");
submit.setBackground(Color.white);
submit.setForeground(Color.red);
submit.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
String y1 = nameT.getText();
String y2 = phnT.getText();
String y3 = ageT.getText();
String y4 = fareT.getText();
String x1 = strainC.getSelectedItem().toString();
String x2 = destinationC.getSelectedItem().toString();
String x3 = stpointC.getSelectedItem().toString();
String x4 = sclassC.getSelectedItem().toString();
Person p = new Person(y1,y2,y3,y4,x1,x2,x3,x4);
System.out.println(p);
addPerson(p);
writeToFile();
}
});
clear = new JButton("CLEAR");
clear.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
fareT.setText("");
nameT.setText("");
nseat.setText("");
phnT.setText("");
ageT.setText("");
strainC.setSelectedIndex(0);
destinationC.setSelectedIndex(0);
stpointC.setSelectedIndex(0);
sclassC.setSelectedIndex(0);
}
});
previous = new JButton("<");
previous.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame.setVisible(true);
frame2.setVisible(false);
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
});
GridLayout g = new GridLayout(5,2);
frame2.setLayout(g);
frame2.add(strain);
frame2.add(strainC);
frame2.add(name);
frame2.add(nameT);
frame2.add(destination);
frame2.add(destinationC);
frame2.add(phn);
frame2.add(phnT);
frame2.add(stpoint);
frame2.add(stpointC);
frame2.add(fareL);
frame2.add(fareT);
frame2.add(sclass);
frame2.add(sclassC);
frame2.add(age);
frame2.add(ageT);
frame2.add(home);
frame2.add(submit);
frame2.add(clear);
frame2.add(previous);
frame2.setJMenuBar(menubar);
menubar.add(file);
menubar.add(edit);
menubar.add(source);
menubar.add(refactor);
menubar.add(navigate);
menubar.add(window);
menubar.add(help);
file.add(n);
file.add(open);
file.add(save);
file.add(saveas);
file.add(rename);
file.add(exit);
edit.add(undo);
edit.add(copy);
edit.add(cut);
edit.add(paste);
edit.add(delete);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setVisible(true);
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setSize(500, 260);
frame2.setLocation(200, 200);
frame2.setTitle("RESERVATION");
}
if(e.getSource() == counter){
frame3 = new JFrame();
strain = new JLabel("Select Train");
tseat = new JLabel("Total Seat");
sold = new JLabel("Sold Out");
aseat = new JLabel("Available Seat");
CounterCheck c= new CounterCheck(null,null,null,null);
c.writeToFile2();
String [] option1 = new String[]{"NONE","Subarna Express","Parabat Express","Turna Express","Lalmoni Express","Nill Shagor","Silkcity Express","DHUMKETU","CHITRA","Padma Express","Chittra Express",
"SHUNDARBAN","MOHANAGAR","Ekota Express","Rangpur Express","Agnibina Exxpress"};
strainC= new JComboBox(option1);
tseatT = new JTextField();
soldT =new JTextField();
aseatT = new JTextField();
if(strainC.getSelectedItem().toString().equals("Subarna Express")){
tseatT = new JTextField();
soldT =new JTextField();
aseatT = new JTextField();
}
home= new JButton("Home");
home.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame3.setVisible(false);
frame3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
submit= new JButton("SUBMIT");
submit.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
String y1 = tseatT.getText();
String y2 = soldT.getText();
String y3 = aseatT.getText();
String x1 = strainC.getSelectedItem().toString();
CounterCheck c = new CounterCheck(y1,y2,y3,x1);
System.out.println(c);
}
});
clear =new JButton("CLEAR");
clear.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
strainC.setSelectedIndex(0);
}
});
previous = new JButton("<");
previous.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
frame3.setVisible(false);
frame3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setVisible(true);
//frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
});
GridLayout g = new GridLayout(3,2);
frame3.setLayout(g);
frame3.add(strain);
frame3.add(strainC);
frame3.add(tseat);
frame3.add(tseatT);
frame3.add(sold);
frame3.add(soldT);
frame3.add(aseat);
frame3.add(aseatT);
frame3.add(home);
frame3.add(submit);
frame3.add(clear);
frame3.add(previous);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame3.setVisible(true);
frame3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame3.setSize(500, 260);
frame3.setLocation(200, 200);
frame3.setTitle("COUNTER CHECK");
}
if(e.getSource() == traininfo){
frame4= new JFrame();
GridLayout g =new GridLayout(1,1);
frame4.setLayout(g);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame4.setVisible(true);
frame4.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame4.setSize(500, 260);
frame4.setLocation(200, 200);
frame4.setTitle("TRAIN INFORMATION");
}
if(e.getSource() == fare){
frame5= new JFrame();
GridLayout g= new GridLayout(1,1);
frame5.setLayout(g);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame5.setVisible(true);
frame5.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame5.setSize(500, 260);
frame5.setLocation(200, 200);
frame5.setTitle("FARE");
}
if(e.getSource() == cancel){
frame6= new JFrame();
srchT = new JTextField();
srch = new JButton("Search");
srch.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e) {
}
});
GridLayout g= new GridLayout(2,2);
frame6.setLayout(g);
frame6.add(srchT);
frame6.add(srch);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame6.setVisible(true);
frame6.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame6.setSize(500, 260);
frame6.setLocation(200, 200);
frame6.setTitle("CANCEL RESERVATION");
}
if(e.getSource() == term){
frame7= new JFrame();
GridLayout g= new GridLayout(1,1);
frame7.setLayout(g);
frame.setVisible(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame7.setVisible(true);
frame7.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame7.setSize(500, 260);
frame7.setLocation(200, 200);
frame7.setTitle("TERM & POLICY");
}
}
}
| [
"pmd.shafi28@gmail.com"
] | pmd.shafi28@gmail.com |
b5854b57ae1190cd280fc26029991f80ecb94486 | 70dd59fbfaabc065b3ac7f4c375cc5f894bf0e07 | /src/array/leetcode_123/Solution.java | f4348daea9e717c12f766af6e600cb0ce94c06ae | [] | no_license | ArgenBarakanov/leetcode | c109ecf0542e0db3659474da310e5ffb2e7351c5 | f7c505f33060c688f7be7a589a281c2985e22489 | refs/heads/master | 2021-07-12T03:50:21.512477 | 2020-08-09T20:08:01 | 2020-08-09T20:08:01 | 178,413,529 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,729 | java | package array.leetcode_123;
public class Solution {
public int maxProfit(int[] prices) {
if (prices.length == 0) return 0;
int[][] dp = new int[3][prices.length];
for (int k = 1; k <= 2; k++) {
int min = prices[0];// для каждой транзакции
for (int i = 1; i < prices.length; i++) {
//находим так чтобы цена была наименьшей а первая транзакция наибольшей
min = Math.min(min, prices[i] - dp[k - 1][i - 1]);
// мы находим такую цену чтоб если от нее отнять первую транзакцию то получим максимальный минимум. это означает что
//с такой ценой продав ее в будущем мы найдем наиболее подходящий день для продажи. крч очень сложно. на вью если спросят сделай попроще а затем вспомнишь
dp[k][i] = Math.max(dp[k][i - 1], prices[i] - min);//эта штука необязательно меняется каждую итерацию
}
}
for (int i = 0; i < dp.length; i++) {
for (int j = 0; j < dp[i].length; j++) {
System.out.print(dp[i][j] + " ");
}
System.out.println();
}
return dp[2][prices.length - 1];
}
public static void main(String[] args) {
int[] price = {3, 3, 5, 0, 3, 1, 4};
Solution solution = new Solution();
System.out.println(solution.maxProfit(price));
}
}
| [
"argen.barakanov@mail.ru"
] | argen.barakanov@mail.ru |
957461508b580401b099502b275dd7e9c0c0047c | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/AssociateLexBotResult.java | 282c0d6b0683bb8e945f964b9a7ec32da1a9779a | [
"Apache-2.0"
] | permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 2,336 | java | /*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.connect.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/AssociateLexBot" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AssociateLexBotResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociateLexBotResult == false)
return false;
AssociateLexBotResult other = (AssociateLexBotResult) obj;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
return hashCode;
}
@Override
public AssociateLexBotResult clone() {
try {
return (AssociateLexBotResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
5399267762f3a42f12a89c5461ae066a09b1c6d2 | 5bab77c7e9924c64c6d8be041279bbd95c530a31 | /project2/src/main/java/projecttwo/app/config/appSetup/model/AppProperties.java | a2f8351347a785dcd959929b06dc0d9553c6aba5 | [] | no_license | applifireAlgo/hello | cd11832c46f8ac82d742f264145ac9f94642f859 | 60e3cd06da7518cc7fb98f53bb37f20f099e282b | refs/heads/master | 2020-05-21T11:23:46.641853 | 2016-08-24T09:30:06 | 2016-08-24T09:30:06 | 43,746,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package projecttwo.app.config.appSetup.model;
public final class AppProperties {
private final String searchEngineDocResultFields;
private final String searchengineSearchLanguage;
private final int authenticationType;
private final String ldapDomain;
private final String ldapUrl;
private final String solrProjectUrl;
public AppProperties(String searchEngineDocResultFields, String searchengineSearchLanguage, int authenticationType, String ldapDomain, String ldapUrl, String baseProjectUrl) {
super();
this.searchEngineDocResultFields = searchEngineDocResultFields;
this.searchengineSearchLanguage = searchengineSearchLanguage;
this.authenticationType = authenticationType;
this.ldapDomain = ldapDomain;
this.ldapUrl = ldapUrl;
this.solrProjectUrl = baseProjectUrl;
}
public String getSearchEngineDocResultFields() {
return searchEngineDocResultFields;
}
public String getSearchengineSearchLanguage() {
return searchengineSearchLanguage;
}
public int getAuthenticationType() {
return authenticationType;
}
public String getLdapDomain() {
return ldapDomain;
}
public String getLdapUrl() {
return ldapUrl;
}
public String getSolrProjectUrl() {
return solrProjectUrl;
}
@Override
public String toString() {
return "AppProperties [searchEngineDocResultFields=" + searchEngineDocResultFields + ", searchengineSearchLanguage=" + searchengineSearchLanguage + ", authenticationType="
+ authenticationType + ", ldapDomain=" + ldapDomain + ", ldapUrl=" + ldapUrl + ", baseProjectUrl=" + solrProjectUrl + "]";
}
}
| [
"applifire@49a7965c2d9e"
] | applifire@49a7965c2d9e |
44ce784c441db5dee6aae6ddf392957f5803057b | b1093691d94e6cca9054d267c50a3626b7606c08 | /app/src/main/java/bitspilani/goa/letsPlay/services/BillshareService.java | 8186ecea3d1dcd519bc0df8f387e67d325d04831 | [] | no_license | prateekgupta3991/billshare-app | d65f1557d68c5854ad643d2e72f3f26b557617c2 | c89428ac23b4aa61b106ebd62a9435c2e2d4deaa | refs/heads/master | 2020-03-26T06:20:02.882020 | 2019-04-30T18:28:37 | 2019-04-30T18:28:37 | 144,600,018 | 0 | 0 | null | 2019-04-19T04:45:04 | 2018-08-13T15:39:16 | Java | UTF-8 | Java | false | false | 1,945 | java | package bitspilani.goa.letsPlay.services;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import java.util.List;
import java.util.concurrent.Callable;
import bitspilani.goa.letsPlay.activities.GetData;
import bitspilani.goa.letsPlay.dtos.UserResponseDto;
import bitspilani.goa.letsPlay.retrofit.BillshareApiService;
import bitspilani.goa.letsPlay.retrofit.RestClient;
import bitspilani.goa.letsPlay.retrofit.RestPropagateCallback;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static android.content.ContentValues.TAG;
public class BillshareService extends Activity {
private BillshareApiService billshareApiService;
private RestClient restClient;
public BillshareService() {
restClient = new RestClient();
billshareApiService = restClient.initialiseRestClient().create(BillshareApiService.class);
}
/**
* Not working yet
* Need to figure this cos this is configurable and reusable code rather than existing implementation
* @param callback
*/
public void getUsers(RestPropagateCallback callback) {
try {
Call<List<UserResponseDto>> call = billshareApiService.getUsers();
call.enqueue(new Callback<List<UserResponseDto>>() {
@Override
public void onResponse(Call<List<UserResponseDto>> call, Response<List<UserResponseDto>> response) {
if (response.isSuccessful() && response.body() != null) {
callback.apiResponse(response.body());
}
}
@Override
public void onFailure(Call<List<UserResponseDto>> call, Throwable t) {
System.out.println("Call failed");
}
});
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
}
| [
"prateek.gupta@swiggy.in"
] | prateek.gupta@swiggy.in |
f9741c09bd6557e35a76c1623646082976b15dce | 4abeadbaaf3666d7b9cb4acf0203f1413456876f | /Project/Source/Project Src/Phase-II/src/main/java/com/dpa/controllers/DegreePlanController.java | 12a1fe4611a914b0102642c9fce1c89c5a8b1c41 | [] | no_license | SriharshiniV/Degree-Plan | 8a9bb9ea757c99ead6b60282d228e3c48881e677 | 283ef437d4e0031a2756f24539882a6335d4d4f8 | refs/heads/master | 2020-04-14T22:38:19.101114 | 2018-11-27T02:43:31 | 2018-11-27T02:43:31 | 164,171,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,997 | java | package com.dpa.controllers;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.dpa.General.Pdf;
import com.dpa.model.Courses;
import com.dpa.model.DegreePlan;
import com.dpa.model.GRE;
import com.dpa.model.Request;
import com.dpa.service.DegreePlanService;
import com.dpa.service.RetrieveUsersService;
//handles the view, submit, save and all other degree plan action requests
@Controller
public class DegreePlanController {
@Autowired
DegreePlanService degreePlanService;
@Autowired
RetrieveUsersService retrieveUsersService;
@Autowired
RetrieveUsersService retrieveStudents;
//gets mandatory and optional courses form the database and makes them available to the view degreepla.jsp
@RequestMapping(value = "/degreeplan", method = RequestMethod.POST)
public String openDegreePlan(@RequestParam String selectPlan,@RequestParam String majProfessor, HttpServletRequest request, HttpServletResponse response, ModelMap model){
model.put("major", selectPlan);
model.put("majorProfessor", majProfessor);
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
List<Integer> optionalCourses = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8);
model.addAttribute("groupACourses", degreePlanService.getGroupACourses(selectPlan));
model.addAttribute("groupBCourses", degreePlanService.getGroupBCourses(selectPlan));
model.addAttribute("groupCCourses", degreePlanService.getGroupCCourses(selectPlan));
model.addAttribute("groupDCourses", degreePlanService.getGroupDCourses(selectPlan));
model.addAttribute("optionalCourses", optionalCourses);
model.addAttribute("optionalCourseLists", degreePlanService.getOptionalCourses());
return "degreeplan";
} else {
return "login";
}
}
//redirects user to the degree plan page with the success message upon success else to the degree plan with error message
@RequestMapping(value = "/degreeplanform", method = RequestMethod.POST)
public String submitDegreePlan(@ModelAttribute DegreePlan degreePlan, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.submitDegreePlan(degreePlan, userName);
model.put("success", "Degree Plan Submitted Successfully");
return "degreeplan";
} else {
model.put("error", "Submission Failed");
return "degreeplan";
}
}
//method that returns a vieDegreePlan page with the model data of the page
@RequestMapping(value = "/viewdegreeplan", method = RequestMethod.GET)
public String viewPlan(@RequestParam(value = "uName", required = false) String uName, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
model.addAttribute("degreePlan", degreePlanService.viewDegreePlan(uName, userName));
model.addAttribute("gre", degreePlanService.getGREScores(uName));
model.addAttribute("courses", degreePlanService.getCourses(uName));
return "viewdegreeplan";
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/submitToAdminSpecialist", method = RequestMethod.POST)
public String submitToAdminSpecialist(@RequestParam String sign, @RequestParam String sName, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
model.addAttribute("degreePlan", degreePlanService.viewDegreePlan(sName, userName));
model.addAttribute("gre", degreePlanService.getGREScores(sName));
model.addAttribute("courses", degreePlanService.getCourses(sName));
int result = degreePlanService.submitToAdminSpecialist(userName, sName, sign);
if(result != 0) {
model.put("success", "Degree Plan Successfully submitted to Admin Specialist");
return "viewdegreeplan";
}else {
model.put("error", "Submission Failed, try again");
return "viewdegreeplan";
}
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/submitToAS", method = RequestMethod.POST)
public String submitToASL2(@RequestParam String sign, @RequestParam String sName, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.submitToASL2(userName, sName, sign);
if(result != 0) {
model.put("success", "Degree Plan approved");
model.addAttribute("receivedDegreePlansLevel2", degreePlanService.getReceivedDegreePlansLevel2(userName));
model.addAttribute("myStudents", retrieveStudents.getMyStudents(userName));
return "associatechairhome";
}else {
model.put("error", "Approval Failed");
model.addAttribute("receivedDegreePlansLevel2", degreePlanService.getReceivedDegreePlansLevel2(userName));
model.addAttribute("myStudents", retrieveStudents.getMyStudents(userName));
return "associatechairhome";
}
} else {
return "login";
}
}
@RequestMapping(value = "/submitToAS2", method = RequestMethod.POST)
public String submitToASL3(@RequestParam String sign, @RequestParam String sName, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.submitToASL3(userName, sName, sign);
if(result != 0) {
model.put("success", "Degree Plan approved");
model.addAttribute("receivedDegreePlansLevel3", degreePlanService.getReceivedDegreePlansLevel3(userName));
model.addAttribute("myStudents", retrieveStudents.getMyStudents(userName));
return "associatechairhome";
}else {
model.put("error", "Approval Failed");
model.addAttribute("receivedDegreePlansLevel3", degreePlanService.getReceivedDegreePlansLevel3(userName));
model.addAttribute("myStudents", retrieveStudents.getMyStudents(userName));
return "associatechairhome";
}
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/submitToAssociateChair", method = RequestMethod.POST)
public String submitToAssociateChair(@RequestParam String sName, @RequestParam int studentId, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.submitToAssociateChair(studentId, sName);
if(result != 0) {
model.put("success", "Degree Plan Successfully submitted to Associate Chair");
model.addAttribute("degreePlans", degreePlanService.getDegreePlans());
return "adminspecialisthome";
}else {
model.put("error", "Submission Failed, try again");
return "adminspecialisthome";
}
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/submitToChair", method = RequestMethod.POST)
public String submitToChair(@RequestParam String sName, @RequestParam int studentId, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.submitToChair(studentId, sName);
if(result != 0) {
model.put("success", "Degree Plan Successfully submitted to Associate Chair");
model.addAttribute("degreePlans", degreePlanService.getDegreePlans());
return "adminspecialisthome";
}else {
model.put("error", "Submission Failed, try again");
return "adminspecialisthome";
}
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/sendApprovaltoStudent", method = RequestMethod.POST)
public String sendApprovaltoStudent(@RequestParam String sName, @RequestParam int studentId, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.sendApprovaltoStudent(studentId, sName);
if(result != 0) {
model.put("success", "Approval Sent to student");
model.addAttribute("degreePlans", degreePlanService.getDegreePlans());
return "adminspecialisthome";
}else {
model.put("error", "Sending Failed, try again");
return "adminspecialisthome";
}
} else {
return "login";
}
}
//It redirects professor to add reject comments page
@RequestMapping(value = "/rejectDP", method = RequestMethod.GET)
public String rejectComments(@RequestParam(value = "sName", required = false) String sName, ModelMap model) {
model.put("studentName", sName);
return "rejectcomments";
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/degreePlanReject", method = RequestMethod.POST)
public String dPProfessorReject(@RequestParam String studentName, @RequestParam String comments, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
int result = degreePlanService.dPProfessorreject(userName, studentName, comments);
if(result != 0) {
model.put("success", "Comments submitted to the student");
return "rejectcomments";
}else {
model.addAttribute("degreePlan", degreePlanService.viewDegreePlan(studentName, userName));
model.addAttribute("gre", degreePlanService.getGREScores(studentName));
model.addAttribute("courses", degreePlanService.getCourses(studentName));
return "viewdegreeplan";
}
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/viewDPStatus", method = RequestMethod.POST)
public String viewDPStatus(@RequestParam String majorProfessor, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
String dpStatus = degreePlanService.getDPStatus(userName, majorProfessor);
if(dpStatus.equals("submitted")) {
dpStatus = "With Professor";
}
model.put("degreePlanStatus", dpStatus);
List<Request> myAdvisors = retrieveUsersService.getMyAdvisors(userName);
model.addAttribute("myAdvisors", myAdvisors);
if(dpStatus.equals("Professor Rejected") || dpStatus.equals("AdminSpecialist Rejected") || dpStatus.equals("AssociateChair Rejected") || dpStatus.equals("Chair Rejected")) {
String rejectComments = degreePlanService.getComments(userName, majorProfessor);
model.put("rejectComments", rejectComments);
model.put("resubmitDP", "Update and resubmit the Degree Plan");
}else if(dpStatus.equals("Degree Plan approved in the CSCE Department")) {
model.put("downloadDP","Download the Approved Degree Plan");
}
return "studenthome";
} else {
return "login";
}
}
//This method submits the degree plan to the administrative specialist
@RequestMapping(value = "/updateDegreePlan", method = RequestMethod.POST)
public String updateDegreePlan(HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
model.addAttribute("degreePlan", degreePlanService.getDegreePlan(userName));
model.addAttribute("gre", degreePlanService.getGREScores(userName));
model.addAttribute("courses", degreePlanService.getCourses(userName));
List<Request> myAdvisors = retrieveUsersService.getMyAdvisors(userName);
model.addAttribute("myAdvisors", myAdvisors);
return "updatedegreeplan";
} else {
return "login";
}
}
//updates and resubmits degree plan
@RequestMapping(value = "/updatedegreeplan", method = RequestMethod.POST)
public String updatetDegreePlan(@ModelAttribute DegreePlan degreePlan, HttpServletRequest request, HttpServletResponse response, ModelMap model){
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
degreePlanService.updateDegreePlan(degreePlan, userName);
model.put("success", "Degree Plan Submitted Successfully");
return "degreeplan";
} else {
model.put("error", "Submission Failed");
return "degreeplan";
}
}
//This method gets the submitted degree plan data
@RequestMapping(value = "/receivedDegreePlan", method = RequestMethod.POST)
public String receivedDegreePlan(@RequestBody String studentDetails, HttpServletRequest request, HttpServletResponse response, ModelMap model) {
HttpSession session = request.getSession(false);
if (session != null) {
String[] sDetails = studentDetails.split("=");
String[] sD = sDetails[1].split("&");
String sName = sD[0];
String sId = sDetails[2];
DegreePlan degreePlan = degreePlanService.getReceivedDP(sName, sId);
model.addAttribute("degreePlan", degreePlan);
model.addAttribute("gre", degreePlanService.getGREScores(sName));
model.addAttribute("courses", degreePlanService.getCourses(sName));
if((degreePlan.getDegreePlanStatus()).equals("With Administrative Specialist")) {
return "dp_AS_View";
}else if((degreePlan.getDegreePlanStatus()).equals("Chair Approved")){
return "dp_AS_S_View";
}else {
return "dp_AS_C_View";
}
} else {
return "login";
}
}
//This method gets the submitted degree plan data
@RequestMapping(value = "/receivedDegreePlanAS", method = RequestMethod.POST)
public String receivedDegreePlanAS(@RequestBody String studentDetails, HttpServletRequest request, HttpServletResponse response, ModelMap model) {
HttpSession session = request.getSession(false);
if (session != null) {
String[] sDetails = studentDetails.split("=");
String[] sD = sDetails[1].split("&");
String sName = sD[0];
String sId = sDetails[2];
model.addAttribute("degreePlan", degreePlanService.getReceivedDP(sName, sId));
model.addAttribute("gre", degreePlanService.getGREScores(sName));
model.addAttribute("courses", degreePlanService.getCourses(sName));
return "dpAssociateChairView";
} else {
return "login";
}
}
//This method gets the submitted degree plan data
@RequestMapping(value = "/receivedDegreePlanAS2", method = RequestMethod.POST)
public String receivedDegreePlanAS2(@RequestBody String studentDetails, HttpServletRequest request, HttpServletResponse response, ModelMap model) {
HttpSession session = request.getSession(false);
if (session != null) {
String[] sDetails = studentDetails.split("=");
String[] sD = sDetails[1].split("&");
String sName = sD[0];
String sId = sDetails[2];
model.addAttribute("degreePlan", degreePlanService.getReceivedDP(sName, sId));
model.addAttribute("gre", degreePlanService.getGREScores(sName));
model.addAttribute("courses", degreePlanService.getCourses(sName));
return "dpChairView";
} else {
return "login";
}
}
//This method will download the approved degree plan
@RequestMapping(value = "/viewApprovedDP", method = RequestMethod.POST)
public String downloadApprovedDP(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
HttpSession session = request.getSession(false);
if (session != null) {
String userName = (String) session.getAttribute("userName");
DegreePlan degreePlan = degreePlanService.getDegreePlan(userName);
GRE gre = degreePlanService.getGREScores(userName);
List<Courses> courses = degreePlanService.getCourses(userName);
List<Request> myAdvisors = retrieveUsersService.getMyAdvisors(userName);
model.addAttribute("myAdvisors", myAdvisors);
Pdf pdf = new Pdf();
int r = pdf.generatePdf(degreePlan, gre, courses);
return "studenthome";
}else {
return "login";
}
}
}
| [
"sharanyagottimukkula@my.unt.edu"
] | sharanyagottimukkula@my.unt.edu |
7c843273b0ba56eb18eb8da35e32a8ba9e44c917 | 7438d39a27c6c3a9e9adae66c6e9ef8765e6f59e | /src/main/java/com/pm/background/common/weixinUtils/CertHttpUtil.java | cb95da90c33c48f50958e5111f7d043bf800cd6b | [] | no_license | yaoas/gongyi | 0bb21a410f140c2611ec0c04798cbdfc96afe1dc | a9ff2936465760db26fbbea2c7e89549f401611a | refs/heads/master | 2022-10-26T01:56:13.453495 | 2019-11-25T06:40:35 | 2019-11-25T06:40:35 | 219,651,729 | 0 | 0 | null | 2022-10-12T20:34:12 | 2019-11-05T03:42:12 | Java | UTF-8 | Java | false | false | 4,089 | java | package com.pm.background.common.weixinUtils;
/**
* @ClassName CertHttpUtil
* @Description TODO
* @Author yaoas
* @Date 2019/10/15 15:09
* @Version 1.0
*/
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.core.io.ClassPathResource;
import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore;
/**
* 获取微信apiclient_cert.p12证书
*
* @author zengwei
* @email 15797630391@163.com
* @date 2018年4月5日 下午4:49:36
*/
public class CertHttpUtil {
private static int socketTimeout = 10000;// 连接超时时间,默认10秒
private static int connectTimeout = 30000;// 传输超时时间,默认30秒
private static RequestConfig requestConfig;// 请求器的配置
private static CloseableHttpClient httpClient;// HTTP请求器
/**
* 通过Https往API post xml数据
*
* @param url API地址
* @param xmlObj 要提交的XML数据对象
* @param mchId 商户ID
* @param certPath 证书位置
* @return
*/
public static String postData(String url, String xmlObj, String mchId, String certPath) {
// 加载证书
try {
initCert(mchId, certPath);
} catch (Exception e) {
e.printStackTrace();
}
String result = null;
HttpPost httpPost = new HttpPost(url);
// 得指明使用UTF-8编码,否则到API服务器XML的中文不能被成功识别
StringEntity postEntity = new StringEntity(xmlObj, "UTF-8");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.setEntity(postEntity);
// 根据默认超时限制初始化requestConfig
requestConfig = RequestConfig.custom().setSocketTimeout(socketTimeout).setConnectTimeout(connectTimeout).build();
// 设置请求器的配置
httpPost.setConfig(requestConfig);
try {
HttpResponse response = null;
try {
response = httpClient.execute(httpPost);
} catch (IOException e) {
e.printStackTrace();
}
HttpEntity entity = response.getEntity();
try {
result = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
}
} finally {
httpPost.abort();
}
return result;
}
/**
* 加载证书
*
* @param mchId 商户ID
* @param certPath 证书位置
* @throws Exception
*/
private static void initCert(String mchId, String certPath) throws Exception {
// 证书密码,默认为商户ID
String key = mchId;
// 证书的路径
String path = certPath;
// 指定读取证书格式为PKCS12
KeyStore keyStore = KeyStore.getInstance("PKCS12");
// 读取本机存放的PKCS12证书文件
ClassPathResource cp = new ClassPathResource(AuthUtil.CERTPATH);
InputStream instream = cp.getInputStream();
try {
// 指定PKCS12的密码(商户ID)
keyStore.load(instream, key.toCharArray());
} finally {
instream.close();
}
SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, key.toCharArray()).build();
SSLConnectionSocketFactory sslsf =
new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1"}, null,
SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
}
}
| [
"787663136@qq.com"
] | 787663136@qq.com |
b54e2d00104c596beb2d849b26368a3f23e143af | 7e1d384d29485f451a471f318c84dd73d4b13a9b | /Hasseling/app/src/main/java/be/pxl/hasseling/Module/Distance.java | 4027909bcd870e114243846233250ec6807ca7b1 | [] | no_license | nasim-shabani/MobileDev_Project | ce177389e630ba9aedd7070fc83f3cb5692d0736 | 262fafff2b47d04d8dacc690551268a61ad383fd | refs/heads/master | 2021-08-08T18:18:44.776975 | 2017-11-10T21:38:07 | 2017-11-10T21:38:07 | 104,931,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java | package be.pxl.hasseling.Module;
public class Distance {
public String text;
public int value;
public Distance(String text, int value) {
this.text = text;
this.value = value;
}
} | [
"Nasim.ShabaniLalani@student.pxl.be"
] | Nasim.ShabaniLalani@student.pxl.be |
76cf58025214365a9e1da73573e6eab24282d7f7 | 998be217843cbcb3645baf713880b784b32d37d7 | /basic-01/src/com/example/Lambda/Demo01/Person.java | 91a4008d1989659dd281ab63811fdac96714264c | [] | no_license | 752391183/basic-coding | 313b43d76444d5a7e1e5f0f3ce8c740839c6c60f | f20c453f1dbe495955b01e6b45ddcc385cb2aecc | refs/heads/master | 2023-01-19T09:25:04.490443 | 2020-11-30T07:29:39 | 2020-11-30T07:29:39 | 289,442,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 656 | java | package com.example.Lambda.Demo01;
public class Person {
private String name;
private int age;
public Person() {
}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Person{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}
| [
"yqdhgqd999"
] | yqdhgqd999 |
a5f30402942d44bc959739e84466550bc0cda758 | 4e07d27227723880e7c74dc57624fa1f4ec9a0d1 | /data/src/main/java/mx/gob/economia/inadem/entity/solicitud/Programa.java | 55b12352a378965eb8d4b26133530f7ed12372dc | [] | no_license | iamedu/oracle-vagrant | a565efb02401478ed9c64e32eb7ff2d94c64cd9b | 9c1477135fb9ea4c56e53f90ae845dffec7832f7 | refs/heads/master | 2021-01-01T16:34:15.147118 | 2013-03-08T22:53:55 | 2013-03-08T22:53:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package mx.gob.economia.inadem.entity.solicitud;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import mx.gob.economia.inadem.entity.catalogo.Catalogo;
@Entity
@Table(name="PROGRAMA")
public class Programa extends Catalogo {
private static final long serialVersionUID = 1L;
@ManyToOne(fetch=FetchType.LAZY,optional=false)
private Direccion direccion;
@OneToMany(mappedBy="programa",orphanRemoval=true)
private List<Convocatoria> convocatorias;
public Direccion getDireccion() {
return direccion;
}
public void setDireccion(Direccion direccion) {
this.direccion = direccion;
}
public List<Convocatoria> getConvocatorias() {
return convocatorias;
}
public void setConvocatorias(List<Convocatoria> convocatorias) {
this.convocatorias = convocatorias;
}
}
| [
"iamedu@Gmail.com"
] | iamedu@Gmail.com |
78611cc01cdff99dac78ba474926ad4467c1ad65 | 56312b912e319dce6701989bbfb5f6b66d0eebf9 | /src/main/java/br/com/eskinfotechweb/workshopmongodb/resources/PostResource.java | da1349e7d93c9100bbeb3ba0f48fe081f2372071 | [] | no_license | eskokado/workshop-springboot2-mongodb | 616591d71ae0b182e388d3698db5eee8dc247f43 | 6d83d28db86c2e9c45bb533c2a7fb70d17bbc076 | refs/heads/master | 2020-06-08T22:29:06.724707 | 2019-06-23T14:51:26 | 2019-06-23T14:51:26 | 193,317,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,884 | java | package br.com.eskinfotechweb.workshopmongodb.resources;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import br.com.eskinfotechweb.workshopmongodb.domain.Post;
import br.com.eskinfotechweb.workshopmongodb.resources.util.URL;
import br.com.eskinfotechweb.workshopmongodb.services.PostService;
@RestController
@RequestMapping(value = "/posts")
public class PostResource {
@Autowired
private PostService service;
@GetMapping("/{id}")
public ResponseEntity<Post> findById(@PathVariable String id) {
Post obj = service.findById(id);
return ResponseEntity.ok().body(obj);
}
@GetMapping("/titlesearch")
public ResponseEntity<List<Post>> findByTitle(@RequestParam(value = "text", defaultValue = "") String text) {
text = URL.decodeParam(text);
List<Post> list = service.findByTitle(text);
return ResponseEntity.ok().body(list);
}
@RequestMapping(value="/fullsearch", method=RequestMethod.GET)
public ResponseEntity<List<Post>> fullSearch(
@RequestParam(value="text", defaultValue="") String text,
@RequestParam(value="minDate", defaultValue="") String minDate,
@RequestParam(value="maxDate", defaultValue="") String maxDate) {
text = URL.decodeParam(text);
Date min = URL.convertDate(minDate, new Date(0L));
Date max = URL.convertDate(maxDate, new Date());
List<Post> list = service.fullSearch(text, min, max);
return ResponseEntity.ok().body(list);
}
}
| [
"eskokado@gmail.com"
] | eskokado@gmail.com |
2b079688a704c3750a2b4588e6d4bd32792eb95d | 47eb5bf54da6c19ca175fc8938ca9b6a2b545dfa | /euicc-cs-profile/src/main/java/com/whty/euicc/profile/securityDomain/bean/Ts102226SIMFileAccessToolkitParameter.java | dcd8c87a36a82db648dd577c43a138e77d204a1b | [] | no_license | liszhu/whatever_ty | 44ddb837f2de19cb980c28fe06e6634f9d6bd8cb | e02ef9e125cac9103848c776e420edcf0dcaed2f | refs/heads/master | 2021-12-13T21:37:06.539805 | 2017-04-05T01:50:23 | 2017-04-05T01:50:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.whty.euicc.profile.securityDomain.bean;
import com.whty.euicc.profile.parent.JavaBean;
/**
* SecurityDomain子元素
* 结构类型:简单类型
* @author Administrator
*
*/
public class Ts102226SIMFileAccessToolkitParameter extends JavaBean{
private String tag ="CA";
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
@Override
public String toString() {
return "Ts102226SIMFileAccessToolkitParameter [length=" + length + ", tag=" + tag + ", value="
+ value + "]";
}
}
| [
"652241956@qq.com"
] | 652241956@qq.com |
2446a9df6b37eb622c5ca9391dc957f17b0d177f | 4bc33e4b6a379665e4d48a291903303ecddf1948 | /pet-clinic-data/src/main/java/com/example/petclinic/services/datajpa/VetDataJpaService.java | 29e4ebbd6160c5ebcdb216c4ecae145831bea003 | [] | no_license | verhoturkin/pet-clinic | e6cbfaa961aa38454a6f5a5c6b7e788309e1d48b | 883cd681686ffe481d2ba75fc82a5a6126fd35d9 | refs/heads/master | 2023-01-23T00:19:59.930987 | 2020-11-14T14:44:49 | 2020-11-14T14:44:49 | 273,048,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | package com.example.petclinic.services.datajpa;
import com.example.petclinic.model.Vet;
import com.example.petclinic.repository.VetRepository;
import com.example.petclinic.services.VetService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.Set;
/**
* created 14.11.2020
*
* @author Alexander Verkhoturkin
*/
@Service
@Profile("datajpa")
public class VetDataJpaService implements VetService {
private final VetRepository vetRepository;
public VetDataJpaService(VetRepository vetRepository) {
this.vetRepository = vetRepository;
}
@Override
public Set<Vet> findAll() {
Set<Vet> vets = new HashSet<>();
vetRepository.findAll().forEach(vets::add);
return vets;
}
@Override
public Vet findById(Long id) {
return vetRepository.findById(id).orElse(null);
}
@Override
public Vet save(Vet vet) {
return vetRepository.save(vet);
}
@Override
public void delete(Vet vet) {
vetRepository.delete(vet);
}
@Override
public void deleteById(Long id) {
vetRepository.deleteById(id);
}
}
| [
"verkhoturkin@gmail.com"
] | verkhoturkin@gmail.com |
c6308fbad9738b060b8ad2f820d39a7147bc54e1 | 043e8c777f64b2b4abf46e2f7eae07e305fb47de | /GGON/GGON/GGON/src/org/parosproxy/paros/extension/history/ProxyListenerLog.java | 07142be71efe067b8688c040a13b302a420063b2 | [] | no_license | kr276400/ggonparos | 34fe2ece0e8fc41364bb6b17396df33cedbfeaba | 585a93c0aa9c3f18e5e0eb901bd7c450a087f373 | refs/heads/master | 2020-12-06T01:49:43.084866 | 2020-01-07T11:02:19 | 2020-01-07T11:02:19 | 232,305,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,205 | java | package org.parosproxy.paros.extension.history;
import java.awt.EventQueue;
import java.util.regex.Pattern;
import org.parosproxy.paros.core.proxy.ProxyListener;
import org.parosproxy.paros.extension.ViewDelegate;
import org.parosproxy.paros.model.HistoryList;
import org.parosproxy.paros.model.HistoryReference;
import org.parosproxy.paros.model.Model;
import org.parosproxy.paros.network.HttpHeader;
import org.parosproxy.paros.network.HttpMessage;
import org.parosproxy.paros.network.HttpStatusCode;
public class ProxyListenerLog implements ProxyListener {
private ViewDelegate view = null;
private Model model = null;
private HistoryList historyList = null;
private Pattern pattern = null;
private boolean isFirstAccess = true;
public ProxyListenerLog(Model model, ViewDelegate view, HistoryList historyList) {
this.model = model;
this.view = view;
this.historyList = historyList;
}
public void setFilter(String filter) {
if (filter == null || filter.equals("")) {
pattern = null;
} else {
pattern = Pattern.compile(filter, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
}
}
public void onHttpRequestSend(HttpMessage msg) {
HttpMessage existingMsg = model.getSession().getSiteTree().pollPath(msg);
if (existingMsg != null && !existingMsg.getResponseHeader().isEmpty()) {
if (HttpStatusCode.isSuccess(existingMsg.getResponseHeader().getStatusCode())) {
return;
}
}
if (msg.getRequestHeader().getHeader(HttpHeader.IF_MODIFIED_SINCE) != null) {
msg.getRequestHeader().setHeader(HttpHeader.IF_MODIFIED_SINCE, null);
}
if (msg.getRequestHeader().getHeader(HttpHeader.IF_NONE_MATCH) != null) {
msg.getRequestHeader().setHeader(HttpHeader.IF_NONE_MATCH, null);
}
}
public void onHttpResponseReceive(final HttpMessage msg) {
int type = HistoryReference.TYPE_MANUAL;
if (isSkipImage(msg.getRequestHeader()) || isSkipImage(msg.getResponseHeader())) {
if (msg.getResponseHeader().getStatusCode() == HttpStatusCode.OK) {
type = HistoryReference.TYPE_HIDDEN;
} else {
return;
}
}
final int finalType = type;
Thread t = new Thread(new Runnable() {
public void run() {
addHistory(msg, finalType);
}
});
t.start();
}
public boolean isSkipImage(HttpHeader header) {
if (header.isImage() && !model.getOptionsParam().getViewParam().isProcessImages()) {
return true;
}
return false;
}
private void addHistory(HttpMessage msg, int type) {
HistoryReference historyRef = null;
try {
historyRef = new HistoryReference(model.getSession(), type, msg);
} catch (Exception e) {
return;
}
if (type != HistoryReference.TYPE_MANUAL && type != HistoryReference.TYPE_HIDDEN) {
return;
}
synchronized(historyList) {
if (type == HistoryReference.TYPE_MANUAL) {
if (pattern == null) {
addHistoryInEventQueue(historyRef);
} else {
StringBuffer sb = new StringBuffer();
sb.append(msg.getRequestHeader().toString());
sb.append(msg.getRequestBody().toString());
if (!msg.getResponseHeader().isEmpty()) {
sb.append(msg.getResponseHeader().toString());
sb.append(msg.getResponseBody().toString());
}
if (pattern.matcher(sb.toString()).find()) {
addHistoryInEventQueue(historyRef);
}
}
}
}
final HistoryReference ref = historyRef;
final HttpMessage finalMsg = msg;
if (EventQueue.isDispatchThread()) {
model.getSession().getSiteTree().addPath(ref, msg);
if (isFirstAccess) {
isFirstAccess = false;
view.getSiteTreePanel().expandRoot();
}
} else {
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
model.getSession().getSiteTree().addPath(ref, finalMsg);
if (isFirstAccess) {
isFirstAccess = false;
view.getSiteTreePanel().expandRoot();
}
}
});
} catch (Exception e) {
}
}
}
private void addHistoryInEventQueue(final HistoryReference ref) {
if (EventQueue.isDispatchThread()) {
historyList.addElement(ref);
} else {
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
historyList.addElement(ref);
}
});
} catch (Exception e) {
}
}
}
}
| [
"52905962+kr276400@users.noreply.github.com"
] | 52905962+kr276400@users.noreply.github.com |
5e9e44d4230cf35d80c3fd779d786b14c83bb78d | 2ef08a0c863c85144c7fa39bbdeb72cf71e6e4fb | /pem1/Ade saputra/UAS/src/uas.java | 221fdc3bf12558bccc1f1c6f18036cc029777668 | [] | no_license | ricots/awesome_praktikum_unikama | d2b32a1e9a6b9b3dc385d5aa56be98d10912d235 | cd85d38c1a74e23e51ba2a3aa16f4e39ac66a302 | refs/heads/master | 2021-01-13T02:54:09.530015 | 2016-12-22T00:12:56 | 2016-12-22T00:12:56 | 77,028,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 27,746 | java | import java.util.Scanner;
import javax.swing.JOptionPane;
public class uas {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner( System.in);
int Galaxi_A5,Galaxi_A3,Experia_Z3,Xperia_M2,NGalaxi_V,Galaxi_J1;
int Oppo_Joy,Oppo_R5;
int Expreia_E3,Experia_M2,Expreia_C3;
int Z10,Z3;
int A369i,P70,A516;
int Mi5s,s3,redmi,frime;
String alamat,email,nohp;
String nama;
String pasword = null;
String nama1 = null;
String pasword1 = null;
JOptionPane.showMessageDialog(null,"Silakan anda melakukan\n Register terlebih dahulu");
nama1 =JOptionPane.showInputDialog("Username");
pasword1=JOptionPane.showInputDialog("pasword");
email =JOptionPane.showInputDialog("E-mail");
alamat =JOptionPane.showInputDialog("Alamat");
nohp =JOptionPane.showInputDialog("No Hp");
JOptionPane.showMessageDialog(null,"Silahkan Login");
nama =JOptionPane.showInputDialog("Username");
pasword=JOptionPane.showInputDialog("pasword");
if(nama1.equals(nama)&&pasword1.equalsIgnoreCase(pasword)){
JOptionPane.showMessageDialog(null," Selamat datang di \" NIAGA CELL \"\n Selamat berbelanja...!!!");
String pilih = JOptionPane.showInputDialog("DAFTAR MEREK HP ANDROID TERBARU : \n1. SAMSUNG \n2. OPPO \n3. SONY \n4. BLACBERRY \n5. LENOVO \n6. XIAOMI");
if (pilih.equals("1")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp SAMSUNG : \na. Galaxi A5 \nb. Galaxi A3 \nc. Experia Z3 \nd. Xperia M2 \ne. Galaxi V \nf. Galaxi J1 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Samsung Galxi A5 \nHarga : RP. 4.600.000");
Galaxi_A5 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_A5*4600000));
}else if (pilih1.equals("b")) {
JOptionPane.showMessageDialog(null,"Samsung Galxi A3 \nHarga : RP. 3.000.000");
Galaxi_A3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_A3*3000000));
}else if (pilih1.equals("c")) {
JOptionPane.showMessageDialog(null,"Samsung Experia Z3 \nHarga : RP. 6.700.000");
Experia_Z3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Experia_Z3*6700000));
}else if (pilih1.equals("d")) {
JOptionPane.showMessageDialog(null,"Samsung Xperia M2 \nHarga : RP. 2.900.000");
Xperia_M2 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Xperia_M2*2900000));
}else if (pilih1.equals("e")) {
JOptionPane.showMessageDialog(null,"Samsung Galaxi V \nHarga : RP. 1.150.000");
NGalaxi_V =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(NGalaxi_V*1150000));
}else if (pilih1.equals("f")) {
JOptionPane.showMessageDialog(null,"Samsung Galaxi J1 \nHarga : RP. 1.550.000");
Galaxi_J1 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_J1*1550000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("2")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp OPPO : \na. Oppo Joy \nb. Oppo R5 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Oppo Joy \nHarga : RP. 1.299.000");
Oppo_Joy =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Oppo_Joy*1299000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Oppo R5 \nHarga : RP. 6.499.000");
Oppo_R5 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Oppo_R5*6499000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("3")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp SONY : \na. Expreia E3 \nb. Experia M2 \nc. Experia C3 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Expreia E3 \nHarga : RP. 2.100.000");
Expreia_E3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Expreia_E3*2100000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Expreia M2 \nHarga : RP. 2.100.000");
Experia_M2 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Experia_M2*2100000));
}else if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Expreia C3 \nHarga : RP. 2.650.000");
Expreia_C3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Expreia_C3*2650000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("4")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp BLACBERRY : \na. Blackbrry Z10 \nb. Blackbrry Z3 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Blackbrry Z10 \nHarga : RP. 3.225.000");
Z10 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Z10*3225000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Blackbrry Z3 \nHarga : RP. 2.600.000");
Z3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Z3*2600000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("5")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp LENOVO : \na. Lenovo A369i \nb. Lenovo P70 \nc. Lenovo A516 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Lenovo A369i \nHarga : RP. 960.000");
A369i =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(A369i*960000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Lenovo P70 \nHarga : RP. 2.899.000");
P70 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +( P70 *2899000));
}else if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Lenovo A516 \nHarga : RP. 1.550.000");
A516 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +( A516 *1550000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("6")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp XIAOMI : \na. Xiomi Mi5s \nb. Xiaomi redmi 3s prime \nc. Xiaomi redmi 4 \nd. Xiaomi redmi 3 frime ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Xiomi Mi5s \nHarga : RP. 3.800.000");
Mi5s =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Mi5s*3800000));
}if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 3s prime \nHarga : RP. 1.850.000");
s3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(s3*1850000));
}if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 4 \nHarga : RP. 960.000");
redmi =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(redmi*960000));
}if (pilih1.equals("d")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 3 frime \nHarga : RP. 2.400.000");
frime =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(frime*2400000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null,"Terimakasih anda telah berbelanja di \" NIAGA CELL \"");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else {
JOptionPane.showMessageDialog(null,"pilhan salah");
}System.exit(0);
}
JOptionPane.showMessageDialog(null,"Username dan Pasword salah..!!\n Silahkan Login kembali");
nama =JOptionPane.showInputDialog("Username");
pasword=JOptionPane.showInputDialog("pasword");
if(nama1.equals(nama)&&pasword1.equalsIgnoreCase(pasword)){
JOptionPane.showMessageDialog(null," Selamat datang di \" NIAGA CELL \"\n Selamat berbelanja...!!!");
String pilih = JOptionPane.showInputDialog("DAFTAR MEREK HP ANDROID TERBARU : \n1. SAMSUNG \n2. OPPO \n3. SONY \n4. BLACBERRY \n5. LENOVO \n6. XIAOMI");
if (pilih.equals("1")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp SAMSUNG : \na. Galaxi A5 \nb. Galaxi A3 \nc. Experia Z3 \nd. Xperia M2 \ne. Galaxi V \nf. Galaxi J1 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Samsung Galxi A5 \nHarga : RP. 4.600.000");
Galaxi_A5 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_A5*4600000));
}else if (pilih1.equals("b")) {
JOptionPane.showMessageDialog(null,"Samsung Galxi A3 \nHarga : RP. 3.000.000");
Galaxi_A3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_A3*3000000));
}else if (pilih1.equals("c")) {
JOptionPane.showMessageDialog(null,"Samsung Experia Z3 \nHarga : RP. 6.700.000");
Experia_Z3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Experia_Z3*6700000));
}else if (pilih1.equals("d")) {
JOptionPane.showMessageDialog(null,"Samsung Xperia M2 \nHarga : RP. 2.900.000");
Xperia_M2 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Xperia_M2*2900000));
}else if (pilih1.equals("e")) {
JOptionPane.showMessageDialog(null,"Samsung Galaxi V \nHarga : RP. 1.150.000");
NGalaxi_V =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(NGalaxi_V*1150000));
}else if (pilih1.equals("f")) {
JOptionPane.showMessageDialog(null,"Samsung Galaxi J1 \nHarga : RP. 1.550.000");
Galaxi_J1 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Galaxi_J1*1550000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("2")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp OPPO : \na. Oppo Joy \nb. Oppo R5 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Oppo Joy \nHarga : RP. 1.299.000");
Oppo_Joy =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Oppo_Joy*1299000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Oppo R5 \nHarga : RP. 6.499.000");
Oppo_R5 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Oppo_R5*6499000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("3")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp SONY : \na. Expreia E3 \nb. Experia M2 \nc. Experia C3 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Expreia E3 \nHarga : RP. 2.100.000");
Expreia_E3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Expreia_E3*2100000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Expreia M2 \nHarga : RP. 2.100.000");
Experia_M2 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Experia_M2*2100000));
}else if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Expreia C3 \nHarga : RP. 2.650.000");
Expreia_C3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Expreia_C3*2650000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("4")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp BLACBERRY : \na. Blackbrry Z10 \nb. Blackbrry Z3 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Blackbrry Z10 \nHarga : RP. 3.225.000");
Z10 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Z10*3225000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Blackbrry Z3 \nHarga : RP. 2.600.000");
Z3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Z3*2600000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("5")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp LENOVO : \na. Lenovo A369i \nb. Lenovo P70 \nc. Lenovo A516 ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Lenovo A369i \nHarga : RP. 960.000");
A369i =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(A369i*960000));
}else if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Lenovo P70 \nHarga : RP. 2.899.000");
P70 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +( P70 *2899000));
}else if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Lenovo A516 \nHarga : RP. 1.550.000");
A516 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +( A516 *1550000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else if (pilih.equals("6")){
String pilih1 = JOptionPane.showInputDialog("DAFTAR Hp XIAOMI : \na. Xiomi Mi5s \nb. Xiaomi redmi 3s prime \nc. Xiaomi redmi 4 \nd. Xiaomi redmi 3 frime ");
if (pilih1.equals("a")){
JOptionPane.showMessageDialog(null,"Xiomi Mi5s \nHarga : RP. 3.800.000");
Mi5s =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(Mi5s*3800000));
}if (pilih1.equals("b")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 3s prime \nHarga : RP. 1.850.000");
s3 =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(s3*1850000));
}if (pilih1.equals("c")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 4 \nHarga : RP. 960.000");
redmi =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(redmi*960000));
}if (pilih1.equals("d")){
JOptionPane.showMessageDialog(null,"Xiaomi redmi 3 frime \nHarga : RP. 2.400.000");
frime =Integer.parseInt(JOptionPane.showInputDialog("Jumlah barang yang dibeli"));
JOptionPane.showMessageDialog(null, "Harga " +(frime*2400000));
}
String pilih2 = JOptionPane.showInputDialog("Pilih BANK yang ingin anda tranfer : \na.BNI \nb.BRI \nc.BTN");
if (pilih2.equals("a")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Siti jaenap\nNo Rekening : 1067xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null,"Terimakasih anda telah berbelanja di \" NIAGA CELL \"");
}else if (pilih2.equals("b")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Slamat Dunia Akhirat\nNo Rekening : 20687xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}else if (pilih2.equals("c")){
JOptionPane.showMessageDialog(null, " Silahakan anda transtfer di rekening : \nNama : Muin Amin\nNo Rekening : 3089xxxxxxxxxxx ");
JOptionPane.showMessageDialog(null, " Terimakasih anda telah berbelanja di \" NIAGA CELL \" ");
}
}else {
JOptionPane.showMessageDialog(null,"pilhan salah");
}System.exit(0);
}
}
}
| [
"ricots47@gmail.com"
] | ricots47@gmail.com |
67e377e936521edd4feae10635ed2b3b4656bb47 | 3d93d7e815dc6ff894723dda351214bb40e0d10c | /src/test/java/com/devin/data/analysis/admin/product/biz/impl/CQSSCFreeQueryServiceTest.java | 9554dfc887ea686635a711460215277a72c3fc65 | [] | no_license | hukaihao/data-analysis-admin | bd21ceeab055fb631d017c93bd004311c09b7faa | dc3b98b7b82a276625a202d0d485027c3bde764e | refs/heads/master | 2020-03-21T07:36:15.506267 | 2018-07-21T08:41:53 | 2018-07-21T08:41:53 | 138,289,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,246 | java | package com.devin.data.analysis.admin.product.biz.impl;
import com.devin.data.analysis.admin.product.dto.CQSSCFreeResultDTO;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.sql.DataSource;
import java.util.List;
import static org.junit.Assert.*;
@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class CQSSCFreeQueryServiceTest {
@Autowired
private CQSSCFreeQueryService cQSSCFreeQueryService;
@Test
public void queryTikectData() {
List<CQSSCFreeResultDTO> dataist = cQSSCFreeQueryService.queryTikectData();
}
@Test
public void testQueryAndInsert(){
List<CQSSCFreeResultDTO> dataist = cQSSCFreeQueryService.queryTikectData();
try{
cQSSCFreeQueryService.batchInsertCQSSCData(
cQSSCFreeQueryService.convertDataForInsert(dataist));
}catch(Exception e){
e.printStackTrace();
}
while(true){
}
}
} | [
"outlookhukaihao@outlook.com"
] | outlookhukaihao@outlook.com |
d250d44ab3a84611e14c38a3de1c98a5ba33d242 | 019dfc771844318536d7a610e0899c2e30cceb55 | /src/iostream/ReadStringBuffer.java | a7cfa03a0f79bf79500d0b43a44f0e9528fe80c0 | [] | no_license | srjsoumya/javaprogram | 97dd5c9fe854d83ac6562d20dcdb0fd6e1d3ef7d | 82c4b56569b763bb6cdc991812f32d51ef156d42 | refs/heads/master | 2020-03-22T07:24:35.297634 | 2018-07-11T14:34:21 | 2018-07-11T14:34:21 | 139,698,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 546 | java | package iostream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ReadStringBuffer {
public static void main(String []args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str;
System.out.println("Enter the line of text: ");
System.out.println("Enter stop to quit: ");
do {
str=br.readLine();
System.out.println(str);
}while (!str.equals("stop"));
}
}
| [
"srj.soumya@gmail.com"
] | srj.soumya@gmail.com |
72a8a4bce17b834b83ff26d5c5f9a13b10824a5b | c26df3ed1da7a0172ff9bdd6e5c907e771d98f27 | /Java/JDBC/ResultSetScrollableDemo2.java | 497b5b203771fe7b8ec85c6f2621762427a69bf7 | [] | no_license | GauravAmarnaniTest/5th-Semester | 76fc9a48ecdf1dc3aaba85e5565556d365a77f5f | d0b62956a7746a0482531821455d71ef9165fa5a | refs/heads/master | 2022-12-09T18:45:35.744528 | 2020-09-13T14:47:59 | 2020-09-13T14:47:59 | 288,982,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,586 | java | //This is a program to show that refreshRow() is not supported by Type 4 Driver.
//Author : Gaurav Amarnani.
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import static java.lang.System.out;
import java.util.Scanner;
public class ResultSetScrollableDemo2
{
public static void main(String...args)throws Exception
{
Scanner sc = new Scanner(System.in);
GetOracleConnection goc = new GetOracleConnection();
String url = goc.getUrl();
String user = goc.getUser();
String pass = goc.getPass();
try(Connection con = DriverManager.getConnection(url, user, pass))
{
Statement st = con.createStatement(1005,1007);
ResultSet rs = st.executeQuery("select * from employee");
out.println("---------------------------------------");
out.println("Original Table : ");
out.println("ID:\tNAME:\tSALARY:\tADDRESS:");
while(rs.next())
{
out.println(rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getInt(3) + "\t" + rs.getString(4));
}
out.println("Waiting now for changes to be made in Database. Enter Proceed to continue.");
String choice = sc.next();
if(choice.equalsIgnoreCase("proceed"))
{
rs.refreshRow();
out.println("---------------------------------------");
out.println("Original Table after changes : ");
out.println("ID:\tNAME:\tSALARY:\tADDRESS:");
while(rs.next())
{
out.println(rs.getInt(1) + "\t" + rs.getString(2) + "\t" + rs.getInt(3) + "\t" + rs.getString(4));
}
}
}
catch(Exception e)
{
out.println(e);
}
}
} | [
"gauravamarnani12@gmail.com"
] | gauravamarnani12@gmail.com |
1cbf898b6ecc24220d52e45d1d4f2548d4638b71 | 6e92c6837f94d7eff99701599bbce522b9653fcc | /B441.java | 724f9ddbe98a66b0fcbfa15f91dda597c90fd73e | [] | no_license | anilvedala/codeforces | df8acf0e6814b992b640fa9d813ac5266971800c | 3c4e6dca66980677bf0e90b56e841e5b9b4bbc46 | refs/heads/master | 2016-09-05T13:15:47.314333 | 2015-06-10T17:50:51 | 2015-06-10T17:50:51 | 22,964,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | import java.util.Scanner;
public class B441{
public static void main(String ar[]){
Scanner sb=new Scanner(System.in);
String s1=sb.nextLine();
String s2[]=s1.split(" ");
int n=Integer.parseInt(s2[0]);
int v=Integer.parseInt(s2[1]);
int a[]=new int[n];
int c=0,f=0,b=0;
for(int i=0;i<n;i++){
String s=sb.nextLine();
String s3[]=s.split(" ");
c=Integer.parseInt(s3[0]);
a[c-1]=Integer.parseInt(s3[1]);
}
for(int i=0;i<n;i++){
if(b<=v){
f=f+b;
if((v-b)<a[i]){
f=f+v-b;
b=a[i]-v+b;
}
else{
f=f+a[i];
b=0;
}
}
else {
f=f+v;
b=a[i];
}
}
if(b<=v){
System.out.print(f+b);}
else{System.out.print(f+v);}
}} | [
"anilvedala@gmail.com"
] | anilvedala@gmail.com |
2ec384699f4af5d85c066e1347e4189ca3beff22 | 377405a1eafa3aa5252c48527158a69ee177752f | /src/com/google/android/gms/wearable/WearableListenerService$a$4.java | d15d1fed900bfe613ef4cf7caffa3d7fd9e9847a | [] | no_license | apptology/AltFuelFinder | 39c15448857b6472ee72c607649ae4de949beb0a | 5851be78af47d1d6fcf07f9a4ad7f9a5c4675197 | refs/heads/master | 2016-08-12T04:00:46.440301 | 2015-10-25T18:25:16 | 2015-10-25T18:25:16 | 44,921,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.wearable;
import com.google.android.gms.internal.kk;
// Referenced classes of package com.google.android.gms.wearable:
// WearableListenerService
class adB
implements Runnable
{
final kk adB;
final adB adz;
public void run()
{
adz.x.onPeerDisconnected(adB);
}
A(A a1, kk kk)
{
adz = a1;
adB = kk;
super();
}
}
| [
"rich.foreman@apptology.com"
] | rich.foreman@apptology.com |
75fbdc7228664d7257344b9f3f24faa4710f532a | 8adfd9cf81fb71136478d7b3ec10d7a299ed6063 | /src/com/exodus/netty/aio/AIOClient.java | fcd26c542f31df62a00136264d043738d41646ab | [] | no_license | arhaiyun/Java_Best_Practices | 97b561b53a60346862897d964b57e0d254f9be79 | e8a8f5a9948a353d8832f3d718c9885f51af4e1b | refs/heads/master | 2023-06-21T23:25:12.955798 | 2023-06-07T16:14:26 | 2023-06-07T16:14:26 | 250,716,814 | 1 | 0 | null | 2022-02-10T04:40:28 | 2020-03-28T04:50:36 | Java | UTF-8 | Java | false | false | 720 | java | package com.exodus.netty.aio;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
public class AIOClient {
public static void main(String... args) throws Exception {
AsynchronousSocketChannel socketChannel = AsynchronousSocketChannel.open();
socketChannel.connect(new InetSocketAddress("127.0.0.1", 9000)).get();
socketChannel.write(ByteBuffer.wrap("HelloServer".getBytes()));
ByteBuffer buffer = ByteBuffer.allocate(512);
Integer len = socketChannel.read(buffer).get();
if (len != -1) {
System.out.println("客户端收到信息:" + new String(buffer.array(), 0, len));
}
}
} | [
"vrhaiyun@gmail.com"
] | vrhaiyun@gmail.com |
80fafc7933c33372f207a44c7ff2bdc114b0920c | ece83c46e0d0727458952a850af2c6ee4c4fea0f | /Shopping/src/main/java/com/ls/dao/GoodsDao.java | cc7fb203a98ccb4b51016c7a8eabbbd5ced1d693 | [] | no_license | ghehsil/Project | 66252742d8f4223903f0f65c6cffa47521de8218 | 5ec00485f2db6b03af647621399660009bb56511 | refs/heads/master | 2021-07-14T02:17:40.166949 | 2018-09-22T12:28:35 | 2018-09-22T12:28:35 | 147,268,872 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,486 | java | package com.ls.dao;
import com.ls.dto.paymentDetail;
import com.ls.dto.shoppingCartDetail;
import com.ls.entity.Goods;
import com.ls.entity.goodsType;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface GoodsDao {
List<Goods> getPageList(@Param("begin") int begin, @Param("pageNum") int pageNum);
List<Goods> getPageListByGoodsType(@Param("begin") int begin, @Param("pageNum") int pageNum, @Param("typeName") String typeName);
Integer getGoodsTotalNum();
Integer getGoodsTotalNumByGoodsType(@Param("typeName") String typeName);
Integer getShoppingCartTotalNum(Long Id);
int addGoods(@Param("goods") Goods goods);
int addMd5Id(@Param("goods") Goods goods);
int deleteGoodsById(@Param("md5Id") String md5Id);
List<Goods> insertRepeat(@Param("name") String name);
List<shoppingCartDetail> showShoppingCart(@Param("Id") Long Id, @Param("begin") Integer begin, @Param("pageNum") Integer pageNum);
Integer addShoppingCart(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer addShoppingCartNum(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer queryShoppingNum(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer queryGoodsNum(@Param("Id") Long Id);
Integer reduceGoodsNumber(@Param("Id") Long Id);
Long getMd5Id(@Param("md5Id") String md5Id);
Integer deleteOne(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer deleteAll(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer queryShoppingGoodsNum(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer addPayment(@Param("number") Integer number, @Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer deleteShoppingCart(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
List<paymentDetail> queryPayment(@Param("Id") Long Id, @Param("begin") Integer begin, @Param("pageNum") Integer pageNum);
Integer queryShoppingCartNum(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
Integer addOneGoodsNum(@Param("Id") Long Id);
Integer addAllGoodsNum(@Param("Id") Long Id, @Param("number") Integer number);
Goods queryGoodsDetail(@Param("md5Id") String md5Id);
Integer updateGoodsDetail(@Param("goods") Goods goods);
Integer updateGoodsDetailWithoutImg(@Param("goods") Goods goods);
List<goodsType> queryGoodsType();
}
| [
"31364676+ghehsil@users.noreply.github.com"
] | 31364676+ghehsil@users.noreply.github.com |
ce57f04a5c1186f5c54c0db76782fb6bebe03bb8 | f4012fd67e87f339ea44cb0794849f444d31f9f2 | /sving-core/src/main/java/de/eudaemon/sving/core/testapp/TestWindow.java | d7a04ca67d717a6316b5e00ac6d55e66a776781f | [
"Apache-2.0"
] | permissive | ohle/sving | f4fc5913a2e112d234d2e72e1fe8f44b99940c9d | 7ed13ba927c6dcbfae6c8d336f7e713cde6d2deb | refs/heads/master | 2020-04-03T05:50:12.972895 | 2020-01-22T16:42:49 | 2020-01-22T16:42:49 | 155,057,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,321 | java | package de.eudaemon.sving.core.testapp;
import javax.swing.*;
import java.awt.*;
public class TestWindow
extends JFrame {
public TestWindow() {
super("Sving test GUI");
setLayout(new BorderLayout());
setName("test-app-frame");
initComponents();
}
private void initComponents() {
JTabbedPane tabbedPane = new JTabbedPane();
JPanel first = new JPanel(new BorderLayout());
JPanel mainPanel = createMainPanel();
JPanel buttonPanel = createButtonPanel();
first.add(mainPanel, BorderLayout.CENTER);
first.add(buttonPanel, BorderLayout.SOUTH);
JPanel second = new JPanel();
second.add(new JLabel("Not much to see here"));
tabbedPane.add("First", first);
tabbedPane.add("Second", second);
add(tabbedPane);
}
private JPanel createMainPanel() {
JPanel mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(10, 10, 10, 10);
c.gridx = 0; c.gridy = 0;
c.weightx = 1;
c.fill = 1;
JTextField textField = new JTextField();
textField.setName("input");
mainPanel.add(textField, c);
c.gridx = 1;
JCheckBox checkbox = new JCheckBox("Checkbox");
checkbox.setName("checkbox");
mainPanel.add(checkbox, c);
c.gridx = 0; c.gridy = 2;
JRadioButton radioButton = new JRadioButton("RadioButton");
radioButton.setName("radio-button");
mainPanel.add(radioButton, c);
c.gridx = 1;
JLabel label = new JLabel("Just a label");
label.setName("label");
mainPanel.add(label, c);
return mainPanel;
}
private JPanel createButtonPanel() {
JPanel panel = new JPanel();
JButton testButton = new JButton("test");
testButton.setName("test-button");
JButton dialogButton = new JButton("Open dialog");
dialogButton.setName("dialog-button");
dialogButton.addActionListener(e -> {
JOptionPane.showInputDialog(this , "What?");
});
testButton.addActionListener(e -> System.out.println("CLICK!"));
panel.add(testButton);
panel.add(dialogButton);
return panel;
}
}
| [
"joclaussen@gmail.com"
] | joclaussen@gmail.com |
68801abae0c69ceecb075aee87f7c8da8f813749 | 6522403509908115ff0c24a6c89d4ca31340fd70 | /src/main/java/com/example/demo/UserRepositoryCommandLineRunner.java | 26a794795d2ef2260e1aaebb1b44db98fa50421e | [] | no_license | Ashwinisanil/demo | 857e647d118e3506997ba0c84baa33870bb64329 | e82fe708887095310f7e6361b26eb3ca8447db5d | refs/heads/master | 2020-04-27T14:27:31.621018 | 2019-03-07T20:02:51 | 2019-03-07T20:02:51 | 174,410,773 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,013 | java | package com.example.demo;
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import com.example.demo.entity.User;
import com.example.service.UserRepository;
@Component
public class UserRepositoryCommandLineRunner implements CommandLineRunner{
private static final Logger log =
LoggerFactory.getLogger(UserRepositoryCommandLineRunner.class);
@Autowired
private UserRepository userRepository;
@Override
public void run(String... arg0) throws Exception {
User user = new User("Jill", "Admin");
userRepository.save(user);
log.info("New User is created : " + user);
Optional<User> userWithIdOne = userRepository.findById(1L);
log.info("User is retrived : " + userWithIdOne);
List<User> users = userRepository.findAll();
log.info("All Users : " + users);
}
} | [
"ashharip@partnet.cisco.com"
] | ashharip@partnet.cisco.com |
950e9c55675c862cb17ab2dafddd885576672e4f | 930dd40fe6056610106935f63c508ab51e5b2034 | /zapp-common/src/main/java/com/zfoo/app/zapp/common/protocol/cache/search/GetHotSearchAnswer.java | 70aadf6c941148d29488de625ad55d296c9e3d5f | [
"Apache-2.0"
] | permissive | qzmfreedom/zapp | bcd8f8dacd226720c83e7c2da8244f959b175a50 | da51773447545fce1f9949b014bcf827065ba66e | refs/heads/main | 2023-08-25T02:33:51.732215 | 2021-10-20T09:55:38 | 2021-10-20T09:55:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | /*
* Copyright (C) 2020 The zfoo Authors
*
* 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.zfoo.app.zapp.common.protocol.cache.search;
import com.zfoo.protocol.IPacket;
import java.util.List;
/**
* @author jaysunxiao
* @version 1.0
* @since 2020-08-11 11:15
*/
public class GetHotSearchAnswer implements IPacket {
public static final transient short PROTOCOL_ID = 3321;
private List<String> searches;
public static GetHotSearchAnswer valueOf(List<String> searches) {
var ask = new GetHotSearchAnswer();
ask.searches = searches;
return ask;
}
@Override
public short protocolId() {
return PROTOCOL_ID;
}
public List<String> getSearches() {
return searches;
}
public void setSearches(List<String> searches) {
this.searches = searches;
}
}
| [
"jaysunxiao@gmail.com"
] | jaysunxiao@gmail.com |
4d92668c49e9dc9559670ca29a616c67aa6223fd | 8fd29d37a63d1fb0b725e95f86b4d3e0d98973f5 | /src/main/java/com/Akoot/cthulhu/items/CthItem.java | 6f0500eb13c6c121ffaf74412d6831868f0ccd0b | [] | no_license | Akoot-zz/Cthulhu-Bukkit | 079b72d38cb7b52b3f87fdf124be85dddd71c853 | 72810b6f51d0ec767d2c2017c062828502b9f07f | refs/heads/master | 2022-09-18T11:25:46.436532 | 2016-06-25T20:16:56 | 2016-06-25T20:16:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,176 | java | package com.Akoot.cthulhu.items;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import com.Akoot.cthulhu.CthUser;
import com.Akoot.cthulhu.Cthulhu;
import com.Akoot.cthulhu.utils.ChatUtil;
public class CthItem
{
public Player player;
public CthUser user;
public ItemStack item;
public ItemMeta meta;
public List<String> lore;
public String name;
public Cthulhu plugin;
public CthItem(Cthulhu plugin, ItemStack item, Player player)
{
this.plugin = plugin;
this.player = player;
this.user = new CthUser(plugin, player);
this.item = item;
this.meta = (item.hasItemMeta() ? item.getItemMeta() : null);
if(meta != null)
{
this.lore = (this.meta.getLore() != null ? this.meta.getLore() : new ArrayList<String>());
}
else
{
this.lore = new ArrayList<String>();
}
}
public void use(){}
public void init(){}
public void setup(){}
public void update()
{
if(meta != null)
{
meta.setLore(lore);
item.setItemMeta(meta);
}
}
public void trace(String s)
{
player.sendMessage(ChatUtil.color(s));
}
}
| [
"akoot311@gmail.com"
] | akoot311@gmail.com |
4e93d760ab6c8bab0a313f752ab4168d2ccf0de9 | fc81359ba810ddfd09403b714b48b6672ce2ab46 | /src/test/java/com/illuminate/rocketmqTest/AppTest.java | 7d100c4e0bb13558c43e1e5cd042acd7610f5e60 | [] | no_license | dallion/rocketMQ-demo | 9a9af75c1fd263114570643f8d5f656ebeb72de4 | 97931c84c58376101c1f57b7b6349c13cdb313b6 | refs/heads/master | 2020-11-29T12:10:41.604413 | 2017-04-07T02:49:16 | 2017-04-07T02:49:16 | 87,497,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 655 | java | package com.illuminate.rocketmqTest;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"lgkzxcv@gmail.com"
] | lgkzxcv@gmail.com |
b07a88f218373580a0e7927ecbb538310f8aa44b | 10e02e5088b8dacc7ec3eef9b92cc20698ae7ff1 | /sa-webapp/src/main/java/com/sa/web/SentimentController.java | b0fdfbbb0359a87d5c38247af9c4718ec4c4a601 | [] | no_license | neekr01/ab | 196ea986f857067f9c32768d9a8f7b423db580f1 | dfb38862c5a3631089e70889a28e335dbe94ca32 | refs/heads/master | 2020-12-06T18:00:56.608501 | 2020-01-07T12:23:20 | 2020-01-07T12:23:20 | 232,520,860 | 0 | 0 | null | 2020-01-08T08:56:29 | 2020-01-08T08:56:28 | null | UTF-8 | Java | false | false | 2,869 | java | package com.sa.web;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
/**
* PaymentResource controller
*/
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/api/payment")
public class SentimentController {
@PostMapping("/print-me")
public String printMe() {
return "Hello World";
}
private final Logger log = LoggerFactory.getLogger(SentimentController.class);
/**
* POST bank1
*/
@PostMapping("/bank-1")
public String bank1(@RequestBody Map<String,String> payload) {
String card = payload.get("card");
if(card.equalsIgnoreCase("CC"))
{
String url = "http://35.193.37.248/api/payment/network";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5VSTFNRVpHT1RreE5VRXpOalZDTUVSR1FqRkRPVUZDUmtOQk1qUXpOekV4TlVaQlFrWTVPUSJ9.eyJpc3MiOiJodHRwczovL2Rldi05cWxidXBuMy5hdXRoMC5jb20vIiwic3ViIjoiWjlSVmg0Y2NBdTFWUkFFR2pHQlNJZExPeWs1OHQ0cGJAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vc2VudGltZW50LWFuYWx5c2lzLmlvIiwiaWF0IjoxNTc2NjU1MDA4LCJleHAiOjE1NzY3NDE0MDgsImF6cCI6Ilo5UlZoNGNjQXUxVlJBRUdqR0JTSWRMT3lrNTh0NHBiIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.t3zr4SPajaTYV-UvsFtX-VktMTQJSloKTsqOoELL0uTcCXy7AKvuEt3fGR_uqfVt42x_4HNQEDXorBk_pv-qyVzKWebYczw9zyyoDvo-iwZrGR3R1fRTQLPieatXpkGmLyTslkDgkHOjTS7Bl8qb1DowqpW3Ve0Rygw-q2P7QlkfN_JorrWowHFZG1dHcx6-QGbl_Ptw3mB9N8d53yoj8-Jpf-yLEQFDNevbVZlH1cUPbCx9RsZiW_hbn5S47BVY9C_nNk1PZGfCpBdgJwEOZJ65mxIcWQgygmbqRKFSXO1uEU5ldWi0YWpbJfBlWlRjrg7Uuua-J3O4xd58lNnpQQ");
Map<String,String> map=new HashMap<String, String>();
map.put("status","accept");
HttpEntity<Map<String, String>> request = new HttpEntity<>(map, headers);
RestTemplate restTemplate=new RestTemplate();
ResponseEntity<String> response = restTemplate.postForEntity(url, request , String.class);
return "Response from network: ("+response.getBody() + ")";
}
return "Not a valid card";
}
}
| [
"dakshi.suri@publicissapient.com"
] | dakshi.suri@publicissapient.com |
3fcf61329373abeedfaf77db5896a532982c87bd | eb7359e4fb6aea62c977a8d949bde5e5f0b64302 | /NightReader/app/src/main/java/com/example/pc/nightreader/entity/parse/OtherchannleParse.java | bd82b4a712af736a1d2de9a636ad5e3fd48beea5 | [] | no_license | XjwAiCoding/NightReader | 7f6d226268e891f0fbbce7d379144001b6345543 | d94c5ccbc59ff1428b3b4e4d15138ea9b3b59315 | refs/heads/master | 2020-06-10T23:35:45.734069 | 2017-01-05T10:18:52 | 2017-01-05T10:18:52 | 75,824,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,570 | java | package com.example.pc.nightreader.entity.parse;
import android.content.Context;
import com.example.pc.nightreader.entity.OtherChannle;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* Created by xujiawei on 2017/1/5.
*/
public class OtherchannleParse {
/**
*
* @param pContext
* @param pJSONObject JsonObject对象
* @return
*/
public static OtherChannle parseOtherChannleFromJson(Context pContext, JSONObject pJSONObject) {
OtherChannle _OtherChannle=new OtherChannle();
_OtherChannle.setName(pJSONObject.optString("name"));
_OtherChannle.setSource(pJSONObject.optString("source"));
return _OtherChannle;
}
/**
*
* @param pContext
* @param pJsonData json字符串
* @return
*/
public static ArrayList<OtherChannle> parseOtherChannleListFromJson(Context pContext, String pJsonData){
ArrayList<OtherChannle> _OtherChannleList=new ArrayList<>();
try{
JSONObject _JsonObject=new JSONObject(pJsonData);
JSONArray _JsonArray=_JsonObject.getJSONArray("Channle");
for(int i=0;i<_JsonArray.length();i++){
JSONObject _object=_JsonArray.getJSONObject(i);
//往list里添加实体类对象
_OtherChannleList.add(parseOtherChannleFromJson(pContext,_object));
}
}catch (JSONException e){
e.printStackTrace();
}
return _OtherChannleList;
}
}
| [
"xujiaweireal@gmail.com"
] | xujiaweireal@gmail.com |
c59e6fc7fd77721e214ef0f04118cd2274b2f1f8 | ff93763d16ba20bd62b204a3e1e688aaa1fcca2b | /src/main/java/com/shangcheng/mapper/AccountMapper.java | 82a0ac20200156e2ab60b00ae2415f1a6ee5b1cd | [] | no_license | tang2988/shangcheng-Cust | a841abbd757360cc3dcdbd203c80977ca4e8d864 | 805266d8b4060a596e59b3daed3aa05b88a3bf5e | refs/heads/master | 2020-05-14T13:34:49.258844 | 2019-04-25T07:06:12 | 2019-04-25T07:06:12 | 181,815,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | package com.shangcheng.mapper;
import com.shangcheng.entity.Account;
public interface AccountMapper {
Account getAccountById(Long AccountId);
Integer addAccount(Account account);
}
| [
"tang2988@qq.com"
] | tang2988@qq.com |
0b92ed3f23fbb4fdefa72fe20cc4daa47d332473 | 0145d39bd1ad117000f3b793779b97e53a2efb95 | /app/src/main/java/dao/DatabaseManager.java | f69b091df3ce8d760c428f75e8ebd5c39f6a0885 | [] | no_license | cedricgau/Forum | 7fe09d01f5aea3aac3e15af63fc68136a4cd1ce0 | 556a81e7ec3673cf12103ad0f4a1e37b24b459d7 | refs/heads/master | 2023-03-28T20:43:14.629901 | 2021-03-28T17:37:10 | 2021-03-28T17:37:10 | 351,835,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,989 | java | package dao;
import android.app.AlertDialog;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build;
import android.util.Log;
import androidx.annotation.RequiresApi;
import androidx.room.ColumnInfo;
import java.sql.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import model.Abonne;
import model.Forum;
import model.Moderator;
import model.Nouvelle;
public class DatabaseManager extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "Forum.db";
private static final int DATABASE_VERSION = 2;
public DatabaseManager( Context context ) {
super( context, DATABASE_NAME, null, DATABASE_VERSION );
}
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void onCreate(SQLiteDatabase db) {
creaBase(db);
Log.i( "DATABASE", "onCreate invoked" );
}
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//String strSql = "alter table Abonne add column ...";
// destruction des anciennes tables
String strSql = "drop table Abonne";
String strSql2 = "drop table Nouvelle";
String strSql3 = "drop table Moderateur";
db.execSQL( strSql );
db.execSQL( strSql2 );
db.execSQL( strSql3 );
this.onCreate(db);
Log.i( "DATABASE", "onUpgrade invoked" );
}
public void insertA( String name, String surname,int age,int aver ) {
String strSql = "insert into Abonne (name_abon, surname_abon,age_abon, avertissement) values ('"+ name + "','"+ surname + "', " + age + ", " + aver + ")";
this.getWritableDatabase().execSQL( strSql );
Log.i( "DATABASE", "insertScore invoked" );
}
public void insertM( String name, String surname,int age) {
String strSql2 = "insert into Moderateur (name_moder, surname_moder,age_moder) values ('"+ name + "','"+ surname + "'," + age+")";
this.getWritableDatabase().execSQL( strSql2 );
Log.i( "DATABASE", "insertScore invoked" );
}
@RequiresApi(api = Build.VERSION_CODES.O)
public void insertN(String sub, String txt) {
String strSql3 = "insert into Nouvelle (subject, text,dateCreation) values ('"+ sub + "','"+ txt + "','" + Date.valueOf(String.valueOf(LocalDate.now()))+"')";
this.getWritableDatabase().execSQL( strSql3 );
Log.i( "DATABASE", "insertScore invoked" );
}
public void creaBase(SQLiteDatabase db) {
// creation des tables
String strSql4 = "create table Abonne ("
+ " idAbonne integer primary key autoincrement,"
+ " name_abon text not null,"
+ " surname_abon text not null,"
+ " age_abon integer not null,"
+ " avertissement integer not null"
+ ")";
String strSql5 = "create table Moderateur ("
+ " idAbonne integer primary key autoincrement,"
+ " name_moder text not null,"
+ " surname_moder text not null,"
+ " age_moder integer not null"
+ ")";
String strSql6 = "create table Nouvelle ("
+ " idAbonne integer primary key autoincrement,"
+ " subject text not null,"
+ " text text not null,"
+ " dateCreation Date not null"
+ ")";
db.execSQL(strSql4);
db.execSQL(strSql5);
db.execSQL(strSql6);
}
@RequiresApi(api = Build.VERSION_CODES.O)
public void idGeneric(){
// creation d'un Forum dans la base
// création d'un modérateur dans la base
insertM("gautier","cedric",47);
// création de pseudos abonnés dans la base
insertA( "Dupont","Marcel",33,0);
insertA( "Martin","Pierre",22,0);
insertA( "Morin","Nathalie",22,0);
insertA( "Charpentier","Catherine",55,0);
// création de pseudos nouvelles dans la base
insertN("Java ---", "C’est bien ? Java est une technique informatique développée initialement par Sun Microsystems puis acquise par Oracle suite au rachat de l’entreprise. Défini à l’origine comme un langage de programmation, Java a évolué pour devenir un ensemble cohérent d’éléments techniques et non techniques.");
insertN("Interface ---", "Principe indispensable en Java, une interface dans le langage de programmation Java est un type abstrait qui est utilisé pour spécifier un comportement que les classes doivent implémenter. They are similar to protocols. Interfaces are declared using the interface keyword, and may only contain method signature and constant declarations.");
insertN("Classe abstraite ---", "C’est une classe non instanciable, dès qu’une classe contient une méthode abstraite, elle doit elle aussi être déclarée abstraite, avec le modificateur abstract placé au début de son en-tête .");
insertN("Classe concrète ---", "Les classes concrètes qui s’étendent une ou plusieurs classes abstraites (indirectement), doit obligatoirement fournir une implémentation pour toutes les méthodes abstraites existantes.");
insertN("Spring ---", "En informatique, Spring est un framework open source pour construire et définir l’infrastructure d’une application Java3, dont il facilite le développement et les tests. En 2004, Rod Johnson a écrit le livre Expert One-on-One J2EE Design and Development4 qui explique les raisons de la création de Spring. Spring est considéré comme un conteneur dit « léger ». La raison de ce nommage est expliquée par Erik Gollot dans l’introduction du document Introduction au framework Spring5. Spring est effectivement un conteneur dit « léger », c’est-à-dire une infrastructure similaire à un serveur d’applications J2EE. Il prend donc en charge la création d’objets et la mise en relation d’objets par l’intermédiaire d’un fichier de configuration qui décrit les objets à fabriquer et les relations de dépendances entre ces objets. Le gros avantage par rapport aux serveurs d’application est qu’avec Spring, les classes n’ont pas besoin d’implémenter une quelconque interface pour être prises en charge par le framework (au contraire des serveurs d’applications J2EE et des EJBs). C’est en ce sens que Spring est qualifié de conteneur « léger ».");
// fermeture de la database Forum
}
@RequiresApi(api = Build.VERSION_CODES.O)
public void init() {
// récupération d'un Modérateur de la base Forum
String strSQL7 = " Select * from Moderateur";
Cursor cursor = this.getReadableDatabase().rawQuery(strSQL7,null);
cursor.moveToNext();
Moderator cedric = new Moderator(cursor.getString(2), cursor.getString(3), cursor.getInt(4));
// récupération et ajout des Abonnés de la base Forum
String strSQL8 = " Select * from Abonne";
cursor = this.getReadableDatabase().rawQuery(strSQL8,null);
while(cursor.moveToNext()){
cedric.ajouterAbonne(new Abonne(cursor.getString(2), cursor.getString(3), cursor.getInt(4)));
cursor.moveToNext();
}
Abonne autre = null;
String strSQL9 = " Select * from Nouvelle";
cursor = this.getReadableDatabase().rawQuery(strSQL9,null);
while(cursor.moveToNext()){
autre.deposerNouvelle(new Nouvelle(cursor.getString(2), cursor.getString(3)));
cursor.moveToNext();
}
cursor.close();
}
}
| [
"cedricgautier94@gmail.com"
] | cedricgautier94@gmail.com |
7fab406ec5996299abf2c2cea0319d43fb52d0c5 | f931cf591a72139c34a56e9028f10ca42499c9a3 | /src/main/java/com/wrial/community/mapper/CommentMapper.java | 19ddc0ae1f779adbba14b4f32f0f9b56c7ee618a | [] | no_license | wrail/community | 254e46619ef4aea7ac90ac34c431cc9c75a711d0 | 20443b3d5b3eb3c2110cbd124408b5a9cc57f343 | refs/heads/master | 2022-06-23T13:59:56.238340 | 2019-08-05T03:53:13 | 2019-08-05T03:53:13 | 190,136,713 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | package com.wrial.community.mapper;
import com.wrial.community.model.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.annotation.RegisterMapper;
@Mapper
public interface CommentMapper extends tk.mybatis.mapper.common.Mapper<Comment> {
@Update("update comment set comment_count = comment_count + #{commentCount} where id = #{id}")
void autoIncCommentCount(Comment comment);
@Select("select * from comment where id = #{parentId}")
Comment selectById(Long parentId);
}
| [
"2806935450@qq.com"
] | 2806935450@qq.com |
ba6ff5ebad4d080ec7e165c3ba60390178e2d2e0 | b4964ae6c2985d032b8d55af7d584e42ac50503a | /app/src/main/java/pe/upc/controlasistencias/ui/home/HomeViewModel.java | 5a6c392880a0f7a17d88bcf1a14b84e201c085ee | [] | no_license | JNalvarte/controlasistenciaupc | 4119a07627707170a8082a14c05b01a4a009884d | 4ab1e67b3cee61d050aaf83ce109ef77c92a48e8 | refs/heads/master | 2023-07-13T04:56:17.406150 | 2021-08-25T01:41:13 | 2021-08-25T01:41:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | package pe.upc.controlasistencias.ui.home;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel {
private MutableLiveData<String> mText;
public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is home fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"leonel_chavez27@hotmail.com"
] | leonel_chavez27@hotmail.com |
554113adbb5e63cfa9a489d3ac0b3192d60087b1 | c74856bd51e001b9dba89a7ec7cb642f8c1ec88f | /src/main/java/com/example/demo/DemoApplication.java | b766f56932a2c969eccbb819e1a47571b925ba14 | [] | no_license | juang-dev/spring-cloud-consul-issue | c0717e6fa77aa8ff2ed5bbb53e0a8bb39f50e806 | c6cc6d423c03e313eca319e0e219c40289bf9b5c | refs/heads/master | 2022-03-06T10:46:26.997116 | 2019-10-16T18:59:29 | 2019-10-16T18:59:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.example.demo;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
@RequestMapping("/")
public String home() {
return "Hello world";
}
public static void main(String[] args) {
new SpringApplicationBuilder(DemoApplication.class).web(WebApplicationType.SERVLET).run(args);
}
}
| [
"juantgarcia96@gmail.com"
] | juantgarcia96@gmail.com |
31240175c18aaae785a6ee95fda4fe41362eabda | 621bcaa062a43ee037ff669b288d646cdd7f57d3 | /chain_of_responsibility/src/jp/ac/it_college/std/s14006/chain_of_responsibility/ChainOfResponsibilityMain.java | 2cfc1c80610ef2cff509ab1bbff655a2ddb3e5de | [] | no_license | s14006/Practice_of_Design_pattern | 1c9cf53d23238f6f5f029351a01c9779832f46d9 | 632f28565e4015085a4ced52e53d39e5d166b860 | refs/heads/master | 2021-01-10T03:54:47.973202 | 2015-06-25T05:07:41 | 2015-06-25T05:07:41 | 36,772,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package jp.ac.it_college.std.s14006.chain_of_responsibility;
/**
* Created by kabotya on 15/06/24.
*/
public class ChainOfResponsibilityMain {
public ChainOfResponsibilityMain() {
Support azrs = new NoSupport("azrs");
Support kabotya = new LimitSupport("kabotya", 100);
Support cloneko = new SpecialSupport("cloneko", 429);
Support ito = new LimitSupport("ito", 200);
Support usathon = new OddSupport("usathon");
Support usao = new LimitSupport("usao", 300);
azrs.setNext(kabotya).setNext(cloneko).setNext(ito).setNext(usathon).setNext(usao);
for (int i = 0; i < 500; i++) {
azrs.support(new Trouble(i));
}
}
}
| [
"s14006@std.it-college.ac.jp"
] | s14006@std.it-college.ac.jp |
0657fc60e68dbd6066bab9d889f1841a9d1cb8ad | ada2af9d80b94932f93bef7b1df33f33c0f20b6d | /InfoMemo/app/src/test/java/com/techportf/android/infomemo/ExampleUnitTest.java | 87d26d0f2ef378acc26bb4638cfe00d2c509913a | [] | no_license | tech-portf/first | 6059cae8bb0f36f9bbaf68a5dbfb55a26fe71022 | d16070c8ab6feefcb0c3b024b3b28cd8f6f0964a | refs/heads/master | 2022-11-22T02:52:27.192800 | 2020-07-07T05:26:02 | 2020-07-07T05:26:02 | 277,447,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.techportf.android.infomemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"67862973+tech-portf@users.noreply.github.com"
] | 67862973+tech-portf@users.noreply.github.com |
9dd141c0549a6e3ec508c816cbd7a29fcd344cea | 74b966cf026a0b9e2e1fc57dfb1be0f3a681c4c6 | /ContractManage/src/main/java/cn/com/kxcomm/contractmanage/vo/ContractQuotationsVo.java | 575d3e90df8b370f79699b2dd6ed893d2c18071b | [] | no_license | liveqmock/Projects | 6f75cdb7e59015aed3ad851619676c392ea7fdec | 0b416e76f38dd7f21062199f0dcf6f893e111eca | refs/heads/master | 2021-01-14T12:31:44.197040 | 2015-04-12T08:38:19 | 2015-04-12T08:38:19 | 33,808,969 | 0 | 0 | null | 2015-04-12T08:21:07 | 2015-04-12T08:21:07 | null | UTF-8 | Java | false | false | 4,891 | java | package cn.com.kxcomm.contractmanage.vo;
public class ContractQuotationsVo {
private String id;
private String contractId; // 合同id
private String projectName; // 项目名称
private String quotationName; // 报价总表名称
private String quantity; // 数量
private String totalPrice; // 总价
private String unit; // 单位
private String unitPrice;// 机型配置的合价
private String ordered; // 已下单数
private String remainingQuantity;// 剩余数量
private String configModelName; // 机型配置名称
private String configModelId; // 机型配置id
private String quotationsId; // 报价表id
private String quotationDataId;//报价表数据Id
private String typeName; // 类型名称
private String categoyName; // 总类型名称
private String usedNum;//使用数量
private String supplierId; //供应商id
private String suppliersQuotationsId;//供应商报价表id
private String purchasePrice; //采购价
public String getPurchasePrice() {
return purchasePrice;
}
public void setPurchasePrice(String purchasePrice) {
this.purchasePrice = purchasePrice;
}
public String getSupplierId() {
return supplierId;
}
public void setSupplierId(String supplierId) {
this.supplierId = supplierId;
}
public String getSuppliersQuotationsId() {
return suppliersQuotationsId;
}
public void setSuppliersQuotationsId(String suppliersQuotationsId) {
this.suppliersQuotationsId = suppliersQuotationsId;
}
public String getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getQuotationDataId() {
return quotationDataId;
}
public void setQuotationDataId(String quotationDataId) {
this.quotationDataId = quotationDataId;
}
public String getCategoyName() {
return categoyName;
}
public void setCategoyName(String categoyName) {
this.categoyName = categoyName;
}
public String getOrdered() {
return ordered;
}
public void setOrdered(String ordered) {
this.ordered = ordered;
}
public String getRemainingQuantity() {
return remainingQuantity;
}
public void setRemainingQuantity(String remainingQuantity) {
this.remainingQuantity = remainingQuantity;
}
public String getConfigModelName() {
return configModelName;
}
public void setConfigModelName(String configModelName) {
this.configModelName = configModelName;
}
public String getConfigModelId() {
return configModelId;
}
public void setConfigModelId(String configModelId) {
this.configModelId = configModelId;
}
public String getQuotationsId() {
return quotationsId;
}
public void setQuotationsId(String quotationsId) {
this.quotationsId = quotationsId;
}
public String getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(String totalPrice) {
this.totalPrice = totalPrice;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUsedNum() {
return usedNum;
}
public void setUsedNum(String usedNum) {
this.usedNum = usedNum;
}
public String getContractId() {
return contractId;
}
public void setContractId(String contractId) {
this.contractId = contractId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getQuotationName() {
return quotationName;
}
public void setQuotationName(String quotationName) {
this.quotationName = quotationName;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@Override
public String toString() {
return "ContractQuotationsVo [id=" + id + ", contractId=" + contractId
+ ", projectName=" + projectName + ", quotationName="
+ quotationName + ", quantity=" + quantity + ", totalPrice="
+ totalPrice + ", unit=" + unit + ", unitPrice=" + unitPrice
+ ", ordered=" + ordered + ", remainingQuantity="
+ remainingQuantity + ", configModelName=" + configModelName
+ ", configModelId=" + configModelId + ", quotationsId="
+ quotationsId + ", quotationDataId=" + quotationDataId
+ ", typeName=" + typeName + ", categoyName=" + categoyName
+ ", usedNum=" + usedNum + ", supplierId=" + supplierId
+ ", suppliersQuotationsId=" + suppliersQuotationsId
+ ", purchasePrice=" + purchasePrice + "]";
}
}
| [
"chenliang@kxcomm.com.cn"
] | chenliang@kxcomm.com.cn |
aabff57be228518fbd9896db05a8e06a230c45c5 | 71ed19c15dc9b32f9eaae42d0926fb7004ca8670 | /src/main/java/br/com/lareira/api/event/RecursoPadraoCriadoEvent.java | 08c274c9c4f5a51634a253dc52d06e98b4f12b37 | [] | no_license | trentinrossi/lareira-api | 1b92872790db7df4af549fe9efff1d1f7745af9d | cf77f526fe824a8801e16bd81df5fbb8d646f6d8 | refs/heads/master | 2023-03-25T05:27:44.528962 | 2021-03-11T16:44:35 | 2021-03-11T16:44:35 | 192,212,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package br.com.lareira.api.event;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationEvent;
public class RecursoPadraoCriadoEvent extends ApplicationEvent {
private HttpServletResponse response;
private Long codigo;
private static final long serialVersionUID = 1L;
public RecursoPadraoCriadoEvent(Object source, HttpServletResponse response, Long codigo) {
super(source);
this.response = response;
this.codigo = codigo;
}
public HttpServletResponse getResponse() {
return response;
}
public Long getCodigo() {
return codigo;
}
}
| [
"rdrg.rossi@gmail.com"
] | rdrg.rossi@gmail.com |
c9a4f9aa116b2980f2577d890cabdfda869692ea | cda901e5f97761b02d223add9586504010d714f3 | /src/main/java/emergon/converter/StringToIngredientsConverter.java | a49a3617cb83cafe2e14c3822aba5afeb32e1a8c | [] | no_license | FeiBaliou/SpringMVCPizzaExercise | a465633aeb54bcb46c1cb16dc1865c5034e327fd | d6ef9305a651817305e2e9b2a2e569f4978bd5a1 | refs/heads/master | 2023-01-08T17:39:16.430917 | 2020-11-12T16:15:16 | 2020-11-12T16:15:16 | 312,327,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java |
package emergon.converter;
import emergon.entity.Ingredient;
import emergon.service.IngredientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
@Component
public class StringToIngredientsConverter implements Converter<String, Ingredient>{
@Autowired
private IngredientService service;
@Override
public Ingredient convert(String source) {
//Get the id of the breadSize selection
//Find the Entity from the Database
//Return the Entity
int id = Integer.parseInt(source);
Ingredient ingr = service.findById(id);
return ingr;
}
}
| [
"48136578+FeiBaliou@users.noreply.github.com"
] | 48136578+FeiBaliou@users.noreply.github.com |
eaf61175eb9b0dbced082acc1ea3bfb074ddebd5 | ff9a503b98a99f85ca4c2af6b1e9a24f28742c2b | /src/test/java/handler/identifyhandler/CommentTest.java | c897309d2fe7349ab56c9c453e46fcdea262c322 | [] | no_license | MarJr/237802_A2 | 30e1df71128f4aea141d1b6616883088e32fb985 | 4836c4dc2e8efe079e54f7c23b83ef44582d30b8 | refs/heads/master | 2021-07-18T20:31:10.609392 | 2017-10-28T17:02:40 | 2017-10-28T17:02:40 | 107,843,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,076 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package handler.identifyhandler;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Mar Jr
*/
public class CommentTest {
public CommentTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of findComments method, of class Comment.
*/
@Test
public void testFindComments() {
System.out.println("findComments");
String[][] fileContent = new String[0][0];
Comment instance = new Comment();
instance.findComments(fileContent);
// TODO review the generated test code and remove the default call to fail.
}
/**
* Test of setFixedCommentTitle method, of class Comment.
*/
@Test
public void testSetFixedCommentTitle() {
System.out.println("setFixedCommentTitle");
String[][] fileContent = new String[0][0];
Comment instance = new Comment();
instance.setFixedCommentTitle(fileContent);
// TODO review the generated test code and remove the default call to fail.
}
/**
* Test of setVariableCommentTitle method, of class Comment.
*/
@Test
public void testSetVariableCommentTitle() {
System.out.println("setVariableCommentTitle");
String[][] fileContent = new String[0][0];
Comment instance = new Comment();
instance.setVariableCommentTitle(fileContent);
// TODO review the generated test code and remove the default call to fail.
}
/**
* Test of checkFixedCommentKeyword method, of class Comment.
*/
@Test
public void testCheckFixedCommentKeyword() {
System.out.println("checkFixedCommentKeyword");
String sentence = "";
String search = "";
Comment instance = new Comment();
boolean expResult = false;
boolean result = instance.checkFixedCommentKeyword(sentence, search);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
}
/**
* Test of grepThisWord method, of class Comment.
*/
@Test
public void testGrepThisWord() {
System.out.println("grepThisWord");
String sentence = "";
String search = "";
Comment instance = new Comment();
String expResult = "";
String result = instance.grepThisWord(sentence, search);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
}
}
| [
"Mar Jr@10.19.245.180"
] | Mar Jr@10.19.245.180 |
93098ba97d359670f0ab79b88ab655c687f78e4b | aa9626eecae0bfece1cb8e5a8c03b08a3b394dfc | /src/main/java/com/aoher/util/Sorting.java | fb92e0de6d2d0efe4dac3a6441bebcc54aef4924 | [] | no_license | MrsMars/java-sorting | f325ffc4392a85aecff2d1b477bc013f07b85339 | 52b46687eb32c39e08f24a30f99ce57756cb3bbc | refs/heads/master | 2021-05-21T20:44:58.673059 | 2020-04-03T17:15:20 | 2020-04-03T17:15:20 | 252,794,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,184 | java | package com.aoher.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.stream.IntStream;
public class Sorting {
private static final String LOGGER_TIME_FORMATTER = "{} time: {} millis";
private static final Logger log = LoggerFactory.getLogger(Sorting.class);
public static void bubbleSort(int[] array) {
LocalDateTime start = LocalDateTime.now();
boolean sorted = false;
int temp;
while (!sorted) {
sorted = true;
for (int i = 0; i < array.length - 1; i++) {
if (array[i] > array[i + 1]) {
temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
sorted = false;
}
}
}
LocalDateTime end = LocalDateTime.now();
log.info(LOGGER_TIME_FORMATTER, "bubbleSort", getTime(start, end));
}
public static void insertionSort(int[] array) {
LocalDateTime start = LocalDateTime.now();
for (int i = 1; i < array.length; i++) {
int current = array[i];
int j = i - 1;
while (j >= 0 && current < array[j]) {
array[j + 1] = array[i];
j--;
}
array[j + 1] = current;
}
LocalDateTime end = LocalDateTime.now();
log.info(LOGGER_TIME_FORMATTER, "insertionSort", getTime(start, end));
}
public static void mergeSort(int[] array) {
LocalDateTime start = LocalDateTime.now();
mergeSort(array, 0, array.length - 1);
LocalDateTime end = LocalDateTime.now();
log.info(LOGGER_TIME_FORMATTER, "mergeSort", getTime(start, end));
}
private static void mergeSort(int[] array, int left, int right) {
if (right <= left) return;
int mid = (left + right) / 2;
mergeSort(array, left, mid);
mergeSort(array, mid + 1, right);
mergeSort(array, left, mid, right);
}
private static void mergeSort(int[] array, int left, int mid, int right) {
// вычисляем длину
int lengthLeft = mid - left + 1;
int lengthRight = right - mid;
// копируем отсортированные массивы во временные
int[] leftArray = IntStream.range(0, lengthLeft).map(i -> array[left + i]).toArray();
int[] rightArray = IntStream.range(0, lengthRight).map(i -> array[mid + i + 1]).toArray();
// итераторы содержат текущий индекс временного подмассива
int leftIndex = 0;
int rightIndex = 0;
// копируем из leftArray и rightArray обратно в массив
for (int i = left; i < right + 1; i++) {
// если остаются нескопированные элементы в R и L, копируем минимальный
if (leftIndex < lengthLeft && rightIndex < lengthRight) {
if (leftArray[leftIndex] < rightArray[rightIndex]) {
array[i] = leftArray[leftIndex];
leftIndex++;
} else {
array[i] = rightArray[rightIndex];
rightIndex++;
}
}
// если все элементы были скопированы из rightArray, скопировать остальные из leftArray
else if (leftIndex < lengthLeft) {
array[i] = leftArray[leftIndex];
leftIndex++;
}
// если все элементы были скопированы из leftArray, скопировать остальные из rightArray
else if (rightIndex < lengthRight) {
array[i] = rightArray[rightIndex];
rightIndex++;
}
}
}
public static void quickSort(int[] array) {
LocalDateTime startT = LocalDateTime.now();
quickSort(array, 0, array.length - 1);
LocalDateTime endT = LocalDateTime.now();
log.info(LOGGER_TIME_FORMATTER, "quickSort", getTime(startT, endT));
}
private static void quickSort(int[] array, int begin, int end) {
if (end <= begin) return;
int pivot = partition(array, begin, end);
quickSort(array, begin, pivot - 1);
quickSort(array, pivot + 1, end);
}
private static int partition(int[] array, int begin, int end) {
int counter = begin;
for (int i = begin; i < end; i++) {
if (array[i] < array[end]) {
int temp = array[counter];
array[counter] = array[i];
array[i] = temp;
counter++;
}
}
int temp = array[end];
array[end] = array[counter];
array[counter] = temp;
return counter;
}
private static long getTime(LocalDateTime start, LocalDateTime end) {
return Duration.between(start, end).toMillis();
}
private Sorting() {
}
}
| [
"42183540+MrsMars@users.noreply.github.com"
] | 42183540+MrsMars@users.noreply.github.com |
c29711e740d143ba382f811c358649831bf4f840 | 4670c49b132f77da5f1e552a4646f3113225ddab | /week12_2/src/com/example/week12_2/db/StudentDBOpenHelper.java | 9a1286333e1787c96b9beeb680c37b64a18a9d39 | [] | no_license | ericMedeiros93/Android-Dev | d6ca8b7efaa3dd4b615be2791526d256f5764a85 | e1647b785a4377a74d9df0136212739678469c73 | refs/heads/master | 2020-06-04T22:31:10.156874 | 2014-12-09T01:30:51 | 2014-12-09T01:30:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,096 | java | package com.example.week12_2.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class StudentDBOpenHelper extends SQLiteOpenHelper {
// create a constant for db name
private static final String DATABASE_NAME = "Students.db";
// create a constant for db version
private static final int DATABASE_VERSION = 1;
public StudentDBOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
// must call super class constructor...
}
@Override
public void onCreate(SQLiteDatabase db) {
// called by runtime if db doesn't exist yet and in onUpgrade below
// here is where we create our table(s)
db.execSQL(StudentDataSource.CREATE_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// for now just drop table and call onCreate not checking for version info
// in real app, probably migrate data from old structure to new one
db.execSQL("DROP TABLE IF EXISTS " + StudentDataSource.TABLE_NAME);
onCreate(db);
}
}
| [
"littlechico93@gmail.com"
] | littlechico93@gmail.com |
02d7632528be80eef6f9b22d8e8c70d94aca8baf | 448ef5a85c9159b5d0041f472dba42302a1ca7de | /app/src/main/java/com/example/nxa/eatmeapp/HomeAdmin.java | eb2130c6ebdf6aa5e7939f1ae2c89c008883ccb1 | [] | no_license | luthfanos/EatMeApp | 6546b2f5f3225c58683be41a725acdc32a6ae10b | 249f3b5882bcf3aecffd001e9eada5dae057229e | refs/heads/master | 2020-04-08T04:08:28.913661 | 2018-11-25T06:26:55 | 2018-11-25T06:26:55 | 159,004,542 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,261 | java | package com.example.nxa.eatmeapp;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import com.example.nxa.eatmeapp.Common.Common;
public class HomeAdmin extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_admin);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.home_admin, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_menu) {
} else if (id == R.id.nav_cart) {
} else if (id == R.id.nav_rating) {
} else if (id == R.id.nav_tentang) {
Intent tentang = new Intent(HomeAdmin.this,Tentang.class);
startActivity(tentang);
}else if (id == R.id.nav_logout) {
Intent logout = new Intent(HomeAdmin.this,SignIn.class);
startActivity(logout);
finish();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
}
| [
"42530019+luthfanos@users.noreply.github.com"
] | 42530019+luthfanos@users.noreply.github.com |
ac5762a3c0cca9dcacaec2ad65326ccbc7816cec | 110271bf560a615310cd5d4994d747b7945783ee | /01_CountLeftNodes/src/TreeNode.java | 76007363d93b42516279b5a09457b6d3a8dbacd4 | [] | no_license | sandi1234/17_Chapter-1- | 9236cc88515b0e369dec883c179199945f7b9d3e | ba7b3f69b18217d98e446b203b893c24d5be40a4 | refs/heads/master | 2020-06-14T05:36:44.684633 | 2016-11-30T21:21:56 | 2016-11-30T21:21:56 | 75,228,131 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | /**
* Created by Samson on 06-11-2016.
*
* Class for storing a single node of a binary tree ints
*/
public class TreeNode<E> {
public E data;
public TreeNode<E> left;
public TreeNode<E> right;
// constructs a leaf node with given data
public TreeNode(E data){
this(data, null, null);
}
// constructs a branch node with given data, left subtree,
// right subtree
public TreeNode(E data, TreeNode<E> left, TreeNode<E> right){
this.data = data;
this.left = left;
this.right = right;
}
}
| [
"samsonndizawa@hotmail.com"
] | samsonndizawa@hotmail.com |
4ba12c4466ed6f3f013eccb8e762c7bddc36d1f4 | 554bcf83f45c2e3e328c70a6d13b5d509a633bc7 | /contractaward-service/src/main/java/com.bkjk.housing/common/enums/BusinessTypeEnum.java | 31cd9224f86cb46010337780453b5291f7f62c48 | [] | no_license | sunjiaxing829/myProject | 1afc32485a24cad06169a6bd5a2e27781010a879 | cce92237e923627132dcc1d8febb6f7888d98f53 | refs/heads/master | 2021-10-13T00:52:22.061024 | 2021-10-11T08:00:09 | 2021-10-11T08:00:09 | 157,194,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java | package com.bkjk.housing.common.enums;
public enum BusinessTypeEnum {
/**
* 协议类型
*/
MAIN("MAIN", "主协议"),
REPLENISH("REPLENISH", "补充协议"),
RECISSION("RECISSION", "解约协议");
private String code;
private String description;
BusinessTypeEnum(String code, String description) {
this.code = code;
this.description = description;
}
public static String getDescriptionByCode(String code) {
for (BusinessTypeEnum businessTypeEnum : BusinessTypeEnum.values()) {
if (businessTypeEnum.getCode().equalsIgnoreCase(code)) {
return businessTypeEnum.getDescription();
}
}
return null;
}
public static BusinessTypeEnum getBusinessTypeEnum(String code) {
for (BusinessTypeEnum businessTypeEnum : BusinessTypeEnum.values()) {
if (businessTypeEnum.getCode().equalsIgnoreCase(code)) {
return businessTypeEnum;
}
}
return null;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
}
| [
"jiaxing.sun@bkjk.com"
] | jiaxing.sun@bkjk.com |
c9560cc1b5ef738515545ceeda8d33bbaa3c66f5 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /ant_cluster/19801/src_42.java | 3bb8024f735b085e7d9ac531d59fc6c0b42eda3b | [] | 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 | 12,787 | java | /*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant;
/**
* Base class for all tasks.
*
* Use Project.createTask to create a new task instance rather than
* using this class directly for construction.
*
* @see Project#createTask
*/
public abstract class Task extends ProjectComponent {
/** Target this task belongs to, if any. */
protected Target target = null;
/** Description of this task, if any. */
protected String description = null;
/** Location within the build file of this task definition. */
protected Location location = Location.UNKNOWN_LOCATION;
/**
* Name of this task to be used for logging purposes.
* This defaults to the same as the type, but may be
* overridden by the user. For instance, the name "java"
* isn't terribly descriptive for a task used within
* another task - the outer task code can probably
* provide a better one.
*/
protected String taskName = null;
/** Type of this task. */
protected String taskType = null;
/** Wrapper for this object, used to configure it at runtime. */
protected RuntimeConfigurable wrapper;
/**
* Whether or not this task is invalid. A task becomes invalid
* if a conflicting class is specified as the implementation for
* its type.
*/
private boolean invalid = false;
/** Sole constructor. */
public Task() {
}
/**
* Sets the target container of this task.
*
* @param target Target in whose scope this task belongs.
* May be <code>null</code>, indicating a top-level task.
*/
public void setOwningTarget(Target target) {
this.target = target;
}
/**
* Returns the container target of this task.
*
* @return The target containing this task, or <code>null</code> if
* this task is a top-level task.
*/
public Target getOwningTarget() {
return target;
}
/**
* Sets the name to use in logging messages.
*
* @param name The name to use in logging messages.
* Should not be <code>null</code>.
*/
public void setTaskName(String name) {
this.taskName = name;
}
/**
* Returns the name to use in logging messages.
*
* @return the name to use in logging messages.
*/
public String getTaskName() {
return taskName;
}
/**
* Sets the name with which the task has been invoked.
*
* @param type The name the task has been invoked as.
* Should not be <code>null</code>.
*/
void setTaskType(String type) {
this.taskType = type;
}
/**
* Sets a description of the current action. This may be used for logging
* purposes.
*
* @param desc Description of the current action.
* May be <code>null</code>, indicating that no description is
* available.
*
*/
public void setDescription(String desc) {
description = desc;
}
/**
* Returns the description of the current action.
*
* @return the description of the current action, or <code>null</code> if
* no description is available.
*/
public String getDescription() {
return description;
}
/**
* Called by the project to let the task initialize properly.
* The default implementation is a no-op.
*
* @exception BuildException if someting goes wrong with the build
*/
public void init() throws BuildException {}
/**
* Called by the project to let the task do its work. This method may be
* called more than once, if the task is invoked more than once.
* For example,
* if target1 and target2 both depend on target3, then running
* "ant target1 target2" will run all tasks in target3 twice.
*
* @exception BuildException if something goes wrong with the build
*/
public void execute() throws BuildException {}
/**
* Returns the file/location where this task was defined.
*
* @return the file/location where this task was defined.
* Should not return <code>null</code>. Location.UNKNOWN_LOCATION
* is used for unknown locations.
*
* @see Location#UNKNOWN_LOCATION
*/
public Location getLocation() {
return location;
}
/**
* Sets the file/location where this task was defined.
*
* @param location The file/location where this task was defined.
* Should not be <code>null</code> - use
* Location.UNKNOWN_LOCATION if the location isn't known.
*
* @see Location#UNKNOWN_LOCATION
*/
public void setLocation(Location location) {
this.location = location;
}
/**
* Returns the wrapper used for runtime configuration.
*
* @return the wrapper used for runtime configuration. This
* method will generate a new wrapper (and cache it)
* if one isn't set already.
*/
public RuntimeConfigurable getRuntimeConfigurableWrapper() {
if (wrapper == null) {
wrapper = new RuntimeConfigurable(this, getTaskName());
}
return wrapper;
}
/**
* Sets the wrapper to be used for runtime configuration.
*
* @param wrapper The wrapper to be used for runtime configuration.
* May be <code>null</code>, in which case the next call
* to getRuntimeConfigurableWrapper will generate a new
* wrapper.
*/
protected void setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper) {
this.wrapper = wrapper;
}
// XXX: (Jon Skeet) The comment "if it hasn't been done already" may
// not be strictly true. wrapper.maybeConfigure() won't configure the same
// attributes/text more than once, but it may well add the children again,
// unless I've missed something.
/**
* Configures this task - if it hasn't been done already.
* If the task has been invalidated, it is replaced with an
* UnknownElement task which uses the new definition in the project.
*
* @exception BuildException if the task cannot be configured.
*/
public void maybeConfigure() throws BuildException {
if (!invalid) {
if (wrapper != null) {
wrapper.maybeConfigure(project);
}
} else {
getReplacement();
}
}
/**
* Handles a line of output by logging it with the INFO priority.
*
* @param line The line of output to log. Should not be <code>null</code>.
*/
protected void handleOutput(String line) {
log(line, Project.MSG_INFO);
}
/**
* Handles an error line by logging it with the INFO priority.
*
* @param line The error line to log. Should not be <code>null</code>.
*/
protected void handleErrorOutput(String line) {
log(line, Project.MSG_ERR);
}
/**
* Logs a message with the default (INFO) priority.
*
* @param msg The message to be logged. Should not be <code>null</code>.
*/
public void log(String msg) {
log(msg, Project.MSG_INFO);
}
/**
* Logs a mesage with the given priority. This delegates
* the actual logging to the project.
*
* @param msg The message to be logged. Should not be <code>null</code>.
* @param msgLevel The message priority at which this message is to
* be logged.
*/
public void log(String msg, int msgLevel) {
project.log(this, msg, msgLevel);
}
/**
* Performs this task if it's still valid, or gets a replacement
* version and performs that otherwise.
*
* Performing a task consists of firing a task started event,
* configuring the task, executing it, and then firing task finished
* event. If a runtime exception is thrown, the task finished event
* is still fired, but with the exception as the cause.
*/
public final void perform() {
if (!invalid) {
try {
project.fireTaskStarted(this);
maybeConfigure();
execute();
project.fireTaskFinished(this, null);
} catch (RuntimeException exc) {
if (exc instanceof BuildException) {
BuildException be = (BuildException) exc;
if (be.getLocation() == Location.UNKNOWN_LOCATION) {
be.setLocation(getLocation());
}
}
project.fireTaskFinished(this, exc);
throw exc;
}
} else {
UnknownElement ue = getReplacement();
Task task = ue.getTask();
task.perform();
}
}
/**
* Marks this task as invalid. Any further use of this task
* will go through a replacement with the updated definition.
*/
final void markInvalid() {
invalid = true;
}
/**
* Replacement element used if this task is invalidated.
*/
private UnknownElement replacement;
/**
* Creates an UnknownElement that can be used to replace this task.
* Once this has been created once, it is cached and returned by
* future calls.
*
* @return the UnknownElement instance for the new definition of this task.
*/
private UnknownElement getReplacement() {
if (replacement == null) {
replacement = new UnknownElement(taskType);
replacement.setProject(project);
replacement.setTaskType(taskType);
replacement.setTaskName(taskName);
replacement.setLocation(location);
replacement.setOwningTarget(target);
replacement.setRuntimeConfigurableWrapper(wrapper);
wrapper.setProxy(replacement);
target.replaceChild(this, replacement);
replacement.maybeConfigure();
}
return replacement;
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
68ab2ed52f1ae7ee6a5bea6c284895c713b58786 | 14b23b02386063c8c161620fe4c750c971958e9c | /p2p-dal/src/main/java/com/icebreak/p2p/daointerface/InvestmentDao.java | 2f7111bca68afa2f04d6160a749a358e5af53219 | [] | no_license | RalphSu/789 | d6d60fa0ae6131871d2cd4782c547cc76f1e08f6 | 1a066f6d0429e8490df03e4e11063533cbcaa217 | refs/heads/master | 2021-01-24T04:55:32.398049 | 2016-03-13T09:28:41 | 2016-03-13T09:28:41 | 52,210,852 | 0 | 0 | null | 2016-02-21T14:40:36 | 2016-02-21T14:40:36 | null | UTF-8 | Java | false | false | 530 | java | package com.icebreak.p2p.daointerface;
import java.util.List;
import java.util.Map;
import com.icebreak.p2p.dataobject.Investment;
public interface InvestmentDao {
/**
* 根据条件查询
* @param params
* @return
*/
public List<Investment> getByProperties(Map<String, Object> params);
/**
* 根据条件查询条数
* @param params
* @return
*/
public long getCountByProperties(Map<String, Object> params);
/**
* 根据ID 查询
* @param id
* @return
*/
public Investment getById(long id);
}
| [
"windofdusk@gmail.com"
] | windofdusk@gmail.com |
221756b3cd127c718ff58892c86e6cec0e55d1ab | 9cc419743bb0a80b4954a6dde52a2912e92da54d | /app/src/main/java/com/ltdd/calculator/SettingActivity.java | f185b402caf27c56bf744ca588357730fd66f168 | [
"MIT"
] | permissive | ttoan12/CalculatorME | 445acb65c3ceccd06d694bb56ed7c6532d2ef284 | 9d3ffbe916d209721f8d6451242c95dabc3c9561 | refs/heads/master | 2020-07-04T08:28:20.173579 | 2019-10-02T07:05:58 | 2019-10-02T07:05:58 | 202,221,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,313 | java | package com.ltdd.calculator;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import java.util.Set;
public class SettingActivity extends AppCompatActivity {
SwitchCompat switchTheme;
private Button btAbout;
boolean stateTheme, stateLang;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES) {
setTheme(R.style.darkTheme);
} else setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final SharedPreferences preferences = getSharedPreferences("PREFS", 0);
stateTheme = preferences.getBoolean("switchTheme", false);
switchTheme = findViewById(R.id.switchTheme);
if ((AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES)) {
switchTheme.setChecked(true);
}
switchTheme.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
restartApp();
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
restartApp();
}
}
public void restartApp()
{
Intent i = new Intent(getApplicationContext(), SettingActivity.class);
startActivity(i);
finish();
}
});
btAbout = findViewById(R.id.btAbout);
btAbout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(SettingActivity.this);
View mView = getLayoutInflater().inflate(R.layout.dialog_about, null);
mBuilder.setView(mView);
final AlertDialog dialog = mBuilder.create();
dialog.setTitle("Application Info");
dialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
dialog.dismiss();
}
});
dialog.show();
}
});
}
}
| [
"mng1998"
] | mng1998 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.