blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
2cbb47157622f37a9059e07582d90045d629ed42
63152c4f60c3be964e9f4e315ae50cb35a75c555
/sql/catalyst/target/java/org/apache/spark/sql/catalyst/expressions/Round$.java
6824dca3133bf52f8fd65bd569ffd1ac00957e61
[ "EPL-1.0", "Classpath-exception-2.0", "LicenseRef-scancode-unicode", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-free-unknown", "GCC-exception-3.1", "LGPL-2.0-or-later", "CDDL-1.0", "MIT", "CC-BY-SA-3.0", "NAIST-2003", "LGPL-2.1-only", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-other-permissive", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "CPL-1.0", "CC-PDDC", "EPL-2.0", "CDDL-1.1", "BSD-2-Clause", "CC0-1.0", "Python-2.0", "LicenseRef-scancode-unknown" ]
permissive
PowersYang/spark-cn
76c407d774e35d18feb52297c68c65889a75a002
06a0459999131ee14864a69a15746c900e815a14
refs/heads/master
2022-12-11T20:18:37.376098
2020-03-30T09:48:22
2020-03-30T09:48:22
219,248,341
0
0
Apache-2.0
2022-12-05T23:46:17
2019-11-03T03:55:17
HTML
UTF-8
Java
false
false
486
java
package org.apache.spark.sql.catalyst.expressions; public class Round$ extends scala.runtime.AbstractFunction2<org.apache.spark.sql.catalyst.expressions.Expression, org.apache.spark.sql.catalyst.expressions.Expression, org.apache.spark.sql.catalyst.expressions.Round> implements scala.Serializable { /** * Static reference to the singleton instance of this Scala object. */ public static final Round$ MODULE$ = null; public Round$ () { throw new RuntimeException(); } }
268244c1fd9cf552d766014c435c784afe7f49af
c155363f6447571e7f62978bf9f830b5d07229ae
/app/src/main/java/apps/lnsel/com/vhortexttest/helpers/CustomViews/ChatEditText.java
787470ba85a51b6bb69d2e1f59777de7401a721f
[]
no_license
barenece9/Vhortext
8b9e628d9cabcecaf5d87d2a11aa33af735b0ede
344857fabca0f019ec2cb70f9287581c94a1a7b8
refs/heads/master
2021-09-09T12:59:35.598319
2018-03-16T10:51:35
2018-03-16T10:51:35
123,862,380
1
0
null
null
null
null
UTF-8
Java
false
false
1,140
java
package apps.lnsel.com.vhortexttest.helpers.CustomViews; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Typeface; import android.util.AttributeSet; import com.rockerhieu.emojicon.EmojiconEditText; import apps.lnsel.com.vhortexttest.R; public class ChatEditText extends EmojiconEditText { public ChatEditText(Context context) { super(context); } public ChatEditText(Context context, AttributeSet attrs) { super(context, attrs); setCustomFont(context, attrs); } private void setCustomFont(Context ctx, AttributeSet attrs) { TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.ViewStyle); String customFont = a.getString(R.styleable.ViewStyle_customFont); setCustomFont(ctx, customFont); a.recycle(); } public boolean setCustomFont(Context ctx, String asset) { Typeface tf = null; try { tf = Typeface.createFromAsset(ctx.getAssets(), asset); } catch (Exception e) { return false; } setTypeface(tf); return true; } }
93a80d57b1350008b88723c25c40b39552d1e50e
bee577bd3a17afa08ac82230b18831bc3fd09538
/.svn/pristine/93/93a80d57b1350008b88723c25c40b39552d1e50e.svn-base
80aff7ab0c3fde0669f0cb0cf2807a8a0baacb99
[]
no_license
pologood/logic_server_im
4b7d55ad56bc80bdbe187049d2290d8099358de2
0694098cbc39bc80eb8bd9d53b5f9282951066ab
refs/heads/master
2021-01-19T16:03:19.103707
2016-12-05T11:06:59
2016-12-05T11:06:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,941
package cn.com.gome.logic.model; import java.io.Serializable; /** * 群组 */ public class Group implements Serializable { private static final long serialVersionUID = 1L; private String groupId; // 群组id private int type; // 群组类型;1:单聊,2:群聊,3:系统消息/小秘书 private long seq; // 递增id private String lastMsg; // 最后一条消息内容 private long createTime; // 创建时间 private int isDele; private long updateTime; // 最后一次修改时间 //以下属性是与OA的Group对象的差异20161013仅增加userId // private String groupName;// 群组名称 // private List<GroupMsg> msgs; // 最新20条消息 private long userId; // 群主id // private String groupDesc;// 群描述 // private String avatar; // 头像 // private String qRcode; // 二维码 // private int capacity;// 容量 // private int isAudit; // 是否需要审核 public String getGroupId() { return groupId; } public void setGroupId(String groupId) { this.groupId = groupId; } public int getType() { return type; } public void setType(int type) { this.type = type; } public long getSeq() { return seq; } public void setSeq(long seq) { this.seq = seq; } public String getLastMsg() { return lastMsg; } public void setLastMsg(String lastMsg) { this.lastMsg = lastMsg; } public long getCreateTime() { return createTime; } public void setCreateTime(long createTime) { this.createTime = createTime; } public int getIsDele() { return isDele; } public void setIsDele(int isDele) { this.isDele = isDele; } public long getUpdateTime() { return updateTime; } public void setUpdateTime(long updateTime) { this.updateTime = updateTime; } public long getUserId() { return userId; } public void setUserId(long userId) { this.userId = userId; } }
6934f91b5effb9d0226e1f6f8239bdb669e8b7ef
ed00688c548f8af1e88d08de1f95d435632c06f7
/src/by/htp/vyacheslav/service/ClientService.java
7c62eb80f50e85c789f1c107c89137e5231dcf75
[]
no_license
slavahokage/testing_system
0f7f6bdc26c8bde54fc0437a0cca1716d8d6b676
0955127ac5f40a852793aff7d46b3d0a2c52984e
refs/heads/master
2023-01-21T20:09:42.674955
2020-12-01T14:25:50
2020-12-01T14:25:50
293,448,078
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package by.htp.vyacheslav.service; import by.htp.vyacheslav.dao.DaoException; import by.htp.vyacheslav.entity.User; import by.htp.vyacheslav.entity.UserData; public interface ClientService { User authorization(String login, String password) throws ServiceException; boolean registration(UserData user) throws ServiceException; public User getUserByLogin(String login) throws ServiceException; }
1ddd803db4a63798df96de6306d214818e4b8555
f822f56d78cbf66e7176bf36473ec495e39e82ba
/cocodingding_0.7.0/java/com/spring/qboard/service/IncorrectService.java
915bb52c51581f34300b7e657b0b90244ebc5f32
[]
no_license
pjs9322/cocodingding
bd8fe158e0102c2308db73f6b89327d801ff22e4
82dd72ecc46a37d6633bb66c8520f75c3082ce1a
refs/heads/master
2020-04-02T16:53:23.799325
2018-11-15T01:25:08
2018-11-15T01:25:08
154,633,270
0
0
null
null
null
null
UHC
Java
false
false
587
java
package com.spring.qboard.service; import java.util.List; import com.spring.qboard.vo.IncorrectVO; public interface IncorrectService { // 전체 장바구니 목록 보기 public List<IncorrectVO> selectIncorrectList() throws Exception; // 유저 장바구니 추가 public void insertIncorrect(IncorrectVO incorrectVO) throws Exception; // 유저별 장바구니 보기 public List<IncorrectVO> selectIncorrect(String id) throws Exception; // 유저 장바구니 삭제 public void deleteIncorrect(IncorrectVO incorrectVO) throws Exception; }
042e8dc79570cca147d9cea41a4d2d24573c4ece
cbd2d5b99cbdb42be7377812cbbe11d8a5eab692
/src/lesson8/accounts/SecondaryAccount.java
8849f8228bacc360c813b173c3f9624af3ca65f7
[]
no_license
sergeyrudov/java-core-grom
d860fc5fdf4317c7a966a568b1a8ad617fef3092
74c469ea9a7af0c5256eedfe9c278ca1e331646b
refs/heads/master
2021-08-08T03:08:43.751455
2020-05-11T16:39:23
2020-05-11T16:39:23
175,904,527
0
0
null
null
null
null
UTF-8
Java
false
false
261
java
package lesson8.accounts; public class SecondaryAccount extends CheckingAccount { public SecondaryAccount(String bankName, String ownerName, int moneyAmount, int limitOfExpenses) { super(bankName, ownerName, moneyAmount, limitOfExpenses); } }
6212f6800320954e02da314446cf914c05b89fdf
53513d2add744fdb056dcc5e1c5be65dee96374f
/src/main/java/com/ecommerce/spring5onlineshop/repositories/ProductRepository.java
c6d5c09814c3a861942b59375f68afb8f48812b2
[]
no_license
patrickhansa/spring5-online-shop
ae29295f23be31a8b5427c04983c30c4c94ce21d
39162957c007f1ddc5684b67b4de6b1ce79953da
refs/heads/master
2022-07-17T00:19:15.871987
2020-05-18T04:40:04
2020-05-18T04:40:04
240,862,489
0
1
null
null
null
null
UTF-8
Java
false
false
801
java
package com.ecommerce.spring5onlineshop.repositories; import com.ecommerce.spring5onlineshop.model.Product; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import java.util.Optional; import java.util.Set; public interface ProductRepository extends CrudRepository<Product, Long> { String SELECT_PRODUCTS_BY_SHOPPING_CART_ID = "select * from product inner join " + "shopping_cart_products as scp on (product.id = scp.products_id) where(scp.shopping_cart_id = ?1)"; Optional<Product> findProductById(Long id); @Query(value = SELECT_PRODUCTS_BY_SHOPPING_CART_ID, nativeQuery = true) Set<Product> getProductsByShoppingCartId(Long id); Set<Product> findByNameContainingIgnoreCase(String productName); }
f21d88d64aa33945775f4ee13fa73692d166aec1
28f1dedfa55de3381f0e2124c7c819f582767e2a
/core/hadoop-components/hadoop-ops/src/org/smartfrog/services/hadoop/mapreduce/terasort/TeraOutputFormat.java
ddda8f81a5b2ea29d77f19b26a18a683ccf55744
[]
no_license
rhusar/smartfrog
3bd0032888c03a8a04036945c2d857f72a89dba6
0b4db766fb1ec1e1c2e48cbf5f7bf6bfd2df4e89
refs/heads/master
2021-01-10T05:07:39.218946
2014-11-28T08:52:32
2014-11-28T08:52:32
47,347,494
0
1
null
null
null
null
UTF-8
Java
false
false
3,317
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.smartfrog.services.hadoop.mapreduce.terasort; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.RecordWriter; import org.apache.hadoop.mapred.TextOutputFormat; import org.apache.hadoop.util.Progressable; import java.io.DataOutputStream; import java.io.IOException; /** * A streamlined text output format that writes key, value, and "\r\n". */ @SuppressWarnings({"deprecation"}) public class TeraOutputFormat extends TextOutputFormat<Text, Text> { /** * Set the requirement for a final sync before the stream is closed. */ public static void setFinalSync(JobConf conf, boolean newValue) { conf.setBoolean(TeraConstants.FINAL_SYNC_ATTRIBUTE, newValue); } /** * Does the user want a final sync at close? */ public static boolean getFinalSync(JobConf conf) { return conf.getBoolean(TeraConstants.FINAL_SYNC_ATTRIBUTE, false); } public static class TeraRecordWriter extends LineRecordWriter<Text, Text> { private static final byte[] newLine = "\r\n".getBytes(); private boolean finalSync = false; public TeraRecordWriter(DataOutputStream out, JobConf conf) { super(out); finalSync = getFinalSync(conf); } @Override public synchronized void write(Text key, Text value) throws IOException { out.write(key.getBytes(), 0, key.getLength()); out.write(value.getBytes(), 0, value.getLength()); out.write(newLine, 0, newLine.length); } public void close() throws IOException { if (finalSync) { ((FSDataOutputStream) out).sync(); } super.close(null); } } @Override public RecordWriter<Text, Text> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { Path dir = getWorkOutputPath(job); FileSystem fs = dir.getFileSystem(job); FSDataOutputStream fileOut = fs.create(new Path(dir, name), progress); return new TeraRecordWriter(fileOut, job); } }
[ "steve_l@9868f95a-be1e-0410-b3e3-a02e98b909e6" ]
steve_l@9868f95a-be1e-0410-b3e3-a02e98b909e6
a910081e1f0eb7f1b7f179922d7eeecd93f75b03
f93d0b80c80b099aab55d948a80ee8f937756ed2
/src/main/java/controllers/alumn/PartnerRequestController.java
44ab4efbd83006a214eb3a0ca9d92e7f8b5fff79
[]
no_license
manugdf/Acme-dance
2bf55b6c19f76ecc656519de70b7430f5bdaba66
527f86d2f326e5c9e7bcfe7103ebda588e07c3d4
refs/heads/master
2020-12-30T15:53:50.609415
2017-06-05T15:30:41
2017-06-05T15:30:41
91,176,403
0
0
null
null
null
null
UTF-8
Java
false
false
5,719
java
package controllers.alumn; import java.util.ArrayList; import java.util.Collection; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.stereotype.Controller; import org.springframework.util.Assert; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import controllers.AbstractController; import domain.Alumn; import domain.PartnerRequest; import services.AlumnService; import services.DanceSchoolService; import services.PartnerRequestService; @Controller @RequestMapping("/partnerRequest/alumn") public class PartnerRequestController extends AbstractController { @Autowired private PartnerRequestService partnerRequestService; @Autowired private AlumnService alumnService; @Autowired private DanceSchoolService danceSchoolService; @RequestMapping(value = "/list", method = RequestMethod.GET) public ModelAndView list() { final ModelAndView res = new ModelAndView("partnerRequest/list"); final Alumn alumn = this.alumnService.findByPrincipal(); res.addObject("partnerRequests", alumn.getPartnerRequests()); res.addObject("requestURI", "partnerRequest/alumn/list.do"); res.addObject("viewing", false); return res; } // @RequestMapping(value = "/list", method = RequestMethod.GET) // public ModelAndView listFromSchool() { // final ModelAndView res = new ModelAndView("partnerRequest/list"); // final Alumn alumn = this.alumnService.findByPrincipal(); // //Me traigo las danceSchools a las que estoy apuntado, y de cada una me traigo sus alumnos, y los que tengan Partner Request los meto en la lista // Collection<DanceSchool> danceSchools = // res.addObject("partnerRequests", alumn.getPartnerRequests()); // res.addObject("requestURI", "partnerRequest/alumn/list.do"); // return res; // // } @RequestMapping(value = "/create", method = RequestMethod.GET) public ModelAndView create() { final ModelAndView res = new ModelAndView("partnerRequest/create"); final PartnerRequest pr = this.partnerRequestService.create(); res.addObject("partnerRequest", pr); res.addObject("requestURI", "partnerRequest/alumn/create.do"); return res; } @RequestMapping(value = "/create", method = RequestMethod.POST, params = "save") public ModelAndView create(@Valid final PartnerRequest partnerRequest, final BindingResult binding) { ModelAndView res = new ModelAndView(); if (binding.hasErrors()) { final PartnerRequest pr = this.partnerRequestService.create(); res = new ModelAndView("partnerRequest/create"); res.addObject("requestURI", "partnerRequest/alumn/create.do"); res.addObject("partnerRequest", pr); res.addObject("message", "partnerRequest.commit.error"); System.out.println(binding.getAllErrors()); } else try { this.partnerRequestService.save(partnerRequest); res = new ModelAndView("partnerRequest/list"); final Alumn alumn = this.alumnService.findByPrincipal(); res.addObject("partnerRequests", alumn.getPartnerRequests()); res.addObject("requestURI", "partnerRequest/alumn/list.do"); res.addObject("viewing", false); } catch (final DataIntegrityViolationException oops) { final PartnerRequest pr = this.partnerRequestService.create(); res = new ModelAndView("partnerRequest/create"); res.addObject("requestURI", "partnerRequest/alumn/create.do"); res.addObject("partnerRequest", pr); res.addObject("message", "partnerRequest.commit.error"); } return res; } @RequestMapping(value = "/delete", method = RequestMethod.GET) public ModelAndView delete(@RequestParam final int partnerRequestId) { ModelAndView res = new ModelAndView(); final Alumn alumn = this.alumnService.findByPrincipal(); try { final PartnerRequest pr = this.partnerRequestService.findOne(partnerRequestId); Assert.isTrue(pr.getAlumn().getId() == this.alumnService.findByPrincipal().getId()); this.partnerRequestService.delete(pr); res = new ModelAndView("partnerRequest/list"); res.addObject("partnerRequests", alumn.getPartnerRequests()); res.addObject("requestURI", "partnerRequest/alumn/list.do"); res.addObject("viewing", false); } catch (final Throwable oops) { res = new ModelAndView("partnerRequest/list"); res.addObject("partnerRequests", alumn.getPartnerRequests()); res.addObject("requestURI", "partnerRequest/alumn/list.do"); res.addObject("viewing", false); res.addObject("message", "partnerRequest.commit.error"); } return res; } @RequestMapping(value = "/view", method = RequestMethod.GET) public ModelAndView view(@RequestParam final int schoolId) { final ModelAndView res = new ModelAndView("partnerRequest/list"); final Alumn alumn = this.alumnService.findByPrincipal(); final Collection<Alumn> alumns = this.alumnService.findAlumnsBySchoolId(schoolId); if (alumns.contains(alumn)) alumns.remove(alumn); final Collection<PartnerRequest> pr = new ArrayList<PartnerRequest>(); for (final Alumn a : alumns) pr.addAll(a.getPartnerRequests()); res.addObject("partnerRequests", pr); res.addObject("requestURI", "partnerRequest/alumn/view.do"); res.addObject("viewing", true); res.addObject("schoolName", this.danceSchoolService.findOne(schoolId).getName()); return res; } }
c221ecf1aab95ae2a123a26e6ee3f16918731423
5351a18ec516e87711bc6d39936fa34a21f28407
/app/src/main/java/uk/co/caprica/vlcj/medialist/events/MediaListEventFactory.java
e134d8cf21168d15a69042ba65172ae3ba395516
[]
no_license
cloverc1022/wanviewplusPc
1ef9a0e5b0b4d0c269699c9d0609195210bfc1d5
257a4b93dc0659f76d7f356e9f74026cbe215e94
refs/heads/master
2022-01-05T14:15:36.751469
2019-06-03T02:05:43
2019-06-03T02:05:43
166,205,495
0
0
null
null
null
null
UTF-8
Java
false
false
3,180
java
/* * This file is part of VLCJ. * * VLCJ is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VLCJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VLCJ. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2009-2019 Caprica Software Limited. */ package uk.co.caprica.vlcj.medialist.events; import uk.co.caprica.vlcj.binding.internal.*; import uk.co.caprica.vlcj.medialist.MediaList; /** * A factory that creates a media list event instance for a native media list event. */ public class MediaListEventFactory { /** * Media list to which the event relates. */ private final MediaList mediaList; /** * Create a new factory. * * @param mediaList media list to create events for */ public MediaListEventFactory(MediaList mediaList) { this.mediaList = mediaList; } /** * Create an event. * * @param event native event * @return media list event, or <code>null</code> if the native event type is not enabled or otherwise could not be handled */ public MediaListEvent createEvent(libvlc_event_t event) { // Create an event suitable for the native event type... MediaListEvent result = null; switch(libvlc_event_e.event(event.type)) { case libvlc_MediaListWillAddItem: media_list_will_add_item addItemEvent = ((media_list_will_add_item)event.u.getTypedValue(media_list_will_add_item.class)); result = new MediaListWillAddItemEvent(mediaList, addItemEvent.item, addItemEvent.index); break; case libvlc_MediaListItemAdded: media_list_item_added itemAddedEvent = ((media_list_item_added)event.u.getTypedValue(media_list_item_added.class)); result = new MediaListItemAddedEvent(mediaList, itemAddedEvent.item, itemAddedEvent.index); break; case libvlc_MediaListWillDeleteItem: media_list_will_delete_item deleteItemEvent = ((media_list_will_delete_item)event.u.getTypedValue(media_list_will_delete_item.class)); result = new MediaListWillDeleteItemEvent(mediaList, deleteItemEvent.item, deleteItemEvent.index); break; case libvlc_MediaListItemDeleted: media_list_item_deleted itemDeletedEvent = ((media_list_item_deleted)event.u.getTypedValue(media_list_item_deleted.class)); result = new MediaListItemDeletedEvent(mediaList, itemDeletedEvent.item, itemDeletedEvent.index); break; case libvlc_MediaListEndReached: result = new MediaListEndReachedEvent(mediaList); break; } return result; } }
5b21f0b42d8f83d893af3c6248b42f1a8db72552
ee2a61a58a3b31a2367be03e6377bada454853ad
/AndroidMvc-master/library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/MvcStateKeeperHolder.java
c2688f95da081fc47366d5b675659007eb47cfb7
[ "Apache-2.0" ]
permissive
song161013/mvc-mvp-mvvm-
690f2c5f6042c8ad3b9f217c98db2f0b306cf4e4
d746637a18e7023f2d3f9bf38ec73ed20a2a407d
refs/heads/master
2021-01-20T08:44:03.951139
2017-08-27T17:56:44
2017-08-27T17:56:44
101,570,238
0
0
null
null
null
null
UTF-8
Java
false
false
3,470
java
/* * Copyright 2016 Kejun Xia * * 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.shipdream.lib.android.mvc; import android.os.Bundle; import com.shipdream.lib.poke.Component; import java.util.Map; /** * This class holds a stateKeeper as a singleton. */ class MvcStateKeeperHolder { static MvcStateKeeper stateKeeper; static { stateKeeper = new MvcStateKeeper(); } /** * Save model of all {@link Bean}s currently live in the {@link Mvc#graph()} * @param outState the out state */ static void saveState(Bundle outState) { stateKeeper.bundle = outState; MvcComponent root = getRootComponent(); doSaveState(root); stateKeeper.bundle = null; } private static void doSaveState(Component component) { if (component.getChildrenComponents() != null && !component.getChildrenComponents().isEmpty()) { for (Component childComponent : component.getChildrenComponents()) { doSaveState(childComponent); } } Map<String, Object> cache = component.getCache(); for (String key : cache.keySet()) { Object v = cache.get(key); if (v != null && v instanceof Bean) { Bean bean = (Bean) v; if (bean.modelType() != null) { stateKeeper.saveState(key, bean.getModel()); } } } } /** * Restore model of all {@link Bean}s currently live in the {@link Mvc#graph()} * @Bundle savedState the saved state */ static void restoreState(Bundle savedState) { stateKeeper.bundle = savedState; MvcComponent root = getRootComponent(); doRestoreState(root); stateKeeper.bundle = null; } private static void doRestoreState(Component component) { if (component.getChildrenComponents() != null && !component.getChildrenComponents().isEmpty()) { for (Component child : component.getChildrenComponents()) { doRestoreState(child); } } Map<String, Object> cache = component.getCache(); for (String key : cache.keySet()) { Object v = cache.get(key); if (v instanceof Bean) { Bean bean = (Bean) v; if (bean.modelType() != null) { Object model = stateKeeper.restoreState(key, bean.modelType()); bean.restoreModel(model); } } } } private static MvcComponent getRootComponent() { Component root = Mvc.graph().getRootComponent(); if (root == null && root instanceof MvcComponent) { throw new IllegalStateException("RootComponent of MvcGraph must inherit MvcComponent"); } MvcComponent mvcComponent = (MvcComponent) root; return mvcComponent; } }
11a536b5ed60bd36eca391b2dfb46a1e5869d50f
249dba1b88673cb659b9e65d69d33b8aaa4de863
/4106_Project/src/featureEngineering/LinearRegression.java
9bc3c31e1c34acb92d60a8e7b40047254d5b62e0
[]
no_license
ismith1024/AI-Class-Project
d805bd00db96adab212b77fb4daf3ab565b99fea
a743899a5d498074672117469c8eafe7371b157c
refs/heads/master
2021-06-18T04:51:53.167229
2017-06-20T23:42:19
2017-06-20T23:42:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,410
java
package featureEngineering; /****************************************************************************** * Compilation: javac LinearRegression.java * Execution: java LinearRegression * Dependencies: none * * Compute least squares solution to y = beta * x + alpha. * Simple linear regression. * ******************************************************************************/ /** * The {@code LinearRegression} class performs a simple linear regression * on an set of <em>n</em> data points (<em>y<sub>i</sub></em>, <em>x<sub>i</sub></em>). * That is, it fits a straight line <em>y</em> = &alpha; + &beta; <em>x</em>, * (where <em>y</em> is the response variable, <em>x</em> is the predictor variable, * &alpha; is the <em>y-intercept</em>, and &beta; is the <em>slope</em>) * that minimizes the sum of squared residuals of the linear regression model. * It also computes associated statistics, including the coefficient of * determination <em>R</em><sup>2</sup> and the standard deviation of the * estimates for the slope and <em>y</em>-intercept. * * @author Robert Sedgewick * @author Kevin Wayne */ public class LinearRegression { private final double intercept, slope; private final double r2; private final double svar0, svar1; /** * Performs a linear regression on the data points {@code (y[i], x[i])}. * * @param x the values of the predictor variable * @param y the corresponding values of the response variable * @throws IllegalArgumentException if the lengths of the two arrays are not equal */ public LinearRegression(double[] x, double[] y) { if (x.length != y.length) { throw new IllegalArgumentException("array lengths are not equal"); } int n = x.length; // first pass double sumx = 0.0, sumy = 0.0, sumx2 = 0.0; for (int i = 0; i < n; i++) { sumx += x[i]; sumx2 += x[i]*x[i]; sumy += y[i]; } double xbar = sumx / n; double ybar = sumy / n; // second pass: compute summary statistics double xxbar = 0.0, yybar = 0.0, xybar = 0.0; for (int i = 0; i < n; i++) { xxbar += (x[i] - xbar) * (x[i] - xbar); yybar += (y[i] - ybar) * (y[i] - ybar); xybar += (x[i] - xbar) * (y[i] - ybar); } slope = xybar / xxbar; intercept = ybar - slope * xbar; // more statistical analysis double rss = 0.0; // residual sum of squares double ssr = 0.0; // regression sum of squares for (int i = 0; i < n; i++) { double fit = slope*x[i] + intercept; rss += (fit - y[i]) * (fit - y[i]); ssr += (fit - ybar) * (fit - ybar); } int degreesOfFreedom = n-2; r2 = ssr / yybar; double svar = rss / degreesOfFreedom; svar1 = svar / xxbar; svar0 = svar/n + xbar*xbar*svar1; } /** * Returns the <em>y</em>-intercept &alpha; of the best of the best-fit line <em>y</em> = &alpha; + &beta; <em>x</em>. * * @return the <em>y</em>-intercept &alpha; of the best-fit line <em>y = &alpha; + &beta; x</em> */ public double intercept() { return intercept; } /** * Returns the slope &beta; of the best of the best-fit line <em>y</em> = &alpha; + &beta; <em>x</em>. * * @return the slope &beta; of the best-fit line <em>y</em> = &alpha; + &beta; <em>x</em> */ public double slope() { return slope; } /** * Returns the coefficient of determination <em>R</em><sup>2</sup>. * * @return the coefficient of determination <em>R</em><sup>2</sup>, * which is a real number between 0 and 1 */ public double R2() { return r2; } /** * Returns the standard error of the estimate for the intercept. * * @return the standard error of the estimate for the intercept */ public double interceptStdErr() { return Math.sqrt(svar0); } /** * Returns the standard error of the estimate for the slope. * * @return the standard error of the estimate for the slope */ public double slopeStdErr() { return Math.sqrt(svar1); } /** * Returns the expected response {@code y} given the value of the predictor * variable {@code x}. * * @param x the value of the predictor variable * @return the expected response {@code y} given the value of the predictor * variable {@code x} */ public double predict(double x) { return slope*x + intercept; } /** * Returns a string representation of the simple linear regression model. * * @return a string representation of the simple linear regression model, * including the best-fit line and the coefficient of determination * <em>R</em><sup>2</sup> */ public String toString() { StringBuilder s = new StringBuilder(); s.append(String.format("%.2f n + %.2f", slope(), intercept())); s.append(" (R^2 = " + String.format("%.3f", R2()) + ")"); return s.toString(); } }
f40173ff4d1e25a9291be43a99bb8e30d3c98369
2dbedb19db36e6e5612dd08b05a8e285a1f09464
/dice-server/blog/src/main/java/com/bihell/dice/blog/model/params/LoginParam.java
acc7eb56bca52dc88613ede22c6db9e8c5ccfb61
[ "MIT" ]
permissive
caojianDavid/Dice
ca276f4d1416e7ef5ede269ed8919a0b997e3d24
e90f21f084e45ea203e1670598a8e936d2fd8be1
refs/heads/master
2022-12-17T14:10:06.367965
2020-09-22T02:26:28
2020-09-22T02:26:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
621
java
package com.bihell.dice.blog.model.params; import lombok.Data; import lombok.ToString; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; /** * Login param. * * @author johnniang * @date 3/28/19 */ @Data @ToString public class LoginParam { @NotBlank(message = "用户名或邮箱不能为空") @Size(max = 255, message = "用户名或邮箱的字符长度不能超过 {max}") private String username; @NotBlank(message = "登陆密码不能为空") @Size(max = 100, message = "用户密码字符长度不能超过 {max}") private String password; }
58d43c94dbaa36df66fd92a882d3b94b75285c43
0b57f26a53ceddd6807d6ff76f34857c993e3087
/src/main/java/genrics/BaseClass.java
32a91f22e6dabadf1dba007c90692f2d07ff765b
[]
no_license
RahulKumar043/Rahul-Kumar2
92857ddc0171296f87288ae6dcd7b07ff3cde076
f3db7c58b5b9cf87e549663c3155bb79c9f72017
refs/heads/master
2023-07-08T12:37:27.373469
2021-08-19T12:00:55
2021-08-19T12:00:55
397,927,227
0
0
null
null
null
null
UTF-8
Java
false
false
2,192
java
package genrics; import java.io.FileNotFoundException; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeSuite; import com.objectrepo.Homepage; import com.objectrepo.Loginpage; public class BaseClass { public WebDriver driver; public WebDriver_Utility wdu=new WebDriver_Utility(); public ReaddatausingPropfile prop=new ReaddatausingPropfile(); @BeforeSuite(groups= {"Smoke Test","Regression Test"}) public void setup_JDBC_Report() { System.out.println("setup of jdbc and report is done"); } @AfterSuite(groups= {"Smoke Test","Regression Test"}) public void setup_JDBC_Close() { System.out.println("setup of jdbc and report is closed"); } @BeforeClass(groups= {"Smoke Test","Regression Test"}) public void launch_Browser() throws FileNotFoundException, IOException { if(prop.read("Browser").equalsIgnoreCase("Chrome")) { driver= new ChromeDriver(); System.out.println(" Chrome Browser is launched"); } else { driver= new FirefoxDriver(); System.out.println("Firefoxdriver is launched"); } driver.manage().window().maximize(); driver.get(prop.read("url")); driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS); } @AfterClass(groups= {"Smoke Test","Regression Test"}) public void Close_Browser() { driver.close(); System.out.println("Browser is closed"); } @BeforeMethod(groups= {"Smoke Test","Regression Test"}) public void loginVtiger() throws FileNotFoundException, IOException { Loginpage lp=new Loginpage(driver); lp.login(prop.read("un"), prop.read("pwd")); } @AfterMethod(groups= {"Smoke Test","Regression Test"}) public void logoutVtiger() { Homepage hp=new Homepage(driver); hp.getSignoutlogo(); hp.getSignoutbtn(); } }
[ "Rahul@Rahul-PC" ]
Rahul@Rahul-PC
f1d08b5eb544b5e30e9332638e9299a0b9cbb12e
38a1f59ece85faaa3be4b174d170eefba0f6aa10
/SpringMVCTest/src/com/bcp/dao/AplicacionEspecializadaDAO.java
b1a7f1d7dd76846c34769062ac4c57ac2ee85982
[]
no_license
DiegoMarrujo/appGUTI
77bdaa0359875e3a194d312438f088aac91cdc86
26bcad381e277da0eb76d17ff3529967c26547cc
refs/heads/master
2021-05-28T09:02:22.097637
2015-01-30T17:44:57
2015-01-30T17:44:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,244
java
package com.bcp.dao; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import com.bcp.modelo.dto.AplicacionEspecializadaDTO; import com.bcp.modelo.AplicacionEspecializada; public class AplicacionEspecializadaDAO { private Connection cnn = null; private ResultSet rs = null; private static AplicacionEspecializadaDAO instancia; public static AplicacionEspecializadaDAO getInstancia() { if (instancia == null) { instancia = new AplicacionEspecializadaDAO(); } return instancia; } public ArrayList<AplicacionEspecializada> obtenerVersiones(AplicacionEspecializada apEspecializada) throws Exception { ArrayList<AplicacionEspecializada> lista = new ArrayList<AplicacionEspecializada>(); try { cnn = Conexion.getConexion(); CallableStatement cs = null; cs = cnn.prepareCall("call sp_obtener_historico_aplicaciones_por_aplicacion1(?)"); cs.setInt(1, apEspecializada.getIdAplicacionEspecializada()); rs = cs.executeQuery(); int i = 1; while (rs.next()) { AplicacionEspecializada objeto = new AplicacionEspecializada(); objeto.setNumero(i); objeto.setIdAplicacionEspecializada(rs.getInt("ID_APLICACION_ESPECIALIZADA")); objeto.setIdVersion(rs.getInt("ID_VERSION")); objeto.setFechaCreacionRegistro(rs.getString("FECHA_CREACION_REGISTRO")); objeto.setMatriculaUsuario(rs.getString("MATRICULA")); objeto.setMotivoCreacion(rs.getString("DESCRIPCION_MOTIVO_CREACION_APLICACION")); objeto.setEstadoVersion(rs.getString("ESTADO_VERSION")); lista.add(objeto); System.out.println(objeto.getIdVersion()); i++; } cnn.close(); cs.close(); } catch (SQLException ex) { throw ex; } return lista; } public ArrayList<AplicacionEspecializada> retornaIDVER(AplicacionEspecializada objeto) throws Exception { ArrayList<AplicacionEspecializada> lista = new ArrayList<AplicacionEspecializada>(); try { cnn = Conexion.getConexion(); CallableStatement cs = null; cs = cnn.prepareCall("call aplicacion_especializada_UPDATE(?,?,?)"); cs.setInt(1, objeto.getIdAplicacionEspecializada()); cs.setInt(2, objeto.getUsuarioCreacion()); cs.setInt(3, objeto.getIdMotivoCreacion()); rs = cs.executeQuery(); while (rs.next()) { AplicacionEspecializada valor = new AplicacionEspecializada(); //valor.setIdAplicacionEspecializada(rs.getInt("ID_APP")); valor.setIdVersion(rs.getInt("ID_VER")); lista.add(valor); } cnn.close(); cs.close(); } catch (SQLException ex) { throw ex; } return lista; } public ArrayList<AplicacionEspecializada> retornaID(AplicacionEspecializada objeto) throws Exception { ArrayList<AplicacionEspecializada> lista = new ArrayList<AplicacionEspecializada>(); try { cnn = Conexion.getConexion(); CallableStatement cs = null; cs = cnn.prepareCall("call aplicacion_especializada_INSERT(?,?)"); cs.setInt(1, objeto.getUsuarioCreacion()); cs.setInt(2, objeto.getIdMotivoCreacion()); rs = cs.executeQuery(); while (rs.next()) { AplicacionEspecializada valor = new AplicacionEspecializada(); valor.setIdAplicacionEspecializada(rs.getInt("ID_APP")); valor.setIdVersion(rs.getInt("ID_VER")); lista.add(valor); } cnn.close(); cs.close(); } catch (SQLException ex) { throw ex; } return lista; } public int ingresarAplicacionEspecializada(AplicacionEspecializadaDTO objeto) throws Exception { int id = 0; try { cnn = Conexion.getConexion(); CallableStatement cs = null; cs = cnn.prepareCall("call aplicacion_especializada_INSERT_GENERAL(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); cs.setInt(1,objeto.getIdAplicacionEspecializada()); cs.setInt(2,objeto.getIdVersion()); /**ESTRUCTURA ORGANIZACIONAL**/ cs.setString(3,objeto.getCodigoAplicacionEspecializada()); cs.setString(4,objeto.getCodigoFNA()); cs.setInt(5,objeto.getIdArea()); cs.setInt(6,objeto.getIdDivision()); cs.setInt(7,objeto.getIdGerenciaCentral()); cs.setInt(8,objeto.getIdUnidad()); /**INFORMACION GENERAL**/ cs.setString(9,objeto.getNombreAplicacionNOIT()); cs.setString(10,objeto.getDescripcionAplicacion()); cs.setString(11,objeto.getFuncionalidadesAplicacion()); cs.setString(12,objeto.getFechaCreacionAplicacion()); cs.setInt(13,objeto.getIdEstadoAplicacion()); cs.setInt(14,objeto.getIdTipoOperacionProceso()); cs.setInt(15,objeto.getIdFrecuenciaOperaciones()); cs.setInt(16,objeto.getIdCantidadOperaciones()); cs.setInt(17,objeto.getNroEntidadesInternas()); cs.setInt(18,objeto.getIdMotivoCreacionAplicacion()); cs.setString(19,objeto.getMotivoCreacionAplicacionOtros()); cs.setInt(20,objeto.getNroFuncionalidadesTransacciones()); cs.setInt(21,objeto.getNroReportes()); cs.setInt(22,objeto.getNroConsultas()); cs.setInt(23,objeto.getNroEntidadesExternas()); cs.setString(24,objeto.getObservacionesGenerales()); /**FUNCIONALIDAD**/ cs.setString(25,objeto.getFuncionalidad()); cs.setString(26,objeto.getDatosEntrada()); cs.setString(27,objeto.getProceso()); cs.setString(28,objeto.getSalida()); /**DOMINIO**/ cs.setString(29,objeto.getFrontUserLiderUsuario()); cs.setString(30,objeto.getGestorAplicaciones()); cs.setString(31,objeto.getEspecialistaAplicaciones()); cs.setString(32,objeto.getBrokerSistemas()); cs.setString(33,objeto.getBrokerNegocios()); cs.setString(34,objeto.getAsesorGUTI()); cs.setString(35,objeto.getArquitectoDominio()); cs.setInt(36,objeto.getIdEntidadesUsuarias()); cs.setInt(37,objeto.getIdDominio()); cs.setInt(38,objeto.getNroUnidadesUtilizanAplicacion()); cs.setInt(39,objeto.getIdCantidadUsuariosAplicacionTotal()); System.out.println("SUBDOMINIO " + objeto.getIdSubDominio()); cs.setInt(40,objeto.getIdSubDominio()); cs.setString(41,objeto.getNombreUnidad1()); cs.setString(42,objeto.getNombreUnidad2()); cs.setString(43,objeto.getNombreUnidad3()); cs.setInt(44,objeto.getIdProcesoAuditoria()); cs.setString(45,objeto.getProcesoAuditoriaOtros()); cs.setInt(46,objeto.getIdImpactaProcesoClave()); //cs.setString(47,objeto.getIdProcesoClave()); cs.setInt(47, objeto.getIdDomProcesoClave()); System.out.print("ID_PROCESO_CLAVE: " + objeto.getIdDomProcesoClave()); cs.setString(48,objeto.getNombreProcesoClaveOtros()); cs.setInt(49,objeto.getActividadDominio()); cs.setString(50,objeto.getRelacionConCIF()); /**CLASIFICACION DE ACTIVOS**/ cs.setInt(51,objeto.getIdConfidencialidad()); cs.setInt(52,objeto.getIdIntegridad()); cs.setInt(53,objeto.getIdDisponibilidad()); cs.setInt(54,objeto.getIdPrivacidad()); cs.setInt(55,objeto.getIdClasificacion()); cs.setString(56,objeto.getClasificacionActivosObservacion()); cs.setInt(57,objeto.getIdCriticidadFinal()); cs.setInt(58,objeto.getIdEstadoRevisionAplicaciones()); /**CARACTERISTICASTECNICAS**/ cs.setInt(59, objeto.getIdCategoriaTecnologica()); //cs.setString(59,objeto.getCategoriaTecnologica()); cs.setString(60,objeto.getCategoriaTecnologicaOtros()); cs.setInt(61,objeto.getIdTiposDesarrollo()); cs.setInt(62,objeto.getIdUbicacionFisica()); cs.setInt(63,objeto.getIdAmbienteAppNOIT()); cs.setString(64,objeto.getAmbienteAppNOITOtros()); cs.setString(65,objeto.getNombreUbicacion()); cs.setInt(66,objeto.getIdInfraestructuraAplicacion()); cs.setInt(67,objeto.getEsSolucionStandAlone()); cs.setInt(68,objeto.getNroInterfacesConOtrasApp()); cs.setString(69,objeto.getNombresInterfaces()); cs.setInt(70,objeto.getIdMantenimientoAplicacion()); cs.setString(71,objeto.getMantenimientoNombreProveedor()); cs.setInt(72,objeto.getIdSoporteAplicacion()); cs.setString(73,objeto.getSoporteNombrePorveedor()); cs.setInt(74,objeto.getIdAcessosAplicacion()); cs.setString(75,objeto.getAccesosNombreProveedor()); cs.setString(76,objeto.getNombreServidor()); cs.setString(77,objeto.getUbicacionServidor()); /**DATAMART**/ cs.setString(78,objeto.getNombreDatamart()); cs.setInt(79,objeto.getCantidadTablas()); cs.setInt(80,objeto.getCantidadTablasDescriptivas()); cs.setInt(81,objeto.getCantidadTablasHechos()); cs.setInt(82,objeto.getIdHerramientaExplotacionDatos()); cs.setString(83,objeto.getHerramientaExplotacionDatosOtros()); cs.setInt(84,objeto.getCantidadReportes()); cs.setInt(85,objeto.getCantidadUsuarios()); cs.setString(86,objeto.getFrecuencia()); cs.setString(87,objeto.getCantidadEspacioTablespace()); /**IMPACTOS**/ cs.setString(88,objeto.getImpactoFinanciero()); cs.setString(89,objeto.getRentabilidad()); cs.setString(90,objeto.getImpactoImagen()); cs.setString(91,objeto.getImpactoClientes()); cs.setString(92,objeto.getImpactoOperativo()); cs.setString(93,objeto.getImpactoLegal()); cs.setInt(94,objeto.getIdProcesoAuditoriaI()); cs.setInt(95,objeto.getIdTocaProcesoClave()); //cs.setString(96,objeto.getIndicarProcesoClave()); cs.setInt(96, objeto.getIdImpProcesoClave()); cs.setString(97,objeto.getOtrosProcesoClave()); cs.setInt(98,objeto.getActividadImpacto()); cs.setString(99,objeto.getCategoriaTecnologica()); cs.setString(100,objeto.getNivel_criticidad()); /**ROADMAP**/ cs.setString(101,objeto.getRoadmapCortoPlazo()); cs.setString(102,objeto.getRoadmapLargoPlazo()); cs.setInt(103,objeto.getIdEstadoAtencionRoadmap()); cs.setString(104,objeto.getFechaInicioPlanificado()); cs.setString(105,objeto.getFechaCompromiso()); cs.setString(106,objeto.getRoadmapEjecutadoActual()); /**PREATENCION**/ cs.setInt(107,objeto.getIdSwBaseEstandarSistemaOperativoPRE()); cs.setString(108,objeto.getSwBaseSistemaOperativoOtrosPRE()); cs.setInt(109,objeto.getIdSwBaseEstandarHeramientaProgramacionPRE()); cs.setString(110,objeto.getSwBaseHerramientaProgramacionOtrosPRE()); cs.setInt(111,objeto.getIdSwBaseEstandarLenguajeProgramacionPRE()); cs.setString(112,objeto.getSwBaseLenguajeProgramacionOtrosPRE()); cs.setInt(113,objeto.getIdSwBaseEstandarGestorBDPRE()); cs.setString(114,objeto.getSwBaseGestorBDOtrosPRE()); cs.setInt(115,objeto.getIdSwBaseEstandarFrameworkPRE()); cs.setString(116,objeto.getSwBaseFrameworkOtrosPRE()); cs.setString(117,objeto.getSwBaseObservacionesAdicionalesPRE()); cs.setInt(118,objeto.getIdAccesosGestionPrivilegiosSistemasPRE()); cs.setInt(119,objeto.getIdAccesosRevisionPrivilegiosUsuariosPRE()); cs.setInt(120,objeto.getIdAccesosGestionContrasenasPRE()); cs.setInt(121,objeto.getIdAccesosPoliticaContrasenasPRE()); cs.setInt(122,objeto.getIdAccesosGestionClaves1PRE()); cs.setInt(123,objeto.getIdAccesosGestionClaves2PRE()); cs.setInt(124,objeto.getIdAccesosGestionClaves3PRE()); cs.setInt(125,objeto.getIdAuditoriaRegistroAuditoriaPRE()); cs.setInt(126,objeto.getIdAuditoriaProteccionRegistrosAuditoriaPRE()); cs.setInt(127,objeto.getIdAuditoriaRegistroEventosAdministradoresPRE()); cs.setInt(128,objeto.getIdAuditoriaConformidadPoliticasPRE()); cs.setInt(129,objeto.getIdContingenciaPRE()); cs.setInt(130,objeto.getIdControlCambiosProcedimientosSwPRE()); cs.setInt(131,objeto.getIdControlCambiosProcedimientosInfraestructuraPRE()); cs.setInt(132,objeto.getIdDocumentacionManejoPRE()); cs.setInt(133,objeto.getIdIncidentesCumplimientoPoliticasAntivirusPRE()); cs.setInt(134,objeto.getIdIncidentesCumplimientoGestionParchesPRE()); cs.setInt(135,objeto.getIdIncidentesCumplimientoCodigoMaliciosoPRE()); cs.setInt(136,objeto.getIdIntegridadConfidencialidadDatosPruebaPRE()); cs.setInt(137,objeto.getIdRespaldosGestionRespaldoRecuperacionPRE()); /**POSTATENCION**/ cs.setInt(138,objeto.getIdSwBaseEstandarSistemaOperativoPOST()); cs.setString(139,objeto.getSwBaseSistemaOperativoOtrosPOST()); cs.setInt(140,objeto.getIdSwBaseEstandarHeramientaProgramacionPOST()); cs.setString(141,objeto.getSwBaseHerramientaProgramacionOtrosPOST()); cs.setInt(142,objeto.getIdSwBaseEstandarLenguajeProgramacionPOST()); cs.setString(143,objeto.getSwBaseLenguajeProgramacionOtrosPOST()); cs.setInt(144,objeto.getIdSwBaseEstandarGestorBDPOST()); cs.setString(145,objeto.getSwBaseGestorBDOtrosPOST()); cs.setInt(146,objeto.getIdSwBaseEstandarFrameworkPOST());/****/ cs.setString(147,objeto.getSwBaseFrameworkOtrosPOST()); cs.setString(148,objeto.getSwBaseObservacionesAdicionalesPOST()); cs.setInt(149,objeto.getIdAccesosGestionPrivilegiosSistemasPOST()); cs.setInt(150,objeto.getIdAccesosRevisionPrivilegiosUsuariosPOST()); cs.setInt(151,objeto.getIdAccesosGestionContrasenasPOST()); cs.setInt(152,objeto.getIdAccesosPoliticaContrasenasPOST()); cs.setInt(153,objeto.getIdAccesosGestionClaves1POST()); cs.setInt(154,objeto.getIdAccesosGestionClaves2POST()); cs.setInt(155,objeto.getIdAccesosGestionClaves3POST()); cs.setInt(156,objeto.getIdAuditoriaRegistroAuditoriaPOST()); cs.setInt(157,objeto.getIdAuditoriaProteccionRegistrosAuditoriaPOST()); cs.setInt(158,objeto.getIdAuditoriaRegistroEventosAdministradoresPOST()); cs.setInt(159,objeto.getIdAuditoriaConformidadPoliticasPOST()); cs.setInt(160,objeto.getIdContingenciaPOST()); cs.setInt(161,objeto.getIdControlCambiosProcedimientosSwPOST()); cs.setInt(162,objeto.getIdControlCambiosProcedimientosInfraestructuraPOST()); cs.setInt(163,objeto.getIdDocumentacionManejoPOST()); cs.setInt(164,objeto.getIdIncidentesCumplimientoPoliticasAntivirusPOST()); cs.setInt(165,objeto.getIdIncidentesCumplimientoGestionParchesPOST()); cs.setInt(166,objeto.getIdIncidentesCumplimientoCodigoMaliciosoPOST()); cs.setInt(167,objeto.getIdIntegridadConfidencialidadDatosPruebaPOST()); cs.setInt(168,objeto.getIdRespaldosGestionRespaldoRecuperacionPOST()); /**INFORMACIONADICIONAL**/ cs.setString(169,objeto.getEvaluacionSeguridadInformatica()); cs.setString(170,objeto.getSeguridadNivelExposicion()); cs.setInt(171,objeto.getIdEscenarioLogueo()); cs.setInt(172,objeto.getIdImpactoProteccionDatos()); cs.setInt(173,objeto.getIdImpactoProteccionDatosLevantamientoInformacion()); cs.setInt(174,objeto.getIdFuentePeriodo()); cs.setString(175,objeto.getDescripcionFuente()); cs.execute(); cnn.close(); cs.close(); } catch (SQLException ex) { throw ex; } return id; } public void eliminar(AplicacionEspecializada objeto) throws Exception { try { cnn = Conexion.getConexion(); CallableStatement cs = null; cs = cnn.prepareCall("call aplicacion_especializada_DELETE(?)"); cs.setInt(1, objeto.getIdAplicacionEspecializada()); cs.execute(); cnn.close(); cs.close(); } catch (SQLException ex) { throw ex; } } }
341e22ed0f9a3cfae5237a5ed9e3728e28a781f3
c9e0b88556149953d2e3c96a690423013da856a5
/share-app/user_center/src/test/java/com/soft1851/usercenter/service/UserServiceTest.java
63659eecc5d1856b293f89b8415c1421fecabe7d
[]
no_license
Mrqinforce/Spring-Cloud-Study
131de0df93307af22c6ab33aed906a1e5445d48f
3cadbad4cf441990e11e6fa51a5a5f60b90992d2
refs/heads/main
2023-01-08T20:54:22.915837
2020-10-18T13:43:59
2020-10-18T13:43:59
301,293,531
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
package com.soft1851.usercenter.service; import com.soft1851.usercenter.domain.entity.User; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import javax.annotation.Resource; @SpringBootTest class UserServiceTest { @Resource private UserService userService; @Test void findById() { User user = userService.findById(1); System.out.println(user); } }
216469bc3f5cea7bcaae7fcfac7c30093eb0a7fc
73ba28547f0a67eeb9703a2d5d850fefaa7759ab
/src/designmode/builder/ConcreteBuilder.java
a02ca3c84fe9b8cc142d07fd200809ef060e1e34
[]
no_license
AsummerCat/TestUtil
ecb3df60ec59035af08c0e919689c748cf80caed
dc50448d22d10d303e3e7349346639fcf0868002
refs/heads/master
2020-04-01T06:30:50.857220
2019-06-03T14:42:28
2019-06-03T14:42:28
152,951,341
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
package designmode.builder; /** * 创建具体的建造者(ConcreteBuilder):装机人员 */ //装机人员1 public class ConcreteBuilder extends Builder { //创建产品实例 Computer computer = new Computer(); //组装产品 @Override public void BuildCPU() { computer.add("组装CPU"); } @Override public void BuildMainboard() { computer.add("组装主板"); } @Override public void BuildHD() { computer.add("组装主板"); } //返回组装成功的电脑 @Override public Computer GetComputer() { return computer; } }
d945785d3a7c1e4dae0a8042937c5375f0a85951
b6511baa5e96750cf1fe81432e639a3632ca89ed
/src/parking/Main.java
38f91a920bf7001ae1f6070cac6ef55909509613
[]
no_license
shashank-shark/java-concurrency
5a57248e1c7b656d7a62e49db2bb4d34d7e24982
890857b62f3fe4965496d9c399cb77a2e7088c8c
refs/heads/master
2021-05-23T00:03:46.981079
2020-04-26T13:38:35
2020-04-26T13:38:35
253,148,319
0
0
null
null
null
null
UTF-8
Java
false
false
1,243
java
package parking; public class Main { public static void main(String[] args) { ParkingCash parkingCash = new ParkingCash(); ParkingStats parkingStats = new ParkingStats(parkingCash); System.out.printf("Parking Simulator\n"); // get the number of processors int numberOfSensors = 2 * Runtime.getRuntime().availableProcessors(); Thread[] threads = new Thread[numberOfSensors]; // initialize a new thread for (int i = 0; i < numberOfSensors; i++) { Sensor sensor = new Sensor(parkingStats); Thread thread = new Thread(sensor); thread.start(); threads[i] = thread; } // now we wait for the finalization of the threads using join() method for (int i = 0; i < numberOfSensors; i++) { try { threads[i].join(); } catch (InterruptedException interruptedException) { interruptedException.printStackTrace(); } } System.out.printf("Number of cars : %d\n", parkingStats.getNumberOfCars()); System.out.printf("Number of motorcycles : %d\n", parkingStats.getNumberOfMotorCycles()); parkingCash.close(); } }
c8824ebe0557b81b36cd84207ff9359eb094a220
8de02c99688c15963194edd9f3611c0923d3693f
/ehome-api/activity-api/src/main/java/com/busi/entity/Groupsetup.java
1e2316099ab30080645c5c87b91558878b8b0098
[]
no_license
yunjiayuan/ehome
5e6bf4b3e2b826b4fe3dd90ef2bb1a9469d47369
477c890bf35dbf076183a409414c08a336ad2c26
refs/heads/master
2022-06-23T03:29:21.472836
2021-08-10T06:22:21
2021-08-10T06:22:21
143,674,834
2
4
null
2022-06-17T01:56:27
2018-08-06T04:05:12
Java
UTF-8
Java
false
false
676
java
package com.busi.entity; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; import javax.validation.constraints.Min; import java.util.Date; /** * @program: 群消息设置 * @author: ZHaoJiaJie * @create: 2018-09-06 17:51 */ @Setter @Getter public class Groupsetup { private long id; @Min(value = 1, message = "userId参数有误") private long userId;//用户 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date addTime; //添加时间 private long groupId;//群ID private long setup;//群消息设置 :0接受消息并提醒 1接受消息但不提醒 2屏蔽群消息 }
2e7cefaae160f45d9ccf3353e411af4470742f45
49b168459a2d218b1de7f5bfe908c254a4eee402
/elivrariafront/src/main/java/br/com/elivrariafront/model/CartaoModelo.java
00dbae6cdad0dc9d0d07e5c41044be789e7c4567
[]
no_license
ocvictor/elivraria
172fd9d047c7f66fa561a9977e596f40bc2b1337
bfb073935d09b285633dca1efbd3577368bc7437
refs/heads/master
2022-12-22T05:25:34.294272
2020-07-06T19:44:18
2020-07-06T19:44:18
245,734,487
0
0
null
2022-12-16T11:09:00
2020-03-08T01:44:24
JavaScript
ISO-8859-1
Java
false
false
1,897
java
package br.com.elivrariafront.model; import java.io.Serializable; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.NotBlank; public class CartaoModelo implements Serializable { /** * */ private static final long serialVersionUID = 1L; private int cartaoId; @NotNull(message = "Insira a bandeira do Cartão") private int bandeiraId; @NotNull(message = "Insira o Numero do Cartão!") private long numeroCartao; @NotBlank(message = "Insira o Nome no Cartão!") private String nomeCartao; @NotNull(message = "Insira o Mês de Vencimento!") private int mesVencimento; @NotNull(message = "Insira o Ano de Vencimento!") private int anoVencimento; @NotNull(message = "Insira o CCV!") private int ccv; private String descricao; public int getBandeiraId() { return bandeiraId; } public void setBandeiraId(int bandeiraId) { this.bandeiraId = bandeiraId; } public long getNumeroCartao() { return numeroCartao; } public void setNumeroCartao(long numeroCartao) { this.numeroCartao = numeroCartao; } public String getNomeCartao() { return nomeCartao; } public void setNomeCartao(String nomeCartao) { this.nomeCartao = nomeCartao; } public int getMesVencimento() { return mesVencimento; } public void setMesVencimento(int mesVencimento) { this.mesVencimento = mesVencimento; } public int getAnoVencimento() { return anoVencimento; } public void setAnoVencimento(int anoVencimento) { this.anoVencimento = anoVencimento; } public int getCcv() { return ccv; } public void setCcv(int ccv) { this.ccv = ccv; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public int getCartaoId() { return cartaoId; } public void setCartaoId(int cartaoId) { this.cartaoId = cartaoId; } }
647ea2c3253ffa818d8628946382a9084fd773e1
3374f62c624c1e133ffcdd340713a50303cb7c6d
/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/CollectionUtils.java
1f6133ad1b75626e71cfc817a576cf25418e8fe3
[ "Apache-2.0" ]
permissive
DalavanCloud/isis
83b6d6437a3ca3b7e0442ed1b8b5dbc3ae67ef1e
2af2ef3e2edcb807d742f089839e0571d8132bd9
refs/heads/master
2020-04-29T10:08:49.816838
2019-02-11T23:35:56
2019-02-11T23:35:56
176,051,163
1
0
Apache-2.0
2019-03-17T03:19:31
2019-03-17T03:19:31
null
UTF-8
Java
false
false
3,507
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.isis.core.metamodel.specloader; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import org.apache.isis.applib.annotation.Programmatic; import org.apache.isis.core.metamodel.facetapi.FacetHolder; import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet; /** * Defines the types which are considered to be collections. * * <p> * In this way there are similarities with the way in which value types are * specified using <tt>@Value</tt>. However, we need to maintain a repository of * these collection types once nominated so that when we introspect classes we * look for collections first, and then properties second. */ public final class CollectionUtils { private CollectionUtils() {} public static boolean isCollectionType(final Class<?> cls) { return java.util.Collection.class.isAssignableFrom(cls); } public static boolean isArrayType(final Class<?> cls) { return cls.isArray(); } public static Class<?> inferFromArrayType(final Class<?> type) { if(!isArrayType(type)) { return null; } if (type.isArray()) { final Class<?> componentType = type.getComponentType(); return componentType; } return null; } @Programmatic public static Class<?> inferFromGenericParamType( final Class<?> parameterType, final Type genericParameterType) { if(!isCollectionType(parameterType)) { return null; } if(genericParameterType instanceof ParameterizedType) { final ParameterizedType parameterizedType = (ParameterizedType) genericParameterType; final Type[] actualTypeArguments = parameterizedType.getActualTypeArguments(); if(actualTypeArguments.length == 1) { final Type actualTypeArgument = actualTypeArguments[0]; if(actualTypeArgument instanceof Class) { final Class<?> actualType = (Class<?>) actualTypeArgument; return actualType; } } } return null; } /** * @return true means that either {@link CollectionUtils#inferFromGenericParamType(Class, Type)} or {@link TypeOfFacet.Util#inferFromArrayType(FacetHolder, Class, SpecificationLoader)} will return a non-null value. */ public static boolean isParamCollection( final Class<?> parameterType, final Type genericParameterType) { return inferFromGenericParamType(parameterType, genericParameterType) != null || inferFromArrayType(parameterType) != null; } }
05a1f03e1e7fbdced616ed4062a807af9a7c8dcb
0f720adce909028cd2a9409c5e5a57d47a33db78
/src/main/java/io/swagger/model/AccountResponse.java
2d6e11ea94ec0d1298d661739e0b63eeeb4efe2b
[]
no_license
GPossel/swagger-spring
05772afe81a78c1d024b9ac19465ecd926b4c9a7
3b66dbb867a117c53c6222195382257d3eeff26c
refs/heads/early_submission_1
2023-02-09T10:45:45.273898
2021-01-05T23:19:21
2021-01-05T23:19:21
326,714,347
0
1
null
2021-01-05T23:22:15
2021-01-04T14:45:20
Java
UTF-8
Java
false
false
1,012
java
package io.swagger.model; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; import javax.persistence.Column; import java.sql.Timestamp; import java.util.Date; import java.util.Objects; @NoArgsConstructor @Validated public class AccountResponse { @JsonProperty("iban") private String iban = null; @JsonProperty("userId") private Long userId = null; @JsonProperty("rank") private Account.RankEnum rank = null; @JsonProperty("balance") private Double balance = null; @JsonProperty("currency") private String currency = null; @JsonProperty("status") private Account.StatusEnum status = null; public AccountResponse(Account a) { this.iban = a.getIban(); this.userId = a.getUserId(); this.rank = a.getRank(); this.balance = a.getBalance(); this.currency = a.getCurrency(); this.status = a.getStatus(); } }
4299c85720f05ca8d9a22a03e7fd7d670d66946b
d7e33135e99b184e861ca7836bb6751e20283129
/app/src/main/java/com/victoralejandro/laboratorio3/AndroidButtonActivity.java
38c4c65b49339e88bdf8aeb19e671dbebff2be59
[]
no_license
victorskatepro/Laboratorio3
a146971ecdf8218134be34ec5d3473b35534ca21
18865a1836fb19ca74128fa37266855d9c9d4c5d
refs/heads/master
2021-01-20T11:10:29.481517
2017-08-28T16:58:05
2017-08-28T16:58:05
101,666,400
0
0
null
null
null
null
UTF-8
Java
false
false
364
java
package com.victoralejandro.laboratorio3; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class AndroidButtonActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_android_button); } }
782a13cca5983e8ff5d0d56885a14d22a13d90ef
fd6f156ce68a18912c0e7b8cd22e77d91f03f49e
/src/holding/ApplesAndOrangesWithoutGenerics.java
cb2e0a1aa74ebb993b5c49bf8f6122d0c36ba141
[]
no_license
pfjia/ThinkingInJava
70f40e654c82b512688247a15b62d16aa8fbafb5
d04b9d97085e3f6600d5a1ea1e9b16c5c60a9c39
refs/heads/master
2021-01-20T07:15:44.347917
2017-05-02T03:27:26
2017-05-02T03:27:26
89,985,699
0
0
null
null
null
null
GB18030
Java
false
false
929
java
package holding; import java.util.ArrayList; class Apple { private static long counter; private final long id = counter++; public long id() { return id; } } class Orange { } public class ApplesAndOrangesWithoutGenerics { @SuppressWarnings("unchecked") public static void main(String[] args) { ArrayList apples = new ArrayList(); for (int i = 0; i < 3; i++) { // Type safety: The method add(Object) belongs to the raw type // ArrayList. References to generic type ArrayList<E> should be // parameterized apples.add(new Apple()); } // Not prevented from adding an Orange to apples: apples.add(new Orange()); // for (int i = 0; i < apples.size(); i++) { // // 运行期错误 // ((Apple) apples.get(i)).id(); // } // 使用foreach是强制类型转换apples为ArrayList<Apple> for (Apple o : (ArrayList<Apple>) apples) { o.id(); } } }
edc10562cd9de30986253472d1b6455a40fb8c0f
ab5b7ffa0170a562536b890bd8a8d6646e898ca2
/src/main/java/com/koiwaLearning/api/service/ScoresService.java
db52bd641189d27b9b253163de34769b1ecc9e7f
[]
no_license
Panhungting/Test
700b4c54beb7f04a1b175363a7b5dc501bf83417
5e59dfb118ef23042fe4ec6224cff21e5c451809
refs/heads/master
2023-05-03T20:27:16.939740
2021-05-09T13:44:20
2021-05-09T13:44:20
358,880,707
0
1
null
2021-05-09T13:20:44
2021-04-17T13:04:44
Java
UTF-8
Java
false
false
938
java
package com.koiwaLearning.api.service; import com.koiwaLearning.api.domain.ScoreDetail; import com.koiwaLearning.api.domain.Scores; import com.koiwaLearning.api.mapper.ScoresMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class ScoresService { @Autowired private ScoresMapper scoresMapper; //検索 public List<Scores> getScores() { return scoresMapper.getScores(); } // 根据id查询一个Score public ScoreDetail getScore(String scoreId) { return scoresMapper.getScore(scoreId); } //追加 public int insertScores(Scores scores) {return scoresMapper.insertScores(scores);} //更新 public int updateScores(Scores scores) {return scoresMapper.updateScores(scores);} //削除 public int deleteScores(String sno) {return scoresMapper.deleteScores(sno);} }
81c8d3eda35f1523a8d7a681b2cbe20709b01aca
72ff314f91b74a9196a6b8ca5a57a4cb1ebf136b
/DecoratorPattern/src/decoratorpattern/SteamedMilk.java
fea4d65933442080ef120f3e2015b922701f08be
[]
no_license
DePacifier/Design-Patterns
661873d111ece485c6acb88fb15990d1e1a3d070
d912021a78fac510909db5395bdb1d9b17e104d5
refs/heads/master
2021-04-15T14:03:56.526479
2018-03-24T14:30:25
2018-03-24T14:30:25
126,607,231
0
0
null
null
null
null
UTF-8
Java
false
false
618
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package decoratorpattern; /** * * @author Milky */ public class SteamedMilk extends CondimentDecorator{ Beverage beverage; public SteamedMilk(Beverage beverage){ this.beverage = beverage; } public String getDescription(){ return beverage.getDescription() + ", Steamed Milk"; } public double cost(){ return 0.10 + beverage.cost(); } }
c3545574e431a25ca89c514e638e3899756cae63
31e4a54b6516bde524bcdcbb80cf3719e7b1959f
/src/main/java/org/rxjava/samples/FileReadWithObservable.java
f6edf113412cfd2c5ed78b348a307d02b1f1699a
[]
no_license
vivekr28/rxjava_samples
0b919c4dacc4e6127574963037170c46b09377a4
ea4ea19b99deebf9094bfb10f2f1284cf15af3cf
refs/heads/master
2022-12-14T19:48:49.059406
2020-09-13T12:34:18
2020-09-13T12:34:18
295,147,337
0
0
null
null
null
null
UTF-8
Java
false
false
2,194
java
package org.rxjava.samples; import io.reactivex.Observable; import io.reactivex.ObservableSource; import io.reactivex.Observer; import io.reactivex.disposables.Disposable; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.concurrent.TimeUnit; /** * This is a sample program to read a file using ObservableSource and have 10 retries in case of file read fails */ public class FileReadWithObservable { public void readFileWithRetries(List<String> files) { Observable<String> filesObs = Observable.fromIterable(files); FileObservableSource fileObservableSource = new FileObservableSource(files.get(0)); filesObs .flatMap(file -> new FileObservableSource(file)) .retryWhen(attempts -> { return attempts.take(10).delay(2, TimeUnit.SECONDS); }) .subscribe(new Observer<String>() { @Override public void onSubscribe(Disposable d) { } @Override public void onNext(String s) { System.out.println(s); } @Override public void onError(Throwable e) { System.out.println("Error!"); } @Override public void onComplete() { System.out.println("completed!"); } }); } static class FileObservableSource implements ObservableSource<String> { private final String filename; FileObservableSource(String filename) { this.filename = filename; } @Override public void subscribe(Observer<? super String> observer) { System.out.println(String.format("Trying to read file %s", Thread.currentThread().getName())); try { Files.lines(Paths.get(filename)).forEach(observer::onNext); observer.onComplete(); } catch (Exception e) { observer.onError(e); } } } }
c05a961c0a699bda495cbea8bbbbed0be14823e6
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/shopee/app/web/protocol/SearchConfigExtInfo.java
942e0b9a995e50ff8f08440ad42e312be28fca54
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.shopee.app.web.protocol; public final class SearchConfigExtInfo { private final String domainType; public SearchConfigExtInfo(String str) { this.domainType = str; } public final String getDomainType() { return this.domainType; } }
5e610ed26e8be81ac4934aea3dcc54ee4dfdc970
3e9aad2a4abc72fea5c1b04e105b118b67df6b87
/anr-base/anr-crud/src/main/java/com/chuang/anarres/crud/mapper/RoleMapper.java
b77b8f70b7e5774ab9b3d0ba3db23f7e3fda39e6
[]
no_license
quchuangh/anarres
59d09f2294bd704a26bd940abb06adde2327523b
bdc53e0a01aef633265688789652241df8883c27
refs/heads/master
2023-05-25T21:28:33.957449
2021-05-26T12:09:15
2021-05-26T12:09:15
365,678,251
1
1
null
null
null
null
UTF-8
Java
false
false
1,256
java
package com.chuang.anarres.crud.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.chuang.anarres.crud.entity.Role; import org.apache.ibatis.annotations.Select; import javax.annotation.Nullable; import java.util.List; /** * <p> * 角色表;角色 Mapper 接口 * </p> * * @author chuang * @since 2021-05-07 */ public interface RoleMapper extends BaseMapper<Role> { @Select("SELECT r.* " + "FROM sys_user_role ur LEFT JOIN sys_role r " + "ON ur.role_id = r.id " + "WHERE username = #{username} ") List<Role> findUserRoles(String username); @Select("SELECT r.* FROM sys_role r " + "LEFT JOIN sys_position p " + "ON r.role = p.role_code " + "LEFT JOIN sys_user_position up " + "ON p.id = up.position_id " + "WHERE username=#{username} ") @Nullable Role findPositionRole(String username); @Select("SELECT r.* FROM sys_role r " + "LEFT JOIN sys_organization o " + "ON r.role = o.role_code " + "LEFT JOIN sys_user_organization uo " + "ON o.id = uo.organization_id " + "WHERE username=#{username}") @Nullable Role findOrgRole(String username); }
101146e30a53474037e531d7f838d7b4d9ac63fd
e3a7622a4d2e16b1683c183568341b39c0de88b4
/EclipseProjects/Java基础/src/ch5/Shape/Circle.java
beb31dc12fdbde56becc782a2d481c620e2d4ffd
[]
no_license
TriggerDark/StudyCodes
937a8f6988cb475d275ff429cd32df823e457296
6f2f339d47dbae10d55d6b6da1d7e107f7dec85f
refs/heads/master
2022-02-09T13:52:10.895963
2019-03-30T13:38:55
2019-03-30T13:38:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
package ch5.Shape; public class Circle extends Shape{ @Override public void draw() { System.out.println("Circle.draw()"); } @Override public void erase() { System.out.println("Circle.erase()"); } }
efec7fdbef6bf9d42ee8b614147586c34b7874cf
299b29e2ce03be56d1b6ba63cde287df74395583
/src/YARS/YARSVisitor.java
81a3a3e81518c834586b5c16c568af668310840d
[ "MIT" ]
permissive
KarolLitman/yars-converter
f83a2f480d2f9def220d9130758e3a738c6842ef
58ee3a9e02fbe5c1537eaafee1e0be9e5abe5e8b
refs/heads/master
2020-04-05T02:31:21.192397
2018-11-24T12:06:32
2018-11-24T12:06:32
156,480,154
1
0
MIT
2018-11-24T10:39:28
2018-11-07T02:40:39
Java
UTF-8
Java
false
false
4,418
java
package YARS;// Generated from YARS.g4 by ANTLR 4.7.1 import org.antlr.v4.runtime.tree.ParseTreeVisitor; /** * This interface defines a complete generic visitor for a parse tree produced * by {@link YARSParser}. * * @param <T> The return type of the visit operation. Use {@link Void} for * operations with no return type. */ public interface YARSVisitor<T> extends ParseTreeVisitor<T> { /** * Visit a parse tree produced by {@link YARSParser#yars}. * @param ctx the parse tree * @return the visitor result */ T visitYars(YARSParser.YarsContext ctx); /** * Visit a parse tree produced by {@link YARSParser#statement}. * @param ctx the parse tree * @return the visitor result */ T visitStatement(YARSParser.StatementContext ctx); /** * Visit a parse tree produced by {@link YARSParser#directive}. * @param ctx the parse tree * @return the visitor result */ T visitDirective(YARSParser.DirectiveContext ctx); /** * Visit a parse tree produced by {@link YARSParser#declaration}. * @param ctx the parse tree * @return the visitor result */ T visitDeclaration(YARSParser.DeclarationContext ctx); /** * Visit a parse tree produced by {@link YARSParser#prefixDirective}. * @param ctx the parse tree * @return the visitor result */ T visitPrefixDirective(YARSParser.PrefixDirectiveContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pname}. * @param ctx the parse tree * @return the visitor result */ T visitPname(YARSParser.PnameContext ctx); /** * Visit a parse tree produced by {@link YARSParser#vertexDeclaration}. * @param ctx the parse tree * @return the visitor result */ T visitVertexDeclaration(YARSParser.VertexDeclarationContext ctx); /** * Visit a parse tree produced by {@link YARSParser#relationship}. * @param ctx the parse tree * @return the visitor result */ T visitRelationship(YARSParser.RelationshipContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pn_local}. * @param ctx the parse tree * @return the visitor result */ T visitPn_local(YARSParser.Pn_localContext ctx); /** * Visit a parse tree produced by {@link YARSParser#predicate}. * @param ctx the parse tree * @return the visitor result */ T visitPredicate(YARSParser.PredicateContext ctx); /** * Visit a parse tree produced by {@link YARSParser#vertex_name}. * @param ctx the parse tree * @return the visitor result */ T visitVertex_name(YARSParser.Vertex_nameContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair}. * @param ctx the parse tree * @return the visitor result */ T visitPair(YARSParser.PairContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_value_key}. * @param ctx the parse tree * @return the visitor result */ T visitPair_value_key(YARSParser.Pair_value_keyContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_lang_key}. * @param ctx the parse tree * @return the visitor result */ T visitPair_lang_key(YARSParser.Pair_lang_keyContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_vocab_key}. * @param ctx the parse tree * @return the visitor result */ T visitPair_vocab_key(YARSParser.Pair_vocab_keyContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_datatype_key}. * @param ctx the parse tree * @return the visitor result */ T visitPair_datatype_key(YARSParser.Pair_datatype_keyContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_any_key}. * @param ctx the parse tree * @return the visitor result */ T visitPair_any_key(YARSParser.Pair_any_keyContext ctx); /** * Visit a parse tree produced by {@link YARSParser#pair_value}. * @param ctx the parse tree * @return the visitor result */ T visitPair_value(YARSParser.Pair_valueContext ctx); /** * Visit a parse tree produced by {@link YARSParser#iri}. * @param ctx the parse tree * @return the visitor result */ T visitIri(YARSParser.IriContext ctx); /** * Visit a parse tree produced by {@link YARSParser#literal}. * @param ctx the parse tree * @return the visitor result */ T visitLiteral(YARSParser.LiteralContext ctx); /** * Visit a parse tree produced by {@link YARSParser#rdfLiteral}. * @param ctx the parse tree * @return the visitor result */ T visitRdfLiteral(YARSParser.RdfLiteralContext ctx); }
1797f44ac87cd317962acb14292266e11142d353
d5908051a1da7d02cc4b419fc3124c71d54967f2
/BlueJ/Lab27.1 Store/Item.java
64a2ce39d506f8cb5f7278bbfc924f56b1afb137
[]
no_license
jariss/apcs
c660ed0eb5cb5bae38ff417ec567783b44908377
ed7308be01a5bed46eb701f6b2b9a7d5cc5f3226
refs/heads/master
2020-03-15T22:59:50.162785
2018-05-07T01:14:45
2018-05-07T01:14:45
132,384,594
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
import apcslib.*; import chn.util.*; public class Item implements Comparable<Item> { private int myId; private int myInv; public Item(int id, int inv) { myId = id; myInv = inv; } public int getId(){ return myId; } public int getInv(){ return myInv; } public int compareTo(Item otherObject){ if(myId>(otherObject.myId)) return -1; else if(myId<(otherObject.myId)) return 1; else return 0; } public boolean equals(Item otherObject){ if(myId==(otherObject.myId)) return true; else return false; } @Override public String toString(){ return Format.right(myId,5) + "" + Format.right(myInv,5); } }
21475c932dd25a7d6cf6df92acb6dd947e874228
ad9bcc1df0953a6d159938be43dc0a6891c1609b
/src/javacertification/genericsandcollections/Generics4.java
bda61a8c85e280c3c4d00295876ed19a095071ce
[]
no_license
aalnct/Algorithms
a02a3a2488a5f5bc73fdeae8368b536ef42170c5
7afdfb67d135ad863b881786b3a97af8c9b27f93
refs/heads/master
2023-07-19T05:33:07.656202
2023-07-13T02:26:42
2023-07-13T02:26:42
186,515,855
1
0
null
null
null
null
UTF-8
Java
false
false
1,765
java
package javacertification.genericsandcollections; import java.util.ArrayList; import java.util.List; public class Generics4 { public static void main(String[] args) { List<? extends Number> list = new ArrayList<Integer>(); // extends keyword /** you cannot do this, because it * will never know if list is pointing * to List<Double> * this means writing is not guaranteed but reading is**/ // list.add(10); /** * so we cannot add any number to <? extends T></?> * but we can read from it since it will provide T or * subclass of T */ // super keyword /** * Reading is not guaranteed */ List<? super Integer> list1 = new ArrayList<Integer>(); List<? super Integer> list2 = new ArrayList<Number>(); List<? super Integer> list3 = new ArrayList<Object>(); String str = get("Hello"); System.out.println(str); ClassA11<Dog> classA11 = new ClassA11(); ClassA11<Animal> classA1 = new ClassA11(); // print1(classA1); print2(classA11); } public static <T> void print1 (ClassA11 <? extends Animal> obj) { // expected <? extends Animal> // obj.set(new Dog()); System.out.println(obj.get().getClass()); } public static <T> void print2 (ClassA11 <? super Dog> obj) { obj.set(new Dog()); System.out.println(obj.get().getClass()); } private static <T> T get (T t) { return t; } } class Animal { } class Dog extends Animal {} class Cat extends Animal {} class ClassA11<T> { T t; void set (T t) { this.t = t; } T get () { return t; } }
05512bb0e7891c8f01fb437b4721a2eee9483a59
585379df83f92a174b17bff3a92294da91558132
/SolicitudesSpring2/src/co/edu/udea/iw/dao/hibernate/SolicitudDAOHibernate.java
8732e2de409fd58c09871f2c4e9fe69141459732
[]
no_license
maribel1989/implementacion2
618809753dedab1f21dd1ebabc4e9036a7be41aa
12b694573b6962349d7b92bcab59f773c93f6e37
refs/heads/master
2021-01-21T11:56:40.591673
2017-05-19T04:26:43
2017-05-19T04:26:43
91,765,487
0
0
null
null
null
null
ISO-8859-2
Java
false
false
3,628
java
package co.edu.udea.iw.dao.hibernate; import java.util.ArrayList; import java.util.List; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import co.edu.udea.iw.dao.SolicitudDAO; import co.edu.udea.iw.dto.Dependencia; import co.edu.udea.iw.dto.Solicitud; import co.edu.udea.iw.exception.MyException; /** * Implementación de SolicitudDAO * * @author Maribel Chaverra Valencia - [email protected] * @since Java 1.7 * @version 1.0 */ public class SolicitudDAOHibernate implements SolicitudDAO { private SessionFactory sessionFactory; public SessionFactory getSessionFactory() { return sessionFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } // Metodo para crear una lista de Solicitudes @Override public List<Solicitud> get() throws MyException { // Creacion de sesion a la base de datos Session session = null; Criteria criteria = null; List<Solicitud> solicitud = new ArrayList<Solicitud>(); try { // Obtengo sesion a la base de datos session = sessionFactory.getCurrentSession(); criteria = session.createCriteria(Solicitud.class); solicitud = criteria.list(); } catch (HibernateException e) { throw new MyException("Se encontraron errores consultando las solicitudes", e); } finally { // if(session != null){ // session.close(); // } } return solicitud; } // Metodo para consultar una solicitud por medio del id @Override public Solicitud get(Long id) throws MyException { Session session = null; Criteria criteria = null; Solicitud solicitud = null; try { session = sessionFactory.getCurrentSession(); // Consulta a través del método load solicitud = (Solicitud) session.get(Solicitud.class, id); } catch (HibernateException e) { throw new MyException("Se encontraron errores consultando las Solicitudes", e); } finally { // if(session != null){ // session.close(); // } } return solicitud; } // Metodo para Insertar una nueva solicitud @Override public void insert(Solicitud solicitud) throws MyException { Session session = null; Transaction tx = null; try { session = sessionFactory.getCurrentSession(); // Para guardar una dependencia en la base de datos session.save(solicitud); } catch (HibernateException e) { throw new MyException("Ocurrio un error almacenando la solicitud", e); } finally { // if(session != null){ // session.close(); // } } } // Metodo para modificar una solicitud @Override public void update(Solicitud solicitud) throws MyException { Session session = null; Transaction tx = null; try { session = sessionFactory.getCurrentSession(); tx = session.beginTransaction(); session.update(solicitud); tx.commit(); } catch (HibernateException e) { throw new MyException("Ocurrio un error modificando la solicitud", e); } finally { } } // Metodo para borrar una solicitud @Override public void delete(Solicitud solicitud) throws MyException { Session session = null; Transaction tx = null; try { session = sessionFactory.getCurrentSession(); tx = session.beginTransaction(); session.delete(solicitud); tx.commit(); } catch (HibernateException e) { throw new MyException("Ocurrio un error eliminando la solicitud", e); } finally { } } }
[ "Maribel@Maribel-PC" ]
Maribel@Maribel-PC
952356d6a02cb4dbc73c2fbdd00adc72ada984ba
242b0492840a116aa2ca4d54774ea7f84fd7d142
/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java
b165e5a5d5c3e03319d0eb651e989969143be19b
[ "Apache-2.0" ]
permissive
smileyuchang/security
633df53c9eb147d26016e8d6456eb08c4a2d2d02
d326b9d31ad18b4d9f7d0f4f50fe172cc430b12c
refs/heads/master
2023-04-03T14:08:05.984555
2021-04-22T07:58:48
2021-04-22T07:58:48
361,603,658
1
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
package io.renren.modules.sys.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.gson.Gson; import io.renren.common.exception.RRException; import io.renren.common.utils.PageUtils; import io.renren.common.utils.Query; import io.renren.modules.sys.dao.SysConfigDao; import io.renren.modules.sys.entity.SysConfigEntity; import io.renren.modules.sys.redis.SysConfigRedis; import io.renren.modules.sys.service.SysConfigService; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.Map; @Service("sysConfigService") public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEntity> implements SysConfigService { @Autowired private SysConfigRedis sysConfigRedis; @Override public PageUtils queryPage(Map<String, Object> params) { String paramKey = (String)params.get("paramKey"); IPage<SysConfigEntity> page = this.page( new Query<SysConfigEntity>().getPage(params), new QueryWrapper<SysConfigEntity>() .like(StringUtils.isNotBlank(paramKey),"param_key", paramKey) .eq("status", 1) ); return new PageUtils(page); } @Override public void saveConfig(SysConfigEntity config) { this.save(config); sysConfigRedis.saveOrUpdate(config); } @Override @Transactional(rollbackFor = Exception.class) public void update(SysConfigEntity config) { this.updateById(config); sysConfigRedis.saveOrUpdate(config); } @Override @Transactional(rollbackFor = Exception.class) public void updateValueByKey(String key, String value) { baseMapper.updateValueByKey(key, value); sysConfigRedis.delete(key); } @Override @Transactional(rollbackFor = Exception.class) public void deleteBatch(Long[] ids) { for(Long id : ids){ SysConfigEntity config = this.getById(id); sysConfigRedis.delete(config.getParamKey()); } this.removeByIds(Arrays.asList(ids)); } @Override public String getValue(String key) { SysConfigEntity config = sysConfigRedis.get(key); if(config == null){ config = baseMapper.queryByKey(key); sysConfigRedis.saveOrUpdate(config); } return config == null ? null : config.getParamValue(); } @Override public <T> T getConfigObject(String key, Class<T> clazz) { String value = getValue(key); if(StringUtils.isNotBlank(value)){ return new Gson().fromJson(value, clazz); } try { return clazz.newInstance(); } catch (Exception e) { throw new RRException("获取参数失败"); } } }
[ "12345678" ]
12345678
7494240e70882262854efb815bdf0d080ca18346
25d2c9a2cdfb2e32f3148004722c8ae650e7238a
/code/source/tundra/assertion/object.java
91509b3efaf2eef6969b1fc441c0a74c3710f914
[ "MIT" ]
permissive
nidhi31jain/Tundra
6f77fd0172753950bbaea21c0eb88deca57b2eeb
388c3682dda98d2df9fed6221d5c4be54aa19d2f
refs/heads/master
2021-01-18T23:28:05.123771
2017-03-29T04:49:53
2017-03-29T04:49:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,709
java
package tundra.assertion; // -----( IS Java Code Template v1.2 // -----( CREATED: 2015-07-08 21:02:49 AEST // -----( ON-HOST: 192.168.66.129 import com.wm.data.*; import com.wm.util.Values; import com.wm.app.b2b.server.Service; import com.wm.app.b2b.server.ServiceException; // --- <<IS-START-IMPORTS>> --- // --- <<IS-END-IMPORTS>> --- public final class object { // ---( internal utility methods )--- final static object _instance = new object(); static object _newInstance() { return new object(); } static object _cast(Object o) { return (object)o; } // ---( server methods )--- public static final void equal (IData pipeline) throws ServiceException { // --- <<IS-START(equal)>> --- // @subtype unknown // @sigtype java 3.5 // [i] object:0:required $expected // [i] object:0:required $actual // [i] field:0:optional $message IDataCursor cursor = pipeline.getCursor(); try { Object expected = IDataUtil.get(cursor, "$expected"); Object actual = IDataUtil.get(cursor, "$actual"); String message = IDataUtil.getString(cursor, "$message"); equal(expected, actual, message); } finally { cursor.destroy(); } // --- <<IS-END>> --- } public static final void exists (IData pipeline) throws ServiceException { // --- <<IS-START(exists)>> --- // @subtype unknown // @sigtype java 3.5 // [i] object:0:optional $object // [i] field:0:optional $message IDataCursor cursor = pipeline.getCursor(); try { Object object = IDataUtil.get(cursor, "$object"); String message = IDataUtil.getString(cursor, "$message"); exist(object, message); } finally { cursor.destroy(); } // --- <<IS-END>> --- } public static final void instance (IData pipeline) throws ServiceException { // --- <<IS-START(instance)>> --- // @subtype unknown // @sigtype java 3.5 // [i] object:0:required $object // [i] field:0:required $class // [i] field:0:optional $message IDataCursor cursor = pipeline.getCursor(); try { Object object = IDataUtil.get(cursor, "$object"); String className = IDataUtil.getString(cursor, "$class"); String message = IDataUtil.getString(cursor, "$message"); instance(object, className, message); } finally { cursor.destroy(); } // --- <<IS-END>> --- } public static final void nothing (IData pipeline) throws ServiceException { // --- <<IS-START(nothing)>> --- // @subtype unknown // @sigtype java 3.5 // [i] object:0:optional $object // [i] field:0:optional $message IDataCursor cursor = pipeline.getCursor(); try { Object object = IDataUtil.get(cursor, "$object"); String message = IDataUtil.getString(cursor, "$message"); nothing(object, message); } finally { cursor.destroy(); } // --- <<IS-END>> --- } public static final void unequal (IData pipeline) throws ServiceException { // --- <<IS-START(unequal)>> --- // @subtype unknown // @sigtype java 3.5 // [i] object:0:required $expected // [i] object:0:required $actual // [i] field:0:optional $message IDataCursor cursor = pipeline.getCursor(); try { Object expected = IDataUtil.get(cursor, "$expected"); Object actual = IDataUtil.get(cursor, "$actual"); String message = IDataUtil.getString(cursor, "$message"); unequal(expected, actual, message); } finally { cursor.destroy(); } // --- <<IS-END>> --- } // --- <<IS-START-SHARED>> --- // asserts that two objects are equal public static void equal(Object expected, Object actual, String message) { if (!((expected == null && actual == null) || (expected != null && actual != null && expected.equals(actual)))) { if (message == null) { message = java.text.MessageFormat.format("Assertion failed: expected '{'{0}'}' is not equal to actual '{'{1}'}'", expected, actual); } else { message = java.text.MessageFormat.format("Assertion failed: {0} (expected '{'{1}'}' is not equal to actual '{'{2}'}')", message, expected, actual); } throw new AssertionError(message); } } // asserts that two objects are not equal public static void unequal(Object expected, Object actual, String message) { if ((expected == null && actual == null) || (expected != null && actual != null && expected.equals(actual))) { if (message == null) { message = java.text.MessageFormat.format("Assertion failed: expected '{'{0}'}' is equal to actual '{'{1}'}'", expected, actual); } else { message = java.text.MessageFormat.format("Assertion failed: {0} (expected '{'{1}'}' is equal to actual '{'{2}'}')", message, expected, actual); } throw new AssertionError(message); } } // asserts that the given object is an instance of the given class public static void instance(Object object, String className, String message) { if (message == null) { message = java.text.MessageFormat.format("Assertion failed: object '{'{0}'}' is not an instance of class '{'{1}'}'", object, className); } else { message = java.text.MessageFormat.format("Assertion failed: {0} (object '{'{1}'}' is not an instance of class '{'{2}'}')", message, object, className); } try { Class klass = Class.forName(className); if (!klass.isInstance(object)) { throw new AssertionError(message); } } catch (ClassNotFoundException ex) { throw new AssertionError(message); } } // asserts that the given object is null public static void nothing(Object object, String message) { if (object != null) { if (message == null) { message = java.text.MessageFormat.format("Assertion failed: object is not null '{'{0}'}'", object); } else { message = java.text.MessageFormat.format("Assertion failed: {0} (object is not null '{'{1}'}')", message, object); } throw new AssertionError(message); } } // asserts that the given object is not null public static void exist(Object object, String message) { if (object == null) { if (message == null) { message = java.text.MessageFormat.format("Assertion failed: object is null '{'{0}'}'", object); } else { message = java.text.MessageFormat.format("Assertion failed: {0} (object is null '{'{1}'}')", message, object); } throw new AssertionError(message); } } // --- <<IS-END-SHARED>> --- }
28332547cc356f0fd4ed298ce84c42b5fd43c96e
76a541f6efbdfcbeb4f880bac0d929ca24552de3
/src/br/uece/ps/mediator/Aplicacao.java
07afd0acd8aa4d73e51062e29bf0644c26432c3b
[]
no_license
rediniz/patterns
d46fc74b8f05f595f1cdcae8f0179401b471ce86
1eebb764017cb920724ca9bb5ccdd729769e25bc
refs/heads/master
2020-03-27T08:10:10.325334
2018-09-19T12:08:10
2018-09-19T12:08:10
146,226,576
0
1
null
null
null
null
UTF-8
Java
false
false
924
java
package br.uece.ps.mediator; public class Aplicacao { public static void main(String[] args) { Classroom classroom = new ClassroomImpl(); Student student1 = new Student("Renato"); Student student2 = new Student("Edgar"); Teacher teacher = new Teacher("Paulo Henrique"); classroom.addMember(student1); classroom.addMember(student2); classroom.addMember(teacher); System.out.println("\n---------------------------------------\n"); teacher.act(Action.SEND_PAPER); System.out.println("\n---------------------------------------\n"); student1.act(Action.SEND_PAPER); System.out.println("\n---------------------------------------\n"); Student student3 = new Student("Novo"); classroom.addMember(student3); System.out.println("\n---------------------------------------\n"); student2.act(Action.SEND_MESSAGE); System.out.println("\n---------------------------------------\n"); } }
da550d4ea54df98514205511bfbdcbbe69e2d553
576f0b0f13a0344b30eb1f80e73022ef2dc72088
/notifier.parent/notifier.controller/src/main/java/notifier/bus/controller/register/TokenRegister.java
ab16a2eab505473d4d0cf04e15666a99b03bd4ff
[]
no_license
undefinedcommand/HackaTYN.greetgo.Lesenka_coderov
2748b7fc10d6ab6f8fbedfbc486f3688a99b54c7
51a601529f7ecaa7cc6b80eb0e781bd10ae0e741
refs/heads/master
2021-05-09T17:19:38.885963
2018-01-28T00:54:49
2018-01-28T00:54:49
119,135,426
0
0
null
null
null
null
UTF-8
Java
false
false
162
java
package notifier.bus.controller.register; /** * Created by daniyar on 28/01/18. */ public interface TokenRegister { public void saveToken(String token); }
59753dbeeea6b6559ec577668275e6a0d9ed2505
ab579571a44b54de5735f6cc43ba76bebea14bc8
/ph-config/src/main/java/com/helger/config/source/res/ConfigurationSourceJson.java
5acc1c279946632db4500e2cf764cb1db65716dc
[ "Apache-2.0" ]
permissive
luchao0111/ph-commons
39db738d27b7bf509dd464d60dcaa5623abc5eb3
edaa38c7198e0abbf636278c7e3e044f5c2eafc1
refs/heads/master
2022-07-29T05:42:51.138502
2020-05-20T21:58:30
2020-05-20T21:58:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,698
java
/** * Copyright (C) 2014-2020 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * 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.helger.config.source.res; import java.nio.charset.Charset; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.helger.commons.annotation.Nonempty; import com.helger.commons.annotation.ReturnsMutableCopy; import com.helger.commons.collection.impl.CommonsLinkedHashMap; import com.helger.commons.collection.impl.ICommonsOrderedMap; import com.helger.commons.io.resource.IReadableResource; import com.helger.commons.string.ToStringGenerator; import com.helger.config.source.IConfigurationSource; import com.helger.json.IJson; import com.helger.json.IJsonArray; import com.helger.json.IJsonObject; import com.helger.json.serialize.JsonReader; /** * Implementation of {@link IConfigurationSource} for properties file based * configuration sources. * * @author Philip Helger */ @Immutable public class ConfigurationSourceJson extends AbstractConfigurationSourceResource { public static final char LEVEL_SEPARATOR = '.'; public static final String ARRAY_SUFFIX_COUNT = "$count"; private static final Logger LOGGER = LoggerFactory.getLogger (ConfigurationSourceJson.class); private final ICommonsOrderedMap <String, String> m_aProps; private static void _recursiveFlattenJson (@Nonnull final String sNamePrefix, @Nonnull final IJson aJson, @Nonnull final Map <String, String> aTarget) { if (aJson.isValue ()) aTarget.put (sNamePrefix, aJson.getAsValue ().getAsString ()); else if (aJson.isObject ()) { for (final Map.Entry <String, IJson> aEntry : aJson.getAsObject ()) _recursiveFlattenJson (sNamePrefix + LEVEL_SEPARATOR + aEntry.getKey (), aEntry.getValue (), aTarget); } else { final IJsonArray aArray = aJson.getAsArray (); aTarget.put (sNamePrefix + LEVEL_SEPARATOR + ARRAY_SUFFIX_COUNT, Integer.toString (aArray.size ())); int nIndex = 0; for (final IJson aEntry : aArray) { _recursiveFlattenJson (sNamePrefix + LEVEL_SEPARATOR + nIndex, aEntry, aTarget); nIndex++; } } } /** * Constructor with default priority and default charset * * @param aRes * Resource to read from. May not be <code>null</code>. */ public ConfigurationSourceJson (@Nonnull final IReadableResource aRes) { this (SOURCE_TYPE.getDefaultPriority (), aRes, (Charset) null); } /** * Constructor with default priority * * @param aRes * Resource to read from. May not be <code>null</code>. * @param aCharset * Character set to use. May be <code>null</code>. */ public ConfigurationSourceJson (@Nonnull final IReadableResource aRes, @Nullable final Charset aCharset) { this (SOURCE_TYPE.getDefaultPriority (), aRes, aCharset); } /** * Constructor with default charset * * @param nPriority * Configuration source priority. * @param aRes * Resource to read from. May not be <code>null</code>. */ public ConfigurationSourceJson (final int nPriority, @Nonnull final IReadableResource aRes) { this (nPriority, aRes, (Charset) null); } /** * Constructor * * @param nPriority * Configuration source priority. * @param aRes * Resource to read from. May not be <code>null</code>. * @param aCharset * Character set to use. May be <code>null</code>. */ public ConfigurationSourceJson (final int nPriority, @Nonnull final IReadableResource aRes, @Nullable final Charset aCharset) { super (nPriority, aRes); final JsonReader.Builder aBuilder = JsonReader.builder () .setSource (aRes, aCharset != null ? aCharset : JsonReader.DEFAULT_CHARSET) .setCustomizeCallback (aParser -> aParser.setRequireStringQuotes (false) .setAllowSpecialCharsInStrings (true) .setAlwaysUseBigNumber (true) .setTrackPosition (true)) .setCustomExceptionCallback (ex -> LOGGER.error ("Failed to parse '" + aRes.getPath () + "' to JSON: " + ex.getMessage ())); final IJsonObject aProps = aBuilder.hasSource () ? aBuilder.readAsObject () : null; if (aProps != null) { m_aProps = new CommonsLinkedHashMap <> (); for (final Map.Entry <String, IJson> aEntry : aProps) _recursiveFlattenJson (aEntry.getKey (), aEntry.getValue (), m_aProps); } else m_aProps = null; } public boolean isInitializedAndUsable () { return m_aProps != null; } @Nullable public String getConfigurationValue (@Nonnull @Nonempty final String sKey) { return m_aProps == null ? null : m_aProps.get (sKey); } @Nonnull @ReturnsMutableCopy public ICommonsOrderedMap <String, String> getAllConfigItems () { return new CommonsLinkedHashMap <> (m_aProps); } @Override public boolean equals (final Object o) { // New field, no change return super.equals (o); } @Override public int hashCode () { // New field, no change return super.hashCode (); } @Override public String toString () { return ToStringGenerator.getDerived (super.toString ()).append ("Properties", m_aProps).getToString (); } }
e8ef738a8476f4fb31cba3d69c810318054e174b
291b164a5f564790b4b481fb227bf8a5f7b4b3c7
/PL15/src/main/java/com/mycompany/pl15/MainApp.java
5adbfa27a6095d44870533b983b68d948fe62f64
[]
no_license
helfer1991/PPROG
765bb6cf3d3918f6fac028027ba0643d28cb6207
b482247998106c63c4e3479699bece553474c5e1
refs/heads/master
2021-03-06T05:36:31.893482
2020-05-06T03:27:12
2020-05-06T03:27:12
246,182,759
1
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
package com.mycompany.pl15; import javafx.application.Application; import static javafx.application.Application.launch; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class MainApp extends Application { @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("/fxml/Scene.fxml")); Scene scene = new Scene(root); scene.getStylesheets().add("/styles/Styles.css"); stage.setTitle("Contador de cliques"); stage.setScene(scene); stage.show(); } /** * The main() method is ignored in correctly deployed JavaFX application. * main() serves only as fallback in case the application can not be * launched through deployment artifacts, e.g., in IDEs with limited FX * support. NetBeans ignores main(). * * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
8d9f99568e2ec7bf6619fee775d44ad6982d067a
e0d3a4f81fff0aec54d1ae96a165fa096e396964
/src/chap10/exericse/Exercise10_1.java
a0ea84bc2f6d277eb17c3f218e0040d8c56f87df
[]
no_license
myj4513/java-study
d262fbb85ccd5176db58d323dcb702bd35233814
6b0b1db95cfe0b841525cd8f983777e358dfc19f
refs/heads/master
2023-06-25T05:25:04.264315
2021-07-24T12:54:16
2021-07-24T12:54:16
381,020,555
0
0
null
null
null
null
UHC
Java
false
false
653
java
package chap10.exericse; import java.text.SimpleDateFormat; import java.time.*; import java.util.Calendar; import java.util.Date; public class Exercise10_1 { public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd은 F번째 E요일입니다."); Calendar from = Calendar.getInstance(); Calendar to = Calendar.getInstance(); from.set(2010, 0, 1); to.set(2010, 11, 31); for(;from.before(to);from.add(Calendar.DATE,1)) { if(from.get(Calendar.DAY_OF_WEEK)==1 && from.get(Calendar.DAY_OF_WEEK_IN_MONTH)==2) { Date day = from.getTime(); System.out.println(sdf.format(day)); } } } }
b37690d4345353cc446becccf1897f7788fc9bea
f7338372de8fd9e98149ce6a7020237c259f51cb
/Source/UnconventionalChess/multiagentchessgateway/src/main/java/stacs/chessgateway/ChessgatewayApplication.java
17b558092fd63cd773276358f117469dc4eb3959
[]
no_license
TheDuckGoesQuark/UnconventionalChess
488c6dce2a7bfd8db2e49d9eed380af44d0b9008
892cd723580fecd4b311163524806ce927f3999a
refs/heads/master
2022-04-14T20:41:35.410288
2020-04-15T18:23:32
2020-04-15T18:23:32
208,792,905
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package stacs.chessgateway; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ChessgatewayApplication { public static void main(String[] args) { SpringApplication.run(ChessgatewayApplication.class, args); } }
39b0265e821e017d4f9b4d2129f0e9f2645cd021
e4aea93f2988e2cf1be4f96a39f6cc3328cbbd50
/src/com/flagleader/repository/rlm/value/SheetFieldMapping.java
c3d9b1b3876d7cf701b566f0834fc4c0fbb7b9a5
[]
no_license
lannerate/ruleBuilder
18116282ae55e9d56e9eb45d483520f90db4a1a6
b5d87495990aa1988adf026366e92f7cbb579b19
refs/heads/master
2016-09-05T09:13:43.879603
2013-11-10T08:32:58
2013-11-10T08:32:58
14,231,127
0
1
null
null
null
null
UTF-8
Java
false
false
8,016
java
package com.flagleader.repository.rlm.value; import com.flagleader.repository.IElement; import com.flagleader.repository.RepositoryVisitor; import com.flagleader.repository.db.FieldModel; import com.flagleader.repository.lang.g; import com.flagleader.repository.lang.h; import com.flagleader.repository.rlm.AbstractRuleObject; import com.flagleader.repository.rlm.editen.b; import com.flagleader.repository.rom.IBusinessObject; import com.flagleader.repository.rom.IPropertyObject; import com.flagleader.repository.tree.Envionment; import com.flagleader.repository.tree.IRuleContainer; import java.util.List; public class SheetFieldMapping extends AbstractRuleObject { private String fieldUuid = ""; private String fieldUnique = ""; private String mappingUuid = ""; private String mappingUnique = ""; private int mappingType = 0; public static final int DEFAULTTYPE = 0; public static final int WHERETYPE = 1; public SheetFieldMapping() { } public SheetFieldMapping(IBusinessObject paramIBusinessObject1, IBusinessObject paramIBusinessObject2) { this.fieldUuid = paramIBusinessObject2.getUuid(); this.fieldUnique = paramIBusinessObject2.getUniqueName(); setMappingField(paramIBusinessObject1); } public SheetFieldMapping(SheetFieldMapping paramSheetFieldMapping) { super(paramSheetFieldMapping); this.fieldUuid = paramSheetFieldMapping.fieldUuid; this.fieldUnique = paramSheetFieldMapping.fieldUnique; this.mappingUuid = paramSheetFieldMapping.mappingUuid; this.mappingUnique = paramSheetFieldMapping.mappingUnique; this.mappingType = paramSheetFieldMapping.mappingType; } public IBusinessObject getField() { Object localObject = getEnvionment().getBusinessObject(getFieldUuid(), getFieldUnique()); if ((localObject == null) && ((getParent() instanceof b))) { String str = getFieldUnique(); if (str.indexOf(".") >= 0) str = str.substring(str.indexOf(".") + 1); List localList = ((b)getParent()).getCanSelectFields(); for (int i = 0; (localList != null) && (i < localList.size()); i++) { if ((localList.get(i) instanceof FieldModel)) { if ((!str.equalsIgnoreCase(((FieldModel)localList.get(i)).getFieldName())) && (!str.equalsIgnoreCase(((FieldModel)localList.get(i)).getDisplayName()))) continue; localObject = (FieldModel)localList.get(i); break; } if ((!(localList.get(i) instanceof IPropertyObject)) || ((!str.equalsIgnoreCase(((IPropertyObject)localList.get(i)).getVariableName())) && (!str.equalsIgnoreCase(((IPropertyObject)localList.get(i)).getDisplayName())))) continue; localObject = (IPropertyObject)localList.get(i); break; } } if ((localObject != null) && ((!((IBusinessObject)localObject).getUuid().equals(getFieldUuid())) || (!((IBusinessObject)localObject).getUniqueName().equals(getFieldUnique())))) { setField((IBusinessObject)localObject); if (getRoot() != null) getRoot().setNeedSave(); } return (IBusinessObject)localObject; } public void setField(IBusinessObject paramIBusinessObject) { this.fieldUuid = paramIBusinessObject.getUuid(); this.fieldUnique = paramIBusinessObject.getUniqueName(); } public IBusinessObject getMappingField() { Object localObject = getEnvionment().getBusinessObject(getMappingUuid(), getMappingUnique()); if ((localObject == null) && ((getParent() instanceof b))) { String str = getMappingUnique(); if (str.indexOf(".") >= 0) str = str.substring(str.indexOf(".") + 1); List localList = ((b)getParent()).getCanSelectSourceFields(); for (int i = 0; (localList != null) && (i < localList.size()); i++) { if ((localList.get(i) instanceof FieldModel)) { if ((!str.equalsIgnoreCase(((FieldModel)localList.get(i)).getFieldName())) && (!str.equalsIgnoreCase(((FieldModel)localList.get(i)).getDisplayName()))) continue; localObject = (FieldModel)localList.get(i); break; } if ((!(localList.get(i) instanceof IPropertyObject)) || ((!str.equalsIgnoreCase(((IPropertyObject)localList.get(i)).getVariableName())) && (!str.equalsIgnoreCase(((IPropertyObject)localList.get(i)).getDisplayName())))) continue; localObject = (IPropertyObject)localList.get(i); break; } } if ((localObject != null) && ((!((IBusinessObject)localObject).getUuid().equals(getMappingUuid())) || (!((IBusinessObject)localObject).getUniqueName().equals(getMappingUnique())))) { setMappingField((IBusinessObject)localObject); if (getRoot() != null) getRoot().setNeedSave(); } return (IBusinessObject)localObject; } public void setMappingField(IBusinessObject paramIBusinessObject) { this.mappingUuid = paramIBusinessObject.getUuid(); this.mappingUnique = paramIBusinessObject.getUniqueName(); } public Object acceptVisitor(RepositoryVisitor paramRepositoryVisitor) { return paramRepositoryVisitor.visitSheetFieldMapping(this); } public IElement deepClone() { return new SheetFieldMapping(this); } public String getName() { return "SheetFieldMapping"; } public IBusinessObject getMemberElement() { IBusinessObject localIBusinessObject = null; if ((getFieldUuid().length() > 0) || (getFieldUnique().length() > 0)) localIBusinessObject = a(getFieldUuid(), getFieldUnique()); if (localIBusinessObject != null) { if (!localIBusinessObject.getUuid().equals(getFieldUuid())) { setFieldUuid(localIBusinessObject.getUuid()); if (getRoot() != null) getRoot().setNeedSave(); } setFieldUnique(localIBusinessObject.getUniqueName()); } return localIBusinessObject; } protected IBusinessObject a(String paramString1, String paramString2) { IBusinessObject localIBusinessObject = null; Envionment localEnvionment = getEnvionment(); if (localEnvionment != null) localIBusinessObject = localEnvionment.getBusinessObject(paramString1, paramString2); if ((localIBusinessObject instanceof IBusinessObject)) return (IBusinessObject)localIBusinessObject; return null; } public g getJavaType() { IBusinessObject localIBusinessObject = a(getFieldUuid(), getFieldUnique()); if ((localIBusinessObject != null) && ((localIBusinessObject instanceof IBusinessObject))) return localIBusinessObject.getJavaType(); return getTypeManager().a(""); } public String getFieldUuid() { return this.fieldUuid; } public void setFieldUuid(String paramString) { this.fieldUuid = paramString; } public String toString() { return "(" + this.fieldUnique + ") as " + getMappingUnique(); } protected Object clone() { return new SheetFieldMapping(this); } public String getFieldUnique() { return this.fieldUnique; } public void setFieldUnique(String paramString) { this.fieldUnique = paramString; } public String getMappingUuid() { return this.mappingUuid; } public void setMappingUuid(String paramString) { this.mappingUuid = paramString; } public String getMappingUnique() { return this.mappingUnique; } public void setMappingUnique(String paramString) { this.mappingUnique = paramString; } public int getMappingType() { return this.mappingType; } public void setMappingType(int paramInt) { this.mappingType = paramInt; } } /* Location: D:\Dev_tools\ruleEngine\rbuilder.jar * Qualified Name: com.flagleader.repository.rlm.value.SheetFieldMapping * JD-Core Version: 0.6.0 */
3f6a0acdaf43ebf207e62ea3e0bcc88b576bfee8
93162d0a36ee79f9063e3467a9621242543e1046
/test10/src/by/main/simplest_classes_and_objects/class10/View.java
b8ab71062caf43288ccb35a8f5ea76bcaff3bf1e
[]
no_license
ilikob/Programming-with-classes
3599e16a0bad99d84a962b65c0138ff4b47192ef
2918e1dff4cc5bf2f92ed2449ed651ed974f9039
refs/heads/main
2023-03-02T00:49:18.932103
2021-02-08T17:26:00
2021-02-08T17:26:00
331,357,758
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package by.main.simplest_classes_and_objects.class10; import java.util.Scanner; public class View { static Scanner scanner=new Scanner(System.in); public static String readString() { return scanner.next(); } public static int readInt() { while(!scanner.hasNextInt()) { scanner.next(); } return scanner.nextInt(); } }
8ec6a83ac1ca24d447a0b330cefb92245b782232
ea6d03cb7ccd659eb6665ec580eeffd8e01a8302
/src/daewooInfo/warehouse/bean/WareHouseItemDetailVO.java
8f3c80928f0d22a9433d5e6e139d4eb6ffcb12a4
[]
no_license
pchul1/wpcs
c389d3793a2f2466812d9875b2bfe00d6f9e5687
932d310c307d3204c89eebaa9ad4aba69777c0a0
refs/heads/master
2020-04-20T04:59:01.464291
2019-04-24T01:04:05
2019-04-24T01:04:05
168,644,223
0
0
null
null
null
null
UTF-8
Java
false
false
28,374
java
package daewooInfo.warehouse.bean; import java.io.Serializable; public class WareHouseItemDetailVO implements Serializable { private String itemCode; private String txtGoodCode; private String txtGoodCode_2; private String itemtr0td0; private String itemtr0td1; private String itemtr0td2; private String itemtr0td3; private String itemtr1td0; private String itemtr1td1; private String itemtr1td2; private String itemtr1td3; private String itemtr2td0; private String itemtr2td1; private String itemtr2td2; private String itemtr2td3; private String itemtr3td0; private String itemtr3td1; private String itemtr3td2; private String itemtr3td3; private String itemtr4td0; private String itemtr4td1; private String itemtr4td2; private String itemtr4td3; private String itemtr5td0; private String itemtr5td1; private String itemtr5td2; private String itemtr5td3; private String itemtr6td0; private String itemtr6td1; private String itemtr6td2; private String itemtr6td3; private String itemtr7td0; private String itemtr7td1; private String itemtr7td2; private String itemtr7td3; private String itemtr8td0; private String itemtr8td1; private String itemtr8td2; private String itemtr8td3; private String itemtr9td0; private String itemtr9td1; private String itemtr9td2; private String itemtr9td3; private String itemtr10td0; private String itemtr10td1; private String itemtr10td2; private String itemtr10td3; private String itemtr11td0; private String itemtr11td1; private String itemtr11td2; private String itemtr11td3; private String itemtr12td0; private String itemtr12td1; private String itemtr12td2; private String itemtr12td3; private String itemtr13td0; private String itemtr13td1; private String itemtr13td2; private String itemtr13td3; private String itemtr14td0; private String itemtr14td1; private String itemtr14td2; private String itemtr14td3; private String itemtr15td0; private String itemtr15td1; private String itemtr15td2; private String itemtr15td3; private String itemtr16td0; private String itemtr16td1; private String itemtr16td2; private String itemtr16td3; private String itemtr17td0; private String itemtr17td1; private String itemtr17td2; private String itemtr17td3; private String itemtr18td0; private String itemtr18td1; private String itemtr18td2; private String itemtr18td3; private String itemtr19td0; private String itemtr19td1; private String itemtr19td2; private String itemtr19td3; private String itemtr20td0; private String itemtr20td1; private String itemtr20td2; private String itemtr20td3; private String itemtr21td0; private String itemtr21td1; private String itemtr21td2; private String itemtr21td3; private String itemtr22td0; private String itemtr22td1; private String itemtr22td2; private String itemtr22td3; private String itemtr23td0; private String itemtr23td1; private String itemtr23td2; private String itemtr23td3; private String itemtr24td0; private String itemtr24td1; private String itemtr24td2; private String itemtr24td3; private String itemtr25td0; private String itemtr25td1; private String itemtr25td2; private String itemtr25td3; private String itemtr26td0; private String itemtr26td1; private String itemtr26td2; private String itemtr26td3; private String itemtr27td0; private String itemtr27td1; private String itemtr27td2; private String itemtr27td3; private String itemtr28td0; private String itemtr28td1; private String itemtr28td2; private String itemtr28td3; private String itemtr29td0; private String itemtr29td1; private String itemtr29td2; private String itemtr29td3; private String itemtr30td0; private String itemtr30td1; private String itemtr30td2; private String itemtr30td3; private String itemtr31td0; private String itemtr31td1; private String itemtr31td2; private String itemtr31td3; private String itemtr32td0; private String itemtr32td1; private String itemtr32td2; private String itemtr32td3; private String itemtr33td0; private String itemtr33td1; private String itemtr33td2; private String itemtr33td3; private String itemtr34td0; private String itemtr34td1; private String itemtr34td2; private String itemtr34td3; private String itemtr35td0; private String itemtr35td1; private String itemtr35td2; private String itemtr35td3; private String itemtr36td0; private String itemtr36td1; private String itemtr36td2; private String itemtr36td3; private String itemtr37td0; private String itemtr37td1; private String itemtr37td2; private String itemtr37td3; private String itemtr38td0; private String itemtr38td1; private String itemtr38td2; private String itemtr38td3; private String itemtr39td0; private String itemtr39td1; private String itemtr39td2; private String itemtr39td3; public String getItemCode() { return itemCode; } public void setItemCode(String itemCode) { this.itemCode = itemCode; } public String getItemtr0td0() { return itemtr0td0; } public void setItemtr0td0(String itemtr0td0) { this.itemtr0td0 = itemtr0td0; } public String getItemtr0td1() { return itemtr0td1; } public void setItemtr0td1(String itemtr0td1) { this.itemtr0td1 = itemtr0td1; } public String getItemtr0td2() { return itemtr0td2; } public void setItemtr0td2(String itemtr0td2) { this.itemtr0td2 = itemtr0td2; } public String getItemtr0td3() { return itemtr0td3; } public void setItemtr0td3(String itemtr0td3) { this.itemtr0td3 = itemtr0td3; } public String getItemtr1td0() { return itemtr1td0; } public void setItemtr1td0(String itemtr1td0) { this.itemtr1td0 = itemtr1td0; } public String getItemtr1td1() { return itemtr1td1; } public void setItemtr1td1(String itemtr1td1) { this.itemtr1td1 = itemtr1td1; } public String getItemtr1td2() { return itemtr1td2; } public void setItemtr1td2(String itemtr1td2) { this.itemtr1td2 = itemtr1td2; } public String getItemtr1td3() { return itemtr1td3; } public void setItemtr1td3(String itemtr1td3) { this.itemtr1td3 = itemtr1td3; } public String getItemtr2td0() { return itemtr2td0; } public void setItemtr2td0(String itemtr2td0) { this.itemtr2td0 = itemtr2td0; } public String getItemtr2td1() { return itemtr2td1; } public void setItemtr2td1(String itemtr2td1) { this.itemtr2td1 = itemtr2td1; } public String getItemtr2td2() { return itemtr2td2; } public void setItemtr2td2(String itemtr2td2) { this.itemtr2td2 = itemtr2td2; } public String getItemtr2td3() { return itemtr2td3; } public void setItemtr2td3(String itemtr2td3) { this.itemtr2td3 = itemtr2td3; } public String getItemtr3td0() { return itemtr3td0; } public void setItemtr3td0(String itemtr3td0) { this.itemtr3td0 = itemtr3td0; } public String getItemtr3td1() { return itemtr3td1; } public void setItemtr3td1(String itemtr3td1) { this.itemtr3td1 = itemtr3td1; } public String getItemtr3td2() { return itemtr3td2; } public void setItemtr3td2(String itemtr3td2) { this.itemtr3td2 = itemtr3td2; } public String getItemtr3td3() { return itemtr3td3; } public void setItemtr3td3(String itemtr3td3) { this.itemtr3td3 = itemtr3td3; } public String getItemtr4td0() { return itemtr4td0; } public void setItemtr4td0(String itemtr4td0) { this.itemtr4td0 = itemtr4td0; } public String getItemtr4td1() { return itemtr4td1; } public void setItemtr4td1(String itemtr4td1) { this.itemtr4td1 = itemtr4td1; } public String getItemtr4td2() { return itemtr4td2; } public void setItemtr4td2(String itemtr4td2) { this.itemtr4td2 = itemtr4td2; } public String getItemtr4td3() { return itemtr4td3; } public void setItemtr4td3(String itemtr4td3) { this.itemtr4td3 = itemtr4td3; } public String getItemtr5td0() { return itemtr5td0; } public void setItemtr5td0(String itemtr5td0) { this.itemtr5td0 = itemtr5td0; } public String getItemtr5td1() { return itemtr5td1; } public void setItemtr5td1(String itemtr5td1) { this.itemtr5td1 = itemtr5td1; } public String getItemtr5td2() { return itemtr5td2; } public void setItemtr5td2(String itemtr5td2) { this.itemtr5td2 = itemtr5td2; } public String getItemtr5td3() { return itemtr5td3; } public void setItemtr5td3(String itemtr5td3) { this.itemtr5td3 = itemtr5td3; } public String getItemtr6td0() { return itemtr6td0; } public void setItemtr6td0(String itemtr6td0) { this.itemtr6td0 = itemtr6td0; } public String getItemtr6td1() { return itemtr6td1; } public void setItemtr6td1(String itemtr6td1) { this.itemtr6td1 = itemtr6td1; } public String getItemtr6td2() { return itemtr6td2; } public void setItemtr6td2(String itemtr6td2) { this.itemtr6td2 = itemtr6td2; } public String getItemtr6td3() { return itemtr6td3; } public void setItemtr6td3(String itemtr6td3) { this.itemtr6td3 = itemtr6td3; } public String getItemtr7td0() { return itemtr7td0; } public void setItemtr7td0(String itemtr7td0) { this.itemtr7td0 = itemtr7td0; } public String getItemtr7td1() { return itemtr7td1; } public void setItemtr7td1(String itemtr7td1) { this.itemtr7td1 = itemtr7td1; } public String getItemtr7td2() { return itemtr7td2; } public void setItemtr7td2(String itemtr7td2) { this.itemtr7td2 = itemtr7td2; } public String getItemtr7td3() { return itemtr7td3; } public void setItemtr7td3(String itemtr7td3) { this.itemtr7td3 = itemtr7td3; } public String getItemtr8td0() { return itemtr8td0; } public void setItemtr8td0(String itemtr8td0) { this.itemtr8td0 = itemtr8td0; } public String getItemtr8td1() { return itemtr8td1; } public void setItemtr8td1(String itemtr8td1) { this.itemtr8td1 = itemtr8td1; } public String getItemtr8td2() { return itemtr8td2; } public void setItemtr8td2(String itemtr8td2) { this.itemtr8td2 = itemtr8td2; } public String getItemtr8td3() { return itemtr8td3; } public void setItemtr8td3(String itemtr8td3) { this.itemtr8td3 = itemtr8td3; } public String getItemtr9td0() { return itemtr9td0; } public void setItemtr9td0(String itemtr9td0) { this.itemtr9td0 = itemtr9td0; } public String getItemtr9td1() { return itemtr9td1; } public void setItemtr9td1(String itemtr9td1) { this.itemtr9td1 = itemtr9td1; } public String getItemtr9td2() { return itemtr9td2; } public void setItemtr9td2(String itemtr9td2) { this.itemtr9td2 = itemtr9td2; } public String getItemtr9td3() { return itemtr9td3; } public void setItemtr9td3(String itemtr9td3) { this.itemtr9td3 = itemtr9td3; } public String getItemtr10td0() { return itemtr10td0; } public void setItemtr10td0(String itemtr10td0) { this.itemtr10td0 = itemtr10td0; } public String getItemtr10td1() { return itemtr10td1; } public void setItemtr10td1(String itemtr10td1) { this.itemtr10td1 = itemtr10td1; } public String getItemtr10td2() { return itemtr10td2; } public void setItemtr10td2(String itemtr10td2) { this.itemtr10td2 = itemtr10td2; } public String getItemtr10td3() { return itemtr10td3; } public void setItemtr10td3(String itemtr10td3) { this.itemtr10td3 = itemtr10td3; } public String getItemtr11td0() { return itemtr11td0; } public void setItemtr11td0(String itemtr11td0) { this.itemtr11td0 = itemtr11td0; } public String getItemtr11td1() { return itemtr11td1; } public void setItemtr11td1(String itemtr11td1) { this.itemtr11td1 = itemtr11td1; } public String getItemtr11td2() { return itemtr11td2; } public void setItemtr11td2(String itemtr11td2) { this.itemtr11td2 = itemtr11td2; } public String getItemtr11td3() { return itemtr11td3; } public void setItemtr11td3(String itemtr11td3) { this.itemtr11td3 = itemtr11td3; } public String getItemtr12td0() { return itemtr12td0; } public void setItemtr12td0(String itemtr12td0) { this.itemtr12td0 = itemtr12td0; } public String getItemtr12td1() { return itemtr12td1; } public void setItemtr12td1(String itemtr12td1) { this.itemtr12td1 = itemtr12td1; } public String getItemtr12td2() { return itemtr12td2; } public void setItemtr12td2(String itemtr12td2) { this.itemtr12td2 = itemtr12td2; } public String getItemtr12td3() { return itemtr12td3; } public void setItemtr12td3(String itemtr12td3) { this.itemtr12td3 = itemtr12td3; } public String getItemtr13td0() { return itemtr13td0; } public void setItemtr13td0(String itemtr13td0) { this.itemtr13td0 = itemtr13td0; } public String getItemtr13td1() { return itemtr13td1; } public void setItemtr13td1(String itemtr13td1) { this.itemtr13td1 = itemtr13td1; } public String getItemtr13td2() { return itemtr13td2; } public void setItemtr13td2(String itemtr13td2) { this.itemtr13td2 = itemtr13td2; } public String getItemtr13td3() { return itemtr13td3; } public void setItemtr13td3(String itemtr13td3) { this.itemtr13td3 = itemtr13td3; } public String getItemtr14td0() { return itemtr14td0; } public void setItemtr14td0(String itemtr14td0) { this.itemtr14td0 = itemtr14td0; } public String getItemtr14td1() { return itemtr14td1; } public void setItemtr14td1(String itemtr14td1) { this.itemtr14td1 = itemtr14td1; } public String getItemtr14td2() { return itemtr14td2; } public void setItemtr14td2(String itemtr14td2) { this.itemtr14td2 = itemtr14td2; } public String getItemtr14td3() { return itemtr14td3; } public void setItemtr14td3(String itemtr14td3) { this.itemtr14td3 = itemtr14td3; } public String getItemtr15td0() { return itemtr15td0; } public void setItemtr15td0(String itemtr15td0) { this.itemtr15td0 = itemtr15td0; } public String getItemtr15td1() { return itemtr15td1; } public void setItemtr15td1(String itemtr15td1) { this.itemtr15td1 = itemtr15td1; } public String getItemtr15td2() { return itemtr15td2; } public void setItemtr15td2(String itemtr15td2) { this.itemtr15td2 = itemtr15td2; } public String getItemtr15td3() { return itemtr15td3; } public void setItemtr15td3(String itemtr15td3) { this.itemtr15td3 = itemtr15td3; } public String getItemtr16td0() { return itemtr16td0; } public void setItemtr16td0(String itemtr16td0) { this.itemtr16td0 = itemtr16td0; } public String getItemtr16td1() { return itemtr16td1; } public void setItemtr16td1(String itemtr16td1) { this.itemtr16td1 = itemtr16td1; } public String getItemtr16td2() { return itemtr16td2; } public void setItemtr16td2(String itemtr16td2) { this.itemtr16td2 = itemtr16td2; } public String getItemtr16td3() { return itemtr16td3; } public void setItemtr16td3(String itemtr16td3) { this.itemtr16td3 = itemtr16td3; } public String getItemtr17td0() { return itemtr17td0; } public void setItemtr17td0(String itemtr17td0) { this.itemtr17td0 = itemtr17td0; } public String getItemtr17td1() { return itemtr17td1; } public void setItemtr17td1(String itemtr17td1) { this.itemtr17td1 = itemtr17td1; } public String getItemtr17td2() { return itemtr17td2; } public void setItemtr17td2(String itemtr17td2) { this.itemtr17td2 = itemtr17td2; } public String getItemtr17td3() { return itemtr17td3; } public void setItemtr17td3(String itemtr17td3) { this.itemtr17td3 = itemtr17td3; } public String getItemtr18td0() { return itemtr18td0; } public void setItemtr18td0(String itemtr18td0) { this.itemtr18td0 = itemtr18td0; } public String getItemtr18td1() { return itemtr18td1; } public void setItemtr18td1(String itemtr18td1) { this.itemtr18td1 = itemtr18td1; } public String getItemtr18td2() { return itemtr18td2; } public void setItemtr18td2(String itemtr18td2) { this.itemtr18td2 = itemtr18td2; } public String getItemtr18td3() { return itemtr18td3; } public void setItemtr18td3(String itemtr18td3) { this.itemtr18td3 = itemtr18td3; } public String getItemtr19td0() { return itemtr19td0; } public void setItemtr19td0(String itemtr19td0) { this.itemtr19td0 = itemtr19td0; } public String getItemtr19td1() { return itemtr19td1; } public void setItemtr19td1(String itemtr19td1) { this.itemtr19td1 = itemtr19td1; } public String getItemtr19td2() { return itemtr19td2; } public void setItemtr19td2(String itemtr19td2) { this.itemtr19td2 = itemtr19td2; } public String getItemtr19td3() { return itemtr19td3; } public void setItemtr19td3(String itemtr19td3) { this.itemtr19td3 = itemtr19td3; } public String getItemtr20td0() { return itemtr20td0; } public void setItemtr20td0(String itemtr20td0) { this.itemtr20td0 = itemtr20td0; } public String getItemtr20td1() { return itemtr20td1; } public void setItemtr20td1(String itemtr20td1) { this.itemtr20td1 = itemtr20td1; } public String getItemtr20td2() { return itemtr20td2; } public void setItemtr20td2(String itemtr20td2) { this.itemtr20td2 = itemtr20td2; } public String getItemtr20td3() { return itemtr20td3; } public void setItemtr20td3(String itemtr20td3) { this.itemtr20td3 = itemtr20td3; } public String getItemtr21td0() { return itemtr21td0; } public void setItemtr21td0(String itemtr21td0) { this.itemtr21td0 = itemtr21td0; } public String getItemtr21td1() { return itemtr21td1; } public void setItemtr21td1(String itemtr21td1) { this.itemtr21td1 = itemtr21td1; } public String getItemtr21td2() { return itemtr21td2; } public void setItemtr21td2(String itemtr21td2) { this.itemtr21td2 = itemtr21td2; } public String getItemtr21td3() { return itemtr21td3; } public void setItemtr21td3(String itemtr21td3) { this.itemtr21td3 = itemtr21td3; } public String getItemtr22td0() { return itemtr22td0; } public void setItemtr22td0(String itemtr22td0) { this.itemtr22td0 = itemtr22td0; } public String getItemtr22td1() { return itemtr22td1; } public void setItemtr22td1(String itemtr22td1) { this.itemtr22td1 = itemtr22td1; } public String getItemtr22td2() { return itemtr22td2; } public void setItemtr22td2(String itemtr22td2) { this.itemtr22td2 = itemtr22td2; } public String getItemtr22td3() { return itemtr22td3; } public void setItemtr22td3(String itemtr22td3) { this.itemtr22td3 = itemtr22td3; } public String getItemtr23td0() { return itemtr23td0; } public void setItemtr23td0(String itemtr23td0) { this.itemtr23td0 = itemtr23td0; } public String getItemtr23td1() { return itemtr23td1; } public void setItemtr23td1(String itemtr23td1) { this.itemtr23td1 = itemtr23td1; } public String getItemtr23td2() { return itemtr23td2; } public void setItemtr23td2(String itemtr23td2) { this.itemtr23td2 = itemtr23td2; } public String getItemtr23td3() { return itemtr23td3; } public void setItemtr23td3(String itemtr23td3) { this.itemtr23td3 = itemtr23td3; } public String getItemtr24td0() { return itemtr24td0; } public void setItemtr24td0(String itemtr24td0) { this.itemtr24td0 = itemtr24td0; } public String getItemtr24td1() { return itemtr24td1; } public void setItemtr24td1(String itemtr24td1) { this.itemtr24td1 = itemtr24td1; } public String getItemtr24td2() { return itemtr24td2; } public void setItemtr24td2(String itemtr24td2) { this.itemtr24td2 = itemtr24td2; } public String getItemtr24td3() { return itemtr24td3; } public void setItemtr24td3(String itemtr24td3) { this.itemtr24td3 = itemtr24td3; } public String getItemtr25td0() { return itemtr25td0; } public void setItemtr25td0(String itemtr25td0) { this.itemtr25td0 = itemtr25td0; } public String getItemtr25td1() { return itemtr25td1; } public void setItemtr25td1(String itemtr25td1) { this.itemtr25td1 = itemtr25td1; } public String getItemtr25td2() { return itemtr25td2; } public void setItemtr25td2(String itemtr25td2) { this.itemtr25td2 = itemtr25td2; } public String getItemtr25td3() { return itemtr25td3; } public void setItemtr25td3(String itemtr25td3) { this.itemtr25td3 = itemtr25td3; } public String getItemtr26td0() { return itemtr26td0; } public void setItemtr26td0(String itemtr26td0) { this.itemtr26td0 = itemtr26td0; } public String getItemtr26td1() { return itemtr26td1; } public void setItemtr26td1(String itemtr26td1) { this.itemtr26td1 = itemtr26td1; } public String getItemtr26td2() { return itemtr26td2; } public void setItemtr26td2(String itemtr26td2) { this.itemtr26td2 = itemtr26td2; } public String getItemtr26td3() { return itemtr26td3; } public void setItemtr26td3(String itemtr26td3) { this.itemtr26td3 = itemtr26td3; } public String getItemtr27td0() { return itemtr27td0; } public void setItemtr27td0(String itemtr27td0) { this.itemtr27td0 = itemtr27td0; } public String getItemtr27td1() { return itemtr27td1; } public void setItemtr27td1(String itemtr27td1) { this.itemtr27td1 = itemtr27td1; } public String getItemtr27td2() { return itemtr27td2; } public void setItemtr27td2(String itemtr27td2) { this.itemtr27td2 = itemtr27td2; } public String getItemtr27td3() { return itemtr27td3; } public void setItemtr27td3(String itemtr27td3) { this.itemtr27td3 = itemtr27td3; } public String getItemtr28td0() { return itemtr28td0; } public void setItemtr28td0(String itemtr28td0) { this.itemtr28td0 = itemtr28td0; } public String getItemtr28td1() { return itemtr28td1; } public void setItemtr28td1(String itemtr28td1) { this.itemtr28td1 = itemtr28td1; } public String getItemtr28td2() { return itemtr28td2; } public void setItemtr28td2(String itemtr28td2) { this.itemtr28td2 = itemtr28td2; } public String getItemtr28td3() { return itemtr28td3; } public void setItemtr28td3(String itemtr28td3) { this.itemtr28td3 = itemtr28td3; } public String getItemtr29td0() { return itemtr29td0; } public void setItemtr29td0(String itemtr29td0) { this.itemtr29td0 = itemtr29td0; } public String getItemtr29td1() { return itemtr29td1; } public void setItemtr29td1(String itemtr29td1) { this.itemtr29td1 = itemtr29td1; } public String getItemtr29td2() { return itemtr29td2; } public void setItemtr29td2(String itemtr29td2) { this.itemtr29td2 = itemtr29td2; } public String getItemtr29td3() { return itemtr29td3; } public void setItemtr29td3(String itemtr29td3) { this.itemtr29td3 = itemtr29td3; } public String getItemtr30td0() { return itemtr30td0; } public void setItemtr30td0(String itemtr30td0) { this.itemtr30td0 = itemtr30td0; } public String getItemtr30td1() { return itemtr30td1; } public void setItemtr30td1(String itemtr30td1) { this.itemtr30td1 = itemtr30td1; } public String getItemtr30td2() { return itemtr30td2; } public void setItemtr30td2(String itemtr30td2) { this.itemtr30td2 = itemtr30td2; } public String getItemtr30td3() { return itemtr30td3; } public void setItemtr30td3(String itemtr30td3) { this.itemtr30td3 = itemtr30td3; } public String getItemtr31td0() { return itemtr31td0; } public void setItemtr31td0(String itemtr31td0) { this.itemtr31td0 = itemtr31td0; } public String getItemtr31td1() { return itemtr31td1; } public void setItemtr31td1(String itemtr31td1) { this.itemtr31td1 = itemtr31td1; } public String getItemtr31td2() { return itemtr31td2; } public void setItemtr31td2(String itemtr31td2) { this.itemtr31td2 = itemtr31td2; } public String getItemtr31td3() { return itemtr31td3; } public void setItemtr31td3(String itemtr31td3) { this.itemtr31td3 = itemtr31td3; } public String getItemtr32td0() { return itemtr32td0; } public void setItemtr32td0(String itemtr32td0) { this.itemtr32td0 = itemtr32td0; } public String getItemtr32td1() { return itemtr32td1; } public void setItemtr32td1(String itemtr32td1) { this.itemtr32td1 = itemtr32td1; } public String getItemtr32td2() { return itemtr32td2; } public void setItemtr32td2(String itemtr32td2) { this.itemtr32td2 = itemtr32td2; } public String getItemtr32td3() { return itemtr32td3; } public void setItemtr32td3(String itemtr32td3) { this.itemtr32td3 = itemtr32td3; } public String getItemtr33td0() { return itemtr33td0; } public void setItemtr33td0(String itemtr33td0) { this.itemtr33td0 = itemtr33td0; } public String getItemtr33td1() { return itemtr33td1; } public void setItemtr33td1(String itemtr33td1) { this.itemtr33td1 = itemtr33td1; } public String getItemtr33td2() { return itemtr33td2; } public void setItemtr33td2(String itemtr33td2) { this.itemtr33td2 = itemtr33td2; } public String getItemtr33td3() { return itemtr33td3; } public void setItemtr33td3(String itemtr33td3) { this.itemtr33td3 = itemtr33td3; } public String getItemtr34td0() { return itemtr34td0; } public void setItemtr34td0(String itemtr34td0) { this.itemtr34td0 = itemtr34td0; } public String getItemtr34td1() { return itemtr34td1; } public void setItemtr34td1(String itemtr34td1) { this.itemtr34td1 = itemtr34td1; } public String getItemtr34td2() { return itemtr34td2; } public void setItemtr34td2(String itemtr34td2) { this.itemtr34td2 = itemtr34td2; } public String getItemtr34td3() { return itemtr34td3; } public void setItemtr34td3(String itemtr34td3) { this.itemtr34td3 = itemtr34td3; } public String getItemtr35td0() { return itemtr35td0; } public void setItemtr35td0(String itemtr35td0) { this.itemtr35td0 = itemtr35td0; } public String getItemtr35td1() { return itemtr35td1; } public void setItemtr35td1(String itemtr35td1) { this.itemtr35td1 = itemtr35td1; } public String getItemtr35td2() { return itemtr35td2; } public void setItemtr35td2(String itemtr35td2) { this.itemtr35td2 = itemtr35td2; } public String getItemtr35td3() { return itemtr35td3; } public void setItemtr35td3(String itemtr35td3) { this.itemtr35td3 = itemtr35td3; } public String getItemtr36td0() { return itemtr36td0; } public void setItemtr36td0(String itemtr36td0) { this.itemtr36td0 = itemtr36td0; } public String getItemtr36td1() { return itemtr36td1; } public void setItemtr36td1(String itemtr36td1) { this.itemtr36td1 = itemtr36td1; } public String getItemtr36td2() { return itemtr36td2; } public void setItemtr36td2(String itemtr36td2) { this.itemtr36td2 = itemtr36td2; } public String getItemtr36td3() { return itemtr36td3; } public void setItemtr36td3(String itemtr36td3) { this.itemtr36td3 = itemtr36td3; } public String getItemtr37td0() { return itemtr37td0; } public void setItemtr37td0(String itemtr37td0) { this.itemtr37td0 = itemtr37td0; } public String getItemtr37td1() { return itemtr37td1; } public void setItemtr37td1(String itemtr37td1) { this.itemtr37td1 = itemtr37td1; } public String getItemtr37td2() { return itemtr37td2; } public void setItemtr37td2(String itemtr37td2) { this.itemtr37td2 = itemtr37td2; } public String getItemtr37td3() { return itemtr37td3; } public void setItemtr37td3(String itemtr37td3) { this.itemtr37td3 = itemtr37td3; } public String getItemtr38td0() { return itemtr38td0; } public void setItemtr38td0(String itemtr38td0) { this.itemtr38td0 = itemtr38td0; } public String getItemtr38td1() { return itemtr38td1; } public void setItemtr38td1(String itemtr38td1) { this.itemtr38td1 = itemtr38td1; } public String getItemtr38td2() { return itemtr38td2; } public void setItemtr38td2(String itemtr38td2) { this.itemtr38td2 = itemtr38td2; } public String getItemtr38td3() { return itemtr38td3; } public void setItemtr38td3(String itemtr38td3) { this.itemtr38td3 = itemtr38td3; } public String getItemtr39td0() { return itemtr39td0; } public void setItemtr39td0(String itemtr39td0) { this.itemtr39td0 = itemtr39td0; } public String getItemtr39td1() { return itemtr39td1; } public void setItemtr39td1(String itemtr39td1) { this.itemtr39td1 = itemtr39td1; } public String getItemtr39td2() { return itemtr39td2; } public void setItemtr39td2(String itemtr39td2) { this.itemtr39td2 = itemtr39td2; } public String getItemtr39td3() { return itemtr39td3; } public void setItemtr39td3(String itemtr39td3) { this.itemtr39td3 = itemtr39td3; } public String getTxtGoodCode() { return txtGoodCode; } public void setTxtGoodCode(String txtGoodCode) { this.txtGoodCode = txtGoodCode; } public String getTxtGoodCode_2() { return txtGoodCode_2; } public void setTxtGoodCode_2(String txtGoodCode_2) { this.txtGoodCode_2 = txtGoodCode_2; } }
606e3eb3ef380b3120b3ae504d13bf46496bfe69
bc5fc2d825735259a66f6b6e1ed5b7e14e3cbbc4
/arquitectura-referencia-web/src/main/java/com/bancolombia/screenplay/avianca/user_interface/DetallesDelViaje.java
98f9368871b217888f1e8e4cfe9f733ee8cd26fd
[]
no_license
RafaelHenao/ScreenplayEjemploWebAvianca
b9a159b6e7b449c775ba7b68fd3a67d2600fcfa6
d1a051529816269c9aaf80e43844509162f5d747
refs/heads/master
2022-11-07T22:09:26.957618
2020-06-18T18:59:02
2020-06-18T18:59:02
273,256,344
0
0
null
null
null
null
UTF-8
Java
false
false
2,640
java
package com.bancolombia.screenplay.avianca.user_interface; import net.serenitybdd.screenplay.targets.Target; public class DetallesDelViaje { //public static final Target OPCION_SOLO_IDA = Target.the("opción de vuelo sólo ida") // .locatedBy("#bkRbIda"); public static final Target OPCION_SOLO_IDA = Target.the("solo ida") .locatedBy("//*[contains(text(), 'Solo ida')]"); //public static final Target ORIGEN = Target.the("el campo de origen") // .locatedBy("#bkOrigen"); //public static final Target ORIGEN = Target.the("pbOrigen") // .locatedBy("#pbOrigen_1_1774347131"); public static final Target ORIGEN = Target.the("pbOrigen") .locatedBy("//*[@class = \"form-control pbOrigen airport airport_ida error\"]"); //public static final Target DESTINO = Target.the("pbDestino") // .locatedBy("#pbDestino_1_1774347131"); public static final Target DESTINO = Target.the("pbDestino") .locatedBy("#//*[@class = \"form-control pbDestino airport airport_regreso error\"]"); //public static final Target DESTINO = Target.the("el campo de destino") // .locatedBy("#bkDestino"); // public static final Target OPCION_DESPLEGABLE = Target.the("la opción {0} de la lista desplegable") //.locatedBy("//li[contains(text(), '{0}')]"); public static final Target OPCION_DESPLEGABLE = Target.the("la opción {1} de la lista desplegable") .locatedBy("//li[contains(text(), '{1}')]"); // public static final Target BOTON_CALENDARIO_SALIDA = Target.the("el botón para seleccionar la fecha de salida") // .locatedBy("//*[@id='vuelos']/form/div[3]/div[4]/div[1]/div[1]/div/div/span/button"); public static final Target BOTON_CALENDARIO_SALIDA = Target.the("el botón para seleccionar la fecha de salida") .locatedBy("//*[@id='vuelos']/form/div[3]/div[4]/div[1]/div[1]/div/div/span/button"); // public static final Target FECHA_DE_SALIDA = Target.the("la fecha de salida") // .locatedBy("//td[contains(@data-month, '{0}')]//a[.='{1}']"); public static final Target FECHA_DE_SALIDA = Target.the("la fecha de salida") .locatedBy("//td[contains(@data-month, '{0}')]//a[.='{1}']"); // public static final Target BOTON_CONSULTA = Target.the("el botón de consulta de vuelos") // .locatedBy("//input[@value='Buscar vuelos']"); public static final Target BOTON_CONSULTA = Target.the("el botón de consulta de vuelos") .locatedBy("//input[@value='Buscar vuelos']"); }
03dedbe01ed2babc503eeba9e4ae075a86b5cfa9
5c92303b29b19a7de3869cbd1408393fef41b543
/demo/site/src/main/java/org/onehippo/forge/beans/NewsDocument.java
9d3ad924e31098f4133b33ff29992e3413491dfd
[ "Apache-2.0" ]
permissive
ajbanck/document-translation-picker
de7dda293d9e37ffbf90d717de525cedf3966eb6
3ccb41ccedc9e873bc5229a38544ce14af17469c
refs/heads/develop
2021-07-23T00:21:53.073208
2019-05-22T09:00:25
2019-05-22T09:00:25
188,984,760
0
0
Apache-2.0
2021-07-07T05:20:15
2019-05-28T08:14:30
Java
UTF-8
Java
false
false
4,083
java
package org.onehippo.forge.beans; /* * Copyright 2014-2018 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.util.Calendar; import org.hippoecm.hst.content.beans.Node; import org.hippoecm.hst.content.beans.standard.HippoDocument; import org.hippoecm.hst.content.beans.standard.HippoGalleryImageSet; import org.hippoecm.hst.content.beans.standard.HippoHtml; import org.onehippo.cms7.essentials.dashboard.annotations.HippoEssentialsGenerated; @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:newsdocument") @Node(jcrType="documenttranslationpickerdemo:newsdocument") public class NewsDocument extends HippoDocument { /** * The document type of the news document. */ public static final String DOCUMENT_TYPE = "documenttranslationpickerdemo:newsdocument"; private static final String TITLE = "documenttranslationpickerdemo:title"; private static final String DATE = "documenttranslationpickerdemo:date"; private static final String INTRODUCTION = "documenttranslationpickerdemo:introduction"; private static final String IMAGE = "documenttranslationpickerdemo:image"; private static final String CONTENT = "documenttranslationpickerdemo:content"; private static final String LOCATION = "documenttranslationpickerdemo:location"; private static final String AUTHOR = "documenttranslationpickerdemo:author"; private static final String SOURCE = "documenttranslationpickerdemo:source"; /** * Get the title of the document. * * @return the title */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:title") public String getTitle() { return getProperty(TITLE); } /** * Get the date of the document. * * @return the date */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:date") public Calendar getDate() { return getProperty(DATE); } /** * Get the introduction of the document. * * @return the introduction */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:introduction") public String getIntroduction() { return getProperty(INTRODUCTION); } /** * Get the image of the document. * * @return the image */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:image") public HippoGalleryImageSet getImage() { return getLinkedBean(IMAGE, HippoGalleryImageSet.class); } /** * Get the main content of the document. * * @return the content */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:content") public HippoHtml getContent() { return getHippoHtml(CONTENT); } /** * Get the location of the document. * * @return the location */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:location") public String getLocation() { return getProperty(LOCATION); } /** * Get the author of the document. * * @return the author */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:author") public String getAuthor() { return getProperty(AUTHOR); } /** * Get the source of the document. * * @return the source */ @HippoEssentialsGenerated(internalName = "documenttranslationpickerdemo:source") public String getSource() { return getProperty(SOURCE); } }
8fcacd6e142f49a9495022f08ea88192863a147b
4dda76de77ddfa6412d8b5206f8ee69ab3c29324
/sm-rest-impl/src/main/java/de/escidoc/core/sm/internal/AggregationDefinitionRestServiceImpl.java
bcb739d996a3153446a69c78c0c136fcbe5a8457
[]
no_license
crh/escidoc-core
062963156fb2f10869ed2ae59471820ee20c7544
7a572cbccc2de72321d2331e84e1b0e22cd99d80
refs/heads/master
2016-09-06T16:52:46.486935
2012-02-15T12:37:29
2012-02-15T12:37:29
3,460,415
0
0
null
null
null
null
UTF-8
Java
false
false
4,063
java
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at license/ESCIDOC.LICENSE * or http://www.escidoc.de/license. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at license/ESCIDOC.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2006-2011 Fachinformationszentrum Karlsruhe Gesellschaft * fuer wissenschaftlich-technische Information mbH and Max-Planck- * Gesellschaft zur Foerderung der Wissenschaft e.V. * All rights reserved. Use is subject to license terms. */ package de.escidoc.core.sm.internal; import org.escidoc.core.domain.service.ServiceUtility; import org.escidoc.core.domain.sm.AggregationDefinitionTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import de.escidoc.core.common.exceptions.application.invalid.XmlCorruptedException; import de.escidoc.core.common.exceptions.application.invalid.XmlSchemaValidationException; import de.escidoc.core.common.exceptions.application.missing.MissingMethodParameterException; import de.escidoc.core.common.exceptions.application.notfound.AggregationDefinitionNotFoundException; import de.escidoc.core.common.exceptions.application.notfound.ScopeNotFoundException; import de.escidoc.core.common.exceptions.application.security.AuthenticationException; import de.escidoc.core.common.exceptions.application.security.AuthorizationException; import de.escidoc.core.common.exceptions.system.SystemException; import de.escidoc.core.sm.AggregationDefinitionRestService; import de.escidoc.core.sm.service.interfaces.AggregationDefinitionHandlerInterface; /** * @author Michael Hoppe * */ public class AggregationDefinitionRestServiceImpl implements AggregationDefinitionRestService { @Autowired @Qualifier("service.AggregationDefinitionHandler") private AggregationDefinitionHandlerInterface aggregationDefinitionHandler; /** * */ public AggregationDefinitionRestServiceImpl() { } /* (non-Javadoc) * @see de.escidoc.core.sm.AggregationDefinitionRestService#create(org.escidoc.core.domain.sm.AggregationDefinitionTO) */ @Override public AggregationDefinitionTO create(final AggregationDefinitionTO aggregationDefinitionTO) throws AuthenticationException, AuthorizationException, XmlSchemaValidationException, XmlCorruptedException, MissingMethodParameterException, ScopeNotFoundException, SystemException { return ServiceUtility.fromXML(AggregationDefinitionTO.class, this.aggregationDefinitionHandler.create(ServiceUtility.toXML(aggregationDefinitionTO))); } /* (non-Javadoc) * @see de.escidoc.core.sm.AggregationDefinitionRestService#delete(java.lang.String) */ @Override public void delete(final String id) throws AuthenticationException, AuthorizationException, AggregationDefinitionNotFoundException, MissingMethodParameterException, SystemException { this.aggregationDefinitionHandler.delete(id); } /* (non-Javadoc) * @see de.escidoc.core.sm.AggregationDefinitionRestService#retrieve(java.lang.String) */ @Override public AggregationDefinitionTO retrieve(final String id) throws AuthenticationException, AuthorizationException, AggregationDefinitionNotFoundException, MissingMethodParameterException, SystemException { return ServiceUtility.fromXML(AggregationDefinitionTO.class, this.aggregationDefinitionHandler.retrieve(id)); } }
416dec92b67d12038932d5397d5836e14a608b47
867beec289d707a787f2bb30ae8a935729b83a2c
/DesignPattern_Factory_Sandwich/src/com/company/Ingredients/Breads/AmericanSandwichBread.java
a66195d3a0b718469abc481f17dbd9bad46277a6
[]
no_license
RomainDeschins/design-patterns
3ae54eb6af5ccd9ddbbe9a29cedff696945f81c6
ae8c7237a984c47d28b7ebd967c40df88ecde6f1
refs/heads/master
2023-03-09T01:54:58.639949
2021-03-02T19:30:31
2021-03-02T19:30:31
333,208,789
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
package com.company.Ingredients.Breads; public class AmericanSandwichBread extends Bread { @Override public String toString() { return "American Sandwich Bread"; } }
f17d1bcd0c93481ef75b37dc90e1e6197f1a1674
221955937b56852cce15853e2d3dbb8b1f94b30b
/sup02_mybatis/mybatis01.start/src/main/java/com/wenbronk/mybatis3_daoImpl/mapper/UserMapper.java
49768bd50843952c67e85bd2ac6df3d9a1c55eea
[]
no_license
awesometype/itcast57
28359d4a8f735fd7d5d9e86bb5ba157fdf0fe4a2
1426952d85f96ee1d11c4088b9fadc922d0bc0a2
refs/heads/master
2022-12-06T03:22:36.259414
2019-09-27T02:43:05
2019-09-27T02:43:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package com.wenbronk.mybatis3_daoImpl.mapper; import com.wenbronk.mybatis3_daoImpl.domain.QueryVo; import com.wenbronk.mybatis3_daoImpl.domain.User; import java.util.List; /** * @Author wenbronk * @Date 2019-06-22 */ public interface UserMapper { List<User> findAll(); void insert(User user); void update(User user); void delete(int i); User findById(int i); List<User> findByLike(String name); List<User> findByQueryVo(QueryVo queryVo); }
6618cb101a8b377b6e2f85985c490f73a5461538
cc701092b9395e55e33e658079a8d5ea36a046b2
/gen/com/xgb/test/webivew/BuildConfig.java
1530e3a2e16fa0cc4cb11dac0d628a21bd83cc91
[]
no_license
chunjiangshieh/AnimationDemos
53291044aef61cea59d04433142ed96187016075
4e2d9e7afc26a502b91ff16e56d2439fbf079052
refs/heads/master
2021-01-13T02:26:12.011571
2013-09-05T02:43:31
2013-09-05T02:43:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
162
java
/** Automatically generated file. DO NOT MODIFY */ package com.xgb.test.webivew; public final class BuildConfig { public final static boolean DEBUG = true; }
72474acae2a9922393a92a757d03ddeed300e5e2
07ee30d63f4b20021fd8808486624d01ee68a132
/src/main/java/org/example/TracingContext.java
77c6e7474cb33eb65e744ec8aad1250438176b05
[]
no_license
Hyperb0t/cloudfunc-crop
9bf85d4bd1667824d56e9b0ecf2629d15255b743
65e519db16e0bcb2dda16f3613cf026fe815eeff
refs/heads/master
2023-08-20T07:25:58.926492
2021-10-25T18:16:12
2021-10-25T18:16:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,806
java
package org.example; import java.util.HashMap; import java.util.Map; import javax.annotation.Generated; @Generated("jsonschema2pojo") public class TracingContext { private String trace_id; private String span_id; private String parent_span_id; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public TracingContext() { } /** * * @param traceId * @param spanId * @param parentSpanId */ public TracingContext(String traceId, String spanId, String parentSpanId) { super(); this.trace_id = traceId; this.span_id = spanId; this.parent_span_id = parentSpanId; } public String getTrace_id() { return trace_id; } public void setTrace_id(String trace_id) { this.trace_id = trace_id; } public String getSpan_id() { return span_id; } public void setSpan_id(String span_id) { this.span_id = span_id; } public String getParent_span_id() { return parent_span_id; } public void setParent_span_id(String parent_span_id) { this.parent_span_id = parent_span_id; } public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(TracingContext.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); sb.append("traceId"); sb.append('='); sb.append(((this.trace_id == null)?"<null>":this.trace_id)); sb.append(','); sb.append("spanId"); sb.append('='); sb.append(((this.span_id == null)?"<null>":this.span_id)); sb.append(','); sb.append("parentSpanId"); sb.append('='); sb.append(((this.parent_span_id == null)?"<null>":this.parent_span_id)); sb.append(','); sb.append("additionalProperties"); sb.append('='); sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties)); sb.append(','); if (sb.charAt((sb.length()- 1)) == ',') { sb.setCharAt((sb.length()- 1), ']'); } else { sb.append(']'); } return sb.toString(); } @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.trace_id == null)? 0 :this.trace_id.hashCode())); result = ((result* 31)+((this.span_id == null)? 0 :this.span_id.hashCode())); result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); result = ((result* 31)+((this.parent_span_id == null)? 0 :this.parent_span_id.hashCode())); return result; } @Override public boolean equals(Object other) { if (other == this) { return true; } if ((other instanceof TracingContext) == false) { return false; } TracingContext rhs = ((TracingContext) other); return (((((this.trace_id == rhs.trace_id)||((this.trace_id != null)&&this.trace_id.equals(rhs.trace_id)))&&((this.span_id == rhs.span_id)||((this.span_id != null)&&this.span_id.equals(rhs.span_id))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.parent_span_id == rhs.parent_span_id)||((this.parent_span_id != null)&&this.parent_span_id.equals(rhs.parent_span_id)))); } }
20780c5e7b507491057f03cbb7feb4c40c092712
51967281cd64a42aa86d01b204415b82cf53956a
/vcd_tallydevice/src/main/java/de/tud/vcd/eVotingTallyAssistance/controller/WahlzettelScanner.java
f76e154c4225f4d7ef4b40934ca3602686a60e8e
[ "Apache-2.0" ]
permissive
SecUSo/EasyVote
13e1ceeee11a57486404b71c56c75433597c43ca
676b20d416999a480495c45c535f5e4bc96e50c2
refs/heads/master
2021-04-23T09:47:20.114468
2015-05-18T14:46:38
2015-05-18T14:46:38
35,817,012
4
2
null
null
null
null
ISO-8859-1
Java
false
false
2,863
java
/******************************************************************************* * # Copyright 2015 SecUSo.org / Jurlind Budurushi / Roman Jöris * # * # 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 de.tud.vcd.eVotingTallyAssistance.controller; import java.awt.image.BufferedImage; import javax.swing.JOptionPane; import de.tud.vcd.eVotingTallyAssistance.common.exceptions.OCRException; /** * @author Roman Jöris <[email protected]> * */ public class WahlzettelScanner { /* Scanner scanner; int scannerSourceId; boolean bildDa; Tallying_C c; private static WahlzettelScanner instance = null; public static synchronized WahlzettelScanner getInstance(Tallying_C c) throws Exception { if (instance == null) { instance = new WahlzettelScanner(c); } return instance; } private WahlzettelScanner(Tallying_C c) throws OCRException, ScannerIOException { scannerSourceId=-1; this.c=c; String[] s=Scanner.getDevice().getDeviceNames(); if (s.length<1){ throw new OCRException("Es wurde kein angeschlossener Scanner gefunden."); }else if(s.length==1){ scannerSourceId=0; }else{ //Es sind mehr als ein Scanner angeschlossen, daher wird beim ersten Scannen nach der Quelle gefragt. //Also die SourceId bleibt erstmal ungesetzt. } } private void selectSource() throws ScannerIOException{ String[] s=Scanner.getDevice().getDeviceNames(); for (String st: s){ System.out.println(st); } Scanner.getDevice().select(); } final BufferedImage[] variable = new BufferedImage[1]; public void scan() throws ScannerIOException{ bildDa=false; //erstmal nach Quelle fragen, wenn sie noch nicht bestimmt wurde. if (scannerSourceId==-1){ JOptionPane.showConfirmDialog(null, "Beim ersten Scanvorgang wird nach der Quelle gefragt. \nBitte drücken Sie danach erneut den Knopf zum Scannen.", "Hinweis:", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE); selectSource(); scannerSourceId=1; }else{ // scanner = Scanner.getDevice(); scanner.acquire(); scanner.addListener(c.getScannerList()); } } */ }
ec2c4b987f6eb2512571b4326cf213174e5de6a2
41e9560574e20b870b40042bbb5c011bbc8ae01b
/src/controller/admin/pages/products/AddProductController.java
864920b11f54a4374a8b050c7d70c442c1c4e3c2
[ "MIT" ]
permissive
prashantraj94/StoreManagementSystem
471f83e73c4ad40eb7e7bdf9a8100f77b20c6898
4ba31e91fd7f04ee9124968cbec756b94ad8d313
refs/heads/main
2023-03-22T13:26:52.169913
2021-02-19T20:55:06
2021-02-19T20:55:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,794
java
package controller.admin.pages.products; import javafx.collections.FXCollections; import javafx.concurrent.Task; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.text.Text; import model.Categories; import model.Datasource; /** * {@inheritDoc} */ public class AddProductController extends ProductsController { @FXML public ComboBox<Categories> fieldAddProductCategoryId; public TextField fieldAddProductName; public TextField fieldAddProductPrice; public TextField fieldAddProductQuantity; public TextArea fieldAddProductDescription; public Text viewProductResponse; @FXML private void initialize() { fieldAddProductCategoryId.setItems(FXCollections.observableArrayList(Datasource.getInstance().getProductCategories(Datasource.ORDER_BY_ASC))); TextFormatter<Double> textFormatterDouble = formatDoubleField(); TextFormatter<Integer> textFormatterInt = formatIntField(); fieldAddProductPrice.setTextFormatter(textFormatterDouble); fieldAddProductQuantity.setTextFormatter(textFormatterInt); } /** * This private method handles the add product button functionality. * It validates user input fields and adds the values to the database. * @since 1.0.0 */ @FXML private void btnAddProductOnAction() { Categories category = fieldAddProductCategoryId.getSelectionModel().getSelectedItem(); int cat_id = 0; if (category != null) { cat_id = category.getId(); } assert category != null; if (areProductInputsValid(fieldAddProductName.getText(), fieldAddProductDescription.getText(), fieldAddProductPrice.getText(), fieldAddProductQuantity.getText(), cat_id)) { String productName = fieldAddProductName.getText(); String productDescription = fieldAddProductDescription.getText(); double productPrice = Double.parseDouble(fieldAddProductPrice.getText()); int productQuantity = Integer.parseInt(fieldAddProductQuantity.getText()); int productCategoryId = category.getId(); Task<Boolean> addProductTask = new Task<Boolean>() { @Override protected Boolean call() { return Datasource.getInstance().insertNewProduct(productName, productDescription, productPrice, productQuantity, productCategoryId); } }; addProductTask.setOnSucceeded(e -> { if (addProductTask.valueProperty().get()) { viewProductResponse.setVisible(true); System.out.println("Product added!"); } }); new Thread(addProductTask).start(); } } }
51e643f4e8615f9c2ccef4a48c4cbd7c5cfeee1f
3be0b37290feeb8820b35c2ff6c7327cd76101b1
/RoboSpring-JUnit4Android-Tests/spring-beans/test/java/org/springframework/beans/BeanUtilsTests.java
962f27e05d0f5f679541cc76b858a22e8a609dcf
[ "Apache-2.0" ]
permissive
cenwei/RoboSpring
34362ee537a073d64c65e6a746418d2f22947c8a
856980d128229fa33b279570c4ae7898c64ca267
refs/heads/master
2021-01-20T14:48:10.671322
2015-04-13T09:04:02
2015-04-13T09:04:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,458
java
/* * Copyright 2002-2008 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 org.springframework.beans; import static org.junit.Assert.*; import org.droid.java.beans.Introspector; import org.droid.java.beans.PropertyDescriptor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import org.junit.Test; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceEditor; import test.beans.DerivedTestBean; import test.beans.ITestBean; import test.beans.TestBean; /** * Unit tests for {@link BeanUtils}. * * @author Juergen Hoeller * @author Rob Harrop * @author Chris Beams * @since 19.05.2003 */ public final class BeanUtilsTests { @Test public void testInstantiateClass() { // give proper class BeanUtils.instantiateClass(ArrayList.class); try { // give interface BeanUtils.instantiateClass(List.class); fail("Should have thrown FatalBeanException"); } catch (FatalBeanException ex) { // expected } try { // give class without default constructor BeanUtils.instantiateClass(CustomDateEditor.class); fail("Should have thrown FatalBeanException"); } catch (FatalBeanException ex) { // expected } } @Test public void testGetPropertyDescriptors() throws Exception { PropertyDescriptor[] actual = Introspector.getBeanInfo(TestBean.class).getPropertyDescriptors(); PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(TestBean.class); assertNotNull("Descriptors should not be null", descriptors); assertEquals("Invalid number of descriptors returned", actual.length, descriptors.length); } @Test public void testBeanPropertyIsArray() { PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(ContainerBean.class); for (int i = 0; i < descriptors.length; i++) { PropertyDescriptor descriptor = descriptors[i]; if ("containedBeans".equals(descriptor.getName())) { assertTrue("Property should be an array", descriptor.getPropertyType().isArray()); assertEquals(descriptor.getPropertyType().getComponentType(), ContainedBean.class); } } } @Test public void testFindEditorByConvention() { assertEquals(ResourceEditor.class, BeanUtils.findEditorByConvention(Resource.class).getClass()); } @Test public void testCopyProperties() throws Exception { TestBean tb = new TestBean(); tb.setName("rod"); tb.setAge(32); tb.setTouchy("touchy"); TestBean tb2 = new TestBean(); assertTrue("Name empty", tb2.getName() == null); assertTrue("Age empty", tb2.getAge() == 0); assertTrue("Touchy empty", tb2.getTouchy() == null); BeanUtils.copyProperties(tb, tb2); assertTrue("Name copied", tb2.getName().equals(tb.getName())); assertTrue("Age copied", tb2.getAge() == tb.getAge()); assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy())); } @Test public void testCopyPropertiesWithDifferentTypes1() throws Exception { DerivedTestBean tb = new DerivedTestBean(); tb.setName("rod"); tb.setAge(32); tb.setTouchy("touchy"); TestBean tb2 = new TestBean(); assertTrue("Name empty", tb2.getName() == null); assertTrue("Age empty", tb2.getAge() == 0); assertTrue("Touchy empty", tb2.getTouchy() == null); BeanUtils.copyProperties(tb, tb2); assertTrue("Name copied", tb2.getName().equals(tb.getName())); assertTrue("Age copied", tb2.getAge() == tb.getAge()); assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy())); } @Test public void testCopyPropertiesWithDifferentTypes2() throws Exception { TestBean tb = new TestBean(); tb.setName("rod"); tb.setAge(32); tb.setTouchy("touchy"); DerivedTestBean tb2 = new DerivedTestBean(); assertTrue("Name empty", tb2.getName() == null); assertTrue("Age empty", tb2.getAge() == 0); assertTrue("Touchy empty", tb2.getTouchy() == null); BeanUtils.copyProperties(tb, tb2); assertTrue("Name copied", tb2.getName().equals(tb.getName())); assertTrue("Age copied", tb2.getAge() == tb.getAge()); assertTrue("Touchy copied", tb2.getTouchy().equals(tb.getTouchy())); } @Test public void testCopyPropertiesWithEditable() throws Exception { TestBean tb = new TestBean(); assertTrue("Name empty", tb.getName() == null); tb.setAge(32); tb.setTouchy("bla"); TestBean tb2 = new TestBean(); tb2.setName("rod"); assertTrue("Age empty", tb2.getAge() == 0); assertTrue("Touchy empty", tb2.getTouchy() == null); // "touchy" should not be copied: it's not defined in ITestBean BeanUtils.copyProperties(tb, tb2, ITestBean.class); assertTrue("Name copied", tb2.getName() == null); assertTrue("Age copied", tb2.getAge() == 32); assertTrue("Touchy still empty", tb2.getTouchy() == null); } @Test public void testCopyPropertiesWithIgnore() throws Exception { TestBean tb = new TestBean(); assertTrue("Name empty", tb.getName() == null); tb.setAge(32); tb.setTouchy("bla"); TestBean tb2 = new TestBean(); tb2.setName("rod"); assertTrue("Age empty", tb2.getAge() == 0); assertTrue("Touchy empty", tb2.getTouchy() == null); // "spouse", "touchy", "age" should not be copied BeanUtils.copyProperties(tb, tb2, new String[]{"spouse", "touchy", "age"}); assertTrue("Name copied", tb2.getName() == null); assertTrue("Age still empty", tb2.getAge() == 0); assertTrue("Touchy still empty", tb2.getTouchy() == null); } @Test public void testCopyPropertiesWithIgnoredNonExistingProperty() { NameAndSpecialProperty source = new NameAndSpecialProperty(); source.setName("name"); TestBean target = new TestBean(); BeanUtils.copyProperties(source, target, new String[]{"specialProperty"}); assertEquals(target.getName(), "name"); } @Test public void testResolveSimpleSignature() throws Exception { Method desiredMethod = MethodSignatureBean.class.getMethod("doSomething"); assertSignatureEquals(desiredMethod, "doSomething"); assertSignatureEquals(desiredMethod, "doSomething()"); } @Test public void testResolveInvalidSignature() throws Exception { try { BeanUtils.resolveSignature("doSomething(", MethodSignatureBean.class); fail("Should not be able to parse with opening but no closing paren."); } catch (IllegalArgumentException ex) { // success } try { BeanUtils.resolveSignature("doSomething)", MethodSignatureBean.class); fail("Should not be able to parse with closing but no opening paren."); } catch (IllegalArgumentException ex) { // success } } @Test public void testResolveWithAndWithoutArgList() throws Exception { Method desiredMethod = MethodSignatureBean.class.getMethod("doSomethingElse", new Class[]{String.class, int.class}); assertSignatureEquals(desiredMethod, "doSomethingElse"); assertNull(BeanUtils.resolveSignature("doSomethingElse()", MethodSignatureBean.class)); } @Test public void testResolveTypedSignature() throws Exception { Method desiredMethod = MethodSignatureBean.class.getMethod("doSomethingElse", new Class[]{String.class, int.class}); assertSignatureEquals(desiredMethod, "doSomethingElse(java.lang.String, int)"); } @Test public void testResolveOverloadedSignature() throws Exception { // test resolve with no args Method desiredMethod = MethodSignatureBean.class.getMethod("overloaded"); assertSignatureEquals(desiredMethod, "overloaded()"); // resolve with single arg desiredMethod = MethodSignatureBean.class.getMethod("overloaded", new Class[]{String.class}); assertSignatureEquals(desiredMethod, "overloaded(java.lang.String)"); // resolve with two args desiredMethod = MethodSignatureBean.class.getMethod("overloaded", new Class[]{String.class, BeanFactory.class}); assertSignatureEquals(desiredMethod, "overloaded(java.lang.String, org.springframework.beans.factory.BeanFactory)"); } @Test public void testResolveSignatureWithArray() throws Exception { Method desiredMethod = MethodSignatureBean.class.getMethod("doSomethingWithAnArray", new Class[]{String[].class}); assertSignatureEquals(desiredMethod, "doSomethingWithAnArray(java.lang.String[])"); desiredMethod = MethodSignatureBean.class.getMethod("doSomethingWithAMultiDimensionalArray", new Class[]{String[][].class}); assertSignatureEquals(desiredMethod, "doSomethingWithAMultiDimensionalArray(java.lang.String[][])"); } @Test public void testSPR6063() { PropertyDescriptor[] descrs = BeanUtils.getPropertyDescriptors(Bean.class); PropertyDescriptor keyDescr = BeanUtils.getPropertyDescriptor(Bean.class, "value"); assertEquals(String.class, keyDescr.getPropertyType()); for (PropertyDescriptor propertyDescriptor : descrs) { if (propertyDescriptor.getName().equals(keyDescr.getName())) { assertEquals(propertyDescriptor.getName() + " has unexpected type", keyDescr.getPropertyType(), propertyDescriptor.getPropertyType()); } } } private void assertSignatureEquals(Method desiredMethod, String signature) { assertEquals(desiredMethod, BeanUtils.resolveSignature(signature, MethodSignatureBean.class)); } private static class NameAndSpecialProperty { private String name; private int specialProperty; public void setName(String name) { this.name = name; } public String getName() { return this.name; } public void setSpecialProperty(int specialProperty) { this.specialProperty = specialProperty; } public int getSpecialProperty() { return specialProperty; } } private static class ContainerBean { private ContainedBean[] containedBeans; public ContainedBean[] getContainedBeans() { return containedBeans; } public void setContainedBeans(ContainedBean[] containedBeans) { this.containedBeans = containedBeans; } } private static class ContainedBean { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } private static class MethodSignatureBean { public void doSomething() { } public void doSomethingElse(String s, int x) { } public void overloaded() { } public void overloaded(String s) { } public void overloaded(String s, BeanFactory beanFactory) { } public void doSomethingWithAnArray(String[] strings) { } public void doSomethingWithAMultiDimensionalArray(String[][] strings) { } } private interface MapEntry<K, V> { K getKey(); void setKey(V value); V getValue(); void setValue(V value); } private static class Bean implements MapEntry<String, String> { private String key; private String value; public String getKey() { return key; } public void setKey(String aKey) { key = aKey; } public String getValue() { return value; } public void setValue(String aValue) { value = aValue; } } }
47af71bd0b4834f88ab8cdd8a1fed350f84b73cd
64e61a9d57643334b42e5ed050c2eb0982900166
/src/cn/easybuy/service/mybatis/MyBatisService.java
8a2dbb5b0ef573cba1e2e7fb4a6d5c310de68852
[]
no_license
Vintonsen/EasyBuy
158e20ea37de18d93077afb772fd34c7236f9db5
871d3da8a80b8f63dff6e1663dea064e63490a87
refs/heads/master
2020-03-11T02:27:03.501444
2018-04-19T02:14:26
2018-04-19T02:14:26
129,719,356
0
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package cn.easybuy.service.mybatis; import java.lang.reflect.ParameterizedType; import java.util.HashMap; import java.util.Map; import org.apache.ibatis.session.SqlSession; import cn.easybuy.utils.MyBatisUtil; /** * @author Vintonsen_lcx * @time 2018年4月19日 上午8:40:23 * @describe */ public class MyBatisService<T> { public T t; public SqlSession session; public Class<T> entityClass = (Class<T>) ((ParameterizedType) this .getClass().getGenericSuperclass()).getActualTypeArguments()[0]; public void setEntityClass(Class<T> entityClass){ this.entityClass = entityClass; } public Class<T> getEntityClass(){ return entityClass; } public void before() { session = MyBatisUtil.getSession(); t = session.getMapper(entityClass); } public Map<String, Integer> getPage(Integer init,Integer pageSize){ Map<String, Integer> map = new HashMap<String, Integer>(); map.put("init",(init-1) * pageSize); map.put("pageSize", pageSize); return map; } public void after() { session.commit(); session.close(); } }
[ "Vintonsen_lcx@DESKTOP-JHSMVRL" ]
Vintonsen_lcx@DESKTOP-JHSMVRL
030da2dea9150dbd434c2efc7b473b68875ab339
e587c46b88f34b037ed53307aaaf1e6283713093
/plugins/au.gov.ga.earthsci.bookmark/src/au/gov/ga/earthsci/bookmark/properties/exaggeration/ExaggerationPropertyApplicator.java
382ff11e9f4b50a5dda7a9bfcbc2345a7eb0d1a1
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
GeoscienceAustralia/earthsci
1fe97deeae176eca836499b4854589a474dd5e89
d44f448f992536c971ac4721ee550021dcea4543
refs/heads/master
2022-09-04T13:40:51.102793
2022-08-03T07:10:45
2022-08-03T07:10:45
6,183,254
51
30
null
2022-06-21T03:30:15
2012-10-12T00:46:12
Java
UTF-8
Java
false
false
1,946
java
/******************************************************************************* * Copyright 2012 Geoscience Australia * * 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 au.gov.ga.earthsci.bookmark.properties.exaggeration; import au.gov.ga.earthsci.bookmark.IBookmarkPropertyAnimator; import au.gov.ga.earthsci.bookmark.IBookmarkPropertyApplicator; import au.gov.ga.earthsci.bookmark.model.IBookmarkProperty; import au.gov.ga.earthsci.worldwind.common.exaggeration.VerticalExaggerationService; /** * An {@link IBookmarkPropertyApplicator} used to apply the state of * {@link ExaggerationProperty}s * * @author Michael de Hoog */ public class ExaggerationPropertyApplicator implements IBookmarkPropertyApplicator { @Override public String[] getSupportedTypes() { return new String[] { ExaggerationProperty.TYPE }; } @Override public void apply(IBookmarkProperty property) { if (property == null) { return; } ExaggerationProperty exaggerationProperty = (ExaggerationProperty) property; VerticalExaggerationService.INSTANCE.set(exaggerationProperty.getExaggeration()); } @Override public IBookmarkPropertyAnimator createAnimator(IBookmarkProperty start, IBookmarkProperty end, long duration) { return new ExaggerationPropertyAnimator((ExaggerationProperty) start, (ExaggerationProperty) end, duration); } }
705be27083dda714fb3eda6231ca720b3fc6801d
19a7c67f842ccb9888193e35c269d557abe1bfa5
/Person.java
a89b4709be4c4542ca0b941666a51b2b65775347
[]
no_license
shaynabergeron/TASK7_DB
8476f8789ad7c8786660591e4829ae2dde3e44c2
43d3f1de2796577e5389490f6a4b0b028836984e
refs/heads/main
2023-04-23T01:21:50.464262
2021-05-09T22:18:35
2021-05-09T22:18:35
365,858,896
0
0
null
null
null
null
UTF-8
Java
false
false
5,087
java
import java.sql.*; import java.util.*; import java.time.*; import java.time.format.DateTimeFormatter; public class Person{ private Connection conn; public Person(Connection con) { this.conn = con; } public ArrayList getPerson(int P_PositionCode){ ArrayList<String> list = new ArrayList(); try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select * from person where person.PersonID = "+P_PositionCode); int colcount = result.getMetaData().getColumnCount(); while(result.next()){ for(int i = 1; i != colcount+1;i++){ list.add(result.getString(i)); } } } catch(Exception e){ System.out.println(e); } return list; } public String skillidToSkillname(String RequiredSkill){ String skillname = ""; try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select Title from skills where SkillCode = "+RequiredSkill); while(result.next()){ skillname = result.getString(1); } } catch(Exception e){ System.out.println(e); } return skillname; } public ArrayList haskills(int P_PositionCode){ ArrayList<String> skills = new ArrayList<>(); try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select * from Has_Skill where PersonID = "+P_PositionCode); while(result.next()){ skills.add(result.getString(2)); } } catch(Exception e){ System.out.println(e); } return skills; } /* public ArrayList skillFromTakenCourses(String className){ ArrayList<String> skills = new ArrayList<>(); try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select T_SkillCode from teaches where T_CourseCode in(select CourseCode from course where Title = \'"+className+"\')"); while(result.next()){ skills.add(result.getString(1)); } } catch(Exception e){ System.out.println(e); } return skills; }*/ public void insertSkills(int PersonID,ArrayList<String> list){ for(String skill:list){ String sql = "INSERT INTO Has_Skill values("+PersonID+","+skill+")"; try{ PreparedStatement ps = this.conn.prepareStatement(sql); ps.execute(); ps.close(); }catch(Exception e){ System.out.println(e); } } } public int courseNum(String className){ int corusenum = 0; try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select CourseCode from course where Title = \'"+className+"\'"); while(result.next()){ corusenum = result.getInt(1); } } catch(Exception e){ System.out.println(e); } return corusenum; } public int coruseNumFromSkill(String RequiredSkill){ int corusenum = 0; try{ Statement state = conn.createStatement(); ResultSet result = state.executeQuery("select T_CourseCode from teaches where T_SkillCode = \'"+RequiredSkill+"\'"); while(result.next()){ corusenum = result.getInt(1); } } catch(Exception e){ System.out.println(e); } return corusenum; } public void insertintotakes(int P_PositionCode, int course, String findate){ String sql = SQLformat(P_PositionCode, "takes", course, findate); try{ PreparedStatement ps = this.conn.prepareStatement(sql); ps.execute(); ps.close(); }catch(Exception e){ System.out.println(e); } } public void insertIntoWorks(int P_PositionCode, String JobCode){ String sql = SQLformat(P_PositionCode, "works", JobCode); try{ LocalDate currentDate = LocalDate.now(); int year = currentDate.getYear(); int month = currentDate.getMonthValue(); String monthYear = month+"/"+year; PreparedStatement ps= this.conn.prepareStatement(sql); ps.execute(); ps.close(); }catch(Exception e){ System.out.println(e); } } public String SQLformat(int P_PositionCode, String table, int one, String two){ String sql = "INSERT INTO "+table+" VALUES("+P_PositionCode+", "+one+", \'"+two+"\')"; return sql; } public String SQLformat(int P_PositionCode, String table, String one){ String sql = "INSERT INTO "+table+" VALUES("+P_PositionCode+", \'"+one+"\')"; return sql; } }
f64a9e0c59f4eab9da025e08044f149b268f37e2
4702c53b26c734a0e807f0793bd5ecd8c17d17e4
/app/src/main/java/com/bh/yibeitong/ui/percen/FMRecharge.java
ede7a2b2b4293936518aa86f767b9abcff80d2e7
[]
no_license
jingangdan/BH_YiBeiTong
f0aa80d0b50326761da30bcbe28c2a2f3f6a1816
a779bbde525061b4363ce8ad11af35de7229fb8b
refs/heads/master
2021-01-12T05:34:55.127465
2017-09-29T03:23:59
2017-09-29T03:23:59
77,132,599
0
0
null
null
null
null
UTF-8
Java
false
false
10,049
java
package com.bh.yibeitong.ui.percen; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.GridView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.bh.yibeitong.R; import com.bh.yibeitong.bean.Register; import com.bh.yibeitong.bean.homepage.Recharge; import com.bh.yibeitong.ui.PayActivity; import com.bh.yibeitong.utils.GsonUtil; import com.bh.yibeitong.utils.HttpPath; import com.bh.yibeitong.view.UserInfo; import org.xutils.common.Callback; import org.xutils.http.RequestParams; import org.xutils.x; import java.util.List; /** * Created by jingang on 2017/7/5. * 我要充值(充值) */ public class FMRecharge extends Fragment implements View.OnClickListener { private View view; /*接口地址*/ private String PATH = ""; /*本地轻量缓存*/ private UserInfo userInfo; private String jingang, uid, pwd, phone; /*充值列表显示*/ private GridView gridView; private RechargeAdapter rechargeAdapter; private TextView tv_hint; /*GridView选中状态*/ private boolean isSelect = false; private LinearLayout linearLayout; private String cost = "", send = ""; /*充值金额*/ private EditText mEditText; /*立即充值*/ private Button but_recharge; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.fragment_recharge, null); initData(); return view; } public static FMRecharge newInstance(String name) { Bundle bundle = new Bundle(); bundle.putString("name", name); FMRecharge fragment = new FMRecharge(); fragment.setArguments(bundle); return fragment; } /**/ public void initData() { gridView = (GridView) view.findViewById(R.id.gv_recharge); tv_hint = (TextView) view.findViewById(R.id.tv_item_recharge_hint); linearLayout = (LinearLayout) view.findViewById(R.id.lin_recharge_hint); mEditText = (EditText) view.findViewById(R.id.et_recharge); but_recharge = (Button) view.findViewById(R.id.but_recharge); but_recharge.setOnClickListener(this); userInfo = new UserInfo(getActivity().getApplication()); jingang = userInfo.getCode();//登录方式 if (!(userInfo.getUserInfo().equals(""))) { Register register = GsonUtil.gsonIntance().gsonToBean(userInfo.getUserInfo(), Register.class); uid = register.getMsg().getUid(); phone = register.getMsg().getPhone(); if (!(userInfo.getPwd().equals(""))) { pwd = userInfo.getPwd(); } if (jingang.equals("0")) { getMemcard(uid, pwd); } else { getMemcard("phone", phone); } } else { //Toast.makeText(getActivity(), "未登录", Toast.LENGTH_SHORT).show(); //toast("未登录"); } } /** * 充值列表 * * @param uid * @param pwd */ public void getMemcard(String uid, String pwd) { if (jingang.equals("0")) { //账号密码登录 PATH = HttpPath.PATH + HttpPath.MEMCARD + "uid=" + uid + "&pwd=" + pwd; } else { //快捷登录 PATH = HttpPath.PATH + HttpPath.MEMCARD + "logintype=" + uid + "&loginphone=" + pwd; } RequestParams params = new RequestParams(PATH); x.http().get(params, new Callback.CommonCallback<String>() { @Override public void onSuccess(String result) { System.out.println("充值列表" + result); final Recharge recharge = GsonUtil.gsonIntance().gsonToBean(result, Recharge.class); rechargeAdapter = new RechargeAdapter(getActivity(), recharge.getMsg().getRechargelist()); gridView.setAdapter(rechargeAdapter); /*列表点击操作*/ gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { if (isSelect) { linearLayout.setVisibility(View.GONE); rechargeAdapter.changeSelected(-1); isSelect = false; } else { linearLayout.setVisibility(View.VISIBLE); rechargeAdapter.changeSelected(i); cost = recharge.getMsg().getRechargelist().get(i).getCost(); send = recharge.getMsg().getRechargelist().get(i).getSendcost(); } tv_hint.setText("充值" + cost + "元赠送" + send + "元"); mEditText.setText("" + cost); } }); } @Override public void onError(Throwable ex, boolean isOnCallback) { } @Override public void onCancelled(CancelledException cex) { } @Override public void onFinished() { } }); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.but_recharge: //立即充值 if (mEditText.getText().toString().equals("")) { Toast.makeText(getActivity(), "充值金额不可为空", Toast.LENGTH_SHORT).show(); } else { Intent intent = new Intent(getActivity(), PayActivity.class); intent.putExtra("dno", "余额充值"); intent.putExtra("shopcost", cost); intent.putExtra("orderid", ""); intent.putExtra("type", "acount"); startActivity(intent); } break; default: break; } } /**/ public class RechargeAdapter extends BaseAdapter { private Context mContext; private List<Recharge.MsgBean.RechargelistBean> rechargelistBeen; private int mSelect = -1; public RechargeAdapter(Context mContext, List<Recharge.MsgBean.RechargelistBean> rechargelistBeen) { this.mContext = mContext; this.rechargelistBeen = rechargelistBeen; } /** * 刷新方法 * * @param positon */ public void changeSelected(int positon) { if (positon != mSelect) { mSelect = positon; notifyDataSetChanged(); } } @Override public int getCount() { return rechargelistBeen.size(); } @Override public Object getItem(int i) { return rechargelistBeen.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { ViewHolder vh; if (view == null) { vh = new ViewHolder(); view = LayoutInflater.from(mContext).inflate(R.layout.item_recharge, null); vh.tv_cost = (TextView) view.findViewById(R.id.tv_item_recharge_cost); vh.tv_send = (TextView) view.findViewById(R.id.tv_item_recharge_send); vh.tv_rmb = (TextView) view.findViewById(R.id.tv_item_recharge_rmb); vh.linearLayout = (LinearLayout) view.findViewById(R.id.lin_item_recharge); view.setTag(vh); } else { vh = (ViewHolder) view.getTag(); } //ListView点击改变背景 文字 if (mSelect == i) { vh.tv_rmb.setTextColor(Color.rgb(255, 157, 7)); vh.tv_cost.setTextColor(Color.rgb(255, 157, 7)); vh.tv_send.setTextColor(Color.rgb(255, 157, 7)); vh.linearLayout.setBackgroundResource(R.drawable.kuang_style); } else if (mSelect == -1) { vh.tv_rmb.setTextColor(Color.rgb(128, 128, 128)); vh.tv_cost.setTextColor(Color.rgb(51, 51, 51)); vh.tv_send.setTextColor(Color.rgb(128, 128, 128)); vh.linearLayout.setBackgroundResource(R.drawable.kuang_black); } else { vh.tv_rmb.setTextColor(Color.rgb(128, 128, 128)); vh.tv_cost.setTextColor(Color.rgb(51, 51, 51)); vh.tv_send.setTextColor(Color.rgb(128, 128, 128)); vh.linearLayout.setBackgroundResource(R.drawable.kuang_black); } String cost = rechargelistBeen.get(i).getCost(); String send = rechargelistBeen.get(i).getSendcost(); vh.tv_cost.setText("" + cost); vh.tv_send.setText("送" + send + "元"); return view; } public class ViewHolder { TextView tv_cost, tv_send, tv_rmb; LinearLayout linearLayout; } } }
c929bc43a48c08b09d730b34103747a914e9316f
b3e3447a6fcf111e79481e4d07b4e342bb2a81c3
/child_android/child_android/app/src/main/java/com/preschool/edu/activity/user/LoginActivity.java
fd93441b1542c23a500ecd1a276087fdd3a07e0d
[]
no_license
973319261/child_android
a320fb8e62f29d5e5e3766161cd502d22d4c5e92
523776fa4bc702220282db97cf186e7fbd011830
refs/heads/master
2023-01-06T12:13:24.022249
2020-11-08T01:06:47
2020-11-08T01:06:47
310,959,935
0
0
null
null
null
null
UTF-8
Java
false
false
6,887
java
package com.preschool.edu.activity.user; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.preschool.edu.R; import com.preschool.edu.activity.BaseActivity; import com.preschool.edu.core.HttpResult; import com.preschool.edu.core.HttpUtil; import org.json.JSONException; import org.json.JSONObject; import org.xutils.common.Callback; import org.xutils.http.RequestParams; import org.xutils.view.annotation.ContentView; import org.xutils.view.annotation.Event; import org.xutils.view.annotation.ViewInject; import org.xutils.x; import java.util.HashMap; import java.util.Map; /** * Created by jac_cheng on 2017/12/27. */ @ContentView(R.layout.activity_login) public class LoginActivity extends BaseActivity { @ViewInject(R.id.login_mobile_area_code_tv) private TextView areaCodeTv; @ViewInject(R.id.login_mobile_et) private EditText mobileEt; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mobileEt.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { updateUI(); } @Override public void afterTextChanged(Editable s) { } }); updateUI(); } @Event(value = {R.id.login_mobile_area_code_tv, R.id.login_cancel_tv, R.id.login_protocols_layout, R.id.login_question_tv, R.id.login_next_step_btn, R.id.login_with_weixin_btn}) private void onBtnsClick(View v) { switch (v.getId()) { case R.id.login_mobile_area_code_tv: open(CountryAreaCodeActivity.class, 300); break; case R.id.login_cancel_tv: goBack(); break; case R.id.login_protocols_layout: break; case R.id.login_question_tv: break; case R.id.login_next_step_btn: hideKb(); tryCheckMobile(); break; case R.id.login_with_weixin_btn: toast("TODO: 等微信信息"); break; } } private void updateUI() { ImageView nextStepBtn = (ImageView) findViewById(R.id.login_next_step_btn); boolean showLoginBtn = etTxt(mobileEt).length() == 11;//要根据不同的国家判断 nextStepBtn.setEnabled(showLoginBtn); nextStepBtn.setFocusable(showLoginBtn); nextStepBtn.setFocusableInTouchMode(showLoginBtn); if (etIsNull(mobileEt)) { nextStepBtn.setVisibility(View.INVISIBLE); hideViewId(R.id.login_protocols_layout, false); showViewById(R.id.login_with_sns_hint_tv); showViewById(R.id.login_with_weixin_btn); } else { hideViewId(R.id.login_with_sns_hint_tv, false); hideViewId(R.id.login_with_weixin_btn, false); nextStepBtn.setVisibility(View.VISIBLE); showViewById(R.id.login_protocols_layout); nextStepBtn.setImageResource(showLoginBtn ? R.mipmap.next_step_arrow_lighted : R.mipmap.next_step_arrow_grey); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == 300) { areaCodeTv.setText(data.getStringExtra("areaCode")); } } } private void tryCheckMobile() { showDialog(); final RequestParams params = HttpUtil.requestParams("external/users/check_exists"); params.addBodyParameter("login", String.format("%s%s", tvTxt(areaCodeTv), etTxt(mobileEt))); x.http().get(params, new Callback.CommonCallback<JSONObject>() { @Override public void onSuccess(JSONObject result) { closeDialog(); HttpResult httpResult = HttpResult.createWith(result); if (httpResult.isSuccess()) { Map<String, Object> args = new HashMap<String, Object>(); args.put("areaCode", tvTxt(areaCodeTv)); args.put("mobile", etTxt(mobileEt)); if ((Boolean) httpResult.payload) { open(LoginSubmitActivity.class, args); } else { open(RegActivity.class, args); } } else { toast(httpResult.returnMsg); } } @Override public void onError(Throwable ex, boolean isOnCallback) { closeDialog(); HttpUtil.onError(params.getUri(), ex); toast(BaseActivity.DEFAULT_HTTP_ERROR); } @Override public void onCancelled(CancelledException cex) { closeDialog(); } @Override public void onFinished() { closeDialog(); } }); } private void tryLoginWithWechat() throws JSONException { showDialog(); JSONObject userLogin = new JSONObject(); userLogin.put("headerImageUrl", ""); userLogin.put("name", ""); userLogin.put("openid", ""); userLogin.put("sex", ""); userLogin.put("role", "ROLE_parent"); final RequestParams params = HttpUtil.requestParams("external/admin/wei-xin-users"); params.setAsJsonContent(true); params.setBodyContent(userLogin.toString()); x.http().post(params, new Callback.CommonCallback<JSONObject>() { @Override public void onSuccess(JSONObject result) { closeDialog(); HttpResult httpResult = HttpResult.createWith(result); if (httpResult.isSuccess()) { } else { toast(httpResult.returnMsg); } } @Override public void onError(Throwable ex, boolean isOnCallback) { closeDialog(); HttpUtil.onError(params.getUri(), ex); toast(BaseActivity.DEFAULT_HTTP_ERROR); } @Override public void onCancelled(CancelledException cex) { closeDialog(); } @Override public void onFinished() { closeDialog(); } }); } }
5b09823cd59e1d42c2f8c2dfcd1f0a1dae7f973b
1c701c4ca9dafa8ee294f8d0233888fe14d99ec1
/src/main/java/com/miaoyidj/miniprogram/controller/WxPortalController.java
13dadbc1ff59cc4a9a37d2e39095d1ed4b61a11a
[]
no_license
caddyz/miniprogram
5bf04fee7043e8b48e7a8984dd38ca76bd7597c2
09778aa4447430b0a1441a54b81e7dcf110c338e
refs/heads/master
2022-07-06T04:06:49.102971
2019-08-11T07:30:38
2019-08-11T07:30:38
195,618,522
0
0
null
2022-06-17T02:18:22
2019-07-07T06:34:52
Java
UTF-8
Java
false
false
4,217
java
package com.miaoyidj.miniprogram.controller; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.bean.WxMaMessage; import cn.binarywang.wx.miniapp.constant.WxMaConstants; import com.miaoyidj.miniprogram.config.WxMaConfiguration; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import java.util.Objects; /** * @ProjectName: miniprogram * @Package: com.miaoyidj.miniprogram.controller * @ClassName: WxPortalController * @Author: Kaiser * @Description: 控制 * @Date: 2019-08-08 17:16 * @Version: 1.0 */ @RestController @RequestMapping("/wx/portal/{appid}") public class WxPortalController { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @GetMapping(produces = "text/plain;charset=utf-8") public String authGet(@PathVariable String appid, @RequestParam(name = "signature", required = false) String signature, @RequestParam(name = "timestamp", required = false) String timestamp, @RequestParam(name = "nonce", required = false) String nonce, @RequestParam(name = "echostr", required = false) String echostr) { this.logger.info("\n接收到来自微信服务器的认证消息:signature = [{}], timestamp = [{}], nonce = [{}], echostr = [{}]", signature, timestamp, nonce, echostr); if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { throw new IllegalArgumentException("请求参数非法,请核实!"); } final WxMaService wxService = WxMaConfiguration.getMaService(appid); if (wxService.checkSignature(timestamp, nonce, signature)) { return echostr; } return "非法请求"; } @PostMapping(produces = "application/xml; charset=UTF-8") public String post(@PathVariable String appid, @RequestBody String requestBody, @RequestParam(name = "msg_signature", required = false) String msgSignature, @RequestParam(name = "encrypt_type", required = false) String encryptType, @RequestParam(name = "signature", required = false) String signature, @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce) { this.logger.info("\n接收微信请求:[msg_signature=[{}], encrypt_type=[{}], signature=[{}]," + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", msgSignature, encryptType, signature, timestamp, nonce, requestBody); final WxMaService wxService = WxMaConfiguration.getMaService(appid); final boolean isJson = Objects.equals(wxService.getWxMaConfig().getMsgDataFormat(), WxMaConstants.MsgDataFormat.JSON); if (StringUtils.isBlank(encryptType)) { // 明文传输的消息 WxMaMessage inMessage; if (isJson) { inMessage = WxMaMessage.fromJson(requestBody); } else {//xml inMessage = WxMaMessage.fromXml(requestBody); } this.route(inMessage, appid); return "success"; } if ("aes".equals(encryptType)) { // 是aes加密的消息 WxMaMessage inMessage; if (isJson) { inMessage = WxMaMessage.fromEncryptedJson(requestBody, wxService.getWxMaConfig()); } else {//xml inMessage = WxMaMessage.fromEncryptedXml(requestBody, wxService.getWxMaConfig(), timestamp, nonce, msgSignature); } this.route(inMessage, appid); return "success"; } throw new RuntimeException("不可识别的加密类型:" + encryptType); } private void route(WxMaMessage message, String appid) { try { WxMaConfiguration.getRouters().get(appid).route(message); } catch (Exception e) { this.logger.error(e.getMessage(), e); } } }
78ff2ef05c3e5a5ce62939f9d38d103f995f26cf
3e99645f4e4755c70db4a52142b11ed9d6587c1c
/Git_project/src/demo_purpose_file/CreateDemoFile.java
eaa6b47ff67d97bc6c211bd965393c0e855f1e50
[ "MIT" ]
permissive
ashwini286/new-repository
4644c9059ea296c2370a702e41fe599a74193c67
6c8dd02449be64e6b67dbec4f27dd2fa59cdc289
refs/heads/main
2023-05-11T17:33:51.845572
2021-06-04T12:53:49
2021-06-04T12:53:49
365,451,635
0
0
null
null
null
null
UTF-8
Java
false
false
4,551
java
package demo_purpose_file; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.LineNumberReader; import java.nio.file.Files; import java.nio.file.Path; import java.util.Scanner; import java.util.*; public class CreateDemoFile { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub /* File f = new File("abc.txt"); System.out.println(f.exists()); f.createNewFile(); System.out.println(f.exists()); } */ File myfile = new File( "G:\\FileHandlingss.txt"); Thread t1 = new Thread(new Runnable () { public void run() { try { if(myfile.createNewFile()) { System.out.println("File creating " +myfile.getName()); } else { System.out.println("file already exitsts"); } } catch (IOException e) { // TODO Auto-generated catch block System.out.println("an error accurred"); e.printStackTrace(); } } }); //copy the file File copyfile = new File("G:\\FileHandlingss-copy.txt"); Thread t4 = new Thread(new Runnable () { public void run() { try { Files.copy(Path.of("G:\\FileHandlingss.txt"), Path.of("G:\\\\FileHandlingsCopy.txt")); System.out.println("Done"); }catch (Exception e){ System.out.println("Error"); } } }); //code to write in file Thread t2 = new Thread(new Runnable () { public void run() { try { FileWriter filewriter = new FileWriter("G:\\\\FileHandlingss.txt"); filewriter.write("hllo i am ashwini sharma from madanpur It is only try to make project \n ok bye"); filewriter.close(); } catch (IOException ex) { ex.printStackTrace(); } } }); int numLines = 0; int numWords = 0; //we need to read inn the file Scanner as = null; //code to read file Thread t3 = new Thread(new Runnable () { public void run() { try { File myfile = new File("G:\\\\FileHandlingss.txt"); Scanner sc = new Scanner(myfile); while(sc.hasNextLine()) { String line = sc.nextLine(); System.out.println(line); } sc.close(); } catch (FileNotFoundException e) { System.out.println("your files does not exists"); } //count the line number in file /* File myfile = new File("G:\\\\\\\\FileHandlingss.txt"); if(myfile.exists()) { try { FileReader f = new FileReader(myfile); LineNumberReader as = new LineNumberReader(f); int LineNumberReader = 0; try { int lineNumberCount = 0; while(as.readLine()!=null) { lineNumberCount++; } System.out.println("total number of line in a file" +lineNumberCount); }catch(IOException e) { e.printStackTrace(); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } */ //count,line characters and numberWord int numwords = 0; int numLines = 0; int numchars=0; Scanner myfile = null; try { Scanner file = new Scanner (new File ("G:\\\\\\\\FileHandlingss.txt")); myfile = file; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } while(myfile.hasNextLine()) { //we need the current line String curLine = myfile.nextLine(); int Size = curLine.length(); boolean foundDiv = true; //no words on this line boolean foundchar = false; //no char yet //we want to check the current line for words for(int i=0;i<Size;i++) { if(curLine.charAt(i) == ' ') { //we have a division foundDiv = true; foundchar = false; }else { //we found char foundchar = true; numchars++; } if(foundchar && foundDiv) { numwords ++; foundDiv=false; } } numLines++; } myfile.close(); System.out.println("number of words = " +numWords); System.out.println("number of Lines = " +numLines); System.out.println("number of character = " +numchars); System.out.println("Ashwini Sharma"); } }); t1.start(); t2.start(); t3.start(); t4.start(); } }
[ "Ashwini Sharma@LAPTOP-T7ERKC6G" ]
Ashwini Sharma@LAPTOP-T7ERKC6G
d5d7554df225e934989892409e5790a15d801925
12c0b343ba64530387f723063bc9c9c469faed1d
/greenarea-workflow/greenarea-activiti-diagrams/src/test/java/it/vige/greenarea/bpm/tempo/test/ImportaNuoviRitiriTest.java
00287c02dbdbb5ca48d950c4501d5e09eda4117a
[]
no_license
gladyscarrizales/greenarea
5d2cde1d7e80b6878077b0a56fffeee11230c885
6231e0fd51de655e5922512e086078b3afb15e63
refs/heads/master
2021-01-18T12:21:33.596462
2016-02-20T10:04:27
2016-02-20T10:04:27
53,947,668
0
0
null
2016-03-15T13:40:31
2016-03-15T13:40:31
null
UTF-8
Java
false
false
16,002
java
/****************************************************************************** * Vige, Home of Professional Open Source Copyright 2010, Vige, and * * individual contributors by the @authors tag. See the copyright.txt in the * * distribution for a full listing of individual contributors. * * 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 it.vige.greenarea.bpm.tempo.test; import it.vige.greenarea.bpm.GreenareaDemoData; import it.vige.greenarea.bpm.mail.MyMessageHandlerFactory; import it.vige.greenarea.bpm.tempo.importanuoviritiri.EmptyAggiornamentoNuoviRitiri; import it.vige.greenarea.bpm.tempo.importanuoviritiri.EmptyVerificaDatiNuoviRitiri; import it.vige.greenarea.bpm.tempo.service.importanuoviritiri.AggiornamentoNuoviRitiriConSegnalazioneErrore; import it.vige.greenarea.bpm.tempo.service.importanuoviritiri.RecuperoDatiNuoviRitiriPopolati; import it.vige.greenarea.bpm.tempo.service.importanuoviritiri.VerificaDatiNuoviRitiriConSollecitoNuoviRitiriNonCorretti; import java.util.List; import org.activiti.bpmn.model.BpmnModel; import org.activiti.bpmn.model.ServiceTask; import org.activiti.bpmn.model.StartEvent; import org.activiti.engine.history.HistoricActivityInstance; import org.activiti.engine.impl.test.ResourceActivitiTestCase; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.test.Deployment; import org.subethamail.smtp.server.SMTPServer; public class ImportaNuoviRitiriTest extends ResourceActivitiTestCase { private final static String USER_NAME = "amministratore"; private GreenareaDemoData greenareaDemoData = new GreenareaDemoData(); public ImportaNuoviRitiriTest() { super("activiti.cfg-mem.xml"); } @Deployment(resources = { "it/vige/greenarea/bpm/tempo/importa_nuovi_ritiri.bpmn20.xml" }) public void testOK() { // PARTE IL SERVER DI POSTA MyMessageHandlerFactory myFactory = new MyMessageHandlerFactory(); SMTPServer smtpServer = new SMTPServer(myFactory); smtpServer.setPort(25000); smtpServer.start(); // RIEMPIMENTO UTENTI E GRUPPI DI TEST greenareaDemoData.initDemoGroups(identityService); greenareaDemoData.initDemoUsers(identityService); // AUTENTICAZIONE // Always reset authenticated user to avoid any mistakes identityService.setAuthenticatedUserId(USER_NAME); // POPOLO I RITIRI E INIZIO IL PROCESSO ProcessDefinition importaNuoviRitiri = repositoryService .createProcessDefinitionQuery().singleResult(); BpmnModel importaNuoviRitiriModel = repositoryService .getBpmnModel(importaNuoviRitiri.getId()); org.activiti.engine.repository.Deployment deployment = repositoryService .createDeploymentQuery().singleResult(); StartEvent timerImportaNuoviRitiri = (StartEvent) importaNuoviRitiriModel .getFlowElement("timerImportaNuoviRitiri"); timerImportaNuoviRitiri.getEventDefinitions().clear(); ServiceTask recuperoDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("recuperoDatiNuoviRitiri"); recuperoDatiNuoviRitiri .setImplementation(RecuperoDatiNuoviRitiriPopolati.class .getName()); ServiceTask verificaDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("verificaDatiNuoviRitiri"); verificaDatiNuoviRitiri .setImplementation(EmptyVerificaDatiNuoviRitiri.class.getName()); ServiceTask aggiornamentoNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("aggiornamentoNuoviRitiri"); aggiornamentoNuoviRitiri .setImplementation(EmptyAggiornamentoNuoviRitiri.class .getName()); repositoryService.deleteDeployment(deployment.getId()); deployment = repositoryService.createDeployment() .addBpmnModel("dynamic-model.bpmn", importaNuoviRitiriModel) .deploy(); runtimeService.startProcessInstanceByKey("importaNuoviRitiri"); // VERIFICO L'ESECUZIONE DEL RECUPERO DATI NUOVI RITIRI List<HistoricActivityInstance> recuperoDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("recuperoDatiNuoviRitiri").list(); assertEquals(recuperoDatiNuoviRitiriHistory.size(), 2); // VERIFICO L'ESECUZIONE DELLA VERIFICA DATI NUOVI RITIRI List<HistoricActivityInstance> verificaDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("verificaDatiNuoviRitiri").list(); assertEquals(verificaDatiNuoviRitiriHistory.size(), 2); // VERIFICO L'ESECUZIONE DELL'AGGIORNAMENTO NUOVI RITIRI List<HistoricActivityInstance> aggiornamentoNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("aggiornamentoNuoviRitiri").list(); assertEquals(aggiornamentoNuoviRitiriHistory.size(), 2); // VERIFICO CHE LE EMAIL DI ERRORE DI NUOVI RITIRI NON CORRETTI NON SONO // STATE // MANDATE List<HistoricActivityInstance> sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti = historyService .createHistoricActivityInstanceQuery() .activityId( "sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti") .list(); assertEquals( sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti .size(), 0); // VERIFICO CHE LE EMAIL DI ERRORE DI AGGIORNAMENTO NUOVI RITIRI NON // SONO STATE // MANDATE List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore .size(), 0); List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico .size(), 0); // RIPULISCO IL DB greenareaDemoData.deleteAllIdentities(identityService); greenareaDemoData.deleteAllHistories(historyService); greenareaDemoData.deleteAllIDeployments(repositoryService); // FERMO IL SERVER DI POSTA smtpServer.stop(); } @Deployment(resources = { "it/vige/greenarea/bpm/tempo/importa_nuovi_ritiri.bpmn20.xml" }) public void testSollecitoPerDatiNuoviRitiriNonCorretti() { // PARTE IL SERVER DI POSTA MyMessageHandlerFactory myFactory = new MyMessageHandlerFactory(); SMTPServer smtpServer = new SMTPServer(myFactory); smtpServer.setPort(25000); smtpServer.start(); // RIEMPIMENTO UTENTI E GRUPPI DI TEST greenareaDemoData.initDemoGroups(identityService); greenareaDemoData.initDemoUsers(identityService); // AUTENTICAZIONE // Always reset authenticated user to avoid any mistakes identityService.setAuthenticatedUserId(USER_NAME); // POPOLO I RITIRI E INIZIO IL PROCESSO ProcessDefinition importaNuoviRitiri = repositoryService .createProcessDefinitionQuery().singleResult(); BpmnModel importaNuoviRitiriModel = repositoryService .getBpmnModel(importaNuoviRitiri.getId()); org.activiti.engine.repository.Deployment deployment = repositoryService .createDeploymentQuery().singleResult(); StartEvent timerImportaNuoviRitiri = (StartEvent) importaNuoviRitiriModel .getFlowElement("timerImportaNuoviRitiri"); timerImportaNuoviRitiri.getEventDefinitions().clear(); ServiceTask verificaDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("verificaDatiNuoviRitiri"); verificaDatiNuoviRitiri .setImplementation(VerificaDatiNuoviRitiriConSollecitoNuoviRitiriNonCorretti.class .getName()); ServiceTask recuperoDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("recuperoDatiNuoviRitiri"); recuperoDatiNuoviRitiri .setImplementation(RecuperoDatiNuoviRitiriPopolati.class .getName()); ServiceTask aggiornamentoNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("aggiornamentoNuoviRitiri"); aggiornamentoNuoviRitiri .setImplementation(EmptyAggiornamentoNuoviRitiri.class .getName()); repositoryService.deleteDeployment(deployment.getId()); deployment = repositoryService.createDeployment() .addBpmnModel("dynamic-model.bpmn", importaNuoviRitiriModel) .deploy(); runtimeService.startProcessInstanceByKey("importaNuoviRitiri"); // VERIFICO L'ESECUZIONE DEL RECUPERO DATI NUOVI RITIRI List<HistoricActivityInstance> recuperoDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("recuperoDatiNuoviRitiri").list(); assertEquals(recuperoDatiNuoviRitiriHistory.size(), 1); // VERIFICO L'ESECUZIONE DELLA VERIFICA DATI NUOVI RITIRI List<HistoricActivityInstance> verificaDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("verificaDatiNuoviRitiri").list(); assertEquals(verificaDatiNuoviRitiriHistory.size(), 1); // VERIFICO L'ESECUZIONE DELL'AGGIORNAMENTO NUOVI RITIRI List<HistoricActivityInstance> aggiornamentoNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("aggiornamentoNuoviRitiri").list(); assertEquals(aggiornamentoNuoviRitiriHistory.size(), 0); // VERIFICO CHE LE EMAIL DI ERRORE DI NUOVI RITIRI NON CORRETTI SONO // STATE // MANDATE List<HistoricActivityInstance> sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti = historyService .createHistoricActivityInstanceQuery() .activityId( "sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti") .list(); assertEquals( sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti .size(), 1); // VERIFICO CHE LE EMAIL DI ERRORE DI AGGIORNAMENTO NUOVI RITIRI NON // SONO STATE // MANDATE List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore .size(), 0); List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico .size(), 0); // RIPULISCO IL DB greenareaDemoData.deleteAllIdentities(identityService); greenareaDemoData.deleteAllHistories(historyService); greenareaDemoData.deleteAllIDeployments(repositoryService); // FERMO IL SERVER DI POSTA smtpServer.stop(); } @Deployment(resources = { "it/vige/greenarea/bpm/tempo/importa_nuovi_ritiri.bpmn20.xml" }) public void testSegnalazioneErroreAggiornamentoNuoviRitiri() { // PARTE IL SERVER DI POSTA MyMessageHandlerFactory myFactory = new MyMessageHandlerFactory(); SMTPServer smtpServer = new SMTPServer(myFactory); smtpServer.setPort(25000); smtpServer.start(); // RIEMPIMENTO UTENTI E GRUPPI DI TEST greenareaDemoData.initDemoGroups(identityService); greenareaDemoData.initDemoUsers(identityService); // AUTENTICAZIONE // Always reset authenticated user to avoid any mistakes identityService.setAuthenticatedUserId(USER_NAME); // POPOLO I RITIRI E INIZIO IL PROCESSO ProcessDefinition importaNuoviRitiri = repositoryService .createProcessDefinitionQuery().singleResult(); BpmnModel importaNuoviRitiriModel = repositoryService .getBpmnModel(importaNuoviRitiri.getId()); org.activiti.engine.repository.Deployment deployment = repositoryService .createDeploymentQuery().singleResult(); StartEvent timerImportaNuoviRitiri = (StartEvent) importaNuoviRitiriModel .getFlowElement("timerImportaNuoviRitiri"); timerImportaNuoviRitiri.getEventDefinitions().clear(); ServiceTask aggiornamentoNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("aggiornamentoNuoviRitiri"); aggiornamentoNuoviRitiri .setImplementation(AggiornamentoNuoviRitiriConSegnalazioneErrore.class .getName()); ServiceTask recuperoDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("recuperoDatiNuoviRitiri"); recuperoDatiNuoviRitiri .setImplementation(RecuperoDatiNuoviRitiriPopolati.class .getName()); ServiceTask verificaDatiNuoviRitiri = (ServiceTask) importaNuoviRitiriModel .getFlowElement("verificaDatiNuoviRitiri"); verificaDatiNuoviRitiri .setImplementation(EmptyVerificaDatiNuoviRitiri.class.getName()); repositoryService.deleteDeployment(deployment.getId()); deployment = repositoryService.createDeployment() .addBpmnModel("dynamic-model.bpmn", importaNuoviRitiriModel) .deploy(); runtimeService.startProcessInstanceByKey("importaNuoviRitiri"); // VERIFICO L'ESECUZIONE DEL RECUPERO DATI NUOVI RITIRI List<HistoricActivityInstance> recuperoDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("recuperoDatiNuoviRitiri").list(); assertEquals(recuperoDatiNuoviRitiriHistory.size(), 1); // VERIFICO L'ESECUZIONE DELLA VERIFICA DATI NUOVI RITIRI List<HistoricActivityInstance> verificaDatiNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("verificaDatiNuoviRitiri").list(); assertEquals(verificaDatiNuoviRitiriHistory.size(), 1); // VERIFICO L'ESECUZIONE DELL'AGGIORNAMENTO NUOVI RITIRI List<HistoricActivityInstance> aggiornamentoNuoviRitiriHistory = historyService .createHistoricActivityInstanceQuery() .activityId("aggiornamentoNuoviRitiri").list(); assertEquals(aggiornamentoNuoviRitiriHistory.size(), 1); // VERIFICO CHE LE EMAIL DI ERRORE DI NUOVI RITIRI NON CORRETTI NON SONO // STATE // MANDATE List<HistoricActivityInstance> sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti = historyService .createHistoricActivityInstanceQuery() .activityId( "sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti") .list(); assertEquals( sollecitoAOperatoreLogisticoPerDatiNuoviRitiriNonCorretti .size(), 0); // VERIFICO CHE LE EMAIL DI ERRORE DI AGGIORNAMENTO NUOVI RITIRI // SONO STATE // MANDATE List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAAmministratore .size(), 1); List<HistoricActivityInstance> segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico = historyService .createHistoricActivityInstanceQuery() .activityId( "segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico") .list(); assertEquals( segnalazioneErroreAggiornamentoNuoviRitiriAOperatoreLogistico .size(), 1); // RIPULISCO IL DB greenareaDemoData.deleteAllIdentities(identityService); greenareaDemoData.deleteAllHistories(historyService); greenareaDemoData.deleteAllIDeployments(repositoryService); // FERMO IL SERVER DI POSTA smtpServer.stop(); } }
8d9487f5d4ed1c58afad212036834e48dc6517c6
db97ce70bd53e5c258ecda4c34a5ec641e12d488
/src/main/java/com/alipay/api/domain/CloudbusSubmitPredictItem.java
0d947a9099ef37684e97bbc2d8a592981be5f8ee
[ "Apache-2.0" ]
permissive
smitzhang/alipay-sdk-java-all
dccc7493c03b3c937f93e7e2be750619f9bed068
a835a9c91e800e7c9350d479e84f9a74b211f0c4
refs/heads/master
2022-11-23T20:32:27.041116
2020-08-03T13:03:02
2020-08-03T13:03:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
796
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 客流预测结果 * * @author auto create * @since 1.0, 2019-08-22 10:27:56 */ public class CloudbusSubmitPredictItem extends AlipayObject { private static final long serialVersionUID = 7511149657444567129L; /** * 处理过程状态描述 */ @ApiField("message") private String message; /** * 任务计划 */ @ApiField("plan_id") private String planId; public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public String getPlanId() { return this.planId; } public void setPlanId(String planId) { this.planId = planId; } }
9c924adac80732738468f17623b518d695c4efe3
e53e995bdd36f4882a8aa56a564f71d04f982fe5
/SystemDesignAssignment/app/src/main/java/com/week8/movie/movieweek8/fragments/MovieDetailsFragment.java
bda709746b3e2bf8decdd63c701b7f9a73dc546e
[ "Apache-2.0" ]
permissive
anushreeag/InterviewPrep
90309bad02a02c140494e0bf1e5650a702fa6490
77d691a50bc9fa693b6178fb1270bb68cc92d326
refs/heads/master
2021-09-07T09:33:37.156951
2018-02-21T00:39:11
2018-02-21T00:39:11
111,050,047
1
1
null
null
null
null
UTF-8
Java
false
false
2,756
java
package com.week8.movie.movieweek8.fragments; import android.support.v4.app.DialogFragment; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RatingBar; import android.widget.TextView; import com.google.android.youtube.player.YouTubeInitializationResult; import com.google.android.youtube.player.YouTubePlayer; import com.google.android.youtube.player.YouTubePlayerSupportFragment; import com.squareup.picasso.Picasso; import com.week8.movie.movieweek8.R; import com.week8.movie.movieweek8.activities.MovieActivity; import com.week8.movie.movieweek8.model.MovieModel; /** * Created by anushree on 2/12/2018. */ public class MovieDetailsFragment extends DialogFragment { TextView title; YouTubePlayerSupportFragment youtubeFragment; RatingBar rating; MovieModel movie; Context ctx; public static final String API_KEY = "AIzaSyBFGWJED0kpO6ncvxhcagLa21yiksUeiHw"; public MovieDetailsFragment(){ } @Override public void onAttach(Context context) { super.onAttach(context); ctx = context; } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.details_layout,null,false); title = view.findViewById(R.id.title); movie = (MovieModel) getArguments().getParcelable("Movie"); rating = view.findViewById(R.id.rating); youtubeFragment = YouTubePlayerSupportFragment.newInstance(); FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); transaction.replace(R.id.youtubeContent,youtubeFragment).commit(); youtubeFragment.initialize(API_KEY, new YouTubePlayer.OnInitializedListener() { @Override public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) { youTubePlayer.cueVideo(MovieActivity.videosMap.get(movie.getId())); } @Override public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) { } }); title.setText(movie.getTitle()); rating.setRating((movie.getVote_average()/2)); return view; } }
ed3c77f1af16626ad35c7742e44719e7167f1520
235565426c0e2caed5316cb39bd09eda135aec4a
/forum/src/main/java/br/com/alura/forum/config/validation/ErrorHandlingValidation.java
7720ee4a0db46c471902f94cf0f3e7579eeed763
[]
no_license
horion/spring-rest-api
e3bbd4393d9f41999ec0de6b414603e7c4cd391c
b62b015a270466c8e4f706215f42d8078e7e3039
refs/heads/master
2022-11-10T13:59:00.967297
2020-06-28T22:17:23
2020-06-28T22:17:23
275,677,288
0
0
null
null
null
null
UTF-8
Java
false
false
1,381
java
package br.com.alura.forum.config.validation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.http.HttpStatus; import org.springframework.validation.FieldError; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @RestControllerAdvice public class ErrorHandlingValidation { private final MessageSource messageSource; public ErrorHandlingValidation(MessageSource messageSource) { this.messageSource = messageSource; } @ResponseStatus(code = HttpStatus.BAD_REQUEST) @ExceptionHandler(MethodArgumentNotValidException.class) public List<ErrorFormDto> handle(MethodArgumentNotValidException e){ List<FieldError> fieldErrors = e.getBindingResult().getFieldErrors(); return fieldErrors.stream().map(fieldError -> new ErrorFormDto(fieldError.getField(),messageSource.getMessage(fieldError, LocaleContextHolder.getLocale()))).collect(Collectors.toList()); } }
2a300b854319c36bfa5a4b6103b34e8c254fe696
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/ModifyAquaConfigurationResult.java
de90fe6c361715455b18a92545e4746634202465
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
4,103
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.redshift.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyAquaConfiguration" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ModifyAquaConfigurationResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * The updated AQUA configuration of the cluster. * </p> */ private AquaConfiguration aquaConfiguration; /** * <p> * The updated AQUA configuration of the cluster. * </p> * * @param aquaConfiguration * The updated AQUA configuration of the cluster. */ public void setAquaConfiguration(AquaConfiguration aquaConfiguration) { this.aquaConfiguration = aquaConfiguration; } /** * <p> * The updated AQUA configuration of the cluster. * </p> * * @return The updated AQUA configuration of the cluster. */ public AquaConfiguration getAquaConfiguration() { return this.aquaConfiguration; } /** * <p> * The updated AQUA configuration of the cluster. * </p> * * @param aquaConfiguration * The updated AQUA configuration of the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyAquaConfigurationResult withAquaConfiguration(AquaConfiguration aquaConfiguration) { setAquaConfiguration(aquaConfiguration); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAquaConfiguration() != null) sb.append("AquaConfiguration: ").append(getAquaConfiguration()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModifyAquaConfigurationResult == false) return false; ModifyAquaConfigurationResult other = (ModifyAquaConfigurationResult) obj; if (other.getAquaConfiguration() == null ^ this.getAquaConfiguration() == null) return false; if (other.getAquaConfiguration() != null && other.getAquaConfiguration().equals(this.getAquaConfiguration()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAquaConfiguration() == null) ? 0 : getAquaConfiguration().hashCode()); return hashCode; } @Override public ModifyAquaConfigurationResult clone() { try { return (ModifyAquaConfigurationResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
ab07562b77369be1f2135dab9b98674a7e621408
e780417b3f4a00fa304eb696fcb37b8923f613ae
/core/src/main/java/com/cwd/tg/gss/data/events/EventType.java
ff4c00755340f49263c4b6b262e8979ff8808ecd
[]
no_license
lyoumi/crossworld
a7e2aa0902d8132e5e1c8f2abd1dde949c6c4337
56bbb8d41c526244d6448ab9b693bdab191f688f
refs/heads/master
2020-04-23T23:44:48.965477
2019-10-17T09:07:56
2019-10-17T09:07:56
171,545,238
1
0
null
2019-10-17T09:07:59
2019-02-19T20:33:24
Java
UTF-8
Java
false
false
99
java
package com.cwd.tg.gss.data.events; public enum EventType { BATTLE, ADVENTURE, REGENERATION }
1a06e0b72583a117ff5d3f71fcbda83051c15a0f
48da6a3558c43424e69f937d75239b864be41bb4
/Algorithm/src/baek10273/Main.java
de94c5740e659a97df55f86c8ad33eeaa4cd4884
[]
no_license
Kim-minjae/AlgorithmPractice.eclipse
63549301e561378d21331ce2daa2d527b80de2ff
2d62377edb22ad237046ca79011baa6049de157f
refs/heads/master
2021-07-14T10:19:49.474604
2017-10-19T08:51:38
2017-10-19T08:51:38
106,066,659
0
0
null
null
null
null
UTF-8
Java
false
false
3,564
java
package baek10273; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main { private static ArrayList<Edge>[] child; private static ArrayList<Integer>[] parents; private static int[] cave; private static Cave[] dp; private static int degree[]; public static void main(String args[])throws IOException, CloneNotSupportedException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc = Integer.parseInt(br.readLine()); for(int t = 0; t<tc; t++){ StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int e = Integer.parseInt(st.nextToken()); child = new ArrayList[n+1]; parents = new ArrayList[n+1]; for(int i = 0; i<n+1; i++){ child[i] = new ArrayList<>(); parents[i] = new ArrayList<>(); } st = new StringTokenizer(br.readLine()); cave = new int[n+1]; degree = new int[n+1]; for(int i = 1;i<n+1;i++){ cave[i] = Integer.parseInt(st.nextToken()); } for(int i = 0; i<e; i++){ st = new StringTokenizer(br.readLine()); int from = Integer.parseInt(st.nextToken()); int to = Integer.parseInt(st.nextToken()); int cost = Integer.parseInt(st.nextToken()); child[from].add(new Edge(to,cost)); parents[to].add(from); degree[from]++; } dp = new Cave[n+1]; /*Queue<Integer> readyQ = new LinkedList<>(); for(int i =1; i<n+1;i++) { if(degree[i] == 0) readyQ.offer(i); } while(!readyQ.isEmpty()) { int tmp = readyQ.poll(); degree[tmp]--; dfs(tmp); for(int x : parents[tmp]) { degree[x]--; if(degree[x] == 0) readyQ.offer(x); } }*/ Cave resultCave = dfs(1); System.out.println(resultCave.cost + " " + resultCave.order.size()); for(int i = resultCave.order.size()-1; i>=0; i--){ System.out.print(resultCave.order.get(i)+ " "); } System.out.println(); } } public static Cave dfs(int vertex) throws CloneNotSupportedException{ if(dp[vertex] != null) return (Cave)dp[vertex].clone(); ArrayList tmpArray = new ArrayList<>(); // tmpArray.add(vertex); ArrayList<Cave> caves = new ArrayList<>(); caves.add(new Cave(vertex,cave[vertex],tmpArray)); for(Edge x : child[vertex]){ Cave tmpCave = dfs(x.to); tmpCave.cost += cave[vertex] - x.cost; caves.add((Cave)tmpCave.clone()); } Cave tmpCave = Collections.max(caves); tmpCave.order.add(vertex); return dp[vertex] = tmpCave; } static class Cave implements Comparable<Cave>,Cloneable{ int vertex; int cost; ArrayList<Integer> order; public Cave(int vertex, int cost, ArrayList<Integer> order) { super(); this.vertex = vertex; this.cost = cost; this.order = order; } @Override public int compareTo(Cave o) { // TODO Auto-generated method stub return this.cost - o.cost; } @Override protected Object clone() throws CloneNotSupportedException { // TODO Auto-generated method stub Cave clone = (Cave)super.clone(); clone.cost = this.cost; clone.vertex = this.vertex; clone.order = (ArrayList<Integer>)this.order.clone(); return clone; } } static class Edge{ int to; int cost; public Edge(int to, int cost) { super(); this.to = to; this.cost = cost; } } }
b72421e7f2a7b85e556b2e59efd085509c9daad0
d6a5608fb7fb49f5729a9ffe23a1773a9ab57bd8
/src/main/java/br/cefetrj/sagitarii/persistence/entity/Domain.java
81ed26c5a201cc2e46f11c75c4856874553f132a
[ "Apache-2.0" ]
permissive
icemagno/sagitarii
ce47ceae436268eea19a5f9f33873f0e7a668497
2047d2e6a38811d18ad7d166a768f7cf9c10841a
refs/heads/master
2021-01-18T23:53:58.100539
2017-01-06T12:55:47
2017-01-06T12:55:47
22,073,161
0
0
null
null
null
null
UTF-8
Java
false
false
1,602
java
package br.cefetrj.sagitarii.persistence.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; @Entity @Table(name="domains") public class Domain { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id_domain") private int idDomain; @ManyToOne @JoinColumn(name="id_table") @Fetch(FetchMode.JOIN) private Relation table; @Column(length=250) private String domainName; @Transient public String getColumnName() { if ( domainName == null || domainName.equals("") ) return null; String[] spt = domainName.split("\\."); if ( spt.length == 2 ) return spt[1]; return ""; } @Transient public String getTableName() { if ( domainName == null || domainName.equals("") ) return null; String[] spt = domainName.split("."); return spt[0]; } public int getIdDomain() { return idDomain; } public void setIdDomain(int idDomain) { this.idDomain = idDomain; } public Relation getTable() { return table; } public void setTable(Relation table) { this.table = table; } public String getDomainName() { return domainName; } public void setDomainName(String domainName) { this.domainName = domainName; } }
c1f401f02ca5097b76e5dd5f2f5c8416a8baae81
cf7408c3c4f59d616c99cc80f10c9c71bc7c4dcf
/src/main/java/valera/shared/SendMailService.java
9627e50a1d7fc03a2f4d1897bfa749b651d9e908
[]
no_license
doggvalera/ProjectVGMAIL
39986778834c50c9b60fa599903a7eb2513dba87
798e73256c740250d44e3d176523633d3339fcdd
refs/heads/master
2016-09-05T10:47:22.986647
2014-01-09T19:27:59
2014-01-09T19:27:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package valera.shared; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; import com.google.gwt.user.server.rpc.XsrfProtect; import valera.shared.model.CreateMail; /** * Created by valerijszemlanikins on 05.01.14. */ @RemoteServiceRelativePath("sendmailservice") @XsrfProtect public interface SendMailService extends RemoteService { public boolean sendMail(CreateMail mail); public String sendMailAuthor(); }
24c1f1d7a4c7f40896ce30f5e9745878b8f5d9b9
93b756154204812415c6dfa04bd24ce5c2854d95
/src/main/java/App/subversion.java
9997e404b261904887616312afafaf080381d010
[]
no_license
fothdr/Nikitin
fc687376c7c32ebe016b5582b33c6579e0e5773d
4418763ae36b6d46908d7139e81531a249becf40
refs/heads/master
2023-03-18T13:03:57.600908
2021-03-13T06:58:35
2021-03-13T06:58:35
342,820,163
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
4,523
java
package App; //пакет Java классов import java.awt.event.ActionListener; //библиотека для события слушателя import javax.swing.*; // Библиотека для GUI (построена на основе awt) public class subversion { public static JPanel main_panel = new JPanel(); public static JFrame main_GUI = new JFrame("subversion"); public static JComboBox changeBox; public static JTextField textSideA; public static JTextField textSideB; public static JTextField textHeight; public static String ourinfo = "Никитин А.В (19130152) | Шарипов И.Р.(19130615) 13.03.2021 | Чернышков А.А.(19130340) | Рахман Л.А(191306371)13.03.2021"; public subversion() { main_GUI.setTitle ("Using subversion for developers"); main_GUI.setBounds(500,400,400,500); main_GUI.setResizable(false); // фиксированный размер окна main_panel.setLayout(null); main_GUI.add(main_panel); JLabel laba_info = new JLabel("Лабораторная работа №4"); // Отображение текста или изображения laba_info.setBounds(120,0,150,30); JLabel name_group = new JLabel("Прикладная информатика"); name_group.setBounds(115,0,160,250); main_panel.add(laba_info); main_panel.add(name_group); JLabel sideA = new JLabel("Сторона a"); JLabel sideB = new JLabel("Сторона b"); JLabel height = new JLabel("Высота"); sideA.setBounds(30,260,60,20); sideB.setBounds(30,295,60,20); height.setBounds(30,330,60,20); main_panel.add(sideA); main_panel.add(sideB); main_panel.add(height); textSideA = new JTextField(); textSideB = new JTextField(); textHeight = new JTextField(); textSideA.setBounds(100, 260, 60, 20); textSideB.setBounds(100, 295, 60, 20); textHeight.setBounds(100, 330, 60, 20); main_panel.add(textSideA); main_panel.add(textSideB); main_panel.add(textHeight); JButton button_result = new JButton("Посчитать"); button_result.setBounds(30,380,150,40); ActionListener resultListener = new ResultListener(); button_result.addActionListener(resultListener); main_panel.add(button_result); JButton button_exit = new JButton("Выход"); // добавляем кнопку button_exit.setBounds(270,200,100,40); ActionListener actionListener = new ListenerButton(); //создаем слушатель button_exit.addActionListener(actionListener); // добавляем слушатель к кнопке main_panel.add(button_exit); JButton button_info = new JButton("Информация"); button_info.setBounds(30,200,150,40); ActionListener infoListener = new ListenerInfo(); button_info.addActionListener(infoListener); main_panel.add(button_info); JMenu mainMenu = new JMenu("Главная"); JMenuBar menuBar = new JMenuBar(); JMenuItem menuItem1 = new JMenuItem("Отобразить логотип УГАТУ"); JMenuItem menuItem2 = new JMenuItem("Загрузить файл в проект11"); JMenuItem menuItem3 = new JMenuItem("Выход"); menuItem1.addActionListener(new PictureListener()); menuItem2.addActionListener(new UploadListener()); menuItem3.addActionListener(new ListenerButton()); mainMenu.add(menuItem1); mainMenu.add(menuItem2); mainMenu.add(menuItem3); menuBar.add(mainMenu); main_GUI.setJMenuBar(menuBar); String[] transfer = {"Переместить логотип в правый верхний угол", "Переместить логотип в середину", "Переместить логотип в левый верхний угол", "Создать массив","Отсортировать массив в проекте11"}; changeBox = new JComboBox(transfer); changeBox.setBounds(30,140,350,30); changeBox.addActionListener(new ChangeComboBoxListener()); main_panel.add(changeBox); changeBox.setEnabled(true); main_GUI.setVisible(true); main_GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // закрытие окна JFrame и процесса Java } public static void main(String[] args) { // интересные заметки: http://www.mstu.edu.ru/study/materials/java/ subversion student= new subversion(); } }
7e3c1f726f4325f84275ffa29487539fe43b526f
e7b2d041ab19cbdd06fe33cf372e416f178f65af
/src/test.java
bd9e9b8e887a8707878320e67bc275262c05ef44
[]
no_license
kittingwong/BankingSystem
002e85cba317d077079c69683ced38969bdc4603
0c2083a1487c52f62001963034da2da45ae61195
refs/heads/master
2021-01-10T08:25:12.276664
2015-05-23T15:01:19
2015-05-23T15:01:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
import java.sql.Connection; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import javax.swing.text.html.HTMLDocument.Iterator; import db_vo.Account_currency; import db_vo.Accounts; import db_vo.Deposits; import db_vo.Transfer; import db_vo.Users; import service.AccountCurrencyService; import service.AccountCurrencyServiceImpl; import service.AccountsService; import service.AccountsServiceImpl; import service.DepositsService; import service.DepositsServiceImpl; import service.MD5; import service.TransferService; import service.TransferServiceImpl; import service.UsersServiceImpl; import service.WithdrawsService; import service.WithdrawsServiceImpl; public class test { public static void main(String[] args) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // df.format(new Date()); // WithdrawsService wds=new WithdrawsServiceImpl(); // Deposits dep=new Deposits(); // dep.setA_id("1"); // dep.setAmount(1000); // dep.setCurrency("CNY"); // dep.setDeposit_time("2015-05-05 17:26:03"); // dep.setInterest(0.78); // dep.setPeriod("6 months"); // dep.setStatement("deposit"); // dep.setType("time"); // //System.out.println(wds.TimeDepositWithdraw(dep)) // //System.out.println(wds.CurrentDepositWithdraw("2", "CNY", 200)); // wds.CheckWithdrawRecordByAid("2"); TransferService trans=new TransferServiceImpl(); Transfer tran=new Transfer(); tran.setA_id_in("2"); tran.setA_id_out("3"); tran.setAmount(100); tran.setCurrency("CNY"); tran.setTransfer_time(df.format(new Date())); tran.setMemo("huaiqian"); System.out.println(trans.transfer(tran)); } }
0615fb46f2b9bc0067cb24a58e1ae0cf576e9a68
0612977b10e37bb376b68c74f5d7b33a3975ff51
/src/main/java/com/comicbook/config/MetricsConfiguration.java
5502c4b0ca4d8bf07834d83b3230de3bb6b215b6
[]
no_license
michaelboyd/comic-book
e3ea0025da59639e74fada2267de063f54834b80
981c9641494f5ad449ae2934e48ba6fff3e212aa
refs/heads/master
2021-01-17T15:48:57.135415
2016-11-01T15:30:51
2016-11-01T15:30:51
69,827,061
0
1
null
2020-09-18T10:27:05
2016-10-02T23:01:33
Java
UTF-8
Java
false
false
6,044
java
package com.comicbook.config; import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Slf4jReporter; import com.codahale.metrics.graphite.Graphite; import com.codahale.metrics.graphite.GraphiteReporter; import com.codahale.metrics.health.HealthCheckRegistry; import com.codahale.metrics.jvm.*; import com.ryantenney.metrics.spring.config.annotation.EnableMetrics; import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter; import com.zaxxer.hikari.HikariDataSource; import fr.ippon.spark.metrics.SparkReporter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.*; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.lang.management.ManagementFactory; import java.net.InetSocketAddress; import java.util.concurrent.TimeUnit; @Configuration @EnableMetrics(proxyTargetClass = true) public class MetricsConfiguration extends MetricsConfigurerAdapter { private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory"; private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage"; private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads"; private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files"; private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers"; private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class); private MetricRegistry metricRegistry = new MetricRegistry(); private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry(); @Inject private JHipsterProperties jHipsterProperties; @Autowired(required = false) private HikariDataSource hikariDataSource; @Override @Bean public MetricRegistry getMetricRegistry() { return metricRegistry; } @Override @Bean public HealthCheckRegistry getHealthCheckRegistry() { return healthCheckRegistry; } @PostConstruct public void init() { log.debug("Registering JVM gauges"); metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge()); metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); if (hikariDataSource != null) { log.debug("Monitoring the datasource"); hikariDataSource.setMetricRegistry(metricRegistry); } if (jHipsterProperties.getMetrics().getJmx().isEnabled()) { log.debug("Initializing Metrics JMX reporting"); JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build(); jmxReporter.start(); } if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { log.info("Initializing Metrics Log reporting"); final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry) .outputTo(LoggerFactory.getLogger("metrics")) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS); } } @Configuration @ConditionalOnClass(Graphite.class) public static class GraphiteRegistry { private final Logger log = LoggerFactory.getLogger(GraphiteRegistry.class); @Inject private MetricRegistry metricRegistry; @Inject private JHipsterProperties jHipsterProperties; @PostConstruct private void init() { if (jHipsterProperties.getMetrics().getGraphite().isEnabled()) { log.info("Initializing Metrics Graphite reporting"); String graphiteHost = jHipsterProperties.getMetrics().getGraphite().getHost(); Integer graphitePort = jHipsterProperties.getMetrics().getGraphite().getPort(); String graphitePrefix = jHipsterProperties.getMetrics().getGraphite().getPrefix(); Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, graphitePort)); GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .prefixedWith(graphitePrefix) .build(graphite); graphiteReporter.start(1, TimeUnit.MINUTES); } } } @Configuration @ConditionalOnClass(SparkReporter.class) public static class SparkRegistry { private final Logger log = LoggerFactory.getLogger(SparkRegistry.class); @Inject private MetricRegistry metricRegistry; @Inject private JHipsterProperties jHipsterProperties; @PostConstruct private void init() { if (jHipsterProperties.getMetrics().getSpark().isEnabled()) { log.info("Initializing Metrics Spark reporting"); String sparkHost = jHipsterProperties.getMetrics().getSpark().getHost(); Integer sparkPort = jHipsterProperties.getMetrics().getSpark().getPort(); SparkReporter sparkReporter = SparkReporter.forRegistry(metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(sparkHost, sparkPort); sparkReporter.start(1, TimeUnit.MINUTES); } } } }
7ad2f7affa6b434500815b72e2d3bc2ff82207fa
d34ce61249c33f93874e4657633ad6b23809282b
/Spring Boot and JPA 1 - Web Application Developement/jpashop/src/main/java/jpabook/jpashop/domain/Category.java
45c348c9830fe6d1b6a4cc1ebaeb8fa052110021
[]
no_license
SuyeonChoi/TIL
07aa36eee739d52ea71ddf19c238c4c4f37cf87c
430d66aa3aedda36b1998a7593cdcc451391cfcf
refs/heads/master
2023-07-16T20:56:26.776462
2021-08-10T16:21:53
2021-08-10T16:21:53
286,508,508
0
0
null
2021-04-10T08:17:33
2020-08-10T15:13:47
Jupyter Notebook
UTF-8
Java
false
false
977
java
package jpabook.jpashop.domain; import jpabook.jpashop.domain.item.Item; import lombok.Getter; import lombok.Setter; import javax.persistence.*; import java.util.ArrayList; import java.util.List; import static javax.persistence.FetchType.*; @Entity @Getter @Setter public class Category { @Id @GeneratedValue @Column(name = "category_id") private Long id; private String name; @ManyToMany @JoinTable(name = "category_item", joinColumns = @JoinColumn(name = "category_id"), inverseJoinColumns = @JoinColumn(name = "item_id")) private List<Item> items = new ArrayList<>(); @ManyToOne(fetch = LAZY) @JoinColumn(name = "parent_id") private Category parent; @OneToMany(mappedBy = "parent") private List<Category> child = new ArrayList<>(); //==연관관계 메소드==// public void addChildCategory(Category child) { this.child.add(child); child.setParent(this); } }
db4b85dcab796d83ae132ac32d483d587a23e66b
4c3ad7da0eed1bd2935d6715178dcaac4c422617
/src/main/java/com/jack/doormis/core/client/bo/ClientBo.java
e5fb794654d81cd407403d2f06c42153693c55a0
[]
no_license
zlxia0013/door-mis
0326d9582d87403cfe3d208311214e15a591506d
fc47b3aae6af8054deababd643f0baab898c0611
refs/heads/master
2021-01-21T05:09:46.685263
2017-03-09T15:17:24
2017-03-09T15:17:24
83,135,446
0
0
null
null
null
null
UTF-8
Java
false
false
3,961
java
package com.jack.doormis.core.client.bo; import com.jack.doormis.core.client.dao.ClientDao; import com.jack.doormis.core.client.dto.ClientMainPageParams; import com.jack.doormis.core.client.pojo.Client; import com.jack.doormis.core.user.pojo.User; import com.jack.doormis.util.StringUtil; import com.jack.doormis.util.exception.DoorMisException; import com.jack.doormis.util.exception.DoorMisRuntimeException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class ClientBo { @Autowired private ClientDao clientDao; public Client getById(Integer id) { return clientDao.getById(id); } public Client getByRealName(String realName) { return clientDao.getByRealName(realName); } public List<Client> search(Client client) { return clientDao.search(client); } public List<Client> searchMainList(ClientMainPageParams pageParams) { return clientDao.searchMainList(pageParams); } public Integer searchMainCount(ClientMainPageParams pageParams) { return clientDao.searchMainCount(pageParams); } public Long searchCnt(Client client) { return clientDao.searchCnt(client); } public void add(Client client) { validate(client, true); clientDao.add(client); } public void update(Client client) { validate(client, false); clientDao.update(client); } private void validate(Client client, boolean isAdd) { if (client == null) { throw new DoorMisRuntimeException("客户实体不能为空"); } if (StringUtil.isEmpty(client.getRealName())) { throw new DoorMisRuntimeException("姓名不能为空"); } else if (client.getRealName().length() > 15) { throw new DoorMisRuntimeException("姓名不能大于15位"); } if (StringUtil.isEmpty(client.getCode())) { throw new DoorMisRuntimeException("编号不能为空"); } else if (client.getCode().length() > 20) { throw new DoorMisRuntimeException("编号不能大于20位"); } if (StringUtil.isEmpty(client.getPhone())) { throw new DoorMisRuntimeException("电话不能为空"); } else if (client.getPhone().length() > 50) { throw new DoorMisRuntimeException("电话不能大于50位"); } if (StringUtil.isEmpty(client.getAddress())) { throw new DoorMisRuntimeException("地址不能为空"); } else if (client.getAddress().length() > 120) { throw new DoorMisRuntimeException("地址不能大于120位"); } if (!StringUtil.isEmpty(client.getWechat()) && client.getWechat().length() > 50) { throw new DoorMisRuntimeException("微信号不能大于50位"); } if (!StringUtil.isEmpty(client.getLogistics()) && client.getLogistics().length() > 50) { throw new DoorMisRuntimeException("货运部不能大于50位"); } if (!StringUtil.isEmpty(client.getRemark()) && client.getRemark().length() > 100) { throw new DoorMisRuntimeException("备注不能大于100位"); } ////////////////// Client client1 = getByRealName(client.getRealName()); if (isAdd) { if (client1 != null) { throw new DoorMisRuntimeException("客户姓名已存在,请重新输入"); } } else { if (client.getId() == null) { throw new DoorMisRuntimeException("客户id不能为空"); } if (client1!=null && client1.getId()!=client.getId().intValue()){ throw new DoorMisRuntimeException("客户姓名已存在,请重新输入"); } } } public void delete(Integer clientId) { clientDao.delete(clientId); } }
01d89bf4fec2676d7d507aef92b435f54de74c9d
ad3ee465bf618eaf0a7e38ea8e91761752ed2d21
/collectiondemo/src/map/ConvertListToSet.java
e64f476e7eccba0271f46e85650d27480f8f452d
[]
no_license
amankmaharjan/javacore
61d01b3044b8749e9f992a49941695701b66e233
693690488946298e292c1b3a2285c927162cb11c
refs/heads/master
2021-08-26T07:08:56.340938
2017-11-22T04:40:41
2017-11-22T04:40:41
108,642,267
0
3
null
null
null
null
UTF-8
Java
false
false
684
java
package map; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class ConvertListToSet { public static void main(String[] args) { System.out.println("List values ....."); List<String> list = new ArrayList<String>(); list.add("1"); list.add("2"); list.add("3"); list.add("4"); list.add("1"); for (String temp : list) { System.out.println(temp); } Set<String> set = new HashSet<String>(list); System.out.println("Set values ....."); for (String temp : set) { System.out.println(temp); } } }
18cd7c50fb5ffe8c2dd206cc881f90fc4d93795b
9e3397fa62c663add127d173519686af872d9f7b
/test/src/mockobj/servlet/javax/servlet/http/HttpServletRequest.java
2ec2617f1ff38f354858099b36feec3ce3501b7b
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
wxyzZ/javataint
d16eb9e04552b3e1c93c8d2c802a9495e9a2ab2c
afc0461358a692957baa534936d5e2aeddf2ce30
refs/heads/master
2021-05-26T22:24:20.306370
2012-01-16T20:03:01
2012-01-16T20:03:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,315
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package javax.servlet.http; import javax.servlet.ServletRequest; import java.util.Enumeration; /** * * Extends the {@link javax.servlet.ServletRequest} interface * to provide request information for HTTP servlets. * * <p>The servlet container creates an <code>HttpServletRequest</code> * object and passes it as an argument to the servlet's service * methods (<code>doGet</code>, <code>doPost</code>, etc). * * * @author Various * @version $Version$ * * */ public interface HttpServletRequest extends ServletRequest { public String getContextPath(); public String getContextPathSafe(); public String getHeader(String name); public String getHeaderSafe(String name); public Enumeration getHeaders(String name); public Enumeration getHeadersSafe(String name); public Enumeration getHeaderNames(); public Enumeration getHeaderNamesSafe(); public String getPathInfo(); public String getPathInfoSafe(); public String getPathTranslated(); public String getQueryString(); public String getQueryStringSafe(); public String getRemoteUser(); public String getRemoteUserSafe(); public String getRequestedSessionId(); public String getRequestedSessionIdSafe(); public String getRequestURI(); public String getRequestURISafe(); public StringBuffer getRequestURL(); public StringBuffer getRequestURLSafe(); public String getServletPath(); public String getServletPathSafe(); }
d0fdede39fe351655d0dcc043e9825ee6b477f97
ce7df68f103bc442ab79c47756819e33c9e941d1
/presentation/src/main/java/com/paddyzab/booksexplorer/common/AppComponent.java
ac64df8eea8fc3e6423135e9f2caf1403f2da087
[]
no_license
paddyzab/BooksExplorer
987a6779db522a9b2d2cfd44e68ac552ef392294
e12898db00e9897528f6bced4af9fe4baa2909ad
refs/heads/master
2021-01-21T02:36:57.864057
2018-03-12T20:35:21
2018-03-12T20:35:21
54,453,351
1
0
null
null
null
null
UTF-8
Java
false
false
581
java
package com.paddyzab.booksexplorer.common; import com.paddyzab.booksexplorer.booksDetails.di.BookDetailsComponent; import com.paddyzab.booksexplorer.booksDetails.di.BookDetailsModule; import com.paddyzab.booksexplorer.booksList.di.BooksListComponent; import com.paddyzab.booksexplorer.booksList.di.BooksListModule; import javax.inject.Singleton; import dagger.Component; @Singleton @Component( modules = AppModule.class ) public interface AppComponent { BookDetailsComponent plus(BookDetailsModule module); BooksListComponent plus(BooksListModule module); }
a3e034796d2613c12c33a05a83b5f87bc8cba0a9
4a18b0d8fc07c5632c1cf2bb8c6348a7e6b99cbe
/src/main/java/com/cloudwise/syslog4j/handler/SyslogServerhandler.java
6e872926c561712a523d08bd02d7854ce3f1baf1
[]
no_license
liyg1011/syslog
18b8540c03012b83fe77d9662a5c7ac280e1e4ac
61a68e267cca0ab370d94984a497407dede98ed4
refs/heads/master
2023-06-26T13:11:55.536482
2021-07-26T06:36:56
2021-07-26T06:36:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.cloudwise.syslog4j.handler; import org.productivity.java.syslog4j.server.SyslogServerEventHandlerIF; import org.springframework.context.ApplicationContext; public interface SyslogServerhandler extends SyslogServerEventHandlerIF{ /** * init method * @param applicationContext */ default void init(ApplicationContext applicationContext){ } }
f48d183771cae874648d796f8e1543cfb7694556
533efe73aed32b765b81f9aaf9bfa21c56facb27
/BoardWeb/src/main/java/com/spring/biz/common/LogAdvice.java
c5c8d47e98f2528bfa3b060352fe91a8bbd26322
[]
no_license
Yoon-SangHyeok/Board-Project
19c6e5e6f521fa402189269ef9d34b56001e1a81
6b1ac15970e9653a314647cd99345139b640d715
refs/heads/master
2023-05-29T23:16:51.348562
2021-06-11T12:53:26
2021-06-11T12:53:26
362,042,323
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.spring.biz.common; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.springframework.stereotype.Service; @Service @Aspect // Aspect = PointCut + Advice public class LogAdvice { @Pointcut("execution(* com.spring.biz..*Impl.*(..))") public void allPointCut() {} // ����Ʈ�� // @Pointcut("execution(* com.spring.biz..*Impl.get*(..))") // public void getPointCut() {} @Before("allPointCut()") public void printLog(JoinPoint jp) { System.out.println("[공통 로그] 비즈니스 로직 수행 전 동작"); // �����̽� } }
595cd13d4e3db95294a6643af7a1788be75858fc
22008b065b22339b4b82c7f32f6dc94f782ce62d
/src/main/java/uk/co/markg/paperclip/listener/Listeners.java
374d43cbb8f2c34359c09da6dd3f10c668cb7ba0
[ "MIT" ]
permissive
itsHobbes/paperclip
70e0f8341f81d7791b3869852d72e85eb016baef
b6f435e244bf577ad8bbcdd0ab1064260ba6aa7c
refs/heads/master
2023-03-29T17:00:26.793415
2021-03-30T18:20:56
2021-03-30T18:20:56
342,859,799
1
0
null
null
null
null
UTF-8
Java
false
false
1,546
java
package uk.co.markg.paperclip.listener; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.reflections.Reflections; import org.reflections.ReflectionsException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.dv8tion.jda.api.hooks.ListenerAdapter; public class Listeners { private static final Logger logger = LoggerFactory.getLogger(Listeners.class); public static Object[] getListeners(String listenerPackage) { var reflections = new Reflections(listenerPackage); Set<Class<? extends ListenerAdapter>> classes = new HashSet<Class<? extends ListenerAdapter>>(); try { classes = reflections.getSubTypesOf(ListenerAdapter.class); } catch (ReflectionsException e) { logger.warn("Failed to find classes. Package may be invalid."); return new Object[0]; } ListenerAdapter[] listeners = new ListenerAdapter[classes.size()]; Iterator<Class<? extends ListenerAdapter>> itr = classes.iterator(); int i = 0; while (itr.hasNext()) { var obj = itr.next(); try { logger.info("Added {} Listener", obj.getName()); listeners[i] = (ListenerAdapter) Class.forName(obj.getName()) .getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { logger.error("Error", e); } i++; } return listeners; } }
3e49d17f4f1de8b78c9fe77e073f72a18f8d681e
f164e5db817cff2c7e1f7bf199d1f4a5bf6183dc
/src/main/java/br/org/catolicasc/controllers/CategoriaRestauranteController.java
b840efd617bd08aaa5e74f3b613dfec27d73466b
[]
no_license
thiagozils/pickmenu
5abd2166cd3f690279127b120543ff9cb55ff8bc
2cbce6842972a326735ad799f9f2104723d9749f
refs/heads/master
2020-03-20T16:57:05.638885
2019-10-01T19:20:28
2019-10-01T19:20:28
137,549,286
0
0
null
null
null
null
UTF-8
Java
false
false
3,165
java
package br.org.catolicasc.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import br.org.catolicasc.models.CategoriaRestaurante; import br.org.catolicasc.repository.CategoriaRestauranteRepository; @Controller public class CategoriaRestauranteController { @Autowired @Qualifier("categoriaRestauranteRepository") private CategoriaRestauranteRepository categoriaRestauranteRepository; @RequestMapping(value = "/cadastrarCategoriaRestaurante", method = RequestMethod.GET) public String form() { return "categoriaRestaurante/formCategoriaRestaurante"; } @RequestMapping("/categoriasRestaurantes") public ModelAndView index() { ModelAndView mv = new ModelAndView("categoriaRestaurante/index"); Iterable<CategoriaRestaurante> categoriasRestaurantes = categoriaRestauranteRepository.findAll(); mv.addObject("categoriasRestaurantes", categoriasRestaurantes); return mv; } @RequestMapping(value = "/editarCategoriaRestaurante", method = RequestMethod.GET) public ModelAndView editarCategoriaRestaurante(long codigo) { ModelAndView mv = new ModelAndView("categoriaRestaurante/formEditCategoriaRestaurante"); CategoriaRestaurante categoriaRestaurante = categoriaRestauranteRepository.findById(codigo); mv.addObject("categoriaRestaurante", categoriaRestaurante); return mv; } @RequestMapping(value = "/editarCategoriaRestaurante", method = RequestMethod.POST) public String editarCategoriaRestaurante(CategoriaRestaurante categoriaRestaurante) { CategoriaRestaurante findCategoriaRestaurante = categoriaRestauranteRepository.findById(categoriaRestaurante.getId()); findCategoriaRestaurante.setNome(categoriaRestaurante.getNome()); findCategoriaRestaurante.setDescricao(categoriaRestaurante.getDescricao()); categoriaRestauranteRepository.save(findCategoriaRestaurante); return "redirect:/categoriasRestaurantes"; } @RequestMapping(value = "/cadastrarCategoriaRestaurante", method = RequestMethod.POST) public String form(CategoriaRestaurante categoriaRestaurante) { System.out.println(categoriaRestaurante.getNome()+" TESTE"+categoriaRestaurante.getDescricao()+" "+categoriaRestaurante.getId()); categoriaRestauranteRepository.save(categoriaRestaurante); return "redirect:/categoriasRestaurantes"; } @RequestMapping("/deletarCategoriaRestaurante") public String deletarCategoriaRestaurante(long codigo){ CategoriaRestaurante categoriaRestaurante = categoriaRestauranteRepository.findById(codigo); categoriaRestauranteRepository.delete(categoriaRestaurante); return "redirect:/categoriasRestaurantes"; } public void setCategoriaRestauranteRepository(CategoriaRestauranteRepository categoriaRestauranteRepository) { this.categoriaRestauranteRepository = categoriaRestauranteRepository; } }
742cde16b0b49a62356bc13d011269333fb41386
5e3e9db8f7ee14bb9e47fd88711046819878e91c
/app/src/main/java/bcs/com/sendreceivebluetooth/MainActivity.java
55c4a231745d47ab4b734cefbe7a36979f69a9b2
[]
no_license
viswanathsingh04/BluetoothSEnderREceiver
98725208a8756b03290e938848cb1dec8b5073b3
2856480edb90d47ed5350e1fe1e41e5a9889bc22
refs/heads/master
2020-03-18T03:42:54.031273
2018-05-21T10:08:55
2018-05-21T10:08:55
134,252,188
0
0
null
null
null
null
UTF-8
Java
false
false
13,331
java
package bcs.com.sendreceivebluetooth; import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.UUID; public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private static final String TAG = "MainActivity"; BluetoothAdapter mBluetoothAdapter; Button btnEnableDisable_Discoverable; BluetoothConnectionService mBluetoothConnection; Button btnStartConnection; Button btnSend; EditText etSend; private static final UUID MY_UUID_INSECURE = UUID.fromString("8ce255c0-200a-11e0-ac64-0800200c9a66"); BluetoothDevice mBTDevice; public ArrayList<BluetoothDevice> mBTDevices = new ArrayList<>(); public DeviceListAdapter mDeviceListAdapter; ListView lvNewDevices; // Create a BroadcastReceiver for ACTION_FOUND private final BroadcastReceiver mBroadcastReceiver1 = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); // When discovery finds a device if (action.equals(mBluetoothAdapter.ACTION_STATE_CHANGED)) { final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, mBluetoothAdapter.ERROR); switch (state) { case BluetoothAdapter.STATE_OFF: Log.d(TAG, "onReceive: STATE OFF"); break; case BluetoothAdapter.STATE_TURNING_OFF: Log.d(TAG, "mBroadcastReceiver1: STATE TURNING OFF"); break; case BluetoothAdapter.STATE_ON: Log.d(TAG, "mBroadcastReceiver1: STATE ON"); break; case BluetoothAdapter.STATE_TURNING_ON: Log.d(TAG, "mBroadcastReceiver1: STATE TURNING ON"); break; } } } }; /** * Broadcast Receiver for changes made to bluetooth states such as: * 1) Discoverability mode on/off or expire. */ private final BroadcastReceiver mBroadcastReceiver2 = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED)) { int mode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.ERROR); switch (mode) { //Device is in Discoverable Mode case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: Log.d(TAG, "mBroadcastReceiver2: Discoverability Enabled."); break; //Device not in discoverable mode case BluetoothAdapter.SCAN_MODE_CONNECTABLE: Log.d(TAG, "mBroadcastReceiver2: Discoverability Disabled. Able to receive connections."); break; case BluetoothAdapter.SCAN_MODE_NONE: Log.d(TAG, "mBroadcastReceiver2: Discoverability Disabled. Not able to receive connections."); break; case BluetoothAdapter.STATE_CONNECTING: Log.d(TAG, "mBroadcastReceiver2: Connecting...."); break; case BluetoothAdapter.STATE_CONNECTED: Log.d(TAG, "mBroadcastReceiver2: Connected."); break; } } } }; /** * Broadcast Receiver for listing devices that are not yet paired * -Executed by btnDiscover() method. */ private BroadcastReceiver mBroadcastReceiver3 = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); Log.d(TAG, "onReceive: ACTION FOUND."); if (action.equals(BluetoothDevice.ACTION_FOUND)) { BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mBTDevices.add(device); Log.d(TAG, "onReceive: " + device.getName() + ": " + device.getAddress()); mDeviceListAdapter = new DeviceListAdapter(context, R.layout.device_adapter_view, mBTDevices); lvNewDevices.setAdapter(mDeviceListAdapter); } } }; /** * Broadcast Receiver that detects bond state changes (Pairing status changes) */ private final BroadcastReceiver mBroadcastReceiver4 = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) { BluetoothDevice mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); //3 cases: //case1: bonded already if (mDevice.getBondState() == BluetoothDevice.BOND_BONDED) { Log.d(TAG, "BroadcastReceiver: BOND_BONDED."); //inside BroadcastReceiver4 mBTDevice = mDevice; } //case2: creating a bone if (mDevice.getBondState() == BluetoothDevice.BOND_BONDING) { Log.d(TAG, "BroadcastReceiver: BOND_BONDING."); } //case3: breaking a bond if (mDevice.getBondState() == BluetoothDevice.BOND_NONE) { Log.d(TAG, "BroadcastReceiver: BOND_NONE."); } } } }; @Override protected void onDestroy() { Log.d(TAG, "onDestroy: called."); super.onDestroy(); unregisterReceiver(mBroadcastReceiver1); unregisterReceiver(mBroadcastReceiver2); unregisterReceiver(mBroadcastReceiver3); unregisterReceiver(mBroadcastReceiver4); //mBluetoothAdapter.cancelDiscovery(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnONOFF = (Button) findViewById(R.id.btnONOFF); btnEnableDisable_Discoverable = (Button) findViewById(R.id.btnDiscoverable_on_off); lvNewDevices = (ListView) findViewById(R.id.lvNewDevices); mBTDevices = new ArrayList<>(); btnStartConnection = (Button) findViewById(R.id.btnStartConnection); btnSend = (Button) findViewById(R.id.btnSend); etSend = (EditText) findViewById(R.id.editText); //Broadcasts when bond state changes (ie:pairing) IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED); registerReceiver(mBroadcastReceiver4, filter); mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); lvNewDevices.setOnItemClickListener(MainActivity.this); btnONOFF.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d(TAG, "onClick: enabling/disabling bluetooth."); enableDisableBT(); } }); btnStartConnection.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startConnection(); } }); btnSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { byte[] bytes = etSend.getText().toString().getBytes(Charset.defaultCharset()); mBluetoothConnection.write(bytes); } }); } //create method for starting connection //***remember the conncction will fail and app will crash if you haven't paired first public void startConnection() { startBTConnection(mBTDevice, MY_UUID_INSECURE); } /** * starting chat service method */ public void startBTConnection(BluetoothDevice device, UUID uuid) { Log.d(TAG, "startBTConnection: Initializing RFCOM Bluetooth Connection."); mBluetoothConnection.startClient(device, uuid); } public void enableDisableBT() { if (mBluetoothAdapter == null) { Log.d(TAG, "enableDisableBT: Does not have BT capabilities."); } if (!mBluetoothAdapter.isEnabled()) { Log.d(TAG, "enableDisableBT: enabling BT."); Intent enableBTIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivity(enableBTIntent); IntentFilter BTIntent = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED); registerReceiver(mBroadcastReceiver1, BTIntent); } if (mBluetoothAdapter.isEnabled()) { Log.d(TAG, "enableDisableBT: disabling BT."); mBluetoothAdapter.disable(); IntentFilter BTIntent = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED); registerReceiver(mBroadcastReceiver1, BTIntent); } } public void btnEnableDisable_Discoverable(View view) { Log.d(TAG, "btnEnableDisable_Discoverable: Making device discoverable for 300 seconds."); Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300); startActivity(discoverableIntent); IntentFilter intentFilter = new IntentFilter(mBluetoothAdapter.ACTION_SCAN_MODE_CHANGED); registerReceiver(mBroadcastReceiver2, intentFilter); } public void btnDiscover(View view) { Log.d(TAG, "btnDiscover: Looking for unpaired devices."); if (mBluetoothAdapter.isDiscovering()) { mBluetoothAdapter.cancelDiscovery(); Log.d(TAG, "btnDiscover: Canceling discovery."); //check BT permissions in manifest checkBTPermissions(); mBluetoothAdapter.startDiscovery(); IntentFilter discoverDevicesIntent = new IntentFilter(BluetoothDevice.ACTION_FOUND); registerReceiver(mBroadcastReceiver3, discoverDevicesIntent); } if (!mBluetoothAdapter.isDiscovering()) { //check BT permissions in manifest checkBTPermissions(); mBluetoothAdapter.startDiscovery(); IntentFilter discoverDevicesIntent = new IntentFilter(BluetoothDevice.ACTION_FOUND); registerReceiver(mBroadcastReceiver3, discoverDevicesIntent); } } /** * This method is required for all devices running API23+ * Android must programmatically check the permissions for bluetooth. Putting the proper permissions * in the manifest is not enough. * <p> * NOTE: This will only execute on versions > LOLLIPOP because it is not needed otherwise. */ @RequiresApi(api = Build.VERSION_CODES.M) private void checkBTPermissions() { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { int permissionCheck = this.checkSelfPermission("Manifest.permission.ACCESS_FINE_LOCATION"); permissionCheck += this.checkSelfPermission("Manifest.permission.ACCESS_COARSE_LOCATION"); if (permissionCheck != 0) { this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number } } else { Log.d(TAG, "checkBTPermissions: No need to check permissions. SDK version < LOLLIPOP."); } } @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { //first cancel discovery because its very memory intensive. mBluetoothAdapter.cancelDiscovery(); Log.d(TAG, "onItemClick: You Clicked on a device."); String deviceName = mBTDevices.get(i).getName(); String deviceAddress = mBTDevices.get(i).getAddress(); Log.d(TAG, "onItemClick: deviceName = " + deviceName); Log.d(TAG, "onItemClick: deviceAddress = " + deviceAddress); //create the bond. //NOTE: Requires API 17+? I think this is JellyBean if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) { Log.d(TAG, "Trying to pair with " + deviceName); mBTDevices.get(i).createBond(); mBTDevice = mBTDevices.get(i); mBluetoothConnection = new BluetoothConnectionService(MainActivity.this); } } }
8eb5833ac6939df5d8043717f16808a4e5bcadad
62d5e6ed12c64eebef93826c05317c56fbb42a1d
/app/src/main/java/com/londonsoftware/calisthenics/calisthenics/glutes_mobility.java
5538518be25d05d7dead7ac89966a3823a550d1e
[]
no_license
aasif1297/PPHProject
db9045dfea1c9e2406d98e72f189f078aa479af4
bfbfbde3a48f65f971885c0a2398b91d8be259b4
refs/heads/master
2020-05-09T14:46:21.795511
2019-04-13T20:10:42
2019-04-13T20:10:42
181,204,532
0
0
null
null
null
null
UTF-8
Java
false
false
3,170
java
package com.londonsoftware.calisthenics.calisthenics; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import com.google.android.youtube.player.YouTubeBaseActivity; import com.google.android.youtube.player.YouTubeInitializationResult; import com.google.android.youtube.player.YouTubePlayer; import com.google.android.youtube.player.YouTubePlayerView; public class glutes_mobility extends YouTubeBaseActivity { YouTubePlayerView youTubePlayerView; Button button; YouTubePlayer.OnInitializedListener onInitializedListener; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.glutes_mobility); button = findViewById(R.id.button_play_glutemobility); youTubePlayerView = findViewById(R.id.glutemobility_youtubePlay); //textView = findViewById(R.id.website); for making textviews open websites //textView.setMovementMethod(LinkMovementMethod.getInstance()); onInitializedListener = new YouTubePlayer.OnInitializedListener() { @Override public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) { youTubePlayer.loadVideo("Qby3ZsiidMY"); } @Override public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) { } }; button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { youTubePlayerView.initialize(YoutubeConfig.getApiKey(), onInitializedListener); } }); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); //This sets the back button on the toolbar of the tabbed page toolbar.setNavigationIcon(R.drawable.ic_backspace); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); } public void stretchinfo_glutes(View view) { Intent stretch_intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://yurielkaim.com/glute-stretches-tight-hips/")); startActivity(stretch_intent); } public void anatomyinfo_glutes(View view) { Intent anatomy_intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.yogajournal.com/teach/yoga-anatomy-get-to-know-your-glutes")); startActivity(anatomy_intent); } public void extravideos_glutes(View view) { Intent videos_intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=mJBOwaoVBFw")); startActivity(videos_intent); } } //public void browsermethod(View view) { //Intent brow_intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://google.com")); //startActivity(brow_intent); //}
ec02374de3144817a1731751b91bf890e47fbfcd
ad949485eee6ccfcbfaf11dfb2ec6ffc5fc919f3
/app/src/main/java/iweinzierl/github/com/moviedatabase/util/MovieTitleDescendingComparator.java
4b59edc4da67523d421aee6dfd1b0b3d5c537598
[]
no_license
iweinzierl/movie-database-android
e60e7b0eb6031e2d584149b056cfc47a02714018
a7b662a909bab475fba69d50ff386f0da45c7266
refs/heads/master
2021-01-10T10:28:03.534094
2016-01-02T19:23:44
2016-01-02T19:23:44
48,514,097
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package iweinzierl.github.com.moviedatabase.util; import java.util.Comparator; import iweinzierl.github.com.moviedatabase.rest.domain.Movie; public class MovieTitleDescendingComparator implements Comparator<Movie> { @Override public int compare(Movie one, Movie two) { return two.getTitle().compareTo(one.getTitle()); } }
ee57dc7289ca62c66d6b547e35d9ee9d944ef829
942ee5e8d54e8ebe9c5c841fbfdd1da652946944
/0001-0500/0307.Range Sum Query - Mutable.(BIT).java
3b2554697f63457838ea68aaaa7cc7238541e02a
[]
no_license
kaiwensun/leetcode
0129c174457f32887fbca078fb448adce46dd89d
6b607f4aae3a4603e61f2e2b7480fdfba1d9b947
refs/heads/master
2023-08-31T07:30:50.459062
2023-08-27T07:59:16
2023-08-27T07:59:16
57,526,914
69
9
null
2023-08-20T06:34:41
2016-05-01T05:37:29
Python
UTF-8
Java
false
false
1,633
java
/** *Basic idea: * Binary Index Tree (BIT). * For tutorial about BIT, see https://www.youtube.com/watch?v=CWDQJGaN1gY *Result: * 10 / 10 test cases passed. * Status: Accepted * Runtime: 8 ms * Your runtime beats 58.28% of java submissions. *Date: * 10/30/2016 */ public class NumArray { private int[] bit; private int[] nums; public NumArray(int[] nums) { this.nums = new int[nums.length]; bit = new int[nums.length+1]; for(int i=0;i<nums.length;i++){ update(i,nums[i]); } } void update(int i, int val) { if(i<0 || i>=nums.length) return; int add = val - nums[i]; nums[i] = val; i = i+1; while(i<bit.length){ bit[i]+=add; i = getNext(i); } } public int sumRange(int i, int j) { return getPrefix(j)-getPrefix(i-1); } private int getPrefix(int i){ //i is inclusive. if(i>=nums.length){ i = nums.length-1; } if(i<0){ return 0; } int sum = 0; i = i+1; while(i!=0){ sum+=bit[i]; i = getParent(i); } return sum; } private int getParent(int x){ return x-getLow(x); } private int getNext(int x){ return x+getLow(x); } private int getLow(int x){ return x & (-x); } } // Your NumArray object will be instantiated and called as such: // NumArray numArray = new NumArray(nums); // numArray.sumRange(0, 1); // numArray.update(1, 10); // numArray.sumRange(1, 2);
804d0c76f816bf3a410e4974cc67bbd4fb87234f
ee9ac61672de2f1a79b0e6de4e0933e495320beb
/JavaExercises/src/test/Factorial.java
6bc510e002f73dd39b5ec112318bac7ee2b7eaa3
[]
no_license
appleberries/JavaExercises
6c8c997dbb885baa575306a42a189215f3155475
c46b257eb8e416eb5542bd6b61f9b2e8b1312336
refs/heads/master
2020-07-13T01:42:17.596158
2019-10-31T17:27:02
2019-10-31T17:27:02
204,961,031
1
0
null
null
null
null
UTF-8
Java
false
false
472
java
package test; import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a number to calculate its factorial: "); System.out.println("Factorial: " + factorial(input.nextInt())); input.close(); } public static int factorial(int num) { int result = 1; for(int i = 1; i <= num; i++) { result *= i; } return result; } }
[ "Gilbert@gilbert" ]
Gilbert@gilbert
9b722229a78b667f4f77020b3021d461a293b31a
860998735282fb1322260e411fcca991f8715f72
/Project/HealthcareManagement/src/userinterface/Hospital/Clinic/ClinicAdminWorkAreaJPanel.java
ffdf4f329a2b22dbf79c20263f363485c73cb0a7
[]
no_license
yashkhopkar/Application-Engineering-Development-
2eea8a582bdf5170ead6a84bcc3c745f8894f2ab
d3420bc6f869b06173ccb8a2bc3f3f564e97f0cb
refs/heads/master
2021-09-22T11:34:25.902253
2018-09-09T23:01:11
2018-09-09T23:01:11
119,608,784
0
0
null
null
null
null
UTF-8
Java
false
false
6,990
java
/* * AdminWorkAreaJPanel.java * * Created on October 10, 2008, 8:50 AM */ package userinterface.Hospital.Clinic; import Business.EcoSystem; import userinterface.Hospital.*; import Business.Enterprise.Enterprise; import Business.Organization.ClinicOrganization; import Business.Organization.Organization; import Business.UserAccount.UserAccount; import java.awt.CardLayout; import javax.swing.JPanel; /** * * @author Yash */ public class ClinicAdminWorkAreaJPanel extends javax.swing.JPanel { JPanel userProcessContainer; UserAccount account; ClinicOrganization organization; Enterprise enterprise; EcoSystem business; /** Creates new form AdminWorkAreaJPanel */ public ClinicAdminWorkAreaJPanel(JPanel userProcessContainer, UserAccount account, ClinicOrganization organization, Enterprise enterprise, EcoSystem business) { initComponents(); this.userProcessContainer = userProcessContainer; this.enterprise = enterprise; this.account=account; this.business=business; this.organization= organization; valueLabel.setText(enterprise.getName()); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); userJButton = new javax.swing.JButton(); manageEmployeeJButton = new javax.swing.JButton(); enterpriseLabel = new javax.swing.JLabel(); valueLabel = new javax.swing.JLabel(); setBackground(new java.awt.Color(255, 255, 255)); jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N jLabel1.setText("Clinic Admin Work area"); userJButton.setBackground(new java.awt.Color(102, 217, 255)); userJButton.setText("Manage User Account"); userJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userJButtonActionPerformed(evt); } }); manageEmployeeJButton.setBackground(new java.awt.Color(102, 217, 255)); manageEmployeeJButton.setText("Manage Employee"); manageEmployeeJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { manageEmployeeJButtonActionPerformed(evt); } }); enterpriseLabel.setBackground(new java.awt.Color(102, 217, 255)); enterpriseLabel.setText("Enterprise :"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(80, 80, 80) .addComponent(enterpriseLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(valueLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(200, 200, 200) .addComponent(manageEmployeeJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(200, 200, 200) .addComponent(userJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(224, 224, 224) .addComponent(jLabel1))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(14, 14, 14) .addComponent(jLabel1) .addGap(57, 57, 57) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(enterpriseLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(valueLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addComponent(manageEmployeeJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(41, 41, 41) .addComponent(userJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents private void userJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userJButtonActionPerformed // TODO add your handling code here: ClinicManageUserAccountJPanel muajp = new ClinicManageUserAccountJPanel( userProcessContainer, account, organization, enterprise, business); userProcessContainer.add("ClinicManageUserAccountJPanel", muajp); CardLayout layout = (CardLayout) userProcessContainer.getLayout(); layout.next(userProcessContainer); }//GEN-LAST:event_userJButtonActionPerformed private void manageEmployeeJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageEmployeeJButtonActionPerformed ClinicManageEmployeeJPanel manageEmployeeJPanel = new ClinicManageEmployeeJPanel(userProcessContainer, account, organization, enterprise, business); userProcessContainer.add("ClinicManageEmployeeJPanel", manageEmployeeJPanel); CardLayout layout = (CardLayout) userProcessContainer.getLayout(); layout.next(userProcessContainer); }//GEN-LAST:event_manageEmployeeJButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel enterpriseLabel; private javax.swing.JLabel jLabel1; private javax.swing.JButton manageEmployeeJButton; private javax.swing.JButton userJButton; private javax.swing.JLabel valueLabel; // End of variables declaration//GEN-END:variables }
f01d029622ba583f9f01141447d7f04da7e0a23b
360290f09bf23e4b5991026032bca6a2f4e4718d
/src/main/java/su/kww/realttranslator/core/api/remote/ngs/services/id/responses/options/Params.java
47095ba63d4b58f716b3c980735a421f7fa7a19b
[]
no_license
aosivt/JRealtTranslator
097fdccbe5d134bbe3ab9122d5a70594ccb576f2
ed52905453d2d0a40824ce88a3db0f99e27572a5
refs/heads/master
2020-04-06T19:01:06.429436
2019-03-22T09:57:43
2019-03-22T09:57:43
157,722,203
0
0
null
2019-03-14T10:54:07
2018-11-15T14:13:19
Java
UTF-8
Java
false
false
10,878
java
package su.kww.realttranslator.core.api.remote.ngs.services.id.responses.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Params { @SerializedName("reference_point") @Expose private String referencePoint; @SerializedName("total_area") @Expose private Integer totalArea; @SerializedName("city") @Expose private City city; @SerializedName("ownership_type") @Expose private OwnershipType ownershipType; @SerializedName("loggia_count") @Expose private Integer loggiaCount; @SerializedName("description") @Expose private String description; @SerializedName("layout_type") @Expose private LayoutType layoutType; @SerializedName("balcony_count") @Expose private Integer balconyCount; @SerializedName("floors_count") @Expose private Integer floorsCount; @SerializedName("has_phone") @Expose private Object hasPhone; @SerializedName("house_number") @Expose private String houseNumber; @SerializedName("type") @Expose private Object type; @SerializedName("parking_type") @Expose private Object parkingType; @SerializedName("price_per_sqm") @Expose private Integer pricePerSqm; @SerializedName("is_exchange") @Expose private Boolean isExchange; @SerializedName("project_declaration") @Expose private String projectDeclaration; @SerializedName("price") @Expose private Integer price; @SerializedName("street") @Expose private Object street; @SerializedName("house_addresses") @Expose private Object houseAddresses; @SerializedName("house_type") @Expose private Object houseType; @SerializedName("floor") @Expose private Integer floor; @SerializedName("house_class") @Expose private Object houseClass; @SerializedName("is_deposit") @Expose private Boolean isDeposit; @SerializedName("released") @Expose private Boolean released; @SerializedName("is_haggle") @Expose private Object isHaggle; @SerializedName("area") @Expose private Area area; @SerializedName("microdistrict") @Expose private Object microdistrict; @SerializedName("rooms_count") @Expose private Integer roomsCount; @SerializedName("is_pawn") @Expose private Boolean isPawn; @SerializedName("condition_type") @Expose private ConditionType conditionType; @SerializedName("wc_type") @Expose private WcType wcType; @SerializedName("is_mortgage") @Expose private Boolean isMortgage; @SerializedName("kitchen_area") @Expose private Integer kitchenArea; @SerializedName("house_material_type") @Expose private Object houseMaterialType; @SerializedName("has_internet") @Expose private Object hasInternet; @SerializedName("release_date") @Expose private Object releaseDate; @SerializedName("metro") @Expose private Object metro; @SerializedName("is_net_sale") @Expose private Boolean isNetSale; @SerializedName("is_newbuilding") @Expose private Boolean isNewbuilding; @SerializedName("district") @Expose private Object district; @SerializedName("living_area") @Expose private Integer livingArea; @SerializedName("location") @Expose private Object location; @SerializedName("developer") @Expose private String developer; @SerializedName("region") @Expose private Region region; public String getReferencePoint() { return referencePoint; } public void setReferencePoint(String referencePoint) { this.referencePoint = referencePoint; } public Integer getTotalArea() { return totalArea; } public void setTotalArea(Integer totalArea) { this.totalArea = totalArea; } public City getCity() { return city; } public void setCity(City city) { this.city = city; } public OwnershipType getOwnershipType() { return ownershipType; } public void setOwnershipType(OwnershipType ownershipType) { this.ownershipType = ownershipType; } public Integer getLoggiaCount() { return loggiaCount; } public void setLoggiaCount(Integer loggiaCount) { this.loggiaCount = loggiaCount; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public LayoutType getLayoutType() { return layoutType; } public void setLayoutType(LayoutType layoutType) { this.layoutType = layoutType; } public Integer getBalconyCount() { return balconyCount; } public void setBalconyCount(Integer balconyCount) { this.balconyCount = balconyCount; } public Integer getFloorsCount() { return floorsCount; } public void setFloorsCount(Integer floorsCount) { this.floorsCount = floorsCount; } public Object getHasPhone() { return hasPhone; } public void setHasPhone(Object hasPhone) { this.hasPhone = hasPhone; } public String getHouseNumber() { return houseNumber; } public void setHouseNumber(String houseNumber) { this.houseNumber = houseNumber; } public Object getType() { return type; } public void setType(Object type) { this.type = type; } public Object getParkingType() { return parkingType; } public void setParkingType(Object parkingType) { this.parkingType = parkingType; } public Integer getPricePerSqm() { return pricePerSqm; } public void setPricePerSqm(Integer pricePerSqm) { this.pricePerSqm = pricePerSqm; } public Boolean getIsExchange() { return isExchange; } public void setIsExchange(Boolean isExchange) { this.isExchange = isExchange; } public String getProjectDeclaration() { return projectDeclaration; } public void setProjectDeclaration(String projectDeclaration) { this.projectDeclaration = projectDeclaration; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Object getStreet() { return street; } public void setStreet(Object street) { this.street = street; } public Object getHouseAddresses() { return houseAddresses; } public void setHouseAddresses(Object houseAddresses) { this.houseAddresses = houseAddresses; } public Object getHouseType() { return houseType; } public void setHouseType(Object houseType) { this.houseType = houseType; } public Integer getFloor() { return floor; } public void setFloor(Integer floor) { this.floor = floor; } public Object getHouseClass() { return houseClass; } public void setHouseClass(Object houseClass) { this.houseClass = houseClass; } public Boolean getIsDeposit() { return isDeposit; } public void setIsDeposit(Boolean isDeposit) { this.isDeposit = isDeposit; } public Boolean getReleased() { return released; } public void setReleased(Boolean released) { this.released = released; } public Object getIsHaggle() { return isHaggle; } public void setIsHaggle(Object isHaggle) { this.isHaggle = isHaggle; } public Area getArea() { return area; } public void setArea(Area area) { this.area = area; } public Object getMicrodistrict() { return microdistrict; } public void setMicrodistrict(Object microdistrict) { this.microdistrict = microdistrict; } public Integer getRoomsCount() { return roomsCount; } public void setRoomsCount(Integer roomsCount) { this.roomsCount = roomsCount; } public Boolean getIsPawn() { return isPawn; } public void setIsPawn(Boolean isPawn) { this.isPawn = isPawn; } public ConditionType getConditionType() { return conditionType; } public void setConditionType(ConditionType conditionType) { this.conditionType = conditionType; } public WcType getWcType() { return wcType; } public void setWcType(WcType wcType) { this.wcType = wcType; } public Boolean getIsMortgage() { return isMortgage; } public void setIsMortgage(Boolean isMortgage) { this.isMortgage = isMortgage; } public Integer getKitchenArea() { return kitchenArea; } public void setKitchenArea(Integer kitchenArea) { this.kitchenArea = kitchenArea; } public Object getHouseMaterialType() { return houseMaterialType; } public void setHouseMaterialType(Object houseMaterialType) { this.houseMaterialType = houseMaterialType; } public Object getHasInternet() { return hasInternet; } public void setHasInternet(Object hasInternet) { this.hasInternet = hasInternet; } public Object getReleaseDate() { return releaseDate; } public void setReleaseDate(Object releaseDate) { this.releaseDate = releaseDate; } public Object getMetro() { return metro; } public void setMetro(Object metro) { this.metro = metro; } public Boolean getIsNetSale() { return isNetSale; } public void setIsNetSale(Boolean isNetSale) { this.isNetSale = isNetSale; } public Boolean getIsNewbuilding() { return isNewbuilding; } public void setIsNewbuilding(Boolean isNewbuilding) { this.isNewbuilding = isNewbuilding; } public Object getDistrict() { return district; } public void setDistrict(Object district) { this.district = district; } public Integer getLivingArea() { return livingArea; } public void setLivingArea(Integer livingArea) { this.livingArea = livingArea; } public Object getLocation() { return location; } public void setLocation(Object location) { this.location = location; } public String getDeveloper() { return developer; } public void setDeveloper(String developer) { this.developer = developer; } public Region getRegion() { return region; } public void setRegion(Region region) { this.region = region; } }
321a440c04011639c7d9123c7ed5c6def1dc1d14
f0c7a0f5cbb877f665ffe8994c784c4aa6c0d0a8
/src/main/java/com/tkpmgd/group4/projectck/MainJFrame.java
94647295bb9141eb93843679895fc2da2f9e7fed
[]
no_license
tskiller1/TKPMGD
84a0d64875083cc56e50474189bf65fae745daab
54c4d835b936c3ea1b2b175ef2f0694a369ac0d8
refs/heads/master
2020-03-10T16:47:04.594887
2018-04-18T06:49:01
2018-04-18T06:49:01
129,482,698
0
0
null
null
null
null
UTF-8
Java
false
false
6,533
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.tkpmgd.group4.projectck; /** * * @author ducthinh */ public class MainJFrame extends javax.swing.JFrame { /** * Creates new form MainJFrame */ public MainJFrame() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 767, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 384, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 508, Short.MAX_VALUE) ); jTabbedPane1.addTab("Phiên âm", jPanel2); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 384, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 508, Short.MAX_VALUE) ); jTabbedPane1.addTab("Lịch sử", jPanel3); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 384, Short.MAX_VALUE) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 508, Short.MAX_VALUE) ); jTabbedPane1.addTab("Video", jPanel4); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jTabbedPane1) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(40, 40, 40) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTabbedPane1)) .addContainerGap(108, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MainJFrame().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JTabbedPane jTabbedPane1; // End of variables declaration//GEN-END:variables }
f9376169eadc979e00683f498ee41e184a73eb42
a640122f9fdaae41ff76a9de481bc16cd658f40f
/src/test/java/com/bh/demo/JdbcApplicationTests.java
7b13bd5897b89647d0a1ad6103e0b003430606c0
[]
no_license
xiaobai324/jdbc
8e3d7e57aef864cdd1986ca9759d6ffe85a3881b
f7f88ba82013eed9025ac7ea9d5eb4a08bdd4e95
refs/heads/master
2023-02-21T00:43:21.914759
2021-01-25T12:36:05
2021-01-25T12:36:05
332,749,543
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.bh.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class JdbcApplicationTests { @Test void contextLoads() { } }
6a4b4ac5fa3767d12f6d813b1b4c6fb26e08aebb
c934f6a1ba8174097d1b71fd5ed76febb8e3ab29
/zigBangProject/app/src/main/java/com/soft/zigbang/src/house/find/detail/review/post/fragment/CheckLiveFragment.java
4eae82c1b5b1e089a313e3ba1897d713547f29a2
[]
no_license
twoDeveloperrr/zigbang_mock_android_mia
24db49e431de86206868276de96911e65114b33e
e713c3670449efcd458565cf1fcefced41d5a31b
refs/heads/main
2023-01-09T12:47:07.012569
2020-11-13T05:11:51
2020-11-13T05:11:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package com.soft.zigbang.src.house.find.detail.review.post.fragment; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.soft.zigbang.R; public class CheckLiveFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_check_live, container, false); } }
6771ff38c1ce5ef04e752699f26a3bfbe9255a4a
6ec9551f8c9f3025f45551a990a14d51f32456c5
/fizz-buzz/src/test/java/com/intraway/fchalar/FizzBuzzControllerTest.java
4af46957a08d71ab9ac8a3829f866bb42c061f3d
[]
no_license
Facundo-Chalar/intraway-interview
0c025ed0c737948abb7a21b40de919475ce865c7
8fd7e9a62e3287ce2b59d10e3fdf9dc887efb7df
refs/heads/master
2020-03-20T00:42:55.680938
2018-06-12T10:13:26
2018-06-12T10:13:26
137,053,613
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
package com.intraway.fchalar; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc public class FizzBuzzControllerTest { @Autowired private MockMvc mockMVC; @Test public void maxValueGreaterThanMinShouldReturnError() throws Exception { this.mockMVC.perform(get("/fizzbuzz/20/10")).andExpect(status().isBadRequest()); } @Test public void fizzBuzzShouldReturnOkWithCorrectParams() throws Exception { this.mockMVC.perform(get("/fizzbuzz/-3/40")).andExpect(status().isOk()); } }
ce38110990f526905a1e5d09de38a5eb5f695e99
dd5d55b5874b847e1fc40041152bf39524968e6b
/app/src/main/java/com/example/administrator/hookandroid/Util/StringUtil.java
55bca7e2d3d626040f9c025b9b813cfbf3218939
[]
no_license
Lesmm/HookAndroid
c95d18b6aad827870c5f41b20d37364ab86f8925
fa83b7d39ff6ba0abd7fe63eb76140d00447f1dc
refs/heads/master
2020-03-28T10:15:35.645941
2019-07-01T06:03:36
2019-07-01T06:03:36
148,089,930
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.example.administrator.hookandroid.Util; public class StringUtil { public static String getClassNameWithoutPackageName(Class cls) { String className = cls.getName(); String[] names = className.split("\\."); String lastName = names[names.length - 1]; String resultName = lastName.replace("$", "."); return resultName; } }
3e667d3b4cf54bc189f826962cc748ef877d3ff6
4d54cf7d3494b5ba20e4f5ed18d114e0d4ee0aaf
/src/com/neet/ghostcatch/states/LevelSelect.java
e4a0addfe5a5a2418c9b53d4140607025fc8c00b
[]
no_license
PrakharNair/GhostCatch
c6a4c8b5415d7bb106bc683306c1d3a0343353f6
101783f3cd8b24fc2c4fea876c9ab38b47dbf2fb
refs/heads/master
2021-09-02T08:21:16.489855
2017-12-31T22:41:26
2017-12-31T22:41:26
115,888,186
0
0
null
null
null
null
UTF-8
Java
false
false
1,831
java
package com.neet.ghostcatch.states; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.neet.ghostcatch.handlers.GameButton; import com.neet.ghostcatch.handlers.GameStateManager; import com.neet.ghostcatch.main.Game; public class LevelSelect extends GameState { private TextureRegion reg; private GameButton[][] buttons; public LevelSelect(GameStateManager gsm) { super(gsm); reg = new TextureRegion(Game.res.getTexture("bgs"), 0, 0, 320, 240); TextureRegion buttonReg = new TextureRegion(Game.res.getTexture("hud"), 0, 0, 32, 32); buttons = new GameButton[5][5]; for(int row = 0; row < buttons.length; row++) { for(int col = 0; col < buttons[0].length; col++) { buttons[row][col] = new GameButton(buttonReg, 80 + col * 40, 200 - row * 40, cam); buttons[row][col].setText(row * buttons[0].length + col + 1 + ""); } } cam.setToOrtho(false, Game.V_WIDTH, Game.V_HEIGHT); } public void handleInput() { } public void update(float dt) { handleInput(); for(int row = 0; row < buttons.length; row++) { for(int col = 0; col < buttons[0].length; col++) { buttons[row][col].update(dt); if(buttons[row][col].isClicked()) { Play.level = row * buttons[0].length + col + 1; Game.res.getSound("Menu_Choice").play(); gsm.setState(GameStateManager.PLAY); } } } } public void render() { sb.setProjectionMatrix(cam.combined); sb.begin(); sb.draw(reg, 0, 0); sb.end(); for(int row = 0; row < buttons.length; row++) { for(int col = 0; col < buttons[0].length; col++) { buttons[row][col].render(sb); } } } public void dispose() { // everything is in the resource manager com.neet.blockbunny.handlers.Content } }
09cbcd7568428ad8768bb12eb19a7b9520211804
2f1b52763d8ad52958ce5653e1816b01a05d780a
/mthd_overriding/Test.java
6d192dbbb5ba1459ad141457b4f43a562b794838
[]
no_license
tuhinjamal/Tjava
baa4c64a752d20506301964025adfc5cd00d5d9f
265fe37ff0833ad35d899d7a747608ee22982a72
refs/heads/master
2022-11-12T06:39:43.323220
2020-07-01T06:40:04
2020-07-01T06:40:04
276,292,580
0
0
null
null
null
null
UTF-8
Java
false
false
487
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package mthd_overriding; /** * * @author tuhin */ public class Test { public static void main(String[] args) { Teacher t1 = new Teacher(); t1.name ="Anis Ul Islam"; t1.age = 30; t1.qualification = "MSc in CSE"; t1.display(); } }
ec011f457012e83783112a6ef20cebf35d262a34
6e3acce1c447ef930ddaed41c5068f425e190381
/DouDemo/app/src/main/java/com/soully/doudemo/Api/Hot/Cast.java
0d73d3b0fe185bee0d664ad1cb643868258a951c
[]
no_license
1048785685/Douban_demo
95c0c2851506ecf8937673d21f18af805e71ea2e
d35641d4bec7d35e6019b75547586dde175f08f1
refs/heads/master
2020-03-27T04:57:48.801630
2018-08-24T11:44:28
2018-08-24T11:44:28
145,982,687
0
0
null
null
null
null
UTF-8
Java
false
false
996
java
package com.soully.doudemo.Api.Hot; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Cast { @SerializedName("alt") @Expose private String alt; @SerializedName("avatars") @Expose private Avatars avatars; @SerializedName("name") @Expose private String name; @SerializedName("id") @Expose private String id; public String getAlt() { return alt; } public void setAlt(String alt) { this.alt = alt; } public Avatars getAvatars() { return avatars; } public void setAvatars(Avatars avatars) { this.avatars = avatars; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
a0c0459fd6ca8acba307b9e5a60f2a22d104d81c
84e4452d49b0ac0f1f2332ddd48c0efe0e9559f2
/src/by/it/ikavalenka/jd02_07/ValidatorXML.java
a72c2f1a24e8ac12eb71cbd1db470b5835fd726f
[]
no_license
loktevalexey/JD2017-02-20
ea2c25203cefc2c139f1277f17d9999e5c8af522
f69c964dc9d651c2acef01e6f177aead182f83b6
refs/heads/master
2020-04-15T00:13:55.277294
2017-06-20T07:53:24
2017-06-20T07:53:24
86,786,465
0
1
null
2017-03-31T06:37:19
2017-03-31T06:37:19
null
UTF-8
Java
false
false
1,280
java
package by.it.ikavalenka.jd02_07; import org.xml.sax.SAXException; import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; import java.io.File; import java.io.IOException; /** * Created by USER on 14.04.2017. */ public class ValidatorXML { public static void main(String[] args) { String sname ="src/by/it/ikavalenka/jd02_07/InShop.xsd"; String xmlfile = "src/by/it/ikavalenka/jd02_07/InternetShop.xml"; String lang = XMLConstants.W3C_XML_SCHEMA_NS_URI; SchemaFactory factory = SchemaFactory.newInstance(lang); File schemaLocation = new File(sname); try { Schema schema = factory.newSchema(schemaLocation); Validator validator = schema.newValidator(); Source source = new StreamSource(xmlfile); validator.validate(source); System.out.println("valid"); } catch (SAXException e) {e.printStackTrace(); System.out.println("invalid"); } catch (IOException e){ e.printStackTrace(); System.out.println("IO Error"); } } }
f40eef845fb9ec951f45c57553bcae05ee211a4c
a6210293a0f11e97ee0e403fcf63e56c9d0b6a7e
/myperf/src/main/java/com/yahoo/dba/perf/myperf/common/DBInstanceInfo.java
6bb2ed59ace11c29d74c2491836c20038a4249bb
[ "Apache-2.0" ]
permissive
selace/mysql_perf_analyzer
1013a802aba1ac0dbdf6cd178ab3ff0eabcb5b3c
c708fce91e6e786e113abd182e03c3dda6f08863
refs/heads/master
2021-01-05T03:10:29.283808
2020-02-11T19:30:03
2020-02-11T19:30:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,447
java
/* * Copyright 2015, Yahoo Inc. * Copyrights licensed under the Apache License. * See the accompanying LICENSE file for terms. */ package com.yahoo.dba.perf.myperf.common; /** * Information about an individual database server * @author xrao * */ public class DBInstanceInfo implements java.io.Serializable{ private static final long serialVersionUID = 1L; private static final int MAX_16BIT_UINT = 65536; private int instance = 0;//keep it for future to include Oracle private String dbType = "mysql";//other value: Oracle private String hostName;//db host name private String port="3306";//tcp port private String databaseName = "information_schema";//MySQL database name for default connect private String dbGroupName;//database group or cluster name //For mysql, we can use it to group servers //used for the same purpose private boolean useTunneling;//when ssh tunneling is used private String localHostName = "localhost";//local hostname when use tunneling private String localPort;//local port when use tunneling private String username; private String password; private boolean connectionVerified;//if we use probe all instances, some instance might not //be verified for its connections, //especially when ssh tunneling is used private boolean testConnection;//used for form only private boolean probeAllInstance;//used for form only, keep it for Oracle private boolean storeCredential;//user for form only private boolean virtualHost;//some system does not allow direct host/sid access, for Oracle private String owner;//the user who creates this entry private int dbid; //primary key, generated. Will be used for metrics private boolean snmpEnabled = true;//by default, we assume SNMP is enabled. private boolean metricsEnabled = true; private boolean alertEnabled = true; public DBInstanceInfo(){} public String getHostName() { return hostName; } public void setHostName(String hostName) { if(hostName!=null) this.hostName = hostName.toLowerCase().trim(); else this.hostName = null; } public String getPort() { return port; } public void setPort(String port) { if(port!=null) { try { int lp = Integer.parseInt(port); if(lp<0) { lp = MAX_16BIT_UINT + lp; } this.port = String.valueOf(lp); }catch(Exception ex){} } else this.port = port; } public short getPortShort() { int lp = 0; try { lp = Integer.valueOf(this.port); }catch(Exception ex) { } return (short)lp; } public boolean isUseTunneling() { return useTunneling; } public void setUseTunneling(boolean useTunneling) { this.useTunneling = useTunneling; } public String getLocalHostName() { return localHostName; } public void setLocalHostName(String localHostName) { if(localHostName!=null) this.localHostName = localHostName.trim(); else this.localHostName = null; } public String getLocalPort() { return localPort; } public void setLocalPort(String localPort) { if(localPort != null) { try { int lp = Integer.parseInt(localPort); if(lp <0 ) { lp = MAX_16BIT_UINT + lp; } this.localPort = String.valueOf(lp); }catch(Exception ex) { } } else this.localPort = localPort; } public short getLocalPortShort() { int lp = 0; try { lp = Integer.valueOf(this.localPort); }catch(Exception ex) { } return (short)lp; } public int getInstance() { return instance; } public void setInstance(int instance) { this.instance = instance; } public String getUsername() { return username; } public void setUsername(String username) { if(username!=null) this.username = username.trim(); else this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } /** * Make a value copy * @return */ public DBInstanceInfo copy() { DBInstanceInfo db = new DBInstanceInfo(); db.setDbType(this.dbType); db.setDbGroupName(this.dbGroupName); db.setHostName(this.hostName); db.setPort(this.port); db.setDatabaseName(this.databaseName); db.setLocalHostName(this.localHostName); db.setUseTunneling(this.useTunneling); db.setLocalPort(this.localPort); db.setUsername(this.username); db.setPassword(this.password); db.setInstance(this.instance); db.setSnmpEnabled(this.snmpEnabled); db.setMetricsEnabled(this.metricsEnabled); db.setConnectionVerified(this.connectionVerified); db.setAlertEnabled(this.alertEnabled); return db; } public String getConnectionString() { // Add allowPublicKeyRetrieval to support sha256 password if("mysql".equalsIgnoreCase(this.dbType)) { if(!this.useTunneling) return "jdbc:mysql://"+this.hostName+":"+this.port+"/"+this.databaseName+"?allowPublicKeyRetrieval=true&useLocalSessionState=true&characterSetResults=UTF-8"; else return "jdbc:mysql://"+this.localHostName+":"+this.localPort+"/"+this.databaseName+"?allowPublicKeyRetrieval=true&useLocalSessionState=true&characterSetResults=UTF-8"; } else if("oracle".equalsIgnoreCase(this.dbType)) { if(!this.useTunneling) { if(!this.virtualHost) return "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="+hostName+")(PORT="+port+"))(CONNECT_DATA=(SERVER=DEDICATED)(SID="+databaseName+")))"; else return "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="+hostName+")(PORT="+port+"))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME="+databaseName+")))"; } else { if(!this.virtualHost) return "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="+this.localHostName+")(PORT="+this.localPort+"))(CONNECT_DATA=(SERVER=DEDICATED)(SID="+databaseName+")))"; else return "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST="+this.localHostName+")(PORT="+this.localPort+"))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME="+databaseName+")))"; } } return null; } @Override public String toString() { return "["+this.dbGroupName+","+this.hostName+","+this.dbid+","+this.instance+"," +this.port+","+this.databaseName+", ssh: "+this.useTunneling+"," +this.localHostName+","+this.localPort+",virtual:"+this.virtualHost +","+this.username+"]"; } public boolean isTestConnection() { return testConnection; } public void setTestConnection(boolean testConnection) { this.testConnection = testConnection; } public boolean isProbeAllInstance() { return probeAllInstance; } public void setProbeAllInstance(boolean probeAllInstance) { this.probeAllInstance = probeAllInstance; } public boolean isStoreCredential() { return storeCredential; } public void setStoreCredential(boolean storeCredential) { this.storeCredential = storeCredential; } public boolean isConnectionVerified() { return connectionVerified; } public void setConnectionVerified(boolean connectionVerified) { this.connectionVerified = connectionVerified; } public boolean isVirtualHost() { return virtualHost; } public void setVirtualHost(boolean virtualHost) { this.virtualHost = virtualHost; } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public String getDbType() { return dbType; } public void setDbType(String dbType) { if(dbType!=null) this.dbType = dbType.trim().toLowerCase(); else this.dbType = null; } public String getDatabaseName() { return databaseName; } public void setDatabaseName(String database) { this.databaseName = database; } public String getDbGroupName() { return dbGroupName; } public void setDbGroupName(String groupName) { this.dbGroupName = groupName; } /** * Whether we can query other db server or instance of the samegroup * to retrieve status of this db, for example, Oracle to use * gv$ or dba_hist views * @return */ public boolean supportClusterQuery() { if("Oracle".equalsIgnoreCase(this.dbType))return true; return false; } public int getDbid() { return dbid; } public void setDbid(int dbid) { this.dbid = dbid; } public boolean isSnmpEnabled() { return snmpEnabled; } public void setSnmpEnabled(boolean snmpEnabled) { this.snmpEnabled = snmpEnabled; } public boolean isMetricsEnabled() { return metricsEnabled; } public void setMetricsEnabled(boolean metricsEnabled) { this.metricsEnabled = metricsEnabled; } public boolean isAlertEnabled() { return alertEnabled; } public void setAlertEnabled(boolean alertEnabled) { this.alertEnabled = alertEnabled; } }