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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f61db1473f7e4e7cb9bbcaf402bf3c922fa6edcf | 1e6c58154cdc6ad8d092a509d1a60fce819229b4 | /Java_Beispiele/Patterns_Prototype/src/org/meins/patterns/prototype/Anwendung.java | 36dde355818b861ae0bc10c118be61f2e0ac8260 | [] | no_license | rrohm/training-java | 3fd9f38991875ee976ae89fe0c36f48bd6510dcd | 7be41412bcbbcf044a8ee30c829cd9effe6f5521 | refs/heads/master | 2022-05-08T20:35:44.580879 | 2021-04-12T08:00:48 | 2021-04-12T08:00:48 | 73,667,503 | 2 | 1 | null | 2022-03-31T18:40:43 | 2016-11-14T04:40:40 | Java | UTF-8 | Java | false | false | 281 | java |
package org.meins.patterns.prototype;
/**
*
* @author Robert Rohm<[email protected]>
*/
public class Anwendung {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
| [
"[email protected]"
] | |
ff7f91260a261f5a2ecb6fe5adc3a1f4e753e525 | da2036c9901292bc91b71894ea950e221113e4ea | /src/main/java/com/Webflux/Pokedex/PokedexApplication.java | bdc1d95cb2fe9832bc6e1f81901d6c5829ce2a97 | [] | no_license | Augusto002/Pokemon | 1b50879481a5b53fb095b227ea18068d68f5ec8f | 3a58cd5513830b565de86f32e48eed975eeb6427 | refs/heads/master | 2023-07-16T18:34:59.048381 | 2021-08-18T14:17:36 | 2021-08-18T14:17:36 | 397,625,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,180 | java | package com.Webflux.Pokedex;
import com.Webflux.Pokedex.Model.Pokemon;
import com.Webflux.Pokedex.repository.PokemonRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.core.ReactiveMongoOperations;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import reactor.core.publisher.Flux;
@SpringBootApplication
public class PokedexApplication {
public static void main(String[] args) {
SpringApplication.run(PokedexApplication.class, args);
}
@Bean
CommandLineRunner init(ReactiveMongoOperations operations, PokemonRepository repository){
return args -> {
Flux<Pokemon> pokemonFlux= Flux.just(
new Pokemon(null, "Blastoise","Água","Torrent",100.0),
new Pokemon(null, "Pikachu","Eletrico","Raio",20.0),
new Pokemon(null, "Bulbasalro","Planta","Folhas Navalhas",15.0)
).flatMap(repository::save);
pokemonFlux
.thenMany(repository.findAll())
.subscribe(System.out::println);
};
}
}
| [
"[email protected]"
] | |
4d2f91b0b969d299bb1afe6c9a616a8de1915ca4 | f91910be031964d66e714bc79bb1632b2c8ee7b4 | /src/cons/SillyString.java | 6f4766085163c7932e19530f694d4352cbf77366 | [] | no_license | zhengqin-huat/rs | b3a442b3eb9b22d5142d75f3232a7cd41a0205ba | 4804c20e774f80e2af75a6398d94a453af6b96b6 | refs/heads/master | 2022-11-07T04:46:03.381636 | 2020-06-25T12:45:55 | 2020-06-25T12:45:55 | 262,301,968 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package cons;
/**
*
*/
import java.util.Map;
/**
*/
public class SillyString {
private final String innerString;
public SillyString(String innerString) {
this.innerString = innerString;
}
public String toString() {
return innerString;
}
@Override
public boolean equals(Object other) {
return this.toString().equals(other.toString());
}
@Override
public int hashCode() {
int total = 0;
for (int i=0; i<innerString.length(); i++) {
total += innerString.charAt(i);
}
System.out.println(total);
return total;
}
/**
*/
public static void main(String[] args) {
Map<SillyString, Integer> map = new MyBetterMap<SillyString, Integer>();
map.put(new SillyString("Word1"), 1);
map.put(new SillyString("Word2"), 2);
Integer value = map.get(new SillyString("Word1"));
System.out.println(value);
for (SillyString key: map.keySet()) {
System.out.println(key + ", " + map.get(key));
}
}
}
| [
"[email protected]"
] | |
42a7028f64783128af3fb230cbfebe4e4292403f | 5c3fc5aa705c24e5fe54928613fac819052a817a | /.svn/pristine/4f/4fa4f6c0c00cdad1e50a4d0229c14e8adbc9c97f.svn-base | 9df6bfda5df3e03b31d96c9843add417b23e7efe | [
"MIT"
] | permissive | wang-shun/eichong | 30e0ca01e9e5f281c9c03f609c52cecb3a5299f0 | c13a6d464150e25039b601aed184fd3fab9e87b7 | refs/heads/master | 2020-04-02T12:19:31.963507 | 2018-03-21T09:40:34 | 2018-03-21T09:40:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,502 | package com.wanma.ims.controller.feedback;
/**
* Created by 18486 on 2018/1/25.
*/
import com.wanma.ims.common.domain.ChargingFaultRecord;
import com.wanma.ims.common.domain.base.Pager;
import com.wanma.ims.constants.WanmaConstants;
import com.wanma.ims.controller.BaseController;
import com.wanma.ims.controller.result.JsonException;
import com.wanma.ims.controller.result.JsonResult;
import com.wanma.ims.service.ChargingFaultRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
* ccu充电故障记录
*/
@Controller
@RequestMapping("/manage/chargingFaultRecord")
public class ChargingFaultRecordController extends BaseController{
private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
@Autowired private ChargingFaultRecordService chargingFaultRecordService;
/**
* 获取ccu充电故障记录列表
*/
@RequestMapping(value = "getChargingFaultRecordList")
@ResponseBody
public void getChargingFaultRecordList(ChargingFaultRecord chargingfaultrecord,Pager pager){
JsonResult result = new JsonResult();
try {
pager.setPageSize(Long.valueOf(100));
long total = chargingFaultRecordService.getChargingFaultRecordCount(chargingfaultrecord);
if (total <= pager.getOffset()) {
pager.setPageNo(1L);
}
pager.setTotal(total);
chargingfaultrecord.setPager(pager);
List<ChargingFaultRecord> faultRecordList = chargingFaultRecordService.getChargingFaultRecordList(chargingfaultrecord);
faultRecordList=changeFaultCause(faultRecordList);
result.setDataObject(faultRecordList);
result.setPager(pager);
responseJson(result);
}catch (Exception e){
LOGGER.error(this.getClass() + "-getChargingFaultRecordList is error|loginUser={}", chargingfaultrecord, e);
responseJson(new JsonException("获取ccu充电故障记录列表失败!"));
}
}
private List<ChargingFaultRecord> changeFaultCause(List<ChargingFaultRecord> faultRecordList){
for (ChargingFaultRecord chargingFaultRecord:faultRecordList){
String cFReFaultCause = chargingFaultRecord.getcFReFaultCause();
String str[] = cFReFaultCause.split("\\|");
if (str.length>1){
Map orderStopReasonMap = WanmaConstants.getOrderStopReson();
if (orderStopReasonMap.get(str[0])!=null){
cFReFaultCause = orderStopReasonMap.get(str[0]).toString();
}else {
cFReFaultCause = str[0];
}
cFReFaultCause+="|";
if ("249".equals(str[0])){
Map startupErrorDetailMap = WanmaConstants.getStartErrorDetail();
cFReFaultCause += startupErrorDetailMap.get(str[1]);
}else {
Map pileErrorDetailMap = WanmaConstants.getPileErrorDetail();
cFReFaultCause += pileErrorDetailMap.get(str[1]);
}
}
chargingFaultRecord.setcFReFaultCause(cFReFaultCause);
}
return faultRecordList;
}
}
| [
"[email protected]"
] | ||
b27245f52e6059de63ed5f76e32749ce287cf862 | eb3ee8c35428239dd24b2b3326428cd8b9e43493 | /AnYiDoor/my_module/src/main/java/cn/nj/www/my_module/main/base/BaseApplication.java | cdd7dc3a7fffd00ad9c143281831fdb560fc6354 | [] | no_license | huqingOK/HKSystemApp | 228b290ed5b5dfcd525affa72558b01774d1997c | 033f93aa0f73396c4e43283cf38644cba210c293 | refs/heads/master | 2021-04-15T11:29:54.781497 | 2017-08-17T12:02:44 | 2017-08-17T12:02:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,828 | java | package cn.nj.www.my_module.main.base;
import android.app.Activity;
import android.app.Application;
import org.apache.http.client.CookieStore;
import java.util.ArrayList;
import java.util.List;
import cn.nj.www.my_module.constant.Global;
import cn.nj.www.my_module.tools.GeneralUtils;
/**
* <baseapplication>
*
*/
public class BaseApplication extends Application {
/**
* 导航栏高度
*/
public static int statusBarHeight = 0;
/**
* cookie缓存
*/
public static CookieStore cookieStore = null;
/**
* app实例
*/
private static BaseApplication sInstance;
/**
* 本地activity
*/
public static List<Activity> activitys = new ArrayList<Activity>();
/**
* 当前avtivity
*/
public static String currentActivity = "";
/**
* Fragment实例
*/
public static String modelName = "";
/**
* 设备号
*/
public static String DEVICE_TOKEN = "";
/**
* url Tag
*/
public static String urlTag = "";
public static String isForced = "0";
@Override
public void onCreate() {
super.onCreate();
sInstance = this;
Global.saveOpenApp(true);
DEVICE_TOKEN = GeneralUtils.getDeviceId();
}
public static synchronized BaseApplication getInstance() {
return sInstance;
}
/**
* <删除>
*/
public void deleteActivity(Activity activity) {
if (activity != null) {
activitys.remove(activity);
activity.finish();
}
}
/**
* <添加activity>
*/
public void addActivity(Activity activity) {
activitys.add(activity);
}
@Override
public void onTerminate() {
super.onTerminate();
Global.logoutApplication();
}
}
| [
"[email protected]"
] | |
ec2891a3c28fbb20aac758a6b438ac957c09835e | da0ae3b9ad57e79aaadd8eb96910f173710b217a | /src/chapter2/delmiddlenode.java | a757be5dc4ec1b5cf81c3aaf966ebc96b5b8d35c | [] | no_license | SrujithPoondla/cracking_coding_interview | c1ca7e23cc9a4170c36a4a0570a5a06c80a6acee | 1045f53c68096dd96bfaaa35b20a49b6651c0823 | refs/heads/master | 2021-03-27T12:44:50.088329 | 2016-12-24T21:13:46 | 2016-12-24T21:13:46 | 73,158,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package chapter2;
import java.util.LinkedList;
/**
* Created by srujithpoondla on 11/20/16.
*/
public class delmiddlenode {
public static void main(String[] args) {
LinkedList llist = new LinkedList();
llist.add(1);
llist.add(2);
llist.add(3);
llist.add(1);
int k=2;
delMiddleNode(llist,k);
}
private static void delMiddleNode(LinkedList llist, int k ) {
}
}
| [
"[email protected]"
] | |
c425d20ce99c501edbd1f1bea2891efdc978b202 | 1b9f5edf161592d468267846d3d6e7a9ec2c28e9 | /app/src/main/java/com/yy/yybaselibary/proxy/ProxyUtil.java | 9ace85331e4f37f2e0256add064229a063f75ff8 | [] | no_license | yy-Kevin/YYBaseLibrary | e32882f1206e3a5dceffe5d72163e812b01f9126 | 52071af201ecfd7c57be3946c63b6dfa8bd4fc4f | refs/heads/master | 2020-06-28T04:42:02.185970 | 2019-08-30T01:31:52 | 2019-08-30T01:31:52 | 200,145,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 430 | java | package com.yy.yybaselibary.proxy;
import java.lang.reflect.Proxy;
/**
* author: Created by yuyao on 2019/8/5 14:52
* E-Mail: [email protected]
* description:
*/
public class ProxyUtil {
public static Object getRroxy(Object o) {
AllProxy allProxy = new AllProxy();
allProxy.setObj(o);
return Proxy.newProxyInstance(o.getClass().getClassLoader(), o.getClass().getInterfaces(), allProxy);
}
}
| [
"[email protected]"
] | |
fe6eb7b55aaecc905e41e4b0c6fa001ee3b14ef9 | 9a69a899240dcdcc030620b8c2443299ac45599a | /src/main/java/com/gog/gograde/config/SecurityConfiguration.java | c408971925acd30475c2a3aaf07b6b675d72e87d | [] | no_license | tipoud/gograde | d8263914a17e6ec8606024ea79bc010dce5080e7 | 7b72c431441d3de676c95f925c3e673675f7dd03 | refs/heads/master | 2021-05-05T16:11:55.071856 | 2017-09-11T20:40:05 | 2017-09-11T20:40:07 | 99,967,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,021 | java | package com.gog.gograde.config;
import com.gog.gograde.security.*;
import com.gog.gograde.security.jwt.*;
import io.github.jhipster.security.*;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.data.repository.query.SecurityEvaluationContextExtension;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.filter.CorsFilter;
import javax.annotation.PostConstruct;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
private final AuthenticationManagerBuilder authenticationManagerBuilder;
private final UserDetailsService userDetailsService;
private final TokenProvider tokenProvider;
private final CorsFilter corsFilter;
public SecurityConfiguration(AuthenticationManagerBuilder authenticationManagerBuilder, UserDetailsService userDetailsService,
TokenProvider tokenProvider,
CorsFilter corsFilter) {
this.authenticationManagerBuilder = authenticationManagerBuilder;
this.userDetailsService = userDetailsService;
this.tokenProvider = tokenProvider;
this.corsFilter = corsFilter;
}
@PostConstruct
public void init() {
try {
authenticationManagerBuilder
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
} catch (Exception e) {
throw new BeanInitializationException("Security configuration failed", e);
}
}
@Bean
public Http401UnauthorizedEntryPoint http401UnauthorizedEntryPoint() {
return new Http401UnauthorizedEntryPoint();
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/app/**/*.{js,html}")
.antMatchers("/i18n/**")
.antMatchers("/content/**")
.antMatchers("/swagger-ui/index.html")
.antMatchers("/test/**");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
.exceptionHandling()
.authenticationEntryPoint(http401UnauthorizedEntryPoint())
.and()
.csrf()
.disable()
.headers()
.frameOptions()
.disable()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/api/register").permitAll()
.antMatchers("/api/activate").permitAll()
.antMatchers("/api/authenticate").permitAll()
.antMatchers("/api/account/reset_password/init").permitAll()
.antMatchers("/api/account/reset_password/finish").permitAll()
.antMatchers("/api/profile-info").permitAll()
.antMatchers("/api/**").authenticated()
.antMatchers("/management/health").permitAll()
.antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)
.antMatchers("/v2/api-docs/**").permitAll()
.antMatchers("/swagger-resources/configuration/ui").permitAll()
.antMatchers("/swagger-ui/index.html").hasAuthority(AuthoritiesConstants.ADMIN)
.and()
.apply(securityConfigurerAdapter());
}
private JWTConfigurer securityConfigurerAdapter() {
return new JWTConfigurer(tokenProvider);
}
@Bean
public SecurityEvaluationContextExtension securityEvaluationContextExtension() {
return new SecurityEvaluationContextExtension();
}
}
| [
"[email protected]"
] | |
f5ed5f21417e357326b124bbb28b8fe33312c163 | 5ca2fb2edcbdab200a8650f1c785de56c040126d | /Java_study/ch10_package/Test04_package.java | d4fb7dc53676d2c76be4a3f99560b6ecf7e81272 | [] | no_license | MainDuke/mainduke-portfolioList | f4acb6cef861fbf96c3d099df5d323793c778b00 | 0410f201d8819c4fe437322773593b5299d17b1f | refs/heads/master | 2020-04-17T18:32:39.544859 | 2019-01-21T15:20:35 | 2019-01-21T15:20:35 | 166,830,888 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 470 | java | /*
* Author: Administrator
* Created: 2016년 1월 28일 목요일 오후 5:09:31
* Modified: 2016년 1월 28일 목요일 오후 5:09:31
*/
import hong.kil.dong.*;
class Test04_package
{
//변수 선언
CalcTest t1;
CalcTest2 t2;
//생성자
public Test04_package(){
t1 = new CalcTest();
t2 = new CalcTest2();
t1.hab(3, 5);
t2.cha(7, 5);
}
//
public static void main( String [] args )
{
new Test04_package();
}// end main
}//class end
| [
"[email protected]"
] | |
7c08b86abd4a592dd9075bfda2b7fb64a298f59a | 9b44ba77eb806f074c0206b13154b3c4d9aaef82 | /src/com/vmetry/collections/HashTableImp.java | 3058106621dabc6e283c50bc738de7f067ab3d18 | [] | no_license | ShanjayJ/Selenium-Java | 781830cdc9e8684bd190d467c06e816420264b41 | f4e593ddf87ee9f0850391a9d34ba0dfc4c66ec3 | refs/heads/master | 2021-08-23T05:45:18.756363 | 2017-12-03T18:04:58 | 2017-12-03T18:04:58 | 112,950,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 913 | java | package com.vmetry.collections;
import java.util.Hashtable;
import java.util.Map;
import java.util.TreeMap;
public class HashTableImp {
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<Integer, String> trmp = new Hashtable<Integer, String>();
trmp.put(1, "Munish");
trmp.put(3, "sankar");
trmp.put(1, "Prabu");
trmp.put(4, "Mano");
trmp.put(5, "Apr");
trmp.put(5, "Perumal");
trmp.put(6, "sanjay");
System.out.println("Keys and Values");
System.out.println("----------------");
for (Map.Entry<Integer, String> ent : trmp.entrySet()) {
System.out.println(ent.getKey() + " " + ent.getValue());
}
trmp.replace(6, "Arun");
System.out.println("After removal");
System.out.println("----------------");
for (Map.Entry<Integer, String> ent : trmp.entrySet()) {
System.out.println(ent.getKey() + " " + ent.getValue());
}
}
}
| [
"[email protected]"
] | |
e592b02423669ea24050f56a3e0956388b5e5907 | f9a1571194fcbd79f1055be66f1ac4ec406abef0 | /src/main/java/ua/sigma/pm/config/DefaultProfileUtil.java | fcfa9e7ee745a241669342af0e7ed3bf84f125cc | [] | no_license | TaranukhaAnton/player_manager | 3ae6b4aec5d959cb9bac472316e57a074ecd5957 | be116972d06de516eda32efd034eeb2d37d08411 | refs/heads/master | 2021-09-19T08:13:24.782217 | 2018-07-25T13:30:32 | 2018-07-25T13:30:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,706 | java | package ua.sigma.pm.config;
import io.github.jhipster.config.JHipsterConstants;
import org.springframework.boot.SpringApplication;
import org.springframework.core.env.Environment;
import java.util.*;
/**
* Utility class to load a Spring profile to be used as default
* when there is no <code>spring.profiles.active</code> set in the environment or as command line argument.
* If the value is not available in <code>application.yml</code> then <code>dev</code> profile will be used as default.
*/
public final class DefaultProfileUtil {
private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default";
private DefaultProfileUtil() {
}
/**
* Set a default to use when no profile is configured.
*
* @param app the Spring application
*/
public static void addDefaultProfile(SpringApplication app) {
Map<String, Object> defProperties = new HashMap<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the <code>application.yml</code> file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
app.setDefaultProperties(defProperties);
}
/**
* Get the profiles that are applied else get default profiles.
*
* @param env spring environment
* @return profiles
*/
public static String[] getActiveProfiles(Environment env) {
String[] profiles = env.getActiveProfiles();
if (profiles.length == 0) {
return env.getDefaultProfiles();
}
return profiles;
}
}
| [
"[email protected]"
] | |
fb55c14c460c22a4c51f113ea8e21ce4c597038c | b89f00f05e9c53909d225ba9b48fd770d72dcb20 | /Java_IT130/Method/foodpractise.java | 9c14b6c307b012ea8d0503518062542b85a78852 | [] | no_license | anjankhatri95/Java-basic-and-advance | 42e3c3d147ed29c80f6ac1fe669f59b68761a9ba | 58bf3ae4cb75efc21614d1dabbc0c4bb088409c6 | refs/heads/master | 2023-04-05T10:44:29.394036 | 2021-04-16T15:42:07 | 2021-04-16T15:42:07 | 358,644,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,061 | java | public class foodpractise extends orderpractise{
private String Type;
private String name;
private int Quantity;
private double price;
public foodpractise(){
super();
this.Type="";
this.name="";
this.Quantity=0;
this.price=0.00;
}
public foodpractise(int OrderNumber, String OrderType,String Type,String name,int Quantity,double price){
super(OrderNumber,OrderType);
this.Type=Type;
this.name=name;
this.Quantity=Quantity;
this.price=price;
}
public void setType(String Type){
this.Type=Type;
}
public String getType(){
return this.Type;
}
public void setname(String name){
this.name=name;
}
public String getname(){
return this.name;
}
public void setQuantity(int Quantity){
this.Quantity=Quantity;
}
public int getQuantity(){
return this.Quantity;
}
public void setPrice(double price){
this.price=price;
}
public double getPrice(){
return this.price;
}
public double subtotal(){
return this.price*this.Quantity;
}
}
| [
"[email protected]"
] | |
1e5019f6a334b6e8096a379c5ebe37377b29b8b9 | e43a5cc0d8fe3342d124898adb4b3cb13afb4642 | /step4/src/main/java/Dunice/step4/service/Serv.java | 79b133490123e047740b304d3c1e6dc5b1b0e53c | [] | no_license | msmetankin/step4 | 6696b2714ecd6a3cb2bc74bff8535fa9ca8c1152 | 5a85ebe193711c92ca3ae217099d75c21a87f508 | refs/heads/master | 2023-08-23T23:25:34.159561 | 2021-10-11T12:14:39 | 2021-10-11T12:14:39 | 412,084,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package Dunice.step4.service;
import Dunice.step4.modelToDo.ToDo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.*;
public interface Serv {
ToDo Create (String text);
Page<ToDo> readAll(Pageable pageable);
Page<ToDo> findByActive(boolean status, Pageable pageable);
ToDo read(int id);
boolean update(ToDo todo, int id);
boolean updateText(int id, String text);
boolean updateStatus(int id);
boolean updateStatusAll(boolean status);
boolean delete(int id);
boolean deleteStat(boolean status);
int countStat(boolean status);
} | [
"[email protected]"
] | |
c08f04dd70a51f57220b5983a02e42e464752e88 | 590b47b192fa73e018b19b20384fc0810c624200 | /play/app/controllers/Administration.java | d04d9d86e75b18b8587c38039e3715cfabd9f05f | [
"Apache-2.0"
] | permissive | raffaeleguidi/virtuoSOA | 3235b18228e95ef6c4fb09415415dab50f9601e1 | 569aaa6dc6499faf72d9924514f0b7ee583a1b13 | refs/heads/master | 2021-01-25T04:53:11.807220 | 2014-09-12T21:38:08 | 2014-09-12T21:38:08 | 23,469,456 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,846 | java | package controllers;
import static play.libs.Json.toJson;
import java.util.List;
import models.Route;
import play.Logger;
import play.Routes;
import play.cache.Cache;
import play.data.Form;
import play.db.ebean.Model;
import play.mvc.Controller;
import play.mvc.Result;
import views.html.Administration.*;
public class Administration extends Controller {
public static Result startHC() {
utils.GettingStarted.test();
return ok("ok");
}
public static Result route() {
return ok(route.render());
}
public static Result editRoute(String id) {
return ok(editroute.render(Route.find.where().eq("id", id).findUnique()));
}
public static Result saveRoute() {
Form form = Form.form(Route.class).bindFromRequest();
if (form.hasErrors()) {
Logger.error("************************" + form.errorsAsJson().toString());
// Do something with the errors (i.e. : redirect with flash message containing the main error)
}
Route route = (Route) form.get();
Cache.remove("source:" + route.randomSeed.toString());
Logger.info("deleted randomSeed " + route.randomSeed + " for route " + route.source);
route.randomSeed = Math.random();
Logger.info("created randomSeed " + route.randomSeed + " for route " + route.source);
route.update();
Cache.remove("route:" + route.source);
return redirect (routes.Administration.editRoute(route.id));
}
public static Result addRoute() {
Route route = Form.form(Route.class).bindFromRequest().get();
route.randomSeed = Math.random();
route.save();
return redirect(routes.Administration.routesList());
}
public static Result routesList() {
List<Route> routes = ((List<Route>)new Model.Finder(String.class, Route.class).all());
return ok(routesList.render(routes));
}
}
| [
"[email protected]"
] | |
76f3ce85203204425e5a81a874f043770040aed2 | 74b28615d32c297cb4c2782fa1f7a9bea1a88619 | /src/main/java/com/xiaoshabao/wxweb/controller/module/UeditorController.java | aa5a28b5c226d5b91f520ac2dc90cf449ab508db | [] | no_license | manxx5521/shabao-sys | a1c8e0d49b245b9be749362caebb3dd3b652ae29 | 711a54e69b1927ff0f36ff98abf8db2ff5b9034a | refs/heads/master | 2021-01-18T23:44:16.656712 | 2018-10-19T02:01:47 | 2018-10-19T02:01:47 | 50,979,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,613 | java | package com.xiaoshabao.wxweb.controller.module;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baidu.ueditor.ActionEnter;
import com.xiaoshabao.framework.web.springmvc.exception.DaoException;
@Controller
//@RequestMapping(value="/resources/js/plugins/ueditor")
@RequestMapping(value="/ueditor")
public class UeditorController {
@RequestMapping(value="/dispatch")
public void reqURL (ModelMap model,HttpServletRequest request,HttpServletResponse response,String action) throws DaoException{
response.setContentType("application/json");
Map<String,Object> params=new HashMap<>();
Enumeration<String> paramnames = request.getParameterNames();
while (paramnames.hasMoreElements()) {
String paramname = paramnames.nextElement();
params.put(paramname,request.getParameter(paramname));
}
String rootPath = request.getSession().getServletContext().getRealPath("/");
try {
request.setCharacterEncoding( "utf-8" );
response.setHeader("Content-Type" , "text/html");
String exec = new ActionEnter(request, rootPath).exec();
PrintWriter writer = response.getWriter();
writer.write(exec);
writer.flush();
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
62f8df00ff5ef9e956626c0a6f57a5364ee16cbe | 6b233c5b2ea674feeb2b9cdecab680f57504ec44 | /app/src/androidTest/java/com/apkglobal/cardview/ExampleInstrumentedTest.java | 936f614cc04e64485f70b8ff238aa43c0173ed62 | [] | no_license | rahul442000/CardView | 96fd9c7f043f1ae9c34de0476df2532193bc1a29 | 7c8fbb13c978f43afa0cd224adc5b1479b478892 | refs/heads/master | 2020-06-07T07:50:36.211637 | 2019-06-20T18:04:02 | 2019-06-20T18:04:02 | 192,965,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.apkglobal.cardview;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.apkglobal.cardview", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
c70974d4b85576432ec63159755cb490914a31b8 | 0874d515fb8c23ae10bf140ee5336853bceafe0b | /l2j-universe/java/lineage2/gameserver/skills/effects/EffectFakeDeath.java | 1f53017af2bac91fe98b746cfed46fc4ec54a76c | [] | no_license | NotorionN/l2j-universe | 8dfe529c4c1ecf0010faead9e74a07d0bc7fa380 | 4d05cbd54f5586bf13e248e9c853068d941f8e57 | refs/heads/master | 2020-12-24T16:15:10.425510 | 2013-11-23T19:35:35 | 2013-11-23T19:35:35 | 37,354,291 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,681 | java | /*
* This program 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.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package lineage2.gameserver.skills.effects;
import lineage2.gameserver.ai.CtrlEvent;
import lineage2.gameserver.cache.Msg;
import lineage2.gameserver.model.Effect;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.network.serverpackets.ChangeWaitType;
import lineage2.gameserver.network.serverpackets.Revive;
import lineage2.gameserver.network.serverpackets.SystemMessage;
import lineage2.gameserver.stats.Env;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public final class EffectFakeDeath extends Effect
{
/**
* Constructor for EffectFakeDeath.
* @param env Env
* @param template EffectTemplate
*/
public EffectFakeDeath(Env env, EffectTemplate template)
{
super(env, template);
}
/**
* Method onStart.
*/
@Override
public void onStart()
{
super.onStart();
Player player = (Player) getEffected();
player.setFakeDeath(true);
player.getAI().notifyEvent(CtrlEvent.EVT_FAKE_DEATH, null, null);
player.broadcastPacket(new ChangeWaitType(player, ChangeWaitType.WT_START_FAKEDEATH));
player.broadcastCharInfo();
}
/**
* Method onExit.
*/
@Override
public void onExit()
{
super.onExit();
Player player = (Player) getEffected();
player.setNonAggroTime(System.currentTimeMillis() + 5000L);
player.setFakeDeath(false);
player.broadcastPacket(new ChangeWaitType(player, ChangeWaitType.WT_STOP_FAKEDEATH));
player.broadcastPacket(new Revive(player));
player.broadcastCharInfo();
}
/**
* Method onActionTime.
* @return boolean
*/
@Override
public boolean onActionTime()
{
if (getEffected().isDead())
{
return false;
}
double manaDam = calc();
if (manaDam > getEffected().getCurrentMp())
{
if (getSkill().isToggle())
{
getEffected().sendPacket(Msg.NOT_ENOUGH_MP);
getEffected().sendPacket(new SystemMessage(SystemMessage.THE_EFFECT_OF_S1_HAS_BEEN_REMOVED).addSkillName(getSkill().getId(), getSkill().getDisplayLevel()));
return false;
}
}
getEffected().reduceCurrentMp(manaDam, null);
return true;
}
}
| [
"[email protected]"
] | |
93742ef8589b40a97e3f52e7945327e7c70686a6 | a3e341c42f0b9c913b7409ee0ca4ed9f5b13cac3 | /src/model/Categoria.java | 7d8f82678a7dfafbc3c9fde1a32263ed665a13be | [] | no_license | rebeccamoraes/java_atp29 | e8ce18a6ad0a000284f6098911a05b63a32d3cc8 | cc96810e692bec97d766275d353563694d5fa20a | refs/heads/main | 2023-08-26T07:57:18.969550 | 2021-10-22T16:01:02 | 2021-10-22T16:01:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package model;
public class Categoria extends Base {
public String nome;
public String descricao;
/**
* Cria id
*/
public Categoria() {
//seta id
super();
}
/**
* Inicializa os atributos e cria o id
* @param nome
* @param descricao
*/
public Categoria(String nome, String descricao) {
super();
this.nome = nome;
this.descricao = descricao;
}
@Override
public String toString() {
String texto = "\nCategoria: " + this.nome + " - " + this.descricao;
return texto;
}
}
| [
"[email protected]"
] | |
bf20d15bf9f8bf3ec9ce2f036665f91566d25d67 | dacf1abdbb642526c731b6b0e18642978ebddbbd | /app/src/main/java/com/example/kuwako/onsen/Activity/BaseAppCompatActivity.java | a7c586435bcad47c15d1c196c5e7c8d95ddaae68 | [] | no_license | kuwako/onsen | 1d0f5ed4cf7cc522517a790b3787e5f0a82d34ac | 46d7333831167ef710f8e5f6afb564e0f643c549 | refs/heads/master | 2021-01-10T08:01:12.376849 | 2016-01-31T05:42:35 | 2016-01-31T05:42:35 | 49,991,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 782 | java | package com.example.kuwako.onsen.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
/**
* Created by kuwako on 2016/01/20.
*/
public class BaseAppCompatActivity extends AppCompatActivity {
public String LOG_TAG = "onsenLog";
public String BASE_URL = "http://loco-partners.heteml.jp/u/onsens";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
// 戻るボタン
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
e62ad66dce289f5c3263d1701adfa5a638cb5bfa | d9ffc6b772dc6d203f26d1a01c77913201cc7416 | /Day17/rottingOranges.java | 2987015dbd97b8fef8b9b632d2dc213d258ac304 | [] | no_license | OzoneProject/21DC | f58028119c6544bdc163cce21c1e31f21924228c | 882dca67de729a885154f649ba47d8e0ae0a39d9 | refs/heads/master | 2022-11-11T08:23:28.517708 | 2020-06-27T10:47:54 | 2020-06-27T10:47:54 | 268,076,577 | 2 | 2 | null | 2020-06-27T10:47:55 | 2020-05-30T12:37:09 | C++ | UTF-8 | Java | false | false | 1,594 | java | class Solution {
public int orangesRotting(int[][] grid) {
int n = grid.length, m = grid[0].length;
int fresh = 0;
Queue<int[]> q = new LinkedList<>();
for(int i = 0; i < n ; i++) {
for(int j = 0 ; j < m ; j++) {
if(grid[i][j] == 2) {
q.add(new int[]{i , j});
} else if(grid[i][j] == 1)
fresh++;
}
}
if(fresh == 0)
return 0;
int level = 2;
fresh += q.size();
while(q.isEmpty() == false){
int [] k = q.remove();
int i = k[0], j = k[1];
level = Math.max(level, grid[i][j]);
fresh--;
if(i > 0 && grid[i-1][j] == 1){
q.add(new int[]{i-1, j});
grid[i-1][j] = 1 + grid[i][j];
}
if(i < n-1 && grid[i+1][j] == 1){
q.add(new int[]{i+1, j});
grid[i+1][j] = 1 + grid[i][j];
}
if(j > 0 && grid[i][j-1] == 1) {
q.add(new int[]{i, j-1});
grid[i][j-1] = 1 + grid[i][j];
}
if(j < m-1 && grid[i][j+1] == 1){
q.add(new int[]{i, j+1});
grid[i][j+1] = 1 + grid[i][j];
}
}
return fresh != 0 ? -1 : level - 2;
}
} | [
"[email protected]"
] | |
5c80395b3d30b86010a8212238d24b6d7e5d7170 | 57e0bb6df155a54545d9cee8f645a95f3db58fd2 | /src/by/it/tsyhanova/at13_calc/Operation.java | 5e6f2d869110fb9c71a3196ea44111f5bb362cc8 | [] | no_license | VitaliShchur/AT2019-03-12 | a73d3acd955bc08aac6ab609a7d40ad109edd4ef | 3297882ea206173ed39bc496dec04431fa957d0d | refs/heads/master | 2020-04-30T23:28:19.377985 | 2019-08-09T14:11:52 | 2019-08-09T14:11:52 | 177,144,769 | 0 | 0 | null | 2019-05-15T21:22:32 | 2019-03-22T13:26:43 | Java | UTF-8 | Java | false | false | 242 | java | package by.it.tsyhanova.at13_calc;
interface Operation {
Var add(Var other) throws CalcException;
Var sub(Var other) throws CalcException;
Var mul(Var other) throws CalcException;
Var div(Var other) throws CalcException;
} | [
"[email protected]"
] | |
6fdef32abdfb434e626be21977f4570be1be5c7f | 0a982392b629da21f37bde3baabde6f9d39ba896 | /app/src/main/java/com/gayathri/contentproviderdemo/MyContentProvider.java | 26de109febd72b02fcdcf9f31c277fcbbb8553a1 | [] | no_license | sagayathri/ContentProvider | 0b5af020ed86af6d463ea53d0f0d751af301fcaf | 67ea5006465dd82f14043da4f3321f69f355300b | refs/heads/master | 2020-03-17T22:22:18.042505 | 2018-05-18T20:34:22 | 2018-05-18T20:34:22 | 134,001,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,210 | java | package com.gayathri.contentproviderdemo;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.widget.Toast;
import com.gayathri.contentproviderdemo.DbHelper;
import com.gayathri.contentproviderdemo.ProductContract;
public class MyContentProvider extends ContentProvider{
public static DbHelper dbHelper;
public static final int ThisProduct = 100;
public static final int ThisProduct_ID = 101;
public static final String AUTHORITY_NAME = "com.gayathri.contentproviderdemo";
public static final Uri URI_Product = Uri.parse("content://"+AUTHORITY_NAME+"/"+ ProductContract.ProductEntry.TABLE_NAME);
public static final Uri URI_Product_ID = Uri.parse("content://"+AUTHORITY_NAME+"/"+ ProductContract.ProductEntry.ID);
public static UriMatcher URI_Matcher = buildUriMatcher();
/*public MyContentProvider(Context context) {
context= this.getContext();
}*/
private static UriMatcher buildUriMatcher() {
UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
matcher.addURI(AUTHORITY_NAME, ProductContract.ProductEntry.TABLE_NAME, ThisProduct);
matcher.addURI(AUTHORITY_NAME, ProductContract.ProductEntry.ID, ThisProduct_ID);;
return matcher;
}
@Override
public boolean onCreate() {
Context context = getContext();
dbHelper = new DbHelper(context);
return true;
}
@Nullable
@Override
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {
Cursor cursor = null;
SQLiteDatabase db = dbHelper.getReadableDatabase();
int match = URI_Matcher.match(uri);
switch (match){
case ThisProduct: {
// String tableName = uri.getLastPathSegment();
cursor = db.query(ProductContract.ProductEntry.TABLE_NAME,
projection, selection, selectionArgs, null, null, sortOrder);
break;
}
case ThisProduct_ID:{
//String tableName = uri.getLastPathSegment();
cursor = db.query(ProductContract.ProductEntry.TABLE_NAME+"/"+ThisProduct_ID,
projection, selection, selectionArgs, null, null, sortOrder);
break;
}
}
return cursor;
}
@Nullable
@Override
public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {
Uri turi = null;
if(dbHelper == null)
dbHelper = new DbHelper(getContext());
SQLiteDatabase db = dbHelper.getWritableDatabase();
switch (URI_Matcher.match(uri)){
case ThisProduct:
long res = db.insert(ProductContract.ProductEntry.TABLE_NAME, null, contentValues);
if(res>0){
turi = ContentUris.withAppendedId(URI_Product, res);
getContext().getContentResolver().notifyChange(turi, null);
}
else
Toast.makeText(getContext(), "Not Inserted", Toast.LENGTH_SHORT).show();
break;
default:
throw new SQLException("SQLiteException at "+uri);
}
return turi;
}
@Override
public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) {
int count = 0;
if(dbHelper == null)
dbHelper = new DbHelper(getContext());
SQLiteDatabase db = dbHelper.getWritableDatabase();
switch (URI_Matcher.match(uri)){
case ThisProduct:
count = db.update(ProductContract.ProductEntry.TABLE_NAME, values, selection, selectionArgs);
break;
case ThisProduct_ID:
count = db.update(ProductContract.ProductEntry.TABLE_NAME, values, selection, selectionArgs);
break;
}
return count;
}
@Override
public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) {
int count = 0;
if(dbHelper == null)
dbHelper = new DbHelper(getContext());
SQLiteDatabase db = dbHelper.getWritableDatabase();
switch (URI_Matcher.match(uri)){
case ThisProduct:
count = db.delete(ProductContract.ProductEntry.TABLE_NAME, selection, selectionArgs);
break;
case ThisProduct_ID:
count = db.delete(ProductContract.ProductEntry.TABLE_NAME, selection, selectionArgs);
break;
}
return count;
}
@Nullable
@Override
public String getType(@NonNull Uri uri) {
throw new UnsupportedOperationException("Not yet implemented");
}
}
| [
"[email protected]"
] | |
2baf87b9dd355e08b8d27eb91bee5d74104ef3e5 | 19490fcc6f396eeb35a9234da31e7b615abf6d04 | /JDownloader/src/org/jdownloader/captcha/v2/challenge/stringcaptcha/ImageCaptchaChallenge.java | 56c9c07553a15491568b7a446550107a012f10d8 | [] | no_license | amicom/my-project | ef72026bb91694e74bc2dafd209a1efea9deb285 | 951c67622713fd89448ffe6e0983fe3f934a7faa | refs/heads/master | 2021-01-02T09:15:45.828528 | 2015-09-06T15:57:01 | 2015-09-06T15:57:01 | 41,953,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,256 | java | package org.jdownloader.captcha.v2.challenge.stringcaptcha;
import java.io.File;
import javax.imageio.ImageIO;
import jd.plugins.Plugin;
import org.appwork.utils.images.IconIO;
import org.appwork.utils.net.httpserver.responses.FileResponse;
import org.jdownloader.captcha.v2.Challenge;
public abstract class ImageCaptchaChallenge<T> extends Challenge<T> {
private File imageFile;
public ImageCaptchaChallenge(File file, String method, String explain, Plugin plugin) {
super(method, explain);
this.imageFile = file;
this.plugin = plugin;
}
public String toString() {
return "CaptchaChallenge by " + plugin.getHost() + "-" + getTypeID() + " File: " + imageFile;
}
public Plugin getPlugin() {
return plugin;
}
public void setPlugin(Plugin plugin) {
this.plugin = plugin;
}
private Plugin plugin;
public File getImageFile() {
return imageFile;
}
public void setImageFile(File imageFile) {
this.imageFile = imageFile;
}
public Object getAPIStorable() throws Exception {
String mime = FileResponse.getMimeType(getImageFile().getName());
return IconIO.toDataUrl(ImageIO.read(getImageFile()), mime);
}
}
| [
"[email protected]"
] | |
f63d3b4aee241d49ca89d0fac49db09fcfe4fb70 | 8d12ae2cfd7b02aa1b8345af8275ec927af32540 | /src/java/recursos/DbQuery.java | 1e861397f535a28c4806b49d596642694545754f | [] | no_license | HenryPaul88/TiendaOnline | 429730018a211bbad06626aa971d455b27023293 | 1f98840cfa1f17dee75fd05fac9be27dd63c4481 | refs/heads/master | 2023-04-21T04:29:51.829172 | 2021-05-17T08:59:31 | 2021-05-17T08:59:31 | 357,889,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,759 | java | package recursos;
public class DbQuery {
// clientes
private static final String InsertarCliente = "insert into clientes values(?,?,?,?,?,?,?)";
private static final String IdCliente = "select max(cod_cliente) from clientes";
private static final String RecuperarClientes = "select cod_cliente,nombre,apellidos,telefono,email,direccion,contrasena from clientes";
private static final String BorrarCliente = "";
private static final String ModificarCliente = "";
// productos
private static final String IdProductos = "select max(cod_pro) from Producto";
private static final String RecuperarProductos = "select cod_pro, nombre_pro, precio, cod_fam, cod_des , imagen_principal, fecha_pro, descripcion from Producto";
private static final String InsertarProductos = "insert into Producto values(?,?,?,?,?,?,?,?)";
private static final String RecuperarProductosImg = "select cod_pro, nombre_pro, precio, cod_fam, cod_des , imagen_principal, fecha_pro, descripcion from Producto where cod_pro= ?";
private static final String BorrarProductos = "";
private static final String ModificarProductos = "";
// familias
private static final String IdFamilias = "select max(cod_fam) from Familias";
private static final String RecuperarFamilias = "select cod_fam, nom_fam, desc_fam from Familias";
private static final String InsertarFamilias = "insert into Familias values(?,?,?)";
private static final String BorrarFamilias = "";
private static final String ModificarFamilias = "";
// img_principal
private static final String IdImagenes = "select max(cod_img) from img_principal";
private static final String RecuperarImagenes = "select cod_img, ruta, ruta_abs from img_principal";
private static final String InsertarImagenes = "insert into img_principal values(?,?,?)";
private static final String BorrarImagenes = "";
private static final String ModificarImagenes = "";
// descuento
private static final String IdDescuento = "select max(cod_des) from Descuento";
private static final String RecuperarDescuento = "select cod_des, descuento from Descuento";
private static final String InsertarDescuento = "insert into Descuento values(?,?)";
private static final String BorrarDescuento = "";
private static final String ModificarDescuento = "";
// FormaPago
private static final String IdFormaPago = "select max(cod_fp) from formaPago";
private static final String RecuperarFormaPago = "";
private static final String InsertarFormaPago = "insert into formaPago values(?,?)";
private static final String BorrarFormaPago = "";
private static final String ModificarFormaPago = "";
// GastoEnvio
private static final String IdGastoEnvio = "select max(cod_fp) from gastoEnvio";
private static final String RecuperarGastoEnvio = "";
private static final String InsertarGastoEnvio = "insert into gastoEnvio values(?,?,?,?)";
private static final String BorrarGastoEnvio = "";
private static final String ModificarGastoEnvio = "";
// Pedido
private static final String IdPedido = "select max(cod_fp) from pedido";
private static final String RecuperarPedido = "";
private static final String InsertarPedido = "";
private static final String BorrarPedido = "";
private static final String ModificarPedido = "";
// LinPedido
private static final String IdLinPedido = "select max(cod_fp) from linPedido";
private static final String RecuperarLinPedido = "";
private static final String InsertarLinPedido = "";
private static final String BorrarLinPedido = "";
private static final String ModificarLinPedido = "";
public static String getBorrarcliente() {
return BorrarCliente;
}
public static String getModificarcliente() {
return ModificarCliente;
}
public static String getInsertarcliente() {
return InsertarCliente;
}
public static String getIdcliente() {
return IdCliente;
}
public static String getRecuperarclientes() {
return RecuperarClientes;
}
public static String getIdproductos() {
return IdProductos;
}
public static String getRecuperarproductos() {
return RecuperarProductos;
}
public static String getInsertarproductos() {
return InsertarProductos;
}
public static String getBorrarproductos() {
return BorrarProductos;
}
public static String getModificarproductos() {
return ModificarProductos;
}
public static String getIdfamilias() {
return IdFamilias;
}
public static String getRecuperarfamilias() {
return RecuperarFamilias;
}
public static String getInsertarfamilias() {
return InsertarFamilias;
}
public static String getBorrarfamilias() {
return BorrarFamilias;
}
public static String getModificarfamilias() {
return ModificarFamilias;
}
public static String getIdimagenes() {
return IdImagenes;
}
public static String getRecuperarimagenes() {
return RecuperarImagenes;
}
public static String getInsertarimagenes() {
return InsertarImagenes;
}
public static String getBorrarimagenes() {
return BorrarImagenes;
}
public static String getModificarimagenes() {
return ModificarImagenes;
}
public static String getIddescuento() {
return IdDescuento;
}
public static String getRecuperardescuento() {
return RecuperarDescuento;
}
public static String getInsertardescuento() {
return InsertarDescuento;
}
public static String getBorrardescuento() {
return BorrarDescuento;
}
public static String getModificardescuento() {
return ModificarDescuento;
}
public static String getIdformapago() {
return IdFormaPago;
}
public static String getRecuperarformapago() {
return RecuperarFormaPago;
}
public static String getInsertarformapago() {
return InsertarFormaPago;
}
public static String getBorrarformapago() {
return BorrarFormaPago;
}
public static String getModificarformapago() {
return ModificarFormaPago;
}
public static String getIdgastoenvio() {
return IdGastoEnvio;
}
public static String getRecuperargastoenvio() {
return RecuperarGastoEnvio;
}
public static String getInsertargastoenvio() {
return InsertarGastoEnvio;
}
public static String getBorrargastoenvio() {
return BorrarGastoEnvio;
}
public static String getModificargastoenvio() {
return ModificarGastoEnvio;
}
public static String getIdpedido() {
return IdPedido;
}
public static String getRecuperarpedido() {
return RecuperarPedido;
}
public static String getInsertarpedido() {
return InsertarPedido;
}
public static String getBorrarpedido() {
return BorrarPedido;
}
public static String getModificarpedido() {
return ModificarPedido;
}
public static String getIdlinpedido() {
return IdLinPedido;
}
public static String getRecuperarlinpedido() {
return RecuperarLinPedido;
}
public static String getInsertarlinpedido() {
return InsertarLinPedido;
}
public static String getBorrarlinpedido() {
return BorrarLinPedido;
}
public static String getModificarlinpedido() {
return ModificarLinPedido;
}
public static String getRecuperarProductosImg() {
return RecuperarProductosImg;
}
}
| [
"henry@henry-ThinkPad-E15"
] | henry@henry-ThinkPad-E15 |
29a9c7d2b37ae55de0360f4d899e6a3e1c683a7d | 9560c3b8ba825f49c1e9b8440b7905cfe9c7ef78 | /module-examples/communications/dom/src/main/java/org/incode/example/communications/dom/mixins/Document_communications.java | 4afd45a1a55dc858df5158bf779f5215c22028eb | [
"Apache-2.0"
] | permissive | incodehq/incode-examples | 756e447a7ac2f84a750571548aed85eb133f8f28 | 911497115d5d049ea1edd3f703c0ccd052db5f9c | refs/heads/master | 2020-03-26T16:35:38.058452 | 2018-08-22T08:13:36 | 2018-08-22T08:13:36 | 145,111,756 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,345 | java | package org.incode.example.communications.dom.mixins;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.inject.Inject;
import com.google.common.collect.Lists;
import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.ActionLayout;
import org.apache.isis.applib.annotation.Contributed;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.Mixin;
import org.apache.isis.applib.annotation.NatureOfService;
import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.services.tablecol.TableColumnOrderService;
import org.incode.example.communications.dom.impl.comms.Communication;
import org.incode.example.communications.dom.impl.covernotes.Document_coverNoteFor;
import org.incode.example.document.DocumentModule;
import org.incode.example.document.dom.impl.docs.Document;
import org.incode.example.document.dom.impl.paperclips.PaperclipRepository;
import org.incode.example.document.dom.spi.SupportingDocumentsEvaluator;
@Mixin(method = "coll")
public class Document_communications {
private final Document document;
public Document_communications(final Document document) {
this.document = document;
}
public static class ActionDomainEvent extends DocumentModule.ActionDomainEvent<Document_communications> { }
@Action(
semantics = SemanticsOf.SAFE,
domainEvent = ActionDomainEvent.class
)
@ActionLayout(
contributed = Contributed.AS_ASSOCIATION
)
public List<Communication> coll() {
final List<Communication> communications = Lists.newArrayList(
paperclipRepository.findByDocument(document).stream()
.map(paperclip -> paperclip.getAttachedTo())
.filter(attachedTo -> attachedTo instanceof Communication)
.map(Communication.class::cast)
.collect(Collectors.toList()));
Collections.reverse(communications);
return communications;
}
public boolean hideColl() {
// hide for supporting documents
for (SupportingDocumentsEvaluator supportingDocumentsEvaluator : supportingDocumentsEvaluators) {
final SupportingDocumentsEvaluator.Evaluation evaluation =
supportingDocumentsEvaluator.evaluate(document);
if(evaluation == SupportingDocumentsEvaluator.Evaluation.SUPPORTING) {
return true;
}
}
return false;
}
@DomainService(nature = NatureOfService.DOMAIN)
public static class TableColumnOrderServiceForDocumentCommunications implements TableColumnOrderService {
@Override
public List<String> orderParented(
final Object parent,
final String collectionId,
final Class<?> collectionType,
final List<String> propertyIds) {
if(parent instanceof Document && Objects.equals(collectionId, "communications")) {
propertyIds.remove("primaryDocument");
return propertyIds;
}
return null;
}
@Override public List<String> orderStandalone(final Class<?> aClass, final List<String> list) {
return null;
}
}
@DomainService(
nature = NatureOfService.DOMAIN,
menuOrder = "110"
)
public static class SupportingDocumentsEvaluatorForCoverNotes implements SupportingDocumentsEvaluator {
@Override
public List<Document> supportedBy(final Document candidateSupportingDocument) {
return null;
}
@Override
public Evaluation evaluate(final Document candidateSupportingDocument) {
final Communication communication = coverNoteEvaluator.coverNoteFor(candidateSupportingDocument);
return communication != null ? Evaluation.SUPPORTING : Evaluation.UNKNOWN;
}
@Inject
Document_coverNoteFor.Evaluator coverNoteEvaluator;
}
@Inject
List<SupportingDocumentsEvaluator> supportingDocumentsEvaluators;
@Inject
PaperclipRepository paperclipRepository;
}
| [
"[email protected]"
] | |
c7543c88a334bdd5f6a5f0e7b6a8872f35a0cdc3 | c998a1bb4ccc5d49fe36ef934500a740d5aefbf5 | /src/main/java/com/myapp/core/base/setting/SystemConstant.java | 3cd7014e44cef17511c55ce5a3b57583cd17fdce | [] | no_license | cqMySong/myapp | 181d5e16f607a07f48cf40bff61068dac673bebe | 77db2d414388ef6a6965d606c732b63ee4e2d59e | refs/heads/master | 2021-01-20T13:22:21.488675 | 2018-06-19T14:55:12 | 2018-06-19T14:55:12 | 90,429,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | package com.myapp.core.base.setting;
public abstract class SystemConstant {
/**
* 分页模型值
*/
public static final Integer DEF_PAGE_SIZE = 50;// 默认分页大小
public static final Integer DEF_PAGE_BEG = 1;// 默认第一页页码
public static final String APP_VERSION = "V1.01";
public static final String DEF_USERPWD_INIT = "123456";// 用户初始密码
//request中的Session保存的上下文内容 的key值
public static String WEBCONTEXT_NAME = "webCtx";
public static final String LICENSE_KEY = "LIC";//license 保存到ServletContext 中的key
public static final String LICENSEVERIFY_KEY = "LIC_MESG";//license 验证信息
}
| [
"[email protected]"
] | |
fa61bc4675cb32ad99ea255e0eb254f900da0bd9 | 364f66fed587e695724b9dbe916de521b437e083 | /jOOQ-test/src/org/jooq/test/sybase/generatedclasses/tables/TLanguage.java | 56e5191a8c249bcbdf224997d7ac9aa636774caf | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | dooApp/jOOQ | febdc254d69506220c2bd23c2f063f79b25f7fe8 | 6784ea88828ee88f934657e22c9dfd9b2ff5173b | refs/heads/master | 2020-12-25T12:27:32.856552 | 2013-08-21T15:21:17 | 2013-08-21T15:21:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,243 | java | /**
* This class is generated by jOOQ
*/
package org.jooq.test.sybase.generatedclasses.tables;
/**
* This class is generated by jOOQ.
*
* An entity holding language master data
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TLanguage extends org.jooq.impl.TableImpl<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord> {
private static final long serialVersionUID = 359982849;
/**
* The singleton instance of <code>DBA.t_language</code>
*/
public static final org.jooq.test.sybase.generatedclasses.tables.TLanguage T_LANGUAGE = new org.jooq.test.sybase.generatedclasses.tables.TLanguage();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord> getRecordType() {
return org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord.class;
}
/**
* The column <code>DBA.t_language.cd</code>.
*/
public final org.jooq.TableField<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord, java.lang.String> CD = createField("cd", org.jooq.impl.SQLDataType.CHAR.length(2), this);
/**
* The column <code>DBA.t_language.description</code>.
*/
public final org.jooq.TableField<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord, java.lang.String> DESCRIPTION = createField("description", org.jooq.impl.SQLDataType.VARCHAR.length(50), this);
/**
* The column <code>DBA.t_language.description_english</code>.
*/
public final org.jooq.TableField<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord, java.lang.String> DESCRIPTION_ENGLISH = createField("description_english", org.jooq.impl.SQLDataType.VARCHAR.length(50), this);
/**
* The column <code>DBA.t_language.id</code>.
*/
public final org.jooq.TableField<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord, java.lang.Integer> ID = createField("id", org.jooq.impl.SQLDataType.INTEGER, this);
/**
* Create a <code>DBA.t_language</code> table reference
*/
public TLanguage() {
super("t_language", org.jooq.test.sybase.generatedclasses.Dba.DBA);
}
/**
* Create an aliased <code>DBA.t_language</code> table reference
*/
public TLanguage(java.lang.String alias) {
super(alias, org.jooq.test.sybase.generatedclasses.Dba.DBA, org.jooq.test.sybase.generatedclasses.tables.TLanguage.T_LANGUAGE);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord> getPrimaryKey() {
return org.jooq.test.sybase.generatedclasses.Keys.T_LANGUAGE__PK_T_LANGUAGE;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.test.sybase.generatedclasses.tables.records.TLanguageRecord>>asList(org.jooq.test.sybase.generatedclasses.Keys.T_LANGUAGE__PK_T_LANGUAGE);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.test.sybase.generatedclasses.tables.TLanguage as(java.lang.String alias) {
return new org.jooq.test.sybase.generatedclasses.tables.TLanguage(alias);
}
}
| [
"[email protected]"
] | |
f2a25535277bd4f1d6c1dcbc1577a585307758af | e4b94ab51bfd35e4c0df5ad6bd8c6fb72c267c16 | /app/release/app-release.apk-decompiled/sources/com/label305/asynctask/OldAsyncTask.java | a7ba70cbb56c070cfd46364220855ca7764f391a | [] | no_license | Blazer20/WeatherApp | 83a87e8d7acde8544bd742b90c8d92fed66e860f | 3886be442a840175d62c06bda9d653a2ec749be7 | refs/heads/main | 2023-06-23T10:38:49.659387 | 2021-07-13T18:48:00 | 2021-07-13T18:48:00 | 381,654,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,065 | java | package com.label305.asynctask;
import android.os.Handler;
import java.lang.Exception;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
public abstract class OldAsyncTask<T, E extends Exception> {
private static final String CANCEL_EXCEPTION = "You cannot cancel this task before calling mFutureTask()";
private static final Executor DEFAULT_EXECUTOR = Executors.newFixedThreadPool(25);
private static final int DEFAULT_POOL_SIZE = 25;
private Executor mExecutor;
private FutureTask<Void> mFutureTask;
private Handler mHandler;
private StackTraceElement[] mLaunchLocation;
private CancelledRunnable mOnCancelledRunnable;
private ExceptionRunnable<E> mOnExceptionRunnable;
private FinallyRunnable mOnFinallyRunnable;
private InterruptedRunnable mOnInterruptedRunnable;
private PreExecuteRunnable mOnPreExecuteRunnable;
private SuccessRunnable<T, E> mOnSuccessRunnable;
public interface CancelledRunnable {
void onCancelled();
}
public interface ExceptionRunnable<E extends Throwable> {
void onException(E e);
}
public interface FinallyRunnable {
void onFinally();
}
public interface InterruptedRunnable {
void onInterrupted(InterruptedException interruptedException);
}
public interface PreExecuteRunnable {
void onPreExecute();
}
public interface SuccessRunnable<T, E> {
void onSuccess(T t);
}
/* access modifiers changed from: protected */
public abstract T doInBackground() throws Exception;
protected OldAsyncTask() {
this.mExecutor = DEFAULT_EXECUTOR;
}
protected OldAsyncTask(Handler handler) {
this.mHandler = handler;
this.mExecutor = DEFAULT_EXECUTOR;
}
protected OldAsyncTask(Executor executor) {
this.mExecutor = executor;
}
protected OldAsyncTask(Handler handler, Executor executor) {
this.mHandler = handler;
this.mExecutor = executor;
}
public <A extends OldAsyncTask<T, E>> A execute() {
return execute(new OldTask(this));
}
public <A extends OldAsyncTask<T, E>> A execute(OldTask<T, E> oldTask) {
this.mLaunchLocation = Thread.currentThread().getStackTrace();
FutureTask<Void> futureTask = new FutureTask<>(oldTask, (Object) null);
this.mFutureTask = futureTask;
this.mExecutor.execute(futureTask);
return this;
}
public boolean cancel() {
return cancel(false);
}
public boolean cancelInterrupt() {
return cancel(true);
}
private boolean cancel(boolean z) {
FutureTask<Void> futureTask = this.mFutureTask;
if (futureTask != null) {
return futureTask.cancel(z);
}
throw new UnsupportedOperationException(CANCEL_EXCEPTION);
}
public boolean isCancelled() {
FutureTask<Void> futureTask = this.mFutureTask;
if (futureTask != null) {
return futureTask.isCancelled();
}
throw new UnsupportedOperationException(CANCEL_EXCEPTION);
}
public Handler getHandler() {
return this.mHandler;
}
public void setHandler(Handler handler) {
this.mHandler = handler;
}
public StackTraceElement[] getLaunchLocation() {
StackTraceElement[] stackTraceElementArr = this.mLaunchLocation;
if (stackTraceElementArr == null) {
return null;
}
StackTraceElement[] stackTraceElementArr2 = new StackTraceElement[stackTraceElementArr.length];
System.arraycopy(stackTraceElementArr, 0, stackTraceElementArr2, 0, stackTraceElementArr.length);
return stackTraceElementArr2;
}
public void setLaunchLocation(StackTraceElement[] stackTraceElementArr) {
this.mLaunchLocation = stackTraceElementArr;
}
public Executor getExecutor() {
return this.mExecutor;
}
public OldAsyncTask<T, E> setExecutor(Executor executor) {
this.mExecutor = executor;
return this;
}
/* access modifiers changed from: protected */
public void onPreExecute() {
PreExecuteRunnable preExecuteRunnable = this.mOnPreExecuteRunnable;
if (preExecuteRunnable != null) {
preExecuteRunnable.onPreExecute();
}
}
/* access modifiers changed from: protected */
public void onSuccess(T t) {
SuccessRunnable<T, E> successRunnable = this.mOnSuccessRunnable;
if (successRunnable != null) {
successRunnable.onSuccess(t);
}
}
/* access modifiers changed from: protected */
public void onInterrupted(InterruptedException interruptedException) {
InterruptedRunnable interruptedRunnable = this.mOnInterruptedRunnable;
if (interruptedRunnable != null) {
interruptedRunnable.onInterrupted(interruptedException);
return;
}
throw new RuntimeException("Thread was interrupted. Override onInterrupted(InterruptedException) to manage behavior.", interruptedException);
}
/* access modifiers changed from: protected */
public void onCancelled() {
CancelledRunnable cancelledRunnable = this.mOnCancelledRunnable;
if (cancelledRunnable != null) {
cancelledRunnable.onCancelled();
}
}
/* access modifiers changed from: protected */
public void onException(E e) {
ExceptionRunnable<E> exceptionRunnable = this.mOnExceptionRunnable;
if (exceptionRunnable != null) {
exceptionRunnable.onException(e);
}
}
/* access modifiers changed from: protected */
public void onRuntimeException(RuntimeException runtimeException) {
throw runtimeException;
}
/* access modifiers changed from: protected */
public void onFinally() {
FinallyRunnable finallyRunnable = this.mOnFinallyRunnable;
if (finallyRunnable != null) {
finallyRunnable.onFinally();
}
}
public OldAsyncTask<T, E> onPreExecute(PreExecuteRunnable preExecuteRunnable) {
this.mOnPreExecuteRunnable = preExecuteRunnable;
return this;
}
public OldAsyncTask<T, E> onSuccess(SuccessRunnable<T, E> successRunnable) {
this.mOnSuccessRunnable = successRunnable;
return this;
}
public OldAsyncTask<T, E> onCancelled(CancelledRunnable cancelledRunnable) {
this.mOnCancelledRunnable = cancelledRunnable;
return this;
}
public OldAsyncTask<T, E> onInterrupted(InterruptedRunnable interruptedRunnable) {
this.mOnInterruptedRunnable = interruptedRunnable;
return this;
}
public OldAsyncTask<T, E> onException(ExceptionRunnable<E> exceptionRunnable) {
this.mOnExceptionRunnable = exceptionRunnable;
return this;
}
public OldAsyncTask<T, E> onFinally(FinallyRunnable finallyRunnable) {
this.mOnFinallyRunnable = finallyRunnable;
return this;
}
}
| [
"[email protected]"
] | |
f984009ae499d0760807541437c4d50457284414 | 251f79afbba3076fba107e546efcc1f984839f47 | /src/Chapter4/CollectionList/mylist/MyLinkedList.java | 6cd0ad6e2cc2d18db9964d24c070043ac9dd973f | [] | no_license | Masonnn/studyJava | e9d4ad69f82b85f2dc45424522b7ac3adbc5161b | 55424d1f7dbfce34ef10210f57a9510be4f1ddaa | refs/heads/master | 2021-06-16T15:04:19.167222 | 2020-11-22T14:36:00 | 2020-11-22T14:36:00 | 204,682,706 | 0 | 0 | null | 2021-06-04T02:09:31 | 2019-08-27T10:50:44 | Java | UTF-8 | Java | false | false | 4,175 | java | package Chapter4.CollectionList.mylist;
import java.util.*;
public class MyLinkedList implements List {
static class ListNode {
public ListNode(ListNode prev, ListNode next, Object value) {
this.prev = prev;
this.next = next;
this.value = value;
}
ListNode prev;
ListNode next;
Object value;
}
private ListNode start = null;
private ListNode tail = null;
private int size = 0;
@Override
public int size() {
return size;
}
@Override
public boolean isEmpty() {
return size == 0;
}
@Override
public boolean contains(Object o) {
ListNode curr = start;
while (curr != null) {
if (Objects.equals(curr.value, o)) {
return true;
}
curr = curr.next;
}
return false;
}
@Override
public Iterator iterator() {
return null;
}
@Override
public Object[] toArray() {
throw new UnsupportedOperationException();
}
// @Override
// public Object[] toArray(IntFunction generator) {
// return new Object[0];
// }
@Override
public boolean remove(Object o) {
return false;
}
@Override
public boolean addAll(Collection c) {
return false;
}
// @Override
// public boolean removeIf(Predicate filter) {
// return false;
// }
@Override
public boolean addAll(int index, Collection c) {
return false;
}
// @Override
// public void replaceAll(UnaryOperator operator) {
//
// }
@Override
public void sort(Comparator c) {
throw new UnsupportedOperationException();
}
@Override
public void clear() {
start = null;
tail = null;
size = 0;
}
@Override
public Object get(int index) {
if (index > size || index < 0) {
throw new IndexOutOfBoundsException("out of bound " + size + " for " + index);
}
ListNode curr = start;
for (int i = 0; i < index; i++) {
curr = curr.next;
}
return curr.value;
}
public boolean add(Object o) {
ListNode newNode = new ListNode(tail, null, o);
if (start == null) {
start = newNode;
}
if (tail != null) {
tail.next = newNode;
}
tail = newNode;
size++;
return true;
}
@Override
public Object set(int index, Object element) {
throw new UnsupportedOperationException();
}
@Override
public void add(int index, Object element) {
throw new UnsupportedOperationException();
}
@Override
public Object remove(int index) {
throw new UnsupportedOperationException();
}
@Override
public int indexOf(Object o) {
throw new UnsupportedOperationException();
}
@Override
public int lastIndexOf(Object o) {
throw new UnsupportedOperationException();
}
@Override
public ListIterator listIterator() {
throw new UnsupportedOperationException();
}
@Override
public ListIterator listIterator(int index) {
throw new UnsupportedOperationException();
}
@Override
public List subList(int fromIndex, int toIndex) {
throw new UnsupportedOperationException();
}
@Override
public Spliterator spliterator() {
throw new UnsupportedOperationException();
}
// @Override
// public Stream stream() {
// return null;
// }
// @Override
// public Stream parallelStream() {
// return null;
// }
@Override
public boolean retainAll(Collection c) {
throw new UnsupportedOperationException();
}
@Override
public boolean removeAll(Collection c) {
throw new UnsupportedOperationException();
}
@Override
public boolean containsAll(Collection c) {
throw new UnsupportedOperationException();
}
@Override
public Object[] toArray(Object[] a) {
throw new UnsupportedOperationException();
}
}
| [
"[email protected]"
] | |
66386bb57df2d9cf7bcbcea92a85927e594c105f | e3bb074903cb14b214a4a89f6224693c35c536ba | /src/main/java/com/johnattan/SpringBasicoAnotacionesFull/ContenedorPrincipal.java | 4b5b9f605ee4c36c49ccd9c32f70404384c8a29c | [] | no_license | johnattan511/SpringBeansJavaConfiguration | 98296022f2f2b1f3bc2e05ec164c1bfbbc98af72 | 0a38591ca08d004875a31a7d508ebfd16f4eab56 | refs/heads/master | 2022-01-09T15:05:12.209139 | 2018-06-04T23:06:33 | 2018-06-04T23:06:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package com.johnattan.SpringBasicoAnotacionesFull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import interfaces.EquipoFutbolAnotacionesFull;
public class ContenedorPrincipal {
@Autowired
@Qualifier(value="obtenerChelsea")
private EquipoFutbolAnotacionesFull equipo;
public EquipoFutbolAnotacionesFull getEquipo() {
return equipo;
}
public void setEquipo(EquipoFutbolAnotacionesFull equipo) {
this.equipo = equipo;
}
}
| [
"[email protected]"
] | |
b72f91f38cc3daf31f25e20e0a419e013b080b3a | 928ea7c8d2f6709b5f3abbfd696afe9dbdd472c9 | /src/main/java/ru/sbt/school/day4/ex4/CollectionUtils.java | 4e440168a5257a035000cba18f0d6d9ab0677ec3 | [] | no_license | chas7610/Education | 54cfc7c2266483f8a24af5a0e90808617355e04f | f3870dc0914e951482df884bb0f678eb2c1dc90d | refs/heads/master | 2020-03-22T18:42:03.781003 | 2018-08-09T14:19:27 | 2018-08-09T14:19:27 | 132,908,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,261 | java | package ru.sbt.school.day4.ex4;
import java.util.*;
public class CollectionUtils {
public static<T> void addAll(List<? extends T> source, List<? super T> destination) {
destination.addAll(source);
}
public static <T> List<T> newArrayList() {
return new ArrayList<T>();
}
public static <T> int indexOf(List <? extends T> source, T o) {
return source.indexOf(o);
}
// public static <T> List limit(List<T> source, int size) {
//
// }
public static <T> void add(List <? super T> source, T o) {
source.add(o);
}
public static<T> void removeAll(List<? super T> removeFrom, List<? extends T> c2) {
removeFrom.removeAll(c2);
}
public static<T> boolean containsAll(List<? extends T> c1, List<? extends T> c2) {
return c1.containsAll(c2);
}
public static <T> boolean containsAny(List <? extends T> c1, List<? extends T> c2) {
for (Iterator<? extends T> it = c2.iterator(); it.hasNext();){
if (c1.contains(it.next()))
return true;
}
return false;
}
public static <T extends Comparable<? super T>> List<T> range(List<T> list, T min, T max) {
List<T> returnList = new ArrayList<>();
if (list == null)
return returnList;
Collections.sort(list);
for (Iterator<T> it = list.iterator(); it.hasNext();){
T t = it.next();
if (t.compareTo(min)==0 || (t.compareTo(min) ==1 && t.compareTo(max) ==-1) || t.compareTo(max) == 0 )
returnList.add(t);
}
return returnList;
}
public static <T> List<T> range(List<T> list, T min, T max, Comparator comparator) {
List<T> returnList = new ArrayList<>();
if (list == null)
return returnList;
Collections.sort(list, comparator);
for (Iterator<T> it = list.iterator(); it.hasNext();){
T t = it.next();
if (((Comparable<T>)t).compareTo(min)==0 ||
(((Comparable<T>)t).compareTo(min) ==1 && ((Comparable<T>)t).compareTo(max) ==-1) ||
((Comparable<T>)t).compareTo(max) == 0 )
returnList.add(t);
}
return returnList;
}
}
| [
"[email protected]"
] | |
ac8f4b60d32d3b5e28e8c784f47383400ed40bcc | 820063df452f56b0a87d3be80f8973b6e948145e | /[2]OnlineStore/src/databeans/Item.java | 15a1c510ba0713ae23582f6e9198c59d065c087c | [] | no_license | robertbalaban8296/cv_projects | b8e2fe35c31c9b4065142de704c1742c11c035fc | c66da32cd7fbbe97983ef2d2a7c7c2143e079506 | refs/heads/master | 2020-03-07T15:37:54.744243 | 2018-03-31T15:42:46 | 2018-03-31T15:42:46 | 127,560,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | 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 databeans;
/**
*
* @author robert.balaban
*/
public class Item {
private int id;
private String nume;
private double pret;
public Item() {
}
public Item(String nume, double pret) {
this.nume = nume;
this.pret = pret;
}
public Item(int id, String nume, double pret) {
this.id = id;
this.nume = nume;
this.pret = pret;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNume() {
return nume;
}
public void setNume(String nume) {
this.nume = nume;
}
public double getPret() {
return pret;
}
public void setPret(double pret) {
this.pret = pret;
}
@Override
public String toString() {
return id + " " + nume + " " + pret;
}
}
| [
"[email protected]"
] | |
ce8c2557bf0bc3e03008f85f3c7c6e6a3a54e65a | 31e68160f8177960e08e04a7f0b22d1505767aa7 | /goodsms/sms/src/main/java/com/nice/good/utils/SavePermissionUtil.java | 1ec0a8e7eccc07526d47010617cef068cff0a067 | [] | no_license | ChengHui154322290/nice | 6d956c44627933e78a5b2e71aed8ad3308fb8481 | d4148350840d1bb36ca9b6cff967b758ea1fbabf | refs/heads/master | 2020-03-28T13:36:01.122152 | 2018-09-12T07:57:43 | 2018-09-12T07:57:43 | 148,409,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,264 | java | package com.nice.good.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class SavePermissionUtil {
private static Logger log = LoggerFactory.getLogger(SavePermissionUtil.class);
/**
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:gooderCode
*
* @param listBean
* @return
*/
public static List<String> getGooderCode(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listGooderCode = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listGooderCode.add(mapStr.get("gooderCode"));
}
}
} catch (Exception e) {
log.error("获取List<String> gooderCode 货主编码异常!");
}
return listGooderCode;
}
/**
* -- 2018/05/21 16:26 rk
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:gooderCode
*
* @param listBean
* @return
*/
public static List<String> getGooderName(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listGooderName = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listGooderName.add(mapStr.get("gooderName"));
}
}
} catch (Exception e) {
log.error("获取List<String> gooderName 货主名称异常!");
}
return listGooderName;
}
/**
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:placeNumber
*
* @param listBean
* @return
*/
public static List<String> getPlaceNumber(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listPlaceNumber = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listPlaceNumber.add(mapStr.get("placeNumber"));
}
}
} catch (Exception e) {
log.error("获取List<String> placeNumber 场地异常!");
}
return listPlaceNumber;
}
/**
* -- 2018/05/21 16:26 rk
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:placeNumber
*
* @param listBean
* @return
*/
public static List<String> getPlaceName(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listPlaceName = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listPlaceName.add(mapStr.get("placeName"));
}
}
} catch (Exception e) {
log.error("获取List<String> placeName 场地名称异常!");
}
return listPlaceName;
}
/**
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:roleId
*
* @param listBean
* @return
*/
public static List<String> getRoleId(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listRoleId = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listRoleId.add(mapStr.get("roleId"));
}
}
} catch (Exception e) {
log.error("获取List<String> listRoleId 角色ID异常!");
}
return listRoleId;
}
/**
* -- 2018/05/21 16:26 rk
* 通过获取 Map<"checked", V>中的 V 值是否‘等于’true ,进而累计自增 Map<K, V> 中的 V 值。 K 值为:roleId
*
* @param listBean
* @return
*/
public static List<String> getRoleName(List<Map<String, String>> listBean) {
// 设置 List<String> 接收为 checked=true 所对应的 gooderCode 值
List<String> listRoleName = new ArrayList<String>();
try {
for (Map<String, String> mapStr : listBean) {
if (mapStr.get("checked").equals("true")) {
listRoleName.add(mapStr.get("roleName"));
}
}
} catch (Exception e) {
log.error("获取List<String> listRoleName 角色名称异常!");
}
return listRoleName;
}
}
| [
"[email protected]"
] | |
b394c7306cc6aeccd9166790c6a47485e5bd881d | 796e3ee80c340303c6422377638fc407b0483f73 | /src/id/ilkom/IndividualHolder.java | 1741a57bba5c3d2c8a1f71de21cf65fd2a4737f9 | [] | no_license | GuestBrutal/SistemGudang | 6b776d20af26f90502777e8ec445db576683c744 | d17585d8f6dba72d26468a5329d78f34f109e7ff | refs/heads/master | 2023-02-23T04:31:44.376598 | 2021-01-26T07:37:03 | 2021-01-26T07:37:03 | 331,336,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,620 | 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 id.ilkom;
/**
*
* @author kmbrps
*/
import java.util.ArrayList;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
/**
*
* @author kmbrps
*/
public class IndividualHolder extends SistemGudang {
StringProperty nik;
StringProperty birthdate;
public IndividualHolder(Integer gudangID, String nama,
String alamat, String nik, String birthdate, ArrayList<Akun> akunn) {
super(gudangID, nama, alamat, akunn);
this.nik = new SimpleStringProperty(nik);
this.birthdate = new SimpleStringProperty(birthdate);
}
public IndividualHolder(Integer gudangID, String nama, String alamat,
String nik, String birthdate, Akun akun) {
super(gudangID, nama, alamat, akun);
this.nik = new SimpleStringProperty(nik);
this.birthdate = new SimpleStringProperty(birthdate);
}
public String getNik() {
return nik.get();
}
public void setNik(String nik) {
this.nik.set(nik);
}
public String getBirthdate() {
return birthdate.get();
}
public void setBirthdate(String birthdate) {
this.birthdate.set(birthdate);
}
public StringProperty nikProperty() {
return nik;
}
public StringProperty birthdateProperty() {
return birthdate;
}
}
| [
"Microsoft@DESKTOP-PUTRO"
] | Microsoft@DESKTOP-PUTRO |
729cbfe06f830312f31a400c09c8a3d62f424b2f | 6ad1ff78f53f80795a90a90a1ec630408ba4e498 | /src/test/java/PAGES/reg_pom.java | 64f81ebb19d0c3927fa51c5eafaaee80897b90b9 | [] | no_license | spskishore/Kishore_Kumar_845155_Product_Store | 3413f3a642da24af2dfd5328a48ec808fd3e7b00 | 48d63a22ba48819aefdb1bebd4ab71ec0f1d2d79 | refs/heads/master | 2023-04-10T03:28:32.171306 | 2020-03-28T06:27:57 | 2020-03-28T06:27:57 | 250,251,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,243 | java | package PAGES;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import BASE_CLASS.wait_type;
public class reg_pom {
WebDriver dr;
wait_type wt;
public reg_pom(WebDriver dr)
{
this.dr=dr;
wt=new wait_type(dr);
}
By signup=By.linkText("Sign up"); // click for signup
By username=By.xpath("//input[@id='sign-username']");// enter signup username
By password=By.xpath("//input[@id='sign-password']"); //enter signup password
By signup_btn=By.xpath("//body[@class='modal-open']/div[2]/div[1]/div/div[3]/button[2]"); // click on sign up button.
By login=By.xpath("//a[@id='login2']"); //click for login
By l_usr=By.xpath("//input[@id='loginusername']"); //enter login username
By l_pwd=By.xpath("//input[@id='loginpassword']"); //enter login password
By l_btn=By.xpath("//body[@class='modal-open']/div[3]/div[1]/div/div[3]/button[2]"); //click login button
public void click_sign() { // click for signup
WebElement we_sign=wt.elementToBeClickable(signup, 60);
we_sign.click();
}
public void set_username(String un)
{
WebElement we_usr=wt.waitForElement(username, 40);
we_usr.sendKeys(un); // enter signup username
}
public void set_pwd(String pwd)
{
WebElement we_pwd=wt.elementToBeClickable(password, 40);
we_pwd.sendKeys(pwd); //enter signup password
}
public void sign_btn()
{
WebElement we_sbtn=wt.elementToBeClickable(signup_btn, 40);
we_sbtn.click(); // click on sign up button.
}
public void alert() //handles successful sign up alert
{
try {
WebDriverWait wait = new WebDriverWait(dr, 10);
wait.until(ExpectedConditions.alertIsPresent());
Alert alert = dr.switchTo().alert();
System.out.println(alert.getText());
alert.accept();
} catch (Exception e) {
//exception handling
e.printStackTrace();
}
}
public void click_login()
{
WebElement we_login=wt.elementToBeClickable(login, 40);
we_login.click(); //click for login
}
public void set_loginusr(String lu)
{
dr.findElement(l_usr).sendKeys(lu); //enter login username
}
public void set_loginpwd(String lp)
{
WebElement we_pwd=wt.waitForElement(l_pwd, 40);
we_pwd.sendKeys(lp); //enter login password
}
public void login_btn()
{
WebElement we_lbtn=wt.elementToBeClickable(l_btn, 40);
we_lbtn.click(); //click on login button
}
public void do_reg(String u,String p) throws InterruptedException //performs all registration steps to be followed.
{
Thread.sleep(1000);
this.click_sign();
this.set_username(u);
this.set_pwd(p);
this.sign_btn();
Thread.sleep(2000);
}
public void do_login(String lu1,String lp1) throws InterruptedException //performs all login operations
{
this.click_login();
Thread.sleep(1000);
this.set_loginusr(lu1);
Thread.sleep(2000);
this.set_loginpwd(lp1);
this.login_btn();
}
}
| [
"Kishore Kumar@LAPTOP-8BGBRP1P"
] | Kishore Kumar@LAPTOP-8BGBRP1P |
91efa17f98acfc758cc25a41651cd41ad45a0c62 | 39f07c81755b22a0a6959bac7f7491f82c1951f3 | /ai_practice/A2_submission/A2src/src/TestTornadoSweeper.java | 349934c780cdd16346639927f95eb5c5fb3a2a1c | [] | no_license | srvCodes/msc_st_andrews | 3b80c3c7550381e7f98f986209eda9609036df92 | bbf8c7a80a76917eaf889829272159c3f146cb32 | refs/heads/main | 2023-01-31T22:46:35.227051 | 2020-12-18T22:22:36 | 2020-12-18T22:22:36 | 322,712,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,239 | java | import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
/**
* Unit tests for Tornado class
*/
public class TestTornadoSweeper {
@Test
public static void testNumOfTornadoes() {
char[][] world = World.TEST1.map;
TornadoSweeper ts = new TornadoSweeper(world);
Assert.assertTrue("Test 1 passed for no. of tornadoes.", ts.getNumOfTornadoes() == 3);
}
@Test
public static void testVisitedCells() {
char[][] world = World.TEST1.map;
TornadoSweeper ts = new TornadoSweeper(world);
Cell cellToProbe = new Cell(2,2);
ts.updateAgentWorld(cellToProbe);
Cell v1 = new Cell(2,1);
Cell v2 = new Cell(1,1);
Cell v3 = new Cell(1,2);
List<Cell> expectedVisitedCells = new ArrayList<>();
expectedVisitedCells.add(cellToProbe);
expectedVisitedCells.add(v2);
expectedVisitedCells.add(v3);
expectedVisitedCells.add(v1);
Assert.assertArrayEquals("Test 2 passed for visited cells", expectedVisitedCells.toArray(), ts.getVisited().toArray());
Assert.assertTrue("Test 3 passed for updating agent world", ts.getAgentWorld()[2][1] == '2');
}
@Test
public static void testGetFirstCellsToProbe() {
char[][] world = World.M10.map;
TornadoSweeper ts1 = new TornadoSweeper(world);
Assert.assertTrue(ts1.getStep() == 0);
Cell firstCellToProbe = ts1.getFirstCellsToProbe();
ts1.updateAgentWorld(firstCellToProbe);
Assert.assertTrue("Test 4 passed for probing top-left corner cell on first step",
firstCellToProbe.getRow() == 0 && firstCellToProbe.getCol() == 0);
// increment step counter for the game
ts1.setStep(ts1.getStep() + 1);
Cell secondCellToProbe = ts1.getFirstCellsToProbe();
ts1.updateAgentWorld(secondCellToProbe);
Assert.assertTrue("Test 5 passed for probing cell in centre on second step",
secondCellToProbe.getRow() == 3 && secondCellToProbe.getCol() == 3);
}
public static void main(String[] args) {
testNumOfTornadoes();
testVisitedCells();
testGetFirstCellsToProbe();
}
}
| [
"[email protected]"
] | |
48665b921575ea5ffab0caa46f127532c733e333 | c2f4654ad76bb64a34eaa9950000e58b70b3acdc | /src/org/drip/sample/bondmetrics/Bhatpara.java | c62b8d2397aff36d93cb169a4cf49a9e511d134e | [
"Apache-2.0"
] | permissive | IanMadlenya/DROP | 0a1361a1f6fd46d9dc8d9795edf04ee8f928b437 | 872d93bbae48ce071bcd9bae2b5ce1570bbbc862 | refs/heads/master | 2021-07-23T01:41:01.575353 | 2017-11-03T14:45:49 | 2017-11-03T14:45:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,538 | java |
package org.drip.sample.bondmetrics;
import org.drip.analytics.date.*;
import org.drip.product.creator.BondBuilder;
import org.drip.product.credit.BondComponent;
import org.drip.product.params.EmbeddedOptionSchedule;
import org.drip.service.env.EnvManager;
import org.drip.service.scenario.*;
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
/*!
* Copyright (C) 2017 Lakshmi Krishnamurthy
*
* This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model
* libraries targeting analysts and developers
* https://lakshmidrip.github.io/DRIP/
*
* DRIP is composed of four main libraries:
*
* - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/
* - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/
* - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/
* - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/
*
* - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options,
* Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA
* Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV
* Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM
* Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics.
*
* - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy
* Incorporator, Holdings Constraint, and Transaction Costs.
*
* - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality.
*
* - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning.
*
* 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.
*/
/**
* Bhatpara generates the Full Suite of Replication Metrics for a Sample Bond.
*
* @author Lakshmi Krishnamurthy
*/
public class Bhatpara {
private static final void SetEOS (
final BondComponent bond,
final EmbeddedOptionSchedule eosCall,
final EmbeddedOptionSchedule eosPut)
throws java.lang.Exception
{
if (null != eosPut) bond.setEmbeddedPutSchedule (eosPut);
if (null != eosCall) bond.setEmbeddedCallSchedule (eosCall);
}
public static final void main (
final String[] astArgs)
throws Exception
{
EnvManager.InitEnv ("");
JulianDate dtSpot = DateUtil.CreateFromYMD (
2017,
DateUtil.AUGUST,
31
);
String[] astrDepositTenor = new String[] {
"2D"
};
double[] adblDepositQuote = new double[] {
0.0130411 // 2D
};
double[] adblFuturesQuote = new double[] {
0.01345, // 98.655
0.01470, // 98.530
0.01575, // 98.425
0.01660, // 98.340
0.01745, // 98.255
0.01845 // 98.155
};
String[] astrFixFloatTenor = new String[] {
"02Y",
"03Y",
"04Y",
"05Y",
"06Y",
"07Y",
"08Y",
"09Y",
"10Y",
"11Y",
"12Y",
"15Y",
"20Y",
"25Y",
"30Y",
"40Y",
"50Y"
};
String[] astrGovvieTenor = new String[] {
"1Y",
"2Y",
"3Y",
"5Y",
"7Y",
"10Y",
"20Y",
"30Y"
};
double[] adblFixFloatQuote = new double[] {
0.016410, // 2Y
0.017863, // 3Y
0.019030, // 4Y
0.020035, // 5Y
0.020902, // 6Y
0.021660, // 7Y
0.022307, // 8Y
0.022879, // 9Y
0.023363, // 10Y
0.023820, // 11Y
0.024172, // 12Y
0.024934, // 15Y
0.025581, // 20Y
0.025906, // 25Y
0.025973, // 30Y
0.025838, // 40Y
0.025560 // 50Y
};
double[] adblGovvieYield = new double[] {
0.01219, // 1Y
0.01391, // 2Y
0.01590, // 3Y
0.01937, // 5Y
0.02200, // 7Y
0.02378, // 10Y
0.02677, // 20Y
0.02927 // 30Y
};
String[] astrCreditTenor = new String[] {
"06M",
"01Y",
"02Y",
"03Y",
"04Y",
"05Y",
"07Y",
"10Y"
};
double[] adblCreditQuote = new double[] {
60., // 6M
68., // 1Y
88., // 2Y
102., // 3Y
121., // 4Y
138., // 5Y
168., // 7Y
188. // 10Y
};
double dblFX = 1.;
int iSettleLag = 3;
int iCouponFreq = 2;
String strName = "Bhatpara";
double dblCleanPrice = 1.01394;
double dblIssuePrice = 1.0;
String strCurrency = "USD";
double dblSpreadBump = 20.;
double dblCouponRate = 0.05125;
double dblIssueAmount = 5.25e08;
String strTreasuryCode = "UST";
String strCouponDayCount = "30/360";
double dblSpreadDurationMultiplier = 5.;
JulianDate dtEffective = DateUtil.CreateFromYMD (
2013,
10,
11
);
JulianDate dtMaturity = DateUtil.CreateFromYMD (
2023,
4,
1
);
BondComponent bond = BondBuilder.CreateSimpleFixed (
strName,
strCurrency,
strName,
dblCouponRate,
iCouponFreq,
strCouponDayCount,
dtEffective,
dtMaturity,
null,
null
);
SetEOS (
bond,
EmbeddedOptionSchedule.FromAmerican (
dtSpot.julian(),
new int[] {
DateUtil.CreateFromYMD (2018, 04, 01).julian(),
DateUtil.CreateFromYMD (2019, 04, 01).julian(),
DateUtil.CreateFromYMD (2020, 04, 01).julian(),
DateUtil.CreateFromYMD (2021, 04, 01).julian(),
DateUtil.CreateFromYMD (2023, 04, 01).julian(),
},
new double[] {
1.02563,
1.01708,
1.00854,
1.00000,
1.00000,
},
false,
15,
15,
false,
Double.NaN,
"",
Double.NaN
),
null
);
BondReplicator abr = BondReplicator.Standard (
dblCleanPrice,
dblIssuePrice,
dblIssueAmount,
dtSpot,
astrDepositTenor,
adblDepositQuote,
adblFuturesQuote,
astrFixFloatTenor,
adblFixFloatQuote,
dblSpreadBump,
dblSpreadDurationMultiplier,
strTreasuryCode,
astrGovvieTenor,
adblGovvieYield,
astrCreditTenor,
adblCreditQuote,
dblFX,
Double.NaN,
iSettleLag,
bond
);
BondReplicationRun abrr = abr.generateRun();
System.out.println (abrr.display());
}
}
| [
"[email protected]"
] | |
afe5badb4445bdf105d2e85c44a565b29df73964 | 07da27ba07c1cfe6cdea14b8cb03ad0fa6c4303e | /src/test/java/com/example/test/palindrome/PalindromeTest.java | 28b09f27024f6e98bdfda53202407e116653c123 | [] | no_license | antufievsemen/mutationTests | 77ee4f8b3c23e4d23a92174e744d5300acb03399 | 1adddb7b60f19c510cd1fe5abf7e166f1b3b6a12 | refs/heads/master | 2023-05-07T01:19:31.784966 | 2021-06-03T20:29:03 | 2021-06-03T20:29:03 | 373,631,117 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package com.example.test.palindrome;
import com.example.palindrome.Palindrome;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class PalindromeTest {
@Test
public void whenPalindrom_thenAccept() {
Palindrome palindromeTester = new Palindrome();
assertTrue(palindromeTester.isPalindrome("noon"));
}
@Test
public void whenNotPalindrom_thanReject() {
Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("box"));
}
@Test
public void whenNearPalindrom_thanReject() {
Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("neon"));
}
}
| [
"[email protected]"
] | |
af806edd497458a7d3f2b304fc45cf9826ec09e6 | 16358360fe1cf527fcf45e1cf13bbf2e441b530c | /runtime/citrus-xml/src/test/java/org/citrusframework/xml/container/AssertTest.java | ba37098439cf268e78a52a2a3308609b29089bb4 | [
"Apache-2.0"
] | permissive | citrusframework/citrus | cc08796208428fe29ae0502ff7da340cc70b5a6c | dd8d57602d77cb6cc10c8793b8f7aa00f1e99a4a | refs/heads/main | 2023-08-26T16:25:20.966016 | 2023-08-21T13:39:31 | 2023-08-21T18:36:14 | 500,806 | 232 | 95 | Apache-2.0 | 2023-09-12T11:33:21 | 2010-02-03T15:32:30 | Java | UTF-8 | Java | false | false | 2,529 | java | /*
* Copyright 2022 the original author or authors.
*
* 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.citrusframework.xml.container;
import org.citrusframework.TestCase;
import org.citrusframework.TestCaseMetaInfo;
import org.citrusframework.actions.FailAction;
import org.citrusframework.exceptions.CitrusRuntimeException;
import org.citrusframework.xml.XmlTestLoader;
import org.citrusframework.xml.actions.AbstractXmlActionTest;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* @author Christoph Deppisch
*/
public class AssertTest extends AbstractXmlActionTest {
@Test
public void shouldLoadAssert() {
XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/xml/container/assert-test.xml");
testLoader.load();
TestCase result = testLoader.getTestCase();
Assert.assertEquals(result.getName(), "AssertTest");
Assert.assertEquals(result.getMetaInfo().getAuthor(), "Christoph");
Assert.assertEquals(result.getMetaInfo().getStatus(), TestCaseMetaInfo.Status.FINAL);
Assert.assertEquals(result.getActionCount(), 1L);
Assert.assertEquals(result.getTestAction(0).getClass(), org.citrusframework.container.Assert.class);
Assert.assertEquals(((org.citrusframework.container.Assert) result.getTestAction(0)).getException(), CitrusRuntimeException.class);
Assert.assertEquals(((org.citrusframework.container.Assert) result.getTestAction(0)).getMessage(), "Something went wrong");
Assert.assertEquals(((org.citrusframework.container.Assert) result.getTestAction(0)).getActionCount(), 1L);
Assert.assertEquals(((org.citrusframework.container.Assert) result.getTestAction(0)).getAction().getClass(), FailAction.class);
}
}
| [
"[email protected]"
] | |
0d72adcbcfff661725e4356046842024cfc99f1b | b5f404eba50a00bd45b711d762ffb2ef8ee7ac0d | /src/cn/ac/irsa/landcirculation/CodeCityAction.java | b42e4c6113e7ca6fa482707bd7ce3adcc8962cb7 | [] | no_license | BNU-Chen/landCirculation | 607c4e4f24468baa69c514805f0f08e17c710af4 | aa605f3e995b71b92809b08db89338855956351c | refs/heads/master | 2016-09-01T07:48:26.278494 | 2016-04-11T07:01:57 | 2016-04-11T07:01:57 | 47,209,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,305 | java | package cn.ac.irsa.landcirculation;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import org.hibernate.Session;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class CodeCityAction extends ActionSupport {
private static final long serialVersionUID = 1L;
public List<CodeCity> lstCodeCity;
public String provinceCode;
public List<CodeCity> getLstCodeCity() {
return lstCodeCity;
}
public void setLstCodeCity(List<CodeCity> lstCodeCity) {
this.lstCodeCity = lstCodeCity;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return SUCCESS;
}
public String listCityByProvinceCode() throws Exception {
// TODO Auto-generated method stub
System.out.println("provinceCode:" + this.provinceCode);
this.lstCodeCity = CodeCityDao.getCodeCityListByProvinceCode(this.provinceCode);
ActionContext context = ActionContext.getContext();
System.out.println("city Nuber:" + this.lstCodeCity.size());
context.put("lstCodeCity", lstCodeCity);
return SUCCESS;
}
}
| [
"[email protected]"
] | |
65ee21943e8b70b3011641d6dae594725f01f77f | d73c0629120b1d1b8bba6147d22c01bc6405c7d9 | /super-devops-common/src/main/java/com/wl4g/devops/common/constants/UMCDevOpsConstants.java | 9feb6f4cb496cc9ea82904ad707a7efa858eef50 | [
"Apache-2.0"
] | permissive | YKHahahaha/super-devops | c4e7d799b561eb55fd266c592e012ca453bbd311 | 3ce21181119235f97abb271634c129a5256c42d8 | refs/heads/master | 2020-09-07T18:34:16.182181 | 2019-11-08T16:07:13 | 2019-11-08T16:07:13 | 220,878,807 | 1 | 0 | null | 2019-11-11T01:43:05 | 2019-11-11T01:43:05 | null | UTF-8 | Java | false | false | 6,638 | java | /*
* Copyright 2017 ~ 2025 the original author or authors. <[email protected], [email protected]>
*
* 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.wl4g.devops.common.constants;
/**
* DevOps UMC Constants.
*
* @author Wangl.sir <[email protected]>
* @version v1.0
* @date 2018年11月13日
* @since
*/
public abstract class UMCDevOpsConstants extends DevOpsConstants {
//
// UMC admin definition.
//
/** Administrator dashboard's base URI. */
final public static String URI_ADMIN_HOME = "/dashboard";
//
// UMC receiver definition.(corresponding to agent collector)
//
/** Receiver end-point based URI */
final public static String URI_HTTP_RECEIVER_BASE = "/receiver";
/** HTTP receiver metric end-point URI.(corresponding to agent collector) */
final public static String URI_HTTP_RECEIVER_ENDPOINT = "metric";
//
// UMC alarm definition.
//
/**
* UMC Alarm template prefix key corresponding to a collector.
*/
final public static String KEY_CACHE_ALARM_TPLS = "umc_alarm_tpls_";
/**
* UMC alarm metric value in time window queue key prefix.
*/
final public static String KEY_CACHE_ALARM_METRIC_QUEUE = "umc_alarm_queue_";
/**
* Simulation UMC alarm metric value in time window queue key prefix.
*/
final public static String KEY_CACHE_ALARM_METRIC_QUEUE_SIMULATE = "umc_alarm_queue_simulate_";
/**
* KAFKA receiver metric topic pattern.(corresponding to agent collector)
*/
final public static String TOPIC_KAFKA_RECEIVE_PATTERN = "umc_agent_metrics";
//
// UMC watch definition.
//
/** Watch fetch sharding cache key. */
final public static String KEY_CACHE_FETCH_META = "umc_fetch_meta_sharding_";
//
// UMC serial store definition.(corresponding to agent collector)
//
/** tag -- id */
final public static String TAG_ID = "id";
/** tag -- disk : mount */
// final public static String TAG_DISK_MOUNT_POINT="mountPoint";
/** tag -- disk : device */
final public static String TAG_DISK_DEVICE = "device";
/** tag -- net : port */
final public static String TAG_DISK_NET_PORT = "port";
/** tag -- docker : containerId */
final public static String TAG_DOCKER_CONTAINER_ID = "containerId";
/** tag -- docker : name */
final public static String TAG_DOCKER_NAME = "name";
/** metric -- cpu */
final public static String METRIC_CPU = "basic.cpu";
/** metric -- mem : total */
final public static String METRIC_MEM_TOTAL = "basic.mem.total";
/** metric -- mem : free */
final public static String METRIC_MEM_FREE = "basic.mem.free";
/** metric -- mem : used percent */
final public static String METRIC_MEM_USED_PERCENT = "basic.mem.usedPercent";
/** metric -- mem : used */
final public static String METRIC_MEM_USED = "basic.mem.used";
/** metric -- mem cached */
final public static String METRIC_MEM_CACHE = "basic.mem.cached";
/** metric -- mem buffers */
final public static String METRIC_MEM_BUFFERS = "basic.mem.buffers";
/** metric -- disk : total */
final public static String METRIC_DISK_TOTAL = "basic.disk.total";
/** metric -- disk : free */
final public static String METRIC_DISK_FREE = "basic.disk.free";
/** metric -- disk : used */
final public static String METRIC_DISK_USED = "basic.disk.used";
/** metric -- disk : used Percent */
final public static String METRIC_DISK_USED_PERCENT = "basic.disk.usedPercent";
/** metric -- disk : inodes Physical */
final public static String METRIC_DISK_INODES_TOTAL = "basic.disk.inodesTotal";
/** metric -- disk : inodes Used */
final public static String METRIC_DISK_INODES_USED = "basic.disk.inodesUsed";
/** metric -- disk : inodes Free */
final public static String METRIC_DISK_INODES_FREE = "basic.disk.inodesFree";
/** metric -- disk : inodes Used Percent */
final public static String METRIC_DISK_INODES_USED_PERCENT = "basic.disk.inodesUsedPercent";
/** metric -- net : up */
final public static String METRIC_NET_UP = "basic.net.up";
/** metric -- net : down */
final public static String METRIC_NET_DOWN = "basic.net.down";
/** metric -- net : count */
final public static String METRIC_NET_COUNT = "basic.net.count";
/** metric -- net : estab */
final public static String METRIC_NET_ESTAB = "basic.net.estab";
/** metric -- net : closeWait */
final public static String METRIC_NET_CLOSE_WAIT = "basic.net.closeWait";
/** metric -- net : timeWait */
final public static String METRIC_NET_TIME_WAIT = "basic.net.timeWait";
/** metric -- net : close */
final public static String METRIC_NET_CLOSE = "basic.net.close";
/** metric -- net : listen */
final public static String METRIC_NET_LISTEN = "basic.net.listen";
/** metric -- net : closing */
final public static String METRIC_NET_CLOSING = "basic.net.closing";
/** metric -- docker : cpu.perc */
final public static String METRIC_DOCKER_CPU = "docker.cpu.perc";
/** metric -- docker : mem.usage */
final public static String METRIC_DOCKER_MEM_USAGE = "docker.mem.usage";
/** metric -- docker : mem.perc */
final public static String METRIC_DOCKER_MEM_PERC = "docker.mem.perc";
/** metric -- docker : net.in */
final public static String METRIC_DOCKER_NET_IN = "docker.net.in";
/** metric -- docker : net.out */
final public static String METRIC_DOCKER_NET_OUT = "docker.net.out";
/** metric -- docker : block.in */
final public static String METRIC_DOCKER_BLOCK_IN = "docker.block.in";
/** metric -- docker : block.out */
final public static String METRIC_DOCKER_BLOCK_OUT = "docker.block.out";
/* alarm limit */
final public static String ALARM_LIMIT_PHONE = "alarm_limit_phone";
final public static String ALARM_LIMIT_DINGTALK = "alarm_limit_dingtalk";
final public static String ALARM_LIMIT_FACEBOOK = "alarm_limit_facebook";
final public static String ALARM_LIMIT_TWITTER = "alarm_limit_twitter";
final public static String ALARM_LIMIT_WECHAT = "alarm_limit_wechat";
/* alarm notification contact status */
final public static String ALARM_SATUS_SEND = "1";
final public static String ALARM_SATUS_UNSEND = "2";
final public static String ALARM_SATUS_ACCEPTED = "3";
final public static String ALARM_SATUS_UNACCEPTED = "4";
} | [
"[email protected]"
] | |
b032a4b2a3fa3a74577afe431220c51da86ace0f | f36f1747678efaa2e893f20d7bb2280b62888362 | /JDBC/src/filesHandle/JsonWriter.java | 3334270b7b2895dcccdd07ded2d03c59010b6018 | [] | no_license | Abeer-Ahmad/JDBC | d49d00b09b5898022103bf61e08d35bcdf093507 | b201af407b9f7f366dc68538e94d2cd7cc3f60e5 | refs/heads/master | 2020-03-23T03:51:03.862883 | 2018-07-17T01:30:52 | 2018-07-17T01:30:52 | 141,052,419 | 0 | 0 | null | 2018-07-15T19:23:30 | 2018-07-15T19:23:30 | null | UTF-8 | Java | false | false | 3,906 | java | package filesHandle;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.io.FileWriter;
import java.io.Writer;
public class JsonWriter implements IFileWriter{
private JSON jsonMaker;
public JsonWriter(){
jsonMaker = new JSON();
}
@Override
public void write(ArrayList<LinkedHashMap<String, String>> tableMap, Path path) throws SQLException {
try{
JSONArray table = new JSONArray();
String tableName = getTableName(path);
path = Paths.get(path.toString() + File.separator + tableName + ".json");
FileWriter writer = new FileWriter(path.toFile());
for (int i=0; i < tableMap.size(); i++){
JSONObject row = new JSONObject();
row.put("row"+(i+1), tableMap.get(i));
table.add(row);
}
JSONObject all = new JSONObject();
all.put("Table", table);
all.writeJSONString(writer);
writer.flush();
writer.close();
} catch (Exception e) {
throw new SQLException(e.getMessage());
}
}
@Override
public void creatTable(Path path, ArrayList<String> fields) throws SQLException {
ArrayList<LinkedHashMap<String, String>> tableMap = new ArrayList<LinkedHashMap<String, String>>();
String tableName = getTableName(path);
Path schemaPath = Paths.get(path.toString() + File.separator + tableName + ".schema");
jsonMaker.createJSON(schemaPath, fields);
write(tableMap,path);
}
private String getTableName(Path path) {
String Path = path.toString();
int tableIndx = Path.lastIndexOf(File.separator);
String tableName = Path.substring(tableIndx + 1, Path.length());
return tableName;
}
public static void main(String args[]) throws SQLException {
LinkedHashMap<String,String> row = new LinkedHashMap<String,String>();
ArrayList<String> fieldss = new ArrayList<String>();
fieldss.add("age");
fieldss.add("int");
fieldss.add("name");
fieldss.add("varchar");
fieldss.add("num");
fieldss.add("int");
JSON json = new JSON();
Path home = Paths.get(System.getProperty("user.home") + File.separator + "DataBases" + File.separator + "zew"
+ File.separator + "1"+File.separator+"1.schema");
json.createJSON(home, fieldss);
Path path2 = Paths.get(System.getProperty("user.home") + File.separator + "DataBases" + File.separator + "zew"
+ File.separator + "1");
JsonWriter kk = new JsonWriter();
JsonReader yy = new JsonReader();
ArrayList<LinkedHashMap<String, String>> tableMap = new ArrayList<LinkedHashMap<String, String>>();
LinkedHashMap<String, String> fields = new LinkedHashMap<String, String>();
fields.put("age","22");
fields.put("name", "yass");
fields.put("num", "5");
tableMap.add(fields);
fields = new LinkedHashMap<String, String>();
fields.put("age","89");
fields.put("name", "yara");
fields.put("num", "9");
tableMap.add(fields);
kk.write(tableMap, path2);
System.out.println("jsonwriter"+yy.read(path2));
//kk.write(tableMap, path);
}
} | [
"[email protected]"
] | |
cae876c9b269f3cdcce325f9bcde3edd37ebf470 | 741062fae9eeea13cdd7bbf3df82b1b2143c4fe3 | /src/main/java/io/onepush/service/AppService.java | 0d8e2f7e5907e63a2a50015105d525d23d896d0d | [] | no_license | 0xcryptowang/one-push | d9ebf6962193ad3fefb0931481e121d9c1c1b64a | 989daf60245346d17a03d65dc8e70a627912b9c4 | refs/heads/master | 2021-10-23T14:02:25.401411 | 2016-05-13T00:23:56 | 2016-05-13T00:23:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package io.onepush.service;
import io.onepush.PushParameterException;
import io.onepush.model.Application;
import io.onepush.repository.AppRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* App服务
* Created by yaoyasong on 2016/5/11.
*/
@Service
public class AppService {
@Autowired
private AppRepository appRepository;
public Boolean validate(String appId, String appKey) {
Application app = appRepository.findOne(appId);
if (app == null) {
throw new PushParameterException("应用不存在,ID:" + appId);
}
if (!app.getAppKey().equals(appKey)) {
throw new PushParameterException("应用密钥不正确");
}
return true;
}
}
| [
"[email protected]"
] | |
01b11d69a8116e90c394a4635671ff352ad434c2 | 5b785e6e8c72ecf2086a981a79f29aaeeb8e8d6e | /sm-core/src/main/java/com/salesmanager/core/business/services/payments/PaymentServiceImpl.java | 92bbfa1b5f6b29841ae6d5270a357310bb4fb44a | [] | no_license | MacawDemos/ecommerce-demo | 29ee4e4a2beccab8b1aeaa7e2c0f3259fa3dae11 | b834a20951d5767d8e7014727ea542b1b0eb6a8e | refs/heads/master | 2021-05-10T10:35:16.908687 | 2018-01-23T12:31:21 | 2018-01-23T12:31:21 | 118,362,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,657 | java | package com.salesmanager.core.business.services.payments;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.inject.Inject;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salesmanager.core.business.constants.Constants;
import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.business.services.order.OrderService;
import com.salesmanager.core.business.services.reference.loader.ConfigurationModulesLoader;
import com.salesmanager.core.business.services.system.MerchantConfigurationService;
import com.salesmanager.core.business.services.system.ModuleConfigurationService;
import com.salesmanager.core.model.customer.Customer;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.order.Order;
import com.salesmanager.core.model.order.OrderTotal;
import com.salesmanager.core.model.order.OrderTotalType;
import com.salesmanager.core.model.order.orderstatus.OrderStatus;
import com.salesmanager.core.model.order.orderstatus.OrderStatusHistory;
import com.salesmanager.core.model.payments.CreditCardPayment;
import com.salesmanager.core.model.payments.CreditCardType;
import com.salesmanager.core.model.payments.Payment;
import com.salesmanager.core.model.payments.PaymentMethod;
import com.salesmanager.core.model.payments.PaymentType;
import com.salesmanager.core.model.payments.Transaction;
import com.salesmanager.core.model.payments.TransactionType;
import com.salesmanager.core.model.shoppingcart.ShoppingCartItem;
import com.salesmanager.core.model.system.IntegrationConfiguration;
import com.salesmanager.core.model.system.IntegrationModule;
import com.salesmanager.core.model.system.MerchantConfiguration;
import com.salesmanager.core.modules.integration.IntegrationException;
import com.salesmanager.core.modules.integration.payment.model.PaymentModule;
import com.salesmanager.core.modules.utils.Encryption;
@Service("paymentService")
public class PaymentServiceImpl implements PaymentService {
private final static String PAYMENT_MODULES = "PAYMENT";
@Inject
private MerchantConfigurationService merchantConfigurationService;
@Inject
private ModuleConfigurationService moduleConfigurationService;
@Inject
private TransactionService transactionService;
@Inject
private OrderService orderService;
@Inject
@Resource(name="paymentModules")
private Map<String,PaymentModule> paymentModules;
@Inject
private Encryption encryption;
@Override
public List<IntegrationModule> getPaymentMethods(MerchantStore store) throws ServiceException {
List<IntegrationModule> modules = moduleConfigurationService.getIntegrationModules(PAYMENT_MODULES);
List<IntegrationModule> returnModules = new ArrayList<IntegrationModule>();
for(IntegrationModule module : modules) {
if(module.getRegionsSet().contains(store.getCountry().getIsoCode())
|| module.getRegionsSet().contains("*")) {
returnModules.add(module);
}
}
return returnModules;
}
@Override
public List<PaymentMethod> getAcceptedPaymentMethods(MerchantStore store) throws ServiceException {
Map<String,IntegrationConfiguration> modules = this.getPaymentModulesConfigured(store);
List<PaymentMethod> returnModules = new ArrayList<PaymentMethod>();
for(String module : modules.keySet()) {
IntegrationConfiguration config = modules.get(module);
if(config.isActive()) {
IntegrationModule md = this.getPaymentMethodByCode(store, config.getModuleCode());
if(md==null) {
continue;
}
PaymentMethod paymentMethod = new PaymentMethod();
paymentMethod.setDefaultSelected(config.isDefaultSelected());
paymentMethod.setPaymentMethodCode(config.getModuleCode());
paymentMethod.setModule(md);
paymentMethod.setInformations(config);
PaymentType type = PaymentType.fromString(md.getType());
/**
if(md.getType().equalsIgnoreCase(PaymentType.CREDITCARD.name())) {
type = PaymentType.CREDITCARD;
} else if(md.getType().equalsIgnoreCase(PaymentType.FREE.name())) {
type = PaymentType.FREE;
} else if(md.getType().equalsIgnoreCase(PaymentType.MONEYORDER.name())) {
type = PaymentType.MONEYORDER;
} else if(md.getType().equalsIgnoreCase(PaymentType.PAYPAL.name())) {
type = PaymentType.PAYPAL;
} else if(md.getType().equalsIgnoreCase(PaymentType.STRIPE.name())) {
type = PaymentType.STRIPE;
}**/
paymentMethod.setPaymentType(type);
returnModules.add(paymentMethod);
}
}
return returnModules;
}
@Override
public IntegrationModule getPaymentMethodByType(MerchantStore store, String type) throws ServiceException {
List<IntegrationModule> modules = getPaymentMethods(store);
for(IntegrationModule module : modules) {
if(module.getModule().equals(type)) {
return module;
}
}
return null;
}
@Override
public IntegrationModule getPaymentMethodByCode(MerchantStore store,
String code) throws ServiceException {
List<IntegrationModule> modules = getPaymentMethods(store);
for(IntegrationModule module : modules) {
if(module.getCode().equals(code)) {
return module;
}
}
return null;
}
@Override
public IntegrationConfiguration getPaymentConfiguration(String moduleCode, MerchantStore store) throws ServiceException {
Map<String,IntegrationConfiguration> configuredModules = getPaymentModulesConfigured(store);
if(configuredModules!=null) {
for(String key : configuredModules.keySet()) {
if(key.equals(moduleCode)) {
return configuredModules.get(key);
}
}
}
return null;
}
@Override
public Map<String,IntegrationConfiguration> getPaymentModulesConfigured(MerchantStore store) throws ServiceException {
try {
Map<String,IntegrationConfiguration> modules = new HashMap<String,IntegrationConfiguration>();
MerchantConfiguration merchantConfiguration = merchantConfigurationService.getMerchantConfiguration(PAYMENT_MODULES, store);
if(merchantConfiguration!=null) {
if(!StringUtils.isBlank(merchantConfiguration.getValue())) {
String decrypted = encryption.decrypt(merchantConfiguration.getValue());
modules = ConfigurationModulesLoader.loadIntegrationConfigurations(decrypted);
}
}
return modules;
} catch (Exception e) {
throw new ServiceException(e);
}
}
@Override
public void savePaymentModuleConfiguration( @com.salesmanager.core.business.services.common.generic.InOut IntegrationConfiguration configuration, MerchantStore store) throws ServiceException {
//validate entries
try {
String moduleCode = configuration.getModuleCode();
PaymentModule module = (PaymentModule)paymentModules.get(moduleCode);
if(module==null) {
throw new ServiceException("Payment module " + moduleCode + " does not exist");
}
module.validateModuleConfiguration(configuration, store);
} catch (IntegrationException ie) {
throw ie;
}
try {
Map<String,IntegrationConfiguration> modules = new HashMap<String,IntegrationConfiguration>();
MerchantConfiguration merchantConfiguration = merchantConfigurationService.getMerchantConfiguration(PAYMENT_MODULES, store);
if(merchantConfiguration!=null) {
if(!StringUtils.isBlank(merchantConfiguration.getValue())) {
String decrypted = encryption.decrypt(merchantConfiguration.getValue());
modules = ConfigurationModulesLoader.loadIntegrationConfigurations(decrypted);
}
} else {
merchantConfiguration = new MerchantConfiguration();
merchantConfiguration.setMerchantStore(store);
merchantConfiguration.setKey(PAYMENT_MODULES);
}
modules.put(configuration.getModuleCode(), configuration);
String configs = ConfigurationModulesLoader.toJSONString(modules);
String encrypted = encryption.encrypt(configs);
merchantConfiguration.setValue(encrypted);
merchantConfigurationService.saveOrUpdate(merchantConfiguration);
} catch (Exception e) {
throw new ServiceException(e);
}
}
@Override
public void removePaymentModuleConfiguration(String moduleCode, MerchantStore store) throws ServiceException {
try {
Map<String,IntegrationConfiguration> modules = new HashMap<String,IntegrationConfiguration>();
MerchantConfiguration merchantConfiguration = merchantConfigurationService.getMerchantConfiguration(PAYMENT_MODULES, store);
if(merchantConfiguration!=null) {
if(!StringUtils.isBlank(merchantConfiguration.getValue())) {
String decrypted = encryption.decrypt(merchantConfiguration.getValue());
modules = ConfigurationModulesLoader.loadIntegrationConfigurations(decrypted);
}
modules.remove(moduleCode);
String configs = ConfigurationModulesLoader.toJSONString(modules);
String encrypted = encryption.encrypt(configs);
merchantConfiguration.setValue(encrypted);
merchantConfigurationService.saveOrUpdate(merchantConfiguration);
}
MerchantConfiguration configuration = merchantConfigurationService.getMerchantConfiguration(moduleCode, store);
if(configuration!=null) {//custom module
merchantConfigurationService.delete(configuration);
}
} catch (Exception e) {
throw new ServiceException(e);
}
}
@Override
public Transaction processPayment(Customer customer,
MerchantStore store, Payment payment, List<ShoppingCartItem> items, Order order)
throws ServiceException {
Validate.notNull(customer);
Validate.notNull(store);
Validate.notNull(payment);
Validate.notNull(order);
Validate.notNull(order.getTotal());
payment.setCurrency(store.getCurrency());
BigDecimal amount = order.getTotal();
//must have a shipping module configured
Map<String, IntegrationConfiguration> modules = this.getPaymentModulesConfigured(store);
if(modules==null){
throw new ServiceException("No payment module configured");
}
IntegrationConfiguration configuration = modules.get(payment.getModuleName());
if(configuration==null) {
throw new ServiceException("Payment module " + payment.getModuleName() + " is not configured");
}
if(!configuration.isActive()) {
throw new ServiceException("Payment module " + payment.getModuleName() + " is not active");
}
String sTransactionType = configuration.getIntegrationKeys().get("transaction");
if(sTransactionType==null) {
sTransactionType = TransactionType.AUTHORIZECAPTURE.name();
}
if(sTransactionType.equals(TransactionType.AUTHORIZE.name())) {
payment.setTransactionType(TransactionType.AUTHORIZE);
} else {
payment.setTransactionType(TransactionType.AUTHORIZECAPTURE);
}
PaymentModule module = this.paymentModules.get(payment.getModuleName());
if(module==null) {
throw new ServiceException("Payment module " + payment.getModuleName() + " does not exist");
}
if(payment instanceof CreditCardPayment) {
CreditCardPayment creditCardPayment = (CreditCardPayment)payment;
validateCreditCard(creditCardPayment.getCreditCardNumber(),creditCardPayment.getCreditCard(),creditCardPayment.getExpirationMonth(),creditCardPayment.getExpirationYear());
}
IntegrationModule integrationModule = getPaymentMethodByCode(store,payment.getModuleName());
TransactionType transactionType = TransactionType.valueOf(sTransactionType);
if(transactionType==null) {
transactionType = payment.getTransactionType();
if(transactionType.equals(TransactionType.CAPTURE.name())) {
throw new ServiceException("This method does not allow to process capture transaction. Use processCapturePayment");
}
}
Transaction transaction = null;
if(transactionType == TransactionType.AUTHORIZE) {
transaction = module.authorize(store, customer, items, amount, payment, configuration, integrationModule);
} else if(transactionType == TransactionType.AUTHORIZECAPTURE) {
transaction = module.authorizeAndCapture(store, customer, items, amount, payment, configuration, integrationModule);
} else if(transactionType == TransactionType.INIT) {
transaction = module.initTransaction(store, customer, amount, payment, configuration, integrationModule);
}
if(transactionType != TransactionType.INIT) {
transactionService.create(transaction);
}
if(transactionType == TransactionType.AUTHORIZECAPTURE) {
order.setStatus(OrderStatus.ORDERED);
if(payment.getPaymentType().name()!=PaymentType.MONEYORDER.name()) {
order.setStatus(OrderStatus.PROCESSED);
}
}
return transaction;
}
@Override
public PaymentModule getPaymentModule(String paymentModuleCode) throws ServiceException {
return paymentModules.get(paymentModuleCode);
}
@Override
public Transaction processCapturePayment( Order order, Customer customer,
MerchantStore store)
throws ServiceException {
Validate.notNull(customer);
Validate.notNull(store);
Validate.notNull(order);
//must have a shipping module configured
Map<String, IntegrationConfiguration> modules = this.getPaymentModulesConfigured(store);
if(modules==null){
throw new ServiceException("No payment module configured");
}
IntegrationConfiguration configuration = modules.get(order.getPaymentModuleCode());
if(configuration==null) {
throw new ServiceException("Payment module " + order.getPaymentModuleCode() + " is not configured");
}
if(!configuration.isActive()) {
throw new ServiceException("Payment module " + order.getPaymentModuleCode() + " is not active");
}
PaymentModule module = this.paymentModules.get(order.getPaymentModuleCode());
if(module==null) {
throw new ServiceException("Payment module " + order.getPaymentModuleCode() + " does not exist");
}
IntegrationModule integrationModule = getPaymentMethodByCode(store,order.getPaymentModuleCode());
//TransactionType transactionType = payment.getTransactionType();
//get the previous transaction
Transaction trx = transactionService.getCapturableTransaction(order);
if(trx==null) {
throw new ServiceException("No capturable transaction for order id " + order.getId());
}
Transaction transaction = module.capture(store, customer, order, trx, configuration, integrationModule);
transaction.setOrder(order);
transactionService.create(transaction);
OrderStatusHistory orderHistory = new OrderStatusHistory();
orderHistory.setOrder(order);
orderHistory.setStatus(OrderStatus.PROCESSED);
orderHistory.setDateAdded(new Date());
orderService.addOrderStatusHistory(order, orderHistory);
order.setStatus(OrderStatus.PROCESSED);
orderService.saveOrUpdate(order);
return transaction;
}
@Override
public Transaction processRefund( Order order, Customer customer,
MerchantStore store, BigDecimal amount)
throws ServiceException {
Validate.notNull(customer);
Validate.notNull(store);
Validate.notNull(amount);
Validate.notNull(order);
Validate.notNull(order.getOrderTotal());
BigDecimal orderTotal = order.getTotal();
if(amount.doubleValue()>orderTotal.doubleValue()) {
throw new ServiceException("Invalid amount, the refunded amount is greater than the total allowed");
}
String module = order.getPaymentModuleCode();
Map<String, IntegrationConfiguration> modules = this.getPaymentModulesConfigured(store);
if(modules==null){
throw new ServiceException("No payment module configured");
}
IntegrationConfiguration configuration = modules.get(module);
if(configuration==null) {
throw new ServiceException("Payment module " + module + " is not configured");
}
PaymentModule paymentModule = this.paymentModules.get(module);
if(paymentModule==null) {
throw new ServiceException("Payment module " + paymentModule + " does not exist");
}
boolean partial = false;
if(amount.doubleValue()!=order.getTotal().doubleValue()) {
partial = true;
}
IntegrationModule integrationModule = getPaymentMethodByCode(store,module);
//get the associated transaction
Transaction refundable = transactionService.getRefundableTransaction(order);
if(refundable==null) {
throw new ServiceException("No refundable transaction for this order");
}
Transaction transaction = paymentModule.refund(partial, store, refundable, order, amount, configuration, integrationModule);
transaction.setOrder(order);
transactionService.create(transaction);
OrderTotal refund = new OrderTotal();
refund.setModule(Constants.OT_REFUND_MODULE_CODE);
refund.setText(Constants.OT_REFUND_MODULE_CODE);
refund.setTitle(Constants.OT_REFUND_MODULE_CODE);
refund.setOrderTotalCode(Constants.OT_REFUND_MODULE_CODE);
refund.setOrderTotalType(OrderTotalType.REFUND);
refund.setValue(amount);
refund.setSortOrder(100);
refund.setOrder(order);
order.getOrderTotal().add(refund);
//update order total
orderTotal = orderTotal.subtract(amount);
//update ordertotal refund
Set<OrderTotal> totals = order.getOrderTotal();
for(OrderTotal total : totals) {
if(total.getModule().equals(Constants.OT_TOTAL_MODULE_CODE)) {
total.setValue(orderTotal);
}
}
order.setTotal(orderTotal);
order.setStatus(OrderStatus.REFUNDED);
OrderStatusHistory orderHistory = new OrderStatusHistory();
orderHistory.setOrder(order);
orderHistory.setStatus(OrderStatus.REFUNDED);
orderHistory.setDateAdded(new Date());
order.getOrderHistory().add(orderHistory);
orderService.saveOrUpdate(order);
return transaction;
}
@Override
public void validateCreditCard(String number, CreditCardType creditCard, String month, String date)
throws ServiceException {
try {
Integer.parseInt(month);
Integer.parseInt(date);
} catch (NumberFormatException nfe) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid date format","messages.error.creditcard.dateformat");
throw ex;
}
if (StringUtils.isBlank(number)) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
Matcher m = Pattern.compile("[^\\d\\s.-]").matcher(number);
if (m.find()) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
Matcher matcher = Pattern.compile("[\\s.-]").matcher(number);
number = matcher.replaceAll("");
validateCreditCardDate(Integer.parseInt(month), Integer.parseInt(date));
validateCreditCardNumber(number, creditCard);
}
private void validateCreditCardDate(int m, int y) throws ServiceException {
java.util.Calendar cal = new java.util.GregorianCalendar();
int monthNow = cal.get(java.util.Calendar.MONTH) + 1;
int yearNow = cal.get(java.util.Calendar.YEAR);
if (yearNow > y) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid date format","messages.error.creditcard.dateformat");
throw ex;
}
// OK, change implementation
if (yearNow == y && monthNow > m) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid date format","messages.error.creditcard.dateformat");
throw ex;
}
}
@Deprecated
/**
* Use commons validator CreditCardValidator
* @param number
* @param creditCard
* @throws ServiceException
*/
private void validateCreditCardNumber(String number, CreditCardType creditCard)
throws ServiceException {
//TODO implement
if(CreditCardType.MASTERCARD.equals(creditCard.name())) {
if (number.length() != 16
|| Integer.parseInt(number.substring(0, 2)) < 51
|| Integer.parseInt(number.substring(0, 2)) > 55) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
if(CreditCardType.VISA.equals(creditCard.name())) {
if ((number.length() != 13 && number.length() != 16)
|| Integer.parseInt(number.substring(0, 1)) != 4) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
if(CreditCardType.AMEX.equals(creditCard.name())) {
if (number.length() != 15
|| (Integer.parseInt(number.substring(0, 2)) != 34 && Integer
.parseInt(number.substring(0, 2)) != 37)) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
if(CreditCardType.DINERS.equals(creditCard.name())) {
if (number.length() != 14
|| ((Integer.parseInt(number.substring(0, 2)) != 36 && Integer
.parseInt(number.substring(0, 2)) != 38)
&& Integer.parseInt(number.substring(0, 3)) < 300 || Integer
.parseInt(number.substring(0, 3)) > 305)) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
if(CreditCardType.DISCOVERY.equals(creditCard.name())) {
if (number.length() != 16
|| Integer.parseInt(number.substring(0, 5)) != 6011) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
luhnValidate(number);
}
// The Luhn algorithm is basically a CRC type
// system for checking the validity of an entry.
// All major credit cards use numbers that will
// pass the Luhn check. Also, all of them are based
// on MOD 10.
@Deprecated
private void luhnValidate(String numberString)
throws ServiceException {
char[] charArray = numberString.toCharArray();
int[] number = new int[charArray.length];
int total = 0;
for (int i = 0; i < charArray.length; i++) {
number[i] = Character.getNumericValue(charArray[i]);
}
for (int i = number.length - 2; i > -1; i -= 2) {
number[i] *= 2;
if (number[i] > 9)
number[i] -= 9;
}
for (int i = 0; i < number.length; i++)
total += number[i];
if (total % 10 != 0) {
ServiceException ex = new ServiceException(ServiceException.EXCEPTION_VALIDATION,"Invalid card number","messages.error.creditcard.number");
throw ex;
}
}
}
| [
"[email protected]"
] | |
6bf6bc732ecb7694a23e6cbefafb33c32c02045c | 3eaaf0e53b4ea471df8493d86414209c4bd11ab3 | /swd/src/main/java/com/swd/app/coffee/service/impl/CoffeeServiceImpl.java | e996e836777e5ca2868f9639dece04bb37300720 | [] | no_license | sdy296600/SWD | 5840e9803b9823453f5e082c5f29c9ffd9ea882b | 1a80c3c7652b43155fd0fd044a9bd65461c80926 | refs/heads/main | 2023-08-07T03:03:05.787351 | 2021-09-25T08:34:03 | 2021-09-25T08:34:03 | 410,194,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,206 | java | package com.swd.app.coffee.service.impl;
import java.util.List;
import com.swd.app.coffee.service.CoffeeService;
import com.swd.app.coffee.service.CoffeeVO;
public class CoffeeServiceImpl implements CoffeeService {
@Override
public List<CoffeeVO> coffeeList(CoffeeVO vo) {
// TODO Auto-generated method stub
return null;
}
@Override
public void createCoffee(List<CoffeeVO> createdRows) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void updateCoffee(List<CoffeeVO> updatedRows) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void deleteCoffee(List<CoffeeVO> deletedRows) throws Exception {
// TODO Auto-generated method stub
}
@Override
public List<CoffeeVO> coffeInfoList(CoffeeVO vo) {
// TODO Auto-generated method stub
return null;
}
@Override
public void createInfo(List<CoffeeVO> createdRows) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void updateInfo(List<CoffeeVO> updatedRows) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void deleteInfo(List<CoffeeVO> deletedRows) throws Exception {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
a04c181640ea75a3e90afb603c86c5e356843dc1 | e8bdd57edc0b70169711bce0cbd75316d7b922fa | /services/hrdb/src/com/auto_xjqgvfkoug/hrdb/service/HrdbProcedureExecutorService.java | 614c5f0bb3aa3416c80b68424232eecf370c270e | [] | no_license | wavemakerapps/Auto_xJQGvfkOuG | c46c2fe86399eb4f67a9043fa8509bb26c3f5797 | df430ad564ec562011d33883d06b35037db09200 | refs/heads/master | 2020-03-07T02:28:39.406461 | 2018-03-28T23:26:11 | 2018-03-28T23:26:11 | 127,209,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | /*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved.
This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with wavemaker.com*/
package com.auto_xjqgvfkoug.hrdb.service;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
public interface HrdbProcedureExecutorService {
}
| [
"[email protected]"
] | |
7e40e804a773388655fb4a3354565ed41753ccc5 | f558cc901adbd26ae96e59294f01ee264f8d5688 | /multiple-database-sample/src/main/java/com/glp/data/warehouse/entity/dw/risk/GlpRuleResult.java | 2932e3e6f822897f7a6ea1da58d2ab36bf801878 | [] | no_license | yousiyuan/dev-utility-project | fb55fff6e59a33f75c2f4014476b78a9881f61a7 | bd0b2633675c26c2fbe305318658afc1d38f9200 | refs/heads/master | 2022-07-09T10:52:06.090370 | 2019-12-11T18:13:55 | 2019-12-11T18:13:55 | 227,431,975 | 0 | 0 | null | 2022-06-21T02:25:42 | 2019-12-11T18:20:19 | Java | UTF-8 | Java | false | false | 7,980 | java | package com.glp.data.warehouse.entity.dw.risk;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Table(name = "glp_rule_result")
public class GlpRuleResult implements Serializable {
/**
* 主键id
*/
@Id
private Integer id;
/**
* 查询编号
*/
@Column(name = "search_code")
private String searchCode;
/**
* 客户Id
*/
@Column(name = "cust_id")
private String custId;
/**
* 项目大类
*/
private String type;
/**
* 数据来源
*/
private String source;
/**
* 项目小类
*/
@Column(name = "project_type")
private String projectType;
/**
* 预警规则
*/
@Column(name = "project_sub_type")
private String projectSubType;
/**
* 是否命中
*/
@Column(name = "is_hit")
private String isHit;
/**
* 规则编号
*/
@Column(name = "rule_code")
private String ruleCode;
/**
* 规则Id
*/
@Column(name = "rule_id")
private String ruleId;
private String result;
/**
* 查询时间
*/
@Column(name = "search_time")
private String searchTime;
/**
* 创建人
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "created_at")
private Date createdAt;
/**
* 修改人
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 修改时间
*/
@Column(name = "updated_at")
private Date updatedAt;
/**
* 版本号
*/
private Integer version;
/**
* 客户名称
*/
@Column(name = "cust_name")
private String custName;
/**
* 获取主键id
*
* @return id - 主键id
*/
public Integer getId() {
return id;
}
/**
* 设置主键id
*
* @param id 主键id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取查询编号
*
* @return search_code - 查询编号
*/
public String getSearchCode() {
return searchCode;
}
/**
* 设置查询编号
*
* @param searchCode 查询编号
*/
public void setSearchCode(String searchCode) {
this.searchCode = searchCode == null ? null : searchCode.trim();
}
/**
* 获取客户Id
*
* @return cust_id - 客户Id
*/
public String getCustId() {
return custId;
}
/**
* 设置客户Id
*
* @param custId 客户Id
*/
public void setCustId(String custId) {
this.custId = custId == null ? null : custId.trim();
}
/**
* 获取项目大类
*
* @return type - 项目大类
*/
public String getType() {
return type;
}
/**
* 设置项目大类
*
* @param type 项目大类
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* 获取数据来源
*
* @return source - 数据来源
*/
public String getSource() {
return source;
}
/**
* 设置数据来源
*
* @param source 数据来源
*/
public void setSource(String source) {
this.source = source == null ? null : source.trim();
}
/**
* 获取项目小类
*
* @return project_type - 项目小类
*/
public String getProjectType() {
return projectType;
}
/**
* 设置项目小类
*
* @param projectType 项目小类
*/
public void setProjectType(String projectType) {
this.projectType = projectType == null ? null : projectType.trim();
}
/**
* 获取预警规则
*
* @return project_sub_type - 预警规则
*/
public String getProjectSubType() {
return projectSubType;
}
/**
* 设置预警规则
*
* @param projectSubType 预警规则
*/
public void setProjectSubType(String projectSubType) {
this.projectSubType = projectSubType == null ? null : projectSubType.trim();
}
/**
* 获取是否命中
*
* @return is_hit - 是否命中
*/
public String getIsHit() {
return isHit;
}
/**
* 设置是否命中
*
* @param isHit 是否命中
*/
public void setIsHit(String isHit) {
this.isHit = isHit == null ? null : isHit.trim();
}
/**
* 获取规则编号
*
* @return rule_code - 规则编号
*/
public String getRuleCode() {
return ruleCode;
}
/**
* 设置规则编号
*
* @param ruleCode 规则编号
*/
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode == null ? null : ruleCode.trim();
}
/**
* 获取规则Id
*
* @return rule_id - 规则Id
*/
public String getRuleId() {
return ruleId;
}
/**
* 设置规则Id
*
* @param ruleId 规则Id
*/
public void setRuleId(String ruleId) {
this.ruleId = ruleId == null ? null : ruleId.trim();
}
/**
* @return result
*/
public String getResult() {
return result;
}
/**
* @param result
*/
public void setResult(String result) {
this.result = result == null ? null : result.trim();
}
/**
* 获取查询时间
*
* @return search_time - 查询时间
*/
public String getSearchTime() {
return searchTime;
}
/**
* 设置查询时间
*
* @param searchTime 查询时间
*/
public void setSearchTime(String searchTime) {
this.searchTime = searchTime == null ? null : searchTime.trim();
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_at - 创建时间
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* 设置创建时间
*
* @param createdAt 创建时间
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_at - 修改时间
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* 设置修改时间
*
* @param updatedAt 修改时间
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* 获取版本号
*
* @return version - 版本号
*/
public Integer getVersion() {
return version;
}
/**
* 设置版本号
*
* @param version 版本号
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* 获取客户名称
*
* @return cust_name - 客户名称
*/
public String getCustName() {
return custName;
}
/**
* 设置客户名称
*
* @param custName 客户名称
*/
public void setCustName(String custName) {
this.custName = custName == null ? null : custName.trim();
}
} | [
"[email protected]"
] | |
67c32f3d48673ccc09e3a075ccb961feb2ad6379 | 2a3f19a4a2b91d9d715378aadb0b1557997ffafe | /sources/com/amap/api/mapcore2d/IUiSettingsDelegate.java | fca23c869281d2f91fb6d613e700483f146b504f | [] | no_license | amelieko/McDonalds-java | ce5062f863f7f1cbe2677938a67db940c379d0a9 | 2fe00d672caaa7b97c4ff3acdb0e1678669b0300 | refs/heads/master | 2022-01-09T22:10:40.360630 | 2019-04-21T14:47:20 | 2019-04-21T14:47:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,434 | java | package com.amap.api.mapcore2d;
import android.os.RemoteException;
/* renamed from: com.amap.api.mapcore2d.ak */
public interface IUiSettingsDelegate {
/* renamed from: a */
void mo9714a(int i) throws RemoteException;
/* renamed from: a */
void mo9715a(boolean z) throws RemoteException;
/* renamed from: a */
boolean mo9716a() throws RemoteException;
/* renamed from: b */
void mo9717b(int i) throws RemoteException;
/* renamed from: b */
void mo9718b(boolean z) throws RemoteException;
/* renamed from: b */
boolean mo9719b() throws RemoteException;
/* renamed from: c */
void mo9720c(boolean z) throws RemoteException;
/* renamed from: c */
boolean mo9721c() throws RemoteException;
/* renamed from: d */
void mo9722d(boolean z) throws RemoteException;
/* renamed from: d */
boolean mo9723d() throws RemoteException;
/* renamed from: e */
void mo9724e(boolean z) throws RemoteException;
/* renamed from: e */
boolean mo9725e() throws RemoteException;
/* renamed from: f */
void mo9726f(boolean z) throws RemoteException;
/* renamed from: f */
boolean mo9727f() throws RemoteException;
/* renamed from: g */
int mo9728g() throws RemoteException;
/* renamed from: g */
void mo9729g(boolean z) throws RemoteException;
/* renamed from: h */
int mo9730h() throws RemoteException;
}
| [
"[email protected]"
] | |
f489285cc7c749c63440369276740c0673b92871 | f49b1ccf8772c621a334feed475e00eb7ee303d5 | /src/main/java/p1/CricketCoach.java | ead8d7c5d2c4e428a2138de6554fb8f5a9dd52cf | [] | no_license | tejashegde/SpringTutorials | 8533c0d3fcdaed733924a39e27042caa65b5742e | 7d1330841c31e8efc74d518b97a9414549020114 | refs/heads/master | 2021-05-04T15:20:33.776804 | 2018-02-04T21:34:16 | 2018-02-04T21:34:16 | 120,225,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 693 | java | package p1;
public class CricketCoach implements Coach {
public CricketCoach(CricketFortune cricketFortune) {
super();
this.cricketFortune = cricketFortune;
}
private CricketFortune cricketFortune;
public String getDailyWorkout() {
// TODO Auto-generated method stub
return "Run cricket field for 10 mins";
}
public String getFortune() {
// TODO Auto-generated method stub
return cricketFortune.getFortune();
}
//init & destroy methods in a bean must always be public void
public void initMethod() {
System.out.println("This is from the init methiod!!");
}
public void destroyMethod() {
System.out.println("This is from the destroy method!!");
}
}
| [
"[email protected]"
] | |
021880420f95f30a54065c223a593039033db2ff | 2094a70cf0d9bb084c00321c3bfb2fbaddf33328 | /ShareAppSource/app/src/androidTest/java/shareapp/vsshv/com/shareapp/ExampleInstrumentedTest.java | a2e0f81bccf2dcb662bfb75c5a291d6780ea8c84 | [] | no_license | rajubhusani/ShareApp | 10f4128880729b94a0e736dc3582b937ed206238 | ac2314287ba23326c78b06073a8f244e115b4c4c | refs/heads/master | 2020-07-23T19:29:32.437223 | 2016-09-02T06:12:11 | 2016-09-02T06:12:11 | 66,945,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package shareapp.vsshv.com.shareapp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("shareapp.vsshv.com.shareapp", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
1390d9fc82f484bbf1fd5e61c409786de2128c4e | efb9f0394a106a002a8dba011109eebfd4c103c9 | /src/main/java/com/mashibing/controller/base/TblRoleMenuPriviController.java | dbe7fe925f3d3d01abbd84e92e848181d4956a11 | [] | no_license | JackWuB-xican/family_service_platform | db2a3143807cf9441d17a8d60c6afc809d9c5e01 | b5ce0b9a65986f86fdf0cd0b5aa7a3299655e3c1 | refs/heads/master | 2023-08-08T04:53:36.528764 | 2021-09-13T03:56:23 | 2021-09-13T03:56:23 | 405,822,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.mashibing.controller.base;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
* 角色菜单权限 前端控制器
* </p>
*
* @author wu
* @since 2021-05-13
*/
@Controller
@RequestMapping("/tblRoleMenuPrivi")
public class TblRoleMenuPriviController {
}
| [
"[email protected]"
] | |
e0b985682d6a20cff27074c173b030cb83c69580 | 3cebd62ae091c6dd436b174f33a68826a7391c22 | /src/model/entities/Client.java | 4b8deb260bddd8aca1ef7420a69bb0d995462bcd | [] | no_license | vinicius-coder/cursoJava | 70600cb97e99de198718647627cb6623ad8f474c | 68636afb8c506f621d56a86289c19fd808d721c5 | refs/heads/master | 2022-04-11T22:27:41.804320 | 2020-04-03T23:27:07 | 2020-04-03T23:27:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package model.entities;
public class Client {
//private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
private String name;
private String email;
public Client() {
}
public Client(String name, String email) {
super();
this.name = name;
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"[email protected]"
] | |
488c36114749a3434b7ff08bb27d6d8d0f7a4766 | 001e7e3507ed222a850ad694f0870bf7a5eb23d6 | /louter-compiler/src/main/java/com/luolc/louter/compiler/NavigationParam.java | 245fe632a5e4343af1ef2fe612a3f6c582ee5c4f | [
"MIT"
] | permissive | Luolc/Louter | 99e722c65c2cf9aa8bb88c8a4bbfe042251cdd67 | 00832d9da5d8de2ae6284a9c27f45e87ed12d67b | refs/heads/master | 2021-01-12T01:38:19.597611 | 2017-04-07T18:20:08 | 2017-04-07T18:20:08 | 78,413,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2016-2017 Luolc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.luolc.louter.compiler;
import com.squareup.javapoet.TypeName;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.Name;
import javax.lang.model.type.DeclaredType;
/**
* @author LuoLiangchen
* @since 2017/1/11
*/
final class NavigationParam {
private final String mKey;
private final TypeName mParamType;
private final boolean mRequired;
NavigationParam(final String key, final TypeName paramType, final boolean required) {
mKey = key;
mParamType = paramType;
mRequired = required;
}
public String getKey() {
return mKey;
}
public boolean isRequired() {
return mRequired;
}
public TypeName getParamType() {
return mParamType;
}
static boolean isRequiredParam(final Element element) {
return !hasAnnotationWithName(element, "Nullable");
}
private static boolean hasAnnotationWithName(final Element element, final String simpleName) {
return element.getAnnotationMirrors().stream()
.map(AnnotationMirror::getAnnotationType)
.map(DeclaredType::asElement)
.map(Element::getSimpleName)
.map(Name::toString)
.anyMatch(simpleName::equals);
}
}
| [
"[email protected]"
] | |
c9c2858eedb5e6b3f43a07bf1caddd4fc42b12e9 | ca4d738e86162222d051c22e31f579fbde7fb9c4 | /src/main/java/mx/ourpodcast/exceptions/ChatAlreadyExistsException.java | 55a785ae66983a506788d33d0d506bf89d0060e9 | [] | no_license | jiaccanche/proyecto_nube | fc2d50d39bbcd020eeb28409b24175609d7b7ae8 | cec721f8dea9642e23ce227bf2ad6d90be654984 | refs/heads/master | 2022-03-27T09:18:58.108096 | 2019-12-04T00:34:51 | 2019-12-04T00:34:51 | 209,867,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package mx.ourpodcast.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
public class ChatAlreadyExistsException extends RuntimeException{
public ChatAlreadyExistsException(String message){
super(message);
}
}
| [
"[email protected]"
] | |
dc8fa9cd199a360a034ba71fd709da9208cdf607 | 6647dd9c9595142ef19a480e90ce540aba6a55ff | /source/src/main/java/mile/com/week1/LRUCache.java | 0e8dda9b452bb59cc8602a0ac12437bfb67b8e48 | [] | no_license | hyzhaolt/algorithm014-algorithm014 | 02750af058ad8ea1eaff74c14e1d35af25ac3806 | fe33224b2bab4a35120685d1fd11f265728145a1 | refs/heads/master | 2023-01-09T01:07:51.014089 | 2020-11-03T08:01:43 | 2020-11-03T08:01:43 | 287,167,737 | 0 | 0 | null | 2020-08-13T03:02:18 | 2020-08-13T03:02:17 | null | UTF-8 | Java | false | false | 5,302 | java | package mile.com.week1;
import java.util.HashMap;
/**
* Created by zhaofengying on 2020/8/16.
*/
class LRUCache {
private HashMap<Integer, Node> indexMap = null;
private Integer capacity = 0;
private Node head = null;
private Node tail = null;
/**
* 初始化一个指定容量大小的缓存队列
*
* @param capacity
*/
LRUCache(Integer capacity) {
this.indexMap = new HashMap<>();
this.capacity = capacity;
head = new Node();
tail = new Node();
head.next = tail;
head.pre = null;
tail.pre = head;
tail.next = null;
}
/**
* 向缓存中放一个指定的key,value
* 1.先从indexMap中查找key是否存在 若存在 则将indexMap.get(key)节点从原来位置删除掉 更新为最新的value值 并插入到队列末尾 返回
* 2.若不存在 先判断是否已超限 不超限 直接在末尾插入新节点 返回
* 3.若不存在 且已超限 则删除头节点 并在末尾插入新节点 返回
*
* @param key
* @param value
* @return
*/
public void put(Integer key, Integer value) {
if (capacity <= 0) {
return ;
}
//1.当前key已经存在
if (this.indexMap.containsKey(key)) {
//先将此节点删除 再将此节点添加到队列末尾
Node currNode = indexMap.get(key);
//更新最新的value值
currNode.setValue(value);
//先删除节点
boolean delRet = delete(null,currNode);
if (!delRet) {
return ;
}
//再在队列末尾添加此节点
addLast(currNode);
}
//2.当前key不存在 则需要新建一个node
Node aNewNode = new Node();
indexMap.put(key, aNewNode);
aNewNode.setKey(key);
aNewNode.setValue(value);
//2.1缓存容量未超限 直接在队列末尾添加当前节点
if (this.indexMap.size() <= this.capacity) {
addLast(aNewNode);
return;
}
//2.2缓存容量已超限 先删除头节点 再插入到队列末尾
Node currNode = indexMap.get(key);
Node firstNode = head.next;
boolean delRet = delete(firstNode.getKey(),firstNode);
if (!delRet) {
return;
}
addLast(currNode);
}
/**
* 查询缓存值
* 1.key不存在 直接返回-1
* 2.key存在 将当前位置的node删除 并插入到队列的末尾(如果当前已经在末尾位置 则不做任何操作)
*
* @param key
* @return
*/
public Integer get(Integer key) {
if (!indexMap.containsKey(key)) {
return -1;
}
Node node = indexMap.get(key);
//如果当前节点已经在队列末尾了 则直接返回value
if (tail.pre == node) {
return node.getValue();
}
//get的时候 只是改变节点的位置 而不做节点真正的删除
boolean delRet = this.delete(null,node);
if (!delRet) {
return -1;
}
this.addLast(node);
return node.getValue();
}
class Node {
public Integer key;
public Integer value;
public Node pre;
public Node next;
public Integer getKey() {
return key;
}
public void setKey(Integer key) {
this.key = key;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public Node getPre() {
return pre;
}
public void setPre(Node pre) {
this.pre = pre;
}
public Node getNext() {
return next;
}
public void setNext(Node next) {
this.next = next;
}
}
/**
* 删除指定的节点 同时从hashMap中删除
* @param key
* @param node
* @return
*/
private boolean delete(Integer key,Node node) {
if (null == node) {
return false;
}
//删除节点的同时 从索引map中删除
if(null != key){
indexMap.remove(key);
}
node.pre.next = node.next;
node.next.pre = node.pre;
node.pre = null;
node.next = null;
return true;
}
/**
* 将指定的节点添加到队列末尾
*
* @param node
*/
private boolean addLast(Node node) {
node.pre = this.tail.pre;
tail.pre.next = node;
node.next = tail;
tail.pre = node;
return true;
}
public static void main(String[] args){
try{
LRUCache cache = new LRUCache(2);
cache.put(1,1);
cache.put(2,2);
System.out.println(cache.get(1));
cache.put(3,3);
System.out.println(cache.get(2));
cache.put(4,4);
System.out.println(cache.get(1));
System.out.println(cache.get(3));
System.out.println(cache.get(4));
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
5017b25d1e4039f9b89da5a1addaddee7f8c7f68 | 0c6f5714c87531c106007175d54c54dedc4acd3e | /app/src/main/java/com/kolosik/Student_Wyniki_Adapter.java | 7345a660e7c4bad795a73fa763006400bfc044cc | [] | no_license | mateusz77/Kolosik | 5c95c33b9596f4061f7cbbd8cd8c1c94cbe8a315 | 42aeef88d7365ab46de683e5e8a36458f3a2d016 | refs/heads/master | 2020-03-18T01:51:36.314330 | 2018-05-20T15:53:42 | 2018-05-20T15:53:42 | 134,163,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,098 | java | package com.kolosik;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
/**
* Created by Ciasteczko on 18/05/2018.
*/
public class Student_Wyniki_Adapter extends RecyclerView.Adapter<Student_Wyniki_Adapter.ProductViewHolder> {
private Context mCtx;
private List<Student_Wyniki> productList;
public Student_Wyniki_Adapter(Context mCtx, List<Student_Wyniki> productList) {
this.mCtx = mCtx;
this.productList = productList;
}
@Override
public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(mCtx);
View view = inflater.inflate(R.layout.wynikireeeee, null);
return new ProductViewHolder(view);
}
@Override
public void onBindViewHolder(ProductViewHolder holder, int position) {
Student_Wyniki product = productList.get(position);
holder.textViewTitle.setText(product.getImie());
holder.textViewShortDesc.setText(product.getNazwisko());
holder.textViewRating.setText(String.valueOf(product.getPunkty()));
holder.textViewPrice.setText(String.valueOf(product.getKlasa()));
}
@Override
public int getItemCount( ) {
return productList.size();
}
class ProductViewHolder extends RecyclerView.ViewHolder {
TextView textViewTitle, textViewShortDesc, textViewRating, textViewPrice;
ImageView imageView;
public ProductViewHolder(View itemView) {
super(itemView);
textViewTitle = itemView.findViewById(R.id.textView_Title);
textViewShortDesc = itemView.findViewById(R.id.textView_odpA);
textViewRating = itemView.findViewById(R.id.textViewRating);
textViewPrice = itemView.findViewById(R.id.textViewPrice);
imageView = itemView.findViewById(R.id.imageView);
}
}
}
| [
"[email protected]"
] | |
4cbfbdf3afef834e2b18988b40d69f5a399d2b1e | 342cf4b7a9567b9427ca2f55498788f83b052a48 | /app/src/main/java/com/matech/csrcall/detectcall7/DeviceAdminDemo.java | 791805e1bfadbfdc7443169d37274fc01d52b191 | [] | no_license | shoaibuddin12fx/DetectCall7 | 65f920a5d2a03c02c0812c789a58d62f9e00f2bd | fcf9380b7262f2816c7cd28e95f066291b70a6ed | refs/heads/master | 2021-01-18T11:30:10.053330 | 2016-05-11T10:20:52 | 2016-05-11T10:20:52 | 58,534,928 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | package com.matech.csrcall.detectcall7;
import android.app.admin.DeviceAdminReceiver;
import android.content.Intent;
import android.content.Context;
/**
* Created by shoaib on 5/7/2016.
*/
public class DeviceAdminDemo extends DeviceAdminReceiver {
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
}
public void onEnabled(Context context, Intent intent) {
};
public void onDisabled(Context context, Intent intent) {
};
}
| [
"[email protected]"
] | |
ead3f673217557c28da0da36bfb92b95f886c89a | 78f1c7a0924b598a9952770fb7b72286aa8bfaf1 | /src/Clases/Intentos.java | 8efb5981af65596bd1a0c35897ae7e00f2bf3cf1 | [] | no_license | marinaCarrizo/AdivinaElNumero | cad9b18a153ae7055269cac85b8a9222ae832a02 | c3aee227d26413c4b925069e934ad8f7f8a90786 | refs/heads/master | 2020-05-20T16:48:27.992743 | 2019-05-08T19:59:56 | 2019-05-08T19:59:56 | 185,673,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,193 | 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 Clases;
import java.util.Scanner;
/**
*
* @author Marina
*/
public class Intentos {
private int regular;
private int coinciden;
NumeroAleatorio numAleatorio;
public Intentos() {
}
public int getRegular() {
return regular;
}
public void setRegular(int regular) {
this.regular = regular;
}
public int getCoinciden() {
return coinciden;
}
public void setCoinciden(int coinciden) {
this.coinciden = coinciden;
}
public NumeroAleatorio getNumAleatorio() {
return numAleatorio;
}
public void setNumAleatorio(NumeroAleatorio numAleatorio) {
this.numAleatorio = numAleatorio;
}
public int teclado() {
int numero;
do {
System.out.println("Ingrese un numero de 4 dígitos");
Scanner reader = new Scanner(System.in);
numero = reader.nextInt();
if (Integer.toString(numero).length() > 4) {
System.out.println("Incorrecto");
}
} while (Integer.toString(numero).length() > 4);
return numero;
}
public void coincidencias(int numero, NumeroAleatorio aleato) {
coinciden = 0;
String num = Integer.toString(numero);
String aleatorio = aleato.getNumAleatorio();
for (int i = 0; i < num.length(); i++) {
if (num.charAt(i) == aleatorio.charAt(i)) {
coinciden++;
}
}
System.out.println("Coincidencias: " + coinciden);
}
public void regulares(int numero, NumeroAleatorio aleato) {
regular = 0;
String num = Integer.toString(numero);
String aleatorio = aleato.getNumAleatorio();
for (int i = 0; i < aleatorio.length(); i++) {
if (num.charAt(i) != aleatorio.charAt(i) && num.indexOf(aleatorio.charAt(i)) > -1) {
regular++;
}
}
System.out.println("Regulares: " + regular);
}
}
| [
"[email protected]"
] | |
379c54fa2f0772907c9c7699e49f5a5df9f03b36 | 763d3d08ba57f62843a621e82995ade6474d36b2 | /Eva1_9_Listas/app/src/main/java/com/example/eva1_9_listas/MainActivity.java | 6c7893c056faa93f68104d1776944239c3727f2e | [] | no_license | Ironfart/APPS1_EVA1 | 9b23d435fc9cdadef5534e9e888dc514e0058cf9 | 4dcea3b0b6f193a060681b06fcab08d86809b299 | refs/heads/master | 2020-08-01T12:21:18.914269 | 2019-09-28T18:32:54 | 2019-09-28T18:32:54 | 210,995,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | java | package com.example.eva1_9_listas;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements ListView.OnItemClickListener {
ListView lstDatos;
TextView txtRst;
String[] asRest = {
"Montados la junta",
"Montados de villa",
"Taco 'n madres",
"El Tacón Milenario",
"Deli Burgers",
"Tortas Don Fermín",
"Burros El Escuadrón",
"Doña Pelos",
"Steak House",
"Las Espadas",
"C19",
"Chiwas",
"Gelos",
"El Borrego",
"Tortas El Buen Gusto",
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lstDatos = findViewById(R.id.lstListDatos);
txtRst = findViewById(R.id.txtRest);
lstDatos.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,asRest));
lstDatos.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int pos, long id) {
txtRst.setText(asRest[pos]);
}
}
| [
"[email protected]"
] | |
b3b36dba26c7af9ce0e8982af94cb3d483336efa | 50e881b5a0fd2e51c81f84e63f756ed50528c40a | /tutorial_elasticsearch/src/main/java/com/tutorial/ElasticSearchStartApp.java | 8a944f124493054771341d9751f23068d3f38065 | [] | no_license | Perfect-Jimmy/tutorial_sky | 6892941563c8ce601919ca01d36f71da86b6ca01 | 3f19fa481b85750dc5bddf17c4215ca6f1dc6f75 | refs/heads/master | 2022-12-23T23:23:09.243264 | 2020-08-13T03:22:18 | 2020-08-13T03:22:18 | 215,051,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package com.tutorial;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author jimmy
* @date 2020/2/16 22:37
*/
@SpringBootApplication
public class ElasticSearchStartApp
{
public static void main( String[] args )
{
SpringApplication.run(ElasticSearchStartApp.class,args);
}
}
| [
"[email protected]"
] | |
572f1dd1f991a7a0067e3ad95acfea3a5d8e6b3d | b17d7c5b8a72226c5554ddc8150cc2918d89eeb6 | /src/main/java/com/hand/config/CustomWebSecurityConfigurerAdapter.java | a47a1fc0ab475aefce41dfa4745735b80cc5775e | [] | no_license | mabu-learn/hzero-order-25219 | bc31c5216f2a75e0449e37b621fb9203c3d4ce3b | 8b82bd3d21a70254d75075fa17a95b9d8f1119ea | refs/heads/master | 2023-04-06T14:07:52.996207 | 2019-08-18T14:26:21 | 2019-08-18T14:26:21 | 202,987,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.hand.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
/**
* @author [email protected]
* @create 2019/8/7 19:50
*/
//@Configuration
public class CustomWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
// 禁用 security basic 验证
http.httpBasic().disable();
}
}
| [
"[email protected]"
] | |
7f5977af0cc3646c3339c60afb07791e21378861 | bf56b977f36848304a7e4ec81676ccdef534220b | /project-end01/src/main/java/com/bit/shop01/controller/MembersController.java | a958ba15b19ed68d83723bb3b0c27b77e9f6d567 | [] | no_license | ohmirae/project | 92f58e1242b5db2135bfdae34dc1c013565829aa | 4c466ad5cdf5a6af31f27daa94b8a33dee2d9d6b | refs/heads/master | 2020-03-22T14:54:59.374396 | 2018-08-06T01:32:10 | 2018-08-06T01:32:10 | 140,214,571 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,118 | java |
package com.bit.shop01.controller;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.method.support.ModelAndViewContainer;
import com.bit.shop01.model.entity.MemVo;
import com.bit.shop01.service.MemService;
@Controller
public class MembersController {
@Autowired
private MemService memService;
Logger log = Logger.getLogger(this.getClass());
// 로그인 페이지로 이동
@RequestMapping(value = "/login/", method = RequestMethod.GET)
public String login() {
return "/info/login";
}
// 로그인 페이지로 이동
@RequestMapping(value = "/login2/", method = RequestMethod.GET)
public String login2() {
return "/info/login2";
}
// 관리자 로그인 성공 or 로그인 성공 or 로그인 실패 후 이동하는 페이지
// 실패 시 다시 로그인 화면으로 이동
@RequestMapping(value = "/login/", method = RequestMethod.POST)
public String login(String memId, String memPassword, HttpSession session) throws Exception {
MemVo loginMem = memService.login(memId, memPassword);
System.out.println(memId + memPassword);
if(memId.equals("manager")) {
session.setAttribute("check", loginMem);
return "/info2/manPage";
}else if (loginMem != null) {
session.setAttribute("check", loginMem);
return "/info/logAfter";
} else {
return "/info/login";
}
}
// 회원정보 변경 페이지로 이동
@RequestMapping(value = "/changePasswd", method = RequestMethod.GET)
public String changePasswd() {
return "/info/changePasswd";
}
// 회원정보 변경 완료 후 이동하는 페이지
@RequestMapping(value = "/changePasswd", method = RequestMethod.POST)
public String changePasswd(String memPassword, String email, String address, String hp, HttpSession session)
throws Exception {
String memId = ((MemVo) session.getAttribute("check")).getMemId();
MemVo memVo = new MemVo();
memVo.setMemId(memId);
memVo.setMemPassword(memPassword);
memVo.setEmail(email);
memVo.setAddress(address);
memVo.setHp(hp);
memService.changePasswd(memVo);
return "/info/changePasswdConfirm";
}
// 로그아웃 후 로그인 화면으로 이동
@RequestMapping(value = "/logout/", method = RequestMethod.GET)
public String logout(HttpSession session) {
session.removeAttribute("check");
return "/info/login";
}
// 회원가입 페이지로 이동
@RequestMapping(value = "/join/", method = RequestMethod.GET)
public String gojoin(MemVo memVo) {
return "/info/join";
}
// 회원가입 성공시 이동하는 페이지
@RequestMapping(value = "/join/", method = RequestMethod.POST)
public String welcome(MemVo memVo) throws Exception {
System.out.println(memVo);
memService.insert(memVo);
return "/info/welcome";
}
}
| [
"[email protected]"
] | |
2f51fb738b26755aee1b529896b1092c55bfbfa5 | 1b53b2f9ae546dd50cd47add6c78b8231cf24017 | /src/main/java/com/chaofan/config/dao/MybatisPlusConfig.java | 46da15527ab0c8d3614eb49a084cfd7181bb8a58 | [] | no_license | HCC-FCHINA/tiku-portal | 016e27686b60e5b0b9dad186a53bfcf3fb232996 | c3836b30dd51c377c474e4aa4eb16bf1b9a4a129 | refs/heads/master | 2022-07-01T12:42:11.328905 | 2019-10-09T02:12:12 | 2019-10-09T02:12:12 | 213,799,142 | 0 | 0 | null | 2022-06-17T02:34:05 | 2019-10-09T02:11:29 | JavaScript | UTF-8 | Java | false | false | 3,282 | java | package com.chaofan.config.dao;
import java.util.ArrayList;
import java.util.List;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.ISqlInjector;
import com.baomidou.mybatisplus.mapper.LogicSqlInjector;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.plugins.PerformanceInterceptor;
import com.baomidou.mybatisplus.plugins.parser.ISqlParser;
import com.baomidou.mybatisplus.plugins.parser.tenant.TenantHandler;
import com.baomidou.mybatisplus.plugins.parser.tenant.TenantSqlParser;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
@Configuration
@MapperScan("com.chaofan.modules.*.dao*")
public class MybatisPlusConfig {
@Bean
public PerformanceInterceptor performanceInterceptor() {
return new PerformanceInterceptor();
}
/**
* mybatis-plus分页插件<br>
* 文档:http://mp.baomidou.com<br>
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
paginationInterceptor.setLocalPage(true);// 开启 PageHelper 的支持
/*
* 【测试多租户】 SQL 解析处理拦截器<br>
* 这里固定写成住户 1 实际情况你可以从cookie读取,因此数据看不到 【 麻花藤 】 这条记录( 注意观察 SQL )<br>
*/
List<ISqlParser> sqlParserList = new ArrayList<>();
TenantSqlParser tenantSqlParser = new TenantSqlParser();
tenantSqlParser.setTenantHandler(new TenantHandler() {
@Override
public Expression getTenantId() {
return new LongValue(1L);
}
@Override
public String getTenantIdColumn() {
return "course_id";
}
@Override
public boolean doTableFilter(String tableName) {
// 这里可以判断是否过滤表
return true;
}
});
sqlParserList.add(tenantSqlParser);
paginationInterceptor.setSqlParserList(sqlParserList);
// 以下过滤方式与 @SqlParser(filter = true) 注解等效
// paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() {
// @Override
// public boolean doFilter(MetaObject metaObject) {
// MappedStatement ms = PluginUtils.getMappedStatement(metaObject);
// // 过滤自定义查询此时无租户信息约束【 麻花藤 】出现
// if ("com.baomidou.springboot.mapper.UserMapper.selectListBySQL".equals(ms.getId())) {
// return true;
// }
// return false;
// }
// });
return paginationInterceptor;
}
@Bean
public MetaObjectHandler metaObjectHandler(){
return new MyMetaObjectHandler();
}
/**
* 注入sql注入器
*/
@Bean
public ISqlInjector sqlInjector(){
return new LogicSqlInjector();
}
}
| [
"[email protected]"
] | |
6ad98fd0e8fe5a292a7e65cf4d85b8a2c4cdf439 | 0db6ec89d729615e517888f54b1b5a73b4871367 | /src/gof/creational/builder/demo1/MealBuilderDemo.java | ad7f7d3576f218415347665c078444f80e475aeb | [] | no_license | dvanwesh/Design-Patterns | 9a579c2be248c37f2171a1c445d790ab9cb59931 | 9d3e1b596675cb01900a8f48f681e7af8bd0429c | refs/heads/master | 2020-04-05T14:36:41.335111 | 2017-06-28T20:38:13 | 2017-06-28T20:38:13 | 94,714,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package gof.creational.builder.demo1;
/**
* Builder pattern builds a complex object using simple objects and using a step
* by step approach. This type of design pattern comes under creational pattern
* as this pattern provides one of the best ways to create an object.
*
* A Builder class builds the final object step by step. This builder is
* independent of other objects.
*
* @author Anwesh
*
*/
public class MealBuilderDemo {
public static void main(String[] args) {
MealBuilder builder = new MealBuilder();
Meal chickenItems = builder.prepareMealA();
chickenItems.showItems();
System.out.println(chickenItems.getCost());
Meal goatItems = builder.prepareMealB();
goatItems.showItems();
System.out.println(goatItems.getCost());
}
}
| [
"[email protected]"
] | |
398d396ee382b84be61a5f3ff08b55f824137142 | a8599a70dcd08bce16d60edc9e3845f176f7acf0 | /guitar1/src/main/java/dbUtil/DbUtil.java | f086bff82f3471e6869082f2f2fa86ac90667ea7 | [] | no_license | maokailu/mis | 304fa19debac217ff43dbdac249b7493ed69d92f | f66cc92dd2f84870c3ca8caad79053889ae0074f | refs/heads/master | 2021-09-10T15:24:43.423326 | 2018-03-28T13:36:07 | 2018-03-28T13:36:07 | 70,894,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,453 | java | package dbUtil;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class DbUtil {
private static ComboPooledDataSource dataSource=new ComboPooledDataSource();
static {
try {
dataSource.setDriverClass("com.mysql.jdbc.Driver");
dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/medicine");
dataSource.setUser("root");
dataSource.setPassword("123456");
dataSource.setInitialPoolSize(50);
dataSource.setMaxPoolSize(100);
dataSource.setMaxIdleTime(10000);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static Connection getConnection(){
Connection conn=null;
try {
conn= DbUtil.dataSource.getConnection();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public static boolean executeUpdate(String sql,Object[] args){
boolean sign=false;
Connection conn=null;
PreparedStatement pst=null;
try{
conn=dataSource.getConnection();
pst=conn.prepareStatement(sql);
if(args!=null&&args.length>0){
for(int i=0;i<args.length;i++){
pst.setObject(i+1, args[i]);
}
}
int rows=pst.executeUpdate();
sign=rows>0?true:false;
}catch(Exception e){
e.printStackTrace();
}
return sign;
}
public static ResultSet executeQuery(String sql,Object[] args){
Connection conn=null;
PreparedStatement pst=null;
ResultSet rs=null;
try{
Class.forName("org.sqlite.JDBC");
// conn=DriverManager.getConnection("jdbc:sqlite:D:\\medicine\\guitar.db3");
conn=DriverManager.getConnection("jdbc:sqlite:db/guitar.db3");
//conn=DbUtil.dataSource.getConnection();
pst=conn.prepareStatement(sql);
if(args!=null&&args.length>0){
for(int i=0;i<args.length;i++){
pst.setObject(i+1, args[i]);
}
}
rs=pst.executeQuery();
}catch(Exception e){
e.printStackTrace();
}
return rs;
}
public static void closeAll(ResultSet rs,Statement st,Connection conn){
try{
if(rs!=null) rs.close();
if(st!=null) st.close();
if(conn!=null) conn.close();
}catch(SQLException e){
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
3e248c0061fcebb43882d1222ba2d5200791b086 | 9c47294ef16fb86ff38eedf1156922c5b0455ff8 | /Linked List/Linked-List-Example.java | 068fa4c337bb8c2d9c1fa20b86f81773839c9e72 | [] | no_license | jwward2/Java | 379c4087e20dcf9d32d7ffeec9e88b0521f094d8 | 5c4c1ba535568da97988da60918b35740a010d56 | refs/heads/master | 2021-01-23T04:03:01.201953 | 2014-11-24T21:04:51 | 2014-11-24T21:04:51 | 27,090,648 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,183 | java | // Description: The Assignment 10 class displays a menu of choices to a user
// and performs the chosen task. It will keep asking a user to
// enter the next choice until the choice of 'Q' (Quit) is
// entered.
import java.io.*;
public class Linked-List-Example
{
public static void main(String[] args)
{
char input1;
String inputInfo = new String();
int operation2;
String line = new String();
//create a linked list to be used in this method.
LinkedList list1 = new LinkedList();
try
{
// print out the menu
printMenu();
// create a BufferedReader object to read input from a keyboard
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader stdin = new BufferedReader (isr);
do
{
System.out.print("What action would you like to perform?\n");
line = stdin.readLine().trim(); //read a line
input1 = line.charAt(0);
input1 = Character.toUpperCase(input1);
if (line.length() == 1) //check if a user entered only one character
{
switch (input1)
{
case 'A': //Add String
System.out.print("Please enter a string to add:\n");
String str1 = stdin.readLine().trim();
System.out.print("Please enter an index to add:\n");
inputInfo = stdin.readLine().trim();
int addIndex = Integer.parseInt(inputInfo);
list1.addElement(addIndex, str1);
break;
case 'B': //Add a few of the specified object at the beginning of the linked list
System.out.print("Please enter a number of elements to be added at the beginning of the linked list:\n");
inputInfo = stdin.readLine().trim();
int howMany = Integer.parseInt(inputInfo);
System.out.print("Please enter a string to be added:\n");
inputInfo = stdin.readLine().trim();
list1.addFewAtBeginning(howMany, inputInfo);
break;
case 'D': //Check if the list is empty
if (list1.isEmpty())
System.out.print("The list is empty.\n");
else
System.out.print("The list contains some element(s).\n");
break;
case 'E': //Search for a String at an Index
System.out.print("Please enter an index to search:\n");
inputInfo = stdin.readLine().trim();
int searchIndex = Integer.parseInt(inputInfo);
System.out.print("String at the index " + searchIndex + " is "
+ list1.getElement(searchIndex) + "\n");
break;
case 'G': //Set String
System.out.print("Please enter a string to set:\n");
String str2 = stdin.readLine().trim();
System.out.print("Please enter an index to set:\n");
inputInfo = stdin.readLine().trim();
int setIndex = Integer.parseInt(inputInfo);
try
{
list1.setElement(setIndex, str2);
}
catch(IndexOutOfBoundsException ex)
{
System.out.print("The index is out of bounds\n");
}
break;
case 'L': //List Strings
System.out.print(list1.toString());
break;
case 'Q': //Quit
break;
case 'S': //Search and Remove
System.out.print("Please enter a string to be searched and removed:\n");
inputInfo = stdin.readLine().trim();
list1.searchAndRemove(inputInfo);
break;
case '?': //Display Menu
printMenu();
break;
default:
System.out.print("Unknown action\n");
break;
}
}
else
{
System.out.print("Unknown action\n");
}
} while (input1 != 'Q' || line.length() != 1);
}
catch (IOException exception)
{
System.out.print("IO Exception\n");
}
}
/** The method printMenu displays the menu to a user **/
public static void printMenu()
{
System.out.print("Choice\t\tAction\n" +
"------\t\t------\n" +
"A\t\tAdd String\n" +
"B\t\tAdd A Few At the Beginning\n" +
"D\t\tCheck if Empty\n" +
"E\t\tSearch for String\n" +
"G\t\tSet String\n" +
"L\t\tList Strings\n" +
"Q\t\tQuit\n" +
"S\t\tSearch and Remove\n" +
"?\t\tDisplay Help\n\n");
} //end of printMenu()
}
| [
"[email protected]"
] | |
f677579b6fd67f5f1eb353caa829d8b0d89f2758 | 710fc3dcf6ca83f90653cbf3ff0645441e9a4edf | /java/src/configuration/ConfigurationMapperImplSQL.java | ada474f0700f35e13ad99ca63907118a9b0b99f8 | [] | no_license | BBK-PiJ-2015-10/mtp-abm | dac029fe0187b4eef4cfedfbedeafdfaa57fd5c7 | 40848df7dba57a9a5d355ad84d414c814b32fbc8 | refs/heads/master | 2020-05-22T05:44:56.007762 | 2016-09-21T11:36:47 | 2016-09-21T11:36:47 | 60,769,600 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package configuration;
import java.util.Scanner;
import java.util.NoSuchElementException;
/*
* An extension of ConfigurationMapperAbstract to support an SQL ABC configuration.
*/
public class ConfigurationMapperImplSQL extends ConfigurationMapperAbstract implements ConfigurationMapper {
public ConfigurationMapperImplSQL(ConfigurationManagerAbstract configurationManager){
super(configurationManager);
mapCreatorFactory = new MapCreatorFactorySQL();
}
public boolean execManager(Scanner sc) {
try {
configurationManager.loadFilesMap();
((ConfigurationManagerSQL)configurationManager).captureGLConnectionSettings(sc);
configurationManager.grabFilesAttributes();
configurationManager.loadGlFilesMainAttributes(sc);
configurationManager.loadBpaFilesMainAttributes(sc);
configurationManager.save();
return true;
} catch (NoSuchElementException ex){
return false;
} catch (NullPointerException ex){
return false;
}
}
}
| [
"[email protected]"
] | |
a628110fead8f7ed6fc0f50d75085c8582e941b0 | 0882993b7aabf178ada8b018508707e1f34b1cf0 | /src/main/java/com/phylogeny/extrabitmanipulation/packet/PacketSetBitStack.java | 645dbeb44d210effebdba7cff89864dc2ad2cb15 | [
"Unlicense"
] | permissive | ToadsworthLP/ExtraBitManipulation | 7299bc6ac2abcf050d30dfec729e9bce2b6d287d | 5005c1592faa5ca6892f919f2f08d241f9aeacc4 | refs/heads/master | 2021-01-16T18:57:42.475796 | 2016-05-22T15:25:19 | 2016-05-22T15:25:19 | 59,418,861 | 0 | 0 | null | 2016-05-22T15:15:58 | 2016-05-22T15:15:57 | null | UTF-8 | Java | false | false | 1,748 | java | package com.phylogeny.extrabitmanipulation.packet;
import com.phylogeny.extrabitmanipulation.helper.ItemStackHelper;
import com.phylogeny.extrabitmanipulation.helper.SculptSettingsHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
public class PacketSetBitStack implements IMessage
{
private boolean isWire;
private ItemStack bitStack;
public PacketSetBitStack() {}
public PacketSetBitStack(boolean isCurved, ItemStack bitStack)
{
this.isWire = isCurved;
this.bitStack = bitStack;
}
@Override
public void toBytes(ByteBuf buffer)
{
buffer.writeBoolean(isWire);
ItemStackHelper.stackToBytes(buffer, bitStack);
}
@Override
public void fromBytes(ByteBuf buffer)
{
isWire = buffer.readBoolean();
bitStack = ItemStackHelper.stackFromBytes(buffer);
}
public static class Handler implements IMessageHandler<PacketSetBitStack, IMessage>
{
@Override
public IMessage onMessage(final PacketSetBitStack message, final MessageContext ctx)
{
IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.worldObj;
mainThread.addScheduledTask(new Runnable()
{
@Override
public void run()
{
EntityPlayer player = ctx.getServerHandler().playerEntity;
SculptSettingsHelper.setBitStack(player, player.getCurrentEquippedItem(), message.isWire, message.bitStack);
}
});
return null;
}
}
} | [
"[email protected]"
] | |
daa1eb52ed3fe23f366720b347f38ca5752da224 | e9a0e958327aaf9ce6d44e7188da43a78a5600c9 | /src/main/java/com/example/demo/annotation/componentScan/dao/Scan_Service.java | 3f2c129e2fa1309f2be71255a2ccee4aeaed111e | [] | no_license | jziyy/study | 15cd09458081a1522b6a17aef89f015cb1c1c6db | b3760af8df5e4a67535044b859bfef6768672baf | refs/heads/master | 2020-04-12T17:49:51.340868 | 2019-05-18T14:19:59 | 2019-05-18T14:19:59 | 162,658,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package com.example.demo.annotation.componentScan.dao;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Data
@Service
public class Scan_Service {
@Value("aaa")
private String name;
@Value("aaa")
private String password;
}
| [
"[email protected]"
] | |
b67eba72a5870a16b1d61a57a2ba18b4e7d73610 | ccdf68f9b9f38ca1931a2686b339b810b5218574 | /spann/spann-metadata/src/test/java/com/masetta/spann/metadata/visitors/BaseAnnotationVisitorTest.java | 4f498d395451cb41ab920447dcb5f85d08185694 | [] | no_license | rpiterman/spann | f6ef8bc431db10ec75f96ef4089f04912ef32ab8 | 76ed66d1a60bc0e7c78110950a967c24b902de94 | refs/heads/master | 2021-05-28T21:48:46.158714 | 2011-11-06T08:56:12 | 2011-11-06T08:56:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | /**
* Copyright 2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.masetta.spann.metadata.visitors;
public class BaseAnnotationVisitorTest {
}
| [
"[email protected]"
] | |
3e8bb26f72224973bfd8fa202b22e0b09b1bc8b7 | a061ae64e1cfb04a7805cc0e94badc92b295eb77 | /src/com/utils/MyHandler.java | 375251a9ca657b3cce3396694f994e6a145372fc | [] | no_license | xiaoyingh/springWXstk | 5493d38314299b4a2f1232ebff0f96407463faf9 | c034532fbd59e08ad4bf697dbfea5d6fe072124b | refs/heads/master | 2021-09-03T05:52:40.551873 | 2018-01-06T02:55:07 | 2018-01-06T02:55:07 | 116,446,932 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,116 | java | package com.utils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import com.jcxa.safe.entity.Users;
import com.jcxa.safe.entity.WxUser;
import com.jcxa.safe.service.LoginService;
public class MyHandler implements HandlerInterceptor{
@Autowired
private LoginService loginService;
@Override
public void afterCompletion(HttpServletRequest arg0,
HttpServletResponse arg1, Object arg2, Exception arg3)
throws Exception {
// TODO Auto-generated method stub
System.out.println("我是afterCompletion+1");
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response,
Object arg2, ModelAndView arg3) throws Exception {
// TODO Auto-generated method stub
System.out.println("我是postHandle+2");
//String url=request.getRequestURI();
//request.getRequestDispatcher(url).forward(request, response);
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
Object arg2) throws Exception {
// TODO Auto-generated method stub
System.out.println("我是preHandle+3");
String url=request.getRequestURI();
String par=request.getQueryString();
if(url.indexOf("wxshare")>=0){
return true;
}
//截取url
url=url.substring(3);
HttpSession session=request.getSession();
url=url+"?"+par;
session.setAttribute("url", url);
WxUser user=(WxUser) session.getAttribute("wxuser");
Users users=(Users) session.getAttribute("user");
if(user!=null || users!=null){
//Users u=loginService.selectWxOpenidService(user.getID());
//session.setAttribute("url", url);
System.out.println("MyHandler.preHandle()++++我是session中以保存的");
return true;
}
System.out.println("MyHandler.preHandle()++++我要去授权登录啦");
request.getRequestDispatcher("wxshare").forward(request, response);
return false;
}
}
| [
"[email protected]"
] | |
f02e46892fb9219a937386cff068a7940c2e5903 | 22ec3cfc7f8ecf3e5eae8b77470b3254ee39f85e | /maps/kvvMapsView/src/kvv/kvvmap/view/TilesWithSel.java | d90c26b118182027125b02b56fcf180e33f6c4d8 | [] | no_license | kvv1/kvvmaps | 82707af2afcdb7f7cb265ebe4deada645e28df53 | 5f6b987e7df1bc72c9087685e8b0608ea2c8398b | refs/heads/master | 2021-01-17T01:39:01.559035 | 2019-04-25T23:14:14 | 2019-04-25T23:14:14 | 38,697,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,816 | java | package kvv.kvvmap.view;
import kvv.kvvmap.adapter.GC;
import kvv.kvvmap.placemark.IPlaceMarksListener;
import kvv.kvvmap.placemark.PathDrawer;
import kvv.kvvmap.tiles.Tiles;
import kvv.kvvmap.util.ISelectable;
import kvv.kvvmap.util.Img;
import kvv.kvvmap.util.InfoLevel;
public abstract class TilesWithSel extends Tiles {
private final Environment envir;
private ISelectable sel;
private volatile InfoLevel infoLevel = InfoLevel.HIGH;
public InfoLevel getInfoLevel() {
return infoLevel;
}
public ISelectable getSel() {
return sel;
}
public void setInfoLevel(InfoLevel level) {
infoLevel = level;
setInvalidAll();
}
public TilesWithSel(final Environment envir) {
super(envir.adapter, envir.maps);
this.envir = envir;
envir.placemarks.setListener(pmListener);
envir.paths.setListener(pmListener);
}
public void select(ISelectable sel) {
this.sel = sel;
setInvalidAll();
}
@Override
protected void drawAdditionalsAsync(long id, Img img) {
GC gc = envir.adapter.getGC(img.img);
if (infoLevel.ordinal() > 0) {
gc.setAntiAlias(true);
PathDrawer.drawPaths(envir.paths, gc, id, infoLevel, sel);
PathDrawer.drawPlacemarks(envir.placemarks, gc, id,
infoLevel, sel, envir.adapter.getScaleFactor());
}
}
private final IPlaceMarksListener pmListener = new IPlaceMarksListener() {
@Override
public void onPathTilesChanged() {
setInvalidAll();
}
@Override
public void onPathTileChanged(long id) {
envir.adapter.assertUIThread();
setInvalid(id);
}
private Runnable r = new Runnable() {
@Override
public void run() {
onPathTilesChanged();
}
};
@Override
public void onPathTilesChangedAsync() {
envir.adapter.execUI(r);
}
};
}
| [
"[email protected]"
] | |
a4104eeeaeb3fd821c827a1953f38266852cbd3c | 199cd58c19335f44a4488289d60c888b32b0203e | /service/src/main/java/com/trade/service/helper/currencyhelper/CurrencyHelperUtil.java | a02e5c3fe1b115e95ff74aa896737d0a1fff1fca | [] | no_license | mirzmary/trade-test | 82d140c1845cea23c6c16597396675510d3f29b8 | 31dcae197e91996c7e1a2ed504e40ca374d2ab02 | refs/heads/master | 2020-03-27T05:12:04.726718 | 2018-08-24T16:50:09 | 2018-08-24T16:50:09 | 146,001,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,039 | java | package com.trade.service.helper.currencyhelper;
import com.trade.service.common.exception.ServiceRuntimeException;
import java.util.ArrayList;
import java.util.Currency;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
public class CurrencyHelperUtil {
private CurrencyHelperUtil() {
// Private constructor
}
public static List<String> getCurrenciesFromPair(final String currencyPair) {
final List<String> currencyList = new ArrayList<>();
currencyList.add(currencyPair.substring(0, 3));
currencyList.add(currencyPair.substring(3, 6));
return currencyList;
}
public static List<CurrencyLocales> getAllCurrencies() {
final List<LocaleCurrency> localeCurrencies = new ArrayList<>();
final Locale[] availableLocales = Locale.getAvailableLocales();
for (final Locale loc : availableLocales) {
if (loc != null && loc.getLanguage() != null && !loc.getLanguage().equals("")) {
try {
final Currency currency = Currency.getInstance(loc);
if (currency != null) {
localeCurrencies.add(LocaleCurrency.from(loc, currency.getCurrencyCode()));
}
} catch (final Exception exc) {
// Do nothing for missing currency for any locale
}
}
}
return localeCurrencies.stream().
collect(Collectors.groupingBy(LocaleCurrency::getCurrency))
.
entrySet().
stream()
.
map(currencyGrouping -> CurrencyLocales.from(currencyGrouping.getKey(), currencyGrouping.getValue().
stream().
map(LocaleCurrency::getLocale).
collect(Collectors.toList())))
.
collect(Collectors.toList());
}
}
| [
"[email protected]"
] | |
01e3588b8644255a397358c0843dd28ca522196c | 45f23cd51c1149f200c7b00fd548dabb1d6506f0 | /src/org/ovirt/engine/sdk/decorators/NetworkLabel.java | dffa594dc484317a384994af40a87e83922a05b8 | [] | no_license | zuoguagua/myproject | 27c6755237183271ed3a6082b51167ebbf122496 | ac3807490b8c507a05e76bebcf73cc9b8c1473fb | refs/heads/master | 2021-01-21T04:54:48.716686 | 2016-06-30T07:05:26 | 2016-06-30T07:05:26 | 55,661,175 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,096 | java | //
// Copyright (c) 2012 Red Hat, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// *********************************************************************
// ********************* GENERATED CODE - DO NOT MODIFY ****************
// *********************************************************************
package org.ovirt.engine.sdk.decorators;
import java.io.IOException;
import java.util.List;
import org.apache.http.Header;
import org.apache.http.client.ClientProtocolException;
import org.ovirt.engine.sdk.entities.Action;
import org.ovirt.engine.sdk.entities.Response;
import org.ovirt.engine.sdk.exceptions.ServerException;
import org.ovirt.engine.sdk.utils.HttpHeaderBuilder;
import org.ovirt.engine.sdk.utils.HttpHeaderUtils;
import org.ovirt.engine.sdk.utils.UrlBuilder;
import org.ovirt.engine.sdk.web.HttpProxyBroker;
import org.ovirt.engine.sdk.web.UrlParameterType;
/**
* <p>NetworkLabel providing relation and functional services
* <p>to {@link org.ovirt.engine.sdk.entities.Label }.
*/
@SuppressWarnings("unused")
public class NetworkLabel extends
org.ovirt.engine.sdk.entities.Label {
private HttpProxyBroker proxy;
private final Object LOCK = new Object();
/**
* @param proxy HttpProxyBroker
*/
public NetworkLabel(HttpProxyBroker proxy) {
this.proxy = proxy;
}
/**
* @return HttpProxyBroker
*/
private HttpProxyBroker getProxy() {
return proxy;
}
/**
* Deletes object.
*
* @return
* {@link Response }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
public Response delete() throws ClientProtocolException,
ServerException, IOException {
String url = this.getHref();
HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
List<Header> headers = headersBuilder.build();
UrlBuilder urlBuilder = new UrlBuilder(url);
url = urlBuilder.build();
return getProxy().delete(url, Response.class, headers);
}
/**
* Deletes object.
*
* @param async
* <pre>
* [true|false]
* </pre>
*
* @return
* {@link Response }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
public Response delete(Boolean async) throws ClientProtocolException,
ServerException, IOException {
String url = this.getHref();
HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
List<Header> headers = headersBuilder.build();
UrlBuilder urlBuilder = new UrlBuilder(url);
if (async != null) {
urlBuilder.add("async", async, UrlParameterType.MATRIX);
}
url = urlBuilder.build();
return getProxy().delete(url, Response.class, headers);
}
/**
* Deletes object.
*
* @param correlationId
* <pre>
* [any string]
* </pre>
*
* @param async
* <pre>
* [true|false]
* </pre>
*
* @return
* {@link Response }
*
* @throws ClientProtocolException
* Signals that HTTP/S protocol error has occurred.
* @throws ServerException
* Signals that an oVirt api error has occurred.
* @throws IOException
* Signals that an I/O exception of some sort has occurred.
*/
public Response delete(Boolean async, String correlationId) throws ClientProtocolException,
ServerException, IOException {
String url = this.getHref();
HttpHeaderBuilder headersBuilder = new HttpHeaderBuilder();
if (correlationId != null) {
headersBuilder.add("Correlation-Id", correlationId);
}
List<Header> headers = headersBuilder.build();
UrlBuilder urlBuilder = new UrlBuilder(url);
if (async != null) {
urlBuilder.add("async", async, UrlParameterType.MATRIX);
}
url = urlBuilder.build();
return getProxy().delete(url, Response.class, headers);
}
}
| [
"[email protected]"
] | |
1044b638ea0012dfd1ac78655b5647381c3d4406 | 62e3b80b6da820681087a3e28e15c5d5e83a736b | /app/src/rxJava/java/com/articles/jcarvalho/guardianapiexample/ui/articles/interactor/IArticleListInteractor.java | 7f8af49a89a1de1394a4b59be42b732d57ade66d | [] | no_license | Drufyre/guardianapiexample | 9491fa058003acf28db065f32cc9d300a583b3a0 | a344ee2092cb06ea32055c92e6df1fdf14e59c2f | refs/heads/master | 2021-01-20T20:02:43.217209 | 2016-08-10T10:23:49 | 2016-08-10T10:23:49 | 65,372,138 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package com.articles.jcarvalho.guardianapiexample.ui.articles.interactor;
import com.articles.jcarvalho.guardianapiexample.models.SearchResponse;
import com.articles.jcarvalho.guardianapiexample.models.SearchResponseObject;
import rx.Observer;
/**
* Created by jcarvalho on 8/9/2016.
*/
public interface IArticleListInteractor {
void getArticleList(String sectionFilter, long page, Observer<SearchResponseObject> subscriber);
void finish();
}
| [
"[email protected]"
] | |
98a7fd831292f709fb97d023b6eb3371c8a6576e | f5ab2c1a2667218288359e66acbb44f2f1d292a4 | /src/Graphics/Controller/addUser_Controller.java | d28d0100943d263ca78a98eccb36fcc77e620577 | [] | no_license | fateme81yosefi/Bank | 68562f2a79a3e0f26234f1d90621bd1330fcaa0e | 4dcfaf4b64b62aaf395d4bb6c449d56ad4a6f097 | refs/heads/master | 2023-06-09T15:19:30.011334 | 2021-07-06T08:26:45 | 2021-07-06T08:26:45 | 378,075,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,981 | java | package Graphics.Controller;
import Core.Bank;
import Graphics.Client;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
public class addUser_Controller implements Initializable {
public TextField codemeli;
public TextField phone;
public TextField name;
public TextField email;
public Button conti;
public Button khadamatk;
public PasswordField ramz;
public void validate() throws IOException {
String codemeliText=codemeli.getText();
String phone1=phone.getText();
String name1=name.getText();
String email1=email.getText();
String ramz1=ramz.getText();
Stage stage;
Parent root;
if (codemeliText.isEmpty()||phone1.isEmpty()||name1.isEmpty()||email1.isEmpty()||ramz1.isEmpty()){
Alert alert=new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("لطفا تمام فیلد ها را پر کنید!");
alert.showAndWait();
}else {
int x=Bank.addUser(name1,codemeliText,ramz1,phone1,email1);
if (x==1){
System.out.println("عملیات با موفقیت انجام شد");
stage = (Stage) conti.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(Client.class.getResource("Fxml/movafagh.fxml"));
root = fxmlLoader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}else {
System.out.println("عملیات موفق نبود ! لطفا دوباره تلاش کنید!");
Alert alert=new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("عملیات موفق نبود ! لطفا دوباره تلاش کنید!");
alert.showAndWait();
}
}
}
public void setAllButten(ActionEvent event) throws IOException {
Stage stage;
Parent root;
if (event.getSource().equals(khadamatk)) {
stage = (Stage) khadamatk.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(Client.class.getResource("Fxml/EntekhabKhadamatUser.fxml"));
root = fxmlLoader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}
| [
"[email protected]"
] | |
b3951c490deac0c9ca68b1e37a7e31abc96c0dd8 | 95fa8c4371957e2acf62204f9170917b493d8fd8 | /planet/test/start-hive/src/main/java/com/item/hive/entity/DbInfo.java | 635bcc10a69a1194e088ed04dad036235842d6ab | [] | no_license | JinggeSun/newword | dd6fa9ddbf575b080bf71fdf74fb248643ad5ce0 | 8ce5763f3c6ec6746dd12aa21d11d6dfb3343f96 | refs/heads/master | 2022-09-07T14:55:13.597224 | 2021-06-16T14:42:39 | 2021-06-16T14:42:39 | 231,100,188 | 0 | 0 | null | 2022-09-01T23:32:47 | 2019-12-31T14:12:50 | JavaScript | UTF-8 | Java | false | false | 489 | java | package com.item.hive.entity;
import java.util.List;
/**
* @author zcm
*/
public class DbInfo {
public DbInfo(String dbName) {
this.dbName = dbName;
}
private String dbName;
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getDbName() {
return dbName;
}
@Override
public String toString() {
return "DbInfo{" +
"dbName='" + dbName + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
83790e676192c203fb0578ea26c4831e518508a1 | 8534ea766585cfbd6986fd845e59a68877ecb15b | /com/slideme/sam/manager/controller/p053a/ak.java | 2bddf43c03e21ea42c4cfd51dda6144ab8068509 | [] | no_license | Shanzid01/NanoTouch | d7af94f2de686f76c2934b9777a92b9949b48e10 | 6d51a44ff8f719f36b880dd8d1112b31ba75bfb4 | refs/heads/master | 2020-04-26T17:39:53.196133 | 2019-03-04T10:23:51 | 2019-03-04T10:23:51 | 173,720,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package com.slideme.sam.manager.controller.p053a;
import android.app.AlertDialog;
import android.graphics.Bitmap;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/* compiled from: TermsAndConditionsDialog */
class ak extends WebViewClient {
final /* synthetic */ aj f2686a;
private final /* synthetic */ AlertDialog f2687b;
ak(aj ajVar, AlertDialog alertDialog) {
this.f2686a = ajVar;
this.f2687b = alertDialog;
}
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super.onPageStarted(webView, str, bitmap);
try {
this.f2687b.getButton(-1).setEnabled(false);
} catch (NullPointerException e) {
}
}
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
try {
this.f2687b.getButton(-1).setEnabled(true);
} catch (NullPointerException e) {
}
}
}
| [
"[email protected]"
] | |
6379daefbbf30dbe3d860c12f0e5eee09936b600 | 67c2f6936139672f23808916b75aadc861737a23 | /dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java | 1d15c20e5e74ca1b3842e86182c5ce4cc32797ca | [
"Apache-2.0"
] | permissive | ligangliu/dubbo | fba99b2e2112b5b13645fb6ceff08343d087e2d0 | c735669acc89b47073fb623d00a78e92cb88380a | refs/heads/master | 2022-12-21T23:28:17.329106 | 2019-11-03T14:57:08 | 2019-11-03T14:57:08 | 219,315,411 | 0 | 0 | null | 2022-12-14T20:37:27 | 2019-11-03T14:43:23 | Java | UTF-8 | Java | false | false | 4,156 | 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.dubbo.registry.support;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.URLBuilder;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.registry.Registry;
import org.apache.dubbo.registry.RegistryFactory;
import org.apache.dubbo.registry.RegistryService;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.EXPORT_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY;
/**
* AbstractRegistryFactory. (SPI, Singleton, ThreadSafe)
*
* @see org.apache.dubbo.registry.RegistryFactory
*/
public abstract class AbstractRegistryFactory implements RegistryFactory {
// Log output
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractRegistryFactory.class);
// The lock for the acquisition process of the registry
private static final ReentrantLock LOCK = new ReentrantLock();
// Registry Collection Map<RegistryAddress, Registry>
private static final Map<String, Registry> REGISTRIES = new HashMap<>();
/**
* Get all registries
*
* @return all registries
*/
public static Collection<Registry> getRegistries() {
return Collections.unmodifiableCollection(REGISTRIES.values());
}
public static Registry getRegistry(String key) {
return REGISTRIES.get(key);
}
/**
* Close all created registries
*/
public static void destroyAll() {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Close all registries " + getRegistries());
}
// Lock up the registry shutdown process
LOCK.lock();
try {
for (Registry registry : getRegistries()) {
try {
registry.destroy();
} catch (Throwable e) {
LOGGER.error(e.getMessage(), e);
}
}
REGISTRIES.clear();
} finally {
// Release the lock
LOCK.unlock();
}
}
@Override
public Registry getRegistry(URL url) {
url = URLBuilder.from(url)
.setPath(RegistryService.class.getName())
.addParameter(INTERFACE_KEY, RegistryService.class.getName())
.removeParameters(EXPORT_KEY, REFER_KEY)
.build();
String key = url.toServiceStringWithoutResolving();
// Lock the registry access process to ensure a single instance of the registry
LOCK.lock();
try {
Registry registry = REGISTRIES.get(key);
if (registry != null) {
return registry;
}
//create registry by spi/ioc
registry = createRegistry(url);
if (registry == null) {
throw new IllegalStateException("Can not create registry " + url);
}
REGISTRIES.put(key, registry);
return registry;
} finally {
// Release the lock
LOCK.unlock();
}
}
protected abstract Registry createRegistry(URL url);
}
| [
"[email protected]"
] | |
1ce7b5f6c1096ddbbbf25965a0854c8ba1bfb872 | e54e3a4ee312758af7a3fd335de1cf56c58ee47b | /app/src/main/java/com/example/testproject/MainActivity.java | c5c4df98075c742e37555e49136ca30446f60cb3 | [] | no_license | vimansh/test-project | 2bcc77422c215253f6d3c0fbf79f8cd45bfb5872 | 11a1dc5a024c37ceb81c6bbb97cf1bd00e7c4485 | refs/heads/master | 2022-07-02T08:47:07.944792 | 2020-05-15T07:47:31 | 2020-05-15T07:47:31 | 264,128,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,093 | java | package com.example.testproject;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class MainActivity extends AppCompatActivity {
private TextView textView;
private RequestQueue mQueue;
Button button;
String[][] ba=new String[100][3];
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
button =findViewById(R.id.button);
mQueue = Volley.newRequestQueue(this);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
jsonParse();
}
});
}
private void jsonParse() {
String url ="http://www.mocky.io/v2/5cc008de310000440a035fdf";
textView.setText("");
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
// textView.append("llllll");
try {
JSONArray jsonArray = response.getJSONArray("book_array");
for(int i=0; i<jsonArray.length();i++){
JSONObject book_array = jsonArray.getJSONObject(i);
String book_title = book_array.getString("book_title");
String image = book_array.getString("image");
String author = book_array.getString("author");
ba[i][0] = book_title;
ba[i][1] = image;
ba[i][2] = author;
textView.append(book_title + "\n");
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
}
});
// textView.append("ddddd");
/*for(int j=0;j<ba.length;j++)
{
for(int k=0;k<3;k++) {
textView.append(ba[j][k] + ", ");
}
textView.append("\n");
}*/
//final Request<JSONObject> add = mQueue.add(request);
//textView.append("jjjjjj");
}
}
| [
"[email protected]"
] | |
cb7a4c77883f56cd26fab9d1bc49df0668d06a23 | adbd4198e7c83dcb3ab4d373bbfbc75f3fb30b15 | /20210924/src/Person/Gender.java | 93de44f918bfe77929dc5fc627584005536ac900 | [] | no_license | JeongMG/20210924Test | e30792adaaea02e381b1be41110a372797727ae6 | c139c2d7c5fa3dae62c0e8ec250c9d8eadd26de1 | refs/heads/master | 2023-07-31T04:39:10.472841 | 2021-09-24T07:05:12 | 2021-09-24T07:05:12 | 409,865,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 60 | java | package Person;
public enum Gender {
MALE, FEMALE;
}
| [
"admin@YD02-21"
] | admin@YD02-21 |
7a9e601d47b28167d3478c83461dfbdc3337e7a9 | 73b7ba9569f95df12c7c5ae23d767a867dbcf6cb | /src/leetcode/tree/problem145.java | f45fd975256b8dfded78eb1fddc328340808c0d5 | [] | no_license | zhaozhongyu/leetcode-solution | 0e54884cbe1436264d46bbd35fa939f893a5e367 | 1ba15577bafba492120d6bc0520d74d6a51e7969 | refs/heads/master | 2022-02-15T03:19:35.302085 | 2022-01-24T07:20:43 | 2022-01-24T07:20:43 | 88,062,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,690 | java | package leetcode.tree;
import javax.transaction.TransactionRequiredException;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
public class problem145 {
/**
* 给定一个二叉树,返回它的 后序 遍历。
*
* 示例:
*
* 输入: [1,null,2,3]
* 1
* \
* 2
* /
* 3
*
* 输出: [3,2,1]
* 进阶: 递归算法很简单,你可以通过迭代算法完成吗?
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
* */
// 两种办法, 一种是先前序再倒装, 另一种是拆分后push进stack
public List<Integer> postorderTraversal(TreeNode root) {
List<Integer> result = new ArrayList<>();
if (root == null) return result;
Stack<TreeNode> stack = new Stack<>();
stack.push(root);
while (!stack.isEmpty()) {
TreeNode node = stack.pop();
TreeNode left = null;
TreeNode right = null;
if (node.left == null && node.right == null) {
result.add(node.val);
} else {
left = node.left;
right = node.right;
node.left = null;
node.right = null;
stack.push(node);
}
if (right != null) {
stack.push(right);
}
if (left != null) {
stack.push(left);
}
}
return result;
}
}
| [
"[email protected]"
] | |
9d334014b4cf7b3a7c2ccd213e075675fe3512ff | 74133ff94715cc340a52612da94f576046e73a78 | /order-service-api-webservice/src/main/java/com/blckly/order/service/api/model/OrderDTO.java | 23d00c56496da589b2bf43fd47969a238822a5d9 | [] | no_license | anikolayevsky/order-service-api | 4dadc8c98ed99788df5ee25d5e2e3cfe9dbfae2a | 74815a047c22ea0a73fd96a0085b3e898fe27626 | refs/heads/master | 2021-01-20T05:48:13.685740 | 2017-03-06T03:23:38 | 2017-03-06T03:23:38 | 83,863,982 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,921 | java | package com.blckly.order.service.api.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.blckly.order.service.api.type.OrderStatus;
import com.blckly.order.service.api.type.OrderType;
import java.util.Date;
/**
* Created by alexnikolayevsky on 3/5/17.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderDTO {
private Integer id;
private String invoiceId;
private Double price;
private OrderStatus status;
private OrderType type;
private Integer requesterId;
private String billingFirstName;
private String billingLastName;
private String billingEmail;
private String billingPhone;
private AddressDTO billlingAddress;
private Date created;
private Date lastModified;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getInvoiceId() {
return invoiceId;
}
public void setInvoiceId(String invoiceId) {
this.invoiceId = invoiceId;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public OrderStatus getStatus() {
return status;
}
public void setStatus(OrderStatus status) {
this.status = status;
}
public OrderType getType() {
return type;
}
public void setType(OrderType type) {
this.type = type;
}
public Integer getRequesterId() {
return requesterId;
}
public void setRequesterId(Integer requesterId) {
this.requesterId = requesterId;
}
public String getBillingFirstName() {
return billingFirstName;
}
public void setBillingFirstName(String billingFirstName) {
this.billingFirstName = billingFirstName;
}
public String getBillingLastName() {
return billingLastName;
}
public void setBillingLastName(String billingLastName) {
this.billingLastName = billingLastName;
}
public String getBillingEmail() {
return billingEmail;
}
public void setBillingEmail(String billingEmail) {
this.billingEmail = billingEmail;
}
public String getBillingPhone() {
return billingPhone;
}
public void setBillingPhone(String billingPhone) {
this.billingPhone = billingPhone;
}
public AddressDTO getBilllingAddress() {
return billlingAddress;
}
public void setBilllingAddress(AddressDTO billlingAddress) {
this.billlingAddress = billlingAddress;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastModified() {
return lastModified;
}
public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}
}
| [
"[email protected]"
] | |
c9eb4efff5909cb8864a07b20da120258163211b | 2161208d3517dcb5884921c60c581af1c0a0e0a5 | /Multithreading/ThreadDemo2.java | 22e11978c9c0f602c90902065eac9b6651378fb8 | [] | no_license | milindbajaj/javaPrograms | c28856a878f41391468e0aefeb5d5a81026fb2df | ab16f37c9ae817f8d912d56a16a5d5a3b115ee6a | refs/heads/master | 2022-11-08T03:39:17.527957 | 2020-06-07T09:46:09 | 2020-06-07T09:46:09 | 270,259,491 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | public class ThreadDemo2 {
public static void main(String[] args) {
Thread t = Thread.currentThread();
t.setName("Admin Thread");
t.setPriority(1);
System.out.println("Thread = " + t);
int priority= t.getPriority();
System.out.println("Thread priority= " + priority);
int count = Thread.activeCount();
System.out.println("currently active threads = " + count);
}
}
| [
"[email protected]"
] | |
6c41dee4eda7a0452c8365240e4ab0d441d4771c | 23ea1ede5a6f7549917337b679e2b7692dc23d9f | /oasys/src/com/oasys/controller/OrganizationController.java | e7a0746371278d84eae0db284bf4c40d430aa8df | [] | no_license | amtech/learngit | 85099959537626c0271d2a0a84fe1329a5d2da9b | 93e8488d45f1f8d2820aae61f51edc20ee7f9873 | refs/heads/master | 2020-04-26T11:32:37.487749 | 2015-10-21T08:01:23 | 2015-10-21T08:01:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | package com.oasys.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.oasys.service.OrganizationService;
import com.oasys.viewModel.TreeModel;
/**
*
* @ClassName: LoginController
* @Description: TODO
* @Author xujianwei
* @Version 1.0
* @Date 2015年8月17日 下午2:24:06
* 部门
*/
@Controller
@RequestMapping("/Organization")
public class OrganizationController extends BaseController{
@Autowired
private OrganizationService organization;
//部门列表
@ResponseBody
@RequestMapping(value="/organizationList",method=RequestMethod.POST)
public String findMenuList(HttpServletResponse httpServletResponse){
List<TreeModel> organizationList = organization.findOrganizationList();
OutputJson(httpServletResponse,organizationList);
return null;
}
}
| [
"[email protected]"
] | |
d418bbac3b5061d76015602eb8ce0772c3ea5bb9 | 66e01ddd607a0806f1ff09c32d9a0aa24ab8e133 | /src/task4/Tasks.java | 0d19cdccf5d5ed1914787ce0785e75a990fa9e14 | [] | no_license | sergkl1/HomeWork7 | 5c10ddcf5a4b550f088a1934a34ebc4691fde0eb | 075c336faab9b779eacfea15002f1c8113bdd400 | refs/heads/master | 2021-04-15T10:05:48.159246 | 2018-03-29T14:22:41 | 2018-03-29T14:22:41 | 126,626,074 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | package task4;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.function.Predicate;
/**
* Created by sergey.kliepikov on 3/28/18.
*/
public class Tasks {
private final List<Task> tasks = new ArrayList<>();
public void add(Task task) {
tasks.add(task);
}
public void sort(Comparator<Task> comparator) {
tasks.sort(comparator);
}
public List<Task> filter(Predicate<Task> predicate) {
List<Task> result = new ArrayList<>();
for (Task task : tasks) {
if (predicate.test(task)) {
result.add(task);
}
}
return result;
}
@Override
public String toString() {
return "Tasks{" +
"tasks=" + tasks +
'}';
}
}
| [
"[email protected]"
] | |
fae210a81ada412c05f7cae64f826cf7a052c235 | eec17a346f6e030d4e62957ba943dcdc5489ecf6 | /Wrinkle/src/wrinkle/Actor.java | 17209d1dc51c680b30aca52c5669ac7cd8cf46b9 | [] | no_license | peaoat/Wrinkle | ff7b14bb79369f6bc031e9215cca7555cb578242 | 7984c213a17379f22ae1ade9704336d56c5f945e | refs/heads/master | 2021-01-18T10:45:28.250540 | 2011-02-11T07:16:38 | 2011-02-11T07:16:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | /*
* Actor.java
*
* Created on February 8, 2011, 8:54 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package wrinkle;
import java.awt.image.BufferedImage;
import java.awt.geom.*;
/**
*
* @author a.bresee
*/
abstract class Actor extends Collidable{
float velX;
float velY;
float accelX;
float accelY;
float maxVelX;
float maxVelY;
protected BufferedImage cursprite;
protected BufferedImage rightwalk[];
protected BufferedImage leftwalk[];
protected BufferedImage rightidle;
protected BufferedImage leftidle;
protected BufferedImage rightjump;
protected BufferedImage leftjump;
void generateBoundingBox()
{
bBox=new Rectangle2D.Float(x,y,cursprite.getWidth(),cursprite.getHeight());
}
}
| [
"NaOH@.(none)"
] | NaOH@.(none) |
bcfe5fa7278c86065a0a096b71f41aa8aae9202b | a054ce6255898ba049e74ad849ab11ea87f670e8 | /aws-framework/src/main/java/com/elasticm2m/frameworks/aws/kinesis/KinesisReader.java | f3789e50a92d083db74364c1d5fd7ea4100203fc | [] | no_license | aiguang/streamflow-frameworks | d8b9ad815397ee04a5b7380c2daab874220d1683 | 21b6ea6769d430b9d7525f10df9437f7bb22bb15 | refs/heads/master | 2020-12-25T11:58:25.628686 | 2015-06-30T01:04:27 | 2015-06-30T01:04:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,707 | java | package com.elasticm2m.frameworks.aws.kinesis;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.utils.Utils;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream;
import com.amazonaws.services.kinesis.model.Record;
import com.elasticm2m.frameworks.common.base.ElasticBaseRichSpout;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
public class KinesisReader extends ElasticBaseRichSpout {
private String applicationName;
private String streamName;
private String initialPosition = "LATEST";
private boolean isReliable = false;
private AWSCredentialsProvider credentialsProvider;
private ProcessingService processingService;
private final LinkedBlockingQueue<Record> queue = new LinkedBlockingQueue<>();
@Inject
public void setApplicationName(@Named("kinesis-application-name") String applicationName) {
this.applicationName = applicationName;
}
@Inject
public void setStreamName(@Named("kinesis-stream-name") String streamName) {
this.streamName = streamName;
}
@Inject(optional = true)
public void setInitialPosition(@Named("kinesis-initial-position") String initialPosition) {
this.initialPosition = initialPosition;
}
@Inject(optional = true)
public void setIsReliable(@Named("is-reliable") boolean isReliable) {
this.isReliable = isReliable;
}
@Inject(optional = true)
public void setCredentialsProvider(AWSCredentialsProvider credentialsProvider) {
this.credentialsProvider = credentialsProvider;
}
@Override
public void open(Map conf, TopologyContext topologyContext, SpoutOutputCollector collector) {
super.open(conf, topologyContext, collector);
logger.info("Kinesis Reader: Stream Name = " + streamName
+ ", Application Name = " + applicationName
+ ", Initial Position = " + initialPosition
+ ", Is Reliable = " + isReliable);
// Use the default credentials provider
credentialsProvider = new DefaultAWSCredentialsProviderChain();
processingService = new ProcessingService(
credentialsProvider, queue, applicationName, streamName,
InitialPositionInStream.valueOf(initialPosition), logger);
processingService.startAsync();
}
@Override
public void nextTuple() {
Record record = queue.poll();
if (record != null) {
if (isReliable) {
collector.emit(recordToTuple(record), record.getSequenceNumber());
} else {
collector.emit(recordToTuple(record));
}
} else {
Utils.sleep(50);
}
}
public List<Object> recordToTuple(Record record) {
HashMap<String, String> properties = new HashMap<>();
properties.put("sequenceNumber", record.getSequenceNumber());
properties.put("partitionKey", record.getPartitionKey());
List<Object> tuple = new ArrayList<>();
tuple.add(null);
tuple.add(new String(record.getData().array()));
tuple.add(properties);
return tuple;
}
@Override
public void close() {
processingService.stopAsync();
processingService.awaitTerminated();
logger.info("Kinesis Reader Spout Stopped");
}
}
| [
"[email protected]"
] | |
e982e67e8513d4c047d61601d0087e77d3267b6d | f3f958461a72fe06a5c676a6baeed50757de5a7a | /src/main/java/com/integrado/SiscamApplication.java | 35febb3d8697c447f707ab2e75daa2390e9fe99a | [] | no_license | carlosgl2017/siscam | 7c8269d3745a87ec1720c231cf45850ea25011b9 | 7c619139e4931394fc7842ebbb48b4d116ff473e | refs/heads/master | 2023-08-21T10:49:59.724151 | 2021-09-21T20:55:08 | 2021-09-21T20:55:08 | 407,926,045 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package com.integrado;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SiscamApplication {
public static void main(String[] args) {
SpringApplication.run(SiscamApplication.class, args);
}
}
| [
"[email protected]"
] | |
d2562ea6c01668daef4431669d3d70688ced42e8 | bbff23795584111838b25a579fe6a37848d6dd2e | /system/src/main/java/com/theone/scaffolding/system/entity/SysPermission.java | 2352e1420d4054fba42e8f381f3b8707cf148410 | [] | no_license | xiao1tt/spring-boot-scaffolding | 51454e480ce24c6fe7a599b97186b0ad6f2a5c22 | ebb1f66014371beecc14b36459c786663b76c9fe | refs/heads/main | 2023-03-27T19:54:49.359618 | 2021-03-28T12:01:30 | 2021-03-28T12:01:30 | 352,316,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | /*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* 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.theone.scaffolding.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.theone.scaffolding.framework.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;
/**
* <pre>
* 系统权限
* </pre>
*
* @author geekidea
* @since 2019-10-24
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SysPermission extends BaseEntity {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private String name;
private Long parentId;
private String url;
@NotBlank(message = "唯一编码不能为空")
private String code;
private String icon;
@NotNull(message = "类型,1:菜单,2:按钮不能为空")
private Integer type;
@NotNull(message = "层级,1:第一级,2:第二级,N:第N级不能为空")
private Integer level;
private Integer state;
private Integer sort;
private String remark;
@Null(message = "版本不用传")
@Version
private Integer version;
@Null(message = "创建时间不用传")
private Date createTime;
@Null(message = "修改时间不用传")
private Date updateTime;
}
| [
"[email protected]"
] | |
ff05b8ede8a856ffc796fd3c666b2416ffed29b1 | 6a856b1d32e622678c744aed5284e1426f351294 | /src/main/java/co/com/masivian/Dto/ApuestaDto.java | e4eaa41e65f6be153229ece668ac2f5d8a10f5f1 | [] | no_license | oscarospinag/masivian | 65a9c6bf8645cc6bbbe814b25abd56083bb88dee | e731eea5d81cd3ebc7b0dbc34738b777f8b01c38 | refs/heads/master | 2022-11-13T14:37:35.378230 | 2020-07-02T03:09:53 | 2020-07-02T03:09:53 | 276,524,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package co.com.masivian.Dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class ApuestaDto {
private Long id;
private Double value;
private String color;
private int number;
public ApuestaDto() {
}
}
| [
"[email protected]"
] | |
f6d769a93c6ab817d7ff122f2ce005dde335ca04 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_20487.java | 64f9dbbbb3da7d2dca85ef139a8b7869c441b79e | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | /**
* Called by worker task when a tile has loaded. Redraws the view.
*/
private synchronized void onTileLoaded(){
debug("onTileLoaded");
checkReady();
checkImageLoaded();
if (isBaseLayerReady() && bitmap != null) {
if (!bitmapIsCached) {
bitmap.recycle();
}
bitmap=null;
if (onImageEventListener != null && bitmapIsCached) {
onImageEventListener.onPreviewReleased();
}
bitmapIsPreview=false;
bitmapIsCached=false;
}
invalidate();
}
| [
"[email protected]"
] | |
203b46e1ccec451ccb7b62098a111fdf17ad6259 | bda25ce7d08e19c4e6b7a4071a8823f0630fba26 | /Egret_Frame-master/runtime/android/AndroidAs/proj.android/app/src/test/java/org/egret/java/AndroidAs/ExampleUnitTest.java | 5c74fddbb66b4d00051141f165f6a57467c50acf | [] | no_license | fxueye/egret | 3a21884400bf0e8060ec1e8d69497559846a5abe | 439ee610764985abe79dcf0a0683f4cf8a79a9f4 | refs/heads/master | 2021-09-07T22:19:57.585621 | 2018-03-02T02:00:55 | 2018-03-02T02:00:55 | 116,212,354 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package org.egret.java.AndroidAs;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
6cae7ca0ff08e131ae2c02b1644161f8e239bef6 | 220d7a13e6e31090fdb1ad28d52027a6f66c4918 | /src/java.java | ae0f2898a2eb88224327ef23bcdaae8029dad60b | [] | no_license | Srinivasu38/Bhagya | a773edcba732cf6d33cea1bc398c4a3345ec4fa0 | 773512bb7bb660ae3e63c22eb2d580f95cb0b4bd | refs/heads/master | 2021-02-23T04:25:47.354428 | 2020-03-06T10:37:43 | 2020-03-06T10:37:43 | 245,392,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java |
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver.Window;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import com.gargoylesoftware.htmlunit.javascript.host.dom.Document;
public class java {
public static void main(String[] args) throws Throwable {
// TODO Auto-generated method stub
WebDriver driver = new ChromeDriver();
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("window.location = 'https://amazon.com'" );
driver.manage().window().maximize();
Thread.sleep(4000);
//scroll from to top to bottom
js.executeScript("window.scrollTo(0,document.body.scrollHeight)");
Thread.sleep(4000);
//scroll from to bottom to top
js.executeScript("window.scrollTo(document.body.scrollHeight,0)");
Thread.sleep(4000);
//scroll to certain pixxel
js.executeScript("window.scrollBy(0,3000)");
Thread.sleep(4000);
//scroll to particular elements in webpage
WebElement Signinbutton = driver.findElement(By.xpath("//a[contains(text(),'Sign in to see personalized recommendations')]"));
//click on button
Signinbutton.click();
}
}
| [
"[email protected]"
] | |
7fbf663b682dfdc12b9f8bf27ac40b83300e9f69 | 61c9a583e5c7d1769f82d8d8402a61dc45a92fa7 | /myCode/rn-complete-guide-bare/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/google/maps/android/R.java | 20d0cd4218a09b48c19becaa0aab50597b1a0acf | [] | no_license | achliopa/udemy_PracticalReactNativeCourse2019 | b4caf9517c9d00c1379b3950d8d3879a1cb01c0d | d301c369588db339ae1244c1bf6230f503612e2f | refs/heads/master | 2023-01-24T09:41:41.649226 | 2020-01-27T22:07:01 | 2020-01-27T22:07:01 | 220,958,852 | 0 | 0 | null | 2023-01-05T05:52:07 | 2019-11-11T10:44:08 | Java | UTF-8 | Java | false | false | 11,476 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.google.maps.android;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int ambientEnabled = 0x7f03002c;
public static final int buttonSize = 0x7f03005a;
public static final int cameraBearing = 0x7f03005f;
public static final int cameraMaxZoomPreference = 0x7f030060;
public static final int cameraMinZoomPreference = 0x7f030061;
public static final int cameraTargetLat = 0x7f030062;
public static final int cameraTargetLng = 0x7f030063;
public static final int cameraTilt = 0x7f030064;
public static final int cameraZoom = 0x7f030065;
public static final int circleCrop = 0x7f030085;
public static final int colorScheme = 0x7f03009c;
public static final int imageAspectRatio = 0x7f030130;
public static final int imageAspectRatioAdjust = 0x7f030131;
public static final int latLngBoundsNorthEastLatitude = 0x7f030146;
public static final int latLngBoundsNorthEastLongitude = 0x7f030147;
public static final int latLngBoundsSouthWestLatitude = 0x7f030148;
public static final int latLngBoundsSouthWestLongitude = 0x7f030149;
public static final int liteMode = 0x7f030168;
public static final int mapType = 0x7f03016b;
public static final int scopeUris = 0x7f0301ac;
public static final int uiCompass = 0x7f030230;
public static final int uiMapToolbar = 0x7f030231;
public static final int uiRotateGestures = 0x7f030232;
public static final int uiScrollGestures = 0x7f030233;
public static final int uiTiltGestures = 0x7f030235;
public static final int uiZoomControls = 0x7f030236;
public static final int uiZoomGestures = 0x7f030237;
public static final int useViewLifecycle = 0x7f030239;
public static final int zOrderOnTop = 0x7f030247;
}
public static final class color {
private color() {}
public static final int common_google_signin_btn_text_dark = 0x7f05002f;
public static final int common_google_signin_btn_text_dark_default = 0x7f050030;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f050031;
public static final int common_google_signin_btn_text_dark_focused = 0x7f050032;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f050033;
public static final int common_google_signin_btn_text_light = 0x7f050034;
public static final int common_google_signin_btn_text_light_default = 0x7f050035;
public static final int common_google_signin_btn_text_light_disabled = 0x7f050036;
public static final int common_google_signin_btn_text_light_focused = 0x7f050037;
public static final int common_google_signin_btn_text_light_pressed = 0x7f050038;
}
public static final class drawable {
private drawable() {}
public static final int amu_bubble_mask = 0x7f07005c;
public static final int amu_bubble_shadow = 0x7f07005d;
public static final int common_full_open_on_phone = 0x7f070068;
public static final int common_google_signin_btn_icon_dark = 0x7f070069;
public static final int common_google_signin_btn_icon_dark_focused = 0x7f07006a;
public static final int common_google_signin_btn_icon_dark_normal = 0x7f07006b;
public static final int common_google_signin_btn_icon_light = 0x7f07006e;
public static final int common_google_signin_btn_icon_light_focused = 0x7f07006f;
public static final int common_google_signin_btn_icon_light_normal = 0x7f070070;
public static final int common_google_signin_btn_text_dark = 0x7f070072;
public static final int common_google_signin_btn_text_dark_focused = 0x7f070073;
public static final int common_google_signin_btn_text_dark_normal = 0x7f070074;
public static final int common_google_signin_btn_text_light = 0x7f070077;
public static final int common_google_signin_btn_text_light_focused = 0x7f070078;
public static final int common_google_signin_btn_text_light_normal = 0x7f070079;
}
public static final class id {
private id() {}
public static final int adjust_height = 0x7f080045;
public static final int adjust_width = 0x7f080046;
public static final int amu_text = 0x7f08004a;
public static final int auto = 0x7f08004c;
public static final int dark = 0x7f080070;
public static final int hybrid = 0x7f080095;
public static final int icon_only = 0x7f080098;
public static final int light = 0x7f0800a1;
public static final int none = 0x7f0800b0;
public static final int normal = 0x7f0800b1;
public static final int satellite = 0x7f0800cf;
public static final int standard = 0x7f0800f2;
public static final int terrain = 0x7f080101;
public static final int webview = 0x7f080120;
public static final int wide = 0x7f080121;
public static final int window = 0x7f080122;
}
public static final class integer {
private integer() {}
public static final int google_play_services_version = 0x7f090008;
}
public static final class layout {
private layout() {}
public static final int amu_info_window = 0x7f0b001c;
public static final int amu_text_bubble = 0x7f0b001d;
public static final int amu_webview = 0x7f0b001e;
}
public static final class raw {
private raw() {}
public static final int amu_ballon_gx_prefix = 0x7f0e0000;
public static final int amu_basic_folder = 0x7f0e0001;
public static final int amu_basic_placemark = 0x7f0e0002;
public static final int amu_cdata = 0x7f0e0003;
public static final int amu_default_balloon = 0x7f0e0004;
public static final int amu_document_nest = 0x7f0e0005;
public static final int amu_draw_order_ground_overlay = 0x7f0e0006;
public static final int amu_extended_data = 0x7f0e0007;
public static final int amu_ground_overlay = 0x7f0e0008;
public static final int amu_ground_overlay_color = 0x7f0e0009;
public static final int amu_inline_style = 0x7f0e000a;
public static final int amu_multigeometry_placemarks = 0x7f0e000b;
public static final int amu_multiple_placemarks = 0x7f0e000c;
public static final int amu_nested_folders = 0x7f0e000d;
public static final int amu_nested_multigeometry = 0x7f0e000e;
public static final int amu_poly_style_boolean_alpha = 0x7f0e000f;
public static final int amu_poly_style_boolean_numeric = 0x7f0e0010;
public static final int amu_unknwown_folder = 0x7f0e0011;
public static final int amu_unsupported = 0x7f0e0012;
public static final int amu_visibility_ground_overlay = 0x7f0e0013;
}
public static final class string {
private string() {}
public static final int common_google_play_services_enable_button = 0x7f0f003e;
public static final int common_google_play_services_enable_text = 0x7f0f003f;
public static final int common_google_play_services_enable_title = 0x7f0f0040;
public static final int common_google_play_services_install_button = 0x7f0f0041;
public static final int common_google_play_services_install_title = 0x7f0f0043;
public static final int common_google_play_services_notification_ticker = 0x7f0f0045;
public static final int common_google_play_services_unknown_issue = 0x7f0f0046;
public static final int common_google_play_services_unsupported_text = 0x7f0f0047;
public static final int common_google_play_services_update_button = 0x7f0f0048;
public static final int common_google_play_services_update_text = 0x7f0f0049;
public static final int common_google_play_services_update_title = 0x7f0f004a;
public static final int common_google_play_services_updating_text = 0x7f0f004b;
public static final int common_google_play_services_wear_update_text = 0x7f0f004c;
public static final int common_open_on_phone = 0x7f0f004d;
public static final int common_signin_button_text = 0x7f0f004e;
public static final int common_signin_button_text_long = 0x7f0f004f;
}
public static final class style {
private style() {}
public static final int amu_Bubble_TextAppearance_Dark = 0x7f10020c;
public static final int amu_Bubble_TextAppearance_Light = 0x7f10020d;
public static final int amu_ClusterIcon_TextAppearance = 0x7f10020e;
}
public static final class styleable {
private styleable() {}
public static final int[] LoadingImageView = { 0x7f030085, 0x7f030130, 0x7f030131 };
public static final int LoadingImageView_circleCrop = 0;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 2;
public static final int[] MapAttrs = { 0x7f03002c, 0x7f03005f, 0x7f030060, 0x7f030061, 0x7f030062, 0x7f030063, 0x7f030064, 0x7f030065, 0x7f030146, 0x7f030147, 0x7f030148, 0x7f030149, 0x7f030168, 0x7f03016b, 0x7f030230, 0x7f030231, 0x7f030232, 0x7f030233, 0x7f030234, 0x7f030235, 0x7f030236, 0x7f030237, 0x7f030239, 0x7f030247 };
public static final int MapAttrs_ambientEnabled = 0;
public static final int MapAttrs_cameraBearing = 1;
public static final int MapAttrs_cameraMaxZoomPreference = 2;
public static final int MapAttrs_cameraMinZoomPreference = 3;
public static final int MapAttrs_cameraTargetLat = 4;
public static final int MapAttrs_cameraTargetLng = 5;
public static final int MapAttrs_cameraTilt = 6;
public static final int MapAttrs_cameraZoom = 7;
public static final int MapAttrs_latLngBoundsNorthEastLatitude = 8;
public static final int MapAttrs_latLngBoundsNorthEastLongitude = 9;
public static final int MapAttrs_latLngBoundsSouthWestLatitude = 10;
public static final int MapAttrs_latLngBoundsSouthWestLongitude = 11;
public static final int MapAttrs_liteMode = 12;
public static final int MapAttrs_mapType = 13;
public static final int MapAttrs_uiCompass = 14;
public static final int MapAttrs_uiMapToolbar = 15;
public static final int MapAttrs_uiRotateGestures = 16;
public static final int MapAttrs_uiScrollGestures = 17;
public static final int MapAttrs_uiScrollGesturesDuringRotateOrZoom = 18;
public static final int MapAttrs_uiTiltGestures = 19;
public static final int MapAttrs_uiZoomControls = 20;
public static final int MapAttrs_uiZoomGestures = 21;
public static final int MapAttrs_useViewLifecycle = 22;
public static final int MapAttrs_zOrderOnTop = 23;
public static final int[] SignInButton = { 0x7f03005a, 0x7f03009c, 0x7f0301ac };
public static final int SignInButton_buttonSize = 0;
public static final int SignInButton_colorScheme = 1;
public static final int SignInButton_scopeUris = 2;
}
}
| [
"[email protected]"
] | |
35852ef35ccb59ab7172a4e2d1dec797e0febb88 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/hd/ddemp/rec/HD_DDEMP_4000_LCURLISTRecord.java | 97dddeeaa5c0a4a17420e442d5271f0497a64ca4 | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 5,013 | java |
package chosun.ciis.hd.ddemp.rec;
import java.sql.*;
import chosun.ciis.hd.ddemp.dm.*;
import chosun.ciis.hd.ddemp.ds.*;
/**
*
*/
public class HD_DDEMP_4000_LCURLISTRecord extends java.lang.Object implements java.io.Serializable{
public String duty_yymm;
public String mang_no;
public String flnm;
public String prn;
public String ptph_no;
public String octgr_cd;
public String octgr_cd_nm;
public String lve_job_resn_cd;
public String lve_job_resn_cd_nm;
public String duty_dds;
public String pay_amt;
public String dd_amt;
public String time_amt;
public String incm_tax;
public String res_tax;
public String fisc_dt;
public String emp_insr_fee;
public String hlth_insr_fee;
public String np_fee;
public String budg_cd;
public String budg_nm;
public String rmks;
public String actu_slip_no;
public String proc_stat;
public String proc_stat_nm;
public String use_dept_cd;
public String use_dept_nm;
public HD_DDEMP_4000_LCURLISTRecord(){}
public void setDuty_yymm(String duty_yymm){
this.duty_yymm = duty_yymm;
}
public void setMang_no(String mang_no){
this.mang_no = mang_no;
}
public void setFlnm(String flnm){
this.flnm = flnm;
}
public void setPrn(String prn){
this.prn = prn;
}
public void setPtph_no(String ptph_no){
this.ptph_no = ptph_no;
}
public void setOctgr_cd(String octgr_cd){
this.octgr_cd = octgr_cd;
}
public void setOctgr_cd_nm(String octgr_cd_nm){
this.octgr_cd_nm = octgr_cd_nm;
}
public void setLve_job_resn_cd(String lve_job_resn_cd){
this.lve_job_resn_cd = lve_job_resn_cd;
}
public void setLve_job_resn_cd_nm(String lve_job_resn_cd_nm){
this.lve_job_resn_cd_nm = lve_job_resn_cd_nm;
}
public void setDuty_dds(String duty_dds){
this.duty_dds = duty_dds;
}
public void setPay_amt(String pay_amt){
this.pay_amt = pay_amt;
}
public void setDd_amt(String dd_amt){
this.dd_amt = dd_amt;
}
public void setTime_amt(String time_amt){
this.time_amt = time_amt;
}
public void setIncm_tax(String incm_tax){
this.incm_tax = incm_tax;
}
public void setRes_tax(String res_tax){
this.res_tax = res_tax;
}
public void setFisc_dt(String fisc_dt){
this.fisc_dt = fisc_dt;
}
public void setEmp_insr_fee(String emp_insr_fee){
this.emp_insr_fee = emp_insr_fee;
}
public void setHlth_insr_fee(String hlth_insr_fee){
this.hlth_insr_fee = hlth_insr_fee;
}
public void setNp_fee(String np_fee){
this.np_fee = np_fee;
}
public void setBudg_cd(String budg_cd){
this.budg_cd = budg_cd;
}
public void setBudg_nm(String budg_nm){
this.budg_nm = budg_nm;
}
public void setRmks(String rmks){
this.rmks = rmks;
}
public void setActu_slip_no(String actu_slip_no){
this.actu_slip_no = actu_slip_no;
}
public void setProc_stat(String proc_stat){
this.proc_stat = proc_stat;
}
public void setProc_stat_nm(String proc_stat_nm){
this.proc_stat_nm = proc_stat_nm;
}
public void setUse_dept_cd(String use_dept_cd){
this.use_dept_cd = use_dept_cd;
}
public void setUse_dept_nm(String use_dept_nm){
this.use_dept_nm = use_dept_nm;
}
public String getDuty_yymm(){
return this.duty_yymm;
}
public String getMang_no(){
return this.mang_no;
}
public String getFlnm(){
return this.flnm;
}
public String getPrn(){
return this.prn;
}
public String getPtph_no(){
return this.ptph_no;
}
public String getOctgr_cd(){
return this.octgr_cd;
}
public String getOctgr_cd_nm(){
return this.octgr_cd_nm;
}
public String getLve_job_resn_cd(){
return this.lve_job_resn_cd;
}
public String getLve_job_resn_cd_nm(){
return this.lve_job_resn_cd_nm;
}
public String getDuty_dds(){
return this.duty_dds;
}
public String getPay_amt(){
return this.pay_amt;
}
public String getDd_amt(){
return this.dd_amt;
}
public String getTime_amt(){
return this.time_amt;
}
public String getIncm_tax(){
return this.incm_tax;
}
public String getRes_tax(){
return this.res_tax;
}
public String getFisc_dt(){
return this.fisc_dt;
}
public String getEmp_insr_fee(){
return this.emp_insr_fee;
}
public String getHlth_insr_fee(){
return this.hlth_insr_fee;
}
public String getNp_fee(){
return this.np_fee;
}
public String getBudg_cd(){
return this.budg_cd;
}
public String getBudg_nm(){
return this.budg_nm;
}
public String getRmks(){
return this.rmks;
}
public String getActu_slip_no(){
return this.actu_slip_no;
}
public String getProc_stat(){
return this.proc_stat;
}
public String getProc_stat_nm(){
return this.proc_stat_nm;
}
public String getUse_dept_cd(){
return this.use_dept_cd;
}
public String getUse_dept_nm(){
return this.use_dept_nm;
}
}
/* ÀÛ¼º½Ã°£ : Tue Feb 08 19:38:00 KST 2011 */ | [
"[email protected]"
] | |
c3d87bf13169a5e6f2c3d7b1c6a7914d3836961b | 6611c3fce03af3a792d0a161891cfd805d9894d3 | /app/src/androidTest/java/com/example/mikew/rsr/ExampleInstrumentedTest.java | c0692a1346907a594b8534d0ef8182bec8ff36de | [] | no_license | MikeRhodens/RSRClone | 8dd59b94aca956ffd8aed3c507a4b25c2e6ac427 | c6c993fa0b549dcdd04131bbc7cd2d221d32f185 | refs/heads/master | 2021-08-22T15:16:49.598422 | 2017-11-30T14:08:50 | 2017-11-30T14:08:50 | 112,618,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package com.example.mikew.rsr;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.mikew.rsr", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
0c9d2b005525d39b4b45bd2e969ba3112598f13d | c0c306883bf2713c2a9155ebc056245ad818d8b9 | /My-Docking/src/main/java/com/mydocking/service/CategoryService.java | 5f6db642e8f13ff43c0f63b78db95f59fdae4156 | [] | no_license | omshankarswami/Practice | 24b0d8d5de4b044b8a8a9d8a23c030af9121f713 | 9d5190f2471a3bdb8974eb5d6ab23d0175c3bec4 | refs/heads/master | 2022-07-04T02:53:23.295705 | 2019-12-13T10:32:51 | 2019-12-13T10:32:51 | 224,399,640 | 0 | 0 | null | 2022-05-25T23:28:05 | 2019-11-27T09:59:36 | JavaScript | UTF-8 | Java | false | false | 3,846 | java | package com.mydocking.service;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import com.mydocking.exception.FileStorageException;
import com.mydocking.exception.ResourceNotFoundException;
import com.mydocking.model.Category;
import com.mydocking.model.FileStorageProperties;
import com.mydocking.repository.CategoryRepository;
@Service
public class CategoryService {
@Autowired
CategoryRepository repository;
private final Path fileStorageLocation;
@Autowired
public CategoryService(FileStorageProperties fileStorageProperties) {
this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
.toAbsolutePath().normalize();
try {
Files.createDirectories(this.fileStorageLocation);
} catch (Exception ex) {
throw new FileStorageException("Could not create the directory where the uploaded files will be stored.", ex);
}
}
public List<Category> findAll() {
return repository.findAllByOrderByNameAsc();
}
public Category findById(Long categoryId) {
return repository.findById(categoryId).orElseThrow(() -> new ResourceNotFoundException("Category", "id", categoryId));
}
public Category findByName(String categoryName) {
return repository.findByName(categoryName).orElseThrow(() -> new ResourceNotFoundException("Category", "name", categoryName));
}
public List<Category> findAllMainCategories() {
return repository.findAllMainCategories();
}
public List<Category> findSubCategories(Long categoryId) {
return repository.findSubCategories(categoryId);
}
public Category save(Category category) {
return repository.save(category);
}
public ResponseEntity<?> delete(Long categoryId) {
Category category = repository.findById(categoryId).orElseThrow(() -> new ResourceNotFoundException("Category", "id", categoryId));
repository.delete(category);
return ResponseEntity.ok().build();
}
public void storeFile(MultipartFile file) {
String fileName = StringUtils.cleanPath(file.getOriginalFilename());
try {
// Check if the file's name contains invalid characters
if(fileName.contains("..")) {
throw new FileStorageException("Sorry! Filename contains invalid path sequence " + fileName);
}
// Copy file to the target location (Replacing existing file with the same name)
Path targetLocation = this.fileStorageLocation.resolve(file.getOriginalFilename());
Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex) {
throw new FileStorageException("Could not store file " + fileName + ". Please try again!", ex);
}
}
public List<Category> findAllWOSubCategories(Long categoryId) {
return repository.findAllWOSubCategories(categoryId);
}
public void deleteFile(String fileName) {
try {
// Check if the file's name contains invalid characters
if(fileName.contains("..")) {
throw new FileStorageException("Sorry! Filename contains invalid path sequence " + fileName);
}
Path targetLocation = this.fileStorageLocation.resolve(fileName);
Files.delete(targetLocation);
}catch (IOException ex) {
throw new FileStorageException("Could not delete file " + fileName + ". Please try again!", ex);
}
}
public Category findByNameForUpload(String cname) {
return repository.findByNameForUpload(cname);
}
} | [
"[email protected]"
] | |
29f0e930d6658209e1089a1ed7197dbf85d20819 | 9c24963d818a03422ba4db661aad16cca9e23d89 | /src/main/java/com/demo/springboot2/c5database/beetl/UserController.java | 14f97a1a6c56a20acac05b6d0e6b1d7dced5658a | [] | no_license | yhb2010/springboot2.0_demo | ced9d9a2870190fe90bddd31fb97463c141912ff | fe6adf5956615eb512cb9dbc7db39f760964c3c3 | refs/heads/master | 2020-04-09T16:46:59.639887 | 2018-12-12T11:19:08 | 2018-12-12T11:19:08 | 160,462,721 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.demo.springboot2.c5database.beetl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import com.demo.springboot2.c5database.beetl.service.UserService;
@RestController
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/user/credit/{id}")
public Integer getCredit(@PathVariable int id){
return userService.getCredit(id);
}
} | [
"[email protected]"
] | |
b03d8b53479ce4d086102e3e1cb89d792a682340 | a4f6291e5d7be4caf4777714b23beed12e43aad0 | /src/main/java/com/example/catalogservice/entity/CatalogEntity.java | 8f96eed3d15fe9a0502d9782db91fc3e8cfa415e | [] | no_license | moon-th/catalog-service | be228c5a3b26b0dfcaf2b1ffb581897d1e7ef913 | 3f76591b2612fd2edf9ed11acc4ebff843b12edd | refs/heads/master | 2023-06-18T22:20:11.742825 | 2021-07-19T13:29:24 | 2021-07-19T13:29:24 | 387,474,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 832 | java | package com.example.catalogservice.entity;
import lombok.Data;
import org.hibernate.annotations.ColumnDefault;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import static javax.persistence.GenerationType.IDENTITY;
@Data
@Entity
@Table(name = "catalog")
public class CatalogEntity implements Serializable {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;
@Column(nullable = false,length = 120,unique = true)
private String productId;
@Column(nullable = false)
private String productName;
@Column(nullable = false)
private Integer stock;
@Column(nullable = false)
private Integer unitPrice;
@Column(nullable = false,updatable = false,insertable = false)
@ColumnDefault(value = "CURRENT_TIMESTAMP")
private Date createdAt;
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.