blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2e19de3f871936868fcaeb2821fa5247a97764b | e724e02a461303e0751e39c8be3ef006e57daee4 | /src/conversordetemperaturas/ConversordeTemperaturas.java | 6e907af9527ef7f070065f663ccce612f02929c3 | [] | no_license | Luisfrb56/Boletin13 | cbbc4530009dc5128c51d66ebc29a4b6c5bdfdf8 | 5cf2bf908d5ff97f86f72695c514314a201283c3 | refs/heads/master | 2021-05-06T16:53:54.617093 | 2017-12-10T21:25:07 | 2017-12-10T21:25:07 | 113,784,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java |
package conversordetemperaturas;
public class ConversordeTemperaturas {
public static void main(String[] args) {
ConversorTemperaturas obj1=new ConversorTemperaturas();
try{
System.out.println(obj1.centigradosAFharenheit(85));
}catch(Exception e){
System.out.println(e.getMessage());
}
try{
System.out.println(obj1.centigradosARemur(120));
}catch(Exception e){
System.out.println(e.getMessage());
}
}
}
| [
"adm@LAPTOP-EQL1FQIM.home"
] | adm@LAPTOP-EQL1FQIM.home |
19aa6bebcaa163efab306e365226c3738d37f824 | 688561181ac8f1ddf880ad9cbd21ed0121385717 | /spring-data-jpa/src/main/java/pl/spring/demo/repository/BookRepository.java | 3f0b3180890bbbc4e1f63666b29b2bbdf5f126e4 | [] | no_license | TomaszKwolek/HibernateJPAGroup2 | b3fcd52c8b989aff11bcfdb869233dbfa61b2617 | a9a7288f5910720a5cb1b0d979d3d848a7f612fe | refs/heads/master | 2016-09-13T23:00:53.188824 | 2016-05-24T10:35:16 | 2016-05-24T10:35:16 | 59,562,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package pl.spring.demo.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import pl.spring.demo.entity.BookEntity;
import java.util.List;
public interface BookRepository extends JpaRepository<BookEntity, Long> {
@Query("select book from BookEntity book where upper(book.title) like concat(upper(:title), '%')")
public List<BookEntity> findBookByTitle(@Param("title") String title);
@Query("select book from BookEntity book JOIN book.authors author where upper(author.firstName) like concat('%', upper(:author), '%') or upper(author.lastName) like concat('%', upper(:author), '%')")
public List<BookEntity> findBookByAuthor(@Param("author") String author);
@Query("select book from BookEntity book JOIN book.authors author where upper(book.title) like concat('%', upper(:title), '%') and (upper(author.firstName) like concat('%', upper(:author), '%') or upper(author.lastName) like concat('%', upper(:author), '%')) and upper(book.library.name) like concat('%', upper(:libraryName), '%')")
public List<BookEntity> findBookByCriteria(@Param("title") String title, @Param("author") String author, @Param("libraryName") String libraryName);
}
| [
"tomasz.kwolek@capgemini.com"
] | tomasz.kwolek@capgemini.com |
d468f8baa735657041868b902470914fcc2648fa | 54772e8abe7247c3e0bf725357cd627d672dd767 | /src/net/shopxx/controller/shop/ProductController.java | 79a8bc515619ff563797d310c8d8724ba27d898f | [] | no_license | tomdev2008/newcode | a0be11f290009c089a6e874b19aa6585c1606f7c | 2e78acdd97886f9464df09d2172d21bc78f9bd74 | refs/heads/master | 2021-01-16T19:21:42.323854 | 2013-06-15T03:05:18 | 2013-06-15T03:05:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,629 | java | package net.shopxx.controller.shop;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import net.shopxx.Pageable;
import net.shopxx.ResourceNotFoundException;
import net.shopxx.entity.Attribute;
import net.shopxx.entity.Brand;
import net.shopxx.entity.Product;
import net.shopxx.entity.Product.ProductOrderType;
import net.shopxx.entity.ProductCategory;
import net.shopxx.entity.Promotion;
import net.shopxx.service.BrandService;
import net.shopxx.service.ProductCategoryService;
import net.shopxx.service.ProductService;
import net.shopxx.service.PromotionService;
import net.shopxx.service.SearchService;
import net.shopxx.service.TagService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller("shopProductController")
@RequestMapping({ "/product" })
public class ProductController extends BaseController {
@Resource(name = "productServiceImpl")
private ProductService IIIlllIl;
@Resource(name = "productCategoryServiceImpl")
private ProductCategoryService IIIllllI;
@Resource(name = "brandServiceImpl")
private BrandService IIIlllll;
@Resource(name = "promotionServiceImpl")
private PromotionService IIlIIIII;
@Resource(name = "tagServiceImpl")
private TagService IIlIIIIl;
@Resource(name = "searchServiceImpl")
private SearchService IIlIIIlI;
@RequestMapping(value = { "/history" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
@ResponseBody
public List<Product> history(Long[] ids) {
return this.IIIlllIl.findList(ids);
}
@RequestMapping(value = { "/list/{productCategoryId}" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String list(@PathVariable Long productCategoryId, Long brandId,
Long promotionId, Long[] tagIds, BigDecimal startPrice,
BigDecimal endPrice, ProductOrderType orderType,
Integer pageNumber, Integer pageSize, HttpServletRequest request,
ModelMap model) {
ProductCategory localProductCategory = (ProductCategory) this.IIIllllI
.find(productCategoryId);
if (localProductCategory == null)
throw new ResourceNotFoundException();
Brand localBrand = (Brand) this.IIIlllll.find(brandId);
Promotion localPromotion = (Promotion) this.IIlIIIII.find(promotionId);
List localList = this.IIlIIIIl.findList(tagIds);
HashMap localHashMap = new HashMap();
if (localProductCategory != null) {
Set<Attribute> attributes = localProductCategory.getAttributes();
Iterator<Attribute> localIterator = attributes.iterator();
while (localIterator.hasNext()) {
Attribute localAttribute = (Attribute) localIterator.next();
String str = request.getParameter("attribute_"
+ localAttribute.getId());
if (!StringUtils.isNotEmpty(str))
continue;
localHashMap.put(localAttribute, str);
}
}
Object localObject = new Pageable(pageNumber, pageSize);
model.addAttribute("orderTypes", ProductOrderType.values());
model.addAttribute("productCategory", localProductCategory);
model.addAttribute("brand", localBrand);
model.addAttribute("promotion", localPromotion);
model.addAttribute("tags", localList);
model.addAttribute("attributeValue", localHashMap);
model.addAttribute("startPrice", startPrice);
model.addAttribute("endPrice", endPrice);
model.addAttribute("orderType", orderType);
model.addAttribute("pageNumber", pageNumber);
model.addAttribute("pageSize", pageSize);
model.addAttribute("page", this.IIIlllIl.findPage(localProductCategory,
localBrand, localPromotion, localList, localHashMap,
startPrice, endPrice, Boolean.valueOf(true),
Boolean.valueOf(true), null, Boolean.valueOf(false), null,
null, orderType, (Pageable) localObject));
return (String) "/shop/product/list";
}
@RequestMapping(value = { "/list" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String list(Long brandId, Long promotionId, Long[] tagIds,
BigDecimal startPrice, BigDecimal endPrice,
ProductOrderType orderType, Integer pageNumber, Integer pageSize,
HttpServletRequest request, ModelMap model) {
Brand localBrand = (Brand) this.IIIlllll.find(brandId);
Promotion localPromotion = (Promotion) this.IIlIIIII.find(promotionId);
List localList = this.IIlIIIIl.findList(tagIds);
Pageable localPageable = new Pageable(pageNumber, pageSize);
model.addAttribute("orderTypes", ProductOrderType.values());
model.addAttribute("brand", localBrand);
model.addAttribute("promotion", localPromotion);
model.addAttribute("tags", localList);
model.addAttribute("startPrice", startPrice);
model.addAttribute("endPrice", endPrice);
model.addAttribute("orderType", orderType);
model.addAttribute("pageNumber", pageNumber);
model.addAttribute("pageSize", pageSize);
model.addAttribute("page", this.IIIlllIl.findPage(null, localBrand,
localPromotion, localList, null, startPrice, endPrice,
Boolean.valueOf(true), Boolean.valueOf(true), null,
Boolean.valueOf(false), null, null, orderType, localPageable));
return "/shop/product/list";
}
@RequestMapping(value = { "/search" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String search(String keyword, BigDecimal startPrice,
BigDecimal endPrice, ProductOrderType orderType,
Integer pageNumber, Integer pageSize, ModelMap model) {
if (StringUtils.isEmpty(keyword))
return "/shop/common/error";
Pageable localPageable = new Pageable(pageNumber, pageSize);
model.addAttribute("orderTypes", ProductOrderType.values());
model.addAttribute("productKeyword", keyword);
model.addAttribute("startPrice", startPrice);
model.addAttribute("endPrice", endPrice);
model.addAttribute("orderType", orderType);
model.addAttribute("page", this.IIlIIIlI.search(keyword, startPrice,
endPrice, orderType, localPageable));
return "shop/product/search";
}
@RequestMapping(value = { "/hits/{id}" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
@ResponseBody
public Long hits(@PathVariable Long id) {
return Long.valueOf(this.IIIlllIl.viewHits(id));
}
}
| [
"xiaoshi332@163.com"
] | xiaoshi332@163.com |
fba4d31d3ea286b81a7cca368b866b16d625befd | 97a7ef64f4d40ba9e775110a6ad9ffab0e53f3a2 | /rabbitmq-send/src/main/java/service/business/rpc/minicore/SL_RPC_RecvThread.java | 82b1ce931a80fdd1db84315903aa94f35a7c16a9 | [] | no_license | wanghuan578/rabbitmq-demo | f53048cbf44fa03d8359185cfc92d340a095b50d | 6a58efbeb0520fac129e7c19e014805d2b59607d | refs/heads/master | 2021-04-09T11:47:38.382305 | 2018-04-13T01:31:07 | 2018-04-13T01:31:07 | 125,465,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,414 | java | /************************************************************
Description: SL_RPC_RecvThread.
Author: wanghuan. 2013-01-20.
Boxin Technology Corporated Corporation. All Rights Reserved.
*************************************************************/
package service.business.rpc.minicore;
public class SL_RPC_RecvThread {
private boolean m_IsSelectRunning = false;
private SL_RPC_Socket_CommonAPI m_SocketCommAPI = null;
private Thread m_RecvThread = null;
public SL_RPC_RecvThread(SL_RPC_Socket_CommonAPI imp) {
SetRunnningStatus(true);
m_SocketCommAPI = imp;
m_RecvThread = new Thread(new ReceiveThread());
}
public SL_RPC_Socket_CommonAPI GetSocketCommAPI(){
return m_SocketCommAPI;
}
public void Listern() {
m_RecvThread.start();
}
public void Destory(){
System.out.println("SL_RPC_RecvThread - Destory");
SetRunnningStatus(false);
GetSocketCommAPI().Destroy();
}
private void SetRunnningStatus(boolean b) {
m_IsSelectRunning = b;
}
private boolean IsRunning() {
return m_IsSelectRunning;
}
public class ReceiveThread extends Thread{
public ReceiveThread() {
}
private void Select() throws InterruptedException {
SL_RPC_ByteBuffer len_buffer = new SL_RPC_ByteBuffer(4);
switch(m_SocketCommAPI.Recv_N(len_buffer, 0, 4)){
case SL_RPC_ErrorCode.NETWORK_DISCONNECT:{
System.out.println("SL_RPC_RecvThread - 00000000 Select NetWork Disconnect");
SetRunnningStatus(false);
}
break;
case SL_RPC_ErrorCode.SOCKET_EXCEPTION:{
System.out.println("SL_RPC_RecvThread - 00000000 Select Socket Exception");
SetRunnningStatus(false);
}
break;
default:{
int buff_len = len_buffer.ReadI32(0);
SL_RPC_ByteBuffer receive_buffer = new SL_RPC_ByteBuffer(buff_len);
receive_buffer.WriteI32(buff_len);
if(0 < buff_len){
int ret = m_SocketCommAPI.Recv_N(receive_buffer, 4, (buff_len - 4));
switch(ret){
case SL_RPC_ErrorCode.NETWORK_DISCONNECT:{
System.out.println("SL_RPC_RecvThread - 11111111 Select NetWork Disconnect");
SetRunnningStatus(false);
}
break;
case SL_RPC_ErrorCode.SOCKET_EXCEPTION:{
System.out.println("SL_RPC_RecvThread - 11111111 Select Socket Exception");
SetRunnningStatus(false);
}
break;
default:{
DispatchMessage(receive_buffer, buff_len);
}
break;
}
}
else
{
System.out.println("SL_RPC_RecvThread - Fatal Error Received Data Out Of Range Length: " + buff_len);
//SL_RPC_Seda_Stage.Instance().PushEvent(new SL_RPC_Seda_Event(null, new SL_RPC_CommHead(SL_RPC_ErrorCode.NETWORK_DISCONNECT)));
SetRunnningStatus(false);
}
}
break;
}
}
public void run()
{
while(true)
{
if(!IsRunning()){
System.out.println("SL_RPC_RecvThread - Thread Over");
break;
}
try
{
Select();
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
}
private void DispatchMessage(SL_RPC_ByteBuffer buff, int len){
buff.WriteBufferBegin(len);
SL_RPC_MainStageHandler main_stage = new SL_RPC_MainStageHandler(buff);
main_stage.Initialize();
main_stage.handle_message();
}
}
| [
"57810140@qq.com"
] | 57810140@qq.com |
1640a06b628fb65b01b7d19f48fe31eeb180e5f7 | 0ff504f363c057e256556405acefdf3f827006fd | /src/main/java/com/app/demo/Gof23Model/strategy/example/BackDoor.java | f042f59b4f36823b07729734c2f0b618e6d164a8 | [] | no_license | Justdoitwj/breeze | b16606036c5303f5e9c9b4310ec711629ff77920 | b772e01a3c1ede32c15cf106bd6a61b18be5671a | refs/heads/dev | 2022-06-30T13:29:47.901212 | 2021-04-11T14:40:32 | 2021-04-11T14:40:32 | 210,748,978 | 1 | 2 | null | 2022-06-21T01:56:21 | 2019-09-25T03:37:36 | Java | UTF-8 | Java | false | false | 362 | java | /**
*
*/
package com.app.demo.Gof23Model.strategy.example;
/**
* @author cbf4Life cbf4life@126.com
* I'm glad to share my knowledge with you all.
* 找乔国老帮忙,使孙权不能杀刘备
*/
public class BackDoor implements IStrategy {
public void operate() {
System.out.println("找乔国老帮忙,让吴国太给孙权施加压力");
}
}
| [
"13227866253@163.com"
] | 13227866253@163.com |
a923b215d482b89639900e5cc9d44ff7b38a4d08 | 1d88a12d1bac65ece5af69d5d9d82cb268a310aa | /publiccms-common/src/main/java/com/publiccms/common/tools/TemplateModelUtils.java | 1435efdbc3c303cdb455d0338ef0c09dc3d42426 | [] | no_license | apexwang/publiccms-parent | 1d9e7095fd7268de69e4411773a25167c0b44ac5 | c8b6bc3711da15e84d8cc450e85cc89e40d608fb | refs/heads/master | 2022-12-23T01:16:41.177571 | 2020-03-09T02:46:12 | 2020-03-09T02:46:12 | 245,928,198 | 1 | 0 | null | 2022-12-16T12:25:27 | 2020-03-09T02:39:27 | JavaScript | UTF-8 | Java | false | false | 9,431 | java | package com.publiccms.common.tools;
import java.text.ParseException;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import com.publiccms.common.constants.Constants;
import freemarker.ext.beans.BeanModel;
import freemarker.template.TemplateBooleanModel;
import freemarker.template.TemplateDateModel;
import freemarker.template.TemplateHashModelEx;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
import freemarker.template.TemplateNumberModel;
import freemarker.template.TemplateScalarModel;
import freemarker.template.TemplateSequenceModel;
/**
* 模板数据模型工具类
*
* TemplateModelUtils
*
*/
public class TemplateModelUtils {
/**
* @param model
* @return java bean value
* @throws TemplateModelException
*/
public static Object converBean(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
converBean(((TemplateSequenceModel) model).get(0));
}
if (model instanceof BeanModel) {
return ((BeanModel) model).getWrappedObject();
}
}
return null;
}
/**
* @param model
* @return string value
* @throws TemplateModelException
*/
public static String converString(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
converString(((TemplateSequenceModel) model).get(0));
}
if (model instanceof TemplateScalarModel) {
return ((TemplateScalarModel) model).getAsString();
} else if ((model instanceof TemplateNumberModel)) {
return ((TemplateNumberModel) model).getAsNumber().toString();
}
}
return null;
}
/**
* @param model
* @return map value
* @throws TemplateModelException
*/
public static TemplateHashModelEx converMap(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateHashModelEx) {
return (TemplateHashModelEx) model;
}
}
return null;
}
/**
* @param model
* @return int value
* @throws TemplateModelException
*/
public static Integer converInteger(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
converInteger(((TemplateSequenceModel) model).get(0));
}
if (model instanceof TemplateNumberModel) {
return ((TemplateNumberModel) model).getAsNumber().intValue();
} else if (model instanceof TemplateScalarModel) {
String s = ((TemplateScalarModel) model).getAsString();
if (CommonUtils.notEmpty(s)) {
try {
return Integer.parseInt(s);
} catch (NumberFormatException e) {
return null;
}
}
}
}
return null;
}
/**
* @param model
* @return short value
* @throws TemplateModelException
*/
public static Short converShort(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
model = ((TemplateSequenceModel) model).get(0);
}
if (model instanceof TemplateNumberModel) {
return ((TemplateNumberModel) model).getAsNumber().shortValue();
} else if (model instanceof TemplateScalarModel) {
String s = ((TemplateScalarModel) model).getAsString();
if (CommonUtils.notEmpty(s)) {
try {
return Short.parseShort(s);
} catch (NumberFormatException e) {
return null;
}
}
}
}
return null;
}
/**
* @param model
* @return long value
* @throws TemplateModelException
*/
public static Long converLong(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
model = ((TemplateSequenceModel) model).get(0);
}
if (model instanceof TemplateNumberModel) {
return ((TemplateNumberModel) model).getAsNumber().longValue();
} else if (model instanceof TemplateScalarModel) {
String s = ((TemplateScalarModel) model).getAsString();
if (CommonUtils.notEmpty(s)) {
try {
return Long.parseLong(s);
} catch (NumberFormatException e) {
return null;
}
}
}
}
return null;
}
/**
* @param model
* @return double value
* @throws TemplateModelException
*/
public static Double converDouble(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
converDouble(((TemplateSequenceModel) model).get(0));
}
if (model instanceof TemplateNumberModel) {
return ((TemplateNumberModel) model).getAsNumber().doubleValue();
} else if (model instanceof TemplateScalarModel) {
String s = ((TemplateScalarModel) model).getAsString();
if (CommonUtils.notEmpty(s)) {
try {
return Double.parseDouble(s);
} catch (NumberFormatException e) {
return null;
}
}
}
}
return null;
}
/**
* @param model
* @return string array value
* @throws TemplateModelException
*/
public static String[] converStringArray(TemplateModel model) throws TemplateModelException {
if (model instanceof TemplateSequenceModel) {
TemplateSequenceModel smodel = (TemplateSequenceModel) model;
String[] values = new String[smodel.size()];
for (int i = 0; i < smodel.size(); i++) {
values[i] = converString(smodel.get(i));
}
return values;
}
String str = converString(model);
if (null != str) {
if (0 <= str.indexOf(Constants.COMMA_DELIMITED)) {
return StringUtils.split(str, Constants.COMMA_DELIMITED);
} else {
return StringUtils.split(str, Constants.BLANK_SPACE);
}
}
return null;
}
/**
* @param model
* @return bool value
* @throws TemplateModelException
*/
public static Boolean converBoolean(TemplateModel model) throws TemplateModelException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
model = ((TemplateSequenceModel) model).get(0);
}
if (model instanceof TemplateBooleanModel) {
return ((TemplateBooleanModel) model).getAsBoolean();
} else if (model instanceof TemplateNumberModel) {
return !(0 == ((TemplateNumberModel) model).getAsNumber().intValue());
} else if (model instanceof TemplateScalarModel) {
String temp = ((TemplateScalarModel) model).getAsString();
if (CommonUtils.notEmpty(temp)) {
return Boolean.valueOf(temp);
}
}
}
return null;
}
/**
* @param model
* @return data value
* @throws TemplateModelException
* @throws ParseException
*/
public static Date converDate(TemplateModel model) throws TemplateModelException, ParseException {
if (null != model) {
if (model instanceof TemplateSequenceModel) {
converDate(((TemplateSequenceModel) model).get(0));
}
if (model instanceof TemplateDateModel) {
return ((TemplateDateModel) model).getAsDate();
} else if (model instanceof TemplateScalarModel) {
String temp = StringUtils.trimToEmpty(((TemplateScalarModel) model).getAsString());
if (DateFormatUtils.FULL_DATE_LENGTH == temp.length()) {
return DateFormatUtils.getDateFormat(DateFormatUtils.FULL_DATE_FORMAT_STRING).parse(temp);
} else if (DateFormatUtils.SHORT_DATE_LENGTH == temp.length()) {
return DateFormatUtils.getDateFormat(DateFormatUtils.SHORT_DATE_FORMAT_STRING).parse(temp);
} else {
try {
return new Date(Long.parseLong(temp));
} catch (NumberFormatException e) {
return null;
}
}
} else if (model instanceof TemplateNumberModel) {
return new Date(((TemplateNumberModel) model).getAsNumber().longValue());
}
}
return null;
}
}
| [
"apex.f.wang@126.com"
] | apex.f.wang@126.com |
c6bc923d2577d3290995a28d0bd78d6ec00dca14 | 08c10fa25d0f5e582efa3876106b8642de3a0896 | /CGB-DB-SYS-V3.02/src/main/java/com/cy/pj/sys/service/SysUserService.java | 183751669f5fb9dd5333027dab20acfff9efbac4 | [] | no_license | githendtbao/CGB-JT | fd1f2f46361e798398de6f9a2183b38881922768 | bd0261f0f65159c25b11231133dec611268001b7 | refs/heads/master | 2021-02-16T22:14:21.917836 | 2020-03-05T03:25:06 | 2020-03-05T03:25:06 | 245,048,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package com.cy.pj.sys.service;
import com.cy.common.vo.PageObject;
public interface SysUserService {
/**
* 基于id更换用户启用和禁用状态
* @param id
* @param valid
* @return
*/
int updateValidById(Integer id,Integer valid);
/**
* -基于用户名查询用户信息
* @param username
* @param pageCurrent
* @return
*/
PageObject findPageObjects(String username,Integer pageCurrent);
}
| [
"hendtbao@163.com"
] | hendtbao@163.com |
0b218766e1acff0f8a95751438d95ea0e1f9a1d3 | 91951ad8d7bd6e3837129170e64bb67ea60f8cf5 | /JavaEx/src/com/javaex/api/objectclass/v2/LangClassTest.java | d578c4be23feeaf11405cc74529dac00f5ea9f2d | [] | no_license | kimjjing1004/JavaEx | 29df9b97e3b214ecb948bd482b5ab8e6e0b65ac6 | a5089c93c6d8c982b796c56f7d5e2af414af235d | refs/heads/master | 2023-05-17T23:39:31.951188 | 2021-06-13T16:35:52 | 2021-06-13T16:35:52 | 363,073,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package com.javaex.api.objectclass.v2;
public class LangClassTest {
public static void main(String[] args) {
Point p = new Point(10, 10);
Point p2 = new Point(10, 10);
System.out.println("p == p2 ? " + (p == p2));
System.out.println("p.equals(p2) ? " + p.equals(p2));
}
} | [
"bit@DESKTOP-60QQ7IK"
] | bit@DESKTOP-60QQ7IK |
4c0e8fd9809b71a5f88adfa59e38cd0e90f2c128 | 49f55096624bc31e973809b7f43f579d9bbc7aa0 | /src/main/java/com/fnt/sys/AppRequestFilter.java | 1310e5a13606fa21726369e795a16821193fcb95 | [] | no_license | tfanto/server2 | a41e27a32331e1811372ade906db2916013f47fd | f1fe4cad96a169aac52d9f93eecefba4aa0392a6 | refs/heads/master | 2020-03-22T18:26:34.182750 | 2018-08-28T06:06:17 | 2018-08-28T06:06:17 | 140,460,472 | 0 | 0 | null | 2018-08-28T06:06:18 | 2018-07-10T16:32:32 | Java | UTF-8 | Java | false | false | 4,838 | java | package com.fnt.sys;
import java.io.IOException;
import java.security.Principal;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Priority;
import javax.crypto.SecretKey;
import javax.ws.rs.Priorities;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.PreMatching;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import org.slf4j.MDC;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fnt.AppException;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.JWEObject;
import com.nimbusds.jose.Payload;
import com.nimbusds.jose.crypto.DirectDecrypter;
@PreMatching
@Provider
@Priority(Priorities.AUTHENTICATION)
public class AppRequestFilter implements ContainerRequestFilter {
private static final ObjectMapper MAPPER = new ObjectMapper();
private static final String TRANSACTION_ID = "TRANSID";
@Context
UriInfo uriInfo;
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
String path = uriInfo.getPath();
/*
* URI uri = uriInfo.getRequestUri(); System.out.println(path);
* System.out.println(requestContext.getMethod());
*/
if (path.startsWith("/events")) {
return;
}
String jweString = requestContext.getHeaderString("Authorization");
if (jweString == null) {
throw new AppException(403, "Forbidden");
// requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
}
Map<String, Object> payload = null;
try {
payload = decrypt(jweString);
} catch (Throwable t) {
throw new AppException(403, "Forbidden");
// requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
}
if (payload == null) {
throw new AppException(403, "Forbidden");
// requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
}
if (!payload.containsKey("user")) {
throw new AppException(403, "Forbidden");
// requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
}
if (!payload.containsKey("roles")) {
throw new AppException(403, "Forbidden");
// requestContext.abortWith(Response.status(Response.Status.FORBIDDEN).build());
}
// transaction tracking every request must be trackable
MDC.put(TRANSACTION_ID, UUID.randomUUID().toString());
// AppUserContext user = new AppUserContext(payload);
// AppSecurityContext securityContext = new AppSecurityContext(uriInfo, user);
// requestContext.setSecurityContext(securityContext);
String user = String.valueOf(payload.get("user"));
String rolesStr = String.valueOf(payload.get("roles"));
requestContext.setSecurityContext(new SecurityContext() {
@Override
public Principal getUserPrincipal() {
return new Principal() {
@Override
public String getName() {
return user;
}
};
}
@Override
public boolean isUserInRole(String role) {
List<String> roles = Arrays.asList(rolesStr.split(","));
return roles.contains(role);
}
@Override
public boolean isSecure() {
return uriInfo.getAbsolutePath().toString().startsWith("https");
}
@Override
public String getAuthenticationScheme() {
return "Token-Based-Auth-Scheme";
}
});
}
/*
* @Override public void filter(ContainerRequestContext requestContext) throws
* IOException {
*
* // transaction tracking every request must be trackable
* MDC.put(TRANSACTION_ID, UUID.randomUUID().toString());
*
* Map<String, Object> payload = new HashMap<>(); payload.put("name",
* "testuser"); payload.put("roles", "ADMIN,USER,GUEST");
*
* AppUserContext user = new AppUserContext(payload); AppSecurityContext
* securityContext = new AppSecurityContext(uriInfo, user);
* requestContext.setSecurityContext(securityContext); }
*/
@SuppressWarnings("unused")
private Map<String, Object> decrypt(String jweString) throws ParseException, JOSEException, JsonParseException, JsonMappingException, IOException {
JWEObject jweObject = JWEObject.parse(jweString);
DirectDecrypter directDecrypter = new DirectDecrypter(getKey());
jweObject.decrypt(directDecrypter);
// Get the plain text
Payload payload = jweObject.getPayload();
Map<String, Object> payloadMap = MAPPER.readValue(payload.toString(), new TypeReference<Map<String, Object>>() {
});
return payloadMap;
}
private SecretKey getKey() {
return AppServletContextListener.getEncryptionKey();
}
}
| [
"thomas@fanto.se"
] | thomas@fanto.se |
04b47d347cedaed3d9e80baf00bb960da4d12566 | d2a6233e06786c9b3a0935476972c6a32111ea1b | /ChangeTabLayout/library/src/main/java/com/github/zl/changetablayout/ChangeTabLayout.java | c3e7bb1e22290a7bf5ecba84dd0b7bdd78b4c049 | [
"Apache-2.0"
] | permissive | kairui467/GithubProject_Gomtel | f0a36dd755446db86a3b1e3634665234f2306f2c | 4b3a6766111fe74113358e528fd8044e2aafc08e | refs/heads/master | 2021-01-20T14:58:40.976221 | 2017-04-18T06:37:27 | 2017-04-18T06:37:27 | 82,787,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,586 | java | /*
* Copyright 2017 simplezhli
*
* 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.github.zl.changetablayout;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.VerticalViewPager;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import static com.github.zl.changetablayout.Constant.ARRAY_INITIAL_VALUE;
/**
* 作者:weilu on 2017/3/15 13:59
*/
public class ChangeTabLayout extends ScrollView{
/**
* tab收起与展开
*/
private boolean tabLayoutState = true;
/**
* tabLayout是否可以点击
*/
private boolean tabLayoutIsClick = true;
/**
* tabView切换是否需要文字实时变化
*/
private boolean flag = false;
private final int tabViewHeight;
private final int tabImageHeight;
private final int defaultTabImageColor;
private final int selectedTabImageColor;
private VerticalViewPager viewPager;
private final ChangeTabStrip tabStrip;
private OnTabClickListener onTabClickListener;
private InternalTabClickListener internalTabClickListener;
private float density = 0;
private AttributeSet attrs;
private int page = 0; //当前页数位置
public ChangeTabLayout(Context context) {
this(context, null);
}
public ChangeTabLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ChangeTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.attrs = attrs;
//禁用滚动条
setVerticalScrollBarEnabled(false);
//去除阴影
setOverScrollMode(OVER_SCROLL_NEVER);
//防止ScrollView子View不能撑满全屏显示问题
setFillViewport(true);
final DisplayMetrics dm = getResources().getDisplayMetrics();
density = dm.density;
int tabViewHeight = (int) (Constant.TAB_VIEW_HEIGHT * density);
int tabImageHeight = (int) (Constant.TAB_IMAGE_HEIGHT * density);
int defaultTabImageColor = Constant.GRAY;
int selectedTabImageColor = Constant.RED;
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ChangeTabLayout);
tabViewHeight = a.getDimensionPixelSize(R.styleable.ChangeTabLayout_ctl_tabViewHeight, tabViewHeight);
tabImageHeight = a.getDimensionPixelSize(R.styleable.ChangeTabLayout_ctl_tabImageHeight, tabImageHeight);
defaultTabImageColor = a.getColor(R.styleable.ChangeTabLayout_ctl_defaultTabImageColor, defaultTabImageColor);
selectedTabImageColor = a.getColor(R.styleable.ChangeTabLayout_ctl_selectedTabImageColor, selectedTabImageColor);
a.recycle();
this.tabViewHeight = tabViewHeight;
this.tabImageHeight = tabImageHeight;
this.defaultTabImageColor = defaultTabImageColor;
this.selectedTabImageColor = selectedTabImageColor;
this.tabStrip = new ChangeTabStrip(context, attrs);
this.internalTabClickListener = new InternalTabClickListener();
addView(tabStrip, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
}
private int [] icon;
private int [] iconSelected;
private int[] lastPosition; //水平ViewPages position位置
private float[] lastValue; //水平ViewPages positionOffset位置
public void setViewPager(VerticalViewPager viewPager, int [] iconDefault, int [] iconSelected) {
tabStrip.removeAllViews();
this.viewPager = viewPager;
this.icon = iconDefault;
this.iconSelected = iconSelected;
page = 0;
if (viewPager != null && viewPager.getAdapter() != null) {
viewPager.addOnPageChangeListener(new InternalViewPagerListener());
viewPager.setOnTouchListener(new ViewPagerTouchListener());
lastPosition = new int[viewPager.getAdapter().getCount()];
lastValue = new float[viewPager.getAdapter().getCount()];
if(icon != null){
populateTabStrip();
}
}
}
private void populateTabStrip() {
final PagerAdapter adapter = viewPager.getAdapter();
if(adapter.getCount() != icon.length){
return;
}
if(iconSelected != null && iconSelected.length != icon.length){
return;
}
int size = adapter.getCount();
for (int i = 0; i < size; i++) {
LinearLayout tabView;
if(iconSelected == null){
tabView = createTabView(adapter.getPageTitle(i), icon[i], 0);
}else{
tabView = createTabView(adapter.getPageTitle(i), icon[i], iconSelected[i]);
}
if (tabView == null) {
throw new IllegalStateException("tabView is null.");
}
if (internalTabClickListener != null) {
//分别为图片与文字设置点击事件,为了收起状态时文字不能点击做准备
tabView.getChildAt(0).setOnClickListener(internalTabClickListener);
tabView.getChildAt(1).setOnClickListener(internalTabClickListener);
}
tabStrip.addView(tabView);
if (i == viewPager.getCurrentItem()) {
ChangeTextView textView = (ChangeTextView) tabView.getChildAt(1);
textView.setLevel(5000);
}
lastPosition[i] = ARRAY_INITIAL_VALUE;
}
setTabLayoutState(true); //默认设置为打开状态
}
protected LinearLayout createTabView(CharSequence title, int icon, int selectIcon) {
LinearLayout mLinearLayout = new LinearLayout(getContext());
mLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
mLinearLayout.setGravity(Gravity.CENTER_VERTICAL);
mLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, tabViewHeight));
ImageView imageView = new ImageView(getContext());
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tabImageHeight + (int) (16 * density), tabViewHeight);
imageView.setPadding((int) (9 * density), 0, (int) (7 * density), 0);
imageView.setLayoutParams(lp);
RevealDrawable drawable;
if(selectIcon != 0){
drawable = new RevealDrawable(DrawableUtils.getDrawable(getContext(), icon), DrawableUtils.getDrawable(getContext(), selectIcon), RevealDrawable.VERTICAL);
}else{
drawable = new RevealDrawable(DrawableUtils.getTabDrawable(getContext(), icon, defaultTabImageColor),
DrawableUtils.getTabDrawable(getContext(), icon, selectedTabImageColor), RevealDrawable.VERTICAL);
}
imageView.setImageDrawable(drawable);
ChangeTextView textView = new ChangeTextView(getContext(), attrs);
textView.setText(title.toString());
textView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
mLinearLayout.addView(imageView);
mLinearLayout.addView(textView);
return mLinearLayout;
}
private class InternalViewPagerListener implements VerticalViewPager.OnPageChangeListener {
private int scrollState;
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
int tabStripChildCount = tabStrip.getChildCount();
if ((tabStripChildCount == 0) || (position < 0) || (position >= tabStripChildCount)) {
return;
}
tabStrip.onViewPagerPageChanged(position, positionOffset);
scrollToTab(position, positionOffset);
}
@Override
public void onPageScrollStateChanged(int state) {
scrollState = state;
}
@Override
public void onPageSelected(int position) {
if (scrollState == ViewPager.SCROLL_STATE_IDLE) {
scrollToTab(position, 0);
}
page = position; // 记录位置
for (int i = 0, size = tabStrip.getChildCount(); i < size; i++) {
ChangeTextView textView = (ChangeTextView) ((LinearLayout) tabStrip.getChildAt(i)).getChildAt(1);
if (position == i) {
textView.setLevel(5000);
}else {
textView.setLevel(0);
}
}
}
}
private class ViewPagerTouchListener implements OnTouchListener{
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
flag = true;
break;
}
return false;
}
}
private void scrollToTab(int tabIndex, float positionOffset) {
final int tabStripChildCount = tabStrip.getChildCount();
if (tabStripChildCount == 0 || tabIndex < 0 || tabIndex >= tabStripChildCount) {
return;
}
LinearLayout selectedTab = (LinearLayout) getTabAt(tabIndex);
if (0f <= positionOffset && positionOffset < 1f) {
if(!tabLayoutState){
ImageView imageView = (ImageView) selectedTab.getChildAt(0);
((RevealDrawable)imageView.getDrawable()).setOrientation(RevealDrawable.VERTICAL);
imageView.setImageLevel((int) (positionOffset * 5000 + 5000));
}
if(flag){
ChangeTextView textView = (ChangeTextView) selectedTab.getChildAt(1);
textView.setLevel((int) (positionOffset * 5000 + 5000));
}
}
if(!(tabIndex + 1 >= tabStripChildCount)){
LinearLayout tab = (LinearLayout) getTabAt(tabIndex + 1);
if(!tabLayoutState){
ImageView img = (ImageView) tab.getChildAt(0);
((RevealDrawable)img.getDrawable()).setOrientation(RevealDrawable.VERTICAL);
img.setImageLevel((int) (positionOffset * 5000));
}
if(flag){
ChangeTextView text = (ChangeTextView) tab.getChildAt(1);
text.setLevel((int) (positionOffset * 5000));
}
}
int titleOffset = tabViewHeight * 2;
int extraOffset = (int) (positionOffset * selectedTab.getHeight());
int y = (tabIndex > 0 || positionOffset > 0) ? -titleOffset : 0;
int start = selectedTab.getTop();
y += start + extraOffset;
scrollTo(0, y);
}
/**
* 水平VIewPager控制
*/
public void setPageScrolled(int p, int position, float positionOffset) {
if (page != p){
return;
}
if (position - lastPosition[page] > 0) {
if (lastPosition[page] != ARRAY_INITIAL_VALUE){
tabLayoutState = false; //每次向左滑动结束时,进入判断,菜单关闭状态
tabLayoutIsClick = true;
}
}else if(position - lastPosition[page] < 0){
if(lastValue[page] - positionOffset < 0){
//向左滑动时,不操作。
return;
}
}
lastPosition[page] = position;
lastValue[page] = positionOffset;
if(positionOffset == 0){
return;
}
if(tabLayoutState){ //防止重复收起
final int tabStripChildCount = tabStrip.getChildCount();
if (tabStripChildCount == 0 || page < 0 || page >= tabStripChildCount) {
return;
}
LinearLayout selectedTab = (LinearLayout) getTabAt(page);
ImageView imageView = (ImageView) selectedTab.getChildAt(0);
((RevealDrawable)imageView.getDrawable()).setOrientation(RevealDrawable.HORIZONTAL);
if (0f < positionOffset && positionOffset <= 1f) {
imageView.setImageLevel((int) ((1 - positionOffset) * 5000 + 5000));
}
for (int i = 0, size = tabStrip.getChildCount(); i < size; i++) {
ChangeTextView textView = (ChangeTextView) ((LinearLayout) tabStrip.getChildAt(i)).getChildAt(1);
if (0f < positionOffset && positionOffset <= 1f) {
textView.setAlpha((1 - positionOffset));
if(positionOffset > 0.9f){
textView.setVisibility(INVISIBLE);
tabLayoutIsClick = false; //防止同时点击,导致状态混乱
}else{
textView.setVisibility(VISIBLE);
tabLayoutIsClick = true;
}
}
}
tabStrip.onViewPagerPageChanged(positionOffset);
}
}
/**
* 点击事件
*/
private class InternalTabClickListener implements OnClickListener {
@Override
public void onClick(View v) {
if(!tabLayoutState){ // 收起状态点击,切换为打开状态
setTabLayoutState(true);
return;
}
if(!tabLayoutIsClick){ //只阻止打开状态时点击
return;
}
for (int i = 0, size = tabStrip.getChildCount(); i < size; i++) {
if (v.getParent() == tabStrip.getChildAt(i)) {
viewPager.setCurrentItem(i);
flag = false;
// viewPager.setCurrentItem(i, false);
if (onTabClickListener != null) {
onTabClickListener.onTabClicked(i);
}
}
}
}
}
/**
* 返回指定位置的选项卡.
* @param position 位置
* @return 指定位置的选项卡View
*/
public View getTabAt(int position) {
return tabStrip.getChildAt(position);
}
public interface OnTabClickListener {
void onTabClicked(int position);
}
/**
* Tab点击事件{@link OnTabClickListener}
* @param listener 点击事件监听器
*/
public void setOnTabClickListener(OnTabClickListener listener) {
onTabClickListener = listener;
}
/**
* 获取TabLayout的状态
*/
public boolean getTabLayoutState(){
return tabLayoutState;
}
/**
* 设置TabLayoutState
* @param state 状态
*/
public void setTabLayoutState(boolean state){
tabLayoutState = true; //先设为可操作
if(state){
setPageScrolled(page, lastPosition[page], 0.00001f);
}else{
setPageScrolled(page, lastPosition[page], 1f);
}
tabLayoutState = state;
}
/**
* 设置阴影颜色
* @param shadowColor 阴影颜色
*/
public void setShadowColor(int shadowColor){
tabStrip.setShadowColor(shadowColor);
}
/**
* 设置背景颜色
* @param backgroundColor 背景颜色
*/
public void setTabLayoutBackgroundColor(int backgroundColor){
tabStrip.setTabLayoutBackgroundColor(backgroundColor);
}
/**
* 设置指示器颜色
* @param indicatorColor 指示器颜色
*/
public void setIndicatorColor(int indicatorColor){
tabStrip.setIndicatorColor(indicatorColor);
}
/**
* 设置指示器标记颜色
* @param leftBorderColor 指示器标记颜色
*/
public void setLeftBorderColor(int leftBorderColor){
tabStrip.setLeftBorderColor(leftBorderColor);
}
/**
* 设置指示器上下内边距
* @param indicatorPadding 指示器上下内边距
*/
public void setIndicatorPadding(int indicatorPadding){
tabStrip.setIndicatorPadding(indicatorPadding);
}
/**
* 设置指示器标记宽度
* @param leftBorderThickness 指示器标记宽度
*/
public void setLeftBorderThickness(int leftBorderThickness){
tabStrip.setLeftBorderThickness(leftBorderThickness);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if(tabLayoutState){
return super.onTouchEvent(event);
}else {
final int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN: //收起时点击不拦截,传入下层
return false;
case MotionEvent.ACTION_MOVE: //收起时,滑动文字部分拦截
if(tabImageHeight + (int) (20 * density) < event.getRawX()){
return true;
}
break;
}
return super.onTouchEvent(event);
}
}
}
| [
"421152600@qq.com"
] | 421152600@qq.com |
19a855ecfb8f45e4f94284ce737547aec920fd82 | ed9a9069865197fb58bf9b71554fb0decf8b8e1e | /JSWebView/app/src/main/java/com/lukemi/jswebiew/MyObject.java | 4a1e874f8df508ec3d5b5f076eecdce003dceba1 | [] | no_license | LukeMi/JSWebView | e86d4cbacd596e16607bae684ea4807c579864cd | b0225038c7f5a18c772662123b105fa4b868e703 | refs/heads/master | 2021-09-08T08:11:22.338398 | 2018-03-08T14:15:39 | 2018-03-08T14:15:39 | 115,698,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 944 | java | package com.lukemi.jswebiew;
import android.content.Context;
import android.util.Log;
import android.webkit.JavascriptInterface;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;
/**
* Created by chenmz
* on 2017/12/6 0006.
*/
public class MyObject {
public static final String TAG = MyObject.class.getSimpleName();
private Context mContext;
private String data;
public MyObject(Context c, String data) {
this.data = data;
mContext = c;
}
/**
* 获取person字符串传Html
*
* @return
*/
@JavascriptInterface
public String getData() {
List<Person> mlist = new ArrayList<>();
for (int i = 0; i < 10; i++) {
mlist.add(new Person("Li" + i, i + "", "com" + i));
}
Gson gson = new Gson();
String d = gson.toJson(mlist);
Log.d(TAG, "getData: dddd" + d);
return d;
}
} | [
"chenmz@91360.com"
] | chenmz@91360.com |
05d9f9018bace97d95c7ce903fd97f00ce8b25ad | 4d5dff7ba300e5c77d752169a1c09b17af969d97 | /Octorprint/app/src/main/java/android/app/printerapp/viewer/FileBrowser.java | 7b2ec2005c7c8f539e3639617a404f38087760db | [] | no_license | Atlanca/Refactoring | e977477c3495bddcf9264b89346b2192e3753c6e | ec2498e7c4ef3c1d18c44c4f787af6ddd0e61b92 | refs/heads/master | 2021-08-07T18:10:45.793334 | 2017-11-08T17:02:58 | 2017-11-08T17:02:58 | 109,815,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,453 | java | package android.app.printerapp.viewer;
import android.app.Activity;
import android.app.Dialog;
import android.app.printerapp.R;
import android.app.printerapp.library.LibraryController;
import android.app.printerapp.library.LibraryModelCreation;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
/**
*
* @author Marina Gonzalez
*/
public class FileBrowser extends Activity {
private static Context mContext;
private static File mCurrentPath;
private static File[] mDialogFileList;
private static int mSelectedIndex = -1;
private static OnFileListDialogListener mFileListListener;
private static OnClickListener mClickListener;
private static DialogInterface.OnKeyListener mKeyListener;
private static String mTitle;
private static String mExtStl;
private static String mExtGcode;
public final static int VIEWER = 0;
public final static int LIBRARY = 1;
/**
*
* @return selected file name
*/
public String getSelectedFileName() {
String ret = "";
if (mSelectedIndex >= 0) {
ret = mDialogFileList[mSelectedIndex].getName();
}
return ret;
}
public static void openFileBrowser(final Context context, int mode, String title, String extStl, String extGcode) {
mTitle = title;
mExtStl = extStl;
mExtGcode = extGcode;
mContext = context;
setOnFileListDialogListener(context);
setOnClickListener(context);
setOnKeyListener (context);
switch (mode) {
case VIEWER:
setOnFileListDialogListenerToOpenFiles(context);
break;
case LIBRARY:
setOnFileListDialogListener(context);
break;
}
show(LibraryController.getParentFolder().getAbsolutePath());
}
/**
* Display the file chooser dialog
*
* @param path
*/
public static void show(String path) {
try {
mCurrentPath = new File(path);
mDialogFileList = new File(path).listFiles();
if (mDialogFileList == null) {
// NG
if (mFileListListener != null) {
mFileListListener.onClickFileList(null);
}
} else {
List<String> list = new ArrayList<String>();
List<File> fileList = new ArrayList<File>();
// create file list
Arrays.sort(mDialogFileList, new Comparator<File>() {
@Override
public int compare(File object1, File object2) {
return object1.getName().toLowerCase(Locale.US).compareTo(object2.getName().toLowerCase(Locale.US));
}
});
for (File file : mDialogFileList) {
if (!file.canRead()) {
continue;
}
String name = null;
if (file.isDirectory()) {
if (!file.getName().startsWith(".")) {
name = file.getName() + File.separator;
}
} else {
if (LibraryController.hasExtension(0,file.getName())) {
name = file.getName();
}
if (LibraryController.hasExtension(1,file.getName())) {
name = file.getName();
}
}
if (name != null) {
//Filter by directory, stl or gcode extension
if ((LibraryController.hasExtension(0,name))||(LibraryController.hasExtension(1,name))
||file.isDirectory()){
list.add(name);
fileList.add(file);
}
}
}
final Dialog dialog;
LayoutInflater li = LayoutInflater.from(mContext);
View view = li.inflate(R.layout.dialog_list, null);
final uk.co.androidalliance.edgeeffectoverride.ListView listView =
(uk.co.androidalliance.edgeeffectoverride.ListView) view.findViewById(R.id.dialog_list_listview);
listView.setSelector(mContext.getResources().getDrawable(R.drawable.list_selector));
TextView emptyText = (TextView) view.findViewById(R.id.dialog_list_emptyview);
listView.setEmptyView(emptyText);
FileBrowserAdapter fileBrowserAdapter = new FileBrowserAdapter(mContext, list, fileList);
listView.setAdapter(fileBrowserAdapter);
listView.setDivider(null);
mDialogFileList = fileList.toArray(mDialogFileList);
MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(mContext)
.title(mTitle)
.customView(view, false)
.negativeText(R.string.cancel)
.negativeColorRes(R.color.theme_accent_1)
.callback(new MaterialDialog.ButtonCallback() {
@Override
public void onNegative(MaterialDialog dialog) {
mFileListListener.onClickFileList(null);
dialog.dismiss();
}
});
dialogBuilder.keyListener(mKeyListener);
dialog = dialogBuilder.build();
dialog.show();
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// save current position
mSelectedIndex = position;
if ((mDialogFileList == null) || (mFileListListener == null)) {
} else {
File file = mDialogFileList[position];
if (file.isDirectory()) {
// is a directory: display file list-up again.
show(file.getAbsolutePath());
} else {
// file selected. call the event mFileListListener
mFileListListener.onClickFileList(file);
}
}
dialog.dismiss();
}
});
}
} catch (SecurityException se) {
se.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void setOnKeyListener (final Context context) {
mKeyListener = new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
File fileParent = mCurrentPath.getParentFile();
if (fileParent != null) {
show(fileParent.getAbsolutePath());
dialog.dismiss();
} else {
// Already the root directory: finish dialog.
mFileListListener.onClickFileList(null);
dialog.dismiss();
}
return true;
}
return false;
}
};
}
public static void setOnFileListDialogListener(final Context context) {
mFileListListener = new OnFileListDialogListener() {
@Override
public void onClickFileList(File file) {
LibraryModelCreation.createFolderStructure(context, file);
}
};
}
public static void setOnFileListDialogListenerToOpenFiles(final Context context) {
mFileListListener = new OnFileListDialogListener() {
@Override
public void onClickFileList(File file) {
if (file!= null) ViewerMainFragment.openFileDialog(file.getPath());
}
};
}
public static void setOnClickListener(final Context context) {
mClickListener = new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// save current position
mSelectedIndex = which;
if ((mDialogFileList == null) || (mFileListListener == null)) {
} else {
File file = mDialogFileList[which];
if (file.isDirectory()) {
// is a directory: display file list-up again.
show(file.getAbsolutePath());
} else {
// file selected. call the event mFileListListener
mFileListListener.onClickFileList(file);
}
}
}
};
}
public interface OnFileListDialogListener {
public void onClickFileList(File file);
}
} | [
"talex@student.chalmers.se"
] | talex@student.chalmers.se |
cace7ffc8f08413b80d24a3073308966c9876cc1 | 7fb95e75e373b8b76823813707d4265073a2e491 | /app/src/main/java/com/example/tracktools/maplisener/AnalyticsOnTrackLifecycleListener.java | 9cb84ec087b1f7b1a44fb07b3eced1673b2338af | [] | no_license | zhoujianxong/TrackTools | 5452009c370493f08e99bc802bc7249a3dad0131 | 10377d0ba59fc1f9f52d11ffc31a5f844f410083 | refs/heads/master | 2022-09-15T21:07:20.777780 | 2020-05-30T03:56:57 | 2020-05-30T03:56:57 | 266,263,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 580 | java | package com.example.tracktools.maplisener;
import com.amap.api.track.OnTrackLifecycleListener;
public interface AnalyticsOnTrackLifecycleListener extends OnTrackLifecycleListener {
@Override
default void onBindServiceCallback(int i, String s) {
}
@Override
default void onStartGatherCallback(int i, String s) {
}
@Override
default void onStartTrackCallback(int i, String s) {
}
@Override
default void onStopGatherCallback(int i, String s) {
}
@Override
default void onStopTrackCallback(int i, String s) {
}
}
| [
"zjxwon@163.com"
] | zjxwon@163.com |
ecd282081cc5aff24902518ec4bef4d6acd959b1 | 954bd8c43237b879fdd659a0f4c207a6ec0da7ea | /java.labs/jdnc-trunk/src/kleopatra/java/org/jdesktop/beansbindingx/example/BBOConnor.java | 85d01c2a9e7a9d72afef82c445276ca4da336f8a | [] | no_license | bothmagic/marxenter-labs | 5e85921ae5b964b9cd58c98602a0faf85be4264e | cf1040e4de8cf4fd13b95470d6846196e1c73ff4 | refs/heads/master | 2021-01-10T14:15:31.594790 | 2013-12-20T11:22:53 | 2013-12-20T11:22:53 | 46,557,821 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,880 | java | /*
* Created on 26.03.2008
*
*/
package org.jdesktop.beansbindingx.example;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JSlider;
import org.jdesktop.beans.AbstractBean;
import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy;
import org.jdesktop.beansbinding.BeanProperty;
import org.jdesktop.beansbinding.Binding;
import org.jdesktop.beansbinding.Bindings;
import org.jdesktop.swingx.incubatorutil.InteractiveTestCase;
public class BBOConnor extends InteractiveTestCase {
public static void main(String[] args) {
BBOConnor test = new BBOConnor();
try {
test.runInteractiveTests();
} catch (Exception e) {
e.printStackTrace();
}
}
public void interactivePOJOBinding() {
final Person person = new Person("baby", 0);
Action action = new AbstractAction("Add year") {
public void actionPerformed(ActionEvent e) {
person.setAge(person.getAge() + 1);
}
};
JSlider age = new JSlider(0, 10, 0);
Binding binding = Bindings.createAutoBinding(UpdateStrategy.READ,
person, BeanProperty.create("age"),
age, BeanProperty.create("value"));
binding.bind();
JButton button = new JButton(action);
JPanel panel = new JPanel();
panel.add(button);
panel.add(age);
JCheckBox box = new JCheckBox("something");
box.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
// TODO Auto-generated method stub
System.out.println(evt.getPropertyName());
}
});
panel.add(box);
showInFrame(panel, "pojo binding");
}
public static class Person extends AbstractBean {
private String name;
private int age;
public Person() {
}
public Person(String name, int age ) {
this.name = name;
this.age = age;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setAge(int age) {
int old = getAge();
this.age = age;
firePropertyChange("age", old, getAge());
}
public int getAge() {
return age;
}
}
}
| [
"markus.taubert@c8aec436-628a-29fb-4c76-4f2700b0ca23"
] | markus.taubert@c8aec436-628a-29fb-4c76-4f2700b0ca23 |
2b11ccd17819f36518dbc33d46d7c0d35ff9d8a8 | 322b225e38e443c98a9901cb93bf7fff814df76e | /drools-wb-screens/drools-wb-factmodel-editor/drools-wb-factmodel-editor-client/src/main/java/org/drools/workbench/screens/factmodel/client/editor/FactModelsEditorPresenter.java | 2f1ca3e0d0371f43d38663438dcc627f4210c885 | [] | no_license | mariofusco/drools-wb | ab0abdb1febb8619670d36ce05cce5b4dea7c59c | 83baa1e75b9a007992b7387899da1a5961decaaa | refs/heads/master | 2022-05-26T16:39:41.425247 | 2013-06-26T11:57:58 | 2013-06-26T11:57:58 | 10,973,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,170 | java | /*
* Copyright 2012 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.drools.workbench.screens.factmodel.client.editor;
import java.util.List;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.New;
import javax.inject.Inject;
import com.google.gwt.user.client.ui.IsWidget;
import org.drools.workbench.screens.factmodel.client.type.FactModelResourceType;
import org.drools.workbench.screens.factmodel.model.FactMetaModel;
import org.drools.workbench.screens.factmodel.model.FactModelContent;
import org.drools.workbench.screens.factmodel.model.FactModels;
import org.drools.workbench.screens.factmodel.service.FactModelService;
import org.jboss.errai.bus.client.api.RemoteCallback;
import org.jboss.errai.ioc.client.api.Caller;
import org.kie.workbench.common.widgets.client.callbacks.HasBusyIndicatorDefaultErrorCallback;
import org.kie.workbench.common.widgets.client.menu.FileMenuBuilder;
import org.kie.workbench.common.widgets.client.popups.file.CommandWithCommitMessage;
import org.kie.workbench.common.widgets.client.popups.file.SaveOperationService;
import org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants;
import org.kie.workbench.common.services.datamodel.oracle.PackageDataModelOracle;
import org.kie.workbench.common.services.shared.metadata.MetadataService;
import org.kie.workbench.common.services.shared.version.events.RestoreEvent;
import org.kie.workbench.common.widgets.configresource.client.widget.bound.ImportsWidgetPresenter;
import org.kie.workbench.common.widgets.metadata.client.callbacks.MetadataSuccessCallback;
import org.kie.workbench.common.widgets.metadata.client.widget.MetadataWidget;
import org.kie.workbench.common.widgets.viewsource.client.callbacks.ViewSourceSuccessCallback;
import org.kie.workbench.common.widgets.viewsource.client.screen.ViewSourceView;
import org.uberfire.backend.vfs.Path;
import org.uberfire.client.annotations.IsDirty;
import org.uberfire.client.annotations.OnClose;
import org.uberfire.client.annotations.OnMayClose;
import org.uberfire.client.annotations.OnSave;
import org.uberfire.client.annotations.OnStart;
import org.uberfire.client.annotations.WorkbenchEditor;
import org.uberfire.client.annotations.WorkbenchMenu;
import org.uberfire.client.annotations.WorkbenchPartTitle;
import org.uberfire.client.annotations.WorkbenchPartView;
import org.uberfire.client.common.MultiPageEditor;
import org.uberfire.client.common.Page;
import org.uberfire.mvp.Command;
import org.uberfire.client.mvp.PlaceManager;
import org.uberfire.workbench.events.NotificationEvent;
import org.uberfire.workbench.model.menu.Menus;
import org.uberfire.mvp.PlaceRequest;
@Dependent
@WorkbenchEditor(identifier = "FactModelsEditor", supportedTypes = { FactModelResourceType.class }, priority = 100)
public class FactModelsEditorPresenter {
@Inject
private ImportsWidgetPresenter importsWidget;
@Inject
private Caller<FactModelService> factModelService;
@Inject
private Caller<MetadataService> metadataService;
@Inject
private FactModelsEditorView view;
@Inject
private ViewSourceView viewSource;
@Inject
private MetadataWidget metadataWidget;
@Inject
private MultiPageEditor multiPage;
@Inject
private Event<NotificationEvent> notification;
@Inject
private PlaceManager placeManager;
@Inject
@New
private FileMenuBuilder menuBuilder;
private Menus menus;
private Path path;
private PlaceRequest place;
private boolean isReadOnly;
private FactModels model;
private PackageDataModelOracle oracle;
private List<FactMetaModel> superTypes;
@OnStart
public void onStart( final Path path,
final PlaceRequest place ) {
this.path = path;
this.place = place;
this.isReadOnly = place.getParameter( "readOnly", null ) == null ? false : true;
makeMenuBar();
view.showBusyIndicator( CommonConstants.INSTANCE.Loading() );
multiPage.addWidget( view,
CommonConstants.INSTANCE.EditTabTitle() );
multiPage.addPage( new Page( viewSource,
CommonConstants.INSTANCE.SourceTabTitle() ) {
@Override
public void onFocus() {
viewSource.showBusyIndicator( CommonConstants.INSTANCE.Loading() );
factModelService.call( new ViewSourceSuccessCallback( viewSource ),
new HasBusyIndicatorDefaultErrorCallback( viewSource ) ).toSource( path,
view.getContent() );
}
@Override
public void onLostFocus() {
viewSource.clear();
}
} );
multiPage.addWidget( importsWidget,
CommonConstants.INSTANCE.ConfigTabTitle() );
multiPage.addPage( new Page( metadataWidget,
CommonConstants.INSTANCE.MetadataTabTitle() ) {
@Override
public void onFocus() {
metadataWidget.showBusyIndicator( CommonConstants.INSTANCE.Loading() );
metadataService.call( new MetadataSuccessCallback( metadataWidget,
isReadOnly ),
new HasBusyIndicatorDefaultErrorCallback( metadataWidget ) ).getMetadata( path );
}
@Override
public void onLostFocus() {
//Nothing to do
}
} );
loadContent();
}
private void makeMenuBar() {
if ( isReadOnly ) {
menus = menuBuilder.addRestoreVersion( path ).build();
} else {
menus = menuBuilder
.addSave( new Command() {
@Override
public void execute() {
onSave();
}
} )
.addCopy( path )
.addRename( path )
.addDelete( path )
.build();
}
}
private void loadContent() {
factModelService.call( getModelSuccessCallback(),
new HasBusyIndicatorDefaultErrorCallback( view ) ).loadContent( path );
}
private RemoteCallback<FactModelContent> getModelSuccessCallback() {
return new RemoteCallback<FactModelContent>() {
@Override
public void callback( final FactModelContent content ) {
model = content.getFactModels();
oracle = content.getDataModel();
oracle.filter( model.getImports() );
superTypes = content.getSuperTypes();
final ModelNameHelper modelNameHelper = new ModelNameHelper();
for ( final FactMetaModel currentModel : superTypes ) {
modelNameHelper.getTypeDescriptions().put( currentModel.getName(),
currentModel.getName() );
}
view.setContent( model,
superTypes,
modelNameHelper );
importsWidget.setContent( oracle,
model.getImports(),
isReadOnly );
view.hideBusyIndicator();
}
};
}
@OnSave
public void onSave() {
if ( isReadOnly ) {
view.alertReadOnly();
return;
}
new SaveOperationService().save( path,
new CommandWithCommitMessage() {
@Override
public void execute( final String comment ) {
view.showBusyIndicator( CommonConstants.INSTANCE.Saving() );
factModelService.call( getSaveSuccessCallback(),
new HasBusyIndicatorDefaultErrorCallback( view ) ).save( path,
view.getContent(),
metadataWidget.getContent(),
comment );
}
} );
}
private RemoteCallback<Path> getSaveSuccessCallback() {
return new RemoteCallback<Path>() {
@Override
public void callback( final Path path ) {
view.setNotDirty();
view.hideBusyIndicator();
metadataWidget.resetDirty();
notification.fire( new NotificationEvent( CommonConstants.INSTANCE.ItemSavedSuccessfully() ) );
}
};
}
@WorkbenchPartView
public IsWidget getWidget() {
return multiPage;
}
@OnClose
public void onClose() {
this.path = null;
}
@IsDirty
public boolean isDirty() {
if ( isReadOnly ) {
return false;
}
return ( view.isDirty() || importsWidget.isDirty() || metadataWidget.isDirty() );
}
@OnMayClose
public boolean checkIfDirty() {
if ( isDirty() ) {
return view.confirmClose();
}
return true;
}
@WorkbenchPartTitle
public String getTitle() {
if ( isReadOnly ) {
return "Read Only Fact Models Viewer [" + path.getFileName() + "]";
}
return "Fact Models Editor [" + path.getFileName() + "]";
}
@WorkbenchMenu
public Menus getMenus() {
return menus;
}
public void onRestore( @Observes RestoreEvent restore ) {
if ( path == null || restore == null || restore.getPath() == null ) {
return;
}
if ( path.equals( restore.getPath() ) ) {
loadContent();
notification.fire( new NotificationEvent( CommonConstants.INSTANCE.ItemRestored() ) );
}
}
}
| [
"michael.anstis@gmail.com"
] | michael.anstis@gmail.com |
203d532c4a612393a2d640c0929f4f7004bfeb60 | 75aaada9a42888eacf6ee2becb8690d88c7f385f | /src/main/java/com/liderbs/dataaccess/dao/AccountDAO.java | 612658d71c6c6acf8bd55fc7f47d9c07c5a26437 | [] | no_license | javico40/bilbao | f01b9ed3b01c6c15ee94d539f2f3e87350d14295 | 4f681b4bddab0b5e982311dd2b5d1729abd26673 | refs/heads/master | 2021-01-18T20:54:57.661214 | 2018-06-11T08:39:56 | 2018-06-11T08:39:56 | 87,000,548 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,663 | java | package com.liderbs.dataaccess.dao;
import com.liderbs.dataaccess.api.HibernateDaoImpl;
import com.liderbs.modelo.Account;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
/**
* A data access object (DAO) providing persistence and search support for
* Account entities. Transaction control of the save(), update() and
* delete() operations can directly support Spring container-managed
* transactions or they can be augmented to handle user-managed Spring
* transactions. Each of these methods provides additional information for how
* to configure it for the desired type of transaction control.
*
* @see lidis.Account
*/
@Scope("singleton")
@Repository("AccountDAO")
public class AccountDAO extends HibernateDaoImpl<Account, Integer>
implements IAccountDAO {
private static final Logger log = LoggerFactory.getLogger(AccountDAO.class);
@Resource
private SessionFactory sessionFactory;
public static IAccountDAO getFromApplicationContext(ApplicationContext ctx) {
return (IAccountDAO) ctx.getBean("AccountDAO");
}
}
| [
"fortaleza40@gmail.com"
] | fortaleza40@gmail.com |
8ee4630af3a4d64a975e18dbca469caa49001e50 | e5eb6b28c89ae4cd14e2ed5baae8f9aba7e03ad5 | /src/modelsDB/UserDB.java | 1927852147caf636eaa5e5e8382e2d69abb89fdb | [] | no_license | juliovcruz/almoxarifado | 65d27bb44505b5004786310605fe06797c7f0558 | 9b8463d74d298a950029d53554045e4b423646f3 | refs/heads/master | 2022-04-05T17:25:41.647945 | 2020-02-22T20:30:26 | 2020-02-22T20:30:26 | 236,173,212 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,132 | java | package modelsDB;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import connection.ConnectionFactory;
import models.Item;
import models.User;
public class UserDB {
public void create(User f) {
java.sql.Connection con = ConnectionFactory.getConnection();
java.sql.PreparedStatement stmt = null;
try {
stmt = con.prepareStatement("INSERT INTO users (reg,name)VALUES(?,?)");
stmt.setString(1, f.getReg());
stmt.setString(2, f.getName());
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Salvo com sucesso!");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro: "+e);
}finally {
ConnectionFactory.closeConnection(con,stmt);
}
}
public void update(User f) {
java.sql.Connection con = ConnectionFactory.getConnection();
java.sql.PreparedStatement stmt = null;
try {
stmt = con.prepareStatement("UPDATE users SET reg = ?,name = ? WHERE id = ?");
stmt.setString(1, f.getReg());
stmt.setString(2, f.getName());
stmt.setInt(3,f.getId());
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Editado com sucesso!");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro: "+e);
}finally {
ConnectionFactory.closeConnection(con,stmt);
}
}
public ArrayList<User> read(){
java.sql.Connection con = ConnectionFactory.getConnection();
java.sql.PreparedStatement stmt = null;
ResultSet rs = null;
ArrayList<User> funcs = new ArrayList<User>();
try {
stmt = con.prepareStatement("SELECT * FROM users");
rs = stmt.executeQuery();
while(rs.next()) {
User f= new User();
f.setId(rs.getInt("id"));
f.setReg(rs.getString("reg"));
f.setName(rs.getString("name"));
funcs.add(f);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro: "+e);
}finally{
ConnectionFactory.closeConnection(con, stmt, rs);
}
return funcs;
}
public ArrayList<User> readFilter(String filter){
java.sql.Connection con = ConnectionFactory.getConnection();
java.sql.PreparedStatement stmt = null;
ResultSet rs = null;
ArrayList<User> funcs = new ArrayList<User>();
try {
stmt = con.prepareStatement("SELECT * FROM users WHERE name LIKE ? OR reg LIKE ?");
stmt.setString(1, "%"+filter+"%");
stmt.setString(2, "%"+filter+"%");
rs = stmt.executeQuery();
while(rs.next()) {
User f= new User();
f.setId(rs.getInt("id"));
f.setReg(rs.getString("reg"));
f.setName(rs.getString("name"));
funcs.add(f);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro: "+e);
}finally{
ConnectionFactory.closeConnection(con, stmt, rs);
}
return funcs;
}
public int lastID(){
java.sql.Connection con = ConnectionFactory.getConnection();
java.sql.PreparedStatement stmt = null;
ResultSet rset = null;
int aux=0;
try {
stmt = con.prepareStatement("SELECT * FROM users ORDER BY id DESC LIMIT 1");
rset = stmt.executeQuery();
while(rset.next()){
aux = rset.getInt("id");
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,"Erro: "+ex);
}finally{
ConnectionFactory.closeConnection(con, stmt);
}
return aux;
}
public void remove(User u){
Connection con = ConnectionFactory.getConnection();
PreparedStatement stmt = null;
try {
stmt = con.prepareStatement("DELETE FROM users WHERE id = ?");
stmt.setInt(1, u.getId());
stmt.executeUpdate();
JOptionPane.showMessageDialog(null,"removido com sucesso");
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,"Erro ao remover "+ex);
}finally{
ConnectionFactory.closeConnection(con, stmt);
}
}
}
| [
"juliovcruz0@gmail.com"
] | juliovcruz0@gmail.com |
1dca2fa62551ec21aa341b93b25cfb8f8d8e4ea7 | 548bd416d0e496e9079ee98930ea56004f23304a | /src/main/java/com/huzhongyu/service/LoginService.java | eb3abfba57423dfb9df2f4c6aa4140f62f05e33b | [] | no_license | huzoyu/h2ssm | d3c50ab97d8c424f7f76106fa3367522cd3630ba | 4f7a6f8bbbb2bccc0a235ee01b0c1d46332d1920 | refs/heads/master | 2020-03-19T18:40:43.142315 | 2018-08-24T04:25:37 | 2018-08-24T04:25:37 | 136,819,640 | 10 | 1 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package com.huzhongyu.service;
import com.huzhongyu.entity.User;
public interface LoginService {
//检验用户登录
public User loginCheck(String name, String password);
//校验是否存在用户
public int ifExist(String name);
}
| [
"noahahahah@foxmail.com"
] | noahahahah@foxmail.com |
d44e048a8160369ecd90e4b64f93bb3e86d217ef | 0d02938b5f633e982a08823d5fac61ea1990156a | /app/src/main/java/com/zero/zero/data/LoginRepository.java | e32077a63485ae3d258f62b4a8f1f9df681cba5a | [] | no_license | atharvakale343/Zero | 8f971b10475e887b5f6dfef3e5e4fc0e5f5eaba6 | 1ab61d38a99a0cd2ece2dc7270b4ae8d5c26beed | refs/heads/master | 2022-09-22T09:37:43.197435 | 2020-06-05T17:30:22 | 2020-06-05T17:30:22 | 269,664,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,697 | java | package com.zero.zero.data;
import com.zero.zero.data.model.LoggedInUser;
/**
* Class that requests authentication and user information from the remote data source and
* maintains an in-memory cache of login status and user credentials information.
*/
public class LoginRepository {
private static volatile LoginRepository instance;
private LoginDataSource dataSource;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
private LoggedInUser user = null;
// private constructor : singleton access
private LoginRepository(LoginDataSource dataSource) {
this.dataSource = dataSource;
}
public static LoginRepository getInstance(LoginDataSource dataSource) {
if (instance == null) {
instance = new LoginRepository(dataSource);
}
return instance;
}
public boolean isLoggedIn() {
return user != null;
}
public void logout() {
user = null;
dataSource.logout();
}
private void setLoggedInUser(LoggedInUser user) {
this.user = user;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
}
public Result<LoggedInUser> login(String username, String password) {
// handle login
Result<LoggedInUser> result = dataSource.login(username, password);
if (result instanceof Result.Success) {
setLoggedInUser(((Result.Success<LoggedInUser>) result).getData());
}
return result;
}
}
| [
"atharvakale343@gmail.com"
] | atharvakale343@gmail.com |
a558bb6c4267573f5120e92c444d79bd4cd74ebc | 1ae55a5ba5538dd7d1a0f2d0334365157eb98ae9 | /F8.3CWorkingWithStreams/src/com/android/School.java | bc5fcd345bf1ba2049f32868cf32076aec7e6606 | [] | no_license | noelflattery/Java2Share | 8f88af90e3203fc2db629f40c299e83870efc3cc | 9bd6de800785a0acc3102aa7ec1255c6697229a8 | refs/heads/master | 2023-05-01T00:28:17.526809 | 2021-05-24T11:54:44 | 2021-05-24T11:54:44 | 368,162,098 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,021 | java | package com.android;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class School implements Serializable{
/*
* all classes that are referred to inside the School clas also have to implement the Serializable
* interface.
* So Teacher, Pupil and subjects of each school, those classe have to implment serializable interface
* Any object of a class that does not implement the serializable interface has to be marked as
* Transient
*/
String name;//name of school
LocalTime start;//the time the school starts
//this will not be serialized as it's a static
static int counter;
//this unique id for each school will be serialized, which is calculated from the static int counter
int schoolId;
/*
* this will be used to uniquely identify the serialized file, as each file will
* have a different DateTime
* this value is NOT serialized, as it's a static
*/
private static final LocalDateTime rightNow=LocalDateTime.now();//NOT serialized
/*
* this values IS serialized, and this value will be got from the above static
*/
LocalDateTime timeId;//serialized
/*
* each school will have a number of teachers, can't have same teacher in this set twice
*/
Set<Teacher>teacherSet=new HashSet<>();//serialized
/*
* each school will have a number of pupils
* no duplicates so it's also a set
*/
Set<Pupil>pupilSet=new HashSet<>();//will be serialized
int teacherCount;//serialized
int pupilCount;//serialized
/*
* this will NOT be serialized as it does NOT implement Serializeable, so we have to mark this as
* TRANSIENT, if we did NOT mark this as transient we would get NotSerializableException
*/
transient Janitor myJanitor=new Janitor();
/*
* you can mark any instance variable as transient, even a object that does implement serializable
* i.e here we have the Headmaster, which is a teacher, which does implement serializable but we have
* choosen to mark it as transisent and will be ignored by serialization process
*/
transient Teacher headMaster;
School(){
name="St Joan's";
//increments by one to keep a count of how many schools created which will be used to give
//the school a unique id
counter++;
//three new teachers added to each school
teacherSet.addAll(Arrays.asList(new Teacher(),new Teacher(),new Teacher()));
//four new pupils for each school
pupilSet.addAll(Arrays.asList(new Pupil(),new Pupil(),new Pupil(),new Pupil()));
//counter will NOT be serialized, but schoolId WILL BE serialized
schoolId=counter;
start=LocalTime.of(9, 0);//starts at 9 o'clock every morning
//this will be give a unique name to our serialized file
//rightNow is the current time
timeId=rightNow;
}
@Override
public String toString() {
return "School [name=" + name + ", start=" + start + ", schoolId=" + schoolId + ", teacherSet=" + teacherSet
+ ", pupilSet=" + pupilSet + "]";
}
}
| [
"noelflattery@gmail.com"
] | noelflattery@gmail.com |
f477cd0939023b32857492738c4267789eed4230 | 2aca54ae80aa38170a5e5e29465c6e1a85da91d9 | /src/interpreter/NumeroRomanoInterpreter.java | eb487d457e1602a287bc09b41093457ad0fb0bdb | [] | no_license | DiegoL1M4/ACADEMIC__Design-Patterns | 37deb49b4e7d7501793093d41558d9897915ca20 | fbb90d205d3f4247d270a5f1d93aaf28449abf32 | refs/heads/master | 2020-12-19T18:07:55.813006 | 2020-01-29T04:42:13 | 2020-01-29T04:42:13 | 235,810,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,402 | java | package interpreter;
public abstract class NumeroRomanoInterpreter {
public void interpretar(Contexto contexto) {
if (contexto.getInput().length() == 0) {
return;
}
// Os valores nove e quatro são os únicos que possuem duas casas
// Ex: IV, IX
if (contexto.getInput().startsWith(nove())) {
adicionarValorOutput(contexto, 9);
consumirDuasCasasDoInput(contexto);
} else if (contexto.getInput().startsWith(quatro())) {
adicionarValorOutput(contexto, 4);
consumirDuasCasasDoInput(contexto);
} else if (contexto.getInput().startsWith(cinco())) {
adicionarValorOutput(contexto, 5);
consumirUmaCasaInput(contexto);
}
// Os valores de um são os únicos que repetem, ex: III, CCC, MMM
while (contexto.getInput().startsWith(um())) {
adicionarValorOutput(contexto, 1);
consumirUmaCasaInput(contexto);
}
}
private void consumirUmaCasaInput(Contexto contexto) {
contexto.setInput(contexto.getInput().substring(1));
}
private void consumirDuasCasasDoInput(Contexto contexto) {
contexto.setInput(contexto.getInput().substring(2));
}
private void adicionarValorOutput(Contexto contexto, int numero) {
contexto.setOutput(contexto.getOutput() + (numero * multiplicador()));
}
public abstract String um();
public abstract String quatro();
public abstract String cinco();
public abstract String nove();
public abstract int multiplicador();
}
| [
"danilo.alexandrinodm@gmail.com"
] | danilo.alexandrinodm@gmail.com |
65671e6317aa406b76da349f411ba83f88f026d9 | d4184d83154ad52fc359925f55cf40fecce94041 | /batman_test/src/batman_test/shahz/jchat/ServerThread.java | ab8c7db50e142996cd622a0bc97cc79f056ea437 | [] | no_license | shadab005/DataStructureAndAlgo | 8322551d9f04a782852ba2520bc77dc13abe592c | 9883105fbf3c785a2f2fc39f6175255a152dcd69 | refs/heads/master | 2022-05-06T04:44:28.051321 | 2022-03-12T11:57:01 | 2022-03-12T11:57:01 | 92,103,132 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,294 | java | package batman_test.shahz.jchat;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
class ServerThread extends Thread //this class handles each client message sending and receiving on separate thread
{
public SocketServer server = null;
public Socket socket = null;
public int ID = -1;//ID is the port number
public String username = "";
public ObjectInputStream streamIn = null;
public ObjectOutputStream streamOut = null;
public ServerGui ui;
public boolean keepRunning;
public ServerThread(SocketServer server, Socket socket)
{
super();
this.server = server;
this.socket = socket;
ID = socket.getPort();
ui = server.ui;
}
public void open() throws IOException
{
streamOut = new ObjectOutputStream(socket.getOutputStream());//stream to send message to this client
streamOut.flush();
streamIn = new ObjectInputStream(socket.getInputStream()); //stream to receive message from this client
}
public void send(Message msg)//this method is for sending message to this client having Socket socket
{
try
{
streamOut.writeObject(msg);
streamOut.flush();
}
catch (IOException ex)
{
System.out.println("Exception [SocketClient : send(...)]");
}
}
public void run()
{
ui.ta.append("\nServer Thread " + ID + " running.");
keepRunning=true;
while (keepRunning)
{
try{
Message msg = (Message) streamIn.readObject();
server.handle(ID, msg);
}
catch(Exception ioe)
{
System.out.println(ID + " ERROR reading zzz: " + ioe.getMessage());
server.remove(ID);
keepRunning=false;
}
}
}
public int getID()
{
return ID;
}
public void close() throws IOException
{
if (socket != null) socket.close();
if (streamIn != null) streamIn.close();
if (streamOut != null) streamOut.close();
}
}
| [
"shadab.checkmate@gmail.com"
] | shadab.checkmate@gmail.com |
bafbc77b205503116b82853a584c857ca8d9aa9e | 6ff512ee7131d80216809b8f25d76e4b92219cf6 | /src/com/qws/core/dao/BaseDictDao.java | c22c7d1434dd44c87c52e14cba297f361f76c5b1 | [] | no_license | qinwenshuai/CRM_SpringMVC_Spring_MyBatis | deeaec6c21317c3787b25b1393dfe1d5a90d0590 | 3c261197fc08b5e044d17b7551353568cab18a0d | refs/heads/master | 2020-07-31T08:22:14.763968 | 2019-09-24T09:24:20 | 2019-09-24T09:24:20 | 210,543,385 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 311 | java | package com.qws.core.dao;
import java.util.List;
import com.qws.core.bean.BaseDict;
public interface BaseDictDao {
//根据数据字典类别代码查询
List<BaseDict> selectByTypecode(String typecode);
//根据数据字典ID查询
BaseDict selectByPrimaryKey(String dictId);
}
| [
"18336136677@163.com"
] | 18336136677@163.com |
9a4d55ad35862acbbac4a9c5bdd509c06bdee680 | e29cc4f45ee5e223bb72fa096d021f9c63a9594b | /src/main/java/uk/ac/soton/ldanalytics/piotre/server/app/App.java | 7430a1b59210bff6ad1a37d093e4e75ecf1dd492 | [] | no_license | eugenesiow/piotre-web | ae63e6e5089521314bf55bd0d26f3b6a83eccdfc | 8b225c6aad0353e1f90fafb776fca6bbee560e14 | refs/heads/master | 2021-01-18T00:26:51.223044 | 2016-10-16T16:47:55 | 2016-10-16T16:47:55 | 65,021,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package uk.ac.soton.ldanalytics.piotre.server.app;
import java.util.UUID;
public class App {
UUID id;
String name;
String author;
String description;
String uri;
public App(UUID id, String name, String author, String description,
String uri) {
super();
this.id = id;
this.name = name;
this.author = author;
this.description = description;
this.uri = uri;
}
public UUID getId() {
return id;
}
public String getName() {
return name;
}
public String getAuthor() {
return author;
}
public String getDescription() {
return description;
}
public String getUri() {
return uri;
}
}
| [
"kyo116@gmail.com"
] | kyo116@gmail.com |
aef9c6433162741a59952a7bc65cad5614b09f01 | fbd049d60331971637da51ee4bf232b1d7831b87 | /src/main/java/com/anoop/atmBatch/bean/AccountHolder.java | 31d5fde0a742c2e4470d350b2d06a52b2ca6aeac | [] | no_license | deshpandeanoop/atmBatch | 793fffa2fdb80a3b8c4bc2d67d7df1e07e5cb075 | 1d1ed81ce7a2a8ab6be1822ef0cff8a5d4351423 | refs/heads/master | 2021-01-23T12:52:36.288331 | 2017-09-06T20:09:18 | 2017-09-06T20:09:18 | 102,653,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,020 | java | package com.anoop.atmBatch.bean;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import com.anoop.atmBatch.util.Constants;
import com.anoop.atmBatch.util.ThreadUtil;
/**
* Holds Account holder information
* @author 532740
*
*/
public class AccountHolder implements ApplicationContextAware
{
private String firstName;
private String lastName;
private String accountNumber;
private String debitCardNumber;
private List<AccountHolder> accountHolderList;
private ApplicationContext applicationContext;
public AccountHolder()
{
}
public AccountHolder(String firstName, String lastName, String accountNumber, String debitCardNumber) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.accountNumber = accountNumber;
this.debitCardNumber = debitCardNumber;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getDebitCardNumber() {
return debitCardNumber;
}
public void setDebitCardNumber(String debitCardNumber) {
this.debitCardNumber = debitCardNumber;
}
public ApplicationContext getApplicationContext() {
return applicationContext;
}
public List<AccountHolder> getAccountHolderList()
{
return this.accountHolderList;
}
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
generateAccountHoldersList();
}
@SuppressWarnings("unchecked")
private void generateAccountHoldersList()
{
try
{
if(applicationContext!=null)
{
ThreadUtil<List<String>> threadUtilBean = applicationContext.getBean(Constants.PERMUTATE_THREAD_BEAN, ThreadUtil.class);
List<Future<List<String>>> futureList = threadUtilBean.getFutureList();
List<String> firstNameList = null;
List<String> lastNameList = null;
List<String> accountNumberList = null;
List<String> debitCardNumberList = null;
firstNameList = futureList.get(0).get();
lastNameList = futureList.get(1).get();
accountNumberList = futureList.get(2).get();
debitCardNumberList = futureList.get(3).get();
int length = firstNameList.size();
AccountHolder accountHolder = null;
this.accountHolderList = new ArrayList<AccountHolder>();
for(int index=0;index<length;index++)
{
accountHolder = new AccountHolder(firstNameList.get(index), lastNameList.get(index), accountNumberList.get(index), debitCardNumberList.get(index));
accountHolderList.add(accountHolder);
}
}
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
}
| [
"anoop.bhardwaja@gmail.com"
] | anoop.bhardwaja@gmail.com |
4b1df4b0f3eb10d4d95a542f6e4a3a82026d7ee6 | 53f895ac58cb7c9e1e8976c235df9c4544e79d33 | /22_Inner Class (115 - 172 in Section 12)/com/source/innerclass1/D.java | 77464d946b153a8f8478d9f0e5907614b0951e8b | [] | no_license | alagurajan/CoreJava | c336356b45cdbcdc88311efbba8f57503e050b66 | be5a8c2a60aac072f777d8b0320e4c94a1266cb3 | refs/heads/master | 2021-01-11T01:33:11.447570 | 2016-12-16T22:24:58 | 2016-12-16T22:24:58 | 70,690,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.source.innerclass1;
class D
{
class E
{
int i;
void test1()
{
}
/***** If we want to make some attribute of innerclass
as static, then we should make the innerclass as static *******/
//static int i;
/*
static void test2()
{
}
*/
}
}
| [
"aalagurajan@gmail.com"
] | aalagurajan@gmail.com |
20df891a516206685f3da2736718192f05e42dc0 | 2319bcf94a9591cd37acc95d5631fcffd2570a8e | /jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/mochc/MOCHC2.java | 52345a9a2461348a5efeed6301a9fbf7dc1cb520 | [] | no_license | Navieclipse/jMetal | 1d02fff4b44845f6f58564e13c107a87c012028f | c9851ff633fa53de9357c606e35e8034d64b475b | refs/heads/master | 2021-01-16T22:57:56.079585 | 2016-02-04T15:44:11 | 2016-02-04T15:44:11 | 51,194,695 | 1 | 1 | null | 2016-02-06T08:03:56 | 2016-02-06T08:03:55 | null | UTF-8 | Java | false | false | 8,232 | java | // MOCHC.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package org.uma.jmetal.algorithm.multiobjective.mochc;
import org.uma.jmetal.algorithm.Algorithm;
import org.uma.jmetal.algorithm.impl.AbstractGeneticAlgorithm;
import org.uma.jmetal.operator.CrossoverOperator;
import org.uma.jmetal.operator.MutationOperator;
import org.uma.jmetal.operator.SelectionOperator;
import org.uma.jmetal.problem.BinaryProblem;
import org.uma.jmetal.solution.BinarySolution;
import org.uma.jmetal.util.JMetalException;
import org.uma.jmetal.util.SolutionListUtils;
import org.uma.jmetal.util.archive.impl.NonDominatedSolutionListArchive;
import org.uma.jmetal.util.binarySet.BinarySet;
import org.uma.jmetal.util.comparator.CrowdingDistanceComparator;
import org.uma.jmetal.util.evaluator.SolutionListEvaluator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* This class executes the MOCHC algorithm described in:
* A.J. Nebro, E. Alba, G. Molina, F. Chicano, F. Luna, J.J. Durillo
* "Optimal antenna placement using a new multi-objective chc algorithm".
* GECCO '07: Proceedings of the 9th annual conference on Genetic and
* evolutionary computation. London, England. July 2007.
*
* Implementation of MOCHC following the scheme used in jMetal4.5 and former versions, i.e, without
* implementing the {@link AbstractGeneticAlgorithm} interface.
*/
public class MOCHC2 implements Algorithm<List<BinarySolution>> {
private BinaryProblem problem;
private List<BinarySolution> population ;
private int populationSize ;
private int maxEvaluations;
private int convergenceValue;
private double preservedPopulation;
private double initialConvergenceCount;
private CrossoverOperator<BinarySolution> crossover;
private MutationOperator<BinarySolution> cataclysmicMutation;
private SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection;
private SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection;
private int evaluations;
private int minimumDistance;
private int size;
private Comparator<BinarySolution> comparator;
private SolutionListEvaluator<BinarySolution> evaluator;
/**
* Constructor
*/
public MOCHC2(BinaryProblem problem, int populationSize, int maxEvaluations, int convergenceValue,
double preservedPopulation, double initialConvergenceCount,
CrossoverOperator<BinarySolution> crossoverOperator,
MutationOperator<BinarySolution> cataclysmicMutation,
SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection,
SelectionOperator<List<BinarySolution>, BinarySolution> parentSelection,
SolutionListEvaluator<BinarySolution> evaluator) {
super();
this.problem = problem;
this.populationSize = populationSize;
this.maxEvaluations = maxEvaluations;
this.convergenceValue = convergenceValue;
this.preservedPopulation = preservedPopulation;
this.initialConvergenceCount = initialConvergenceCount;
this.crossover = crossoverOperator;
this.cataclysmicMutation = cataclysmicMutation;
this.newGenerationSelection = newGenerationSelection;
this.parentSelection = parentSelection;
this.evaluator = evaluator;
}
@Override
public String getName() {
return "MOCHC45";
}
@Override
public String getDescription() {
return "Multiobjective CHC algorithm";
}
@Override
public void run() {
for (int i = 0; i < problem.getNumberOfVariables(); i++) {
size += problem.getNumberOfBits(i);
}
minimumDistance = (int) Math.floor(this.initialConvergenceCount * size);
comparator = new CrowdingDistanceComparator<BinarySolution>();
evaluations = 0 ;
population = new ArrayList<>() ;
for (int i = 0; i < populationSize; i++) {
BinarySolution newIndividual = problem.createSolution();
problem.evaluate(newIndividual);
population.add(newIndividual);
evaluations ++ ;
}
boolean finishCondition = false ;
while (!finishCondition) {
List<BinarySolution> offspringPopulation = new ArrayList<>(populationSize) ;
for (int i = 0; i < population.size()/2; i++) {
List<BinarySolution> parents = new ArrayList<>(2) ;
parents.add(parentSelection.execute(population)) ;
parents.add(parentSelection.execute(population)) ;
if (hammingDistance(parents.get(0), parents.get(1)) >= minimumDistance) {
List<BinarySolution> offspring = crossover.execute(parents);
problem.evaluate(offspring.get(0));
problem.evaluate(offspring.get(1));
offspringPopulation.add(offspring.get(0));
offspringPopulation.add(offspring.get(1));
evaluations += 2 ;
}
}
List<BinarySolution> union = new ArrayList<>();
union.addAll(population);
union.addAll(offspringPopulation);
List<BinarySolution> newPopulation = newGenerationSelection.execute(union);
if (SolutionListUtils.solutionListsAreEquals(population, newPopulation)) {
minimumDistance--;
}
if (minimumDistance <= -convergenceValue) {
minimumDistance = (int) (1.0 / size * (1 - 1.0 / size) * size);
int preserve = (int) Math.floor(preservedPopulation * population.size());
newPopulation = new ArrayList<>(populationSize);
Collections.sort(population, comparator);
for (int i = 0; i < preserve; i++) {
newPopulation.add((BinarySolution) population.get(i).copy());
}
for (int i = preserve; i < populationSize; i++) {
BinarySolution solution = (BinarySolution) population.get(i).copy();
cataclysmicMutation.execute(solution);
problem.evaluate(solution);
//problem.evaluateConstraints(solution);
newPopulation.add(solution);
evaluations ++ ;
}
}
population = newPopulation ;
if (evaluations >= maxEvaluations) {
finishCondition = true ;
}
}
}
@Override
public List<BinarySolution> getResult() {
NonDominatedSolutionListArchive<BinarySolution> archive = new NonDominatedSolutionListArchive<>() ;
for (BinarySolution solution : population) {
archive.add(solution) ;
}
return archive.getSolutionList();
}
/**
* Calculate the hamming distance between two solutions
*
* @param solutionOne A <code>Solution</code>
* @param solutionTwo A <code>Solution</code>
* @return the hamming distance between solutions
*/
private int hammingDistance(BinarySolution solutionOne, BinarySolution solutionTwo) {
int distance = 0;
for (int i = 0; i < problem.getNumberOfVariables(); i++) {
distance += hammingDistance(solutionOne.getVariableValue(i), solutionTwo.getVariableValue(i));
}
return distance;
}
private int hammingDistance(BinarySet bitSet1, BinarySet bitSet2) {
if (bitSet1.getBinarySetLength() != bitSet2.getBinarySetLength()) {
throw new JMetalException("The bitsets have different length: "
+ bitSet1.getBinarySetLength() +", " + bitSet2.getBinarySetLength()) ;
}
int distance = 0;
int i = 0;
while (i < bitSet1.getBinarySetLength()) {
if (bitSet1.get(i) != bitSet2.get(i)) {
distance++;
}
i++;
}
return distance;
}
}
| [
"ajnebro@outlook.com"
] | ajnebro@outlook.com |
a13568ddd183ec8e74e86249e5a75f58ef131aab | 13307b636ffbd5281ff7ab1be700e1f0770e420c | /JDK-1.8.0.110-b13/src/com/sun/corba/se/PortableActivationIDL/InitialNameService.java | 684085288b1c024ec1f8d49206e8d3d894248f9a | [] | no_license | 844485538/source-code | e4f55b6bb70088c6998515345d02de90a8e00c99 | 1ba8a2c3cd6ed6f10dc95ac2932696e03a498159 | refs/heads/master | 2022-12-15T04:30:09.751916 | 2019-11-10T09:44:24 | 2019-11-10T09:44:24 | 218,294,819 | 0 | 0 | null | 2022-12-10T10:46:58 | 2019-10-29T13:33:28 | Java | UTF-8 | Java | false | false | 593 | java | package com.sun.corba.se.PortableActivationIDL;
/**
* com/sun/corba/se/PortableActivationIDL/InitialNameService.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Thursday, December 17, 2009 2:13:38 PM GMT-08:00
*/
/** Interface used to support binding references in the bootstrap name
* service.
*/
public interface InitialNameService extends InitialNameServiceOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
{
} // interface InitialNameService
| [
"844485538@qq.com"
] | 844485538@qq.com |
ad42299479093907dabb93fc1e4f04682665f945 | 6b5f2c9eacab222beb3ee82ebc0a236de7d84e6b | /src/m8mapgenerics/practice/Shape.java | e3892b62c637d02cc3998405c9cc77eb2f8dab9d | [] | no_license | vasiliykulik/JavaCore | dc14c02aab4186b3e690df31fca6e8d15e8de04f | 96eb9f50710c6ee3f96d4b0e8dfd7d8e1947c63c | refs/heads/master | 2020-12-04T11:13:58.998061 | 2018-02-05T11:40:27 | 2018-02-05T11:40:27 | 66,162,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package src.m8mapgenerics.practice;
public abstract class Shape implements Comparable<Shape> {
private Point point;
public Shape(Point point) {
this.point = point;
}
public Point getPoint() {
return point;
}
public abstract double getArea();
public String getClassName() {
return this.getClass().getSimpleName();
}
@Override
public int compareTo(Shape shape) {
/* final double firstArea = getArea();
final double secondArea = shape.getArea();
if (firstArea > secondArea) {
return 1;
}
if (firstArea < secondArea) {
return -1;
}
return 0;*/
//better option
return Double.compare(getArea(), shape.getArea());
}
}
| [
"detroi.vv@gmail.com"
] | detroi.vv@gmail.com |
7d3689a8b371ba0a8e716d7c5d4576803d3669de | 70fc0aa241e564893ba69a33516496bfa2d0698d | /test/edu/metrostate/ics372/project1/MemberListTest.java | 427a5b910e87c73fbd241b57e99d7aa59580cd50 | [] | no_license | elorrainek/ICS-372-Project1 | 25c4b8e6bc3988b85936daff944949906a9b6f24 | eafa34aa5edf2a5d44ef1f26e64e83a6b238e825 | refs/heads/master | 2020-09-02T11:01:18.716090 | 2019-11-02T19:38:30 | 2019-11-02T19:38:30 | 219,207,153 | 0 | 0 | null | 2019-11-02T20:02:28 | 2019-11-02T20:02:27 | null | UTF-8 | Java | false | false | 5,109 | java | package edu.metrostate.ics372.project1;
import static org.junit.jupiter.api.Assertions.*;
import java.util.Date;
import java.util.Random;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
class MemberListTest {
private final static long SEED = 20191015001L;
private final static Random RAND = new Random(SEED);
@Test
@DisplayName("it should return an instance of the MemberList object")
void memberList_instance() {
assertTrue(MemberList.instance() instanceof MemberList);
}
@Test
@DisplayName("it should add a new member to the list and return true")
void memberList_addNewMember() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
assertTrue(members.addNewMember(member));
}
@Test
@DisplayName("it should not add a member if they are already in the list and return false")
void memberList_addNewMember_exists() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
members.addNewMember(member);
assertFalse(members.addNewMember(member));
}
@Test
@DisplayName("it should return the searched member")
void memberList_search() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
members.addNewMember(member);
assertTrue(member.equals(members.search(member.getMemberId())));
}
@Test
@DisplayName("it should return null if the searched member does not exist")
void memberList_search_null() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
members.addNewMember(member);
Member searchedMember = new Member(getSaltString(), getSaltString(), new Date(), RAND.nextBoolean());
assertFalse(member.equals(members.search(searchedMember.getMemberId())));
}
@Test
@DisplayName("it should remove a member from the list and return true")
void memberList_removeMember() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
members.addNewMember(member);
assertTrue(members.removeMember(member.getMemberId()));
assertFalse(member.equals(members.search(member.getMemberId())));
}
@Test
@DisplayName("it should return false if the member to be removed does not exist")
void memberList_removeMember_dne() {
String name = getSaltString();
String address = getSaltString();
Date date = new Date();
boolean feePaid = RAND.nextBoolean();
Member member = new Member(name, address, date, feePaid);
MemberList members = MemberList.instance();
members.addNewMember(member);
Member removeMember = new Member(getSaltString(), getSaltString(), new Date(), RAND.nextBoolean());
assertFalse(members.removeMember(removeMember.getMemberId()));
}
@Test
@DisplayName("it should return formatted string of all members in list")
void memberList_getAllMembers() {
String name1 = getSaltString();
String address1 = getSaltString();
Date date1 = new Date();
boolean feePaid1 = RAND.nextBoolean();
Member member1 = new Member(name1, address1, date1, feePaid1);
String name2 = getSaltString();
String address2 = getSaltString();
Date date2 = new Date();
boolean feePaid2 = RAND.nextBoolean();
Member member2 = new Member(name2, address2, date2, feePaid2);
String name3 = getSaltString();
String address3 = getSaltString();
Date date3 = new Date();
boolean feePaid3 = RAND.nextBoolean();
Member member3 = new Member(name3, address3, date3, feePaid3);
MemberList.clearInstance();
MemberList members = MemberList.instance();
members.addNewMember(member1);
members.addNewMember(member2);
members.addNewMember(member3);
String listOfMembers = members.getAllMembers();
String expected = String.format("%s\n%s\n%s", member1.getMemberName(),
member2.getMemberName(), member3.getMemberName());
assertEquals(expected, listOfMembers);
}
private String getSaltString() {
String SALTCHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
StringBuilder salt = new StringBuilder();
Random rnd = new Random();
while (salt.length() < 18) {
int index = (int) (rnd.nextFloat() * SALTCHARS.length());
salt.append(SALTCHARS.charAt(index));
}
String saltStr = salt.toString();
return saltStr;
}
}
| [
"don.nguyen.000@gmail.com"
] | don.nguyen.000@gmail.com |
76ae44f86bdb7053be51687c6fff4e6960a3d972 | 8fd8c419c585a39631a8959d6d00d0e08d7c96e3 | /src/q04/Q4.java | fc7fa27f6e559945cec2842847b72010e8408cdc | [] | no_license | Basavaraj-chorgasti/collections | 767e9695f49648371b511aedb1f243897840fa7a | 90662b28a75958c81ad06d57764d703d8ab0a1da | refs/heads/master | 2022-12-03T01:50:33.261275 | 2020-08-23T17:39:55 | 2020-08-23T17:39:55 | 289,736,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,038 | java | package q04;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
public class Q4 {
public static void main(String[] args)
{
HashMap<StudCourse, Integer> hm=new HashMap<>();
hm.put(new StudCourse(1,"atish","java"), 75);
hm.put(new StudCourse(2,"rahul","java"), 70);
hm.put(new StudCourse(3,"aksahay","angular"), 60);
hm.put(new StudCourse(4,"basavaraj","angular"), 75);
hm.put(new StudCourse(5,"roshan","java"), 45);
hm.put(new StudCourse(6,"abhinav","angular"), 50);
HashSet<StudCourse> java=new HashSet<>();
HashSet<StudCourse> angular=new HashSet<>();
Set<Entry<StudCourse,Integer>> s=hm.entrySet();
for(Entry<StudCourse,Integer> ob:s)
{
String cname=ob.getKey().getCourse();
int marks=ob.getValue();
if(cname.equals("java")&& marks>=50) {
java.add(ob.getKey());
}
if(cname.equals("angular") && marks>=60) {
angular.add(ob.getKey());
}
}
System.out.println(java);
System.out.println(angular);
}
}
| [
"cvbasu97@gmail.com"
] | cvbasu97@gmail.com |
56bb12508aaf4654466867e60f434dcd30cf2fcd | 91682c22fa06d64b6fff5008e86260297f28ce0b | /mobile-runescape-client/src/main/java/com/jagex/mobilesdk/payments/CategoryListRecyclerViewAdapter$ViewHolder$2.java | 0e4dd7c89ad604234028cdcb6530d04dcb5771d6 | [
"BSD-2-Clause"
] | permissive | morscape/mors-desktop | a32b441b08605bd4cd16604dc3d1bc0b9da62ec9 | 230174cdfd2e409816c7699756f1a98e89c908d9 | refs/heads/master | 2023-02-06T15:35:04.524188 | 2020-12-27T22:00:22 | 2020-12-27T22:00:22 | 324,747,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,334 | java | /*
* Decompiled with CFR 0.150.
*
* Could not load the following classes:
* android.content.Intent
* android.net.Uri
* android.view.View
* android.view.View$OnClickListener
* com.jagex.mobilesdk.payments.CategoryListRecyclerViewAdapter
* net.runelite.mapping.Implements
*/
package com.jagex.mobilesdk.payments;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import com.jagex.mobilesdk.payments.CategoryListRecyclerViewAdapter;
import com.jagex.mobilesdk.payments.CategoryListRecyclerViewAdapter$ViewHolder;
import net.runelite.mapping.Implements;
@Implements(value="CategoryListRecyclerViewAdapter$ViewHolder$2")
class CategoryListRecyclerViewAdapter$ViewHolder$2
implements View.OnClickListener {
final /* synthetic */ CategoryListRecyclerViewAdapter$ViewHolder this$1;
CategoryListRecyclerViewAdapter$ViewHolder$2(CategoryListRecyclerViewAdapter$ViewHolder categoryListRecyclerViewAdapter$ViewHolder) {
this.this$1 = categoryListRecyclerViewAdapter$ViewHolder;
}
public void onClick(View view) {
view = new Intent("android.intent.action.VIEW", Uri.parse((String)"https://www.jagex.com/terms/privacy"));
CategoryListRecyclerViewAdapter.access$300((CategoryListRecyclerViewAdapter)this.this$1.this$0).startActivity((Intent)view);
}
}
| [
"lorenzo.vaccaro@hotmail.com"
] | lorenzo.vaccaro@hotmail.com |
9802dd94d04b59c51cb4174ebcce3b136324c7ea | 1661886bc7ec4e827acdd0ed7e4287758a4ccc54 | /srv_unip_pub/src/main/java/com/sa/unip/app/common/controller/UserRoleDataActionGridViewController.java | 816e285fcf335ba7d7d9402ff6a63c7ec73292d6 | [
"MIT"
] | permissive | zhanght86/iBizSys_unip | baafb4a96920e8321ac6a1b68735bef376b50946 | a22b15ebb069c6a7432e3401bdd500a3ca37250e | refs/heads/master | 2020-04-25T21:20:23.830300 | 2018-01-26T06:08:28 | 2018-01-26T06:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,070 | java | /**
* iBizSys 5.0 机器人生产代码(不要直接修改当前代码)
* http://www.ibizsys.net
*/
package com.sa.unip.app.common.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import net.ibizsys.paas.appmodel.AppModelGlobal;
import net.ibizsys.paas.appmodel.IApplicationModel;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.sysmodel.ISystemModel;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.controller.ViewControllerGlobal;
import net.ibizsys.paas.ctrlmodel.ICtrlModel;
import net.ibizsys.paas.ctrlhandler.ICtrlHandler;
import com.sa.unip.srv.UniPSampleSysModel;
import com.sa.unip.app.appAppModel;
/**
* 视图[UserRoleDataActionGridView]控制类基类
*
* !! 不要对此代码进行修改
*/
@Controller
@RequestMapping(value = "/app/common/UserRoleDataActionGridView.do")
public class UserRoleDataActionGridViewController extends net.ibizsys.paas.controller.GridViewControllerBase {
public UserRoleDataActionGridViewController() throws Exception {
super();
this.setId("c26dee931c921e0c5794487b621088d5");
this.setCaption("用户角色数据操作");
this.setTitle("用户角色数据操作实体表格视图");
this.setAccessUserMode(2);
//支持快速搜索
this.setAttribute("UI.ENABLEQUICKSEARCH","TRUE");
//
this.setAttribute("UI.CTRL.GRID","TRUE");
//
this.setAttribute("UI.CTRL.SEARCHFORM","TRUE");
//
this.setAttribute("UI.CTRL.TOOLBAR","TRUE");
//支持搜常规索
this.setAttribute("UI.ENABLESEARCH","TRUE");
ViewControllerGlobal.registerViewController("/app/common/UserRoleDataActionGridView.do",this);
ViewControllerGlobal.registerViewController("com.sa.unip.app.common.controller.UserRoleDataActionGridViewController",this);
}
@Override
protected void prepareViewParam() throws Exception {
super.prepareViewParam();
}
private UniPSampleSysModel uniPSampleSysModel;
public UniPSampleSysModel getUniPSampleSysModel() {
if(this.uniPSampleSysModel==null) {
try {
this.uniPSampleSysModel = (UniPSampleSysModel)SysModelGlobal.getSystem("com.sa.unip.srv.UniPSampleSysModel");
} catch(Exception ex) {
}
}
return this.uniPSampleSysModel;
}
@Override
public ISystemModel getSystemModel() {
return this.getUniPSampleSysModel();
}
private appAppModel appAppModel;
public appAppModel getappAppModel() {
if(this.appAppModel==null) {
try {
this.appAppModel = (appAppModel)AppModelGlobal.getApplication("com.sa.unip.app.appAppModel");
} catch(Exception ex) {
}
}
return this.appAppModel;
}
@Override
public IApplicationModel getAppModel() {
return this.getappAppModel();
}
private net.ibizsys.psrt.srv.common.demodel.UserRoleDataActionDEModel userRoleDataActionDEModel;
public net.ibizsys.psrt.srv.common.demodel.UserRoleDataActionDEModel getUserRoleDataActionDEModel() {
if(this.userRoleDataActionDEModel==null) {
try {
this.userRoleDataActionDEModel = (net.ibizsys.psrt.srv.common.demodel.UserRoleDataActionDEModel)DEModelGlobal.getDEModel("net.ibizsys.psrt.srv.common.demodel.UserRoleDataActionDEModel");
} catch(Exception ex) {
}
}
return this.userRoleDataActionDEModel;
}
public IDataEntityModel getDEModel() {
return this.getUserRoleDataActionDEModel();
}
public net.ibizsys.psrt.srv.common.service.UserRoleDataActionService getUserRoleDataActionService() {
try {
return (net.ibizsys.psrt.srv.common.service.UserRoleDataActionService)ServiceGlobal.getService("net.ibizsys.psrt.srv.common.service.UserRoleDataActionService",this.getSessionFactory());
} catch(Exception ex) {
return null;
}
}
/* (non-Javadoc)
* @see net.ibizsys.paas.controller.IViewController#getService()
*/
@Override
public IService getService() {
return getUserRoleDataActionService();
}
/**
* 准备部件模型
* @throws Exception
*/
@Override
protected void prepareCtrlModels()throws Exception {
//注册 grid
ICtrlModel grid=(ICtrlModel)getUniPSampleSysModel().createObject("com.sa.unip.app.srv.common.ctrlmodel.UserRoleDataActionMainGridModel");
grid.init(this);
this.registerCtrlModel("grid",grid);
//注册 searchform
ICtrlModel searchForm=(ICtrlModel)getUniPSampleSysModel().createObject("com.sa.unip.app.srv.common.ctrlmodel.UserRoleDataActionDefaultSearchFormModel");
searchForm.init(this);
this.registerCtrlModel("searchform",searchForm);
}
/**
* 准备部件处理对象
* @throws Exception
*/
@Override
protected void prepareCtrlHandlers()throws Exception {
//注册 grid
ICtrlHandler grid = (ICtrlHandler)getUniPSampleSysModel().createObject("com.sa.unip.app.common.ctrlhandler.UserRoleDataActionGridViewGridHandler");
grid.init(this);
this.registerCtrlHandler("grid",grid);
//注册 searchform
ICtrlHandler searchForm = (ICtrlHandler)getUniPSampleSysModel().createObject("com.sa.unip.app.common.ctrlhandler.UserRoleDataActionGridViewSearchFormHandler");
searchForm.init(this);
this.registerCtrlHandler("searchform",searchForm);
}
/**
* 注册界面行为
* @throws Exception
*/
@Override
protected void prepareUIActions()throws Exception {
}
} | [
"dev@ibizsys.net"
] | dev@ibizsys.net |
a19c15a4136d5bb2cca2476c0080c8aed1dc7c8e | 96270347b5e287e3682c8a6d8c62f4fe8940414b | /src/main/java/com/ribeiro/softFocusApi/service/impl/LogRequestServiceImpl.java | 4312207df34f87ee5b6fe54d1ffdfefdee5cda8b | [] | no_license | ralexandre11/SoftFocusApi | 18ba16cc4fe40b0fc6071247a3562103364cf5fc | 6a509ebacb1798972018af019090406f473f602c | refs/heads/main | 2023-02-26T21:25:16.505982 | 2021-02-10T20:27:18 | 2021-02-10T20:27:18 | 336,611,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,833 | java | package com.ribeiro.softFocusApi.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ribeiro.softFocusApi.exception.PersonalException;
import com.ribeiro.softFocusApi.model.entity.LogRequest;
import com.ribeiro.softFocusApi.model.repository.LogRequestRepository;
import com.ribeiro.softFocusApi.resouce.dto.WeatherResponseDTO;
import com.ribeiro.softFocusApi.service.LogRequestService;
@Service
public class LogRequestServiceImpl implements LogRequestService {
private LogRequestRepository repository;
public LogRequestServiceImpl(LogRequestRepository repository) {
this.repository = repository;
}
@Override
public List<LogRequest> all() {
return repository.findAll();
}
@Override
@Transactional
public LogRequest Save(WeatherResponseDTO weatherDTO) {
checkWeatherDTO(weatherDTO);
Double tempCelcius = weatherDTO.getMain().getTemp() - 273.0;
LogRequest logRequest = new LogRequest();
logRequest.setDate(new Date());
logRequest.setCity(weatherDTO.getCity());
logRequest.setLon(weatherDTO.getCoord().getLon());
logRequest.setLat(weatherDTO.getCoord().getLat());
logRequest.setTemp(tempCelcius);
logRequest.setGenre(verifyGenre(tempCelcius));
return repository.save(logRequest);
}
private void checkWeatherDTO(WeatherResponseDTO weatherDTO) {
if (weatherDTO.getCity() == null) {
throw new PersonalException("Cidade não localizada!");
}
}
public String verifyGenre(Double tempCelcius) {
String genre = new String();
if (tempCelcius > 30.0) {
genre = "party";
} else if (tempCelcius > 15.0) {
genre = "pop";
} else if (tempCelcius > 10.0) {
genre = "rock";
} else {
genre = "classical";
}
return genre;
}
}
| [
"ralexandre11.gmail.com"
] | ralexandre11.gmail.com |
6687045fc8e30e81a5435429756646f08d75addb | 10d77fabcbb945fe37e15ae438e360a89a24ea05 | /graalvm/transactions/fork/narayana/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/EnvironmentBeanTest.java | 886ce0272d501323660e03bf9dcc676413e495ce | [
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"LicenseRef-scancode-other-copyleft",
"Apache-2.0"
] | permissive | nmcl/scratch | 1a881605971e22aa300487d2e57660209f8450d3 | 325513ea42f4769789f126adceb091a6002209bd | refs/heads/master | 2023-03-12T19:56:31.764819 | 2023-02-05T17:14:12 | 2023-02-05T17:14:12 | 48,547,106 | 2 | 1 | Apache-2.0 | 2023-03-01T12:44:18 | 2015-12-24T15:02:58 | Java | UTF-8 | Java | false | false | 1,498 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc. and/or its affiliates,
* and individual contributors as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2010,
* @author JBoss, by Red Hat.
*/
package com.hp.mwtests.ts.txoj.basic;
import java.util.HashMap;
import org.junit.Test;
import com.arjuna.ats.txoj.common.TxojEnvironmentBean;
/**
* Unit tests for EnvironmentBean classes.
*
* @author Jonathan Halliday (jonathan.halliday@redhat.com)
*/
public class EnvironmentBeanTest
{
@Test
public void testTxojEnvironmentBean() throws Exception {
HashMap map;
com.arjuna.common.tests.simple.EnvironmentBeanTest.testBeanByReflection(new TxojEnvironmentBean());
}
}
| [
"mlittle@redhat.com"
] | mlittle@redhat.com |
e2913eb0317d8735ef4426ab4a1ae9f0659901cd | 3f660c4fb6b72badc606fe7be13b77cf9a5d3696 | /app/src/main/java/stayabode/foodyHive/fragments/platforms/SettingsFragment.java | edcf16ac90fa8118b79d7df268865d136650ca9f | [] | no_license | alphasourcecorp/stayabode | 99eec39c5e3058b7d5304a9aa6385b8a979a80bc | e2d1c2aeb5112482024312a310cc39950bb47e08 | refs/heads/main | 2023-06-03T06:20:52.861457 | 2021-06-17T12:29:15 | 2021-06-17T12:29:15 | 377,732,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,267 | java | package stayabode.foodyHive.fragments.platforms;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import stayabode.foodyHive.R;
import stayabode.foodyHive.activities.platform.MainActivity;
public class SettingsFragment extends Fragment {
TextView back;
TextView pagetitle;
TextView editProfile;
TextView changeLanguage;
TextView changeCurrency;
Typeface fontBold;
Typeface fontRegular;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_settings,container,false);
fontBold = Typeface.createFromAsset(getContext().getAssets(), "fonts/Nunito-Bold.ttf");
fontRegular = Typeface.createFromAsset(getContext().getAssets(), "fonts/Nunito-Regular.ttf");
// MainActivity.toolbar.setNavigationIcon(R.drawable.ic_keyboard_arrow_left_black);
// MainActivity.toolbar.setNavigationOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// onBackPressed();
// }
// });
MainActivity.toolbar.setNavigationIcon(null);
MainActivity.customIcon.setVisibility(View.VISIBLE);
MainActivity.rightMenu.setVisibility(View.GONE);
MainActivity.toolbar_save.setText("< Back");
MainActivity.toolbar_save.setTypeface(fontBold);
MainActivity.customIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
MainActivity.navigation.setVisibility(View.GONE);
MainActivity.mainBottomLayout.setVisibility(View.GONE);
MainActivity.active = this;
back = rootView.findViewById(R.id.back);
back.setText("<Back");
pagetitle = rootView.findViewById(R.id.pagetitle);
pagetitle.setText("Settings");
back.setTypeface(fontRegular);
pagetitle.setTypeface(fontBold);
editProfile = rootView.findViewById(R.id.editProfile);
changeLanguage = rootView.findViewById(R.id.changeLanguage);
changeCurrency = rootView.findViewById(R.id.changeCurrency);
editProfile.setTypeface(fontRegular);
changeLanguage.setTypeface(fontRegular);
changeCurrency.setTypeface(fontRegular);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
editProfile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditProfileFragment fragment = new EditProfileFragment();
FragmentManager fm = MainActivity.fragmentManager;
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.content, fragment).addToBackStack(null);
// ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.commit();
}
});
changeCurrency.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentChangeCurrency fragment = new FragmentChangeCurrency();
FragmentManager fm = MainActivity.fragmentManager;
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.content, fragment).addToBackStack(null);
// ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.commit();
}
});
changeLanguage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentChangeLanguage fragment = new FragmentChangeLanguage();
FragmentManager fm = MainActivity.fragmentManager;
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.content, fragment).addToBackStack(null);
//ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.commit();
}
});
return rootView;
}
@Override
public void onResume() {
super.onResume();
MainActivity.navigation.setVisibility(View.GONE);
MainActivity.mainBottomLayout.setVisibility(View.GONE);
MainActivity.rightMenu.setVisibility(View.GONE);
// BottomNavigationView navBar = getActivity().findViewById(R.id.navigation);
// navBar.setVisibility(View.GONE);
// navigation.setVisibility(View.GONE);
}
public void onBackPressed()
{
// navigation.setVisibility(View.VISIBLE);
FragmentManager fm = getActivity().getSupportFragmentManager();
fm.popBackStack();
}
}
| [
"sathishkumar.crp@gmail.com"
] | sathishkumar.crp@gmail.com |
e9c122ce366d068998eb8660e7b024cade560bcd | e6a39c01218db4891056e6e6f2b029a87681ed1a | /src/main/java/buzz/gaoyusense/injection/mixins/MixinEntityPlayerSP.java | 2c6db0e98587970d10d0f8156a3c6c27c439e934 | [
"Unlicense",
"MIT"
] | permissive | duoduo2333/EnjoyTheBan-For-Forge | cf2bf6c999fa64818ccaa28718afd3c177d6879a | 02902c1dc883fc8b873b2a7d2984d95b4342b31b | refs/heads/main | 2023-06-17T01:58:29.461862 | 2021-07-10T07:40:14 | 2021-07-10T07:40:14 | 387,105,835 | 0 | 1 | MIT | 2021-07-18T06:20:55 | 2021-07-18T06:20:54 | null | UTF-8 | Java | false | false | 3,398 | java | /*
* Copyright (c) 2018 superblaubeere27
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package buzz.gaoyusense.injection.mixins;
import com.enjoytheban.api.EventBus;
import com.enjoytheban.api.events.misc.EventChat;
import com.enjoytheban.api.events.world.EventMove;
import com.enjoytheban.api.events.world.EventPostUpdate;
import com.enjoytheban.api.events.world.EventPreUpdate;
import net.minecraft.client.entity.EntityPlayerSP;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(EntityPlayerSP.class)
public class MixinEntityPlayerSP extends MixinEntity {
private double cachedX;
private double cachedY;
private double cachedZ;
private float cachedRotationPitch;
private float cachedRotationYaw;
@Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true)
public void sendChatMessage(String message,CallbackInfo callbackInfo) {
EventChat event = new EventChat(message);
EventBus.getInstance().call(event);
if(event.isCancelled()){
callbackInfo.cancel();
}
}
EventPostUpdate post;
@Inject(method = "onUpdateWalkingPlayer", at = @At("HEAD"), cancellable = true)
private void onUpdateWalkingPlayerPre(CallbackInfo ci) {
cachedX = posX;
cachedY = posY;
cachedZ = posZ;
cachedRotationYaw = rotationYaw;
cachedRotationPitch = rotationPitch;
EventPreUpdate event = new EventPreUpdate(this.rotationYaw, this.rotationPitch, this.posY,this.onGround);
post = new EventPostUpdate(this.rotationYaw, this.rotationPitch);
EventBus.getInstance().call(event);
if (event.isCancelled()) {
EventBus.getInstance().call(post);
ci.cancel();
}
posY = event.getY();
onGround = event.isOnground();
rotationYaw = event.getYaw();
rotationPitch = event.getPitch();
}
@Inject(method = "onUpdateWalkingPlayer", at = @At("RETURN"))
private void onUpdateWalkingPlayerPost(CallbackInfo ci) {
posX = cachedX;
posY = cachedY;
posZ = cachedZ;
rotationYaw = cachedRotationYaw;
rotationPitch = cachedRotationPitch;
EventBus.getInstance().call(post);
}
}
| [
"SuperSkidder@outlook.com"
] | SuperSkidder@outlook.com |
6885689073dca7789419efc9697d849bc6052536 | 7f937fdd571eba2fa86853ab29e35a298e0d3922 | /src/main/java/com/ucc/application/Controllers/LikePCController.java | 3d523f305fd611304191116eddb5f505e567304b | [] | no_license | Amjadalrefayi/springboot-uca | bf71f5435165683516253192b32755a5d4bec695 | 971953a05edc1c93027d9062bd986adbaf478b98 | refs/heads/master | 2023-07-18T04:17:19.197546 | 2021-08-29T15:19:40 | 2021-08-29T15:19:40 | 401,074,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,319 | java | package com.ucc.application.Controllers;
import java.util.ArrayList;
import java.util.List;
import com.ucc.application.Entities.LikePCEntity;
import com.ucc.application.Entities.PostComuEntity;
import com.ucc.application.Models.LikePCModel;
import com.ucc.application.Repositories.CommentPCRepo;
import com.ucc.application.Repositories.LikePCRepo;
import com.ucc.application.Repositories.PostComRepo;
import com.ucc.application.Repositories.UserRepo;
import com.ucc.application.Services.FormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(path="/ucc/likesPC")
public class LikePCController {
@Autowired
LikePCRepo likeRepo;
@Autowired
PostComRepo postRepo;
@Autowired
UserRepo userRepo;
@Autowired
CommentPCRepo commentRepo;
@Autowired
FormService service;
@GetMapping(path = "/addlikepost")
public boolean addlikepost(@RequestParam Long user_id , @RequestParam Long post_id){
LikePCEntity likeEntity = new LikePCEntity();
if((postRepo.findById(post_id).isPresent()) && userRepo.findById(user_id).isPresent())
{
for(int i =0 ; i< userRepo.findById(user_id).get().getUser_LikesPC().size(); i++)
{
if(userRepo.findById(user_id).get().getUser_LikesPC().get(i).getPostComuEntity().equals(postRepo.findById(post_id).get()))
{
likeRepo.deleteLike(userRepo.findById(user_id).get().getUser_LikesPC().get(i).getId());
return false;
}
}
likeEntity.setUserEntity(userRepo.findById(user_id).get());
likeEntity.setPostComuEntity(postRepo.findById(post_id).get());
likeRepo.save(likeEntity);
return true;
}
else
return false;
}
@GetMapping(path = "/getlikespost")
public List<LikePCModel> getlikeposts(@RequestParam Long post_id){
PostComuEntity postEntity = new PostComuEntity();
if(postRepo.findById(post_id).isPresent())
{
postEntity = postRepo.findById(post_id).get();
List <LikePCModel> likeModels = new ArrayList<>();
for( LikePCEntity likeEntity : postEntity.getPost_Likes() )
likeModels.add(service.LikePCEntity_To_LikePCModel(likeEntity));
return likeModels;
}
else
return new ArrayList<>();
}
@GetMapping(path = "/getuserlikePost")
public boolean getuserlikePost(@RequestParam Long user_id , @RequestParam Long post_id){
if((postRepo.findById(post_id).isPresent()) && userRepo.findById(user_id).isPresent())
{
for(int i =0 ; i< userRepo.findById(user_id).get().getUser_LikesPC().size(); i++)
if(userRepo.findById(user_id).get().getUser_LikesPC().get(i).getPostComuEntity().equals(postRepo.findById(post_id).get()))
return true;
return false;
}
else
return false;
}
} | [
"iteamjad@gmail.com"
] | iteamjad@gmail.com |
3fe9a931bb3a994666c6dd900296c19a88e69707 | c7e7890fb858086f74606ecdebda4f9ba0b5d472 | /src/spiderweb/visualizer/StatisticEvent.java | 9a6c987171abd0a8b2142968ebde126011e812ca | [] | no_license | NMAI-lab/SpiderWeb | 9b9e44e8eb88c1406a83c9775248f7974fa50cb8 | 63a55ec57bdd76ca24bd2d37937b795172b14f8d | refs/heads/master | 2021-01-15T17:07:25.708428 | 2012-06-04T20:44:47 | 2012-06-04T20:44:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | package spiderweb.visualizer;
public class StatisticEvent {
//TODO: make the GraphStatisticalPane change dynamically
private int event;
private int query;
private int msgId;
public StatisticEvent(int event)
{
this.event = event;
this.query = 0;
this.msgId = 0;
}
public StatisticEvent(int event, int query)
{
this.event = event;
this.query = query;
this.msgId = 0;
}
public StatisticEvent(int event, int query, int msgId)
{
this.event = event;
this.query = query;
this.msgId = msgId;
}
public int getEvent()
{
return event;
}
public int getQuery()
{
return query;
}
public int getMsgId()
{
return msgId;
}
}
| [
"djdionne@connect.carleton.ca"
] | djdionne@connect.carleton.ca |
b59599d0ca893733cf0c51bb4c1e2ff8e562b869 | 80cfec5ba036a6d866567f1c3251873c379a1a99 | /idm/src/main/java/com/gibbor/idm/web/rest/errors/FieldErrorDTO.java | bf4c4cb208d83d17eb097098a70ed14e6b35d160 | [] | no_license | Version-OneIAM/workspace | 801a8464404948d7b8ab132970b70b38ef4e0988 | 4321c8d21512b747fd65d7b3a11932307224830b | refs/heads/master | 2020-12-25T14:38:47.245028 | 2016-08-18T13:33:00 | 2016-08-18T13:33:00 | 65,997,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.gibbor.idm.web.rest.errors;
import java.io.Serializable;
public class FieldErrorDTO implements Serializable {
private static final long serialVersionUID = 1L;
private final String objectName;
private final String field;
private final String message;
FieldErrorDTO(String dto, String field, String message) {
this.objectName = dto;
this.field = field;
this.message = message;
}
public String getObjectName() {
return objectName;
}
public String getField() {
return field;
}
public String getMessage() {
return message;
}
}
| [
"common@gibbortech.com"
] | common@gibbortech.com |
d08d88c72c49c013d03e37666ebf79a865c2f3ac | c623508377399202b9f36905b6185aa96970dd60 | /Telecom/src/main/java/utils/LZWEntropy.java | 9f39621ca398622f92636892e921ef7cedf88c21 | [] | no_license | mmamei/telecom | 1ac0ead19027fd9420a062dca4042e3427f849f6 | 31116debae12bc784e1246313c7c3e075d7835ec | refs/heads/master | 2021-12-07T17:01:57.777527 | 2019-09-13T16:19:49 | 2019-09-13T16:19:49 | 37,588,691 | 0 | 0 | null | 2021-04-26T17:44:41 | 2015-06-17T10:32:40 | Java | UTF-8 | Java | false | false | 2,764 | java |
package utils;
import java.util.HashSet;
import java.util.Set;
public class LZWEntropy {
/** Compress a string to a list of output symbols. */
public static double lzwEntropy(String x) {
// Build the dictionary.
double lambda = 0;
Set<String> dictionary = new HashSet<String>();
int start = 0;
for(; start<x.length();start++) {
int i = start+1;
for(;i<x.length();i++) {
String tmp = x.substring(start, i);
if (!dictionary.contains(tmp)) {
// Add wc to the dictionary.
dictionary.add(tmp);
//System.out.println(start+"-->"+tmp);
lambda += (i-start);
break;
}
}
if(i==x.length()) break;
}
double n = start;
return n*log2(n)/lambda;
}
public static void main(String[] args) {
run( new String[]{"a","b","c","d"},new double[]{0.25,0.25,0.25,0.25},10000);
run( new String[]{"a","b"},new double[]{0.5,0.5},10000);
run( new String[]{"a"},new double[]{0.1},1000);
}
public static void run(String[] alphabet, double[] p, int l) {
double s = lzwEntropy(rrep(alphabet,p,l));
System.out.println("Entropy = "+s);
System.out.println("Predictabiilty = "+predictability(s,alphabet.length));
}
public static String rep(String base, int r) {
String res = "";
for(int i=0; i<r;i++)
res += base;
return res;
}
public static String rrep(String[] s, double[] p, int r) {
double[] cum = new double[p.length];
cum[0] = p[0];
//System.out.print("Cumulative: "+cum[0]);
for(int i=1; i<cum.length-1;i++) {
cum[i] = cum[i-1]+ p[i];
//System.out.print(" "+cum[i]);
}
cum[cum.length-1] = 1.0;
//System.out.print(" "+cum[cum.length-1]);
//System.out.println();
String res = "";
for(int i=0; i<r;i++) {
double x = Math.random();
for(int k=0; k<cum.length; k++)
if(x<=cum[k]) {
res+=s[k];
break;
}
}
return res;
}
// find-by-trials the maximum of fano function defined below
public static double predictability(double s, double m) {
double maxp = 0.001;
for(double p=0.01; p<=1; p+=0.01)
if(Math.abs(fano(p,s,m)) < Math.abs(fano(maxp,s,m)))
maxp = p;
return maxp;
}
public static double fano(double p, double s, double m) {
return -(p*log2(p) + (1-p)*log2(1-p)) + (1-p)*log2(m-1) - s;
}
public static double log2(double x) {
return Math.log(x) / Math.log(2);
}
} | [
"marco.mamei@unimore.it"
] | marco.mamei@unimore.it |
c5f737be8a272235097525e46095986319169cd2 | 859ec4f53126db3f60d0dfdc97ca472a58e7cb88 | /frame-mq/src/main/java/top/vjin/frame/mq/event/MqWithTxEvent.java | 0fdb086706abad0306f1339cdec44ca9bd7e531c | [] | no_license | JWL1ang/spring-frame | 15c602a1f6ab1df8dd806f2cabedb2f78dec340c | e3af132d0916b281ae8b0e872fcafcb11828b7ad | refs/heads/master | 2023-02-27T19:21:57.526165 | 2021-02-07T10:54:51 | 2021-02-07T10:54:51 | 336,755,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | /*
* Copyright (c) 2021 vjin.top All rights reserved.
* created by JW_Liang at 2021/2/7 18:16:15
*/
package top.vjin.frame.mq.event;
import lombok.AllArgsConstructor;
import lombok.Getter;
import top.vjin.frame.core.event.AbstractEvent;
/**
* 伴随事务消息队列事件
*
* @author JW_Liang
* @date 2021-02-07
*/
public class MqWithTxEvent {
/**
* 发送给队列事件
*/
@Getter
@AllArgsConstructor
public static class ToQueue extends AbstractEvent<Object> {
/** 目标源 */
private Object source;
/** 队列 */
private String queue;
}
/**
* 发送给交换机事件
*/
@Getter
@AllArgsConstructor
public static class ToExchange extends AbstractEvent<Object> {
/** 目标源 */
private Object source;
/** 交换机 */
private String exchange;
/** 路由键 */
private String routingKey;
}
}
| [
"ljwive@outlook.com"
] | ljwive@outlook.com |
6f4ab8bc8785c4d31a50ad16d18d2803b8243427 | 9665f5ffb9d7940cdacf074b9a047b2b431ba0ca | /app/src/main/java/me/weyye/todaynews/base/BaseActivity.java | 2e60d44ba92c9d9b8278493dafce7d46b845a9f0 | [] | no_license | guoxuliang/qfnews2 | 583a91985de74e4c4d2d04130b94eeeb831cad8b | 4782c5ad79d2982a6d3a0027ee14f83a01021494 | refs/heads/master | 2020-03-07T02:45:46.880295 | 2018-03-29T00:58:09 | 2018-03-29T00:58:09 | 127,216,651 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,539 | java | package me.weyye.todaynews.base;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.v4.view.LayoutInflaterCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.orhanobut.logger.Logger;
import java.lang.reflect.Field;
import cn.jpush.android.api.JPushInterface;
import me.weyye.todaynews.R;
import me.weyye.todaynews.model.Notice;
import me.weyye.todaynews.theme.colorUi.SkinFactory;
import me.weyye.todaynews.theme.colorUi.util.ColorUiUtil;
import me.weyye.todaynews.theme.colorUi.util.SharedPreferencesMgr;
import me.weyye.todaynews.ui.view.SwipeBackLayout;
import me.weyye.todaynews.utils.ConstanceValue;
import me.weyye.todaynews.utils.MyDialog;
import me.weyye.todaynews.utils.RxBus;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;
import rx.subscriptions.CompositeSubscription;
/**
* Created by Administrator on 2016/3/16.
*/
public abstract class BaseActivity extends AppCompatActivity {
protected Context mContext;
private CompositeSubscription mCompositeSubscription;
protected Subscription mSubscription;
private SwipeBackLayout mSwipeBackLayout;
// private ImageView mIvShadow;
private Dialog loginDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
if (SharedPreferencesMgr.getInt(ConstanceValue.SP_THEME, ConstanceValue.THEME_LIGHT) == ConstanceValue.THEME_LIGHT) {
setTheme(R.style.Theme_Light);
} else {
setTheme(R.style.Theme_Night);
}
mSubscription = toObservable().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Notice>() {
@Override
public void call(Notice message) {
if (message.type == ConstanceValue.MSG_TYPE_CHANGE_THEME)
ColorUiUtil.changeTheme(getWindow().getDecorView(), getTheme());
}
});
setLayoutInflaterFactory();
initView(savedInstanceState);
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(getContainer());
View view = LayoutInflater.from(this).inflate(layoutResID, null);
mSwipeBackLayout.addView(view);
}
private View getContainer() {
RelativeLayout container = new RelativeLayout(this);
mSwipeBackLayout = new SwipeBackLayout(this);
mSwipeBackLayout.setDragEdge(SwipeBackLayout.DragEdge.LEFT);
// mIvShadow = new ImageView(this);
// mIvShadow.setBackgroundColor(getResources().getColor(R.color.black));
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// container.addView(mIvShadow, params);
container.addView(mSwipeBackLayout);
return container;
}
public void setEnableSwipe(boolean enableSwipe) {
mSwipeBackLayout.setEnablePullToBack(enableSwipe);
}
// public void setDragEdge(SwipeBackLayout.DragEdge dragEdge) {
// mSwipeBackLayout.setDragEdge(dragEdge);
// }
public SwipeBackLayout getSwipeBackLayout() {
return mSwipeBackLayout;
}
public void setLayoutInflaterFactory() {
LayoutInflater layoutInflater = getLayoutInflater();
try {
Field mFactorySet = LayoutInflater.class.getDeclaredField("mFactorySet");
mFactorySet.setAccessible(true);
mFactorySet.set(layoutInflater, false);
LayoutInflaterCompat.setFactory(layoutInflater, new SkinFactory(this));
} catch (Exception e) {
e.printStackTrace();
}
}
public RecyclerView initCommonRecyclerView(BaseQuickAdapter adapter, RecyclerView.ItemDecoration decoration) {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
return initCommonRecyclerView(recyclerView, adapter, decoration);
}
public RecyclerView initCommonRecyclerView(RecyclerView recyclerView, BaseQuickAdapter adapter, RecyclerView.ItemDecoration decoration) {
recyclerView.setLayoutManager(new LinearLayoutManager(this));
if (decoration != null) {
recyclerView.addItemDecoration(decoration);
}
recyclerView.setAdapter(adapter);
return recyclerView;
}
public RecyclerView initHorizontalRecyclerView(BaseQuickAdapter adapter, RecyclerView.ItemDecoration decoration) {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
if (decoration != null) {
recyclerView.addItemDecoration(decoration);
}
recyclerView.setAdapter(adapter);
return recyclerView;
}
public RecyclerView initGridRecyclerView(int resId, BaseQuickAdapter adapter, RecyclerView.ItemDecoration decoration, int spanCount) {
RecyclerView recyclerView = (RecyclerView) findViewById(resId == 0 ? R.id.recyclerView : resId);
recyclerView.setLayoutManager(new GridLayoutManager(this, spanCount));
if (decoration != null) {
recyclerView.addItemDecoration(decoration);
}
recyclerView.setAdapter(adapter);
return recyclerView;
}
public RecyclerView initGridRecyclerView(BaseQuickAdapter adapter, RecyclerView.ItemDecoration decoration, int spanCount) {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new GridLayoutManager(this, spanCount));
if (decoration != null) {
recyclerView.addItemDecoration(decoration);
}
recyclerView.setAdapter(adapter);
return initGridRecyclerView(0, adapter, decoration, spanCount);
}
@Override
protected void onDestroy() {
super.onDestroy();
onUnsubscribe();
if (mSubscription != null) mSubscription.unsubscribe();
}
/**
* 初始化界面
*/
protected void initView(Bundle savedInstanceState) {
loadViewLayout();
bindViews();
processLogic(savedInstanceState);
setListener();
}
protected void showLog(String log) {
Logger.i(log);
}
/**
* 获取控件
*
* @param id 控件的id
* @param <E>
* @return
*/
protected <E extends View> E get(int id) {
return (E) findViewById(id);
}
/**
* 加载布局
*/
protected abstract void loadViewLayout();
/**
* find控件
*/
protected abstract void bindViews();
/**
* 处理数据
*/
protected abstract void processLogic(Bundle savedInstanceState);
/**
* 设置监听
*/
protected abstract void setListener();
/**
* 界面跳转
*
* @param tarActivity
*/
protected void intent2Activity(Class<? extends Activity> tarActivity) {
Intent intent = new Intent(mContext, tarActivity);
startActivity(intent);
}
protected void openActivity(Class<?> pClass, Bundle pBundle) {
Intent intent = new Intent(mContext, pClass);
if (pBundle != null) {
intent.putExtras(pBundle);
}
startActivity(intent);
}
/**
* 显示Toast
*
* @param msg
*/
protected void showToast(String msg) {
// ToastUtils.showToast(msg);
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
/**
* 注册事件通知
*/
public Observable<Notice> toObservable() {
return RxBus.getDefault().toObservable(Notice.class);
}
/**
* 发送消息
*/
public void post(Notice msg) {
RxBus.getDefault().post(msg);
}
//RXjava取消注册,以避免内存泄露
public void onUnsubscribe() {
if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
mCompositeSubscription.unsubscribe();
}
}
public void addSubscription(Observable observable, Subscriber subscriber) {
if (mCompositeSubscription == null) {
mCompositeSubscription = new CompositeSubscription();
}
mCompositeSubscription.add(observable
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(subscriber));
}
public BaseActivity() {
}
public void onStart() {
super.onStart();
}
protected void onResume() {
super.onResume();
JPushInterface.onResume(this);
}
protected void onPause() {
super.onPause();
JPushInterface.onPause(this);
}
public void onStop() {
super.onStop();
}
/** 检查更新Dialog */
/** 等待提示框 */
public void showLoadingDialog(String msg) {
if (loginDialog == null) {
loginDialog = new MyDialog(BaseActivity.this, R.style.MyDialog);
}
if (loginDialog.isShowing()) {
loginDialog.dismiss();
}
LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.login_dialog, null);
TextView text = (TextView) view.findViewById(R.id.login_dialog_textview);
text.setText(msg);
// 设置显示位置
Window window = loginDialog.getWindow();
window.setGravity(Gravity.CENTER);
// 设置透明度
Display display = getWindowManager().getDefaultDisplay();
WindowManager.LayoutParams lp = window.getAttributes();
lp.alpha = 0.8f;
lp.width = (int) (display.getWidth() * 0.85);
window.setAttributes(lp);
// 弹出对话框或某些模式窗口时,后面的内容会变得模糊或不清楚
// window.setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
// WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
loginDialog.setCanceledOnTouchOutside(false);
loginDialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
} else {
return false; // 默认返回 false
}
}
});
loginDialog.setContentView(view);
loginDialog.setCancelable(false);
loginDialog.show();
}
public void dismissLoadingDialog() {
if (loginDialog != null && loginDialog.isShowing()) {
loginDialog.dismiss();
}
}
}
| [
"632977592@qq.com"
] | 632977592@qq.com |
50d667de10195d81464a31ae2352d382c1f62ba8 | 71633cdf1d13240bb630c0ca9e8daa00f1bee0a9 | /src/main/java/com/example/democomment/dao/StudentDao.java | c48dfebe17a7ac1b2f9431f1c9c62f64dc06b484 | [] | no_license | houfei11/dome | ba6b2ec7a51d5cf0275f7026db393a0c6718319e | c5379fde76355aa7091c96bb05dbee6dfa62c05a | refs/heads/master | 2020-05-22T16:24:30.160263 | 2019-05-14T14:41:07 | 2019-05-14T14:41:07 | 186,430,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 137 | java | package com.example.democomment.dao;
/**
* 持久化数据层
*/
public interface StudentDao {
public boolean add(String name);
}
| [
"331488738@qq.com"
] | 331488738@qq.com |
58f831db207e852086203b9097e76a618f5f89bb | 5c92beefaf050ff7ad4d8210eb169ee3d8504fe9 | /HAAProject_IProcess_20091218/src/c4j/system/haa/iprocess/test/TestCasePredict.java | e33842715eab051e47cf99bbeffe64f0647e6930 | [] | no_license | kutariyar/haaprojects | 89a225b8b97c4501167971dcaa00c74c8c7fb9a8 | f35de8af8a6b63a9bffc80c8b4b21a43cc6d59ac | refs/heads/master | 2021-01-20T23:24:01.125777 | 2013-12-26T06:47:52 | 2013-12-26T06:47:52 | 34,249,551 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,123 | java | /**
* $Revision: 1.0 $
* $Author: Eric Yang $
* $Date: Dec 18, 2009 7:40:41 PM $
*
* Author: Eric Yang
* Date : Dec 18, 2009 7:40:41 PM
*
*/
package c4j.system.haa.iprocess.test;
import com.comwave.staffware.sso.CaseCore;
import com.comwave.staffware.sso.Field;
import com.comwave.staffware.sso.Step;
/**
* @author Eric Yang
* @version 1.0
*/
public class TestCasePredict extends BaseSSOCoreTest {
CaseCore caseCore;
protected void setUp() throws Exception {
super.setUp();
caseCore = ssoCore.getCaseCore();
}
public void testPredictNextStep() {
Field field1 = new Field("TYPE", "A");
Field field2 = new Field("ORGID", "01");
Field field3 = new Field("NEXTADD", "4551");
Field[] fields = new Field[] { field1, field2, field3 };
Step step = caseCore.predictNextStep("CREDIT", "6191", fields)[0];
assertEquals("MGRAPR", step.getStepName());
field1 = new Field("TYPE", "B");
fields = new Field[] { field1, field2, field3 };
step = caseCore.predictNextStep("CREDIT", "6191", fields)[0];
assertEquals("MGRAPR1", step.getStepName());
}
}
| [
"gelnyang@d0820c7c-ebc6-11de-9b30-9f9d59cce923"
] | gelnyang@d0820c7c-ebc6-11de-9b30-9f9d59cce923 |
e1b1af3cc591ece593d9415c95f1a434c2adefa4 | 5ec11e84304812436fab642808500f1749095271 | /src/test/java/C3_sharing_objects/C3_2_Non_thread_safe_mutable_integer_holder/MutableIntegerTest.java | 2f4303cdc2e7d638508b5a9a31f6ca5b1961f976 | [] | no_license | hellojinl/JCIPSrc | 92753dbf9c517ca9dcad69f1a150edc24e83422d | ba92bd96b3105c9f3ce2af2cd6c006a542ee1c59 | refs/heads/master | 2021-07-04T06:01:40.629260 | 2017-09-13T08:33:46 | 2017-09-13T08:33:46 | 103,031,630 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,013 | java | package C3_sharing_objects.C3_2_Non_thread_safe_mutable_integer_holder;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CountDownLatch;
import org.junit.Test;
/**
*
* 由于MutableInteger中的get和set方法都没有synchronized,且value也不是volatile,因此它是线程不安全的,理论上有可能出现
* 在一个线程中将value值set为123456之后,在另一线程中读到的value值不等于12356(中间没有其他线程修改value值)。
* 所以我想写一个测试让这个过程可以很容易的反复出现,可是没有成功。但是即使很难复现出错的情况,也不能说MutableInteger是线程安全的,
* 它仍然是线程不安全的,此外实际生产环境中高并发是很常见的(测试环境很难模拟),因此MutableInteger在实际生产环境中出错的概率并不低,
* 因此如果你不注意,就可能会遇到测试一切OK,上线就出问题的窘境。
*
* @author Jin Lei Stormborn, the Unburnt, King of of Meereen, King of the
* Andals and the Rhoynar and the First Men, Lord of the Seven Kingdoms,
* Protector of the Realm, Caho of the Great Grass Sea, Breaker of
* Shackles, Father of Dragons.
* @see <a href=
* "http://www.cnblogs.com/rocomp/p/4780532.html">细说Java多线程之内存可见性</a>
*/
public class MutableIntegerTest {
@Test
public void test() throws InterruptedException, BrokenBarrierException {
final MutableInteger mutableInteger = new MutableInteger();
final CountDownLatch latch = new CountDownLatch( 1 );
ReaderThread readerThread = new ReaderThread( mutableInteger, latch );
readerThread.start();
WriterThread writerThread = new WriterThread( mutableInteger, latch );
writerThread.start();
readerThread.join();
}
private class WriterThread extends Thread {
private final MutableInteger mutableInteger;
private final CountDownLatch latch;
WriterThread(MutableInteger mutableInteger, CountDownLatch latch) {
this.mutableInteger = mutableInteger;
this.latch = latch;
}
public void run() {
mutableInteger.set( 123456 );
latch.countDown();
}
}
private class ReaderThread extends Thread {
private final MutableInteger mutableInteger;
private final CountDownLatch latch;
ReaderThread(MutableInteger mutableInteger, CountDownLatch latch) {
this.mutableInteger = mutableInteger;
this.latch = latch;
}
public void run() {
try {
latch.await();
} catch ( InterruptedException e ) {
e.printStackTrace();
return; // 结束线程
}
System.out.println( mutableInteger.get() ); // 只有在极少的情况下(短时间,高并发),这个值才不为123456
}
}
}
| [
"hello_jinl@126.com"
] | hello_jinl@126.com |
22e331dafbb50e8a883d91573a31cb66405d7413 | 6eb9945622c34e32a9bb4e5cd09f32e6b826f9d3 | /src/com/crashlytics/android/core/Report.java | 80bf73103cc1e91c24c2656aee25229c55faf0ce | [] | no_license | alexivaner/GadgetX-Android-App | 6d700ba379d0159de4dddec4d8f7f9ce2318c5cc | 26c5866be12da7b89447814c05708636483bf366 | refs/heads/master | 2022-06-01T09:04:32.347786 | 2020-04-30T17:43:17 | 2020-04-30T17:43:17 | 260,275,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.crashlytics.android.core;
import java.io.File;
import java.util.Map;
interface Report
{
public abstract Map getCustomHeaders();
public abstract File getFile();
public abstract String getFileName();
public abstract String getIdentifier();
public abstract boolean remove();
}
| [
"hutomoivan@gmail.com"
] | hutomoivan@gmail.com |
5fb94ce64993d9f98370d47045ac56c55b994ca5 | ff708cd4e45210b887ae2d7070a3a5265eaaacfa | /src/com/sankar/gbemu/cart/RomRamCartridge.java | cf9e37be576ae3376fb42e7e16be0d76c4d484a2 | [] | no_license | viswans83/GameboyEmu | 74237d73e0ff21f0fc4259b3bd5b07c5ca99ef4e | 8c1949a4dd54d369e5022058f7bb0f986f1780f9 | refs/heads/master | 2021-01-18T06:00:08.654409 | 2013-11-18T00:11:56 | 2013-11-18T00:11:56 | 13,441,680 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.sankar.gbemu.cart;
/**
*
* @author minerva
*/
public class RomRamCartridge extends Cartridge {
public RomRamCartridge(byte[] rom, byte[] ram) {
super(rom,ram);
}
@Override
protected void handleWrite(int addr, byte value) {
if(addr >= 0xa000 && addr <= 0xbfff) {
wram8(addr,value);
}
}
}
| [
"rationalrevolt@gmail.com"
] | rationalrevolt@gmail.com |
7307f988494c5f62a957be1a42dfe62aaca11969 | 7f32909a84a728e46c3314ccba39a5918d94b846 | /src/main/java/essay/ToBinaryString.java | 11a732cbf46724979f2a375fa0fde432db1f41a6 | [] | no_license | zm2417/algorithm | 2d05ef0726ac36fb5bd35d745576c293f711b442 | d64b2f7424f21ba9355589aff726aa54cf42263d | refs/heads/master | 2020-03-28T20:52:31.583076 | 2018-11-15T03:55:02 | 2018-11-15T03:55:02 | 149,110,139 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,318 | java | package essay;
/**
* int ==> binary string
*/
public class ToBinaryString {
private static final int SIZE = 32;
static String toBinaryString(int val){
int shift = 1;
// assert shift > 0 && shift <=5 : "Illegal shift value";
int mag = ToBinaryString.SIZE - ToBinaryString.numberOfLeadingZeros(val);
int chars = Math.max(((mag + (shift - 1)) / shift), 1);
char[] buf = new char[chars];
formatUnsignedInt(val, shift, buf, 0, chars);
// Use special constructor which takes over "buf".
return new String(buf);
}
static int formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) {
int charPos = len;
int radix = 1 << shift;
int mask = radix - 1;
do {
buf[offset + --charPos] = ToBinaryString.digits[val & mask];
val >>>= shift;
} while (val != 0 && charPos > 0);
return charPos;
}
/**
* All possible chars for representing a number as a String
* base 2 and base 16
*/
final static char[] digits = {
'0' , '1' , '2' , '3' , '4' , '5' ,
'6' , '7' , '8' , '9' , 'a' , 'b' ,
'c' , 'd' , 'e' , 'f' , 'g' , 'h' ,
'i' , 'j' , 'k' , 'l' , 'm' , 'n' ,
'o' , 'p' , 'q' , 'r' , 's' , 't' ,
'u' , 'v' , 'w' , 'x' , 'y' , 'z'
};
/**
* 返回int数前面的0的个数
* @param val
* @return
*/
public static int numberOfLeadingZeros(int val){
if(val == 0){
return 32;
}
int n = 1;
if(val >>> 16 == 0){ n+=16; val<<=16; }
if(val >>> 24 == 0){ n+=8; val<<=8; }
if(val >>> 28 == 0){ n+=4; val<<=4; }
if(val >>> 30 == 0){ n+=2; val<<=2; }
n-=val>>>31;
return n;
}
public static int bitCount(int i) {
// HD, Figure 5-2
i = i - ((i >>> 1) & 0x55555555);
i = (i & 0x33333333) + ((i >>> 2) & 0x33333333);
i = (i + (i >>> 4)) & 0x0f0f0f0f;
i = i + (i >>> 8);
i = i + (i >>> 16);
return i & 0x3f;
}
public static void main(String[] args){
// ToBinaryString.numberOfLeadingZeros(-2);
ToBinaryString.toBinaryString(0);
// ToBinaryString.bitCount(14);
}
}
| [
"wangliuhui@sokamail.com"
] | wangliuhui@sokamail.com |
8745465d60c48c313eb1de94be937045bc973793 | 0c99cdce8af0c7cf1b0242df9209f541dfd3a232 | /lesson02/src/FindCub.java | 193cc7feb9f199478dcbb9113a521cbdc949fb01 | [] | no_license | elemanjan/javacore_01 | 330f4a52ada6be933e9f2d9306c01aa58b61a806 | c22679dc8d95251013e265daa24e551fc106f6ff | refs/heads/master | 2023-01-28T19:24:07.952652 | 2020-11-30T04:13:04 | 2020-11-30T04:13:04 | 311,653,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | import java.util.Scanner;
public class FindCub {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
double num = read.nextInt();
System.out.println(num * num * num);
System.out.println(Math.pow(num, 3));
}
}
| [
"mr.eleman@gmail.com"
] | mr.eleman@gmail.com |
d3351b6709cf1d0aa4838ceb5baf7181533c0db0 | ec50137c634d0040aad9154d9247eeb9ee1684e9 | /common-lib/src/main/java/ca/teranet/pages/tex/DocumentListPage.java | 78d898d3df89d859c37df141fb20cb35fccc8e89 | [] | no_license | santoshkiranvegi/csp-tex-autouitest | 62d973aef7b8bd9a42aaca9923552f2cb6ce9ada | 1c5ffd151668d7fc523f6994d62cff1f56810be7 | refs/heads/master | 2022-07-14T09:12:27.458342 | 2019-07-16T10:38:35 | 2019-07-16T10:38:35 | 196,379,558 | 0 | 0 | null | 2022-06-29T17:30:43 | 2019-07-11T11:14:27 | Java | UTF-8 | Java | false | false | 1,333 | java | package ca.teranet.pages.tex;
import ca.teranet.pages.base.WebTablePage;
import net.serenitybdd.core.annotations.findby.FindBy;
import net.serenitybdd.core.pages.WebElementFacade;
public class DocumentListPage extends WebTablePage {
private final String tableDocumentList = "//table[@id='namesLoop']";
public void setDocumentListTable() {
this.setTablePath(tableDocumentList);
}
public WebElementFacade desp_document(int docNo) {
return findBy(tableDocumentList + "/tbody/tr[" + docNo + "]/td/div[@class='form-label']");
}
public WebElementFacade radiobutton_allPages(int docNo) {
return findBy(tableDocumentList + "/tbody/tr[" + docNo + "]/td//tr[2]/td[1]/input");
}
public WebElementFacade radiobutton_selectPages(int docNo) {
return findBy(tableDocumentList + "/tbody/tr[" + docNo + "]/td//tr[2]/td[2]//input[@type='radio']");
}
public WebElementFacade input_selectPages(int docNo) {
return findBy(tableDocumentList + "/tbody/tr[" + docNo + "]/td//tr[2]/td[2]//input[@type='text']");
}
@FindBy(xpath = "//input[@id='btn-submit']")
public WebElementFacade button_submit;
// ============== negative ==================================
// for list document and some error message in document view page
@FindBy(xpath = "//span[@id='doc.errors']")
public WebElementFacade page_errorMsg_docList;
}
| [
"47055936+santoshkiranvegi@users.noreply.github.com"
] | 47055936+santoshkiranvegi@users.noreply.github.com |
a6e897ef9c0e913aa3896a4838db844619c89087 | d2249c034b72270266cd3d3d277f710708038774 | /src/com/peakcentre/web/servlet/ModifyTrainingPlanServlet.java | 7d6485b8ad0cfacab3f5043c421dd079e3f9e995 | [] | no_license | MingyangSun/PeakCentreProject | 232f4791aebe742c6afee552b2d88797e73580b5 | 95132e6b5a4ae6629f33f2a0727063d89f00334b | refs/heads/master | 2021-01-10T16:22:55.013292 | 2015-12-16T15:33:24 | 2015-12-16T15:33:24 | 48,115,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,364 | java | package com.peakcentre.web.servlet;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.peakcentre.web.dao.TrainingPlanDao;
import com.peakcentre.web.dao.UserinfoDao;
import com.peakcentre.web.entity.TrainingPlan;
import com.peakcentre.web.entity.Userinfo;
/**
* Servlet implementation class ModifyTrainingPlanServlet
*/
@WebServlet("/jsp/ModifyTrainingPlanServlet")
public class ModifyTrainingPlanServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ModifyTrainingPlanServlet() {
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
if(request.getSession(false) != null && request.getSession(false).getAttribute("id") != null) {
response.sendRedirect("dashboard.jsp");
} else {
response.sendRedirect(request.getContextPath() + "/index.jsp");
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String username = request.getParameter("username");
String startdate = request.getParameter("startdate");
String enddate = request.getParameter("enddate");
String weekData = request.getParameter("weekData");
String st1 = request.getParameter("st1");
String st2 = request.getParameter("st2");
String ft = request.getParameter("ft");
System.out.println("Here");
TrainingPlan tp = new TrainingPlan();
tp.setData("weekData", weekData);
tp.setData("st1", st1);
tp.setData("st2", st2);
tp.setData("ft", ft);
tp.setStartdate(startdate);
tp.setEnddate(enddate);
tp.setUsername(username);
TrainingPlanDao tpd = new TrainingPlanDao();
tpd.updateTrainingPlan(tp);
response.sendRedirect("dashboard.jsp");
}
}
| [
"msun078@uottawa.ca"
] | msun078@uottawa.ca |
dd89beccb4869e5b0d6f3ae95175e7b91376114c | 51a9dcf2c58c40a27098abdcbc3d7bf058447e09 | /src/com/hahareader/listener/BackGestureListener.java | 6ff25f4ad6b91943b5e640f4fc71af23b6592e1e | [] | no_license | AlexJingHF/HaHaReader | ac6aef8e9216a72fc378e2c3f8f5f095cb9b735f | 57f604eafd516754022385a0eb3e142da9282f8a | refs/heads/master | 2020-06-02T08:28:33.865024 | 2014-05-28T01:52:45 | 2014-05-28T01:52:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,268 | java | package com.hahareader.listener;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import com.hahareader.base.BaseActivity;
import com.hahareader.tool.Mlog;
public class BackGestureListener implements OnGestureListener
{
private final String TAG = BackGestureListener.class.getSimpleName();
private BaseActivity activity;
public BackGestureListener(BaseActivity activity)
{
this.activity = activity;
}
@Override
public boolean onDown(MotionEvent e)
{
Mlog.d(TAG, "onDown");
return false;
}
@Override
public void onShowPress(MotionEvent e)
{
Mlog.d(TAG, "onShowPress");
}
@Override
public boolean onSingleTapUp(MotionEvent e)
{
Mlog.d(TAG, "onSingleTapUp");
return false;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY)
{
Mlog.d(TAG, "onScroll");
if ((e2.getX() - e1.getX()) > 100 && Math.abs(e1.getY() - e2.getY()) < 60)
{
activity.onBackPressed();
}
return false;
}
@Override
public void onLongPress(MotionEvent e)
{
Mlog.d(TAG, "onLongPress");
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY)
{
Mlog.d(TAG, "onFling");
return false;
}
}
| [
"huq33@126.com"
] | huq33@126.com |
2f01a298be63e0f6df978c028340e7604fbf2e65 | c7d2852b1af6d1cc0f79931beb75cb9d0e56e4fb | /app/src/main/java/com/peoit/android/studentuga/weixin/MD5.java | 138827f570c80c7a3adb9018a93ab1533db14eb7 | [] | no_license | bolig/studentUGA | 1e96fc1e8946a1029aa70802fb9adfedfabd9e51 | 269bab9861c84c700da678e332918f19ca7d0d0c | refs/heads/master | 2021-01-18T00:37:51.313540 | 2015-11-20T07:03:36 | 2015-11-20T07:03:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package com.peoit.android.studentuga.weixin;
import java.security.MessageDigest;
public class MD5 {
private MD5() {}
public final static String getMessageDigest(byte[] buffer) {
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
try {
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(buffer);
byte[] md = mdTemp.digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
return null;
}
}
}
| [
"1043973279@qq.com"
] | 1043973279@qq.com |
51f7a7faeab2536325a07ba8fa7866e92e4be82e | 65487a2f1d3d6d27b4caa81f3538b48ee2f98162 | /src/controllers/reports/ReportsEditServlet.java | ec42225c4ae145b442962abdd0cd06d355826740 | [] | no_license | YoshidaInasaku/daily_report_system | faa43157266386df67ff4079040a9cb0e9b622f9 | f8eb00f616fcecb01e273d24cf31629d5d2cd058 | refs/heads/main | 2023-03-13T17:59:01.407663 | 2021-03-07T07:57:35 | 2021-03-07T07:57:35 | 345,034,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,802 | java | package controllers.reports;
import java.io.IOException;
import javax.persistence.EntityManager;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import models.Employee;
import models.Report;
import utils.DBUtil;
/**
* Servlet implementation class ReportsEditServlet
*/
@WebServlet("/reports/edit")
public class ReportsEditServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ReportsEditServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
EntityManager em = DBUtil.createEntityManager();
Report r = em.find(Report.class, Integer.parseInt(request.getParameter("id")));
em.close();
Employee login_employee = (Employee)request.getSession().getAttribute("login_employee");
if(r != null && r.getEmployee().getId() == login_employee.getId()) { // sessionに格納されている社員IDと編集しようとしている社員のIDが同じなら
request.setAttribute("report", r);
request.setAttribute("_token", request.getSession().getId()); // CSRF対策
request.getSession().setAttribute("report_id", r.getId()); //UpdateServletに値を渡すため
}
RequestDispatcher rd = request.getRequestDispatcher("/WEB-INF/views/reports/edit.jsp");
rd.forward(request, response);
}
}
| [
"yoshidanoinasaku@gmail.com"
] | yoshidanoinasaku@gmail.com |
e8f512c50afd62e5a3d992b9791e3ecf502a08ab | 749acc590b2203a88c0148a303e5a532b092ba06 | /behavioralPattern/interpreterPattern/src/Impl/TerminalExpression.java | 83101633c0825082f4d5f6fced627f7d8b58a513 | [] | no_license | rohitnotes/DesignPattern-1 | b1e3cb6526fc7483ccd6e6f329c2ac960f49ca1e | 14a1a35fc0f51a94310f67ba5326a10c6e47d897 | refs/heads/master | 2022-02-25T12:25:40.516824 | 2019-10-11T12:46:35 | 2019-10-11T12:46:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package Impl;
import Interface.Expression;
/**
* 实现了表达式接口的实体类
* Created by 李伟民 on 17/7/18.
*/
public class TerminalExpression implements Expression {
private String data;
public TerminalExpression(String data){
this.data = data;
}
public boolean interpret(String context) {
return context.contains(data);
}
}
| [
"151250082@smail.nju.edu.cn"
] | 151250082@smail.nju.edu.cn |
8f06778937f24a227bffd6ac401dc9658756684a | 8f1962ce96b53d87d2329c02c87deb39702d1ad8 | /trucking/src/main/java/ru/tsystems/javaschool/validator/UserValidator.java | 87a1ecc216ce0fc8189643a450de4d4c5df3429f | [] | no_license | Kseniia2iup/logiwebMultiModule | df90a9ea82528e608f3891f456603260f8341e2f | 89428e0e80c5898faf40a5fb3339e8117a4ac0e9 | refs/heads/master | 2020-03-21T16:31:57.267409 | 2018-06-27T22:39:13 | 2018-06-27T22:39:13 | 138,775,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,250 | java | package ru.tsystems.javaschool.validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import ru.tsystems.javaschool.dto.User;
import ru.tsystems.javaschool.service.UserService;
@Component
public class UserValidator implements Validator {
private static final Logger LOGGER = LoggerFactory.getLogger(UserValidator.class);
private UserService userService;
@Autowired
public void setUserService(UserService userService) {
this.userService = userService;
}
@Override
public boolean supports(Class<?> clazz) {
return User.class.isAssignableFrom(clazz);
}
@Override
public void validate(Object target, Errors errors) {
User user = (User) target;
ValidationUtils.rejectIfEmptyOrWhitespace(errors,
"login", "login", "Login is required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors,
"password", "password", "Password is required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors,
"email", "email", "Email is required.");
try {
if(!userService.isEmailValid(user.getEmail())){
errors.rejectValue("email", "email",
"Email is not valid.");
}
}
catch (Exception e){
LOGGER.warn("From UserValidator method validate\n", e);
}
try {
if(!userService.isEmailUnique(user.getEmail())){
errors.rejectValue("email", "email",
"Email is not unique.");
}
}
catch (Exception e){
LOGGER.warn("From UserValidator method validate\n", e);
}
try {
if (!userService.isUserValid(user)){
errors.rejectValue("login", "login",
"Incorrect data.");
}
} catch (Exception e){
LOGGER.warn("From UserValidator method validate\n", e);
}
}
}
| [
"kseniia.iup@gmail.com"
] | kseniia.iup@gmail.com |
cec874ddbf238c34bfe52df6fd04a70ac1eb1e3c | 580516de0039509fcc1362880ea62a1883960e7d | /Ejercicio0316.java | 197b5d8a0b86bb0962746e3b0560f7a152db599c | [] | no_license | giannyuffo/dam129t11 | 8f8201cae94db82372cf5d922158826b89e2ba7f | 5bb36ec224cd1e22b611b1ee4484c84222e0bb0a | refs/heads/master | 2021-02-10T07:43:42.191636 | 2020-04-03T14:38:18 | 2020-04-03T14:38:18 | 244,362,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,234 | java |
package ejercicios;
import java.util.Scanner;
public class Ejercicio0316 {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
int num1=0, num2=0, nveces=2;
boolean acertar=false;
System.out.println("Comienza el primer jugador. Introduce un número entre 0 y 100");
num1=teclado.nextInt();
if (num1<0 || num1>100)
{do{
System.out.println("Número erróneo, vuelve a introducirlo");
num1=teclado.nextInt();
}
while(num1<0 || num1>100);
}
System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
System.out.println("Segundo jugador. Intenta adivinar el número.Introduce un número entre 0 y 100. Tienes 5 intentos.");
num2=teclado.nextInt();
do {
if (num2<0 || num2>100)
{do{
System.out.println("Número erróneo, vuelve a introducirlo");
num2=teclado.nextInt();
}
while(num2<0 || num2>100);
}
else
{
if(num1 != num2)
{
if (num1>num2)
System.out.println("Tu número es más pequeño");
if (num1<num2)
System.out.println("Tu número es más grande");
acertar =false;
System.out.println("Vuelve a intentarlo");
num2=teclado.nextInt();
nveces++;
}
if(num1==num2)
{
acertar=true;
}
}
}
while (acertar == false && nveces<6);
if(num1 != num2)
System.out.println("No haz acertado. Esperemos que tengas más suerte mañana.");
else
System.out.println("Haz acertado. Toma, un premio.");
} //fin main
} //fin clase | [
"59051445+giannyuffo@users.noreply.github.com"
] | 59051445+giannyuffo@users.noreply.github.com |
cff39448bcac2adced321eb5b74e8faf88e93d08 | d12c9af52788a2fd1487b07608b4840d8dbdb673 | /Lab5/src/a00998715/Lab5.java | 723185adb7d9307e9d4c919f2d9649e10eef214c | [] | no_license | e1212545/comp2613_java | d811fc6bb31f1f767872184bfebbb529a607af29 | 4e31958be9068ef153c8ee116c12f620e69e0e76 | refs/heads/master | 2020-06-17T10:06:42.989411 | 2017-03-29T01:04:42 | 2017-03-29T01:04:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,797 | java | /**
* Project: Lab4
* File: Lab2.java
* Date: Jan 22, 2017
* Time: 3:18:33 PM
*/
package a00998715;
import java.io.FileInputStream;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.Configurator;
import a00998715.data.ApplicationException;
import a00998715.io.CustomerReader;
import a00998715.io.CustomerReport;
/**
* @author Edgar Zapeka, A00998715
*
*/
public class Lab5 {
public static final String LOG4J_CONFIG_FILENAME = "log4j2.xml";
private static void configureLogging() {
ConfigurationSource source;
try {
source = new ConfigurationSource(new FileInputStream(LOG4J_CONFIG_FILENAME));
Configurator.initialize(null, source);
} catch (IOException e) {
System.out.println(String.format("Can't find the log4j logging configuration file %s.", LOG4J_CONFIG_FILENAME));
}
}
static {
configureLogging();
}
private static final Logger LOG = LogManager.getLogger(Lab5.class);
static void run() {
CustomerReader readCustomersFile = new CustomerReader();
CustomerReport report = new CustomerReport();
try {
report.addAllCustomers(readCustomersFile.splitDataAndCreateCustomersListSortedByJoinedDate());
report.printIntoFile();
} catch (ApplicationException e) {
LOG.error(e.toString());
System.exit(-1);
}
}
/**
* @param args
*/
public static void main(String[] args) {
Instant startTime = Instant.now();
LOG.info(startTime);
Lab5.run();
Instant endTime = Instant.now();
LOG.info(endTime);
LOG.info(String.format("Duration: %d ms", Duration.between(startTime, endTime).toMillis()));
}
}
| [
"edz@edgars-mbp.wifi.bcit.ca"
] | edz@edgars-mbp.wifi.bcit.ca |
eaa552e0f83ff1e7a34592473014e85eafbb2beb | e55da33d76933d7a8771bf8a6617a626e2e98207 | /boot_api/src/main/java/com/mr/pojo/CouponVo.java | bbf853e5a2a568ad93ba98bde0089c836348a9d2 | [] | no_license | w5y2f0/OnlineRetailers | 37da2e5bbfe16989327651f407d8d4eefcb82386 | de712275151437d6b34f2c27d3ba40c9ad5468b7 | refs/heads/master | 2020-05-17T22:36:34.366229 | 2019-05-10T03:08:49 | 2019-05-10T03:08:49 | 183,993,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,159 | java | package com.mr.pojo;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Fan on 2019/5/9.
*/
public class CouponVo {
private Integer coId;//卷编号
private Double coMoney;//价值
private Double coLimit;//限制价格
private Date coValid;//有效时间
private Date reTime;//领取时间
private Integer reUse;//使用状态
private Integer reTerm;//过期状态
private String getReTimeStr(){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String format1 = format.format(reTerm);
return format1;
}
private String getCoValidStr(){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String format1 = format.format(coValid);
return format1;
}
@Override
public String toString() {
return "CouponVo{" +
"coId=" + coId +
", coMoney=" + coMoney +
", coLimit=" + coLimit +
", coValid=" + coValid +
", reTime=" + reTime +
", reUse=" + reUse +
", reTerm=" + reTerm +
'}';
}
public Integer getCoId() {
return coId;
}
public void setCoId(Integer coId) {
this.coId = coId;
}
public Double getCoMoney() {
return coMoney;
}
public void setCoMoney(Double coMoney) {
this.coMoney = coMoney;
}
public Double getCoLimit() {
return coLimit;
}
public void setCoLimit(Double coLimit) {
this.coLimit = coLimit;
}
public Date getCoValid() {
return coValid;
}
public void setCoValid(Date coValid) {
this.coValid = coValid;
}
public Date getReTime() {
return reTime;
}
public void setReTime(Date reTime) {
this.reTime = reTime;
}
public Integer getReUse() {
return reUse;
}
public void setReUse(Integer reUse) {
this.reUse = reUse;
}
public Integer getReTerm() {
return reTerm;
}
public void setReTerm(Integer reTerm) {
this.reTerm = reTerm;
}
}
| [
"13994959519@163.com"
] | 13994959519@163.com |
987e93002626a57e0dfb4c34ac18d6591e2ea7ab | 0c9ea9a90b73d85b286eed8e91258d2db383e265 | /src/main/java/com/kotsovskyi/action/TakeShotHelper.java | e5a62846b04626b62585d28f8f31a3dc5e6c7b9a | [] | no_license | kotsovskyi/BattleShipWeb | df94571c822679a32c5afe7cc3a5149d51f1e33e | 2ff771292cdc5b44156c9003a57f68173aa44564 | refs/heads/master | 2021-01-10T07:56:55.790841 | 2016-03-16T08:43:34 | 2016-03-16T08:43:34 | 54,014,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package com.kotsovskyi.action;
import com.kotsovskyi.server.FightRoom;
import com.kotsovskyi.utils.BattleFieldStorage;
import com.kotsovskyi.utils.BattleShipHelper;
import com.kotsovskyi.utils.FightRoomDirectory;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.simple.JSONValue;
import org.json.simple.parser.ParseException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class TakeShotHelper implements Action{
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ParseException, JSONException {
String loginJson = request.getParameter("login");
JSONObject jsonObject = new JSONObject();
BattleShipHelper helper = new BattleShipHelper();
if(loginJson != null) {
String login = (String) JSONValue.parse(loginJson);
FightRoom fightRoom = FightRoomDirectory.getFightRoom(login);
jsonObject.put("attacker", false);
if(fightRoom.getCl2().isAttacker() && fightRoom.getCl2().getName().equals(login)) {
jsonObject.put("attacker", true);
} else if(fightRoom.getCl1().isAttacker() && fightRoom.getCl1().getName().equals(login)) {
jsonObject.put("attacker", true);
}
if(helper.isTheEndOfGame(BattleFieldStorage.getBattleField(login))) {
jsonObject.put("loser", true);
}
jsonObject.put("hits", BattleFieldStorage.getHits(login));
response.getWriter().write(jsonObject.toString());
}
return "/jsp/battlefields.jsp";
}
}
| [
"romankotsovskyi@gmail.com"
] | romankotsovskyi@gmail.com |
c7fe09ce786fcce579030cc472009017b6bddfca | 2c0acb67c8d07c2149f6f6d1e2633cfb033bce2a | /app/src/main/java/qf/com/vitamodemo/adapter/SourceSpinnerAdapter.java | 3fa75cd049faf7b974c34d1a48c7da7a84bf9406 | [] | no_license | yufeilong92/AiShiPin | a4c8dedc1381bf7b1161bf489ff7001ecf8d5782 | 8a7657765132832e3aaf7b44fcda9b8c45004896 | refs/heads/master | 2020-03-14T06:28:32.240967 | 2019-02-25T07:27:26 | 2019-02-25T07:27:26 | 131,484,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,131 | java | package qf.com.vitamodemo.adapter;
import android.content.Context;
import android.util.Log;
import android.widget.ImageView;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
import java.util.List;
import qf.com.vitamodemo.BaseApp;
import qf.com.vitamodemo.R;
import qf.com.vitamodemo.bean.VideoBean;
/**
* 视频来源spinner的adapter
* Created by Administrator on 2015/10/11 0011.
*/
public class SourceSpinnerAdapter extends AbsAdapter<VideoBean.SitesEntity> {
public SourceSpinnerAdapter(Context context, int layoutRes, List<VideoBean.SitesEntity>
datas) {
super(context, layoutRes, datas, 0);
}
@Override
public void showData(ViewHolder vHolder, VideoBean.SitesEntity data, int position) {
ImageView icon = (ImageView) vHolder.getView(R.id.source_icon);
ImageLoader.getInstance().displayImage(data.getSite_logo(), icon, BaseApp
.getDisplayImageOptions(new FadeInBitmapDisplayer(1000)));
vHolder.setText(R.id.scource_sites, data.getSite_name());
}
}
| [
"931697478@qq.com"
] | 931697478@qq.com |
dde435c0f720be72adef2d7de3afb7991b558720 | 7d4131c1fae05d684acd0fe98fdb09d54c26decd | /threadModule01/src/com/itheima/newtest05/MyRunnable.java | 44a070b1601c34455e9bfea21811c13df0496aaf | [] | no_license | zhangzhuang521/iterableProject | 3902302cf89b7b685482cfe73daa007e1a74016d | 6b0cc4db4b00cf89b8dc55790292b3436c973ba2 | refs/heads/master | 2023-07-06T06:23:09.562267 | 2021-08-09T15:00:53 | 2021-08-09T15:00:54 | 394,332,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,196 | java | package com.itheima.newtest05;
//同步代码块
public class MyRunnable implements Runnable {
//定义一个车票的数量
private static int pick = 100;
//创建任意对象
// private Object object = new Object();
//重写run方法
@Override
public void run() {
while (true) {
//同步代码块
// synchronized (object) {
// if (pick <= 0) {
// break;
// } else {
// try {
// Thread.sleep(100);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// pick--;
// System.out.println(Thread.currentThread().getName() + "正在售票,还剩余" + pick + "张车票");
// }
// }
if ("窗口一".equals(Thread.currentThread().getName())) {
boolean b = synchronizedMethod();
if(b){
break;
}
}
if ("窗口二".equals(Thread.currentThread().getName())) {
synchronized (MyRunnable.class) {
if (pick <= 0) {
break;
} else {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
pick--;
System.out.println(Thread.currentThread().getName() + "正在售票,还剩余" + pick + "张车票");
}
}
}
}
}
private static synchronized boolean synchronizedMethod() {
if (pick <= 0) {
return true;
} else {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
pick--;
System.out.println(Thread.currentThread().getName() + "正在售票,还剩余" + pick + "张车票");
return false;
}
}
}
| [
"1158654165@qq.com"
] | 1158654165@qq.com |
19088798f8e39a555bbff508ad6066664a7525b2 | ce6e6df8a188b57acc7c62ec6b6d9cfad0b69e3d | /src/main/java/sgq/web/pygmalion/enums/RoleEnum.java | 5fc8b2483272f1a617e12f20dff56270b48da52d | [] | no_license | comcaptain/blog | d2c994e6c8618d2b2de9928e3586661947b1f738 | d84433f1102854904b8b86a49b9aec670d220e12 | refs/heads/master | 2021-06-19T11:47:55.295280 | 2017-04-01T12:04:16 | 2017-04-01T12:04:16 | 24,707,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | package sgq.web.pygmalion.enums;
import java.util.Arrays;
import java.util.HashSet;
public enum RoleEnum {
ADMIN(1, new PrivilegeEnum[]{PrivilegeEnum.EDIT_ARTICLE, PrivilegeEnum.DELETE_ARTICLE, PrivilegeEnum.PUBLISH_ARTICLE}),
MANAGER(2, new PrivilegeEnum[]{PrivilegeEnum.EDIT_ARTICLE, PrivilegeEnum.PUBLISH_ARTICLE}),
USER(300, new PrivilegeEnum[]{});
private final int code;
private final HashSet<PrivilegeEnum> privileges;
RoleEnum(int code, PrivilegeEnum[] privileges) {
this.code = code;
this.privileges = new HashSet<PrivilegeEnum>(Arrays.asList(privileges));
}
public boolean containsPrivilege(PrivilegeEnum testPrivilege) {
return this.privileges.contains(testPrivilege);
}
public int code() {
return this.code;
}
public int identifier() {
return this.code;
}
public static RoleEnum getEnum(int code) {
for (RoleEnum en: RoleEnum.values()) {
if (en.code == code) return en;
}
return null;
}
}
| [
"htmlcaptain@gmail.com"
] | htmlcaptain@gmail.com |
ee259640cd1bc59767970cef25e0bba8d2cc6805 | 92cf0ac960e0f090b612eeb65dbdf7d664bf9b3c | /app/src/main/java/com/example/social/Users.java | 1c805eb18a1d1b9a093add0bf869fb4eb107cc07 | [] | no_license | nikitha2/Social | 4308111724d2304b355197c4712c724190a39205 | 107f52d72e465d31311e275f07abdc2e9bd419f3 | refs/heads/master | 2023-02-24T20:38:30.925698 | 2021-01-24T01:31:23 | 2021-01-24T01:31:23 | 325,387,645 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java | package com.example.social;
import java.util.List;
public class Users {
String DISPLAY_IMAGE_URL;
String DisplayName;
String EmailID;
List<String> URL;
String Uid;
String timestamp;
public Users() {
}
public String getDISPLAY_IMAGE_URL() {
return DISPLAY_IMAGE_URL;
}
public void setDISPLAY_IMAGE_URL(String DISPLAY_IMAGE_URL) {
this.DISPLAY_IMAGE_URL = DISPLAY_IMAGE_URL;
}
public String getDisplayName() {
return DisplayName;
}
public void setDisplayName(String displayName) {
DisplayName = displayName;
}
public String getEmailID() {
return EmailID;
}
public void setEmailID(String emailID) {
EmailID = emailID;
}
public List<String> getURL() {
return URL;
}
public void setURL(List<String> URL) {
this.URL = URL;
}
public String getUid() {
return Uid;
}
public void setUid(String uid) {
Uid = uid;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
}
| [
"gullapalli.nikitha@gmail.com"
] | gullapalli.nikitha@gmail.com |
3f57bfb5beb666a42da7024e1edbc5bce5b337ad | 6b365cd9f51f0c54327136f904c03051a1589c88 | /orchis-admin/src/main/java/com/orchis/admin/validator/group/QiniuGroup.java | 0374d882dbdcfbcaea3f10f82839b319f0c4c1b4 | [] | no_license | lowzc/orchis | 017b11fa784d8970ad8f1fabfd95b6c282a87674 | cc7d147abf18f0f9806e4bf2380eccab3c78b492 | refs/heads/master | 2022-12-22T18:56:32.322638 | 2020-09-22T04:13:55 | 2020-09-22T04:13:55 | 296,620,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | /**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.orchis.admin.validator.group;
/**
* 七牛
*
* @author Mark sunlightcs@gmail.com
*/
public interface QiniuGroup {
}
| [
"huangzucheng"
] | huangzucheng |
6e6122e957ec6c6eba8162167bd8c21899d7cf23 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/tags/2.3.0/code/base/dso-spring/tests.unit/com/tctest/spring/bean/TestBean.java | 33b8cb3ee7d651544afafd19887337deb4b67f1e | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,677 | java | /*
* Copyright 2002-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tctest.spring.bean;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;
import java.util.Properties;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.util.ObjectUtils;
/**
* Simple test bean used for testing bean factories,
* AOP framework etc.
*
* @author Rod Johnson
* @since 15 April 2001
*/
public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOther, Comparable {
private String beanName;
private String country;
private BeanFactory beanFactory;
private boolean postProcessed;
private String name;
private String sex;
private int age;
private boolean jedi;
private ITestBean spouse;
private String touchy;
private String[] stringArray;
private Date date = new Date();
private Float myFloat = new Float(0.0);
private Collection friends = new LinkedList();
private Set someSet = new HashSet();
private Map someMap = new HashMap();
private List someList = new ArrayList();
private Properties someProperties = new Properties();
private INestedTestBean doctor = new NestedTestBean();
private INestedTestBean lawyer = new NestedTestBean();
private IndexedTestBean nestedIndexedBean;
private boolean destroyed = false;
private Number someNumber;
public TestBean() {
}
public TestBean(String name) {
this.name = name;
}
public TestBean(ITestBean spouse) {
this.spouse = spouse;
}
public TestBean(String name, int age) {
this.name = name;
this.age = age;
}
public void setBeanName(String beanName) {
this.beanName = beanName;
}
public String getBeanName() {
return beanName;
}
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
public BeanFactory getBeanFactory() {
return beanFactory;
}
public void setPostProcessed(boolean postProcessed) {
this.postProcessed = postProcessed;
}
public boolean isPostProcessed() {
return postProcessed;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public boolean isJedi() {
return jedi;
}
public void setJedi(boolean jedi) {
this.jedi = jedi;
}
public ITestBean getSpouse() {
return spouse;
}
public void setSpouse(ITestBean spouse) {
this.spouse = spouse;
}
public String getTouchy() {
return touchy;
}
public void setTouchy(String touchy) throws Exception {
if (touchy.indexOf('.') != -1) {
throw new Exception("Can't contain a .");
}
if (touchy.indexOf(',') != -1) {
throw new NumberFormatException("Number format exception: contains a ,");
}
this.touchy = touchy;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String[] getStringArray() {
return stringArray;
}
public void setStringArray(String[] stringArray) {
this.stringArray = stringArray;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Float getMyFloat() {
return myFloat;
}
public void setMyFloat(Float myFloat) {
this.myFloat = myFloat;
}
public Collection getFriends() {
return friends;
}
public void setFriends(Collection friends) {
this.friends = friends;
}
public Set getSomeSet() {
return someSet;
}
public void setSomeSet(Set someSet) {
this.someSet = someSet;
}
public Map getSomeMap() {
return someMap;
}
public void setSomeMap(Map someMap) {
this.someMap = someMap;
}
public List getSomeList() {
return someList;
}
public void setSomeList(List someList) {
this.someList = someList;
}
public Properties getSomeProperties() {
return someProperties;
}
public void setSomeProperties(Properties someProperties) {
this.someProperties = someProperties;
}
public INestedTestBean getDoctor() {
return doctor;
}
public INestedTestBean getLawyer() {
return lawyer;
}
public void setDoctor(INestedTestBean bean) {
doctor = bean;
}
public void setLawyer(INestedTestBean bean) {
lawyer = bean;
}
public Number getSomeNumber() {
return someNumber;
}
public void setSomeNumber(Number someNumber) {
this.someNumber = someNumber;
}
public IndexedTestBean getNestedIndexedBean() {
return nestedIndexedBean;
}
public void setNestedIndexedBean(IndexedTestBean nestedIndexedBean) {
this.nestedIndexedBean = nestedIndexedBean;
}
/**
* @see ITestBean#exceptional(Throwable)
*/
public void exceptional(Throwable t) throws Throwable {
if (t != null) {
throw t;
}
}
/**
* @see ITestBean#returnsThis()
*/
public Object returnsThis() {
return this;
}
/**
* @see IOther#absquatulate()
*/
public void absquatulate() {
}
public int haveBirthday() {
return age++;
}
public void destroy() {
this.destroyed = true;
}
public boolean wasDestroyed() {
return destroyed;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || !(other instanceof TestBean)) {
return false;
}
TestBean tb2 = (TestBean) other;
return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age);
}
public int hashCode() {
return this.age;
}
public int compareTo(Object other) {
if (this.name != null && other instanceof TestBean) {
return this.name.compareTo(((TestBean) other).getName());
}
else {
return 1;
}
}
public String toString() {
String s = "name=" + name + "; age=" + age + "; touchy=" + touchy;
s += "; spouse={" + (spouse != null ? spouse.getName() : null) + "}";
return s;
}
}
| [
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864 |
12d5b4d2d0384ae7657f1ca1875643c3c77dbffc | 677225712ade03e88236e6afa1d05cab263b3a3f | /Chapter6/src/PacTest/SquareCalculExam.java | e958b179affa4c9f76999a0b502a6b3c8f431be3 | [] | no_license | dongomdocu/Java_Source | 4f4a16281221f517524e6227900c3ee1e9fe03d4 | 37610656bf4b40911eb5f62889e903262938aa63 | refs/heads/master | 2021-04-26T07:17:18.952755 | 2018-02-13T07:34:08 | 2018-02-13T07:34:08 | 121,361,667 | 0 | 0 | null | 2018-02-13T09:13:21 | 2018-02-13T09:13:21 | null | UTF-8 | Java | false | false | 305 | java | package PacTest;
public class SquareCalculExam {
public static void main(String[] args) {
SquareCalcul calcul = new SquareCalcul();
double sq1 = calcul.areaRectangle(2);
double sq2 = calcul.areaRectangle(10.1, 20.1);
System.out.println(sq1);
System.out.println(sq2);
}
}
| [
"dongom910@gmail.com"
] | dongom910@gmail.com |
2f11b022fe5a3a0534dde276da9c5b51fb2e3186 | a03530c2d296d90b556a6d9969f230c66712d27b | /it.disco.unimib.lta.eclipse.anomalyGraph.diagram/src/it/unimib/disco/lta/eclipse/anomalyGraph/diagram/part/AnomalyGraphCreationWizard.java | e79135dd41aebd643e35f3ccc80b5aec10cd6160 | [] | no_license | lta-disco-unimib-it/BCT_TOOLSET | 991b6acc64f9518361ddbef2c67e05be94c2463f | 0eacbed65316a8fc5608161a6396d36dd89f9170 | refs/heads/master | 2020-08-24T21:06:48.610483 | 2020-02-27T08:08:57 | 2020-02-27T08:08:57 | 216,904,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,452 | java | package it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
/**
* @generated
*/
public class AnomalyGraphCreationWizard extends Wizard implements INewWizard {
/**
* @generated
*/
private IWorkbench workbench;
/**
* @generated
*/
protected IStructuredSelection selection;
/**
* @generated
*/
protected it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphCreationWizardPage diagramModelFilePage;
/**
* @generated
*/
protected Resource diagram;
/**
* @generated
*/
private boolean openNewlyCreatedDiagramEditor = true;
/**
* @generated
*/
public IWorkbench getWorkbench() {
return workbench;
}
/**
* @generated
*/
public IStructuredSelection getSelection() {
return selection;
}
/**
* @generated
*/
public final Resource getDiagram() {
return diagram;
}
/**
* @generated
*/
public final boolean isOpenNewlyCreatedDiagramEditor() {
return openNewlyCreatedDiagramEditor;
}
/**
* @generated
*/
public void setOpenNewlyCreatedDiagramEditor(
boolean openNewlyCreatedDiagramEditor) {
this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
}
/**
* @generated
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
this.selection = selection;
setWindowTitle(it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.Messages.AnomalyGraphCreationWizardTitle);
setDefaultPageImageDescriptor(it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphDiagramEditorPlugin
.getBundledImageDescriptor("icons/wizban/NewAnomalyGraphWizard.gif")); //$NON-NLS-1$
setNeedsProgressMonitor(true);
}
/**
* @generated
*/
public void addPages() {
diagramModelFilePage = new it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphCreationWizardPage(
"DiagramModelFile", getSelection(), "anomalyGraph_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
diagramModelFilePage
.setTitle(it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.Messages.AnomalyGraphCreationWizard_DiagramModelFilePageTitle);
diagramModelFilePage
.setDescription(it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.Messages.AnomalyGraphCreationWizard_DiagramModelFilePageDescription);
addPage(diagramModelFilePage);
}
/**
* @generated
*/
public boolean performFinish() {
IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
protected void execute(IProgressMonitor monitor)
throws CoreException, InterruptedException {
diagram = it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphDiagramEditorUtil
.createDiagram(diagramModelFilePage.getURI(), monitor);
if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
try {
it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphDiagramEditorUtil
.openDiagram(diagram);
} catch (PartInitException e) {
ErrorDialog
.openError(
getContainer().getShell(),
it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.Messages.AnomalyGraphCreationWizardOpenEditorError,
null, e.getStatus());
}
}
}
};
try {
getContainer().run(false, true, op);
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof CoreException) {
ErrorDialog
.openError(
getContainer().getShell(),
it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.Messages.AnomalyGraphCreationWizardCreationError,
null, ((CoreException) e.getTargetException())
.getStatus());
} else {
it.unimib.disco.lta.eclipse.anomalyGraph.diagram.part.AnomalyGraphDiagramEditorPlugin
.getInstance()
.logError(
"Error creating diagram", e.getTargetException()); //$NON-NLS-1$
}
return false;
}
return diagram != null;
}
}
| [
"you@example.com"
] | you@example.com |
03ddcab9c79e8553ee1453d276c52822c2b9f8b2 | 3e4a927767ca38b2ddd78bb0412d086868c380df | /app/src/main/java/com/example/prabhat/vistara/OrdersAdapter.java | e8cd8318ddf8a44442f31db812a3f47d89d52f87 | [] | no_license | prabhatks12/Aviation_Hackathon_APP | b40261aa8eacf651387d5e02a15f3a29495cb1a1 | d4d47520f88caffcceb5ae1e93e33585a8bd82bd | refs/heads/master | 2021-09-17T09:25:22.429342 | 2018-06-29T22:17:44 | 2018-06-29T22:17:44 | 106,294,462 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,112 | java | package com.example.prabhat.vistara;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;
/**
* Created by prabhat on 07-10-2017.
*/
public class OrdersAdapter extends ArrayAdapter {
List list=new ArrayList();
Context context,cx;
static int pos;
View view;
static String p;
public OrdersAdapter( Context context, int resource) {
super(context, resource);
this.context=context;//IMPPPPPPPPPPPPPPPPPPPP
this.cx=context;
}
public void add(Orders.Editdetails object){
super.add(object);
list.add(object);
}
public int getCount(){
return list.size();
}
public Object getItem(int position){
return list.get(position);
}
public View getView(int position, View convertView, ViewGroup parent){
OrdersAdapter.ContactHolder ch;
View row;
row=convertView;
if(row==null){
LayoutInflater lf=(LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row=lf.inflate(R.layout.orderslist,parent,false);
ch=new OrdersAdapter.ContactHolder();
pos=position;
ch.name=(TextView) row.findViewById(R.id.fooditem);
ch.price=(TextView)row.findViewById(R.id.itemprice);
ch.img=(ImageView)row.findViewById(R.id.imageorder);
row.setTag(ch);
}
else{
ch=(OrdersAdapter.ContactHolder)row.getTag();
pos=position;
}
Orders.Editdetails c=(Orders.Editdetails) this.getItem(position);
ch.name.setText(c.getName());
ch.price.setText(c.getType());
Picasso.with(context).load(c.getLang()).into(ch.img);
return row;
}
static class ContactHolder{
TextView name,price;
ImageView img;
}
}
| [
"prabhat111s@gmail.com"
] | prabhat111s@gmail.com |
29df9480373cc49566d9a44bebd5dfad732c5afc | c253d1ef4ae69e6c87661575f28e6058f552c319 | /src/main/java/controllers/MainWindowController.java | be8f996a880049b547f8a41538852ac482b9afda | [] | no_license | sa-n-d/JMS_UI | e7781bb83328d3b788838dfbba408b0ce5fbd243 | 3a58cedeceeeff02033c04b742ad0a70c16e2bab | refs/heads/master | 2020-05-03T14:10:56.218727 | 2019-05-08T15:06:41 | 2019-05-08T15:06:41 | 178,670,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,707 | java | package controllers;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.stage.FileChooser;
import javafx.stage.Modality;
import javafx.stage.Stage;
import transport.JMSManager;
import parsers.Project;
import parsers.ProjectParser;
import parsers.SettingsParser;
import transport.SiebelModeler;
import utility.TreeProjectCell;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Map;
import java.util.ResourceBundle;
public class MainWindowController {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private ImageView settingsImageButton;
@FXML
private ImageView reconnectImageButton;
@FXML
private ImageView runImageButton;
@FXML
private ImageView stopImageButton;
@FXML
private ImageView newImageButton;
@FXML
private ImageView importImageButton;
@FXML
private ImageView statusImage;
@FXML
private ChoiceBox<String> serverName;
@FXML
private TextArea loggerTextArea;
@FXML
private TreeView<String> projectsTree;
@FXML
private TextArea workingTextArea;
@FXML
private TextArea responseTextArea;
@FXML
private CheckBox modelingCheckBox;
@FXML
private TabPane bindCondTabPane;
@FXML
private TableView<String> bindTableView;
@FXML
private TableView<String> condTableView;
//@FXML
//private ContextMenu projectContextMenu;
private String currentServer;
private JMSManager jmsManager;
private SiebelModeler siebelModeler;
private Project selectedProject;
private String currentRequestName;
private String selectedProjectType;
private String inputQueue;
private String outputQueue;
private String wfName;
private boolean connectionIsActive = false;
private ArrayList<Project> listOfProjects;
@FXML
void mouseEnteredMenuButton(MouseEvent event) {
Node node = (Node) event.getSource();
node.setStyle("-fx-border-color: grey; -fx-border-radius: 10;" +
" -fx-background-color: #c4ec9e; -fx-background-radius: 10;");
}
@FXML
void mouseExitedMenuButton(MouseEvent event) {
Node node = (Node) event.getSource();
node.setStyle("-fx-border-color: grey; -fx-border-radius: 10;" +
" -fx-background-color: #ecf1c8; -fx-background-radius: 10;");
}
@FXML
void runClicked() {
String xmlRequest = workingTextArea.getText();
if(selectedProject != null){
if(modelingCheckBox.isSelected()){
if(serverName.getValue() != null){
if(selectedProject.getType().equals("input")) siebelModeler.wfModeling(wfName, xmlRequest);
else loggerTextArea.appendText("Моделирование доступно для projectType = 'input'\n");
}
else loggerTextArea.appendText("Необходимо выбрать сервер для моделирования\n");
}
else {
if(connectionIsActive){
if(selectedProject.getType().equals("input")){
responseTextArea.clear();
jmsManager.sendMessage(xmlRequest, inputQueue, outputQueue);
}
else{
String dummyXML = workingTextArea.getText();
responseTextArea.clear();
jmsManager.runDummy(dummyXML, inputQueue, outputQueue);
loggerTextArea.appendText("Заглушка активирована\n");
}
}
else{
loggerTextArea.appendText("Необходимо подключиться к шине\n");
}
}
}
else {
loggerTextArea.appendText("Не выбран проект\n");
}
}
@FXML
void stopClicked(){
if(jmsManager.dummyIsActive()){
jmsManager.stopDummy();
loggerTextArea.appendText("Заглушка отключена\n");
}
}
@FXML
void importButtonClicked() {
FileChooser fileChooser = new FileChooser();
File file = fileChooser.showOpenDialog(this.importImageButton.getScene().getWindow());
if(file !=null){
Project project = ProjectParser.parseProjectFile(file.getAbsolutePath(), null);
ProjectParser.addProjectToList(project);
this.refreshProjectTree();
}
}
@FXML
void reconnectClicked() {
currentServer = serverName.getValue();
if (currentServer != null) {
if (connectionIsActive) {
jmsManager.closeCurrentConnection();
}
Map<String, String> connParam = SettingsParser.connectSettings.get(currentServer);
jmsManager.setConnection(connParam.get("hostESB"), connParam.get("portESB"),
connParam.get("channel"), connParam.get("queueManager"));
}
}
@FXML
void newProjectButtonClicked() {
Parent newProjectRoot = null;
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/fxml/newProjectView.fxml"));
loader.load();
newProjectRoot = loader.getRoot();
}
catch (IOException ex){
System.out.println("Не удалось загрузить newProjectView.fxml");
}
Stage newProjectStage = new Stage();
newProjectStage.setScene(new Scene(newProjectRoot, 550, 290));
newProjectStage.setResizable(false);
newProjectStage.initModality(Modality.WINDOW_MODAL);
newProjectStage.initOwner(newImageButton.getScene().getWindow());
newProjectStage.showAndWait();
refreshProjectTree();
}
@FXML
void settingsButtonClicked() {
Parent settingsRoot = null;
try{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/fxml/settingsView.fxml"));
loader.load();
settingsRoot = loader.getRoot();
}
catch (IOException exception){
System.out.println("Не удалось загрузить settingsView.fxml");
}
Stage settingsStage = new Stage();
settingsStage.setScene(new Scene(settingsRoot, 560, 240));
settingsStage.setResizable(false);
settingsStage.initModality(Modality.WINDOW_MODAL);
settingsStage.initOwner(settingsImageButton.getScene().getWindow());
settingsStage.showAndWait();
}
@FXML
void addBind() {
TableView table;
if(bindCondTabPane.getSelectionModel().getSelectedIndex() == 0){
table = bindTableView;
}
else table = condTableView;
ObservableList<String> row = table.getItems();
row.add("newRow");
}
@FXML
void removeBind() {
TableView table;
if(bindCondTabPane.getSelectionModel().getSelectedIndex() == 0){
table = bindTableView;
}
else table = condTableView;
ObservableList<String> row = table.getItems();
}
@FXML
void initialize() {
jmsManager = new JMSManager(this);
siebelModeler = new SiebelModeler(this);
// Распарсить файл конфига и получить параметры (static field)
SettingsParser.getConnectSettings();
ObservableList<String> choiceBoxList = FXCollections.observableArrayList();
choiceBoxList.addAll(SettingsParser.connectSettings.keySet());
serverName.setItems(choiceBoxList);
// Распарсить файл с проектами
listOfProjects = ProjectParser.parseProjectConfig();
projectsTree.setEditable(false);
projectsTree.setCellFactory(param -> new TreeProjectCell(projectsTree.getScene(), this));
this.refreshProjectTree();
projectsTree.setShowRoot(false);
projectsTree.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
if(event.getClickCount() == 2){
TreeItem<String> selectedItem = projectsTree.getSelectionModel().getSelectedItems().get(0);
if(selectedItem == null) return;
if(selectedItem.isLeaf()){
if(selectedProject != null){
String workTextContent = workingTextArea.getText();
String oldTextRequest = selectedProject.requests.get(currentRequestName);
if(!workTextContent.equals(oldTextRequest)){
selectedProject.projectIsChanged = true;
selectedProject.requests.put(currentRequestName, workTextContent);
}
}
String projectName = selectedItem.getParent().getValue();
for (Project project: listOfProjects) {
if(project.toString().equals(projectName)){
selectedProject = project;
currentRequestName = selectedItem.getValue();
selectedProjectType = project.getType();
inputQueue = project.getInputQueue();
outputQueue = project.getOutputQueue();
wfName = project.getWorkFlowName();
String xmlRequest = project.requests.get(currentRequestName);
this.workingTextArea.setText(xmlRequest);
break;
}
}
}
}
});
ContextMenu loggerContextManu = new ContextMenu();
MenuItem clearItem = new MenuItem("Clear");
loggerContextManu.getItems().add(clearItem);
clearItem.setOnAction(event -> loggerTextArea.clear());
loggerTextArea.setContextMenu(loggerContextManu);
serverName.setOnAction(event -> {
if(connectionIsActive){
jmsManager.closeCurrentConnection();
}
currentServer = serverName.getValue();
Map<String,String> connParam = SettingsParser.connectSettings.get(currentServer);
jmsManager.setConnection(connParam.get("hostESB"), connParam.get("portESB"),
connParam.get("channel"), connParam.get("queueManager"));
siebelModeler.setConnection(connParam.get("hostSiebelServer"), connParam.get("portSiebelServer"),
connParam.get("enterpriseServer"));
});
VBox.setVgrow(workingTextArea, Priority.ALWAYS);
bindTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
condTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
}
public void refreshProjectTree(){
if(listOfProjects != null){
TreeItem<String> rootItem = new TreeItem<>("PROJECTS");
for (Project project : listOfProjects) {
ImageView iconProject = new ImageView();
TreeItem<String> projectItem = new TreeItem<>(project.toString());
if(project.projectFileNotFound) {
iconProject.setImage(new Image("/graphics/icons/missing.png",15,
15,false,false));
projectItem.setGraphic(iconProject);
}
else {
if(project.getType().equals("dummy")) {
iconProject.setImage(new Image("/graphics/icons/dummy.png",15,
15,false,false));
projectItem.setGraphic(iconProject);
}
else {
iconProject.setImage(new Image("/graphics/icons/sender.png",17,
17,false,false));
projectItem.setGraphic(iconProject);
}
}
rootItem.getChildren().add(projectItem);
for(String requestName : project.requests.keySet()){
TreeItem<String> request = new TreeItem<>(requestName);
projectItem.getChildren().add(request);
}
}
projectsTree.setRoot(rootItem);
}
}
public void appendLoggerText(String text){
loggerTextArea.appendText(text);
}
public void setConnectionStatus(boolean isActive){
if(isActive){
this.connectionIsActive = true;
statusImage.setImage(new Image("/graphics/icons/connectStatusImage.png"));
this.loggerTextArea.appendText("Соединение с шиной установлено\n");
}
else {
this.connectionIsActive = false;
statusImage.setImage(new Image("/graphics/icons/disconnectStatusImage.png"));
this.loggerTextArea.appendText("Соединение с шиной разорвано\n");
}
}
public void setOutputText(String text){
this.responseTextArea.setText(text);
}
}
| [
"sandron0v@yandex.ru"
] | sandron0v@yandex.ru |
a176d8ccdec638f4ccf66faddc9d7c3b1e57d715 | 97734b7675c7bb24468c9fe4b7917540ce9a65db | /app/src/main/java/com/zhejiang/haoxiadan/ui/adapter/cart/CartListAdapter.java | e0cd3195384956a4b66ed2946e6c6ddd0961843f | [] | no_license | yangyuqi/android_hxd | 303db8bba4f4419c0792dbcfdd973e1a5165e09a | f02cb1c7c625c5f6eaa656d03a82c7459ff4a9a1 | refs/heads/master | 2020-04-13T03:47:59.651505 | 2018-12-24T03:06:34 | 2018-12-24T03:06:34 | 162,942,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,119 | java | package com.zhejiang.haoxiadan.ui.adapter.cart;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.zhejiang.haoxiadan.R;
import com.zhejiang.haoxiadan.model.common.Cart;
import com.zhejiang.haoxiadan.model.common.CartGoods;
import com.zhejiang.haoxiadan.model.common.CartGoodsStyle;
import com.zhejiang.haoxiadan.third.imageload.ImageLoaderUtil;
import com.zhejiang.haoxiadan.ui.adapter.AbsBaseAdapter;
import com.zhejiang.haoxiadan.ui.view.NoScrollListView;
import com.zhejiang.haoxiadan.util.TimeUtils;
import java.util.List;
/**
* 购物车
* Created by KK on 2017/6/7.
*/
public class CartListAdapter extends AbsBaseAdapter<Cart> {
private CartListCallBack callBack;
private boolean isEdit = false;
public interface CartListCallBack {
void onChooseChange();
void onNumChange(String cartId);
}
public CartListAdapter(Context context, List<Cart> datas) {
super(context, datas);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.listview_cart_list, null);
holder.chooseHeadCb = (CheckBox) convertView.findViewById(R.id.iv_choose_head);
holder.supplierNameTv = (TextView) convertView.findViewById(R.id.tv_supplier);
holder.goodsLV = (NoScrollListView) convertView.findViewById(R.id.lv_goods);
convertView.setTag(holder);
}else{
holder = (ViewHolder)convertView.getTag();
}
final CartGoodsListAdapter adapter = new CartGoodsListAdapter(mContext,mDatas.get(position).getCartGoodses());
holder.goodsLV.setAdapter(adapter);
holder.supplierNameTv.setText(mDatas.get(position).getSupplierName());
holder.chooseHeadCb.setChecked(mDatas.get(position).isChoose());
adapter.setEdit(isEdit);
adapter.setCallBack(new CartGoodsListAdapter.CartGoodsListCallBack() {
@Override
public void onChooseChange() {
boolean isChecked = true;
for(CartGoods cartGoods : mDatas.get(position).getCartGoodses()){
isChecked = isChecked & cartGoods.isChoose();
}
mDatas.get(position).setChoose(isChecked);
holder.chooseHeadCb.setChecked(isChecked);
if(callBack != null){
callBack.onChooseChange();
}
}
@Override
public void onNumChange(String cartId) {
if(callBack != null){
callBack.onNumChange(cartId);
}
}
});
holder.chooseHeadCb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean isChecked = holder.chooseHeadCb.isChecked();
mDatas.get(position).setChoose(isChecked);
for(CartGoods cartGoods : mDatas.get(position).getCartGoodses()){
cartGoods.setChoose(isChecked);
for(CartGoodsStyle cartGoodsStyle : cartGoods.getGoodsStyles()){
cartGoodsStyle.setChoose(isChecked);
}
}
adapter.notifyDataSetChanged();
if(callBack != null){
callBack.onChooseChange();
}
}
});
return convertView;
}
public void setEdit(boolean isEdit){
this.isEdit = isEdit;
}
public void setCallBack(CartListCallBack callBack) {
this.callBack = callBack;
}
private class ViewHolder{
CheckBox chooseHeadCb;
TextView supplierNameTv;
NoScrollListView goodsLV;
}
}
| [
"yuqi.yang@ughen.com"
] | yuqi.yang@ughen.com |
bc6671d4b2ffbba8f529c210a200acd56dd5b613 | 751a11f8af7eebf30e19472a1e0e98f4f25f94eb | /writGenerator/src/main/java/generator/po/WsAjjbxxbExample.java | 78d407bef3772d35d1c30754b7cec0e4f93153e5 | [] | no_license | Lionel233/writ-generator | 2633525574685c4c487b76517e5253a32575475b | 7c443f07aae5e15ba741fa6e0842d873eec1d5ad | refs/heads/master | 2020-12-31T00:11:39.830562 | 2017-05-14T06:22:03 | 2017-05-14T06:22:03 | 86,548,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59,902 | java | package main.java.generator.po;
import java.util.ArrayList;
import java.util.List;
public class WsAjjbxxbExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public WsAjjbxxbExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andAjxhIsNull() {
addCriterion("AJXH is null");
return (Criteria) this;
}
public Criteria andAjxhIsNotNull() {
addCriterion("AJXH is not null");
return (Criteria) this;
}
public Criteria andAjxhEqualTo(Integer value) {
addCriterion("AJXH =", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhNotEqualTo(Integer value) {
addCriterion("AJXH <>", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhGreaterThan(Integer value) {
addCriterion("AJXH >", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhGreaterThanOrEqualTo(Integer value) {
addCriterion("AJXH >=", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhLessThan(Integer value) {
addCriterion("AJXH <", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhLessThanOrEqualTo(Integer value) {
addCriterion("AJXH <=", value, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhIn(List<Integer> values) {
addCriterion("AJXH in", values, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhNotIn(List<Integer> values) {
addCriterion("AJXH not in", values, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhBetween(Integer value1, Integer value2) {
addCriterion("AJXH between", value1, value2, "ajxh");
return (Criteria) this;
}
public Criteria andAjxhNotBetween(Integer value1, Integer value2) {
addCriterion("AJXH not between", value1, value2, "ajxh");
return (Criteria) this;
}
public Criteria andAhIsNull() {
addCriterion("AH is null");
return (Criteria) this;
}
public Criteria andAhIsNotNull() {
addCriterion("AH is not null");
return (Criteria) this;
}
public Criteria andAhEqualTo(String value) {
addCriterion("AH =", value, "ah");
return (Criteria) this;
}
public Criteria andAhNotEqualTo(String value) {
addCriterion("AH <>", value, "ah");
return (Criteria) this;
}
public Criteria andAhGreaterThan(String value) {
addCriterion("AH >", value, "ah");
return (Criteria) this;
}
public Criteria andAhGreaterThanOrEqualTo(String value) {
addCriterion("AH >=", value, "ah");
return (Criteria) this;
}
public Criteria andAhLessThan(String value) {
addCriterion("AH <", value, "ah");
return (Criteria) this;
}
public Criteria andAhLessThanOrEqualTo(String value) {
addCriterion("AH <=", value, "ah");
return (Criteria) this;
}
public Criteria andAhLike(String value) {
addCriterion("AH like", value, "ah");
return (Criteria) this;
}
public Criteria andAhNotLike(String value) {
addCriterion("AH not like", value, "ah");
return (Criteria) this;
}
public Criteria andAhIn(List<String> values) {
addCriterion("AH in", values, "ah");
return (Criteria) this;
}
public Criteria andAhNotIn(List<String> values) {
addCriterion("AH not in", values, "ah");
return (Criteria) this;
}
public Criteria andAhBetween(String value1, String value2) {
addCriterion("AH between", value1, value2, "ah");
return (Criteria) this;
}
public Criteria andAhNotBetween(String value1, String value2) {
addCriterion("AH not between", value1, value2, "ah");
return (Criteria) this;
}
public Criteria andAjxzIsNull() {
addCriterion("AJXZ is null");
return (Criteria) this;
}
public Criteria andAjxzIsNotNull() {
addCriterion("AJXZ is not null");
return (Criteria) this;
}
public Criteria andAjxzEqualTo(String value) {
addCriterion("AJXZ =", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzNotEqualTo(String value) {
addCriterion("AJXZ <>", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzGreaterThan(String value) {
addCriterion("AJXZ >", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzGreaterThanOrEqualTo(String value) {
addCriterion("AJXZ >=", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzLessThan(String value) {
addCriterion("AJXZ <", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzLessThanOrEqualTo(String value) {
addCriterion("AJXZ <=", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzLike(String value) {
addCriterion("AJXZ like", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzNotLike(String value) {
addCriterion("AJXZ not like", value, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzIn(List<String> values) {
addCriterion("AJXZ in", values, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzNotIn(List<String> values) {
addCriterion("AJXZ not in", values, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzBetween(String value1, String value2) {
addCriterion("AJXZ between", value1, value2, "ajxz");
return (Criteria) this;
}
public Criteria andAjxzNotBetween(String value1, String value2) {
addCriterion("AJXZ not between", value1, value2, "ajxz");
return (Criteria) this;
}
public Criteria andSpcxIsNull() {
addCriterion("SPCX is null");
return (Criteria) this;
}
public Criteria andSpcxIsNotNull() {
addCriterion("SPCX is not null");
return (Criteria) this;
}
public Criteria andSpcxEqualTo(String value) {
addCriterion("SPCX =", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxNotEqualTo(String value) {
addCriterion("SPCX <>", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxGreaterThan(String value) {
addCriterion("SPCX >", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxGreaterThanOrEqualTo(String value) {
addCriterion("SPCX >=", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxLessThan(String value) {
addCriterion("SPCX <", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxLessThanOrEqualTo(String value) {
addCriterion("SPCX <=", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxLike(String value) {
addCriterion("SPCX like", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxNotLike(String value) {
addCriterion("SPCX not like", value, "spcx");
return (Criteria) this;
}
public Criteria andSpcxIn(List<String> values) {
addCriterion("SPCX in", values, "spcx");
return (Criteria) this;
}
public Criteria andSpcxNotIn(List<String> values) {
addCriterion("SPCX not in", values, "spcx");
return (Criteria) this;
}
public Criteria andSpcxBetween(String value1, String value2) {
addCriterion("SPCX between", value1, value2, "spcx");
return (Criteria) this;
}
public Criteria andSpcxNotBetween(String value1, String value2) {
addCriterion("SPCX not between", value1, value2, "spcx");
return (Criteria) this;
}
public Criteria andWsmcIsNull() {
addCriterion("WSMC is null");
return (Criteria) this;
}
public Criteria andWsmcIsNotNull() {
addCriterion("WSMC is not null");
return (Criteria) this;
}
public Criteria andWsmcEqualTo(String value) {
addCriterion("WSMC =", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcNotEqualTo(String value) {
addCriterion("WSMC <>", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcGreaterThan(String value) {
addCriterion("WSMC >", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcGreaterThanOrEqualTo(String value) {
addCriterion("WSMC >=", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcLessThan(String value) {
addCriterion("WSMC <", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcLessThanOrEqualTo(String value) {
addCriterion("WSMC <=", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcLike(String value) {
addCriterion("WSMC like", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcNotLike(String value) {
addCriterion("WSMC not like", value, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcIn(List<String> values) {
addCriterion("WSMC in", values, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcNotIn(List<String> values) {
addCriterion("WSMC not in", values, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcBetween(String value1, String value2) {
addCriterion("WSMC between", value1, value2, "wsmc");
return (Criteria) this;
}
public Criteria andWsmcNotBetween(String value1, String value2) {
addCriterion("WSMC not between", value1, value2, "wsmc");
return (Criteria) this;
}
public Criteria andWszlIsNull() {
addCriterion("WSZL is null");
return (Criteria) this;
}
public Criteria andWszlIsNotNull() {
addCriterion("WSZL is not null");
return (Criteria) this;
}
public Criteria andWszlEqualTo(String value) {
addCriterion("WSZL =", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlNotEqualTo(String value) {
addCriterion("WSZL <>", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlGreaterThan(String value) {
addCriterion("WSZL >", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlGreaterThanOrEqualTo(String value) {
addCriterion("WSZL >=", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlLessThan(String value) {
addCriterion("WSZL <", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlLessThanOrEqualTo(String value) {
addCriterion("WSZL <=", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlLike(String value) {
addCriterion("WSZL like", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlNotLike(String value) {
addCriterion("WSZL not like", value, "wszl");
return (Criteria) this;
}
public Criteria andWszlIn(List<String> values) {
addCriterion("WSZL in", values, "wszl");
return (Criteria) this;
}
public Criteria andWszlNotIn(List<String> values) {
addCriterion("WSZL not in", values, "wszl");
return (Criteria) this;
}
public Criteria andWszlBetween(String value1, String value2) {
addCriterion("WSZL between", value1, value2, "wszl");
return (Criteria) this;
}
public Criteria andWszlNotBetween(String value1, String value2) {
addCriterion("WSZL not between", value1, value2, "wszl");
return (Criteria) this;
}
public Criteria andWszzdwIsNull() {
addCriterion("WSZZDW is null");
return (Criteria) this;
}
public Criteria andWszzdwIsNotNull() {
addCriterion("WSZZDW is not null");
return (Criteria) this;
}
public Criteria andWszzdwEqualTo(String value) {
addCriterion("WSZZDW =", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwNotEqualTo(String value) {
addCriterion("WSZZDW <>", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwGreaterThan(String value) {
addCriterion("WSZZDW >", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwGreaterThanOrEqualTo(String value) {
addCriterion("WSZZDW >=", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwLessThan(String value) {
addCriterion("WSZZDW <", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwLessThanOrEqualTo(String value) {
addCriterion("WSZZDW <=", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwLike(String value) {
addCriterion("WSZZDW like", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwNotLike(String value) {
addCriterion("WSZZDW not like", value, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwIn(List<String> values) {
addCriterion("WSZZDW in", values, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwNotIn(List<String> values) {
addCriterion("WSZZDW not in", values, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwBetween(String value1, String value2) {
addCriterion("WSZZDW between", value1, value2, "wszzdw");
return (Criteria) this;
}
public Criteria andWszzdwNotBetween(String value1, String value2) {
addCriterion("WSZZDW not between", value1, value2, "wszzdw");
return (Criteria) this;
}
public Criteria andJbfyIsNull() {
addCriterion("JBFY is null");
return (Criteria) this;
}
public Criteria andJbfyIsNotNull() {
addCriterion("JBFY is not null");
return (Criteria) this;
}
public Criteria andJbfyEqualTo(String value) {
addCriterion("JBFY =", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyNotEqualTo(String value) {
addCriterion("JBFY <>", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyGreaterThan(String value) {
addCriterion("JBFY >", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyGreaterThanOrEqualTo(String value) {
addCriterion("JBFY >=", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyLessThan(String value) {
addCriterion("JBFY <", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyLessThanOrEqualTo(String value) {
addCriterion("JBFY <=", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyLike(String value) {
addCriterion("JBFY like", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyNotLike(String value) {
addCriterion("JBFY not like", value, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyIn(List<String> values) {
addCriterion("JBFY in", values, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyNotIn(List<String> values) {
addCriterion("JBFY not in", values, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyBetween(String value1, String value2) {
addCriterion("JBFY between", value1, value2, "jbfy");
return (Criteria) this;
}
public Criteria andJbfyNotBetween(String value1, String value2) {
addCriterion("JBFY not between", value1, value2, "jbfy");
return (Criteria) this;
}
public Criteria andFyjbIsNull() {
addCriterion("FYJB is null");
return (Criteria) this;
}
public Criteria andFyjbIsNotNull() {
addCriterion("FYJB is not null");
return (Criteria) this;
}
public Criteria andFyjbEqualTo(String value) {
addCriterion("FYJB =", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbNotEqualTo(String value) {
addCriterion("FYJB <>", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbGreaterThan(String value) {
addCriterion("FYJB >", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbGreaterThanOrEqualTo(String value) {
addCriterion("FYJB >=", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbLessThan(String value) {
addCriterion("FYJB <", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbLessThanOrEqualTo(String value) {
addCriterion("FYJB <=", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbLike(String value) {
addCriterion("FYJB like", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbNotLike(String value) {
addCriterion("FYJB not like", value, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbIn(List<String> values) {
addCriterion("FYJB in", values, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbNotIn(List<String> values) {
addCriterion("FYJB not in", values, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbBetween(String value1, String value2) {
addCriterion("FYJB between", value1, value2, "fyjb");
return (Criteria) this;
}
public Criteria andFyjbNotBetween(String value1, String value2) {
addCriterion("FYJB not between", value1, value2, "fyjb");
return (Criteria) this;
}
public Criteria andXzqhshIsNull() {
addCriterion("XZQHSH is null");
return (Criteria) this;
}
public Criteria andXzqhshIsNotNull() {
addCriterion("XZQHSH is not null");
return (Criteria) this;
}
public Criteria andXzqhshEqualTo(String value) {
addCriterion("XZQHSH =", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshNotEqualTo(String value) {
addCriterion("XZQHSH <>", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshGreaterThan(String value) {
addCriterion("XZQHSH >", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshGreaterThanOrEqualTo(String value) {
addCriterion("XZQHSH >=", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshLessThan(String value) {
addCriterion("XZQHSH <", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshLessThanOrEqualTo(String value) {
addCriterion("XZQHSH <=", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshLike(String value) {
addCriterion("XZQHSH like", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshNotLike(String value) {
addCriterion("XZQHSH not like", value, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshIn(List<String> values) {
addCriterion("XZQHSH in", values, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshNotIn(List<String> values) {
addCriterion("XZQHSH not in", values, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshBetween(String value1, String value2) {
addCriterion("XZQHSH between", value1, value2, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhshNotBetween(String value1, String value2) {
addCriterion("XZQHSH not between", value1, value2, "xzqhsh");
return (Criteria) this;
}
public Criteria andXzqhsIsNull() {
addCriterion("XZQHS is null");
return (Criteria) this;
}
public Criteria andXzqhsIsNotNull() {
addCriterion("XZQHS is not null");
return (Criteria) this;
}
public Criteria andXzqhsEqualTo(String value) {
addCriterion("XZQHS =", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsNotEqualTo(String value) {
addCriterion("XZQHS <>", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsGreaterThan(String value) {
addCriterion("XZQHS >", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsGreaterThanOrEqualTo(String value) {
addCriterion("XZQHS >=", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsLessThan(String value) {
addCriterion("XZQHS <", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsLessThanOrEqualTo(String value) {
addCriterion("XZQHS <=", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsLike(String value) {
addCriterion("XZQHS like", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsNotLike(String value) {
addCriterion("XZQHS not like", value, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsIn(List<String> values) {
addCriterion("XZQHS in", values, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsNotIn(List<String> values) {
addCriterion("XZQHS not in", values, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsBetween(String value1, String value2) {
addCriterion("XZQHS between", value1, value2, "xzqhs");
return (Criteria) this;
}
public Criteria andXzqhsNotBetween(String value1, String value2) {
addCriterion("XZQHS not between", value1, value2, "xzqhs");
return (Criteria) this;
}
public Criteria andLandIsNull() {
addCriterion("LAND is null");
return (Criteria) this;
}
public Criteria andLandIsNotNull() {
addCriterion("LAND is not null");
return (Criteria) this;
}
public Criteria andLandEqualTo(String value) {
addCriterion("LAND =", value, "land");
return (Criteria) this;
}
public Criteria andLandNotEqualTo(String value) {
addCriterion("LAND <>", value, "land");
return (Criteria) this;
}
public Criteria andLandGreaterThan(String value) {
addCriterion("LAND >", value, "land");
return (Criteria) this;
}
public Criteria andLandGreaterThanOrEqualTo(String value) {
addCriterion("LAND >=", value, "land");
return (Criteria) this;
}
public Criteria andLandLessThan(String value) {
addCriterion("LAND <", value, "land");
return (Criteria) this;
}
public Criteria andLandLessThanOrEqualTo(String value) {
addCriterion("LAND <=", value, "land");
return (Criteria) this;
}
public Criteria andLandLike(String value) {
addCriterion("LAND like", value, "land");
return (Criteria) this;
}
public Criteria andLandNotLike(String value) {
addCriterion("LAND not like", value, "land");
return (Criteria) this;
}
public Criteria andLandIn(List<String> values) {
addCriterion("LAND in", values, "land");
return (Criteria) this;
}
public Criteria andLandNotIn(List<String> values) {
addCriterion("LAND not in", values, "land");
return (Criteria) this;
}
public Criteria andLandBetween(String value1, String value2) {
addCriterion("LAND between", value1, value2, "land");
return (Criteria) this;
}
public Criteria andLandNotBetween(String value1, String value2) {
addCriterion("LAND not between", value1, value2, "land");
return (Criteria) this;
}
public Criteria andTcgxqyyIsNull() {
addCriterion("TCGXQYY is null");
return (Criteria) this;
}
public Criteria andTcgxqyyIsNotNull() {
addCriterion("TCGXQYY is not null");
return (Criteria) this;
}
public Criteria andTcgxqyyEqualTo(String value) {
addCriterion("TCGXQYY =", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyNotEqualTo(String value) {
addCriterion("TCGXQYY <>", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyGreaterThan(String value) {
addCriterion("TCGXQYY >", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyGreaterThanOrEqualTo(String value) {
addCriterion("TCGXQYY >=", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyLessThan(String value) {
addCriterion("TCGXQYY <", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyLessThanOrEqualTo(String value) {
addCriterion("TCGXQYY <=", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyLike(String value) {
addCriterion("TCGXQYY like", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyNotLike(String value) {
addCriterion("TCGXQYY not like", value, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyIn(List<String> values) {
addCriterion("TCGXQYY in", values, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyNotIn(List<String> values) {
addCriterion("TCGXQYY not in", values, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyBetween(String value1, String value2) {
addCriterion("TCGXQYY between", value1, value2, "tcgxqyy");
return (Criteria) this;
}
public Criteria andTcgxqyyNotBetween(String value1, String value2) {
addCriterion("TCGXQYY not between", value1, value2, "tcgxqyy");
return (Criteria) this;
}
public Criteria andJafsIsNull() {
addCriterion("JAFS is null");
return (Criteria) this;
}
public Criteria andJafsIsNotNull() {
addCriterion("JAFS is not null");
return (Criteria) this;
}
public Criteria andJafsEqualTo(String value) {
addCriterion("JAFS =", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsNotEqualTo(String value) {
addCriterion("JAFS <>", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsGreaterThan(String value) {
addCriterion("JAFS >", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsGreaterThanOrEqualTo(String value) {
addCriterion("JAFS >=", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsLessThan(String value) {
addCriterion("JAFS <", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsLessThanOrEqualTo(String value) {
addCriterion("JAFS <=", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsLike(String value) {
addCriterion("JAFS like", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsNotLike(String value) {
addCriterion("JAFS not like", value, "jafs");
return (Criteria) this;
}
public Criteria andJafsIn(List<String> values) {
addCriterion("JAFS in", values, "jafs");
return (Criteria) this;
}
public Criteria andJafsNotIn(List<String> values) {
addCriterion("JAFS not in", values, "jafs");
return (Criteria) this;
}
public Criteria andJafsBetween(String value1, String value2) {
addCriterion("JAFS between", value1, value2, "jafs");
return (Criteria) this;
}
public Criteria andJafsNotBetween(String value1, String value2) {
addCriterion("JAFS not between", value1, value2, "jafs");
return (Criteria) this;
}
public Criteria andPjsjIsNull() {
addCriterion("PJSJ is null");
return (Criteria) this;
}
public Criteria andPjsjIsNotNull() {
addCriterion("PJSJ is not null");
return (Criteria) this;
}
public Criteria andPjsjEqualTo(String value) {
addCriterion("PJSJ =", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjNotEqualTo(String value) {
addCriterion("PJSJ <>", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjGreaterThan(String value) {
addCriterion("PJSJ >", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjGreaterThanOrEqualTo(String value) {
addCriterion("PJSJ >=", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjLessThan(String value) {
addCriterion("PJSJ <", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjLessThanOrEqualTo(String value) {
addCriterion("PJSJ <=", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjLike(String value) {
addCriterion("PJSJ like", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjNotLike(String value) {
addCriterion("PJSJ not like", value, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjIn(List<String> values) {
addCriterion("PJSJ in", values, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjNotIn(List<String> values) {
addCriterion("PJSJ not in", values, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjBetween(String value1, String value2) {
addCriterion("PJSJ between", value1, value2, "pjsj");
return (Criteria) this;
}
public Criteria andPjsjNotBetween(String value1, String value2) {
addCriterion("PJSJ not between", value1, value2, "pjsj");
return (Criteria) this;
}
public Criteria andJandIsNull() {
addCriterion("JAND is null");
return (Criteria) this;
}
public Criteria andJandIsNotNull() {
addCriterion("JAND is not null");
return (Criteria) this;
}
public Criteria andJandEqualTo(String value) {
addCriterion("JAND =", value, "jand");
return (Criteria) this;
}
public Criteria andJandNotEqualTo(String value) {
addCriterion("JAND <>", value, "jand");
return (Criteria) this;
}
public Criteria andJandGreaterThan(String value) {
addCriterion("JAND >", value, "jand");
return (Criteria) this;
}
public Criteria andJandGreaterThanOrEqualTo(String value) {
addCriterion("JAND >=", value, "jand");
return (Criteria) this;
}
public Criteria andJandLessThan(String value) {
addCriterion("JAND <", value, "jand");
return (Criteria) this;
}
public Criteria andJandLessThanOrEqualTo(String value) {
addCriterion("JAND <=", value, "jand");
return (Criteria) this;
}
public Criteria andJandLike(String value) {
addCriterion("JAND like", value, "jand");
return (Criteria) this;
}
public Criteria andJandNotLike(String value) {
addCriterion("JAND not like", value, "jand");
return (Criteria) this;
}
public Criteria andJandIn(List<String> values) {
addCriterion("JAND in", values, "jand");
return (Criteria) this;
}
public Criteria andJandNotIn(List<String> values) {
addCriterion("JAND not in", values, "jand");
return (Criteria) this;
}
public Criteria andJandBetween(String value1, String value2) {
addCriterion("JAND between", value1, value2, "jand");
return (Criteria) this;
}
public Criteria andJandNotBetween(String value1, String value2) {
addCriterion("JAND not between", value1, value2, "jand");
return (Criteria) this;
}
public Criteria andJayfIsNull() {
addCriterion("JAYF is null");
return (Criteria) this;
}
public Criteria andJayfIsNotNull() {
addCriterion("JAYF is not null");
return (Criteria) this;
}
public Criteria andJayfEqualTo(String value) {
addCriterion("JAYF =", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfNotEqualTo(String value) {
addCriterion("JAYF <>", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfGreaterThan(String value) {
addCriterion("JAYF >", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfGreaterThanOrEqualTo(String value) {
addCriterion("JAYF >=", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfLessThan(String value) {
addCriterion("JAYF <", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfLessThanOrEqualTo(String value) {
addCriterion("JAYF <=", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfLike(String value) {
addCriterion("JAYF like", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfNotLike(String value) {
addCriterion("JAYF not like", value, "jayf");
return (Criteria) this;
}
public Criteria andJayfIn(List<String> values) {
addCriterion("JAYF in", values, "jayf");
return (Criteria) this;
}
public Criteria andJayfNotIn(List<String> values) {
addCriterion("JAYF not in", values, "jayf");
return (Criteria) this;
}
public Criteria andJayfBetween(String value1, String value2) {
addCriterion("JAYF between", value1, value2, "jayf");
return (Criteria) this;
}
public Criteria andJayfNotBetween(String value1, String value2) {
addCriterion("JAYF not between", value1, value2, "jayf");
return (Criteria) this;
}
public Criteria andKsszIsNull() {
addCriterion("KSSZ is null");
return (Criteria) this;
}
public Criteria andKsszIsNotNull() {
addCriterion("KSSZ is not null");
return (Criteria) this;
}
public Criteria andKsszEqualTo(String value) {
addCriterion("KSSZ =", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszNotEqualTo(String value) {
addCriterion("KSSZ <>", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszGreaterThan(String value) {
addCriterion("KSSZ >", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszGreaterThanOrEqualTo(String value) {
addCriterion("KSSZ >=", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszLessThan(String value) {
addCriterion("KSSZ <", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszLessThanOrEqualTo(String value) {
addCriterion("KSSZ <=", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszLike(String value) {
addCriterion("KSSZ like", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszNotLike(String value) {
addCriterion("KSSZ not like", value, "kssz");
return (Criteria) this;
}
public Criteria andKsszIn(List<String> values) {
addCriterion("KSSZ in", values, "kssz");
return (Criteria) this;
}
public Criteria andKsszNotIn(List<String> values) {
addCriterion("KSSZ not in", values, "kssz");
return (Criteria) this;
}
public Criteria andKsszBetween(String value1, String value2) {
addCriterion("KSSZ between", value1, value2, "kssz");
return (Criteria) this;
}
public Criteria andKsszNotBetween(String value1, String value2) {
addCriterion("KSSZ not between", value1, value2, "kssz");
return (Criteria) this;
}
public Criteria andSsqxIsNull() {
addCriterion("SSQX is null");
return (Criteria) this;
}
public Criteria andSsqxIsNotNull() {
addCriterion("SSQX is not null");
return (Criteria) this;
}
public Criteria andSsqxEqualTo(String value) {
addCriterion("SSQX =", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxNotEqualTo(String value) {
addCriterion("SSQX <>", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxGreaterThan(String value) {
addCriterion("SSQX >", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxGreaterThanOrEqualTo(String value) {
addCriterion("SSQX >=", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxLessThan(String value) {
addCriterion("SSQX <", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxLessThanOrEqualTo(String value) {
addCriterion("SSQX <=", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxLike(String value) {
addCriterion("SSQX like", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxNotLike(String value) {
addCriterion("SSQX not like", value, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxIn(List<String> values) {
addCriterion("SSQX in", values, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxNotIn(List<String> values) {
addCriterion("SSQX not in", values, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxBetween(String value1, String value2) {
addCriterion("SSQX between", value1, value2, "ssqx");
return (Criteria) this;
}
public Criteria andSsqxNotBetween(String value1, String value2) {
addCriterion("SSQX not between", value1, value2, "ssqx");
return (Criteria) this;
}
public Criteria andSstjclIsNull() {
addCriterion("SSTJCL is null");
return (Criteria) this;
}
public Criteria andSstjclIsNotNull() {
addCriterion("SSTJCL is not null");
return (Criteria) this;
}
public Criteria andSstjclEqualTo(String value) {
addCriterion("SSTJCL =", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclNotEqualTo(String value) {
addCriterion("SSTJCL <>", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclGreaterThan(String value) {
addCriterion("SSTJCL >", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclGreaterThanOrEqualTo(String value) {
addCriterion("SSTJCL >=", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclLessThan(String value) {
addCriterion("SSTJCL <", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclLessThanOrEqualTo(String value) {
addCriterion("SSTJCL <=", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclLike(String value) {
addCriterion("SSTJCL like", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclNotLike(String value) {
addCriterion("SSTJCL not like", value, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclIn(List<String> values) {
addCriterion("SSTJCL in", values, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclNotIn(List<String> values) {
addCriterion("SSTJCL not in", values, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclBetween(String value1, String value2) {
addCriterion("SSTJCL between", value1, value2, "sstjcl");
return (Criteria) this;
}
public Criteria andSstjclNotBetween(String value1, String value2) {
addCriterion("SSTJCL not between", value1, value2, "sstjcl");
return (Criteria) this;
}
public Criteria andSffhcsIsNull() {
addCriterion("SFFHCS is null");
return (Criteria) this;
}
public Criteria andSffhcsIsNotNull() {
addCriterion("SFFHCS is not null");
return (Criteria) this;
}
public Criteria andSffhcsEqualTo(String value) {
addCriterion("SFFHCS =", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsNotEqualTo(String value) {
addCriterion("SFFHCS <>", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsGreaterThan(String value) {
addCriterion("SFFHCS >", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsGreaterThanOrEqualTo(String value) {
addCriterion("SFFHCS >=", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsLessThan(String value) {
addCriterion("SFFHCS <", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsLessThanOrEqualTo(String value) {
addCriterion("SFFHCS <=", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsLike(String value) {
addCriterion("SFFHCS like", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsNotLike(String value) {
addCriterion("SFFHCS not like", value, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsIn(List<String> values) {
addCriterion("SFFHCS in", values, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsNotIn(List<String> values) {
addCriterion("SFFHCS not in", values, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsBetween(String value1, String value2) {
addCriterion("SFFHCS between", value1, value2, "sffhcs");
return (Criteria) this;
}
public Criteria andSffhcsNotBetween(String value1, String value2) {
addCriterion("SFFHCS not between", value1, value2, "sffhcs");
return (Criteria) this;
}
public Criteria andFhcsyyIsNull() {
addCriterion("FHCSYY is null");
return (Criteria) this;
}
public Criteria andFhcsyyIsNotNull() {
addCriterion("FHCSYY is not null");
return (Criteria) this;
}
public Criteria andFhcsyyEqualTo(String value) {
addCriterion("FHCSYY =", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyNotEqualTo(String value) {
addCriterion("FHCSYY <>", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyGreaterThan(String value) {
addCriterion("FHCSYY >", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyGreaterThanOrEqualTo(String value) {
addCriterion("FHCSYY >=", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyLessThan(String value) {
addCriterion("FHCSYY <", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyLessThanOrEqualTo(String value) {
addCriterion("FHCSYY <=", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyLike(String value) {
addCriterion("FHCSYY like", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyNotLike(String value) {
addCriterion("FHCSYY not like", value, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyIn(List<String> values) {
addCriterion("FHCSYY in", values, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyNotIn(List<String> values) {
addCriterion("FHCSYY not in", values, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyBetween(String value1, String value2) {
addCriterion("FHCSYY between", value1, value2, "fhcsyy");
return (Criteria) this;
}
public Criteria andFhcsyyNotBetween(String value1, String value2) {
addCriterion("FHCSYY not between", value1, value2, "fhcsyy");
return (Criteria) this;
}
public Criteria andJazbdIsNull() {
addCriterion("JAZBD is null");
return (Criteria) this;
}
public Criteria andJazbdIsNotNull() {
addCriterion("JAZBD is not null");
return (Criteria) this;
}
public Criteria andJazbdEqualTo(String value) {
addCriterion("JAZBD =", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdNotEqualTo(String value) {
addCriterion("JAZBD <>", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdGreaterThan(String value) {
addCriterion("JAZBD >", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdGreaterThanOrEqualTo(String value) {
addCriterion("JAZBD >=", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdLessThan(String value) {
addCriterion("JAZBD <", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdLessThanOrEqualTo(String value) {
addCriterion("JAZBD <=", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdLike(String value) {
addCriterion("JAZBD like", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdNotLike(String value) {
addCriterion("JAZBD not like", value, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdIn(List<String> values) {
addCriterion("JAZBD in", values, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdNotIn(List<String> values) {
addCriterion("JAZBD not in", values, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdBetween(String value1, String value2) {
addCriterion("JAZBD between", value1, value2, "jazbd");
return (Criteria) this;
}
public Criteria andJazbdNotBetween(String value1, String value2) {
addCriterion("JAZBD not between", value1, value2, "jazbd");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ws_ajjbxxb
*
* @mbg.generated do_not_delete_during_merge Thu Apr 20 16:55:49 CST 2017
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ws_ajjbxxb
*
* @mbg.generated Thu Apr 20 16:55:49 CST 2017
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"1358313967@qq.com"
] | 1358313967@qq.com |
cbe59a42870096b060a0471d561fb018d5c2fad9 | f08b27af962807d8e4c0df0e383576dee0afca5b | /src/main/java/com/achanzhang/multiThread/demo03/sleep/MyThread.java | 7769a64878944627421b97f09db4626476765cf5 | [] | no_license | AchanZhang/test_for_practice | 040860674ee4a0dbe210286c0833311a53d4bca6 | 2594bdffa3196a938456e9aff22ef8edc1891f93 | refs/heads/master | 2023-06-23T23:00:45.041662 | 2022-05-24T13:40:48 | 2022-05-24T13:40:48 | 221,138,471 | 0 | 0 | null | 2023-06-14T22:32:48 | 2019-11-12T05:38:34 | Java | UTF-8 | Java | false | false | 350 | java | package com.achanzhang.multiThread.demo03.sleep;
public class MyThread extends Thread{
@Override
public void run() {
// String name = getName();
// System.out.println(name);
Thread t = Thread.currentThread();
System.out.println(t);
String name = t.getName();
System.out.println(name);
}
}
| [
"zhangyuchuan@evercreative.com.cn"
] | zhangyuchuan@evercreative.com.cn |
9a8f435d16996d93db8abc82f98a3236073e52dc | 952789d549bf98b84ffc02cb895f38c95b85e12c | /V_1.x/tag/SpagoBI-1.7(20060201)/SpagoBIProject/src/it/eng/spagobi/bo/dao/IEngineDAO.java | 6b25be42003dc8bfab9b854008f36b42b5cc5459 | [] | no_license | emtee40/testingazuan | de6342378258fcd4e7cbb3133bb7eed0ebfebeee | f3bd91014e1b43f2538194a5eb4e92081d2ac3ae | refs/heads/master | 2020-03-26T08:42:50.873491 | 2015-01-09T16:17:08 | 2015-01-09T16:17:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,632 | java | /**
SpagoBI - The Business Intelligence Free Platform
Copyright (C) 2005 Engineering Ingegneria Informatica S.p.A.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**/
/*
* Created on 13-mag-2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package it.eng.spagobi.bo.dao;
import it.eng.spago.error.EMFUserError;
import it.eng.spagobi.bo.Engine;
import java.util.List;
/**
* Defines the interfaces for all methods needed to insert, modify and deleting an engine.
*
* @author Zoppello
*/
public interface IEngineDAO {
/**
* Loads all detail information for an engine identified by its <code>engineID</code>. All these information,
* achived by a query to the DB, are stored into an <code>engine</code> object, which is
* returned.
*
* @param engineID The id for the engine to load
* @return An <code>engine</code> object containing all loaded information
* @throws EMFUserError If an Exception occurred
*/
public Engine loadEngineByID(Integer engineID) throws EMFUserError;
/**
* Loads all detail information for all engines. For each of them, detail
* information is stored into an <code>engine</code> object. After that, all engines
* are stored into a <code>List</code>, which is returned.
*
* @return A list containing all engine objects
* @throws EMFUserError If an Exception occurred
*/
public List loadAllEngines() throws EMFUserError;
/**
* Implements the query to modify an engine. All information needed is stored
* into the input <code>engine</code> object.
*
* @param aEngine The object containing all modify information
* @throws EMFUserError If an Exception occurred
*/
public void modifyEngine(Engine aEngine) throws EMFUserError;
/**
* Implements the query to insert an engine. All information needed is stored
* into the input <code>engine</code> object.
*
* @param aEngine The object containing all insert information
* @throws EMFUserError If an Exception occurred
*/
public void insertEngine(Engine aEngine) throws EMFUserError;
/**
* Implements the query to erase an engine. All information needed is stored
* into the input <code>engine</code> object.
*
* @param aEngine The object containing all delete information
* @throws EMFUserError If an Exception occurred
*/
public void eraseEngine(Engine aEngine) throws EMFUserError;
/**
* Tells if an engine is associated to any
* BI Object. It is useful because an engine cannot be deleted
* if it is used by one or more BI Objects.
*
* @param engineId The engine identifier
* @return True if the engine is used by one or more
* objects, else false
* @throws EMFUserError If any exception occurred
*/
public boolean hasBIObjAssociated (String engineId) throws EMFUserError;
} | [
"fiscato@99afaf0d-6903-0410-885a-c66a8bbb5f81"
] | fiscato@99afaf0d-6903-0410-885a-c66a8bbb5f81 |
38d4b73f27f99ee5d77fdf0aab1904788c6b096e | 4dc42bd9a88c6ca061957802338fe4df0b455bbd | /src/view/PopUpMenu.java | d13fabc01a0d6cf42186d7c7c9fa49a31d81ed80 | [] | no_license | djidji233/DSW2018 | 76928cdb2997b0baa7eba2be4787e7135eebc8d4 | ad31b2a4799b987961dcf28e21f90e1c669b9846 | refs/heads/master | 2022-05-28T18:45:25.742336 | 2020-05-01T01:36:33 | 2020-05-01T01:36:33 | 260,353,634 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package view;
import javax.swing.JPopupMenu;
import app.MainFrame;
public class PopUpMenu extends JPopupMenu{
public PopUpMenu() {
add(MainFrame.getInstance().getActionManager().getNewAction());
addSeparator();
add(MainFrame.getInstance().getActionManager().getDeleteAction());
addSeparator();
add(MainFrame.getInstance().getActionManager().getSaveAction());
addSeparator();
add(MainFrame.getInstance().getActionManager().getSaveAsAction());
addSeparator();
add(MainFrame.getInstance().getActionManager().getCopyAction());
add(MainFrame.getInstance().getActionManager().getCutAction());
add(MainFrame.getInstance().getActionManager().getPasteAction());
addSeparator();
add(MainFrame.getInstance().getActionManager().getUndoAction());
add(MainFrame.getInstance().getActionManager().getRedoAction());
}
}
| [
"djolezile@gmail.com"
] | djolezile@gmail.com |
aafb8897daa84c7f74f25aed5e33e3eb8765a8ee | eca3302f30ca2ab99c7077619a3264a6b5ff6c3b | /Redis常用技术/src/transaction/TransactionTest.java | 28f1654c03adf5871506e2f870db46216a120e61 | [] | no_license | KronosOceanus/Spring | bac87731224e0a8fe9cd7b224e88a3e36a2e019e | 5d292aca5d4bec8ced4bd6b4af101bf1687c2336 | refs/heads/master | 2020-06-19T11:20:27.132175 | 2019-10-27T06:36:17 | 2019-10-27T06:36:17 | 196,690,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,079 | java | package transaction;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SessionCallback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.Pipeline;
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class TransactionTest {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private JedisPoolConfig poolConfig;
//事务
@Test
public void demo01(){
//不用理会泛型警告
SessionCallback callback = (SessionCallback) (RedisOperations ops) -> {
// multi,开启事务
ops.multi();
ops.boundValueOps("key1").set("value1");
//事务过程中,命令进入队列,但没有被执行,所以 value1 为空
String value1 = (String)ops.boundValueOps("key1").get();
System.out.println(value1);
// exec,执行事务,之前的结果会以 List 形式返回,也可以直接将 List 返回到 SessionCallback
List list = ops.exec();
//事务结束后获取 value1
value1 = (String)redisTemplate.opsForValue().get("key1");
return value1;
};
String value = (String)redisTemplate.execute(callback);
System.out.println(value);
}
//流水线
@Test
public void demo02(){
//连接池获取连接
Jedis jedis = new JedisPool(poolConfig, "localhost").getResource();
long start = System.currentTimeMillis();
//开启流水线
Pipeline pipeline = jedis.pipelined();
for (int i=0;i<100000;i++){
pipeline.set("pipeline_key" + i, "pipeline_value" + i);
pipeline.get("pipeline_key" + i);
}
// pipeline.sync(),同步,但不返回结果
//同步并返回所有的结果到 List
List result = pipeline.syncAndReturnAll();
long end = System.currentTimeMillis();
System.out.println(end - start);
}
//流水线 + 事务
@Test
public void demo03(){
SessionCallback callback = (SessionCallback)(RedisOperations ops)->{
for (int i=0;i<100000;i++){
int j = i + 1;
ops.boundValueOps("pipeline_key" + j).set("pipeline_value" + j);
ops.boundValueOps("pipeline_key" + j).get();
}
return null;
};
long start = System.currentTimeMillis();
List result = redisTemplate.executePipelined(callback);
long end = System.currentTimeMillis();
System.out.println(end - start);
}
}
| [
"704690152@qq.com"
] | 704690152@qq.com |
b7e2accb4840fd41ab4320e7d6fc8ad02f466577 | c1c9c418110ac23dc07072487df2e4f4bf223f29 | /src/test/java/com/timain/web/sys/mapper/RoleMapperTest.java | 2625fbb6cf2071c74cb4b2bb6c17411acf898fc6 | [] | no_license | yyf1172719533/WMS | d319df4e384eacacec7479525a97772e7cd4d8dc | 55baab0df3f957e2fbc9470b14da6d9f6210e016 | refs/heads/master | 2022-07-04T08:16:58.040842 | 2022-03-11T01:25:26 | 2022-03-11T01:25:26 | 244,312,136 | 1 | 0 | null | 2022-06-17T02:58:37 | 2020-03-02T07:56:36 | JavaScript | UTF-8 | Java | false | false | 1,288 | java | package com.timain.web.sys.mapper;
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.util.List;
import static org.junit.Assert.*;
/**
* @author yyf
* @version 1.0
* @date 2020/2/20 12:06
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class RoleMapperTest {
@Autowired
private RoleMapper roleMapper;
@Test
@Transactional
public void deleteRolePermissionByRID() {
roleMapper.deleteRolePermissionByRID(1);
}
@Test
@Transactional
public void deleteRoleUserByRID() {
roleMapper.deleteRoleUserByRID(7);
}
@Test
public void findById() {
List<Integer> ids = roleMapper.queryRolePermissionIdsByRid(1);
ids.forEach(System.out::println);
}
@Test
@Transactional
public void deleteRoleUserByUID() {
roleMapper.deleteRoleUserByUID(4);
}
@Test
public void queryUserRoleIdsByUid() {
List<Integer> ids = roleMapper.queryUserRoleIdsByUid(3);
ids.forEach(System.out::println);
}
} | [
"yyf@qq.com"
] | yyf@qq.com |
6efd79d9756aa254e90640acf54f9e405207a8a3 | 32f4325f967446d167a51a277a9519bd76382d4e | /src/main/java/com/zelinskiyrk/store/category/exception/CategoryNotExistException.java | 8b68ccf91467410850edcac562e4715dcb61e241 | [
"MIT"
] | permissive | zelinskiyrk/fts-jb-101-store | b3370db7be6437464479e8cd4ef07b18e0c81757 | 6e98ea785bec14d9a04d78a44f8bbe995dbc7577 | refs/heads/main | 2023-02-03T09:02:38.515154 | 2020-12-24T13:36:01 | 2020-12-24T13:36:01 | 313,280,646 | 0 | 0 | MIT | 2020-12-24T13:26:38 | 2020-11-16T11:29:41 | Java | UTF-8 | Java | false | false | 112 | java | package com.zelinskiyrk.store.category.exception;
public class CategoryNotExistException extends Exception {
}
| [
"fiordi@yandex.ru"
] | fiordi@yandex.ru |
0abd7b1bc0784f5be16793839bfb7a933e802a8e | 99a17f6eb28b677e4e2088a2d9ab50afb8a64155 | /app/src/main/java/com/nuowei/smarthome/appkit/sharingdevice/MsgNoticeActivity.java | a9989c79ac58b99ac0a62eb67751f412be57e630 | [] | no_license | xiaoli1993/KKSmartHome | 4ba80ff1208bcbc5d1817087c2ad6f5bc5aff049 | 6c480619df17c5a4937928c286aceec503c4d229 | refs/heads/master | 2021-01-01T17:51:49.903587 | 2017-07-24T11:04:33 | 2017-07-24T11:04:33 | 98,181,688 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,724 | java | package com.nuowei.smarthome.appkit.sharingdevice;
import com.nuowei.smarthome.R;
import com.nuowei.smarthome.appkit.CommonModule.GosBaseActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.ListView;
import android.widget.TextView;
/**
* Created by Sunny on 2015年6月25日
*
* @author Sunny
*/
public class MsgNoticeActivity extends GosBaseActivity{
private ListView lvNotice;
private TextView tvNoNotice;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notice);
// setActionBar(true, true, R.string.msg_notice);
initView();
// initData();
}
private void initView(){
lvNotice=(ListView) findViewById(R.id.lvNotice);
tvNoNotice=(TextView) findViewById(R.id.tvNoNotice);
}
// private void initData(){
// NoticeDBService dbService= new NoticeDBService(this);
// ArrayList<NoticeBean> lsNotice=dbService.getNoticeList();
//
// if(lsNotice!=null&&lsNotice.size()>0){
// lvNotice.setVisibility(View.VISIBLE);
// tvNoNotice.setVisibility(View.GONE);
//
// NoticeAdapter na=new NoticeAdapter(this, lsNotice);
// lvNotice.setAdapter(na);
// }else{
// lvNotice.setVisibility(View.GONE);
// tvNoNotice.setVisibility(View.VISIBLE);
// }
// }
@Override
public void onResume() {
super.onResume();
// initData();
}
@Override
public void onPause() {
super.onPause();
}
public boolean onOptionsItemSelected(MenuItem menu) {
super.onOptionsItemSelected(menu);
switch (menu.getItemId()) {
case android.R.id.home:
finish();
break;
default:
break;
}
return true;
}
@Override
public void onBackPressed() {
finish();
}
}
| [
"554674787@qq.com"
] | 554674787@qq.com |
75d957aac80a9fc4f9cb8353062bb11fced5b856 | 761a7ead23425292fb58f8b6b97c3a97a641bfa4 | /code/swordOfffer/Problem13.java | f24ad15e7384fc7c91700c38edf0dd9e413f58ba | [] | no_license | wangyinghehe/CodingInterviews | 38983fd37139e56d6f87e4a9ecb8e1ce434b12e0 | a2d0e213d9b7c7cd758f219f3526ab75616bbb04 | refs/heads/master | 2021-01-01T17:08:04.132701 | 2017-08-26T16:12:26 | 2017-08-26T16:12:26 | 98,005,697 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,702 | java | package code.swordOfffer;
/**
* 题目:给定单向链表的头指针和一个结点指针,定义一个函数在 O(1)时间删除该结点。
* 思路1:需要删除某一节点i,需要获取其前一个节点,从头遍历顺序查找,需要的时间复杂度是O(n)
* 思路2:已知某一节点,则直接获取其下一节点,将其值copy覆盖指针节点,然后删除下一节点即可。O(1)
* 细节:<1>.被删除节点,没有下一个节点,需要从头遍历
* <2>.链表中只有一个节点,指针置为null
*/
public class Problem13 {
public static void main(String[] args) {
ListNode head = new ListNode();
ListNode second = new ListNode();
ListNode third = new ListNode();
head.next = second;
second.next = third;
head.data = 1;
second.data = 2;
third.data = 3;
Problem13 p13 = new Problem13();
p13.deleteNode(head, second);
System.out.println(head.next.data);
}
public void deleteNode(ListNode head, ListNode delistNode) {
if (head == null || delistNode == null) {
return;
}
if (head == delistNode) {//只有一个节点
head = null;
} else {
if (delistNode.next == null) {//为尾节点
ListNode temp = head;
while (temp.next != delistNode) {
temp = temp.next;
}
temp.next = null;//倒数第二个节点,变为尾节点
} else {
delistNode.data = delistNode.next.data;
delistNode.next = delistNode.next.next;
}
}
}
}
| [
"2293845243@qq.com"
] | 2293845243@qq.com |
7c3f3cbdc938bef38d686ac8170427a6fd84b0a4 | df9bd289d1b4217d72ab00b26466167e9c2cb66e | /Spring-core/src/spring_ex4/Car.java | bd8752dad8fe30693667b6f9344f5b37f4eb1df1 | [] | no_license | wkdalswn11/spring-ex02-20210112 | 47b89b299834fa82cd79b1948023792edba5e0d9 | 022ff8c48d43246958956591dc1841aa15387db6 | refs/heads/master | 2023-02-26T08:59:43.516780 | 2021-02-03T02:53:28 | 2021-02-03T02:53:28 | 328,834,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package spring_ex4;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class Car {
private Tire tire;
@Autowired // 버전에따라 생성자가 하나일때는 tire가 이미 bean이므로 autowired를 생략해도 된다
// 현재 우리버전은 생략가능하다
public Car(Tire tire) {
this.tire = tire;
}
public Tire getTire() {
return tire;
}
}
| [
"wkdalswn133@naver.com"
] | wkdalswn133@naver.com |
d69ea862ab98d6db8b685a0582e3b91b1612eb79 | 540f0273cff832ac21f24809cf9c922fc48487b5 | /src/main/java/org/zashev/ci/repository/ExecutionRepository.java | d94c79b4fbd82df5e1ea9eeaf66f9e5298fed78d | [] | no_license | IvayloZashev/advanced-ci | aca61c0f4d48e5b686be5aef2a540e7eec0b73c3 | ec41078cdb474af665a9e46bc13bd2a495dc5acb | refs/heads/master | 2020-03-19T04:10:53.054705 | 2018-06-02T09:02:49 | 2018-06-02T09:02:49 | 115,784,721 | 0 | 0 | null | 2018-02-12T20:30:45 | 2017-12-30T08:39:33 | Java | UTF-8 | Java | false | false | 353 | java | package org.zashev.ci.repository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.zashev.ci.model.Execution;
import java.util.List;
public interface ExecutionRepository extends PagingAndSortingRepository<Execution, Integer> {
Execution save(Execution execution);
@Override
List<Execution> findAll();
}
| [
"ivaylo_zashev@yahoo.bg"
] | ivaylo_zashev@yahoo.bg |
025b9169b62dd1dada72ba27067b38fcfdbd44e7 | 4ff64768ecd803e684b10ef680d0290001c1cbdb | /Test/ChocolateSolverTest.java | 50a40d0a84e82b29c990b2ea52a56c99f454d205 | [] | no_license | RdDvls/Web-Chocolate | cfc6b8e1e66d54f868b89bc7604fc9a09c82a2ec | 53c19a09a4e699b50164121fd7e2f5c5ae09cc05 | refs/heads/master | 2021-01-13T10:21:00.698932 | 2016-10-13T01:20:45 | 2016-10-13T01:20:45 | 68,975,543 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,690 | java | import com.tiy.ChocolateSolver;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Created by localdom on 6/3/2016.
*/
public class ChocolateSolverTest {
ChocolateSolver solver = new ChocolateSolver();
@Before
public void setUp() {
}
@Test
public void testWithEnoughSmalls() throws Exception {
assertEquals(1, solver.makeChocolate(1, 1, 6).smalls);
assertEquals(1, solver.makeChocolate(1, 1, 6).bigs);
assertTrue(solver.makeChocolate(1, 1, 6).hasSolution);
assertEquals(0, solver.makeChocolate(5, 5, 25).smalls);
assertEquals(5, solver.makeChocolate(5, 5, 25).bigs);
assertEquals(1, solver.makeChocolate(5, 5, 26).smalls);
assertEquals(5, solver.makeChocolate(5, 5, 26).bigs);
assertEquals(2, solver.makeChocolate(5, 5, 27).smalls);
assertEquals(5, solver.makeChocolate(5, 5, 27).bigs);
assertEquals(3, solver.makeChocolate(5, 5, 28).smalls);
assertEquals(5, solver.makeChocolate(5, 5, 28).bigs);
assertEquals(4, solver.makeChocolate(5, 5, 29).smalls);
assertEquals(5, solver.makeChocolate(5, 5, 29).bigs);
}
@Test
public void testNotEnough() throws Exception {
assertEquals(-1, solver.makeChocolate(1, 1, 7).smalls);
assertFalse(solver.makeChocolate(1, 1, 7).hasSolution);
assertEquals(-1, solver.makeChocolate(1, 1, 7).bigs);
assertEquals(-1, solver.makeChocolate(5, 5, 31).smalls);
assertEquals(-1, solver.makeChocolate(5, 5, 31).bigs);
}
@Test
public void testNotEnoughSmalls() throws Exception {
assertEquals(-1, solver.makeChocolate(1, 2, 8).smalls);
assertEquals(-1, solver.makeChocolate(1, 2, 8).bigs);
}
@Test
public void testOnlyWithSmalls() throws Exception {
assertEquals(6, solver.makeChocolate(10, 0, 6).smalls);
assertEquals(0, solver.makeChocolate(10, 0, 6).bigs);
}
@Test
public void testOnlyWithBigs() throws Exception {
assertEquals(0, solver.makeChocolate(0, 10, 20).smalls);
assertEquals(4, solver.makeChocolate(0, 10, 20).bigs);
}
@Test
public void testNotEnoughBigs() throws Exception {
assertEquals(-1, solver.makeChocolate(4, 1, 10).smalls);
assertFalse(solver.makeChocolate(4, 1, 10).hasSolution);
}
@Test
public void testMakeChocolateNotEnoughBigsButEnoughSmalls() throws Exception {
assertEquals(6, solver.makeChocolate(7, 2, 16).smalls);
}
@Test
public void testMakeChocolateUseLotsOfSmalls() throws Exception {
assertEquals(6, solver.makeChocolate(12, 7, 41).smalls);
}
} | [
"cjstrickland5@gmail.com"
] | cjstrickland5@gmail.com |
7b77b23218ce1d65ca7b0f65c98e946ccbf247d7 | fc0e4f453833415ff9248f1c98c74ceecd4faa05 | /android/src/main/java/com/google/samples/apps/guangdong/sync/SyncAdapter.java | ee57b7b87d9547f0c64573a566b6777a2cadc9fc | [
"Apache-2.0"
] | permissive | guangdongliang/my-iosched-master | 4e116aee21cd19b47b9e8a4b91113aa8a97a9d82 | 6023bc55e2283ff262dd40cabc6368d189d4b395 | refs/heads/master | 2021-01-11T09:03:30.295783 | 2016-12-26T08:08:15 | 2016-12-26T08:08:15 | 77,367,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,557 | java | /*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.guangdong.sync;
import android.accounts.Account;
import android.content.*;
import android.os.Bundle;
import com.google.samples.apps.guangdong.BuildConfig;
import java.util.regex.Pattern;
import static com.google.samples.apps.guangdong.util.LogUtils.*;
/**
* Sync adapter for Google I/O data. Used for download sync only. For upload sync,
*/
public class SyncAdapter extends AbstractThreadedSyncAdapter {
private static final String TAG = makeLogTag(SyncAdapter.class);
private static final Pattern sSanitizeAccountNamePattern = Pattern.compile("(.).*?(.?)@");
public static final String EXTRA_SYNC_USER_DATA_ONLY =
"com.google.samples.apps.iosched.EXTRA_SYNC_USER_DATA_ONLY";
private final Context mContext;
public SyncAdapter(Context context, boolean autoInitialize) {
super(context, autoInitialize);
mContext = context;
//noinspection ConstantConditions,PointlessBooleanExpression
if (!BuildConfig.DEBUG) {
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
LOGE(TAG, "Uncaught sync exception, suppressing UI in release build.",
throwable);
}
});
}
}
@Override
public void onPerformSync(final Account account, Bundle extras, String authority,
final ContentProviderClient provider, final SyncResult syncResult) {
final boolean uploadOnly = extras.getBoolean(ContentResolver.SYNC_EXTRAS_UPLOAD, false);
final boolean initialize = extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE, false);
final boolean userScheduleDataOnly = extras.getBoolean(EXTRA_SYNC_USER_DATA_ONLY,
false);
final String logSanitizedAccountName = sSanitizeAccountNamePattern
.matcher(account.name).replaceAll("$1...$2@");
// This Adapter is declared not to support uploading in its xml file.
// {@code ContentResolver.SYNC_EXTRAS_UPLOAD} is set by the system in some cases, but never
// by the app. Conference data only is a download sync, user schedule data sync is both
// ways and uses {@code EXTRA_SYNC_USER_DATA_ONLY}, session feedback data sync is
// upload only and isn't managed by this SyncAdapter as it doesn't need periodic sync.
if (uploadOnly) {
return;
}
LOGI(TAG, "Beginning sync for account " + logSanitizedAccountName + "," +
" uploadOnly=" + uploadOnly +
" userScheduleDataOnly =" + userScheduleDataOnly +
" initialize=" + initialize);
/** Sync from bootstrap and remote data, as needed */
new SyncHelper(mContext).performSync(syncResult, account, extras);
}
}
| [
"1242416028@qq.com"
] | 1242416028@qq.com |
67801e6a2ec2d5eb0fa26ad7a0d5b387f5c7191e | 04bfaf142c9c2aaa52dceeba7b37452a4b7fd03b | /plms/V1.0.2/src/main/java/com/vilio/plms/dynamicdatasource/CustomerContextHolder.java | 48188ba150d71963dc4a19a1d7ae9101ba226909 | [] | no_license | yanzj/hhsite | a1dd19a11a5623bcc04651dd364640767df9b335 | 603ef16f7d4d53494e4ab99cae631cfafeee3159 | refs/heads/master | 2020-04-14T04:18:35.363346 | 2018-12-31T02:18:04 | 2018-12-31T02:18:04 | 163,632,151 | 0 | 1 | null | 2018-12-31T02:16:10 | 2018-12-31T02:16:10 | null | UTF-8 | Java | false | false | 967 | java | package com.vilio.plms.dynamicdatasource;
import org.apache.commons.lang.StringUtils;
/**
* Created by dell on 2017/5/22/0022.
*/
public class CustomerContextHolder {
public static final String DATA_SOURCE_PCFS = "plmsDataSource";
public static final String DATA_SOURCE_PLMS = "plmsDataSource";
public static final String DATA_SOURCE_BMS = "bmsDataSource";
//用ThreadLocal来设置当前线程使用哪个dataSource
private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();
public static void setCustomerType(String customerType) {
contextHolder.set(customerType);
}
public static String getCustomerType() {
String dataSource = contextHolder.get();
if (StringUtils.isEmpty(dataSource)) {
return DATA_SOURCE_PCFS;
}else {
return dataSource;
}
}
public static void clearCustomerType() {
contextHolder.remove();
}
}
| [
"panda7168@163.com"
] | panda7168@163.com |
fae51739a8c89553b5ffc8464c6094ce3b9736f2 | 79345e6c579742fd69eccc34a84ad297250c8607 | /src/main/java/com/eksad/rest/entity/Cashier.java | 3c1a9ff26ea36ea40ba2666a1f0e8515f35aecdc | [] | no_license | afratiara/rest | ebf4662976aa08f30e3a800ad8aa16446d478b6f | e2d1132b722eccbb9d274204ae6cf90d5bd17544 | refs/heads/master | 2020-06-19T17:08:44.264520 | 2019-07-14T07:31:34 | 2019-07-14T07:31:34 | 196,795,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package com.eksad.rest.entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@DiscriminatorValue("Cashier") // kalo bukan cashier gabisa masuk ke sini
public class Cashier extends Person {
private String shift;
}
| [
"afratiararahmayani@yahoo.co.id"
] | afratiararahmayani@yahoo.co.id |
acd0e8b5f8cddbcd0e19338185c70f606ad18e16 | 6c3a4ca72de64bd1dbd7c5139f42282acabf8d41 | /src/main/java/run/nya/toutiao/controller/AuthController.java | 5630a90e2e1b63a518be896820d1df833b870532 | [] | no_license | HAIZAKURA/toutiao | 1603a66dedbc167aeac0a99f349e0e5b7faf3c99 | a59b821bae03d2600bcc29e02209e8f709bf5904 | refs/heads/master | 2022-11-06T05:55:56.513196 | 2020-06-24T10:31:17 | 2020-06-24T10:31:17 | 268,473,398 | 2 | 1 | null | 2020-06-15T16:53:46 | 2020-06-01T09:02:43 | Java | UTF-8 | Java | false | false | 4,443 | java | package run.nya.toutiao.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import run.nya.toutiao.model.bean.Auth;
import run.nya.toutiao.model.dao.AuthDao;
import run.nya.toutiao.utils.CheckerUtils;
import javax.servlet.http.HttpSession;
import java.util.List;
@RestController
@Api(tags = {"Auth"})
public class AuthController {
/**
* code 1 操作成功
* code 0 操作失败
* code -1 权限不足
*/
@Autowired(required = false)
private AuthDao authDao;
/**
* @api getAllAuth
* @remark 获取所有权限信息
* @access ALL
* @method GET
* @route /api/auth
* @return res JSONString
*/
@RequestMapping(value = "/api/auth", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
@ApiOperation(value = "Get All Auth Information", httpMethod = "GET", notes = "ALL")
public Object getAllAuth() {
JSONObject res = new JSONObject();
JSONObject data = new JSONObject();
try {
List<Auth> authList = authDao.getAllAuth();
res.put("code", 1);
res.put("data", authList);
} catch (Exception e) {
e.printStackTrace();
res.put("code", 0);
res.put("data", data);
}
return res.toJSONString();
}
/**
* @api getAuthBy
* @remark 获取权限信息 通过aid/aname
* @access ALL
* @method GET
* @route /api/auth/{value}
* @param value String
* @return res JSONString
*/
@RequestMapping(value = "/api/auth/{value}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
@ApiOperation(value = "Get an Auth Information By ID or Name", httpMethod = "GET", notes = "ALL")
public String getAuthBy(@PathVariable("value") String value) {
JSONObject res = new JSONObject();
JSONObject data = new JSONObject();
if (CheckerUtils.isStartNum(value)) {
try {
Auth auth = authDao.getAuthById(Integer.valueOf(value));
res.put("code", 1);
res.put("data", auth);
} catch (Exception e) {
e.printStackTrace();
res.put("code", 0);
res.put("data", data);
}
} else {
try {
Auth auth = authDao.getAuthByName(value);
res.put("code", 1);
res.put("data", auth);
} catch (Exception e) {
e.printStackTrace();
res.put("code", 0);
res.put("data", data);
}
}
return res.toJSONString();
}
/**
* @api modAuthById
* @remark 修改权限信息 通过aid
* @access Admin
* @method PUT
* @route /api/auth/{aid}
* @param aid Integer
* @param body JSONObject
* @param session HttpSession
* @return res JSONString
*/
@RequestMapping(value = "/api/auth/{aid}", method = RequestMethod.PUT, produces = "application/json;charset=UTF-8")
@ApiOperation(value = "Modify an Auth Information By ID", httpMethod = "PUT", notes = "Admin")
public String modAuthById(@PathVariable("aid") Integer aid, @RequestBody JSONObject body,
HttpSession session) {
JSONObject res = new JSONObject();
JSONObject data = new JSONObject();
Auth reqAuth = JSON.parseObject(body.toJSONString(), Auth.class);
data.put("aid", aid);
if (CheckerUtils.isAdmin(session)) {
try {
Integer back = authDao.modAuth(aid, reqAuth.getAname(), reqAuth.getAdesc());
if (back > 0) {
data.put("aname", reqAuth.getAname());
data.put("adesc", reqAuth.getAdesc());
res.put("code", 1);
} else {
res.put("code", 0);
}
} catch (Exception e) {
e.printStackTrace();
res.put("code", 0);
}
} else {
res.put("code", -1);
}
res.put("data", data);
return res.toJSONString();
}
}
| [
"hhbilly99@gmail.com"
] | hhbilly99@gmail.com |
0e64d4383a081d5f2433277d3a7c391dc16adefe | 651ae960a6ed4379c4516a189f09fc9c84d45926 | /app/src/main/java/cn/com/amome/amomeshoes/adapter/BindShoeListAdapter.java | 5ebef82f05339dc6e6b4c0be57ce0f6da4034914 | [] | no_license | dengjiaping/AmomeShoeAndroid_work | a2b3c47bbd8100f85f42af8bf9ff473d3128274e | 5e05666b72ede34044c143b7525ca24c47d34a87 | refs/heads/master | 2021-08-26T07:24:56.986652 | 2017-11-22T06:07:48 | 2017-11-22T06:07:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,668 | java | package cn.com.amome.amomeshoes.adapter;
import java.util.List;
import cn.com.amome.amomeshoes.R;
import cn.com.amome.amomeshoes.model.BleDeviceInfo;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class BindShoeListAdapter extends BaseAdapter {
private Context context;
private List<BleDeviceInfo> list;
private Handler mHandler;
@SuppressWarnings("unused")
private int index = -1;
private static final int MSG_CHANGE = 2;
private static final int MSG_LONG_CLICK = 3;
public BindShoeListAdapter(Context context, List<BleDeviceInfo> list,
Handler mHandler) {
super();
this.context = context;
this.list = list;
this.mHandler = mHandler;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = View
.inflate(context, R.layout.item_my_bindshoe, null);
holder.tv_shoe_name = (TextView) convertView
.findViewById(R.id.tv_shoe_name); // 设备名称
holder.tv_shoe_num = (TextView) convertView
.findViewById(R.id.tv_shoe_num); // 设备序号
holder.tv_bind_time = (TextView) convertView
.findViewById(R.id.tv_bind_time); // 设备绑定的时间
holder.rl_bind_shoes = (RelativeLayout) convertView
.findViewById(R.id.rl_bind_shoes); // item整体布局
holder.tv_bind_left_address = (TextView) convertView
.findViewById(R.id.tv_bind_left_address); // 左脚蓝牙地址
holder.tv_bind_right_address = (TextView) convertView
.findViewById(R.id.tv_bind_right_address); // 右脚蓝牙地址
holder.tv_shoe_select = (TextView) convertView
.findViewById(R.id.tv_shoe_select);
holder.iv_shoe_select = (ImageView) convertView
.findViewById(R.id.iv_shoe_select);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.tv_shoe_name.setText(list.get(position).name);
holder.tv_shoe_num.setText("NO." + (position + 1));
holder.tv_bind_time.setText("绑定日期:" + list.get(position).create_time);
if (list.get(position).getState().equals("1")) {
holder.iv_shoe_select.setImageResource(R.drawable.bind_shoe_select);
holder.tv_shoe_select.setText("使用中");
}
holder.tv_bind_left_address.setText("左脚地址:" + list.get(position).lble);
holder.tv_bind_right_address.setText("右脚地址:" + list.get(position).rble);
holder.rl_bind_shoes.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (list.get(position).getState().equals("1")) {
list.get(position).setState("0");
Message msg = Message.obtain();
msg.what = MSG_CHANGE;
msg.arg1 = position;
msg.arg2 = 0;
mHandler.sendMessage(msg);
} else {
for (int i = 0; i < list.size(); i++) {
list.get(i).setState("0");
}
list.get(position).setState("1");
Message msg = Message.obtain();
msg.what = MSG_CHANGE;
msg.arg1 = position;
msg.arg2 = 1;
mHandler.sendMessage(msg);
}
notifyDataSetChanged();
}
});
for (int i = 0; i < list.size(); i++) {
if (list.get(position).getState().equals("1")) {
holder.iv_shoe_select
.setImageResource(R.drawable.bind_shoe_select);
holder.tv_shoe_select.setText("使用中");
} else {
holder.iv_shoe_select
.setImageResource(R.drawable.bind_shoe_unselect);
holder.tv_shoe_select.setText("未使用");
}
}
holder.rl_bind_shoes.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
// Log.i("bindshoe", "长按");
Message msg = Message.obtain();
msg.arg1 = position;
msg.what = MSG_LONG_CLICK;
mHandler.sendMessage(msg);
return true;
}
});
return convertView;
}
class ViewHolder {
TextView tv_shoe_name, tv_shoe_num, tv_bind_time, tv_bind_left_address,
tv_bind_right_address, tv_shoe_select;
ImageView iv_shoe_select;
RelativeLayout rl_bind_shoes;
}
}
| [
"sam.912@qq.com"
] | sam.912@qq.com |
a46b06f06bef55ffb53e73c5f3cf397f7d5168b8 | b51f017685d4582361172fefa8b1a07414a8dce2 | /trunk/Java/BigFatFileTransfer/src/file-uploader/src/main/java/org/vikulin/runtime/Configuration.java | bafb5c5b361c9c76ce18b5653f4f96e666e5ef4b | [] | no_license | hastapasta/financereport | 5cb48993c5923af3eddb08605d0b06bfe84ddfa5 | 853a8b8d42563d8c9d44693cda9b8fb79aa61508 | refs/heads/master | 2021-01-10T11:38:03.548297 | 2015-12-27T17:18:18 | 2015-12-27T17:18:18 | 48,634,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,383 | java | package org.vikulin.runtime;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.log4j.Logger;
public class Configuration {
private static final Logger log = Logger.getLogger(Configuration.class);
private PropertiesConfiguration configuration;
private String serverFileDirectory;
private int serverPort;
private String serverHost;
private int chunkSize;
private static boolean client = false;
public static void setIsClient(boolean client) {
Configuration.client = client;
}
private static Configuration _instance = null;
private Configuration() {
}
public static synchronized Configuration getInstance() {
if (_instance == null) {
_instance = new Configuration();
_instance.readConfiguration();
}
return _instance;
}
public void readConfiguration() {
System.out.println("here 1");
configuration = new PropertiesConfiguration();
System.out.println("here 2");
URL config = null;
try {
String strConfFile = System.getProperty( "service.conffile" );
if (Configuration.client == false)
{
System.out.println("Using serverconf.properties");
if (strConfFile == null)
{
config = new URL("file:../conf/serverconf.properties");
}
else
{
config = new URL("file:" + strConfFile + "/serverconf.properties");
}
}
else
{
System.out.println("Using clientconf.properties");
if (strConfFile == null)
{
config = new URL("file:../conf/clientconf.properties");
}
else
{
config = new URL("file:" + strConfFile + "/clientconf.properties");
}
}
} catch (MalformedURLException e2) {
e2.printStackTrace();
}
configuration.setDelimiterParsingDisabled(true);
log.info("---------------------- Server info ----------------------");
try {
configuration.load(config);
log.info(String.format("Properties file %s", config.toString()));
} catch (Exception e1) {
if (config == null) {
config = Configuration.class.getClassLoader().getResource(
"conf.properties");
}
try {
configuration.load(config);
} catch (ConfigurationException e) {
e.printStackTrace();
}
log.info(String.format("Properties file %s", config.toString()));
}
serverFileDirectory = configuration.getString("file.dir",
System.getProperty("java.io.tmpdir"));
log.info("File dir = " + getFileDirectory());
serverPort = configuration.getInt("server.port");
log.info("Server port = " + serverPort);
serverHost = configuration.getString("server.host", "localhost");
log.info("Server host = " + serverHost);
chunkSize = configuration.getInt("chunk.size");
log.info("Chunk size = " + chunkSize);
log.info("---------------------------------------------------------");
}
public String getFileDirectory() {
return (serverFileDirectory.endsWith("\\") ? serverFileDirectory
.substring(0, serverFileDirectory.length() - 1)
: serverFileDirectory);
}
public int getServerPort() {
return serverPort;
}
public String getServerHost() {
return serverHost;
}
public int getChunkSize() {
return chunkSize;
}
}
| [
"hastapasta99@d2ea8a1b-09b1-a710-b10d-4e27fa839f9d"
] | hastapasta99@d2ea8a1b-09b1-a710-b10d-4e27fa839f9d |
93c415645b85e4cf55abafc5e2fb1ce26e154cf9 | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE191_Integer_Underflow/CWE191_Integer_Underflow__fromDB_subtract_05.java | 27bf5c2820d7a87776e68999ca645e83ac0b5ad6 | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,595 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__fromDB_subtract_05.java
Label Definition File: CWE191_Integer_Underflow.label.xml
Template File: sources-sinks-05.tmpl.java
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: fromDB Read data from a database connection
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: subtract
* GoodSink: Ensure there will not be an underflow before performing the subtraction
* BadSink : Unchecked subtraction can lead to underflow
* Flow Variant: 05 Control flow: if(private_t) and if(private_f)
*
* */
package testcases.CWE191_Integer_Underflow;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.logging.Logger;
import java.security.SecureRandom;
public class CWE191_Integer_Underflow__fromDB_subtract_05 extends AbstractTestCase
{
/* The two variables below are not defined as "final", but are never
assigned any other value, so a tool should be able to identify that
reads of these will always return their initialized values. */
private boolean private_t = true;
private boolean private_f = false;
public void bad() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
Logger log_bad = Logger.getLogger("local-logger");
/* init data */
data = -1;
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
String s_data = rs.getString(1);
data = Integer.parseInt(s_data.trim());
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
catch( NumberFormatException nfe )
{
log_bad.warning("Error with number parsing");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
/* POTENTIAL FLAW: if (data-valueToSub) < MIN_VALUE this will underflow */
int result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
int result = 0;
/* FIX: Add a check to prevent an underflow from occurring */
if (data >= (Integer.MIN_VALUE+valueToSub))
{
result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
IO.writeLine("Input value is too small to perform subtraction.");
}
}
}
/* goodG2B1() - use goodsource and badsink by changing first private_t to private_f */
private void goodG2B1() throws Throwable
{
int data;
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_f)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
Logger log_bad = Logger.getLogger("local-logger");
/* init data */
data = -1;
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
String s_data = rs.getString(1);
data = Integer.parseInt(s_data.trim());
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
catch( NumberFormatException nfe )
{
log_bad.warning("Error with number parsing");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
}
else {
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
/* POTENTIAL FLAW: if (data-valueToSub) < MIN_VALUE this will underflow */
int result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
int result = 0;
/* FIX: Add a check to prevent an underflow from occurring */
if (data >= (Integer.MIN_VALUE+valueToSub))
{
result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
IO.writeLine("Input value is too small to perform subtraction.");
}
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
Logger log_bad = Logger.getLogger("local-logger");
/* init data */
data = -1;
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
String s_data = rs.getString(1);
data = Integer.parseInt(s_data.trim());
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
catch( NumberFormatException nfe )
{
log_bad.warning("Error with number parsing");
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
/* POTENTIAL FLAW: if (data-valueToSub) < MIN_VALUE this will underflow */
int result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
int result = 0;
/* FIX: Add a check to prevent an underflow from occurring */
if (data >= (Integer.MIN_VALUE+valueToSub))
{
result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
IO.writeLine("Input value is too small to perform subtraction.");
}
}
}
/* goodB2G1() - use badsource and goodsink by changing second private_t to private_f */
private void goodB2G1() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
Logger log_bad = Logger.getLogger("local-logger");
/* init data */
data = -1;
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
String s_data = rs.getString(1);
data = Integer.parseInt(s_data.trim());
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
catch( NumberFormatException nfe )
{
log_bad.warning("Error with number parsing");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_f)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
/* POTENTIAL FLAW: if (data-valueToSub) < MIN_VALUE this will underflow */
int result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
int result = 0;
/* FIX: Add a check to prevent an underflow from occurring */
if (data >= (Integer.MIN_VALUE+valueToSub))
{
result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else {
IO.writeLine("Input value is too small to perform subtraction.");
}
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
Logger log_bad = Logger.getLogger("local-logger");
/* init data */
data = -1;
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
String s_data = rs.getString(1);
data = Integer.parseInt(s_data.trim());
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
catch( NumberFormatException nfe )
{
log_bad.warning("Error with number parsing");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_t)
{
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
int result = 0;
/* FIX: Add a check to prevent an underflow from occurring */
if (data >= (Integer.MIN_VALUE+valueToSub))
{
result = (data - valueToSub);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("Input value is too small to perform subtraction.");
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
int valueToSub = (new SecureRandom()).nextInt(99)+1; /* subtracting at least 1 */
/* POTENTIAL FLAW: if (data-valueToSub) < MIN_VALUE this will underflow */
int result = (data - valueToSub);
IO.writeLine("result: " + result);
}
}
public void good() throws Throwable
{
goodG2B1();
goodG2B2();
goodB2G1();
goodB2G2();
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
a25ecb9c423535228c77d8bd3edb4440be482d2e | 2f821f1f82b0ef87583115587b71026a6960088e | /STCsCUCMLibrary/src/com/cisco/schemas/ast/soap/CmSelectionCriteriaSIP.java | b912f515eb16e65b99d730c22b50982c162b760c | [] | no_license | STCSolutions/IPT_XMLServices | f177330574427ee96f2843b64336e26fdbf31e57 | 381001f5bf0c76bed314e119692fd89445705c3b | refs/heads/master | 2021-01-12T05:01:47.030281 | 2017-03-06T11:58:52 | 2017-03-06T11:58:52 | 77,830,943 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,749 | java | /**
* CmSelectionCriteriaSIP.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Jul 31, 2008 (10:54:19 GMT) WSDL2Java emitter.
*/
package com.cisco.schemas.ast.soap;
public class CmSelectionCriteriaSIP implements java.io.Serializable {
private org.apache.axis.types.UnsignedInt maxReturnedDevices;
private java.lang.String _class;
private org.apache.axis.types.UnsignedInt model;
private java.lang.String status;
private java.lang.String nodeName;
private java.lang.String selectBy;
private com.cisco.schemas.ast.soap.SelectItem[] selectItems;
private com.cisco.schemas.ast.soap.ProtocolType protocol;
public CmSelectionCriteriaSIP() {
}
public CmSelectionCriteriaSIP(
org.apache.axis.types.UnsignedInt maxReturnedDevices,
java.lang.String _class,
org.apache.axis.types.UnsignedInt model,
java.lang.String status,
java.lang.String nodeName,
java.lang.String selectBy,
com.cisco.schemas.ast.soap.SelectItem[] selectItems,
com.cisco.schemas.ast.soap.ProtocolType protocol) {
this.maxReturnedDevices = maxReturnedDevices;
this._class = _class;
this.model = model;
this.status = status;
this.nodeName = nodeName;
this.selectBy = selectBy;
this.selectItems = selectItems;
this.protocol = protocol;
}
/**
* Gets the maxReturnedDevices value for this CmSelectionCriteriaSIP.
*
* @return maxReturnedDevices
*/
public org.apache.axis.types.UnsignedInt getMaxReturnedDevices() {
return maxReturnedDevices;
}
/**
* Sets the maxReturnedDevices value for this CmSelectionCriteriaSIP.
*
* @param maxReturnedDevices
*/
public void setMaxReturnedDevices(org.apache.axis.types.UnsignedInt maxReturnedDevices) {
this.maxReturnedDevices = maxReturnedDevices;
}
/**
* Gets the _class value for this CmSelectionCriteriaSIP.
*
* @return _class
*/
public java.lang.String get_class() {
return _class;
}
/**
* Sets the _class value for this CmSelectionCriteriaSIP.
*
* @param _class
*/
public void set_class(java.lang.String _class) {
this._class = _class;
}
/**
* Gets the model value for this CmSelectionCriteriaSIP.
*
* @return model
*/
public org.apache.axis.types.UnsignedInt getModel() {
return model;
}
/**
* Sets the model value for this CmSelectionCriteriaSIP.
*
* @param model
*/
public void setModel(org.apache.axis.types.UnsignedInt model) {
this.model = model;
}
/**
* Gets the status value for this CmSelectionCriteriaSIP.
*
* @return status
*/
public java.lang.String getStatus() {
return status;
}
/**
* Sets the status value for this CmSelectionCriteriaSIP.
*
* @param status
*/
public void setStatus(java.lang.String status) {
this.status = status;
}
/**
* Gets the nodeName value for this CmSelectionCriteriaSIP.
*
* @return nodeName
*/
public java.lang.String getNodeName() {
return nodeName;
}
/**
* Sets the nodeName value for this CmSelectionCriteriaSIP.
*
* @param nodeName
*/
public void setNodeName(java.lang.String nodeName) {
this.nodeName = nodeName;
}
/**
* Gets the selectBy value for this CmSelectionCriteriaSIP.
*
* @return selectBy
*/
public java.lang.String getSelectBy() {
return selectBy;
}
/**
* Sets the selectBy value for this CmSelectionCriteriaSIP.
*
* @param selectBy
*/
public void setSelectBy(java.lang.String selectBy) {
this.selectBy = selectBy;
}
/**
* Gets the selectItems value for this CmSelectionCriteriaSIP.
*
* @return selectItems
*/
public com.cisco.schemas.ast.soap.SelectItem[] getSelectItems() {
return selectItems;
}
/**
* Sets the selectItems value for this CmSelectionCriteriaSIP.
*
* @param selectItems
*/
public void setSelectItems(com.cisco.schemas.ast.soap.SelectItem[] selectItems) {
this.selectItems = selectItems;
}
/**
* Gets the protocol value for this CmSelectionCriteriaSIP.
*
* @return protocol
*/
public com.cisco.schemas.ast.soap.ProtocolType getProtocol() {
return protocol;
}
/**
* Sets the protocol value for this CmSelectionCriteriaSIP.
*
* @param protocol
*/
public void setProtocol(com.cisco.schemas.ast.soap.ProtocolType protocol) {
this.protocol = protocol;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof CmSelectionCriteriaSIP)) return false;
CmSelectionCriteriaSIP other = (CmSelectionCriteriaSIP) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.maxReturnedDevices==null && other.getMaxReturnedDevices()==null) ||
(this.maxReturnedDevices!=null &&
this.maxReturnedDevices.equals(other.getMaxReturnedDevices()))) &&
((this._class==null && other.get_class()==null) ||
(this._class!=null &&
this._class.equals(other.get_class()))) &&
((this.model==null && other.getModel()==null) ||
(this.model!=null &&
this.model.equals(other.getModel()))) &&
((this.status==null && other.getStatus()==null) ||
(this.status!=null &&
this.status.equals(other.getStatus()))) &&
((this.nodeName==null && other.getNodeName()==null) ||
(this.nodeName!=null &&
this.nodeName.equals(other.getNodeName()))) &&
((this.selectBy==null && other.getSelectBy()==null) ||
(this.selectBy!=null &&
this.selectBy.equals(other.getSelectBy()))) &&
((this.selectItems==null && other.getSelectItems()==null) ||
(this.selectItems!=null &&
java.util.Arrays.equals(this.selectItems, other.getSelectItems()))) &&
((this.protocol==null && other.getProtocol()==null) ||
(this.protocol!=null &&
this.protocol.equals(other.getProtocol())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getMaxReturnedDevices() != null) {
_hashCode += getMaxReturnedDevices().hashCode();
}
if (get_class() != null) {
_hashCode += get_class().hashCode();
}
if (getModel() != null) {
_hashCode += getModel().hashCode();
}
if (getStatus() != null) {
_hashCode += getStatus().hashCode();
}
if (getNodeName() != null) {
_hashCode += getNodeName().hashCode();
}
if (getSelectBy() != null) {
_hashCode += getSelectBy().hashCode();
}
if (getSelectItems() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getSelectItems());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getSelectItems(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (getProtocol() != null) {
_hashCode += getProtocol().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(CmSelectionCriteriaSIP.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "CmSelectionCriteriaSIP"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("maxReturnedDevices");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "MaxReturnedDevices"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "unsignedInt"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("_class");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "Class"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("model");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "Model"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "unsignedInt"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("status");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "Status"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("nodeName");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "NodeName"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("selectBy");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "SelectBy"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("selectItems");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "SelectItems"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "SelectItem"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("protocol");
elemField.setXmlName(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "Protocol"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.cisco.com/ast/soap/", "ProtocolType"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"aatawfik@ENG-19865LAP.stcs.com.sa"
] | aatawfik@ENG-19865LAP.stcs.com.sa |
118e775ebe72b4985e27b807dec9cf46bcd4f75d | c3631a36e27fd96f50cb53ad3cf2b435d02c2e96 | /app/src/main/java/com/fzu/chatrobot/custom/ProgressWebView.java | e1615a518380197679b30bf36636d8985c6e7e73 | [] | no_license | yuruiyin/chatrobot | b4f514204bb7533dec030c5e12eeaf7edaca8443 | a934150076e93ee01da7e50a40d3222a00abefd1 | refs/heads/master | 2021-09-13T18:30:44.575432 | 2018-05-03T03:04:46 | 2018-05-03T03:04:46 | 110,125,174 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,509 | java | package com.fzu.chatrobot.custom;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.fzu.chatrobot.R;
/**
* 自定义包含进度条的WebView
* Created by yury on 2016/9/7.
*/
public class ProgressWebView extends WebView {
private ProgressBar mProgressBar;
public ProgressWebView(Context context, AttributeSet attrs) {
super(context, attrs);
// 新建一个水平进度条
mProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
// 指定进度条的布局,比如宽高和位置
mProgressBar.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 8, 0, 0));
// 定义进度条的样式
Drawable drawable = context.getResources().getDrawable(R.drawable.progress_bar_states);
mProgressBar.setProgressDrawable(drawable);
// 将进度条添加进webView中
addView(mProgressBar);
setWebChromeClient(new MyWebChromeClient());
setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return false; //点击其他链接依然在webView内部执行
}
});
WebSettings webSettings = getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBlockNetworkImage(false);
webSettings.setDomStorageEnabled(true);
webSettings.setLoadsImagesAutomatically(true); //支持自动加载图片
//是否支持缩放
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
}
public class MyWebChromeClient extends android.webkit.WebChromeClient {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (newProgress >= 100) {
// mProgressBar.setProgress(newProgress);
mProgressBar.setVisibility(GONE);
} else {
if (mProgressBar.getVisibility() == GONE) {
mProgressBar.setVisibility(VISIBLE);
}
mProgressBar.setProgress(newProgress);
}
}
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
LayoutParams lp = (LayoutParams) mProgressBar.getLayoutParams();
lp.x = l;
lp.y = t;
mProgressBar.setLayoutParams(lp);
super.onScrollChanged(l, t, oldl, oldt);
}
}
| [
"yuruiyin@cyou-inc.com"
] | yuruiyin@cyou-inc.com |
0d29d4d582fdc129b63d6d5404dbad3215bcf82e | 8716fca8ca8e04920300d08e29023676501b4da0 | /SIMS/src/SIMS/AdminWindow.java | abdd9ffe67d752540fb8a6adfe9acc86f7ff18bd | [] | no_license | d3faultx90/CMSC495_6980 | 1c2277e0f79ff67d733e0052123ab1dc7ecc44f4 | f30b7479c73e26e2f47efd7f65fa0295ba7333db | refs/heads/Development | 2023-07-16T19:57:44.890572 | 2021-08-10T23:44:59 | 2021-08-10T23:44:59 | 379,738,880 | 2 | 0 | null | 2021-08-01T16:07:42 | 2021-06-23T22:01:02 | Java | UTF-8 | Java | false | false | 8,288 | java | /*
* File: AdminWindow.java
* Author: Ben Sutter
* Date: July 19th, 2021
* Purpose: This is the window that the user sees when they login if they have admin permissions
*/
package SIMS;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.DefaultTableModel;
import enums.UserRole;
public class AdminWindow extends javax.swing.JFrame {
static List<List> userInfoTable = new ArrayList<List>();
String username;
// Variables declaration - do not modify
private javax.swing.JButton addUserButton;
private javax.swing.JButton editUserButton;
private javax.swing.JButton helpButton;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JButton logoutButton;
private javax.swing.JButton removeUserButton;
private javax.swing.JLabel userLabel;
private javax.swing.JTable userTable;
// End of variables declaration
protected AdminWindow(Connector connector, String username) {
Database database = new Database(connector);
this.username = username;
userInfoTable = Database.getUsersTable();
initComponents();
populateUserTable();
}
// This method was deprecated because it could not be implemented in time due to security concerns.
private void addUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
GeneralGuiFunctions.displayErrorPane("Was unable to implement in time due to security concerns");
}
// When the use presses the edit user button, grab the selected user and display their information.
private void editUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
try {
String selectedCellValue = (String) userTable.getValueAt(userTable.getSelectedRow(), 0);
String[] userInfo = new String[4];
for (List userRow : userInfoTable) {
// If the username is not the admin's username, add it to table (don't want
// admin locking themselves out)
if (selectedCellValue == userRow.get(1)) {
userInfo[0] = (String) userRow.get(1);
userInfo[1] = (String) userRow.get(2);
userInfo[2] = (String) userRow.get(3);
userInfo[3] = (String) userRow.get(4);
}
}
new EditUserWindow(userInfo).setVisible(true);
} catch (Exception e) {
GeneralGuiFunctions.displayErrorPane("Please select a user");
}
}
private void helpButtonActionPerformed(java.awt.event.ActionEvent evt) {
GeneralGuiFunctions.displayHelpPane("In this panel, you can edit current users or add a new user."
+ "\nWhy do I not show up on the list? So you don't accidentally demote yourself.");
}
private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {
GeneralGuiFunctions.closeAndOpenWindow(this, new LoginWindow());
}
// Populates the user table with the current users in the database.
private void populateUserTable() {
DefaultTableModel model = (DefaultTableModel) userTable.getModel();
for (List userRow : userInfoTable) {
// If the username is not the admin's username, add it to table (don't want admin locking themselves out)
if (!username.equals(userRow.get(1))) {
// Use the enum to show the name of their role
int permissionLevel = GeneralGuiFunctions.castObjectToInteger(userRow.get(4));
model.addRow(new Object[] { userRow.get(1), UserRole.values()[permissionLevel] });
}
}
}
// This method was deprecated because it could not be implemented in time due to security concerns.
private void removeUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
GeneralGuiFunctions.displayErrorPane("Was unable to implement in time due to security concerns");
}
private void initComponents() {
jScrollPane2 = new javax.swing.JScrollPane();
userTable = new javax.swing.JTable();
helpButton = new javax.swing.JButton();
userLabel = new javax.swing.JLabel();
editUserButton = new javax.swing.JButton();
addUserButton = new javax.swing.JButton();
removeUserButton = new javax.swing.JButton();
logoutButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("SIMS - Admin");
userTable.setModel(
new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] { "Username", "Role" }));
jScrollPane2.setViewportView(userTable);
helpButton.setBackground(new java.awt.Color(255, 255, 153));
helpButton.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N
helpButton.setForeground(new java.awt.Color(0, 0, 0));
helpButton.setText("?");
helpButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
helpButtonActionPerformed(evt);
}
});
userLabel.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
userLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
userLabel.setText("Active Users");
editUserButton.setText("View/Edit");
editUserButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
editUserButtonActionPerformed(evt);
}
});
addUserButton.setText("Add New User");
addUserButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addUserButtonActionPerformed(evt);
}
});
removeUserButton.setBackground(new java.awt.Color(153, 0, 0));
removeUserButton.setText("Remove");
removeUserButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
removeUserButtonActionPerformed(evt);
}
});
logoutButton.setText("Logout");
logoutButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
logoutButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(helpButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(logoutButton, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(removeUserButton, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(addUserButton, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
.addComponent(editUserButton, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(userLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(24, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addGap(12, 12, 12).addComponent(userLabel))
.addComponent(helpButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(editUserButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(addUserButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(removeUserButton).addGap(26, 26, 26).addComponent(logoutButton)
.addContainerGap(22, Short.MAX_VALUE)));
pack();
setLocationRelativeTo(null);
}
}
| [
"65268729+Broccolimonkey@users.noreply.github.com"
] | 65268729+Broccolimonkey@users.noreply.github.com |
91799cb78a0654d8c26f633d84b426ed8dbd5619 | c7c1c7f639e0a55715537a8eaf961e34675ac38c | /ListaApp/android/app/src/debug/java/com/listaapp/ReactNativeFlipper.java | e33a84c8335333cb167768df7746621b2a47e978 | [] | no_license | DanielLayon/React-Native- | 740c23180fcc6fec1ef9b499e075f41d56280d7a | c79391bfa088092f21d2fa0c7282faa46a7e82e7 | refs/heads/main | 2023-08-16T14:31:55.460910 | 2021-10-08T21:35:57 | 2021-10-08T21:35:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,263 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.listaapp;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"daniel.layon@outlook.com"
] | daniel.layon@outlook.com |
cb8caae47c8bb87f9332763d1194b952ce3dca3e | aa7faa8c185b08f55afcd03b89763f4b0a37a5aa | /src/main/java/edu/illinois/yasgl/DirectedGraph.java | 2e82a93d645c4adaa1fc4945685190e54431bd51 | [
"MIT"
] | permissive | TestingResearchIllinois/yasgl | 8d0ffe612ec759eaddfab3a4216d4af5cae630e5 | 62c9db8871732f97a674346867d7f826804a784a | refs/heads/master | 2021-06-22T03:13:36.419870 | 2017-07-26T22:22:59 | 2017-07-26T22:22:59 | 62,596,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,115 | java | /* The MIT License (MIT)
Copyright (c) 2016 Alex Gyori
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package edu.illinois.yasgl;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.Writer;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import java.util.stream.Collectors;
import com.google.common.collect.ImmutableMultimap;
public class DirectedGraph<V> extends AbstractGraph<V> {
private static final long serialVersionUID = -3303603645240328439L;
final ImmutableMultimap<V, V> forward;
final ImmutableMultimap<V, V> backward;
final Collection<V> vertices;
protected DirectedGraph(ImmutableMultimap<V, V> forward, Collection<V> vertices) {
this.forward = forward;
this.backward = this.forward.inverse();
this.vertices = vertices;
}
private DirectedGraph(ImmutableMultimap<V, V> forward, ImmutableMultimap<V, V> backward,
Collection<V> vertices) {
this.forward = forward;
this.backward = backward;
this.vertices = vertices;
}
@Override
public DirectedGraph<V> inverse() {
return new DirectedGraph<>(this.backward, this.forward, vertices);
}
public Collection<V> getSuccessors(V vertex) {
return this.forward.get(vertex);
}
public Collection<V> getPredecessors(V vertex) {
return this.backward.get(vertex);
}
public Collection<V> vertexSet() {
return Collections.unmodifiableCollection(this.vertices);
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (V v : vertices) {
sb.append("<");
sb.append(v);
sb.append(" -> ");
sb.append(this.forward.containsKey(v) ? this.forward.get(v) : "{}");
sb.append("\n");
}
sb.append("]");
return sb.toString();
}
@Override
public Collection<V> getVertices() {
return Collections.unmodifiableCollection(this.vertices);
}
public Collection<Edge<V>> getEdges() {
return this.forward.entries().stream()
.map(e -> new Edge<V>((V) e.getKey(), (V) e.getValue()))
.collect(Collectors.toSet());
}
public static DirectedGraph<Long> fromGiraphString(String fileName) {
DirectedGraphBuilder<Long> graphBuilder = new DirectedGraphBuilder<Long>();
try (BufferedReader br = new BufferedReader(new FileReader(fileName))) {
String sCurrentLine;
while ((sCurrentLine = br.readLine()) != null) {
long[] tokens = Arrays.stream(sCurrentLine.split("\\s+"))
.mapToLong(x -> Long.parseLong(x))
.toArray();
graphBuilder.addVertex(tokens[0]);
for (int i = 1; i < tokens.length; i++) {
graphBuilder.addEdge(tokens[0], tokens[i]);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return graphBuilder.build();
}
public static <T> DirectedGraph<T> fromGiraphString(String fileName, Map<Long, T> map) {
DirectedGraphBuilder<T> graphBuilder = new DirectedGraphBuilder<T>();
try (BufferedReader br = new BufferedReader(new FileReader(fileName))) {
String sCurrentLine;
while ((sCurrentLine = br.readLine()) != null) {
long[] tokens = Arrays.stream(sCurrentLine.split("\\s+"))
.mapToLong(x -> Long.parseLong(x))
.toArray();
graphBuilder.addVertex(map.get(tokens[0]));
for (int i = 1; i < tokens.length; i++) {
graphBuilder.addEdge(map.get(tokens[0]), map.get(tokens[i]));
}
}
} catch (IOException e) {
e.printStackTrace();
}
return graphBuilder.build();
}
}
| [
"gyori@illinois.edu"
] | gyori@illinois.edu |
9756828886d35b060e220fb8520a3299d5ca52f0 | f416510a4579dce90122ed55592245e58501b7fa | /app/src/main/java/me/unjar/beehold/Constants.java | a3488dc1b203dd74bf0161685b10f68ed45a5e21 | [
"MIT"
] | permissive | unjar/beehold-android | 67c1d823458d565ee1323a6b947e3ac5a28c7dab | fdb1af604bfaf8073fce2540a1c77a9180b8ccf4 | refs/heads/master | 2021-08-29T23:42:51.452674 | 2017-12-15T09:32:37 | 2017-12-15T09:35:42 | 112,136,512 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 187 | java | package me.unjar.beehold;
public final class Constants {
private Constants() {
}
public static final String CLOUD_VISION_API_BASE_URL = "https://vision.googleapis.com/";
}
| [
"33921467+unjar@users.noreply.github.com"
] | 33921467+unjar@users.noreply.github.com |
e0dc7f9f000fc762e37eafc1a1b0711148361270 | caca2c60c5632d480cd1c0a2c4af0088c44c2e3f | /app/src/main/java/com/kupferwerk/sample/recyclerview/gridlayout/GridLayoutActivity.java | 87c03c58c436b77ed6011f24176ea29c20acc082 | [
"Apache-2.0"
] | permissive | anne-plp/android-recyclerview-sample | a2c5155e8cde72fbefee3f7c0c83e59549a51e76 | 070376bf5c8c6116ea1fe8ecaf0550baeb9b82e8 | refs/heads/master | 2021-01-18T10:51:44.179362 | 2014-11-06T11:39:42 | 2014-11-06T11:39:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,156 | java | package com.kupferwerk.sample.recyclerview.gridlayout;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuItem;
import com.kupferwerk.sample.recyclerview.R;
import com.kupferwerk.sample.recyclerview.model.Item;
import com.kupferwerk.sample.recyclerview.adapter.StaggeredAdapter;
public class GridLayoutActivity extends Activity {
private RecyclerView recyclerView;
private RecyclerView.Adapter adapter;
private RecyclerView.LayoutManager layoutManager;
private int orientation;
private boolean reverseLayout;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_gridlayout, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.menu_orientation) {
if (orientation == GridLayoutManager.VERTICAL) {
orientation = GridLayoutManager.HORIZONTAL;
} else {
orientation = GridLayoutManager.VERTICAL;
}
initializeRecyclerView();
} else if (item.getItemId() == R.id.menu_revert) {
reverseLayout = !reverseLayout;
initializeRecyclerView();
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recyclerview);
orientation = GridLayoutManager.VERTICAL;
reverseLayout = false;
initializeRecyclerView();
}
private void initializeRecyclerView() {
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
layoutManager = new GridLayoutManager(this, 2, orientation, reverseLayout);
recyclerView.setLayoutManager(layoutManager);
// specify an adapter (see also next example)
adapter = new StaggeredAdapter(this, Item.buildDemoModel(30));
recyclerView.setAdapter(adapter);
}
}
| [
"chsc@kupferwerk.net"
] | chsc@kupferwerk.net |
9c8d14b537d7caca25422345a7a1bc180c577dde | 353d28009bade891f49034de5d4f6671744c32aa | /kodilla-testing/src/main/java/com/kodilla/testing/shape/ShapeCollector.java | 0ba0b844387f05652e83eeec7f35535f959041b5 | [] | no_license | kruzeln/Zbigniew-Jasiak-Kodilla-java | 1a1fbbce4aff1480b8b2a6caec7431afdf282f99 | cfef60217c334d4ba3a25926cd1dd3e2cf5ff6f6 | refs/heads/master | 2020-03-19T13:18:02.687220 | 2018-08-21T09:09:07 | 2018-08-21T09:09:07 | 136,572,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | package com.kodilla.testing.shape;
import java.util.ArrayList;
public class ShapeCollector {
ArrayList <Shape> figures = new ArrayList<Shape>();
public void addFig(Shape shape) {
figures.add(shape);
}
public void removeFig(Shape shape){
figures.remove(shape);
}
public Shape getFig (int n){
return figures.get(n);
}
public ArrayList<Shape> getFigures() {
return figures;
}
public void showFig(){
for(Shape figure: figures){
System.out.println(figure.getShapeName() + "field: " + figure.getField());
}
}
}
| [
"kruzeln@interia.pl"
] | kruzeln@interia.pl |
ceaf4ea784742f001de4a9138284092eafdae9e9 | c0849f19c0553113d26b7798c6a431077c548af7 | /src/main/java/ippo/assignment2/factories/ServicesFactory.java | 019489db56c4f0d144f5e52131fddfdf1758650c | [] | no_license | b136325/ippo.assignment2 | 294c167e85dd24d4fb7588c045d3f51f37ab4427 | be5da5f44be903ba5877f4c32ffbaf2bbfa63f16 | refs/heads/master | 2020-09-15T16:48:32.251715 | 2019-11-27T16:40:55 | 2019-11-27T16:40:55 | 223,506,440 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,965 | java | package ippo.assignment2.factories;
import ippo.assignment2.services.IService;
import ippo.assignment2.services.PlayersEdinburghService;
import ippo.assignment2.services.PlayersJsonService;
import ippo.assignment2.services.PlayersService;
import ippo.assignment2.properties.PropertiesSingleton;
/**
* A simple concrete factory that creates IService objects.
*
* @since 0.1.7
*/
public class ServicesFactory {
/**
* Create and return an instance of the service named 'servicesName'
*
* @param serviceName The name of the service to be returned.
* @return An instance of a service or null.
*
* @since 0.1.7
*/
public static IService createService(String serviceName) {
IService service = null;
switch(serviceName) {
case "PlayersService":
service = new PlayersService();
break;
case "PlayersEdinburghService":
service = new PlayersEdinburghService();
break;
case "PlayersJsonService":
service = new PlayersJsonService();
break;
}
return service;
}
/**
* Create and return an instance of the service named
* by the property value associated with 'propertyName'.
*
* @param properties An object of properties.
* @param propertyName The name of the property whose value represents a service.
* @return An instance of a service or null.
*
* @since 0.1.7
*/
public static IService createServiceFromProperties(PropertiesSingleton properties, String propertyName) {
String serviceClassName = null;
IService service = null;
if (properties.has(propertyName)) {
serviceClassName = properties.getValue(propertyName);
}
if (serviceClassName != null) {
service = createService(serviceClassName);
}
return service;
}
}
| [
"joe.strachan@ymail.com"
] | joe.strachan@ymail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.