blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
262d49614cd3a133e494d3dc5750b2fa06a8cfe4 | ed354f172ee5642ea2337fe0a7db7edbcfacf627 | /src/test/java/com/zero_bank/test/TestEditor.java | 4c2186b446baa8ca355d8158d054b55352a85835 | [] | no_license | AndrewChetvertakov/ZeroBank | 39f73ca035f4379aa0861b5756a73b80bd4be0ec | 38561bce82ed537484021159d1b56cf4e56de259 | refs/heads/master | 2023-09-04T10:57:28.868665 | 2021-09-17T18:00:15 | 2021-09-17T18:00:15 | 390,947,332 | 1 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,787 | java | package com.zero_bank.test;
public class TestEditor {
public static void main(String[] args) {
String story = "Feature:\tPurchase Foreign Currency\n" +
"Scenario:\tAvailable\tcurrencies\n" +
"Given the user accesses the Purchase\tforeign\tcurrency\tcash tab\n" +
"Then\tfollowing\tcurrencies should\tbe\tavailable\n" +
"|Australia\t(dollar) \t\t|\n" +
"www.cybertekschool.com [email protected]\n" +
"6\n" +
"|Canada\t(dollar) \t\t|\n" +
"|Switzerland\t(franc) \t\t|\n" +
"|China\t(yuan) \t\t|\n" +
"|Denmark\t(krone) \t\t|\n" +
"|Eurozone\t(euro) \t\t|\n" +
"|Great\tBritain\t(pound)|\n" +
"|Japan\t(yen) \t\t\t|\n" +
"|Mexico\t(peso) \t\t|\n" +
"|Norway\t(krone) \t\t|\n" +
"|New\tZealand\t(dollar) |\n" +
"|Singapore\t(dollar) \t\t\t\t\t\t|\n" +
"Scenario:\tError\tmessage for\tnot\tselecting\tcurrency\n" +
"Given the user accesses the Purchase\tforeign\tcurrency\tcash tab\n" +
"When\tuser tries\tto\tcalculate\tcost\twithout\tselecting\ta\tcurrency\n" +
"Then\terror\tmessage\tshould\tbe\tdisplayed\n" +
"Scenario:\tError\tmessage for\tnot\tentering\tvalue\n" +
"Given the user accesses the Purchase\tforeign\tcurrency\tcash tab\n" +
"When\tuser tries\tto\tcalculate\tcost\twithout\tentering\ta\tvalue\n" +
"Then error\tmessage\tshould\tbe\tdisplayed";
System.out.println(story.replace("\t", " ").replace("“","\"").replace("”","\""));
}
} | [
"[email protected]"
] | |
59c818cf66fe0edd4317ceb9b92bfd175918cf50 | edb2bc568ef330849c131d4c3ec0b0ffca0d3411 | /src/main/java/com/fpis/vipapp/VipAppApplication.java | 15180e759a3bac002da203be6c48b9fe74091691 | [] | no_license | radovanovicmm/vipapp | fff318863e1a3c5a9cd260f8fd2537adb9ae163c | 891af667f68e2a80d2811374c35fd3147847cf8b | refs/heads/main | 2023-01-31T14:48:05.060274 | 2020-12-17T12:36:32 | 2020-12-17T12:36:32 | 318,508,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package com.fpis.vipapp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
@SpringBootApplication
public class VipAppApplication {
public static void main(String[] args) {
SpringApplication.run(VipAppApplication.class, args);
}
}
| [
"[email protected]"
] | |
fa01dc81e09f2a11a3d56bfdff5424f69bf7e902 | 73f99ca9b06655e6fd294e84e4006c9ff2382a00 | /app/src/main/java/com/centaurstech/sdk/fragment/ProcessingFragment.java | cba7971a0c65652b53ab97542e18caebcdbd45ba | [] | no_license | y6692/SDKDemo | 638a0572116cc9ed4cf7d86e6a8cd41c99888d04 | 466d244af57c8095caf8f48b020720632e4a48f1 | refs/heads/master | 2021-02-22T10:25:12.230871 | 2020-03-09T05:33:37 | 2020-03-09T05:33:37 | 245,375,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 236 | java | package com.centaurstech.sdk.fragment;
/**
* Time:2019/12/25
* Author: 樊德鹏
* Description:
*/
public class ProcessingFragment extends OrderListFragment {
@Override
public int getPosition() {
return 2;
}
}
| [
"[email protected]"
] | |
5ea10256fc6aec53143268648e30d66fc75607a0 | 0c8a6458d8dd37019ca68b29d4c205201db9974c | /Lab2/Assignment2/src/domain/adt/MyInterfaceDictionary.java | c4140a7fe5e8ddcc70a8476a5761f8fdeefe2cc6 | [] | no_license | adrianatim/map | 36a5649334c7494d054488167563e7579567229a | e33648eda8715a5be9d7f931ba1b9cf547f89870 | refs/heads/master | 2023-02-09T05:30:52.775926 | 2020-12-28T16:54:48 | 2020-12-28T16:54:48 | 303,117,566 | 0 | 0 | null | 2020-10-11T13:00:50 | 2020-10-11T12:37:42 | Java | UTF-8 | Java | false | false | 242 | java | package domain.adt;
public interface MyInterfaceDictionary<TKey, TValue> {
void put(TKey k, TValue val);
void remove(TKey k);
TValue lookup(TKey t);
boolean isDefined(TKey t);
void update(TKey id, TValue val);
} | [
"[email protected]"
] | |
aaa9f0c93ae35314b0f5ffca5f0c2f251face5b5 | 8de1bdb0ca8110e0e7ad51b3fddb4b7580e3c326 | /pontus-domain/src/main/java/com/snowstore/pontus/repository/SpecialDetailRepository.java | 6c1cfbf9e8b6c8d692ef9bd85353d1f0cb26bbc1 | [] | no_license | cenbow/pontus | 1502d4485fbe2aa6b78d7a6132327b6349aa97fa | b3471ab6ae5567378293a3902d289c73c4c93570 | refs/heads/master | 2021-01-20T03:59:25.821841 | 2016-06-30T02:38:39 | 2016-06-30T02:38:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.snowstore.pontus.repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import com.snowstore.pontus.domain.SpecialContract;
import com.snowstore.pontus.domain.SpecialDetail;
@Repository
public interface SpecialDetailRepository extends PagingAndSortingRepository<SpecialDetail, Long>, JpaSpecificationExecutor<SpecialDetail> {
Page<SpecialDetail> findBySpecialContract(SpecialContract specialContract, Pageable pageable);
List<SpecialDetail> findBySpecialContractId(Long id);
}
| [
"[email protected]"
] | |
1ac5291a3991a60b6eaae52006bbe58077ec74ab | 0319afb5c64ed401fc4bcadc20fe39fe2634cb8e | /tags/icepdf-6.3.1/icepdf/examples/extraction/metadata/src/main/java/org/icepdf/os/examples/extraction/PageMetaDataExtraction.java | 8aa547acab59e13547ff0fea9d30ae9814dc6ef2 | [] | no_license | svn2github/icepdf-6_3_0_all | e3334b1d98c8fb3b400a57b05a32a7bcc2c86d99 | e73b943f4449c8967472a1f5a477c8c136afb803 | refs/heads/master | 2023-09-03T10:39:31.313071 | 2018-09-06T03:00:25 | 2018-09-06T03:00:25 | 133,867,237 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,783 | java | package org.icepdf.os.examples.extraction;
/*
* Copyright 2006-2017 ICEsoft Technologies Canada Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import org.icepdf.core.exceptions.PDFException;
import org.icepdf.core.exceptions.PDFSecurityException;
import org.icepdf.core.pobjects.Document;
import org.icepdf.core.pobjects.PInfo;
import org.icepdf.ri.util.FontPropertiesManager;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* The <code>PageMetaDataExtraction</code> class is an example of how to extract
* meta-data from a PDF document. A file specified at the command line is opened
* and the document's information is displayed on the command line.
*
* @since 2.0
*/
public class PageMetaDataExtraction {
public static void main(String[] args) {
// Get a file from the command line to open
String filePath = args[0];
// read/store the font cache.
FontPropertiesManager.getInstance().loadOrReadSystemFonts();
// open the url
Document document = new Document();
try {
document.setFile(filePath);
} catch (PDFException ex) {
System.out.println("Error parsing PDF document " + ex);
} catch (PDFSecurityException ex) {
System.out.println("Error encryption not supported " + ex);
} catch (FileNotFoundException ex) {
System.out.println("Error file not found " + ex);
} catch (IOException ex) {
System.out.println("Error handling PDF document " + ex);
}
// data to collect from document information entry
String title = "";
String author = "";
String subject = "";
String keyWords = "";
String creator = "";
String producer = "";
String creationDate = "";
String modDate = "";
// get document information values if available
PInfo documentInfo = document.getInfo();
if (documentInfo != null) {
title = documentInfo.getTitle();
author = documentInfo.getAuthor();
subject = documentInfo.getSubject();
keyWords = documentInfo.getKeywords();
creator = documentInfo.getCreator() != null ?
documentInfo.getCreator() : "Not Available";
producer = documentInfo.getProducer() != null ?
documentInfo.getProducer() : "Not Available";
creationDate = documentInfo.getCreationDate() != null ?
documentInfo.getCreationDate().toString() : "Not Available";
modDate = documentInfo.getModDate() != null ?
documentInfo.getModDate().toString() : "Not Available";
}
// Output the captured document information
System.out.println("Title: " + title);
System.out.println("Subject: " + subject);
System.out.println("Author: " + author);
System.out.println("Keywords: " + keyWords);
System.out.println("Creator: " + creator);
System.out.println("Producer: " + producer);
System.out.println("Created: " + creationDate);
System.out.println("Modified: " + modDate);
// clean up resources
document.dispose();
}
}
| [
"patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74"
] | patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74 |
594d2a3c6a6f7bd6d28ae33e4d625bbc945bda33 | 2d4e4709fd9eb663c0e693451b27ad73a0ba3a26 | /consumer.crm/src/main/java/com/iqb/consumer/crm/customer/service/impl/CustomerServiceImpl.java | a06f7d14ab5f317a15bbb75d6d6c4e121bfa8457 | [] | no_license | hapylong/consumer.platform | 0e7c21587e938d5e5a327af4fb1434183c6ac0c8 | 0005bdd447f325396cd48ce0b2b1547f45fec35a | refs/heads/master | 2020-04-11T04:04:13.826338 | 2018-12-19T10:00:42 | 2018-12-19T10:00:42 | 161,500,288 | 4 | 6 | null | null | null | null | UTF-8 | Java | false | false | 20,505 | java | package com.iqb.consumer.crm.customer.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.iqb.consumer.crm.base.CrmAttr.CrmImgType;
import com.iqb.consumer.crm.base.CrmAttr.CrmPushCommonAttr;
import com.iqb.consumer.crm.base.CrmAttr.CrmPushReceiveAttr;
import com.iqb.consumer.crm.base.CrmAttr.HttpInterMode;
import com.iqb.consumer.crm.base.CrmReturnInfo;
import com.iqb.consumer.crm.base.config.CrmConfig;
import com.iqb.consumer.crm.crmpush.service.ICrmPushService;
import com.iqb.consumer.crm.customer.bean.CustomerBean;
import com.iqb.consumer.crm.customer.bean.CustomerPushRecord;
import com.iqb.consumer.crm.customer.biz.CustomerBiz;
import com.iqb.consumer.crm.customer.service.ICustomerService;
import com.iqb.consumer.data.layer.bean.ownerloan.MyCheckInfoBean;
import com.iqb.consumer.data.layer.bean.user.UserBean;
import com.iqb.etep.common.exception.IqbException;
import com.iqb.etep.common.utils.BeanUtil;
import com.iqb.etep.common.utils.DateTools;
import com.iqb.etep.common.utils.GenerationUtil;
import com.iqb.etep.common.utils.JSONUtil;
import com.iqb.etep.common.utils.StringUtil;
/**
*
* Description: 客户信息实现类
*
* @author wangxinbang
* @version 1.0
*
* <pre>
* Modification History:
* Date Author Version Description
------------------------------------------------------------------
* 2016年9月19日 wangxinbang 1.0 1.0 Version
* </pre>
*/
@Service
@SuppressWarnings({"rawtypes", "unchecked"})
public class CustomerServiceImpl implements ICustomerService {
/**
* 日志
*/
private static Logger logger = LoggerFactory.getLogger(CustomerServiceImpl.class);
@Autowired
private CustomerBiz customerBiz;
@Autowired
private ICrmPushService crmPushServiceImpl;
@Autowired
private CrmConfig crmConfig;
@Override
public void saveCustomerServiceFromEtep(Map m) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(m)) {
throw new IqbException(CrmReturnInfo.ETEP_PUSH_01020001);
}
this.customerBiz.saveCustomerServiceFromEtep(m);
}
@Override
public void pushCustomerInfoToXFJR(Map<String, Object> m) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(m)) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030001);
}
CustomerBean customerBean = this.customerBiz.getCustomerInfoByCustmerCode(m);
/** 校验返回信息 **/
if (customerBean == null || StringUtil.isEmpty(customerBean.getCustomerCode())) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030002);
}
String riskFlag = m.get("riskFlag").toString();
String riskCode = null != m.get("riskCode") ? (String) m.get("riskCode") : "";
customerBean.setRiskFlag(riskFlag.equals("1") ? 1 : 2);
customerBean.setRiskCode(riskCode);
this.pushCustomerBean(customerBean);
}
private void pushCustomerBean(CustomerBean customerBean) throws IqbException {
String uuid = GenerationUtil.getUUID();
if (StringUtil.isEmpty(customerBean.getRequestType())) {
/** 封装请求类型 **/
customerBean.setRequestType(CrmPushCommonAttr.CRM_PUSH_TYPE_UPDATE);
if (StringUtil.isEmpty(customerBean.getPushTime())) {
customerBean.setRequestType(CrmPushCommonAttr.CRM_PUSH_TYPE_ADD);
}
}
/** 封装记录信息 **/
CustomerPushRecord customerPushRecord = new CustomerPushRecord();
customerPushRecord.setCustomerCode(customerBean.getCustomerCode());
customerPushRecord.setUuid(uuid);
customerPushRecord.setPushType(Integer.parseInt(CrmPushCommonAttr.CRM_PUSH_TYPE_ADD));
customerPushRecord.setPushTime(DateTools.getCurrTime());
customerPushRecord.setReceive(CrmPushReceiveAttr.RECEIVE_XFJR);
customerPushRecord.setPushStatus(Integer.parseInt(CrmPushCommonAttr.CRM_PUSH_STATUS_START));
this.customerBiz.insertCustomerPushRecord(customerPushRecord);
/** 开始推送客户信息 **/
try {
synchronized (this) {
logger.info("推送crm客户信息开始,客户信息" + JSONUtil.objToJson(customerPushRecord));
String retStr = "";
if (HttpInterMode.HTTPINTERMODE_HTTP.equals(crmConfig.getHttpInterfaceInteractionMode())) {
retStr =
this.crmPushServiceImpl.crmPushByPost(crmConfig.getUrlCrmCustomerCfmPush(),
this.CustomerBeanToXFJRMap(customerBean));
}
if (HttpInterMode.HTTPINTERMODE_HTTPS.equals(crmConfig.getHttpInterfaceInteractionMode())) {
retStr =
this.crmPushServiceImpl.crmPushByPostByHttps(crmConfig.getUrlCrmCustomerCfmPush(),
this.CustomerBeanToXFJRMap(customerBean));
}
/** 如果返回值为空,则抛出异常 **/
logger.info("消费金融返回信息:" + retStr);
if (StringUtil.isEmpty(retStr)) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030003);
}
JSONObject retMap = JSONUtil.strToJSON(retStr);
if (!CollectionUtils.isEmpty(retMap)
&& CrmPushCommonAttr.CRM_PUSH_STATUS_FAIL.equals(retMap.getString("success"))) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030003);
}
Map iqbResult = (Map) retMap.get("iqbResult");
if (!CollectionUtils.isEmpty(iqbResult)
&& !CrmPushCommonAttr.CRM_PUSH_XFJR_SUCC_RESULT.equals(iqbResult.get("result"))) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030003);
}
this.customerBiz.updatePushTimeByCustmerCode(customerBean);
}
} catch (Exception e) {
/** 推送异常 **/
logger.error("推送crm客户信息至" + customerPushRecord.getReceive() + "异常", e);
customerPushRecord.setPushTime(DateTools.getCurrTime());
customerPushRecord.setPushStatus(Integer.parseInt(CrmPushCommonAttr.CRM_PUSH_STATUS_ERROE));
this.customerBiz.insertCustomerPushRecord(customerPushRecord);
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030003);
}
/** 推送结束 **/
customerPushRecord.setPushTime(DateTools.getCurrTime());
customerPushRecord.setPushStatus(Integer.parseInt(CrmPushCommonAttr.CRM_PUSH_STATUS_END));
this.customerBiz.insertCustomerPushRecord(customerPushRecord);
}
/**
*
* Description: 将客户信息bean转成消费金融map
*
* @param
* @return Map
* @throws
* @Author wangxinbang Create Date: 2016年9月22日 下午2:28:01
*/
private Map CustomerBeanToXFJRMap(CustomerBean customerBean) {
Map retMap = new HashMap();
retMap.put("id", customerBean.getCustomerCode());
retMap.put("merchCode", customerBean.getCustomerShortNameCode());
retMap.put("merchShortName", customerBean.getCustomerShortName());
retMap.put("merchantFullName", customerBean.getCustomerFullName());
retMap.put("publicNo", customerBean.getHoldWeixin());
retMap.put("province", customerBean.getProvince());
retMap.put("city", customerBean.getCity());
retMap.put("merchAddr", customerBean.getAddressDetail());
retMap.put("riskType", customerBean.getRiskManageType());
retMap.put("parentId", customerBean.getHigherOrgCode());
retMap.put("level", customerBean.getLayer());
retMap.put("instalNo", customerBean.getInstallmentPlan());
retMap.put("overdueRate", customerBean.getOverdueInterestRate());
retMap.put("overdueFee", customerBean.getOverdueFixedFee());
retMap.put("overdueType", customerBean.getOverdueInterestModel());
retMap.put("enabled", customerBean.getIsVirtualMerc());
retMap.put("actcode", customerBean.getRequestType());
retMap.put("businessType", customerBean.getBusinessType());
retMap.put("riskFlag", customerBean.getRiskFlag());
retMap.put("riskCode", customerBean.getRiskCode());
return retMap;
}
@Override
public void updateCustomerInfoFromEtep(Map m) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(m)) {
throw new IqbException(CrmReturnInfo.ETEP_PUSH_01020001);
}
this.customerBiz.updateCustomerInfoFromEtep(m);
}
@Override
public PageInfo queryCustomerList(JSONObject objs) throws IqbException {
return new PageInfo<CustomerBean>(this.customerBiz.queryCustomerList(objs));
}
@Override
public void deleteCustomerInfo(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
throw new IqbException(CrmReturnInfo.CUSTOMER_PUSH_01030001);
}
CustomerBean customerBean = BeanUtil.mapToBean(objs, CustomerBean.class);
/** 校验数据完整性 **/
if (customerBean == null || StringUtil.isEmpty(customerBean.getCustomerCode())) {
throw new IqbException(CrmReturnInfo.COMMON_01010001);
}
CustomerBean dbCustomerBean = this.customerBiz.getCustomerInfoByCustmerCode(objs);
/** 已推送消费金融的商户,不可删除 2017年12月18日 11:01:41 chengzhen **/
Integer customerPushRecordCount =
this.customerBiz.selectCustomerPushRecordByCustomerCode(dbCustomerBean);
if (customerPushRecordCount > 0) {// 说明该商户已经推送消费金融
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040007);
}
this.customerBiz.deleteCustomerInfo(customerBean.getCustomerCode());
/** 校验返回信息 **/
// 修改BY chengzhen 2017年12月18日 11:17:00
/*
* if (dbCustomerBean == null || StringUtil.isEmpty(dbCustomerBean.getCustomerCode())) {
* return; } if (StringUtil.isEmpty(dbCustomerBean.getPushTime())) { return; }
* customerBean.setRequestType(CrmPushCommonAttr.CRM_PUSH_TYPE_DELETE);
* this.pushCustomerBean(customerBean);
*/
}
@Override
@Transactional(propagation = Propagation.REQUIRED)
public void insertCustomerInfo(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040001);
}
Map m = this.clearEmptyFromMapForCustomer(objs);
this.customerBiz.insertCustomerBaseInfo(m);
this.customerBiz.insertCustomerEnterpriseInfo(m);
this.customerBiz.insertCustomerXFJRInfo(m);
// 调用推送消费金融接口,将客户信息保存至客户信息表中
pushCustomerInfoToXFJR(objs);
}
@Override
@Transactional(propagation = Propagation.REQUIRED)
public void updateCustomerInfo(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040001);
}
this.customerBiz.updateCustomerBaseInfo(objs);
// 调用推送消费金融接口,将客户信息保存至客户信息表中
pushCustomerInfoToXFJR(objs);
}
@Override
public Map getCustomerInfoByCustomerCode(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040001);
}
CustomerBean bean = this.customerBiz.getCustomerInfoByCustmerCode(objs);
if (bean == null) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040003);
}
return BeanUtil.entity2map(bean);
}
/**
*
* Description: 清空map中的空值
*
* @param
* @return Map
* @throws
* @Author wangxinbang Create Date: 2016年9月25日 下午3:13:39
*/
@SuppressWarnings("unused")
private Map clearEmptyFromMap(Map m) {
Map retMap = new HashMap();
Set<String> keySet = m.keySet();
for (String key : keySet) {
if (m.get(key) != null && StringUtil.isNotEmpty((String) m.get(key))) {
retMap.put(key, m.get(key));
}
}
return retMap;
}
/**
* 用于特殊类型 集合的处理
*
* @param objs
* @param request
* @return
*/
private Map clearEmptyFromMapForCustomer(Map m) {
Map retMap = new HashMap();
Set<String> keySet = m.keySet();
for (String key : keySet) {
if (key.equals("customerType") || key.equals("businessType")) {
retMap.put(key, m.get(key));
} else {
if (m.get(key) != null && StringUtil.isNotEmpty((String) m.get(key))) {
retMap.put(key, m.get(key));
}
}
}
return retMap;
}
@Override
public List<CustomerBean> getCustomerInfoByCustomerType(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040001);
}
/** 校验客户类型 **/
if (StringUtil.isEmpty(objs.getString("customerType"))) {
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_01040005);
}
return this.customerBiz.getCustomerInfoByCustomerType(objs);
}
@Override
public void uploadCustomerImg(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
logger.error("客户图片上传异常:传入信息为空");
return;
}
/** 校验客户Id **/
if (StringUtil.isEmpty(objs.getString("customerCode"))) {
logger.error("客户图片上传异常:传入客户code为空");
return;
}
/** 校验图片路径 **/
if (StringUtil.isEmpty(objs.getString("imgUrl"))) {
logger.error("客户图片上传异常:传入图片路径为空");
return;
}
/** 校验图片类型 **/
if (StringUtil.isEmpty(objs.getString("imgType"))) {
logger.error("客户图片上传异常:传入图片类型为空");
return;
}
/** 获取图片类型 1:公司印章 2:法人印章 **/
String imgType = objs.getString("imgType");
if (CrmImgType.IMG_TYPE_COMPONY_IMG.equals(imgType)) {
this.customerBiz.uploadCustomerComponyImg(objs);
}
if (CrmImgType.IMG_TYPE_CORPORATE_IMG.equals(imgType)) {
this.customerBiz.uploadCustomerCorporateImg(objs);
}
}
@Override
public void deleteCustomerImg(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
logger.error("客户图片删除异常:传入信息为空");
return;
}
/** 校验客户Id **/
if (StringUtil.isEmpty(objs.getString("customerCode"))) {
logger.error("客户图片删除异常:传入客户code为空");
return;
}
/** 获取图片类型 1:公司印章 2:法人印章 **/
String imgType = objs.getString("imgType");
if (CrmImgType.IMG_TYPE_COMPONY_IMG.equals(imgType)) {
this.customerBiz.deleteCustomerComponyImg(objs.getString("customerCode"));
}
if (CrmImgType.IMG_TYPE_CORPORATE_IMG.equals(imgType)) {
this.customerBiz.deleteCustomerCorporateImg(objs.getString("customerCode"));
}
}
@Override
public Map getCustomerStoreInfoByCode(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
logger.error("门店查询接口:传入查询信息为空");
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_STORE_01050001);
}
if (StringUtil.isEmpty(objs.getString("customerCode"))) {
logger.error("门店查询接口:传入查询信息客户编码为空");
throw new IqbException(CrmReturnInfo.CRM_CUSTOMER_STORE_01050002);
}
CustomerBean bean = this.customerBiz.getCustomerStoreInfoByCode(objs);
if (bean == null) {
logger.error("门店查询接口:查询结果为空");
return new HashMap();
}
return BeanUtil.entity2map(bean);
}
@Override
public List<Map<String, Object>> getCustomerCityListByProvince(JSONObject objs) throws IqbException {
/** 校验传递信息是否为空 **/
if (CollectionUtils.isEmpty(objs)) {
logger.error("获取市下拉框集合:传入查询信息为空");
return new ArrayList<Map<String, Object>>();
}
if (StringUtil.isEmpty(objs.getString("provinceName"))) {
logger.error("获取市下拉框集合:传入查询信息客户编码为空");
return new ArrayList<Map<String, Object>>();
}
List<Map<String, Object>> cityList = this.customerBiz.getCustomerCityListByProvince(objs);
return cityList;
}
/**
* 根据商户code查询债权人信息列表
*
* @param params
* @return
* @Author haojinlong Create Date: 2017年11月3日
*/
@Override
public CustomerBean getCustomerStoreInfoListByCode(String customerCode) {
return customerBiz.getCustomerStoreInfoListByCode(customerCode);
}
/**
* FINANCE-2784 FINANCE-2690 蒲公英个人客户信息查询
*/
@Override
public PageInfo<MyCheckInfoBean> getDandelionCustomerList(JSONObject objs) {
List<UserBean> dandelionCustomerList = customerBiz.getDandelionCustomerList(objs, true);
List<MyCheckInfoBean> checkInfoBeanList = new ArrayList<>();
for (UserBean userBean : dandelionCustomerList) {
String checkInfo = userBean.getCheckInfo();
JSONObject jsb = JSONUtil.strToJSON(checkInfo);
MyCheckInfoBean checkBean = JSONObject.toJavaObject(jsb, MyCheckInfoBean.class);
checkInfoBeanList.add(checkBean);
}
PageInfo<UserBean> urbp = new PageInfo<>(dandelionCustomerList);
PageInfo<MyCheckInfoBean> urp = new PageInfo<>(checkInfoBeanList);
urp.setEndRow(urbp.getEndRow());
urp.setFirstPage(urbp.getFirstPage());
urp.setHasNextPage(urbp.isHasNextPage());
urp.setHasPreviousPage(urbp.isHasPreviousPage());
urp.setIsFirstPage(urbp.isIsFirstPage());
urp.setIsLastPage(urbp.isIsLastPage());
urp.setNavigatepageNums(urbp.getNavigatepageNums());
urp.setNextPage(urbp.getNextPage());
urp.setOrderBy(urbp.getOrderBy());
urp.setPageNum(urbp.getPageNum());
urp.setPages(urbp.getPages());
urp.setPageSize(urbp.getPageSize());
urp.setPrePage(urbp.getPrePage());
urp.setSize(urbp.getSize());
urp.setStartRow(urbp.getStartRow());
urp.setTotal(urbp.getTotal());
return urp;
}
/**
* FINANCE-2784 FINANCE-2690 蒲公英个人客户信息明细查询
*/
@Override
public MyCheckInfoBean getDandelionCustomerDetail(JSONObject objs) {
return customerBiz.getDandelionCustomerDetail(objs);
}
}
| [
"[email protected]"
] | |
74ce4bd507eaee90be944a082a23da472f7d5427 | 395ec784027c63711a60e4bacaa4ef57dc5457c9 | /lailem/src/main/java/com/lailem/app/widget/pulltorefresh/helper/DefaultLoadMoreHelper.java | 6fdc3b67c7f84b17fb98e28bfe2d00f0538511a3 | [] | no_license | StormFeng/LaiPrivateLe | 4e21f02284deb8bb70f28673db304c600bb811d8 | dadcb91658c1bcad5483dee27320b6a84cd721d5 | refs/heads/master | 2020-06-11T05:06:28.326139 | 2016-12-09T07:51:12 | 2016-12-09T07:51:12 | 76,000,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,215 | java | package com.lailem.app.widget.pulltorefresh.helper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.lailem.app.R;
import com.lailem.app.widget.pulltorefresh.HeaderFooterGridView;
import com.lailem.app.widget.pulltorefresh.helper.ILoadViewFactory.ILoadMoreView;
public class DefaultLoadMoreHelper implements ILoadMoreView {
protected View footView;
protected TextView text;
protected ProgressBar progressBar;
protected OnClickListener onClickRefreshListener;
@Override
public void init(AbsListView listView, OnClickListener onClickRefreshListener) {
footView = LayoutInflater.from(listView.getContext()).inflate(R.layout.layout_listview_foot, listView, false);
text = (TextView) footView.findViewById(R.id.text);
progressBar = (ProgressBar) footView.findViewById(R.id.progressBar);
if (listView instanceof ListView) {
((ListView) listView).addFooterView(footView);
} else if (listView instanceof HeaderFooterGridView) {
((HeaderFooterGridView) listView).addFooterView(footView);
}
this.onClickRefreshListener = onClickRefreshListener;
showNormal();
}
@Override
public void showNormal() {
text.setText("点击加载更多");
progressBar.setVisibility(View.GONE);
footView.setOnClickListener(onClickRefreshListener);
}
@Override
public void showLoading() {
text.setText("正在加载中..");
progressBar.setVisibility(View.VISIBLE);
footView.setOnClickListener(null);
}
@Override
public void showFail() {
progressBar.setVisibility(View.GONE);
text.setText("加载失败,点击重新加载");
footView.setOnClickListener(onClickRefreshListener);
}
@Override
public void showNomore() {
footView.setVisibility(View.INVISIBLE);
progressBar.setVisibility(View.GONE);
text.setText("已经加载完毕");
footView.setOnClickListener(null);
}
} | [
"[email protected]"
] | |
7f7125cbed561d4dbbaad005958eb9759810ae93 | 328e5512d2cc764a6a182596e6a4745d48375ae7 | /ddxj-worker-cms/src/main/java/net/zn/ddxj/config/WebMvcConfig.java | 8e0cbca14baa8f524e55031cd52e335f46a262db | [] | no_license | yangbingkun315/cms | e67b1b0958d9b390198290a22d2b9bfd30880ea5 | 80c494db4c76e1540bee7861f312374a6492abd4 | refs/heads/master | 2022-12-12T13:28:49.419679 | 2019-07-04T13:34:43 | 2019-07-04T13:34:43 | 163,160,603 | 0 | 1 | null | 2022-12-06T00:30:54 | 2018-12-26T09:14:38 | TSQL | UTF-8 | Java | false | false | 4,475 | java | package net.zn.ddxj.config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import net.zn.ddxj.config.intercepter.CommonIntercepter;
import net.zn.ddxj.constants.CmsConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter4;
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Autowired
private CommonIntercepter commonIntercepter;
/**
* fastJson相关设置
*/
private FastJsonConfig getFastJsonConfig() {
FastJsonConfig fastJsonConfig = new FastJsonConfig();
// 在serializerFeatureList中添加转换规则
List<SerializerFeature> serializerFeatureList = new ArrayList<SerializerFeature>();
serializerFeatureList.add(SerializerFeature.PrettyFormat);
serializerFeatureList.add(SerializerFeature.WriteMapNullValue);
serializerFeatureList.add(SerializerFeature.WriteNullStringAsEmpty);
serializerFeatureList.add(SerializerFeature.WriteNullListAsEmpty);
serializerFeatureList.add(SerializerFeature.DisableCircularReferenceDetect);
SerializerFeature[] serializerFeatures = serializerFeatureList.toArray(new SerializerFeature[serializerFeatureList.size()]);
fastJsonConfig.setSerializerFeatures(serializerFeatures);
return fastJsonConfig;
}
/**
* fastJson相关设置
*/
private FastJsonHttpMessageConverter4 fastJsonHttpMessageConverter() {
FastJsonHttpMessageConverter4 fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter4();
List<MediaType> supportedMediaTypes = new ArrayList<MediaType>();
supportedMediaTypes.add(MediaType.parseMediaType("text/html;charset=UTF-8"));
supportedMediaTypes.add(MediaType.parseMediaType("application/json"));
fastJsonHttpMessageConverter.setSupportedMediaTypes(supportedMediaTypes);
fastJsonHttpMessageConverter.setFastJsonConfig(getFastJsonConfig());
return fastJsonHttpMessageConverter;
}
/**
* 添加fastJsonHttpMessageConverter到converters
*/
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(fastJsonHttpMessageConverter());
}
/**
* 添加拦截器
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(commonIntercepter).addPathPatterns("/**")
.excludePathPatterns("/**/404.htm","/**/500.htm","/**/403.htm","*.css","*.js","/**/images/","/**/css/","/**/js/");
super.addInterceptors(registry);
}
/* @Bean
public FilterRegistrationBean registFilter() {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter();
registration.addUrlPatterns("/*");
registration.setOrder(1);
return registration;
}*/
//统一页码处理配置
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return new EmbeddedServletContainerCustomizer() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
//ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND,"/cms/404.htm");
ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/cms/500.htm");
container.addErrorPages( error404Page, error500Page);
}
};
}
}
| [
"[email protected]"
] | |
4d2011f1c601c96758323aa2fb8abec157b765e5 | f385d2b9a676fb4d3a46a00cfb95948915e5578c | /core/src/main/java/com/oklib/widget/GlideCircleTransform.java | fe61623f33da5acf0fa88f9bcb864b756863b5ef | [] | no_license | zhandejie/Oklib | e99fa497471ed7d39d6fd1b19c88aa99104bebf9 | 108948a4f906bb7c81e0c6d2b0712cfc311d935d | refs/heads/master | 2021-06-18T01:58:33.300543 | 2017-06-15T09:33:27 | 2017-06-15T09:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,612 | java | package com.oklib.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
/**
* .
*/
public class GlideCircleTransform extends BitmapTransformation {
public GlideCircleTransform(Context context) {
super(context);
}
@Override
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
return circleCrop(pool, toTransform);
}
private static Bitmap circleCrop(BitmapPool pool, Bitmap source) {
if (source == null) return null;
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squared = Bitmap.createBitmap(source, x, y, size, size);
Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888);
if (result == null) {
result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
return result;
}
@Override
public String getId() {
return getClass().getName();
}
}
| [
"[email protected]"
] | |
4ee8c1b802ee1013f46fe6250944bfb00c85d5e7 | 531e53ec827e212f6213609eeacd38db65b57fe0 | /src/test/java/br/pro/bruno/drogaria/dao/EstadoDAOTest.java | 7ace040fe214422e2bbb1619154e448b702cff25 | [] | no_license | brunodamasco/Drogaria | bbd8971ffd94eb13df0c5d1ef264d2dbec15a7c6 | fdbef76fd8d3a0df1a8a115f0bf60aa38681c034 | refs/heads/master | 2021-06-29T13:17:16.861948 | 2019-05-04T06:12:30 | 2019-05-04T06:12:30 | 183,305,503 | 0 | 0 | null | 2020-11-13T06:10:17 | 2019-04-24T20:55:21 | Java | UTF-8 | Java | false | false | 2,190 | java | package br.pro.bruno.drogaria.dao;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import br.pro.bruno.drogaria.domain.Estado;
public class EstadoDAOTest {
@Test
@Ignore
public void salvar() {
Estado estado = new Estado();
estado.setNome("Rio Grande do Sul");
estado.setSigla("RS");
EstadoDAO estadoDAO = new EstadoDAO();
estadoDAO.salvar(estado);
}
@Test
@Ignore
public void listar() {
EstadoDAO estadoDAO = new EstadoDAO();
List<Estado> resultado = estadoDAO.listar();
System.out.println("Total de Registros Encontrados: " + resultado.size());
for (Estado estado : resultado) {
System.out.println(estado.getCodigo() + " - " + estado.getSigla() + " - " + estado.getNome());
}
}
@Test
@Ignore
public void buscar() {
Long codigo = 3L;
EstadoDAO estadoDAO = new EstadoDAO();
Estado estado = estadoDAO.buscar(codigo);
if (estado == null) {
System.out.println("Nenhum registro encontrado");
} else {
System.out.println("Registro encontrado:");
System.out.println(estado.getCodigo() + " - " + estado.getSigla() + " - " + estado.getNome());
}
}
@Test
@Ignore
public void excluir() {
Long codigo = 4L;
EstadoDAO estadoDAO = new EstadoDAO();
Estado estado = estadoDAO.buscar(codigo);
if (estado == null) {
System.out.println("Nenhum registro encontrado");
} else {
estadoDAO.excluir(estado);
System.out.println("Registro removido:");
System.out.println(estado.getCodigo() + " - " + estado.getSigla() + " - " + estado.getNome());
}
}
@Test
@Ignore
public void editar() {
Long codigo = 5L;
EstadoDAO estadoDAO = new EstadoDAO();
Estado estado = estadoDAO.buscar(codigo);
if (estado == null) {
System.out.println("Nenhum registro encontrado");
} else {
System.out.println("Registro editado - Antes:");
System.out.println(estado.getCodigo() + " - " + estado.getSigla() + " - " + estado.getNome());
estado.setNome("Minas Gerais");
estado.setSigla("MG");
estadoDAO.editar(estado);
System.out.println("Registro editado - Depois:");
System.out.println(estado.getCodigo() + " - " + estado.getSigla() + " - " + estado.getNome());
}
}
} | [
"[email protected]"
] | |
b4b8c5c4907a8c239653d42ab92c90bfa1054186 | 9b0ee970ecc447181973952b9e0470ca3e1b5c25 | /mhub-20170825/java/src/main/java/com/aliyun/mhub20170825/models/SpiLogicalDeleteResourceRequest.java | 8ab68bbae449fa414bd0d61ae257c015f330e2c6 | [
"Apache-2.0"
] | permissive | start-doing/alibabacloud-sdk | 0c44185445ff7c86461bced4bc11717ad5e9ecbb | 9b5d3c7434ed8df91fa3c4cde6a6c7052f8ea289 | refs/heads/master | 2023-02-20T21:53:23.278841 | 2021-01-20T11:48:56 | 2021-01-20T11:48:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,518 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.mhub20170825.models;
import com.aliyun.tea.*;
public class SpiLogicalDeleteResourceRequest extends TeaModel {
@NameInMap("Interrupt")
public Boolean interrupt;
@NameInMap("Invoker")
@Validation(required = true)
public String invoker;
@NameInMap("Pk")
@Validation(required = true)
public String pk;
@NameInMap("Bid")
@Validation(required = true)
public String bid;
@NameInMap("Hid")
@Validation(required = true)
public Long hid;
@NameInMap("Country")
@Validation(required = true)
public String country;
@NameInMap("TaskIdentifier")
@Validation(required = true)
public String taskIdentifier;
@NameInMap("TaskExtraData")
@Validation(required = true)
public String taskExtraData;
@NameInMap("GmtWakeup")
@Validation(required = true)
public String gmtWakeup;
@NameInMap("Success")
public Boolean success;
@NameInMap("Message")
public String message;
public static SpiLogicalDeleteResourceRequest build(java.util.Map<String, ?> map) throws Exception {
SpiLogicalDeleteResourceRequest self = new SpiLogicalDeleteResourceRequest();
return TeaModel.build(map, self);
}
public SpiLogicalDeleteResourceRequest setInterrupt(Boolean interrupt) {
this.interrupt = interrupt;
return this;
}
public Boolean getInterrupt() {
return this.interrupt;
}
public SpiLogicalDeleteResourceRequest setInvoker(String invoker) {
this.invoker = invoker;
return this;
}
public String getInvoker() {
return this.invoker;
}
public SpiLogicalDeleteResourceRequest setPk(String pk) {
this.pk = pk;
return this;
}
public String getPk() {
return this.pk;
}
public SpiLogicalDeleteResourceRequest setBid(String bid) {
this.bid = bid;
return this;
}
public String getBid() {
return this.bid;
}
public SpiLogicalDeleteResourceRequest setHid(Long hid) {
this.hid = hid;
return this;
}
public Long getHid() {
return this.hid;
}
public SpiLogicalDeleteResourceRequest setCountry(String country) {
this.country = country;
return this;
}
public String getCountry() {
return this.country;
}
public SpiLogicalDeleteResourceRequest setTaskIdentifier(String taskIdentifier) {
this.taskIdentifier = taskIdentifier;
return this;
}
public String getTaskIdentifier() {
return this.taskIdentifier;
}
public SpiLogicalDeleteResourceRequest setTaskExtraData(String taskExtraData) {
this.taskExtraData = taskExtraData;
return this;
}
public String getTaskExtraData() {
return this.taskExtraData;
}
public SpiLogicalDeleteResourceRequest setGmtWakeup(String gmtWakeup) {
this.gmtWakeup = gmtWakeup;
return this;
}
public String getGmtWakeup() {
return this.gmtWakeup;
}
public SpiLogicalDeleteResourceRequest setSuccess(Boolean success) {
this.success = success;
return this;
}
public Boolean getSuccess() {
return this.success;
}
public SpiLogicalDeleteResourceRequest setMessage(String message) {
this.message = message;
return this;
}
public String getMessage() {
return this.message;
}
}
| [
"[email protected]"
] | |
1cd225980822503dc17858eca7004c285a79595c | 85827ed2aaa5c80084aecd6b92301b02fcf0ab1d | /BOJ/Sort/1015_수열정렬/AY_1015_수열정렬.java | c3de251aadbeac5dc6cd460091f04712293cee5c | [] | no_license | LeeA0/AlgoAlgo | 1c8600d9195aa5a887db0dfa3d49431938333ab7 | e71da92078b6fce1342f723e92b0893d9d525a31 | refs/heads/main | 2023-05-26T05:42:34.471277 | 2021-06-01T18:38:43 | 2021-06-01T18:38:43 | 342,244,830 | 0 | 3 | null | 2021-04-04T13:47:39 | 2021-02-25T12:56:42 | Java | UTF-8 | Java | false | false | 1,647 | java | package day;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
// 백준_수열정렬_1015_실버4
public class BOJ_1015_수열정렬 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Comparator<int[]> comparator = new Comparator<int[]>() {
@Override
public int compare(int[] o1, int[] o2) {
if(o1[0]==o2[0]) {
return Integer.compare(o1[1], o2[1]);
}
return Integer.compare(o1[0], o2[0]);
}
};
PriorityQueue<int[]> A = new PriorityQueue<>(comparator);
int N = Integer.parseInt(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
// A = 2 3 1 1 2 3
// i = 0 1 2 => 2 0 1
for (int i = 0; i < N; i++) {
// A배열을 인덱스와 함께 우선순위큐에 집어 넣어 오름차순으로 정렬한다
A.offer(new int[] { Integer.parseInt(st.nextToken()), i });
}
PriorityQueue<int[]> P = new PriorityQueue<>(comparator);
// A = 1 2 3
// i = 2 0 1 0 1 2
// P[i] = 0 1 2 => 1 2 0
for (int i = 0; i < N; i++) {
// A배열의 인덱스와 B배열의 인덱스를 우선순위 큐에 집어 넣어 A배열의 인덱스를 기준으로 오름차순으로 정렬한다
// 여기서 A배열의 인덱스는 P배열의 인덱스와 같다
P.offer(new int[] { A.poll()[1], i });
}
// 출력
StringBuilder sb = new StringBuilder();
for (int i = 0; i < N; i++) {
sb.append(P.poll()[1]).append(" ");
}
System.out.println(sb);
}
}
| [
"[email protected]"
] | |
91d67275c95d2cecac4f877268192e7abbd26f68 | 83e81c25b1f74f88ed0f723afc5d3f83e7d05da8 | /services/core/java/com/android/server/wm/FactoryErrorDialog.java | 977904d41eda4a096beef8afdab5834abef41c25 | [
"Apache-2.0",
"LicenseRef-scancode-unicode"
] | permissive | Ankits-lab/frameworks_base | 8a63f39a79965c87a84e80550926327dcafb40b7 | 150a9240e5a11cd5ebc9bb0832ce30e9c23f376a | refs/heads/main | 2023-02-06T03:57:44.893590 | 2020-11-14T09:13:40 | 2020-11-14T09:13:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,776 | java | /*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.wm;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.view.WindowManager;
import com.android.server.am.BaseErrorDialog;
final class FactoryErrorDialog extends BaseErrorDialog {
public FactoryErrorDialog(Context context, CharSequence msg) {
super(context);
setCancelable(false);
setTitle(context.getText(com.android.internal.R.string.factorytest_failed));
setMessage(msg);
setButton(DialogInterface.BUTTON_POSITIVE,
context.getText(com.android.internal.R.string.factorytest_reboot),
mHandler.obtainMessage(0));
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.setTitle("Factory Error");
getWindow().setAttributes(attrs);
}
public void onStop() {
}
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
throw new RuntimeException("Rebooting from failed factory test");
}
};
}
| [
"[email protected]"
] | |
07fc1972c83914a97743251195678926c243fbd1 | 71f02c247dc21e43e0eceaf3339597024a3bd0e1 | /src/main/java/tn/esprit/spring/services/ChirugienService.java | 462f9977ed909c82625f0907d835b96163b32a77 | [] | no_license | hajerbenarbia/Stage | aa8d3b23ae548580456189819455fbca2c16f114 | c6fda29b77f842947c86c3837eb77107480f0bb7 | refs/heads/master | 2023-08-29T12:27:06.137251 | 2021-10-26T20:41:21 | 2021-10-26T20:41:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package tn.esprit.spring.services;
import java.util.List;
import tn.esprit.spring.entities.Chirugien;
public interface ChirugienService {
public List<Chirugien> retrieveAllChirugien();
public Chirugien addChirugien(Chirugien r) ;
public void deleteChirugien(String id) ;
public Chirugien updateChirugien(Chirugien chirugien);
public Chirugien retrieveChirugien(Long id);
public Chirugien retrieveChirugien(String id) ;
}
| [
"[email protected]"
] | |
1c951c016bdd9cf8781575231a32fb28a1c9e1a3 | f2e54bc17dc9bff0d342adbb31cd1fb9a6f45fe4 | /src/main/java/java/awt/print/Printable.java | e1dda688ce9b47c51d0b58c843dfce84ad5c0388 | [] | no_license | LeonDevLifeLog/poi-awt | a21b1bddab452948f40f9edc1fea7db96fec5820 | 7baa26659ba715b174f2091216cb7c07280b4b6e | refs/heads/master | 2020-05-26T09:31:23.539044 | 2019-05-23T07:51:56 | 2019-05-23T08:09:19 | 188,187,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,498 | java | /*
* Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package java.awt.print;
import java.awt.Graphics;
/**
* The <code>Printable</code> interface is implemented
* by the <code>print</code> methods of the current
* page painter, which is called by the printing
* system to render a page. When building a
* {@link Pageable}, pairs of {@link PageFormat}
* instances and instances that implement
* this interface are used to describe each page. The
* instance implementing <code>Printable</code> is called to
* print the page's graphics.
* <p>
* A <code>Printable(..)</code> may be set on a <code>PrinterJob</code>.
* When the client subsequently initiates printing by calling
* <code>PrinterJob.print(..)</code> control
* <p>
* is handed to the printing system until all pages have been printed.
* It does this by calling <code>Printable.print(..)</code> until
* all pages in the document have been printed.
* In using the <code>Printable</code> interface the printing
* commits to image the contents of a page whenever
* requested by the printing system.
* <p>
* The parameters to <code>Printable.print(..)</code> include a
* <code>PageFormat</code> which describes the printable area of
* the page, needed for calculating the contents that will fit the
* page, and the page index, which specifies the zero-based print
* stream index of the requested page.
* <p>
* For correct printing behaviour, the following points should be
* observed:
* <ul>
* <li> The printing system may request a page index more than once.
* On each occasion equal PageFormat parameters will be supplied.
*
* <li>The printing system will call <code>Printable.print(..)</code>
* with page indexes which increase monotonically, although as noted above,
* the <code>Printable</code> should expect multiple calls for a page index
* and that page indexes may be skipped, when page ranges are specified
* by the client, or by a user through a print dialog.
*
* <li>If multiple collated copies of a document are requested, and the
* printer cannot natively support this, then the document may be imaged
* multiple times. Printing will start each copy from the lowest print
* stream page index page.
*
* <li>With the exception of re-imaging an entire document for multiple
* collated copies, the increasing page index order means that when
* page N is requested if a client needs to calculate page break position,
* it may safely discard any state related to pages < N, and make current
* that for page N. "State" usually is just the calculated position in the
* document that corresponds to the start of the page.
*
* <li>When called by the printing system the <code>Printable</code> must
* inspect and honour the supplied PageFormat parameter as well as the
* page index. The format of the page to be drawn is specified by the
* supplied PageFormat. The size, orientation and imageable area of the page
* is therefore already determined and rendering must be within this
* imageable area.
* This is key to correct printing behaviour, and it has the
* implication that the client has the responsibility of tracking
* what content belongs on the specified page.
*
* <li>When the <code>Printable</code> is obtained from a client-supplied
* <code>Pageable</code> then the client may provide different PageFormats
* for each page index. Calculations of page breaks must account for this.
* </ul>
* <p>
* @see Pageable
* @see PageFormat
* @see PrinterJob
*/
public interface Printable {
/**
* Returned from {@link #print(Graphics, PageFormat, int)}
* to signify that the requested page was rendered.
*/
int PAGE_EXISTS = 0;
/**
* Returned from <code>print</code> to signify that the
* <code>pageIndex</code> is too large and that the requested page
* does not exist.
*/
int NO_SUCH_PAGE = 1;
/**
* Prints the page at the specified index into the specified
* {@link Graphics} context in the specified
* format. A <code>PrinterJob</code> calls the
* <code>Printable</code> interface to request that a page be
* rendered into the context specified by
* <code>graphics</code>. The format of the page to be drawn is
* specified by <code>pageFormat</code>. The zero based index
* of the requested page is specified by <code>pageIndex</code>.
* If the requested page does not exist then this method returns
* NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned.
* The <code>Graphics</code> class or subclass implements the
* {@link PrinterGraphics} interface to provide additional
* information. If the <code>Printable</code> object
* aborts the print job then it throws a {@link PrinterException}.
* @param graphics the context into which the page is drawn
* @param pageFormat the size and orientation of the page being drawn
* @param pageIndex the zero based index of the page to be drawn
* @return PAGE_EXISTS if the page is rendered successfully
* or NO_SUCH_PAGE if <code>pageIndex</code> specifies a
* non-existent page.
* @exception PrinterException
* thrown when the print job is terminated.
*/
int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
throws PrinterException;
}
| [
"[email protected]"
] | |
e0b1e034a348ac62fd1ab10bbc67ff0cc71d0a1a | 8b17153dff357938e4646bd771648df3883877d0 | /mpi/src/main/java/com/ghostflow/http/security/JWTAuthorizationFilter.java | be903ebb13e49cb3b4d6891d9869e27a3ef4046a | [
"MIT"
] | permissive | chebykinn/university | c272670a8676837319a1e0c3506722275987c1b3 | 49491b4d942cedbda1c178d5634c5109f1b81a81 | refs/heads/master | 2022-09-24T15:22:05.145988 | 2019-12-18T05:25:19 | 2019-12-18T05:25:19 | 70,061,560 | 2 | 3 | MIT | 2022-09-22T18:41:43 | 2016-10-05T13:09:51 | Java | UTF-8 | Java | false | false | 2,155 | java | package com.ghostflow.http.security;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
public class JWTAuthorizationFilter extends BasicAuthenticationFilter {
private final Constants.Security security;
public JWTAuthorizationFilter(Constants.Security security, AuthenticationManager authManager) {
super(authManager);
this.security = security;
}
@Override
protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain) throws IOException, ServletException {
String header = req.getHeader(security.getHeader());
if (header == null || !header.startsWith(security.getTokenPrefix())) {
chain.doFilter(req, res);
return;
}
UsernamePasswordAuthenticationToken authentication = getAuthentication(req);
SecurityContextHolder.getContext().setAuthentication(authentication);
chain.doFilter(req, res);
}
private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) {
String token = request.getHeader(security.getHeader());
if (token != null) {
// parse the token.
String user = JWT.require(Algorithm.HMAC512(security.getSecret().getBytes()))
.build()
.verify(token.replace(security.getTokenPrefix(), ""))
.getSubject();
if (user != null) {
return new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>());
}
return null;
}
return null;
}
} | [
"[email protected]"
] | |
22eae23c34c37e58a30645f574bad92e1133d99f | af0352e7ae86d5ad117207136202a8b53ada5c87 | /javatest/src/main/java/com/example/thread/SynchronizedTest.java | 5020fd492709e4e30c80f2cd6642cd853b376eb6 | [] | no_license | ZhanJJ/Jame | 25b2c48b0f4e6dc7d73895862ada30240ef0c8eb | 743f181434729dcb5fc9ca79eeb1c47b96d95e65 | refs/heads/master | 2021-01-19T05:19:10.072379 | 2019-03-07T03:07:46 | 2019-03-07T03:07:46 | 100,502,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package com.example.thread;
/**
* Created by James on 2016/9/3.
*/
public class SynchronizedTest {
static int num = 10;
static class CountThread extends Thread {
@Override
public void run() {
synchronized (""){
while (num > 0) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("tickets" + num--);
}
}
}
}
public static void main(String[] args) {
new CountThread().start();
new CountThread().start();
new CountThread().start();
new CountThread().start();
}
}
| [
"[email protected]"
] | |
bf73251825efb450bd5eaedbd1d8f564e409d0e7 | 328b5ec957af0a5c8bb19a91e126837857cc81e8 | /dbmonitor/DbMonitor/src/com/jump/MaxdbMonitor.java | cbbd1192df49093946697d07e282e16ff29673f7 | [] | no_license | linzon/java_web_manager | c0dde9150dc7b7659499e83db25d0bd3fd2fa3cf | 73e7b6261e5fb9feea8e2a35ef5eb505fc526b83 | refs/heads/master | 2020-12-25T15:08:18.836170 | 2016-02-20T09:22:45 | 2016-02-20T09:22:45 | 67,701,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,727 | java | package com.jump;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MaxdbMonitor implements IMonitorBuz{
private static Connection connection = null;
@Override
public String getCharacters(String args) throws SQLException {
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select value from sysinfo.activeconfiguration where lower(parametername) = lower('default_code')", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getCpu(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select cpuload from sysinfo.machineutilization", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getDataFileDir(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select value from sysinfo.activeconfiguration where lower(parametername) = lower('rundirectory')", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getDatabaseNum(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select count(*) from domain.serverdbs", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getDatabaseVersion(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select id from sysinfo.version", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getMemery(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select (physicalmemorysize - physicalmemoryusable) / physicalmemorysize from sysinfo.machineconfiguration, sysinfo.machineutilization", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public String getSession(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select count(*) session_count from sysinfo.sessions", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
/**
* 获取数据库服务器运行时间
* @param args
* @return
* @throws SQLException
*/
private long getLastRunSeconds() throws SQLException {
String date_time = "";
ResultSet resultSet = DBUtil.executeQuery("select restart_date || ' ' || restart_time || '|' || now() from dbtimes", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
date_time = resultSet.getString(1);
}
resultSet.close();
if (date_time.trim().length() <= 0) {
throw new SQLException("not get Start Date Time");
}
int sepIndex = date_time.indexOf("|");
if (sepIndex < 0) {
throw new SQLException("not get Now Date Time");
}
try {
String restart_date_time = date_time.substring(0, sepIndex);
String now_date_time = date_time.substring(sepIndex + 1);
SimpleDateFormat dateFormat = new SimpleDateFormat();
dateFormat.applyPattern("yyyy-MM-dd HH:mm:ss");
Date restart_dt = dateFormat.parse(restart_date_time);
long restart_sec = restart_dt.getTime();
dateFormat.applyPattern("yyyy-MM-dd HH:mm:ss");
Date now_dt = dateFormat.parse(now_date_time);
long now_sec = now_dt.getTime();
long sec_distance = (now_sec - restart_sec) / 1000;
return sec_distance;
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new SQLException(e);
}
}
@Override
public String getUpTime(String args) throws SQLException {
long last_run_seconds = getLastRunSeconds();
String days = String.valueOf(last_run_seconds / (60 * 60 * 24));
String hours = String.valueOf((last_run_seconds % (60 * 60 * 24)) / (60 * 60));
String minites = String.valueOf(((last_run_seconds % (60 * 60 * 24)) % (60 * 60)) / 60);
String seconds = String.valueOf(((last_run_seconds % (60 * 60 * 24)) % (60 * 60)) % 60);
return days + "天" + hours + "小时" + minites + "分钟" + seconds + "秒";
}
@Override
public String getUserConnections(String args) throws SQLException {
// TODO Auto-generated method stub
String res = "";
ResultSet resultSet = DBUtil.executeQuery("select count(*) from domain.connectedusers", connection);
while (resultSet.next()) {
//解析结果集,必要时进行结果计算
res = resultSet.getString(1);
}
resultSet.close();
//返回结果
return res;
}
@Override
public void destroy() throws SQLException {
connection.close();
}
@Override
public void init(String param) throws SQLException, ClassNotFoundException {
String host = "";
String port = "";
String username = "";
String password = "";
String dbname = "";
String[] paras = param.split("&");
for (int i = 0; i < paras.length; i++) {
if(paras[i].indexOf("host=")!=-1){
host = paras[i].substring(paras[i].indexOf("=")+1);
}
if(paras[i].indexOf("port=")!=-1){
port = paras[i].substring(paras[i].indexOf("=")+1);
}
if(paras[i].indexOf("username=")!=-1){
username = paras[i].substring(paras[i].indexOf("=")+1);
}
if(paras[i].indexOf("password=")!=-1){
password = paras[i].substring(paras[i].indexOf("=")+1);
}
if(paras[i].indexOf("dbname=")!=-1){
dbname = paras[i].substring(paras[i].indexOf("=")+1);
}
}
Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
String url = "jdbc:sapdb://" + host + ":" + port + "/" + dbname;
connection = DriverManager.getConnection(url, username,password);
}
}
| [
"[email protected]"
] | |
6aa96bb8b3a291c3c3a4e202261f6001dfd3efb2 | 9e38d5963fa5f6be93d0ddbfc0fee4555a4a5168 | /app/src/main/java/aykhadma/droidahmed/com/aykhaama/wholesale_api/GetWholeSaleSubCategory.java | 38d54139246f1bf81414b0e94c616a77b4c49565 | [] | no_license | proAhmed/ai5dama | 2907fc900e9cbe51f95704ccc6a53c19b205c949 | a46c8cc9896c30ed02adf263500a2c11131ecbc8 | refs/heads/master | 2021-01-23T02:30:47.607421 | 2019-04-07T09:58:51 | 2019-04-07T09:58:51 | 86,003,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,361 | java | package aykhadma.droidahmed.com.aykhaama.wholesale_api;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import aykhadma.droidahmed.com.aykhaama.R;
import aykhadma.droidahmed.com.aykhaama.interfaces.OnLoadingComplete;
import aykhadma.droidahmed.com.aykhaama.shopping_model.ShoppingCategoryMain;
import aykhadma.droidahmed.com.aykhaama.wholesale_model.WholeSaleCategoryMain;
import aykhadma.droidahmed.com.aykhaama.whosale.WholeSaleMain;
public class GetWholeSaleSubCategory extends AsyncTask<String, Void, WholeSaleCategoryMain> {
private String URL = "http://ai5adma.com/API/ar/wsproduct/categoriesbyparent/";
private ProgressDialog dialog;
private OnLoadingComplete callback;
private Context context;
public GetWholeSaleSubCategory(Context context, OnLoadingComplete cb, double id) {
dialog = new ProgressDialog(context);
callback = cb;
this.context = context;
URL = URL+id;
Log.d("iiill2",URL);
}
@Override
protected void onPreExecute() {
this.dialog.setMessage(context.getResources().getString(
R.string.loading_proudct));
this.dialog.setCancelable(false);
this.dialog.show();
}
@Override
protected WholeSaleCategoryMain doInBackground(String... params) {
String responseJSON = null;
try {
responseJSON = invokeJSONWS();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Gson gson = new Gson();
WholeSaleCategoryMain obj = null;
if (responseJSON != null && responseJSON.length() > 1) {
GsonBuilder gb = new GsonBuilder();
gb.serializeNulls();
gson = gb.create();
try {
obj = gson.fromJson(responseJSON, WholeSaleCategoryMain.class);
} catch (com.google.gson.JsonSyntaxException ex) {
ex.printStackTrace();
}
}
return obj;
}
@Override
protected void onPostExecute(WholeSaleCategoryMain result) {
if (dialog.isShowing()) {
dialog.dismiss();
}
if (result != null) {
callback.onSuccess(result);
} else {
callback.onFailure();
}
}
private String invokeJSONWS() throws IOException {
HttpURLConnection httpConn = null;
InputStream in = null;
int response = -1;
String responseJSON;
URL url = new URL(URL);
URLConnection conn = url.openConnection();
if (!(conn instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection");
try {
httpConn = (HttpURLConnection) conn;
httpConn.setRequestMethod("GET");
httpConn.setDoInput(true);
httpConn.setDoOutput(true);
httpConn.connect();
response = httpConn.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
in = conn.getInputStream();
}
BufferedReader reader = new BufferedReader(
new InputStreamReader(in));
StringBuilder out = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
out.append(line);
}
responseJSON = out.toString();
} catch (Exception e) {
throw new IOException("Error connecting");
}finally {
httpConn.disconnect();
}
return responseJSON;
}
}
| [
"[email protected]"
] | |
9fc94c27ad66ca89c3a261e7a72d4908d854b0be | a9245d70ed3214deb84620ea84310dd4146078e4 | /sandbox/src/test/java/ua/annalonskaya/sandbox/PointTests.java | 83f89c749d127a0429a0abeb8ed9ca9b813b7886 | [
"Apache-2.0"
] | permissive | AnnaLonskaya/java_barancev_course | 9aab44e4afca3cfa7fb7a35daa99f4c5ae0d4eae | 0e2a36b244f730b6ef63e5d11379e61ef53b9d74 | refs/heads/master | 2021-01-22T05:23:55.110518 | 2017-05-18T19:34:26 | 2017-05-18T19:34:26 | 81,654,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package ua.annalonskaya.sandbox;
import org.testng.Assert;
import org.testng.annotations.Test;
import static ua.annalonskaya.sandbox.Point.distance;
public class PointTests {
@Test
public void testDistanceP1P2() {
Point p1 = new Point(4, 5);
Point p2 = new Point(2, 3);
Assert.assertEquals(distance(p1, p2), 2.8284271247461903);
}
@Test
public void testDistanceqP2() {
Point p1 = new Point(4, 5);
Point p2 = new Point(2, 3);
Assert.assertEquals(p1.distance(p2), 2.8284271247461903);
}
}
| [
"[email protected]"
] | |
8bf0c0eeeb159ba3060d90f3e936004546684016 | c36e1f2f1712f71cd11c829588ef8e82b09b7ef1 | /java/monkey_foxwan_socket/src/com/stang/game/entity/detail/GameEInsDetail.java | f61c7d77b2ad950699bf3455f2a9ccdd4fcad048 | [] | no_license | CJSDCQS/Monkey-Web-Game | 8b5645c7d5278708679827b956e9ca17d60a93e0 | c2e93001db22df775c9638651d84d9bb2dcdb52a | refs/heads/master | 2021-12-04T08:15:23.863743 | 2014-10-24T09:10:44 | 2014-10-24T09:10:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package com.stang.game.entity.detail;
import com.stang.game.entity.GameEIns;
public class GameEInsDetail extends GameEIns{
}
| [
"[email protected]"
] | |
824edc323edbdded933eb4384c3927881fa321bf | 211f40b21b9a92b38b665baa571f86fba45a7c73 | /app/src/main/java/com/hackm/famiryboard/model/viewobject/Deco.java | 4b98d4bee3f40934a0b3e3c2b11e045dbbe4633f | [] | no_license | hackm/FamiryBoard | 90e659aee463e326b6442cf136534496b6dd14d9 | 1ec79ca08cf13b68c15c329eca0e65921f022fd1 | refs/heads/master | 2021-01-21T18:11:45.638941 | 2015-05-10T14:10:27 | 2015-05-10T14:10:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,692 | java | package com.hackm.famiryboard.model.viewobject;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Point;
import android.util.Log;
import com.hackm.famiryboard.model.system.AppConfig;
import com.hackm.famiryboard.view.widget.WhiteBoardView;
import com.squareup.picasso.Target;
/**
* Created by shunhosaka on 2014/12/27.
*/
public class Deco {
public static final int TYPE_CAMERA = 0;
public static final int TYPE_GALLERY = 1;
public static final int TYPE_STAMP = 1;
public static final int TYPE_TEXT = 2;
public float x, y;
public float width, height;
public int rotation;
public int type = TYPE_CAMERA;
public String boardId;
public String id;
//Jsonにするときに無視する
public transient Bitmap bitmap;
private transient Paint paint = null;
public Deco() {
}
public Deco(Bitmap bitmap, float x, float y, float width, float height, int rotation, int type, String boardId) {
this.bitmap = bitmap;
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.rotation = rotation;
this.type = type;
if(AppConfig.DEBUG) {
Log.d("Deco", "Constructor Value:" + "(x:" + Float.toString(x) + ", y:" + Float.toString(y) + ")");
Log.d("Deco", "Constructor Value:" + "(width:" + Float.toString(width) + ", height:" + Float.toString(height) + ")");
Log.d("Deco", "Constructor Value:" + "(rotation:" + Integer.toString(rotation) + ")");
}
}
// Non Bitmap Type
public Deco(float x, float y, float width, float height, int rotation, int type, String boardId) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.rotation = rotation;
this.type = type;
}
/**
* Draw this object
* @param canvas
*/
public void draw(Canvas canvas) {
if (this.width == 0 || this.height == 0) {
this.width = bitmap.getWidth() / 2;
this.height = bitmap.getHeight() / 2;
}
canvas.drawBitmap(bitmap, getMatrix(), paint);
}
/**
* @return Matrix
*/
private Matrix getMatrix() {
Matrix matrix = new Matrix();
matrix.setScale(width / bitmap.getWidth(), height / bitmap.getHeight());
matrix.postRotate(rotation, width / 2, height / 2);
matrix.postTranslate(x - width / 2, y - height / 2);
return matrix;
}
/**
* タッチしているかを返す。
* @param touch is touch CakeDecoView point
* @return
*/
public int getTouchType(Point touch) {
Point[] points = getRectPoints();
int halfImageSize = (int) (WhiteBoardView.MENU_BUTTON_SIZE / 2);
if (Math.sqrt((touch.x - points[0].x) * (touch.x - points[0].x) + (touch.y - points[0].y) * (touch.y - points[0].y)) < halfImageSize) {
//points[0] -> delete
return WhiteBoardView.TYPE_DELETE;
} else if (Math.sqrt((touch.x - points[1].x) * (touch.x - points[1].x) + (touch.y - points[1].y) * (touch.y - points[1].y)) < halfImageSize) {
//points[1] -> change
return WhiteBoardView.TYPE_CHANGE;
} else if(crossingNumber(points, touch)) {
return WhiteBoardView.TYPE_TAP;
} else {
return WhiteBoardView.TYPE_NONE;
}
}
public Point[] getRectPoints() {
//ラジアン角に変換
Double radian = rotation* Math.PI / 180;
double coordinateX1 = width / 2 * Math.cos(radian);
double coordinateX2 = height / 2 * Math.sin(radian);
double coordinateY1 = width / 2 * Math.sin(radian);
double coordinateY2 = height / 2 * Math.cos(radian);
//頂点の角ポイント
Point[] points = new Point[4];
points[0] = new Point((int) (-coordinateX1 + coordinateX2 + x), (int) (-coordinateY1 - coordinateY2 + y));
points[1] = new Point((int) (coordinateX1 + coordinateX2 + x), (int) (coordinateY1 - coordinateY2 + y));
points[2] = new Point((int) (coordinateX1 - coordinateX2 + x), (int) (coordinateY1 + coordinateY2 + y));
points[3] = new Point((int) (-coordinateX1 - coordinateX2 + x), (int) (-coordinateY1 + coordinateY2 + y));
if(AppConfig.DEBUG) {
for(Point point : points) {
Log.d("getRectPoints","Point: "+point.toString());
}
}
return points;
}
/**
* Set new object size and rotation
* @param touch (touch is RightTop point new Object size)
* TODO
*/
public void setChange(Point touch) {
//拡張点のポイントを求める
Point[] points = getRectPoints();
Double radian = Math.toRadians(rotation);
//最初の角度
double firstRotaition = getRadian(x, y, points[1].x, points[1].y) * 180d / Math.PI;
//新しい角度
double newRotaition = getRadian(x, y, (double) touch.x, (double) touch.y) * 180d / Math.PI;
//差分を以前の角度に足す
rotation -= (int) (newRotaition - firstRotaition);
if(AppConfig.DEBUG) {
Log.d("Deco", "Deco rotation:" + Integer.toString(rotation));
}
// 大きさ
double currentLength = Math.sqrt(width * width + height * height) / 2;
double newLength = Math.sqrt((touch.x - x) * (touch.x - x) + (touch.y - y) * (touch.y - y));
double scale = newLength / currentLength;
width = width * (float)scale;
height = height * (float)scale;
}
protected double getRadian(double x, double y, double x2, double y2) {
double radian = Math.atan2(x2 - x, y2 - y);
return radian;
}
/**
* Crossing Number Algorithm
* @param polygon
* @param touch
* @return
*/
boolean crossingNumber(Point[] polygon, Point touch) {
int cnt = 0;
for (int i = 0; i < 4; ++i) {
final int x1 = polygon[(i + 1) % 4].x - polygon[i].x;
final int y1 = polygon[(i + 1) % 4].y - polygon[i].y;
final int x2 = touch.x - polygon[i].x;
final int y2 = touch.y - polygon[i].y;
if (x1 * y2 - x2 * y1 < 0) {
++cnt;
} else {
--cnt;
}
}
if(AppConfig.DEBUG) {
Log.d("Deco","Touch Point: "+touch.toString());
Log.d("Deco", "CrossingNumber CN:" + Integer.toString(cnt));
}
return cnt == 4 || cnt == -4;
}
}
| [
"[email protected]"
] | |
64feb6e9b3e3d5ec4db506c4ed30fe51108f13f6 | c8474a513671c4f78b5b9fea2df79797b7593185 | /src/main/java/Model/Entity/Tipoestudiocitologico.java | a07d69f803176a60b782fb5ed3e5bf59befea340 | [] | no_license | rgormpcs/HEEE | 4e028b51af19cd32ffa6edf87f90a30147601697 | 77d04e79a9f2cc8c8d46b83abd18a5183c27475c | refs/heads/master | 2021-01-20T14:03:48.621212 | 2017-09-11T18:12:52 | 2017-09-11T18:12:52 | 90,555,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,294 | 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 Model.Entity;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author EPN
*/
@Entity
@Table(name = "tipoestudiocitologico")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Tipoestudiocitologico.findAll", query = "SELECT t FROM Tipoestudiocitologico t"),
@NamedQuery(name = "Tipoestudiocitologico.findByIdtec", query = "SELECT t FROM Tipoestudiocitologico t WHERE t.idtec = :idtec"),
@NamedQuery(name = "Tipoestudiocitologico.findByDescripcionmarcadortec", query = "SELECT t FROM Tipoestudiocitologico t WHERE t.descripcionmarcadortec = :descripcionmarcadortec")})
public class Tipoestudiocitologico implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idtec")
private Integer idtec;
@Size(max = 50)
@Column(name = "descripcionmarcadortec")
private String descripcionmarcadortec;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "idtec")
private List<Categoria> categoriaList;
public Tipoestudiocitologico() {
}
public Tipoestudiocitologico(Integer idtec) {
this.idtec = idtec;
}
public Integer getIdtec() {
return idtec;
}
public void setIdtec(Integer idtec) {
this.idtec = idtec;
}
public String getDescripcionmarcadortec() {
return descripcionmarcadortec;
}
public void setDescripcionmarcadortec(String descripcionmarcadortec) {
this.descripcionmarcadortec = descripcionmarcadortec;
}
@XmlTransient
public List<Categoria> getCategoriaList() {
return categoriaList;
}
public void setCategoriaList(List<Categoria> categoriaList) {
this.categoriaList = categoriaList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idtec != null ? idtec.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Tipoestudiocitologico)) {
return false;
}
Tipoestudiocitologico other = (Tipoestudiocitologico) object;
if ((this.idtec == null && other.idtec != null) || (this.idtec != null && !this.idtec.equals(other.idtec))) {
return false;
}
return true;
}
@Override
public String toString() {
return "Model.Entity.Tipoestudiocitologico[ idtec=" + idtec + " ]";
}
}
| [
"[email protected]"
] | |
001634f26c1aa5724d61afda30f2ca6f7d76cf12 | 124a826bc963bdc4bd9a6a6c5e1801bb8a62a0f5 | /net/minecraft/server/ItemLeash.java | 162fcfec0eca6c74d8238b31b182f2d156beca94 | [] | no_license | speakeasy/mc-dev | b816587d1adbf2d7832906c0dae7a1356aa852af | 80720c97b503fd771185f0e68e061b62f48e48ad | refs/heads/master | 2020-04-05T23:43:14.310524 | 2013-06-26T01:58:25 | 2013-07-02T03:17:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,689 | java | package net.minecraft.server;
import java.util.Iterator;
import java.util.List;
public class ItemLeash extends Item {
public ItemLeash(int i) {
super(i);
this.a(CreativeModeTab.i);
}
public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
int i1 = world.getTypeId(i, j, k);
if (Block.byId[i1] != null && Block.byId[i1].d() == 11) {
if (world.isStatic) {
return true;
} else {
a(entityhuman, world, i, j, k);
return true;
}
} else {
return false;
}
}
public static boolean a(EntityHuman entityhuman, World world, int i, int j, int k) {
EntityLeash entityleash = EntityLeash.b(world, i, j, k);
boolean flag = false;
double d0 = 7.0D;
List list = world.a(EntityInsentient.class, AxisAlignedBB.a().a((double) i - d0, (double) j - d0, (double) k - d0, (double) i + d0, (double) j + d0, (double) k + d0));
if (list != null) {
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
EntityInsentient entityinsentient = (EntityInsentient) iterator.next();
if (entityinsentient.bD() && entityinsentient.bE() == entityhuman) {
if (entityleash == null) {
entityleash = EntityLeash.a(world, i, j, k);
}
entityinsentient.b(entityleash, true);
flag = true;
}
}
}
return flag;
}
}
| [
"[email protected]"
] | |
367064b1e9b7483c466b0532175230fc259f8333 | cbdfb6072e38e9c7867c82cffcb6899fb39a290b | /app/src/main/java/com/lfk/drawapictiure/View/MarkDown/parser/BoldParser.java | aa9ff8a86195e8c908bd0159daae95f058bbebb7 | [] | no_license | lfkdsk/draw-picture-yunnote | 7350dce9204e6410cbed7cb40493b1a7d5cd6893 | 78539dc56c9fa6cf2dde2098fabd6256b1d3a1af | refs/heads/master | 2021-01-19T17:36:48.007785 | 2017-04-15T08:41:20 | 2017-04-15T08:41:20 | 88,334,776 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java |
package com.lfk.drawapictiure.View.MarkDown.parser;
import com.lfk.drawapictiure.View.MarkDown.Markdown;
public class BoldParser extends Markdown.MDParser {
private static final String KEY = "**";
@Override
public Markdown.MDWord parseLineFmt(String content) {
return Markdown.MDWord.NULL;
}
@Override
public Markdown.MDWord parseWordFmt(String content) {
if (!content.startsWith(KEY)) {
return Markdown.MDWord.NULL;
}
int position = content.indexOf(KEY, 2);
if (position == -1) {
return Markdown.MDWord.NULL;
}
return new Markdown.MDWord(content.substring(2, position), position + 2, Markdown.MD_FMT_BOLD);
}
}
| [
"[email protected]"
] | |
1be6d701cc19fb1fcdeed13e49a1f78bec292b93 | 01f1f247fe3fd446e806e7f88604fda7ca7bff48 | /sftp.src/com/jscape/util/k/g.java | 3d3a7b5e66f6a07336fd899d97f1a31f4f96af0b | [] | no_license | DiegoTc/ImageUpload | bba6761ecc8f8e925b0da77fb2dac1c413793db6 | c306b1186d3d2f3d3e64157a337a3f7a3eca9bcd | refs/heads/master | 2016-09-07T18:39:23.469651 | 2014-03-14T20:34:57 | 2014-03-14T20:34:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package com.jscape.util.k;
public abstract interface g
{
public abstract boolean a(String paramString);
}
/* Location: C:\Users\dturcios\Documents\NetBeansProjects\ImageUploader\dist\lib\sftp.jar
* Qualified Name: com.jscape.util.k.g
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
0b5a6fb14cb783d142da20d03511676fb1bc2458 | 1e340da2abde11df00c0374d942ffdb5cbda9c67 | /ModuleDemo/src/com/augustpharmacist/set21_JDBC/jdbc/JDBCDemo3.java | 083c3197c32b817472fd8993031130ec6fc2b67d | [] | no_license | AugustPharmacist/PracticeDemo | 32e36f062d3f6b6b3b4a59f5baef54395c16f1d7 | 3279e17b05e22500d0f17ad774f1f4bda65d17ab | refs/heads/master | 2020-11-29T14:26:39.684855 | 2020-01-29T15:39:23 | 2020-01-29T15:39:23 | 229,653,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,670 | java | package com.augustpharmacist.set21_JDBC.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
/**
* account表 修改记录
*/
public class JDBCDemo3 {
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
try {
//1. 注册驱动
Class.forName("com.mysql.jdbc.Driver");
//2.获取连接对象
conn = DriverManager.getConnection("jdbc:mysql:///db3", "root", "root");
//3.定义sql
String sql = "update account set balance = 1500 where id = 3";
//4.获取执行sql对象
stmt = conn.createStatement();
//5.执行sql
int count = stmt.executeUpdate(sql);
//6.处理结果
System.out.println(count);
if (count > 0) {
System.out.println("修改成功!");
} else {
System.out.println("修改失败");
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} finally {
//7.释放资源
if (stmt != null) {
try {
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
}
| [
"[email protected]"
] | |
98bc5ea24edbc6af04f9709bca2a2f03dde0a1ed | ccdcc09206e72f95599517663273d7b05b5c45f9 | /l06/ub1/complete/movierental.jpa/src/test/java/ch/fhnw/eaf/rental/services/dto/MovieDtoServiceTest.java | 01fdc43e57da6868e08ddac6a75b2eebb97596d2 | [] | no_license | cintoros/eaf-gradle | 50b1a16ecd23b3c23d4c2489520658be39918881 | bcb73c18da46e8a3817d2230ec01a2ea47d5b917 | refs/heads/master | 2023-03-01T18:07:49.751771 | 2021-02-07T10:55:58 | 2021-02-07T10:55:58 | 296,248,078 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,432 | java | package ch.fhnw.eaf.rental.services.dto;
import ch.fhnw.eaf.rental.model.dto.MovieDto;
import org.junit.Before;
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.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@RunWith(SpringRunner.class)
@SpringBootTest
@Transactional
public class MovieDtoServiceTest {
@Autowired
private DtoMovieService movieService;
private int totalNumberOfMovies;
@Before
public void setUp() {
totalNumberOfMovies = movieService.getAllMovies().size();
}
@Test
public void testChangeTitle() {
String title = "Marie Curie";
MovieDto movie = movieService.getMovieById(1L);
assertEquals(movie.getTitle(), title);
movie.setTitle("NEW");
Long id = movieService.saveOrUpdateMovie(movie);
assertEquals(movie.getId(), id);
MovieDto updatedMovie = movieService.getMovieById(1L);
System.out.println(updatedMovie);
assertEquals("NEW", updatedMovie.getTitle());
}
@Test
public void testCreateMovie() {
List<MovieDto> movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
Long category = movies.get(0).getPriceCategoryId();
MovieDto movie = new MovieDto("testMovie", LocalDate.now(), category);
Long id = movieService.saveOrUpdateMovie(movie);
movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies + 1, movies.size());
MovieDto movie2 = movieService.getMovieById(id);
assertTrue(movie.getReleaseDate().equals(movie2.getReleaseDate()));
assertTrue(movie.getPriceCategoryId().equals(movie2.getPriceCategoryId()));
assertTrue(movie.getTitle().equals(movie2.getTitle()));
}
@Test
public void testDeleteMovie() {
List<MovieDto> movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
MovieDto movie = null;
String title = "Die göttliche Ordnung";
for (MovieDto m : movies) {
if (m.getTitle().equals(title)) {
movie = m;
}
}
assertTrue("Movie " + title + "not found", movie != null);
movieService.deleteMovie(movie.getId());
movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies - 1, movies.size());
}
@Test(expected = RuntimeException.class)
public void testDeleteRentedMovie() {
MovieDto movie = movieService.getMovieById(1L);
assertTrue(movie.isRented());
movieService.deleteMovie(movie.getId());
}
@Test(expected = RuntimeException.class)
public void testDeleteMovieUsedByRental() {
List<MovieDto> movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
MovieDto movie = movies.get(0);
assertEquals("Marie Curie", movie.getTitle());
movieService.deleteMovie(movie.getId());
}
@Test
public void testGetByTitle() {
List<MovieDto> movies = movieService.getAllMovies();
MovieDto m = movies.get(0);
movies = movieService.getMoviesByTitle(m.getTitle());
assertTrue("result must contain movie m", movies.size() > 0);
assertTrue("result must contain movie m", movies.contains(m));
}
@Test
public void testDeleteAndInsertMovie() {
List<MovieDto> movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
MovieDto movie = movies.get(4);
movieService.deleteMovie(movie.getId());
movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies - 1, movies.size());
Long id = movieService.saveOrUpdateMovie(movie);
System.out.println(id);
movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
}
@Test
public void changeMovie() {
List<MovieDto> movies = movieService.getAllMovies();
assertEquals(totalNumberOfMovies, movies.size());
MovieDto m1 = movies.get(1);
MovieDto m2 = new MovieDto("####", m1.getReleaseDate(), m1.getPriceCategoryId());
m2.setId(m1.getId());
m2.setRented(m1.isRented());
movieService.saveOrUpdateMovie(m2);
m1 = movieService.getMovieById(m1.getId());
assertEquals(m2.getTitle(), m1.getTitle());
}
}
| [
"[email protected]"
] | |
5d9ca7b06e3043a67b7b3845fe04f01064ca84c2 | 44786bfae670d80a8cf0538909ed79886a6402b0 | /src/JavaCourse_Section_18_Debugging/StringUtilities.java | 950e3e7a4e7e2af6507bbfa6e8594a55af595e0a | [] | no_license | MiKwasny/JavaCourse | 4cb02975997cbd460c643454fc7a7b6aa89bdc71 | 943a4712d850045010048ba6dcb924639eba69b6 | refs/heads/master | 2020-03-28T04:02:43.214802 | 2019-05-28T15:36:20 | 2019-05-28T15:36:20 | 147,691,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package JavaCourse_Section_18_Debugging;
public class StringUtilities {
private StringBuilder sBuilder = new StringBuilder();
private int charsAdded = 0;
public void addChar(StringBuilder sBuilder, char c){
sBuilder.append(c);
charsAdded++;
}
public String upperAndPrefing(String str){
String upper = str.toUpperCase();
return "Prefix " +upper;
}
public String addSuffic(String str){
return str + "__sufix";
}
}
| [
"[email protected]"
] | |
44ac5af970006d23f0514aa928835441a0817a05 | 2059fa24057af67790664d346e3704ea2d9e569d | /lib-common/src/main/java/com/libcommon/action/mode/BaseBean.java | b5128e74a151d16bfa4363a9753e5c343d662eed | [] | no_license | pujianggh/EMIS800TS_Android_App | 7c6692d6b491ef83ce67013c794d36b208bd9c31 | de7515d5938440748fc64a6bb19266d2eb9a58cd | refs/heads/master | 2020-03-26T22:59:25.116553 | 2018-08-21T03:28:59 | 2018-08-21T03:28:59 | 145,501,553 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 726 | java | package com.libcommon.action.mode;
import java.io.Serializable;
/**
* 基类,Bean
*
* @author pujiang
* @date 2018/8/15 16:23
* @mail [email protected]
* @Description:
*/
public class BaseBean implements Serializable {
private int code = 0;
private String message;
private String status;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
| [
"[email protected]"
] | |
b872b45bbf7d597e47d271a8c37ad91356998b11 | 927939f9c3893bc11847540d94df77893de4d6c2 | /doc/api/EngineProjectile.java | a4ec63270ceabebde5af8b8d9b53cb88e47a6efb | [
"MIT"
] | permissive | susiechoi/game-authoring-envt | b39c62c04626ed5d223b6042b75cfbd701fc0ade | b0a9c3f7dd3422fad9ffded916da0a923e19bdd5 | refs/heads/master | 2021-09-16T18:42:08.396897 | 2018-06-23T15:47:14 | 2018-06-23T15:47:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package api;
/**
* Class is used when a projectile is launched from the Launcher (in Tower and possibly enemy)
* @author ryanpond
*
*/
public interface EngineProjectile {
/**
* Called when this projectile hits an enemy. It will destroy itself, as well as
* @return the amount of damage it does.
*/
public Integer hitsEnemy();
}
| [
"[email protected]"
] | |
ff15a5cb4e5c4b051dce3d9de5b118ff374c3166 | 6f8901129f76926bb8daf21e41968c336eed8980 | /app/src/main/java/com/inerun/dropinsta/data/ParcelListingData.java | d2235f8b269a5592cc4119d033264821e7e27d40 | [] | no_license | vinay-a/DropInsta | 214444d02036a72e52d470a601853c310cdb4923 | 19d386948ed47d6643d5210d9853a715af31198b | refs/heads/master | 2021-01-09T05:53:09.084545 | 2017-02-03T13:21:38 | 2017-02-03T13:21:38 | 80,813,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,166 | java | package com.inerun.dropinsta.data;
import java.io.Serializable;
import java.util.ArrayList;
/**
* Created by vineet on 11/29/2016.
*/
public class ParcelListingData implements Serializable {
private boolean status;
private String message;
private long delivered_num;
private long pending_num;
private ArrayList<ParcelData> deliveryData;
private ArrayList<TransactionData> transdata;
public long getDelivered_num() {
return delivered_num;
}
public ArrayList<TransactionData> getTransdata() {
return transdata;
}
public long getPending_num() {
return pending_num;
}
public ArrayList<ParcelData> getDeliveryData() {
return deliveryData;
}
public ParcelListingData(long delivered_num, long pending_num) {
this.delivered_num = delivered_num;
this.pending_num = pending_num;
}
public ParcelListingData(long delivered_num, long pending_num, ArrayList<ParcelData> deliveryData) {
this.delivered_num = delivered_num;
this.pending_num = pending_num;
this.deliveryData = deliveryData;
}
public ParcelListingData() {
}
public class ParcelData implements Serializable {
private int column_id;
private String barcode;
private String custid;
private String name;
private String weight;
private String specialinstructions;
private int deliverystatus;
private String deliverycomments;
private int payment_type;
private int payment_status;
private String parcel_type;
private String amount;
private String currency;
private String date;
private String source_address1;
private String source_address2;
private String source_city;
private String source_state;
private String source_pin;
private String source_phone;
private String delivery_address1;
private String delivery_address2;
private String delivery_city;
private String delivery_state;
private String delivery_pin;
private String delivery_phone;
private String reciever_name;
private String transaction_timestamp;
private String transc_type;
public ParcelData(String barcode, String amount, String currency) {
this.barcode = barcode;
this.amount = amount;
this.currency = currency;
}
private String transcid;
private String rackno;
private String binno;
private boolean isselected;
public final static int DELIVERED = 9;
public final static int PENDING = 12;
public final static int ATTEMPTED = 14;
public final static int TRANSACTION_CARD = 1;
public final static int TRANSACTION_CASH = 2;
public ArrayList<ParcelStatus> status;
//
public String deliveryAddress;
public ParcelData(String barcode, String specialinstructions, int deliverystatus, String
amount, String currency, String date, String delivery_address1, String
delivery_address2, String delivery_city, String delivery_state, String
delivery_pin, String delivery_phone) {
this.barcode = barcode;
this.specialinstructions = specialinstructions;
this.deliverystatus = deliverystatus;
this.amount = amount;
this.currency = currency;
this.date = date;
this.delivery_address1 = delivery_address1;
this.delivery_address2 = delivery_address2;
this.delivery_city = delivery_city;
this.delivery_state = delivery_state;
this.delivery_pin = delivery_pin;
this.delivery_phone = delivery_phone;
}
public ParcelData(int column_id, String barcode, String name, String weight, String
specialinstructions, int deliverystatus, String deliverycomments, int payment_type,
int payment_status, String parcel_type, String amount, String currency, String
date, String source_address1, String source_address2, String source_city, String
source_state, String source_pin, String source_phone, String delivery_address1, String
delivery_address2, String delivery_city, String delivery_state, String
delivery_pin, String delivery_phone,String custid) {
this.column_id = column_id;
this.barcode = barcode;
this.name = name;
this.weight = weight;
this.specialinstructions = specialinstructions;
this.deliverystatus = deliverystatus;
this.deliverycomments = deliverycomments;
this.payment_type = payment_type;
this.payment_status = payment_status;
this.parcel_type = parcel_type;
this.amount = amount;
this.currency = currency;
this.date = date;
this.source_address1 = source_address1;
this.source_address2 = source_address2;
this.source_city = source_city;
this.source_state = source_state;
this.source_pin = source_pin;
this.source_phone = source_phone;
this.delivery_address1 = delivery_address1;
this.delivery_address2 = delivery_address2;
this.delivery_city = delivery_city;
this.delivery_state = delivery_state;
this.delivery_pin = delivery_pin;
this.delivery_phone = delivery_phone;
this.custid = custid;
}
public int getColumn_id() {
return column_id;
}
public String getBarcode() {
return barcode;
}
public String getName() {
return name;
}
public String getWeight() {
return weight;
}
public String getSpecialinstructions() {
return specialinstructions;
}
public int getDeliverystatus() {
return deliverystatus;
}
public String getDeliverycomments() {
return deliverycomments;
}
public void setDeliverycomments(String deliverycomments) {
this.deliverycomments = deliverycomments;
}
public int getPayment_type() {
return payment_type;
}
public String getCustid() {
return custid;
}
public int getPayment_status() {
return payment_status;
}
public String getParcel_type() {
return parcel_type;
}
public String getAmount() {
return amount;
}
public String getCurrency() {
return currency;
}
public String getDate() {
return date;
}
public String getSource_address1() {
return source_address1;
}
public String getSource_address2() {
return source_address2;
}
public String getSource_city() {
return source_city;
}
public String getSource_state() {
return source_state;
}
public String getSource_pin() {
return source_pin;
}
public String getSource_phone() {
return source_phone;
}
public String getDelivery_address1() {
return delivery_address1;
}
public String getDelivery_address2() {
return delivery_address2;
}
public String getDelivery_city() {
return delivery_city;
}
public String getDelivery_state() {
return delivery_state;
}
public String getDelivery_pin() {
return delivery_pin;
}
public String getDelivery_phone() {
return delivery_phone;
}
public boolean isDelivered() {
return deliverystatus == DELIVERED;
}
public boolean isselected() {
return isselected;
}
public void setIsselected(boolean isselected) {
this.isselected = isselected;
}
public String getRackno() {
return rackno;
}
public String getBinno() {
return binno;
}
public String getReciever_name() {
return reciever_name;
}
public String getTransaction_timestamp() {
return transaction_timestamp;
}
public String getTransc_type() {
return transc_type;
}
public String getTranscid() {
return transcid;
}
public ArrayList<ParcelStatus> getStatus() {
return status;
}
public String getDeliveryAddress() {
String add = "";
if (getDelivery_address1() != null && getDelivery_address1().trim().length() > 0) {
add = getDelivery_address1() + ", ";
}
if (getDelivery_address2() != null && getDelivery_address2().trim().length() > 0) {
add = add + getDelivery_address2() + ", ";
}
if (getDelivery_city() != null && getDelivery_city().trim().length() > 0) {
add = add + getDelivery_city() + ", ";
}
if (getDelivery_state() != null && getDelivery_state().trim().length() > 0) {
add = add + getDelivery_state() + ", ";
}
if (getDelivery_pin() != null && getDelivery_pin().trim().length() > 0) {
add = getDelivery_pin() + ", ";
}
// if(add.length() == add.lastIndexOf(",") + 1){
// add = add.substring(0, add.lastIndexOf(","));
// }
return add;
}public String getSourceAddress() {
String add = "";
if (getSource_address1() != null && getSource_address1().trim().length() > 0) {
add = getSource_address1() + ", ";
}
if (getSource_address2() != null && getSource_address2().trim().length() > 0) {
add = add + getSource_address2() + ", ";
}
if (getSource_city() != null && getSource_city().trim().length() > 0) {
add = add + getSource_city() + ", ";
}
if (getSource_state() != null && getSource_state().trim().length() > 0) {
add = add + getSource_state() + ", ";
}
if (getSource_pin() != null && getSource_pin().trim().length() > 0) {
add = getSource_pin() + ", ";
}
// if(add.length() == add.lastIndexOf(",") + 1){
// add = add.substring(0, add.lastIndexOf(","));
// }
return add;
}
public void setColumn_id(int column_id) {
this.column_id = column_id;
}
}
}
| [
"[email protected]"
] | |
4b6a7a0bf4ae009c3615760818214fb15b577923 | cf2b76d380774c048336126e644f8bfa2edd9f34 | /项目备份/e3-main/e3-share/src/main/java/com/e3expo/e3/model/Appeal.java | f47b06d921d65852f578a34a6fdd2908fc4b1368 | [] | no_license | cirsyou/web_daily | fc13abcad5b19e90bac35e876e4338f8ef4a7555 | a8f79ff0e3adc0aa4edb113fa3d0362402e67769 | refs/heads/master | 2021-09-23T09:41:57.961435 | 2018-09-21T06:42:19 | 2018-09-21T06:42:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,427 | java | package com.e3expo.e3.model;
import java.io.Serializable;
public class Appeal implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.order_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer orderId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.designer_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer designerId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.company_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer companyId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.appeal_type
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer appealType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.appeal_msg
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private String appealMsg;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.link_men
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private String linkMen;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.link_phone
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private String linkPhone;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.status
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.handler_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Integer handlerId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.remark
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private String remark;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.create_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Long createTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column te_appeal.update_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
private Long updateTime;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.id
*
* @return the value of te_appeal.id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.id
*
* @param id the value for te_appeal.id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.order_id
*
* @return the value of te_appeal.order_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getOrderId() {
return orderId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.order_id
*
* @param orderId the value for te_appeal.order_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.designer_id
*
* @return the value of te_appeal.designer_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getDesignerId() {
return designerId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.designer_id
*
* @param designerId the value for te_appeal.designer_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setDesignerId(Integer designerId) {
this.designerId = designerId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.company_id
*
* @return the value of te_appeal.company_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getCompanyId() {
return companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.company_id
*
* @param companyId the value for te_appeal.company_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.appeal_type
*
* @return the value of te_appeal.appeal_type
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getAppealType() {
return appealType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.appeal_type
*
* @param appealType the value for te_appeal.appeal_type
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setAppealType(Integer appealType) {
this.appealType = appealType;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.appeal_msg
*
* @return the value of te_appeal.appeal_msg
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public String getAppealMsg() {
return appealMsg;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.appeal_msg
*
* @param appealMsg the value for te_appeal.appeal_msg
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setAppealMsg(String appealMsg) {
this.appealMsg = appealMsg;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.link_men
*
* @return the value of te_appeal.link_men
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public String getLinkMen() {
return linkMen;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.link_men
*
* @param linkMen the value for te_appeal.link_men
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setLinkMen(String linkMen) {
this.linkMen = linkMen;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.link_phone
*
* @return the value of te_appeal.link_phone
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public String getLinkPhone() {
return linkPhone;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.link_phone
*
* @param linkPhone the value for te_appeal.link_phone
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setLinkPhone(String linkPhone) {
this.linkPhone = linkPhone;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.status
*
* @return the value of te_appeal.status
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.status
*
* @param status the value for te_appeal.status
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.handler_id
*
* @return the value of te_appeal.handler_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Integer getHandlerId() {
return handlerId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.handler_id
*
* @param handlerId the value for te_appeal.handler_id
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setHandlerId(Integer handlerId) {
this.handlerId = handlerId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.remark
*
* @return the value of te_appeal.remark
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public String getRemark() {
return remark;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.remark
*
* @param remark the value for te_appeal.remark
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.create_time
*
* @return the value of te_appeal.create_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Long getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.create_time
*
* @param createTime the value for te_appeal.create_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column te_appeal.update_time
*
* @return the value of te_appeal.update_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public Long getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column te_appeal.update_time
*
* @param updateTime the value for te_appeal.update_time
*
* @mbggenerated Tue Nov 07 16:26:13 CST 2017
*/
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
} | [
"[email protected]"
] | |
44fcaa79402b7395908a8886f4a95e9ed2fcdd00 | 84b39249fd19ee1f8c977d91e371dab93d9e32f2 | /00_bookABattery_SERVICE/src/main/java/it/luigibennardis/microservice/domain/StationAddress.java | e937760e78e5d25f11fcd1257de2308d4ff4ef0c | [] | no_license | lbennardis/microS_code2016_serviceRegistryDiscovery | 6eb9839f5ee127cc1203a4ad6d76c32cb41a7ed2 | 7c676b9d7b6fb327387fa5b60fc61c4a095420fb | refs/heads/master | 2020-04-06T05:03:56.446992 | 2016-11-15T13:35:53 | 2016-11-15T13:35:53 | 54,958,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,328 | java | package it.luigibennardis.microservice.domain;
import java.io.Serializable;
import java.text.DecimalFormat;
import javax.annotation.Generated;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
@Entity
@NamedQuery(name="StationAddress.findNearest",query="SELECT stationid,address,city,latitude,longitude,3956 * 2 * (ASIN(SQRT(POWER(SIN((?1 - abs(latitude)) * pi()/180/2),2)+ COS(?1 * pi()/180 )*COS(abs(latitude) * pi()/180)*POWER (SIN((?2 - longitude)) * pi()/180/2, 2)))) AS distance FROM StationAddress WHERE (3956 * 2 * (ASIN(SQRT(POWER(SIN((?1 - abs(latitude)) * pi()/180/2),2)+ COS(?1 * pi()/180 )*COS(abs(latitude) * pi()/180)*POWER (SIN((?2 - longitude)) * pi()/180/2, 2))))) < ?3 ")
public class StationAddress implements Serializable{
private static final long serialVersionUID = 6075466029412276470L;
@Id
@Column(name="stationid")
String stationid;
@Column(name="address")
String address;
@Column(name="city")
String city;
@Column(name="latitude")
Double latitude;
@Column(name="longitude")
Double longitude;
public String getStationId() {
return stationid;
}
public void setStationId(String stationId) {
this.stationid = stationId;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getLatitude() {
//return latitudine;
System.out.println("latitude" + latitude);
DecimalFormat myFormatter = new DecimalFormat("###.########");
String output = myFormatter.format(latitude);
return output ;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public String getLongitude() {
//return longitude;
System.out.println("longitude" + longitude);
DecimalFormat myFormatter = new DecimalFormat("###.########");
String output = myFormatter.format(longitude);
return output ;
}
public void setLongitudine(Double longitude) {
this.longitude = longitude;
}
public String toXML(){
StringBuffer appo = new StringBuffer();
appo.append("<StationId>" + this.getStationId()+"</StationId>");
return appo.toString();
}
}
| [
"[email protected]"
] | |
f4f849d1fc4b9e787b3c4aac63db85f2fb493c79 | 307dfe6991a9e9567be659b268d8c1dd9bf4f476 | /qq/src/main/java/com/zh/qq/service/AdminServiceImpl.java | 91b5719f2917ec11b298baa667f66014b3e44591 | [] | no_license | InkstarONE/Netty-chatApp-Hoar | f13e0aaf77ac6987623a29312e274d18a0028011 | d642cb5e51e3bd72397fb9049bd54a5b6e85c92e | refs/heads/master | 2022-07-09T17:59:16.777790 | 2019-05-30T07:41:03 | 2019-05-30T07:41:03 | 138,700,068 | 0 | 0 | null | 2022-06-20T23:31:01 | 2018-06-26T07:21:44 | Java | UTF-8 | Java | false | false | 661 | java | package com.zh.qq.service;
import com.zh.qq.mapper.AdminNoticeMapper;
import com.zh.qq.pojo.AdminNotice;
import com.zh.qq.pojo.vo.AdminNoticeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
@Autowired
private AdminNoticeMapper adminNoticeMapper;
@Override
public void saveNotice(AdminNotice adminNotice) {
adminNoticeMapper.saveUser(adminNotice);
}
@Override
public List<AdminNoticeVO> showNoticeList() {
return adminNoticeMapper.showNoticeList();
}
}
| [
"[email protected]"
] | |
20947a7a30820bd4a76d5f661e2b8749ef904efd | 4157bbec9d353b3992a77dbcc807d37149dee9e1 | /24_HashMap/src/opgave03_Dictionary/DictionaryHashMap.java | f73651a4f650edda8ec545e5ff2f3b964ae0d3f2 | [] | no_license | Mageofdavodo/PRO2_Test | 0809c1779b465dca185b657d486c5739b4a70a6f | 0e112d0baae49d4ed5dafd39ae04cb32b264ec90 | refs/heads/master | 2020-04-06T14:21:21.850090 | 2019-01-15T20:46:21 | 2019-01-15T20:46:21 | 157,537,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package opgave03_Dictionary;
public class DictionaryHashMap<K, V> implements Dictionary<K, V> {
private java.util.Map<K, V>[] tabel;
private int N = 10;
private int size = 0;
/**
* HashingMap constructor comment.
*/
public DictionaryHashMap() {
tabel = new java.util.HashMap[N];
for (int i = 0; i < N; i++) {
tabel[i] = new java.util.HashMap<K, V>();
}
}
@Override
public V get(K key) {
int i = key.hashCode() % N;
java.util.Map<K, V> map = tabel[i];
return map.get(key);
}
@Override
public boolean isEmpty() {
boolean empty = true;
int i = 0;
while (empty && i < N) {
empty = (tabel[i]).isEmpty();
i++;
}
return empty;
}
@Override
public V put(K key, V value) {
int i = key.hashCode() % N;
V oldValue = tabel[i].put(key, value);
if (oldValue == null) {
size++;
}
return oldValue;
}
@Override
public V remove(K key) {
int i = key.hashCode() % N;
V oldValue = tabel[i].remove(key);
if (oldValue != null) {
size--;
}
return oldValue;
}
@Override
public int size() {
return size;
}
}
| [
"[email protected]"
] | |
aa7a694707aa5dbb29575a1e748162840bfea0ea | 9a6cb7d6c922dd7029caba21d2c1a0aa6e3950ff | /searching/src/test/java/SearchSortedIndexTest.java | 0cf470bdaaa9725832a502f42f4b0c4fa04877eb | [
"MIT"
] | permissive | amanyadv/elements-of-programming-interviews | 991dee4e0807e4d490218fdf613ce01d2faea172 | c6ec2c54bc5d8aa5625d45c0be120fd73f295c40 | refs/heads/master | 2021-06-17T00:41:18.530790 | 2021-01-23T14:15:15 | 2021-01-23T14:15:15 | 131,750,827 | 1 | 0 | MIT | 2021-01-23T14:15:16 | 2018-05-01T18:52:33 | Java | UTF-8 | Java | false | false | 827 | java | import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.*;
public class SearchSortedIndexTest {
private int expected;
private List<Integer> list;
@Test
public void search1() throws Exception {
expected = 3;
list = Arrays.asList(3,3,3,3,3);
test(expected, list);
}
@Test
public void search2() throws Exception {
expected = 4;
list = Arrays.asList(9,2,6,3,4);
test(expected, list);
}
@Test
public void search3() throws Exception {
expected = 0;
list = Arrays.asList(0,6,3,2,5,7,4,3,1);
test(expected, list);
}
public void test(int expected, List<Integer> list) throws Exception {
assertEquals(expected, SearchSortedIndex.search(list));
}
} | [
"[email protected]"
] | |
11e92d9140cd7092de30b16de33b93a007c7931a | 0acb459d246488c4d290fb6fdd916821964f0b46 | /src/com/grupobeta/wicket/PropertyChoiceRenderer.java | 3d3cb8457f811d0d7260b0f24e943233fff353df | [] | no_license | mrmorazan/StylePortal | ce0f581e4933fcbcf02604ed1c7fb39d0a578174 | c17ffc8949810eaba6b839468e1f8898d2e8357b | refs/heads/feature/PE-15 | 2022-12-24T15:06:24.904261 | 2019-10-24T21:08:19 | 2019-10-24T21:08:19 | 216,910,444 | 0 | 0 | null | 2022-12-16T03:09:11 | 2019-10-22T21:10:58 | JavaScript | UTF-8 | Java | false | false | 1,103 | java | package com.grupobeta.wicket;
import java.io.Serializable;
import java.util.List;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.core.util.lang.PropertyResolver;
public class PropertyChoiceRenderer<T extends Serializable> implements IChoiceRenderer<T> {
private static final long serialVersionUID = 1L;
protected final String idProperty;
protected final String displayProperty;
public PropertyChoiceRenderer(String idProperty) {
this(idProperty, null);
}
public PropertyChoiceRenderer(String idProperty, String displayProperty) {
this.idProperty = idProperty;
this.displayProperty = displayProperty;
}
@Override
public Object getDisplayValue(T object) {
return displayProperty == null ? object.toString() : PropertyResolver.getValue(displayProperty, object);
}
@Override
public String getIdValue(T object, int index) {
return PropertyResolver.getValue(idProperty, object).toString();
}
@Override
public T getObject(String id, IModel<? extends List<? extends T>> choices) {
return null;
}
}
| [
"[email protected]"
] | |
daf031838e2c6a18baf56745508e4cac65cbf3d2 | ab91a619de3fe12d2faedaeeed738a3dda936e02 | /UserIO/src/main/java/UserView.java | e18f9b551aa5f692eb60a8c26a1355413c619558 | [] | no_license | chase-owens/Java_SG | 78439f4e71f7b1e935248bd6c00562c58820cdc3 | 2f57374d04fdb6c3b0a42a4bd5470d028d2e9fba | refs/heads/master | 2020-04-27T18:22:25.574178 | 2019-03-08T16:07:16 | 2019-03-08T16:07:16 | 174,566,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | 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.
*/
/**
*
* @author chaseowens
*/
public class UserView {
}
| [
"[email protected]"
] | |
4cfb84b5634311050f09cdf8ee9ed6f3b93d36a0 | babbe4d56d06a9867f67108302411ed19092964e | /getmessage/src/test/java/com/dong/getmessage/ExampleUnitTest.java | 3b48f2b7c58ef56cdb93f0892265799d16d578f3 | [] | no_license | xiaotianzhen/NetAndView | 9e33296a25f300e9d59b77df6d3150b1d861e103 | 5c3994ee6dee512c8fcb3d1f2c24361090da0c4f | refs/heads/master | 2020-12-30T16:27:34.184667 | 2017-10-22T14:58:37 | 2017-10-22T14:58:37 | 90,985,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package com.dong.getmessage;
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() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
062e64a01ed90d3e793e58f38a9301acbf3163fd | 79ee206c47d578af3e7e4407e21c147d48ade24f | /src/com/test/algo/misc/ReverseLinkedList.java | 17f2814151376904626ed5b7bc3c61e347cdb301 | [] | no_license | gitforkcal/algo | 1db7268e552dbd9c6fa228e9a4346b3caece0236 | b32b1dbb7cfc35e274c8b2191acbd1538f197792 | refs/heads/master | 2020-12-25T21:35:18.801897 | 2015-06-06T06:09:19 | 2015-06-06T06:09:19 | 36,969,357 | 0 | 0 | null | 2015-06-06T05:59:50 | 2015-06-06T05:59:50 | null | UTF-8 | Java | false | false | 884 | java | package com.test.algo.misc;
import com.test.algo.list.ListUtil;
import com.test.algo.list.Node;
/**
* @author Rahul Bhattacharjee
*/
public class ReverseLinkedList {
public static void main(String [] argv) {
int [] data = {1,2,3,4,5,6,7,8,9};
Node start = ListUtil.createList(data);
start = reverseList(start);
ListUtil.print(start);
}
private static Node reverseList(Node start) {
Node a = start;
Node b = start.getNext();
Node c = null;
if(b != null) {
c = b.getNext();
}
boolean first = true;
while(b != null && b.getNext() != null) {
if(first) {
a.setNext(null);
first = false;
}
b.setNext(a);
a=b;
b=c;
c = c.getNext();
}
return a;
}
}
| [
"[email protected]"
] | |
d8e1d1c584ce893a4f0d88ea68dd0baa3af1c2b9 | 0542b1f6a704376e19b390e7baa1fe96bc706aa8 | /src/mop/algorithm/moead/util/MOEADUtils.java | f52e65c9e6df50dc86e9f92d41b98d6e8db0e0b5 | [] | no_license | matheusfsa/RS-MOP | f80ad0e153827cf2b902b15a833218d5aa75478f | b753a887ae9326ea85c3c2b9dc0090031af92ae6 | refs/heads/master | 2022-12-17T21:04:26.365266 | 2020-02-13T16:04:02 | 2020-02-13T16:04:02 | 225,250,102 | 2 | 0 | null | 2022-12-08T03:15:01 | 2019-12-02T00:03:50 | Jupyter Notebook | UTF-8 | Java | false | false | 6,743 | java | package mop.algorithm.moead.util;
import org.uma.jmetal.solution.Solution;
import org.uma.jmetal.util.JMetalException;
import org.uma.jmetal.util.distance.Distance;
import org.uma.jmetal.util.distance.impl.EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace;
import org.uma.jmetal.util.pseudorandom.JMetalRandom;
import org.uma.jmetal.util.point.impl.IdealPoint;
import java.util.ArrayList;
import java.util.List;
/**
* Utilities methods to used by MOEA/D
*/
public class MOEADUtils {
/**
* Quick sort procedure (ascending order)
*
* @param array
* @param idx
* @param from
* @param to
*/
public static void quickSort(double[] array, int[] idx, int from, int to) {
if (from < to) {
double temp = array[to];
int tempIdx = idx[to];
int i = from - 1;
for (int j = from; j < to; j++) {
if (array[j] <= temp) {
i++;
double tempValue = array[j];
array[j] = array[i];
array[i] = tempValue;
int tempIndex = idx[j];
idx[j] = idx[i];
idx[i] = tempIndex;
}
}
array[to] = array[i + 1];
array[i + 1] = temp;
idx[to] = idx[i + 1];
idx[i + 1] = tempIdx;
quickSort(array, idx, from, i);
quickSort(array, idx, i + 1, to);
}
}
public static double distVector(double[] vector1, double[] vector2) {
int dim = vector1.length;
double sum = 0;
for (int n = 0; n < dim; n++) {
sum += (vector1[n] - vector2[n]) * (vector1[n] - vector2[n]);
}
return Math.sqrt(sum);
}
public static void minFastSort(double x[], int idx[], int n, int m) {
for (int i = 0; i < m; i++) {
for (int j = i + 1; j < n; j++) {
if (x[i] > x[j]) {
double temp = x[i];
x[i] = x[j];
x[j] = temp;
int id = idx[i];
idx[i] = idx[j];
idx[j] = id;
}
}
}
}
public static void randomPermutation(int[] perm, int size) {
JMetalRandom randomGenerator = JMetalRandom.getInstance() ;
int[] index = new int[size];
boolean[] flag = new boolean[size];
for (int n = 0; n < size; n++) {
index[n] = n;
flag[n] = true;
}
int num = 0;
while (num < size) {
int start = randomGenerator.nextInt(0, size - 1);
while (true) {
if (flag[start]) {
perm[num] = index[start];
flag[start] = false;
num++;
break;
}
if (start == (size - 1)) {
start = 0;
} else {
start++;
}
}
}
}
/**
* This methods select a subset of evenly spread solutions from a solution list. The implementation
* is based on the method described in the MOEA/D-DRA paper.
* @param solutionList
* @param newSolutionListSize
* @param <S>
* @return
*/
public static <S extends Solution<?>> List<S> getSubsetOfEvenlyDistributedSolutions(
List<S> solutionList, int newSolutionListSize) {
List<S> resultSolutionList = new ArrayList<>(newSolutionListSize) ;
if (solutionList == null) {
throw new JMetalException("The solution list is null") ;
}
if (solutionList.size() > 0) {
int numberOfObjectives = solutionList.get(0).getNumberOfObjectives() ;
if (numberOfObjectives == 2) {
twoObjectivesCase(solutionList, resultSolutionList, newSolutionListSize) ;
} else {
moreThanTwoObjectivesCase(solutionList, resultSolutionList, newSolutionListSize) ;
}
}
return resultSolutionList ;
}
private static <S extends Solution<?>> void twoObjectivesCase(
List<S> solutionList,
List<S> resultSolutionList,
int newSolutionListSize) {
double[][] lambda = new double[newSolutionListSize][2] ;
// Compute the weight vectors
for (int i = 0; i < newSolutionListSize; i++) {
double a = 1.0 * i / (newSolutionListSize - 1);
lambda[i][0] = a;
lambda[i][1] = 1 - a;
}
IdealPoint idealPoint = new IdealPoint(2) ;
solutionList.stream().forEach(solution -> idealPoint.update(solution.getObjectives()));
// Select the best solution for each weight vector
for (int i = 0; i < newSolutionListSize; i++) {
S currentBest = solutionList.get(0);
double value = scalarizingFitnessFunction(currentBest, lambda[i], idealPoint);
for (int j = 1; j < solutionList.size(); j++) {
double aux = scalarizingFitnessFunction(solutionList.get(j),lambda[i], idealPoint); // we are looking for the best for the weight i
if (aux < value) { // solution in position j is better!
value = aux;
currentBest = solutionList.get(j);
}
}
resultSolutionList.add((S) currentBest.copy());
}
}
private static <S extends Solution<?>> void moreThanTwoObjectivesCase(
List<S> solutionList,
List<S> resultSolutionList,
int newSolutionListSize) {
Distance<S, List<S>> distance =
new EuclideanDistanceBetweenSolutionAndASolutionListInObjectiveSpace() ;
int randomIndex = JMetalRandom.getInstance().nextInt(0, solutionList.size() - 1) ;
// create a list containing all the solutions but the selected one (only references to them)
List<S> candidate = new ArrayList<>();
resultSolutionList.add(solutionList.get(randomIndex)) ;
for (int i = 0; i< solutionList.size(); i++) {
if (i != randomIndex)
candidate.add(solutionList.get(i));
}
while (resultSolutionList.size() < newSolutionListSize) {
int index = 0;
S selected = candidate.get(0); // it should be a next! (n <= population size!)
double aux = distance.getDistance(selected, solutionList);
int i = 1;
while (i < candidate.size()) {
S nextCandidate = candidate.get(i);
double distanceValue = distance.getDistance(nextCandidate, solutionList);
if (aux < distanceValue) {
index = i;
aux = distanceValue ;
}
i++;
}
// add the selected to res and remove from candidate list
S removedSolution = candidate.remove(index) ;
resultSolutionList.add((S)removedSolution.copy());
}
}
private static <S extends Solution<?>> double scalarizingFitnessFunction(
S currentBest,
double[] lambda,
IdealPoint idealPoint) {
double maxFun = -1.0e+30;
for (int n = 0; n < idealPoint.getDimension(); n++) {
double diff = Math.abs(currentBest.getObjective(n) - idealPoint.getValue(n));
double functionValue;
if (lambda[n] == 0) {
functionValue = 0.0001 * diff;
} else {
functionValue = diff * lambda[n];
}
if (functionValue > maxFun) {
maxFun = functionValue;
}
}
return maxFun;
}
}
| [
"[email protected]"
] | |
cdfabad7750b0fbfe802672eadf483efc567dd60 | 1cade02902fc49cd13762f9576f8a19653295c37 | /src/siniflar/KamyonParcasi.java | 35b7be744e98364f508d03211ecaa435c0ce662d | [] | no_license | hsynpsdmr/aracParcaTakipSistemi | 96143dfde3ce220c7b257d4c3f02e087087b804e | 7a91ba424015dde3722f9d6bcff7177045bff354 | refs/heads/master | 2022-12-04T05:14:04.192657 | 2020-08-08T19:52:15 | 2020-08-08T19:52:15 | 286,099,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 534 | 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 siniflar;
/**
*
* @author hsynpsdmr
*/
public class KamyonParcasi extends ParcaTurleri implements ParcaInterface{
public KamyonParcasi(){
setTur("Kamyon");
}
@Override
public String getTur(){
return this.tur;
}
@Override
public void setTur(String tur){
this.tur = tur;
}
}
| [
"[email protected]"
] | |
54bd74a1e2c77bb428e7ecac2cdece0f5b30b34d | 64d0777f30e16289e1ebfc154db56dda6e14c1d7 | /src/main/java/com/imooc/service/impl/UserServiceImpl.java | 812a6f55dd9bdc9e4a4033e23d9c597adb6ddd2d | [] | no_license | fyjjpe/springboot-helloworld | 9c1d0e9408d415ec388ea76c45e55a1ed01a2979 | 93456f42b66380660dd3aad08984abc2a6a9c059 | refs/heads/master | 2021-08-15T04:36:57.973845 | 2017-11-17T10:23:52 | 2017-11-17T10:23:52 | 110,958,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | package com.imooc.service.impl;
import com.imooc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
/**
* Created by yuanjie.fang on 2017/11/16.
*/
@Service("userService")
public class UserServiceImpl implements UserService {
@Autowired
private JdbcTemplate jdbcTemplate;
@Override
public void createJdbcUser() {
jdbcTemplate.update("INSERT INTO user VALUES (null,?,?);", "lisi", 19);
}
}
| [
"[email protected]"
] | |
f5ce39157c7169e2aacd05c1c2d3382f9bae52be | c0606f722e33cb121cf224f9693e14e478185489 | /KnightMidasLibGDX/core/src/game/HeroState.java | 4fabbca29f36dde8a9687adbf454b7e8f10c9e74 | [] | no_license | duchien85/KnightMidasLibGDX | 69ad69050a114fd3209c70f469b5571ee8451ef3 | ff498c7cda831ed3f865e07305ad5c8f0e37b09e | refs/heads/master | 2022-05-28T09:59:28.344932 | 2020-04-28T23:25:51 | 2020-04-28T23:25:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java |
package game;
public enum HeroState {
IDLE,
WALK,
RUN,
STAB,
JUMP,
FALL,
SPIN,
HURT,
DEAD,
SPAWN;
}
| [
"[email protected]"
] | |
ee11439337fb7dd68b277528b8e3d5bb3e32a113 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/26/1152.java | 93e73c822af8a40e1033d3e64c8ddae6509fc985 | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,038 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
char[] str = {' ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'};
char[] a = {' ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'};
int j;
int i;
int k;
str = new Scanner(System.in).nextLine();
k = 0;
for (i = 0;i < 200;i++)
{
for (j = k;j < 200;j++)
{
if (str[j + 1] != ' ' || str[j] != ' ')
{
a[i] = str[j];
k = j + 1;
break;
}
else
{
;
}
}
}
System.out.println(a);
return 0;
}
}
| [
"[email protected]"
] | |
76505b13321f4e53681657d4bb2dad035ac6f38a | cf81f24093f67df064bb218e40899f34ebb77ac8 | /src/main/java/org/libj/util/UnmodifiableNavigableSet.java | 7a4e2511f2028c08ea8b1a2f39df7a49f61254e6 | [
"MIT"
] | permissive | libj/util | 052d120f4eb9122661f975ef1fad04716885b8a4 | 817614b4cf72fc0f7655bc0d3142b00c408c72d7 | refs/heads/master | 2023-09-04T00:37:02.590848 | 2023-08-19T10:24:30 | 2023-08-19T10:24:30 | 148,916,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,558 | java | /* Copyright (c) 2022 LibJ
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* You should have received a copy of The MIT License (MIT) along with this
* program. If not, see <http://opensource.org/licenses/MIT/>.
*/
package org.libj.util;
import java.util.Iterator;
import java.util.NavigableSet;
import java.util.SortedSet;
/**
* This class allows modules to provide users with "read-only" access to internal navigable sets. Query operations on the returned
* navigable set "read through" to the specified navigable set. Attempts to modify the returned navigable set, whether direct, via
* its iterator, or via its {@link SortedSet#subSet(Object,Object)}, {@link SortedSet#headSet(Object)}, or
* {@link SortedSet#tailSet(Object)} views, result in an {@link UnsupportedOperationException}.
* <p>
* The returned navigable set will be serializable if the specified navigable set is serializable.
*
* @param <E> The type parameter of the objects in the set.
*/
public class UnmodifiableNavigableSet<E> extends UnmodifiableSortedSet<E> implements NavigableSet<E> {
/**
* Creates a new {@link UnmodifiableNavigableSet} with the specified target {@link NavigableSet}.
*
* @param target The target {@link NavigableSet}.
* @throws NullPointerException If the target {@link NavigableSet} is null.
*/
public UnmodifiableNavigableSet(final NavigableSet<E> target) {
super(target);
}
/**
* Creates a new {@link UnmodifiableNavigableSet} with a null target.
*/
protected UnmodifiableNavigableSet() {
}
@Override
protected NavigableSet<E> getTarget() {
return (NavigableSet<E>)super.getTarget();
}
@Override
public E lower(final E e) {
return getTarget().lower(e);
}
@Override
public E floor(final E e) {
return getTarget().floor(e);
}
@Override
public E ceiling(final E e) {
return getTarget().ceiling(e);
}
@Override
public E higher(final E e) {
return getTarget().higher(e);
}
@Override
public E pollFirst() {
throw new UnsupportedOperationException();
}
@Override
public E pollLast() {
throw new UnsupportedOperationException();
}
@Override
public NavigableSet<E> descendingSet() {
return new UnmodifiableNavigableSet<>(getTarget().descendingSet());
}
@Override
public Iterator<E> descendingIterator() {
return descendingSet().iterator();
}
@Override
public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive) {
return new UnmodifiableNavigableSet<>(getTarget().subSet(fromElement, fromInclusive, toElement, toInclusive));
}
@Override
public NavigableSet<E> headSet(final E toElement, final boolean inclusive) {
return new UnmodifiableNavigableSet<>(getTarget().headSet(toElement, inclusive));
}
@Override
public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive) {
return new UnmodifiableNavigableSet<>(getTarget().tailSet(fromElement, inclusive));
}
} | [
"[email protected]"
] | |
ab0514da527cd56a6b9b130be05247fef471c76e | f62c25fbc4dd7a6e891bf4821b4c03cee6f0d9c6 | /nj-front-web/nj-front-web/src/main/java/com/js/nj/controller/LoginController.java | 52c768522e6f190a8c5e9c2159ace626f034d252 | [] | no_license | zhangyoo/spring-boot-demo | c93fa606c275bf6ca8315e9791063c6746c6e43c | 9d9dab71965b99dd52d240542ee2fdbb2ba9ecd0 | refs/heads/master | 2022-06-30T00:52:25.796181 | 2021-01-15T06:36:59 | 2021-01-15T06:36:59 | 165,961,817 | 0 | 0 | null | 2022-06-21T00:55:10 | 2019-01-16T02:47:46 | Java | UTF-8 | Java | false | false | 1,317 | java | package com.js.nj.controller;
import com.js.nj.entity.User;
import com.js.nj.service.UserService;
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 org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@Controller
public class LoginController {
@Autowired
private UserService userService;
@RequestMapping("/login")
public String login(){
return "login/login";
}
@RequestMapping(value = "/login_in", method = RequestMethod.POST)
public String login_in(User user, HttpServletRequest request, Model model){
User userInfo = userService.validateUser(user.getUserName(), user.getUserPassword());
if(userInfo == null){
return "login/login";
}
HttpSession session = request.getSession();
session.setAttribute("USER_INFO", userInfo);
return "redirect:/index";
}
@RequestMapping("/logout")
public String logout(HttpServletRequest request){
request.getSession().removeAttribute(request.getSession().getId());
return "login/login";
}
}
| [
"[email protected]"
] | |
edc716d83c0d0d5e11d519c8bd4647eca5a6da37 | 65cd1ddaf85bc9594c6e4d2086afc9f8215d07c0 | /1811-money-web/src/main/java/com/money/web/service/CartService.java | 1a4180718d60b17403a63f295c62e0517905d432 | [] | no_license | 5683junwei/SpringCloud-manager | a0b0d0d93e3a7be6974069dad6a18a72eea4eb8c | 2fcdb1f28c5f297c43eaad5b2b3d06c078c3c2ab | refs/heads/master | 2020-05-23T22:33:09.642486 | 2019-05-16T08:05:29 | 2019-05-16T08:05:29 | 186,975,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,259 | java | package com.money.web.service;
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 com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.money.common.config.HttpClientService;
import com.money.common.pojo.Cart;
import com.money.common.util.OUtil;
@Service
public class CartService {
@Autowired
private HttpClientService client;
private ObjectMapper mp=OUtil.mapper;
public List<Cart> queryCart(String userId) {
//按照接口实现访问
try{
//String url="http://localhost:9000/api-g/list?userId="+userId;
String url="http://manage.money.com/api-g/list?userId="+userId;
String jsonData=client.doGet(url);//[{"":""},{}]
//jsonData时一个list结构,无法直接使用之前readValue();
//先将jsonData的字符串,转化成JsonNode
JsonNode data=mp.readTree(jsonData);
List<Cart> cList=null;
//data并不一定有值,判断是否是数组类型,是否size>0
if(data.isArray()&&data.size()>0){
//(将json解析成linkedHashMap的封装对象),traverce()
cList= mp.readValue(data.traverse(),mp.getTypeFactory()
.constructCollectionType(List.class,Cart.class));
}
//并且制定List类反射,元素类反射对象List<Cart>
return cList;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
public String addCart(String userId, String productId, String num){
//String url="http://localhost:9000/api-h/save";
String url="http://manage.money.com:9000/api-h/save";
Map<String,Object> map=new HashMap<String,Object>();
map.put("userId", userId);
map.put("productId", productId);
map.put("num", Integer.parseInt(num));
//doGet
try{
String result=client.doGet(url, map);
return result;
}catch(Exception e){
e.printStackTrace();
return e.getMessage();
}
}
public void deleteCart(String userId) throws Exception {
//String url="http://localhost:9000/api-i/delete";
String url="http://manage.money.com:9000/api-i/delete";
Map<String,Object> map=new HashMap<String,Object>();
map.put("userId", userId);
client.doGet(url,map);
}
}
| [
"[email protected]"
] | |
f80811f145cbb68829c30222bb1c68df47f6312e | 7844090bd7b4340b9011274ca9c6d1f81b4200d1 | /src/main/java/com/ActiTime/dataprovider/ActitimeDataProvider.java | c90a6973f1d7b2fe2ee037f07255a22ffeb8cdea | [] | no_license | sandesh-pai/ActiTimeFramework | b012f0fbb7e39246f6a446e3b093a86f1d649aa1 | 2e9f21b489e3fe91bc65e501a1e8d4d320b67a6a | refs/heads/master | 2023-03-06T19:16:35.824882 | 2021-02-17T10:07:53 | 2021-02-17T10:07:53 | 337,483,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 985 | java | package com.ActiTime.dataprovider;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.testng.annotations.DataProvider;
import com.ActiTime.Utils.excelUtils;
public class ActitimeDataProvider {
private static List<Map<String, String>> list = new ArrayList<Map<String, String>>();
@DataProvider(parallel=true)
public static Object[] getdata(Method m) {
String testname = m.getName();
if(list.isEmpty()) {
list = excelUtils.getData("Sheet2");
}
System.out.println(list.size() + " full list size");
List<Map<String, String>> smalllist = new ArrayList<Map<String, String>>();
for(int i=0;i<list.size();i++) {
if(list.get(i).get("testcasename").equalsIgnoreCase(testname) &&
list.get(i).get("execute").equalsIgnoreCase("yes")) {
smalllist.add(list.get(i));
}
}
System.out.println(smalllist.size() + " smalllist list size");
return smalllist.toArray();
}
}
| [
"[email protected]"
] | |
8d28f0a916c2500647c6fbaea3f8a27cdc725c6c | 04095f967958e42858c642dad0321a82a626baa6 | /easysocketlib/src/main/java/com/littlebayreal/easysocketlib/util/BCD8421Operater.java | 4ac9ec0f7e6ec0b85ff83faf6797cc20d2a6a8b1 | [
"Apache-2.0"
] | permissive | littlebayreal/EasySocket | ea4a03532a8486b0383bf48589b351d56c66e874 | 231e42213a271200ebe8a1a06b0f31fa00c2cf9f | refs/heads/master | 2020-12-08T11:33:24.165357 | 2020-08-21T09:11:03 | 2020-08-21T09:11:03 | 232,971,856 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,906 | java | package com.littlebayreal.easysocketlib.util;
public class BCD8421Operater {
public static byte[] numToByteArray(long num, int size) {
byte[] result = new byte[size];
for (int i = 0; i < size; i++) {
result[i] = (byte) ((num >> (size - i - 1) * 8) & 0xFF);
}
return result;
}
/**
* BCD字节数组===>String
*
* @param bytes
* @return 十进制字符串
*/
public static String bcd2String(byte[] bytes) {
StringBuilder temp = new StringBuilder(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
// 高四位
temp.append((bytes[i] & 0xf0) >>> 4);
// 低四位
temp.append(bytes[i] & 0x0f);
}
// return temp.toString().substring(0, 1).equalsIgnoreCase("0") ? temp.toString().substring(1) : temp.toString();
return temp.toString();
}
/**
* 字符串==>BCD字节数组
*
* @param str
* @return BCD字节数组
*/
public static byte[] string2Bcd(String str) {
// 奇数,前补零
if ((str.length() & 0x1) == 1) {
str = "0" + str;
}
byte ret[] = new byte[str.length() / 2];
byte bs[] = str.getBytes();
for (int i = 0; i < ret.length; i++) {
byte high = ascII2Bcd(bs[2 * i]);
byte low = ascII2Bcd(bs[2 * i + 1]);
// TODO 只遮罩BCD低四位?
ret[i] = (byte) ((high << 4) | low);
}
return ret;
}
private static byte ascII2Bcd(byte asc) {
if ((asc >= '0') && (asc <= '9'))
return (byte) (asc - '0');
else if ((asc >= 'A') && (asc <= 'F'))
return (byte) (asc - 'A' + 10);
else if ((asc >= 'a') && (asc <= 'f'))
return (byte) (asc - 'a' + 10);
else
return (byte) (asc - 48);
}
}
| [
"[email protected]"
] | |
b8395781e966d1ac4e30b5e8239cf19716381585 | 1123b6db8ff802bee64e4e29619f36b2319c81a5 | /src/main/java/com/space/alzheimer/dao/UserMapper.java | 9e1a0fd220bd942a41ffa29c83199e5765ced66b | [] | no_license | zcsoft/hospital-admin-server | a00d463302c4a5cfe1cb78c46a2916ef61037e77 | b6c70555b5ec68dfc1731c386d353c32cb1e0ea6 | refs/heads/master | 2022-11-28T00:35:19.987009 | 2020-08-06T01:02:33 | 2020-08-06T01:02:33 | 285,508,268 | 0 | 0 | null | 2020-08-06T07:49:50 | 2020-08-06T07:49:49 | null | UTF-8 | Java | false | false | 599 | java | package com.space.alzheimer.dao;
import com.github.pagehelper.Page;
import com.space.alzheimer.bean.User;
import com.space.alzheimer.bean.UserVo;
import org.apache.ibatis.annotations.Param;
/**
* @ClassName UserDao
* @Description: TODO
* @Author ljh
* @Date 2020/5/18
**/
public interface UserMapper {
User queryByName(@Param("userName") String name);
void insert(User user);
void updatePassword(@Param("id")String id, @Param("password") String pwdOne);
Page<User> queryList(UserVo userVo);
void updateUserState(@Param("id")String id, @Param("state")String state);
} | [
"[email protected]"
] | |
4b58eec67f7c541c536219c03b303753fb85aa87 | 240f31fc7278cf720ec1a73676e93b0bd7d61a28 | /src/main/java/org/wildstang/hardware/crio/inputs/WsI2CInput.java | 837cbdb868e03295dd5d1cbb89288d713c2a5fa2 | [] | no_license | wildstang/2020_robot_software | 5a3159e387e156ae0e391ff6f7065ed285f5cf80 | 437ce2753346d8c352eb2f17f43ec43f169cb59d | refs/heads/master | 2023-08-12T01:57:12.844516 | 2021-09-05T13:12:57 | 2021-09-05T13:12:57 | 232,211,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,482 | java | package org.wildstang.hardware.crio.inputs;
import org.wildstang.framework.io.inputs.I2CInput;
import edu.wpi.first.wpilibj.I2C;
import edu.wpi.first.wpilibj.I2C.Port;
public class WsI2CInput extends I2CInput {
private I2C i2c;
// MessageHandler m_handler;
public WsI2CInput(String name, Port port, int p_address) {
super(name);
i2c = new I2C(port, p_address);
// m_handler = new MessageHandler(i2c);
// Thread t = new Thread(m_handler);
// t.start();
}
@Override
protected byte[] readRawValue() {
// byte[] data = m_handler.getRecentData();
byte rcvBytes[] = new byte[1];
i2c.readOnly(rcvBytes, 1);
return rcvBytes;// data;
}
// private static class MessageHandler implements Runnable
// {
// // Offload to a thread avoid blocking main thread with I2C reads.
//
// byte[] rcvBytes;
// boolean running = true;
// private I2C i2c;
//
// public MessageHandler(I2C p_i2c)
// {
// // Get ourselves an i2c instance to read data.
// i2c = p_i2c;
// }
//
// @Override
// public void run()
// {
// while (running)
// {
// rcvBytes = new byte[1];
// // Read a single byte
// i2c.readOnly(rcvBytes, 1);
// }
// }
//
// public byte[] getRecentData()
// {
// return rcvBytes;
// }
//
// public void stop()
// {
// running = false;
// }
// }
}
| [
"[email protected]"
] | |
89e9eec74a50855b50bcbbd16165f93501ed63d3 | e9e131e1162ff3c1285ebe68d2849b39f19bfc98 | /playground-java/app/src/main/java/org/example/jluzio/playground/ui/samples/SampleFragmentActivity.java | 5a3db2d443a2500efa45acbc917a00272a12b1d3 | [] | no_license | jluzio/android-examples | 4c8bd540c7e3fd89cf6fce99a6e1ce3e597c635a | db66ac9a337805fab15e0c361727365324530056 | refs/heads/master | 2021-06-14T07:03:09.968021 | 2019-10-06T17:11:48 | 2019-10-06T17:11:48 | 111,953,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package org.example.jluzio.playground.ui.samples;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import org.example.jluzio.playground.R;
public class SampleFragmentActivity extends AppCompatActivity implements SampleBodyFragment.OnBodyFragmentInteractionListener, SampleHeaderFragment.OnHeaderFragmentInteractionListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_fragment);
SampleHeaderFragment sampleHeaderFragment = SampleHeaderFragment.newInstance("nice title");
SampleBodyFragment sampleBodyFragment = SampleBodyFragment.newInstance("nice body");
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragmentHeader, sampleHeaderFragment)
.replace(R.id.fragmentBody, sampleBodyFragment)
.commit();
}
private Bundle getParamBundle(String textValue) {
Bundle bundle = new Bundle();
bundle.putString("text", textValue);
return bundle;
}
@Override
public void onBodyFragmentInteraction(Uri uri) {
}
@Override
public void onHeaderFragmentInteraction(Uri uri) {
}
}
| [
"[email protected]"
] | |
f043dcabefa15608f768bbfa9d6bd33dd3322373 | 37ea684e6f25c8042a015c3d77f4b6500cd2ed72 | /src/com/example/wlanhelper/ReadException.java | d2b6d70f76cf6067cd0297a8f3cd17a4d91dfcf6 | [] | no_license | Jartse/WlanHelper | 8e7553eef60a76c36450b8de1d588d43cbccd3a3 | d5d4475ba4b7b34bfd91e0483661e63dbc736669 | refs/heads/master | 2021-01-10T21:40:23.288843 | 2012-10-20T08:20:32 | 2012-10-20T08:20:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | package com.example.wlanhelper;
public class ReadException extends Exception {
private static final long serialVersionUID = 42L; // for serialization
public ReadException() {
}
public ReadException(String details) {
super(details);
}
public ReadException(String details, Throwable throwable) {
super(details, throwable);
}
}
| [
"[email protected]"
] | |
16d626962a1b57f7303778d22a0e2915eefe149e | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/shardingjdbc--sharding-jdbc/a06d534ab84498fd4bc9b73b646c57c70a843754/before/SelectStatement.java | 11cc790cf4885164c703fdf85cccc17a2ed6ebaa | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,484 | java | /*
* Copyright 1999-2015 dangdang.com.
* <p>
* 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.
* </p>
*/
package com.dangdang.ddframe.rdb.sharding.parsing.parser.statement.dql.select;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.context.OrderItem;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.context.limit.Limit;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.context.selectitem.AggregationSelectItem;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.context.selectitem.SelectItem;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.statement.dql.DQLStatement;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.token.OffsetToken;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.token.RowCountToken;
import com.dangdang.ddframe.rdb.sharding.parsing.parser.token.SQLToken;
import com.google.common.base.Preconditions;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Select SQL语句对象.
*
* @author zhangliang
*/
@Getter
@Setter
@ToString(callSuper = true)
public final class SelectStatement extends DQLStatement {
private boolean containStar;
private int selectListLastPosition;
private int groupByLastPosition;
private final Set<SelectItem> items = new HashSet<>();
private final List<OrderItem> groupByItems = new LinkedList<>();
private final List<OrderItem> orderByItems = new LinkedList<>();
private Limit limit;
@Getter(AccessLevel.NONE)
private SelectStatement subQueryStatement;
/**
* 获取聚合选择项集合.
*
* @return 聚合选择项
*/
public List<AggregationSelectItem> getAggregationSelectItems() {
List<AggregationSelectItem> result = new LinkedList<>();
for (SelectItem each : items) {
if (each instanceof AggregationSelectItem) {
AggregationSelectItem aggregationSelectItem = (AggregationSelectItem) each;
result.add(aggregationSelectItem);
for (AggregationSelectItem derivedEach: aggregationSelectItem.getDerivedAggregationSelectItems()) {
result.add(derivedEach);
}
}
}
return result;
}
/**
* 判断是否分组和排序项一致.
*
* @return 是否分组和排序项一致
*/
public boolean isSameGroupByAndOrderByItems() {
return !getGroupByItems().isEmpty() && getGroupByItems().equals(getOrderByItems());
}
/**
* 为选择项设置索引.
*
* @param columnLabelIndexMap 列标签索引字典
*/
public void setIndexForItems(final Map<String, Integer> columnLabelIndexMap) {
setIndexForAggregationItem(columnLabelIndexMap);
setIndexForOrderItem(columnLabelIndexMap, orderByItems);
setIndexForOrderItem(columnLabelIndexMap, groupByItems);
}
private void setIndexForAggregationItem(final Map<String, Integer> columnLabelIndexMap) {
for (AggregationSelectItem each : getAggregationSelectItems()) {
Preconditions.checkState(columnLabelIndexMap.containsKey(each.getColumnLabel()), String.format("Can't find index: %s, please add alias for aggregate selections", each));
each.setIndex(columnLabelIndexMap.get(each.getColumnLabel()));
for (AggregationSelectItem derived : each.getDerivedAggregationSelectItems()) {
Preconditions.checkState(columnLabelIndexMap.containsKey(derived.getColumnLabel()), String.format("Can't find index: %s", derived));
derived.setIndex(columnLabelIndexMap.get(derived.getColumnLabel()));
}
}
}
private void setIndexForOrderItem(final Map<String, Integer> columnLabelIndexMap, final List<OrderItem> orderItems) {
for (OrderItem each : orderItems) {
if (-1 != each.getIndex()) {
continue;
}
Preconditions.checkState(columnLabelIndexMap.containsKey(each.getColumnLabel()), String.format("Can't find index: %s", each));
if (columnLabelIndexMap.containsKey(each.getColumnLabel())) {
each.setIndex(columnLabelIndexMap.get(each.getColumnLabel()));
}
}
}
/**
* 判断是否包含子查询.
*
* @return 是否包含子查询
*/
public boolean containsSubQuery() {
return null != subQueryStatement;
}
/**
* 获取子查询的Select SQL语句对象.
*
* @return 子查询的Select SQL语句对象
*/
public SelectStatement getSubQueryStatement() {
SelectStatement result = processLimitForSubQuery();
processOrderByItems(result);
return result;
}
private SelectStatement processLimitForSubQuery() {
SelectStatement result = this;
List<SQLToken> limitSQLTokens = getLimitTokens(result);
Limit limit = result.getLimit();
while (result.containsSubQuery()) {
result = result.subQueryStatement;
limitSQLTokens.addAll(getLimitTokens(result));
if (null == result.getLimit()) {
continue;
}
if (null == limit) {
limit = result.getLimit();
}
if (null != result.getLimit().getRowCount()) {
limit.setRowCount(result.getLimit().getRowCount());
}
if (null != result.getLimit().getOffset()) {
limit.setOffset(result.getLimit().getOffset());
}
}
resetLimitTokens(result, limitSQLTokens);
result.setLimit(limit);
return result;
}
private List<SQLToken> getLimitTokens(final SelectStatement selectStatement) {
List<SQLToken> result = new LinkedList<>();
for (SQLToken each : selectStatement.getSqlTokens()) {
if (each instanceof RowCountToken || each instanceof OffsetToken) {
result.add(each);
}
}
return result;
}
private void resetLimitTokens(final SelectStatement selectStatement, final List<SQLToken> limitSQLTokens) {
int count = 0;
List<Integer> toBeRemovedIndexes = new LinkedList<>();
for (SQLToken each : selectStatement.getSqlTokens()) {
if (each instanceof RowCountToken || each instanceof OffsetToken) {
toBeRemovedIndexes.add(count);
}
count++;
}
for (int each : toBeRemovedIndexes) {
selectStatement.getSqlTokens().remove(each);
}
selectStatement.getSqlTokens().addAll(limitSQLTokens);
}
private void processOrderByItems(final SelectStatement result) {
if (!containStar) {
result.getOrderByItems().clear();
result.getGroupByItems().clear();
}
}
} | [
"[email protected]"
] | |
1e78d5ef278babca707ba1ac22a24aea9a5f983b | e3162d976b3a665717b9a75c503281e501ec1b1a | /src/main/java/com/alipay/api/domain/ZhimaOpenAppKeyanLqlCreateModel.java | 057bf78a6411f530fb7b4d81f6c3988bf6d265e2 | [
"Apache-2.0"
] | permissive | sunandy3/alipay-sdk-java-all | 16b14f3729864d74846585796a28d858c40decf8 | 30e6af80cffc0d2392133457925dc5e9ee44cbac | refs/heads/master | 2020-07-30T14:07:34.040692 | 2019-09-20T09:35:20 | 2019-09-20T09:35:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 811 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* keyantestoneone
*
* @author auto create
* @since 1.0, 2017-08-01 16:05:55
*/
public class ZhimaOpenAppKeyanLqlCreateModel extends AlipayObject {
private static final long serialVersionUID = 6261798444724239474L;
/**
* 参数描述必须通俗易懂、无错别字、完整。描述的内容请按此格式填写:参数名+是1否唯一(如需)+应用场景+枚举值(如有)+如何获取+特殊说明(如有)。如不符合标准终审会驳回,影响上线时间。
*/
@ApiField("cert_no")
private String certNo;
public String getCertNo() {
return this.certNo;
}
public void setCertNo(String certNo) {
this.certNo = certNo;
}
}
| [
"[email protected]"
] | |
9c0549ca68fde3daba0b6b9f176fa8d8e8a8c9bf | 7a112ad9438bf8050af1ab0ba7e8bc9baca1f9de | /src/main/java/com/co/cbg/sbt/app/auth/filter/JWTAuthorizationFilter.java | 786cae8191b71991db49041eb99e9c41a68a0876 | [] | no_license | krif07/spring-boot-jwt | 1782dda3aae4db468494d6d6004cc8c3afe4a2f9 | fb2a596c8489d4ce495517878cf2304c95a5620a | refs/heads/master | 2022-07-07T13:59:54.431545 | 2018-07-18T04:51:42 | 2018-07-18T04:51:42 | 203,401,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,814 | java | package com.co.cbg.sbt.app.auth.filter;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import com.co.cbg.sbt.app.auth.service.IJWTService;
import com.co.cbg.sbt.app.auth.service.JWTServiceImpl;
public class JWTAuthorizationFilter extends BasicAuthenticationFilter{
private IJWTService jwtService;
public JWTAuthorizationFilter(AuthenticationManager authenticationManager, IJWTService jwtService) {
super(authenticationManager);
this.jwtService = jwtService;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws IOException, ServletException {
String header = request.getHeader(JWTServiceImpl.HEADER_STRING);
if(!requiresAuthentication(header)) {
chain.doFilter(request, response);
return;
}
UsernamePasswordAuthenticationToken authentication = null;
if(jwtService.validate(header)) {
authentication = new UsernamePasswordAuthenticationToken(jwtService.getUsername(header), null,
jwtService.getRoles(header));
}
SecurityContextHolder.getContext().setAuthentication(authentication);
chain.doFilter(request, response);
}
protected boolean requiresAuthentication(String header) {
if(header == null || !header.startsWith(JWTServiceImpl.TOKEN_PREFIX)) {
return false;
}
return true;
}
}
| [
"[email protected]"
] | |
bd68e5db7c8b180c0cfb0cce432b39ba753d6a02 | e90fbc03fa4cb6323915cbcc9c000d79d1d7ecea | /code/java/src/main/java/linkedlist/DoublyLinkedList.java | 19bbe38625df4d3cd394e20ec4f1d069f2e7a893 | [] | no_license | abhishek-honey/travelHimalayasCodeWise | 08e21319adc9c8d7a7a4e67658805bc5d9322277 | 425f5046d71ee92753d2b2f3af31795ef5a0f40f | refs/heads/main | 2023-03-15T00:16:02.892196 | 2021-03-05T04:06:29 | 2021-03-05T04:06:29 | 344,087,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,626 | java | package linkedlist;
public class DoublyLinkedList {
public DoublyNode head;
public void add() {
}
public void print() {
}
public void deleteFirstOccurrence(int data) {
}
public static void main(String[] args) {
}
}
class DoublyNode {
Integer data;
DoublyNode prev;
DoublyNode next;
public DoublyNode(Integer data, DoublyNode prev, DoublyNode next) {
super();
this.data = data;
this.prev = prev;
this.next = next;
}
public Integer getData() {
return data;
}
public DoublyNode getPrev() {
return prev;
}
public DoublyNode getNext() {
return next;
}
@Override
public String toString() {
return "DoublyNode [data=" + data + ", prev=" + prev + ", next=" + next + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + ((next == null) ? 0 : next.hashCode());
result = prime * result + ((prev == null) ? 0 : prev.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;
DoublyNode other = (DoublyNode) obj;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (next == null) {
if (other.next != null)
return false;
} else if (!next.equals(other.next))
return false;
if (prev == null) {
if (other.prev != null)
return false;
} else if (!prev.equals(other.prev))
return false;
return true;
}
}
| [
"[email protected]"
] | |
babe9dada5a2c7b7fc3caa6147652461c9227d4e | fa14bf5def7b4b4eae5b7a77d8fbe46e5eba4625 | /app/src/main/java/com/apcovid19project/Login/VerifyActivity.java | d091c0aeaa46f20f458ba164c9b3786172cf44a2 | [] | no_license | COVID-19-Apps/AP-COVID-19-Project | a5bd110a7a0836b6f81202d119ee5aeb1b35a5cc | 87a1300f006bee0a68ad4e9e8cb39e302c9f64f9 | refs/heads/master | 2022-11-08T20:05:14.914999 | 2020-06-19T14:28:15 | 2020-06-19T14:28:15 | 273,512,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,645 | java | package com.apcovid19project.Login;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.apcovid19project.Login.ProfileActivity;
import com.apcovid19project.R;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
import com.google.android.material.textfield.TextInputEditText;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
public class VerifyActivity extends AppCompatActivity {
private String verificationId, Phone_Number;
private FirebaseAuth mAuth;
private TextInputEditText Verify_Code;
private TextView Verify_Timer;
private TextView Description;
private Button Verify_Done, Verify_Resend;
private DatabaseReference mUsersDatabase;
private CountDownTimer countDownTimer;
private boolean startTimer = false;
private final long startTime = (120 * 1000);
private final long interval = 1 * 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify);
mAuth = FirebaseAuth.getInstance();
mUsersDatabase = FirebaseDatabase.getInstance().getReference().child("Users");
mUsersDatabase.keepSynced(true);
Verify_Code = findViewById(R.id.verify_code);
Verify_Done=findViewById(R.id.verify_done);
Description=findViewById(R.id.verify_text);
Verify_Timer=findViewById(R.id.verify_timer);
Verify_Resend=findViewById(R.id.verify_resend);
countDownTimer = new MyCountDownTimer(startTime, interval);
Verify_Timer.setText(Verify_Timer.getText() + String.valueOf(startTime / (60 * 1000)));
timerControl(true);
Phone_Number = getIntent().getStringExtra("phonenumber");
Description.setText("Waiting to automatically detect a SMS sent to "+Phone_Number+".");
sendVerificationCode(Phone_Number);
Verify_Resend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendVerificationCode(Phone_Number);
timerControl(true);
}
});
Verify_Done.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String s=Verify_Code.getText().toString();
if (s.isEmpty() || s.length() < 6) {
Verify_Code.setError("Enter code.");
Verify_Code.requestFocus();
} else {
verifyCode(s.toString());
}
}
});
}
private void verifyCode(String code) {
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationId, code);
signInWithCredential(credential);
}
private void signInWithCredential(PhoneAuthCredential credential) {
timerControl(false);
final ProgressDialog pd = new ProgressDialog(VerifyActivity.this);
pd.setMessage("Logging in.");
pd.setCanceledOnTouchOutside(false);
pd.show();
mAuth.signInWithCredential(credential)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
final HashMap userMap = new HashMap<>();
userMap.put("phone_number", Phone_Number);
userMap.put("name", "");
userMap.put("age", "");
userMap.put("city", "");
userMap.put("country", "");
userMap.put("state", "");
userMap.put("address", "");
userMap.put("email_id", "");
userMap.put("gender", "Male");
userMap.put("verified", "false");
userMap.put("user_id", mAuth.getCurrentUser().getUid());
FirebaseUser current_user = FirebaseAuth.getInstance().getCurrentUser();
final String uid = current_user.getUid();
mUsersDatabase.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
if (snapshot.hasChild(uid)) {
Intent setupIntent = new Intent(VerifyActivity.this, ProfileActivity.class);
setupIntent.putExtra("access","false");
setupIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(setupIntent);
pd.dismiss();
finish();
}else{
mUsersDatabase.child(uid).setValue(userMap).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Intent setupIntent = new Intent(VerifyActivity.this, ProfileActivity.class);
setupIntent.putExtra("access","false");
setupIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(setupIntent);
pd.dismiss();
finish();
}
}
});
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
}
});
}
private void sendVerificationCode(String number) {
PhoneAuthProvider.getInstance().verifyPhoneNumber(
number,
60,
TimeUnit.SECONDS,
TaskExecutors.MAIN_THREAD,
mCallBack
);
}
private PhoneAuthProvider.OnVerificationStateChangedCallbacks
mCallBack = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
verificationId = s;
}
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
String code = phoneAuthCredential.getSmsCode();
if (code != null) {
Verify_Code.setText(code);
verifyCode(code);
}
}
@Override
public void onVerificationFailed(FirebaseException e) {
Toast.makeText(VerifyActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
};
public void timerControl(Boolean startTimer) {
if (startTimer) {
countDownTimer.start();
Verify_Resend.setVisibility(View.GONE);
Verify_Done.setVisibility(View.VISIBLE);
} else {
countDownTimer.cancel();
Verify_Resend.setVisibility(View.VISIBLE);
Verify_Done.setVisibility(View.GONE);
}
}
public class MyCountDownTimer extends CountDownTimer {
public MyCountDownTimer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onFinish() {
Verify_Timer.setText("00 : 00");
Verify_Resend.setVisibility(View.VISIBLE);
}
@Override
public void onTick(long millisUntilFinished) {
long currentTime = millisUntilFinished/1000 ;
Verify_Timer.setText("" + currentTime/60 + " : " +((currentTime % 60)>=10 ? currentTime % 60:"0" +( currentTime % 60)));
}
}
}
| [
"[email protected]"
] | |
4d68b85668f73090e4da93c8a492fba11d64e994 | 5e24e4ee7d14488cc7c6a14dcebbc1cb3c759e95 | /src/stinkyplayer/ArchonBrain.java | f3dfdf52feeb860528425754532f9cdecb65c920 | [] | no_license | robertquitt/battlecode-scaffold-2017 | 8e2911d7f668680754d9c5e3d6072f2e0d5cce11 | 14fc48654aa589268b773c79c21f7f57e80580b7 | refs/heads/master | 2021-01-12T02:10:26.117150 | 2017-01-13T07:52:22 | 2017-01-13T07:52:22 | 78,482,740 | 0 | 0 | null | 2017-01-10T00:40:46 | 2017-01-10T00:40:46 | null | UTF-8 | Java | false | false | 1,021 | java | package stinkyplayer;
import battlecode.common.*;
public class ArchonBrain extends Brain {
public ArchonBrain(RobotController rc) {
this.rc = rc;
}
/**
* run() is the method that is called when a robot is instantiated in the
* Battlecode world. If this method returns, the robot dies! @throws
**/
public void run() {
System.out.println("I'm an archon!");
while (true) {
try {
Direction dir = randomDirection();
if (rc.canHireGardener(dir) && Math.random() < .1 ) {
rc.hireGardener(dir);
}
tryMove(randomDirection());
MapLocation myLocation = rc.getLocation();
rc.broadcast(0,(int)myLocation.x);
rc.broadcast(1,(int)myLocation.y);
Clock.yield();
} catch (Exception e) {
System.out.println("Archon Exception");
e.printStackTrace();
}
}
}
} | [
"[email protected]"
] | |
d618d0193abdc727183e2c4643d8072360aa1116 | 3493b0404b02ff1967e5dfedcacd1ed609f40b67 | /localization-service/src/main/java/br/whereismyson/localizationservice/repository/GeoPositionDAO.java | 7dc341fa2b587cc722790b159fd38bce4fbecf95 | [] | no_license | joseteodoro/WhereIsMySon | cde7dd39c26f738f9db5e8d7de443d3125e6c90a | 146296f367d7285f0e7cd8b9507cb5dbb277493b | refs/heads/master | 2020-03-21T11:01:19.769551 | 2018-06-24T20:19:38 | 2018-06-24T20:19:38 | 138,484,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package br.whereismyson.localizationservice.repository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import br.whereismyson.localizationservice.model.GeoPosition;
@Repository
public interface GeoPositionDAO extends CrudRepository<GeoPosition, Long> {
}
| [
"[email protected]"
] | |
3905ca1e064ca3dc762bf07d6b1d503b008c795b | 260ee7f86f1820c384f14c4da168428a8616f1f9 | /src/com/loiane/cursojava/aula19Labs/Exer35.java | 9c6645e86de82ac8bfbf5c92143548bcfa5e58a1 | [] | no_license | bdumbram/Curso-Java-B-sico | 7d6136033584c754e2fffb5fe9f8350a38046bde | 8f8252f5a3b24586f30d72e843f984a3d5a743be | refs/heads/master | 2020-03-11T17:26:08.554546 | 2018-04-18T00:17:58 | 2018-04-18T00:17:58 | 130,146,684 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package com.loiane.cursojava.aula19Labs;
import java.util.Random;
import java.util.Scanner;
public class Exer35 {
public static void main(String[] args) {
// CORRIGIDO
Scanner scan = new Scanner(System.in);
Random rand = new Random();
int[] vetorA = new int[10];
for (int i = 0; i < vetorA.length; i++) {
vetorA[i] = scan.nextInt();
//vetorA[i] = rand.nextInt(30)+1;
}
for (int i =0; i < vetorA.length; i++) {
System.out.println();
System.out.print(vetorA[i] + " = ");
for (int j =1; j< vetorA[i]; j++) {
if (vetorA[i] % j == 0) {
System.out.print(" " +j);
}
}
}
/*int numero = scan.nextInt();
int resto = 0;
int[] vetorDivisores = new int[10];
vetorDivisores[0] = 1;
for (int i = 2; i <= 10; i++) {
for (int j = i; j <= numero; j++) {
if (numero % i == 0) {
resto = (numero / i);
System.out.println("i = " + i);
vetorDivisores[i-1] = i * vetorDivisores[i-2];
System.out.println("vetor divisores: " + vetorDivisores[i-2]);
numero = resto;
System.out.println("resto = " + resto);
}
}
}*/
}
} | [
"[email protected]"
] | |
ca557d6969130a16e1de889c6561062bc778798b | 45ffdde40fe851e94dba79cc3ccaaabc497f0d58 | /src/main/java/repository/PostRepository.java | 9f8364c8ef0cbcbbce12fb8af2fcb1b5018683dc | [] | no_license | binhnguyenapr91/WBDS-BlogApp | 05d4de9895b868055525c4f4d946da9dff4fb700 | dbc88962a974ff1e3a810d7e56ac2feb344bbc0a | refs/heads/master | 2022-11-08T18:33:47.930595 | 2020-06-14T01:56:37 | 2020-06-14T01:56:37 | 271,944,297 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 103 | java | package repository;
import model.Post;
public interface PostRepository extends Repository<Post> {
}
| [
"[email protected]"
] | |
75e98e572f0b9851f556e1eb6aefaf6df69db959 | 64ab3a874e71dc63fee9371be9fd076588b154a0 | /src/main/java/juc/lock/LockCase.java | 1efbf686927fd0d63db3417d938a44ed4e3f13ff | [
"Apache-2.0"
] | permissive | Mister24/ThinkingInJava | 9638c88df0033f7c66b6e327f1a316992a124ba2 | ba5a0f97cc9c19515573a60afebeada6472945ad | refs/heads/master | 2022-12-23T05:40:53.756650 | 2022-07-24T16:14:44 | 2022-07-24T16:14:44 | 118,343,943 | 0 | 0 | null | 2022-12-16T03:57:20 | 2018-01-21T14:51:37 | JavaScript | UTF-8 | Java | false | false | 931 | java | /**
* @Company Mister24.com Inc.
* @Copyright Copyright (c) 2016-2020 All Rights Reserved.
*/
package juc.lock;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* @author mr.24
* @version Id: LockCase, v 1.0 2020/9/14 下午11:42 Exp $$
*/
public class LockCase extends Thread {
Lock lock = new ReentrantLock();
public static void main(String[] args) {
LockCase lockCase = new LockCase();
Thread thread = new Thread(lockCase);
Thread thread1 = new Thread(lockCase);
thread.start();
thread1.start();
}
public void add() {
lock.lock();
try {
for (int i = 0; i < 98; i++) {
System.out.println(i + " : " + Thread.currentThread().getName());
}
} finally {
lock.unlock();
}
}
@Override
public void run() {
add();
}
}
| [
"[email protected]"
] | |
ecce614a0b86c6d6f903e09f830313251ee81ade | d2223803a1b36aa73ce026a662bb4a49750c3d1d | /src/main/java/com/leetcode/parentheses/_214_ShortestPalindrome.java | c9785e8c63c882bd518d1c758f29ed97bc38af4c | [] | no_license | xzdking/LeetCode | fa99a38577719caac785119ee270fbb807a1150c | c76a1df78a67e4deaef78700935802d504fa2430 | refs/heads/master | 2022-12-31T17:14:39.551291 | 2020-07-14T05:19:26 | 2020-07-14T05:19:26 | 264,629,586 | 0 | 0 | null | 2020-10-13T22:03:15 | 2020-05-17T09:43:11 | Java | UTF-8 | Java | false | false | 979 | java | package com.leetcode.parentheses;
public class _214_ShortestPalindrome {
/**
* 214. 最短回文串
*
* <p>给定一个字符串 s,你可以通过在字符串前面添加字符将其转换为回文串。找到并返回可以用这种方式转换的最短回文串。
*
* <p>示例 1:
*
* <p>输入: "aacecaaa" 输出: "aaacecaaa"
*
* <p>示例 2:
*
* <p>输入: "abcd" 输出: "dcbabcd"
*
* @param s
* @return
*/
public static String shortestPalindrome(String s) {
int i = 0, j = s.length() - 1;
int end = s.length() - 1;
while (i < j) {
if (s.charAt(i) == s.charAt(j)) {
i++;
j--;
} else {
i = 0;
end--;
j = end;
}
}
return new StringBuilder(s.substring(end + 1)).reverse().toString() + s;
}
public static void main(String[] args) {
String s = "aacecaaa";
// String s = "abcd";
System.out.println(shortestPalindrome(s));
}
}
| [
"[email protected]"
] | |
abdf8caef292717354a0c645b34aed9b2390a3b5 | 817f41aa34254c4d2d5088c6ae82117f22407539 | /src/main/java/com/sda/gym/SecurityConfiguration.java | 0e9110ec55f9fb8ee488dd1b3018a02be6db89ef | [] | no_license | moise1985/gymManagement | 7b242af0c38ab6372c96d0cbf1d8370328379972 | 95c88fb0625ee58258460ce0487b8ee45fe4f9c6 | refs/heads/master | 2022-06-12T19:54:18.819059 | 2019-10-11T15:10:26 | 2019-10-11T15:10:26 | 208,424,242 | 0 | 0 | null | 2022-05-25T23:20:09 | 2019-09-14T10:26:44 | CSS | UTF-8 | Java | false | false | 1,360 | java | package com.sda.gym;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/").permitAll()
.antMatchers("/client/save").hasRole("ADMIN")
.antMatchers("/client/delete/*").hasRole("ADMIN")
.antMatchers("/client/update/*").hasRole("ADMIN")
.and()
.exceptionHandling().accessDeniedPage("/accessDenied")
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.permitAll();
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
| [
"[email protected]"
] | |
10c29dac642ae18fd7c9cc9a650463f9890e9152 | a5234d50cbb88685ca5fe8ba76a7a0a79ed9a64d | /quiz/src/main/org/demo/interview/SumPermutation.java | b4220c4bbc62f593ffabc1bfa424729f1914adbc | [] | no_license | ehabtaleb/quiz | 305c1e4f5bc542f88544a6150a96bde5350750a4 | c5ecae9074d99968a9330a81831b967e108deeb2 | refs/heads/master | 2021-01-12T10:45:46.902534 | 2017-04-10T08:48:21 | 2017-04-10T08:48:21 | 72,679,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | package org.demo.interview;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ehabtaleb on 04/02/17.
*/
public class SumPermutation {
private static int match = 12;
public static void findSumPermutation(List<Integer> input,
List<Integer> output, int sum, int level) {
// refuse
if (sum > match) {
return;
}
// found match
if (sum == match) {
System.out.println("output = " + output);
return;
}
for (int i = 0; i < input.size(); i++) {
List<Integer> inClone = new ArrayList<>(input);
int n = inClone.remove(i);
List<Integer> outClone = new ArrayList<>(output);
outClone.add(n);
sum = calcSum(outClone);
findSumPermutation(inClone, outClone, sum, level + 1);
}
}
private static int calcSum(List<Integer> outClone) {
int sum = 0;
for (int i = 0; i < outClone.size(); i++) {
sum += outClone.get(i);
}
return sum;
}
public static void stringPermutation(String input, String output, int n, int level){
if(output.length() > n){
return;
}
if(output.length() == n){
System.out.println("output = " + output);
return;
}
for (int i = 0; i < input.length(); i++) {
String inClone = input.substring(i+1);
String outClone = String.valueOf(output);
char c = input.charAt(i);
outClone = outClone.concat(String.valueOf(c));
System.out.println("inClone = " + inClone);
System.out.println("outClone = " + outClone);
stringPermutation(inClone, outClone, n, level + 1);
}
}
}
| [
"[email protected]"
] | |
3c0e2831b3968c6bb5a3044fc8ea47804c870757 | 5d4f4acf2bfdfd3e14d81319cf57ad29bbd90478 | /app/src/androidTest/java/com/example/root/myrxjava1/ExampleInstrumentedTest.java | d983019d3e9a9373ee16d404c42ae003c4654e68 | [] | no_license | jorgelerma/RxJava1 | d3e2ddd2d9843e5ac50fe2799f1200c3b22b9a59 | 2c672d5cae59e3ea6596fea16425a910020b063a | refs/heads/master | 2020-04-07T17:55:19.582067 | 2018-11-21T18:28:32 | 2018-11-21T18:28:32 | 158,589,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.example.root.myrxjava1;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.root.myrxjava1", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
4673e92370243a9cc911fda39b78b8f9e9ea3154 | 378fa1f41b815b30b0715fd7a33796ed9cd22f8b | /src/main/java/share/costs/users/service/impl/UserServiceImpl.java | 3f7af9819cdcc3a6c0fd244926ec7f9a659bb917 | [] | no_license | elkag/share-costs-api | 948bf53c638e73a4abdf9774f59bc41252c305d4 | dfe0b2e7bf5e4a7d2d8709f4464dfba2b9d353fb | refs/heads/master | 2022-12-26T19:46:14.937489 | 2020-10-01T09:51:54 | 2020-10-01T09:51:54 | 282,732,737 | 0 | 0 | null | 2020-09-13T09:57:25 | 2020-07-26T21:02:23 | Java | UTF-8 | Java | false | false | 345 | java | package share.costs.users.service.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import share.costs.users.service.UserService;
@Service
public class UserServiceImpl implements UserService {
private static final Logger LOGGER = LoggerFactory.getLogger(UserService.class);
}
| [
"[email protected]"
] | |
23134b500d5ec2410da432c6995d4e3d0ce61717 | 6064e0034349b82e5aa71a148125df65c7866983 | /BayesOfFileFixed/DocCount/DocCountMapper.java | fa8bb3d0298ba1e8626ceb889d6ad881c9fbb9f3 | [] | no_license | huangling000/Bayes-on-hadoop | 8b0424d1d293a850215d0ec2d5de573cb1b1cb3b | 9d7e878775cadfed2f0eefabf3a456b9468e90ab | refs/heads/master | 2023-01-24T16:12:05.664290 | 2020-12-03T13:52:28 | 2020-12-03T13:52:28 | 314,595,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package BayesOfFileFixed.DocCount;
import java.io.IOException;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
public class DocCountMapper extends Mapper<LongWritable,Text,Text,IntWritable>{
@Override
protected void map(LongWritable key,Text value, Context context) throws IOException,InterruptedException{
String line = value.toString();
String[] splited = line.split("\t");
String classname = ((FileSplit)context.getInputSplit()).getPath().getName();
context.write(new Text(classname.substring( 0 , classname.indexOf('.'))),new IntWritable(1));
}
}
| [
"[email protected]"
] | |
a706e95b565a15b999a8f1e74b2b3e31e48fea35 | faa1db70d2279f4c28e24aa4d91330d474b34216 | /902BSdkDemo/src/com/sdk902b/demo/fragment/BaseFragment.java | d15e558420743e6cb77e616b5a2982b7ec2b4aa9 | [] | no_license | sleepacesource/Android_Nox902B_SDK | a7a5cf0fd5da4065ac6e49d1b8e310063d8b88f1 | 9a024bfbc7852cffb04ae72cdfa6966458839ab5 | refs/heads/master | 2023-02-21T03:13:23.809749 | 2020-11-06T03:33:09 | 2020-11-06T03:33:09 | 199,401,501 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,553 | java | package com.sdk902b.demo.fragment;
import com.sdk902b.demo.MainActivity;
import com.sdk902b.demo.BaseActivity.MyOnTouchListener;
import com.sleepace.sdk.nox902b.Nox902BHelper;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
public abstract class BaseFragment extends Fragment implements OnClickListener{
protected String TAG = getClass().getSimpleName();
protected MainActivity mActivity;
private Nox902BHelper mHelper;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// TODO Auto-generated method stub
mActivity = (MainActivity) getActivity();
mHelper = Nox902BHelper.getInstance(mActivity);
return super.onCreateView(inflater, container, savedInstanceState);
}
public Nox902BHelper getDeviceHelper() {
return mHelper;
}
protected void findView(View root) {
// TODO Auto-generated method stub
}
protected void initListener() {
// TODO Auto-generated method stub
}
protected void initUI() {
// TODO Auto-generated method stub
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
public void registerTouchListener(MyOnTouchListener myOnTouchListener) {
mActivity.registerTouchListener(myOnTouchListener);
}
public void unregisterTouchListener(MyOnTouchListener myOnTouchListener) {
mActivity.unregisterTouchListener(myOnTouchListener);
}
}
| [
"[email protected]"
] | |
5c94c40c278c31929da8cd4ea9577df86732034c | af55f2e3126d3a95a124315aea6417607b44b396 | /HelloWorld3.java | b7d5f247d1aaf7226e757682bba5329b68d5fa69 | [] | no_license | ruicarvoeiro/Initial-Java | c7aa2255ab6b0249e611028a1eb4946b81042aa1 | 93816ab13506d35663d846babf5486ef24642be2 | refs/heads/master | 2020-03-18T14:16:22.561089 | 2018-05-25T08:48:36 | 2018-05-25T08:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java |
public class HelloWorld3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String hello = "Hello World";
System.out.println(hello);
}
}
| [
"[email protected]"
] | |
be373560fb7fda82b772ca43462717cfb4c0b861 | c6d93152ab18b0e282960b8ff224a52c88efb747 | /安慧软件资料/gitRepository/ITMS-3.0/Code/cy.its.sysCfg/cy.its.sysCfg.domain/src/main/java/cy/its/syscfg/domain/repository/home/INoticeRepository.java | 704be3822f50aeaf0ba9793dca7cd5d1bf6419ef | [] | no_license | BAT6188/company-database | adfe5d8b87b66cd51efd0355e131de164b69d3f9 | 40d0342345cadc51ca2555840e32339ca0c83f51 | refs/heads/master | 2023-05-23T22:18:22.702550 | 2018-12-25T00:58:15 | 2018-12-25T00:58:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package cy.its.syscfg.domain.repository.home;
import java.util.List;
import cy.its.com.domain.IRepository;
import cy.its.syscfg.domain.criteria.NoticeCriteria;
import cy.its.syscfg.domain.model.home.SysNotice;
public interface INoticeRepository extends IRepository<SysNotice> {
List<SysNotice> findNotices(NoticeCriteria criteria);
int countNotices(NoticeCriteria criteria);
void sysNoticeChanged();
}
| [
"[email protected]"
] | |
88ee02ecb3be2d108f74c6d375706e576315ca5e | 4e1f9ac053de49f9a3f9e632b9ba4c69b129f2b9 | /PPPPathVisual/src/main/RunMain.java | 2dafac9e24f343e93dc3576073b8fa1f07f18ba2 | [] | no_license | askus/PPPPathVisual | 6c43f35ce490963cde3403d76dddf6b139787f5c | e02f45b0e66348d033bc628b87e784b8a993e601 | refs/heads/master | 2021-01-11T03:49:41.091023 | 2011-09-13T02:58:25 | 2011-09-13T02:58:25 | 2,375,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java |
package main;
import edu.uci.ics.jung.graph.*;
import edu.uci.ics.jung.graph.util.*;
import edu.uci.ics.jung.algorithms.layout.*;
import edu.uci.ics.jung.visualization.*;
import edu.uci.ics.jung.visualization.decorators.*;
import org.apache.commons.collections15.*;
import javax.swing.*;
import java.io.*;
import java.util.*;
import java.awt.*;
import window.*;
import graph.*;
import utility.*;
public class RunMain{
public static void main( String[] argv) throws Exception{
String answerFileName = argv[0];
String predictFileName = argv[1];
String relationName = argv[2];
Integer isRelation = Integer.parseInt( argv[3] );
String tmpfolder =null;
if( argv.length > 4 ){
tmpfolder = argv[4] ;
}
Map<Long,Collection<Edge>> answer_paths = IOUtility.readGraphs( answerFileName );
Map<Long,Collection<Edge>> predict_paths = IOUtility.readGraphs( predictFileName);
// Map<Long,Collection<Edge>> uid2relations = IOUtility.readRelations( relationName );
RelationsReader r_reader = null;
if( isRelation == 0)
r_reader = new RelationsReader( null );
else
r_reader = new RelationsReader( relationName );
if( tmpfolder!= null ){
r_reader.setTmpfolder( tmpfolder );
}
TreeWindow window = new TreeWindow( answer_paths, predict_paths, r_reader, tmpfolder );
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack();
window.setVisible(true);
}
}
| [
"[email protected]"
] | |
d87ea5cc55c8d9e20e542dd7e63ee1966afd8e9f | 1e51d9a8744700a18387a96b85698ac224dfd0c9 | /test/soundmusic/selenium/Usuarios/DesactivarTest.java | 8b45e4d0b147120202c1ee24ea6ce25b68d440e7 | [] | no_license | Sanmedi27/SoundMusicSeleniumAutomatizacion | 84cad7fee93989ca829c6b7daec5b6152db324b0 | 76d0d3a4fc1f258b6b8ab8aba381733fd196d979 | refs/heads/master | 2020-04-21T11:56:59.282700 | 2019-02-17T17:24:54 | 2019-02-17T17:24:54 | 169,545,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,465 | java | package soundmusic.selenium.Usuarios;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.Before;
import org.junit.BeforeClass;
import static org.junit.Assert.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import soundmusic.selenium.POM.Home;
import soundmusic.selenium.POM.Login;
import soundmusic.selenium.POM.Usuario.*;
/**
*
* @author Santiago Medina Pelaez
*/
public class DesactivarTest {
private static WebDriver driver = null;
Login loginPOM;
Home homePOM;
UsuariosListar usuarioListarPOM;
String nomUsuario;
String password;
public DesactivarTest() {
}
@BeforeClass
public static void setUpClass() {
System.setProperty("webdriver.chrome.driver", "drivers\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
driver.get("http://localhost:8081/SoundMusic/login.jsp");
loginPOM = new Login(driver);
homePOM = new Home(driver);
usuarioListarPOM = new UsuariosListar(driver);
nomUsuario = "admin";
password = "admin";
}
@After
public void tearDown() {
driver.quit();
}
@Test
public void usuariosDesactivarTest() {
loginPOM.ingresarAplicacion(nomUsuario, password);
homePOM.ClicMenuUsuarios();
int numeroUsuariosListados = usuarioListarPOM.numeroUsuariosListados();
int numeroUsuariosActivos = usuarioListarPOM.numeroUsuariosActivos();
int numeroUsuariosInactivos= usuarioListarPOM.numeroUsuariosInactivos();
usuarioListarPOM.clickSoloListarActivosCheckbox();
assertEquals("Validar todos los activos con los que quedan al dar click al chekbox",
numeroUsuariosActivos,
numeroUsuariosListados-numeroUsuariosInactivos);
try {
Thread.sleep(300);
} catch (InterruptedException ex) {
Logger.getLogger(ListarTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"sanme@Santiago"
] | sanme@Santiago |
0794c8637a0cae7313a9c4dfb21d4ebc99bcc9e6 | d70b72f64d53dd56444b0fc9f0ab8c9e4c515c9f | /src/testInput/java/randoop/types/test/VariablesInput.java | 45f08e9bfc4e3b31534552802ca4df33bfc95c9f | [
"MIT",
"GPL-2.0-only"
] | permissive | randoop/randoop | 1c3d5339c1e25549ff40fa4f091f74aeefbefa6d | 615c6feea5dabc43573307e8ee28f11901d15b56 | refs/heads/master | 2023-08-30T05:45:07.426081 | 2023-08-29T14:56:23 | 2023-08-29T14:56:23 | 34,923,107 | 520 | 187 | MIT | 2023-09-14T04:54:50 | 2015-05-01T20:42:29 | Java | UTF-8 | Java | false | false | 1,230 | java | package randoop.types.test;
import java.util.List;
public class VariablesInput {
public <T extends Comparable<T>> void m00(T t) {}
public <T> void m01(T t) {}
public <T> void m02(Comparable<? extends T> t) {}
public <T> void m03(Comparable<? super T> t) {}
public <U, T extends U> void m04(T t) {}
public <T> void m05(Comparable<? extends Number> t) {}
public <T> void m06(Comparable<? super Integer> t) {}
public <U, W extends U, T extends W> void m07(T t) {}
public <U extends Number, W extends U, T extends W> void m08(T t) {}
public <U extends Comparable<U>, W extends U, T extends W> void m09(T t) {}
public <U extends Comparable<T>, W extends U, T extends W> void m10(T t) {}
public <O extends Comparable<? super O>> List<O> m11(O a) {
return null;
}
/*
public void check() {
m00("s");
m00(1);
m01("s");
m01(1);
m02("s"); //also testing capture variable
m02(1); //also testing capture variable
m03("s");
m03(1);
m04("s");
//m05 actually look at capture variable
//m06 actually testing capture variable
m06(1);
m07("s");
m07(1);
//m08("s");
m08(1);
m09("s");
m09(1);
m10("s");
m10(1);
}
*/
}
| [
"[email protected]"
] | |
5663198026447b228b196e259fbe68df893df7bb | 0ecc3f1b9199f398368b1126966c8f3a04351b0c | /clients-business-capability-services/src/main/java/com/lulobank/clients/services/features/clientverificationresult/mapper/RiskEngineMapper.java | 1d40f59aa8e9f9b7a196522956feb877ff19fb74 | [] | no_license | zhenyuncai/client | 30c990af3fe97f8e63d7440f53a73819fcef572b | a352c3cc1d563e5ffa9886988bf831630a915d65 | refs/heads/main | 2023-06-04T12:59:02.973045 | 2021-06-29T23:16:07 | 2021-06-29T23:16:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 991 | java | package com.lulobank.clients.services.features.clientverificationresult.mapper;
import com.lulobank.clients.services.ports.out.dto.RiskOfferResponse;
import com.lulobank.clients.services.utils.InterestUtil;
import com.lulobank.clients.v3.adapters.port.out.dynamo.dto.RiskOfferV3;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, imports = InterestUtil.class)
public interface RiskEngineMapper {
RiskEngineMapper INSTANCE = Mappers.getMapper(RiskEngineMapper.class);
@Mapping(target = "idProductOffer", expression = "java(java.util.UUID.randomUUID().toString())")
@Mapping(target = "state", constant = "ACTIVE")
@Mapping(target = "type", constant = "REGISTRY_PREAPPROVED")
@Mapping(target = "offerDate", expression = "java(java.time.LocalDateTime.now())")
RiskOfferV3 toRiskOfferV3(RiskOfferResponse riskEngineResponse);
}
| [
"[email protected]"
] | |
b244c5a49f6612f202d0893e0185056e02ed709b | 5f8fdf99f76653e8d26986f7cea1caa829d9abf4 | /12 Compound Pattern/src/observable/adapter/GooseAdapter.java | 9830e2a9d1cc49e31e7e15353429529e598dee60 | [] | no_license | nanwan03/HeadFirst-Design-Pattern-Self | 08048b67e61bb376f89a1d31511613cfc0108a32 | 341430a228f5610c440f101a8dc145490e7c2f38 | refs/heads/master | 2021-01-10T07:00:20.930669 | 2016-02-20T22:00:44 | 2016-02-20T22:00:44 | 51,129,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package observable.adapter;
import goose.Goose;
import observable.Observable;
import observable.Quackable;
import observer.Observer;
public class GooseAdapter implements Quackable {
Goose goose;
Observable observable;
public GooseAdapter(Goose goose) {
this.goose = goose;
observable = new Observable(this);
}
@Override
public void registerObserver(Observer observer) {
// TODO Auto-generated method stub
observable.registerObserver(observer);
}
@Override
public void notifyObservers() {
// TODO Auto-generated method stub
observable.notifyObservers();
}
@Override
public void quack() {
// TODO Auto-generated method stub
goose.honk();
notifyObservers();
}
public String toString() {
return "Goose pretending to be a Duck";
}
}
| [
"[email protected]"
] | |
73954b4dbe3ade2a314be65152f4ef0b3198f1b3 | 1a7b39bab33d91a6ed65b9bcecf3196692b5f562 | /Docker/benchmark/arrays/transitively_immutable/ArrayTransitiveImmutability.java | ab2d7dd4b28144f7f5bef08a74b1cb880bb1a0e3 | [
"BSD-2-Clause"
] | permissive | roterEmil/CiFi | 90e6cba1e88d85f6e38c45a9e3b36653f46727bb | f089f897b1f78e05710963772fef0d02f20f2443 | refs/heads/master | 2023-04-12T06:34:38.191533 | 2021-08-20T14:28:21 | 2021-08-20T14:28:21 | 386,268,175 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,271 | java | package org.opalj.fpcf.fixtures.cifi_benchmark.arrays.transitively_immutable;
import edu.cmu.cs.glacier.qual.Immutable;
import org.opalj.fpcf.fixtures.cifi_benchmark.common.CustomObject;
import org.opalj.fpcf.properties.immutability.classes.TransitivelyImmutableClass;
import org.opalj.fpcf.properties.immutability.field_assignability.NonAssignableField;
import org.opalj.fpcf.properties.immutability.fields.TransitivelyImmutableField;
import org.opalj.fpcf.properties.immutability.field_assignability.EffectivelyNonAssignableField;
import org.opalj.fpcf.properties.immutability.types.TransitivelyImmutableType;
/**
* This class encompasses different array-typed transitively immutable fields.
*/
@Immutable
@TransitivelyImmutableType("Class is final")
@TransitivelyImmutableClass("Class has only transitively immutable fields")
public final class ArrayTransitiveImmutability {
@Immutable
@TransitivelyImmutableField("The elements of the array can not escape")
@NonAssignableField("Field is final")
private final Integer @Immutable[] eagerAssignedIntegerArray = new Integer @Immutable[]{1, 2, 3};
@Immutable
@TransitivelyImmutableField("The elements of the array are never set")
@NonAssignableField("The field is only assigned once")
private static final Integer @Immutable[] staticTransitivelyImmutableArray = new Integer @Immutable[5];
@TransitivelyImmutableField("The elements of the array can not escape")
@NonAssignableField("Field is initialized in the constructor")
private final Integer @Immutable[] transitivelyImmutableArrayAssignedInTheConstructor;
public ArrayTransitiveImmutability() {
transitivelyImmutableArrayAssignedInTheConstructor = new Integer @Immutable[]{5, 6, 7, 8};
}
@Immutable
@TransitivelyImmutableField("The elements of the array can not escape")
@EffectivelyNonAssignableField("The array is not initialized.")
private CustomObject @Immutable[] notInitializedArray;
@Immutable
@TransitivelyImmutableField("")
@EffectivelyNonAssignableField("")
private CustomObject @Immutable[] clonedArray = new CustomObject @Immutable[]{new CustomObject(), new CustomObject()};
public CustomObject[] getClonedArray(){ return clonedArray.clone(); }
}
| [
"[email protected]"
] | |
72463b32eaccca952e53cbd47dc0cd4817854f07 | 152607b683b5fcf421f3f18c082e96bf6d0094fa | /payUMoneysdk/src/main/java/com/payUMoney/sdk/fragment/NetBankingFragment.java | 6c435991b3bb1ba1b3eb8b9a14f6ec19f2c8ab1f | [] | no_license | rsv355/DemoImagePinch | 4cfe2331d9a57332aa7ab4ea3a68cd6bb406ad88 | ba6562867830e3111be84945c49b5e1a5eb3f3ad | refs/heads/master | 2020-04-05T08:46:14.651837 | 2015-05-05T20:23:47 | 2015-05-05T20:23:47 | 35,122,037 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,148 | java | package com.payUMoney.sdk.fragment;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.Toast;
import com.payUMoney.sdk.CobbocEvent;
import com.payUMoney.sdk.Constants;
import com.payUMoney.sdk.HomeActivity;
import com.payUMoney.sdk.R;
import com.payUMoney.sdk.Session;
import com.payUMoney.sdk.WebViewActivity;
import com.payUMoney.sdk.adapter.NetBankingAdapter;
import com.payUMoney.sdk.dialog.QustomDialogBuilder;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Iterator;
import de.greenrobot.event.EventBus;
/**
* A simple {@link android.support.v4.app.Fragment} subclass.
*/
public class NetBankingFragment extends Fragment {
ProgressDialog mProgressDialog;
String mid,amt,banklist,bankCode;
JSONArray bankName = new JSONArray();
JSONObject bankObject;
private ProgressBar pb;
JSONObject details;
public NetBankingFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
mid = ((HomeActivity)getActivity()).getMid();
amt = ((HomeActivity)getActivity()).getAmt();
details = ((HomeActivity)getActivity()).getBankObject();
float a = (float)Math.round(getArguments().getDouble("amt_net")*100)/100;
HomeActivity.mAmoutDetails.setVisibility(View.VISIBLE);
HomeActivity.mAmount.setText("Rs." + a);
HomeActivity.mAmoutDetails.setOnClickListener(new View.OnClickListener() {
//@Override
public void onClick(View v) {
if(getArguments().getDouble("coupan_amt")==0.0) {
new QustomDialogBuilder(getActivity(), R.style.PauseDialog).
setTitleColor(Constants.greenPayU).
setDividerColor(Constants.greenPayU)
.setTitle("Payment Details")
.setMessage(
"**Bill Break Down**\n\n"+
"Order Amount : Rs." +round(getArguments().getDouble("amount"),2) + "\nConvenience Fee : Rs." + round(getArguments().getDouble("amt_convenience"),2)
+ "\nTotal : Rs." + round(getArguments().getDouble("amt_total"),2)
+"\n\n**Payment Break Down**\n"
+ "\nDiscount : Rs." + round(getArguments().getDouble("amt_discount"),2)
+ "\nPayUMoney points : Rs." + round(getArguments().getDouble("cashback_amt"),2)
+ "\nNet Amount : Rs." + round(getArguments().getDouble("amt_net"),2)
+ "\nWallet : Rs."+round(getArguments().getDouble("wallet"),2))
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Your code
}
})
.show();
}else{
new QustomDialogBuilder(getActivity(), R.style.PauseDialog).
setTitleColor(Constants.greenPayU).
setDividerColor(Constants.greenPayU)
.setTitle("Payment Details")
.setMessage( "**Bill Break Down**\n\n"+
"Order Amount : Rs." + round(getArguments().getDouble("amount"),2) +
"\nConvenience Fee : Rs." + round(getArguments().getDouble("amt_convenience"),2) +
"\nTotal : Rs." + round(getArguments().getDouble("amt_total"),2) +
"\n\n**Payment Break Down**\n"+
"\nPayUMoney points : Rs." + round(getArguments().getDouble("cashback_amt"),2)
+ "\nCoupon Discount :" + round(getArguments().getDouble("coupan_amt"),2)
+ "\nNet Amount : Rs." + round(getArguments().getDouble("amt_net"),2)
+ "\nWallet" +round(getArguments().getDouble("wallet"),2))
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Your code
}
})
.show();
} }
});
final View netBankingFragment = inflater.inflate(R.layout.fragment_net_banking, container, false);
pb=(ProgressBar)netBankingFragment.findViewById(R.id.pb);
netBankingFragment.findViewById(R.id.nbPayButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final HashMap<String, Object> data = new HashMap<String, Object>();
try {
data.put("bankcode", bankCode);
data.put("key",((HomeActivity)getActivity()).getBankObject().getJSONObject("paymentOption").getString("publicKey").replaceAll("\\r", ""));
pb.setVisibility(View.VISIBLE);
Session.getInstance(getActivity()).sendToPayUWithWallet(((HomeActivity)getActivity()).getBankObject(),"NB",data,getArguments().getDouble("cashback_amt"),getArguments().getDouble("wallet"));
} catch (JSONException e) {
pb.setVisibility(View.GONE);
Toast.makeText(getActivity(),"Something went wrong",Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
});
netBankingFragment.findViewById(R.id.useNewCardButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getActivity().getFragmentManager().popBackStack();
}
});
return netBankingFragment;
}
@Override
public void onResume() {
super.onResume();
EventBus.getDefault().register(this);
}
@Override
public void onPause() {
super.onPause();
EventBus.getDefault().unregister(this);
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
}
public void onEventMainThread(final CobbocEvent event) {
if (event.getType() == CobbocEvent.PAYMENT) {
if (event.getStatus()) {
pb.setVisibility(View.VISIBLE);
Log.i("reached","here");
Intent intent = new Intent(getActivity(), WebViewActivity.class);
intent.putExtra(Constants.RESULT, event.getValue().toString());
getActivity().startActivityForResult(intent,((HomeActivity)getActivity()).WEB_VIEW);
} else {
}
}
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// fetch the data once again if last fetched at is less than 15 min
try {
bankObject = new JSONObject(((HomeActivity)getActivity()).getBankObject().getJSONObject(Constants.PAYMENT_OPTION).getString("nb"));
JSONArray keyNames = bankObject.names();
final String[][] banks1 = new String[102][2];
for (int j = 0; j < keyNames.length(); j++) {
String code = keyNames.getString(j);
JSONObject object = bankObject.getJSONObject(code);
banks1[j][0] = object.getString("pt_priority");
banks1[j][1] = object.getString("title");
//map.put(Integer.valueOf(object.getString("pt_priority")), object.getString("title"));
}
for (int j = 0; j < keyNames.length(); j++) {
for (int k = j + 1; k < keyNames.length(); k++) {
if (Integer.valueOf(banks1[k][0]) < Integer.valueOf(banks1[j][0])) {
String tmpRow[] = banks1[k];
banks1[k] = banks1[j];
banks1[j] = tmpRow;
}
}
}
final String banks[] = new String[keyNames.length()];
for (int j = 0; j < keyNames.length(); j++) {
banks[j] = banks1[j][1];
}
setupAdapter(banks);
} catch (JSONException e) {
e.printStackTrace();
}
}
private void setupAdapter(String banks[]) {
NetBankingAdapter adapter = new NetBankingAdapter(getActivity(), banks);
Spinner netBankingSpinner = (Spinner) getActivity().findViewById(R.id.netBankingSpinner);
netBankingSpinner.setAdapter(adapter);
//String text = netBankingSpinner.getSelectedItem().toString();
netBankingSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
Object item = parent.getItemAtPosition(pos);
Log.i("Item",item.toString());
Iterator bankCodes = bankObject.keys();
try {
while (bankCodes.hasNext()) {
final String code = (String) bankCodes.next();
JSONObject object = bankObject.getJSONObject(code);
if (object.getString("title").equals(item.toString())) {
bankCode = code;
getActivity().findViewById(R.id.nbPayButton).setEnabled(true);
break;
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
@Override
public void onDetach()
{
super.onDetach();
if(getArguments().getDouble("cashback_amt")==0.0);
/*HomeActivity.mPayUpoints.setVisibility(View.GONE);*/
}
@Override
public void onAttach(Activity a)
{
/* HomeActivity.mPayUpoints.setText("Convenience Charge added : "+round((float) (getArguments().getDouble("amt_convenience") / 100) * 100, 2)+" ,PayUPoints charged : "+round((float) (getArguments().getDouble("cashback_amt") / 100) * 100, 2)+" and Discount of: "+round((float) (getArguments().getDouble("amt_discount") / 100) * 100, 2));
HomeActivity.mPayUpoints.setVisibility(View.VISIBLE);*/
a=getActivity();
super.onAttach(a);
}
public static float round(float d, int decimalPlace)
{
BigDecimal bd = new BigDecimal(Float.toString(d));
bd = bd.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP);
return bd.floatValue();
}
public static float round(double d, int decimalPlace)
{
BigDecimal bd = new BigDecimal(Double.toString(d));
bd = bd.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP);
return bd.floatValue();
}
}
| [
"[email protected]"
] | |
00baf2b23def5a7d0b1f445fbe45545bf21dedf9 | 1f793cc8646c8095b5b8300d26d23c9a54080667 | /src/main/java/com/sq/Application.java | ad47f0e7e8a780745acd4ff33e43c0441a1248f5 | [] | no_license | anyangdp/SpringbootQuartz | 94d988be64f13321da3605680040508cb078e8a8 | 23ffc216a300c657bf97a0053211a081c59ff180 | refs/heads/master | 2021-01-19T09:55:50.780438 | 2017-02-28T02:04:28 | 2017-02-28T02:04:28 | 82,162,927 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,476 | java | package com.sq;
import java.util.Arrays;
import org.apache.tomcat.jdbc.pool.DataSource;
import org.beetl.core.resource.ClasspathResourceLoader;
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
import org.beetl.ext.spring.BeetlSpringViewResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.MediaType;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.web.accept.ContentNegotiationManagerFactoryBean;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
@SpringBootApplication
public class Application {
@Autowired
public DataSource dataSource;
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
@Bean
public SchedulerFactoryBean schedulerFactoryBean() {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
schedulerFactoryBean.setDataSource(dataSource);
schedulerFactoryBean.setApplicationContextSchedulerContextKey("applicationContextKey");
schedulerFactoryBean.setConfigLocation(new ClassPathResource("quartz.properties"));
return schedulerFactoryBean;
}
@Bean(initMethod = "init", name = "beetlConfig")
public BeetlGroupUtilConfiguration getBeetlGroupUtilConfiguration() {
BeetlGroupUtilConfiguration beetlGroupUtilConfiguration = new BeetlGroupUtilConfiguration();
try {
ClasspathResourceLoader cploder =
new ClasspathResourceLoader(Application.class.getClassLoader(), "templates/");
beetlGroupUtilConfiguration.setResourceLoader(cploder);
return beetlGroupUtilConfiguration;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Bean
public ContentNegotiatingViewResolver contentViewResolver(
@Qualifier("beetlConfig") BeetlGroupUtilConfiguration beetlGroupUtilConfiguration) throws Exception {
ContentNegotiationManagerFactoryBean contentNegotiationManager = new ContentNegotiationManagerFactoryBean();
contentNegotiationManager.addMediaType("json", MediaType.APPLICATION_JSON);
//bttel template
BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver();
beetlSpringViewResolver.setOrder(0);
beetlSpringViewResolver.setConfig(beetlGroupUtilConfiguration);
beetlSpringViewResolver.setSuffix(".html");
MappingJackson2JsonView defaultView = new MappingJackson2JsonView();
defaultView.setExtractValueFromSingleKeyModel(true);
ContentNegotiatingViewResolver contentViewResolver = new ContentNegotiatingViewResolver();
contentViewResolver.setContentNegotiationManager(contentNegotiationManager.getObject());
contentViewResolver.setViewResolvers(Arrays.<ViewResolver>asList(beetlSpringViewResolver));
contentViewResolver.setDefaultViews(Arrays.<View>asList(defaultView));
return contentViewResolver;
}
}
| [
"[email protected]"
] | |
ab0181412dedee239cd4096ca95429a1df387789 | 9a69f255eda84d86827940054c24f2e5e2377ef0 | /src/com/main/sections/ExtractSectionsContraXML.java | b0e9a64f5d31bd8a228ddccd706a3555cf486bf2 | [] | no_license | bvassilis/migration | 093abf9eec06bac580e665ad56e9165daa81b6bc | b1fa5d6657696f7d1bf6f8788ed357710804bd7b | refs/heads/master | 2018-12-28T05:27:18.672579 | 2011-12-05T10:59:14 | 2011-12-05T10:59:14 | 1,776,690 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,400 | java | package com.main.sections;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import com.escenic.xmlns.x2009.ximport.EscenicDocument;
import com.escenic.xmlns.x2009.ximport.EscenicDocument.Escenic.Version;
import com.escenic.xmlns.x2009.ximport.ParentDocument.Parent;
import com.escenic.xmlns.x2009.ximport.SectionDocument.Section;
//import com.news.Category;
//import com.news.Newspaper;
//import com.news.Newstype;
import com.news.Competition;
import com.news.Place;
import com.news.Sport;
import com.news.SubSection;
public class ExtractSectionsContraXML {
static EntityManager em;
public static void main(String[] args) throws IOException {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("DownloadContraArticlesJPA");
em = emf.createEntityManager();
exportCategoriesContraXML();
// exportNewspapersSectionsContraXML();
}
// private static void exportNewspapersSectionsContraXML() throws IOException {
// EscenicDocument escenicDocument = EscenicDocument.Factory.newInstance();
// initializeEscenic(escenicDocument);
//
// //newspapers section
// Section section = escenicDocument.getEscenic().addNewSection();
// section.addNewSource().setStringValue("ContraSections");
// section.addNewSourceid().setStringValue("newspapers");
// section.addNewName().setStringValue("Πρωτοσέλιδα");
// section.setMirrorSource2(false);
//
// Parent parent = section.addNewParent();
// parent.addNewUniqueName().setStringValue("ece_frontpage");
//
// section.addNewUniqueName().newCursor().setTextValue("newspapers");
// section.addNewDirectory().newCursor().setTextValue("newspapers");
// section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
// section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
// //end newpapers sections
//
// Query q = em.createQuery("SELECT p FROM Newstype p ORDER BY p.priority");
// List<Newstype> resultsNewstype = q.getResultList();
//
// for (Newstype newstype : resultsNewstype) {
// section = escenicDocument.getEscenic().addNewSection();
// section.addNewSource().setStringValue("ContraSections");
// section.addNewSourceid().setStringValue(newstype.getName());
// section.addNewName().setStringValue(newstype.getDisplayName());
// section.setMirrorSource2(false);
//
// parent = section.addNewParent();
// parent.addNewSource().setStringValue("ContraSections");
// parent.addNewSourceid().setStringValue("newspapers");
//
// section.addNewUniqueName().newCursor().setTextValue(newstype.getName());
// section.addNewDirectory().newCursor().setTextValue(newstype.getName());
// section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
// section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
// }
//
// q = em.createQuery("SELECT n FROM Newspaper n ORDER BY n.priority");
// List<Newspaper> resultsNewspaper = q.getResultList();
//
// for (Newspaper newspaper : resultsNewspaper) {
// section = escenicDocument.getEscenic().addNewSection();
// section.addNewSource().setStringValue("ContraSections");
// String englishTitle = ELOT743Convertor.convert(newspaper.getTitle().toLowerCase());
// section.addNewSourceid().setStringValue(englishTitle);
// section.addNewName().setStringValue(newspaper.getTitle());
// section.setMirrorSource2(false);
//
// Newstype newstype = (Newstype) em.createQuery("SELECT p FROM Newstype p WHERE p.id = "+newspaper.getTypeId()).getSingleResult();
// parent = section.addNewParent();
// parent.addNewSource().setStringValue("ContraSections");
// parent.addNewSourceid().setStringValue(newstype.getName());
//
// section.addNewUniqueName().newCursor().setTextValue(englishTitle);
// section.addNewDirectory().newCursor().setTextValue(englishTitle);
// section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
// section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
// }
//
// String outFileName = "import-sections/newspapers-sections.xml";
// File f = new File(outFileName);
// escenicDocument.save(f);
// }
private static void exportCategoriesContraXML() throws IOException{
Query q = em.createQuery("SELECT p FROM Sport p WHERE p.sportID in (1,2,29,42)");
List<Sport> results = q.getResultList();
Query q2 = em.createQuery("SELECT p FROM Sport p WHERE p.sportID not in (0,1,2,29,42)");
List<Sport> results2 = q2.getResultList();
results.addAll(results2);
// List<Integer> resultsCategoriesIds = q2.getResultList();
// resultsCategoriesIds.add(Integer.valueOf(12));
EscenicDocument escenicDocument = EscenicDocument.Factory.newInstance();
initializeEscenic(escenicDocument);
for (Sport cat : results) {
Section section = escenicDocument.getEscenic().addNewSection();
section.addNewSource().setStringValue("ContraSections");
section.addNewSourceid().setStringValue(Integer.toString(cat.getSportID()));
section.addNewName().setStringValue(cat.getSportName());
section.setMirrorSource2(false);
Parent parent = section.addNewParent();
if (cat.getSportID() != 1 && cat.getSportID() != 2 && cat.getSportID() != 29 && cat.getSportID() != 42) {
parent.addNewSource().setStringValue("ContraSections");
parent.addNewSourceid().setStringValue(Integer.toString(42));
} else {
parent.addNewUniqueName().setStringValue("ece_frontpage");
}
section.addNewUniqueName().newCursor().setTextValue(cat.getSportName_url());
section.addNewDirectory().newCursor().setTextValue(cat.getSportName_url());
section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
}
//competitions table
Query q3 = em.createQuery("SELECT c FROM Competition c WHERE c.competitionID<>0");
Place defaultPlace = (Place) em.createQuery("Select p FROM Place p WHERE p.placeID = 1").getSingleResult();
Sport defaultSport = (Sport) em.createQuery("Select p FROM Sport p WHERE p.sportID = 42").getSingleResult();
List<Competition> results3 = q3.getResultList();
//sport -places
for (Competition cat : results3) {
Sport defSport = cat.getSport();
Place defPlace = cat.getPlace();
if(defPlace.getPlaceID()==0){
defPlace = defaultPlace;
}
if(defSport.getSportID()==0){
defSport = defaultSport;
}
Section section = escenicDocument.getEscenic().addNewSection();
section.addNewSource().setStringValue("ContraSections");
section.addNewSourceid().setStringValue(Integer.toString(defSport.getSportID()) +"-"+Integer.toString(defPlace.getPlaceID()));
section.addNewName().setStringValue(defPlace.getPlaceName());
section.setMirrorSource2(false);
Parent parent = section.addNewParent();
parent.addNewSource().setStringValue("ContraSections");
parent.addNewSourceid().setStringValue(Integer.toString(defSport.getSportID()));
section.addNewUniqueName().newCursor().setTextValue(defPlace.getPlaceName_url()+"_"+defSport.getSportName_url());
section.addNewDirectory().newCursor().setTextValue(defPlace.getPlaceName_url());
section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
}
//places - competitions
for (Competition cat : results3) {
Sport defSport = cat.getSport();
Place defPlace = cat.getPlace();
if(defPlace.getPlaceID()==0){
defPlace = defaultPlace;
}
if(defSport.getSportID()==0){
defSport = defaultSport;
}
Section section = escenicDocument.getEscenic().addNewSection();
section.addNewSource().setStringValue("ContraSections");
section.addNewSourceid().setStringValue(Integer.toString(defSport.getSportID()) +"-"+Integer.toString(defPlace.getPlaceID())+"-"+Integer.toString(cat.getCompetitionID()));
section.addNewName().setStringValue(cat.getCompetitionName());
section.setMirrorSource2(false);
Parent parent = section.addNewParent();
parent.addNewSource().setStringValue("ContraSections");
parent.addNewSourceid().setStringValue(Integer.toString(defSport.getSportID()) +"-"+Integer.toString(defPlace.getPlaceID()));
section.addNewUniqueName().newCursor().setTextValue(cat.getCompetitionName_url());
section.addNewDirectory().newCursor().setTextValue(cat.getCompetitionName_url());
section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
}
// subsections columns + archives
for(Object subSectionURL : em.createQuery("SELECT DISTINCT c.subSectionURL FROM SubSection c WHERE (c.section.sectionID=1 OR c.section.sectionID=4) AND c.subSectionID not in (1,47,16)").getResultList()){
String subSectionURLString = (String) subSectionURL;
Section section = escenicDocument.getEscenic().addNewSection();
section.addNewSource().setStringValue("ContraSections");
section.addNewSourceid().setStringValue(subSectionURLString);
section.addNewName().setStringValue(subSectionURLString);
section.setMirrorSource2(false);
Parent parent = section.addNewParent();
parent.addNewUniqueName().setStringValue("ece_frontpage");
section.addNewUniqueName().newCursor().setTextValue(subSectionURLString);
section.addNewDirectory().newCursor().setTextValue(subSectionURLString);
section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
}
List<SubSection> results4 = em.createQuery("SELECT c FROM SubSection c WHERE (c.section.sectionID=1 OR c.section.sectionID=4) AND c.subSectionID not in (1,47,16)").getResultList();
for(SubSection ss : results4){
Section section = escenicDocument.getEscenic().addNewSection();
section.addNewSource().setStringValue("ContraSections");
section.addNewSourceid().setStringValue(ss.getSubSectionName_url());
section.addNewName().setStringValue(ss.getSubSectionName());
section.setMirrorSource2(false);
Parent parent = section.addNewParent();
parent.addNewSource().setStringValue("ContraSections");
parent.addNewSourceid().setStringValue(ss.getSubSectionURL());
section.addNewUniqueName().newCursor().setTextValue(ss.getSubSectionName_url());
section.addNewDirectory().newCursor().setTextValue(ss.getSubSectionName_url());
section.addNewSectionLayout().newCursor().setTextValue("defaultsection");
section.addNewArticleLayout().newCursor().setTextValue("defaultarticle");
}
String outFileName = "import-sections/sections-contra.xml";
File f = new File(outFileName);
escenicDocument.save(f);
}
public static List<String> uniqueNames(){
List<String>uniqueNamesList = new ArrayList<String>();
Query q = em.createQuery("SELECT p FROM Sport p WHERE p.sportID in (1,2,29,42)");
List<Sport> results = q.getResultList();
Query q2 = em.createQuery("SELECT p FROM Sport p WHERE p.sportID not in (0,1,2,29,42)");
List<Sport> results2 = q2.getResultList();
results.addAll(results2);
// List<Integer> resultsCategoriesIds = q2.getResultList();
// resultsCategoriesIds.add(Integer.valueOf(12));
for (Sport cat : results) {
uniqueNamesList.add(cat.getSportName_url());
}
//competitions table
Query q3 = em.createQuery("SELECT c FROM Competition c WHERE c.competitionID<>0");
Place defaultPlace = (Place) em.createQuery("Select p FROM Place p WHERE p.placeID = 1").getSingleResult();
Sport defaultSport = (Sport) em.createQuery("Select p FROM Sport p WHERE p.sportID = 42").getSingleResult();
List<Competition> results3 = q3.getResultList();
//sport -places
for (Competition cat : results3) {
Sport defSport = cat.getSport();
Place defPlace = cat.getPlace();
if(defPlace.getPlaceID()==0){
defPlace = defaultPlace;
}
if(defSport.getSportID()==0){
defSport = defaultSport;
}
uniqueNamesList.add(defPlace.getPlaceName_url()+"_"+defSport.getSportName_url());
}
//places - competitions
for (Competition cat : results3) {
Sport defSport = cat.getSport();
Place defPlace = cat.getPlace();
if(defPlace.getPlaceID()==0){
defPlace = defaultPlace;
}
if(defSport.getSportID()==0){
defSport = defaultSport;
}
uniqueNamesList.add(cat.getCompetitionName_url());
}
// subsections columns + archives
for(Object subSectionURL : em.createQuery("SELECT DISTINCT c.subSectionURL FROM SubSection c WHERE (c.section.sectionID=1 OR c.section.sectionID=4) AND c.subSectionID not in (1,47,16)").getResultList()){
String subSectionURLString = (String) subSectionURL;
uniqueNamesList.add(subSectionURLString);
}
List<SubSection> results4 = em.createQuery("SELECT c FROM SubSection c WHERE (c.section.sectionID=1 OR c.section.sectionID=4) AND c.subSectionID not in (1,47,16)").getResultList();
for(SubSection ss : results4){
uniqueNamesList.add(ss.getSubSectionName_url());
}
return uniqueNamesList;
}
private static void initializeEscenic(EscenicDocument escenicDocument) {
escenicDocument.addNewEscenic();
escenicDocument.getEscenic().setVersion(Version.X_2_0);
}
}
| [
"[email protected]"
] | |
221f946edd35c0a7990a1f912c44bb33014c9a9d | 167c6226bc77c5daaedab007dfdad4377f588ef4 | /java/ql/src/Security/CWE/CWE-502/UnsafeDeserializationBad.java | d5a37b7bf0fb1193bf1b36e4bfdf696ce8c4fb64 | [
"MIT"
] | permissive | github/codeql | 1eebb449a34f774db9e881b52cb8f7a1b1a53612 | d109637e2d7ab3b819812eb960c05cb31d9d2168 | refs/heads/main | 2023-08-20T11:32:39.162059 | 2023-08-18T14:33:32 | 2023-08-18T14:33:32 | 143,040,428 | 5,987 | 1,363 | MIT | 2023-09-14T19:36:50 | 2018-07-31T16:35:51 | CodeQL | UTF-8 | Java | false | false | 267 | java | public MyObject {
public int field;
MyObject(int field) {
this.field = field;
}
}
public MyObject deserialize(Socket sock) {
try(ObjectInputStream in = new ObjectInputStream(sock.getInputStream())) {
return (MyObject)in.readObject(); // unsafe
}
}
| [
"[email protected]"
] | |
f7e751ad0719b1474ff133db40e3abde3e0de270 | ea03efaecfc756cf09b3051ae1a32c4965c00c31 | /app/src/main/java/com/sportskonnect/api/Callbacks/GlobalRankingRespo.java | 3c1c89caa80c3338f283a025dbb0891e11e04f19 | [] | no_license | vjsindhu2/rackonnect_released | 01b245ff9128823de4cb9141310a1428ebd7336d | b687adea80092e2eaea13cb2cb8f75cb1114bfd7 | refs/heads/master | 2020-05-16T18:00:53.805729 | 2019-04-24T11:16:22 | 2019-04-24T11:16:22 | 183,208,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 699 | java | package com.sportskonnect.api.Callbacks;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.sportskonnect.modal.GlobalRankDatum;
import java.util.List;
public class GlobalRankingRespo {
@SerializedName("error")
@Expose
private Boolean error;
@SerializedName("data")
@Expose
private List<GlobalRankDatum> data = null;
public Boolean getError() {
return error;
}
public void setError(Boolean error) {
this.error = error;
}
public List<GlobalRankDatum> getData() {
return data;
}
public void setData(List<GlobalRankDatum> data) {
this.data = data;
}
}
| [
""
] | |
7c74b4cc44a991cae1adb902e984c5feb1e0ea18 | f6554892250ebc0ec4d188aac1678038cd6344ce | /print-service/src/main/java/com/enter/print/pojo/dto/other/LoginCheckDTO.java | 0b13924f54f551cd1eea2b85364bd8c1d97513e0 | [] | no_license | WOW2423/project | f83033d0403fc9d6d66308b24d65855a982b26fb | 5d4e745a96243ef365b01dd5f410ad113a5e5ace | refs/heads/master | 2020-08-07T08:20:17.204619 | 2019-10-07T13:58:32 | 2019-10-07T13:58:32 | 213,369,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.enter.print.pojo.dto.other;
import lombok.Data;
import java.io.Serializable;
/**
* @author Liquid
* @类名: LoginCheckDTO
* @描述: 登录校验DTO
* @date 2019/9/26
*/
@Data
public class LoginCheckDTO implements Serializable{
private static final long serialVersionUID = -2255463046044981156L;
private String projectType;
private String token;
private String resultInfo;
private String userId;
private Boolean result;
}
| [
"[email protected]"
] | |
bd072a91a45f4d440ae8061ece8b301727a1898c | 22e197e53dad6ab8590fabd1d43fd031ef193750 | /Colorful Words/Number2.java | f1eb925847dd33eacdcb18ec52bcb7c5523ad66a | [] | no_license | Gflg/Projetos | 7604bfd758e7dd6443218a75efe7cc9eda4c79b9 | 5bf954abe303bd36d1afa2ac845a04bf565fef4e | refs/heads/master | 2022-04-09T02:14:40.256478 | 2020-03-09T03:36:17 | 2020-03-09T03:36:17 | 112,526,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 483 | java | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Number2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Number2 extends Actor
{
/**
* Act - do whatever the Number2 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}
| [
"[email protected]"
] | |
06af3e0a29decb71e46fd6167bd01ca55476d9b2 | a4b9bcf602647bf48a5412ad0f7d274b1bb147a9 | /DesignPattern/factory/pizzaaf/PizzaIngredientFactory.java | 2bed52834a27c9bea9fd52424b55a6c311222ab0 | [] | no_license | huangketsudou/javalearning | 5680884584771b6c9a9fb1ba5838824cd0ebb550 | 6a5b751e50007702641d14588cb90c0ea0ca0f4c | refs/heads/master | 2022-11-10T14:50:08.716494 | 2020-06-25T09:12:02 | 2020-06-25T09:12:02 | 264,204,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 252 | java | package DesignPattern.factory.pizzaaf;
public interface PizzaIngredientFactory {
Dough createDough();
Sauce createSauce();
Cheese createCheese();
Veggies[] createVeggies();
Pepperoni createPepperoni();
Clams createClam();
} | [
"[email protected]"
] | |
724905296e12a8faa0a94ea24fff20b3d30aedef | 6255eb040af0bcef2a3004a5a795e882c08bdf09 | /src/edu/ctpositivo/trabalho/CanceladoPeloUsuarioException.java | 28a29bca2f568838a6e0f4a18261222fef342811 | [] | no_license | SparK-Cruz/trabalho-bimestral-java | 182e18a7dc9496788980405a83847e86692ac55f | 20d221225fe8f394b7cdb4ce9cab1dbc059b52b2 | refs/heads/master | 2021-01-19T02:12:29.546491 | 2016-06-02T05:32:39 | 2016-06-02T05:32:52 | 60,235,050 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 96 | java | package edu.ctpositivo.trabalho;
public class CanceladoPeloUsuarioException extends Exception{} | [
"[email protected]"
] | |
c74d003be8c4d3af7598f56a812fe4a374caba82 | 44566b5b2e9c766cab03f390f6cd5b0fc5c22dd3 | /AutomationTest/src/test/java/JUnitTests/CalculatorTest.java | 962dedb658a469e72380aef7255eda7956473f2c | [] | no_license | Safa-Derouiche/TestProject | 444f02ebd82a000fe38151447bf7e9ac17f1151b | be513aa2a959ad28d3d3a2533fc774ba0a87af02 | refs/heads/master | 2023-02-16T13:27:52.826366 | 2021-01-13T14:58:20 | 2021-01-13T14:58:20 | 329,053,247 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package JUnitTests;
import org.junit.Assert;
import org.junit.Test;
public class CalculatorTest {
@Test
public void addOnetotwo_mustbethree() {
Calculator calcul = new Calculator();
int actualResult = calcul.add(1, 2);
int expectedResult = 3;
Assert.assertEquals(expectedResult, actualResult);
}
} | [
"[email protected]"
] | |
506f3af75d1575c6d0321e37f6d973cd9d0edc04 | 2867f1f801cb405798cb9557493ccc10aca738ee | /app/src/main/java/com/example/user/mediaplayer/backend/MuseStuff/MuseArtifactPacket.java | c0f8b8257daef68aa00b172289b43c56ccd86d2c | [] | no_license | janamanoharan/Wearhacks2016 | 50f200d3e76ff3914ea4ebffc41d53eb6fd6e08f | ef114f253be2c0810cbce1fe81a4a122ded7c8aa | refs/heads/master | 2021-01-10T10:35:47.544970 | 2016-03-27T13:50:04 | 2016-03-27T13:50:04 | 54,838,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 944 | java | //
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.example.user.mediaplayer.backend.MuseStuff;
import com.example.user.mediaplayer.backend.MuseStuff.SenderInformation;
public final class MuseArtifactPacket {
final SenderInformation source;
final boolean headbandOn;
final boolean blink;
final boolean jawClench;
public MuseArtifactPacket(SenderInformation source, boolean headbandOn, boolean blink, boolean jawClench) {
this.source = source;
this.headbandOn = headbandOn;
this.blink = blink;
this.jawClench = jawClench;
}
public SenderInformation getSource() {
return this.source;
}
public boolean getHeadbandOn() {
return this.headbandOn;
}
public boolean getBlink() {
return this.blink;
}
public boolean getJawClench() {
return this.jawClench;
}
}
| [
"[email protected]"
] | |
84cbbc5c814ad3f3ac827099165593354ee0c7dc | b681ab36327f0aad42e0cad928638b6094edc37c | /MISS/src/th/co/aoe/makedev/missconsult/exam/domain/MyUser.java | 616043b95c7c76f4ae7c4f184174a322f392ccd3 | [] | no_license | imakedev/imakedev-exam | fdbb65da43a109cf8c7c2aa0d9d0ddd7d78f0868 | a2182102a5959a44039058617e7d00af42d039ad | refs/heads/master | 2021-01-23T06:26:16.282898 | 2015-02-08T04:13:56 | 2015-02-08T04:13:56 | 32,436,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | package th.co.aoe.makedev.missconsult.exam.domain;
import java.io.Serializable;
public class MyUser implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
public MyUser(String fullName) {
super();
this.fullName = fullName;
}
private String fullName;
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
}
| [
"[email protected]"
] | |
e410d7d642222825bf529d3922cb29fc2923c910 | 9f76d905f8adac15260a15dfdee2dc97d519e7a6 | /src/main/java/com/examples/settings/GuestPreferences.java | 5d3cbd80cfb81daa9e241ea06dd743d41f099e3d | [] | no_license | sbasinge/primetest | 44e37874b73d4dc7f104c73c678e996c7f6e0205 | e9d922a8d8038df4889ad1861037e9f84c839275 | refs/heads/master | 2016-09-06T08:34:52.338933 | 2011-06-14T10:10:16 | 2011-06-14T10:10:16 | 1,264,178 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | /*
* Copyright 2009 Prime Technology.
*
* 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.examples.settings;
import java.io.Serializable;
import java.util.Map;
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SessionScoped
//@ConversationScoped
@Named
public class GuestPreferences implements Serializable {
Logger log = LoggerFactory.getLogger(GuestPreferences.class);
private String theme = "pepper-grinder"; //default
public String getTheme() {
Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
if(params.containsKey("theme")) {
theme = params.get("theme");
}
return theme;
}
public void setTheme(String theme) {
log.info("Setting theme to {}",theme);
this.theme = theme;
}
}
| [
"Scott@dell8100"
] | Scott@dell8100 |
3ae02f9d20699c0079cb0fc87c1cb636b0f5cb27 | ece85f0b1bf404e4e735bea4139f11e937cf179b | /Trivia/src/com/trivia/Controller/OrderItemController.java | 356e3ee4d424bbf240ceeeec5f286f2cfe7646e6 | [] | no_license | OsamaRaees/Trivia | 6230ab7acc603a29c5eeec01224e473b253f1572 | 08313bb3ca01dfb1185702d9f8a467282c24b967 | refs/heads/master | 2020-05-15T00:57:20.063133 | 2019-04-18T04:51:46 | 2019-04-18T04:51:46 | 182,018,327 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,267 | java | package com.trivia.Controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class OrderItemController
*/
@WebServlet("/OrderItemController")
public class OrderItemController extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public OrderItemController() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"[email protected]"
] | |
12caf017cd2a42609c94863c03a9e67a85fdf566 | 1d7fdb72743552ee45a20519419e850d31a4c746 | /app/src/androidTest/java/com/example/pas_10rpl1_25/ExampleInstrumentedTest.java | 49ee5e63d08ba2d802c05b20aed15180b8fe5c4d | [] | no_license | Ragil-Ikhsan/PAS_10RPL1_25 | 5f3ee3946235509545b926531c5f4907cc6f435f | 6e0d30cdfb6add31f80c6920cdfed8cfb315c89f | refs/heads/master | 2023-05-31T15:23:09.509531 | 2021-06-13T16:00:24 | 2021-06-13T16:00:24 | 376,584,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.example.pas_10rpl1_25;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.pas_10rpl1_25", appContext.getPackageName());
}
} | [
"[email protected]"
] | |
31273fb6bc842c9863096bf4a5fc38abeeceffe2 | 9aef37f8d418daa06643740a72fadc7f1be02fc5 | /Event Handling/src/aku/GUI.java | 9710f44bcfd7818f0df427b414dea6c8985d0dae | [] | no_license | Nityasarara/weh-ada-tugas | c69f7e4d585b47e7498ab45369b00df908ff8f7a | dc238e13ba85563948e82cab5f80947f82f0c495 | refs/heads/master | 2021-05-20T10:07:27.219227 | 2020-04-01T17:20:56 | 2020-04-01T17:20:56 | 252,240,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,640 | java | package aku;
import java.awt.Font;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
public class GUI extends JFrame implements ActionListener {
String Nama,jk,Alamat,hobi;
JRadioButton rd_l,rd_p;
JScrollPane scroll;
JComboBox jc_hobi;
JButton cari=new JButton();
JLabel nama=new JLabel();
JLabel alamat=new JLabel();
JLabel jkelamin=new JLabel();
JLabel Hobi=new JLabel();
JButton simpan=new JButton();
JButton baca=new JButton();
JTextField txtnama =new JTextField();
JTextArea TXTalamat=new JTextArea();
public GUI(){
Font isi=new Font("Arial", Font.PLAIN, 14);
cari.setFont(isi);
nama.setFont(isi);
alamat.setFont(isi);
jkelamin.setFont(isi);
Hobi.setFont(isi);
simpan.setFont(isi);
baca.setFont(isi);
// NAMA MAHASISWA
nama.setText("NAMA");
nama.setBounds(50, 20, 100, 25);
add(nama);
txtnama.setBounds(150, 20, 200, 25);
add(txtnama);
// GENDER
jkelamin.setText("JENIS KELAMIN");
jkelamin.setBounds(50, 60, 150, 25);
add(jkelamin);
//radio button
rd_l=new JRadioButton("Laki-Laki");
rd_l.setBounds(145, 60, 80, 25);
add(rd_l);
rd_p=new JRadioButton("Perempuan");
rd_p.setBounds(225, 60, 95, 25);
add(rd_p);
// ALAMAT
alamat.setText("ALAMAT");
alamat.setBounds(50, 100, 100, 25);
add(alamat);
TXTalamat.setBounds(150, 100, 200, 70);
scroll=new JScrollPane(TXTalamat);
scroll.setBounds(150, 100, 200, 70);
add(scroll);
// Hobi
Hobi.setText("HOBI");
Hobi.setBounds(50, 190, 150, 25);
add(Hobi);
String pilih[] = {"-PILIH-","Tidur","Ngegame","Dengerin Musik"};
jc_hobi = new JComboBox(pilih);
jc_hobi.setBounds(150, 190, 200, 25);
add(jc_hobi);
simpan.setText("Simpan");
simpan.setBounds(50, 250, 140, 25);
simpan.addActionListener(this);
add(simpan);
baca.setText("Tampil");
baca.setBounds(212, 250, 140, 25);
baca.addActionListener(this);
add(baca);
setLayout(null);
setTitle("Form Biodata");
setSize(400, 375);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setResizable(false);
}
public void Buat() throws IOException {
String nameFile="hasil.txt";
FileOutputStream outFile=new FileOutputStream(nameFile);
try{
DataOutputStream outStream=new DataOutputStream(outFile);
outStream.writeUTF("Nama : "+Nama);
outStream.writeUTF("Alamat : "+Alamat);
outStream.writeUTF("Jenis Kelamin : "+jk);
outStream.writeUTF("Hobi : "+hobi);
outStream.close();
JOptionPane.showMessageDialog(this, "Data di simpan");
}catch (IOException e){
System.err.println("IOERROR : "+e.getMessage()+"\n");
}
}
public void Baca() throws IOException{
String nameFile="hasil.txt";
String nama;
String alamat;
String jkelamin;
String hobi;
String isi;
try{
FileInputStream inFile=new FileInputStream(nameFile);
DataInputStream inStream=new DataInputStream(inFile);
nama=inStream.readUTF();
alamat=inStream.readUTF();
jkelamin=inStream.readUTF();
hobi=inStream.readUTF();
isi=nama+"\n"+alamat+"\n"+jkelamin+"\n"+hobi ;
inStream.close();
System.out.println(isi);
}catch (FileNotFoundException e){
System.err.println("File "+nameFile+"Tidak Ada!\n");
}catch (IOException ex ){
System.err.println("IOERROR : "+ex.getMessage()+"\n");
}
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("Simpan")){
Nama=txtnama.getText();
Alamat=TXTalamat.getText();
if(rd_l.isSelected()){
jk="Laki-Laki";
}else{
jk="Perempuan";
}
hobi=(String) jc_hobi.getSelectedItem();
try {
Buat();
} catch (IOException ex) {}
}else if(e.getActionCommand().equals("Tampil")){
try {
Baca();
} catch (IOException ex) {}
}else{
dispose();
}
}
}
| [
"[email protected]"
] | |
97413921fd08ac3235a03550837b3c06cb00f75a | 886a5c4bf6ae0c50e29150d90fc8ea1388601143 | /webservice/src/com/demo/webservice/service/AxisDemoWebservice.java | 35227ff5f2b400eab7407f545cc100ec30787964 | [] | no_license | taz372436/Test | 39013f9d333d51ac313e9cf0222b59d99d5782e1 | 4803e8248e72decd805bbb825d0e4f254f23a2dd | refs/heads/master | 2021-01-20T19:13:06.058327 | 2016-07-29T07:48:22 | 2016-07-29T07:48:22 | 64,456,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | package com.demo.webservice.service;
import java.util.HashMap;
import java.util.Map;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.demo.webservice.bean.RequestBeanWS;
import com.demo.webservice.bean.ResponseBeanWS;
/**
* webservice 接口---邦邦搭伙平台
* @author AB049399
*
*/
//@WebService
//@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface AxisDemoWebservice {
// @WebMethod
// public void testWebsServiceNull();
// @WebMethod@WebParam(name = "inputs")
// public void testWebsServiceOne(CxBBSlsRelaBean inputs);
// public void testWebsServiceOne(CxBBSlsRelaBean inputs);
// @WebMethod
// @WebResult(name = "results")
// public String testWebsServiceTwo(CxBBSlsRelaBean inputs);
public ResponseBeanWS testWebsServiceTwo(RequestBeanWS inputs);
}
| [
"[email protected]"
] | |
2bd026a03eba9d3a56041c05422024de3b724bdc | ee2fece384c0b7b58cd40f10227960c9058d2ee6 | /src/main/java/com/homeapp/app/domain/AbstractAuditingEntity.java | f729e1961d63622dd5911e573f699680de06c6dc | [] | no_license | FredPi17/HomeAutomationApp | 302289b94b4f4a1109c2a81db6f25486c3f38867 | 1e9a98aa091982dd943a866b0ea919deeb9b49db | refs/heads/master | 2022-12-22T15:00:58.568671 | 2020-03-09T18:50:24 | 2020-03-09T18:50:24 | 244,335,080 | 0 | 0 | null | 2022-12-16T05:13:17 | 2020-03-02T09:49:13 | Java | UTF-8 | Java | false | false | 2,166 | java | package com.homeapp.app.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.io.Serializable;
import java.time.Instant;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
/**
* Base abstract class for entities which will hold definitions for created, last modified by and created,
* last modified by date.
*/
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@CreatedBy
@Column(name = "created_by", nullable = false, length = 50, updatable = false)
@JsonIgnore
private String createdBy;
@CreatedDate
@Column(name = "created_date", updatable = false)
@JsonIgnore
private Instant createdDate = Instant.now();
@LastModifiedBy
@Column(name = "last_modified_by", length = 50)
@JsonIgnore
private String lastModifiedBy;
@LastModifiedDate
@Column(name = "last_modified_date")
@JsonIgnore
private Instant lastModifiedDate = Instant.now();
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
}
| [
"[email protected]"
] | |
45955009a1aec900f75c9020f2351525ec9bf56a | d1b921f0f720f6fc3ae24ad0810c39788ee09566 | /spring-boot-study3/src/main/java/study/springboot/step8security/WebSecurtiyConfig.java | c4ccab0b560554f936112b3f0aa481dbd8353077 | [] | no_license | shro1005/SpringBootStudy | efd0e9a3f66d4cff42ee64b7d62009f4936b5c4e | 50ad60409f7d99f6c0bc4c889f3b620f9e98e2ec | refs/heads/master | 2022-11-28T16:51:28.097008 | 2019-09-11T05:36:04 | 2019-09-11T05:36:04 | 203,683,111 | 0 | 0 | null | 2022-11-16T12:38:34 | 2019-08-22T00:15:18 | Java | UTF-8 | Java | false | false | 1,387 | java | package study.springboot.step8security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
* WebSecurityConfig 2019.09.10 Spring Securtiy 커스터 마이징
*/
@Configuration
public class WebSecurtiyConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/", "/welcome").permitAll() /** 해당 화면은 허가한다는 의미*/
.anyRequest().authenticated() /** 나머지 화면들은 인증이 필요하다.*/
.and()
.formLogin().and() /** form login을 해야한다.*/
.httpBasic(); /** http 베이직 인증 해야한다.*/
}
@Bean
public PasswordEncoder passwordEncoding() {
return PasswordEncoderFactories.createDelegatingPasswordEncoder();
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.